decocms 3.99.1 → 3.99.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-VcwplCRi.js → AlertCircle-D8nl7USt.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CAv7CUnJ.js → ArrowUpRight-DgG9Xs3P.js} +1 -1
- package/dist/client/assets/{CheckCircle-V30FMM2D.js → CheckCircle-yOjX9PZe.js} +1 -1
- package/dist/client/assets/{ChevronDown-URo4LveF.js → ChevronDown-DXzUoD2e.js} +1 -1
- package/dist/client/assets/{ChevronLeft-aMkPes9N.js → ChevronLeft-DopUTXew.js} +1 -1
- package/dist/client/assets/{ChevronRight-oz8o6WPV.js → ChevronRight-j760Iee-.js} +1 -1
- package/dist/client/assets/{ChevronUp-HJUE3-BD.js → ChevronUp-CADhYHt4.js} +1 -1
- package/dist/client/assets/{DotsVertical-QF46dzdi.js → DotsVertical-AD-a2Knc.js} +1 -1
- package/dist/client/assets/{Eye-BSiFxHQB.js → Eye-CQQama2s.js} +1 -1
- package/dist/client/assets/{FilterLines-CEzORaPw.js → FilterLines-CehUrsTR.js} +1 -1
- package/dist/client/assets/{Globe01-wGomueqV.js → Globe01-CaIgPTxT.js} +1 -1
- package/dist/client/assets/{Globe04-CsKOsQ4z.js → Globe04-CuT114AV.js} +1 -1
- package/dist/client/assets/{HardDrive-BuI4Q48l.js → HardDrive-lZvAMErY.js} +1 -1
- package/dist/client/assets/{Key01-r6MDYdDw.js → Key01-BAEB0MKB.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BFxGsVdk.js → LayoutLeft-Fadct960.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BWnRnxGs.js → LinkExternal01-Dh2g8Xye.js} +1 -1
- package/dist/client/assets/{Monitor01-SEZLDRFN.js → Monitor01-_MTiHAuD.js} +1 -1
- package/dist/client/assets/{Palette-CEjENuG4.js → Palette-hlsbFMfV.js} +1 -1
- package/dist/client/assets/{Play-BDoh8EAp.js → Play-CfbRRa8r.js} +1 -1
- package/dist/client/assets/{Plus-Bw9lc6SR.js → Plus-CdiQoMoJ.js} +1 -1
- package/dist/client/assets/{SearchMd-BMfw7gZ4.js → SearchMd-D1HSgOeu.js} +1 -1
- package/dist/client/assets/{Settings02-DbH9OAzT.js → Settings02-D-O2SNJf.js} +1 -1
- package/dist/client/assets/{Shield01-C1R4fpvK.js → Shield01-DOrMIO9W.js} +1 -1
- package/dist/client/assets/{Star01-BwAv907s.js → Star01-BNUohd1g.js} +1 -1
- package/dist/client/assets/{Stars01-D1icdaCh.js → Stars01-DMt3zew5.js} +1 -1
- package/dist/client/assets/{Stars02-PPXsboxW.js → Stars02-BUidkUMX.js} +1 -1
- package/dist/client/assets/{Sun-Dw86eVev.js → Sun-CrWUbEJD.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-F_1MjTR3.js → SwitchHorizontal01-CB8Z7BL9.js} +1 -1
- package/dist/client/assets/{Tool01-DvTGD1Yt.js → Tool01-Dt-TbXDn.js} +1 -1
- package/dist/client/assets/{Trash01-d58N8w5a.js → Trash01-BVvGX_KK.js} +1 -1
- package/dist/client/assets/{Upload01-C_hHbDSF.js → Upload01-Prj9a2xY.js} +1 -1
- package/dist/client/assets/{User01-BDtU1dk1.js → User01-CaU7xtcd.js} +1 -1
- package/dist/client/assets/{Users01-PX3eYoC8.js → Users01-BRnzISUs.js} +1 -1
- package/dist/client/assets/{Users03-CL71IAQ8.js → Users03-DwMxpPU3.js} +1 -1
- package/dist/client/assets/{X-D7X7Z50V.js → X-C-TqNtc2.js} +1 -1
- package/dist/client/assets/{XCircle-PlbEvjyp.js → XCircle-DAqTWvWp.js} +1 -1
- package/dist/client/assets/{XClose-BbuWQhNb.js → XClose-DlK2hm1P.js} +1 -1
- package/dist/client/assets/{Zap-BQKeuD4l.js → Zap-5n0DTezT.js} +1 -1
- package/dist/client/assets/{ZapSquare-CvkoTQDM.js → ZapSquare-DD_XuIyF.js} +1 -1
- package/dist/client/assets/{ZoomOut-DxqRFWA_.js → ZoomOut-VAm9p2Hl.js} +1 -1
- package/dist/client/assets/{access-gate-6AWas-Ss.js → access-gate-Bb0qjuIO.js} +1 -1
- package/dist/client/assets/{add-section-modal-jgpkoBcW.js → add-section-modal-ZfYc_Xn6.js} +1 -1
- package/dist/client/assets/{agent-icon-B2N3zGQH.js → agent-icon-Tlh3oNKM.js} +1 -1
- package/dist/client/assets/{agents-list-Cd9i8250.js → agents-list-DG6ttARV.js} +1 -1
- package/dist/client/assets/{ai-providers-CG207wTX.js → ai-providers-KlM-uWQ0.js} +1 -1
- package/dist/client/assets/{alert-Cg3WXwSx.js → alert-19iuIUZ1.js} +1 -1
- package/dist/client/assets/{alert-dialog-DvWgcmQI.js → alert-dialog-DESqZhA2.js} +1 -1
- package/dist/client/assets/{app-editor-tLSi5KV_.js → app-editor-C0ZGI6j9.js} +1 -1
- package/dist/client/assets/{auth-DZDiXt1m.js → auth-BR3aJLVt.js} +1 -1
- package/dist/client/assets/{auth-catchall-kuEh1_rd.js → auth-catchall-DV_XFERR.js} +1 -1
- package/dist/client/assets/{auth-entry-CavsOUDq.js → auth-entry-WLY89UlS.js} +1 -1
- package/dist/client/assets/{auth-split-layout-dFpcxyJe.js → auth-split-layout-D8MR1i_O.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CGYbK6H8.js → authenticate-and-persist-oauth-DlE0FF2e.js} +1 -1
- package/dist/client/assets/{automation-list-row-CAUoBpVq.js → automation-list-row-D2uPOFxN.js} +1 -1
- package/dist/client/assets/{automation-runs-DyKvgj21.js → automation-runs-irK0CDv6.js} +1 -1
- package/dist/client/assets/{automations-wXAz-GXj.js → automations-DLGkAvdI.js} +1 -1
- package/dist/client/assets/{avatar-Dv3IrttI.js → avatar-DKl_SvPY.js} +1 -1
- package/dist/client/assets/{badge-toKsUzoB.js → badge-CPOFnH5f.js} +1 -1
- package/dist/client/assets/{block-document-DRbnuwCo.js → block-document-C_nFcvPT.js} +1 -1
- package/dist/client/assets/{brand-context-BaVxi4M4.js → brand-context-CmJN3ec7.js} +1 -1
- package/dist/client/assets/{buckets-BKwGKvkZ.js → buckets-BEbuFGaG.js} +1 -1
- package/dist/client/assets/{capability-load-error-BRyHg_Rt.js → capability-load-error-BULhLJ9o.js} +1 -1
- package/dist/client/assets/{card-Chq65iX4.js → card-CCz6n2PT.js} +1 -1
- package/dist/client/assets/{category-editor-LeiO5-YX.js → category-editor-BEu80DLc.js} +1 -1
- package/dist/client/assets/{chat-context-Bspy4m-d.js → chat-context-C-somJSY.js} +1 -1
- package/dist/client/assets/{checkbox-KUrNOBQk.js → checkbox-DXMAgfVg.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B36KwAFt.js → cli-auth-success-Dv2HlRuI.js} +1 -1
- package/dist/client/assets/{collection-detail-CbhoYXmP.js → collection-detail-BunbCR6D.js} +1 -1
- package/dist/client/assets/{collection-display-button-DNbt3d2y.js → collection-display-button-DsLpaXK_.js} +1 -1
- package/dist/client/assets/{collection-search-BPoBI_I5.js → collection-search-9Z9J-flr.js} +1 -1
- package/dist/client/assets/{collection-tabs-FH3-RtUV.js → collection-tabs-BkVwtVd6.js} +1 -1
- package/dist/client/assets/{command-DMsCjDdA.js → command-CD_UfdIZ.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Cv30K_3D.js → commerce-onboarding-BiVomJ-b.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-G37q3fkg.js → connect-desktop-dialog-DhsRqyJo.js} +1 -1
- package/dist/client/assets/{connection-card-BG_Nwlzj.js → connection-card-Cm-r3F3U.js} +1 -1
- package/dist/client/assets/{connection-detail-oU0C71F8.js → connection-detail-C_0Hpkc4.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DLOiycDJ.js → connection-form-helpers-CzldBL3R.js} +1 -1
- package/dist/client/assets/{connections-BgFAjnb1.js → connections-Be1_sFRI.js} +1 -1
- package/dist/client/assets/{context-menu-BRDnNrnF.js → context-menu-BMjlqCBa.js} +1 -1
- package/dist/client/assets/{decopilot-DfFzELja.js → decopilot-CzHxKRA2.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-TIer_srZ.js → decopilot-sse-pool-9lyDYS1g.js} +1 -1
- package/dist/client/assets/{dialog-CxQBoX40.js → dialog-BYnY80tb.js} +1 -1
- package/dist/client/assets/{domain-settings-gFWo85oP.js → domain-settings-Be5Onfyn.js} +1 -1
- package/dist/client/assets/{drawer-CoRZTii0.js → drawer-DSWLLvbj.js} +1 -1
- package/dist/client/assets/{dropdown-menu-5CWPgj7f.js → dropdown-menu-B_-Um9OQ.js} +1 -1
- package/dist/client/assets/{empty-state-B-ezQrZT.js → empty-state-Di1r-g_a.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BaXkJtVr.js → extract-connection-data-sR3PfR1q.js} +1 -1
- package/dist/client/assets/{file-explorer-CwlDpz6e.js → file-explorer-hz_GCFqU.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cd8oKt-R.js → file-type-icon-MmuXAAgi.js} +1 -1
- package/dist/client/assets/{files-CkNnfKPK.js → files-D4PhY45Y.js} +1 -1
- package/dist/client/assets/{form-CpFt_4sy.js → form-DyV_U4Fx.js} +1 -1
- package/dist/client/assets/{general-9kWrBaDN.js → general-CBtZaIU7.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CvyWRbaM.js → github-repo-picker-B4YgsSnm.js} +1 -1
- package/dist/client/assets/{hooks-BAG9TZjZ.js → hooks-B4h0KjiG.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-ga5lUGZx.js → import-from-deco-dialog-DQBHcufQ.js} +1 -1
- package/dist/client/assets/{index-BLMNER8l.js → index--rRbpAQ9.js} +1 -1
- package/dist/client/assets/{index-DZCgQXLz.js → index-2MM6p12e.js} +1 -1
- package/dist/client/assets/{index-CiVkOVzW.js → index-53LWl5CV.js} +6 -6
- package/dist/client/assets/{index-BAfXUZ9K.js → index-9DIboil-.js} +1 -1
- package/dist/client/assets/{index-ALZP0-mx.js → index-BG_EZ_gC.js} +1 -1
- package/dist/client/assets/{index-DPI_0XE-.js → index-BSpZjkyI.js} +1 -1
- package/dist/client/assets/{index-I8Uum3Jx.js → index-C5w7M3ak.js} +3 -3
- package/dist/client/assets/{index-DS2I5JM3.js → index-C94qgHMJ.js} +1 -1
- package/dist/client/assets/{index-BwC0cAdP.js → index-CfIbeCCb.js} +1 -1
- package/dist/client/assets/{index-DUdLsOJu.js → index-Cx9raLNH.js} +1 -1
- package/dist/client/assets/{index-BU8Nad-n.js → index-DJPcb21Y.js} +1 -1
- package/dist/client/assets/{index-JhgoGL0k.js → index-Dsuwnck-.js} +1 -1
- package/dist/client/assets/{index-C_Ih0jtP.js → index-T5P3sRB3.js} +1 -1
- package/dist/client/assets/{index-BeB2S664.js → index-mv0f5ZIA.js} +1 -1
- package/dist/client/assets/{index-redirect-CP9ATXDl.js → index-redirect-D6vRUTKb.js} +1 -1
- package/dist/client/assets/{input-CutcETvq.js → input-agFYfi3v.js} +1 -1
- package/dist/client/assets/{integration-icon-D3W1euXX.js → integration-icon-CE7Y49fT.js} +1 -1
- package/dist/client/assets/{label-DtGUWURu.js → label-A5aaknkU.js} +1 -1
- package/dist/client/assets/{login-DUTSfri0.js → login-Ccc0MFum.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CSZ5TVrK.js → mcp-oauth-BsM22i8Z.js} +1 -1
- package/dist/client/assets/{members-Dq59tJj1.js → members-Cxv-yFRF.js} +1 -1
- package/dist/client/assets/{monaco-editor-x5JEAvo5.js → monaco-editor-CK4_aHmD.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BsPY2-bU.js → monitoring-stats-row-C_tu4yGv.js} +1 -1
- package/dist/client/assets/{oauth-callback-BXF1WEWL.js → oauth-callback-BGRjz4pz.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-MpQ7zAqW.js → oauth-callback-ai-provider-D6VPZnFo.js} +1 -1
- package/dist/client/assets/{onboarding-CKZFzjtY.js → onboarding-DuFslM5N.js} +1 -1
- package/dist/client/assets/{org-install-DVysq6Hz.js → org-install-HxIFGE3M.js} +1 -1
- package/dist/client/assets/{org-layout-hE5dYTZz.js → org-layout-Bz6JE5ap.js} +1 -1
- package/dist/client/assets/{organization-choice-y8WYOYM0.js → organization-choice-BtKnPkHP.js} +1 -1
- package/dist/client/assets/{page-seo-form-gPXTm6pw.js → page-seo-form-DjBw0txl.js} +1 -1
- package/dist/client/assets/page-seo-sheet-Ddik0L9a.js +1 -0
- package/dist/client/assets/{popover-C8AJAJSa.js → popover-DXCLs7Mh.js} +1 -1
- package/dist/client/assets/{post-editor-DrZmKifS.js → post-editor-aN1M0k3q.js} +1 -1
- package/dist/client/assets/{preview-dialog-D1-LAakL.js → preview-dialog-DwVGd6qW.js} +1 -1
- package/dist/client/assets/{primitives-D7qGIw1V.js → primitives-DHDblW6s.js} +1 -1
- package/dist/client/assets/{profile-DwtHhCaD.js → profile-BHOgJciD.js} +1 -1
- package/dist/client/assets/project-app-view-Dds52VxM.js +1 -0
- package/dist/client/assets/record-editor-DWU1kNnR.js +1 -0
- package/dist/client/assets/registry-BQ5Yq-6B.js +2 -0
- package/dist/client/assets/{registry-layout-CZALtE-Q.js → registry-layout-DQnSen4T.js} +1 -1
- package/dist/client/assets/{require-capability-DAovjPYR.js → require-capability-DyXOtXgQ.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BFGUeccA.js → required-auth-layout-CluuNdrt.js} +1 -1
- package/dist/client/assets/{reset-password-CrnrgmIx.js → reset-password-CfcV_Ol7.js} +1 -1
- package/dist/client/assets/{roles-DRg1cyfq.js → roles-BCXCHheI.js} +1 -1
- package/dist/client/assets/{save-status-BmnvufMt.js → save-status-Dg-HdKmb.js} +1 -1
- package/dist/client/assets/{scroll-area-DnauLcxE.js → scroll-area-BFd5bzOG.js} +1 -1
- package/dist/client/assets/{search-input-BVF4N9EW.js → search-input-DBcneL-Z.js} +1 -1
- package/dist/client/assets/{secrets-DPqx_gXC.js → secrets-DKKr0DS-.js} +1 -1
- package/dist/client/assets/{sections-editor-BLU0buUC.js → sections-editor-Da2BXnWh.js} +1 -1
- package/dist/client/assets/{select-CeO9pIG_.js → select--NMtIJXa.js} +1 -1
- package/dist/client/assets/{select-model-mprfSN1i.js → select-model-B8wcKRbd.js} +1 -1
- package/dist/client/assets/{seo-editor-Dyh0ncgL.js → seo-editor-CpXgkLht.js} +1 -1
- package/dist/client/assets/{settings-layout-BcPbOkgS.js → settings-layout-kC9Zv916.js} +1 -1
- package/dist/client/assets/{settings-section-B3kXnqLg.js → settings-section-Cv3fX46A.js} +1 -1
- package/dist/client/assets/{sheet-CaSXRGPU.js → sheet-CG7AqhVD.js} +1 -1
- package/dist/client/assets/{shell-controls-D2Qn9uVj.js → shell-controls-BD9OqBnx.js} +1 -1
- package/dist/client/assets/{shell-layout-BgovnITR.js → shell-layout-Cz9jaH1b.js} +1 -1
- package/dist/client/assets/{shell-route-loading-w2qYEgt-.js → shell-route-loading-DX7cr59C.js} +1 -1
- package/dist/client/assets/{sidebar-BNKGZwsk.js → sidebar-C8Zfra_F.js} +1 -1
- package/dist/client/assets/{skeleton-1BUBAFib.js → skeleton-sBC4lQNI.js} +1 -1
- package/dist/client/assets/{sortable.esm-BQBGtGRV.js → sortable.esm-YhwgmY_a.js} +1 -1
- package/dist/client/assets/{sso-B5RA5Egt.js → sso-CMBwbNfn.js} +1 -1
- package/dist/client/assets/{store-Ni3ANns9.js → store-Cl_1LRh_.js} +1 -1
- package/dist/client/assets/store-registry-B8Uu7fXQ.js +2 -0
- package/dist/client/assets/{studio-tools-bjPFQfXc.js → studio-tools-BJLBgOee.js} +1 -1
- package/dist/client/assets/{switch-B9PlH85E.js → switch-V6piMM6A.js} +1 -1
- package/dist/client/assets/{table-Bh38Wtyx.js → table-CO4yX7RA.js} +1 -1
- package/dist/client/assets/{tabs-C0RM8s7M.js → tabs-DGpCIiez.js} +1 -1
- package/dist/client/assets/{task-status-sw3Y4pwg.js → task-status-CyBXqR4E.js} +1 -1
- package/dist/client/assets/{textarea-CvR7iHW3.js → textarea-Dgff3Gg2.js} +1 -1
- package/dist/client/assets/{toggle-group-qpErv2AC.js → toggle-group-DRhh44eR.js} +1 -1
- package/dist/client/assets/{toolbar-CB27CeHy.js → toolbar-QoRJzy-G.js} +1 -1
- package/dist/client/assets/{tooltip-Cs84Kx7a.js → tooltip-CgNWIJOM.js} +1 -1
- package/dist/client/assets/{types-pQkRXbdZ.js → types-CXz6VYrK.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BgadC07_.js → use-ai-providers-Dw8zktiy.js} +1 -1
- package/dist/client/assets/{use-automations-P1MHR3DS.js → use-automations-1dr86I_A.js} +1 -1
- package/dist/client/assets/{use-capability-BUm2GwYJ.js → use-capability-DVHDSFWa.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DNfOIVGO.js → use-clock-tick-CmvqvAhs.js} +1 -1
- package/dist/client/assets/{use-collections-KLUYE1x1.js → use-collections-BYKClwvP.js} +1 -1
- package/dist/client/assets/{use-connection-BcZ8SPdu.js → use-connection-BnTFSsXk.js} +1 -1
- package/dist/client/assets/{use-copy-3_Rhxcs5.js → use-copy-Cz-l8dwG.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BUg1GOjA.js → use-create-virtual-mcp-Dc3lK-qn.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CSkDAooO.js → use-debounced-autosave-mT469Qcu.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CRtYZbhZ.js → use-delete-connection-Tmvu17mo.js} +1 -1
- package/dist/client/assets/{use-file-configs-YBpYKsXP.js → use-file-configs-BY2cpVcw.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BJoUj4tJ.js → use-infinite-scroll-10P3vgT3.js} +1 -1
- package/dist/client/assets/{use-join-requests-7lEKJyAD.js → use-join-requests-CrmgeiIm.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bq9g8m5J.js → use-mcp-client-Ci_r6Z9X.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-B5FIxmOZ.js → use-mcp-prompts-Brfbccg_.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-LraQQ1bu.js → use-mcp-tools-C3Vng-X-.js} +1 -1
- package/dist/client/assets/{use-members-D283HZiN.js → use-members-B81Cwsvd.js} +1 -1
- package/dist/client/assets/{use-mobile-C0mpADhR.js → use-mobile-COxfHS-K.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CRQ9sIAj.js → use-navigate-to-agent-Cp82Pt97.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-WATciLg3.js → use-org-auth-client-C5HFWhiz.js} +1 -1
- package/dist/client/assets/{use-org-sso-HWNvOeDC.js → use-org-sso-BrX2nnoi.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cyp5dthQ.js → use-organization-roles-kcsQY_C9.js} +1 -1
- package/dist/client/assets/{use-organization-settings-oh1iUWuA.js → use-organization-settings-D1CXb2Mk.js} +1 -1
- package/dist/client/assets/{use-registry-connections-d6Abj3O4.js → use-registry-connections-DxwnrcKA.js} +1 -1
- package/dist/client/assets/{use-secrets-CkVHtz_G.js → use-secrets-B-XWgN3K.js} +1 -1
- package/dist/client/assets/{use-status-sounds-MBoAiBsc.js → use-status-sounds-SD_W2P9L.js} +1 -1
- package/dist/client/assets/{use-view-mode-Dhn_wt1k.js → use-view-mode-C99Hv44a.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C5aoCVVQ.js → use-virtual-mcp-C76Ypnz5.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dd70hn1g.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-8qs6htsj.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-C6KWJru5.js → useSuspenseQueries-CT-DHsCI.js} +1 -1
- package/dist/client/assets/{variant-calendar-krPIZ_Rp.js → variant-calendar-BHRaDzz9.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DTMt6lCZ.js → view-mode-toggle-XGoB5RsL.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/page-seo-sheet-CpMq28JR.js +0 -1
- package/dist/client/assets/project-app-view-H9YA_3uu.js +0 -1
- package/dist/client/assets/record-editor-C64a4aNL.js +0 -1
- package/dist/client/assets/registry-CxYUBbU6.js +0 -2
- package/dist/client/assets/store-registry-kIHn_jDR.js +0 -2
- package/dist/client/assets/useInfiniteQuery-RfoATJAI.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DBiSYggu.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-
|
|
2
|
-
import{c as F,r as M,l as le,j as n,i as Oe,D as Fe,a as Hi,E as Jt,b as Vt,u as no,e as J0,C as ef,L as tf,k as Ps,K as Tt,m as di,a6 as ro,a7 as sf,q as nf,t as ue,B as ie,a8 as X0,a9 as rf,aa as of,w as Ye,ab as Z0,ac as af,ad as oo,ae as Pn,af as Ut,ag as lf,p as Q0,n as cf,G as ed,ah as Wt,V as td,ai as df,Y as hf,a3 as sd,_ as uf,aj as ff,W as mf,ak as pf,d as hi,o as br,al as gn,s as os,am as cs,F as gf}from"./index-I8Uum3Jx.js";import{C as ot,a as _f,w as Lf,u as hl,s as ca,T as vf,b as xf,g as yf,c as bf}from"./index-C_Ih0jtP.js";import{u as ui,a as Ds,b as ul,c as id,S as fl,t as Sf,d as wf}from"./chat-context-Bspy4m-d.js";import{i as Ui}from"./AlertCircle-VcwplCRi.js";import{i as nd}from"./CheckCircle-V30FMM2D.js";import{n as P9}from"./ChevronLeft-aMkPes9N.js";import{a as Cf,b as kf,i as jf}from"./XCircle-PlbEvjyp.js";import{s as Vs}from"./XClose-BbuWQhNb.js";import{a as xs,u as ml,b as rd,c as Nf}from"./use-virtual-mcp-C5aoCVVQ.js";import{c as Ef,u as Tf,a as od,O as Af,t as da,S as Wi,T as Rf,b as ad,R as Pf,C as Df,G as If,d as Mf,i as Bf,E as Of,g as $f,s as zf,e as Ff,f as Hf,h as Uf}from"./scroll-area-DnauLcxE.js";import{I as ys}from"./integration-icon-D3W1euXX.js";import{a as ld,u as Pt,S as pl,b as Wf,c as Vf,i as Kf,d as cd}from"./use-mcp-client-Bq9g8m5J.js";import{a as qf}from"./Users03-CL71IAQ8.js";import{t as ds}from"./ChevronDown-URo4LveF.js";import{u as Gf,h as Yf,a as qn,i as dd,j as ni,g as Jf,A as Xf,b as hd,c as Ar,K as ud,P as fd,D as md,d as pd,S as gd,v as _d,k as Ld,l as ha,e as vd,C as xd,s as yd,m as Zf,n as Qf}from"./sortable.esm-BQBGtGRV.js";import{u as bd}from"./use-ai-providers-BgadC07_.js";import{u as e2}from"./connect-desktop-dialog-G37q3fkg.js";import{r as t2,b as gl,i as s2}from"./shell-layout-BgovnITR.js";import{u as _l}from"./use-mobile-C0mpADhR.js";import{u as i2}from"./use-status-sounds-MBoAiBsc.js";import{E as Rr}from"./empty-state-B-ezQrZT.js";import{r as ua,a as n2,p as Sd,f as D9,b as wd,c as Cd,d as kd,e as r2,F as o2,i as a2,g as l2,h as jd,j as Nd}from"./tab-id-BptcWVWa.js";import{u as Ed,a as Td}from"./hooks-BAG9TZjZ.js";import{T as I9,a as _n}from"./toolbar-CB27CeHy.js";import{u as c2,a as d2,b as h2,c as u2,g as f2,d as Ad,e as M9,f as m2,F as p2,h as g2,i as _2,j as L2,k as v2,l as x2,m as y2,H as b2,L as S2,R as Rd,n as w2,o as C2,T as Ll,p as k2,q as j2}from"./preview-dialog-D1-LAakL.js";import{g as Dn,h as vl,j as Pd,k as N2,p as ao,l as fi,m as xl,n as Dd,o as fa,q as To,r as B9,A as O9,s as E2,t as T2,u as A2,v as R2,w as P2,x as Id,y as D2,z as I2,B as M2,C as B2,D as Vi,E as O2,F as $9,G as z9,H as $2,e as z2,I as F2,J as H2,K as Ti,L as Pr,M as lo,N as U2,O as W2,P as V2,Q as K2,R as q2,S as G2,T as Md,U as Di,V as F9,W as Bd,X as yl,Y as Y2,Z as J2,_ as X2,$ as Z2,a0 as Q2,a1 as em,a2 as H9,a3 as tm,a4 as sm,a5 as im,a6 as Od,a7 as nm}from"./agent-icon-B2N3zGQH.js";import{a as Ee,b as Te,T as Ae,c as $d}from"./tooltip-Cs84Kx7a.js";import{i as Ki,n as rm}from"./Globe01-wGomueqV.js";import{i as zd}from"./Monitor01-SEZLDRFN.js";import{u as Gn,a as bl,b as Fd}from"./use-connection-BcZ8SPdu.js";import{u as co,a as Hd,b as Ud}from"./use-mcp-tools-LraQQ1bu.js";import{g as Wd}from"./types-pQkRXbdZ.js";import{u as mi}from"./studio-tools-bjPFQfXc.js";import{e as Sl}from"./backoff-CrEUbyZT.js";import{u as om}from"./use-capability-BUm2GwYJ.js";import{F as Ii,M as wl,O as am}from"./file-type-icon-Cd8oKt-R.js";import{P as bs,a as Ss,b as ws}from"./popover-C8AJAJSa.js";import{b as Ct,c as Et,S as kt,a as et,d as jt}from"./select-CeO9pIG_.js";import{D as Qt,a as es,b as ts,c as We,d as ma,e as pa,f as ga,g as Cn,h as ir,i as ho,j as U9}from"./dropdown-menu-5CWPgj7f.js";import{a as Ot,b as $t,c as is,d as ns,D as qs,e as qi}from"./dialog-CxQBoX40.js";import{I as ze}from"./input-CutcETvq.js";import{T as Hs,a as uo,b as Ai,c as fo}from"./tabs-C0RM8s7M.js";import{T as In}from"./textarea-CvR7iHW3.js";import{a as Xt,s as lm}from"./Eye-BSiFxHQB.js";import{t as ti}from"./Stars01-D1icdaCh.js";import{l as cm,w as dm}from"./index-DPI_0XE-.js";import{i as Gi}from"./ChevronRight-oz8o6WPV.js";import{b as _a,c as Vd,d as Cl}from"./ZoomOut-DxqRFWA_.js";import{S as hm}from"./shell-route-loading-w2qYEgt-.js";import{a as um}from"./extract-connection-data-BaXkJtVr.js";import{A as Ao}from"./avatar-Dv3IrttI.js";import{T as Kd,u as qd,I as fm,R as mm,a as pm}from"./index-JhgoGL0k.js";import{a as gm,i as W9}from"./mcp-oauth-CSZ5TVrK.js";import{s as Gd,g as _m}from"./connection-slug-eyAPH6o3.js";import{f as Dr,a as Ir,b as Mr,c as Br,d as Or,e as $r,A as zr,g as Fr}from"./alert-dialog-DvWgcmQI.js";import{C as kl,a as Hr}from"./card-Chq65iX4.js";import{L as $e}from"./label-DtGUWURu.js";import{S as Mn}from"./switch-B9PlH85E.js";import{i as Mi}from"./Play-BDoh8EAp.js";import{s as Dt}from"./Plus-Bw9lc6SR.js";import{a as Lm,b as Yd}from"./Settings02-DbH9OAzT.js";import{s as ss}from"./Trash01-d58N8w5a.js";import{u as Ur}from"./use-debounced-autosave-CSkDAooO.js";import{i as Bn}from"./SearchMd-BMfw7gZ4.js";import{i as Yn}from"./Upload01-C_hHbDSF.js";import{i as vm}from"./LayoutLeft-BFxGsVdk.js";import{P as ls}from"./index-BU8Nad-n.js";import{C as Yi}from"./checkbox-KUrNOBQk.js";import{S as jl}from"./search-input-BVF4N9EW.js";import{C as Jd}from"./collection-tabs-FH3-RtUV.js";import{u as xm}from"./use-mcp-prompts-B5FIxmOZ.js";import{b as ym,a as bm,D as Sm}from"./drawer-CoRZTii0.js";import{i as Ls}from"./ChevronUp-HJUE3-BD.js";import{i as Nl}from"./Key01-r6MDYdDw.js";import{a as Xd,G as wm,u as Cm}from"./github-repo-picker-CvyWRbaM.js";import{S as El}from"./skeleton-1BUBAFib.js";import{s as km}from"./User01-BDtU1dk1.js";import{t as Tl}from"./Users01-PX3eYoC8.js";import{u as jm,a as Nm}from"./use-secrets-CkVHtz_G.js";import{f as Em}from"./formatDistanceToNow-Cb2QZZJn.js";import{n as pi}from"./LinkExternal01-BWnRnxGs.js";import{s as ri}from"./Star01-BwAv907s.js";import{i as Zd,s as kn}from"./Stars02-PPXsboxW.js";import{V as Tm}from"./view-mode-toggle-DTMt6lCZ.js";import{n as La}from"./ZapSquare-CvkoTQDM.js";import{i as Qd,a as oi,b as Al,c as Rl}from"./Tool01-DvTGD1Yt.js";import{i as Am,c as eh,a as Rm}from"./SwitchHorizontal01-F_1MjTR3.js";import{i as mo}from"./X-D7X7Z50V.js";import{i as Pm,a as Dm}from"./DotsVertical-QF46dzdi.js";import{C as Im,A as Mm}from"./automation-runs-DyKvgj21.js";import{b as po,C as go,a as On,e as $n,c as _o,d as Pl,f as Bm}from"./command-DMsCjDdA.js";import{u as Om,a as th}from"./use-file-configs-YBpYKsXP.js";import{u as $m}from"./useInfiniteQuery-RfoATJAI.js";import{i as zm}from"./FilterLines-CEzORaPw.js";import{M as sh}from"./monaco-editor-x5JEAvo5.js";import{B as Fm}from"./badge-toKsUzoB.js";import{M as Hm}from"./select-model-mprfSN1i.js";import{u as Jn,a as Um,b as Wm,c as Vm,d as Km}from"./use-automations-P1MHR3DS.js";import{i as zn}from"./Zap-BQKeuD4l.js";import{A as qm}from"./automation-list-row-CAUoBpVq.js";function rn(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function V9(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Gm(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function Ym(t){const e=F.c(4),{items:s}=t;let i;e[0]!==s?(i=s.map(Jm),e[0]=s,e[1]=i):i=e[1];let r;return e[2]!==i?(r=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:i}),e[2]=i,e[3]=r):r=e[3],r}function Jm(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function Xm(t){const e=F.c(30),{userTokens:s,assistantTokens:i,otherTokens:r}=t,o=s+i+r,a=o>0?s/o*100:0,l=o>0?i/o*100:0,d=o>0?r/o*100:0;let c;e[0]!==a?(c=a>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${a}%`}}),e[0]=a,e[1]=c):c=e[1];let h;e[2]!==l?(h=l>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${l}%`}}),e[2]=l,e[3]=h):h=e[3];let u;e[4]!==d?(u=d>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${d}%`}}),e[4]=d,e[5]=u):u=e[5];let f;e[6]!==c||e[7]!==h||e[8]!==u?(f=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[c,h,u]}),e[6]=c,e[7]=h,e[8]=u,e[9]=f):f=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=m):m=e[10];let p;e[11]!==a?(p=a.toFixed(1),e[11]=a,e[12]=p):p=e[12];let _;e[13]!==p?(_=n.jsxs("div",{className:"flex items-center gap-1.5",children:[m,n.jsxs("span",{className:"text-xs text-muted-foreground",children:["User ",p,"%"]})]}),e[13]=p,e[14]=_):_=e[14];let L;e[15]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[15]=L):L=e[15];let v;e[16]!==l?(v=l.toFixed(1),e[16]=l,e[17]=v):v=e[17];let x;e[18]!==v?(x=n.jsxs("div",{className:"flex items-center gap-1.5",children:[L,n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Assistant ",v,"%"]})]}),e[18]=v,e[19]=x):x=e[19];let g;e[20]!==d||e[21]!==r?(g=r>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Other ",d.toFixed(1),"%"]})]}),e[20]=d,e[21]=r,e[22]=g):g=e[22];let y;e[23]!==x||e[24]!==g||e[25]!==_?(y=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[_,x,g]}),e[23]=x,e[24]=g,e[25]=_,e[26]=y):y=e[26];let b;return e[27]!==y||e[28]!==f?(b=n.jsxs("div",{className:"flex flex-col gap-2",children:[f,y]}),e[27]=y,e[28]=f,e[29]=b):b=e[29],b}function Zm(t){const e=F.c(11),{agentId:s,isError:i}=t,r=xs(s),o=r?.title??"Subtask",a=r?.icon??null;let l;e[0]!==a||e[1]!==o?(l=n.jsx(ys,{icon:a,name:o,size:"xs",className:"size-6 rounded-md shrink-0"}),e[0]=a,e[1]=o,e[2]=l):l=e[2];const d=i?"text-destructive":"text-foreground";let c;e[3]!==d?(c=le("shrink-0 font-medium",d),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==o||e[6]!==c?(h=n.jsx("span",{className:c,children:o}),e[5]=o,e[6]=c,e[7]=h):h=e[7];let u;return e[8]!==l||e[9]!==h?(u=n.jsxs(n.Fragment,{children:[l,h]}),e[8]=l,e[9]=h,e[10]=u):u=e[10],u}function Qm(t){const e=F.c(5),{isError:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ys,{icon:null,name:"Subtask",size:"xs",className:"size-6 rounded-md shrink-0"}),e[0]=i):i=e[0];const r=s?"text-destructive":"text-foreground";let o;e[1]!==r?(o=le("shrink-0 font-medium",r),e[1]=r,e[2]=o):o=e[2];let a;return e[3]!==o?(a=n.jsxs(n.Fragment,{children:[i,n.jsx("span",{className:o,children:"Subtask"})]}),e[3]=o,e[4]=a):a=e[4],a}function e3(t){const e=F.c(18),{part:s}=t,i=s.input?.agent_id,r=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,o=s.state==="output-error",a=s.state==="approval-requested";let l;e[0]!==o?(l=n.jsx(Qm,{isError:o}),e[0]=o,e[1]=l):l=e[1];let d;e[2]!==i||e[3]!==o?(d=n.jsx(Zm,{agentId:i,isError:o}),e[2]=i,e[3]=o,e[4]=d):d=e[4];let c;e[5]!==l||e[6]!==d?(c=n.jsx(M.Suspense,{fallback:l,children:d}),e[5]=l,e[6]=d,e[7]=c):c=e[7];let h;e[8]!==s.input?(h=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=h):h=e[9];let u;e[10]!==a||e[11]!==o||e[12]!==r?(u=n.jsx("span",{className:"ml-auto shrink-0",children:r?n.jsx(Oe,{size:12,className:"animate-spin text-muted-foreground"}):o?n.jsx(Cf,{size:12,className:"text-destructive"}):a?n.jsx(Ui,{size:12,className:"text-warning"}):n.jsx(nd,{size:12,className:"text-emerald-500"})}),e[10]=a,e[11]=o,e[12]=r,e[13]=u):u=e[13];let f;return e[14]!==c||e[15]!==h||e[16]!==u?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[c,h,u]}),e[14]=c,e[15]=h,e[16]=u,e[17]=f):f=e[17],f}function t3(t){const e=F.c(55),{onClose:s,back:i,className:r}=t,[o,a]=M.useState(null),{messages:l}=ui(),{activeTask:d}=Ds(),{selectedModel:c,selectedVirtualMcp:h}=ul();let u,f,m,p,_,L,v,x;if(e[0]!==d||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==s||e[5]!==o?.id||e[6]!==c||e[7]!==h?.title){x=Symbol.for("react.early_return_sentinel");e:{const b=Ef(l),S=[...l].reverse().find(u3),w=S?.metadata?.usage,C=S?.metadata?.modelLimits?.contextWindow??c?.limits?.contextWindow??null,N=w?.contextTokens??0,T=C&&C>0?(N/C*100).toFixed(1):null,A=l;let j;e[16]!==A?(j=A.filter(h3).reduce(d3,0),e[16]=A,e[17]=j):j=e[17];const k=j,I=l;let E;e[18]!==I?(E=I.filter(c3).reduce(l3,0),e[18]=I,e[19]=E):E=e[19];const R=E,P=Math.max(0,b.totalTokens-k-R),D=l[0],O=l.at(-1),$=D?.metadata?.created_at??d?.created_at,K=O?.metadata?.created_at??d?.updated_at,z=l.filter(a3),U=l.flatMap(r3),G=c?.modelId?Gm(c.modelId):"—",q=h?.title??"Decopilot",W=[{label:"Session",value:d?.title??"New chat"},{label:"Messages",value:z.length},{label:"Agent",value:q},{label:"Model",value:G},{label:"Context Limit",value:C?rn(C):"—"},{label:"Session Tokens (billed)",value:b.totalTokens>0?rn(b.totalTokens):"0"},{label:"Usage",value:T!==null?`${T}%`:"—"},{label:"Input Tokens",value:b.inputTokens>0?rn(b.inputTokens):"0"},{label:"Output Tokens",value:b.outputTokens>0?rn(b.outputTokens):"0"},{label:"Reasoning Tokens",value:b.reasoningTokens>0?rn(b.reasoningTokens):"0"},{label:"Cost",value:b.cost>0?`$${b.cost<.001?b.cost.toFixed(6):b.cost.toFixed(4)}`:"$0.00"},{label:"Session Created",value:V9($)},{label:"Last Activity",value:V9(K)}];if(!d&&z.length===0){let B;e[20]!==r?(B=le("flex flex-col h-full w-full border-l border-border bg-background",r),e[20]=r,e[21]=B):B=e[21];let X;e[22]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[22]=X):X=e[22];let V;e[23]!==i?(V=i?n.jsx(P9,{size:14,className:"text-muted-foreground"}):n.jsx(Vs,{size:14,className:"text-muted-foreground"}),e[23]=i,e[24]=V):V=e[24];let ee;e[25]!==s||e[26]!==V?(ee=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[X,n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center rounded hover:bg-accent transition-colors",children:V})]}),e[25]=s,e[26]=V,e[27]=ee):ee=e[27];let te;e[28]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:"Start a conversation to see context"})}),e[28]=te):te=e[28];let ae;e[29]!==B||e[30]!==ee?(ae=n.jsxs("div",{className:B,children:[ee,te]}),e[29]=B,e[30]=ee,e[31]=ae):ae=e[31],x=ae;break e}e[32]!==r?(L=le("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",r),e[32]=r,e[33]=L):L=e[33];let H;e[34]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[34]=H):H=e[34];let Z;e[35]!==i?(Z=i?n.jsx(P9,{size:14}):n.jsx(Vs,{size:14}),e[35]=i,e[36]=Z):Z=e[36],e[37]!==s||e[38]!==Z?(v=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,n.jsx("button",{type:"button",onClick:s,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:Z})]}),e[37]=s,e[38]=Z,e[39]=v):v=e[39],u="flex flex-col gap-8 p-6",f=U.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:"Subtasks"}),n.jsx("div",{className:"flex flex-col gap-1",children:U.map(n3)})]}),m=n.jsx(Ym,{items:W});let J;e[40]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Context Breakdown"}),e[40]=J):J=e[40],e[41]!==R||e[42]!==P||e[43]!==k?(p=n.jsxs("div",{className:"flex flex-col gap-3",children:[J,n.jsx(Xm,{userTokens:k,assistantTokens:R,otherTokens:P})]}),e[41]=R,e[42]=P,e[43]=k,e[44]=p):p=e[44],_=z.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:"Raw messages"}),n.jsx("div",{className:"flex flex-col gap-1",children:z.map(B=>{const X=B.metadata?.created_at,V=o?.id===B.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>a(V?null:B),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:le("shrink-0 font-medium",B.role==="user"?"text-chart-1":"text-chart-2"),children:B.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:B.id})]}),X&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:new Date(X).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})})]}),V&&n.jsxs(n.Fragment,{children:[B.role==="assistant"&&(()=>{const ee=B.metadata?._request;if(!ee)return null;const te=ee.systemSections??[],ae=Math.max(1,...te.map(i3)),de=te.reduce(s3,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:"Request"}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[ee.activeTools??0," / ",ee.tools??0," ","tools active"]})]}),te.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:["System prompt"," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(de/4).toLocaleString()," ","tok"]})]}),te.map((fe,Q)=>{const se=fe.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${Q}`,oe=fe.chars/ae*100,he=Math.round(fe.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:se}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",he.toLocaleString()," tok"]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${oe}%`}})})]},Q)})]})]})})(),n.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(B,null,2)})]})]},B.id)})})]})}e[0]=d,e[1]=i,e[2]=r,e[3]=l,e[4]=s,e[5]=o?.id,e[6]=c,e[7]=h?.title,e[8]=u,e[9]=f,e[10]=m,e[11]=p,e[12]=_,e[13]=L,e[14]=v,e[15]=x}else u=e[8],f=e[9],m=e[10],p=e[11],_=e[12],L=e[13],v=e[14],x=e[15];if(x!==Symbol.for("react.early_return_sentinel"))return x;let g;e[45]!==u||e[46]!==f||e[47]!==m||e[48]!==p||e[49]!==_?(g=n.jsxs("div",{className:u,children:[f,m,p,_]}),e[45]=u,e[46]=f,e[47]=m,e[48]=p,e[49]=_,e[50]=g):g=e[50];let y;return e[51]!==L||e[52]!==v||e[53]!==g?(y=n.jsxs("div",{className:L,children:[v,g]}),e[51]=L,e[52]=v,e[53]=g,e[54]=y):y=e[54],y}function s3(t,e){return t+e.chars}function i3(t){return t.chars}function n3(t,e){return n.jsx(e3,{part:t},e)}function r3(t){return(t.parts??[]).filter(o3)}function o3(t){return t.type==="tool-subtask"}function a3(t){return t.role!=="system"}function l3(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function c3(t){return t.role==="assistant"}function d3(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function h3(t){return t.role==="user"}function u3(t){return t.role==="assistant"&&t.metadata?.usage}function f3(t){const e=F.c(13),{readOnly:s,identity:i,aboveRow:r,input:o,iceBreakers:a}=t,l=!s&&i?i:null;let d;e[0]!==r||e[1]!==s?(d=!s&&r?n.jsx("div",{"data-chat-above-row":"true",className:"@container/chat-bottom flex justify-start gap-1",children:r}):null,e[0]=r,e[1]=s,e[2]=d):d=e[2];let c;e[3]!==o||e[4]!==d?(c=n.jsxs("div",{className:"flex flex-col gap-2",children:[d,o]}),e[3]=o,e[4]=d,e[5]=c):c=e[5];let h;e[6]!==a||e[7]!==s?(h=!s&&a?n.jsx("div",{className:"w-full",children:a}):null,e[6]=a,e[7]=s,e[8]=h):h=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==h?(u=n.jsx("div",{"data-chat-centered":"true",className:"h-full w-full flex flex-col items-center justify-center px-4 gap-6",children:n.jsxs("div",{className:"w-full max-w-3xl flex flex-col gap-6",children:[l,c,h]})}),e[9]=l,e[10]=c,e[11]=h,e[12]=u):u=e[12],u}function m3(t){const e=F.c(25),{onOpenContextPanel:s}=t,{org:i}=Fe(),{selectedVirtualMcp:r}=ul();let o;e[0]!==i.id?(o=ld(i.id),e[0]=i.id,e[1]=o):o=e[1];const l=r??o,d=xs(l.id),c=id(),{data:h}=Hi.useSession(),u=h?.user?.id,f=c?.activeTask??null,m=!!(u&&f?.created_by&&f.created_by!==u);let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(qf,{size:32}),e[2]=p):p=e[2];let _;e[3]!==l.icon||e[4]!==l.title?(_=n.jsx(ys,{icon:l.icon,name:l.title,size:"lg",fallbackIcon:p,className:"size-10 min-w-10 md:size-[60px]! md:min-w-[60px] rounded-xl md:rounded-[18px]!"}),e[3]=l.icon,e[4]=l.title,e[5]=_):_=e[5];let L;e[6]!==l.title?(L=n.jsx("h3",{className:"text-base md:text-xl font-medium text-foreground",children:l.title}),e[6]=l.title,e[7]=L):L=e[7];const v=l.description??"Ask anything about configuring model providers or using MCP Mesh.";let x;e[8]!==v?(x=n.jsx("div",{className:"text-muted-foreground text-center text-base max-w-md line-clamp-2",children:v}),e[8]=v,e[9]=x):x=e[9];let g;e[10]!==_||e[11]!==L||e[12]!==x?(g=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 md:gap-4 text-center",children:[_,L,x]}),e[10]=_,e[11]=L,e[12]=x,e[13]=g):g=e[13];const y=c?.currentBranch??null;let b;e[14]!==d||e[15]!==y?(b=n.jsx(_f,{virtualMcp:d,currentBranch:y}),e[14]=d,e[15]=y,e[16]=b):b=e[16];let S;e[17]!==s?(S=n.jsx(ot.Input,{onOpenContextPanel:s}),e[17]=s,e[18]=S):S=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(ot.IceBreakers,{}),e[19]=w):w=e[19];let C;return e[20]!==m||e[21]!==S||e[22]!==g||e[23]!==b?(C=n.jsx(f3,{readOnly:m,identity:g,aboveRow:b,input:S,iceBreakers:w}),e[20]=m,e[21]=S,e[22]=g,e[23]=b,e[24]=C):C=e[24],C}function K9(t){const e=F.c(17),{outputs:s,collapsed:i,onToggle:r,variant:o}=t,a=o==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let l;e[0]!==a?(l=le(a),e[0]=a,e[1]=l):l=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=d):d=e[2];const c=i&&"-rotate-90";let h;e[3]!==c?(h=le("size-4 text-muted-foreground transition-transform",c),e[3]=c,e[4]=h):h=e[4];let u;e[5]!==h?(u=n.jsx(ds,{className:h}),e[5]=h,e[6]=u):u=e[6];let f;e[7]!==r||e[8]!==u?(f=n.jsxs("button",{type:"button",onClick:r,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[d,u]}),e[7]=r,e[8]=u,e[9]=f):f=e[9];let m;e[10]!==i||e[11]!==s?(m=!i&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(p3)}),e[10]=i,e[11]=s,e[12]=m):m=e[12];let p;return e[13]!==l||e[14]!==f||e[15]!==m?(p=n.jsxs("div",{className:l,children:[f,m]}),e[13]=l,e[14]=f,e[15]=m,e[16]=p):p=e[16],p}function p3(t){return n.jsx(Af,{file:t},t.key)}function g3(){const t=F.c(13),e=id()?.taskId??null,s=Tf();let i;t[0]!==s?(i={enabled:s},t[0]=s,t[1]=i):i=t[1];const{data:r}=od(e,i),[o,a]=M.useState(!1),[l,d]=M.useState(!0);if(!e||!r||r.length===0)return null;let c;t[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>a(L3),t[2]=c):c=t[2];let h;t[3]!==o||t[4]!==r?(h=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(K9,{variant:"card",outputs:r,collapsed:o,onToggle:c})}),t[3]=o,t[4]=r,t[5]=h):h=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=()=>d(_3),t[6]=u):u=t[6];let f;t[7]!==l||t[8]!==r?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(K9,{variant:"bar",outputs:r,collapsed:l,onToggle:u})}),t[7]=l,t[8]=r,t[9]=f):f=t[9];let m;return t[10]!==h||t[11]!==f?(m=n.jsxs(n.Fragment,{children:[h,f]}),t[10]=h,t[11]=f,t[12]=m):m=t[12],m}function _3(t){return!t}function L3(t){return!t}function v3(){const t=F.c(26),{org:e}=Fe(),s=bd(),{isChatEmpty:i}=ui(),[r,o]=M.useState("chat"),a=Gf(),l=e2();if(s.length===0&&!Yf(l)){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(ot,{className:"animate-in fade-in-0 duration-200",children:n.jsx(ot.Main,{className:"flex flex-col items-center",children:n.jsx(ot.EmptyState,{children:n.jsx(ot.NoAiProviderEmptyState,{})})})}),t[0]=b):b=t[0],b}let c;t[1]!==a.hasDecoKey||t[2]!==a.hasOnlyDecoProvider||t[3]!==a.isLoading||t[4]!==a.isZeroBalance||t[5]!==i||t[6]!==e?(c=a.hasDecoKey&&a.isZeroBalance&&a.hasOnlyDecoProvider&&!a.isLoading&&i&&!Lf(e.id),t[1]=a.hasDecoKey,t[2]=a.hasOnlyDecoProvider,t[3]=a.isLoading,t[4]=a.isZeroBalance,t[5]=i,t[6]=e,t[7]=c):c=t[7];const h=c;let u;t[8]!==h?(u=h&&n.jsx(ot.CreditsEmptyState,{}),t[8]=h,t[9]=u):u=t[9];const f=r!=="chat"?"opacity-0 pointer-events-none":"opacity-100";let m;t[10]!==f?(m=le("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",f),t[10]=f,t[11]=m):m=t[11];let p;t[12]!==i?(p=i?n.jsx(ot.Main,{children:n.jsx(m3,{onOpenContextPanel:()=>o("context")})}):n.jsxs(n.Fragment,{children:[n.jsxs(ot.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(g3,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(ot.Messages,{})})]}),n.jsx(ot.Footer,{children:n.jsx(ot.Input,{onOpenContextPanel:()=>o("context")})})]}),t[12]=i,t[13]=p):p=t[13];let _;t[14]!==m||t[15]!==p?(_=n.jsx("div",{className:m,children:p}),t[14]=m,t[15]=p,t[16]=_):_=t[16];const L=r==="context"?"opacity-100":"opacity-0 pointer-events-none";let v;t[17]!==L?(v=le("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",L),t[17]=L,t[18]=v):v=t[18];let x;t[19]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(t3,{back:!0,onClose:()=>o("chat")}),t[19]=x):x=t[19];let g;t[20]!==v?(g=n.jsx("div",{className:v,children:x}),t[20]=v,t[21]=g):g=t[21];let y;return t[22]!==u||t[23]!==_||t[24]!==g?(y=n.jsxs(ot,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[u,_,g]}),t[22]=u,t[23]=_,t[24]=g,t[25]=y):y=t[25],y}function ih(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ot.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Jt,{fallback:e,children:n.jsx(M.Suspense,{fallback:n.jsx(ot.Skeleton,{}),children:n.jsx(v3,{})})}),t[1]=s):s=t[1],s}function x3(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",i=t.mainParamPresent?t.mainParamValue!=="0":!s,r=s?!0:t.entityMetadata?.chatDefaultOpen??!1;return{mainOpen:i,chatOpen:r}}function q9(t,e){return t&&e?{chat:45,main:55}:t&&!e?{chat:100,main:0}:!t&&e?{chat:0,main:100}:{chat:0,main:0}}function y3(t,e){return t===1?!0:t===0?!1:e}function b3(t,e){const s=Vt(),i=no({strict:!1}),r=J0({strict:!1}),{create:o}=Ed(),{locator:a}=Fe(),{virtualMcpId:l,orgSlug:d,isAgentRoute:c}=e,h=x3({entityMetadata:t,mainParamPresent:i.main!==void 0,mainParamValue:i.main}),u=y3(i.chat,h.chatOpen),f=h.mainOpen,m=M.useRef(crypto.randomUUID()),p=r.taskId??m.current,_="/$org/$taskId",L=N=>({org:d,taskId:N}),v=c?{virtualmcpid:l}:{},x=(N,T)=>{s({to:_,params:L(p),search:A=>({...A,...N}),replace:T?.replace??!1})},g=(N,T)=>{s({to:_,params:L(N),search:A=>{const j={};return T?j.virtualmcpid=T:c&&(j.virtualmcpid=l),j}})},y=()=>{f?x({main:"0"},{replace:!0}):x({main:ua(t)},{replace:!0})},b=()=>{x({chat:u?0:1},{replace:!0})},S=()=>{u||x({chat:1},{replace:!0})},w=async()=>{const N=crypto.randomUUID(),T=t2(d,a,p);try{await o({id:N,virtual_mcp_id:l,...T?{branch:T}:{}})}catch{}s({to:_,params:L(N),search:A=>({...v,chat:1})})},C=N=>{x({main:N},{replace:!0})};return{taskId:p,mainOpen:f,chatOpen:u,mainParam:i.main,setTaskId:g,toggleMain:y,toggleChat:b,openChat:S,createNewTask:w,openTab:C}}const Dl=45;function nh(t,e=Dl){const s=typeof t=="number"?t:Number(t);return!Number.isFinite(s)||s<=0||s>=100?e:s}function S3(t){return nh(t,Dl)}function w3(){const t=F.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=tf.decoChatPanelWidth(),t[0]=e):e=t[0];const[s,i]=ef(e,S3);let r;t[1]!==s?(r=nh(s,Dl),t[1]=s,t[2]=r):r=t[2];const o=r;let a;return t[3]!==i||t[4]!==o?(a=[o,i],t[3]=i,t[4]=o,t[5]=a):a=t[5],a}function C3(t){try{return JSON.parse(t)}catch{return null}}function k3(t){if(!t||typeof t!="object")return null;const e=t,s=e.content?.find(o=>o.type==="text")?.text,i=s?C3(s):null,r=e.structuredContent;return r==null?i:typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0?i??r:r}function gi(t){const e=k3(t);return e===null?null:e}function Il(t){if(!t)return null;const e=t.match(/\/pull\/(\d+)\b/);if(!e)return null;const s=Number(e[1]);return Number.isFinite(s)&&s>0?s:null}function j3(t){if(!t||typeof t!="object")return null;const e=t.content?.find(r=>r.type==="text")?.text;if(!e)return null;const s=e.match(/https:\/\/github\.com\/[^\s"]+\/pull\/\d+/)?.[0],i=Il(s);return!i||!s?null:{number:i,htmlUrl:s}}const G9=/[\r\n<>]/,N3=/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;function Xn(t){const e=t?.userName?.trim();if(!e||G9.test(e))return null;const s=t?.userEmail?.trim();return!s||G9.test(s)?{userName:e}:N3.test(s)?{userName:e,userEmail:s}:{userName:e}}function E3(t){return t.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-Da2BXnWh.js","assets/index-C5w7M3ak.js","assets/index-NVhaWgyE.css","assets/ChevronDown-DXzUoD2e.js","assets/ChevronLeft-DopUTXew.js","assets/ChevronRight-j760Iee-.js","assets/ChevronUp-CADhYHt4.js","assets/agent-icon-Tlh3oNKM.js","assets/AlertCircle-D8nl7USt.js","assets/Tool01-Dt-TbXDn.js","assets/SwitchHorizontal01-CB8Z7BL9.js","assets/Settings02-D-O2SNJf.js","assets/XCircle-DAqTWvWp.js","assets/ArrowUpRight-DgG9Xs3P.js","assets/ZapSquare-DD_XuIyF.js","assets/Users03-DwMxpPU3.js","assets/CheckCircle-yOjX9PZe.js","assets/DotsVertical-AD-a2Knc.js","assets/Stars02-BUidkUMX.js","assets/Eye-CQQama2s.js","assets/ZoomOut-VAm9p2Hl.js","assets/Globe01-CaIgPTxT.js","assets/FilterLines-CehUrsTR.js","assets/Star01-BNUohd1g.js","assets/Globe04-CuT114AV.js","assets/HardDrive-lZvAMErY.js","assets/Key01-BAEB0MKB.js","assets/LayoutLeft-Fadct960.js","assets/LinkExternal01-Dh2g8Xye.js","assets/Monitor01-_MTiHAuD.js","assets/Sun-CrWUbEJD.js","assets/Palette-hlsbFMfV.js","assets/Play-CfbRRa8r.js","assets/Plus-CdiQoMoJ.js","assets/SearchMd-D1HSgOeu.js","assets/Shield01-DOrMIO9W.js","assets/Stars01-DMt3zew5.js","assets/Trash01-BVvGX_KK.js","assets/Upload01-Prj9a2xY.js","assets/User01-CaU7xtcd.js","assets/Users01-BRnzISUs.js","assets/XClose-DlK2hm1P.js","assets/X-C-TqNtc2.js","assets/Zap-5n0DTezT.js","assets/scroll-area-BFd5bzOG.js","assets/use-clock-tick-CmvqvAhs.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-Cz-l8dwG.js","assets/tooltip-CgNWIJOM.js","assets/file-type-icon-MmuXAAgi.js","assets/dialog-BYnY80tb.js","assets/use-mobile-COxfHS-K.js","assets/tab-id-BptcWVWa.js","assets/content-blocks-o63cs2vh.js","assets/types-CXz6VYrK.js","assets/use-mcp-client-Ci_r6Z9X.js","assets/auth-BR3aJLVt.js","assets/chat-context-C-somJSY.js","assets/hooks-B4h0KjiG.js","assets/decopilot-sse-pool-9lyDYS1g.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/use-virtual-mcp-C76Ypnz5.js","assets/use-collections-BYKClwvP.js","assets/use-ai-providers-Dw8zktiy.js","assets/studio-tools-BJLBgOee.js","assets/use-organization-settings-D1CXb2Mk.js","assets/shell-layout-Cz9jaH1b.js","assets/avatar-DKl_SvPY.js","assets/required-auth-layout-CluuNdrt.js","assets/use-org-sso-BrX2nnoi.js","assets/sheet-CG7AqhVD.js","assets/integration-icon-CE7Y49fT.js","assets/use-navigate-to-agent-Cp82Pt97.js","assets/use-connection-BnTFSsXk.js","assets/use-mcp-prompts-Brfbccg_.js","assets/form-DyV_U4Fx.js","assets/label-A5aaknkU.js","assets/input-agFYfi3v.js","assets/select--NMtIJXa.js","assets/dropdown-menu-B_-Um9OQ.js","assets/sortable.esm-YhwgmY_a.js","assets/connection-slug-eyAPH6o3.js","assets/connection-card-Cm-r3F3U.js","assets/use-registry-connections-DxwnrcKA.js","assets/useInfiniteQuery-Dd70hn1g.js","assets/use-infinite-scroll-10P3vgT3.js","assets/extract-connection-data-sR3PfR1q.js","assets/card-CCz6n2PT.js","assets/collection-search-9Z9J-flr.js","assets/collection-tabs-BkVwtVd6.js","assets/badge-CPOFnH5f.js","assets/drawer-DSWLLvbj.js","assets/textarea-Dgff3Gg2.js","assets/connection-form-helpers-CzldBL3R.js","assets/authenticate-and-persist-oauth-DlE0FF2e.js","assets/mcp-oauth-BsM22i8Z.js","assets/useSuspenseInfiniteQuery-8qs6htsj.js","assets/page-seo-form-DjBw0txl.js","assets/switch-V6piMM6A.js","assets/add-section-modal-ZfYc_Xn6.js","assets/index-T5P3sRB3.js","assets/tabs-DGpCIiez.js","assets/toggle-group-DRhh44eR.js","assets/connect-desktop-dialog-DhsRqyJo.js","assets/decopilot-CzHxKRA2.js","assets/checkbox-DXMAgfVg.js","assets/skeleton-sBC4lQNI.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-Cv3fX46A.js","assets/popover-DXCLs7Mh.js","assets/command-CD_UfdIZ.js","assets/index--rRbpAQ9.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-SD_W2P9L.js","assets/empty-state-Di1r-g_a.js","assets/toolbar-QoRJzy-G.js","assets/preview-dialog-DwVGd6qW.js","assets/index-BSpZjkyI.js","assets/use-mcp-tools-C3Vng-X-.js","assets/use-capability-DVHDSFWa.js","assets/shell-route-loading-DX7cr59C.js","assets/index-Dsuwnck-.js","assets/alert-dialog-DESqZhA2.js","assets/use-debounced-autosave-mT469Qcu.js","assets/index-DJPcb21Y.js","assets/sidebar-C8Zfra_F.js","assets/search-input-DBcneL-Z.js","assets/github-repo-picker-B4YgsSnm.js","assets/use-secrets-B-XWgN3K.js","assets/formatDistanceToNow-Cb2QZZJn.js","assets/view-mode-toggle-XGoB5RsL.js","assets/automation-runs-irK0CDv6.js","assets/table-CO4yX7RA.js","assets/use-members-B81Cwsvd.js","assets/use-org-auth-client-C5HFWhiz.js","assets/task-status-CyBXqR4E.js","assets/use-automations-1dr86I_A.js","assets/use-file-configs-BY2cpVcw.js","assets/monaco-editor-CK4_aHmD.js","assets/select-model-B8wcKRbd.js","assets/automation-list-row-D2uPOFxN.js","assets/page-seo-sheet-Ddik0L9a.js","assets/file-explorer-hz_GCFqU.js","assets/context-menu-BMjlqCBa.js","assets/app-editor-C0ZGI6j9.js","assets/save-status-Dg-HdKmb.js","assets/post-editor-aN1M0k3q.js","assets/block-document-C_nFcvPT.js","assets/primitives-DHDblW6s.js","assets/record-editor-DWU1kNnR.js","assets/category-editor-BEu80DLc.js","assets/seo-editor-CpXgkLht.js","assets/variant-calendar-BHRaDzz9.js","assets/project-app-view-Dds52VxM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as F,r as M,l as le,j as n,i as Oe,D as Fe,a as Hi,E as Jt,b as Vt,u as no,e as J0,C as ef,L as tf,k as Ps,K as Tt,m as di,a6 as ro,a7 as sf,q as nf,t as ue,B as ie,a8 as X0,a9 as rf,aa as of,w as Ye,ab as Z0,ac as af,ad as oo,ae as Pn,af as Ut,ag as lf,p as Q0,n as cf,G as ed,ah as Wt,V as td,ai as df,Y as hf,a3 as sd,_ as uf,aj as ff,W as mf,ak as pf,d as hi,o as br,al as gn,s as os,am as cs,F as gf}from"./index-C5w7M3ak.js";import{C as ot,a as _f,w as Lf,u as hl,s as ca,T as vf,b as xf,g as yf,c as bf}from"./index-T5P3sRB3.js";import{u as ui,a as Ds,b as ul,c as id,S as fl,t as Sf,d as wf}from"./chat-context-C-somJSY.js";import{i as Ui}from"./AlertCircle-D8nl7USt.js";import{i as nd}from"./CheckCircle-yOjX9PZe.js";import{n as P9}from"./ChevronLeft-DopUTXew.js";import{a as Cf,b as kf,i as jf}from"./XCircle-DAqTWvWp.js";import{s as Vs}from"./XClose-DlK2hm1P.js";import{a as xs,u as ml,b as rd,c as Nf}from"./use-virtual-mcp-C76Ypnz5.js";import{c as Ef,u as Tf,a as od,O as Af,t as da,S as Wi,T as Rf,b as ad,R as Pf,C as Df,G as If,d as Mf,i as Bf,E as Of,g as $f,s as zf,e as Ff,f as Hf,h as Uf}from"./scroll-area-BFd5bzOG.js";import{I as ys}from"./integration-icon-CE7Y49fT.js";import{a as ld,u as Pt,S as pl,b as Wf,c as Vf,i as Kf,d as cd}from"./use-mcp-client-Ci_r6Z9X.js";import{a as qf}from"./Users03-DwMxpPU3.js";import{t as ds}from"./ChevronDown-DXzUoD2e.js";import{u as Gf,h as Yf,a as qn,i as dd,j as ni,g as Jf,A as Xf,b as hd,c as Ar,K as ud,P as fd,D as md,d as pd,S as gd,v as _d,k as Ld,l as ha,e as vd,C as xd,s as yd,m as Zf,n as Qf}from"./sortable.esm-YhwgmY_a.js";import{u as bd}from"./use-ai-providers-Dw8zktiy.js";import{u as e2}from"./connect-desktop-dialog-DhsRqyJo.js";import{r as t2,b as gl,i as s2}from"./shell-layout-Cz9jaH1b.js";import{u as _l}from"./use-mobile-COxfHS-K.js";import{u as i2}from"./use-status-sounds-SD_W2P9L.js";import{E as Rr}from"./empty-state-Di1r-g_a.js";import{r as ua,a as n2,p as Sd,f as D9,b as wd,c as Cd,d as kd,e as r2,F as o2,i as a2,g as l2,h as jd,j as Nd}from"./tab-id-BptcWVWa.js";import{u as Ed,a as Td}from"./hooks-B4h0KjiG.js";import{T as I9,a as _n}from"./toolbar-QoRJzy-G.js";import{u as c2,a as d2,b as h2,c as u2,g as f2,d as Ad,e as M9,f as m2,F as p2,h as g2,i as _2,j as L2,k as v2,l as x2,m as y2,H as b2,L as S2,R as Rd,n as w2,o as C2,T as Ll,p as k2,q as j2}from"./preview-dialog-DwVGd6qW.js";import{g as Dn,h as vl,j as Pd,k as N2,p as ao,l as fi,m as xl,n as Dd,o as fa,q as To,r as B9,A as O9,s as E2,t as T2,u as A2,v as R2,w as P2,x as Id,y as D2,z as I2,B as M2,C as B2,D as Vi,E as O2,F as $9,G as z9,H as $2,e as z2,I as F2,J as H2,K as Ti,L as Pr,M as lo,N as U2,O as W2,P as V2,Q as K2,R as q2,S as G2,T as Md,U as Di,V as F9,W as Bd,X as yl,Y as Y2,Z as J2,_ as X2,$ as Z2,a0 as Q2,a1 as em,a2 as H9,a3 as tm,a4 as sm,a5 as im,a6 as Od,a7 as nm}from"./agent-icon-Tlh3oNKM.js";import{a as Ee,b as Te,T as Ae,c as $d}from"./tooltip-CgNWIJOM.js";import{i as Ki,n as rm}from"./Globe01-CaIgPTxT.js";import{i as zd}from"./Monitor01-_MTiHAuD.js";import{u as Gn,a as bl,b as Fd}from"./use-connection-BnTFSsXk.js";import{u as co,a as Hd,b as Ud}from"./use-mcp-tools-C3Vng-X-.js";import{g as Wd}from"./types-CXz6VYrK.js";import{u as mi}from"./studio-tools-BJLBgOee.js";import{e as Sl}from"./backoff-CrEUbyZT.js";import{u as om}from"./use-capability-DVHDSFWa.js";import{F as Ii,M as wl,O as am}from"./file-type-icon-MmuXAAgi.js";import{P as bs,a as Ss,b as ws}from"./popover-DXCLs7Mh.js";import{b as Ct,c as Et,S as kt,a as et,d as jt}from"./select--NMtIJXa.js";import{D as Qt,a as es,b as ts,c as We,d as ma,e as pa,f as ga,g as Cn,h as ir,i as ho,j as U9}from"./dropdown-menu-B_-Um9OQ.js";import{a as Ot,b as $t,c as is,d as ns,D as qs,e as qi}from"./dialog-BYnY80tb.js";import{I as ze}from"./input-agFYfi3v.js";import{T as Hs,a as uo,b as Ai,c as fo}from"./tabs-DGpCIiez.js";import{T as In}from"./textarea-Dgff3Gg2.js";import{a as Xt,s as lm}from"./Eye-CQQama2s.js";import{t as ti}from"./Stars01-DMt3zew5.js";import{l as cm,w as dm}from"./index-BSpZjkyI.js";import{i as Gi}from"./ChevronRight-j760Iee-.js";import{b as _a,c as Vd,d as Cl}from"./ZoomOut-VAm9p2Hl.js";import{S as hm}from"./shell-route-loading-DX7cr59C.js";import{a as um}from"./extract-connection-data-sR3PfR1q.js";import{A as Ao}from"./avatar-DKl_SvPY.js";import{T as Kd,u as qd,I as fm,R as mm,a as pm}from"./index-Dsuwnck-.js";import{a as gm,i as W9}from"./mcp-oauth-BsM22i8Z.js";import{s as Gd,g as _m}from"./connection-slug-eyAPH6o3.js";import{f as Dr,a as Ir,b as Mr,c as Br,d as Or,e as $r,A as zr,g as Fr}from"./alert-dialog-DESqZhA2.js";import{C as kl,a as Hr}from"./card-CCz6n2PT.js";import{L as $e}from"./label-A5aaknkU.js";import{S as Mn}from"./switch-V6piMM6A.js";import{i as Mi}from"./Play-CfbRRa8r.js";import{s as Dt}from"./Plus-CdiQoMoJ.js";import{a as Lm,b as Yd}from"./Settings02-D-O2SNJf.js";import{s as ss}from"./Trash01-BVvGX_KK.js";import{u as Ur}from"./use-debounced-autosave-mT469Qcu.js";import{i as Bn}from"./SearchMd-D1HSgOeu.js";import{i as Yn}from"./Upload01-Prj9a2xY.js";import{i as vm}from"./LayoutLeft-Fadct960.js";import{P as ls}from"./index-DJPcb21Y.js";import{C as Yi}from"./checkbox-DXMAgfVg.js";import{S as jl}from"./search-input-DBcneL-Z.js";import{C as Jd}from"./collection-tabs-BkVwtVd6.js";import{u as xm}from"./use-mcp-prompts-Brfbccg_.js";import{b as ym,a as bm,D as Sm}from"./drawer-DSWLLvbj.js";import{i as Ls}from"./ChevronUp-CADhYHt4.js";import{i as Nl}from"./Key01-BAEB0MKB.js";import{a as Xd,G as wm,u as Cm}from"./github-repo-picker-B4YgsSnm.js";import{S as El}from"./skeleton-sBC4lQNI.js";import{s as km}from"./User01-CaU7xtcd.js";import{t as Tl}from"./Users01-BRnzISUs.js";import{u as jm,a as Nm}from"./use-secrets-B-XWgN3K.js";import{f as Em}from"./formatDistanceToNow-Cb2QZZJn.js";import{n as pi}from"./LinkExternal01-Dh2g8Xye.js";import{s as ri}from"./Star01-BNUohd1g.js";import{i as Zd,s as kn}from"./Stars02-BUidkUMX.js";import{V as Tm}from"./view-mode-toggle-XGoB5RsL.js";import{n as La}from"./ZapSquare-DD_XuIyF.js";import{i as Qd,a as oi,b as Al,c as Rl}from"./Tool01-Dt-TbXDn.js";import{i as Am,c as eh,a as Rm}from"./SwitchHorizontal01-CB8Z7BL9.js";import{i as mo}from"./X-C-TqNtc2.js";import{i as Pm,a as Dm}from"./DotsVertical-AD-a2Knc.js";import{C as Im,A as Mm}from"./automation-runs-irK0CDv6.js";import{b as po,C as go,a as On,e as $n,c as _o,d as Pl,f as Bm}from"./command-CD_UfdIZ.js";import{u as Om,a as th}from"./use-file-configs-BY2cpVcw.js";import{u as $m}from"./useInfiniteQuery-Dd70hn1g.js";import{i as zm}from"./FilterLines-CehUrsTR.js";import{M as sh}from"./monaco-editor-CK4_aHmD.js";import{B as Fm}from"./badge-CPOFnH5f.js";import{M as Hm}from"./select-model-B8wcKRbd.js";import{u as Jn,a as Um,b as Wm,c as Vm,d as Km}from"./use-automations-1dr86I_A.js";import{i as zn}from"./Zap-5n0DTezT.js";import{A as qm}from"./automation-list-row-D2uPOFxN.js";function rn(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function V9(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Gm(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function Ym(t){const e=F.c(4),{items:s}=t;let i;e[0]!==s?(i=s.map(Jm),e[0]=s,e[1]=i):i=e[1];let r;return e[2]!==i?(r=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:i}),e[2]=i,e[3]=r):r=e[3],r}function Jm(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function Xm(t){const e=F.c(30),{userTokens:s,assistantTokens:i,otherTokens:r}=t,o=s+i+r,a=o>0?s/o*100:0,l=o>0?i/o*100:0,d=o>0?r/o*100:0;let c;e[0]!==a?(c=a>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${a}%`}}),e[0]=a,e[1]=c):c=e[1];let h;e[2]!==l?(h=l>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${l}%`}}),e[2]=l,e[3]=h):h=e[3];let u;e[4]!==d?(u=d>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${d}%`}}),e[4]=d,e[5]=u):u=e[5];let f;e[6]!==c||e[7]!==h||e[8]!==u?(f=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[c,h,u]}),e[6]=c,e[7]=h,e[8]=u,e[9]=f):f=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=m):m=e[10];let p;e[11]!==a?(p=a.toFixed(1),e[11]=a,e[12]=p):p=e[12];let _;e[13]!==p?(_=n.jsxs("div",{className:"flex items-center gap-1.5",children:[m,n.jsxs("span",{className:"text-xs text-muted-foreground",children:["User ",p,"%"]})]}),e[13]=p,e[14]=_):_=e[14];let L;e[15]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[15]=L):L=e[15];let v;e[16]!==l?(v=l.toFixed(1),e[16]=l,e[17]=v):v=e[17];let x;e[18]!==v?(x=n.jsxs("div",{className:"flex items-center gap-1.5",children:[L,n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Assistant ",v,"%"]})]}),e[18]=v,e[19]=x):x=e[19];let g;e[20]!==d||e[21]!==r?(g=r>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Other ",d.toFixed(1),"%"]})]}),e[20]=d,e[21]=r,e[22]=g):g=e[22];let y;e[23]!==x||e[24]!==g||e[25]!==_?(y=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[_,x,g]}),e[23]=x,e[24]=g,e[25]=_,e[26]=y):y=e[26];let b;return e[27]!==y||e[28]!==f?(b=n.jsxs("div",{className:"flex flex-col gap-2",children:[f,y]}),e[27]=y,e[28]=f,e[29]=b):b=e[29],b}function Zm(t){const e=F.c(11),{agentId:s,isError:i}=t,r=xs(s),o=r?.title??"Subtask",a=r?.icon??null;let l;e[0]!==a||e[1]!==o?(l=n.jsx(ys,{icon:a,name:o,size:"xs",className:"size-6 rounded-md shrink-0"}),e[0]=a,e[1]=o,e[2]=l):l=e[2];const d=i?"text-destructive":"text-foreground";let c;e[3]!==d?(c=le("shrink-0 font-medium",d),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==o||e[6]!==c?(h=n.jsx("span",{className:c,children:o}),e[5]=o,e[6]=c,e[7]=h):h=e[7];let u;return e[8]!==l||e[9]!==h?(u=n.jsxs(n.Fragment,{children:[l,h]}),e[8]=l,e[9]=h,e[10]=u):u=e[10],u}function Qm(t){const e=F.c(5),{isError:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ys,{icon:null,name:"Subtask",size:"xs",className:"size-6 rounded-md shrink-0"}),e[0]=i):i=e[0];const r=s?"text-destructive":"text-foreground";let o;e[1]!==r?(o=le("shrink-0 font-medium",r),e[1]=r,e[2]=o):o=e[2];let a;return e[3]!==o?(a=n.jsxs(n.Fragment,{children:[i,n.jsx("span",{className:o,children:"Subtask"})]}),e[3]=o,e[4]=a):a=e[4],a}function e3(t){const e=F.c(18),{part:s}=t,i=s.input?.agent_id,r=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,o=s.state==="output-error",a=s.state==="approval-requested";let l;e[0]!==o?(l=n.jsx(Qm,{isError:o}),e[0]=o,e[1]=l):l=e[1];let d;e[2]!==i||e[3]!==o?(d=n.jsx(Zm,{agentId:i,isError:o}),e[2]=i,e[3]=o,e[4]=d):d=e[4];let c;e[5]!==l||e[6]!==d?(c=n.jsx(M.Suspense,{fallback:l,children:d}),e[5]=l,e[6]=d,e[7]=c):c=e[7];let h;e[8]!==s.input?(h=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=h):h=e[9];let u;e[10]!==a||e[11]!==o||e[12]!==r?(u=n.jsx("span",{className:"ml-auto shrink-0",children:r?n.jsx(Oe,{size:12,className:"animate-spin text-muted-foreground"}):o?n.jsx(Cf,{size:12,className:"text-destructive"}):a?n.jsx(Ui,{size:12,className:"text-warning"}):n.jsx(nd,{size:12,className:"text-emerald-500"})}),e[10]=a,e[11]=o,e[12]=r,e[13]=u):u=e[13];let f;return e[14]!==c||e[15]!==h||e[16]!==u?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[c,h,u]}),e[14]=c,e[15]=h,e[16]=u,e[17]=f):f=e[17],f}function t3(t){const e=F.c(55),{onClose:s,back:i,className:r}=t,[o,a]=M.useState(null),{messages:l}=ui(),{activeTask:d}=Ds(),{selectedModel:c,selectedVirtualMcp:h}=ul();let u,f,m,p,_,L,v,x;if(e[0]!==d||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==s||e[5]!==o?.id||e[6]!==c||e[7]!==h?.title){x=Symbol.for("react.early_return_sentinel");e:{const b=Ef(l),S=[...l].reverse().find(u3),w=S?.metadata?.usage,C=S?.metadata?.modelLimits?.contextWindow??c?.limits?.contextWindow??null,N=w?.contextTokens??0,T=C&&C>0?(N/C*100).toFixed(1):null,A=l;let j;e[16]!==A?(j=A.filter(h3).reduce(d3,0),e[16]=A,e[17]=j):j=e[17];const k=j,I=l;let E;e[18]!==I?(E=I.filter(c3).reduce(l3,0),e[18]=I,e[19]=E):E=e[19];const R=E,P=Math.max(0,b.totalTokens-k-R),D=l[0],O=l.at(-1),$=D?.metadata?.created_at??d?.created_at,K=O?.metadata?.created_at??d?.updated_at,z=l.filter(a3),U=l.flatMap(r3),G=c?.modelId?Gm(c.modelId):"—",q=h?.title??"Decopilot",W=[{label:"Session",value:d?.title??"New chat"},{label:"Messages",value:z.length},{label:"Agent",value:q},{label:"Model",value:G},{label:"Context Limit",value:C?rn(C):"—"},{label:"Session Tokens (billed)",value:b.totalTokens>0?rn(b.totalTokens):"0"},{label:"Usage",value:T!==null?`${T}%`:"—"},{label:"Input Tokens",value:b.inputTokens>0?rn(b.inputTokens):"0"},{label:"Output Tokens",value:b.outputTokens>0?rn(b.outputTokens):"0"},{label:"Reasoning Tokens",value:b.reasoningTokens>0?rn(b.reasoningTokens):"0"},{label:"Cost",value:b.cost>0?`$${b.cost<.001?b.cost.toFixed(6):b.cost.toFixed(4)}`:"$0.00"},{label:"Session Created",value:V9($)},{label:"Last Activity",value:V9(K)}];if(!d&&z.length===0){let B;e[20]!==r?(B=le("flex flex-col h-full w-full border-l border-border bg-background",r),e[20]=r,e[21]=B):B=e[21];let X;e[22]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[22]=X):X=e[22];let V;e[23]!==i?(V=i?n.jsx(P9,{size:14,className:"text-muted-foreground"}):n.jsx(Vs,{size:14,className:"text-muted-foreground"}),e[23]=i,e[24]=V):V=e[24];let ee;e[25]!==s||e[26]!==V?(ee=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[X,n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center rounded hover:bg-accent transition-colors",children:V})]}),e[25]=s,e[26]=V,e[27]=ee):ee=e[27];let te;e[28]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:"Start a conversation to see context"})}),e[28]=te):te=e[28];let ae;e[29]!==B||e[30]!==ee?(ae=n.jsxs("div",{className:B,children:[ee,te]}),e[29]=B,e[30]=ee,e[31]=ae):ae=e[31],x=ae;break e}e[32]!==r?(L=le("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",r),e[32]=r,e[33]=L):L=e[33];let H;e[34]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Context"}),e[34]=H):H=e[34];let Z;e[35]!==i?(Z=i?n.jsx(P9,{size:14}):n.jsx(Vs,{size:14}),e[35]=i,e[36]=Z):Z=e[36],e[37]!==s||e[38]!==Z?(v=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,n.jsx("button",{type:"button",onClick:s,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:Z})]}),e[37]=s,e[38]=Z,e[39]=v):v=e[39],u="flex flex-col gap-8 p-6",f=U.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:"Subtasks"}),n.jsx("div",{className:"flex flex-col gap-1",children:U.map(n3)})]}),m=n.jsx(Ym,{items:W});let J;e[40]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Context Breakdown"}),e[40]=J):J=e[40],e[41]!==R||e[42]!==P||e[43]!==k?(p=n.jsxs("div",{className:"flex flex-col gap-3",children:[J,n.jsx(Xm,{userTokens:k,assistantTokens:R,otherTokens:P})]}),e[41]=R,e[42]=P,e[43]=k,e[44]=p):p=e[44],_=z.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:"Raw messages"}),n.jsx("div",{className:"flex flex-col gap-1",children:z.map(B=>{const X=B.metadata?.created_at,V=o?.id===B.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>a(V?null:B),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:le("shrink-0 font-medium",B.role==="user"?"text-chart-1":"text-chart-2"),children:B.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:B.id})]}),X&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:new Date(X).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})})]}),V&&n.jsxs(n.Fragment,{children:[B.role==="assistant"&&(()=>{const ee=B.metadata?._request;if(!ee)return null;const te=ee.systemSections??[],ae=Math.max(1,...te.map(i3)),de=te.reduce(s3,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:"Request"}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[ee.activeTools??0," / ",ee.tools??0," ","tools active"]})]}),te.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:["System prompt"," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(de/4).toLocaleString()," ","tok"]})]}),te.map((fe,Q)=>{const se=fe.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${Q}`,oe=fe.chars/ae*100,he=Math.round(fe.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:se}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",he.toLocaleString()," tok"]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${oe}%`}})})]},Q)})]})]})})(),n.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(B,null,2)})]})]},B.id)})})]})}e[0]=d,e[1]=i,e[2]=r,e[3]=l,e[4]=s,e[5]=o?.id,e[6]=c,e[7]=h?.title,e[8]=u,e[9]=f,e[10]=m,e[11]=p,e[12]=_,e[13]=L,e[14]=v,e[15]=x}else u=e[8],f=e[9],m=e[10],p=e[11],_=e[12],L=e[13],v=e[14],x=e[15];if(x!==Symbol.for("react.early_return_sentinel"))return x;let g;e[45]!==u||e[46]!==f||e[47]!==m||e[48]!==p||e[49]!==_?(g=n.jsxs("div",{className:u,children:[f,m,p,_]}),e[45]=u,e[46]=f,e[47]=m,e[48]=p,e[49]=_,e[50]=g):g=e[50];let y;return e[51]!==L||e[52]!==v||e[53]!==g?(y=n.jsxs("div",{className:L,children:[v,g]}),e[51]=L,e[52]=v,e[53]=g,e[54]=y):y=e[54],y}function s3(t,e){return t+e.chars}function i3(t){return t.chars}function n3(t,e){return n.jsx(e3,{part:t},e)}function r3(t){return(t.parts??[]).filter(o3)}function o3(t){return t.type==="tool-subtask"}function a3(t){return t.role!=="system"}function l3(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function c3(t){return t.role==="assistant"}function d3(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function h3(t){return t.role==="user"}function u3(t){return t.role==="assistant"&&t.metadata?.usage}function f3(t){const e=F.c(13),{readOnly:s,identity:i,aboveRow:r,input:o,iceBreakers:a}=t,l=!s&&i?i:null;let d;e[0]!==r||e[1]!==s?(d=!s&&r?n.jsx("div",{"data-chat-above-row":"true",className:"@container/chat-bottom flex justify-start gap-1",children:r}):null,e[0]=r,e[1]=s,e[2]=d):d=e[2];let c;e[3]!==o||e[4]!==d?(c=n.jsxs("div",{className:"flex flex-col gap-2",children:[d,o]}),e[3]=o,e[4]=d,e[5]=c):c=e[5];let h;e[6]!==a||e[7]!==s?(h=!s&&a?n.jsx("div",{className:"w-full",children:a}):null,e[6]=a,e[7]=s,e[8]=h):h=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==h?(u=n.jsx("div",{"data-chat-centered":"true",className:"h-full w-full flex flex-col items-center justify-center px-4 gap-6",children:n.jsxs("div",{className:"w-full max-w-3xl flex flex-col gap-6",children:[l,c,h]})}),e[9]=l,e[10]=c,e[11]=h,e[12]=u):u=e[12],u}function m3(t){const e=F.c(25),{onOpenContextPanel:s}=t,{org:i}=Fe(),{selectedVirtualMcp:r}=ul();let o;e[0]!==i.id?(o=ld(i.id),e[0]=i.id,e[1]=o):o=e[1];const l=r??o,d=xs(l.id),c=id(),{data:h}=Hi.useSession(),u=h?.user?.id,f=c?.activeTask??null,m=!!(u&&f?.created_by&&f.created_by!==u);let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(qf,{size:32}),e[2]=p):p=e[2];let _;e[3]!==l.icon||e[4]!==l.title?(_=n.jsx(ys,{icon:l.icon,name:l.title,size:"lg",fallbackIcon:p,className:"size-10 min-w-10 md:size-[60px]! md:min-w-[60px] rounded-xl md:rounded-[18px]!"}),e[3]=l.icon,e[4]=l.title,e[5]=_):_=e[5];let L;e[6]!==l.title?(L=n.jsx("h3",{className:"text-base md:text-xl font-medium text-foreground",children:l.title}),e[6]=l.title,e[7]=L):L=e[7];const v=l.description??"Ask anything about configuring model providers or using MCP Mesh.";let x;e[8]!==v?(x=n.jsx("div",{className:"text-muted-foreground text-center text-base max-w-md line-clamp-2",children:v}),e[8]=v,e[9]=x):x=e[9];let g;e[10]!==_||e[11]!==L||e[12]!==x?(g=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 md:gap-4 text-center",children:[_,L,x]}),e[10]=_,e[11]=L,e[12]=x,e[13]=g):g=e[13];const y=c?.currentBranch??null;let b;e[14]!==d||e[15]!==y?(b=n.jsx(_f,{virtualMcp:d,currentBranch:y}),e[14]=d,e[15]=y,e[16]=b):b=e[16];let S;e[17]!==s?(S=n.jsx(ot.Input,{onOpenContextPanel:s}),e[17]=s,e[18]=S):S=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(ot.IceBreakers,{}),e[19]=w):w=e[19];let C;return e[20]!==m||e[21]!==S||e[22]!==g||e[23]!==b?(C=n.jsx(f3,{readOnly:m,identity:g,aboveRow:b,input:S,iceBreakers:w}),e[20]=m,e[21]=S,e[22]=g,e[23]=b,e[24]=C):C=e[24],C}function K9(t){const e=F.c(17),{outputs:s,collapsed:i,onToggle:r,variant:o}=t,a=o==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let l;e[0]!==a?(l=le(a),e[0]=a,e[1]=l):l=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=d):d=e[2];const c=i&&"-rotate-90";let h;e[3]!==c?(h=le("size-4 text-muted-foreground transition-transform",c),e[3]=c,e[4]=h):h=e[4];let u;e[5]!==h?(u=n.jsx(ds,{className:h}),e[5]=h,e[6]=u):u=e[6];let f;e[7]!==r||e[8]!==u?(f=n.jsxs("button",{type:"button",onClick:r,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[d,u]}),e[7]=r,e[8]=u,e[9]=f):f=e[9];let m;e[10]!==i||e[11]!==s?(m=!i&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(p3)}),e[10]=i,e[11]=s,e[12]=m):m=e[12];let p;return e[13]!==l||e[14]!==f||e[15]!==m?(p=n.jsxs("div",{className:l,children:[f,m]}),e[13]=l,e[14]=f,e[15]=m,e[16]=p):p=e[16],p}function p3(t){return n.jsx(Af,{file:t},t.key)}function g3(){const t=F.c(13),e=id()?.taskId??null,s=Tf();let i;t[0]!==s?(i={enabled:s},t[0]=s,t[1]=i):i=t[1];const{data:r}=od(e,i),[o,a]=M.useState(!1),[l,d]=M.useState(!0);if(!e||!r||r.length===0)return null;let c;t[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>a(L3),t[2]=c):c=t[2];let h;t[3]!==o||t[4]!==r?(h=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(K9,{variant:"card",outputs:r,collapsed:o,onToggle:c})}),t[3]=o,t[4]=r,t[5]=h):h=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=()=>d(_3),t[6]=u):u=t[6];let f;t[7]!==l||t[8]!==r?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(K9,{variant:"bar",outputs:r,collapsed:l,onToggle:u})}),t[7]=l,t[8]=r,t[9]=f):f=t[9];let m;return t[10]!==h||t[11]!==f?(m=n.jsxs(n.Fragment,{children:[h,f]}),t[10]=h,t[11]=f,t[12]=m):m=t[12],m}function _3(t){return!t}function L3(t){return!t}function v3(){const t=F.c(26),{org:e}=Fe(),s=bd(),{isChatEmpty:i}=ui(),[r,o]=M.useState("chat"),a=Gf(),l=e2();if(s.length===0&&!Yf(l)){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(ot,{className:"animate-in fade-in-0 duration-200",children:n.jsx(ot.Main,{className:"flex flex-col items-center",children:n.jsx(ot.EmptyState,{children:n.jsx(ot.NoAiProviderEmptyState,{})})})}),t[0]=b):b=t[0],b}let c;t[1]!==a.hasDecoKey||t[2]!==a.hasOnlyDecoProvider||t[3]!==a.isLoading||t[4]!==a.isZeroBalance||t[5]!==i||t[6]!==e?(c=a.hasDecoKey&&a.isZeroBalance&&a.hasOnlyDecoProvider&&!a.isLoading&&i&&!Lf(e.id),t[1]=a.hasDecoKey,t[2]=a.hasOnlyDecoProvider,t[3]=a.isLoading,t[4]=a.isZeroBalance,t[5]=i,t[6]=e,t[7]=c):c=t[7];const h=c;let u;t[8]!==h?(u=h&&n.jsx(ot.CreditsEmptyState,{}),t[8]=h,t[9]=u):u=t[9];const f=r!=="chat"?"opacity-0 pointer-events-none":"opacity-100";let m;t[10]!==f?(m=le("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",f),t[10]=f,t[11]=m):m=t[11];let p;t[12]!==i?(p=i?n.jsx(ot.Main,{children:n.jsx(m3,{onOpenContextPanel:()=>o("context")})}):n.jsxs(n.Fragment,{children:[n.jsxs(ot.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(g3,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(ot.Messages,{})})]}),n.jsx(ot.Footer,{children:n.jsx(ot.Input,{onOpenContextPanel:()=>o("context")})})]}),t[12]=i,t[13]=p):p=t[13];let _;t[14]!==m||t[15]!==p?(_=n.jsx("div",{className:m,children:p}),t[14]=m,t[15]=p,t[16]=_):_=t[16];const L=r==="context"?"opacity-100":"opacity-0 pointer-events-none";let v;t[17]!==L?(v=le("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",L),t[17]=L,t[18]=v):v=t[18];let x;t[19]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(t3,{back:!0,onClose:()=>o("chat")}),t[19]=x):x=t[19];let g;t[20]!==v?(g=n.jsx("div",{className:v,children:x}),t[20]=v,t[21]=g):g=t[21];let y;return t[22]!==u||t[23]!==_||t[24]!==g?(y=n.jsxs(ot,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[u,_,g]}),t[22]=u,t[23]=_,t[24]=g,t[25]=y):y=t[25],y}function ih(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ot.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Jt,{fallback:e,children:n.jsx(M.Suspense,{fallback:n.jsx(ot.Skeleton,{}),children:n.jsx(v3,{})})}),t[1]=s):s=t[1],s}function x3(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",i=t.mainParamPresent?t.mainParamValue!=="0":!s,r=s?!0:t.entityMetadata?.chatDefaultOpen??!1;return{mainOpen:i,chatOpen:r}}function q9(t,e){return t&&e?{chat:45,main:55}:t&&!e?{chat:100,main:0}:!t&&e?{chat:0,main:100}:{chat:0,main:0}}function y3(t,e){return t===1?!0:t===0?!1:e}function b3(t,e){const s=Vt(),i=no({strict:!1}),r=J0({strict:!1}),{create:o}=Ed(),{locator:a}=Fe(),{virtualMcpId:l,orgSlug:d,isAgentRoute:c}=e,h=x3({entityMetadata:t,mainParamPresent:i.main!==void 0,mainParamValue:i.main}),u=y3(i.chat,h.chatOpen),f=h.mainOpen,m=M.useRef(crypto.randomUUID()),p=r.taskId??m.current,_="/$org/$taskId",L=N=>({org:d,taskId:N}),v=c?{virtualmcpid:l}:{},x=(N,T)=>{s({to:_,params:L(p),search:A=>({...A,...N}),replace:T?.replace??!1})},g=(N,T)=>{s({to:_,params:L(N),search:A=>{const j={};return T?j.virtualmcpid=T:c&&(j.virtualmcpid=l),j}})},y=()=>{f?x({main:"0"},{replace:!0}):x({main:ua(t)},{replace:!0})},b=()=>{x({chat:u?0:1},{replace:!0})},S=()=>{u||x({chat:1},{replace:!0})},w=async()=>{const N=crypto.randomUUID(),T=t2(d,a,p);try{await o({id:N,virtual_mcp_id:l,...T?{branch:T}:{}})}catch{}s({to:_,params:L(N),search:A=>({...v,chat:1})})},C=N=>{x({main:N},{replace:!0})};return{taskId:p,mainOpen:f,chatOpen:u,mainParam:i.main,setTaskId:g,toggleMain:y,toggleChat:b,openChat:S,createNewTask:w,openTab:C}}const Dl=45;function nh(t,e=Dl){const s=typeof t=="number"?t:Number(t);return!Number.isFinite(s)||s<=0||s>=100?e:s}function S3(t){return nh(t,Dl)}function w3(){const t=F.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=tf.decoChatPanelWidth(),t[0]=e):e=t[0];const[s,i]=ef(e,S3);let r;t[1]!==s?(r=nh(s,Dl),t[1]=s,t[2]=r):r=t[2];const o=r;let a;return t[3]!==i||t[4]!==o?(a=[o,i],t[3]=i,t[4]=o,t[5]=a):a=t[5],a}function C3(t){try{return JSON.parse(t)}catch{return null}}function k3(t){if(!t||typeof t!="object")return null;const e=t,s=e.content?.find(o=>o.type==="text")?.text,i=s?C3(s):null,r=e.structuredContent;return r==null?i:typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0?i??r:r}function gi(t){const e=k3(t);return e===null?null:e}function Il(t){if(!t)return null;const e=t.match(/\/pull\/(\d+)\b/);if(!e)return null;const s=Number(e[1]);return Number.isFinite(s)&&s>0?s:null}function j3(t){if(!t||typeof t!="object")return null;const e=t.content?.find(r=>r.type==="text")?.text;if(!e)return null;const s=e.match(/https:\/\/github\.com\/[^\s"]+\/pull\/\d+/)?.[0],i=Il(s);return!i||!s?null:{number:i,htmlUrl:s}}const G9=/[\r\n<>]/,N3=/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;function Xn(t){const e=t?.userName?.trim();if(!e||G9.test(e))return null;const s=t?.userEmail?.trim();return!s||G9.test(s)?{userName:e}:N3.test(s)?{userName:e,userEmail:s}:{userName:e}}function E3(t){return t.split(`
|
|
3
3
|
`).filter(e=>!/^Co-authored-by:\s/i.test(e)).join(`
|
|
4
4
|
`).trimEnd()}function T3(t){const e=t.userName.trim(),s=t.userEmail?.trim();return s?`Co-authored-by: ${e} <${s}>`:`Co-authored-by: ${e}`}function rh(t,e){const s=Xn(e);if(!s)return t;const i=E3(t),r=T3(s);if(i.includes(r))return i;const o=i.trimEnd();return o.length>0?`${o}
|
|
5
5
|
|
|
@@ -448,7 +448,7 @@ ${X}`:X;c.setValue("metadata.instructions",V,{shouldDirty:!0})},q=new Set(h.map(
|
|
|
448
448
|
window.__cmsEditorActive = false;
|
|
449
449
|
}
|
|
450
450
|
});
|
|
451
|
-
})();`;function bi(t){return t.replace(/[`*_]/g,"\\$&")}function Wg(t,e){const s=[`The user selected an element on the live preview and asked: **"${bi(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&s.push(`**Section
|
|
451
|
+
})();`;function bi(t){return t.replace(/[`*_]/g,"\\$&")}function Wg(t,e){const s=[`The user selected an element on the live preview and asked: **"${bi(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&s.push(`**Section resolveType:** \`${bi(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const i=`<${t.tag}${t.classes?` class="${bi(t.classes)}"`:""}>`;s.push(`**Clicked element:** \`${i}\``),t.parents&&s.push(`**DOM breadcrumb:** ${bi(t.parents)} > ${t.tag}`),t.text&&s.push(`**Text content:** "${bi(t.text)}"`),t.componentName&&s.push(`**Component name:** ${bi(t.componentName)}`);const r=t.html.replace(/```/g,"`` `");return s.push("","**HTML snippet:**","```html",r,"```"),s.push("","Please read the source file, locate the element, and apply the requested change."),s.join(`
|
|
452
452
|
`)}function Vg(t,e,s=320,i=44,r=12){const{x:o,y:a}=t,{width:l,height:d}=e,c=Math.max(r,Math.min(o-s/2,l-s-r)),u=a/d>.68?Math.max(r,a-i-18):Math.min(a+18,d-i-r);return{leftPct:c/l*100,topPct:u/d*100}}function Kg(t){const e=F.c(32),{element:s,onDismiss:i}=t,[r,o]=M.useState(""),a=M.useRef(null),{sendMessage:l}=ui(),{setChatOpen:d}=gl();let c;e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==l||e[4]!==d?(c=()=>{if(!r.trim())return;const T=Wg(s,r);d(!0),l({parts:[{type:"text",text:T}]}),i()},e[0]=s,e[1]=r,e[2]=i,e[3]=l,e[4]=d,e[5]=c):c=e[5];const h=c;let u;e[6]!==s.position||e[7]!==s.viewport?(u=Vg(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=u):u=e[8];const f=u,m=`${f.leftPct}%`,p=`${f.topPct}%`;let _;e[9]!==m||e[10]!==p?(_={left:m,top:p,width:"320px"},e[9]=m,e[10]=p,e[11]=_):_=e[11];let L;e[12]!==h?(L=T=>{T.preventDefault(),h()},e[12]=h,e[13]=L):L=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=T=>o(T.target.value),e[14]=v):v=e[14];let x;e[15]!==i?(x=T=>{T.key==="Escape"&&i()},e[15]=i,e[16]=x):x=e[16];let g;e[17]!==r||e[18]!==x?(g=n.jsx("input",{ref:a,autoFocus:!0,type:"text",value:r,onChange:v,onKeyDown:x,placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[17]=r,e[18]=x,e[19]=g):g=e[19];let y;e[20]!==r?(y=r.trim(),e[20]=r,e[21]=y):y=e[21];const b=!y;let S;e[22]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[n.jsx("title",{children:"Send"}),n.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e[22]=S):S=e[22];let w;e[23]!==b?(w=n.jsx("button",{type:"submit",disabled:b,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity disabled:opacity-30",title:"Send",children:S}),e[23]=b,e[24]=w):w=e[24];let C;e[25]!==w||e[26]!==L||e[27]!==g?(C=n.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:L,children:[g,w]}),e[25]=w,e[26]=L,e[27]=g,e[28]=C):C=e[28];let N;return e[29]!==C||e[30]!==_?(N=n.jsx("div",{className:"absolute z-30 pointer-events-none",style:_,children:C}),e[29]=C,e[30]=_,e[31]=N):N=e[31],N}const hu={claiming:{long:"Reserving sandbox",short:"Reserving sandbox"},"waiting-for-capacity":{long:"Waiting for cluster capacity",short:"Waiting for capacity"},"pulling-image":{long:"Downloading sandbox image",short:"Downloading image"},"starting-container":{long:"Starting your sandbox",short:"Starting container"},"warming-daemon":{long:"Connecting to your sandbox",short:"Connecting to sandbox"}},qg=["provision","cloning","install","dev"];function uu(t){switch(t.lifecycle.phase){case"cloning":case"checking-out":return{step:"cloning",status:"doing"};case"clone-failed":return{step:"cloning",status:"failed"};case"installing":return{step:"install",status:"doing"};case"install-failed":return{step:"install",status:"failed"};case"starting":return{step:"dev",status:"doing"};case"running":return{step:"dev",status:"done"};case"start-failed":return{step:"dev",status:"failed"};case"crashed":return{step:"dev",status:"failed"};case"idle":return t.claimPhase&&t.claimPhase.kind!=="ready"&&t.claimPhase.kind!=="failed"?{step:"provision",status:"doing"}:{step:"cloning",status:"doing"}}}function Gg(t){switch(t){case"starting":return"Starting your sandbox";case"suspended":return"Sandbox is paused"}}function Yg(t){return qg.indexOf(t.step)}const pc=48,fu=28,mu=3,Jg=(()=>{const t=[];let e=0;for(let s=0;s<pc;s++)s===fu?t.push(null):(t.push(e/(pc-1)*mu),e++);return t})(),Xg={provision:"Reserving sandbox",cloning:"Cloning your repo",install:"Installing packages",dev:"Starting your preview"};function Zg(t,e){return t.step==="provision"&&e!=null&&e.kind!=="ready"&&e.kind!=="failed"?hu[e.kind].long:Xg[t.step]}const ps="bg-foreground/[0.05]",Gt="bg-foreground/[0.09]",Qg=Array.from({length:35},()=>Math.random()*1.8),e_=Array.from({length:35},()=>Math.random()<.4);function t_(t){const e=F.c(30),{progress:s,claimPhase:i}=t;let r;e[0]!==s?(r=Yg(s),e[0]=s,e[1]=r):r=e[1];const o=r;let a;e[2]!==i||e[3]!==s?(a=Zg(s,i),e[2]=i,e[3]=s,e[4]=a):a=e[4];const l=a;let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(If,{}),e[5]=d):d=e[5];const c=`${s.step}-${l}`;let h;e[6]!==l||e[7]!==c?(h=n.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-foreground/10 bg-background px-3.5 py-1.5 shadow-[0_4px_20px_-4px_rgb(0_0_0_/_0.12)]",children:[d,n.jsxs("span",{className:"animate-in fade-in text-[13px] font-medium text-foreground/85 duration-500",children:[l,"…"]},c)]}),e[6]=l,e[7]=c,e[8]=h):h=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(s_,{}),e[9]=u):u=e[9];let f;e[10]!==o?(f=n.jsx(lr,{phase:0,current:o,children:u}),e[10]=o,e[11]=f):f=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(n_,{}),e[12]=m):m=e[12];let p;e[13]!==o?(p=n.jsx(lr,{phase:1,current:o,children:m}),e[13]=o,e[14]=p):p=e[14];let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(r_,{}),e[15]=_):_=e[15];let L;e[16]!==o?(L=n.jsx(lr,{phase:2,current:o,children:_}),e[16]=o,e[17]=L):L=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(a_,{}),e[18]=v):v=e[18];let x;e[19]!==o?(x=n.jsx(lr,{phase:3,current:o,children:v}),e[19]=o,e[20]=x):x=e[20];let g;e[21]!==L||e[22]!==x||e[23]!==f||e[24]!==p?(g=n.jsxs("div",{className:"relative aspect-[4/3] w-[min(78%,560px)]",children:[f,p,L,x]}),e[21]=L,e[22]=x,e[23]=f,e[24]=p,e[25]=g):g=e[25];let y;e[26]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx("style",{children:`
|
|
453
453
|
@keyframes vm-pulse-soft {
|
|
454
454
|
0%, 100% { opacity: 0.25; }
|
|
@@ -463,8 +463,8 @@ ${X}`:X;c.setValue("metadata.instructions",V,{shouldDirty:!0})},q=new Set(h.map(
|
|
|
463
463
|
8% { opacity: 1; }
|
|
464
464
|
22% { opacity: 0; }
|
|
465
465
|
}
|
|
466
|
-
`}),e[26]=y):y=e[26];let b;return e[27]!==g||e[28]!==h?(b=n.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center gap-12 select-none [clip-path:inset(-24px_0_-200px_0)]",children:[h,g,y]}),e[27]=g,e[28]=h,e[29]=b):b=e[29],b}function lr(t){const e=F.c(10),{phase:s,current:i,children:r}=t,o=s-i,a=o<0,l=o===0,d=a?90:o*-22,c=a?.94:1-Math.max(o,0)*.04,h=a?0:l?1:o===1?.8:.55,u=a?10:30-o,f=!l;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=le("absolute inset-0 overflow-hidden rounded-xl border border-foreground/10 bg-background shadow-[0_20px_60px_-20px_rgb(0_0_0_/_0.35)] transition-all ease-[cubic-bezier(0.22,1,0.36,1)]"),e[0]=m):m=e[0];const p=`translateY(${d}px) scale(${c})`,_=l?"auto":"none";let L;e[1]!==h||e[2]!==p||e[3]!==_||e[4]!==u?(L={transform:p,opacity:h,zIndex:u,transitionDuration:"1000ms",pointerEvents:_},e[1]=h,e[2]=p,e[3]=_,e[4]=u,e[5]=L):L=e[5];let v;return e[6]!==r||e[7]!==f||e[8]!==L?(v=n.jsx("div",{"aria-hidden":f,className:m,style:L,children:r}),e[6]=r,e[7]=f,e[8]=L,e[9]=v):v=e[9],v}function bo(t){const e=F.c(7),{showUrl:s}=t,i=s===void 0?!1:s;let r,o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:le("size-2.5 rounded-full",Gt)}),o=n.jsx("div",{className:le("size-2.5 rounded-full",Gt)}),a=n.jsx("div",{className:le("size-2.5 rounded-full",Gt)}),e[0]=r,e[1]=o,e[2]=a):(r=e[0],o=e[1],a=e[2]);let l;e[3]!==i?(l=i&&n.jsx("div",{className:le("ml-3 h-3.5 max-w-[220px] flex-1 rounded-sm",ps)}),e[3]=i,e[4]=l):l=e[4];let d;return e[5]!==l?(d=n.jsxs("div",{className:"flex h-7 shrink-0 items-center gap-1.5 px-3",children:[r,o,a,l]}),e[5]=l,e[6]=d):d=e[6],d}function s_(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bo,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex h-full flex-col",children:[e,n.jsx("div",{className:"flex flex-1 px-8 py-5",children:n.jsx("div",{className:"grid h-full w-full grid-cols-8 grid-rows-6 gap-2",children:Jg.map(i_)})})]}),t[1]=s):s=t[1],s}function i_(t,e){if(e===fu)return n.jsx("div",{className:"rounded-md bg-chart-1/[0.55]",style:{animation:"vm-breathe 2.4s ease-in-out infinite"}},e);const s=t;return n.jsx("div",{className:le("relative rounded-md",Gt),children:n.jsx("div",{className:"absolute inset-0 rounded-md bg-chart-1/40 opacity-0",style:{animation:`vm-rack-scan ${mu}s ease-in-out infinite`,animationDelay:`${s}s`}})},e)}function n_(){const t=F.c(5);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bo,{}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:le("w-[18%] rounded-md",ps),style:{animation:"vm-breathe 3s ease-in-out infinite"}}),t[1]=s):s=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"h-[42%] shrink-0 rounded-md bg-chart-3/[0.12]",style:{animation:"vm-breathe 3s ease-in-out 0.4s infinite"}}),t[2]=i):i=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"col-span-3 rounded-md bg-chart-3/[0.12]",style:{animation:"vm-breathe 3s ease-in-out 0.8s infinite"}}),t[3]=r):r=t[3];let o;return t[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"flex h-full flex-col",children:[e,n.jsxs("div",{className:"flex min-h-0 flex-1 gap-1.5 p-3",children:[s,n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[i,n.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-5 gap-1.5",children:[r,n.jsxs("div",{className:"col-span-2 grid grid-rows-2 gap-1.5",children:[n.jsx("div",{className:le("rounded-md",ps),style:{animation:"vm-breathe 3s ease-in-out 1.2s infinite"}}),n.jsx("div",{className:le("rounded-md",ps),style:{animation:"vm-breathe 3s ease-in-out 1.6s infinite"}})]})]})]})]})]}),t[4]=o):o=t[4],o}function r_(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bo,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex h-full flex-col",children:[e,n.jsx("div",{className:"relative flex flex-1 items-center justify-center px-8 py-5",children:n.jsx("div",{className:"grid w-full gap-2",style:{gridTemplateColumns:"repeat(7, minmax(0, 1fr))"},children:Qg.map(o_)})})]}),t[1]=s):s=t[1],s}function o_(t,e){return n.jsx("div",{className:le("aspect-square rounded-md",e_[e]?"bg-chart-2/70":Gt),style:{animation:`vm-pulse-soft 2.2s ease-in-out ${t}s infinite`}},e)}function a_(){const t=F.c(11);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bo,{showUrl:!0}),t[0]=e):e=t[0];let s,i,r,o,a;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"mb-2 h-5 rounded-md bg-chart-1/[0.10]"}),i=n.jsx("div",{className:le("h-1.5 w-[70%] rounded-sm",Gt)}),r=n.jsx("div",{className:le("h-1.5 w-[55%] rounded-sm",Gt)}),o=n.jsx("div",{className:le("h-1.5 w-[80%] rounded-sm",Gt)}),a=n.jsx("div",{className:le("h-1.5 w-[50%] rounded-sm",Gt)}),t[1]=s,t[2]=i,t[3]=r,t[4]=o,t[5]=a):(s=t[1],i=t[2],r=t[3],o=t[4],a=t[5]);let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex w-[18%] shrink-0 flex-col gap-1.5 bg-chart-1/[0.05] p-2.5",children:[s,i,r,o,a,n.jsx("div",{className:"mt-auto",children:n.jsx("div",{className:le("h-4 rounded-md",Gt)})})]}),t[6]=l):l=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("div",{className:"relative h-[42%] shrink-0 overflow-hidden bg-chart-1/[0.10]",children:n.jsxs("div",{className:"absolute right-3 bottom-3 left-3 space-y-1.5",children:[n.jsx("div",{className:"h-3 w-[35%] rounded-sm bg-chart-1/[0.15]"}),n.jsx("div",{className:le("h-1.5 w-[55%] rounded-sm",ps)})]})}),t[7]=d):d=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[n.jsx("div",{className:"h-4 w-12 rounded-full bg-chart-1/[0.12]"}),n.jsx("div",{className:le("h-4 w-10 rounded-full",ps)}),n.jsx("div",{className:le("h-4 w-14 rounded-full",ps)})]}),t[8]=c):c=t[8];let h;t[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs("div",{className:le("col-span-3 flex flex-col justify-end gap-1 rounded-md p-2",ps),children:[n.jsx("div",{className:le("h-1.5 w-[50%] rounded-sm",Gt)}),n.jsx("div",{className:le("h-1 w-[75%] rounded-sm",Gt)})]}),t[9]=h):h=t[9];let u;return t[10]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs("div",{className:"flex h-full flex-col",children:[e,n.jsxs("div",{className:"flex min-h-0 flex-1",children:[l,n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[d,n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2.5 p-3",children:[c,n.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-5 gap-2",children:[h,n.jsxs("div",{className:"col-span-2 grid grid-rows-2 gap-2",children:[n.jsx("div",{className:le("rounded-md",ps)}),n.jsx("div",{className:le("rounded-md",ps)})]})]})]})]})]})]}),t[10]=u):u=t[10],u}function Jr(t){const e=F.c(9);if(t.kind==="starting"){let l;return e[0]!==t.claimPhase||e[1]!==t.progress?(l=n.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background p-6",children:n.jsx(t_,{progress:t.progress,claimPhase:t.claimPhase})}),e[0]=t.claimPhase,e[1]=t.progress,e[2]=l):l=e[2],l}let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(O2,{className:"size-12 text-blue-500"}),e[3]=s):s=e[3];let i,r;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("h3",{className:"text-lg font-medium",children:Gg("suspended")}),r=n.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:"Resume to continue."}),e[4]=i,e[5]=r):(i=e[4],r=e[5]);let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Mi,{className:"size-4"}),e[6]=o):o=e[6];let a;return e[7]!==t.onResume?(a=n.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background p-6",children:n.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-4 text-center",children:[s,i,r,n.jsxs(ie,{onClick:t.onResume,className:"mt-2",children:[o," Resume"]})]})}),e[7]=t.onResume,e[8]=a):a=e[8],a}function l_(t){const e=F.c(12),{orgSlug:s,virtualMcpId:i,branch:r,enabled:o}=t,a=o===void 0?!0:o;let l;e[0]!==r||e[1]!==s||e[2]!==i?(l=Tt.sandboxRepoDir(s,i,r),e[0]=r,e[1]=s,e[2]=i,e[3]=l):l=e[3];let d;e[4]!==r||e[5]!==s||e[6]!==i?(d=async()=>{const u=`/api/${s}/sandbox/${encodeURIComponent(i)}/${encodeURIComponent(r)}/config`,f=await fetch(u);return f.ok?(await f.json()).repoDir??null:null},e[4]=r,e[5]=s,e[6]=i,e[7]=d):d=e[7];let c;return e[8]!==a||e[9]!==l||e[10]!==d?(c={queryKey:l,queryFn:d,enabled:a,staleTime:1/0},e[8]=a,e[9]=l,e[10]=d,e[11]=c):c=e[11],Ps(c).data??null}const gc="https://decoims.com/decocms/01b321bd-4613-4b2c-9348-35058444d210/Visual_Studio_Code_1.35_icon.svg.png",_c="https://decoims.com/decocms/7583d3b5-81d0-4afb-becf-6a59bbb3a68e/cursor-logo-icon-freelogovectors.net_.png",c_=M.lazy(()=>cs(()=>import("./sections-editor-BLU0buUC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SectionsEditor}))),d_=M.lazy(()=>cs(()=>import("./page-seo-sheet-CpMq28JR.js"),__vite__mapDeps([142,1,2,71,42,44,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,74,75,76,77,78,79,98,99,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SeoSheet}))),h_=M.lazy(()=>cs(()=>import("./file-explorer-CwlDpz6e.js"),__vite__mapDeps([143,1,2,118,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,123,144,117,107,80,110,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,108,109,111,112,113,114,115,116,119,120,121,122,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.FileExplorer}))),Oo=500,u_={mobile:375,tablet:768,desktop:null},$o=["desktop","mobile","tablet"],f_={mobile:"Mobile (375px)",tablet:"Tablet (768px)",desktop:"Desktop"},m_="website/sections/Rendering/Lazy.tsx";function wa(t,e){let s=t,i=typeof s?.__resolveType=="string"?s.__resolveType:"";for(let r=0;i&&r<5;r++){const o=e[i];if(o&&typeof o=="object"&&"__resolveType"in o){const a=o.__resolveType;if(typeof a=="string"&&a&&a!==i){s=o,i=a;continue}}break}if(!i)return[];if(i.includes("flags/multivariate")){const r=Array.isArray(s.variants)?s.variants:[],o=[];for(const a of r){const l=a?.value;if(l&&typeof l=="object")for(const d of wa(l,e))o.includes(d)||o.push(d)}return o}if(i===m_){const r=s.section&&typeof s.section=="object"?wa(s.section,e):[];return r.length?[i,...r]:[i]}return[i]}function p_(t,e){const s=new URL(t,window.location.href);return s.searchParams.set("deviceHint",e),s.href}function g_(){const t=yi(),{currentBranch:e}=Ds(),[s,i]=M.useState("preview"),[r,o]=M.useState("desktop"),[a,l]=M.useState(null),d=M.useRef(null),c=s==="cms",[h,u]=M.useState(null),[f,m]=M.useState(null),[p,_]=M.useState(384),L=M.useRef(!1),v=M.useRef(0),x=M.useRef(0),g=M.useRef(null),[y,b]=M.useState(!1),[S,w]=M.useState(""),C=M.useRef(null),[N,T]=M.useState(!1),[A,j]=M.useState(),[k,I]=M.useState(null),[E,R]=M.useState(null),[P,D]=M.useState("/"),[O,$]=M.useState(null),[K,z]=M.useState(!1),[U,G]=M.useState(!1),[q,W]=M.useState(null),H=t?.entity?.id??null,{org:Z}=Fe(),J=Cs(),B=Zl(),X=B.vmEntry,V=B.previewUrl,ee=J.lifecycle.phase,te=ee==="running",ae=X?.sandboxProviderKind==="user-desktop",de=l_({orgSlug:Z.slug,virtualMcpId:H??"",branch:e??"",enabled:ae&&te&&!!H&&!!e}),fe=ae?de:null,Q=H&&e&&te?{orgSlug:Z.slug,virtualMcpId:H,branch:e,previewUrl:V}:null,{data:se}=zl(Q,{fetchEnabled:te}),{data:oe}=Fl(Q,{fetchEnabled:te}),he=H&&e?{orgSlug:Z.slug,virtualMcpId:H,branch:e}:null,xe=Og(he),ve=se?Yl(se).sort((ne,ke)=>ne.name.localeCompare(ke.name)):[],be=se&&oe?Xl(se,oe):[],De=Ri,Ie=ve.filter(ne=>{if(!S)return!0;const ke=S.toLowerCase();return ne.name.toLowerCase().includes(ke)||ne.path.toLowerCase().includes(ke)}),Me=be.filter(ne=>{if(!S)return!0;const ke=S.toLowerCase();return ne.name.toLowerCase().includes(ke)||ne.key.toLowerCase().includes(ke)||ne.resolveType.toLowerCase().includes(ke)}),He=k?null:m4(ve,P,O),Je=k?k.name:He?.name,ge=He?.key??null,we=se&&ge?lu(se,ge,0):[],Be=se?iu(we,se):[],Ne=Be.map(ne=>ne.isSavedBlock?ne.label:""),nt=Be.map(ne=>ne.isSavedBlock?"global":ne.isMultivariate?"variant":"normal"),Ve=we.map(ne=>wa(ne,se??{})),ye=M.useRef(null),_e=M.useRef(null);C4(()=>{const ne=d.current,ke=ye.current;!ne||!ke||(ne.src=ke)});const Ue=J.status.state==="paused",Ze=J.phase,Xe=uu({claimPhase:Ze,lifecycle:J.lifecycle}),Ke=B.previewState,ce=B.userStopped,Y=Ke.kind==="starting"||Ke.kind==="iframe"&&Xe.status==="doing",me=Ke.kind==="iframe"?xg(p_(E??new URL(P,Ke.previewUrl).href,r),c&&f?f:[]):null,[Se,je]=M.useState(null);if(Ke.kind==="iframe"&&Se!==Ke.previewUrl){const ne=Se!==null;je(Ke.previewUrl),ne&&(_e.current=null,D("/"),R(null),$(null),I(null))}ye.current=me;const qe=!!H&&!!e&&!J.notFound&&!ce&&!Ue&&(Ze?.kind==="ready"||ee!=="idle"),rt=Ke.kind!=="iframe"&&(s==="visual"||s==="cms")?"preview":s;M.useEffect(()=>{if(!V)return;let ne;try{ne=new URL(V,window.location.href).origin}catch{return}const ke=yt=>{if(yt.origin===ne){if(yt.data?.type==="visual-editor::element-clicked"){const bt=zg.safeParse(yt.data.payload);bt.success&&l(bt.data)}else if(yt.data?.type==="cms-editor::section-clicked"){const bt=Hg.safeParse(yt.data.payload);bt.success&&u(bt.data.sectionIndex)}}};return window.addEventListener("message",ke),()=>window.removeEventListener("message",ke)},[V]),M.useEffect(()=>{if(!y)return;const ne=ke=>{C.current?.contains(ke.target)||(b(!1),w(""))};return document.addEventListener("pointerdown",ne),()=>document.removeEventListener("pointerdown",ne)},[y]),M.useEffect(()=>{if(!c)return;const ne=yt=>{const bt=yt.target;bt&&bt!==d.current&&(g.current=bt)},ke=()=>{requestAnimationFrame(()=>{const yt=document.activeElement;(yt===document.body||yt===d.current)&&g.current&&g.current.focus()})};return document.addEventListener("focusin",ne),document.addEventListener("blur",ke,!0),()=>{document.removeEventListener("focusin",ne),document.removeEventListener("blur",ke,!0)}},[c]);const ks=()=>{const ne=d.current?.contentWindow;ne&&ne.postMessage({type:"visual-editor::activate",script:Fg},"*")},Gs=()=>{const ne=d.current?.contentWindow;ne&&ne.postMessage({type:"visual-editor::deactivate"},"*")},A9=()=>{const ne=d.current?.contentWindow;ne&&(ne.postMessage({type:"visual-editor::activate",script:Ug},"*"),ne.postMessage({type:"cms-editor::set-labels",labels:Ne,kinds:nt,keys:Ve},"*"))},H1=()=>{const ne=d.current?.contentWindow;ne&&ne.postMessage({type:"cms-editor::deactivate"},"*")},nn=ne=>{const ke=s;i(ne),l(null),ne!=="code"&&W(null),ne!=="cms"&&(u(null),m(null)),ke==="visual"&&Gs(),ke==="cms"&&H1(),ne==="visual"&&ks(),ne==="cms"&&A9()},U1=()=>{if(!d.current||!me)return;const ne=d.current;ne.src=me},W1=ne=>{m(ne)},V1=()=>{const ne=d.current;if(!ne)return;const ke=document.activeElement,yt=ne.tabIndex;ne.tabIndex=-1,ne.style.pointerEvents="none",ne.blur();try{ne.contentWindow?.location.reload()}catch{const rs=ye.current;rs&&(ne.src=rs)}const bt=()=>{ne.tabIndex=yt,ne.style.pointerEvents="",ke?.focus(),ne.removeEventListener("load",bt)};ne.addEventListener("load",bt),setTimeout(bt,3e3)},K1=()=>{if(!d.current||!me)return;const ne=me.includes("?")?"&":"?";d.current.src=`${me}${ne}_r=${Date.now()}`},q1=()=>{const ne=$o.indexOf(r);o($o[(ne+1)%$o.length])},G1=()=>{const ne=d.current?.contentWindow?.location?.href??me??V;ne&&navigator.clipboard.writeText(ne)},Y1=(()=>{if(!V)return"No server running";if(k)return k.name;try{const ne=new URL(V),ke=P==="/"?"":P;return`${ne.host}${ke}`}catch{return V}})(),R9=ne=>{_e.current=ne.path,I(null),R(null),$(ne.key),D(ne.path),u(null),z(!1)},J1=ne=>{if(!V||!oe){ue.error("Preview metadata not ready yet");return}_e.current=null;const ke=wh(oe),yt=Pg(V,ke,ne.key);I(ne),R(yt),u(null)},X1=async({name:ne,path:ke})=>{if(!H||!e)return;const yt=Kl(ke);if(yt){j(yt);return}const bt=ke.trim().startsWith("/")?ke.trim():`/${ke.trim()}`;if(ve.some(rs=>De(rs.path)===De(bt))){j(`A page with path "${bt}" already exists.`);return}j(void 0);try{const rs=await xe.mutateAsync({name:ne,path:bt});T(!1),ue.success(`Page "${ne}" created`),await new Promise(Q1=>setTimeout(Q1,Oo)),R9({key:rs.key,name:rs.name,path:rs.path}),nn("cms")}catch(rs){j(rs instanceof Error?rs.message:"Failed to create page")}},Z1=[{value:"preview",icon:n.jsx($9,{size:14}),tooltip:"Interactive"},...Ke.kind==="iframe"?[{value:"visual",icon:n.jsx(z9,{size:14}),tooltip:"Visual editor"}]:[],...Ke.kind==="iframe"&&Gl(se,oe)?[{value:"cms",icon:n.jsx($2,{size:14}),tooltip:"Sections editor"}]:[],{value:"code",icon:n.jsx(z2,{size:14}),tooltip:"Code editor"}];return n.jsxs("div",{className:"flex flex-col w-full h-full",children:[qe&&n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-4 border-b border-border/60 px-3 md:px-4",children:[n.jsx("div",{className:"flex shrink-0 items-center gap-1",children:n.jsx(Tm,{value:rt,onValueChange:nn,options:Z1,size:"sm",className:"shrink-0 bg-foreground/4.5"})}),Ke.kind==="iframe"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:le("flex min-w-0 flex-1 items-center gap-0.5 ml-2",s==="code"&&"hidden"),children:[n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:U1,children:n.jsx(Pn,{size:14})})}),n.jsx(Te,{side:"bottom",children:"Refresh"})]}),n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:q1,children:n.jsxs("span",{className:"flex items-center justify-center animate-device-icon-pop",children:[r==="mobile"&&n.jsx(F2,{size:14}),r==="tablet"&&n.jsx(H2,{size:14}),r==="desktop"&&n.jsx($9,{size:14})]},r)})}),n.jsx(Te,{side:"bottom",children:f_[r]})]}),n.jsxs("div",{ref:C,className:"relative min-w-0 flex-1",children:[n.jsxs("button",{type:"button",className:"flex h-8 w-full min-w-0 items-center gap-1 rounded-md bg-background px-2 transition-colors duration-200 hover:bg-accent",onClick:()=>b(ne=>!ne),children:[k&&n.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[n.jsx(ri,{size:11}),"Global"]}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-[12px] text-foreground/88",children:Y1}),Je&&!k&&n.jsx("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:Je}),n.jsx(ds,{size:12,className:le("shrink-0 text-muted-foreground transition-transform",y&&"rotate-180")})]}),y&&n.jsxs("div",{className:"absolute left-0 right-0 top-full z-50 mt-1.5 overflow-hidden rounded-lg border bg-popover shadow-lg",children:[n.jsxs("div",{className:"px-2 h-10 flex items-center gap-2 border-b",children:[n.jsx(Zd,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),n.jsx("input",{type:"text",value:S,onChange:ne=>w(ne.target.value),placeholder:"Search pages and components...",className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground",autoFocus:!0})]}),n.jsx("div",{className:"p-1.5 border-b",children:n.jsxs("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:ne=>{ne.preventDefault(),b(!1),w(""),j(void 0),T(!0)},children:[n.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"flex-1 font-medium",children:"Create new page"})]})}),Ie.length===0&&Me.length===0?n.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:ve.length===0&&be.length===0?"No pages found in this site.":"No results match your search."}):n.jsxs("div",{className:"max-h-80 overflow-y-auto overscroll-contain",children:[Ie.length>0&&n.jsx("div",{className:"p-1.5",children:Ie.map(ne=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:ke=>{ke.preventDefault(),b(!1),w(""),R9(ne)},children:[n.jsx(Ti,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:ne.name}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:ne.path})]},ne.key))}),Me.length>0&&n.jsxs("div",{className:le("p-1.5",Ie.length>0&&"border-t"),children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Global components"}),Me.map(ne=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:ke=>{ke.preventDefault(),b(!1),w(""),J1(ne)},children:[n.jsx(ri,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:ne.name}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:ne.resolveType.split("/").pop()?.replace(/\.tsx?$/,"")})]},ne.key))]})]})]})]})]}),n.jsxs("div",{className:le("flex shrink-0 items-center gap-0.5",s==="code"&&"hidden"),children:[n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{const ne=me??Ke.previewUrl;ne&&window.open(ne,"_blank","noopener")},children:n.jsx(pi,{size:14})})}),n.jsx(Te,{side:"bottom",children:"Open in new tab"})]}),n.jsxs(Qt,{children:[n.jsx(es,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",children:n.jsx(Vi,{size:14})})}),n.jsxs(ts,{align:"end",className:"w-44",children:[n.jsx(We,{onClick:K1,children:"Hard Reload"}),n.jsx(We,{onClick:G1,children:"Copy Current URL"}),se&&oe&&n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),ge&&n.jsxs(We,{onClick:()=>{z(!0),nn("cms")},children:[n.jsx(Pr,{size:14}),"Edit SEO"]}),ge&&n.jsxs(We,{onClick:()=>{try{W(M9(ge)),nn("code")}catch{ue.error("Invalid page block key")}},children:[n.jsx(lo,{size:14}),"View JSON"]}),n.jsxs(We,{onClick:()=>G(!0),children:[n.jsx(Pr,{size:14}),"Site SEO"]})]}),fe&&n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),n.jsxs(We,{onClick:()=>window.open(`vscode://file${fe}?windowId=_blank`),children:[n.jsx("img",{src:gc,alt:"VSCode",width:14,height:14}),"Open in VSCode"]}),n.jsxs(We,{onClick:()=>window.open(`cursor://file${fe}?windowId=_blank`),children:[n.jsx("img",{src:_c,alt:"Cursor",width:14,height:14}),"Open in Cursor"]})]})]})]})]})]}),s==="code"&&fe&&n.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon","aria-label":"Open in VSCode",onClick:()=>window.open(`vscode://file${fe}?windowId=_blank`),children:n.jsx("img",{src:gc,alt:"VSCode",width:14,height:14})})}),n.jsx(Te,{side:"bottom",children:"Open in VSCode"})]}),n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon","aria-label":"Open in Cursor",onClick:()=>window.open(`cursor://file${fe}?windowId=_blank`),children:n.jsx("img",{src:_c,alt:"Cursor",width:14,height:14})})}),n.jsx(Te,{side:"bottom",children:"Open in Cursor"})]})]})]}),n.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c&&V&&e&&H&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"shrink-0 border-r overflow-hidden",style:{width:p},children:n.jsx(M.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),children:n.jsx(c_,{orgSlug:Z.slug,virtualMcpId:H,branch:e,previewReady:te,previewUrl:V,currentPath:P,activePageBlockKey:ge,activeGlobalBlockKey:k?.key??null,externalSelectedIndex:k?null:h,onSaved:()=>{setTimeout(V1,Oo)},initialEditSeo:K,onExitSeo:()=>z(!1),onViewJsonFile:ne=>{try{W(M9(ne)),nn("code")}catch{ue.error("Invalid page block key")}},onVariantPreviewOverride:W1})})}),n.jsx("div",{className:"w-1 shrink-0 cursor-col-resize bg-transparent hover:bg-border transition-colors",onPointerDown:ne=>{L.current=!0,v.current=ne.clientX,x.current=p,ne.currentTarget.setPointerCapture(ne.pointerId)},onPointerMove:ne=>{if(!L.current)return;const ke=ne.clientX-v.current;_(Math.max(240,Math.min(640,x.current+ke)))},onPointerUp:()=>{L.current=!1}})]}),n.jsxs("div",{className:le("flex-1 relative overflow-hidden",r!=="desktop"&&Ke.kind==="iframe"&&s!=="code"&&"flex justify-center bg-muted/30"),children:[Y&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Jr,{kind:"starting",progress:Xe,claimPhase:Ze})}),Ke.kind==="suspended"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Jr,{kind:"suspended",onResume:B.resume})}),rt==="visual"&&!a&&n.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-violet-400/40 bg-violet-500/90 px-3 py-1 text-xs font-medium text-white shadow-md backdrop-blur-sm pointer-events-none select-none",children:[n.jsx(z9,{size:12}),"Click any element to ask the AI"]}),rt==="visual"&&a&&n.jsx(Kg,{element:a,onDismiss:()=>l(null)}),s==="code"&&qe&&H&&e&&n.jsx("div",{className:"absolute inset-0 z-10 bg-background",children:n.jsx(M.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),children:n.jsx(h_,{orgSlug:Z.slug,virtualMcpId:H,branch:e,openPath:q})})}),Ke.kind==="iframe"&&me&&n.jsx("div",{className:le("h-full transition-[width] duration-250 [transition-timing-function:var(--ease-in-out-cubic)]",r!=="desktop"&&s!=="code"&&"w-full max-w-full border-x border-border bg-background shadow-sm"),style:{width:r==="desktop"||s==="code"?"100%":`${u_[r]}px`},children:n.jsx("iframe",{ref:d,src:me,className:le("w-full h-full border-0",s==="code"&&"invisible"),title:"Dev Server Preview",tabIndex:c?-1:void 0,onLoad:()=>{if(Ye("vm_preview_loaded",{view_mode:s,vm_id:X?.sandboxHandle??null}),!k)try{const ne=d.current?.contentWindow?.location?.pathname;if(!ne)return;const ke=_e.current;if(ke!==null){_e.current=null,De(ne)===De(ke)&&D(ne);return}D(ne)}catch{}s==="visual"&&ks(),s==="cms"&&A9()}},Ke.previewUrl)})]})]}),n.jsx($g,{open:N,onOpenChange:T,isPending:xe.isPending,error:A,onSubmit:X1}),U&&se&&oe&&n.jsx(M.Suspense,{fallback:null,children:n.jsx(d_,{open:U,onOpenChange:G,orgSlug:Z.slug,virtualMcpId:H??"",branch:e??"",decofile:se,meta:oe,onSaved:()=>{setTimeout(()=>{const ne=d.current;if(ne)try{ne.contentWindow?.location.reload()}catch{const ke=ye.current;ke&&(ne.src=ke)}},Oo)},target:{kind:"site"}})})]})}function __(t){const e=F.c(2),{virtualMcpId:s}=t,i=xs(s);if(!ni(i?.metadata)){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[n.jsx(Ui,{size:24,className:"text-muted-foreground/60"}),n.jsx("div",{children:"No source to preview."}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Connect a GitHub repository from the Connections tab to enable Preview."})]}),e[0]=a):a=e[0],a}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(g_,{}),e[1]=o):o=e[1],o}function L_(t){const e=F.c(8);let s,i;e[0]!==t?({className:s,...i}=t,e[0]=t,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let r;e[3]!==s?(r=le("grid gap-3",s),e[3]=s,e[4]=r):r=e[4];let o;return e[5]!==i||e[6]!==r?(o=n.jsx(mm,{"data-slot":"radio-group",className:r,...i}),e[5]=i,e[6]=r,e[7]=o):o=e[7],o}function Lc(t){const e=F.c(9);let s,i;e[0]!==t?({className:s,...i}=t,e[0]=t,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let r;e[3]!==s?(r=le("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",s),e[3]=s,e[4]=r):r=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(pm,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:n.jsx(Pm,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=o):o=e[5];let a;return e[6]!==i||e[7]!==r?(a=n.jsx(fm,{"data-slot":"radio-group-item",className:r,...i,children:o}),e[6]=i,e[7]=r,e[8]=a):a=e[8],a}function v_(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([i])=>!e.includes(i)));return Object.keys(s).length>0?{...t,properties:s}:t}function x_(t,e,s){return typeof t!="string"?null:v_(Ks(t,e),s)}function pu(t,e,s){if(!e||typeof t!="string")return!1;const i=x_(t,e,s);return!!i&&Object.keys(i.properties??{}).length>0}function y_({orgSlug:t,virtualMcpId:e,branch:s}){const i=di();return hi({mutationFn:async({blockKey:r})=>{const o=Ad(r),a=await fetch(`/api/${t}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/unlink`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:o})});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error??`Delete failed (${a.status})`)}return a.json()},onMutate:async({blockKey:r})=>{const o=`${t}/${e}/${s}`,a=Tt.decofile(o);await i.cancelQueries({queryKey:a});const l=i.getQueryData(a);return i.setQueryData(a,d=>{if(!d)return d;const{[r]:c,...h}=d;return h}),{previous:l,queryKey:a}},onError:(r,o,a)=>{a?.queryKey&&i.setQueryData(a.queryKey,a.previous)},onSuccess:()=>{const r=`${t}/${e}/${s}`;i.invalidateQueries({queryKey:Tt.liveMeta(r)})}})}function So(t,e){return`${t}-${e}`}function gu(t,e){return`site/apps/${t}/${e}.ts`}function _u(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function b_(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function S_(t){return t==="local"?"Custom":"Installed"}function Lu(t,e,s){const i=new Set([So(t,e),e].map(o=>o.toLowerCase())),r=gu(t,e);for(const[o,a]of Object.entries(s)){if(o.includes("/")||!a||typeof a!="object"||Array.isArray(a))continue;const l=a;if(i.has(o.toLowerCase())||l.__resolveType===r)return o}return null}function w_(t,e){const s=t.vendor.alias,i=t.name,r=Lu(s,i,e);return{id:So(s,i),app:i,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:gu(s,i),blockKey:r,installed:r!==null}}function C_(t,e,s){if(t===ql)return null;const i=_u(t);if(!i)return null;const{vendor:r,app:o}=i,a=Lu(r,o,s),l=_i(t,e);return{id:So(r,o),app:o,vendor:r,title:l.title??o,description:l.description??"",category:"Others",logo:l.logo??l.icon,resolveType:t,blockKey:a,installed:a!==null}}function k_(t,e,s){const i=e.__resolveType;if(typeof i!="string"||Vr(t,e)||!yh(i))return null;const r=_u(i)??b_(t);if(!r)return null;const o=_i(i,s),{vendor:a,app:l}=r;return{id:So(a,l),app:l,vendor:a,title:o.title??Kr(t,e,s),description:o.description??"",category:S_(a),logo:o.logo??o.icon,resolveType:i,blockKey:t,installed:!0}}function j_(t,e,s){const i=new Map;for(const o of t){const a=w_(o,s);i.set(a.id,a)}const r=e.manifest?.blocks?.apps??{};for(const o of Object.keys(r)){const a=C_(o,e,s);!a||i.has(a.id)||i.set(a.id,a)}for(const[o,a]of Object.entries(s)){if(o.includes("/")||!a||typeof a!="object"||Array.isArray(a))continue;const l=k_(o,a,e);!l||i.has(l.id)||i.set(l.id,l)}return[...i.values()].sort(N_)}function N_(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function E_(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function T_(t,e,s){const i=F.c(12),r=s?.enabled??!0;let o;i[0]===Symbol.for("react.memo_cache_sentinel")?(o=Tt.decoApps(),i[0]=o):o=i[0];let a;i[1]!==r?(a={queryKey:o,queryFn:E_,staleTime:3e5,retry:1,enabled:r},i[1]=r,i[2]=a):a=i[2];const l=Ps(a);let d;i[3]!==e||i[4]!==t||i[5]!==l.data?(d=t&&e?j_(l.data??[],t,e):[],i[3]=e,i[4]=t,i[5]=l.data,i[6]=d):d=i[6];const c=d,h=l.isLoading&&!l.isError;let u;return i[7]!==c||i[8]!==l.isError||i[9]!==l.refetch||i[10]!==h?(u={catalog:c,isLoading:h,isError:l.isError,refetch:l.refetch},i[7]=c,i[8]=l.isError,i[9]=l.refetch,i[10]=h,i[11]=u):u=i[11],u}function ok(t,e,s,i,r){const o={...t[e]};if(r.length>1){const a=o.sections,l=[...a?.variants??[]];l[i]&&(l[i]={...l[i],value:s}),o.sections={...a,variants:l}}else o.sections=s;return o}function ak(t){return structuredClone(t)}function lk(t){return!t.isSavedBlock&&!t.isMultivariate&&!t.isHidden}function A_(t){const e=t.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function R_(t,e){const s=t.trim();return s?s.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,s)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(s)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function P_(t){return(e,s)=>{m2(e),t(e,s)}}const D_=new Set(["http:","https:","mailto:","tel:","ftp:"]);function I_(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return D_.has(e.protocol)}catch{return!1}}function js(t){const e=F.c(8),{active:s,label:i,onClick:r,children:o}=t,a=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==a?(l=le("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",a),e[0]=a,e[1]=l):l=e[1];let d;return e[2]!==s||e[3]!==o||e[4]!==i||e[5]!==r||e[6]!==l?(d=n.jsx("button",{type:"button","aria-label":i,"aria-pressed":s,onMouseDown:M_,onClick:r,className:l,children:o}),e[2]=s,e[3]=o,e[4]=i,e[5]=r,e[6]=l,e[7]=d):d=e[7],d}function M_(t){return t.preventDefault()}function B_({schema:t,value:e,onChange:s,path:i,label:r}){const o=typeof e=="string"?e:"",a=M.useRef(s);a.current=s;const l=Mf({extensions:[Bf.configure({heading:{levels:[1,2,3]}})],content:o||"",editorProps:{attributes:{class:le("prose prose-sm dark:prose-invert max-w-none focus:outline-none","min-h-[80px] px-3 py-2")}},onUpdate:({editor:d})=>{const c=d.getHTML();a.current(c==="<p></p>"?"":c)}});return l?n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"space-y-0.5",children:[n.jsx($e,{htmlFor:i,children:r}),t.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:t.description})]}),n.jsxs("div",{className:"overflow-hidden rounded-md border border-input",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-border/60 bg-muted/30 px-1.5 py-1",children:[n.jsx(js,{active:l.isActive("bold"),label:"Bold",onClick:()=>l.chain().focus().toggleBold().run(),children:n.jsx(U2,{size:14})}),n.jsx(js,{active:l.isActive("italic"),label:"Italic",onClick:()=>l.chain().focus().toggleItalic().run(),children:n.jsx(W2,{size:14})}),n.jsx(js,{active:l.isActive("underline"),label:"Underline",onClick:()=>l.chain().focus().toggleUnderline().run(),children:n.jsx(V2,{size:14})}),n.jsx(js,{active:l.isActive("strike"),label:"Strikethrough",onClick:()=>l.chain().focus().toggleStrike().run(),children:n.jsx(K2,{size:14})}),n.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),n.jsx(js,{active:l.isActive("heading",{level:1}),label:"Heading 1",onClick:()=>l.chain().focus().toggleHeading({level:1}).run(),children:n.jsx(q2,{size:14})}),n.jsx(js,{active:l.isActive("heading",{level:2}),label:"Heading 2",onClick:()=>l.chain().focus().toggleHeading({level:2}).run(),children:n.jsx(G2,{size:14})}),n.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),n.jsx(js,{active:l.isActive("bulletList"),label:"Bullet list",onClick:()=>l.chain().focus().toggleBulletList().run(),children:n.jsx(Am,{size:14})}),n.jsx(js,{active:l.isActive("orderedList"),label:"Ordered list",onClick:()=>l.chain().focus().toggleOrderedList().run(),children:n.jsx("span",{className:"text-[11px] font-semibold leading-none",children:"1."})}),n.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),n.jsx(js,{active:l.isActive("link"),label:"Link",onClick:()=>{const d=l.getAttributes("link").href,c=window.prompt("Link URL",d??"https://");c!==null&&(c===""?l.chain().focus().unsetLink().run():I_(c)&&l.chain().focus().setLink({href:c}).run())},children:n.jsx(kf,{size:14})})]}),n.jsx(Of,{editor:l})]})]}):null}const ji=t=>String(t).padStart(2,"0"),O_="1900-01-01",$_="2099-12-31",z_="1900-01-01T00:00",F_="2099-12-31T23:59";function H_(t){if(!t)return"";const e=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const s=new Date(t);return Number.isNaN(s.getTime())?"":`${s.getUTCFullYear()}-${ji(s.getUTCMonth()+1)}-${ji(s.getUTCDate())}`}function U_(t){return!t||!/^\d{4}-\d{2}-\d{2}$/.test(t)?"":`${t}T00:00:00.000Z`}function W_(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${ji(e.getMonth()+1)}-${ji(e.getDate())}T${ji(e.getHours())}:${ji(e.getMinutes())}`}function V_(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toISOString()}function K_(t){const e=F.c(29),{id:s,withTime:i,value:r,onChange:o}=t,[a,l]=M.useState(!1);let d;e[0]!==r||e[1]!==i?(d=i?W_(r):H_(r),e[0]=r,e[1]=i,e[2]=d):d=e[2];const c=d;let h;e[3]!==o||e[4]!==i?(h=N=>{o(i?V_(N.target.value):U_(N.target.value))},e[3]=o,e[4]=i,e[5]=h):h=e[5];const u=h;let f;if(e[6]!==r){const N=r?new Date(r):null;f=N&&!Number.isNaN(N.getTime())?N:null,e[6]=r,e[7]=f}else f=e[7];const m=f;let p;e[8]!==o||e[9]!==m||e[10]!==i?(p=N=>{N&&(i&&m?N.setHours(m.getHours(),m.getMinutes(),0,0):N.setHours(0,0,0,0),o(N.toISOString()),l(!1))},e[8]=o,e[9]=m,e[10]=i,e[11]=p):p=e[11];const _=p,L=i?"datetime-local":"date",v=i?z_:O_,x=i?F_:$_;let g;e[12]!==u||e[13]!==s||e[14]!==c||e[15]!==L||e[16]!==v||e[17]!==x?(g=n.jsx(ze,{id:s,type:L,min:v,max:x,value:c,onChange:u,className:"h-10 flex-1 [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:opacity-0"}),e[12]=u,e[13]=s,e[14]=c,e[15]=L,e[16]=v,e[17]=x,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ss,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0","aria-label":"Open calendar",children:n.jsx(Md,{className:"h-4 w-4"})})}),e[19]=y):y=e[19];const b=m??void 0;let S;e[20]!==_||e[21]!==b?(S=n.jsx(ws,{className:"w-auto p-0",align:"end",children:n.jsx(Im,{mode:"single",selected:b,onSelect:_,initialFocus:!0})}),e[20]=_,e[21]=b,e[22]=S):S=e[22];let w;e[23]!==a||e[24]!==S?(w=n.jsxs(bs,{open:a,onOpenChange:l,children:[y,S]}),e[23]=a,e[24]=S,e[25]=w):w=e[25];let C;return e[26]!==w||e[27]!==g?(C=n.jsxs("div",{className:"flex gap-1",children:[g,w]}),e[26]=w,e[27]=g,e[28]=C):C=e[28],C}function cr(t){const e=F.c(8),{htmlFor:s,label:i,description:r}=t;let o;e[0]!==s||e[1]!==i?(o=n.jsx($e,{htmlFor:s,children:i}),e[0]=s,e[1]=i,e[2]=o):o=e[2];let a;e[3]!==r?(a=r&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==a?(l=n.jsxs("div",{className:"space-y-0.5",children:[o,a]}),e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function dr(t){const e=F.c(67),{schema:s,value:i,onChange:r,path:o,label:a}=t,l=typeof i=="string"?i:"",d=s.format;if(d==="rich-text"||d==="rich-text-inline"||d==="html"){let _;return e[0]!==a||e[1]!==r||e[2]!==o||e[3]!==s||e[4]!==i?(_=n.jsx(B_,{schema:s,value:i,onChange:r,path:o,label:a}),e[0]=a,e[1]=r,e[2]=o,e[3]=s,e[4]=i,e[5]=_):_=e[5],_}if(d==="textarea"||d==="markdown"){let _;e[6]!==a||e[7]!==o||e[8]!==s.description?(_=n.jsx(cr,{htmlFor:o,label:a,description:s.description}),e[6]=a,e[7]=o,e[8]=s.description,e[9]=_):_=e[9];let L;e[10]!==r?(L=g=>r(g.target.value),e[10]=r,e[11]=L):L=e[11];let v;e[12]!==o||e[13]!==l||e[14]!==L?(v=n.jsx(In,{id:o,value:l,onChange:L,rows:4}),e[12]=o,e[13]=l,e[14]=L,e[15]=v):v=e[15];let x;return e[16]!==_||e[17]!==v?(x=n.jsxs("div",{className:"space-y-2",children:[_,v]}),e[16]=_,e[17]=v,e[18]=x):x=e[18],x}if(d==="date"||d==="date-time"){let _;e[19]!==a||e[20]!==o||e[21]!==s.description?(_=n.jsx(cr,{htmlFor:o,label:a,description:s.description}),e[19]=a,e[20]=o,e[21]=s.description,e[22]=_):_=e[22];const L=d==="date-time";let v;e[23]!==r||e[24]!==o||e[25]!==l||e[26]!==L?(v=n.jsx(K_,{id:o,withTime:L,value:l,onChange:r}),e[23]=r,e[24]=o,e[25]=l,e[26]=L,e[27]=v):v=e[27];let x;return e[28]!==_||e[29]!==v?(x=n.jsxs("div",{className:"space-y-2",children:[_,v]}),e[28]=_,e[29]=v,e[30]=x):x=e[30],x}if(d==="color-input"){let _;e[31]!==a||e[32]!==o||e[33]!==s.description?(_=n.jsx(cr,{htmlFor:o,label:a,description:s.description}),e[31]=a,e[32]=o,e[33]=s.description,e[34]=_):_=e[34];const L=l||"#000000";let v;e[35]!==r?(v=w=>r(w.target.value),e[35]=r,e[36]=v):v=e[36];let x;e[37]!==L||e[38]!==v?(x=n.jsx("input",{type:"color",value:L,onChange:v,className:"h-10 w-10 cursor-pointer rounded-lg border border-border bg-background p-1"}),e[37]=L,e[38]=v,e[39]=x):x=e[39];let g;e[40]!==r?(g=w=>r(w.target.value),e[40]=r,e[41]=g):g=e[41];let y;e[42]!==o||e[43]!==l||e[44]!==g?(y=n.jsx(ze,{id:o,value:l,onChange:g,placeholder:"#000000",className:"h-10 flex-1"}),e[42]=o,e[43]=l,e[44]=g,e[45]=y):y=e[45];let b;e[46]!==x||e[47]!==y?(b=n.jsxs("div",{className:"flex items-center gap-2",children:[x,y]}),e[46]=x,e[47]=y,e[48]=b):b=e[48];let S;return e[49]!==_||e[50]!==b?(S=n.jsxs("div",{className:"space-y-2",children:[_,b]}),e[49]=_,e[50]=b,e[51]=S):S=e[51],S}let c;e[52]!==a||e[53]!==o||e[54]!==s.description?(c=n.jsx(cr,{htmlFor:o,label:a,description:s.description}),e[52]=a,e[53]=o,e[54]=s.description,e[55]=c):c=e[55];const h=d==="url"?"url":"text";let u;e[56]!==r?(u=_=>r(_.target.value),e[56]=r,e[57]=u):u=e[57];const f=s.default!=null?String(s.default):void 0;let m;e[58]!==o||e[59]!==l||e[60]!==h||e[61]!==u||e[62]!==f?(m=n.jsx(ze,{id:o,type:h,value:l,onChange:u,placeholder:f,className:"h-10"}),e[58]=o,e[59]=l,e[60]=h,e[61]=u,e[62]=f,e[63]=m):m=e[63];let p;return e[64]!==c||e[65]!==m?(p=n.jsxs("div",{className:"space-y-2",children:[c,m]}),e[64]=c,e[65]=m,e[66]=p):p=e[66],p}function q_(t){const e=F.c(17),{schema:s,value:i,onChange:r,path:o,label:a}=t,l=typeof i=="number"?i:"";let d;e[0]!==a||e[1]!==o?(d=n.jsx($e,{htmlFor:o,children:a}),e[0]=a,e[1]=o,e[2]=d):d=e[2];let c;e[3]!==s.description?(c=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[3]=s.description,e[4]=c):c=e[4];let h;e[5]!==d||e[6]!==c?(h=n.jsxs("div",{className:"space-y-0.5",children:[d,c]}),e[5]=d,e[6]=c,e[7]=h):h=e[7];let u;e[8]!==r?(u=p=>{const _=p.target.value;r(_===""?void 0:Number(_))},e[8]=r,e[9]=u):u=e[9];let f;e[10]!==l||e[11]!==o||e[12]!==u?(f=n.jsx(ze,{id:o,type:"number",value:l,onChange:u,className:"h-10"}),e[10]=l,e[11]=o,e[12]=u,e[13]=f):f=e[13];let m;return e[14]!==h||e[15]!==f?(m=n.jsxs("div",{className:"space-y-2",children:[h,f]}),e[14]=h,e[15]=f,e[16]=m):m=e[16],m}function G_(t){const e=F.c(17),{value:s,onChange:i,path:r,label:o,schema:a}=t,l=typeof s=="boolean"?s:!1;let d;e[0]!==o||e[1]!==r?(d=n.jsx($e,{htmlFor:r,children:o}),e[0]=o,e[1]=r,e[2]=d):d=e[2];let c;e[3]!==a.description?(c=a.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:a.description}),e[3]=a.description,e[4]=c):c=e[4];let h;e[5]!==d||e[6]!==c?(h=n.jsxs("div",{className:"space-y-0.5",children:[d,c]}),e[5]=d,e[6]=c,e[7]=h):h=e[7];let u;e[8]!==i?(u=p=>i(p),e[8]=i,e[9]=u):u=e[9];let f;e[10]!==l||e[11]!==r||e[12]!==u?(f=n.jsx(Mn,{id:r,checked:l,onCheckedChange:u}),e[10]=l,e[11]=r,e[12]=u,e[13]=f):f=e[13];let m;return e[14]!==h||e[15]!==f?(m=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h,f]}),e[14]=h,e[15]=f,e[16]=m):m=e[16],m}const c9="__enum_empty__";function d9(t){return t===""?c9:String(t)}function Y_(t,e){if(t===c9)return"";const s=e.find(i=>d9(i)===t);return s!==void 0?s:t}function J_(t,e){return t==null?e.some(s=>s==="")?c9:void 0:d9(t)}function X_(t){return t===""?"":String(t)}function Z_(t){const e=F.c(28),{schema:s,value:i,onChange:r,path:o,label:a}=t;let l;e[0]!==s.enum?(l=s.enum??[],e[0]=s.enum,e[1]=l):l=e[1];const d=l;let c;e[2]!==d||e[3]!==i?(c=J_(i,d),e[2]=d,e[3]=i,e[4]=c):c=e[4];const h=c;let u;e[5]!==a||e[6]!==o?(u=n.jsx($e,{htmlFor:o,children:a}),e[5]=a,e[6]=o,e[7]=u):u=e[7];let f;e[8]!==s.description?(f=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[8]=s.description,e[9]=f):f=e[9];let m;e[10]!==u||e[11]!==f?(m=n.jsxs("div",{className:"space-y-0.5",children:[u,f]}),e[10]=u,e[11]=f,e[12]=m):m=e[12];let p;e[13]!==r||e[14]!==d?(p=y=>r(Y_(y,d)),e[13]=r,e[14]=d,e[15]=p):p=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Ct,{className:"h-10",children:n.jsx(Et,{placeholder:"Select..."})}),e[16]=_):_=e[16];let L;e[17]!==d?(L=d.map(Q_),e[17]=d,e[18]=L):L=e[18];let v;e[19]!==L?(v=n.jsx(kt,{children:L}),e[19]=L,e[20]=v):v=e[20];let x;e[21]!==h||e[22]!==p||e[23]!==v?(x=n.jsxs(jt,{value:h,onValueChange:p,children:[_,v]}),e[21]=h,e[22]=p,e[23]=v,e[24]=x):x=e[24];let g;return e[25]!==x||e[26]!==m?(g=n.jsxs("div",{className:"space-y-2",children:[m,x]}),e[25]=x,e[26]=m,e[27]=g):g=e[27],g}function Q_(t){const e=d9(t);return n.jsx(et,{value:e,children:X_(t)},e)}function h9(t){const e=t.__resolveType;if(typeof e!="string")return null;if(At(e)){const i=t.section?.__resolveType;return typeof i=="string"?i:e}return e}function e6(t){return t.includes("flags/multivariate")}function t6(t){return mt(t)}function s6(t,e){const s=[...t],i=new Set(s.map(o=>o.resolveType)),r=(o,a)=>{!o||i.has(o)||(i.add(o),s.push({resolveType:o,title:a??t6(o)}))};if(e.savedBlockKey&&r(e.savedBlockKey,e.savedBlockKey),e.editorValue&&typeof e.editorValue=="object"&&!Array.isArray(e.editorValue)){const o=h9(e.editorValue);o?.includes("/")&&r(o)}return s}function i6(t,e,s){const i=e[0]?.resolveType??"";if(s)return s;if(!t||typeof t!="object"||Array.isArray(t))return i;const r=t,o=r.__resolveType;if(typeof o=="string"){if(Rs(o)){const u=e.find(f=>f.resolveType===o);return u?u.resolveType:o}const c=e.find(u=>X9(u.resolveType,o));if(c)return c.resolveType;const h=e.find(u=>u.resolveType===o);if(h)return h.resolveType;if(o.includes("/"))return o}const a=typeof r.type=="string"?r.type:void 0;if(a){const c=e.find(h=>h.discriminatorValue===a||h.resolveType===a||X9(h.resolveType,a));if(c)return c.resolveType}let l=i,d=-1;for(const c of e){if(!c.schema?.properties)continue;const u=Object.keys(c.schema.properties).filter(f=>!f.startsWith("__")&&f!=="@type"&&f!=="action"&&f!=="alt").filter(f=>r[f]!==void 0).length;u>0&&u>d&&(d=u,l=c.resolveType)}return d>0,l}function vc(t,e,s){if(!t||typeof t!="object"||Array.isArray(t))return s??null;const i=h9(t);if(!i)return s??null;if(!e)return i.includes("/")?null:s??null;const r=Ks(i,e);return r||(i.includes("/")?null:s??null)}function n6(t,e){if(!t?.properties||!e)return t??null;if(!(e in t.properties))return t;const s={...t.properties};return delete s[e],{...t,properties:s}}function vu(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;if(typeof e.__resolveType!="string"||!At(e.__resolveType))return null;const s=e.section;return!s||typeof s!="object"||Array.isArray(s)?null:s}function r6(t,e){if(e)return!0;if(!t||typeof t!="object"||Array.isArray(t))return!1;const s=t,i=h9(s);return i&&e6(i)?Array.isArray(s.variants)&&s.variants.length>0:Object.keys(s).some(r=>!r.startsWith("__")&&r!=="@type")}function u9(t){if(typeof t=="string")return t;if(!t||typeof t!="object")return"";const e=t;if(Array.isArray(e.variants)){const s=e.variants,i=s.find(o=>o.rule?.__resolveType?.includes("always"));if(typeof i?.value=="string")return i.value;const r=s.find(o=>typeof o.value=="string");if(r)return r.value}return typeof e.src=="string"?e.src:typeof e.url=="string"?e.url:typeof e.value=="string"?e.value:""}function o6(t){if(t?.trim())try{const e=new URL(t);return e.protocol!=="https:"?void 0:e.href}catch{return}}function a6(t){if(Array.isArray(t.variants)){const e=t.variants,s=e.find(r=>r.rule?.__resolveType?.includes("always"));if(typeof s?.value=="string")return s.value;const i=e.find(r=>typeof r.value=="string");if(i)return i.value}if(typeof t.src=="string")return t.src;if(typeof t.url=="string")return t.url;if(typeof t.value=="string")return t.value}function xu(t){if(typeof t=="string"||t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(xu);const e=t;return e.__resolveType?a6(e)??t:yu(e)}function yu(t){const e={};for(const[s,i]of Object.entries(t))e[s]=xu(i);return e}function l6(t,e){return e.split(".").reduce((s,i)=>{if(!(s==null||typeof s!="object"))return s[i]},t)}function bu(t){return t==null?"":Array.isArray(t)?t.map(bu).filter(Boolean).join(","):typeof t=="object"?"":String(t)}function f9(t,e){if(!t.includes("{"))return;const s=yu(e);return t.replace(/\{\{\{([^}]+)\}\}\}|\{\{([^}]+)\}\}/g,(r,o,a)=>{const l=(o??a??"").trim();return bu(l6(s,l))}).trim()||void 0}function c6(t){return t.replace(/<[^>]*>/g,"").trim()}function d6(t,e){if(e.includes("{"))return f9(e,t);const s=t[e];if(typeof s=="string"&&s)return s;if(Array.isArray(s)){const i=s.map(r=>r==null?"":String(r)).filter(Boolean).join(",");if(i)return i}}function Qs(t,e,s){if(typeof t=="string")return t.trim()?t:`Item ${e+1}`;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t&&typeof t=="object"&&!Array.isArray(t)){let i=t;const r=vu(i);if(r&&(i=r),s?.titleBy){const a=d6(i,s.titleBy);if(a)return a}for(const a of["name","label","title","alt","text","href","id","key"]){const l=i[a];if(typeof l=="string"&&l.trim()){const d=s?.properties?.[a]?.format;if(d==="rich-text"||d==="html"){const c=c6(l);if(c)return c;continue}return l}if(Array.isArray(l)){const d=l.map(c=>c==null?"":String(c)).filter(Boolean).join(",");if(d)return d}}const o=i.__resolveType;if(typeof o=="string"&&o)return mt(o);if(s?.title){const a=f9(s.title,i);if(a)return a;if(!s.title.includes("{"))return s.title}}return`Item ${e+1}`}function h6(t){if(!t)return;if(typeof t.image=="string"&&t.image.includes("{"))return t.image;const e=t.properties?.image;if(!e)return;if(e.format==="image-uri")return"{{{image}}}";const s=e.properties;return s?.mobile?"{{{image.mobile}}}":s?.desktop?"{{{image.desktop}}}":"{{{image}}}"}function xc(t,e){if(!t||typeof t!="object"||Array.isArray(t))return;const s=h6(e);if(!s)return;const i=f9(s,t);if(!i)return;const r=u9(i)||i;return o6(r)}function Su(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/^\w/,e=>e.toUpperCase())}function ai(t){return t.normalize("NFC").trim()}function St(t,e){return ai(t)===ai(e)}function yc(t,e){return ai(t).replace(/\s+/g,"").toLowerCase()===ai(e).replace(/\s+/g,"").toLowerCase()}function hr(t,e,s){const i=ai(s);if(t.some(a=>St(a,i)||St(a,s)))return t;const r=[...t];return r.some(a=>St(a,e))||r.push(e),r.push(s),r}function u6(t,e,s){if(s.length===0)return s;const i=jn(t,e),r=s[0];return St(r,i)||St(r,t)?s.slice(1):s}function jn(t,e){return e.title??Su(t)}function ck(t,e){return e<=0?[]:t.slice(0,e)}function zo(t,e){const s=ai(e);return t.findIndex(i=>ai(i)===s)}function bc(t,e){return t.type==="array"&&t.items||yo(t)?!0:Array.isArray(e)}function f6(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Hn(t,e,s,i){if(i.length===0)return null;const r=i[0];for(const a of t){const l=e[a];if(!l||!bc(l,s[a]))continue;const d=jn(a,l);if(St(r,d)||St(r,a)||i.some(c=>St(c,d)||St(c,a)))return a}for(const a of t){const l=e[a];if(!l||!bc(l,s[a]))continue;const d=s[a];if(!Array.isArray(d))continue;const c=l.items;for(let h=0;h<d.length;h++){const u=Qs(d[h],h,c);if(St(u,r))return a}}for(const a of t){const l=e[a];if(l?.type!=="object"||!l.properties)continue;const d=Object.keys(l.properties),c=f6(s[a]),h=jn(a,l);if(Hn(d,l.properties,c,i)||(St(r,h)||St(r,a))&&Hn(d,l.properties,c,i.slice(1)))return a}let o=null;for(const a of t){const l=e[a];if(l?.type!=="block-ref")continue;const d=jn(a,l);if(!(r!==d&&r!==a)){if(i.length>1){const c=s[a];if(c&&typeof c=="object"&&!Array.isArray(c)){const h=i[1];if(Object.keys(c).some(f=>!f.startsWith("__")&&(yc(Su(f),h)||yc(f,h))))return a}}o||(o=a)}}return o||null}function m6(t,e,s,i){return Hn(t,e,s,i)}function p6(t,e,s,i,r){if(r.length===0||!s.properties)return!1;const o=Object.keys(s.properties);if(Hn(o,s.properties,i,r))return!0;const a=r[0];return!St(a,e)&&!St(a,t)?!1:r.length>1||Hn(o,s.properties,i,r.slice(1))!==null}function g6(t,e,s,i){if(e.length===0)return null;for(let o=0;o<e.length;o++){const a=e[o],l=s.findIndex((d,c)=>St(Qs(d,c,i),a));if(l>=0)return{index:l,innerPath:e.slice(o+1)}}const r=e.findIndex(o=>St(o,t));if(r>=0&&e.length>r+1){const o=e[r+1],a=s.findIndex((l,d)=>St(Qs(l,d,i),o));if(a>=0)return{index:a,innerPath:e.slice(r+2)}}return null}function Fo(t){return t.includes("/sections/")||t.includes("multivariate/section")||t===Zn}function _6(t){if(t.type==="block-ref"&&t.anyOfRefs?.length)return t.anyOfRefs.some(s=>Fo(s.resolveType));if(t.anyOfRefs?.length)return t.anyOfRefs.some(s=>Fo(s.resolveType));const e=t.properties?.__resolveType;return e?.type==="block-ref"&&e.anyOfRefs?.length?e.anyOfRefs.some(s=>Fo(s.resolveType)):!1}function L6(t,e){if(e==="global"||e==="sections"||yo(t))return!0;const s=t.type==="array"?t.items:void 0;return s?_6(s):!1}function Sc(t){return Array.from({length:t},(e,s)=>({id:crypto.randomUUID(),index:s}))}function v6(t,e,s,i,r){if(e?.type==="object"&&e.properties&&Object.keys(e.properties).length>0||e?.type==="block-ref"&&e.anyOfRefs?.length)return e;if(t!=null&&typeof t=="object"&&!Array.isArray(t)){const o=t.__resolveType;if(typeof o=="string"&&s){const a=Ks(o,s);if(a?.properties&&Object.keys(a.properties).length>0)return a}}if(s&&i&&r){const a=Ks(i,s)?.properties?.[r]?.items;if(a?.properties&&Object.keys(a.properties).length>0)return{...a,titleBy:a.titleBy??e?.titleBy}}return e}function x6(t){const e=t.split(".").filter(s=>!/^\d+$/.test(s));return e[e.length-1]??t}function wu(t){return t.map((e,s)=>({...e,index:s}))}function y6(t,e){if(e===t.length)return t;if(e<t.length)return wu(t.slice(0,e));const s=Array.from({length:e-t.length},(i,r)=>({id:crypto.randomUUID(),index:t.length+r}));return[...t,...s]}function b6(t){const e=F.c(8),{labelText:s,imageSrc:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Cl,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),e[0]=r):r=e[0];let o;e[1]!==i?(o=i&&n.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[1]=i,e[2]=o):o=e[2];let a;e[3]!==s?(a=n.jsx("span",{className:"min-w-0 truncate",children:s}),e[3]=s,e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==a?(l=n.jsxs(n.Fragment,{children:[r,n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5 text-sm",children:[o,a]})]}),e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function S6(t){const e=F.c(43),{sortableId:s,labelText:i,imageSrc:r,onOpen:o,onDuplicate:a,onRemove:l}=t;let d;e[0]!==s?(d={id:s,animateLayoutChanges:k6},e[0]=s,e[1]=d):d=e[1];const{attributes:c,listeners:h,setNodeRef:u,transform:f,isDragging:m}=vd(d);let p;e[2]!==f?(p=xd.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=p):p=e[3];const _=m?0:void 0;let L;e[4]!==p||e[5]!==_?(L={transform:p,opacity:_},e[4]=p,e[5]=_,e[6]=L):L=e[6];const v=L;let x;e[7]!==o?(x=D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),o())},e[7]=o,e[8]=x):x=e[8];const g=m?"cursor-grabbing":"cursor-pointer";let y;e[9]!==g?(y=le("group flex min-w-0 items-center gap-2.5 rounded-lg px-2 py-2.5 hover:bg-accent hover:text-accent-foreground touch-none",g),e[9]=g,e[10]=y):y=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cl,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),e[11]=b):b=e[11];let S;e[12]!==r?(S=r&&n.jsx("img",{src:r,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[12]=r,e[13]=S):S=e[13];let w;e[14]!==i?(w=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:i}),e[14]=i,e[15]=w):w=e[15];const C=`Open actions for ${i}`;let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Vi,{size:14}),e[16]=N):N=e[16];let T;e[17]!==C?(T=n.jsx(es,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":C,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:C6,onPointerDown:w6,children:N})}),e[17]=C,e[18]=T):T=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Xt,{size:14}),e[19]=A):A=e[19];let j;e[20]!==a?(j=n.jsxs(We,{onClick:a,children:[A,"Duplicate"]}),e[20]=a,e[21]=j):j=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ss,{size:14}),e[22]=k):k=e[22];let I;e[23]!==l?(I=n.jsxs(We,{className:"text-destructive focus:text-destructive",onClick:l,children:[k,"Delete"]}),e[23]=l,e[24]=I):I=e[24];let E;e[25]!==j||e[26]!==I?(E=n.jsxs(ts,{align:"end",children:[j,I]}),e[25]=j,e[26]=I,e[27]=E):E=e[27];let R;e[28]!==T||e[29]!==E?(R=n.jsxs(Qt,{children:[T,E]}),e[28]=T,e[29]=E,e[30]=R):R=e[30];let P;return e[31]!==c||e[32]!==i||e[33]!==h||e[34]!==o||e[35]!==u||e[36]!==v||e[37]!==w||e[38]!==R||e[39]!==x||e[40]!==y||e[41]!==S?(P=n.jsxs("div",{ref:u,style:v,...c,...h,role:"button",tabIndex:0,onClick:o,onKeyDown:x,className:y,title:i,children:[b,S,w,R]}),e[31]=c,e[32]=i,e[33]=h,e[34]=o,e[35]=u,e[36]=v,e[37]=w,e[38]=R,e[39]=x,e[40]=y,e[41]=S,e[42]=P):P=e[42],P}function w6(t){return t.stopPropagation()}function C6(t){return t.stopPropagation()}function k6(){return!1}function ur(t){const e=F.c(24),{schema:s,value:i,onChange:r,path:o,label:a,breadcrumbPath:l,onBreadcrumbChange:d,meta:c,decofile:h,onSaveReferencedBlock:u,containerResolveType:f,previewBaseUrl:m,onAddSectionItem:p,onRequestAddSection:_,sandbox:L}=t,v=l===void 0?[]:l,x=Array.isArray(i)?i:[],g=s.items,y=x6(o),b=L6(s,y),S=g6(a,v,x,g),w=S?.index??null,[C,N]=M.useState(()=>Sc(x.length)),[T,A]=M.useState(null),[j,k]=M.useState(o),[I,E]=M.useState(x.length),R=M.useRef(!1);j!==o?(k(o),E(x.length),N(Sc(x.length))):I!==x.length&&(E(x.length),N(ge=>y6(ge,x.length)));let P;e[0]!==g?(P=(ge,we)=>Qs(ge,we,g),e[0]=g,e[1]=P):P=e[1];const D=P,O=ge=>{if(R.current)return;const we=D(x[ge],ge);d?.(hr(v,a,we))},$=ge=>{const we=[...x,ge];r(we);const Be=we.length-1,Ne=Qs(ge,Be,g);d?.(hr(v,a,Ne))},K=()=>{const ge=g?.type,we=g?.default!==void 0?g.default:ge==="object"?{}:ge==="block-ref"?(()=>{const Ve=g?.anyOfRefs?.[0]?.resolveType;return typeof Ve!="string"||Wr(Ve)?{}:{__resolveType:Ve}})():ge==="number"||ge==="integer"?0:ge==="boolean"?!1:ge==="array"?[]:"",Be=[...x,we];r(Be);const Ne=Be.length-1,nt=Qs(we,Ne,g);d?.(hr(v,a,nt))},z=()=>{if(b){if(!m){ue.error("Start the preview dev server to add sections.");return}if(_){_({append:$});return}ue.error("Section picker is not available in this editor.");return}K()},U=ge=>{const we=x[ge],Be=typeof structuredClone=="function"?structuredClone(we):JSON.parse(JSON.stringify(we??null)),Ne=[...x.slice(0,ge+1),Be,...x.slice(ge+1)];r(Ne)},G=ge=>{if(r(x.filter((we,Be)=>Be!==ge)),w===ge){const we=D(x[ge],ge),Be=zo(v,we);d?.(Be>=0?v.slice(0,Be):[])}},q=(ge,we)=>{const Be=[...x];if(Be[ge]=we,r(Be),ge===w&&w!==null){const Ne=D(x[ge],ge),nt=Qs(we,ge,g);if(Ne!==nt){const Ve=zo(v,Ne);if(Ve>=0){const ye=[...v];ye[Ve]=nt,d?.(ye)}}}};let W;e[2]===Symbol.for("react.memo_cache_sentinel")?(W={activationConstraint:{distance:8}},e[2]=W):W=e[2];let H;e[3]===Symbol.for("react.memo_cache_sentinel")?(H={coordinateGetter:yd},e[3]=H):H=e[3];const Z=hd(Ar(fd,W),Ar(ud,H)),J=C.map(j6);let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B=ge=>{A(String(ge.active.id))},e[4]=B):B=e[4];const X=B,V=ge=>{A(null);const{active:we,over:Be}=ge;if(!Be||we.id===Be.id)return;const Ne=J.indexOf(String(we.id)),nt=J.indexOf(String(Be.id));Ne===-1||nt===-1||(N(Ve=>wu(ha([...Ve],Ne,nt))),r(ha([...x],Ne,nt)),R.current=!0,requestAnimationFrame(()=>{R.current=!1}))};let ee;e[5]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>{A(null)},e[5]=ee):ee=e[5];const te=ee,ae=T?C.find(ge=>ge.id===T):null,de=ae!=null?x[ae.index]:void 0,fe=ae!=null&&de!==void 0?D(de,ae.index):null,Q=ae!=null&&de!==void 0?xc(de,g):void 0;if(w!==null&&w<x.length){const ge=x[w],we=v6(ge,g,c,f,y),Be=()=>{const Ne=D(ge,w),nt=hr(v,a,Ne),Ve=zo(nt,Ne);return Ve>=0?nt.slice(0,Ve+1):nt};return n.jsx("div",{className:"min-w-0",children:we?.type==="object"&&we.properties?n.jsx(vi,{schema:we,value:ge,onChange:Ne=>q(w,Ne),basePath:`${o}.${w}`,breadcrumbPath:S?.innerPath??[],onBreadcrumbChange:Ne=>{d?.([...Be(),...Ne])},meta:c,decofile:h,onSaveReferencedBlock:u,previewBaseUrl:m,onAddSectionItem:p,onRequestAddSection:_,sandbox:L}):we?_9({schema:we,value:ge,onChange:Ne=>q(w,Ne),path:`${o}.${w}`,label:we.title&&!we.title.includes("{{")?we.title:D(ge,w),breadcrumbPath:S?.innerPath??[],onBreadcrumbChange:Ne=>{d?.([...Be(),...Ne])},meta:c,decofile:h,onSaveReferencedBlock:u,previewBaseUrl:m,onAddSectionItem:p,onRequestAddSection:_,sandbox:L}):null})}const se="space-y-2";let oe;e[6]!==a?(oe=n.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:a}),e[6]=a,e[7]=oe):oe=e[7];const he=x.length>0&&n.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:x.length});let xe;e[8]!==oe||e[9]!==he?(xe=n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[oe,he]}),e[8]=oe,e[9]=he,e[10]=xe):xe=e[10];let ve;e[11]!==s.description?(ve=s.description&&n.jsx("p",{className:"break-words text-xs leading-normal text-muted-foreground",children:s.description}),e[11]=s.description,e[12]=ve):ve=e[12];let be;e[13]!==xe||e[14]!==ve?(be=n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[xe,ve]}),e[13]=xe,e[14]=ve,e[15]=be):be=e[15];const De=x.length>0&&n.jsx("div",{className:le(T&&"cursor-grabbing"),children:n.jsxs(md,{sensors:Z,collisionDetection:pd,onDragStart:X,onDragEnd:V,onDragCancel:te,children:[n.jsx(gd,{items:J,strategy:_d,children:n.jsx("div",{className:"min-w-0 overflow-hidden rounded-xl border border-border/50 p-1.5",children:C.map(ge=>{const we=x[ge.index];if(we===void 0)return null;const Be=D(we,ge.index),Ne=xc(we,g);return n.jsx(S6,{sortableId:ge.id,labelText:Be,imageSrc:Ne,onOpen:()=>O(ge.index),onDuplicate:()=>U(ge.index),onRemove:()=>G(ge.index)},ge.id)})})}),n.jsx(Ld,{dropAnimation:null,children:fe?n.jsx("div",{className:"flex min-w-0 items-center gap-2.5 rounded-lg border border-border/60 bg-background px-2 py-2.5 shadow-lg ring-1 ring-border/60",children:n.jsx(b6,{labelText:fe,imageSrc:Q})}):null})]})});let Ie;e[16]===Symbol.for("react.memo_cache_sentinel")?(Ie=n.jsx(Dt,{size:14}),e[16]=Ie):Ie=e[16];const Me=b?"Add section":"Add item";let He;e[17]!==z||e[18]!==Me?(He=n.jsxs("button",{type:"button",onClick:z,className:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-border/60 py-2.5 text-sm text-muted-foreground transition-colors hover:border-border hover:bg-muted/30",children:[Ie,Me]}),e[17]=z,e[18]=Me,e[19]=He):He=e[19];let Je;return e[20]!==be||e[21]!==De||e[22]!==He?(Je=n.jsxs("div",{className:se,children:[be,De,He]}),e[20]=be,e[21]=De,e[22]=He,e[23]=Je):Je=e[23],Je}function j6(t){return t.id}function N6(t){const e=F.c(44),{schema:s,value:i,onChange:r,path:o,label:a,breadcrumbPath:l,onBreadcrumbChange:d,meta:c,decofile:h,onSaveReferencedBlock:u,previewBaseUrl:f,onAddSectionItem:m,onRequestAddSection:p,sandbox:_}=t;let L;e[0]!==l?(L=l===void 0?[]:l,e[0]=l,e[1]=L):L=e[1];const v=L,[x,g]=M.useState(!1);let y;e[2]!==i?(y=i!=null&&typeof i=="object"&&!Array.isArray(i)?i:{},e[2]=i,e[3]=y):y=e[3];const b=y;if(!s.properties)return null;let S;e[4]!==o?(S=o.split(".").pop()??o,e[4]=o,e[5]=S):S=e[5];const w=S;let C;e[6]!==v||e[7]!==w||e[8]!==a||e[9]!==b||e[10]!==s?(C=p6(w,a,s,b,v),e[6]=v,e[7]=w,e[8]=a,e[9]=b,e[10]=s,e[11]=C):C=e[11];const T=x||C,A=`${o}-fields`;let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=()=>g(E6),e[12]=j):j=e[12];let k;e[13]!==T?(k=n.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors group-hover:text-accent-foreground",children:T?n.jsx(ds,{size:16}):n.jsx(Gi,{size:16})}),e[13]=T,e[14]=k):k=e[14];let I;e[15]!==a?(I=n.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:a}),e[15]=a,e[16]=I):I=e[16];let E;e[17]!==A||e[18]!==T||e[19]!==k||e[20]!==I?(E=n.jsxs("button",{type:"button","aria-expanded":T,"aria-controls":A,onClick:j,className:"group flex w-full min-w-0 items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:bg-accent hover:text-accent-foreground",children:[k,I]}),e[17]=A,e[18]=T,e[19]=k,e[20]=I,e[21]=E):E=e[21];let R;e[22]!==s.description?(R=s.description&&n.jsx("p",{className:"break-words pl-9 text-xs leading-normal text-muted-foreground",children:s.description}),e[22]=s.description,e[23]=R):R=e[23];let P;e[24]!==v||e[25]!==A||e[26]!==h||e[27]!==T||e[28]!==c||e[29]!==b||e[30]!==m||e[31]!==d||e[32]!==r||e[33]!==p||e[34]!==u||e[35]!==o||e[36]!==f||e[37]!==_||e[38]!==s?(P=T&&n.jsx("div",{id:A,className:"ml-3 min-w-0 max-w-full overflow-hidden border-l border-border/80 pl-5",children:n.jsx(vi,{schema:s,value:b,onChange:r,basePath:o,breadcrumbPath:v,onBreadcrumbChange:d,meta:c,decofile:h,onSaveReferencedBlock:u,previewBaseUrl:f,onAddSectionItem:m,onRequestAddSection:p,sandbox:_})}),e[24]=v,e[25]=A,e[26]=h,e[27]=T,e[28]=c,e[29]=b,e[30]=m,e[31]=d,e[32]=r,e[33]=p,e[34]=u,e[35]=o,e[36]=f,e[37]=_,e[38]=s,e[39]=P):P=e[39];let D;return e[40]!==R||e[41]!==P||e[42]!==E?(D=n.jsxs("div",{className:"min-w-0 space-y-2",children:[E,R,P]}),e[40]=R,e[41]=P,e[42]=E,e[43]=D):D=e[43],D}function E6(t){return!t}function Cu(t){return t===Zn||t===Ji}function wo(t,e){if(!Object.hasOwn(e,t))return null;const s=e[t]??{},i=s.__resolveType??t;return{data:{...s},resolveType:i}}function Xr(t,e){const s=t.__resolveType??"";if(!s)return null;if(At(s)){const i=t.section??{};return ku(i,e)}if(Cu(s)){const i=t.variants?.[0]?.value;return i?Xr(i,e):null}return!Rs(s)||!Object.hasOwn(e,s)?{data:{...t},resolveType:s}:wo(s,e)}function ku(t,e){const s=t.__resolveType??"";if(!s)return null;if(Cu(s)){const i=t.variants?.[0]?.value;return i?Xr(i,e):null}return!Rs(s)||!Object.hasOwn(e,s)?{data:{...t},resolveType:s}:wo(s,e)}function T6(t,e){if(!t||typeof t!="object"||Array.isArray(t))return null;const i=t.__resolveType;if(typeof i!="string"||!Rs(i)||!Object.hasOwn(e,i))return null;const r=wo(i,e);return r?{blockKey:i,...r}:null}function A6(t,e,s){if(e.isMultivariate)return null;if(e.isSavedBlock){const i=e.isLazy?t.section?.__resolveType??t.__resolveType:t.__resolveType;return wo(i,s)}if(e.isHidden){const o=(At(t.__resolveType)?t.section:t)?.variants?.[0]?.value??t;return Xr(o,s)}if(e.isLazy||At(t.__resolveType)){const i=t.section??{};return ku(i,s)}return Xr(t,s)}function R6(t){if(!t?.properties)return{};const e={};for(const[s,i]of Object.entries(t.properties))s.startsWith("__")||s==="@type"||(i.default!==void 0?e[s]=i.default:i.type==="boolean"?e[s]=!1:i.type==="string"?e[s]="":i.type==="number"||i.type==="integer"?e[s]=0:i.type==="object"&&(e[s]={}));return e}function P6(t){const e=F.c(3),{blockKey:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ee,{asChild:!0,children:n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[n.jsx(Ki,{size:11}),"Global"]})}),e[0]=i):i=e[0];let r;return e[1]!==s?(r=n.jsxs(Ae,{children:[i,n.jsxs(Te,{side:"top",className:"max-w-[260px]",children:["Edits the saved block “",s,"”. Changes apply everywhere this loader is referenced on your site."]})]}),e[1]=s,e[2]=r):r=e[2],r}function D6(t){const e=F.c(28),{path:s,open:i,onOpenChange:r,title:o,nested:a,nestedBlockRef:l,globalBlockKey:d}=t,c=`${s}-loader-config`,h=l&&"ml-1";let u;e[0]!==h?(u=le("rounded-lg border border-border/80 bg-muted/30",h),e[0]=h,e[1]=u):u=e[1];let f;e[2]!==r||e[3]!==i?(f=()=>r(!i),e[2]=r,e[3]=i,e[4]=f):f=e[4];let m;e[5]!==i?(m=n.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center text-muted-foreground transition-colors group-hover:text-foreground",children:i?n.jsx(ds,{size:16}):n.jsx(Gi,{size:16})}),e[5]=i,e[6]=m):m=e[6];let p;e[7]!==o?(p=n.jsx("span",{className:"truncate text-xs font-medium tracking-wide text-muted-foreground uppercase",children:o}),e[7]=o,e[8]=p):p=e[8];let _;e[9]!==d?(_=d&&n.jsx(P6,{blockKey:d}),e[9]=d,e[10]=_):_=e[10];let L;e[11]!==p||e[12]!==_?(L=n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[p,_]}),e[11]=p,e[12]=_,e[13]=L):L=e[13];let v;e[14]!==c||e[15]!==i||e[16]!==f||e[17]!==m||e[18]!==L?(v=n.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":c,onClick:f,className:"group flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[m,L]}),e[14]=c,e[15]=i,e[16]=f,e[17]=m,e[18]=L,e[19]=v):v=e[19];let x;e[20]!==c||e[21]!==a||e[22]!==i?(x=i&&n.jsx("div",{id:c,className:"border-t border-border/60 px-4 pb-4 pt-3",children:n.jsx("div",{className:"border-l border-border/80 pl-4",children:a})}),e[20]=c,e[21]=a,e[22]=i,e[23]=x):x=e[23];let g;return e[24]!==u||e[25]!==v||e[26]!==x?(g=n.jsxs("div",{className:u,children:[v,x]}),e[24]=u,e[25]=v,e[26]=x,e[27]=g):g=e[27],g}function wc(t){const e=F.c(35),{schema:s,value:i,onChange:r,path:o,label:a,breadcrumbPath:l,onBreadcrumbChange:d,meta:c,decofile:h,onSaveReferencedBlock:u,sandbox:f}=t,m=(s.anyOfRefs??[]).filter(B6),p=h&&i?T6(i,h):null,_=p?.data??i,L=p?null:vu(_),v=L??_,x=s6(m,{savedBlockKey:p?.blockKey,editorValue:_}),g=x.length>0?i6(_,x,p?.blockKey):x[0]?.resolveType??"",b=s.type==="block-ref"&&x.some(M6);let S;e[0]!==a||e[1]!==o?(S=a??(o.includes(".")?o.split(".")[0]:o),e[0]=a,e[1]=o,e[2]=S):S=e[2];const w=S;let C;e[3]!==l?(C=l??[],e[3]=l,e[4]=C):C=e[4];const N=C,T=b&&N[0]===w?N.slice(1):N,A=b?q=>{d?.([w,...q])}:d,[j,k]=M.useState(g),[I,E]=M.useState(g);I!==g&&(E(g),k(g));const[R,P]=M.useState(()=>r6(_,p?.blockKey));if(x.length>0){const q=j||g;let W;e[5]!==q?(W=oe=>oe.resolveType===q,e[5]=q,e[6]=W):W=e[6];const H=x.find(W),Z=vc(_,c,H?.schema),J=n6(Z??H?.schema??null,s.discriminatorKey),B=s.discriminatorKey,X=oe=>{k(oe);const he=x.find(Me=>Me.resolveType===oe),xe=vc(_,c,he?.schema),ve=new Set(Object.keys((xe??he?.schema)?.properties??{})),be=i!==null&&typeof i=="object"&&!Array.isArray(i)?i:{},De=Object.fromEntries(Object.entries(be).filter(Me=>{const[He]=Me;return ve.has(He)})),Ie={...R6(he?.schema),...De};if(B){const Me=he?.discriminatorValue??oe;r({...Ie,[B]:Me});return}if(Wr(oe)){r(Ie);return}r({...Ie,__resolveType:oe})};let V;e[7]!==q||e[8]!==B||e[9]!==r?(V=oe=>{if(B||!Wr(q)||oe===null||typeof oe!="object"||Array.isArray(oe)){r(oe);return}const{__resolveType:he,...xe}=oe;r(xe)},e[7]=q,e[8]=B,e[9]=r,e[10]=V):V=e[10];const ee=V,te=J?.properties?n.jsx(vi,{schema:J,value:v,onChange:oe=>{if(p&&u){u(p.blockKey,oe);return}if(L){r({..._,section:oe});return}ee(oe)},basePath:o,breadcrumbPath:T,onBreadcrumbChange:A,meta:c,decofile:h,onSaveReferencedBlock:u,sandbox:f}):null;let ae;e[11]!==o?(ae=o.includes("."),e[11]=o,e[12]=ae):ae=e[12];const de=ae;let fe;e[13]!==a||e[14]!==o?(fe=n.jsx($e,{htmlFor:o,children:a}),e[13]=a,e[14]=o,e[15]=fe):fe=e[15];let Q;e[16]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx(Ct,{children:n.jsx(Et,{placeholder:"Select..."})}),e[16]=Q):Q=e[16];let se;return e[17]!==s.description?(se=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[17]=s.description,e[18]=se):se=e[18],n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[fe,n.jsxs(jt,{value:q||void 0,onValueChange:X,children:[Q,n.jsx(kt,{children:x.map(I6)})]}),se]}),te&&(b?n.jsx(D6,{path:o,open:R,onOpenChange:P,title:de?"Configuration":"Loader configuration",nested:te,nestedBlockRef:de,globalBlockKey:p?.blockKey}):te)]})}if(s.anyOfRefs&&s.anyOfRefs.length>0)return null;let D;e[19]!==a||e[20]!==o?(D=n.jsx($e,{htmlFor:o,children:a}),e[19]=a,e[20]=o,e[21]=D):D=e[21];const O=i!=null?String(i):"";let $;e[22]!==r?($=q=>r(q.target.value),e[22]=r,e[23]=$):$=e[23];const K=s.description??"";let z;e[24]!==o||e[25]!==O||e[26]!==$||e[27]!==K?(z=n.jsx("input",{id:o,type:"text",value:O,onChange:$,className:"w-full rounded-md border bg-background px-3 py-1.5 text-sm",placeholder:K}),e[24]=o,e[25]=O,e[26]=$,e[27]=K,e[28]=z):z=e[28];let U;e[29]!==s.description?(U=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[29]=s.description,e[30]=U):U=e[30];let G;return e[31]!==D||e[32]!==z||e[33]!==U?(G=n.jsxs("div",{className:"space-y-1.5",children:[D,z,U]}),e[31]=D,e[32]=z,e[33]=U,e[34]=G):G=e[34],G}function I6(t){const e=t.title&&!t.title.includes("/")?t.title:va(t.resolveType)??mt(t.resolveType);return n.jsx(et,{value:t.resolveType,children:e},t.resolveType)}function M6(t){return t.resolveType.includes("/")&&!Wr(t.resolveType)}function B6(t){return t.resolveType!==""}function O6(t){if(!Array.isArray(t))return[];const e=[];for(const s of t)if(typeof s=="string")e.push({value:s,label:s});else if(s&&typeof s=="object"&&"value"in s){const i=s;e.push({value:String(i.value),label:typeof i.label=="string"?i.label:String(i.value),image:typeof i.image=="string"?i.image:void 0})}return e}async function $6(t,e,s){const i={};s&&(i.term=s);const o=`${t.replace(/\/+$/,"")}/deco/invoke/${e}`,a=await fetch(o,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)});if(!a.ok)throw new Error(`Failed to fetch dynamic options: ${a.status}`);const l=await a.json();return O6(l)}function Cc(t){const e=F.c(8),{path:s,label:i,description:r}=t;let o;e[0]!==i||e[1]!==s?(o=n.jsx($e,{htmlFor:s,children:i}),e[0]=i,e[1]=s,e[2]=o):o=e[2];let a;e[3]!==r?(a=r&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==a?(l=n.jsxs("div",{className:"space-y-0.5",children:[o,a]}),e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function z6(t){const e=F.c(71),{schema:s,value:i,onChange:r,path:o,label:a,sandbox:l}=t,d=s.options,c=l?.previewUrl,[h,u]=M.useState(!1),[f,m]=M.useState(""),[p,_]=M.useState(""),L=M.useRef(null);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=Z=>{m(Z),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{_(Z)},300)},e[0]=v):v=e[0];const x=v,g=l?`${l.orgSlug}/${l.virtualMcpId}/${l.branch}`:"";let y;e[1]!==p||e[2]!==d||e[3]!==g?(y=Tt.sandboxInvoke(g,`dynamic-options:${d??""}:${p}`),e[1]=p,e[2]=d,e[3]=g,e[4]=y):y=e[4];let b;e[5]!==p||e[6]!==d||e[7]!==c?(b=()=>$6(c,d,p||void 0),e[5]=p,e[6]=d,e[7]=c,e[8]=b):b=e[8];const S=!!c&&!!d&&h;let w;e[9]!==y||e[10]!==b||e[11]!==S?(w={queryKey:y,queryFn:b,enabled:S,staleTime:6e4,retry:1},e[9]=y,e[10]=b,e[11]=S,e[12]=w):w=e[12];const C=Ps(w);let N;e[13]!==C.data?(N=C.data??[],e[13]=C.data,e[14]=N):N=e[14];const T=N,A=typeof i=="string"?i:"";let j;if(e[15]!==A||e[16]!==T){let Z;e[18]!==A?(Z=J=>J.value===A,e[18]=A,e[19]=Z):Z=e[19],j=T.find(Z),e[15]=A,e[16]=T,e[17]=j}else j=e[17];const k=j;if(!c||!d){let Z;e[20]!==a||e[21]!==o||e[22]!==s.description?(Z=n.jsx(Cc,{path:o,label:a,description:s.description}),e[20]=a,e[21]=o,e[22]=s.description,e[23]=Z):Z=e[23];let J;e[24]!==r?(J=V=>r(V.target.value),e[24]=r,e[25]=J):J=e[25];let B;e[26]!==A||e[27]!==o||e[28]!==J?(B=n.jsx(ze,{id:o,type:"text",value:A,onChange:J}),e[26]=A,e[27]=o,e[28]=J,e[29]=B):B=e[29];let X;return e[30]!==B||e[31]!==Z?(X=n.jsxs("div",{className:"space-y-2",children:[Z,B]}),e[30]=B,e[31]=Z,e[32]=X):X=e[32],X}let I;e[33]!==a||e[34]!==o||e[35]!==s.description?(I=n.jsx(Cc,{path:o,label:a,description:s.description}),e[33]=a,e[34]=o,e[35]=s.description,e[36]=I):I=e[36];let E;e[37]!==A||e[38]!==k?(E=k?n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[k.image&&n.jsx("img",{src:k.image,alt:"",referrerPolicy:"no-referrer",className:"h-6 w-6 shrink-0 rounded object-cover"}),n.jsx("span",{className:"truncate",children:k.label??k.value})]}):A?n.jsx("span",{className:"truncate",children:A}):n.jsx("span",{className:"text-muted-foreground",children:"Select..."}),e[37]=A,e[38]=k,e[39]=E):E=e[39];let R;e[40]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx(Qd,{className:"size-4 shrink-0 opacity-50"}),e[40]=R):R=e[40];let P;e[41]!==h||e[42]!==E?(P=n.jsx(Ss,{asChild:!0,children:n.jsxs(ie,{variant:"outline",role:"combobox","aria-expanded":h,className:"h-10 w-full justify-between font-normal",children:[E,R]})}),e[41]=h,e[42]=E,e[43]=P):P=e[43];let D;e[44]===Symbol.for("react.memo_cache_sentinel")?(D={width:"var(--radix-popover-trigger-width)"},e[44]=D):D=e[44];let O;e[45]!==f?(O=n.jsx(po,{placeholder:"Search...",className:"h-9",value:f,onValueChange:x}),e[45]=f,e[46]=O):O=e[46];const $=C.isLoading?"Loading...":"No results found.";let K;e[47]!==$?(K=n.jsx(go,{children:$}),e[47]=$,e[48]=K):K=e[48];let z;if(e[49]!==A||e[50]!==r||e[51]!==T){let Z;e[53]!==A||e[54]!==r?(Z=J=>n.jsxs(On,{value:J.value,onSelect:()=>{r(J.value===A?"":J.value),u(!1)},children:[n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[J.image&&n.jsx("img",{src:J.image,alt:"",referrerPolicy:"no-referrer",className:"h-9 w-9 shrink-0 rounded object-cover"}),n.jsx("span",{className:"truncate",children:J.label??J.value})]}),n.jsx(Ls,{className:le("ml-auto size-4 shrink-0",A===J.value?"opacity-100":"opacity-0")})]},J.value),e[53]=A,e[54]=r,e[55]=Z):Z=e[55],z=T.map(Z),e[49]=A,e[50]=r,e[51]=T,e[52]=z}else z=e[52];let U;e[56]!==z?(U=n.jsx($n,{children:z}),e[56]=z,e[57]=U):U=e[57];let G;e[58]!==K||e[59]!==U?(G=n.jsxs(_o,{children:[K,U]}),e[58]=K,e[59]=U,e[60]=G):G=e[60];let q;e[61]!==O||e[62]!==G?(q=n.jsx(ws,{className:"p-0",style:D,children:n.jsxs(Pl,{shouldFilter:!1,children:[O,G]})}),e[61]=O,e[62]=G,e[63]=q):q=e[63];let W;e[64]!==h||e[65]!==P||e[66]!==q?(W=n.jsxs(bs,{open:h,onOpenChange:u,children:[P,q]}),e[64]=h,e[65]=P,e[66]=q,e[67]=W):W=e[67];let H;return e[68]!==W||e[69]!==I?(H=n.jsxs("div",{className:"space-y-2",children:[I,W]}),e[68]=W,e[69]=I,e[70]=H):H=e[70],H}function F6(t){const e=F.c(17),{org:s}=Fe(),i=mi();let r,o,a,l;e[0]!==s.id||e[1]!==t.configId||e[2]!==t.imageOnly||e[3]!==t.search?(o=t.search?.trim()||void 0,r=t.imageOnly??!1,l=$m,a=Tt.filePickerObjects(s.id,t.configId,o,r),e[0]=s.id,e[1]=t.configId,e[2]=t.imageOnly,e[3]=t.search,e[4]=r,e[5]=o,e[6]=a,e[7]=l):(r=e[4],o=e[5],a=e[6],l=e[7]);const d=t.enabled!==!1&&!!t.configId;let c;e[8]!==r||e[9]!==t.configId||e[10]!==o||e[11]!==i?(c=async u=>{const{pageParam:f}=u;return await i.call("FILE_OBJECTS_LIST",{configId:t.configId,cursor:f??void 0,search:o,imageOnly:r||void 0})},e[8]=r,e[9]=t.configId,e[10]=o,e[11]=i,e[12]=c):c=e[12];let h;return e[13]!==a||e[14]!==d||e[15]!==c?(h={queryKey:a,enabled:d,staleTime:3e4,initialPageParam:null,queryFn:c,getNextPageParam:H6},e[13]=a,e[14]=d,e[15]=c,e[16]=h):h=e[16],l(h)}function H6(t){return t.nextCursor??void 0}function m9(){const t=F.c(2),{org:e}=Fe();let s;return t[0]!==e?(s={mutationFn:async i=>{const r=i.file.type||"application/octet-stream",o=await fetch(`/api/${encodeURIComponent(e.slug)}/file-configs/${encodeURIComponent(i.configId)}/upload?filename=${encodeURIComponent(i.file.name)}`,{method:"POST",headers:{"Content-Type":r},body:i.file});if(!o.ok){const a=await o.text().catch(U6);let l=`${o.status} ${o.statusText}`;try{const d=JSON.parse(a);d.message&&(l=d.message)}catch{a&&(l=a.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await o.json()}},t[0]=e,t[1]=s):s=t[1],hi(s)}function U6(){return""}const Co="file-picker:last-config-id";function ju(t){const e=F.c(19),s=t.mode==="image"?"Pick an image":"Pick a file";let i;e[0]!==s?(i=n.jsx(ns,{children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(qi,{children:"Upload a new file or pick one previously uploaded to a configured bucket."}),e[2]=r):r=e[2];let o;e[3]!==i?(o=n.jsxs(is,{children:[i,r]}),e[3]=i,e[4]=o):o=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(El,{className:"h-64 w-full"}),e[5]=a):a=e[5];let l;e[6]!==t?(l=u=>{t.onSelect(u),t.onOpenChange(!1)},e[6]=t,e[7]=l):l=e[7];let d;e[8]!==t.lockedConfigId||e[9]!==t.mode||e[10]!==l?(d=n.jsx(Jt,{fallback:W6,children:n.jsx(M.Suspense,{fallback:a,children:n.jsx(K6,{mode:t.mode,lockedConfigId:t.lockedConfigId,onSelect:l})})}),e[8]=t.lockedConfigId,e[9]=t.mode,e[10]=l,e[11]=d):d=e[11];let c;e[12]!==o||e[13]!==d?(c=n.jsxs($t,{className:"sm:max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",children:[o,d]}),e[12]=o,e[13]=d,e[14]=c):c=e[14];let h;return e[15]!==t.onOpenChange||e[16]!==t.open||e[17]!==c?(h=n.jsx(Ot,{open:t.open,onOpenChange:t.onOpenChange,children:c}),e[15]=t.onOpenChange,e[16]=t.open,e[17]=c,e[18]=h):h=e[18],h}function W6(t){const{error:e}=t;return n.jsx(V6,{error:e??new Error("Failed to load buckets")})}function V6(t){const e=F.c(3),{error:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ui,{size:16}),e[0]=i):i=e[0];let r;return e[1]!==s.message?(r=n.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,n.jsx("span",{className:"text-sm font-medium",children:s.message})]}),e[1]=s.message,e[2]=r):r=e[2],r}function K6(t){const e=F.c(32),{mode:s,lockedConfigId:i,onSelect:r}=t,o=Om();if(o.length===0){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Y6,{}),e[0]=p):p=e[0],p}if(i){let p;if(e[1]!==o||e[2]!==i){let L;e[4]!==i?(L=v=>v.id===i,e[4]=i,e[5]=L):L=e[5],p=o.find(L),e[1]=o,e[2]=i,e[3]=p}else p=e[3];const _=p;if(_){let L;return e[6]!==_||e[7]!==s||e[8]!==r?(L=n.jsx(Ho,{config:_,mode:s,onSelect:r}),e[6]=_,e[7]=s,e[8]=r,e[9]=L):L=e[9],L}}if(o.length===1){const p=o[0];let _;return e[10]!==p||e[11]!==s||e[12]!==r?(_=n.jsx(Ho,{config:p,mode:s,onSelect:r}),e[10]=p,e[11]=s,e[12]=r,e[13]=_):_=e[13],_}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=typeof window<"u"?window.localStorage.getItem(Co):null,e[14]=a):a=e[14];const l=a;let d;e[15]!==o?(d=o.find(p=>p.id===l)?.id??o[0].id,e[15]=o,e[16]=d):d=e[16];const c=d;let h;e[17]!==o?(h=o.map(q6),e[17]=o,e[18]=h):h=e[18];let u;e[19]!==h?(u=n.jsx(uo,{className:"self-start",children:h}),e[19]=h,e[20]=u):u=e[20];let f;if(e[21]!==o||e[22]!==s||e[23]!==r){let p;e[25]!==s||e[26]!==r?(p=_=>n.jsx(Ai,{value:_.id,className:"min-h-0 flex-1 overflow-hidden",children:n.jsx(Ho,{config:_,mode:s,onSelect:r})},_.id),e[25]=s,e[26]=r,e[27]=p):p=e[27],f=o.map(p),e[21]=o,e[22]=s,e[23]=r,e[24]=f}else f=e[24];let m;return e[28]!==c||e[29]!==u||e[30]!==f?(m=n.jsxs(fo,{defaultValue:c,onValueChange:G6,className:"min-h-0 flex-1 flex flex-col",children:[u,f]}),e[28]=c,e[29]=u,e[30]=f,e[31]=m):m=e[31],m}function q6(t){return n.jsx(Hs,{value:t.id,children:t.name},t.id)}function G6(t){typeof window<"u"&&window.localStorage.setItem(Co,t)}function Y6(){const t=F.c(4),{org:e}=Fe();let s,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:n.jsx(Yn,{size:20,className:"text-muted-foreground"})}),i=n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-sm",children:"No bucket configured"}),n.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket in Settings before you can upload files."})]}),t[0]=s,t[1]=i):(s=t[0],i=t[1]);let r;return t[2]!==e.slug?(r=n.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s,i,n.jsx(ie,{asChild:!0,size:"sm",className:"mt-2",children:n.jsx(ed,{to:"/$org/settings/files",params:{org:e.slug},children:"Configure a bucket"})})]}),t[2]=e.slug,t[3]=r):r=t[3],r}function Ho({config:t,mode:e,onSelect:s}){const[i,r]=M.useState(""),o=Cm(i,300),a=F6({configId:t.id,search:o,imageOnly:e==="image"}),l=m9(),[d,c]=M.useState(!1),h=M.useRef(null),u=e==="image"?"image/*":void 0;async function f(S){if(!S)return;const w=Array.from(S);if(w.length===0)return;let C=null;const N=[];for(const T of w)try{const A=await l.mutateAsync({configId:t.id,file:T});C??=A.publicUrl}catch(A){N.push(`${T.name} (${A instanceof Error?A.message:"upload failed"})`)}await a.refetch(),N.length>0&&ue.error(N.length===w.length?`Upload failed: ${N.join("; ")}`:`Some files failed: ${N.join("; ")}`),C&&s(C)}function m(S){S.preventDefault(),c(!0)}function p(){c(!1)}function _(S){S.preventDefault(),c(!1),f(S.dataTransfer.files)}const v=(a.data?.pages??[]).flatMap(S=>S.items),x=v.filter(S=>e==="image"?Nu(S.key):!0),g=o.trim(),y=v.length>0||i.trim().length>0,b=i!==o||a.isFetching&&!a.isFetchingNextPage;return n.jsxs("div",{className:"flex flex-col gap-3 min-h-0 h-full",children:[n.jsxs("button",{type:"button",onClick:()=>h.current?.click(),onDragOver:m,onDragLeave:p,onDrop:_,className:le("rounded-xl border border-dashed border-border/60 p-6 flex flex-col items-center justify-center gap-2 text-center transition-colors",d&&"border-primary bg-primary/5",l.isPending&&"opacity-60 pointer-events-none"),children:[n.jsx(Yn,{size:18,className:"text-muted-foreground"}),n.jsx("p",{className:"text-sm font-medium",children:l.isPending?"Uploading…":"Drop files here or click to upload"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Up to 100 MB."," ",e==="image"?"Images only (PNG, JPEG, WebP, GIF, SVG, AVIF).":"Common image, video, audio, and document types."]}),n.jsx("input",{ref:h,type:"file",accept:u,multiple:!0,className:"hidden",onChange:S=>{const w=Array.from(S.target.files??[]);S.target.value="",f(w)}})]}),y?n.jsx(jl,{value:i,onChange:r,isSearching:b,placeholder:e==="image"?"Search images…":"Search files…"}):null,n.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[x.length===0?g?n.jsx(Z6,{query:g}):e==="image"&&v.length>0?n.jsx(X6,{}):n.jsx(J6,{}):e==="image"?n.jsx(eL,{items:x,onSelect:s}):n.jsx(tL,{items:x,onSelect:s}),a.hasNextPage&&n.jsx("div",{className:"flex justify-center py-4",children:n.jsx(ie,{type:"button",variant:"outline",size:"sm",disabled:a.isFetchingNextPage,onClick:()=>a.fetchNextPage(),children:a.isFetchingNextPage?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Loading…"]}):"Load more"})})]})]})}function J6(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[n.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:n.jsx(oi,{size:18,className:"text-muted-foreground"})}),n.jsx("p",{className:"text-sm font-medium",children:"No files in this bucket yet"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Drop a file above to get started."})]}),t[0]=e):e=t[0],e}function X6(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[n.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:n.jsx(oi,{size:18,className:"text-muted-foreground"})}),n.jsx("p",{className:"text-sm font-medium",children:"No images in this bucket yet"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"The bucket has other files, but none match common image formats."})]}),t[0]=e):e=t[0],e}function Z6(t){const e=F.c(6),{query:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:n.jsx(oi,{size:18,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let r;e[1]!==s?(r=n.jsxs("p",{className:"text-sm font-medium",children:['No matches for "',s,'"']}),e[1]=s,e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("p",{className:"text-xs text-muted-foreground",children:"Try a different search, or load more files below."}),e[3]=o):o=e[3];let a;return e[4]!==r?(a=n.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[i,r,o]}),e[4]=r,e[5]=a):a=e[5],a}function Nu(t){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(t)}function Q6(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"file":t.slice(e+1).toLowerCase()}function eL(t){const e=F.c(7),{items:s,onSelect:i}=t;let r;if(e[0]!==s||e[1]!==i){let a;e[3]!==i?(a=l=>n.jsx(Eu,{item:l,variant:"image",onSelect:i},l.key),e[3]=i,e[4]=a):a=e[4],r=s.map(a),e[0]=s,e[1]=i,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:r}),e[5]=r,e[6]=o):o=e[6],o}function tL(t){const e=F.c(7),{items:s,onSelect:i}=t;let r;if(e[0]!==s||e[1]!==i){let a;e[3]!==i?(a=l=>n.jsx("li",{children:n.jsx(Eu,{item:l,variant:"row",onSelect:i})},l.key),e[3]=i,e[4]=a):a=e[4],r=s.map(a),e[0]=s,e[1]=i,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=n.jsx("ul",{className:"divide-y divide-border/60 rounded-lg border border-border/60",children:r}),e[5]=r,e[6]=o):o=e[6],o}function Eu(t){const e=F.c(58),{item:s,variant:i,onSelect:r}=t;let o;e[0]!==s.key?(o=Q6(s.key),e[0]=s.key,e[1]=o):o=e[1];const a=o;if(i==="image"){let g;e[2]!==s.publicUrl||e[3]!==r?(g=()=>r(s.publicUrl),e[2]=s.publicUrl,e[3]=r,e[4]=g):g=e[4];let y;e[5]!==s.key||e[6]!==s.publicUrl?(y=n.jsx("img",{src:s.publicUrl,alt:s.key,loading:"lazy",className:"h-full w-full object-cover",onError:sL}),e[5]=s.key,e[6]=s.publicUrl,e[7]=y):y=e[7];let b;e[8]!==s.key||e[9]!==g||e[10]!==y?(b=n.jsx("button",{type:"button",onClick:g,className:"block h-full w-full transition hover:ring-2 hover:ring-primary",title:s.key,children:y}),e[8]=s.key,e[9]=g,e[10]=y,e[11]=b):b=e[11];let S;e[12]!==a?(S=n.jsx("span",{className:"pointer-events-none absolute left-1.5 top-1.5 rounded bg-background/80 px-1.5 py-0.5 text-[10px] font-medium uppercase text-foreground opacity-0 backdrop-blur-sm transition-opacity group-hover:opacity-100",children:a}),e[12]=a,e[13]=S):S=e[13];let w;e[14]!==s||e[15]!==r?(w=n.jsx("div",{className:"absolute right-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100",children:n.jsx(kc,{item:s,onSelect:r})}),e[14]=s,e[15]=r,e[16]=w):w=e[16];let C;e[17]!==s.key?(C=jc(s.key),e[17]=s.key,e[18]=C):C=e[18];let N;e[19]!==C?(N=n.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",children:n.jsx("p",{className:"truncate text-xs text-white",children:C})}),e[19]=C,e[20]=N):N=e[20];let T;return e[21]!==b||e[22]!==S||e[23]!==w||e[24]!==N?(T=n.jsxs("div",{className:"group relative aspect-square overflow-hidden rounded-lg border border-border/60 bg-muted",children:[b,S,w,N]}),e[21]=b,e[22]=S,e[23]=w,e[24]=N,e[25]=T):T=e[25],T}let l;e[26]!==s.publicUrl||e[27]!==r?(l=()=>r(s.publicUrl),e[26]=s.publicUrl,e[27]=r,e[28]=l):l=e[28];let d;e[29]!==s.key?(d=n.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted",children:Nu(s.key)?n.jsx(oi,{size:16,className:"text-muted-foreground"}):n.jsx(Di,{size:16,className:"text-muted-foreground"})}),e[29]=s.key,e[30]=d):d=e[30];let c;e[31]!==s.key?(c=jc(s.key),e[31]=s.key,e[32]=c):c=e[32];let h;e[33]!==c?(h=n.jsx("p",{className:"truncate text-sm font-medium",children:c}),e[33]=c,e[34]=h):h=e[34];let u;e[35]!==s.key?(u=n.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:s.key}),e[35]=s.key,e[36]=u):u=e[36];let f;e[37]!==h||e[38]!==u?(f=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,u]}),e[37]=h,e[38]=u,e[39]=f):f=e[39];let m;e[40]!==a?(m=n.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:a}),e[40]=a,e[41]=m):m=e[41];let p;e[42]!==s.size?(p=oL(s.size),e[42]=s.size,e[43]=p):p=e[43];let _;e[44]!==p?(_=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:p}),e[44]=p,e[45]=_):_=e[45];let L;e[46]!==_||e[47]!==l||e[48]!==d||e[49]!==f||e[50]!==m?(L=n.jsxs("button",{type:"button",onClick:l,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[d,f,m,_]}),e[46]=_,e[47]=l,e[48]=d,e[49]=f,e[50]=m,e[51]=L):L=e[51];let v;e[52]!==s||e[53]!==r?(v=n.jsx(kc,{item:s,onSelect:r}),e[52]=s,e[53]=r,e[54]=v):v=e[54];let x;return e[55]!==L||e[56]!==v?(x=n.jsxs("div",{className:"group flex items-center gap-3 px-3 py-2 transition hover:bg-muted/50",children:[L,v]}),e[55]=L,e[56]=v,e[57]=x):x=e[57],x}function sL(t){t.target.style.display="none"}function kc(t){const e=F.c(22),{item:s,onSelect:i}=t,[r,o]=M.useState(!1);let a;e[0]!==s.publicUrl?(a=async function(g){g.preventDefault(),g.stopPropagation();try{await navigator.clipboard.writeText(s.publicUrl),o(!0),window.setTimeout(()=>o(!1),1500)}catch{ue.error("Failed to copy URL")}},e[0]=s.publicUrl,e[1]=a):a=e[1];const l=a;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(es,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"size-7 rounded-md bg-background/80 backdrop-blur-sm",onClick:rL,"aria-label":"Asset actions",children:n.jsx(Dm,{size:14})})}),e[2]=d):d=e[2];let c;e[3]!==s.publicUrl||e[4]!==i?(c=()=>i(s.publicUrl),e[3]=s.publicUrl,e[4]=i,e[5]=c):c=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Ls,{size:14}),e[6]=h):h=e[6];let u;e[7]!==c?(u=n.jsxs(We,{onClick:c,children:[h,"Use this"]}),e[7]=c,e[8]=u):u=e[8];let f;e[9]!==r?(f=r?n.jsx(Ls,{size:14}):n.jsx(Xt,{size:14}),e[9]=r,e[10]=f):f=e[10];const m=r?"Copied":"Copy URL";let p;e[11]!==l||e[12]!==f||e[13]!==m?(p=n.jsxs(We,{onClick:l,children:[f,m]}),e[11]=l,e[12]=f,e[13]=m,e[14]=p):p=e[14];let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(pi,{size:14}),e[15]=_):_=e[15];let L;e[16]!==s.publicUrl?(L=n.jsx(We,{asChild:!0,children:n.jsxs("a",{href:s.publicUrl,target:"_blank",rel:"noreferrer",onClick:iL,children:[_,"Open in new tab"]})}),e[16]=s.publicUrl,e[17]=L):L=e[17];let v;return e[18]!==L||e[19]!==u||e[20]!==p?(v=n.jsxs(Qt,{children:[d,n.jsxs(ts,{align:"end",onClick:nL,children:[u,p,L]})]}),e[18]=L,e[19]=u,e[20]=p,e[21]=v):v=e[21],v}function iL(t){return t.stopPropagation()}function nL(t){return t.stopPropagation()}function rL(t){return t.stopPropagation()}function jc(t){const e=t.split("/");return e[e.length-1]??t}function oL(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Tu(t,e){if(!e)return null;const s=e.toLowerCase();return t.find(i=>{const r=i.bucket.toLowerCase();return i.siteSlug?.toLowerCase()===s||r===s||r===`deco-assets-${s}`})??null}function Nc(t){const e=F.c(2),{ext:s}=t;if(!s)return null;let i;return e[0]!==s?(i=n.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function aL(t){try{const e=new URL(t).pathname;return decodeURIComponent(e.split("/").pop()??t)}catch{return t.split("/").pop()??t}}function lL(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"":t.slice(e+1).toLowerCase()}function cL(t){const e=F.c(79),{schema:s,value:i,onChange:r,path:o,label:a,sandbox:l}=t,d=s.format==="video-uri",c=u9(i),[h,u]=M.useState(!1),[f,m]=M.useState(!1),p=c?aL(c):"",_=p?lL(p):"",L=th(),v=m9();let x;e[0]!==L.data?.configs?(x=L.data?.configs??[],e[0]=L.data?.configs,e[1]=x):x=e[1];const g=l?.siteSlug;let y;e[2]!==x||e[3]!==g?(y=Tu(x,g),e[2]=x,e[3]=g,e[4]=y):y=e[4];const b=y;let S;e[5]!==L.data?.configs||e[6]!==b?(S=function(){if(b)return b.id;const Q=L.data?.configs??[];if(Q.length===1)return Q[0].id;if(Q.length===0)return null;const se=typeof window<"u"?window.localStorage.getItem(Co):null;return Q.some(oe=>oe.id===se)?se:null},e[5]=L.data?.configs,e[6]=b,e[7]=S):S=e[7];const w=S;let C;e[8]!==d||e[9]!==r||e[10]!==w||e[11]!==u||e[12]!==v?(C=async function(Q){if(!Q)return;let se=Array.from(Q);if(se.length===0)return;if(d&&(se=se.filter(dL),se.length===0)){ue.error("Please drop a video file (mp4, webm, …).");return}const oe=w();if(!oe){u(!0);return}try{const he=await v.mutateAsync({configId:oe,file:se[0]});r(he.publicUrl),se.length>1&&ue.info(`Uploaded ${se[0].name}; extra files were ignored (single-select field).`)}catch(he){const xe=he;ue.error(xe instanceof Error?xe.message:"Upload failed")}},e[8]=d,e[9]=r,e[10]=w,e[11]=u,e[12]=v,e[13]=C):C=e[13];const N=C;let T;e[14]!==m?(T=function(Q){Q.preventDefault(),Q.dataTransfer.types.includes("Files")&&m(!0)},e[14]=m,e[15]=T):T=e[15];const A=T;let j;e[16]!==m?(j=function(Q){Q.currentTarget===Q.target&&m(!1)},e[16]=m,e[17]=j):j=e[17];const k=j;let I;e[18]!==N||e[19]!==m?(I=function(Q){Q.preventDefault(),m(!1),N(Q.dataTransfer.files)},e[18]=N,e[19]=m,e[20]=I):I=e[20];const E=I;let R;e[21]!==a||e[22]!==o?(R=n.jsx($e,{htmlFor:o,className:"text-muted-foreground",children:a}),e[21]=a,e[22]=o,e[23]=R):R=e[23];let P;e[24]!==s.description?(P=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[24]=s.description,e[25]=P):P=e[25];let D;e[26]!==P||e[27]!==R?(D=n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[R,P]}),e[26]=P,e[27]=R,e[28]=D):D=e[28];const O=f&&"border-primary ring-2 ring-primary/30",$=v.isPending&&"pointer-events-none opacity-60";let K;e[29]!==O||e[30]!==$?(K=le("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",O,$),e[29]=O,e[30]=$,e[31]=K):K=e[31];let z;e[32]!==_||e[33]!==p||e[34]!==d||e[35]!==u||e[36]!==c||e[37]!==v.isPending?(z=c?d?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"relative h-40 w-full overflow-hidden bg-black",children:n.jsx("video",{src:c,preload:"metadata",className:"h-full w-full object-contain"},c)}),n.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[n.jsx(F9,{size:14,className:"shrink-0 text-muted-foreground"}),n.jsx("p",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:p}),n.jsx(Nc,{ext:_})]})]}):n.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[n.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-md bg-background",children:n.jsx(Di,{size:18,className:"text-muted-foreground"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:p}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:c})]}),n.jsx(Nc,{ext:_})]}):n.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex w-full flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[d?n.jsx(F9,{size:20}):n.jsx(Di,{size:20}),n.jsx("span",{className:"text-sm font-medium",children:v.isPending?"Uploading…":d?"Drop a video here or click to browse":"Drop a file or click to browse"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Up to 100 MB"})]}),e[32]=_,e[33]=p,e[34]=d,e[35]=u,e[36]=c,e[37]=v.isPending,e[38]=z):z=e[38];let U;e[39]!==f?(U=f&&n.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:n.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[39]=f,e[40]=U):U=e[40];let G;e[41]!==k||e[42]!==A||e[43]!==E||e[44]!==K||e[45]!==z||e[46]!==U?(G=n.jsxs("div",{onDragOver:A,onDragLeave:k,onDrop:E,className:K,children:[z,U]}),e[41]=k,e[42]=A,e[43]=E,e[44]=K,e[45]=z,e[46]=U,e[47]=G):G=e[47];let q;e[48]!==r?(q=fe=>r(fe.target.value),e[48]=r,e[49]=q):q=e[49];let W;e[50]!==o||e[51]!==c||e[52]!==q?(W=n.jsx(ze,{id:o,type:"url",value:c,onChange:q,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[50]=o,e[51]=c,e[52]=q,e[53]=W):W=e[53];let H;e[54]!==u?(H=()=>u(!0),e[54]=u,e[55]=H):H=e[55];let Z;e[56]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(Yn,{size:14}),e[56]=Z):Z=e[56];const J=c?"Replace":"Browse";let B;e[57]!==H||e[58]!==J?(B=n.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:H,className:"h-9 shrink-0",children:[Z,J]}),e[57]=H,e[58]=J,e[59]=B):B=e[59];let X;e[60]!==r||e[61]!==c?(X=c&&n.jsx(ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(""),className:"h-9 shrink-0","aria-label":"Remove file",children:n.jsx(ss,{size:14})}),e[60]=r,e[61]=c,e[62]=X):X=e[62];let V;e[63]!==W||e[64]!==B||e[65]!==X?(V=n.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[W,B,X]}),e[63]=W,e[64]=B,e[65]=X,e[66]=V):V=e[66];let ee;e[67]!==r?(ee=fe=>r(fe),e[67]=r,e[68]=ee):ee=e[68];const te=b?.id??null;let ae;e[69]!==h||e[70]!==u||e[71]!==ee||e[72]!==te?(ae=n.jsx(ju,{open:h,onOpenChange:u,mode:"any",onSelect:ee,lockedConfigId:te}),e[69]=h,e[70]=u,e[71]=ee,e[72]=te,e[73]=ae):ae=e[73];let de;return e[74]!==D||e[75]!==G||e[76]!==V||e[77]!==ae?(de=n.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[D,G,V,ae]}),e[74]=D,e[75]=G,e[76]=V,e[77]=ae,e[78]=de):de=e[78],de}function dL(t){return t.type.startsWith("video/")}function hL(t){try{const e=new URL(t).pathname;return decodeURIComponent(e.split("/").pop()??t)}catch{return t.split("/").pop()??t}}function uL(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"":t.slice(e+1).toLowerCase()}const fL=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/avif"]);function mL(t){const e=F.c(86),{schema:s,value:i,onChange:r,path:o,label:a,sandbox:l}=t,d=u9(i),[c,h]=M.useState(!1),[u,f]=M.useState(!1),[m,p]=M.useState(!1),[_,L]=M.useState(!1),v=d?hL(d):"",x=v?uL(v):"",g=th(),y=m9();let b;e[0]!==g.data?.configs?(b=g.data?.configs??[],e[0]=g.data?.configs,e[1]=b):b=e[1];const S=l?.siteSlug;let w;e[2]!==b||e[3]!==S?(w=Tu(b,S),e[2]=b,e[3]=S,e[4]=w):w=e[4];const C=w;let N;e[5]!==r||e[6]!==L||e[7]!==p?(N=function(ve){p(!1),L(!1),r(ve)},e[5]=r,e[6]=L,e[7]=p,e[8]=N):N=e[8];const T=N;let A;e[9]!==g.data?.configs||e[10]!==C?(A=function(){if(C)return C.id;const ve=g.data?.configs??[];if(ve.length===1)return ve[0].id;if(ve.length===0)return null;const be=typeof window<"u"?window.localStorage.getItem(Co):null;return ve.some(De=>De.id===be)?be:null},e[9]=g.data?.configs,e[10]=C,e[11]=A):A=e[11];const j=A;let k;e[12]!==j||e[13]!==h||e[14]!==T||e[15]!==y?(k=async function(ve){if(!ve)return;const be=Array.from(ve).filter(pL);if(be.length===0){ue.error("Only image files are accepted here.");return}const De=j();if(!De){h(!0);return}try{const Ie=await y.mutateAsync({configId:De,file:be[0]});T(Ie.publicUrl),be.length>1&&ue.info(`Uploaded ${be[0].name}; extra files were ignored (single-select field).`)}catch(Ie){const Me=Ie;ue.error(Me instanceof Error?Me.message:"Upload failed")}},e[12]=j,e[13]=h,e[14]=T,e[15]=y,e[16]=k):k=e[16];const I=k;let E;e[17]!==f?(E=function(ve){ve.preventDefault(),ve.dataTransfer.types.includes("Files")&&f(!0)},e[17]=f,e[18]=E):E=e[18];const R=E;let P;e[19]!==f?(P=function(ve){ve.currentTarget===ve.target&&f(!1)},e[19]=f,e[20]=P):P=e[20];const D=P;let O;e[21]!==I||e[22]!==f?(O=function(ve){ve.preventDefault(),f(!1),I(ve.dataTransfer.files)},e[21]=I,e[22]=f,e[23]=O):O=e[23];const $=O;let K;e[24]!==a||e[25]!==o?(K=n.jsx($e,{htmlFor:o,className:"text-muted-foreground",children:a}),e[24]=a,e[25]=o,e[26]=K):K=e[26];let z;e[27]!==s.description?(z=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[27]=s.description,e[28]=z):z=e[28];let U;e[29]!==K||e[30]!==z?(U=n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[K,z]}),e[29]=K,e[30]=z,e[31]=U):U=e[31];const G=u&&"border-primary ring-2 ring-primary/30",q=y.isPending&&"pointer-events-none opacity-60";let W;e[32]!==G||e[33]!==q?(W=le("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",G,q),e[32]=G,e[33]=q,e[34]=W):W=e[34];let H;e[35]!==x||e[36]!==v||e[37]!==_||e[38]!==m||e[39]!==a||e[40]!==L||e[41]!==p||e[42]!==h||e[43]!==d||e[44]!==y.isPending?(H=d?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"relative h-40 w-full bg-[image:linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%),linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%)] bg-[position:0_0,8px_8px] [background-size:16px_16px]",children:[!_&&n.jsx("img",{src:d,alt:a,className:le("h-full w-full object-contain transition-opacity",!m&&"opacity-0"),onLoad:()=>p(!0),onError:()=>L(!0)},d),_&&n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-muted-foreground",children:[n.jsx(oi,{size:20}),n.jsx("p",{className:"text-xs",children:"Preview unavailable"})]}),!m&&!_&&n.jsx("div",{className:"absolute inset-0 animate-pulse bg-muted/60"})]}),n.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:v}),x&&n.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:x})]})]}):n.jsxs("button",{type:"button",onClick:()=>h(!0),className:"flex h-40 w-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[n.jsx(oi,{size:20}),n.jsx("span",{className:"text-sm font-medium",children:y.isPending?"Uploading…":"Drop an image or click to browse"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"PNG, JPEG, WebP, GIF, SVG, AVIF — up to 100 MB"})]}),e[35]=x,e[36]=v,e[37]=_,e[38]=m,e[39]=a,e[40]=L,e[41]=p,e[42]=h,e[43]=d,e[44]=y.isPending,e[45]=H):H=e[45];let Z;e[46]!==u?(Z=u&&n.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:n.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[46]=u,e[47]=Z):Z=e[47];let J;e[48]!==D||e[49]!==R||e[50]!==$||e[51]!==W||e[52]!==H||e[53]!==Z?(J=n.jsxs("div",{onDragOver:R,onDragLeave:D,onDrop:$,className:W,children:[H,Z]}),e[48]=D,e[49]=R,e[50]=$,e[51]=W,e[52]=H,e[53]=Z,e[54]=J):J=e[54];let B;e[55]!==T?(B=xe=>T(xe.target.value),e[55]=T,e[56]=B):B=e[56];let X;e[57]!==o||e[58]!==d||e[59]!==B?(X=n.jsx(ze,{id:o,type:"url",value:d,onChange:B,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[57]=o,e[58]=d,e[59]=B,e[60]=X):X=e[60];let V;e[61]!==h?(V=()=>h(!0),e[61]=h,e[62]=V):V=e[62];let ee;e[63]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(Yn,{size:14}),e[63]=ee):ee=e[63];const te=d?"Replace":"Browse";let ae;e[64]!==V||e[65]!==te?(ae=n.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:V,className:"h-9 shrink-0",children:[ee,te]}),e[64]=V,e[65]=te,e[66]=ae):ae=e[66];let de;e[67]!==T||e[68]!==d?(de=d&&n.jsx(ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(""),className:"h-9 shrink-0","aria-label":"Remove image",children:n.jsx(ss,{size:14})}),e[67]=T,e[68]=d,e[69]=de):de=e[69];let fe;e[70]!==X||e[71]!==ae||e[72]!==de?(fe=n.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[X,ae,de]}),e[70]=X,e[71]=ae,e[72]=de,e[73]=fe):fe=e[73];let Q;e[74]!==T?(Q=xe=>T(xe),e[74]=T,e[75]=Q):Q=e[75];const se=C?.id??null;let oe;e[76]!==c||e[77]!==h||e[78]!==Q||e[79]!==se?(oe=n.jsx(ju,{open:c,onOpenChange:h,mode:"image",onSelect:Q,lockedConfigId:se}),e[76]=c,e[77]=h,e[78]=Q,e[79]=se,e[80]=oe):oe=e[80];let he;return e[81]!==U||e[82]!==J||e[83]!==fe||e[84]!==oe?(he=n.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[U,J,fe,oe]}),e[81]=U,e[82]=J,e[83]=fe,e[84]=oe,e[85]=he):he=e[85],he}function pL(t){return fL.has(t.type||"")}function Au(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function gL(t,e){if(e.length===0)return 0;const s=Au(t);for(let o=0;o<e.length;o++){const a=e[o].discriminators;if(a&&Object.keys(a).length>0&&Object.entries(a).every(([d,c])=>s[d]===c))return o}let i=0,r=-1;for(let o=0;o<e.length;o++){const a=e[o],l=new Set(Object.keys(a.discriminators??{})),c=a.propertyKeys.filter(h=>!l.has(h)).filter(h=>s[h]!==void 0&&s[h]!==null&&s[h]!=="").length;c>r&&(r=c,i=o)}return i}function _L(t,e){const s=Au(t),i=new Set(e);return Object.fromEntries(Object.entries(s).filter(([r])=>!i.has(r)))}const LL="0 0 1080 1080",vL="matrix(1 0 0 1 540 540)",p9=[{code:"AC",name:"Acre",gTransform:"matrix(1 0 0 1 -248.53 -95.16)",pathTransform:"translate(-57.47, -224.1)",d:"M 30.47 237.77 L 28.39 237.73 L 28.93 235.92 L 28.72 235.09 L 28.47 234.6 L 27.22 233.9 L 27.08 233.45 L 27.35 232.3 L 26.58 230.35 L 25.49 229.71 L 19.89 228.46 L 12.55 228.27 L 12.82 227.71 L 15.31 225.45 L 16.2 224.22 L 16.49 223.02 L 16.27 221.79 L 15.59 220.88 L 14.76 220.44 L 13.08 217.49 L 12.31 217.05 L 11.41 216.86 L 10.28 215.73 L 9.36 213.35 L 7.36 211.82 L 6.38 208.2 L 5.51 206.56 L 3.63 205.48 L 3.55 204.31 L 4.36 204.41 L 4.78 203.89 L 4.85 203.22 L 4.65 202.8 L 2.53 201.87 L 2.17 201.21 L 0 199.32 L 0.04 198.95 L 0.66 198.9 L 1.16 197.58 L 1.15 196.27 L 4.16 195.88 L 4.66 195.49 L 4.44 194.14 L 3.27 192.57 L 3.27 192.57 L 21.22 200.05 L 44.88 205.71 L 57.02 208.85 L 83.46 223.02 L 111.97 235.15 L 111.97 235.15 L 114.94 236.41 L 114.94 236.41 L 114.64 236.89 L 113.07 237.55 L 110.98 239.14 L 108.12 241.93 L 106.47 242.79 L 105.81 242.61 L 104.28 242.79 L 104.23 243.35 L 102.31 244.65 L 100.23 245.64 L 98.79 247.47 L 98.35 248.65 L 97.74 248.93 L 96.57 248.18 L 95.81 248.05 L 93.44 248.1 L 92.76 248.36 L 92.13 248.81 L 91.77 249.67 L 89.33 253.15 L 85.56 254.4 L 84.72 255.09 L 82.78 255.6 L 81.75 255.63 L 81.83 253.52 L 80.47 253.72 L 76.92 252.95 L 71.68 252.48 L 66.59 252.86 L 65.93 252.28 L 63.66 252.11 L 60.1 253.94 L 57.37 254.56 L 55.69 253.89 L 54.29 252.45 L 52.65 253.61 L 52.69 236.06 L 52.74 234.96 L 53.21 234.25 L 53.28 231.9 L 53.02 231.02 L 53.99 229.84 L 54.47 228.7 L 53.31 228.9 L 50.34 231.49 L 48.74 232.5 L 46.68 234.88 L 44.73 235.55 L 44.08 236.63 L 42.27 237.62 z"},{code:"AL",name:"Alagoas",gTransform:"matrix(1 0 0 1 276.36 -86.82)",pathTransform:"translate(-582.36, -232.44)",d:"M 561.91 230.3 L 561.71 229.57 L 560.29 228.79 L 559.84 228.88 L 558.82 228.59 L 558.28 227.19 L 558.28 227.19 L 559.6 226.12 L 560.24 225.03 L 562.41 224.27 L 564.79 220.98 L 564.88 220.29 L 565.7 219.69 L 566.7 220.91 L 568.37 221.21 L 569.45 221.09 L 572 223.11 L 573.9 225.23 L 575.68 226.28 L 577.59 226.76 L 580.09 226.11 L 583.23 226.4 L 584.4 226.29 L 586.26 225.23 L 587.42 225.28 L 589.23 224.17 L 591.41 221.88 L 591.53 221.43 L 593.08 220.19 L 595.08 219.95 L 597.32 220.8 L 599.88 219.51 L 601.35 219.32 L 603.27 220.13 L 606.17 220.4 L 606.44 220.61 L 606.44 220.61 L 603.66 225.57 L 599.11 230.7 L 595.53 234.28 L 592.49 238.86 L 589.16 241.74 L 588.16 243.77 L 586.84 245.56 L 586.84 245.56 L 586.24 244.25 L 582.65 242.02 L 582.19 241.99 L 580.53 241.2 L 578.77 239.75 L 577.47 237.3 L 572.05 234.23 L 568.37 233.28 z"},{code:"AM",name:"Amazonas",gTransform:"matrix(1 0 0 1 -166.8 -178.05)",pathTransform:"translate(-139.2, -141.22)",d:"M 165.82 47.29 L 166.54 48.07 L 167.29 48.41 L 167.9 48.42 L 169.03 48 L 169.66 48.11 L 169.72 49.07 L 170.93 50.24 L 171.9 50.61 L 172.78 50.4 L 174.14 50.51 L 176.09 51.46 L 176.58 52.12 L 175.67 55.44 L 174.96 56.94 L 177.69 60.68 L 179.35 65.44 L 179.54 67.7 L 180.41 68.82 L 180.46 69.27 L 178.84 70.73 L 179.2 72.32 L 179.86 73.9 L 179.09 76.94 L 178.52 77.9 L 178.81 82.88 L 179.69 85.05 L 180.91 85.89 L 181.49 86.79 L 182.62 91.12 L 182.56 91.7 L 181.42 93.02 L 179.58 92.69 L 179.44 93.83 L 184.45 98.25 L 184.97 98.29 L 186.93 99.6 L 188.41 101.25 L 189.45 103.29 L 189.98 103.36 L 191.32 102.94 L 193.68 103.98 L 193.24 101.87 L 193.99 99.58 L 194.24 97.85 L 193.87 96.05 L 194.69 93.08 L 195.71 91.82 L 196.99 91.13 L 199.08 90.42 L 199.63 89.53 L 201.23 89.47 L 204.06 90.4 L 205.93 92.44 L 206.85 94.95 L 208.67 95.18 L 209.92 94.72 L 211.33 93.31 L 213.36 92.76 L 213.78 92.37 L 213.8 91.84 L 212.66 90.43 L 212.43 89.7 L 212.54 89.04 L 213.69 86.4 L 213.76 85.27 L 215.42 82.24 L 217.75 78.98 L 217.72 78.3 L 236.21 78.37 L 236.21 78.37 L 236.61 83.23 L 236.18 84.68 L 236.36 86.95 L 236.6 87.63 L 238.3 88.48 L 238.48 88.89 L 238.13 89.58 L 238.08 91.69 L 239.91 93.68 L 240.27 93.87 L 240.97 93.69 L 242.81 94.92 L 243.36 96.75 L 243.4 97.68 L 243.7 98.13 L 248.34 101.9 L 252.92 104.44 L 253.55 105.34 L 254.9 106.43 L 256.78 107.1 L 259.15 108.41 L 261.41 109.06 L 262.77 109.21 L 264.09 110.03 L 264.17 110.64 L 265.44 111.98 L 268.14 113.42 L 269.24 115.59 L 271.11 116.38 L 271.96 115.77 L 273.34 115.42 L 273.53 115.9 L 273.4 116.68 L 275.21 118.35 L 245.31 182.59 L 244.53 183.9 L 243.08 185.03 L 242.5 186 L 242.47 187.13 L 243.29 189.46 L 243.67 190.03 L 244.74 190.61 L 246.32 192.17 L 246.96 193.43 L 247.11 195.39 L 247.68 195.96 L 247.68 195.96 L 246.5 197.16 L 246.3 197.77 L 246.24 198.53 L 246.58 199.37 L 246.31 200.38 L 245.11 202.2 L 244.25 202.84 L 243.83 203.69 L 243.93 204.54 L 244.59 205.91 L 245.05 207.85 L 243.67 212.07 L 242.49 217.29 L 241.28 218.02 L 193.43 218.34 L 193.43 218.34 L 193.47 217.64 L 193.11 217.26 L 191.72 216.98 L 189.8 218.06 L 189.26 219.8 L 188.58 219.99 L 185.34 218.51 L 184.66 215.63 L 184.04 215.43 L 183.06 215.56 L 182.6 215.35 L 181.35 212.08 L 178.81 211.1 L 177.48 209.83 L 176.68 207.92 L 176.23 207.43 L 174.08 206.3 L 163.29 206.36 L 161.91 208.92 L 160.19 209.42 L 160.28 210.59 L 160.02 210.81 L 157.54 211.34 L 156.35 212.93 L 156.3 213.6 L 157.2 214.3 L 157.37 214.75 L 157.01 215.77 L 156.2 216.92 L 154.14 218.13 L 154.03 219.94 L 154.27 221.4 L 150.4 220.94 L 148.27 221.32 L 147.07 222.39 L 145.28 222.29 L 144.44 221.74 L 143.98 221.72 L 142.23 222.98 L 141.7 223.82 L 141.96 225.57 L 139.42 228.73 L 138.74 228.81 L 138.06 228.28 L 137.42 226.02 L 137.04 225.93 L 135.2 226.95 L 133.9 228.16 L 132.53 228.55 L 131.76 228.42 L 130.68 228.92 L 130.27 229.45 L 130.14 230.17 L 128.92 230.96 L 128.55 230.98 L 126.24 228.65 L 125.52 228.28 L 122.65 228.61 L 118.69 228.35 L 118.85 229.64 L 118.7 230.2 L 117.15 232.01 L 115.23 232.59 L 111.97 235.15 L 111.97 235.15 L 83.46 223.02 L 57.02 208.85 L 44.88 205.71 L 21.22 200.05 L 3.27 192.57 L 3.27 192.57 L 3.2 191.92 L 3.9 189 L 5.12 187.6 L 10.04 184.13 L 12.3 183.89 L 12.77 183.59 L 13.75 182.03 L 13.83 181 L 12.09 176.51 L 12.47 175.32 L 13.65 173.13 L 14.93 171.81 L 15.85 170.56 L 16.27 169.58 L 16.57 167.84 L 16.28 166.52 L 16.95 164.48 L 17.26 162.17 L 17.99 161.42 L 21.65 159.79 L 23.84 158.56 L 24.99 157.52 L 25.43 156.12 L 26.21 155.75 L 27.62 155.64 L 29.27 154.71 L 32.81 151.98 L 35.23 151.55 L 36.74 151.84 L 40.93 150.62 L 42.43 149.85 L 44.25 149.49 L 47.58 149.87 L 48.88 148.28 L 49.51 146.83 L 50.6 146.22 L 52.74 146.42 L 53.38 146.96 L 54.7 146.72 L 55.8 145.98 L 57.51 146.1 L 57.82 146.63 L 57.8 147.81 L 59.41 149.1 L 62.24 149.18 L 62.82 148.78 L 63.28 148 L 63.17 147.61 L 64.34 142.69 L 71.04 105.52 L 72.2 102.6 L 71.21 97.64 L 71.33 97.38 L 70.03 96.33 L 68.55 93.58 L 68.51 93.09 L 69.16 91.7 L 68.64 89.92 L 68.27 89.52 L 66.57 88.93 L 63.54 86.58 L 61.6 84.3 L 61.8 72.79 L 65.69 72.53 L 67.44 71.36 L 70.94 70.44 L 73.62 72.2 L 74.84 72.31 L 76.11 71.88 L 75.62 70.19 L 75.92 68.47 L 74.55 66.37 L 73.98 65.83 L 72.83 65.23 L 71.32 65.76 L 68.53 65.15 L 64.96 65.24 L 64.9 55.34 L 65.86 55.38 L 67.18 54.8 L 69.46 54.2 L 72.3 55.07 L 91.33 55.13 L 90.87 54.47 L 90.08 54.33 L 89.7 53.13 L 90.65 51.2 L 92.08 51.6 L 92.69 53.12 L 93.56 54.44 L 94.22 54.79 L 95.05 54.8 L 96.66 54.19 L 98.6 52.1 L 98.92 51.26 L 100.18 50.02 L 102.73 48.63 L 104.02 49.09 L 105.19 51.67 L 106.81 53.66 L 107.55 54.96 L 108.21 56.74 L 108.44 58.29 L 107.95 61.92 L 108.15 63.68 L 111.35 62.93 L 119.66 69.99 L 120.45 70.27 L 122.95 70.48 L 125.25 69.48 L 126.95 67.78 L 129.06 66.62 L 131.25 66.51 L 131.81 66.8 L 132.58 67.88 L 132.56 68.85 L 131.45 70.55 L 131.82 71.53 L 132.4 71.8 L 133.73 71.08 L 134.29 70.17 L 134.52 68.88 L 135.52 67.72 L 135.99 67.49 L 136.99 67.67 L 137.54 67.49 L 137.95 66.83 L 138.41 64.52 L 138.92 64.15 L 140.43 63.79 L 143.36 62.02 L 144.33 62.57 L 145.26 62.28 L 146.86 61.24 L 147.88 59.63 L 149.99 58.42 L 152.02 58.97 L 154.38 57.32 L 154.93 56.5 L 155.37 53.84 L 155.34 52.55 L 156.11 51.63 L 157.14 51.21 L 158.88 51.19 L 160.22 50.8 L 162.28 49.2 L 163.24 48.83 L 165.52 48.53 z"},{code:"AP",name:"Amapá",gTransform:"matrix(1 0 0 1 32.29 -262.31)",pathTransform:"translate(-338.29, -56.97)",d:"M 344.98 99.7 L 344.04 99.64 L 343.27000000000004 99.98 L 341.97 100.10000000000001 L 339.18 99.42 L 337.73 98.39 L 337.3 96.89 L 335.43 95.5 L 335.32 94.2 L 335.53 93.51 L 335.21999999999997 91.93 L 334.89 91.46000000000001 L 333.94 91.27000000000001 L 333.53 90.33000000000001 L 333.60999999999996 87.9 L 330.67999999999995 84.62 L 329.9 84.98 L 329.08 84.79 L 327.58 81.31 L 327.71 79.73 L 327.12 77.92 L 326.5 77.36 L 325.83 75.85 L 325.64 73.74 L 326.07 70.6 L 325.9 70.27 L 323.33 69.53999999999999 L 321.31 67.27999999999999 L 320.55 64.44999999999999 L 320.74 63.72999999999999 L 321.42 63.49999999999999 L 320.93 62.31999999999999 L 320.25 62.349999999999994 L 317.41 59.69 L 316.47 59.83 L 316.09000000000003 60.25 L 314.76000000000005 60.39 L 313.9200000000001 60.12 L 313.12000000000006 59.14 L 311.9800000000001 58.3 L 310.7900000000001 58.18 L 310.30000000000007 56.9 L 309.63000000000005 56.1 L 307.70000000000005 55.050000000000004 L 306.41 54.56 L 303.02000000000004 54.190000000000005 L 301.94000000000005 54.480000000000004 L 300.77000000000004 54.46 L 300.46000000000004 53.92 L 300.22 52.480000000000004 L 300.47 47.940000000000005 L 301.09000000000003 46.64000000000001 L 300.72 44.34000000000001 L 300.1 43.77000000000001 L 300.1 43.77000000000001 L 300.45000000000005 43.56000000000001 L 301.44000000000005 43.86000000000001 L 301.43000000000006 44.67000000000001 L 301.14000000000004 44.85000000000001 L 301.48 45.82000000000001 L 302.95000000000005 45.760000000000005 L 303.77000000000004 45.99 L 304.12000000000006 46.89 L 304.96000000000004 47.6 L 307.21000000000004 48.38 L 310.50000000000006 49.13 L 313.26000000000005 47.35 L 313.61000000000007 46.59 L 315.3400000000001 45.42 L 316.1700000000001 45.13 L 316.86000000000007 46.07 L 319.57000000000005 47.01 L 320.65000000000003 46.89 L 322.37000000000006 45.88 L 322.49000000000007 45.46 L 322.81000000000006 45.49 L 324.27000000000004 46.79 L 324.07000000000005 47.66 L 326.44000000000005 47.489999999999995 L 326.95000000000005 47.989999999999995 L 327.90000000000003 48.16 L 328.52000000000004 48.15 L 329.43000000000006 47.67 L 331.1000000000001 46.17 L 332.88000000000005 45.07 L 334.63000000000005 42.77 L 335.00000000000006 41.77 L 334.80000000000007 41.230000000000004 L 337.93000000000006 34.730000000000004 L 338.0400000000001 32.910000000000004 L 339.1500000000001 31.610000000000003 L 339.8800000000001 31.42 L 343.48000000000013 25.630000000000003 L 343.71000000000015 24.480000000000004 L 344.5500000000001 23.280000000000005 L 346.34000000000015 21.730000000000004 L 346.97000000000014 20.070000000000004 L 349.08000000000015 18.930000000000003 L 349.5500000000002 18.01 L 350.5900000000002 17.430000000000003 L 351.1500000000002 18.890000000000004 L 352.0300000000002 20.250000000000004 L 350.3600000000002 15.450000000000003 L 350.2900000000002 14.160000000000004 L 350.4700000000002 13.830000000000004 L 353.8400000000002 16.250000000000004 L 354.9800000000002 17.460000000000004 L 355.8900000000002 18.680000000000003 L 356.4100000000002 19.870000000000005 L 356.44000000000017 21.450000000000003 L 356.88000000000017 21.76 L 357.20000000000016 21.28 L 357.58000000000015 21.18 L 357.79000000000013 21.58 L 358.0000000000001 29.47 L 358.66000000000014 33.339999999999996 L 361.3700000000001 39.38999999999999 L 364.03000000000014 48.32999999999999 L 367.35000000000014 53.32999999999999 L 368.3600000000001 53.67999999999999 L 371.6300000000001 53.599999999999994 L 374.4100000000001 54.53999999999999 L 375.7000000000001 55.38999999999999 L 376.4700000000001 58.03999999999999 L 376.31000000000006 61.36999999999999 L 375.02000000000004 62.32999999999999 L 373.29 62.75999999999999 L 372.91 63.08999999999999 L 374.70000000000005 62.93999999999999 L 375.74000000000007 62.51999999999999 L 376.02000000000004 62.749999999999986 L 376.14000000000004 63.33999999999999 L 375.97 64.07 L 370.94000000000005 68.13 L 369.77000000000004 70.22999999999999 L 367.62000000000006 71.63999999999999 L 365.68000000000006 75.35999999999999 L 362.77000000000004 78.85999999999999 L 362.07000000000005 79.31999999999998 L 361.13000000000005 79.22999999999998 L 359.68000000000006 79.74999999999997 L 357.6000000000001 82.72999999999998 L 357.6000000000001 82.72999999999998 L 356.2600000000001 82.79999999999997 L 355.5100000000001 83.69999999999997 L 355.5100000000001 83.69999999999997 L 354.0400000000001 85.37999999999998 L 353.07000000000005 87.59999999999998 L 351.95000000000005 89.46999999999998 L 351.11000000000007 90.11999999999999 L 348.1000000000001 93.57 L 347.74000000000007 95.97 L 347.9100000000001 97.77 L 345.9600000000001 99.58 L 344.98 99.7 z M 368.34 52.71 L 367.89 52.38 L 366.78999999999996 50.52 L 366.85999999999996 49.64 L 367.09 49.230000000000004 L 368.75 48.78 L 369.18 49.17 L 370.01 51.440000000000005 L 369.02 52.540000000000006 L 368.34 52.71 z M 370.83 70.32 L 370.43 70.07 L 370.35 69.36 L 371.46000000000004 68.26 L 372.34000000000003 68.11 L 373.59000000000003 68.35 L 374.05 68.24 L 374.49 67.6 L 374.54 68.19 L 373.57 69.63 L 372.58 70.13 L 370.83 70.32 z M 374.27 67.45 L 373.49 67.22 L 373.49 66.66 L 374.21000000000004 65.61999999999999 L 375.46000000000004 65.52 L 375.64000000000004 65.86999999999999 L 375.54 66.38 L 374.27 67.45 z M 367.08 49.03 L 366.32 48.53 L 366.58 47.7 L 367.46 47.53 L 368.32 47.85 L 368.33 48.58 L 367.08 49.03 z"},{code:"BA",name:"Bahia",gTransform:"matrix(1 0 0 1 193.52 -26.39)",pathTransform:"translate(-499.52, -292.87)",d:"M 527.5 365.33 L 527.14 364.5 L 527.8199999999999 363.15 L 527.81 362.62 L 527.28 361.58 L 523.15 358.53 L 523 358.02 L 523.22 356.51 L 522.65 355.28 L 522 355.52 L 521.8 355.96999999999997 L 521.4599999999999 356.15 L 521.2399999999999 355.9 L 521.7699999999999 351.5 L 522.5899999999999 348.2 L 523.41 347.32 L 525.88 347.56 L 526.9 346.85 L 526.9 346.43 L 526.34 345.41 L 526.5 342.76000000000005 L 531.46 338.54 L 532.9300000000001 335.46000000000004 L 532.5100000000001 334.29 L 531.7300000000001 333.27000000000004 L 530.8400000000001 333.21000000000004 L 530.1100000000001 332.83000000000004 L 527.2800000000001 330.36 L 525.1600000000001 330.38 L 522.97 329.78 L 520.7 328.7 L 517.97 328.14 L 515.99 328 L 514.67 328.99 L 513.1999999999999 329.49 L 510.5899999999999 329.04 L 510.0199999999999 329.25 L 509.5799999999999 325.29 L 503.05999999999995 319.09000000000003 L 502.67999999999995 318.91 L 498.28999999999996 320.14000000000004 L 496.76 318.90000000000003 L 496.25 319.11 L 495.32 318.89 L 492.78 317.66999999999996 L 490.60999999999996 316.04999999999995 L 489.62999999999994 316.22999999999996 L 485.2799999999999 312.59999999999997 L 484.1799999999999 312.05999999999995 L 481.4499999999999 311.30999999999995 L 479.6799999999999 311.55999999999995 L 477.7999999999999 312.4599999999999 L 476.9899999999999 313.5799999999999 L 476.3499999999999 313.75999999999993 L 471.0199999999999 312.2899999999999 L 470.4099999999999 311.7999999999999 L 470.1499999999999 310.2999999999999 L 470.2899999999999 309.4099999999999 L 471.5799999999999 306.6699999999999 L 470.7199999999999 306.2099999999999 L 468.43999999999994 305.68999999999994 L 466.25999999999993 305.6499999999999 L 465.05999999999995 305.1499999999999 L 463.2699999999999 305.06999999999994 L 459.43999999999994 306.6499999999999 L 455.17999999999995 309.6799999999999 L 454.53999999999996 310.7899999999999 L 451.16999999999996 312.6599999999999 L 449.15 313.0599999999999 L 448.2 314.2399999999999 L 446.39 315.7899999999999 L 444.96 316.3099999999999 L 443.96 316.1599999999999 L 442.10999999999996 318.7399999999999 L 441.06999999999994 319.5099999999999 L 438.93999999999994 319.1299999999999 L 438.2199999999999 319.2599999999999 L 437.5299999999999 320.2599999999999 L 436.18999999999994 321.1799999999999 L 435.78999999999996 320.9399999999999 L 437.21999999999997 317.5099999999999 L 436.71 315.09999999999985 L 436.71 315.09999999999985 L 438.19 313.1299999999998 L 438.44 312.35999999999984 L 438.21 311.08999999999986 L 437.53999999999996 309.36999999999983 L 437.64 308.6999999999998 L 438.34999999999997 307.2799999999998 L 438.29999999999995 306.8199999999998 L 435.09 304.1999999999998 L 433.4 300.73999999999984 L 432.78 297.21999999999986 L 432.83 295.66999999999985 L 434.03 291.83999999999986 L 435.61999999999995 290.8099999999999 L 435.84999999999997 290.4299999999999 L 435.90999999999997 289.4899999999999 L 434.28 288.6499999999999 L 434.16999999999996 288.31999999999994 L 434.65 285.79999999999995 L 436.08 284.73999999999995 L 436.06 284.36999999999995 L 433.34 281.90999999999997 L 433.34 281.90999999999997 L 433.29999999999995 280.97999999999996 L 434.65999999999997 278.59999999999997 L 434.61999999999995 277.53 L 434.44999999999993 277.10999999999996 L 432.98999999999995 276.61999999999995 L 432.04999999999995 275.96999999999997 L 431.69999999999993 274.71 L 431.75999999999993 271.78999999999996 L 431.94999999999993 270.93999999999994 L 433.8999999999999 269.2699999999999 L 435.0399999999999 268.8499999999999 L 435.9999999999999 268.1299999999999 L 435.70999999999987 267.4999999999999 L 435.1299999999999 266.9799999999999 L 434.20999999999987 266.6899999999999 L 433.1799999999999 266.8699999999999 L 432.82999999999987 266.5399999999999 L 432.7399999999999 266.0399999999999 L 433.1599999999999 265.0799999999999 L 435.19999999999993 264.25999999999993 L 435.75999999999993 263.80999999999995 L 435.7199999999999 263.04999999999995 L 433.8399999999999 262.06999999999994 L 430.25999999999993 261.3999999999999 L 428.3999999999999 259.43999999999994 L 428.1699999999999 258.5199999999999 L 428.6699999999999 257.3599999999999 L 429.6799999999999 256.6299999999999 L 431.1999999999999 253.1499999999999 L 432.09999999999985 252.53999999999988 L 433.10999999999984 252.26999999999987 L 433.45999999999987 251.88999999999987 L 432.16999999999985 250.08999999999986 L 432.35999999999984 249.71999999999986 L 435.5699999999998 247.09999999999985 L 439.3899999999998 245.07999999999984 L 439.9499999999998 244.60999999999984 L 440.16999999999985 243.62999999999985 L 440.85999999999984 242.97999999999985 L 440.85999999999984 242.97999999999985 L 443.1899999999998 242.95999999999984 L 444.6299999999998 244.29999999999984 L 445.28999999999985 245.33999999999983 L 445.8199999999998 247.54999999999984 L 447.5799999999998 250.03999999999985 L 451.7599999999998 251.89999999999986 L 453.55999999999983 251.37999999999985 L 455.66999999999985 251.55999999999986 L 455.99999999999983 251.34999999999985 L 456.74999999999983 249.89999999999986 L 457.8899999999998 249.52999999999986 L 458.55999999999983 248.65999999999985 L 459.72999999999985 247.76999999999987 L 461.9399999999998 247.01999999999987 L 463.2699999999998 247.18999999999986 L 464.74999999999983 247.71999999999986 L 466.09999999999985 247.29999999999987 L 469.0699999999999 244.87999999999988 L 472.01999999999987 239.82999999999987 L 472.7399999999999 238.96999999999986 L 472.9799999999999 238.04999999999987 L 473.2799999999999 235.48999999999987 L 473.1599999999999 234.32999999999987 L 470.9199999999999 229.89999999999986 L 470.9699999999999 228.96999999999986 L 474.2099999999999 227.31999999999985 L 476.1599999999999 227.29999999999984 L 477.6599999999999 227.75999999999985 L 478.06999999999994 228.68999999999986 L 478.38999999999993 228.86999999999986 L 480.50999999999993 228.43999999999986 L 481.8999999999999 227.89999999999986 L 483.2299999999999 228.27999999999986 L 484.9399999999999 229.26999999999987 L 484.8099999999999 229.91999999999987 L 484.9999999999999 230.20999999999987 L 485.8199999999999 230.48999999999987 L 488.8199999999999 230.37999999999985 L 490.2899999999999 229.73999999999987 L 491.9899999999999 229.63999999999987 L 492.8099999999999 228.41999999999987 L 494.3199999999999 227.07999999999987 L 497.0499999999999 226.73999999999987 L 497.8199999999999 226.37999999999985 L 498.6299999999999 225.39999999999986 L 500.7999999999999 225.40999999999985 L 501.4199999999999 226.03999999999985 L 501.7299999999999 226.08999999999986 L 503.5899999999999 224.27999999999986 L 503.4899999999999 221.87999999999985 L 505.4799999999999 221.49999999999986 L 506.2699999999999 221.67999999999986 L 507.31999999999994 221.01999999999987 L 508.81999999999994 218.70999999999987 L 509.2799999999999 217.55999999999986 L 509.2799999999999 217.55999999999986 L 510.1699999999999 217.95999999999987 L 511.3299999999999 217.68999999999986 L 513.53 217.97999999999985 L 516.35 219.36999999999983 L 516.7900000000001 219.87999999999982 L 516.7300000000001 222.60999999999981 L 517.4500000000002 224.5499999999998 L 519.6600000000002 225.4599999999998 L 519.9300000000002 227.4599999999998 L 519.0100000000002 229.13999999999982 L 520.8400000000003 229.75999999999982 L 521.8000000000003 229.53999999999982 L 522.6200000000003 228.61999999999983 L 525.4900000000004 227.73999999999984 L 526.2600000000003 224.15999999999983 L 526.7600000000003 223.28999999999982 L 527.5100000000003 223.12999999999982 L 528.2900000000003 223.65999999999983 L 528.9200000000003 223.70999999999984 L 531.3100000000003 222.68999999999983 L 532.4100000000003 221.44999999999982 L 532.5800000000003 220.85999999999981 L 532.3300000000003 219.4999999999998 L 532.6200000000002 219.2499999999998 L 534.8600000000002 218.7999999999998 L 535.6300000000002 216.7499999999998 L 537.2800000000002 216.3099999999998 L 539.8100000000002 214.8499999999998 L 540.4000000000002 214.7499999999998 L 541.8900000000002 215.3099999999998 L 542.7200000000003 216.7499999999998 L 544.0800000000003 217.5599999999998 L 546.4400000000003 218.3399999999998 L 549.4300000000003 218.7399999999998 L 551.0100000000003 219.88999999999982 L 551.5500000000003 221.53999999999982 L 551.9400000000003 221.80999999999983 L 552.3700000000002 221.65999999999983 L 552.6600000000002 219.90999999999983 L 553.0900000000001 219.46999999999983 L 554.0900000000001 219.45999999999984 L 554.5400000000002 219.77999999999983 L 554.5600000000002 220.40999999999983 L 553.9400000000002 221.28999999999982 L 554.3900000000002 222.11999999999983 L 554.8900000000002 222.48999999999984 L 556.9900000000002 223.34999999999985 L 557.0100000000002 224.28999999999985 L 558.2300000000002 227.33999999999986 L 558.2300000000002 227.33999999999986 L 558.7700000000002 228.73999999999987 L 559.7900000000002 229.02999999999986 L 560.2400000000002 228.93999999999986 L 561.6700000000002 229.72999999999985 L 561.8700000000002 230.44999999999985 L 561.8700000000002 230.44999999999985 L 561.2000000000003 231.60999999999984 L 561.4100000000003 233.74999999999983 L 562.6900000000003 236.24999999999983 L 564.6800000000003 238.19999999999982 L 565.4300000000003 239.34999999999982 L 565.3500000000003 242.46999999999983 L 564.6900000000003 244.08999999999983 L 564.6000000000003 244.96999999999983 L 565.3600000000002 247.71999999999983 L 565.0600000000003 248.29999999999984 L 564.3700000000002 248.84999999999985 L 561.8200000000003 249.84999999999985 L 560.6900000000003 249.09999999999985 L 558.9800000000002 249.08999999999986 L 558.6600000000002 249.38999999999987 L 558.0700000000002 250.96999999999989 L 558.0900000000001 251.7399999999999 L 559.0400000000002 253.3399999999999 L 560.1400000000002 253.9999999999999 L 560.6600000000002 255.4899999999999 L 562.0900000000001 256.9999999999999 L 562.2400000000001 257.3899999999999 L 562.1100000000001 258.8099999999999 L 561.7700000000001 259.1999999999999 L 561.8900000000001 259.6199999999999 L 562.4800000000001 260.1399999999999 L 564.4100000000001 261.0599999999999 L 564.8900000000001 261.76999999999987 L 565.4300000000001 262.10999999999984 L 566.98 262.74999999999983 L 569.87 261.86999999999983 L 569.87 261.86999999999983 L 570.51 261.84999999999985 L 570.87 262.2599999999999 L 566.79 271.08999999999986 L 562.9599999999999 276.27999999999986 L 561.93 278.60999999999984 L 556.9 284.34999999999985 L 554.4499999999999 285.60999999999984 L 553.5799999999999 285.59999999999985 L 553.8799999999999 284.16999999999985 L 554.2499999999999 284.01999999999987 L 554.3899999999999 282.91999999999985 L 553.9399999999998 280.98999999999984 L 552.0699999999998 280.73999999999984 L 551.6399999999999 279.4399999999998 L 550.9599999999999 278.6899999999998 L 550.5899999999999 279.28999999999985 L 550.1299999999999 281.61999999999983 L 549.6299999999999 282.48999999999984 L 549.0799999999999 282.86999999999983 L 548.52 282.5799999999998 L 548.03 280.8399999999998 L 548.14 280.5199999999998 L 548.4499999999999 280.3899999999998 L 548.42 279.99999999999983 L 547.55 281.28999999999985 L 548.4799999999999 282.97999999999985 L 548.9399999999999 283.20999999999987 L 549.31 283.0599999999999 L 550.4599999999999 283.3199999999999 L 549.9999999999999 285.1299999999999 L 548.7899999999998 286.27999999999986 L 548.5399999999998 288.09999999999985 L 547.2899999999998 289.0699999999999 L 546.9399999999998 289.7399999999999 L 546.7399999999998 290.57999999999987 L 546.9199999999997 291.4299999999999 L 545.5699999999997 291.0399999999999 L 545.3599999999997 291.4299999999999 L 544.9999999999997 293.9499999999999 L 545.3599999999997 293.22999999999985 L 546.1099999999997 293.4399999999998 L 546.3499999999997 293.97999999999985 L 546.1199999999997 294.3899999999999 L 546.1799999999996 295.0099999999999 L 546.4799999999996 295.3099999999999 L 546.8099999999996 296.3099999999999 L 545.7699999999996 298.8199999999999 L 546.3399999999997 302.2599999999999 L 545.7899999999997 302.7499999999999 L 545.2199999999997 302.52999999999986 L 545.0799999999997 303.65999999999985 L 545.6699999999997 304.11999999999983 L 546.8799999999998 302.3999999999998 L 546.4099999999997 300.1899999999998 L 547.2299999999998 299.5799999999998 L 547.4799999999998 300.11999999999983 L 547.4199999999998 301.8799999999998 L 546.4599999999998 304.48999999999984 L 545.7199999999998 309.91999999999985 L 545.2099999999998 311.72999999999985 L 545.4099999999999 314.1999999999999 L 546.1899999999998 317.0499999999999 L 546.3799999999999 321.5899999999999 L 547.2499999999999 327.99999999999994 L 548.2399999999999 331.41999999999996 L 546.0299999999999 338.08 L 544.6799999999998 344.72999999999996 L 544.2099999999998 345.73999999999995 L 544.0499999999998 348.59999999999997 L 542.9899999999999 352.32 L 542.8999999999999 354.65 L 543.2899999999998 359.07 L 544.1799999999998 360.78 L 541.9399999999998 363.76 L 540.1299999999999 364.43 L 539.1899999999998 365.07 L 536.4699999999998 368.96 L 535.9 371 L 535.9 371 L 527.81 365.86 L 527.5 365.33 z M 549.78 287.33 L 549.55 286.13 L 550.29 285.71999999999997 L 551.3499999999999 284.67999999999995 L 551.5099999999999 284.03999999999996 L 551.1399999999999 283.30999999999995 L 551.8999999999999 283.44999999999993 L 552.7199999999999 284.49999999999994 L 552.67 285.0299999999999 L 549.78 287.33 z M 547.25 294.18 L 546.62 294.15000000000003 L 546.63 293.48 L 546.89 293.12 L 546.09 292.9 L 545.6700000000001 292.5 L 545.8000000000001 291.43 L 547.6700000000001 291.28000000000003 L 547.83 291.48 L 547.94 292.61 L 547.25 294.18 z"},{code:"CE",name:"Ceará",gTransform:"matrix(1 0 0 1 235.04 -154.64)",pathTransform:"translate(-541.04, -164.62)",d:"M 573.79 156.85 L 568.9 158.44 L 566.29 160.45 L 562.99 167.14 L 562.15 168.26 L 561.28 168.83 L 560.63 170.5 L 560.78 171.24 L 559.38 173.68 L 557.92 175.19 L 557.35 176.29 L 556.32 176.55 L 555.54 176.04 L 555.03 176.11 L 554.19 176.99 L 552.78 179.24 L 552.44 181.21 L 553.08 181.38 L 553.74 181 L 553.74 181 L 553.66 181.54 L 552.82 182.69 L 551.79 185.69 L 552.31 187 L 551.65 188.31 L 550.56 188.94 L 550.39 189.32 L 550.27 190.25 L 550.51 190.66 L 551.09 190.95 L 551.44 191.67 L 551.42 193.33 L 552.66 194.22 L 553.35 194.3 L 553.69 195.49 L 552.08 198.98 L 550.89 200.1 L 551.06 200.35 L 551.06 200.35 L 549.47 200.84 L 548.4 201.67 L 546.86 203.96 L 545.21 204.01 L 544.58 202.37 L 543.8 201.8 L 542.44 201.32 L 541.43 200.25 L 540.97 199.26 L 539.14 198.43 L 536.29 196.53 L 533.21 196.11 L 531.92 196.21 L 529.78 197.01 L 528.15 197.2 L 527.26 196.96 L 522.33 196.76 L 522.33 196.76 L 522.39 195.44 L 521.71 194.76 L 521.63 193.79 L 522.77 190.68 L 524.27 188.43 L 524.28 187.74 L 523.51 186.58 L 520.95 186.11 L 519.64 185.46 L 518.63 182.79 L 517.58 177.59 L 516.82 175.02 L 517.06 174.57 L 516.12 166.41 L 516.01 166.03 L 515.09 165.34 L 515.89 164.76 L 516.48 163.18 L 515.88 160.19 L 514.88 158.18 L 515.36 156.58 L 514.57 152.71 L 515.31 151.35 L 515.33 150.59 L 513.97 149 L 513.53 147.27 L 510.38 140.85 L 508.58 136.13 L 508.29 134.84 L 508.47 133.38 L 510.05 131.41 L 511.14 129.56 L 511.25 128.76 L 511.25 128.76 L 511.44 128.62 L 511.4 128 L 511 127.34 L 511.65 126.53 L 518.39 126.31 L 521.28 125.88 L 523.35 125.22 L 530.75 126.01 L 532.87 127.13 L 534.81 128.63 L 538.93 130.81 L 540.39 131.33 L 545.21 134.33 L 546.42 134.53 L 548.64 136.82 L 551.63 138.93 L 554.2 139.65 L 556.64 142.56 L 557.86 143.17 L 560.82 146.98 L 564.98 150.06 L 566.44 152.06 L 567.48 153.05 L 568.98 153.87 L 570.13 153.9 L 572.5 154.82 L 573.29 155.49 z"},{code:"DF",name:"Distrito Federal",gTransform:"matrix(1 0 0 1 103.1 10.18)",pathTransform:"translate(-409.11, -329.45)",d:"M 416.71 333.87 L 402.02 333.85 L 401.5 330.59 L 402.42 328.76 L 402.8 325.03 L 414.75 325.04 L 416.58 327.02 L 416.64 329.23 L 416.05 330.42 L 415.84 332.86 z"},{code:"ES",name:"Espírito Santo",gTransform:"matrix(1 0 0 1 212.62 72.56)",pathTransform:"translate(-518.62, -391.82)",d:"M 501.63 411.37 L 501.34 411.23 L 501.78 408.89 L 502.35 407.59 L 501.76 404.47 L 501.92 404.05 L 503.64 401.99 L 508.79 402.02 L 509.34 401.7 L 510.31 398.46 L 511.42 397.19 L 512.3 394.9 L 512.54 393.18 L 512.8 392.74 L 514.04 391.88 L 515.75 389.79 L 516.29 386.82 L 516 384.39 L 514.73 381.58 L 513.63 380.31 L 513.11 380.22 L 512.66 380.51 L 511.9 380.23 L 511.41 379.52 L 511.84 378.97 L 513.32 378.88 L 514.12 379.23 L 515.09 379.26 L 516.04 379.02 L 516.36 378.6 L 516.19 376.88 L 514.88 376.53 L 514.67 376.12 L 514.97 374.58 L 515 372.66 L 514.48 372 L 513.15 371.33 L 512.85 370.63 L 514.02 368.7 L 516.19 367.39 L 516.5 367.37 L 517.55 368.11 L 518.68 368.22 L 518.7 367.41 L 517.03 365.14 L 518.37 365.27 L 520.55 364.98 L 521.39 364.37 L 522.47 364.05 L 524.05 363.97 L 526.59 364.78 L 527.5 365.33 L 527.5 365.33 L 527.5 365.33 L 527.5 365.33 L 527.8 365.86 L 535.9 371 L 535.9 371 L 534.97 374.35 L 534.66 377.21 L 534.78 380.8 L 535.5 386.95 L 535.19 389.42 L 533.7 392.6 L 530.95 393.99 L 530.4 394.59 L 528.73 397.92 L 527.75 401.72 L 526.98 403.19 L 526.15 402.51 L 525.27 402.38 L 524.98 403.66 L 526.33 404.18 L 524.39 408.42 L 520.94 412.26 L 520.7 411.99 L 518.84 412.65 L 518.04 413.88 L 517.98 415.27 L 517.56 416.52 L 515.97 418.54 L 515.68 419.67 L 515.68 419.67 L 514.06 418.61 L 511.07 418.98 L 506.73 417.97 L 504.23 416.84 L 503.56 412.13 z"},{code:"GO",name:"Goiás",gTransform:"matrix(1 0 0 1 75.37 14.13)",pathTransform:"translate(-381.37, -333.38)",d:"M 416.71 333.87 L 415.84 332.86 L 416.05 330.42 L 416.64 329.23 L 416.58 327.02 L 414.75 325.04 L 402.8 325.03 L 402.42 328.76 L 401.5 330.59 L 402.02 333.85 L 416.71 333.87 L 416.71 333.87 L 416.71 333.87 L 416.71 333.87 L 416.18 335.39 L 416.49 336.96 L 415.81 338.55 L 414.77 339.8 L 414.36 341.27 L 415.21 342.48 L 416.06 342.82 L 417.48 343.85 L 419.13 348.41 L 419.13 349.01 L 416.81 351.72 L 413.57 354.73 L 413.14 356.87 L 414.23 357.98 L 415.13 357.51 L 416.71 358.08 L 417.18 358.69 L 417.36 359.69 L 417.19 360.4 L 416.46 361.3 L 415.95 363.19 L 417.14 366.65 L 414.05 368.71 L 412.89 368.91 L 412.03 369.81 L 411.55 370.93 L 406.66 373.67 L 405.96 372.9 L 401.61 371.04 L 401.06 371.52 L 400.48 371.61 L 398.73 371.62 L 397.25 371.34 L 393.39 371.5 L 391.38 370.61 L 387.25 373.25 L 384.34 376.17 L 384.01 376.17 L 382.7 374.75 L 381.18 374.45 L 377.99 376.09 L 374.28 375.47 L 371.8 376.43 L 369.57 376.97 L 368.16 379.07 L 366.95 381.53 L 367.01 382.53 L 366.17 383.83 L 365.35 384.11 L 364.51 383.95 L 364.06 384.09 L 363.12 384.83 L 361.48 386.93 L 360.91 388.83 L 361.47 389.44 L 361.46 389.78 L 361.1 390.01 L 360.24 389.55 L 360.24 389.55 L 360 389.1 L 357.34 386.86 L 354.19 386.25 L 352.57 384.7 L 350.67 384.27 L 349.18 384.23 L 345.83 382.89 L 345.15 382.04 L 342.08 380.48 L 341.41 379.87 L 339.97 379.16 L 338.83 378.99 L 336.13 377.31 L 333.35 377.47 L 329.55 376.77 L 329.42 376.44 L 329.68 375.6 L 330.25 374.43 L 331.56 372.67 L 331.48 372.25 L 329.23 371.35 L 328.09 372.02 L 327.43 371.83 L 327.15 371.42 L 326.92 370.31 L 327.18 367.73 L 326.99 365.96 L 326.99 365.96 L 326.04 363.76 L 325.86 360.33 L 324.45 358.14 L 324.29 357.43 L 324.69 354.02 L 327.24 350.17 L 327.62 347.26 L 328.32 346.49 L 330.34 345.65 L 332.26 343.88 L 333.51 341.86 L 333.84 339.91 L 334.34 338.9 L 335.62 337.86 L 336.44 336.43 L 336.52 334.89 L 338.27 333.92 L 339.67 331.3 L 342.32 331.17 L 345.04 330.31 L 345.36 330.03 L 347.34 325.84 L 348.05 324.88 L 348.69 320.78 L 349.07 320.04 L 350.99 318.1 L 352.64 317.09 L 353.71 316.83 L 354.94 317.51 L 356.15 316.78 L 357.54 315.35 L 358.38 312.42 L 359.55 309.55 L 359.54 308.75 L 359.06 307.61 L 359.64 304.87 L 361.24 301.78 L 361.12 296.6 L 362.33 295.82 L 363.36 293.19 L 365.36 290.02 L 365.75 288.95 L 365.59 286.23 L 365.94 285.33 L 366.91 284.47 L 367.18 283.34 L 367.1 282.71 L 367.1 282.71 L 367.44 282.26 L 367.64 280.38 L 368.3 279.15 L 370.11 277.06 L 370.67 276.76 L 370.64 278.47 L 369.42 280.35 L 368.9 282.69 L 371.3 283.09 L 373.5 284.12 L 377.43 284.52 L 380.52 286.23 L 384.59 287.66 L 385.22 287.43 L 386.85 281.49 L 388.32 279.1 L 389.5 278.13 L 390.65 279.44 L 391.69 281.32 L 392.8 285.03 L 393.41 288.13 L 394.55 288.18 L 395.3 287.43 L 395.6 286.43 L 396.16 285.89 L 398.92 286.23 L 403.45 285.7 L 403.67 286.44 L 403.11 288 L 406.24 289.47 L 409.59 290.15 L 410.28 290.07 L 410.79 286.77 L 411.34 286.8 L 412.85 289.42 L 413.31 289.66 L 415.09 288.76 L 417.61 286.68 L 422.14 285.68 L 423.69 285.68 L 426.25 284.58 L 427.99 283.24 L 433.35 281.82 L 433.35 281.82 L 436.07 284.28 L 436.09 284.66 L 434.66 285.72 L 434.18 288.24 L 434.28 288.57 L 435.91 289.41 L 435.85 290.35 L 435.62 290.73 L 434.03 291.76 L 432.84 295.59 L 432.79 297.14 L 433.41 300.66 L 435.11 304.12 L 438.32 306.74 L 438.37 307.21 L 437.65 308.63 L 437.55 309.3 L 438.22 311.02 L 438.45 312.3 L 438.2 313.07 L 436.72 315.04 L 436.72 315.04 L 435.72 316.05 L 432.49 315.71 L 431.59 313.95 L 429.17 312.47 L 428 313.96 L 428.58 317.73 L 428.01 318.27 L 427.61 318.4 L 424.83 317.26 L 423.66 317.49 L 423.29 317.77 L 422.57 320.95 L 423.29 321.05 L 423.78 322.21 L 423.21 323.15 L 422.48 323.85 L 422.52 325.75 L 422.94 326.36 L 423.47 326.55 L 424.16 330.81 L 423.63 331.34 L 420.27 332.24 L 417.98 333.75 z"},{code:"MA",name:"Maranhão",gTransform:"matrix(1 0 0 1 142.22 -148.63)",pathTransform:"translate(-448.22, -170.64)",d:"M 458.57 128.92 L 458.53 129.25 L 456.48999999999995 131.4 L 456.05999999999995 131.57 L 456.0199999999999 133.01 L 457.98999999999995 131.31 L 458.66999999999996 130.1 L 460.78999999999996 128.51999999999998 L 461.67999999999995 127.37999999999998 L 462.7099999999999 121.04999999999998 L 463.8599999999999 120.34999999999998 L 464.9699999999999 120.22999999999998 L 466.63999999999993 119.30999999999997 L 467.2899999999999 119.17999999999998 L 467.7499999999999 119.29999999999998 L 467.82999999999987 120.92999999999998 L 467.6299999999999 121.37999999999998 L 466.20999999999987 123.24999999999999 L 462.9999999999999 124.99999999999999 L 462.9699999999999 125.71999999999998 L 463.69999999999993 125.83999999999999 L 464.1499999999999 125.02999999999999 L 465.2999999999999 124.71999999999998 L 465.5199999999999 125.54999999999998 L 464.92999999999995 126.05999999999999 L 465.17999999999995 126.35999999999999 L 469.38999999999993 121.38999999999999 L 470.24999999999994 121.71999999999998 L 472.8299999999999 120.78999999999998 L 476.86999999999995 121.21999999999998 L 476.40999999999997 118.80999999999999 L 477.02 118.57999999999998 L 479.44 118.65999999999998 L 481.21999999999997 119.03999999999998 L 483.84999999999997 120.08999999999997 L 484.89 120.19999999999997 L 487.03999999999996 121.57999999999997 L 488.43999999999994 121.60999999999997 L 489.69999999999993 122.90999999999997 L 491.5899999999999 124.22999999999996 L 494.0899999999999 124.80999999999996 L 495.24999999999994 124.61999999999996 L 495.80999999999995 125.37999999999997 L 496.1499999999999 125.42999999999996 L 497.7399999999999 125.33999999999996 L 500.1999999999999 125.99999999999996 L 500.45999999999987 125.09999999999995 L 499.78999999999985 124.62999999999995 L 501.45999999999987 124.24999999999996 L 502.02999999999986 124.35999999999996 L 501.9399999999999 124.77999999999996 L 501.9399999999999 124.77999999999996 L 501.4799999999999 126.20999999999997 L 501.7099999999999 126.92999999999996 L 502.3399999999999 127.46999999999997 L 501.9599999999999 128.99999999999997 L 500.1699999999999 131.26999999999998 L 496.0399999999999 135.23999999999998 L 492.7199999999999 135.7 L 491.9199999999999 135.54 L 488.9999999999999 138.94 L 489.0399999999999 140.74 L 488.1599999999999 142.57000000000002 L 486.2699999999999 144.42000000000002 L 485.44999999999993 146.4 L 484.80999999999995 146.57 L 484.03999999999996 147.62 L 484.4 149.54 L 485.63 150.37 L 486.01 151.65 L 485.73 153.11 L 484.59000000000003 155.98000000000002 L 486.17 158.79000000000002 L 486.72 161.77 L 486.61 164.20000000000002 L 486.40000000000003 164.75000000000003 L 482.3 169.17000000000002 L 482.13 171.65 L 482.25 173.76000000000002 L 482.76 176.06000000000003 L 484.53999999999996 178.10000000000002 L 486.15 179.01000000000002 L 486.32 179.51000000000002 L 486.45 180.35000000000002 L 486.06 182.55 L 485.77 182.99 L 485.65 184.20000000000002 L 485.15 185.66000000000003 L 483.94 186.97000000000003 L 481.65 187.26000000000002 L 481 186.98000000000002 L 480.17 187.02 L 477.74 187.88000000000002 L 476.22 187.99000000000004 L 473.72 186.17000000000004 L 472.71000000000004 185.96000000000004 L 471.25000000000006 186.15000000000003 L 470.24000000000007 186.75000000000003 L 469.12000000000006 187.01000000000002 L 468.89000000000004 186.71 L 468.05000000000007 186.95000000000002 L 467.55000000000007 187.17000000000002 L 465.6500000000001 189.08 L 465.6600000000001 189.54000000000002 L 465.0300000000001 190.41000000000003 L 463.0200000000001 192.41000000000003 L 460.6800000000001 193.32000000000002 L 457.8100000000001 195.88000000000002 L 456.48000000000013 196.41000000000003 L 455.4300000000001 196.45000000000002 L 453.73000000000013 197.98000000000002 L 452.65000000000015 198.34000000000003 L 450.04000000000013 198.66000000000003 L 447.3200000000001 199.42000000000002 L 445.1900000000001 201.37 L 444.2100000000001 204.34 L 443.8200000000001 207.31 L 443.1900000000001 209.63 L 441.7400000000001 212.37 L 441.4400000000001 212.59 L 441.10000000000014 213.41 L 440.97000000000014 214.93 L 439.77000000000015 217.41 L 438.07000000000016 218.81 L 437.34000000000015 220.81 L 438.0500000000001 222.75 L 438.52000000000015 225.93 L 440.25000000000017 228.99 L 440.21000000000015 229.51000000000002 L 439.45000000000016 230.91000000000003 L 439.32000000000016 237.27000000000004 L 438.1700000000002 239.72000000000003 L 437.9100000000002 240.78000000000003 L 437.8600000000002 242.70000000000002 L 437.8600000000002 242.70000000000002 L 436.5800000000002 242.04000000000002 L 435.9700000000002 241.22000000000003 L 435.1500000000002 240.77000000000004 L 434.1600000000002 240.48000000000005 L 432.3800000000002 240.68000000000004 L 431.67000000000024 240.50000000000003 L 430.3200000000002 238.50000000000003 L 429.3300000000002 235.64000000000001 L 427.2000000000002 234.02 L 427.06000000000023 232.37 L 428.7000000000002 230.56 L 428.62000000000023 230.03 L 424.74000000000024 228.08 L 424.12000000000023 227.03 L 424.06000000000023 225.37 L 423.31000000000023 223.78 L 422.37000000000023 223.09 L 420.29000000000025 222.81 L 420.09000000000026 222.39000000000001 L 420.35000000000025 221.68 L 422.98000000000025 219.14000000000001 L 422.61000000000024 217.83 L 423.34000000000026 215.15 L 424.03000000000026 213.72 L 424.60000000000025 213.17 L 425.9400000000002 212.63 L 429.3300000000002 212.28 L 428.9400000000002 210.93 L 429.5800000000002 207.68 L 429.5000000000002 205.92000000000002 L 427.7000000000002 204.71 L 423.43000000000023 205.65 L 421.28000000000026 206.99 L 419.0100000000003 203.97 L 418.10000000000025 203.12 L 415.10000000000025 198.97 L 414.22000000000025 199.04 L 413.3800000000003 197.6 L 413.9900000000003 196.41 L 413.8800000000003 195.53 L 413.6300000000003 195.19 L 412.2600000000003 194.95 L 411.84000000000026 195.22 L 409.91000000000025 193.89 L 410.09000000000026 193.17999999999998 L 411.85000000000025 192.51999999999998 L 413.60000000000025 190.48 L 413.85000000000025 188.89 L 413.5700000000003 187.89 L 413.8800000000003 185.52999999999997 L 415.65000000000026 179.36999999999998 L 415.66000000000025 178.93999999999997 L 414.98000000000025 177.79999999999998 L 414.7500000000002 176.71999999999997 L 414.9600000000002 172.99999999999997 L 414.3200000000002 171.49999999999997 L 413.8500000000002 168.00999999999996 L 413.0100000000002 166.97999999999996 L 409.61000000000024 165.53999999999996 L 408.3900000000002 165.51999999999995 L 408.11000000000024 165.19999999999996 L 408.03000000000026 164.16999999999996 L 407.4400000000003 163.47999999999996 L 405.7000000000003 163.18999999999997 L 404.7400000000003 163.70999999999998 L 403.3400000000003 163.61999999999998 L 400.56000000000034 162.10999999999999 L 399.70000000000033 162.04999999999998 L 397.74000000000035 162.57999999999998 L 395.12000000000035 164.42999999999998 L 394.5900000000004 165.06999999999996 L 394.5900000000004 165.06999999999996 L 394.10000000000036 164.98999999999995 L 408.81000000000034 153.15999999999994 L 411.16000000000037 153.38999999999993 L 412.3300000000004 152.46999999999994 L 413.8800000000004 150.29999999999995 L 414.3100000000004 149.14999999999995 L 415.8600000000004 147.97999999999996 L 416.4800000000004 145.09999999999997 L 417.6000000000004 144.63999999999996 L 420.0400000000004 142.31999999999996 L 420.51000000000045 141.10999999999996 L 420.80000000000047 139.20999999999995 L 422.4000000000005 134.51999999999995 L 424.36000000000047 132.97999999999996 L 425.8400000000005 131.21999999999997 L 426.67000000000047 129.76999999999998 L 427.13000000000045 128.48999999999998 L 426.95000000000044 126.66999999999999 L 427.74000000000046 125.85999999999999 L 426.70000000000044 124.27999999999999 L 430.38000000000045 121.18999999999998 L 430.25000000000045 119.54999999999998 L 430.75000000000045 117.16999999999999 L 432.49000000000046 115.6 L 432.8500000000005 114.89 L 433.75000000000045 111.87 L 433.83000000000044 110.26 L 433.40000000000043 109.73 L 432.4100000000004 109.89 L 432.14000000000044 109.4 L 432.19000000000045 108.78 L 433.33000000000044 108.63 L 433.90000000000043 107.89 L 434.6100000000004 103.5 L 434.4500000000004 102.12 L 434.9200000000004 101.09 L 435.6900000000004 100.64 L 435.6900000000004 100.64 L 436.3200000000004 100.64 L 436.5600000000004 100.4 L 436.5000000000004 99.86 L 436.8400000000004 99.11 L 437.42000000000036 98.58 L 438.76000000000033 99.56 L 439.2100000000003 101.4 L 440.4000000000003 101.52000000000001 L 441.1700000000003 100.16000000000001 L 441.7800000000003 103.09000000000002 L 442.7700000000003 103.13000000000002 L 443.06000000000034 102.64000000000003 L 443.13000000000034 101.70000000000003 L 443.98000000000036 101.66000000000003 L 445.67000000000036 102.19000000000003 L 446.17000000000036 102.88000000000002 L 444.74000000000035 104.58000000000003 L 445.41000000000037 105.28000000000003 L 445.43000000000035 105.83000000000003 L 446.6400000000003 103.79000000000002 L 447.13000000000034 102.25000000000001 L 447.5800000000003 102.25000000000001 L 447.9800000000003 103.27000000000001 L 447.9800000000003 103.85000000000001 L 447.1100000000003 104.77000000000001 L 446.8400000000003 105.76 L 446.9200000000003 108.47 L 447.1800000000003 108.8 L 447.6500000000003 108.92 L 448.2300000000003 108.78 L 449.1900000000003 107.85 L 448.72000000000025 106.85 L 448.86000000000024 106.25 L 450.18000000000023 104.82 L 451.23000000000025 104.57 L 453.36000000000024 105.16 L 454.86000000000024 104.05 L 454.91000000000025 104.97 L 454.55000000000024 105.17999999999999 L 453.42000000000024 106.71 L 454.0100000000002 107.28999999999999 L 454.11000000000024 106.91999999999999 L 455.36000000000024 106.32 L 455.9400000000002 107.11 L 455.80000000000024 108.32 L 457.43000000000023 110.07 L 458.29000000000025 109.63 L 459.87000000000023 110.3 L 460.6400000000002 112.7 L 460.5300000000002 113.65 L 458.3400000000002 116.38000000000001 L 457.9600000000002 117.27000000000001 L 458.06000000000023 117.93 L 458.66000000000025 116.9 L 460.41000000000025 115.22 L 461.24000000000024 115.19 L 462.11000000000024 116 L 462.6300000000002 117.89 L 462.36000000000024 119.12 L 461.3900000000002 119.31 L 460.36000000000024 120.22 L 459.2000000000002 121.71 L 459.2700000000002 122.47999999999999 L 458.1100000000002 124.82999999999998 L 457.4900000000002 128.35 L 457.70000000000016 128.69 L 458.57 128.92 z M 459.09 129.37 L 459.03 128.58 L 459.55999999999995 127.05000000000001 L 459.1499999999999 125.98000000000002 L 459.2799999999999 125.32000000000002 L 460.18999999999994 124.08000000000003 L 460.73999999999995 123.89000000000003 L 460.78999999999996 126.24000000000002 L 460.56999999999994 127.58000000000003 L 459.7699999999999 128.18000000000004 L 459.09 129.37 z M 452.79 103.61 L 452.35 103.15 L 452.27000000000004 102.55000000000001 L 453.07000000000005 101.43 L 453.91 101.4 L 454.59000000000003 101.82000000000001 L 454.69000000000005 102.16000000000001 L 454.50000000000006 102.52000000000001 L 452.79 103.61 z M 456.29 107.79 L 456 107.49000000000001 L 456.06 106.96000000000001 L 457.12 106.07000000000001 L 457.6 106.14 L 458.1 106.99 L 457.96000000000004 107.6 L 457.56000000000006 107.42999999999999 L 456.29 107.79 z M 442.13 102.98 L 441.92 102.93 L 442.87 99.35000000000001 L 443.17 99.44000000000001 L 443.2 99.67000000000002 L 442.78999999999996 102.73000000000002 L 442.13 102.98 z"},{code:"MG",name:"Minas Gerais",gTransform:"matrix(1 0 0 1 139.79 56.66)",pathTransform:"translate(-445.79, -375.93)",d:"M 527.5 365.33 L 526.59 364.78 L 524.05 363.97 L 522.47 364.05 L 521.39 364.37 L 520.55 364.98 L 518.37 365.27 L 517.03 365.14 L 518.7 367.41 L 518.68 368.22 L 517.55 368.11 L 516.5 367.37 L 516.19 367.39 L 514.02 368.7 L 512.85 370.63 L 513.15 371.33 L 514.48 372 L 515 372.66 L 514.97 374.58 L 514.67 376.12 L 514.88 376.53 L 516.19 376.88 L 516.36 378.6 L 516.04 379.02 L 515.09 379.26 L 514.12 379.23 L 513.32 378.88 L 511.84 378.97 L 511.41 379.52 L 511.9 380.23 L 512.66 380.51 L 513.11 380.22 L 513.63 380.31 L 514.73 381.58 L 516 384.39 L 516.29 386.82 L 515.75 389.79 L 514.04 391.88 L 512.8 392.74 L 512.54 393.18 L 512.3 394.9 L 511.42 397.19 L 510.31 398.46 L 509.34 401.7 L 508.79 402.02 L 503.64 401.99 L 501.92 404.05 L 501.76 404.47 L 502.35 407.59 L 501.78 408.89 L 501.34 411.23 L 501.63 411.37 L 501.63 411.37 L 499.1 413.72 L 497.86 413.99 L 497.3 414.49 L 498.04 415.19 L 495.68 421.24 L 493.78 424.95 L 493.69 425.7 L 495.13 425.83 L 495.42 426.44 L 495.21 426.96 L 492.68 427.94 L 483.17 432.47 L 481.8 432.67 L 481.82 432.21 L 481.33 432.04 L 478.8 431.77 L 478.23 431.83 L 476.61 432.77 L 475.36 432.93 L 472.16 433.01 L 471.8 432.69 L 471.29 432.77 L 467.19 434.55 L 466.14 435.32 L 464.43 436.09 L 463.93 435.81 L 461.34 435.98 L 458.43 437.32 L 456.01 438.06 L 455.33 438.55 L 455.33 438.55 L 454.08 439.28 L 451.88 439.5 L 449.95 440.52 L 448.72 441.76 L 446.93 442.43 L 444.55 442.68 L 442.21 442.6 L 442.2 442.11 L 442.55 441.62 L 442.46 441.27 L 441.27 441.6 L 441.09 443.9 L 441.33 444.13 L 441.28 444.97 L 440.53 445.95 L 439.23 446.27 L 438.66 445.84 L 435.05 446.84 L 434.86 446.31 L 432.85 446.55 L 431.73 446.3 L 429.7 442.99 L 430.92 442.28 L 430.4 440.57 L 428.6 439.74 L 426.81 438.51 L 426.1 436.9 L 426.63 435.34 L 426.82 431.89 L 426.56 428.95 L 428.42 426.23 L 429.12 424.05 L 429.17 422.78 L 428.94 422.41 L 425.24 421.09 L 424.24 421.14 L 423.96 421.5 L 423.18 421.81 L 421.57 421.86 L 421.6 421.01 L 420.77 419.02 L 419.47 417.23 L 419.1 415.02 L 418.79 414.4 L 418 413.66 L 418.19 411.72 L 419.71 409.69 L 419.77 409.13 L 419.37 407.58 L 417.49 406.37 L 416.91 405.76 L 417.2 403.39 L 417.77 402.38 L 417.57 401.34 L 414.3 397.99 L 413 398.28 L 412.15 398.92 L 410.5 398.14 L 408.12 398.25 L 407.81 398.86 L 408.01 399.32 L 407.57 400.31 L 404.79 400.99 L 403.68 400.56 L 402.17 399.11 L 401.16 400.36 L 392.98 401.04 L 392.52 401.52 L 392.04 402.71 L 392.31 405.25 L 391.9 405.69 L 390.71 405.17 L 390.7 402.39 L 390.45 401.43 L 390.09 401.04 L 389.53 400.99 L 389.27 401.18 L 388.86 402.31 L 388.19 403.25 L 387.65 403.57 L 387.03 403.55 L 385.82 401.45 L 385.49 400.03 L 385.63 399.12 L 383.95 398.33 L 381.77 396.91 L 379.78 397.5 L 378.16 397.28 L 376.49 397.63 L 372.2 396.67 L 369.65 396.59 L 367.92 395.04 L 367.17 394.9 L 365.67 395.51 L 364.24 397.2 L 362.32 397.57 L 360.17 398.68 L 358.95 399.81 L 358.95 399.81 L 359.26 397.19 L 358.67 393.98 L 359.66 389.8 L 360.24 389.55 L 360.24 389.55 L 361.1 390.01 L 361.46 389.78 L 361.47 389.44 L 360.91 388.83 L 361.48 386.93 L 363.12 384.83 L 364.06 384.09 L 364.51 383.95 L 365.35 384.11 L 366.17 383.83 L 367.01 382.53 L 366.95 381.53 L 368.16 379.07 L 369.57 376.97 L 371.8 376.43 L 374.28 375.47 L 377.99 376.09 L 381.18 374.45 L 382.7 374.75 L 384.01 376.17 L 384.34 376.17 L 387.25 373.25 L 391.38 370.61 L 393.39 371.5 L 397.25 371.34 L 398.73 371.62 L 400.48 371.61 L 401.06 371.52 L 401.61 371.04 L 405.96 372.9 L 406.66 373.67 L 411.55 370.93 L 412.03 369.81 L 412.89 368.91 L 414.05 368.71 L 417.14 366.65 L 415.95 363.19 L 416.46 361.3 L 417.19 360.4 L 417.36 359.69 L 417.18 358.69 L 416.71 358.08 L 415.13 357.51 L 414.23 357.98 L 413.14 356.87 L 413.57 354.73 L 416.81 351.72 L 419.13 349.01 L 419.13 348.41 L 417.48 343.85 L 416.06 342.82 L 415.21 342.48 L 414.36 341.27 L 414.77 339.8 L 415.81 338.55 L 416.49 336.96 L 416.18 335.39 L 416.71 333.87 L 417.98 333.75 L 420.27 332.24 L 423.63 331.34 L 424.16 330.81 L 423.47 326.55 L 422.94 326.36 L 422.52 325.75 L 422.48 323.85 L 423.21 323.15 L 423.78 322.21 L 423.29 321.05 L 422.57 320.95 L 423.29 317.77 L 423.66 317.49 L 424.83 317.26 L 427.61 318.4 L 428.01 318.27 L 428.58 317.73 L 428 313.96 L 429.17 312.47 L 431.59 313.95 L 432.49 315.71 L 435.72 316.05 L 436.72 315.04 L 436.72 315.04 L 437.23 317.45 L 435.8 320.89 L 436.2 321.12 L 437.54 320.21 L 438.24 319.21 L 438.96 319.08 L 441.09 319.46 L 442.13 318.69 L 443.98 316.12 L 444.97 316.27 L 446.4 315.74 L 448.21 314.19 L 449.16 313.02 L 451.18 312.61 L 454.55 310.75 L 455.19 309.64 L 459.46 306.61 L 463.28 305.03 L 465.08 305.12 L 466.28 305.62 L 468.46 305.65 L 470.74 306.18 L 471.59 306.64 L 470.3 309.38 L 470.15 310.27 L 470.41 311.76 L 471.02 312.26 L 476.35 313.72 L 476.99 313.55 L 477.8 312.43 L 479.68 311.54 L 481.45 311.28 L 484.18 312.03 L 485.28 312.57 L 489.63 316.21 L 490.61 316.03 L 492.78 317.65 L 495.31 318.87 L 496.24 319.09 L 496.75 318.88 L 498.28 320.12 L 502.67 318.89 L 503.05 319.07 L 509.57 325.27 L 510.01 329.23 L 510.58 329.02 L 513.19 329.47 L 514.66 328.97 L 515.98 327.98 L 517.97 328.13 L 520.7 328.69 L 522.96 329.77 L 525.15 330.38 L 527.27 330.35 L 530.1 332.82 L 530.83 333.2 L 531.72 333.27 L 532.5 334.29 L 532.92 335.46 L 531.45 338.54 L 526.49 342.76 L 526.34 345.41 L 526.9 346.43 L 526.9 346.85 L 525.88 347.56 L 523.4 347.32 L 522.58 348.2 L 521.76 351.5 L 521.23 355.9 L 521.45 356.15 L 521.8 355.96 L 522 355.51 L 522.64 355.27 L 523.22 356.5 L 523 358.01 L 523.15 358.52 L 527.29 361.58 L 527.82 362.62 L 527.83 363.15 L 527.15 364.5 z"},{code:"MS",name:"Mato Grosso do Sul",gTransform:"matrix(1 0 0 1 -2.22 90.13)",pathTransform:"translate(-303.77, -409.4)",d:"M 358.95 399.81 L 358.55 402.27 L 358.27 402.67 L 356.77 403.45 L 355.45 403.49 L 354.98 403.71 L 353.76 404.74 L 351.77 407.42 L 351.04 408.07 L 350.03 408.37 L 349.41 410.05 L 349.25 412.98 L 346.66 416.62 L 345.7 417.14 L 345.47 417.52 L 345.78 419.45 L 345.7 420.4 L 344.49 422.74 L 342.49 425 L 342.84 425.85 L 342.56 427.06 L 341.12 428.09 L 340.72 429.3 L 338.99 430.99 L 337.73 433.43 L 335.78 435.3 L 328.22 439.83 L 326.96 440.97 L 326.22 442.51 L 325.38 443.59 L 325.38 443.59 L 319.97 445.86 L 318.86 446.68 L 317.93 449.01 L 317.95 450.16 L 316.5 453.72 L 315.83 454.4 L 314.17 455.41 L 313.06 455.73 L 312.73 456.08 L 311.16 464 L 310.8 464.82 L 308.42 466.38 L 308.42 466.38 L 305.87 464.05 L 302.46 462.16 L 298.47 464.13 L 297.79 464.88 L 296.13 465.37 L 293.55 465.8 L 291.19 465.34 L 290.18 464.69 L 289.71 460.42 L 289.39 459.72 L 288.49 458.77 L 288.26 456.3 L 288.77 454.96 L 288.13 454.17 L 288.04 453.73 L 288.04 450.86 L 287.15 448.89 L 286.55 446.15 L 286.5 445.43 L 287.09 444.07 L 287.11 442.46 L 285.54 441.37 L 285.16 440.57 L 285 438.41 L 283.35 436.59 L 281.18 436.33 L 279.67 436.64 L 277.84 436.35 L 275.38 434.39 L 274.82 432.9 L 273.28 433.23 L 271.11 435.97 L 270.11 435.37 L 268.39 436.18 L 267.31 436.34 L 265.57 435.65 L 263.01 435.16 L 259.55 435.39 L 255.89 434.68 L 255.41 433.77 L 253.42 433.64 L 252.53 434.16 L 250.03 433.28 L 250.94 426.01 L 250.51 423.63 L 251.11 422.21 L 252.09 420.75 L 252.69 414.72 L 252.03 412.39 L 251.98 410.66 L 251.22 409.7 L 250.79 409.61 L 250.3 410.26 L 249.66 407 L 248.87 405.13 L 247.66 403.11 L 247.31 401.28 L 251.34 398.98 L 252.1 398.1 L 247.9 394.24 L 253.28 382.82 L 254.4 382.76 L 254.12 380.63 L 253.38 380.5 L 256.61 370.17 L 257.27 369.01 L 254.18 363.16 L 254.21 361.25 L 254.21 361.25 L 254.91 361.45 L 255.93 362.55 L 258.08 364.07 L 263.7 362.1 L 265.75 360.1 L 267.77 357.15 L 267.86 355.98 L 269.26 354.53 L 271.85 354.56 L 273.41 354.34 L 274.18 354.68 L 275.84 354.17 L 277.19 352.92 L 279.21 352.43 L 280.48 352.63 L 281.24 353.78 L 284.03 355.03 L 286.65 355.5 L 287.3 355.85 L 287.57 356.71 L 288.35 357.73 L 291.38 358.89 L 292.64 360 L 293.88 360.57 L 298.4 359.94 L 299.66 359.14 L 300.15 358.29 L 301.58 357.68 L 304.02 357.75 L 305.61 358.79 L 305.91 360.16 L 306.15 360.41 L 307.14 360.45 L 309.27 359.57 L 310.28 359.63 L 315.9 353.62 L 317.24 353.49 L 316.01 360.1 L 314.21 360.8 L 312.55 363.63 L 312.36 364.09 L 312.51 364.62 L 313.81 364.73 L 315.55 366 L 320.17 366.27 L 320.74 365.7 L 323.4 365.62 L 324.27 365.7 L 325.44 366.27 L 326.99 365.96 L 326.99 365.96 L 327.18 367.73 L 326.92 370.31 L 327.15 371.42 L 327.43 371.83 L 328.09 372.02 L 329.23 371.35 L 331.48 372.25 L 331.56 372.67 L 330.25 374.43 L 329.68 375.6 L 329.42 376.44 L 329.55 376.77 L 333.35 377.47 L 336.13 377.31 L 338.83 378.99 L 339.97 379.16 L 341.41 379.87 L 342.08 380.48 L 345.15 382.04 L 345.83 382.89 L 349.18 384.23 L 350.67 384.27 L 352.57 384.7 L 354.19 386.25 L 357.34 386.86 L 360 389.1 L 360.24 389.55 L 360.24 389.55 L 359.66 389.8 L 358.67 393.98 L 359.26 397.19 z"},{code:"MT",name:"Mato Grosso",gTransform:"matrix(1 0 0 1 -23.8 -38.15)",pathTransform:"translate(-282.2, -281.12)",d:"M 206.96 296.05 L 208.43 294.62 L 212.54 292.05 L 213.06 289.6 L 214.49 285.82 L 215.42 284.74 L 217.06 284.21 L 217.49 283.8 L 218.07 282.96 L 218.59 280.71 L 220.25 278.7 L 220.81 276.46 L 220.88 274.75 L 220.3 273.26 L 220.34 271.21 L 218.81 267.87 L 217.91 267.9 L 217.33 267.39 L 216.9 264.14 L 217.04 262.82 L 218.4 261.74 L 219.8 259.99 L 219.97 259.24 L 218.56 255.65 L 217.49 255.22 L 216.38 255.11 L 212.88 255.2 L 211.66 254.09 L 211.9 253.53 L 194.74 253.48 L 195.64 244.48 L 194.14 241.73 L 193.87 239.97 L 193.9 239.17 L 194.9 235.65 L 194.52 233.72 L 195.46 232.05 L 194.63 229.78 L 194.48 228.39 L 194.22 227.78 L 193.44 227.31 L 193.38 226.96 L 194.67 221.97 L 195.43 220.55 L 194.83 219.31 L 193.43 218.34 L 193.43 218.34 L 241.28 218.02 L 242.49 217.29 L 243.67 212.07 L 245.05 207.85 L 244.59 205.91 L 243.93 204.54 L 243.83 203.69 L 244.25 202.84 L 245.11 202.2 L 246.31 200.38 L 246.58 199.37 L 246.24 198.53 L 246.3 197.77 L 246.5 197.16 L 247.68 195.96 L 247.68 195.96 L 248.85 197.04 L 251.3 201.1 L 251.7 202.86 L 253.07 206.82 L 254.39 208.75 L 255.16 210.37 L 254.93 212.81 L 255.41 215.21 L 256.14 217.41 L 257.67 218.52 L 260.67 221.27 L 264.05 222.97 L 264.28 223.91 L 264.24 225.01 L 264.47 225.5 L 265.42 225.9 L 266.24 225.73 L 267.87 226.18 L 268.41 226.9 L 268.61 227.98 L 268.96 228.3 L 270.33 227.85 L 274.02 229.34 L 308.06 231.76 L 371.03 235.24 L 371.03 235.24 L 370.38 236.26 L 369.82 238.15 L 368.72 239.4 L 368.28 242.54 L 367.85 243.39 L 367.48 243.66 L 365.54 248.95 L 365 251.92 L 364.96 254.87 L 363.08 260.86 L 363.14 261.72 L 364.53 263.06 L 364.37 263.93 L 363.55 264.82 L 363.5 265.32 L 364.6 267.57 L 364.13 270.88 L 364.14 272.45 L 364.66 273.03 L 365.1 276.08 L 364.36 278.84 L 365.34 282.18 L 366.3 282.69 L 367.1 282.71 L 367.1 282.71 L 367.18 283.34 L 366.91 284.47 L 365.94 285.33 L 365.59 286.23 L 365.75 288.95 L 365.36 290.02 L 363.36 293.19 L 362.33 295.82 L 361.12 296.6 L 361.24 301.78 L 359.64 304.87 L 359.06 307.61 L 359.54 308.75 L 359.55 309.55 L 358.38 312.42 L 357.54 315.35 L 356.15 316.78 L 354.94 317.51 L 353.71 316.83 L 352.64 317.09 L 350.99 318.1 L 349.07 320.04 L 348.69 320.78 L 348.05 324.88 L 347.34 325.84 L 345.36 330.03 L 345.04 330.31 L 342.32 331.17 L 339.67 331.3 L 338.27 333.92 L 336.52 334.89 L 336.44 336.43 L 335.62 337.86 L 334.34 338.9 L 333.84 339.91 L 333.51 341.86 L 332.26 343.88 L 330.34 345.65 L 328.32 346.49 L 327.62 347.26 L 327.24 350.17 L 324.69 354.02 L 324.29 357.43 L 324.45 358.14 L 325.86 360.33 L 326.04 363.76 L 326.99 365.96 L 326.99 365.96 L 325.44 366.27 L 324.27 365.7 L 323.4 365.62 L 320.74 365.7 L 320.17 366.27 L 315.55 366 L 313.81 364.73 L 312.51 364.62 L 312.36 364.09 L 312.55 363.63 L 314.21 360.8 L 316.01 360.1 L 317.24 353.49 L 315.9 353.62 L 310.28 359.63 L 309.27 359.57 L 307.14 360.45 L 306.15 360.41 L 305.91 360.16 L 305.61 358.79 L 304.02 357.75 L 301.58 357.68 L 300.15 358.29 L 299.66 359.14 L 298.4 359.94 L 293.88 360.57 L 292.64 360 L 291.38 358.89 L 288.35 357.73 L 287.57 356.71 L 287.3 355.85 L 286.65 355.5 L 284.03 355.03 L 281.24 353.78 L 280.48 352.63 L 279.21 352.43 L 277.19 352.92 L 275.84 354.17 L 274.18 354.68 L 273.41 354.34 L 271.85 354.56 L 269.26 354.53 L 267.86 355.98 L 267.77 357.15 L 265.75 360.1 L 263.7 362.1 L 258.08 364.07 L 255.93 362.55 L 254.91 361.45 L 254.21 361.25 L 254.21 361.25 L 253.55 360.58 L 253.23 359.78 L 253.77 359.07 L 251.33 356.92 L 250.05 357.55 L 249.53 357.5 L 248.36 356.82 L 247.91 356.12 L 245.89 354.71 L 244 353.95 L 243.7 353.63 L 243.4 352.51 L 243.17 349.58 L 242.56 347.81 L 242.37 344.15 L 243.25 342.51 L 244.39 341.42 L 244.73 339.64 L 244.68 337.75 L 243.72 337.81 L 243.32 338.41 L 242.94 338.57 L 216.08 337.49 L 215.03 324.84 L 209.66 318.71 L 214.54 318.65 L 214.19 311.1 L 211.55 305.78 L 211.06 303.81 L 211.32 302.75 L 211.93 302.2 L 212.58 300.92 L 211.14 297.99 L 208.03 296.95 z"},{code:"PA",name:"Pará",gTransform:"matrix(1 0 0 1 29.16 -180.48)",pathTransform:"translate(-335.15, -138.78)",d:"M 371.03 235.24 L 308.05999999999995 231.76000000000002 L 274.0199999999999 229.34000000000003 L 270.3299999999999 227.85000000000002 L 268.9599999999999 228.3 L 268.6099999999999 227.99 L 268.4099999999999 226.9 L 267.8599999999999 226.18 L 266.2299999999999 225.73000000000002 L 265.4099999999999 225.9 L 264.4599999999999 225.51000000000002 L 264.2299999999999 225.01000000000002 L 264.2699999999999 223.91000000000003 L 264.0399999999999 222.97000000000003 L 260.6599999999999 221.27000000000004 L 257.6599999999999 218.51000000000005 L 256.1199999999999 217.40000000000003 L 255.3999999999999 215.20000000000005 L 254.9199999999999 212.81000000000006 L 255.1499999999999 210.37000000000006 L 254.37999999999988 208.74000000000007 L 253.04999999999987 206.81000000000006 L 251.67999999999986 202.86000000000007 L 251.28999999999988 201.10000000000008 L 248.8399999999999 197.04000000000008 L 247.65999999999988 195.96000000000006 L 247.65999999999988 195.96000000000006 L 247.0899999999999 195.40000000000006 L 246.93999999999988 193.44000000000005 L 246.2999999999999 192.18000000000006 L 244.7099999999999 190.62000000000006 L 243.6399999999999 190.04000000000005 L 243.2699999999999 189.47000000000006 L 242.43999999999988 187.13000000000005 L 242.46999999999989 186.00000000000006 L 243.0499999999999 185.03000000000006 L 244.4999999999999 183.90000000000006 L 245.2799999999999 182.59000000000006 L 275.1799999999999 118.35000000000007 L 273.3699999999999 116.68000000000006 L 273.4999999999999 115.90000000000006 L 273.3099999999999 115.42000000000006 L 271.9199999999999 115.77000000000005 L 271.0699999999999 116.38000000000005 L 269.1999999999999 115.60000000000005 L 268.09999999999985 113.43000000000005 L 265.40999999999985 111.98000000000005 L 264.1399999999999 110.64000000000004 L 264.0599999999999 110.04000000000005 L 262.7399999999999 109.22000000000006 L 261.3699999999999 109.07000000000005 L 259.1199999999999 108.42000000000004 L 256.7399999999999 107.11000000000004 L 254.8599999999999 106.44000000000004 L 253.5099999999999 105.35000000000004 L 252.8799999999999 104.45000000000003 L 248.2999999999999 101.91000000000003 L 243.6599999999999 98.14000000000003 L 243.3599999999999 97.70000000000003 L 243.3199999999999 96.77000000000002 L 242.7699999999999 94.94000000000003 L 240.9299999999999 93.71000000000002 L 240.2299999999999 93.90000000000002 L 239.8699999999999 93.70000000000002 L 238.03999999999988 91.72000000000001 L 238.0899999999999 89.61000000000001 L 238.43999999999988 88.92000000000002 L 238.25999999999988 88.51000000000002 L 236.56999999999988 87.66000000000003 L 236.32999999999987 86.98000000000002 L 236.14999999999986 84.71000000000002 L 236.57999999999987 83.26000000000002 L 236.17999999999986 78.40000000000002 L 236.17999999999986 78.40000000000002 L 234.58999999999986 61.43000000000002 L 234.58999999999986 61.43000000000002 L 235.33999999999986 61.75000000000002 L 235.76999999999987 62.33000000000002 L 235.74999999999986 62.81000000000002 L 236.19999999999985 63.210000000000015 L 237.11999999999983 63.490000000000016 L 238.48999999999984 62.780000000000015 L 238.95999999999984 61.97000000000001 L 241.66999999999985 62.20000000000001 L 242.47999999999985 61.15000000000001 L 241.93999999999986 59.34000000000001 L 243.72999999999985 58.98000000000001 L 245.13999999999984 57.35000000000001 L 247.77999999999983 58.36000000000001 L 249.65999999999983 58.39000000000001 L 250.19999999999982 56.870000000000005 L 253.52999999999983 55.25000000000001 L 255.49999999999983 55.64000000000001 L 256.65999999999985 55.53000000000001 L 257.14999999999986 55.28000000000001 L 258.34999999999985 53.80000000000001 L 258.74999999999983 52.40000000000001 L 260.2099999999998 51.30000000000001 L 261.0699999999998 51.19000000000001 L 261.7199999999998 51.65000000000001 L 263.8299999999998 50.52000000000001 L 264.23999999999984 50.63000000000001 L 264.60999999999984 51.62000000000001 L 265.33999999999986 52.070000000000014 L 267.36999999999983 52.55000000000001 L 268.97999999999985 52.80000000000001 L 269.53999999999985 52.20000000000001 L 271.20999999999987 51.81000000000001 L 271.98999999999984 52.09000000000001 L 272.80999999999983 52.08000000000001 L 273.66999999999985 51.74000000000001 L 275.90999999999985 52.040000000000006 L 280.57999999999987 53.42000000000001 L 281.53999999999985 53.28000000000001 L 282.53999999999985 52.41000000000001 L 282.5099999999999 50.13000000000001 L 280.4399999999999 47.63000000000001 L 279.1999999999999 47.00000000000001 L 279.6899999999999 45.32000000000001 L 280.9999999999999 43.870000000000005 L 281.27999999999986 42.760000000000005 L 281.58999999999986 42.59 L 282.29999999999984 42.78 L 283.1299999999998 43.54 L 285.47999999999985 44.65 L 297.09999999999985 42.32 L 298.66999999999985 44.01 L 299.6899999999998 44.07 L 300.1299999999998 43.78 L 300.1299999999998 43.78 L 300.74999999999983 44.35 L 301.11999999999983 46.65 L 300.49999999999983 47.949999999999996 L 300.24999999999983 52.489999999999995 L 300.48999999999984 53.92999999999999 L 300.79999999999984 54.46999999999999 L 301.96999999999986 54.489999999999995 L 303.04999999999984 54.199999999999996 L 306.4399999999998 54.56999999999999 L 307.72999999999985 55.059999999999995 L 309.65999999999985 56.10999999999999 L 310.32999999999987 56.90999999999999 L 310.8199999999999 58.18999999999999 L 312.0099999999999 58.30999999999999 L 313.14999999999986 59.14999999999999 L 313.9499999999999 60.12999999999999 L 314.78999999999985 60.39999999999999 L 316.11999999999983 60.25999999999999 L 316.49999999999983 59.83999999999999 L 317.4399999999998 59.69999999999999 L 320.2799999999998 62.359999999999985 L 320.9599999999998 62.329999999999984 L 321.4499999999998 63.509999999999984 L 320.7699999999998 63.73999999999998 L 320.5799999999998 64.45999999999998 L 321.3399999999998 67.28999999999998 L 323.3599999999998 69.54999999999998 L 325.9299999999998 70.27999999999999 L 326.0999999999998 70.60999999999999 L 325.6699999999998 73.74999999999999 L 325.8599999999998 75.85999999999999 L 326.5299999999998 77.36999999999999 L 327.1499999999998 77.92999999999999 L 327.7399999999998 79.74 L 327.6099999999998 81.32 L 329.1099999999998 84.8 L 329.9299999999998 84.99 L 330.70999999999975 84.63 L 333.63999999999976 87.91 L 333.5599999999998 90.34 L 333.9699999999998 91.28 L 334.9199999999998 91.47 L 335.2499999999998 91.94 L 335.5599999999998 93.52 L 335.3499999999998 94.21 L 335.4599999999998 95.50999999999999 L 337.3299999999998 96.89999999999999 L 337.7599999999998 98.39999999999999 L 339.2099999999998 99.42999999999999 L 341.99999999999983 100.11 L 343.29999999999984 99.99 L 344.0699999999998 99.64999999999999 L 345.0099999999998 99.71 L 345.0099999999998 99.71 L 344.47999999999985 100.44999999999999 L 344.76999999999987 102.03999999999999 L 344.59999999999985 102.57 L 343.30999999999983 103.67999999999999 L 341.91999999999985 103.85 L 341.41999999999985 103.66999999999999 L 340.57999999999987 102.87999999999998 L 339.91999999999985 102.72999999999998 L 336.53999999999985 104.30999999999997 L 336.16999999999985 104.84999999999998 L 334.5699999999998 105.56999999999998 L 333.9399999999998 105.54999999999998 L 332.3899999999998 106.13999999999999 L 332.42999999999984 106.71999999999998 L 338.8899999999998 105.65999999999998 L 339.7699999999998 106.31999999999998 L 339.8999999999998 106.77999999999997 L 339.8999999999998 107.43999999999997 L 339.2799999999998 107.93999999999997 L 339.5799999999998 108.29999999999997 L 340.2099999999998 108.09999999999997 L 341.0699999999998 107.09999999999997 L 342.0899999999998 107.08999999999996 L 342.6199999999998 106.81999999999996 L 343.2199999999998 106.93999999999997 L 344.2899999999998 106.51999999999997 L 345.4299999999998 105.94999999999997 L 348.70999999999975 103.60999999999997 L 350.20999999999975 103.25999999999998 L 352.0499999999997 102.44999999999997 L 355.20999999999975 100.60999999999997 L 355.7499999999998 99.60999999999997 L 356.4199999999998 99.08999999999997 L 358.50999999999976 98.07999999999997 L 359.1699999999998 97.35999999999997 L 358.9199999999998 96.68999999999997 L 359.12999999999977 96.27999999999997 L 360.25999999999976 95.99999999999997 L 361.34999999999974 96.05999999999997 L 361.75999999999976 96.26999999999997 L 362.13999999999976 100.06999999999996 L 361.6199999999998 102.64999999999996 L 361.94999999999976 104.26999999999997 L 362.75999999999976 105.86999999999996 L 364.06999999999977 107.21999999999996 L 364.3699999999998 108.85999999999996 L 364.2499999999998 109.32999999999996 L 362.4099999999998 111.16999999999996 L 361.93999999999977 111.29999999999995 L 361.06999999999977 110.77999999999996 L 359.2499999999998 110.25999999999996 L 357.9899999999998 109.94999999999996 L 357.0599999999998 110.08999999999996 L 354.9299999999998 109.04999999999995 L 354.6699999999998 107.92999999999995 L 353.7899999999998 107.39999999999995 L 351.5099999999998 111.21999999999994 L 350.8999999999998 113.58999999999995 L 351.5799999999998 116.55999999999995 L 352.05999999999983 117.19999999999995 L 352.97999999999985 117.81999999999995 L 351.96999999999986 116.67999999999995 L 351.53999999999985 113.98999999999995 L 351.65999999999985 113.46999999999996 L 354.22999999999985 109.24999999999996 L 356.53999999999985 110.42999999999996 L 356.64999999999986 110.87999999999997 L 359.17999999999984 113.32999999999997 L 358.92999999999984 115.34999999999997 L 358.1899999999998 115.89999999999996 L 358.5899999999998 118.22999999999996 L 359.1099999999998 119.35999999999996 L 360.2299999999998 120.10999999999996 L 360.9699999999998 120.25999999999996 L 361.4899999999998 120.74999999999996 L 361.1499999999998 120.10999999999996 L 360.3799999999998 119.86999999999996 L 359.17999999999984 118.82999999999996 L 358.9599999999998 118.14999999999995 L 359.2999999999998 113.94999999999995 L 360.1199999999998 112.75999999999995 L 361.5499999999998 113.48999999999995 L 362.37999999999977 114.68999999999996 L 362.2899999999998 115.47999999999996 L 363.4899999999998 116.33999999999996 L 363.7399999999998 116.04999999999995 L 362.7399999999998 114.78999999999995 L 361.81999999999977 112.68999999999996 L 361.81999999999977 112.24999999999996 L 364.07999999999976 109.92999999999996 L 365.69999999999976 110.01999999999997 L 367.62999999999977 110.65999999999997 L 367.96999999999974 111.21999999999997 L 367.35999999999973 111.80999999999997 L 367.6799999999997 112.08999999999997 L 368.15999999999974 112.11999999999998 L 369.1899999999997 111.94999999999997 L 370.5199999999997 111.04999999999997 L 374.6099999999997 110.08999999999997 L 375.37999999999965 110.28999999999998 L 377.11999999999966 111.34999999999998 L 380.2899999999997 110.92999999999998 L 381.3599999999997 110.51999999999998 L 382.37999999999965 109.50999999999998 L 383.3599999999997 108.91999999999997 L 385.0999999999997 108.40999999999997 L 385.86999999999966 108.47999999999996 L 385.92999999999967 109.22999999999996 L 383.88999999999965 113.24999999999996 L 383.64999999999964 114.74999999999996 L 383.18999999999966 115.81999999999995 L 382.3599999999997 116.84999999999995 L 382.3499999999997 117.72999999999995 L 382.92999999999967 119.14999999999995 L 382.6099999999997 121.61999999999995 L 383.48999999999967 120.42999999999995 L 383.49999999999966 119.02999999999994 L 385.0399999999997 116.02999999999994 L 386.1699999999997 112.83999999999995 L 387.2899999999997 111.27999999999994 L 387.55999999999966 111.00999999999995 L 388.31999999999965 110.95999999999995 L 388.89999999999964 110.60999999999996 L 390.71999999999963 110.37999999999995 L 391.5999999999996 109.02999999999996 L 393.1099999999996 107.33999999999996 L 394.46999999999963 105.07999999999996 L 394.9899999999996 104.61999999999996 L 395.77999999999963 105.10999999999996 L 396.39999999999964 104.64999999999996 L 398.01999999999964 106.98999999999997 L 399.20999999999964 107.57999999999997 L 399.1599999999996 106.83999999999997 L 398.8099999999996 106.08999999999997 L 399.4299999999996 105.07999999999997 L 402.9399999999996 104.56999999999996 L 401.9099999999996 104.24999999999997 L 398.39999999999964 104.70999999999997 L 398.08999999999963 104.49999999999997 L 398.37999999999965 102.06999999999996 L 398.88999999999965 101.77999999999996 L 399.55999999999966 102.15999999999995 L 400.57999999999964 102.26999999999995 L 401.64999999999964 99.16999999999996 L 400.96999999999963 97.77999999999996 L 400.9999999999996 97.09999999999995 L 402.1699999999996 95.28999999999995 L 405.0099999999996 92.80999999999995 L 405.3699999999996 92.72999999999995 L 406.4799999999996 93.86999999999995 L 409.4099999999996 91.77999999999994 L 409.8699999999996 91.70999999999995 L 410.2699999999996 92.15999999999995 L 410.3699999999996 92.72999999999995 L 410.0499999999996 93.39999999999995 L 411.1199999999996 93.23999999999995 L 411.9299999999996 92.65999999999995 L 412.2899999999996 91.87999999999995 L 412.9199999999996 91.68999999999996 L 413.1999999999996 91.83999999999996 L 413.9399999999996 93.22999999999996 L 415.2699999999996 94.42999999999996 L 415.4699999999996 93.86999999999996 L 415.35999999999956 93.48999999999997 L 414.4 93 L 414.26 92.71 L 414.13 91.50999999999999 L 414.3 91.08999999999999 L 414.74 90.89999999999999 L 417.02 91.16 L 418.2 91.81 L 418.82 92.83 L 420.45 93.53999999999999 L 422.09999999999997 92.75999999999999 L 422.62999999999994 94.89999999999999 L 422.12999999999994 95.21 L 422.09999999999997 95.8 L 423.02 95.28 L 424.18 92.93 L 424.56 93.16000000000001 L 424.33 94.49000000000001 L 424.74 94.93 L 427.25 94.67 L 427.7 95.32000000000001 L 428.15999999999997 97.00000000000001 L 427.55999999999995 97.95000000000002 L 428.40999999999997 97.45000000000002 L 428.66999999999996 97.82000000000002 L 430.55999999999995 97.96000000000002 L 434.0899999999999 96.72000000000003 L 433.7799999999999 98.30000000000003 L 433.0299999999999 100.13000000000002 L 434.49999999999994 99.64000000000003 L 435.0899999999999 99.02000000000002 L 435.7199999999999 100.64000000000003 L 435.7199999999999 100.64000000000003 L 434.94999999999993 101.09000000000003 L 434.4799999999999 102.12000000000003 L 434.63999999999993 103.50000000000003 L 433.92999999999995 107.89000000000003 L 433.35999999999996 108.63000000000002 L 432.21999999999997 108.78000000000003 L 432.16999999999996 109.40000000000003 L 432.43999999999994 109.89000000000003 L 433.42999999999995 109.73000000000003 L 433.85999999999996 110.26000000000003 L 433.78 111.87000000000003 L 432.88 114.89000000000003 L 432.52 115.60000000000002 L 430.78 117.17000000000002 L 430.28 119.55000000000001 L 430.40999999999997 121.19000000000001 L 426.72999999999996 124.28000000000002 L 427.77 125.86000000000001 L 426.97999999999996 126.67000000000002 L 427.15999999999997 128.49 L 426.7 129.77 L 425.87 131.22 L 424.39 132.98 L 422.43 134.51999999999998 L 420.83 139.20999999999998 L 420.53999999999996 141.10999999999999 L 420.06999999999994 142.32 L 417.62999999999994 144.64 L 416.50999999999993 145.1 L 415.88999999999993 147.98 L 414.3399999999999 149.14999999999998 L 413.9099999999999 150.29999999999998 L 412.3599999999999 152.46999999999997 L 411.1899999999999 153.38999999999996 L 408.83999999999986 153.15999999999997 L 394.1299999999999 164.98999999999998 L 394.6199999999999 165.07 L 394.6199999999999 165.07 L 396.9099999999999 165.88 L 398.7799999999999 165.64 L 400.06999999999994 165.76 L 401.0899999999999 167.42 L 401.4799999999999 167.73 L 402.3499999999999 167.86999999999998 L 403.6099999999999 169.03999999999996 L 403.5699999999999 169.66999999999996 L 403.1999999999999 170.33999999999995 L 402.47999999999985 170.70999999999995 L 401.5099999999998 170.77999999999994 L 401.2199999999998 171.05999999999995 L 401.3099999999998 172.46999999999994 L 402.31999999999977 173.80999999999995 L 401.39999999999975 176.55999999999995 L 400.75999999999976 177.03999999999994 L 399.2999999999998 177.49999999999994 L 399.0499999999998 177.95999999999995 L 399.3399999999998 179.15999999999994 L 399.1499999999998 180.49999999999994 L 397.8499999999998 180.64999999999995 L 396.3399999999998 181.98999999999995 L 395.4899999999998 183.25999999999996 L 395.63999999999976 184.76999999999995 L 395.39999999999975 185.26999999999995 L 392.89999999999975 186.46999999999994 L 389.4899999999997 187.60999999999993 L 387.0199999999997 189.38999999999993 L 386.8299999999997 189.73999999999992 L 387.2599999999997 191.92999999999992 L 387.3199999999997 194.5999999999999 L 386.03999999999974 196.6999999999999 L 384.6299999999997 198.3799999999999 L 384.47999999999973 198.9499999999999 L 384.64999999999975 199.8299999999999 L 385.2399999999997 200.7899999999999 L 386.90999999999974 202.52999999999992 L 387.65999999999974 202.8499999999999 L 387.8099999999997 203.14999999999992 L 387.1499999999997 207.1899999999999 L 385.3899999999997 212.33999999999992 L 384.3099999999997 213.14999999999992 L 382.60999999999973 216.38999999999993 L 382.4299999999997 217.37999999999994 L 381.4899999999997 218.91999999999993 L 380.7499999999997 219.76999999999992 L 379.6999999999997 219.92999999999992 L 378.3299999999997 220.8499999999999 L 377.2999999999997 222.7699999999999 L 376.08999999999975 224.4499999999999 L 374.90999999999974 225.5399999999999 L 373.75999999999976 227.11999999999992 L 372.62999999999977 231.57999999999993 L 371.03 235.24 z M 392.19 104.93 L 387.67 106.89 L 384.28000000000003 107.41 L 382.26000000000005 107.1 L 381.61000000000007 108.22999999999999 L 379.7700000000001 109.41999999999999 L 379.05000000000007 108.80999999999999 L 378.44000000000005 107.27999999999999 L 378.21000000000004 107.55999999999999 L 378.63000000000005 108.78999999999999 L 378.2900000000001 109.6 L 377.5800000000001 110.00999999999999 L 373.8100000000001 108.36999999999999 L 373.0100000000001 109.08999999999999 L 368.8200000000001 110.35 L 365.6200000000001 109.78 L 364.8100000000001 109.17 L 364.5700000000001 107.32000000000001 L 364.3400000000001 106.91000000000001 L 363.2300000000001 105.89000000000001 L 362.1700000000001 104.29000000000002 L 361.9600000000001 102.51000000000002 L 362.4800000000001 99.76000000000002 L 363.1000000000001 99.38000000000002 L 364.86000000000007 99.74000000000002 L 365.7900000000001 98.99000000000002 L 365.87000000000006 98.43000000000002 L 364.57000000000005 98.86000000000003 L 363.35 98.73000000000003 L 362.41 98.02000000000004 L 362.23 96.97000000000004 L 362.57 91.89000000000004 L 363.3 91.13000000000004 L 363.65000000000003 91.88000000000004 L 365.41 92.48000000000003 L 365.96000000000004 92.42000000000003 L 365.50000000000006 92.00000000000003 L 364.2300000000001 91.78000000000003 L 363.3300000000001 89.62000000000003 L 363.6900000000001 87.94000000000003 L 364.5800000000001 85.97000000000003 L 365.9100000000001 84.64000000000003 L 366.87000000000006 84.07000000000004 L 368.21000000000004 83.58000000000004 L 369.53000000000003 83.45000000000005 L 372.99 83.97000000000004 L 380.2 85.74000000000004 L 383.9 85.28000000000004 L 384.01 84.98000000000005 L 385.15 84.36000000000004 L 387.31 83.99000000000004 L 390.2 84.28000000000004 L 393 85.10000000000004 L 399.48 85.95000000000003 L 400.11 86.42000000000003 L 400.06 87.65000000000003 L 399.36 88.39000000000003 L 398.68 89.89000000000003 L 398.32 92.54000000000003 L 397.46 95.84000000000003 L 396.16999999999996 96.52000000000004 L 395.81999999999994 97.21000000000004 L 396.04999999999995 98.40000000000003 L 394.06999999999994 100.98000000000003 L 392.67999999999995 104.48000000000003 L 392.19 104.93 z M 344.98 104.76 L 344.23 104.25 L 345.33000000000004 102 L 345.24000000000007 100.21 L 345.49000000000007 100 L 347.82000000000005 99.52 L 348.72 98.66 L 348.87 98.16 L 348.67 95.82 L 349.53000000000003 93.24 L 350.79 91.75 L 353.08000000000004 90.28 L 355.95000000000005 90.08 L 356.6700000000001 92.44 L 355.57000000000005 94.63 L 354.72 97.67 L 353.62 98.34 L 352.28000000000003 100.37 L 351.50000000000006 101.09 L 346.56000000000006 104.4 L 344.98 104.76 z M 373.46 81.86 L 372.43 81.61 L 369.98 81.69 L 369.19 81.53 L 368.9 81.27 L 368.52 80.17999999999999 L 368.53 78.94 L 370.03999999999996 78.52 L 371.92999999999995 78.56 L 374.11999999999995 77.27 L 378.92999999999995 76.67 L 379.69999999999993 76.93 L 380.37999999999994 77.61000000000001 L 380.19999999999993 78.63000000000001 L 377.63999999999993 80.02000000000001 L 375.85999999999996 82.50000000000001 L 374.76 83 L 373.46 81.86 z M 378.25 81.86 L 380.11 80.66 L 382.09000000000003 80.69 L 383.74 81.31 L 384.27 82.3 L 384.32 82.92 L 383.44 83.69 L 380.59 83.97 L 379.41999999999996 84.28999999999999 L 377.15999999999997 83.39999999999999 L 376.96 82.86999999999999 L 378.25 81.86 z M 361.27 86.25 L 360.77 85.99 L 360.15999999999997 86.03 L 358.61999999999995 85.34 L 358.8299999999999 84.18 L 359.4699999999999 83.26 L 361.38999999999993 82.86 L 363.74999999999994 81.96 L 365.06999999999994 82.03999999999999 L 365.86999999999995 82.72 L 365.9599999999999 82.85 L 364.0299999999999 84.46 L 362.9599999999999 84.8 L 361.27 86.25 z M 370.69 76.56 L 369.87 76.26 L 369.7 74.60000000000001 L 369.84999999999997 74.00000000000001 L 371.02 72.69000000000001 L 373.46999999999997 71.77000000000001 L 373.71999999999997 71.89000000000001 L 374.24999999999994 72.57000000000002 L 374.28999999999996 73.46000000000002 L 372.34 75.45000000000002 L 370.69 76.56 z M 356.86 96.78 L 356.72 96.37 L 356.91 95.44 L 357.95000000000005 92.63 L 360.54 90.94 L 361.26000000000005 90.66 L 361.95000000000005 90.8 L 361.79 92.59 L 360.23 93.03 L 358.61 95.22 L 356.86 96.78 z M 367.77 79.21 L 366.58 78.89999999999999 L 366.28 78.41999999999999 L 367.15999999999997 77.46 L 367.86999999999995 73.50999999999999 L 368.75999999999993 72.27999999999999 L 369.04999999999995 72.40999999999998 L 369.11999999999995 72.72999999999998 L 369.09999999999997 75.20999999999998 L 369.7 77.07999999999998 L 369.38 77.95999999999998 L 368.35 78.35999999999999 L 367.77 79.21 z M 352.96 89.4 L 352.69 89.21000000000001 L 352.81 88.60000000000001 L 353.36 88.24000000000001 L 354.55 86.53000000000002 L 355.31 84.99000000000001 L 356.04 84.33000000000001 L 357.49 83.79 L 357.29 85.28 L 356.89000000000004 86.28 L 355.17 87.94 L 352.96 89.4 z M 366.83 82.37 L 366.22999999999996 82.22 L 365.39 81.51 L 364.43 79.87 L 364.38 79.49000000000001 L 364.61 79.2 L 365.42 78.62 L 367.27000000000004 79.46000000000001 L 367.56000000000006 79.89000000000001 L 367.80000000000007 81.98000000000002 L 366.83 82.37 z M 361.45 112.93 L 360.8 112.82000000000001 L 359.92 112.30000000000001 L 359.23 112.76 L 358.48 112.48 L 356.8 110.74000000000001 L 356.8 110.13000000000001 L 358.08 110.12 L 361.14 111.44 L 361.45 112.93 z M 340.3 107.39 L 340.34000000000003 106.36 L 340.14000000000004 106.06 L 340.74000000000007 105.07000000000001 L 343.1000000000001 104.19000000000001 L 343.88000000000005 104.57000000000001 L 344.75000000000006 105.43 L 344.46000000000004 105.78 L 343.43000000000006 106.25 L 340.89000000000004 106.66 L 340.3 107.39 z M 353 100.7 L 352.82 100.67 L 352.83 100.32000000000001 L 353.37 99.38000000000001 L 355.16 97.76 L 355.58000000000004 96.52000000000001 L 355.63000000000005 95.22000000000001 L 355.87000000000006 94.92000000000002 L 356.19000000000005 95.36000000000001 L 356.19000000000005 96.87000000000002 L 355.30000000000007 99.60000000000002 L 354.68000000000006 100.25000000000003 L 353 100.7 z M 359.3 90.8 L 360.95 87.84 L 361.83 87.63000000000001 L 362.53999999999996 87.82000000000001 L 362.80999999999995 88.69000000000001 L 362.22999999999996 89.4 L 359.3 90.8 z M 390.72 109.77 L 389.88000000000005 109.42 L 389.5400000000001 108.36 L 390.5800000000001 106.64 L 391.6500000000001 106.31 L 391.8400000000001 106.41 L 391.8200000000001 107.14999999999999 L 391.0800000000001 109.38999999999999 L 390.72 109.77 z M 357.24 90.3 L 356.7 90.1 L 357.02 88.05999999999999 L 358.34999999999997 86.24999999999999 L 358.58 86.28999999999999 L 359.87 87.16999999999999 L 359.86 87.41999999999999 L 358.31 88.05999999999999 L 357.24 90.3 z M 359.47 95.33 L 360.19000000000005 95.36 L 359.7900000000001 95.81 L 358.8500000000001 96.12 L 358.74000000000007 97.24000000000001 L 357.95000000000005 97.95 L 356.26000000000005 98.79 L 356.1 98.61 L 356.37 97.78 L 356.84000000000003 97.15 L 358.57000000000005 95.48 L 359.47 95.33 z M 336.91 105.54 L 336.36 105.35000000000001 L 336.29 105.00000000000001 L 336.72 104.60000000000001 L 340.28000000000003 103.00000000000001 L 340.82000000000005 103.70000000000002 L 340.81000000000006 103.90000000000002 L 339.4100000000001 104.63000000000002 L 336.91 105.54 z M 400.44 100.76 L 399.41 100.57000000000001 L 398.59000000000003 99.78 L 399.46000000000004 98.53 L 400.8 98.52 L 400.99 99.71 L 400.89 100.3 L 400.44 100.76 z M 363.19 81.86 L 360.83 82.56 L 360.24 82.57000000000001 L 360.06 82.36000000000001 L 361.09 81.32000000000001 L 362.13 80.81 L 363.17 80.98 L 363.61 81.32000000000001 L 363.76 81.55000000000001 L 363.61 81.76 L 363.19 81.86 z M 357.92 90.45 L 357.84000000000003 89.69 L 358.09000000000003 89.19 L 360.57000000000005 87.73 L 359.6700000000001 89.73 L 358.86000000000007 90.36 L 357.92 90.45 z M 360.06 94.98 L 359.61 94.86 L 359.54 94.63 L 360.32 93.13 L 361.51 93.14999999999999 L 361.39 94.49999999999999 L 360.06 94.98 z M 388.1 110.81 L 387.82000000000005 110.58 L 388.72 108.98 L 389.40000000000003 108.58 L 389.63000000000005 109.33 L 390.14000000000004 109.7 L 389.88000000000005 110.22 L 389.45000000000005 110.56 L 388.82000000000005 110.38 L 388.1 110.81 z M 361.44 87.49 L 360.55 87.42 L 360.57 87.23 L 362.93 85.39 L 362.97 86.35 L 362.74 86.97999999999999 L 362.49 87.32 L 361.44 87.49 z M 428.9 97.71 L 428.52 97.17999999999999 L 428.71 96.41999999999999 L 429.72999999999996 95.50999999999999 L 429.97999999999996 95.66 L 430.21 97.41 L 428.9 97.71 z"},{code:"PB",name:"Paraíba",gTransform:"matrix(1 0 0 1 275.13 -126.21)",pathTransform:"translate(-581.13, -193.05)",d:"M 610.43 199.15 L 607.93 197.09 L 607.11 196.83 L 604.46 196.62 L 602.15 197.69 L 600.67 198.97 L 600.22 200.77 L 598.32 201.8 L 596.31 202.25 L 595.17 202.23 L 595.17 202.83 L 594.37 203.36 L 592.19 203.65 L 588.31 203.39 L 586.7 204.27 L 586.15 204.91 L 584.33 205.01 L 583.44 205.7 L 582.9 206.46 L 583.29 207.19 L 583.3 207.73 L 582.9 208.21 L 581.12 209.74 L 579.78 209.9 L 578.13 210.74 L 576.53 209.95 L 575.58 209.01 L 575.23 206.77 L 575.47 206.28 L 575.29 205.98 L 574.15 205.66 L 573.71 205.95 L 572.2 206.2 L 572.24 205.75 L 574.77 203.11 L 574.94 202.68 L 574.22 200.81 L 574.18 200.34 L 574.55 199.56 L 577.55 198.49 L 577.66 198.19 L 577.16 196.8 L 573.66 194.88 L 572.18 195.29 L 569.96 196.55 L 569.03 198.06 L 567.55 198.93 L 566.5 199.24 L 563.8 201.12 L 562.28 202.76 L 560.65 202.99 L 558.02 203.96 L 557.25 203.63 L 557.3 202.95 L 556.67 201.71 L 556.29 201.63 L 555.36 202.36 L 553.85 202.68 L 552.86 202.35 L 551.46 200.44 L 551.06 200.35 L 551.06 200.35 L 550.89 200.1 L 552.08 198.98 L 553.69 195.49 L 553.35 194.3 L 552.66 194.22 L 551.42 193.33 L 551.44 191.67 L 551.09 190.95 L 550.51 190.66 L 550.27 190.25 L 550.39 189.32 L 550.56 188.94 L 551.65 188.31 L 552.31 187 L 551.79 185.69 L 552.82 182.69 L 553.66 181.54 L 553.74 181 L 553.74 181 L 554.31 180.54 L 556.24 182.18 L 557.14 182.6 L 560.02 183.21 L 561.18 182.08 L 564.41 180.42 L 565.23 179.71 L 565.33 178.67 L 565.74 177.72 L 568.92 176.51 L 570.35 176.39 L 573.61 175.35 L 574.25 175.43 L 574.78 175.87 L 574.79 177.06 L 571.8 180.27 L 571.36 181.23 L 570.98 182.97 L 570.57 183.35 L 569.72 183.6 L 569.51 183.91 L 569.43 185.63 L 572.96 186.15 L 573.28 186.38 L 573.59 187.76 L 573.88 187.99 L 577.03 186.73 L 578.8 186.65 L 580.75 186.95 L 581.64 188.12 L 581.12 189.66 L 581.95 190.4 L 584.3 189.47 L 584.8 188.73 L 585.35 187.52 L 584.88 186.58 L 584.72 185.16 L 585.2 184.57 L 586.21 184.89 L 585.68 183.36 L 584.96 182.58 L 585.27 181.1 L 587.09 179.75 L 588.47 179.7 L 588.89 180.09 L 588.79 181.09 L 589.41 181.58 L 592.83 181.98 L 593.36 182.33 L 599.19 181.94 L 601.36 182.24 L 603.82 183.34 L 604.86 182.94 L 608.36 183.15 L 609.29 182.91 L 609.29 182.91 L 609.38 185.31 L 610.83 189.7 L 610.89 190.34 L 610.71 191.28 L 610.34 191.73 L 610.31 192.61 L 610.89 191.87 L 611.4 190.37 L 611.41 192.35 L 612 193.36 L 611.73 198.54 L 611.37 199.14 z"},{code:"PE",name:"Pernambuco",gTransform:"matrix(1 0 0 1 254.6 -106.99)",pathTransform:"translate(-560.6, -212.26)",d:"M 558.28 227.19 L 557.06 224.15 L 557.05 223.21 L 554.94 222.35 L 554.44 221.98 L 553.99 221.15 L 554.6 220.26 L 554.58 219.64 L 554.13 219.32 L 553.13 219.33 L 552.7 219.77 L 552.41 221.51 L 551.98 221.66 L 551.59 221.4 L 551.05 219.75 L 549.47 218.6 L 546.48 218.2 L 544.12 217.43 L 542.77 216.62 L 541.94 215.18 L 540.45 214.62 L 539.86 214.73 L 537.33 216.19 L 535.68 216.63 L 534.91 218.68 L 532.68 219.13 L 532.39 219.38 L 532.64 220.74 L 532.47 221.33 L 531.37 222.57 L 528.98 223.6 L 528.34 223.54 L 527.57 223.01 L 526.81 223.18 L 526.31 224.05 L 525.54 227.62 L 522.67 228.5 L 521.85 229.42 L 520.89 229.65 L 519.05 229.03 L 519.97 227.35 L 519.71 225.35 L 517.5 224.44 L 516.78 222.5 L 516.84 219.77 L 516.4 219.26 L 513.59 217.88 L 511.39 217.59 L 510.23 217.85 L 509.33 217.45 L 509.33 217.45 L 511.95 216.18 L 513.92 214.47 L 514.46 213.6 L 516.75 212.27 L 517.72 211.99 L 521.61 208.12 L 522.35 206.36 L 522.41 204.09 L 522.12 203.55 L 520.5 201.97 L 520.57 199.78 L 519.97 198.65 L 519.91 197.7 L 520.02 197.25 L 520.54 196.92 L 522.33 196.76 L 522.33 196.76 L 527.26 196.96 L 528.15 197.2 L 529.78 197.01 L 531.92 196.21 L 533.21 196.11 L 536.29 196.53 L 539.14 198.43 L 540.97 199.26 L 541.43 200.25 L 542.44 201.32 L 543.8 201.8 L 544.58 202.37 L 545.21 204.01 L 546.86 203.96 L 548.4 201.67 L 549.47 200.84 L 551.06 200.35 L 551.06 200.35 L 551.46 200.44 L 552.86 202.35 L 553.85 202.68 L 555.36 202.36 L 556.29 201.63 L 556.67 201.71 L 557.3 202.95 L 557.25 203.63 L 558.02 203.96 L 560.65 202.99 L 562.28 202.76 L 563.8 201.12 L 566.5 199.24 L 567.55 198.93 L 569.03 198.06 L 569.96 196.55 L 572.18 195.29 L 573.66 194.88 L 577.16 196.8 L 577.66 198.19 L 577.55 198.49 L 574.55 199.56 L 574.18 200.34 L 574.22 200.81 L 574.94 202.68 L 574.77 203.11 L 572.24 205.75 L 572.2 206.2 L 573.71 205.95 L 574.15 205.66 L 575.29 205.98 L 575.47 206.28 L 575.23 206.77 L 575.58 209.01 L 576.53 209.95 L 578.13 210.74 L 579.78 209.9 L 581.12 209.74 L 582.9 208.21 L 583.3 207.73 L 583.29 207.19 L 582.9 206.46 L 583.44 205.7 L 584.33 205.01 L 586.15 204.91 L 586.7 204.27 L 588.31 203.39 L 592.19 203.65 L 594.37 203.36 L 595.17 202.83 L 595.17 202.23 L 596.31 202.25 L 598.32 201.8 L 600.22 200.77 L 600.67 198.97 L 602.15 197.69 L 604.46 196.62 L 607.11 196.83 L 607.93 197.09 L 610.43 199.15 L 610.43 199.15 L 611.31 199.38 L 611.86 200.6 L 610.59 202.32 L 610.48 202.87 L 610.49 203.35 L 611.19 203.72 L 611.46 204.22 L 611.65 205.28 L 609.69 211.66 L 606.44 220.61 L 606.44 220.61 L 606.17 220.4 L 603.27 220.13 L 601.35 219.32 L 599.88 219.51 L 597.32 220.8 L 595.08 219.95 L 593.08 220.19 L 591.53 221.43 L 591.41 221.88 L 589.23 224.17 L 587.42 225.28 L 586.26 225.23 L 584.4 226.29 L 583.23 226.4 L 580.09 226.11 L 577.59 226.76 L 575.68 226.28 L 573.9 225.23 L 572 223.11 L 569.45 221.09 L 568.37 221.21 L 566.7 220.91 L 565.7 219.69 L 564.88 220.29 L 564.79 220.98 L 562.41 224.27 L 560.24 225.03 L 559.6 226.12 z"},{code:"PI",name:"Piauí",gTransform:"matrix(1 0 0 1 174.84 -130.97)",pathTransform:"translate(-480.85, -188.29)",d:"M 505.7 126.91 L 507.01 127.03 L 507.7 126.8 L 509.94 127.31 L 510.93 128.16 L 511.25 128.76 L 511.25 128.76 L 511.14 129.56 L 510.05 131.41 L 508.47 133.38 L 508.29 134.84 L 508.58 136.13 L 510.38 140.85 L 513.53 147.27 L 513.97 149 L 515.33 150.59 L 515.31 151.35 L 514.57 152.71 L 515.36 156.58 L 514.88 158.18 L 515.88 160.19 L 516.48 163.18 L 515.89 164.76 L 515.09 165.34 L 516.01 166.03 L 516.12 166.41 L 517.06 174.57 L 516.82 175.02 L 517.58 177.59 L 518.63 182.79 L 519.64 185.46 L 520.95 186.11 L 523.51 186.58 L 524.28 187.74 L 524.27 188.43 L 522.77 190.68 L 521.63 193.79 L 521.71 194.76 L 522.39 195.44 L 522.33 196.76 L 522.33 196.76 L 520.54 196.92 L 520.02 197.25 L 519.91 197.7 L 519.97 198.65 L 520.57 199.78 L 520.5 201.97 L 522.12 203.55 L 522.41 204.09 L 522.35 206.36 L 521.61 208.12 L 517.72 211.99 L 516.75 212.27 L 514.46 213.6 L 513.92 214.47 L 511.95 216.18 L 509.33 217.45 L 509.33 217.45 L 508.88 218.61 L 507.38 220.91 L 506.33 221.58 L 505.54 221.4 L 503.54 221.78 L 503.65 224.18 L 501.79 225.98 L 501.47 225.93 L 500.85 225.31 L 498.69 225.3 L 497.87 226.28 L 497.1 226.64 L 494.37 226.98 L 492.86 228.32 L 492.04 229.54 L 490.34 229.64 L 488.86 230.28 L 485.86 230.39 L 485.04 230.11 L 484.85 229.83 L 484.98 229.17 L 483.27 228.19 L 481.94 227.8 L 480.55 228.35 L 478.42 228.78 L 478.1 228.6 L 477.69 227.67 L 476.19 227.21 L 474.24 227.23 L 471 228.88 L 470.94 229.81 L 473.18 234.25 L 473.3 235.4 L 473.01 237.97 L 472.76 238.88 L 472.04 239.74 L 469.09 244.79 L 466.12 247.21 L 464.77 247.63 L 463.29 247.1 L 461.95 246.93 L 459.75 247.68 L 458.58 248.57 L 457.91 249.44 L 456.77 249.82 L 456.02 251.27 L 455.69 251.48 L 453.58 251.3 L 451.78 251.82 L 447.6 249.97 L 445.83 247.48 L 445.3 245.27 L 444.64 244.23 L 443.2 242.89 L 440.87 242.91 L 440.87 242.91 L 437.93 242.7 L 437.93 242.7 L 437.98 240.78 L 438.24 239.72 L 439.39 237.27 L 439.52 230.91 L 440.28 229.51 L 440.31 229 L 438.58 225.94 L 438.11 222.75 L 437.41 220.81 L 438.14 218.81 L 439.84 217.41 L 441.04 214.93 L 441.17 213.42 L 441.51 212.59 L 441.81 212.38 L 443.25 209.64 L 443.88 207.32 L 444.27 204.35 L 445.25 201.37 L 447.38 199.42 L 450.1 198.66 L 452.71 198.35 L 453.78 197.98 L 455.48 196.45 L 456.53 196.41 L 457.87 195.89 L 460.73 193.32 L 463.07 192.41 L 465.08 190.41 L 465.71 189.54 L 465.71 189.08 L 467.61 187.16 L 468.11 186.94 L 468.95 186.7 L 469.18 187 L 470.3 186.74 L 471.3 186.14 L 472.76 185.95 L 473.77 186.16 L 476.28 187.98 L 477.79 187.88 L 480.23 187.02 L 481.06 186.98 L 481.71 187.26 L 483.99 186.97 L 485.2 185.66 L 485.7 184.2 L 485.82 182.99 L 486.11 182.55 L 486.5 180.35 L 486.37 179.5 L 486.2 179 L 484.59 178.09 L 482.81 176.06 L 482.3 173.76 L 482.19 171.65 L 482.36 169.17 L 486.46 164.74 L 486.67 164.19 L 486.77 161.76 L 486.22 158.78 L 484.64 155.98 L 485.78 153.11 L 486.06 151.64 L 485.68 150.37 L 484.45 149.53 L 484.1 147.61 L 484.87 146.56 L 485.51 146.39 L 486.33 144.41 L 488.22 142.56 L 489.1 140.73 L 489.06 138.94 L 491.98 135.53 L 492.79 135.69 L 496.1 135.23 L 500.23 131.26 L 502.02 128.99 L 502.41 127.46 L 501.77 126.93 L 501.55 126.21 L 502.01 124.77 L 502.01 124.77 L 502.74 124.89 L 504.21 125.76 L 504.72 126.27 L 504.59 126.58 z"},{code:"PR",name:"Paraná",gTransform:"matrix(1 0 0 1 47.59 157)",pathTransform:"translate(-353.59, -476.27)",d:"M 396.75 499.4 L 391.51 499.37 L 391.18 499.81 L 389.44 500.05 L 388.68 499.98 L 388.57 499.59 L 387 500.16 L 385.65 501.59 L 382.3 503.72 L 380.86 503.56 L 379.63 502.94 L 376.5 500.34 L 375.47 499.95 L 374.71 499.94 L 371.87 500.67 L 369.54 500.84 L 368.73 500.81 L 367.31 500.05 L 366.2 500.19 L 364.67 500.84 L 364.08 502.31 L 363.35 503.18 L 361.48 504.16 L 357.91 503.75 L 355.91 504.9 L 355.19 505.67 L 354.5 507.26 L 355.35 510.25 L 354.48 511.11 L 353.56 511.13 L 352.81 511.51 L 352.64 512 L 351.31 510.11 L 347.06 510.24 L 343.3 509.81 L 341.72 508.63 L 341.56 508.22 L 340.53 507.59 L 336.27 507.23 L 330.98 505.55 L 328.64 506.12 L 325.95 506.09 L 323.93 504.68 L 323.61 504.17 L 322.55 503.93 L 322.02 503.92 L 321.31 504.29 L 317.68 504.27 L 317.68 504.27 L 317.46 503.06 L 314.93 498.88 L 314.95 496.29 L 313.96 493.41 L 310.54 491.04 L 309.45 492.17 L 307.33 492.06 L 306.23 492.49 L 305.16 493.39 L 303.7 492.31 L 302.88 492.37 L 302.6 490.17 L 303.26 488.6 L 304.33 487.33 L 305.55 485.15 L 305.61 484.81 L 305.12 484.06 L 305.14 482.82 L 306.04 479.18 L 307.3 476.16 L 307.05 473.86 L 308.33 471.48 L 308.12 470.46 L 307.28 469.58 L 306.97 467.98 L 307.63 466.92 L 308.42 466.38 L 308.42 466.38 L 310.8 464.82 L 311.16 464 L 312.73 456.08 L 313.06 455.73 L 314.17 455.41 L 315.83 454.4 L 316.5 453.72 L 317.95 450.16 L 317.93 449.01 L 318.86 446.68 L 319.97 445.86 L 325.38 443.59 L 325.38 443.59 L 328.64 441.3 L 332.47 441.95 L 336.48 441.84 L 339.75 442.13 L 340.96 441.51 L 341.31 440.91 L 342.04 440.54 L 343.21 440.83 L 344.69 441.61 L 347.21 442.07 L 349.85 443.16 L 351.16 443.29 L 352.23 442.75 L 354.81 442.74 L 355.59 443.74 L 357.34 444.58 L 360.85 445.38 L 361.48 445.89 L 362.19 447.21 L 363.92 447.28 L 364.34 446.94 L 365.99 447.09 L 366.65 447.63 L 371.96 447.76 L 374.93 446.91 L 376.06 448.46 L 379.65 451.29 L 380.54 453.05 L 380.55 455.79 L 380.16 456.37 L 380 457.18 L 380.38 459.02 L 381.68 460.53 L 381.6 462.29 L 381.24 462.85 L 382.73 465.85 L 383.94 467 L 384.61 467.28 L 385.11 467.96 L 385.06 468.85 L 385.98 470.82 L 386.58 471.11 L 386.83 471.55 L 386.58 472.6 L 385.31 474.73 L 385.63 476.77 L 386.23 477.15 L 387.24 477.36 L 389.62 477.24 L 393.04 476.71 L 393.54 477.1 L 395.12 476.91 L 396.71 477.04 L 398.32 478.3 L 398.18 478.71 L 397.29 479.36 L 396.6 482.66 L 396.95 483.44 L 398.02 483.97 L 398.67 483.12 L 399.77 480.36 L 400.53 480.19 L 402.67 480.77 L 402.27 482.72 L 403 486.02 L 404.42 486.6 L 404.58 487.92 L 404.58 487.92 L 403.23 488.94 L 402.62 490.42 L 402.07 490.3 L 402.34 488.36 L 403.78 487.41 L 402.37 487.69 L 401.48 488.18 L 400.61 488.16 L 400.27 487.77 L 399.7 487.6 L 399.16 487.97 L 398.88 488.9 L 399.4 489.7 L 398.67 490.66 L 398.37 490.76 L 395.89 490.23 L 395.1 489.69 L 394.65 489.81 L 394.47 490.71 L 394.81 491.08 L 396.42 491.64 L 397.82 491.39 L 399.95 491.99 L 400.22 492.47 L 399.25 493.15 L 397.71 495.93 L 396.47 496.7 L 394.05 497.27 L 393.85 497.72 L 396.8 497.52 L 396.95 498.71 z"},{code:"RJ",name:"Rio de Janeiro",gTransform:"matrix(1 0 0 1 179.27 113.69)",pathTransform:"translate(-485.28, -432.95)",d:"M 468.35 450.28 L 468.28000000000003 449.5 L 468.66 449.23 L 471.85 449.45000000000005 L 474.44 448.86000000000007 L 471.91 447.31000000000006 L 470.51000000000005 446.81000000000006 L 467.70000000000005 447.49000000000007 L 466.34000000000003 449.0900000000001 L 465.31000000000006 449.4100000000001 L 464.61000000000007 449.36000000000007 L 463.26000000000005 447.2100000000001 L 462.78000000000003 447.2100000000001 L 461.88000000000005 447.6300000000001 L 460.9200000000001 448.6900000000001 L 457.7700000000001 449.4900000000001 L 457.4300000000001 450.40000000000015 L 457.2400000000001 452.3000000000001 L 459.4300000000001 452.4300000000001 L 460.5000000000001 453.4400000000001 L 459.35000000000014 454.5200000000001 L 458.41000000000014 454.3500000000001 L 456.9900000000001 454.5200000000001 L 456.9900000000001 454.5200000000001 L 456.5100000000001 454.2600000000001 L 454.8800000000001 452.5300000000001 L 454.8300000000001 452.12000000000006 L 455.9200000000001 448.62000000000006 L 457.01000000000005 447.4700000000001 L 459.36000000000007 446.4600000000001 L 459.86000000000007 446.61000000000007 L 462.63000000000005 446.25000000000006 L 464.13000000000005 445.5400000000001 L 465.78000000000003 443.3900000000001 L 465.03000000000003 441.7500000000001 L 463.33000000000004 441.7400000000001 L 460.18000000000006 442.2700000000001 L 458.4100000000001 441.8800000000001 L 457.18000000000006 440.29000000000013 L 456.62000000000006 439.1200000000001 L 455.3500000000001 438.5800000000001 L 455.3500000000001 438.5800000000001 L 456.0300000000001 438.0900000000001 L 458.4500000000001 437.3500000000001 L 461.3600000000001 436.0100000000001 L 463.9400000000001 435.8400000000001 L 464.4400000000001 436.11000000000007 L 466.16000000000014 435.3400000000001 L 467.21000000000015 434.5700000000001 L 471.3000000000001 432.7800000000001 L 471.8200000000001 432.7100000000001 L 472.1800000000001 433.0200000000001 L 475.3800000000001 432.9500000000001 L 476.6300000000001 432.7800000000001 L 478.2600000000001 431.8400000000001 L 478.8300000000001 431.7800000000001 L 481.36000000000007 432.05000000000007 L 481.8500000000001 432.2200000000001 L 481.8300000000001 432.6900000000001 L 483.2100000000001 432.4900000000001 L 492.7200000000001 427.96000000000015 L 495.25000000000006 426.97000000000014 L 495.46000000000004 426.45000000000016 L 495.18000000000006 425.84000000000015 L 493.74000000000007 425.71000000000015 L 493.83000000000004 424.96000000000015 L 495.72 421.25000000000017 L 498.08000000000004 415.21000000000015 L 497.35 414.50000000000017 L 497.91 414.01000000000016 L 499.15000000000003 413.7400000000002 L 501.68 411.38000000000017 L 501.68 411.38000000000017 L 503.61 412.14000000000016 L 504.28000000000003 416.85000000000014 L 506.78000000000003 417.98000000000013 L 511.11 418.9900000000001 L 514.1 418.6200000000001 L 515.72 419.6800000000001 L 515.72 419.6800000000001 L 515.64 420.9500000000001 L 514.6999999999999 422.5600000000001 L 514.4799999999999 424.6900000000001 L 515.6199999999999 431.4700000000001 L 515.1199999999999 432.1500000000001 L 512.0399999999998 433.9000000000001 L 506.0699999999998 435.8400000000001 L 503.23999999999984 437.5600000000001 L 499.73999999999984 441.2500000000001 L 499.6299999999998 442.91000000000014 L 499.9399999999998 444.10000000000014 L 499.74999999999983 445.72000000000014 L 499.0199999999998 447.20000000000016 L 497.1999999999998 447.71000000000015 L 490.6499999999998 447.54000000000013 L 484.8599999999998 448.2400000000001 L 482.4699999999998 447.78000000000014 L 481.9799999999998 447.40000000000015 L 481.9199999999998 446.72000000000014 L 482.94999999999976 445.2400000000001 L 483.6199999999998 443.79000000000013 L 483.5299999999998 443.17000000000013 L 482.74999999999983 442.9900000000001 L 479.9599999999998 444.1400000000001 L 479.6999999999998 444.8300000000001 L 480.0099999999998 445.6200000000001 L 481.3899999999998 446.79000000000013 L 481.6399999999998 447.76000000000016 L 481.04999999999984 448.28000000000014 L 479.41999999999985 448.79000000000013 L 477.84999999999985 448.76000000000016 L 469.80999999999983 449.83000000000015 L 468.35 450.28 z M 463.24 452.27 L 462.57 451.29999999999995 L 464.68 449.74999999999994 L 466.54 450.68999999999994 L 466.97 451.38999999999993 L 464.51000000000005 451.88999999999993 L 464.1 451.5399999999999 L 463.63 451.5399999999999 L 463.24 452.27 z"},{code:"RN",name:"Rio Grande do Norte",gTransform:"matrix(1 0 0 1 274.86 -145.63)",pathTransform:"translate(-580.87, -173.63)",d:"M 609.29 182.91 L 608.36 183.15 L 604.86 182.94 L 603.82 183.34 L 601.36 182.24 L 599.19 181.94 L 593.36 182.33 L 592.83 181.98 L 589.41 181.58 L 588.79 181.09 L 588.89 180.09 L 588.47 179.7 L 587.09 179.75 L 585.27 181.1 L 584.96 182.58 L 585.68 183.36 L 586.21 184.89 L 585.2 184.57 L 584.72 185.16 L 584.88 186.58 L 585.35 187.52 L 584.8 188.73 L 584.3 189.47 L 581.95 190.4 L 581.12 189.66 L 581.64 188.12 L 580.75 186.95 L 578.8 186.65 L 577.03 186.73 L 573.88 187.99 L 573.59 187.76 L 573.28 186.38 L 572.96 186.15 L 569.43 185.63 L 569.51 183.91 L 569.72 183.6 L 570.57 183.35 L 570.98 182.97 L 571.36 181.23 L 571.8 180.27 L 574.79 177.06 L 574.78 175.87 L 574.25 175.43 L 573.61 175.35 L 570.35 176.39 L 568.92 176.51 L 565.74 177.72 L 565.33 178.67 L 565.23 179.71 L 564.41 180.42 L 561.18 182.08 L 560.02 183.21 L 557.14 182.6 L 556.24 182.18 L 554.31 180.54 L 553.74 181 L 553.74 181 L 553.08 181.38 L 552.44 181.21 L 552.78 179.24 L 554.19 176.99 L 555.03 176.11 L 555.54 176.04 L 556.32 176.55 L 557.35 176.29 L 557.92 175.19 L 559.38 173.68 L 560.78 171.24 L 560.63 170.5 L 561.28 168.83 L 562.15 168.26 L 562.99 167.14 L 566.29 160.45 L 568.9 158.44 L 573.79 156.85 L 573.79 156.85 L 574.26 157.61 L 575.12 158.36 L 578.25 158.35 L 579.47 158.76 L 581.16 160.51 L 582.48 161.01 L 585.81 160.69 L 588.69 161.21 L 591.23 160.97 L 593.56 160.24 L 598.06 161.16 L 599.33 161.2 L 601.28 162.06 L 602.3 162.88 L 602.94 163.82 L 605.25 168.56 L 605.75 170.35 L 605.71 171.1 L 607.19 176.48 L 607.4 178.16 L 608.12 178.7 L 609.08 181.39 z"},{code:"RO",name:"Rondônia",gTransform:"matrix(1 0 0 1 -139.57 -68.08)",pathTransform:"translate(-166.43, -251.18)",d:"M 187.32 290.95 L 186.03 289.5 L 185.59 287.62 L 184.03 287.1 L 183.17 287.42 L 181.36 287.5 L 177.29 285.69 L 177.28 285.29 L 176.62 284.68 L 175.35 285.27 L 173.37 283.59 L 171.85 282.62 L 170.99 281.16 L 170.71 279.77 L 169.67 279.38 L 167.9 280.5 L 166.68 280.47 L 165.27 279.67 L 164.4 278.34 L 161.27 276.76 L 159.31 276.59 L 158.17 277.13 L 157.27 277.98 L 155.84 277.81 L 155.53 277.51 L 153.39 277 L 150.33 276.72 L 149.57 276.29 L 148.39 275.1 L 148.09 273.13 L 146.51 272.64 L 144.62 271.67 L 143.8 269.95 L 143.51 269.75 L 140.79 269.47 L 140.41 269.12 L 139.57 265.41 L 138.69 264.52 L 138.21 265.68 L 137.55 265.36 L 137.28 264.72 L 137.9 263.19 L 137.06 261.67 L 135.7 261.28 L 134.44 257.81 L 134.27 256.15 L 135.82 253.24 L 135.61 251.58 L 134.45 249.61 L 133.7 247.45 L 133.64 245.16 L 134.26 244.66 L 134.64 243.29 L 135.68 242.24 L 136.04 240.77 L 135.8 239.28 L 135.38 238.39 L 135.29 236.86 L 135.83 235.21 L 134.66 233.03 L 133.64 232.65 L 132.55 233.63 L 132.49 234.14 L 131.65 235.1 L 131.08 235.1 L 128.9 234.08 L 123.72 234.16 L 118.11 235.94 L 116.42 235.93 L 114.94 236.41 L 114.94 236.41 L 111.97 235.15 L 111.97 235.15 L 115.23 232.59 L 117.15 232.01 L 118.7 230.2 L 118.85 229.64 L 118.69 228.35 L 122.65 228.61 L 125.52 228.28 L 126.24 228.65 L 128.55 230.98 L 128.92 230.96 L 130.14 230.17 L 130.27 229.45 L 130.68 228.92 L 131.76 228.42 L 132.53 228.55 L 133.9 228.16 L 135.2 226.95 L 137.04 225.93 L 137.42 226.02 L 138.06 228.28 L 138.74 228.81 L 139.42 228.73 L 141.96 225.57 L 141.7 223.82 L 142.23 222.98 L 143.98 221.72 L 144.44 221.74 L 145.28 222.29 L 147.07 222.39 L 148.27 221.32 L 150.4 220.94 L 154.27 221.4 L 154.03 219.94 L 154.14 218.13 L 156.2 216.92 L 157.01 215.77 L 157.37 214.75 L 157.2 214.3 L 156.3 213.6 L 156.35 212.93 L 157.54 211.34 L 160.02 210.81 L 160.28 210.59 L 160.19 209.42 L 161.91 208.92 L 163.29 206.36 L 174.08 206.3 L 176.23 207.43 L 176.68 207.92 L 177.48 209.83 L 178.81 211.1 L 181.35 212.08 L 182.6 215.35 L 183.06 215.56 L 184.04 215.43 L 184.66 215.63 L 185.34 218.51 L 188.58 219.99 L 189.26 219.8 L 189.8 218.06 L 191.72 216.98 L 193.11 217.26 L 193.47 217.64 L 193.43 218.34 L 193.43 218.34 L 194.83 219.31 L 195.43 220.55 L 194.67 221.97 L 193.38 226.96 L 193.44 227.31 L 194.22 227.78 L 194.48 228.39 L 194.63 229.78 L 195.46 232.05 L 194.52 233.72 L 194.9 235.65 L 193.9 239.17 L 193.87 239.97 L 194.14 241.73 L 195.64 244.48 L 194.74 253.48 L 211.9 253.53 L 211.66 254.09 L 212.88 255.2 L 216.38 255.11 L 217.49 255.22 L 218.56 255.65 L 219.97 259.24 L 219.8 259.99 L 218.4 261.74 L 217.04 262.82 L 216.9 264.14 L 217.33 267.39 L 217.91 267.9 L 218.81 267.87 L 220.34 271.21 L 220.3 273.26 L 220.88 274.75 L 220.81 276.46 L 220.25 278.7 L 218.59 280.71 L 218.07 282.96 L 217.49 283.8 L 217.06 284.21 L 215.42 284.74 L 214.49 285.82 L 213.06 289.6 L 212.54 292.05 L 208.43 294.62 L 206.96 296.05 L 206.96 296.05 L 206.22 296.01 L 203.63 294.46 L 202.36 293.03 L 195.28 293.99 L 193.96 293.56 L 193.71 293.26 L 190.33 293.92 L 189.85 293.76 L 189.33 292.41 z"},{code:"RR",name:"Roraima",gTransform:"matrix(1 0 0 1 -116.08 -267.27)",pathTransform:"translate(-189.92, -51.99)",d:"M 234.61 61.4 L 236.21 78.37 L 236.21 78.37 L 217.72 78.3 L 217.75 78.98 L 215.42 82.24 L 213.76 85.27 L 213.69 86.4 L 212.54 89.04 L 212.43 89.7 L 212.66 90.43 L 213.8 91.84 L 213.78 92.37 L 213.36 92.76 L 211.33 93.31 L 209.92 94.72 L 208.67 95.18 L 206.85 94.95 L 205.93 92.44 L 204.06 90.4 L 201.23 89.47 L 199.63 89.53 L 199.08 90.42 L 196.99 91.13 L 195.71 91.82 L 194.69 93.08 L 193.87 96.05 L 194.24 97.85 L 193.99 99.58 L 193.24 101.87 L 193.68 103.98 L 191.32 102.94 L 189.98 103.36 L 189.45 103.29 L 188.41 101.25 L 186.93 99.6 L 184.97 98.29 L 184.45 98.25 L 179.44 93.83 L 179.58 92.69 L 181.42 93.02 L 182.56 91.7 L 182.62 91.12 L 181.49 86.79 L 180.91 85.89 L 179.69 85.05 L 178.81 82.88 L 178.52 77.9 L 179.09 76.94 L 179.86 73.9 L 179.2 72.32 L 178.84 70.73 L 180.46 69.27 L 180.41 68.82 L 179.54 67.7 L 179.35 65.44 L 177.69 60.68 L 174.96 56.94 L 175.67 55.44 L 176.58 52.12 L 176.09 51.46 L 174.14 50.51 L 172.78 50.4 L 171.9 50.61 L 170.93 50.24 L 169.72 49.07 L 169.66 48.11 L 169.03 48 L 167.9 48.42 L 167.29 48.41 L 166.54 48.07 L 165.82 47.29 L 165.82 47.29 L 166.12 46.83 L 166.35 44.55 L 166.05 44.33 L 162.68 44.1 L 158.93 44.24 L 155.62 43.54 L 155.42 42.94 L 156.22 41.18 L 156.34 39.7 L 155.61 37.93 L 153.67 34.39 L 152.94 32.33 L 152.47 28.61 L 153.26 27.13 L 153.18 26.17 L 151.34 24.17 L 149.18 23.11 L 146.37 20.33 L 145.31 18.52 L 145.02 17.56 L 143.88 16.91 L 143.63 16.52 L 143.66 15.68 L 143.95 15.35 L 144.85 15.42 L 145.97 16.08 L 146.91 17.81 L 147.52 17.9 L 150.91 17.4 L 152.26 17.5 L 154.17 18.09 L 154.78 19.29 L 155.33 21.22 L 155.87 21.57 L 156.83 21.49 L 157.57 20.84 L 158.52 20.44 L 161.7 20.6 L 162.17 20.65 L 163.48 21.86 L 164.08 22.01 L 164.6 21.87 L 165.21 20.31 L 166.52 20.45 L 167.97 21.38 L 171.9 25.95 L 172.95 26.52 L 173.66 26.63 L 175.17 25.95 L 175.91 24.82 L 176.01 23.98 L 175.18 21.22 L 175.54 19.48 L 176 19.2 L 177.93 19.15 L 178.94 18.05 L 180.49 16.96 L 181.24 17.01 L 185.14 18.35 L 185.73 18.18 L 186.53 17.46 L 187.56 17.16 L 188.69 17.51 L 189.72 17.3 L 191.06 16.02 L 192.06 15.77 L 193.21 16 L 194.32 15.93 L 195 15.08 L 195.05 13.73 L 198.08 11.92 L 200.41 12.11 L 203.17 11.72 L 204.06 10.59 L 204.15 9.88 L 204.74 8.76 L 205.49 8.63 L 207.34 7.73 L 208.44 6.69 L 209.55 4.98 L 208.35 1.42 L 207.18 1.06 L 207.82 0.88 L 209.25 0.95 L 210.05 1.27 L 213.62 1.17 L 214.68 0.22 L 215.42 0 L 216.79 0.42 L 217.32 1.73 L 218.36 2.53 L 218.84 3.9 L 218.17 8.8 L 217.45 10.18 L 216.2 10.88 L 216.26 11.71 L 217.87 12.12 L 219.49 11.9 L 221.84 12.71 L 223.66 13.81 L 222.78 15.24 L 222.77 16.39 L 225.11 19.81 L 225.31 21.36 L 223.8 24.28 L 221.92 25.69 L 221.2 27.19 L 221.47 27.58 L 221.53 29.75 L 220.06 32.16 L 219.16 34.93 L 218.85 37.5 L 218.76 40.17 L 219.74 42.04 L 220.25 43.8 L 220.24 45.2 L 221.81 46.23 L 222.71 46.43 L 222.84 47.11 L 222.38 52.26 L 222.5 53 L 224.31 53.29 L 223.65 54.46 L 224.11 54.96 L 226.26 55.7 L 227.72 57.62 L 230.38 60.36 z"},{code:"RS",name:"Rio Grande do Sul",gTransform:"matrix(1 0 0 1 11.62 259.25)",pathTransform:"translate(-317.63, -578.5)",d:"M 321.99 638.52 L 321.63 638.53 L 319.69 637.42 L 319.49 636.96 L 320.01 632.69 L 319.55 628.44 L 319.7 627.37 L 320.33 626.13 L 323.17 623.75 L 324 622.19 L 326.3 619.63 L 324.84 617.98 L 323.77 617.36 L 321.52 616.76 L 319.2 614.51 L 317.99 612.89 L 317.89 611.3 L 317.46 610.12 L 316.23 608.09 L 314.17 605.85 L 313.5 605.26 L 311.11 604.05 L 309.66 604.26 L 307.76 602.75 L 306.24 601.12 L 304.99 600.34 L 304.85 598.64 L 302.95 596.48 L 299.63 596.02 L 298.71 595.55 L 296.98 593.89 L 295.22 594.02 L 293.05 592.64 L 291.14 588.93 L 290.03 587.44 L 287.5 585.32 L 286.8 585.4 L 286.13 587.19 L 283.54 589.43 L 280.87 589.55 L 280.97 586.69 L 281.37 585.41 L 280.98 584.41 L 277.33 580.12 L 274.96 578.35 L 272.78 576.29 L 271.03 574.18 L 268.34 571.97 L 266.44 571.83 L 264.29 572.04 L 263.15 573.4 L 263.09 574.36 L 262.06 575.33 L 260.95 575.35 L 260.37 574.87 L 257.21 575.01 L 256.56 574.53 L 256.4 573.62 L 255.91 573.4 L 256.76 573.18 L 257.8 572.46 L 260.32 569.69 L 260.43 567.85 L 261.03 566.6 L 261.85 566.15 L 263.14 566.08 L 263.78 565.82 L 264.7 564.82 L 270.15 558.34 L 270.78 556.92 L 270.95 555.81 L 271.77 554.74 L 272.97 553.89 L 274.34 553.48 L 276.3 549.26 L 276.4 548.65 L 276.71 548.28 L 278.35 547.42 L 279.98 545.62 L 280.83 544.47 L 281.34 543.18 L 282.68 541.08 L 283.61 540.79 L 285.18 540.97 L 285.73 541.76 L 286.2 540.48 L 285.99 539.9 L 284.64 539.08 L 284.59 538.72 L 284.94 538.39 L 286.02 538.01 L 286.84 537.05 L 289.63 536.1 L 290.68 535.03 L 290.78 534.11 L 291.6 533.2 L 293.81 532.05 L 296.28 531.65 L 298.05 529.84 L 298.2 528.78 L 299.52 526.42 L 299.85 526.38 L 299.9 526.74 L 300.19 526.94 L 301.52 526.77 L 303.96 525.64 L 306.64 525.05 L 307.85 524.48 L 309.95 522.13 L 310.45 522.14 L 311.12 521.75 L 312.13 520.4 L 314.44 519.67 L 314.74 520.05 L 314.74 520.05 L 318.26 520.44 L 321.52 519.29 L 322.08 518.48 L 323.43 519.06 L 323.28 519.98 L 326.36 519.95 L 327.99 520.94 L 330.55 520.57 L 332.47 521.72 L 335.05 521.31 L 336.59 521.49 L 339.39 521.33 L 341.65 522.25 L 344.13 523.65 L 345.13 526.09 L 346.72 526.28 L 346.81 525.8 L 348.62 525.45 L 354.18 528.99 L 355.55 530.54 L 356.26 530.51 L 357.82 531.49 L 360.85 534.98 L 362.49 537.19 L 362.97 538.67 L 365.14 541.33 L 366.31 541.88 L 373 542.94 L 375.11 542.54 L 378.46 542.88 L 379.34 545.22 L 377.26 546.8 L 375.99 547.21 L 375.26 549.07 L 375.48 551.26 L 375.1 552.82 L 374.58 554.12 L 373.4 554.32 L 372.11 556.01 L 372.08 557.42 L 373.88 558.59 L 374.15 558.39 L 373.87 557.42 L 373.88 556.46 L 375.37 555.64 L 376.95 556.28 L 377.68 557.19 L 378.85 558.04 L 379.3 558.01 L 379.3 558.01 L 377.9 559.74 L 374 566.78 L 369.79 578.38 L 363.49 588.86 L 358.05 595.52 L 351.54 601.48 L 345.45 605.16 L 342.35 609.47 L 342.17 609.04 L 342.82 607.46 L 343.16 605.28 L 341.98 603.57 L 342.08 603.15 L 343.01 602.98 L 344.02 603.38 L 344.58 603.96 L 345.6 604 L 348.18 602.59 L 349 601.91 L 351.85 598.2 L 352.6 597.51 L 353.05 597.7 L 354.07 597.51 L 355.12 596.67 L 356.05 595.4 L 356.42 593.92 L 356.6 592.99 L 356.37 590.89 L 356.57 589.52 L 358.14 589.45 L 358.88 589.75 L 359.15 590.58 L 359.5 590.32 L 359.21 588.92 L 359.72 586.85 L 360.2 586.28 L 362.94 584.69 L 363.67 583.61 L 364.14 580.86 L 363.93 578.58 L 364.49 577.9 L 364.99 578.7 L 365.36 578.73 L 365.79 578.31 L 366.26 575.23 L 366.16 574.79 L 365.21 573.57 L 364.54 573.54 L 364.28 574.23 L 364.45 574.62 L 364.31 575.19 L 363.96 575.39 L 362.45 575.37 L 360.44 575.77 L 360.1 577.38 L 359.57 577.43 L 358.76 576.99 L 358.86 575.28 L 358.04 574.39 L 357 574.72 L 356.4 574.24 L 355.67 572.98 L 355.27 571.53 L 355.39 570.96 L 354.75 570.27 L 354.14 572.98 L 354.58 575.23 L 355.83 577.34 L 355.26 578.15 L 354.52 580.69 L 354.9 583.72 L 354.72 584.49 L 354.24 584.12 L 354.5 583.88 L 354.47 583.17 L 354 581.89 L 353.55 581.5 L 353.02 582.16 L 352.99 583.53 L 351.58 586.8 L 351.53 588.69 L 351.75 589.21 L 351.03 589.91 L 349.42 590.55 L 348.81 592.13 L 344.72 593.7 L 344 594.23 L 343.47 595.82 L 343.37 598.09 L 342.4 600.36 L 340.04 601.66 L 339.93 603.42 L 340.41 604.25 L 340.66 605.27 L 339.71 605.83 L 339.46 607.34 L 339.89 607.94 L 340.57 607.8 L 341.87 608.43 L 342.02 609.34 L 339.89 610.99 L 337.57 615.51 L 335.64 622.39 L 333.63 626.88 L 331.95 629.4 L 324.16 636.93 z"},{code:"SC",name:"Santa Catarina",gTransform:"matrix(1 0 0 1 51.41 209.71)",pathTransform:"translate(-357.4, -528.97)",d:"M 379.3 558.01 L 378.85 558.04 L 377.68 557.1899999999999 L 376.95 556.27 L 375.36 555.64 L 373.88 556.46 L 373.87 557.4200000000001 L 374.15 558.3900000000001 L 373.88 558.5900000000001 L 372.08 557.4200000000002 L 372.12 556.0100000000002 L 373.4 554.3200000000002 L 374.58 554.1200000000001 L 375.10999999999996 552.8100000000002 L 375.47999999999996 551.2600000000002 L 375.25999999999993 549.0700000000002 L 375.98999999999995 547.2100000000002 L 377.25999999999993 546.7900000000002 L 379.3399999999999 545.2100000000002 L 378.4599999999999 542.8700000000001 L 375.1099999999999 542.5300000000001 L 372.9999999999999 542.9300000000001 L 366.3099999999999 541.8700000000001 L 365.14999999999986 541.3300000000002 L 362.97999999999985 538.6700000000002 L 362.48999999999984 537.1900000000002 L 360.85999999999984 534.9800000000001 L 357.82999999999987 531.4900000000001 L 356.2599999999999 530.5000000000001 L 355.5499999999999 530.5300000000001 L 354.1799999999999 528.9800000000001 L 348.6199999999999 525.4400000000002 L 346.8099999999999 525.7800000000002 L 346.7199999999999 526.2600000000002 L 345.1199999999999 526.0700000000002 L 344.1199999999999 523.6300000000001 L 341.64999999999986 522.2400000000001 L 339.3799999999999 521.3100000000002 L 336.58999999999986 521.4700000000001 L 335.04999999999984 521.2900000000002 L 332.45999999999987 521.7000000000002 L 330.54999999999984 520.5500000000002 L 327.97999999999985 520.9100000000002 L 326.34999999999985 519.9300000000002 L 323.26999999999987 519.9600000000002 L 323.41999999999985 519.0300000000002 L 322.0699999999998 518.4500000000002 L 321.5099999999998 519.2600000000001 L 318.24999999999983 520.4200000000001 L 314.72999999999985 520.0300000000001 L 314.72999999999985 520.0300000000001 L 316.17999999999984 517.1000000000001 L 316.90999999999985 515.0100000000001 L 316.32999999999987 511.7600000000001 L 316.7399999999999 508.5500000000001 L 316.6999999999999 506.0000000000001 L 317.65999999999985 504.2500000000001 L 317.65999999999985 504.2500000000001 L 321.28999999999985 504.2700000000001 L 321.99999999999983 503.8900000000001 L 322.5299999999998 503.9000000000001 L 323.5899999999998 504.1400000000001 L 323.8999999999998 504.6500000000001 L 325.9299999999998 506.0600000000001 L 328.6099999999998 506.0900000000001 L 330.94999999999976 505.5100000000001 L 336.2399999999998 507.1900000000001 L 340.4999999999998 507.5500000000001 L 341.51999999999975 508.1800000000001 L 341.68999999999977 508.59000000000015 L 343.25999999999976 509.77000000000015 L 347.02999999999975 510.19000000000017 L 351.27999999999975 510.0600000000002 L 352.60999999999973 511.96000000000015 L 352.78999999999974 511.46000000000015 L 353.52999999999975 511.08000000000015 L 354.44999999999976 511.0600000000002 L 355.31999999999977 510.20000000000016 L 354.46999999999974 507.21000000000015 L 355.15999999999974 505.63000000000017 L 355.87999999999977 504.8500000000002 L 357.87999999999977 503.7100000000002 L 361.44999999999976 504.1100000000002 L 363.31999999999977 503.14000000000016 L 364.0499999999998 502.27000000000015 L 364.63999999999976 500.79000000000013 L 366.16999999999973 500.14000000000016 L 367.27999999999975 500.00000000000017 L 368.69999999999976 500.76000000000016 L 369.50999999999976 500.79000000000013 L 371.83999999999975 500.6200000000001 L 374.6799999999997 499.8900000000001 L 375.4299999999997 499.9000000000001 L 376.46999999999974 500.30000000000007 L 379.58999999999975 502.9000000000001 L 380.81999999999977 503.5200000000001 L 382.25999999999976 503.6800000000001 L 385.6099999999998 501.5500000000001 L 386.9599999999998 500.1200000000001 L 388.5199999999998 499.5500000000001 L 388.6399999999998 499.9400000000001 L 389.3999999999998 500.0100000000001 L 391.1399999999998 499.7800000000001 L 391.4699999999998 499.3400000000001 L 396.7099999999998 499.37000000000006 L 396.7099999999998 499.37000000000006 L 396.3199999999998 500.69000000000005 L 396.8299999999998 502.34000000000003 L 396.7599999999998 502.73 L 395.2599999999998 503.87 L 394.2799999999998 503.39 L 393.4599999999998 500.86 L 393.4399999999998 501.98 L 394.0299999999998 504.70000000000005 L 395.7399999999998 506.36000000000007 L 396.2999999999998 507.31000000000006 L 395.2899999999998 509.6000000000001 L 395.12999999999977 511.9200000000001 L 395.2299999999998 512.35 L 395.9899999999998 513.08 L 396.2499999999998 518.94 L 396.5599999999998 519.49 L 396.9899999999998 519.69 L 397.75999999999976 519.1800000000001 L 398.1099999999998 519.9000000000001 L 398.2099999999998 520.7700000000001 L 397.7399999999998 520.83 L 397.3099999999998 520.5500000000001 L 396.1199999999998 521.1800000000001 L 395.7799999999998 525.0200000000001 L 396.3499999999998 527.6100000000001 L 395.7799999999998 528.3600000000001 L 396.0899999999998 530.2900000000001 L 396.99999999999983 532.1700000000001 L 396.1399999999998 534.5100000000001 L 395.61999999999983 538.5200000000001 L 393.90999999999985 543.2 L 393.5699999999999 543.1 L 393.20999999999987 542.34 L 393.41999999999985 541.37 L 392.49999999999983 540.19 L 392.23999999999984 540.5200000000001 L 392.41999999999985 542.95 L 393.57999999999987 543.7800000000001 L 392.65999999999985 545.44 L 391.01999999999987 546.09 L 386.8899999999999 549.13 L 384.08999999999986 551.6899999999999 L 380.33999999999986 556.13 L 379.3 558.01 z M 397.18 531.46 L 397.03000000000003 530.99 L 397.28000000000003 529.24 L 398.04 526.84 L 397.64000000000004 525.6600000000001 L 397.80000000000007 524.6400000000001 L 399.20000000000005 523.8800000000001 L 399.4200000000001 523.94 L 400.0800000000001 524.8800000000001 L 399.5400000000001 527.44 L 398.7200000000001 528.3000000000001 L 398.1300000000001 529.5200000000001 L 398.3300000000001 530.69 L 397.18 531.46 z M 396.73 507.09 L 394.86 505.07 L 397.41 502.63 L 397.66 502.67 L 398.31 503.72 L 397.45 505.04 L 396.73 507.09 z"},{code:"SE",name:"Sergipe",gTransform:"matrix(1 0 0 1 266.49 -72.82)",pathTransform:"translate(-572.49, -246.44)",d:"M 569.94 261.69 L 567.04 262.58 L 565.49 261.94 L 564.95 261.6 L 564.47 260.88 L 562.55 259.96 L 561.95 259.44 L 561.83 259.03 L 562.17 258.64 L 562.3 257.22 L 562.15 256.83 L 560.72 255.32 L 560.2 253.83 L 559.11 253.16 L 558.15 251.56 L 558.13 250.79 L 558.72 249.21 L 559.04 248.91 L 560.74 248.92 L 561.87 249.67 L 564.42 248.68 L 565.11 248.13 L 565.41 247.55 L 564.65 244.8 L 564.73 243.92 L 565.39 242.3 L 565.47 239.19 L 564.72 238.04 L 562.73 236.09 L 561.46 233.59 L 561.24 231.45 L 561.91 230.3 L 561.91 230.3 L 568.37 233.28 L 572.05 234.23 L 577.47 237.3 L 578.77 239.75 L 580.53 241.2 L 582.19 241.99 L 582.65 242.02 L 586.24 244.25 L 586.84 245.56 L 586.84 245.56 L 584.46 246.32 L 579.89 249.26 L 578.92 250.15 L 577.37 252.36 L 577.05 252.34 L 577.16 251.24 L 576.11 249.42 L 575.12 249.58 L 575.46 250.74 L 576.7 250.74 L 576.93 250.98 L 576.41 252.95 L 575.14 255.04 L 574.61 254.69 L 574.24 254.02 L 573.25 253.86 L 573.45 254.54 L 574.58 255.16 L 574.32 256.93 L 573.46 258.08 L 572.53 260.11 L 571.75 260.26 L 571.45 259.8 L 571.93 258.4 L 572.34 258.27 L 572.65 257.84 L 573.02 256.8 L 572.21 256.43 L 572.31 257.11 L 571.86 258.24 L 571.38 258.74 L 571.12 259.83 L 571.4 260.55 L 571.14 261.07 z"},{code:"SP",name:"São Paulo",gTransform:"matrix(1 0 0 1 89.6 122.15)",pathTransform:"translate(-395.6, -441.42)",d:"M 404.58 487.92 L 404.41999999999996 486.59000000000003 L 402.99999999999994 486.02000000000004 L 402.2699999999999 482.72 L 402.6699999999999 480.77000000000004 L 400.5299999999999 480.19000000000005 L 399.7699999999999 480.36000000000007 L 398.6699999999999 483.13000000000005 L 398.0099999999999 483.9800000000001 L 396.9499999999999 483.4500000000001 L 396.59999999999985 482.67000000000013 L 397.28999999999985 479.3700000000001 L 398.17999999999984 478.7100000000001 L 398.3199999999998 478.3100000000001 L 396.7099999999998 477.04000000000013 L 395.11999999999983 476.91000000000014 L 393.53999999999985 477.10000000000014 L 393.03999999999985 476.72000000000014 L 389.6299999999998 477.2500000000001 L 387.24999999999983 477.3700000000001 L 386.23999999999984 477.16000000000014 L 385.6399999999998 476.77000000000015 L 385.30999999999983 474.73000000000013 L 386.5899999999998 472.6100000000001 L 386.8399999999998 471.5600000000001 L 386.5899999999998 471.1200000000001 L 385.9899999999998 470.8200000000001 L 385.06999999999977 468.8500000000001 L 385.12999999999977 467.9600000000001 L 384.62999999999977 467.2800000000001 L 383.95999999999975 466.99000000000007 L 382.7499999999998 465.8500000000001 L 381.25999999999976 462.8400000000001 L 381.6199999999998 462.2900000000001 L 381.69999999999976 460.5300000000001 L 380.39999999999975 459.0100000000001 L 380.01999999999975 457.17000000000013 L 380.18999999999977 456.3600000000001 L 380.57999999999976 455.78000000000014 L 380.5599999999998 453.04000000000013 L 379.6699999999998 451.28000000000014 L 376.0799999999998 448.45000000000016 L 374.9499999999998 446.90000000000015 L 371.9799999999998 447.76000000000016 L 366.6699999999998 447.63000000000017 L 366.00999999999976 447.09000000000015 L 364.3599999999998 446.95000000000016 L 363.93999999999977 447.29000000000013 L 362.21999999999974 447.22000000000014 L 361.4999999999997 445.90000000000015 L 360.8699999999997 445.39000000000016 L 357.35999999999973 444.59000000000015 L 355.60999999999973 443.75000000000017 L 354.82999999999976 442.75000000000017 L 352.2499999999998 442.76000000000016 L 351.1799999999998 443.3000000000002 L 349.8599999999998 443.1700000000002 L 347.2199999999998 442.0800000000002 L 344.6899999999998 441.62000000000023 L 343.2099999999998 440.8300000000002 L 342.0399999999998 440.5400000000002 L 341.3099999999998 440.9100000000002 L 340.9699999999998 441.5100000000002 L 339.7599999999998 442.1300000000002 L 336.47999999999985 441.8400000000002 L 332.46999999999986 441.9500000000002 L 328.6399999999999 441.30000000000024 L 325.3899999999999 443.59000000000026 L 325.3899999999999 443.59000000000026 L 326.22999999999985 442.5100000000003 L 326.95999999999987 440.97000000000025 L 328.21999999999986 439.83000000000027 L 335.77999999999986 435.29000000000025 L 337.72999999999985 433.42000000000024 L 338.98999999999984 430.99000000000024 L 340.71999999999986 429.30000000000024 L 341.11999999999983 428.09000000000026 L 342.55999999999983 427.0600000000003 L 342.8399999999998 425.84000000000026 L 342.4899999999998 425.0000000000003 L 344.4899999999998 422.7400000000003 L 345.69999999999976 420.4000000000003 L 345.76999999999975 419.4600000000003 L 345.45999999999975 417.5300000000003 L 345.68999999999977 417.1400000000003 L 346.64999999999975 416.62000000000035 L 349.2499999999998 412.98000000000036 L 349.4099999999998 410.05000000000035 L 350.0299999999998 408.37000000000035 L 351.0399999999998 408.07000000000033 L 351.7699999999998 407.43000000000035 L 353.7599999999998 404.75000000000034 L 354.97999999999985 403.73000000000036 L 355.4499999999999 403.50000000000034 L 356.7599999999999 403.4600000000003 L 358.2599999999999 402.68000000000035 L 358.53999999999985 402.28000000000037 L 358.9399999999998 399.8200000000004 L 358.9399999999998 399.8200000000004 L 360.15999999999985 398.6900000000004 L 362.30999999999983 397.5800000000004 L 364.22999999999985 397.2100000000004 L 365.65999999999985 395.5200000000004 L 367.15999999999985 394.91000000000037 L 367.90999999999985 395.05000000000035 L 369.6399999999999 396.60000000000036 L 372.1899999999999 396.68000000000035 L 376.4799999999999 397.6400000000003 L 378.1499999999999 397.2800000000003 L 379.7699999999999 397.50000000000034 L 381.7699999999999 396.91000000000037 L 383.94999999999993 398.3300000000004 L 385.61999999999995 399.1200000000004 L 385.48999999999995 400.0400000000004 L 385.81999999999994 401.46000000000043 L 387.0299999999999 403.5500000000004 L 387.6599999999999 403.5800000000004 L 388.19999999999993 403.2600000000004 L 388.86999999999995 402.3200000000004 L 389.28 401.1900000000004 L 389.53999999999996 401.0000000000004 L 390.09 401.0500000000004 L 390.45 401.4400000000004 L 390.7 402.4000000000004 L 390.71 405.18000000000035 L 391.90999999999997 405.7100000000003 L 392.32 405.26000000000033 L 392.05 402.7200000000003 L 392.54 401.5300000000003 L 392.99 401.0500000000003 L 401.17 400.3800000000003 L 402.18 399.1300000000003 L 403.68 400.59000000000026 L 404.8 401.02000000000027 L 407.58 400.33000000000027 L 408.02 399.34000000000026 L 407.82 398.8800000000003 L 408.13 398.27000000000027 L 410.51 398.16000000000025 L 412.17 398.9400000000002 L 413.02000000000004 398.30000000000024 L 414.33000000000004 398.0100000000002 L 417.59000000000003 401.36000000000024 L 417.79 402.40000000000026 L 417.22 403.41000000000025 L 416.93 405.78000000000026 L 417.51 406.39000000000027 L 419.4 407.60000000000025 L 419.79999999999995 409.15000000000026 L 419.73999999999995 409.71000000000026 L 418.21999999999997 411.74000000000024 L 418.03999999999996 413.68000000000023 L 418.83 414.42000000000024 L 419.14 415.03000000000026 L 419.51 417.24000000000024 L 420.81 419.04000000000025 L 421.64 421.03000000000026 L 421.61 421.8800000000003 L 423.22 421.83000000000027 L 424 421.52000000000027 L 424.28 421.16000000000025 L 425.28 421.11000000000024 L 428.97999999999996 422.43000000000023 L 429.21 422.80000000000024 L 429.15999999999997 424.0700000000002 L 428.46 426.2500000000002 L 426.59999999999997 428.97000000000025 L 426.85999999999996 431.91000000000025 L 426.66999999999996 435.36000000000024 L 426.14 436.92000000000024 L 426.86 438.52000000000027 L 428.64 439.7600000000003 L 430.45 440.59000000000026 L 430.96 442.3100000000003 L 429.75 443.0100000000003 L 431.77 446.3200000000003 L 432.9 446.5700000000003 L 434.90999999999997 446.33000000000027 L 435.09 446.86000000000024 L 438.71 445.86000000000024 L 439.27 446.28000000000026 L 440.58 445.96000000000026 L 441.33 444.98000000000025 L 441.38 444.14000000000027 L 441.14 443.90000000000026 L 441.31 441.60000000000025 L 442.5 441.27000000000027 L 442.59 441.6200000000003 L 442.23999999999995 442.1100000000003 L 442.24999999999994 442.5900000000003 L 444.5899999999999 442.6700000000003 L 446.9799999999999 442.4200000000003 L 448.7699999999999 441.7500000000003 L 449.99999999999994 440.5100000000003 L 451.92999999999995 439.4900000000003 L 454.13999999999993 439.27000000000027 L 455.37999999999994 438.54000000000025 L 455.37999999999994 438.54000000000025 L 456.6499999999999 439.08000000000027 L 457.2099999999999 440.2500000000003 L 458.43999999999994 441.84000000000026 L 460.2099999999999 442.23000000000025 L 463.3599999999999 441.7000000000003 L 465.0599999999999 441.71000000000026 L 465.8099999999999 443.35000000000025 L 464.1599999999999 445.5000000000002 L 462.6599999999999 446.2100000000002 L 459.88999999999993 446.5700000000002 L 459.38999999999993 446.42000000000024 L 457.0399999999999 447.43000000000023 L 455.94999999999993 448.5800000000002 L 454.85999999999996 452.0800000000002 L 454.90999999999997 452.49000000000024 L 456.53999999999996 454.22000000000025 L 457.02 454.48000000000025 L 457.02 454.48000000000025 L 456.96 454.68000000000023 L 455.27 455.10000000000025 L 454.21 454.28000000000026 L 452.72999999999996 455.39000000000027 L 452.29999999999995 456.04000000000025 L 452.56999999999994 456.2600000000003 L 451.80999999999995 456.90000000000026 L 448.5899999999999 458.4500000000003 L 446.3399999999999 459.15000000000026 L 446.05999999999995 459.59000000000026 L 446.09999999999997 460.55000000000024 L 446.59999999999997 462.10000000000025 L 446.28 462.52000000000027 L 444.88 462.78000000000026 L 444.18 462.14000000000027 L 442.84000000000003 461.85000000000025 L 439.72 461.35000000000025 L 438.86 461.5000000000002 L 437.54 461.8400000000002 L 435.81 462.6600000000002 L 435.31 463.1700000000002 L 434.1 465.32000000000016 L 432.79 465.89000000000016 L 432.29 465.77000000000015 L 432.87 465.3000000000001 L 432.39 464.0800000000001 L 431.21999999999997 463.2300000000001 L 430.39 464.4600000000001 L 430.65 465.2100000000001 L 430.34999999999997 465.8200000000001 L 422.72999999999996 470.0600000000001 L 421.78 470.8800000000001 L 421.46999999999997 472.04000000000013 L 418.2 475.04000000000013 L 414.95 476.9900000000001 L 413.03 477.5200000000001 L 408.53 480.7300000000001 L 406.2 482.69000000000005 L 405.53 482.77000000000004 L 405.09 483.39000000000004 L 405.98999999999995 483.82000000000005 L 406.65 483.88000000000005 L 407.58 483.52000000000004 L 407.58 484.28000000000003 L 406.96 485.59000000000003 L 405.64 486.44000000000005 L 404.58 487.92 z M 448.89 464.91 L 447.34999999999997 464.26000000000005 L 446.18999999999994 464.44000000000005 L 445.69999999999993 464.06000000000006 L 445.79999999999995 463.2800000000001 L 446.74999999999994 462.6300000000001 L 447.8399999999999 460.7800000000001 L 448.55999999999995 461.0300000000001 L 449.21999999999997 461.68000000000006 L 449.34999999999997 464.5900000000001 L 448.89 464.91 z"},{code:"TO",name:"Tocantins",gTransform:"matrix(1 0 0 1 95.98 -93.17)",pathTransform:"translate(-401.98, -226.09)",d:"M 433.35 281.82 L 427.99 283.24 L 426.25 284.58 L 423.69 285.68 L 422.14 285.68 L 417.61 286.68 L 415.09 288.76 L 413.31 289.66 L 412.85 289.42 L 411.34 286.8 L 410.79 286.77 L 410.28 290.07 L 409.59 290.15 L 406.24 289.47 L 403.11 288 L 403.67 286.44 L 403.45 285.7 L 398.92 286.23 L 396.16 285.89 L 395.6 286.43 L 395.3 287.43 L 394.55 288.18 L 393.41 288.13 L 392.8 285.03 L 391.69 281.32 L 390.65 279.44 L 389.5 278.13 L 388.32 279.1 L 386.85 281.49 L 385.22 287.43 L 384.59 287.66 L 380.52 286.23 L 377.43 284.52 L 373.5 284.12 L 371.3 283.09 L 368.9 282.69 L 369.42 280.35 L 370.64 278.47 L 370.67 276.76 L 370.11 277.06 L 368.3 279.15 L 367.64 280.38 L 367.44 282.26 L 367.1 282.71 L 367.1 282.71 L 366.3 282.69 L 365.34 282.18 L 364.36 278.84 L 365.1 276.08 L 364.66 273.03 L 364.14 272.45 L 364.13 270.88 L 364.6 267.57 L 363.5 265.32 L 363.55 264.82 L 364.37 263.93 L 364.53 263.06 L 363.14 261.72 L 363.08 260.86 L 364.96 254.87 L 365 251.92 L 365.54 248.95 L 367.48 243.66 L 367.85 243.39 L 368.28 242.54 L 368.72 239.4 L 369.82 238.15 L 370.38 236.26 L 371.03 235.24 L 371.03 235.24 L 372.65 231.55 L 373.78 227.1 L 374.93 225.52 L 376.12 224.42 L 377.33 222.74 L 378.36 220.82 L 379.73 219.9 L 380.78 219.74 L 381.51 218.89 L 382.45 217.35 L 382.63 216.36 L 384.33 213.12 L 385.42 212.32 L 387.18 207.17 L 387.84 203.13 L 387.69 202.83 L 386.95 202.51 L 385.28 200.77 L 384.68 199.82 L 384.52 198.94 L 384.66 198.37 L 386.07 196.68 L 387.36 194.58 L 387.3 191.91 L 386.87 189.73 L 387.06 189.38 L 389.53 187.6 L 392.94 186.46 L 395.44 185.25 L 395.68 184.75 L 395.53 183.24 L 396.39 181.97 L 397.9 180.63 L 399.19 180.48 L 399.38 179.14 L 399.09 177.94 L 399.34 177.48 L 400.8 177.02 L 401.44 176.54 L 402.37 173.79 L 401.35 172.45 L 401.26 171.05 L 401.55 170.77 L 402.52 170.69 L 403.24 170.32 L 403.61 169.66 L 403.64 169.02 L 402.38 167.85 L 401.51 167.71 L 401.12 167.4 L 400.1 165.74 L 398.81 165.62 L 396.94 165.87 L 394.65 165.06 L 394.65 165.06 L 395.18 164.42 L 397.8 162.57 L 399.76 162.04 L 400.63 162.09 L 403.41 163.61 L 404.81 163.69 L 405.76 163.17 L 407.5 163.46 L 408.09 164.15 L 408.17 165.18 L 408.45 165.5 L 409.67 165.53 L 413.07 166.96 L 413.91 167.99 L 414.38 171.49 L 415.02 172.99 L 414.81 176.71 L 415.04 177.79 L 415.71 178.92 L 415.7 179.36 L 413.93 185.51 L 413.62 187.88 L 413.9 188.88 L 413.65 190.47 L 411.9 192.51 L 410.14 193.18 L 409.96 193.89 L 411.9 195.21 L 412.32 194.94 L 413.69 195.18 L 413.94 195.53 L 414.05 196.41 L 413.43 197.6 L 414.28 199.04 L 415.16 198.97 L 418.16 203.13 L 419.07 203.98 L 421.35 207 L 423.49 205.66 L 427.76 204.72 L 429.56 205.94 L 429.64 207.69 L 429 210.94 L 429.39 212.29 L 426 212.64 L 424.66 213.18 L 424.09 213.73 L 423.41 215.16 L 422.68 217.84 L 423.05 219.14 L 420.42 221.69 L 420.16 222.39 L 420.36 222.81 L 422.44 223.1 L 423.38 223.79 L 424.12 225.38 L 424.18 227.04 L 424.8 228.08 L 428.68 230.03 L 428.77 230.56 L 427.13 232.37 L 427.26 234.02 L 429.4 235.64 L 430.39 238.51 L 431.73 240.51 L 432.44 240.69 L 434.22 240.48 L 435.22 240.78 L 436.04 241.22 L 436.65 242.04 L 437.93 242.7 L 437.93 242.7 L 440.87 242.91 L 440.87 242.91 L 440.18 243.56 L 439.96 244.54 L 439.4 245.01 L 435.58 247.03 L 432.37 249.65 L 432.18 250.02 L 433.47 251.82 L 433.11 252.21 L 432.1 252.48 L 431.2 253.09 L 429.68 256.58 L 428.67 257.3 L 428.17 258.46 L 428.4 259.38 L 430.26 261.33 L 433.85 262 L 435.72 262.99 L 435.77 263.75 L 435.21 264.2 L 433.17 265.01 L 432.74 265.97 L 432.83 266.47 L 433.18 266.8 L 434.21 266.62 L 435.13 266.91 L 435.71 267.42 L 436 268.06 L 435.04 268.77 L 433.89 269.19 L 431.94 270.86 L 431.75 271.71 L 431.7 274.63 L 432.05 275.88 L 432.99 276.54 L 434.04 276.78 L 434.45 277.03 L 434.62 277.45 L 434.67 278.51 L 433.31 280.89 z"}];function xL({selected:t,onSelect:e}){const[s,i]=M.useState(LL),r=o=>{if(o)try{const a=o.getBBox();if(!a.width||!a.height)return;const l=Math.max(a.width,a.height)*.04,d=`${a.x-l} ${a.y-l} ${a.width+l*2} ${a.height+l*2}`;i(c=>c===d?c:d)}catch{}};return n.jsx("svg",{ref:r,viewBox:s,role:"group","aria-label":"Map of Brazil — select a state",className:"h-72 w-full rounded-md border border-border/60 bg-muted/20",children:n.jsx("g",{transform:vL,children:p9.map(o=>{const a=o.code===t;return n.jsx("g",{transform:o.gTransform,children:n.jsx("path",{d:o.d,transform:o.pathTransform,role:"button",tabIndex:0,"aria-label":o.name,"aria-pressed":a,onClick:()=>e(o.code),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),e(o.code))},className:le("cursor-pointer stroke-background outline-none transition-colors [stroke-width:1] [vector-effect:non-scaling-stroke]","hover:fill-primary/50 focus-visible:fill-primary/50",a?"fill-primary":"fill-muted-foreground/40")})},o.code)})})})}const yL=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Åland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua & Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia & Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"VG",name:"British Virgin Islands"},{code:"BN",name:"Brunei"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"BQ",name:"Caribbean Netherlands"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"IO",name:"Chagos Archipelago"},{code:"CL",name:"Chile"},{code:"CN",name:"China mainland"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo - Brazzaville"},{code:"CD",name:"Congo - Kinshasa"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Côte d’Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CW",name:"Curaçao"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czechia"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"SZ",name:"Eswatini"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard & McDonald Islands"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia"},{code:"MD",name:"Moldova"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar (Burma)"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"KP",name:"North Korea"},{code:"MK",name:"North Macedonia"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PS",name:"Palestinian Territories"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn Islands"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Réunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"São Tomé & Príncipe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"GS",name:"So. Georgia & So. Sandwich Isl."},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"KR",name:"South Korea"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"BL",name:"St. Barthélemy"},{code:"SH",name:"St. Helena"},{code:"KN",name:"St. Kitts & Nevis"},{code:"LC",name:"St. Lucia"},{code:"MF",name:"St. Martin"},{code:"PM",name:"St. Pierre & Miquelon"},{code:"VC",name:"St. Vincent & Grenadines"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard & Jan Mayen"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"T1",name:"Tor network (Cloudflare)"},{code:"TT",name:"Trinidad & Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Türkiye"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks & Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UM",name:"U.S. Outlying Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"XX",name:"Unknown (Cloudflare could not determine)"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VA",name:"Vatican City"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"WF",name:"Wallis & Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}],bL="BR";function SL(t){if(!t)return!1;const e=Object.keys(t).sort();return e.length===3&&e[0]==="city"&&e[1]==="country"&&e[2]==="regionCode"}function wL(t){const e=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return{city:typeof e.city=="string"?e.city:"",regionCode:typeof e.regionCode=="string"?e.regionCode:"",country:typeof e.country=="string"?e.country:""}}function CL(t,e){const s={...t,...e},i={};for(const r of["city","regionCode","country"])s[r]&&(i[r]=s[r]);return i}function Ec(t){const e=F.c(37),{id:s,options:i,value:r,placeholder:o,emptyMessage:a,onChange:l}=t,[d,c]=M.useState(!1);let h;if(e[0]!==i||e[1]!==r){let w;e[3]!==r?(w=C=>C.value===r,e[3]=r,e[4]=w):w=e[4],h=i.find(w),e[0]=i,e[1]=r,e[2]=h}else h=e[2];const u=h;let f;e[5]!==o||e[6]!==u?(f=u?n.jsx("span",{className:"truncate",children:u.label}):n.jsx("span",{className:"text-muted-foreground",children:o}),e[5]=o,e[6]=u,e[7]=f):f=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Qd,{className:"size-4 shrink-0 opacity-50"}),e[8]=m):m=e[8];let p;e[9]!==s||e[10]!==d||e[11]!==f?(p=n.jsx(Ss,{asChild:!0,children:n.jsxs(ie,{id:s,variant:"outline",role:"combobox","aria-expanded":d,className:"h-10 w-full justify-between font-normal",children:[f,m]})}),e[9]=s,e[10]=d,e[11]=f,e[12]=p):p=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={width:"var(--radix-popover-trigger-width)"},e[13]=_):_=e[13];let L;e[14]!==o?(L=n.jsx(po,{placeholder:o,className:"h-9"}),e[14]=o,e[15]=L):L=e[15];let v;e[16]!==a?(v=n.jsx(go,{children:a}),e[16]=a,e[17]=v):v=e[17];let x;if(e[18]!==l||e[19]!==i||e[20]!==r){let w;e[22]!==l||e[23]!==r?(w=C=>n.jsxs(On,{value:`${C.label} ${C.value}`,onSelect:()=>{l(C.value===r?"":C.value),c(!1)},children:[n.jsx("span",{className:"truncate",children:C.label}),n.jsx(Ls,{className:le("ml-auto size-4 shrink-0",r===C.value?"opacity-100":"opacity-0")})]},C.value),e[22]=l,e[23]=r,e[24]=w):w=e[24],x=i.map(w),e[18]=l,e[19]=i,e[20]=r,e[21]=x}else x=e[21];let g;e[25]!==x?(g=n.jsx($n,{children:x}),e[25]=x,e[26]=g):g=e[26];let y;e[27]!==v||e[28]!==g?(y=n.jsxs(_o,{children:[v,g]}),e[27]=v,e[28]=g,e[29]=y):y=e[29];let b;e[30]!==y||e[31]!==L?(b=n.jsx(ws,{className:"p-0",style:_,children:n.jsxs(Pl,{children:[L,y]})}),e[30]=y,e[31]=L,e[32]=b):b=e[32];let S;return e[33]!==d||e[34]!==b||e[35]!==p?(S=n.jsxs(bs,{open:d,onOpenChange:c,children:[p,b]}),e[33]=d,e[34]=b,e[35]=p,e[36]=S):S=e[36],S}const kL=yL.map(t=>({value:t.code,label:`${t.name} (${t.code})`})),jL=p9.map(t=>({value:t.code,label:`${t.name} (${t.code})`}));function Ru(t){const e=F.c(49),{schema:s,value:i,onChange:r,path:o}=t;let a;e[0]!==i?(a=wL(i),e[0]=i,e[1]=a):a=e[1];const l=a,{city:d,regionCode:c,country:h}=l;let u;e[2]!==s.properties?(u=s.properties??{},e[2]=s.properties,e[3]=u):u=e[3];const f=u,m=f.country?.title??"Country",p=f.regionCode?.title??"Region",_=f.city?.title??"City";let L;e[4]!==l||e[5]!==r?(L=O=>{r(CL(l,O))},e[4]=l,e[5]=r,e[6]=L):L=e[6];const v=L,x=h===bL;let g;e[7]!==c?(g=p9.find(O=>O.code===c),e[7]=c,e[8]=g):g=e[8];const y=g,b=`${o}.country`,S=s.title??"Location";let w;e[9]!==b||e[10]!==S?(w=n.jsx($e,{htmlFor:b,children:S}),e[9]=b,e[10]=S,e[11]=w):w=e[11];let C;e[12]!==s.description?(C=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[12]=s.description,e[13]=C):C=e[13];let N;e[14]!==w||e[15]!==C?(N=n.jsxs("div",{className:"space-y-0.5",children:[w,C]}),e[14]=w,e[15]=C,e[16]=N):N=e[16];const T=`${o}.country`;let A;e[17]!==m||e[18]!==T?(A=n.jsx($e,{htmlFor:T,className:"text-xs",children:m}),e[17]=m,e[18]=T,e[19]=A):A=e[19];const j=`${o}.country`;let k;e[20]!==v?(k=O=>v({country:O,regionCode:"",city:""}),e[20]=v,e[21]=k):k=e[21];let I;e[22]!==h||e[23]!==j||e[24]!==k?(I=n.jsx(Ec,{id:j,options:kL,value:h,placeholder:"Select a country…",emptyMessage:"No country found.",onChange:k}),e[22]=h,e[23]=j,e[24]=k,e[25]=I):I=e[25];let E;e[26]!==A||e[27]!==I?(E=n.jsxs("div",{className:"space-y-1.5",children:[A,I]}),e[26]=A,e[27]=I,e[28]=E):E=e[28];let R;e[29]!==h||e[30]!==v||e[31]!==x||e[32]!==o||e[33]!==c||e[34]!==p?(R=h&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx($e,{htmlFor:`${o}.regionCode`,className:"text-xs",children:p}),x?n.jsxs("div",{className:"space-y-2",children:[n.jsx(xL,{selected:c,onSelect:O=>v({regionCode:O===c?"":O,city:""})}),n.jsx(Ec,{id:`${o}.regionCode`,options:jL,value:c,placeholder:"Select a state…",emptyMessage:"No state found.",onChange:O=>v({regionCode:O,city:""})})]}):n.jsxs(n.Fragment,{children:[n.jsx(ze,{id:`${o}.regionCode`,type:"text",value:c,placeholder:"e.g. SP",onChange:O=>v({regionCode:O.target.value})}),n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:"ISO 3166-2 subdivision code from cf-region-code."})]})]}),e[29]=h,e[30]=v,e[31]=x,e[32]=o,e[33]=c,e[34]=p,e[35]=R):R=e[35];let P;e[36]!==d||e[37]!==_||e[38]!==h||e[39]!==v||e[40]!==x||e[41]!==o||e[42]!==y?(P=h&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx($e,{htmlFor:`${o}.city`,className:"text-xs",children:_}),n.jsx(ze,{id:`${o}.city`,type:"text",value:d,placeholder:x&&y?`e.g. a city in ${y.name}`:"e.g. Sao Paulo",onChange:O=>v({city:O.target.value})}),n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:"Matched exactly against cf-ipcity."})]}),e[36]=d,e[37]=_,e[38]=h,e[39]=v,e[40]=x,e[41]=o,e[42]=y,e[43]=P):P=e[43];let D;return e[44]!==E||e[45]!==R||e[46]!==P||e[47]!==N?(D=n.jsxs("div",{className:"space-y-4",children:[N,E,R,P]}),e[44]=E,e[45]=R,e[46]=P,e[47]=N,e[48]=D):D=e[48],D}function NL(t){const e=t.schema;if(!e?.properties)return null;const s=new Set(Object.keys(t.discriminators??{}));if(s.size===0)return e;const i={};for(const[r,o]of Object.entries(e.properties))s.has(r)||(i[r]=o);return{...e,properties:i}}function EL(t){const e=F.c(46),{schema:s,value:i,onChange:r,path:o,label:a}=t;let l,d;e[0]!==s.inlineUnionBranches||e[1]!==i?(l=s.inlineUnionBranches??[],d=gL(i,l.map(AL)),e[0]=s.inlineUnionBranches,e[1]=i,e[2]=l,e[3]=d):(l=e[2],d=e[3]);const c=d,[h,u]=M.useState(c),[f,m]=M.useState(c);f!==c&&(m(c),u(c));const p=Math.min(h,l.length-1),_=l[p];let L;e[4]!==l||e[5]!==r?(L=P=>{const D=Number(P);u(D),r({...l[D]?.discriminators??{}})},e[4]=l,e[5]=r,e[6]=L):L=e[6];const v=L;if(l.length===0)return null;let x;e[7]!==_?(x=_?NL(_):null,e[7]=_,e[8]=x):x=e[8];const g=x;let y;if(e[9]!==_?.schema?.properties||e[10]!==i){let P;e[12]!==_?.schema?.properties?(P=_?.schema?.properties??{},e[12]=_?.schema?.properties,e[13]=P):P=e[13],y=_L(i,Object.keys(P)),e[9]=_?.schema?.properties,e[10]=i,e[11]=y}else y=e[11];const b=y;let S;e[14]!==a||e[15]!==o?(S=n.jsx($e,{htmlFor:o,children:a}),e[14]=a,e[15]=o,e[16]=S):S=e[16];const w=String(p);let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Et,{placeholder:"Select..."}),e[17]=C):C=e[17];let N;e[18]!==o?(N=n.jsx(Ct,{id:o,children:C}),e[18]=o,e[19]=N):N=e[19];let T;e[20]!==l?(T=l.map(TL),e[20]=l,e[21]=T):T=e[21];let A;e[22]!==T?(A=n.jsx(kt,{children:T}),e[22]=T,e[23]=A):A=e[23];let j;e[24]!==v||e[25]!==w||e[26]!==N||e[27]!==A?(j=n.jsxs(jt,{value:w,onValueChange:v,children:[N,A]}),e[24]=v,e[25]=w,e[26]=N,e[27]=A,e[28]=j):j=e[28];let k;e[29]!==s.description?(k=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[29]=s.description,e[30]=k):k=e[30];let I;e[31]!==j||e[32]!==k||e[33]!==S?(I=n.jsxs("div",{className:"space-y-1.5",children:[S,j,k]}),e[31]=j,e[32]=k,e[33]=S,e[34]=I):I=e[34];let E;e[35]!==_||e[36]!==g||e[37]!==r||e[38]!==o||e[39]!==b||e[40]!==t||e[41]!==i?(E=_&&(SL(_.schema?.properties)?n.jsx(Ru,{...t,schema:_.schema,onChange:P=>r({...b,...P,..._.discriminators??{}})}):g?n.jsx(vi,{schema:g,value:i,onChange:P=>r({...P,..._.discriminators??{}}),basePath:o,breadcrumbPath:t.breadcrumbPath,onBreadcrumbChange:t.onBreadcrumbChange,meta:t.meta,decofile:t.decofile,onSaveReferencedBlock:t.onSaveReferencedBlock,sandbox:t.sandbox,previewBaseUrl:t.previewBaseUrl,onAddSectionItem:t.onAddSectionItem,onRequestAddSection:t.onRequestAddSection}):null),e[35]=_,e[36]=g,e[37]=r,e[38]=o,e[39]=b,e[40]=t,e[41]=i,e[42]=E):E=e[42];let R;return e[43]!==I||e[44]!==E?(R=n.jsxs("div",{className:"space-y-3",children:[I,E]}),e[43]=I,e[44]=E,e[45]=R):R=e[45],R}function TL(t,e){return n.jsx(et,{value:String(e),children:t.title},t.title)}function AL(t){return{discriminators:t.discriminators,propertyKeys:Object.keys(t.schema?.properties??{})}}const RL={lat:-21.9,lng:-41.42},Ca=1e5;let fr=null;function PL(t){return fr||(fr=new Promise((e,s)=>{if(typeof window>"u"){s(new Error("Google Maps requires a browser environment"));return}const i=window;if(i.google?.maps){e(i.google.maps);return}const r=()=>{const l=window.google?.maps;l?e(l):s(new Error("Google Maps script loaded without google.maps"))},o=document.querySelector("script[data-google-maps-loader]");if(o){o.addEventListener("load",r),o.addEventListener("error",()=>s(new Error("Failed to load Google Maps")));return}const a=document.createElement("script");a.src=`https://maps.googleapis.com/maps/api/js?key=${t}&v=weekly&libraries=maps`,a.async=!0,a.defer=!0,a.dataset.googleMapsLoader="true",a.addEventListener("load",r),a.addEventListener("error",()=>s(new Error("Failed to load Google Maps"))),document.head.appendChild(a)}),fr)}function DL(t){if(typeof t!="string"||!t)return null;const e=t.split(",").map(Number),[s,i,r]=e;return!Number.isFinite(s)||!Number.isFinite(i)?null:{lat:s,lng:i,radius:Number.isFinite(r)?r:Ca}}function IL({schema:t,value:e,onChange:s,path:i,label:r}){const o=gf().googleMapsApiKey,a=M.useRef(s);a.current=s;const l=M.useRef(DL(e)),[d,c]=M.useState(null),h=M.useRef(null),u=f=>{if(!f||!o)return;const m={disposed:!1,circle:null,listeners:[]};return PL(o).then(p=>{if(m.disposed)return;const _=l.current,L=_?{lat:_.lat,lng:_.lng}:RL,v=_?.radius??Ca,x=new p.Map(f,{center:L,zoom:v?Math.round(Math.log2(768e4/v))+1:4,draggable:!0,streetViewControl:!1,mapTypeControl:!1}),g=new p.Circle({strokeColor:"#2E6ED9",strokeOpacity:.8,strokeWeight:2,fillColor:"#2E6ED9",fillOpacity:.35,editable:!0,draggable:!0,map:x,center:L,radius:v});m.circle=g;const y=()=>{const S=g.getCenter(),w=g.getRadius();S&&a.current(`${S.lat()},${S.lng()},${w}`)},b=S=>{S&&m.listeners.push(S)};b(x.addListener("click",S=>{S.latLng&&(g.setCenter({lat:S.latLng.lat(),lng:S.latLng.lng()}),g.getRadius()||g.setRadius(Ca),y())})),b(g.addListener("radius_changed",y)),b(g.addListener("dragend",y))},p=>{m.disposed||c(p instanceof Error?p.message:"Failed to load map")}),()=>{m.disposed=!0;for(const p of m.listeners)try{p?.remove()}catch{}if(m.listeners=[],m.circle){try{m.circle.setMap(null)}catch{}m.circle=null}}};return h.current||(h.current=u),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"space-y-0.5",children:[n.jsx($e,{htmlFor:i,children:r}),t.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:t.description})]}),o?d?n.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:d}):n.jsx("div",{ref:h.current,id:i,className:"h-72 w-full rounded-md border border-border/60"}):n.jsxs("div",{className:"rounded-md border border-border/60 bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:["The map picker is unavailable — set"," ",n.jsx("code",{className:"font-mono",children:"GOOGLE_MAPS_API_KEY"})," on the server to enable it."]})]})}const ML="oklch(0.65 0.15 160)",BL="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)]",Pu="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]",dk="text-[oklch(0.45_0.15_160)] focus:bg-[oklch(0.65_0.15_160/0.12)] focus:text-[oklch(0.45_0.15_160)] dark:text-[oklch(0.78_0.15_160)] dark:focus:bg-[oklch(0.65_0.15_160/0.15)] dark:focus:text-[oklch(0.78_0.15_160)]";function Tc(t){return t.map(e=>e.label).join(`
|
|
467
|
-
`)}function Uo(t){return t.map(e=>({id:crypto.randomUUID(),index:e.index,label:e.label}))}function OL(t){return t.map((e,s)=>({...e,index:s}))}function Du(t){const e=F.c(17),{label:s,canDelete:i,dragging:r,onDuplicate:o,onDelete:a}=t,l=r?"opacity-100":"opacity-0 group-hover:opacity-100";let d;e[0]!==l?(d=le("h-4 w-4 shrink-0 text-muted-foreground/40 transition-opacity",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==d?(c=n.jsx(Cl,{className:d}),e[2]=d,e[3]=c):c=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Ti,{className:"h-4 w-4 shrink-0",style:{color:ML}}),e[4]=h):h=e[4];let u;e[5]!==s?(u=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:s}),e[5]=s,e[6]=u):u=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==s||e[10]!==a||e[11]!==o?(f=!r&&n.jsxs(Qt,{children:[n.jsx(es,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":`Open actions for ${s}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:zL,onPointerDown:$L,children:n.jsx(Vi,{size:14})})}),n.jsxs(ts,{align:"end",children:[n.jsxs(We,{onClick:p=>{p.stopPropagation(),o?.()},children:[n.jsx(Xt,{size:14}),"Duplicate"]}),n.jsxs(We,{variant:"destructive",disabled:!i,onClick:p=>{p.stopPropagation(),a?.()},children:[n.jsx(ss,{size:14}),"Delete"]})]})]}),e[7]=i,e[8]=r,e[9]=s,e[10]=a,e[11]=o,e[12]=f):f=e[12];let m;return e[13]!==c||e[14]!==u||e[15]!==f?(m=n.jsxs(n.Fragment,{children:[c,h,u,f]}),e[13]=c,e[14]=u,e[15]=f,e[16]=m):m=e[16],m}function $L(t){return t.stopPropagation()}function zL(t){return t.stopPropagation()}function FL(t){const e=F.c(26),{entry:s,selected:i,canDelete:r,onSelect:o,onDuplicate:a,onDelete:l}=t;let d;e[0]!==s.id?(d={id:s.id,animateLayoutChanges:HL},e[0]=s.id,e[1]=d):d=e[1];const{attributes:c,listeners:h,setNodeRef:u,transform:f,isDragging:m}=vd(d);let p;e[2]!==f?(p=xd.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=p):p=e[3];const _=m?0:void 0;let L;e[4]!==p||e[5]!==_?(L={transform:p,opacity:_},e[4]=p,e[5]=_,e[6]=L):L=e[6];const v=L;let x;e[7]!==o?(x=C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),o())},e[7]=o,e[8]=x):x=e[8];const g=m?"cursor-grabbing":"cursor-grab",y=i?Pu:BL;let b;e[9]!==g||e[10]!==y?(b=le("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",g,y),e[9]=g,e[10]=y,e[11]=b):b=e[11];let S;e[12]!==r||e[13]!==s.label||e[14]!==l||e[15]!==a?(S=n.jsx(Du,{label:s.label,canDelete:r,onDuplicate:a,onDelete:l}),e[12]=r,e[13]=s.label,e[14]=l,e[15]=a,e[16]=S):S=e[16];let w;return e[17]!==c||e[18]!==h||e[19]!==o||e[20]!==u||e[21]!==v||e[22]!==x||e[23]!==b||e[24]!==S?(w=n.jsx("div",{ref:u,style:v,...c,...h,onClick:o,onKeyDown:x,className:b,children:S}),e[17]=c,e[18]=h,e[19]=o,e[20]=u,e[21]=v,e[22]=x,e[23]=b,e[24]=S,e[25]=w):w=e[25],w}function HL(){return!1}function UL(t){const e=F.c(81),{listKey:s,variants:i,selectedIndex:r,onSelect:o,onDuplicate:a,onDelete:l,onRemoveAll:d,onReorder:c,onAdd:h}=t,u=i.length>1;let f;e[0]!==i?(f=()=>Uo(i),e[0]=i,e[1]=f):f=e[1];const[m,p]=M.useState(f),[_,L]=M.useState(null),[v,x]=M.useState(s),[g,y]=M.useState(i.length);let b;e[2]!==i?(b=()=>Tc(i),e[2]=i,e[3]=b):b=e[3];const[S,w]=M.useState(b),C=M.useRef(!1),N=Tc(i);v!==s?(x(s),y(i.length),w(N),p(Uo(i))):g!==i.length?(y(i.length),w(N),p(Uo(i))):S!==N&&(w(N),p(oe=>i.map((he,xe)=>({id:oe[xe]?.id??crypto.randomUUID(),index:he.index,label:he.label}))));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A={coordinateGetter:yd},e[5]=A):A=e[5];const j=hd(Ar(fd,T),Ar(ud,A));let k;e[6]!==m?(k=m.map(WL),e[6]=m,e[7]=k):k=e[7];const I=k;let E;e[8]!==m?(E=oe=>{const he=String(oe.active.id);L(m.find(xe=>xe.id===he)??null)},e[8]=m,e[9]=E):E=e[9];const R=E;let P;e[10]!==I||e[11]!==c?(P=oe=>{L(null);const{active:he,over:xe}=oe;if(!xe||he.id===xe.id)return;const ve=I.indexOf(String(he.id)),be=I.indexOf(String(xe.id));ve===-1||be===-1||(p(De=>OL(ha([...De],ve,be))),C.current=!0,requestAnimationFrame(()=>{C.current=!1}),c(ve,be))},e[10]=I,e[11]=c,e[12]=P):P=e[12];const D=P;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{L(null)},e[13]=O):O=e[13];const $=O;let K,z,U,G,q,W,H,Z,J,B,X,V,ee;if(e[14]!==u||e[15]!==m||e[16]!==I||e[17]!==D||e[18]!==R||e[19]!==h||e[20]!==l||e[21]!==a||e[22]!==d||e[23]!==o||e[24]!==r||e[25]!==j){const oe=ge=>{C.current||o(ge)};X="space-y-1 border-b p-2";let he;e[39]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[39]=he):he=e[39];let xe;e[40]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx(Dt,{size:14}),e[40]=xe):xe=e[40];let ve;e[41]!==h?(ve=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:h,children:xe})}),e[41]=h,e[42]=ve):ve=e[42];let be;e[43]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx(Te,{children:"Add variant"}),e[43]=be):be=e[43];let De;e[44]!==ve?(De=n.jsxs(Ae,{children:[ve,be]}),e[44]=ve,e[45]=De):De=e[45];let Ie;e[46]===Symbol.for("react.memo_cache_sentinel")?(Ie=n.jsx(ss,{size:14}),e[46]=Ie):Ie=e[46];let Me;e[47]!==d?(Me=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove all variants",className:"size-6 text-muted-foreground hover:text-destructive",onClick:d,children:Ie})}),e[47]=d,e[48]=Me):Me=e[48];let He;e[49]===Symbol.for("react.memo_cache_sentinel")?(He=n.jsx(Te,{children:"Remove all variants"}),e[49]=He):He=e[49];let Je;e[50]!==Me?(Je=n.jsxs(Ae,{children:[Me,He]}),e[50]=Me,e[51]=Je):Je=e[51],e[52]!==De||e[53]!==Je?(V=n.jsxs("div",{className:"flex items-center justify-between",children:[he,n.jsxs("div",{className:"flex items-center gap-0.5",children:[De,Je]})]}),e[52]=De,e[53]=Je,e[54]=V):V=e[54],z=md,W=j,H=pd,Z=R,J=D,B=$,K=gd,G=I,q=_d,ee="space-y-0.5",U=m.map(ge=>n.jsx(FL,{entry:ge,selected:ge.index===r,canDelete:u,onSelect:()=>oe(ge.index),onDuplicate:()=>a(ge.index),onDelete:()=>l(ge.index)},ge.id)),e[14]=u,e[15]=m,e[16]=I,e[17]=D,e[18]=R,e[19]=h,e[20]=l,e[21]=a,e[22]=d,e[23]=o,e[24]=r,e[25]=j,e[26]=K,e[27]=z,e[28]=U,e[29]=G,e[30]=q,e[31]=W,e[32]=H,e[33]=Z,e[34]=J,e[35]=B,e[36]=X,e[37]=V,e[38]=ee}else K=e[26],z=e[27],U=e[28],G=e[29],q=e[30],W=e[31],H=e[32],Z=e[33],J=e[34],B=e[35],X=e[36],V=e[37],ee=e[38];let te;e[55]!==U||e[56]!==ee?(te=n.jsx("div",{className:ee,children:U}),e[55]=U,e[56]=ee,e[57]=te):te=e[57];let ae;e[58]!==K||e[59]!==G||e[60]!==q||e[61]!==te?(ae=n.jsx(K,{items:G,strategy:q,children:te}),e[58]=K,e[59]=G,e[60]=q,e[61]=te,e[62]=ae):ae=e[62];let de;e[63]!==_||e[64]!==u?(de=_?n.jsx("div",{className:le("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",Pu),children:n.jsx(Du,{label:_.label,canDelete:u,dragging:!0})}):null,e[63]=_,e[64]=u,e[65]=de):de=e[65];let fe;e[66]!==de?(fe=n.jsx(Ld,{dropAnimation:null,children:de}),e[66]=de,e[67]=fe):fe=e[67];let Q;e[68]!==z||e[69]!==W||e[70]!==H||e[71]!==Z||e[72]!==J||e[73]!==B||e[74]!==ae||e[75]!==fe?(Q=n.jsxs(z,{sensors:W,collisionDetection:H,onDragStart:Z,onDragEnd:J,onDragCancel:B,children:[ae,fe]}),e[68]=z,e[69]=W,e[70]=H,e[71]=Z,e[72]=J,e[73]=B,e[74]=ae,e[75]=fe,e[76]=Q):Q=e[76];let se;return e[77]!==X||e[78]!==V||e[79]!==Q?(se=n.jsxs("div",{className:X,children:[V,Q]}),e[77]=X,e[78]=V,e[79]=Q,e[80]=se):se=e[80],se}function WL(t){return t.id}const VL=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],KL={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Wo(t){return fi(t)!==void 0}function Iu(t,e){if(e){if(Wo(e))return e;const s=KL[e];if(s&&Wo(s))return s}for(const[s,i]of VL)if(s.test(t)&&Wo(i))return i;return"FilterLines"}function qL(t){return fi(t)??zm}function Ac(t){const e=F.c(11),{iconName:s,size:i,className:r}=t,o=i===void 0?"md":i;let a;e[0]!==s?(a=qL(s),e[0]=s,e[1]=a):a=e[1];const l=a,d=o==="sm"?"size-7":"size-9",c=o==="sm"?16:18;let h;e[2]!==d||e[3]!==r?(h=le("flex shrink-0 items-center justify-center rounded-full bg-muted",d,r),e[2]=d,e[3]=r,e[4]=h):h=e[4];let u;e[5]!==l||e[6]!==c?(u=n.jsx(l,{size:c,className:"text-muted-foreground"}),e[5]=l,e[6]=c,e[7]=u):u=e[7];let f;return e[8]!==h||e[9]!==u?(f=n.jsx("div",{className:h,children:u}),e[8]=h,e[9]=u,e[10]=f):f=e[10],f}const Mu="Users03";function GL(t){const e=t.manifest?.blocks??{},s=[];for(const[i,r]of Object.entries(e))if(i.includes("matchers"))for(const o of Object.keys(r)){if(o.includes("always"))continue;const a=_i(o,t);s.push({resolveType:o,title:a.title??mt(o),description:a.description,iconName:Iu(o,a.icon)})}return s}function YL(t,e){if(!t)return Mu;const s=e.find(i=>i.resolveType===t);return s?s.iconName:Iu(t)}function JL(t){const e=F.c(41),{currentRt:s,currentLabel:i,matchers:r,onSelect:o}=t,[a,l]=M.useState(!1);let d;if(e[0]!==s||e[1]!==r){const k=YL(s,r);d=fi(k),e[0]=s,e[1]=r,e[2]=d}else d=e[2];const c=d;let h;e[3]!==o?(h=k=>{o(k),l(!1)},e[3]=o,e[4]=h):h=e[4];const u=h;let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(!0),e[5]=f):f=e[5];let m;e[6]!==c?(m=c&&n.jsx(c,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=c,e[7]=m):m=e[7];let p;e[8]!==i?(p=n.jsx("span",{className:"flex-1 truncate",children:i}),e[8]=i,e[9]=p):p=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ds,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=_):_=e[10];let L;e[11]!==m||e[12]!==p?(L=n.jsxs("button",{type:"button",onClick:f,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[m,p,_]}),e[11]=m,e[12]=p,e[13]=L):L=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(po,{placeholder:"Search rules..."}),e[14]=v):v=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(go,{children:"No rules found."}),e[15]=x):x=e[15];let g;e[16]!==u?(g=()=>u(""),e[16]=u,e[17]=g):g=e[17];const y=!s&&"bg-accent/60";let b;e[18]!==y?(b=le("gap-2.5",y),e[18]=y,e[19]=b):b=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Ac,{iconName:Mu,size:"sm"}),e[20]=S):S=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx("span",{className:"text-sm",children:"Always"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=w):w=e[21];let C;e[22]!==g||e[23]!==b?(C=n.jsxs(On,{value:"always Target all users",onSelect:g,className:b,children:[S,w]}),e[22]=g,e[23]=b,e[24]=C):C=e[24];let N;if(e[25]!==s||e[26]!==u||e[27]!==r){let k;e[29]!==s||e[30]!==u?(k=I=>n.jsxs(On,{value:`${I.title} ${I.resolveType} ${I.description??""}`,onSelect:()=>u(I.resolveType),className:le("gap-2.5",s===I.resolveType&&"bg-accent/60"),children:[n.jsx(Ac,{iconName:I.iconName,size:"sm"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx("span",{className:"text-sm",children:I.title}),I.description&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:I.description})]})]},I.resolveType),e[29]=s,e[30]=u,e[31]=k):k=e[31],N=r.map(k),e[25]=s,e[26]=u,e[27]=r,e[28]=N}else N=e[28];let T;e[32]!==C||e[33]!==N?(T=n.jsxs(_o,{children:[x,n.jsxs($n,{children:[C,N]})]}),e[32]=C,e[33]=N,e[34]=T):T=e[34];let A;e[35]!==a||e[36]!==T?(A=n.jsxs(Bm,{open:a,onOpenChange:l,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[v,T]}),e[35]=a,e[36]=T,e[37]=A):A=e[37];let j;return e[38]!==A||e[39]!==L?(j=n.jsxs(n.Fragment,{children:[L,A]}),e[38]=A,e[39]=L,e[40]=j):j=e[40],j}const XL=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ZL=5,QL=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Rc(t){const{start:e,end:s}=t,i=typeof e=="string"?e:"",r=typeof s=="string"?s:"";if(!i&&!r)return null;const o=d=>{if(!d)return null;const c=new Date(d);return Number.isNaN(c.getTime())?null:QL.format(c)},a=o(i),l=o(r);return a&&l?`${a} → ${l}`:a?`From ${a}`:l?`Until ${l}`:null}function g9(t,e=0){if(!t)return"Default";if(e>ZL)return"...";const s=t.__resolveType??"";if(["website/matchers/always.ts","$live/matchers/MatchAlways.ts"].includes(s)||s==="")return"Default";switch(s){case"website/matchers/never.ts":return"Hidden";case"website/matchers/device.ts":case"$live/matchers/MatchDevice.ts":{const{mobile:r,tablet:o,desktop:a,devices:l=[]}=t,d=[...l];return r&&d.push("Mobile"),o&&d.push("Tablet"),a&&d.push("Desktop"),d.length>0?d.map(XL).join(" & "):mt(s)}case"website/matchers/date.ts":case"$live/matchers/MatchDate.ts":return Rc(t)??mt(s);case"website/matchers/random.ts":case"$live/matchers/MatchRandom.ts":{const{traffic:r}=t;return typeof r=="number"?`${Math.ceil(r*100)}% of sessions`:mt(s)}case"website/matchers/host.ts":case"$live/matchers/MatchHost.ts":{const{includes:r,match:o}=t,a=[];return r&&a.push(r),o&&a.push(o),a.length>0?a.join(" - "):mt(s)}case"website/matchers/pathname.ts":{const r=t.case,{type:o,pathname:a}=r??{};return o&&a?`Pathname ${o} ${a}`:mt(s)}case"website/matchers/location.ts":case"$live/matchers/MatchLocation.ts":{const{includeLocations:r,excludeLocations:o}=t,a=c=>[c.city,c.regionCode,c.country].filter(Boolean).join(" - "),l=r?.[0];if(l){const c=(r?.length??0)-1;return`${a(l)}${c>0?` +${c}`:""}`}const d=o?.[0];if(d){const c=(o?.length??0)-1;return`Except ${a(d)}${c>0?` +${c}`:""}`}return"Any location"}case"website/matchers/multi.ts":case"$live/matchers/MatchMulti.ts":{const{matchers:r,op:o="AND"}=t;if(r&&r.length>0){const a=o==="OR"?"OR":"AND";return r.map(l=>g9(l,e+1)).join(` ${a} `)}return mt(s)}default:{const r=Rc(t);return r||mt(s)||"Default"}}}function e8(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.__resolveType=="string"&&Array.isArray(e.variants)}function t8(t,e){return{__resolveType:e,variants:[{rule:Bi(),value:structuredClone(t)},{rule:Bi(),value:structuredClone(t)}]}}function s8(t){const e=t.variants;if(e.length===0)return;const s=e.find(i=>o9(i.rule));return s?s.value:e[e.length-1]?.value}function i8(t){const e=[...t.variants],s=e[e.length-1],i={rule:Bi(),value:s?structuredClone(s.value):void 0};return{...t,variants:[...e,i]}}function n8(t,e){if(t.variants.length<=1)return null;const s=[...t.variants];return s.splice(e,1),{...t,variants:s}}function r8(t,e){const s=[...t.variants],i=s[e];return i?(s.splice(e+1,0,structuredClone(i)),{...t,variants:s}):t}function o8(t,e,s){const i=[...t.variants];if(e===s||e<0||s<0||e>=i.length||s>=i.length)return t;const[r]=i.splice(e,1);return r?(i.splice(s,0,r),{...t,variants:i}):t}function a8(t,e,s){const i=[...t.variants],r=i[e];return r?(i[e]={...r,value:s},{...t,variants:i}):t}function Pc(t,e,s){const i=[...t.variants],r=i[e];return r?(i[e]={...r,rule:s},{...t,variants:i}):t}const Dc=new WeakMap,Ic=new Map;function l8(t){let e=Dc.get(t);return e||(e=GL(t),Dc.set(t,e)),e}function c8(t,e){let s=Ic.get(t);return s===void 0&&(s=Ks(t,e),Ic.set(t,s)),s}function d8(t){const e=F.c(3),{multivariateResolveType:s,renderInnerField:i,...r}=t,{value:o,onChange:a,meta:l,path:d}=r,[c,h]=M.useState(0);if(!e8(o)){let P;e[0]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(Bd,{size:14}),e[0]=P):P=e[0];let D;return e[1]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(Te,{children:"Add variant"}),e[1]=D):D=e[1],n.jsxs("div",{className:"relative grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 size-6 text-muted-foreground hover:text-foreground","aria-label":"Add variant",onClick:()=>{a(t8(o,s)),h(0)},children:P})}),D]}),i(r)]})}const u=o,f=u.variants,m=Math.min(c,f.length-1),p=f.map(h8),_=f[m],L=_?.rule??{},v=L.__resolveType??"",x=_?.value,g=l?l8(l):[],y=v&&l?c8(v,l):null,{__resolveType:b,...S}=L,w=()=>{a(s8(u)),h(0)},C=()=>{const P=i8(u);a(P),h(P.variants.length-1)},N=P=>{const D=n8(u,P);D&&(a(D),m>=D.variants.length&&h(D.variants.length-1))},T=P=>{const D=r8(u,P);a(D),h(P+1)},A=(P,D)=>{const O=o8(u,P,D);a(O),m===P&&h(D)},j=P=>{a(Pc(u,m,P?{__resolveType:P}:{__resolveType:gh}))},k=P=>{const D=P,O=v?{...D,__resolveType:v}:{...D};a(Pc(u,m,O))},I=P=>{a(a8(u,m,P))},E=`${d}-${u.__resolveType}`;let R;return e[2]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx($e,{className:"text-xs text-muted-foreground",children:"Rule"}),e[2]=R):R=e[2],n.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-0",children:[n.jsx(UL,{listKey:E,variants:p,selectedIndex:m,onSelect:h,onDuplicate:T,onDelete:N,onRemoveAll:w,onReorder:A,onAdd:C}),n.jsxs("div",{className:"space-y-4 px-2 pt-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[R,n.jsx(JL,{currentRt:v,currentLabel:g9(L),matchers:g,onSelect:j}),y&&n.jsx("div",{className:"pt-1",children:n.jsx(vi,{schema:y,value:S,onChange:k,basePath:""})})]}),i({...r,value:x,onChange:I})]})]})}function h8(t,e){return{index:e,label:g9(t.rule)||`Variant ${e+1}`}}const u8="website/loaders/secret.ts";function Nn(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t.__resolveType;return typeof e=="string"&&(e.endsWith("/secret.ts")||e.includes("loaders/secret"))}function f8(){return{__resolveType:u8,name:"",encrypted:""}}function m8(t){const{value:e,...s}=t;return s}function Vo(t){const e=F.c(45),{schema:s,value:i,onChange:r,label:o,path:a}=t;if(typeof i=="string"||i==null&&!Nn(i)){const w=typeof i=="string"?i:"";let C;e[0]!==o||e[1]!==a?(C=n.jsx($e,{htmlFor:a,className:"text-sm font-medium",children:o}),e[0]=o,e[1]=a,e[2]=C):C=e[2];let N;e[3]!==s.description?(N=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[3]=s.description,e[4]=N):N=e[4];let T;e[5]!==r?(T=k=>r(k.target.value),e[5]=r,e[6]=T):T=e[6];let A;e[7]!==a||e[8]!==w||e[9]!==T?(A=n.jsx(ze,{id:a,type:"password",value:w,autoComplete:"new-password",autoCorrect:"off",spellCheck:!1,placeholder:"Secret value",onChange:T,className:"h-10"}),e[7]=a,e[8]=w,e[9]=T,e[10]=A):A=e[10];let j;return e[11]!==C||e[12]!==N||e[13]!==A?(j=n.jsxs("div",{className:"space-y-2",children:[C,N,A]}),e[11]=C,e[12]=N,e[13]=A,e[14]=j):j=e[14],j}let l;e[15]!==i?(l=Nn(i)?i:f8(),e[15]=i,e[16]=l):l=e[16];const d=l,c=typeof d.name=="string"?d.name:"",h=typeof d.encrypted=="string"&&d.encrypted,u=`${a}-name`;let f;e[17]!==o||e[18]!==u?(f=n.jsx($e,{htmlFor:u,className:"text-sm font-medium",children:o}),e[17]=o,e[18]=u,e[19]=f):f=e[19];let m;e[20]!==s.description?(m=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[20]=s.description,e[21]=m):m=e[21];const p=`${a}-name`;let _;e[22]!==d||e[23]!==r?(_=w=>r({...d,name:w.target.value}),e[22]=d,e[23]=r,e[24]=_):_=e[24];let L;e[25]!==c||e[26]!==p||e[27]!==_?(L=n.jsx(ze,{id:p,value:c,placeholder:"Secret name",onChange:_,className:"h-10"}),e[25]=c,e[26]=p,e[27]=_,e[28]=L):L=e[28];const v=`${a}-value`,x=h?"Leave blank to keep current value":"Secret value";let g;e[29]!==d||e[30]!==h||e[31]!==r?(g=w=>{const C=w.target.value;if(!C){r(h?m8(d):d);return}r({...d,value:C})},e[29]=d,e[30]=h,e[31]=r,e[32]=g):g=e[32];let y;e[33]!==g||e[34]!==v||e[35]!==x?(y=n.jsx(ze,{id:v,type:"password",autoComplete:"new-password",autoCorrect:"off",spellCheck:!1,placeholder:x,onChange:g,className:"h-10"}),e[33]=g,e[34]=v,e[35]=x,e[36]=y):y=e[36];let b;e[37]!==h?(b=h&&n.jsx("p",{className:"text-xs text-muted-foreground",children:"A secret value is stored."}),e[37]=h,e[38]=b):b=e[38];let S;return e[39]!==y||e[40]!==b||e[41]!==f||e[42]!==m||e[43]!==L?(S=n.jsxs("div",{className:"space-y-2",children:[f,m,L,y,b]}),e[39]=y,e[40]=b,e[41]=f,e[42]=m,e[43]=L,e[44]=S):S=e[44],S}function p8(t){const e=t.length>0?t[0]:void 0;if(e==null||typeof e!="object"||Array.isArray(e))return;const s={};for(const[i,r]of Object.entries(e))i.startsWith("__")||(typeof r=="string"?s[i]={type:"string"}:typeof r=="number"?s[i]={type:"number"}:typeof r=="boolean"&&(s[i]={type:"boolean"}));return Object.keys(s).length>0?{type:"object",properties:s}:void 0}const g8=new Set(["__resolveType","@type"]);function _8(t){if(t.type!=="block-ref"||!t.anyOfRefs?.length||t.anyOfRefs.length!==1)return!1;const e=t.anyOfRefs[0].schema;return!!(e?.properties?.variants||!e&&t.plainSchema)}function L8(t){if(yo(t))for(const e of t.anyOfRefs??[]){const r=e.schema?.properties?.variants?.items?.properties?.value;if(r?.type==="array"&&r.items)return r.items}}function Mc(t){if(t.type==="array"&&t.items)return t;const e=t.items??L8(t);return e?{...t,type:"array",items:e}:null}function v8(t,e){if(e!==void 0)return e;switch(t){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}}function _9(t){const{schema:e,value:s}=t;if(Yr(s)){const a=Ng(s),l=Mc(e);if(a!==null&&l)return n.jsx(ur,{...t,schema:l,value:a,onChange:d=>t.onChange(Eg(s,d))},t.path)}if(Array.isArray(s)&&e.type==="block-ref"&&yo(e)){const a=Mc(e);if(a)return n.jsx(ur,{...t,schema:a,value:s,onChange:t.onChange},t.path)}if(Array.isArray(s)&&!Yr(s)&&e.type==="block-ref"){const a=p8(s);if(a){const l={...e,type:"array",items:a};return n.jsx(ur,{...t,schema:l,value:s,onChange:t.onChange},t.path)}}if(e.type==="block-ref"||s!==null&&typeof s=="object"&&!Array.isArray(s)&&typeof s.__resolveType=="string"&&e.anyOfRefs){if(_8(e)){const a=e.anyOfRefs[0],l=a.schema?.properties?.variants?.items?.properties?.value,d=l&&l.type!=="block-ref"?l:e.plainSchema??l?.plainSchema??{type:"string"},c=h=>_9({...h,schema:d});return n.jsx(d8,{...t,multivariateResolveType:a.resolveType,renderInnerField:c},t.path)}return e.anyOfRefs?n.jsx(wc,{...t},t.path):null}if(e.type==="inline-union")return n.jsx(EL,{...t},t.path);if(e.format==="image-uri")return n.jsx(mL,{...t},t.path);if(e.format==="file-uri"||e.format==="video-uri")return n.jsx(cL,{...t},t.path);if(e.format==="map")return n.jsx(IL,{...t},t.path);if(e.format==="dynamic-options"&&e.options)return n.jsx(z6,{...t},t.path);if(e.format==="location")return n.jsx(Ru,{...t},t.path);if(e.enum&&e.enum.length>0)return n.jsx(Z_,{...t},t.path);if(e.type==="anyOf")return n.jsx(wc,{...t},t.path);if(Nn(s)||e.format==="password"||s==null&&e.format==="password")return n.jsx(Vo,{...t},t.path);const i=s??v8(e.type,e.default);if(i==null)return Nn(s)?n.jsx(Vo,{...t},t.path):null;if(Nn(i))return n.jsx(Vo,{...t,value:i},t.path);const r={...t,value:i},o=s==null?e.type??typeof i:Array.isArray(i)?"array":typeof i;if(o==="array"||Array.isArray(i))return n.jsx(ur,{...r},t.path);switch(o){case"boolean":return n.jsx(G_,{...r},t.path);case"number":case"integer":return n.jsx(q_,{...r},t.path);case"string":{const a=e.format;return a==="color-input"?n.jsx(dr,{...r},t.path):a==="textarea"||a==="rich-text"||a==="html"?n.jsx(dr,{...r},t.path):n.jsx(dr,{...r},t.path)}case"object":return i!==null&&typeof i=="object"&&!Array.isArray(i)?n.jsx(N6,{...r},t.path):null;default:return n.jsx(dr,{...r},t.path)}}function vi(t){const e=F.c(16),{schema:s,value:i,onChange:r,basePath:o,breadcrumbPath:a,onBreadcrumbChange:l,meta:d,decofile:c,onSaveReferencedBlock:h,previewBaseUrl:u,onAddSectionItem:f,onRequestAddSection:m,sandbox:p}=t;let _,L;if(e[0]!==o||e[1]!==c||e[2]!==d||e[3]!==f||e[4]!==l||e[5]!==r||e[6]!==m||e[7]!==h||e[8]!==u||e[9]!==p||e[10]!==s.properties||e[11]!==a||e[12]!==i){L=Symbol.for("react.early_return_sentinel");e:{const v=a===void 0?[]:a,x=s.properties;if(!x){L=null;break e}const g=i!=null&&typeof i=="object"&&!Array.isArray(i)?i:{},y=Object.keys(x).filter(A=>!g8.has(A)&&x[A]?.hidden!==!0);if(y.length===0){let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields on this section."}),e[15]=A):A=e[15],L=A;break e}const b=(A,j)=>{r({...g,[A]:j})},S=typeof g.__resolveType=="string"?g.__resolveType:void 0,w=v.length>0?m6(y,x,g,v):null,C=w?x[w]:null,N=w&&C?[w]:y,T=w&&C?u6(w,C,v):v;_=n.jsx("div",{className:"min-w-0 space-y-6",children:N.map(A=>{const j=x[A];if(!j)return null;const k=o?`${o}.${A}`:A,I=jn(A,j);return _9({schema:j,value:g[A],onChange:E=>b(A,E),path:k,label:I,breadcrumbPath:T,onBreadcrumbChange:l,meta:d,decofile:c,onSaveReferencedBlock:h,containerResolveType:S,previewBaseUrl:u,onAddSectionItem:f,onRequestAddSection:m,sandbox:p})})})}e[0]=o,e[1]=c,e[2]=d,e[3]=f,e[4]=l,e[5]=r,e[6]=m,e[7]=h,e[8]=u,e[9]=p,e[10]=s.properties,e[11]=a,e[12]=i,e[13]=_,e[14]=L}else _=e[13],L=e[14];return L!==Symbol.for("react.early_return_sentinel")?L:_}function x8(t){const e=F.c(37),{open:s,onOpenChange:i,defaultBlockId:r,isPending:o,onSubmit:a}=t,l=r===void 0?"":r,d=o===void 0?!1:o,[c,h]=M.useState(l),[u,f]=M.useState(s);s!==u&&(f(s),s&&h(l));let m;e[0]!==d||e[1]!==i?(m=k=>{!k&&!d&&i(!1)},e[0]=d,e[1]=i,e[2]=m):m=e[2];const p=m;let _;e[3]!==c||e[4]!==d||e[5]!==a?(_=async k=>{k.preventDefault();const I=c.trim();!I||d||await a(I)},e[3]=c,e[4]=d,e[5]=a,e[6]=_):_=e[6];const L=_;let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsxs(is,{children:[n.jsx(ns,{children:"Save as global"}),n.jsx(qi,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=v):v=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=k=>h(k.target.value),e[9]=g):g=e[9];let y;e[10]!==c||e[11]!==d?(y=n.jsxs("div",{className:"py-4 space-y-2",children:[x,n.jsx(ze,{id:"block-id",value:c,onChange:g,placeholder:"MyNewBlock",autoFocus:!0,disabled:d})]}),e[10]=c,e[11]=d,e[12]=y):y=e[12];let b;e[13]!==i?(b=()=>i(!1),e[13]=i,e[14]=b):b=e[14];let S;e[15]!==d||e[16]!==b?(S=n.jsx(ie,{type:"button",variant:"outline",onClick:b,disabled:d,children:"Cancel"}),e[15]=d,e[16]=b,e[17]=S):S=e[17];let w;e[18]!==c||e[19]!==d?(w=!c.trim()||d,e[18]=c,e[19]=d,e[20]=w):w=e[20];let C;e[21]!==d?(C=d?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=d,e[22]=C):C=e[22];let N;e[23]!==w||e[24]!==C?(N=n.jsx(ie,{type:"submit",disabled:w,children:C}),e[23]=w,e[24]=C,e[25]=N):N=e[25];let T;e[26]!==S||e[27]!==N?(T=n.jsxs(qs,{children:[S,N]}),e[26]=S,e[27]=N,e[28]=T):T=e[28];let A;e[29]!==L||e[30]!==T||e[31]!==y?(A=n.jsx($t,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:L,children:[v,y,T]})}),e[29]=L,e[30]=T,e[31]=y,e[32]=A):A=e[32];let j;return e[33]!==p||e[34]!==s||e[35]!==A?(j=n.jsx(Ot,{open:s,onOpenChange:p,children:A}),e[33]=p,e[34]=s,e[35]=A,e[36]=j):j=e[36],j}function y8(t){const e=F.c(60),{orgSlug:s,virtualMcpId:i,branch:r,previewUrl:o,meta:a,decofile:l,resolveType:d,title:c,defaultBlockId:h,isCreating:u,onCreate:f,onSaveReferencedBlock:m}=t,p=yi(),_=p?.entity?.id===i?p.entity.metadata?.siteSlug??null:null;let L;e[0]===Symbol.for("react.memo_cache_sentinel")?(L={},e[0]=L):L=e[0];const[v,x]=M.useState(L);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[1]=g):g=e[1];const[y,b]=M.useState(g),[S,w]=M.useState(0),[C,N]=M.useState(!1);let T;e[2]!==a||e[3]!==d?(T=Ks(d,a),e[2]=a,e[3]=d,e[4]=T):T=e[4];const A=T;let j;e[5]!==d?(j=d.split("/").pop()?.replace(/\.tsx?$/,"")??d,e[5]=d,e[6]=j):j=e[6];const k=j,I=o??void 0;let E;e[7]!==_||e[8]!==r||e[9]!==s||e[10]!==I||e[11]!==i?(E={orgSlug:s,virtualMcpId:i,branch:r,previewUrl:I,siteSlug:_},e[7]=_,e[8]=r,e[9]=s,e[10]=I,e[11]=i,e[12]=E):E=e[12];const R=E;let P;e[13]!==y||e[14]!==c?(P=[c,...y],e[13]=y,e[14]=c,e[15]=P):P=e[15];const D=P;let O;e[16]!==y?(O=de=>{b(y.slice(0,de)),w(b8)},e[16]=y,e[17]=O):O=e[17];const $=O;let K;e[18]!==l||e[19]!==v||e[20]!==f?(K=async de=>{const fe=R_(de,l);if(fe){ue.error(fe);return}await f(de,v),N(!1)},e[18]=l,e[19]=v,e[20]=f,e[21]=K):K=e[21];const z=K;let U;e[22]!==$||e[23]!==D?(U=n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:D.map((de,fe)=>{const Q=fe===D.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[fe>0&&n.jsx(Gi,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>$(fe),title:de,className:le("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",Q?"font-medium text-foreground":"text-muted-foreground"),children:de})]},`${de}-${fe}`)})}),e[22]=$,e[23]=D,e[24]=U):U=e[24];let G;e[25]===Symbol.for("react.memo_cache_sentinel")?(G=()=>N(!0),e[25]=G):G=e[25];let q;e[26]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(Id,{size:14}),e[26]=q):q=e[26];let W;e[27]!==u?(W=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{size:"icon",className:"size-8 shrink-0",disabled:u,onClick:G,"aria-label":"Save as global section",children:q})}),e[27]=u,e[28]=W):W=e[28];let H;e[29]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx(Te,{side:"bottom",children:"Save as global section"}),e[29]=H):H=e[29];let Z;e[30]!==W?(Z=n.jsxs(Ae,{children:[W,H]}),e[30]=W,e[31]=Z):Z=e[31];let J;e[32]!==U||e[33]!==Z?(J=n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[U,Z]}),e[32]=U,e[33]=Z,e[34]=J):J=e[34];let B;e[35]!==k?(B=n.jsxs("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:[k," — edits stay local until you save this as a global section."]}),e[35]=k,e[36]=B):B=e[36];let X;e[37]!==J||e[38]!==B?(X=n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[J,B]}),e[37]=J,e[38]=B,e[39]=X):X=e[39];let V;e[40]!==l||e[41]!==y||e[42]!==S||e[43]!==v||e[44]!==a||e[45]!==m||e[46]!==R||e[47]!==A?(V=n.jsx(Wi,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:A?n.jsx(vi,{schema:A,value:v,onChange:de=>x(de),basePath:"",breadcrumbPath:y,onBreadcrumbChange:b,meta:a,decofile:l,onSaveReferencedBlock:m,sandbox:R},S):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields for this section."})})})}),e[40]=l,e[41]=y,e[42]=S,e[43]=v,e[44]=a,e[45]=m,e[46]=R,e[47]=A,e[48]=V):V=e[48];let ee;e[49]!==X||e[50]!==V?(ee=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[X,V]}),e[49]=X,e[50]=V,e[51]=ee):ee=e[51];let te;e[52]!==h||e[53]!==z||e[54]!==u||e[55]!==C?(te=n.jsx(x8,{open:C,onOpenChange:N,defaultBlockId:h,isPending:u,onSubmit:z}),e[52]=h,e[53]=z,e[54]=u,e[55]=C,e[56]=te):te=e[56];let ae;return e[57]!==ee||e[58]!==te?(ae=n.jsxs("div",{className:"flex h-full w-full min-w-0",children:[ee,te]}),e[57]=ee,e[58]=te,e[59]=ae):ae=e[59],ae}function b8(t){return t+1}function S8(t,e){const s={__resolveType:t},i=iu([s],e)[0];return i?A6(s,i,e):null}function w8({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i,meta:r,decofile:o,blockKey:a,onSaveReferencedBlock:l}){const d=yi(),c=d?.entity?.id===e?d.entity.metadata?.siteSlug??null:null,[h]=M.useState(()=>S8(a,o)),[u,f]=M.useState(h?.data??{}),[m,p]=M.useState([]),[_,L]=M.useState(0),[v,x]=M.useState(!1),[g,y]=M.useState(null),b=g!==null,{save:S,flush:w}=Mg({orgSlug:t,virtualMcpId:e,branch:s}),C=h?.resolveType?Ks(h.resolveType,r):null,N=o[a],T=N?Jl(a,N):a,A={orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i??void 0,siteSlug:c},j=P=>{f(P),S(a,P)},k=()=>{b?(y(null),x(!1),L(P=>P+1)):y(JSON.stringify(u,null,2))},I=P=>{const D=P??"";try{const O=JSON.parse(D);if(O&&typeof O=="object"&&!Array.isArray(O)){x(!1),j(O);return}x(!0)}catch{x(!0)}},E=[T,...m],R=P=>{p(m.slice(0,P)),L(D=>D+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:ph},"aria-hidden":!0}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((P,D)=>{const O=D===E.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(Gi,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>R(D),title:P,className:le("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",O?"font-medium text-foreground":"text-muted-foreground"),children:P})]},`${P}-${D}`)})}),n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:b?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:k,"aria-label":b?"Close JSON editor":"Edit as JSON","aria-pressed":b,children:b?n.jsx(mo,{size:14}):n.jsx(lo,{size:14})})}),n.jsx(Te,{side:"bottom",children:b?"Close JSON editor":"Edit as JSON"})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:"Global section — changes save automatically and apply everywhere it's used."})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Wi,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:C?n.jsx(vi,{schema:C,value:u,onChange:P=>j(P),basePath:"",breadcrumbPath:m,onBreadcrumbChange:p,meta:r,decofile:o,onSaveReferencedBlock:l,sandbox:A},_):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields for this section."})})})}),g!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[v&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:"Invalid JSON — changes aren't saved until it parses."}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(sh,{language:"json",height:"100%",code:g,onChange:I,onSave:P=>{I(P),w()}})})]})]})]})})}function Bc(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),i=`${s} (copy)`;if(!t.has(i))return i;for(let r=2;r<1e3;r++){const o=`${s} (copy ${r})`;if(!t.has(o))return o}return`${s} (copy ${Date.now()})`}function C8(t,e){const s=Ri,i=e.replace(/-copy(?:-\d+)?$/,""),r=`${i}-copy`;if(!t.has(s(r)))return r;for(let o=2;o<1e3;o++){const a=`${i}-copy-${o}`;if(!t.has(s(a)))return a}return`${i}-copy-${Date.now()}`}function k8(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),i=`${s}_copy`;if(!Object.hasOwn(t,i))return i;for(let r=2;r<1e3;r++){const o=`${s}_copy_${r}`;if(!Object.hasOwn(t,o))return o}return`${s}_copy_${Date.now()}`}function j8(t){const e=a9(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function N8(t,e){return du(t,e)}const E8=1e3;function T8(t,e){for(let s=0;s<E8;s++){const i=a9(e);if(!Object.hasOwn(t,i))return i}throw new Error("Could not generate a unique page block key")}const A8={create:"Create new page",duplicate:"Duplicate page",rename:"Rename page"},R8={create:"Create",duplicate:"Duplicate",rename:"Save"},P8={create:"Creating…",duplicate:"Duplicating…",rename:"Saving…"};function D8(t){const e=F.c(54),{open:s,mode:i,initialName:r,initialPath:o,isPending:a,error:l,validate:d,onSubmit:c,onOpenChange:h}=t,u=a===void 0?!1:a,[f,m]=M.useState(r),[p,_]=M.useState(o),[L,v]=M.useState(null),[x,g]=M.useState(s);s!==x&&(g(s),s&&(m(r),_(o),v(null)));let y;e[0]!==u||e[1]!==h?(y=H=>{!H&&!u&&(v(null),h(!1))},e[0]=u,e[1]=h,e[2]=y):y=e[2];const b=y;let S;e[3]!==u||e[4]!==f||e[5]!==c||e[6]!==p||e[7]!==d?(S=async H=>{H.preventDefault();const Z=f.trim(),J=p.trim();if(!Z||!J||u)return;const B=Kl(J);if(B){v(B);return}const X=d?.({name:Z,path:J});if(X){v(X);return}v(null),await c({name:Z,path:J})},e[3]=u,e[4]=f,e[5]=c,e[6]=p,e[7]=d,e[8]=S):S=e[8];const w=S,C=L??l,N=A8[i];let T;e[9]!==N?(T=n.jsx(is,{children:n.jsx(ns,{children:N})}),e[9]=N,e[10]=T):T=e[10];let A;e[11]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[11]=A):A=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=H=>m(H.target.value),e[12]=j):j=e[12];let k;e[13]!==u||e[14]!==f?(k=n.jsxs("div",{className:"space-y-1.5",children:[A,n.jsx(ze,{id:"page-form-name",value:f,onChange:j,placeholder:"My page",autoFocus:!0,disabled:u})]}),e[13]=u,e[14]=f,e[15]=k):k=e[15];let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:"Path"}),e[16]=I):I=e[16];let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=H=>_(H.target.value),e[17]=E):E=e[17];let R;e[18]!==u||e[19]!==p?(R=n.jsxs("div",{className:"space-y-1.5",children:[I,n.jsx(ze,{id:"page-form-path",value:p,onChange:E,placeholder:"/example",disabled:u})]}),e[18]=u,e[19]=p,e[20]=R):R=e[20];let P;e[21]!==C?(P=C&&n.jsx("p",{className:"text-xs text-destructive",children:C}),e[21]=C,e[22]=P):P=e[22];let D;e[23]!==R||e[24]!==P||e[25]!==k?(D=n.jsxs("div",{className:"space-y-4 py-4",children:[k,R,P]}),e[23]=R,e[24]=P,e[25]=k,e[26]=D):D=e[26];let O;e[27]!==h?(O=()=>h(!1),e[27]=h,e[28]=O):O=e[28];let $;e[29]!==u||e[30]!==O?($=n.jsx(ie,{type:"button",variant:"outline",onClick:O,disabled:u,children:"Cancel"}),e[29]=u,e[30]=O,e[31]=$):$=e[31];let K;e[32]!==u||e[33]!==f||e[34]!==p?(K=!f.trim()||!p.trim()||u,e[32]=u,e[33]=f,e[34]=p,e[35]=K):K=e[35];let z;e[36]!==u||e[37]!==i?(z=u?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),P8[i]]}):R8[i],e[36]=u,e[37]=i,e[38]=z):z=e[38];let U;e[39]!==K||e[40]!==z?(U=n.jsx(ie,{type:"submit",disabled:K,children:z}),e[39]=K,e[40]=z,e[41]=U):U=e[41];let G;e[42]!==$||e[43]!==U?(G=n.jsxs(qs,{children:[$,U]}),e[42]=$,e[43]=U,e[44]=G):G=e[44];let q;e[45]!==w||e[46]!==D||e[47]!==G||e[48]!==T?(q=n.jsx($t,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[T,D,G]})}),e[45]=w,e[46]=D,e[47]=G,e[48]=T,e[49]=q):q=e[49];let W;return e[50]!==b||e[51]!==s||e[52]!==q?(W=n.jsx(Ot,{open:s,onOpenChange:b,children:q}),e[50]=b,e[51]=s,e[52]=q,e[53]=W):W=e[53],W}function I8(t){const e=F.c(43),{open:s,blockKey:i,initialName:r,isPending:o,onSubmit:a,onOpenChange:l}=t,d=o===void 0?!1:o,[c,h]=M.useState(r),[u,f]=M.useState(s);s!==u&&(f(s),s&&h(r));let m;e[0]!==d||e[1]!==l?(m=R=>{!R&&!d&&l(!1)},e[0]=d,e[1]=l,e[2]=m):m=e[2];const p=m;let _;e[3]!==d||e[4]!==c||e[5]!==a?(_=async R=>{R.preventDefault();const P=c.trim();!P||d||await a(P)},e[3]=d,e[4]=c,e[5]=a,e[6]=_):_=e[6];const L=_;let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsxs(is,{children:[n.jsx(ns,{children:"Rename section"}),n.jsx(qi,{children:"Updates the display name. The internal key stays the same so pages referencing this section keep working."})]}),e[7]=v):v=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=R=>h(R.target.value),e[9]=g):g=e[9];let y;e[10]!==d||e[11]!==c?(y=n.jsxs("div",{className:"space-y-1.5",children:[x,n.jsx(ze,{id:"section-rename-name",value:c,onChange:g,autoFocus:!0,disabled:d})]}),e[10]=d,e[11]=c,e[12]=y):y=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Key"}),e[13]=b):b=e[13];let S;e[14]!==i?(S=n.jsxs("div",{className:"space-y-1.5",children:[b,n.jsx(ze,{value:i,readOnly:!0,disabled:!0,className:"font-mono"})]}),e[14]=i,e[15]=S):S=e[15];let w;e[16]!==y||e[17]!==S?(w=n.jsxs("div",{className:"space-y-4 py-4",children:[y,S]}),e[16]=y,e[17]=S,e[18]=w):w=e[18];let C;e[19]!==l?(C=()=>l(!1),e[19]=l,e[20]=C):C=e[20];let N;e[21]!==d||e[22]!==C?(N=n.jsx(ie,{type:"button",variant:"outline",onClick:C,disabled:d,children:"Cancel"}),e[21]=d,e[22]=C,e[23]=N):N=e[23];let T;e[24]!==d||e[25]!==c?(T=!c.trim()||d,e[24]=d,e[25]=c,e[26]=T):T=e[26];let A;e[27]!==d?(A=d?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[27]=d,e[28]=A):A=e[28];let j;e[29]!==T||e[30]!==A?(j=n.jsx(ie,{type:"submit",disabled:T,children:A}),e[29]=T,e[30]=A,e[31]=j):j=e[31];let k;e[32]!==N||e[33]!==j?(k=n.jsxs(qs,{children:[N,j]}),e[32]=N,e[33]=j,e[34]=k):k=e[34];let I;e[35]!==L||e[36]!==w||e[37]!==k?(I=n.jsx($t,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:L,children:[v,w,k]})}),e[35]=L,e[36]=w,e[37]=k,e[38]=I):I=e[38];let E;return e[39]!==p||e[40]!==s||e[41]!==I?(E=n.jsx(Ot,{open:s,onOpenChange:p,children:I}),e[39]=p,e[40]=s,e[41]=I,e[42]=E):E=e[42],E}const Ko={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},L9=["posts","authors","categories"],En={posts:"post",authors:"author",categories:"category"};function Tn(t){return L9.includes(t)}const v9={posts:"post",authors:"author",categories:"category"},Bu={posts:Ko.post,authors:Ko.author,categories:Ko.category},M8=Object.fromEntries(Object.entries(Bu).map(([t,e])=>[e,t]));function B8(t){return typeof t=="string"?M8[t]??null:null}function Oi(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function as(t){return typeof t=="string"?t:""}function O8(t,e){switch(t){case"posts":return{label:as(e.title)||"Untitled post",subtitle:as(e.slug)};case"authors":return{label:as(e.name)||"Unnamed author",subtitle:as(e.email)};case"categories":return{label:as(e.name)||"Unnamed category",subtitle:as(e.slug)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function Ou(t){const e={posts:[],authors:[],categories:[]};for(const[s,i]of Object.entries(t)){const r=Oi(i);if(!r)continue;const o=B8(r.__resolveType);if(!o)continue;const a=Oi(r[v9[o]])??{},{label:l,subtitle:d}=O8(o,a);e[o].push({key:s,kind:o,label:l,subtitle:d})}for(const s of L9)e[s].sort((i,r)=>i.label.localeCompare(r.label));return e}function $8(t,e){return Ou(t)[e]}function Un(t,e){return $8(t,e).map(s=>({key:s.key,payload:wr(Oi(t[s.key])??void 0,e)}))}const Oc=Object.freeze({});function wr(t,e){return t?Oi(t[v9[e]])??Oc:Oc}function mr(t,e,s){return{name:t,__resolveType:Bu[e],[v9[e]]:s}}function $u(t){return`.deco/blocks/${encodeURIComponent(t)}.json`}function $i(t){return Array.isArray(t)?t:[]}function Us(t){if(typeof t=="string")return t;const e=Oi(t);return e?as(e.slug):""}function z8(t){if(typeof t=="string")return t;const e=Oi(t);return e?as(e.email):""}function F8(t){return Un(t,"posts").map(({key:e,payload:s})=>({key:e,title:as(s.title)||"Untitled post",slug:as(s.slug),date:as(s.date),categorySlugs:$i(s.categories).map(Us).filter(Boolean),authorEmails:$i(s.authors).map(z8).filter(Boolean)}))}function H8(t,e){const s=$i(t.categories);return s.some(i=>Us(i)===e.slug)?t:{...t,categories:[...s,{name:e.name,slug:e.slug}]}}function U8(t,e){const s=$i(t.categories);return s.length===1&&Us(s[0])===e.slug?t:{...t,categories:[{name:e.name,slug:e.slug}]}}function hk(t,e,s){const i=$i(t.categories);if(!i.some(l=>Us(l)===e))return t;const r=i.map(l=>{const d=Us(l);return d===e||d===s.slug?{name:s.name,slug:s.slug}:l}),o=new Set,a=r.filter(l=>{const d=Us(l);return d?o.has(d)?!1:(o.add(d),!0):!0});return{...t,categories:a}}function W8(t,e){const s=$i(t.categories);return s.some(i=>Us(i)===e)?{...t,categories:s.filter(i=>Us(i)!==e)}:t}function ka(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,s=>s.toString(16).padStart(2,"0")).join("").slice(0,t)}function $c(t,e){const s=`collections/blog/${e}/${ka(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function V8(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${ka(8)}`,date:new Date().toISOString().slice(0,10),image:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${ka(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const K8={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},zc="Box";function q8(t){return t.startsWith("site/")?"site":"app"}function G8(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function an(...t){for(const e of t)if(e!==void 0)return e}function uk(t){const e=new Set,s=[],i=t.manifest?.blocks??{};for(const r of Object.values(i))for(const o of Object.keys(r)){if(!X8(o)||e.has(o))continue;e.add(o);const a=_i(o,t),l=Y8(o),d=K8[l],c=q8(o),h=(c==="site"?an(a.title,d?.title):an(d?.title,a.title))??l,u=c==="site"?an(a.description,d?.description):an(d?.description,a.description),f=c==="site"?a.icon:void 0,m=f&&G8(f)?f:void 0,p=m!==void 0?d?.iconName??zc:an(f,d?.iconName)??zc;s.push({resolveType:o,title:h,description:u,iconName:p,iconUrl:m,source:c})}return s.sort((r,o)=>r.title.localeCompare(o.title))}function Y8(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const J8=["blog/sections/blocks/","site/sections/Blog/Post/"];function X8(t){return J8.some(e=>t.startsWith(e))}function zu({orgSlug:t,virtualMcpId:e,branch:s}){return Tt.decofile(`${t}/${e}/${s}`)}function Fu({orgSlug:t,virtualMcpId:e,branch:s},i){return`/api/${t}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${i}`}function Z8(t){const e=F.c(11),s=di();let i;e[0]!==t?(i=async l=>{const{blockKey:d,data:c}=l,h=await fetch(Fu(t,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:$u(d),content:JSON.stringify(c,null,2)})});if(!h.ok){const u=await h.json().catch(Q8);throw new Error(u.error??`Write failed (${h.status})`)}return h.json()},e[0]=t,e[1]=i):i=e[1];let r;e[2]!==t||e[3]!==s?(r=async l=>{const{blockKey:d,data:c}=l,h=zu(t);await s.cancelQueries({queryKey:h});const u=s.getQueryData(h);return s.setQueryData(h,f=>({...f??{},[d]:c})),{previous:u,queryKey:h}},e[2]=t,e[3]=s,e[4]=r):r=e[4];let o;e[5]!==s?(o=(l,d,c)=>{c?.queryKey&&s.setQueryData(c.queryKey,c.previous)},e[5]=s,e[6]=o):o=e[6];let a;return e[7]!==i||e[8]!==r||e[9]!==o?(a={mutationFn:i,onMutate:r,onError:o},e[7]=i,e[8]=r,e[9]=o,e[10]=a):a=e[10],hi(a)}function Q8(){return{}}function ev(t){const e=di();return hi({mutationFn:async({blockKey:s})=>{const i=await fetch(Fu(t,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:$u(s)})});if(!i.ok){const r=await i.json().catch(()=>({}));throw new Error(r.error??`Delete failed (${i.status})`)}return i.json()},onMutate:async({blockKey:s})=>{const i=zu(t);await e.cancelQueries({queryKey:i});const r=e.getQueryData(i);return e.setQueryData(i,o=>{if(!o)return o;const{[s]:a,...l}=o;return l}),{previous:r,queryKey:i}},onError:(s,i,r)=>{r?.queryKey&&e.setQueryData(r.queryKey,r.previous)}})}function tv(t){const e=F.c(20),{open:s,onOpenChange:i,pageKey:r,decofile:o}=t,[a,l]=M.useState(!1),d=o[r];let c;e[0]!==d?(c=d===void 0?"// Page not found.":JSON.stringify(d,null,2),e[0]=d,e[1]=c):c=e[1];const h=c;let u;e[2]!==h?(u=()=>{navigator.clipboard.writeText(h).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},e[2]=h,e[3]=u):u=e[3];const f=u;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(ns,{className:"text-sm font-semibold",children:"Page JSON"}),e[4]=m):m=e[4];let p;e[5]!==a?(p=a?n.jsx(nd,{size:12}):n.jsx(Xt,{size:12}),e[5]=a,e[6]=p):p=e[6];const _=a?"Copied":"Copy";let L;e[7]!==f||e[8]!==p||e[9]!==_?(L=n.jsxs(is,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m,n.jsxs(ie,{variant:"ghost",size:"sm",onClick:f,className:"h-7 gap-1.5 text-xs",children:[p,_]})]}),e[7]=f,e[8]=p,e[9]=_,e[10]=L):L=e[10];let v;e[11]!==h?(v=n.jsx(Wi,{className:"max-h-[70vh]",children:n.jsx("pre",{className:"p-4 text-xs font-mono text-foreground/90 whitespace-pre overflow-auto",children:h})}),e[11]=h,e[12]=v):v=e[12];let x;e[13]!==L||e[14]!==v?(x=n.jsxs($t,{className:"max-w-2xl p-0 gap-0",children:[L,v]}),e[13]=L,e[14]=v,e[15]=x):x=e[15];let g;return e[16]!==i||e[17]!==s||e[18]!==x?(g=n.jsx(Ot,{open:s,onOpenChange:i,children:x}),e[16]=i,e[17]=s,e[18]=x,e[19]=g):g=e[19],g}const Fc=M.lazy(()=>cs(()=>import("./app-editor-tLSi5KV_.js"),__vite__mapDeps([145,1,2,5,44,7,8,9,10,11,12,13,14,15,16,6,3,4,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,100,146,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,119,120,121,122,123,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.AppEditor}))),sv=M.lazy(()=>cs(()=>import("./post-editor-DrZmKifS.js"),__vite__mapDeps([147,1,2,28,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,78,77,132,85,86,74,63,55,56,62,88,71,133,115,134,135,136,137,65,97,91,79,48,106,111,112,50,110,68,44,45,46,47,49,51,52,53,54,57,58,59,60,61,64,66,67,69,70,72,73,75,76,102,93,148,81,82,83,84,87,89,90,92,94,95,96,101,103,104,105,107,108,109,80,113,149,146,114,116,117,118,119,120,121,122,123,99,124,125,126,127,128,129,130,131,138,139,140,141])).then(t=>({default:t.PostEditor}))),iv=M.lazy(()=>cs(()=>import("./record-editor-C64a4aNL.js"),__vite__mapDeps([150,1,2,78,77,93,149,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,146,101,57,58,55,56,59,60,61,62,63,64,65,52,66,44,45,46,47,48,49,50,51,53,54,67,68,69,70,71,72,73,74,75,76,79,92,89,102,103,81,82,83,84,85,86,87,88,90,91,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,119,120,121,122,123,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.RecordEditor}))),nv=M.lazy(()=>cs(()=>import("./category-editor-LeiO5-YX.js"),__vite__mapDeps([151,1,2,12,7,8,9,10,11,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,123,78,77,148,81,82,83,84,74,63,55,56,66,65,85,86,87,88,72,89,90,91,50,92,51,76,79,48,93,94,95,96,97,64,111,112,110,44,45,46,47,49,52,53,54,57,58,59,60,61,62,67,68,69,70,71,73,75,101,102,103,104,105,106,107,108,109,80,113,149,146,114,115,116,117,118,119,120,121,122,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.CategoryEditor}))),rv=M.lazy(()=>cs(()=>import("./sections-editor-BLU0buUC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SectionsEditor}))),ov=M.lazy(()=>cs(()=>import("./seo-editor-Dyh0ncgL.js"),__vite__mapDeps([152,1,2,5,7,8,9,10,11,12,13,14,15,16,6,3,4,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,98,99,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SeoEditor}))),av=M.lazy(()=>cs(()=>import("./variant-calendar-krPIZ_Rp.js"),__vite__mapDeps([153,1,2,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,77,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,78,79,99,131])).then(t=>({default:t.VariantCalendar}))),ja="oklch(0.65 0.15 160)";function lv(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function cv(t){const e=new Map;for(const s of t){const i=lv(s.resolveType),r=e.get(i);r?r.push(s):e.set(i,[s])}return[...e.entries()].map(([s,i])=>({label:s,sections:i})).sort((s,i)=>s.label.localeCompare(i.label))}function dv(){const t=F.c(18),e=yi(),{data:s}=Hi.useSession(),{currentBranch:i}=Ds(),{org:r}=Fe(),o=e?.entity?.id??null,a=s?.user?.id,l=e?.entity?.metadata,d=a&&i?ro(l?.sandboxMap?.[a]?.[i]):{},c=Object.values(d),u=(c.find(hv)??c[0])?.previewUrl??null,f=Cs(),m=e?.entity?.organization_id??"";let p;t[0]!==r.slug||t[1]!==m?(p={connectionId:pl,orgId:m,orgSlug:r.slug},t[0]=r.slug,t[1]=m,t[2]=p):p=t[2];const _=Pt(p),L=hl(_);let v;t[3]!==i||t[4]!==L||t[5]!==o?(v=()=>{if(!o)return;const S={virtualMcpId:o};i&&(S.branch=i),L.mutate(S)},t[3]=i,t[4]=L,t[5]=o,t[6]=v):v=t[6];const x=v,g=!!o&&!!i&&ca.isStopped(o,i),y=Th({previewUrl:u,appPaused:f.status.state==="paused",userStopped:g});if(y.kind!=="iframe"){let S;return t[7]!==y||t[8]!==x||t[9]!==f.lifecycle||t[10]!==f.phase?(S=n.jsx(Dv,{state:y,claimPhase:f.phase,lifecycle:f.lifecycle,onStart:x}),t[7]=y,t[8]=x,t[9]=f.lifecycle,t[10]=f.phase,t[11]=S):S=t[11],S}if(!o||!i){let S;return t[12]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Ni,{title:"Waiting for sandbox context…"}),t[12]=S):S=t[12],S}let b;return t[13]!==i||t[14]!==r.slug||t[15]!==u||t[16]!==o?(b=n.jsx(fv,{orgSlug:r.slug,virtualMcpId:o,branch:i,previewUrl:u}),t[13]=i,t[14]=r.slug,t[15]=u,t[16]=o,t[17]=b):b=t[17],b}function hv(t){return t.sandboxProviderKind!=="user-desktop"}const Hc=2e3,uv=15;function Uc(t,e,s,i){return typeof e!="string"||s&&(pu(e,s,i)||t.state.dataUpdateCount>=uv)?!1:Hc}function fv({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i}){const r={orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i},{data:o,isLoading:a}=zl(r),[l,d]=M.useState("pages"),[c,h]=M.useState(null),[u,f]=M.useState(null),[m,p]=M.useState(""),[_,L]=M.useState(null),[v,x]=M.useState(null),[g,y]=M.useState("date-desc"),[b,S]=M.useState(()=>new Set),w=()=>S(new Set),[C,N]=M.useState(l);C!==l&&(N(l),p(""),L(null),x(null),y("date-desc"),S(new Set));const{data:T,isLoading:A,isFetching:j}=Fl(r,{refetchInterval:Y=>{const me=Y.state.data;if(l==="apps"&&c&&c.collection==="apps"){const Se=o?.[c.key];return Uc(Y,typeof Se?.__resolveType=="string"?Se.__resolveType:void 0,me)}if(l==="site"&&o){const Se=me?ya(o,me):null,je=o.site,qe=Se?.resolveType??(typeof je?.__resolveType=="string"?je.__resolveType:void 0);return Uc(Y,qe,me,["seo"])}return!1}}),k=(Y,me)=>!pu(Y,T,me)&&(A||j),{catalog:I,isLoading:E}=T_(T??void 0,o??void 0,{enabled:l==="apps"}),R=l9(r),P=y_(r),D=Z8(r),O=ev(r),[$,K]=M.useState(null),[z,U]=M.useState(),[G,q]=M.useState(null),[W,H]=M.useState(null),[Z,J]=M.useState(null),[B,X]=M.useState(null);if(a||A)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!T)return n.jsx(Ni,{title:"Could not load site data."});const V=Yl(o).sort((Y,me)=>Y.name.localeCompare(me.name)),ee=Xl(o,T),te=l==="sections"?h4(T):[],ae=ya(o,T),de=Ou(o),fe=L9.some(Y=>de[Y].length>0),Q=Tn(l)?de[l]:[],se=(fe?Un(o,"categories"):[]).map(({key:Y,payload:me})=>{const Se=typeof me.slug=="string"?me.slug:"",je=typeof me.name=="string"?me.name:"";return{slug:Se||Y,name:je||Se||Y}}).filter(Y=>Y.slug).sort((Y,me)=>Y.name.localeCompare(me.name));if(!Gl(o,T)&&!fe)return n.jsx(Ni,{icon:Ui,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, or apps."});const oe={pages:V.length,sections:ee.length,apps:I.length,posts:de.posts.length,authors:de.authors.length,categories:de.categories.length},he=new Set(V.map(Y=>Ri(Y.path))),xe=new Set(V.map(Y=>Y.name)),ve=new Set(ee.map(Y=>Y.name)),be=async Y=>{const me=o[Y.key];if(!me)return;const Se=au(o,Y.key),je=lu(o,Y.key,Math.max(0,Se-1)),qe=Ag(me.sections,je);if(qe)try{await R.mutateAsync({blockKey:Y.key,data:{...me,sections:qe}}),ue.success(`Variant added to "${Y.name}"`),h({collection:"pages",key:Y.key,path:Y.path})}catch(rt){ue.error(rt instanceof Error?rt.message:"Could not add variant")}},De=()=>{U(void 0),K({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ie=Y=>{U(void 0),K({mode:"duplicate",sourceKey:Y.key,initialName:Bc(xe,Y.name),initialPath:C8(he,Y.path)})},Me=Y=>{U(void 0),K({mode:"rename",sourceKey:Y.key,initialName:Y.name,initialPath:Y.path})},He=async Y=>{if(!$)return;const{mode:me,sourceKey:Se}=$;try{if(me==="create"){const je=N8(Y.name,Y.path),qe=T8(o,Y.name);await R.mutateAsync({blockKey:qe,data:je}),ue.success(`Created "${Y.name}"`),h({collection:"pages",key:qe,path:Y.path})}else if(me==="duplicate"&&Se){const je=o[Se];if(!je)throw new Error("Source page not found");const{key:qe,data:rt}=j8({source:je,pages:V,newName:Y.name,newPath:Y.path});await R.mutateAsync({blockKey:qe,data:rt}),ue.success(`Duplicated as "${Y.name}"`),h({collection:"pages",key:qe,path:Y.path})}else if(me==="rename"&&Se){const je=o[Se];if(!je)throw new Error("Page not found");const qe={...je,name:Y.name,path:Y.path};await R.mutateAsync({blockKey:Se,data:qe}),ue.success("Page updated"),c?.collection==="pages"&&c.key===Se&&h({collection:"pages",key:Se,path:Y.path})}K(null)}catch(je){U(je instanceof Error?je.message:"Save failed")}},Je=({path:Y})=>{if(!$)return null;const me=Ri(Y);return($.mode==="rename"?Ri($.initialPath):null)!==me&&he.has(me)?`A page with path "${Y}" already exists.`:null},ge=async(Y,me,Se)=>{await R.mutateAsync({blockKey:me,data:{...Se,name:me,__resolveType:Y}}),ue.success(`Created section "${me}"`),h({collection:"sections",key:me})},we=P_((Y,me)=>R.mutate({blockKey:Y,data:me})),Be=async Y=>{const me=o[Y.key];if(!me){ue.error("Section not found.");return}const Se=k8(o,Y.key),je=Bc(ve,Y.name),qe={...me,name:je};try{await R.mutateAsync({blockKey:Se,data:qe}),ue.success(`Duplicated "${Y.name}"`),h({collection:"sections",key:Se})}catch(rt){ue.error(rt instanceof Error?rt.message:"Duplicate failed")}},Ne=async Y=>{if(!G)return;const me=o[G];if(!me){ue.error("Section not found.");return}try{await R.mutateAsync({blockKey:G,data:{...me,name:Y}}),ue.success("Section renamed"),q(null)}catch(Se){ue.error(Se instanceof Error?Se.message:"Rename failed")}},nt=async Y=>{const me=$c(o,Y),Se=mr(me,Y,V8(Y));try{await D.mutateAsync({blockKey:me,data:Se}),ue.success(`Created ${En[Y]}`),h({collection:Y,key:me})}catch(je){ue.error(je instanceof Error?je.message:"Could not create")}},Ve=async Y=>{const me=o[Y.key];if(!me){ue.error("Record not found.");return}const Se=$c(o,Y.kind),je=Y.kind==="posts"?"title":"name",qe={...structuredClone(wr(me,Y.kind)),[je]:`${Y.label} (copy)`};try{await D.mutateAsync({blockKey:Se,data:mr(Se,Y.kind,qe)}),ue.success(`Duplicated "${Y.label}"`),h({collection:Y.kind,key:Se})}catch(rt){ue.error(rt instanceof Error?rt.message:"Duplicate failed")}},ye=Y=>{S(me=>{const Se=new Set(me);return Se.has(Y)?Se.delete(Y):Se.add(Y),Se})},_e=Y=>{d("posts"),N("posts"),h(null),f(null),p(""),L(Y||null),x(null),y("date-desc"),S(new Set)},Ue=async(Y,me)=>{const Se=[...b];let je=0;for(const qe of Se){const rt=o[qe],ks=wr(rt,"posts"),Gs=Y==="add"?H8(ks,me):U8(ks,me);Gs!==ks&&(await D.mutateAsync({blockKey:qe,data:mr(qe,"posts",Gs)}),je+=1)}return je},Ze=async(Y,me)=>{const Se=b.size;try{const je=await Ue(Y,me),qe=Y==="add"?"Added to":"Moved",rt=Se-je;ue.success(`${qe} ${je} ${je===1?"post":"posts"}`+(rt>0?` (${rt} already set)`:"")),w(),X(null)}catch(je){ue.error(je instanceof Error?je.message:"Bulk update failed")}},Xe=async()=>{if(W)try{if(W.kind==="blog-bulk"){for(const je of W.keys)await O.mutateAsync({blockKey:je});ue.success(`Deleted ${W.count} ${W.count===1?"post":"posts"}`),c&&c.collection!=="available-section"&&W.keys.includes(c.key)&&h(null),w(),H(null);return}const{kind:Y,key:me,label:Se}=W;if(Y==="blog"){if(W.blogKind==="categories"){const je=wr(o[me],"categories").slug,qe=typeof je=="string"?je:"";if(qe)for(const{key:rt,payload:ks}of Un(o,"posts")){const Gs=W8(ks,qe);Gs!==ks&&await D.mutateAsync({blockKey:rt,data:mr(rt,"posts",Gs)})}}await O.mutateAsync({blockKey:me})}else await P.mutateAsync({blockKey:me});ue.success(`Deleted "${Se}"`),c&&c.collection!=="available-section"&&c.key===me&&h(null),H(null)}catch(Y){ue.error(Y instanceof Error?Y.message:"Delete failed")}},Ke=P.isPending||O.isPending||D.isPending,ce=W?.kind==="blog"?En[W.blogKind]:W?.kind==="blog-bulk"?`${W.count} ${W.count===1?"post":"posts"}`:W?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(pv,{active:l,counts:oe,showBlog:fe,onSelect:Y=>{d(Y),h(null),f(null)}}),l!=="seo"&&l!=="site"&&l!=="calendar"&&n.jsx(gv,{activeCollection:l,pages:V,sections:ee,availableSections:te,appCatalog:I,appCatalogLoading:E,blogEntries:Q,decofile:o,searchQuery:m,onSearchChange:p,postCategoryFilter:_,postAuthorFilter:v,postSort:g,onPostCategoryFilterChange:Y=>{L(Y),S(new Set)},onPostAuthorFilterChange:Y=>{x(Y),S(new Set)},onPostSortChange:y,selectedPostKeys:b,onTogglePostSelect:ye,onSelectAllPosts:Y=>S(new Set(Y)),onClearPostSelection:()=>S(new Set),onBulkUpdateCategory:()=>X({count:b.size}),onBulkDeletePosts:()=>H({kind:"blog-bulk",keys:[...b],count:b.size}),selection:c,onSelect:Y=>{h(Y),f(null)},onCreate:()=>{l==="pages"?De():Tn(l)&&nt(l)},onDuplicatePage:Ie,onRenamePage:Me,onAddPageVariant:be,onDeletePage:Y=>H({kind:"page",key:Y.key,label:Y.name}),onEditPageSeo:Y=>{h({collection:"pages",key:Y.key,path:Y.path}),f(Y.key)},onViewPageJson:Y=>J(Y.key),onDuplicateSection:Be,onRenameSection:Y=>q(Y.key),onDeleteSection:Y=>H({kind:"section",key:Y.key,label:Y.name}),onDuplicateBlog:Ve,onDeleteBlog:Y=>H({kind:"blog",blogKind:Y.kind,key:Y.key,label:Y.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(M.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),children:l==="calendar"?n.jsx(av,{decofile:o}):l==="site"?ae?n.jsx(Fc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:ae.key,block:o[ae.key],decofile:o,meta:T,title:"Site",excludeFields:["seo"],schemaPending:k(ae.resolveType,["seo"]),previewBaseUrl:i},`site:${ae.key}`):n.jsx(Ni,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):l==="seo"?n.jsx(ov,{orgSlug:t,virtualMcpId:e,branch:s,decofile:o,meta:T,target:{kind:"site"},previewBaseUrl:i}):l==="sections"?n.jsx(mv,{selection:c?.collection==="sections"||c?.collection==="available-section"?c:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i,meta:T,decofile:o,isCreating:R.isPending,onCreateAvailable:ge,onSaveReferencedBlock:we}):c&&c.collection!=="available-section"?c.collection==="apps"?n.jsx(Fc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:c.key,block:o[c.key],decofile:o,meta:T,previewBaseUrl:i,schemaPending:k(typeof o[c.key]?.__resolveType=="string"?String(o[c.key].__resolveType):void 0)},`app:${c.key}`):c.collection==="posts"?n.jsx(sv,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:c.key,block:o[c.key],decofile:o,meta:T,previewBaseUrl:i},`post:${c.key}`):c.collection==="categories"?n.jsx(nv,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:c.key,block:o[c.key],decofile:o,meta:T,onManagePosts:_e,onOpenPost:Y=>{d("posts"),N("posts"),h({collection:"posts",key:Y}),f(null)},previewBaseUrl:i},`category:${c.key}`):c.collection==="authors"?n.jsx(iv,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:c.key,block:o[c.key]},`authors:${c.key}`):n.jsx(rv,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:i??void 0,currentPath:c.collection==="pages"?c.path:"/",activePageBlockKey:c.collection==="pages"?c.key:null,activeGlobalBlockKey:c.collection==="sections"?c.key:null,initialEditSeo:c.collection==="pages"&&u===c.key,onExitSeo:()=>f(null)},c.collection==="pages"?`page:${c.key}`:`section:${c.key}`):n.jsx(Ni,{title:`Select ${Tn(l)?`a ${En[l]}`:l==="pages"?"a page":l==="apps"?"an app":"a section"} to edit`,description:l==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),$&&n.jsx(D8,{open:!!$,mode:$.mode,initialName:$.initialName,initialPath:$.initialPath,isPending:R.isPending,error:z,validate:Je,onSubmit:He,onOpenChange:Y=>{Y||(K(null),U(void 0))}}),G&&n.jsx(I8,{open:!!G,blockKey:G,initialName:ee.find(Y=>Y.key===G)?.name??G,isPending:R.isPending,onSubmit:Ne,onOpenChange:Y=>{Y||q(null)}}),Z&&n.jsx(tv,{open:!!Z,onOpenChange:Y=>{Y||J(null)},pageKey:Z,decofile:o}),B&&n.jsx(Tv,{count:B.count,categories:se,isPending:D.isPending,onApply:(Y,me)=>{Ze(Y,me)},onOpenChange:Y=>{!Y&&!D.isPending&&X(null)}}),n.jsx(Dr,{open:!!W,onOpenChange:Y=>{!Y&&!Ke&&H(null)},children:n.jsxs(Ir,{children:[n.jsxs(Mr,{children:[n.jsx(Br,{children:`Delete ${ce}?`}),n.jsx(Or,{children:W?.kind==="section"?`"${W.label}" will be removed. Pages that still reference it will lose this section.`:W?.kind==="blog-bulk"?`${W.count} ${W.count===1?"post":"posts"} will be removed permanently. This can't be undone.`:W?`"${W.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs($r,{children:[n.jsx(zr,{disabled:Ke,children:"Cancel"}),n.jsx(Fr,{onClick:Y=>{Y.preventDefault(),Xe()},disabled:Ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ke?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Deleting…"]}):"Delete"})]})]})})]})}function mv(t){const e=F.c(30),{selection:s,orgSlug:i,virtualMcpId:r,branch:o,previewUrl:a,meta:l,decofile:d,isCreating:c,onCreateAvailable:h,onSaveReferencedBlock:u}=t;if(!s){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Ni,{title:"Select a section to edit",description:"Pick a saved section to edit it, or an available one to customize and save as global."}),e[0]=p):p=e[0],p}if(s.collection==="available-section"){const p=`available:${s.resolveType}`,_=s.resolveType,L=s.title;let v;e[1]!==s.title?(v=A_(s.title),e[1]=s.title,e[2]=v):v=e[2];let x;e[3]!==h||e[4]!==s.resolveType?(x=(y,b)=>h(s.resolveType,y,b),e[3]=h,e[4]=s.resolveType,e[5]=x):x=e[5];let g;return e[6]!==o||e[7]!==d||e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==i||e[12]!==a||e[13]!==s.resolveType||e[14]!==s.title||e[15]!==p||e[16]!==v||e[17]!==x||e[18]!==r?(g=n.jsx(y8,{orgSlug:i,virtualMcpId:r,branch:o,previewUrl:a,meta:l,decofile:d,resolveType:_,title:L,defaultBlockId:v,isCreating:c,onCreate:x,onSaveReferencedBlock:u},p),e[6]=o,e[7]=d,e[8]=c,e[9]=l,e[10]=u,e[11]=i,e[12]=a,e[13]=s.resolveType,e[14]=s.title,e[15]=p,e[16]=v,e[17]=x,e[18]=r,e[19]=g):g=e[19],g}const f=`saved:${s.key}`;let m;return e[20]!==o||e[21]!==d||e[22]!==l||e[23]!==u||e[24]!==i||e[25]!==a||e[26]!==s.key||e[27]!==f||e[28]!==r?(m=n.jsx(w8,{orgSlug:i,virtualMcpId:r,branch:o,previewUrl:a,meta:l,decofile:d,blockKey:s.key,onSaveReferencedBlock:u},f),e[20]=o,e[21]=d,e[22]=l,e[23]=u,e[24]=i,e[25]=a,e[26]=s.key,e[27]=f,e[28]=r,e[29]=m):m=e[29],m}function Wc(t){const e=F.c(8),{icon:s,label:i,className:r}=t;let o;e[0]!==r?(o=le("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==s?(a=n.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=a):a=e[3];let l;return e[4]!==i||e[5]!==o||e[6]!==a?(l=n.jsxs("div",{className:o,children:[a,i]}),e[4]=i,e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function pv(t){const e=F.c(37),{active:s,counts:i,showBlog:r,onSelect:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:"Content"})}),e[0]=a):a=e[0];const l=s==="pages";let d;e[1]!==i.pages||e[2]!==o||e[3]!==l?(d=n.jsx(Ns,{id:"pages",icon:Ti,label:"Pages",count:i.pages,active:l,onSelect:o}),e[1]=i.pages,e[2]=o,e[3]=l,e[4]=d):d=e[4];const c=s==="sections";let h;e[5]!==i.sections||e[6]!==o||e[7]!==c?(h=n.jsx(Ns,{id:"sections",icon:ri,label:"Sections",count:i.sections,active:c,onSelect:o}),e[5]=i.sections,e[6]=o,e[7]=c,e[8]=h):h=e[8];const u=s==="apps";let f;e[9]!==i.apps||e[10]!==o||e[11]!==u?(f=n.jsx(Ns,{id:"apps",icon:eh,label:"Apps",count:i.apps,active:u,onSelect:o}),e[9]=i.apps,e[10]=o,e[11]=u,e[12]=f):f=e[12];const m=s==="site";let p;e[13]!==o||e[14]!==m?(p=n.jsx(Ns,{id:"site",icon:Y2,label:"Site",active:m,onSelect:o}),e[13]=o,e[14]=m,e[15]=p):p=e[15];const _=s==="seo";let L;e[16]!==o||e[17]!==_?(L=n.jsx(Ns,{id:"seo",icon:Pr,label:"SEO",active:_,onSelect:o}),e[16]=o,e[17]=_,e[18]=L):L=e[18];const v=s==="calendar";let x;e[19]!==o||e[20]!==v?(x=n.jsx(Ns,{id:"calendar",icon:Md,label:"Calendar",active:v,onSelect:o}),e[19]=o,e[20]=v,e[21]=x):x=e[21];let g;e[22]!==s||e[23]!==i.authors||e[24]!==i.categories||e[25]!==i.posts||e[26]!==o||e[27]!==r?(g=r&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[n.jsx(La,{size:13,className:"shrink-0"}),"Blog"]}),n.jsx(Ns,{id:"posts",icon:Di,label:"Posts",count:i.posts,active:s==="posts",onSelect:o}),n.jsx(Ns,{id:"authors",icon:Tl,label:"Authors",count:i.authors,active:s==="authors",onSelect:o}),n.jsx(Ns,{id:"categories",icon:yl,label:"Categories",count:i.categories,active:s==="categories",onSelect:o})]}),e[22]=s,e[23]=i.authors,e[24]=i.categories,e[25]=i.posts,e[26]=o,e[27]=r,e[28]=g):g=e[28];let y;return e[29]!==L||e[30]!==x||e[31]!==g||e[32]!==d||e[33]!==h||e[34]!==f||e[35]!==p?(y=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[a,n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[d,h,f,p,L,x,g]})]}),e[29]=L,e[30]=x,e[31]=g,e[32]=d,e[33]=h,e[34]=f,e[35]=p,e[36]=y):y=e[36],y}function Ns(t){const e=F.c(18),{id:s,icon:i,label:r,count:o,active:a,onSelect:l}=t;let d;e[0]!==s||e[1]!==l?(d=()=>l(s),e[0]=s,e[1]=l,e[2]=d):d=e[2];const c=a?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==c?(h=le("flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",c),e[3]=c,e[4]=h):h=e[4];let u;e[5]!==i?(u=n.jsx(i,{size:16,className:"shrink-0"}),e[5]=i,e[6]=u):u=e[6];let f;e[7]!==r?(f=n.jsx("span",{className:"flex-1 truncate",children:r}),e[7]=r,e[8]=f):f=e[8];let m;e[9]!==a||e[10]!==o?(m=o!==void 0&&n.jsx("span",{className:le("shrink-0 text-xs tabular-nums",a?"text-accent-foreground/70":"text-muted-foreground/70"),children:o}),e[9]=a,e[10]=o,e[11]=m):m=e[11];let p;return e[12]!==d||e[13]!==h||e[14]!==u||e[15]!==f||e[16]!==m?(p=n.jsxs("button",{type:"button",onClick:d,className:h,children:[u,f,m]}),e[12]=d,e[13]=h,e[14]=u,e[15]=f,e[16]=m,e[17]=p):p=e[17],p}function gv(t){const e=F.c(75),{activeCollection:s,pages:i,sections:r,availableSections:o,appCatalog:a,appCatalogLoading:l,blogEntries:d,decofile:c,searchQuery:h,onSearchChange:u,postCategoryFilter:f,postAuthorFilter:m,postSort:p,onPostCategoryFilterChange:_,onPostAuthorFilterChange:L,onPostSortChange:v,selectedPostKeys:x,onTogglePostSelect:g,onSelectAllPosts:y,onClearPostSelection:b,onBulkUpdateCategory:S,onBulkDeletePosts:w,selection:C,onSelect:N,onCreate:T,onDuplicatePage:A,onRenamePage:j,onAddPageVariant:k,onDeletePage:I,onEditPageSeo:E,onViewPageJson:R,onDuplicateSection:P,onRenameSection:D,onDeleteSection:O,onDuplicateBlog:$,onDeleteBlog:K}=t;let z,U,G,q,W,H,Z;if(e[0]!==s||e[1]!==a||e[2]!==l||e[3]!==o||e[4]!==d||e[5]!==c||e[6]!==k||e[7]!==w||e[8]!==S||e[9]!==b||e[10]!==T||e[11]!==K||e[12]!==I||e[13]!==O||e[14]!==$||e[15]!==A||e[16]!==P||e[17]!==E||e[18]!==L||e[19]!==_||e[20]!==v||e[21]!==j||e[22]!==D||e[23]!==u||e[24]!==N||e[25]!==y||e[26]!==g||e[27]!==R||e[28]!==i||e[29]!==m||e[30]!==f||e[31]!==p||e[32]!==h||e[33]!==r||e[34]!==x||e[35]!==C){const V=h.toLowerCase(),ee=i.filter(ce=>!V||ce.name.toLowerCase().includes(V)||ce.path.toLowerCase().includes(V)),te=r.filter(ce=>!V||ce.name.toLowerCase().includes(V)||ce.key.toLowerCase().includes(V)||ce.resolveType.toLowerCase().includes(V)),ae=o.filter(ce=>!V||ce.title.toLowerCase().includes(V)||ce.resolveType.toLowerCase().includes(V)||(ce.description?.toLowerCase().includes(V)??!1)),de=cv(te),fe=a.filter(ce=>!V||ce.title.toLowerCase().includes(V)||ce.app.toLowerCase().includes(V)||ce.vendor.toLowerCase().includes(V)||ce.category.toLowerCase().includes(V)),Q=d.filter(ce=>!V||ce.label.toLowerCase().includes(V)||ce.subtitle.toLowerCase().includes(V)),se=s==="posts",oe=xv,he=se?F8(c):[],xe=new Map,ve=new Map;for(const ce of he){for(const Y of ce.categorySlugs)xe.set(Y,(xe.get(Y)??0)+1);for(const Y of ce.authorEmails)ve.set(Y,(ve.get(Y)??0)+1)}const be=(se?Un(c,"categories"):[]).map(ce=>{const{key:Y,payload:me}=ce,Se=oe(me.slug)||Y;return{slug:Se,name:oe(me.name)||oe(me.slug)||Y,count:xe.get(Se)??0}}).filter(vv),De=(se?Un(c,"authors"):[]).map(ce=>{const{key:Y,payload:me}=ce,Se=oe(me.email);return{email:Se,name:oe(me.name)||oe(me.email)||Y,count:ve.get(Se)??0}}).filter(Lv);let Ie;e[43]!==f?(Ie=ce=>!f||ce.categorySlugs.includes(f),e[43]=f,e[44]=Ie):Ie=e[44];let Me;e[45]!==m?(Me=ce=>!m||ce.authorEmails.includes(m),e[45]=m,e[46]=Me):Me=e[46];let He;e[47]!==p?(He=(ce,Y)=>{if(p==="az")return ce.title.localeCompare(Y.title);if(p==="za")return Y.title.localeCompare(ce.title);const me=ce.date.localeCompare(Y.date);return p==="date-asc"?me:-me},e[47]=p,e[48]=He):He=e[48];const Je=he.filter(ce=>!V||ce.title.toLowerCase().includes(V)||ce.slug.toLowerCase().includes(V)).filter(Ie).filter(Me).sort(He),ge=x.size,we=Je.map(_v),Be=we.length>0&&we.every(ce=>x.has(ce)),Ne=ge>0,nt=()=>{Be?b():y(we)},Ve=`Search ${s}…`,ye=Tn(s)?`Create new ${En[s]}`:"Create new page",_e=s!=="apps"&&s!=="sections";W="w-[300px] shrink-0 border-r flex flex-col min-h-0";let Ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(Ue=n.jsx(Zd,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[49]=Ue):Ue=e[49];let Ze;e[50]!==u?(Ze=ce=>u(ce.target.value),e[50]=u,e[51]=Ze):Ze=e[51];let Xe;e[52]!==Ve||e[53]!==h||e[54]!==Ze?(Xe=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[Ue,n.jsx("input",{type:"text",value:h,onChange:Ze,placeholder:Ve,"aria-label":Ve,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[52]=Ve,e[53]=h,e[54]=Ze,e[55]=Xe):Xe=e[55];let Ke;e[56]!==ye||e[57]!==T||e[58]!==_e?(Ke=_e&&n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:T,"aria-label":ye,children:n.jsx(Dt,{size:14})})}),n.jsx(Te,{side:"bottom",children:ye})]}),e[56]=ye,e[57]=T,e[58]=_e,e[59]=Ke):Ke=e[59],e[60]!==Xe||e[61]!==Ke?(H=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Xe,Ke]}),e[60]=Xe,e[61]=Ke,e[62]=H):H=e[62],Z=se&&(Ne?n.jsx(Ev,{count:ge,allSelected:Be,onToggleSelectAll:nt,onUpdateCategory:S,onDelete:w,onExit:b}):n.jsx(bv,{categories:be,authors:De,categoryFilter:f,authorFilter:m,sort:p,onCategoryFilterChange:_,onAuthorFilterChange:L,onSortChange:v})),z=Wi,q="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",U="flex flex-col gap-1 p-1.5",G=s==="pages"?ee.length===0?n.jsx(ln,{hasItems:i.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):ee.map(ce=>{const Y=C?.collection==="pages"&&C.key===ce.key,me=au(c,ce.key);return n.jsx(Si,{icon:Ti,title:ce.name,subtitle:ce.path,active:Y,variantCount:me,onClick:()=>N({collection:"pages",key:ce.key,path:ce.path}),menu:n.jsx(pr,{onDuplicate:()=>A(ce),onRename:()=>j(ce),onAddVariant:()=>k(ce),onEditSeo:()=>E(ce),onViewJson:()=>R(ce),onDelete:()=>I(ce)})},ce.key)}):s==="sections"?te.length===0&&ae.length===0?n.jsx(ln,{hasItems:r.length>0||o.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[de.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Wc,{icon:ri,label:"Saved sections"}),de.map(ce=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:ce.label}),ce.sections.map(Y=>{const me=C?.collection==="sections"&&C.key===Y.key;return n.jsx(Si,{icon:ri,accent:"global",title:Y.name,subtitle:ce.label,active:me,onClick:()=>N({collection:"sections",key:Y.key}),menu:n.jsx(pr,{onDuplicate:()=>P(Y),onRename:()=>D(Y),onDelete:()=>O(Y)})},Y.key)})]},ce.label))]}),ae.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Wc,{icon:Ti,label:"Available sections",className:le(de.length>0&&"mt-3")}),ae.map(ce=>{const Y=C?.collection==="available-section"&&C.resolveType===ce.resolveType,me=ce.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(Si,{icon:Ti,title:ce.title,subtitle:me??ce.resolveType,active:Y,onClick:()=>N({collection:"available-section",resolveType:ce.resolveType,title:ce.title})},ce.resolveType)})]})]}):s==="apps"?l?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Oe,{size:18,className:"animate-spin text-muted-foreground"})}):fe.length===0?n.jsx(ln,{hasItems:a.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):fe.map(ce=>{const Y=C?.collection==="apps"&&ce.blockKey!==null&&C.key===ce.blockKey;return n.jsx(Si,{icon:eh,logoUrl:ce.logo,title:ce.title,subtitle:ce.category,active:Y,trailing:ce.installed?n.jsx("span",{className:"shrink-0 rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-700 dark:text-emerald-400",children:"Installed"}):void 0,onClick:()=>{if(!ce.installed||!ce.blockKey){ue.message(`${ce.title} is not installed on this site.`);return}N({collection:"apps",key:ce.blockKey})}},ce.id)}):se?Je.length===0?n.jsx(ln,{hasItems:he.length>0,emptyLabel:"No posts yet.",emptyHint:'Click "+" to create your first post.'}):Je.map(ce=>{const Y={key:ce.key,kind:"posts",label:ce.title,subtitle:ce.slug};return n.jsx(Si,{icon:Di,title:ce.title,subtitle:ce.slug,active:C?.collection==="posts"&&C.key===ce.key,selectable:!0,selectionActive:Ne,selected:x.has(ce.key),onToggleSelect:()=>g(ce.key),onClick:()=>Ne?g(ce.key):N({collection:"posts",key:ce.key}),menu:n.jsx(pr,{onDuplicate:()=>$(Y),onDelete:()=>K(Y)})},ce.key)}):Q.length===0?n.jsx(ln,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${Tn(s)?En[s]:"item"}.`}):Q.map(ce=>{const Y=C?.collection===ce.kind&&C.key===ce.key;return n.jsx(Si,{icon:ce.kind==="posts"?Di:ce.kind==="authors"?Tl:yl,title:ce.label,subtitle:ce.subtitle,active:Y,onClick:()=>N({collection:ce.kind,key:ce.key}),menu:n.jsx(pr,{onDuplicate:()=>$(ce),onDelete:()=>K(ce)})},ce.key)}),e[0]=s,e[1]=a,e[2]=l,e[3]=o,e[4]=d,e[5]=c,e[6]=k,e[7]=w,e[8]=S,e[9]=b,e[10]=T,e[11]=K,e[12]=I,e[13]=O,e[14]=$,e[15]=A,e[16]=P,e[17]=E,e[18]=L,e[19]=_,e[20]=v,e[21]=j,e[22]=D,e[23]=u,e[24]=N,e[25]=y,e[26]=g,e[27]=R,e[28]=i,e[29]=m,e[30]=f,e[31]=p,e[32]=h,e[33]=r,e[34]=x,e[35]=C,e[36]=z,e[37]=U,e[38]=G,e[39]=q,e[40]=W,e[41]=H,e[42]=Z}else z=e[36],U=e[37],G=e[38],q=e[39],W=e[40],H=e[41],Z=e[42];let J;e[63]!==U||e[64]!==G?(J=n.jsx("div",{className:U,children:G}),e[63]=U,e[64]=G,e[65]=J):J=e[65];let B;e[66]!==z||e[67]!==q||e[68]!==J?(B=n.jsx(z,{className:q,children:J}),e[66]=z,e[67]=q,e[68]=J,e[69]=B):B=e[69];let X;return e[70]!==W||e[71]!==H||e[72]!==Z||e[73]!==B?(X=n.jsxs("div",{className:W,children:[H,Z,B]}),e[70]=W,e[71]=H,e[72]=Z,e[73]=B,e[74]=X):X=e[74],X}function _v(t){return t.key}function Lv(t){return t.email}function vv(t){return t.slug}function xv(t){return typeof t=="string"?t:""}const Vc="__all__",Hu={"date-desc":"Newest first","date-asc":"Oldest first",az:"Title A–Z",za:"Title Z–A"},yv={"date-desc":"Newest","date-asc":"Oldest",az:"A–Z",za:"Z–A"},Kc=M.forwardRef(function(e,s){const i=F.c(20);let r,o,a,l,d;i[0]!==e?({icon:r,active:o,value:d,className:a,...l}=e,i[0]=e,i[1]=r,i[2]=o,i[3]=a,i[4]=l,i[5]=d):(r=i[1],o=i[2],a=i[3],l=i[4],d=i[5]);const c=o?"text-foreground":"text-muted-foreground";let h;i[6]!==a||i[7]!==c?(h=le("h-7 gap-1 px-1.5 text-xs",c,a),i[6]=a,i[7]=c,i[8]=h):h=i[8];let u;i[9]!==r?(u=n.jsx(r,{size:14,className:"shrink-0"}),i[9]=r,i[10]=u):u=i[10];let f;i[11]!==d?(f=d&&n.jsx("span",{className:"min-w-0 flex-1 truncate",children:d}),i[11]=d,i[12]=f):f=i[12];let m;i[13]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(ds,{size:12,className:"shrink-0 opacity-60"}),i[13]=m):m=i[13];let p;return i[14]!==l||i[15]!==s||i[16]!==h||i[17]!==u||i[18]!==f?(p=n.jsxs(ie,{ref:s,type:"button",variant:"ghost",size:"sm",className:h,...l,children:[u,f,m]}),i[14]=l,i[15]=s,i[16]=h,i[17]=u,i[18]=f,i[19]=p):p=i[19],p});function Uu(t){const e=F.c(2),{count:s}=t;let i;return e[0]!==s?(i=n.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=i):i=e[1],i}function bv(t){const e=F.c(60),{categories:s,authors:i,categoryFilter:r,authorFilter:o,sort:a,onCategoryFilterChange:l,onAuthorFilterChange:d,onSortChange:c}=t;let h;if(e[0]!==s||e[1]!==r){let G;e[3]!==r?(G=q=>q.slug===r,e[3]=r,e[4]=G):G=e[4],h=s.find(G),e[0]=s,e[1]=r,e[2]=h}else h=e[2];const u=h;let f;if(e[5]!==o||e[6]!==i){let G;e[8]!==o?(G=q=>q.email===o,e[8]=o,e[9]=G):G=e[9],f=i.find(G),e[5]=o,e[6]=i,e[7]=f}else f=e[7];const m=f,p=!!(r||o),_=u?.name??m?.name??"Filter",L=r?`cat:${r}`:o?`author:${o}`:Vc;let v;e[10]!==d||e[11]!==l?(v=()=>{l(null),d(null)},e[10]=d,e[11]=l,e[12]=v):v=e[12];const x=v;let g;e[13]!==x||e[14]!==d||e[15]!==l?(g=G=>{G.startsWith("cat:")?(d(null),l(G.slice(4))):G.startsWith("author:")?(l(null),d(G.slice(7))):x()},e[13]=x,e[14]=d,e[15]=l,e[16]=g):g=e[16];const y=g;let b;e[17]!==_||e[18]!==p?(b=n.jsx(es,{asChild:!0,children:n.jsx(Kc,{icon:J2,active:p,value:_,className:"min-w-0 shrink"})}),e[17]=_,e[18]=p,e[19]=b):b=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ir,{children:"Filter by"}),e[20]=S):S=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(ho,{value:Vc,children:"All posts"}),e[21]=w):w=e[21];let C;e[22]!==s.length?(C=s.length>0&&n.jsx(ir,{className:"text-muted-foreground/70",children:"Category"}),e[22]=s.length,e[23]=C):C=e[23];let N;e[24]!==s?(N=s.map(Cv),e[24]=s,e[25]=N):N=e[25];let T;e[26]!==i.length?(T=i.length>0&&n.jsx(ir,{className:"text-muted-foreground/70",children:"Author"}),e[26]=i.length,e[27]=T):T=e[27];let A;e[28]!==i?(A=i.map(wv),e[28]=i,e[29]=A):A=e[29];let j;e[30]!==L||e[31]!==y||e[32]!==T||e[33]!==A||e[34]!==C||e[35]!==N?(j=n.jsxs(ts,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[S,n.jsxs(U9,{value:L,onValueChange:y,children:[w,C,N,T,A]})]}),e[30]=L,e[31]=y,e[32]=T,e[33]=A,e[34]=C,e[35]=N,e[36]=j):j=e[36];let k;e[37]!==j||e[38]!==b?(k=n.jsxs(Qt,{children:[b,j]}),e[37]=j,e[38]=b,e[39]=k):k=e[39];let I;e[40]!==x||e[41]!==p?(I=p&&n.jsx(kv,{label:"Clear filter",onClick:x}),e[40]=x,e[41]=p,e[42]=I):I=e[42];const E=yv[a];let R;e[43]!==E?(R=n.jsx(es,{asChild:!0,children:n.jsx(Kc,{icon:X2,active:!0,value:E})}),e[43]=E,e[44]=R):R=e[44];let P;e[45]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(ir,{children:"Sort by"}),e[45]=P):P=e[45];let D;e[46]!==c?(D=G=>c(G),e[46]=c,e[47]=D):D=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=Object.keys(Hu),e[48]=O):O=e[48];let $;e[49]===Symbol.for("react.memo_cache_sentinel")?($=O.map(Sv),e[49]=$):$=e[49];let K;e[50]!==a||e[51]!==D?(K=n.jsxs(ts,{align:"end",className:"w-44",children:[P,n.jsx(U9,{value:a,onValueChange:D,children:$})]}),e[50]=a,e[51]=D,e[52]=K):K=e[52];let z;e[53]!==R||e[54]!==K?(z=n.jsx("div",{className:"ml-auto shrink-0",children:n.jsxs(Qt,{children:[R,K]})}),e[53]=R,e[54]=K,e[55]=z):z=e[55];let U;return e[56]!==k||e[57]!==I||e[58]!==z?(U=n.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[k,I,z]}),e[56]=k,e[57]=I,e[58]=z,e[59]=U):U=e[59],U}function Sv(t){return n.jsx(ho,{value:t,children:Hu[t]},t)}function wv(t){return n.jsxs(ho,{value:`author:${t.email}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx(Uu,{count:t.count})]},`author:${t.email}`)}function Cv(t){return n.jsxs(ho,{value:`cat:${t.slug}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx(Uu,{count:t.count})]},`cat:${t.slug}`)}function kv(t){const e=F.c(4),{label:s,onClick:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(mo,{size:12}),e[0]=r):r=e[0];let o;return e[1]!==s||e[2]!==i?(o=n.jsx("button",{type:"button","aria-label":s,onClick:i,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:r}),e[1]=s,e[2]=i,e[3]=o):o=e[3],o}function jv(t){const e=F.c(12),{checked:s,disabled:i,onToggle:r}=t;let o;e[0]!==r?(o=()=>r(),e[0]=r,e[1]=o):o=e[1];const a=s?"Deselect all posts":"Select all posts";let l;e[2]!==s||e[3]!==i||e[4]!==o||e[5]!==a?(l=n.jsx(Ee,{asChild:!0,children:n.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:Nv,children:n.jsx(Yi,{checked:s,disabled:i,onCheckedChange:o,"aria-label":a})})}),e[2]=s,e[3]=i,e[4]=o,e[5]=a,e[6]=l):l=e[6];const d=s?"Deselect all":"Select all";let c;e[7]!==d?(c=n.jsx(Te,{side:"bottom",children:d}),e[7]=d,e[8]=c):c=e[8];let h;return e[9]!==l||e[10]!==c?(h=n.jsxs(Ae,{children:[l,c]}),e[9]=l,e[10]=c,e[11]=h):h=e[11],h}function Nv(t){return t.stopPropagation()}function Ev(t){const e=F.c(31),{count:s,allSelected:i,onToggleSelectAll:r,onUpdateCategory:o,onDelete:a,onExit:l}=t;let d;e[0]!==i||e[1]!==r?(d=n.jsx(jv,{checked:i,onToggle:r}),e[0]=i,e[1]=r,e[2]=d):d=e[2];let c;e[3]!==s?(c=n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[s," selected"]}),e[3]=s,e[4]=c):c=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(yl,{size:14}),e[5]=h):h=e[5];let u;e[6]!==o?(u=n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:o,"aria-label":"Set the category for the selected posts",children:[h,"Set category"]})}),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Te,{side:"bottom",children:"Set the category for the selected posts"}),e[8]=f):f=e[8];let m;e[9]!==u?(m=n.jsxs(Ae,{children:[u,f]}),e[9]=u,e[10]=m):m=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(ss,{size:14}),e[11]=p):p=e[11];let _;e[12]!==a?(_=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:a,"aria-label":"Delete selected posts",children:p})}),e[12]=a,e[13]=_):_=e[13];let L;e[14]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Te,{side:"bottom",children:"Delete selected"}),e[14]=L):L=e[14];let v;e[15]!==_?(v=n.jsxs(Ae,{children:[_,L]}),e[15]=_,e[16]=v):v=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(mo,{size:14}),e[17]=x):x=e[17];let g;e[18]!==l?(g=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l,"aria-label":"Exit selection",children:x})}),e[18]=l,e[19]=g):g=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Te,{side:"bottom",children:"Exit selection"}),e[20]=y):y=e[20];let b;e[21]!==g?(b=n.jsxs(Ae,{children:[g,y]}),e[21]=g,e[22]=b):b=e[22];let S;e[23]!==v||e[24]!==b||e[25]!==m?(S=n.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[m,v,b]}),e[23]=v,e[24]=b,e[25]=m,e[26]=S):S=e[26];let w;return e[27]!==d||e[28]!==S||e[29]!==c?(w=n.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[d,c,S]}),e[27]=d,e[28]=S,e[29]=c,e[30]=w):w=e[30],w}function Tv(t){const e=F.c(48),{count:s,categories:i,isPending:r,onApply:o,onOpenChange:a}=t,[l,d]=M.useState(i[0]?.slug??""),[c,h]=M.useState("add");let u;if(e[0]!==i||e[1]!==l){let D;e[3]!==l?(D=O=>O.slug===l,e[3]=l,e[4]=D):D=e[4],u=i.find(D),e[0]=i,e[1]=l,e[2]=u}else u=e[2];const f=u;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(ns,{children:"Update category"}),e[5]=m):m=e[5];const p=s===1?"post":"posts";let _;e[6]!==s||e[7]!==p?(_=n.jsxs(is,{children:[m,n.jsxs(qi,{children:["Choose a category to apply to ",s," ",p,"."]})]}),e[6]=s,e[7]=p,e[8]=_):_=e[8];let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx($e,{children:"Category"}),e[9]=L):L=e[9];let v;e[10]!==i||e[11]!==l?(v=n.jsxs("div",{className:"space-y-2",children:[L,i.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):n.jsxs(jt,{value:l,onValueChange:d,children:[n.jsx(Ct,{className:"w-full",children:n.jsx(Et,{placeholder:"Select a category"})}),n.jsx(kt,{children:i.map(Av)})]})]}),e[10]=i,e[11]=l,e[12]=v):v=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=D=>h(D),e[13]=x):x=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Lc,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[14]=g):g=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsxs($e,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[g,n.jsxs("span",{className:"space-y-0.5",children:[n.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),n.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[15]=y):y=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Lc,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[16]=b):b=e[16];let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsxs($e,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[b,n.jsxs("span",{className:"space-y-0.5",children:[n.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),n.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[17]=S):S=e[17];let w;e[18]!==c?(w=n.jsxs(L_,{value:c,onValueChange:x,className:"gap-2",children:[y,S]}),e[18]=c,e[19]=w):w=e[19];let C;e[20]!==w||e[21]!==v?(C=n.jsxs("div",{className:"space-y-4 py-2",children:[v,w]}),e[20]=w,e[21]=v,e[22]=C):C=e[22];let N;e[23]!==a?(N=()=>a(!1),e[23]=a,e[24]=N):N=e[24];let T;e[25]!==r||e[26]!==N?(T=n.jsx(ie,{type:"button",variant:"outline",onClick:N,disabled:r,children:"Cancel"}),e[25]=r,e[26]=N,e[27]=T):T=e[27];const A=!f||r;let j;e[28]!==c||e[29]!==o||e[30]!==f?(j=()=>f&&o(c,{name:f.name,slug:f.slug}),e[28]=c,e[29]=o,e[30]=f,e[31]=j):j=e[31];let k;e[32]!==r?(k=r?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[32]=r,e[33]=k):k=e[33];let I;e[34]!==A||e[35]!==j||e[36]!==k?(I=n.jsx(ie,{type:"button",disabled:A,onClick:j,children:k}),e[34]=A,e[35]=j,e[36]=k,e[37]=I):I=e[37];let E;e[38]!==T||e[39]!==I?(E=n.jsxs(qs,{children:[T,I]}),e[38]=T,e[39]=I,e[40]=E):E=e[40];let R;e[41]!==C||e[42]!==E||e[43]!==_?(R=n.jsxs($t,{className:"sm:max-w-md",children:[_,C,E]}),e[41]=C,e[42]=E,e[43]=_,e[44]=R):R=e[44];let P;return e[45]!==a||e[46]!==R?(P=n.jsx(Ot,{open:!0,onOpenChange:a,children:R}),e[45]=a,e[46]=R,e[47]=P):P=e[47],P}function Av(t){return n.jsx(et,{value:t.slug,children:n.jsx("span",{className:"truncate",children:t.name})},t.slug)}function Si(t){const e=F.c(37),{icon:s,logoUrl:i,title:r,subtitle:o,active:a,accent:l,variantCount:d,trailing:c,selectable:h,selectionActive:u,selected:f,onToggleSelect:m,onClick:p,menu:_}=t,L=l==="global";let v;e[0]!==s||e[1]!==a||e[2]!==L||e[3]!==i||e[4]!==d?(v=d&&d>1?n.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center",children:n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(s,{size:16,className:"shrink-0",style:{color:ja}})}),n.jsxs(Te,{side:"right",children:[d," variants"]})]})}):i?n.jsx("img",{src:i,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:le("flex size-8 shrink-0 items-center justify-center rounded-lg",L?"bg-global-section/15":"bg-muted"),children:n.jsx(s,{size:16,className:le("shrink-0",!L&&(a?"text-accent-foreground":"text-muted-foreground")),style:L?{color:ph}:void 0})}),e[0]=s,e[1]=a,e[2]=L,e[3]=i,e[4]=d,e[5]=v):v=e[5];const x=v,g=a?L?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":L?"hover:bg-global-section/10":"hover:bg-muted";let y;e[6]!==g?(y=le("group relative flex min-w-0 items-center rounded-md transition-colors",g),e[6]=g,e[7]=y):y=e[7];let b;e[8]!==m||e[9]!==h||e[10]!==f||e[11]!==u||e[12]!==r?(b=h&&n.jsx("span",{className:le("flex shrink-0 items-center pl-2.5 transition-opacity",f||u?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Rv,children:n.jsx(Yi,{checked:f,onCheckedChange:()=>m?.(),"aria-label":`Select ${r}`})}),e[8]=m,e[9]=h,e[10]=f,e[11]=u,e[12]=r,e[13]=b):b=e[13];let S;e[14]!==r?(S=n.jsx("span",{className:"block truncate text-sm font-medium",children:r}),e[14]=r,e[15]=S):S=e[15];const w=a?"text-accent-foreground/70":"text-muted-foreground";let C;e[16]!==w?(C=le("block truncate text-xs",w),e[16]=w,e[17]=C):C=e[17];let N;e[18]!==o||e[19]!==C?(N=n.jsx("span",{className:C,children:o}),e[18]=o,e[19]=C,e[20]=N):N=e[20];let T;e[21]!==S||e[22]!==N?(T=n.jsxs("span",{className:"min-w-0 flex-1",children:[S,N]}),e[21]=S,e[22]=N,e[23]=T):T=e[23];let A;e[24]!==p||e[25]!==x||e[26]!==T||e[27]!==c?(A=n.jsxs("button",{type:"button",onClick:p,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-2 text-left cursor-pointer",children:[x,T,c]}),e[24]=p,e[25]=x,e[26]=T,e[27]=c,e[28]=A):A=e[28];let j;e[29]!==a||e[30]!==_?(j=_&&n.jsx("div",{className:le("pr-1 opacity-0 transition-opacity group-hover:opacity-100",a&&"opacity-100"),children:_}),e[29]=a,e[30]=_,e[31]=j):j=e[31];let k;return e[32]!==A||e[33]!==j||e[34]!==y||e[35]!==b?(k=n.jsxs("div",{className:y,children:[b,A,j]}),e[32]=A,e[33]=j,e[34]=y,e[35]=b,e[36]=k):k=e[36],k}function Rv(t){return t.stopPropagation()}function pr(t){const e=F.c(21),{onDuplicate:s,onRename:i,onAddVariant:r,onEditSeo:o,onViewJson:a,onDelete:l}=t;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(es,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"More actions",className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Pv,children:n.jsx(Vi,{size:14})})}),e[0]=d):d=e[0];let c;e[1]!==i?(c=i&&n.jsxs(We,{onClick:i,children:[n.jsx(Al,{size:14}),"Rename"]}),e[1]=i,e[2]=c):c=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Xt,{size:14}),e[3]=h):h=e[3];let u;e[4]!==s?(u=n.jsxs(We,{onClick:s,children:[h,"Duplicate"]}),e[4]=s,e[5]=u):u=e[5];let f;e[6]!==r?(f=r&&n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),n.jsxs(We,{onClick:r,className:"cursor-pointer",style:{color:ja},children:[n.jsx(Bd,{size:14,style:{color:ja}}),"Add variant"]})]}),e[6]=r,e[7]=f):f=e[7];let m;e[8]!==o||e[9]!==a?(m=(o||a)&&n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),o&&n.jsxs(We,{onClick:o,children:[n.jsx(Pr,{size:14}),"Edit SEO"]}),a&&n.jsxs(We,{onClick:a,children:[n.jsx(lo,{size:14}),"View JSON"]})]}),e[8]=o,e[9]=a,e[10]=m):m=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Cn,{}),e[11]=p):p=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ss,{size:14}),e[12]=_):_=e[12];let L;e[13]!==l?(L=n.jsxs(We,{onClick:l,className:"text-destructive focus:text-destructive",children:[_,"Delete"]}),e[13]=l,e[14]=L):L=e[14];let v;return e[15]!==c||e[16]!==u||e[17]!==f||e[18]!==m||e[19]!==L?(v=n.jsxs(Qt,{children:[d,n.jsxs(ts,{align:"end",className:"w-44",children:[c,u,f,m,p,L]})]}),e[15]=c,e[16]=u,e[17]=f,e[18]=m,e[19]=L,e[20]=v):v=e[20],v}function Pv(t){return t.stopPropagation()}function ln(t){const e=F.c(6),{hasItems:s,emptyLabel:i,emptyHint:r}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s?(o=s?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:i}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:r})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o):o=e[3];let a;return e[4]!==o?(a=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:o}),e[4]=o,e[5]=a):a=e[5],a}function Dv(t){const e=F.c(8),{state:s,claimPhase:i,lifecycle:r,onStart:o}=t;switch(s.kind){case"starting":{let a;e[0]!==i||e[1]!==r?(a=uu({claimPhase:i,lifecycle:r}),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;return e[3]!==i||e[4]!==a?(l=n.jsx(Jr,{kind:"starting",progress:a,claimPhase:i}),e[3]=i,e[4]=a,e[5]=l):l=e[5],l}case"suspended":{let a;return e[6]!==o?(a=n.jsx(Jr,{kind:"suspended",onResume:o}),e[6]=o,e[7]=a):a=e[7],a}}}function Ni(t){const e=F.c(10),{icon:s,title:i,description:r}=t;let o;e[0]!==s?(o=s&&n.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=o):o=e[1];let a;e[2]!==i?(a=n.jsx("div",{children:i}),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==r?(l=r&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:r}),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==o||e[7]!==a||e[8]!==l?(d=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[o,a,l]}),e[6]=o,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function Iv(t){const e=F.c(2),{virtualMcpId:s}=t,i=xs(s);if(!ni(i?.metadata)){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[n.jsx(Ui,{size:24,className:"text-muted-foreground/60"}),n.jsx("div",{children:"No content to edit."}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Connect a GitHub repository from the Settings tab to enable Content."})]}),e[0]=a):a=e[0],a}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(dv,{}),e[1]=o):o=e[1],o}const qo={fast:{label:"Fast",subtitle:"Quick responses for simple tasks",icon:Pd},smart:{label:"Smart",subtitle:"Balanced quality and speed",icon:ti},thinking:{label:"Thinking",subtitle:"Deeper reasoning for hard tasks",icon:tm}},Mv=["fast","smart","thinking"];function Bv(t){const e=F.c(15),{tier:s,onSelect:i}=t,[r,o]=M.useState(!1),a=qo[s].icon;let l;e[0]!==a?(l=n.jsx(a,{size:14,className:"text-muted-foreground"}),e[0]=a,e[1]=l):l=e[1];const d=qo[s];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ds,{size:14,className:"text-muted-foreground"}),e[2]=c):c=e[2];let h;e[3]!==l||e[4]!==d.label?(h=n.jsx(Ss,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[l,d.label,c]})}),e[3]=l,e[4]=d.label,e[5]=h):h=e[5];let u;e[6]!==i||e[7]!==s?(u=Mv.map(p=>{const _=qo[p],L=_.icon;return n.jsxs("button",{type:"button",onClick:()=>{i(p),o(!1)},className:le("flex items-start gap-2 px-2 py-1.5 rounded-md text-left hover:bg-muted"),children:[n.jsx(L,{size:16,className:"shrink-0 text-muted-foreground mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"text-sm",children:_.label}),n.jsx("div",{className:"text-xs text-muted-foreground",children:_.subtitle})]}),p===s&&n.jsx(Ls,{size:14,className:"text-foreground mt-0.5"})]},p)}),e[6]=i,e[7]=s,e[8]=u):u=e[8];let f;e[9]!==u?(f=n.jsx(ws,{align:"start",className:"p-1 w-64",children:n.jsx("div",{className:"flex flex-col",children:u})}),e[9]=u,e[10]=f):f=e[10];let m;return e[11]!==r||e[12]!==h||e[13]!==f?(m=n.jsxs(bs,{open:r,onOpenChange:o,children:[h,f]}),e[11]=r,e[12]=h,e[13]=f,e[14]=m):m=e[14],m}function Ov(t){const e=F.c(15),{tier:s,onTierChange:i,override:r,onOverrideChange:o}=t,[a,l]=M.useState(r!==null);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Model"}),e[0]=d):d=e[0];let c;e[1]!==o||e[2]!==i||e[3]!==r||e[4]!==s||e[5]!==a?(c=a?n.jsx(M.Suspense,{fallback:n.jsx(ie,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:"Loading models…"}),children:n.jsx($v,{override:r,onOverrideChange:o})}):n.jsx(Bv,{tier:s,onSelect:i}),e[1]=o,e[2]=i,e[3]=r,e[4]=s,e[5]=a,e[6]=c):c=e[6];let h;e[7]!==o?(h=m=>{l(m),m||o(null)},e[7]=o,e[8]=h):h=e[8];let u;e[9]!==h||e[10]!==a?(u=n.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none",children:[n.jsx(Mn,{checked:a,onCheckedChange:h,className:"cursor-pointer"}),"Specific model"]}),e[9]=h,e[10]=a,e[11]=u):u=e[11];let f;return e[12]!==c||e[13]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-2",children:[d,n.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c,u]})]}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}function $v(t){const e=F.c(10),{override:s,onOverrideChange:i}=t,r=bd(),o=r[0]?.id??null,[a,l]=M.useState(s?.credentialId??o);let d;e[0]!==s?(d=s?{modelId:s.modelId,title:s.title||s.modelId,keyId:s.credentialId,providerId:"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[0]=s,e[1]=d):d=e[1];const c=d;if(r.length===0){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("span",{className:"text-xs text-muted-foreground italic",children:"Connect an AI provider in settings to pick a specific model."}),e[2]=f):f=e[2],f}let h;e[3]!==a||e[4]!==i?(h=f=>{const m=f.keyId??a??"";l(m),i({modelId:f.modelId,credentialId:m,title:f.title??f.modelId})},e[3]=a,e[4]=i,e[5]=h):h=e[5];let u;return e[6]!==a||e[7]!==c||e[8]!==h?(u=n.jsx("div",{className:"w-fit max-w-full [&_button]:rounded-md",children:n.jsx(Hm,{variant:"bordered",placeholder:"Pick a model",model:c,credentialId:a,onCredentialChange:l,onModelChange:h})}),e[6]=a,e[7]=c,e[8]=h,e[9]=u):u=e[9],u}const Wu=[{key:"capabilities",heading:"Built-in capabilities",icon:Rl,tools:[{name:"web_search",title:"Web search",description:"Look up current information on the web",icon:Ki},{name:"generate_image",title:"Generate image",description:"Create images from a text prompt",icon:oi},{name:"subtask",title:"Subtask",description:"Spawn a focused sub-agent to handle part of the work",icon:Dn},{name:"user_ask",title:"Ask the user",description:"Pause to ask the user a clarifying question",icon:Z2}]},{key:"files",heading:"Files & code",icon:_a,tools:[{name:"read",title:"Read File",description:"Read a file from the workspace",icon:Vd},{name:"write",title:"Write File",description:"Create or overwrite a file",icon:Al},{name:"edit",title:"Edit File",description:"Make targeted edits to an existing file",icon:Q2},{name:"grep",title:"Search Content",description:"Search file contents by pattern",icon:Bn},{name:"glob",title:"Find Files",description:"Find files by name pattern",icon:_a},{name:"bash",title:"Run Command",description:"Run shell commands in the sandbox",icon:em}]},{key:"context",heading:"Context",icon:H9,tools:[{name:"read_resource",title:"Read Resource",description:"Read an MCP resource by URI",icon:H9},{name:"read_prompt",title:"Read Prompt",description:"Read an MCP prompt definition",icon:La},{name:"skill",title:"Load Skill",description:"Load a skill's full instructions (SKILL.md) by id",icon:La}]},{key:"browser",heading:"Browser",icon:ri,tools:[{name:"take_screenshot",title:"Take Screenshot",description:"Capture a screenshot of a web page",icon:zd},{name:"scrape_url",title:"Scrape URL",description:"Fetch and extract content from a URL",icon:ri},{name:"inspect_page",title:"Inspect Page",description:"Inspect a web page's structure",icon:lo}]}],zv=Wu.flatMap(t=>t.tools.map(e=>e.name));function Fv(t){const e=t.replace(/[_-]+/g," ").trim();return e?e.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()):t}function Hv(t){const e=F.c(5),{agentId:s,value:i,onChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Tools"}),e[0]=o):o=e[0];let a;return e[1]!==s||e[2]!==r||e[3]!==i?(a=n.jsxs("div",{className:"flex flex-col gap-2",children:[o,s?n.jsx(M.Suspense,{fallback:n.jsxs(ie,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:[n.jsx(Rl,{size:14}),"Loading tools…"]}),children:n.jsx(Uv,{agentId:s,value:i,onChange:r})}):n.jsx("span",{className:"text-xs text-muted-foreground italic",children:"Pick an agent first"})]}),e[1]=s,e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function qc(t){const e=F.c(17),{value:s,checked:i,onToggle:r,title:o,description:a,leading:l}=t;let d;e[0]!==i?(d=n.jsx(Yi,{checked:i,className:"pointer-events-none mt-0.5"}),e[0]=i,e[1]=d):d=e[1];let c;e[2]!==l?(c=l&&n.jsx("span",{className:"mt-px shrink-0",children:l}),e[2]=l,e[3]=c):c=e[3];let h;e[4]!==o?(h=n.jsx("span",{className:"truncate text-sm leading-tight",children:o}),e[4]=o,e[5]=h):h=e[5];let u;e[6]!==a?(u=a&&n.jsx("span",{className:"line-clamp-2 text-xs leading-snug text-muted-foreground",children:a}),e[6]=a,e[7]=u):u=e[7];let f;e[8]!==h||e[9]!==u?(f=n.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[h,u]}),e[8]=h,e[9]=u,e[10]=f):f=e[10];let m;return e[11]!==r||e[12]!==d||e[13]!==c||e[14]!==f||e[15]!==s?(m=n.jsxs(On,{value:s,onSelect:r,className:"items-start gap-2.5 py-2",children:[d,c,f]}),e[11]=r,e[12]=d,e[13]=c,e[14]=f,e[15]=s,e[16]=m):m=e[16],m}function Gc(t){const e=F.c(20),{conn:s,label:i,icon:r,on:o,total:a,onToggle:l}=t,d=o===a;let c;e[0]!==r||e[1]!==s?(c=s?n.jsx(ys,{icon:s.icon,name:s.title,size:"2xs"}):r?n.jsx(r,{size:14,className:"text-muted-foreground"}):n.jsx(sm,{size:14,className:"text-muted-foreground"}),e[0]=r,e[1]=s,e[2]=c):c=e[2];const h=s?.title??i??"Other tools";let u;e[3]!==h?(u=n.jsx("span",{className:"truncate",children:h}),e[3]=h,e[4]=u):u=e[4];let f;e[5]!==o||e[6]!==a?(f=n.jsxs("span",{className:"text-[11px] font-normal tabular-nums text-muted-foreground/70",children:[o,"/",a]}),e[5]=o,e[6]=a,e[7]=f):f=e[7];let m;e[8]!==l?(m=x=>{x.stopPropagation(),l()},e[8]=l,e[9]=m):m=e[9];const p=d?"None":"All";let _;e[10]!==m||e[11]!==p?(_=n.jsx("button",{type:"button",onClick:m,className:"text-[11px] font-medium text-primary hover:underline",children:p}),e[10]=m,e[11]=p,e[12]=_):_=e[12];let L;e[13]!==f||e[14]!==_?(L=n.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[f,_]}),e[13]=f,e[14]=_,e[15]=L):L=e[15];let v;return e[16]!==c||e[17]!==u||e[18]!==L?(v=n.jsxs("div",{className:"flex items-center gap-2",children:[c,u,L]}),e[16]=c,e[17]=u,e[18]=L,e[19]=v):v=e[19],v}function Uv(t){const e=F.c(70),{agentId:s,value:i,onChange:r}=t,{org:o}=Fe(),[a,l]=M.useState(!1);let d;e[0]!==s||e[1]!==o.id||e[2]!==o.slug?(d={connectionId:s,orgId:o.id,orgSlug:o.slug},e[0]=s,e[1]=o.id,e[2]=o.slug,e[3]=d):d=e[3];const c=Pt(d);let h;e[4]!==c?(h={client:c},e[4]=c,e[5]=h):h=e[5];const{data:u,isLoading:f}=Hd(h),m=Gn();let p,_,L,v,x,g,y,b,S,w,C,N,T;if(e[6]!==m||e[7]!==u?.tools||e[8]!==f||e[9]!==r||e[10]!==a||e[11]!==i){const E=new Map(m.map(Gv)),R=new Map;for(const Q of u?.tools??[]){const se=$f(Q._meta)??"__other__",oe=zf(Q.name,se==="__other__"?void 0:se),he=Q.title,xe=he&&he!==Q.name?he:Fv(oe);R.has(se)||R.set(se,{clientId:se,conn:E.get(se),tools:[]}),R.get(se).tools.push({name:Q.name,display:xe,description:Q.description})}const P=[...R.values()].sort(qv),D=(u?.tools??[]).map(Kv),O=[...zv,...D],$=i===null?new Set(O):new Set(i),K=O.every(Q=>$.has(Q)),z=Q=>r(O.every(se=>Q.has(se))?null:[...Q]),U=Q=>{const se=new Set($);se.has(Q)?se.delete(Q):se.add(Q),z(se)},G=(Q,se)=>{const oe=new Set($);for(const he of Q)se?oe.add(he):oe.delete(he);z(oe)};v=bs,T=a,x=l;let q;e[25]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(Rl,{size:14,className:"text-muted-foreground"}),e[25]=q):q=e[25];const W=K?"All tools":"Tools",H=!K&&n.jsxs(Fm,{variant:"secondary",className:"ml-0.5 h-5 px-1.5 text-[11px] tabular-nums",children:[$.size,"/",O.length]});let Z;e[26]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(ds,{size:14,className:"text-muted-foreground"}),e[26]=Z):Z=e[26],e[27]!==W||e[28]!==H?(g=n.jsx(Ss,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[q,W,H,Z]})}),e[27]=W,e[28]=H,e[29]=g):g=e[29],L=ws,C="p-0 w-80",N="start",_=Pl,e[30]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(po,{placeholder:"Search tools..."}),e[30]=S):S=e[30];const J=K?`All ${O.length} tools enabled`:`${$.size} of ${O.length} enabled`;let B;e[31]!==J?(B=n.jsx("span",{className:"text-xs text-muted-foreground",children:J}),e[31]=J,e[32]=B):B=e[32];let X;e[33]!==r?(X=()=>r(null),e[33]=r,e[34]=X):X=e[34];let V;e[35]!==K||e[36]!==X?(V=n.jsx("button",{type:"button",onClick:X,disabled:K,className:"text-xs font-medium text-primary hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:"Select all"}),e[35]=K,e[36]=X,e[37]=V):V=e[37];let ee;e[38]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[38]=ee):ee=e[38];let te;e[39]!==r?(te=()=>r([]),e[39]=r,e[40]=te):te=e[40];const ae=$.size===0;let de;e[41]!==te||e[42]!==ae?(de=n.jsx("button",{type:"button",onClick:te,disabled:ae,className:"text-xs font-medium text-muted-foreground hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:"Clear"}),e[41]=te,e[42]=ae,e[43]=de):de=e[43];let fe;e[44]!==V||e[45]!==de?(fe=n.jsxs("div",{className:"flex items-center gap-2",children:[V,ee,de]}),e[44]=V,e[45]=de,e[46]=fe):fe=e[46],e[47]!==B||e[48]!==fe?(w=n.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[B,fe]}),e[47]=B,e[48]=fe,e[49]=w):w=e[49],p=_o,y="max-h-80",b=f?n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"Loading tools…"}):n.jsxs(n.Fragment,{children:[n.jsx(go,{children:"No tools found"}),Wu.map(Q=>{const se=Q.tools.map(Vv),oe=se.filter(he=>$.has(he)).length;return n.jsx($n,{heading:n.jsx(Gc,{label:Q.heading,icon:Q.icon,on:oe,total:se.length,onToggle:()=>G(se,oe!==se.length)}),children:Q.tools.map(he=>n.jsx(qc,{value:`${he.title} ${he.name}`,checked:$.has(he.name),onToggle:()=>U(he.name),title:he.title,description:he.description,leading:n.jsx(he.icon,{size:16,className:"text-muted-foreground"})},he.name))},Q.key)}),P.map(Q=>{const se=Q.tools.map(Wv),oe=se.filter(he=>$.has(he)).length;return n.jsx($n,{heading:n.jsx(Gc,{conn:Q.conn,on:oe,total:se.length,onToggle:()=>G(se,oe!==se.length)}),children:Q.tools.map(he=>n.jsx(qc,{value:`${he.display} ${he.name} ${Q.conn?.title??""}`,checked:$.has(he.name),onToggle:()=>U(he.name),title:he.display,description:he.description},he.name))},Q.clientId)})]}),e[6]=m,e[7]=u?.tools,e[8]=f,e[9]=r,e[10]=a,e[11]=i,e[12]=p,e[13]=_,e[14]=L,e[15]=v,e[16]=x,e[17]=g,e[18]=y,e[19]=b,e[20]=S,e[21]=w,e[22]=C,e[23]=N,e[24]=T}else p=e[12],_=e[13],L=e[14],v=e[15],x=e[16],g=e[17],y=e[18],b=e[19],S=e[20],w=e[21],C=e[22],N=e[23],T=e[24];let A;e[50]!==p||e[51]!==y||e[52]!==b?(A=n.jsx(p,{className:y,children:b}),e[50]=p,e[51]=y,e[52]=b,e[53]=A):A=e[53];let j;e[54]!==_||e[55]!==A||e[56]!==S||e[57]!==w?(j=n.jsxs(_,{children:[S,w,A]}),e[54]=_,e[55]=A,e[56]=S,e[57]=w,e[58]=j):j=e[58];let k;e[59]!==L||e[60]!==j||e[61]!==C||e[62]!==N?(k=n.jsx(L,{className:C,align:N,children:j}),e[59]=L,e[60]=j,e[61]=C,e[62]=N,e[63]=k):k=e[63];let I;return e[64]!==v||e[65]!==x||e[66]!==g||e[67]!==k||e[68]!==T?(I=n.jsxs(v,{open:T,onOpenChange:x,children:[g,k]}),e[64]=v,e[65]=x,e[66]=g,e[67]=k,e[68]=T,e[69]=I):I=e[69],I}function Wv(t){return t.name}function Vv(t){return t.name}function Kv(t){return t.name}function qv(t,e){return(t.conn?.title??t.clientId).localeCompare(e.conn?.title??e.clientId)}function Gv(t){return[t.id,t]}function An(t){const e=t.trim().split(/\s+/);return e.length!==5?!1:e.every(s=>/^[\d*/,-]+$/.test(s))}function Yv(t){if(!t)return"Unknown schedule";const e=t.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return`Every ${s[1]} minutes`;const i=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(i)return`Every ${i[1]} hours`;const r=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(r){const l=parseInt(r[1]??"1");return l%7===0?`Every ${l/7} weeks`:`Every ${l} days`}const o=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(o){const l=(o[2]??"0").padStart(2,"0"),d=(o[1]??"0").padStart(2,"0");return`Every day at ${l}:${d} UTC`}const a=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(a){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(a[3]??"0")]??"day",c=(a[2]??"0").padStart(2,"0"),h=(a[1]??"0").padStart(2,"0");return`Every ${d} at ${c}:${h} UTC`}return t}function Jv(t,e){const s=Math.max(1,t);switch(e){case"minutes":return s===1?"* * * * *":`*/${s} * * * *`;case"hours":return s===1?"0 * * * *":`0 */${s} * * *`;case"days":return s===1?"0 0 * * *":`0 0 */${s} * *`;case"weeks":return s===1?"0 0 * * 1":`0 0 */${s*7} * *`}}function Xv(t){const e=t.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return{count:parseInt(s[1]),unit:"minutes"};const i=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(i)return{count:parseInt(i[1]),unit:"hours"};const r=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);return r?{count:parseInt(r[1]),unit:"days"}:null}function Zv(t,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[t]??t:t}const Qv=[{label:"5 minutes",cron:"*/5 * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function ex({automationId:t,open:e,onOpenChange:s,onCustomSelect:i,onEventSelect:r,onWebhookCreated:o}){const{triggerAdd:a}=Jn(),[l,d]=M.useState(!1),c=e??l,h=m=>{s?s(m):d(m)},u=async m=>{try{await a.mutateAsync({automation_id:t,type:"cron",cron_expression:m}),ue.success("Starter added"),h(!1)}catch(p){const _=p instanceof Error?p.message:"Failed to add starter";ue.error(_)}},f=async()=>{try{const m=await a.mutateAsync({automation_id:t,type:"webhook"});h(!1),m.webhook?o?.(m.webhook):ue.success("Webhook starter added")}catch(m){const p=m instanceof Error?m.message:"Failed to add webhook starter";ue.error(p)}};return n.jsxs(Qt,{open:c,onOpenChange:h,children:[n.jsx(es,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",children:[n.jsx(Dt,{size:14}),"Add Starter"]})}),n.jsxs(ts,{align:"end",className:"w-[200px]",children:[n.jsxs(ma,{children:[n.jsxs(pa,{className:"gap-2.5",children:[n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),n.jsx(ga,{className:"w-[160px]",children:Qv.map(m=>n.jsxs(We,{className:"gap-2.5",onSelect:()=>u(m.cron),disabled:a.isPending,children:[n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",m.label]},m.cron))})]}),n.jsxs(We,{className:"gap-2.5",onSelect:()=>{h(!1),i?.()},children:[n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}),"Custom (cron)"]}),n.jsxs(We,{className:"gap-2.5",onSelect:()=>{h(!1),r?.()},children:[n.jsx(zn,{size:14,className:"text-muted-foreground shrink-0"}),"Event"]}),n.jsxs(We,{className:"gap-2.5",onSelect:()=>{f()},disabled:a.isPending,children:[n.jsx(Ki,{size:14,className:"text-muted-foreground shrink-0"}),"Webhook"]})]})]})}function Vu(t){const e=F.c(31),{open:s,onOpenChange:i,url:r,token:o,title:a,description:l}=t,d=a===void 0?"Webhook ready":a,c=l===void 0?"Send a POST to this URL with the bearer token to fire the automation. The token is shown once — copy it now.":l,[h,u]=M.useState(null),[f,m]=M.useState("curl"),[p,_]=M.useState("header"),L=M.useId();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=async(E,R)=>{try{await navigator.clipboard.writeText(E),u(R),ue.success("Copied"),setTimeout(()=>u(null),1500)}catch{ue.error("Failed to copy")}},e[0]=v):v=e[0];const x=v;let g;e[1]!==p||e[2]!==o||e[3]!==r?(g=r&&o&&p==="url"?`${r.replace(/\/$/,"")}/${o}`:r??"",e[1]=p,e[2]=o,e[3]=r,e[4]=g):g=e[4];const y=g,b=r&&o?p==="header"?`curl -X POST "${y}" \\
|
|
466
|
+
`}),e[26]=y):y=e[26];let b;return e[27]!==g||e[28]!==h?(b=n.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center gap-12 select-none [clip-path:inset(-24px_0_-200px_0)]",children:[h,g,y]}),e[27]=g,e[28]=h,e[29]=b):b=e[29],b}function lr(t){const e=F.c(10),{phase:s,current:i,children:r}=t,o=s-i,a=o<0,l=o===0,d=a?90:o*-22,c=a?.94:1-Math.max(o,0)*.04,h=a?0:l?1:o===1?.8:.55,u=a?10:30-o,f=!l;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=le("absolute inset-0 overflow-hidden rounded-xl border border-foreground/10 bg-background shadow-[0_20px_60px_-20px_rgb(0_0_0_/_0.35)] transition-all ease-[cubic-bezier(0.22,1,0.36,1)]"),e[0]=m):m=e[0];const p=`translateY(${d}px) scale(${c})`,_=l?"auto":"none";let L;e[1]!==h||e[2]!==p||e[3]!==_||e[4]!==u?(L={transform:p,opacity:h,zIndex:u,transitionDuration:"1000ms",pointerEvents:_},e[1]=h,e[2]=p,e[3]=_,e[4]=u,e[5]=L):L=e[5];let v;return e[6]!==r||e[7]!==f||e[8]!==L?(v=n.jsx("div",{"aria-hidden":f,className:m,style:L,children:r}),e[6]=r,e[7]=f,e[8]=L,e[9]=v):v=e[9],v}function bo(t){const e=F.c(7),{showUrl:s}=t,i=s===void 0?!1:s;let r,o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:le("size-2.5 rounded-full",Gt)}),o=n.jsx("div",{className:le("size-2.5 rounded-full",Gt)}),a=n.jsx("div",{className:le("size-2.5 rounded-full",Gt)}),e[0]=r,e[1]=o,e[2]=a):(r=e[0],o=e[1],a=e[2]);let l;e[3]!==i?(l=i&&n.jsx("div",{className:le("ml-3 h-3.5 max-w-[220px] flex-1 rounded-sm",ps)}),e[3]=i,e[4]=l):l=e[4];let d;return e[5]!==l?(d=n.jsxs("div",{className:"flex h-7 shrink-0 items-center gap-1.5 px-3",children:[r,o,a,l]}),e[5]=l,e[6]=d):d=e[6],d}function s_(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bo,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex h-full flex-col",children:[e,n.jsx("div",{className:"flex flex-1 px-8 py-5",children:n.jsx("div",{className:"grid h-full w-full grid-cols-8 grid-rows-6 gap-2",children:Jg.map(i_)})})]}),t[1]=s):s=t[1],s}function i_(t,e){if(e===fu)return n.jsx("div",{className:"rounded-md bg-chart-1/[0.55]",style:{animation:"vm-breathe 2.4s ease-in-out infinite"}},e);const s=t;return n.jsx("div",{className:le("relative rounded-md",Gt),children:n.jsx("div",{className:"absolute inset-0 rounded-md bg-chart-1/40 opacity-0",style:{animation:`vm-rack-scan ${mu}s ease-in-out infinite`,animationDelay:`${s}s`}})},e)}function n_(){const t=F.c(5);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bo,{}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:le("w-[18%] rounded-md",ps),style:{animation:"vm-breathe 3s ease-in-out infinite"}}),t[1]=s):s=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"h-[42%] shrink-0 rounded-md bg-chart-3/[0.12]",style:{animation:"vm-breathe 3s ease-in-out 0.4s infinite"}}),t[2]=i):i=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"col-span-3 rounded-md bg-chart-3/[0.12]",style:{animation:"vm-breathe 3s ease-in-out 0.8s infinite"}}),t[3]=r):r=t[3];let o;return t[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"flex h-full flex-col",children:[e,n.jsxs("div",{className:"flex min-h-0 flex-1 gap-1.5 p-3",children:[s,n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[i,n.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-5 gap-1.5",children:[r,n.jsxs("div",{className:"col-span-2 grid grid-rows-2 gap-1.5",children:[n.jsx("div",{className:le("rounded-md",ps),style:{animation:"vm-breathe 3s ease-in-out 1.2s infinite"}}),n.jsx("div",{className:le("rounded-md",ps),style:{animation:"vm-breathe 3s ease-in-out 1.6s infinite"}})]})]})]})]})]}),t[4]=o):o=t[4],o}function r_(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bo,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex h-full flex-col",children:[e,n.jsx("div",{className:"relative flex flex-1 items-center justify-center px-8 py-5",children:n.jsx("div",{className:"grid w-full gap-2",style:{gridTemplateColumns:"repeat(7, minmax(0, 1fr))"},children:Qg.map(o_)})})]}),t[1]=s):s=t[1],s}function o_(t,e){return n.jsx("div",{className:le("aspect-square rounded-md",e_[e]?"bg-chart-2/70":Gt),style:{animation:`vm-pulse-soft 2.2s ease-in-out ${t}s infinite`}},e)}function a_(){const t=F.c(11);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bo,{showUrl:!0}),t[0]=e):e=t[0];let s,i,r,o,a;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"mb-2 h-5 rounded-md bg-chart-1/[0.10]"}),i=n.jsx("div",{className:le("h-1.5 w-[70%] rounded-sm",Gt)}),r=n.jsx("div",{className:le("h-1.5 w-[55%] rounded-sm",Gt)}),o=n.jsx("div",{className:le("h-1.5 w-[80%] rounded-sm",Gt)}),a=n.jsx("div",{className:le("h-1.5 w-[50%] rounded-sm",Gt)}),t[1]=s,t[2]=i,t[3]=r,t[4]=o,t[5]=a):(s=t[1],i=t[2],r=t[3],o=t[4],a=t[5]);let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex w-[18%] shrink-0 flex-col gap-1.5 bg-chart-1/[0.05] p-2.5",children:[s,i,r,o,a,n.jsx("div",{className:"mt-auto",children:n.jsx("div",{className:le("h-4 rounded-md",Gt)})})]}),t[6]=l):l=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("div",{className:"relative h-[42%] shrink-0 overflow-hidden bg-chart-1/[0.10]",children:n.jsxs("div",{className:"absolute right-3 bottom-3 left-3 space-y-1.5",children:[n.jsx("div",{className:"h-3 w-[35%] rounded-sm bg-chart-1/[0.15]"}),n.jsx("div",{className:le("h-1.5 w-[55%] rounded-sm",ps)})]})}),t[7]=d):d=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[n.jsx("div",{className:"h-4 w-12 rounded-full bg-chart-1/[0.12]"}),n.jsx("div",{className:le("h-4 w-10 rounded-full",ps)}),n.jsx("div",{className:le("h-4 w-14 rounded-full",ps)})]}),t[8]=c):c=t[8];let h;t[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs("div",{className:le("col-span-3 flex flex-col justify-end gap-1 rounded-md p-2",ps),children:[n.jsx("div",{className:le("h-1.5 w-[50%] rounded-sm",Gt)}),n.jsx("div",{className:le("h-1 w-[75%] rounded-sm",Gt)})]}),t[9]=h):h=t[9];let u;return t[10]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs("div",{className:"flex h-full flex-col",children:[e,n.jsxs("div",{className:"flex min-h-0 flex-1",children:[l,n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[d,n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2.5 p-3",children:[c,n.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-5 gap-2",children:[h,n.jsxs("div",{className:"col-span-2 grid grid-rows-2 gap-2",children:[n.jsx("div",{className:le("rounded-md",ps)}),n.jsx("div",{className:le("rounded-md",ps)})]})]})]})]})]})]}),t[10]=u):u=t[10],u}function Jr(t){const e=F.c(9);if(t.kind==="starting"){let l;return e[0]!==t.claimPhase||e[1]!==t.progress?(l=n.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background p-6",children:n.jsx(t_,{progress:t.progress,claimPhase:t.claimPhase})}),e[0]=t.claimPhase,e[1]=t.progress,e[2]=l):l=e[2],l}let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(O2,{className:"size-12 text-blue-500"}),e[3]=s):s=e[3];let i,r;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("h3",{className:"text-lg font-medium",children:Gg("suspended")}),r=n.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:"Resume to continue."}),e[4]=i,e[5]=r):(i=e[4],r=e[5]);let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Mi,{className:"size-4"}),e[6]=o):o=e[6];let a;return e[7]!==t.onResume?(a=n.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background p-6",children:n.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-4 text-center",children:[s,i,r,n.jsxs(ie,{onClick:t.onResume,className:"mt-2",children:[o," Resume"]})]})}),e[7]=t.onResume,e[8]=a):a=e[8],a}function l_(t){const e=F.c(12),{orgSlug:s,virtualMcpId:i,branch:r,enabled:o}=t,a=o===void 0?!0:o;let l;e[0]!==r||e[1]!==s||e[2]!==i?(l=Tt.sandboxRepoDir(s,i,r),e[0]=r,e[1]=s,e[2]=i,e[3]=l):l=e[3];let d;e[4]!==r||e[5]!==s||e[6]!==i?(d=async()=>{const u=`/api/${s}/sandbox/${encodeURIComponent(i)}/${encodeURIComponent(r)}/config`,f=await fetch(u);return f.ok?(await f.json()).repoDir??null:null},e[4]=r,e[5]=s,e[6]=i,e[7]=d):d=e[7];let c;return e[8]!==a||e[9]!==l||e[10]!==d?(c={queryKey:l,queryFn:d,enabled:a,staleTime:1/0},e[8]=a,e[9]=l,e[10]=d,e[11]=c):c=e[11],Ps(c).data??null}const gc="https://decoims.com/decocms/01b321bd-4613-4b2c-9348-35058444d210/Visual_Studio_Code_1.35_icon.svg.png",_c="https://decoims.com/decocms/7583d3b5-81d0-4afb-becf-6a59bbb3a68e/cursor-logo-icon-freelogovectors.net_.png",c_=M.lazy(()=>cs(()=>import("./sections-editor-Da2BXnWh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SectionsEditor}))),d_=M.lazy(()=>cs(()=>import("./page-seo-sheet-Ddik0L9a.js"),__vite__mapDeps([142,1,2,71,42,44,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,74,75,76,77,78,79,98,99,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SeoSheet}))),h_=M.lazy(()=>cs(()=>import("./file-explorer-hz_GCFqU.js"),__vite__mapDeps([143,1,2,118,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,123,144,117,107,80,110,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,108,109,111,112,113,114,115,116,119,120,121,122,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.FileExplorer}))),Oo=500,u_={mobile:375,tablet:768,desktop:null},$o=["desktop","mobile","tablet"],f_={mobile:"Mobile (375px)",tablet:"Tablet (768px)",desktop:"Desktop"},m_="website/sections/Rendering/Lazy.tsx";function wa(t,e){let s=t,i=typeof s?.__resolveType=="string"?s.__resolveType:"";for(let r=0;i&&r<5;r++){const o=e[i];if(o&&typeof o=="object"&&"__resolveType"in o){const a=o.__resolveType;if(typeof a=="string"&&a&&a!==i){s=o,i=a;continue}}break}if(!i)return[];if(i.includes("flags/multivariate")){const r=Array.isArray(s.variants)?s.variants:[],o=[];for(const a of r){const l=a?.value;if(l&&typeof l=="object")for(const d of wa(l,e))o.includes(d)||o.push(d)}return o}if(i===m_){const r=s.section&&typeof s.section=="object"?wa(s.section,e):[];return r.length?[i,...r]:[i]}return[i]}function p_(t,e){const s=new URL(t,window.location.href);return s.searchParams.set("deviceHint",e),s.href}function g_(){const t=yi(),{currentBranch:e}=Ds(),[s,i]=M.useState("preview"),[r,o]=M.useState("desktop"),[a,l]=M.useState(null),d=M.useRef(null),c=s==="cms",[h,u]=M.useState(null),[f,m]=M.useState(null),[p,_]=M.useState(384),L=M.useRef(!1),v=M.useRef(0),x=M.useRef(0),g=M.useRef(null),[y,b]=M.useState(!1),[S,w]=M.useState(""),C=M.useRef(null),[N,T]=M.useState(!1),[A,j]=M.useState(),[k,I]=M.useState(null),[E,R]=M.useState(null),[P,D]=M.useState("/"),[O,$]=M.useState(null),[K,z]=M.useState(!1),[U,G]=M.useState(!1),[q,W]=M.useState(null),H=t?.entity?.id??null,{org:Z}=Fe(),J=Cs(),B=Zl(),X=B.vmEntry,V=B.previewUrl,ee=J.lifecycle.phase,te=ee==="running",ae=X?.sandboxProviderKind==="user-desktop",de=l_({orgSlug:Z.slug,virtualMcpId:H??"",branch:e??"",enabled:ae&&te&&!!H&&!!e}),fe=ae?de:null,Q=H&&e&&te?{orgSlug:Z.slug,virtualMcpId:H,branch:e,previewUrl:V}:null,{data:se}=zl(Q,{fetchEnabled:te}),{data:oe}=Fl(Q,{fetchEnabled:te}),he=H&&e?{orgSlug:Z.slug,virtualMcpId:H,branch:e}:null,xe=Og(he),ve=se?Yl(se).sort((ne,ke)=>ne.name.localeCompare(ke.name)):[],be=se&&oe?Xl(se,oe):[],De=Ri,Ie=ve.filter(ne=>{if(!S)return!0;const ke=S.toLowerCase();return ne.name.toLowerCase().includes(ke)||ne.path.toLowerCase().includes(ke)}),Me=be.filter(ne=>{if(!S)return!0;const ke=S.toLowerCase();return ne.name.toLowerCase().includes(ke)||ne.key.toLowerCase().includes(ke)||ne.resolveType.toLowerCase().includes(ke)}),He=k?null:m4(ve,P,O),Je=k?k.name:He?.name,ge=He?.key??null,we=se&&ge?lu(se,ge,0):[],Be=se?iu(we,se):[],Ne=Be.map(ne=>ne.isSavedBlock?ne.label:""),nt=Be.map(ne=>ne.isSavedBlock?"global":ne.isMultivariate?"variant":"normal"),Ve=we.map(ne=>wa(ne,se??{})),ye=M.useRef(null),_e=M.useRef(null);C4(()=>{const ne=d.current,ke=ye.current;!ne||!ke||(ne.src=ke)});const Ue=J.status.state==="paused",Ze=J.phase,Xe=uu({claimPhase:Ze,lifecycle:J.lifecycle}),Ke=B.previewState,ce=B.userStopped,Y=Ke.kind==="starting"||Ke.kind==="iframe"&&Xe.status==="doing",me=Ke.kind==="iframe"?xg(p_(E??new URL(P,Ke.previewUrl).href,r),c&&f?f:[]):null,[Se,je]=M.useState(null);if(Ke.kind==="iframe"&&Se!==Ke.previewUrl){const ne=Se!==null;je(Ke.previewUrl),ne&&(_e.current=null,D("/"),R(null),$(null),I(null))}ye.current=me;const qe=!!H&&!!e&&!J.notFound&&!ce&&!Ue&&(Ze?.kind==="ready"||ee!=="idle"),rt=Ke.kind!=="iframe"&&(s==="visual"||s==="cms")?"preview":s;M.useEffect(()=>{if(!V)return;let ne;try{ne=new URL(V,window.location.href).origin}catch{return}const ke=yt=>{if(yt.origin===ne){if(yt.data?.type==="visual-editor::element-clicked"){const bt=zg.safeParse(yt.data.payload);bt.success&&l(bt.data)}else if(yt.data?.type==="cms-editor::section-clicked"){const bt=Hg.safeParse(yt.data.payload);bt.success&&u(bt.data.sectionIndex)}}};return window.addEventListener("message",ke),()=>window.removeEventListener("message",ke)},[V]),M.useEffect(()=>{if(!y)return;const ne=ke=>{C.current?.contains(ke.target)||(b(!1),w(""))};return document.addEventListener("pointerdown",ne),()=>document.removeEventListener("pointerdown",ne)},[y]),M.useEffect(()=>{if(!c)return;const ne=yt=>{const bt=yt.target;bt&&bt!==d.current&&(g.current=bt)},ke=()=>{requestAnimationFrame(()=>{const yt=document.activeElement;(yt===document.body||yt===d.current)&&g.current&&g.current.focus()})};return document.addEventListener("focusin",ne),document.addEventListener("blur",ke,!0),()=>{document.removeEventListener("focusin",ne),document.removeEventListener("blur",ke,!0)}},[c]);const ks=()=>{const ne=d.current?.contentWindow;ne&&ne.postMessage({type:"visual-editor::activate",script:Fg},"*")},Gs=()=>{const ne=d.current?.contentWindow;ne&&ne.postMessage({type:"visual-editor::deactivate"},"*")},A9=()=>{const ne=d.current?.contentWindow;ne&&(ne.postMessage({type:"visual-editor::activate",script:Ug},"*"),ne.postMessage({type:"cms-editor::set-labels",labels:Ne,kinds:nt,keys:Ve},"*"))},H1=()=>{const ne=d.current?.contentWindow;ne&&ne.postMessage({type:"cms-editor::deactivate"},"*")},nn=ne=>{const ke=s;i(ne),l(null),ne!=="code"&&W(null),ne!=="cms"&&(u(null),m(null)),ke==="visual"&&Gs(),ke==="cms"&&H1(),ne==="visual"&&ks(),ne==="cms"&&A9()},U1=()=>{if(!d.current||!me)return;const ne=d.current;ne.src=me},W1=ne=>{m(ne)},V1=()=>{const ne=d.current;if(!ne)return;const ke=document.activeElement,yt=ne.tabIndex;ne.tabIndex=-1,ne.style.pointerEvents="none",ne.blur();try{ne.contentWindow?.location.reload()}catch{const rs=ye.current;rs&&(ne.src=rs)}const bt=()=>{ne.tabIndex=yt,ne.style.pointerEvents="",ke?.focus(),ne.removeEventListener("load",bt)};ne.addEventListener("load",bt),setTimeout(bt,3e3)},K1=()=>{if(!d.current||!me)return;const ne=me.includes("?")?"&":"?";d.current.src=`${me}${ne}_r=${Date.now()}`},q1=()=>{const ne=$o.indexOf(r);o($o[(ne+1)%$o.length])},G1=()=>{const ne=d.current?.contentWindow?.location?.href??me??V;ne&&navigator.clipboard.writeText(ne)},Y1=(()=>{if(!V)return"No server running";if(k)return k.name;try{const ne=new URL(V),ke=P==="/"?"":P;return`${ne.host}${ke}`}catch{return V}})(),R9=ne=>{_e.current=ne.path,I(null),R(null),$(ne.key),D(ne.path),u(null),z(!1)},J1=ne=>{if(!V||!oe){ue.error("Preview metadata not ready yet");return}_e.current=null;const ke=wh(oe),yt=Pg(V,ke,ne.key);I(ne),R(yt),u(null)},X1=async({name:ne,path:ke})=>{if(!H||!e)return;const yt=Kl(ke);if(yt){j(yt);return}const bt=ke.trim().startsWith("/")?ke.trim():`/${ke.trim()}`;if(ve.some(rs=>De(rs.path)===De(bt))){j(`A page with path "${bt}" already exists.`);return}j(void 0);try{const rs=await xe.mutateAsync({name:ne,path:bt});T(!1),ue.success(`Page "${ne}" created`),await new Promise(Q1=>setTimeout(Q1,Oo)),R9({key:rs.key,name:rs.name,path:rs.path}),nn("cms")}catch(rs){j(rs instanceof Error?rs.message:"Failed to create page")}},Z1=[{value:"preview",icon:n.jsx($9,{size:14}),tooltip:"Interactive"},...Ke.kind==="iframe"?[{value:"visual",icon:n.jsx(z9,{size:14}),tooltip:"Visual editor"}]:[],...Ke.kind==="iframe"&&Gl(se,oe)?[{value:"cms",icon:n.jsx($2,{size:14}),tooltip:"Sections editor"}]:[],{value:"code",icon:n.jsx(z2,{size:14}),tooltip:"Code editor"}];return n.jsxs("div",{className:"flex flex-col w-full h-full",children:[qe&&n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-4 border-b border-border/60 px-3 md:px-4",children:[n.jsx("div",{className:"flex shrink-0 items-center gap-1",children:n.jsx(Tm,{value:rt,onValueChange:nn,options:Z1,size:"sm",className:"shrink-0 bg-foreground/4.5"})}),Ke.kind==="iframe"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:le("flex min-w-0 flex-1 items-center gap-0.5 ml-2",s==="code"&&"hidden"),children:[n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:U1,children:n.jsx(Pn,{size:14})})}),n.jsx(Te,{side:"bottom",children:"Refresh"})]}),n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:q1,children:n.jsxs("span",{className:"flex items-center justify-center animate-device-icon-pop",children:[r==="mobile"&&n.jsx(F2,{size:14}),r==="tablet"&&n.jsx(H2,{size:14}),r==="desktop"&&n.jsx($9,{size:14})]},r)})}),n.jsx(Te,{side:"bottom",children:f_[r]})]}),n.jsxs("div",{ref:C,className:"relative min-w-0 flex-1",children:[n.jsxs("button",{type:"button",className:"flex h-8 w-full min-w-0 items-center gap-1 rounded-md bg-background px-2 transition-colors duration-200 hover:bg-accent",onClick:()=>b(ne=>!ne),children:[k&&n.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[n.jsx(ri,{size:11}),"Global"]}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-[12px] text-foreground/88",children:Y1}),Je&&!k&&n.jsx("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:Je}),n.jsx(ds,{size:12,className:le("shrink-0 text-muted-foreground transition-transform",y&&"rotate-180")})]}),y&&n.jsxs("div",{className:"absolute left-0 right-0 top-full z-50 mt-1.5 overflow-hidden rounded-lg border bg-popover shadow-lg",children:[n.jsxs("div",{className:"px-2 h-10 flex items-center gap-2 border-b",children:[n.jsx(Zd,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),n.jsx("input",{type:"text",value:S,onChange:ne=>w(ne.target.value),placeholder:"Search pages and components...",className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground",autoFocus:!0})]}),n.jsx("div",{className:"p-1.5 border-b",children:n.jsxs("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:ne=>{ne.preventDefault(),b(!1),w(""),j(void 0),T(!0)},children:[n.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"flex-1 font-medium",children:"Create new page"})]})}),Ie.length===0&&Me.length===0?n.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:ve.length===0&&be.length===0?"No pages found in this site.":"No results match your search."}):n.jsxs("div",{className:"max-h-80 overflow-y-auto overscroll-contain",children:[Ie.length>0&&n.jsx("div",{className:"p-1.5",children:Ie.map(ne=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:ke=>{ke.preventDefault(),b(!1),w(""),R9(ne)},children:[n.jsx(Ti,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:ne.name}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:ne.path})]},ne.key))}),Me.length>0&&n.jsxs("div",{className:le("p-1.5",Ie.length>0&&"border-t"),children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Global components"}),Me.map(ne=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:ke=>{ke.preventDefault(),b(!1),w(""),J1(ne)},children:[n.jsx(ri,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:ne.name}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:ne.resolveType.split("/").pop()?.replace(/\.tsx?$/,"")})]},ne.key))]})]})]})]})]}),n.jsxs("div",{className:le("flex shrink-0 items-center gap-0.5",s==="code"&&"hidden"),children:[n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{const ne=me??Ke.previewUrl;ne&&window.open(ne,"_blank","noopener")},children:n.jsx(pi,{size:14})})}),n.jsx(Te,{side:"bottom",children:"Open in new tab"})]}),n.jsxs(Qt,{children:[n.jsx(es,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",children:n.jsx(Vi,{size:14})})}),n.jsxs(ts,{align:"end",className:"w-44",children:[n.jsx(We,{onClick:K1,children:"Hard Reload"}),n.jsx(We,{onClick:G1,children:"Copy Current URL"}),se&&oe&&n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),ge&&n.jsxs(We,{onClick:()=>{z(!0),nn("cms")},children:[n.jsx(Pr,{size:14}),"Edit SEO"]}),ge&&n.jsxs(We,{onClick:()=>{try{W(M9(ge)),nn("code")}catch{ue.error("Invalid page block key")}},children:[n.jsx(lo,{size:14}),"View JSON"]}),n.jsxs(We,{onClick:()=>G(!0),children:[n.jsx(Pr,{size:14}),"Site SEO"]})]}),fe&&n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),n.jsxs(We,{onClick:()=>window.open(`vscode://file${fe}?windowId=_blank`),children:[n.jsx("img",{src:gc,alt:"VSCode",width:14,height:14}),"Open in VSCode"]}),n.jsxs(We,{onClick:()=>window.open(`cursor://file${fe}?windowId=_blank`),children:[n.jsx("img",{src:_c,alt:"Cursor",width:14,height:14}),"Open in Cursor"]})]})]})]})]})]}),s==="code"&&fe&&n.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon","aria-label":"Open in VSCode",onClick:()=>window.open(`vscode://file${fe}?windowId=_blank`),children:n.jsx("img",{src:gc,alt:"VSCode",width:14,height:14})})}),n.jsx(Te,{side:"bottom",children:"Open in VSCode"})]}),n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon","aria-label":"Open in Cursor",onClick:()=>window.open(`cursor://file${fe}?windowId=_blank`),children:n.jsx("img",{src:_c,alt:"Cursor",width:14,height:14})})}),n.jsx(Te,{side:"bottom",children:"Open in Cursor"})]})]})]}),n.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c&&V&&e&&H&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"shrink-0 border-r overflow-hidden",style:{width:p},children:n.jsx(M.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),children:n.jsx(c_,{orgSlug:Z.slug,virtualMcpId:H,branch:e,previewReady:te,previewUrl:V,currentPath:P,activePageBlockKey:ge,activeGlobalBlockKey:k?.key??null,externalSelectedIndex:k?null:h,onSaved:()=>{setTimeout(V1,Oo)},initialEditSeo:K,onExitSeo:()=>z(!1),onViewJsonFile:ne=>{try{W(M9(ne)),nn("code")}catch{ue.error("Invalid page block key")}},onVariantPreviewOverride:W1})})}),n.jsx("div",{className:"w-1 shrink-0 cursor-col-resize bg-transparent hover:bg-border transition-colors",onPointerDown:ne=>{L.current=!0,v.current=ne.clientX,x.current=p,ne.currentTarget.setPointerCapture(ne.pointerId)},onPointerMove:ne=>{if(!L.current)return;const ke=ne.clientX-v.current;_(Math.max(240,Math.min(640,x.current+ke)))},onPointerUp:()=>{L.current=!1}})]}),n.jsxs("div",{className:le("flex-1 relative overflow-hidden",r!=="desktop"&&Ke.kind==="iframe"&&s!=="code"&&"flex justify-center bg-muted/30"),children:[Y&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Jr,{kind:"starting",progress:Xe,claimPhase:Ze})}),Ke.kind==="suspended"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Jr,{kind:"suspended",onResume:B.resume})}),rt==="visual"&&!a&&n.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-violet-400/40 bg-violet-500/90 px-3 py-1 text-xs font-medium text-white shadow-md backdrop-blur-sm pointer-events-none select-none",children:[n.jsx(z9,{size:12}),"Click any element to ask the AI"]}),rt==="visual"&&a&&n.jsx(Kg,{element:a,onDismiss:()=>l(null)}),s==="code"&&qe&&H&&e&&n.jsx("div",{className:"absolute inset-0 z-10 bg-background",children:n.jsx(M.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),children:n.jsx(h_,{orgSlug:Z.slug,virtualMcpId:H,branch:e,openPath:q})})}),Ke.kind==="iframe"&&me&&n.jsx("div",{className:le("h-full transition-[width] duration-250 [transition-timing-function:var(--ease-in-out-cubic)]",r!=="desktop"&&s!=="code"&&"w-full max-w-full border-x border-border bg-background shadow-sm"),style:{width:r==="desktop"||s==="code"?"100%":`${u_[r]}px`},children:n.jsx("iframe",{ref:d,src:me,className:le("w-full h-full border-0",s==="code"&&"invisible"),title:"Dev Server Preview",tabIndex:c?-1:void 0,onLoad:()=>{if(Ye("vm_preview_loaded",{view_mode:s,vm_id:X?.sandboxHandle??null}),!k)try{const ne=d.current?.contentWindow?.location?.pathname;if(!ne)return;const ke=_e.current;if(ke!==null){_e.current=null,De(ne)===De(ke)&&D(ne);return}D(ne)}catch{}s==="visual"&&ks(),s==="cms"&&A9()}},Ke.previewUrl)})]})]}),n.jsx($g,{open:N,onOpenChange:T,isPending:xe.isPending,error:A,onSubmit:X1}),U&&se&&oe&&n.jsx(M.Suspense,{fallback:null,children:n.jsx(d_,{open:U,onOpenChange:G,orgSlug:Z.slug,virtualMcpId:H??"",branch:e??"",decofile:se,meta:oe,onSaved:()=>{setTimeout(()=>{const ne=d.current;if(ne)try{ne.contentWindow?.location.reload()}catch{const ke=ye.current;ke&&(ne.src=ke)}},Oo)},target:{kind:"site"}})})]})}function __(t){const e=F.c(2),{virtualMcpId:s}=t,i=xs(s);if(!ni(i?.metadata)){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[n.jsx(Ui,{size:24,className:"text-muted-foreground/60"}),n.jsx("div",{children:"No source to preview."}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Connect a GitHub repository from the Connections tab to enable Preview."})]}),e[0]=a):a=e[0],a}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(g_,{}),e[1]=o):o=e[1],o}function L_(t){const e=F.c(8);let s,i;e[0]!==t?({className:s,...i}=t,e[0]=t,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let r;e[3]!==s?(r=le("grid gap-3",s),e[3]=s,e[4]=r):r=e[4];let o;return e[5]!==i||e[6]!==r?(o=n.jsx(mm,{"data-slot":"radio-group",className:r,...i}),e[5]=i,e[6]=r,e[7]=o):o=e[7],o}function Lc(t){const e=F.c(9);let s,i;e[0]!==t?({className:s,...i}=t,e[0]=t,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let r;e[3]!==s?(r=le("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",s),e[3]=s,e[4]=r):r=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(pm,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:n.jsx(Pm,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=o):o=e[5];let a;return e[6]!==i||e[7]!==r?(a=n.jsx(fm,{"data-slot":"radio-group-item",className:r,...i,children:o}),e[6]=i,e[7]=r,e[8]=a):a=e[8],a}function v_(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([i])=>!e.includes(i)));return Object.keys(s).length>0?{...t,properties:s}:t}function x_(t,e,s){return typeof t!="string"?null:v_(Ks(t,e),s)}function pu(t,e,s){if(!e||typeof t!="string")return!1;const i=x_(t,e,s);return!!i&&Object.keys(i.properties??{}).length>0}function y_({orgSlug:t,virtualMcpId:e,branch:s}){const i=di();return hi({mutationFn:async({blockKey:r})=>{const o=Ad(r),a=await fetch(`/api/${t}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/unlink`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:o})});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error??`Delete failed (${a.status})`)}return a.json()},onMutate:async({blockKey:r})=>{const o=`${t}/${e}/${s}`,a=Tt.decofile(o);await i.cancelQueries({queryKey:a});const l=i.getQueryData(a);return i.setQueryData(a,d=>{if(!d)return d;const{[r]:c,...h}=d;return h}),{previous:l,queryKey:a}},onError:(r,o,a)=>{a?.queryKey&&i.setQueryData(a.queryKey,a.previous)},onSuccess:()=>{const r=`${t}/${e}/${s}`;i.invalidateQueries({queryKey:Tt.liveMeta(r)})}})}function So(t,e){return`${t}-${e}`}function gu(t,e){return`site/apps/${t}/${e}.ts`}function _u(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function b_(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function S_(t){return t==="local"?"Custom":"Installed"}function Lu(t,e,s){const i=new Set([So(t,e),e].map(o=>o.toLowerCase())),r=gu(t,e);for(const[o,a]of Object.entries(s)){if(o.includes("/")||!a||typeof a!="object"||Array.isArray(a))continue;const l=a;if(i.has(o.toLowerCase())||l.__resolveType===r)return o}return null}function w_(t,e){const s=t.vendor.alias,i=t.name,r=Lu(s,i,e);return{id:So(s,i),app:i,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:gu(s,i),blockKey:r,installed:r!==null}}function C_(t,e,s){if(t===ql)return null;const i=_u(t);if(!i)return null;const{vendor:r,app:o}=i,a=Lu(r,o,s),l=_i(t,e);return{id:So(r,o),app:o,vendor:r,title:l.title??o,description:l.description??"",category:"Others",logo:l.logo??l.icon,resolveType:t,blockKey:a,installed:a!==null}}function k_(t,e,s){const i=e.__resolveType;if(typeof i!="string"||Vr(t,e)||!yh(i))return null;const r=_u(i)??b_(t);if(!r)return null;const o=_i(i,s),{vendor:a,app:l}=r;return{id:So(a,l),app:l,vendor:a,title:o.title??Kr(t,e,s),description:o.description??"",category:S_(a),logo:o.logo??o.icon,resolveType:i,blockKey:t,installed:!0}}function j_(t,e,s){const i=new Map;for(const o of t){const a=w_(o,s);i.set(a.id,a)}const r=e.manifest?.blocks?.apps??{};for(const o of Object.keys(r)){const a=C_(o,e,s);!a||i.has(a.id)||i.set(a.id,a)}for(const[o,a]of Object.entries(s)){if(o.includes("/")||!a||typeof a!="object"||Array.isArray(a))continue;const l=k_(o,a,e);!l||i.has(l.id)||i.set(l.id,l)}return[...i.values()].sort(N_)}function N_(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function E_(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function T_(t,e,s){const i=F.c(12),r=s?.enabled??!0;let o;i[0]===Symbol.for("react.memo_cache_sentinel")?(o=Tt.decoApps(),i[0]=o):o=i[0];let a;i[1]!==r?(a={queryKey:o,queryFn:E_,staleTime:3e5,retry:1,enabled:r},i[1]=r,i[2]=a):a=i[2];const l=Ps(a);let d;i[3]!==e||i[4]!==t||i[5]!==l.data?(d=t&&e?j_(l.data??[],t,e):[],i[3]=e,i[4]=t,i[5]=l.data,i[6]=d):d=i[6];const c=d,h=l.isLoading&&!l.isError;let u;return i[7]!==c||i[8]!==l.isError||i[9]!==l.refetch||i[10]!==h?(u={catalog:c,isLoading:h,isError:l.isError,refetch:l.refetch},i[7]=c,i[8]=l.isError,i[9]=l.refetch,i[10]=h,i[11]=u):u=i[11],u}function ok(t,e,s,i,r){const o={...t[e]};if(r.length>1){const a=o.sections,l=[...a?.variants??[]];l[i]&&(l[i]={...l[i],value:s}),o.sections={...a,variants:l}}else o.sections=s;return o}function ak(t){return structuredClone(t)}function lk(t){return!t.isSavedBlock&&!t.isMultivariate&&!t.isHidden}function A_(t){const e=t.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function R_(t,e){const s=t.trim();return s?s.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,s)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(s)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function P_(t){return(e,s)=>{m2(e),t(e,s)}}const D_=new Set(["http:","https:","mailto:","tel:","ftp:"]);function I_(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return D_.has(e.protocol)}catch{return!1}}function js(t){const e=F.c(8),{active:s,label:i,onClick:r,children:o}=t,a=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==a?(l=le("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",a),e[0]=a,e[1]=l):l=e[1];let d;return e[2]!==s||e[3]!==o||e[4]!==i||e[5]!==r||e[6]!==l?(d=n.jsx("button",{type:"button","aria-label":i,"aria-pressed":s,onMouseDown:M_,onClick:r,className:l,children:o}),e[2]=s,e[3]=o,e[4]=i,e[5]=r,e[6]=l,e[7]=d):d=e[7],d}function M_(t){return t.preventDefault()}function B_({schema:t,value:e,onChange:s,path:i,label:r}){const o=typeof e=="string"?e:"",a=M.useRef(s);a.current=s;const l=Mf({extensions:[Bf.configure({heading:{levels:[1,2,3]}})],content:o||"",editorProps:{attributes:{class:le("prose prose-sm dark:prose-invert max-w-none focus:outline-none","min-h-[80px] px-3 py-2")}},onUpdate:({editor:d})=>{const c=d.getHTML();a.current(c==="<p></p>"?"":c)}});return l?n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"space-y-0.5",children:[n.jsx($e,{htmlFor:i,children:r}),t.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:t.description})]}),n.jsxs("div",{className:"overflow-hidden rounded-md border border-input",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-border/60 bg-muted/30 px-1.5 py-1",children:[n.jsx(js,{active:l.isActive("bold"),label:"Bold",onClick:()=>l.chain().focus().toggleBold().run(),children:n.jsx(U2,{size:14})}),n.jsx(js,{active:l.isActive("italic"),label:"Italic",onClick:()=>l.chain().focus().toggleItalic().run(),children:n.jsx(W2,{size:14})}),n.jsx(js,{active:l.isActive("underline"),label:"Underline",onClick:()=>l.chain().focus().toggleUnderline().run(),children:n.jsx(V2,{size:14})}),n.jsx(js,{active:l.isActive("strike"),label:"Strikethrough",onClick:()=>l.chain().focus().toggleStrike().run(),children:n.jsx(K2,{size:14})}),n.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),n.jsx(js,{active:l.isActive("heading",{level:1}),label:"Heading 1",onClick:()=>l.chain().focus().toggleHeading({level:1}).run(),children:n.jsx(q2,{size:14})}),n.jsx(js,{active:l.isActive("heading",{level:2}),label:"Heading 2",onClick:()=>l.chain().focus().toggleHeading({level:2}).run(),children:n.jsx(G2,{size:14})}),n.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),n.jsx(js,{active:l.isActive("bulletList"),label:"Bullet list",onClick:()=>l.chain().focus().toggleBulletList().run(),children:n.jsx(Am,{size:14})}),n.jsx(js,{active:l.isActive("orderedList"),label:"Ordered list",onClick:()=>l.chain().focus().toggleOrderedList().run(),children:n.jsx("span",{className:"text-[11px] font-semibold leading-none",children:"1."})}),n.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),n.jsx(js,{active:l.isActive("link"),label:"Link",onClick:()=>{const d=l.getAttributes("link").href,c=window.prompt("Link URL",d??"https://");c!==null&&(c===""?l.chain().focus().unsetLink().run():I_(c)&&l.chain().focus().setLink({href:c}).run())},children:n.jsx(kf,{size:14})})]}),n.jsx(Of,{editor:l})]})]}):null}const ji=t=>String(t).padStart(2,"0"),O_="1900-01-01",$_="2099-12-31",z_="1900-01-01T00:00",F_="2099-12-31T23:59";function H_(t){if(!t)return"";const e=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const s=new Date(t);return Number.isNaN(s.getTime())?"":`${s.getUTCFullYear()}-${ji(s.getUTCMonth()+1)}-${ji(s.getUTCDate())}`}function U_(t){return!t||!/^\d{4}-\d{2}-\d{2}$/.test(t)?"":`${t}T00:00:00.000Z`}function W_(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${ji(e.getMonth()+1)}-${ji(e.getDate())}T${ji(e.getHours())}:${ji(e.getMinutes())}`}function V_(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toISOString()}function K_(t){const e=F.c(29),{id:s,withTime:i,value:r,onChange:o}=t,[a,l]=M.useState(!1);let d;e[0]!==r||e[1]!==i?(d=i?W_(r):H_(r),e[0]=r,e[1]=i,e[2]=d):d=e[2];const c=d;let h;e[3]!==o||e[4]!==i?(h=N=>{o(i?V_(N.target.value):U_(N.target.value))},e[3]=o,e[4]=i,e[5]=h):h=e[5];const u=h;let f;if(e[6]!==r){const N=r?new Date(r):null;f=N&&!Number.isNaN(N.getTime())?N:null,e[6]=r,e[7]=f}else f=e[7];const m=f;let p;e[8]!==o||e[9]!==m||e[10]!==i?(p=N=>{N&&(i&&m?N.setHours(m.getHours(),m.getMinutes(),0,0):N.setHours(0,0,0,0),o(N.toISOString()),l(!1))},e[8]=o,e[9]=m,e[10]=i,e[11]=p):p=e[11];const _=p,L=i?"datetime-local":"date",v=i?z_:O_,x=i?F_:$_;let g;e[12]!==u||e[13]!==s||e[14]!==c||e[15]!==L||e[16]!==v||e[17]!==x?(g=n.jsx(ze,{id:s,type:L,min:v,max:x,value:c,onChange:u,className:"h-10 flex-1 [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:opacity-0"}),e[12]=u,e[13]=s,e[14]=c,e[15]=L,e[16]=v,e[17]=x,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ss,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0","aria-label":"Open calendar",children:n.jsx(Md,{className:"h-4 w-4"})})}),e[19]=y):y=e[19];const b=m??void 0;let S;e[20]!==_||e[21]!==b?(S=n.jsx(ws,{className:"w-auto p-0",align:"end",children:n.jsx(Im,{mode:"single",selected:b,onSelect:_,initialFocus:!0})}),e[20]=_,e[21]=b,e[22]=S):S=e[22];let w;e[23]!==a||e[24]!==S?(w=n.jsxs(bs,{open:a,onOpenChange:l,children:[y,S]}),e[23]=a,e[24]=S,e[25]=w):w=e[25];let C;return e[26]!==w||e[27]!==g?(C=n.jsxs("div",{className:"flex gap-1",children:[g,w]}),e[26]=w,e[27]=g,e[28]=C):C=e[28],C}function cr(t){const e=F.c(8),{htmlFor:s,label:i,description:r}=t;let o;e[0]!==s||e[1]!==i?(o=n.jsx($e,{htmlFor:s,children:i}),e[0]=s,e[1]=i,e[2]=o):o=e[2];let a;e[3]!==r?(a=r&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==a?(l=n.jsxs("div",{className:"space-y-0.5",children:[o,a]}),e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function dr(t){const e=F.c(67),{schema:s,value:i,onChange:r,path:o,label:a}=t,l=typeof i=="string"?i:"",d=s.format;if(d==="rich-text"||d==="rich-text-inline"||d==="html"){let _;return e[0]!==a||e[1]!==r||e[2]!==o||e[3]!==s||e[4]!==i?(_=n.jsx(B_,{schema:s,value:i,onChange:r,path:o,label:a}),e[0]=a,e[1]=r,e[2]=o,e[3]=s,e[4]=i,e[5]=_):_=e[5],_}if(d==="textarea"||d==="markdown"){let _;e[6]!==a||e[7]!==o||e[8]!==s.description?(_=n.jsx(cr,{htmlFor:o,label:a,description:s.description}),e[6]=a,e[7]=o,e[8]=s.description,e[9]=_):_=e[9];let L;e[10]!==r?(L=g=>r(g.target.value),e[10]=r,e[11]=L):L=e[11];let v;e[12]!==o||e[13]!==l||e[14]!==L?(v=n.jsx(In,{id:o,value:l,onChange:L,rows:4}),e[12]=o,e[13]=l,e[14]=L,e[15]=v):v=e[15];let x;return e[16]!==_||e[17]!==v?(x=n.jsxs("div",{className:"space-y-2",children:[_,v]}),e[16]=_,e[17]=v,e[18]=x):x=e[18],x}if(d==="date"||d==="date-time"){let _;e[19]!==a||e[20]!==o||e[21]!==s.description?(_=n.jsx(cr,{htmlFor:o,label:a,description:s.description}),e[19]=a,e[20]=o,e[21]=s.description,e[22]=_):_=e[22];const L=d==="date-time";let v;e[23]!==r||e[24]!==o||e[25]!==l||e[26]!==L?(v=n.jsx(K_,{id:o,withTime:L,value:l,onChange:r}),e[23]=r,e[24]=o,e[25]=l,e[26]=L,e[27]=v):v=e[27];let x;return e[28]!==_||e[29]!==v?(x=n.jsxs("div",{className:"space-y-2",children:[_,v]}),e[28]=_,e[29]=v,e[30]=x):x=e[30],x}if(d==="color-input"){let _;e[31]!==a||e[32]!==o||e[33]!==s.description?(_=n.jsx(cr,{htmlFor:o,label:a,description:s.description}),e[31]=a,e[32]=o,e[33]=s.description,e[34]=_):_=e[34];const L=l||"#000000";let v;e[35]!==r?(v=w=>r(w.target.value),e[35]=r,e[36]=v):v=e[36];let x;e[37]!==L||e[38]!==v?(x=n.jsx("input",{type:"color",value:L,onChange:v,className:"h-10 w-10 cursor-pointer rounded-lg border border-border bg-background p-1"}),e[37]=L,e[38]=v,e[39]=x):x=e[39];let g;e[40]!==r?(g=w=>r(w.target.value),e[40]=r,e[41]=g):g=e[41];let y;e[42]!==o||e[43]!==l||e[44]!==g?(y=n.jsx(ze,{id:o,value:l,onChange:g,placeholder:"#000000",className:"h-10 flex-1"}),e[42]=o,e[43]=l,e[44]=g,e[45]=y):y=e[45];let b;e[46]!==x||e[47]!==y?(b=n.jsxs("div",{className:"flex items-center gap-2",children:[x,y]}),e[46]=x,e[47]=y,e[48]=b):b=e[48];let S;return e[49]!==_||e[50]!==b?(S=n.jsxs("div",{className:"space-y-2",children:[_,b]}),e[49]=_,e[50]=b,e[51]=S):S=e[51],S}let c;e[52]!==a||e[53]!==o||e[54]!==s.description?(c=n.jsx(cr,{htmlFor:o,label:a,description:s.description}),e[52]=a,e[53]=o,e[54]=s.description,e[55]=c):c=e[55];const h=d==="url"?"url":"text";let u;e[56]!==r?(u=_=>r(_.target.value),e[56]=r,e[57]=u):u=e[57];const f=s.default!=null?String(s.default):void 0;let m;e[58]!==o||e[59]!==l||e[60]!==h||e[61]!==u||e[62]!==f?(m=n.jsx(ze,{id:o,type:h,value:l,onChange:u,placeholder:f,className:"h-10"}),e[58]=o,e[59]=l,e[60]=h,e[61]=u,e[62]=f,e[63]=m):m=e[63];let p;return e[64]!==c||e[65]!==m?(p=n.jsxs("div",{className:"space-y-2",children:[c,m]}),e[64]=c,e[65]=m,e[66]=p):p=e[66],p}function q_(t){const e=F.c(17),{schema:s,value:i,onChange:r,path:o,label:a}=t,l=typeof i=="number"?i:"";let d;e[0]!==a||e[1]!==o?(d=n.jsx($e,{htmlFor:o,children:a}),e[0]=a,e[1]=o,e[2]=d):d=e[2];let c;e[3]!==s.description?(c=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[3]=s.description,e[4]=c):c=e[4];let h;e[5]!==d||e[6]!==c?(h=n.jsxs("div",{className:"space-y-0.5",children:[d,c]}),e[5]=d,e[6]=c,e[7]=h):h=e[7];let u;e[8]!==r?(u=p=>{const _=p.target.value;r(_===""?void 0:Number(_))},e[8]=r,e[9]=u):u=e[9];let f;e[10]!==l||e[11]!==o||e[12]!==u?(f=n.jsx(ze,{id:o,type:"number",value:l,onChange:u,className:"h-10"}),e[10]=l,e[11]=o,e[12]=u,e[13]=f):f=e[13];let m;return e[14]!==h||e[15]!==f?(m=n.jsxs("div",{className:"space-y-2",children:[h,f]}),e[14]=h,e[15]=f,e[16]=m):m=e[16],m}function G_(t){const e=F.c(17),{value:s,onChange:i,path:r,label:o,schema:a}=t,l=typeof s=="boolean"?s:!1;let d;e[0]!==o||e[1]!==r?(d=n.jsx($e,{htmlFor:r,children:o}),e[0]=o,e[1]=r,e[2]=d):d=e[2];let c;e[3]!==a.description?(c=a.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:a.description}),e[3]=a.description,e[4]=c):c=e[4];let h;e[5]!==d||e[6]!==c?(h=n.jsxs("div",{className:"space-y-0.5",children:[d,c]}),e[5]=d,e[6]=c,e[7]=h):h=e[7];let u;e[8]!==i?(u=p=>i(p),e[8]=i,e[9]=u):u=e[9];let f;e[10]!==l||e[11]!==r||e[12]!==u?(f=n.jsx(Mn,{id:r,checked:l,onCheckedChange:u}),e[10]=l,e[11]=r,e[12]=u,e[13]=f):f=e[13];let m;return e[14]!==h||e[15]!==f?(m=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h,f]}),e[14]=h,e[15]=f,e[16]=m):m=e[16],m}const c9="__enum_empty__";function d9(t){return t===""?c9:String(t)}function Y_(t,e){if(t===c9)return"";const s=e.find(i=>d9(i)===t);return s!==void 0?s:t}function J_(t,e){return t==null?e.some(s=>s==="")?c9:void 0:d9(t)}function X_(t){return t===""?"":String(t)}function Z_(t){const e=F.c(28),{schema:s,value:i,onChange:r,path:o,label:a}=t;let l;e[0]!==s.enum?(l=s.enum??[],e[0]=s.enum,e[1]=l):l=e[1];const d=l;let c;e[2]!==d||e[3]!==i?(c=J_(i,d),e[2]=d,e[3]=i,e[4]=c):c=e[4];const h=c;let u;e[5]!==a||e[6]!==o?(u=n.jsx($e,{htmlFor:o,children:a}),e[5]=a,e[6]=o,e[7]=u):u=e[7];let f;e[8]!==s.description?(f=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[8]=s.description,e[9]=f):f=e[9];let m;e[10]!==u||e[11]!==f?(m=n.jsxs("div",{className:"space-y-0.5",children:[u,f]}),e[10]=u,e[11]=f,e[12]=m):m=e[12];let p;e[13]!==r||e[14]!==d?(p=y=>r(Y_(y,d)),e[13]=r,e[14]=d,e[15]=p):p=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Ct,{className:"h-10",children:n.jsx(Et,{placeholder:"Select..."})}),e[16]=_):_=e[16];let L;e[17]!==d?(L=d.map(Q_),e[17]=d,e[18]=L):L=e[18];let v;e[19]!==L?(v=n.jsx(kt,{children:L}),e[19]=L,e[20]=v):v=e[20];let x;e[21]!==h||e[22]!==p||e[23]!==v?(x=n.jsxs(jt,{value:h,onValueChange:p,children:[_,v]}),e[21]=h,e[22]=p,e[23]=v,e[24]=x):x=e[24];let g;return e[25]!==x||e[26]!==m?(g=n.jsxs("div",{className:"space-y-2",children:[m,x]}),e[25]=x,e[26]=m,e[27]=g):g=e[27],g}function Q_(t){const e=d9(t);return n.jsx(et,{value:e,children:X_(t)},e)}function h9(t){const e=t.__resolveType;if(typeof e!="string")return null;if(At(e)){const i=t.section?.__resolveType;return typeof i=="string"?i:e}return e}function e6(t){return t.includes("flags/multivariate")}function t6(t){return mt(t)}function s6(t,e){const s=[...t],i=new Set(s.map(o=>o.resolveType)),r=(o,a)=>{!o||i.has(o)||(i.add(o),s.push({resolveType:o,title:a??t6(o)}))};if(e.savedBlockKey&&r(e.savedBlockKey,e.savedBlockKey),e.editorValue&&typeof e.editorValue=="object"&&!Array.isArray(e.editorValue)){const o=h9(e.editorValue);o?.includes("/")&&r(o)}return s}function i6(t,e,s){const i=e[0]?.resolveType??"";if(s)return s;if(!t||typeof t!="object"||Array.isArray(t))return i;const r=t,o=r.__resolveType;if(typeof o=="string"){if(Rs(o)){const u=e.find(f=>f.resolveType===o);return u?u.resolveType:o}const c=e.find(u=>X9(u.resolveType,o));if(c)return c.resolveType;const h=e.find(u=>u.resolveType===o);if(h)return h.resolveType;if(o.includes("/"))return o}const a=typeof r.type=="string"?r.type:void 0;if(a){const c=e.find(h=>h.discriminatorValue===a||h.resolveType===a||X9(h.resolveType,a));if(c)return c.resolveType}let l=i,d=-1;for(const c of e){if(!c.schema?.properties)continue;const u=Object.keys(c.schema.properties).filter(f=>!f.startsWith("__")&&f!=="@type"&&f!=="action"&&f!=="alt").filter(f=>r[f]!==void 0).length;u>0&&u>d&&(d=u,l=c.resolveType)}return d>0,l}function vc(t,e,s){if(!t||typeof t!="object"||Array.isArray(t))return s??null;const i=h9(t);if(!i)return s??null;if(!e)return i.includes("/")?null:s??null;const r=Ks(i,e);return r||(i.includes("/")?null:s??null)}function n6(t,e){if(!t?.properties||!e)return t??null;if(!(e in t.properties))return t;const s={...t.properties};return delete s[e],{...t,properties:s}}function vu(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;if(typeof e.__resolveType!="string"||!At(e.__resolveType))return null;const s=e.section;return!s||typeof s!="object"||Array.isArray(s)?null:s}function r6(t,e){if(e)return!0;if(!t||typeof t!="object"||Array.isArray(t))return!1;const s=t,i=h9(s);return i&&e6(i)?Array.isArray(s.variants)&&s.variants.length>0:Object.keys(s).some(r=>!r.startsWith("__")&&r!=="@type")}function u9(t){if(typeof t=="string")return t;if(!t||typeof t!="object")return"";const e=t;if(Array.isArray(e.variants)){const s=e.variants,i=s.find(o=>o.rule?.__resolveType?.includes("always"));if(typeof i?.value=="string")return i.value;const r=s.find(o=>typeof o.value=="string");if(r)return r.value}return typeof e.src=="string"?e.src:typeof e.url=="string"?e.url:typeof e.value=="string"?e.value:""}function o6(t){if(t?.trim())try{const e=new URL(t);return e.protocol!=="https:"?void 0:e.href}catch{return}}function a6(t){if(Array.isArray(t.variants)){const e=t.variants,s=e.find(r=>r.rule?.__resolveType?.includes("always"));if(typeof s?.value=="string")return s.value;const i=e.find(r=>typeof r.value=="string");if(i)return i.value}if(typeof t.src=="string")return t.src;if(typeof t.url=="string")return t.url;if(typeof t.value=="string")return t.value}function xu(t){if(typeof t=="string"||t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(xu);const e=t;return e.__resolveType?a6(e)??t:yu(e)}function yu(t){const e={};for(const[s,i]of Object.entries(t))e[s]=xu(i);return e}function l6(t,e){return e.split(".").reduce((s,i)=>{if(!(s==null||typeof s!="object"))return s[i]},t)}function bu(t){return t==null?"":Array.isArray(t)?t.map(bu).filter(Boolean).join(","):typeof t=="object"?"":String(t)}function f9(t,e){if(!t.includes("{"))return;const s=yu(e);return t.replace(/\{\{\{([^}]+)\}\}\}|\{\{([^}]+)\}\}/g,(r,o,a)=>{const l=(o??a??"").trim();return bu(l6(s,l))}).trim()||void 0}function c6(t){return t.replace(/<[^>]*>/g,"").trim()}function d6(t,e){if(e.includes("{"))return f9(e,t);const s=t[e];if(typeof s=="string"&&s)return s;if(Array.isArray(s)){const i=s.map(r=>r==null?"":String(r)).filter(Boolean).join(",");if(i)return i}}function Qs(t,e,s){if(typeof t=="string")return t.trim()?t:`Item ${e+1}`;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t&&typeof t=="object"&&!Array.isArray(t)){let i=t;const r=vu(i);if(r&&(i=r),s?.titleBy){const a=d6(i,s.titleBy);if(a)return a}for(const a of["name","label","title","alt","text","href","id","key"]){const l=i[a];if(typeof l=="string"&&l.trim()){const d=s?.properties?.[a]?.format;if(d==="rich-text"||d==="html"){const c=c6(l);if(c)return c;continue}return l}if(Array.isArray(l)){const d=l.map(c=>c==null?"":String(c)).filter(Boolean).join(",");if(d)return d}}const o=i.__resolveType;if(typeof o=="string"&&o)return mt(o);if(s?.title){const a=f9(s.title,i);if(a)return a;if(!s.title.includes("{"))return s.title}}return`Item ${e+1}`}function h6(t){if(!t)return;if(typeof t.image=="string"&&t.image.includes("{"))return t.image;const e=t.properties?.image;if(!e)return;if(e.format==="image-uri")return"{{{image}}}";const s=e.properties;return s?.mobile?"{{{image.mobile}}}":s?.desktop?"{{{image.desktop}}}":"{{{image}}}"}function xc(t,e){if(!t||typeof t!="object"||Array.isArray(t))return;const s=h6(e);if(!s)return;const i=f9(s,t);if(!i)return;const r=u9(i)||i;return o6(r)}function Su(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/^\w/,e=>e.toUpperCase())}function ai(t){return t.normalize("NFC").trim()}function St(t,e){return ai(t)===ai(e)}function yc(t,e){return ai(t).replace(/\s+/g,"").toLowerCase()===ai(e).replace(/\s+/g,"").toLowerCase()}function hr(t,e,s){const i=ai(s);if(t.some(a=>St(a,i)||St(a,s)))return t;const r=[...t];return r.some(a=>St(a,e))||r.push(e),r.push(s),r}function u6(t,e,s){if(s.length===0)return s;const i=jn(t,e),r=s[0];return St(r,i)||St(r,t)?s.slice(1):s}function jn(t,e){return e.title??Su(t)}function ck(t,e){return e<=0?[]:t.slice(0,e)}function zo(t,e){const s=ai(e);return t.findIndex(i=>ai(i)===s)}function bc(t,e){return t.type==="array"&&t.items||yo(t)?!0:Array.isArray(e)}function f6(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Hn(t,e,s,i){if(i.length===0)return null;const r=i[0];for(const a of t){const l=e[a];if(!l||!bc(l,s[a]))continue;const d=jn(a,l);if(St(r,d)||St(r,a)||i.some(c=>St(c,d)||St(c,a)))return a}for(const a of t){const l=e[a];if(!l||!bc(l,s[a]))continue;const d=s[a];if(!Array.isArray(d))continue;const c=l.items;for(let h=0;h<d.length;h++){const u=Qs(d[h],h,c);if(St(u,r))return a}}for(const a of t){const l=e[a];if(l?.type!=="object"||!l.properties)continue;const d=Object.keys(l.properties),c=f6(s[a]),h=jn(a,l);if(Hn(d,l.properties,c,i)||(St(r,h)||St(r,a))&&Hn(d,l.properties,c,i.slice(1)))return a}let o=null;for(const a of t){const l=e[a];if(l?.type!=="block-ref")continue;const d=jn(a,l);if(!(r!==d&&r!==a)){if(i.length>1){const c=s[a];if(c&&typeof c=="object"&&!Array.isArray(c)){const h=i[1];if(Object.keys(c).some(f=>!f.startsWith("__")&&(yc(Su(f),h)||yc(f,h))))return a}}o||(o=a)}}return o||null}function m6(t,e,s,i){return Hn(t,e,s,i)}function p6(t,e,s,i,r){if(r.length===0||!s.properties)return!1;const o=Object.keys(s.properties);if(Hn(o,s.properties,i,r))return!0;const a=r[0];return!St(a,e)&&!St(a,t)?!1:r.length>1||Hn(o,s.properties,i,r.slice(1))!==null}function g6(t,e,s,i){if(e.length===0)return null;for(let o=0;o<e.length;o++){const a=e[o],l=s.findIndex((d,c)=>St(Qs(d,c,i),a));if(l>=0)return{index:l,innerPath:e.slice(o+1)}}const r=e.findIndex(o=>St(o,t));if(r>=0&&e.length>r+1){const o=e[r+1],a=s.findIndex((l,d)=>St(Qs(l,d,i),o));if(a>=0)return{index:a,innerPath:e.slice(r+2)}}return null}function Fo(t){return t.includes("/sections/")||t.includes("multivariate/section")||t===Zn}function _6(t){if(t.type==="block-ref"&&t.anyOfRefs?.length)return t.anyOfRefs.some(s=>Fo(s.resolveType));if(t.anyOfRefs?.length)return t.anyOfRefs.some(s=>Fo(s.resolveType));const e=t.properties?.__resolveType;return e?.type==="block-ref"&&e.anyOfRefs?.length?e.anyOfRefs.some(s=>Fo(s.resolveType)):!1}function L6(t,e){if(e==="global"||e==="sections"||yo(t))return!0;const s=t.type==="array"?t.items:void 0;return s?_6(s):!1}function Sc(t){return Array.from({length:t},(e,s)=>({id:crypto.randomUUID(),index:s}))}function v6(t,e,s,i,r){if(e?.type==="object"&&e.properties&&Object.keys(e.properties).length>0||e?.type==="block-ref"&&e.anyOfRefs?.length)return e;if(t!=null&&typeof t=="object"&&!Array.isArray(t)){const o=t.__resolveType;if(typeof o=="string"&&s){const a=Ks(o,s);if(a?.properties&&Object.keys(a.properties).length>0)return a}}if(s&&i&&r){const a=Ks(i,s)?.properties?.[r]?.items;if(a?.properties&&Object.keys(a.properties).length>0)return{...a,titleBy:a.titleBy??e?.titleBy}}return e}function x6(t){const e=t.split(".").filter(s=>!/^\d+$/.test(s));return e[e.length-1]??t}function wu(t){return t.map((e,s)=>({...e,index:s}))}function y6(t,e){if(e===t.length)return t;if(e<t.length)return wu(t.slice(0,e));const s=Array.from({length:e-t.length},(i,r)=>({id:crypto.randomUUID(),index:t.length+r}));return[...t,...s]}function b6(t){const e=F.c(8),{labelText:s,imageSrc:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Cl,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),e[0]=r):r=e[0];let o;e[1]!==i?(o=i&&n.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[1]=i,e[2]=o):o=e[2];let a;e[3]!==s?(a=n.jsx("span",{className:"min-w-0 truncate",children:s}),e[3]=s,e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==a?(l=n.jsxs(n.Fragment,{children:[r,n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5 text-sm",children:[o,a]})]}),e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function S6(t){const e=F.c(43),{sortableId:s,labelText:i,imageSrc:r,onOpen:o,onDuplicate:a,onRemove:l}=t;let d;e[0]!==s?(d={id:s,animateLayoutChanges:k6},e[0]=s,e[1]=d):d=e[1];const{attributes:c,listeners:h,setNodeRef:u,transform:f,isDragging:m}=vd(d);let p;e[2]!==f?(p=xd.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=p):p=e[3];const _=m?0:void 0;let L;e[4]!==p||e[5]!==_?(L={transform:p,opacity:_},e[4]=p,e[5]=_,e[6]=L):L=e[6];const v=L;let x;e[7]!==o?(x=D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),o())},e[7]=o,e[8]=x):x=e[8];const g=m?"cursor-grabbing":"cursor-pointer";let y;e[9]!==g?(y=le("group flex min-w-0 items-center gap-2.5 rounded-lg px-2 py-2.5 hover:bg-accent hover:text-accent-foreground touch-none",g),e[9]=g,e[10]=y):y=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cl,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),e[11]=b):b=e[11];let S;e[12]!==r?(S=r&&n.jsx("img",{src:r,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[12]=r,e[13]=S):S=e[13];let w;e[14]!==i?(w=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:i}),e[14]=i,e[15]=w):w=e[15];const C=`Open actions for ${i}`;let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Vi,{size:14}),e[16]=N):N=e[16];let T;e[17]!==C?(T=n.jsx(es,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":C,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:C6,onPointerDown:w6,children:N})}),e[17]=C,e[18]=T):T=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Xt,{size:14}),e[19]=A):A=e[19];let j;e[20]!==a?(j=n.jsxs(We,{onClick:a,children:[A,"Duplicate"]}),e[20]=a,e[21]=j):j=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ss,{size:14}),e[22]=k):k=e[22];let I;e[23]!==l?(I=n.jsxs(We,{className:"text-destructive focus:text-destructive",onClick:l,children:[k,"Delete"]}),e[23]=l,e[24]=I):I=e[24];let E;e[25]!==j||e[26]!==I?(E=n.jsxs(ts,{align:"end",children:[j,I]}),e[25]=j,e[26]=I,e[27]=E):E=e[27];let R;e[28]!==T||e[29]!==E?(R=n.jsxs(Qt,{children:[T,E]}),e[28]=T,e[29]=E,e[30]=R):R=e[30];let P;return e[31]!==c||e[32]!==i||e[33]!==h||e[34]!==o||e[35]!==u||e[36]!==v||e[37]!==w||e[38]!==R||e[39]!==x||e[40]!==y||e[41]!==S?(P=n.jsxs("div",{ref:u,style:v,...c,...h,role:"button",tabIndex:0,onClick:o,onKeyDown:x,className:y,title:i,children:[b,S,w,R]}),e[31]=c,e[32]=i,e[33]=h,e[34]=o,e[35]=u,e[36]=v,e[37]=w,e[38]=R,e[39]=x,e[40]=y,e[41]=S,e[42]=P):P=e[42],P}function w6(t){return t.stopPropagation()}function C6(t){return t.stopPropagation()}function k6(){return!1}function ur(t){const e=F.c(24),{schema:s,value:i,onChange:r,path:o,label:a,breadcrumbPath:l,onBreadcrumbChange:d,meta:c,decofile:h,onSaveReferencedBlock:u,containerResolveType:f,previewBaseUrl:m,onAddSectionItem:p,onRequestAddSection:_,sandbox:L}=t,v=l===void 0?[]:l,x=Array.isArray(i)?i:[],g=s.items,y=x6(o),b=L6(s,y),S=g6(a,v,x,g),w=S?.index??null,[C,N]=M.useState(()=>Sc(x.length)),[T,A]=M.useState(null),[j,k]=M.useState(o),[I,E]=M.useState(x.length),R=M.useRef(!1);j!==o?(k(o),E(x.length),N(Sc(x.length))):I!==x.length&&(E(x.length),N(ge=>y6(ge,x.length)));let P;e[0]!==g?(P=(ge,we)=>Qs(ge,we,g),e[0]=g,e[1]=P):P=e[1];const D=P,O=ge=>{if(R.current)return;const we=D(x[ge],ge);d?.(hr(v,a,we))},$=ge=>{const we=[...x,ge];r(we);const Be=we.length-1,Ne=Qs(ge,Be,g);d?.(hr(v,a,Ne))},K=()=>{const ge=g?.type,we=g?.default!==void 0?g.default:ge==="object"?{}:ge==="block-ref"?(()=>{const Ve=g?.anyOfRefs?.[0]?.resolveType;return typeof Ve!="string"||Wr(Ve)?{}:{__resolveType:Ve}})():ge==="number"||ge==="integer"?0:ge==="boolean"?!1:ge==="array"?[]:"",Be=[...x,we];r(Be);const Ne=Be.length-1,nt=Qs(we,Ne,g);d?.(hr(v,a,nt))},z=()=>{if(b){if(!m){ue.error("Start the preview dev server to add sections.");return}if(_){_({append:$});return}ue.error("Section picker is not available in this editor.");return}K()},U=ge=>{const we=x[ge],Be=typeof structuredClone=="function"?structuredClone(we):JSON.parse(JSON.stringify(we??null)),Ne=[...x.slice(0,ge+1),Be,...x.slice(ge+1)];r(Ne)},G=ge=>{if(r(x.filter((we,Be)=>Be!==ge)),w===ge){const we=D(x[ge],ge),Be=zo(v,we);d?.(Be>=0?v.slice(0,Be):[])}},q=(ge,we)=>{const Be=[...x];if(Be[ge]=we,r(Be),ge===w&&w!==null){const Ne=D(x[ge],ge),nt=Qs(we,ge,g);if(Ne!==nt){const Ve=zo(v,Ne);if(Ve>=0){const ye=[...v];ye[Ve]=nt,d?.(ye)}}}};let W;e[2]===Symbol.for("react.memo_cache_sentinel")?(W={activationConstraint:{distance:8}},e[2]=W):W=e[2];let H;e[3]===Symbol.for("react.memo_cache_sentinel")?(H={coordinateGetter:yd},e[3]=H):H=e[3];const Z=hd(Ar(fd,W),Ar(ud,H)),J=C.map(j6);let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B=ge=>{A(String(ge.active.id))},e[4]=B):B=e[4];const X=B,V=ge=>{A(null);const{active:we,over:Be}=ge;if(!Be||we.id===Be.id)return;const Ne=J.indexOf(String(we.id)),nt=J.indexOf(String(Be.id));Ne===-1||nt===-1||(N(Ve=>wu(ha([...Ve],Ne,nt))),r(ha([...x],Ne,nt)),R.current=!0,requestAnimationFrame(()=>{R.current=!1}))};let ee;e[5]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>{A(null)},e[5]=ee):ee=e[5];const te=ee,ae=T?C.find(ge=>ge.id===T):null,de=ae!=null?x[ae.index]:void 0,fe=ae!=null&&de!==void 0?D(de,ae.index):null,Q=ae!=null&&de!==void 0?xc(de,g):void 0;if(w!==null&&w<x.length){const ge=x[w],we=v6(ge,g,c,f,y),Be=()=>{const Ne=D(ge,w),nt=hr(v,a,Ne),Ve=zo(nt,Ne);return Ve>=0?nt.slice(0,Ve+1):nt};return n.jsx("div",{className:"min-w-0",children:we?.type==="object"&&we.properties?n.jsx(vi,{schema:we,value:ge,onChange:Ne=>q(w,Ne),basePath:`${o}.${w}`,breadcrumbPath:S?.innerPath??[],onBreadcrumbChange:Ne=>{d?.([...Be(),...Ne])},meta:c,decofile:h,onSaveReferencedBlock:u,previewBaseUrl:m,onAddSectionItem:p,onRequestAddSection:_,sandbox:L}):we?_9({schema:we,value:ge,onChange:Ne=>q(w,Ne),path:`${o}.${w}`,label:we.title&&!we.title.includes("{{")?we.title:D(ge,w),breadcrumbPath:S?.innerPath??[],onBreadcrumbChange:Ne=>{d?.([...Be(),...Ne])},meta:c,decofile:h,onSaveReferencedBlock:u,previewBaseUrl:m,onAddSectionItem:p,onRequestAddSection:_,sandbox:L}):null})}const se="space-y-2";let oe;e[6]!==a?(oe=n.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:a}),e[6]=a,e[7]=oe):oe=e[7];const he=x.length>0&&n.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:x.length});let xe;e[8]!==oe||e[9]!==he?(xe=n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[oe,he]}),e[8]=oe,e[9]=he,e[10]=xe):xe=e[10];let ve;e[11]!==s.description?(ve=s.description&&n.jsx("p",{className:"break-words text-xs leading-normal text-muted-foreground",children:s.description}),e[11]=s.description,e[12]=ve):ve=e[12];let be;e[13]!==xe||e[14]!==ve?(be=n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[xe,ve]}),e[13]=xe,e[14]=ve,e[15]=be):be=e[15];const De=x.length>0&&n.jsx("div",{className:le(T&&"cursor-grabbing"),children:n.jsxs(md,{sensors:Z,collisionDetection:pd,onDragStart:X,onDragEnd:V,onDragCancel:te,children:[n.jsx(gd,{items:J,strategy:_d,children:n.jsx("div",{className:"min-w-0 overflow-hidden rounded-xl border border-border/50 p-1.5",children:C.map(ge=>{const we=x[ge.index];if(we===void 0)return null;const Be=D(we,ge.index),Ne=xc(we,g);return n.jsx(S6,{sortableId:ge.id,labelText:Be,imageSrc:Ne,onOpen:()=>O(ge.index),onDuplicate:()=>U(ge.index),onRemove:()=>G(ge.index)},ge.id)})})}),n.jsx(Ld,{dropAnimation:null,children:fe?n.jsx("div",{className:"flex min-w-0 items-center gap-2.5 rounded-lg border border-border/60 bg-background px-2 py-2.5 shadow-lg ring-1 ring-border/60",children:n.jsx(b6,{labelText:fe,imageSrc:Q})}):null})]})});let Ie;e[16]===Symbol.for("react.memo_cache_sentinel")?(Ie=n.jsx(Dt,{size:14}),e[16]=Ie):Ie=e[16];const Me=b?"Add section":"Add item";let He;e[17]!==z||e[18]!==Me?(He=n.jsxs("button",{type:"button",onClick:z,className:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-border/60 py-2.5 text-sm text-muted-foreground transition-colors hover:border-border hover:bg-muted/30",children:[Ie,Me]}),e[17]=z,e[18]=Me,e[19]=He):He=e[19];let Je;return e[20]!==be||e[21]!==De||e[22]!==He?(Je=n.jsxs("div",{className:se,children:[be,De,He]}),e[20]=be,e[21]=De,e[22]=He,e[23]=Je):Je=e[23],Je}function j6(t){return t.id}function N6(t){const e=F.c(44),{schema:s,value:i,onChange:r,path:o,label:a,breadcrumbPath:l,onBreadcrumbChange:d,meta:c,decofile:h,onSaveReferencedBlock:u,previewBaseUrl:f,onAddSectionItem:m,onRequestAddSection:p,sandbox:_}=t;let L;e[0]!==l?(L=l===void 0?[]:l,e[0]=l,e[1]=L):L=e[1];const v=L,[x,g]=M.useState(!1);let y;e[2]!==i?(y=i!=null&&typeof i=="object"&&!Array.isArray(i)?i:{},e[2]=i,e[3]=y):y=e[3];const b=y;if(!s.properties)return null;let S;e[4]!==o?(S=o.split(".").pop()??o,e[4]=o,e[5]=S):S=e[5];const w=S;let C;e[6]!==v||e[7]!==w||e[8]!==a||e[9]!==b||e[10]!==s?(C=p6(w,a,s,b,v),e[6]=v,e[7]=w,e[8]=a,e[9]=b,e[10]=s,e[11]=C):C=e[11];const T=x||C,A=`${o}-fields`;let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=()=>g(E6),e[12]=j):j=e[12];let k;e[13]!==T?(k=n.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors group-hover:text-accent-foreground",children:T?n.jsx(ds,{size:16}):n.jsx(Gi,{size:16})}),e[13]=T,e[14]=k):k=e[14];let I;e[15]!==a?(I=n.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:a}),e[15]=a,e[16]=I):I=e[16];let E;e[17]!==A||e[18]!==T||e[19]!==k||e[20]!==I?(E=n.jsxs("button",{type:"button","aria-expanded":T,"aria-controls":A,onClick:j,className:"group flex w-full min-w-0 items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:bg-accent hover:text-accent-foreground",children:[k,I]}),e[17]=A,e[18]=T,e[19]=k,e[20]=I,e[21]=E):E=e[21];let R;e[22]!==s.description?(R=s.description&&n.jsx("p",{className:"break-words pl-9 text-xs leading-normal text-muted-foreground",children:s.description}),e[22]=s.description,e[23]=R):R=e[23];let P;e[24]!==v||e[25]!==A||e[26]!==h||e[27]!==T||e[28]!==c||e[29]!==b||e[30]!==m||e[31]!==d||e[32]!==r||e[33]!==p||e[34]!==u||e[35]!==o||e[36]!==f||e[37]!==_||e[38]!==s?(P=T&&n.jsx("div",{id:A,className:"ml-3 min-w-0 max-w-full overflow-hidden border-l border-border/80 pl-5",children:n.jsx(vi,{schema:s,value:b,onChange:r,basePath:o,breadcrumbPath:v,onBreadcrumbChange:d,meta:c,decofile:h,onSaveReferencedBlock:u,previewBaseUrl:f,onAddSectionItem:m,onRequestAddSection:p,sandbox:_})}),e[24]=v,e[25]=A,e[26]=h,e[27]=T,e[28]=c,e[29]=b,e[30]=m,e[31]=d,e[32]=r,e[33]=p,e[34]=u,e[35]=o,e[36]=f,e[37]=_,e[38]=s,e[39]=P):P=e[39];let D;return e[40]!==R||e[41]!==P||e[42]!==E?(D=n.jsxs("div",{className:"min-w-0 space-y-2",children:[E,R,P]}),e[40]=R,e[41]=P,e[42]=E,e[43]=D):D=e[43],D}function E6(t){return!t}function Cu(t){return t===Zn||t===Ji}function wo(t,e){if(!Object.hasOwn(e,t))return null;const s=e[t]??{},i=s.__resolveType??t;return{data:{...s},resolveType:i}}function Xr(t,e){const s=t.__resolveType??"";if(!s)return null;if(At(s)){const i=t.section??{};return ku(i,e)}if(Cu(s)){const i=t.variants?.[0]?.value;return i?Xr(i,e):null}return!Rs(s)||!Object.hasOwn(e,s)?{data:{...t},resolveType:s}:wo(s,e)}function ku(t,e){const s=t.__resolveType??"";if(!s)return null;if(Cu(s)){const i=t.variants?.[0]?.value;return i?Xr(i,e):null}return!Rs(s)||!Object.hasOwn(e,s)?{data:{...t},resolveType:s}:wo(s,e)}function T6(t,e){if(!t||typeof t!="object"||Array.isArray(t))return null;const i=t.__resolveType;if(typeof i!="string"||!Rs(i)||!Object.hasOwn(e,i))return null;const r=wo(i,e);return r?{blockKey:i,...r}:null}function A6(t,e,s){if(e.isMultivariate)return null;if(e.isSavedBlock){const i=e.isLazy?t.section?.__resolveType??t.__resolveType:t.__resolveType;return wo(i,s)}if(e.isHidden){const o=(At(t.__resolveType)?t.section:t)?.variants?.[0]?.value??t;return Xr(o,s)}if(e.isLazy||At(t.__resolveType)){const i=t.section??{};return ku(i,s)}return Xr(t,s)}function R6(t){if(!t?.properties)return{};const e={};for(const[s,i]of Object.entries(t.properties))s.startsWith("__")||s==="@type"||(i.default!==void 0?e[s]=i.default:i.type==="boolean"?e[s]=!1:i.type==="string"?e[s]="":i.type==="number"||i.type==="integer"?e[s]=0:i.type==="object"&&(e[s]={}));return e}function P6(t){const e=F.c(3),{blockKey:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ee,{asChild:!0,children:n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[n.jsx(Ki,{size:11}),"Global"]})}),e[0]=i):i=e[0];let r;return e[1]!==s?(r=n.jsxs(Ae,{children:[i,n.jsxs(Te,{side:"top",className:"max-w-[260px]",children:["Edits the saved block “",s,"”. Changes apply everywhere this loader is referenced on your site."]})]}),e[1]=s,e[2]=r):r=e[2],r}function D6(t){const e=F.c(28),{path:s,open:i,onOpenChange:r,title:o,nested:a,nestedBlockRef:l,globalBlockKey:d}=t,c=`${s}-loader-config`,h=l&&"ml-1";let u;e[0]!==h?(u=le("rounded-lg border border-border/80 bg-muted/30",h),e[0]=h,e[1]=u):u=e[1];let f;e[2]!==r||e[3]!==i?(f=()=>r(!i),e[2]=r,e[3]=i,e[4]=f):f=e[4];let m;e[5]!==i?(m=n.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center text-muted-foreground transition-colors group-hover:text-foreground",children:i?n.jsx(ds,{size:16}):n.jsx(Gi,{size:16})}),e[5]=i,e[6]=m):m=e[6];let p;e[7]!==o?(p=n.jsx("span",{className:"truncate text-xs font-medium tracking-wide text-muted-foreground uppercase",children:o}),e[7]=o,e[8]=p):p=e[8];let _;e[9]!==d?(_=d&&n.jsx(P6,{blockKey:d}),e[9]=d,e[10]=_):_=e[10];let L;e[11]!==p||e[12]!==_?(L=n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[p,_]}),e[11]=p,e[12]=_,e[13]=L):L=e[13];let v;e[14]!==c||e[15]!==i||e[16]!==f||e[17]!==m||e[18]!==L?(v=n.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":c,onClick:f,className:"group flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[m,L]}),e[14]=c,e[15]=i,e[16]=f,e[17]=m,e[18]=L,e[19]=v):v=e[19];let x;e[20]!==c||e[21]!==a||e[22]!==i?(x=i&&n.jsx("div",{id:c,className:"border-t border-border/60 px-4 pb-4 pt-3",children:n.jsx("div",{className:"border-l border-border/80 pl-4",children:a})}),e[20]=c,e[21]=a,e[22]=i,e[23]=x):x=e[23];let g;return e[24]!==u||e[25]!==v||e[26]!==x?(g=n.jsxs("div",{className:u,children:[v,x]}),e[24]=u,e[25]=v,e[26]=x,e[27]=g):g=e[27],g}function wc(t){const e=F.c(35),{schema:s,value:i,onChange:r,path:o,label:a,breadcrumbPath:l,onBreadcrumbChange:d,meta:c,decofile:h,onSaveReferencedBlock:u,sandbox:f}=t,m=(s.anyOfRefs??[]).filter(B6),p=h&&i?T6(i,h):null,_=p?.data??i,L=p?null:vu(_),v=L??_,x=s6(m,{savedBlockKey:p?.blockKey,editorValue:_}),g=x.length>0?i6(_,x,p?.blockKey):x[0]?.resolveType??"",b=s.type==="block-ref"&&x.some(M6);let S;e[0]!==a||e[1]!==o?(S=a??(o.includes(".")?o.split(".")[0]:o),e[0]=a,e[1]=o,e[2]=S):S=e[2];const w=S;let C;e[3]!==l?(C=l??[],e[3]=l,e[4]=C):C=e[4];const N=C,T=b&&N[0]===w?N.slice(1):N,A=b?q=>{d?.([w,...q])}:d,[j,k]=M.useState(g),[I,E]=M.useState(g);I!==g&&(E(g),k(g));const[R,P]=M.useState(()=>r6(_,p?.blockKey));if(x.length>0){const q=j||g;let W;e[5]!==q?(W=oe=>oe.resolveType===q,e[5]=q,e[6]=W):W=e[6];const H=x.find(W),Z=vc(_,c,H?.schema),J=n6(Z??H?.schema??null,s.discriminatorKey),B=s.discriminatorKey,X=oe=>{k(oe);const he=x.find(Me=>Me.resolveType===oe),xe=vc(_,c,he?.schema),ve=new Set(Object.keys((xe??he?.schema)?.properties??{})),be=i!==null&&typeof i=="object"&&!Array.isArray(i)?i:{},De=Object.fromEntries(Object.entries(be).filter(Me=>{const[He]=Me;return ve.has(He)})),Ie={...R6(he?.schema),...De};if(B){const Me=he?.discriminatorValue??oe;r({...Ie,[B]:Me});return}if(Wr(oe)){r(Ie);return}r({...Ie,__resolveType:oe})};let V;e[7]!==q||e[8]!==B||e[9]!==r?(V=oe=>{if(B||!Wr(q)||oe===null||typeof oe!="object"||Array.isArray(oe)){r(oe);return}const{__resolveType:he,...xe}=oe;r(xe)},e[7]=q,e[8]=B,e[9]=r,e[10]=V):V=e[10];const ee=V,te=J?.properties?n.jsx(vi,{schema:J,value:v,onChange:oe=>{if(p&&u){u(p.blockKey,oe);return}if(L){r({..._,section:oe});return}ee(oe)},basePath:o,breadcrumbPath:T,onBreadcrumbChange:A,meta:c,decofile:h,onSaveReferencedBlock:u,sandbox:f}):null;let ae;e[11]!==o?(ae=o.includes("."),e[11]=o,e[12]=ae):ae=e[12];const de=ae;let fe;e[13]!==a||e[14]!==o?(fe=n.jsx($e,{htmlFor:o,children:a}),e[13]=a,e[14]=o,e[15]=fe):fe=e[15];let Q;e[16]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx(Ct,{children:n.jsx(Et,{placeholder:"Select..."})}),e[16]=Q):Q=e[16];let se;return e[17]!==s.description?(se=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[17]=s.description,e[18]=se):se=e[18],n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[fe,n.jsxs(jt,{value:q||void 0,onValueChange:X,children:[Q,n.jsx(kt,{children:x.map(I6)})]}),se]}),te&&(b?n.jsx(D6,{path:o,open:R,onOpenChange:P,title:de?"Configuration":"Loader configuration",nested:te,nestedBlockRef:de,globalBlockKey:p?.blockKey}):te)]})}if(s.anyOfRefs&&s.anyOfRefs.length>0)return null;let D;e[19]!==a||e[20]!==o?(D=n.jsx($e,{htmlFor:o,children:a}),e[19]=a,e[20]=o,e[21]=D):D=e[21];const O=i!=null?String(i):"";let $;e[22]!==r?($=q=>r(q.target.value),e[22]=r,e[23]=$):$=e[23];const K=s.description??"";let z;e[24]!==o||e[25]!==O||e[26]!==$||e[27]!==K?(z=n.jsx("input",{id:o,type:"text",value:O,onChange:$,className:"w-full rounded-md border bg-background px-3 py-1.5 text-sm",placeholder:K}),e[24]=o,e[25]=O,e[26]=$,e[27]=K,e[28]=z):z=e[28];let U;e[29]!==s.description?(U=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[29]=s.description,e[30]=U):U=e[30];let G;return e[31]!==D||e[32]!==z||e[33]!==U?(G=n.jsxs("div",{className:"space-y-1.5",children:[D,z,U]}),e[31]=D,e[32]=z,e[33]=U,e[34]=G):G=e[34],G}function I6(t){const e=t.title&&!t.title.includes("/")?t.title:va(t.resolveType)??mt(t.resolveType);return n.jsx(et,{value:t.resolveType,children:e},t.resolveType)}function M6(t){return t.resolveType.includes("/")&&!Wr(t.resolveType)}function B6(t){return t.resolveType!==""}function O6(t){if(!Array.isArray(t))return[];const e=[];for(const s of t)if(typeof s=="string")e.push({value:s,label:s});else if(s&&typeof s=="object"&&"value"in s){const i=s;e.push({value:String(i.value),label:typeof i.label=="string"?i.label:String(i.value),image:typeof i.image=="string"?i.image:void 0})}return e}async function $6(t,e,s){const i={};s&&(i.term=s);const o=`${t.replace(/\/+$/,"")}/deco/invoke/${e}`,a=await fetch(o,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)});if(!a.ok)throw new Error(`Failed to fetch dynamic options: ${a.status}`);const l=await a.json();return O6(l)}function Cc(t){const e=F.c(8),{path:s,label:i,description:r}=t;let o;e[0]!==i||e[1]!==s?(o=n.jsx($e,{htmlFor:s,children:i}),e[0]=i,e[1]=s,e[2]=o):o=e[2];let a;e[3]!==r?(a=r&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==a?(l=n.jsxs("div",{className:"space-y-0.5",children:[o,a]}),e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function z6(t){const e=F.c(71),{schema:s,value:i,onChange:r,path:o,label:a,sandbox:l}=t,d=s.options,c=l?.previewUrl,[h,u]=M.useState(!1),[f,m]=M.useState(""),[p,_]=M.useState(""),L=M.useRef(null);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=Z=>{m(Z),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{_(Z)},300)},e[0]=v):v=e[0];const x=v,g=l?`${l.orgSlug}/${l.virtualMcpId}/${l.branch}`:"";let y;e[1]!==p||e[2]!==d||e[3]!==g?(y=Tt.sandboxInvoke(g,`dynamic-options:${d??""}:${p}`),e[1]=p,e[2]=d,e[3]=g,e[4]=y):y=e[4];let b;e[5]!==p||e[6]!==d||e[7]!==c?(b=()=>$6(c,d,p||void 0),e[5]=p,e[6]=d,e[7]=c,e[8]=b):b=e[8];const S=!!c&&!!d&&h;let w;e[9]!==y||e[10]!==b||e[11]!==S?(w={queryKey:y,queryFn:b,enabled:S,staleTime:6e4,retry:1},e[9]=y,e[10]=b,e[11]=S,e[12]=w):w=e[12];const C=Ps(w);let N;e[13]!==C.data?(N=C.data??[],e[13]=C.data,e[14]=N):N=e[14];const T=N,A=typeof i=="string"?i:"";let j;if(e[15]!==A||e[16]!==T){let Z;e[18]!==A?(Z=J=>J.value===A,e[18]=A,e[19]=Z):Z=e[19],j=T.find(Z),e[15]=A,e[16]=T,e[17]=j}else j=e[17];const k=j;if(!c||!d){let Z;e[20]!==a||e[21]!==o||e[22]!==s.description?(Z=n.jsx(Cc,{path:o,label:a,description:s.description}),e[20]=a,e[21]=o,e[22]=s.description,e[23]=Z):Z=e[23];let J;e[24]!==r?(J=V=>r(V.target.value),e[24]=r,e[25]=J):J=e[25];let B;e[26]!==A||e[27]!==o||e[28]!==J?(B=n.jsx(ze,{id:o,type:"text",value:A,onChange:J}),e[26]=A,e[27]=o,e[28]=J,e[29]=B):B=e[29];let X;return e[30]!==B||e[31]!==Z?(X=n.jsxs("div",{className:"space-y-2",children:[Z,B]}),e[30]=B,e[31]=Z,e[32]=X):X=e[32],X}let I;e[33]!==a||e[34]!==o||e[35]!==s.description?(I=n.jsx(Cc,{path:o,label:a,description:s.description}),e[33]=a,e[34]=o,e[35]=s.description,e[36]=I):I=e[36];let E;e[37]!==A||e[38]!==k?(E=k?n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[k.image&&n.jsx("img",{src:k.image,alt:"",referrerPolicy:"no-referrer",className:"h-6 w-6 shrink-0 rounded object-cover"}),n.jsx("span",{className:"truncate",children:k.label??k.value})]}):A?n.jsx("span",{className:"truncate",children:A}):n.jsx("span",{className:"text-muted-foreground",children:"Select..."}),e[37]=A,e[38]=k,e[39]=E):E=e[39];let R;e[40]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx(Qd,{className:"size-4 shrink-0 opacity-50"}),e[40]=R):R=e[40];let P;e[41]!==h||e[42]!==E?(P=n.jsx(Ss,{asChild:!0,children:n.jsxs(ie,{variant:"outline",role:"combobox","aria-expanded":h,className:"h-10 w-full justify-between font-normal",children:[E,R]})}),e[41]=h,e[42]=E,e[43]=P):P=e[43];let D;e[44]===Symbol.for("react.memo_cache_sentinel")?(D={width:"var(--radix-popover-trigger-width)"},e[44]=D):D=e[44];let O;e[45]!==f?(O=n.jsx(po,{placeholder:"Search...",className:"h-9",value:f,onValueChange:x}),e[45]=f,e[46]=O):O=e[46];const $=C.isLoading?"Loading...":"No results found.";let K;e[47]!==$?(K=n.jsx(go,{children:$}),e[47]=$,e[48]=K):K=e[48];let z;if(e[49]!==A||e[50]!==r||e[51]!==T){let Z;e[53]!==A||e[54]!==r?(Z=J=>n.jsxs(On,{value:J.value,onSelect:()=>{r(J.value===A?"":J.value),u(!1)},children:[n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[J.image&&n.jsx("img",{src:J.image,alt:"",referrerPolicy:"no-referrer",className:"h-9 w-9 shrink-0 rounded object-cover"}),n.jsx("span",{className:"truncate",children:J.label??J.value})]}),n.jsx(Ls,{className:le("ml-auto size-4 shrink-0",A===J.value?"opacity-100":"opacity-0")})]},J.value),e[53]=A,e[54]=r,e[55]=Z):Z=e[55],z=T.map(Z),e[49]=A,e[50]=r,e[51]=T,e[52]=z}else z=e[52];let U;e[56]!==z?(U=n.jsx($n,{children:z}),e[56]=z,e[57]=U):U=e[57];let G;e[58]!==K||e[59]!==U?(G=n.jsxs(_o,{children:[K,U]}),e[58]=K,e[59]=U,e[60]=G):G=e[60];let q;e[61]!==O||e[62]!==G?(q=n.jsx(ws,{className:"p-0",style:D,children:n.jsxs(Pl,{shouldFilter:!1,children:[O,G]})}),e[61]=O,e[62]=G,e[63]=q):q=e[63];let W;e[64]!==h||e[65]!==P||e[66]!==q?(W=n.jsxs(bs,{open:h,onOpenChange:u,children:[P,q]}),e[64]=h,e[65]=P,e[66]=q,e[67]=W):W=e[67];let H;return e[68]!==W||e[69]!==I?(H=n.jsxs("div",{className:"space-y-2",children:[I,W]}),e[68]=W,e[69]=I,e[70]=H):H=e[70],H}function F6(t){const e=F.c(17),{org:s}=Fe(),i=mi();let r,o,a,l;e[0]!==s.id||e[1]!==t.configId||e[2]!==t.imageOnly||e[3]!==t.search?(o=t.search?.trim()||void 0,r=t.imageOnly??!1,l=$m,a=Tt.filePickerObjects(s.id,t.configId,o,r),e[0]=s.id,e[1]=t.configId,e[2]=t.imageOnly,e[3]=t.search,e[4]=r,e[5]=o,e[6]=a,e[7]=l):(r=e[4],o=e[5],a=e[6],l=e[7]);const d=t.enabled!==!1&&!!t.configId;let c;e[8]!==r||e[9]!==t.configId||e[10]!==o||e[11]!==i?(c=async u=>{const{pageParam:f}=u;return await i.call("FILE_OBJECTS_LIST",{configId:t.configId,cursor:f??void 0,search:o,imageOnly:r||void 0})},e[8]=r,e[9]=t.configId,e[10]=o,e[11]=i,e[12]=c):c=e[12];let h;return e[13]!==a||e[14]!==d||e[15]!==c?(h={queryKey:a,enabled:d,staleTime:3e4,initialPageParam:null,queryFn:c,getNextPageParam:H6},e[13]=a,e[14]=d,e[15]=c,e[16]=h):h=e[16],l(h)}function H6(t){return t.nextCursor??void 0}function m9(){const t=F.c(2),{org:e}=Fe();let s;return t[0]!==e?(s={mutationFn:async i=>{const r=i.file.type||"application/octet-stream",o=await fetch(`/api/${encodeURIComponent(e.slug)}/file-configs/${encodeURIComponent(i.configId)}/upload?filename=${encodeURIComponent(i.file.name)}`,{method:"POST",headers:{"Content-Type":r},body:i.file});if(!o.ok){const a=await o.text().catch(U6);let l=`${o.status} ${o.statusText}`;try{const d=JSON.parse(a);d.message&&(l=d.message)}catch{a&&(l=a.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await o.json()}},t[0]=e,t[1]=s):s=t[1],hi(s)}function U6(){return""}const Co="file-picker:last-config-id";function ju(t){const e=F.c(19),s=t.mode==="image"?"Pick an image":"Pick a file";let i;e[0]!==s?(i=n.jsx(ns,{children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(qi,{children:"Upload a new file or pick one previously uploaded to a configured bucket."}),e[2]=r):r=e[2];let o;e[3]!==i?(o=n.jsxs(is,{children:[i,r]}),e[3]=i,e[4]=o):o=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(El,{className:"h-64 w-full"}),e[5]=a):a=e[5];let l;e[6]!==t?(l=u=>{t.onSelect(u),t.onOpenChange(!1)},e[6]=t,e[7]=l):l=e[7];let d;e[8]!==t.lockedConfigId||e[9]!==t.mode||e[10]!==l?(d=n.jsx(Jt,{fallback:W6,children:n.jsx(M.Suspense,{fallback:a,children:n.jsx(K6,{mode:t.mode,lockedConfigId:t.lockedConfigId,onSelect:l})})}),e[8]=t.lockedConfigId,e[9]=t.mode,e[10]=l,e[11]=d):d=e[11];let c;e[12]!==o||e[13]!==d?(c=n.jsxs($t,{className:"sm:max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",children:[o,d]}),e[12]=o,e[13]=d,e[14]=c):c=e[14];let h;return e[15]!==t.onOpenChange||e[16]!==t.open||e[17]!==c?(h=n.jsx(Ot,{open:t.open,onOpenChange:t.onOpenChange,children:c}),e[15]=t.onOpenChange,e[16]=t.open,e[17]=c,e[18]=h):h=e[18],h}function W6(t){const{error:e}=t;return n.jsx(V6,{error:e??new Error("Failed to load buckets")})}function V6(t){const e=F.c(3),{error:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ui,{size:16}),e[0]=i):i=e[0];let r;return e[1]!==s.message?(r=n.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,n.jsx("span",{className:"text-sm font-medium",children:s.message})]}),e[1]=s.message,e[2]=r):r=e[2],r}function K6(t){const e=F.c(32),{mode:s,lockedConfigId:i,onSelect:r}=t,o=Om();if(o.length===0){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Y6,{}),e[0]=p):p=e[0],p}if(i){let p;if(e[1]!==o||e[2]!==i){let L;e[4]!==i?(L=v=>v.id===i,e[4]=i,e[5]=L):L=e[5],p=o.find(L),e[1]=o,e[2]=i,e[3]=p}else p=e[3];const _=p;if(_){let L;return e[6]!==_||e[7]!==s||e[8]!==r?(L=n.jsx(Ho,{config:_,mode:s,onSelect:r}),e[6]=_,e[7]=s,e[8]=r,e[9]=L):L=e[9],L}}if(o.length===1){const p=o[0];let _;return e[10]!==p||e[11]!==s||e[12]!==r?(_=n.jsx(Ho,{config:p,mode:s,onSelect:r}),e[10]=p,e[11]=s,e[12]=r,e[13]=_):_=e[13],_}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=typeof window<"u"?window.localStorage.getItem(Co):null,e[14]=a):a=e[14];const l=a;let d;e[15]!==o?(d=o.find(p=>p.id===l)?.id??o[0].id,e[15]=o,e[16]=d):d=e[16];const c=d;let h;e[17]!==o?(h=o.map(q6),e[17]=o,e[18]=h):h=e[18];let u;e[19]!==h?(u=n.jsx(uo,{className:"self-start",children:h}),e[19]=h,e[20]=u):u=e[20];let f;if(e[21]!==o||e[22]!==s||e[23]!==r){let p;e[25]!==s||e[26]!==r?(p=_=>n.jsx(Ai,{value:_.id,className:"min-h-0 flex-1 overflow-hidden",children:n.jsx(Ho,{config:_,mode:s,onSelect:r})},_.id),e[25]=s,e[26]=r,e[27]=p):p=e[27],f=o.map(p),e[21]=o,e[22]=s,e[23]=r,e[24]=f}else f=e[24];let m;return e[28]!==c||e[29]!==u||e[30]!==f?(m=n.jsxs(fo,{defaultValue:c,onValueChange:G6,className:"min-h-0 flex-1 flex flex-col",children:[u,f]}),e[28]=c,e[29]=u,e[30]=f,e[31]=m):m=e[31],m}function q6(t){return n.jsx(Hs,{value:t.id,children:t.name},t.id)}function G6(t){typeof window<"u"&&window.localStorage.setItem(Co,t)}function Y6(){const t=F.c(4),{org:e}=Fe();let s,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:n.jsx(Yn,{size:20,className:"text-muted-foreground"})}),i=n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-sm",children:"No bucket configured"}),n.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket in Settings before you can upload files."})]}),t[0]=s,t[1]=i):(s=t[0],i=t[1]);let r;return t[2]!==e.slug?(r=n.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s,i,n.jsx(ie,{asChild:!0,size:"sm",className:"mt-2",children:n.jsx(ed,{to:"/$org/settings/files",params:{org:e.slug},children:"Configure a bucket"})})]}),t[2]=e.slug,t[3]=r):r=t[3],r}function Ho({config:t,mode:e,onSelect:s}){const[i,r]=M.useState(""),o=Cm(i,300),a=F6({configId:t.id,search:o,imageOnly:e==="image"}),l=m9(),[d,c]=M.useState(!1),h=M.useRef(null),u=e==="image"?"image/*":void 0;async function f(S){if(!S)return;const w=Array.from(S);if(w.length===0)return;let C=null;const N=[];for(const T of w)try{const A=await l.mutateAsync({configId:t.id,file:T});C??=A.publicUrl}catch(A){N.push(`${T.name} (${A instanceof Error?A.message:"upload failed"})`)}await a.refetch(),N.length>0&&ue.error(N.length===w.length?`Upload failed: ${N.join("; ")}`:`Some files failed: ${N.join("; ")}`),C&&s(C)}function m(S){S.preventDefault(),c(!0)}function p(){c(!1)}function _(S){S.preventDefault(),c(!1),f(S.dataTransfer.files)}const v=(a.data?.pages??[]).flatMap(S=>S.items),x=v.filter(S=>e==="image"?Nu(S.key):!0),g=o.trim(),y=v.length>0||i.trim().length>0,b=i!==o||a.isFetching&&!a.isFetchingNextPage;return n.jsxs("div",{className:"flex flex-col gap-3 min-h-0 h-full",children:[n.jsxs("button",{type:"button",onClick:()=>h.current?.click(),onDragOver:m,onDragLeave:p,onDrop:_,className:le("rounded-xl border border-dashed border-border/60 p-6 flex flex-col items-center justify-center gap-2 text-center transition-colors",d&&"border-primary bg-primary/5",l.isPending&&"opacity-60 pointer-events-none"),children:[n.jsx(Yn,{size:18,className:"text-muted-foreground"}),n.jsx("p",{className:"text-sm font-medium",children:l.isPending?"Uploading…":"Drop files here or click to upload"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Up to 100 MB."," ",e==="image"?"Images only (PNG, JPEG, WebP, GIF, SVG, AVIF).":"Common image, video, audio, and document types."]}),n.jsx("input",{ref:h,type:"file",accept:u,multiple:!0,className:"hidden",onChange:S=>{const w=Array.from(S.target.files??[]);S.target.value="",f(w)}})]}),y?n.jsx(jl,{value:i,onChange:r,isSearching:b,placeholder:e==="image"?"Search images…":"Search files…"}):null,n.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[x.length===0?g?n.jsx(Z6,{query:g}):e==="image"&&v.length>0?n.jsx(X6,{}):n.jsx(J6,{}):e==="image"?n.jsx(eL,{items:x,onSelect:s}):n.jsx(tL,{items:x,onSelect:s}),a.hasNextPage&&n.jsx("div",{className:"flex justify-center py-4",children:n.jsx(ie,{type:"button",variant:"outline",size:"sm",disabled:a.isFetchingNextPage,onClick:()=>a.fetchNextPage(),children:a.isFetchingNextPage?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Loading…"]}):"Load more"})})]})]})}function J6(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[n.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:n.jsx(oi,{size:18,className:"text-muted-foreground"})}),n.jsx("p",{className:"text-sm font-medium",children:"No files in this bucket yet"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Drop a file above to get started."})]}),t[0]=e):e=t[0],e}function X6(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[n.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:n.jsx(oi,{size:18,className:"text-muted-foreground"})}),n.jsx("p",{className:"text-sm font-medium",children:"No images in this bucket yet"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"The bucket has other files, but none match common image formats."})]}),t[0]=e):e=t[0],e}function Z6(t){const e=F.c(6),{query:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:n.jsx(oi,{size:18,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let r;e[1]!==s?(r=n.jsxs("p",{className:"text-sm font-medium",children:['No matches for "',s,'"']}),e[1]=s,e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("p",{className:"text-xs text-muted-foreground",children:"Try a different search, or load more files below."}),e[3]=o):o=e[3];let a;return e[4]!==r?(a=n.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[i,r,o]}),e[4]=r,e[5]=a):a=e[5],a}function Nu(t){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(t)}function Q6(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"file":t.slice(e+1).toLowerCase()}function eL(t){const e=F.c(7),{items:s,onSelect:i}=t;let r;if(e[0]!==s||e[1]!==i){let a;e[3]!==i?(a=l=>n.jsx(Eu,{item:l,variant:"image",onSelect:i},l.key),e[3]=i,e[4]=a):a=e[4],r=s.map(a),e[0]=s,e[1]=i,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:r}),e[5]=r,e[6]=o):o=e[6],o}function tL(t){const e=F.c(7),{items:s,onSelect:i}=t;let r;if(e[0]!==s||e[1]!==i){let a;e[3]!==i?(a=l=>n.jsx("li",{children:n.jsx(Eu,{item:l,variant:"row",onSelect:i})},l.key),e[3]=i,e[4]=a):a=e[4],r=s.map(a),e[0]=s,e[1]=i,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=n.jsx("ul",{className:"divide-y divide-border/60 rounded-lg border border-border/60",children:r}),e[5]=r,e[6]=o):o=e[6],o}function Eu(t){const e=F.c(58),{item:s,variant:i,onSelect:r}=t;let o;e[0]!==s.key?(o=Q6(s.key),e[0]=s.key,e[1]=o):o=e[1];const a=o;if(i==="image"){let g;e[2]!==s.publicUrl||e[3]!==r?(g=()=>r(s.publicUrl),e[2]=s.publicUrl,e[3]=r,e[4]=g):g=e[4];let y;e[5]!==s.key||e[6]!==s.publicUrl?(y=n.jsx("img",{src:s.publicUrl,alt:s.key,loading:"lazy",className:"h-full w-full object-cover",onError:sL}),e[5]=s.key,e[6]=s.publicUrl,e[7]=y):y=e[7];let b;e[8]!==s.key||e[9]!==g||e[10]!==y?(b=n.jsx("button",{type:"button",onClick:g,className:"block h-full w-full transition hover:ring-2 hover:ring-primary",title:s.key,children:y}),e[8]=s.key,e[9]=g,e[10]=y,e[11]=b):b=e[11];let S;e[12]!==a?(S=n.jsx("span",{className:"pointer-events-none absolute left-1.5 top-1.5 rounded bg-background/80 px-1.5 py-0.5 text-[10px] font-medium uppercase text-foreground opacity-0 backdrop-blur-sm transition-opacity group-hover:opacity-100",children:a}),e[12]=a,e[13]=S):S=e[13];let w;e[14]!==s||e[15]!==r?(w=n.jsx("div",{className:"absolute right-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100",children:n.jsx(kc,{item:s,onSelect:r})}),e[14]=s,e[15]=r,e[16]=w):w=e[16];let C;e[17]!==s.key?(C=jc(s.key),e[17]=s.key,e[18]=C):C=e[18];let N;e[19]!==C?(N=n.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",children:n.jsx("p",{className:"truncate text-xs text-white",children:C})}),e[19]=C,e[20]=N):N=e[20];let T;return e[21]!==b||e[22]!==S||e[23]!==w||e[24]!==N?(T=n.jsxs("div",{className:"group relative aspect-square overflow-hidden rounded-lg border border-border/60 bg-muted",children:[b,S,w,N]}),e[21]=b,e[22]=S,e[23]=w,e[24]=N,e[25]=T):T=e[25],T}let l;e[26]!==s.publicUrl||e[27]!==r?(l=()=>r(s.publicUrl),e[26]=s.publicUrl,e[27]=r,e[28]=l):l=e[28];let d;e[29]!==s.key?(d=n.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted",children:Nu(s.key)?n.jsx(oi,{size:16,className:"text-muted-foreground"}):n.jsx(Di,{size:16,className:"text-muted-foreground"})}),e[29]=s.key,e[30]=d):d=e[30];let c;e[31]!==s.key?(c=jc(s.key),e[31]=s.key,e[32]=c):c=e[32];let h;e[33]!==c?(h=n.jsx("p",{className:"truncate text-sm font-medium",children:c}),e[33]=c,e[34]=h):h=e[34];let u;e[35]!==s.key?(u=n.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:s.key}),e[35]=s.key,e[36]=u):u=e[36];let f;e[37]!==h||e[38]!==u?(f=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,u]}),e[37]=h,e[38]=u,e[39]=f):f=e[39];let m;e[40]!==a?(m=n.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:a}),e[40]=a,e[41]=m):m=e[41];let p;e[42]!==s.size?(p=oL(s.size),e[42]=s.size,e[43]=p):p=e[43];let _;e[44]!==p?(_=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:p}),e[44]=p,e[45]=_):_=e[45];let L;e[46]!==_||e[47]!==l||e[48]!==d||e[49]!==f||e[50]!==m?(L=n.jsxs("button",{type:"button",onClick:l,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[d,f,m,_]}),e[46]=_,e[47]=l,e[48]=d,e[49]=f,e[50]=m,e[51]=L):L=e[51];let v;e[52]!==s||e[53]!==r?(v=n.jsx(kc,{item:s,onSelect:r}),e[52]=s,e[53]=r,e[54]=v):v=e[54];let x;return e[55]!==L||e[56]!==v?(x=n.jsxs("div",{className:"group flex items-center gap-3 px-3 py-2 transition hover:bg-muted/50",children:[L,v]}),e[55]=L,e[56]=v,e[57]=x):x=e[57],x}function sL(t){t.target.style.display="none"}function kc(t){const e=F.c(22),{item:s,onSelect:i}=t,[r,o]=M.useState(!1);let a;e[0]!==s.publicUrl?(a=async function(g){g.preventDefault(),g.stopPropagation();try{await navigator.clipboard.writeText(s.publicUrl),o(!0),window.setTimeout(()=>o(!1),1500)}catch{ue.error("Failed to copy URL")}},e[0]=s.publicUrl,e[1]=a):a=e[1];const l=a;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(es,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"size-7 rounded-md bg-background/80 backdrop-blur-sm",onClick:rL,"aria-label":"Asset actions",children:n.jsx(Dm,{size:14})})}),e[2]=d):d=e[2];let c;e[3]!==s.publicUrl||e[4]!==i?(c=()=>i(s.publicUrl),e[3]=s.publicUrl,e[4]=i,e[5]=c):c=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Ls,{size:14}),e[6]=h):h=e[6];let u;e[7]!==c?(u=n.jsxs(We,{onClick:c,children:[h,"Use this"]}),e[7]=c,e[8]=u):u=e[8];let f;e[9]!==r?(f=r?n.jsx(Ls,{size:14}):n.jsx(Xt,{size:14}),e[9]=r,e[10]=f):f=e[10];const m=r?"Copied":"Copy URL";let p;e[11]!==l||e[12]!==f||e[13]!==m?(p=n.jsxs(We,{onClick:l,children:[f,m]}),e[11]=l,e[12]=f,e[13]=m,e[14]=p):p=e[14];let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(pi,{size:14}),e[15]=_):_=e[15];let L;e[16]!==s.publicUrl?(L=n.jsx(We,{asChild:!0,children:n.jsxs("a",{href:s.publicUrl,target:"_blank",rel:"noreferrer",onClick:iL,children:[_,"Open in new tab"]})}),e[16]=s.publicUrl,e[17]=L):L=e[17];let v;return e[18]!==L||e[19]!==u||e[20]!==p?(v=n.jsxs(Qt,{children:[d,n.jsxs(ts,{align:"end",onClick:nL,children:[u,p,L]})]}),e[18]=L,e[19]=u,e[20]=p,e[21]=v):v=e[21],v}function iL(t){return t.stopPropagation()}function nL(t){return t.stopPropagation()}function rL(t){return t.stopPropagation()}function jc(t){const e=t.split("/");return e[e.length-1]??t}function oL(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Tu(t,e){if(!e)return null;const s=e.toLowerCase();return t.find(i=>{const r=i.bucket.toLowerCase();return i.siteSlug?.toLowerCase()===s||r===s||r===`deco-assets-${s}`})??null}function Nc(t){const e=F.c(2),{ext:s}=t;if(!s)return null;let i;return e[0]!==s?(i=n.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function aL(t){try{const e=new URL(t).pathname;return decodeURIComponent(e.split("/").pop()??t)}catch{return t.split("/").pop()??t}}function lL(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"":t.slice(e+1).toLowerCase()}function cL(t){const e=F.c(79),{schema:s,value:i,onChange:r,path:o,label:a,sandbox:l}=t,d=s.format==="video-uri",c=u9(i),[h,u]=M.useState(!1),[f,m]=M.useState(!1),p=c?aL(c):"",_=p?lL(p):"",L=th(),v=m9();let x;e[0]!==L.data?.configs?(x=L.data?.configs??[],e[0]=L.data?.configs,e[1]=x):x=e[1];const g=l?.siteSlug;let y;e[2]!==x||e[3]!==g?(y=Tu(x,g),e[2]=x,e[3]=g,e[4]=y):y=e[4];const b=y;let S;e[5]!==L.data?.configs||e[6]!==b?(S=function(){if(b)return b.id;const Q=L.data?.configs??[];if(Q.length===1)return Q[0].id;if(Q.length===0)return null;const se=typeof window<"u"?window.localStorage.getItem(Co):null;return Q.some(oe=>oe.id===se)?se:null},e[5]=L.data?.configs,e[6]=b,e[7]=S):S=e[7];const w=S;let C;e[8]!==d||e[9]!==r||e[10]!==w||e[11]!==u||e[12]!==v?(C=async function(Q){if(!Q)return;let se=Array.from(Q);if(se.length===0)return;if(d&&(se=se.filter(dL),se.length===0)){ue.error("Please drop a video file (mp4, webm, …).");return}const oe=w();if(!oe){u(!0);return}try{const he=await v.mutateAsync({configId:oe,file:se[0]});r(he.publicUrl),se.length>1&&ue.info(`Uploaded ${se[0].name}; extra files were ignored (single-select field).`)}catch(he){const xe=he;ue.error(xe instanceof Error?xe.message:"Upload failed")}},e[8]=d,e[9]=r,e[10]=w,e[11]=u,e[12]=v,e[13]=C):C=e[13];const N=C;let T;e[14]!==m?(T=function(Q){Q.preventDefault(),Q.dataTransfer.types.includes("Files")&&m(!0)},e[14]=m,e[15]=T):T=e[15];const A=T;let j;e[16]!==m?(j=function(Q){Q.currentTarget===Q.target&&m(!1)},e[16]=m,e[17]=j):j=e[17];const k=j;let I;e[18]!==N||e[19]!==m?(I=function(Q){Q.preventDefault(),m(!1),N(Q.dataTransfer.files)},e[18]=N,e[19]=m,e[20]=I):I=e[20];const E=I;let R;e[21]!==a||e[22]!==o?(R=n.jsx($e,{htmlFor:o,className:"text-muted-foreground",children:a}),e[21]=a,e[22]=o,e[23]=R):R=e[23];let P;e[24]!==s.description?(P=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[24]=s.description,e[25]=P):P=e[25];let D;e[26]!==P||e[27]!==R?(D=n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[R,P]}),e[26]=P,e[27]=R,e[28]=D):D=e[28];const O=f&&"border-primary ring-2 ring-primary/30",$=v.isPending&&"pointer-events-none opacity-60";let K;e[29]!==O||e[30]!==$?(K=le("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",O,$),e[29]=O,e[30]=$,e[31]=K):K=e[31];let z;e[32]!==_||e[33]!==p||e[34]!==d||e[35]!==u||e[36]!==c||e[37]!==v.isPending?(z=c?d?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"relative h-40 w-full overflow-hidden bg-black",children:n.jsx("video",{src:c,preload:"metadata",className:"h-full w-full object-contain"},c)}),n.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[n.jsx(F9,{size:14,className:"shrink-0 text-muted-foreground"}),n.jsx("p",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:p}),n.jsx(Nc,{ext:_})]})]}):n.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[n.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-md bg-background",children:n.jsx(Di,{size:18,className:"text-muted-foreground"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:p}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:c})]}),n.jsx(Nc,{ext:_})]}):n.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex w-full flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[d?n.jsx(F9,{size:20}):n.jsx(Di,{size:20}),n.jsx("span",{className:"text-sm font-medium",children:v.isPending?"Uploading…":d?"Drop a video here or click to browse":"Drop a file or click to browse"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Up to 100 MB"})]}),e[32]=_,e[33]=p,e[34]=d,e[35]=u,e[36]=c,e[37]=v.isPending,e[38]=z):z=e[38];let U;e[39]!==f?(U=f&&n.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:n.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[39]=f,e[40]=U):U=e[40];let G;e[41]!==k||e[42]!==A||e[43]!==E||e[44]!==K||e[45]!==z||e[46]!==U?(G=n.jsxs("div",{onDragOver:A,onDragLeave:k,onDrop:E,className:K,children:[z,U]}),e[41]=k,e[42]=A,e[43]=E,e[44]=K,e[45]=z,e[46]=U,e[47]=G):G=e[47];let q;e[48]!==r?(q=fe=>r(fe.target.value),e[48]=r,e[49]=q):q=e[49];let W;e[50]!==o||e[51]!==c||e[52]!==q?(W=n.jsx(ze,{id:o,type:"url",value:c,onChange:q,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[50]=o,e[51]=c,e[52]=q,e[53]=W):W=e[53];let H;e[54]!==u?(H=()=>u(!0),e[54]=u,e[55]=H):H=e[55];let Z;e[56]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(Yn,{size:14}),e[56]=Z):Z=e[56];const J=c?"Replace":"Browse";let B;e[57]!==H||e[58]!==J?(B=n.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:H,className:"h-9 shrink-0",children:[Z,J]}),e[57]=H,e[58]=J,e[59]=B):B=e[59];let X;e[60]!==r||e[61]!==c?(X=c&&n.jsx(ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(""),className:"h-9 shrink-0","aria-label":"Remove file",children:n.jsx(ss,{size:14})}),e[60]=r,e[61]=c,e[62]=X):X=e[62];let V;e[63]!==W||e[64]!==B||e[65]!==X?(V=n.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[W,B,X]}),e[63]=W,e[64]=B,e[65]=X,e[66]=V):V=e[66];let ee;e[67]!==r?(ee=fe=>r(fe),e[67]=r,e[68]=ee):ee=e[68];const te=b?.id??null;let ae;e[69]!==h||e[70]!==u||e[71]!==ee||e[72]!==te?(ae=n.jsx(ju,{open:h,onOpenChange:u,mode:"any",onSelect:ee,lockedConfigId:te}),e[69]=h,e[70]=u,e[71]=ee,e[72]=te,e[73]=ae):ae=e[73];let de;return e[74]!==D||e[75]!==G||e[76]!==V||e[77]!==ae?(de=n.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[D,G,V,ae]}),e[74]=D,e[75]=G,e[76]=V,e[77]=ae,e[78]=de):de=e[78],de}function dL(t){return t.type.startsWith("video/")}function hL(t){try{const e=new URL(t).pathname;return decodeURIComponent(e.split("/").pop()??t)}catch{return t.split("/").pop()??t}}function uL(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"":t.slice(e+1).toLowerCase()}const fL=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/avif"]);function mL(t){const e=F.c(86),{schema:s,value:i,onChange:r,path:o,label:a,sandbox:l}=t,d=u9(i),[c,h]=M.useState(!1),[u,f]=M.useState(!1),[m,p]=M.useState(!1),[_,L]=M.useState(!1),v=d?hL(d):"",x=v?uL(v):"",g=th(),y=m9();let b;e[0]!==g.data?.configs?(b=g.data?.configs??[],e[0]=g.data?.configs,e[1]=b):b=e[1];const S=l?.siteSlug;let w;e[2]!==b||e[3]!==S?(w=Tu(b,S),e[2]=b,e[3]=S,e[4]=w):w=e[4];const C=w;let N;e[5]!==r||e[6]!==L||e[7]!==p?(N=function(ve){p(!1),L(!1),r(ve)},e[5]=r,e[6]=L,e[7]=p,e[8]=N):N=e[8];const T=N;let A;e[9]!==g.data?.configs||e[10]!==C?(A=function(){if(C)return C.id;const ve=g.data?.configs??[];if(ve.length===1)return ve[0].id;if(ve.length===0)return null;const be=typeof window<"u"?window.localStorage.getItem(Co):null;return ve.some(De=>De.id===be)?be:null},e[9]=g.data?.configs,e[10]=C,e[11]=A):A=e[11];const j=A;let k;e[12]!==j||e[13]!==h||e[14]!==T||e[15]!==y?(k=async function(ve){if(!ve)return;const be=Array.from(ve).filter(pL);if(be.length===0){ue.error("Only image files are accepted here.");return}const De=j();if(!De){h(!0);return}try{const Ie=await y.mutateAsync({configId:De,file:be[0]});T(Ie.publicUrl),be.length>1&&ue.info(`Uploaded ${be[0].name}; extra files were ignored (single-select field).`)}catch(Ie){const Me=Ie;ue.error(Me instanceof Error?Me.message:"Upload failed")}},e[12]=j,e[13]=h,e[14]=T,e[15]=y,e[16]=k):k=e[16];const I=k;let E;e[17]!==f?(E=function(ve){ve.preventDefault(),ve.dataTransfer.types.includes("Files")&&f(!0)},e[17]=f,e[18]=E):E=e[18];const R=E;let P;e[19]!==f?(P=function(ve){ve.currentTarget===ve.target&&f(!1)},e[19]=f,e[20]=P):P=e[20];const D=P;let O;e[21]!==I||e[22]!==f?(O=function(ve){ve.preventDefault(),f(!1),I(ve.dataTransfer.files)},e[21]=I,e[22]=f,e[23]=O):O=e[23];const $=O;let K;e[24]!==a||e[25]!==o?(K=n.jsx($e,{htmlFor:o,className:"text-muted-foreground",children:a}),e[24]=a,e[25]=o,e[26]=K):K=e[26];let z;e[27]!==s.description?(z=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[27]=s.description,e[28]=z):z=e[28];let U;e[29]!==K||e[30]!==z?(U=n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[K,z]}),e[29]=K,e[30]=z,e[31]=U):U=e[31];const G=u&&"border-primary ring-2 ring-primary/30",q=y.isPending&&"pointer-events-none opacity-60";let W;e[32]!==G||e[33]!==q?(W=le("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",G,q),e[32]=G,e[33]=q,e[34]=W):W=e[34];let H;e[35]!==x||e[36]!==v||e[37]!==_||e[38]!==m||e[39]!==a||e[40]!==L||e[41]!==p||e[42]!==h||e[43]!==d||e[44]!==y.isPending?(H=d?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"relative h-40 w-full bg-[image:linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%),linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%)] bg-[position:0_0,8px_8px] [background-size:16px_16px]",children:[!_&&n.jsx("img",{src:d,alt:a,className:le("h-full w-full object-contain transition-opacity",!m&&"opacity-0"),onLoad:()=>p(!0),onError:()=>L(!0)},d),_&&n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-muted-foreground",children:[n.jsx(oi,{size:20}),n.jsx("p",{className:"text-xs",children:"Preview unavailable"})]}),!m&&!_&&n.jsx("div",{className:"absolute inset-0 animate-pulse bg-muted/60"})]}),n.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:v}),x&&n.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:x})]})]}):n.jsxs("button",{type:"button",onClick:()=>h(!0),className:"flex h-40 w-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[n.jsx(oi,{size:20}),n.jsx("span",{className:"text-sm font-medium",children:y.isPending?"Uploading…":"Drop an image or click to browse"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"PNG, JPEG, WebP, GIF, SVG, AVIF — up to 100 MB"})]}),e[35]=x,e[36]=v,e[37]=_,e[38]=m,e[39]=a,e[40]=L,e[41]=p,e[42]=h,e[43]=d,e[44]=y.isPending,e[45]=H):H=e[45];let Z;e[46]!==u?(Z=u&&n.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:n.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[46]=u,e[47]=Z):Z=e[47];let J;e[48]!==D||e[49]!==R||e[50]!==$||e[51]!==W||e[52]!==H||e[53]!==Z?(J=n.jsxs("div",{onDragOver:R,onDragLeave:D,onDrop:$,className:W,children:[H,Z]}),e[48]=D,e[49]=R,e[50]=$,e[51]=W,e[52]=H,e[53]=Z,e[54]=J):J=e[54];let B;e[55]!==T?(B=xe=>T(xe.target.value),e[55]=T,e[56]=B):B=e[56];let X;e[57]!==o||e[58]!==d||e[59]!==B?(X=n.jsx(ze,{id:o,type:"url",value:d,onChange:B,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[57]=o,e[58]=d,e[59]=B,e[60]=X):X=e[60];let V;e[61]!==h?(V=()=>h(!0),e[61]=h,e[62]=V):V=e[62];let ee;e[63]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(Yn,{size:14}),e[63]=ee):ee=e[63];const te=d?"Replace":"Browse";let ae;e[64]!==V||e[65]!==te?(ae=n.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:V,className:"h-9 shrink-0",children:[ee,te]}),e[64]=V,e[65]=te,e[66]=ae):ae=e[66];let de;e[67]!==T||e[68]!==d?(de=d&&n.jsx(ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(""),className:"h-9 shrink-0","aria-label":"Remove image",children:n.jsx(ss,{size:14})}),e[67]=T,e[68]=d,e[69]=de):de=e[69];let fe;e[70]!==X||e[71]!==ae||e[72]!==de?(fe=n.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[X,ae,de]}),e[70]=X,e[71]=ae,e[72]=de,e[73]=fe):fe=e[73];let Q;e[74]!==T?(Q=xe=>T(xe),e[74]=T,e[75]=Q):Q=e[75];const se=C?.id??null;let oe;e[76]!==c||e[77]!==h||e[78]!==Q||e[79]!==se?(oe=n.jsx(ju,{open:c,onOpenChange:h,mode:"image",onSelect:Q,lockedConfigId:se}),e[76]=c,e[77]=h,e[78]=Q,e[79]=se,e[80]=oe):oe=e[80];let he;return e[81]!==U||e[82]!==J||e[83]!==fe||e[84]!==oe?(he=n.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[U,J,fe,oe]}),e[81]=U,e[82]=J,e[83]=fe,e[84]=oe,e[85]=he):he=e[85],he}function pL(t){return fL.has(t.type||"")}function Au(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function gL(t,e){if(e.length===0)return 0;const s=Au(t);for(let o=0;o<e.length;o++){const a=e[o].discriminators;if(a&&Object.keys(a).length>0&&Object.entries(a).every(([d,c])=>s[d]===c))return o}let i=0,r=-1;for(let o=0;o<e.length;o++){const a=e[o],l=new Set(Object.keys(a.discriminators??{})),c=a.propertyKeys.filter(h=>!l.has(h)).filter(h=>s[h]!==void 0&&s[h]!==null&&s[h]!=="").length;c>r&&(r=c,i=o)}return i}function _L(t,e){const s=Au(t),i=new Set(e);return Object.fromEntries(Object.entries(s).filter(([r])=>!i.has(r)))}const LL="0 0 1080 1080",vL="matrix(1 0 0 1 540 540)",p9=[{code:"AC",name:"Acre",gTransform:"matrix(1 0 0 1 -248.53 -95.16)",pathTransform:"translate(-57.47, -224.1)",d:"M 30.47 237.77 L 28.39 237.73 L 28.93 235.92 L 28.72 235.09 L 28.47 234.6 L 27.22 233.9 L 27.08 233.45 L 27.35 232.3 L 26.58 230.35 L 25.49 229.71 L 19.89 228.46 L 12.55 228.27 L 12.82 227.71 L 15.31 225.45 L 16.2 224.22 L 16.49 223.02 L 16.27 221.79 L 15.59 220.88 L 14.76 220.44 L 13.08 217.49 L 12.31 217.05 L 11.41 216.86 L 10.28 215.73 L 9.36 213.35 L 7.36 211.82 L 6.38 208.2 L 5.51 206.56 L 3.63 205.48 L 3.55 204.31 L 4.36 204.41 L 4.78 203.89 L 4.85 203.22 L 4.65 202.8 L 2.53 201.87 L 2.17 201.21 L 0 199.32 L 0.04 198.95 L 0.66 198.9 L 1.16 197.58 L 1.15 196.27 L 4.16 195.88 L 4.66 195.49 L 4.44 194.14 L 3.27 192.57 L 3.27 192.57 L 21.22 200.05 L 44.88 205.71 L 57.02 208.85 L 83.46 223.02 L 111.97 235.15 L 111.97 235.15 L 114.94 236.41 L 114.94 236.41 L 114.64 236.89 L 113.07 237.55 L 110.98 239.14 L 108.12 241.93 L 106.47 242.79 L 105.81 242.61 L 104.28 242.79 L 104.23 243.35 L 102.31 244.65 L 100.23 245.64 L 98.79 247.47 L 98.35 248.65 L 97.74 248.93 L 96.57 248.18 L 95.81 248.05 L 93.44 248.1 L 92.76 248.36 L 92.13 248.81 L 91.77 249.67 L 89.33 253.15 L 85.56 254.4 L 84.72 255.09 L 82.78 255.6 L 81.75 255.63 L 81.83 253.52 L 80.47 253.72 L 76.92 252.95 L 71.68 252.48 L 66.59 252.86 L 65.93 252.28 L 63.66 252.11 L 60.1 253.94 L 57.37 254.56 L 55.69 253.89 L 54.29 252.45 L 52.65 253.61 L 52.69 236.06 L 52.74 234.96 L 53.21 234.25 L 53.28 231.9 L 53.02 231.02 L 53.99 229.84 L 54.47 228.7 L 53.31 228.9 L 50.34 231.49 L 48.74 232.5 L 46.68 234.88 L 44.73 235.55 L 44.08 236.63 L 42.27 237.62 z"},{code:"AL",name:"Alagoas",gTransform:"matrix(1 0 0 1 276.36 -86.82)",pathTransform:"translate(-582.36, -232.44)",d:"M 561.91 230.3 L 561.71 229.57 L 560.29 228.79 L 559.84 228.88 L 558.82 228.59 L 558.28 227.19 L 558.28 227.19 L 559.6 226.12 L 560.24 225.03 L 562.41 224.27 L 564.79 220.98 L 564.88 220.29 L 565.7 219.69 L 566.7 220.91 L 568.37 221.21 L 569.45 221.09 L 572 223.11 L 573.9 225.23 L 575.68 226.28 L 577.59 226.76 L 580.09 226.11 L 583.23 226.4 L 584.4 226.29 L 586.26 225.23 L 587.42 225.28 L 589.23 224.17 L 591.41 221.88 L 591.53 221.43 L 593.08 220.19 L 595.08 219.95 L 597.32 220.8 L 599.88 219.51 L 601.35 219.32 L 603.27 220.13 L 606.17 220.4 L 606.44 220.61 L 606.44 220.61 L 603.66 225.57 L 599.11 230.7 L 595.53 234.28 L 592.49 238.86 L 589.16 241.74 L 588.16 243.77 L 586.84 245.56 L 586.84 245.56 L 586.24 244.25 L 582.65 242.02 L 582.19 241.99 L 580.53 241.2 L 578.77 239.75 L 577.47 237.3 L 572.05 234.23 L 568.37 233.28 z"},{code:"AM",name:"Amazonas",gTransform:"matrix(1 0 0 1 -166.8 -178.05)",pathTransform:"translate(-139.2, -141.22)",d:"M 165.82 47.29 L 166.54 48.07 L 167.29 48.41 L 167.9 48.42 L 169.03 48 L 169.66 48.11 L 169.72 49.07 L 170.93 50.24 L 171.9 50.61 L 172.78 50.4 L 174.14 50.51 L 176.09 51.46 L 176.58 52.12 L 175.67 55.44 L 174.96 56.94 L 177.69 60.68 L 179.35 65.44 L 179.54 67.7 L 180.41 68.82 L 180.46 69.27 L 178.84 70.73 L 179.2 72.32 L 179.86 73.9 L 179.09 76.94 L 178.52 77.9 L 178.81 82.88 L 179.69 85.05 L 180.91 85.89 L 181.49 86.79 L 182.62 91.12 L 182.56 91.7 L 181.42 93.02 L 179.58 92.69 L 179.44 93.83 L 184.45 98.25 L 184.97 98.29 L 186.93 99.6 L 188.41 101.25 L 189.45 103.29 L 189.98 103.36 L 191.32 102.94 L 193.68 103.98 L 193.24 101.87 L 193.99 99.58 L 194.24 97.85 L 193.87 96.05 L 194.69 93.08 L 195.71 91.82 L 196.99 91.13 L 199.08 90.42 L 199.63 89.53 L 201.23 89.47 L 204.06 90.4 L 205.93 92.44 L 206.85 94.95 L 208.67 95.18 L 209.92 94.72 L 211.33 93.31 L 213.36 92.76 L 213.78 92.37 L 213.8 91.84 L 212.66 90.43 L 212.43 89.7 L 212.54 89.04 L 213.69 86.4 L 213.76 85.27 L 215.42 82.24 L 217.75 78.98 L 217.72 78.3 L 236.21 78.37 L 236.21 78.37 L 236.61 83.23 L 236.18 84.68 L 236.36 86.95 L 236.6 87.63 L 238.3 88.48 L 238.48 88.89 L 238.13 89.58 L 238.08 91.69 L 239.91 93.68 L 240.27 93.87 L 240.97 93.69 L 242.81 94.92 L 243.36 96.75 L 243.4 97.68 L 243.7 98.13 L 248.34 101.9 L 252.92 104.44 L 253.55 105.34 L 254.9 106.43 L 256.78 107.1 L 259.15 108.41 L 261.41 109.06 L 262.77 109.21 L 264.09 110.03 L 264.17 110.64 L 265.44 111.98 L 268.14 113.42 L 269.24 115.59 L 271.11 116.38 L 271.96 115.77 L 273.34 115.42 L 273.53 115.9 L 273.4 116.68 L 275.21 118.35 L 245.31 182.59 L 244.53 183.9 L 243.08 185.03 L 242.5 186 L 242.47 187.13 L 243.29 189.46 L 243.67 190.03 L 244.74 190.61 L 246.32 192.17 L 246.96 193.43 L 247.11 195.39 L 247.68 195.96 L 247.68 195.96 L 246.5 197.16 L 246.3 197.77 L 246.24 198.53 L 246.58 199.37 L 246.31 200.38 L 245.11 202.2 L 244.25 202.84 L 243.83 203.69 L 243.93 204.54 L 244.59 205.91 L 245.05 207.85 L 243.67 212.07 L 242.49 217.29 L 241.28 218.02 L 193.43 218.34 L 193.43 218.34 L 193.47 217.64 L 193.11 217.26 L 191.72 216.98 L 189.8 218.06 L 189.26 219.8 L 188.58 219.99 L 185.34 218.51 L 184.66 215.63 L 184.04 215.43 L 183.06 215.56 L 182.6 215.35 L 181.35 212.08 L 178.81 211.1 L 177.48 209.83 L 176.68 207.92 L 176.23 207.43 L 174.08 206.3 L 163.29 206.36 L 161.91 208.92 L 160.19 209.42 L 160.28 210.59 L 160.02 210.81 L 157.54 211.34 L 156.35 212.93 L 156.3 213.6 L 157.2 214.3 L 157.37 214.75 L 157.01 215.77 L 156.2 216.92 L 154.14 218.13 L 154.03 219.94 L 154.27 221.4 L 150.4 220.94 L 148.27 221.32 L 147.07 222.39 L 145.28 222.29 L 144.44 221.74 L 143.98 221.72 L 142.23 222.98 L 141.7 223.82 L 141.96 225.57 L 139.42 228.73 L 138.74 228.81 L 138.06 228.28 L 137.42 226.02 L 137.04 225.93 L 135.2 226.95 L 133.9 228.16 L 132.53 228.55 L 131.76 228.42 L 130.68 228.92 L 130.27 229.45 L 130.14 230.17 L 128.92 230.96 L 128.55 230.98 L 126.24 228.65 L 125.52 228.28 L 122.65 228.61 L 118.69 228.35 L 118.85 229.64 L 118.7 230.2 L 117.15 232.01 L 115.23 232.59 L 111.97 235.15 L 111.97 235.15 L 83.46 223.02 L 57.02 208.85 L 44.88 205.71 L 21.22 200.05 L 3.27 192.57 L 3.27 192.57 L 3.2 191.92 L 3.9 189 L 5.12 187.6 L 10.04 184.13 L 12.3 183.89 L 12.77 183.59 L 13.75 182.03 L 13.83 181 L 12.09 176.51 L 12.47 175.32 L 13.65 173.13 L 14.93 171.81 L 15.85 170.56 L 16.27 169.58 L 16.57 167.84 L 16.28 166.52 L 16.95 164.48 L 17.26 162.17 L 17.99 161.42 L 21.65 159.79 L 23.84 158.56 L 24.99 157.52 L 25.43 156.12 L 26.21 155.75 L 27.62 155.64 L 29.27 154.71 L 32.81 151.98 L 35.23 151.55 L 36.74 151.84 L 40.93 150.62 L 42.43 149.85 L 44.25 149.49 L 47.58 149.87 L 48.88 148.28 L 49.51 146.83 L 50.6 146.22 L 52.74 146.42 L 53.38 146.96 L 54.7 146.72 L 55.8 145.98 L 57.51 146.1 L 57.82 146.63 L 57.8 147.81 L 59.41 149.1 L 62.24 149.18 L 62.82 148.78 L 63.28 148 L 63.17 147.61 L 64.34 142.69 L 71.04 105.52 L 72.2 102.6 L 71.21 97.64 L 71.33 97.38 L 70.03 96.33 L 68.55 93.58 L 68.51 93.09 L 69.16 91.7 L 68.64 89.92 L 68.27 89.52 L 66.57 88.93 L 63.54 86.58 L 61.6 84.3 L 61.8 72.79 L 65.69 72.53 L 67.44 71.36 L 70.94 70.44 L 73.62 72.2 L 74.84 72.31 L 76.11 71.88 L 75.62 70.19 L 75.92 68.47 L 74.55 66.37 L 73.98 65.83 L 72.83 65.23 L 71.32 65.76 L 68.53 65.15 L 64.96 65.24 L 64.9 55.34 L 65.86 55.38 L 67.18 54.8 L 69.46 54.2 L 72.3 55.07 L 91.33 55.13 L 90.87 54.47 L 90.08 54.33 L 89.7 53.13 L 90.65 51.2 L 92.08 51.6 L 92.69 53.12 L 93.56 54.44 L 94.22 54.79 L 95.05 54.8 L 96.66 54.19 L 98.6 52.1 L 98.92 51.26 L 100.18 50.02 L 102.73 48.63 L 104.02 49.09 L 105.19 51.67 L 106.81 53.66 L 107.55 54.96 L 108.21 56.74 L 108.44 58.29 L 107.95 61.92 L 108.15 63.68 L 111.35 62.93 L 119.66 69.99 L 120.45 70.27 L 122.95 70.48 L 125.25 69.48 L 126.95 67.78 L 129.06 66.62 L 131.25 66.51 L 131.81 66.8 L 132.58 67.88 L 132.56 68.85 L 131.45 70.55 L 131.82 71.53 L 132.4 71.8 L 133.73 71.08 L 134.29 70.17 L 134.52 68.88 L 135.52 67.72 L 135.99 67.49 L 136.99 67.67 L 137.54 67.49 L 137.95 66.83 L 138.41 64.52 L 138.92 64.15 L 140.43 63.79 L 143.36 62.02 L 144.33 62.57 L 145.26 62.28 L 146.86 61.24 L 147.88 59.63 L 149.99 58.42 L 152.02 58.97 L 154.38 57.32 L 154.93 56.5 L 155.37 53.84 L 155.34 52.55 L 156.11 51.63 L 157.14 51.21 L 158.88 51.19 L 160.22 50.8 L 162.28 49.2 L 163.24 48.83 L 165.52 48.53 z"},{code:"AP",name:"Amapá",gTransform:"matrix(1 0 0 1 32.29 -262.31)",pathTransform:"translate(-338.29, -56.97)",d:"M 344.98 99.7 L 344.04 99.64 L 343.27000000000004 99.98 L 341.97 100.10000000000001 L 339.18 99.42 L 337.73 98.39 L 337.3 96.89 L 335.43 95.5 L 335.32 94.2 L 335.53 93.51 L 335.21999999999997 91.93 L 334.89 91.46000000000001 L 333.94 91.27000000000001 L 333.53 90.33000000000001 L 333.60999999999996 87.9 L 330.67999999999995 84.62 L 329.9 84.98 L 329.08 84.79 L 327.58 81.31 L 327.71 79.73 L 327.12 77.92 L 326.5 77.36 L 325.83 75.85 L 325.64 73.74 L 326.07 70.6 L 325.9 70.27 L 323.33 69.53999999999999 L 321.31 67.27999999999999 L 320.55 64.44999999999999 L 320.74 63.72999999999999 L 321.42 63.49999999999999 L 320.93 62.31999999999999 L 320.25 62.349999999999994 L 317.41 59.69 L 316.47 59.83 L 316.09000000000003 60.25 L 314.76000000000005 60.39 L 313.9200000000001 60.12 L 313.12000000000006 59.14 L 311.9800000000001 58.3 L 310.7900000000001 58.18 L 310.30000000000007 56.9 L 309.63000000000005 56.1 L 307.70000000000005 55.050000000000004 L 306.41 54.56 L 303.02000000000004 54.190000000000005 L 301.94000000000005 54.480000000000004 L 300.77000000000004 54.46 L 300.46000000000004 53.92 L 300.22 52.480000000000004 L 300.47 47.940000000000005 L 301.09000000000003 46.64000000000001 L 300.72 44.34000000000001 L 300.1 43.77000000000001 L 300.1 43.77000000000001 L 300.45000000000005 43.56000000000001 L 301.44000000000005 43.86000000000001 L 301.43000000000006 44.67000000000001 L 301.14000000000004 44.85000000000001 L 301.48 45.82000000000001 L 302.95000000000005 45.760000000000005 L 303.77000000000004 45.99 L 304.12000000000006 46.89 L 304.96000000000004 47.6 L 307.21000000000004 48.38 L 310.50000000000006 49.13 L 313.26000000000005 47.35 L 313.61000000000007 46.59 L 315.3400000000001 45.42 L 316.1700000000001 45.13 L 316.86000000000007 46.07 L 319.57000000000005 47.01 L 320.65000000000003 46.89 L 322.37000000000006 45.88 L 322.49000000000007 45.46 L 322.81000000000006 45.49 L 324.27000000000004 46.79 L 324.07000000000005 47.66 L 326.44000000000005 47.489999999999995 L 326.95000000000005 47.989999999999995 L 327.90000000000003 48.16 L 328.52000000000004 48.15 L 329.43000000000006 47.67 L 331.1000000000001 46.17 L 332.88000000000005 45.07 L 334.63000000000005 42.77 L 335.00000000000006 41.77 L 334.80000000000007 41.230000000000004 L 337.93000000000006 34.730000000000004 L 338.0400000000001 32.910000000000004 L 339.1500000000001 31.610000000000003 L 339.8800000000001 31.42 L 343.48000000000013 25.630000000000003 L 343.71000000000015 24.480000000000004 L 344.5500000000001 23.280000000000005 L 346.34000000000015 21.730000000000004 L 346.97000000000014 20.070000000000004 L 349.08000000000015 18.930000000000003 L 349.5500000000002 18.01 L 350.5900000000002 17.430000000000003 L 351.1500000000002 18.890000000000004 L 352.0300000000002 20.250000000000004 L 350.3600000000002 15.450000000000003 L 350.2900000000002 14.160000000000004 L 350.4700000000002 13.830000000000004 L 353.8400000000002 16.250000000000004 L 354.9800000000002 17.460000000000004 L 355.8900000000002 18.680000000000003 L 356.4100000000002 19.870000000000005 L 356.44000000000017 21.450000000000003 L 356.88000000000017 21.76 L 357.20000000000016 21.28 L 357.58000000000015 21.18 L 357.79000000000013 21.58 L 358.0000000000001 29.47 L 358.66000000000014 33.339999999999996 L 361.3700000000001 39.38999999999999 L 364.03000000000014 48.32999999999999 L 367.35000000000014 53.32999999999999 L 368.3600000000001 53.67999999999999 L 371.6300000000001 53.599999999999994 L 374.4100000000001 54.53999999999999 L 375.7000000000001 55.38999999999999 L 376.4700000000001 58.03999999999999 L 376.31000000000006 61.36999999999999 L 375.02000000000004 62.32999999999999 L 373.29 62.75999999999999 L 372.91 63.08999999999999 L 374.70000000000005 62.93999999999999 L 375.74000000000007 62.51999999999999 L 376.02000000000004 62.749999999999986 L 376.14000000000004 63.33999999999999 L 375.97 64.07 L 370.94000000000005 68.13 L 369.77000000000004 70.22999999999999 L 367.62000000000006 71.63999999999999 L 365.68000000000006 75.35999999999999 L 362.77000000000004 78.85999999999999 L 362.07000000000005 79.31999999999998 L 361.13000000000005 79.22999999999998 L 359.68000000000006 79.74999999999997 L 357.6000000000001 82.72999999999998 L 357.6000000000001 82.72999999999998 L 356.2600000000001 82.79999999999997 L 355.5100000000001 83.69999999999997 L 355.5100000000001 83.69999999999997 L 354.0400000000001 85.37999999999998 L 353.07000000000005 87.59999999999998 L 351.95000000000005 89.46999999999998 L 351.11000000000007 90.11999999999999 L 348.1000000000001 93.57 L 347.74000000000007 95.97 L 347.9100000000001 97.77 L 345.9600000000001 99.58 L 344.98 99.7 z M 368.34 52.71 L 367.89 52.38 L 366.78999999999996 50.52 L 366.85999999999996 49.64 L 367.09 49.230000000000004 L 368.75 48.78 L 369.18 49.17 L 370.01 51.440000000000005 L 369.02 52.540000000000006 L 368.34 52.71 z M 370.83 70.32 L 370.43 70.07 L 370.35 69.36 L 371.46000000000004 68.26 L 372.34000000000003 68.11 L 373.59000000000003 68.35 L 374.05 68.24 L 374.49 67.6 L 374.54 68.19 L 373.57 69.63 L 372.58 70.13 L 370.83 70.32 z M 374.27 67.45 L 373.49 67.22 L 373.49 66.66 L 374.21000000000004 65.61999999999999 L 375.46000000000004 65.52 L 375.64000000000004 65.86999999999999 L 375.54 66.38 L 374.27 67.45 z M 367.08 49.03 L 366.32 48.53 L 366.58 47.7 L 367.46 47.53 L 368.32 47.85 L 368.33 48.58 L 367.08 49.03 z"},{code:"BA",name:"Bahia",gTransform:"matrix(1 0 0 1 193.52 -26.39)",pathTransform:"translate(-499.52, -292.87)",d:"M 527.5 365.33 L 527.14 364.5 L 527.8199999999999 363.15 L 527.81 362.62 L 527.28 361.58 L 523.15 358.53 L 523 358.02 L 523.22 356.51 L 522.65 355.28 L 522 355.52 L 521.8 355.96999999999997 L 521.4599999999999 356.15 L 521.2399999999999 355.9 L 521.7699999999999 351.5 L 522.5899999999999 348.2 L 523.41 347.32 L 525.88 347.56 L 526.9 346.85 L 526.9 346.43 L 526.34 345.41 L 526.5 342.76000000000005 L 531.46 338.54 L 532.9300000000001 335.46000000000004 L 532.5100000000001 334.29 L 531.7300000000001 333.27000000000004 L 530.8400000000001 333.21000000000004 L 530.1100000000001 332.83000000000004 L 527.2800000000001 330.36 L 525.1600000000001 330.38 L 522.97 329.78 L 520.7 328.7 L 517.97 328.14 L 515.99 328 L 514.67 328.99 L 513.1999999999999 329.49 L 510.5899999999999 329.04 L 510.0199999999999 329.25 L 509.5799999999999 325.29 L 503.05999999999995 319.09000000000003 L 502.67999999999995 318.91 L 498.28999999999996 320.14000000000004 L 496.76 318.90000000000003 L 496.25 319.11 L 495.32 318.89 L 492.78 317.66999999999996 L 490.60999999999996 316.04999999999995 L 489.62999999999994 316.22999999999996 L 485.2799999999999 312.59999999999997 L 484.1799999999999 312.05999999999995 L 481.4499999999999 311.30999999999995 L 479.6799999999999 311.55999999999995 L 477.7999999999999 312.4599999999999 L 476.9899999999999 313.5799999999999 L 476.3499999999999 313.75999999999993 L 471.0199999999999 312.2899999999999 L 470.4099999999999 311.7999999999999 L 470.1499999999999 310.2999999999999 L 470.2899999999999 309.4099999999999 L 471.5799999999999 306.6699999999999 L 470.7199999999999 306.2099999999999 L 468.43999999999994 305.68999999999994 L 466.25999999999993 305.6499999999999 L 465.05999999999995 305.1499999999999 L 463.2699999999999 305.06999999999994 L 459.43999999999994 306.6499999999999 L 455.17999999999995 309.6799999999999 L 454.53999999999996 310.7899999999999 L 451.16999999999996 312.6599999999999 L 449.15 313.0599999999999 L 448.2 314.2399999999999 L 446.39 315.7899999999999 L 444.96 316.3099999999999 L 443.96 316.1599999999999 L 442.10999999999996 318.7399999999999 L 441.06999999999994 319.5099999999999 L 438.93999999999994 319.1299999999999 L 438.2199999999999 319.2599999999999 L 437.5299999999999 320.2599999999999 L 436.18999999999994 321.1799999999999 L 435.78999999999996 320.9399999999999 L 437.21999999999997 317.5099999999999 L 436.71 315.09999999999985 L 436.71 315.09999999999985 L 438.19 313.1299999999998 L 438.44 312.35999999999984 L 438.21 311.08999999999986 L 437.53999999999996 309.36999999999983 L 437.64 308.6999999999998 L 438.34999999999997 307.2799999999998 L 438.29999999999995 306.8199999999998 L 435.09 304.1999999999998 L 433.4 300.73999999999984 L 432.78 297.21999999999986 L 432.83 295.66999999999985 L 434.03 291.83999999999986 L 435.61999999999995 290.8099999999999 L 435.84999999999997 290.4299999999999 L 435.90999999999997 289.4899999999999 L 434.28 288.6499999999999 L 434.16999999999996 288.31999999999994 L 434.65 285.79999999999995 L 436.08 284.73999999999995 L 436.06 284.36999999999995 L 433.34 281.90999999999997 L 433.34 281.90999999999997 L 433.29999999999995 280.97999999999996 L 434.65999999999997 278.59999999999997 L 434.61999999999995 277.53 L 434.44999999999993 277.10999999999996 L 432.98999999999995 276.61999999999995 L 432.04999999999995 275.96999999999997 L 431.69999999999993 274.71 L 431.75999999999993 271.78999999999996 L 431.94999999999993 270.93999999999994 L 433.8999999999999 269.2699999999999 L 435.0399999999999 268.8499999999999 L 435.9999999999999 268.1299999999999 L 435.70999999999987 267.4999999999999 L 435.1299999999999 266.9799999999999 L 434.20999999999987 266.6899999999999 L 433.1799999999999 266.8699999999999 L 432.82999999999987 266.5399999999999 L 432.7399999999999 266.0399999999999 L 433.1599999999999 265.0799999999999 L 435.19999999999993 264.25999999999993 L 435.75999999999993 263.80999999999995 L 435.7199999999999 263.04999999999995 L 433.8399999999999 262.06999999999994 L 430.25999999999993 261.3999999999999 L 428.3999999999999 259.43999999999994 L 428.1699999999999 258.5199999999999 L 428.6699999999999 257.3599999999999 L 429.6799999999999 256.6299999999999 L 431.1999999999999 253.1499999999999 L 432.09999999999985 252.53999999999988 L 433.10999999999984 252.26999999999987 L 433.45999999999987 251.88999999999987 L 432.16999999999985 250.08999999999986 L 432.35999999999984 249.71999999999986 L 435.5699999999998 247.09999999999985 L 439.3899999999998 245.07999999999984 L 439.9499999999998 244.60999999999984 L 440.16999999999985 243.62999999999985 L 440.85999999999984 242.97999999999985 L 440.85999999999984 242.97999999999985 L 443.1899999999998 242.95999999999984 L 444.6299999999998 244.29999999999984 L 445.28999999999985 245.33999999999983 L 445.8199999999998 247.54999999999984 L 447.5799999999998 250.03999999999985 L 451.7599999999998 251.89999999999986 L 453.55999999999983 251.37999999999985 L 455.66999999999985 251.55999999999986 L 455.99999999999983 251.34999999999985 L 456.74999999999983 249.89999999999986 L 457.8899999999998 249.52999999999986 L 458.55999999999983 248.65999999999985 L 459.72999999999985 247.76999999999987 L 461.9399999999998 247.01999999999987 L 463.2699999999998 247.18999999999986 L 464.74999999999983 247.71999999999986 L 466.09999999999985 247.29999999999987 L 469.0699999999999 244.87999999999988 L 472.01999999999987 239.82999999999987 L 472.7399999999999 238.96999999999986 L 472.9799999999999 238.04999999999987 L 473.2799999999999 235.48999999999987 L 473.1599999999999 234.32999999999987 L 470.9199999999999 229.89999999999986 L 470.9699999999999 228.96999999999986 L 474.2099999999999 227.31999999999985 L 476.1599999999999 227.29999999999984 L 477.6599999999999 227.75999999999985 L 478.06999999999994 228.68999999999986 L 478.38999999999993 228.86999999999986 L 480.50999999999993 228.43999999999986 L 481.8999999999999 227.89999999999986 L 483.2299999999999 228.27999999999986 L 484.9399999999999 229.26999999999987 L 484.8099999999999 229.91999999999987 L 484.9999999999999 230.20999999999987 L 485.8199999999999 230.48999999999987 L 488.8199999999999 230.37999999999985 L 490.2899999999999 229.73999999999987 L 491.9899999999999 229.63999999999987 L 492.8099999999999 228.41999999999987 L 494.3199999999999 227.07999999999987 L 497.0499999999999 226.73999999999987 L 497.8199999999999 226.37999999999985 L 498.6299999999999 225.39999999999986 L 500.7999999999999 225.40999999999985 L 501.4199999999999 226.03999999999985 L 501.7299999999999 226.08999999999986 L 503.5899999999999 224.27999999999986 L 503.4899999999999 221.87999999999985 L 505.4799999999999 221.49999999999986 L 506.2699999999999 221.67999999999986 L 507.31999999999994 221.01999999999987 L 508.81999999999994 218.70999999999987 L 509.2799999999999 217.55999999999986 L 509.2799999999999 217.55999999999986 L 510.1699999999999 217.95999999999987 L 511.3299999999999 217.68999999999986 L 513.53 217.97999999999985 L 516.35 219.36999999999983 L 516.7900000000001 219.87999999999982 L 516.7300000000001 222.60999999999981 L 517.4500000000002 224.5499999999998 L 519.6600000000002 225.4599999999998 L 519.9300000000002 227.4599999999998 L 519.0100000000002 229.13999999999982 L 520.8400000000003 229.75999999999982 L 521.8000000000003 229.53999999999982 L 522.6200000000003 228.61999999999983 L 525.4900000000004 227.73999999999984 L 526.2600000000003 224.15999999999983 L 526.7600000000003 223.28999999999982 L 527.5100000000003 223.12999999999982 L 528.2900000000003 223.65999999999983 L 528.9200000000003 223.70999999999984 L 531.3100000000003 222.68999999999983 L 532.4100000000003 221.44999999999982 L 532.5800000000003 220.85999999999981 L 532.3300000000003 219.4999999999998 L 532.6200000000002 219.2499999999998 L 534.8600000000002 218.7999999999998 L 535.6300000000002 216.7499999999998 L 537.2800000000002 216.3099999999998 L 539.8100000000002 214.8499999999998 L 540.4000000000002 214.7499999999998 L 541.8900000000002 215.3099999999998 L 542.7200000000003 216.7499999999998 L 544.0800000000003 217.5599999999998 L 546.4400000000003 218.3399999999998 L 549.4300000000003 218.7399999999998 L 551.0100000000003 219.88999999999982 L 551.5500000000003 221.53999999999982 L 551.9400000000003 221.80999999999983 L 552.3700000000002 221.65999999999983 L 552.6600000000002 219.90999999999983 L 553.0900000000001 219.46999999999983 L 554.0900000000001 219.45999999999984 L 554.5400000000002 219.77999999999983 L 554.5600000000002 220.40999999999983 L 553.9400000000002 221.28999999999982 L 554.3900000000002 222.11999999999983 L 554.8900000000002 222.48999999999984 L 556.9900000000002 223.34999999999985 L 557.0100000000002 224.28999999999985 L 558.2300000000002 227.33999999999986 L 558.2300000000002 227.33999999999986 L 558.7700000000002 228.73999999999987 L 559.7900000000002 229.02999999999986 L 560.2400000000002 228.93999999999986 L 561.6700000000002 229.72999999999985 L 561.8700000000002 230.44999999999985 L 561.8700000000002 230.44999999999985 L 561.2000000000003 231.60999999999984 L 561.4100000000003 233.74999999999983 L 562.6900000000003 236.24999999999983 L 564.6800000000003 238.19999999999982 L 565.4300000000003 239.34999999999982 L 565.3500000000003 242.46999999999983 L 564.6900000000003 244.08999999999983 L 564.6000000000003 244.96999999999983 L 565.3600000000002 247.71999999999983 L 565.0600000000003 248.29999999999984 L 564.3700000000002 248.84999999999985 L 561.8200000000003 249.84999999999985 L 560.6900000000003 249.09999999999985 L 558.9800000000002 249.08999999999986 L 558.6600000000002 249.38999999999987 L 558.0700000000002 250.96999999999989 L 558.0900000000001 251.7399999999999 L 559.0400000000002 253.3399999999999 L 560.1400000000002 253.9999999999999 L 560.6600000000002 255.4899999999999 L 562.0900000000001 256.9999999999999 L 562.2400000000001 257.3899999999999 L 562.1100000000001 258.8099999999999 L 561.7700000000001 259.1999999999999 L 561.8900000000001 259.6199999999999 L 562.4800000000001 260.1399999999999 L 564.4100000000001 261.0599999999999 L 564.8900000000001 261.76999999999987 L 565.4300000000001 262.10999999999984 L 566.98 262.74999999999983 L 569.87 261.86999999999983 L 569.87 261.86999999999983 L 570.51 261.84999999999985 L 570.87 262.2599999999999 L 566.79 271.08999999999986 L 562.9599999999999 276.27999999999986 L 561.93 278.60999999999984 L 556.9 284.34999999999985 L 554.4499999999999 285.60999999999984 L 553.5799999999999 285.59999999999985 L 553.8799999999999 284.16999999999985 L 554.2499999999999 284.01999999999987 L 554.3899999999999 282.91999999999985 L 553.9399999999998 280.98999999999984 L 552.0699999999998 280.73999999999984 L 551.6399999999999 279.4399999999998 L 550.9599999999999 278.6899999999998 L 550.5899999999999 279.28999999999985 L 550.1299999999999 281.61999999999983 L 549.6299999999999 282.48999999999984 L 549.0799999999999 282.86999999999983 L 548.52 282.5799999999998 L 548.03 280.8399999999998 L 548.14 280.5199999999998 L 548.4499999999999 280.3899999999998 L 548.42 279.99999999999983 L 547.55 281.28999999999985 L 548.4799999999999 282.97999999999985 L 548.9399999999999 283.20999999999987 L 549.31 283.0599999999999 L 550.4599999999999 283.3199999999999 L 549.9999999999999 285.1299999999999 L 548.7899999999998 286.27999999999986 L 548.5399999999998 288.09999999999985 L 547.2899999999998 289.0699999999999 L 546.9399999999998 289.7399999999999 L 546.7399999999998 290.57999999999987 L 546.9199999999997 291.4299999999999 L 545.5699999999997 291.0399999999999 L 545.3599999999997 291.4299999999999 L 544.9999999999997 293.9499999999999 L 545.3599999999997 293.22999999999985 L 546.1099999999997 293.4399999999998 L 546.3499999999997 293.97999999999985 L 546.1199999999997 294.3899999999999 L 546.1799999999996 295.0099999999999 L 546.4799999999996 295.3099999999999 L 546.8099999999996 296.3099999999999 L 545.7699999999996 298.8199999999999 L 546.3399999999997 302.2599999999999 L 545.7899999999997 302.7499999999999 L 545.2199999999997 302.52999999999986 L 545.0799999999997 303.65999999999985 L 545.6699999999997 304.11999999999983 L 546.8799999999998 302.3999999999998 L 546.4099999999997 300.1899999999998 L 547.2299999999998 299.5799999999998 L 547.4799999999998 300.11999999999983 L 547.4199999999998 301.8799999999998 L 546.4599999999998 304.48999999999984 L 545.7199999999998 309.91999999999985 L 545.2099999999998 311.72999999999985 L 545.4099999999999 314.1999999999999 L 546.1899999999998 317.0499999999999 L 546.3799999999999 321.5899999999999 L 547.2499999999999 327.99999999999994 L 548.2399999999999 331.41999999999996 L 546.0299999999999 338.08 L 544.6799999999998 344.72999999999996 L 544.2099999999998 345.73999999999995 L 544.0499999999998 348.59999999999997 L 542.9899999999999 352.32 L 542.8999999999999 354.65 L 543.2899999999998 359.07 L 544.1799999999998 360.78 L 541.9399999999998 363.76 L 540.1299999999999 364.43 L 539.1899999999998 365.07 L 536.4699999999998 368.96 L 535.9 371 L 535.9 371 L 527.81 365.86 L 527.5 365.33 z M 549.78 287.33 L 549.55 286.13 L 550.29 285.71999999999997 L 551.3499999999999 284.67999999999995 L 551.5099999999999 284.03999999999996 L 551.1399999999999 283.30999999999995 L 551.8999999999999 283.44999999999993 L 552.7199999999999 284.49999999999994 L 552.67 285.0299999999999 L 549.78 287.33 z M 547.25 294.18 L 546.62 294.15000000000003 L 546.63 293.48 L 546.89 293.12 L 546.09 292.9 L 545.6700000000001 292.5 L 545.8000000000001 291.43 L 547.6700000000001 291.28000000000003 L 547.83 291.48 L 547.94 292.61 L 547.25 294.18 z"},{code:"CE",name:"Ceará",gTransform:"matrix(1 0 0 1 235.04 -154.64)",pathTransform:"translate(-541.04, -164.62)",d:"M 573.79 156.85 L 568.9 158.44 L 566.29 160.45 L 562.99 167.14 L 562.15 168.26 L 561.28 168.83 L 560.63 170.5 L 560.78 171.24 L 559.38 173.68 L 557.92 175.19 L 557.35 176.29 L 556.32 176.55 L 555.54 176.04 L 555.03 176.11 L 554.19 176.99 L 552.78 179.24 L 552.44 181.21 L 553.08 181.38 L 553.74 181 L 553.74 181 L 553.66 181.54 L 552.82 182.69 L 551.79 185.69 L 552.31 187 L 551.65 188.31 L 550.56 188.94 L 550.39 189.32 L 550.27 190.25 L 550.51 190.66 L 551.09 190.95 L 551.44 191.67 L 551.42 193.33 L 552.66 194.22 L 553.35 194.3 L 553.69 195.49 L 552.08 198.98 L 550.89 200.1 L 551.06 200.35 L 551.06 200.35 L 549.47 200.84 L 548.4 201.67 L 546.86 203.96 L 545.21 204.01 L 544.58 202.37 L 543.8 201.8 L 542.44 201.32 L 541.43 200.25 L 540.97 199.26 L 539.14 198.43 L 536.29 196.53 L 533.21 196.11 L 531.92 196.21 L 529.78 197.01 L 528.15 197.2 L 527.26 196.96 L 522.33 196.76 L 522.33 196.76 L 522.39 195.44 L 521.71 194.76 L 521.63 193.79 L 522.77 190.68 L 524.27 188.43 L 524.28 187.74 L 523.51 186.58 L 520.95 186.11 L 519.64 185.46 L 518.63 182.79 L 517.58 177.59 L 516.82 175.02 L 517.06 174.57 L 516.12 166.41 L 516.01 166.03 L 515.09 165.34 L 515.89 164.76 L 516.48 163.18 L 515.88 160.19 L 514.88 158.18 L 515.36 156.58 L 514.57 152.71 L 515.31 151.35 L 515.33 150.59 L 513.97 149 L 513.53 147.27 L 510.38 140.85 L 508.58 136.13 L 508.29 134.84 L 508.47 133.38 L 510.05 131.41 L 511.14 129.56 L 511.25 128.76 L 511.25 128.76 L 511.44 128.62 L 511.4 128 L 511 127.34 L 511.65 126.53 L 518.39 126.31 L 521.28 125.88 L 523.35 125.22 L 530.75 126.01 L 532.87 127.13 L 534.81 128.63 L 538.93 130.81 L 540.39 131.33 L 545.21 134.33 L 546.42 134.53 L 548.64 136.82 L 551.63 138.93 L 554.2 139.65 L 556.64 142.56 L 557.86 143.17 L 560.82 146.98 L 564.98 150.06 L 566.44 152.06 L 567.48 153.05 L 568.98 153.87 L 570.13 153.9 L 572.5 154.82 L 573.29 155.49 z"},{code:"DF",name:"Distrito Federal",gTransform:"matrix(1 0 0 1 103.1 10.18)",pathTransform:"translate(-409.11, -329.45)",d:"M 416.71 333.87 L 402.02 333.85 L 401.5 330.59 L 402.42 328.76 L 402.8 325.03 L 414.75 325.04 L 416.58 327.02 L 416.64 329.23 L 416.05 330.42 L 415.84 332.86 z"},{code:"ES",name:"Espírito Santo",gTransform:"matrix(1 0 0 1 212.62 72.56)",pathTransform:"translate(-518.62, -391.82)",d:"M 501.63 411.37 L 501.34 411.23 L 501.78 408.89 L 502.35 407.59 L 501.76 404.47 L 501.92 404.05 L 503.64 401.99 L 508.79 402.02 L 509.34 401.7 L 510.31 398.46 L 511.42 397.19 L 512.3 394.9 L 512.54 393.18 L 512.8 392.74 L 514.04 391.88 L 515.75 389.79 L 516.29 386.82 L 516 384.39 L 514.73 381.58 L 513.63 380.31 L 513.11 380.22 L 512.66 380.51 L 511.9 380.23 L 511.41 379.52 L 511.84 378.97 L 513.32 378.88 L 514.12 379.23 L 515.09 379.26 L 516.04 379.02 L 516.36 378.6 L 516.19 376.88 L 514.88 376.53 L 514.67 376.12 L 514.97 374.58 L 515 372.66 L 514.48 372 L 513.15 371.33 L 512.85 370.63 L 514.02 368.7 L 516.19 367.39 L 516.5 367.37 L 517.55 368.11 L 518.68 368.22 L 518.7 367.41 L 517.03 365.14 L 518.37 365.27 L 520.55 364.98 L 521.39 364.37 L 522.47 364.05 L 524.05 363.97 L 526.59 364.78 L 527.5 365.33 L 527.5 365.33 L 527.5 365.33 L 527.5 365.33 L 527.8 365.86 L 535.9 371 L 535.9 371 L 534.97 374.35 L 534.66 377.21 L 534.78 380.8 L 535.5 386.95 L 535.19 389.42 L 533.7 392.6 L 530.95 393.99 L 530.4 394.59 L 528.73 397.92 L 527.75 401.72 L 526.98 403.19 L 526.15 402.51 L 525.27 402.38 L 524.98 403.66 L 526.33 404.18 L 524.39 408.42 L 520.94 412.26 L 520.7 411.99 L 518.84 412.65 L 518.04 413.88 L 517.98 415.27 L 517.56 416.52 L 515.97 418.54 L 515.68 419.67 L 515.68 419.67 L 514.06 418.61 L 511.07 418.98 L 506.73 417.97 L 504.23 416.84 L 503.56 412.13 z"},{code:"GO",name:"Goiás",gTransform:"matrix(1 0 0 1 75.37 14.13)",pathTransform:"translate(-381.37, -333.38)",d:"M 416.71 333.87 L 415.84 332.86 L 416.05 330.42 L 416.64 329.23 L 416.58 327.02 L 414.75 325.04 L 402.8 325.03 L 402.42 328.76 L 401.5 330.59 L 402.02 333.85 L 416.71 333.87 L 416.71 333.87 L 416.71 333.87 L 416.71 333.87 L 416.18 335.39 L 416.49 336.96 L 415.81 338.55 L 414.77 339.8 L 414.36 341.27 L 415.21 342.48 L 416.06 342.82 L 417.48 343.85 L 419.13 348.41 L 419.13 349.01 L 416.81 351.72 L 413.57 354.73 L 413.14 356.87 L 414.23 357.98 L 415.13 357.51 L 416.71 358.08 L 417.18 358.69 L 417.36 359.69 L 417.19 360.4 L 416.46 361.3 L 415.95 363.19 L 417.14 366.65 L 414.05 368.71 L 412.89 368.91 L 412.03 369.81 L 411.55 370.93 L 406.66 373.67 L 405.96 372.9 L 401.61 371.04 L 401.06 371.52 L 400.48 371.61 L 398.73 371.62 L 397.25 371.34 L 393.39 371.5 L 391.38 370.61 L 387.25 373.25 L 384.34 376.17 L 384.01 376.17 L 382.7 374.75 L 381.18 374.45 L 377.99 376.09 L 374.28 375.47 L 371.8 376.43 L 369.57 376.97 L 368.16 379.07 L 366.95 381.53 L 367.01 382.53 L 366.17 383.83 L 365.35 384.11 L 364.51 383.95 L 364.06 384.09 L 363.12 384.83 L 361.48 386.93 L 360.91 388.83 L 361.47 389.44 L 361.46 389.78 L 361.1 390.01 L 360.24 389.55 L 360.24 389.55 L 360 389.1 L 357.34 386.86 L 354.19 386.25 L 352.57 384.7 L 350.67 384.27 L 349.18 384.23 L 345.83 382.89 L 345.15 382.04 L 342.08 380.48 L 341.41 379.87 L 339.97 379.16 L 338.83 378.99 L 336.13 377.31 L 333.35 377.47 L 329.55 376.77 L 329.42 376.44 L 329.68 375.6 L 330.25 374.43 L 331.56 372.67 L 331.48 372.25 L 329.23 371.35 L 328.09 372.02 L 327.43 371.83 L 327.15 371.42 L 326.92 370.31 L 327.18 367.73 L 326.99 365.96 L 326.99 365.96 L 326.04 363.76 L 325.86 360.33 L 324.45 358.14 L 324.29 357.43 L 324.69 354.02 L 327.24 350.17 L 327.62 347.26 L 328.32 346.49 L 330.34 345.65 L 332.26 343.88 L 333.51 341.86 L 333.84 339.91 L 334.34 338.9 L 335.62 337.86 L 336.44 336.43 L 336.52 334.89 L 338.27 333.92 L 339.67 331.3 L 342.32 331.17 L 345.04 330.31 L 345.36 330.03 L 347.34 325.84 L 348.05 324.88 L 348.69 320.78 L 349.07 320.04 L 350.99 318.1 L 352.64 317.09 L 353.71 316.83 L 354.94 317.51 L 356.15 316.78 L 357.54 315.35 L 358.38 312.42 L 359.55 309.55 L 359.54 308.75 L 359.06 307.61 L 359.64 304.87 L 361.24 301.78 L 361.12 296.6 L 362.33 295.82 L 363.36 293.19 L 365.36 290.02 L 365.75 288.95 L 365.59 286.23 L 365.94 285.33 L 366.91 284.47 L 367.18 283.34 L 367.1 282.71 L 367.1 282.71 L 367.44 282.26 L 367.64 280.38 L 368.3 279.15 L 370.11 277.06 L 370.67 276.76 L 370.64 278.47 L 369.42 280.35 L 368.9 282.69 L 371.3 283.09 L 373.5 284.12 L 377.43 284.52 L 380.52 286.23 L 384.59 287.66 L 385.22 287.43 L 386.85 281.49 L 388.32 279.1 L 389.5 278.13 L 390.65 279.44 L 391.69 281.32 L 392.8 285.03 L 393.41 288.13 L 394.55 288.18 L 395.3 287.43 L 395.6 286.43 L 396.16 285.89 L 398.92 286.23 L 403.45 285.7 L 403.67 286.44 L 403.11 288 L 406.24 289.47 L 409.59 290.15 L 410.28 290.07 L 410.79 286.77 L 411.34 286.8 L 412.85 289.42 L 413.31 289.66 L 415.09 288.76 L 417.61 286.68 L 422.14 285.68 L 423.69 285.68 L 426.25 284.58 L 427.99 283.24 L 433.35 281.82 L 433.35 281.82 L 436.07 284.28 L 436.09 284.66 L 434.66 285.72 L 434.18 288.24 L 434.28 288.57 L 435.91 289.41 L 435.85 290.35 L 435.62 290.73 L 434.03 291.76 L 432.84 295.59 L 432.79 297.14 L 433.41 300.66 L 435.11 304.12 L 438.32 306.74 L 438.37 307.21 L 437.65 308.63 L 437.55 309.3 L 438.22 311.02 L 438.45 312.3 L 438.2 313.07 L 436.72 315.04 L 436.72 315.04 L 435.72 316.05 L 432.49 315.71 L 431.59 313.95 L 429.17 312.47 L 428 313.96 L 428.58 317.73 L 428.01 318.27 L 427.61 318.4 L 424.83 317.26 L 423.66 317.49 L 423.29 317.77 L 422.57 320.95 L 423.29 321.05 L 423.78 322.21 L 423.21 323.15 L 422.48 323.85 L 422.52 325.75 L 422.94 326.36 L 423.47 326.55 L 424.16 330.81 L 423.63 331.34 L 420.27 332.24 L 417.98 333.75 z"},{code:"MA",name:"Maranhão",gTransform:"matrix(1 0 0 1 142.22 -148.63)",pathTransform:"translate(-448.22, -170.64)",d:"M 458.57 128.92 L 458.53 129.25 L 456.48999999999995 131.4 L 456.05999999999995 131.57 L 456.0199999999999 133.01 L 457.98999999999995 131.31 L 458.66999999999996 130.1 L 460.78999999999996 128.51999999999998 L 461.67999999999995 127.37999999999998 L 462.7099999999999 121.04999999999998 L 463.8599999999999 120.34999999999998 L 464.9699999999999 120.22999999999998 L 466.63999999999993 119.30999999999997 L 467.2899999999999 119.17999999999998 L 467.7499999999999 119.29999999999998 L 467.82999999999987 120.92999999999998 L 467.6299999999999 121.37999999999998 L 466.20999999999987 123.24999999999999 L 462.9999999999999 124.99999999999999 L 462.9699999999999 125.71999999999998 L 463.69999999999993 125.83999999999999 L 464.1499999999999 125.02999999999999 L 465.2999999999999 124.71999999999998 L 465.5199999999999 125.54999999999998 L 464.92999999999995 126.05999999999999 L 465.17999999999995 126.35999999999999 L 469.38999999999993 121.38999999999999 L 470.24999999999994 121.71999999999998 L 472.8299999999999 120.78999999999998 L 476.86999999999995 121.21999999999998 L 476.40999999999997 118.80999999999999 L 477.02 118.57999999999998 L 479.44 118.65999999999998 L 481.21999999999997 119.03999999999998 L 483.84999999999997 120.08999999999997 L 484.89 120.19999999999997 L 487.03999999999996 121.57999999999997 L 488.43999999999994 121.60999999999997 L 489.69999999999993 122.90999999999997 L 491.5899999999999 124.22999999999996 L 494.0899999999999 124.80999999999996 L 495.24999999999994 124.61999999999996 L 495.80999999999995 125.37999999999997 L 496.1499999999999 125.42999999999996 L 497.7399999999999 125.33999999999996 L 500.1999999999999 125.99999999999996 L 500.45999999999987 125.09999999999995 L 499.78999999999985 124.62999999999995 L 501.45999999999987 124.24999999999996 L 502.02999999999986 124.35999999999996 L 501.9399999999999 124.77999999999996 L 501.9399999999999 124.77999999999996 L 501.4799999999999 126.20999999999997 L 501.7099999999999 126.92999999999996 L 502.3399999999999 127.46999999999997 L 501.9599999999999 128.99999999999997 L 500.1699999999999 131.26999999999998 L 496.0399999999999 135.23999999999998 L 492.7199999999999 135.7 L 491.9199999999999 135.54 L 488.9999999999999 138.94 L 489.0399999999999 140.74 L 488.1599999999999 142.57000000000002 L 486.2699999999999 144.42000000000002 L 485.44999999999993 146.4 L 484.80999999999995 146.57 L 484.03999999999996 147.62 L 484.4 149.54 L 485.63 150.37 L 486.01 151.65 L 485.73 153.11 L 484.59000000000003 155.98000000000002 L 486.17 158.79000000000002 L 486.72 161.77 L 486.61 164.20000000000002 L 486.40000000000003 164.75000000000003 L 482.3 169.17000000000002 L 482.13 171.65 L 482.25 173.76000000000002 L 482.76 176.06000000000003 L 484.53999999999996 178.10000000000002 L 486.15 179.01000000000002 L 486.32 179.51000000000002 L 486.45 180.35000000000002 L 486.06 182.55 L 485.77 182.99 L 485.65 184.20000000000002 L 485.15 185.66000000000003 L 483.94 186.97000000000003 L 481.65 187.26000000000002 L 481 186.98000000000002 L 480.17 187.02 L 477.74 187.88000000000002 L 476.22 187.99000000000004 L 473.72 186.17000000000004 L 472.71000000000004 185.96000000000004 L 471.25000000000006 186.15000000000003 L 470.24000000000007 186.75000000000003 L 469.12000000000006 187.01000000000002 L 468.89000000000004 186.71 L 468.05000000000007 186.95000000000002 L 467.55000000000007 187.17000000000002 L 465.6500000000001 189.08 L 465.6600000000001 189.54000000000002 L 465.0300000000001 190.41000000000003 L 463.0200000000001 192.41000000000003 L 460.6800000000001 193.32000000000002 L 457.8100000000001 195.88000000000002 L 456.48000000000013 196.41000000000003 L 455.4300000000001 196.45000000000002 L 453.73000000000013 197.98000000000002 L 452.65000000000015 198.34000000000003 L 450.04000000000013 198.66000000000003 L 447.3200000000001 199.42000000000002 L 445.1900000000001 201.37 L 444.2100000000001 204.34 L 443.8200000000001 207.31 L 443.1900000000001 209.63 L 441.7400000000001 212.37 L 441.4400000000001 212.59 L 441.10000000000014 213.41 L 440.97000000000014 214.93 L 439.77000000000015 217.41 L 438.07000000000016 218.81 L 437.34000000000015 220.81 L 438.0500000000001 222.75 L 438.52000000000015 225.93 L 440.25000000000017 228.99 L 440.21000000000015 229.51000000000002 L 439.45000000000016 230.91000000000003 L 439.32000000000016 237.27000000000004 L 438.1700000000002 239.72000000000003 L 437.9100000000002 240.78000000000003 L 437.8600000000002 242.70000000000002 L 437.8600000000002 242.70000000000002 L 436.5800000000002 242.04000000000002 L 435.9700000000002 241.22000000000003 L 435.1500000000002 240.77000000000004 L 434.1600000000002 240.48000000000005 L 432.3800000000002 240.68000000000004 L 431.67000000000024 240.50000000000003 L 430.3200000000002 238.50000000000003 L 429.3300000000002 235.64000000000001 L 427.2000000000002 234.02 L 427.06000000000023 232.37 L 428.7000000000002 230.56 L 428.62000000000023 230.03 L 424.74000000000024 228.08 L 424.12000000000023 227.03 L 424.06000000000023 225.37 L 423.31000000000023 223.78 L 422.37000000000023 223.09 L 420.29000000000025 222.81 L 420.09000000000026 222.39000000000001 L 420.35000000000025 221.68 L 422.98000000000025 219.14000000000001 L 422.61000000000024 217.83 L 423.34000000000026 215.15 L 424.03000000000026 213.72 L 424.60000000000025 213.17 L 425.9400000000002 212.63 L 429.3300000000002 212.28 L 428.9400000000002 210.93 L 429.5800000000002 207.68 L 429.5000000000002 205.92000000000002 L 427.7000000000002 204.71 L 423.43000000000023 205.65 L 421.28000000000026 206.99 L 419.0100000000003 203.97 L 418.10000000000025 203.12 L 415.10000000000025 198.97 L 414.22000000000025 199.04 L 413.3800000000003 197.6 L 413.9900000000003 196.41 L 413.8800000000003 195.53 L 413.6300000000003 195.19 L 412.2600000000003 194.95 L 411.84000000000026 195.22 L 409.91000000000025 193.89 L 410.09000000000026 193.17999999999998 L 411.85000000000025 192.51999999999998 L 413.60000000000025 190.48 L 413.85000000000025 188.89 L 413.5700000000003 187.89 L 413.8800000000003 185.52999999999997 L 415.65000000000026 179.36999999999998 L 415.66000000000025 178.93999999999997 L 414.98000000000025 177.79999999999998 L 414.7500000000002 176.71999999999997 L 414.9600000000002 172.99999999999997 L 414.3200000000002 171.49999999999997 L 413.8500000000002 168.00999999999996 L 413.0100000000002 166.97999999999996 L 409.61000000000024 165.53999999999996 L 408.3900000000002 165.51999999999995 L 408.11000000000024 165.19999999999996 L 408.03000000000026 164.16999999999996 L 407.4400000000003 163.47999999999996 L 405.7000000000003 163.18999999999997 L 404.7400000000003 163.70999999999998 L 403.3400000000003 163.61999999999998 L 400.56000000000034 162.10999999999999 L 399.70000000000033 162.04999999999998 L 397.74000000000035 162.57999999999998 L 395.12000000000035 164.42999999999998 L 394.5900000000004 165.06999999999996 L 394.5900000000004 165.06999999999996 L 394.10000000000036 164.98999999999995 L 408.81000000000034 153.15999999999994 L 411.16000000000037 153.38999999999993 L 412.3300000000004 152.46999999999994 L 413.8800000000004 150.29999999999995 L 414.3100000000004 149.14999999999995 L 415.8600000000004 147.97999999999996 L 416.4800000000004 145.09999999999997 L 417.6000000000004 144.63999999999996 L 420.0400000000004 142.31999999999996 L 420.51000000000045 141.10999999999996 L 420.80000000000047 139.20999999999995 L 422.4000000000005 134.51999999999995 L 424.36000000000047 132.97999999999996 L 425.8400000000005 131.21999999999997 L 426.67000000000047 129.76999999999998 L 427.13000000000045 128.48999999999998 L 426.95000000000044 126.66999999999999 L 427.74000000000046 125.85999999999999 L 426.70000000000044 124.27999999999999 L 430.38000000000045 121.18999999999998 L 430.25000000000045 119.54999999999998 L 430.75000000000045 117.16999999999999 L 432.49000000000046 115.6 L 432.8500000000005 114.89 L 433.75000000000045 111.87 L 433.83000000000044 110.26 L 433.40000000000043 109.73 L 432.4100000000004 109.89 L 432.14000000000044 109.4 L 432.19000000000045 108.78 L 433.33000000000044 108.63 L 433.90000000000043 107.89 L 434.6100000000004 103.5 L 434.4500000000004 102.12 L 434.9200000000004 101.09 L 435.6900000000004 100.64 L 435.6900000000004 100.64 L 436.3200000000004 100.64 L 436.5600000000004 100.4 L 436.5000000000004 99.86 L 436.8400000000004 99.11 L 437.42000000000036 98.58 L 438.76000000000033 99.56 L 439.2100000000003 101.4 L 440.4000000000003 101.52000000000001 L 441.1700000000003 100.16000000000001 L 441.7800000000003 103.09000000000002 L 442.7700000000003 103.13000000000002 L 443.06000000000034 102.64000000000003 L 443.13000000000034 101.70000000000003 L 443.98000000000036 101.66000000000003 L 445.67000000000036 102.19000000000003 L 446.17000000000036 102.88000000000002 L 444.74000000000035 104.58000000000003 L 445.41000000000037 105.28000000000003 L 445.43000000000035 105.83000000000003 L 446.6400000000003 103.79000000000002 L 447.13000000000034 102.25000000000001 L 447.5800000000003 102.25000000000001 L 447.9800000000003 103.27000000000001 L 447.9800000000003 103.85000000000001 L 447.1100000000003 104.77000000000001 L 446.8400000000003 105.76 L 446.9200000000003 108.47 L 447.1800000000003 108.8 L 447.6500000000003 108.92 L 448.2300000000003 108.78 L 449.1900000000003 107.85 L 448.72000000000025 106.85 L 448.86000000000024 106.25 L 450.18000000000023 104.82 L 451.23000000000025 104.57 L 453.36000000000024 105.16 L 454.86000000000024 104.05 L 454.91000000000025 104.97 L 454.55000000000024 105.17999999999999 L 453.42000000000024 106.71 L 454.0100000000002 107.28999999999999 L 454.11000000000024 106.91999999999999 L 455.36000000000024 106.32 L 455.9400000000002 107.11 L 455.80000000000024 108.32 L 457.43000000000023 110.07 L 458.29000000000025 109.63 L 459.87000000000023 110.3 L 460.6400000000002 112.7 L 460.5300000000002 113.65 L 458.3400000000002 116.38000000000001 L 457.9600000000002 117.27000000000001 L 458.06000000000023 117.93 L 458.66000000000025 116.9 L 460.41000000000025 115.22 L 461.24000000000024 115.19 L 462.11000000000024 116 L 462.6300000000002 117.89 L 462.36000000000024 119.12 L 461.3900000000002 119.31 L 460.36000000000024 120.22 L 459.2000000000002 121.71 L 459.2700000000002 122.47999999999999 L 458.1100000000002 124.82999999999998 L 457.4900000000002 128.35 L 457.70000000000016 128.69 L 458.57 128.92 z M 459.09 129.37 L 459.03 128.58 L 459.55999999999995 127.05000000000001 L 459.1499999999999 125.98000000000002 L 459.2799999999999 125.32000000000002 L 460.18999999999994 124.08000000000003 L 460.73999999999995 123.89000000000003 L 460.78999999999996 126.24000000000002 L 460.56999999999994 127.58000000000003 L 459.7699999999999 128.18000000000004 L 459.09 129.37 z M 452.79 103.61 L 452.35 103.15 L 452.27000000000004 102.55000000000001 L 453.07000000000005 101.43 L 453.91 101.4 L 454.59000000000003 101.82000000000001 L 454.69000000000005 102.16000000000001 L 454.50000000000006 102.52000000000001 L 452.79 103.61 z M 456.29 107.79 L 456 107.49000000000001 L 456.06 106.96000000000001 L 457.12 106.07000000000001 L 457.6 106.14 L 458.1 106.99 L 457.96000000000004 107.6 L 457.56000000000006 107.42999999999999 L 456.29 107.79 z M 442.13 102.98 L 441.92 102.93 L 442.87 99.35000000000001 L 443.17 99.44000000000001 L 443.2 99.67000000000002 L 442.78999999999996 102.73000000000002 L 442.13 102.98 z"},{code:"MG",name:"Minas Gerais",gTransform:"matrix(1 0 0 1 139.79 56.66)",pathTransform:"translate(-445.79, -375.93)",d:"M 527.5 365.33 L 526.59 364.78 L 524.05 363.97 L 522.47 364.05 L 521.39 364.37 L 520.55 364.98 L 518.37 365.27 L 517.03 365.14 L 518.7 367.41 L 518.68 368.22 L 517.55 368.11 L 516.5 367.37 L 516.19 367.39 L 514.02 368.7 L 512.85 370.63 L 513.15 371.33 L 514.48 372 L 515 372.66 L 514.97 374.58 L 514.67 376.12 L 514.88 376.53 L 516.19 376.88 L 516.36 378.6 L 516.04 379.02 L 515.09 379.26 L 514.12 379.23 L 513.32 378.88 L 511.84 378.97 L 511.41 379.52 L 511.9 380.23 L 512.66 380.51 L 513.11 380.22 L 513.63 380.31 L 514.73 381.58 L 516 384.39 L 516.29 386.82 L 515.75 389.79 L 514.04 391.88 L 512.8 392.74 L 512.54 393.18 L 512.3 394.9 L 511.42 397.19 L 510.31 398.46 L 509.34 401.7 L 508.79 402.02 L 503.64 401.99 L 501.92 404.05 L 501.76 404.47 L 502.35 407.59 L 501.78 408.89 L 501.34 411.23 L 501.63 411.37 L 501.63 411.37 L 499.1 413.72 L 497.86 413.99 L 497.3 414.49 L 498.04 415.19 L 495.68 421.24 L 493.78 424.95 L 493.69 425.7 L 495.13 425.83 L 495.42 426.44 L 495.21 426.96 L 492.68 427.94 L 483.17 432.47 L 481.8 432.67 L 481.82 432.21 L 481.33 432.04 L 478.8 431.77 L 478.23 431.83 L 476.61 432.77 L 475.36 432.93 L 472.16 433.01 L 471.8 432.69 L 471.29 432.77 L 467.19 434.55 L 466.14 435.32 L 464.43 436.09 L 463.93 435.81 L 461.34 435.98 L 458.43 437.32 L 456.01 438.06 L 455.33 438.55 L 455.33 438.55 L 454.08 439.28 L 451.88 439.5 L 449.95 440.52 L 448.72 441.76 L 446.93 442.43 L 444.55 442.68 L 442.21 442.6 L 442.2 442.11 L 442.55 441.62 L 442.46 441.27 L 441.27 441.6 L 441.09 443.9 L 441.33 444.13 L 441.28 444.97 L 440.53 445.95 L 439.23 446.27 L 438.66 445.84 L 435.05 446.84 L 434.86 446.31 L 432.85 446.55 L 431.73 446.3 L 429.7 442.99 L 430.92 442.28 L 430.4 440.57 L 428.6 439.74 L 426.81 438.51 L 426.1 436.9 L 426.63 435.34 L 426.82 431.89 L 426.56 428.95 L 428.42 426.23 L 429.12 424.05 L 429.17 422.78 L 428.94 422.41 L 425.24 421.09 L 424.24 421.14 L 423.96 421.5 L 423.18 421.81 L 421.57 421.86 L 421.6 421.01 L 420.77 419.02 L 419.47 417.23 L 419.1 415.02 L 418.79 414.4 L 418 413.66 L 418.19 411.72 L 419.71 409.69 L 419.77 409.13 L 419.37 407.58 L 417.49 406.37 L 416.91 405.76 L 417.2 403.39 L 417.77 402.38 L 417.57 401.34 L 414.3 397.99 L 413 398.28 L 412.15 398.92 L 410.5 398.14 L 408.12 398.25 L 407.81 398.86 L 408.01 399.32 L 407.57 400.31 L 404.79 400.99 L 403.68 400.56 L 402.17 399.11 L 401.16 400.36 L 392.98 401.04 L 392.52 401.52 L 392.04 402.71 L 392.31 405.25 L 391.9 405.69 L 390.71 405.17 L 390.7 402.39 L 390.45 401.43 L 390.09 401.04 L 389.53 400.99 L 389.27 401.18 L 388.86 402.31 L 388.19 403.25 L 387.65 403.57 L 387.03 403.55 L 385.82 401.45 L 385.49 400.03 L 385.63 399.12 L 383.95 398.33 L 381.77 396.91 L 379.78 397.5 L 378.16 397.28 L 376.49 397.63 L 372.2 396.67 L 369.65 396.59 L 367.92 395.04 L 367.17 394.9 L 365.67 395.51 L 364.24 397.2 L 362.32 397.57 L 360.17 398.68 L 358.95 399.81 L 358.95 399.81 L 359.26 397.19 L 358.67 393.98 L 359.66 389.8 L 360.24 389.55 L 360.24 389.55 L 361.1 390.01 L 361.46 389.78 L 361.47 389.44 L 360.91 388.83 L 361.48 386.93 L 363.12 384.83 L 364.06 384.09 L 364.51 383.95 L 365.35 384.11 L 366.17 383.83 L 367.01 382.53 L 366.95 381.53 L 368.16 379.07 L 369.57 376.97 L 371.8 376.43 L 374.28 375.47 L 377.99 376.09 L 381.18 374.45 L 382.7 374.75 L 384.01 376.17 L 384.34 376.17 L 387.25 373.25 L 391.38 370.61 L 393.39 371.5 L 397.25 371.34 L 398.73 371.62 L 400.48 371.61 L 401.06 371.52 L 401.61 371.04 L 405.96 372.9 L 406.66 373.67 L 411.55 370.93 L 412.03 369.81 L 412.89 368.91 L 414.05 368.71 L 417.14 366.65 L 415.95 363.19 L 416.46 361.3 L 417.19 360.4 L 417.36 359.69 L 417.18 358.69 L 416.71 358.08 L 415.13 357.51 L 414.23 357.98 L 413.14 356.87 L 413.57 354.73 L 416.81 351.72 L 419.13 349.01 L 419.13 348.41 L 417.48 343.85 L 416.06 342.82 L 415.21 342.48 L 414.36 341.27 L 414.77 339.8 L 415.81 338.55 L 416.49 336.96 L 416.18 335.39 L 416.71 333.87 L 417.98 333.75 L 420.27 332.24 L 423.63 331.34 L 424.16 330.81 L 423.47 326.55 L 422.94 326.36 L 422.52 325.75 L 422.48 323.85 L 423.21 323.15 L 423.78 322.21 L 423.29 321.05 L 422.57 320.95 L 423.29 317.77 L 423.66 317.49 L 424.83 317.26 L 427.61 318.4 L 428.01 318.27 L 428.58 317.73 L 428 313.96 L 429.17 312.47 L 431.59 313.95 L 432.49 315.71 L 435.72 316.05 L 436.72 315.04 L 436.72 315.04 L 437.23 317.45 L 435.8 320.89 L 436.2 321.12 L 437.54 320.21 L 438.24 319.21 L 438.96 319.08 L 441.09 319.46 L 442.13 318.69 L 443.98 316.12 L 444.97 316.27 L 446.4 315.74 L 448.21 314.19 L 449.16 313.02 L 451.18 312.61 L 454.55 310.75 L 455.19 309.64 L 459.46 306.61 L 463.28 305.03 L 465.08 305.12 L 466.28 305.62 L 468.46 305.65 L 470.74 306.18 L 471.59 306.64 L 470.3 309.38 L 470.15 310.27 L 470.41 311.76 L 471.02 312.26 L 476.35 313.72 L 476.99 313.55 L 477.8 312.43 L 479.68 311.54 L 481.45 311.28 L 484.18 312.03 L 485.28 312.57 L 489.63 316.21 L 490.61 316.03 L 492.78 317.65 L 495.31 318.87 L 496.24 319.09 L 496.75 318.88 L 498.28 320.12 L 502.67 318.89 L 503.05 319.07 L 509.57 325.27 L 510.01 329.23 L 510.58 329.02 L 513.19 329.47 L 514.66 328.97 L 515.98 327.98 L 517.97 328.13 L 520.7 328.69 L 522.96 329.77 L 525.15 330.38 L 527.27 330.35 L 530.1 332.82 L 530.83 333.2 L 531.72 333.27 L 532.5 334.29 L 532.92 335.46 L 531.45 338.54 L 526.49 342.76 L 526.34 345.41 L 526.9 346.43 L 526.9 346.85 L 525.88 347.56 L 523.4 347.32 L 522.58 348.2 L 521.76 351.5 L 521.23 355.9 L 521.45 356.15 L 521.8 355.96 L 522 355.51 L 522.64 355.27 L 523.22 356.5 L 523 358.01 L 523.15 358.52 L 527.29 361.58 L 527.82 362.62 L 527.83 363.15 L 527.15 364.5 z"},{code:"MS",name:"Mato Grosso do Sul",gTransform:"matrix(1 0 0 1 -2.22 90.13)",pathTransform:"translate(-303.77, -409.4)",d:"M 358.95 399.81 L 358.55 402.27 L 358.27 402.67 L 356.77 403.45 L 355.45 403.49 L 354.98 403.71 L 353.76 404.74 L 351.77 407.42 L 351.04 408.07 L 350.03 408.37 L 349.41 410.05 L 349.25 412.98 L 346.66 416.62 L 345.7 417.14 L 345.47 417.52 L 345.78 419.45 L 345.7 420.4 L 344.49 422.74 L 342.49 425 L 342.84 425.85 L 342.56 427.06 L 341.12 428.09 L 340.72 429.3 L 338.99 430.99 L 337.73 433.43 L 335.78 435.3 L 328.22 439.83 L 326.96 440.97 L 326.22 442.51 L 325.38 443.59 L 325.38 443.59 L 319.97 445.86 L 318.86 446.68 L 317.93 449.01 L 317.95 450.16 L 316.5 453.72 L 315.83 454.4 L 314.17 455.41 L 313.06 455.73 L 312.73 456.08 L 311.16 464 L 310.8 464.82 L 308.42 466.38 L 308.42 466.38 L 305.87 464.05 L 302.46 462.16 L 298.47 464.13 L 297.79 464.88 L 296.13 465.37 L 293.55 465.8 L 291.19 465.34 L 290.18 464.69 L 289.71 460.42 L 289.39 459.72 L 288.49 458.77 L 288.26 456.3 L 288.77 454.96 L 288.13 454.17 L 288.04 453.73 L 288.04 450.86 L 287.15 448.89 L 286.55 446.15 L 286.5 445.43 L 287.09 444.07 L 287.11 442.46 L 285.54 441.37 L 285.16 440.57 L 285 438.41 L 283.35 436.59 L 281.18 436.33 L 279.67 436.64 L 277.84 436.35 L 275.38 434.39 L 274.82 432.9 L 273.28 433.23 L 271.11 435.97 L 270.11 435.37 L 268.39 436.18 L 267.31 436.34 L 265.57 435.65 L 263.01 435.16 L 259.55 435.39 L 255.89 434.68 L 255.41 433.77 L 253.42 433.64 L 252.53 434.16 L 250.03 433.28 L 250.94 426.01 L 250.51 423.63 L 251.11 422.21 L 252.09 420.75 L 252.69 414.72 L 252.03 412.39 L 251.98 410.66 L 251.22 409.7 L 250.79 409.61 L 250.3 410.26 L 249.66 407 L 248.87 405.13 L 247.66 403.11 L 247.31 401.28 L 251.34 398.98 L 252.1 398.1 L 247.9 394.24 L 253.28 382.82 L 254.4 382.76 L 254.12 380.63 L 253.38 380.5 L 256.61 370.17 L 257.27 369.01 L 254.18 363.16 L 254.21 361.25 L 254.21 361.25 L 254.91 361.45 L 255.93 362.55 L 258.08 364.07 L 263.7 362.1 L 265.75 360.1 L 267.77 357.15 L 267.86 355.98 L 269.26 354.53 L 271.85 354.56 L 273.41 354.34 L 274.18 354.68 L 275.84 354.17 L 277.19 352.92 L 279.21 352.43 L 280.48 352.63 L 281.24 353.78 L 284.03 355.03 L 286.65 355.5 L 287.3 355.85 L 287.57 356.71 L 288.35 357.73 L 291.38 358.89 L 292.64 360 L 293.88 360.57 L 298.4 359.94 L 299.66 359.14 L 300.15 358.29 L 301.58 357.68 L 304.02 357.75 L 305.61 358.79 L 305.91 360.16 L 306.15 360.41 L 307.14 360.45 L 309.27 359.57 L 310.28 359.63 L 315.9 353.62 L 317.24 353.49 L 316.01 360.1 L 314.21 360.8 L 312.55 363.63 L 312.36 364.09 L 312.51 364.62 L 313.81 364.73 L 315.55 366 L 320.17 366.27 L 320.74 365.7 L 323.4 365.62 L 324.27 365.7 L 325.44 366.27 L 326.99 365.96 L 326.99 365.96 L 327.18 367.73 L 326.92 370.31 L 327.15 371.42 L 327.43 371.83 L 328.09 372.02 L 329.23 371.35 L 331.48 372.25 L 331.56 372.67 L 330.25 374.43 L 329.68 375.6 L 329.42 376.44 L 329.55 376.77 L 333.35 377.47 L 336.13 377.31 L 338.83 378.99 L 339.97 379.16 L 341.41 379.87 L 342.08 380.48 L 345.15 382.04 L 345.83 382.89 L 349.18 384.23 L 350.67 384.27 L 352.57 384.7 L 354.19 386.25 L 357.34 386.86 L 360 389.1 L 360.24 389.55 L 360.24 389.55 L 359.66 389.8 L 358.67 393.98 L 359.26 397.19 z"},{code:"MT",name:"Mato Grosso",gTransform:"matrix(1 0 0 1 -23.8 -38.15)",pathTransform:"translate(-282.2, -281.12)",d:"M 206.96 296.05 L 208.43 294.62 L 212.54 292.05 L 213.06 289.6 L 214.49 285.82 L 215.42 284.74 L 217.06 284.21 L 217.49 283.8 L 218.07 282.96 L 218.59 280.71 L 220.25 278.7 L 220.81 276.46 L 220.88 274.75 L 220.3 273.26 L 220.34 271.21 L 218.81 267.87 L 217.91 267.9 L 217.33 267.39 L 216.9 264.14 L 217.04 262.82 L 218.4 261.74 L 219.8 259.99 L 219.97 259.24 L 218.56 255.65 L 217.49 255.22 L 216.38 255.11 L 212.88 255.2 L 211.66 254.09 L 211.9 253.53 L 194.74 253.48 L 195.64 244.48 L 194.14 241.73 L 193.87 239.97 L 193.9 239.17 L 194.9 235.65 L 194.52 233.72 L 195.46 232.05 L 194.63 229.78 L 194.48 228.39 L 194.22 227.78 L 193.44 227.31 L 193.38 226.96 L 194.67 221.97 L 195.43 220.55 L 194.83 219.31 L 193.43 218.34 L 193.43 218.34 L 241.28 218.02 L 242.49 217.29 L 243.67 212.07 L 245.05 207.85 L 244.59 205.91 L 243.93 204.54 L 243.83 203.69 L 244.25 202.84 L 245.11 202.2 L 246.31 200.38 L 246.58 199.37 L 246.24 198.53 L 246.3 197.77 L 246.5 197.16 L 247.68 195.96 L 247.68 195.96 L 248.85 197.04 L 251.3 201.1 L 251.7 202.86 L 253.07 206.82 L 254.39 208.75 L 255.16 210.37 L 254.93 212.81 L 255.41 215.21 L 256.14 217.41 L 257.67 218.52 L 260.67 221.27 L 264.05 222.97 L 264.28 223.91 L 264.24 225.01 L 264.47 225.5 L 265.42 225.9 L 266.24 225.73 L 267.87 226.18 L 268.41 226.9 L 268.61 227.98 L 268.96 228.3 L 270.33 227.85 L 274.02 229.34 L 308.06 231.76 L 371.03 235.24 L 371.03 235.24 L 370.38 236.26 L 369.82 238.15 L 368.72 239.4 L 368.28 242.54 L 367.85 243.39 L 367.48 243.66 L 365.54 248.95 L 365 251.92 L 364.96 254.87 L 363.08 260.86 L 363.14 261.72 L 364.53 263.06 L 364.37 263.93 L 363.55 264.82 L 363.5 265.32 L 364.6 267.57 L 364.13 270.88 L 364.14 272.45 L 364.66 273.03 L 365.1 276.08 L 364.36 278.84 L 365.34 282.18 L 366.3 282.69 L 367.1 282.71 L 367.1 282.71 L 367.18 283.34 L 366.91 284.47 L 365.94 285.33 L 365.59 286.23 L 365.75 288.95 L 365.36 290.02 L 363.36 293.19 L 362.33 295.82 L 361.12 296.6 L 361.24 301.78 L 359.64 304.87 L 359.06 307.61 L 359.54 308.75 L 359.55 309.55 L 358.38 312.42 L 357.54 315.35 L 356.15 316.78 L 354.94 317.51 L 353.71 316.83 L 352.64 317.09 L 350.99 318.1 L 349.07 320.04 L 348.69 320.78 L 348.05 324.88 L 347.34 325.84 L 345.36 330.03 L 345.04 330.31 L 342.32 331.17 L 339.67 331.3 L 338.27 333.92 L 336.52 334.89 L 336.44 336.43 L 335.62 337.86 L 334.34 338.9 L 333.84 339.91 L 333.51 341.86 L 332.26 343.88 L 330.34 345.65 L 328.32 346.49 L 327.62 347.26 L 327.24 350.17 L 324.69 354.02 L 324.29 357.43 L 324.45 358.14 L 325.86 360.33 L 326.04 363.76 L 326.99 365.96 L 326.99 365.96 L 325.44 366.27 L 324.27 365.7 L 323.4 365.62 L 320.74 365.7 L 320.17 366.27 L 315.55 366 L 313.81 364.73 L 312.51 364.62 L 312.36 364.09 L 312.55 363.63 L 314.21 360.8 L 316.01 360.1 L 317.24 353.49 L 315.9 353.62 L 310.28 359.63 L 309.27 359.57 L 307.14 360.45 L 306.15 360.41 L 305.91 360.16 L 305.61 358.79 L 304.02 357.75 L 301.58 357.68 L 300.15 358.29 L 299.66 359.14 L 298.4 359.94 L 293.88 360.57 L 292.64 360 L 291.38 358.89 L 288.35 357.73 L 287.57 356.71 L 287.3 355.85 L 286.65 355.5 L 284.03 355.03 L 281.24 353.78 L 280.48 352.63 L 279.21 352.43 L 277.19 352.92 L 275.84 354.17 L 274.18 354.68 L 273.41 354.34 L 271.85 354.56 L 269.26 354.53 L 267.86 355.98 L 267.77 357.15 L 265.75 360.1 L 263.7 362.1 L 258.08 364.07 L 255.93 362.55 L 254.91 361.45 L 254.21 361.25 L 254.21 361.25 L 253.55 360.58 L 253.23 359.78 L 253.77 359.07 L 251.33 356.92 L 250.05 357.55 L 249.53 357.5 L 248.36 356.82 L 247.91 356.12 L 245.89 354.71 L 244 353.95 L 243.7 353.63 L 243.4 352.51 L 243.17 349.58 L 242.56 347.81 L 242.37 344.15 L 243.25 342.51 L 244.39 341.42 L 244.73 339.64 L 244.68 337.75 L 243.72 337.81 L 243.32 338.41 L 242.94 338.57 L 216.08 337.49 L 215.03 324.84 L 209.66 318.71 L 214.54 318.65 L 214.19 311.1 L 211.55 305.78 L 211.06 303.81 L 211.32 302.75 L 211.93 302.2 L 212.58 300.92 L 211.14 297.99 L 208.03 296.95 z"},{code:"PA",name:"Pará",gTransform:"matrix(1 0 0 1 29.16 -180.48)",pathTransform:"translate(-335.15, -138.78)",d:"M 371.03 235.24 L 308.05999999999995 231.76000000000002 L 274.0199999999999 229.34000000000003 L 270.3299999999999 227.85000000000002 L 268.9599999999999 228.3 L 268.6099999999999 227.99 L 268.4099999999999 226.9 L 267.8599999999999 226.18 L 266.2299999999999 225.73000000000002 L 265.4099999999999 225.9 L 264.4599999999999 225.51000000000002 L 264.2299999999999 225.01000000000002 L 264.2699999999999 223.91000000000003 L 264.0399999999999 222.97000000000003 L 260.6599999999999 221.27000000000004 L 257.6599999999999 218.51000000000005 L 256.1199999999999 217.40000000000003 L 255.3999999999999 215.20000000000005 L 254.9199999999999 212.81000000000006 L 255.1499999999999 210.37000000000006 L 254.37999999999988 208.74000000000007 L 253.04999999999987 206.81000000000006 L 251.67999999999986 202.86000000000007 L 251.28999999999988 201.10000000000008 L 248.8399999999999 197.04000000000008 L 247.65999999999988 195.96000000000006 L 247.65999999999988 195.96000000000006 L 247.0899999999999 195.40000000000006 L 246.93999999999988 193.44000000000005 L 246.2999999999999 192.18000000000006 L 244.7099999999999 190.62000000000006 L 243.6399999999999 190.04000000000005 L 243.2699999999999 189.47000000000006 L 242.43999999999988 187.13000000000005 L 242.46999999999989 186.00000000000006 L 243.0499999999999 185.03000000000006 L 244.4999999999999 183.90000000000006 L 245.2799999999999 182.59000000000006 L 275.1799999999999 118.35000000000007 L 273.3699999999999 116.68000000000006 L 273.4999999999999 115.90000000000006 L 273.3099999999999 115.42000000000006 L 271.9199999999999 115.77000000000005 L 271.0699999999999 116.38000000000005 L 269.1999999999999 115.60000000000005 L 268.09999999999985 113.43000000000005 L 265.40999999999985 111.98000000000005 L 264.1399999999999 110.64000000000004 L 264.0599999999999 110.04000000000005 L 262.7399999999999 109.22000000000006 L 261.3699999999999 109.07000000000005 L 259.1199999999999 108.42000000000004 L 256.7399999999999 107.11000000000004 L 254.8599999999999 106.44000000000004 L 253.5099999999999 105.35000000000004 L 252.8799999999999 104.45000000000003 L 248.2999999999999 101.91000000000003 L 243.6599999999999 98.14000000000003 L 243.3599999999999 97.70000000000003 L 243.3199999999999 96.77000000000002 L 242.7699999999999 94.94000000000003 L 240.9299999999999 93.71000000000002 L 240.2299999999999 93.90000000000002 L 239.8699999999999 93.70000000000002 L 238.03999999999988 91.72000000000001 L 238.0899999999999 89.61000000000001 L 238.43999999999988 88.92000000000002 L 238.25999999999988 88.51000000000002 L 236.56999999999988 87.66000000000003 L 236.32999999999987 86.98000000000002 L 236.14999999999986 84.71000000000002 L 236.57999999999987 83.26000000000002 L 236.17999999999986 78.40000000000002 L 236.17999999999986 78.40000000000002 L 234.58999999999986 61.43000000000002 L 234.58999999999986 61.43000000000002 L 235.33999999999986 61.75000000000002 L 235.76999999999987 62.33000000000002 L 235.74999999999986 62.81000000000002 L 236.19999999999985 63.210000000000015 L 237.11999999999983 63.490000000000016 L 238.48999999999984 62.780000000000015 L 238.95999999999984 61.97000000000001 L 241.66999999999985 62.20000000000001 L 242.47999999999985 61.15000000000001 L 241.93999999999986 59.34000000000001 L 243.72999999999985 58.98000000000001 L 245.13999999999984 57.35000000000001 L 247.77999999999983 58.36000000000001 L 249.65999999999983 58.39000000000001 L 250.19999999999982 56.870000000000005 L 253.52999999999983 55.25000000000001 L 255.49999999999983 55.64000000000001 L 256.65999999999985 55.53000000000001 L 257.14999999999986 55.28000000000001 L 258.34999999999985 53.80000000000001 L 258.74999999999983 52.40000000000001 L 260.2099999999998 51.30000000000001 L 261.0699999999998 51.19000000000001 L 261.7199999999998 51.65000000000001 L 263.8299999999998 50.52000000000001 L 264.23999999999984 50.63000000000001 L 264.60999999999984 51.62000000000001 L 265.33999999999986 52.070000000000014 L 267.36999999999983 52.55000000000001 L 268.97999999999985 52.80000000000001 L 269.53999999999985 52.20000000000001 L 271.20999999999987 51.81000000000001 L 271.98999999999984 52.09000000000001 L 272.80999999999983 52.08000000000001 L 273.66999999999985 51.74000000000001 L 275.90999999999985 52.040000000000006 L 280.57999999999987 53.42000000000001 L 281.53999999999985 53.28000000000001 L 282.53999999999985 52.41000000000001 L 282.5099999999999 50.13000000000001 L 280.4399999999999 47.63000000000001 L 279.1999999999999 47.00000000000001 L 279.6899999999999 45.32000000000001 L 280.9999999999999 43.870000000000005 L 281.27999999999986 42.760000000000005 L 281.58999999999986 42.59 L 282.29999999999984 42.78 L 283.1299999999998 43.54 L 285.47999999999985 44.65 L 297.09999999999985 42.32 L 298.66999999999985 44.01 L 299.6899999999998 44.07 L 300.1299999999998 43.78 L 300.1299999999998 43.78 L 300.74999999999983 44.35 L 301.11999999999983 46.65 L 300.49999999999983 47.949999999999996 L 300.24999999999983 52.489999999999995 L 300.48999999999984 53.92999999999999 L 300.79999999999984 54.46999999999999 L 301.96999999999986 54.489999999999995 L 303.04999999999984 54.199999999999996 L 306.4399999999998 54.56999999999999 L 307.72999999999985 55.059999999999995 L 309.65999999999985 56.10999999999999 L 310.32999999999987 56.90999999999999 L 310.8199999999999 58.18999999999999 L 312.0099999999999 58.30999999999999 L 313.14999999999986 59.14999999999999 L 313.9499999999999 60.12999999999999 L 314.78999999999985 60.39999999999999 L 316.11999999999983 60.25999999999999 L 316.49999999999983 59.83999999999999 L 317.4399999999998 59.69999999999999 L 320.2799999999998 62.359999999999985 L 320.9599999999998 62.329999999999984 L 321.4499999999998 63.509999999999984 L 320.7699999999998 63.73999999999998 L 320.5799999999998 64.45999999999998 L 321.3399999999998 67.28999999999998 L 323.3599999999998 69.54999999999998 L 325.9299999999998 70.27999999999999 L 326.0999999999998 70.60999999999999 L 325.6699999999998 73.74999999999999 L 325.8599999999998 75.85999999999999 L 326.5299999999998 77.36999999999999 L 327.1499999999998 77.92999999999999 L 327.7399999999998 79.74 L 327.6099999999998 81.32 L 329.1099999999998 84.8 L 329.9299999999998 84.99 L 330.70999999999975 84.63 L 333.63999999999976 87.91 L 333.5599999999998 90.34 L 333.9699999999998 91.28 L 334.9199999999998 91.47 L 335.2499999999998 91.94 L 335.5599999999998 93.52 L 335.3499999999998 94.21 L 335.4599999999998 95.50999999999999 L 337.3299999999998 96.89999999999999 L 337.7599999999998 98.39999999999999 L 339.2099999999998 99.42999999999999 L 341.99999999999983 100.11 L 343.29999999999984 99.99 L 344.0699999999998 99.64999999999999 L 345.0099999999998 99.71 L 345.0099999999998 99.71 L 344.47999999999985 100.44999999999999 L 344.76999999999987 102.03999999999999 L 344.59999999999985 102.57 L 343.30999999999983 103.67999999999999 L 341.91999999999985 103.85 L 341.41999999999985 103.66999999999999 L 340.57999999999987 102.87999999999998 L 339.91999999999985 102.72999999999998 L 336.53999999999985 104.30999999999997 L 336.16999999999985 104.84999999999998 L 334.5699999999998 105.56999999999998 L 333.9399999999998 105.54999999999998 L 332.3899999999998 106.13999999999999 L 332.42999999999984 106.71999999999998 L 338.8899999999998 105.65999999999998 L 339.7699999999998 106.31999999999998 L 339.8999999999998 106.77999999999997 L 339.8999999999998 107.43999999999997 L 339.2799999999998 107.93999999999997 L 339.5799999999998 108.29999999999997 L 340.2099999999998 108.09999999999997 L 341.0699999999998 107.09999999999997 L 342.0899999999998 107.08999999999996 L 342.6199999999998 106.81999999999996 L 343.2199999999998 106.93999999999997 L 344.2899999999998 106.51999999999997 L 345.4299999999998 105.94999999999997 L 348.70999999999975 103.60999999999997 L 350.20999999999975 103.25999999999998 L 352.0499999999997 102.44999999999997 L 355.20999999999975 100.60999999999997 L 355.7499999999998 99.60999999999997 L 356.4199999999998 99.08999999999997 L 358.50999999999976 98.07999999999997 L 359.1699999999998 97.35999999999997 L 358.9199999999998 96.68999999999997 L 359.12999999999977 96.27999999999997 L 360.25999999999976 95.99999999999997 L 361.34999999999974 96.05999999999997 L 361.75999999999976 96.26999999999997 L 362.13999999999976 100.06999999999996 L 361.6199999999998 102.64999999999996 L 361.94999999999976 104.26999999999997 L 362.75999999999976 105.86999999999996 L 364.06999999999977 107.21999999999996 L 364.3699999999998 108.85999999999996 L 364.2499999999998 109.32999999999996 L 362.4099999999998 111.16999999999996 L 361.93999999999977 111.29999999999995 L 361.06999999999977 110.77999999999996 L 359.2499999999998 110.25999999999996 L 357.9899999999998 109.94999999999996 L 357.0599999999998 110.08999999999996 L 354.9299999999998 109.04999999999995 L 354.6699999999998 107.92999999999995 L 353.7899999999998 107.39999999999995 L 351.5099999999998 111.21999999999994 L 350.8999999999998 113.58999999999995 L 351.5799999999998 116.55999999999995 L 352.05999999999983 117.19999999999995 L 352.97999999999985 117.81999999999995 L 351.96999999999986 116.67999999999995 L 351.53999999999985 113.98999999999995 L 351.65999999999985 113.46999999999996 L 354.22999999999985 109.24999999999996 L 356.53999999999985 110.42999999999996 L 356.64999999999986 110.87999999999997 L 359.17999999999984 113.32999999999997 L 358.92999999999984 115.34999999999997 L 358.1899999999998 115.89999999999996 L 358.5899999999998 118.22999999999996 L 359.1099999999998 119.35999999999996 L 360.2299999999998 120.10999999999996 L 360.9699999999998 120.25999999999996 L 361.4899999999998 120.74999999999996 L 361.1499999999998 120.10999999999996 L 360.3799999999998 119.86999999999996 L 359.17999999999984 118.82999999999996 L 358.9599999999998 118.14999999999995 L 359.2999999999998 113.94999999999995 L 360.1199999999998 112.75999999999995 L 361.5499999999998 113.48999999999995 L 362.37999999999977 114.68999999999996 L 362.2899999999998 115.47999999999996 L 363.4899999999998 116.33999999999996 L 363.7399999999998 116.04999999999995 L 362.7399999999998 114.78999999999995 L 361.81999999999977 112.68999999999996 L 361.81999999999977 112.24999999999996 L 364.07999999999976 109.92999999999996 L 365.69999999999976 110.01999999999997 L 367.62999999999977 110.65999999999997 L 367.96999999999974 111.21999999999997 L 367.35999999999973 111.80999999999997 L 367.6799999999997 112.08999999999997 L 368.15999999999974 112.11999999999998 L 369.1899999999997 111.94999999999997 L 370.5199999999997 111.04999999999997 L 374.6099999999997 110.08999999999997 L 375.37999999999965 110.28999999999998 L 377.11999999999966 111.34999999999998 L 380.2899999999997 110.92999999999998 L 381.3599999999997 110.51999999999998 L 382.37999999999965 109.50999999999998 L 383.3599999999997 108.91999999999997 L 385.0999999999997 108.40999999999997 L 385.86999999999966 108.47999999999996 L 385.92999999999967 109.22999999999996 L 383.88999999999965 113.24999999999996 L 383.64999999999964 114.74999999999996 L 383.18999999999966 115.81999999999995 L 382.3599999999997 116.84999999999995 L 382.3499999999997 117.72999999999995 L 382.92999999999967 119.14999999999995 L 382.6099999999997 121.61999999999995 L 383.48999999999967 120.42999999999995 L 383.49999999999966 119.02999999999994 L 385.0399999999997 116.02999999999994 L 386.1699999999997 112.83999999999995 L 387.2899999999997 111.27999999999994 L 387.55999999999966 111.00999999999995 L 388.31999999999965 110.95999999999995 L 388.89999999999964 110.60999999999996 L 390.71999999999963 110.37999999999995 L 391.5999999999996 109.02999999999996 L 393.1099999999996 107.33999999999996 L 394.46999999999963 105.07999999999996 L 394.9899999999996 104.61999999999996 L 395.77999999999963 105.10999999999996 L 396.39999999999964 104.64999999999996 L 398.01999999999964 106.98999999999997 L 399.20999999999964 107.57999999999997 L 399.1599999999996 106.83999999999997 L 398.8099999999996 106.08999999999997 L 399.4299999999996 105.07999999999997 L 402.9399999999996 104.56999999999996 L 401.9099999999996 104.24999999999997 L 398.39999999999964 104.70999999999997 L 398.08999999999963 104.49999999999997 L 398.37999999999965 102.06999999999996 L 398.88999999999965 101.77999999999996 L 399.55999999999966 102.15999999999995 L 400.57999999999964 102.26999999999995 L 401.64999999999964 99.16999999999996 L 400.96999999999963 97.77999999999996 L 400.9999999999996 97.09999999999995 L 402.1699999999996 95.28999999999995 L 405.0099999999996 92.80999999999995 L 405.3699999999996 92.72999999999995 L 406.4799999999996 93.86999999999995 L 409.4099999999996 91.77999999999994 L 409.8699999999996 91.70999999999995 L 410.2699999999996 92.15999999999995 L 410.3699999999996 92.72999999999995 L 410.0499999999996 93.39999999999995 L 411.1199999999996 93.23999999999995 L 411.9299999999996 92.65999999999995 L 412.2899999999996 91.87999999999995 L 412.9199999999996 91.68999999999996 L 413.1999999999996 91.83999999999996 L 413.9399999999996 93.22999999999996 L 415.2699999999996 94.42999999999996 L 415.4699999999996 93.86999999999996 L 415.35999999999956 93.48999999999997 L 414.4 93 L 414.26 92.71 L 414.13 91.50999999999999 L 414.3 91.08999999999999 L 414.74 90.89999999999999 L 417.02 91.16 L 418.2 91.81 L 418.82 92.83 L 420.45 93.53999999999999 L 422.09999999999997 92.75999999999999 L 422.62999999999994 94.89999999999999 L 422.12999999999994 95.21 L 422.09999999999997 95.8 L 423.02 95.28 L 424.18 92.93 L 424.56 93.16000000000001 L 424.33 94.49000000000001 L 424.74 94.93 L 427.25 94.67 L 427.7 95.32000000000001 L 428.15999999999997 97.00000000000001 L 427.55999999999995 97.95000000000002 L 428.40999999999997 97.45000000000002 L 428.66999999999996 97.82000000000002 L 430.55999999999995 97.96000000000002 L 434.0899999999999 96.72000000000003 L 433.7799999999999 98.30000000000003 L 433.0299999999999 100.13000000000002 L 434.49999999999994 99.64000000000003 L 435.0899999999999 99.02000000000002 L 435.7199999999999 100.64000000000003 L 435.7199999999999 100.64000000000003 L 434.94999999999993 101.09000000000003 L 434.4799999999999 102.12000000000003 L 434.63999999999993 103.50000000000003 L 433.92999999999995 107.89000000000003 L 433.35999999999996 108.63000000000002 L 432.21999999999997 108.78000000000003 L 432.16999999999996 109.40000000000003 L 432.43999999999994 109.89000000000003 L 433.42999999999995 109.73000000000003 L 433.85999999999996 110.26000000000003 L 433.78 111.87000000000003 L 432.88 114.89000000000003 L 432.52 115.60000000000002 L 430.78 117.17000000000002 L 430.28 119.55000000000001 L 430.40999999999997 121.19000000000001 L 426.72999999999996 124.28000000000002 L 427.77 125.86000000000001 L 426.97999999999996 126.67000000000002 L 427.15999999999997 128.49 L 426.7 129.77 L 425.87 131.22 L 424.39 132.98 L 422.43 134.51999999999998 L 420.83 139.20999999999998 L 420.53999999999996 141.10999999999999 L 420.06999999999994 142.32 L 417.62999999999994 144.64 L 416.50999999999993 145.1 L 415.88999999999993 147.98 L 414.3399999999999 149.14999999999998 L 413.9099999999999 150.29999999999998 L 412.3599999999999 152.46999999999997 L 411.1899999999999 153.38999999999996 L 408.83999999999986 153.15999999999997 L 394.1299999999999 164.98999999999998 L 394.6199999999999 165.07 L 394.6199999999999 165.07 L 396.9099999999999 165.88 L 398.7799999999999 165.64 L 400.06999999999994 165.76 L 401.0899999999999 167.42 L 401.4799999999999 167.73 L 402.3499999999999 167.86999999999998 L 403.6099999999999 169.03999999999996 L 403.5699999999999 169.66999999999996 L 403.1999999999999 170.33999999999995 L 402.47999999999985 170.70999999999995 L 401.5099999999998 170.77999999999994 L 401.2199999999998 171.05999999999995 L 401.3099999999998 172.46999999999994 L 402.31999999999977 173.80999999999995 L 401.39999999999975 176.55999999999995 L 400.75999999999976 177.03999999999994 L 399.2999999999998 177.49999999999994 L 399.0499999999998 177.95999999999995 L 399.3399999999998 179.15999999999994 L 399.1499999999998 180.49999999999994 L 397.8499999999998 180.64999999999995 L 396.3399999999998 181.98999999999995 L 395.4899999999998 183.25999999999996 L 395.63999999999976 184.76999999999995 L 395.39999999999975 185.26999999999995 L 392.89999999999975 186.46999999999994 L 389.4899999999997 187.60999999999993 L 387.0199999999997 189.38999999999993 L 386.8299999999997 189.73999999999992 L 387.2599999999997 191.92999999999992 L 387.3199999999997 194.5999999999999 L 386.03999999999974 196.6999999999999 L 384.6299999999997 198.3799999999999 L 384.47999999999973 198.9499999999999 L 384.64999999999975 199.8299999999999 L 385.2399999999997 200.7899999999999 L 386.90999999999974 202.52999999999992 L 387.65999999999974 202.8499999999999 L 387.8099999999997 203.14999999999992 L 387.1499999999997 207.1899999999999 L 385.3899999999997 212.33999999999992 L 384.3099999999997 213.14999999999992 L 382.60999999999973 216.38999999999993 L 382.4299999999997 217.37999999999994 L 381.4899999999997 218.91999999999993 L 380.7499999999997 219.76999999999992 L 379.6999999999997 219.92999999999992 L 378.3299999999997 220.8499999999999 L 377.2999999999997 222.7699999999999 L 376.08999999999975 224.4499999999999 L 374.90999999999974 225.5399999999999 L 373.75999999999976 227.11999999999992 L 372.62999999999977 231.57999999999993 L 371.03 235.24 z M 392.19 104.93 L 387.67 106.89 L 384.28000000000003 107.41 L 382.26000000000005 107.1 L 381.61000000000007 108.22999999999999 L 379.7700000000001 109.41999999999999 L 379.05000000000007 108.80999999999999 L 378.44000000000005 107.27999999999999 L 378.21000000000004 107.55999999999999 L 378.63000000000005 108.78999999999999 L 378.2900000000001 109.6 L 377.5800000000001 110.00999999999999 L 373.8100000000001 108.36999999999999 L 373.0100000000001 109.08999999999999 L 368.8200000000001 110.35 L 365.6200000000001 109.78 L 364.8100000000001 109.17 L 364.5700000000001 107.32000000000001 L 364.3400000000001 106.91000000000001 L 363.2300000000001 105.89000000000001 L 362.1700000000001 104.29000000000002 L 361.9600000000001 102.51000000000002 L 362.4800000000001 99.76000000000002 L 363.1000000000001 99.38000000000002 L 364.86000000000007 99.74000000000002 L 365.7900000000001 98.99000000000002 L 365.87000000000006 98.43000000000002 L 364.57000000000005 98.86000000000003 L 363.35 98.73000000000003 L 362.41 98.02000000000004 L 362.23 96.97000000000004 L 362.57 91.89000000000004 L 363.3 91.13000000000004 L 363.65000000000003 91.88000000000004 L 365.41 92.48000000000003 L 365.96000000000004 92.42000000000003 L 365.50000000000006 92.00000000000003 L 364.2300000000001 91.78000000000003 L 363.3300000000001 89.62000000000003 L 363.6900000000001 87.94000000000003 L 364.5800000000001 85.97000000000003 L 365.9100000000001 84.64000000000003 L 366.87000000000006 84.07000000000004 L 368.21000000000004 83.58000000000004 L 369.53000000000003 83.45000000000005 L 372.99 83.97000000000004 L 380.2 85.74000000000004 L 383.9 85.28000000000004 L 384.01 84.98000000000005 L 385.15 84.36000000000004 L 387.31 83.99000000000004 L 390.2 84.28000000000004 L 393 85.10000000000004 L 399.48 85.95000000000003 L 400.11 86.42000000000003 L 400.06 87.65000000000003 L 399.36 88.39000000000003 L 398.68 89.89000000000003 L 398.32 92.54000000000003 L 397.46 95.84000000000003 L 396.16999999999996 96.52000000000004 L 395.81999999999994 97.21000000000004 L 396.04999999999995 98.40000000000003 L 394.06999999999994 100.98000000000003 L 392.67999999999995 104.48000000000003 L 392.19 104.93 z M 344.98 104.76 L 344.23 104.25 L 345.33000000000004 102 L 345.24000000000007 100.21 L 345.49000000000007 100 L 347.82000000000005 99.52 L 348.72 98.66 L 348.87 98.16 L 348.67 95.82 L 349.53000000000003 93.24 L 350.79 91.75 L 353.08000000000004 90.28 L 355.95000000000005 90.08 L 356.6700000000001 92.44 L 355.57000000000005 94.63 L 354.72 97.67 L 353.62 98.34 L 352.28000000000003 100.37 L 351.50000000000006 101.09 L 346.56000000000006 104.4 L 344.98 104.76 z M 373.46 81.86 L 372.43 81.61 L 369.98 81.69 L 369.19 81.53 L 368.9 81.27 L 368.52 80.17999999999999 L 368.53 78.94 L 370.03999999999996 78.52 L 371.92999999999995 78.56 L 374.11999999999995 77.27 L 378.92999999999995 76.67 L 379.69999999999993 76.93 L 380.37999999999994 77.61000000000001 L 380.19999999999993 78.63000000000001 L 377.63999999999993 80.02000000000001 L 375.85999999999996 82.50000000000001 L 374.76 83 L 373.46 81.86 z M 378.25 81.86 L 380.11 80.66 L 382.09000000000003 80.69 L 383.74 81.31 L 384.27 82.3 L 384.32 82.92 L 383.44 83.69 L 380.59 83.97 L 379.41999999999996 84.28999999999999 L 377.15999999999997 83.39999999999999 L 376.96 82.86999999999999 L 378.25 81.86 z M 361.27 86.25 L 360.77 85.99 L 360.15999999999997 86.03 L 358.61999999999995 85.34 L 358.8299999999999 84.18 L 359.4699999999999 83.26 L 361.38999999999993 82.86 L 363.74999999999994 81.96 L 365.06999999999994 82.03999999999999 L 365.86999999999995 82.72 L 365.9599999999999 82.85 L 364.0299999999999 84.46 L 362.9599999999999 84.8 L 361.27 86.25 z M 370.69 76.56 L 369.87 76.26 L 369.7 74.60000000000001 L 369.84999999999997 74.00000000000001 L 371.02 72.69000000000001 L 373.46999999999997 71.77000000000001 L 373.71999999999997 71.89000000000001 L 374.24999999999994 72.57000000000002 L 374.28999999999996 73.46000000000002 L 372.34 75.45000000000002 L 370.69 76.56 z M 356.86 96.78 L 356.72 96.37 L 356.91 95.44 L 357.95000000000005 92.63 L 360.54 90.94 L 361.26000000000005 90.66 L 361.95000000000005 90.8 L 361.79 92.59 L 360.23 93.03 L 358.61 95.22 L 356.86 96.78 z M 367.77 79.21 L 366.58 78.89999999999999 L 366.28 78.41999999999999 L 367.15999999999997 77.46 L 367.86999999999995 73.50999999999999 L 368.75999999999993 72.27999999999999 L 369.04999999999995 72.40999999999998 L 369.11999999999995 72.72999999999998 L 369.09999999999997 75.20999999999998 L 369.7 77.07999999999998 L 369.38 77.95999999999998 L 368.35 78.35999999999999 L 367.77 79.21 z M 352.96 89.4 L 352.69 89.21000000000001 L 352.81 88.60000000000001 L 353.36 88.24000000000001 L 354.55 86.53000000000002 L 355.31 84.99000000000001 L 356.04 84.33000000000001 L 357.49 83.79 L 357.29 85.28 L 356.89000000000004 86.28 L 355.17 87.94 L 352.96 89.4 z M 366.83 82.37 L 366.22999999999996 82.22 L 365.39 81.51 L 364.43 79.87 L 364.38 79.49000000000001 L 364.61 79.2 L 365.42 78.62 L 367.27000000000004 79.46000000000001 L 367.56000000000006 79.89000000000001 L 367.80000000000007 81.98000000000002 L 366.83 82.37 z M 361.45 112.93 L 360.8 112.82000000000001 L 359.92 112.30000000000001 L 359.23 112.76 L 358.48 112.48 L 356.8 110.74000000000001 L 356.8 110.13000000000001 L 358.08 110.12 L 361.14 111.44 L 361.45 112.93 z M 340.3 107.39 L 340.34000000000003 106.36 L 340.14000000000004 106.06 L 340.74000000000007 105.07000000000001 L 343.1000000000001 104.19000000000001 L 343.88000000000005 104.57000000000001 L 344.75000000000006 105.43 L 344.46000000000004 105.78 L 343.43000000000006 106.25 L 340.89000000000004 106.66 L 340.3 107.39 z M 353 100.7 L 352.82 100.67 L 352.83 100.32000000000001 L 353.37 99.38000000000001 L 355.16 97.76 L 355.58000000000004 96.52000000000001 L 355.63000000000005 95.22000000000001 L 355.87000000000006 94.92000000000002 L 356.19000000000005 95.36000000000001 L 356.19000000000005 96.87000000000002 L 355.30000000000007 99.60000000000002 L 354.68000000000006 100.25000000000003 L 353 100.7 z M 359.3 90.8 L 360.95 87.84 L 361.83 87.63000000000001 L 362.53999999999996 87.82000000000001 L 362.80999999999995 88.69000000000001 L 362.22999999999996 89.4 L 359.3 90.8 z M 390.72 109.77 L 389.88000000000005 109.42 L 389.5400000000001 108.36 L 390.5800000000001 106.64 L 391.6500000000001 106.31 L 391.8400000000001 106.41 L 391.8200000000001 107.14999999999999 L 391.0800000000001 109.38999999999999 L 390.72 109.77 z M 357.24 90.3 L 356.7 90.1 L 357.02 88.05999999999999 L 358.34999999999997 86.24999999999999 L 358.58 86.28999999999999 L 359.87 87.16999999999999 L 359.86 87.41999999999999 L 358.31 88.05999999999999 L 357.24 90.3 z M 359.47 95.33 L 360.19000000000005 95.36 L 359.7900000000001 95.81 L 358.8500000000001 96.12 L 358.74000000000007 97.24000000000001 L 357.95000000000005 97.95 L 356.26000000000005 98.79 L 356.1 98.61 L 356.37 97.78 L 356.84000000000003 97.15 L 358.57000000000005 95.48 L 359.47 95.33 z M 336.91 105.54 L 336.36 105.35000000000001 L 336.29 105.00000000000001 L 336.72 104.60000000000001 L 340.28000000000003 103.00000000000001 L 340.82000000000005 103.70000000000002 L 340.81000000000006 103.90000000000002 L 339.4100000000001 104.63000000000002 L 336.91 105.54 z M 400.44 100.76 L 399.41 100.57000000000001 L 398.59000000000003 99.78 L 399.46000000000004 98.53 L 400.8 98.52 L 400.99 99.71 L 400.89 100.3 L 400.44 100.76 z M 363.19 81.86 L 360.83 82.56 L 360.24 82.57000000000001 L 360.06 82.36000000000001 L 361.09 81.32000000000001 L 362.13 80.81 L 363.17 80.98 L 363.61 81.32000000000001 L 363.76 81.55000000000001 L 363.61 81.76 L 363.19 81.86 z M 357.92 90.45 L 357.84000000000003 89.69 L 358.09000000000003 89.19 L 360.57000000000005 87.73 L 359.6700000000001 89.73 L 358.86000000000007 90.36 L 357.92 90.45 z M 360.06 94.98 L 359.61 94.86 L 359.54 94.63 L 360.32 93.13 L 361.51 93.14999999999999 L 361.39 94.49999999999999 L 360.06 94.98 z M 388.1 110.81 L 387.82000000000005 110.58 L 388.72 108.98 L 389.40000000000003 108.58 L 389.63000000000005 109.33 L 390.14000000000004 109.7 L 389.88000000000005 110.22 L 389.45000000000005 110.56 L 388.82000000000005 110.38 L 388.1 110.81 z M 361.44 87.49 L 360.55 87.42 L 360.57 87.23 L 362.93 85.39 L 362.97 86.35 L 362.74 86.97999999999999 L 362.49 87.32 L 361.44 87.49 z M 428.9 97.71 L 428.52 97.17999999999999 L 428.71 96.41999999999999 L 429.72999999999996 95.50999999999999 L 429.97999999999996 95.66 L 430.21 97.41 L 428.9 97.71 z"},{code:"PB",name:"Paraíba",gTransform:"matrix(1 0 0 1 275.13 -126.21)",pathTransform:"translate(-581.13, -193.05)",d:"M 610.43 199.15 L 607.93 197.09 L 607.11 196.83 L 604.46 196.62 L 602.15 197.69 L 600.67 198.97 L 600.22 200.77 L 598.32 201.8 L 596.31 202.25 L 595.17 202.23 L 595.17 202.83 L 594.37 203.36 L 592.19 203.65 L 588.31 203.39 L 586.7 204.27 L 586.15 204.91 L 584.33 205.01 L 583.44 205.7 L 582.9 206.46 L 583.29 207.19 L 583.3 207.73 L 582.9 208.21 L 581.12 209.74 L 579.78 209.9 L 578.13 210.74 L 576.53 209.95 L 575.58 209.01 L 575.23 206.77 L 575.47 206.28 L 575.29 205.98 L 574.15 205.66 L 573.71 205.95 L 572.2 206.2 L 572.24 205.75 L 574.77 203.11 L 574.94 202.68 L 574.22 200.81 L 574.18 200.34 L 574.55 199.56 L 577.55 198.49 L 577.66 198.19 L 577.16 196.8 L 573.66 194.88 L 572.18 195.29 L 569.96 196.55 L 569.03 198.06 L 567.55 198.93 L 566.5 199.24 L 563.8 201.12 L 562.28 202.76 L 560.65 202.99 L 558.02 203.96 L 557.25 203.63 L 557.3 202.95 L 556.67 201.71 L 556.29 201.63 L 555.36 202.36 L 553.85 202.68 L 552.86 202.35 L 551.46 200.44 L 551.06 200.35 L 551.06 200.35 L 550.89 200.1 L 552.08 198.98 L 553.69 195.49 L 553.35 194.3 L 552.66 194.22 L 551.42 193.33 L 551.44 191.67 L 551.09 190.95 L 550.51 190.66 L 550.27 190.25 L 550.39 189.32 L 550.56 188.94 L 551.65 188.31 L 552.31 187 L 551.79 185.69 L 552.82 182.69 L 553.66 181.54 L 553.74 181 L 553.74 181 L 554.31 180.54 L 556.24 182.18 L 557.14 182.6 L 560.02 183.21 L 561.18 182.08 L 564.41 180.42 L 565.23 179.71 L 565.33 178.67 L 565.74 177.72 L 568.92 176.51 L 570.35 176.39 L 573.61 175.35 L 574.25 175.43 L 574.78 175.87 L 574.79 177.06 L 571.8 180.27 L 571.36 181.23 L 570.98 182.97 L 570.57 183.35 L 569.72 183.6 L 569.51 183.91 L 569.43 185.63 L 572.96 186.15 L 573.28 186.38 L 573.59 187.76 L 573.88 187.99 L 577.03 186.73 L 578.8 186.65 L 580.75 186.95 L 581.64 188.12 L 581.12 189.66 L 581.95 190.4 L 584.3 189.47 L 584.8 188.73 L 585.35 187.52 L 584.88 186.58 L 584.72 185.16 L 585.2 184.57 L 586.21 184.89 L 585.68 183.36 L 584.96 182.58 L 585.27 181.1 L 587.09 179.75 L 588.47 179.7 L 588.89 180.09 L 588.79 181.09 L 589.41 181.58 L 592.83 181.98 L 593.36 182.33 L 599.19 181.94 L 601.36 182.24 L 603.82 183.34 L 604.86 182.94 L 608.36 183.15 L 609.29 182.91 L 609.29 182.91 L 609.38 185.31 L 610.83 189.7 L 610.89 190.34 L 610.71 191.28 L 610.34 191.73 L 610.31 192.61 L 610.89 191.87 L 611.4 190.37 L 611.41 192.35 L 612 193.36 L 611.73 198.54 L 611.37 199.14 z"},{code:"PE",name:"Pernambuco",gTransform:"matrix(1 0 0 1 254.6 -106.99)",pathTransform:"translate(-560.6, -212.26)",d:"M 558.28 227.19 L 557.06 224.15 L 557.05 223.21 L 554.94 222.35 L 554.44 221.98 L 553.99 221.15 L 554.6 220.26 L 554.58 219.64 L 554.13 219.32 L 553.13 219.33 L 552.7 219.77 L 552.41 221.51 L 551.98 221.66 L 551.59 221.4 L 551.05 219.75 L 549.47 218.6 L 546.48 218.2 L 544.12 217.43 L 542.77 216.62 L 541.94 215.18 L 540.45 214.62 L 539.86 214.73 L 537.33 216.19 L 535.68 216.63 L 534.91 218.68 L 532.68 219.13 L 532.39 219.38 L 532.64 220.74 L 532.47 221.33 L 531.37 222.57 L 528.98 223.6 L 528.34 223.54 L 527.57 223.01 L 526.81 223.18 L 526.31 224.05 L 525.54 227.62 L 522.67 228.5 L 521.85 229.42 L 520.89 229.65 L 519.05 229.03 L 519.97 227.35 L 519.71 225.35 L 517.5 224.44 L 516.78 222.5 L 516.84 219.77 L 516.4 219.26 L 513.59 217.88 L 511.39 217.59 L 510.23 217.85 L 509.33 217.45 L 509.33 217.45 L 511.95 216.18 L 513.92 214.47 L 514.46 213.6 L 516.75 212.27 L 517.72 211.99 L 521.61 208.12 L 522.35 206.36 L 522.41 204.09 L 522.12 203.55 L 520.5 201.97 L 520.57 199.78 L 519.97 198.65 L 519.91 197.7 L 520.02 197.25 L 520.54 196.92 L 522.33 196.76 L 522.33 196.76 L 527.26 196.96 L 528.15 197.2 L 529.78 197.01 L 531.92 196.21 L 533.21 196.11 L 536.29 196.53 L 539.14 198.43 L 540.97 199.26 L 541.43 200.25 L 542.44 201.32 L 543.8 201.8 L 544.58 202.37 L 545.21 204.01 L 546.86 203.96 L 548.4 201.67 L 549.47 200.84 L 551.06 200.35 L 551.06 200.35 L 551.46 200.44 L 552.86 202.35 L 553.85 202.68 L 555.36 202.36 L 556.29 201.63 L 556.67 201.71 L 557.3 202.95 L 557.25 203.63 L 558.02 203.96 L 560.65 202.99 L 562.28 202.76 L 563.8 201.12 L 566.5 199.24 L 567.55 198.93 L 569.03 198.06 L 569.96 196.55 L 572.18 195.29 L 573.66 194.88 L 577.16 196.8 L 577.66 198.19 L 577.55 198.49 L 574.55 199.56 L 574.18 200.34 L 574.22 200.81 L 574.94 202.68 L 574.77 203.11 L 572.24 205.75 L 572.2 206.2 L 573.71 205.95 L 574.15 205.66 L 575.29 205.98 L 575.47 206.28 L 575.23 206.77 L 575.58 209.01 L 576.53 209.95 L 578.13 210.74 L 579.78 209.9 L 581.12 209.74 L 582.9 208.21 L 583.3 207.73 L 583.29 207.19 L 582.9 206.46 L 583.44 205.7 L 584.33 205.01 L 586.15 204.91 L 586.7 204.27 L 588.31 203.39 L 592.19 203.65 L 594.37 203.36 L 595.17 202.83 L 595.17 202.23 L 596.31 202.25 L 598.32 201.8 L 600.22 200.77 L 600.67 198.97 L 602.15 197.69 L 604.46 196.62 L 607.11 196.83 L 607.93 197.09 L 610.43 199.15 L 610.43 199.15 L 611.31 199.38 L 611.86 200.6 L 610.59 202.32 L 610.48 202.87 L 610.49 203.35 L 611.19 203.72 L 611.46 204.22 L 611.65 205.28 L 609.69 211.66 L 606.44 220.61 L 606.44 220.61 L 606.17 220.4 L 603.27 220.13 L 601.35 219.32 L 599.88 219.51 L 597.32 220.8 L 595.08 219.95 L 593.08 220.19 L 591.53 221.43 L 591.41 221.88 L 589.23 224.17 L 587.42 225.28 L 586.26 225.23 L 584.4 226.29 L 583.23 226.4 L 580.09 226.11 L 577.59 226.76 L 575.68 226.28 L 573.9 225.23 L 572 223.11 L 569.45 221.09 L 568.37 221.21 L 566.7 220.91 L 565.7 219.69 L 564.88 220.29 L 564.79 220.98 L 562.41 224.27 L 560.24 225.03 L 559.6 226.12 z"},{code:"PI",name:"Piauí",gTransform:"matrix(1 0 0 1 174.84 -130.97)",pathTransform:"translate(-480.85, -188.29)",d:"M 505.7 126.91 L 507.01 127.03 L 507.7 126.8 L 509.94 127.31 L 510.93 128.16 L 511.25 128.76 L 511.25 128.76 L 511.14 129.56 L 510.05 131.41 L 508.47 133.38 L 508.29 134.84 L 508.58 136.13 L 510.38 140.85 L 513.53 147.27 L 513.97 149 L 515.33 150.59 L 515.31 151.35 L 514.57 152.71 L 515.36 156.58 L 514.88 158.18 L 515.88 160.19 L 516.48 163.18 L 515.89 164.76 L 515.09 165.34 L 516.01 166.03 L 516.12 166.41 L 517.06 174.57 L 516.82 175.02 L 517.58 177.59 L 518.63 182.79 L 519.64 185.46 L 520.95 186.11 L 523.51 186.58 L 524.28 187.74 L 524.27 188.43 L 522.77 190.68 L 521.63 193.79 L 521.71 194.76 L 522.39 195.44 L 522.33 196.76 L 522.33 196.76 L 520.54 196.92 L 520.02 197.25 L 519.91 197.7 L 519.97 198.65 L 520.57 199.78 L 520.5 201.97 L 522.12 203.55 L 522.41 204.09 L 522.35 206.36 L 521.61 208.12 L 517.72 211.99 L 516.75 212.27 L 514.46 213.6 L 513.92 214.47 L 511.95 216.18 L 509.33 217.45 L 509.33 217.45 L 508.88 218.61 L 507.38 220.91 L 506.33 221.58 L 505.54 221.4 L 503.54 221.78 L 503.65 224.18 L 501.79 225.98 L 501.47 225.93 L 500.85 225.31 L 498.69 225.3 L 497.87 226.28 L 497.1 226.64 L 494.37 226.98 L 492.86 228.32 L 492.04 229.54 L 490.34 229.64 L 488.86 230.28 L 485.86 230.39 L 485.04 230.11 L 484.85 229.83 L 484.98 229.17 L 483.27 228.19 L 481.94 227.8 L 480.55 228.35 L 478.42 228.78 L 478.1 228.6 L 477.69 227.67 L 476.19 227.21 L 474.24 227.23 L 471 228.88 L 470.94 229.81 L 473.18 234.25 L 473.3 235.4 L 473.01 237.97 L 472.76 238.88 L 472.04 239.74 L 469.09 244.79 L 466.12 247.21 L 464.77 247.63 L 463.29 247.1 L 461.95 246.93 L 459.75 247.68 L 458.58 248.57 L 457.91 249.44 L 456.77 249.82 L 456.02 251.27 L 455.69 251.48 L 453.58 251.3 L 451.78 251.82 L 447.6 249.97 L 445.83 247.48 L 445.3 245.27 L 444.64 244.23 L 443.2 242.89 L 440.87 242.91 L 440.87 242.91 L 437.93 242.7 L 437.93 242.7 L 437.98 240.78 L 438.24 239.72 L 439.39 237.27 L 439.52 230.91 L 440.28 229.51 L 440.31 229 L 438.58 225.94 L 438.11 222.75 L 437.41 220.81 L 438.14 218.81 L 439.84 217.41 L 441.04 214.93 L 441.17 213.42 L 441.51 212.59 L 441.81 212.38 L 443.25 209.64 L 443.88 207.32 L 444.27 204.35 L 445.25 201.37 L 447.38 199.42 L 450.1 198.66 L 452.71 198.35 L 453.78 197.98 L 455.48 196.45 L 456.53 196.41 L 457.87 195.89 L 460.73 193.32 L 463.07 192.41 L 465.08 190.41 L 465.71 189.54 L 465.71 189.08 L 467.61 187.16 L 468.11 186.94 L 468.95 186.7 L 469.18 187 L 470.3 186.74 L 471.3 186.14 L 472.76 185.95 L 473.77 186.16 L 476.28 187.98 L 477.79 187.88 L 480.23 187.02 L 481.06 186.98 L 481.71 187.26 L 483.99 186.97 L 485.2 185.66 L 485.7 184.2 L 485.82 182.99 L 486.11 182.55 L 486.5 180.35 L 486.37 179.5 L 486.2 179 L 484.59 178.09 L 482.81 176.06 L 482.3 173.76 L 482.19 171.65 L 482.36 169.17 L 486.46 164.74 L 486.67 164.19 L 486.77 161.76 L 486.22 158.78 L 484.64 155.98 L 485.78 153.11 L 486.06 151.64 L 485.68 150.37 L 484.45 149.53 L 484.1 147.61 L 484.87 146.56 L 485.51 146.39 L 486.33 144.41 L 488.22 142.56 L 489.1 140.73 L 489.06 138.94 L 491.98 135.53 L 492.79 135.69 L 496.1 135.23 L 500.23 131.26 L 502.02 128.99 L 502.41 127.46 L 501.77 126.93 L 501.55 126.21 L 502.01 124.77 L 502.01 124.77 L 502.74 124.89 L 504.21 125.76 L 504.72 126.27 L 504.59 126.58 z"},{code:"PR",name:"Paraná",gTransform:"matrix(1 0 0 1 47.59 157)",pathTransform:"translate(-353.59, -476.27)",d:"M 396.75 499.4 L 391.51 499.37 L 391.18 499.81 L 389.44 500.05 L 388.68 499.98 L 388.57 499.59 L 387 500.16 L 385.65 501.59 L 382.3 503.72 L 380.86 503.56 L 379.63 502.94 L 376.5 500.34 L 375.47 499.95 L 374.71 499.94 L 371.87 500.67 L 369.54 500.84 L 368.73 500.81 L 367.31 500.05 L 366.2 500.19 L 364.67 500.84 L 364.08 502.31 L 363.35 503.18 L 361.48 504.16 L 357.91 503.75 L 355.91 504.9 L 355.19 505.67 L 354.5 507.26 L 355.35 510.25 L 354.48 511.11 L 353.56 511.13 L 352.81 511.51 L 352.64 512 L 351.31 510.11 L 347.06 510.24 L 343.3 509.81 L 341.72 508.63 L 341.56 508.22 L 340.53 507.59 L 336.27 507.23 L 330.98 505.55 L 328.64 506.12 L 325.95 506.09 L 323.93 504.68 L 323.61 504.17 L 322.55 503.93 L 322.02 503.92 L 321.31 504.29 L 317.68 504.27 L 317.68 504.27 L 317.46 503.06 L 314.93 498.88 L 314.95 496.29 L 313.96 493.41 L 310.54 491.04 L 309.45 492.17 L 307.33 492.06 L 306.23 492.49 L 305.16 493.39 L 303.7 492.31 L 302.88 492.37 L 302.6 490.17 L 303.26 488.6 L 304.33 487.33 L 305.55 485.15 L 305.61 484.81 L 305.12 484.06 L 305.14 482.82 L 306.04 479.18 L 307.3 476.16 L 307.05 473.86 L 308.33 471.48 L 308.12 470.46 L 307.28 469.58 L 306.97 467.98 L 307.63 466.92 L 308.42 466.38 L 308.42 466.38 L 310.8 464.82 L 311.16 464 L 312.73 456.08 L 313.06 455.73 L 314.17 455.41 L 315.83 454.4 L 316.5 453.72 L 317.95 450.16 L 317.93 449.01 L 318.86 446.68 L 319.97 445.86 L 325.38 443.59 L 325.38 443.59 L 328.64 441.3 L 332.47 441.95 L 336.48 441.84 L 339.75 442.13 L 340.96 441.51 L 341.31 440.91 L 342.04 440.54 L 343.21 440.83 L 344.69 441.61 L 347.21 442.07 L 349.85 443.16 L 351.16 443.29 L 352.23 442.75 L 354.81 442.74 L 355.59 443.74 L 357.34 444.58 L 360.85 445.38 L 361.48 445.89 L 362.19 447.21 L 363.92 447.28 L 364.34 446.94 L 365.99 447.09 L 366.65 447.63 L 371.96 447.76 L 374.93 446.91 L 376.06 448.46 L 379.65 451.29 L 380.54 453.05 L 380.55 455.79 L 380.16 456.37 L 380 457.18 L 380.38 459.02 L 381.68 460.53 L 381.6 462.29 L 381.24 462.85 L 382.73 465.85 L 383.94 467 L 384.61 467.28 L 385.11 467.96 L 385.06 468.85 L 385.98 470.82 L 386.58 471.11 L 386.83 471.55 L 386.58 472.6 L 385.31 474.73 L 385.63 476.77 L 386.23 477.15 L 387.24 477.36 L 389.62 477.24 L 393.04 476.71 L 393.54 477.1 L 395.12 476.91 L 396.71 477.04 L 398.32 478.3 L 398.18 478.71 L 397.29 479.36 L 396.6 482.66 L 396.95 483.44 L 398.02 483.97 L 398.67 483.12 L 399.77 480.36 L 400.53 480.19 L 402.67 480.77 L 402.27 482.72 L 403 486.02 L 404.42 486.6 L 404.58 487.92 L 404.58 487.92 L 403.23 488.94 L 402.62 490.42 L 402.07 490.3 L 402.34 488.36 L 403.78 487.41 L 402.37 487.69 L 401.48 488.18 L 400.61 488.16 L 400.27 487.77 L 399.7 487.6 L 399.16 487.97 L 398.88 488.9 L 399.4 489.7 L 398.67 490.66 L 398.37 490.76 L 395.89 490.23 L 395.1 489.69 L 394.65 489.81 L 394.47 490.71 L 394.81 491.08 L 396.42 491.64 L 397.82 491.39 L 399.95 491.99 L 400.22 492.47 L 399.25 493.15 L 397.71 495.93 L 396.47 496.7 L 394.05 497.27 L 393.85 497.72 L 396.8 497.52 L 396.95 498.71 z"},{code:"RJ",name:"Rio de Janeiro",gTransform:"matrix(1 0 0 1 179.27 113.69)",pathTransform:"translate(-485.28, -432.95)",d:"M 468.35 450.28 L 468.28000000000003 449.5 L 468.66 449.23 L 471.85 449.45000000000005 L 474.44 448.86000000000007 L 471.91 447.31000000000006 L 470.51000000000005 446.81000000000006 L 467.70000000000005 447.49000000000007 L 466.34000000000003 449.0900000000001 L 465.31000000000006 449.4100000000001 L 464.61000000000007 449.36000000000007 L 463.26000000000005 447.2100000000001 L 462.78000000000003 447.2100000000001 L 461.88000000000005 447.6300000000001 L 460.9200000000001 448.6900000000001 L 457.7700000000001 449.4900000000001 L 457.4300000000001 450.40000000000015 L 457.2400000000001 452.3000000000001 L 459.4300000000001 452.4300000000001 L 460.5000000000001 453.4400000000001 L 459.35000000000014 454.5200000000001 L 458.41000000000014 454.3500000000001 L 456.9900000000001 454.5200000000001 L 456.9900000000001 454.5200000000001 L 456.5100000000001 454.2600000000001 L 454.8800000000001 452.5300000000001 L 454.8300000000001 452.12000000000006 L 455.9200000000001 448.62000000000006 L 457.01000000000005 447.4700000000001 L 459.36000000000007 446.4600000000001 L 459.86000000000007 446.61000000000007 L 462.63000000000005 446.25000000000006 L 464.13000000000005 445.5400000000001 L 465.78000000000003 443.3900000000001 L 465.03000000000003 441.7500000000001 L 463.33000000000004 441.7400000000001 L 460.18000000000006 442.2700000000001 L 458.4100000000001 441.8800000000001 L 457.18000000000006 440.29000000000013 L 456.62000000000006 439.1200000000001 L 455.3500000000001 438.5800000000001 L 455.3500000000001 438.5800000000001 L 456.0300000000001 438.0900000000001 L 458.4500000000001 437.3500000000001 L 461.3600000000001 436.0100000000001 L 463.9400000000001 435.8400000000001 L 464.4400000000001 436.11000000000007 L 466.16000000000014 435.3400000000001 L 467.21000000000015 434.5700000000001 L 471.3000000000001 432.7800000000001 L 471.8200000000001 432.7100000000001 L 472.1800000000001 433.0200000000001 L 475.3800000000001 432.9500000000001 L 476.6300000000001 432.7800000000001 L 478.2600000000001 431.8400000000001 L 478.8300000000001 431.7800000000001 L 481.36000000000007 432.05000000000007 L 481.8500000000001 432.2200000000001 L 481.8300000000001 432.6900000000001 L 483.2100000000001 432.4900000000001 L 492.7200000000001 427.96000000000015 L 495.25000000000006 426.97000000000014 L 495.46000000000004 426.45000000000016 L 495.18000000000006 425.84000000000015 L 493.74000000000007 425.71000000000015 L 493.83000000000004 424.96000000000015 L 495.72 421.25000000000017 L 498.08000000000004 415.21000000000015 L 497.35 414.50000000000017 L 497.91 414.01000000000016 L 499.15000000000003 413.7400000000002 L 501.68 411.38000000000017 L 501.68 411.38000000000017 L 503.61 412.14000000000016 L 504.28000000000003 416.85000000000014 L 506.78000000000003 417.98000000000013 L 511.11 418.9900000000001 L 514.1 418.6200000000001 L 515.72 419.6800000000001 L 515.72 419.6800000000001 L 515.64 420.9500000000001 L 514.6999999999999 422.5600000000001 L 514.4799999999999 424.6900000000001 L 515.6199999999999 431.4700000000001 L 515.1199999999999 432.1500000000001 L 512.0399999999998 433.9000000000001 L 506.0699999999998 435.8400000000001 L 503.23999999999984 437.5600000000001 L 499.73999999999984 441.2500000000001 L 499.6299999999998 442.91000000000014 L 499.9399999999998 444.10000000000014 L 499.74999999999983 445.72000000000014 L 499.0199999999998 447.20000000000016 L 497.1999999999998 447.71000000000015 L 490.6499999999998 447.54000000000013 L 484.8599999999998 448.2400000000001 L 482.4699999999998 447.78000000000014 L 481.9799999999998 447.40000000000015 L 481.9199999999998 446.72000000000014 L 482.94999999999976 445.2400000000001 L 483.6199999999998 443.79000000000013 L 483.5299999999998 443.17000000000013 L 482.74999999999983 442.9900000000001 L 479.9599999999998 444.1400000000001 L 479.6999999999998 444.8300000000001 L 480.0099999999998 445.6200000000001 L 481.3899999999998 446.79000000000013 L 481.6399999999998 447.76000000000016 L 481.04999999999984 448.28000000000014 L 479.41999999999985 448.79000000000013 L 477.84999999999985 448.76000000000016 L 469.80999999999983 449.83000000000015 L 468.35 450.28 z M 463.24 452.27 L 462.57 451.29999999999995 L 464.68 449.74999999999994 L 466.54 450.68999999999994 L 466.97 451.38999999999993 L 464.51000000000005 451.88999999999993 L 464.1 451.5399999999999 L 463.63 451.5399999999999 L 463.24 452.27 z"},{code:"RN",name:"Rio Grande do Norte",gTransform:"matrix(1 0 0 1 274.86 -145.63)",pathTransform:"translate(-580.87, -173.63)",d:"M 609.29 182.91 L 608.36 183.15 L 604.86 182.94 L 603.82 183.34 L 601.36 182.24 L 599.19 181.94 L 593.36 182.33 L 592.83 181.98 L 589.41 181.58 L 588.79 181.09 L 588.89 180.09 L 588.47 179.7 L 587.09 179.75 L 585.27 181.1 L 584.96 182.58 L 585.68 183.36 L 586.21 184.89 L 585.2 184.57 L 584.72 185.16 L 584.88 186.58 L 585.35 187.52 L 584.8 188.73 L 584.3 189.47 L 581.95 190.4 L 581.12 189.66 L 581.64 188.12 L 580.75 186.95 L 578.8 186.65 L 577.03 186.73 L 573.88 187.99 L 573.59 187.76 L 573.28 186.38 L 572.96 186.15 L 569.43 185.63 L 569.51 183.91 L 569.72 183.6 L 570.57 183.35 L 570.98 182.97 L 571.36 181.23 L 571.8 180.27 L 574.79 177.06 L 574.78 175.87 L 574.25 175.43 L 573.61 175.35 L 570.35 176.39 L 568.92 176.51 L 565.74 177.72 L 565.33 178.67 L 565.23 179.71 L 564.41 180.42 L 561.18 182.08 L 560.02 183.21 L 557.14 182.6 L 556.24 182.18 L 554.31 180.54 L 553.74 181 L 553.74 181 L 553.08 181.38 L 552.44 181.21 L 552.78 179.24 L 554.19 176.99 L 555.03 176.11 L 555.54 176.04 L 556.32 176.55 L 557.35 176.29 L 557.92 175.19 L 559.38 173.68 L 560.78 171.24 L 560.63 170.5 L 561.28 168.83 L 562.15 168.26 L 562.99 167.14 L 566.29 160.45 L 568.9 158.44 L 573.79 156.85 L 573.79 156.85 L 574.26 157.61 L 575.12 158.36 L 578.25 158.35 L 579.47 158.76 L 581.16 160.51 L 582.48 161.01 L 585.81 160.69 L 588.69 161.21 L 591.23 160.97 L 593.56 160.24 L 598.06 161.16 L 599.33 161.2 L 601.28 162.06 L 602.3 162.88 L 602.94 163.82 L 605.25 168.56 L 605.75 170.35 L 605.71 171.1 L 607.19 176.48 L 607.4 178.16 L 608.12 178.7 L 609.08 181.39 z"},{code:"RO",name:"Rondônia",gTransform:"matrix(1 0 0 1 -139.57 -68.08)",pathTransform:"translate(-166.43, -251.18)",d:"M 187.32 290.95 L 186.03 289.5 L 185.59 287.62 L 184.03 287.1 L 183.17 287.42 L 181.36 287.5 L 177.29 285.69 L 177.28 285.29 L 176.62 284.68 L 175.35 285.27 L 173.37 283.59 L 171.85 282.62 L 170.99 281.16 L 170.71 279.77 L 169.67 279.38 L 167.9 280.5 L 166.68 280.47 L 165.27 279.67 L 164.4 278.34 L 161.27 276.76 L 159.31 276.59 L 158.17 277.13 L 157.27 277.98 L 155.84 277.81 L 155.53 277.51 L 153.39 277 L 150.33 276.72 L 149.57 276.29 L 148.39 275.1 L 148.09 273.13 L 146.51 272.64 L 144.62 271.67 L 143.8 269.95 L 143.51 269.75 L 140.79 269.47 L 140.41 269.12 L 139.57 265.41 L 138.69 264.52 L 138.21 265.68 L 137.55 265.36 L 137.28 264.72 L 137.9 263.19 L 137.06 261.67 L 135.7 261.28 L 134.44 257.81 L 134.27 256.15 L 135.82 253.24 L 135.61 251.58 L 134.45 249.61 L 133.7 247.45 L 133.64 245.16 L 134.26 244.66 L 134.64 243.29 L 135.68 242.24 L 136.04 240.77 L 135.8 239.28 L 135.38 238.39 L 135.29 236.86 L 135.83 235.21 L 134.66 233.03 L 133.64 232.65 L 132.55 233.63 L 132.49 234.14 L 131.65 235.1 L 131.08 235.1 L 128.9 234.08 L 123.72 234.16 L 118.11 235.94 L 116.42 235.93 L 114.94 236.41 L 114.94 236.41 L 111.97 235.15 L 111.97 235.15 L 115.23 232.59 L 117.15 232.01 L 118.7 230.2 L 118.85 229.64 L 118.69 228.35 L 122.65 228.61 L 125.52 228.28 L 126.24 228.65 L 128.55 230.98 L 128.92 230.96 L 130.14 230.17 L 130.27 229.45 L 130.68 228.92 L 131.76 228.42 L 132.53 228.55 L 133.9 228.16 L 135.2 226.95 L 137.04 225.93 L 137.42 226.02 L 138.06 228.28 L 138.74 228.81 L 139.42 228.73 L 141.96 225.57 L 141.7 223.82 L 142.23 222.98 L 143.98 221.72 L 144.44 221.74 L 145.28 222.29 L 147.07 222.39 L 148.27 221.32 L 150.4 220.94 L 154.27 221.4 L 154.03 219.94 L 154.14 218.13 L 156.2 216.92 L 157.01 215.77 L 157.37 214.75 L 157.2 214.3 L 156.3 213.6 L 156.35 212.93 L 157.54 211.34 L 160.02 210.81 L 160.28 210.59 L 160.19 209.42 L 161.91 208.92 L 163.29 206.36 L 174.08 206.3 L 176.23 207.43 L 176.68 207.92 L 177.48 209.83 L 178.81 211.1 L 181.35 212.08 L 182.6 215.35 L 183.06 215.56 L 184.04 215.43 L 184.66 215.63 L 185.34 218.51 L 188.58 219.99 L 189.26 219.8 L 189.8 218.06 L 191.72 216.98 L 193.11 217.26 L 193.47 217.64 L 193.43 218.34 L 193.43 218.34 L 194.83 219.31 L 195.43 220.55 L 194.67 221.97 L 193.38 226.96 L 193.44 227.31 L 194.22 227.78 L 194.48 228.39 L 194.63 229.78 L 195.46 232.05 L 194.52 233.72 L 194.9 235.65 L 193.9 239.17 L 193.87 239.97 L 194.14 241.73 L 195.64 244.48 L 194.74 253.48 L 211.9 253.53 L 211.66 254.09 L 212.88 255.2 L 216.38 255.11 L 217.49 255.22 L 218.56 255.65 L 219.97 259.24 L 219.8 259.99 L 218.4 261.74 L 217.04 262.82 L 216.9 264.14 L 217.33 267.39 L 217.91 267.9 L 218.81 267.87 L 220.34 271.21 L 220.3 273.26 L 220.88 274.75 L 220.81 276.46 L 220.25 278.7 L 218.59 280.71 L 218.07 282.96 L 217.49 283.8 L 217.06 284.21 L 215.42 284.74 L 214.49 285.82 L 213.06 289.6 L 212.54 292.05 L 208.43 294.62 L 206.96 296.05 L 206.96 296.05 L 206.22 296.01 L 203.63 294.46 L 202.36 293.03 L 195.28 293.99 L 193.96 293.56 L 193.71 293.26 L 190.33 293.92 L 189.85 293.76 L 189.33 292.41 z"},{code:"RR",name:"Roraima",gTransform:"matrix(1 0 0 1 -116.08 -267.27)",pathTransform:"translate(-189.92, -51.99)",d:"M 234.61 61.4 L 236.21 78.37 L 236.21 78.37 L 217.72 78.3 L 217.75 78.98 L 215.42 82.24 L 213.76 85.27 L 213.69 86.4 L 212.54 89.04 L 212.43 89.7 L 212.66 90.43 L 213.8 91.84 L 213.78 92.37 L 213.36 92.76 L 211.33 93.31 L 209.92 94.72 L 208.67 95.18 L 206.85 94.95 L 205.93 92.44 L 204.06 90.4 L 201.23 89.47 L 199.63 89.53 L 199.08 90.42 L 196.99 91.13 L 195.71 91.82 L 194.69 93.08 L 193.87 96.05 L 194.24 97.85 L 193.99 99.58 L 193.24 101.87 L 193.68 103.98 L 191.32 102.94 L 189.98 103.36 L 189.45 103.29 L 188.41 101.25 L 186.93 99.6 L 184.97 98.29 L 184.45 98.25 L 179.44 93.83 L 179.58 92.69 L 181.42 93.02 L 182.56 91.7 L 182.62 91.12 L 181.49 86.79 L 180.91 85.89 L 179.69 85.05 L 178.81 82.88 L 178.52 77.9 L 179.09 76.94 L 179.86 73.9 L 179.2 72.32 L 178.84 70.73 L 180.46 69.27 L 180.41 68.82 L 179.54 67.7 L 179.35 65.44 L 177.69 60.68 L 174.96 56.94 L 175.67 55.44 L 176.58 52.12 L 176.09 51.46 L 174.14 50.51 L 172.78 50.4 L 171.9 50.61 L 170.93 50.24 L 169.72 49.07 L 169.66 48.11 L 169.03 48 L 167.9 48.42 L 167.29 48.41 L 166.54 48.07 L 165.82 47.29 L 165.82 47.29 L 166.12 46.83 L 166.35 44.55 L 166.05 44.33 L 162.68 44.1 L 158.93 44.24 L 155.62 43.54 L 155.42 42.94 L 156.22 41.18 L 156.34 39.7 L 155.61 37.93 L 153.67 34.39 L 152.94 32.33 L 152.47 28.61 L 153.26 27.13 L 153.18 26.17 L 151.34 24.17 L 149.18 23.11 L 146.37 20.33 L 145.31 18.52 L 145.02 17.56 L 143.88 16.91 L 143.63 16.52 L 143.66 15.68 L 143.95 15.35 L 144.85 15.42 L 145.97 16.08 L 146.91 17.81 L 147.52 17.9 L 150.91 17.4 L 152.26 17.5 L 154.17 18.09 L 154.78 19.29 L 155.33 21.22 L 155.87 21.57 L 156.83 21.49 L 157.57 20.84 L 158.52 20.44 L 161.7 20.6 L 162.17 20.65 L 163.48 21.86 L 164.08 22.01 L 164.6 21.87 L 165.21 20.31 L 166.52 20.45 L 167.97 21.38 L 171.9 25.95 L 172.95 26.52 L 173.66 26.63 L 175.17 25.95 L 175.91 24.82 L 176.01 23.98 L 175.18 21.22 L 175.54 19.48 L 176 19.2 L 177.93 19.15 L 178.94 18.05 L 180.49 16.96 L 181.24 17.01 L 185.14 18.35 L 185.73 18.18 L 186.53 17.46 L 187.56 17.16 L 188.69 17.51 L 189.72 17.3 L 191.06 16.02 L 192.06 15.77 L 193.21 16 L 194.32 15.93 L 195 15.08 L 195.05 13.73 L 198.08 11.92 L 200.41 12.11 L 203.17 11.72 L 204.06 10.59 L 204.15 9.88 L 204.74 8.76 L 205.49 8.63 L 207.34 7.73 L 208.44 6.69 L 209.55 4.98 L 208.35 1.42 L 207.18 1.06 L 207.82 0.88 L 209.25 0.95 L 210.05 1.27 L 213.62 1.17 L 214.68 0.22 L 215.42 0 L 216.79 0.42 L 217.32 1.73 L 218.36 2.53 L 218.84 3.9 L 218.17 8.8 L 217.45 10.18 L 216.2 10.88 L 216.26 11.71 L 217.87 12.12 L 219.49 11.9 L 221.84 12.71 L 223.66 13.81 L 222.78 15.24 L 222.77 16.39 L 225.11 19.81 L 225.31 21.36 L 223.8 24.28 L 221.92 25.69 L 221.2 27.19 L 221.47 27.58 L 221.53 29.75 L 220.06 32.16 L 219.16 34.93 L 218.85 37.5 L 218.76 40.17 L 219.74 42.04 L 220.25 43.8 L 220.24 45.2 L 221.81 46.23 L 222.71 46.43 L 222.84 47.11 L 222.38 52.26 L 222.5 53 L 224.31 53.29 L 223.65 54.46 L 224.11 54.96 L 226.26 55.7 L 227.72 57.62 L 230.38 60.36 z"},{code:"RS",name:"Rio Grande do Sul",gTransform:"matrix(1 0 0 1 11.62 259.25)",pathTransform:"translate(-317.63, -578.5)",d:"M 321.99 638.52 L 321.63 638.53 L 319.69 637.42 L 319.49 636.96 L 320.01 632.69 L 319.55 628.44 L 319.7 627.37 L 320.33 626.13 L 323.17 623.75 L 324 622.19 L 326.3 619.63 L 324.84 617.98 L 323.77 617.36 L 321.52 616.76 L 319.2 614.51 L 317.99 612.89 L 317.89 611.3 L 317.46 610.12 L 316.23 608.09 L 314.17 605.85 L 313.5 605.26 L 311.11 604.05 L 309.66 604.26 L 307.76 602.75 L 306.24 601.12 L 304.99 600.34 L 304.85 598.64 L 302.95 596.48 L 299.63 596.02 L 298.71 595.55 L 296.98 593.89 L 295.22 594.02 L 293.05 592.64 L 291.14 588.93 L 290.03 587.44 L 287.5 585.32 L 286.8 585.4 L 286.13 587.19 L 283.54 589.43 L 280.87 589.55 L 280.97 586.69 L 281.37 585.41 L 280.98 584.41 L 277.33 580.12 L 274.96 578.35 L 272.78 576.29 L 271.03 574.18 L 268.34 571.97 L 266.44 571.83 L 264.29 572.04 L 263.15 573.4 L 263.09 574.36 L 262.06 575.33 L 260.95 575.35 L 260.37 574.87 L 257.21 575.01 L 256.56 574.53 L 256.4 573.62 L 255.91 573.4 L 256.76 573.18 L 257.8 572.46 L 260.32 569.69 L 260.43 567.85 L 261.03 566.6 L 261.85 566.15 L 263.14 566.08 L 263.78 565.82 L 264.7 564.82 L 270.15 558.34 L 270.78 556.92 L 270.95 555.81 L 271.77 554.74 L 272.97 553.89 L 274.34 553.48 L 276.3 549.26 L 276.4 548.65 L 276.71 548.28 L 278.35 547.42 L 279.98 545.62 L 280.83 544.47 L 281.34 543.18 L 282.68 541.08 L 283.61 540.79 L 285.18 540.97 L 285.73 541.76 L 286.2 540.48 L 285.99 539.9 L 284.64 539.08 L 284.59 538.72 L 284.94 538.39 L 286.02 538.01 L 286.84 537.05 L 289.63 536.1 L 290.68 535.03 L 290.78 534.11 L 291.6 533.2 L 293.81 532.05 L 296.28 531.65 L 298.05 529.84 L 298.2 528.78 L 299.52 526.42 L 299.85 526.38 L 299.9 526.74 L 300.19 526.94 L 301.52 526.77 L 303.96 525.64 L 306.64 525.05 L 307.85 524.48 L 309.95 522.13 L 310.45 522.14 L 311.12 521.75 L 312.13 520.4 L 314.44 519.67 L 314.74 520.05 L 314.74 520.05 L 318.26 520.44 L 321.52 519.29 L 322.08 518.48 L 323.43 519.06 L 323.28 519.98 L 326.36 519.95 L 327.99 520.94 L 330.55 520.57 L 332.47 521.72 L 335.05 521.31 L 336.59 521.49 L 339.39 521.33 L 341.65 522.25 L 344.13 523.65 L 345.13 526.09 L 346.72 526.28 L 346.81 525.8 L 348.62 525.45 L 354.18 528.99 L 355.55 530.54 L 356.26 530.51 L 357.82 531.49 L 360.85 534.98 L 362.49 537.19 L 362.97 538.67 L 365.14 541.33 L 366.31 541.88 L 373 542.94 L 375.11 542.54 L 378.46 542.88 L 379.34 545.22 L 377.26 546.8 L 375.99 547.21 L 375.26 549.07 L 375.48 551.26 L 375.1 552.82 L 374.58 554.12 L 373.4 554.32 L 372.11 556.01 L 372.08 557.42 L 373.88 558.59 L 374.15 558.39 L 373.87 557.42 L 373.88 556.46 L 375.37 555.64 L 376.95 556.28 L 377.68 557.19 L 378.85 558.04 L 379.3 558.01 L 379.3 558.01 L 377.9 559.74 L 374 566.78 L 369.79 578.38 L 363.49 588.86 L 358.05 595.52 L 351.54 601.48 L 345.45 605.16 L 342.35 609.47 L 342.17 609.04 L 342.82 607.46 L 343.16 605.28 L 341.98 603.57 L 342.08 603.15 L 343.01 602.98 L 344.02 603.38 L 344.58 603.96 L 345.6 604 L 348.18 602.59 L 349 601.91 L 351.85 598.2 L 352.6 597.51 L 353.05 597.7 L 354.07 597.51 L 355.12 596.67 L 356.05 595.4 L 356.42 593.92 L 356.6 592.99 L 356.37 590.89 L 356.57 589.52 L 358.14 589.45 L 358.88 589.75 L 359.15 590.58 L 359.5 590.32 L 359.21 588.92 L 359.72 586.85 L 360.2 586.28 L 362.94 584.69 L 363.67 583.61 L 364.14 580.86 L 363.93 578.58 L 364.49 577.9 L 364.99 578.7 L 365.36 578.73 L 365.79 578.31 L 366.26 575.23 L 366.16 574.79 L 365.21 573.57 L 364.54 573.54 L 364.28 574.23 L 364.45 574.62 L 364.31 575.19 L 363.96 575.39 L 362.45 575.37 L 360.44 575.77 L 360.1 577.38 L 359.57 577.43 L 358.76 576.99 L 358.86 575.28 L 358.04 574.39 L 357 574.72 L 356.4 574.24 L 355.67 572.98 L 355.27 571.53 L 355.39 570.96 L 354.75 570.27 L 354.14 572.98 L 354.58 575.23 L 355.83 577.34 L 355.26 578.15 L 354.52 580.69 L 354.9 583.72 L 354.72 584.49 L 354.24 584.12 L 354.5 583.88 L 354.47 583.17 L 354 581.89 L 353.55 581.5 L 353.02 582.16 L 352.99 583.53 L 351.58 586.8 L 351.53 588.69 L 351.75 589.21 L 351.03 589.91 L 349.42 590.55 L 348.81 592.13 L 344.72 593.7 L 344 594.23 L 343.47 595.82 L 343.37 598.09 L 342.4 600.36 L 340.04 601.66 L 339.93 603.42 L 340.41 604.25 L 340.66 605.27 L 339.71 605.83 L 339.46 607.34 L 339.89 607.94 L 340.57 607.8 L 341.87 608.43 L 342.02 609.34 L 339.89 610.99 L 337.57 615.51 L 335.64 622.39 L 333.63 626.88 L 331.95 629.4 L 324.16 636.93 z"},{code:"SC",name:"Santa Catarina",gTransform:"matrix(1 0 0 1 51.41 209.71)",pathTransform:"translate(-357.4, -528.97)",d:"M 379.3 558.01 L 378.85 558.04 L 377.68 557.1899999999999 L 376.95 556.27 L 375.36 555.64 L 373.88 556.46 L 373.87 557.4200000000001 L 374.15 558.3900000000001 L 373.88 558.5900000000001 L 372.08 557.4200000000002 L 372.12 556.0100000000002 L 373.4 554.3200000000002 L 374.58 554.1200000000001 L 375.10999999999996 552.8100000000002 L 375.47999999999996 551.2600000000002 L 375.25999999999993 549.0700000000002 L 375.98999999999995 547.2100000000002 L 377.25999999999993 546.7900000000002 L 379.3399999999999 545.2100000000002 L 378.4599999999999 542.8700000000001 L 375.1099999999999 542.5300000000001 L 372.9999999999999 542.9300000000001 L 366.3099999999999 541.8700000000001 L 365.14999999999986 541.3300000000002 L 362.97999999999985 538.6700000000002 L 362.48999999999984 537.1900000000002 L 360.85999999999984 534.9800000000001 L 357.82999999999987 531.4900000000001 L 356.2599999999999 530.5000000000001 L 355.5499999999999 530.5300000000001 L 354.1799999999999 528.9800000000001 L 348.6199999999999 525.4400000000002 L 346.8099999999999 525.7800000000002 L 346.7199999999999 526.2600000000002 L 345.1199999999999 526.0700000000002 L 344.1199999999999 523.6300000000001 L 341.64999999999986 522.2400000000001 L 339.3799999999999 521.3100000000002 L 336.58999999999986 521.4700000000001 L 335.04999999999984 521.2900000000002 L 332.45999999999987 521.7000000000002 L 330.54999999999984 520.5500000000002 L 327.97999999999985 520.9100000000002 L 326.34999999999985 519.9300000000002 L 323.26999999999987 519.9600000000002 L 323.41999999999985 519.0300000000002 L 322.0699999999998 518.4500000000002 L 321.5099999999998 519.2600000000001 L 318.24999999999983 520.4200000000001 L 314.72999999999985 520.0300000000001 L 314.72999999999985 520.0300000000001 L 316.17999999999984 517.1000000000001 L 316.90999999999985 515.0100000000001 L 316.32999999999987 511.7600000000001 L 316.7399999999999 508.5500000000001 L 316.6999999999999 506.0000000000001 L 317.65999999999985 504.2500000000001 L 317.65999999999985 504.2500000000001 L 321.28999999999985 504.2700000000001 L 321.99999999999983 503.8900000000001 L 322.5299999999998 503.9000000000001 L 323.5899999999998 504.1400000000001 L 323.8999999999998 504.6500000000001 L 325.9299999999998 506.0600000000001 L 328.6099999999998 506.0900000000001 L 330.94999999999976 505.5100000000001 L 336.2399999999998 507.1900000000001 L 340.4999999999998 507.5500000000001 L 341.51999999999975 508.1800000000001 L 341.68999999999977 508.59000000000015 L 343.25999999999976 509.77000000000015 L 347.02999999999975 510.19000000000017 L 351.27999999999975 510.0600000000002 L 352.60999999999973 511.96000000000015 L 352.78999999999974 511.46000000000015 L 353.52999999999975 511.08000000000015 L 354.44999999999976 511.0600000000002 L 355.31999999999977 510.20000000000016 L 354.46999999999974 507.21000000000015 L 355.15999999999974 505.63000000000017 L 355.87999999999977 504.8500000000002 L 357.87999999999977 503.7100000000002 L 361.44999999999976 504.1100000000002 L 363.31999999999977 503.14000000000016 L 364.0499999999998 502.27000000000015 L 364.63999999999976 500.79000000000013 L 366.16999999999973 500.14000000000016 L 367.27999999999975 500.00000000000017 L 368.69999999999976 500.76000000000016 L 369.50999999999976 500.79000000000013 L 371.83999999999975 500.6200000000001 L 374.6799999999997 499.8900000000001 L 375.4299999999997 499.9000000000001 L 376.46999999999974 500.30000000000007 L 379.58999999999975 502.9000000000001 L 380.81999999999977 503.5200000000001 L 382.25999999999976 503.6800000000001 L 385.6099999999998 501.5500000000001 L 386.9599999999998 500.1200000000001 L 388.5199999999998 499.5500000000001 L 388.6399999999998 499.9400000000001 L 389.3999999999998 500.0100000000001 L 391.1399999999998 499.7800000000001 L 391.4699999999998 499.3400000000001 L 396.7099999999998 499.37000000000006 L 396.7099999999998 499.37000000000006 L 396.3199999999998 500.69000000000005 L 396.8299999999998 502.34000000000003 L 396.7599999999998 502.73 L 395.2599999999998 503.87 L 394.2799999999998 503.39 L 393.4599999999998 500.86 L 393.4399999999998 501.98 L 394.0299999999998 504.70000000000005 L 395.7399999999998 506.36000000000007 L 396.2999999999998 507.31000000000006 L 395.2899999999998 509.6000000000001 L 395.12999999999977 511.9200000000001 L 395.2299999999998 512.35 L 395.9899999999998 513.08 L 396.2499999999998 518.94 L 396.5599999999998 519.49 L 396.9899999999998 519.69 L 397.75999999999976 519.1800000000001 L 398.1099999999998 519.9000000000001 L 398.2099999999998 520.7700000000001 L 397.7399999999998 520.83 L 397.3099999999998 520.5500000000001 L 396.1199999999998 521.1800000000001 L 395.7799999999998 525.0200000000001 L 396.3499999999998 527.6100000000001 L 395.7799999999998 528.3600000000001 L 396.0899999999998 530.2900000000001 L 396.99999999999983 532.1700000000001 L 396.1399999999998 534.5100000000001 L 395.61999999999983 538.5200000000001 L 393.90999999999985 543.2 L 393.5699999999999 543.1 L 393.20999999999987 542.34 L 393.41999999999985 541.37 L 392.49999999999983 540.19 L 392.23999999999984 540.5200000000001 L 392.41999999999985 542.95 L 393.57999999999987 543.7800000000001 L 392.65999999999985 545.44 L 391.01999999999987 546.09 L 386.8899999999999 549.13 L 384.08999999999986 551.6899999999999 L 380.33999999999986 556.13 L 379.3 558.01 z M 397.18 531.46 L 397.03000000000003 530.99 L 397.28000000000003 529.24 L 398.04 526.84 L 397.64000000000004 525.6600000000001 L 397.80000000000007 524.6400000000001 L 399.20000000000005 523.8800000000001 L 399.4200000000001 523.94 L 400.0800000000001 524.8800000000001 L 399.5400000000001 527.44 L 398.7200000000001 528.3000000000001 L 398.1300000000001 529.5200000000001 L 398.3300000000001 530.69 L 397.18 531.46 z M 396.73 507.09 L 394.86 505.07 L 397.41 502.63 L 397.66 502.67 L 398.31 503.72 L 397.45 505.04 L 396.73 507.09 z"},{code:"SE",name:"Sergipe",gTransform:"matrix(1 0 0 1 266.49 -72.82)",pathTransform:"translate(-572.49, -246.44)",d:"M 569.94 261.69 L 567.04 262.58 L 565.49 261.94 L 564.95 261.6 L 564.47 260.88 L 562.55 259.96 L 561.95 259.44 L 561.83 259.03 L 562.17 258.64 L 562.3 257.22 L 562.15 256.83 L 560.72 255.32 L 560.2 253.83 L 559.11 253.16 L 558.15 251.56 L 558.13 250.79 L 558.72 249.21 L 559.04 248.91 L 560.74 248.92 L 561.87 249.67 L 564.42 248.68 L 565.11 248.13 L 565.41 247.55 L 564.65 244.8 L 564.73 243.92 L 565.39 242.3 L 565.47 239.19 L 564.72 238.04 L 562.73 236.09 L 561.46 233.59 L 561.24 231.45 L 561.91 230.3 L 561.91 230.3 L 568.37 233.28 L 572.05 234.23 L 577.47 237.3 L 578.77 239.75 L 580.53 241.2 L 582.19 241.99 L 582.65 242.02 L 586.24 244.25 L 586.84 245.56 L 586.84 245.56 L 584.46 246.32 L 579.89 249.26 L 578.92 250.15 L 577.37 252.36 L 577.05 252.34 L 577.16 251.24 L 576.11 249.42 L 575.12 249.58 L 575.46 250.74 L 576.7 250.74 L 576.93 250.98 L 576.41 252.95 L 575.14 255.04 L 574.61 254.69 L 574.24 254.02 L 573.25 253.86 L 573.45 254.54 L 574.58 255.16 L 574.32 256.93 L 573.46 258.08 L 572.53 260.11 L 571.75 260.26 L 571.45 259.8 L 571.93 258.4 L 572.34 258.27 L 572.65 257.84 L 573.02 256.8 L 572.21 256.43 L 572.31 257.11 L 571.86 258.24 L 571.38 258.74 L 571.12 259.83 L 571.4 260.55 L 571.14 261.07 z"},{code:"SP",name:"São Paulo",gTransform:"matrix(1 0 0 1 89.6 122.15)",pathTransform:"translate(-395.6, -441.42)",d:"M 404.58 487.92 L 404.41999999999996 486.59000000000003 L 402.99999999999994 486.02000000000004 L 402.2699999999999 482.72 L 402.6699999999999 480.77000000000004 L 400.5299999999999 480.19000000000005 L 399.7699999999999 480.36000000000007 L 398.6699999999999 483.13000000000005 L 398.0099999999999 483.9800000000001 L 396.9499999999999 483.4500000000001 L 396.59999999999985 482.67000000000013 L 397.28999999999985 479.3700000000001 L 398.17999999999984 478.7100000000001 L 398.3199999999998 478.3100000000001 L 396.7099999999998 477.04000000000013 L 395.11999999999983 476.91000000000014 L 393.53999999999985 477.10000000000014 L 393.03999999999985 476.72000000000014 L 389.6299999999998 477.2500000000001 L 387.24999999999983 477.3700000000001 L 386.23999999999984 477.16000000000014 L 385.6399999999998 476.77000000000015 L 385.30999999999983 474.73000000000013 L 386.5899999999998 472.6100000000001 L 386.8399999999998 471.5600000000001 L 386.5899999999998 471.1200000000001 L 385.9899999999998 470.8200000000001 L 385.06999999999977 468.8500000000001 L 385.12999999999977 467.9600000000001 L 384.62999999999977 467.2800000000001 L 383.95999999999975 466.99000000000007 L 382.7499999999998 465.8500000000001 L 381.25999999999976 462.8400000000001 L 381.6199999999998 462.2900000000001 L 381.69999999999976 460.5300000000001 L 380.39999999999975 459.0100000000001 L 380.01999999999975 457.17000000000013 L 380.18999999999977 456.3600000000001 L 380.57999999999976 455.78000000000014 L 380.5599999999998 453.04000000000013 L 379.6699999999998 451.28000000000014 L 376.0799999999998 448.45000000000016 L 374.9499999999998 446.90000000000015 L 371.9799999999998 447.76000000000016 L 366.6699999999998 447.63000000000017 L 366.00999999999976 447.09000000000015 L 364.3599999999998 446.95000000000016 L 363.93999999999977 447.29000000000013 L 362.21999999999974 447.22000000000014 L 361.4999999999997 445.90000000000015 L 360.8699999999997 445.39000000000016 L 357.35999999999973 444.59000000000015 L 355.60999999999973 443.75000000000017 L 354.82999999999976 442.75000000000017 L 352.2499999999998 442.76000000000016 L 351.1799999999998 443.3000000000002 L 349.8599999999998 443.1700000000002 L 347.2199999999998 442.0800000000002 L 344.6899999999998 441.62000000000023 L 343.2099999999998 440.8300000000002 L 342.0399999999998 440.5400000000002 L 341.3099999999998 440.9100000000002 L 340.9699999999998 441.5100000000002 L 339.7599999999998 442.1300000000002 L 336.47999999999985 441.8400000000002 L 332.46999999999986 441.9500000000002 L 328.6399999999999 441.30000000000024 L 325.3899999999999 443.59000000000026 L 325.3899999999999 443.59000000000026 L 326.22999999999985 442.5100000000003 L 326.95999999999987 440.97000000000025 L 328.21999999999986 439.83000000000027 L 335.77999999999986 435.29000000000025 L 337.72999999999985 433.42000000000024 L 338.98999999999984 430.99000000000024 L 340.71999999999986 429.30000000000024 L 341.11999999999983 428.09000000000026 L 342.55999999999983 427.0600000000003 L 342.8399999999998 425.84000000000026 L 342.4899999999998 425.0000000000003 L 344.4899999999998 422.7400000000003 L 345.69999999999976 420.4000000000003 L 345.76999999999975 419.4600000000003 L 345.45999999999975 417.5300000000003 L 345.68999999999977 417.1400000000003 L 346.64999999999975 416.62000000000035 L 349.2499999999998 412.98000000000036 L 349.4099999999998 410.05000000000035 L 350.0299999999998 408.37000000000035 L 351.0399999999998 408.07000000000033 L 351.7699999999998 407.43000000000035 L 353.7599999999998 404.75000000000034 L 354.97999999999985 403.73000000000036 L 355.4499999999999 403.50000000000034 L 356.7599999999999 403.4600000000003 L 358.2599999999999 402.68000000000035 L 358.53999999999985 402.28000000000037 L 358.9399999999998 399.8200000000004 L 358.9399999999998 399.8200000000004 L 360.15999999999985 398.6900000000004 L 362.30999999999983 397.5800000000004 L 364.22999999999985 397.2100000000004 L 365.65999999999985 395.5200000000004 L 367.15999999999985 394.91000000000037 L 367.90999999999985 395.05000000000035 L 369.6399999999999 396.60000000000036 L 372.1899999999999 396.68000000000035 L 376.4799999999999 397.6400000000003 L 378.1499999999999 397.2800000000003 L 379.7699999999999 397.50000000000034 L 381.7699999999999 396.91000000000037 L 383.94999999999993 398.3300000000004 L 385.61999999999995 399.1200000000004 L 385.48999999999995 400.0400000000004 L 385.81999999999994 401.46000000000043 L 387.0299999999999 403.5500000000004 L 387.6599999999999 403.5800000000004 L 388.19999999999993 403.2600000000004 L 388.86999999999995 402.3200000000004 L 389.28 401.1900000000004 L 389.53999999999996 401.0000000000004 L 390.09 401.0500000000004 L 390.45 401.4400000000004 L 390.7 402.4000000000004 L 390.71 405.18000000000035 L 391.90999999999997 405.7100000000003 L 392.32 405.26000000000033 L 392.05 402.7200000000003 L 392.54 401.5300000000003 L 392.99 401.0500000000003 L 401.17 400.3800000000003 L 402.18 399.1300000000003 L 403.68 400.59000000000026 L 404.8 401.02000000000027 L 407.58 400.33000000000027 L 408.02 399.34000000000026 L 407.82 398.8800000000003 L 408.13 398.27000000000027 L 410.51 398.16000000000025 L 412.17 398.9400000000002 L 413.02000000000004 398.30000000000024 L 414.33000000000004 398.0100000000002 L 417.59000000000003 401.36000000000024 L 417.79 402.40000000000026 L 417.22 403.41000000000025 L 416.93 405.78000000000026 L 417.51 406.39000000000027 L 419.4 407.60000000000025 L 419.79999999999995 409.15000000000026 L 419.73999999999995 409.71000000000026 L 418.21999999999997 411.74000000000024 L 418.03999999999996 413.68000000000023 L 418.83 414.42000000000024 L 419.14 415.03000000000026 L 419.51 417.24000000000024 L 420.81 419.04000000000025 L 421.64 421.03000000000026 L 421.61 421.8800000000003 L 423.22 421.83000000000027 L 424 421.52000000000027 L 424.28 421.16000000000025 L 425.28 421.11000000000024 L 428.97999999999996 422.43000000000023 L 429.21 422.80000000000024 L 429.15999999999997 424.0700000000002 L 428.46 426.2500000000002 L 426.59999999999997 428.97000000000025 L 426.85999999999996 431.91000000000025 L 426.66999999999996 435.36000000000024 L 426.14 436.92000000000024 L 426.86 438.52000000000027 L 428.64 439.7600000000003 L 430.45 440.59000000000026 L 430.96 442.3100000000003 L 429.75 443.0100000000003 L 431.77 446.3200000000003 L 432.9 446.5700000000003 L 434.90999999999997 446.33000000000027 L 435.09 446.86000000000024 L 438.71 445.86000000000024 L 439.27 446.28000000000026 L 440.58 445.96000000000026 L 441.33 444.98000000000025 L 441.38 444.14000000000027 L 441.14 443.90000000000026 L 441.31 441.60000000000025 L 442.5 441.27000000000027 L 442.59 441.6200000000003 L 442.23999999999995 442.1100000000003 L 442.24999999999994 442.5900000000003 L 444.5899999999999 442.6700000000003 L 446.9799999999999 442.4200000000003 L 448.7699999999999 441.7500000000003 L 449.99999999999994 440.5100000000003 L 451.92999999999995 439.4900000000003 L 454.13999999999993 439.27000000000027 L 455.37999999999994 438.54000000000025 L 455.37999999999994 438.54000000000025 L 456.6499999999999 439.08000000000027 L 457.2099999999999 440.2500000000003 L 458.43999999999994 441.84000000000026 L 460.2099999999999 442.23000000000025 L 463.3599999999999 441.7000000000003 L 465.0599999999999 441.71000000000026 L 465.8099999999999 443.35000000000025 L 464.1599999999999 445.5000000000002 L 462.6599999999999 446.2100000000002 L 459.88999999999993 446.5700000000002 L 459.38999999999993 446.42000000000024 L 457.0399999999999 447.43000000000023 L 455.94999999999993 448.5800000000002 L 454.85999999999996 452.0800000000002 L 454.90999999999997 452.49000000000024 L 456.53999999999996 454.22000000000025 L 457.02 454.48000000000025 L 457.02 454.48000000000025 L 456.96 454.68000000000023 L 455.27 455.10000000000025 L 454.21 454.28000000000026 L 452.72999999999996 455.39000000000027 L 452.29999999999995 456.04000000000025 L 452.56999999999994 456.2600000000003 L 451.80999999999995 456.90000000000026 L 448.5899999999999 458.4500000000003 L 446.3399999999999 459.15000000000026 L 446.05999999999995 459.59000000000026 L 446.09999999999997 460.55000000000024 L 446.59999999999997 462.10000000000025 L 446.28 462.52000000000027 L 444.88 462.78000000000026 L 444.18 462.14000000000027 L 442.84000000000003 461.85000000000025 L 439.72 461.35000000000025 L 438.86 461.5000000000002 L 437.54 461.8400000000002 L 435.81 462.6600000000002 L 435.31 463.1700000000002 L 434.1 465.32000000000016 L 432.79 465.89000000000016 L 432.29 465.77000000000015 L 432.87 465.3000000000001 L 432.39 464.0800000000001 L 431.21999999999997 463.2300000000001 L 430.39 464.4600000000001 L 430.65 465.2100000000001 L 430.34999999999997 465.8200000000001 L 422.72999999999996 470.0600000000001 L 421.78 470.8800000000001 L 421.46999999999997 472.04000000000013 L 418.2 475.04000000000013 L 414.95 476.9900000000001 L 413.03 477.5200000000001 L 408.53 480.7300000000001 L 406.2 482.69000000000005 L 405.53 482.77000000000004 L 405.09 483.39000000000004 L 405.98999999999995 483.82000000000005 L 406.65 483.88000000000005 L 407.58 483.52000000000004 L 407.58 484.28000000000003 L 406.96 485.59000000000003 L 405.64 486.44000000000005 L 404.58 487.92 z M 448.89 464.91 L 447.34999999999997 464.26000000000005 L 446.18999999999994 464.44000000000005 L 445.69999999999993 464.06000000000006 L 445.79999999999995 463.2800000000001 L 446.74999999999994 462.6300000000001 L 447.8399999999999 460.7800000000001 L 448.55999999999995 461.0300000000001 L 449.21999999999997 461.68000000000006 L 449.34999999999997 464.5900000000001 L 448.89 464.91 z"},{code:"TO",name:"Tocantins",gTransform:"matrix(1 0 0 1 95.98 -93.17)",pathTransform:"translate(-401.98, -226.09)",d:"M 433.35 281.82 L 427.99 283.24 L 426.25 284.58 L 423.69 285.68 L 422.14 285.68 L 417.61 286.68 L 415.09 288.76 L 413.31 289.66 L 412.85 289.42 L 411.34 286.8 L 410.79 286.77 L 410.28 290.07 L 409.59 290.15 L 406.24 289.47 L 403.11 288 L 403.67 286.44 L 403.45 285.7 L 398.92 286.23 L 396.16 285.89 L 395.6 286.43 L 395.3 287.43 L 394.55 288.18 L 393.41 288.13 L 392.8 285.03 L 391.69 281.32 L 390.65 279.44 L 389.5 278.13 L 388.32 279.1 L 386.85 281.49 L 385.22 287.43 L 384.59 287.66 L 380.52 286.23 L 377.43 284.52 L 373.5 284.12 L 371.3 283.09 L 368.9 282.69 L 369.42 280.35 L 370.64 278.47 L 370.67 276.76 L 370.11 277.06 L 368.3 279.15 L 367.64 280.38 L 367.44 282.26 L 367.1 282.71 L 367.1 282.71 L 366.3 282.69 L 365.34 282.18 L 364.36 278.84 L 365.1 276.08 L 364.66 273.03 L 364.14 272.45 L 364.13 270.88 L 364.6 267.57 L 363.5 265.32 L 363.55 264.82 L 364.37 263.93 L 364.53 263.06 L 363.14 261.72 L 363.08 260.86 L 364.96 254.87 L 365 251.92 L 365.54 248.95 L 367.48 243.66 L 367.85 243.39 L 368.28 242.54 L 368.72 239.4 L 369.82 238.15 L 370.38 236.26 L 371.03 235.24 L 371.03 235.24 L 372.65 231.55 L 373.78 227.1 L 374.93 225.52 L 376.12 224.42 L 377.33 222.74 L 378.36 220.82 L 379.73 219.9 L 380.78 219.74 L 381.51 218.89 L 382.45 217.35 L 382.63 216.36 L 384.33 213.12 L 385.42 212.32 L 387.18 207.17 L 387.84 203.13 L 387.69 202.83 L 386.95 202.51 L 385.28 200.77 L 384.68 199.82 L 384.52 198.94 L 384.66 198.37 L 386.07 196.68 L 387.36 194.58 L 387.3 191.91 L 386.87 189.73 L 387.06 189.38 L 389.53 187.6 L 392.94 186.46 L 395.44 185.25 L 395.68 184.75 L 395.53 183.24 L 396.39 181.97 L 397.9 180.63 L 399.19 180.48 L 399.38 179.14 L 399.09 177.94 L 399.34 177.48 L 400.8 177.02 L 401.44 176.54 L 402.37 173.79 L 401.35 172.45 L 401.26 171.05 L 401.55 170.77 L 402.52 170.69 L 403.24 170.32 L 403.61 169.66 L 403.64 169.02 L 402.38 167.85 L 401.51 167.71 L 401.12 167.4 L 400.1 165.74 L 398.81 165.62 L 396.94 165.87 L 394.65 165.06 L 394.65 165.06 L 395.18 164.42 L 397.8 162.57 L 399.76 162.04 L 400.63 162.09 L 403.41 163.61 L 404.81 163.69 L 405.76 163.17 L 407.5 163.46 L 408.09 164.15 L 408.17 165.18 L 408.45 165.5 L 409.67 165.53 L 413.07 166.96 L 413.91 167.99 L 414.38 171.49 L 415.02 172.99 L 414.81 176.71 L 415.04 177.79 L 415.71 178.92 L 415.7 179.36 L 413.93 185.51 L 413.62 187.88 L 413.9 188.88 L 413.65 190.47 L 411.9 192.51 L 410.14 193.18 L 409.96 193.89 L 411.9 195.21 L 412.32 194.94 L 413.69 195.18 L 413.94 195.53 L 414.05 196.41 L 413.43 197.6 L 414.28 199.04 L 415.16 198.97 L 418.16 203.13 L 419.07 203.98 L 421.35 207 L 423.49 205.66 L 427.76 204.72 L 429.56 205.94 L 429.64 207.69 L 429 210.94 L 429.39 212.29 L 426 212.64 L 424.66 213.18 L 424.09 213.73 L 423.41 215.16 L 422.68 217.84 L 423.05 219.14 L 420.42 221.69 L 420.16 222.39 L 420.36 222.81 L 422.44 223.1 L 423.38 223.79 L 424.12 225.38 L 424.18 227.04 L 424.8 228.08 L 428.68 230.03 L 428.77 230.56 L 427.13 232.37 L 427.26 234.02 L 429.4 235.64 L 430.39 238.51 L 431.73 240.51 L 432.44 240.69 L 434.22 240.48 L 435.22 240.78 L 436.04 241.22 L 436.65 242.04 L 437.93 242.7 L 437.93 242.7 L 440.87 242.91 L 440.87 242.91 L 440.18 243.56 L 439.96 244.54 L 439.4 245.01 L 435.58 247.03 L 432.37 249.65 L 432.18 250.02 L 433.47 251.82 L 433.11 252.21 L 432.1 252.48 L 431.2 253.09 L 429.68 256.58 L 428.67 257.3 L 428.17 258.46 L 428.4 259.38 L 430.26 261.33 L 433.85 262 L 435.72 262.99 L 435.77 263.75 L 435.21 264.2 L 433.17 265.01 L 432.74 265.97 L 432.83 266.47 L 433.18 266.8 L 434.21 266.62 L 435.13 266.91 L 435.71 267.42 L 436 268.06 L 435.04 268.77 L 433.89 269.19 L 431.94 270.86 L 431.75 271.71 L 431.7 274.63 L 432.05 275.88 L 432.99 276.54 L 434.04 276.78 L 434.45 277.03 L 434.62 277.45 L 434.67 278.51 L 433.31 280.89 z"}];function xL({selected:t,onSelect:e}){const[s,i]=M.useState(LL),r=o=>{if(o)try{const a=o.getBBox();if(!a.width||!a.height)return;const l=Math.max(a.width,a.height)*.04,d=`${a.x-l} ${a.y-l} ${a.width+l*2} ${a.height+l*2}`;i(c=>c===d?c:d)}catch{}};return n.jsx("svg",{ref:r,viewBox:s,role:"group","aria-label":"Map of Brazil — select a state",className:"h-72 w-full rounded-md border border-border/60 bg-muted/20",children:n.jsx("g",{transform:vL,children:p9.map(o=>{const a=o.code===t;return n.jsx("g",{transform:o.gTransform,children:n.jsx("path",{d:o.d,transform:o.pathTransform,role:"button",tabIndex:0,"aria-label":o.name,"aria-pressed":a,onClick:()=>e(o.code),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),e(o.code))},className:le("cursor-pointer stroke-background outline-none transition-colors [stroke-width:1] [vector-effect:non-scaling-stroke]","hover:fill-primary/50 focus-visible:fill-primary/50",a?"fill-primary":"fill-muted-foreground/40")})},o.code)})})})}const yL=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Åland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua & Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia & Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"VG",name:"British Virgin Islands"},{code:"BN",name:"Brunei"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"BQ",name:"Caribbean Netherlands"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"IO",name:"Chagos Archipelago"},{code:"CL",name:"Chile"},{code:"CN",name:"China mainland"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo - Brazzaville"},{code:"CD",name:"Congo - Kinshasa"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Côte d’Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CW",name:"Curaçao"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czechia"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"SZ",name:"Eswatini"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard & McDonald Islands"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia"},{code:"MD",name:"Moldova"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar (Burma)"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"KP",name:"North Korea"},{code:"MK",name:"North Macedonia"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PS",name:"Palestinian Territories"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn Islands"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Réunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"São Tomé & Príncipe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"GS",name:"So. Georgia & So. Sandwich Isl."},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"KR",name:"South Korea"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"BL",name:"St. Barthélemy"},{code:"SH",name:"St. Helena"},{code:"KN",name:"St. Kitts & Nevis"},{code:"LC",name:"St. Lucia"},{code:"MF",name:"St. Martin"},{code:"PM",name:"St. Pierre & Miquelon"},{code:"VC",name:"St. Vincent & Grenadines"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard & Jan Mayen"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"T1",name:"Tor network (Cloudflare)"},{code:"TT",name:"Trinidad & Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Türkiye"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks & Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UM",name:"U.S. Outlying Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"XX",name:"Unknown (Cloudflare could not determine)"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VA",name:"Vatican City"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"WF",name:"Wallis & Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}],bL="BR";function SL(t){if(!t)return!1;const e=Object.keys(t).sort();return e.length===3&&e[0]==="city"&&e[1]==="country"&&e[2]==="regionCode"}function wL(t){const e=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return{city:typeof e.city=="string"?e.city:"",regionCode:typeof e.regionCode=="string"?e.regionCode:"",country:typeof e.country=="string"?e.country:""}}function CL(t,e){const s={...t,...e},i={};for(const r of["city","regionCode","country"])s[r]&&(i[r]=s[r]);return i}function Ec(t){const e=F.c(37),{id:s,options:i,value:r,placeholder:o,emptyMessage:a,onChange:l}=t,[d,c]=M.useState(!1);let h;if(e[0]!==i||e[1]!==r){let w;e[3]!==r?(w=C=>C.value===r,e[3]=r,e[4]=w):w=e[4],h=i.find(w),e[0]=i,e[1]=r,e[2]=h}else h=e[2];const u=h;let f;e[5]!==o||e[6]!==u?(f=u?n.jsx("span",{className:"truncate",children:u.label}):n.jsx("span",{className:"text-muted-foreground",children:o}),e[5]=o,e[6]=u,e[7]=f):f=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Qd,{className:"size-4 shrink-0 opacity-50"}),e[8]=m):m=e[8];let p;e[9]!==s||e[10]!==d||e[11]!==f?(p=n.jsx(Ss,{asChild:!0,children:n.jsxs(ie,{id:s,variant:"outline",role:"combobox","aria-expanded":d,className:"h-10 w-full justify-between font-normal",children:[f,m]})}),e[9]=s,e[10]=d,e[11]=f,e[12]=p):p=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={width:"var(--radix-popover-trigger-width)"},e[13]=_):_=e[13];let L;e[14]!==o?(L=n.jsx(po,{placeholder:o,className:"h-9"}),e[14]=o,e[15]=L):L=e[15];let v;e[16]!==a?(v=n.jsx(go,{children:a}),e[16]=a,e[17]=v):v=e[17];let x;if(e[18]!==l||e[19]!==i||e[20]!==r){let w;e[22]!==l||e[23]!==r?(w=C=>n.jsxs(On,{value:`${C.label} ${C.value}`,onSelect:()=>{l(C.value===r?"":C.value),c(!1)},children:[n.jsx("span",{className:"truncate",children:C.label}),n.jsx(Ls,{className:le("ml-auto size-4 shrink-0",r===C.value?"opacity-100":"opacity-0")})]},C.value),e[22]=l,e[23]=r,e[24]=w):w=e[24],x=i.map(w),e[18]=l,e[19]=i,e[20]=r,e[21]=x}else x=e[21];let g;e[25]!==x?(g=n.jsx($n,{children:x}),e[25]=x,e[26]=g):g=e[26];let y;e[27]!==v||e[28]!==g?(y=n.jsxs(_o,{children:[v,g]}),e[27]=v,e[28]=g,e[29]=y):y=e[29];let b;e[30]!==y||e[31]!==L?(b=n.jsx(ws,{className:"p-0",style:_,children:n.jsxs(Pl,{children:[L,y]})}),e[30]=y,e[31]=L,e[32]=b):b=e[32];let S;return e[33]!==d||e[34]!==b||e[35]!==p?(S=n.jsxs(bs,{open:d,onOpenChange:c,children:[p,b]}),e[33]=d,e[34]=b,e[35]=p,e[36]=S):S=e[36],S}const kL=yL.map(t=>({value:t.code,label:`${t.name} (${t.code})`})),jL=p9.map(t=>({value:t.code,label:`${t.name} (${t.code})`}));function Ru(t){const e=F.c(49),{schema:s,value:i,onChange:r,path:o}=t;let a;e[0]!==i?(a=wL(i),e[0]=i,e[1]=a):a=e[1];const l=a,{city:d,regionCode:c,country:h}=l;let u;e[2]!==s.properties?(u=s.properties??{},e[2]=s.properties,e[3]=u):u=e[3];const f=u,m=f.country?.title??"Country",p=f.regionCode?.title??"Region",_=f.city?.title??"City";let L;e[4]!==l||e[5]!==r?(L=O=>{r(CL(l,O))},e[4]=l,e[5]=r,e[6]=L):L=e[6];const v=L,x=h===bL;let g;e[7]!==c?(g=p9.find(O=>O.code===c),e[7]=c,e[8]=g):g=e[8];const y=g,b=`${o}.country`,S=s.title??"Location";let w;e[9]!==b||e[10]!==S?(w=n.jsx($e,{htmlFor:b,children:S}),e[9]=b,e[10]=S,e[11]=w):w=e[11];let C;e[12]!==s.description?(C=s.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:s.description}),e[12]=s.description,e[13]=C):C=e[13];let N;e[14]!==w||e[15]!==C?(N=n.jsxs("div",{className:"space-y-0.5",children:[w,C]}),e[14]=w,e[15]=C,e[16]=N):N=e[16];const T=`${o}.country`;let A;e[17]!==m||e[18]!==T?(A=n.jsx($e,{htmlFor:T,className:"text-xs",children:m}),e[17]=m,e[18]=T,e[19]=A):A=e[19];const j=`${o}.country`;let k;e[20]!==v?(k=O=>v({country:O,regionCode:"",city:""}),e[20]=v,e[21]=k):k=e[21];let I;e[22]!==h||e[23]!==j||e[24]!==k?(I=n.jsx(Ec,{id:j,options:kL,value:h,placeholder:"Select a country…",emptyMessage:"No country found.",onChange:k}),e[22]=h,e[23]=j,e[24]=k,e[25]=I):I=e[25];let E;e[26]!==A||e[27]!==I?(E=n.jsxs("div",{className:"space-y-1.5",children:[A,I]}),e[26]=A,e[27]=I,e[28]=E):E=e[28];let R;e[29]!==h||e[30]!==v||e[31]!==x||e[32]!==o||e[33]!==c||e[34]!==p?(R=h&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx($e,{htmlFor:`${o}.regionCode`,className:"text-xs",children:p}),x?n.jsxs("div",{className:"space-y-2",children:[n.jsx(xL,{selected:c,onSelect:O=>v({regionCode:O===c?"":O,city:""})}),n.jsx(Ec,{id:`${o}.regionCode`,options:jL,value:c,placeholder:"Select a state…",emptyMessage:"No state found.",onChange:O=>v({regionCode:O,city:""})})]}):n.jsxs(n.Fragment,{children:[n.jsx(ze,{id:`${o}.regionCode`,type:"text",value:c,placeholder:"e.g. SP",onChange:O=>v({regionCode:O.target.value})}),n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:"ISO 3166-2 subdivision code from cf-region-code."})]})]}),e[29]=h,e[30]=v,e[31]=x,e[32]=o,e[33]=c,e[34]=p,e[35]=R):R=e[35];let P;e[36]!==d||e[37]!==_||e[38]!==h||e[39]!==v||e[40]!==x||e[41]!==o||e[42]!==y?(P=h&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx($e,{htmlFor:`${o}.city`,className:"text-xs",children:_}),n.jsx(ze,{id:`${o}.city`,type:"text",value:d,placeholder:x&&y?`e.g. a city in ${y.name}`:"e.g. Sao Paulo",onChange:O=>v({city:O.target.value})}),n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:"Matched exactly against cf-ipcity."})]}),e[36]=d,e[37]=_,e[38]=h,e[39]=v,e[40]=x,e[41]=o,e[42]=y,e[43]=P):P=e[43];let D;return e[44]!==E||e[45]!==R||e[46]!==P||e[47]!==N?(D=n.jsxs("div",{className:"space-y-4",children:[N,E,R,P]}),e[44]=E,e[45]=R,e[46]=P,e[47]=N,e[48]=D):D=e[48],D}function NL(t){const e=t.schema;if(!e?.properties)return null;const s=new Set(Object.keys(t.discriminators??{}));if(s.size===0)return e;const i={};for(const[r,o]of Object.entries(e.properties))s.has(r)||(i[r]=o);return{...e,properties:i}}function EL(t){const e=F.c(46),{schema:s,value:i,onChange:r,path:o,label:a}=t;let l,d;e[0]!==s.inlineUnionBranches||e[1]!==i?(l=s.inlineUnionBranches??[],d=gL(i,l.map(AL)),e[0]=s.inlineUnionBranches,e[1]=i,e[2]=l,e[3]=d):(l=e[2],d=e[3]);const c=d,[h,u]=M.useState(c),[f,m]=M.useState(c);f!==c&&(m(c),u(c));const p=Math.min(h,l.length-1),_=l[p];let L;e[4]!==l||e[5]!==r?(L=P=>{const D=Number(P);u(D),r({...l[D]?.discriminators??{}})},e[4]=l,e[5]=r,e[6]=L):L=e[6];const v=L;if(l.length===0)return null;let x;e[7]!==_?(x=_?NL(_):null,e[7]=_,e[8]=x):x=e[8];const g=x;let y;if(e[9]!==_?.schema?.properties||e[10]!==i){let P;e[12]!==_?.schema?.properties?(P=_?.schema?.properties??{},e[12]=_?.schema?.properties,e[13]=P):P=e[13],y=_L(i,Object.keys(P)),e[9]=_?.schema?.properties,e[10]=i,e[11]=y}else y=e[11];const b=y;let S;e[14]!==a||e[15]!==o?(S=n.jsx($e,{htmlFor:o,children:a}),e[14]=a,e[15]=o,e[16]=S):S=e[16];const w=String(p);let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Et,{placeholder:"Select..."}),e[17]=C):C=e[17];let N;e[18]!==o?(N=n.jsx(Ct,{id:o,children:C}),e[18]=o,e[19]=N):N=e[19];let T;e[20]!==l?(T=l.map(TL),e[20]=l,e[21]=T):T=e[21];let A;e[22]!==T?(A=n.jsx(kt,{children:T}),e[22]=T,e[23]=A):A=e[23];let j;e[24]!==v||e[25]!==w||e[26]!==N||e[27]!==A?(j=n.jsxs(jt,{value:w,onValueChange:v,children:[N,A]}),e[24]=v,e[25]=w,e[26]=N,e[27]=A,e[28]=j):j=e[28];let k;e[29]!==s.description?(k=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[29]=s.description,e[30]=k):k=e[30];let I;e[31]!==j||e[32]!==k||e[33]!==S?(I=n.jsxs("div",{className:"space-y-1.5",children:[S,j,k]}),e[31]=j,e[32]=k,e[33]=S,e[34]=I):I=e[34];let E;e[35]!==_||e[36]!==g||e[37]!==r||e[38]!==o||e[39]!==b||e[40]!==t||e[41]!==i?(E=_&&(SL(_.schema?.properties)?n.jsx(Ru,{...t,schema:_.schema,onChange:P=>r({...b,...P,..._.discriminators??{}})}):g?n.jsx(vi,{schema:g,value:i,onChange:P=>r({...P,..._.discriminators??{}}),basePath:o,breadcrumbPath:t.breadcrumbPath,onBreadcrumbChange:t.onBreadcrumbChange,meta:t.meta,decofile:t.decofile,onSaveReferencedBlock:t.onSaveReferencedBlock,sandbox:t.sandbox,previewBaseUrl:t.previewBaseUrl,onAddSectionItem:t.onAddSectionItem,onRequestAddSection:t.onRequestAddSection}):null),e[35]=_,e[36]=g,e[37]=r,e[38]=o,e[39]=b,e[40]=t,e[41]=i,e[42]=E):E=e[42];let R;return e[43]!==I||e[44]!==E?(R=n.jsxs("div",{className:"space-y-3",children:[I,E]}),e[43]=I,e[44]=E,e[45]=R):R=e[45],R}function TL(t,e){return n.jsx(et,{value:String(e),children:t.title},t.title)}function AL(t){return{discriminators:t.discriminators,propertyKeys:Object.keys(t.schema?.properties??{})}}const RL={lat:-21.9,lng:-41.42},Ca=1e5;let fr=null;function PL(t){return fr||(fr=new Promise((e,s)=>{if(typeof window>"u"){s(new Error("Google Maps requires a browser environment"));return}const i=window;if(i.google?.maps){e(i.google.maps);return}const r=()=>{const l=window.google?.maps;l?e(l):s(new Error("Google Maps script loaded without google.maps"))},o=document.querySelector("script[data-google-maps-loader]");if(o){o.addEventListener("load",r),o.addEventListener("error",()=>s(new Error("Failed to load Google Maps")));return}const a=document.createElement("script");a.src=`https://maps.googleapis.com/maps/api/js?key=${t}&v=weekly&libraries=maps`,a.async=!0,a.defer=!0,a.dataset.googleMapsLoader="true",a.addEventListener("load",r),a.addEventListener("error",()=>s(new Error("Failed to load Google Maps"))),document.head.appendChild(a)}),fr)}function DL(t){if(typeof t!="string"||!t)return null;const e=t.split(",").map(Number),[s,i,r]=e;return!Number.isFinite(s)||!Number.isFinite(i)?null:{lat:s,lng:i,radius:Number.isFinite(r)?r:Ca}}function IL({schema:t,value:e,onChange:s,path:i,label:r}){const o=gf().googleMapsApiKey,a=M.useRef(s);a.current=s;const l=M.useRef(DL(e)),[d,c]=M.useState(null),h=M.useRef(null),u=f=>{if(!f||!o)return;const m={disposed:!1,circle:null,listeners:[]};return PL(o).then(p=>{if(m.disposed)return;const _=l.current,L=_?{lat:_.lat,lng:_.lng}:RL,v=_?.radius??Ca,x=new p.Map(f,{center:L,zoom:v?Math.round(Math.log2(768e4/v))+1:4,draggable:!0,streetViewControl:!1,mapTypeControl:!1}),g=new p.Circle({strokeColor:"#2E6ED9",strokeOpacity:.8,strokeWeight:2,fillColor:"#2E6ED9",fillOpacity:.35,editable:!0,draggable:!0,map:x,center:L,radius:v});m.circle=g;const y=()=>{const S=g.getCenter(),w=g.getRadius();S&&a.current(`${S.lat()},${S.lng()},${w}`)},b=S=>{S&&m.listeners.push(S)};b(x.addListener("click",S=>{S.latLng&&(g.setCenter({lat:S.latLng.lat(),lng:S.latLng.lng()}),g.getRadius()||g.setRadius(Ca),y())})),b(g.addListener("radius_changed",y)),b(g.addListener("dragend",y))},p=>{m.disposed||c(p instanceof Error?p.message:"Failed to load map")}),()=>{m.disposed=!0;for(const p of m.listeners)try{p?.remove()}catch{}if(m.listeners=[],m.circle){try{m.circle.setMap(null)}catch{}m.circle=null}}};return h.current||(h.current=u),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"space-y-0.5",children:[n.jsx($e,{htmlFor:i,children:r}),t.description&&n.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:t.description})]}),o?d?n.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:d}):n.jsx("div",{ref:h.current,id:i,className:"h-72 w-full rounded-md border border-border/60"}):n.jsxs("div",{className:"rounded-md border border-border/60 bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:["The map picker is unavailable — set"," ",n.jsx("code",{className:"font-mono",children:"GOOGLE_MAPS_API_KEY"})," on the server to enable it."]})]})}const ML="oklch(0.65 0.15 160)",BL="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)]",Pu="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]",dk="text-[oklch(0.45_0.15_160)] focus:bg-[oklch(0.65_0.15_160/0.12)] focus:text-[oklch(0.45_0.15_160)] dark:text-[oklch(0.78_0.15_160)] dark:focus:bg-[oklch(0.65_0.15_160/0.15)] dark:focus:text-[oklch(0.78_0.15_160)]";function Tc(t){return t.map(e=>e.label).join(`
|
|
467
|
+
`)}function Uo(t){return t.map(e=>({id:crypto.randomUUID(),index:e.index,label:e.label}))}function OL(t){return t.map((e,s)=>({...e,index:s}))}function Du(t){const e=F.c(17),{label:s,canDelete:i,dragging:r,onDuplicate:o,onDelete:a}=t,l=r?"opacity-100":"opacity-0 group-hover:opacity-100";let d;e[0]!==l?(d=le("h-4 w-4 shrink-0 text-muted-foreground/40 transition-opacity",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==d?(c=n.jsx(Cl,{className:d}),e[2]=d,e[3]=c):c=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Ti,{className:"h-4 w-4 shrink-0",style:{color:ML}}),e[4]=h):h=e[4];let u;e[5]!==s?(u=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:s}),e[5]=s,e[6]=u):u=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==s||e[10]!==a||e[11]!==o?(f=!r&&n.jsxs(Qt,{children:[n.jsx(es,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":`Open actions for ${s}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:zL,onPointerDown:$L,children:n.jsx(Vi,{size:14})})}),n.jsxs(ts,{align:"end",children:[n.jsxs(We,{onClick:p=>{p.stopPropagation(),o?.()},children:[n.jsx(Xt,{size:14}),"Duplicate"]}),n.jsxs(We,{variant:"destructive",disabled:!i,onClick:p=>{p.stopPropagation(),a?.()},children:[n.jsx(ss,{size:14}),"Delete"]})]})]}),e[7]=i,e[8]=r,e[9]=s,e[10]=a,e[11]=o,e[12]=f):f=e[12];let m;return e[13]!==c||e[14]!==u||e[15]!==f?(m=n.jsxs(n.Fragment,{children:[c,h,u,f]}),e[13]=c,e[14]=u,e[15]=f,e[16]=m):m=e[16],m}function $L(t){return t.stopPropagation()}function zL(t){return t.stopPropagation()}function FL(t){const e=F.c(26),{entry:s,selected:i,canDelete:r,onSelect:o,onDuplicate:a,onDelete:l}=t;let d;e[0]!==s.id?(d={id:s.id,animateLayoutChanges:HL},e[0]=s.id,e[1]=d):d=e[1];const{attributes:c,listeners:h,setNodeRef:u,transform:f,isDragging:m}=vd(d);let p;e[2]!==f?(p=xd.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=p):p=e[3];const _=m?0:void 0;let L;e[4]!==p||e[5]!==_?(L={transform:p,opacity:_},e[4]=p,e[5]=_,e[6]=L):L=e[6];const v=L;let x;e[7]!==o?(x=C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),o())},e[7]=o,e[8]=x):x=e[8];const g=m?"cursor-grabbing":"cursor-grab",y=i?Pu:BL;let b;e[9]!==g||e[10]!==y?(b=le("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",g,y),e[9]=g,e[10]=y,e[11]=b):b=e[11];let S;e[12]!==r||e[13]!==s.label||e[14]!==l||e[15]!==a?(S=n.jsx(Du,{label:s.label,canDelete:r,onDuplicate:a,onDelete:l}),e[12]=r,e[13]=s.label,e[14]=l,e[15]=a,e[16]=S):S=e[16];let w;return e[17]!==c||e[18]!==h||e[19]!==o||e[20]!==u||e[21]!==v||e[22]!==x||e[23]!==b||e[24]!==S?(w=n.jsx("div",{ref:u,style:v,...c,...h,onClick:o,onKeyDown:x,className:b,children:S}),e[17]=c,e[18]=h,e[19]=o,e[20]=u,e[21]=v,e[22]=x,e[23]=b,e[24]=S,e[25]=w):w=e[25],w}function HL(){return!1}function UL(t){const e=F.c(81),{listKey:s,variants:i,selectedIndex:r,onSelect:o,onDuplicate:a,onDelete:l,onRemoveAll:d,onReorder:c,onAdd:h}=t,u=i.length>1;let f;e[0]!==i?(f=()=>Uo(i),e[0]=i,e[1]=f):f=e[1];const[m,p]=M.useState(f),[_,L]=M.useState(null),[v,x]=M.useState(s),[g,y]=M.useState(i.length);let b;e[2]!==i?(b=()=>Tc(i),e[2]=i,e[3]=b):b=e[3];const[S,w]=M.useState(b),C=M.useRef(!1),N=Tc(i);v!==s?(x(s),y(i.length),w(N),p(Uo(i))):g!==i.length?(y(i.length),w(N),p(Uo(i))):S!==N&&(w(N),p(oe=>i.map((he,xe)=>({id:oe[xe]?.id??crypto.randomUUID(),index:he.index,label:he.label}))));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A={coordinateGetter:yd},e[5]=A):A=e[5];const j=hd(Ar(fd,T),Ar(ud,A));let k;e[6]!==m?(k=m.map(WL),e[6]=m,e[7]=k):k=e[7];const I=k;let E;e[8]!==m?(E=oe=>{const he=String(oe.active.id);L(m.find(xe=>xe.id===he)??null)},e[8]=m,e[9]=E):E=e[9];const R=E;let P;e[10]!==I||e[11]!==c?(P=oe=>{L(null);const{active:he,over:xe}=oe;if(!xe||he.id===xe.id)return;const ve=I.indexOf(String(he.id)),be=I.indexOf(String(xe.id));ve===-1||be===-1||(p(De=>OL(ha([...De],ve,be))),C.current=!0,requestAnimationFrame(()=>{C.current=!1}),c(ve,be))},e[10]=I,e[11]=c,e[12]=P):P=e[12];const D=P;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{L(null)},e[13]=O):O=e[13];const $=O;let K,z,U,G,q,W,H,Z,J,B,X,V,ee;if(e[14]!==u||e[15]!==m||e[16]!==I||e[17]!==D||e[18]!==R||e[19]!==h||e[20]!==l||e[21]!==a||e[22]!==d||e[23]!==o||e[24]!==r||e[25]!==j){const oe=ge=>{C.current||o(ge)};X="space-y-1 border-b p-2";let he;e[39]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[39]=he):he=e[39];let xe;e[40]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx(Dt,{size:14}),e[40]=xe):xe=e[40];let ve;e[41]!==h?(ve=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:h,children:xe})}),e[41]=h,e[42]=ve):ve=e[42];let be;e[43]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx(Te,{children:"Add variant"}),e[43]=be):be=e[43];let De;e[44]!==ve?(De=n.jsxs(Ae,{children:[ve,be]}),e[44]=ve,e[45]=De):De=e[45];let Ie;e[46]===Symbol.for("react.memo_cache_sentinel")?(Ie=n.jsx(ss,{size:14}),e[46]=Ie):Ie=e[46];let Me;e[47]!==d?(Me=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove all variants",className:"size-6 text-muted-foreground hover:text-destructive",onClick:d,children:Ie})}),e[47]=d,e[48]=Me):Me=e[48];let He;e[49]===Symbol.for("react.memo_cache_sentinel")?(He=n.jsx(Te,{children:"Remove all variants"}),e[49]=He):He=e[49];let Je;e[50]!==Me?(Je=n.jsxs(Ae,{children:[Me,He]}),e[50]=Me,e[51]=Je):Je=e[51],e[52]!==De||e[53]!==Je?(V=n.jsxs("div",{className:"flex items-center justify-between",children:[he,n.jsxs("div",{className:"flex items-center gap-0.5",children:[De,Je]})]}),e[52]=De,e[53]=Je,e[54]=V):V=e[54],z=md,W=j,H=pd,Z=R,J=D,B=$,K=gd,G=I,q=_d,ee="space-y-0.5",U=m.map(ge=>n.jsx(FL,{entry:ge,selected:ge.index===r,canDelete:u,onSelect:()=>oe(ge.index),onDuplicate:()=>a(ge.index),onDelete:()=>l(ge.index)},ge.id)),e[14]=u,e[15]=m,e[16]=I,e[17]=D,e[18]=R,e[19]=h,e[20]=l,e[21]=a,e[22]=d,e[23]=o,e[24]=r,e[25]=j,e[26]=K,e[27]=z,e[28]=U,e[29]=G,e[30]=q,e[31]=W,e[32]=H,e[33]=Z,e[34]=J,e[35]=B,e[36]=X,e[37]=V,e[38]=ee}else K=e[26],z=e[27],U=e[28],G=e[29],q=e[30],W=e[31],H=e[32],Z=e[33],J=e[34],B=e[35],X=e[36],V=e[37],ee=e[38];let te;e[55]!==U||e[56]!==ee?(te=n.jsx("div",{className:ee,children:U}),e[55]=U,e[56]=ee,e[57]=te):te=e[57];let ae;e[58]!==K||e[59]!==G||e[60]!==q||e[61]!==te?(ae=n.jsx(K,{items:G,strategy:q,children:te}),e[58]=K,e[59]=G,e[60]=q,e[61]=te,e[62]=ae):ae=e[62];let de;e[63]!==_||e[64]!==u?(de=_?n.jsx("div",{className:le("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",Pu),children:n.jsx(Du,{label:_.label,canDelete:u,dragging:!0})}):null,e[63]=_,e[64]=u,e[65]=de):de=e[65];let fe;e[66]!==de?(fe=n.jsx(Ld,{dropAnimation:null,children:de}),e[66]=de,e[67]=fe):fe=e[67];let Q;e[68]!==z||e[69]!==W||e[70]!==H||e[71]!==Z||e[72]!==J||e[73]!==B||e[74]!==ae||e[75]!==fe?(Q=n.jsxs(z,{sensors:W,collisionDetection:H,onDragStart:Z,onDragEnd:J,onDragCancel:B,children:[ae,fe]}),e[68]=z,e[69]=W,e[70]=H,e[71]=Z,e[72]=J,e[73]=B,e[74]=ae,e[75]=fe,e[76]=Q):Q=e[76];let se;return e[77]!==X||e[78]!==V||e[79]!==Q?(se=n.jsxs("div",{className:X,children:[V,Q]}),e[77]=X,e[78]=V,e[79]=Q,e[80]=se):se=e[80],se}function WL(t){return t.id}const VL=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],KL={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Wo(t){return fi(t)!==void 0}function Iu(t,e){if(e){if(Wo(e))return e;const s=KL[e];if(s&&Wo(s))return s}for(const[s,i]of VL)if(s.test(t)&&Wo(i))return i;return"FilterLines"}function qL(t){return fi(t)??zm}function Ac(t){const e=F.c(11),{iconName:s,size:i,className:r}=t,o=i===void 0?"md":i;let a;e[0]!==s?(a=qL(s),e[0]=s,e[1]=a):a=e[1];const l=a,d=o==="sm"?"size-7":"size-9",c=o==="sm"?16:18;let h;e[2]!==d||e[3]!==r?(h=le("flex shrink-0 items-center justify-center rounded-full bg-muted",d,r),e[2]=d,e[3]=r,e[4]=h):h=e[4];let u;e[5]!==l||e[6]!==c?(u=n.jsx(l,{size:c,className:"text-muted-foreground"}),e[5]=l,e[6]=c,e[7]=u):u=e[7];let f;return e[8]!==h||e[9]!==u?(f=n.jsx("div",{className:h,children:u}),e[8]=h,e[9]=u,e[10]=f):f=e[10],f}const Mu="Users03";function GL(t){const e=t.manifest?.blocks??{},s=[];for(const[i,r]of Object.entries(e))if(i.includes("matchers"))for(const o of Object.keys(r)){if(o.includes("always"))continue;const a=_i(o,t);s.push({resolveType:o,title:a.title??mt(o),description:a.description,iconName:Iu(o,a.icon)})}return s}function YL(t,e){if(!t)return Mu;const s=e.find(i=>i.resolveType===t);return s?s.iconName:Iu(t)}function JL(t){const e=F.c(41),{currentRt:s,currentLabel:i,matchers:r,onSelect:o}=t,[a,l]=M.useState(!1);let d;if(e[0]!==s||e[1]!==r){const k=YL(s,r);d=fi(k),e[0]=s,e[1]=r,e[2]=d}else d=e[2];const c=d;let h;e[3]!==o?(h=k=>{o(k),l(!1)},e[3]=o,e[4]=h):h=e[4];const u=h;let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(!0),e[5]=f):f=e[5];let m;e[6]!==c?(m=c&&n.jsx(c,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=c,e[7]=m):m=e[7];let p;e[8]!==i?(p=n.jsx("span",{className:"flex-1 truncate",children:i}),e[8]=i,e[9]=p):p=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ds,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=_):_=e[10];let L;e[11]!==m||e[12]!==p?(L=n.jsxs("button",{type:"button",onClick:f,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[m,p,_]}),e[11]=m,e[12]=p,e[13]=L):L=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(po,{placeholder:"Search rules..."}),e[14]=v):v=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(go,{children:"No rules found."}),e[15]=x):x=e[15];let g;e[16]!==u?(g=()=>u(""),e[16]=u,e[17]=g):g=e[17];const y=!s&&"bg-accent/60";let b;e[18]!==y?(b=le("gap-2.5",y),e[18]=y,e[19]=b):b=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Ac,{iconName:Mu,size:"sm"}),e[20]=S):S=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx("span",{className:"text-sm",children:"Always"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=w):w=e[21];let C;e[22]!==g||e[23]!==b?(C=n.jsxs(On,{value:"always Target all users",onSelect:g,className:b,children:[S,w]}),e[22]=g,e[23]=b,e[24]=C):C=e[24];let N;if(e[25]!==s||e[26]!==u||e[27]!==r){let k;e[29]!==s||e[30]!==u?(k=I=>n.jsxs(On,{value:`${I.title} ${I.resolveType} ${I.description??""}`,onSelect:()=>u(I.resolveType),className:le("gap-2.5",s===I.resolveType&&"bg-accent/60"),children:[n.jsx(Ac,{iconName:I.iconName,size:"sm"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx("span",{className:"text-sm",children:I.title}),I.description&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:I.description})]})]},I.resolveType),e[29]=s,e[30]=u,e[31]=k):k=e[31],N=r.map(k),e[25]=s,e[26]=u,e[27]=r,e[28]=N}else N=e[28];let T;e[32]!==C||e[33]!==N?(T=n.jsxs(_o,{children:[x,n.jsxs($n,{children:[C,N]})]}),e[32]=C,e[33]=N,e[34]=T):T=e[34];let A;e[35]!==a||e[36]!==T?(A=n.jsxs(Bm,{open:a,onOpenChange:l,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[v,T]}),e[35]=a,e[36]=T,e[37]=A):A=e[37];let j;return e[38]!==A||e[39]!==L?(j=n.jsxs(n.Fragment,{children:[L,A]}),e[38]=A,e[39]=L,e[40]=j):j=e[40],j}const XL=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ZL=5,QL=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Rc(t){const{start:e,end:s}=t,i=typeof e=="string"?e:"",r=typeof s=="string"?s:"";if(!i&&!r)return null;const o=d=>{if(!d)return null;const c=new Date(d);return Number.isNaN(c.getTime())?null:QL.format(c)},a=o(i),l=o(r);return a&&l?`${a} → ${l}`:a?`From ${a}`:l?`Until ${l}`:null}function g9(t,e=0){if(!t)return"Default";if(e>ZL)return"...";const s=t.__resolveType??"";if(["website/matchers/always.ts","$live/matchers/MatchAlways.ts"].includes(s)||s==="")return"Default";switch(s){case"website/matchers/never.ts":return"Hidden";case"website/matchers/device.ts":case"$live/matchers/MatchDevice.ts":{const{mobile:r,tablet:o,desktop:a,devices:l=[]}=t,d=[...l];return r&&d.push("Mobile"),o&&d.push("Tablet"),a&&d.push("Desktop"),d.length>0?d.map(XL).join(" & "):mt(s)}case"website/matchers/date.ts":case"$live/matchers/MatchDate.ts":return Rc(t)??mt(s);case"website/matchers/random.ts":case"$live/matchers/MatchRandom.ts":{const{traffic:r}=t;return typeof r=="number"?`${Math.ceil(r*100)}% of sessions`:mt(s)}case"website/matchers/host.ts":case"$live/matchers/MatchHost.ts":{const{includes:r,match:o}=t,a=[];return r&&a.push(r),o&&a.push(o),a.length>0?a.join(" - "):mt(s)}case"website/matchers/pathname.ts":{const r=t.case,{type:o,pathname:a}=r??{};return o&&a?`Pathname ${o} ${a}`:mt(s)}case"website/matchers/location.ts":case"$live/matchers/MatchLocation.ts":{const{includeLocations:r,excludeLocations:o}=t,a=c=>[c.city,c.regionCode,c.country].filter(Boolean).join(" - "),l=r?.[0];if(l){const c=(r?.length??0)-1;return`${a(l)}${c>0?` +${c}`:""}`}const d=o?.[0];if(d){const c=(o?.length??0)-1;return`Except ${a(d)}${c>0?` +${c}`:""}`}return"Any location"}case"website/matchers/multi.ts":case"$live/matchers/MatchMulti.ts":{const{matchers:r,op:o="AND"}=t;if(r&&r.length>0){const a=o==="OR"?"OR":"AND";return r.map(l=>g9(l,e+1)).join(` ${a} `)}return mt(s)}default:{const r=Rc(t);return r||mt(s)||"Default"}}}function e8(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.__resolveType=="string"&&Array.isArray(e.variants)}function t8(t,e){return{__resolveType:e,variants:[{rule:Bi(),value:structuredClone(t)},{rule:Bi(),value:structuredClone(t)}]}}function s8(t){const e=t.variants;if(e.length===0)return;const s=e.find(i=>o9(i.rule));return s?s.value:e[e.length-1]?.value}function i8(t){const e=[...t.variants],s=e[e.length-1],i={rule:Bi(),value:s?structuredClone(s.value):void 0};return{...t,variants:[...e,i]}}function n8(t,e){if(t.variants.length<=1)return null;const s=[...t.variants];return s.splice(e,1),{...t,variants:s}}function r8(t,e){const s=[...t.variants],i=s[e];return i?(s.splice(e+1,0,structuredClone(i)),{...t,variants:s}):t}function o8(t,e,s){const i=[...t.variants];if(e===s||e<0||s<0||e>=i.length||s>=i.length)return t;const[r]=i.splice(e,1);return r?(i.splice(s,0,r),{...t,variants:i}):t}function a8(t,e,s){const i=[...t.variants],r=i[e];return r?(i[e]={...r,value:s},{...t,variants:i}):t}function Pc(t,e,s){const i=[...t.variants],r=i[e];return r?(i[e]={...r,rule:s},{...t,variants:i}):t}const Dc=new WeakMap,Ic=new Map;function l8(t){let e=Dc.get(t);return e||(e=GL(t),Dc.set(t,e)),e}function c8(t,e){let s=Ic.get(t);return s===void 0&&(s=Ks(t,e),Ic.set(t,s)),s}function d8(t){const e=F.c(3),{multivariateResolveType:s,renderInnerField:i,...r}=t,{value:o,onChange:a,meta:l,path:d}=r,[c,h]=M.useState(0);if(!e8(o)){let P;e[0]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(Bd,{size:14}),e[0]=P):P=e[0];let D;return e[1]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(Te,{children:"Add variant"}),e[1]=D):D=e[1],n.jsxs("div",{className:"relative grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 size-6 text-muted-foreground hover:text-foreground","aria-label":"Add variant",onClick:()=>{a(t8(o,s)),h(0)},children:P})}),D]}),i(r)]})}const u=o,f=u.variants,m=Math.min(c,f.length-1),p=f.map(h8),_=f[m],L=_?.rule??{},v=L.__resolveType??"",x=_?.value,g=l?l8(l):[],y=v&&l?c8(v,l):null,{__resolveType:b,...S}=L,w=()=>{a(s8(u)),h(0)},C=()=>{const P=i8(u);a(P),h(P.variants.length-1)},N=P=>{const D=n8(u,P);D&&(a(D),m>=D.variants.length&&h(D.variants.length-1))},T=P=>{const D=r8(u,P);a(D),h(P+1)},A=(P,D)=>{const O=o8(u,P,D);a(O),m===P&&h(D)},j=P=>{a(Pc(u,m,P?{__resolveType:P}:{__resolveType:gh}))},k=P=>{const D=P,O=v?{...D,__resolveType:v}:{...D};a(Pc(u,m,O))},I=P=>{a(a8(u,m,P))},E=`${d}-${u.__resolveType}`;let R;return e[2]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx($e,{className:"text-xs text-muted-foreground",children:"Rule"}),e[2]=R):R=e[2],n.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-0",children:[n.jsx(UL,{listKey:E,variants:p,selectedIndex:m,onSelect:h,onDuplicate:T,onDelete:N,onRemoveAll:w,onReorder:A,onAdd:C}),n.jsxs("div",{className:"space-y-4 px-2 pt-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[R,n.jsx(JL,{currentRt:v,currentLabel:g9(L),matchers:g,onSelect:j}),y&&n.jsx("div",{className:"pt-1",children:n.jsx(vi,{schema:y,value:S,onChange:k,basePath:""})})]}),i({...r,value:x,onChange:I})]})]})}function h8(t,e){return{index:e,label:g9(t.rule)||`Variant ${e+1}`}}const u8="website/loaders/secret.ts";function Nn(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t.__resolveType;return typeof e=="string"&&(e.endsWith("/secret.ts")||e.includes("loaders/secret"))}function f8(){return{__resolveType:u8,name:"",encrypted:""}}function m8(t){const{value:e,...s}=t;return s}function Vo(t){const e=F.c(45),{schema:s,value:i,onChange:r,label:o,path:a}=t;if(typeof i=="string"||i==null&&!Nn(i)){const w=typeof i=="string"?i:"";let C;e[0]!==o||e[1]!==a?(C=n.jsx($e,{htmlFor:a,className:"text-sm font-medium",children:o}),e[0]=o,e[1]=a,e[2]=C):C=e[2];let N;e[3]!==s.description?(N=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[3]=s.description,e[4]=N):N=e[4];let T;e[5]!==r?(T=k=>r(k.target.value),e[5]=r,e[6]=T):T=e[6];let A;e[7]!==a||e[8]!==w||e[9]!==T?(A=n.jsx(ze,{id:a,type:"password",value:w,autoComplete:"new-password",autoCorrect:"off",spellCheck:!1,placeholder:"Secret value",onChange:T,className:"h-10"}),e[7]=a,e[8]=w,e[9]=T,e[10]=A):A=e[10];let j;return e[11]!==C||e[12]!==N||e[13]!==A?(j=n.jsxs("div",{className:"space-y-2",children:[C,N,A]}),e[11]=C,e[12]=N,e[13]=A,e[14]=j):j=e[14],j}let l;e[15]!==i?(l=Nn(i)?i:f8(),e[15]=i,e[16]=l):l=e[16];const d=l,c=typeof d.name=="string"?d.name:"",h=typeof d.encrypted=="string"&&d.encrypted,u=`${a}-name`;let f;e[17]!==o||e[18]!==u?(f=n.jsx($e,{htmlFor:u,className:"text-sm font-medium",children:o}),e[17]=o,e[18]=u,e[19]=f):f=e[19];let m;e[20]!==s.description?(m=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}),e[20]=s.description,e[21]=m):m=e[21];const p=`${a}-name`;let _;e[22]!==d||e[23]!==r?(_=w=>r({...d,name:w.target.value}),e[22]=d,e[23]=r,e[24]=_):_=e[24];let L;e[25]!==c||e[26]!==p||e[27]!==_?(L=n.jsx(ze,{id:p,value:c,placeholder:"Secret name",onChange:_,className:"h-10"}),e[25]=c,e[26]=p,e[27]=_,e[28]=L):L=e[28];const v=`${a}-value`,x=h?"Leave blank to keep current value":"Secret value";let g;e[29]!==d||e[30]!==h||e[31]!==r?(g=w=>{const C=w.target.value;if(!C){r(h?m8(d):d);return}r({...d,value:C})},e[29]=d,e[30]=h,e[31]=r,e[32]=g):g=e[32];let y;e[33]!==g||e[34]!==v||e[35]!==x?(y=n.jsx(ze,{id:v,type:"password",autoComplete:"new-password",autoCorrect:"off",spellCheck:!1,placeholder:x,onChange:g,className:"h-10"}),e[33]=g,e[34]=v,e[35]=x,e[36]=y):y=e[36];let b;e[37]!==h?(b=h&&n.jsx("p",{className:"text-xs text-muted-foreground",children:"A secret value is stored."}),e[37]=h,e[38]=b):b=e[38];let S;return e[39]!==y||e[40]!==b||e[41]!==f||e[42]!==m||e[43]!==L?(S=n.jsxs("div",{className:"space-y-2",children:[f,m,L,y,b]}),e[39]=y,e[40]=b,e[41]=f,e[42]=m,e[43]=L,e[44]=S):S=e[44],S}function p8(t){const e=t.length>0?t[0]:void 0;if(e==null||typeof e!="object"||Array.isArray(e))return;const s={};for(const[i,r]of Object.entries(e))i.startsWith("__")||(typeof r=="string"?s[i]={type:"string"}:typeof r=="number"?s[i]={type:"number"}:typeof r=="boolean"&&(s[i]={type:"boolean"}));return Object.keys(s).length>0?{type:"object",properties:s}:void 0}const g8=new Set(["__resolveType","@type"]);function _8(t){if(t.type!=="block-ref"||!t.anyOfRefs?.length||t.anyOfRefs.length!==1)return!1;const e=t.anyOfRefs[0].schema;return!!(e?.properties?.variants||!e&&t.plainSchema)}function L8(t){if(yo(t))for(const e of t.anyOfRefs??[]){const r=e.schema?.properties?.variants?.items?.properties?.value;if(r?.type==="array"&&r.items)return r.items}}function Mc(t){if(t.type==="array"&&t.items)return t;const e=t.items??L8(t);return e?{...t,type:"array",items:e}:null}function v8(t,e){if(e!==void 0)return e;switch(t){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}}function _9(t){const{schema:e,value:s}=t;if(Yr(s)){const a=Ng(s),l=Mc(e);if(a!==null&&l)return n.jsx(ur,{...t,schema:l,value:a,onChange:d=>t.onChange(Eg(s,d))},t.path)}if(Array.isArray(s)&&e.type==="block-ref"&&yo(e)){const a=Mc(e);if(a)return n.jsx(ur,{...t,schema:a,value:s,onChange:t.onChange},t.path)}if(Array.isArray(s)&&!Yr(s)&&e.type==="block-ref"){const a=p8(s);if(a){const l={...e,type:"array",items:a};return n.jsx(ur,{...t,schema:l,value:s,onChange:t.onChange},t.path)}}if(e.type==="block-ref"||s!==null&&typeof s=="object"&&!Array.isArray(s)&&typeof s.__resolveType=="string"&&e.anyOfRefs){if(_8(e)){const a=e.anyOfRefs[0],l=a.schema?.properties?.variants?.items?.properties?.value,d=l&&l.type!=="block-ref"?l:e.plainSchema??l?.plainSchema??{type:"string"},c=h=>_9({...h,schema:d});return n.jsx(d8,{...t,multivariateResolveType:a.resolveType,renderInnerField:c},t.path)}return e.anyOfRefs?n.jsx(wc,{...t},t.path):null}if(e.type==="inline-union")return n.jsx(EL,{...t},t.path);if(e.format==="image-uri")return n.jsx(mL,{...t},t.path);if(e.format==="file-uri"||e.format==="video-uri")return n.jsx(cL,{...t},t.path);if(e.format==="map")return n.jsx(IL,{...t},t.path);if(e.format==="dynamic-options"&&e.options)return n.jsx(z6,{...t},t.path);if(e.format==="location")return n.jsx(Ru,{...t},t.path);if(e.enum&&e.enum.length>0)return n.jsx(Z_,{...t},t.path);if(e.type==="anyOf")return n.jsx(wc,{...t},t.path);if(Nn(s)||e.format==="password"||s==null&&e.format==="password")return n.jsx(Vo,{...t},t.path);const i=s??v8(e.type,e.default);if(i==null)return Nn(s)?n.jsx(Vo,{...t},t.path):null;if(Nn(i))return n.jsx(Vo,{...t,value:i},t.path);const r={...t,value:i},o=s==null?e.type??typeof i:Array.isArray(i)?"array":typeof i;if(o==="array"||Array.isArray(i))return n.jsx(ur,{...r},t.path);switch(o){case"boolean":return n.jsx(G_,{...r},t.path);case"number":case"integer":return n.jsx(q_,{...r},t.path);case"string":{const a=e.format;return a==="color-input"?n.jsx(dr,{...r},t.path):a==="textarea"||a==="rich-text"||a==="html"?n.jsx(dr,{...r},t.path):n.jsx(dr,{...r},t.path)}case"object":return i!==null&&typeof i=="object"&&!Array.isArray(i)?n.jsx(N6,{...r},t.path):null;default:return n.jsx(dr,{...r},t.path)}}function vi(t){const e=F.c(16),{schema:s,value:i,onChange:r,basePath:o,breadcrumbPath:a,onBreadcrumbChange:l,meta:d,decofile:c,onSaveReferencedBlock:h,previewBaseUrl:u,onAddSectionItem:f,onRequestAddSection:m,sandbox:p}=t;let _,L;if(e[0]!==o||e[1]!==c||e[2]!==d||e[3]!==f||e[4]!==l||e[5]!==r||e[6]!==m||e[7]!==h||e[8]!==u||e[9]!==p||e[10]!==s.properties||e[11]!==a||e[12]!==i){L=Symbol.for("react.early_return_sentinel");e:{const v=a===void 0?[]:a,x=s.properties;if(!x){L=null;break e}const g=i!=null&&typeof i=="object"&&!Array.isArray(i)?i:{},y=Object.keys(x).filter(A=>!g8.has(A)&&x[A]?.hidden!==!0);if(y.length===0){let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields on this section."}),e[15]=A):A=e[15],L=A;break e}const b=(A,j)=>{r({...g,[A]:j})},S=typeof g.__resolveType=="string"?g.__resolveType:void 0,w=v.length>0?m6(y,x,g,v):null,C=w?x[w]:null,N=w&&C?[w]:y,T=w&&C?u6(w,C,v):v;_=n.jsx("div",{className:"min-w-0 space-y-6",children:N.map(A=>{const j=x[A];if(!j)return null;const k=o?`${o}.${A}`:A,I=jn(A,j);return _9({schema:j,value:g[A],onChange:E=>b(A,E),path:k,label:I,breadcrumbPath:T,onBreadcrumbChange:l,meta:d,decofile:c,onSaveReferencedBlock:h,containerResolveType:S,previewBaseUrl:u,onAddSectionItem:f,onRequestAddSection:m,sandbox:p})})})}e[0]=o,e[1]=c,e[2]=d,e[3]=f,e[4]=l,e[5]=r,e[6]=m,e[7]=h,e[8]=u,e[9]=p,e[10]=s.properties,e[11]=a,e[12]=i,e[13]=_,e[14]=L}else _=e[13],L=e[14];return L!==Symbol.for("react.early_return_sentinel")?L:_}function x8(t){const e=F.c(37),{open:s,onOpenChange:i,defaultBlockId:r,isPending:o,onSubmit:a}=t,l=r===void 0?"":r,d=o===void 0?!1:o,[c,h]=M.useState(l),[u,f]=M.useState(s);s!==u&&(f(s),s&&h(l));let m;e[0]!==d||e[1]!==i?(m=k=>{!k&&!d&&i(!1)},e[0]=d,e[1]=i,e[2]=m):m=e[2];const p=m;let _;e[3]!==c||e[4]!==d||e[5]!==a?(_=async k=>{k.preventDefault();const I=c.trim();!I||d||await a(I)},e[3]=c,e[4]=d,e[5]=a,e[6]=_):_=e[6];const L=_;let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsxs(is,{children:[n.jsx(ns,{children:"Save as global"}),n.jsx(qi,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=v):v=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=k=>h(k.target.value),e[9]=g):g=e[9];let y;e[10]!==c||e[11]!==d?(y=n.jsxs("div",{className:"py-4 space-y-2",children:[x,n.jsx(ze,{id:"block-id",value:c,onChange:g,placeholder:"MyNewBlock",autoFocus:!0,disabled:d})]}),e[10]=c,e[11]=d,e[12]=y):y=e[12];let b;e[13]!==i?(b=()=>i(!1),e[13]=i,e[14]=b):b=e[14];let S;e[15]!==d||e[16]!==b?(S=n.jsx(ie,{type:"button",variant:"outline",onClick:b,disabled:d,children:"Cancel"}),e[15]=d,e[16]=b,e[17]=S):S=e[17];let w;e[18]!==c||e[19]!==d?(w=!c.trim()||d,e[18]=c,e[19]=d,e[20]=w):w=e[20];let C;e[21]!==d?(C=d?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=d,e[22]=C):C=e[22];let N;e[23]!==w||e[24]!==C?(N=n.jsx(ie,{type:"submit",disabled:w,children:C}),e[23]=w,e[24]=C,e[25]=N):N=e[25];let T;e[26]!==S||e[27]!==N?(T=n.jsxs(qs,{children:[S,N]}),e[26]=S,e[27]=N,e[28]=T):T=e[28];let A;e[29]!==L||e[30]!==T||e[31]!==y?(A=n.jsx($t,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:L,children:[v,y,T]})}),e[29]=L,e[30]=T,e[31]=y,e[32]=A):A=e[32];let j;return e[33]!==p||e[34]!==s||e[35]!==A?(j=n.jsx(Ot,{open:s,onOpenChange:p,children:A}),e[33]=p,e[34]=s,e[35]=A,e[36]=j):j=e[36],j}function y8(t){const e=F.c(60),{orgSlug:s,virtualMcpId:i,branch:r,previewUrl:o,meta:a,decofile:l,resolveType:d,title:c,defaultBlockId:h,isCreating:u,onCreate:f,onSaveReferencedBlock:m}=t,p=yi(),_=p?.entity?.id===i?p.entity.metadata?.siteSlug??null:null;let L;e[0]===Symbol.for("react.memo_cache_sentinel")?(L={},e[0]=L):L=e[0];const[v,x]=M.useState(L);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[1]=g):g=e[1];const[y,b]=M.useState(g),[S,w]=M.useState(0),[C,N]=M.useState(!1);let T;e[2]!==a||e[3]!==d?(T=Ks(d,a),e[2]=a,e[3]=d,e[4]=T):T=e[4];const A=T;let j;e[5]!==d?(j=d.split("/").pop()?.replace(/\.tsx?$/,"")??d,e[5]=d,e[6]=j):j=e[6];const k=j,I=o??void 0;let E;e[7]!==_||e[8]!==r||e[9]!==s||e[10]!==I||e[11]!==i?(E={orgSlug:s,virtualMcpId:i,branch:r,previewUrl:I,siteSlug:_},e[7]=_,e[8]=r,e[9]=s,e[10]=I,e[11]=i,e[12]=E):E=e[12];const R=E;let P;e[13]!==y||e[14]!==c?(P=[c,...y],e[13]=y,e[14]=c,e[15]=P):P=e[15];const D=P;let O;e[16]!==y?(O=de=>{b(y.slice(0,de)),w(b8)},e[16]=y,e[17]=O):O=e[17];const $=O;let K;e[18]!==l||e[19]!==v||e[20]!==f?(K=async de=>{const fe=R_(de,l);if(fe){ue.error(fe);return}await f(de,v),N(!1)},e[18]=l,e[19]=v,e[20]=f,e[21]=K):K=e[21];const z=K;let U;e[22]!==$||e[23]!==D?(U=n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:D.map((de,fe)=>{const Q=fe===D.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[fe>0&&n.jsx(Gi,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>$(fe),title:de,className:le("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",Q?"font-medium text-foreground":"text-muted-foreground"),children:de})]},`${de}-${fe}`)})}),e[22]=$,e[23]=D,e[24]=U):U=e[24];let G;e[25]===Symbol.for("react.memo_cache_sentinel")?(G=()=>N(!0),e[25]=G):G=e[25];let q;e[26]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(Id,{size:14}),e[26]=q):q=e[26];let W;e[27]!==u?(W=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{size:"icon",className:"size-8 shrink-0",disabled:u,onClick:G,"aria-label":"Save as global section",children:q})}),e[27]=u,e[28]=W):W=e[28];let H;e[29]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx(Te,{side:"bottom",children:"Save as global section"}),e[29]=H):H=e[29];let Z;e[30]!==W?(Z=n.jsxs(Ae,{children:[W,H]}),e[30]=W,e[31]=Z):Z=e[31];let J;e[32]!==U||e[33]!==Z?(J=n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[U,Z]}),e[32]=U,e[33]=Z,e[34]=J):J=e[34];let B;e[35]!==k?(B=n.jsxs("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:[k," — edits stay local until you save this as a global section."]}),e[35]=k,e[36]=B):B=e[36];let X;e[37]!==J||e[38]!==B?(X=n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[J,B]}),e[37]=J,e[38]=B,e[39]=X):X=e[39];let V;e[40]!==l||e[41]!==y||e[42]!==S||e[43]!==v||e[44]!==a||e[45]!==m||e[46]!==R||e[47]!==A?(V=n.jsx(Wi,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:A?n.jsx(vi,{schema:A,value:v,onChange:de=>x(de),basePath:"",breadcrumbPath:y,onBreadcrumbChange:b,meta:a,decofile:l,onSaveReferencedBlock:m,sandbox:R},S):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields for this section."})})})}),e[40]=l,e[41]=y,e[42]=S,e[43]=v,e[44]=a,e[45]=m,e[46]=R,e[47]=A,e[48]=V):V=e[48];let ee;e[49]!==X||e[50]!==V?(ee=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[X,V]}),e[49]=X,e[50]=V,e[51]=ee):ee=e[51];let te;e[52]!==h||e[53]!==z||e[54]!==u||e[55]!==C?(te=n.jsx(x8,{open:C,onOpenChange:N,defaultBlockId:h,isPending:u,onSubmit:z}),e[52]=h,e[53]=z,e[54]=u,e[55]=C,e[56]=te):te=e[56];let ae;return e[57]!==ee||e[58]!==te?(ae=n.jsxs("div",{className:"flex h-full w-full min-w-0",children:[ee,te]}),e[57]=ee,e[58]=te,e[59]=ae):ae=e[59],ae}function b8(t){return t+1}function S8(t,e){const s={__resolveType:t},i=iu([s],e)[0];return i?A6(s,i,e):null}function w8({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i,meta:r,decofile:o,blockKey:a,onSaveReferencedBlock:l}){const d=yi(),c=d?.entity?.id===e?d.entity.metadata?.siteSlug??null:null,[h]=M.useState(()=>S8(a,o)),[u,f]=M.useState(h?.data??{}),[m,p]=M.useState([]),[_,L]=M.useState(0),[v,x]=M.useState(!1),[g,y]=M.useState(null),b=g!==null,{save:S,flush:w}=Mg({orgSlug:t,virtualMcpId:e,branch:s}),C=h?.resolveType?Ks(h.resolveType,r):null,N=o[a],T=N?Jl(a,N):a,A={orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i??void 0,siteSlug:c},j=P=>{f(P),S(a,P)},k=()=>{b?(y(null),x(!1),L(P=>P+1)):y(JSON.stringify(u,null,2))},I=P=>{const D=P??"";try{const O=JSON.parse(D);if(O&&typeof O=="object"&&!Array.isArray(O)){x(!1),j(O);return}x(!0)}catch{x(!0)}},E=[T,...m],R=P=>{p(m.slice(0,P)),L(D=>D+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:ph},"aria-hidden":!0}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((P,D)=>{const O=D===E.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(Gi,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>R(D),title:P,className:le("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",O?"font-medium text-foreground":"text-muted-foreground"),children:P})]},`${P}-${D}`)})}),n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:b?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:k,"aria-label":b?"Close JSON editor":"Edit as JSON","aria-pressed":b,children:b?n.jsx(mo,{size:14}):n.jsx(lo,{size:14})})}),n.jsx(Te,{side:"bottom",children:b?"Close JSON editor":"Edit as JSON"})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:"Global section — changes save automatically and apply everywhere it's used."})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Wi,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:C?n.jsx(vi,{schema:C,value:u,onChange:P=>j(P),basePath:"",breadcrumbPath:m,onBreadcrumbChange:p,meta:r,decofile:o,onSaveReferencedBlock:l,sandbox:A},_):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields for this section."})})})}),g!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[v&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:"Invalid JSON — changes aren't saved until it parses."}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(sh,{language:"json",height:"100%",code:g,onChange:I,onSave:P=>{I(P),w()}})})]})]})]})})}function Bc(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),i=`${s} (copy)`;if(!t.has(i))return i;for(let r=2;r<1e3;r++){const o=`${s} (copy ${r})`;if(!t.has(o))return o}return`${s} (copy ${Date.now()})`}function C8(t,e){const s=Ri,i=e.replace(/-copy(?:-\d+)?$/,""),r=`${i}-copy`;if(!t.has(s(r)))return r;for(let o=2;o<1e3;o++){const a=`${i}-copy-${o}`;if(!t.has(s(a)))return a}return`${i}-copy-${Date.now()}`}function k8(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),i=`${s}_copy`;if(!Object.hasOwn(t,i))return i;for(let r=2;r<1e3;r++){const o=`${s}_copy_${r}`;if(!Object.hasOwn(t,o))return o}return`${s}_copy_${Date.now()}`}function j8(t){const e=a9(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function N8(t,e){return du(t,e)}const E8=1e3;function T8(t,e){for(let s=0;s<E8;s++){const i=a9(e);if(!Object.hasOwn(t,i))return i}throw new Error("Could not generate a unique page block key")}const A8={create:"Create new page",duplicate:"Duplicate page",rename:"Rename page"},R8={create:"Create",duplicate:"Duplicate",rename:"Save"},P8={create:"Creating…",duplicate:"Duplicating…",rename:"Saving…"};function D8(t){const e=F.c(54),{open:s,mode:i,initialName:r,initialPath:o,isPending:a,error:l,validate:d,onSubmit:c,onOpenChange:h}=t,u=a===void 0?!1:a,[f,m]=M.useState(r),[p,_]=M.useState(o),[L,v]=M.useState(null),[x,g]=M.useState(s);s!==x&&(g(s),s&&(m(r),_(o),v(null)));let y;e[0]!==u||e[1]!==h?(y=H=>{!H&&!u&&(v(null),h(!1))},e[0]=u,e[1]=h,e[2]=y):y=e[2];const b=y;let S;e[3]!==u||e[4]!==f||e[5]!==c||e[6]!==p||e[7]!==d?(S=async H=>{H.preventDefault();const Z=f.trim(),J=p.trim();if(!Z||!J||u)return;const B=Kl(J);if(B){v(B);return}const X=d?.({name:Z,path:J});if(X){v(X);return}v(null),await c({name:Z,path:J})},e[3]=u,e[4]=f,e[5]=c,e[6]=p,e[7]=d,e[8]=S):S=e[8];const w=S,C=L??l,N=A8[i];let T;e[9]!==N?(T=n.jsx(is,{children:n.jsx(ns,{children:N})}),e[9]=N,e[10]=T):T=e[10];let A;e[11]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[11]=A):A=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=H=>m(H.target.value),e[12]=j):j=e[12];let k;e[13]!==u||e[14]!==f?(k=n.jsxs("div",{className:"space-y-1.5",children:[A,n.jsx(ze,{id:"page-form-name",value:f,onChange:j,placeholder:"My page",autoFocus:!0,disabled:u})]}),e[13]=u,e[14]=f,e[15]=k):k=e[15];let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:"Path"}),e[16]=I):I=e[16];let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=H=>_(H.target.value),e[17]=E):E=e[17];let R;e[18]!==u||e[19]!==p?(R=n.jsxs("div",{className:"space-y-1.5",children:[I,n.jsx(ze,{id:"page-form-path",value:p,onChange:E,placeholder:"/example",disabled:u})]}),e[18]=u,e[19]=p,e[20]=R):R=e[20];let P;e[21]!==C?(P=C&&n.jsx("p",{className:"text-xs text-destructive",children:C}),e[21]=C,e[22]=P):P=e[22];let D;e[23]!==R||e[24]!==P||e[25]!==k?(D=n.jsxs("div",{className:"space-y-4 py-4",children:[k,R,P]}),e[23]=R,e[24]=P,e[25]=k,e[26]=D):D=e[26];let O;e[27]!==h?(O=()=>h(!1),e[27]=h,e[28]=O):O=e[28];let $;e[29]!==u||e[30]!==O?($=n.jsx(ie,{type:"button",variant:"outline",onClick:O,disabled:u,children:"Cancel"}),e[29]=u,e[30]=O,e[31]=$):$=e[31];let K;e[32]!==u||e[33]!==f||e[34]!==p?(K=!f.trim()||!p.trim()||u,e[32]=u,e[33]=f,e[34]=p,e[35]=K):K=e[35];let z;e[36]!==u||e[37]!==i?(z=u?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),P8[i]]}):R8[i],e[36]=u,e[37]=i,e[38]=z):z=e[38];let U;e[39]!==K||e[40]!==z?(U=n.jsx(ie,{type:"submit",disabled:K,children:z}),e[39]=K,e[40]=z,e[41]=U):U=e[41];let G;e[42]!==$||e[43]!==U?(G=n.jsxs(qs,{children:[$,U]}),e[42]=$,e[43]=U,e[44]=G):G=e[44];let q;e[45]!==w||e[46]!==D||e[47]!==G||e[48]!==T?(q=n.jsx($t,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[T,D,G]})}),e[45]=w,e[46]=D,e[47]=G,e[48]=T,e[49]=q):q=e[49];let W;return e[50]!==b||e[51]!==s||e[52]!==q?(W=n.jsx(Ot,{open:s,onOpenChange:b,children:q}),e[50]=b,e[51]=s,e[52]=q,e[53]=W):W=e[53],W}function I8(t){const e=F.c(43),{open:s,blockKey:i,initialName:r,isPending:o,onSubmit:a,onOpenChange:l}=t,d=o===void 0?!1:o,[c,h]=M.useState(r),[u,f]=M.useState(s);s!==u&&(f(s),s&&h(r));let m;e[0]!==d||e[1]!==l?(m=R=>{!R&&!d&&l(!1)},e[0]=d,e[1]=l,e[2]=m):m=e[2];const p=m;let _;e[3]!==d||e[4]!==c||e[5]!==a?(_=async R=>{R.preventDefault();const P=c.trim();!P||d||await a(P)},e[3]=d,e[4]=c,e[5]=a,e[6]=_):_=e[6];const L=_;let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsxs(is,{children:[n.jsx(ns,{children:"Rename section"}),n.jsx(qi,{children:"Updates the display name. The internal key stays the same so pages referencing this section keep working."})]}),e[7]=v):v=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=R=>h(R.target.value),e[9]=g):g=e[9];let y;e[10]!==d||e[11]!==c?(y=n.jsxs("div",{className:"space-y-1.5",children:[x,n.jsx(ze,{id:"section-rename-name",value:c,onChange:g,autoFocus:!0,disabled:d})]}),e[10]=d,e[11]=c,e[12]=y):y=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Key"}),e[13]=b):b=e[13];let S;e[14]!==i?(S=n.jsxs("div",{className:"space-y-1.5",children:[b,n.jsx(ze,{value:i,readOnly:!0,disabled:!0,className:"font-mono"})]}),e[14]=i,e[15]=S):S=e[15];let w;e[16]!==y||e[17]!==S?(w=n.jsxs("div",{className:"space-y-4 py-4",children:[y,S]}),e[16]=y,e[17]=S,e[18]=w):w=e[18];let C;e[19]!==l?(C=()=>l(!1),e[19]=l,e[20]=C):C=e[20];let N;e[21]!==d||e[22]!==C?(N=n.jsx(ie,{type:"button",variant:"outline",onClick:C,disabled:d,children:"Cancel"}),e[21]=d,e[22]=C,e[23]=N):N=e[23];let T;e[24]!==d||e[25]!==c?(T=!c.trim()||d,e[24]=d,e[25]=c,e[26]=T):T=e[26];let A;e[27]!==d?(A=d?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[27]=d,e[28]=A):A=e[28];let j;e[29]!==T||e[30]!==A?(j=n.jsx(ie,{type:"submit",disabled:T,children:A}),e[29]=T,e[30]=A,e[31]=j):j=e[31];let k;e[32]!==N||e[33]!==j?(k=n.jsxs(qs,{children:[N,j]}),e[32]=N,e[33]=j,e[34]=k):k=e[34];let I;e[35]!==L||e[36]!==w||e[37]!==k?(I=n.jsx($t,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:L,children:[v,w,k]})}),e[35]=L,e[36]=w,e[37]=k,e[38]=I):I=e[38];let E;return e[39]!==p||e[40]!==s||e[41]!==I?(E=n.jsx(Ot,{open:s,onOpenChange:p,children:I}),e[39]=p,e[40]=s,e[41]=I,e[42]=E):E=e[42],E}const Ko={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},L9=["posts","authors","categories"],En={posts:"post",authors:"author",categories:"category"};function Tn(t){return L9.includes(t)}const v9={posts:"post",authors:"author",categories:"category"},Bu={posts:Ko.post,authors:Ko.author,categories:Ko.category},M8=Object.fromEntries(Object.entries(Bu).map(([t,e])=>[e,t]));function B8(t){return typeof t=="string"?M8[t]??null:null}function Oi(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function as(t){return typeof t=="string"?t:""}function O8(t,e){switch(t){case"posts":return{label:as(e.title)||"Untitled post",subtitle:as(e.slug)};case"authors":return{label:as(e.name)||"Unnamed author",subtitle:as(e.email)};case"categories":return{label:as(e.name)||"Unnamed category",subtitle:as(e.slug)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function Ou(t){const e={posts:[],authors:[],categories:[]};for(const[s,i]of Object.entries(t)){const r=Oi(i);if(!r)continue;const o=B8(r.__resolveType);if(!o)continue;const a=Oi(r[v9[o]])??{},{label:l,subtitle:d}=O8(o,a);e[o].push({key:s,kind:o,label:l,subtitle:d})}for(const s of L9)e[s].sort((i,r)=>i.label.localeCompare(r.label));return e}function $8(t,e){return Ou(t)[e]}function Un(t,e){return $8(t,e).map(s=>({key:s.key,payload:wr(Oi(t[s.key])??void 0,e)}))}const Oc=Object.freeze({});function wr(t,e){return t?Oi(t[v9[e]])??Oc:Oc}function mr(t,e,s){return{name:t,__resolveType:Bu[e],[v9[e]]:s}}function $u(t){return`.deco/blocks/${encodeURIComponent(t)}.json`}function $i(t){return Array.isArray(t)?t:[]}function Us(t){if(typeof t=="string")return t;const e=Oi(t);return e?as(e.slug):""}function z8(t){if(typeof t=="string")return t;const e=Oi(t);return e?as(e.email):""}function F8(t){return Un(t,"posts").map(({key:e,payload:s})=>({key:e,title:as(s.title)||"Untitled post",slug:as(s.slug),date:as(s.date),categorySlugs:$i(s.categories).map(Us).filter(Boolean),authorEmails:$i(s.authors).map(z8).filter(Boolean)}))}function H8(t,e){const s=$i(t.categories);return s.some(i=>Us(i)===e.slug)?t:{...t,categories:[...s,{name:e.name,slug:e.slug}]}}function U8(t,e){const s=$i(t.categories);return s.length===1&&Us(s[0])===e.slug?t:{...t,categories:[{name:e.name,slug:e.slug}]}}function hk(t,e,s){const i=$i(t.categories);if(!i.some(l=>Us(l)===e))return t;const r=i.map(l=>{const d=Us(l);return d===e||d===s.slug?{name:s.name,slug:s.slug}:l}),o=new Set,a=r.filter(l=>{const d=Us(l);return d?o.has(d)?!1:(o.add(d),!0):!0});return{...t,categories:a}}function W8(t,e){const s=$i(t.categories);return s.some(i=>Us(i)===e)?{...t,categories:s.filter(i=>Us(i)!==e)}:t}function ka(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,s=>s.toString(16).padStart(2,"0")).join("").slice(0,t)}function $c(t,e){const s=`collections/blog/${e}/${ka(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function V8(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${ka(8)}`,date:new Date().toISOString().slice(0,10),image:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${ka(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const K8={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},zc="Box";function q8(t){return t.startsWith("site/")?"site":"app"}function G8(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function an(...t){for(const e of t)if(e!==void 0)return e}function uk(t){const e=new Set,s=[],i=t.manifest?.blocks??{};for(const r of Object.values(i))for(const o of Object.keys(r)){if(!X8(o)||e.has(o))continue;e.add(o);const a=_i(o,t),l=Y8(o),d=K8[l],c=q8(o),h=(c==="site"?an(a.title,d?.title):an(d?.title,a.title))??l,u=c==="site"?an(a.description,d?.description):an(d?.description,a.description),f=c==="site"?a.icon:void 0,m=f&&G8(f)?f:void 0,p=m!==void 0?d?.iconName??zc:an(f,d?.iconName)??zc;s.push({resolveType:o,title:h,description:u,iconName:p,iconUrl:m,source:c})}return s.sort((r,o)=>r.title.localeCompare(o.title))}function Y8(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const J8=["blog/sections/blocks/","site/sections/Blog/Post/"];function X8(t){return J8.some(e=>t.startsWith(e))}function zu({orgSlug:t,virtualMcpId:e,branch:s}){return Tt.decofile(`${t}/${e}/${s}`)}function Fu({orgSlug:t,virtualMcpId:e,branch:s},i){return`/api/${t}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${i}`}function Z8(t){const e=F.c(11),s=di();let i;e[0]!==t?(i=async l=>{const{blockKey:d,data:c}=l,h=await fetch(Fu(t,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:$u(d),content:JSON.stringify(c,null,2)})});if(!h.ok){const u=await h.json().catch(Q8);throw new Error(u.error??`Write failed (${h.status})`)}return h.json()},e[0]=t,e[1]=i):i=e[1];let r;e[2]!==t||e[3]!==s?(r=async l=>{const{blockKey:d,data:c}=l,h=zu(t);await s.cancelQueries({queryKey:h});const u=s.getQueryData(h);return s.setQueryData(h,f=>({...f??{},[d]:c})),{previous:u,queryKey:h}},e[2]=t,e[3]=s,e[4]=r):r=e[4];let o;e[5]!==s?(o=(l,d,c)=>{c?.queryKey&&s.setQueryData(c.queryKey,c.previous)},e[5]=s,e[6]=o):o=e[6];let a;return e[7]!==i||e[8]!==r||e[9]!==o?(a={mutationFn:i,onMutate:r,onError:o},e[7]=i,e[8]=r,e[9]=o,e[10]=a):a=e[10],hi(a)}function Q8(){return{}}function ev(t){const e=di();return hi({mutationFn:async({blockKey:s})=>{const i=await fetch(Fu(t,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:$u(s)})});if(!i.ok){const r=await i.json().catch(()=>({}));throw new Error(r.error??`Delete failed (${i.status})`)}return i.json()},onMutate:async({blockKey:s})=>{const i=zu(t);await e.cancelQueries({queryKey:i});const r=e.getQueryData(i);return e.setQueryData(i,o=>{if(!o)return o;const{[s]:a,...l}=o;return l}),{previous:r,queryKey:i}},onError:(s,i,r)=>{r?.queryKey&&e.setQueryData(r.queryKey,r.previous)}})}function tv(t){const e=F.c(20),{open:s,onOpenChange:i,pageKey:r,decofile:o}=t,[a,l]=M.useState(!1),d=o[r];let c;e[0]!==d?(c=d===void 0?"// Page not found.":JSON.stringify(d,null,2),e[0]=d,e[1]=c):c=e[1];const h=c;let u;e[2]!==h?(u=()=>{navigator.clipboard.writeText(h).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},e[2]=h,e[3]=u):u=e[3];const f=u;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(ns,{className:"text-sm font-semibold",children:"Page JSON"}),e[4]=m):m=e[4];let p;e[5]!==a?(p=a?n.jsx(nd,{size:12}):n.jsx(Xt,{size:12}),e[5]=a,e[6]=p):p=e[6];const _=a?"Copied":"Copy";let L;e[7]!==f||e[8]!==p||e[9]!==_?(L=n.jsxs(is,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m,n.jsxs(ie,{variant:"ghost",size:"sm",onClick:f,className:"h-7 gap-1.5 text-xs",children:[p,_]})]}),e[7]=f,e[8]=p,e[9]=_,e[10]=L):L=e[10];let v;e[11]!==h?(v=n.jsx(Wi,{className:"max-h-[70vh]",children:n.jsx("pre",{className:"p-4 text-xs font-mono text-foreground/90 whitespace-pre overflow-auto",children:h})}),e[11]=h,e[12]=v):v=e[12];let x;e[13]!==L||e[14]!==v?(x=n.jsxs($t,{className:"max-w-2xl p-0 gap-0",children:[L,v]}),e[13]=L,e[14]=v,e[15]=x):x=e[15];let g;return e[16]!==i||e[17]!==s||e[18]!==x?(g=n.jsx(Ot,{open:s,onOpenChange:i,children:x}),e[16]=i,e[17]=s,e[18]=x,e[19]=g):g=e[19],g}const Fc=M.lazy(()=>cs(()=>import("./app-editor-C0ZGI6j9.js"),__vite__mapDeps([145,1,2,5,44,7,8,9,10,11,12,13,14,15,16,6,3,4,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,100,146,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,119,120,121,122,123,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.AppEditor}))),sv=M.lazy(()=>cs(()=>import("./post-editor-aN1M0k3q.js"),__vite__mapDeps([147,1,2,28,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,78,77,132,85,86,74,63,55,56,62,88,71,133,115,134,135,136,137,65,97,91,79,48,106,111,112,50,110,68,44,45,46,47,49,51,52,53,54,57,58,59,60,61,64,66,67,69,70,72,73,75,76,102,93,148,81,82,83,84,87,89,90,92,94,95,96,101,103,104,105,107,108,109,80,113,149,146,114,116,117,118,119,120,121,122,123,99,124,125,126,127,128,129,130,131,138,139,140,141])).then(t=>({default:t.PostEditor}))),iv=M.lazy(()=>cs(()=>import("./record-editor-DWU1kNnR.js"),__vite__mapDeps([150,1,2,78,77,93,149,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,146,101,57,58,55,56,59,60,61,62,63,64,65,52,66,44,45,46,47,48,49,50,51,53,54,67,68,69,70,71,72,73,74,75,76,79,92,89,102,103,81,82,83,84,85,86,87,88,90,91,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,119,120,121,122,123,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.RecordEditor}))),nv=M.lazy(()=>cs(()=>import("./category-editor-BEu80DLc.js"),__vite__mapDeps([151,1,2,12,7,8,9,10,11,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,123,78,77,148,81,82,83,84,74,63,55,56,66,65,85,86,87,88,72,89,90,91,50,92,51,76,79,48,93,94,95,96,97,64,111,112,110,44,45,46,47,49,52,53,54,57,58,59,60,61,62,67,68,69,70,71,73,75,101,102,103,104,105,106,107,108,109,80,113,149,146,114,115,116,117,118,119,120,121,122,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.CategoryEditor}))),rv=M.lazy(()=>cs(()=>import("./sections-editor-Da2BXnWh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SectionsEditor}))),ov=M.lazy(()=>cs(()=>import("./seo-editor-CpXgkLht.js"),__vite__mapDeps([152,1,2,5,7,8,9,10,11,12,13,14,15,16,6,3,4,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,98,99,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.SeoEditor}))),av=M.lazy(()=>cs(()=>import("./variant-calendar-BHRaDzz9.js"),__vite__mapDeps([153,1,2,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,77,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,78,79,99,131])).then(t=>({default:t.VariantCalendar}))),ja="oklch(0.65 0.15 160)";function lv(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function cv(t){const e=new Map;for(const s of t){const i=lv(s.resolveType),r=e.get(i);r?r.push(s):e.set(i,[s])}return[...e.entries()].map(([s,i])=>({label:s,sections:i})).sort((s,i)=>s.label.localeCompare(i.label))}function dv(){const t=F.c(18),e=yi(),{data:s}=Hi.useSession(),{currentBranch:i}=Ds(),{org:r}=Fe(),o=e?.entity?.id??null,a=s?.user?.id,l=e?.entity?.metadata,d=a&&i?ro(l?.sandboxMap?.[a]?.[i]):{},c=Object.values(d),u=(c.find(hv)??c[0])?.previewUrl??null,f=Cs(),m=e?.entity?.organization_id??"";let p;t[0]!==r.slug||t[1]!==m?(p={connectionId:pl,orgId:m,orgSlug:r.slug},t[0]=r.slug,t[1]=m,t[2]=p):p=t[2];const _=Pt(p),L=hl(_);let v;t[3]!==i||t[4]!==L||t[5]!==o?(v=()=>{if(!o)return;const S={virtualMcpId:o};i&&(S.branch=i),L.mutate(S)},t[3]=i,t[4]=L,t[5]=o,t[6]=v):v=t[6];const x=v,g=!!o&&!!i&&ca.isStopped(o,i),y=Th({previewUrl:u,appPaused:f.status.state==="paused",userStopped:g});if(y.kind!=="iframe"){let S;return t[7]!==y||t[8]!==x||t[9]!==f.lifecycle||t[10]!==f.phase?(S=n.jsx(Dv,{state:y,claimPhase:f.phase,lifecycle:f.lifecycle,onStart:x}),t[7]=y,t[8]=x,t[9]=f.lifecycle,t[10]=f.phase,t[11]=S):S=t[11],S}if(!o||!i){let S;return t[12]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Ni,{title:"Waiting for sandbox context…"}),t[12]=S):S=t[12],S}let b;return t[13]!==i||t[14]!==r.slug||t[15]!==u||t[16]!==o?(b=n.jsx(fv,{orgSlug:r.slug,virtualMcpId:o,branch:i,previewUrl:u}),t[13]=i,t[14]=r.slug,t[15]=u,t[16]=o,t[17]=b):b=t[17],b}function hv(t){return t.sandboxProviderKind!=="user-desktop"}const Hc=2e3,uv=15;function Uc(t,e,s,i){return typeof e!="string"||s&&(pu(e,s,i)||t.state.dataUpdateCount>=uv)?!1:Hc}function fv({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i}){const r={orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i},{data:o,isLoading:a}=zl(r),[l,d]=M.useState("pages"),[c,h]=M.useState(null),[u,f]=M.useState(null),[m,p]=M.useState(""),[_,L]=M.useState(null),[v,x]=M.useState(null),[g,y]=M.useState("date-desc"),[b,S]=M.useState(()=>new Set),w=()=>S(new Set),[C,N]=M.useState(l);C!==l&&(N(l),p(""),L(null),x(null),y("date-desc"),S(new Set));const{data:T,isLoading:A,isFetching:j}=Fl(r,{refetchInterval:Y=>{const me=Y.state.data;if(l==="apps"&&c&&c.collection==="apps"){const Se=o?.[c.key];return Uc(Y,typeof Se?.__resolveType=="string"?Se.__resolveType:void 0,me)}if(l==="site"&&o){const Se=me?ya(o,me):null,je=o.site,qe=Se?.resolveType??(typeof je?.__resolveType=="string"?je.__resolveType:void 0);return Uc(Y,qe,me,["seo"])}return!1}}),k=(Y,me)=>!pu(Y,T,me)&&(A||j),{catalog:I,isLoading:E}=T_(T??void 0,o??void 0,{enabled:l==="apps"}),R=l9(r),P=y_(r),D=Z8(r),O=ev(r),[$,K]=M.useState(null),[z,U]=M.useState(),[G,q]=M.useState(null),[W,H]=M.useState(null),[Z,J]=M.useState(null),[B,X]=M.useState(null);if(a||A)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!T)return n.jsx(Ni,{title:"Could not load site data."});const V=Yl(o).sort((Y,me)=>Y.name.localeCompare(me.name)),ee=Xl(o,T),te=l==="sections"?h4(T):[],ae=ya(o,T),de=Ou(o),fe=L9.some(Y=>de[Y].length>0),Q=Tn(l)?de[l]:[],se=(fe?Un(o,"categories"):[]).map(({key:Y,payload:me})=>{const Se=typeof me.slug=="string"?me.slug:"",je=typeof me.name=="string"?me.name:"";return{slug:Se||Y,name:je||Se||Y}}).filter(Y=>Y.slug).sort((Y,me)=>Y.name.localeCompare(me.name));if(!Gl(o,T)&&!fe)return n.jsx(Ni,{icon:Ui,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, or apps."});const oe={pages:V.length,sections:ee.length,apps:I.length,posts:de.posts.length,authors:de.authors.length,categories:de.categories.length},he=new Set(V.map(Y=>Ri(Y.path))),xe=new Set(V.map(Y=>Y.name)),ve=new Set(ee.map(Y=>Y.name)),be=async Y=>{const me=o[Y.key];if(!me)return;const Se=au(o,Y.key),je=lu(o,Y.key,Math.max(0,Se-1)),qe=Ag(me.sections,je);if(qe)try{await R.mutateAsync({blockKey:Y.key,data:{...me,sections:qe}}),ue.success(`Variant added to "${Y.name}"`),h({collection:"pages",key:Y.key,path:Y.path})}catch(rt){ue.error(rt instanceof Error?rt.message:"Could not add variant")}},De=()=>{U(void 0),K({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ie=Y=>{U(void 0),K({mode:"duplicate",sourceKey:Y.key,initialName:Bc(xe,Y.name),initialPath:C8(he,Y.path)})},Me=Y=>{U(void 0),K({mode:"rename",sourceKey:Y.key,initialName:Y.name,initialPath:Y.path})},He=async Y=>{if(!$)return;const{mode:me,sourceKey:Se}=$;try{if(me==="create"){const je=N8(Y.name,Y.path),qe=T8(o,Y.name);await R.mutateAsync({blockKey:qe,data:je}),ue.success(`Created "${Y.name}"`),h({collection:"pages",key:qe,path:Y.path})}else if(me==="duplicate"&&Se){const je=o[Se];if(!je)throw new Error("Source page not found");const{key:qe,data:rt}=j8({source:je,pages:V,newName:Y.name,newPath:Y.path});await R.mutateAsync({blockKey:qe,data:rt}),ue.success(`Duplicated as "${Y.name}"`),h({collection:"pages",key:qe,path:Y.path})}else if(me==="rename"&&Se){const je=o[Se];if(!je)throw new Error("Page not found");const qe={...je,name:Y.name,path:Y.path};await R.mutateAsync({blockKey:Se,data:qe}),ue.success("Page updated"),c?.collection==="pages"&&c.key===Se&&h({collection:"pages",key:Se,path:Y.path})}K(null)}catch(je){U(je instanceof Error?je.message:"Save failed")}},Je=({path:Y})=>{if(!$)return null;const me=Ri(Y);return($.mode==="rename"?Ri($.initialPath):null)!==me&&he.has(me)?`A page with path "${Y}" already exists.`:null},ge=async(Y,me,Se)=>{await R.mutateAsync({blockKey:me,data:{...Se,name:me,__resolveType:Y}}),ue.success(`Created section "${me}"`),h({collection:"sections",key:me})},we=P_((Y,me)=>R.mutate({blockKey:Y,data:me})),Be=async Y=>{const me=o[Y.key];if(!me){ue.error("Section not found.");return}const Se=k8(o,Y.key),je=Bc(ve,Y.name),qe={...me,name:je};try{await R.mutateAsync({blockKey:Se,data:qe}),ue.success(`Duplicated "${Y.name}"`),h({collection:"sections",key:Se})}catch(rt){ue.error(rt instanceof Error?rt.message:"Duplicate failed")}},Ne=async Y=>{if(!G)return;const me=o[G];if(!me){ue.error("Section not found.");return}try{await R.mutateAsync({blockKey:G,data:{...me,name:Y}}),ue.success("Section renamed"),q(null)}catch(Se){ue.error(Se instanceof Error?Se.message:"Rename failed")}},nt=async Y=>{const me=$c(o,Y),Se=mr(me,Y,V8(Y));try{await D.mutateAsync({blockKey:me,data:Se}),ue.success(`Created ${En[Y]}`),h({collection:Y,key:me})}catch(je){ue.error(je instanceof Error?je.message:"Could not create")}},Ve=async Y=>{const me=o[Y.key];if(!me){ue.error("Record not found.");return}const Se=$c(o,Y.kind),je=Y.kind==="posts"?"title":"name",qe={...structuredClone(wr(me,Y.kind)),[je]:`${Y.label} (copy)`};try{await D.mutateAsync({blockKey:Se,data:mr(Se,Y.kind,qe)}),ue.success(`Duplicated "${Y.label}"`),h({collection:Y.kind,key:Se})}catch(rt){ue.error(rt instanceof Error?rt.message:"Duplicate failed")}},ye=Y=>{S(me=>{const Se=new Set(me);return Se.has(Y)?Se.delete(Y):Se.add(Y),Se})},_e=Y=>{d("posts"),N("posts"),h(null),f(null),p(""),L(Y||null),x(null),y("date-desc"),S(new Set)},Ue=async(Y,me)=>{const Se=[...b];let je=0;for(const qe of Se){const rt=o[qe],ks=wr(rt,"posts"),Gs=Y==="add"?H8(ks,me):U8(ks,me);Gs!==ks&&(await D.mutateAsync({blockKey:qe,data:mr(qe,"posts",Gs)}),je+=1)}return je},Ze=async(Y,me)=>{const Se=b.size;try{const je=await Ue(Y,me),qe=Y==="add"?"Added to":"Moved",rt=Se-je;ue.success(`${qe} ${je} ${je===1?"post":"posts"}`+(rt>0?` (${rt} already set)`:"")),w(),X(null)}catch(je){ue.error(je instanceof Error?je.message:"Bulk update failed")}},Xe=async()=>{if(W)try{if(W.kind==="blog-bulk"){for(const je of W.keys)await O.mutateAsync({blockKey:je});ue.success(`Deleted ${W.count} ${W.count===1?"post":"posts"}`),c&&c.collection!=="available-section"&&W.keys.includes(c.key)&&h(null),w(),H(null);return}const{kind:Y,key:me,label:Se}=W;if(Y==="blog"){if(W.blogKind==="categories"){const je=wr(o[me],"categories").slug,qe=typeof je=="string"?je:"";if(qe)for(const{key:rt,payload:ks}of Un(o,"posts")){const Gs=W8(ks,qe);Gs!==ks&&await D.mutateAsync({blockKey:rt,data:mr(rt,"posts",Gs)})}}await O.mutateAsync({blockKey:me})}else await P.mutateAsync({blockKey:me});ue.success(`Deleted "${Se}"`),c&&c.collection!=="available-section"&&c.key===me&&h(null),H(null)}catch(Y){ue.error(Y instanceof Error?Y.message:"Delete failed")}},Ke=P.isPending||O.isPending||D.isPending,ce=W?.kind==="blog"?En[W.blogKind]:W?.kind==="blog-bulk"?`${W.count} ${W.count===1?"post":"posts"}`:W?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(pv,{active:l,counts:oe,showBlog:fe,onSelect:Y=>{d(Y),h(null),f(null)}}),l!=="seo"&&l!=="site"&&l!=="calendar"&&n.jsx(gv,{activeCollection:l,pages:V,sections:ee,availableSections:te,appCatalog:I,appCatalogLoading:E,blogEntries:Q,decofile:o,searchQuery:m,onSearchChange:p,postCategoryFilter:_,postAuthorFilter:v,postSort:g,onPostCategoryFilterChange:Y=>{L(Y),S(new Set)},onPostAuthorFilterChange:Y=>{x(Y),S(new Set)},onPostSortChange:y,selectedPostKeys:b,onTogglePostSelect:ye,onSelectAllPosts:Y=>S(new Set(Y)),onClearPostSelection:()=>S(new Set),onBulkUpdateCategory:()=>X({count:b.size}),onBulkDeletePosts:()=>H({kind:"blog-bulk",keys:[...b],count:b.size}),selection:c,onSelect:Y=>{h(Y),f(null)},onCreate:()=>{l==="pages"?De():Tn(l)&&nt(l)},onDuplicatePage:Ie,onRenamePage:Me,onAddPageVariant:be,onDeletePage:Y=>H({kind:"page",key:Y.key,label:Y.name}),onEditPageSeo:Y=>{h({collection:"pages",key:Y.key,path:Y.path}),f(Y.key)},onViewPageJson:Y=>J(Y.key),onDuplicateSection:Be,onRenameSection:Y=>q(Y.key),onDeleteSection:Y=>H({kind:"section",key:Y.key,label:Y.name}),onDuplicateBlog:Ve,onDeleteBlog:Y=>H({kind:"blog",blogKind:Y.kind,key:Y.key,label:Y.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(M.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),children:l==="calendar"?n.jsx(av,{decofile:o}):l==="site"?ae?n.jsx(Fc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:ae.key,block:o[ae.key],decofile:o,meta:T,title:"Site",excludeFields:["seo"],schemaPending:k(ae.resolveType,["seo"]),previewBaseUrl:i},`site:${ae.key}`):n.jsx(Ni,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):l==="seo"?n.jsx(ov,{orgSlug:t,virtualMcpId:e,branch:s,decofile:o,meta:T,target:{kind:"site"},previewBaseUrl:i}):l==="sections"?n.jsx(mv,{selection:c?.collection==="sections"||c?.collection==="available-section"?c:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:i,meta:T,decofile:o,isCreating:R.isPending,onCreateAvailable:ge,onSaveReferencedBlock:we}):c&&c.collection!=="available-section"?c.collection==="apps"?n.jsx(Fc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:c.key,block:o[c.key],decofile:o,meta:T,previewBaseUrl:i,schemaPending:k(typeof o[c.key]?.__resolveType=="string"?String(o[c.key].__resolveType):void 0)},`app:${c.key}`):c.collection==="posts"?n.jsx(sv,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:c.key,block:o[c.key],decofile:o,meta:T,previewBaseUrl:i},`post:${c.key}`):c.collection==="categories"?n.jsx(nv,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:c.key,block:o[c.key],decofile:o,meta:T,onManagePosts:_e,onOpenPost:Y=>{d("posts"),N("posts"),h({collection:"posts",key:Y}),f(null)},previewBaseUrl:i},`category:${c.key}`):c.collection==="authors"?n.jsx(iv,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:c.key,block:o[c.key]},`authors:${c.key}`):n.jsx(rv,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:i??void 0,currentPath:c.collection==="pages"?c.path:"/",activePageBlockKey:c.collection==="pages"?c.key:null,activeGlobalBlockKey:c.collection==="sections"?c.key:null,initialEditSeo:c.collection==="pages"&&u===c.key,onExitSeo:()=>f(null)},c.collection==="pages"?`page:${c.key}`:`section:${c.key}`):n.jsx(Ni,{title:`Select ${Tn(l)?`a ${En[l]}`:l==="pages"?"a page":l==="apps"?"an app":"a section"} to edit`,description:l==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),$&&n.jsx(D8,{open:!!$,mode:$.mode,initialName:$.initialName,initialPath:$.initialPath,isPending:R.isPending,error:z,validate:Je,onSubmit:He,onOpenChange:Y=>{Y||(K(null),U(void 0))}}),G&&n.jsx(I8,{open:!!G,blockKey:G,initialName:ee.find(Y=>Y.key===G)?.name??G,isPending:R.isPending,onSubmit:Ne,onOpenChange:Y=>{Y||q(null)}}),Z&&n.jsx(tv,{open:!!Z,onOpenChange:Y=>{Y||J(null)},pageKey:Z,decofile:o}),B&&n.jsx(Tv,{count:B.count,categories:se,isPending:D.isPending,onApply:(Y,me)=>{Ze(Y,me)},onOpenChange:Y=>{!Y&&!D.isPending&&X(null)}}),n.jsx(Dr,{open:!!W,onOpenChange:Y=>{!Y&&!Ke&&H(null)},children:n.jsxs(Ir,{children:[n.jsxs(Mr,{children:[n.jsx(Br,{children:`Delete ${ce}?`}),n.jsx(Or,{children:W?.kind==="section"?`"${W.label}" will be removed. Pages that still reference it will lose this section.`:W?.kind==="blog-bulk"?`${W.count} ${W.count===1?"post":"posts"} will be removed permanently. This can't be undone.`:W?`"${W.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs($r,{children:[n.jsx(zr,{disabled:Ke,children:"Cancel"}),n.jsx(Fr,{onClick:Y=>{Y.preventDefault(),Xe()},disabled:Ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ke?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Deleting…"]}):"Delete"})]})]})})]})}function mv(t){const e=F.c(30),{selection:s,orgSlug:i,virtualMcpId:r,branch:o,previewUrl:a,meta:l,decofile:d,isCreating:c,onCreateAvailable:h,onSaveReferencedBlock:u}=t;if(!s){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Ni,{title:"Select a section to edit",description:"Pick a saved section to edit it, or an available one to customize and save as global."}),e[0]=p):p=e[0],p}if(s.collection==="available-section"){const p=`available:${s.resolveType}`,_=s.resolveType,L=s.title;let v;e[1]!==s.title?(v=A_(s.title),e[1]=s.title,e[2]=v):v=e[2];let x;e[3]!==h||e[4]!==s.resolveType?(x=(y,b)=>h(s.resolveType,y,b),e[3]=h,e[4]=s.resolveType,e[5]=x):x=e[5];let g;return e[6]!==o||e[7]!==d||e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==i||e[12]!==a||e[13]!==s.resolveType||e[14]!==s.title||e[15]!==p||e[16]!==v||e[17]!==x||e[18]!==r?(g=n.jsx(y8,{orgSlug:i,virtualMcpId:r,branch:o,previewUrl:a,meta:l,decofile:d,resolveType:_,title:L,defaultBlockId:v,isCreating:c,onCreate:x,onSaveReferencedBlock:u},p),e[6]=o,e[7]=d,e[8]=c,e[9]=l,e[10]=u,e[11]=i,e[12]=a,e[13]=s.resolveType,e[14]=s.title,e[15]=p,e[16]=v,e[17]=x,e[18]=r,e[19]=g):g=e[19],g}const f=`saved:${s.key}`;let m;return e[20]!==o||e[21]!==d||e[22]!==l||e[23]!==u||e[24]!==i||e[25]!==a||e[26]!==s.key||e[27]!==f||e[28]!==r?(m=n.jsx(w8,{orgSlug:i,virtualMcpId:r,branch:o,previewUrl:a,meta:l,decofile:d,blockKey:s.key,onSaveReferencedBlock:u},f),e[20]=o,e[21]=d,e[22]=l,e[23]=u,e[24]=i,e[25]=a,e[26]=s.key,e[27]=f,e[28]=r,e[29]=m):m=e[29],m}function Wc(t){const e=F.c(8),{icon:s,label:i,className:r}=t;let o;e[0]!==r?(o=le("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==s?(a=n.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=a):a=e[3];let l;return e[4]!==i||e[5]!==o||e[6]!==a?(l=n.jsxs("div",{className:o,children:[a,i]}),e[4]=i,e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function pv(t){const e=F.c(37),{active:s,counts:i,showBlog:r,onSelect:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:"Content"})}),e[0]=a):a=e[0];const l=s==="pages";let d;e[1]!==i.pages||e[2]!==o||e[3]!==l?(d=n.jsx(Ns,{id:"pages",icon:Ti,label:"Pages",count:i.pages,active:l,onSelect:o}),e[1]=i.pages,e[2]=o,e[3]=l,e[4]=d):d=e[4];const c=s==="sections";let h;e[5]!==i.sections||e[6]!==o||e[7]!==c?(h=n.jsx(Ns,{id:"sections",icon:ri,label:"Sections",count:i.sections,active:c,onSelect:o}),e[5]=i.sections,e[6]=o,e[7]=c,e[8]=h):h=e[8];const u=s==="apps";let f;e[9]!==i.apps||e[10]!==o||e[11]!==u?(f=n.jsx(Ns,{id:"apps",icon:eh,label:"Apps",count:i.apps,active:u,onSelect:o}),e[9]=i.apps,e[10]=o,e[11]=u,e[12]=f):f=e[12];const m=s==="site";let p;e[13]!==o||e[14]!==m?(p=n.jsx(Ns,{id:"site",icon:Y2,label:"Site",active:m,onSelect:o}),e[13]=o,e[14]=m,e[15]=p):p=e[15];const _=s==="seo";let L;e[16]!==o||e[17]!==_?(L=n.jsx(Ns,{id:"seo",icon:Pr,label:"SEO",active:_,onSelect:o}),e[16]=o,e[17]=_,e[18]=L):L=e[18];const v=s==="calendar";let x;e[19]!==o||e[20]!==v?(x=n.jsx(Ns,{id:"calendar",icon:Md,label:"Calendar",active:v,onSelect:o}),e[19]=o,e[20]=v,e[21]=x):x=e[21];let g;e[22]!==s||e[23]!==i.authors||e[24]!==i.categories||e[25]!==i.posts||e[26]!==o||e[27]!==r?(g=r&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[n.jsx(La,{size:13,className:"shrink-0"}),"Blog"]}),n.jsx(Ns,{id:"posts",icon:Di,label:"Posts",count:i.posts,active:s==="posts",onSelect:o}),n.jsx(Ns,{id:"authors",icon:Tl,label:"Authors",count:i.authors,active:s==="authors",onSelect:o}),n.jsx(Ns,{id:"categories",icon:yl,label:"Categories",count:i.categories,active:s==="categories",onSelect:o})]}),e[22]=s,e[23]=i.authors,e[24]=i.categories,e[25]=i.posts,e[26]=o,e[27]=r,e[28]=g):g=e[28];let y;return e[29]!==L||e[30]!==x||e[31]!==g||e[32]!==d||e[33]!==h||e[34]!==f||e[35]!==p?(y=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[a,n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[d,h,f,p,L,x,g]})]}),e[29]=L,e[30]=x,e[31]=g,e[32]=d,e[33]=h,e[34]=f,e[35]=p,e[36]=y):y=e[36],y}function Ns(t){const e=F.c(18),{id:s,icon:i,label:r,count:o,active:a,onSelect:l}=t;let d;e[0]!==s||e[1]!==l?(d=()=>l(s),e[0]=s,e[1]=l,e[2]=d):d=e[2];const c=a?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==c?(h=le("flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",c),e[3]=c,e[4]=h):h=e[4];let u;e[5]!==i?(u=n.jsx(i,{size:16,className:"shrink-0"}),e[5]=i,e[6]=u):u=e[6];let f;e[7]!==r?(f=n.jsx("span",{className:"flex-1 truncate",children:r}),e[7]=r,e[8]=f):f=e[8];let m;e[9]!==a||e[10]!==o?(m=o!==void 0&&n.jsx("span",{className:le("shrink-0 text-xs tabular-nums",a?"text-accent-foreground/70":"text-muted-foreground/70"),children:o}),e[9]=a,e[10]=o,e[11]=m):m=e[11];let p;return e[12]!==d||e[13]!==h||e[14]!==u||e[15]!==f||e[16]!==m?(p=n.jsxs("button",{type:"button",onClick:d,className:h,children:[u,f,m]}),e[12]=d,e[13]=h,e[14]=u,e[15]=f,e[16]=m,e[17]=p):p=e[17],p}function gv(t){const e=F.c(75),{activeCollection:s,pages:i,sections:r,availableSections:o,appCatalog:a,appCatalogLoading:l,blogEntries:d,decofile:c,searchQuery:h,onSearchChange:u,postCategoryFilter:f,postAuthorFilter:m,postSort:p,onPostCategoryFilterChange:_,onPostAuthorFilterChange:L,onPostSortChange:v,selectedPostKeys:x,onTogglePostSelect:g,onSelectAllPosts:y,onClearPostSelection:b,onBulkUpdateCategory:S,onBulkDeletePosts:w,selection:C,onSelect:N,onCreate:T,onDuplicatePage:A,onRenamePage:j,onAddPageVariant:k,onDeletePage:I,onEditPageSeo:E,onViewPageJson:R,onDuplicateSection:P,onRenameSection:D,onDeleteSection:O,onDuplicateBlog:$,onDeleteBlog:K}=t;let z,U,G,q,W,H,Z;if(e[0]!==s||e[1]!==a||e[2]!==l||e[3]!==o||e[4]!==d||e[5]!==c||e[6]!==k||e[7]!==w||e[8]!==S||e[9]!==b||e[10]!==T||e[11]!==K||e[12]!==I||e[13]!==O||e[14]!==$||e[15]!==A||e[16]!==P||e[17]!==E||e[18]!==L||e[19]!==_||e[20]!==v||e[21]!==j||e[22]!==D||e[23]!==u||e[24]!==N||e[25]!==y||e[26]!==g||e[27]!==R||e[28]!==i||e[29]!==m||e[30]!==f||e[31]!==p||e[32]!==h||e[33]!==r||e[34]!==x||e[35]!==C){const V=h.toLowerCase(),ee=i.filter(ce=>!V||ce.name.toLowerCase().includes(V)||ce.path.toLowerCase().includes(V)),te=r.filter(ce=>!V||ce.name.toLowerCase().includes(V)||ce.key.toLowerCase().includes(V)||ce.resolveType.toLowerCase().includes(V)),ae=o.filter(ce=>!V||ce.title.toLowerCase().includes(V)||ce.resolveType.toLowerCase().includes(V)||(ce.description?.toLowerCase().includes(V)??!1)),de=cv(te),fe=a.filter(ce=>!V||ce.title.toLowerCase().includes(V)||ce.app.toLowerCase().includes(V)||ce.vendor.toLowerCase().includes(V)||ce.category.toLowerCase().includes(V)),Q=d.filter(ce=>!V||ce.label.toLowerCase().includes(V)||ce.subtitle.toLowerCase().includes(V)),se=s==="posts",oe=xv,he=se?F8(c):[],xe=new Map,ve=new Map;for(const ce of he){for(const Y of ce.categorySlugs)xe.set(Y,(xe.get(Y)??0)+1);for(const Y of ce.authorEmails)ve.set(Y,(ve.get(Y)??0)+1)}const be=(se?Un(c,"categories"):[]).map(ce=>{const{key:Y,payload:me}=ce,Se=oe(me.slug)||Y;return{slug:Se,name:oe(me.name)||oe(me.slug)||Y,count:xe.get(Se)??0}}).filter(vv),De=(se?Un(c,"authors"):[]).map(ce=>{const{key:Y,payload:me}=ce,Se=oe(me.email);return{email:Se,name:oe(me.name)||oe(me.email)||Y,count:ve.get(Se)??0}}).filter(Lv);let Ie;e[43]!==f?(Ie=ce=>!f||ce.categorySlugs.includes(f),e[43]=f,e[44]=Ie):Ie=e[44];let Me;e[45]!==m?(Me=ce=>!m||ce.authorEmails.includes(m),e[45]=m,e[46]=Me):Me=e[46];let He;e[47]!==p?(He=(ce,Y)=>{if(p==="az")return ce.title.localeCompare(Y.title);if(p==="za")return Y.title.localeCompare(ce.title);const me=ce.date.localeCompare(Y.date);return p==="date-asc"?me:-me},e[47]=p,e[48]=He):He=e[48];const Je=he.filter(ce=>!V||ce.title.toLowerCase().includes(V)||ce.slug.toLowerCase().includes(V)).filter(Ie).filter(Me).sort(He),ge=x.size,we=Je.map(_v),Be=we.length>0&&we.every(ce=>x.has(ce)),Ne=ge>0,nt=()=>{Be?b():y(we)},Ve=`Search ${s}…`,ye=Tn(s)?`Create new ${En[s]}`:"Create new page",_e=s!=="apps"&&s!=="sections";W="w-[300px] shrink-0 border-r flex flex-col min-h-0";let Ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(Ue=n.jsx(Zd,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[49]=Ue):Ue=e[49];let Ze;e[50]!==u?(Ze=ce=>u(ce.target.value),e[50]=u,e[51]=Ze):Ze=e[51];let Xe;e[52]!==Ve||e[53]!==h||e[54]!==Ze?(Xe=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[Ue,n.jsx("input",{type:"text",value:h,onChange:Ze,placeholder:Ve,"aria-label":Ve,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[52]=Ve,e[53]=h,e[54]=Ze,e[55]=Xe):Xe=e[55];let Ke;e[56]!==ye||e[57]!==T||e[58]!==_e?(Ke=_e&&n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:T,"aria-label":ye,children:n.jsx(Dt,{size:14})})}),n.jsx(Te,{side:"bottom",children:ye})]}),e[56]=ye,e[57]=T,e[58]=_e,e[59]=Ke):Ke=e[59],e[60]!==Xe||e[61]!==Ke?(H=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Xe,Ke]}),e[60]=Xe,e[61]=Ke,e[62]=H):H=e[62],Z=se&&(Ne?n.jsx(Ev,{count:ge,allSelected:Be,onToggleSelectAll:nt,onUpdateCategory:S,onDelete:w,onExit:b}):n.jsx(bv,{categories:be,authors:De,categoryFilter:f,authorFilter:m,sort:p,onCategoryFilterChange:_,onAuthorFilterChange:L,onSortChange:v})),z=Wi,q="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",U="flex flex-col gap-1 p-1.5",G=s==="pages"?ee.length===0?n.jsx(ln,{hasItems:i.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):ee.map(ce=>{const Y=C?.collection==="pages"&&C.key===ce.key,me=au(c,ce.key);return n.jsx(Si,{icon:Ti,title:ce.name,subtitle:ce.path,active:Y,variantCount:me,onClick:()=>N({collection:"pages",key:ce.key,path:ce.path}),menu:n.jsx(pr,{onDuplicate:()=>A(ce),onRename:()=>j(ce),onAddVariant:()=>k(ce),onEditSeo:()=>E(ce),onViewJson:()=>R(ce),onDelete:()=>I(ce)})},ce.key)}):s==="sections"?te.length===0&&ae.length===0?n.jsx(ln,{hasItems:r.length>0||o.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[de.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Wc,{icon:ri,label:"Saved sections"}),de.map(ce=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:ce.label}),ce.sections.map(Y=>{const me=C?.collection==="sections"&&C.key===Y.key;return n.jsx(Si,{icon:ri,accent:"global",title:Y.name,subtitle:ce.label,active:me,onClick:()=>N({collection:"sections",key:Y.key}),menu:n.jsx(pr,{onDuplicate:()=>P(Y),onRename:()=>D(Y),onDelete:()=>O(Y)})},Y.key)})]},ce.label))]}),ae.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Wc,{icon:Ti,label:"Available sections",className:le(de.length>0&&"mt-3")}),ae.map(ce=>{const Y=C?.collection==="available-section"&&C.resolveType===ce.resolveType,me=ce.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(Si,{icon:Ti,title:ce.title,subtitle:me??ce.resolveType,active:Y,onClick:()=>N({collection:"available-section",resolveType:ce.resolveType,title:ce.title})},ce.resolveType)})]})]}):s==="apps"?l?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Oe,{size:18,className:"animate-spin text-muted-foreground"})}):fe.length===0?n.jsx(ln,{hasItems:a.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):fe.map(ce=>{const Y=C?.collection==="apps"&&ce.blockKey!==null&&C.key===ce.blockKey;return n.jsx(Si,{icon:eh,logoUrl:ce.logo,title:ce.title,subtitle:ce.category,active:Y,trailing:ce.installed?n.jsx("span",{className:"shrink-0 rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-700 dark:text-emerald-400",children:"Installed"}):void 0,onClick:()=>{if(!ce.installed||!ce.blockKey){ue.message(`${ce.title} is not installed on this site.`);return}N({collection:"apps",key:ce.blockKey})}},ce.id)}):se?Je.length===0?n.jsx(ln,{hasItems:he.length>0,emptyLabel:"No posts yet.",emptyHint:'Click "+" to create your first post.'}):Je.map(ce=>{const Y={key:ce.key,kind:"posts",label:ce.title,subtitle:ce.slug};return n.jsx(Si,{icon:Di,title:ce.title,subtitle:ce.slug,active:C?.collection==="posts"&&C.key===ce.key,selectable:!0,selectionActive:Ne,selected:x.has(ce.key),onToggleSelect:()=>g(ce.key),onClick:()=>Ne?g(ce.key):N({collection:"posts",key:ce.key}),menu:n.jsx(pr,{onDuplicate:()=>$(Y),onDelete:()=>K(Y)})},ce.key)}):Q.length===0?n.jsx(ln,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${Tn(s)?En[s]:"item"}.`}):Q.map(ce=>{const Y=C?.collection===ce.kind&&C.key===ce.key;return n.jsx(Si,{icon:ce.kind==="posts"?Di:ce.kind==="authors"?Tl:yl,title:ce.label,subtitle:ce.subtitle,active:Y,onClick:()=>N({collection:ce.kind,key:ce.key}),menu:n.jsx(pr,{onDuplicate:()=>$(ce),onDelete:()=>K(ce)})},ce.key)}),e[0]=s,e[1]=a,e[2]=l,e[3]=o,e[4]=d,e[5]=c,e[6]=k,e[7]=w,e[8]=S,e[9]=b,e[10]=T,e[11]=K,e[12]=I,e[13]=O,e[14]=$,e[15]=A,e[16]=P,e[17]=E,e[18]=L,e[19]=_,e[20]=v,e[21]=j,e[22]=D,e[23]=u,e[24]=N,e[25]=y,e[26]=g,e[27]=R,e[28]=i,e[29]=m,e[30]=f,e[31]=p,e[32]=h,e[33]=r,e[34]=x,e[35]=C,e[36]=z,e[37]=U,e[38]=G,e[39]=q,e[40]=W,e[41]=H,e[42]=Z}else z=e[36],U=e[37],G=e[38],q=e[39],W=e[40],H=e[41],Z=e[42];let J;e[63]!==U||e[64]!==G?(J=n.jsx("div",{className:U,children:G}),e[63]=U,e[64]=G,e[65]=J):J=e[65];let B;e[66]!==z||e[67]!==q||e[68]!==J?(B=n.jsx(z,{className:q,children:J}),e[66]=z,e[67]=q,e[68]=J,e[69]=B):B=e[69];let X;return e[70]!==W||e[71]!==H||e[72]!==Z||e[73]!==B?(X=n.jsxs("div",{className:W,children:[H,Z,B]}),e[70]=W,e[71]=H,e[72]=Z,e[73]=B,e[74]=X):X=e[74],X}function _v(t){return t.key}function Lv(t){return t.email}function vv(t){return t.slug}function xv(t){return typeof t=="string"?t:""}const Vc="__all__",Hu={"date-desc":"Newest first","date-asc":"Oldest first",az:"Title A–Z",za:"Title Z–A"},yv={"date-desc":"Newest","date-asc":"Oldest",az:"A–Z",za:"Z–A"},Kc=M.forwardRef(function(e,s){const i=F.c(20);let r,o,a,l,d;i[0]!==e?({icon:r,active:o,value:d,className:a,...l}=e,i[0]=e,i[1]=r,i[2]=o,i[3]=a,i[4]=l,i[5]=d):(r=i[1],o=i[2],a=i[3],l=i[4],d=i[5]);const c=o?"text-foreground":"text-muted-foreground";let h;i[6]!==a||i[7]!==c?(h=le("h-7 gap-1 px-1.5 text-xs",c,a),i[6]=a,i[7]=c,i[8]=h):h=i[8];let u;i[9]!==r?(u=n.jsx(r,{size:14,className:"shrink-0"}),i[9]=r,i[10]=u):u=i[10];let f;i[11]!==d?(f=d&&n.jsx("span",{className:"min-w-0 flex-1 truncate",children:d}),i[11]=d,i[12]=f):f=i[12];let m;i[13]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(ds,{size:12,className:"shrink-0 opacity-60"}),i[13]=m):m=i[13];let p;return i[14]!==l||i[15]!==s||i[16]!==h||i[17]!==u||i[18]!==f?(p=n.jsxs(ie,{ref:s,type:"button",variant:"ghost",size:"sm",className:h,...l,children:[u,f,m]}),i[14]=l,i[15]=s,i[16]=h,i[17]=u,i[18]=f,i[19]=p):p=i[19],p});function Uu(t){const e=F.c(2),{count:s}=t;let i;return e[0]!==s?(i=n.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=i):i=e[1],i}function bv(t){const e=F.c(60),{categories:s,authors:i,categoryFilter:r,authorFilter:o,sort:a,onCategoryFilterChange:l,onAuthorFilterChange:d,onSortChange:c}=t;let h;if(e[0]!==s||e[1]!==r){let G;e[3]!==r?(G=q=>q.slug===r,e[3]=r,e[4]=G):G=e[4],h=s.find(G),e[0]=s,e[1]=r,e[2]=h}else h=e[2];const u=h;let f;if(e[5]!==o||e[6]!==i){let G;e[8]!==o?(G=q=>q.email===o,e[8]=o,e[9]=G):G=e[9],f=i.find(G),e[5]=o,e[6]=i,e[7]=f}else f=e[7];const m=f,p=!!(r||o),_=u?.name??m?.name??"Filter",L=r?`cat:${r}`:o?`author:${o}`:Vc;let v;e[10]!==d||e[11]!==l?(v=()=>{l(null),d(null)},e[10]=d,e[11]=l,e[12]=v):v=e[12];const x=v;let g;e[13]!==x||e[14]!==d||e[15]!==l?(g=G=>{G.startsWith("cat:")?(d(null),l(G.slice(4))):G.startsWith("author:")?(l(null),d(G.slice(7))):x()},e[13]=x,e[14]=d,e[15]=l,e[16]=g):g=e[16];const y=g;let b;e[17]!==_||e[18]!==p?(b=n.jsx(es,{asChild:!0,children:n.jsx(Kc,{icon:J2,active:p,value:_,className:"min-w-0 shrink"})}),e[17]=_,e[18]=p,e[19]=b):b=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ir,{children:"Filter by"}),e[20]=S):S=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(ho,{value:Vc,children:"All posts"}),e[21]=w):w=e[21];let C;e[22]!==s.length?(C=s.length>0&&n.jsx(ir,{className:"text-muted-foreground/70",children:"Category"}),e[22]=s.length,e[23]=C):C=e[23];let N;e[24]!==s?(N=s.map(Cv),e[24]=s,e[25]=N):N=e[25];let T;e[26]!==i.length?(T=i.length>0&&n.jsx(ir,{className:"text-muted-foreground/70",children:"Author"}),e[26]=i.length,e[27]=T):T=e[27];let A;e[28]!==i?(A=i.map(wv),e[28]=i,e[29]=A):A=e[29];let j;e[30]!==L||e[31]!==y||e[32]!==T||e[33]!==A||e[34]!==C||e[35]!==N?(j=n.jsxs(ts,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[S,n.jsxs(U9,{value:L,onValueChange:y,children:[w,C,N,T,A]})]}),e[30]=L,e[31]=y,e[32]=T,e[33]=A,e[34]=C,e[35]=N,e[36]=j):j=e[36];let k;e[37]!==j||e[38]!==b?(k=n.jsxs(Qt,{children:[b,j]}),e[37]=j,e[38]=b,e[39]=k):k=e[39];let I;e[40]!==x||e[41]!==p?(I=p&&n.jsx(kv,{label:"Clear filter",onClick:x}),e[40]=x,e[41]=p,e[42]=I):I=e[42];const E=yv[a];let R;e[43]!==E?(R=n.jsx(es,{asChild:!0,children:n.jsx(Kc,{icon:X2,active:!0,value:E})}),e[43]=E,e[44]=R):R=e[44];let P;e[45]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(ir,{children:"Sort by"}),e[45]=P):P=e[45];let D;e[46]!==c?(D=G=>c(G),e[46]=c,e[47]=D):D=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=Object.keys(Hu),e[48]=O):O=e[48];let $;e[49]===Symbol.for("react.memo_cache_sentinel")?($=O.map(Sv),e[49]=$):$=e[49];let K;e[50]!==a||e[51]!==D?(K=n.jsxs(ts,{align:"end",className:"w-44",children:[P,n.jsx(U9,{value:a,onValueChange:D,children:$})]}),e[50]=a,e[51]=D,e[52]=K):K=e[52];let z;e[53]!==R||e[54]!==K?(z=n.jsx("div",{className:"ml-auto shrink-0",children:n.jsxs(Qt,{children:[R,K]})}),e[53]=R,e[54]=K,e[55]=z):z=e[55];let U;return e[56]!==k||e[57]!==I||e[58]!==z?(U=n.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[k,I,z]}),e[56]=k,e[57]=I,e[58]=z,e[59]=U):U=e[59],U}function Sv(t){return n.jsx(ho,{value:t,children:Hu[t]},t)}function wv(t){return n.jsxs(ho,{value:`author:${t.email}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx(Uu,{count:t.count})]},`author:${t.email}`)}function Cv(t){return n.jsxs(ho,{value:`cat:${t.slug}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx(Uu,{count:t.count})]},`cat:${t.slug}`)}function kv(t){const e=F.c(4),{label:s,onClick:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(mo,{size:12}),e[0]=r):r=e[0];let o;return e[1]!==s||e[2]!==i?(o=n.jsx("button",{type:"button","aria-label":s,onClick:i,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:r}),e[1]=s,e[2]=i,e[3]=o):o=e[3],o}function jv(t){const e=F.c(12),{checked:s,disabled:i,onToggle:r}=t;let o;e[0]!==r?(o=()=>r(),e[0]=r,e[1]=o):o=e[1];const a=s?"Deselect all posts":"Select all posts";let l;e[2]!==s||e[3]!==i||e[4]!==o||e[5]!==a?(l=n.jsx(Ee,{asChild:!0,children:n.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:Nv,children:n.jsx(Yi,{checked:s,disabled:i,onCheckedChange:o,"aria-label":a})})}),e[2]=s,e[3]=i,e[4]=o,e[5]=a,e[6]=l):l=e[6];const d=s?"Deselect all":"Select all";let c;e[7]!==d?(c=n.jsx(Te,{side:"bottom",children:d}),e[7]=d,e[8]=c):c=e[8];let h;return e[9]!==l||e[10]!==c?(h=n.jsxs(Ae,{children:[l,c]}),e[9]=l,e[10]=c,e[11]=h):h=e[11],h}function Nv(t){return t.stopPropagation()}function Ev(t){const e=F.c(31),{count:s,allSelected:i,onToggleSelectAll:r,onUpdateCategory:o,onDelete:a,onExit:l}=t;let d;e[0]!==i||e[1]!==r?(d=n.jsx(jv,{checked:i,onToggle:r}),e[0]=i,e[1]=r,e[2]=d):d=e[2];let c;e[3]!==s?(c=n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[s," selected"]}),e[3]=s,e[4]=c):c=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(yl,{size:14}),e[5]=h):h=e[5];let u;e[6]!==o?(u=n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:o,"aria-label":"Set the category for the selected posts",children:[h,"Set category"]})}),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Te,{side:"bottom",children:"Set the category for the selected posts"}),e[8]=f):f=e[8];let m;e[9]!==u?(m=n.jsxs(Ae,{children:[u,f]}),e[9]=u,e[10]=m):m=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(ss,{size:14}),e[11]=p):p=e[11];let _;e[12]!==a?(_=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:a,"aria-label":"Delete selected posts",children:p})}),e[12]=a,e[13]=_):_=e[13];let L;e[14]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Te,{side:"bottom",children:"Delete selected"}),e[14]=L):L=e[14];let v;e[15]!==_?(v=n.jsxs(Ae,{children:[_,L]}),e[15]=_,e[16]=v):v=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(mo,{size:14}),e[17]=x):x=e[17];let g;e[18]!==l?(g=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l,"aria-label":"Exit selection",children:x})}),e[18]=l,e[19]=g):g=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Te,{side:"bottom",children:"Exit selection"}),e[20]=y):y=e[20];let b;e[21]!==g?(b=n.jsxs(Ae,{children:[g,y]}),e[21]=g,e[22]=b):b=e[22];let S;e[23]!==v||e[24]!==b||e[25]!==m?(S=n.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[m,v,b]}),e[23]=v,e[24]=b,e[25]=m,e[26]=S):S=e[26];let w;return e[27]!==d||e[28]!==S||e[29]!==c?(w=n.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[d,c,S]}),e[27]=d,e[28]=S,e[29]=c,e[30]=w):w=e[30],w}function Tv(t){const e=F.c(48),{count:s,categories:i,isPending:r,onApply:o,onOpenChange:a}=t,[l,d]=M.useState(i[0]?.slug??""),[c,h]=M.useState("add");let u;if(e[0]!==i||e[1]!==l){let D;e[3]!==l?(D=O=>O.slug===l,e[3]=l,e[4]=D):D=e[4],u=i.find(D),e[0]=i,e[1]=l,e[2]=u}else u=e[2];const f=u;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(ns,{children:"Update category"}),e[5]=m):m=e[5];const p=s===1?"post":"posts";let _;e[6]!==s||e[7]!==p?(_=n.jsxs(is,{children:[m,n.jsxs(qi,{children:["Choose a category to apply to ",s," ",p,"."]})]}),e[6]=s,e[7]=p,e[8]=_):_=e[8];let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx($e,{children:"Category"}),e[9]=L):L=e[9];let v;e[10]!==i||e[11]!==l?(v=n.jsxs("div",{className:"space-y-2",children:[L,i.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):n.jsxs(jt,{value:l,onValueChange:d,children:[n.jsx(Ct,{className:"w-full",children:n.jsx(Et,{placeholder:"Select a category"})}),n.jsx(kt,{children:i.map(Av)})]})]}),e[10]=i,e[11]=l,e[12]=v):v=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=D=>h(D),e[13]=x):x=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Lc,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[14]=g):g=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsxs($e,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[g,n.jsxs("span",{className:"space-y-0.5",children:[n.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),n.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[15]=y):y=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Lc,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[16]=b):b=e[16];let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsxs($e,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[b,n.jsxs("span",{className:"space-y-0.5",children:[n.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),n.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[17]=S):S=e[17];let w;e[18]!==c?(w=n.jsxs(L_,{value:c,onValueChange:x,className:"gap-2",children:[y,S]}),e[18]=c,e[19]=w):w=e[19];let C;e[20]!==w||e[21]!==v?(C=n.jsxs("div",{className:"space-y-4 py-2",children:[v,w]}),e[20]=w,e[21]=v,e[22]=C):C=e[22];let N;e[23]!==a?(N=()=>a(!1),e[23]=a,e[24]=N):N=e[24];let T;e[25]!==r||e[26]!==N?(T=n.jsx(ie,{type:"button",variant:"outline",onClick:N,disabled:r,children:"Cancel"}),e[25]=r,e[26]=N,e[27]=T):T=e[27];const A=!f||r;let j;e[28]!==c||e[29]!==o||e[30]!==f?(j=()=>f&&o(c,{name:f.name,slug:f.slug}),e[28]=c,e[29]=o,e[30]=f,e[31]=j):j=e[31];let k;e[32]!==r?(k=r?n.jsxs(n.Fragment,{children:[n.jsx(Oe,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[32]=r,e[33]=k):k=e[33];let I;e[34]!==A||e[35]!==j||e[36]!==k?(I=n.jsx(ie,{type:"button",disabled:A,onClick:j,children:k}),e[34]=A,e[35]=j,e[36]=k,e[37]=I):I=e[37];let E;e[38]!==T||e[39]!==I?(E=n.jsxs(qs,{children:[T,I]}),e[38]=T,e[39]=I,e[40]=E):E=e[40];let R;e[41]!==C||e[42]!==E||e[43]!==_?(R=n.jsxs($t,{className:"sm:max-w-md",children:[_,C,E]}),e[41]=C,e[42]=E,e[43]=_,e[44]=R):R=e[44];let P;return e[45]!==a||e[46]!==R?(P=n.jsx(Ot,{open:!0,onOpenChange:a,children:R}),e[45]=a,e[46]=R,e[47]=P):P=e[47],P}function Av(t){return n.jsx(et,{value:t.slug,children:n.jsx("span",{className:"truncate",children:t.name})},t.slug)}function Si(t){const e=F.c(37),{icon:s,logoUrl:i,title:r,subtitle:o,active:a,accent:l,variantCount:d,trailing:c,selectable:h,selectionActive:u,selected:f,onToggleSelect:m,onClick:p,menu:_}=t,L=l==="global";let v;e[0]!==s||e[1]!==a||e[2]!==L||e[3]!==i||e[4]!==d?(v=d&&d>1?n.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center",children:n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(s,{size:16,className:"shrink-0",style:{color:ja}})}),n.jsxs(Te,{side:"right",children:[d," variants"]})]})}):i?n.jsx("img",{src:i,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:le("flex size-8 shrink-0 items-center justify-center rounded-lg",L?"bg-global-section/15":"bg-muted"),children:n.jsx(s,{size:16,className:le("shrink-0",!L&&(a?"text-accent-foreground":"text-muted-foreground")),style:L?{color:ph}:void 0})}),e[0]=s,e[1]=a,e[2]=L,e[3]=i,e[4]=d,e[5]=v):v=e[5];const x=v,g=a?L?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":L?"hover:bg-global-section/10":"hover:bg-muted";let y;e[6]!==g?(y=le("group relative flex min-w-0 items-center rounded-md transition-colors",g),e[6]=g,e[7]=y):y=e[7];let b;e[8]!==m||e[9]!==h||e[10]!==f||e[11]!==u||e[12]!==r?(b=h&&n.jsx("span",{className:le("flex shrink-0 items-center pl-2.5 transition-opacity",f||u?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Rv,children:n.jsx(Yi,{checked:f,onCheckedChange:()=>m?.(),"aria-label":`Select ${r}`})}),e[8]=m,e[9]=h,e[10]=f,e[11]=u,e[12]=r,e[13]=b):b=e[13];let S;e[14]!==r?(S=n.jsx("span",{className:"block truncate text-sm font-medium",children:r}),e[14]=r,e[15]=S):S=e[15];const w=a?"text-accent-foreground/70":"text-muted-foreground";let C;e[16]!==w?(C=le("block truncate text-xs",w),e[16]=w,e[17]=C):C=e[17];let N;e[18]!==o||e[19]!==C?(N=n.jsx("span",{className:C,children:o}),e[18]=o,e[19]=C,e[20]=N):N=e[20];let T;e[21]!==S||e[22]!==N?(T=n.jsxs("span",{className:"min-w-0 flex-1",children:[S,N]}),e[21]=S,e[22]=N,e[23]=T):T=e[23];let A;e[24]!==p||e[25]!==x||e[26]!==T||e[27]!==c?(A=n.jsxs("button",{type:"button",onClick:p,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-2 text-left cursor-pointer",children:[x,T,c]}),e[24]=p,e[25]=x,e[26]=T,e[27]=c,e[28]=A):A=e[28];let j;e[29]!==a||e[30]!==_?(j=_&&n.jsx("div",{className:le("pr-1 opacity-0 transition-opacity group-hover:opacity-100",a&&"opacity-100"),children:_}),e[29]=a,e[30]=_,e[31]=j):j=e[31];let k;return e[32]!==A||e[33]!==j||e[34]!==y||e[35]!==b?(k=n.jsxs("div",{className:y,children:[b,A,j]}),e[32]=A,e[33]=j,e[34]=y,e[35]=b,e[36]=k):k=e[36],k}function Rv(t){return t.stopPropagation()}function pr(t){const e=F.c(21),{onDuplicate:s,onRename:i,onAddVariant:r,onEditSeo:o,onViewJson:a,onDelete:l}=t;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(es,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"More actions",className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Pv,children:n.jsx(Vi,{size:14})})}),e[0]=d):d=e[0];let c;e[1]!==i?(c=i&&n.jsxs(We,{onClick:i,children:[n.jsx(Al,{size:14}),"Rename"]}),e[1]=i,e[2]=c):c=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Xt,{size:14}),e[3]=h):h=e[3];let u;e[4]!==s?(u=n.jsxs(We,{onClick:s,children:[h,"Duplicate"]}),e[4]=s,e[5]=u):u=e[5];let f;e[6]!==r?(f=r&&n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),n.jsxs(We,{onClick:r,className:"cursor-pointer",style:{color:ja},children:[n.jsx(Bd,{size:14,style:{color:ja}}),"Add variant"]})]}),e[6]=r,e[7]=f):f=e[7];let m;e[8]!==o||e[9]!==a?(m=(o||a)&&n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),o&&n.jsxs(We,{onClick:o,children:[n.jsx(Pr,{size:14}),"Edit SEO"]}),a&&n.jsxs(We,{onClick:a,children:[n.jsx(lo,{size:14}),"View JSON"]})]}),e[8]=o,e[9]=a,e[10]=m):m=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Cn,{}),e[11]=p):p=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ss,{size:14}),e[12]=_):_=e[12];let L;e[13]!==l?(L=n.jsxs(We,{onClick:l,className:"text-destructive focus:text-destructive",children:[_,"Delete"]}),e[13]=l,e[14]=L):L=e[14];let v;return e[15]!==c||e[16]!==u||e[17]!==f||e[18]!==m||e[19]!==L?(v=n.jsxs(Qt,{children:[d,n.jsxs(ts,{align:"end",className:"w-44",children:[c,u,f,m,p,L]})]}),e[15]=c,e[16]=u,e[17]=f,e[18]=m,e[19]=L,e[20]=v):v=e[20],v}function Pv(t){return t.stopPropagation()}function ln(t){const e=F.c(6),{hasItems:s,emptyLabel:i,emptyHint:r}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s?(o=s?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:i}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:r})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o):o=e[3];let a;return e[4]!==o?(a=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:o}),e[4]=o,e[5]=a):a=e[5],a}function Dv(t){const e=F.c(8),{state:s,claimPhase:i,lifecycle:r,onStart:o}=t;switch(s.kind){case"starting":{let a;e[0]!==i||e[1]!==r?(a=uu({claimPhase:i,lifecycle:r}),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;return e[3]!==i||e[4]!==a?(l=n.jsx(Jr,{kind:"starting",progress:a,claimPhase:i}),e[3]=i,e[4]=a,e[5]=l):l=e[5],l}case"suspended":{let a;return e[6]!==o?(a=n.jsx(Jr,{kind:"suspended",onResume:o}),e[6]=o,e[7]=a):a=e[7],a}}}function Ni(t){const e=F.c(10),{icon:s,title:i,description:r}=t;let o;e[0]!==s?(o=s&&n.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=o):o=e[1];let a;e[2]!==i?(a=n.jsx("div",{children:i}),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==r?(l=r&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:r}),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==o||e[7]!==a||e[8]!==l?(d=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[o,a,l]}),e[6]=o,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function Iv(t){const e=F.c(2),{virtualMcpId:s}=t,i=xs(s);if(!ni(i?.metadata)){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[n.jsx(Ui,{size:24,className:"text-muted-foreground/60"}),n.jsx("div",{children:"No content to edit."}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Connect a GitHub repository from the Settings tab to enable Content."})]}),e[0]=a):a=e[0],a}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(dv,{}),e[1]=o):o=e[1],o}const qo={fast:{label:"Fast",subtitle:"Quick responses for simple tasks",icon:Pd},smart:{label:"Smart",subtitle:"Balanced quality and speed",icon:ti},thinking:{label:"Thinking",subtitle:"Deeper reasoning for hard tasks",icon:tm}},Mv=["fast","smart","thinking"];function Bv(t){const e=F.c(15),{tier:s,onSelect:i}=t,[r,o]=M.useState(!1),a=qo[s].icon;let l;e[0]!==a?(l=n.jsx(a,{size:14,className:"text-muted-foreground"}),e[0]=a,e[1]=l):l=e[1];const d=qo[s];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ds,{size:14,className:"text-muted-foreground"}),e[2]=c):c=e[2];let h;e[3]!==l||e[4]!==d.label?(h=n.jsx(Ss,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[l,d.label,c]})}),e[3]=l,e[4]=d.label,e[5]=h):h=e[5];let u;e[6]!==i||e[7]!==s?(u=Mv.map(p=>{const _=qo[p],L=_.icon;return n.jsxs("button",{type:"button",onClick:()=>{i(p),o(!1)},className:le("flex items-start gap-2 px-2 py-1.5 rounded-md text-left hover:bg-muted"),children:[n.jsx(L,{size:16,className:"shrink-0 text-muted-foreground mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"text-sm",children:_.label}),n.jsx("div",{className:"text-xs text-muted-foreground",children:_.subtitle})]}),p===s&&n.jsx(Ls,{size:14,className:"text-foreground mt-0.5"})]},p)}),e[6]=i,e[7]=s,e[8]=u):u=e[8];let f;e[9]!==u?(f=n.jsx(ws,{align:"start",className:"p-1 w-64",children:n.jsx("div",{className:"flex flex-col",children:u})}),e[9]=u,e[10]=f):f=e[10];let m;return e[11]!==r||e[12]!==h||e[13]!==f?(m=n.jsxs(bs,{open:r,onOpenChange:o,children:[h,f]}),e[11]=r,e[12]=h,e[13]=f,e[14]=m):m=e[14],m}function Ov(t){const e=F.c(15),{tier:s,onTierChange:i,override:r,onOverrideChange:o}=t,[a,l]=M.useState(r!==null);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Model"}),e[0]=d):d=e[0];let c;e[1]!==o||e[2]!==i||e[3]!==r||e[4]!==s||e[5]!==a?(c=a?n.jsx(M.Suspense,{fallback:n.jsx(ie,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:"Loading models…"}),children:n.jsx($v,{override:r,onOverrideChange:o})}):n.jsx(Bv,{tier:s,onSelect:i}),e[1]=o,e[2]=i,e[3]=r,e[4]=s,e[5]=a,e[6]=c):c=e[6];let h;e[7]!==o?(h=m=>{l(m),m||o(null)},e[7]=o,e[8]=h):h=e[8];let u;e[9]!==h||e[10]!==a?(u=n.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none",children:[n.jsx(Mn,{checked:a,onCheckedChange:h,className:"cursor-pointer"}),"Specific model"]}),e[9]=h,e[10]=a,e[11]=u):u=e[11];let f;return e[12]!==c||e[13]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-2",children:[d,n.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c,u]})]}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}function $v(t){const e=F.c(10),{override:s,onOverrideChange:i}=t,r=bd(),o=r[0]?.id??null,[a,l]=M.useState(s?.credentialId??o);let d;e[0]!==s?(d=s?{modelId:s.modelId,title:s.title||s.modelId,keyId:s.credentialId,providerId:"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[0]=s,e[1]=d):d=e[1];const c=d;if(r.length===0){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("span",{className:"text-xs text-muted-foreground italic",children:"Connect an AI provider in settings to pick a specific model."}),e[2]=f):f=e[2],f}let h;e[3]!==a||e[4]!==i?(h=f=>{const m=f.keyId??a??"";l(m),i({modelId:f.modelId,credentialId:m,title:f.title??f.modelId})},e[3]=a,e[4]=i,e[5]=h):h=e[5];let u;return e[6]!==a||e[7]!==c||e[8]!==h?(u=n.jsx("div",{className:"w-fit max-w-full [&_button]:rounded-md",children:n.jsx(Hm,{variant:"bordered",placeholder:"Pick a model",model:c,credentialId:a,onCredentialChange:l,onModelChange:h})}),e[6]=a,e[7]=c,e[8]=h,e[9]=u):u=e[9],u}const Wu=[{key:"capabilities",heading:"Built-in capabilities",icon:Rl,tools:[{name:"web_search",title:"Web search",description:"Look up current information on the web",icon:Ki},{name:"generate_image",title:"Generate image",description:"Create images from a text prompt",icon:oi},{name:"subtask",title:"Subtask",description:"Spawn a focused sub-agent to handle part of the work",icon:Dn},{name:"user_ask",title:"Ask the user",description:"Pause to ask the user a clarifying question",icon:Z2}]},{key:"files",heading:"Files & code",icon:_a,tools:[{name:"read",title:"Read File",description:"Read a file from the workspace",icon:Vd},{name:"write",title:"Write File",description:"Create or overwrite a file",icon:Al},{name:"edit",title:"Edit File",description:"Make targeted edits to an existing file",icon:Q2},{name:"grep",title:"Search Content",description:"Search file contents by pattern",icon:Bn},{name:"glob",title:"Find Files",description:"Find files by name pattern",icon:_a},{name:"bash",title:"Run Command",description:"Run shell commands in the sandbox",icon:em}]},{key:"context",heading:"Context",icon:H9,tools:[{name:"read_resource",title:"Read Resource",description:"Read an MCP resource by URI",icon:H9},{name:"read_prompt",title:"Read Prompt",description:"Read an MCP prompt definition",icon:La},{name:"skill",title:"Load Skill",description:"Load a skill's full instructions (SKILL.md) by id",icon:La}]},{key:"browser",heading:"Browser",icon:ri,tools:[{name:"take_screenshot",title:"Take Screenshot",description:"Capture a screenshot of a web page",icon:zd},{name:"scrape_url",title:"Scrape URL",description:"Fetch and extract content from a URL",icon:ri},{name:"inspect_page",title:"Inspect Page",description:"Inspect a web page's structure",icon:lo}]}],zv=Wu.flatMap(t=>t.tools.map(e=>e.name));function Fv(t){const e=t.replace(/[_-]+/g," ").trim();return e?e.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()):t}function Hv(t){const e=F.c(5),{agentId:s,value:i,onChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Tools"}),e[0]=o):o=e[0];let a;return e[1]!==s||e[2]!==r||e[3]!==i?(a=n.jsxs("div",{className:"flex flex-col gap-2",children:[o,s?n.jsx(M.Suspense,{fallback:n.jsxs(ie,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:[n.jsx(Rl,{size:14}),"Loading tools…"]}),children:n.jsx(Uv,{agentId:s,value:i,onChange:r})}):n.jsx("span",{className:"text-xs text-muted-foreground italic",children:"Pick an agent first"})]}),e[1]=s,e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function qc(t){const e=F.c(17),{value:s,checked:i,onToggle:r,title:o,description:a,leading:l}=t;let d;e[0]!==i?(d=n.jsx(Yi,{checked:i,className:"pointer-events-none mt-0.5"}),e[0]=i,e[1]=d):d=e[1];let c;e[2]!==l?(c=l&&n.jsx("span",{className:"mt-px shrink-0",children:l}),e[2]=l,e[3]=c):c=e[3];let h;e[4]!==o?(h=n.jsx("span",{className:"truncate text-sm leading-tight",children:o}),e[4]=o,e[5]=h):h=e[5];let u;e[6]!==a?(u=a&&n.jsx("span",{className:"line-clamp-2 text-xs leading-snug text-muted-foreground",children:a}),e[6]=a,e[7]=u):u=e[7];let f;e[8]!==h||e[9]!==u?(f=n.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[h,u]}),e[8]=h,e[9]=u,e[10]=f):f=e[10];let m;return e[11]!==r||e[12]!==d||e[13]!==c||e[14]!==f||e[15]!==s?(m=n.jsxs(On,{value:s,onSelect:r,className:"items-start gap-2.5 py-2",children:[d,c,f]}),e[11]=r,e[12]=d,e[13]=c,e[14]=f,e[15]=s,e[16]=m):m=e[16],m}function Gc(t){const e=F.c(20),{conn:s,label:i,icon:r,on:o,total:a,onToggle:l}=t,d=o===a;let c;e[0]!==r||e[1]!==s?(c=s?n.jsx(ys,{icon:s.icon,name:s.title,size:"2xs"}):r?n.jsx(r,{size:14,className:"text-muted-foreground"}):n.jsx(sm,{size:14,className:"text-muted-foreground"}),e[0]=r,e[1]=s,e[2]=c):c=e[2];const h=s?.title??i??"Other tools";let u;e[3]!==h?(u=n.jsx("span",{className:"truncate",children:h}),e[3]=h,e[4]=u):u=e[4];let f;e[5]!==o||e[6]!==a?(f=n.jsxs("span",{className:"text-[11px] font-normal tabular-nums text-muted-foreground/70",children:[o,"/",a]}),e[5]=o,e[6]=a,e[7]=f):f=e[7];let m;e[8]!==l?(m=x=>{x.stopPropagation(),l()},e[8]=l,e[9]=m):m=e[9];const p=d?"None":"All";let _;e[10]!==m||e[11]!==p?(_=n.jsx("button",{type:"button",onClick:m,className:"text-[11px] font-medium text-primary hover:underline",children:p}),e[10]=m,e[11]=p,e[12]=_):_=e[12];let L;e[13]!==f||e[14]!==_?(L=n.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[f,_]}),e[13]=f,e[14]=_,e[15]=L):L=e[15];let v;return e[16]!==c||e[17]!==u||e[18]!==L?(v=n.jsxs("div",{className:"flex items-center gap-2",children:[c,u,L]}),e[16]=c,e[17]=u,e[18]=L,e[19]=v):v=e[19],v}function Uv(t){const e=F.c(70),{agentId:s,value:i,onChange:r}=t,{org:o}=Fe(),[a,l]=M.useState(!1);let d;e[0]!==s||e[1]!==o.id||e[2]!==o.slug?(d={connectionId:s,orgId:o.id,orgSlug:o.slug},e[0]=s,e[1]=o.id,e[2]=o.slug,e[3]=d):d=e[3];const c=Pt(d);let h;e[4]!==c?(h={client:c},e[4]=c,e[5]=h):h=e[5];const{data:u,isLoading:f}=Hd(h),m=Gn();let p,_,L,v,x,g,y,b,S,w,C,N,T;if(e[6]!==m||e[7]!==u?.tools||e[8]!==f||e[9]!==r||e[10]!==a||e[11]!==i){const E=new Map(m.map(Gv)),R=new Map;for(const Q of u?.tools??[]){const se=$f(Q._meta)??"__other__",oe=zf(Q.name,se==="__other__"?void 0:se),he=Q.title,xe=he&&he!==Q.name?he:Fv(oe);R.has(se)||R.set(se,{clientId:se,conn:E.get(se),tools:[]}),R.get(se).tools.push({name:Q.name,display:xe,description:Q.description})}const P=[...R.values()].sort(qv),D=(u?.tools??[]).map(Kv),O=[...zv,...D],$=i===null?new Set(O):new Set(i),K=O.every(Q=>$.has(Q)),z=Q=>r(O.every(se=>Q.has(se))?null:[...Q]),U=Q=>{const se=new Set($);se.has(Q)?se.delete(Q):se.add(Q),z(se)},G=(Q,se)=>{const oe=new Set($);for(const he of Q)se?oe.add(he):oe.delete(he);z(oe)};v=bs,T=a,x=l;let q;e[25]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(Rl,{size:14,className:"text-muted-foreground"}),e[25]=q):q=e[25];const W=K?"All tools":"Tools",H=!K&&n.jsxs(Fm,{variant:"secondary",className:"ml-0.5 h-5 px-1.5 text-[11px] tabular-nums",children:[$.size,"/",O.length]});let Z;e[26]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(ds,{size:14,className:"text-muted-foreground"}),e[26]=Z):Z=e[26],e[27]!==W||e[28]!==H?(g=n.jsx(Ss,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[q,W,H,Z]})}),e[27]=W,e[28]=H,e[29]=g):g=e[29],L=ws,C="p-0 w-80",N="start",_=Pl,e[30]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(po,{placeholder:"Search tools..."}),e[30]=S):S=e[30];const J=K?`All ${O.length} tools enabled`:`${$.size} of ${O.length} enabled`;let B;e[31]!==J?(B=n.jsx("span",{className:"text-xs text-muted-foreground",children:J}),e[31]=J,e[32]=B):B=e[32];let X;e[33]!==r?(X=()=>r(null),e[33]=r,e[34]=X):X=e[34];let V;e[35]!==K||e[36]!==X?(V=n.jsx("button",{type:"button",onClick:X,disabled:K,className:"text-xs font-medium text-primary hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:"Select all"}),e[35]=K,e[36]=X,e[37]=V):V=e[37];let ee;e[38]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[38]=ee):ee=e[38];let te;e[39]!==r?(te=()=>r([]),e[39]=r,e[40]=te):te=e[40];const ae=$.size===0;let de;e[41]!==te||e[42]!==ae?(de=n.jsx("button",{type:"button",onClick:te,disabled:ae,className:"text-xs font-medium text-muted-foreground hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:"Clear"}),e[41]=te,e[42]=ae,e[43]=de):de=e[43];let fe;e[44]!==V||e[45]!==de?(fe=n.jsxs("div",{className:"flex items-center gap-2",children:[V,ee,de]}),e[44]=V,e[45]=de,e[46]=fe):fe=e[46],e[47]!==B||e[48]!==fe?(w=n.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[B,fe]}),e[47]=B,e[48]=fe,e[49]=w):w=e[49],p=_o,y="max-h-80",b=f?n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"Loading tools…"}):n.jsxs(n.Fragment,{children:[n.jsx(go,{children:"No tools found"}),Wu.map(Q=>{const se=Q.tools.map(Vv),oe=se.filter(he=>$.has(he)).length;return n.jsx($n,{heading:n.jsx(Gc,{label:Q.heading,icon:Q.icon,on:oe,total:se.length,onToggle:()=>G(se,oe!==se.length)}),children:Q.tools.map(he=>n.jsx(qc,{value:`${he.title} ${he.name}`,checked:$.has(he.name),onToggle:()=>U(he.name),title:he.title,description:he.description,leading:n.jsx(he.icon,{size:16,className:"text-muted-foreground"})},he.name))},Q.key)}),P.map(Q=>{const se=Q.tools.map(Wv),oe=se.filter(he=>$.has(he)).length;return n.jsx($n,{heading:n.jsx(Gc,{conn:Q.conn,on:oe,total:se.length,onToggle:()=>G(se,oe!==se.length)}),children:Q.tools.map(he=>n.jsx(qc,{value:`${he.display} ${he.name} ${Q.conn?.title??""}`,checked:$.has(he.name),onToggle:()=>U(he.name),title:he.display,description:he.description},he.name))},Q.clientId)})]}),e[6]=m,e[7]=u?.tools,e[8]=f,e[9]=r,e[10]=a,e[11]=i,e[12]=p,e[13]=_,e[14]=L,e[15]=v,e[16]=x,e[17]=g,e[18]=y,e[19]=b,e[20]=S,e[21]=w,e[22]=C,e[23]=N,e[24]=T}else p=e[12],_=e[13],L=e[14],v=e[15],x=e[16],g=e[17],y=e[18],b=e[19],S=e[20],w=e[21],C=e[22],N=e[23],T=e[24];let A;e[50]!==p||e[51]!==y||e[52]!==b?(A=n.jsx(p,{className:y,children:b}),e[50]=p,e[51]=y,e[52]=b,e[53]=A):A=e[53];let j;e[54]!==_||e[55]!==A||e[56]!==S||e[57]!==w?(j=n.jsxs(_,{children:[S,w,A]}),e[54]=_,e[55]=A,e[56]=S,e[57]=w,e[58]=j):j=e[58];let k;e[59]!==L||e[60]!==j||e[61]!==C||e[62]!==N?(k=n.jsx(L,{className:C,align:N,children:j}),e[59]=L,e[60]=j,e[61]=C,e[62]=N,e[63]=k):k=e[63];let I;return e[64]!==v||e[65]!==x||e[66]!==g||e[67]!==k||e[68]!==T?(I=n.jsxs(v,{open:T,onOpenChange:x,children:[g,k]}),e[64]=v,e[65]=x,e[66]=g,e[67]=k,e[68]=T,e[69]=I):I=e[69],I}function Wv(t){return t.name}function Vv(t){return t.name}function Kv(t){return t.name}function qv(t,e){return(t.conn?.title??t.clientId).localeCompare(e.conn?.title??e.clientId)}function Gv(t){return[t.id,t]}function An(t){const e=t.trim().split(/\s+/);return e.length!==5?!1:e.every(s=>/^[\d*/,-]+$/.test(s))}function Yv(t){if(!t)return"Unknown schedule";const e=t.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return`Every ${s[1]} minutes`;const i=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(i)return`Every ${i[1]} hours`;const r=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(r){const l=parseInt(r[1]??"1");return l%7===0?`Every ${l/7} weeks`:`Every ${l} days`}const o=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(o){const l=(o[2]??"0").padStart(2,"0"),d=(o[1]??"0").padStart(2,"0");return`Every day at ${l}:${d} UTC`}const a=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(a){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(a[3]??"0")]??"day",c=(a[2]??"0").padStart(2,"0"),h=(a[1]??"0").padStart(2,"0");return`Every ${d} at ${c}:${h} UTC`}return t}function Jv(t,e){const s=Math.max(1,t);switch(e){case"minutes":return s===1?"* * * * *":`*/${s} * * * *`;case"hours":return s===1?"0 * * * *":`0 */${s} * * *`;case"days":return s===1?"0 0 * * *":`0 0 */${s} * *`;case"weeks":return s===1?"0 0 * * 1":`0 0 */${s*7} * *`}}function Xv(t){const e=t.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return{count:parseInt(s[1]),unit:"minutes"};const i=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(i)return{count:parseInt(i[1]),unit:"hours"};const r=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);return r?{count:parseInt(r[1]),unit:"days"}:null}function Zv(t,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[t]??t:t}const Qv=[{label:"5 minutes",cron:"*/5 * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function ex({automationId:t,open:e,onOpenChange:s,onCustomSelect:i,onEventSelect:r,onWebhookCreated:o}){const{triggerAdd:a}=Jn(),[l,d]=M.useState(!1),c=e??l,h=m=>{s?s(m):d(m)},u=async m=>{try{await a.mutateAsync({automation_id:t,type:"cron",cron_expression:m}),ue.success("Starter added"),h(!1)}catch(p){const _=p instanceof Error?p.message:"Failed to add starter";ue.error(_)}},f=async()=>{try{const m=await a.mutateAsync({automation_id:t,type:"webhook"});h(!1),m.webhook?o?.(m.webhook):ue.success("Webhook starter added")}catch(m){const p=m instanceof Error?m.message:"Failed to add webhook starter";ue.error(p)}};return n.jsxs(Qt,{open:c,onOpenChange:h,children:[n.jsx(es,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",children:[n.jsx(Dt,{size:14}),"Add Starter"]})}),n.jsxs(ts,{align:"end",className:"w-[200px]",children:[n.jsxs(ma,{children:[n.jsxs(pa,{className:"gap-2.5",children:[n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),n.jsx(ga,{className:"w-[160px]",children:Qv.map(m=>n.jsxs(We,{className:"gap-2.5",onSelect:()=>u(m.cron),disabled:a.isPending,children:[n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",m.label]},m.cron))})]}),n.jsxs(We,{className:"gap-2.5",onSelect:()=>{h(!1),i?.()},children:[n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}),"Custom (cron)"]}),n.jsxs(We,{className:"gap-2.5",onSelect:()=>{h(!1),r?.()},children:[n.jsx(zn,{size:14,className:"text-muted-foreground shrink-0"}),"Event"]}),n.jsxs(We,{className:"gap-2.5",onSelect:()=>{f()},disabled:a.isPending,children:[n.jsx(Ki,{size:14,className:"text-muted-foreground shrink-0"}),"Webhook"]})]})]})}function Vu(t){const e=F.c(31),{open:s,onOpenChange:i,url:r,token:o,title:a,description:l}=t,d=a===void 0?"Webhook ready":a,c=l===void 0?"Send a POST to this URL with the bearer token to fire the automation. The token is shown once — copy it now.":l,[h,u]=M.useState(null),[f,m]=M.useState("curl"),[p,_]=M.useState("header"),L=M.useId();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=async(E,R)=>{try{await navigator.clipboard.writeText(E),u(R),ue.success("Copied"),setTimeout(()=>u(null),1500)}catch{ue.error("Failed to copy")}},e[0]=v):v=e[0];const x=v;let g;e[1]!==p||e[2]!==o||e[3]!==r?(g=r&&o&&p==="url"?`${r.replace(/\/$/,"")}/${o}`:r??"",e[1]=p,e[2]=o,e[3]=r,e[4]=g):g=e[4];const y=g,b=r&&o?p==="header"?`curl -X POST "${y}" \\
|
|
468
468
|
-H "Authorization: Bearer ${o}" \\
|
|
469
469
|
-H "Content-Type: application/json" \\
|
|
470
470
|
-d '{"hello":"world"}'`:`curl -X POST "${y}" \\
|
|
@@ -483,7 +483,7 @@ ${X}`:X;c.setValue("metadata.instructions",V,{shouldDirty:!0})},q=new Set(h.map(
|
|
|
483
483
|
},
|
|
484
484
|
body: JSON.stringify({ hello: "world" }),
|
|
485
485
|
});`:"",w=f==="curl"?b:S;let C;e[5]!==d?(C=n.jsx(ns,{children:d}),e[5]=d,e[6]=C):C=e[6];let N;e[7]!==c?(N=n.jsx(qi,{children:c}),e[7]=c,e[8]=N):N=e[8];let T;e[9]!==C||e[10]!==N?(T=n.jsxs(is,{children:[C,N]}),e[9]=C,e[10]=N,e[11]=T):T=e[11];let A;e[12]!==p||e[13]!==h||e[14]!==y||e[15]!==f||e[16]!==w||e[17]!==o||e[18]!==L||e[19]!==r?(A=r&&o?n.jsxs("div",{className:"flex flex-col gap-3 min-w-0",children:[n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"URL"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:y}),n.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>x(y,"url"),children:[n.jsx(Xt,{size:13}),h==="url"?"Copied":"Copy"]})]})]}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Token (shown once)"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:o}),n.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>x(o,"token"),children:[n.jsx(Xt,{size:13}),h==="token"?"Copied":"Copy"]})]})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Snippet"}),n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(fo,{value:f,onValueChange:E=>m(E),children:n.jsxs(uo,{className:"h-8 p-[2px]",children:[n.jsx(Hs,{value:"curl",className:"h-7 px-2.5 text-xs",children:"curl"}),n.jsx(Hs,{value:"fetch",className:"h-7 px-2.5 text-xs",children:"fetch"})]})}),n.jsxs("label",{htmlFor:L,className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none",children:[n.jsx(Yi,{id:L,checked:p==="url",onCheckedChange:E=>_(E?"url":"header")}),"Token in URL"]})]}),n.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>x(w,"example"),children:[n.jsx(Xt,{size:13}),h==="example"?"Copied":"Copy"]})]}),n.jsx("div",{className:"rounded-md border overflow-hidden min-w-0",children:n.jsx(sh,{code:w,language:f==="curl"?"shell":"typescript",readOnly:!0,disableDiagnostics:!0,height:180})})]})]}):null,e[12]=p,e[13]=h,e[14]=y,e[15]=f,e[16]=w,e[17]=o,e[18]=L,e[19]=r,e[20]=A):A=e[20];let j;e[21]!==i?(j=n.jsx(qs,{children:n.jsx(ie,{onClick:()=>i(!1),children:"Done"})}),e[21]=i,e[22]=j):j=e[22];let k;e[23]!==T||e[24]!==A||e[25]!==j?(k=n.jsxs($t,{className:"max-w-lg",children:[T,A,j]}),e[23]=T,e[24]=A,e[25]=j,e[26]=k):k=e[26];let I;return e[27]!==i||e[28]!==s||e[29]!==k?(I=n.jsx(Ot,{open:s,onOpenChange:i,children:k}),e[27]=i,e[28]=s,e[29]=k,e[30]=I):I=e[30],I}function tx(t){const e=F.c(83),{trigger:s,automationId:i,connectionName:r}=t,{triggerAdd:o,triggerRemove:a,triggerRotateToken:l}=Jn(),[d,c]=M.useState(!1),[h,u]=M.useState(!1),[f,m]=M.useState(null);let p;e[0]!==s.cron_expression?(p=s.cron_expression?Xv(s.cron_expression):null,e[0]=s.cron_expression,e[1]=p):p=e[1];const _=p,[L,v]=M.useState(_?.count??1),[x,g]=M.useState(!1),[y,b]=M.useState(s.cron_expression??""),S=a.isPending||o.isPending||l.isPending,w=s.type==="cron",C=s.type==="webhook";let N;e[2]!==i||e[3]!==a||e[4]!==s.id?(N=async()=>{try{await a.mutateAsync({trigger_id:s.id,automation_id:i}),ue.success("Starter removed")}catch{ue.error("Failed to remove starter")}c(!1)},e[2]=i,e[3]=a,e[4]=s.id,e[5]=N):N=e[5];const T=N;let A;e[6]!==o||e[7]!==i||e[8]!==y||e[9]!==a||e[10]!==s.cron_expression||e[11]!==s.id?(A=async()=>{const se=y.trim();if(!se||!An(se)||se===s.cron_expression){g(!1),b(s.cron_expression??"");return}try{await o.mutateAsync({automation_id:i,type:"cron",cron_expression:se}),await a.mutateAsync({trigger_id:s.id,automation_id:i}),g(!1)}catch{ue.error("Failed to update starter"),b(s.cron_expression??""),g(!1)}},e[6]=o,e[7]=i,e[8]=y,e[9]=a,e[10]=s.cron_expression,e[11]=s.id,e[12]=A):A=e[12];const j=A;let k;e[13]!==i||e[14]!==l||e[15]!==s.id?(k=async()=>{u(!1);try{const se=await l.mutateAsync({trigger_id:s.id,automation_id:i});m({url:se.url,token:se.token})}catch(se){const oe=se,he=oe instanceof Error?oe.message:"Failed to rotate token";ue.error(he)}},e[13]=i,e[14]=l,e[15]=s.id,e[16]=k):k=e[16];const I=k;let E;e[17]!==o||e[18]!==i||e[19]!==_||e[20]!==a||e[21]!==s.cron_expression||e[22]!==s.id?(E=async se=>{if(!_)return;const oe=_.unit==="minutes"?5:1,he=Math.max(oe,se);he!==se&&v(he);const xe=Jv(he,_.unit);if(xe!==s.cron_expression)try{await o.mutateAsync({automation_id:i,type:"cron",cron_expression:xe}),await a.mutateAsync({trigger_id:s.id,automation_id:i})}catch{ue.error("Failed to update starter"),v(_.count)}},e[17]=o,e[18]=i,e[19]=_,e[20]=a,e[21]=s.cron_expression,e[22]=s.id,e[23]=E):E=e[23];const R=E;let P;e[24]!==w||e[25]!==C?(P=w?n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}):C?n.jsx(Ki,{size:14,className:"text-muted-foreground shrink-0"}):n.jsx(zn,{size:14,className:"text-muted-foreground shrink-0"}),e[24]=w,e[25]=C,e[26]=P):P=e[26];let D;e[27]!==r||e[28]!==L||e[29]!==y||e[30]!==R||e[31]!==j||e[32]!==_||e[33]!==w||e[34]!==x||e[35]!==S||e[36]!==C||e[37]!==s.cron_expression||e[38]!==s.event_type||e[39]!==s.params?(D=_&&w?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),n.jsx("input",{type:"number",min:_.unit==="minutes"?5:1,value:L,onChange:se=>v(parseInt(se.target.value)||1),onBlur:()=>R(L),onKeyDown:se=>{se.key==="Enter"&&se.target.blur(),se.key==="Escape"&&v(_.count)},disabled:S,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),n.jsx("span",{className:"text-sm",children:Zv(_.unit,L)})]}):w&&x?n.jsxs(n.Fragment,{children:[n.jsx("input",{type:"text",value:y,onChange:se=>b(se.target.value),onBlur:j,onKeyDown:se=>{se.key==="Enter"&&se.target.blur(),se.key==="Escape"&&(g(!1),b(s.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),y&&!An(y)&&n.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):n.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[n.jsx("span",{className:"text-sm font-mono text-xs text-muted-foreground truncate",children:w?Yv(s.cron_expression??""):C?"Webhook · POST to fire":`${s.event_type}${r?` · ${r}`:""}`}),!w&&!C&&s.params&&Object.keys(s.params).length>0&&n.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:Object.entries(s.params).map(sx).join(", ")})]}),e[27]=r,e[28]=L,e[29]=y,e[30]=R,e[31]=j,e[32]=_,e[33]=w,e[34]=x,e[35]=S,e[36]=C,e[37]=s.cron_expression,e[38]=s.event_type,e[39]=s.params,e[40]=D):D=e[40];let O;e[41]!==S?(O=S&&n.jsx(Oe,{size:13,className:"animate-spin text-muted-foreground"}),e[41]=S,e[42]=O):O=e[42];let $;e[43]!==_||e[44]!==w||e[45]!==x||e[46]!==s.cron_expression?($=w&&!_&&!x&&n.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{b(s.cron_expression??""),g(!0)},children:n.jsx(Al,{size:13,className:"text-muted-foreground"})}),e[43]=_,e[44]=w,e[45]=x,e[46]=s.cron_expression,e[47]=$):$=e[47];let K;e[48]!==C?(K=C&&n.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",title:"Rotate token",onClick:()=>u(!0),children:n.jsx(Pn,{size:13,className:"text-muted-foreground"})}),e[48]=C,e[49]=K):K=e[49];let z;e[50]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>c(!0),children:n.jsx(Vs,{size:13,className:"text-muted-foreground"})}),e[50]=z):z=e[50];let U;e[51]!==K||e[52]!==O||e[53]!==$?(U=n.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[O,$,K,z]}),e[51]=K,e[52]=O,e[53]=$,e[54]=U):U=e[54];let G;e[55]!==U||e[56]!==P||e[57]!==D?(G=n.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[P,D,U]}),e[55]=U,e[56]=P,e[57]=D,e[58]=G):G=e[58];let q;e[59]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsxs(Mr,{children:[n.jsx(Br,{children:"Remove Starter"}),n.jsx(Or,{children:"Are you sure you want to remove this starter?"})]}),e[59]=q):q=e[59];let W;e[60]===Symbol.for("react.memo_cache_sentinel")?(W=n.jsx(zr,{children:"Cancel"}),e[60]=W):W=e[60];let H;e[61]!==T?(H=n.jsxs(Ir,{children:[q,n.jsxs($r,{children:[W,n.jsx(Fr,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[61]=T,e[62]=H):H=e[62];let Z;e[63]!==d||e[64]!==H?(Z=n.jsx(Dr,{open:d,onOpenChange:c,children:H}),e[63]=d,e[64]=H,e[65]=Z):Z=e[65];let J;e[66]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsxs(Mr,{children:[n.jsx(Br,{children:"Rotate webhook token"}),n.jsx(Or,{children:"A new token will be generated and the current token will stop working. Any senders using the old token must be updated."})]}),e[66]=J):J=e[66];let B;e[67]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(zr,{children:"Cancel"}),e[67]=B):B=e[67];let X;e[68]!==I?(X=n.jsxs(Ir,{children:[J,n.jsxs($r,{children:[B,n.jsx(Fr,{onClick:I,children:"Rotate"})]})]}),e[68]=I,e[69]=X):X=e[69];let V;e[70]!==h||e[71]!==X?(V=n.jsx(Dr,{open:h,onOpenChange:u,children:X}),e[70]=h,e[71]=X,e[72]=V):V=e[72];const ee=f!==null;let te;e[73]===Symbol.for("react.memo_cache_sentinel")?(te=se=>{se||m(null)},e[73]=te):te=e[73];const ae=f?.url??null,de=f?.token??null;let fe;e[74]!==ee||e[75]!==ae||e[76]!==de?(fe=n.jsx(Vu,{open:ee,onOpenChange:te,url:ae,token:de,title:"New webhook token",description:"The previous token has been revoked. Copy the new token now — it will not be shown again."}),e[74]=ee,e[75]=ae,e[76]=de,e[77]=fe):fe=e[77];let Q;return e[78]!==G||e[79]!==Z||e[80]!==V||e[81]!==fe?(Q=n.jsxs(n.Fragment,{children:[G,Z,V,fe]}),e[78]=G,e[79]=Z,e[80]=V,e[81]=fe,e[82]=Q):Q=e[82],Q}function sx(t){const[e,s]=t;return`${e}: ${s}`}const ix=30;function nx(t,e){switch(e.type){case"accumulate":{const s=t??{start:e.now,fields:new Set,saveCount:0},i=new Set(s.fields);for(const r of e.fields)i.add(r);return{...s,fields:i,saveCount:s.saveCount+1}}case"reset":return null}}function rx(t){const e=F.c(55),{automationId:s,onDone:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={binding:"TRIGGER"},e[0]=r):r=e[0];const o=Gn(r),[a,l]=M.useState(),[d,c]=M.useState();let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h={},e[1]=h):h=e[1];const[u,f]=M.useState(h),{triggerAdd:m}=Jn(),{data:p,isLoading:_}=Um(a);let L,v,x,g,y,b;if(e[2]!==m||e[3]!==s||e[4]!==a||e[5]!==d||e[6]!==_||e[7]!==i||e[8]!==u||e[9]!==o||e[10]!==p){const C=p?.find(D=>D.type===d);let N;e[17]!==m||e[18]!==s||e[19]!==a||e[20]!==d||e[21]!==i||e[22]!==u?(N=async()=>{if(!(!a||!d))try{await m.mutateAsync({automation_id:s,type:"event",event_type:d,connection_id:a,params:u}),Ye("automation_trigger_added",{automation_id:s,trigger_type:"event",connection_id:a,event_type:d}),ue.success("Event trigger added"),i()}catch{ue.error("Failed to add event trigger")}},e[17]=m,e[18]=s,e[19]=a,e[20]=d,e[21]=i,e[22]=u,e[23]=N):N=e[23],L=N,v="flex flex-col gap-3 px-3 py-3 rounded-lg border border-border bg-background";let T,A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(zn,{size:14,className:"text-muted-foreground shrink-0"}),T=n.jsx("span",{className:"text-sm font-medium",children:"Event trigger"}),e[24]=T,e[25]=A):(T=e[24],A=e[25]);let j;e[26]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Vs,{size:13}),e[26]=j):j=e[26],e[27]!==i?(x=n.jsxs("div",{className:"flex items-center gap-2",children:[A,T,n.jsx("button",{type:"button",className:"ml-auto shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground",onClick:i,children:j})]}),e[27]=i,e[28]=x):x=e[28];const k=a??"";let I;e[29]===Symbol.for("react.memo_cache_sentinel")?(I=D=>{l(D),c(void 0),f({})},e[29]=I):I=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(Ct,{className:"w-full",children:n.jsx(Et,{placeholder:"Select connection..."})}),e[30]=E):E=e[30];let R;e[31]!==o?(R=o.length===0?n.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No connections with trigger support"}):o.map(lx),e[31]=o,e[32]=R):R=e[32];let P;e[33]!==R?(P=n.jsx(kt,{children:R}),e[33]=R,e[34]=P):P=e[34],e[35]!==k||e[36]!==P?(g=n.jsxs(jt,{value:k,onValueChange:I,children:[E,P]}),e[35]=k,e[36]=P,e[37]=g):g=e[37],e[38]!==a||e[39]!==d||e[40]!==_||e[41]!==p?(y=a&&n.jsxs(jt,{value:d??"",onValueChange:D=>{c(D),f({})},children:[n.jsx(Ct,{className:"w-full",children:_?n.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[n.jsx(Oe,{size:13,className:"animate-spin"}),"Loading events..."]}):n.jsx(Et,{placeholder:"Select event type...",children:d??"Select event type..."})}),n.jsx(kt,{children:p?.map(ax)})]}),e[38]=a,e[39]=d,e[40]=_,e[41]=p,e[42]=y):y=e[42],b=C?.paramsSchema&&Object.keys(C.paramsSchema).length>0&&n.jsx("div",{className:"flex flex-col gap-2",children:Object.entries(C.paramsSchema).map(D=>{const[O,$]=D;return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("label",{className:"text-xs text-muted-foreground",children:[O,$.description&&n.jsxs("span",{className:"text-muted-foreground/60",children:[" ","— ",$.description]})]}),$.enum?n.jsxs(jt,{value:u[O]??"",onValueChange:K=>f(z=>({...z,[O]:K})),children:[n.jsx(Ct,{className:"w-full",children:n.jsx(Et,{placeholder:`Select ${O}...`})}),n.jsx(kt,{children:$.enum.map(ox)})]}):n.jsx("input",{type:"text",value:u[O]??"",onChange:K=>f(z=>({...z,[O]:K.target.value})),placeholder:$.description??O,className:"text-sm border border-border rounded-md bg-background px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-ring"})]},O)})}),e[2]=m,e[3]=s,e[4]=a,e[5]=d,e[6]=_,e[7]=i,e[8]=u,e[9]=o,e[10]=p,e[11]=L,e[12]=v,e[13]=x,e[14]=g,e[15]=y,e[16]=b}else L=e[11],v=e[12],x=e[13],g=e[14],y=e[15],b=e[16];let S;e[43]!==m||e[44]!==a||e[45]!==d||e[46]!==L?(S=a&&d&&n.jsx(ie,{size:"sm",onClick:L,disabled:m.isPending,children:m.isPending?n.jsx(Oe,{size:13,className:"animate-spin"}):"Add trigger"}),e[43]=m,e[44]=a,e[45]=d,e[46]=L,e[47]=S):S=e[47];let w;return e[48]!==v||e[49]!==x||e[50]!==g||e[51]!==y||e[52]!==b||e[53]!==S?(w=n.jsxs("div",{className:v,children:[x,g,y,b,S]}),e[48]=v,e[49]=x,e[50]=g,e[51]=y,e[52]=b,e[53]=S,e[54]=w):w=e[54],w}function ox(t){return n.jsx(et,{value:t,children:t},t)}function ax(t){return n.jsx(et,{value:t.type,children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:t.type}),n.jsx("span",{className:"text-xs text-muted-foreground",children:t.description})]})},t.type)}function lx(t){return n.jsx(et,{value:t.id,children:t.title},t.id)}function cx({automationId:t,automation:e,onBack:s,onDelete:i}){const r=e.virtual_mcp_id,{org:o}=Fe(),{update:a,triggerAdd:l,run:d}=Jn(),c=Gn(),h=new Map(c.map(te=>[te.id,te.title])),{openTask:u}=Ds(),{setChatOpen:f}=gl(),{sendMessage:m}=ui(),p=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[_,L]=M.useState(p),[v,x]=M.useState(!1),[g,y]=M.useState(!1),[b,S]=M.useState(!1),[w,C]=M.useState(""),[N,T]=M.useState(!1),[A,j]=M.useState(null),[k,I]=M.useState(!1),[E,R]=M.useState(!1),[P,D]=M.useState(!1),O=async()=>{if(k)return;const ae=wf(_).filter(de=>de.type==="text").map(de=>de.text).join(`
|
|
486
|
-
`);if(ae.trim()){I(!0);try{X(),Ye("automation_improve_clicked",{automation_id:t,agent_id:r,instructions_length:ae.length}),f(!0),await m({tiptapDoc:Rh({managerAgentId:cd.AUTOMATION_MANAGER(o.id),managerName:"Automation Manager",kind:"automation",id:t,instructions:ae})})}finally{I(!1)}}},$=e.models?.tier??"smart",K=e.models?.modelId&&e.models?.credentialId?{modelId:e.models.modelId,credentialId:e.models.credentialId,title:e.models.modelTitle??e.models.modelId}:null,z=Q0({defaultValues:{name:e.name,active:e.active,tier:$,modelOverride:K,tools:e.tools??null,maxAgentSteps:e.maxAgentSteps??null}}),U=z.watch("active"),[G,q]=M.useReducer(nx,null),W=()=>{G!==null&&(Ye("automation_updated",{automation_id:t,agent_id:r,fields:Array.from(G.fields),save_count:G.saveCount,edit_duration_ms:Date.now()-G.start}),q({type:"reset"}))},H=async()=>{const te=z.control._formState.dirtyFields,ae=Object.keys(te);if(ae.length===0&&!P)return!0;const de=z.getValues(),fe=z.control._defaultValues;z.reset(de,{keepValues:!0});const Q=P;D(!1);const se={tier:de.tier,...de.modelOverride?{modelId:de.modelOverride.modelId,credentialId:de.modelOverride.credentialId,modelTitle:de.modelOverride.title}:{}},oe={id:t,name:de.name,active:de.active,models:se,tools:de.tools,maxAgentSteps:de.maxAgentSteps,messages:Sf(_),temperature:0};try{await a.mutateAsync(oe)}catch{return z.reset(fe,{keepValues:!0}),Q&&D(!0),!1}const he=[...ae];return Q&&he.push("messages"),q({type:"accumulate",now:Date.now(),fields:he}),B(),!0},{schedule:Z,flush:J}=Ur({save:H}),{schedule:B,flush:X}=Ur({delayMs:3e4,save:async()=>W()});M.useEffect(()=>{const te=z.watch(()=>Z());return()=>te.unsubscribe()},[]);const V=te=>{if(L(te),!E){R(!0);return}D(!0),Z()},ee=async()=>{Ye("automation_test_clicked",{automation_id:t,agent_id:r});const te=await J();if(X(),!!te){if(!_){ue.error("No instructions configured for this automation");return}try{const ae=await d.mutateAsync(t);ae.threadId&&(f(!0),u(ae.threadId))}catch{}}};return n.jsxs(n.Fragment,{children:[s&&n.jsx("div",{className:"flex items-center pb-4 shrink-0",children:n.jsxs(ie,{variant:"ghost",size:"sm",onClick:s,children:[n.jsx(Yd,{size:14}),"Back to list"]})}),n.jsxs("div",{className:"flex flex-col gap-8",children:[n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsx(Ut,{control:z.control,name:"name",render:({field:te})=>n.jsx(ze,{...te,placeholder:"Automation name",className:"border border-transparent shadow-none px-0 text-lg font-medium h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent flex-1",style:{boxShadow:"none"}})}),i&&n.jsx(ie,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:i,children:n.jsx(ss,{size:14})})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ut,{control:z.control,name:"active",render:({field:te})=>n.jsx(Mn,{checked:te.value,onCheckedChange:ae=>{te.onChange(ae),J()},className:"cursor-pointer"})}),n.jsx("span",{className:"text-sm text-muted-foreground",children:U?"Active":"Inactive"}),n.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),n.jsx(Ph,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),n.jsxs("div",{className:"flex flex-col gap-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),n.jsx(ex,{automationId:t,open:v,onOpenChange:x,onCustomSelect:()=>{S(!0),T(!1),C("")},onEventSelect:()=>{T(!0),S(!1)},onWebhookCreated:te=>{Ye("automation_trigger_added",{automation_id:t,trigger_type:"webhook"}),j(te)}})]}),e.triggers.length===0&&!b?n.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:n.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",n.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>x(!0),children:"Add a starter"})," ","to get going."]})}):n.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(te=>n.jsx(tx,{trigger:te,automationId:t,connectionName:te.connection_id?h.get(te.connection_id):void 0},te.id))}),b&&n.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}),n.jsx("input",{type:"text",value:w,onChange:te=>C(te.target.value),onBlur:async()=>{const te=w.trim();if(!(!te||!An(te)))try{await l.mutateAsync({automation_id:t,type:"cron",cron_expression:te}),Ye("automation_trigger_added",{automation_id:t,trigger_type:"cron"}),ue.success("Starter added"),S(!1),C("")}catch{ue.error("Failed to add starter")}},onKeyDown:async te=>{const ae=w.trim();te.key==="Enter"&&ae&&An(ae)&&te.target.blur(),te.key==="Escape"&&(S(!1),C(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),w&&!An(w)&&n.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),l.isPending&&n.jsx(Oe,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),n.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{S(!1),C("")},children:n.jsx(Vs,{size:13})})]}),N&&n.jsx(M.Suspense,{fallback:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 rounded-lg border border-border bg-background",children:[n.jsx(Oe,{size:13,className:"animate-spin text-muted-foreground"}),n.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading connections..."})]}),children:n.jsx(rx,{automationId:t,onDone:()=>T(!1)})}),n.jsx(Vu,{open:A!==null,onOpenChange:te=>{te||j(null)},url:A?.url??null,token:A?.token??null})]}),n.jsxs("div",{className:"flex flex-col gap-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),n.jsxs(ie,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",disabled:k||!_,onClick:O,children:[n.jsx(ti,{size:13}),"Improve"]})]}),n.jsx(vf,{tiptapDoc:_,setTiptapDoc:V,placeholder:"What should this automation do?",children:n.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[n.jsx(xf,{virtualMcpId:r||null,className:"max-h-[45vh]"}),n.jsx("div",{className:"@container/chat-bottom flex items-center justify-end gap-1.5 p-2.5",children:n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{type:"button",variant:"default",className:"h-8 gap-1.5 rounded-md px-3 text-sm font-medium",onClick:ee,disabled:!r,children:[n.jsx(Rm,{size:16}),"Test"]})}),n.jsx(Te,{children:"Test Automation"})]})})]})})]}),n.jsxs(Ff,{open:g,onOpenChange:y,className:"flex flex-col gap-2.5",children:[n.jsxs(Hf,{className:"group flex w-fit cursor-pointer items-center gap-1.5",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Advanced"}),n.jsx(ds,{size:14,className:"text-muted-foreground/60 transition-transform group-data-[state=open]:rotate-180"})]}),n.jsxs(Uf,{className:"flex flex-col gap-5 pt-0.5",children:[n.jsx(Ov,{tier:z.watch("tier"),onTierChange:te=>z.setValue("tier",te,{shouldDirty:!0}),override:z.watch("modelOverride"),onOverrideChange:te=>z.setValue("modelOverride",te,{shouldDirty:!0})}),n.jsx(Hv,{agentId:r||null,value:z.watch("tools"),onChange:te=>z.setValue("tools",te,{shouldDirty:!0})}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Max steps"}),n.jsx(ze,{type:"number",min:1,max:100,className:"w-40",placeholder:`${ix} (default)`,value:z.watch("maxAgentSteps")??"",onChange:te=>{const ae=te.target.value.trim(),de=ae===""?null:Number(ae);z.setValue("maxAgentSteps",de===null||Number.isNaN(de)?null:de,{shouldDirty:!0})}})]})]})]})]})]})}function zi(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{"data-testid":"main-panel-loading",className:"flex h-full w-full items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}const Ku=[{key:"24h",label:"Last 24 hours",ms:1440*60*1e3},{key:"7d",label:"Last 7 days",ms:10080*60*1e3},{key:"30d",label:"Last 30 days",ms:720*60*60*1e3}];function qu(t){const e=Ku.find(i=>i.key===t).ms,s=Date.now();return{startDate:new Date(s-e).toISOString(),endDate:new Date(s).toISOString()}}function dx(t){const e=F.c(12),{automationId:s,triggerIds:i}=t,[r,o]=M.useState("30d"),[a,l]=M.useState(ux);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=p=>{const _=p;o(_),l(qu(_))},e[0]=d):d=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ct,{className:"w-44",children:n.jsx(Et,{})}),e[1]=c):c=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(kt,{children:Ku.map(hx)}),e[2]=h):h=e[2];let u;e[3]!==r?(u=n.jsx("div",{className:"flex items-center justify-end",children:n.jsxs(jt,{value:r,onValueChange:d,children:[c,h]})}),e[3]=r,e[4]=u):u=e[4];let f;e[5]!==s||e[6]!==a||e[7]!==i?(f=n.jsx(Mm,{automationId:s,triggerIds:i,range:a}),e[5]=s,e[6]=a,e[7]=i,e[8]=f):f=e[8];let m;return e[9]!==u||e[10]!==f?(m=n.jsxs("div",{className:"flex flex-col gap-5",children:[u,f]}),e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function hx(t){return n.jsx(et,{value:t.key,children:t.label},t.key)}function ux(){return qu("30d")}function fx(t){const e=F.c(5),{tabId:s}=t;let i;e[0]!==s?(i=Sd(s),e[0]=s,e[1]=i):i=e[1];const r=i;if(!r)return null;let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(zi,{}),e[2]=o):o=e[2];let a;return e[3]!==r.id?(a=n.jsx(M.Suspense,{fallback:o,children:n.jsx(mx,{id:r.id})}),e[3]=r.id,e[4]=a):a=e[4],a}function mx(t){const e=F.c(24),{id:s}=t,i=Vt(),{data:r,isLoading:o}=Wm(s),[a,l]=M.useState("settings");let d;e[0]!==i?(d=()=>{i({to:".",search:gx,replace:!0})},e[0]=i,e[1]=d):d=e[1];const c=d;if(o){let y;return e[2]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(zi,{}),e[2]=y):y=e[2],y}if(!r){let y;return e[3]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:"Automation not found"}),e[3]=y):y=e[3],y}let h;e[4]!==r.triggers?(h=r.triggers.map(px),e[4]=r.triggers,e[5]=h):h=e[5];const u=h;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Yd,{size:14}),e[6]=f):f=e[6];let m;e[7]!==c?(m=n.jsxs(ie,{variant:"ghost",size:"sm",onClick:c,children:[f,"Back to list"]}),e[7]=c,e[8]=m):m=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=[{id:"settings",label:"Settings"},{id:"runs",label:"Runs"}],e[9]=p):p=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=y=>l(y),e[10]=_):_=e[10];let L;e[11]!==a?(L=n.jsx(Jd,{tabs:p,activeTab:a,onTabChange:_}),e[11]=a,e[12]=L):L=e[12];let v;e[13]!==m||e[14]!==L?(v=n.jsxs("div",{className:"flex items-center justify-between pb-4 shrink-0",children:[m,L]}),e[13]=m,e[14]=L,e[15]=v):v=e[15];let x;e[16]!==r||e[17]!==s||e[18]!==a||e[19]!==u?(x=a==="settings"?n.jsx(cx,{automationId:s,automation:r}):n.jsx(dx,{automationId:s,triggerIds:u}),e[16]=r,e[17]=s,e[18]=a,e[19]=u,e[20]=x):x=e[20];let g;return e[21]!==v||e[22]!==x?(g=n.jsx(ls,{children:n.jsx(ls.Content,{children:n.jsxs(ls.Body,{children:[v,x]})})}),e[21]=v,e[22]=x,e[23]=g):g=e[23],g}function px(t){return t.id}function gx(t){return{...t,main:"automations"}}function _x(t){const e=F.c(20),{virtualMcpId:s}=t,i=Vt(),{data:r}=Vm(s),o=r===void 0?[]:r,{create:a}=Jn(),[l,d]=M.useState(""),c=l.toLowerCase(),h=o.filter(A=>A.name.toLowerCase().includes(c));let u;e[0]!==i?(u=A=>i({to:".",search:j=>({...j,main:"automation:"+A}),replace:!0}),e[0]=i,e[1]=u):u=e[1];const f=u,m=async()=>{if(a.isPending)return;Ye("automation_new_clicked",{virtual_mcp_id:s,existing_count:o.length});const A=await a.mutateAsync(Km(s));f(A.id)};let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Dt,{size:14}),e[2]=p):p=e[2];let _;e[3]!==a.isPending||e[4]!==m?(_=n.jsxs(ie,{size:"sm",onClick:m,disabled:a.isPending,children:[p,"New automation"]}),e[3]=a.isPending,e[4]=m,e[5]=_):_=e[5];const L=_,v=ls,x=ls,g=ls;let y;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ls.Title,{children:"Automations"}),e[6]=y):y=e[6];const b=o.length>0&&n.jsx(jl,{value:l,onChange:d,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let S;e[7]!==L||e[8]!==b?(S=n.jsxs("div",{className:"flex flex-col gap-6",children:[y,n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[b,L]})]}),e[7]=L,e[8]=b,e[9]=S):S=e[9];const w=o.length===0?n.jsx("div",{className:"flex items-center justify-center py-20",children:n.jsx(Rr,{image:n.jsx(zn,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Create your first automation to run this agent on a schedule or in response to events.",actions:L})}):h.length===0?n.jsx("div",{className:"flex items-center justify-center py-20",children:n.jsx(Rr,{image:n.jsx(zn,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${l}"`})}):n.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:h.map(A=>n.jsx(qm,{automation:A,onClick:()=>f(A.id)},A.id))});let C;e[10]!==w||e[11]!==g.Body||e[12]!==S?(C=n.jsxs(g.Body,{children:[S,w]}),e[10]=w,e[11]=g.Body,e[12]=S,e[13]=C):C=e[13];let N;e[14]!==C||e[15]!==x.Content?(N=n.jsx(x.Content,{children:C}),e[14]=C,e[15]=x.Content,e[16]=N):N=e[16];let T;return e[17]!==v||e[18]!==N?(T=n.jsx(v,{children:N}),e[17]=v,e[18]=N,e[19]=T):T=e[19],T}function Lx(t){const e=F.c(3),{virtualMcpId:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(zi,{}),e[0]=i):i=e[0];let r;return e[1]!==s?(r=n.jsx(M.Suspense,{fallback:i,children:n.jsx(_x,{virtualMcpId:s})}),e[1]=s,e[2]=r):r=e[2],r}function vx(t){const e=F.c(37),{file:s,onClose:i}=t;let r,o;e[0]!==s.filename?(r=n.jsx(Ii,{filename:s.filename,className:"h-4.5 w-3.5 shrink-0"}),o=n.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:s.filename}),e[0]=s.filename,e[1]=r,e[2]=o):(r=e[1],o=e[2]);let a;e[3]!==s.size?(a=_2(s.size),e[3]=s.size,e[4]=a):a=e[4];let l;e[5]!==a?(l=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a}),e[5]=a,e[6]=l):l=e[6];let d;e[7]!==r||e[8]!==o||e[9]!==l?(d=n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[r,o,l]}),e[7]=r,e[8]=o,e[9]=l,e[10]=d):d=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(rm,{size:14}),e[11]=c):c=e[11];let h;e[12]!==s.downloadUrl||e[13]!==s.filename?(h=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",asChild:!0,children:n.jsx("a",{href:s.downloadUrl,download:s.filename,children:c})})}),e[12]=s.downloadUrl,e[13]=s.filename,e[14]=h):h=e[14];let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Te,{side:"bottom",children:"Download"}),e[15]=u):u=e[15];let f;e[16]!==h?(f=n.jsxs(Ae,{children:[h,u]}),e[16]=h,e[17]=f):f=e[17];let m;e[18]!==s.downloadUrl?(m=()=>window.open(s.downloadUrl,"_blank","noopener"),e[18]=s.downloadUrl,e[19]=m):m=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(pi,{size:14}),e[20]=p):p=e[20];let _;e[21]!==m?(_=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:m,children:p})}),e[21]=m,e[22]=_):_=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Te,{side:"bottom",children:"Open in new tab"}),e[23]=L):L=e[23];let v;e[24]!==_?(v=n.jsxs(Ae,{children:[_,L]}),e[24]=_,e[25]=v):v=e[25];let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Vs,{size:14}),e[26]=x):x=e[26];let g;e[27]!==i?(g=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:i,children:x})}),e[27]=i,e[28]=g):g=e[28];let y;e[29]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Te,{side:"bottom",children:"Close"}),e[29]=y):y=e[29];let b;e[30]!==g?(b=n.jsxs(Ae,{children:[g,y]}),e[30]=g,e[31]=b):b=e[31];let S;return e[32]!==v||e[33]!==b||e[34]!==d||e[35]!==f?(S=n.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[d,f,v,b]}),e[32]=v,e[33]=b,e[34]=d,e[35]=f,e[36]=S):S=e[36],S}function xx(t){const e=F.c(24),{fileKey:s,taskId:i}=t,r=Vt(),{data:o,isPending:a}=od(i);let l;e[0]!==s||e[1]!==o?(l=o?.find(p=>p.key===s)??null,e[0]=s,e[1]=o,e[2]=l):l=e[2];const d=l;let c;e[3]!==r?(c=()=>r({to:".",search:yx,replace:!0}),e[3]=r,e[4]=c):c=e[4];const h=c;if(!d){if(a){let g;return e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"h-full w-full bg-background",children:n.jsx(p2,{})}),e[5]=g):g=e[5],g}let p;e[6]!==s?(p=s.split("/").pop()??s,e[6]=s,e[7]=p):p=e[7];let _;e[8]!==p?(_=n.jsx(Ii,{filename:p,className:"h-7.5 w-6"}),e[8]=p,e[9]=_):_=e[9];let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."}),e[10]=L):L=e[10];let v;e[11]!==h?(v=n.jsx(ie,{variant:"ghost",size:"sm",onClick:h,children:"Close"}),e[11]=h,e[12]=v):v=e[12];let x;return e[13]!==_||e[14]!==v?(x=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 bg-background",children:[_,L,v]}),e[13]=_,e[14]=v,e[15]=x):x=e[15],x}let u;e[16]!==d||e[17]!==h?(u=n.jsx(vx,{file:d,onClose:h}),e[16]=d,e[17]=h,e[18]=u):u=e[18];let f;e[19]!==d?(f=n.jsx("div",{className:"relative min-h-0 flex-1",children:n.jsx(g2,{file:d})}),e[19]=d,e[20]=f):f=e[20];let m;return e[21]!==u||e[22]!==f?(m=n.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[u,f]}),e[21]=u,e[22]=f,e[23]=m):m=e[23],m}function yx(t){return{...t,main:"0"}}const Go="home";function bx(t){const e=F.c(5),{label:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(El,{className:"aspect-video w-2/3 max-w-xl"}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[1]=s,e[2]=r):r=e[2];let o;return e[3]!==r?(o=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-background",children:[i,r]}),e[3]=r,e[4]=o):o=e[4],o}function Sx(t){const e=F.c(15),{path:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={refetchIntervalWhenAbsent:2e3},e[0]=i):i=e[0];const r=L2(Go,s,i),o=v2(Go)(s);if(r.isPending||!r.data){const f=!r.isPending&&!r.data?"Waiting for the deck to sync…":void 0;let m;return e[1]!==f?(m=n.jsx(bx,{label:f}),e[1]=f,e[2]=m):m=e[2],m}let a;e[3]!==r.data?(a=x2(r.data),e[3]=r.data,e[4]=a):a=e[4];const l=r.data.shareMode??"private",d=r.data.effectivePublic??!1,c=window.location.origin+o;let h;e[5]!==s||e[6]!==l||e[7]!==d||e[8]!==c?(h=n.jsx(y2,{volume:Go,path:s,shareMode:l,effectivePublic:d,url:c}),e[5]=s,e[6]=l,e[7]=d,e[8]=c,e[9]=h):h=e[9];let u;return e[10]!==s||e[11]!==o||e[12]!==a||e[13]!==h?(u=n.jsx(b2,{readUrl:o,marker:a,title:s,savePath:s,trailing:h}),e[10]=s,e[11]=o,e[12]=a,e[13]=h,e[14]=u):u=e[14],u}function wx(t){const e=F.c(5),{path:s}=t,i=Vt();let r;e[0]!==i?(r=()=>i({to:".",search:Cx,replace:!0}),e[0]=i,e[1]=r):r=e[1];const o=r;let a;return e[2]!==o||e[3]!==s?(a=n.jsx(S2,{previewPath:s,onClose:o,showSeeInLibrary:!0}),e[2]=o,e[3]=s,e[4]=a):a=e[4],a}function Cx(t){return{...t,main:"0"}}const Yc=M.lazy(()=>cs(()=>import("./project-app-view-H9YA_3uu.js"),__vite__mapDeps([154,1,2,44,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,119,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,120,121,122,123,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.AppViewContent})));function kx(t){const e=F.c(53),{activeTab:s,virtualMcpId:i,taskId:r,layoutTabs:o,expandedTools:a,automationTabParsed:l}=t;if(a2(s)){let g;return e[0]!==i?(g=n.jsx(lc,{virtualMcpId:i}),e[0]=i,e[1]=g):g=e[1],g}if(s==="git"){let g;return e[2]!==i?(g=n.jsx(hg,{virtualMcpId:i}),e[2]=i,e[3]=g):g=e[3],g}if(s==="automations"){let g;return e[4]!==i?(g=n.jsx(Lx,{virtualMcpId:i}),e[4]=i,e[5]=g):g=e[5],g}if(s==="preview"){let g;return e[6]!==i?(g=n.jsx(__,{virtualMcpId:i}),e[6]=i,e[7]=g):g=e[7],g}if(s==="content"){let g;return e[8]!==i?(g=n.jsx(Iv,{virtualMcpId:i}),e[8]=i,e[9]=g):g=e[9],g}if(l){let g;return e[10]!==s?(g=n.jsx(fx,{tabId:s}),e[10]=s,e[11]=g):g=e[11],g}let d;e[12]!==s?(d=Cd(s),e[12]=s,e[13]=d):d=e[13];const c=d;if(c){let g;return e[14]!==c.path?(g=n.jsx(Sx,{path:c.path},c.path),e[14]=c.path,e[15]=g):g=e[15],g}let h;e[16]!==s?(h=wd(s),e[16]=s,e[17]=h):h=e[17];const u=h;if(u){let g;return e[18]!==u.key||e[19]!==r?(g=n.jsx(xx,{fileKey:u.key,taskId:r}),e[18]=u.key,e[19]=r,e[20]=g):g=e[20],g}let f;e[21]!==s?(f=kd(s),e[21]=s,e[22]=f):f=e[22];const m=f;if(m){let g;return e[23]!==m.path?(g=n.jsx(wx,{path:m.path},m.path),e[23]=m.path,e[24]=g):g=e[24],g}let p;e[25]!==s?(p=l2(s),e[25]=s,e[26]=p):p=e[26];const _=p;if(_){let g;if(e[27]!==a||e[28]!==_.connectionId||e[29]!==_.toolName){let C;e[31]!==_.connectionId||e[32]!==_.toolName?(C=N=>N.appId===_.connectionId&&N.toolName===_.toolName,e[31]=_.connectionId,e[32]=_.toolName,e[33]=C):C=e[33],g=a.find(C),e[27]=a,e[28]=_.connectionId,e[29]=_.toolName,e[30]=g}else g=e[30];const y=g;let b;e[34]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(zi,{}),e[34]=b):b=e[34];const S=y?.args;let w;return e[35]!==s||e[36]!==_.connectionId||e[37]!==_.toolName||e[38]!==S?(w=n.jsx(M.Suspense,{fallback:b,children:n.jsx(Yc,{connectionId:_.connectionId,toolName:_.toolName,args:S},s)}),e[35]=s,e[36]=_.connectionId,e[37]=_.toolName,e[38]=S,e[39]=w):w=e[39],w}let L;if(e[40]!==s||e[41]!==o){let g;e[43]!==s?(g=y=>y.id===s,e[43]=s,e[44]=g):g=e[44],L=o.find(g),e[40]=s,e[41]=o,e[42]=L}else L=e[42];const v=L;if(v){let g;e[45]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(zi,{}),e[45]=g):g=e[45];let y;return e[46]!==s||e[47]!==v.id||e[48]!==v.view.appId||e[49]!==v.view.args?(y=n.jsx(M.Suspense,{fallback:g,children:n.jsx(Yc,{connectionId:v.view.appId,toolName:v.id,args:v.view.args},s)}),e[46]=s,e[47]=v.id,e[48]=v.view.appId,e[49]=v.view.args,e[50]=y):y=e[50],y}let x;return e[51]!==i?(x=n.jsx(lc,{virtualMcpId:i}),e[51]=i,e[52]=x):x=e[52],x}function jx(t){const e=F.c(14),{taskId:s,virtualMcpId:i}=t;let r;e[0]!==s||e[1]!==i?(r={virtualMcpId:i,taskId:s},e[0]=s,e[1]=i,e[2]=r):r=e[2];const{activeTab:o,layoutTabs:a,expandedTools:l,automationTabParsed:d}=Ql(r);let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(zi,{}),e[3]=c):c=e[3];let h;e[4]!==o||e[5]!==d||e[6]!==l||e[7]!==a||e[8]!==s||e[9]!==i?(h=n.jsx(M.Suspense,{fallback:c,children:n.jsx(kx,{activeTab:o,virtualMcpId:i,taskId:s,layoutTabs:a,expandedTools:l,automationTabParsed:d})}),e[4]=o,e[5]=d,e[6]=l,e[7]=a,e[8]=s,e[9]=i,e[10]=h):h=e[10];let u;return e[11]!==o||e[12]!==h?(u=n.jsx(Jt,{children:h},o),e[11]=o,e[12]=h,e[13]=u):u=e[13],u}const si="setup";function Nx(t){const e=F.c(35);let s;if(e[0]!==t.scriptTabs||e[1]!==t.scripts){let m;e[3]!==t.scriptTabs?(m=p=>!t.scriptTabs.includes(p),e[3]=t.scriptTabs,e[4]=m):m=e[4],s=t.scripts.filter(m),e[0]=t.scriptTabs,e[1]=t.scripts,e[2]=s}else s=e[2];const i=s;let r;e[5]!==t?(r=()=>{t.active===si?t.onToggle():t.onSelectTab(si)},e[5]=t,e[6]=r):r=e[6];const o=r,a=t.active===si;let l;e[7]!==o||e[8]!==t.open||e[9]!==a?(l=n.jsx(Ex,{active:a,open:t.open,onClick:o}),e[7]=o,e[8]=t.open,e[9]=a,e[10]=l):l=e[10];let d;e[11]!==t?(d=t.scriptTabs.map(m=>n.jsx(Ax,{active:t.active===m,onClick:()=>{t.active===m?t.onToggle():t.onSelectTab(m)},onClose:()=>t.onCloseScript(m),children:m},m)),e[11]=t,e[12]=d):d=e[12];let c;e[13]!==i||e[14]!==t.onAddScript?(c=n.jsx(Rx,{scripts:i,onRun:t.onAddScript}),e[13]=i,e[14]=t.onAddScript,e[15]=c):c=e[15];let h;e[16]!==l||e[17]!==d||e[18]!==c?(h=n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto",children:[l,d,c]}),e[16]=l,e[17]=d,e[18]=c,e[19]=h):h=e[19];let u;e[20]!==t.onRestart||e[21]!==t.onResume||e[22]!==t.onRetry||e[23]!==t.onRunActiveScript||e[24]!==t.onStart||e[25]!==t.onStop||e[26]!==t.onStopActiveScript||e[27]!==t.scriptIsKilling||e[28]!==t.scriptIsRunning||e[29]!==t.showScriptControls||e[30]!==t.status?(u=t.showScriptControls?n.jsx(Px,{isRunning:t.scriptIsRunning,isKilling:t.scriptIsKilling,onRun:t.onRunActiveScript,onStop:t.onStopActiveScript}):n.jsx(Tx,{status:t.status,onStart:t.onStart,onStop:t.onStop,onRestart:t.onRestart,onResume:t.onResume,onRetry:t.onRetry}),e[20]=t.onRestart,e[21]=t.onResume,e[22]=t.onRetry,e[23]=t.onRunActiveScript,e[24]=t.onStart,e[25]=t.onStop,e[26]=t.onStopActiveScript,e[27]=t.scriptIsKilling,e[28]=t.scriptIsRunning,e[29]=t.showScriptControls,e[30]=t.status,e[31]=u):u=e[31];let f;return e[32]!==h||e[33]!==u?(f=n.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-t border-b border-border bg-muted/60 px-3",children:[h,u]}),e[32]=h,e[33]=u,e[34]=f):f=e[34],f}function Ex(t){const e=F.c(8),{active:s,open:i,onClick:r}=t,o=s&&i,a=s&&i,l=s?"border-border bg-background font-medium text-foreground shadow-sm":"border-transparent text-muted-foreground hover:bg-background/50 hover:text-foreground";let d;e[0]!==l?(d=le("flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-xs",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(im,{className:"size-3.5"}),e[2]=c):c=e[2];let h;return e[3]!==r||e[4]!==o||e[5]!==a||e[6]!==d?(h=n.jsxs("button",{type:"button","aria-pressed":o,"aria-expanded":a,onClick:r,className:d,children:[c,"sandbox"]}),e[3]=r,e[4]=o,e[5]=a,e[6]=d,e[7]=h):h=e[7],h}function Tx(t){const e=F.c(24),{status:s,onStart:i,onStop:r,onRestart:o,onResume:a,onRetry:l}=t;if(s==="idle"&&i){let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Mi,{className:"size-3.5"}),e[0]=d):d=e[0];let c;return e[1]!==i?(c=n.jsxs(ie,{variant:"outline",size:"sm",onClick:i,children:[d," Start"]}),e[1]=i,e[2]=c):c=e[2],c}if(s==="suspended"&&a){let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Mi,{className:"size-3.5"}),e[3]=d):d=e[3];let c;return e[4]!==a?(c=n.jsxs(ie,{variant:"outline",size:"sm",onClick:a,children:[d," Resume"]}),e[4]=a,e[5]=c):c=e[5],c}if(s==="errored"&&l){let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Pn,{className:"size-3.5"}),e[6]=d):d=e[6];let c;return e[7]!==l?(c=n.jsxs(ie,{variant:"outline",size:"sm",onClick:l,children:[d," Retry"]}),e[7]=l,e[8]=c):c=e[8],c}if(s==="starting"||s==="running"){const d=s==="running"&&!!o,c=d?"rounded-r-none border-r-0":void 0;let h;e[9]!==c?(h=le(c),e[9]=c,e[10]=h):h=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Od,{className:"size-3.5"}),e[11]=u):u=e[11];let f;e[12]!==r||e[13]!==h?(f=n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",onClick:r,className:h,children:[u," Stop"]})}),e[12]=r,e[13]=h,e[14]=f):f=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Te,{children:"Stop sandbox"}),e[15]=m):m=e[15];let p;e[16]!==f?(p=n.jsxs(Ae,{children:[f,m]}),e[16]=f,e[17]=p):p=e[17];let _;e[18]!==o||e[19]!==d?(_=d&&n.jsxs(Qt,{children:[n.jsx(es,{asChild:!0,children:n.jsx(ie,{variant:"outline",size:"sm",className:"rounded-l-none px-1",children:n.jsx(ds,{className:"size-3"})})}),n.jsx(ts,{align:"end",children:n.jsxs(We,{onClick:o,children:[n.jsx(Pn,{className:"size-3.5"})," Restart"]})})]}),e[18]=o,e[19]=d,e[20]=_):_=e[20];let L;return e[21]!==p||e[22]!==_?(L=n.jsxs("div",{className:"flex items-center",children:[p,_]}),e[21]=p,e[22]=_,e[23]=L):L=e[23],L}return null}function Ax(t){const e=F.c(16),{active:s,onClick:i,onClose:r,children:o}=t,a=s?"border-border bg-background shadow-sm":"border-transparent hover:bg-background/50";let l;e[0]!==a?(l=le("flex h-7 items-center rounded-md border text-xs",a),e[0]=a,e[1]=l):l=e[1];const d=r?"pl-2.5 pr-1":"px-2.5",c=s?"font-medium text-foreground":"text-muted-foreground hover:text-foreground";let h;e[2]!==d||e[3]!==c?(h=le("flex h-full items-center",d,c),e[2]=d,e[3]=c,e[4]=h):h=e[4];let u;e[5]!==o||e[6]!==i||e[7]!==h?(u=n.jsx("button",{type:"button",onClick:i,className:h,children:o}),e[5]=o,e[6]=i,e[7]=h,e[8]=u):u=e[8];let f;e[9]!==o||e[10]!==r?(f=r&&n.jsx("button",{type:"button","aria-label":`Close ${o}`,onClick:r,className:"pr-1.5 text-muted-foreground hover:text-foreground",children:n.jsx(mo,{className:"size-3"})}),e[9]=o,e[10]=r,e[11]=f):f=e[11];let m;return e[12]!==l||e[13]!==u||e[14]!==f?(m=n.jsxs("div",{className:l,children:[u,f]}),e[12]=l,e[13]=u,e[14]=f,e[15]=m):m=e[15],m}function Rx(t){const e=F.c(10),{scripts:s,onRun:i}=t,[r,o]=M.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(Ss,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"sm","aria-label":"Run script",children:n.jsx(Dt,{className:"size-3.5"})})})}),n.jsx(Te,{children:"Run script"})]}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"run a script"}),e[1]=l):l=e[1];let d;e[2]!==i||e[3]!==s?(d=s.length===0?n.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No scripts found"}):s.map(u=>n.jsxs("button",{type:"button",onClick:()=>{o(!1),i(u)},className:"w-full rounded-md px-2 py-1.5 text-left text-xs hover:bg-accent",children:["▸ ",u]},u)),e[2]=i,e[3]=s,e[4]=d):d=e[4];let c;e[5]!==d?(c=n.jsxs(ws,{align:"start",className:"p-1 w-56",children:[l,d]}),e[5]=d,e[6]=c):c=e[6];let h;return e[7]!==r||e[8]!==c?(h=n.jsxs(bs,{open:r,onOpenChange:o,children:[a,c]}),e[7]=r,e[8]=c,e[9]=h):h=e[9],h}function Px(t){const e=F.c(13),{isRunning:s,isKilling:i,onRun:r,onStop:o}=t;if(i){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(ie,{variant:"outline",size:"sm",disabled:!0,children:[n.jsx(Oe,{className:"size-3.5 animate-spin"})," Stopping…"]}),e[0]=h):h=e[0],h}if(!s){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Mi,{className:"size-3.5"}),e[1]=h):h=e[1];let u;e[2]!==r?(u=n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",onClick:r,children:[h," Run"]})}),e[2]=r,e[3]=u):u=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Te,{children:"Start process"}),e[4]=f):f=e[4];let m;return e[5]!==u?(m=n.jsxs(Ae,{children:[u,f]}),e[5]=u,e[6]=m):m=e[6],m}let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Od,{className:"size-3.5"}),e[7]=a):a=e[7];let l;e[8]!==o?(l=n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",onClick:o,children:[a," Stop"]})}),e[8]=o,e[9]=l):l=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Te,{children:"Stop process"}),e[10]=d):d=e[10];let c;return e[11]!==l?(c=n.jsxs(Ae,{children:[l,d]}),e[11]=l,e[12]=c):c=e[12],c}var Gu=Object.defineProperty,Dx=Object.getOwnPropertyDescriptor,Ix=(t,e)=>{for(var s in e)Gu(t,s,{get:e[s],enumerable:!0})},lt=(t,e,s,i)=>{for(var r=i>1?void 0:i?Dx(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(i?a(e,s,r):a(r))||r);return i&&r&&Gu(e,s,r),r},Le=(t,e)=>(s,i)=>e(s,i,t),Jc="Terminal input",Na={get:()=>Jc,set:t=>Jc=t},Xc="Too much output to announce, navigate to rows manually to read",Ea={get:()=>Xc,set:t=>Xc=t};function Mx(t){return t.replace(/\r?\n/g,"\r")}function Bx(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function Ox(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function $x(t,e,s,i){if(t.stopPropagation(),t.clipboardData){let r=t.clipboardData.getData("text/plain");Yu(r,e,s,i)}}function Yu(t,e,s,i){t=Mx(t),t=Bx(t,s.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(t,!0),e.value=""}function Ju(t,e,s){let i=s.getBoundingClientRect(),r=t.clientX-i.left-10,o=t.clientY-i.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${r}px`,e.style.top=`${o}px`,e.style.zIndex="1000",e.focus()}function Zc(t,e,s,i,r){Ju(t,e,s),r&&i.rightClickSelect(t),e.value=i.selectionText,e.select()}function zs(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function ko(t,e=0,s=t.length){let i="";for(let r=e;r<s;++r){let o=t[r];o>65535?(o-=65536,i+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):i+=String.fromCharCode(o)}return i}var zx=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,e){let s=t.length;if(!s)return 0;let i=0,r=0;if(this._interim){let o=t.charCodeAt(r++);56320<=o&&o<=57343?e[i++]=(this._interim-55296)*1024+o-56320+65536:(e[i++]=this._interim,e[i++]=o),this._interim=0}for(let o=r;o<s;++o){let a=t.charCodeAt(o);if(55296<=a&&a<=56319){if(++o>=s)return this._interim=a,i;let l=t.charCodeAt(o);56320<=l&&l<=57343?e[i++]=(a-55296)*1024+l-56320+65536:(e[i++]=a,e[i++]=l);continue}a!==65279&&(e[i++]=a)}return i}},Fx=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,e){let s=t.length;if(!s)return 0;let i=0,r,o,a,l,d=0,c=0;if(this.interim[0]){let f=!1,m=this.interim[0];m&=(m&224)===192?31:(m&240)===224?15:7;let p=0,_;for(;(_=this.interim[++p]&63)&&p<4;)m<<=6,m|=_;let L=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,v=L-p;for(;c<v;){if(c>=s)return 0;if(_=t[c++],(_&192)!==128){c--,f=!0;break}else this.interim[p++]=_,m<<=6,m|=_&63}f||(L===2?m<128?c--:e[i++]=m:L===3?m<2048||m>=55296&&m<=57343||m===65279||(e[i++]=m):m<65536||m>1114111||(e[i++]=m)),this.interim.fill(0)}let h=s-4,u=c;for(;u<s;){for(;u<h&&!((r=t[u])&128)&&!((o=t[u+1])&128)&&!((a=t[u+2])&128)&&!((l=t[u+3])&128);)e[i++]=r,e[i++]=o,e[i++]=a,e[i++]=l,u+=4;if(r=t[u++],r<128)e[i++]=r;else if((r&224)===192){if(u>=s)return this.interim[0]=r,i;if(o=t[u++],(o&192)!==128){u--;continue}if(d=(r&31)<<6|o&63,d<128){u--;continue}e[i++]=d}else if((r&240)===224){if(u>=s)return this.interim[0]=r,i;if(o=t[u++],(o&192)!==128){u--;continue}if(u>=s)return this.interim[0]=r,this.interim[1]=o,i;if(a=t[u++],(a&192)!==128){u--;continue}if(d=(r&15)<<12|(o&63)<<6|a&63,d<2048||d>=55296&&d<=57343||d===65279)continue;e[i++]=d}else if((r&248)===240){if(u>=s)return this.interim[0]=r,i;if(o=t[u++],(o&192)!==128){u--;continue}if(u>=s)return this.interim[0]=r,this.interim[1]=o,i;if(a=t[u++],(a&192)!==128){u--;continue}if(u>=s)return this.interim[0]=r,this.interim[1]=o,this.interim[2]=a,i;if(l=t[u++],(l&192)!==128){u--;continue}if(d=(r&7)<<18|(o&63)<<12|(a&63)<<6|l&63,d<65536||d>1114111)continue;e[i++]=d}}return i}},Xu="",Fs=" ",Qn=class Zu{constructor(){this.fg=0,this.bg=0,this.extended=new Zr}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new Zu;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Zr=class Qu{constructor(e=0,s=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=s}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new Qu(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Zt=class e1 extends Qn{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Zr,this.combinedData=""}static fromCharData(e){let s=new e1;return s.setFromCharData(e),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?zs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let s=!1;if(e[1].length>2)s=!0;else if(e[1].length===2){let i=e[1].charCodeAt(0);if(55296<=i&&i<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(i-55296)*1024+r-56320+65536|e[2]<<22:s=!0}else s=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;s&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Qc="di$target",Ta="di$dependencies",Yo=new Map;function Hx(t){return t[Ta]||[]}function xt(t){if(Yo.has(t))return Yo.get(t);let e=function(s,i,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ux(e,s,r)};return e._id=t,Yo.set(t,e),e}function Ux(t,e,s){e[Qc]===e?e[Ta].push({id:t,index:s}):(e[Ta]=[{id:t,index:s}],e[Qc]=e)}var It=xt("BufferService"),t1=xt("CoreMouseService"),xi=xt("CoreService"),Wx=xt("CharsetService"),x9=xt("InstantiationService"),s1=xt("LogService"),Mt=xt("OptionsService"),i1=xt("OscLinkService"),Vx=xt("UnicodeService"),er=xt("DecorationService"),Aa=class{constructor(t,e,s){this._bufferService=t,this._optionsService=e,this._oscLinkService=s}provideLinks(t,e){let s=this._bufferService.buffer.lines.get(t-1);if(!s){e(void 0);return}let i=[],r=this._optionsService.rawOptions.linkHandler,o=new Zt,a=s.getTrimmedLength(),l=-1,d=-1,c=!1;for(let h=0;h<a;h++)if(!(d===-1&&!s.hasContent(h))){if(s.loadCell(h,o),o.hasExtendedAttrs()&&o.extended.urlId)if(d===-1){d=h,l=o.extended.urlId;continue}else c=o.extended.urlId!==l;else d!==-1&&(c=!0);if(c||d!==-1&&h===a-1){let u=this._oscLinkService.getLinkData(l)?.uri;if(u){let f={start:{x:d+1,y:t},end:{x:h+(!c&&h===a-1?1:0),y:t}},m=!1;if(!r?.allowNonHttpProtocols)try{let p=new URL(u);["http:","https:"].includes(p.protocol)||(m=!0)}catch{m=!0}m||i.push({text:u,range:f,activate:(p,_)=>r?r.activate(p,_,f):Kx(p,_),hover:(p,_)=>r?.hover?.(p,_,f),leave:(p,_)=>r?.leave?.(p,_,f)})}c=!1,o.hasExtendedAttrs()&&o.extended.urlId?(d=h,l=o.extended.urlId):(d=-1,l=-1)}}e(i)}};Aa=lt([Le(0,It),Le(1,Mt),Le(2,i1)],Aa);function Kx(t,e){if(confirm(`Do you want to navigate to ${e}?
|
|
486
|
+
`);if(ae.trim()){I(!0);try{X(),Ye("automation_improve_clicked",{automation_id:t,agent_id:r,instructions_length:ae.length}),f(!0),await m({tiptapDoc:Rh({managerAgentId:cd.AUTOMATION_MANAGER(o.id),managerName:"Automation Manager",kind:"automation",id:t,instructions:ae})})}finally{I(!1)}}},$=e.models?.tier??"smart",K=e.models?.modelId&&e.models?.credentialId?{modelId:e.models.modelId,credentialId:e.models.credentialId,title:e.models.modelTitle??e.models.modelId}:null,z=Q0({defaultValues:{name:e.name,active:e.active,tier:$,modelOverride:K,tools:e.tools??null,maxAgentSteps:e.maxAgentSteps??null}}),U=z.watch("active"),[G,q]=M.useReducer(nx,null),W=()=>{G!==null&&(Ye("automation_updated",{automation_id:t,agent_id:r,fields:Array.from(G.fields),save_count:G.saveCount,edit_duration_ms:Date.now()-G.start}),q({type:"reset"}))},H=async()=>{const te=z.control._formState.dirtyFields,ae=Object.keys(te);if(ae.length===0&&!P)return!0;const de=z.getValues(),fe=z.control._defaultValues;z.reset(de,{keepValues:!0});const Q=P;D(!1);const se={tier:de.tier,...de.modelOverride?{modelId:de.modelOverride.modelId,credentialId:de.modelOverride.credentialId,modelTitle:de.modelOverride.title}:{}},oe={id:t,name:de.name,active:de.active,models:se,tools:de.tools,maxAgentSteps:de.maxAgentSteps,messages:Sf(_),temperature:0};try{await a.mutateAsync(oe)}catch{return z.reset(fe,{keepValues:!0}),Q&&D(!0),!1}const he=[...ae];return Q&&he.push("messages"),q({type:"accumulate",now:Date.now(),fields:he}),B(),!0},{schedule:Z,flush:J}=Ur({save:H}),{schedule:B,flush:X}=Ur({delayMs:3e4,save:async()=>W()});M.useEffect(()=>{const te=z.watch(()=>Z());return()=>te.unsubscribe()},[]);const V=te=>{if(L(te),!E){R(!0);return}D(!0),Z()},ee=async()=>{Ye("automation_test_clicked",{automation_id:t,agent_id:r});const te=await J();if(X(),!!te){if(!_){ue.error("No instructions configured for this automation");return}try{const ae=await d.mutateAsync(t);ae.threadId&&(f(!0),u(ae.threadId))}catch{}}};return n.jsxs(n.Fragment,{children:[s&&n.jsx("div",{className:"flex items-center pb-4 shrink-0",children:n.jsxs(ie,{variant:"ghost",size:"sm",onClick:s,children:[n.jsx(Yd,{size:14}),"Back to list"]})}),n.jsxs("div",{className:"flex flex-col gap-8",children:[n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsx(Ut,{control:z.control,name:"name",render:({field:te})=>n.jsx(ze,{...te,placeholder:"Automation name",className:"border border-transparent shadow-none px-0 text-lg font-medium h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent flex-1",style:{boxShadow:"none"}})}),i&&n.jsx(ie,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:i,children:n.jsx(ss,{size:14})})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ut,{control:z.control,name:"active",render:({field:te})=>n.jsx(Mn,{checked:te.value,onCheckedChange:ae=>{te.onChange(ae),J()},className:"cursor-pointer"})}),n.jsx("span",{className:"text-sm text-muted-foreground",children:U?"Active":"Inactive"}),n.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),n.jsx(Ph,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),n.jsxs("div",{className:"flex flex-col gap-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),n.jsx(ex,{automationId:t,open:v,onOpenChange:x,onCustomSelect:()=>{S(!0),T(!1),C("")},onEventSelect:()=>{T(!0),S(!1)},onWebhookCreated:te=>{Ye("automation_trigger_added",{automation_id:t,trigger_type:"webhook"}),j(te)}})]}),e.triggers.length===0&&!b?n.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:n.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",n.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>x(!0),children:"Add a starter"})," ","to get going."]})}):n.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(te=>n.jsx(tx,{trigger:te,automationId:t,connectionName:te.connection_id?h.get(te.connection_id):void 0},te.id))}),b&&n.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[n.jsx(kn,{size:14,className:"text-muted-foreground shrink-0"}),n.jsx("input",{type:"text",value:w,onChange:te=>C(te.target.value),onBlur:async()=>{const te=w.trim();if(!(!te||!An(te)))try{await l.mutateAsync({automation_id:t,type:"cron",cron_expression:te}),Ye("automation_trigger_added",{automation_id:t,trigger_type:"cron"}),ue.success("Starter added"),S(!1),C("")}catch{ue.error("Failed to add starter")}},onKeyDown:async te=>{const ae=w.trim();te.key==="Enter"&&ae&&An(ae)&&te.target.blur(),te.key==="Escape"&&(S(!1),C(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),w&&!An(w)&&n.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),l.isPending&&n.jsx(Oe,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),n.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{S(!1),C("")},children:n.jsx(Vs,{size:13})})]}),N&&n.jsx(M.Suspense,{fallback:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 rounded-lg border border-border bg-background",children:[n.jsx(Oe,{size:13,className:"animate-spin text-muted-foreground"}),n.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading connections..."})]}),children:n.jsx(rx,{automationId:t,onDone:()=>T(!1)})}),n.jsx(Vu,{open:A!==null,onOpenChange:te=>{te||j(null)},url:A?.url??null,token:A?.token??null})]}),n.jsxs("div",{className:"flex flex-col gap-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),n.jsxs(ie,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",disabled:k||!_,onClick:O,children:[n.jsx(ti,{size:13}),"Improve"]})]}),n.jsx(vf,{tiptapDoc:_,setTiptapDoc:V,placeholder:"What should this automation do?",children:n.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[n.jsx(xf,{virtualMcpId:r||null,className:"max-h-[45vh]"}),n.jsx("div",{className:"@container/chat-bottom flex items-center justify-end gap-1.5 p-2.5",children:n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{type:"button",variant:"default",className:"h-8 gap-1.5 rounded-md px-3 text-sm font-medium",onClick:ee,disabled:!r,children:[n.jsx(Rm,{size:16}),"Test"]})}),n.jsx(Te,{children:"Test Automation"})]})})]})})]}),n.jsxs(Ff,{open:g,onOpenChange:y,className:"flex flex-col gap-2.5",children:[n.jsxs(Hf,{className:"group flex w-fit cursor-pointer items-center gap-1.5",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Advanced"}),n.jsx(ds,{size:14,className:"text-muted-foreground/60 transition-transform group-data-[state=open]:rotate-180"})]}),n.jsxs(Uf,{className:"flex flex-col gap-5 pt-0.5",children:[n.jsx(Ov,{tier:z.watch("tier"),onTierChange:te=>z.setValue("tier",te,{shouldDirty:!0}),override:z.watch("modelOverride"),onOverrideChange:te=>z.setValue("modelOverride",te,{shouldDirty:!0})}),n.jsx(Hv,{agentId:r||null,value:z.watch("tools"),onChange:te=>z.setValue("tools",te,{shouldDirty:!0})}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Max steps"}),n.jsx(ze,{type:"number",min:1,max:100,className:"w-40",placeholder:`${ix} (default)`,value:z.watch("maxAgentSteps")??"",onChange:te=>{const ae=te.target.value.trim(),de=ae===""?null:Number(ae);z.setValue("maxAgentSteps",de===null||Number.isNaN(de)?null:de,{shouldDirty:!0})}})]})]})]})]})]})}function zi(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{"data-testid":"main-panel-loading",className:"flex h-full w-full items-center justify-center",children:n.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}const Ku=[{key:"24h",label:"Last 24 hours",ms:1440*60*1e3},{key:"7d",label:"Last 7 days",ms:10080*60*1e3},{key:"30d",label:"Last 30 days",ms:720*60*60*1e3}];function qu(t){const e=Ku.find(i=>i.key===t).ms,s=Date.now();return{startDate:new Date(s-e).toISOString(),endDate:new Date(s).toISOString()}}function dx(t){const e=F.c(12),{automationId:s,triggerIds:i}=t,[r,o]=M.useState("30d"),[a,l]=M.useState(ux);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=p=>{const _=p;o(_),l(qu(_))},e[0]=d):d=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ct,{className:"w-44",children:n.jsx(Et,{})}),e[1]=c):c=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(kt,{children:Ku.map(hx)}),e[2]=h):h=e[2];let u;e[3]!==r?(u=n.jsx("div",{className:"flex items-center justify-end",children:n.jsxs(jt,{value:r,onValueChange:d,children:[c,h]})}),e[3]=r,e[4]=u):u=e[4];let f;e[5]!==s||e[6]!==a||e[7]!==i?(f=n.jsx(Mm,{automationId:s,triggerIds:i,range:a}),e[5]=s,e[6]=a,e[7]=i,e[8]=f):f=e[8];let m;return e[9]!==u||e[10]!==f?(m=n.jsxs("div",{className:"flex flex-col gap-5",children:[u,f]}),e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function hx(t){return n.jsx(et,{value:t.key,children:t.label},t.key)}function ux(){return qu("30d")}function fx(t){const e=F.c(5),{tabId:s}=t;let i;e[0]!==s?(i=Sd(s),e[0]=s,e[1]=i):i=e[1];const r=i;if(!r)return null;let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(zi,{}),e[2]=o):o=e[2];let a;return e[3]!==r.id?(a=n.jsx(M.Suspense,{fallback:o,children:n.jsx(mx,{id:r.id})}),e[3]=r.id,e[4]=a):a=e[4],a}function mx(t){const e=F.c(24),{id:s}=t,i=Vt(),{data:r,isLoading:o}=Wm(s),[a,l]=M.useState("settings");let d;e[0]!==i?(d=()=>{i({to:".",search:gx,replace:!0})},e[0]=i,e[1]=d):d=e[1];const c=d;if(o){let y;return e[2]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(zi,{}),e[2]=y):y=e[2],y}if(!r){let y;return e[3]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:"Automation not found"}),e[3]=y):y=e[3],y}let h;e[4]!==r.triggers?(h=r.triggers.map(px),e[4]=r.triggers,e[5]=h):h=e[5];const u=h;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Yd,{size:14}),e[6]=f):f=e[6];let m;e[7]!==c?(m=n.jsxs(ie,{variant:"ghost",size:"sm",onClick:c,children:[f,"Back to list"]}),e[7]=c,e[8]=m):m=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=[{id:"settings",label:"Settings"},{id:"runs",label:"Runs"}],e[9]=p):p=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=y=>l(y),e[10]=_):_=e[10];let L;e[11]!==a?(L=n.jsx(Jd,{tabs:p,activeTab:a,onTabChange:_}),e[11]=a,e[12]=L):L=e[12];let v;e[13]!==m||e[14]!==L?(v=n.jsxs("div",{className:"flex items-center justify-between pb-4 shrink-0",children:[m,L]}),e[13]=m,e[14]=L,e[15]=v):v=e[15];let x;e[16]!==r||e[17]!==s||e[18]!==a||e[19]!==u?(x=a==="settings"?n.jsx(cx,{automationId:s,automation:r}):n.jsx(dx,{automationId:s,triggerIds:u}),e[16]=r,e[17]=s,e[18]=a,e[19]=u,e[20]=x):x=e[20];let g;return e[21]!==v||e[22]!==x?(g=n.jsx(ls,{children:n.jsx(ls.Content,{children:n.jsxs(ls.Body,{children:[v,x]})})}),e[21]=v,e[22]=x,e[23]=g):g=e[23],g}function px(t){return t.id}function gx(t){return{...t,main:"automations"}}function _x(t){const e=F.c(20),{virtualMcpId:s}=t,i=Vt(),{data:r}=Vm(s),o=r===void 0?[]:r,{create:a}=Jn(),[l,d]=M.useState(""),c=l.toLowerCase(),h=o.filter(A=>A.name.toLowerCase().includes(c));let u;e[0]!==i?(u=A=>i({to:".",search:j=>({...j,main:"automation:"+A}),replace:!0}),e[0]=i,e[1]=u):u=e[1];const f=u,m=async()=>{if(a.isPending)return;Ye("automation_new_clicked",{virtual_mcp_id:s,existing_count:o.length});const A=await a.mutateAsync(Km(s));f(A.id)};let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Dt,{size:14}),e[2]=p):p=e[2];let _;e[3]!==a.isPending||e[4]!==m?(_=n.jsxs(ie,{size:"sm",onClick:m,disabled:a.isPending,children:[p,"New automation"]}),e[3]=a.isPending,e[4]=m,e[5]=_):_=e[5];const L=_,v=ls,x=ls,g=ls;let y;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ls.Title,{children:"Automations"}),e[6]=y):y=e[6];const b=o.length>0&&n.jsx(jl,{value:l,onChange:d,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let S;e[7]!==L||e[8]!==b?(S=n.jsxs("div",{className:"flex flex-col gap-6",children:[y,n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[b,L]})]}),e[7]=L,e[8]=b,e[9]=S):S=e[9];const w=o.length===0?n.jsx("div",{className:"flex items-center justify-center py-20",children:n.jsx(Rr,{image:n.jsx(zn,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Create your first automation to run this agent on a schedule or in response to events.",actions:L})}):h.length===0?n.jsx("div",{className:"flex items-center justify-center py-20",children:n.jsx(Rr,{image:n.jsx(zn,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${l}"`})}):n.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:h.map(A=>n.jsx(qm,{automation:A,onClick:()=>f(A.id)},A.id))});let C;e[10]!==w||e[11]!==g.Body||e[12]!==S?(C=n.jsxs(g.Body,{children:[S,w]}),e[10]=w,e[11]=g.Body,e[12]=S,e[13]=C):C=e[13];let N;e[14]!==C||e[15]!==x.Content?(N=n.jsx(x.Content,{children:C}),e[14]=C,e[15]=x.Content,e[16]=N):N=e[16];let T;return e[17]!==v||e[18]!==N?(T=n.jsx(v,{children:N}),e[17]=v,e[18]=N,e[19]=T):T=e[19],T}function Lx(t){const e=F.c(3),{virtualMcpId:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(zi,{}),e[0]=i):i=e[0];let r;return e[1]!==s?(r=n.jsx(M.Suspense,{fallback:i,children:n.jsx(_x,{virtualMcpId:s})}),e[1]=s,e[2]=r):r=e[2],r}function vx(t){const e=F.c(37),{file:s,onClose:i}=t;let r,o;e[0]!==s.filename?(r=n.jsx(Ii,{filename:s.filename,className:"h-4.5 w-3.5 shrink-0"}),o=n.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:s.filename}),e[0]=s.filename,e[1]=r,e[2]=o):(r=e[1],o=e[2]);let a;e[3]!==s.size?(a=_2(s.size),e[3]=s.size,e[4]=a):a=e[4];let l;e[5]!==a?(l=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a}),e[5]=a,e[6]=l):l=e[6];let d;e[7]!==r||e[8]!==o||e[9]!==l?(d=n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[r,o,l]}),e[7]=r,e[8]=o,e[9]=l,e[10]=d):d=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(rm,{size:14}),e[11]=c):c=e[11];let h;e[12]!==s.downloadUrl||e[13]!==s.filename?(h=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",asChild:!0,children:n.jsx("a",{href:s.downloadUrl,download:s.filename,children:c})})}),e[12]=s.downloadUrl,e[13]=s.filename,e[14]=h):h=e[14];let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Te,{side:"bottom",children:"Download"}),e[15]=u):u=e[15];let f;e[16]!==h?(f=n.jsxs(Ae,{children:[h,u]}),e[16]=h,e[17]=f):f=e[17];let m;e[18]!==s.downloadUrl?(m=()=>window.open(s.downloadUrl,"_blank","noopener"),e[18]=s.downloadUrl,e[19]=m):m=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(pi,{size:14}),e[20]=p):p=e[20];let _;e[21]!==m?(_=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:m,children:p})}),e[21]=m,e[22]=_):_=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Te,{side:"bottom",children:"Open in new tab"}),e[23]=L):L=e[23];let v;e[24]!==_?(v=n.jsxs(Ae,{children:[_,L]}),e[24]=_,e[25]=v):v=e[25];let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Vs,{size:14}),e[26]=x):x=e[26];let g;e[27]!==i?(g=n.jsx(Ee,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"icon",onClick:i,children:x})}),e[27]=i,e[28]=g):g=e[28];let y;e[29]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Te,{side:"bottom",children:"Close"}),e[29]=y):y=e[29];let b;e[30]!==g?(b=n.jsxs(Ae,{children:[g,y]}),e[30]=g,e[31]=b):b=e[31];let S;return e[32]!==v||e[33]!==b||e[34]!==d||e[35]!==f?(S=n.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[d,f,v,b]}),e[32]=v,e[33]=b,e[34]=d,e[35]=f,e[36]=S):S=e[36],S}function xx(t){const e=F.c(24),{fileKey:s,taskId:i}=t,r=Vt(),{data:o,isPending:a}=od(i);let l;e[0]!==s||e[1]!==o?(l=o?.find(p=>p.key===s)??null,e[0]=s,e[1]=o,e[2]=l):l=e[2];const d=l;let c;e[3]!==r?(c=()=>r({to:".",search:yx,replace:!0}),e[3]=r,e[4]=c):c=e[4];const h=c;if(!d){if(a){let g;return e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"h-full w-full bg-background",children:n.jsx(p2,{})}),e[5]=g):g=e[5],g}let p;e[6]!==s?(p=s.split("/").pop()??s,e[6]=s,e[7]=p):p=e[7];let _;e[8]!==p?(_=n.jsx(Ii,{filename:p,className:"h-7.5 w-6"}),e[8]=p,e[9]=_):_=e[9];let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."}),e[10]=L):L=e[10];let v;e[11]!==h?(v=n.jsx(ie,{variant:"ghost",size:"sm",onClick:h,children:"Close"}),e[11]=h,e[12]=v):v=e[12];let x;return e[13]!==_||e[14]!==v?(x=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 bg-background",children:[_,L,v]}),e[13]=_,e[14]=v,e[15]=x):x=e[15],x}let u;e[16]!==d||e[17]!==h?(u=n.jsx(vx,{file:d,onClose:h}),e[16]=d,e[17]=h,e[18]=u):u=e[18];let f;e[19]!==d?(f=n.jsx("div",{className:"relative min-h-0 flex-1",children:n.jsx(g2,{file:d})}),e[19]=d,e[20]=f):f=e[20];let m;return e[21]!==u||e[22]!==f?(m=n.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[u,f]}),e[21]=u,e[22]=f,e[23]=m):m=e[23],m}function yx(t){return{...t,main:"0"}}const Go="home";function bx(t){const e=F.c(5),{label:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(El,{className:"aspect-video w-2/3 max-w-xl"}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[1]=s,e[2]=r):r=e[2];let o;return e[3]!==r?(o=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-background",children:[i,r]}),e[3]=r,e[4]=o):o=e[4],o}function Sx(t){const e=F.c(15),{path:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={refetchIntervalWhenAbsent:2e3},e[0]=i):i=e[0];const r=L2(Go,s,i),o=v2(Go)(s);if(r.isPending||!r.data){const f=!r.isPending&&!r.data?"Waiting for the deck to sync…":void 0;let m;return e[1]!==f?(m=n.jsx(bx,{label:f}),e[1]=f,e[2]=m):m=e[2],m}let a;e[3]!==r.data?(a=x2(r.data),e[3]=r.data,e[4]=a):a=e[4];const l=r.data.shareMode??"private",d=r.data.effectivePublic??!1,c=window.location.origin+o;let h;e[5]!==s||e[6]!==l||e[7]!==d||e[8]!==c?(h=n.jsx(y2,{volume:Go,path:s,shareMode:l,effectivePublic:d,url:c}),e[5]=s,e[6]=l,e[7]=d,e[8]=c,e[9]=h):h=e[9];let u;return e[10]!==s||e[11]!==o||e[12]!==a||e[13]!==h?(u=n.jsx(b2,{readUrl:o,marker:a,title:s,savePath:s,trailing:h}),e[10]=s,e[11]=o,e[12]=a,e[13]=h,e[14]=u):u=e[14],u}function wx(t){const e=F.c(5),{path:s}=t,i=Vt();let r;e[0]!==i?(r=()=>i({to:".",search:Cx,replace:!0}),e[0]=i,e[1]=r):r=e[1];const o=r;let a;return e[2]!==o||e[3]!==s?(a=n.jsx(S2,{previewPath:s,onClose:o,showSeeInLibrary:!0}),e[2]=o,e[3]=s,e[4]=a):a=e[4],a}function Cx(t){return{...t,main:"0"}}const Yc=M.lazy(()=>cs(()=>import("./project-app-view-Dds52VxM.js"),__vite__mapDeps([154,1,2,44,7,8,9,10,11,12,13,14,15,16,6,3,4,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,119,101,92,89,102,103,81,82,83,84,85,86,87,88,90,91,93,94,95,96,97,104,105,106,107,108,109,110,111,112,80,113,114,115,116,117,118,120,121,122,123,99,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141])).then(t=>({default:t.AppViewContent})));function kx(t){const e=F.c(53),{activeTab:s,virtualMcpId:i,taskId:r,layoutTabs:o,expandedTools:a,automationTabParsed:l}=t;if(a2(s)){let g;return e[0]!==i?(g=n.jsx(lc,{virtualMcpId:i}),e[0]=i,e[1]=g):g=e[1],g}if(s==="git"){let g;return e[2]!==i?(g=n.jsx(hg,{virtualMcpId:i}),e[2]=i,e[3]=g):g=e[3],g}if(s==="automations"){let g;return e[4]!==i?(g=n.jsx(Lx,{virtualMcpId:i}),e[4]=i,e[5]=g):g=e[5],g}if(s==="preview"){let g;return e[6]!==i?(g=n.jsx(__,{virtualMcpId:i}),e[6]=i,e[7]=g):g=e[7],g}if(s==="content"){let g;return e[8]!==i?(g=n.jsx(Iv,{virtualMcpId:i}),e[8]=i,e[9]=g):g=e[9],g}if(l){let g;return e[10]!==s?(g=n.jsx(fx,{tabId:s}),e[10]=s,e[11]=g):g=e[11],g}let d;e[12]!==s?(d=Cd(s),e[12]=s,e[13]=d):d=e[13];const c=d;if(c){let g;return e[14]!==c.path?(g=n.jsx(Sx,{path:c.path},c.path),e[14]=c.path,e[15]=g):g=e[15],g}let h;e[16]!==s?(h=wd(s),e[16]=s,e[17]=h):h=e[17];const u=h;if(u){let g;return e[18]!==u.key||e[19]!==r?(g=n.jsx(xx,{fileKey:u.key,taskId:r}),e[18]=u.key,e[19]=r,e[20]=g):g=e[20],g}let f;e[21]!==s?(f=kd(s),e[21]=s,e[22]=f):f=e[22];const m=f;if(m){let g;return e[23]!==m.path?(g=n.jsx(wx,{path:m.path},m.path),e[23]=m.path,e[24]=g):g=e[24],g}let p;e[25]!==s?(p=l2(s),e[25]=s,e[26]=p):p=e[26];const _=p;if(_){let g;if(e[27]!==a||e[28]!==_.connectionId||e[29]!==_.toolName){let C;e[31]!==_.connectionId||e[32]!==_.toolName?(C=N=>N.appId===_.connectionId&&N.toolName===_.toolName,e[31]=_.connectionId,e[32]=_.toolName,e[33]=C):C=e[33],g=a.find(C),e[27]=a,e[28]=_.connectionId,e[29]=_.toolName,e[30]=g}else g=e[30];const y=g;let b;e[34]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(zi,{}),e[34]=b):b=e[34];const S=y?.args;let w;return e[35]!==s||e[36]!==_.connectionId||e[37]!==_.toolName||e[38]!==S?(w=n.jsx(M.Suspense,{fallback:b,children:n.jsx(Yc,{connectionId:_.connectionId,toolName:_.toolName,args:S},s)}),e[35]=s,e[36]=_.connectionId,e[37]=_.toolName,e[38]=S,e[39]=w):w=e[39],w}let L;if(e[40]!==s||e[41]!==o){let g;e[43]!==s?(g=y=>y.id===s,e[43]=s,e[44]=g):g=e[44],L=o.find(g),e[40]=s,e[41]=o,e[42]=L}else L=e[42];const v=L;if(v){let g;e[45]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(zi,{}),e[45]=g):g=e[45];let y;return e[46]!==s||e[47]!==v.id||e[48]!==v.view.appId||e[49]!==v.view.args?(y=n.jsx(M.Suspense,{fallback:g,children:n.jsx(Yc,{connectionId:v.view.appId,toolName:v.id,args:v.view.args},s)}),e[46]=s,e[47]=v.id,e[48]=v.view.appId,e[49]=v.view.args,e[50]=y):y=e[50],y}let x;return e[51]!==i?(x=n.jsx(lc,{virtualMcpId:i}),e[51]=i,e[52]=x):x=e[52],x}function jx(t){const e=F.c(14),{taskId:s,virtualMcpId:i}=t;let r;e[0]!==s||e[1]!==i?(r={virtualMcpId:i,taskId:s},e[0]=s,e[1]=i,e[2]=r):r=e[2];const{activeTab:o,layoutTabs:a,expandedTools:l,automationTabParsed:d}=Ql(r);let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(zi,{}),e[3]=c):c=e[3];let h;e[4]!==o||e[5]!==d||e[6]!==l||e[7]!==a||e[8]!==s||e[9]!==i?(h=n.jsx(M.Suspense,{fallback:c,children:n.jsx(kx,{activeTab:o,virtualMcpId:i,taskId:s,layoutTabs:a,expandedTools:l,automationTabParsed:d})}),e[4]=o,e[5]=d,e[6]=l,e[7]=a,e[8]=s,e[9]=i,e[10]=h):h=e[10];let u;return e[11]!==o||e[12]!==h?(u=n.jsx(Jt,{children:h},o),e[11]=o,e[12]=h,e[13]=u):u=e[13],u}const si="setup";function Nx(t){const e=F.c(35);let s;if(e[0]!==t.scriptTabs||e[1]!==t.scripts){let m;e[3]!==t.scriptTabs?(m=p=>!t.scriptTabs.includes(p),e[3]=t.scriptTabs,e[4]=m):m=e[4],s=t.scripts.filter(m),e[0]=t.scriptTabs,e[1]=t.scripts,e[2]=s}else s=e[2];const i=s;let r;e[5]!==t?(r=()=>{t.active===si?t.onToggle():t.onSelectTab(si)},e[5]=t,e[6]=r):r=e[6];const o=r,a=t.active===si;let l;e[7]!==o||e[8]!==t.open||e[9]!==a?(l=n.jsx(Ex,{active:a,open:t.open,onClick:o}),e[7]=o,e[8]=t.open,e[9]=a,e[10]=l):l=e[10];let d;e[11]!==t?(d=t.scriptTabs.map(m=>n.jsx(Ax,{active:t.active===m,onClick:()=>{t.active===m?t.onToggle():t.onSelectTab(m)},onClose:()=>t.onCloseScript(m),children:m},m)),e[11]=t,e[12]=d):d=e[12];let c;e[13]!==i||e[14]!==t.onAddScript?(c=n.jsx(Rx,{scripts:i,onRun:t.onAddScript}),e[13]=i,e[14]=t.onAddScript,e[15]=c):c=e[15];let h;e[16]!==l||e[17]!==d||e[18]!==c?(h=n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto",children:[l,d,c]}),e[16]=l,e[17]=d,e[18]=c,e[19]=h):h=e[19];let u;e[20]!==t.onRestart||e[21]!==t.onResume||e[22]!==t.onRetry||e[23]!==t.onRunActiveScript||e[24]!==t.onStart||e[25]!==t.onStop||e[26]!==t.onStopActiveScript||e[27]!==t.scriptIsKilling||e[28]!==t.scriptIsRunning||e[29]!==t.showScriptControls||e[30]!==t.status?(u=t.showScriptControls?n.jsx(Px,{isRunning:t.scriptIsRunning,isKilling:t.scriptIsKilling,onRun:t.onRunActiveScript,onStop:t.onStopActiveScript}):n.jsx(Tx,{status:t.status,onStart:t.onStart,onStop:t.onStop,onRestart:t.onRestart,onResume:t.onResume,onRetry:t.onRetry}),e[20]=t.onRestart,e[21]=t.onResume,e[22]=t.onRetry,e[23]=t.onRunActiveScript,e[24]=t.onStart,e[25]=t.onStop,e[26]=t.onStopActiveScript,e[27]=t.scriptIsKilling,e[28]=t.scriptIsRunning,e[29]=t.showScriptControls,e[30]=t.status,e[31]=u):u=e[31];let f;return e[32]!==h||e[33]!==u?(f=n.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-t border-b border-border bg-muted/60 px-3",children:[h,u]}),e[32]=h,e[33]=u,e[34]=f):f=e[34],f}function Ex(t){const e=F.c(8),{active:s,open:i,onClick:r}=t,o=s&&i,a=s&&i,l=s?"border-border bg-background font-medium text-foreground shadow-sm":"border-transparent text-muted-foreground hover:bg-background/50 hover:text-foreground";let d;e[0]!==l?(d=le("flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-xs",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(im,{className:"size-3.5"}),e[2]=c):c=e[2];let h;return e[3]!==r||e[4]!==o||e[5]!==a||e[6]!==d?(h=n.jsxs("button",{type:"button","aria-pressed":o,"aria-expanded":a,onClick:r,className:d,children:[c,"sandbox"]}),e[3]=r,e[4]=o,e[5]=a,e[6]=d,e[7]=h):h=e[7],h}function Tx(t){const e=F.c(24),{status:s,onStart:i,onStop:r,onRestart:o,onResume:a,onRetry:l}=t;if(s==="idle"&&i){let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Mi,{className:"size-3.5"}),e[0]=d):d=e[0];let c;return e[1]!==i?(c=n.jsxs(ie,{variant:"outline",size:"sm",onClick:i,children:[d," Start"]}),e[1]=i,e[2]=c):c=e[2],c}if(s==="suspended"&&a){let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Mi,{className:"size-3.5"}),e[3]=d):d=e[3];let c;return e[4]!==a?(c=n.jsxs(ie,{variant:"outline",size:"sm",onClick:a,children:[d," Resume"]}),e[4]=a,e[5]=c):c=e[5],c}if(s==="errored"&&l){let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Pn,{className:"size-3.5"}),e[6]=d):d=e[6];let c;return e[7]!==l?(c=n.jsxs(ie,{variant:"outline",size:"sm",onClick:l,children:[d," Retry"]}),e[7]=l,e[8]=c):c=e[8],c}if(s==="starting"||s==="running"){const d=s==="running"&&!!o,c=d?"rounded-r-none border-r-0":void 0;let h;e[9]!==c?(h=le(c),e[9]=c,e[10]=h):h=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Od,{className:"size-3.5"}),e[11]=u):u=e[11];let f;e[12]!==r||e[13]!==h?(f=n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",onClick:r,className:h,children:[u," Stop"]})}),e[12]=r,e[13]=h,e[14]=f):f=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Te,{children:"Stop sandbox"}),e[15]=m):m=e[15];let p;e[16]!==f?(p=n.jsxs(Ae,{children:[f,m]}),e[16]=f,e[17]=p):p=e[17];let _;e[18]!==o||e[19]!==d?(_=d&&n.jsxs(Qt,{children:[n.jsx(es,{asChild:!0,children:n.jsx(ie,{variant:"outline",size:"sm",className:"rounded-l-none px-1",children:n.jsx(ds,{className:"size-3"})})}),n.jsx(ts,{align:"end",children:n.jsxs(We,{onClick:o,children:[n.jsx(Pn,{className:"size-3.5"})," Restart"]})})]}),e[18]=o,e[19]=d,e[20]=_):_=e[20];let L;return e[21]!==p||e[22]!==_?(L=n.jsxs("div",{className:"flex items-center",children:[p,_]}),e[21]=p,e[22]=_,e[23]=L):L=e[23],L}return null}function Ax(t){const e=F.c(16),{active:s,onClick:i,onClose:r,children:o}=t,a=s?"border-border bg-background shadow-sm":"border-transparent hover:bg-background/50";let l;e[0]!==a?(l=le("flex h-7 items-center rounded-md border text-xs",a),e[0]=a,e[1]=l):l=e[1];const d=r?"pl-2.5 pr-1":"px-2.5",c=s?"font-medium text-foreground":"text-muted-foreground hover:text-foreground";let h;e[2]!==d||e[3]!==c?(h=le("flex h-full items-center",d,c),e[2]=d,e[3]=c,e[4]=h):h=e[4];let u;e[5]!==o||e[6]!==i||e[7]!==h?(u=n.jsx("button",{type:"button",onClick:i,className:h,children:o}),e[5]=o,e[6]=i,e[7]=h,e[8]=u):u=e[8];let f;e[9]!==o||e[10]!==r?(f=r&&n.jsx("button",{type:"button","aria-label":`Close ${o}`,onClick:r,className:"pr-1.5 text-muted-foreground hover:text-foreground",children:n.jsx(mo,{className:"size-3"})}),e[9]=o,e[10]=r,e[11]=f):f=e[11];let m;return e[12]!==l||e[13]!==u||e[14]!==f?(m=n.jsxs("div",{className:l,children:[u,f]}),e[12]=l,e[13]=u,e[14]=f,e[15]=m):m=e[15],m}function Rx(t){const e=F.c(10),{scripts:s,onRun:i}=t,[r,o]=M.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs(Ae,{children:[n.jsx(Ee,{asChild:!0,children:n.jsx(Ss,{asChild:!0,children:n.jsx(ie,{variant:"ghost",size:"sm","aria-label":"Run script",children:n.jsx(Dt,{className:"size-3.5"})})})}),n.jsx(Te,{children:"Run script"})]}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"run a script"}),e[1]=l):l=e[1];let d;e[2]!==i||e[3]!==s?(d=s.length===0?n.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No scripts found"}):s.map(u=>n.jsxs("button",{type:"button",onClick:()=>{o(!1),i(u)},className:"w-full rounded-md px-2 py-1.5 text-left text-xs hover:bg-accent",children:["▸ ",u]},u)),e[2]=i,e[3]=s,e[4]=d):d=e[4];let c;e[5]!==d?(c=n.jsxs(ws,{align:"start",className:"p-1 w-56",children:[l,d]}),e[5]=d,e[6]=c):c=e[6];let h;return e[7]!==r||e[8]!==c?(h=n.jsxs(bs,{open:r,onOpenChange:o,children:[a,c]}),e[7]=r,e[8]=c,e[9]=h):h=e[9],h}function Px(t){const e=F.c(13),{isRunning:s,isKilling:i,onRun:r,onStop:o}=t;if(i){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(ie,{variant:"outline",size:"sm",disabled:!0,children:[n.jsx(Oe,{className:"size-3.5 animate-spin"})," Stopping…"]}),e[0]=h):h=e[0],h}if(!s){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Mi,{className:"size-3.5"}),e[1]=h):h=e[1];let u;e[2]!==r?(u=n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",onClick:r,children:[h," Run"]})}),e[2]=r,e[3]=u):u=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Te,{children:"Start process"}),e[4]=f):f=e[4];let m;return e[5]!==u?(m=n.jsxs(Ae,{children:[u,f]}),e[5]=u,e[6]=m):m=e[6],m}let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Od,{className:"size-3.5"}),e[7]=a):a=e[7];let l;e[8]!==o?(l=n.jsx(Ee,{asChild:!0,children:n.jsxs(ie,{variant:"outline",size:"sm",onClick:o,children:[a," Stop"]})}),e[8]=o,e[9]=l):l=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Te,{children:"Stop process"}),e[10]=d):d=e[10];let c;return e[11]!==l?(c=n.jsxs(Ae,{children:[l,d]}),e[11]=l,e[12]=c):c=e[12],c}var Gu=Object.defineProperty,Dx=Object.getOwnPropertyDescriptor,Ix=(t,e)=>{for(var s in e)Gu(t,s,{get:e[s],enumerable:!0})},lt=(t,e,s,i)=>{for(var r=i>1?void 0:i?Dx(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(i?a(e,s,r):a(r))||r);return i&&r&&Gu(e,s,r),r},Le=(t,e)=>(s,i)=>e(s,i,t),Jc="Terminal input",Na={get:()=>Jc,set:t=>Jc=t},Xc="Too much output to announce, navigate to rows manually to read",Ea={get:()=>Xc,set:t=>Xc=t};function Mx(t){return t.replace(/\r?\n/g,"\r")}function Bx(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function Ox(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function $x(t,e,s,i){if(t.stopPropagation(),t.clipboardData){let r=t.clipboardData.getData("text/plain");Yu(r,e,s,i)}}function Yu(t,e,s,i){t=Mx(t),t=Bx(t,s.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(t,!0),e.value=""}function Ju(t,e,s){let i=s.getBoundingClientRect(),r=t.clientX-i.left-10,o=t.clientY-i.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${r}px`,e.style.top=`${o}px`,e.style.zIndex="1000",e.focus()}function Zc(t,e,s,i,r){Ju(t,e,s),r&&i.rightClickSelect(t),e.value=i.selectionText,e.select()}function zs(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function ko(t,e=0,s=t.length){let i="";for(let r=e;r<s;++r){let o=t[r];o>65535?(o-=65536,i+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):i+=String.fromCharCode(o)}return i}var zx=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,e){let s=t.length;if(!s)return 0;let i=0,r=0;if(this._interim){let o=t.charCodeAt(r++);56320<=o&&o<=57343?e[i++]=(this._interim-55296)*1024+o-56320+65536:(e[i++]=this._interim,e[i++]=o),this._interim=0}for(let o=r;o<s;++o){let a=t.charCodeAt(o);if(55296<=a&&a<=56319){if(++o>=s)return this._interim=a,i;let l=t.charCodeAt(o);56320<=l&&l<=57343?e[i++]=(a-55296)*1024+l-56320+65536:(e[i++]=a,e[i++]=l);continue}a!==65279&&(e[i++]=a)}return i}},Fx=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,e){let s=t.length;if(!s)return 0;let i=0,r,o,a,l,d=0,c=0;if(this.interim[0]){let f=!1,m=this.interim[0];m&=(m&224)===192?31:(m&240)===224?15:7;let p=0,_;for(;(_=this.interim[++p]&63)&&p<4;)m<<=6,m|=_;let L=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,v=L-p;for(;c<v;){if(c>=s)return 0;if(_=t[c++],(_&192)!==128){c--,f=!0;break}else this.interim[p++]=_,m<<=6,m|=_&63}f||(L===2?m<128?c--:e[i++]=m:L===3?m<2048||m>=55296&&m<=57343||m===65279||(e[i++]=m):m<65536||m>1114111||(e[i++]=m)),this.interim.fill(0)}let h=s-4,u=c;for(;u<s;){for(;u<h&&!((r=t[u])&128)&&!((o=t[u+1])&128)&&!((a=t[u+2])&128)&&!((l=t[u+3])&128);)e[i++]=r,e[i++]=o,e[i++]=a,e[i++]=l,u+=4;if(r=t[u++],r<128)e[i++]=r;else if((r&224)===192){if(u>=s)return this.interim[0]=r,i;if(o=t[u++],(o&192)!==128){u--;continue}if(d=(r&31)<<6|o&63,d<128){u--;continue}e[i++]=d}else if((r&240)===224){if(u>=s)return this.interim[0]=r,i;if(o=t[u++],(o&192)!==128){u--;continue}if(u>=s)return this.interim[0]=r,this.interim[1]=o,i;if(a=t[u++],(a&192)!==128){u--;continue}if(d=(r&15)<<12|(o&63)<<6|a&63,d<2048||d>=55296&&d<=57343||d===65279)continue;e[i++]=d}else if((r&248)===240){if(u>=s)return this.interim[0]=r,i;if(o=t[u++],(o&192)!==128){u--;continue}if(u>=s)return this.interim[0]=r,this.interim[1]=o,i;if(a=t[u++],(a&192)!==128){u--;continue}if(u>=s)return this.interim[0]=r,this.interim[1]=o,this.interim[2]=a,i;if(l=t[u++],(l&192)!==128){u--;continue}if(d=(r&7)<<18|(o&63)<<12|(a&63)<<6|l&63,d<65536||d>1114111)continue;e[i++]=d}}return i}},Xu="",Fs=" ",Qn=class Zu{constructor(){this.fg=0,this.bg=0,this.extended=new Zr}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new Zu;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Zr=class Qu{constructor(e=0,s=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=s}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new Qu(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Zt=class e1 extends Qn{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Zr,this.combinedData=""}static fromCharData(e){let s=new e1;return s.setFromCharData(e),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?zs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let s=!1;if(e[1].length>2)s=!0;else if(e[1].length===2){let i=e[1].charCodeAt(0);if(55296<=i&&i<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(i-55296)*1024+r-56320+65536|e[2]<<22:s=!0}else s=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;s&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Qc="di$target",Ta="di$dependencies",Yo=new Map;function Hx(t){return t[Ta]||[]}function xt(t){if(Yo.has(t))return Yo.get(t);let e=function(s,i,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ux(e,s,r)};return e._id=t,Yo.set(t,e),e}function Ux(t,e,s){e[Qc]===e?e[Ta].push({id:t,index:s}):(e[Ta]=[{id:t,index:s}],e[Qc]=e)}var It=xt("BufferService"),t1=xt("CoreMouseService"),xi=xt("CoreService"),Wx=xt("CharsetService"),x9=xt("InstantiationService"),s1=xt("LogService"),Mt=xt("OptionsService"),i1=xt("OscLinkService"),Vx=xt("UnicodeService"),er=xt("DecorationService"),Aa=class{constructor(t,e,s){this._bufferService=t,this._optionsService=e,this._oscLinkService=s}provideLinks(t,e){let s=this._bufferService.buffer.lines.get(t-1);if(!s){e(void 0);return}let i=[],r=this._optionsService.rawOptions.linkHandler,o=new Zt,a=s.getTrimmedLength(),l=-1,d=-1,c=!1;for(let h=0;h<a;h++)if(!(d===-1&&!s.hasContent(h))){if(s.loadCell(h,o),o.hasExtendedAttrs()&&o.extended.urlId)if(d===-1){d=h,l=o.extended.urlId;continue}else c=o.extended.urlId!==l;else d!==-1&&(c=!0);if(c||d!==-1&&h===a-1){let u=this._oscLinkService.getLinkData(l)?.uri;if(u){let f={start:{x:d+1,y:t},end:{x:h+(!c&&h===a-1?1:0),y:t}},m=!1;if(!r?.allowNonHttpProtocols)try{let p=new URL(u);["http:","https:"].includes(p.protocol)||(m=!0)}catch{m=!0}m||i.push({text:u,range:f,activate:(p,_)=>r?r.activate(p,_,f):Kx(p,_),hover:(p,_)=>r?.hover?.(p,_,f),leave:(p,_)=>r?.leave?.(p,_,f)})}c=!1,o.hasExtendedAttrs()&&o.extended.urlId?(d=h,l=o.extended.urlId):(d=-1,l=-1)}}e(i)}};Aa=lt([Le(0,It),Le(1,Mt),Le(2,i1)],Aa);function Kx(t,e){if(confirm(`Do you want to navigate to ${e}?
|
|
487
487
|
|
|
488
488
|
WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var jo=xt("CharSizeService"),Is=xt("CoreBrowserService"),y9=xt("MouseService"),Ms=xt("RenderService"),qx=xt("SelectionService"),n1=xt("CharacterJoinerService"),tn=xt("ThemeService"),r1=xt("LinkProviderService"),Gx=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?e0.isErrorNoTelemetry(t)?new e0(t.message+`
|
|
489
489
|
|