decocms 4.541.0 → 4.542.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-HI4PJ-HL.js → ActiveShapeUtils-ppN64tl0.js} +1 -1
- package/dist/client/assets/{AlertCircle-Pu-QR8hS.js → AlertCircle-RV4AM_8y.js} +1 -1
- package/dist/client/assets/{AreaChart-DJ3vI97z.js → AreaChart-B5eHYCMZ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CiCYDVFq.js → ArrowLeft-XO66B9Td.js} +1 -1
- package/dist/client/assets/{ArrowUp-bMBjrwqG.js → ArrowUp-DpQ-09y4.js} +1 -1
- package/dist/client/assets/{BarChart-DW5fB9sQ.js → BarChart-rvb3yNLn.js} +1 -1
- package/dist/client/assets/{Building02-BejNykWR.js → Building02-NRzC_IEp.js} +1 -1
- package/dist/client/assets/{CartesianChart-BfqGbR2p.js → CartesianChart-BVsrzbFJ.js} +1 -1
- package/dist/client/assets/{CategoricalChart-1g-OhB34.js → CategoricalChart-64zykerQ.js} +1 -1
- package/dist/client/assets/{CheckCircle-CiBrtkwP.js → CheckCircle-CfYD_Bi6.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Bb_Zani-.js → ChevronSelectorVertical-C5MARPJN.js} +1 -1
- package/dist/client/assets/{ChevronUp-D3pnxmNi.js → ChevronUp-xR4eZngE.js} +1 -1
- package/dist/client/assets/{Copy01-BEOZtg79.js → Copy01-Dy1KrWO0.js} +1 -1
- package/dist/client/assets/{CreditCard01-C2H6wRye.js → CreditCard01-DVN26JVZ.js} +1 -1
- package/dist/client/assets/{DotsVertical-DddKhPwC.js → DotsVertical-CncVW4wJ.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CUSRsGW6.js → ErrorBarContext-C5dp8Quc.js} +1 -1
- package/dist/client/assets/{Globe04-CR7aWwIq.js → Globe04-BxFc3HLH.js} +1 -1
- package/dist/client/assets/{Image01-D9f6XNAl.js → Image01-CaawlkVR.js} +1 -1
- package/dist/client/assets/{Key01-BGQzZTLx.js → Key01-FaGRi3tG.js} +1 -1
- package/dist/client/assets/{Link01-_AjEk0aG.js → Link01-B_YWUHoH.js} +1 -1
- package/dist/client/assets/{LinkBroken01-BeLPonYT.js → LinkBroken01-z_Mm0CSf.js} +1 -1
- package/dist/client/assets/{Minus-DRtjDVr0.js → Minus-yAYwM_Ty.js} +1 -1
- package/dist/client/assets/{Monitor01-CMcPb3p-.js → Monitor01-Bl7f7T5L.js} +1 -1
- package/dist/client/assets/{Play-Bon9Nn-R.js → Play-OByKGnTy.js} +1 -1
- package/dist/client/assets/{Plus-DZ8OV5bq.js → Plus-Ccck99Do.js} +1 -1
- package/dist/client/assets/{ReferenceLine-CduNCTtx.js → ReferenceLine-BxNBuCjR.js} +1 -1
- package/dist/client/assets/{SearchMd-Coxjt-Zl.js → SearchMd-BAGHgvYw.js} +1 -1
- package/dist/client/assets/{Sector-CNB3zVjr.js → Sector-BCmuavOw.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-CeVNpa4z.js → ShoppingBag01-BhoOjVkp.js} +1 -1
- package/dist/client/assets/{Sun-E-EbUc0n.js → Sun-CZRF_565.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B8-pBEhT.js → SwitchHorizontal01-Ce37vA9c.js} +1 -1
- package/dist/client/assets/{Tool01-CkZTily1.js → Tool01-CHLDtlIL.js} +1 -1
- package/dist/client/assets/{Trash01-C8OxhBl3.js → Trash01-BQBP0tUM.js} +1 -1
- package/dist/client/assets/{Upload01-Bt37Plwz.js → Upload01-D_q00M49.js} +1 -1
- package/dist/client/assets/{UserSquare-D7fSnIn3.js → UserSquare-BSsT3MHy.js} +1 -1
- package/dist/client/assets/{Users01-DVEy527M.js → Users01-C6bE7RDt.js} +1 -1
- package/dist/client/assets/{XClose-Bvl4KGPV.js → XClose-BjZnEBvF.js} +1 -1
- package/dist/client/assets/Zap-CHuT8W6R.js +1 -0
- package/dist/client/assets/{ZoomOut-9x8WuC5l.js → ZoomOut-CBOWQYet.js} +1 -1
- package/dist/client/assets/{access-gate-DaxHYIBB.js → access-gate-BU0Til0A.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CjJZP05X.js → add-connection-dialog-BB5lDWHR.js} +1 -1
- package/dist/client/assets/agent-analytics-DvRSJxx0.js +2 -0
- package/dist/client/assets/agent-app-B0uhmcWv.js +1 -0
- package/dist/client/assets/agent-assets-DtVY4a5g.js +1 -0
- package/dist/client/assets/{agent-automation-CI0Nub-n.js → agent-automation-DcUA7Zto.js} +2 -2
- package/dist/client/assets/agent-automations-C9tGxGRj.js +1 -0
- package/dist/client/assets/agent-calendar-D4_LWZH3.js +1 -0
- package/dist/client/assets/agent-connect-sources-BJ3ZDaf3.js +1 -0
- package/dist/client/assets/agent-deck-CACa1iZR.js +1 -0
- package/dist/client/assets/agent-e2e-Cn5SS6MS.js +1 -0
- package/dist/client/assets/agent-experiments-TwOhraCy.js +1 -0
- package/dist/client/assets/agent-file-W_Lb3P1H.js +1 -0
- package/dist/client/assets/agent-hosting-CP_GZV0j.js +1 -0
- package/dist/client/assets/agent-icon-nQ1AH9dU.js +1 -0
- package/dist/client/assets/agent-library-BvH-Q75b.js +1 -0
- package/dist/client/assets/agent-library-file-BC8zk1Dl.js +1 -0
- package/dist/client/assets/agent-monitor-UYQNblqG.js +1 -0
- package/dist/client/assets/agent-overview-BlaBQIjD.js +1 -0
- package/dist/client/assets/{agent-releases-CEzBKX-V.js → agent-releases-CAYqdnuz.js} +2 -2
- package/dist/client/assets/agent-settings-Lu1EqGNe.js +1 -0
- package/dist/client/assets/agent-site-editor-code-BAyfkSPu.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CKgCOX3-.js +1 -0
- package/dist/client/assets/{agent-site-editor-Du4tKYJz.js → agent-site-editor-dBOL06nH.js} +2 -2
- package/dist/client/assets/agent-site-editor-preview-B9oFLAt2.js +1 -0
- package/dist/client/assets/agent-view-D-sscasX.js +1 -0
- package/dist/client/assets/{agent-view-guard-B04R8Znt.js → agent-view-guard-B4NqxjMv.js} +1 -1
- package/dist/client/assets/agents-list-DYMJQcr6.js +1 -0
- package/dist/client/assets/{ai-providers-aETP-f64.js → ai-providers-Ci2k4cWf.js} +1 -1
- package/dist/client/assets/{alert-BF8n9shl.js → alert-Bsjmz-OK.js} +1 -1
- package/dist/client/assets/{analytics-sections-SZXfO52-.js → analytics-sections-Nw_65a4t.js} +1 -1
- package/dist/client/assets/{api-keys-CiBjRrwV.js → api-keys-D4BF_tKg.js} +1 -1
- package/dist/client/assets/api-keys-D_tuzPJP.js +1 -0
- package/dist/client/assets/app-editor-hRLD7Ehq.js +1 -0
- package/dist/client/assets/{asset-utils-7zQmpZtP.js → asset-utils-BSDCnt-j.js} +1 -1
- package/dist/client/assets/{auth-Dt9DGFhA.js → auth-CK6AyRu5.js} +1 -1
- package/dist/client/assets/{auth-catchall-APuNzDqf.js → auth-catchall-CJTrtQsq.js} +1 -1
- package/dist/client/assets/{auth-entry-Dt8D4c49.js → auth-entry-CPeTN7o5.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DKGBUJmn.js → auth-split-layout-BGf8-EnP.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CzFtziag.js → authenticate-and-persist-oauth-Bb8BBbsA.js} +1 -1
- package/dist/client/assets/automation-list-row-B9IR9kWn.js +1 -0
- package/dist/client/assets/{automation-runs-rp2R5GSb.js → automation-runs-DnR9pxm5.js} +1 -1
- package/dist/client/assets/automations-Bxg30h3H.js +1 -0
- package/dist/client/assets/{autosend-BYljpA5c.js → autosend-DTWIjCgK.js} +1 -1
- package/dist/client/assets/{badge-CMgWUKiX.js → badge-BV7rxTvN.js} +1 -1
- package/dist/client/assets/{block-document-ClAOKgf4.js → block-document-CQARMaA2.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-DQj4RBd8.js → blocks-preview-workspace-context-C2nnj0H9.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CQydf1x6.js → blocks-tab-states-DhR3pyff.js} +1 -1
- package/dist/client/assets/{blog-schema-BOqVZaeF.js → blog-schema-YJUL-tEX.js} +1 -1
- package/dist/client/assets/{buckets-qwGMsdZj.js → buckets-C4JU-8qW.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-B2MxMIfa.js → build-improve-prompt-doc-Bv3kayMV.js} +1 -1
- package/dist/client/assets/{calendar-gk2fXc2c.js → calendar-ym6zGcEl.js} +1 -1
- package/dist/client/assets/{capability-load-error-D2UF4Aw2.js → capability-load-error-7V5aWr5c.js} +1 -1
- package/dist/client/assets/category-editor-CdId4wR5.js +1 -0
- package/dist/client/assets/{cdn-tab-BJ_vvsuv.js → cdn-tab-2DyF7VRR.js} +1 -1
- package/dist/client/assets/{chart-orNTiDQv.js → chart-eh3rIFzp.js} +1 -1
- package/dist/client/assets/{chat-context-Cbn1d2gD.js → chat-context-kqrW-XPR.js} +1 -1
- package/dist/client/assets/{chat-draft-Dz-8ZkTL.js → chat-draft-CRTo5XoS.js} +1 -1
- package/dist/client/assets/{checkbox-CA6aWe75.js → checkbox-aDQexY19.js} +1 -1
- package/dist/client/assets/choose-editor-D9t0sU_N.js +1 -0
- package/dist/client/assets/{cli-auth-success-BwZvMY9K.js → cli-auth-success-BSvz1123.js} +1 -1
- package/dist/client/assets/{client-icons-BokFUC05.js → client-icons-DGnfsAP4.js} +1 -1
- package/dist/client/assets/cms-settings-editor-BCSWQ-Po.js +1 -0
- package/dist/client/assets/{collapsible-DMa5aTxw.js → collapsible-Cx6KFD5C.js} +1 -1
- package/dist/client/assets/collection-detail-ZxhaHEpw.js +1 -0
- package/dist/client/assets/{collection-display-button-CO0G5HBN.js → collection-display-button-Bswg3uCR.js} +1 -1
- package/dist/client/assets/{collection-search-BtpA2Lei.js → collection-search-B3vfcK1n.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-zNmZhsyo.js → collection-table-wrapper-Cs4FMkXQ.js} +1 -1
- package/dist/client/assets/{collection-tabs-CSXR7UYb.js → collection-tabs-BdhCjBRd.js} +1 -1
- package/dist/client/assets/{combobox-BwKhFDqj.js → combobox-DXDZmm8e.js} +1 -1
- package/dist/client/assets/{command-lP5P8rqX.js → command-De9pJLwH.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CvFB8u3v.js → companion-mcps-section-B-ueLE1c.js} +1 -1
- package/dist/client/assets/{config-B8-1YX-t.js → config-Bakd4Y8w.js} +1 -1
- package/dist/client/assets/{connect-D2iiXOSY.js → connect-BMYdSTT8.js} +1 -1
- package/dist/client/assets/{connect-layout-HGVTLejY.js → connect-layout-BpMetD5F.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-DXGOBfjT.js → connect-source-dialog-BkUskMwn.js} +1 -1
- package/dist/client/assets/{connection-Cn9FrEsZ.js → connection-C-NllGni.js} +1 -1
- package/dist/client/assets/{connection-card-DlWLwRKA.js → connection-card-DZD_rAWh.js} +1 -1
- package/dist/client/assets/connection-detail-BRz9FZ83.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DdDJu97E.js → connection-form-helpers-DmavsUyJ.js} +1 -1
- package/dist/client/assets/connections-Cj6HJEn1.js +1 -0
- package/dist/client/assets/{content-tab-B-LNJbd9.js → content-tab-DkKuIDyy.js} +8 -8
- package/dist/client/assets/context-C2r290S4.js +1 -0
- package/dist/client/assets/{context-menu-gvTbM_VP.js → context-menu-CiH3Gj0R.js} +1 -1
- package/dist/client/assets/{context-shell-BdVWw-gN.js → context-shell-BwT70eIn.js} +3 -3
- package/dist/client/assets/{core.esm-M1IJOkIH.js → core.esm-DQyn-kJS.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DNvzT5i-.js → create-organization-dialog-CiZys2Ku.js} +1 -1
- package/dist/client/assets/{daily-pulse-DOHhxMy1.js → daily-pulse-CMy69HGI.js} +1 -1
- package/dist/client/assets/discover-DQ9dXI7n.js +1 -0
- package/dist/client/assets/{domain-settings-DRphZ3mS.js → domain-settings-5g_MWfwe.js} +1 -1
- package/dist/client/assets/{drawer-Bsnw19SA.js → drawer-DDmudFbW.js} +1 -1
- package/dist/client/assets/{editor-Z7h3tdjo.js → editor-BqqnxL88.js} +1 -1
- package/dist/client/assets/{editor-classes-CIysMLqw.js → editor-classes-D-ez-qBv.js} +1 -1
- package/dist/client/assets/{empty-state-CEJi6IVu.js → empty-state-C7LII3ZM.js} +1 -1
- package/dist/client/assets/{empty-state-EpAwETL4.js → empty-state-iEpXVBwd.js} +1 -1
- package/dist/client/assets/{experiments-tab-BKBmpbQS.js → experiments-tab-DGo_lvyv.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-EKyQNqty.js → experiments-tab-choice-B_rL9_Nx.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CGOVIYLF.js → extract-connection-data-DYwFbKkm.js} +1 -1
- package/dist/client/assets/{feature-gate-DXCleAqA.js → feature-gate-E1LoWMx3.js} +1 -1
- package/dist/client/assets/{feature-paywall-4QJAn2z5.js → feature-paywall-CDMJv8wq.js} +1 -1
- package/dist/client/assets/file-explorer-CsD267WS.js +2 -0
- package/dist/client/assets/{file-preview-CCmllyvi.js → file-preview-Cj5pBQv2.js} +1 -1
- package/dist/client/assets/{file-share-button-DbPRyXAD.js → file-share-button-DOup2WzD.js} +1 -1
- package/dist/client/assets/{file-type-icon-CiMMiUYO.js → file-type-icon-BgzyV542.js} +1 -1
- package/dist/client/assets/folder-icon-DY3kBxQc.js +1 -0
- package/dist/client/assets/{form-Bk9ymCIS.js → form-gDNfP07W.js} +1 -1
- package/dist/client/assets/{general-Cr_ASK52.js → general-CWpdg4Hl.js} +1 -1
- package/dist/client/assets/{github-icon-EmEurWMX.js → github-icon-DAxkwypb.js} +1 -1
- package/dist/client/assets/{held-block-view-BDu8bj-6.js → held-block-view-C3Ird9F-.js} +3 -3
- package/dist/client/assets/home-TaMnsEq5.js +1 -0
- package/dist/client/assets/{hosted-publish-feedback-C3S_f767.js → hosted-publish-feedback-CVQKURab.js} +1 -1
- package/dist/client/assets/{icon-button-CcHZO8e6.js → icon-button-CTmBGRaQ.js} +1 -1
- package/dist/client/assets/{index-DMJwbqhe.js → index-15xKR9ar.js} +1 -1
- package/dist/client/assets/{index-LISCRMKT.js → index-BWpKrclg.js} +5 -5
- package/dist/client/assets/{index-BaOc9Ezz.js → index-C-GH7ZUH.js} +1 -1
- package/dist/client/assets/{index-CcyUawfW.js → index-CFDA2Gyk.js} +1 -1
- package/dist/client/assets/{index-BGKyyvyC.js → index-CXhEXTV0.js} +1 -1
- package/dist/client/assets/{index-DGAfs5q1.js → index-Cbe7caeT.js} +1 -1
- package/dist/client/assets/{index-Bd1JsEWx.js → index-Cjtut9JA.js} +1 -1
- package/dist/client/assets/{index-CRt26OMk.js → index-CzqNFJgA.js} +1 -1
- package/dist/client/assets/{index-Bek871Hp.js → index-D3fuewCp.js} +1 -1
- package/dist/client/assets/{index-DvPTtoj9.js → index-DGoeX32I.js} +1 -1
- package/dist/client/assets/{index-DMN6-ViK.js → index-DKRm_nGH.js} +2 -2
- package/dist/client/assets/{index-D_GgrLpt.js → index-G8_ivZDF.js} +1 -1
- package/dist/client/assets/{index-KxuowPl9.js → index-Qn_AZuwz.js} +1 -1
- package/dist/client/assets/index-_wqQ3Hkr.css +1 -0
- package/dist/client/assets/{index-KpWMq2p9.js → index-lchr3O79.js} +1 -1
- package/dist/client/assets/{index-redirect-C_c-8-0u.js → index-redirect-COc2iMJs.js} +1 -1
- package/dist/client/assets/{index-Rjs_bdr_.js → index-ylByMMZI.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DGdbL4U6.js → infiniteQueryObserver-CbIPWgZj.js} +1 -1
- package/dist/client/assets/{infra-billing-CkpqPi0H.js → infra-billing-gMBDswwS.js} +1 -1
- package/dist/client/assets/{input-Cgw3HqQu.js → input-Cf50b9sU.js} +3 -3
- package/dist/client/assets/{input-BhbajINs.js → input-CgS5sNmj.js} +1 -1
- package/dist/client/assets/{integration-icon-msZhQ6E3.js → integration-icon-BQ9jVlvt.js} +1 -1
- package/dist/client/assets/{jira-icon-C8kN-yG2.js → jira-icon-CzGOnWKo.js} +1 -1
- package/dist/client/assets/{label-BfYbFBpZ.js → label-DzRNwB_s.js} +1 -1
- package/dist/client/assets/{layout-DFaNAdKK.js → layout-d2_2jbV9.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BQflSkhZ.js → legacy-agents-deep-CyFzwt79.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DaGWGhtf.js → legacy-main-redirect-B0hY-Z0B.js} +1 -1
- package/dist/client/assets/library-CS74d8fl.js +1 -0
- package/dist/client/assets/{library-tab-4UasD5Mp.js → library-tab-cQd24fFO.js} +3 -3
- package/dist/client/assets/{login-DtccMmUF.js → login-BB7FreRC.js} +1 -1
- package/dist/client/assets/{markdown-CGLGjJUn.js → markdown-CkZaCBow.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BmH0oH65.js → mcp-app-renderer-BVLr3WK6.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CDHHl2AY.js → mcp-oauth-DWlxkjKx.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D5bTwzBt.js → mcp-oauth-KJGfGjkD.js} +1 -1
- package/dist/client/assets/{members-CqaIW0DL.js → members-BvQ1xqU5.js} +1 -1
- package/dist/client/assets/{memory-DoZ_Hb59.js → memory-_Oguj4if.js} +1 -1
- package/dist/client/assets/{mini-report-page-CWBsLXpy.js → mini-report-page-BC7L0ipE.js} +1 -1
- package/dist/client/assets/mock-board-BC3rEvaU.js +81 -0
- package/dist/client/assets/{monaco-editor-B_hB8uvI.js → monaco-editor-zzUPRyBn.js} +1 -1
- package/dist/client/assets/monitoring-ilB7hU6H.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-va93h-kh.js → monitoring-stats-row-DZ9HvRuy.js} +1 -1
- package/dist/client/assets/{multi-select-DqoGBuJR.js → multi-select-D2pKycte.js} +1 -1
- package/dist/client/assets/{mustache-YJnhKKzZ.js → mustache-BBgPaDqo.js} +1 -1
- package/dist/client/assets/{named-rule-uses-B5UiiWoJ.js → named-rule-uses-8PEXqP7W.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BrtI6GgZ.js → new-project-dialog-Dd5pVssc.js} +1 -1
- package/dist/client/assets/{oauth-callback-DvCUGRkg.js → oauth-callback-DIj2YLwh.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-IxBLpV6t.js → oauth-callback-ai-provider-zp6PPNfP.js} +1 -1
- package/dist/client/assets/{onboarding-CqirqsHd.js → onboarding-CSUeJ8OK.js} +1 -1
- package/dist/client/assets/openai-conversation-CT9LWWrS.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-CPWt9LH6.js → optimistic-project-sidebar-views-BhoNMrVo.js} +1 -1
- package/dist/client/assets/{order-monitor-day-or-R9J0S.js → order-monitor-day-D-Ti4NDE.js} +1 -1
- package/dist/client/assets/{organization-choice-CeZ3suN4.js → organization-choice-Bs2Llr3r.js} +1 -1
- package/dist/client/assets/{orgs-iTHfKpGx.js → orgs-Bs_15YVG.js} +1 -1
- package/dist/client/assets/{page-seo-form-CdFLhDD2.js → page-seo-form-DizfAl8r.js} +1 -1
- package/dist/client/assets/{pair-B_hske_9.js → pair-BFVxcKKp.js} +1 -1
- package/dist/client/assets/{parse-sections-rTJ9Vxva.js → parse-sections-BVn3AvAz.js} +1 -1
- package/dist/client/assets/plan-_57doTJd.js +1 -0
- package/dist/client/assets/{plan-ladder-ROI7a8rc.js → plan-ladder-DVSwNgR2.js} +1 -1
- package/dist/client/assets/{plan-usage-card-DmpNxqNF.js → plan-usage-card-B64WjIMI.js} +1 -1
- package/dist/client/assets/{popover-D6dCz_8d.js → popover-ClEv7Zyf.js} +1 -1
- package/dist/client/assets/post-calendar-CMHuZuip.js +1 -0
- package/dist/client/assets/{post-editor-C9guOY0S.js → post-editor-CqgW2_fW.js} +2 -2
- package/dist/client/assets/{preview-content-DFI0aQf4.js → preview-content-BSsfQ6ZE.js} +1 -1
- package/dist/client/assets/{preview-dialog-D2HjzZ1B.js → preview-dialog-DBnDC8gE.js} +1 -1
- package/dist/client/assets/{preview-panel-0VJe1FDB.js → preview-panel-DQBuS4_f.js} +1 -1
- package/dist/client/assets/{preview-tab-CpG9tuu6.js → preview-tab-_86kIh0E.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-CFjl9WR-.js → product-picker-dialog-C8oMVTn6.js} +1 -1
- package/dist/client/assets/{profile-CY0p7UGQ.js → profile-Bsx5sLNH.js} +1 -1
- package/dist/client/assets/project-app-view-C5QghQe6.js +1 -0
- package/dist/client/assets/project-apps-oe6VMb11.js +1 -0
- package/dist/client/assets/{project-feed-Cqb3oD2R.js → project-feed-DAjFP_Ib.js} +1 -1
- package/dist/client/assets/{project-icon-As9MoCET.js → project-icon-BKeF243f.js} +1 -1
- package/dist/client/assets/project-reports-uzkOMqSE.js +1 -0
- package/dist/client/assets/project-tasks-jNTlksUk.js +1 -0
- package/dist/client/assets/projects-BaKJExhs.js +1 -0
- package/dist/client/assets/{projects-empty-state-B4wHwi2Z.js → projects-empty-state-B_kHw_MZ.js} +1 -1
- package/dist/client/assets/{prompts-f4GajLV5.js → prompts-Br3MvaH9.js} +1 -1
- package/dist/client/assets/record-editor-B5oAS_5D.js +1 -0
- package/dist/client/assets/redirect-editor-CSg_SJ3I.js +1 -0
- package/dist/client/assets/{releases-api-kH_Ed6eO.js → releases-api-DwHPczFb.js} +1 -1
- package/dist/client/assets/reports-CL4pYm69.js +1 -0
- package/dist/client/assets/{reports-D2UCpDap.js → reports-iqRQlH1z.js} +1 -1
- package/dist/client/assets/reports-onboarding-Bm9Wvkaq.js +1 -0
- package/dist/client/assets/reports-tab-DesQ1SQx.js +2 -0
- package/dist/client/assets/repositories-C-WO-gxz.js +1 -0
- package/dist/client/assets/{repositories-DzOMkV9O.js → repositories-DUBWep32.js} +1 -1
- package/dist/client/assets/{repository-binding-N72ZtnJ7.js → repository-binding-Bpq6heaQ.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CNVRTxph.js → repository-import-picker-DxJJpcCz.js} +1 -1
- package/dist/client/assets/{repository-picker-CW0SaV-m.js → repository-picker-P8Asvsk4.js} +1 -1
- package/dist/client/assets/{require-capability-C2GXhzLq.js → require-capability-B-uxpRvL.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BwkU_8aI.js → required-auth-layout-DYZU5vk_.js} +1 -1
- package/dist/client/assets/{reset-password-gBMO6F0r.js → reset-password-Bs_JmNWK.js} +1 -1
- package/dist/client/assets/{resizable-WR3fdR8J.js → resizable-vbjrp9Su.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DS-pAijm.js → resolve-tab-icon-CzFxm7IQ.js} +1 -1
- package/dist/client/assets/{review-settings-DcaJvbTX.js → review-settings-CsHCgNLm.js} +1 -1
- package/dist/client/assets/roles-C-6Op6OQ.js +1 -0
- package/dist/client/assets/route-Bdui6QXz.js +1 -0
- package/dist/client/assets/route-BlJ-TDEK.js +1 -0
- package/dist/client/assets/route-Cr42SuLO.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-BBDd5Vd6.js → sandbox-lifecycle-context-D9eDp86x.js} +1 -1
- package/dist/client/assets/{schema-cjQbFYEA.js → schema-Cd1llToh.js} +1 -1
- package/dist/client/assets/{schema-C2dfCTpF.js → schema-DzZBw0EW.js} +1 -1
- package/dist/client/assets/{scroll-area-DYvdRQ3X.js → scroll-area-CwuazZb5.js} +1 -1
- package/dist/client/assets/{search-input-DfJJHgak.js → search-input-D2iQ_3lu.js} +1 -1
- package/dist/client/assets/{search-toggle-K39LDgc3.js → search-toggle-Cw7hl_Xx.js} +1 -1
- package/dist/client/assets/{secret-picker-COEpc_Br.js → secret-picker-Ct1DoTR9.js} +1 -1
- package/dist/client/assets/{secrets-DpnxLirI.js → secrets-CBPyw7ba.js} +1 -1
- package/dist/client/assets/{section-array-field-cPwKvhUj.js → section-array-field-BXLl3jB0.js} +1 -1
- package/dist/client/assets/{sections-DQYOsFQr.js → sections-DRD1aU5D.js} +1 -1
- package/dist/client/assets/sections-editor-B628EbZ4.js +1 -0
- package/dist/client/assets/{select-Ce8n-RXJ.js → select-BMteQTWS.js} +1 -1
- package/dist/client/assets/{select-model-DrlCeL1J.js → select-model-ujDDmA_R.js} +1 -1
- package/dist/client/assets/seo-editor-nXgc_X38.js +1 -0
- package/dist/client/assets/{separator-CMPRlDqA.js → separator-l2LsOpLi.js} +1 -1
- package/dist/client/assets/settings-tab-Cj4D3Abl.js +1 -0
- package/dist/client/assets/{sheet-C1Iz_daC.js → sheet-BW-FxyJZ.js} +1 -1
- package/dist/client/assets/shell-layout-BbFvnpcf.js +1 -0
- package/dist/client/assets/{site-draft-actions-Cwq-m4rQ.js → site-draft-actions-9GNFURGo.js} +1 -1
- package/dist/client/assets/{site-draft-view-BGk8W1nm.js → site-draft-view-DhCorNAk.js} +2 -2
- package/dist/client/assets/site-editor-8rMP2pUf.js +1 -0
- package/dist/client/assets/{site-editor-toast-BZwEeugO.js → site-editor-toast-QHleRFN5.js} +1 -1
- package/dist/client/assets/skills-ApZ_uT4M.js +1 -0
- package/dist/client/assets/{slider-BRlhk1I_.js → slider-DtzvJZ1j.js} +1 -1
- package/dist/client/assets/{sortable.esm-DfWQuMf-.js → sortable.esm-DNzjY6xb.js} +1 -1
- package/dist/client/assets/{sso-Bl0_X14P.js → sso-Con6Y9JD.js} +1 -1
- package/dist/client/assets/{suggestion-C79o6bsf.js → suggestion-BgdlUdcB.js} +1 -1
- package/dist/client/assets/{switch-B5fLkk4G.js → switch-Bv0wLEBx.js} +1 -1
- package/dist/client/assets/{symbol-AaQxOm0Y.js → symbol-CJoI4vsX.js} +1 -1
- package/dist/client/assets/{synced-repos-Bes2Akem.js → synced-repos-Bdx0Lzti.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-X9RKDulT.js → tab-icon-glyph-CSlj-TVq.js} +1 -1
- package/dist/client/assets/{table-CR0vxly9.js → table-CheWM6KL.js} +1 -1
- package/dist/client/assets/{tabs-BeQ3GpBj.js → tabs-CjWwohzM.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-BxtkZ6j_.js → task-assignee-avatar-DwSiTsoy.js} +1 -1
- package/dist/client/assets/{task-board-DfACAZyY.js → task-board-L6ZGzY-s.js} +1 -1
- package/dist/client/assets/{task-route-CEMyrZwM.js → task-route-D7Tzzgt_.js} +1 -1
- package/dist/client/assets/{task-status-CwtxChqi.js → task-status-FHJjKh4u.js} +1 -1
- package/dist/client/assets/taskboard-analytics-kV8i_37N.js +1 -0
- package/dist/client/assets/{tasks-5giK8VZS.js → tasks-3fvPlwxK.js} +3 -3
- package/dist/client/assets/tasks-BImUOCfZ.js +1 -0
- package/dist/client/assets/{textarea-1B6eWYpg.js → textarea-BNvvIWSZ.js} +1 -1
- package/dist/client/assets/thread-analytics-DOn_63z0.js +1 -0
- package/dist/client/assets/{thread-intent-ptqgtSKo.js → thread-intent-DjvP3GsU.js} +1 -1
- package/dist/client/assets/thread-route-B3uNqVbb.js +1 -0
- package/dist/client/assets/{thread-route-CCN9I68_.js → thread-route-BOOkt7de.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Opalk3rB.js → thread-sheet-body-sjcfE700.js} +1 -1
- package/dist/client/assets/{time-range-picker-D-3pTVaL.js → time-range-picker-BostqQTB.js} +1 -1
- package/dist/client/assets/{toggle-group-DhjHoFhg.js → toggle-group-BAFBdL9F.js} +1 -1
- package/dist/client/assets/{tool-namespace-EPn7Kyb1.js → tool-namespace-CG1Oreso.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DOtu5VNi.js → toolbar-icon-button-CnXJyVJt.js} +1 -1
- package/dist/client/assets/{tooltip-DiW2ytsS.js → tooltip-D2ANqV2w.js} +1 -1
- package/dist/client/assets/{tooltipContext-Boh-kskS.js → tooltipContext-DvKfbID4.js} +1 -1
- package/dist/client/assets/{track-DDsr4-8X.js → track-BA-6upge.js} +1 -1
- package/dist/client/assets/{types-CAqly_33.js → types-BNmsSext.js} +1 -1
- package/dist/client/assets/{url-slug-BimzZyel.js → url-slug-DcB6_J0W.js} +1 -1
- package/dist/client/assets/{usage-stats-DyqnqVDM.js → usage-stats-I2nqy87E.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DGRaKYBP.js → use-ai-providers-BcLfhqAn.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-TltIMgYp.js → use-apply-named-rule-CdtINk0A.js} +1 -1
- package/dist/client/assets/{use-automations-DcNzV0FS.js → use-automations-DX8SlLEI.js} +1 -1
- package/dist/client/assets/{use-autosave-DQJxV1eg.js → use-autosave-c4cGzjJa.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-lg3L3DSm.js → use-chat-layout-state-CyqukwDV.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BXkjZk4h.js → use-clock-tick-CXtcWsca.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-Cg-2YJOJ.js → use-cms-publish-actions-BDOdjoX5.js} +1 -1
- package/dist/client/assets/{use-connect-companion-FMSyv7iG.js → use-connect-companion-pjD5dMZl.js} +1 -1
- package/dist/client/assets/{use-connection-DZPkoV0a.js → use-connection-CZNQu-z2.js} +1 -1
- package/dist/client/assets/{use-copy-Bb3ge3Jw.js → use-copy-Bq-mz0ld.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CFxxMtOW.js → use-create-virtual-mcp-BVwiobb2.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DTg1snyT.js → use-date-fns-locale-CLYhNSnw.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DKsafE_B.js → use-debounced-autosave-Cxe8yde_.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DBl2u8Ax.js → use-debounced-value-CqLWq6L2.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CHyZsaQg.js → use-deco-credits-C26dK60_.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-ChnGZu8F.js → use-decopilot-events-Dg011Qgn.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Txpqn3lI.js → use-delete-connection-DzeFDNj4.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Do6VU3ed.js → use-deployment-admin-COukxauw.js} +1 -1
- package/dist/client/assets/{use-entitlements-9vbVfq68.js → use-entitlements-Bxptpo8e.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CXQ7cT85.js → use-fast-preview-draft-url-DWrGmO4E.js} +1 -1
- package/dist/client/assets/{use-file-configs-Dn7YLM4Z.js → use-file-configs-DAoix9gu.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-BZyJNQXN.js → use-inbox-feed-CEHyMhUC.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CB0WyAlc.js → use-infinite-scroll-CojsIRJO.js} +1 -1
- package/dist/client/assets/{use-join-requests-CW_FogGu.js → use-join-requests-GMVGPaSk.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BtH_KnVM.js → use-main-panel-tabs-DXx3VvH2.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CKDFCOAa.js → use-mcp-auth-status-CvV54_ol.js} +1 -1
- package/dist/client/assets/{use-mcp-client-0e8NRgfT.js → use-mcp-client-zIBQco5Q.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-B2c7TGKV.js → use-mcp-prompts-XayY9yfQ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BWk4AICK.js → use-mcp-tools-BmZF8fTN.js} +1 -1
- package/dist/client/assets/{use-mobile-BJBInbLU.js → use-mobile-CoPLJ8cu.js} +1 -1
- package/dist/client/assets/{use-move-blocks-sjThA1Ew.js → use-move-blocks-Ck5rS_vn.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CpRnIp1k.js → use-navigate-to-agent-DqWY18b4.js} +1 -1
- package/dist/client/assets/{use-org-fs-B8r-1D4b.js → use-org-fs-B4wvUwJj.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-Dq0Qf-et.js → use-org-repo-syncs-D-0WnIj6.js} +1 -1
- package/dist/client/assets/{use-org-sso-DVHlBcmx.js → use-org-sso-sTi3oL5_.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DYmDerrq.js → use-organization-roles-DXXkhsvq.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CK8r9oqu.js → use-organization-settings-D_5fr-OI.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CnrhnUVG.js → use-panel-navigate-nriEb2Qz.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DnAEbSTa.js → use-project-native-view-presence-Bdl4n5BM.js} +1 -1
- package/dist/client/assets/{use-project-scope-LiKIXaiK.js → use-project-scope-CdqclLu1.js} +1 -1
- package/dist/client/assets/{use-recent-apps-Dbpw5TB5.js → use-recent-apps-6oU0G5sy.js} +1 -1
- package/dist/client/assets/{use-releases-ClTQL_RZ.js → use-releases-CjPNvHz7.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DVwMPgD_.js → use-reports-diagnostic-CbLn3JeW.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BAik2LAS.js → use-sandbox-events-C3mgE5Ut.js} +1 -1
- package/dist/client/assets/{use-secrets-ZlehcjzW.js → use-secrets-DMgYR7J2.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CLumQxEU.js → use-section-preview-base-CJSLbEeV.js} +1 -1
- package/dist/client/assets/{use-session-runtime-PX0UU1rX.js → use-session-runtime-HJpkQoy0.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-ByUss2bb.js → use-sidebar-collapsed-DGKLEITN.js} +1 -1
- package/dist/client/assets/{use-tags-CeuMPNMY.js → use-tags-C5S50qhF.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DzVWF5Q4.js → use-task-board-analytics-BhLHNvA-.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Cuq4HTGo.js → use-task-board-events-CWQQpnEy.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BZA4s0mM.js → use-task-board-item-prs-a7ezuDRL.js} +1 -1
- package/dist/client/assets/use-task-board-prompts-DonCfR5m.js +1 -0
- package/dist/client/assets/{use-task-metadata-De52Dfmg.js → use-task-metadata-MAOPH7xT.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-HQsRrHEt.js → use-thread-analytics-B2fKyMxQ.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BT4PyLKe.js → use-thread-outputs-vH0sJUqm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CFafSHXd.js +1 -0
- package/dist/client/assets/{useQueries-nk-gppMK.js → useQueries-Qve4MUYw.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D_oVQ9bL.js +1 -0
- package/dist/client/assets/{users-CLgvJMnS.js → users-DHtbHEKw.js} +1 -1
- package/dist/client/assets/{utils-BDRBqTP5.js → utils-BoR7m7ir.js} +1 -1
- package/dist/client/assets/variant-calendar-DSZCP6Sl.js +1 -0
- package/dist/client/assets/{variant-matcher-override-D6IszGLS.js → variant-matcher-override-Cvh79vYa.js} +1 -1
- package/dist/client/assets/{view-header-Ce7a2voT.js → view-header-DTW0kjf6.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C5JzNRIg.js → virtual-mcp-RiqyMxQd.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CBQ2__fw.js → watch-sse-pool-6veZzsu7.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-BEKl1X8N.js +0 -2
- package/dist/client/assets/agent-app-8j-E-hT5.js +0 -1
- package/dist/client/assets/agent-assets-DQ6hVD8p.js +0 -1
- package/dist/client/assets/agent-automations-DzkmpBZa.js +0 -1
- package/dist/client/assets/agent-calendar-BC2tVvZL.js +0 -1
- package/dist/client/assets/agent-connect-sources-Dh7wTbNs.js +0 -1
- package/dist/client/assets/agent-deck-07no_3NQ.js +0 -1
- package/dist/client/assets/agent-e2e-Ds3Fe2AE.js +0 -1
- package/dist/client/assets/agent-experiments-DofmmJcd.js +0 -1
- package/dist/client/assets/agent-file-6W_Gnaal.js +0 -1
- package/dist/client/assets/agent-hosting-vZ66b5t2.js +0 -1
- package/dist/client/assets/agent-icon-Co7E9kYl.js +0 -1
- package/dist/client/assets/agent-library-R2xLquH1.js +0 -1
- package/dist/client/assets/agent-library-file-BXlKOL8M.js +0 -1
- package/dist/client/assets/agent-monitor-BoyNxcz1.js +0 -1
- package/dist/client/assets/agent-overview-CSwJW27z.js +0 -1
- package/dist/client/assets/agent-settings-BGDVCihC.js +0 -1
- package/dist/client/assets/agent-site-editor-code-FDZ6QYUh.js +0 -2
- package/dist/client/assets/agent-site-editor-content-kP1qC2rB.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DmkFZKpC.js +0 -1
- package/dist/client/assets/agent-view-CH596Gq0.js +0 -1
- package/dist/client/assets/agents-list-CBfEPAhK.js +0 -1
- package/dist/client/assets/api-keys-9pHr3QlX.js +0 -1
- package/dist/client/assets/app-editor-BVC0eWvP.js +0 -1
- package/dist/client/assets/automation-list-row-BvcdSOir.js +0 -1
- package/dist/client/assets/automations-C2DGayAE.js +0 -1
- package/dist/client/assets/category-editor-BaE2uAd6.js +0 -1
- package/dist/client/assets/choose-editor-C2L8nFMF.js +0 -1
- package/dist/client/assets/cms-settings-editor-DTAdiNDN.js +0 -1
- package/dist/client/assets/collection-detail-tC_GRfYF.js +0 -1
- package/dist/client/assets/column-rules-C63NCpq3.js +0 -3
- package/dist/client/assets/connection-detail-C98bDTVH.js +0 -1
- package/dist/client/assets/connections-C6M8AgjO.js +0 -1
- package/dist/client/assets/context-CPd4zSV0.js +0 -1
- package/dist/client/assets/discover-COhVLrYW.js +0 -1
- package/dist/client/assets/file-explorer-Bd3gIXGV.js +0 -2
- package/dist/client/assets/folder-icon-rxpoDvAE.js +0 -1
- package/dist/client/assets/home-DGMtvNuq.js +0 -1
- package/dist/client/assets/index-By_-wb1N.css +0 -1
- package/dist/client/assets/library-CdfdY0qf.js +0 -1
- package/dist/client/assets/mock-board-piOcYIBD.js +0 -81
- package/dist/client/assets/monitoring-3dbLT4OM.js +0 -1
- package/dist/client/assets/openai-conversation-DGR8tfoH.js +0 -3
- package/dist/client/assets/plan-CKUD-2iO.js +0 -1
- package/dist/client/assets/post-calendar-DkrNCJu_.js +0 -1
- package/dist/client/assets/project-app-view-Cf1gd22p.js +0 -1
- package/dist/client/assets/project-apps-X2VfH52k.js +0 -1
- package/dist/client/assets/project-reports-BVlytfOe.js +0 -1
- package/dist/client/assets/project-tasks-BGW3O_F5.js +0 -1
- package/dist/client/assets/projects-oKJE7kAY.js +0 -1
- package/dist/client/assets/record-editor-BOGjSPiY.js +0 -1
- package/dist/client/assets/redirect-editor-DxMUngFX.js +0 -1
- package/dist/client/assets/reports-N81wb4Wq.js +0 -1
- package/dist/client/assets/reports-onboarding-CljQnv9P.js +0 -1
- package/dist/client/assets/reports-tab-CSx5fOj6.js +0 -2
- package/dist/client/assets/repositories-DL-11--e.js +0 -1
- package/dist/client/assets/roles-Brhhqsw3.js +0 -1
- package/dist/client/assets/route-BmSXOav-.js +0 -1
- package/dist/client/assets/route-C51vZk3q.js +0 -1
- package/dist/client/assets/route-D_u0Bw_R.js +0 -1
- package/dist/client/assets/sections-editor-p5iYgj5l.js +0 -1
- package/dist/client/assets/seo-editor-BtHI4gWU.js +0 -1
- package/dist/client/assets/settings-tab-qkoZ5Hhk.js +0 -1
- package/dist/client/assets/shell-layout-DUwEP5qi.js +0 -1
- package/dist/client/assets/site-editor-DBH3tuRQ.js +0 -1
- package/dist/client/assets/skills-CmU0q2d6.js +0 -1
- package/dist/client/assets/taskboard-analytics-nTEghmrx.js +0 -1
- package/dist/client/assets/tasks-sE4UNYKk.js +0 -1
- package/dist/client/assets/thread-analytics-DRVZv6bu.js +0 -1
- package/dist/client/assets/thread-route-BnB8pcK6.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ChletbBT.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BJjYTjXx.js +0 -1
- package/dist/client/assets/variant-calendar-DOQE-pkF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as M,j as t,V as Ht,n as Oe,b5 as Pl,Y as Kt,b6 as Dl,Z as qt,b as ce,bB as ve,v as nt,D as rt,a4 as _e,q as Gt,r as G,x as at,B as ie,hi as Ol,b7 as Ft,l as ne,I as Ye,K as he,t as oe,X as Ge,m as $l,hj as ft,b4 as Tl,o as Fl,d as zl,u as El,b8 as Ml,P as zt,h1 as Bl,w as Et,aY as Mt,y as Bt,aS as Al,aR as Ll,aO as Il,aM as Vl,aN as Rl,aQ as Ul,aP as _l,bm as Hl,g3 as Kl}from"./index-
|
|
1
|
+
import{c as M,j as t,V as Ht,n as Oe,b5 as Pl,Y as Kt,b6 as Dl,Z as qt,b as ce,bB as ve,v as nt,D as rt,a4 as _e,q as Gt,r as G,x as at,B as ie,hi as Ol,b7 as Ft,l as ne,I as Ye,K as he,t as oe,X as Ge,m as $l,hj as ft,b4 as Tl,o as Fl,d as zl,u as El,b8 as Ml,P as zt,h1 as Bl,w as Et,aY as Mt,y as Bt,aS as Al,aR as Ll,aO as Il,aM as Vl,aN as Rl,aQ as Ul,aP as _l,bm as Hl,g3 as Kl}from"./index-BWpKrclg.js";import{s as ql}from"./Image01-CaawlkVR.js";import{s as At}from"./Plus-Ccck99Do.js";import{i as Qe}from"./Upload01-D_q00M49.js";import{u as Gl}from"./use-mobile-CoPLJ8cu.js";import{I as Ql}from"./icon-button-CTmBGRaQ.js";import{S as Yl}from"./search-input-D2iQ_3lu.js";import{S as Xl}from"./search-toggle-Cw7hl_Xx.js";import{H as be,P as Le,b as re,p as it,n as Qt,f as Ie,g as ge,i as Wl,h as Jl,s as Xe,j as Yt,k as pt,l as Zl,m as es}from"./location-V0VwTJTt.js";import{O as ts,P as ls}from"./chat-context-kqrW-XPR.js";import{u as ss}from"./use-debounced-value-CqLWq6L2.js";import{q as Xt,h as Se,k as He,d as ns,j as ot,u as Ze,r as rs,s as as,o as Wt}from"./use-org-fs-B4wvUwJj.js";import{t as Jt,n as is}from"./ChevronUp-xR4eZngE.js";import{u as os,a as cs}from"./use-org-repo-syncs-D-0WnIj6.js";import{T as ds}from"./textarea-BNvvIWSZ.js";import{ag as Ve,bt as us,b as fs,l as mt,b3 as ps,bu as ms,A as hs}from"./agent-icon-nQ1AH9dU.js";import{M as bs,g as xs}from"./markdown-CkZaCBow.js";import{f as ys,b as gs,g as vs,u as js,e as ws}from"./context-shell-BwT70eIn.js";import{S as ks}from"./file-share-button-DOup2WzD.js";import{L as Zt}from"./preview-dialog-DBnDC8gE.js";import{F as et,S as el}from"./folder-icon-DY3kBxQc.js";import{e as Ss}from"./repository-binding-Bpq6heaQ.js";import{i as Ns,c as Cs}from"./SwitchHorizontal01-Ce37vA9c.js";import{i as ht}from"./Zap-CHuT8W6R.js";import{E as tl}from"./empty-state-iEpXVBwd.js";import{T as Lt,a as Ps}from"./toggle-group-BAFBdL9F.js";import{F as bt,d as Ds}from"./file-type-icon-BgzyV542.js";import{i as Os}from"./DotsVertical-CncVW4wJ.js";import{n as $s}from"./ZoomOut-CBOWQYet.js";import{i as Ts}from"./Key01-FaGRi3tG.js";import{s as Fs}from"./Trash01-BQBP0tUM.js";import{n as zs,i as Es}from"./ArrowUp-DpQ-09y4.js";import{c as Pe,b as ll,T as De,a as Ms,d as Bs,e as As}from"./table-CheWM6KL.js";import{s as Ls}from"./use-project-scope-CdqclLu1.js";import{a as Is}from"./use-panel-navigate-nriEb2Qz.js";const Vs=new Set(["pdf","doc","docx","odt","rtf","txt","md","markdown","xls","xlsx","ods","csv","tsv","ppt","pptx","odp","key","pages","numbers","html","htm","epub"]),Rs=new Set(["png","jpg","jpeg","gif","webp","svg","avif","bmp","tif","tiff","ico","heic","heif","mp4","webm","mov","m4v","avi","mkv","mp3","wav","ogg","oga","m4a","aac","flac"]);function ct(i,e){if(e==="all")return!0;const l=i.slice(i.lastIndexOf("/")+1),s=l.lastIndexOf(".");if(s<=0)return!1;const a=l.slice(s+1).toLowerCase();return(e==="media"?Rs:Vs).has(a)}const Us=["any","today","week","month"],_s={today:1,week:7,month:30};function Hs(i,e,l=Date.now()){if(e==="any")return!0;const s=Date.parse(i);return Number.isNaN(s)?!1:l-s<=_s[e]*24*60*60*1e3}function It(i){const e=M.c(16),{label:l,value:s,options:a,active:r,onChange:n}=i;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Jt,{size:14}),e[0]=o):o=e[0];let c;e[1]!==r||e[2]!==l?(c=t.jsx(Ht,{asChild:!0,children:t.jsxs(Oe.Tab,{active:r,children:[l,o]})}),e[1]=r,e[2]=l,e[3]=c):c=e[3];let d;e[4]!==n||e[5]!==a?(d=m=>{const y=a.find(x=>x.value===m);y&&n(y.value)},e[4]=n,e[5]=a,e[6]=d):d=e[6];let p;e[7]!==a?(p=a.map(Ks),e[7]=a,e[8]=p):p=e[8];let u;e[9]!==d||e[10]!==p||e[11]!==s?(u=t.jsx(Kt,{align:"start",children:t.jsx(Dl,{value:s,onValueChange:d,children:p})}),e[9]=d,e[10]=p,e[11]=s,e[12]=u):u=e[12];let f;return e[13]!==c||e[14]!==u?(f=t.jsxs(qt,{children:[c,u]}),e[13]=c,e[14]=u,e[15]=f):f=e[15],f}function Ks(i){return t.jsx(Pl,{value:i.value,children:i.label},i.value)}function qs(i){const e=M.c(28),l=ce(),s=os(),a=Xt();if(i!==be){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0],x}let r;e[1]!==l?(r=l("library.library.all"),e[1]=l,e[2]=r):r=e[2];let n;e[3]!==i||e[4]!==r?(n={key:"all",label:r,path:i},e[3]=i,e[4]=r,e[5]=n):n=e[5];let o;e[6]!==l?(o=l("library.library.placeProjects"),e[6]=l,e[7]=o):o=e[7];let c;e[8]!==o?(c={key:Le,label:o,path:`${be}/${Le}`},e[8]=o,e[9]=c):c=e[9];let d;e[10]!==l?(d=l("library.library.placeUploads"),e[10]=l,e[11]=d):d=e[11];let p;e[12]!==d?(p={key:"uploads",label:d,path:"uploads"},e[12]=d,e[13]=p):p=e[13];let u;e[14]!==l?(u=l("library.library.placeOutputs"),e[14]=l,e[15]=u):u=e[15];let f;e[16]!==u?(f={key:"outputs",label:u,path:"outputs"},e[16]=u,e[17]=f):f=e[17];let m;e[18]!==a.data?.length||e[19]!==l?(m=(a.data?.length??0)>0?[{key:"public",label:l("library.library.placeSkills"),path:"public"}]:[],e[18]=a.data?.length,e[19]=l,e[20]=m):m=e[20];let y;return e[21]!==s.data||e[22]!==n||e[23]!==c||e[24]!==p||e[25]!==f||e[26]!==m?(y=[n,c,p,f,...m,...(s.data??[]).map(Gs)],e[21]=s.data,e[22]=n,e[23]=c,e[24]=p,e[25]=f,e[26]=m,e[27]=y):y=e[27],y}function Gs(i){return{key:i.volume,label:i.volume,path:i.volume}}function Qs(i){return i.kind==="file"?"file":i.hasSkill?"skill":i.hasBrand?"brand":"folder"}function Be(i){return{kind:Qs(i),path:i.path,name:re(i.path),updatedAt:i.updatedAt,size:i.size??0,entry:i}}const Ys=["name","updated","size"];function Vt(i){return i.kind==="file"?1:0}function We(i,e){const l=(s,a)=>s.name.localeCompare(a.name,void 0,{numeric:!0,sensitivity:"base"});return[...i].sort((s,a)=>{const r=Vt(s)-Vt(a);if(r!==0)return r;if(e==="updated"){const n=(a.updatedAt??"").localeCompare(s.updatedAt??"");if(n!==0)return n}if(e==="size"){const n=a.size-s.size;if(n!==0)return n}return l(s,a)})}function Xs(i){if(i.kind!=="file")return null;const e=i.size;if(!e)return null;const l=["B","KB","MB","GB","TB"];let s=e,a=0;for(;s>=1024&&a<l.length-1;)s/=1024,a++;return`${s>=10||a===0?Math.round(s):s.toFixed(1)} ${l[a]}`}function Ws(i){const e=i("library.brandComponentsPreview.title"),l=i("library.brandComponentsPreview.subtitle"),s=i("library.brandComponentsPreview.monthlySavingsLabel"),a=i("library.brandComponentsPreview.primaryButton"),r=i("library.brandComponentsPreview.secondaryButton"),n=i("library.brandComponentsPreview.ghostButton"),o=i("library.brandComponentsPreview.successBadge"),c=i("library.brandComponentsPreview.warningBadge"),d=i("library.brandComponentsPreview.errorBadge"),p=i("library.brandComponentsPreview.infoBadge"),u=i("library.brandComponentsPreview.allChip"),f=i("library.brandComponentsPreview.incomeChip"),m=i("library.brandComponentsPreview.spendingChip"),y=i("library.brandComponentsPreview.emailPlaceholder");return`
|
|
2
2
|
<div class="stack">
|
|
3
3
|
<div>
|
|
4
4
|
<h1>${e}</h1>
|
|
@@ -158,5 +158,5 @@ import{c as M,j as t,V as Ht,n as Oe,b5 as Pl,Y as Kt,b6 as Dl,Z as qt,b as ce,b
|
|
|
158
158
|
<p class="cta">slides-create --theme …</p>
|
|
159
159
|
</section>`].join(`
|
|
160
160
|
|
|
161
|
-
`);function sn(i,e){const l=e?`<style>${e}</style>`:"";return i.replaceAll("{{{slides}}}",ln).replaceAll("{{title}}",tn).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${l}</head>`)}function nn(i){const e=M.c(8),{readUrl:l,title:s,tokensUrl:a}=i,r=Se(l),n=Se(a??"");if(r.isPending||a&&n.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(ve,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[0]=p):p=e[0],p}if(r.isError||!r.data){let p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[1]=p):p=e[1],p}const o=n.data??null;let c;e[2]!==o||e[3]!==r.data?(c=sn(r.data,o),e[2]=o,e[3]=r.data,e[4]=c):c=e[4];let d;return e[5]!==c||e[6]!==s?(d=t.jsx("iframe",{title:s,srcDoc:c,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[5]=c,e[6]=s,e[7]=d):d=e[7],d}function Me(i){const e=M.c(2),{children:l}=i;let s;return e[0]!==l?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:l}),e[0]=l,e[1]=s):s=e[1],s}function rn(i){const e=M.c(16),{family:l,tokens:s,editing:a,valueOf:r,onEdit:n}=i;let o;e[0]!==l?(o=t.jsx("span",{className:"text-xs text-muted-foreground",children:l}),e[0]=l,e[1]=o):o=e[1];let c;if(e[2]!==a||e[3]!==n||e[4]!==s||e[5]!==r){let u;e[7]!==a||e[8]!==n||e[9]!==r?(u=f=>{const m=r(f),y=`${f.name.replace(/^--brand-/,"")}: ${m}`;return a&&/^#/.test(m)?t.jsx("input",{type:"color","aria-label":f.name,title:y,value:ws(m),onChange:x=>n(f.name,x.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},f.name):t.jsx("span",{title:y,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:m}},f.name)},e[7]=a,e[8]=n,e[9]=r,e[10]=u):u=e[10],c=s.map(u),e[2]=a,e[3]=n,e[4]=s,e[5]=r,e[6]=c}else c=e[6];let d;e[11]!==c?(d=t.jsx("div",{className:"flex flex-wrap gap-1",children:c}),e[11]=c,e[12]=d):d=e[12];let p;return e[13]!==o||e[14]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[o,d]}),e[13]=o,e[14]=d,e[15]=p):p=e[15],p}function an(i){const e=M.c(9),{token:l,value:s}=i;if(l.kind==="space"){let r;return e[0]!==s?(r=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:s,maxWidth:"100%"}})}),e[0]=s,e[1]=r):r=e[1],r}if(l.kind==="radius"){let r;return e[2]!==s?(r=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:s}}),e[2]=s,e[3]=r):r=e[3],r}if(l.kind==="shadow"){let r;return e[4]!==s?(r=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:s}}),e[4]=s,e[5]=r):r=e[5],r}if(l.kind==="type"&&/^--brand-text-/.test(l.name)){const r=`min(${s}, 22px)`;let n;return e[6]!==r?(n=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:r},children:"Ag"}),e[6]=r,e[7]=n):n=e[7],n}let a;return e[8]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=a):a=e[8],a}function sl(i){const e=M.c(17),{token:l,value:s,editing:a,onEdit:r}=i;let n;e[0]!==l||e[1]!==s?(n=t.jsx(an,{token:l,value:s}),e[0]=l,e[1]=s,e[2]=n):n=e[2];let o;if(e[3]!==l.name){let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=/^--brand-/,e[5]=u):u=e[5],o=l.name.replace(u,""),e[3]=l.name,e[4]=o}else o=e[4];let c;e[6]!==o?(c=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let d;e[8]!==a||e[9]!==r||e[10]!==l.name||e[11]!==s?(d=a?t.jsx(Ye,{value:s,onChange:u=>r(l.name,u.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:s}),e[8]=a,e[9]=r,e[10]=l.name,e[11]=s,e[12]=d):d=e[12];let p;return e[13]!==n||e[14]!==c||e[15]!==d?(p=t.jsxs("div",{className:"flex items-center gap-3",children:[n,c,d]}),e[13]=n,e[14]=c,e[15]=d,e[16]=p):p=e[16],p}function Fe(i){const e=M.c(16),{label:l,tokens:s,editing:a,valueOf:r,onEdit:n}=i;if(s.length===0)return null;let o;e[0]!==l?(o=t.jsx(Me,{children:l}),e[0]=l,e[1]=o):o=e[1];let c;if(e[2]!==a||e[3]!==n||e[4]!==s||e[5]!==r){let u;e[7]!==a||e[8]!==n||e[9]!==r?(u=f=>t.jsx(sl,{token:f,value:r(f),editing:a,onEdit:n},f.name),e[7]=a,e[8]=n,e[9]=r,e[10]=u):u=e[10],c=s.map(u),e[2]=a,e[3]=n,e[4]=s,e[5]=r,e[6]=c}else c=e[6];let d;e[11]!==c?(d=t.jsx("div",{className:"flex flex-col gap-2.5",children:c}),e[11]=c,e[12]=d):d=e[12];let p;return e[13]!==o||e[14]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-3",children:[o,d]}),e[13]=o,e[14]=d,e[15]=p):p=e[15],p}function on({brandPath:i,onClose:e,variant:l}){const s=ce(),{org:a}=_e(),r=it(i),n=r.volume??"",o=r.dirPath,c=re(o),d=r.readOnly,p=Gt(),u=He(),f=ns(n),{upload:m,remove:y}=ot(n),x=G.useRef(null),S=Ze(n,o),k=S.data??[],v=C=>k.some(ee=>ee.kind==="file"&&re(ee.path)===C),N=v("tokens.css"),D=v("brand.md"),j=v("slides-theme.html"),O=ys(k),w=u(n,`${o}/tokens.css`),I=u(n,`${o}/brand.md`),g=u(n,`${o}/slides-theme.html`),$=Se(w,{enabled:N}),R=Se(I,{enabled:D}),[F,B]=G.useState(!1),[z,A]=G.useState({}),[E,U]=G.useState(null),[P,V]=G.useState(!1),[T,L]=G.useState(!1),[X,W]=G.useState("deck"),_=$.data?gs($.data):[],q=C=>_.find(ee=>ee.name===C)?.value,H=C=>z[C.name]??C.value,J=vs(_),Y=_.filter(C=>C.kind==="font"),te=_.filter(C=>C.kind==="type"),se=_.filter(C=>C.kind==="space"),pe=_.filter(C=>C.kind==="radius"),ke=_.filter(C=>C.kind==="shadow"),je=_.filter(C=>C.kind==="motion"),xe=_.filter(C=>C.kind==="other"),le=(C,ee)=>A(Ce=>({...Ce,[C]:ee})),me=j&&X==="deck",b=E??R.data??"",K=Object.entries(z).filter(([C,ee])=>q(C)!==ee),Z=E!==null&&E!==(R.data??""),ae=K.length>0||Z;function de(){A({}),U(null),B(!1)}async function ue(){V(!0);try{if(K.length>0){let C=$.data??"";for(const[ee,Ce]of K)C=js(C,ee,Ce);await f.mutateAsync({path:`${o}/tokens.css`,body:C,contentType:"text/css; charset=utf-8"}),p.invalidateQueries({queryKey:he.fileText(w)})}Z&&E!==null&&(await f.mutateAsync({path:`${o}/brand.md`,body:E,contentType:"text/markdown; charset=utf-8"}),p.invalidateQueries({queryKey:he.fileText(I)})),p.invalidateQueries({queryKey:he.orgFsVolume(a.id,n)}),p.invalidateQueries({queryKey:he.orgFsRecent(a.id)}),A({}),U(null),B(!1),oe.success(s("library.brandPreview.brandSaved"))}catch(C){oe.error(C instanceof Error?C.message:s("library.brandPreview.failedSaveBrand"))}finally{V(!1)}}async function ye(C){const ee=C?.[0];if(!ee)return;const $e=`logo.${(ee.name.split(".").pop()??"png").toLowerCase()}`;try{await m.mutateAsync({dir:o,files:[new File([ee],$e,{type:ee.type})]}),O&&re(O)!==$e&&await y.mutateAsync(O),oe.success(s("library.brandPreview.logoUpdated"))}catch(Te){oe.error(Te instanceof Error?Te.message:s("library.brandPreview.logoUploadFailed"))}finally{x.current&&(x.current.value="")}}const Ne=!S.isPending&&!N&&!D&&!O;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Ve,{size:18})}),l==="dialog"?t.jsx(at,{className:"flex-1 truncate text-base font-medium text-foreground",children:c}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:c}),!d&&(F?t.jsxs(t.Fragment,{children:[t.jsx(ie,{variant:"ghost",size:"sm",onClick:de,disabled:P,children:s("library.brandPreview.cancel")}),t.jsx(ie,{size:"sm",disabled:!ae||P,onClick:()=>{ue()},children:s(P?"library.brandPreview.saving":"library.brandPreview.save")})]}):t.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>B(!0),children:[t.jsx(us,{size:14}),s("library.brandPreview.edit")]})),l==="dialog"?t.jsx(Ol,{asChild:!0,children:t.jsx(ie,{variant:"ghost",size:"icon",className:"shrink-0",children:t.jsx(Ft,{size:16})})}):t.jsx(ie,{variant:"ghost",size:"icon",className:"shrink-0",onClick:e,children:t.jsx(Ft,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(ve,{className:"h-40 w-full rounded-xl"}),t.jsx(ve,{className:"h-4 w-1/3"}),t.jsx(ve,{className:"h-4 w-2/3"})]}):Ne?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:s("library.brandPreview.brandNotAvailable")}):t.jsxs(t.Fragment,{children:[(j||N)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":s(T?"library.brandPreview.showPreview":"library.brandPreview.hidePreview"),onClick:()=>L(C=>!C),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),L(ee=>!ee))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-accent",children:[t.jsxs("div",{className:"surface-inset flex gap-0.5 p-0.5 text-xs font-medium",onClick:C=>C.stopPropagation(),children:[j&&t.jsx("button",{type:"button",onClick:()=>{W("deck"),L(!1)},className:ne("rounded-lg px-2.5 py-1",me?"bg-background text-foreground shadow-edge":"text-muted-foreground hover:text-foreground"),children:s("library.brandPreview.deck")}),t.jsx("button",{type:"button",onClick:()=>{W("components"),L(!1)},className:ne("rounded-lg px-2.5 py-1",me?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-edge"),children:s("library.brandPreview.components")})]}),T?t.jsx(Jt,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(is,{size:16,className:"shrink-0 text-muted-foreground"})]}),!T&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:ne("w-full overflow-hidden rounded-xl border border-border bg-muted/30",me?"aspect-[16/9]":"h-96"),children:me?t.jsx(nn,{readUrl:g,title:`${c} deck theme`,tokensUrl:w}):t.jsx(en,{tokensUrl:w})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Me,{children:s("library.brandPreview.logo")}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:O?t.jsx("img",{src:u(n,O),alt:`${c} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(Ve,{size:28,className:"text-muted-foreground/50"})}),F&&t.jsxs("div",{children:[t.jsxs(ie,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>x.current?.click(),children:[t.jsx(Qe,{size:14}),s(O?"library.brandPreview.replaceLogo":"library.brandPreview.addLogo")]}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:C=>{ye(C.target.files)}})]})]})]}),J.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Me,{children:s("library.brandPreview.colors")}),J.map(C=>t.jsx(rn,{family:C.family,tokens:C.tokens,editing:F,valueOf:H,onEdit:le},C.family))]}),(Y.length>0||te.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Me,{children:s("library.brandPreview.typography")}),Y.map(C=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:C.name.replace(/^--brand-font-?/,"")||s("library.brandPreview.defaultFont")}),F?t.jsx(Ye,{value:H(C),onChange:ee=>le(C.name,ee.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:H(C)},children:H(C)})]},C.name)),te.map(C=>t.jsx(sl,{token:C,value:H(C),editing:F,onEdit:le},C.name))]}),t.jsx(Fe,{label:s("library.brandPreview.spacing"),tokens:se,editing:F,valueOf:H,onEdit:le}),t.jsx(Fe,{label:s("library.brandPreview.radius"),tokens:pe,editing:F,valueOf:H,onEdit:le}),t.jsx(Fe,{label:s("library.brandPreview.shadows"),tokens:ke,editing:F,valueOf:H,onEdit:le}),t.jsx(Fe,{label:s("library.brandPreview.motion"),tokens:je,editing:F,valueOf:H,onEdit:le}),t.jsx(Fe,{label:s("library.brandPreview.tokens"),tokens:xe,editing:F,valueOf:H,onEdit:le}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Me,{children:s("library.brandPreview.voiceGuidelines")}),F?t.jsx(ds,{value:b,onChange:C=>U(C.target.value),placeholder:s("library.brandPreview.voicePlaceholder"),className:"min-h-48 font-mono text-sm"}):R.isPending&&D?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(ve,{className:"h-3 w-full"}),t.jsx(ve,{className:"h-3 w-5/6"})]}):b.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(bs,{id:`brand-preview-${i}`,text:b})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:s("library.brandPreview.noVoiceYet")})]})]})]})})]})}function nl(i){const e=M.c(8),{brandPath:l,onClose:s}=i;let a;e[0]!==s?(a=o=>{o||s()},e[0]=s,e[1]=a):a=e[1];let r;e[2]!==l||e[3]!==s?(r=t.jsx(nt,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(on,{brandPath:l,onClose:s,variant:"dialog"})}),e[2]=l,e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=t.jsx(rt,{open:!0,onOpenChange:a,children:r}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}const cn=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),dn=new Set(["csv","tsv"]),un=new Set(["mp4","webm","mov","m4v"]),fn=new Set(["txt","json","log","yaml","yml","xml"]),Rt=256*1024;function pn(i){return i.split(".").pop()?.toLowerCase()??""}async function mn(i,e){const l=await fetch(i,{credentials:"include",...e});if(!l.ok)throw new Error(`fetch failed: ${l.status}`);return l.text()}function hn(i){const e=M.c(6),{onShare:l,t:s}=i;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ps,{size:14}),e[0]=a):a=e[0];let r;e[1]!==s?(r=s("library.cards.share"),e[1]=s,e[2]=r):r=e[2];let n;return e[3]!==l||e[4]!==r?(n=t.jsxs(Ge,{onClick:l,children:[a,r]}),e[3]=l,e[4]=r,e[5]=n):n=e[5],n}function Je(i){const e=M.c(12),{state:l,t:s}=i;let a;e[0]!==l||e[1]!==s?(a=s(l==="password"?"library.cards.passwordProtected":l==="inherited"?"library.cards.sharedViaParent":"library.cards.publicBadge"),e[0]=l,e[1]=s,e[2]=a):a=e[2];const r=a,n=l==="password"?Ts:fs,o=l==="inherited"?"text-muted-foreground/60":"text-primary";let c;e[3]!==o?(c=ne(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==n||e[6]!==r||e[7]!==c?(d=t.jsx(n,{size:12,className:c,"aria-label":r}),e[5]=n,e[6]=r,e[7]=c,e[8]=d):d=e[8];let p;return e[9]!==r||e[10]!==d?(p=t.jsx("span",{title:r,className:"mt-0.5 flex shrink-0 items-center",children:d}),e[9]=r,e[10]=d,e[11]=p):p=e[11],p}function xt(i){const e=M.c(26),{label:l,onBrowse:s,onShare:a,download:r,onDelete:n,t:o}=i;if(!s&&!a&&!r&&!n)return;let c;e[0]!==l||e[1]!==o?(c=o("library.cards.actionsFor",{label:l}),e[0]=l,e[1]=o,e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx($s,{size:14}),e[3]=d):d=e[3];let p;e[4]!==c?(p=t.jsx(Ht,{asChild:!0,children:t.jsx(ie,{variant:"ghost",size:"icon-xs",className:"shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:xn,"aria-label":c,children:d})}),e[4]=c,e[5]=p):p=e[5];let u;e[6]!==s||e[7]!==o?(u=s&&t.jsxs(Ge,{onClick:s,children:[t.jsx(mt,{size:14}),o("library.cards.browseFiles")]}),e[6]=s,e[7]=o,e[8]=u):u=e[8];let f;e[9]!==a||e[10]!==o?(f=a&&t.jsx(hn,{onShare:a,t:o}),e[9]=a,e[10]=o,e[11]=f):f=e[11];let m;e[12]!==r||e[13]!==o?(m=r&&t.jsx(Ge,{asChild:!0,children:t.jsxs("a",{href:r.url,download:r.filename,children:[t.jsx(Ps,{size:14}),o("library.cards.download")]})}),e[12]=r,e[13]=o,e[14]=m):m=e[14];let y;e[15]!==n||e[16]!==o?(y=n&&t.jsxs(Ge,{variant:"destructive",onClick:n,children:[t.jsx(Fs,{size:14}),o("library.cards.delete")]}),e[15]=n,e[16]=o,e[17]=y):y=e[17];let x;e[18]!==u||e[19]!==f||e[20]!==m||e[21]!==y?(x=t.jsxs(Kt,{align:"end",onClick:bn,children:[u,f,m,y]}),e[18]=u,e[19]=f,e[20]=m,e[21]=y,e[22]=x):x=e[22];let S;return e[23]!==p||e[24]!==x?(S=t.jsxs(qt,{children:[p,x]}),e[23]=p,e[24]=x,e[25]=S):S=e[25],S}function bn(i){return i.stopPropagation()}function xn(i){return i.stopPropagation()}function rl(i){const e=M.c(44),{size:l,filename:s,downloadUrl:a,subtitle:r,publicState:n,selected:o,compact:c,onOpen:d,onShare:p,onDelete:u,draggable:f,onDragStart:m,onContextMenu:y}=i,x=l===void 0?0:l,S=o===void 0?!1:o,k=c===void 0?!1:c,v=ce();let N;e[0]!==d?(N=A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),d())},e[0]=d,e[1]=N):N=e[1];let D;e[2]!==k||e[3]!==a||e[4]!==s||e[5]!==x?(D=t.jsx(Nn,{filename:s,size:x,downloadUrl:a,compact:k}),e[2]=k,e[3]=a,e[4]=s,e[5]=x,e[6]=D):D=e[6];let j;e[7]!==s?(j=t.jsx(bt,{filename:s,className:"h-5 w-4 shrink-0"}),e[7]=s,e[8]=j):j=e[8];let O;e[9]!==s?(O=t.jsx("span",{className:"truncate text-sm font-medium text-foreground",title:s,children:s}),e[9]=s,e[10]=O):O=e[10];let w;e[11]!==n||e[12]!==v?(w=n&&t.jsx(Je,{state:n,t:v}),e[11]=n,e[12]=v,e[13]=w):w=e[13];let I;e[14]!==O||e[15]!==w?(I=t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[O,w]}),e[14]=O,e[15]=w,e[16]=I):I=e[16];let g;e[17]!==r?(g=t.jsx("span",{className:"text-meta truncate",title:r,children:r}),e[17]=r,e[18]=g):g=e[18];let $;e[19]!==g||e[20]!==I?($=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[I,g]}),e[19]=g,e[20]=I,e[21]=$):$=e[21];let R;e[22]!==a||e[23]!==s?(R={url:a,filename:s},e[22]=a,e[23]=s,e[24]=R):R=e[24];let F;e[25]!==s||e[26]!==u||e[27]!==p||e[28]!==v||e[29]!==R?(F=t.jsx(xt,{label:s,download:R,onShare:p,onDelete:u,t:v}),e[25]=s,e[26]=u,e[27]=p,e[28]=v,e[29]=R,e[30]=F):F=e[30];let B;e[31]!==$||e[32]!==F||e[33]!==j?(B=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 pl-1.5",children:[j,$,F]}),e[31]=$,e[32]=F,e[33]=j,e[34]=B):B=e[34];let z;return e[35]!==f||e[36]!==y||e[37]!==m||e[38]!==d||e[39]!==S||e[40]!==B||e[41]!==N||e[42]!==D?(z=t.jsxs("div",{role:"button",tabIndex:0,"aria-pressed":S,draggable:f,onClick:d,onKeyDown:N,onDragStart:m,onContextMenu:y,className:"group/card surface surface-interactive focus-ring flex min-w-0 cursor-pointer flex-col gap-2.5 p-1.5 pb-2 text-left aria-pressed:bg-accent",children:[D,B]}),e[35]=f,e[36]=y,e[37]=m,e[38]=d,e[39]=S,e[40]=B,e[41]=N,e[42]=D,e[43]=z):z=e[43],z}function ze(i){const e=M.c(4),{children:l,whileVisible:s}=i,a=s===void 0?!1:s,[r,n]=G.useState(!1);let o;e[0]!==a?(o=()=>u=>{if(!u)return;const f=new IntersectionObserver(m=>{const[y]=m;y?.isIntersecting?(n(!0),a||f.disconnect()):a&&n(!1)},{rootMargin:"200px"});return f.observe(u),()=>f.disconnect()},e[0]=a,e[1]=o):o=e[1];const[c]=G.useState(o),d=r&&l;let p;return e[2]!==d?(p=t.jsx("div",{ref:c,className:"h-full w-full",children:d}),e[2]=d,e[3]=p):p=e[3],p}function yn(i){const e=M.c(6),{url:l,filename:s}=i,{data:a}=Se(l);if(a===void 0)return null;if(a===null||!a.trim()){let o;return e[0]!==s?(o=t.jsx(Re,{filename:s}),e[0]=s,e[1]=o):o=e[1],o}let r;e[2]!==a?(r=a.slice(0,2e3),e[2]=a,e[3]=r):r=e[3];let n;return e[4]!==r?(n=t.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:r}),e[4]=r,e[5]=n):n=e[5],n}function gn(i){const e=M.c(6),{url:l,filename:s}=i,{data:a}=Se(l);if(a===void 0)return null;if(a===null||!a.trim()){let o;return e[0]!==s?(o=t.jsx(Re,{filename:s}),e[0]=s,e[1]=o):o=e[1],o}let r;e[2]!==a?(r=a.slice(0,4e3),e[2]=a,e[3]=r):r=e[3];let n;return e[4]!==r?(n=t.jsx("div",{className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 overflow-hidden bg-background p-6 text-sm select-none",children:t.jsx(xs,{children:r})}),e[4]=r,e[5]=n):n=e[5],n}function Re(i){const e=M.c(2),{filename:l}=i;let s;return e[0]!==l?(s=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(bt,{filename:l,className:"h-14 w-11 opacity-60"})}),e[0]=l,e[1]=s):s=e[1],s}function vn(i){const e=M.c(23),{url:l,ext:s}=i;let a;e[0]!==l?(a=he.csvThumb(l),e[0]=l,e[1]=a):a=e[1];let r;e[2]!==l?(r=()=>mn(l,{headers:{Range:"bytes=0-8191"}}),e[2]=l,e[3]=r):r=e[3];let n;e[4]!==a||e[5]!==r?(n={queryKey:a,queryFn:r,staleTime:6e4,retry:!1},e[4]=a,e[5]=r,e[6]=n):n=e[6];const{data:o}=$l(n);if(!o)return null;const c=s==="tsv"?" ":",";let d,p,u,f;if(e[7]!==o||e[8]!==c){f=Symbol.for("react.early_return_sentinel");e:{let S;e[13]!==c?(S=v=>v.split(c).slice(0,6).map(kn),e[13]=c,e[14]=S):S=e[14];const k=o.split(`
|
|
162
|
-
`).filter(Boolean).slice(0,7).map(S);if(k.length===0){f=null;break e}u="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",p="w-full border-collapse",d=k.map(jn)}e[7]=o,e[8]=c,e[9]=d,e[10]=p,e[11]=u,e[12]=f}else d=e[9],p=e[10],u=e[11],f=e[12];if(f!==Symbol.for("react.early_return_sentinel"))return f;let m;e[15]!==d?(m=t.jsx("tbody",{children:d}),e[15]=d,e[16]=m):m=e[16];let y;e[17]!==p||e[18]!==m?(y=t.jsx("table",{className:p,children:m}),e[17]=p,e[18]=m,e[19]=y):y=e[19];let x;return e[20]!==u||e[21]!==y?(x=t.jsx("div",{className:u,children:y}),e[20]=u,e[21]=y,e[22]=x):x=e[22],x}function jn(i,e){return t.jsx("tr",{className:ne(e===0&&"bg-muted/50 font-medium"),children:i.map(wn)},e)}function wn(i,e){return t.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:t.jsx("span",{className:"block truncate",children:i})},e)}function kn(i){return i.trim().replace(/^"|"$/g,"")}function Sn(i){const e=M.c(12),{url:l,filename:s}=i,[a,r]=G.useState(!1);let n;e[0]!==s||e[1]!==a?(n=!a&&t.jsx(Re,{filename:s}),e[0]=s,e[1]=a,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=()=>r(!0),e[3]=o):o=e[3];const c=a?"opacity-100":"opacity-0";let d;e[4]!==c?(d=ne("absolute top-0 left-0 h-[400%] w-[400%] origin-top-left scale-25 border-0 bg-white transition-opacity duration-300",c),e[4]=c,e[5]=d):d=e[5];let p;e[6]!==d||e[7]!==l?(p=t.jsx("iframe",{src:l,title:"","aria-hidden":!0,tabIndex:-1,sandbox:"allow-scripts",onLoad:o,className:d}),e[6]=d,e[7]=l,e[8]=p):p=e[8];let u;return e[9]!==n||e[10]!==p?(u=t.jsxs("div",{className:"pointer-events-none relative h-full w-full overflow-hidden",children:[n,p]}),e[9]=n,e[10]=p,e[11]=u):u=e[11],u}function Nn(i){const e=M.c(26),{filename:l,size:s,downloadUrl:a,compact:r}=i,n=r===void 0?!1:r;let o;if(e[0]!==a||e[1]!==l||e[2]!==s){const u=pn(l);if(cn.has(u)){let f;e[4]!==a?(f=t.jsx("img",{src:a,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=a,e[5]=f):f=e[5],o=f}else if(un.has(u)){const f=`${a}#t=0.1`;let m;e[6]!==f?(m=t.jsx(ze,{children:t.jsx("video",{src:f,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=f,e[7]=m):m=e[7],o=m}else if(u==="pdf"){let f;e[8]!==l?(f=t.jsx(Re,{filename:l}),e[8]=l,e[9]=f):f=e[9],o=f}else if(dn.has(u))o=t.jsx(ze,{children:t.jsx(vn,{url:a,ext:u})});else if(u==="html"||u==="htm"){let f;e[10]!==a||e[11]!==l?(f=t.jsx(ze,{whileVisible:!0,children:t.jsx(Sn,{url:a,filename:l})}),e[10]=a,e[11]=l,e[12]=f):f=e[12],o=f}else if((u==="md"||u==="markdown")&&s<=Rt){let f;e[13]!==a||e[14]!==l?(f=t.jsx(ze,{children:t.jsx(gn,{url:a,filename:l})}),e[13]=a,e[14]=l,e[15]=f):f=e[15],o=f}else if(fn.has(u)&&s<=Rt){let f;e[16]!==a||e[17]!==l?(f=t.jsx(ze,{children:t.jsx(yn,{url:a,filename:l})}),e[16]=a,e[17]=l,e[18]=f):f=e[18],o=f}else{let f;e[19]!==l?(f=t.jsx(Re,{filename:l}),e[19]=l,e[20]=f):f=e[20],o=f}e[0]=a,e[1]=l,e[2]=s,e[3]=o}else o=e[3];const c=n?"aspect-[3/1]":"aspect-[400/265]";let d;e[21]!==c?(d=ne("w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",c),e[21]=c,e[22]=d):d=e[22];let p;return e[23]!==o||e[24]!==d?(p=t.jsx("div",{className:d,children:o}),e[23]=o,e[24]=d,e[25]=p):p=e[25],p}const al={location:"hidden w-32 @2xl/library:table-cell",owner:"hidden w-36 @3xl/library:table-cell",size:"hidden w-20 text-right @xl/library:table-cell",updated:"hidden w-24 text-right @md/library:table-cell",menu:"w-10"},il=G.createContext(!1),ol=G.createContext(!1),cl={location:"hidden w-32 @2xl/library:table-cell",owner:"hidden w-36 @xl/library:table-cell",size:"hidden w-20 @lg/library:table-cell",updated:"hidden w-24 @md/library:table-cell",menu:"w-10"};function Cn(i){const e=M.c(2),{kind:l}=i,s=l==="folder"?mt:l==="skill"?ht:l==="brand"?Ve:ms;let a;return e[0]!==s?(a=t.jsx(s,{size:16,className:"shrink-0 text-muted-foreground"}),e[0]=s,e[1]=a):a=e[1],a}function Pn(i){const e=M.c(5),{kind:l,name:s}=i;if(l==="folder"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(et,{className:"size-5 shrink-0"}),e[0]=r):r=e[0],r}if(l==="skill"||l==="brand"){const r=l==="skill"?ht:Ve;let n;return e[1]!==r?(n=t.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:t.jsx(r,{size:12})}),e[1]=r,e[2]=n):n=e[2],n}let a;return e[3]!==s?(a=t.jsx(bt,{filename:s,className:"h-5 w-4 shrink-0"}),e[3]=s,e[4]=a):a=e[4],a}function Dn(i){const e=M.c(18),{userId:l}=i,s=!!l;let a;e[0]!==s?(a={enabled:s},e[0]=s,e[1]=a):a=e[1];const{data:r}=Tl(a);let n,o;if(e[2]!==r?.data?.members||e[3]!==l){const y=r?.data?.members??[];n=l?y.find(x=>x.userId===l):void 0,o=n?.user?.name?.trim(),e[2]=r?.data?.members,e[3]=l,e[4]=n,e[5]=o}else n=e[4],o=e[5];const c=o;if(!c)return null;const d=n?.user?.image??void 0;let p;e[6]!==c||e[7]!==d?(p=t.jsx(Fl,{url:d,fallback:c,shape:"circle",size:"2xs",className:"shrink-0"}),e[6]=c,e[7]=d,e[8]=p):p=e[8];let u;if(e[9]!==c){let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=/\s+/,e[11]=y):y=e[11],u=c.split(y),e[9]=c,e[10]=u}else u=e[10];let f;e[12]!==u[0]?(f=t.jsx("span",{className:"truncate",children:u[0]}),e[12]=u[0],e[13]=f):f=e[13];let m;return e[14]!==c||e[15]!==p||e[16]!==f?(m=t.jsxs("span",{className:"flex min-w-0 items-center gap-2",title:c,children:[p,f]}),e[14]=c,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function dt(i){const e=M.c(74),{entry:l,publicState:s,secondary:a,selected:r,actions:n}=i,o=r===void 0?!1:r,c=ce();let d;e[0]!==l?(d=Xs(l),e[0]=l,e[1]=d):d=e[1];const p=d,u=G.use(il),f=G.use(ol),m=f?cl:al;let y;e[2]!==n||e[3]!==m.location||e[4]!==f||e[5]!==a||e[6]!==u?(y=u&&t.jsx(Pe,{className:ne(m.location,"truncate text-muted-foreground"),title:a,children:a&&n.onOpenSecondary?t.jsx("button",{type:"button",className:"max-w-full truncate hover:text-foreground hover:underline",onClick:pe=>{pe.stopPropagation(),n.onOpenSecondary?.()},children:a}):a&&f?t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[t.jsx(mt,{size:14,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:a})]}):a}),e[2]=n,e[3]=m.location,e[4]=f,e[5]=a,e[6]=u,e[7]=y):y=e[7];const x=y,S=f?"text-foreground":"text-muted-foreground";let k;e[8]!==m.owner||e[9]!==S?(k=ne(m.owner,S),e[8]=m.owner,e[9]=S,e[10]=k):k=e[10];let v;e[11]!==l.entry.createdBy?(v=t.jsx(Dn,{userId:l.entry.createdBy}),e[11]=l.entry.createdBy,e[12]=v):v=e[12];let N;e[13]!==k||e[14]!==v?(N=t.jsx(Pe,{className:k,children:v}),e[13]=k,e[14]=v,e[15]=N):N=e[15];const D=N;let j;e[16]!==m.size?(j=ne(m.size,"tabular-nums text-muted-foreground"),e[16]=m.size,e[17]=j):j=e[17];const O=p??"";let w;e[18]!==j||e[19]!==O?(w=t.jsx(Pe,{className:j,children:O}),e[18]=j,e[19]=O,e[20]=w):w=e[20];const I=w;let g;e[21]!==m.updated?(g=ne(m.updated,"tabular-nums text-muted-foreground"),e[21]=m.updated,e[22]=g):g=e[22];let $;e[23]!==l.updatedAt?($=ft(l.updatedAt),e[23]=l.updatedAt,e[24]=$):$=e[24];let R;e[25]!==g||e[26]!==$?(R=t.jsx(Pe,{className:g,children:$}),e[25]=g,e[26]=$,e[27]=R):R=e[27];const F=R,B=o?"selected":void 0,z=n.draggable,A=n.onOpen,E=n.onDragStart,U=n.onContextMenu,P=n.onDrop?On:void 0,V=n.onDrop;let T;e[28]!==l.kind||e[29]!==l.name||e[30]!==f?(T=f?t.jsx(Cn,{kind:l.kind}):t.jsx(Pn,{kind:l.kind,name:l.name}),e[28]=l.kind,e[29]=l.name,e[30]=f,e[31]=T):T=e[31];const L=f&&"font-medium";let X;e[32]!==L?(X=ne("truncate text-foreground",L),e[32]=L,e[33]=X):X=e[33];let W;e[34]!==l.name||e[35]!==X?(W=t.jsx("span",{className:X,title:l.name,children:l.name}),e[34]=l.name,e[35]=X,e[36]=W):W=e[36];let _;e[37]!==s||e[38]!==c?(_=s&&t.jsx(Je,{state:s,t:c}),e[37]=s,e[38]=c,e[39]=_):_=e[39];let q;e[40]!==T||e[41]!==W||e[42]!==_?(q=t.jsx(Pe,{className:"min-w-0 max-w-0 pl-4",children:t.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[T,W,_]})}),e[40]=T,e[41]=W,e[42]=_,e[43]=q):q=e[43];let H;e[44]!==x||e[45]!==D||e[46]!==f||e[47]!==I||e[48]!==F?(H=f?t.jsxs(t.Fragment,{children:[F,I,D,x]}):t.jsxs(t.Fragment,{children:[x,D,I,F]}),e[44]=x,e[45]=D,e[46]=f,e[47]=I,e[48]=F,e[49]=H):H=e[49];let J;e[50]!==m.menu?(J=ne(m.menu,"pr-2 text-right"),e[50]=m.menu,e[51]=J):J=e[51];let Y;e[52]!==n.download||e[53]!==n.onBrowse||e[54]!==n.onDelete||e[55]!==n.onShare||e[56]!==l.name||e[57]!==c?(Y=t.jsx(xt,{label:l.name,onBrowse:n.onBrowse,onShare:n.onShare,download:n.download,onDelete:n.onDelete,t:c}),e[52]=n.download,e[53]=n.onBrowse,e[54]=n.onDelete,e[55]=n.onShare,e[56]=l.name,e[57]=c,e[58]=Y):Y=e[58];let te;e[59]!==J||e[60]!==Y?(te=t.jsx(Pe,{className:J,children:Y}),e[59]=J,e[60]=Y,e[61]=te):te=e[61];let se;return e[62]!==n.draggable||e[63]!==n.onContextMenu||e[64]!==n.onDragStart||e[65]!==n.onDrop||e[66]!==n.onOpen||e[67]!==o||e[68]!==B||e[69]!==P||e[70]!==q||e[71]!==H||e[72]!==te?(se=t.jsxs(ll,{"data-state":B,"aria-selected":o,className:"group/card cursor-pointer hover:bg-accent",draggable:z,onClick:A,onDragStart:E,onContextMenu:U,onDragOver:P,onDrop:V,children:[q,H,te]}),e[62]=n.draggable,e[63]=n.onContextMenu,e[64]=n.onDragStart,e[65]=n.onDrop,e[66]=n.onOpen,e[67]=o,e[68]=B,e[69]=P,e[70]=q,e[71]=H,e[72]=te,e[73]=se):se=e[73],se}function On(i){return i.preventDefault()}function st(i){const e=M.c(11),{label:l,active:s,descending:a,className:r,onClick:n}=i,o=a?zs:Es,c=s?"text-foreground":"text-muted-foreground";let d;e[0]!==r||e[1]!==c?(d=ne("flex items-center gap-1 truncate font-medium transition-colors hover:text-foreground",c,r),e[0]=r,e[1]=c,e[2]=d):d=e[2];let p;e[3]!==o||e[4]!==s?(p=s&&t.jsx(o,{size:11,className:"shrink-0"}),e[3]=o,e[4]=s,e[5]=p):p=e[5];let u;return e[6]!==l||e[7]!==n||e[8]!==d||e[9]!==p?(u=t.jsxs("button",{type:"button",onClick:n,className:d,children:[l,p]}),e[6]=l,e[7]=n,e[8]=d,e[9]=p,e[10]=u):u=e[10],u}function dl(i){const e=M.c(67),{sort:l,onSort:s,locationLabel:a,plain:r,children:n}=i,o=r===void 0?!1:r,c=ce(),d=o?cl:al,p=o?"font-normal":"ml-auto";let u;e[0]!==d.location||e[1]!==a?(u=a&&t.jsx(De,{className:d.location,children:a}),e[0]=d.location,e[1]=a,e[2]=u):u=e[2];const f=u,m=d.owner;let y;e[3]!==c?(y=c("library.entries.createdBy"),e[3]=c,e[4]=y):y=e[4];let x;e[5]!==d.owner||e[6]!==y?(x=t.jsx(De,{className:m,children:y}),e[5]=d.owner,e[6]=y,e[7]=x):x=e[7];const S=x,k=d.size;let v;e[8]!==c?(v=c("library.entries.size"),e[8]=c,e[9]=v):v=e[9];const N=l==="size";let D;e[10]!==s?(D=()=>s("size"),e[10]=s,e[11]=D):D=e[11];let j;e[12]!==p||e[13]!==v||e[14]!==N||e[15]!==D?(j=t.jsx(st,{label:v,active:N,descending:!0,className:p,onClick:D}),e[12]=p,e[13]=v,e[14]=N,e[15]=D,e[16]=j):j=e[16];let O;e[17]!==d.size||e[18]!==j?(O=t.jsx(De,{className:k,children:j}),e[17]=d.size,e[18]=j,e[19]=O):O=e[19];const w=O,I=d.updated;let g;e[20]!==c?(g=c("library.library.updated"),e[20]=c,e[21]=g):g=e[21];const $=l==="updated";let R;e[22]!==s?(R=()=>s("updated"),e[22]=s,e[23]=R):R=e[23];let F;e[24]!==p||e[25]!==g||e[26]!==$||e[27]!==R?(F=t.jsx(st,{label:g,active:$,descending:!0,className:p,onClick:R}),e[24]=p,e[25]=g,e[26]=$,e[27]=R,e[28]=F):F=e[28];let B;e[29]!==d.updated||e[30]!==F?(B=t.jsx(De,{className:I,children:F}),e[29]=d.updated,e[30]=F,e[31]=B):B=e[31];const z=B,A=o&&"table-fixed";let E;e[32]!==A?(E=ne(A),e[32]=A,e[33]=E):E=e[33];let U;e[34]!==c?(U=c("library.library.name"),e[34]=c,e[35]=U):U=e[35];const P=l==="name",V=o&&"font-normal";let T;e[36]!==V?(T=ne(V),e[36]=V,e[37]=T):T=e[37];let L;e[38]!==s?(L=()=>s("name"),e[38]=s,e[39]=L):L=e[39];let X;e[40]!==U||e[41]!==P||e[42]!==T||e[43]!==L?(X=t.jsx(De,{className:"pl-4",children:t.jsx(st,{label:U,active:P,className:T,onClick:L})}),e[40]=U,e[41]=P,e[42]=T,e[43]=L,e[44]=X):X=e[44];let W;e[45]!==f||e[46]!==S||e[47]!==o||e[48]!==w||e[49]!==z?(W=o?t.jsxs(t.Fragment,{children:[z,w,S,f]}):t.jsxs(t.Fragment,{children:[f,S,w,z]}),e[45]=f,e[46]=S,e[47]=o,e[48]=w,e[49]=z,e[50]=W):W=e[50];let _;e[51]!==d.menu?(_=t.jsx(De,{className:d.menu}),e[51]=d.menu,e[52]=_):_=e[52];let q;e[53]!==X||e[54]!==W||e[55]!==_?(q=t.jsx(Ms,{children:t.jsxs(ll,{children:[X,W,_]})}),e[53]=X,e[54]=W,e[55]=_,e[56]=q):q=e[56];const H=!!a;let J;e[57]!==n||e[58]!==H?(J=t.jsx(il,{value:H,children:n}),e[57]=n,e[58]=H,e[59]=J):J=e[59];let Y;e[60]!==o||e[61]!==J?(Y=t.jsx(Bs,{children:t.jsx(ol,{value:o,children:J})}),e[60]=o,e[61]=J,e[62]=Y):Y=e[62];let te;return e[63]!==E||e[64]!==q||e[65]!==Y?(te=t.jsx("div",{className:"@container/library min-w-0",children:t.jsxs(As,{className:E,children:[q,Y]})}),e[63]=E,e[64]=q,e[65]=Y,e[66]=te):te=e[66],te}const ul=24;function $n(i){return i?i<=2?1:i<=8?2:3:0}function Ae(i){const e=M.c(44),{name:l,meta:s,icon:a,glyph:r,tone:n,readOnly:o,overlay:c,badge:d,counts:p,onOpen:u,onBrowse:f,onShare:m,onDelete:y,draggable:x,onDragStart:S,onContextMenu:k,onDrop:v}=i,N=ce(),D=!!p&&p.enabled;let j;e[0]!==D?(j={enabled:D},e[0]=D,e[1]=j):j=e[1];const O=Ze(p?.volume??"",p?.path??"",j),w=p?O.data?.length:void 0;let I;e[2]!==w||e[3]!==s||e[4]!==N?(I=s??(w===void 0?void 0:w===0?N("library.entries.emptyFolder"):w===1?N("library.entries.itemCount"):N("library.entries.itemsCount",{count:w})),e[2]=w,e[3]=s,e[4]=N,e[5]=I):I=e[5];const g=I;let $;e[6]!==u?($=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),u())},e[6]=u,e[7]=$):$=e[7];const R=v?Tn:void 0;let F;e[8]!==w||e[9]!==r||e[10]!==a||e[11]!==o||e[12]!==n?(F=a??t.jsx(et,{glyph:r,tone:n,readOnly:o,sheets:$n(w),className:"size-6"}),e[8]=w,e[9]=r,e[10]=a,e[11]=o,e[12]=n,e[13]=F):F=e[13];let B;e[14]!==c?(B=c&&t.jsx("span",{className:"absolute -right-1.5 -bottom-1 flex rounded-lg ring-2 ring-card",children:c}),e[14]=c,e[15]=B):B=e[15];let z;e[16]!==F||e[17]!==B?(z=t.jsxs("span",{className:"relative flex shrink-0",children:[F,B]}),e[16]=F,e[17]=B,e[18]=z):z=e[18];let A;e[19]!==l?(A=t.jsx("span",{className:"truncate text-sm font-medium text-foreground",title:l,children:l}),e[19]=l,e[20]=A):A=e[20];let E;e[21]!==d||e[22]!==A?(E=t.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[A,d]}),e[21]=d,e[22]=A,e[23]=E):E=e[23];let U;e[24]!==g?(U=g&&t.jsx("span",{className:"text-meta shrink-0 group-hover/card:hidden group-has-[[data-state=open]]/card:hidden",children:g}),e[24]=g,e[25]=U):U=e[25];let P;e[26]!==l||e[27]!==f||e[28]!==y||e[29]!==m||e[30]!==N?(P=t.jsx(xt,{label:l,onBrowse:f,onShare:m,onDelete:y,t:N}),e[26]=l,e[27]=f,e[28]=y,e[29]=m,e[30]=N,e[31]=P):P=e[31];let V;return e[32]!==x||e[33]!==k||e[34]!==S||e[35]!==v||e[36]!==u||e[37]!==E||e[38]!==U||e[39]!==P||e[40]!==$||e[41]!==R||e[42]!==z?(V=t.jsxs("div",{role:"button",tabIndex:0,draggable:x,onClick:u,onKeyDown:$,onDragStart:S,onContextMenu:k,onDragOver:R,onDrop:v,className:"group/card surface surface-interactive focus-ring relative flex h-12 min-w-0 cursor-pointer items-center gap-2.5 pr-1.5 pl-3",children:[z,E,U,P]}),e[32]=x,e[33]=k,e[34]=S,e[35]=v,e[36]=u,e[37]=E,e[38]=U,e[39]=P,e[40]=$,e[41]=R,e[42]=z,e[43]=V):V=e[43],V}function Tn(i){return i.preventDefault()}function yt(i){const e=M.c(2),{children:l}=i;let s;return e[0]!==l?(s=t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2",children:l}),e[0]=l,e[1]=s):s=e[1],s}function Fn(i){return`${i.volume}/${Qt(i.path)}`}function zn(i,e){const l=new Map;for(const s of i){if(!ct(s.path,"documents")&&!ct(s.path,"media"))continue;const a=Fn(s),r=l.get(a);r?r.more+=1:l.set(a,{entry:s,more:0})}return[...l.values()].slice(0,e)}function gt(i){return`${window.location.origin}${i}`}function we(i){if(i.shareMode==="password")return"password";if(i.shareMode==="public"||i.readPublic)return"public";if(i.effectivePublic)return"inherited"}const En=[be,"uploads","outputs"],fl=["uploads","outputs"],ut=new Set([...fl,Le,Xe("public")]),Mn=4;function vt(i,e,l){const s=Qt(e);if(s)return Xe(re(s));const a=Yt(i);return a||(i===be?pt(l):i)}function Ee(i,e,l){return{onDragStart:s=>{l.onDragStart?.(i),s.dataTransfer.effectAllowed="move",s.dataTransfer.setData("application/x-studio-library-path",i)},onContextMenu:s=>{s.preventDefault(),l.onContextMenu?.(i,e)},onDrop:l.onDrop?s=>{s.preventDefault();const a=s.dataTransfer.getData("application/x-studio-library-path");a&&a!==i&&!i.startsWith(a+"/")&&l.onDrop(a,i)}:void 0}}function Ue(i,e){return ct(i.path,e.fileView)&&Hs(i.updatedAt,e.modified)}function Bn(i){const e=M.c(17),{layout:l,onChange:s}=i,a=ce();let r;e[0]!==s?(r=m=>{(m==="list"||m==="grid")&&s(m)},e[0]=s,e[1]=r):r=e[1];let n;e[2]!==a?(n=a("library.entries.listView"),e[2]=a,e[3]=n):n=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ns,{}),e[4]=o):o=e[4];let c;e[5]!==n?(c=t.jsx(Lt,{value:"list",tooltip:n,children:o}),e[5]=n,e[6]=c):c=e[6];let d;e[7]!==a?(d=a("library.entries.gridView"),e[7]=a,e[8]=d):d=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Cs,{}),e[9]=p):p=e[9];let u;e[10]!==d?(u=t.jsx(Lt,{value:"grid",tooltip:d,children:p}),e[10]=d,e[11]=u):u=e[11];let f;return e[12]!==l||e[13]!==r||e[14]!==c||e[15]!==u?(f=t.jsxs(Ds,{type:"single",variant:"segmented",size:"sm",value:l,onValueChange:r,children:[c,u]}),e[12]=l,e[13]=r,e[14]=c,e[15]=u,e[16]=f):f=e[16],f}function An(i){const e=M.c(8),{label:l,count:s,action:a}=i;let r;e[0]!==s?(r=s!==void 0&&s>0&&t.jsx("span",{className:"text-meta",children:s}),e[0]=s,e[1]=r):r=e[1];let n;e[2]!==l||e[3]!==r?(n=t.jsxs("h2",{className:"flex items-baseline gap-2 text-sm font-medium text-foreground",children:[l,r]}),e[2]=l,e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=t.jsxs("div",{className:"flex h-7 items-center justify-between gap-3",children:[n,a]}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Ke(i){const e=M.c(7),{label:l,count:s,action:a,children:r}=i;let n;e[0]!==a||e[1]!==s||e[2]!==l?(n=t.jsx(An,{label:l,count:s,action:a}),e[0]=a,e[1]=s,e[2]=l,e[3]=n):n=e[3];let o;return e[4]!==r||e[5]!==n?(o=t.jsxs("section",{className:"flex flex-col gap-3",children:[n,r]}),e[4]=r,e[5]=n,e[6]=o):o=e[6],o}function pl(i){const e=M.c(2),{children:l}=i;let s;return e[0]!==l?(s=t.jsx("div",{className:"@container",children:t.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3 @[980px]:grid-cols-4",children:l})}),e[0]=l,e[1]=s):s=e[1],s}function Ln(i){const e=M.c(2),{rows:l}=i,s=l===void 0?1:l;let a;return e[0]!==s?(a=t.jsx(pl,{children:Array.from({length:s*3},In)}),e[0]=s,e[1]=a):a=e[1],a}function In(i,e){return t.jsx(ve,{className:"h-16 rounded-2xl"},e)}function Vn(i){const e=M.c(2),{rows:l}=i,s=l===void 0?6:l;let a;return e[0]!==s?(a=t.jsx("div",{className:"flex flex-col gap-px",children:Array.from({length:s},Rn)}),e[0]=s,e[1]=a):a=e[1],a}function Rn(i,e){return t.jsx(ve,{className:"h-11 rounded-lg"},e)}function tt(i){const e=M.c(2),{layout:l}=i;let s;return e[0]!==l?(s=l==="grid"?t.jsx(Ln,{rows:2}):t.jsx(Vn,{}),e[0]=l,e[1]=s):s=e[1],s}function jt(i){const e=M.c(2),{children:l}=i;let s;return e[0]!==l?(s=t.jsx("p",{className:"text-sm text-muted-foreground",children:l}),e[0]=l,e[1]=s):s=e[1],s}function wt(i){const e=M.c(24),{entry:l,view:s,secondary:a,publicState:r,downloadUrl:n,selected:o,actions:c}=i;if(s.layout==="list"){let x;return e[0]!==c||e[1]!==l||e[2]!==r||e[3]!==a||e[4]!==o?(x=t.jsx(dt,{entry:l,selected:o,secondary:a,publicState:r,actions:c}),e[0]=c,e[1]=l,e[2]=r,e[3]=a,e[4]=o,e[5]=x):x=e[5],x}const d=l.size,p=l.name;let u;e[6]!==l.name||e[7]!==a?(u=a??Os(l.name),e[6]=l.name,e[7]=a,e[8]=u):u=e[8];let f;e[9]!==l.updatedAt?(f=ft(l.updatedAt),e[9]=l.updatedAt,e[10]=f):f=e[10];const m=`${u} · ${f}`;let y;return e[11]!==c.draggable||e[12]!==c.onContextMenu||e[13]!==c.onDelete||e[14]!==c.onDragStart||e[15]!==c.onOpen||e[16]!==c.onShare||e[17]!==n||e[18]!==l.name||e[19]!==l.size||e[20]!==r||e[21]!==o||e[22]!==m?(y=t.jsx(rl,{size:d,filename:p,downloadUrl:n,subtitle:m,publicState:r,selected:o,onOpen:c.onOpen,onShare:c.onShare,onDelete:c.onDelete,draggable:c.draggable,onDragStart:c.onDragStart,onContextMenu:c.onContextMenu}),e[11]=c.draggable,e[12]=c.onContextMenu,e[13]=c.onDelete,e[14]=c.onDragStart,e[15]=c.onOpen,e[16]=c.onShare,e[17]=n,e[18]=l.name,e[19]=l.size,e[20]=r,e[21]=o,e[22]=m,e[23]=y):y=e[23],y}function kt(i){const e=M.c(17),{view:l,count:s,label:a,locationLabel:r,note:n,children:o}=i,c=ce();let d;e[0]!==a||e[1]!==c?(d=a??c("library.libraryViews.files"),e[0]=a,e[1]=c,e[2]=d):d=e[2];let p;e[3]!==n?(p=n&&t.jsx("span",{className:"text-meta",children:n}),e[3]=n,e[4]=p):p=e[4];let u;e[5]!==o||e[6]!==r||e[7]!==l.flat||e[8]!==l.layout||e[9]!==l.onSort||e[10]!==l.sort?(u=l.layout==="grid"?t.jsx(pl,{children:o}):t.jsx(dl,{sort:l.sort,onSort:l.onSort,locationLabel:r,plain:l.flat,children:o}),e[5]=o,e[6]=r,e[7]=l.flat,e[8]=l.layout,e[9]=l.onSort,e[10]=l.sort,e[11]=u):u=e[11];let f;return e[12]!==s||e[13]!==d||e[14]!==p||e[15]!==u?(f=t.jsx(Ke,{label:d,count:s,action:p,children:u}),e[12]=s,e[13]=d,e[14]=p,e[15]=u,e[16]=f):f=e[16],f}function Ut(i){const e=M.c(2),{Glyph:l}=i;let s;return e[0]!==l?(s=t.jsx("span",{className:"flex size-6 items-center justify-center rounded-md bg-primary/10 text-primary",children:t.jsx(l,{className:"size-3.5"})}),e[0]=l,e[1]=s):s=e[1],s}function Un(){const i=M.c(2),e=Ss();let l;if(i[0]!==e){l=new Map;for(const s of Ls(e))l.set(Jl(s),s);i[0]=e,i[1]=l}else l=i[1];return l}function _n(i){const e=M.c(54),{query:l,scope:s,stale:a,view:r,onOpenFile:n,onShare:o,onDelete:c}=i,d=ce(),{org:p}=_e(),u=He(),f=rs(l,s);let m;e[0]!==u||e[1]!==o?(m=g=>o({volume:g.volume,path:g.path,kind:"file",shareMode:g.shareMode??"private",effectivePublic:g.effectivePublic??!1,url:gt(u(g.volume,g.path))}),e[0]=u,e[1]=o,e[2]=m):m=e[2];const y=m;if(f.isPending){let g;return e[3]!==r.layout?(g=t.jsx(tt,{layout:r.layout}),e[3]=r.layout,e[4]=g):g=e[4],g}let x,S,k,v,N,D,j,O;if(e[5]!==u||e[6]!==c||e[7]!==n||e[8]!==p||e[9]!==l||e[10]!==f.data||e[11]!==f.isPlaceholderData||e[12]!==y||e[13]!==a||e[14]!==d||e[15]!==r){O=Symbol.for("react.early_return_sentinel");e:{let g;e[24]!==r?(g=z=>Ue(z,r),e[24]=r,e[25]=g):g=e[25];const $=(f.data??[]).filter(g);if($.length===0){let z;e[26]!==l||e[27]!==d?(z=d("library.libraryViews.noFilesMatch",{query:l}),e[26]=l,e[27]=d,e[28]=z):z=e[28];let A;e[29]!==z?(A=t.jsx(jt,{children:z}),e[29]=z,e[30]=A):A=e[30],O=A;break e}const R=We($.map(Be),r.sort).map(z=>({item:z,hit:$.find(A=>A.path===z.path)})),F=(a||f.isPlaceholderData)&&"opacity-50";e[31]!==F?(j=ne(F),e[31]=F,e[32]=j):j=e[32],x=kt,S=r,e[33]!==d?(k=d("library.libraryViews.results"),e[33]=d,e[34]=k):k=e[34],e[35]!==d?(v=d("library.entries.location"),e[35]=d,e[36]=v):v=e[36],N=$.length;let B;e[37]!==u||e[38]!==c||e[39]!==n||e[40]!==p||e[41]!==y||e[42]!==r?(B=z=>{const{item:A,hit:E}=z,U=Yt(E.volume)!==null,P=u(E.volume,E.path),V=Ie(E.volume,E.path);return t.jsx(wt,{entry:A,view:r,selected:r.previewPath===V,secondary:vt(E.volume,E.path,p.slug),publicState:we(E),downloadUrl:P,actions:{onOpen:()=>n(V),download:{url:P,filename:A.name},onShare:U?void 0:()=>y(E),onDelete:U?void 0:()=>c({volume:E.volume,path:E.path,kind:"file"})}},`${E.volume}/${E.path}`)},e[37]=u,e[38]=c,e[39]=n,e[40]=p,e[41]=y,e[42]=r,e[43]=B):B=e[43],D=R.map(B)}e[5]=u,e[6]=c,e[7]=n,e[8]=p,e[9]=l,e[10]=f.data,e[11]=f.isPlaceholderData,e[12]=y,e[13]=a,e[14]=d,e[15]=r,e[16]=x,e[17]=S,e[18]=k,e[19]=v,e[20]=N,e[21]=D,e[22]=j,e[23]=O}else x=e[16],S=e[17],k=e[18],v=e[19],N=e[20],D=e[21],j=e[22],O=e[23];if(O!==Symbol.for("react.early_return_sentinel"))return O;let w;e[44]!==x||e[45]!==S||e[46]!==k||e[47]!==v||e[48]!==N||e[49]!==D?(w=t.jsx(x,{view:S,label:k,locationLabel:v,count:N,children:D}),e[44]=x,e[45]=S,e[46]=k,e[47]=v,e[48]=N,e[49]=D,e[50]=w):w=e[50];let I;return e[51]!==j||e[52]!==w?(I=t.jsx("div",{className:j,children:w}),e[51]=j,e[52]=w,e[53]=I):I=e[53],I}function Hn(i){const e=M.c(34),{view:l,onOpenFile:s}=i,a=ce(),{org:r}=_e(),n=Wt(),o=He();if(n.isPending)return null;let c,d,p,u,f,m;if(e[0]!==o||e[1]!==s||e[2]!==r||e[3]!==n.data||e[4]!==a||e[5]!==l){m=Symbol.for("react.early_return_sentinel");e:{let k;e[12]!==l?(k=O=>Ue(O,l),e[12]=l,e[13]=k):k=e[13];const v=zn((n.data??[]).filter(k),Mn);if(v.length===0){m=null;break e}let N;e[14]!==r||e[15]!==a?(N=(O,w)=>[vt(O.volume,O.path,r.slug),ft(O.updatedAt),w>0&&a("library.libraryViews.moreInFolder",{count:w})].filter(Boolean).join(" · "),e[14]=r,e[15]=a,e[16]=N):N=e[16];const D=N;c=Ke,e[17]!==a?(f=a("library.libraryViews.recent"),e[17]=a,e[18]=f):f=e[18],u="@container",d="grid grid-cols-2 gap-3 @[720px]:grid-cols-4";let j;e[19]!==D||e[20]!==o||e[21]!==s||e[22]!==l?(j=O=>{const{entry:w,more:I}=O,g=Ie(w.volume,w.path),$=re(w.path);return t.jsx(rl,{size:w.size,filename:$,downloadUrl:o(w.volume,w.path),subtitle:D(w,I),publicState:we(w),selected:l.previewPath===g,compact:!0,onOpen:()=>s(g)},`${w.volume}/${w.path}`)},e[19]=D,e[20]=o,e[21]=s,e[22]=l,e[23]=j):j=e[23],p=v.map(j)}e[0]=o,e[1]=s,e[2]=r,e[3]=n.data,e[4]=a,e[5]=l,e[6]=c,e[7]=d,e[8]=p,e[9]=u,e[10]=f,e[11]=m}else c=e[6],d=e[7],p=e[8],u=e[9],f=e[10],m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m;let y;e[24]!==d||e[25]!==p?(y=t.jsx("div",{className:d,children:p}),e[24]=d,e[25]=p,e[26]=y):y=e[26];let x;e[27]!==u||e[28]!==y?(x=t.jsx("div",{className:u,children:y}),e[27]=u,e[28]=y,e[29]=x):x=e[29];let S;return e[30]!==c||e[31]!==f||e[32]!==x?(S=t.jsx(c,{label:f,children:x}),e[30]=c,e[31]=f,e[32]=x,e[33]=S):S=e[33],S}const Kn=new Set(fl);function _t(i){return i!==null&&Kn.has(i)}function qn(i){const e=M.c(52),{volume:l,view:s,onOpenDir:a,onOpenFile:r,onShare:n,onDelete:o,emptyActions:c}=i,d=ce(),p=He(),u=as(l),f=Ze(l,""),{navigateToTask:m}=ts();if(u.isPending||f.isPending){let g;return e[0]!==s.layout?(g=t.jsx(tt,{layout:s.layout}),e[0]=s.layout,e[1]=g):g=e[1],g}const y=u.error??f.error;if(y){let g;e[2]!==y||e[3]!==d?(g=y instanceof Error?y.message:d("library.libraryViews.failedToLoad"),e[2]=y,e[3]=d,e[4]=g):g=e[4];let $;return e[5]!==g?($=t.jsx("p",{className:"text-sm text-destructive",children:g}),e[5]=g,e[6]=$):$=e[6],$}let x,S,k,v,N,D,j;if(e[7]!==c||e[8]!==p||e[9]!==m||e[10]!==o||e[11]!==a||e[12]!==r||e[13]!==n||e[14]!==f.data||e[15]!==d||e[16]!==s||e[17]!==l||e[18]!==u.data?.pages){j=Symbol.for("react.early_return_sentinel");e:{const g=u.data?.pages??[],$=g.flatMap(Yn),R=Object.assign({},...g.map(Qn)),F=new Map($.map(P=>[P.path,P.sourceThreadId?{id:P.sourceThreadId,...R[P.sourceThreadId]}:void 0]));let B;e[26]!==s?(B=P=>Ue(P,s),e[26]=s,e[27]=B):B=e[27];const z=$.filter(B),A=(f.data??[]).filter(Gn);if(z.length===0&&A.length===0){let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(et,{className:"size-16"}),e[28]=P):P=e[28];let V;e[29]!==d?(V=d("library.libraryViews.emptyFolder"),e[29]=d,e[30]=V):V=e[30];let T;e[31]!==d?(T=d("library.libraryViews.emptyFolderHint"),e[31]=d,e[32]=T):T=e[32];let L;e[33]!==c||e[34]!==T||e[35]!==V?(L=t.jsx("div",{className:"rounded-2xl border border-dashed border-border",children:t.jsx(tl,{illustration:P,title:V,description:T,buttonComponent:c})}),e[33]=c,e[34]=T,e[35]=V,e[36]=L):L=e[36],j=L;break e}const E=A.length>0&&t.jsx(Ke,{label:d("library.libraryViews.folders"),count:A.length,children:t.jsx(yt,{children:A.map((P,V)=>t.jsx(Ae,{name:re(P.path),counts:{volume:l,path:P.path,enabled:V<ul},onOpen:()=>a(Ie(l,P.path)),onDelete:()=>o({volume:l,path:P.path,kind:"dir"})},P.path))})});if(z.length===0){j=E;break e}const U=We(z.map(Be),s.sort);D=E,x=kt,S=s,k=z.length,e[37]!==d?(v=d("library.libraryViews.sourceChat"),e[37]=d,e[38]=v):v=e[38],N=U.map(P=>{const V=Ie(l,P.path),T=p(l,P.path),L=F.get(P.path);return t.jsx(wt,{entry:P,view:s,secondary:L?.title,selected:s.previewPath===V,publicState:we(P.entry),downloadUrl:T,actions:{onOpen:()=>r(V),onOpenSecondary:L?.agentId!==void 0?()=>m(L.id,{virtualMcpId:L.agentId}):void 0,download:{url:T,filename:P.name},onShare:()=>n({volume:l,path:P.path,kind:"file",shareMode:P.entry.shareMode??"private",effectivePublic:P.entry.effectivePublic??!1,url:gt(T)}),onDelete:()=>o({volume:l,path:P.path,kind:"file"})}},P.path)})}e[7]=c,e[8]=p,e[9]=m,e[10]=o,e[11]=a,e[12]=r,e[13]=n,e[14]=f.data,e[15]=d,e[16]=s,e[17]=l,e[18]=u.data?.pages,e[19]=x,e[20]=S,e[21]=k,e[22]=v,e[23]=N,e[24]=D,e[25]=j}else x=e[19],S=e[20],k=e[21],v=e[22],N=e[23],D=e[24],j=e[25];if(j!==Symbol.for("react.early_return_sentinel"))return j;let O;e[39]!==x||e[40]!==S||e[41]!==k||e[42]!==v||e[43]!==N?(O=t.jsx(x,{view:S,count:k,locationLabel:v,children:N}),e[39]=x,e[40]=S,e[41]=k,e[42]=v,e[43]=N,e[44]=O):O=e[44];let w;e[45]!==d||e[46]!==u?(w=u.hasNextPage&&t.jsx(ie,{variant:"outline",className:"self-center",disabled:u.isFetchingNextPage,onClick:()=>{u.fetchNextPage()},children:d("library.libraryViews.loadMore")}),e[45]=d,e[46]=u,e[47]=w):w=e[47];let I;return e[48]!==D||e[49]!==O||e[50]!==w?(I=t.jsxs(t.Fragment,{children:[D,O,w]}),e[48]=D,e[49]=O,e[50]=w,e[51]=I):I=e[51],I}function Gn(i){return i.kind==="dir"&&!Wl(re(i.path))}function Qn(i){return i.threads}function Yn(i){return i.entries}function Xn(i){const e=M.c(21),{view:l,onOpenDir:s}=i,a=ce(),r=Xt();if(r.isPending){let m;return e[0]!==l.layout?(m=t.jsx(tt,{layout:l.layout}),e[0]=l.layout,e[1]=m):m=e[1],m}let n;e[2]!==r.data?(n=r.data??[],e[2]=r.data,e[3]=n):n=e[3];const o=n;if(o.length===0){let m;e[4]!==a?(m=a("library.libraryViews.noPublicSkillSetsConfigured"),e[4]=a,e[5]=m):m=e[5];let y;return e[6]!==m?(y=t.jsx(jt,{children:m}),e[6]=m,e[7]=y):y=e[7],y}let c;e[8]!==a?(c=a("library.libraryViews.folders"),e[8]=a,e[9]=c):c=e[9];const d=o.length;let p;if(e[10]!==s||e[11]!==o){let m;e[13]!==s?(m=y=>t.jsx(Ae,{name:y,readOnly:!0,counts:{volume:`public-${y}`,path:"",enabled:!0},onOpen:()=>s(`public/${y}`)},y),e[13]=s,e[14]=m):m=e[14],p=o.map(m),e[10]=s,e[11]=o,e[12]=p}else p=e[12];let u;e[15]!==p?(u=t.jsx(yt,{children:p}),e[15]=p,e[16]=u):u=e[16];let f;return e[17]!==o.length||e[18]!==c||e[19]!==u?(f=t.jsx(Ke,{label:c,count:d,children:u}),e[17]=o.length,e[18]=c,e[19]=u,e[20]=f):f=e[20],f}function Wn(i){const e=M.c(86),{location:l,root:s,onOpenDir:a,view:r,onOpenFile:n,onOpenSkill:o,onOpenBrand:c,onShare:d,onDelete:p,onDragStart:u,onContextMenu:f,onMove:m,emptyActions:y}=i,x=ce(),{org:S}=_e(),k=l.volume??"",v=Ze(k,l.dirPath),N=He(),D=Un(),j=l.isHomeRoot&&s===be,O=k===be&&l.dirPath===Le;let w;e[0]!==j||e[1]!==S?(w=T=>j&&ut.has(T.toLowerCase())?`${pt(S.slug)}/${T}`:void 0,e[0]=j,e[1]=S,e[2]=w):w=e[2];const I=w,g=j&&!!r.flat;let $;e[3]!==g?($={enabled:g},e[3]=g,e[4]=$):$=e[4];const R=Wt(void 0,$);let F;e[5]!==g||e[6]!==j||e[7]!==n||e[8]!==r?(F=j&&!g?t.jsx(Hn,{view:r,onOpenFile:n}):null,e[5]=g,e[6]=j,e[7]=n,e[8]=r,e[9]=F):F=e[9];const B=F;if(v.isPending){let T;e[10]!==r.layout?(T=t.jsx(tt,{layout:r.layout}),e[10]=r.layout,e[11]=T):T=e[11];let L;return e[12]!==B||e[13]!==T?(L=t.jsxs(t.Fragment,{children:[B,T]}),e[12]=B,e[13]=T,e[14]=L):L=e[14],L}if(v.isError){let T;e[15]!==v.error||e[16]!==x?(T=v.error instanceof Error?v.error.message:x("library.libraryViews.failedToLoad"),e[15]=v.error,e[16]=x,e[17]=T):T=e[17];let L;return e[18]!==T?(L=t.jsx("p",{className:"text-sm text-destructive",children:T}),e[18]=T,e[19]=L):L=e[19],L}let z,A,E,U;if(e[20]!==I||e[21]!==y||e[22]!==N||e[23]!==g||e[24]!==O||e[25]!==j||e[26]!==v.data||e[27]!==l||e[28]!==f||e[29]!==p||e[30]!==u||e[31]!==m||e[32]!==c||e[33]!==a||e[34]!==n||e[35]!==o||e[36]!==d||e[37]!==S||e[38]!==D||e[39]!==B||e[40]!==R||e[41]!==x||e[42]!==r||e[43]!==k){U=Symbol.for("react.early_return_sentinel");e:{const T=v.data??[];let L;e[48]!==j?(L=b=>!(j&&b.kind==="dir"&&re(b.path)===Le),e[48]=j,e[49]=L):L=e[49];const X=T.filter(L);if(X.length===0&&!j){let b;e[50]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(et,{className:"size-16"}),e[50]=b):b=e[50];let K;e[51]!==x?(K=x("library.libraryViews.emptyFolder"),e[51]=x,e[52]=K):K=e[52];const Z=l.readOnly?"library.libraryViews.emptyReadOnlySet":"library.libraryViews.emptyFolderHint";let ae;e[53]!==x||e[54]!==Z?(ae=x(Z),e[53]=x,e[54]=Z,e[55]=ae):ae=e[55];const de=l.readOnly?void 0:y;let ue;e[56]!==ae||e[57]!==de||e[58]!==K?(ue=t.jsx("div",{className:"rounded-2xl border border-dashed border-border",children:t.jsx(tl,{illustration:b,title:K,description:ae,buttonComponent:de})}),e[56]=ae,e[57]=de,e[58]=K,e[59]=ue):ue=e[59],U=ue;break e}let W;e[60]!==l.readOnly||e[61]!==p||e[62]!==k?(W=b=>l.readOnly?void 0:()=>p({volume:k,path:b.path,kind:b.kind}),e[60]=l.readOnly,e[61]=p,e[62]=k,e[63]=W):W=e[63];const _=W;let q;e[64]!==N||e[65]!==l.readOnly||e[66]!==d||e[67]!==k?(q=b=>l.readOnly?void 0:()=>d({volume:k,path:b.path,kind:b.kind,shareMode:b.shareMode??"private",effectivePublic:b.effectivePublic??!1,url:b.kind==="file"?gt(N(k,b.path)):void 0}),e[64]=N,e[65]=l.readOnly,e[66]=d,e[67]=k,e[68]=q):q=e[68];const H=q,J=X.filter(er),Y=X.filter(Zn),te=X.filter(Jn);let se;e[69]!==r?(se=b=>b.kind==="file"&&Ue(b,r),e[69]=r,e[70]=se):se=e[70],z=X.filter(se);const pe=We(z.map(Be),r.sort),ke=We([...J,...Y,...te,...z].map(Be),r.sort);let je;e[71]!==l||e[72]!==c||e[73]!==a||e[74]!==n||e[75]!==o?(je=b=>{const K=ge(l,b.path);switch(b.kind){case"folder":return()=>a(K);case"skill":return()=>o(K);case"brand":return()=>c(K);case"file":return()=>n(K);default:return b.kind}},e[71]=l,e[72]=c,e[73]=a,e[74]=n,e[75]=o,e[76]=je):je=e[76];const xe=je,le=g?(R.data??[]).filter(b=>Ue(b,r)&&!(b.volume===be&&!b.path.includes("/"))):[],me=ke.length+le.length>0&&t.jsxs(dl,{sort:r.sort,onSort:r.onSort,locationLabel:g?x("library.entries.location"):void 0,plain:r.flat,children:[ke.map(b=>{const K=ge(l,b.path),Z=O?D.get(b.name):void 0,ae=b.kind==="skill"||b.kind==="brand";return t.jsx(dt,{entry:Z?.title?{...b,name:Z.title}:b,selected:b.kind==="file"&&r.previewPath===K,publicState:we(b.entry),actions:{onOpen:xe(b),onBrowse:ae?()=>a(K):void 0,download:b.kind==="file"?{url:N(k,b.path),filename:b.name}:void 0,onShare:b.kind==="brand"?void 0:H(b.entry),onDelete:_(b.entry),draggable:!l.readOnly,...Ee(b.path,b.kind==="file"?"file":"dir",{onDragStart:u,onContextMenu:f,onDrop:b.kind==="folder"?m:void 0})}},b.path)}),le.map(b=>{const K=Ie(b.volume,b.path),Z=Be(b);return t.jsx(dt,{entry:Z,secondary:vt(b.volume,b.path,S.slug),selected:r.previewPath===K,publicState:we(b),actions:{onOpen:()=>n(K),download:{url:N(b.volume,b.path),filename:Z.name},onDelete:()=>p({volume:b.volume,path:b.path,kind:"file"})}},`${b.volume}/${b.path}`)})]});A=B,E=r.layout==="list"?me:t.jsxs(t.Fragment,{children:[te.length+J.length+Y.length>0&&t.jsx(Ke,{label:x("library.libraryViews.folders"),count:te.length+J.length+Y.length,children:t.jsxs(yt,{children:[J.map(b=>{const K=we(b);return t.jsx(Ae,{name:re(b.path),meta:x("library.cards.skill"),icon:t.jsx(Ut,{Glyph:ht}),badge:K&&t.jsx(Je,{state:K,t:x}),onOpen:()=>o(ge(l,b.path)),onBrowse:()=>a(ge(l,b.path)),onShare:H(b),onDelete:_(b),draggable:!l.readOnly,...Ee(b.path,"dir",{onDragStart:u,onContextMenu:f})},b.path)}),Y.map(b=>t.jsx(Ae,{name:re(b.path),meta:x("library.cards.brand"),icon:t.jsx(Ut,{Glyph:Ve}),onOpen:()=>c(ge(l,b.path)),onBrowse:()=>a(ge(l,b.path)),onDelete:_(b),draggable:!l.readOnly,...Ee(b.path,"dir",{onDragStart:u,onContextMenu:f})},b.path)),te.map((b,K)=>{const Z=re(b.path),ae=O?D.get(Z):void 0,de=we(b);return t.jsx(Ae,{name:ae?.title??Z,meta:I(Z),readOnly:l.readOnly,counts:{volume:k,path:b.path,enabled:K<ul},overlay:ae&&t.jsx(hs,{icon:ae.icon,name:ae.title,size:"xs"}),badge:de&&t.jsx(Je,{state:de,t:x}),onOpen:()=>a(ge(l,b.path)),onShare:H(b),onDelete:_(b),draggable:!l.readOnly,...Ee(b.path,"dir",{onDragStart:u,onContextMenu:f,onDrop:m})},b.path)})]})}),pe.length>0&&t.jsx(kt,{view:r,count:pe.length,children:pe.map(b=>t.jsx(wt,{entry:b,view:r,selected:r.previewPath===ge(l,b.path),publicState:we(b.entry),downloadUrl:N(k,b.path),actions:{onOpen:()=>n(ge(l,b.path)),download:{url:N(k,b.path),filename:b.name},onShare:H(b.entry),onDelete:_(b.entry),draggable:!l.readOnly,...Ee(b.path,"file",{onDragStart:u,onContextMenu:f})}},b.path))})]})}e[20]=I,e[21]=y,e[22]=N,e[23]=g,e[24]=O,e[25]=j,e[26]=v.data,e[27]=l,e[28]=f,e[29]=p,e[30]=u,e[31]=m,e[32]=c,e[33]=a,e[34]=n,e[35]=o,e[36]=d,e[37]=S,e[38]=D,e[39]=B,e[40]=R,e[41]=x,e[42]=r,e[43]=k,e[44]=z,e[45]=A,e[46]=E,e[47]=U}else z=e[44],A=e[45],E=e[46],U=e[47];if(U!==Symbol.for("react.early_return_sentinel"))return U;let P;e[77]!==z||e[78]!==x||e[79]!==r.fileView||e[80]!==r.modified?(P=(r.fileView!=="all"||r.modified!=="any")&&z.length===0&&t.jsx(jt,{children:x("library.library.noFilesInView")}),e[77]=z,e[78]=x,e[79]=r.fileView,e[80]=r.modified,e[81]=P):P=e[81];let V;return e[82]!==A||e[83]!==E||e[84]!==P?(V=t.jsxs(t.Fragment,{children:[A,E,P]}),e[82]=A,e[83]=E,e[84]=P,e[85]=V):V=e[85],V}function Jn(i){return i.kind==="dir"&&!i.hasSkill&&!i.hasBrand}function Zn(i){return i.kind==="dir"&&i.hasBrand&&!i.hasSkill}function er(i){return i.kind==="dir"&&i.hasSkill}function tr({root:i=be,rootLabel:e,onOpenFile:l,onOpenSkill:s,onOpenBrand:a,context:r=!1}={}){const n=ce(),{org:o}=_e(),c=Gt(),d=zl(),p=Gl(),u=El({strict:!1}),f=u.fileView??"all",m=u.modified??"any",y=!r&&u.layout==="grid"?"grid":"list",x=it(u.path||i),S=_t(x.volume)&&!x.dirPath?"updated":"name",k=Ys.find(h=>h===u.sort)??S,v=(h,Q)=>d({to:".",search:fe=>({...fe,[h]:Q||void 0})}),N=h=>v("fileView",h==="all"?null:h),j={layout:y,sort:k,fileView:f,modified:m,previewPath:!l?u.preview:void 0,flat:r,onLayout:h=>v("layout",h==="list"?null:h),onSort:h=>v("sort",h===S?null:h)},O=u.path||i,w=it(O),I=cs(),g=w.volume!==null&&I.has(w.volume)?{...w,readOnly:!0}:w,$=h=>v("path",h),R=e??pt(o.slug),F=Zl(O,i),B=F.length===0,z=F.map(h=>({key:`folder:${h.path}`,label:h.label,onSelect:()=>$(h.path)})),A=(h,Q)=>d({to:".",search:fe=>({...fe,preview:void 0,skill:void 0,brand:void 0,[h]:Q})}),E=h=>{ls(),l?l(h):A("preview",h)},U=s??(h=>A("skill",h)),P=a??(h=>A("brand",h)),[V,T]=G.useState(""),L=ss(V.trim(),300),X=!B&&g.volume!==null?{volume:g.volume,prefix:g.dirPath}:void 0,W=X?n("library.library.searchInPlaceholder",{folder:Xe(g.segments.at(-1)??"")}):n("library.library.searchPlaceholder"),_=B?R:Xe(g.segments.at(-1)??""),[q,H]=G.useState(null),[J,Y]=G.useState(null),[te,se]=G.useState(!1),[pe,ke]=G.useState(""),[je,xe]=G.useState(!1),[le,me]=G.useState(null),[b,K]=G.useState(""),Z=G.useRef(null),[ae,de]=G.useState(!1),ue=G.useRef(0),ye=g.readOnly?null:g.volume,{upload:Ne,mkdir:C,move:ee}=ot(ye??be),{remove:Ce}=ot(q?.volume??"uploads"),$e=g.isHomeRoot&&i===be;async function Te(h){if(!(!ye||!h||h.length===0))try{await Ne.mutateAsync({dir:g.dirPath,files:[...h]}),oe.success(h.length===1?n("library.library.uploadedSingle",{filename:h[0]?.name??""}):n("library.library.uploadedMultiple",{count:h.length}))}catch(Q){oe.error(Q instanceof Error?Q.message:n("library.library.uploadFailed"))}finally{Z.current&&(Z.current.value="")}}const qe=ye!==null;function St(h){return h.dataTransfer.types.includes("Files")}function ml(h){!qe||!St(h)||(h.preventDefault(),ue.current+=1,de(!0))}function hl(h){!qe||!St(h)||h.preventDefault()}function bl(){qe&&(ue.current=Math.max(0,ue.current-1),ue.current===0&&de(!1))}function xl(h){qe&&(h.preventDefault(),h.stopPropagation(),ue.current=0,de(!1),h.dataTransfer.files.length>0&&Te(h.dataTransfer.files))}async function Nt(){const h=pe.trim();if(!(!ye||!h)){if($e&&ut.has(h.toLowerCase())){oe.error(n("library.library.folderNameReserved",{name:h}));return}try{const Q=g.dirPath;await C.mutateAsync(Q?`${Q}/${h}`:h),oe.success(n("library.library.folderCreated",{name:h})),se(!1),ke("")}catch(Q){oe.error(Q instanceof Error?Q.message:n("library.library.folderCreateFailed"))}}}async function yl(){if(!q)return;const h=q;try{await Ce.mutateAsync(h.path),oe.success(n("library.library.deleted",{name:re(h.path)}))}catch(Q){oe.error(Q instanceof Error?Q.message:n("library.library.deleteFailed"))}finally{H(null)}}async function Ct(){if(!le)return;const h=b.trim();if(!h||h.includes("/")||h.includes("..")||h===re(le.path)){xe(!1),me(null),K("");return}if(le.kind==="dir"&&$e&&ut.has(h.toLowerCase())){oe.error(n("library.library.folderNameReserved",{name:h}));return}try{const Q=le.path.includes("/")?le.path.slice(0,le.path.lastIndexOf("/")):"",fe=Q?`${Q}/${h}`:h;await ee.mutateAsync({from:le.path,to:fe});const lt=h.replace(/[<>]/g,"");oe.success(n("library.library.renamed",{name:lt}))}catch(Q){oe.error(Q instanceof Error?Q.message:n("library.library.renameFailed"))}finally{xe(!1),me(null),K("")}}async function gl(h,Q){try{const fe=re(h),lt=Q?`${Q}/${fe}`:fe;await ee.mutateAsync({from:h,to:lt}),oe.success(n("library.library.moved",{name:fe,destination:Q||n("library.library.theLibrary")}))}catch(fe){oe.error(fe instanceof Error?fe.message:n("library.library.moveFailed"))}}function vl(){for(const h of En)c.invalidateQueries({queryKey:he.orgFsVolume(o.id,h)});g.volume&&c.invalidateQueries({queryKey:he.orgFsVolume(o.id,g.volume)}),c.invalidateQueries({queryKey:he.orgFsRecent(o.id)}),c.invalidateQueries({queryKey:he.orgFsSearchRoot(o.id)}),c.invalidateQueries({queryKey:he.orgFsPublicSets(o.id)})}function jl(h){h.defaultPrevented||!ye||h.target.closest("input, textarea, button, a, [role='button']")||(h.preventDefault(),se(!0))}const wl=t.jsxs(t.Fragment,{children:[t.jsx(Ql,{label:n("library.library.refresh"),tooltipSide:"bottom",variant:"secondary",onClick:vl,children:t.jsx(Ml,{})}),ye&&t.jsxs(ie,{variant:"secondary",size:"sm",onClick:()=>se(!0),"aria-label":n("library.library.newFolder"),children:[t.jsx(At,{size:14}),t.jsx("span",{className:"hidden @lg/panel-header:inline",children:n("library.library.newFolder")})]})]}),Pt=g.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(ql,{size:12}),n("library.library.readOnly")]}):t.jsxs(ie,{size:"sm",disabled:Ne.isPending,onClick:()=>Z.current?.click(),"aria-label":Ne.isPending?n("library.library.uploading"):n("library.library.uploadFile"),children:[t.jsx(Qe,{size:14}),t.jsx("span",{className:"hidden @lg/panel-header:inline",children:Ne.isPending?n("library.library.uploading"):n("library.library.uploadFile")})]}),Dt=t.jsxs(ie,{size:"sm",onClick:()=>Z.current?.click(),children:[t.jsx(Qe,{size:14}),n("library.library.uploadFile")]}),kl=t.jsxs("div",{className:"flex items-center gap-2",children:[Dt,t.jsxs(ie,{variant:"secondary",size:"sm",onClick:()=>se(!0),children:[t.jsx(At,{size:14}),n("library.library.newFolder")]})]}),Sl=_t(g.volume)&&!g.dirPath,Ot=qs(i).filter(h=>!r||h.key!=="public"),Nl=es(g),$t=Us.map(h=>({value:h,label:{any:n("library.library.modifiedAny"),today:n("library.library.modifiedToday"),week:n("library.library.modifiedWeek"),month:n("library.library.modifiedMonth")}[h]})),Tt=["all","documents","media"].map(h=>({value:h,label:n(h==="all"?"library.library.anyType":`library.library.${h}`)})),Cl=t.jsxs(Oe.Tabs,{children:[Ot.map(h=>t.jsx(Oe.Tab,{active:Nl===h.key,onClick:()=>$(h.path),children:r&&h.key==="all"?n("library.context.all"):h.label},h.key)),!r&&Ot.length>0&&t.jsx("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border"}),!r&&t.jsxs(t.Fragment,{children:[t.jsx(It,{label:f==="all"?n("library.library.typeFilter"):Tt.find(h=>h.value===f)?.label,value:f,options:Tt,active:f!=="all",onChange:N}),t.jsx(It,{label:m==="any"?n("library.library.modified"):$t.find(h=>h.value===m)?.label,value:m,options:$t,active:m!=="any",onChange:h=>{v("modified",h==="any"?null:h)}})]})]});return t.jsxs("div",{className:"relative h-full",onDragEnter:ml,onDragOver:hl,onDragLeave:bl,onDrop:xl,onContextMenu:jl,children:[ae&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx(Qe,{size:28,className:"text-primary"}),t.jsx("p",{className:"text-sm font-medium text-foreground",children:n("library.library.dropToUpload",{location:_})})]})}),t.jsx("input",{ref:Z,type:"file",multiple:!0,className:"hidden",onChange:h=>{Te(h.target.files)}}),t.jsx(Oe.Breadcrumbs,{after:"page",parent:{onSelect:()=>$(i),...e?{label:e}:{}},items:z}),r?t.jsxs(Oe.Actions,{children:[ye&&t.jsx(ie,{variant:"secondary",size:"sm",onClick:()=>se(!0),children:n("library.library.newFolder")}),Pt]}):t.jsx(Oe.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(Xl,{value:V,onChange:T,label:n("library.library.searchPlaceholder"),placeholder:W,clearLabel:n("library.library.clearSearch")}),wl]}),children:Pt}),t.jsx(zt.Toolbar.Left.Portal,{children:Cl}),t.jsx(zt.Toolbar.Right.Portal,{children:r?t.jsx(Yl,{value:V,onChange:T,placeholder:W,className:"w-full min-w-48 md:w-56"}):t.jsx(Bn,{layout:y,onChange:j.onLayout})}),t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsx("div",{className:ne("mx-auto flex w-full flex-col gap-8",r?ne(Bl,"pt-4 pb-8"):"max-w-[1200px] px-4 py-6 md:px-8"),children:L?t.jsx(_n,{view:j,query:L,scope:X,stale:V.trim()!==L,onOpenFile:E,onShare:Y,onDelete:H}):g.volume===null?t.jsx(Xn,{view:j,onOpenDir:$}):Sl?t.jsx(qn,{volume:g.volume,view:j,onOpenDir:$,onOpenFile:E,onShare:Y,onDelete:H,emptyActions:Dt},g.volume):t.jsx(Wn,{view:j,root:i,location:g,onOpenDir:$,onOpenFile:E,onOpenSkill:U,onOpenBrand:P,onShare:Y,onDelete:H,onContextMenu:(h,Q)=>{me({path:h,kind:Q}),K(re(h)),xe(!0)},onMove:gl,emptyActions:kl},g.volume)})}),p&&(u.preview?t.jsx(Zt,{previewPath:u.preview,onClose:()=>v("preview",null)}):u.skill?t.jsx(el,{skillPath:u.skill,onClose:()=>v("skill",null)},u.skill):u.brand?t.jsx(nl,{brandPath:u.brand,onClose:()=>v("brand",null)},u.brand):null),t.jsx(rt,{open:te,onOpenChange:se,children:t.jsxs(nt,{children:[t.jsxs(Et,{children:[t.jsx(at,{children:n("library.library.newFolderTitle")}),t.jsx(Mt,{children:n("library.library.newFolderDescription",{path:_||n("library.library.theLibrary")})})]}),t.jsx(Ye,{autoFocus:!0,placeholder:n("library.library.folderNamePlaceholder"),value:pe,onChange:h=>ke(h.target.value),onKeyDown:h=>{h.key==="Enter"&&Nt()}}),t.jsxs(Bt,{children:[t.jsx(ie,{variant:"outline",onClick:()=>se(!1),children:n("library.library.cancel")}),t.jsx(ie,{disabled:!pe.trim()||C.isPending,onClick:()=>{Nt()},children:n("library.library.create")})]})]})}),t.jsx(rt,{open:je,onOpenChange:h=>{xe(h),h||(me(null),K(""))},children:t.jsxs(nt,{children:[t.jsxs(Et,{children:[t.jsx(at,{children:le&&n("library.library.renameTitle",{name:re(le.path)})}),t.jsx(Mt,{children:n("library.library.renameDescription")})]}),t.jsx(Ye,{autoFocus:!0,value:b,onChange:h=>K(h.target.value),onKeyDown:h=>{h.key==="Enter"&&Ct()}}),t.jsxs(Bt,{children:[t.jsx(ie,{variant:"outline",onClick:()=>xe(!1),children:n("library.library.cancel")}),t.jsx(ie,{disabled:!b.trim()||ee.isPending,onClick:()=>{Ct()},children:n("library.library.rename")})]})]})}),t.jsx(ks,{target:J,onOpenChange:h=>{h||Y(null)}}),t.jsx(Al,{open:q!==null,onOpenChange:h=>{h||H(null)},children:t.jsxs(Ll,{children:[t.jsxs(Il,{children:[t.jsx(Vl,{children:n("library.library.deleteTitle",{name:q?re(q.path):""})}),t.jsx(Rl,{children:q?.kind==="dir"?n("library.library.deleteDirectoryDescription"):n("library.library.deleteFileDescription")})]}),t.jsxs(Ul,{children:[t.jsx(_l,{children:n("library.library.cancel")}),t.jsx(Hl,{onClick:()=>{yl()},children:n("library.library.delete")})]})]})})]})}function lr(i,e,l){switch(i){case"dialog":return e;case"panel":return l;case"side":return;default:return i}}function Ar(i){const e=M.c(23);let l;e[0]!==i?(l=i===void 0?{}:i,e[0]=i,e[1]=l):l=e[1];const{root:s,rootLabel:a,filePreview:r,context:n}=l,o=r===void 0?"panel":r,{openPanel:c}=Is(),[d,p]=G.useState(null),[u,f]=G.useState(null),[m,y]=G.useState(null);let x;e[2]!==c?(x=O=>c(Kl(O)),e[2]=c,e[3]=x):x=e[3];let S;e[4]!==o||e[5]!==x?(S=lr(o,p,x),e[4]=o,e[5]=x,e[6]=S):S=e[6];let k;e[7]!==n||e[8]!==s||e[9]!==a||e[10]!==S?(k=t.jsx(tr,{root:s,rootLabel:a,context:n,onOpenFile:S,onOpenSkill:f,onOpenBrand:y}),e[7]=n,e[8]=s,e[9]=a,e[10]=S,e[11]=k):k=e[11];let v;e[12]!==d?(v=d&&t.jsx(Zt,{previewPath:d,onClose:()=>p(null)},d),e[12]=d,e[13]=v):v=e[13];let N;e[14]!==u?(N=u&&t.jsx(el,{skillPath:u,onClose:()=>f(null)},u),e[14]=u,e[15]=N):N=e[15];let D;e[16]!==m?(D=m&&t.jsx(nl,{brandPath:m,onClose:()=>y(null)},m),e[16]=m,e[17]=D):D=e[17];let j;return e[18]!==k||e[19]!==v||e[20]!==N||e[21]!==D?(j=t.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[k,v,N,D]}),e[18]=k,e[19]=v,e[20]=N,e[21]=D,e[22]=j):j=e[22],j}export{Ar as L};
|
|
161
|
+
`);function sn(i,e){const l=e?`<style>${e}</style>`:"";return i.replaceAll("{{{slides}}}",ln).replaceAll("{{title}}",tn).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${l}</head>`)}function nn(i){const e=M.c(8),{readUrl:l,title:s,tokensUrl:a}=i,r=Se(l),n=Se(a??"");if(r.isPending||a&&n.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(ve,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[0]=p):p=e[0],p}if(r.isError||!r.data){let p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[1]=p):p=e[1],p}const o=n.data??null;let c;e[2]!==o||e[3]!==r.data?(c=sn(r.data,o),e[2]=o,e[3]=r.data,e[4]=c):c=e[4];let d;return e[5]!==c||e[6]!==s?(d=t.jsx("iframe",{title:s,srcDoc:c,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[5]=c,e[6]=s,e[7]=d):d=e[7],d}function Me(i){const e=M.c(2),{children:l}=i;let s;return e[0]!==l?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:l}),e[0]=l,e[1]=s):s=e[1],s}function rn(i){const e=M.c(16),{family:l,tokens:s,editing:a,valueOf:r,onEdit:n}=i;let o;e[0]!==l?(o=t.jsx("span",{className:"text-xs text-muted-foreground",children:l}),e[0]=l,e[1]=o):o=e[1];let c;if(e[2]!==a||e[3]!==n||e[4]!==s||e[5]!==r){let u;e[7]!==a||e[8]!==n||e[9]!==r?(u=f=>{const m=r(f),y=`${f.name.replace(/^--brand-/,"")}: ${m}`;return a&&/^#/.test(m)?t.jsx("input",{type:"color","aria-label":f.name,title:y,value:ws(m),onChange:x=>n(f.name,x.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},f.name):t.jsx("span",{title:y,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:m}},f.name)},e[7]=a,e[8]=n,e[9]=r,e[10]=u):u=e[10],c=s.map(u),e[2]=a,e[3]=n,e[4]=s,e[5]=r,e[6]=c}else c=e[6];let d;e[11]!==c?(d=t.jsx("div",{className:"flex flex-wrap gap-1",children:c}),e[11]=c,e[12]=d):d=e[12];let p;return e[13]!==o||e[14]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[o,d]}),e[13]=o,e[14]=d,e[15]=p):p=e[15],p}function an(i){const e=M.c(9),{token:l,value:s}=i;if(l.kind==="space"){let r;return e[0]!==s?(r=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:s,maxWidth:"100%"}})}),e[0]=s,e[1]=r):r=e[1],r}if(l.kind==="radius"){let r;return e[2]!==s?(r=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:s}}),e[2]=s,e[3]=r):r=e[3],r}if(l.kind==="shadow"){let r;return e[4]!==s?(r=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:s}}),e[4]=s,e[5]=r):r=e[5],r}if(l.kind==="type"&&/^--brand-text-/.test(l.name)){const r=`min(${s}, 22px)`;let n;return e[6]!==r?(n=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:r},children:"Ag"}),e[6]=r,e[7]=n):n=e[7],n}let a;return e[8]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=a):a=e[8],a}function sl(i){const e=M.c(17),{token:l,value:s,editing:a,onEdit:r}=i;let n;e[0]!==l||e[1]!==s?(n=t.jsx(an,{token:l,value:s}),e[0]=l,e[1]=s,e[2]=n):n=e[2];let o;if(e[3]!==l.name){let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=/^--brand-/,e[5]=u):u=e[5],o=l.name.replace(u,""),e[3]=l.name,e[4]=o}else o=e[4];let c;e[6]!==o?(c=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let d;e[8]!==a||e[9]!==r||e[10]!==l.name||e[11]!==s?(d=a?t.jsx(Ye,{value:s,onChange:u=>r(l.name,u.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:s}),e[8]=a,e[9]=r,e[10]=l.name,e[11]=s,e[12]=d):d=e[12];let p;return e[13]!==n||e[14]!==c||e[15]!==d?(p=t.jsxs("div",{className:"flex items-center gap-3",children:[n,c,d]}),e[13]=n,e[14]=c,e[15]=d,e[16]=p):p=e[16],p}function Fe(i){const e=M.c(16),{label:l,tokens:s,editing:a,valueOf:r,onEdit:n}=i;if(s.length===0)return null;let o;e[0]!==l?(o=t.jsx(Me,{children:l}),e[0]=l,e[1]=o):o=e[1];let c;if(e[2]!==a||e[3]!==n||e[4]!==s||e[5]!==r){let u;e[7]!==a||e[8]!==n||e[9]!==r?(u=f=>t.jsx(sl,{token:f,value:r(f),editing:a,onEdit:n},f.name),e[7]=a,e[8]=n,e[9]=r,e[10]=u):u=e[10],c=s.map(u),e[2]=a,e[3]=n,e[4]=s,e[5]=r,e[6]=c}else c=e[6];let d;e[11]!==c?(d=t.jsx("div",{className:"flex flex-col gap-2.5",children:c}),e[11]=c,e[12]=d):d=e[12];let p;return e[13]!==o||e[14]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-3",children:[o,d]}),e[13]=o,e[14]=d,e[15]=p):p=e[15],p}function on({brandPath:i,onClose:e,variant:l}){const s=ce(),{org:a}=_e(),r=it(i),n=r.volume??"",o=r.dirPath,c=re(o),d=r.readOnly,p=Gt(),u=He(),f=ns(n),{upload:m,remove:y}=ot(n),x=G.useRef(null),S=Ze(n,o),k=S.data??[],v=C=>k.some(ee=>ee.kind==="file"&&re(ee.path)===C),N=v("tokens.css"),D=v("brand.md"),j=v("slides-theme.html"),O=ys(k),w=u(n,`${o}/tokens.css`),I=u(n,`${o}/brand.md`),g=u(n,`${o}/slides-theme.html`),$=Se(w,{enabled:N}),R=Se(I,{enabled:D}),[F,B]=G.useState(!1),[z,A]=G.useState({}),[E,U]=G.useState(null),[P,V]=G.useState(!1),[T,L]=G.useState(!1),[X,W]=G.useState("deck"),_=$.data?gs($.data):[],q=C=>_.find(ee=>ee.name===C)?.value,H=C=>z[C.name]??C.value,J=vs(_),Y=_.filter(C=>C.kind==="font"),te=_.filter(C=>C.kind==="type"),se=_.filter(C=>C.kind==="space"),pe=_.filter(C=>C.kind==="radius"),ke=_.filter(C=>C.kind==="shadow"),je=_.filter(C=>C.kind==="motion"),xe=_.filter(C=>C.kind==="other"),le=(C,ee)=>A(Ce=>({...Ce,[C]:ee})),me=j&&X==="deck",b=E??R.data??"",K=Object.entries(z).filter(([C,ee])=>q(C)!==ee),Z=E!==null&&E!==(R.data??""),ae=K.length>0||Z;function de(){A({}),U(null),B(!1)}async function ue(){V(!0);try{if(K.length>0){let C=$.data??"";for(const[ee,Ce]of K)C=js(C,ee,Ce);await f.mutateAsync({path:`${o}/tokens.css`,body:C,contentType:"text/css; charset=utf-8"}),p.invalidateQueries({queryKey:he.fileText(w)})}Z&&E!==null&&(await f.mutateAsync({path:`${o}/brand.md`,body:E,contentType:"text/markdown; charset=utf-8"}),p.invalidateQueries({queryKey:he.fileText(I)})),p.invalidateQueries({queryKey:he.orgFsVolume(a.id,n)}),p.invalidateQueries({queryKey:he.orgFsRecent(a.id)}),A({}),U(null),B(!1),oe.success(s("library.brandPreview.brandSaved"))}catch(C){oe.error(C instanceof Error?C.message:s("library.brandPreview.failedSaveBrand"))}finally{V(!1)}}async function ye(C){const ee=C?.[0];if(!ee)return;const $e=`logo.${(ee.name.split(".").pop()??"png").toLowerCase()}`;try{await m.mutateAsync({dir:o,files:[new File([ee],$e,{type:ee.type})]}),O&&re(O)!==$e&&await y.mutateAsync(O),oe.success(s("library.brandPreview.logoUpdated"))}catch(Te){oe.error(Te instanceof Error?Te.message:s("library.brandPreview.logoUploadFailed"))}finally{x.current&&(x.current.value="")}}const Ne=!S.isPending&&!N&&!D&&!O;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Ve,{size:18})}),l==="dialog"?t.jsx(at,{className:"flex-1 truncate text-base font-medium text-foreground",children:c}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:c}),!d&&(F?t.jsxs(t.Fragment,{children:[t.jsx(ie,{variant:"ghost",size:"sm",onClick:de,disabled:P,children:s("library.brandPreview.cancel")}),t.jsx(ie,{size:"sm",disabled:!ae||P,onClick:()=>{ue()},children:s(P?"library.brandPreview.saving":"library.brandPreview.save")})]}):t.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>B(!0),children:[t.jsx(us,{size:14}),s("library.brandPreview.edit")]})),l==="dialog"?t.jsx(Ol,{asChild:!0,children:t.jsx(ie,{variant:"ghost",size:"icon",className:"shrink-0",children:t.jsx(Ft,{size:16})})}):t.jsx(ie,{variant:"ghost",size:"icon",className:"shrink-0",onClick:e,children:t.jsx(Ft,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(ve,{className:"h-40 w-full rounded-xl"}),t.jsx(ve,{className:"h-4 w-1/3"}),t.jsx(ve,{className:"h-4 w-2/3"})]}):Ne?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:s("library.brandPreview.brandNotAvailable")}):t.jsxs(t.Fragment,{children:[(j||N)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":s(T?"library.brandPreview.showPreview":"library.brandPreview.hidePreview"),onClick:()=>L(C=>!C),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),L(ee=>!ee))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-accent",children:[t.jsxs("div",{className:"surface-inset flex gap-0.5 p-0.5 text-xs font-medium",onClick:C=>C.stopPropagation(),children:[j&&t.jsx("button",{type:"button",onClick:()=>{W("deck"),L(!1)},className:ne("rounded-lg px-2.5 py-1",me?"bg-background text-foreground shadow-edge":"text-muted-foreground hover:text-foreground"),children:s("library.brandPreview.deck")}),t.jsx("button",{type:"button",onClick:()=>{W("components"),L(!1)},className:ne("rounded-lg px-2.5 py-1",me?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-edge"),children:s("library.brandPreview.components")})]}),T?t.jsx(Jt,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(is,{size:16,className:"shrink-0 text-muted-foreground"})]}),!T&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:ne("w-full overflow-hidden rounded-xl border border-border bg-muted/30",me?"aspect-[16/9]":"h-96"),children:me?t.jsx(nn,{readUrl:g,title:`${c} deck theme`,tokensUrl:w}):t.jsx(en,{tokensUrl:w})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Me,{children:s("library.brandPreview.logo")}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:O?t.jsx("img",{src:u(n,O),alt:`${c} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(Ve,{size:28,className:"text-muted-foreground/50"})}),F&&t.jsxs("div",{children:[t.jsxs(ie,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>x.current?.click(),children:[t.jsx(Qe,{size:14}),s(O?"library.brandPreview.replaceLogo":"library.brandPreview.addLogo")]}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:C=>{ye(C.target.files)}})]})]})]}),J.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Me,{children:s("library.brandPreview.colors")}),J.map(C=>t.jsx(rn,{family:C.family,tokens:C.tokens,editing:F,valueOf:H,onEdit:le},C.family))]}),(Y.length>0||te.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Me,{children:s("library.brandPreview.typography")}),Y.map(C=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:C.name.replace(/^--brand-font-?/,"")||s("library.brandPreview.defaultFont")}),F?t.jsx(Ye,{value:H(C),onChange:ee=>le(C.name,ee.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:H(C)},children:H(C)})]},C.name)),te.map(C=>t.jsx(sl,{token:C,value:H(C),editing:F,onEdit:le},C.name))]}),t.jsx(Fe,{label:s("library.brandPreview.spacing"),tokens:se,editing:F,valueOf:H,onEdit:le}),t.jsx(Fe,{label:s("library.brandPreview.radius"),tokens:pe,editing:F,valueOf:H,onEdit:le}),t.jsx(Fe,{label:s("library.brandPreview.shadows"),tokens:ke,editing:F,valueOf:H,onEdit:le}),t.jsx(Fe,{label:s("library.brandPreview.motion"),tokens:je,editing:F,valueOf:H,onEdit:le}),t.jsx(Fe,{label:s("library.brandPreview.tokens"),tokens:xe,editing:F,valueOf:H,onEdit:le}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Me,{children:s("library.brandPreview.voiceGuidelines")}),F?t.jsx(ds,{value:b,onChange:C=>U(C.target.value),placeholder:s("library.brandPreview.voicePlaceholder"),className:"min-h-48 font-mono text-sm"}):R.isPending&&D?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(ve,{className:"h-3 w-full"}),t.jsx(ve,{className:"h-3 w-5/6"})]}):b.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(bs,{id:`brand-preview-${i}`,text:b})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:s("library.brandPreview.noVoiceYet")})]})]})]})})]})}function nl(i){const e=M.c(8),{brandPath:l,onClose:s}=i;let a;e[0]!==s?(a=o=>{o||s()},e[0]=s,e[1]=a):a=e[1];let r;e[2]!==l||e[3]!==s?(r=t.jsx(nt,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(on,{brandPath:l,onClose:s,variant:"dialog"})}),e[2]=l,e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=t.jsx(rt,{open:!0,onOpenChange:a,children:r}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}const cn=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),dn=new Set(["csv","tsv"]),un=new Set(["mp4","webm","mov","m4v"]),fn=new Set(["txt","json","log","yaml","yml","xml"]),Rt=256*1024;function pn(i){return i.split(".").pop()?.toLowerCase()??""}async function mn(i,e){const l=await fetch(i,{credentials:"include",...e});if(!l.ok)throw new Error(`fetch failed: ${l.status}`);return l.text()}function hn(i){const e=M.c(6),{onShare:l,t:s}=i;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ps,{size:14}),e[0]=a):a=e[0];let r;e[1]!==s?(r=s("library.cards.share"),e[1]=s,e[2]=r):r=e[2];let n;return e[3]!==l||e[4]!==r?(n=t.jsxs(Ge,{onClick:l,children:[a,r]}),e[3]=l,e[4]=r,e[5]=n):n=e[5],n}function Je(i){const e=M.c(12),{state:l,t:s}=i;let a;e[0]!==l||e[1]!==s?(a=s(l==="password"?"library.cards.passwordProtected":l==="inherited"?"library.cards.sharedViaParent":"library.cards.publicBadge"),e[0]=l,e[1]=s,e[2]=a):a=e[2];const r=a,n=l==="password"?Ts:fs,o=l==="inherited"?"text-muted-foreground/60":"text-primary";let c;e[3]!==o?(c=ne(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==n||e[6]!==r||e[7]!==c?(d=t.jsx(n,{size:12,className:c,"aria-label":r}),e[5]=n,e[6]=r,e[7]=c,e[8]=d):d=e[8];let p;return e[9]!==r||e[10]!==d?(p=t.jsx("span",{title:r,className:"mt-0.5 flex shrink-0 items-center",children:d}),e[9]=r,e[10]=d,e[11]=p):p=e[11],p}function xt(i){const e=M.c(26),{label:l,onBrowse:s,onShare:a,download:r,onDelete:n,t:o}=i;if(!s&&!a&&!r&&!n)return;let c;e[0]!==l||e[1]!==o?(c=o("library.cards.actionsFor",{label:l}),e[0]=l,e[1]=o,e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Os,{size:14}),e[3]=d):d=e[3];let p;e[4]!==c?(p=t.jsx(Ht,{asChild:!0,children:t.jsx(ie,{variant:"ghost",size:"icon-xs",className:"shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:xn,"aria-label":c,children:d})}),e[4]=c,e[5]=p):p=e[5];let u;e[6]!==s||e[7]!==o?(u=s&&t.jsxs(Ge,{onClick:s,children:[t.jsx(mt,{size:14}),o("library.cards.browseFiles")]}),e[6]=s,e[7]=o,e[8]=u):u=e[8];let f;e[9]!==a||e[10]!==o?(f=a&&t.jsx(hn,{onShare:a,t:o}),e[9]=a,e[10]=o,e[11]=f):f=e[11];let m;e[12]!==r||e[13]!==o?(m=r&&t.jsx(Ge,{asChild:!0,children:t.jsxs("a",{href:r.url,download:r.filename,children:[t.jsx($s,{size:14}),o("library.cards.download")]})}),e[12]=r,e[13]=o,e[14]=m):m=e[14];let y;e[15]!==n||e[16]!==o?(y=n&&t.jsxs(Ge,{variant:"destructive",onClick:n,children:[t.jsx(Fs,{size:14}),o("library.cards.delete")]}),e[15]=n,e[16]=o,e[17]=y):y=e[17];let x;e[18]!==u||e[19]!==f||e[20]!==m||e[21]!==y?(x=t.jsxs(Kt,{align:"end",onClick:bn,children:[u,f,m,y]}),e[18]=u,e[19]=f,e[20]=m,e[21]=y,e[22]=x):x=e[22];let S;return e[23]!==p||e[24]!==x?(S=t.jsxs(qt,{children:[p,x]}),e[23]=p,e[24]=x,e[25]=S):S=e[25],S}function bn(i){return i.stopPropagation()}function xn(i){return i.stopPropagation()}function rl(i){const e=M.c(44),{size:l,filename:s,downloadUrl:a,subtitle:r,publicState:n,selected:o,compact:c,onOpen:d,onShare:p,onDelete:u,draggable:f,onDragStart:m,onContextMenu:y}=i,x=l===void 0?0:l,S=o===void 0?!1:o,k=c===void 0?!1:c,v=ce();let N;e[0]!==d?(N=A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),d())},e[0]=d,e[1]=N):N=e[1];let D;e[2]!==k||e[3]!==a||e[4]!==s||e[5]!==x?(D=t.jsx(Nn,{filename:s,size:x,downloadUrl:a,compact:k}),e[2]=k,e[3]=a,e[4]=s,e[5]=x,e[6]=D):D=e[6];let j;e[7]!==s?(j=t.jsx(bt,{filename:s,className:"h-5 w-4 shrink-0"}),e[7]=s,e[8]=j):j=e[8];let O;e[9]!==s?(O=t.jsx("span",{className:"truncate text-sm font-medium text-foreground",title:s,children:s}),e[9]=s,e[10]=O):O=e[10];let w;e[11]!==n||e[12]!==v?(w=n&&t.jsx(Je,{state:n,t:v}),e[11]=n,e[12]=v,e[13]=w):w=e[13];let I;e[14]!==O||e[15]!==w?(I=t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[O,w]}),e[14]=O,e[15]=w,e[16]=I):I=e[16];let g;e[17]!==r?(g=t.jsx("span",{className:"text-meta truncate",title:r,children:r}),e[17]=r,e[18]=g):g=e[18];let $;e[19]!==g||e[20]!==I?($=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[I,g]}),e[19]=g,e[20]=I,e[21]=$):$=e[21];let R;e[22]!==a||e[23]!==s?(R={url:a,filename:s},e[22]=a,e[23]=s,e[24]=R):R=e[24];let F;e[25]!==s||e[26]!==u||e[27]!==p||e[28]!==v||e[29]!==R?(F=t.jsx(xt,{label:s,download:R,onShare:p,onDelete:u,t:v}),e[25]=s,e[26]=u,e[27]=p,e[28]=v,e[29]=R,e[30]=F):F=e[30];let B;e[31]!==$||e[32]!==F||e[33]!==j?(B=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 pl-1.5",children:[j,$,F]}),e[31]=$,e[32]=F,e[33]=j,e[34]=B):B=e[34];let z;return e[35]!==f||e[36]!==y||e[37]!==m||e[38]!==d||e[39]!==S||e[40]!==B||e[41]!==N||e[42]!==D?(z=t.jsxs("div",{role:"button",tabIndex:0,"aria-pressed":S,draggable:f,onClick:d,onKeyDown:N,onDragStart:m,onContextMenu:y,className:"group/card surface surface-interactive focus-ring flex min-w-0 cursor-pointer flex-col gap-2.5 p-1.5 pb-2 text-left aria-pressed:bg-accent",children:[D,B]}),e[35]=f,e[36]=y,e[37]=m,e[38]=d,e[39]=S,e[40]=B,e[41]=N,e[42]=D,e[43]=z):z=e[43],z}function ze(i){const e=M.c(4),{children:l,whileVisible:s}=i,a=s===void 0?!1:s,[r,n]=G.useState(!1);let o;e[0]!==a?(o=()=>u=>{if(!u)return;const f=new IntersectionObserver(m=>{const[y]=m;y?.isIntersecting?(n(!0),a||f.disconnect()):a&&n(!1)},{rootMargin:"200px"});return f.observe(u),()=>f.disconnect()},e[0]=a,e[1]=o):o=e[1];const[c]=G.useState(o),d=r&&l;let p;return e[2]!==d?(p=t.jsx("div",{ref:c,className:"h-full w-full",children:d}),e[2]=d,e[3]=p):p=e[3],p}function yn(i){const e=M.c(6),{url:l,filename:s}=i,{data:a}=Se(l);if(a===void 0)return null;if(a===null||!a.trim()){let o;return e[0]!==s?(o=t.jsx(Re,{filename:s}),e[0]=s,e[1]=o):o=e[1],o}let r;e[2]!==a?(r=a.slice(0,2e3),e[2]=a,e[3]=r):r=e[3];let n;return e[4]!==r?(n=t.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:r}),e[4]=r,e[5]=n):n=e[5],n}function gn(i){const e=M.c(6),{url:l,filename:s}=i,{data:a}=Se(l);if(a===void 0)return null;if(a===null||!a.trim()){let o;return e[0]!==s?(o=t.jsx(Re,{filename:s}),e[0]=s,e[1]=o):o=e[1],o}let r;e[2]!==a?(r=a.slice(0,4e3),e[2]=a,e[3]=r):r=e[3];let n;return e[4]!==r?(n=t.jsx("div",{className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 overflow-hidden bg-background p-6 text-sm select-none",children:t.jsx(xs,{children:r})}),e[4]=r,e[5]=n):n=e[5],n}function Re(i){const e=M.c(2),{filename:l}=i;let s;return e[0]!==l?(s=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(bt,{filename:l,className:"h-14 w-11 opacity-60"})}),e[0]=l,e[1]=s):s=e[1],s}function vn(i){const e=M.c(23),{url:l,ext:s}=i;let a;e[0]!==l?(a=he.csvThumb(l),e[0]=l,e[1]=a):a=e[1];let r;e[2]!==l?(r=()=>mn(l,{headers:{Range:"bytes=0-8191"}}),e[2]=l,e[3]=r):r=e[3];let n;e[4]!==a||e[5]!==r?(n={queryKey:a,queryFn:r,staleTime:6e4,retry:!1},e[4]=a,e[5]=r,e[6]=n):n=e[6];const{data:o}=$l(n);if(!o)return null;const c=s==="tsv"?" ":",";let d,p,u,f;if(e[7]!==o||e[8]!==c){f=Symbol.for("react.early_return_sentinel");e:{let S;e[13]!==c?(S=v=>v.split(c).slice(0,6).map(kn),e[13]=c,e[14]=S):S=e[14];const k=o.split(`
|
|
162
|
+
`).filter(Boolean).slice(0,7).map(S);if(k.length===0){f=null;break e}u="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",p="w-full border-collapse",d=k.map(jn)}e[7]=o,e[8]=c,e[9]=d,e[10]=p,e[11]=u,e[12]=f}else d=e[9],p=e[10],u=e[11],f=e[12];if(f!==Symbol.for("react.early_return_sentinel"))return f;let m;e[15]!==d?(m=t.jsx("tbody",{children:d}),e[15]=d,e[16]=m):m=e[16];let y;e[17]!==p||e[18]!==m?(y=t.jsx("table",{className:p,children:m}),e[17]=p,e[18]=m,e[19]=y):y=e[19];let x;return e[20]!==u||e[21]!==y?(x=t.jsx("div",{className:u,children:y}),e[20]=u,e[21]=y,e[22]=x):x=e[22],x}function jn(i,e){return t.jsx("tr",{className:ne(e===0&&"bg-muted/50 font-medium"),children:i.map(wn)},e)}function wn(i,e){return t.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:t.jsx("span",{className:"block truncate",children:i})},e)}function kn(i){return i.trim().replace(/^"|"$/g,"")}function Sn(i){const e=M.c(12),{url:l,filename:s}=i,[a,r]=G.useState(!1);let n;e[0]!==s||e[1]!==a?(n=!a&&t.jsx(Re,{filename:s}),e[0]=s,e[1]=a,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=()=>r(!0),e[3]=o):o=e[3];const c=a?"opacity-100":"opacity-0";let d;e[4]!==c?(d=ne("absolute top-0 left-0 h-[400%] w-[400%] origin-top-left scale-25 border-0 bg-white transition-opacity duration-300",c),e[4]=c,e[5]=d):d=e[5];let p;e[6]!==d||e[7]!==l?(p=t.jsx("iframe",{src:l,title:"","aria-hidden":!0,tabIndex:-1,sandbox:"allow-scripts",onLoad:o,className:d}),e[6]=d,e[7]=l,e[8]=p):p=e[8];let u;return e[9]!==n||e[10]!==p?(u=t.jsxs("div",{className:"pointer-events-none relative h-full w-full overflow-hidden",children:[n,p]}),e[9]=n,e[10]=p,e[11]=u):u=e[11],u}function Nn(i){const e=M.c(26),{filename:l,size:s,downloadUrl:a,compact:r}=i,n=r===void 0?!1:r;let o;if(e[0]!==a||e[1]!==l||e[2]!==s){const u=pn(l);if(cn.has(u)){let f;e[4]!==a?(f=t.jsx("img",{src:a,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=a,e[5]=f):f=e[5],o=f}else if(un.has(u)){const f=`${a}#t=0.1`;let m;e[6]!==f?(m=t.jsx(ze,{children:t.jsx("video",{src:f,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=f,e[7]=m):m=e[7],o=m}else if(u==="pdf"){let f;e[8]!==l?(f=t.jsx(Re,{filename:l}),e[8]=l,e[9]=f):f=e[9],o=f}else if(dn.has(u))o=t.jsx(ze,{children:t.jsx(vn,{url:a,ext:u})});else if(u==="html"||u==="htm"){let f;e[10]!==a||e[11]!==l?(f=t.jsx(ze,{whileVisible:!0,children:t.jsx(Sn,{url:a,filename:l})}),e[10]=a,e[11]=l,e[12]=f):f=e[12],o=f}else if((u==="md"||u==="markdown")&&s<=Rt){let f;e[13]!==a||e[14]!==l?(f=t.jsx(ze,{children:t.jsx(gn,{url:a,filename:l})}),e[13]=a,e[14]=l,e[15]=f):f=e[15],o=f}else if(fn.has(u)&&s<=Rt){let f;e[16]!==a||e[17]!==l?(f=t.jsx(ze,{children:t.jsx(yn,{url:a,filename:l})}),e[16]=a,e[17]=l,e[18]=f):f=e[18],o=f}else{let f;e[19]!==l?(f=t.jsx(Re,{filename:l}),e[19]=l,e[20]=f):f=e[20],o=f}e[0]=a,e[1]=l,e[2]=s,e[3]=o}else o=e[3];const c=n?"aspect-[3/1]":"aspect-[400/265]";let d;e[21]!==c?(d=ne("w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",c),e[21]=c,e[22]=d):d=e[22];let p;return e[23]!==o||e[24]!==d?(p=t.jsx("div",{className:d,children:o}),e[23]=o,e[24]=d,e[25]=p):p=e[25],p}const al={location:"hidden w-32 @2xl/library:table-cell",owner:"hidden w-36 @3xl/library:table-cell",size:"hidden w-20 text-right @xl/library:table-cell",updated:"hidden w-24 text-right @md/library:table-cell",menu:"w-10"},il=G.createContext(!1),ol=G.createContext(!1),cl={location:"hidden w-32 @2xl/library:table-cell",owner:"hidden w-36 @xl/library:table-cell",size:"hidden w-20 @lg/library:table-cell",updated:"hidden w-24 @md/library:table-cell",menu:"w-10"};function Cn(i){const e=M.c(2),{kind:l}=i,s=l==="folder"?mt:l==="skill"?ht:l==="brand"?Ve:ms;let a;return e[0]!==s?(a=t.jsx(s,{size:16,className:"shrink-0 text-muted-foreground"}),e[0]=s,e[1]=a):a=e[1],a}function Pn(i){const e=M.c(5),{kind:l,name:s}=i;if(l==="folder"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(et,{className:"size-5 shrink-0"}),e[0]=r):r=e[0],r}if(l==="skill"||l==="brand"){const r=l==="skill"?ht:Ve;let n;return e[1]!==r?(n=t.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:t.jsx(r,{size:12})}),e[1]=r,e[2]=n):n=e[2],n}let a;return e[3]!==s?(a=t.jsx(bt,{filename:s,className:"h-5 w-4 shrink-0"}),e[3]=s,e[4]=a):a=e[4],a}function Dn(i){const e=M.c(18),{userId:l}=i,s=!!l;let a;e[0]!==s?(a={enabled:s},e[0]=s,e[1]=a):a=e[1];const{data:r}=Tl(a);let n,o;if(e[2]!==r?.data?.members||e[3]!==l){const y=r?.data?.members??[];n=l?y.find(x=>x.userId===l):void 0,o=n?.user?.name?.trim(),e[2]=r?.data?.members,e[3]=l,e[4]=n,e[5]=o}else n=e[4],o=e[5];const c=o;if(!c)return null;const d=n?.user?.image??void 0;let p;e[6]!==c||e[7]!==d?(p=t.jsx(Fl,{url:d,fallback:c,shape:"circle",size:"2xs",className:"shrink-0"}),e[6]=c,e[7]=d,e[8]=p):p=e[8];let u;if(e[9]!==c){let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=/\s+/,e[11]=y):y=e[11],u=c.split(y),e[9]=c,e[10]=u}else u=e[10];let f;e[12]!==u[0]?(f=t.jsx("span",{className:"truncate",children:u[0]}),e[12]=u[0],e[13]=f):f=e[13];let m;return e[14]!==c||e[15]!==p||e[16]!==f?(m=t.jsxs("span",{className:"flex min-w-0 items-center gap-2",title:c,children:[p,f]}),e[14]=c,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function dt(i){const e=M.c(74),{entry:l,publicState:s,secondary:a,selected:r,actions:n}=i,o=r===void 0?!1:r,c=ce();let d;e[0]!==l?(d=Xs(l),e[0]=l,e[1]=d):d=e[1];const p=d,u=G.use(il),f=G.use(ol),m=f?cl:al;let y;e[2]!==n||e[3]!==m.location||e[4]!==f||e[5]!==a||e[6]!==u?(y=u&&t.jsx(Pe,{className:ne(m.location,"truncate text-muted-foreground"),title:a,children:a&&n.onOpenSecondary?t.jsx("button",{type:"button",className:"max-w-full truncate hover:text-foreground hover:underline",onClick:pe=>{pe.stopPropagation(),n.onOpenSecondary?.()},children:a}):a&&f?t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[t.jsx(mt,{size:14,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:a})]}):a}),e[2]=n,e[3]=m.location,e[4]=f,e[5]=a,e[6]=u,e[7]=y):y=e[7];const x=y,S=f?"text-foreground":"text-muted-foreground";let k;e[8]!==m.owner||e[9]!==S?(k=ne(m.owner,S),e[8]=m.owner,e[9]=S,e[10]=k):k=e[10];let v;e[11]!==l.entry.createdBy?(v=t.jsx(Dn,{userId:l.entry.createdBy}),e[11]=l.entry.createdBy,e[12]=v):v=e[12];let N;e[13]!==k||e[14]!==v?(N=t.jsx(Pe,{className:k,children:v}),e[13]=k,e[14]=v,e[15]=N):N=e[15];const D=N;let j;e[16]!==m.size?(j=ne(m.size,"tabular-nums text-muted-foreground"),e[16]=m.size,e[17]=j):j=e[17];const O=p??"";let w;e[18]!==j||e[19]!==O?(w=t.jsx(Pe,{className:j,children:O}),e[18]=j,e[19]=O,e[20]=w):w=e[20];const I=w;let g;e[21]!==m.updated?(g=ne(m.updated,"tabular-nums text-muted-foreground"),e[21]=m.updated,e[22]=g):g=e[22];let $;e[23]!==l.updatedAt?($=ft(l.updatedAt),e[23]=l.updatedAt,e[24]=$):$=e[24];let R;e[25]!==g||e[26]!==$?(R=t.jsx(Pe,{className:g,children:$}),e[25]=g,e[26]=$,e[27]=R):R=e[27];const F=R,B=o?"selected":void 0,z=n.draggable,A=n.onOpen,E=n.onDragStart,U=n.onContextMenu,P=n.onDrop?On:void 0,V=n.onDrop;let T;e[28]!==l.kind||e[29]!==l.name||e[30]!==f?(T=f?t.jsx(Cn,{kind:l.kind}):t.jsx(Pn,{kind:l.kind,name:l.name}),e[28]=l.kind,e[29]=l.name,e[30]=f,e[31]=T):T=e[31];const L=f&&"font-medium";let X;e[32]!==L?(X=ne("truncate text-foreground",L),e[32]=L,e[33]=X):X=e[33];let W;e[34]!==l.name||e[35]!==X?(W=t.jsx("span",{className:X,title:l.name,children:l.name}),e[34]=l.name,e[35]=X,e[36]=W):W=e[36];let _;e[37]!==s||e[38]!==c?(_=s&&t.jsx(Je,{state:s,t:c}),e[37]=s,e[38]=c,e[39]=_):_=e[39];let q;e[40]!==T||e[41]!==W||e[42]!==_?(q=t.jsx(Pe,{className:"min-w-0 max-w-0 pl-4",children:t.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[T,W,_]})}),e[40]=T,e[41]=W,e[42]=_,e[43]=q):q=e[43];let H;e[44]!==x||e[45]!==D||e[46]!==f||e[47]!==I||e[48]!==F?(H=f?t.jsxs(t.Fragment,{children:[F,I,D,x]}):t.jsxs(t.Fragment,{children:[x,D,I,F]}),e[44]=x,e[45]=D,e[46]=f,e[47]=I,e[48]=F,e[49]=H):H=e[49];let J;e[50]!==m.menu?(J=ne(m.menu,"pr-2 text-right"),e[50]=m.menu,e[51]=J):J=e[51];let Y;e[52]!==n.download||e[53]!==n.onBrowse||e[54]!==n.onDelete||e[55]!==n.onShare||e[56]!==l.name||e[57]!==c?(Y=t.jsx(xt,{label:l.name,onBrowse:n.onBrowse,onShare:n.onShare,download:n.download,onDelete:n.onDelete,t:c}),e[52]=n.download,e[53]=n.onBrowse,e[54]=n.onDelete,e[55]=n.onShare,e[56]=l.name,e[57]=c,e[58]=Y):Y=e[58];let te;e[59]!==J||e[60]!==Y?(te=t.jsx(Pe,{className:J,children:Y}),e[59]=J,e[60]=Y,e[61]=te):te=e[61];let se;return e[62]!==n.draggable||e[63]!==n.onContextMenu||e[64]!==n.onDragStart||e[65]!==n.onDrop||e[66]!==n.onOpen||e[67]!==o||e[68]!==B||e[69]!==P||e[70]!==q||e[71]!==H||e[72]!==te?(se=t.jsxs(ll,{"data-state":B,"aria-selected":o,className:"group/card cursor-pointer hover:bg-accent",draggable:z,onClick:A,onDragStart:E,onContextMenu:U,onDragOver:P,onDrop:V,children:[q,H,te]}),e[62]=n.draggable,e[63]=n.onContextMenu,e[64]=n.onDragStart,e[65]=n.onDrop,e[66]=n.onOpen,e[67]=o,e[68]=B,e[69]=P,e[70]=q,e[71]=H,e[72]=te,e[73]=se):se=e[73],se}function On(i){return i.preventDefault()}function st(i){const e=M.c(11),{label:l,active:s,descending:a,className:r,onClick:n}=i,o=a?zs:Es,c=s?"text-foreground":"text-muted-foreground";let d;e[0]!==r||e[1]!==c?(d=ne("flex items-center gap-1 truncate font-medium transition-colors hover:text-foreground",c,r),e[0]=r,e[1]=c,e[2]=d):d=e[2];let p;e[3]!==o||e[4]!==s?(p=s&&t.jsx(o,{size:11,className:"shrink-0"}),e[3]=o,e[4]=s,e[5]=p):p=e[5];let u;return e[6]!==l||e[7]!==n||e[8]!==d||e[9]!==p?(u=t.jsxs("button",{type:"button",onClick:n,className:d,children:[l,p]}),e[6]=l,e[7]=n,e[8]=d,e[9]=p,e[10]=u):u=e[10],u}function dl(i){const e=M.c(67),{sort:l,onSort:s,locationLabel:a,plain:r,children:n}=i,o=r===void 0?!1:r,c=ce(),d=o?cl:al,p=o?"font-normal":"ml-auto";let u;e[0]!==d.location||e[1]!==a?(u=a&&t.jsx(De,{className:d.location,children:a}),e[0]=d.location,e[1]=a,e[2]=u):u=e[2];const f=u,m=d.owner;let y;e[3]!==c?(y=c("library.entries.createdBy"),e[3]=c,e[4]=y):y=e[4];let x;e[5]!==d.owner||e[6]!==y?(x=t.jsx(De,{className:m,children:y}),e[5]=d.owner,e[6]=y,e[7]=x):x=e[7];const S=x,k=d.size;let v;e[8]!==c?(v=c("library.entries.size"),e[8]=c,e[9]=v):v=e[9];const N=l==="size";let D;e[10]!==s?(D=()=>s("size"),e[10]=s,e[11]=D):D=e[11];let j;e[12]!==p||e[13]!==v||e[14]!==N||e[15]!==D?(j=t.jsx(st,{label:v,active:N,descending:!0,className:p,onClick:D}),e[12]=p,e[13]=v,e[14]=N,e[15]=D,e[16]=j):j=e[16];let O;e[17]!==d.size||e[18]!==j?(O=t.jsx(De,{className:k,children:j}),e[17]=d.size,e[18]=j,e[19]=O):O=e[19];const w=O,I=d.updated;let g;e[20]!==c?(g=c("library.library.updated"),e[20]=c,e[21]=g):g=e[21];const $=l==="updated";let R;e[22]!==s?(R=()=>s("updated"),e[22]=s,e[23]=R):R=e[23];let F;e[24]!==p||e[25]!==g||e[26]!==$||e[27]!==R?(F=t.jsx(st,{label:g,active:$,descending:!0,className:p,onClick:R}),e[24]=p,e[25]=g,e[26]=$,e[27]=R,e[28]=F):F=e[28];let B;e[29]!==d.updated||e[30]!==F?(B=t.jsx(De,{className:I,children:F}),e[29]=d.updated,e[30]=F,e[31]=B):B=e[31];const z=B,A=o&&"table-fixed";let E;e[32]!==A?(E=ne(A),e[32]=A,e[33]=E):E=e[33];let U;e[34]!==c?(U=c("library.library.name"),e[34]=c,e[35]=U):U=e[35];const P=l==="name",V=o&&"font-normal";let T;e[36]!==V?(T=ne(V),e[36]=V,e[37]=T):T=e[37];let L;e[38]!==s?(L=()=>s("name"),e[38]=s,e[39]=L):L=e[39];let X;e[40]!==U||e[41]!==P||e[42]!==T||e[43]!==L?(X=t.jsx(De,{className:"pl-4",children:t.jsx(st,{label:U,active:P,className:T,onClick:L})}),e[40]=U,e[41]=P,e[42]=T,e[43]=L,e[44]=X):X=e[44];let W;e[45]!==f||e[46]!==S||e[47]!==o||e[48]!==w||e[49]!==z?(W=o?t.jsxs(t.Fragment,{children:[z,w,S,f]}):t.jsxs(t.Fragment,{children:[f,S,w,z]}),e[45]=f,e[46]=S,e[47]=o,e[48]=w,e[49]=z,e[50]=W):W=e[50];let _;e[51]!==d.menu?(_=t.jsx(De,{className:d.menu}),e[51]=d.menu,e[52]=_):_=e[52];let q;e[53]!==X||e[54]!==W||e[55]!==_?(q=t.jsx(Ms,{children:t.jsxs(ll,{children:[X,W,_]})}),e[53]=X,e[54]=W,e[55]=_,e[56]=q):q=e[56];const H=!!a;let J;e[57]!==n||e[58]!==H?(J=t.jsx(il,{value:H,children:n}),e[57]=n,e[58]=H,e[59]=J):J=e[59];let Y;e[60]!==o||e[61]!==J?(Y=t.jsx(Bs,{children:t.jsx(ol,{value:o,children:J})}),e[60]=o,e[61]=J,e[62]=Y):Y=e[62];let te;return e[63]!==E||e[64]!==q||e[65]!==Y?(te=t.jsx("div",{className:"@container/library min-w-0",children:t.jsxs(As,{className:E,children:[q,Y]})}),e[63]=E,e[64]=q,e[65]=Y,e[66]=te):te=e[66],te}const ul=24;function $n(i){return i?i<=2?1:i<=8?2:3:0}function Ae(i){const e=M.c(44),{name:l,meta:s,icon:a,glyph:r,tone:n,readOnly:o,overlay:c,badge:d,counts:p,onOpen:u,onBrowse:f,onShare:m,onDelete:y,draggable:x,onDragStart:S,onContextMenu:k,onDrop:v}=i,N=ce(),D=!!p&&p.enabled;let j;e[0]!==D?(j={enabled:D},e[0]=D,e[1]=j):j=e[1];const O=Ze(p?.volume??"",p?.path??"",j),w=p?O.data?.length:void 0;let I;e[2]!==w||e[3]!==s||e[4]!==N?(I=s??(w===void 0?void 0:w===0?N("library.entries.emptyFolder"):w===1?N("library.entries.itemCount"):N("library.entries.itemsCount",{count:w})),e[2]=w,e[3]=s,e[4]=N,e[5]=I):I=e[5];const g=I;let $;e[6]!==u?($=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),u())},e[6]=u,e[7]=$):$=e[7];const R=v?Tn:void 0;let F;e[8]!==w||e[9]!==r||e[10]!==a||e[11]!==o||e[12]!==n?(F=a??t.jsx(et,{glyph:r,tone:n,readOnly:o,sheets:$n(w),className:"size-6"}),e[8]=w,e[9]=r,e[10]=a,e[11]=o,e[12]=n,e[13]=F):F=e[13];let B;e[14]!==c?(B=c&&t.jsx("span",{className:"absolute -right-1.5 -bottom-1 flex rounded-lg ring-2 ring-card",children:c}),e[14]=c,e[15]=B):B=e[15];let z;e[16]!==F||e[17]!==B?(z=t.jsxs("span",{className:"relative flex shrink-0",children:[F,B]}),e[16]=F,e[17]=B,e[18]=z):z=e[18];let A;e[19]!==l?(A=t.jsx("span",{className:"truncate text-sm font-medium text-foreground",title:l,children:l}),e[19]=l,e[20]=A):A=e[20];let E;e[21]!==d||e[22]!==A?(E=t.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[A,d]}),e[21]=d,e[22]=A,e[23]=E):E=e[23];let U;e[24]!==g?(U=g&&t.jsx("span",{className:"text-meta shrink-0 group-hover/card:hidden group-has-[[data-state=open]]/card:hidden",children:g}),e[24]=g,e[25]=U):U=e[25];let P;e[26]!==l||e[27]!==f||e[28]!==y||e[29]!==m||e[30]!==N?(P=t.jsx(xt,{label:l,onBrowse:f,onShare:m,onDelete:y,t:N}),e[26]=l,e[27]=f,e[28]=y,e[29]=m,e[30]=N,e[31]=P):P=e[31];let V;return e[32]!==x||e[33]!==k||e[34]!==S||e[35]!==v||e[36]!==u||e[37]!==E||e[38]!==U||e[39]!==P||e[40]!==$||e[41]!==R||e[42]!==z?(V=t.jsxs("div",{role:"button",tabIndex:0,draggable:x,onClick:u,onKeyDown:$,onDragStart:S,onContextMenu:k,onDragOver:R,onDrop:v,className:"group/card surface surface-interactive focus-ring relative flex h-12 min-w-0 cursor-pointer items-center gap-2.5 pr-1.5 pl-3",children:[z,E,U,P]}),e[32]=x,e[33]=k,e[34]=S,e[35]=v,e[36]=u,e[37]=E,e[38]=U,e[39]=P,e[40]=$,e[41]=R,e[42]=z,e[43]=V):V=e[43],V}function Tn(i){return i.preventDefault()}function yt(i){const e=M.c(2),{children:l}=i;let s;return e[0]!==l?(s=t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2",children:l}),e[0]=l,e[1]=s):s=e[1],s}function Fn(i){return`${i.volume}/${Qt(i.path)}`}function zn(i,e){const l=new Map;for(const s of i){if(!ct(s.path,"documents")&&!ct(s.path,"media"))continue;const a=Fn(s),r=l.get(a);r?r.more+=1:l.set(a,{entry:s,more:0})}return[...l.values()].slice(0,e)}function gt(i){return`${window.location.origin}${i}`}function we(i){if(i.shareMode==="password")return"password";if(i.shareMode==="public"||i.readPublic)return"public";if(i.effectivePublic)return"inherited"}const En=[be,"uploads","outputs"],fl=["uploads","outputs"],ut=new Set([...fl,Le,Xe("public")]),Mn=4;function vt(i,e,l){const s=Qt(e);if(s)return Xe(re(s));const a=Yt(i);return a||(i===be?pt(l):i)}function Ee(i,e,l){return{onDragStart:s=>{l.onDragStart?.(i),s.dataTransfer.effectAllowed="move",s.dataTransfer.setData("application/x-studio-library-path",i)},onContextMenu:s=>{s.preventDefault(),l.onContextMenu?.(i,e)},onDrop:l.onDrop?s=>{s.preventDefault();const a=s.dataTransfer.getData("application/x-studio-library-path");a&&a!==i&&!i.startsWith(a+"/")&&l.onDrop(a,i)}:void 0}}function Ue(i,e){return ct(i.path,e.fileView)&&Hs(i.updatedAt,e.modified)}function Bn(i){const e=M.c(17),{layout:l,onChange:s}=i,a=ce();let r;e[0]!==s?(r=m=>{(m==="list"||m==="grid")&&s(m)},e[0]=s,e[1]=r):r=e[1];let n;e[2]!==a?(n=a("library.entries.listView"),e[2]=a,e[3]=n):n=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ns,{}),e[4]=o):o=e[4];let c;e[5]!==n?(c=t.jsx(Lt,{value:"list",tooltip:n,children:o}),e[5]=n,e[6]=c):c=e[6];let d;e[7]!==a?(d=a("library.entries.gridView"),e[7]=a,e[8]=d):d=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Cs,{}),e[9]=p):p=e[9];let u;e[10]!==d?(u=t.jsx(Lt,{value:"grid",tooltip:d,children:p}),e[10]=d,e[11]=u):u=e[11];let f;return e[12]!==l||e[13]!==r||e[14]!==c||e[15]!==u?(f=t.jsxs(Ps,{type:"single",variant:"segmented",size:"sm",value:l,onValueChange:r,children:[c,u]}),e[12]=l,e[13]=r,e[14]=c,e[15]=u,e[16]=f):f=e[16],f}function An(i){const e=M.c(8),{label:l,count:s,action:a}=i;let r;e[0]!==s?(r=s!==void 0&&s>0&&t.jsx("span",{className:"text-meta",children:s}),e[0]=s,e[1]=r):r=e[1];let n;e[2]!==l||e[3]!==r?(n=t.jsxs("h2",{className:"flex items-baseline gap-2 text-sm font-medium text-foreground",children:[l,r]}),e[2]=l,e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=t.jsxs("div",{className:"flex h-7 items-center justify-between gap-3",children:[n,a]}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Ke(i){const e=M.c(7),{label:l,count:s,action:a,children:r}=i;let n;e[0]!==a||e[1]!==s||e[2]!==l?(n=t.jsx(An,{label:l,count:s,action:a}),e[0]=a,e[1]=s,e[2]=l,e[3]=n):n=e[3];let o;return e[4]!==r||e[5]!==n?(o=t.jsxs("section",{className:"flex flex-col gap-3",children:[n,r]}),e[4]=r,e[5]=n,e[6]=o):o=e[6],o}function pl(i){const e=M.c(2),{children:l}=i;let s;return e[0]!==l?(s=t.jsx("div",{className:"@container",children:t.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3 @[980px]:grid-cols-4",children:l})}),e[0]=l,e[1]=s):s=e[1],s}function Ln(i){const e=M.c(2),{rows:l}=i,s=l===void 0?1:l;let a;return e[0]!==s?(a=t.jsx(pl,{children:Array.from({length:s*3},In)}),e[0]=s,e[1]=a):a=e[1],a}function In(i,e){return t.jsx(ve,{className:"h-16 rounded-2xl"},e)}function Vn(i){const e=M.c(2),{rows:l}=i,s=l===void 0?6:l;let a;return e[0]!==s?(a=t.jsx("div",{className:"flex flex-col gap-px",children:Array.from({length:s},Rn)}),e[0]=s,e[1]=a):a=e[1],a}function Rn(i,e){return t.jsx(ve,{className:"h-11 rounded-lg"},e)}function tt(i){const e=M.c(2),{layout:l}=i;let s;return e[0]!==l?(s=l==="grid"?t.jsx(Ln,{rows:2}):t.jsx(Vn,{}),e[0]=l,e[1]=s):s=e[1],s}function jt(i){const e=M.c(2),{children:l}=i;let s;return e[0]!==l?(s=t.jsx("p",{className:"text-sm text-muted-foreground",children:l}),e[0]=l,e[1]=s):s=e[1],s}function wt(i){const e=M.c(24),{entry:l,view:s,secondary:a,publicState:r,downloadUrl:n,selected:o,actions:c}=i;if(s.layout==="list"){let x;return e[0]!==c||e[1]!==l||e[2]!==r||e[3]!==a||e[4]!==o?(x=t.jsx(dt,{entry:l,selected:o,secondary:a,publicState:r,actions:c}),e[0]=c,e[1]=l,e[2]=r,e[3]=a,e[4]=o,e[5]=x):x=e[5],x}const d=l.size,p=l.name;let u;e[6]!==l.name||e[7]!==a?(u=a??Ds(l.name),e[6]=l.name,e[7]=a,e[8]=u):u=e[8];let f;e[9]!==l.updatedAt?(f=ft(l.updatedAt),e[9]=l.updatedAt,e[10]=f):f=e[10];const m=`${u} · ${f}`;let y;return e[11]!==c.draggable||e[12]!==c.onContextMenu||e[13]!==c.onDelete||e[14]!==c.onDragStart||e[15]!==c.onOpen||e[16]!==c.onShare||e[17]!==n||e[18]!==l.name||e[19]!==l.size||e[20]!==r||e[21]!==o||e[22]!==m?(y=t.jsx(rl,{size:d,filename:p,downloadUrl:n,subtitle:m,publicState:r,selected:o,onOpen:c.onOpen,onShare:c.onShare,onDelete:c.onDelete,draggable:c.draggable,onDragStart:c.onDragStart,onContextMenu:c.onContextMenu}),e[11]=c.draggable,e[12]=c.onContextMenu,e[13]=c.onDelete,e[14]=c.onDragStart,e[15]=c.onOpen,e[16]=c.onShare,e[17]=n,e[18]=l.name,e[19]=l.size,e[20]=r,e[21]=o,e[22]=m,e[23]=y):y=e[23],y}function kt(i){const e=M.c(17),{view:l,count:s,label:a,locationLabel:r,note:n,children:o}=i,c=ce();let d;e[0]!==a||e[1]!==c?(d=a??c("library.libraryViews.files"),e[0]=a,e[1]=c,e[2]=d):d=e[2];let p;e[3]!==n?(p=n&&t.jsx("span",{className:"text-meta",children:n}),e[3]=n,e[4]=p):p=e[4];let u;e[5]!==o||e[6]!==r||e[7]!==l.flat||e[8]!==l.layout||e[9]!==l.onSort||e[10]!==l.sort?(u=l.layout==="grid"?t.jsx(pl,{children:o}):t.jsx(dl,{sort:l.sort,onSort:l.onSort,locationLabel:r,plain:l.flat,children:o}),e[5]=o,e[6]=r,e[7]=l.flat,e[8]=l.layout,e[9]=l.onSort,e[10]=l.sort,e[11]=u):u=e[11];let f;return e[12]!==s||e[13]!==d||e[14]!==p||e[15]!==u?(f=t.jsx(Ke,{label:d,count:s,action:p,children:u}),e[12]=s,e[13]=d,e[14]=p,e[15]=u,e[16]=f):f=e[16],f}function Ut(i){const e=M.c(2),{Glyph:l}=i;let s;return e[0]!==l?(s=t.jsx("span",{className:"flex size-6 items-center justify-center rounded-md bg-primary/10 text-primary",children:t.jsx(l,{className:"size-3.5"})}),e[0]=l,e[1]=s):s=e[1],s}function Un(){const i=M.c(2),e=Ss();let l;if(i[0]!==e){l=new Map;for(const s of Ls(e))l.set(Jl(s),s);i[0]=e,i[1]=l}else l=i[1];return l}function _n(i){const e=M.c(54),{query:l,scope:s,stale:a,view:r,onOpenFile:n,onShare:o,onDelete:c}=i,d=ce(),{org:p}=_e(),u=He(),f=rs(l,s);let m;e[0]!==u||e[1]!==o?(m=g=>o({volume:g.volume,path:g.path,kind:"file",shareMode:g.shareMode??"private",effectivePublic:g.effectivePublic??!1,url:gt(u(g.volume,g.path))}),e[0]=u,e[1]=o,e[2]=m):m=e[2];const y=m;if(f.isPending){let g;return e[3]!==r.layout?(g=t.jsx(tt,{layout:r.layout}),e[3]=r.layout,e[4]=g):g=e[4],g}let x,S,k,v,N,D,j,O;if(e[5]!==u||e[6]!==c||e[7]!==n||e[8]!==p||e[9]!==l||e[10]!==f.data||e[11]!==f.isPlaceholderData||e[12]!==y||e[13]!==a||e[14]!==d||e[15]!==r){O=Symbol.for("react.early_return_sentinel");e:{let g;e[24]!==r?(g=z=>Ue(z,r),e[24]=r,e[25]=g):g=e[25];const $=(f.data??[]).filter(g);if($.length===0){let z;e[26]!==l||e[27]!==d?(z=d("library.libraryViews.noFilesMatch",{query:l}),e[26]=l,e[27]=d,e[28]=z):z=e[28];let A;e[29]!==z?(A=t.jsx(jt,{children:z}),e[29]=z,e[30]=A):A=e[30],O=A;break e}const R=We($.map(Be),r.sort).map(z=>({item:z,hit:$.find(A=>A.path===z.path)})),F=(a||f.isPlaceholderData)&&"opacity-50";e[31]!==F?(j=ne(F),e[31]=F,e[32]=j):j=e[32],x=kt,S=r,e[33]!==d?(k=d("library.libraryViews.results"),e[33]=d,e[34]=k):k=e[34],e[35]!==d?(v=d("library.entries.location"),e[35]=d,e[36]=v):v=e[36],N=$.length;let B;e[37]!==u||e[38]!==c||e[39]!==n||e[40]!==p||e[41]!==y||e[42]!==r?(B=z=>{const{item:A,hit:E}=z,U=Yt(E.volume)!==null,P=u(E.volume,E.path),V=Ie(E.volume,E.path);return t.jsx(wt,{entry:A,view:r,selected:r.previewPath===V,secondary:vt(E.volume,E.path,p.slug),publicState:we(E),downloadUrl:P,actions:{onOpen:()=>n(V),download:{url:P,filename:A.name},onShare:U?void 0:()=>y(E),onDelete:U?void 0:()=>c({volume:E.volume,path:E.path,kind:"file"})}},`${E.volume}/${E.path}`)},e[37]=u,e[38]=c,e[39]=n,e[40]=p,e[41]=y,e[42]=r,e[43]=B):B=e[43],D=R.map(B)}e[5]=u,e[6]=c,e[7]=n,e[8]=p,e[9]=l,e[10]=f.data,e[11]=f.isPlaceholderData,e[12]=y,e[13]=a,e[14]=d,e[15]=r,e[16]=x,e[17]=S,e[18]=k,e[19]=v,e[20]=N,e[21]=D,e[22]=j,e[23]=O}else x=e[16],S=e[17],k=e[18],v=e[19],N=e[20],D=e[21],j=e[22],O=e[23];if(O!==Symbol.for("react.early_return_sentinel"))return O;let w;e[44]!==x||e[45]!==S||e[46]!==k||e[47]!==v||e[48]!==N||e[49]!==D?(w=t.jsx(x,{view:S,label:k,locationLabel:v,count:N,children:D}),e[44]=x,e[45]=S,e[46]=k,e[47]=v,e[48]=N,e[49]=D,e[50]=w):w=e[50];let I;return e[51]!==j||e[52]!==w?(I=t.jsx("div",{className:j,children:w}),e[51]=j,e[52]=w,e[53]=I):I=e[53],I}function Hn(i){const e=M.c(34),{view:l,onOpenFile:s}=i,a=ce(),{org:r}=_e(),n=Wt(),o=He();if(n.isPending)return null;let c,d,p,u,f,m;if(e[0]!==o||e[1]!==s||e[2]!==r||e[3]!==n.data||e[4]!==a||e[5]!==l){m=Symbol.for("react.early_return_sentinel");e:{let k;e[12]!==l?(k=O=>Ue(O,l),e[12]=l,e[13]=k):k=e[13];const v=zn((n.data??[]).filter(k),Mn);if(v.length===0){m=null;break e}let N;e[14]!==r||e[15]!==a?(N=(O,w)=>[vt(O.volume,O.path,r.slug),ft(O.updatedAt),w>0&&a("library.libraryViews.moreInFolder",{count:w})].filter(Boolean).join(" · "),e[14]=r,e[15]=a,e[16]=N):N=e[16];const D=N;c=Ke,e[17]!==a?(f=a("library.libraryViews.recent"),e[17]=a,e[18]=f):f=e[18],u="@container",d="grid grid-cols-2 gap-3 @[720px]:grid-cols-4";let j;e[19]!==D||e[20]!==o||e[21]!==s||e[22]!==l?(j=O=>{const{entry:w,more:I}=O,g=Ie(w.volume,w.path),$=re(w.path);return t.jsx(rl,{size:w.size,filename:$,downloadUrl:o(w.volume,w.path),subtitle:D(w,I),publicState:we(w),selected:l.previewPath===g,compact:!0,onOpen:()=>s(g)},`${w.volume}/${w.path}`)},e[19]=D,e[20]=o,e[21]=s,e[22]=l,e[23]=j):j=e[23],p=v.map(j)}e[0]=o,e[1]=s,e[2]=r,e[3]=n.data,e[4]=a,e[5]=l,e[6]=c,e[7]=d,e[8]=p,e[9]=u,e[10]=f,e[11]=m}else c=e[6],d=e[7],p=e[8],u=e[9],f=e[10],m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m;let y;e[24]!==d||e[25]!==p?(y=t.jsx("div",{className:d,children:p}),e[24]=d,e[25]=p,e[26]=y):y=e[26];let x;e[27]!==u||e[28]!==y?(x=t.jsx("div",{className:u,children:y}),e[27]=u,e[28]=y,e[29]=x):x=e[29];let S;return e[30]!==c||e[31]!==f||e[32]!==x?(S=t.jsx(c,{label:f,children:x}),e[30]=c,e[31]=f,e[32]=x,e[33]=S):S=e[33],S}const Kn=new Set(fl);function _t(i){return i!==null&&Kn.has(i)}function qn(i){const e=M.c(52),{volume:l,view:s,onOpenDir:a,onOpenFile:r,onShare:n,onDelete:o,emptyActions:c}=i,d=ce(),p=He(),u=as(l),f=Ze(l,""),{navigateToTask:m}=ts();if(u.isPending||f.isPending){let g;return e[0]!==s.layout?(g=t.jsx(tt,{layout:s.layout}),e[0]=s.layout,e[1]=g):g=e[1],g}const y=u.error??f.error;if(y){let g;e[2]!==y||e[3]!==d?(g=y instanceof Error?y.message:d("library.libraryViews.failedToLoad"),e[2]=y,e[3]=d,e[4]=g):g=e[4];let $;return e[5]!==g?($=t.jsx("p",{className:"text-sm text-destructive",children:g}),e[5]=g,e[6]=$):$=e[6],$}let x,S,k,v,N,D,j;if(e[7]!==c||e[8]!==p||e[9]!==m||e[10]!==o||e[11]!==a||e[12]!==r||e[13]!==n||e[14]!==f.data||e[15]!==d||e[16]!==s||e[17]!==l||e[18]!==u.data?.pages){j=Symbol.for("react.early_return_sentinel");e:{const g=u.data?.pages??[],$=g.flatMap(Yn),R=Object.assign({},...g.map(Qn)),F=new Map($.map(P=>[P.path,P.sourceThreadId?{id:P.sourceThreadId,...R[P.sourceThreadId]}:void 0]));let B;e[26]!==s?(B=P=>Ue(P,s),e[26]=s,e[27]=B):B=e[27];const z=$.filter(B),A=(f.data??[]).filter(Gn);if(z.length===0&&A.length===0){let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(et,{className:"size-16"}),e[28]=P):P=e[28];let V;e[29]!==d?(V=d("library.libraryViews.emptyFolder"),e[29]=d,e[30]=V):V=e[30];let T;e[31]!==d?(T=d("library.libraryViews.emptyFolderHint"),e[31]=d,e[32]=T):T=e[32];let L;e[33]!==c||e[34]!==T||e[35]!==V?(L=t.jsx("div",{className:"rounded-2xl border border-dashed border-border",children:t.jsx(tl,{illustration:P,title:V,description:T,buttonComponent:c})}),e[33]=c,e[34]=T,e[35]=V,e[36]=L):L=e[36],j=L;break e}const E=A.length>0&&t.jsx(Ke,{label:d("library.libraryViews.folders"),count:A.length,children:t.jsx(yt,{children:A.map((P,V)=>t.jsx(Ae,{name:re(P.path),counts:{volume:l,path:P.path,enabled:V<ul},onOpen:()=>a(Ie(l,P.path)),onDelete:()=>o({volume:l,path:P.path,kind:"dir"})},P.path))})});if(z.length===0){j=E;break e}const U=We(z.map(Be),s.sort);D=E,x=kt,S=s,k=z.length,e[37]!==d?(v=d("library.libraryViews.sourceChat"),e[37]=d,e[38]=v):v=e[38],N=U.map(P=>{const V=Ie(l,P.path),T=p(l,P.path),L=F.get(P.path);return t.jsx(wt,{entry:P,view:s,secondary:L?.title,selected:s.previewPath===V,publicState:we(P.entry),downloadUrl:T,actions:{onOpen:()=>r(V),onOpenSecondary:L?.agentId!==void 0?()=>m(L.id,{virtualMcpId:L.agentId}):void 0,download:{url:T,filename:P.name},onShare:()=>n({volume:l,path:P.path,kind:"file",shareMode:P.entry.shareMode??"private",effectivePublic:P.entry.effectivePublic??!1,url:gt(T)}),onDelete:()=>o({volume:l,path:P.path,kind:"file"})}},P.path)})}e[7]=c,e[8]=p,e[9]=m,e[10]=o,e[11]=a,e[12]=r,e[13]=n,e[14]=f.data,e[15]=d,e[16]=s,e[17]=l,e[18]=u.data?.pages,e[19]=x,e[20]=S,e[21]=k,e[22]=v,e[23]=N,e[24]=D,e[25]=j}else x=e[19],S=e[20],k=e[21],v=e[22],N=e[23],D=e[24],j=e[25];if(j!==Symbol.for("react.early_return_sentinel"))return j;let O;e[39]!==x||e[40]!==S||e[41]!==k||e[42]!==v||e[43]!==N?(O=t.jsx(x,{view:S,count:k,locationLabel:v,children:N}),e[39]=x,e[40]=S,e[41]=k,e[42]=v,e[43]=N,e[44]=O):O=e[44];let w;e[45]!==d||e[46]!==u?(w=u.hasNextPage&&t.jsx(ie,{variant:"outline",className:"self-center",disabled:u.isFetchingNextPage,onClick:()=>{u.fetchNextPage()},children:d("library.libraryViews.loadMore")}),e[45]=d,e[46]=u,e[47]=w):w=e[47];let I;return e[48]!==D||e[49]!==O||e[50]!==w?(I=t.jsxs(t.Fragment,{children:[D,O,w]}),e[48]=D,e[49]=O,e[50]=w,e[51]=I):I=e[51],I}function Gn(i){return i.kind==="dir"&&!Wl(re(i.path))}function Qn(i){return i.threads}function Yn(i){return i.entries}function Xn(i){const e=M.c(21),{view:l,onOpenDir:s}=i,a=ce(),r=Xt();if(r.isPending){let m;return e[0]!==l.layout?(m=t.jsx(tt,{layout:l.layout}),e[0]=l.layout,e[1]=m):m=e[1],m}let n;e[2]!==r.data?(n=r.data??[],e[2]=r.data,e[3]=n):n=e[3];const o=n;if(o.length===0){let m;e[4]!==a?(m=a("library.libraryViews.noPublicSkillSetsConfigured"),e[4]=a,e[5]=m):m=e[5];let y;return e[6]!==m?(y=t.jsx(jt,{children:m}),e[6]=m,e[7]=y):y=e[7],y}let c;e[8]!==a?(c=a("library.libraryViews.folders"),e[8]=a,e[9]=c):c=e[9];const d=o.length;let p;if(e[10]!==s||e[11]!==o){let m;e[13]!==s?(m=y=>t.jsx(Ae,{name:y,readOnly:!0,counts:{volume:`public-${y}`,path:"",enabled:!0},onOpen:()=>s(`public/${y}`)},y),e[13]=s,e[14]=m):m=e[14],p=o.map(m),e[10]=s,e[11]=o,e[12]=p}else p=e[12];let u;e[15]!==p?(u=t.jsx(yt,{children:p}),e[15]=p,e[16]=u):u=e[16];let f;return e[17]!==o.length||e[18]!==c||e[19]!==u?(f=t.jsx(Ke,{label:c,count:d,children:u}),e[17]=o.length,e[18]=c,e[19]=u,e[20]=f):f=e[20],f}function Wn(i){const e=M.c(86),{location:l,root:s,onOpenDir:a,view:r,onOpenFile:n,onOpenSkill:o,onOpenBrand:c,onShare:d,onDelete:p,onDragStart:u,onContextMenu:f,onMove:m,emptyActions:y}=i,x=ce(),{org:S}=_e(),k=l.volume??"",v=Ze(k,l.dirPath),N=He(),D=Un(),j=l.isHomeRoot&&s===be,O=k===be&&l.dirPath===Le;let w;e[0]!==j||e[1]!==S?(w=T=>j&&ut.has(T.toLowerCase())?`${pt(S.slug)}/${T}`:void 0,e[0]=j,e[1]=S,e[2]=w):w=e[2];const I=w,g=j&&!!r.flat;let $;e[3]!==g?($={enabled:g},e[3]=g,e[4]=$):$=e[4];const R=Wt(void 0,$);let F;e[5]!==g||e[6]!==j||e[7]!==n||e[8]!==r?(F=j&&!g?t.jsx(Hn,{view:r,onOpenFile:n}):null,e[5]=g,e[6]=j,e[7]=n,e[8]=r,e[9]=F):F=e[9];const B=F;if(v.isPending){let T;e[10]!==r.layout?(T=t.jsx(tt,{layout:r.layout}),e[10]=r.layout,e[11]=T):T=e[11];let L;return e[12]!==B||e[13]!==T?(L=t.jsxs(t.Fragment,{children:[B,T]}),e[12]=B,e[13]=T,e[14]=L):L=e[14],L}if(v.isError){let T;e[15]!==v.error||e[16]!==x?(T=v.error instanceof Error?v.error.message:x("library.libraryViews.failedToLoad"),e[15]=v.error,e[16]=x,e[17]=T):T=e[17];let L;return e[18]!==T?(L=t.jsx("p",{className:"text-sm text-destructive",children:T}),e[18]=T,e[19]=L):L=e[19],L}let z,A,E,U;if(e[20]!==I||e[21]!==y||e[22]!==N||e[23]!==g||e[24]!==O||e[25]!==j||e[26]!==v.data||e[27]!==l||e[28]!==f||e[29]!==p||e[30]!==u||e[31]!==m||e[32]!==c||e[33]!==a||e[34]!==n||e[35]!==o||e[36]!==d||e[37]!==S||e[38]!==D||e[39]!==B||e[40]!==R||e[41]!==x||e[42]!==r||e[43]!==k){U=Symbol.for("react.early_return_sentinel");e:{const T=v.data??[];let L;e[48]!==j?(L=b=>!(j&&b.kind==="dir"&&re(b.path)===Le),e[48]=j,e[49]=L):L=e[49];const X=T.filter(L);if(X.length===0&&!j){let b;e[50]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(et,{className:"size-16"}),e[50]=b):b=e[50];let K;e[51]!==x?(K=x("library.libraryViews.emptyFolder"),e[51]=x,e[52]=K):K=e[52];const Z=l.readOnly?"library.libraryViews.emptyReadOnlySet":"library.libraryViews.emptyFolderHint";let ae;e[53]!==x||e[54]!==Z?(ae=x(Z),e[53]=x,e[54]=Z,e[55]=ae):ae=e[55];const de=l.readOnly?void 0:y;let ue;e[56]!==ae||e[57]!==de||e[58]!==K?(ue=t.jsx("div",{className:"rounded-2xl border border-dashed border-border",children:t.jsx(tl,{illustration:b,title:K,description:ae,buttonComponent:de})}),e[56]=ae,e[57]=de,e[58]=K,e[59]=ue):ue=e[59],U=ue;break e}let W;e[60]!==l.readOnly||e[61]!==p||e[62]!==k?(W=b=>l.readOnly?void 0:()=>p({volume:k,path:b.path,kind:b.kind}),e[60]=l.readOnly,e[61]=p,e[62]=k,e[63]=W):W=e[63];const _=W;let q;e[64]!==N||e[65]!==l.readOnly||e[66]!==d||e[67]!==k?(q=b=>l.readOnly?void 0:()=>d({volume:k,path:b.path,kind:b.kind,shareMode:b.shareMode??"private",effectivePublic:b.effectivePublic??!1,url:b.kind==="file"?gt(N(k,b.path)):void 0}),e[64]=N,e[65]=l.readOnly,e[66]=d,e[67]=k,e[68]=q):q=e[68];const H=q,J=X.filter(er),Y=X.filter(Zn),te=X.filter(Jn);let se;e[69]!==r?(se=b=>b.kind==="file"&&Ue(b,r),e[69]=r,e[70]=se):se=e[70],z=X.filter(se);const pe=We(z.map(Be),r.sort),ke=We([...J,...Y,...te,...z].map(Be),r.sort);let je;e[71]!==l||e[72]!==c||e[73]!==a||e[74]!==n||e[75]!==o?(je=b=>{const K=ge(l,b.path);switch(b.kind){case"folder":return()=>a(K);case"skill":return()=>o(K);case"brand":return()=>c(K);case"file":return()=>n(K);default:return b.kind}},e[71]=l,e[72]=c,e[73]=a,e[74]=n,e[75]=o,e[76]=je):je=e[76];const xe=je,le=g?(R.data??[]).filter(b=>Ue(b,r)&&!(b.volume===be&&!b.path.includes("/"))):[],me=ke.length+le.length>0&&t.jsxs(dl,{sort:r.sort,onSort:r.onSort,locationLabel:g?x("library.entries.location"):void 0,plain:r.flat,children:[ke.map(b=>{const K=ge(l,b.path),Z=O?D.get(b.name):void 0,ae=b.kind==="skill"||b.kind==="brand";return t.jsx(dt,{entry:Z?.title?{...b,name:Z.title}:b,selected:b.kind==="file"&&r.previewPath===K,publicState:we(b.entry),actions:{onOpen:xe(b),onBrowse:ae?()=>a(K):void 0,download:b.kind==="file"?{url:N(k,b.path),filename:b.name}:void 0,onShare:b.kind==="brand"?void 0:H(b.entry),onDelete:_(b.entry),draggable:!l.readOnly,...Ee(b.path,b.kind==="file"?"file":"dir",{onDragStart:u,onContextMenu:f,onDrop:b.kind==="folder"?m:void 0})}},b.path)}),le.map(b=>{const K=Ie(b.volume,b.path),Z=Be(b);return t.jsx(dt,{entry:Z,secondary:vt(b.volume,b.path,S.slug),selected:r.previewPath===K,publicState:we(b),actions:{onOpen:()=>n(K),download:{url:N(b.volume,b.path),filename:Z.name},onDelete:()=>p({volume:b.volume,path:b.path,kind:"file"})}},`${b.volume}/${b.path}`)})]});A=B,E=r.layout==="list"?me:t.jsxs(t.Fragment,{children:[te.length+J.length+Y.length>0&&t.jsx(Ke,{label:x("library.libraryViews.folders"),count:te.length+J.length+Y.length,children:t.jsxs(yt,{children:[J.map(b=>{const K=we(b);return t.jsx(Ae,{name:re(b.path),meta:x("library.cards.skill"),icon:t.jsx(Ut,{Glyph:ht}),badge:K&&t.jsx(Je,{state:K,t:x}),onOpen:()=>o(ge(l,b.path)),onBrowse:()=>a(ge(l,b.path)),onShare:H(b),onDelete:_(b),draggable:!l.readOnly,...Ee(b.path,"dir",{onDragStart:u,onContextMenu:f})},b.path)}),Y.map(b=>t.jsx(Ae,{name:re(b.path),meta:x("library.cards.brand"),icon:t.jsx(Ut,{Glyph:Ve}),onOpen:()=>c(ge(l,b.path)),onBrowse:()=>a(ge(l,b.path)),onDelete:_(b),draggable:!l.readOnly,...Ee(b.path,"dir",{onDragStart:u,onContextMenu:f})},b.path)),te.map((b,K)=>{const Z=re(b.path),ae=O?D.get(Z):void 0,de=we(b);return t.jsx(Ae,{name:ae?.title??Z,meta:I(Z),readOnly:l.readOnly,counts:{volume:k,path:b.path,enabled:K<ul},overlay:ae&&t.jsx(hs,{icon:ae.icon,name:ae.title,size:"xs"}),badge:de&&t.jsx(Je,{state:de,t:x}),onOpen:()=>a(ge(l,b.path)),onShare:H(b),onDelete:_(b),draggable:!l.readOnly,...Ee(b.path,"dir",{onDragStart:u,onContextMenu:f,onDrop:m})},b.path)})]})}),pe.length>0&&t.jsx(kt,{view:r,count:pe.length,children:pe.map(b=>t.jsx(wt,{entry:b,view:r,selected:r.previewPath===ge(l,b.path),publicState:we(b.entry),downloadUrl:N(k,b.path),actions:{onOpen:()=>n(ge(l,b.path)),download:{url:N(k,b.path),filename:b.name},onShare:H(b.entry),onDelete:_(b.entry),draggable:!l.readOnly,...Ee(b.path,"file",{onDragStart:u,onContextMenu:f})}},b.path))})]})}e[20]=I,e[21]=y,e[22]=N,e[23]=g,e[24]=O,e[25]=j,e[26]=v.data,e[27]=l,e[28]=f,e[29]=p,e[30]=u,e[31]=m,e[32]=c,e[33]=a,e[34]=n,e[35]=o,e[36]=d,e[37]=S,e[38]=D,e[39]=B,e[40]=R,e[41]=x,e[42]=r,e[43]=k,e[44]=z,e[45]=A,e[46]=E,e[47]=U}else z=e[44],A=e[45],E=e[46],U=e[47];if(U!==Symbol.for("react.early_return_sentinel"))return U;let P;e[77]!==z||e[78]!==x||e[79]!==r.fileView||e[80]!==r.modified?(P=(r.fileView!=="all"||r.modified!=="any")&&z.length===0&&t.jsx(jt,{children:x("library.library.noFilesInView")}),e[77]=z,e[78]=x,e[79]=r.fileView,e[80]=r.modified,e[81]=P):P=e[81];let V;return e[82]!==A||e[83]!==E||e[84]!==P?(V=t.jsxs(t.Fragment,{children:[A,E,P]}),e[82]=A,e[83]=E,e[84]=P,e[85]=V):V=e[85],V}function Jn(i){return i.kind==="dir"&&!i.hasSkill&&!i.hasBrand}function Zn(i){return i.kind==="dir"&&i.hasBrand&&!i.hasSkill}function er(i){return i.kind==="dir"&&i.hasSkill}function tr({root:i=be,rootLabel:e,onOpenFile:l,onOpenSkill:s,onOpenBrand:a,context:r=!1}={}){const n=ce(),{org:o}=_e(),c=Gt(),d=zl(),p=Gl(),u=El({strict:!1}),f=u.fileView??"all",m=u.modified??"any",y=!r&&u.layout==="grid"?"grid":"list",x=it(u.path||i),S=_t(x.volume)&&!x.dirPath?"updated":"name",k=Ys.find(h=>h===u.sort)??S,v=(h,Q)=>d({to:".",search:fe=>({...fe,[h]:Q||void 0})}),N=h=>v("fileView",h==="all"?null:h),j={layout:y,sort:k,fileView:f,modified:m,previewPath:!l?u.preview:void 0,flat:r,onLayout:h=>v("layout",h==="list"?null:h),onSort:h=>v("sort",h===S?null:h)},O=u.path||i,w=it(O),I=cs(),g=w.volume!==null&&I.has(w.volume)?{...w,readOnly:!0}:w,$=h=>v("path",h),R=e??pt(o.slug),F=Zl(O,i),B=F.length===0,z=F.map(h=>({key:`folder:${h.path}`,label:h.label,onSelect:()=>$(h.path)})),A=(h,Q)=>d({to:".",search:fe=>({...fe,preview:void 0,skill:void 0,brand:void 0,[h]:Q})}),E=h=>{ls(),l?l(h):A("preview",h)},U=s??(h=>A("skill",h)),P=a??(h=>A("brand",h)),[V,T]=G.useState(""),L=ss(V.trim(),300),X=!B&&g.volume!==null?{volume:g.volume,prefix:g.dirPath}:void 0,W=X?n("library.library.searchInPlaceholder",{folder:Xe(g.segments.at(-1)??"")}):n("library.library.searchPlaceholder"),_=B?R:Xe(g.segments.at(-1)??""),[q,H]=G.useState(null),[J,Y]=G.useState(null),[te,se]=G.useState(!1),[pe,ke]=G.useState(""),[je,xe]=G.useState(!1),[le,me]=G.useState(null),[b,K]=G.useState(""),Z=G.useRef(null),[ae,de]=G.useState(!1),ue=G.useRef(0),ye=g.readOnly?null:g.volume,{upload:Ne,mkdir:C,move:ee}=ot(ye??be),{remove:Ce}=ot(q?.volume??"uploads"),$e=g.isHomeRoot&&i===be;async function Te(h){if(!(!ye||!h||h.length===0))try{await Ne.mutateAsync({dir:g.dirPath,files:[...h]}),oe.success(h.length===1?n("library.library.uploadedSingle",{filename:h[0]?.name??""}):n("library.library.uploadedMultiple",{count:h.length}))}catch(Q){oe.error(Q instanceof Error?Q.message:n("library.library.uploadFailed"))}finally{Z.current&&(Z.current.value="")}}const qe=ye!==null;function St(h){return h.dataTransfer.types.includes("Files")}function ml(h){!qe||!St(h)||(h.preventDefault(),ue.current+=1,de(!0))}function hl(h){!qe||!St(h)||h.preventDefault()}function bl(){qe&&(ue.current=Math.max(0,ue.current-1),ue.current===0&&de(!1))}function xl(h){qe&&(h.preventDefault(),h.stopPropagation(),ue.current=0,de(!1),h.dataTransfer.files.length>0&&Te(h.dataTransfer.files))}async function Nt(){const h=pe.trim();if(!(!ye||!h)){if($e&&ut.has(h.toLowerCase())){oe.error(n("library.library.folderNameReserved",{name:h}));return}try{const Q=g.dirPath;await C.mutateAsync(Q?`${Q}/${h}`:h),oe.success(n("library.library.folderCreated",{name:h})),se(!1),ke("")}catch(Q){oe.error(Q instanceof Error?Q.message:n("library.library.folderCreateFailed"))}}}async function yl(){if(!q)return;const h=q;try{await Ce.mutateAsync(h.path),oe.success(n("library.library.deleted",{name:re(h.path)}))}catch(Q){oe.error(Q instanceof Error?Q.message:n("library.library.deleteFailed"))}finally{H(null)}}async function Ct(){if(!le)return;const h=b.trim();if(!h||h.includes("/")||h.includes("..")||h===re(le.path)){xe(!1),me(null),K("");return}if(le.kind==="dir"&&$e&&ut.has(h.toLowerCase())){oe.error(n("library.library.folderNameReserved",{name:h}));return}try{const Q=le.path.includes("/")?le.path.slice(0,le.path.lastIndexOf("/")):"",fe=Q?`${Q}/${h}`:h;await ee.mutateAsync({from:le.path,to:fe});const lt=h.replace(/[<>]/g,"");oe.success(n("library.library.renamed",{name:lt}))}catch(Q){oe.error(Q instanceof Error?Q.message:n("library.library.renameFailed"))}finally{xe(!1),me(null),K("")}}async function gl(h,Q){try{const fe=re(h),lt=Q?`${Q}/${fe}`:fe;await ee.mutateAsync({from:h,to:lt}),oe.success(n("library.library.moved",{name:fe,destination:Q||n("library.library.theLibrary")}))}catch(fe){oe.error(fe instanceof Error?fe.message:n("library.library.moveFailed"))}}function vl(){for(const h of En)c.invalidateQueries({queryKey:he.orgFsVolume(o.id,h)});g.volume&&c.invalidateQueries({queryKey:he.orgFsVolume(o.id,g.volume)}),c.invalidateQueries({queryKey:he.orgFsRecent(o.id)}),c.invalidateQueries({queryKey:he.orgFsSearchRoot(o.id)}),c.invalidateQueries({queryKey:he.orgFsPublicSets(o.id)})}function jl(h){h.defaultPrevented||!ye||h.target.closest("input, textarea, button, a, [role='button']")||(h.preventDefault(),se(!0))}const wl=t.jsxs(t.Fragment,{children:[t.jsx(Ql,{label:n("library.library.refresh"),tooltipSide:"bottom",variant:"secondary",onClick:vl,children:t.jsx(Ml,{})}),ye&&t.jsxs(ie,{variant:"secondary",size:"sm",onClick:()=>se(!0),"aria-label":n("library.library.newFolder"),children:[t.jsx(At,{size:14}),t.jsx("span",{className:"hidden @lg/panel-header:inline",children:n("library.library.newFolder")})]})]}),Pt=g.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(ql,{size:12}),n("library.library.readOnly")]}):t.jsxs(ie,{size:"sm",disabled:Ne.isPending,onClick:()=>Z.current?.click(),"aria-label":Ne.isPending?n("library.library.uploading"):n("library.library.uploadFile"),children:[t.jsx(Qe,{size:14}),t.jsx("span",{className:"hidden @lg/panel-header:inline",children:Ne.isPending?n("library.library.uploading"):n("library.library.uploadFile")})]}),Dt=t.jsxs(ie,{size:"sm",onClick:()=>Z.current?.click(),children:[t.jsx(Qe,{size:14}),n("library.library.uploadFile")]}),kl=t.jsxs("div",{className:"flex items-center gap-2",children:[Dt,t.jsxs(ie,{variant:"secondary",size:"sm",onClick:()=>se(!0),children:[t.jsx(At,{size:14}),n("library.library.newFolder")]})]}),Sl=_t(g.volume)&&!g.dirPath,Ot=qs(i).filter(h=>!r||h.key!=="public"),Nl=es(g),$t=Us.map(h=>({value:h,label:{any:n("library.library.modifiedAny"),today:n("library.library.modifiedToday"),week:n("library.library.modifiedWeek"),month:n("library.library.modifiedMonth")}[h]})),Tt=["all","documents","media"].map(h=>({value:h,label:n(h==="all"?"library.library.anyType":`library.library.${h}`)})),Cl=t.jsxs(Oe.Tabs,{children:[Ot.map(h=>t.jsx(Oe.Tab,{active:Nl===h.key,onClick:()=>$(h.path),children:r&&h.key==="all"?n("library.context.all"):h.label},h.key)),!r&&Ot.length>0&&t.jsx("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border"}),!r&&t.jsxs(t.Fragment,{children:[t.jsx(It,{label:f==="all"?n("library.library.typeFilter"):Tt.find(h=>h.value===f)?.label,value:f,options:Tt,active:f!=="all",onChange:N}),t.jsx(It,{label:m==="any"?n("library.library.modified"):$t.find(h=>h.value===m)?.label,value:m,options:$t,active:m!=="any",onChange:h=>{v("modified",h==="any"?null:h)}})]})]});return t.jsxs("div",{className:"relative h-full",onDragEnter:ml,onDragOver:hl,onDragLeave:bl,onDrop:xl,onContextMenu:jl,children:[ae&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx(Qe,{size:28,className:"text-primary"}),t.jsx("p",{className:"text-sm font-medium text-foreground",children:n("library.library.dropToUpload",{location:_})})]})}),t.jsx("input",{ref:Z,type:"file",multiple:!0,className:"hidden",onChange:h=>{Te(h.target.files)}}),t.jsx(Oe.Breadcrumbs,{after:"page",parent:{onSelect:()=>$(i),...e?{label:e}:{}},items:z}),r?t.jsxs(Oe.Actions,{children:[ye&&t.jsx(ie,{variant:"secondary",size:"sm",onClick:()=>se(!0),children:n("library.library.newFolder")}),Pt]}):t.jsx(Oe.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(Xl,{value:V,onChange:T,label:n("library.library.searchPlaceholder"),placeholder:W,clearLabel:n("library.library.clearSearch")}),wl]}),children:Pt}),t.jsx(zt.Toolbar.Left.Portal,{children:Cl}),t.jsx(zt.Toolbar.Right.Portal,{children:r?t.jsx(Yl,{value:V,onChange:T,placeholder:W,className:"w-full min-w-48 md:w-56"}):t.jsx(Bn,{layout:y,onChange:j.onLayout})}),t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsx("div",{className:ne("mx-auto flex w-full flex-col gap-8",r?ne(Bl,"pt-4 pb-8"):"max-w-[1200px] px-4 py-6 md:px-8"),children:L?t.jsx(_n,{view:j,query:L,scope:X,stale:V.trim()!==L,onOpenFile:E,onShare:Y,onDelete:H}):g.volume===null?t.jsx(Xn,{view:j,onOpenDir:$}):Sl?t.jsx(qn,{volume:g.volume,view:j,onOpenDir:$,onOpenFile:E,onShare:Y,onDelete:H,emptyActions:Dt},g.volume):t.jsx(Wn,{view:j,root:i,location:g,onOpenDir:$,onOpenFile:E,onOpenSkill:U,onOpenBrand:P,onShare:Y,onDelete:H,onContextMenu:(h,Q)=>{me({path:h,kind:Q}),K(re(h)),xe(!0)},onMove:gl,emptyActions:kl},g.volume)})}),p&&(u.preview?t.jsx(Zt,{previewPath:u.preview,onClose:()=>v("preview",null)}):u.skill?t.jsx(el,{skillPath:u.skill,onClose:()=>v("skill",null)},u.skill):u.brand?t.jsx(nl,{brandPath:u.brand,onClose:()=>v("brand",null)},u.brand):null),t.jsx(rt,{open:te,onOpenChange:se,children:t.jsxs(nt,{children:[t.jsxs(Et,{children:[t.jsx(at,{children:n("library.library.newFolderTitle")}),t.jsx(Mt,{children:n("library.library.newFolderDescription",{path:_||n("library.library.theLibrary")})})]}),t.jsx(Ye,{autoFocus:!0,placeholder:n("library.library.folderNamePlaceholder"),value:pe,onChange:h=>ke(h.target.value),onKeyDown:h=>{h.key==="Enter"&&Nt()}}),t.jsxs(Bt,{children:[t.jsx(ie,{variant:"outline",onClick:()=>se(!1),children:n("library.library.cancel")}),t.jsx(ie,{disabled:!pe.trim()||C.isPending,onClick:()=>{Nt()},children:n("library.library.create")})]})]})}),t.jsx(rt,{open:je,onOpenChange:h=>{xe(h),h||(me(null),K(""))},children:t.jsxs(nt,{children:[t.jsxs(Et,{children:[t.jsx(at,{children:le&&n("library.library.renameTitle",{name:re(le.path)})}),t.jsx(Mt,{children:n("library.library.renameDescription")})]}),t.jsx(Ye,{autoFocus:!0,value:b,onChange:h=>K(h.target.value),onKeyDown:h=>{h.key==="Enter"&&Ct()}}),t.jsxs(Bt,{children:[t.jsx(ie,{variant:"outline",onClick:()=>xe(!1),children:n("library.library.cancel")}),t.jsx(ie,{disabled:!b.trim()||ee.isPending,onClick:()=>{Ct()},children:n("library.library.rename")})]})]})}),t.jsx(ks,{target:J,onOpenChange:h=>{h||Y(null)}}),t.jsx(Al,{open:q!==null,onOpenChange:h=>{h||H(null)},children:t.jsxs(Ll,{children:[t.jsxs(Il,{children:[t.jsx(Vl,{children:n("library.library.deleteTitle",{name:q?re(q.path):""})}),t.jsx(Rl,{children:q?.kind==="dir"?n("library.library.deleteDirectoryDescription"):n("library.library.deleteFileDescription")})]}),t.jsxs(Ul,{children:[t.jsx(_l,{children:n("library.library.cancel")}),t.jsx(Hl,{onClick:()=>{yl()},children:n("library.library.delete")})]})]})})]})}function lr(i,e,l){switch(i){case"dialog":return e;case"panel":return l;case"side":return;default:return i}}function Lr(i){const e=M.c(23);let l;e[0]!==i?(l=i===void 0?{}:i,e[0]=i,e[1]=l):l=e[1];const{root:s,rootLabel:a,filePreview:r,context:n}=l,o=r===void 0?"panel":r,{openPanel:c}=Is(),[d,p]=G.useState(null),[u,f]=G.useState(null),[m,y]=G.useState(null);let x;e[2]!==c?(x=O=>c(Kl(O)),e[2]=c,e[3]=x):x=e[3];let S;e[4]!==o||e[5]!==x?(S=lr(o,p,x),e[4]=o,e[5]=x,e[6]=S):S=e[6];let k;e[7]!==n||e[8]!==s||e[9]!==a||e[10]!==S?(k=t.jsx(tr,{root:s,rootLabel:a,context:n,onOpenFile:S,onOpenSkill:f,onOpenBrand:y}),e[7]=n,e[8]=s,e[9]=a,e[10]=S,e[11]=k):k=e[11];let v;e[12]!==d?(v=d&&t.jsx(Zt,{previewPath:d,onClose:()=>p(null)},d),e[12]=d,e[13]=v):v=e[13];let N;e[14]!==u?(N=u&&t.jsx(el,{skillPath:u,onClose:()=>f(null)},u),e[14]=u,e[15]=N):N=e[15];let D;e[16]!==m?(D=m&&t.jsx(nl,{brandPath:m,onClose:()=>y(null)},m),e[16]=m,e[17]=D):D=e[17];let j;return e[18]!==k||e[19]!==v||e[20]!==N||e[21]!==D?(j=t.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[k,v,N,D]}),e[18]=k,e[19]=v,e[20]=N,e[21]=D,e[22]=j):j=e[22],j}export{Lr as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E,u as C,j as n,N as S}from"./index-
|
|
1
|
+
import{a as E,u as C,j as n,N as S}from"./index-BWpKrclg.js";import{A as R,a as U}from"./auth-entry-CPeTN7o5.js";import{A as y}from"./auth-split-layout-BGf8-EnP.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";const s="studio_signup_ref",r="studio_signup_src",j=720*60*60,u=128;function l(e){const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?.[1]?decodeURIComponent(t[1]):null}function _(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${j}; samesite=lax`}function O(e){e.ref&&e.ref.length<=u&&!l(s)&&_(s,e.ref),e.src&&e.src.length<=u&&!l(r)&&_(r,e.src)}function k(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function W(){const e=E.useSession(),t=C({from:"/login"}),{next:o="/",client_id:d,redirect_uri:h,response_type:f,state:a,scope:g,code_challenge:p,code_challenge_method:x,src:A,ref:m}=t;O({src:A,ref:m});const c=o.startsWith("/")&&!o.startsWith("//")&&!o.startsWith("/\\")?o:"/",i=k({client_id:d,redirect_uri:h,response_type:f,state:a,scope:g,code_challenge:p,code_challenge_method:x});return e.data?i?(window.location.href=i,n.jsx(R,{})):n.jsx(S,{to:c}):n.jsx(y,{children:n.jsx(U,{callbackUrl:c,redirectUrl:i})})}export{W as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Ie,d as lE,f as uE,j as O,r as Oe,g3 as cE,dv as Pl,fc as He,g4 as Kt,b as pt,D as dE,aU as pE,aT as gE,aV as fE,x as mE,l as fh,ai as mh,B as hh}from"./index-
|
|
1
|
+
import{c as Ie,d as lE,f as uE,j as O,r as Oe,g3 as cE,dv as Pl,fc as He,g4 as Kt,b as pt,D as dE,aU as pE,aT as gE,aV as fE,x as mE,l as fh,ai as mh,B as hh}from"./index-BWpKrclg.js";import{u as bh}from"./use-copy-Bq-mz0ld.js";import{a as Eh}from"./Copy01-Dy1KrWO0.js";import{d as hE,c as bE,n as yh,i as EE}from"./ZoomOut-CBOWQYet.js";import{a as yE}from"./location-V0VwTJTt.js";import{u as SE}from"./use-mobile-CoPLJ8cu.js";import{a as kE}from"./use-panel-navigate-nriEb2Qz.js";import{a as vE}from"./thread-route-BOOkt7de.js";const Ul=Oe.createContext(null);function ZL(e){const t=Ie.c(12),{children:n}=e,r=lE(),a=SE(),{openPanel:i}=kE();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const s=uE(o),l="org"in s&&typeof s.org=="string"?s.org:void 0,u=vE()??void 0;let c;t[1]!==a||t[2]!==r||t[3]!==i?(c=f=>{if(!a){i(cE(f),{search:TE});return}r({to:".",search:b=>({...b,preview:f})})},t[1]=a,t[2]=r,t[3]=i,t[4]=c):c=t[4];const d=c;let p;t[5]!==d||t[6]!==l||t[7]!==u?(p={orgSlug:l,threadId:u,open:d},t[5]=d,t[6]=l,t[7]=u,t[8]=p):p=t[8];let g;return t[9]!==n||t[10]!==p?(g=O.jsx(Ul.Provider,{value:p,children:n}),t[9]=n,t[10]=p,t[11]=g):g=t[11],g}function TE(e){return{...e,preview:void 0}}function Bl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tt=Bl();function Sh(e){tt=e}var _t={exec:()=>null};function ee(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(be.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},wE=/^(?:[ \t]*(?:\n|$))+/,AE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,RE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Dt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_E=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$l=/(?:[*+-]|\d{1,9}[.)])/,kh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vh=ee(kh).replace(/bull/g,$l).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),IE=ee(kh).replace(/bull/g,$l).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ql=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,xE=/^[^\n]+/,zl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,NE=ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",zl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),CE=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$l).getRegex(),rn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Gl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,OE=ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Gl).replace("tag",rn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Th=ee(ql).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),LE=ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Th).getRegex(),Hl={blockquote:LE,code:AE,def:NE,fences:RE,heading:_E,hr:Dt,html:OE,lheading:vh,list:CE,newline:wE,paragraph:Th,table:_t,text:xE},Au=ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),DE={...Hl,lheading:IE,table:Au,paragraph:ee(ql).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Au).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex()},ME={...Hl,html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_t,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ee(ql).replace("hr",Dt).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",vh).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},FE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wh=/^( {2,}|\\)\n(?!\s*$)/,UE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,an=/[\p{P}\p{S}]/u,jl=/[\s\p{P}\p{S}]/u,Ah=/[^\s\p{P}\p{S}]/u,BE=ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jl).getRegex(),Rh=/(?!~)[\p{P}\p{S}]/u,$E=/(?!~)[\s\p{P}\p{S}]/u,qE=/(?:[^\s\p{P}\p{S}]|~)/u,zE=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,_h=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,GE=ee(_h,"u").replace(/punct/g,an).getRegex(),HE=ee(_h,"u").replace(/punct/g,Rh).getRegex(),Ih="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",jE=ee(Ih,"gu").replace(/notPunctSpace/g,Ah).replace(/punctSpace/g,jl).replace(/punct/g,an).getRegex(),VE=ee(Ih,"gu").replace(/notPunctSpace/g,qE).replace(/punctSpace/g,$E).replace(/punct/g,Rh).getRegex(),WE=ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ah).replace(/punctSpace/g,jl).replace(/punct/g,an).getRegex(),YE=ee(/\\(punct)/,"gu").replace(/punct/g,an).getRegex(),KE=ee(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),XE=ee(Gl).replace("(?:-->|$)","-->").getRegex(),ZE=ee("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",XE).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,QE=ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Xt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xh=ee(/^!?\[(label)\]\[(ref)\]/).replace("label",Xt).replace("ref",zl).getRegex(),Nh=ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",zl).getRegex(),JE=ee("reflink|nolink(?!\\()","g").replace("reflink",xh).replace("nolink",Nh).getRegex(),Vl={_backpedal:_t,anyPunctuation:YE,autolink:KE,blockSkip:zE,br:wh,code:PE,del:_t,emStrongLDelim:GE,emStrongRDelimAst:jE,emStrongRDelimUnd:WE,escape:FE,link:QE,nolink:Nh,punctuation:BE,reflink:xh,reflinkSearch:JE,tag:ZE,text:UE,url:_t},ey={...Vl,link:ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Xt).getRegex(),reflink:ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xt).getRegex()},El={...Vl,emStrongRDelimAst:VE,emStrongLDelim:HE,url:ee(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ty={...El,br:ee(wh).replace("{2,}","*").getRegex(),text:ee(El.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bt={normal:Hl,gfm:DE,pedantic:ME},kt={normal:Vl,gfm:El,breaks:ty,pedantic:ey},ny={"&":"&","<":"<",">":">",'"':""","'":"'"},Ru=e=>ny[e];function Fe(e,t){if(t){if(be.escapeTest.test(e))return e.replace(be.escapeReplace,Ru)}else if(be.escapeTestNoEncode.test(e))return e.replace(be.escapeReplaceNoEncode,Ru);return e}function _u(e){try{e=encodeURI(e).replace(be.percentDecode,"%")}catch{return null}return e}function Iu(e,t){const n=e.replace(be.findPipe,(i,o,s)=>{let l=!1,u=o;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(be.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(be.slashPipe,"|");return r}function vt(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function ry(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function xu(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function ay(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
|
|
3
3
|
`).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
|
|
4
4
|
`)}var Zt=class{options;rules;lexer;constructor(e){this.options=e||tt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:vt(n,`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as z,c as L,j as u,gn as J,go as ee,C as te,H as ne,a as oe,l as q,h as se}from"./index-
|
|
1
|
+
import{r as z,c as L,j as u,gn as J,go as ee,C as te,H as ne,a as oe,l as q,h as se}from"./index-BWpKrclg.js";import{D as ie,E as re,C as ae}from"./types-BNmsSext.js";const W=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function le(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${de(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
|
|
2
2
|
`+n+o.slice(l)}const r=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,a=o.match(r);if(a){const l=(a.index??0)+a[0].length;return o.slice(0,l)+`
|
|
3
3
|
<head>
|
|
4
4
|
`+n+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as V,a as N,e as H,b as z}from"./auth-
|
|
1
|
+
import{d as V,a as N,e as H,b as z}from"./auth-CK6AyRu5.js";import{c8 as M}from"./index-BWpKrclg.js";function D(){return window.location.origin}function C(){try{const e=window.location.hostname;return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}const R="mcp:oauth:callback:",J=1e3,K=10*6e4,v=15e3;class W{_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(t){this._redirectUrl=t.callbackUrl??`${D()}/oauth/callback`,this._windowMode=t.windowMode??"popup";const n=t.scope?Array.isArray(t.scope)?t.scope.join(" "):t.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:t.clientName??"@decocms/studio MCP client",...n&&{scope:n}}}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(t){this._clientInfo=t}tokens(){return this._tokens??void 0}saveTokens(t){this._tokens=t}redirectToAuthorization(t){if(this._windowMode==="tab"){if(!window.open(t.toString(),"_blank"))throw new Error("Tab was blocked")}else{const i=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(t.toString(),"mcp-oauth",`width=600,height=700,left=${i},top=${o},popup=yes`)&&!window.open(t.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(t){this._codeVerifier=t}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}}async function Q(e){const t=M(e,window.location.origin),n=e.orgSlug?`/api/${encodeURIComponent(e.orgSlug)}/mcp/${e.connectionId}`:`/mcp/${e.connectionId}`,r=new URL(n,t),i=new W({serverUrl:r.href,clientName:e.clientName,clientUri:e.clientUri,callbackUrl:e.callbackUrl,scope:e.scope,windowMode:e.windowMode}),o={fn:null};try{const s=new Promise((a,d)=>{const p=e.timeout||K;let _,S,f=!1;const L=i.state(),b=`${R}${L}`,w=()=>{window.removeEventListener("message",T),window.removeEventListener("storage",y),clearTimeout(_),clearInterval(S);try{localStorage.removeItem(b)}catch{}};o.fn=c=>{f||(f=!0,w(),d(c))};const I=async c=>{if(f)return;if(f=!0,!c.success){w(),d(new Error(c.error||"OAuth authentication failed"));return}const{code:g,state:$}=c;if(!g){w(),d(new Error("Missing authorization code"));return}if(i.getStoredState()!==$){w(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const U=(await V(r))?.authorization_servers?.[0]||r,A=await N(U),k=i.clientInformation();if(!k){w(),d(new Error("Client information not found"));return}const P=i.codeVerifier(),x=await H(U,{metadata:A,clientInformation:k,authorizationCode:g,codeVerifier:P,redirectUri:i.redirectUrl,resource:new URL(r)});w(),a({tokens:x,clientId:k.client_id??null,clientSecret:k.client_secret??null,tokenEndpoint:A?.token_endpoint??null,userinfoEndpoint:A?.userinfo_endpoint??null})}catch(E){w(),d(E)}},T=async c=>{!C()&&c.origin!==window.location.origin||c.data?.type==="mcp:oauth:callback"&&await I(c.data)},y=async c=>{if(!(c.key!==b||!c.newValue))try{const g=JSON.parse(c.newValue);await I(g)}catch{}};window.addEventListener("message",T),window.addEventListener("storage",y),S=setInterval(()=>{if(f)return;let c=null;try{c=localStorage.getItem(b)}catch{return}if(c)try{I(JSON.parse(c))}catch{}},J),_=setTimeout(()=>{f||(f=!0,w(),d(new Error("OAuth authentication timeout")))},p)});if(s.catch(()=>{}),await z(i,{serverUrl:r})==="REDIRECT"){const a=await s;return{token:a.tokens.access_token,tokenInfo:{accessToken:a.tokens.access_token,refreshToken:a.tokens.refresh_token??null,expiresIn:a.tokens.expires_in??null,scope:a.tokens.scope??null,clientId:a.clientId,clientSecret:a.clientSecret,tokenEndpoint:a.tokenEndpoint,userinfoEndpoint:a.userinfoEndpoint,idToken:a.tokens.id_token??null},error:null}}const l=i.tokens(),h=i.clientInformation();return{token:l?.access_token||null,tokenInfo:l?{accessToken:l.access_token,refreshToken:l.refresh_token??null,expiresIn:l.expires_in??null,scope:l.scope??null,clientId:h?.client_id??null,clientSecret:h?.client_secret??null,tokenEndpoint:null,userinfoEndpoint:null,idToken:l.id_token??null}:null,error:null}}catch(s){return o.fn&&o.fn(s instanceof Error?s:new Error(String(s))),{token:null,tokenInfo:null,error:s instanceof Error?s.message:String(s)}}}function O(e,t){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(e,n),!0}if(t)try{const n=`${R}${t}`;return localStorage.setItem(n,JSON.stringify(e)),!0}catch{}return!1}async function Z(){const e=new URLSearchParams(window.location.search),t=e.get("code");let n=e.get("state");const r=e.get("error"),i=e.get("error_description");let o=n;if(n)try{const u=atob(n),l=JSON.parse(u);l.clientState&&(o=l.clientState)}catch{}if(r){const u=i||r;return O({type:"mcp:oauth:callback",success:!1,error:u},o),{success:!1,error:u}}if(!t||!n){const u="Missing code or state parameter";return O({type:"mcp:oauth:callback",success:!1,error:u},o),{success:!1,error:u}}return n=o||n,O({type:"mcp:oauth:callback",success:!0,code:t,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function m(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(e){try{const t=m(),n=t?new URL(e,t):new URL(e),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function F(e){try{const t=m();return(t?new URL(e,t):new URL(e)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function G(e,t,n){const r={hasToken:!1,usable:!1,sandboxSignIn:!1};try{const i=`/api/${encodeURIComponent(t)}/connections/${e}/oauth-token/status`,o=n?new URL(i,n).href:i,s=m(),u=!n||new URL(n).origin===s,l=await fetch(o,{credentials:u?"include":"omit"});if(!l.ok)return r;const h=await l.json();return{hasToken:h.hasToken===!0,usable:h.hasToken===!0&&(h.isExpired!==!0||h.canRefresh===!0),sandboxSignIn:h.sandboxSignIn===!0}}catch{return r}}async function B({url:e,token:t,orgId:n,studioUrl:r,meshUrl:i}){try{const o=j(e),s=F(e),u=m(),l=M({studioUrl:r,meshUrl:i},u?new URL(e,u).origin:new URL(e).origin),h=o&&s?await G(o,s,l):null;if(h?.sandboxSignIn)return{isAuthenticated:h.usable,supportsOAuth:!0,hasOAuthToken:h.hasToken};const a=new Headers;a.set("Content-Type","application/json"),a.set("Accept","application/json, text/event-stream");const d=await fetch(e,{method:"POST",headers:a,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/studio MCP client",version:"1.0.0"}}}),signal:AbortSignal.timeout(v)});if(d.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:h?.hasToken??!1};let p;try{const f=await d.json();p=f.error||f.message}catch{}return d.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:p||`HTTP ${d.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!d.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:p||`HTTP ${d.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o instanceof Error&&o.name==="TimeoutError"?`Connection check timed out after ${v/1e3}s`:o.message}}}export{Q as a,Z as h,B as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eL as e}from"./index-
|
|
1
|
+
import{eL as e}from"./index-BWpKrclg.js";import{a as c}from"./mcp-oauth-DWlxkjKx.js";async function i(n,o){const t=await(await fetch(`/api/${encodeURIComponent(n)}/connections/${o}/oauth-token/status`,{credentials:"include"}).catch(()=>null))?.json().catch(()=>null);return!!t&&typeof t=="object"&&"sandboxSignIn"in t&&t.sandboxSignIn===!0}async function r(n){return n.orgSlug&&await i(n.orgSlug,n.connectionId)?e(n.orgSlug,n.connectionId):c(n)}export{r as a};
|