decocms 4.51.2 → 4.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-D3-xinjs.js → AlertCircle-Ckjfi5CH.js} +1 -1
- package/dist/client/assets/{ArrowUp-BDUzeu95.js → ArrowUp-rkD_HZ8P.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-C3_2cXeW.js → ArrowUpRight-BLtI0F49.js} +1 -1
- package/dist/client/assets/{Check-ocZ9qfNA.js → Check-BqPyZLQD.js} +1 -1
- package/dist/client/assets/{CheckCircle-C0j5UyGw.js → CheckCircle-CAJezFjV.js} +1 -1
- package/dist/client/assets/{ChevronDown-wJWuHepF.js → ChevronDown-CnwT1mzn.js} +1 -1
- package/dist/client/assets/{ChevronRight-BjCnVhIo.js → ChevronRight-D1QQje8D.js} +1 -1
- package/dist/client/assets/{ChevronUp-CJAHlnYn.js → ChevronUp-DyEeTUVg.js} +1 -1
- package/dist/client/assets/{Circle-BTXhFI7S.js → Circle-acrc1-5x.js} +1 -1
- package/dist/client/assets/{Copy01-jaaWVisn.js → Copy01-evFlatZI.js} +1 -1
- package/dist/client/assets/{DotsVertical-DtV5Fnad.js → DotsVertical-DH6RqqNz.js} +1 -1
- package/dist/client/assets/{Eye-wkJjtmH2.js → Eye-jSmQrVvy.js} +1 -1
- package/dist/client/assets/{FilterLines-DlRQ5-i5.js → FilterLines-CP0tWCPE.js} +1 -1
- package/dist/client/assets/{Globe01-BGRBT0T0.js → Globe01-z5xFpMbi.js} +1 -1
- package/dist/client/assets/{Globe04-DRckETTE.js → Globe04-DhVhlypi.js} +1 -1
- package/dist/client/assets/{HardDrive-B5qdyv_Y.js → HardDrive-Bs1M6Hvn.js} +1 -1
- package/dist/client/assets/{Key01-JqQROwH3.js → Key01-Cb_sZVe8.js} +1 -1
- package/dist/client/assets/{LayoutLeft-j7RNB7Kr.js → LayoutLeft-BXKFuGem.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BOVv-eRf.js → LinkExternal01-DQeBBiDb.js} +1 -1
- package/dist/client/assets/{List-B14rXxdk.js → List-BxYpph4d.js} +1 -1
- package/dist/client/assets/{Loading02-pQoaBc8-.js → Loading02-sBz7BJ1q.js} +1 -1
- package/dist/client/assets/{Monitor01-p4fXdA6F.js → Monitor01-JTUoetfA.js} +1 -1
- package/dist/client/assets/{Palette-Ba4t1bDZ.js → Palette-Dhj0ki3L.js} +1 -1
- package/dist/client/assets/{Play-BRUiwJ0P.js → Play-DSn_fJ5I.js} +1 -1
- package/dist/client/assets/{Plus-CD0lb0Z8.js → Plus-CpRHfh-d.js} +1 -1
- package/dist/client/assets/{SearchLg-DomSsZ58.js → SearchLg-LmkvPKlo.js} +1 -1
- package/dist/client/assets/{SearchMd-BcwHGb7L.js → SearchMd-u399I-U8.js} +1 -1
- package/dist/client/assets/{Settings02-C124V1Xc.js → Settings02-FvY_WrCl.js} +1 -1
- package/dist/client/assets/{Shield01-xKRFJ51X.js → Shield01-Rg8a4xQi.js} +1 -1
- package/dist/client/assets/{Star01-8j7H5tvN.js → Star01-D4HIeFV4.js} +1 -1
- package/dist/client/assets/{Stars01-D-3hvZEh.js → Stars01-CzMXezZV.js} +1 -1
- package/dist/client/assets/{Stars02-Cb9neMzf.js → Stars02-DMehdEnh.js} +1 -1
- package/dist/client/assets/{Sun-f1oBLB5X.js → Sun-DzU87xA1.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DENI6_WB.js → SwitchHorizontal01-BMyKSURs.js} +1 -1
- package/dist/client/assets/{Tool01-DWMuD8TU.js → Tool01-afck1aOJ.js} +1 -1
- package/dist/client/assets/{Trash01-CWwPWzB6.js → Trash01-Cwa4v7Ml.js} +1 -1
- package/dist/client/assets/{Upload01-mS32ZgCv.js → Upload01-CkgWiY_F.js} +1 -1
- package/dist/client/assets/{User01-ByTCset0.js → User01-l1nuU6BZ.js} +1 -1
- package/dist/client/assets/{Users01-C_ia9S0h.js → Users01-8CrcPzGC.js} +1 -1
- package/dist/client/assets/{Users03-DgaczNXO.js → Users03-CKC5bCWK.js} +1 -1
- package/dist/client/assets/{X-Dntrg8W3.js → X-Cteb_roe.js} +1 -1
- package/dist/client/assets/{XCircle-Cc0xPE71.js → XCircle-wfHfVXUq.js} +1 -1
- package/dist/client/assets/{XClose-BKzJufOf.js → XClose-DlEEzpSj.js} +1 -1
- package/dist/client/assets/{Zap-B8LjXKlt.js → Zap-sfgXlWrU.js} +1 -1
- package/dist/client/assets/{ZapSquare-BaPWVQ37.js → ZapSquare-BkH7GX2j.js} +1 -1
- package/dist/client/assets/{ZoomOut-0JxM3Azv.js → ZoomOut-CdvzCj0T.js} +1 -1
- package/dist/client/assets/{access-gate-CuWTKtSI.js → access-gate-Bwfhmk-C.js} +1 -1
- package/dist/client/assets/add-section-modal-DexsffuH.js +1 -0
- package/dist/client/assets/{agent-capabilities-DSzooKp7.js → agent-capabilities-Bl8V-IcK.js} +1 -1
- package/dist/client/assets/{agent-icon-aq9fahDc.js → agent-icon-DzoFzJug.js} +1 -1
- package/dist/client/assets/{agents-list-CaUeXqG0.js → agents-list-DK6QZzyJ.js} +1 -1
- package/dist/client/assets/{ai-providers-CQLJ_8tO.js → ai-providers-BXgftXJ-.js} +1 -1
- package/dist/client/assets/{alert-fs5gPaUM.js → alert-BseR7lL7.js} +1 -1
- package/dist/client/assets/{alert-dialog-Ctmy7BUh.js → alert-dialog-k1jTn90-.js} +1 -1
- package/dist/client/assets/app-editor-COySOmxh.js +1 -0
- package/dist/client/assets/{auth-Bj2JBDn0.js → auth-Qjv7NhMS.js} +1 -1
- package/dist/client/assets/{auth-catchall-JbJLOIeZ.js → auth-catchall-ByT6IIRw.js} +1 -1
- package/dist/client/assets/{auth-entry-C1NUF8ZX.js → auth-entry-CjhmLnz0.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CfwFLRNN.js → auth-split-layout-Dpf-nPNK.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Dq14rQ5H.js → authenticate-and-persist-oauth-DpJjlm5V.js} +1 -1
- package/dist/client/assets/{automation-list-row-B4UVZ48v.js → automation-list-row-fxbcdSMq.js} +1 -1
- package/dist/client/assets/{automation-runs-COPPnkgJ.js → automation-runs-Dy1JESzQ.js} +1 -1
- package/dist/client/assets/{automations-k4gVYYGR.js → automations-DvN61x0o.js} +1 -1
- package/dist/client/assets/{autosend-DCYPaCYz.js → autosend-DX3Zzpl9.js} +1 -1
- package/dist/client/assets/{avatar-B58RA_6l.js → avatar-DGwxsQN2.js} +1 -1
- package/dist/client/assets/{badge-OQCPYGcq.js → badge-BQwEfJU4.js} +1 -1
- package/dist/client/assets/{block-document-LDG191Ua.js → block-document-BA-iUXEG.js} +3 -3
- package/dist/client/assets/{brand-context-D_AxwSWO.js → brand-context-CEEM_0kN.js} +1 -1
- package/dist/client/assets/{breadcrumb-BgOeMiKF.js → breadcrumb-BJWIHuqO.js} +1 -1
- package/dist/client/assets/{buckets-DucCPVYS.js → buckets-COiudA57.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-oOfbKD4q.js → bulk-category-panel-Dfvm8E4y.js} +1 -1
- package/dist/client/assets/{calendar-DWypRNoG.js → calendar-D9HHKNhR.js} +1 -1
- package/dist/client/assets/{capability-load-error-C9fFHl6G.js → capability-load-error-B5enhri-.js} +1 -1
- package/dist/client/assets/{card-CFUuQQ1M.js → card-CaPUDQMR.js} +1 -1
- package/dist/client/assets/category-editor-DpiKu_mb.js +1 -0
- package/dist/client/assets/{chat-context-BDLg73HV.js → chat-context-D1agoSZr.js} +5 -5
- package/dist/client/assets/{checkbox-BN0UcVyB.js → checkbox-D5lnR8wp.js} +1 -1
- package/dist/client/assets/{cli-auth-success-0s8PkjYa.js → cli-auth-success-BRy-NxMn.js} +1 -1
- package/dist/client/assets/collection-detail-AgoVpHZK.js +1 -0
- package/dist/client/assets/{collection-display-button-BLiQdNGK.js → collection-display-button-DXVH8deL.js} +1 -1
- package/dist/client/assets/{collection-search-IN2QsdDZ.js → collection-search-BenYn43P.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DjickeiC.js → collection-table-wrapper-C3H_A_xz.js} +1 -1
- package/dist/client/assets/{collection-tabs-DEEctqY7.js → collection-tabs-D1IpI5td.js} +1 -1
- package/dist/client/assets/{command-B-zA3-tK.js → command-DrWU6m5z.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CSQzdWRv.js → commerce-onboarding-BjeDrjZF.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DZCJkLGC.js → connect-desktop-dialog-DyDEdtY1.js} +1 -1
- package/dist/client/assets/{connection-card-CLhBW468.js → connection-card-DDlzd240.js} +1 -1
- package/dist/client/assets/{connection-detail-DWSgMsK8.js → connection-detail-BwuDYyyX.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CYnQot14.js → connection-form-helpers-JXDOtVIm.js} +1 -1
- package/dist/client/assets/{connections-BCohgvy9.js → connections-GBz8DR7k.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DSmv0lZi.js → decopilot-sse-pool-CWyHzlYU.js} +1 -1
- package/dist/client/assets/{dialog-CzN8avhL.js → dialog-PEI6UoxW.js} +1 -1
- package/dist/client/assets/{domain-settings-WMRLNbvN.js → domain-settings-B9jhB5je.js} +1 -1
- package/dist/client/assets/{drawer-HThdP5uB.js → drawer-CW08mroo.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BK5FaV5k.js → dropdown-menu-3AB2tgYT.js} +1 -1
- package/dist/client/assets/{empty-state-CcJIYptY.js → empty-state-DKJCnKDH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DSL7Y8A3.js → extract-connection-data-CRLwd6e7.js} +1 -1
- package/dist/client/assets/file-explorer-B5xHPC0m.js +2 -0
- package/dist/client/assets/{file-type-icon-GpEKUsdD.js → file-type-icon-BpXPQv3v.js} +1 -1
- package/dist/client/assets/{files-CcROi9t6.js → files-CXE7GzEs.js} +1 -1
- package/dist/client/assets/{form-CGcaRTOA.js → form-C1rNn4k6.js} +1 -1
- package/dist/client/assets/{general-DF7PHO03.js → general-0SucHlcy.js} +1 -1
- package/dist/client/assets/{github-repo-picker-KQYx5bF_.js → github-repo-picker-CUgtUqyb.js} +1 -1
- package/dist/client/assets/{hooks-BFJHOTt4.js → hooks-C2D4zi1P.js} +1 -1
- package/dist/client/assets/{index-DjoZL3mB.js → index-BC7A-4eo.js} +1 -1
- package/dist/client/assets/{index-CJs4YG_y.js → index-BJwe5x7p.js} +10 -10
- package/dist/client/assets/{index-DyKFz-Wv.js → index-BorSr1F7.js} +1 -1
- package/dist/client/assets/{index-CZ4WVu9U.js → index-C1OKchwi.js} +27 -27
- package/dist/client/assets/{index-C7hMTAFR.js → index-C3-boS0g.js} +1 -1
- package/dist/client/assets/{index-CylmZ2ca.js → index-C5c1_CFi.js} +1 -1
- package/dist/client/assets/{index-C7WjeY76.js → index-CA97b24W.js} +1 -1
- package/dist/client/assets/{index-C2LXo0VC.js → index-CCvcVLlX.js} +1 -1
- package/dist/client/assets/{index-C_F4X9gQ.js → index-Cz2K9IhP.js} +1 -1
- package/dist/client/assets/{index-Cu4sMkIs.js → index-D5FSJZrv.js} +1 -1
- package/dist/client/assets/{index-CPqDQfOw.js → index-DRvJRGa6.js} +1 -1
- package/dist/client/assets/{index-DRgsUNzQ.js → index-DXJraMAU.js} +2 -2
- package/dist/client/assets/{index-CP4HAVaa.js → index-DXSiQMy7.js} +1 -1
- package/dist/client/assets/{index-BcE0UPe9.js → index-JAv4b7xn.js} +1 -1
- package/dist/client/assets/{index-redirect-DOgz12Hs.js → index-redirect-XAsgVCK7.js} +1 -1
- package/dist/client/assets/{input-B0aQnFKg.js → input-C3Rirubl.js} +1 -1
- package/dist/client/assets/{integration-icon-BrvrOk5H.js → integration-icon-CIzHynOH.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-B0C0bNkM.js → invite-member-dialog-B_Ev4fOf.js} +1 -1
- package/dist/client/assets/{label-CAEQU6Kw.js → label-B_qG9hBJ.js} +1 -1
- package/dist/client/assets/{layout-CAQxuDfc.js → layout-DOGkXOpg.js} +1 -1
- package/dist/client/assets/{login-BNl3DyrG.js → login-DyHUQRlz.js} +1 -1
- package/dist/client/assets/{mcp-oauth-WkAErzUM.js → mcp-oauth-BQExdojx.js} +1 -1
- package/dist/client/assets/{members-CFAG47YG.js → members-BwJT85YH.js} +1 -1
- package/dist/client/assets/{monaco-editor-DTLtlpMl.js → monaco-editor-qEZd2OY7.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Byzwo_hq.js → monitoring-stats-row-36QuOlXN.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DZWV38Z5.js → oauth-callback-ai-provider-Gt_5rwPH.js} +1 -1
- package/dist/client/assets/{oauth-callback-Dl7hbaaA.js → oauth-callback-bZWA-VvB.js} +1 -1
- package/dist/client/assets/{onboarding-BSMPev5P.js → onboarding-B3pVNKOu.js} +1 -1
- package/dist/client/assets/{org-install-ByQXqxL7.js → org-install-DdMsBGUJ.js} +1 -1
- package/dist/client/assets/{org-layout-CKgpdyFk.js → org-layout-CHPBFBts.js} +1 -1
- package/dist/client/assets/{organization-choice-B79IthHJ.js → organization-choice-MpYOALKm.js} +1 -1
- package/dist/client/assets/{orgs-BiSSAVq9.js → orgs-BUeLl6_Z.js} +1 -1
- package/dist/client/assets/page-seo-form-BAzywWad.js +1 -0
- package/dist/client/assets/page-seo-sheet-C-hDReVa.js +1 -0
- package/dist/client/assets/{popover-uE71epyh.js → popover-Dot0rTJL.js} +1 -1
- package/dist/client/assets/post-editor-BAXDbs3u.js +1 -0
- package/dist/client/assets/{primitives-CFiyHFxY.js → primitives-CnMZHkqC.js} +1 -1
- package/dist/client/assets/{profile-BSZd_-p5.js → profile-DLHF7ILW.js} +1 -1
- package/dist/client/assets/project-app-view-B9EkpDAX.js +1 -0
- package/dist/client/assets/record-editor-CY_ezMJK.js +1 -0
- package/dist/client/assets/registry-CYWFdNYv.js +2 -0
- package/dist/client/assets/{registry-layout-N861VHnw.js → registry-layout-ufjLBHjw.js} +1 -1
- package/dist/client/assets/{require-capability-XY6ZhzOS.js → require-capability-BhlwYJmb.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Mghc_qb4.js → required-auth-layout-BC8u-kka.js} +1 -1
- package/dist/client/assets/{reset-password-Dsq-8-D_.js → reset-password-CldvJ8Wq.js} +1 -1
- package/dist/client/assets/{roles-Bh63EYOm.js → roles-C2KkgwN_.js} +1 -1
- package/dist/client/assets/{search-input-CfI7XQSB.js → search-input-BQq9o40f.js} +1 -1
- package/dist/client/assets/{secrets-Bqyd0QgI.js → secrets-c113z7Ow.js} +1 -1
- package/dist/client/assets/sections-editor-CqVnCcKd.js +2 -0
- package/dist/client/assets/{select-IQqkuyke.js → select-BAgGTsPs.js} +1 -1
- package/dist/client/assets/{select-model-_ueK9IUW.js → select-model-BWTLQCs1.js} +1 -1
- package/dist/client/assets/seo-editor-CXJZ6fSJ.js +1 -0
- package/dist/client/assets/{settings-layout-B_2KA4xq.js → settings-layout-BWtmqWri.js} +1 -1
- package/dist/client/assets/{settings-section-B4wKOM9N.js → settings-section-DRqGNV4u.js} +1 -1
- package/dist/client/assets/{shell-controls-CZKEytTQ.js → shell-controls-CNJcsxg1.js} +1 -1
- package/dist/client/assets/{shell-layout--i4S_y1a.js → shell-layout-BmmfEuxL.js} +1 -1
- package/dist/client/assets/{sidebar-ciphtA4J.js → sidebar-C_Os3PcH.js} +1 -1
- package/dist/client/assets/{skeleton-CtTBfwRk.js → skeleton-4HubKfur.js} +1 -1
- package/dist/client/assets/{sso-CTXCmsBb.js → sso-CE7J0MVA.js} +1 -1
- package/dist/client/assets/{store-CdG0vY93.js → store-CNLQyTjq.js} +1 -1
- package/dist/client/assets/store-registry-As-nKPZf.js +2 -0
- package/dist/client/assets/{studio-tools-C8sSWr27.js → studio-tools-BQ_BglCi.js} +1 -1
- package/dist/client/assets/{switch-WmIvORwZ.js → switch-tuaEWa67.js} +1 -1
- package/dist/client/assets/{table-BtAQhFli.js → table-BlwP8tRY.js} +1 -1
- package/dist/client/assets/{tabs-dnRCcMZW.js → tabs-H8L7nqeW.js} +1 -1
- package/dist/client/assets/{textarea-BWkJXpt-.js → textarea-DwT5RbAY.js} +1 -1
- package/dist/client/assets/{toggle-group-BWqkPPRz.js → toggle-group-9fFnAM5M.js} +1 -1
- package/dist/client/assets/{toolbar-CJcI1ONf.js → toolbar-CnJJ4eu5.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-cVkvjja9.js → toolbar-icon-button-B79y2ICd.js} +1 -1
- package/dist/client/assets/{tools-list-DEAw8kBy.js → tools-list-BkmrRVg0.js} +1 -1
- package/dist/client/assets/{tooltip-B3Xu0WsU.js → tooltip-BzvGoBJt.js} +1 -1
- package/dist/client/assets/{types-CDMEICfs.js → types-qR--dQ-D.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Dy1XYekN.js → use-ai-providers-CozhHADu.js} +1 -1
- package/dist/client/assets/{use-automations-89YCo463.js → use-automations-D3QGnMVz.js} +1 -1
- package/dist/client/assets/{use-capability-vmeCrW9g.js → use-capability-CqwMtAEs.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Dums0r6j.js → use-clock-tick-DNM9eBUk.js} +1 -1
- package/dist/client/assets/{use-collections-Q9vyVcYX.js → use-collections-BMd7toro.js} +1 -1
- package/dist/client/assets/{use-connection-M87KpiDN.js → use-connection-D_bvpL3s.js} +1 -1
- package/dist/client/assets/{use-copy-D3B6kIY8.js → use-copy-CfpTy51n.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BqvwF4Bt.js → use-create-virtual-mcp-5bjE35Lp.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Bt96Pub1.js → use-debounced-autosave-BwNSBrQD.js} +1 -1
- package/dist/client/assets/{use-debounced-value-KutXID4s.js → use-debounced-value-qjTBhtoV.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BCbLJTtF.js → use-decopilot-events-E3D17uZ3.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DTuplEmy.js → use-delete-connection-D-tPxqKr.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-7ATx6QPd.js → use-deployment-admin-BZ-iktfM.js} +1 -1
- package/dist/client/assets/{use-file-configs-BJxRx26Q.js → use-file-configs-BRfvb0LV.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DJF4Bq88.js → use-infinite-scroll-CYW4X7JC.js} +1 -1
- package/dist/client/assets/{use-join-requests-D-cXu4uc.js → use-join-requests-Bb_vw0fo.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BdcH2AAr.js → use-mcp-client-DGZ08Y8e.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DUZPd05e.js → use-mcp-prompts-D74mkwg7.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BhZCZNca.js → use-mcp-tools-B5iTOnEw.js} +1 -1
- package/dist/client/assets/{use-members-D2ADy_SQ.js → use-members-qflA3E7c.js} +1 -1
- package/dist/client/assets/{use-mobile-CMaygZmb.js → use-mobile-By_u8ixw.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BFFz8mSO.js → use-navigate-to-agent-DUyGpjg4.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Mq6_dHl5.js → use-org-auth-client-BujSnFJy.js} +1 -1
- package/dist/client/assets/{use-org-sso-Br7EvSJS.js → use-org-sso-zk4R_q3_.js} +1 -1
- package/dist/client/assets/{use-organization-roles-vbXYDT1Q.js → use-organization-roles-sCZ_uTyg.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DqYIIvrP.js → use-organization-settings-Dw2bNyak.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BcjXByDN.js → use-registry-connections-qE_J2XZV.js} +1 -1
- package/dist/client/assets/{use-secrets-Bf4bTSxf.js → use-secrets-gKHHVo8w.js} +1 -1
- package/dist/client/assets/{use-status-sounds-VC5seyB1.js → use-status-sounds-BFVcHBqH.js} +1 -1
- package/dist/client/assets/{use-view-mode-sA-TbW6V.js → use-view-mode-BFldqFYa.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C8ctxJhX.js → use-virtual-mcp-BO8V40gw.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C_ER8SDL.js +1 -0
- package/dist/client/assets/{useRouterState-BmwO-4b6.js → useRouterState-CpGQovi1.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C4gxwWHA.js +1 -0
- package/dist/client/assets/{users-CBHdkzLg.js → users-B-Y5Y6VT.js} +1 -1
- package/dist/client/assets/{variant-calendar-8twey6VW.js → variant-calendar-soIe9CBE.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-1IeTPrvb.js → view-mode-toggle-DjQW7OBV.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-NS1ZCez1.js +0 -1
- package/dist/client/assets/app-editor-9YM-GZC2.js +0 -1
- package/dist/client/assets/category-editor-ChglZmxt.js +0 -1
- package/dist/client/assets/collection-detail-UOi2wnnk.js +0 -1
- package/dist/client/assets/file-explorer-BvdpftwY.js +0 -2
- package/dist/client/assets/page-seo-sheet-CiZnYdHp.js +0 -1
- package/dist/client/assets/post-editor-BSDKdvDJ.js +0 -1
- package/dist/client/assets/project-app-view-DQB3cq3D.js +0 -1
- package/dist/client/assets/record-editor-D4XAQGuN.js +0 -1
- package/dist/client/assets/registry-OhtqP004.js +0 -2
- package/dist/client/assets/sections-editor-B8NpwMFb.js +0 -2
- package/dist/client/assets/seo-editor-DUryeA6Q.js +0 -1
- package/dist/client/assets/seo-save-FLLGxIUK.js +0 -1
- package/dist/client/assets/store-registry-DZliD663.js +0 -2
- package/dist/client/assets/useInfiniteQuery-GaTpQKsb.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BMdxCWpS.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-DyHUQRlz.js","assets/auth-entry-CjhmLnz0.js","assets/input-C3Rirubl.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/auth-split-layout-Dpf-nPNK.js","assets/cli-auth-success-BRy-NxMn.js","assets/reset-password-CldvJ8Wq.js","assets/oauth-callback-bZWA-VvB.js","assets/mcp-oauth-BQExdojx.js","assets/auth-Qjv7NhMS.js","assets/layout-DOGkXOpg.js","assets/useRouterState-CpGQovi1.js","assets/required-auth-layout-BC8u-kka.js","assets/use-deployment-admin-BZ-iktfM.js","assets/users-B-Y5Y6VT.js","assets/index-CA97b24W.js","assets/sidebar-C_Os3PcH.js","assets/LayoutLeft-BXKFuGem.js","assets/use-mobile-By_u8ixw.js","assets/X-Cteb_roe.js","assets/tooltip-BzvGoBJt.js","assets/collection-table-wrapper-C3H_A_xz.js","assets/table-BlwP8tRY.js","assets/ArrowUp-rkD_HZ8P.js","assets/empty-state-DKJCnKDH.js","assets/search-input-BQq9o40f.js","assets/SearchMd-u399I-U8.js","assets/avatar-DGwxsQN2.js","assets/User01-l1nuU6BZ.js","assets/badge-BQwEfJU4.js","assets/use-debounced-value-qjTBhtoV.js","assets/admin-fetch-CCSvjTk1.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/get-initials-D-f_fDFw.js","assets/orgs-BUeLl6_Z.js","assets/label-B_qG9hBJ.js","assets/dialog-PEI6UoxW.js","assets/select-BAgGTsPs.js","assets/Check-BqPyZLQD.js","assets/ChevronDown-CnwT1mzn.js","assets/ChevronUp-DyEeTUVg.js","assets/shell-layout-BmmfEuxL.js","assets/Users03-CKC5bCWK.js","assets/SearchLg-LmkvPKlo.js","assets/Stars02-DMehdEnh.js","assets/XClose-DlEEzpSj.js","assets/CheckCircle-CAJezFjV.js","assets/FilterLines-CP0tWCPE.js","assets/Zap-sfgXlWrU.js","assets/alert-dialog-k1jTn90-.js","assets/autosend-DX3Zzpl9.js","assets/use-mcp-client-DGZ08Y8e.js","assets/constants-B72Xmt_K.js","assets/hooks-C2D4zi1P.js","assets/decopilot-sse-pool-CWyHzlYU.js","assets/tab-id-bb-jjgGv.js","assets/use-organization-settings-Dw2bNyak.js","assets/studio-tools-BQ_BglCi.js","assets/use-org-sso-zk4R_q3_.js","assets/onboarding-B3pVNKOu.js","assets/organization-choice-MpYOALKm.js","assets/switch-tuaEWa67.js","assets/Globe04-DhVhlypi.js","assets/Palette-Dhj0ki3L.js","assets/Upload01-CkgWiY_F.js","assets/commerce-onboarding-BjeDrjZF.js","assets/XCircle-wfHfVXUq.js","assets/integration-icon-CIzHynOH.js","assets/agent-icon-DzoFzJug.js","assets/AlertCircle-Ckjfi5CH.js","assets/Tool01-afck1aOJ.js","assets/Settings02-FvY_WrCl.js","assets/ArrowUpRight-BLtI0F49.js","assets/ZapSquare-BkH7GX2j.js","assets/Loading02-sBz7BJ1q.js","assets/ChevronRight-D1QQje8D.js","assets/Circle-acrc1-5x.js","assets/Copy01-evFlatZI.js","assets/ZoomOut-CdvzCj0T.js","assets/DotsVertical-DH6RqqNz.js","assets/Globe01-z5xFpMbi.js","assets/Eye-jSmQrVvy.js","assets/Star01-D4HIeFV4.js","assets/SwitchHorizontal01-BMyKSURs.js","assets/HardDrive-Bs1M6Hvn.js","assets/Key01-Cb_sZVe8.js","assets/LinkExternal01-DQeBBiDb.js","assets/List-BxYpph4d.js","assets/Monitor01-JTUoetfA.js","assets/Sun-DzU87xA1.js","assets/Play-DSn_fJ5I.js","assets/Plus-CpRHfh-d.js","assets/Shield01-Rg8a4xQi.js","assets/Stars01-CzMXezZV.js","assets/Trash01-Cwa4v7Ml.js","assets/Users01-8CrcPzGC.js","assets/extract-connection-data-CRLwd6e7.js","assets/github-installations-D2vHSx02.js","assets/form-C1rNn4k6.js","assets/authenticate-and-persist-oauth-DpJjlm5V.js","assets/index-DRvJRGa6.js","assets/skeleton-4HubKfur.js","assets/toolbar-icon-button-B79y2ICd.js","assets/popover-Dot0rTJL.js","assets/drawer-CW08mroo.js","assets/index-DXSiQMy7.js","assets/invite-member-dialog-B_Ev4fOf.js","assets/textarea-DwT5RbAY.js","assets/use-org-auth-client-BujSnFJy.js","assets/use-organization-roles-sCZ_uTyg.js","assets/agent-capabilities-Bl8V-IcK.js","assets/connection-slug-eyAPH6o3.js","assets/connection-card-DDlzd240.js","assets/use-registry-connections-qE_J2XZV.js","assets/use-connection-D_bvpL3s.js","assets/use-collections-BMd7toro.js","assets/useInfiniteQuery-C_ER8SDL.js","assets/use-infinite-scroll-CYW4X7JC.js","assets/card-CaPUDQMR.js","assets/collection-search-BenYn43P.js","assets/collection-tabs-D1IpI5td.js","assets/connection-form-helpers-JXDOtVIm.js","assets/useSuspenseInfiniteQuery-C4gxwWHA.js","assets/use-ai-providers-CozhHADu.js","assets/connect-desktop-dialog-DyDEdtY1.js","assets/chat-context-D1agoSZr.js","assets/use-virtual-mcp-BO8V40gw.js","assets/use-decopilot-events-E3D17uZ3.js","assets/toggle-group-9fFnAM5M.js","assets/command-DrWU6m5z.js","assets/index-CCvcVLlX.js","assets/shell-controls-CNJcsxg1.js","assets/use-clock-tick-DNM9eBUk.js","assets/use-navigate-to-agent-DUyGpjg4.js","assets/reusable-new-chat-CouMjkYR.js","assets/breadcrumb-BJWIHuqO.js","assets/github-repo-picker-CUgtUqyb.js","assets/use-mcp-tools-B5iTOnEw.js","assets/toolbar-CnJJ4eu5.js","assets/index-C1OKchwi.js","assets/automation-runs-Dy1JESzQ.js","assets/use-members-qflA3E7c.js","assets/use-automations-D3QGnMVz.js","assets/checkbox-D5lnR8wp.js","assets/use-copy-CfpTy51n.js","assets/file-type-icon-BpXPQv3v.js","assets/monaco-editor-qEZd2OY7.js","assets/index-C3-boS0g.js","assets/types-qR--dQ-D.js","assets/use-mcp-prompts-D74mkwg7.js","assets/tabs-H8L7nqeW.js","assets/select-model-BWTLQCs1.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-DRqGNV4u.js","assets/dropdown-menu-3AB2tgYT.js","assets/index-DXJraMAU.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-BFVcHBqH.js","assets/use-capability-CqwMtAEs.js","assets/tools-list-BkmrRVg0.js","assets/use-debounced-autosave-BwNSBrQD.js","assets/use-secrets-gKHHVo8w.js","assets/formatDistanceToNow-Cb2QZZJn.js","assets/index-C5c1_CFi.js","assets/calendar-D9HHKNhR.js","assets/use-file-configs-BRfvb0LV.js","assets/automation-list-row-fxbcdSMq.js","assets/index-DDGTF8rc.css","assets/index-JAv4b7xn.js","assets/settings-layout-BWtmqWri.js","assets/use-join-requests-Bb_vw0fo.js","assets/index-redirect-XAsgVCK7.js","assets/capability-load-error-B5enhri-.js","assets/connections-GBz8DR7k.js","assets/collection-display-button-DXVH8deL.js","assets/view-mode-toggle-DjQW7OBV.js","assets/use-delete-connection-D-tPxqKr.js","assets/use-view-mode-BFldqFYa.js","assets/connection-detail-BwuDYyyX.js","assets/index-BorSr1F7.js","assets/index-D5FSJZrv.js","assets/index-BC7A-4eo.js","assets/use-create-virtual-mcp-5bjE35Lp.js","assets/monitoring-stats-row-36QuOlXN.js","assets/collection-detail-AgoVpHZK.js","assets/alert-BseR7lL7.js","assets/index-Cz2K9IhP.js","assets/require-capability-BhlwYJmb.js","assets/access-gate-Bwfhmk-C.js","assets/general-0SucHlcy.js","assets/domain-settings-B9jhB5je.js","assets/brand-context-CEEM_0kN.js","assets/ai-providers-BXgftXJ-.js","assets/secrets-c113z7Ow.js","assets/buckets-COiudA57.js","assets/members-BwJT85YH.js","assets/roles-C2KkgwN_.js","assets/sso-CE7J0MVA.js","assets/profile-DLHF7ILW.js","assets/store-CNLQyTjq.js","assets/registry-CYWFdNYv.js","assets/store-registry-As-nKPZf.js","assets/agents-list-DK6QZzyJ.js","assets/automations-DvN61x0o.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function Tj(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const Cj="modulepreload",Aj=function(e){return"/"+e},v2={},ft=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");o=l(n.map(f=>{if(f=Aj(f),f in v2)return;v2[f]=!0;const p=f.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":Cj,p||(g.as="script"),g.crossOrigin="",g.href=f,d&&g.setAttribute("nonce",d),document.head.appendChild(g),p)return new Promise((v,_)=>{g.addEventListener("load",v),g.addEventListener("error",()=>_(Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var Ece=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iy={exports:{}},Wu={};var y2;function Ij(){if(y2)return Wu;y2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Wu.Fragment=t,Wu.jsx=n,Wu.jsxs=n,Wu}var _2;function Pj(){return _2||(_2=1,Iy.exports=Ij()),Iy.exports}var C=Pj(),Py={exports:{}},Qu={},My={exports:{}},Ny={};var b2;function Mj(){return b2||(b2=1,(function(e){function t(H,W){var te=H.length;H.push(W);e:for(;0<te;){var le=te-1>>>1,Q=H[le];if(0<o(Q,W))H[le]=W,H[te]=Q,te=le;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var W=H[0],te=H.pop();if(te!==W){H[0]=te;e:for(var le=0,Q=H.length,k=Q>>>1;le<k;){var G=2*(le+1)-1,V=H[G],D=G+1,U=H[D];if(0>o(V,te))D<Q&&0>o(U,V)?(H[le]=U,H[D]=te,le=D):(H[le]=V,H[G]=te,le=G);else if(D<Q&&0>o(U,te))H[le]=U,H[D]=te,le=D;else break e}}return W}function o(H,W){var te=H.sortIndex-W.sortIndex;return te!==0?te:H.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],p=1,h=null,g=3,v=!1,_=!1,b=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function R(H){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=H)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function O(H){if(b=!1,R(H),!_)if(n(d)!==null)_=!0,A||(A=!0,B());else{var W=n(f);W!==null&&ie(O,W.startTime-H)}}var A=!1,I=-1,M=5,L=-1;function q(){return x?!0:!(e.unstable_now()-L<M)}function j(){if(x=!1,A){var H=e.unstable_now();L=H;var W=!0;try{e:{_=!1,b&&(b=!1,E(I),I=-1),v=!0;var te=g;try{t:{for(R(H),h=n(d);h!==null&&!(h.expirationTime>H&&q());){var le=h.callback;if(typeof le=="function"){h.callback=null,g=h.priorityLevel;var Q=le(h.expirationTime<=H);if(H=e.unstable_now(),typeof Q=="function"){h.callback=Q,R(H),W=!0;break t}h===n(d)&&r(d),R(H)}else r(d);h=n(d)}if(h!==null)W=!0;else{var k=n(f);k!==null&&ie(O,k.startTime-H),W=!1}}break e}finally{h=null,g=te,v=!1}W=void 0}}finally{W?B():A=!1}}}var B;if(typeof T=="function")B=function(){T(j)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,Z=F.port2;F.port1.onmessage=j,B=function(){Z.postMessage(null)}}else B=function(){S(j,0)};function ie(H,W){I=S(function(){H(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(H){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var te=g;g=W;try{return H()}finally{g=te}},e.unstable_requestPaint=function(){x=!0},e.unstable_runWithPriority=function(H,W){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var te=g;g=H;try{return W()}finally{g=te}},e.unstable_scheduleCallback=function(H,W,te){var le=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?le+te:le):te=le,H){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=te+Q,H={id:p++,callback:W,priorityLevel:H,startTime:te,expirationTime:Q,sortIndex:-1},te>le?(H.sortIndex=te,t(f,H),n(d)===null&&H===n(f)&&(b?(E(I),I=-1):b=!0,ie(O,te-le))):(H.sortIndex=Q,t(d,H),_||v||(_=!0,A||(A=!0,B()))),H},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(H){var W=g;return function(){var te=g;g=W;try{return H.apply(this,arguments)}finally{g=te}}}})(Ny)),Ny}var w2;function Nj(){return w2||(w2=1,My.exports=Mj()),My.exports}var ky={exports:{}},ot={};var S2;function kj(){if(S2)return ot;S2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.iterator;function v(k){return k===null||typeof k!="object"?null:(k=g&&k[g]||k["@@iterator"],typeof k=="function"?k:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function S(k,G,V){this.props=k,this.context=G,this.refs=x,this.updater=V||_}S.prototype.isReactComponent={},S.prototype.setState=function(k,G){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,G,"setState")},S.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function E(){}E.prototype=S.prototype;function T(k,G,V){this.props=k,this.context=G,this.refs=x,this.updater=V||_}var R=T.prototype=new E;R.constructor=T,b(R,S.prototype),R.isPureReactComponent=!0;var O=Array.isArray;function A(){}var I={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function L(k,G,V){var D=V.ref;return{$$typeof:e,type:k,key:G,ref:D!==void 0?D:null,props:V}}function q(k,G){return L(k.type,G,k.props)}function j(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function B(k){var G={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(V){return G[V]})}var F=/\/+/g;function Z(k,G){return typeof k=="object"&&k!==null&&k.key!=null?B(""+k.key):G.toString(36)}function ie(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(A,A):(k.status="pending",k.then(function(G){k.status==="pending"&&(k.status="fulfilled",k.value=G)},function(G){k.status==="pending"&&(k.status="rejected",k.reason=G)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function H(k,G,V,D,U){var X=typeof k;(X==="undefined"||X==="boolean")&&(k=null);var fe=!1;if(k===null)fe=!0;else switch(X){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(k.$$typeof){case e:case t:fe=!0;break;case p:return fe=k._init,H(fe(k._payload),G,V,D,U)}}if(fe)return U=U(k),fe=D===""?"."+Z(k,0):D,O(U)?(V="",fe!=null&&(V=fe.replace(F,"$&/")+"/"),H(U,G,V,"",function(je){return je})):U!=null&&(j(U)&&(U=q(U,V+(U.key==null||k&&k.key===U.key?"":(""+U.key).replace(F,"$&/")+"/")+fe)),G.push(U)),1;fe=0;var pe=D===""?".":D+":";if(O(k))for(var xe=0;xe<k.length;xe++)D=k[xe],X=pe+Z(D,xe),fe+=H(D,G,V,X,U);else if(xe=v(k),typeof xe=="function")for(k=xe.call(k),xe=0;!(D=k.next()).done;)D=D.value,X=pe+Z(D,xe++),fe+=H(D,G,V,X,U);else if(X==="object"){if(typeof k.then=="function")return H(ie(k),G,V,D,U);throw G=String(k),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return fe}function W(k,G,V){if(k==null)return k;var D=[],U=0;return H(k,D,"","",function(X){return G.call(V,X,U++)}),D}function te(k){if(k._status===-1){var G=k._result;G=G(),G.then(function(V){(k._status===0||k._status===-1)&&(k._status=1,k._result=V)},function(V){(k._status===0||k._status===-1)&&(k._status=2,k._result=V)}),k._status===-1&&(k._status=0,k._result=G)}if(k._status===1)return k._result.default;throw k._result}var le=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},Q={map:W,forEach:function(k,G,V){W(k,function(){G.apply(this,arguments)},V)},count:function(k){var G=0;return W(k,function(){G++}),G},toArray:function(k){return W(k,function(G){return G})||[]},only:function(k){if(!j(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return ot.Activity=h,ot.Children=Q,ot.Component=S,ot.Fragment=n,ot.Profiler=o,ot.PureComponent=T,ot.StrictMode=r,ot.Suspense=d,ot.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ot.__COMPILER_RUNTIME={__proto__:null,c:function(k){return I.H.useMemoCache(k)}},ot.cache=function(k){return function(){return k.apply(null,arguments)}},ot.cacheSignal=function(){return null},ot.cloneElement=function(k,G,V){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var D=b({},k.props),U=k.key;if(G!=null)for(X in G.key!==void 0&&(U=""+G.key),G)!M.call(G,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&G.ref===void 0||(D[X]=G[X]);var X=arguments.length-2;if(X===1)D.children=V;else if(1<X){for(var fe=Array(X),pe=0;pe<X;pe++)fe[pe]=arguments[pe+2];D.children=fe}return L(k.type,U,D)},ot.createContext=function(k){return k={$$typeof:l,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:s,_context:k},k},ot.createElement=function(k,G,V){var D,U={},X=null;if(G!=null)for(D in G.key!==void 0&&(X=""+G.key),G)M.call(G,D)&&D!=="key"&&D!=="__self"&&D!=="__source"&&(U[D]=G[D]);var fe=arguments.length-2;if(fe===1)U.children=V;else if(1<fe){for(var pe=Array(fe),xe=0;xe<fe;xe++)pe[xe]=arguments[xe+2];U.children=pe}if(k&&k.defaultProps)for(D in fe=k.defaultProps,fe)U[D]===void 0&&(U[D]=fe[D]);return L(k,X,U)},ot.createRef=function(){return{current:null}},ot.forwardRef=function(k){return{$$typeof:c,render:k}},ot.isValidElement=j,ot.lazy=function(k){return{$$typeof:p,_payload:{_status:-1,_result:k},_init:te}},ot.memo=function(k,G){return{$$typeof:f,type:k,compare:G===void 0?null:G}},ot.startTransition=function(k){var G=I.T,V={};I.T=V;try{var D=k(),U=I.S;U!==null&&U(V,D),typeof D=="object"&&D!==null&&typeof D.then=="function"&&D.then(A,le)}catch(X){le(X)}finally{G!==null&&V.types!==null&&(G.types=V.types),I.T=G}},ot.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ot.use=function(k){return I.H.use(k)},ot.useActionState=function(k,G,V){return I.H.useActionState(k,G,V)},ot.useCallback=function(k,G){return I.H.useCallback(k,G)},ot.useContext=function(k){return I.H.useContext(k)},ot.useDebugValue=function(){},ot.useDeferredValue=function(k,G){return I.H.useDeferredValue(k,G)},ot.useEffect=function(k,G){return I.H.useEffect(k,G)},ot.useEffectEvent=function(k){return I.H.useEffectEvent(k)},ot.useId=function(){return I.H.useId()},ot.useImperativeHandle=function(k,G,V){return I.H.useImperativeHandle(k,G,V)},ot.useInsertionEffect=function(k,G){return I.H.useInsertionEffect(k,G)},ot.useLayoutEffect=function(k,G){return I.H.useLayoutEffect(k,G)},ot.useMemo=function(k,G){return I.H.useMemo(k,G)},ot.useOptimistic=function(k,G){return I.H.useOptimistic(k,G)},ot.useReducer=function(k,G,V){return I.H.useReducer(k,G,V)},ot.useRef=function(k){return I.H.useRef(k)},ot.useState=function(k){return I.H.useState(k)},ot.useSyncExternalStore=function(k,G,V){return I.H.useSyncExternalStore(k,G,V)},ot.useTransition=function(){return I.H.useTransition()},ot.version="19.2.6",ot}var E2;function ma(){return E2||(E2=1,ky.exports=kj()),ky.exports}var Dy={exports:{}},Er={};var x2;function Dj(){if(x2)return Er;x2=1;var e=ma();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(d,f,p){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:h==null?null:""+h,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Er.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(d,f,null,p)},Er.flushSync=function(d){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=p,r.d.f()}},Er.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},Er.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Er.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,h=c(p,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:h,integrity:g,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:h,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Er.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},Er.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,h=c(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Er.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},Er.requestFormReset=function(d){r.d.r(d)},Er.unstable_batchedUpdates=function(d,f){return d(f)},Er.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},Er.useFormStatus=function(){return l.H.useHostTransitionStatus()},Er.version="19.2.6",Er}var R2;function tM(){if(R2)return Dy.exports;R2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dy.exports=Dj(),Dy.exports}var O2;function Lj(){if(O2)return Qu;O2=1;var e=Nj(),t=ma(),n=tM();function r(i){var a="https://react.dev/errors/"+i;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var a=i,u=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(u=a.return),i=a.return;while(i)}return a.tag===3?u:null}function l(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function c(i){if(i.tag===31){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function d(i){if(s(i)!==i)throw Error(r(188))}function f(i){var a=i.alternate;if(!a){if(a=s(i),a===null)throw Error(r(188));return a!==i?null:i}for(var u=i,m=a;;){var y=u.return;if(y===null)break;var w=y.alternate;if(w===null){if(m=y.return,m!==null){u=m;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===u)return d(y),i;if(w===m)return d(y),a;w=w.sibling}throw Error(r(188))}if(u.return!==m.return)u=y,m=w;else{for(var N=!1,z=y.child;z;){if(z===u){N=!0,u=y,m=w;break}if(z===m){N=!0,m=y,u=w;break}z=z.sibling}if(!N){for(z=w.child;z;){if(z===u){N=!0,u=w,m=y;break}if(z===m){N=!0,m=w,u=y;break}z=z.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==m)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:a}function p(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i;for(i=i.child;i!==null;){if(a=p(i),a!==null)return a;i=i.sibling}return null}var h=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function B(i){return i===null||typeof i!="object"?null:(i=j&&i[j]||i["@@iterator"],typeof i=="function"?i:null)}var F=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===F?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case b:return"Fragment";case S:return"Profiler";case x:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case L:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case _:return"Portal";case T:return i.displayName||"Context";case E:return(i._context.displayName||"Context")+".Consumer";case R:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case I:return a=i.displayName||null,a!==null?a:Z(i.type)||"Memo";case M:a=i._payload,i=i._init;try{return Z(i(a))}catch{}}return null}var ie=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},le=[],Q=-1;function k(i){return{current:i}}function G(i){0>Q||(i.current=le[Q],le[Q]=null,Q--)}function V(i,a){Q++,le[Q]=i.current,i.current=a}var D=k(null),U=k(null),X=k(null),fe=k(null);function pe(i,a){switch(V(X,a),V(U,i),V(D,null),a.nodeType){case 9:case 11:i=(i=a.documentElement)&&(i=i.namespaceURI)?UO(i):0;break;default:if(i=a.tagName,a=a.namespaceURI)a=UO(a),i=FO(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(D),V(D,i)}function xe(){G(D),G(U),G(X)}function je(i){i.memoizedState!==null&&V(fe,i);var a=D.current,u=FO(a,i.type);a!==u&&(V(U,i),V(D,u))}function Y(i){U.current===i&&(G(D),G(U)),fe.current===i&&(G(fe),Gu._currentValue=te)}var re,ve;function se(i){if(re===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);re=a&&a[1]||"",ve=-1<u.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+re+i+ve}var Se=!1;function Te(i,a){if(!i||Se)return"";Se=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(a){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(ge){var he=ge}Reflect.construct(i,[],Ee)}else{try{Ee.call()}catch(ge){he=ge}i.call(Ee.prototype)}}else{try{throw Error()}catch(ge){he=ge}(Ee=i())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(ge){if(ge&&he&&typeof ge.stack=="string")return[ge.stack,he.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=m.DetermineComponentFrameRoot(),N=w[0],z=w[1];if(N&&z){var J=N.split(`
|
|
@@ -43,9 +43,9 @@ Error generating stack: `+m.message+`
|
|
|
43
43
|
newResult[${O}] = ${R}.value;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(T,R)=>E(g,T,R)};let s;const l=Zd,c=!XM.jitless,f=c&&M9.value,p=t.catchall;let h;e._zod.parse=(g,v)=>{h??(h=r.value);const _=g.value;return l(_)?c&&f&&v?.async===!1&&v.jitless!==!0?(s||(s=o(t.shape)),g=s(g,v),p?p3([],_,g,v,h,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),g)}});function _T(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Tc(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(l=>fa(l,r,da())))}),t)}const m3=ye("$ZodUnion",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),It(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>$w(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let l=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:o.value,issues:[]},s);if(f instanceof Promise)c.push(f),l=!0;else{if(f.issues.length===0)return f;c.push(f)}}return l?Promise.all(c).then(d=>_T(d,o,e,s)):_T(c,o,e,s)}}),CU=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,m3.init(e,t);const n=e._zod.parse;It(e._zod,"propValues",()=>{const o={};for(const s of t.options){const l=s._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[c,d]of Object.entries(l)){o[c]||(o[c]=new Set);for(const f of d)o[c].add(f)}}return o});const r=Lg(()=>{const o=t.options,s=new Map;for(const l of o){const c=l._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of c){if(s.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);s.set(d,l)}}return s});e._zod.parse=(o,s)=>{const l=o.value;if(!Zd(l))return o.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),o;const c=r.value.get(l?.[t.discriminator]);return c?c._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),o)}}),AU=ye("$ZodIntersection",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),l=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||l instanceof Promise?Promise.all([s,l]).then(([d,f])=>bT(n,d,f)):bT(n,s,l)}});function Fb(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qc(e)&&qc(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const l=Fb(e[s],t[s]);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};o[s]=l.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],l=Fb(o,s);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function bT(e,t,n){const r=new Map;let o;for(const c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o&&e.issues.push({...o,keys:s}),Tc(e))return e;const l=Fb(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const IU=ye("$ZodTuple",(e,t)=>{Bt.init(e,t);const n=t.items;e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const l=[],c=[...n].reverse().findIndex(p=>p._zod.optin!=="optional"),d=c===-1?0:n.length-c;if(!t.rest){const p=s.length>n.length,h=s.length<d-1;if(p||h)return r.issues.push({...p?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:s,inst:e,origin:"array"}),r}let f=-1;for(const p of n){if(f++,f>=s.length&&f>=d)continue;const h=p._zod.run({value:s[f],issues:[]},o);h instanceof Promise?l.push(h.then(g=>Xh(g,r,f))):Xh(h,r,f)}if(t.rest){const p=s.slice(n.length);for(const h of p){f++;const g=t.rest._zod.run({value:h,issues:[]},o);g instanceof Promise?l.push(g.then(v=>Xh(v,r,f))):Xh(g,r,f)}}return l.length?Promise.all(l).then(()=>r):r}});function Xh(e,t,n){e.issues.length&&t.issues.push(...nl(n,e.issues)),t.value[n]=e.value}const PU=ye("$ZodRecord",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!qc(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:o[f],issues:[]},r);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&n.issues.push(...nl(f,h.issues)),n.value[f]=h.value})):(p.issues.length&&n.issues.push(...nl(f,p.issues)),n.value[f]=p.value)}let d;for(const f in o)c.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:d})}else{n.value={};for(const c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&a3.test(c)&&d.issues.length){const h=t.keyType._zod.run({value:Number(c),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(d=h)}if(d.issues.length){t.mode==="loose"?n.value[c]=o[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>fa(h,r,da())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:o[c],issues:[]},r);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&n.issues.push(...nl(c,h.issues)),n.value[d.value]=h.value})):(p.issues.length&&n.issues.push(...nl(c,p.issues)),n.value[d.value]=p.value)}}return s.length?Promise.all(s).then(()=>n):n}}),MU=ye("$ZodEnum",(e,t)=>{Bt.init(e,t);const n=JM(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>N9.has(typeof o)).map(o=>typeof o=="string"?Hc(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const l=o.value;return r.has(l)||o.issues.push({code:"invalid_value",values:n,input:l,inst:e}),o}}),NU=ye("$ZodLiteral",(e,t)=>{if(Bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Hc(r):r?Hc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),kU=ye("$ZodFile",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;return o instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),n}}),DU=ye("$ZodTransform",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new QM(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(l=>(n.value=l,n));if(o instanceof Promise)throw new kc;return n.value=o,n}});function wT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const g3=ye("$ZodOptional",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$w(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>wT(s,n.value)):wT(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),LU=ye("$ZodExactOptional",(e,t)=>{g3.init(e,t),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),$U=ye("$ZodNullable",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$w(n.source)}|null)$`):void 0}),It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),jU=ye("$ZodDefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>ST(s,t)):ST(o,t)}});function ST(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zU=ye("$ZodPrefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),UU=ye("$ZodNonOptional",(e,t)=>{Bt.init(e,t),It(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>ET(s,e)):ET(o,e)}});function ET(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const FU=ye("$ZodCatch",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>fa(l,r,da()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>fa(s,r,da()))},input:n.value}),n.issues=[]),n)}}),BU=ye("$ZodPipe",(e,t)=>{Bt.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(l=>Jh(l,t.in,r)):Jh(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Jh(s,t.out,r)):Jh(o,t.out,r)}});function Jh(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const VU=ye("$ZodReadonly",(e,t)=>{Bt.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>t.innerType?._zod?.optin),It(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(xT):xT(o)}});function xT(e){return e.value=Object.freeze(e.value),e}const qU=ye("$ZodLazy",(e,t)=>{Bt.init(e,t),It(e._zod,"innerType",()=>t.getter()),It(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),It(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),It(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),It(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),HU=ye("$ZodCustom",(e,t)=>{yr.init(e,t),Bt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>RT(s,n,r,e));RT(o,n,r,e)}});function RT(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Yd(o))}}var OT;class GU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function KU(){return new GU}(OT=globalThis).__zod_globalRegistry??(OT.__zod_globalRegistry=KU());const wd=globalThis.__zod_globalRegistry;function ZU(e,t){return new e({type:"string",...Fe(t)})}function YU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function TT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function XU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function JU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function v3(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function eF(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function tF(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function nF(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function rF(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function oF(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function iF(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function sF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function aF(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function lF(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function cF(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function uF(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function dF(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function fF(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function hF(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function pF(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function mF(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function gF(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function vF(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function yF(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function _F(e,t){return new e({type:"number",checks:[],...Fe(t)})}function bF(e,t){return new e({type:"number",coerce:!0,checks:[],...Fe(t)})}function wF(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function SF(e,t){return new e({type:"boolean",...Fe(t)})}function EF(e,t){return new e({type:"boolean",coerce:!0,...Fe(t)})}function xF(e,t){return new e({type:"undefined",...Fe(t)})}function RF(e,t){return new e({type:"null",...Fe(t)})}function OF(e){return new e({type:"any"})}function TF(e){return new e({type:"unknown"})}function CF(e,t){return new e({type:"never",...Fe(t)})}function CT(e,t){return new c3({check:"less_than",...Fe(t),value:e,inclusive:!1})}function Wy(e,t){return new c3({check:"less_than",...Fe(t),value:e,inclusive:!0})}function AT(e,t){return new u3({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function Qy(e,t){return new u3({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function IT(e,t){return new Iz({check:"multiple_of",...Fe(t),value:e})}function AF(e,t){return new Mz({check:"max_size",...Fe(t),maximum:e})}function IF(e,t){return new Nz({check:"min_size",...Fe(t),minimum:e})}function y3(e,t){return new kz({check:"max_length",...Fe(t),maximum:e})}function jm(e,t){return new Dz({check:"min_length",...Fe(t),minimum:e})}function _3(e,t){return new Lz({check:"length_equals",...Fe(t),length:e})}function PF(e,t){return new $z({check:"string_format",format:"regex",...Fe(t),pattern:e})}function MF(e){return new jz({check:"string_format",format:"lowercase",...Fe(e)})}function NF(e){return new zz({check:"string_format",format:"uppercase",...Fe(e)})}function kF(e,t){return new Uz({check:"string_format",format:"includes",...Fe(t),includes:e})}function DF(e,t){return new Fz({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function LF(e,t){return new Bz({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function $F(e,t){return new Vz({check:"mime_type",mime:e,...Fe(t)})}function nu(e){return new qz({check:"overwrite",tx:e})}function jF(e){return nu(t=>t.normalize(e))}function zF(){return nu(e=>e.trim())}function UF(){return nu(e=>e.toLowerCase())}function FF(){return nu(e=>e.toUpperCase())}function BF(){return nu(e=>P9(e))}function VF(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function qF(e,t){return new e({type:"file",...Fe(t)})}function HF(e,t,n){const r=Fe(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function GF(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function KF(e){const t=ZF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Yd(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Yd(o))}},e(n.value,n)));return t}function ZF(e,t){const n=new yr({check:"custom",...Fe(t)});return n._zod.check=e,n}function zm(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??wd,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function an(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const g=l.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,g,p)}const h=e._zod.parent;h&&(l.ref||(l.ref=h),an(h,t,p),t.seen.get(h).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&Dr(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function Um(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const d=r.get(c);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const o=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(l[0])?.id,g=e.external.uri??(_=>_);if(h)return{ref:g(h)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${g("__shared")}#/${c}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:d,defId:f}=o(l);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const h in p)delete p[h];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
46
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(T,R)=>E(g,T,R)};let s;const l=Zd,c=!XM.jitless,f=c&&M9.value,p=t.catchall;let h;e._zod.parse=(g,v)=>{h??(h=r.value);const _=g.value;return l(_)?c&&f&&v?.async===!1&&v.jitless!==!0?(s||(s=o(t.shape)),g=s(g,v),p?p3([],_,g,v,h,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),g)}});function _T(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Tc(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(l=>fa(l,r,da())))}),t)}const m3=ye("$ZodUnion",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),It(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>$w(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let l=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:o.value,issues:[]},s);if(f instanceof Promise)c.push(f),l=!0;else{if(f.issues.length===0)return f;c.push(f)}}return l?Promise.all(c).then(d=>_T(d,o,e,s)):_T(c,o,e,s)}}),CU=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,m3.init(e,t);const n=e._zod.parse;It(e._zod,"propValues",()=>{const o={};for(const s of t.options){const l=s._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[c,d]of Object.entries(l)){o[c]||(o[c]=new Set);for(const f of d)o[c].add(f)}}return o});const r=Lg(()=>{const o=t.options,s=new Map;for(const l of o){const c=l._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of c){if(s.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);s.set(d,l)}}return s});e._zod.parse=(o,s)=>{const l=o.value;if(!Zd(l))return o.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),o;const c=r.value.get(l?.[t.discriminator]);return c?c._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),o)}}),AU=ye("$ZodIntersection",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),l=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||l instanceof Promise?Promise.all([s,l]).then(([d,f])=>bT(n,d,f)):bT(n,s,l)}});function Fb(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qc(e)&&qc(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const l=Fb(e[s],t[s]);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};o[s]=l.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],l=Fb(o,s);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function bT(e,t,n){const r=new Map;let o;for(const c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o&&e.issues.push({...o,keys:s}),Tc(e))return e;const l=Fb(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const IU=ye("$ZodTuple",(e,t)=>{Bt.init(e,t);const n=t.items;e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const l=[],c=[...n].reverse().findIndex(p=>p._zod.optin!=="optional"),d=c===-1?0:n.length-c;if(!t.rest){const p=s.length>n.length,h=s.length<d-1;if(p||h)return r.issues.push({...p?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:s,inst:e,origin:"array"}),r}let f=-1;for(const p of n){if(f++,f>=s.length&&f>=d)continue;const h=p._zod.run({value:s[f],issues:[]},o);h instanceof Promise?l.push(h.then(g=>Xh(g,r,f))):Xh(h,r,f)}if(t.rest){const p=s.slice(n.length);for(const h of p){f++;const g=t.rest._zod.run({value:h,issues:[]},o);g instanceof Promise?l.push(g.then(v=>Xh(v,r,f))):Xh(g,r,f)}}return l.length?Promise.all(l).then(()=>r):r}});function Xh(e,t,n){e.issues.length&&t.issues.push(...nl(n,e.issues)),t.value[n]=e.value}const PU=ye("$ZodRecord",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!qc(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:o[f],issues:[]},r);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&n.issues.push(...nl(f,h.issues)),n.value[f]=h.value})):(p.issues.length&&n.issues.push(...nl(f,p.issues)),n.value[f]=p.value)}let d;for(const f in o)c.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:d})}else{n.value={};for(const c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&a3.test(c)&&d.issues.length){const h=t.keyType._zod.run({value:Number(c),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(d=h)}if(d.issues.length){t.mode==="loose"?n.value[c]=o[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>fa(h,r,da())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:o[c],issues:[]},r);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&n.issues.push(...nl(c,h.issues)),n.value[d.value]=h.value})):(p.issues.length&&n.issues.push(...nl(c,p.issues)),n.value[d.value]=p.value)}}return s.length?Promise.all(s).then(()=>n):n}}),MU=ye("$ZodEnum",(e,t)=>{Bt.init(e,t);const n=JM(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>N9.has(typeof o)).map(o=>typeof o=="string"?Hc(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const l=o.value;return r.has(l)||o.issues.push({code:"invalid_value",values:n,input:l,inst:e}),o}}),NU=ye("$ZodLiteral",(e,t)=>{if(Bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Hc(r):r?Hc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),kU=ye("$ZodFile",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;return o instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),n}}),DU=ye("$ZodTransform",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new QM(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(l=>(n.value=l,n));if(o instanceof Promise)throw new kc;return n.value=o,n}});function wT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const g3=ye("$ZodOptional",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$w(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>wT(s,n.value)):wT(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),LU=ye("$ZodExactOptional",(e,t)=>{g3.init(e,t),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),$U=ye("$ZodNullable",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$w(n.source)}|null)$`):void 0}),It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),jU=ye("$ZodDefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>ST(s,t)):ST(o,t)}});function ST(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zU=ye("$ZodPrefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),UU=ye("$ZodNonOptional",(e,t)=>{Bt.init(e,t),It(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>ET(s,e)):ET(o,e)}});function ET(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const FU=ye("$ZodCatch",(e,t)=>{Bt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>fa(l,r,da()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>fa(s,r,da()))},input:n.value}),n.issues=[]),n)}}),BU=ye("$ZodPipe",(e,t)=>{Bt.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(l=>Jh(l,t.in,r)):Jh(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Jh(s,t.out,r)):Jh(o,t.out,r)}});function Jh(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const VU=ye("$ZodReadonly",(e,t)=>{Bt.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>t.innerType?._zod?.optin),It(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(xT):xT(o)}});function xT(e){return e.value=Object.freeze(e.value),e}const qU=ye("$ZodLazy",(e,t)=>{Bt.init(e,t),It(e._zod,"innerType",()=>t.getter()),It(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),It(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),It(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),It(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),HU=ye("$ZodCustom",(e,t)=>{yr.init(e,t),Bt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>RT(s,n,r,e));RT(o,n,r,e)}});function RT(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Yd(o))}}var OT;class GU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function KU(){return new GU}(OT=globalThis).__zod_globalRegistry??(OT.__zod_globalRegistry=KU());const wd=globalThis.__zod_globalRegistry;function ZU(e,t){return new e({type:"string",...Fe(t)})}function YU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function TT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function XU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function JU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function v3(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function eF(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function tF(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function nF(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function rF(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function oF(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function iF(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function sF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function aF(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function lF(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function cF(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function uF(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function dF(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function fF(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function hF(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function pF(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function mF(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function gF(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function vF(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function yF(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function _F(e,t){return new e({type:"number",checks:[],...Fe(t)})}function bF(e,t){return new e({type:"number",coerce:!0,checks:[],...Fe(t)})}function wF(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function SF(e,t){return new e({type:"boolean",...Fe(t)})}function EF(e,t){return new e({type:"boolean",coerce:!0,...Fe(t)})}function xF(e,t){return new e({type:"undefined",...Fe(t)})}function RF(e,t){return new e({type:"null",...Fe(t)})}function OF(e){return new e({type:"any"})}function TF(e){return new e({type:"unknown"})}function CF(e,t){return new e({type:"never",...Fe(t)})}function CT(e,t){return new c3({check:"less_than",...Fe(t),value:e,inclusive:!1})}function Wy(e,t){return new c3({check:"less_than",...Fe(t),value:e,inclusive:!0})}function AT(e,t){return new u3({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function Qy(e,t){return new u3({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function IT(e,t){return new Iz({check:"multiple_of",...Fe(t),value:e})}function AF(e,t){return new Mz({check:"max_size",...Fe(t),maximum:e})}function IF(e,t){return new Nz({check:"min_size",...Fe(t),minimum:e})}function y3(e,t){return new kz({check:"max_length",...Fe(t),maximum:e})}function jm(e,t){return new Dz({check:"min_length",...Fe(t),minimum:e})}function _3(e,t){return new Lz({check:"length_equals",...Fe(t),length:e})}function PF(e,t){return new $z({check:"string_format",format:"regex",...Fe(t),pattern:e})}function MF(e){return new jz({check:"string_format",format:"lowercase",...Fe(e)})}function NF(e){return new zz({check:"string_format",format:"uppercase",...Fe(e)})}function kF(e,t){return new Uz({check:"string_format",format:"includes",...Fe(t),includes:e})}function DF(e,t){return new Fz({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function LF(e,t){return new Bz({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function $F(e,t){return new Vz({check:"mime_type",mime:e,...Fe(t)})}function nu(e){return new qz({check:"overwrite",tx:e})}function jF(e){return nu(t=>t.normalize(e))}function zF(){return nu(e=>e.trim())}function UF(){return nu(e=>e.toLowerCase())}function FF(){return nu(e=>e.toUpperCase())}function BF(){return nu(e=>P9(e))}function VF(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function qF(e,t){return new e({type:"file",...Fe(t)})}function HF(e,t,n){const r=Fe(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function GF(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function KF(e){const t=ZF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Yd(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Yd(o))}},e(n.value,n)));return t}function ZF(e,t){const n=new yr({check:"custom",...Fe(t)});return n._zod.check=e,n}function zm(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??wd,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function sn(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const g=l.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,g,p)}const h=e._zod.parent;h&&(l.ref||(l.ref=h),sn(h,t,p),t.seen.get(h).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&Dr(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function Um(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const d=r.get(c);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const o=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(l[0])?.id,g=e.external.uri??(_=>_);if(h)return{ref:g(h)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${g("__shared")}#/${c}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:d,defId:f}=o(l);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const h in p)delete p[h];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
47
47
|
|
|
48
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function Fm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.ref=null,p){r(p);const g=e.seen.get(p),v=g.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),l._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&g.def)for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}const h=l._zod.parent;if(h&&h!==p){r(h);const g=e.seen.get(h);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const v in d)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(d[v])===JSON.stringify(g.def[v])&&delete d[v]}e.override({zodSchema:l,jsonSchema:d,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bm(t,"input",e.processors),output:Bm(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Dr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Dr(r.element,n);if(r.type==="set")return Dr(r.valueType,n);if(r.type==="lazy")return Dr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Dr(r.innerType,n);if(r.type==="intersection")return Dr(r.left,n)||Dr(r.right,n);if(r.type==="record"||r.type==="map")return Dr(r.keyType,n)||Dr(r.valueType,n);if(r.type==="pipe")return Dr(r.in,n)||Dr(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Dr(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Dr(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Dr(o,n))return!0;return!!(r.rest&&Dr(r.rest,n))}return!1}const YF=(e,t={})=>n=>{const r=zm({...n,processors:t});return an(e,r),Um(r,e),Fm(r,e)},Bm=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},l=zm({...o??{},target:s,io:t,processors:n});return an(e,l),Um(l,e),Fm(l,e)},WF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},b3=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:l,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof l=="number"&&(o.maxLength=l),c&&(o.format=WF[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),f&&(o.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?o.pattern=p[0].source:p.length>1&&(o.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},w3=(e,t,n,r)=>{const o=n,{minimum:s,maximum:l,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=p,o.exclusiveMinimum=!0):o.exclusiveMinimum=p),typeof s=="number"&&(o.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=f,o.exclusiveMaximum=!0):o.exclusiveMaximum=f),typeof l=="number"&&(o.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete o.maximum:delete o.exclusiveMaximum)),typeof d=="number"&&(o.multipleOf=d)},S3=(e,t,n,r)=>{n.type="boolean"},QF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},XF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},E3=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},x3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},JF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},R3=(e,t,n,r)=>{n.not={}},O3=(e,t,n,r)=>{},T3=(e,t,n,r)=>{},eB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},C3=(e,t,n,r)=>{const o=e._zod.def,s=JM(o.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},A3=(e,t,n,r)=>{const o=e._zod.def,s=[];for(const l of o.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(l))}else s.push(l);if(s.length!==0)if(s.length===1){const l=s[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),s.every(l=>typeof l=="boolean")&&(n.type="boolean"),s.every(l=>l===null)&&(n.type="null"),n.enum=s},tB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},nB=(e,t,n,r)=>{const o=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},I3=(e,t,n,r)=>{const o=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:l,maximum:c,mime:d}=e._zod.bag;l!==void 0&&(s.minLength=l),c!==void 0&&(s.maxLength=c),d?d.length===1?(s.contentMediaType=d[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=d.map(f=>({contentMediaType:f}))):Object.assign(o,s)},rB=(e,t,n,r)=>{n.type="boolean"},P3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},oB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},M3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},iB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},sB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},N3=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=an(s.element,t,{...r,path:[...r.path,"items"]})},k3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const l=s.shape;for(const f in l)o.properties[f]=an(l[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(l)),d=new Set([...c].filter(f=>{const p=s.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(o.required=Array.from(d)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=an(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},D3=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,l=o.options.map((c,d)=>an(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",d]}));s?n.oneOf=l:n.anyOf=l},L3=(e,t,n,r)=>{const o=e._zod.def,s=an(o.left,t,{...r,path:[...r.path,"allOf",0]}),l=an(o.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=d},$3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="array";const l=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=s.items.map((g,v)=>an(g,t,{...r,path:[...r.path,l,v]})),f=s.rest?an(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=d,f&&(o.items=f)):t.target==="openapi-3.0"?(o.items={anyOf:d},f&&o.items.anyOf.push(f),o.minItems=d.length,f||(o.maxItems=d.length)):(o.items=d,f&&(o.additionalItems=f));const{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(o.minItems=p),typeof h=="number"&&(o.maxItems=h)},j3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const l=s.keyType,d=l._zod.bag?.patterns;if(s.mode==="loose"&&d&&d.size>0){const p=an(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of d)o.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=an(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=an(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const p=[...f].filter(h=>typeof h=="string"||typeof h=="number");p.length>0&&(o.required=p)}},z3=(e,t,n,r)=>{const o=e._zod.def,s=an(o.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},U3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},F3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},B3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},V3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let l;try{l=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},q3=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;an(s,t,r);const l=t.seen.get(e);l.ref=s},H3=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},aB=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Fw=(e,t,n,r)=>{const o=e._zod.def;an(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},G3=(e,t,n,r)=>{const o=e._zod.innerType;an(o,t,r);const s=t.seen.get(e);s.ref=o},PT={string:b3,number:w3,boolean:S3,bigint:QF,symbol:XF,null:E3,undefined:x3,void:JF,never:R3,any:O3,unknown:T3,date:eB,enum:C3,literal:A3,nan:tB,template_literal:nB,file:I3,success:rB,custom:P3,function:oB,transform:M3,map:iB,set:sB,array:N3,object:k3,union:D3,intersection:L3,tuple:$3,record:j3,nullable:z3,nonoptional:U3,default:F3,prefault:B3,catch:V3,pipe:q3,readonly:H3,promise:aB,optional:Fw,lazy:G3};function kce(e,t){if("_idmap"in e){const r=e,o=zm({...t,processors:PT}),s={};for(const d of r._idmap.entries()){const[f,p]=d;an(p,o)}const l={},c={registry:r,uri:t?.uri,defs:s};o.external=c;for(const d of r._idmap.entries()){const[f,p]=d;Um(o,p),l[f]=Fm(o,p)}if(Object.keys(s).length>0){const d=o.target==="draft-2020-12"?"$defs":"definitions";l.__shared={[d]:s}}return{schemas:l}}const n=zm({...t,processors:PT});return an(e,n),Um(n,e),Fm(n,e)}const lB=ye("ZodISODateTime",(e,t)=>{oU.init(e,t),wn.init(e,t)});function K3(e){return mF(lB,e)}const cB=ye("ZodISODate",(e,t)=>{iU.init(e,t),wn.init(e,t)});function uB(e){return gF(cB,e)}const dB=ye("ZodISOTime",(e,t)=>{sU.init(e,t),wn.init(e,t)});function fB(e){return vF(dB,e)}const hB=ye("ZodISODuration",(e,t)=>{aU.init(e,t),wn.init(e,t)});function pB(e){return yF(hB,e)}const mB=(e,t)=>{zw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>q9(e,n)},flatten:{value:n=>V9(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ub,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ub,2)}},isEmpty:{get(){return e.issues.length===0}}})},Bo=ye("ZodError",mB,{Parent:Error}),gB=jg(Bo),vB=zg(Bo),yB=Ug(Bo),_B=Fg(Bo),bB=Y9(Bo),wB=W9(Bo),SB=Q9(Bo),EB=X9(Bo),xB=J9(Bo),RB=ez(Bo),OB=tz(Bo),TB=nz(Bo),Kt=ye("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bm(e,"input"),output:Bm(e,"output")}}),e.toJSONSchema=YF(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ga(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>va(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>gB(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>yB(e,n,r),e.parseAsync=async(n,r)=>vB(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>_B(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>bB(e,n,r),e.decode=(n,r)=>wB(e,n,r),e.encodeAsync=async(n,r)=>SB(e,n,r),e.decodeAsync=async(n,r)=>EB(e,n,r),e.safeEncode=(n,r)=>xB(e,n,r),e.safeDecode=(n,r)=>RB(e,n,r),e.safeEncodeAsync=async(n,r)=>OB(e,n,r),e.safeDecodeAsync=async(n,r)=>TB(e,n,r),e.refine=(n,r)=>e.check(EV(n,r)),e.superRefine=n=>e.check(xV(n)),e.overwrite=n=>e.check(nu(n)),e.optional=()=>bn(e),e.exactOptional=()=>cV(e),e.nullable=()=>kT(e),e.nullish=()=>bn(kT(e)),e.nonoptional=n=>mV(e,n),e.array=()=>Re(e),e.or=n=>nn([e,n]),e.and=n=>Hw(e,n),e.transform=n=>Vb(e,J3(n)),e.default=n=>fV(e,n),e.prefault=n=>pV(e,n),e.catch=n=>vV(e,n),e.pipe=n=>Vb(e,n),e.readonly=()=>bV(e),e.describe=n=>{const r=e.clone();return wd.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return wd.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return wd.get(e);const r=e.clone();return wd.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Z3=ye("_ZodString",(e,t)=>{Uw.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>b3(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(PF(...r)),e.includes=(...r)=>e.check(kF(...r)),e.startsWith=(...r)=>e.check(DF(...r)),e.endsWith=(...r)=>e.check(LF(...r)),e.min=(...r)=>e.check(jm(...r)),e.max=(...r)=>e.check(y3(...r)),e.length=(...r)=>e.check(_3(...r)),e.nonempty=(...r)=>e.check(jm(1,...r)),e.lowercase=r=>e.check(MF(r)),e.uppercase=r=>e.check(NF(r)),e.trim=()=>e.check(zF()),e.normalize=(...r)=>e.check(jF(...r)),e.toLowerCase=()=>e.check(UF()),e.toUpperCase=()=>e.check(FF()),e.slugify=()=>e.check(BF())}),CB=ye("ZodString",(e,t)=>{Uw.init(e,t),Z3.init(e,t),e.email=n=>e.check(YU(AB,n)),e.url=n=>e.check(v3(Y3,n)),e.jwt=n=>e.check(pF(HB,n)),e.emoji=n=>e.check(eF(PB,n)),e.guid=n=>e.check(TT(MT,n)),e.uuid=n=>e.check(WU(ep,n)),e.uuidv4=n=>e.check(QU(ep,n)),e.uuidv6=n=>e.check(XU(ep,n)),e.uuidv7=n=>e.check(JU(ep,n)),e.nanoid=n=>e.check(tF(MB,n)),e.guid=n=>e.check(TT(MT,n)),e.cuid=n=>e.check(nF(NB,n)),e.cuid2=n=>e.check(rF(kB,n)),e.ulid=n=>e.check(oF(DB,n)),e.base64=n=>e.check(dF(BB,n)),e.base64url=n=>e.check(fF(VB,n)),e.xid=n=>e.check(iF(LB,n)),e.ksuid=n=>e.check(sF($B,n)),e.ipv4=n=>e.check(aF(jB,n)),e.ipv6=n=>e.check(lF(zB,n)),e.cidrv4=n=>e.check(cF(UB,n)),e.cidrv6=n=>e.check(uF(FB,n)),e.e164=n=>e.check(hF(qB,n)),e.datetime=n=>e.check(K3(n)),e.date=n=>e.check(uB(n)),e.time=n=>e.check(fB(n)),e.duration=n=>e.check(pB(n))});function $(e){return ZU(CB,e)}const wn=ye("ZodStringFormat",(e,t)=>{gn.init(e,t),Z3.init(e,t)}),AB=ye("ZodEmail",(e,t)=>{Yz.init(e,t),wn.init(e,t)}),MT=ye("ZodGUID",(e,t)=>{Kz.init(e,t),wn.init(e,t)}),ep=ye("ZodUUID",(e,t)=>{Zz.init(e,t),wn.init(e,t)}),Y3=ye("ZodURL",(e,t)=>{Wz.init(e,t),wn.init(e,t)});function IB(e){return v3(Y3,e)}const PB=ye("ZodEmoji",(e,t)=>{Qz.init(e,t),wn.init(e,t)}),MB=ye("ZodNanoID",(e,t)=>{Xz.init(e,t),wn.init(e,t)}),NB=ye("ZodCUID",(e,t)=>{Jz.init(e,t),wn.init(e,t)}),kB=ye("ZodCUID2",(e,t)=>{eU.init(e,t),wn.init(e,t)}),DB=ye("ZodULID",(e,t)=>{tU.init(e,t),wn.init(e,t)}),LB=ye("ZodXID",(e,t)=>{nU.init(e,t),wn.init(e,t)}),$B=ye("ZodKSUID",(e,t)=>{rU.init(e,t),wn.init(e,t)}),jB=ye("ZodIPv4",(e,t)=>{lU.init(e,t),wn.init(e,t)}),zB=ye("ZodIPv6",(e,t)=>{cU.init(e,t),wn.init(e,t)}),UB=ye("ZodCIDRv4",(e,t)=>{uU.init(e,t),wn.init(e,t)}),FB=ye("ZodCIDRv6",(e,t)=>{dU.init(e,t),wn.init(e,t)}),BB=ye("ZodBase64",(e,t)=>{fU.init(e,t),wn.init(e,t)}),VB=ye("ZodBase64URL",(e,t)=>{pU.init(e,t),wn.init(e,t)}),qB=ye("ZodE164",(e,t)=>{mU.init(e,t),wn.init(e,t)}),HB=ye("ZodJWT",(e,t)=>{vU.init(e,t),wn.init(e,t)}),Bw=ye("ZodNumber",(e,t)=>{f3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>w3(e,r,o),e.gt=(r,o)=>e.check(AT(r,o)),e.gte=(r,o)=>e.check(Qy(r,o)),e.min=(r,o)=>e.check(Qy(r,o)),e.lt=(r,o)=>e.check(CT(r,o)),e.lte=(r,o)=>e.check(Wy(r,o)),e.max=(r,o)=>e.check(Wy(r,o)),e.int=r=>e.check(NT(r)),e.safe=r=>e.check(NT(r)),e.positive=r=>e.check(AT(0,r)),e.nonnegative=r=>e.check(Qy(0,r)),e.negative=r=>e.check(CT(0,r)),e.nonpositive=r=>e.check(Wy(0,r)),e.multipleOf=(r,o)=>e.check(IT(r,o)),e.step=(r,o)=>e.check(IT(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function dt(e){return _F(Bw,e)}const GB=ye("ZodNumberFormat",(e,t)=>{yU.init(e,t),Bw.init(e,t)});function NT(e){return wF(GB,e)}const W3=ye("ZodBoolean",(e,t)=>{_U.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>S3(e,n,r)});function Nt(e){return SF(W3,e)}const KB=ye("ZodUndefined",(e,t)=>{bU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>x3(e,n)});function Dce(e){return xF(KB,e)}const ZB=ye("ZodNull",(e,t)=>{wU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>E3(e,n,r)});function YB(e){return RF(ZB,e)}const WB=ye("ZodAny",(e,t)=>{SU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>O3()});function QB(){return OF(WB)}const XB=ye("ZodUnknown",(e,t)=>{EU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>T3()});function Gt(){return TF(XB)}const JB=ye("ZodNever",(e,t)=>{xU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>R3(e,n,r)});function Q3(e){return CF(JB,e)}const eV=ye("ZodArray",(e,t)=>{RU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>N3(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(jm(n,r)),e.nonempty=n=>e.check(jm(1,n)),e.max=(n,r)=>e.check(y3(n,r)),e.length=(n,r)=>e.check(_3(n,r)),e.unwrap=()=>e.element});function Re(e,t){return VF(eV,e,t)}const Vw=ye("ZodObject",(e,t)=>{TU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>k3(e,n,r,o),It(e,"shape",()=>t.shape),e.keyof=()=>rn(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Gt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Gt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Q3()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>j9(e,n),e.safeExtend=n=>z9(e,n),e.merge=n=>U9(e,n),e.pick=n=>L9(e,n),e.omit=n=>$9(e,n),e.partial=(...n)=>F9(eN,e,n[0]),e.required=(...n)=>B9(tN,e,n[0])});function be(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new Vw(n)}function Lce(e,t){return new Vw({type:"object",shape:e,catchall:Q3(),...Fe(t)})}function vr(e,t){return new Vw({type:"object",shape:e,catchall:Gt(),...Fe(t)})}const X3=ye("ZodUnion",(e,t)=>{m3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>D3(e,n,r,o),e.options=t.options});function nn(e,t){return new X3({type:"union",options:e,...Fe(t)})}const tV=ye("ZodDiscriminatedUnion",(e,t)=>{X3.init(e,t),CU.init(e,t)});function qw(e,t,n){return new tV({type:"union",options:t,discriminator:e,...Fe(n)})}const nV=ye("ZodIntersection",(e,t)=>{AU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>L3(e,n,r,o)});function Hw(e,t){return new nV({type:"intersection",left:e,right:t})}const rV=ye("ZodTuple",(e,t)=>{IU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$3(e,n,r,o),e.rest=n=>e.clone({...e._zod.def,rest:n})});function $ce(e,t,n){const r=t instanceof Bt,o=r?n:t,s=r?t:null;return new rV({type:"tuple",items:e,rest:s,...Fe(o)})}const oV=ye("ZodRecord",(e,t)=>{PU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>j3(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Pt(e,t,n){return new oV({type:"record",keyType:e,valueType:t,...Fe(n)})}const Bb=ye("ZodEnum",(e,t)=>{MU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>C3(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const l of r)if(n.has(l))s[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Bb({...t,checks:[],...Fe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const l of r)if(n.has(l))delete s[l];else throw new Error(`Key ${l} not found in enum`);return new Bb({...t,checks:[],...Fe(o),entries:s})}});function rn(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Bb({type:"enum",entries:n,...Fe(t)})}const iV=ye("ZodLiteral",(e,t)=>{NU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>A3(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ge(e,t){return new iV({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const sV=ye("ZodFile",(e,t)=>{kU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>I3(e,n,r),e.min=(n,r)=>e.check(IF(n,r)),e.max=(n,r)=>e.check(AF(n,r)),e.mime=(n,r)=>e.check($F(Array.isArray(n)?n:[n],r))});function jce(e){return qF(sV,e)}const aV=ye("ZodTransform",(e,t)=>{DU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>M3(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new QM(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Yd(s,n.value,t));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Yd(l))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function J3(e){return new aV({type:"transform",transform:e})}const eN=ye("ZodOptional",(e,t)=>{g3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bn(e){return new eN({type:"optional",innerType:e})}const lV=ye("ZodExactOptional",(e,t)=>{LU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function cV(e){return new lV({type:"optional",innerType:e})}const uV=ye("ZodNullable",(e,t)=>{$U.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>z3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function kT(e){return new uV({type:"nullable",innerType:e})}const dV=ye("ZodDefault",(e,t)=>{jU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>F3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fV(e,t){return new dV({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t3(t)}})}const hV=ye("ZodPrefault",(e,t)=>{zU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>B3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function pV(e,t){return new hV({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t3(t)}})}const tN=ye("ZodNonOptional",(e,t)=>{UU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>U3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function mV(e,t){return new tN({type:"nonoptional",innerType:e,...Fe(t)})}const gV=ye("ZodCatch",(e,t)=>{FU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>V3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vV(e,t){return new gV({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const yV=ye("ZodPipe",(e,t)=>{BU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>q3(e,n,r,o),e.in=t.in,e.out=t.out});function Vb(e,t){return new yV({type:"pipe",in:e,out:t})}const _V=ye("ZodReadonly",(e,t)=>{VU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>H3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bV(e){return new _V({type:"readonly",innerType:e})}const wV=ye("ZodLazy",(e,t)=>{qU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>G3(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function ya(e){return new wV({type:"lazy",getter:e})}const Gw=ye("ZodCustom",(e,t)=>{HU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>P3(e,n)});function SV(e,t){return HF(Gw,e??(()=>!0),t)}function EV(e,t={}){return GF(Gw,e,t)}function xV(e){return KF(e)}function zce(e,t={}){const n=new Gw({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Fe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Kw(e,t){return Vb(J3(e),t)}const RV={custom:"custom"};function nN(e){return bF(Bw,e)}function DT(e){return EF(W3,e)}function OV(e){return e.charAt(0).toUpperCase()+e.slice(1)}var kd=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function TV(e){try{return(new URL(e).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new kd(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function CV(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new kd(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof kd?t:new kd(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Xy(e,t="/api/auth"){if(CV(e),TV(e))return e;const n=e.replace(/\/+$/,"");return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function AV(e,t,n,r,o){if(e)return Xy(e,t);{const s=Do.BETTER_AUTH_URL||Do.NEXT_PUBLIC_BETTER_AUTH_URL||Do.PUBLIC_BETTER_AUTH_URL||Do.NUXT_PUBLIC_BETTER_AUTH_URL||Do.NUXT_PUBLIC_AUTH_URL||(Do.BASE_URL!=="/"?Do.BASE_URL:void 0);if(s)return Xy(s,t)}if(typeof window<"u"&&window.location)return Xy(window.location.origin,t)}const IV={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},PV={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},MV=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,LT={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},NV=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function kV(e){return e instanceof Date&&!isNaN(e.getTime())}function DV(e){const t=NV.exec(e);if(!t)return null;const[,n,r,o,s,l,c,d,f,p,h]=t,g=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(o,10),parseInt(s,10),parseInt(l,10),parseInt(c,10),d?parseInt(d.padEnd(3,"0"),10):0));if(f){const v=(parseInt(p,10)*60+parseInt(h,10))*(f==="+"?-1:1);g.setUTCMinutes(g.getUTCMinutes()+v)}return kV(g)?g:null}function LV(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:o,parseDates:s=!0}=t;if(typeof e!="string")return e;const l=e.trim();if(l.length>0&&l[0]==='"'&&l.endsWith('"')&&!l.slice(1,-1).includes('"'))return l.slice(1,-1);const c=l.toLowerCase();if(c.length<=9&&c in LT)return LT[c];if(!MV.test(l)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(PV).some(([d,f])=>{const p=f.test(l);return p&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${d} pattern`),p})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(l,(f,p)=>{if(f==="__proto__"||f==="constructor"&&p&&typeof p=="object"&&"prototype"in p){r&&console.warn(`[better-json] Dropping "${f}" key to prevent prototype pollution`);return}if(s&&typeof p=="string"){const h=DV(p);if(h)return h}return o?o(f,p):p})}catch(d){if(n)throw d;return e}}function $V(e,t={strict:!0}){return LV(e,t)}let Wo=[],Vs=0;const tp=4,jV=globalThis.nanostoresGlobal||={epoch:0},Cc=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(r){return n.lc=t.push(r),()=>{for(let s=Vs+tp;s<Wo.length;)Wo[s]===r?Wo.splice(s,tp):s+=tp;let o=t.indexOf(r);~o&&(t.splice(o,1),--n.lc||n.off())}},notify(r,o){jV.epoch++;let s=!Wo.length;for(let l of t)Wo.push(l,n.value,r,o);if(s){for(Vs=0;Vs<Wo.length;Vs+=tp)Wo[Vs](Wo[Vs+1],Wo[Vs+2],Wo[Vs+3]);Wo.length=0}},off(){},set(r){let o=n.value;o!==r&&(n.value=r,n.notify(o))},subscribe(r){let o=n.listen(r);return r(n.value),o},value:e};return n},zV=5,np=6,rp=10;let UV=(e,t,n,r)=>(e.events=e.events||{},e.events[n+rp]||(e.events[n+rp]=r(o=>{e.events[n].reduceRight((s,l)=>(l(s),s),{shared:{},...o})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],s=o.indexOf(t);o.splice(s,1),o.length||(delete e.events[n],e.events[n+rp](),delete e.events[n+rp])});const FV=1e3;let rN=(e,t)=>UV(e,r=>{let o=t(r);o&&e.events[np].push(o)},zV,r=>{let o=e.listen;e.listen=(...l)=>(!e.lc&&!e.active&&(e.active=!0,r()),o(...l));let s=e.off;return e.events[np]=[],e.off=()=>{s(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let l of e.events[np])l();e.events[np]=[]}},FV)},()=>{e.listen=o,e.off=s}});function BV(e,t,n){let r=new Set(t).add(void 0);return e.listen((o,s,l)=>{r.has(l)&&n(o,s,l)})}const VV=()=>typeof window>"u",Sd=(e,t,n,r)=>{const o=Cc({data:null,error:null,isPending:!0,isRefetching:!1,refetch:c=>s(c)}),s=async c=>new Promise(d=>{const f=typeof r=="function"?r({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):r;n(t,{...f,query:{...f?.query,...c?.query},async onSuccess(p){o.set({data:p.data,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await f?.onSuccess?.(p)},async onError(p){const{request:h}=p,g=typeof h.retry=="number"?h.retry:h.retry?.attempts,v=h.retryAttempt||0;g&&v<g||(o.set({error:p.error,data:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await f?.onError?.(p))},async onRequest(p){const h=o.get();o.set({isPending:h.data===null,data:h.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await f?.onRequest?.(p)}}).catch(p=>{o.set({error:p,data:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{d(void 0)})});e=Array.isArray(e)?e:[e];let l=!1;for(const c of e)c.subscribe(async()=>{VV()||(l?await s():rN(o,()=>{const d=setTimeout(async()=>{l||(await s(),l=!0)},0);return()=>{o.off(),c.off(),clearTimeout(d)}}))});return o},Jy=Symbol.for("better-auth:broadcast-channel"),qV=()=>Math.floor(Date.now()/1e3);var HV=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:qV()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function e_(e="better-auth.message"){return globalThis[Jy]||(globalThis[Jy]=new HV(e)),globalThis[Jy]}const t_=Symbol.for("better-auth:focus-manager");var GV=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function $T(){return globalThis[t_]||(globalThis[t_]=new GV),globalThis[t_]}const n_=Symbol.for("better-auth:online-manager");var KV=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function r_(){return globalThis[n_]||(globalThis[n_]=new KV),globalThis[n_]}const sc=()=>Math.floor(Date.now()/1e3),ZV=5;function YV(e){const{sessionAtom:t,sessionSignal:n,$fetch:r,options:o={}}=e,s=o.sessionOptions?.refetchInterval??0,l=o.sessionOptions?.refetchOnWindowFocus??!0,c=o.sessionOptions?.refetchWhenOffline??!1,d={lastSync:0,lastSessionRequest:0,cachedSession:void 0},f=()=>c||r_().isOnline,p=E=>{if(!f())return;if(E?.event==="storage"){d.lastSync=sc(),n.set(!n.get());return}const T=t.get();if(E?.event==="poll"){d.lastSessionRequest=sc(),r("/get-session").then(R=>{R.error?t.set({...T,data:null,error:R.error}):t.set({...T,data:R.data,error:null}),d.lastSync=sc(),n.set(!n.get())}).catch(()=>{});return}if(E?.event==="visibilitychange"){if(sc()-d.lastSessionRequest<ZV)return;d.lastSessionRequest=sc()}(T?.data===null||T?.data===void 0||E?.event==="visibilitychange")&&(d.lastSync=sc(),n.set(!n.get()))},h=E=>{e_().post({event:"session",data:{trigger:E},clientId:Math.random().toString(36).substring(7)})},g=()=>{s&&s>0&&(d.pollInterval=setInterval(()=>{t.get()?.data&&p({event:"poll"})},s*1e3))},v=()=>{d.unsubscribeBroadcast=e_().subscribe(()=>{p({event:"storage"})})},_=()=>{l&&(d.unsubscribeFocus=$T().subscribe(()=>{p({event:"visibilitychange"})}))},b=()=>{d.unsubscribeOnline=r_().subscribe(E=>{E&&p({event:"visibilitychange"})})};return{init:()=>{g(),v(),_(),b(),e_().setup(),$T().setup(),r_().setup()},cleanup:()=>{d.pollInterval&&(clearInterval(d.pollInterval),d.pollInterval=void 0),d.unsubscribeBroadcast&&(d.unsubscribeBroadcast(),d.unsubscribeBroadcast=void 0),d.unsubscribeFocus&&(d.unsubscribeFocus(),d.unsubscribeFocus=void 0),d.unsubscribeOnline&&(d.unsubscribeOnline(),d.unsubscribeOnline=void 0),d.lastSync=0,d.lastSessionRequest=0,d.cachedSession=void 0},triggerRefetch:p,broadcastSessionUpdate:h}}function WV(e,t){const n=Cc(!1),r=Sd(n,"/get-session",e,{method:"GET"});return rN(r,()=>{const o=YV({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return o.init(),()=>{o.cleanup()}}),{session:r,$sessionSignal:n}}function o_(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function qb(e,t,n=".",r){if(!o_(t))return qb(e,{},n,r);const o={...t};for(const s of Object.keys(e)){if(s==="__proto__"||s==="constructor")continue;const l=e[s];l!=null&&(r&&r(o,s,l,n)||(Array.isArray(l)&&Array.isArray(o[s])?o[s]=[...l,...o[s]]:o_(l)&&o_(o[s])?o[s]=qb(l,o[s],(n?`${n}.`:"")+s.toString(),r):o[s]=l))}return o}function QV(e){return(...t)=>t.reduce((n,r)=>qb(n,r,"",e),{})}const XV=QV();var JV=Object.defineProperty,eq=Object.defineProperties,tq=Object.getOwnPropertyDescriptors,jT=Object.getOwnPropertySymbols,nq=Object.prototype.hasOwnProperty,rq=Object.prototype.propertyIsEnumerable,zT=(e,t,n)=>t in e?JV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ti=(e,t)=>{for(var n in t||(t={}))nq.call(t,n)&&zT(e,n,t[n]);if(jT)for(var n of jT(t))rq.call(t,n)&&zT(e,n,t[n]);return e},yi=(e,t)=>eq(e,tq(t)),oq=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},iq=async(e,t)=>{var n,r,o,s,l,c;let d=t||{};const f={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:d,hooks:f};for(const p of t?.plugins||[]){if(p.init){const h=await((n=p.init)==null?void 0:n.call(p,e.toString(),t));d=h.options||d,e=h.url}f.onRequest.push((r=p.hooks)==null?void 0:r.onRequest),f.onResponse.push((o=p.hooks)==null?void 0:o.onResponse),f.onSuccess.push((s=p.hooks)==null?void 0:s.onSuccess),f.onError.push((l=p.hooks)==null?void 0:l.onError),f.onRetry.push((c=p.hooks)==null?void 0:c.onRetry)}return{url:e,options:d,hooks:f}},UT=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},sq=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function aq(e){if(typeof e=="number")return new UT({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new UT(e);case"exponential":return new sq(e);default:throw new Error("Invalid retry strategy")}}var lq=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,o]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!o)return t;t.authorization=`Basic ${btoa(`${r}:${o}`)}`}else if(e.auth.type==="Custom"){const[r,o]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!o)return t;t.authorization=`${r??""} ${o}`}}return t},cq=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function uq(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return cq.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function dq(e){try{return JSON.parse(e),!0}catch{return!1}}function Hb(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function FT(e){try{return JSON.parse(e)}catch{return e}}function BT(e){return typeof e=="function"}function fq(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&BT(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&BT(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function hq(e){const t=new Headers(e?.headers),n=await lq(e);for(const[r,o]of Object.entries(n||{}))t.set(r,o);if(!t.has("content-type")){const r=pq(e?.body);r&&t.set("content-type",r)}return t}function pq(e){return Hb(e)?"application/json":null}function mq(e){if(!e?.body)return null;const t=new Headers(e?.headers);if(Hb(e.body)&&!t.has("content-type")){for(const[n,r]of Object.entries(e?.body))r instanceof Date&&(e.body[n]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&t.get("content-type")==="application/x-www-form-urlencoded"&&Hb(e.body)?new URLSearchParams(e.body).toString():e.body}function gq(e,t){var n;if(t?.method)return t.method.toUpperCase();if(e.startsWith("@")){const r=(n=e.split("@")[1])==null?void 0:n.split("/")[0];return iN.includes(r)?r.toUpperCase():t?.body?"POST":"GET"}return t?.body?"POST":"GET"}function vq(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var yq=class oN extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,oN.prototype)}};async function _m(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new yq(n.issues);return n.value}var iN=["get","post","put","patch","delete"],_q=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r,o,s,l;const c=((o=(r=e.plugins)==null?void 0:r.find(d=>{var f;return(f=d.schema)!=null&&f.config?t.startsWith(d.schema.config.baseURL||"")||t.startsWith(d.schema.config.prefix||""):!1}))==null?void 0:o.schema)||e.schema;if(c){let d=t;(s=c.config)!=null&&s.prefix&&d.startsWith(c.config.prefix)&&(d=d.replace(c.config.prefix,""),c.config.baseURL&&(t=t.replace(c.config.prefix,c.config.baseURL))),(l=c.config)!=null&&l.baseURL&&d.startsWith(c.config.baseURL)&&(d=d.replace(c.config.baseURL,""));const f=c.schema[d];if(f){let p=yi(ti({},n),{method:f.method,output:f.output});return n?.disableValidation||(p=yi(ti({},p),{body:f.input?await _m(f.input,n?.body):n?.body,params:f.params?await _m(f.params,n?.params):n?.params,query:f.query?await _m(f.query,n?.query):n?.query})),{url:t,options:p}}}return{url:t,options:n}}}),bq=e=>{async function t(n,r){const o=yi(ti(ti({},e),r),{plugins:[...e?.plugins||[],_q(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await Gb(n,o)}catch(s){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:s}}}return await Gb(n,o)}return t};function wq(e,t){const{baseURL:n,params:r,query:o}=t||{query:{},params:{},baseURL:""};let s=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){const h=e.toString().split("@")[1].split("/")[0];iN.includes(h)&&(e=e.replace(`@${h}/`,"/"))}s.endsWith("/")||(s+="/");let[l,c]=e.replace(s,"").split("?");const d=new URLSearchParams(c);for(const[h,g]of Object.entries(o||{})){if(g==null)continue;let v;if(typeof g=="string")v=g;else if(Array.isArray(g)){for(const _ of g)d.append(h,_);continue}else v=JSON.stringify(g);d.set(h,v)}if(r)if(Array.isArray(r)){const h=l.split("/").filter(g=>g.startsWith(":"));for(const[g,v]of h.entries()){const _=r[g];l=l.replace(v,_)}}else for(const[h,g]of Object.entries(r))l=l.replace(`:${h}`,String(g));l=l.split("/").map(encodeURIComponent).join("/"),l.startsWith("/")&&(l=l.slice(1));let f=d.toString();return f=f.length>0?`?${f}`.replace(/\+/g,"%20"):"",s.startsWith("http")?new URL(`${l}${f}`,s):`${s}${l}${f}`}var Gb=async(e,t)=>{var n,r,o,s,l,c,d,f;const{hooks:p,url:h,options:g}=await iq(e,t),v=fq(g),_=new AbortController,b=(n=g.signal)!=null?n:_.signal,x=wq(h,g),S=mq(g),E=await hq(g),T=gq(h,g);let R=yi(ti({},g),{url:x,headers:E,body:S,method:T,signal:b});for(const F of p.onRequest)if(F){const Z=await F(R);typeof Z=="object"&&Z!==null&&(R=Z)}("pipeTo"in R&&typeof R.pipeTo=="function"||typeof((r=t?.body)==null?void 0:r.pipe)=="function")&&("duplex"in R||(R.duplex="half"));const{clearTimeout:O}=vq(g,_);let A=await v(R.url,R);O();const I={response:A,request:R};for(const F of p.onResponse)if(F){const Z=await F(yi(ti({},I),{response:(o=t?.hookOptions)!=null&&o.cloneResponse?A.clone():A}));Z instanceof Response?A=Z:typeof Z=="object"&&Z!==null&&(A=Z.response)}if(A.ok){if(!(R.method!=="HEAD"))return{data:"",error:null};const Z=uq(A),ie={data:null,response:A,request:R};if(Z==="json"||Z==="text"){const H=await A.text(),W=(s=R.jsonParser)!=null?s:FT;ie.data=await W(H)}else ie.data=await A[Z]();R?.output&&R.output&&!R.disableValidation&&(ie.data=await _m(R.output,ie.data));for(const H of p.onSuccess)H&&await H(yi(ti({},ie),{response:(l=t?.hookOptions)!=null&&l.cloneResponse?A.clone():A}));return t?.throw?ie.data:{data:ie.data,error:null}}const M=(c=t?.jsonParser)!=null?c:FT,L=await A.text(),q=dq(L),j=q?await M(L):null,B={response:A,responseText:L,request:R,error:yi(ti({},j),{status:A.status,statusText:A.statusText})};for(const F of p.onError)F&&await F(yi(ti({},B),{response:(d=t?.hookOptions)!=null&&d.cloneResponse?A.clone():A}));if(t?.retry){const F=aq(t.retry),Z=(f=t.retryAttempt)!=null?f:0;if(await F.shouldAttemptRetry(Z,A)){for(const H of p.onRetry)H&&await H(I);const ie=F.getDelay(Z);return await new Promise(H=>setTimeout(H,ie)),await Gb(e,yi(ti({},t),{retryAttempt:Z+1}))}}if(t?.throw)throw new oq(A.status,A.statusText,q?j:L);return{data:null,error:yi(ti({},j),{status:A.status,statusText:A.statusText})}};const Sq=(e,t)=>{const n="credentials"in Request.prototype,r=AV(e?.baseURL,e?.basePath)??"/api/auth",o=e?.plugins?.flatMap(R=>R.fetchPlugins).filter(R=>R!==void 0)||[],s={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:l,onError:c,onRequest:d,onResponse:f,...p}=e?.fetchOptions||{},h=bq({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(R){return R?$V(R,{strict:!1}):null},customFetchImpl:fetch,...p,plugins:[s,...p.plugins||[],...e?.disableDefaultFetchPlugins?[]:[IV],...o]}),{$sessionSignal:g,session:v}=WV(h,e),_=e?.plugins||[];let b={};const x={$sessionSignal:g,session:v},S={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},E=[{signal:"$sessionSignal",matcher(R){return R==="/sign-out"||R==="/update-user"||R==="/sign-up/email"||R==="/sign-in/email"||R==="/delete-user"||R==="/verify-email"||R==="/revoke-sessions"||R==="/revoke-session"||R==="/change-email"}}];for(const R of _)R.getAtoms&&Object.assign(x,R.getAtoms?.(h)),R.pathMethods&&Object.assign(S,R.pathMethods),R.atomListeners&&E.push(...R.atomListeners);const T={notify:R=>{x[R].set(!x[R].get())},listen:(R,O)=>{x[R].subscribe(O)},atoms:x};for(const R of _)R.getActions&&(b=XV(R.getActions?.(h,T,e)??{},b));return{get baseURL(){return r},pluginsActions:b,pluginsAtoms:x,pluginPathMethods:S,atomListeners:E,$fetch:h,$store:T}};function Eq(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function xq(e,t,n){const r=t[e],{fetchOptions:o,query:s,...l}=n||{};return r||(o?.method?o.method:l&&Object.keys(l).length>0?"POST":"GET")}function Rq(e,t,n,r,o){function s(l=[]){return new Proxy(function(){},{get(c,d){if(typeof d!="string"||d==="then"||d==="catch"||d==="finally")return;const f=[...l,d];let p=e;for(const h of f)if(p&&typeof p=="object"&&h in p)p=p[h];else{p=void 0;break}return typeof p=="function"||Eq(p)?p:s(f)},apply:async(c,d,f)=>{const p="/"+l.map(E=>E.replace(/[A-Z]/g,T=>`-${T.toLowerCase()}`)).join("/"),h=f[0]||{},g=f[1]||{},{query:v,fetchOptions:_,...b}=h,x={...g,..._},S=xq(p,n,h);return await t(p,{...x,body:S==="GET"?void 0:{...b,...x?.body||{}},query:v||x?.query,method:S,async onSuccess(E){if(await x?.onSuccess?.(E),!o||x.disableSignal)return;const T=o.filter(O=>O.matcher(p));if(!T.length)return;const R=new Set;for(const O of T){const A=r[O.signal];if(!A)return;if(R.has(O.signal))continue;R.add(O.signal);const I=A.get();setTimeout(()=>{A.set(!I)},10)}}})}})}return s()}function Oq(e,t={}){const n=P.useRef(e.get()),{keys:r,deps:o=[e,r]}=t,s=P.useCallback(c=>{const d=f=>{n.current!==f&&(n.current=f,c())};return d(e.value),r?.length?BV(e,r,d):e.listen(d)},o),l=()=>n.current;return P.useSyncExternalStore(s,l,l)}function Tq(e){return`use${OV(e)}`}function Cq(e){const{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:o,$store:s,atomListeners:l}=Sq(e),c={};for(const[d,f]of Object.entries(r))c[Tq(d)]=()=>Oq(f);return Rq({...n,...c,$fetch:o,$store:s},o,t,r,l)}function Aq(e){return{authorize(t,n="AND"){let r=!1;for(const[o,s]of Object.entries(t)){const l=e[o];if(!l)return{success:!1,error:`You are not allowed to access resource: ${o}`};if(Array.isArray(s))r=s.every(c=>l.includes(c));else if(typeof s=="object"){const c=s;c.connector==="OR"?r=c.actions.some(d=>l.includes(d)):r=c.actions.every(d=>l.includes(d))}else throw new kd("Invalid access control request");if(r&&n==="OR")return{success:r};if(!r&&n==="AND")return{success:!1,error:`unauthorized to access resource "${o}"`}}return r?{success:r}:{success:!1,error:"Not authorized"}},statements:e}}function sN(e){return{newRole(t){return Aq(t)},statements:e}}const Iq={user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]},aN=sN(Iq),lN=aN.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),cN=aN.newRole({user:[],session:[]}),Pq={admin:lN,user:cN},Mq=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions&&!e.permission)return!1;const t=(e.role||e.options?.defaultRole||"user").split(","),n=e.options?.roles||Pq;for(const r of t)if(n[r]?.authorize(e.permission??e.permissions)?.success)return!0;return!1},Nq=e=>{const t={admin:lN,user:cN,...e?.roles};return{id:"admin-client",$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>Mq({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions??n.permission})}}),pathMethods:{"/admin/list-users":"GET","/admin/stop-impersonating":"POST"}}},kq=()=>({id:"email-otp",$InferServerPlugin:{},atomListeners:[{matcher:e=>e==="/email-otp/verify-email"||e==="/sign-in/email-otp",signal:"$sessionSignal"}]}),Dq=()=>({id:"magic-link",$InferServerPlugin:{}}),Lq={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]},Zw=sN(Lq),uN=Zw.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),dN=Zw.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),fN=Zw.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),$q={admin:uN,owner:dN,member:fN},jq=(e,t)=>{if(!e.permissions&&!e.permission)return!1;const n=e.role.split(","),r=e.options.creatorRole||"owner",o=n.includes(r),s=e.allowCreatorAllPermissions||!1;if(o&&s)return!0;for(const l of n)if(t[l]?.authorize(e.permissions??e.permission)?.success)return!0;return!1},zq=e=>jq(e,e.options.roles||$q),Uq=e=>{const t=Cc(!1),n=Cc(!1),r=Cc(!1),o=Cc(!1),s={admin:uN,member:fN,owner:dN,...e?.roles};return{id:"organization",$InferServerPlugin:{},getActions:(l,c,d)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:f=>zq({role:f.role,options:{ac:e?.ac,roles:s},permissions:f.permissions??f.permission})}}),getAtoms:l=>{const c=Sd(t,"/organization/list",l,{method:"GET"});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:o,activeOrganization:Sd([n],"/organization/get-full-organization",l,()=>({method:"GET"})),listOrganizations:c,activeMember:Sd([r],"/organization/get-active-member",l,{method:"GET"}),activeMemberRole:Sd([o],"/organization/get-active-member-role",l,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher(l){return l==="/organization/create"||l==="/organization/delete"||l==="/organization/update"},signal:"$listOrg"},{matcher(l){return l.startsWith("/organization")},signal:"$activeOrgSignal"},{matcher(l){return l.startsWith("/organization/set-active")},signal:"$sessionSignal"},{matcher(l){return l.includes("/organization/update-member-role")},signal:"$activeMemberSignal"},{matcher(l){return l.includes("/organization/update-member-role")},signal:"$activeMemberRoleSignal"}]}},Fq=e=>({id:"sso-client",$InferServerPlugin:{}});function hN(e){const t=e?.metadata;if(!t)return!1;try{return(typeof t=="string"?JSON.parse(t):t).archived===!0}catch{return!1}}const Vg=Cq({plugins:[Uq({}),Nq(),Fq(),Dq(),kq()]}),Bq=3e4;let Ed=null,op=null;function pN(){if(Ed&&Ed.expiresAt>Date.now())return Promise.resolve(Ed.result);if(op)return op;const e=Vg.organization.list().then(t=>{const n=t.data?{...t,data:t.data.filter(r=>!hN(r))}:t;return n.data&&(Ed={result:n,expiresAt:Date.now()+Bq}),n}).finally(()=>{op=null});return op=e,e}function Uce(){const e=Vg.useListOrganizations(),t=e.data?.filter(n=>!hN(n));return{...e,data:t}}function Fce(){Ed=null}function mN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=mN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yw(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=mN(e))&&(r&&(r+=" "),r+=t);return r}const Vq=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},qq=(e,t)=>({classGroupId:e,validator:t}),gN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vm="-",VT=[],Hq="arbitrary..",Gq=e=>{const t=Zq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Kq(l);const c=l.split(Vm),d=c[0]===""&&c.length>1?1:0;return vN(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?Vq(f,d):d:f||VT}return n[l]||VT}}},vN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=vN(e,t+1,s);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(Vm):e.slice(t).join(Vm),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(c))return p.classGroupId}},Kq=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Hq+r:void 0})(),Zq=e=>{const{theme:t,classGroups:n}=e;return Yq(n,t)},Yq=(e,t)=>{const n=gN();for(const r in e){const o=e[r];Ww(o,n,r,t)}return n},Ww=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const l=e[s];Wq(l,t,n,r)}},Wq=(e,t,n,r)=>{if(typeof e=="string"){Qq(e,t,n);return}if(typeof e=="function"){Xq(e,t,n,r);return}Jq(e,t,n,r)},Qq=(e,t,n)=>{const r=e===""?t:yN(t,e);r.classGroupId=n},Xq=(e,t,n,r)=>{if(eH(e)){Ww(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(qq(n,e))},Jq=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let l=0;l<s;l++){const[c,d]=o[l];Ww(d,yN(t,c),n,r)}},yN=(e,t)=>{let n=e;const r=t.split(Vm),o=r.length;for(let s=0;s<o;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=gN(),n.nextPart.set(l,c)),n=c}return n},eH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,tH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},Kb="!",qT=":",nH=[],HT=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),rH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let l=0,c=0,d=0,f;const p=o.length;for(let b=0;b<p;b++){const x=o[b];if(l===0&&c===0){if(x===qT){s.push(o.slice(d,b)),d=b+1;continue}if(x==="/"){f=b;continue}}x==="["?l++:x==="]"?l--:x==="("?c++:x===")"&&c--}const h=s.length===0?o:o.slice(d);let g=h,v=!1;h.endsWith(Kb)?(g=h.slice(0,-1),v=!0):h.startsWith(Kb)&&(g=h.slice(1),v=!0);const _=f&&f>d?f-d:void 0;return HT(s,v,g,_)};if(t){const o=t+qT,s=r;r=l=>l.startsWith(o)?s(l.slice(o.length)):HT(nH,!1,l,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},oH=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",d=t.has(l);c||d?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(l)):o.push(l)}return o.length>0&&(o.sort(),r.push(...o)),r}},iH=e=>({cache:tH(e.cacheSize),parseClassName:rH(e),sortModifiers:oH(e),postfixLookupClassGroupIds:sH(e),...Gq(e)}),sH=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},aH=/\s+/,lH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:l}=t,c=[],d=e.trim().split(aH);let f="";for(let p=d.length-1;p>=0;p-=1){const h=d[p],{isExternal:g,modifiers:v,hasImportantModifier:_,baseClassName:b,maybePostfixModifierPosition:x}=n(h);if(g){f=h+(f.length>0?" "+f:f);continue}let S=!!x,E;if(S){const I=b.substring(0,x);E=r(I);const M=E&&l[E]?r(b):void 0;M&&M!==E&&(E=M,S=!1)}else E=r(b);if(!E){if(!S){f=h+(f.length>0?" "+f:f);continue}if(E=r(b),!E){f=h+(f.length>0?" "+f:f);continue}S=!1}const T=v.length===0?"":v.length===1?v[0]:s(v).join(":"),R=_?T+Kb:T,O=R+E;if(c.indexOf(O)>-1)continue;c.push(O);const A=o(E,S);for(let I=0;I<A.length;++I){const M=A[I];c.push(R+M)}f=h+(f.length>0?" "+f:f)}return f},cH=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=_N(n))&&(o&&(o+=" "),o+=r);return o},_N=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_N(e[r]))&&(n&&(n+=" "),n+=t);return n},uH=(e,...t)=>{let n,r,o,s;const l=d=>{const f=t.reduce((p,h)=>h(p),e());return n=iH(f),r=n.cache.get,o=n.cache.set,s=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=lH(d,n);return o(d,p),p};return s=l,(...d)=>s(cH(...d))},dH=[],Kn=e=>{const t=n=>n[e]||dH;return t.isThemeGetter=!0,t},bN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pH=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>fH.test(e),gt=e=>!!e&&!Number.isNaN(Number(e)),pi=e=>!!e&&Number.isInteger(Number(e)),i_=e=>e.endsWith("%")&>(e.slice(0,-1)),Xi=e=>hH.test(e),SN=()=>!0,yH=e=>pH.test(e)&&!mH.test(e),Qw=()=>!1,_H=e=>gH.test(e),bH=e=>vH.test(e),wH=e=>!Ve(e)&&!qe(e),SH=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),EH=e=>_a(e,RN,Qw),Ve=e=>bN.test(e),Ua=e=>_a(e,ON,yH),GT=e=>_a(e,PH,gt),xH=e=>_a(e,CN,SN),RH=e=>_a(e,TN,Qw),KT=e=>_a(e,EN,Qw),OH=e=>_a(e,xN,bH),ip=e=>_a(e,AN,_H),qe=e=>wN.test(e),od=e=>ml(e,ON),TH=e=>ml(e,TN),ZT=e=>ml(e,EN),CH=e=>ml(e,RN),AH=e=>ml(e,xN),sp=e=>ml(e,AN,!0),IH=e=>ml(e,CN,!0),_a=(e,t,n)=>{const r=bN.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ml=(e,t,n=!1)=>{const r=wN.exec(e);return r?r[1]?t(r[1]):n:!1},EN=e=>e==="position"||e==="percentage",xN=e=>e==="image"||e==="url",RN=e=>e==="length"||e==="size"||e==="bg-size",ON=e=>e==="length",PH=e=>e==="number",TN=e=>e==="family-name",CN=e=>e==="number"||e==="weight",AN=e=>e==="shadow",MH=()=>{const e=Kn("color"),t=Kn("font"),n=Kn("text"),r=Kn("font-weight"),o=Kn("tracking"),s=Kn("leading"),l=Kn("breakpoint"),c=Kn("container"),d=Kn("spacing"),f=Kn("radius"),p=Kn("shadow"),h=Kn("inset-shadow"),g=Kn("text-shadow"),v=Kn("drop-shadow"),_=Kn("blur"),b=Kn("perspective"),x=Kn("aspect"),S=Kn("ease"),E=Kn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...R(),qe,Ve],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],M=()=>[qe,Ve,d],L=()=>[qs,"full","auto",...M()],q=()=>[pi,"none","subgrid",qe,Ve],j=()=>["auto",{span:["full",pi,qe,Ve]},pi,qe,Ve],B=()=>[pi,"auto",qe,Ve],F=()=>["auto","min","max","fr",qe,Ve],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...M()],W=()=>[qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],te=()=>[qs,"screen","full","dvw","lvw","svw","min","max","fit",...M()],le=()=>[qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],Q=()=>[e,qe,Ve],k=()=>[...R(),ZT,KT,{position:[qe,Ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",CH,EH,{size:[qe,Ve]}],D=()=>[i_,od,Ua],U=()=>["","none","full",f,qe,Ve],X=()=>["",gt,od,Ua],fe=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[gt,i_,ZT,KT],je=()=>["","none",_,qe,Ve],Y=()=>["none",gt,qe,Ve],re=()=>["none",gt,qe,Ve],ve=()=>[gt,qe,Ve],se=()=>[qs,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xi],breakpoint:[Xi],color:[SN],container:[Xi],"drop-shadow":[Xi],ease:["in","out","in-out"],font:[wH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xi],shadow:[Xi],spacing:["px",gt],text:[Xi],"text-shadow":[Xi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qs,Ve,qe,x]}],container:["container"],"container-type":[{"@container":["","normal","size",qe,Ve]}],"container-named":[SH],columns:[{columns:[gt,Ve,qe,c]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[pi,"auto",qe,Ve]}],basis:[{basis:[qs,"full","auto",c,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gt,qs,"auto","initial","none",Ve]}],grow:[{grow:["",gt,qe,Ve]}],shrink:[{shrink:["",gt,qe,Ve]}],order:[{order:[pi,"first","last","none",qe,Ve]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...le()]}],"min-block-size":[{"min-block":["auto",...le()]}],"max-block-size":[{"max-block":["none",...le()]}],w:[{w:[c,"screen",...W()]}],"min-w":[{"min-w":[c,"screen","none",...W()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,od,Ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,IH,xH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",i_,Ve]}],"font-family":[{font:[TH,RH,t]}],"font-features":[{"font-features":[Ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,qe,Ve]}],"line-clamp":[{"line-clamp":[gt,"none",qe,GT]}],leading:[{leading:[s,...M()]}],"list-image":[{"list-image":["none",qe,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Q()}],"text-color":[{text:Q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[gt,"from-font","auto",qe,Ua]}],"text-decoration-color":[{decoration:Q()}],"underline-offset":[{"underline-offset":[gt,"auto",qe,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[pi,qe,Ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pi,qe,Ve],radial:["",qe,Ve],conic:[pi,qe,Ve]},AH,OH]}],"bg-color":[{bg:Q()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:Q()}],"gradient-via":[{via:Q()}],"gradient-to":[{to:Q()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:Q()}],"border-color-x":[{"border-x":Q()}],"border-color-y":[{"border-y":Q()}],"border-color-s":[{"border-s":Q()}],"border-color-e":[{"border-e":Q()}],"border-color-bs":[{"border-bs":Q()}],"border-color-be":[{"border-be":Q()}],"border-color-t":[{"border-t":Q()}],"border-color-r":[{"border-r":Q()}],"border-color-b":[{"border-b":Q()}],"border-color-l":[{"border-l":Q()}],"divide-color":[{divide:Q()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gt,qe,Ve]}],"outline-w":[{outline:["",gt,od,Ua]}],"outline-color":[{outline:Q()}],shadow:[{shadow:["","none",p,sp,ip]}],"shadow-color":[{shadow:Q()}],"inset-shadow":[{"inset-shadow":["none",h,sp,ip]}],"inset-shadow-color":[{"inset-shadow":Q()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Q()}],"ring-offset-w":[{"ring-offset":[gt,Ua]}],"ring-offset-color":[{"ring-offset":Q()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":Q()}],"text-shadow":[{"text-shadow":["none",g,sp,ip]}],"text-shadow-color":[{"text-shadow":Q()}],opacity:[{opacity:[gt,qe,Ve]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[gt]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":Q()}],"mask-image-linear-to-color":[{"mask-linear-to":Q()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":Q()}],"mask-image-t-to-color":[{"mask-t-to":Q()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":Q()}],"mask-image-r-to-color":[{"mask-r-to":Q()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":Q()}],"mask-image-b-to-color":[{"mask-b-to":Q()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":Q()}],"mask-image-l-to-color":[{"mask-l-to":Q()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":Q()}],"mask-image-x-to-color":[{"mask-x-to":Q()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":Q()}],"mask-image-y-to-color":[{"mask-y-to":Q()}],"mask-image-radial":[{"mask-radial":[qe,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":Q()}],"mask-image-radial-to-color":[{"mask-radial-to":Q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[gt]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":Q()}],"mask-image-conic-to-color":[{"mask-conic-to":Q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,Ve]}],filter:[{filter:["","none",qe,Ve]}],blur:[{blur:je()}],brightness:[{brightness:[gt,qe,Ve]}],contrast:[{contrast:[gt,qe,Ve]}],"drop-shadow":[{"drop-shadow":["","none",v,sp,ip]}],"drop-shadow-color":[{"drop-shadow":Q()}],grayscale:[{grayscale:["",gt,qe,Ve]}],"hue-rotate":[{"hue-rotate":[gt,qe,Ve]}],invert:[{invert:["",gt,qe,Ve]}],saturate:[{saturate:[gt,qe,Ve]}],sepia:[{sepia:["",gt,qe,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,Ve]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[gt,qe,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[gt,qe,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gt,qe,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gt,qe,Ve]}],"backdrop-invert":[{"backdrop-invert":["",gt,qe,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[gt,qe,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[gt,qe,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",gt,qe,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gt,"initial",qe,Ve]}],ease:[{ease:["linear","initial",S,qe,Ve]}],delay:[{delay:[gt,qe,Ve]}],animate:[{animate:["none",E,qe,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,qe,Ve]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[qe,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],zoom:[{zoom:[pi,qe,Ve]}],accent:[{accent:Q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe,Ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Q()}],"scrollbar-track-color":[{"scrollbar-track":Q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe,Ve]}],fill:[{fill:["none",...Q()]}],"stroke-w":[{stroke:[gt,od,Ua,GT]}],stroke:[{stroke:["none",...Q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},IN=uH(MH);function Ce(...e){return IN(Yw(e))}function NH(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function kn({error:e,localization:t,localizeErrors:n=!0}){var r;const o="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:o;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const s=e.error.code;if(t?.[s])return t[s]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||o}function gl(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}function Zb(e,t){for(const n in e)if(e[n]===t)return n}function Wd(e,t){let n=$().min(1,{message:t?.PASSWORD_REQUIRED});return e?.minLength&&(n=n.min(e.minLength,{message:t?.PASSWORD_TOO_SHORT})),e?.maxLength&&(n=n.max(e.maxLength,{message:t?.PASSWORD_TOO_LONG})),e?.regex&&(n=n.regex(e.regex,{message:t?.INVALID_PASSWORD})),n}var kH={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},DH={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},LH={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},$H={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},jH={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},zH={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},UH={...jH,...zH},FH={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},BH={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},VH={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},qH={INVALID_SESSION_TOKEN:"Invalid session token"},HH={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},GH={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},KH={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},ZH={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},YH={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},WH={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},QH={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},XH={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...$H,...kH,...DH,...LH,...UH,...FH,...BH,...VH,...qH,...HH,...GH,...KH,...ZH,...YH,...WH,...QH},JH={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},YT={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},WT={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};function eG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const tG=e=>{switch(e){case"success":return oG;case"info":return sG;case"warning":return iG;case"error":return aG;default:return null}},nG=Array(12).fill(0),rG=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},nG.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),oG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),iG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),sG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),aG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),lG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),cG=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Yb=1;class uG{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Yb++,l=this.toasts.find(d=>d.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),l?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...t,id:s,title:r}),{...d,...t,id:s,dismissible:c,title:r}):d):this.addToast({title:r,...o,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,l;const c=o.then(async f=>{if(l=["resolve",f],ee.isValidElement(f))s=!1,this.create({id:r,type:"default",message:f});else if(fG(f)&&!f.ok){s=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,..._})}else if(f instanceof Error){s=!1;const h=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,..._})}else if(n.success!==void 0){s=!1;const h=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:g,..._})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){s=!1;const p=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,v=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,p)=>c.then(()=>l[0]==="reject"?p(l[1]):f(l[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||Yb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Wr=new uG,dG=(e,t)=>{const n=t?.id||Yb++;return Wr.addToast({title:e,...t,id:n}),n},fG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",hG=dG,pG=()=>Wr.toasts,mG=()=>Wr.getActiveToasts(),QT=Object.assign(hG,{success:Wr.success,info:Wr.info,warning:Wr.warning,error:Wr.error,custom:Wr.custom,message:Wr.message,promise:Wr.promise,dismiss:Wr.dismiss,loading:Wr.loading},{getHistory:pG,getToasts:mG});eG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ap(e){return e.label!==void 0}const gG=3,vG="24px",yG="16px",XT=4e3,_G=356,bG=14,wG=45,SG=200;function mi(...e){return e.filter(Boolean).join(" ")}function EG(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const xG=e=>{var t,n,r,o,s,l,c,d,f;const{invert:p,toast:h,unstyled:g,interacting:v,setHeights:_,visibleToasts:b,heights:x,index:S,toasts:E,expanded:T,removeToast:R,defaultRichColors:O,closeButton:A,style:I,cancelButtonStyle:M,actionButtonStyle:L,className:q="",descriptionClassName:j="",duration:B,position:F,gap:Z,expandByDefault:ie,classNames:H,icons:W,closeButtonAriaLabel:te="Close toast"}=e,[le,Q]=ee.useState(null),[k,G]=ee.useState(null),[V,D]=ee.useState(!1),[U,X]=ee.useState(!1),[fe,pe]=ee.useState(!1),[xe,je]=ee.useState(!1),[Y,re]=ee.useState(!1),[ve,se]=ee.useState(0),[Se,Te]=ee.useState(0),tt=ee.useRef(h.duration||B||XT),rt=ee.useRef(null),Be=ee.useRef(null),Qe=S===0,Me=S+1<=b,Pe=h.type,Ue=h.dismissible!==!1,K=h.className||"",ne=h.descriptionClassName||"",ae=ee.useMemo(()=>x.findIndex(Ke=>Ke.toastId===h.id)||0,[x,h.id]),Oe=ee.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:A},[h.closeButton,A]),Ae=ee.useMemo(()=>h.duration||B||XT,[h.duration,B]),Ie=ee.useRef(0),ke=ee.useRef(0),Je=ee.useRef(0),et=ee.useRef(null),[_t,Tt]=F.split("-"),bt=ee.useMemo(()=>x.reduce((Ke,ut,Jt)=>Jt>=ae?Ke:Ke+ut.height,0),[x,ae]),Ln=cG(),Ni=h.invert||p,Ho=Pe==="loading";ke.current=ee.useMemo(()=>ae*Z+bt,[ae,bt]),ee.useEffect(()=>{tt.current=Ae},[Ae]),ee.useEffect(()=>{D(!0)},[]),ee.useEffect(()=>{const Ke=Be.current;if(Ke){const ut=Ke.getBoundingClientRect().height;return Te(ut),_(Jt=>[{toastId:h.id,height:ut,position:h.position},...Jt]),()=>_(Jt=>Jt.filter(Zt=>Zt.toastId!==h.id))}},[_,h.id]),ee.useLayoutEffect(()=>{if(!V)return;const Ke=Be.current,ut=Ke.style.height;Ke.style.height="auto";const Jt=Ke.getBoundingClientRect().height;Ke.style.height=ut,Te(Jt),_(Zt=>Zt.find(Lt=>Lt.toastId===h.id)?Zt.map(Lt=>Lt.toastId===h.id?{...Lt,height:Jt}:Lt):[{toastId:h.id,height:Jt,position:h.position},...Zt])},[V,h.title,h.description,_,h.id,h.jsx,h.action,h.cancel]);const Ye=ee.useCallback(()=>{X(!0),se(ke.current),_(Ke=>Ke.filter(ut=>ut.toastId!==h.id)),setTimeout(()=>{R(h)},SG)},[h,R,_,ke]);ee.useEffect(()=>{if(h.promise&&Pe==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return T||v||Ln?(()=>{if(Je.current<Ie.current){const Zt=new Date().getTime()-Ie.current;tt.current=tt.current-Zt}Je.current=new Date().getTime()})():tt.current!==1/0&&(Ie.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Ye()},tt.current)),()=>clearTimeout(Ke)},[T,v,h,Pe,Ln,Ye]),ee.useEffect(()=>{h.delete&&(Ye(),h.onDismiss==null||h.onDismiss.call(h,h))},[Ye,h.delete]);function pt(){var Ke;if(W?.loading){var ut;return ee.createElement("div",{className:mi(H?.loader,h==null||(ut=h.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Pe==="loading"},W.loading)}return ee.createElement(rG,{className:mi(H?.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Pe==="loading"})}const Ct=h.icon||W?.[Pe]||tG(Pe);var it,Dt;return ee.createElement("li",{tabIndex:0,ref:Be,className:mi(q,K,H?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,H?.default,H?.[Pe],h==null||(n=h.classNames)==null?void 0:n[Pe]),"data-sonner-toast":"","data-rich-colors":(it=h.richColors)!=null?it:O,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":V,"data-promise":!!h.promise,"data-swiped":Y,"data-removed":U,"data-visible":Me,"data-y-position":_t,"data-x-position":Tt,"data-index":S,"data-front":Qe,"data-swiping":fe,"data-dismissible":Ue,"data-type":Pe,"data-invert":Ni,"data-swipe-out":xe,"data-swipe-direction":k,"data-expanded":!!(T||ie&&V),"data-testid":h.testId,style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${U?ve:ke.current}px`,"--initial-height":ie?"auto":`${Se}px`,...I,...h.style},onDragEnd:()=>{pe(!1),Q(null),et.current=null},onPointerDown:Ke=>{Ke.button!==2&&(Ho||!Ue||(rt.current=new Date,se(ke.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(pe(!0),et.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,ut,Jt;if(xe||!Ue)return;et.current=null;const Zt=Number(((Ke=Be.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Sr=Number(((ut=Be.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Lt=new Date().getTime()-((Jt=rt.current)==null?void 0:Jt.getTime()),ln=le==="x"?Zt:Sr,So=Math.abs(ln)/Lt;if(Math.abs(ln)>=wG||So>.11){se(ke.current),h.onDismiss==null||h.onDismiss.call(h,h),G(le==="x"?Zt>0?"right":"left":Sr>0?"down":"up"),Ye(),je(!0);return}else{var sr,zr;(sr=Be.current)==null||sr.style.setProperty("--swipe-amount-x","0px"),(zr=Be.current)==null||zr.style.setProperty("--swipe-amount-y","0px")}re(!1),pe(!1),Q(null)},onPointerMove:Ke=>{var ut,Jt,Zt;if(!et.current||!Ue||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const Lt=Ke.clientY-et.current.y,ln=Ke.clientX-et.current.x;var So;const sr=(So=e.swipeDirections)!=null?So:EG(F);!le&&(Math.abs(ln)>1||Math.abs(Lt)>1)&&Q(Math.abs(ln)>Math.abs(Lt)?"x":"y");let zr={x:0,y:0};const bl=Go=>1/(1.5+Math.abs(Go)/20);if(le==="y"){if(sr.includes("top")||sr.includes("bottom"))if(sr.includes("top")&&Lt<0||sr.includes("bottom")&&Lt>0)zr.y=Lt;else{const Go=Lt*bl(Lt);zr.y=Math.abs(Go)<Math.abs(Lt)?Go:Lt}}else if(le==="x"&&(sr.includes("left")||sr.includes("right")))if(sr.includes("left")&&ln<0||sr.includes("right")&&ln>0)zr.x=ln;else{const Go=ln*bl(ln);zr.x=Math.abs(Go)<Math.abs(ln)?Go:ln}(Math.abs(zr.x)>0||Math.abs(zr.y)>0)&&re(!0),(Jt=Be.current)==null||Jt.style.setProperty("--swipe-amount-x",`${zr.x}px`),(Zt=Be.current)==null||Zt.style.setProperty("--swipe-amount-y",`${zr.y}px`)}},Oe&&!h.jsx&&Pe!=="loading"?ee.createElement("button",{"aria-label":te,"data-disabled":Ho,"data-close-button":!0,onClick:Ho||!Ue?()=>{}:()=>{Ye(),h.onDismiss==null||h.onDismiss.call(h,h)},className:mi(H?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Dt=W?.close)!=null?Dt:lG):null,(Pe||h.icon||h.promise)&&h.icon!==null&&(W?.[Pe]!==null||h.icon)?ee.createElement("div",{"data-icon":"",className:mi(H?.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||pt():null,h.type!=="loading"?Ct:null):null,ee.createElement("div",{"data-content":"",className:mi(H?.content,h==null||(s=h.classNames)==null?void 0:s.content)},ee.createElement("div",{"data-title":"",className:mi(H?.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ee.createElement("div",{"data-description":"",className:mi(j,ne,H?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),ee.isValidElement(h.cancel)?h.cancel:h.cancel&&ap(h.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:Ke=>{ap(h.cancel)&&Ue&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),Ye())},className:mi(H?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,ee.isValidElement(h.action)?h.action:h.action&&ap(h.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Ke=>{ap(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&Ye())},className:mi(H?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function JT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function RG(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,l=s?"--mobile-offset":"--offset",c=s?yG:vG;function d(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=c:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const OG=ee.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:p,mobileOffset:h,theme:g="light",richColors:v,duration:_,style:b,visibleToasts:x=gG,toastOptions:S,dir:E=JT(),gap:T=bG,icons:R,containerAriaLabel:O="Notifications"}=t,[A,I]=ee.useState([]),M=ee.useMemo(()=>r?A.filter(V=>V.toasterId===r):A.filter(V=>!V.toasterId),[A,r]),L=ee.useMemo(()=>Array.from(new Set([s].concat(M.filter(V=>V.position).map(V=>V.position)))),[M,s]),[q,j]=ee.useState([]),[B,F]=ee.useState(!1),[Z,ie]=ee.useState(!1),[H,W]=ee.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=ee.useRef(null),le=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=ee.useRef(null),k=ee.useRef(!1),G=ee.useCallback(V=>{I(D=>{var U;return(U=D.find(X=>X.id===V.id))!=null&&U.delete||Wr.dismiss(V.id),D.filter(({id:X})=>X!==V.id)})},[]);return ee.useEffect(()=>Wr.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{I(D=>D.map(U=>U.id===V.id?{...U,delete:!0}:U))});return}setTimeout(()=>{KM.flushSync(()=>{I(D=>{const U=D.findIndex(X=>X.id===V.id);return U!==-1?[...D.slice(0,U),{...D[U],...V},...D.slice(U+1)]:[V,...D]})})})}),[A]),ee.useEffect(()=>{if(g!=="system"){W(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:D})=>{W(D?"dark":"light")})}catch{V.addListener(({matches:U})=>{try{W(U?"dark":"light")}catch(X){console.error(X)}})}},[g]),ee.useEffect(()=>{A.length<=1&&F(!1)},[A]),ee.useEffect(()=>{const V=D=>{var U;if(l.every(pe=>D[pe]||D.code===pe)){var fe;F(!0),(fe=te.current)==null||fe.focus()}D.code==="Escape"&&(document.activeElement===te.current||(U=te.current)!=null&&U.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[l]),ee.useEffect(()=>{if(te.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,k.current=!1)}},[te.current]),ee.createElement("section",{ref:n,"aria-label":`${O} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((V,D)=>{var U;const[X,fe]=V.split("-");return M.length?ee.createElement("ol",{key:V,dir:E==="auto"?JT():E,tabIndex:-1,ref:te,className:f,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":X,"data-x-position":fe,style:{"--front-toast-height":`${((U=q[0])==null?void 0:U.height)||0}px`,"--width":`${_G}px`,"--gap":`${T}px`,...b,...RG(p,h)},onBlur:pe=>{k.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(k.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||k.current||(k.current=!0,Q.current=pe.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{Z||F(!1)},onDragEnd:()=>F(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||ie(!0)},onPointerUp:()=>ie(!1)},M.filter(pe=>!pe.position&&D===0||pe.position===V).map((pe,xe)=>{var je,Y;return ee.createElement(xG,{key:pe.id,icons:R,index:xe,toast:pe,defaultRichColors:v,duration:(je=S?.duration)!=null?je:_,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:o,visibleToasts:x,closeButton:(Y=S?.closeButton)!=null?Y:d,interacting:Z,position:V,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:G,toasts:M.filter(re=>re.position==pe.position),heights:q.filter(re=>re.position==pe.position),setHeights:j,expandByDefault:c,gap:T,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),PN=P.createContext({});function MN(){return P.useContext(PN)}var s_,eC;function TG(){if(eC)return s_;eC=1;var e=function(){};return s_=e,s_}var CG=TG();const AG=fl(CG);function IG({async:e,appendTo:t,defer:n,id:r,nonce:o,src:s}){const l=document.createElement("script");e!==void 0&&(l.async=e),n!==void 0&&(l.defer=n),r&&(l.id=r),o&&l.setAttribute("nonce",o),l.src=s,(t==="head"?document.head:document.body).appendChild(l)}var PG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Dd=null,Qd=!1;const qm=new Set,Hm=new Set,MG=typeof window<"u",Dc="___grecaptcha_cfg",NN=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function NG(){if(!MG)return;function e(n){if(Qd)n();else{window[Dc]||(window[Dc]={});const r=window[Dc];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){Qd=!0;for(const n of Hm)n();Hm.clear()}window[NN]=t}function kG({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:o=!1}){const s=o?"recaptcha.net":"google.com",l=r?"enterprise.js":"api.js",c=new URLSearchParams({render:n});return t&&c.set("onload",t),e&&c.set("hl",e),`https://www.${s}/recaptcha/${l}?${c.toString()}`}function DG({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:o}){const s={id:"google-recaptcha-v3"},l=kG({language:e,onLoadCallbackName:NN,render:t,useEnterprise:r,useRecaptchaNet:o});if(Dd){if(Dd!==l)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}Dd=l,IG(Object.assign(Object.assign(Object.assign({},s),n),{src:l}))}function LG(e){if(!window[Dc])return;const t=window[Dc];t.clients&&delete t.clients[e]}function $G(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,o=PG(t,["onLoadCallback","onLoadCallbackName"]);if(qm.size===0&&NG(),DG(o),qm.add(e),n&&(Qd?n():Hm.add(n)),r){let s=function(){if(!r)return;const l=window[r];typeof l=="function"&&l()};Qd?s():Hm.add(s)}}function jG(e){var t,n,r;qm.delete(e),qm.size===0&&(window.grecaptcha=void 0,window[Dc]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${Dd}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),Dd=null,Qd=!1)}let tC=!1;function zG({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:o,useEnterprise:s,useRecaptchaNet:l}){var c,d,f,p,h,g,v;const _=P.useId(),[b,x]=P.useState(null),[S,E]=P.useState(null),T=P.useRef(!1);P.useEffect(()=>{function I(){var M;const L=s?(M=window.grecaptcha)===null||M===void 0?void 0:M.enterprise:window.grecaptcha;if(!L)throw new Error("reCAPTCHA not found");if(!L.ready)throw new Error("reCAPTCHA ready callback not found");L.ready(()=>{x(L)})}return $G(_,{language:n,onLoadCallback:I,onLoadCallbackName:o?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:o?.appendTo,async:o?.async,defer:o?.defer,id:o?.id,nonce:o?.nonce},useEnterprise:s,useRecaptchaNet:l}),()=>{jG(_),x(null)}},[e?.element,_,n,r,o?.appendTo,o?.async,o?.defer,o?.id,o?.nonce,o?.onLoadCallbackName,s,l]),P.useEffect(()=>{var I,M,L;if(!e?.element||!b?.render)return;const q={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((I=e.parameters)===null||I===void 0?void 0:I.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},j=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!j)throw new Error("reCAPTCHA container element not found");const B=b.render(j,q);return!((M=e?.parameters)===null||M===void 0)&&M.hidden&&(tC||(AG(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),tC=!0),(L=j.querySelector(".grecaptcha-badge"))===null||L===void 0||L.style.setProperty("display","none")),E(B),T.current=!0,()=>{E(null),T.current=!1,LG(B),j.innerHTML=""}},[e?.element,(c=e?.parameters)===null||c===void 0?void 0:c.badge,(d=e?.parameters)===null||d===void 0?void 0:d.hidden,(f=e?.parameters)===null||f===void 0?void 0:f.callback,(p=e?.parameters)===null||p===void 0?void 0:p.errorCallback,(h=e?.parameters)===null||h===void 0?void 0:h.expiredCallback,(g=e?.parameters)===null||g===void 0?void 0:g.tabindex,(v=e?.parameters)===null||v===void 0?void 0:v.theme,b,r]);const R=!!e?.element,O=R?S:r,A=P.useMemo(()=>O!==null&&b?.execute?I=>{if(O===null||!b?.execute)throw new Error("reCAPTCHA has not been loaded");return R&&!T.current?(console.warn("Client ID not mounted"),null):b.execute(O,{action:I})}:void 0,[O,b,R]);return C.jsx(PN.Provider,{value:{container:e?.element,executeRecaptcha:A,reCaptchaInstance:b},children:t})}var UG=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},No=new UG;function FG(){return()=>{}}function ms(){return P.useSyncExternalStore(FG,()=>!0,()=>!1)}function kN(){const[e,t]=P.useState();return P.useEffect(()=>{const n=()=>{const o=document.documentElement.getAttribute("lang");t(o??void 0)};n();const r=new MutationObserver(o=>{for(const s of o)s.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function Xw(){const[e,t]=P.useState("light");return P.useEffect(()=>{const n=()=>{var o;const s=document.documentElement.classList.contains("dark")||((o=document.documentElement.getAttribute("style"))==null?void 0:o.includes("color-scheme: dark"));t(s?"dark":"light")};n();const r=new MutationObserver(o=>{for(const s of o)(s.attributeName==="style"||s.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function BG({children:e}){const t=ms(),{captcha:n}=P.useContext(vt);return n?.provider!=="google-recaptcha-v3"?e:C.jsxs(zG,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&C.jsx("style",{children:`
|
|
48
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function Fm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.ref=null,p){r(p);const g=e.seen.get(p),v=g.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),l._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&g.def)for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}const h=l._zod.parent;if(h&&h!==p){r(h);const g=e.seen.get(h);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const v in d)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(d[v])===JSON.stringify(g.def[v])&&delete d[v]}e.override({zodSchema:l,jsonSchema:d,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bm(t,"input",e.processors),output:Bm(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Dr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Dr(r.element,n);if(r.type==="set")return Dr(r.valueType,n);if(r.type==="lazy")return Dr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Dr(r.innerType,n);if(r.type==="intersection")return Dr(r.left,n)||Dr(r.right,n);if(r.type==="record"||r.type==="map")return Dr(r.keyType,n)||Dr(r.valueType,n);if(r.type==="pipe")return Dr(r.in,n)||Dr(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Dr(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Dr(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Dr(o,n))return!0;return!!(r.rest&&Dr(r.rest,n))}return!1}const YF=(e,t={})=>n=>{const r=zm({...n,processors:t});return sn(e,r),Um(r,e),Fm(r,e)},Bm=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},l=zm({...o??{},target:s,io:t,processors:n});return sn(e,l),Um(l,e),Fm(l,e)},WF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},b3=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:l,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof l=="number"&&(o.maxLength=l),c&&(o.format=WF[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),f&&(o.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?o.pattern=p[0].source:p.length>1&&(o.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},w3=(e,t,n,r)=>{const o=n,{minimum:s,maximum:l,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=p,o.exclusiveMinimum=!0):o.exclusiveMinimum=p),typeof s=="number"&&(o.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=f,o.exclusiveMaximum=!0):o.exclusiveMaximum=f),typeof l=="number"&&(o.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete o.maximum:delete o.exclusiveMaximum)),typeof d=="number"&&(o.multipleOf=d)},S3=(e,t,n,r)=>{n.type="boolean"},QF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},XF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},E3=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},x3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},JF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},R3=(e,t,n,r)=>{n.not={}},O3=(e,t,n,r)=>{},T3=(e,t,n,r)=>{},eB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},C3=(e,t,n,r)=>{const o=e._zod.def,s=JM(o.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},A3=(e,t,n,r)=>{const o=e._zod.def,s=[];for(const l of o.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(l))}else s.push(l);if(s.length!==0)if(s.length===1){const l=s[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),s.every(l=>typeof l=="boolean")&&(n.type="boolean"),s.every(l=>l===null)&&(n.type="null"),n.enum=s},tB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},nB=(e,t,n,r)=>{const o=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},I3=(e,t,n,r)=>{const o=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:l,maximum:c,mime:d}=e._zod.bag;l!==void 0&&(s.minLength=l),c!==void 0&&(s.maxLength=c),d?d.length===1?(s.contentMediaType=d[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=d.map(f=>({contentMediaType:f}))):Object.assign(o,s)},rB=(e,t,n,r)=>{n.type="boolean"},P3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},oB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},M3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},iB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},sB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},N3=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=sn(s.element,t,{...r,path:[...r.path,"items"]})},k3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const l=s.shape;for(const f in l)o.properties[f]=sn(l[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(l)),d=new Set([...c].filter(f=>{const p=s.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(o.required=Array.from(d)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=sn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},D3=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,l=o.options.map((c,d)=>sn(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",d]}));s?n.oneOf=l:n.anyOf=l},L3=(e,t,n,r)=>{const o=e._zod.def,s=sn(o.left,t,{...r,path:[...r.path,"allOf",0]}),l=sn(o.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=d},$3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="array";const l=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=s.items.map((g,v)=>sn(g,t,{...r,path:[...r.path,l,v]})),f=s.rest?sn(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=d,f&&(o.items=f)):t.target==="openapi-3.0"?(o.items={anyOf:d},f&&o.items.anyOf.push(f),o.minItems=d.length,f||(o.maxItems=d.length)):(o.items=d,f&&(o.additionalItems=f));const{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(o.minItems=p),typeof h=="number"&&(o.maxItems=h)},j3=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const l=s.keyType,d=l._zod.bag?.patterns;if(s.mode==="loose"&&d&&d.size>0){const p=sn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of d)o.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=sn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=sn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const p=[...f].filter(h=>typeof h=="string"||typeof h=="number");p.length>0&&(o.required=p)}},z3=(e,t,n,r)=>{const o=e._zod.def,s=sn(o.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},U3=(e,t,n,r)=>{const o=e._zod.def;sn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},F3=(e,t,n,r)=>{const o=e._zod.def;sn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},B3=(e,t,n,r)=>{const o=e._zod.def;sn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},V3=(e,t,n,r)=>{const o=e._zod.def;sn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let l;try{l=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},q3=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;sn(s,t,r);const l=t.seen.get(e);l.ref=s},H3=(e,t,n,r)=>{const o=e._zod.def;sn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},aB=(e,t,n,r)=>{const o=e._zod.def;sn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Fw=(e,t,n,r)=>{const o=e._zod.def;sn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},G3=(e,t,n,r)=>{const o=e._zod.innerType;sn(o,t,r);const s=t.seen.get(e);s.ref=o},PT={string:b3,number:w3,boolean:S3,bigint:QF,symbol:XF,null:E3,undefined:x3,void:JF,never:R3,any:O3,unknown:T3,date:eB,enum:C3,literal:A3,nan:tB,template_literal:nB,file:I3,success:rB,custom:P3,function:oB,transform:M3,map:iB,set:sB,array:N3,object:k3,union:D3,intersection:L3,tuple:$3,record:j3,nullable:z3,nonoptional:U3,default:F3,prefault:B3,catch:V3,pipe:q3,readonly:H3,promise:aB,optional:Fw,lazy:G3};function kce(e,t){if("_idmap"in e){const r=e,o=zm({...t,processors:PT}),s={};for(const d of r._idmap.entries()){const[f,p]=d;sn(p,o)}const l={},c={registry:r,uri:t?.uri,defs:s};o.external=c;for(const d of r._idmap.entries()){const[f,p]=d;Um(o,p),l[f]=Fm(o,p)}if(Object.keys(s).length>0){const d=o.target==="draft-2020-12"?"$defs":"definitions";l.__shared={[d]:s}}return{schemas:l}}const n=zm({...t,processors:PT});return sn(e,n),Um(n,e),Fm(n,e)}const lB=ye("ZodISODateTime",(e,t)=>{oU.init(e,t),wn.init(e,t)});function K3(e){return mF(lB,e)}const cB=ye("ZodISODate",(e,t)=>{iU.init(e,t),wn.init(e,t)});function uB(e){return gF(cB,e)}const dB=ye("ZodISOTime",(e,t)=>{sU.init(e,t),wn.init(e,t)});function fB(e){return vF(dB,e)}const hB=ye("ZodISODuration",(e,t)=>{aU.init(e,t),wn.init(e,t)});function pB(e){return yF(hB,e)}const mB=(e,t)=>{zw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>q9(e,n)},flatten:{value:n=>V9(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ub,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ub,2)}},isEmpty:{get(){return e.issues.length===0}}})},Bo=ye("ZodError",mB,{Parent:Error}),gB=jg(Bo),vB=zg(Bo),yB=Ug(Bo),_B=Fg(Bo),bB=Y9(Bo),wB=W9(Bo),SB=Q9(Bo),EB=X9(Bo),xB=J9(Bo),RB=ez(Bo),OB=tz(Bo),TB=nz(Bo),Kt=ye("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bm(e,"input"),output:Bm(e,"output")}}),e.toJSONSchema=YF(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ga(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>va(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>gB(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>yB(e,n,r),e.parseAsync=async(n,r)=>vB(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>_B(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>bB(e,n,r),e.decode=(n,r)=>wB(e,n,r),e.encodeAsync=async(n,r)=>SB(e,n,r),e.decodeAsync=async(n,r)=>EB(e,n,r),e.safeEncode=(n,r)=>xB(e,n,r),e.safeDecode=(n,r)=>RB(e,n,r),e.safeEncodeAsync=async(n,r)=>OB(e,n,r),e.safeDecodeAsync=async(n,r)=>TB(e,n,r),e.refine=(n,r)=>e.check(EV(n,r)),e.superRefine=n=>e.check(xV(n)),e.overwrite=n=>e.check(nu(n)),e.optional=()=>bn(e),e.exactOptional=()=>cV(e),e.nullable=()=>kT(e),e.nullish=()=>bn(kT(e)),e.nonoptional=n=>mV(e,n),e.array=()=>Re(e),e.or=n=>nn([e,n]),e.and=n=>Hw(e,n),e.transform=n=>Vb(e,J3(n)),e.default=n=>fV(e,n),e.prefault=n=>pV(e,n),e.catch=n=>vV(e,n),e.pipe=n=>Vb(e,n),e.readonly=()=>bV(e),e.describe=n=>{const r=e.clone();return wd.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return wd.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return wd.get(e);const r=e.clone();return wd.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Z3=ye("_ZodString",(e,t)=>{Uw.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>b3(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(PF(...r)),e.includes=(...r)=>e.check(kF(...r)),e.startsWith=(...r)=>e.check(DF(...r)),e.endsWith=(...r)=>e.check(LF(...r)),e.min=(...r)=>e.check(jm(...r)),e.max=(...r)=>e.check(y3(...r)),e.length=(...r)=>e.check(_3(...r)),e.nonempty=(...r)=>e.check(jm(1,...r)),e.lowercase=r=>e.check(MF(r)),e.uppercase=r=>e.check(NF(r)),e.trim=()=>e.check(zF()),e.normalize=(...r)=>e.check(jF(...r)),e.toLowerCase=()=>e.check(UF()),e.toUpperCase=()=>e.check(FF()),e.slugify=()=>e.check(BF())}),CB=ye("ZodString",(e,t)=>{Uw.init(e,t),Z3.init(e,t),e.email=n=>e.check(YU(AB,n)),e.url=n=>e.check(v3(Y3,n)),e.jwt=n=>e.check(pF(HB,n)),e.emoji=n=>e.check(eF(PB,n)),e.guid=n=>e.check(TT(MT,n)),e.uuid=n=>e.check(WU(ep,n)),e.uuidv4=n=>e.check(QU(ep,n)),e.uuidv6=n=>e.check(XU(ep,n)),e.uuidv7=n=>e.check(JU(ep,n)),e.nanoid=n=>e.check(tF(MB,n)),e.guid=n=>e.check(TT(MT,n)),e.cuid=n=>e.check(nF(NB,n)),e.cuid2=n=>e.check(rF(kB,n)),e.ulid=n=>e.check(oF(DB,n)),e.base64=n=>e.check(dF(BB,n)),e.base64url=n=>e.check(fF(VB,n)),e.xid=n=>e.check(iF(LB,n)),e.ksuid=n=>e.check(sF($B,n)),e.ipv4=n=>e.check(aF(jB,n)),e.ipv6=n=>e.check(lF(zB,n)),e.cidrv4=n=>e.check(cF(UB,n)),e.cidrv6=n=>e.check(uF(FB,n)),e.e164=n=>e.check(hF(qB,n)),e.datetime=n=>e.check(K3(n)),e.date=n=>e.check(uB(n)),e.time=n=>e.check(fB(n)),e.duration=n=>e.check(pB(n))});function $(e){return ZU(CB,e)}const wn=ye("ZodStringFormat",(e,t)=>{gn.init(e,t),Z3.init(e,t)}),AB=ye("ZodEmail",(e,t)=>{Yz.init(e,t),wn.init(e,t)}),MT=ye("ZodGUID",(e,t)=>{Kz.init(e,t),wn.init(e,t)}),ep=ye("ZodUUID",(e,t)=>{Zz.init(e,t),wn.init(e,t)}),Y3=ye("ZodURL",(e,t)=>{Wz.init(e,t),wn.init(e,t)});function IB(e){return v3(Y3,e)}const PB=ye("ZodEmoji",(e,t)=>{Qz.init(e,t),wn.init(e,t)}),MB=ye("ZodNanoID",(e,t)=>{Xz.init(e,t),wn.init(e,t)}),NB=ye("ZodCUID",(e,t)=>{Jz.init(e,t),wn.init(e,t)}),kB=ye("ZodCUID2",(e,t)=>{eU.init(e,t),wn.init(e,t)}),DB=ye("ZodULID",(e,t)=>{tU.init(e,t),wn.init(e,t)}),LB=ye("ZodXID",(e,t)=>{nU.init(e,t),wn.init(e,t)}),$B=ye("ZodKSUID",(e,t)=>{rU.init(e,t),wn.init(e,t)}),jB=ye("ZodIPv4",(e,t)=>{lU.init(e,t),wn.init(e,t)}),zB=ye("ZodIPv6",(e,t)=>{cU.init(e,t),wn.init(e,t)}),UB=ye("ZodCIDRv4",(e,t)=>{uU.init(e,t),wn.init(e,t)}),FB=ye("ZodCIDRv6",(e,t)=>{dU.init(e,t),wn.init(e,t)}),BB=ye("ZodBase64",(e,t)=>{fU.init(e,t),wn.init(e,t)}),VB=ye("ZodBase64URL",(e,t)=>{pU.init(e,t),wn.init(e,t)}),qB=ye("ZodE164",(e,t)=>{mU.init(e,t),wn.init(e,t)}),HB=ye("ZodJWT",(e,t)=>{vU.init(e,t),wn.init(e,t)}),Bw=ye("ZodNumber",(e,t)=>{f3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>w3(e,r,o),e.gt=(r,o)=>e.check(AT(r,o)),e.gte=(r,o)=>e.check(Qy(r,o)),e.min=(r,o)=>e.check(Qy(r,o)),e.lt=(r,o)=>e.check(CT(r,o)),e.lte=(r,o)=>e.check(Wy(r,o)),e.max=(r,o)=>e.check(Wy(r,o)),e.int=r=>e.check(NT(r)),e.safe=r=>e.check(NT(r)),e.positive=r=>e.check(AT(0,r)),e.nonnegative=r=>e.check(Qy(0,r)),e.negative=r=>e.check(CT(0,r)),e.nonpositive=r=>e.check(Wy(0,r)),e.multipleOf=(r,o)=>e.check(IT(r,o)),e.step=(r,o)=>e.check(IT(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function dt(e){return _F(Bw,e)}const GB=ye("ZodNumberFormat",(e,t)=>{yU.init(e,t),Bw.init(e,t)});function NT(e){return wF(GB,e)}const W3=ye("ZodBoolean",(e,t)=>{_U.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>S3(e,n,r)});function Nt(e){return SF(W3,e)}const KB=ye("ZodUndefined",(e,t)=>{bU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>x3(e,n)});function Dce(e){return xF(KB,e)}const ZB=ye("ZodNull",(e,t)=>{wU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>E3(e,n,r)});function YB(e){return RF(ZB,e)}const WB=ye("ZodAny",(e,t)=>{SU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>O3()});function QB(){return OF(WB)}const XB=ye("ZodUnknown",(e,t)=>{EU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>T3()});function Gt(){return TF(XB)}const JB=ye("ZodNever",(e,t)=>{xU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>R3(e,n,r)});function Q3(e){return CF(JB,e)}const eV=ye("ZodArray",(e,t)=>{RU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>N3(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(jm(n,r)),e.nonempty=n=>e.check(jm(1,n)),e.max=(n,r)=>e.check(y3(n,r)),e.length=(n,r)=>e.check(_3(n,r)),e.unwrap=()=>e.element});function Re(e,t){return VF(eV,e,t)}const Vw=ye("ZodObject",(e,t)=>{TU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>k3(e,n,r,o),It(e,"shape",()=>t.shape),e.keyof=()=>an(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Gt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Gt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Q3()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>j9(e,n),e.safeExtend=n=>z9(e,n),e.merge=n=>U9(e,n),e.pick=n=>L9(e,n),e.omit=n=>$9(e,n),e.partial=(...n)=>F9(eN,e,n[0]),e.required=(...n)=>B9(tN,e,n[0])});function be(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new Vw(n)}function Lce(e,t){return new Vw({type:"object",shape:e,catchall:Q3(),...Fe(t)})}function vr(e,t){return new Vw({type:"object",shape:e,catchall:Gt(),...Fe(t)})}const X3=ye("ZodUnion",(e,t)=>{m3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>D3(e,n,r,o),e.options=t.options});function nn(e,t){return new X3({type:"union",options:e,...Fe(t)})}const tV=ye("ZodDiscriminatedUnion",(e,t)=>{X3.init(e,t),CU.init(e,t)});function qw(e,t,n){return new tV({type:"union",options:t,discriminator:e,...Fe(n)})}const nV=ye("ZodIntersection",(e,t)=>{AU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>L3(e,n,r,o)});function Hw(e,t){return new nV({type:"intersection",left:e,right:t})}const rV=ye("ZodTuple",(e,t)=>{IU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$3(e,n,r,o),e.rest=n=>e.clone({...e._zod.def,rest:n})});function $ce(e,t,n){const r=t instanceof Bt,o=r?n:t,s=r?t:null;return new rV({type:"tuple",items:e,rest:s,...Fe(o)})}const oV=ye("ZodRecord",(e,t)=>{PU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>j3(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Pt(e,t,n){return new oV({type:"record",keyType:e,valueType:t,...Fe(n)})}const Bb=ye("ZodEnum",(e,t)=>{MU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>C3(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const l of r)if(n.has(l))s[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Bb({...t,checks:[],...Fe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const l of r)if(n.has(l))delete s[l];else throw new Error(`Key ${l} not found in enum`);return new Bb({...t,checks:[],...Fe(o),entries:s})}});function an(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Bb({type:"enum",entries:n,...Fe(t)})}const iV=ye("ZodLiteral",(e,t)=>{NU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>A3(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ge(e,t){return new iV({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const sV=ye("ZodFile",(e,t)=>{kU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>I3(e,n,r),e.min=(n,r)=>e.check(IF(n,r)),e.max=(n,r)=>e.check(AF(n,r)),e.mime=(n,r)=>e.check($F(Array.isArray(n)?n:[n],r))});function jce(e){return qF(sV,e)}const aV=ye("ZodTransform",(e,t)=>{DU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>M3(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new QM(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Yd(s,n.value,t));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Yd(l))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function J3(e){return new aV({type:"transform",transform:e})}const eN=ye("ZodOptional",(e,t)=>{g3.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bn(e){return new eN({type:"optional",innerType:e})}const lV=ye("ZodExactOptional",(e,t)=>{LU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function cV(e){return new lV({type:"optional",innerType:e})}const uV=ye("ZodNullable",(e,t)=>{$U.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>z3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function kT(e){return new uV({type:"nullable",innerType:e})}const dV=ye("ZodDefault",(e,t)=>{jU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>F3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fV(e,t){return new dV({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t3(t)}})}const hV=ye("ZodPrefault",(e,t)=>{zU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>B3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function pV(e,t){return new hV({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t3(t)}})}const tN=ye("ZodNonOptional",(e,t)=>{UU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>U3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function mV(e,t){return new tN({type:"nonoptional",innerType:e,...Fe(t)})}const gV=ye("ZodCatch",(e,t)=>{FU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>V3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vV(e,t){return new gV({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const yV=ye("ZodPipe",(e,t)=>{BU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>q3(e,n,r,o),e.in=t.in,e.out=t.out});function Vb(e,t){return new yV({type:"pipe",in:e,out:t})}const _V=ye("ZodReadonly",(e,t)=>{VU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>H3(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bV(e){return new _V({type:"readonly",innerType:e})}const wV=ye("ZodLazy",(e,t)=>{qU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>G3(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function ya(e){return new wV({type:"lazy",getter:e})}const Gw=ye("ZodCustom",(e,t)=>{HU.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>P3(e,n)});function SV(e,t){return HF(Gw,e??(()=>!0),t)}function EV(e,t={}){return GF(Gw,e,t)}function xV(e){return KF(e)}function zce(e,t={}){const n=new Gw({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Fe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Kw(e,t){return Vb(J3(e),t)}const RV={custom:"custom"};function nN(e){return bF(Bw,e)}function DT(e){return EF(W3,e)}function OV(e){return e.charAt(0).toUpperCase()+e.slice(1)}var kd=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function TV(e){try{return(new URL(e).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new kd(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function CV(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new kd(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof kd?t:new kd(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Xy(e,t="/api/auth"){if(CV(e),TV(e))return e;const n=e.replace(/\/+$/,"");return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function AV(e,t,n,r,o){if(e)return Xy(e,t);{const s=Do.BETTER_AUTH_URL||Do.NEXT_PUBLIC_BETTER_AUTH_URL||Do.PUBLIC_BETTER_AUTH_URL||Do.NUXT_PUBLIC_BETTER_AUTH_URL||Do.NUXT_PUBLIC_AUTH_URL||(Do.BASE_URL!=="/"?Do.BASE_URL:void 0);if(s)return Xy(s,t)}if(typeof window<"u"&&window.location)return Xy(window.location.origin,t)}const IV={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},PV={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},MV=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,LT={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},NV=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function kV(e){return e instanceof Date&&!isNaN(e.getTime())}function DV(e){const t=NV.exec(e);if(!t)return null;const[,n,r,o,s,l,c,d,f,p,h]=t,g=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(o,10),parseInt(s,10),parseInt(l,10),parseInt(c,10),d?parseInt(d.padEnd(3,"0"),10):0));if(f){const v=(parseInt(p,10)*60+parseInt(h,10))*(f==="+"?-1:1);g.setUTCMinutes(g.getUTCMinutes()+v)}return kV(g)?g:null}function LV(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:o,parseDates:s=!0}=t;if(typeof e!="string")return e;const l=e.trim();if(l.length>0&&l[0]==='"'&&l.endsWith('"')&&!l.slice(1,-1).includes('"'))return l.slice(1,-1);const c=l.toLowerCase();if(c.length<=9&&c in LT)return LT[c];if(!MV.test(l)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(PV).some(([d,f])=>{const p=f.test(l);return p&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${d} pattern`),p})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(l,(f,p)=>{if(f==="__proto__"||f==="constructor"&&p&&typeof p=="object"&&"prototype"in p){r&&console.warn(`[better-json] Dropping "${f}" key to prevent prototype pollution`);return}if(s&&typeof p=="string"){const h=DV(p);if(h)return h}return o?o(f,p):p})}catch(d){if(n)throw d;return e}}function $V(e,t={strict:!0}){return LV(e,t)}let Wo=[],Vs=0;const tp=4,jV=globalThis.nanostoresGlobal||={epoch:0},Cc=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(r){return n.lc=t.push(r),()=>{for(let s=Vs+tp;s<Wo.length;)Wo[s]===r?Wo.splice(s,tp):s+=tp;let o=t.indexOf(r);~o&&(t.splice(o,1),--n.lc||n.off())}},notify(r,o){jV.epoch++;let s=!Wo.length;for(let l of t)Wo.push(l,n.value,r,o);if(s){for(Vs=0;Vs<Wo.length;Vs+=tp)Wo[Vs](Wo[Vs+1],Wo[Vs+2],Wo[Vs+3]);Wo.length=0}},off(){},set(r){let o=n.value;o!==r&&(n.value=r,n.notify(o))},subscribe(r){let o=n.listen(r);return r(n.value),o},value:e};return n},zV=5,np=6,rp=10;let UV=(e,t,n,r)=>(e.events=e.events||{},e.events[n+rp]||(e.events[n+rp]=r(o=>{e.events[n].reduceRight((s,l)=>(l(s),s),{shared:{},...o})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],s=o.indexOf(t);o.splice(s,1),o.length||(delete e.events[n],e.events[n+rp](),delete e.events[n+rp])});const FV=1e3;let rN=(e,t)=>UV(e,r=>{let o=t(r);o&&e.events[np].push(o)},zV,r=>{let o=e.listen;e.listen=(...l)=>(!e.lc&&!e.active&&(e.active=!0,r()),o(...l));let s=e.off;return e.events[np]=[],e.off=()=>{s(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let l of e.events[np])l();e.events[np]=[]}},FV)},()=>{e.listen=o,e.off=s}});function BV(e,t,n){let r=new Set(t).add(void 0);return e.listen((o,s,l)=>{r.has(l)&&n(o,s,l)})}const VV=()=>typeof window>"u",Sd=(e,t,n,r)=>{const o=Cc({data:null,error:null,isPending:!0,isRefetching:!1,refetch:c=>s(c)}),s=async c=>new Promise(d=>{const f=typeof r=="function"?r({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):r;n(t,{...f,query:{...f?.query,...c?.query},async onSuccess(p){o.set({data:p.data,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await f?.onSuccess?.(p)},async onError(p){const{request:h}=p,g=typeof h.retry=="number"?h.retry:h.retry?.attempts,v=h.retryAttempt||0;g&&v<g||(o.set({error:p.error,data:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await f?.onError?.(p))},async onRequest(p){const h=o.get();o.set({isPending:h.data===null,data:h.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await f?.onRequest?.(p)}}).catch(p=>{o.set({error:p,data:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{d(void 0)})});e=Array.isArray(e)?e:[e];let l=!1;for(const c of e)c.subscribe(async()=>{VV()||(l?await s():rN(o,()=>{const d=setTimeout(async()=>{l||(await s(),l=!0)},0);return()=>{o.off(),c.off(),clearTimeout(d)}}))});return o},Jy=Symbol.for("better-auth:broadcast-channel"),qV=()=>Math.floor(Date.now()/1e3);var HV=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:qV()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function e_(e="better-auth.message"){return globalThis[Jy]||(globalThis[Jy]=new HV(e)),globalThis[Jy]}const t_=Symbol.for("better-auth:focus-manager");var GV=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function $T(){return globalThis[t_]||(globalThis[t_]=new GV),globalThis[t_]}const n_=Symbol.for("better-auth:online-manager");var KV=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function r_(){return globalThis[n_]||(globalThis[n_]=new KV),globalThis[n_]}const sc=()=>Math.floor(Date.now()/1e3),ZV=5;function YV(e){const{sessionAtom:t,sessionSignal:n,$fetch:r,options:o={}}=e,s=o.sessionOptions?.refetchInterval??0,l=o.sessionOptions?.refetchOnWindowFocus??!0,c=o.sessionOptions?.refetchWhenOffline??!1,d={lastSync:0,lastSessionRequest:0,cachedSession:void 0},f=()=>c||r_().isOnline,p=E=>{if(!f())return;if(E?.event==="storage"){d.lastSync=sc(),n.set(!n.get());return}const T=t.get();if(E?.event==="poll"){d.lastSessionRequest=sc(),r("/get-session").then(R=>{R.error?t.set({...T,data:null,error:R.error}):t.set({...T,data:R.data,error:null}),d.lastSync=sc(),n.set(!n.get())}).catch(()=>{});return}if(E?.event==="visibilitychange"){if(sc()-d.lastSessionRequest<ZV)return;d.lastSessionRequest=sc()}(T?.data===null||T?.data===void 0||E?.event==="visibilitychange")&&(d.lastSync=sc(),n.set(!n.get()))},h=E=>{e_().post({event:"session",data:{trigger:E},clientId:Math.random().toString(36).substring(7)})},g=()=>{s&&s>0&&(d.pollInterval=setInterval(()=>{t.get()?.data&&p({event:"poll"})},s*1e3))},v=()=>{d.unsubscribeBroadcast=e_().subscribe(()=>{p({event:"storage"})})},_=()=>{l&&(d.unsubscribeFocus=$T().subscribe(()=>{p({event:"visibilitychange"})}))},b=()=>{d.unsubscribeOnline=r_().subscribe(E=>{E&&p({event:"visibilitychange"})})};return{init:()=>{g(),v(),_(),b(),e_().setup(),$T().setup(),r_().setup()},cleanup:()=>{d.pollInterval&&(clearInterval(d.pollInterval),d.pollInterval=void 0),d.unsubscribeBroadcast&&(d.unsubscribeBroadcast(),d.unsubscribeBroadcast=void 0),d.unsubscribeFocus&&(d.unsubscribeFocus(),d.unsubscribeFocus=void 0),d.unsubscribeOnline&&(d.unsubscribeOnline(),d.unsubscribeOnline=void 0),d.lastSync=0,d.lastSessionRequest=0,d.cachedSession=void 0},triggerRefetch:p,broadcastSessionUpdate:h}}function WV(e,t){const n=Cc(!1),r=Sd(n,"/get-session",e,{method:"GET"});return rN(r,()=>{const o=YV({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return o.init(),()=>{o.cleanup()}}),{session:r,$sessionSignal:n}}function o_(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function qb(e,t,n=".",r){if(!o_(t))return qb(e,{},n,r);const o={...t};for(const s of Object.keys(e)){if(s==="__proto__"||s==="constructor")continue;const l=e[s];l!=null&&(r&&r(o,s,l,n)||(Array.isArray(l)&&Array.isArray(o[s])?o[s]=[...l,...o[s]]:o_(l)&&o_(o[s])?o[s]=qb(l,o[s],(n?`${n}.`:"")+s.toString(),r):o[s]=l))}return o}function QV(e){return(...t)=>t.reduce((n,r)=>qb(n,r,"",e),{})}const XV=QV();var JV=Object.defineProperty,eq=Object.defineProperties,tq=Object.getOwnPropertyDescriptors,jT=Object.getOwnPropertySymbols,nq=Object.prototype.hasOwnProperty,rq=Object.prototype.propertyIsEnumerable,zT=(e,t,n)=>t in e?JV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ti=(e,t)=>{for(var n in t||(t={}))nq.call(t,n)&&zT(e,n,t[n]);if(jT)for(var n of jT(t))rq.call(t,n)&&zT(e,n,t[n]);return e},yi=(e,t)=>eq(e,tq(t)),oq=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},iq=async(e,t)=>{var n,r,o,s,l,c;let d=t||{};const f={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:d,hooks:f};for(const p of t?.plugins||[]){if(p.init){const h=await((n=p.init)==null?void 0:n.call(p,e.toString(),t));d=h.options||d,e=h.url}f.onRequest.push((r=p.hooks)==null?void 0:r.onRequest),f.onResponse.push((o=p.hooks)==null?void 0:o.onResponse),f.onSuccess.push((s=p.hooks)==null?void 0:s.onSuccess),f.onError.push((l=p.hooks)==null?void 0:l.onError),f.onRetry.push((c=p.hooks)==null?void 0:c.onRetry)}return{url:e,options:d,hooks:f}},UT=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},sq=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function aq(e){if(typeof e=="number")return new UT({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new UT(e);case"exponential":return new sq(e);default:throw new Error("Invalid retry strategy")}}var lq=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,o]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!o)return t;t.authorization=`Basic ${btoa(`${r}:${o}`)}`}else if(e.auth.type==="Custom"){const[r,o]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!o)return t;t.authorization=`${r??""} ${o}`}}return t},cq=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function uq(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return cq.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function dq(e){try{return JSON.parse(e),!0}catch{return!1}}function Hb(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function FT(e){try{return JSON.parse(e)}catch{return e}}function BT(e){return typeof e=="function"}function fq(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&BT(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&BT(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function hq(e){const t=new Headers(e?.headers),n=await lq(e);for(const[r,o]of Object.entries(n||{}))t.set(r,o);if(!t.has("content-type")){const r=pq(e?.body);r&&t.set("content-type",r)}return t}function pq(e){return Hb(e)?"application/json":null}function mq(e){if(!e?.body)return null;const t=new Headers(e?.headers);if(Hb(e.body)&&!t.has("content-type")){for(const[n,r]of Object.entries(e?.body))r instanceof Date&&(e.body[n]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&t.get("content-type")==="application/x-www-form-urlencoded"&&Hb(e.body)?new URLSearchParams(e.body).toString():e.body}function gq(e,t){var n;if(t?.method)return t.method.toUpperCase();if(e.startsWith("@")){const r=(n=e.split("@")[1])==null?void 0:n.split("/")[0];return iN.includes(r)?r.toUpperCase():t?.body?"POST":"GET"}return t?.body?"POST":"GET"}function vq(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var yq=class oN extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,oN.prototype)}};async function _m(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new yq(n.issues);return n.value}var iN=["get","post","put","patch","delete"],_q=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r,o,s,l;const c=((o=(r=e.plugins)==null?void 0:r.find(d=>{var f;return(f=d.schema)!=null&&f.config?t.startsWith(d.schema.config.baseURL||"")||t.startsWith(d.schema.config.prefix||""):!1}))==null?void 0:o.schema)||e.schema;if(c){let d=t;(s=c.config)!=null&&s.prefix&&d.startsWith(c.config.prefix)&&(d=d.replace(c.config.prefix,""),c.config.baseURL&&(t=t.replace(c.config.prefix,c.config.baseURL))),(l=c.config)!=null&&l.baseURL&&d.startsWith(c.config.baseURL)&&(d=d.replace(c.config.baseURL,""));const f=c.schema[d];if(f){let p=yi(ti({},n),{method:f.method,output:f.output});return n?.disableValidation||(p=yi(ti({},p),{body:f.input?await _m(f.input,n?.body):n?.body,params:f.params?await _m(f.params,n?.params):n?.params,query:f.query?await _m(f.query,n?.query):n?.query})),{url:t,options:p}}}return{url:t,options:n}}}),bq=e=>{async function t(n,r){const o=yi(ti(ti({},e),r),{plugins:[...e?.plugins||[],_q(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await Gb(n,o)}catch(s){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:s}}}return await Gb(n,o)}return t};function wq(e,t){const{baseURL:n,params:r,query:o}=t||{query:{},params:{},baseURL:""};let s=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){const h=e.toString().split("@")[1].split("/")[0];iN.includes(h)&&(e=e.replace(`@${h}/`,"/"))}s.endsWith("/")||(s+="/");let[l,c]=e.replace(s,"").split("?");const d=new URLSearchParams(c);for(const[h,g]of Object.entries(o||{})){if(g==null)continue;let v;if(typeof g=="string")v=g;else if(Array.isArray(g)){for(const _ of g)d.append(h,_);continue}else v=JSON.stringify(g);d.set(h,v)}if(r)if(Array.isArray(r)){const h=l.split("/").filter(g=>g.startsWith(":"));for(const[g,v]of h.entries()){const _=r[g];l=l.replace(v,_)}}else for(const[h,g]of Object.entries(r))l=l.replace(`:${h}`,String(g));l=l.split("/").map(encodeURIComponent).join("/"),l.startsWith("/")&&(l=l.slice(1));let f=d.toString();return f=f.length>0?`?${f}`.replace(/\+/g,"%20"):"",s.startsWith("http")?new URL(`${l}${f}`,s):`${s}${l}${f}`}var Gb=async(e,t)=>{var n,r,o,s,l,c,d,f;const{hooks:p,url:h,options:g}=await iq(e,t),v=fq(g),_=new AbortController,b=(n=g.signal)!=null?n:_.signal,x=wq(h,g),S=mq(g),E=await hq(g),T=gq(h,g);let R=yi(ti({},g),{url:x,headers:E,body:S,method:T,signal:b});for(const F of p.onRequest)if(F){const Z=await F(R);typeof Z=="object"&&Z!==null&&(R=Z)}("pipeTo"in R&&typeof R.pipeTo=="function"||typeof((r=t?.body)==null?void 0:r.pipe)=="function")&&("duplex"in R||(R.duplex="half"));const{clearTimeout:O}=vq(g,_);let A=await v(R.url,R);O();const I={response:A,request:R};for(const F of p.onResponse)if(F){const Z=await F(yi(ti({},I),{response:(o=t?.hookOptions)!=null&&o.cloneResponse?A.clone():A}));Z instanceof Response?A=Z:typeof Z=="object"&&Z!==null&&(A=Z.response)}if(A.ok){if(!(R.method!=="HEAD"))return{data:"",error:null};const Z=uq(A),ie={data:null,response:A,request:R};if(Z==="json"||Z==="text"){const H=await A.text(),W=(s=R.jsonParser)!=null?s:FT;ie.data=await W(H)}else ie.data=await A[Z]();R?.output&&R.output&&!R.disableValidation&&(ie.data=await _m(R.output,ie.data));for(const H of p.onSuccess)H&&await H(yi(ti({},ie),{response:(l=t?.hookOptions)!=null&&l.cloneResponse?A.clone():A}));return t?.throw?ie.data:{data:ie.data,error:null}}const M=(c=t?.jsonParser)!=null?c:FT,L=await A.text(),q=dq(L),j=q?await M(L):null,B={response:A,responseText:L,request:R,error:yi(ti({},j),{status:A.status,statusText:A.statusText})};for(const F of p.onError)F&&await F(yi(ti({},B),{response:(d=t?.hookOptions)!=null&&d.cloneResponse?A.clone():A}));if(t?.retry){const F=aq(t.retry),Z=(f=t.retryAttempt)!=null?f:0;if(await F.shouldAttemptRetry(Z,A)){for(const H of p.onRetry)H&&await H(I);const ie=F.getDelay(Z);return await new Promise(H=>setTimeout(H,ie)),await Gb(e,yi(ti({},t),{retryAttempt:Z+1}))}}if(t?.throw)throw new oq(A.status,A.statusText,q?j:L);return{data:null,error:yi(ti({},j),{status:A.status,statusText:A.statusText})}};const Sq=(e,t)=>{const n="credentials"in Request.prototype,r=AV(e?.baseURL,e?.basePath)??"/api/auth",o=e?.plugins?.flatMap(R=>R.fetchPlugins).filter(R=>R!==void 0)||[],s={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:l,onError:c,onRequest:d,onResponse:f,...p}=e?.fetchOptions||{},h=bq({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(R){return R?$V(R,{strict:!1}):null},customFetchImpl:fetch,...p,plugins:[s,...p.plugins||[],...e?.disableDefaultFetchPlugins?[]:[IV],...o]}),{$sessionSignal:g,session:v}=WV(h,e),_=e?.plugins||[];let b={};const x={$sessionSignal:g,session:v},S={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},E=[{signal:"$sessionSignal",matcher(R){return R==="/sign-out"||R==="/update-user"||R==="/sign-up/email"||R==="/sign-in/email"||R==="/delete-user"||R==="/verify-email"||R==="/revoke-sessions"||R==="/revoke-session"||R==="/change-email"}}];for(const R of _)R.getAtoms&&Object.assign(x,R.getAtoms?.(h)),R.pathMethods&&Object.assign(S,R.pathMethods),R.atomListeners&&E.push(...R.atomListeners);const T={notify:R=>{x[R].set(!x[R].get())},listen:(R,O)=>{x[R].subscribe(O)},atoms:x};for(const R of _)R.getActions&&(b=XV(R.getActions?.(h,T,e)??{},b));return{get baseURL(){return r},pluginsActions:b,pluginsAtoms:x,pluginPathMethods:S,atomListeners:E,$fetch:h,$store:T}};function Eq(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function xq(e,t,n){const r=t[e],{fetchOptions:o,query:s,...l}=n||{};return r||(o?.method?o.method:l&&Object.keys(l).length>0?"POST":"GET")}function Rq(e,t,n,r,o){function s(l=[]){return new Proxy(function(){},{get(c,d){if(typeof d!="string"||d==="then"||d==="catch"||d==="finally")return;const f=[...l,d];let p=e;for(const h of f)if(p&&typeof p=="object"&&h in p)p=p[h];else{p=void 0;break}return typeof p=="function"||Eq(p)?p:s(f)},apply:async(c,d,f)=>{const p="/"+l.map(E=>E.replace(/[A-Z]/g,T=>`-${T.toLowerCase()}`)).join("/"),h=f[0]||{},g=f[1]||{},{query:v,fetchOptions:_,...b}=h,x={...g,..._},S=xq(p,n,h);return await t(p,{...x,body:S==="GET"?void 0:{...b,...x?.body||{}},query:v||x?.query,method:S,async onSuccess(E){if(await x?.onSuccess?.(E),!o||x.disableSignal)return;const T=o.filter(O=>O.matcher(p));if(!T.length)return;const R=new Set;for(const O of T){const A=r[O.signal];if(!A)return;if(R.has(O.signal))continue;R.add(O.signal);const I=A.get();setTimeout(()=>{A.set(!I)},10)}}})}})}return s()}function Oq(e,t={}){const n=P.useRef(e.get()),{keys:r,deps:o=[e,r]}=t,s=P.useCallback(c=>{const d=f=>{n.current!==f&&(n.current=f,c())};return d(e.value),r?.length?BV(e,r,d):e.listen(d)},o),l=()=>n.current;return P.useSyncExternalStore(s,l,l)}function Tq(e){return`use${OV(e)}`}function Cq(e){const{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:o,$store:s,atomListeners:l}=Sq(e),c={};for(const[d,f]of Object.entries(r))c[Tq(d)]=()=>Oq(f);return Rq({...n,...c,$fetch:o,$store:s},o,t,r,l)}function Aq(e){return{authorize(t,n="AND"){let r=!1;for(const[o,s]of Object.entries(t)){const l=e[o];if(!l)return{success:!1,error:`You are not allowed to access resource: ${o}`};if(Array.isArray(s))r=s.every(c=>l.includes(c));else if(typeof s=="object"){const c=s;c.connector==="OR"?r=c.actions.some(d=>l.includes(d)):r=c.actions.every(d=>l.includes(d))}else throw new kd("Invalid access control request");if(r&&n==="OR")return{success:r};if(!r&&n==="AND")return{success:!1,error:`unauthorized to access resource "${o}"`}}return r?{success:r}:{success:!1,error:"Not authorized"}},statements:e}}function sN(e){return{newRole(t){return Aq(t)},statements:e}}const Iq={user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]},aN=sN(Iq),lN=aN.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),cN=aN.newRole({user:[],session:[]}),Pq={admin:lN,user:cN},Mq=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions&&!e.permission)return!1;const t=(e.role||e.options?.defaultRole||"user").split(","),n=e.options?.roles||Pq;for(const r of t)if(n[r]?.authorize(e.permission??e.permissions)?.success)return!0;return!1},Nq=e=>{const t={admin:lN,user:cN,...e?.roles};return{id:"admin-client",$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>Mq({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions??n.permission})}}),pathMethods:{"/admin/list-users":"GET","/admin/stop-impersonating":"POST"}}},kq=()=>({id:"email-otp",$InferServerPlugin:{},atomListeners:[{matcher:e=>e==="/email-otp/verify-email"||e==="/sign-in/email-otp",signal:"$sessionSignal"}]}),Dq=()=>({id:"magic-link",$InferServerPlugin:{}}),Lq={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]},Zw=sN(Lq),uN=Zw.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),dN=Zw.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),fN=Zw.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),$q={admin:uN,owner:dN,member:fN},jq=(e,t)=>{if(!e.permissions&&!e.permission)return!1;const n=e.role.split(","),r=e.options.creatorRole||"owner",o=n.includes(r),s=e.allowCreatorAllPermissions||!1;if(o&&s)return!0;for(const l of n)if(t[l]?.authorize(e.permissions??e.permission)?.success)return!0;return!1},zq=e=>jq(e,e.options.roles||$q),Uq=e=>{const t=Cc(!1),n=Cc(!1),r=Cc(!1),o=Cc(!1),s={admin:uN,member:fN,owner:dN,...e?.roles};return{id:"organization",$InferServerPlugin:{},getActions:(l,c,d)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:f=>zq({role:f.role,options:{ac:e?.ac,roles:s},permissions:f.permissions??f.permission})}}),getAtoms:l=>{const c=Sd(t,"/organization/list",l,{method:"GET"});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:o,activeOrganization:Sd([n],"/organization/get-full-organization",l,()=>({method:"GET"})),listOrganizations:c,activeMember:Sd([r],"/organization/get-active-member",l,{method:"GET"}),activeMemberRole:Sd([o],"/organization/get-active-member-role",l,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher(l){return l==="/organization/create"||l==="/organization/delete"||l==="/organization/update"},signal:"$listOrg"},{matcher(l){return l.startsWith("/organization")},signal:"$activeOrgSignal"},{matcher(l){return l.startsWith("/organization/set-active")},signal:"$sessionSignal"},{matcher(l){return l.includes("/organization/update-member-role")},signal:"$activeMemberSignal"},{matcher(l){return l.includes("/organization/update-member-role")},signal:"$activeMemberRoleSignal"}]}},Fq=e=>({id:"sso-client",$InferServerPlugin:{}});function hN(e){const t=e?.metadata;if(!t)return!1;try{return(typeof t=="string"?JSON.parse(t):t).archived===!0}catch{return!1}}const Vg=Cq({plugins:[Uq({}),Nq(),Fq(),Dq(),kq()]}),Bq=3e4;let Ed=null,op=null;function pN(){if(Ed&&Ed.expiresAt>Date.now())return Promise.resolve(Ed.result);if(op)return op;const e=Vg.organization.list().then(t=>{const n=t.data?{...t,data:t.data.filter(r=>!hN(r))}:t;return n.data&&(Ed={result:n,expiresAt:Date.now()+Bq}),n}).finally(()=>{op=null});return op=e,e}function Uce(){const e=Vg.useListOrganizations(),t=e.data?.filter(n=>!hN(n));return{...e,data:t}}function Fce(){Ed=null}function mN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=mN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yw(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=mN(e))&&(r&&(r+=" "),r+=t);return r}const Vq=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},qq=(e,t)=>({classGroupId:e,validator:t}),gN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vm="-",VT=[],Hq="arbitrary..",Gq=e=>{const t=Zq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Kq(l);const c=l.split(Vm),d=c[0]===""&&c.length>1?1:0;return vN(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?Vq(f,d):d:f||VT}return n[l]||VT}}},vN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=vN(e,t+1,s);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(Vm):e.slice(t).join(Vm),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(c))return p.classGroupId}},Kq=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Hq+r:void 0})(),Zq=e=>{const{theme:t,classGroups:n}=e;return Yq(n,t)},Yq=(e,t)=>{const n=gN();for(const r in e){const o=e[r];Ww(o,n,r,t)}return n},Ww=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const l=e[s];Wq(l,t,n,r)}},Wq=(e,t,n,r)=>{if(typeof e=="string"){Qq(e,t,n);return}if(typeof e=="function"){Xq(e,t,n,r);return}Jq(e,t,n,r)},Qq=(e,t,n)=>{const r=e===""?t:yN(t,e);r.classGroupId=n},Xq=(e,t,n,r)=>{if(eH(e)){Ww(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(qq(n,e))},Jq=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let l=0;l<s;l++){const[c,d]=o[l];Ww(d,yN(t,c),n,r)}},yN=(e,t)=>{let n=e;const r=t.split(Vm),o=r.length;for(let s=0;s<o;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=gN(),n.nextPart.set(l,c)),n=c}return n},eH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,tH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},Kb="!",qT=":",nH=[],HT=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),rH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let l=0,c=0,d=0,f;const p=o.length;for(let b=0;b<p;b++){const x=o[b];if(l===0&&c===0){if(x===qT){s.push(o.slice(d,b)),d=b+1;continue}if(x==="/"){f=b;continue}}x==="["?l++:x==="]"?l--:x==="("?c++:x===")"&&c--}const h=s.length===0?o:o.slice(d);let g=h,v=!1;h.endsWith(Kb)?(g=h.slice(0,-1),v=!0):h.startsWith(Kb)&&(g=h.slice(1),v=!0);const _=f&&f>d?f-d:void 0;return HT(s,v,g,_)};if(t){const o=t+qT,s=r;r=l=>l.startsWith(o)?s(l.slice(o.length)):HT(nH,!1,l,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},oH=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",d=t.has(l);c||d?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(l)):o.push(l)}return o.length>0&&(o.sort(),r.push(...o)),r}},iH=e=>({cache:tH(e.cacheSize),parseClassName:rH(e),sortModifiers:oH(e),postfixLookupClassGroupIds:sH(e),...Gq(e)}),sH=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},aH=/\s+/,lH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:l}=t,c=[],d=e.trim().split(aH);let f="";for(let p=d.length-1;p>=0;p-=1){const h=d[p],{isExternal:g,modifiers:v,hasImportantModifier:_,baseClassName:b,maybePostfixModifierPosition:x}=n(h);if(g){f=h+(f.length>0?" "+f:f);continue}let S=!!x,E;if(S){const I=b.substring(0,x);E=r(I);const M=E&&l[E]?r(b):void 0;M&&M!==E&&(E=M,S=!1)}else E=r(b);if(!E){if(!S){f=h+(f.length>0?" "+f:f);continue}if(E=r(b),!E){f=h+(f.length>0?" "+f:f);continue}S=!1}const T=v.length===0?"":v.length===1?v[0]:s(v).join(":"),R=_?T+Kb:T,O=R+E;if(c.indexOf(O)>-1)continue;c.push(O);const A=o(E,S);for(let I=0;I<A.length;++I){const M=A[I];c.push(R+M)}f=h+(f.length>0?" "+f:f)}return f},cH=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=_N(n))&&(o&&(o+=" "),o+=r);return o},_N=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_N(e[r]))&&(n&&(n+=" "),n+=t);return n},uH=(e,...t)=>{let n,r,o,s;const l=d=>{const f=t.reduce((p,h)=>h(p),e());return n=iH(f),r=n.cache.get,o=n.cache.set,s=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=lH(d,n);return o(d,p),p};return s=l,(...d)=>s(cH(...d))},dH=[],Kn=e=>{const t=n=>n[e]||dH;return t.isThemeGetter=!0,t},bN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pH=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>fH.test(e),gt=e=>!!e&&!Number.isNaN(Number(e)),pi=e=>!!e&&Number.isInteger(Number(e)),i_=e=>e.endsWith("%")&>(e.slice(0,-1)),Xi=e=>hH.test(e),SN=()=>!0,yH=e=>pH.test(e)&&!mH.test(e),Qw=()=>!1,_H=e=>gH.test(e),bH=e=>vH.test(e),wH=e=>!Ve(e)&&!qe(e),SH=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),EH=e=>_a(e,RN,Qw),Ve=e=>bN.test(e),Ua=e=>_a(e,ON,yH),GT=e=>_a(e,PH,gt),xH=e=>_a(e,CN,SN),RH=e=>_a(e,TN,Qw),KT=e=>_a(e,EN,Qw),OH=e=>_a(e,xN,bH),ip=e=>_a(e,AN,_H),qe=e=>wN.test(e),od=e=>ml(e,ON),TH=e=>ml(e,TN),ZT=e=>ml(e,EN),CH=e=>ml(e,RN),AH=e=>ml(e,xN),sp=e=>ml(e,AN,!0),IH=e=>ml(e,CN,!0),_a=(e,t,n)=>{const r=bN.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ml=(e,t,n=!1)=>{const r=wN.exec(e);return r?r[1]?t(r[1]):n:!1},EN=e=>e==="position"||e==="percentage",xN=e=>e==="image"||e==="url",RN=e=>e==="length"||e==="size"||e==="bg-size",ON=e=>e==="length",PH=e=>e==="number",TN=e=>e==="family-name",CN=e=>e==="number"||e==="weight",AN=e=>e==="shadow",MH=()=>{const e=Kn("color"),t=Kn("font"),n=Kn("text"),r=Kn("font-weight"),o=Kn("tracking"),s=Kn("leading"),l=Kn("breakpoint"),c=Kn("container"),d=Kn("spacing"),f=Kn("radius"),p=Kn("shadow"),h=Kn("inset-shadow"),g=Kn("text-shadow"),v=Kn("drop-shadow"),_=Kn("blur"),b=Kn("perspective"),x=Kn("aspect"),S=Kn("ease"),E=Kn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...R(),qe,Ve],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],M=()=>[qe,Ve,d],L=()=>[qs,"full","auto",...M()],q=()=>[pi,"none","subgrid",qe,Ve],j=()=>["auto",{span:["full",pi,qe,Ve]},pi,qe,Ve],B=()=>[pi,"auto",qe,Ve],F=()=>["auto","min","max","fr",qe,Ve],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...M()],W=()=>[qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],te=()=>[qs,"screen","full","dvw","lvw","svw","min","max","fit",...M()],le=()=>[qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],Q=()=>[e,qe,Ve],k=()=>[...R(),ZT,KT,{position:[qe,Ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",CH,EH,{size:[qe,Ve]}],D=()=>[i_,od,Ua],U=()=>["","none","full",f,qe,Ve],X=()=>["",gt,od,Ua],fe=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[gt,i_,ZT,KT],je=()=>["","none",_,qe,Ve],Y=()=>["none",gt,qe,Ve],re=()=>["none",gt,qe,Ve],ve=()=>[gt,qe,Ve],se=()=>[qs,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xi],breakpoint:[Xi],color:[SN],container:[Xi],"drop-shadow":[Xi],ease:["in","out","in-out"],font:[wH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xi],shadow:[Xi],spacing:["px",gt],text:[Xi],"text-shadow":[Xi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qs,Ve,qe,x]}],container:["container"],"container-type":[{"@container":["","normal","size",qe,Ve]}],"container-named":[SH],columns:[{columns:[gt,Ve,qe,c]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[pi,"auto",qe,Ve]}],basis:[{basis:[qs,"full","auto",c,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gt,qs,"auto","initial","none",Ve]}],grow:[{grow:["",gt,qe,Ve]}],shrink:[{shrink:["",gt,qe,Ve]}],order:[{order:[pi,"first","last","none",qe,Ve]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...le()]}],"min-block-size":[{"min-block":["auto",...le()]}],"max-block-size":[{"max-block":["none",...le()]}],w:[{w:[c,"screen",...W()]}],"min-w":[{"min-w":[c,"screen","none",...W()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,od,Ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,IH,xH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",i_,Ve]}],"font-family":[{font:[TH,RH,t]}],"font-features":[{"font-features":[Ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,qe,Ve]}],"line-clamp":[{"line-clamp":[gt,"none",qe,GT]}],leading:[{leading:[s,...M()]}],"list-image":[{"list-image":["none",qe,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Q()}],"text-color":[{text:Q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[gt,"from-font","auto",qe,Ua]}],"text-decoration-color":[{decoration:Q()}],"underline-offset":[{"underline-offset":[gt,"auto",qe,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[pi,qe,Ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pi,qe,Ve],radial:["",qe,Ve],conic:[pi,qe,Ve]},AH,OH]}],"bg-color":[{bg:Q()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:Q()}],"gradient-via":[{via:Q()}],"gradient-to":[{to:Q()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:Q()}],"border-color-x":[{"border-x":Q()}],"border-color-y":[{"border-y":Q()}],"border-color-s":[{"border-s":Q()}],"border-color-e":[{"border-e":Q()}],"border-color-bs":[{"border-bs":Q()}],"border-color-be":[{"border-be":Q()}],"border-color-t":[{"border-t":Q()}],"border-color-r":[{"border-r":Q()}],"border-color-b":[{"border-b":Q()}],"border-color-l":[{"border-l":Q()}],"divide-color":[{divide:Q()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gt,qe,Ve]}],"outline-w":[{outline:["",gt,od,Ua]}],"outline-color":[{outline:Q()}],shadow:[{shadow:["","none",p,sp,ip]}],"shadow-color":[{shadow:Q()}],"inset-shadow":[{"inset-shadow":["none",h,sp,ip]}],"inset-shadow-color":[{"inset-shadow":Q()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Q()}],"ring-offset-w":[{"ring-offset":[gt,Ua]}],"ring-offset-color":[{"ring-offset":Q()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":Q()}],"text-shadow":[{"text-shadow":["none",g,sp,ip]}],"text-shadow-color":[{"text-shadow":Q()}],opacity:[{opacity:[gt,qe,Ve]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[gt]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":Q()}],"mask-image-linear-to-color":[{"mask-linear-to":Q()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":Q()}],"mask-image-t-to-color":[{"mask-t-to":Q()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":Q()}],"mask-image-r-to-color":[{"mask-r-to":Q()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":Q()}],"mask-image-b-to-color":[{"mask-b-to":Q()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":Q()}],"mask-image-l-to-color":[{"mask-l-to":Q()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":Q()}],"mask-image-x-to-color":[{"mask-x-to":Q()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":Q()}],"mask-image-y-to-color":[{"mask-y-to":Q()}],"mask-image-radial":[{"mask-radial":[qe,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":Q()}],"mask-image-radial-to-color":[{"mask-radial-to":Q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[gt]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":Q()}],"mask-image-conic-to-color":[{"mask-conic-to":Q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,Ve]}],filter:[{filter:["","none",qe,Ve]}],blur:[{blur:je()}],brightness:[{brightness:[gt,qe,Ve]}],contrast:[{contrast:[gt,qe,Ve]}],"drop-shadow":[{"drop-shadow":["","none",v,sp,ip]}],"drop-shadow-color":[{"drop-shadow":Q()}],grayscale:[{grayscale:["",gt,qe,Ve]}],"hue-rotate":[{"hue-rotate":[gt,qe,Ve]}],invert:[{invert:["",gt,qe,Ve]}],saturate:[{saturate:[gt,qe,Ve]}],sepia:[{sepia:["",gt,qe,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,Ve]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[gt,qe,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[gt,qe,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gt,qe,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gt,qe,Ve]}],"backdrop-invert":[{"backdrop-invert":["",gt,qe,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[gt,qe,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[gt,qe,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",gt,qe,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gt,"initial",qe,Ve]}],ease:[{ease:["linear","initial",S,qe,Ve]}],delay:[{delay:[gt,qe,Ve]}],animate:[{animate:["none",E,qe,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,qe,Ve]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[qe,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],zoom:[{zoom:[pi,qe,Ve]}],accent:[{accent:Q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe,Ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Q()}],"scrollbar-track-color":[{"scrollbar-track":Q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe,Ve]}],fill:[{fill:["none",...Q()]}],"stroke-w":[{stroke:[gt,od,Ua,GT]}],stroke:[{stroke:["none",...Q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},IN=uH(MH);function Ce(...e){return IN(Yw(e))}function NH(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function kn({error:e,localization:t,localizeErrors:n=!0}){var r;const o="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:o;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const s=e.error.code;if(t?.[s])return t[s]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||o}function gl(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}function Zb(e,t){for(const n in e)if(e[n]===t)return n}function Wd(e,t){let n=$().min(1,{message:t?.PASSWORD_REQUIRED});return e?.minLength&&(n=n.min(e.minLength,{message:t?.PASSWORD_TOO_SHORT})),e?.maxLength&&(n=n.max(e.maxLength,{message:t?.PASSWORD_TOO_LONG})),e?.regex&&(n=n.regex(e.regex,{message:t?.INVALID_PASSWORD})),n}var kH={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},DH={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},LH={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},$H={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},jH={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},zH={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},UH={...jH,...zH},FH={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},BH={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},VH={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},qH={INVALID_SESSION_TOKEN:"Invalid session token"},HH={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},GH={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},KH={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},ZH={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},YH={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},WH={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},QH={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},XH={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...$H,...kH,...DH,...LH,...UH,...FH,...BH,...VH,...qH,...HH,...GH,...KH,...ZH,...YH,...WH,...QH},JH={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},YT={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},WT={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};function eG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const tG=e=>{switch(e){case"success":return oG;case"info":return sG;case"warning":return iG;case"error":return aG;default:return null}},nG=Array(12).fill(0),rG=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},nG.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),oG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),iG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),sG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),aG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),lG=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),cG=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Yb=1;class uG{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Yb++,l=this.toasts.find(d=>d.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),l?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...t,id:s,title:r}),{...d,...t,id:s,dismissible:c,title:r}):d):this.addToast({title:r,...o,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,l;const c=o.then(async f=>{if(l=["resolve",f],ee.isValidElement(f))s=!1,this.create({id:r,type:"default",message:f});else if(fG(f)&&!f.ok){s=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,..._})}else if(f instanceof Error){s=!1;const h=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,..._})}else if(n.success!==void 0){s=!1;const h=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:g,..._})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){s=!1;const p=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,v=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,p)=>c.then(()=>l[0]==="reject"?p(l[1]):f(l[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||Yb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Wr=new uG,dG=(e,t)=>{const n=t?.id||Yb++;return Wr.addToast({title:e,...t,id:n}),n},fG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",hG=dG,pG=()=>Wr.toasts,mG=()=>Wr.getActiveToasts(),QT=Object.assign(hG,{success:Wr.success,info:Wr.info,warning:Wr.warning,error:Wr.error,custom:Wr.custom,message:Wr.message,promise:Wr.promise,dismiss:Wr.dismiss,loading:Wr.loading},{getHistory:pG,getToasts:mG});eG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ap(e){return e.label!==void 0}const gG=3,vG="24px",yG="16px",XT=4e3,_G=356,bG=14,wG=45,SG=200;function mi(...e){return e.filter(Boolean).join(" ")}function EG(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const xG=e=>{var t,n,r,o,s,l,c,d,f;const{invert:p,toast:h,unstyled:g,interacting:v,setHeights:_,visibleToasts:b,heights:x,index:S,toasts:E,expanded:T,removeToast:R,defaultRichColors:O,closeButton:A,style:I,cancelButtonStyle:M,actionButtonStyle:L,className:q="",descriptionClassName:j="",duration:B,position:F,gap:Z,expandByDefault:ie,classNames:H,icons:W,closeButtonAriaLabel:te="Close toast"}=e,[le,Q]=ee.useState(null),[k,G]=ee.useState(null),[V,D]=ee.useState(!1),[U,X]=ee.useState(!1),[fe,pe]=ee.useState(!1),[xe,je]=ee.useState(!1),[Y,re]=ee.useState(!1),[ve,se]=ee.useState(0),[Se,Te]=ee.useState(0),tt=ee.useRef(h.duration||B||XT),rt=ee.useRef(null),Be=ee.useRef(null),Qe=S===0,Me=S+1<=b,Pe=h.type,Ue=h.dismissible!==!1,K=h.className||"",ne=h.descriptionClassName||"",ae=ee.useMemo(()=>x.findIndex(Ke=>Ke.toastId===h.id)||0,[x,h.id]),Oe=ee.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:A},[h.closeButton,A]),Ae=ee.useMemo(()=>h.duration||B||XT,[h.duration,B]),Ie=ee.useRef(0),ke=ee.useRef(0),Je=ee.useRef(0),et=ee.useRef(null),[_t,Tt]=F.split("-"),bt=ee.useMemo(()=>x.reduce((Ke,ut,Jt)=>Jt>=ae?Ke:Ke+ut.height,0),[x,ae]),Ln=cG(),Ni=h.invert||p,Ho=Pe==="loading";ke.current=ee.useMemo(()=>ae*Z+bt,[ae,bt]),ee.useEffect(()=>{tt.current=Ae},[Ae]),ee.useEffect(()=>{D(!0)},[]),ee.useEffect(()=>{const Ke=Be.current;if(Ke){const ut=Ke.getBoundingClientRect().height;return Te(ut),_(Jt=>[{toastId:h.id,height:ut,position:h.position},...Jt]),()=>_(Jt=>Jt.filter(Zt=>Zt.toastId!==h.id))}},[_,h.id]),ee.useLayoutEffect(()=>{if(!V)return;const Ke=Be.current,ut=Ke.style.height;Ke.style.height="auto";const Jt=Ke.getBoundingClientRect().height;Ke.style.height=ut,Te(Jt),_(Zt=>Zt.find(Lt=>Lt.toastId===h.id)?Zt.map(Lt=>Lt.toastId===h.id?{...Lt,height:Jt}:Lt):[{toastId:h.id,height:Jt,position:h.position},...Zt])},[V,h.title,h.description,_,h.id,h.jsx,h.action,h.cancel]);const Ye=ee.useCallback(()=>{X(!0),se(ke.current),_(Ke=>Ke.filter(ut=>ut.toastId!==h.id)),setTimeout(()=>{R(h)},SG)},[h,R,_,ke]);ee.useEffect(()=>{if(h.promise&&Pe==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return T||v||Ln?(()=>{if(Je.current<Ie.current){const Zt=new Date().getTime()-Ie.current;tt.current=tt.current-Zt}Je.current=new Date().getTime()})():tt.current!==1/0&&(Ie.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Ye()},tt.current)),()=>clearTimeout(Ke)},[T,v,h,Pe,Ln,Ye]),ee.useEffect(()=>{h.delete&&(Ye(),h.onDismiss==null||h.onDismiss.call(h,h))},[Ye,h.delete]);function pt(){var Ke;if(W?.loading){var ut;return ee.createElement("div",{className:mi(H?.loader,h==null||(ut=h.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Pe==="loading"},W.loading)}return ee.createElement(rG,{className:mi(H?.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Pe==="loading"})}const Ct=h.icon||W?.[Pe]||tG(Pe);var it,Dt;return ee.createElement("li",{tabIndex:0,ref:Be,className:mi(q,K,H?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,H?.default,H?.[Pe],h==null||(n=h.classNames)==null?void 0:n[Pe]),"data-sonner-toast":"","data-rich-colors":(it=h.richColors)!=null?it:O,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":V,"data-promise":!!h.promise,"data-swiped":Y,"data-removed":U,"data-visible":Me,"data-y-position":_t,"data-x-position":Tt,"data-index":S,"data-front":Qe,"data-swiping":fe,"data-dismissible":Ue,"data-type":Pe,"data-invert":Ni,"data-swipe-out":xe,"data-swipe-direction":k,"data-expanded":!!(T||ie&&V),"data-testid":h.testId,style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${U?ve:ke.current}px`,"--initial-height":ie?"auto":`${Se}px`,...I,...h.style},onDragEnd:()=>{pe(!1),Q(null),et.current=null},onPointerDown:Ke=>{Ke.button!==2&&(Ho||!Ue||(rt.current=new Date,se(ke.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(pe(!0),et.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,ut,Jt;if(xe||!Ue)return;et.current=null;const Zt=Number(((Ke=Be.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Sr=Number(((ut=Be.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Lt=new Date().getTime()-((Jt=rt.current)==null?void 0:Jt.getTime()),ln=le==="x"?Zt:Sr,So=Math.abs(ln)/Lt;if(Math.abs(ln)>=wG||So>.11){se(ke.current),h.onDismiss==null||h.onDismiss.call(h,h),G(le==="x"?Zt>0?"right":"left":Sr>0?"down":"up"),Ye(),je(!0);return}else{var sr,zr;(sr=Be.current)==null||sr.style.setProperty("--swipe-amount-x","0px"),(zr=Be.current)==null||zr.style.setProperty("--swipe-amount-y","0px")}re(!1),pe(!1),Q(null)},onPointerMove:Ke=>{var ut,Jt,Zt;if(!et.current||!Ue||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const Lt=Ke.clientY-et.current.y,ln=Ke.clientX-et.current.x;var So;const sr=(So=e.swipeDirections)!=null?So:EG(F);!le&&(Math.abs(ln)>1||Math.abs(Lt)>1)&&Q(Math.abs(ln)>Math.abs(Lt)?"x":"y");let zr={x:0,y:0};const bl=Go=>1/(1.5+Math.abs(Go)/20);if(le==="y"){if(sr.includes("top")||sr.includes("bottom"))if(sr.includes("top")&&Lt<0||sr.includes("bottom")&&Lt>0)zr.y=Lt;else{const Go=Lt*bl(Lt);zr.y=Math.abs(Go)<Math.abs(Lt)?Go:Lt}}else if(le==="x"&&(sr.includes("left")||sr.includes("right")))if(sr.includes("left")&&ln<0||sr.includes("right")&&ln>0)zr.x=ln;else{const Go=ln*bl(ln);zr.x=Math.abs(Go)<Math.abs(ln)?Go:ln}(Math.abs(zr.x)>0||Math.abs(zr.y)>0)&&re(!0),(Jt=Be.current)==null||Jt.style.setProperty("--swipe-amount-x",`${zr.x}px`),(Zt=Be.current)==null||Zt.style.setProperty("--swipe-amount-y",`${zr.y}px`)}},Oe&&!h.jsx&&Pe!=="loading"?ee.createElement("button",{"aria-label":te,"data-disabled":Ho,"data-close-button":!0,onClick:Ho||!Ue?()=>{}:()=>{Ye(),h.onDismiss==null||h.onDismiss.call(h,h)},className:mi(H?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Dt=W?.close)!=null?Dt:lG):null,(Pe||h.icon||h.promise)&&h.icon!==null&&(W?.[Pe]!==null||h.icon)?ee.createElement("div",{"data-icon":"",className:mi(H?.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||pt():null,h.type!=="loading"?Ct:null):null,ee.createElement("div",{"data-content":"",className:mi(H?.content,h==null||(s=h.classNames)==null?void 0:s.content)},ee.createElement("div",{"data-title":"",className:mi(H?.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ee.createElement("div",{"data-description":"",className:mi(j,ne,H?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),ee.isValidElement(h.cancel)?h.cancel:h.cancel&&ap(h.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:Ke=>{ap(h.cancel)&&Ue&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),Ye())},className:mi(H?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,ee.isValidElement(h.action)?h.action:h.action&&ap(h.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Ke=>{ap(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&Ye())},className:mi(H?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function JT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function RG(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,l=s?"--mobile-offset":"--offset",c=s?yG:vG;function d(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=c:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const OG=ee.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:p,mobileOffset:h,theme:g="light",richColors:v,duration:_,style:b,visibleToasts:x=gG,toastOptions:S,dir:E=JT(),gap:T=bG,icons:R,containerAriaLabel:O="Notifications"}=t,[A,I]=ee.useState([]),M=ee.useMemo(()=>r?A.filter(V=>V.toasterId===r):A.filter(V=>!V.toasterId),[A,r]),L=ee.useMemo(()=>Array.from(new Set([s].concat(M.filter(V=>V.position).map(V=>V.position)))),[M,s]),[q,j]=ee.useState([]),[B,F]=ee.useState(!1),[Z,ie]=ee.useState(!1),[H,W]=ee.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=ee.useRef(null),le=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=ee.useRef(null),k=ee.useRef(!1),G=ee.useCallback(V=>{I(D=>{var U;return(U=D.find(X=>X.id===V.id))!=null&&U.delete||Wr.dismiss(V.id),D.filter(({id:X})=>X!==V.id)})},[]);return ee.useEffect(()=>Wr.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{I(D=>D.map(U=>U.id===V.id?{...U,delete:!0}:U))});return}setTimeout(()=>{KM.flushSync(()=>{I(D=>{const U=D.findIndex(X=>X.id===V.id);return U!==-1?[...D.slice(0,U),{...D[U],...V},...D.slice(U+1)]:[V,...D]})})})}),[A]),ee.useEffect(()=>{if(g!=="system"){W(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:D})=>{W(D?"dark":"light")})}catch{V.addListener(({matches:U})=>{try{W(U?"dark":"light")}catch(X){console.error(X)}})}},[g]),ee.useEffect(()=>{A.length<=1&&F(!1)},[A]),ee.useEffect(()=>{const V=D=>{var U;if(l.every(pe=>D[pe]||D.code===pe)){var fe;F(!0),(fe=te.current)==null||fe.focus()}D.code==="Escape"&&(document.activeElement===te.current||(U=te.current)!=null&&U.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[l]),ee.useEffect(()=>{if(te.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,k.current=!1)}},[te.current]),ee.createElement("section",{ref:n,"aria-label":`${O} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((V,D)=>{var U;const[X,fe]=V.split("-");return M.length?ee.createElement("ol",{key:V,dir:E==="auto"?JT():E,tabIndex:-1,ref:te,className:f,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":X,"data-x-position":fe,style:{"--front-toast-height":`${((U=q[0])==null?void 0:U.height)||0}px`,"--width":`${_G}px`,"--gap":`${T}px`,...b,...RG(p,h)},onBlur:pe=>{k.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(k.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||k.current||(k.current=!0,Q.current=pe.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{Z||F(!1)},onDragEnd:()=>F(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||ie(!0)},onPointerUp:()=>ie(!1)},M.filter(pe=>!pe.position&&D===0||pe.position===V).map((pe,xe)=>{var je,Y;return ee.createElement(xG,{key:pe.id,icons:R,index:xe,toast:pe,defaultRichColors:v,duration:(je=S?.duration)!=null?je:_,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:o,visibleToasts:x,closeButton:(Y=S?.closeButton)!=null?Y:d,interacting:Z,position:V,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:G,toasts:M.filter(re=>re.position==pe.position),heights:q.filter(re=>re.position==pe.position),setHeights:j,expandByDefault:c,gap:T,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),PN=P.createContext({});function MN(){return P.useContext(PN)}var s_,eC;function TG(){if(eC)return s_;eC=1;var e=function(){};return s_=e,s_}var CG=TG();const AG=fl(CG);function IG({async:e,appendTo:t,defer:n,id:r,nonce:o,src:s}){const l=document.createElement("script");e!==void 0&&(l.async=e),n!==void 0&&(l.defer=n),r&&(l.id=r),o&&l.setAttribute("nonce",o),l.src=s,(t==="head"?document.head:document.body).appendChild(l)}var PG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Dd=null,Qd=!1;const qm=new Set,Hm=new Set,MG=typeof window<"u",Dc="___grecaptcha_cfg",NN=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function NG(){if(!MG)return;function e(n){if(Qd)n();else{window[Dc]||(window[Dc]={});const r=window[Dc];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){Qd=!0;for(const n of Hm)n();Hm.clear()}window[NN]=t}function kG({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:o=!1}){const s=o?"recaptcha.net":"google.com",l=r?"enterprise.js":"api.js",c=new URLSearchParams({render:n});return t&&c.set("onload",t),e&&c.set("hl",e),`https://www.${s}/recaptcha/${l}?${c.toString()}`}function DG({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:o}){const s={id:"google-recaptcha-v3"},l=kG({language:e,onLoadCallbackName:NN,render:t,useEnterprise:r,useRecaptchaNet:o});if(Dd){if(Dd!==l)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}Dd=l,IG(Object.assign(Object.assign(Object.assign({},s),n),{src:l}))}function LG(e){if(!window[Dc])return;const t=window[Dc];t.clients&&delete t.clients[e]}function $G(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,o=PG(t,["onLoadCallback","onLoadCallbackName"]);if(qm.size===0&&NG(),DG(o),qm.add(e),n&&(Qd?n():Hm.add(n)),r){let s=function(){if(!r)return;const l=window[r];typeof l=="function"&&l()};Qd?s():Hm.add(s)}}function jG(e){var t,n,r;qm.delete(e),qm.size===0&&(window.grecaptcha=void 0,window[Dc]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${Dd}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),Dd=null,Qd=!1)}let tC=!1;function zG({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:o,useEnterprise:s,useRecaptchaNet:l}){var c,d,f,p,h,g,v;const _=P.useId(),[b,x]=P.useState(null),[S,E]=P.useState(null),T=P.useRef(!1);P.useEffect(()=>{function I(){var M;const L=s?(M=window.grecaptcha)===null||M===void 0?void 0:M.enterprise:window.grecaptcha;if(!L)throw new Error("reCAPTCHA not found");if(!L.ready)throw new Error("reCAPTCHA ready callback not found");L.ready(()=>{x(L)})}return $G(_,{language:n,onLoadCallback:I,onLoadCallbackName:o?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:o?.appendTo,async:o?.async,defer:o?.defer,id:o?.id,nonce:o?.nonce},useEnterprise:s,useRecaptchaNet:l}),()=>{jG(_),x(null)}},[e?.element,_,n,r,o?.appendTo,o?.async,o?.defer,o?.id,o?.nonce,o?.onLoadCallbackName,s,l]),P.useEffect(()=>{var I,M,L;if(!e?.element||!b?.render)return;const q={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((I=e.parameters)===null||I===void 0?void 0:I.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},j=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!j)throw new Error("reCAPTCHA container element not found");const B=b.render(j,q);return!((M=e?.parameters)===null||M===void 0)&&M.hidden&&(tC||(AG(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),tC=!0),(L=j.querySelector(".grecaptcha-badge"))===null||L===void 0||L.style.setProperty("display","none")),E(B),T.current=!0,()=>{E(null),T.current=!1,LG(B),j.innerHTML=""}},[e?.element,(c=e?.parameters)===null||c===void 0?void 0:c.badge,(d=e?.parameters)===null||d===void 0?void 0:d.hidden,(f=e?.parameters)===null||f===void 0?void 0:f.callback,(p=e?.parameters)===null||p===void 0?void 0:p.errorCallback,(h=e?.parameters)===null||h===void 0?void 0:h.expiredCallback,(g=e?.parameters)===null||g===void 0?void 0:g.tabindex,(v=e?.parameters)===null||v===void 0?void 0:v.theme,b,r]);const R=!!e?.element,O=R?S:r,A=P.useMemo(()=>O!==null&&b?.execute?I=>{if(O===null||!b?.execute)throw new Error("reCAPTCHA has not been loaded");return R&&!T.current?(console.warn("Client ID not mounted"),null):b.execute(O,{action:I})}:void 0,[O,b,R]);return C.jsx(PN.Provider,{value:{container:e?.element,executeRecaptcha:A,reCaptchaInstance:b},children:t})}var UG=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},No=new UG;function FG(){return()=>{}}function ms(){return P.useSyncExternalStore(FG,()=>!0,()=>!1)}function kN(){const[e,t]=P.useState();return P.useEffect(()=>{const n=()=>{const o=document.documentElement.getAttribute("lang");t(o??void 0)};n();const r=new MutationObserver(o=>{for(const s of o)s.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function Xw(){const[e,t]=P.useState("light");return P.useEffect(()=>{const n=()=>{var o;const s=document.documentElement.classList.contains("dark")||((o=document.documentElement.getAttribute("style"))==null?void 0:o.includes("color-scheme: dark"));t(s?"dark":"light")};n();const r=new MutationObserver(o=>{for(const s of o)(s.attributeName==="style"||s.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function BG({children:e}){const t=ms(),{captcha:n}=P.useContext(vt);return n?.provider!=="google-recaptcha-v3"?e:C.jsxs(zG,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&C.jsx("style",{children:`
|
|
49
49
|
.grecaptcha-badge {
|
|
50
50
|
visibility: hidden;
|
|
51
51
|
border-radius: var(--radius) !important;
|
|
@@ -58,7 +58,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
58
58
|
.dark .grecaptcha-badge {
|
|
59
59
|
border-color: var(--input) !important;
|
|
60
60
|
}
|
|
61
|
-
`}),C.jsx(VG,{}),e]})}function VG(){const{executeRecaptcha:e}=MN(),{theme:t}=Xw(),{lang:n}=kN();return P.useEffect(()=>{if(!e)return;(async()=>{const o=document.querySelector("iframe[title='reCAPTCHA']");if(o){const s=new URL(o.src);s.searchParams.set("theme",t),n&&s.searchParams.set("hl",n),o.src=s.toString()}})()},[e,t,n]),null}function qG({slug:e}={}){const{organization:t,hooks:{useActiveOrganization:n,useListOrganizations:r}}=P.useContext(vt),{pathMode:o,slug:s}=t||{};let l,c,d,f;const{data:p,isPending:h,isRefetching:g}=r();if(o==="slug"){const v=e||s;l=p?.find(_=>_.slug===v),c=h,d=g}else{const{data:v,isPending:_,isRefetching:b,refetch:x}=n();f=x,l=v,c=_,d=b}return P.useMemo(()=>({data:l,isPending:c,isRefetching:d,refetch:f}),[l,c,d,f])}var HG=()=>{const{hooks:{useListOrganizations:e,useSession:t},organization:n,navigate:r,redirectTo:o}=P.useContext(vt),{slug:s,pathMode:l,personalPath:c}=n||{},{data:d}=t(),{data:f,isPending:p,isRefetching:h,refetch:g}=qG(),{refetch:v}=e(),{data:_}=e();return P.useEffect(()=>{d?.user.id&&(f||_)&&(g?.(),v?.())},[d?.user.id]),P.useEffect(()=>{h||p||s&&l==="slug"&&!f&&r(c||o)},[f,h,p,s,l,c,r,o]),null},GG=({href:e,className:t,children:n})=>C.jsx("a",{className:t,href:e,children:n}),KG=e=>{window.location.href=e},ZG=e=>{window.location.replace(e)},YG=({variant:e="default",message:t})=>{e==="default"?QT(t):QT[e](t)},vt=P.createContext({}),WG=({children:e,authClient:t,account:n,avatar:r,deleteUser:o,social:s,genericOAuth:l,basePath:c="/auth",baseURL:d="",captcha:f,redirectTo:p="/",credentials:h,changeEmail:g=!0,freshAge:v=3600*24,hooks:_,mutators:b,localization:x,localizeErrors:S=!0,nameRequired:E=!0,organization:T,teams:R,signUp:O=!0,toast:A=YG,viewPaths:I,navigate:M,replace:L,Link:q=GG,emailVerification:j,...B})=>{const F=t,Z=P.useMemo(()=>{if(r)return r===!0?{extension:"png",size:128}:{upload:r.upload,delete:r.delete,extension:r.extension||"png",size:r.size||(r.upload?256:128),Image:r.Image}},[r]),ie=P.useMemo(()=>{if(j)return j===!0?{otp:!1}:{otp:j.otp??!1}},[j]),H=P.useMemo(()=>{var Y;return n===!1?void 0:n===!0||n===void 0?{basePath:"/account",fields:["image","name"],viewPaths:YT}:{basePath:((Y=n.basePath)!=null&&Y.endsWith("/")?n.basePath.slice(0,-1):n.basePath)??"/account",fields:n.fields||["image","name"],viewPaths:{...YT,...n.viewPaths}}},[n]),W=P.useMemo(()=>{if(o)return o===!0?{}:o},[o]),te=P.useMemo(()=>{if(s)return s},[s]),le=P.useMemo(()=>{if(l)return l},[l]),Q=P.useMemo(()=>{if(h!==!1)return h===!0?{forgotPassword:!0,usernameRequired:!0}:{...h,forgotPassword:h?.forgotPassword??!0,usernameRequired:h?.usernameRequired??!0}},[h]),k=P.useMemo(()=>{if(O!==!1)return O===!0||O===void 0?{fields:["name"]}:{fields:O.fields||["name"]}},[O]),G=P.useMemo(()=>{var Y;if(!T)return;if(T===!0)return{basePath:"/organization",viewPaths:WT,customRoles:[]};let re;T.logo===!0?re={extension:"png",size:128}:T.logo&&(re={upload:T.logo.upload,delete:T.logo.delete,extension:T.logo.extension||"png",size:T.logo.size||(T.logo.upload?256:128)});const ve=(Y=T.basePath)!=null&&Y.endsWith("/")?T.basePath.slice(0,-1):T.basePath;return{...T,logo:re,basePath:ve??"/organization",customRoles:T.customRoles||[],viewPaths:{...WT,...T.viewPaths}}},[T]),V=P.useMemo(()=>{var Y,re;if(!(!R||!G))return R===!0?{enabled:!0,customRoles:[],colors:{count:5,prefix:"team"}}:{enabled:R.enabled??!0,customRoles:R.customRoles||[],colors:{count:((Y=R.colors)==null?void 0:Y.count)??5,prefix:((re=R.colors)==null?void 0:re.prefix)??"team"}}},[R,G]),D=P.useMemo(()=>({deleteApiKey:Y=>F.apiKey.delete({...Y,fetchOptions:{throw:!0}}),deletePasskey:Y=>F.passkey.deletePasskey({...Y,fetchOptions:{throw:!0}}),revokeDeviceSession:Y=>F.multiSession.revoke({...Y,fetchOptions:{throw:!0}}),revokeSession:Y=>F.revokeSession({...Y,fetchOptions:{throw:!0}}),setActiveSession:Y=>F.multiSession.setActive({...Y,fetchOptions:{throw:!0}}),updateOrganization:Y=>F.organization.update({...Y,fetchOptions:{throw:!0}}),updateTeam:Y=>F.$fetch("/organization/update-team",{method:"POST",body:Y,throw:!0}),updateUser:Y=>F.updateUser({...Y,fetchOptions:{throw:!0}}),unlinkAccount:Y=>F.unlinkAccount({...Y,fetchOptions:{throw:!0}})}),[F]),U=P.useMemo(()=>({useSession:F.useSession,useListAccounts:()=>ao({queryFn:F.listAccounts,cacheKey:"listAccounts"}),useAccountInfo:Y=>ao({queryFn:()=>F.accountInfo(Y),cacheKey:`accountInfo:${JSON.stringify(Y)}`}),useListDeviceSessions:()=>ao({queryFn:F.multiSession.listDeviceSessions,cacheKey:"listDeviceSessions"}),useListSessions:()=>ao({queryFn:F.listSessions,cacheKey:"listSessions"}),useListPasskeys:F.useListPasskeys,useListApiKeys:()=>ao({queryFn:F.apiKey.list,cacheKey:"listApiKeys"}),useActiveOrganization:F.useActiveOrganization,useListOrganizations:F.useListOrganizations,useHasPermission:Y=>ao({queryFn:()=>F.$fetch("/organization/has-permission",{method:"POST",body:Y}),cacheKey:`hasPermission:${JSON.stringify(Y)}`}),useInvitation:Y=>ao({queryFn:()=>F.organization.getInvitation(Y),cacheKey:`invitation:${JSON.stringify(Y)}`}),useListInvitations:Y=>ao({queryFn:()=>{var re;return F.$fetch(`/organization/list-invitations?organizationId=${((re=Y?.query)==null?void 0:re.organizationId)||""}`)},cacheKey:`listInvitations:${JSON.stringify(Y)}`}),useListUserInvitations:()=>ao({queryFn:()=>F.$fetch("/organization/list-user-invitations"),cacheKey:"listUserInvitations"}),useListMembers:Y=>ao({queryFn:()=>{var re;return F.$fetch(`/organization/list-members?organizationId=${((re=Y?.query)==null?void 0:re.organizationId)||""}`)},cacheKey:`listMembers:${JSON.stringify(Y)}`}),useListTeams:Y=>ao({queryFn:()=>F.$fetch(`/organization/list-teams?organizationId=${Y?.organizationId||""}`),cacheKey:`listTeams:${JSON.stringify(Y)}`}),useListTeamMembers:Y=>ao({queryFn:()=>F.$fetch("/organization/list-team-members",{method:"POST",body:Y?.teamId?{query:{teamId:Y.teamId}}:void 0}),cacheKey:`listTeamMembers:${JSON.stringify(Y)}`}),useListUserTeams:()=>ao({queryFn:()=>F.$fetch("/organization/list-user-teams"),cacheKey:"listUserTeams"})}),[F]),X=P.useMemo(()=>({...JH,...I}),[I]),fe=P.useMemo(()=>({...XH,...x}),[x]),pe=P.useMemo(()=>({...U,..._}),[U,_]),xe=P.useMemo(()=>({...D,...b}),[D,b]);d=d.endsWith("/")?d.slice(0,-1):d,c=c.endsWith("/")?c.slice(0,-1):c;const{data:je}=pe.useSession();return C.jsxs(vt.Provider,{value:{authClient:F,avatar:Z,basePath:c==="/"?"":c,baseURL:d,captcha:f,redirectTo:p,changeEmail:g,credentials:Q,deleteUser:W,emailVerification:ie,freshAge:v,genericOAuth:le,hooks:pe,mutators:xe,localization:fe,localizeErrors:S,nameRequired:E,organization:G,teams:V,account:H,signUp:k,social:te,toast:A,navigate:M||KG,replace:L||M||ZG,viewPaths:X,Link:q,...B},children:[je&&G&&C.jsx(HG,{}),f?.provider==="google-recaptcha-v3"?C.jsx(BG,{children:e}):e]})};function ao({queryFn:e,cacheKey:t,staleTime:n=1e4}){var r;const{hooks:{useSession:o},toast:s,localization:l,localizeErrors:c}=P.useContext(vt),{data:d,isPending:f}=o(),p=P.useRef(e);p.current=e;const h=t||e.toString(),g=P.useSyncExternalStore(P.useCallback(T=>No.subscribe(h,T),[h]),P.useCallback(()=>No.get(h),[h]),P.useCallback(()=>No.get(h),[h])),v=P.useRef(!1),_=P.useRef(void 0),[b,x]=P.useState(null),S=P.useCallback(async()=>{const T=No.getInFlightRequest(h);if(T){try{const O=await T;O.error?x(O.error):x(null)}catch(O){x(O)}return}g?.data!==void 0&&No.setRefetching(h,!0);const R=p.current();No.setInFlightRequest(h,R);try{const{data:O,error:A}=await R;A?(x(A),s({variant:"error",message:kn({error:A,localization:l,localizeErrors:c})})):x(null),No.set(h,O)}catch(O){const A=O;x(A),s({variant:"error",message:kn({error:A,localization:l,localizeErrors:c})})}finally{No.setRefetching(h,!1),No.removeInFlightRequest(h)}},[h,s,l,c,g]);P.useEffect(()=>{var T;const R=(T=d?.user)==null?void 0:T.id;if(!d){No.setRefetching(h,!1),No.clear(h),v.current=!1,_.current=void 0;return}const O=_.current!==void 0&&_.current!==R;O&&No.clear(h);const A=g?.data!==void 0,I=!g||Date.now()-g.timestamp>n;(!v.current||!A||O||A&&I)&&(!A||I)&&(v.current=!0,S()),_.current=R},[d,(r=d?.user)==null?void 0:r.id,h,S,g,n]);const E=f||g?.data===void 0&&!b;return{data:g?.data??null,isPending:E,isRefetching:g?.isRefetching??!1,error:b,refetch:S}}const QG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),DN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var XG={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const JG=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:l,...c},d)=>P.createElement("svg",{ref:d,...XG,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:DN("lucide",o),...c},[...l.map(([f,p])=>P.createElement(f,p)),...Array.isArray(s)?s:[s]]));const Ir=(e,t)=>{const n=P.forwardRef(({className:r,...o},s)=>P.createElement(JG,{ref:s,iconNode:t,className:DN(`lucide-${QG(e)}`,r),...o}));return n.displayName=`${e}`,n};const eK=Ir("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const tK=Ir("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);const LN=Ir("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const nK=Ir("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const rK=Ir("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const oK=Ir("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const iK=Ir("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);const Ar=Ir("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const $N=Ir("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const jN=Ir("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);const sK=Ir("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const aK=Ir("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);const nC=Ir("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const lK=Ir("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const cK=Ir("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);const uK=Ir("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var pf=e=>e.type==="checkbox",rl=e=>e instanceof Date,jr=e=>e==null;const zN=e=>typeof e=="object";var Nn=e=>!jr(e)&&!Array.isArray(e)&&zN(e)&&!rl(e),UN=e=>Nn(e)&&e.target?pf(e.target)?e.target.checked:e.target.value:e,FN=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),dK=e=>{const t=e.constructor&&e.constructor.prototype;return Nn(t)&&t.hasOwnProperty("isPrototypeOf")},Jw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function on(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Jw&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Nn(e)&&dK(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=on(e[o]));return r}var qg=e=>/^\w*$/.test(e),tn=e=>e===void 0,Hg=e=>Array.isArray(e)?e.filter(Boolean):[],eS=e=>Hg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,n)=>{if(!t||!Nn(e))return n;const o=(qg(t)?[t]:eS(t)).reduce((s,l)=>jr(s)?void 0:s[l],e);return tn(o)||o===e?tn(e[t])?n:e[t]:o},fo=e=>typeof e=="boolean",Or=e=>typeof e=="function",zt=(e,t,n)=>{let r=-1;const o=qg(t)?[t]:eS(t),s=o.length,l=s-1;for(;++r<s;){const c=o[r];let d=n;if(r!==l){const f=e[c];d=Nn(f)||Array.isArray(f)?f:isNaN(+o[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const ea={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},jo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Jo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},a_="form",BN="root",tS=ee.createContext(null);tS.displayName="HookFormControlContext";const Gg=()=>ee.useContext(tS);var VN=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const l=s;return t._proxyFormState[l]!==jo.all&&(t._proxyFormState[l]=!r||jo.all),n&&(n[l]=!0),e[l]}});return o};const Kg=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;function qN(e){const t=Gg(),{control:n=t,disabled:r,name:o,exact:s}=e||{},[l,c]=ee.useState(n._formState),d=ee.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Kg(()=>n._subscribe({name:o,formState:d.current,exact:s,callback:f=>{!r&&c({...n._formState,...f})}}),[o,r,s]),ee.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),ee.useMemo(()=>VN(l,n,d.current,!1),[l,n])}var Tr=e=>typeof e=="string",Wb=(e,t,n,r,o)=>Tr(e)?(r&&t.watch.add(e),De(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),De(n,s))):(r&&(t.watchAll=!0),n),Qb=e=>jr(e)||!zN(e);function ho(e,t,n=new WeakSet){if(e===t)return!0;if(Qb(e)||Qb(t))return Object.is(e,t);if(rl(e)&&rl(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const l=e[s];if(!(s in t))return!1;if(s!=="ref"){const c=t[s];if(rl(l)&&rl(c)||(Nn(l)||Array.isArray(l))&&(Nn(c)||Array.isArray(c))?!ho(l,c,n):!Object.is(l,c))return!1}}return!0}function fK(e){const t=Gg(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:l,compute:c}=e||{},d=ee.useRef(o),f=ee.useRef(c),p=ee.useRef(void 0),h=ee.useRef(n),g=ee.useRef(r);f.current=c;const[v,_]=ee.useState(()=>{const R=n._getWatch(r,d.current);return f.current?f.current(R):R}),b=ee.useCallback(R=>{const O=Wb(r,n._names,R||n._formValues,!1,d.current);return f.current?f.current(O):O},[n._formValues,n._names,r]),x=ee.useCallback(R=>{if(!s){const O=Wb(r,n._names,R||n._formValues,!1,d.current);if(f.current){const A=f.current(O);ho(A,p.current)||(_(A),p.current=A)}else _(O)}},[n._formValues,n._names,s,r]);Kg(()=>((h.current!==n||!ho(g.current,r))&&(h.current=n,g.current=r,x()),n._subscribe({name:r,formState:{values:!0},exact:l,callback:R=>{x(R.values)}})),[n,l,r,x]),ee.useEffect(()=>n._removeUnmounted());const S=h.current!==n,E=g.current,T=ee.useMemo(()=>{if(s)return null;const R=!S&&!ho(E,r);return S||R?b():null},[s,S,r,E,b]);return T!==null?T:v}function hK(e){const t=Gg(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:l,exact:c=!0}=e,d=FN(o._names.array,n),f=ee.useMemo(()=>De(o._formValues,n,De(o._defaultValues,n,l)),[o,n,l]),p=fK({control:o,name:n,defaultValue:f,exact:c}),h=qN({control:o,name:n,exact:c}),g=ee.useRef(e),v=ee.useRef(o.register(n,{...e.rules,value:p,...fo(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const _=ee.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(h.validatingFields,n)},error:{enumerable:!0,get:()=>De(h.errors,n)}}),[h,n]),b=ee.useCallback(T=>v.current.onChange({target:{value:UN(T),name:n},type:ea.CHANGE}),[n]),x=ee.useCallback(()=>v.current.onBlur({target:{value:De(o._formValues,n),name:n},type:ea.BLUR}),[n,o._formValues]),S=ee.useCallback(T=>{const R=De(o._fields,n);R&&R._f&&T&&(R._f.ref={focus:()=>Or(T.focus)&&T.focus(),select:()=>Or(T.select)&&T.select(),setCustomValidity:O=>Or(T.setCustomValidity)&&T.setCustomValidity(O),reportValidity:()=>Or(T.reportValidity)&&T.reportValidity()})},[o._fields,n]),E=ee.useMemo(()=>({name:n,value:p,...fo(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:b,onBlur:x,ref:S}),[n,r,h.disabled,b,x,S,p]);return ee.useEffect(()=>{const T=o._options.shouldUnregister||s;o.register(n,{...g.current.rules,...fo(g.current.disabled)?{disabled:g.current.disabled}:{}});const R=(O,A)=>{const I=De(o._fields,O);I&&I._f&&(I._f.mount=A)};if(R(n,!0),T){const O=on(De(o._options.defaultValues,n,g.current.defaultValue));zt(o._defaultValues,n,O),tn(De(o._formValues,n))&&zt(o._formValues,n,O)}return!d&&o.register(n),()=>{(d?T&&!o._state.action:T)?o.unregister(n):R(n,!1)}},[n,o,d,s]),ee.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),ee.useMemo(()=>({field:E,formState:h,fieldState:_}),[E,h,_])}const pK=e=>e.render(hK(e)),nS=ee.createContext(null);nS.displayName="HookFormContext";const mK=()=>ee.useContext(nS),gK=e=>{const{children:t,watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:l,setValue:c,trigger:d,formState:f,resetField:p,reset:h,handleSubmit:g,unregister:v,control:_,register:b,setFocus:x,subscribe:S}=e,E=ee.useMemo(()=>({watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:l,setValue:c,trigger:d,formState:f,resetField:p,reset:h,handleSubmit:g,unregister:v,control:_,register:b,setFocus:x,subscribe:S}),[l,_,f,o,r,g,b,h,p,s,x,c,S,d,v,n]);return ee.createElement(nS.Provider,{value:E},ee.createElement(tS.Provider,{value:E.control},t))};var rS=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Xr=e=>Array.isArray(e)?e:[e],rC=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function HN(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],s=t[r];if(o&&Nn(o)&&s){const l=HN(o,s);Nn(l)&&(n[r]=l)}else e[r]&&(n[r]=s)}return n}var hr=e=>Nn(e)&&!Object.keys(e).length,oS=e=>e.type==="file",Gm=e=>{if(!Jw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},GN=e=>e.type==="select-multiple",iS=e=>e.type==="radio",vK=e=>iS(e)||pf(e),l_=e=>Gm(e)&&e.isConnected;function yK(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;){if(jr(e)){e=void 0;break}e=e[t[r]],r++}return e}function _K(e){for(const t in e)if(e.hasOwnProperty(t)&&!tn(e[t]))return!1;return!0}function Cn(e,t){if(Tr(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:qg(t)?[t]:eS(t),r=n.length===1?e:yK(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Nn(r)&&hr(r)||Array.isArray(r)&&_K(r))&&Cn(e,n.slice(0,-1)),e}var bK=e=>{for(const t in e)if(Or(e[t]))return!0;return!1};function KN(e){return Array.isArray(e)||Nn(e)&&!bK(e)}function Xb(e,t={}){for(const n in e){const r=e[n];KN(r)?(t[n]=Array.isArray(r)?[]:{},Xb(r,t[n])):tn(r)||(t[n]=!0)}return t}function xd(e,t,n){n||(n=Xb(t));for(const r in e){const o=e[r];if(KN(o))tn(t)||Qb(n[r])?n[r]=Xb(o,Array.isArray(o)?[]:{}):xd(o,jr(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!ho(o,s)}}return n}const oC={value:!1,isValid:!1},iC={value:!0,isValid:!0};var ZN=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!tn(e[0].attributes.value)?tn(e[0].value)||e[0].value===""?iC:{value:e[0].value,isValid:!0}:iC:oC}return oC},YN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>tn(e)?e:t?e===""?NaN:e&&+e:n&&Tr(e)?new Date(e):r?r(e):e;const sC={isValid:!1,value:null};var WN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,sC):sC;function aC(e){const t=e.ref;return oS(t)?t.files:iS(t)?WN(e.refs).value:GN(t)?[...t.selectedOptions].map(({value:n})=>n):pf(t)?ZN(e.refs).value:YN(tn(t.value)?e.ref.value:t.value,e)}var wK=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,SK=(e,t,n,r)=>{const o={};for(const s of e){const l=De(t,s);l&&zt(o,s,l._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Km=e=>e instanceof RegExp,id=e=>tn(e)?e:Km(e)?e.source:Nn(e)?Km(e.value)?e.value.source:e.value:e,Ac=e=>({isOnSubmit:!e||e===jo.onSubmit,isOnBlur:e===jo.onBlur,isOnChange:e===jo.onChange,isOnAll:e===jo.all,isOnTouch:e===jo.onTouched});const lC="AsyncFunction";var EK=e=>!!e&&!!e.validate&&!!(Or(e.validate)&&e.validate.constructor.name===lC||Nn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===lC)),xK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Jb=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Lc=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=De(e,o);if(s){const{_f:l,...c}=s;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],o)&&!r)return!0;if(l.ref&&t(l.ref,l.name)&&!r)return!0;if(Lc(c,t))break}else if(Nn(c)&&Lc(c,t))break}}};function cC(e,t,n){const r=De(e,n);if(r||qg(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),l=De(t,s),c=De(e,s);if(l&&!Array.isArray(l)&&n!==s)return{name:n};if(c&&c.type)return{name:s,error:c};if(c&&c.root&&c.root.type)return{name:`${s}.root`,error:c.root};o.pop()}return{name:n}}var RK=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return hr(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(l=>t[l]===(!r||jo.all))},OK=(e,t,n)=>!e||!t||e===t||Xr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),TK=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,CK=(e,t)=>!Hg(De(e,t)).length&&Cn(e,t),QN=(e,t,n)=>{const r=Xr(De(e,n));return zt(r,BN,t[n]),zt(e,n,r),e};function uC(e,t,n="validate"){if(Tr(e)||Array.isArray(e)&&e.every(Tr)||fo(e)&&!e)return{type:n,message:Tr(e)?e:"",ref:t}}var ac=e=>Nn(e)&&!Km(e)?e:{value:e,message:""},e1=async(e,t,n,r,o,s)=>{const{ref:l,refs:c,required:d,maxLength:f,minLength:p,min:h,max:g,pattern:v,validate:_,name:b,valueAsNumber:x,mount:S}=e._f,E=De(n,b);if(!S||t.has(b))return{};const T=c?c[0]:l,R=B=>{o&&T.reportValidity&&(T.setCustomValidity(fo(B)?"":B||""),T.reportValidity())},O={},A=iS(l),I=pf(l),M=A||I,L=(x||oS(l))&&tn(l.value)&&tn(E)||Gm(l)&&l.value===""||E===""||Array.isArray(E)&&!E.length||x&&typeof E=="number"&&isNaN(E),q=rS.bind(null,b,r,O),j=(B,F,Z,ie=Jo.maxLength,H=Jo.minLength)=>{const W=B?F:Z;O[b]={type:B?ie:H,message:W,ref:l,...q(B?ie:H,W)}};if(s?!Array.isArray(E)||!E.length:d&&(!M&&(L||jr(E))||fo(E)&&!E||I&&!ZN(c).isValid||A&&!WN(c).isValid)){const{value:B,message:F}=Tr(d)?{value:!!d,message:d}:ac(d);if(B&&(O[b]={type:Jo.required,message:F,ref:T,...q(Jo.required,F)},!r))return R(F),O}if(!L&&(!jr(h)||!jr(g))){let B,F;const Z=ac(g),ie=ac(h);if(!jr(E)&&!isNaN(E)){const H=l.valueAsNumber||E&&+E;jr(Z.value)||(B=H>Z.value),jr(ie.value)||(F=H<ie.value)}else{const H=l.valueAsDate||new Date(E),W=Q=>new Date(new Date().toDateString()+" "+Q),te=l.type=="time",le=l.type=="week";Tr(Z.value)&&E&&(B=te?W(E)>W(Z.value):le?E>Z.value:H>new Date(Z.value)),Tr(ie.value)&&E&&(F=te?W(E)<W(ie.value):le?E<ie.value:H<new Date(ie.value))}if((B||F)&&(j(!!B,Z.message,ie.message,Jo.max,Jo.min),!r))return R(O[b].message),O}if((f||p)&&!L&&(Tr(E)||s&&Array.isArray(E))){const B=ac(f),F=ac(p),Z=!jr(B.value)&&E.length>+B.value,ie=!jr(F.value)&&E.length<+F.value;if((Z||ie)&&(j(Z,B.message,F.message),!r))return R(O[b].message),O}if(v&&!L&&Tr(E)){const{value:B,message:F}=ac(v);if(Km(B)&&!E.match(B)&&(O[b]={type:Jo.pattern,message:F,ref:l,...q(Jo.pattern,F)},!r))return R(F),O}if(_){if(Or(_)){const B=await _(E,n),F=uC(B,T);if(F&&(O[b]={...F,...q(Jo.validate,F.message)},!r))return R(F.message),O}else if(Nn(_)){let B={};for(const F in _){if(!hr(B)&&!r)break;const Z=uC(await _[F](E,n),T,F);Z&&(B={...Z,...q(F,Z.message)},R(Z.message),r&&(O[b]=B))}if(!hr(B)&&(O[b]={ref:T,...B},!r))return O}}return R(!0),O};const AK={mode:jo.onSubmit,reValidateMode:jo.onChange,shouldFocusError:!0};function IK(e={}){let t={...AK,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Or(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Nn(t.defaultValues)||Nn(t.values)?on(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:on(o),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},d,f=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...p};let g={...h};const v={array:rC(),state:rC()},_=t.criteriaMode===jo.all,b=K=>ne=>{clearTimeout(f),f=setTimeout(K,ne)},x=async K=>{if(!l.keepIsValid&&!t.disabled&&(h.isValid||g.isValid||K)){let ne;t.resolver?(ne=hr((await L()).errors),S()):ne=await B({fields:r,onlyCheckValid:!0,eventType:ea.VALID}),ne!==n.isValid&&v.state.next({isValid:ne})}},S=(K,ne)=>{!t.disabled&&(h.isValidating||h.validatingFields||g.isValidating||g.validatingFields)&&((K||Array.from(c.mount)).forEach(ae=>{ae&&(ne?zt(n.validatingFields,ae,ne):Cn(n.validatingFields,ae))}),v.state.next({validatingFields:n.validatingFields,isValidating:!hr(n.validatingFields)}))},E=K=>{const ne=xd(o,s),ae=wK(K);zt(n.dirtyFields,ae,De(ne,ae))},T=(K,ne=[],ae,Oe,Ae=!0,Ie=!0)=>{if(Oe&&ae&&!t.disabled){if(l.action=!0,Ie&&Array.isArray(De(r,K))){const ke=ae(De(r,K),Oe.argA,Oe.argB);Ae&&zt(r,K,ke)}if(Ie&&Array.isArray(De(n.errors,K))){const ke=ae(De(n.errors,K),Oe.argA,Oe.argB);Ae&&zt(n.errors,K,ke),CK(n.errors,K)}if((h.touchedFields||g.touchedFields)&&Ie&&Array.isArray(De(n.touchedFields,K))){const ke=ae(De(n.touchedFields,K),Oe.argA,Oe.argB);Ae&&zt(n.touchedFields,K,ke)}(h.dirtyFields||g.dirtyFields)&&E(K),v.state.next({name:K,isDirty:Z(K,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zt(s,K,ne)},R=(K,ne)=>{zt(n.errors,K,ne),v.state.next({errors:n.errors})},O=K=>{n.errors=K,v.state.next({errors:n.errors,isValid:!1})},A=(K,ne,ae,Oe)=>{const Ae=De(r,K);if(Ae){const Ie=De(s,K,tn(ae)?De(o,K):ae);tn(Ie)||Oe&&Oe.defaultChecked||ne?zt(s,K,ne?Ie:aC(Ae._f)):W(K,Ie),l.mount&&!l.action&&x()}},I=(K,ne,ae,Oe,Ae)=>{let Ie=!1,ke=!1;const Je={name:K};if(!t.disabled){if(!ae||Oe){(h.isDirty||g.isDirty)&&(ke=n.isDirty,n.isDirty=Je.isDirty=Z(),Ie=ke!==Je.isDirty);const et=ho(De(o,K),ne);ke=!!De(n.dirtyFields,K),et?Cn(n.dirtyFields,K):zt(n.dirtyFields,K,!0),Je.dirtyFields=n.dirtyFields,Ie=Ie||(h.dirtyFields||g.dirtyFields)&&ke!==!et}if(ae){const et=De(n.touchedFields,K);et||(zt(n.touchedFields,K,ae),Je.touchedFields=n.touchedFields,Ie=Ie||(h.touchedFields||g.touchedFields)&&et!==ae)}Ie&&Ae&&v.state.next(Je)}return Ie?Je:{}},M=(K,ne,ae,Oe)=>{const Ae=De(n.errors,K),Ie=(h.isValid||g.isValid)&&fo(ne)&&n.isValid!==ne;if(t.delayError&&ae?(d=b(()=>R(K,ae)),d(t.delayError)):(clearTimeout(f),d=null,ae?zt(n.errors,K,ae):Cn(n.errors,K)),(ae?!ho(Ae,ae):Ae)||!hr(Oe)||Ie){const ke={...Oe,...Ie&&fo(ne)?{isValid:ne}:{},errors:n.errors,name:K};n={...n,...ke},v.state.next(ke)}},L=async K=>(S(K,!0),await t.resolver(s,t.context,SK(K||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),q=async K=>{const{errors:ne}=await L(K);if(S(K),K)for(const ae of K){const Oe=De(ne,ae);Oe?zt(n.errors,ae,Oe):Cn(n.errors,ae)}else n.errors=ne;return ne},j=async({name:K,eventType:ne})=>{if(e.validate){const ae=await e.validate({formValues:s,formState:n,name:K,eventType:ne});if(Nn(ae))for(const Oe in ae)ae[Oe]&&fe(`${a_}.${Oe}`,{message:Tr(ae.message)?ae.message:"",type:Jo.validate});else Tr(ae)||!ae?fe(a_,{message:ae||"",type:Jo.validate}):X(a_);return ae}return!0},B=async({fields:K,onlyCheckValid:ne,name:ae,eventType:Oe,context:Ae={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Ae.runRootValidation=!0,!await j({name:ae,eventType:Oe})&&(Ae.valid=!1,ne)))return Ae.valid;for(const Ie in K){const ke=K[Ie];if(ke){const{_f:Je,...et}=ke;if(Je){const _t=c.array.has(Je.name),Tt=ke._f&&EK(ke._f);Tt&&h.validatingFields&&S([Je.name],!0);const bt=await e1(ke,c.disabled,s,_,t.shouldUseNativeValidation&&!ne,_t);if(Tt&&h.validatingFields&&S([Je.name]),bt[Je.name]&&(Ae.valid=!1,ne)||(!ne&&(De(bt,Je.name)?_t?QN(n.errors,bt,Je.name):zt(n.errors,Je.name,bt[Je.name]):Cn(n.errors,Je.name)),e.shouldUseNativeValidation&&bt[Je.name]))break}!hr(et)&&await B({context:Ae,onlyCheckValid:ne,fields:et,name:Ie,eventType:Oe})}}return Ae.valid},F=()=>{for(const K of c.unMount){const ne=De(r,K);ne&&(ne._f.refs?ne._f.refs.every(ae=>!l_(ae)):!l_(ne._f.ref))&&Y(K)}c.unMount=new Set},Z=(K,ne)=>!t.disabled&&(K&&ne&&zt(s,K,ne),!ho(D(),o)),ie=(K,ne,ae)=>Wb(K,c,{...l.mount?s:tn(ne)?o:Tr(K)?{[K]:ne}:ne},ae,ne),H=K=>Hg(De(l.mount?s:o,K,t.shouldUnregister?De(o,K,[]):[])),W=(K,ne,ae={})=>{const Oe=De(r,K);let Ae=ne;if(Oe){const Ie=Oe._f;Ie&&(!Ie.disabled&&zt(s,K,YN(ne,Ie)),Ae=Gm(Ie.ref)&&jr(ne)?"":ne,GN(Ie.ref)?[...Ie.ref.options].forEach(ke=>ke.selected=Ae.includes(ke.value)):Ie.refs?pf(Ie.ref)?Ie.refs.forEach(ke=>{(!ke.defaultChecked||!ke.disabled)&&(Array.isArray(Ae)?ke.checked=!!Ae.find(Je=>Je===ke.value):ke.checked=Ae===ke.value||!!Ae)}):Ie.refs.forEach(ke=>ke.checked=ke.value===Ae):oS(Ie.ref)?Ie.ref.value="":(Ie.ref.value=Ae,Ie.ref.type||v.state.next({name:K,values:on(s)})))}(ae.shouldDirty||ae.shouldTouch)&&I(K,Ae,ae.shouldTouch,ae.shouldDirty,!0),ae.shouldValidate&&V(K)},te=(K,ne,ae)=>{for(const Oe in ne){if(!ne.hasOwnProperty(Oe))return;const Ae=ne[Oe],Ie=K+"."+Oe,ke=De(r,Ie);(c.array.has(K)||Nn(Ae)||ke&&!ke._f)&&!rl(Ae)?te(Ie,Ae,ae):W(Ie,Ae,ae)}},le=(K,ne,ae={})=>{const Oe=De(r,K),Ae=c.array.has(K),Ie=on(ne),ke=De(s,K),Je=ho(ke,Ie);if(zt(s,K,Ie),Ae)v.array.next({name:K,values:on(s)}),ae.shouldDirty&&(E(K),v.state.next({name:K,dirtyFields:n.dirtyFields,isDirty:Z(K,Ie)}));else{const et=Array.isArray(Ie)&&!Ie.length||hr(Ie);!Oe||Oe._f||jr(Ie)||et?W(K,Ie,ae):te(K,Ie,ae)}Je||(Jb(K,c)?v.state.next({...n,name:K,values:on(s)}):v.state.next({name:l.mount?K:void 0,values:on(s)}))},Q=K=>{const ne=Or(K)?K(s):K;ho(s,ne)||(s={...s,...ne},v.state.next({...n,values:s}))},k=async K=>{l.mount=!0;const ne=K.target;let ae=ne.name,Oe=!0;const Ae=De(r,ae),Ie=et=>{Oe=Number.isNaN(et)||rl(et)&&isNaN(et.getTime())||ho(et,De(s,ae,et))},ke=Ac(t.mode),Je=Ac(t.reValidateMode);if(Ae){let et,_t;const Tt=ne.type?aC(Ae._f):UN(K),bt=K.type===ea.BLUR||K.type===ea.FOCUS_OUT,Ln=!xK(Ae._f)&&!e.validate&&!t.resolver&&!De(n.errors,ae)&&!Ae._f.deps||TK(bt,De(n.touchedFields,ae),n.isSubmitted,Je,ke),Ni=Jb(ae,c,bt);zt(s,ae,Tt),bt?(!ne||!ne.readOnly)&&(Ae._f.onBlur&&Ae._f.onBlur(K),d&&d(0)):Ae._f.onChange&&Ae._f.onChange(K);const Ho=I(ae,Tt,bt),Ye=!hr(Ho)||Ni;if(!bt&&v.state.next({name:ae,type:K.type,values:on(s)}),Ln)return(h.isValid||g.isValid)&&(t.mode==="onBlur"?bt&&x():bt||x()),Ye&&v.state.next({name:ae,...Ni?{}:Ho});if(!t.resolver&&e.validate&&await j({name:ae,eventType:K.type}),!bt&&Ni&&v.state.next({...n}),t.resolver){const{errors:pt}=await L([ae]);if(S([ae]),Ie(Tt),Oe){const Ct=cC(n.errors,r,ae),it=cC(pt,r,Ct.name||ae);et=it.error,ae=it.name,_t=hr(pt)}}else S([ae],!0),et=(await e1(Ae,c.disabled,s,_,t.shouldUseNativeValidation))[ae],S([ae]),Ie(Tt),Oe&&(et?_t=!1:(h.isValid||g.isValid)&&(_t=await B({fields:r,onlyCheckValid:!0,name:ae,eventType:K.type})));Oe&&(Ae._f.deps&&(!Array.isArray(Ae._f.deps)||Ae._f.deps.length>0)&&V(Ae._f.deps),M(ae,_t,et,Ho))}},G=(K,ne)=>{if(De(n.errors,ne)&&K.focus)return K.focus(),1},V=async(K,ne={})=>{let ae,Oe;const Ae=Xr(K);if(t.resolver){const Ie=await q(tn(K)?K:Ae);ae=hr(Ie),Oe=K?!Ae.some(ke=>De(Ie,ke)):ae}else K?(Oe=(await Promise.all(Ae.map(async Ie=>{const ke=De(r,Ie);return await B({fields:ke&&ke._f?{[Ie]:ke}:ke,eventType:ea.TRIGGER})}))).every(Boolean),!(!Oe&&!n.isValid)&&x()):Oe=ae=await B({fields:r,name:K,eventType:ea.TRIGGER});return v.state.next({...!Tr(K)||(h.isValid||g.isValid)&&ae!==n.isValid?{}:{name:K},...t.resolver||!K?{isValid:ae}:{},errors:n.errors}),ne.shouldFocus&&!Oe&&Lc(r,G,K?Ae:c.mount),Oe},D=(K,ne)=>{let ae={...l.mount?s:o};return ne&&(ae=HN(ne.dirtyFields?n.dirtyFields:n.touchedFields,ae)),tn(K)?ae:Tr(K)?De(ae,K):K.map(Oe=>De(ae,Oe))},U=(K,ne)=>({invalid:!!De((ne||n).errors,K),isDirty:!!De((ne||n).dirtyFields,K),error:De((ne||n).errors,K),isValidating:!!De(n.validatingFields,K),isTouched:!!De((ne||n).touchedFields,K)}),X=K=>{const ne=K?Xr(K):void 0;ne?.forEach(ae=>Cn(n.errors,ae)),ne?ne.forEach(ae=>{v.state.next({name:ae,errors:n.errors})}):v.state.next({errors:{}})},fe=(K,ne,ae)=>{const Oe=(De(r,K,{_f:{}})._f||{}).ref,Ae=De(n.errors,K)||{},{ref:Ie,message:ke,type:Je,...et}=Ae;zt(n.errors,K,{...et,...ne,ref:Oe}),v.state.next({name:K,errors:n.errors,isValid:!1}),ae&&ae.shouldFocus&&Oe&&Oe.focus&&Oe.focus()},pe=(K,ne)=>Or(K)?v.state.subscribe({next:ae=>"values"in ae&&K(ae.values||ie(void 0,ne),ae)}):ie(K,ne,!0),xe=K=>v.state.subscribe({next:ne=>{if(OK(K.name,ne.name,K.exact)&&RK(ne,K.formState||h,Me,K.reRenderRoot)){const ae={...s};K.callback({values:ae,...n,...ne,defaultValues:o})}}}).unsubscribe,je=K=>(l.mount=!0,g={...g,...K.formState},xe({...K,formState:{...p,...K.formState}})),Y=(K,ne={})=>{for(const ae of K?Xr(K):c.mount)c.mount.delete(ae),c.array.delete(ae),ne.keepValue||(Cn(r,ae),Cn(s,ae)),!ne.keepError&&Cn(n.errors,ae),!ne.keepDirty&&Cn(n.dirtyFields,ae),!ne.keepTouched&&Cn(n.touchedFields,ae),!ne.keepIsValidating&&Cn(n.validatingFields,ae),!t.shouldUnregister&&!ne.keepDefaultValue&&Cn(o,ae);v.state.next({values:on(s)}),v.state.next({...n,...ne.keepDirty?{isDirty:Z()}:{}}),!ne.keepIsValid&&x()},re=({disabled:K,name:ne})=>{if(fo(K)&&l.mount||K||c.disabled.has(ne)){const Ae=c.disabled.has(ne)!==!!K;K?c.disabled.add(ne):c.disabled.delete(ne),Ae&&l.mount&&!l.action&&x()}},ve=(K,ne={})=>{let ae=De(r,K);const Oe=fo(ne.disabled)||fo(t.disabled),Ae=!c.registerName.has(K)&&ae&&ae._f&&!ae._f.mount;return zt(r,K,{...ae||{},_f:{...ae&&ae._f?ae._f:{ref:{name:K}},name:K,mount:!0,...ne}}),c.mount.add(K),ae&&!Ae?re({disabled:fo(ne.disabled)?ne.disabled:t.disabled,name:K}):A(K,!0,ne.value),{...Oe?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:id(ne.min),max:id(ne.max),minLength:id(ne.minLength),maxLength:id(ne.maxLength),pattern:id(ne.pattern)}:{},name:K,onChange:k,onBlur:k,ref:Ie=>{if(Ie){c.registerName.add(K),ve(K,ne),c.registerName.delete(K),ae=De(r,K);const ke=tn(Ie.value)&&Ie.querySelectorAll&&Ie.querySelectorAll("input,select,textarea")[0]||Ie,Je=vK(ke),et=ae._f.refs||[];if(Je?et.find(_t=>_t===ke):ke===ae._f.ref)return;zt(r,K,{_f:{...ae._f,...Je?{refs:[...et.filter(l_),ke,...Array.isArray(De(o,K))?[{}]:[]],ref:{type:ke.type,name:K}}:{ref:ke}}}),A(K,!1,void 0,ke)}else ae=De(r,K,{}),ae._f&&(ae._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(FN(c.array,K)&&l.action)&&c.unMount.add(K)}}},se=()=>t.shouldFocusError&&Lc(r,G,c.mount),Se=K=>{fo(K)&&(v.state.next({disabled:K}),Lc(r,(ne,ae)=>{const Oe=De(r,ae);Oe&&(ne.disabled=Oe._f.disabled||K,Array.isArray(Oe._f.refs)&&Oe._f.refs.forEach(Ae=>{Ae.disabled=Oe._f.disabled||K}))},0,!1))},Te=(K,ne)=>async ae=>{let Oe;ae&&(ae.preventDefault&&ae.preventDefault(),ae.persist&&ae.persist());let Ae=on(s);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ie,values:ke}=await L();S(),n.errors=Ie,Ae=on(ke)}else await B({fields:r,eventType:ea.SUBMIT});if(c.disabled.size)for(const Ie of c.disabled)Cn(Ae,Ie);if(Cn(n.errors,BN),hr(n.errors)){v.state.next({errors:{}});try{await K(Ae,ae)}catch(Ie){Oe=Ie}}else ne&&await ne({...n.errors},ae),se(),setTimeout(se);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:hr(n.errors)&&!Oe,submitCount:n.submitCount+1,errors:n.errors}),Oe)throw Oe},tt=(K,ne={})=>{De(r,K)&&(tn(ne.defaultValue)?le(K,on(De(o,K))):(le(K,ne.defaultValue),zt(o,K,on(ne.defaultValue))),ne.keepTouched||Cn(n.touchedFields,K),ne.keepDirty||(Cn(n.dirtyFields,K),n.isDirty=ne.defaultValue?Z(K,on(De(o,K))):Z()),ne.keepError||(Cn(n.errors,K),h.isValid&&x()),v.state.next({...n}))},rt=(K,ne={})=>{const ae=K?on(K):o,Oe=on(ae),Ae=hr(K),Ie=Ae?o:Oe;if(ne.keepDefaultValues||(o=ae),!ne.keepValues){if(ne.keepDirtyValues){const ke=new Set([...c.mount,...Object.keys(xd(o,s))]);for(const Je of Array.from(ke)){const et=De(n.dirtyFields,Je),_t=De(s,Je),Tt=De(Ie,Je);et&&!tn(_t)?zt(Ie,Je,_t):!et&&!tn(Tt)&&le(Je,Tt)}}else{if(Jw&&tn(K))for(const ke of c.mount){const Je=De(r,ke);if(Je&&Je._f){const et=Array.isArray(Je._f.refs)?Je._f.refs[0]:Je._f.ref;if(Gm(et)){const _t=et.closest("form");if(_t){_t.reset();break}}}}if(ne.keepFieldsRef)for(const ke of c.mount)le(ke,De(Ie,ke));else r={}}s=t.shouldUnregister?ne.keepDefaultValues?on(o):{}:on(Ie),v.array.next({values:{...Ie}}),v.state.next({values:{...Ie}})}c={mount:ne.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!h.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!hr(Ie),l.watch=!!t.shouldUnregister,l.keepIsValid=!!ne.keepIsValid,l.action=!1,ne.keepErrors||(n.errors={}),v.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Ae?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!ho(K,o)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ae?{}:ne.keepDirtyValues?ne.keepDefaultValues&&s?xd(o,s):n.dirtyFields:ne.keepDefaultValues&&K?xd(o,K):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Be=(K,ne)=>rt(Or(K)?K(s):K,{...t.resetOptions,...ne}),Qe=(K,ne={})=>{const ae=De(r,K),Oe=ae&&ae._f;if(Oe){const Ae=Oe.refs?Oe.refs[0]:Oe.ref;Ae.focus&&setTimeout(()=>{Ae.focus(),ne.shouldSelect&&Or(Ae.select)&&Ae.select()})}},Me=K=>{n={...n,...K}},Ue={control:{register:ve,unregister:Y,getFieldState:U,handleSubmit:Te,setError:fe,_subscribe:xe,_runSchema:L,_updateIsValidating:S,_focusError:se,_getWatch:ie,_getDirty:Z,_setValid:x,_setFieldArray:T,_setDisabledField:re,_setErrors:O,_getFieldArray:H,_reset:rt,_resetDefaultValues:()=>Or(t.defaultValues)&&t.defaultValues().then(K=>{Be(K,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:Se,_subjects:v,_proxyFormState:h,get _fields(){return r},get _formValues(){return s},get _state(){return l},set _state(K){l=K},get _defaultValues(){return o},get _names(){return c},set _names(K){c=K},get _formState(){return n},get _options(){return t},set _options(K){t={...t,...K}}},subscribe:je,trigger:V,register:ve,handleSubmit:Te,watch:pe,setValue:le,setValues:Q,getValues:D,reset:Be,resetField:tt,clearErrors:X,unregister:Y,setError:fe,setFocus:Qe,getFieldState:U};return{...Ue,formControl:Ue}}var Hs=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},c_=(e,t,n={})=>n.shouldFocus||tn(n.shouldFocus)?n.focusName||`${e}.${tn(n.focusIndex)?t:n.focusIndex}.`:"",u_=(e,t)=>[...e,...Xr(t)],d_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function f_(e,t,n){return[...e.slice(0,t),...Xr(n),...e.slice(t)]}var h_=(e,t,n)=>Array.isArray(e)?(tn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],p_=(e,t)=>[...Xr(t),...Xr(e)];function PK(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return Hg(r).length?r:[]}var m_=(e,t)=>tn(t)?[]:PK(e,Xr(t).sort((n,r)=>n-r)),g_=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},dC=(e,t,n)=>(e[t]=n,e);function Bce(e){const t=Gg(),{control:n=t,name:r,keyName:o="id",shouldUnregister:s,rules:l}=e,[c,d]=ee.useState(n._getFieldArray(r)),f=ee.useRef(n._getFieldArray(r).map(Hs)),p=ee.useRef(!1);n._names.array.add(r),ee.useMemo(()=>l&&c.length>=0&&n.register(r,l),[n,r,c.length,l]),Kg(()=>n._subjects.array.subscribe({next:({values:R,name:O})=>{if(O===r||!O){const A=De(R,r);Array.isArray(A)&&(d(A),f.current=A.map(Hs))}}}).unsubscribe,[n,r]);const h=ee.useCallback(R=>{p.current=!0,n._setFieldArray(r,R)},[n,r]),g=(R,O)=>{const A=Xr(on(R)),I=u_(n._getFieldArray(r),A);n._names.focus=c_(r,I.length-1,O),f.current=u_(f.current,A.map(Hs)),h(I),d(I),n._setFieldArray(r,I,u_,{argA:d_(R)})},v=(R,O)=>{const A=Xr(on(R)),I=p_(n._getFieldArray(r),A);n._names.focus=c_(r,0,O),f.current=p_(f.current,A.map(Hs)),h(I),d(I),n._setFieldArray(r,I,p_,{argA:d_(R)})},_=R=>{const O=m_(n._getFieldArray(r),R);f.current=m_(f.current,R),h(O),d(O),!Array.isArray(De(n._fields,r))&&zt(n._fields,r,void 0),n._setFieldArray(r,O,m_,{argA:R})},b=(R,O,A)=>{const I=Xr(on(O)),M=f_(n._getFieldArray(r),R,I);n._names.focus=c_(r,R,A),f.current=f_(f.current,R,I.map(Hs)),h(M),d(M),n._setFieldArray(r,M,f_,{argA:R,argB:d_(O)})},x=(R,O)=>{const A=n._getFieldArray(r);g_(A,R,O),g_(f.current,R,O),h(A),d(A),n._setFieldArray(r,A,g_,{argA:R,argB:O},!1)},S=(R,O)=>{const A=n._getFieldArray(r);h_(A,R,O),h_(f.current,R,O),h(A),d(A),n._setFieldArray(r,A,h_,{argA:R,argB:O},!1)},E=(R,O)=>{const A=on(O),I=dC(n._getFieldArray(r),R,A);f.current=[...I].map((M,L)=>!M||L===R?Hs():f.current[L]),h(I),d([...I]),n._setFieldArray(r,I,dC,{argA:R,argB:A},!0,!1)},T=R=>{const O=Xr(on(R));f.current=O.map(Hs),h([...O]),d([...O]),n._setFieldArray(r,[...O],A=>A,{},!0,!1)};return ee.useEffect(()=>{n._state.action=!1,Jb(r,n._names)&&n._subjects.state.next({...n._formState});const R=Ac(n._options.mode);if(p.current&&(!R.isOnSubmit||n._formState.isSubmitted)&&!Ac(n._options.reValidateMode).isOnSubmit&&!R.isOnBlur)if(n._options.resolver)n._runSchema([r]).then(O=>{n._updateIsValidating([r]);const A=De(O.errors,r),I=De(n._formState.errors,r);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?zt(n._formState.errors,r,A):Cn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const O=De(n._fields,r);O&&O._f&&!(Ac(n._options.reValidateMode).isOnSubmit&&Ac(n._options.mode).isOnSubmit)&&e1(O,n._names.disabled,n._formValues,n._options.criteriaMode===jo.all,n._options.shouldUseNativeValidation,!0).then(A=>!hr(A)&&n._subjects.state.next({errors:QN(n._formState.errors,A,r)}))}n._subjects.state.next({name:r,values:on(n._formValues)}),n._names.focus&&Lc(n._fields,(O,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&O.focus)return O.focus(),1}),n._names.focus="",n._setValid(),p.current=!1},[c,r,n]),ee.useEffect(()=>(!De(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(O,A)=>{const I=De(n._fields,O);I&&I._f&&(I._f.mount=A)};n._options.shouldUnregister||s?n.unregister(r):R(r,!1)}),[r,n,o,s]),{swap:ee.useCallback(x,[h,r,n]),move:ee.useCallback(S,[h,r,n]),prepend:ee.useCallback(v,[h,r,n]),append:ee.useCallback(g,[h,r,n]),remove:ee.useCallback(_,[h,r,n]),insert:ee.useCallback(b,[h,r,n]),update:ee.useCallback(E,[h,r,n]),replace:ee.useCallback(T,[h,r,n]),fields:ee.useMemo(()=>c.map((R,O)=>({...R,[o]:f.current[O]||Hs()})),[c,o])}}function Ci(e={}){const t=ee.useRef(void 0),n=ee.useRef(void 0),[r,o]=ee.useState({isDirty:!1,isValidating:!1,isLoading:Or(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Or(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Or(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...c}=IK(e);t.current={...c,formState:r}}const s=t.current.control;return s._options=e,Kg(()=>{const l=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),s._formState.isReady=!0,l},[s]),ee.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),ee.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),ee.useEffect(()=>{if(s._proxyFormState.isDirty){const l=s._getDirty();l!==r.isDirty&&s._subjects.state.next({isDirty:l})}},[s,r.isDirty]),ee.useEffect(()=>{var l;e.values&&!ho(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((l=s._options.resetOptions)===null||l===void 0)&&l.keepIsValid||s._setValid(),n.current=e.values,o(c=>({...c}))):s._resetDefaultValues()},[s,e.values]),ee.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=ee.useMemo(()=>VN(r,s),[s,r]),t.current}function fC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mf(...e){return t=>{let n=!1;const r=e.map(o=>{const s=fC(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():fC(e[o],null)}}}}function er(...e){return P.useCallback(mf(...e),e)}var MK=Symbol.for("react.lazy"),Zm=xw[" use ".trim().toString()];function NK(e){return typeof e=="object"&&e!==null&&"then"in e}function XN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MK&&"_payload"in e&&NK(e._payload)}function JN(e){const t=kK(e),n=P.forwardRef((r,o)=>{let{children:s,...l}=r;XN(s)&&typeof Zm=="function"&&(s=Zm(s._payload));const c=P.Children.toArray(s),d=c.find(LK);if(d){const f=d.props.children,p=c.map(h=>h===d?P.Children.count(f)>1?P.Children.only(null):P.isValidElement(f)?f.props.children:null:h);return C.jsx(t,{...l,ref:o,children:P.isValidElement(f)?P.cloneElement(f,void 0,p):null})}return C.jsx(t,{...l,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var sS=JN("Slot");function kK(e){const t=P.forwardRef((n,r)=>{let{children:o,...s}=n;if(XN(o)&&typeof Zm=="function"&&(o=Zm(o._payload)),P.isValidElement(o)){const l=jK(o),c=$K(s,o.props);return o.type!==P.Fragment&&(c.ref=r?mf(r,l):l),P.cloneElement(o,c)}return P.Children.count(o)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DK=Symbol("radix.slottable");function LK(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DK}function $K(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function jK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const hC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,pC=Yw,e4=(e,t)=>n=>{var r;if(t?.variants==null)return pC(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(f=>{const p=n?.[f],h=s?.[f];if(p===null)return null;const g=hC(p)||hC(h);return o[f][g]}),c=n&&Object.entries(n).reduce((f,p)=>{let[h,g]=p;return g===void 0||(f[h]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:h,className:g,...v}=p;return Object.entries(v).every(_=>{let[b,x]=_;return Array.isArray(x)?x.includes({...s,...c}[b]):{...s,...c}[b]===x})?[...f,h,g]:f},[]);return pC(e,l,d,n?.class,n?.className)},mC=(e,t,n)=>{if(e&&"reportValidity"in e){const r=De(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},t1=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?mC(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>mC(o,n,e))}},gC=(e,t)=>{t.shouldUseNativeValidation&&t1(e,t);const n={};for(const r in e){const o=De(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(zK(t.names||Object.keys(e),r)){const l=Object.assign({},De(n,r));zt(l,"root",s),zt(n,r,l)}else zt(n,r,s)}return n},zK=(e,t)=>{const n=vC(t);return e.some(r=>vC(r).match(`^${n}\\.\\d+`))};function vC(e){return e.replace(/\]|\[/g,"")}function yC(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function UK(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,l=r.path.join(".");if(!n[l])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[l]={message:c.message,type:c.code}}else n[l]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(p){return p.errors.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=rS(l,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n}function FK(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,l=r.path.join(".");if(!n[l])if(r.code==="invalid_union"&&r.errors.length>0){var c=r.errors[0][0];n[l]={message:c.message,type:c.code}}else n[l]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(p){return p.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=rS(l,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n}function Ai(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(yC(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return s.shouldUseNativeValidation&&t1({},s),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(c){return Array.isArray(c?.issues)})(l))return{values:{},errors:gC(UK(l.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(yC(function(){return Promise.resolve((n.mode==="sync"?H9:G9)(e,r,t)).then(function(l){return s.shouldUseNativeValidation&&t1({},s),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(c){return c instanceof zw})(l))return{values:{},errors:gC(FK(l.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}function ct(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function BK(e,t){const n=P.createContext(t),r=s=>{const{children:l,...c}=s,d=P.useMemo(()=>c,Object.values(c));return C.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function o(s){const l=P.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function vl(e,t=[]){let n=[];function r(s,l){const c=P.createContext(l),d=n.length;n=[...n,l];const f=h=>{const{scope:g,children:v,..._}=h,b=g?.[e]?.[d]||c,x=P.useMemo(()=>_,Object.values(_));return C.jsx(b.Provider,{value:x,children:v})};f.displayName=s+"Provider";function p(h,g){const v=g?.[e]?.[d]||c,_=P.useContext(v);if(_)return _;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[f,p]}const o=()=>{const s=n.map(l=>P.createContext(l));return function(c){const d=c?.[e]||s;return P.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return o.scopeName=e,[r,VK(o,...t)]}function VK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const l=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(s)[`__scope${f}`];return{...c,...h}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ri=globalThis?.document?P.useLayoutEffect:()=>{},qK=xw[" useId ".trim().toString()]||(()=>{}),HK=0;function la(e){const[t,n]=P.useState(qK());return ri(()=>{n(r=>r??String(HK++))},[e]),e||(t?`radix-${t}`:"")}var GK=xw[" useInsertionEffect ".trim().toString()]||ri;function gf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,l]=KK({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:o;{const p=P.useRef(e!==void 0);P.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=P.useCallback(p=>{if(c){const h=ZK(p)?p(e):p;h!==e&&l.current?.(h)}else s(p)},[c,e,s,l]);return[d,f]}function KK({defaultProp:e,onChange:t}){const[n,r]=P.useState(e),o=P.useRef(n),s=P.useRef(t);return GK(()=>{s.current=t},[t]),P.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function ZK(e){return typeof e=="function"}function Xd(e){const t=YK(e),n=P.forwardRef((r,o)=>{const{children:s,...l}=r,c=P.Children.toArray(s),d=c.find(WK);if(d){const f=d.props.children,p=c.map(h=>h===d?P.Children.count(f)>1?P.Children.only(null):P.isValidElement(f)?f.props.children:null:h);return C.jsx(t,{...l,ref:o,children:P.isValidElement(f)?P.cloneElement(f,void 0,p):null})}return C.jsx(t,{...l,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function YK(e){const t=P.forwardRef((n,r)=>{const{children:o,...s}=n;if(P.isValidElement(o)){const l=XK(o),c=QK(s,o.props);return o.type!==P.Fragment&&(c.ref=r?mf(r,l):l),P.cloneElement(o,c)}return P.Children.count(o)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var t4=Symbol("radix.slottable");function Vce(e){const t=({children:n})=>C.jsx(C.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=t4,t}function WK(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===t4}function QK(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function XK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var JK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sn=JK.reduce((e,t)=>{const n=Xd(`Primitive.${t}`),r=P.forwardRef((o,s)=>{const{asChild:l,...c}=o,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(d,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function n4(e,t){e&&kg.flushSync(()=>e.dispatchEvent(t))}function oi(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...n)=>t.current?.(...n),[])}function eZ(e,t=globalThis?.document){const n=oi(e);P.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var tZ="DismissableLayer",n1="dismissableLayer.update",nZ="dismissableLayer.pointerDownOutside",rZ="dismissableLayer.focusOutside",_C,r4=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aS=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=e,f=P.useContext(r4),[p,h]=P.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=P.useState({}),_=er(t,I=>h(I)),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),E=p?b.indexOf(p):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,R=E>=S,O=sZ(I=>{const M=I.target,L=[...f.branches].some(q=>q.contains(M));!R||L||(o?.(I),l?.(I),I.defaultPrevented||c?.())},g),A=aZ(I=>{const M=I.target;[...f.branches].some(q=>q.contains(M))||(s?.(I),l?.(I),I.defaultPrevented||c?.())},g);return eZ(I=>{E===f.layers.size-1&&(r?.(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},g),P.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(_C=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),bC(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=_C)}},[p,g,n,f]),P.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),bC())},[p,f]),P.useEffect(()=>{const I=()=>v({});return document.addEventListener(n1,I),()=>document.removeEventListener(n1,I)},[]),C.jsx(Sn.div,{...d,ref:_,style:{pointerEvents:T?R?"auto":"none":void 0,...e.style},onFocusCapture:ct(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ct(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ct(e.onPointerDownCapture,O.onPointerDownCapture)})});aS.displayName=tZ;var oZ="DismissableLayerBranch",iZ=P.forwardRef((e,t)=>{const n=P.useContext(r4),r=P.useRef(null),o=er(t,r);return P.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),C.jsx(Sn.div,{...e,ref:o})});iZ.displayName=oZ;function sZ(e,t=globalThis?.document){const n=oi(e),r=P.useRef(!1),o=P.useRef(()=>{});return P.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let d=function(){o4(nZ,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function aZ(e,t=globalThis?.document){const n=oi(e),r=P.useRef(!1);return P.useEffect(()=>{const o=s=>{s.target&&!r.current&&o4(rZ,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bC(){const e=new CustomEvent(n1);document.dispatchEvent(e)}function o4(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?n4(o,s):o.dispatchEvent(s)}var v_="focusScope.autoFocusOnMount",y_="focusScope.autoFocusOnUnmount",wC={bubbles:!1,cancelable:!0},lZ="FocusScope",lS=P.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...l}=e,[c,d]=P.useState(null),f=oi(o),p=oi(s),h=P.useRef(null),g=er(t,b=>d(b)),v=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(r){let b=function(T){if(v.paused||!c)return;const R=T.target;c.contains(R)?h.current=R:Xs(h.current,{select:!0})},x=function(T){if(v.paused||!c)return;const R=T.relatedTarget;R!==null&&(c.contains(R)||Xs(h.current,{select:!0}))},S=function(T){if(document.activeElement===document.body)for(const O of T)O.removedNodes.length>0&&Xs(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const E=new MutationObserver(S);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),E.disconnect()}}},[r,c,v.paused]),P.useEffect(()=>{if(c){EC.add(v);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(v_,wC);c.addEventListener(v_,f),c.dispatchEvent(S),S.defaultPrevented||(cZ(pZ(i4(c)),{select:!0}),document.activeElement===b&&Xs(c))}return()=>{c.removeEventListener(v_,f),setTimeout(()=>{const S=new CustomEvent(y_,wC);c.addEventListener(y_,p),c.dispatchEvent(S),S.defaultPrevented||Xs(b??document.body,{select:!0}),c.removeEventListener(y_,p),EC.remove(v)},0)}}},[c,f,p,v]);const _=P.useCallback(b=>{if(!n&&!r||v.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(x&&S){const E=b.currentTarget,[T,R]=uZ(E);T&&R?!b.shiftKey&&S===R?(b.preventDefault(),n&&Xs(T,{select:!0})):b.shiftKey&&S===T&&(b.preventDefault(),n&&Xs(R,{select:!0})):S===E&&b.preventDefault()}},[n,r,v.paused]);return C.jsx(Sn.div,{tabIndex:-1,...l,ref:g,onKeyDown:_})});lS.displayName=lZ;function cZ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xs(r,{select:t}),document.activeElement!==n)return}function uZ(e){const t=i4(e),n=SC(t,e),r=SC(t.reverse(),e);return[n,r]}function i4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function SC(e,t){for(const n of e)if(!dZ(n,{upTo:t}))return n}function dZ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fZ(e){return e instanceof HTMLInputElement&&"select"in e}function Xs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fZ(e)&&t&&e.select()}}var EC=hZ();function hZ(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xC(e,t),e.unshift(t)},remove(t){e=xC(e,t),e[0]?.resume()}}}function xC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pZ(e){return e.filter(t=>t.tagName!=="A")}var mZ="Portal",cS=P.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=P.useState(!1);ri(()=>s(!0),[]);const l=n||o&&globalThis?.document?.body;return l?KM.createPortal(C.jsx(Sn.div,{...r,ref:t}),l):null});cS.displayName=mZ;function gZ(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var gs=e=>{const{present:t,children:n}=e,r=vZ(t),o=typeof n=="function"?n({present:r.isPresent}):P.Children.only(n),s=er(r.ref,yZ(o));return typeof n=="function"||r.isPresent?P.cloneElement(o,{ref:s}):null};gs.displayName="Presence";function vZ(e){const[t,n]=P.useState(),r=P.useRef(null),o=P.useRef(e),s=P.useRef("none"),l=e?"mounted":"unmounted",[c,d]=gZ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const f=lp(r.current);s.current=c==="mounted"?f:"none"},[c]),ri(()=>{const f=r.current,p=o.current;if(p!==e){const g=s.current,v=lp(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),ri(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=v=>{const b=lp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=v=>{v.target===t&&(s.current=lp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:P.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function lp(e){return e?.animationName||"none"}function yZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var __=0;function s4(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??RC()),document.body.insertAdjacentElement("beforeend",e[1]??RC()),__++,()=>{__===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),__--}},[])}function RC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Si=function(){return Si=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Si.apply(this,arguments)};function a4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function _Z(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var bm="right-scroll-bar-position",wm="width-before-scroll-bar",bZ="with-scroll-bars-hidden",wZ="--removed-body-scroll-bar-size";function b_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function SZ(e,t){var n=P.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var EZ=typeof window<"u"?P.useLayoutEffect:P.useEffect,OC=new WeakMap;function xZ(e,t){var n=SZ(null,function(r){return e.forEach(function(o){return b_(o,r)})});return EZ(function(){var r=OC.get(n);if(r){var o=new Set(r),s=new Set(e),l=n.current;o.forEach(function(c){s.has(c)||b_(c,null)}),s.forEach(function(c){o.has(c)||b_(c,l)})}OC.set(n,e)},[e]),n}function RZ(e){return e}function OZ(e,t){t===void 0&&(t=RZ);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(s),l=n}var d=function(){var p=l;l=[],p.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return o}function TZ(e){e===void 0&&(e={});var t=OZ(null);return t.options=Si({async:!0,ssr:!1},e),t}var l4=function(e){var t=e.sideCar,n=a4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return P.createElement(r,Si({},n))};l4.isSideCarExport=!0;function CZ(e,t){return e.useMedium(t),l4}var c4=TZ(),w_=function(){},Zg=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:w_,onWheelCapture:w_,onTouchMoveCapture:w_}),o=r[0],s=r[1],l=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,_=e.noIsolation,b=e.inert,x=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,T=e.gapMode,R=a4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=xZ([n,t]),I=Si(Si({},R),o);return P.createElement(P.Fragment,null,p&&P.createElement(O,{sideCar:c4,removeScrollBar:f,shards:h,noRelative:v,noIsolation:_,inert:b,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:T}),l?P.cloneElement(P.Children.only(c),Si(Si({},I),{ref:A})):P.createElement(E,Si({},I,{className:d,ref:A}),c))});Zg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zg.classNames={fullWidth:wm,zeroRight:bm};var AZ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IZ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=AZ();return t&&e.setAttribute("nonce",t),e}function PZ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function MZ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var NZ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=IZ())&&(PZ(t,n),MZ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kZ=function(){var e=NZ();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},u4=function(){var e=kZ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},DZ={left:0,top:0,right:0,gap:0},S_=function(e){return parseInt(e||"",10)||0},LZ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[S_(n),S_(r),S_(o)]},$Z=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return DZ;var t=LZ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jZ=u4(),$c="data-scroll-locked",zZ=function(e,t,n,r){var o=e.left,s=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
+
`}),C.jsx(VG,{}),e]})}function VG(){const{executeRecaptcha:e}=MN(),{theme:t}=Xw(),{lang:n}=kN();return P.useEffect(()=>{if(!e)return;(async()=>{const o=document.querySelector("iframe[title='reCAPTCHA']");if(o){const s=new URL(o.src);s.searchParams.set("theme",t),n&&s.searchParams.set("hl",n),o.src=s.toString()}})()},[e,t,n]),null}function qG({slug:e}={}){const{organization:t,hooks:{useActiveOrganization:n,useListOrganizations:r}}=P.useContext(vt),{pathMode:o,slug:s}=t||{};let l,c,d,f;const{data:p,isPending:h,isRefetching:g}=r();if(o==="slug"){const v=e||s;l=p?.find(_=>_.slug===v),c=h,d=g}else{const{data:v,isPending:_,isRefetching:b,refetch:x}=n();f=x,l=v,c=_,d=b}return P.useMemo(()=>({data:l,isPending:c,isRefetching:d,refetch:f}),[l,c,d,f])}var HG=()=>{const{hooks:{useListOrganizations:e,useSession:t},organization:n,navigate:r,redirectTo:o}=P.useContext(vt),{slug:s,pathMode:l,personalPath:c}=n||{},{data:d}=t(),{data:f,isPending:p,isRefetching:h,refetch:g}=qG(),{refetch:v}=e(),{data:_}=e();return P.useEffect(()=>{d?.user.id&&(f||_)&&(g?.(),v?.())},[d?.user.id]),P.useEffect(()=>{h||p||s&&l==="slug"&&!f&&r(c||o)},[f,h,p,s,l,c,r,o]),null},GG=({href:e,className:t,children:n})=>C.jsx("a",{className:t,href:e,children:n}),KG=e=>{window.location.href=e},ZG=e=>{window.location.replace(e)},YG=({variant:e="default",message:t})=>{e==="default"?QT(t):QT[e](t)},vt=P.createContext({}),WG=({children:e,authClient:t,account:n,avatar:r,deleteUser:o,social:s,genericOAuth:l,basePath:c="/auth",baseURL:d="",captcha:f,redirectTo:p="/",credentials:h,changeEmail:g=!0,freshAge:v=3600*24,hooks:_,mutators:b,localization:x,localizeErrors:S=!0,nameRequired:E=!0,organization:T,teams:R,signUp:O=!0,toast:A=YG,viewPaths:I,navigate:M,replace:L,Link:q=GG,emailVerification:j,...B})=>{const F=t,Z=P.useMemo(()=>{if(r)return r===!0?{extension:"png",size:128}:{upload:r.upload,delete:r.delete,extension:r.extension||"png",size:r.size||(r.upload?256:128),Image:r.Image}},[r]),ie=P.useMemo(()=>{if(j)return j===!0?{otp:!1}:{otp:j.otp??!1}},[j]),H=P.useMemo(()=>{var Y;return n===!1?void 0:n===!0||n===void 0?{basePath:"/account",fields:["image","name"],viewPaths:YT}:{basePath:((Y=n.basePath)!=null&&Y.endsWith("/")?n.basePath.slice(0,-1):n.basePath)??"/account",fields:n.fields||["image","name"],viewPaths:{...YT,...n.viewPaths}}},[n]),W=P.useMemo(()=>{if(o)return o===!0?{}:o},[o]),te=P.useMemo(()=>{if(s)return s},[s]),le=P.useMemo(()=>{if(l)return l},[l]),Q=P.useMemo(()=>{if(h!==!1)return h===!0?{forgotPassword:!0,usernameRequired:!0}:{...h,forgotPassword:h?.forgotPassword??!0,usernameRequired:h?.usernameRequired??!0}},[h]),k=P.useMemo(()=>{if(O!==!1)return O===!0||O===void 0?{fields:["name"]}:{fields:O.fields||["name"]}},[O]),G=P.useMemo(()=>{var Y;if(!T)return;if(T===!0)return{basePath:"/organization",viewPaths:WT,customRoles:[]};let re;T.logo===!0?re={extension:"png",size:128}:T.logo&&(re={upload:T.logo.upload,delete:T.logo.delete,extension:T.logo.extension||"png",size:T.logo.size||(T.logo.upload?256:128)});const ve=(Y=T.basePath)!=null&&Y.endsWith("/")?T.basePath.slice(0,-1):T.basePath;return{...T,logo:re,basePath:ve??"/organization",customRoles:T.customRoles||[],viewPaths:{...WT,...T.viewPaths}}},[T]),V=P.useMemo(()=>{var Y,re;if(!(!R||!G))return R===!0?{enabled:!0,customRoles:[],colors:{count:5,prefix:"team"}}:{enabled:R.enabled??!0,customRoles:R.customRoles||[],colors:{count:((Y=R.colors)==null?void 0:Y.count)??5,prefix:((re=R.colors)==null?void 0:re.prefix)??"team"}}},[R,G]),D=P.useMemo(()=>({deleteApiKey:Y=>F.apiKey.delete({...Y,fetchOptions:{throw:!0}}),deletePasskey:Y=>F.passkey.deletePasskey({...Y,fetchOptions:{throw:!0}}),revokeDeviceSession:Y=>F.multiSession.revoke({...Y,fetchOptions:{throw:!0}}),revokeSession:Y=>F.revokeSession({...Y,fetchOptions:{throw:!0}}),setActiveSession:Y=>F.multiSession.setActive({...Y,fetchOptions:{throw:!0}}),updateOrganization:Y=>F.organization.update({...Y,fetchOptions:{throw:!0}}),updateTeam:Y=>F.$fetch("/organization/update-team",{method:"POST",body:Y,throw:!0}),updateUser:Y=>F.updateUser({...Y,fetchOptions:{throw:!0}}),unlinkAccount:Y=>F.unlinkAccount({...Y,fetchOptions:{throw:!0}})}),[F]),U=P.useMemo(()=>({useSession:F.useSession,useListAccounts:()=>ao({queryFn:F.listAccounts,cacheKey:"listAccounts"}),useAccountInfo:Y=>ao({queryFn:()=>F.accountInfo(Y),cacheKey:`accountInfo:${JSON.stringify(Y)}`}),useListDeviceSessions:()=>ao({queryFn:F.multiSession.listDeviceSessions,cacheKey:"listDeviceSessions"}),useListSessions:()=>ao({queryFn:F.listSessions,cacheKey:"listSessions"}),useListPasskeys:F.useListPasskeys,useListApiKeys:()=>ao({queryFn:F.apiKey.list,cacheKey:"listApiKeys"}),useActiveOrganization:F.useActiveOrganization,useListOrganizations:F.useListOrganizations,useHasPermission:Y=>ao({queryFn:()=>F.$fetch("/organization/has-permission",{method:"POST",body:Y}),cacheKey:`hasPermission:${JSON.stringify(Y)}`}),useInvitation:Y=>ao({queryFn:()=>F.organization.getInvitation(Y),cacheKey:`invitation:${JSON.stringify(Y)}`}),useListInvitations:Y=>ao({queryFn:()=>{var re;return F.$fetch(`/organization/list-invitations?organizationId=${((re=Y?.query)==null?void 0:re.organizationId)||""}`)},cacheKey:`listInvitations:${JSON.stringify(Y)}`}),useListUserInvitations:()=>ao({queryFn:()=>F.$fetch("/organization/list-user-invitations"),cacheKey:"listUserInvitations"}),useListMembers:Y=>ao({queryFn:()=>{var re;return F.$fetch(`/organization/list-members?organizationId=${((re=Y?.query)==null?void 0:re.organizationId)||""}`)},cacheKey:`listMembers:${JSON.stringify(Y)}`}),useListTeams:Y=>ao({queryFn:()=>F.$fetch(`/organization/list-teams?organizationId=${Y?.organizationId||""}`),cacheKey:`listTeams:${JSON.stringify(Y)}`}),useListTeamMembers:Y=>ao({queryFn:()=>F.$fetch("/organization/list-team-members",{method:"POST",body:Y?.teamId?{query:{teamId:Y.teamId}}:void 0}),cacheKey:`listTeamMembers:${JSON.stringify(Y)}`}),useListUserTeams:()=>ao({queryFn:()=>F.$fetch("/organization/list-user-teams"),cacheKey:"listUserTeams"})}),[F]),X=P.useMemo(()=>({...JH,...I}),[I]),fe=P.useMemo(()=>({...XH,...x}),[x]),pe=P.useMemo(()=>({...U,..._}),[U,_]),xe=P.useMemo(()=>({...D,...b}),[D,b]);d=d.endsWith("/")?d.slice(0,-1):d,c=c.endsWith("/")?c.slice(0,-1):c;const{data:je}=pe.useSession();return C.jsxs(vt.Provider,{value:{authClient:F,avatar:Z,basePath:c==="/"?"":c,baseURL:d,captcha:f,redirectTo:p,changeEmail:g,credentials:Q,deleteUser:W,emailVerification:ie,freshAge:v,genericOAuth:le,hooks:pe,mutators:xe,localization:fe,localizeErrors:S,nameRequired:E,organization:G,teams:V,account:H,signUp:k,social:te,toast:A,navigate:M||KG,replace:L||M||ZG,viewPaths:X,Link:q,...B},children:[je&&G&&C.jsx(HG,{}),f?.provider==="google-recaptcha-v3"?C.jsx(BG,{children:e}):e]})};function ao({queryFn:e,cacheKey:t,staleTime:n=1e4}){var r;const{hooks:{useSession:o},toast:s,localization:l,localizeErrors:c}=P.useContext(vt),{data:d,isPending:f}=o(),p=P.useRef(e);p.current=e;const h=t||e.toString(),g=P.useSyncExternalStore(P.useCallback(T=>No.subscribe(h,T),[h]),P.useCallback(()=>No.get(h),[h]),P.useCallback(()=>No.get(h),[h])),v=P.useRef(!1),_=P.useRef(void 0),[b,x]=P.useState(null),S=P.useCallback(async()=>{const T=No.getInFlightRequest(h);if(T){try{const O=await T;O.error?x(O.error):x(null)}catch(O){x(O)}return}g?.data!==void 0&&No.setRefetching(h,!0);const R=p.current();No.setInFlightRequest(h,R);try{const{data:O,error:A}=await R;A?(x(A),s({variant:"error",message:kn({error:A,localization:l,localizeErrors:c})})):x(null),No.set(h,O)}catch(O){const A=O;x(A),s({variant:"error",message:kn({error:A,localization:l,localizeErrors:c})})}finally{No.setRefetching(h,!1),No.removeInFlightRequest(h)}},[h,s,l,c,g]);P.useEffect(()=>{var T;const R=(T=d?.user)==null?void 0:T.id;if(!d){No.setRefetching(h,!1),No.clear(h),v.current=!1,_.current=void 0;return}const O=_.current!==void 0&&_.current!==R;O&&No.clear(h);const A=g?.data!==void 0,I=!g||Date.now()-g.timestamp>n;(!v.current||!A||O||A&&I)&&(!A||I)&&(v.current=!0,S()),_.current=R},[d,(r=d?.user)==null?void 0:r.id,h,S,g,n]);const E=f||g?.data===void 0&&!b;return{data:g?.data??null,isPending:E,isRefetching:g?.isRefetching??!1,error:b,refetch:S}}const QG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),DN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var XG={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const JG=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:l,...c},d)=>P.createElement("svg",{ref:d,...XG,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:DN("lucide",o),...c},[...l.map(([f,p])=>P.createElement(f,p)),...Array.isArray(s)?s:[s]]));const Ir=(e,t)=>{const n=P.forwardRef(({className:r,...o},s)=>P.createElement(JG,{ref:s,iconNode:t,className:DN(`lucide-${QG(e)}`,r),...o}));return n.displayName=`${e}`,n};const eK=Ir("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const tK=Ir("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);const LN=Ir("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const nK=Ir("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const rK=Ir("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const oK=Ir("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const iK=Ir("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);const Ar=Ir("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const $N=Ir("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const jN=Ir("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);const sK=Ir("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const aK=Ir("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);const nC=Ir("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const lK=Ir("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const cK=Ir("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);const uK=Ir("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var pf=e=>e.type==="checkbox",rl=e=>e instanceof Date,jr=e=>e==null;const zN=e=>typeof e=="object";var Nn=e=>!jr(e)&&!Array.isArray(e)&&zN(e)&&!rl(e),UN=e=>Nn(e)&&e.target?pf(e.target)?e.target.checked:e.target.value:e,FN=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),dK=e=>{const t=e.constructor&&e.constructor.prototype;return Nn(t)&&t.hasOwnProperty("isPrototypeOf")},Jw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function rn(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Jw&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Nn(e)&&dK(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=rn(e[o]));return r}var qg=e=>/^\w*$/.test(e),tn=e=>e===void 0,Hg=e=>Array.isArray(e)?e.filter(Boolean):[],eS=e=>Hg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,n)=>{if(!t||!Nn(e))return n;const o=(qg(t)?[t]:eS(t)).reduce((s,l)=>jr(s)?void 0:s[l],e);return tn(o)||o===e?tn(e[t])?n:e[t]:o},fo=e=>typeof e=="boolean",Or=e=>typeof e=="function",zt=(e,t,n)=>{let r=-1;const o=qg(t)?[t]:eS(t),s=o.length,l=s-1;for(;++r<s;){const c=o[r];let d=n;if(r!==l){const f=e[c];d=Nn(f)||Array.isArray(f)?f:isNaN(+o[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const ea={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},jo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Jo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},a_="form",BN="root",tS=ee.createContext(null);tS.displayName="HookFormControlContext";const Gg=()=>ee.useContext(tS);var VN=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const l=s;return t._proxyFormState[l]!==jo.all&&(t._proxyFormState[l]=!r||jo.all),n&&(n[l]=!0),e[l]}});return o};const Kg=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;function qN(e){const t=Gg(),{control:n=t,disabled:r,name:o,exact:s}=e||{},[l,c]=ee.useState(n._formState),d=ee.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Kg(()=>n._subscribe({name:o,formState:d.current,exact:s,callback:f=>{!r&&c({...n._formState,...f})}}),[o,r,s]),ee.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),ee.useMemo(()=>VN(l,n,d.current,!1),[l,n])}var Tr=e=>typeof e=="string",Wb=(e,t,n,r,o)=>Tr(e)?(r&&t.watch.add(e),De(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),De(n,s))):(r&&(t.watchAll=!0),n),Qb=e=>jr(e)||!zN(e);function ho(e,t,n=new WeakSet){if(e===t)return!0;if(Qb(e)||Qb(t))return Object.is(e,t);if(rl(e)&&rl(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const l=e[s];if(!(s in t))return!1;if(s!=="ref"){const c=t[s];if(rl(l)&&rl(c)||(Nn(l)||Array.isArray(l))&&(Nn(c)||Array.isArray(c))?!ho(l,c,n):!Object.is(l,c))return!1}}return!0}function fK(e){const t=Gg(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:l,compute:c}=e||{},d=ee.useRef(o),f=ee.useRef(c),p=ee.useRef(void 0),h=ee.useRef(n),g=ee.useRef(r);f.current=c;const[v,_]=ee.useState(()=>{const R=n._getWatch(r,d.current);return f.current?f.current(R):R}),b=ee.useCallback(R=>{const O=Wb(r,n._names,R||n._formValues,!1,d.current);return f.current?f.current(O):O},[n._formValues,n._names,r]),x=ee.useCallback(R=>{if(!s){const O=Wb(r,n._names,R||n._formValues,!1,d.current);if(f.current){const A=f.current(O);ho(A,p.current)||(_(A),p.current=A)}else _(O)}},[n._formValues,n._names,s,r]);Kg(()=>((h.current!==n||!ho(g.current,r))&&(h.current=n,g.current=r,x()),n._subscribe({name:r,formState:{values:!0},exact:l,callback:R=>{x(R.values)}})),[n,l,r,x]),ee.useEffect(()=>n._removeUnmounted());const S=h.current!==n,E=g.current,T=ee.useMemo(()=>{if(s)return null;const R=!S&&!ho(E,r);return S||R?b():null},[s,S,r,E,b]);return T!==null?T:v}function hK(e){const t=Gg(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:l,exact:c=!0}=e,d=FN(o._names.array,n),f=ee.useMemo(()=>De(o._formValues,n,De(o._defaultValues,n,l)),[o,n,l]),p=fK({control:o,name:n,defaultValue:f,exact:c}),h=qN({control:o,name:n,exact:c}),g=ee.useRef(e),v=ee.useRef(o.register(n,{...e.rules,value:p,...fo(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const _=ee.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(h.validatingFields,n)},error:{enumerable:!0,get:()=>De(h.errors,n)}}),[h,n]),b=ee.useCallback(T=>v.current.onChange({target:{value:UN(T),name:n},type:ea.CHANGE}),[n]),x=ee.useCallback(()=>v.current.onBlur({target:{value:De(o._formValues,n),name:n},type:ea.BLUR}),[n,o._formValues]),S=ee.useCallback(T=>{const R=De(o._fields,n);R&&R._f&&T&&(R._f.ref={focus:()=>Or(T.focus)&&T.focus(),select:()=>Or(T.select)&&T.select(),setCustomValidity:O=>Or(T.setCustomValidity)&&T.setCustomValidity(O),reportValidity:()=>Or(T.reportValidity)&&T.reportValidity()})},[o._fields,n]),E=ee.useMemo(()=>({name:n,value:p,...fo(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:b,onBlur:x,ref:S}),[n,r,h.disabled,b,x,S,p]);return ee.useEffect(()=>{const T=o._options.shouldUnregister||s;o.register(n,{...g.current.rules,...fo(g.current.disabled)?{disabled:g.current.disabled}:{}});const R=(O,A)=>{const I=De(o._fields,O);I&&I._f&&(I._f.mount=A)};if(R(n,!0),T){const O=rn(De(o._options.defaultValues,n,g.current.defaultValue));zt(o._defaultValues,n,O),tn(De(o._formValues,n))&&zt(o._formValues,n,O)}return!d&&o.register(n),()=>{(d?T&&!o._state.action:T)?o.unregister(n):R(n,!1)}},[n,o,d,s]),ee.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),ee.useMemo(()=>({field:E,formState:h,fieldState:_}),[E,h,_])}const pK=e=>e.render(hK(e)),nS=ee.createContext(null);nS.displayName="HookFormContext";const mK=()=>ee.useContext(nS),gK=e=>{const{children:t,watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:l,setValue:c,trigger:d,formState:f,resetField:p,reset:h,handleSubmit:g,unregister:v,control:_,register:b,setFocus:x,subscribe:S}=e,E=ee.useMemo(()=>({watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:l,setValue:c,trigger:d,formState:f,resetField:p,reset:h,handleSubmit:g,unregister:v,control:_,register:b,setFocus:x,subscribe:S}),[l,_,f,o,r,g,b,h,p,s,x,c,S,d,v,n]);return ee.createElement(nS.Provider,{value:E},ee.createElement(tS.Provider,{value:E.control},t))};var rS=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Xr=e=>Array.isArray(e)?e:[e],rC=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function HN(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],s=t[r];if(o&&Nn(o)&&s){const l=HN(o,s);Nn(l)&&(n[r]=l)}else e[r]&&(n[r]=s)}return n}var hr=e=>Nn(e)&&!Object.keys(e).length,oS=e=>e.type==="file",Gm=e=>{if(!Jw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},GN=e=>e.type==="select-multiple",iS=e=>e.type==="radio",vK=e=>iS(e)||pf(e),l_=e=>Gm(e)&&e.isConnected;function yK(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;){if(jr(e)){e=void 0;break}e=e[t[r]],r++}return e}function _K(e){for(const t in e)if(e.hasOwnProperty(t)&&!tn(e[t]))return!1;return!0}function Cn(e,t){if(Tr(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:qg(t)?[t]:eS(t),r=n.length===1?e:yK(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Nn(r)&&hr(r)||Array.isArray(r)&&_K(r))&&Cn(e,n.slice(0,-1)),e}var bK=e=>{for(const t in e)if(Or(e[t]))return!0;return!1};function KN(e){return Array.isArray(e)||Nn(e)&&!bK(e)}function Xb(e,t={}){for(const n in e){const r=e[n];KN(r)?(t[n]=Array.isArray(r)?[]:{},Xb(r,t[n])):tn(r)||(t[n]=!0)}return t}function xd(e,t,n){n||(n=Xb(t));for(const r in e){const o=e[r];if(KN(o))tn(t)||Qb(n[r])?n[r]=Xb(o,Array.isArray(o)?[]:{}):xd(o,jr(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!ho(o,s)}}return n}const oC={value:!1,isValid:!1},iC={value:!0,isValid:!0};var ZN=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!tn(e[0].attributes.value)?tn(e[0].value)||e[0].value===""?iC:{value:e[0].value,isValid:!0}:iC:oC}return oC},YN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>tn(e)?e:t?e===""?NaN:e&&+e:n&&Tr(e)?new Date(e):r?r(e):e;const sC={isValid:!1,value:null};var WN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,sC):sC;function aC(e){const t=e.ref;return oS(t)?t.files:iS(t)?WN(e.refs).value:GN(t)?[...t.selectedOptions].map(({value:n})=>n):pf(t)?ZN(e.refs).value:YN(tn(t.value)?e.ref.value:t.value,e)}var wK=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,SK=(e,t,n,r)=>{const o={};for(const s of e){const l=De(t,s);l&&zt(o,s,l._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Km=e=>e instanceof RegExp,id=e=>tn(e)?e:Km(e)?e.source:Nn(e)?Km(e.value)?e.value.source:e.value:e,Ac=e=>({isOnSubmit:!e||e===jo.onSubmit,isOnBlur:e===jo.onBlur,isOnChange:e===jo.onChange,isOnAll:e===jo.all,isOnTouch:e===jo.onTouched});const lC="AsyncFunction";var EK=e=>!!e&&!!e.validate&&!!(Or(e.validate)&&e.validate.constructor.name===lC||Nn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===lC)),xK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Jb=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Lc=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=De(e,o);if(s){const{_f:l,...c}=s;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],o)&&!r)return!0;if(l.ref&&t(l.ref,l.name)&&!r)return!0;if(Lc(c,t))break}else if(Nn(c)&&Lc(c,t))break}}};function cC(e,t,n){const r=De(e,n);if(r||qg(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),l=De(t,s),c=De(e,s);if(l&&!Array.isArray(l)&&n!==s)return{name:n};if(c&&c.type)return{name:s,error:c};if(c&&c.root&&c.root.type)return{name:`${s}.root`,error:c.root};o.pop()}return{name:n}}var RK=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return hr(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(l=>t[l]===(!r||jo.all))},OK=(e,t,n)=>!e||!t||e===t||Xr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),TK=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,CK=(e,t)=>!Hg(De(e,t)).length&&Cn(e,t),QN=(e,t,n)=>{const r=Xr(De(e,n));return zt(r,BN,t[n]),zt(e,n,r),e};function uC(e,t,n="validate"){if(Tr(e)||Array.isArray(e)&&e.every(Tr)||fo(e)&&!e)return{type:n,message:Tr(e)?e:"",ref:t}}var ac=e=>Nn(e)&&!Km(e)?e:{value:e,message:""},e1=async(e,t,n,r,o,s)=>{const{ref:l,refs:c,required:d,maxLength:f,minLength:p,min:h,max:g,pattern:v,validate:_,name:b,valueAsNumber:x,mount:S}=e._f,E=De(n,b);if(!S||t.has(b))return{};const T=c?c[0]:l,R=B=>{o&&T.reportValidity&&(T.setCustomValidity(fo(B)?"":B||""),T.reportValidity())},O={},A=iS(l),I=pf(l),M=A||I,L=(x||oS(l))&&tn(l.value)&&tn(E)||Gm(l)&&l.value===""||E===""||Array.isArray(E)&&!E.length||x&&typeof E=="number"&&isNaN(E),q=rS.bind(null,b,r,O),j=(B,F,Z,ie=Jo.maxLength,H=Jo.minLength)=>{const W=B?F:Z;O[b]={type:B?ie:H,message:W,ref:l,...q(B?ie:H,W)}};if(s?!Array.isArray(E)||!E.length:d&&(!M&&(L||jr(E))||fo(E)&&!E||I&&!ZN(c).isValid||A&&!WN(c).isValid)){const{value:B,message:F}=Tr(d)?{value:!!d,message:d}:ac(d);if(B&&(O[b]={type:Jo.required,message:F,ref:T,...q(Jo.required,F)},!r))return R(F),O}if(!L&&(!jr(h)||!jr(g))){let B,F;const Z=ac(g),ie=ac(h);if(!jr(E)&&!isNaN(E)){const H=l.valueAsNumber||E&&+E;jr(Z.value)||(B=H>Z.value),jr(ie.value)||(F=H<ie.value)}else{const H=l.valueAsDate||new Date(E),W=Q=>new Date(new Date().toDateString()+" "+Q),te=l.type=="time",le=l.type=="week";Tr(Z.value)&&E&&(B=te?W(E)>W(Z.value):le?E>Z.value:H>new Date(Z.value)),Tr(ie.value)&&E&&(F=te?W(E)<W(ie.value):le?E<ie.value:H<new Date(ie.value))}if((B||F)&&(j(!!B,Z.message,ie.message,Jo.max,Jo.min),!r))return R(O[b].message),O}if((f||p)&&!L&&(Tr(E)||s&&Array.isArray(E))){const B=ac(f),F=ac(p),Z=!jr(B.value)&&E.length>+B.value,ie=!jr(F.value)&&E.length<+F.value;if((Z||ie)&&(j(Z,B.message,F.message),!r))return R(O[b].message),O}if(v&&!L&&Tr(E)){const{value:B,message:F}=ac(v);if(Km(B)&&!E.match(B)&&(O[b]={type:Jo.pattern,message:F,ref:l,...q(Jo.pattern,F)},!r))return R(F),O}if(_){if(Or(_)){const B=await _(E,n),F=uC(B,T);if(F&&(O[b]={...F,...q(Jo.validate,F.message)},!r))return R(F.message),O}else if(Nn(_)){let B={};for(const F in _){if(!hr(B)&&!r)break;const Z=uC(await _[F](E,n),T,F);Z&&(B={...Z,...q(F,Z.message)},R(Z.message),r&&(O[b]=B))}if(!hr(B)&&(O[b]={ref:T,...B},!r))return O}}return R(!0),O};const AK={mode:jo.onSubmit,reValidateMode:jo.onChange,shouldFocusError:!0};function IK(e={}){let t={...AK,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Or(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Nn(t.defaultValues)||Nn(t.values)?rn(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:rn(o),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},d,f=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...p};let g={...h};const v={array:rC(),state:rC()},_=t.criteriaMode===jo.all,b=K=>ne=>{clearTimeout(f),f=setTimeout(K,ne)},x=async K=>{if(!l.keepIsValid&&!t.disabled&&(h.isValid||g.isValid||K)){let ne;t.resolver?(ne=hr((await L()).errors),S()):ne=await B({fields:r,onlyCheckValid:!0,eventType:ea.VALID}),ne!==n.isValid&&v.state.next({isValid:ne})}},S=(K,ne)=>{!t.disabled&&(h.isValidating||h.validatingFields||g.isValidating||g.validatingFields)&&((K||Array.from(c.mount)).forEach(ae=>{ae&&(ne?zt(n.validatingFields,ae,ne):Cn(n.validatingFields,ae))}),v.state.next({validatingFields:n.validatingFields,isValidating:!hr(n.validatingFields)}))},E=K=>{const ne=xd(o,s),ae=wK(K);zt(n.dirtyFields,ae,De(ne,ae))},T=(K,ne=[],ae,Oe,Ae=!0,Ie=!0)=>{if(Oe&&ae&&!t.disabled){if(l.action=!0,Ie&&Array.isArray(De(r,K))){const ke=ae(De(r,K),Oe.argA,Oe.argB);Ae&&zt(r,K,ke)}if(Ie&&Array.isArray(De(n.errors,K))){const ke=ae(De(n.errors,K),Oe.argA,Oe.argB);Ae&&zt(n.errors,K,ke),CK(n.errors,K)}if((h.touchedFields||g.touchedFields)&&Ie&&Array.isArray(De(n.touchedFields,K))){const ke=ae(De(n.touchedFields,K),Oe.argA,Oe.argB);Ae&&zt(n.touchedFields,K,ke)}(h.dirtyFields||g.dirtyFields)&&E(K),v.state.next({name:K,isDirty:Z(K,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zt(s,K,ne)},R=(K,ne)=>{zt(n.errors,K,ne),v.state.next({errors:n.errors})},O=K=>{n.errors=K,v.state.next({errors:n.errors,isValid:!1})},A=(K,ne,ae,Oe)=>{const Ae=De(r,K);if(Ae){const Ie=De(s,K,tn(ae)?De(o,K):ae);tn(Ie)||Oe&&Oe.defaultChecked||ne?zt(s,K,ne?Ie:aC(Ae._f)):W(K,Ie),l.mount&&!l.action&&x()}},I=(K,ne,ae,Oe,Ae)=>{let Ie=!1,ke=!1;const Je={name:K};if(!t.disabled){if(!ae||Oe){(h.isDirty||g.isDirty)&&(ke=n.isDirty,n.isDirty=Je.isDirty=Z(),Ie=ke!==Je.isDirty);const et=ho(De(o,K),ne);ke=!!De(n.dirtyFields,K),et?Cn(n.dirtyFields,K):zt(n.dirtyFields,K,!0),Je.dirtyFields=n.dirtyFields,Ie=Ie||(h.dirtyFields||g.dirtyFields)&&ke!==!et}if(ae){const et=De(n.touchedFields,K);et||(zt(n.touchedFields,K,ae),Je.touchedFields=n.touchedFields,Ie=Ie||(h.touchedFields||g.touchedFields)&&et!==ae)}Ie&&Ae&&v.state.next(Je)}return Ie?Je:{}},M=(K,ne,ae,Oe)=>{const Ae=De(n.errors,K),Ie=(h.isValid||g.isValid)&&fo(ne)&&n.isValid!==ne;if(t.delayError&&ae?(d=b(()=>R(K,ae)),d(t.delayError)):(clearTimeout(f),d=null,ae?zt(n.errors,K,ae):Cn(n.errors,K)),(ae?!ho(Ae,ae):Ae)||!hr(Oe)||Ie){const ke={...Oe,...Ie&&fo(ne)?{isValid:ne}:{},errors:n.errors,name:K};n={...n,...ke},v.state.next(ke)}},L=async K=>(S(K,!0),await t.resolver(s,t.context,SK(K||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),q=async K=>{const{errors:ne}=await L(K);if(S(K),K)for(const ae of K){const Oe=De(ne,ae);Oe?zt(n.errors,ae,Oe):Cn(n.errors,ae)}else n.errors=ne;return ne},j=async({name:K,eventType:ne})=>{if(e.validate){const ae=await e.validate({formValues:s,formState:n,name:K,eventType:ne});if(Nn(ae))for(const Oe in ae)ae[Oe]&&fe(`${a_}.${Oe}`,{message:Tr(ae.message)?ae.message:"",type:Jo.validate});else Tr(ae)||!ae?fe(a_,{message:ae||"",type:Jo.validate}):X(a_);return ae}return!0},B=async({fields:K,onlyCheckValid:ne,name:ae,eventType:Oe,context:Ae={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Ae.runRootValidation=!0,!await j({name:ae,eventType:Oe})&&(Ae.valid=!1,ne)))return Ae.valid;for(const Ie in K){const ke=K[Ie];if(ke){const{_f:Je,...et}=ke;if(Je){const _t=c.array.has(Je.name),Tt=ke._f&&EK(ke._f);Tt&&h.validatingFields&&S([Je.name],!0);const bt=await e1(ke,c.disabled,s,_,t.shouldUseNativeValidation&&!ne,_t);if(Tt&&h.validatingFields&&S([Je.name]),bt[Je.name]&&(Ae.valid=!1,ne)||(!ne&&(De(bt,Je.name)?_t?QN(n.errors,bt,Je.name):zt(n.errors,Je.name,bt[Je.name]):Cn(n.errors,Je.name)),e.shouldUseNativeValidation&&bt[Je.name]))break}!hr(et)&&await B({context:Ae,onlyCheckValid:ne,fields:et,name:Ie,eventType:Oe})}}return Ae.valid},F=()=>{for(const K of c.unMount){const ne=De(r,K);ne&&(ne._f.refs?ne._f.refs.every(ae=>!l_(ae)):!l_(ne._f.ref))&&Y(K)}c.unMount=new Set},Z=(K,ne)=>!t.disabled&&(K&&ne&&zt(s,K,ne),!ho(D(),o)),ie=(K,ne,ae)=>Wb(K,c,{...l.mount?s:tn(ne)?o:Tr(K)?{[K]:ne}:ne},ae,ne),H=K=>Hg(De(l.mount?s:o,K,t.shouldUnregister?De(o,K,[]):[])),W=(K,ne,ae={})=>{const Oe=De(r,K);let Ae=ne;if(Oe){const Ie=Oe._f;Ie&&(!Ie.disabled&&zt(s,K,YN(ne,Ie)),Ae=Gm(Ie.ref)&&jr(ne)?"":ne,GN(Ie.ref)?[...Ie.ref.options].forEach(ke=>ke.selected=Ae.includes(ke.value)):Ie.refs?pf(Ie.ref)?Ie.refs.forEach(ke=>{(!ke.defaultChecked||!ke.disabled)&&(Array.isArray(Ae)?ke.checked=!!Ae.find(Je=>Je===ke.value):ke.checked=Ae===ke.value||!!Ae)}):Ie.refs.forEach(ke=>ke.checked=ke.value===Ae):oS(Ie.ref)?Ie.ref.value="":(Ie.ref.value=Ae,Ie.ref.type||v.state.next({name:K,values:rn(s)})))}(ae.shouldDirty||ae.shouldTouch)&&I(K,Ae,ae.shouldTouch,ae.shouldDirty,!0),ae.shouldValidate&&V(K)},te=(K,ne,ae)=>{for(const Oe in ne){if(!ne.hasOwnProperty(Oe))return;const Ae=ne[Oe],Ie=K+"."+Oe,ke=De(r,Ie);(c.array.has(K)||Nn(Ae)||ke&&!ke._f)&&!rl(Ae)?te(Ie,Ae,ae):W(Ie,Ae,ae)}},le=(K,ne,ae={})=>{const Oe=De(r,K),Ae=c.array.has(K),Ie=rn(ne),ke=De(s,K),Je=ho(ke,Ie);if(zt(s,K,Ie),Ae)v.array.next({name:K,values:rn(s)}),ae.shouldDirty&&(E(K),v.state.next({name:K,dirtyFields:n.dirtyFields,isDirty:Z(K,Ie)}));else{const et=Array.isArray(Ie)&&!Ie.length||hr(Ie);!Oe||Oe._f||jr(Ie)||et?W(K,Ie,ae):te(K,Ie,ae)}Je||(Jb(K,c)?v.state.next({...n,name:K,values:rn(s)}):v.state.next({name:l.mount?K:void 0,values:rn(s)}))},Q=K=>{const ne=Or(K)?K(s):K;ho(s,ne)||(s={...s,...ne},v.state.next({...n,values:s}))},k=async K=>{l.mount=!0;const ne=K.target;let ae=ne.name,Oe=!0;const Ae=De(r,ae),Ie=et=>{Oe=Number.isNaN(et)||rl(et)&&isNaN(et.getTime())||ho(et,De(s,ae,et))},ke=Ac(t.mode),Je=Ac(t.reValidateMode);if(Ae){let et,_t;const Tt=ne.type?aC(Ae._f):UN(K),bt=K.type===ea.BLUR||K.type===ea.FOCUS_OUT,Ln=!xK(Ae._f)&&!e.validate&&!t.resolver&&!De(n.errors,ae)&&!Ae._f.deps||TK(bt,De(n.touchedFields,ae),n.isSubmitted,Je,ke),Ni=Jb(ae,c,bt);zt(s,ae,Tt),bt?(!ne||!ne.readOnly)&&(Ae._f.onBlur&&Ae._f.onBlur(K),d&&d(0)):Ae._f.onChange&&Ae._f.onChange(K);const Ho=I(ae,Tt,bt),Ye=!hr(Ho)||Ni;if(!bt&&v.state.next({name:ae,type:K.type,values:rn(s)}),Ln)return(h.isValid||g.isValid)&&(t.mode==="onBlur"?bt&&x():bt||x()),Ye&&v.state.next({name:ae,...Ni?{}:Ho});if(!t.resolver&&e.validate&&await j({name:ae,eventType:K.type}),!bt&&Ni&&v.state.next({...n}),t.resolver){const{errors:pt}=await L([ae]);if(S([ae]),Ie(Tt),Oe){const Ct=cC(n.errors,r,ae),it=cC(pt,r,Ct.name||ae);et=it.error,ae=it.name,_t=hr(pt)}}else S([ae],!0),et=(await e1(Ae,c.disabled,s,_,t.shouldUseNativeValidation))[ae],S([ae]),Ie(Tt),Oe&&(et?_t=!1:(h.isValid||g.isValid)&&(_t=await B({fields:r,onlyCheckValid:!0,name:ae,eventType:K.type})));Oe&&(Ae._f.deps&&(!Array.isArray(Ae._f.deps)||Ae._f.deps.length>0)&&V(Ae._f.deps),M(ae,_t,et,Ho))}},G=(K,ne)=>{if(De(n.errors,ne)&&K.focus)return K.focus(),1},V=async(K,ne={})=>{let ae,Oe;const Ae=Xr(K);if(t.resolver){const Ie=await q(tn(K)?K:Ae);ae=hr(Ie),Oe=K?!Ae.some(ke=>De(Ie,ke)):ae}else K?(Oe=(await Promise.all(Ae.map(async Ie=>{const ke=De(r,Ie);return await B({fields:ke&&ke._f?{[Ie]:ke}:ke,eventType:ea.TRIGGER})}))).every(Boolean),!(!Oe&&!n.isValid)&&x()):Oe=ae=await B({fields:r,name:K,eventType:ea.TRIGGER});return v.state.next({...!Tr(K)||(h.isValid||g.isValid)&&ae!==n.isValid?{}:{name:K},...t.resolver||!K?{isValid:ae}:{},errors:n.errors}),ne.shouldFocus&&!Oe&&Lc(r,G,K?Ae:c.mount),Oe},D=(K,ne)=>{let ae={...l.mount?s:o};return ne&&(ae=HN(ne.dirtyFields?n.dirtyFields:n.touchedFields,ae)),tn(K)?ae:Tr(K)?De(ae,K):K.map(Oe=>De(ae,Oe))},U=(K,ne)=>({invalid:!!De((ne||n).errors,K),isDirty:!!De((ne||n).dirtyFields,K),error:De((ne||n).errors,K),isValidating:!!De(n.validatingFields,K),isTouched:!!De((ne||n).touchedFields,K)}),X=K=>{const ne=K?Xr(K):void 0;ne?.forEach(ae=>Cn(n.errors,ae)),ne?ne.forEach(ae=>{v.state.next({name:ae,errors:n.errors})}):v.state.next({errors:{}})},fe=(K,ne,ae)=>{const Oe=(De(r,K,{_f:{}})._f||{}).ref,Ae=De(n.errors,K)||{},{ref:Ie,message:ke,type:Je,...et}=Ae;zt(n.errors,K,{...et,...ne,ref:Oe}),v.state.next({name:K,errors:n.errors,isValid:!1}),ae&&ae.shouldFocus&&Oe&&Oe.focus&&Oe.focus()},pe=(K,ne)=>Or(K)?v.state.subscribe({next:ae=>"values"in ae&&K(ae.values||ie(void 0,ne),ae)}):ie(K,ne,!0),xe=K=>v.state.subscribe({next:ne=>{if(OK(K.name,ne.name,K.exact)&&RK(ne,K.formState||h,Me,K.reRenderRoot)){const ae={...s};K.callback({values:ae,...n,...ne,defaultValues:o})}}}).unsubscribe,je=K=>(l.mount=!0,g={...g,...K.formState},xe({...K,formState:{...p,...K.formState}})),Y=(K,ne={})=>{for(const ae of K?Xr(K):c.mount)c.mount.delete(ae),c.array.delete(ae),ne.keepValue||(Cn(r,ae),Cn(s,ae)),!ne.keepError&&Cn(n.errors,ae),!ne.keepDirty&&Cn(n.dirtyFields,ae),!ne.keepTouched&&Cn(n.touchedFields,ae),!ne.keepIsValidating&&Cn(n.validatingFields,ae),!t.shouldUnregister&&!ne.keepDefaultValue&&Cn(o,ae);v.state.next({values:rn(s)}),v.state.next({...n,...ne.keepDirty?{isDirty:Z()}:{}}),!ne.keepIsValid&&x()},re=({disabled:K,name:ne})=>{if(fo(K)&&l.mount||K||c.disabled.has(ne)){const Ae=c.disabled.has(ne)!==!!K;K?c.disabled.add(ne):c.disabled.delete(ne),Ae&&l.mount&&!l.action&&x()}},ve=(K,ne={})=>{let ae=De(r,K);const Oe=fo(ne.disabled)||fo(t.disabled),Ae=!c.registerName.has(K)&&ae&&ae._f&&!ae._f.mount;return zt(r,K,{...ae||{},_f:{...ae&&ae._f?ae._f:{ref:{name:K}},name:K,mount:!0,...ne}}),c.mount.add(K),ae&&!Ae?re({disabled:fo(ne.disabled)?ne.disabled:t.disabled,name:K}):A(K,!0,ne.value),{...Oe?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:id(ne.min),max:id(ne.max),minLength:id(ne.minLength),maxLength:id(ne.maxLength),pattern:id(ne.pattern)}:{},name:K,onChange:k,onBlur:k,ref:Ie=>{if(Ie){c.registerName.add(K),ve(K,ne),c.registerName.delete(K),ae=De(r,K);const ke=tn(Ie.value)&&Ie.querySelectorAll&&Ie.querySelectorAll("input,select,textarea")[0]||Ie,Je=vK(ke),et=ae._f.refs||[];if(Je?et.find(_t=>_t===ke):ke===ae._f.ref)return;zt(r,K,{_f:{...ae._f,...Je?{refs:[...et.filter(l_),ke,...Array.isArray(De(o,K))?[{}]:[]],ref:{type:ke.type,name:K}}:{ref:ke}}}),A(K,!1,void 0,ke)}else ae=De(r,K,{}),ae._f&&(ae._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(FN(c.array,K)&&l.action)&&c.unMount.add(K)}}},se=()=>t.shouldFocusError&&Lc(r,G,c.mount),Se=K=>{fo(K)&&(v.state.next({disabled:K}),Lc(r,(ne,ae)=>{const Oe=De(r,ae);Oe&&(ne.disabled=Oe._f.disabled||K,Array.isArray(Oe._f.refs)&&Oe._f.refs.forEach(Ae=>{Ae.disabled=Oe._f.disabled||K}))},0,!1))},Te=(K,ne)=>async ae=>{let Oe;ae&&(ae.preventDefault&&ae.preventDefault(),ae.persist&&ae.persist());let Ae=rn(s);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ie,values:ke}=await L();S(),n.errors=Ie,Ae=rn(ke)}else await B({fields:r,eventType:ea.SUBMIT});if(c.disabled.size)for(const Ie of c.disabled)Cn(Ae,Ie);if(Cn(n.errors,BN),hr(n.errors)){v.state.next({errors:{}});try{await K(Ae,ae)}catch(Ie){Oe=Ie}}else ne&&await ne({...n.errors},ae),se(),setTimeout(se);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:hr(n.errors)&&!Oe,submitCount:n.submitCount+1,errors:n.errors}),Oe)throw Oe},tt=(K,ne={})=>{De(r,K)&&(tn(ne.defaultValue)?le(K,rn(De(o,K))):(le(K,ne.defaultValue),zt(o,K,rn(ne.defaultValue))),ne.keepTouched||Cn(n.touchedFields,K),ne.keepDirty||(Cn(n.dirtyFields,K),n.isDirty=ne.defaultValue?Z(K,rn(De(o,K))):Z()),ne.keepError||(Cn(n.errors,K),h.isValid&&x()),v.state.next({...n}))},rt=(K,ne={})=>{const ae=K?rn(K):o,Oe=rn(ae),Ae=hr(K),Ie=Ae?o:Oe;if(ne.keepDefaultValues||(o=ae),!ne.keepValues){if(ne.keepDirtyValues){const ke=new Set([...c.mount,...Object.keys(xd(o,s))]);for(const Je of Array.from(ke)){const et=De(n.dirtyFields,Je),_t=De(s,Je),Tt=De(Ie,Je);et&&!tn(_t)?zt(Ie,Je,_t):!et&&!tn(Tt)&&le(Je,Tt)}}else{if(Jw&&tn(K))for(const ke of c.mount){const Je=De(r,ke);if(Je&&Je._f){const et=Array.isArray(Je._f.refs)?Je._f.refs[0]:Je._f.ref;if(Gm(et)){const _t=et.closest("form");if(_t){_t.reset();break}}}}if(ne.keepFieldsRef)for(const ke of c.mount)le(ke,De(Ie,ke));else r={}}s=t.shouldUnregister?ne.keepDefaultValues?rn(o):{}:rn(Ie),v.array.next({values:{...Ie}}),v.state.next({values:{...Ie}})}c={mount:ne.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!h.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!hr(Ie),l.watch=!!t.shouldUnregister,l.keepIsValid=!!ne.keepIsValid,l.action=!1,ne.keepErrors||(n.errors={}),v.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Ae?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!ho(K,o)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ae?{}:ne.keepDirtyValues?ne.keepDefaultValues&&s?xd(o,s):n.dirtyFields:ne.keepDefaultValues&&K?xd(o,K):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Be=(K,ne)=>rt(Or(K)?K(s):K,{...t.resetOptions,...ne}),Qe=(K,ne={})=>{const ae=De(r,K),Oe=ae&&ae._f;if(Oe){const Ae=Oe.refs?Oe.refs[0]:Oe.ref;Ae.focus&&setTimeout(()=>{Ae.focus(),ne.shouldSelect&&Or(Ae.select)&&Ae.select()})}},Me=K=>{n={...n,...K}},Ue={control:{register:ve,unregister:Y,getFieldState:U,handleSubmit:Te,setError:fe,_subscribe:xe,_runSchema:L,_updateIsValidating:S,_focusError:se,_getWatch:ie,_getDirty:Z,_setValid:x,_setFieldArray:T,_setDisabledField:re,_setErrors:O,_getFieldArray:H,_reset:rt,_resetDefaultValues:()=>Or(t.defaultValues)&&t.defaultValues().then(K=>{Be(K,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:Se,_subjects:v,_proxyFormState:h,get _fields(){return r},get _formValues(){return s},get _state(){return l},set _state(K){l=K},get _defaultValues(){return o},get _names(){return c},set _names(K){c=K},get _formState(){return n},get _options(){return t},set _options(K){t={...t,...K}}},subscribe:je,trigger:V,register:ve,handleSubmit:Te,watch:pe,setValue:le,setValues:Q,getValues:D,reset:Be,resetField:tt,clearErrors:X,unregister:Y,setError:fe,setFocus:Qe,getFieldState:U};return{...Ue,formControl:Ue}}var Hs=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},c_=(e,t,n={})=>n.shouldFocus||tn(n.shouldFocus)?n.focusName||`${e}.${tn(n.focusIndex)?t:n.focusIndex}.`:"",u_=(e,t)=>[...e,...Xr(t)],d_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function f_(e,t,n){return[...e.slice(0,t),...Xr(n),...e.slice(t)]}var h_=(e,t,n)=>Array.isArray(e)?(tn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],p_=(e,t)=>[...Xr(t),...Xr(e)];function PK(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return Hg(r).length?r:[]}var m_=(e,t)=>tn(t)?[]:PK(e,Xr(t).sort((n,r)=>n-r)),g_=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},dC=(e,t,n)=>(e[t]=n,e);function Bce(e){const t=Gg(),{control:n=t,name:r,keyName:o="id",shouldUnregister:s,rules:l}=e,[c,d]=ee.useState(n._getFieldArray(r)),f=ee.useRef(n._getFieldArray(r).map(Hs)),p=ee.useRef(!1);n._names.array.add(r),ee.useMemo(()=>l&&c.length>=0&&n.register(r,l),[n,r,c.length,l]),Kg(()=>n._subjects.array.subscribe({next:({values:R,name:O})=>{if(O===r||!O){const A=De(R,r);Array.isArray(A)&&(d(A),f.current=A.map(Hs))}}}).unsubscribe,[n,r]);const h=ee.useCallback(R=>{p.current=!0,n._setFieldArray(r,R)},[n,r]),g=(R,O)=>{const A=Xr(rn(R)),I=u_(n._getFieldArray(r),A);n._names.focus=c_(r,I.length-1,O),f.current=u_(f.current,A.map(Hs)),h(I),d(I),n._setFieldArray(r,I,u_,{argA:d_(R)})},v=(R,O)=>{const A=Xr(rn(R)),I=p_(n._getFieldArray(r),A);n._names.focus=c_(r,0,O),f.current=p_(f.current,A.map(Hs)),h(I),d(I),n._setFieldArray(r,I,p_,{argA:d_(R)})},_=R=>{const O=m_(n._getFieldArray(r),R);f.current=m_(f.current,R),h(O),d(O),!Array.isArray(De(n._fields,r))&&zt(n._fields,r,void 0),n._setFieldArray(r,O,m_,{argA:R})},b=(R,O,A)=>{const I=Xr(rn(O)),M=f_(n._getFieldArray(r),R,I);n._names.focus=c_(r,R,A),f.current=f_(f.current,R,I.map(Hs)),h(M),d(M),n._setFieldArray(r,M,f_,{argA:R,argB:d_(O)})},x=(R,O)=>{const A=n._getFieldArray(r);g_(A,R,O),g_(f.current,R,O),h(A),d(A),n._setFieldArray(r,A,g_,{argA:R,argB:O},!1)},S=(R,O)=>{const A=n._getFieldArray(r);h_(A,R,O),h_(f.current,R,O),h(A),d(A),n._setFieldArray(r,A,h_,{argA:R,argB:O},!1)},E=(R,O)=>{const A=rn(O),I=dC(n._getFieldArray(r),R,A);f.current=[...I].map((M,L)=>!M||L===R?Hs():f.current[L]),h(I),d([...I]),n._setFieldArray(r,I,dC,{argA:R,argB:A},!0,!1)},T=R=>{const O=Xr(rn(R));f.current=O.map(Hs),h([...O]),d([...O]),n._setFieldArray(r,[...O],A=>A,{},!0,!1)};return ee.useEffect(()=>{n._state.action=!1,Jb(r,n._names)&&n._subjects.state.next({...n._formState});const R=Ac(n._options.mode);if(p.current&&(!R.isOnSubmit||n._formState.isSubmitted)&&!Ac(n._options.reValidateMode).isOnSubmit&&!R.isOnBlur)if(n._options.resolver)n._runSchema([r]).then(O=>{n._updateIsValidating([r]);const A=De(O.errors,r),I=De(n._formState.errors,r);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?zt(n._formState.errors,r,A):Cn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const O=De(n._fields,r);O&&O._f&&!(Ac(n._options.reValidateMode).isOnSubmit&&Ac(n._options.mode).isOnSubmit)&&e1(O,n._names.disabled,n._formValues,n._options.criteriaMode===jo.all,n._options.shouldUseNativeValidation,!0).then(A=>!hr(A)&&n._subjects.state.next({errors:QN(n._formState.errors,A,r)}))}n._subjects.state.next({name:r,values:rn(n._formValues)}),n._names.focus&&Lc(n._fields,(O,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&O.focus)return O.focus(),1}),n._names.focus="",n._setValid(),p.current=!1},[c,r,n]),ee.useEffect(()=>(!De(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(O,A)=>{const I=De(n._fields,O);I&&I._f&&(I._f.mount=A)};n._options.shouldUnregister||s?n.unregister(r):R(r,!1)}),[r,n,o,s]),{swap:ee.useCallback(x,[h,r,n]),move:ee.useCallback(S,[h,r,n]),prepend:ee.useCallback(v,[h,r,n]),append:ee.useCallback(g,[h,r,n]),remove:ee.useCallback(_,[h,r,n]),insert:ee.useCallback(b,[h,r,n]),update:ee.useCallback(E,[h,r,n]),replace:ee.useCallback(T,[h,r,n]),fields:ee.useMemo(()=>c.map((R,O)=>({...R,[o]:f.current[O]||Hs()})),[c,o])}}function Ci(e={}){const t=ee.useRef(void 0),n=ee.useRef(void 0),[r,o]=ee.useState({isDirty:!1,isValidating:!1,isLoading:Or(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Or(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Or(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...c}=IK(e);t.current={...c,formState:r}}const s=t.current.control;return s._options=e,Kg(()=>{const l=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),s._formState.isReady=!0,l},[s]),ee.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),ee.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),ee.useEffect(()=>{if(s._proxyFormState.isDirty){const l=s._getDirty();l!==r.isDirty&&s._subjects.state.next({isDirty:l})}},[s,r.isDirty]),ee.useEffect(()=>{var l;e.values&&!ho(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((l=s._options.resetOptions)===null||l===void 0)&&l.keepIsValid||s._setValid(),n.current=e.values,o(c=>({...c}))):s._resetDefaultValues()},[s,e.values]),ee.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=ee.useMemo(()=>VN(r,s),[s,r]),t.current}function fC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mf(...e){return t=>{let n=!1;const r=e.map(o=>{const s=fC(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():fC(e[o],null)}}}}function er(...e){return P.useCallback(mf(...e),e)}var MK=Symbol.for("react.lazy"),Zm=xw[" use ".trim().toString()];function NK(e){return typeof e=="object"&&e!==null&&"then"in e}function XN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MK&&"_payload"in e&&NK(e._payload)}function JN(e){const t=kK(e),n=P.forwardRef((r,o)=>{let{children:s,...l}=r;XN(s)&&typeof Zm=="function"&&(s=Zm(s._payload));const c=P.Children.toArray(s),d=c.find(LK);if(d){const f=d.props.children,p=c.map(h=>h===d?P.Children.count(f)>1?P.Children.only(null):P.isValidElement(f)?f.props.children:null:h);return C.jsx(t,{...l,ref:o,children:P.isValidElement(f)?P.cloneElement(f,void 0,p):null})}return C.jsx(t,{...l,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var sS=JN("Slot");function kK(e){const t=P.forwardRef((n,r)=>{let{children:o,...s}=n;if(XN(o)&&typeof Zm=="function"&&(o=Zm(o._payload)),P.isValidElement(o)){const l=jK(o),c=$K(s,o.props);return o.type!==P.Fragment&&(c.ref=r?mf(r,l):l),P.cloneElement(o,c)}return P.Children.count(o)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DK=Symbol("radix.slottable");function LK(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DK}function $K(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function jK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const hC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,pC=Yw,e4=(e,t)=>n=>{var r;if(t?.variants==null)return pC(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(f=>{const p=n?.[f],h=s?.[f];if(p===null)return null;const g=hC(p)||hC(h);return o[f][g]}),c=n&&Object.entries(n).reduce((f,p)=>{let[h,g]=p;return g===void 0||(f[h]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:h,className:g,...v}=p;return Object.entries(v).every(_=>{let[b,x]=_;return Array.isArray(x)?x.includes({...s,...c}[b]):{...s,...c}[b]===x})?[...f,h,g]:f},[]);return pC(e,l,d,n?.class,n?.className)},mC=(e,t,n)=>{if(e&&"reportValidity"in e){const r=De(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},t1=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?mC(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>mC(o,n,e))}},gC=(e,t)=>{t.shouldUseNativeValidation&&t1(e,t);const n={};for(const r in e){const o=De(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(zK(t.names||Object.keys(e),r)){const l=Object.assign({},De(n,r));zt(l,"root",s),zt(n,r,l)}else zt(n,r,s)}return n},zK=(e,t)=>{const n=vC(t);return e.some(r=>vC(r).match(`^${n}\\.\\d+`))};function vC(e){return e.replace(/\]|\[/g,"")}function yC(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function UK(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,l=r.path.join(".");if(!n[l])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[l]={message:c.message,type:c.code}}else n[l]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(p){return p.errors.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=rS(l,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n}function FK(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,l=r.path.join(".");if(!n[l])if(r.code==="invalid_union"&&r.errors.length>0){var c=r.errors[0][0];n[l]={message:c.message,type:c.code}}else n[l]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(p){return p.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=rS(l,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n}function Ai(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(yC(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return s.shouldUseNativeValidation&&t1({},s),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(c){return Array.isArray(c?.issues)})(l))return{values:{},errors:gC(UK(l.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(yC(function(){return Promise.resolve((n.mode==="sync"?H9:G9)(e,r,t)).then(function(l){return s.shouldUseNativeValidation&&t1({},s),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(c){return c instanceof zw})(l))return{values:{},errors:gC(FK(l.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}function ct(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function BK(e,t){const n=P.createContext(t),r=s=>{const{children:l,...c}=s,d=P.useMemo(()=>c,Object.values(c));return C.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function o(s){const l=P.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function vl(e,t=[]){let n=[];function r(s,l){const c=P.createContext(l),d=n.length;n=[...n,l];const f=h=>{const{scope:g,children:v,..._}=h,b=g?.[e]?.[d]||c,x=P.useMemo(()=>_,Object.values(_));return C.jsx(b.Provider,{value:x,children:v})};f.displayName=s+"Provider";function p(h,g){const v=g?.[e]?.[d]||c,_=P.useContext(v);if(_)return _;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[f,p]}const o=()=>{const s=n.map(l=>P.createContext(l));return function(c){const d=c?.[e]||s;return P.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return o.scopeName=e,[r,VK(o,...t)]}function VK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const l=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(s)[`__scope${f}`];return{...c,...h}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ri=globalThis?.document?P.useLayoutEffect:()=>{},qK=xw[" useId ".trim().toString()]||(()=>{}),HK=0;function la(e){const[t,n]=P.useState(qK());return ri(()=>{n(r=>r??String(HK++))},[e]),e||(t?`radix-${t}`:"")}var GK=xw[" useInsertionEffect ".trim().toString()]||ri;function gf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,l]=KK({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:o;{const p=P.useRef(e!==void 0);P.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=P.useCallback(p=>{if(c){const h=ZK(p)?p(e):p;h!==e&&l.current?.(h)}else s(p)},[c,e,s,l]);return[d,f]}function KK({defaultProp:e,onChange:t}){const[n,r]=P.useState(e),o=P.useRef(n),s=P.useRef(t);return GK(()=>{s.current=t},[t]),P.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function ZK(e){return typeof e=="function"}function Xd(e){const t=YK(e),n=P.forwardRef((r,o)=>{const{children:s,...l}=r,c=P.Children.toArray(s),d=c.find(WK);if(d){const f=d.props.children,p=c.map(h=>h===d?P.Children.count(f)>1?P.Children.only(null):P.isValidElement(f)?f.props.children:null:h);return C.jsx(t,{...l,ref:o,children:P.isValidElement(f)?P.cloneElement(f,void 0,p):null})}return C.jsx(t,{...l,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function YK(e){const t=P.forwardRef((n,r)=>{const{children:o,...s}=n;if(P.isValidElement(o)){const l=XK(o),c=QK(s,o.props);return o.type!==P.Fragment&&(c.ref=r?mf(r,l):l),P.cloneElement(o,c)}return P.Children.count(o)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var t4=Symbol("radix.slottable");function Vce(e){const t=({children:n})=>C.jsx(C.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=t4,t}function WK(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===t4}function QK(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function XK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var JK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sn=JK.reduce((e,t)=>{const n=Xd(`Primitive.${t}`),r=P.forwardRef((o,s)=>{const{asChild:l,...c}=o,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(d,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function n4(e,t){e&&kg.flushSync(()=>e.dispatchEvent(t))}function oi(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...n)=>t.current?.(...n),[])}function eZ(e,t=globalThis?.document){const n=oi(e);P.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var tZ="DismissableLayer",n1="dismissableLayer.update",nZ="dismissableLayer.pointerDownOutside",rZ="dismissableLayer.focusOutside",_C,r4=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aS=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=e,f=P.useContext(r4),[p,h]=P.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=P.useState({}),_=er(t,I=>h(I)),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),E=p?b.indexOf(p):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,R=E>=S,O=sZ(I=>{const M=I.target,L=[...f.branches].some(q=>q.contains(M));!R||L||(o?.(I),l?.(I),I.defaultPrevented||c?.())},g),A=aZ(I=>{const M=I.target;[...f.branches].some(q=>q.contains(M))||(s?.(I),l?.(I),I.defaultPrevented||c?.())},g);return eZ(I=>{E===f.layers.size-1&&(r?.(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},g),P.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(_C=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),bC(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=_C)}},[p,g,n,f]),P.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),bC())},[p,f]),P.useEffect(()=>{const I=()=>v({});return document.addEventListener(n1,I),()=>document.removeEventListener(n1,I)},[]),C.jsx(Sn.div,{...d,ref:_,style:{pointerEvents:T?R?"auto":"none":void 0,...e.style},onFocusCapture:ct(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ct(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ct(e.onPointerDownCapture,O.onPointerDownCapture)})});aS.displayName=tZ;var oZ="DismissableLayerBranch",iZ=P.forwardRef((e,t)=>{const n=P.useContext(r4),r=P.useRef(null),o=er(t,r);return P.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),C.jsx(Sn.div,{...e,ref:o})});iZ.displayName=oZ;function sZ(e,t=globalThis?.document){const n=oi(e),r=P.useRef(!1),o=P.useRef(()=>{});return P.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let d=function(){o4(nZ,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function aZ(e,t=globalThis?.document){const n=oi(e),r=P.useRef(!1);return P.useEffect(()=>{const o=s=>{s.target&&!r.current&&o4(rZ,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bC(){const e=new CustomEvent(n1);document.dispatchEvent(e)}function o4(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?n4(o,s):o.dispatchEvent(s)}var v_="focusScope.autoFocusOnMount",y_="focusScope.autoFocusOnUnmount",wC={bubbles:!1,cancelable:!0},lZ="FocusScope",lS=P.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...l}=e,[c,d]=P.useState(null),f=oi(o),p=oi(s),h=P.useRef(null),g=er(t,b=>d(b)),v=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(r){let b=function(T){if(v.paused||!c)return;const R=T.target;c.contains(R)?h.current=R:Xs(h.current,{select:!0})},x=function(T){if(v.paused||!c)return;const R=T.relatedTarget;R!==null&&(c.contains(R)||Xs(h.current,{select:!0}))},S=function(T){if(document.activeElement===document.body)for(const O of T)O.removedNodes.length>0&&Xs(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const E=new MutationObserver(S);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),E.disconnect()}}},[r,c,v.paused]),P.useEffect(()=>{if(c){EC.add(v);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(v_,wC);c.addEventListener(v_,f),c.dispatchEvent(S),S.defaultPrevented||(cZ(pZ(i4(c)),{select:!0}),document.activeElement===b&&Xs(c))}return()=>{c.removeEventListener(v_,f),setTimeout(()=>{const S=new CustomEvent(y_,wC);c.addEventListener(y_,p),c.dispatchEvent(S),S.defaultPrevented||Xs(b??document.body,{select:!0}),c.removeEventListener(y_,p),EC.remove(v)},0)}}},[c,f,p,v]);const _=P.useCallback(b=>{if(!n&&!r||v.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(x&&S){const E=b.currentTarget,[T,R]=uZ(E);T&&R?!b.shiftKey&&S===R?(b.preventDefault(),n&&Xs(T,{select:!0})):b.shiftKey&&S===T&&(b.preventDefault(),n&&Xs(R,{select:!0})):S===E&&b.preventDefault()}},[n,r,v.paused]);return C.jsx(Sn.div,{tabIndex:-1,...l,ref:g,onKeyDown:_})});lS.displayName=lZ;function cZ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xs(r,{select:t}),document.activeElement!==n)return}function uZ(e){const t=i4(e),n=SC(t,e),r=SC(t.reverse(),e);return[n,r]}function i4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function SC(e,t){for(const n of e)if(!dZ(n,{upTo:t}))return n}function dZ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fZ(e){return e instanceof HTMLInputElement&&"select"in e}function Xs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fZ(e)&&t&&e.select()}}var EC=hZ();function hZ(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xC(e,t),e.unshift(t)},remove(t){e=xC(e,t),e[0]?.resume()}}}function xC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pZ(e){return e.filter(t=>t.tagName!=="A")}var mZ="Portal",cS=P.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=P.useState(!1);ri(()=>s(!0),[]);const l=n||o&&globalThis?.document?.body;return l?KM.createPortal(C.jsx(Sn.div,{...r,ref:t}),l):null});cS.displayName=mZ;function gZ(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var gs=e=>{const{present:t,children:n}=e,r=vZ(t),o=typeof n=="function"?n({present:r.isPresent}):P.Children.only(n),s=er(r.ref,yZ(o));return typeof n=="function"||r.isPresent?P.cloneElement(o,{ref:s}):null};gs.displayName="Presence";function vZ(e){const[t,n]=P.useState(),r=P.useRef(null),o=P.useRef(e),s=P.useRef("none"),l=e?"mounted":"unmounted",[c,d]=gZ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const f=lp(r.current);s.current=c==="mounted"?f:"none"},[c]),ri(()=>{const f=r.current,p=o.current;if(p!==e){const g=s.current,v=lp(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),ri(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=v=>{const b=lp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=v=>{v.target===t&&(s.current=lp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:P.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function lp(e){return e?.animationName||"none"}function yZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var __=0;function s4(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??RC()),document.body.insertAdjacentElement("beforeend",e[1]??RC()),__++,()=>{__===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),__--}},[])}function RC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Si=function(){return Si=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Si.apply(this,arguments)};function a4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function _Z(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var bm="right-scroll-bar-position",wm="width-before-scroll-bar",bZ="with-scroll-bars-hidden",wZ="--removed-body-scroll-bar-size";function b_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function SZ(e,t){var n=P.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var EZ=typeof window<"u"?P.useLayoutEffect:P.useEffect,OC=new WeakMap;function xZ(e,t){var n=SZ(null,function(r){return e.forEach(function(o){return b_(o,r)})});return EZ(function(){var r=OC.get(n);if(r){var o=new Set(r),s=new Set(e),l=n.current;o.forEach(function(c){s.has(c)||b_(c,null)}),s.forEach(function(c){o.has(c)||b_(c,l)})}OC.set(n,e)},[e]),n}function RZ(e){return e}function OZ(e,t){t===void 0&&(t=RZ);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(s),l=n}var d=function(){var p=l;l=[],p.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return o}function TZ(e){e===void 0&&(e={});var t=OZ(null);return t.options=Si({async:!0,ssr:!1},e),t}var l4=function(e){var t=e.sideCar,n=a4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return P.createElement(r,Si({},n))};l4.isSideCarExport=!0;function CZ(e,t){return e.useMedium(t),l4}var c4=TZ(),w_=function(){},Zg=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:w_,onWheelCapture:w_,onTouchMoveCapture:w_}),o=r[0],s=r[1],l=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,_=e.noIsolation,b=e.inert,x=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,T=e.gapMode,R=a4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=xZ([n,t]),I=Si(Si({},R),o);return P.createElement(P.Fragment,null,p&&P.createElement(O,{sideCar:c4,removeScrollBar:f,shards:h,noRelative:v,noIsolation:_,inert:b,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:T}),l?P.cloneElement(P.Children.only(c),Si(Si({},I),{ref:A})):P.createElement(E,Si({},I,{className:d,ref:A}),c))});Zg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zg.classNames={fullWidth:wm,zeroRight:bm};var AZ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IZ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=AZ();return t&&e.setAttribute("nonce",t),e}function PZ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function MZ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var NZ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=IZ())&&(PZ(t,n),MZ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kZ=function(){var e=NZ();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},u4=function(){var e=kZ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},DZ={left:0,top:0,right:0,gap:0},S_=function(e){return parseInt(e||"",10)||0},LZ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[S_(n),S_(r),S_(o)]},$Z=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return DZ;var t=LZ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jZ=u4(),$c="data-scroll-locked",zZ=function(e,t,n,r){var o=e.left,s=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
62
62
|
.`.concat(bZ,` {
|
|
63
63
|
overflow: hidden `).concat(r,`;
|
|
64
64
|
padding-right: `).concat(c,"px ").concat(r,`;
|
|
@@ -126,7 +126,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
126
126
|
--nojs-bg: black !important;
|
|
127
127
|
--nojs-fg: white !important;
|
|
128
128
|
}
|
|
129
|
-
}`,fc={},j_,cA;function FD(){return cA||(cA=1,j_={L:1,M:0,Q:3,H:2}),j_}var z_,uA;function BD(){return uA||(uA=1,z_={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),z_}var U_,dA;function $ee(){if(dA)return U_;dA=1;var e=BD();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},U_=t,U_}var F_,fA;function jee(){if(fA)return F_;fA=1;var e=FD();function t(n,r){this.totalCount=n,this.dataCount=r}return t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(n,r){var o=t.getRsBlockTable(n,r);if(o==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var s=o.length/3,l=new Array,c=0;c<s;c++)for(var d=o[c*3+0],f=o[c*3+1],p=o[c*3+2],h=0;h<d;h++)l.push(new t(f,p));return l},t.getRsBlockTable=function(n,r){switch(r){case e.L:return t.RS_BLOCK_TABLE[(n-1)*4+0];case e.M:return t.RS_BLOCK_TABLE[(n-1)*4+1];case e.Q:return t.RS_BLOCK_TABLE[(n-1)*4+2];case e.H:return t.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},F_=t,F_}var B_,hA;function zee(){if(hA)return B_;hA=1;function e(){this.buffer=new Array,this.length=0}return e.prototype={get:function(t){var n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)==1},put:function(t,n){for(var r=0;r<n;r++)this.putBit((t>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},B_=e,B_}var V_,pA;function VD(){if(pA)return V_;pA=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)e.EXP_TABLE[t]=e.EXP_TABLE[t-4]^e.EXP_TABLE[t-5]^e.EXP_TABLE[t-6]^e.EXP_TABLE[t-8];for(var t=0;t<255;t++)e.LOG_TABLE[e.EXP_TABLE[t]]=t;return V_=e,V_}var q_,mA;function qD(){if(mA)return q_;mA=1;var e=VD();function t(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var o=0;o<n.length&&n[o]==0;)o++;this.num=new Array(n.length-o+r);for(var s=0;s<n.length-o;s++)this.num[s]=n[s+o]}return t.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),o=0;o<this.getLength();o++)for(var s=0;s<n.getLength();s++)r[o+s]^=e.gexp(e.glog(this.get(o))+e.glog(n.get(s)));return new t(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=e.glog(this.get(0))-e.glog(n.get(0)),o=new Array(this.getLength()),s=0;s<this.getLength();s++)o[s]=this.get(s);for(var s=0;s<n.getLength();s++)o[s]^=e.gexp(e.glog(n.get(s))+r);return new t(o,0).mod(n)}},q_=t,q_}var H_,gA;function Uee(){if(gA)return H_;gA=1;var e=BD(),t=qD(),n=VD(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},o={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){for(var l=s<<10;o.getBCHDigit(l)-o.getBCHDigit(o.G15)>=0;)l^=o.G15<<o.getBCHDigit(l)-o.getBCHDigit(o.G15);return(s<<10|l)^o.G15_MASK},getBCHTypeNumber:function(s){for(var l=s<<12;o.getBCHDigit(l)-o.getBCHDigit(o.G18)>=0;)l^=o.G18<<o.getBCHDigit(l)-o.getBCHDigit(o.G18);return s<<12|l},getBCHDigit:function(s){for(var l=0;s!=0;)l++,s>>>=1;return l},getPatternPosition:function(s){return o.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,l,c){switch(s){case r.PATTERN000:return(l+c)%2==0;case r.PATTERN001:return l%2==0;case r.PATTERN010:return c%3==0;case r.PATTERN011:return(l+c)%3==0;case r.PATTERN100:return(Math.floor(l/2)+Math.floor(c/3))%2==0;case r.PATTERN101:return l*c%2+l*c%3==0;case r.PATTERN110:return(l*c%2+l*c%3)%2==0;case r.PATTERN111:return(l*c%3+(l+c)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){for(var l=new t([1],0),c=0;c<s;c++)l=l.multiply(new t([1,n.gexp(c)],0));return l},getLengthInBits:function(s,l){if(1<=l&&l<10)switch(s){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(l<27)switch(s){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(l<41)switch(s){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+l)},getLostPoint:function(s){for(var l=s.getModuleCount(),c=0,d=0;d<l;d++)for(var f=0;f<l;f++){for(var p=0,h=s.isDark(d,f),g=-1;g<=1;g++)if(!(d+g<0||l<=d+g))for(var v=-1;v<=1;v++)f+v<0||l<=f+v||g==0&&v==0||h==s.isDark(d+g,f+v)&&p++;p>5&&(c+=3+p-5)}for(var d=0;d<l-1;d++)for(var f=0;f<l-1;f++){var _=0;s.isDark(d,f)&&_++,s.isDark(d+1,f)&&_++,s.isDark(d,f+1)&&_++,s.isDark(d+1,f+1)&&_++,(_==0||_==4)&&(c+=3)}for(var d=0;d<l;d++)for(var f=0;f<l-6;f++)s.isDark(d,f)&&!s.isDark(d,f+1)&&s.isDark(d,f+2)&&s.isDark(d,f+3)&&s.isDark(d,f+4)&&!s.isDark(d,f+5)&&s.isDark(d,f+6)&&(c+=40);for(var f=0;f<l;f++)for(var d=0;d<l-6;d++)s.isDark(d,f)&&!s.isDark(d+1,f)&&s.isDark(d+2,f)&&s.isDark(d+3,f)&&s.isDark(d+4,f)&&!s.isDark(d+5,f)&&s.isDark(d+6,f)&&(c+=40);for(var b=0,f=0;f<l;f++)for(var d=0;d<l;d++)s.isDark(d,f)&&b++;var x=Math.abs(100*b/l/l-50)/5;return c+=x*10,c}};return H_=o,H_}var G_,vA;function Fee(){if(vA)return G_;vA=1;var e=$ee(),t=jee(),n=zee(),r=Uee(),o=qD();function s(c,d){this.typeNumber=c,this.errorCorrectLevel=d,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var l=s.prototype;return l.addData=function(c){var d=new e(c);this.dataList.push(d),this.dataCache=null},l.isDark=function(c,d){if(c<0||this.moduleCount<=c||d<0||this.moduleCount<=d)throw new Error(c+","+d);return this.modules[c][d]},l.getModuleCount=function(){return this.moduleCount},l.make=function(){if(this.typeNumber<1){var c=1;for(c=1;c<40;c++){for(var d=t.getRSBlocks(c,this.errorCorrectLevel),f=new n,p=0,h=0;h<d.length;h++)p+=d[h].dataCount;for(var h=0;h<this.dataList.length;h++){var g=this.dataList[h];f.put(g.mode,4),f.put(g.getLength(),r.getLengthInBits(g.mode,c)),g.write(f)}if(f.getLengthInBits()<=p*8)break}this.typeNumber=c}this.makeImpl(!1,this.getBestMaskPattern())},l.makeImpl=function(c,d){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var f=0;f<this.moduleCount;f++){this.modules[f]=new Array(this.moduleCount);for(var p=0;p<this.moduleCount;p++)this.modules[f][p]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(c,d),this.typeNumber>=7&&this.setupTypeNumber(c),this.dataCache==null&&(this.dataCache=s.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,d)},l.setupPositionProbePattern=function(c,d){for(var f=-1;f<=7;f++)if(!(c+f<=-1||this.moduleCount<=c+f))for(var p=-1;p<=7;p++)d+p<=-1||this.moduleCount<=d+p||(0<=f&&f<=6&&(p==0||p==6)||0<=p&&p<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=p&&p<=4?this.modules[c+f][d+p]=!0:this.modules[c+f][d+p]=!1)},l.getBestMaskPattern=function(){for(var c=0,d=0,f=0;f<8;f++){this.makeImpl(!0,f);var p=r.getLostPoint(this);(f==0||c>p)&&(c=p,d=f)}return d},l.createMovieClip=function(c,d,f){var p=c.createEmptyMovieClip(d,f),h=1;this.make();for(var g=0;g<this.modules.length;g++)for(var v=g*h,_=0;_<this.modules[g].length;_++){var b=_*h,x=this.modules[g][_];x&&(p.beginFill(0,100),p.moveTo(b,v),p.lineTo(b+h,v),p.lineTo(b+h,v+h),p.lineTo(b,v+h),p.endFill())}return p},l.setupTimingPattern=function(){for(var c=8;c<this.moduleCount-8;c++)this.modules[c][6]==null&&(this.modules[c][6]=c%2==0);for(var d=8;d<this.moduleCount-8;d++)this.modules[6][d]==null&&(this.modules[6][d]=d%2==0)},l.setupPositionAdjustPattern=function(){for(var c=r.getPatternPosition(this.typeNumber),d=0;d<c.length;d++)for(var f=0;f<c.length;f++){var p=c[d],h=c[f];if(this.modules[p][h]==null)for(var g=-2;g<=2;g++)for(var v=-2;v<=2;v++)g==-2||g==2||v==-2||v==2||g==0&&v==0?this.modules[p+g][h+v]=!0:this.modules[p+g][h+v]=!1}},l.setupTypeNumber=function(c){for(var d=r.getBCHTypeNumber(this.typeNumber),f=0;f<18;f++){var p=!c&&(d>>f&1)==1;this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=p}for(var f=0;f<18;f++){var p=!c&&(d>>f&1)==1;this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=p}},l.setupTypeInfo=function(c,d){for(var f=this.errorCorrectLevel<<3|d,p=r.getBCHTypeInfo(f),h=0;h<15;h++){var g=!c&&(p>>h&1)==1;h<6?this.modules[h][8]=g:h<8?this.modules[h+1][8]=g:this.modules[this.moduleCount-15+h][8]=g}for(var h=0;h<15;h++){var g=!c&&(p>>h&1)==1;h<8?this.modules[8][this.moduleCount-h-1]=g:h<9?this.modules[8][15-h-1+1]=g:this.modules[8][15-h-1]=g}this.modules[this.moduleCount-8][8]=!c},l.mapData=function(c,d){for(var f=-1,p=this.moduleCount-1,h=7,g=0,v=this.moduleCount-1;v>0;v-=2)for(v==6&&v--;;){for(var _=0;_<2;_++)if(this.modules[p][v-_]==null){var b=!1;g<c.length&&(b=(c[g]>>>h&1)==1);var x=r.getMask(d,p,v-_);x&&(b=!b),this.modules[p][v-_]=b,h--,h==-1&&(g++,h=7)}if(p+=f,p<0||this.moduleCount<=p){p-=f,f=-f;break}}},s.PAD0=236,s.PAD1=17,s.createData=function(c,d,f){for(var p=t.getRSBlocks(c,d),h=new n,g=0;g<f.length;g++){var v=f[g];h.put(v.mode,4),h.put(v.getLength(),r.getLengthInBits(v.mode,c)),v.write(h)}for(var _=0,g=0;g<p.length;g++)_+=p[g].dataCount;if(h.getLengthInBits()>_*8)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+_*8+")");for(h.getLengthInBits()+4<=_*8&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;!(h.getLengthInBits()>=_*8||(h.put(s.PAD0,8),h.getLengthInBits()>=_*8));)h.put(s.PAD1,8);return s.createBytes(h,p)},s.createBytes=function(c,d){for(var f=0,p=0,h=0,g=new Array(d.length),v=new Array(d.length),_=0;_<d.length;_++){var b=d[_].dataCount,x=d[_].totalCount-b;p=Math.max(p,b),h=Math.max(h,x),g[_]=new Array(b);for(var S=0;S<g[_].length;S++)g[_][S]=255&c.buffer[S+f];f+=b;var E=r.getErrorCorrectPolynomial(x),T=new o(g[_],E.getLength()-1),R=T.mod(E);v[_]=new Array(E.getLength()-1);for(var S=0;S<v[_].length;S++){var O=S+R.getLength()-v[_].length;v[_][S]=O>=0?R.get(O):0}}for(var A=0,S=0;S<d.length;S++)A+=d[S].totalCount;for(var I=new Array(A),M=0,S=0;S<p;S++)for(var _=0;_<d.length;_++)S<g[_].length&&(I[M++]=g[_][S]);for(var S=0;S<h;S++)for(var _=0;_<d.length;_++)S<v[_].length&&(I[M++]=v[_][S]);return I},G_=s,G_}var _p={},yA;function Bee(){if(yA)return _p;yA=1,Object.defineProperty(_p,"__esModule",{value:!0});var e=Object.assign||function(f){for(var p=1;p<arguments.length;p++){var h=arguments[p];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(f[g]=h[g])}return f},t=NS(),n=s(t),r=ma(),o=s(r);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,p){var h={};for(var g in f)p.indexOf(g)>=0||Object.prototype.hasOwnProperty.call(f,g)&&(h[g]=f[g]);return h}var c={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},d=(0,r.forwardRef)(function(f,p){var h=f.bgColor,g=f.bgD,v=f.fgD,_=f.fgColor,b=f.size,x=f.title,S=f.viewBoxSize,E=f.xmlns,T=E===void 0?"http://www.w3.org/2000/svg":E,R=l(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return o.default.createElement("svg",e({},R,{height:b,ref:p,viewBox:"0 0 "+S+" "+S,width:b,xmlns:T}),x?o.default.createElement("title",null,x):null,o.default.createElement("path",{d:g,fill:h}),o.default.createElement("path",{d:v,fill:_}))});return d.displayName="QRCodeSvg",d.propTypes=c,_p.default=d,_p}var _A;function Vee(){if(_A)return fc;_A=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.QRCode=void 0;var e=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var S=arguments[x];for(var E in S)Object.prototype.hasOwnProperty.call(S,E)&&(b[E]=S[E])}return b},t=NS(),n=h(t),r=FD(),o=h(r),s=Fee(),l=h(s),c=ma(),d=h(c),f=Bee(),p=h(f);function h(b){return b&&b.__esModule?b:{default:b}}function g(b,x){var S={};for(var E in b)x.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(b,E)&&(S[E]=b[E]);return S}var v={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},_=(0,c.forwardRef)(function(b,x){var S=b.bgColor,E=S===void 0?"#FFFFFF":S,T=b.fgColor,R=T===void 0?"#000000":T,O=b.level,A=O===void 0?"L":O,I=b.size,M=I===void 0?256:I,L=b.value,q=g(b,["bgColor","fgColor","level","size","value"]),j=new l.default(-1,o.default[A]);j.addData(L),j.make();var B=j.modules;return d.default.createElement(p.default,e({},q,{bgColor:E,bgD:B.map(function(F,Z){return F.map(function(ie,H){return ie?"":"M "+H+" "+Z+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:B.map(function(F,Z){return F.map(function(ie,H){return ie?"M "+H+" "+Z+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:x,size:M,viewBoxSize:B.length}))});return fc.QRCode=_,_.displayName="QRCode",_.propTypes=v,fc.default=_,fc}var qee=Vee();const Hee=fl(qee);var Gee="Separator",bA="horizontal",Kee=["horizontal","vertical"],HD=P.forwardRef((e,t)=>{const{decorative:n,orientation:r=bA,...o}=e,s=Zee(r)?r:bA,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return C.jsx(Sf.div,{"data-orientation":s,...c,...o,ref:t})});HD.displayName=Gee;function Zee(e){return Kee.includes(e)}var Yee=HD;function Wee(e){const{authView:t="SIGN_IN",enabled:n=!0}={},{hooks:{useSession:r},basePath:o,viewPaths:s,replace:l}=P.useContext(vt),{data:c,isPending:d,error:f,refetch:p}=r(),h=c;return P.useEffect(()=>{if(!n||d||h)return;const v=new URLSearchParams(window.location.search).get("redirectTo")||window.location.pathname+window.location.search;l(`${o}/${s[t]}?redirectTo=${encodeURIComponent(v)}`)},[d,h,o,s,l,t,n]),{data:h,user:h?.user,isPending:d,error:f,refetch:p}}function nf({className:e,...t}){return C.jsx("div",{"data-slot":"card",className:Ce("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function DS({className:e,...t}){return C.jsx("div",{"data-slot":"card-header",className:Ce("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function GD({className:e,...t}){return C.jsx("div",{"data-slot":"card-title",className:Ce("leading-none font-semibold",e),...t})}function KD({className:e,...t}){return C.jsx("div",{"data-slot":"card-description",className:Ce("text-muted-foreground text-sm",e),...t})}function LS({className:e,...t}){return C.jsx("div",{"data-slot":"card-content",className:Ce("px-6",e),...t})}function wA({className:e,...t}){return C.jsx("div",{"data-slot":"card-footer",className:Ce("flex items-center px-6 [.border-t]:pt-6",e),...t})}function ss({className:e,...t}){return C.jsx("div",{"data-slot":"skeleton",className:Ce("bg-accent animate-pulse rounded-md",e),...t})}var Qee=e4("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function sn({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?sS:"button";return C.jsx(s,{"data-slot":"button",className:Ce(Qee({variant:t,size:n,className:e})),...o})}async function Xee(e,t,n,r){const o=await Jee(e),s=document.createElement("canvas");s.width=s.height=n;const l=s.getContext("2d"),c=Math.min(o.width,o.height),d=(o.width-c)/2,f=(o.height-c)/2,p=c,h=c;l?.drawImage(o,d,f,p,h,0,0,n,n);const g=await new Promise(v=>s.toBlob(v,`image/${r}`));return new File([g],`${t}.${r}`,{type:`image/${r}`})}async function Jee(e){return new Promise((t,n)=>{const r=new Image,o=new FileReader;o.onload=s=>{var l;r.src=(l=s.target)==null?void 0:l.result},r.onload=()=>t(r),r.onerror=s=>n(s),o.readAsDataURL(e)})}async function ete(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}function tte({...e}){return C.jsx(tX,{"data-slot":"dropdown-menu",...e})}function nte({...e}){return C.jsx(nX,{"data-slot":"dropdown-menu-trigger",...e})}function rte({className:e,sideOffset:t=4,...n}){return C.jsx(rX,{children:C.jsx(oX,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ce("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function SA({className:e,inset:t,variant:n="default",...r}){return C.jsx(iX,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ce("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ZD({className:e,...t}){return C.jsx(lX,{"data-slot":"label",className:Ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Pi=gK,YD=P.createContext({}),In=({...e})=>C.jsx(YD.Provider,{value:{name:e.name},children:C.jsx(pK,{...e})}),$S=()=>{const e=P.useContext(YD),t=P.useContext(WD),{getFieldState:n}=mK(),r=qN({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},WD=P.createContext({});function Pn({className:e,...t}){const n=P.useId();return C.jsx(WD.Provider,{value:{id:n},children:C.jsx("div",{"data-slot":"form-item",className:Ce("grid gap-2",e),...t})})}function Mn({className:e,...t}){const{error:n,formItemId:r}=$S();return C.jsx(ZD,{"data-slot":"form-label","data-error":!!n,className:Ce("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function qn({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=$S();return C.jsx(sS,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function Wn({className:e,...t}){const{error:n,formMessageId:r}=$S(),o=n?String(n?.message??""):t.children;return o?C.jsx("p",{"data-slot":"form-message",id:r,className:Ce("text-destructive text-sm",e),...t,children:o}):null}function ni({className:e,type:t,...n}){return C.jsx("input",{type:t,"data-slot":"input",className:Ce("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function QD({className:e,...t}){return C.jsx(vX,{"data-slot":"avatar",className:Ce("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function XD({className:e,...t}){return C.jsx(yX,{"data-slot":"avatar-image",className:Ce("aspect-square size-full",e),...t})}function JD({className:e,...t}){return C.jsx(_X,{"data-slot":"avatar-fallback",className:Ce("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function ote({className:e,classNames:t,isPending:n,size:r,organization:o,localization:s,...l}){const{localization:c,avatar:d}=P.useContext(vt),f=P.useMemo(()=>({...c,...s}),[c,s]),p=o?.name,h=o?.logo;return n?C.jsx(ss,{className:Ce("shrink-0 rounded-full",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base,t?.skeleton)}):C.jsxs(QD,{className:Ce("bg-muted",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base),...l,children:[d?.Image?C.jsx(d.Image,{alt:p||f?.ORGANIZATION,className:t?.image,src:h||""}):C.jsx(XD,{alt:p||f?.ORGANIZATION,className:t?.image,src:h||void 0}),C.jsx(JD,{className:Ce("text-foreground",t?.fallback),delayMs:h?600:void 0,children:C.jsx(tK,{className:Ce("size-[50%]",t?.fallbackIcon)})})]})}function e5({className:e,classNames:t,isPending:n,size:r,organization:o,localization:s}){const{localization:l}=P.useContext(vt),c={...l,...s};return C.jsxs("div",{className:Ce("flex items-center gap-2 truncate",e,t?.base),children:[C.jsx(ote,{className:Ce(r!=="sm"&&"my-0.5"),classNames:t?.avatar,isPending:n,localization:c,organization:o,size:r}),C.jsx("div",{className:Ce("flex flex-col truncate text-left leading-tight",t?.content),children:n?C.jsxs(C.Fragment,{children:[C.jsx(ss,{className:Ce("max-w-full",r==="lg"?"h-4.5 w-32":"h-3.5 w-24",t?.title,t?.skeleton)}),r!=="sm"&&C.jsx(ss,{className:Ce("mt-1.5 max-w-full",r==="lg"?"h-3.5 w-24":"h-3 w-16",t?.subtitle,t?.skeleton)})]}):C.jsxs(C.Fragment,{children:[C.jsx("span",{className:Ce("truncate font-semibold",r==="lg"?"text-base":"text-sm",t?.title),children:o?.name||c?.ORGANIZATION}),r!=="sm"&&o?.slug&&C.jsx("span",{className:Ce("truncate opacity-70",r==="lg"?"text-sm":"text-xs",t?.subtitle),children:o.slug})]})})]})}function ite(e,t){if(!e)return null;try{const n=e.trim().toLowerCase(),o=new TextEncoder().encode(n),s=xX(NX(o)),l=t?.jpg?".jpg":"";let c=`https://gravatar.com/avatar/${s}${l}`;const d=new URLSearchParams;t?.size&&d.append("s",Math.min(Math.max(t.size,1),2048).toString()),t?.d&&d.append("d",t.d),t?.forceDefault&&d.append("f","y");const f=d.toString();return f&&(c+=`?${f}`),c}catch(n){return console.error("Error generating Gravatar URL:",n),null}}function ste({className:e,classNames:t,isPending:n,size:r,user:o,localization:s,...l}){const{localization:c,gravatar:d,avatar:f}=P.useContext(vt),p={...c,...s},h=o?.displayName||o?.name||o?.fullName||o?.firstName||o?.displayUsername||o?.username||o?.email,g=o?.image||o?.avatar||o?.avatarUrl,v=d&&o?.email?ite(o.email,d===!0?void 0:d):null,_=d?v:g;return n?C.jsx(ss,{className:Ce("shrink-0 rounded-full",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base,t?.skeleton)}):C.jsxs(QD,{className:Ce("bg-muted",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base),...l,children:[f?.Image?C.jsx(f.Image,{alt:h||p?.USER,className:t?.image,src:_||""}):C.jsx(XD,{alt:h||p?.USER,className:t?.image,src:_||void 0}),C.jsx(JD,{className:Ce("text-foreground uppercase",t?.fallback),delayMs:_?600:void 0,children:ate(h)||C.jsx(cK,{className:Ce("size-[50%]",t?.fallbackIcon)})})]})}var ate=e=>e?.slice(0,2);function jS({className:e,...t}){return C.jsx(sD,{"data-slot":"checkbox",className:Ce("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:C.jsx(lD,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:C.jsx(LN,{className:"size-3.5"})})})}function lte({className:e,...t}){return C.jsx("textarea",{"data-slot":"textarea",className:Ce("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var cte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M9.438 31.401a7 7 0 0 1-1.656-1.536a20 20 0 0 1-1.422-1.938a18.9 18.9 0 0 1-2.375-4.849c-.667-2-.99-3.917-.99-5.792c0-2.094.453-3.922 1.339-5.458a7.7 7.7 0 0 1 2.797-2.906a7.45 7.45 0 0 1 3.786-1.12q.705.002 1.51.198c.385.109.854.281 1.427.495c.729.281 1.13.453 1.266.495c.427.156.786.224 1.068.224c.214 0 .516-.068.859-.172c.193-.068.557-.188 1.078-.411c.516-.188.922-.349 1.245-.469c.495-.146.974-.281 1.401-.349a6.7 6.7 0 0 1 1.531-.063a9 9 0 0 1 2.589.557c1.359.547 2.458 1.401 3.276 2.615a6.4 6.4 0 0 0-.969.734a8.2 8.2 0 0 0-1.641 2.005a6.8 6.8 0 0 0-.859 3.359c.021 1.443.391 2.714 1.12 3.813a7.2 7.2 0 0 0 2.047 2.047c.417.281.776.474 1.12.604c-.161.5-.333.984-.536 1.464a19 19 0 0 1-1.667 3.083c-.578.839-1.031 1.464-1.375 1.88c-.536.635-1.052 1.12-1.573 1.458c-.573.38-1.25.583-1.938.583a4.4 4.4 0 0 1-1.38-.167c-.385-.13-.766-.271-1.141-.432a9 9 0 0 0-1.203-.453a6.3 6.3 0 0 0-3.099-.005c-.417.12-.818.26-1.214.432c-.557.234-.927.391-1.141.458c-.427.125-.87.203-1.318.229c-.693 0-1.339-.198-1.979-.599zm9.14-24.615c-.906.453-1.771.646-2.63.583c-.135-.865 0-1.75.359-2.719a7.3 7.3 0 0 1 1.333-2.24A7.1 7.1 0 0 1 19.812.733q1.319-.68 2.521-.734c.104.906 0 1.797-.333 2.76a8 8 0 0 1-1.333 2.344a6.8 6.8 0 0 1-2.115 1.682z",fill:"currentColor"})}),ute=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 199",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M216.856 16.597A208.5 208.5 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046q-29.538-4.442-58.533 0c-1.832-4.4-4.55-9.933-6.846-14.046a207.8 207.8 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161 161 0 0 0 79.735 175.3a136.4 136.4 0 0 1-21.846-10.632a109 109 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a132 132 0 0 0 5.355 4.237a136 136 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848c21.142-6.58 42.646-16.637 64.815-33.213c5.316-56.288-9.08-105.09-38.056-148.36M85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2s23.236 11.804 23.015 26.2c.02 14.375-10.148 26.18-23.015 26.18m85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2c0 14.375-10.148 26.18-23.015 26.18",fill:"#5865f2"})}),dte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 218",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M63.995 0L0 40.771l63.995 40.772L128 40.771zM192 0l-64 40.775l64 40.775l64.001-40.775zM0 122.321l63.995 40.772L128 122.321L63.995 81.55zM192 81.55l-64 40.775l64 40.774l64-40.774zM64 176.771l64.005 40.772L192 176.771L128.005 136z",fill:"#0061ff"})}),fte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M256 128C256 57.308 198.692 0 128 0S0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445",fill:"#1877f2"}),C.jsx("path",{d:"m177.825 165l5.675-37H148v-24.01C148 93.866 152.959 84 168.86 84H185V52.5S170.352 50 156.347 50C127.11 50 108 67.72 108 99.8V128H75.5v37H108v89.445A129 129 0 0 0 128 256a129 129 0 0 0 20-1.555V165z",fill:"#fff"})]}),hte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",fill:"currentColor"})}),pte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 236",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"m128.075 236.075l47.104-144.97H80.97z",fill:"#e24329"}),C.jsx("path",{d:"M128.075 236.074L80.97 91.104H14.956z",fill:"#fc6d26"}),C.jsx("path",{d:"M14.956 91.104L.642 135.16a9.75 9.75 0 0 0 3.542 10.903l123.891 90.012z",fill:"#fca326"}),C.jsx("path",{d:"M14.956 91.105H80.97L52.601 3.79c-1.46-4.493-7.816-4.492-9.275 0z",fill:"#e24329"}),C.jsx("path",{d:"m128.075 236.074l47.104-144.97h66.015z",fill:"#fc6d26"}),C.jsx("path",{d:"m241.194 91.104l14.314 44.056a9.75 9.75 0 0 1-3.543 10.903l-123.89 90.012z",fill:"#fca326"}),C.jsx("path",{d:"M241.194 91.105h-66.015l28.37-87.315c1.46-4.493 7.816-4.492 9.275 0z",fill:"#e24329"})]}),mte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285f4"}),C.jsx("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34a853"}),C.jsx("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z",fill:"#fbbc05"}),C.jsx("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#eb4335"})]}),gte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378c0 1.112.178 2.181.503 3.185c.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284c.278.173.48.408.71.694c.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542c.01.026.653 1.552 1.657 2.54c.616.605 1.01 1.223 1.082 1.912c.055.537-.096 1.059-.38 1.572c.637.121 1.294.187 1.967.187c.657 0 1.298-.063 1.921-.178c-.287-.517-.44-1.041-.384-1.581c.07-.69.465-1.307 1.081-1.913c1.004-.987 1.647-2.513 1.657-2.539c.021-.074.083-.285.233-.542c.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952c.23-.286.432-.52.71-.694c.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174a1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094c-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71c-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013a1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921a.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92a.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164c1.607-.007 2.984-1.155 3.572-1.164c.196-.003.305.12.305.454c0 .886-.424 2.328-1.563 3.202c-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026l-.01.008l-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116a1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243a1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444c-.034-.016-.104-.008-.2.022q-.094.03-.216.087q-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096a3 3 0 0 0-.26.219a2 2 0 0 0-.12.121a2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203c0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194c-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858s-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64c-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647s2.822 2.813 2.562 3.244s-1.176-.506-1.176-.506s-2.866-2.567-3.49-1.898s.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405c-.238.839-2.71-1.587-3.216-.642c-.506.946 3.49 2.056 3.522 2.064c1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194c1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858s.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64c.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647s-2.822 2.813-2.562 3.244s1.176-.506 1.176-.506s2.866-2.567 3.49-1.898s-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405c.238.839 2.71-1.587 3.216-.642c.506.946-3.49 2.056-3.522 2.064c-1.29.33-4.568 1.028-5.713-.624"})}),vte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M1.333 0h8v5.333H12V2.667h2.667V0h8v8H20v2.667h-2.667v2.666H20V16h2.667v8h-8v-2.667H12v-2.666H9.333V24h-8Z"})}),yte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M2.886 4.18A11.98 11.98 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556q-.787.496-1.65.866L.951 7.277q.371-.863.866-1.65ZM.322 9.163l14.515 14.515q-1.066.26-2.195.322L0 11.358a12 12 0 0 1 .322-2.195m-.17 4.862l9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"})}),_te=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M116 3H12a8.91 8.91 0 0 0-9 8.8v104.42a8.91 8.91 0 0 0 9 8.78h104a8.93 8.93 0 0 0 9-8.81V11.77A8.93 8.93 0 0 0 116 3",fill:"#0076b2"}),C.jsx("path",{d:"M21.06 48.73h18.11V107H21.06zm9.06-29a10.5 10.5 0 1 1-10.5 10.49a10.5 10.5 0 0 1 10.5-10.49m20.41 29h17.36v8h.24c2.42-4.58 8.32-9.41 17.13-9.41C103.6 47.28 107 59.35 107 75v32H88.89V78.65c0-6.75-.12-15.44-9.41-15.44s-10.87 7.36-10.87 15V107H50.53z",fill:"#fff"})]}),bte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M121.666 121.666H0V0h121.666z",fill:"#f1511b"}),C.jsx("path",{d:"M256 121.666H134.335V0H256z",fill:"#80cc28"}),C.jsx("path",{d:"M121.663 256.002H0V134.336h121.663z",fill:"#00adef"}),C.jsx("path",{d:"M256 256.002H134.335V134.336H256z",fill:"#fbbc09"})]}),wte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514c-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233l4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632"})}),Ste=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("circle",{cx:"128",cy:"128",fill:"#ff4500",r:"128"}),C.jsx("path",{d:"M213.15 129.22c0-10.376-8.391-18.617-18.617-18.617a18.74 18.74 0 0 0-12.97 5.189c-12.818-9.157-30.368-15.107-49.9-15.87l8.544-39.981l27.773 5.95c.307 7.02 6.104 12.667 13.278 12.667c7.324 0 13.275-5.95 13.275-13.278c0-7.324-5.95-13.275-13.275-13.275c-5.188 0-9.768 3.052-11.904 7.478l-30.976-6.562c-.916-.154-1.832 0-2.443.458c-.763.458-1.22 1.22-1.371 2.136l-9.464 44.558c-19.837.612-37.692 6.562-50.662 15.872a18.74 18.74 0 0 0-12.971-5.188c-10.377 0-18.617 8.391-18.617 18.617c0 7.629 4.577 14.037 10.988 16.939a33.6 33.6 0 0 0-.458 5.646c0 28.686 33.42 52.036 74.621 52.036c41.202 0 74.622-23.196 74.622-52.036a35 35 0 0 0-.458-5.646c6.408-2.902 10.985-9.464 10.985-17.093M85.272 142.495c0-7.324 5.95-13.275 13.278-13.275c7.324 0 13.275 5.95 13.275 13.275s-5.95 13.278-13.275 13.278c-7.327.15-13.278-5.953-13.278-13.278m74.317 35.251c-9.156 9.157-26.553 9.768-31.588 9.768c-5.188 0-22.584-.765-31.59-9.768c-1.371-1.373-1.371-3.51 0-4.883c1.374-1.371 3.51-1.371 4.884 0c5.8 5.8 18.008 7.782 26.706 7.782s21.058-1.983 26.704-7.782c1.374-1.371 3.51-1.371 4.884 0c1.22 1.373 1.22 3.51 0 4.883m-2.443-21.822c-7.325 0-13.275-5.95-13.275-13.275s5.95-13.275 13.275-13.275c7.327 0 13.277 5.95 13.277 13.275c0 7.17-5.95 13.275-13.277 13.275",fill:"#fff"})]}),Ete=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M18.926 23.998L0 18.892L5.075.002L24 5.108ZM15.348 10.09l-5.282-1.453l-1.414 5.273l5.282 1.453z",fill:"currentColor"})}),xte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M6 15a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2h2zm1 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2a2 2 0 0 1-2-2zm2-8a2 2 0 0 1-2-2a2 2 0 0 1 2-2a2 2 0 0 1 2 2v2zm0 1a2 2 0 0 1 2 2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2a2 2 0 0 1 2-2zm8 2a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2h-2zm-1 0a2 2 0 0 1-2 2a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2a2 2 0 0 1 2 2zm-2 8a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2v-2zm0-1a2 2 0 0 1-2-2a2 2 0 0 1 2-2h5a2 2 0 0 1 2 2a2 2 0 0 1-2 2z"})}),Rte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M128 0C57.308 0 0 57.309 0 128c0 70.696 57.309 128 128 128c70.697 0 128-57.304 128-128C256 57.314 198.697.007 127.998.007zm58.699 184.614c-2.293 3.76-7.215 4.952-10.975 2.644c-30.053-18.357-67.885-22.515-112.44-12.335a7.98 7.98 0 0 1-9.552-6.007a7.97 7.97 0 0 1 6-9.553c48.76-11.14 90.583-6.344 124.323 14.276c3.76 2.308 4.952 7.215 2.644 10.975m15.667-34.853c-2.89 4.695-9.034 6.178-13.726 3.289c-34.406-21.148-86.853-27.273-127.548-14.92c-5.278 1.594-10.852-1.38-12.454-6.649c-1.59-5.278 1.386-10.842 6.655-12.446c46.485-14.106 104.275-7.273 143.787 17.007c4.692 2.89 6.175 9.034 3.286 13.72zm1.345-36.293C162.457 88.964 94.394 86.71 55.007 98.666c-6.325 1.918-13.014-1.653-14.93-7.978c-1.917-6.328 1.65-13.012 7.98-14.935C93.27 62.027 168.434 64.68 215.929 92.876c5.702 3.376 7.566 10.724 4.188 16.405c-3.362 5.69-10.73 7.565-16.4 4.187z",fill:"#1ed760"})}),Ote=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 290",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M189.72 104.421c18.678 13.345 41.56 21.197 66.273 21.197v-47.53a67 67 0 0 1-13.918-1.456v37.413c-24.711 0-47.59-7.851-66.272-21.195v96.996c0 48.523-39.356 87.855-87.9 87.855c-18.113 0-34.949-5.473-48.934-14.86c15.962 16.313 38.222 26.432 62.848 26.432c48.548 0 87.905-39.332 87.905-87.857v-96.995zm17.17-47.952c-9.546-10.423-15.814-23.893-17.17-38.785v-6.113h-13.189c3.32 18.927 14.644 35.097 30.358 44.898M69.673 225.607a40 40 0 0 1-8.203-24.33c0-22.192 18.001-40.186 40.21-40.186a40.3 40.3 0 0 1 12.197 1.883v-48.593c-4.61-.631-9.262-.9-13.912-.801v37.822a40.3 40.3 0 0 0-12.203-1.882c-22.208 0-40.208 17.992-40.208 40.187c0 15.694 8.997 29.281 22.119 35.9",fill:"#ff004f"}),C.jsx("path",{d:"M175.803 92.849c18.683 13.344 41.56 21.195 66.272 21.195V76.631c-13.794-2.937-26.005-10.141-35.186-20.162c-15.715-9.802-27.038-25.972-30.358-44.898h-34.643v189.843c-.079 22.132-18.049 40.052-40.21 40.052c-13.058 0-24.66-6.221-32.007-15.86c-13.12-6.618-22.118-20.206-22.118-35.898c0-22.193 18-40.187 40.208-40.187c4.255 0 8.356.662 12.203 1.882v-37.822c-47.692.985-86.047 39.933-86.047 87.834c0 23.912 9.551 45.589 25.053 61.428c13.985 9.385 30.82 14.86 48.934 14.86c48.545 0 87.9-39.335 87.9-87.857z"}),C.jsx("path",{d:"M242.075 76.63V66.516a66.3 66.3 0 0 1-35.186-10.047a66.47 66.47 0 0 0 35.186 20.163M176.53 11.57a68 68 0 0 1-.728-5.457V0h-47.834v189.845c-.076 22.13-18.046 40.05-40.208 40.05a40.06 40.06 0 0 1-18.09-4.287c7.347 9.637 18.949 15.857 32.007 15.857c22.16 0 40.132-17.918 40.21-40.05V11.571zM99.966 113.58v-10.769a89 89 0 0 0-12.061-.818C39.355 101.993 0 141.327 0 189.845c0 30.419 15.467 57.227 38.971 72.996c-15.502-15.838-25.053-37.516-25.053-61.427c0-47.9 38.354-86.848 86.048-87.833",fill:"#00f2ea"})]}),Tte=({className:e})=>C.jsxs("svg",{className:e,version:"1.1",viewBox:"0 0 2400 2800",x:"0px",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",y:"0px",children:[C.jsx("style",{type:"text/css",children:`
|
|
129
|
+
}`,fc={},j_,cA;function FD(){return cA||(cA=1,j_={L:1,M:0,Q:3,H:2}),j_}var z_,uA;function BD(){return uA||(uA=1,z_={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),z_}var U_,dA;function $ee(){if(dA)return U_;dA=1;var e=BD();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},U_=t,U_}var F_,fA;function jee(){if(fA)return F_;fA=1;var e=FD();function t(n,r){this.totalCount=n,this.dataCount=r}return t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(n,r){var o=t.getRsBlockTable(n,r);if(o==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var s=o.length/3,l=new Array,c=0;c<s;c++)for(var d=o[c*3+0],f=o[c*3+1],p=o[c*3+2],h=0;h<d;h++)l.push(new t(f,p));return l},t.getRsBlockTable=function(n,r){switch(r){case e.L:return t.RS_BLOCK_TABLE[(n-1)*4+0];case e.M:return t.RS_BLOCK_TABLE[(n-1)*4+1];case e.Q:return t.RS_BLOCK_TABLE[(n-1)*4+2];case e.H:return t.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},F_=t,F_}var B_,hA;function zee(){if(hA)return B_;hA=1;function e(){this.buffer=new Array,this.length=0}return e.prototype={get:function(t){var n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)==1},put:function(t,n){for(var r=0;r<n;r++)this.putBit((t>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},B_=e,B_}var V_,pA;function VD(){if(pA)return V_;pA=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)e.EXP_TABLE[t]=e.EXP_TABLE[t-4]^e.EXP_TABLE[t-5]^e.EXP_TABLE[t-6]^e.EXP_TABLE[t-8];for(var t=0;t<255;t++)e.LOG_TABLE[e.EXP_TABLE[t]]=t;return V_=e,V_}var q_,mA;function qD(){if(mA)return q_;mA=1;var e=VD();function t(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var o=0;o<n.length&&n[o]==0;)o++;this.num=new Array(n.length-o+r);for(var s=0;s<n.length-o;s++)this.num[s]=n[s+o]}return t.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),o=0;o<this.getLength();o++)for(var s=0;s<n.getLength();s++)r[o+s]^=e.gexp(e.glog(this.get(o))+e.glog(n.get(s)));return new t(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=e.glog(this.get(0))-e.glog(n.get(0)),o=new Array(this.getLength()),s=0;s<this.getLength();s++)o[s]=this.get(s);for(var s=0;s<n.getLength();s++)o[s]^=e.gexp(e.glog(n.get(s))+r);return new t(o,0).mod(n)}},q_=t,q_}var H_,gA;function Uee(){if(gA)return H_;gA=1;var e=BD(),t=qD(),n=VD(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},o={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){for(var l=s<<10;o.getBCHDigit(l)-o.getBCHDigit(o.G15)>=0;)l^=o.G15<<o.getBCHDigit(l)-o.getBCHDigit(o.G15);return(s<<10|l)^o.G15_MASK},getBCHTypeNumber:function(s){for(var l=s<<12;o.getBCHDigit(l)-o.getBCHDigit(o.G18)>=0;)l^=o.G18<<o.getBCHDigit(l)-o.getBCHDigit(o.G18);return s<<12|l},getBCHDigit:function(s){for(var l=0;s!=0;)l++,s>>>=1;return l},getPatternPosition:function(s){return o.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,l,c){switch(s){case r.PATTERN000:return(l+c)%2==0;case r.PATTERN001:return l%2==0;case r.PATTERN010:return c%3==0;case r.PATTERN011:return(l+c)%3==0;case r.PATTERN100:return(Math.floor(l/2)+Math.floor(c/3))%2==0;case r.PATTERN101:return l*c%2+l*c%3==0;case r.PATTERN110:return(l*c%2+l*c%3)%2==0;case r.PATTERN111:return(l*c%3+(l+c)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){for(var l=new t([1],0),c=0;c<s;c++)l=l.multiply(new t([1,n.gexp(c)],0));return l},getLengthInBits:function(s,l){if(1<=l&&l<10)switch(s){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(l<27)switch(s){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(l<41)switch(s){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+l)},getLostPoint:function(s){for(var l=s.getModuleCount(),c=0,d=0;d<l;d++)for(var f=0;f<l;f++){for(var p=0,h=s.isDark(d,f),g=-1;g<=1;g++)if(!(d+g<0||l<=d+g))for(var v=-1;v<=1;v++)f+v<0||l<=f+v||g==0&&v==0||h==s.isDark(d+g,f+v)&&p++;p>5&&(c+=3+p-5)}for(var d=0;d<l-1;d++)for(var f=0;f<l-1;f++){var _=0;s.isDark(d,f)&&_++,s.isDark(d+1,f)&&_++,s.isDark(d,f+1)&&_++,s.isDark(d+1,f+1)&&_++,(_==0||_==4)&&(c+=3)}for(var d=0;d<l;d++)for(var f=0;f<l-6;f++)s.isDark(d,f)&&!s.isDark(d,f+1)&&s.isDark(d,f+2)&&s.isDark(d,f+3)&&s.isDark(d,f+4)&&!s.isDark(d,f+5)&&s.isDark(d,f+6)&&(c+=40);for(var f=0;f<l;f++)for(var d=0;d<l-6;d++)s.isDark(d,f)&&!s.isDark(d+1,f)&&s.isDark(d+2,f)&&s.isDark(d+3,f)&&s.isDark(d+4,f)&&!s.isDark(d+5,f)&&s.isDark(d+6,f)&&(c+=40);for(var b=0,f=0;f<l;f++)for(var d=0;d<l;d++)s.isDark(d,f)&&b++;var x=Math.abs(100*b/l/l-50)/5;return c+=x*10,c}};return H_=o,H_}var G_,vA;function Fee(){if(vA)return G_;vA=1;var e=$ee(),t=jee(),n=zee(),r=Uee(),o=qD();function s(c,d){this.typeNumber=c,this.errorCorrectLevel=d,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var l=s.prototype;return l.addData=function(c){var d=new e(c);this.dataList.push(d),this.dataCache=null},l.isDark=function(c,d){if(c<0||this.moduleCount<=c||d<0||this.moduleCount<=d)throw new Error(c+","+d);return this.modules[c][d]},l.getModuleCount=function(){return this.moduleCount},l.make=function(){if(this.typeNumber<1){var c=1;for(c=1;c<40;c++){for(var d=t.getRSBlocks(c,this.errorCorrectLevel),f=new n,p=0,h=0;h<d.length;h++)p+=d[h].dataCount;for(var h=0;h<this.dataList.length;h++){var g=this.dataList[h];f.put(g.mode,4),f.put(g.getLength(),r.getLengthInBits(g.mode,c)),g.write(f)}if(f.getLengthInBits()<=p*8)break}this.typeNumber=c}this.makeImpl(!1,this.getBestMaskPattern())},l.makeImpl=function(c,d){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var f=0;f<this.moduleCount;f++){this.modules[f]=new Array(this.moduleCount);for(var p=0;p<this.moduleCount;p++)this.modules[f][p]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(c,d),this.typeNumber>=7&&this.setupTypeNumber(c),this.dataCache==null&&(this.dataCache=s.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,d)},l.setupPositionProbePattern=function(c,d){for(var f=-1;f<=7;f++)if(!(c+f<=-1||this.moduleCount<=c+f))for(var p=-1;p<=7;p++)d+p<=-1||this.moduleCount<=d+p||(0<=f&&f<=6&&(p==0||p==6)||0<=p&&p<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=p&&p<=4?this.modules[c+f][d+p]=!0:this.modules[c+f][d+p]=!1)},l.getBestMaskPattern=function(){for(var c=0,d=0,f=0;f<8;f++){this.makeImpl(!0,f);var p=r.getLostPoint(this);(f==0||c>p)&&(c=p,d=f)}return d},l.createMovieClip=function(c,d,f){var p=c.createEmptyMovieClip(d,f),h=1;this.make();for(var g=0;g<this.modules.length;g++)for(var v=g*h,_=0;_<this.modules[g].length;_++){var b=_*h,x=this.modules[g][_];x&&(p.beginFill(0,100),p.moveTo(b,v),p.lineTo(b+h,v),p.lineTo(b+h,v+h),p.lineTo(b,v+h),p.endFill())}return p},l.setupTimingPattern=function(){for(var c=8;c<this.moduleCount-8;c++)this.modules[c][6]==null&&(this.modules[c][6]=c%2==0);for(var d=8;d<this.moduleCount-8;d++)this.modules[6][d]==null&&(this.modules[6][d]=d%2==0)},l.setupPositionAdjustPattern=function(){for(var c=r.getPatternPosition(this.typeNumber),d=0;d<c.length;d++)for(var f=0;f<c.length;f++){var p=c[d],h=c[f];if(this.modules[p][h]==null)for(var g=-2;g<=2;g++)for(var v=-2;v<=2;v++)g==-2||g==2||v==-2||v==2||g==0&&v==0?this.modules[p+g][h+v]=!0:this.modules[p+g][h+v]=!1}},l.setupTypeNumber=function(c){for(var d=r.getBCHTypeNumber(this.typeNumber),f=0;f<18;f++){var p=!c&&(d>>f&1)==1;this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=p}for(var f=0;f<18;f++){var p=!c&&(d>>f&1)==1;this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=p}},l.setupTypeInfo=function(c,d){for(var f=this.errorCorrectLevel<<3|d,p=r.getBCHTypeInfo(f),h=0;h<15;h++){var g=!c&&(p>>h&1)==1;h<6?this.modules[h][8]=g:h<8?this.modules[h+1][8]=g:this.modules[this.moduleCount-15+h][8]=g}for(var h=0;h<15;h++){var g=!c&&(p>>h&1)==1;h<8?this.modules[8][this.moduleCount-h-1]=g:h<9?this.modules[8][15-h-1+1]=g:this.modules[8][15-h-1]=g}this.modules[this.moduleCount-8][8]=!c},l.mapData=function(c,d){for(var f=-1,p=this.moduleCount-1,h=7,g=0,v=this.moduleCount-1;v>0;v-=2)for(v==6&&v--;;){for(var _=0;_<2;_++)if(this.modules[p][v-_]==null){var b=!1;g<c.length&&(b=(c[g]>>>h&1)==1);var x=r.getMask(d,p,v-_);x&&(b=!b),this.modules[p][v-_]=b,h--,h==-1&&(g++,h=7)}if(p+=f,p<0||this.moduleCount<=p){p-=f,f=-f;break}}},s.PAD0=236,s.PAD1=17,s.createData=function(c,d,f){for(var p=t.getRSBlocks(c,d),h=new n,g=0;g<f.length;g++){var v=f[g];h.put(v.mode,4),h.put(v.getLength(),r.getLengthInBits(v.mode,c)),v.write(h)}for(var _=0,g=0;g<p.length;g++)_+=p[g].dataCount;if(h.getLengthInBits()>_*8)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+_*8+")");for(h.getLengthInBits()+4<=_*8&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;!(h.getLengthInBits()>=_*8||(h.put(s.PAD0,8),h.getLengthInBits()>=_*8));)h.put(s.PAD1,8);return s.createBytes(h,p)},s.createBytes=function(c,d){for(var f=0,p=0,h=0,g=new Array(d.length),v=new Array(d.length),_=0;_<d.length;_++){var b=d[_].dataCount,x=d[_].totalCount-b;p=Math.max(p,b),h=Math.max(h,x),g[_]=new Array(b);for(var S=0;S<g[_].length;S++)g[_][S]=255&c.buffer[S+f];f+=b;var E=r.getErrorCorrectPolynomial(x),T=new o(g[_],E.getLength()-1),R=T.mod(E);v[_]=new Array(E.getLength()-1);for(var S=0;S<v[_].length;S++){var O=S+R.getLength()-v[_].length;v[_][S]=O>=0?R.get(O):0}}for(var A=0,S=0;S<d.length;S++)A+=d[S].totalCount;for(var I=new Array(A),M=0,S=0;S<p;S++)for(var _=0;_<d.length;_++)S<g[_].length&&(I[M++]=g[_][S]);for(var S=0;S<h;S++)for(var _=0;_<d.length;_++)S<v[_].length&&(I[M++]=v[_][S]);return I},G_=s,G_}var _p={},yA;function Bee(){if(yA)return _p;yA=1,Object.defineProperty(_p,"__esModule",{value:!0});var e=Object.assign||function(f){for(var p=1;p<arguments.length;p++){var h=arguments[p];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(f[g]=h[g])}return f},t=NS(),n=s(t),r=ma(),o=s(r);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,p){var h={};for(var g in f)p.indexOf(g)>=0||Object.prototype.hasOwnProperty.call(f,g)&&(h[g]=f[g]);return h}var c={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},d=(0,r.forwardRef)(function(f,p){var h=f.bgColor,g=f.bgD,v=f.fgD,_=f.fgColor,b=f.size,x=f.title,S=f.viewBoxSize,E=f.xmlns,T=E===void 0?"http://www.w3.org/2000/svg":E,R=l(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return o.default.createElement("svg",e({},R,{height:b,ref:p,viewBox:"0 0 "+S+" "+S,width:b,xmlns:T}),x?o.default.createElement("title",null,x):null,o.default.createElement("path",{d:g,fill:h}),o.default.createElement("path",{d:v,fill:_}))});return d.displayName="QRCodeSvg",d.propTypes=c,_p.default=d,_p}var _A;function Vee(){if(_A)return fc;_A=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.QRCode=void 0;var e=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var S=arguments[x];for(var E in S)Object.prototype.hasOwnProperty.call(S,E)&&(b[E]=S[E])}return b},t=NS(),n=h(t),r=FD(),o=h(r),s=Fee(),l=h(s),c=ma(),d=h(c),f=Bee(),p=h(f);function h(b){return b&&b.__esModule?b:{default:b}}function g(b,x){var S={};for(var E in b)x.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(b,E)&&(S[E]=b[E]);return S}var v={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},_=(0,c.forwardRef)(function(b,x){var S=b.bgColor,E=S===void 0?"#FFFFFF":S,T=b.fgColor,R=T===void 0?"#000000":T,O=b.level,A=O===void 0?"L":O,I=b.size,M=I===void 0?256:I,L=b.value,q=g(b,["bgColor","fgColor","level","size","value"]),j=new l.default(-1,o.default[A]);j.addData(L),j.make();var B=j.modules;return d.default.createElement(p.default,e({},q,{bgColor:E,bgD:B.map(function(F,Z){return F.map(function(ie,H){return ie?"":"M "+H+" "+Z+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:B.map(function(F,Z){return F.map(function(ie,H){return ie?"M "+H+" "+Z+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:x,size:M,viewBoxSize:B.length}))});return fc.QRCode=_,_.displayName="QRCode",_.propTypes=v,fc.default=_,fc}var qee=Vee();const Hee=fl(qee);var Gee="Separator",bA="horizontal",Kee=["horizontal","vertical"],HD=P.forwardRef((e,t)=>{const{decorative:n,orientation:r=bA,...o}=e,s=Zee(r)?r:bA,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return C.jsx(Sf.div,{"data-orientation":s,...c,...o,ref:t})});HD.displayName=Gee;function Zee(e){return Kee.includes(e)}var Yee=HD;function Wee(e){const{authView:t="SIGN_IN",enabled:n=!0}={},{hooks:{useSession:r},basePath:o,viewPaths:s,replace:l}=P.useContext(vt),{data:c,isPending:d,error:f,refetch:p}=r(),h=c;return P.useEffect(()=>{if(!n||d||h)return;const v=new URLSearchParams(window.location.search).get("redirectTo")||window.location.pathname+window.location.search;l(`${o}/${s[t]}?redirectTo=${encodeURIComponent(v)}`)},[d,h,o,s,l,t,n]),{data:h,user:h?.user,isPending:d,error:f,refetch:p}}function nf({className:e,...t}){return C.jsx("div",{"data-slot":"card",className:Ce("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function DS({className:e,...t}){return C.jsx("div",{"data-slot":"card-header",className:Ce("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function GD({className:e,...t}){return C.jsx("div",{"data-slot":"card-title",className:Ce("leading-none font-semibold",e),...t})}function KD({className:e,...t}){return C.jsx("div",{"data-slot":"card-description",className:Ce("text-muted-foreground text-sm",e),...t})}function LS({className:e,...t}){return C.jsx("div",{"data-slot":"card-content",className:Ce("px-6",e),...t})}function wA({className:e,...t}){return C.jsx("div",{"data-slot":"card-footer",className:Ce("flex items-center px-6 [.border-t]:pt-6",e),...t})}function ss({className:e,...t}){return C.jsx("div",{"data-slot":"skeleton",className:Ce("bg-accent animate-pulse rounded-md",e),...t})}var Qee=e4("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function on({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?sS:"button";return C.jsx(s,{"data-slot":"button",className:Ce(Qee({variant:t,size:n,className:e})),...o})}async function Xee(e,t,n,r){const o=await Jee(e),s=document.createElement("canvas");s.width=s.height=n;const l=s.getContext("2d"),c=Math.min(o.width,o.height),d=(o.width-c)/2,f=(o.height-c)/2,p=c,h=c;l?.drawImage(o,d,f,p,h,0,0,n,n);const g=await new Promise(v=>s.toBlob(v,`image/${r}`));return new File([g],`${t}.${r}`,{type:`image/${r}`})}async function Jee(e){return new Promise((t,n)=>{const r=new Image,o=new FileReader;o.onload=s=>{var l;r.src=(l=s.target)==null?void 0:l.result},r.onload=()=>t(r),r.onerror=s=>n(s),o.readAsDataURL(e)})}async function ete(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}function tte({...e}){return C.jsx(tX,{"data-slot":"dropdown-menu",...e})}function nte({...e}){return C.jsx(nX,{"data-slot":"dropdown-menu-trigger",...e})}function rte({className:e,sideOffset:t=4,...n}){return C.jsx(rX,{children:C.jsx(oX,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ce("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function SA({className:e,inset:t,variant:n="default",...r}){return C.jsx(iX,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ce("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ZD({className:e,...t}){return C.jsx(lX,{"data-slot":"label",className:Ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Pi=gK,YD=P.createContext({}),In=({...e})=>C.jsx(YD.Provider,{value:{name:e.name},children:C.jsx(pK,{...e})}),$S=()=>{const e=P.useContext(YD),t=P.useContext(WD),{getFieldState:n}=mK(),r=qN({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},WD=P.createContext({});function Pn({className:e,...t}){const n=P.useId();return C.jsx(WD.Provider,{value:{id:n},children:C.jsx("div",{"data-slot":"form-item",className:Ce("grid gap-2",e),...t})})}function Mn({className:e,...t}){const{error:n,formItemId:r}=$S();return C.jsx(ZD,{"data-slot":"form-label","data-error":!!n,className:Ce("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function qn({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=$S();return C.jsx(sS,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function Wn({className:e,...t}){const{error:n,formMessageId:r}=$S(),o=n?String(n?.message??""):t.children;return o?C.jsx("p",{"data-slot":"form-message",id:r,className:Ce("text-destructive text-sm",e),...t,children:o}):null}function ni({className:e,type:t,...n}){return C.jsx("input",{type:t,"data-slot":"input",className:Ce("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function QD({className:e,...t}){return C.jsx(vX,{"data-slot":"avatar",className:Ce("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function XD({className:e,...t}){return C.jsx(yX,{"data-slot":"avatar-image",className:Ce("aspect-square size-full",e),...t})}function JD({className:e,...t}){return C.jsx(_X,{"data-slot":"avatar-fallback",className:Ce("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function ote({className:e,classNames:t,isPending:n,size:r,organization:o,localization:s,...l}){const{localization:c,avatar:d}=P.useContext(vt),f=P.useMemo(()=>({...c,...s}),[c,s]),p=o?.name,h=o?.logo;return n?C.jsx(ss,{className:Ce("shrink-0 rounded-full",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base,t?.skeleton)}):C.jsxs(QD,{className:Ce("bg-muted",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base),...l,children:[d?.Image?C.jsx(d.Image,{alt:p||f?.ORGANIZATION,className:t?.image,src:h||""}):C.jsx(XD,{alt:p||f?.ORGANIZATION,className:t?.image,src:h||void 0}),C.jsx(JD,{className:Ce("text-foreground",t?.fallback),delayMs:h?600:void 0,children:C.jsx(tK,{className:Ce("size-[50%]",t?.fallbackIcon)})})]})}function e5({className:e,classNames:t,isPending:n,size:r,organization:o,localization:s}){const{localization:l}=P.useContext(vt),c={...l,...s};return C.jsxs("div",{className:Ce("flex items-center gap-2 truncate",e,t?.base),children:[C.jsx(ote,{className:Ce(r!=="sm"&&"my-0.5"),classNames:t?.avatar,isPending:n,localization:c,organization:o,size:r}),C.jsx("div",{className:Ce("flex flex-col truncate text-left leading-tight",t?.content),children:n?C.jsxs(C.Fragment,{children:[C.jsx(ss,{className:Ce("max-w-full",r==="lg"?"h-4.5 w-32":"h-3.5 w-24",t?.title,t?.skeleton)}),r!=="sm"&&C.jsx(ss,{className:Ce("mt-1.5 max-w-full",r==="lg"?"h-3.5 w-24":"h-3 w-16",t?.subtitle,t?.skeleton)})]}):C.jsxs(C.Fragment,{children:[C.jsx("span",{className:Ce("truncate font-semibold",r==="lg"?"text-base":"text-sm",t?.title),children:o?.name||c?.ORGANIZATION}),r!=="sm"&&o?.slug&&C.jsx("span",{className:Ce("truncate opacity-70",r==="lg"?"text-sm":"text-xs",t?.subtitle),children:o.slug})]})})]})}function ite(e,t){if(!e)return null;try{const n=e.trim().toLowerCase(),o=new TextEncoder().encode(n),s=xX(NX(o)),l=t?.jpg?".jpg":"";let c=`https://gravatar.com/avatar/${s}${l}`;const d=new URLSearchParams;t?.size&&d.append("s",Math.min(Math.max(t.size,1),2048).toString()),t?.d&&d.append("d",t.d),t?.forceDefault&&d.append("f","y");const f=d.toString();return f&&(c+=`?${f}`),c}catch(n){return console.error("Error generating Gravatar URL:",n),null}}function ste({className:e,classNames:t,isPending:n,size:r,user:o,localization:s,...l}){const{localization:c,gravatar:d,avatar:f}=P.useContext(vt),p={...c,...s},h=o?.displayName||o?.name||o?.fullName||o?.firstName||o?.displayUsername||o?.username||o?.email,g=o?.image||o?.avatar||o?.avatarUrl,v=d&&o?.email?ite(o.email,d===!0?void 0:d):null,_=d?v:g;return n?C.jsx(ss,{className:Ce("shrink-0 rounded-full",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base,t?.skeleton)}):C.jsxs(QD,{className:Ce("bg-muted",r==="sm"?"size-6":r==="lg"?"size-10":r==="xl"?"size-12":"size-8",e,t?.base),...l,children:[f?.Image?C.jsx(f.Image,{alt:h||p?.USER,className:t?.image,src:_||""}):C.jsx(XD,{alt:h||p?.USER,className:t?.image,src:_||void 0}),C.jsx(JD,{className:Ce("text-foreground uppercase",t?.fallback),delayMs:_?600:void 0,children:ate(h)||C.jsx(cK,{className:Ce("size-[50%]",t?.fallbackIcon)})})]})}var ate=e=>e?.slice(0,2);function jS({className:e,...t}){return C.jsx(sD,{"data-slot":"checkbox",className:Ce("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:C.jsx(lD,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:C.jsx(LN,{className:"size-3.5"})})})}function lte({className:e,...t}){return C.jsx("textarea",{"data-slot":"textarea",className:Ce("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var cte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M9.438 31.401a7 7 0 0 1-1.656-1.536a20 20 0 0 1-1.422-1.938a18.9 18.9 0 0 1-2.375-4.849c-.667-2-.99-3.917-.99-5.792c0-2.094.453-3.922 1.339-5.458a7.7 7.7 0 0 1 2.797-2.906a7.45 7.45 0 0 1 3.786-1.12q.705.002 1.51.198c.385.109.854.281 1.427.495c.729.281 1.13.453 1.266.495c.427.156.786.224 1.068.224c.214 0 .516-.068.859-.172c.193-.068.557-.188 1.078-.411c.516-.188.922-.349 1.245-.469c.495-.146.974-.281 1.401-.349a6.7 6.7 0 0 1 1.531-.063a9 9 0 0 1 2.589.557c1.359.547 2.458 1.401 3.276 2.615a6.4 6.4 0 0 0-.969.734a8.2 8.2 0 0 0-1.641 2.005a6.8 6.8 0 0 0-.859 3.359c.021 1.443.391 2.714 1.12 3.813a7.2 7.2 0 0 0 2.047 2.047c.417.281.776.474 1.12.604c-.161.5-.333.984-.536 1.464a19 19 0 0 1-1.667 3.083c-.578.839-1.031 1.464-1.375 1.88c-.536.635-1.052 1.12-1.573 1.458c-.573.38-1.25.583-1.938.583a4.4 4.4 0 0 1-1.38-.167c-.385-.13-.766-.271-1.141-.432a9 9 0 0 0-1.203-.453a6.3 6.3 0 0 0-3.099-.005c-.417.12-.818.26-1.214.432c-.557.234-.927.391-1.141.458c-.427.125-.87.203-1.318.229c-.693 0-1.339-.198-1.979-.599zm9.14-24.615c-.906.453-1.771.646-2.63.583c-.135-.865 0-1.75.359-2.719a7.3 7.3 0 0 1 1.333-2.24A7.1 7.1 0 0 1 19.812.733q1.319-.68 2.521-.734c.104.906 0 1.797-.333 2.76a8 8 0 0 1-1.333 2.344a6.8 6.8 0 0 1-2.115 1.682z",fill:"currentColor"})}),ute=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 199",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M216.856 16.597A208.5 208.5 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046q-29.538-4.442-58.533 0c-1.832-4.4-4.55-9.933-6.846-14.046a207.8 207.8 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161 161 0 0 0 79.735 175.3a136.4 136.4 0 0 1-21.846-10.632a109 109 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a132 132 0 0 0 5.355 4.237a136 136 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848c21.142-6.58 42.646-16.637 64.815-33.213c5.316-56.288-9.08-105.09-38.056-148.36M85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2s23.236 11.804 23.015 26.2c.02 14.375-10.148 26.18-23.015 26.18m85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2c0 14.375-10.148 26.18-23.015 26.18",fill:"#5865f2"})}),dte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 218",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M63.995 0L0 40.771l63.995 40.772L128 40.771zM192 0l-64 40.775l64 40.775l64.001-40.775zM0 122.321l63.995 40.772L128 122.321L63.995 81.55zM192 81.55l-64 40.775l64 40.774l64-40.774zM64 176.771l64.005 40.772L192 176.771L128.005 136z",fill:"#0061ff"})}),fte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M256 128C256 57.308 198.692 0 128 0S0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445",fill:"#1877f2"}),C.jsx("path",{d:"m177.825 165l5.675-37H148v-24.01C148 93.866 152.959 84 168.86 84H185V52.5S170.352 50 156.347 50C127.11 50 108 67.72 108 99.8V128H75.5v37H108v89.445A129 129 0 0 0 128 256a129 129 0 0 0 20-1.555V165z",fill:"#fff"})]}),hte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",fill:"currentColor"})}),pte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 236",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"m128.075 236.075l47.104-144.97H80.97z",fill:"#e24329"}),C.jsx("path",{d:"M128.075 236.074L80.97 91.104H14.956z",fill:"#fc6d26"}),C.jsx("path",{d:"M14.956 91.104L.642 135.16a9.75 9.75 0 0 0 3.542 10.903l123.891 90.012z",fill:"#fca326"}),C.jsx("path",{d:"M14.956 91.105H80.97L52.601 3.79c-1.46-4.493-7.816-4.492-9.275 0z",fill:"#e24329"}),C.jsx("path",{d:"m128.075 236.074l47.104-144.97h66.015z",fill:"#fc6d26"}),C.jsx("path",{d:"m241.194 91.104l14.314 44.056a9.75 9.75 0 0 1-3.543 10.903l-123.89 90.012z",fill:"#fca326"}),C.jsx("path",{d:"M241.194 91.105h-66.015l28.37-87.315c1.46-4.493 7.816-4.492 9.275 0z",fill:"#e24329"})]}),mte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285f4"}),C.jsx("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34a853"}),C.jsx("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z",fill:"#fbbc05"}),C.jsx("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#eb4335"})]}),gte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378c0 1.112.178 2.181.503 3.185c.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284c.278.173.48.408.71.694c.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542c.01.026.653 1.552 1.657 2.54c.616.605 1.01 1.223 1.082 1.912c.055.537-.096 1.059-.38 1.572c.637.121 1.294.187 1.967.187c.657 0 1.298-.063 1.921-.178c-.287-.517-.44-1.041-.384-1.581c.07-.69.465-1.307 1.081-1.913c1.004-.987 1.647-2.513 1.657-2.539c.021-.074.083-.285.233-.542c.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952c.23-.286.432-.52.71-.694c.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174a1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094c-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71c-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013a1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921a.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92a.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164c1.607-.007 2.984-1.155 3.572-1.164c.196-.003.305.12.305.454c0 .886-.424 2.328-1.563 3.202c-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026l-.01.008l-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116a1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243a1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444c-.034-.016-.104-.008-.2.022q-.094.03-.216.087q-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096a3 3 0 0 0-.26.219a2 2 0 0 0-.12.121a2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203c0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194c-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858s-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64c-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647s2.822 2.813 2.562 3.244s-1.176-.506-1.176-.506s-2.866-2.567-3.49-1.898s.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405c-.238.839-2.71-1.587-3.216-.642c-.506.946 3.49 2.056 3.522 2.064c1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194c1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858s.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64c.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647s-2.822 2.813-2.562 3.244s1.176-.506 1.176-.506s2.866-2.567 3.49-1.898s-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405c.238.839 2.71-1.587 3.216-.642c.506.946-3.49 2.056-3.522 2.064c-1.29.33-4.568 1.028-5.713-.624"})}),vte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M1.333 0h8v5.333H12V2.667h2.667V0h8v8H20v2.667h-2.667v2.666H20V16h2.667v8h-8v-2.667H12v-2.666H9.333V24h-8Z"})}),yte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M2.886 4.18A11.98 11.98 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556q-.787.496-1.65.866L.951 7.277q.371-.863.866-1.65ZM.322 9.163l14.515 14.515q-1.066.26-2.195.322L0 11.358a12 12 0 0 1 .322-2.195m-.17 4.862l9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"})}),_te=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M116 3H12a8.91 8.91 0 0 0-9 8.8v104.42a8.91 8.91 0 0 0 9 8.78h104a8.93 8.93 0 0 0 9-8.81V11.77A8.93 8.93 0 0 0 116 3",fill:"#0076b2"}),C.jsx("path",{d:"M21.06 48.73h18.11V107H21.06zm9.06-29a10.5 10.5 0 1 1-10.5 10.49a10.5 10.5 0 0 1 10.5-10.49m20.41 29h17.36v8h.24c2.42-4.58 8.32-9.41 17.13-9.41C103.6 47.28 107 59.35 107 75v32H88.89V78.65c0-6.75-.12-15.44-9.41-15.44s-10.87 7.36-10.87 15V107H50.53z",fill:"#fff"})]}),bte=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M121.666 121.666H0V0h121.666z",fill:"#f1511b"}),C.jsx("path",{d:"M256 121.666H134.335V0H256z",fill:"#80cc28"}),C.jsx("path",{d:"M121.663 256.002H0V134.336h121.663z",fill:"#00adef"}),C.jsx("path",{d:"M256 256.002H134.335V134.336H256z",fill:"#fbbc09"})]}),wte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514c-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233l4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632"})}),Ste=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("circle",{cx:"128",cy:"128",fill:"#ff4500",r:"128"}),C.jsx("path",{d:"M213.15 129.22c0-10.376-8.391-18.617-18.617-18.617a18.74 18.74 0 0 0-12.97 5.189c-12.818-9.157-30.368-15.107-49.9-15.87l8.544-39.981l27.773 5.95c.307 7.02 6.104 12.667 13.278 12.667c7.324 0 13.275-5.95 13.275-13.278c0-7.324-5.95-13.275-13.275-13.275c-5.188 0-9.768 3.052-11.904 7.478l-30.976-6.562c-.916-.154-1.832 0-2.443.458c-.763.458-1.22 1.22-1.371 2.136l-9.464 44.558c-19.837.612-37.692 6.562-50.662 15.872a18.74 18.74 0 0 0-12.971-5.188c-10.377 0-18.617 8.391-18.617 18.617c0 7.629 4.577 14.037 10.988 16.939a33.6 33.6 0 0 0-.458 5.646c0 28.686 33.42 52.036 74.621 52.036c41.202 0 74.622-23.196 74.622-52.036a35 35 0 0 0-.458-5.646c6.408-2.902 10.985-9.464 10.985-17.093M85.272 142.495c0-7.324 5.95-13.275 13.278-13.275c7.324 0 13.275 5.95 13.275 13.275s-5.95 13.278-13.275 13.278c-7.327.15-13.278-5.953-13.278-13.278m74.317 35.251c-9.156 9.157-26.553 9.768-31.588 9.768c-5.188 0-22.584-.765-31.59-9.768c-1.371-1.373-1.371-3.51 0-4.883c1.374-1.371 3.51-1.371 4.884 0c5.8 5.8 18.008 7.782 26.706 7.782s21.058-1.983 26.704-7.782c1.374-1.371 3.51-1.371 4.884 0c1.22 1.373 1.22 3.51 0 4.883m-2.443-21.822c-7.325 0-13.275-5.95-13.275-13.275s5.95-13.275 13.275-13.275c7.327 0 13.277 5.95 13.277 13.275c0 7.17-5.95 13.275-13.277 13.275",fill:"#fff"})]}),Ete=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M18.926 23.998L0 18.892L5.075.002L24 5.108ZM15.348 10.09l-5.282-1.453l-1.414 5.273l5.282 1.453z",fill:"currentColor"})}),xte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:C.jsx("path",{fill:"currentColor",d:"M6 15a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2h2zm1 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2a2 2 0 0 1-2-2zm2-8a2 2 0 0 1-2-2a2 2 0 0 1 2-2a2 2 0 0 1 2 2v2zm0 1a2 2 0 0 1 2 2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2a2 2 0 0 1 2-2zm8 2a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2h-2zm-1 0a2 2 0 0 1-2 2a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2a2 2 0 0 1 2 2zm-2 8a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2v-2zm0-1a2 2 0 0 1-2-2a2 2 0 0 1 2-2h5a2 2 0 0 1 2 2a2 2 0 0 1-2 2z"})}),Rte=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M128 0C57.308 0 0 57.309 0 128c0 70.696 57.309 128 128 128c70.697 0 128-57.304 128-128C256 57.314 198.697.007 127.998.007zm58.699 184.614c-2.293 3.76-7.215 4.952-10.975 2.644c-30.053-18.357-67.885-22.515-112.44-12.335a7.98 7.98 0 0 1-9.552-6.007a7.97 7.97 0 0 1 6-9.553c48.76-11.14 90.583-6.344 124.323 14.276c3.76 2.308 4.952 7.215 2.644 10.975m15.667-34.853c-2.89 4.695-9.034 6.178-13.726 3.289c-34.406-21.148-86.853-27.273-127.548-14.92c-5.278 1.594-10.852-1.38-12.454-6.649c-1.59-5.278 1.386-10.842 6.655-12.446c46.485-14.106 104.275-7.273 143.787 17.007c4.692 2.89 6.175 9.034 3.286 13.72zm1.345-36.293C162.457 88.964 94.394 86.71 55.007 98.666c-6.325 1.918-13.014-1.653-14.93-7.978c-1.917-6.328 1.65-13.012 7.98-14.935C93.27 62.027 168.434 64.68 215.929 92.876c5.702 3.376 7.566 10.724 4.188 16.405c-3.362 5.69-10.73 7.565-16.4 4.187z",fill:"#1ed760"})}),Ote=({className:e})=>C.jsxs("svg",{className:e,viewBox:"0 0 256 290",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("path",{d:"M189.72 104.421c18.678 13.345 41.56 21.197 66.273 21.197v-47.53a67 67 0 0 1-13.918-1.456v37.413c-24.711 0-47.59-7.851-66.272-21.195v96.996c0 48.523-39.356 87.855-87.9 87.855c-18.113 0-34.949-5.473-48.934-14.86c15.962 16.313 38.222 26.432 62.848 26.432c48.548 0 87.905-39.332 87.905-87.857v-96.995zm17.17-47.952c-9.546-10.423-15.814-23.893-17.17-38.785v-6.113h-13.189c3.32 18.927 14.644 35.097 30.358 44.898M69.673 225.607a40 40 0 0 1-8.203-24.33c0-22.192 18.001-40.186 40.21-40.186a40.3 40.3 0 0 1 12.197 1.883v-48.593c-4.61-.631-9.262-.9-13.912-.801v37.822a40.3 40.3 0 0 0-12.203-1.882c-22.208 0-40.208 17.992-40.208 40.187c0 15.694 8.997 29.281 22.119 35.9",fill:"#ff004f"}),C.jsx("path",{d:"M175.803 92.849c18.683 13.344 41.56 21.195 66.272 21.195V76.631c-13.794-2.937-26.005-10.141-35.186-20.162c-15.715-9.802-27.038-25.972-30.358-44.898h-34.643v189.843c-.079 22.132-18.049 40.052-40.21 40.052c-13.058 0-24.66-6.221-32.007-15.86c-13.12-6.618-22.118-20.206-22.118-35.898c0-22.193 18-40.187 40.208-40.187c4.255 0 8.356.662 12.203 1.882v-37.822c-47.692.985-86.047 39.933-86.047 87.834c0 23.912 9.551 45.589 25.053 61.428c13.985 9.385 30.82 14.86 48.934 14.86c48.545 0 87.9-39.335 87.9-87.857z"}),C.jsx("path",{d:"M242.075 76.63V66.516a66.3 66.3 0 0 1-35.186-10.047a66.47 66.47 0 0 0 35.186 20.163M176.53 11.57a68 68 0 0 1-.728-5.457V0h-47.834v189.845c-.076 22.13-18.046 40.05-40.208 40.05a40.06 40.06 0 0 1-18.09-4.287c7.347 9.637 18.949 15.857 32.007 15.857c22.16 0 40.132-17.918 40.21-40.05V11.571zM99.966 113.58v-10.769a89 89 0 0 0-12.061-.818C39.355 101.993 0 141.327 0 189.845c0 30.419 15.467 57.227 38.971 72.996c-15.502-15.838-25.053-37.516-25.053-61.427c0-47.9 38.354-86.848 86.048-87.833",fill:"#00f2ea"})]}),Tte=({className:e})=>C.jsxs("svg",{className:e,version:"1.1",viewBox:"0 0 2400 2800",x:"0px",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",y:"0px",children:[C.jsx("style",{type:"text/css",children:`
|
|
130
130
|
.st0{fill:#FFFFFF}
|
|
131
131
|
.st1{fill:#9146FF}
|
|
132
132
|
`}),C.jsx("title",{children:"Asset 2"}),C.jsxs("g",{children:[C.jsx("polygon",{className:"st0",points:"2200,1300 1800,1700 1400,1700 1050,2050 1050,1700 600,1700 600,200 2200,200"}),C.jsx("g",{children:C.jsxs("g",{children:[C.jsx("path",{className:"st1",d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600V1300z"}),C.jsx("rect",{className:"st1",height:"600",width:"200",x:"1700",y:"550"}),C.jsx("rect",{className:"st1",height:"600",width:"200",x:"1150",y:"550"})]})})]})]}),Cte=({className:e})=>C.jsx("svg",{"data-testid":"geist-icon",height:"16","stroke-linejoin":"round",viewBox:"0 0 16 16",width:"16",className:e,style:{color:"currentcolor"},children:C.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1L16 15H0L8 1Z",fill:"currentColor"})}),Ate=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 576 512",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M545 117.7c3.7-12.5 0-21.7-17.8-21.7h-58.9c-15 0-21.9 7.9-25.6 16.7c0 0-30 73.1-72.4 120.5c-13.7 13.7-20 18.1-27.5 18.1c-3.7 0-9.4-4.4-9.4-16.9V117.7c0-15-4.2-21.7-16.6-21.7h-92.6c-9.4 0-15 7-15 13.5c0 14.2 21.2 17.5 23.4 57.5v86.8c0 19-3.4 22.5-10.9 22.5c-20 0-68.6-73.4-97.4-157.4c-5.8-16.3-11.5-22.9-26.6-22.9H38.8c-16.8 0-20.2 7.9-20.2 16.7c0 15.6 20 93.1 93.1 195.5C160.4 378.1 229 416 291.4 416c37.5 0 42.1-8.4 42.1-22.9c0-66.8-3.4-73.1 15.4-73.1c8.7 0 23.7 4.4 58.7 38.1c40 40 46.6 57.9 69 57.9h58.9c16.8 0 25.3-8.4 20.4-25c-11.2-34.9-86.9-106.7-90.3-111.5c-8.7-11.2-6.2-16.2 0-26.2c.1-.1 72-101.3 79.4-135.6",fill:"currentColor"})}),Ite=({className:e})=>C.jsx("svg",{className:e,viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M389.2 48h70.6L305.6 224.2L487 464H345L233.7 318.6L106.5 464H35.8l164.9-188.5L26.8 48h145.6l100.5 132.9zm-24.8 373.8h39.1L151.1 88h-42z",fill:"currentColor"})}),Pte=({className:e})=>C.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:512,height:117,viewBox:"0 0 512 117",children:C.jsx("path",{fill:"#0b5cff",d:"M107.472 114.706H16.348c-5.968 0-11.791-3.203-14.557-8.589C-1.41 99.858-.247 92.434 4.702 87.63L68.17 24.164H22.607C10.088 24.164.044 13.974.044 1.6h83.992c5.968 0 11.79 3.203 14.556 8.589c3.203 6.259 2.038 13.683-2.911 18.486L32.214 92.143h52.55c12.518 0 22.708 10.19 22.708 22.563M468.183 0c-13.1 0-24.746 5.677-32.898 14.702C427.134 5.677 415.488 0 402.388 0c-24.164 0-43.961 20.67-43.961 44.834v69.872c12.518 0 22.562-10.19 22.562-22.563V44.689c0-11.646 9.025-21.544 20.67-21.98c12.228-.437 22.272 9.315 22.272 21.397v48.037c0 12.519 10.19 22.563 22.563 22.563V44.543c0-11.645 9.025-21.544 20.67-21.98c12.228-.437 22.272 9.316 22.272 21.398v48.036c0 12.52 10.19 22.563 22.563 22.563V44.69C512.144 20.67 492.347 0 468.183 0M221.595 58.226c0 32.17-26.056 58.226-58.226 58.226s-58.226-26.056-58.226-58.226S131.199 0 163.369 0s58.226 26.056 58.226 58.226m-22.563 0c0-19.651-16.012-35.663-35.663-35.663s-35.664 16.012-35.664 35.663c0 19.652 16.013 35.664 35.664 35.664s35.663-16.012 35.663-35.664m148.04 0c0 32.17-26.056 58.226-58.226 58.226S230.62 90.396 230.62 58.226S256.676 0 288.846 0s58.227 26.056 58.227 58.226m-22.562 0c0-19.651-16.012-35.663-35.664-35.663c-19.65 0-35.663 16.012-35.663 35.663c0 19.652 16.012 35.664 35.663 35.664c19.652 0 35.664-16.012 35.664-35.664"})}),Mte=[{provider:"apple",name:"Apple",icon:cte},{provider:"discord",name:"Discord",icon:ute},{provider:"dropbox",name:"Dropbox",icon:dte},{provider:"facebook",name:"Facebook",icon:fte},{provider:"github",name:"GitHub",icon:hte},{provider:"gitlab",name:"GitLab",icon:pte},{provider:"google",name:"Google",icon:mte},{provider:"huggingface",name:"Hugging Face",icon:gte},{provider:"kick",name:"Kick",icon:vte},{provider:"linear",name:"Linear",icon:yte},{provider:"linkedin",name:"LinkedIn",icon:_te},{provider:"microsoft",name:"Microsoft",icon:bte},{provider:"notion",name:"Notion",icon:wte},{provider:"reddit",name:"Reddit",icon:Ste},{provider:"roblox",name:"Roblox",icon:Ete},{provider:"slack",name:"Slack",icon:xte},{provider:"spotify",name:"Spotify",icon:Rte},{provider:"tiktok",name:"TikTok",icon:Ote},{provider:"twitch",name:"Twitch",icon:Tte},{provider:"vercel",name:"Vercel",icon:Cte},{provider:"vk",name:"VK",icon:Ate},{provider:"twitter",name:"X",icon:Ite},{provider:"zoom",name:"Zoom",icon:Pte}],Nte=["/sign-up/email","/sign-in/email","/forget-password"],kte=e=>{let t=e.startsWith("/")?e.substring(1):e;return t=t.replace(/-([a-z])/g,(n,r)=>r.toUpperCase()).replace(/\/([a-z])/g,(n,r)=>r.toUpperCase()).replace(/\//g,"").replace(/[^A-Za-z0-9_]/g,""),t};function xf({localization:e}){const{captcha:t,localization:n}=P.useContext(vt);e={...n,...e};const r=P.useRef(null),{executeRecaptcha:o}=MN(),s=async d=>{if(!t)throw new Error(e.MISSING_RESPONSE);let f;switch(t.provider){case"google-recaptcha-v3":{const p=kte(d);f=await o?.(p);break}case"google-recaptcha-v2-checkbox":{f=r.current.getValue();break}case"google-recaptcha-v2-invisible":{f=await r.current.executeAsync();break}case"cloudflare-turnstile":{f=r.current.getResponse();break}case"hcaptcha":{f=r.current.getResponse();break}case"captchafox":{f=r.current.getResponse();break}}if(!f)throw new Error(e.MISSING_RESPONSE);return f};return{captchaRef:r,getCaptchaHeaders:async d=>{if(!t)return;if((t.endpoints||Nte).includes(d))return{"x-captcha-response":await s(d)}},resetCaptcha:()=>{var d,f,p,h,g,v,_,b;if(t)switch(t.provider){case"google-recaptcha-v3":break;case"google-recaptcha-v2-checkbox":case"google-recaptcha-v2-invisible":{(f=(d=r.current)==null?void 0:d.reset)==null||f.call(d);break}case"cloudflare-turnstile":{(h=(p=r.current)==null?void 0:p.reset)==null||h.call(p);break}case"hcaptcha":{(v=(g=r.current)==null?void 0:g.resetCaptcha)==null||v.call(g);break}case"captchafox":{(b=(_=r.current)==null?void 0:_.reset)==null||b.call(_);break}}}}}function Dte({className:e,localization:t}){const n=ms(),{captcha:r,localization:o}=P.useContext(vt),s={...o,...t};return r?r.hideBadge?C.jsxs(C.Fragment,{children:[C.jsx("style",{children:`
|
|
@@ -145,22 +145,22 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
145
145
|
.dark .grecaptcha-badge {
|
|
146
146
|
border-color: var(--input) !important;
|
|
147
147
|
}
|
|
148
|
-
`}),C.jsx(YJ,{ref:e,sitekey:t.siteKey,theme:n,hl:r,size:t.provider==="google-recaptcha-v2-invisible"?"invisible":"normal",className:Ce(t.provider==="google-recaptcha-v2-invisible"?"absolute":"mx-auto h-[76px] w-[302px] overflow-hidden rounded bg-muted")},`${n}-${r}-${t.provider}`)]}):null}var $te=["/sign-up/email","/sign-in/email","/forget-password"];function Rf({ref:e,localization:t,action:n}){const{captcha:r}=P.useContext(vt);if(!r||n&&!(r.endpoints||$te).includes(n))return null;const{theme:o}=Xw(),s=r.provider==="google-recaptcha-v2-checkbox"||r.provider==="google-recaptcha-v2-invisible",l=r.provider==="google-recaptcha-v3"||r.provider==="google-recaptcha-v2-invisible",c=r.provider==="cloudflare-turnstile",d=r.provider==="hcaptcha",f=r.provider==="captchafox";return C.jsxs(C.Fragment,{children:[s&&C.jsx(Lte,{ref:e}),l&&C.jsx(Dte,{localization:t}),c&&C.jsx(xD,{className:"mx-auto",ref:e,siteKey:r.siteKey,options:{theme:o,size:"flexible"}}),d&&C.jsx("div",{className:"mx-auto",children:C.jsx(xJ,{ref:e,sitekey:r.siteKey,theme:o})}),f&&C.jsx("div",{className:"mx-auto",children:C.jsx(hD,{ref:e,sitekey:r.siteKey,theme:o})})]})}function rf({className:e,enableToggle:t,onChange:n,...r}){const[o,s]=P.useState(!0),[l,c]=P.useState(!1);return C.jsxs("div",{className:"relative",children:[C.jsx(ni,{className:Ce(t&&"pr-10",e),...r,type:l&&t?"text":"password",onChange:d=>{s(!d.target.value),n?.(d)}}),t&&C.jsxs(C.Fragment,{children:[C.jsx(
|
|
148
|
+
`}),C.jsx(YJ,{ref:e,sitekey:t.siteKey,theme:n,hl:r,size:t.provider==="google-recaptcha-v2-invisible"?"invisible":"normal",className:Ce(t.provider==="google-recaptcha-v2-invisible"?"absolute":"mx-auto h-[76px] w-[302px] overflow-hidden rounded bg-muted")},`${n}-${r}-${t.provider}`)]}):null}var $te=["/sign-up/email","/sign-in/email","/forget-password"];function Rf({ref:e,localization:t,action:n}){const{captcha:r}=P.useContext(vt);if(!r||n&&!(r.endpoints||$te).includes(n))return null;const{theme:o}=Xw(),s=r.provider==="google-recaptcha-v2-checkbox"||r.provider==="google-recaptcha-v2-invisible",l=r.provider==="google-recaptcha-v3"||r.provider==="google-recaptcha-v2-invisible",c=r.provider==="cloudflare-turnstile",d=r.provider==="hcaptcha",f=r.provider==="captchafox";return C.jsxs(C.Fragment,{children:[s&&C.jsx(Lte,{ref:e}),l&&C.jsx(Dte,{localization:t}),c&&C.jsx(xD,{className:"mx-auto",ref:e,siteKey:r.siteKey,options:{theme:o,size:"flexible"}}),d&&C.jsx("div",{className:"mx-auto",children:C.jsx(xJ,{ref:e,sitekey:r.siteKey,theme:o})}),f&&C.jsx("div",{className:"mx-auto",children:C.jsx(hD,{ref:e,sitekey:r.siteKey,theme:o})})]})}function rf({className:e,enableToggle:t,onChange:n,...r}){const[o,s]=P.useState(!0),[l,c]=P.useState(!1);return C.jsxs("div",{className:"relative",children:[C.jsx(ni,{className:Ce(t&&"pr-10",e),...r,type:l&&t?"text":"password",onChange:d=>{s(!d.target.value),n?.(d)}}),t&&C.jsxs(C.Fragment,{children:[C.jsx(on,{className:"!bg-transparent absolute top-0 right-0",disabled:o,size:"icon",type:"button",variant:"ghost",onClick:()=>c(!l),children:l?C.jsx(oK,{}):C.jsx(rK,{})}),C.jsx("style",{children:`
|
|
149
149
|
.hide-password-toggle::-ms-reveal,
|
|
150
150
|
.hide-password-toggle::-ms-clear {
|
|
151
151
|
visibility: hidden;
|
|
152
152
|
pointer-events: none;
|
|
153
153
|
display: none;
|
|
154
154
|
}
|
|
155
|
-
`})]})]})}function Mi({redirectTo:e}){const{redirectTo:t}=P.useContext(vt),[n,r]=P.useState(!1),{navigate:o,hooks:{useSession:s},onSessionChange:l}=P.useContext(vt),{refetch:c}=s();return{onSuccess:P.useCallback(async()=>{r(!0),await c?.(),l&&await l(),r(!1);const f=e||gl("redirectTo")||t;o(f)},[c,l,o,e,t]),isPending:n}}function t5({redirectTo:e}){const{hooks:{useIsRestoring:t},persistClient:n}=P.useContext(vt),r=t?.(),o=P.useRef(!1),{onSuccess:s}=Mi({redirectTo:e});return P.useEffect(()=>{if(!o.current){if(!n){o.current=!0,s();return}r||(o.current=!0,s())}},[r,n,s]),C.jsx(Ar,{className:"animate-spin"})}function zS({className:e,containerClassName:t,...n}){return C.jsx(UD,{"data-slot":"input-otp",containerClassName:Ce("flex items-center gap-2 has-disabled:opacity-50",t),className:Ce("disabled:cursor-not-allowed",e),...n})}function hc({className:e,...t}){return C.jsx("div",{"data-slot":"input-otp-group",className:Ce("flex items-center",e),...t})}function rr({index:e,className:t,...n}){const r=P.useContext(zD),{char:o,hasFakeCaret:s,isActive:l}=r?.slots[e]??{};return C.jsxs("div",{"data-slot":"input-otp-slot","data-active":l,className:Ce("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[o,s&&C.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:C.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function K_({...e}){return C.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:C.jsx(sK,{})})}function US({otpSeparators:e=0}){return e===0?C.jsxs(hc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1}),C.jsx(rr,{index:2}),C.jsx(rr,{index:3}),C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]}):e===1?C.jsxs(C.Fragment,{children:[C.jsxs(hc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1}),C.jsx(rr,{index:2})]}),C.jsx(K_,{}),C.jsxs(hc,{children:[C.jsx(rr,{index:3}),C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]})]}):C.jsxs(C.Fragment,{children:[C.jsxs(hc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1})]}),C.jsx(K_,{}),C.jsxs(hc,{children:[C.jsx(rr,{index:2}),C.jsx(rr,{index:3})]}),C.jsx(K_,{}),C.jsxs(hc,{children:[C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]})]})}function EA(e){const[t,n]=P.useState();return t?C.jsx(zte,{...e,email:t}):C.jsx(jte,{...e,setEmail:n})}function jte({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:o,setEmail:s}){const l=ms(),{captchaRef:c,getCaptchaHeaders:d}=xf({localization:r}),{authClient:f,localization:p,toast:h,localizeErrors:g}=P.useContext(vt);r={...p,...r};const v=be({email:$().email({message:`${r.EMAIL} ${r.IS_INVALID}`})}),_=Ci({resolver:Ai(v),defaultValues:{email:""}});n=n||_.formState.isSubmitting,P.useEffect(()=>{o?.(_.formState.isSubmitting)},[_.formState.isSubmitting,o]);async function b({email:x}){const S={throw:!0,headers:await d("/email-otp/send-verification-otp")};try{await f.emailOtp.sendVerificationOtp({email:x,type:"sign-in",fetchOptions:S}),h({variant:"success",message:r.EMAIL_OTP_VERIFICATION_SENT}),s(x)}catch(E){h({variant:"error",message:kn({error:E,localization:r,localizeErrors:g})})}}return C.jsx(Pi,{..._,children:C.jsxs("form",{method:"POST",onSubmit:_.handleSubmit(b),noValidate:l,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:_.control,name:"email",render:({field:x})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...x})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(Rf,{ref:c,localization:r,action:"/email-otp/send-verification-otp"}),C.jsx(sn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.EMAIL_OTP_SEND_ACTION})]})})}function zte({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:o=0,redirectTo:s,setIsSubmitting:l,email:c}){const{authClient:d,localization:f,toast:p,localizeErrors:h}=P.useContext(vt);r={...f,...r};const{onSuccess:g,isPending:v}=Mi({redirectTo:s}),_=be({code:$().min(1,{message:`${r.EMAIL_OTP} ${r.IS_REQUIRED}`}).min(6,{message:`${r.EMAIL_OTP} ${r.IS_INVALID}`})}),b=Ci({resolver:Ai(_),defaultValues:{code:""}});n=n||b.formState.isSubmitting||v,P.useEffect(()=>{l?.(b.formState.isSubmitting||v)},[b.formState.isSubmitting,v,l]);async function x({code:S}){try{await d.signIn.emailOtp({email:c,otp:S,fetchOptions:{throw:!0}}),await g()}catch(E){p({variant:"error",message:kn({error:E,localization:r,localizeErrors:h})}),b.reset()}}return C.jsx(Pi,{...b,children:C.jsxs("form",{method:"POST",onSubmit:b.handleSubmit(x),className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:b.control,name:"code",render:({field:S})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:r.EMAIL_OTP}),C.jsx(qn,{children:C.jsx(zS,{...S,maxLength:6,onChange:E=>{S.onChange(E),E.length===6&&b.handleSubmit(x)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:C.jsx(US,{otpSeparators:o})})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx("div",{className:"grid gap-4",children:C.jsxs(sn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&C.jsx(Ar,{className:"animate-spin"}),r.EMAIL_OTP_VERIFY_ACTION]})})]})})}function Ute({onCancel:e,localization:t,className:n,classNames:r,otpSeparators:o,callbackURL:s,isSubmitting:l,redirectTo:c,setIsSubmitting:d}){const[f,p]=P.useState(!0),[h,g]=P.useState(30),{authClient:v,localization:_,toast:b,localizeErrors:x,navigate:S,basePath:E,viewPaths:T}=P.useContext(vt);t={..._,...t};const R=typeof window<"u"&&new URLSearchParams(window.location.search).get("email")||"",{onSuccess:O,isPending:A}=Mi({redirectTo:c}),I=be({code:$().min(1,{message:`${t.EMAIL_OTP} ${t.IS_REQUIRED}`}).min(6,{message:`${t.EMAIL_OTP} ${t.IS_INVALID}`})}),M=Ci({resolver:Ai(I),defaultValues:{code:""}}),L=l||M.formState.isSubmitting||A;P.useEffect(()=>{d?.(M.formState.isSubmitting||A)},[M.formState.isSubmitting,A,d]),P.useEffect(()=>{if(h>0){const B=setTimeout(()=>g(h-1),1e3);return()=>clearTimeout(B)}else p(!1)},[h]);async function q({code:B}){try{const F=await v.emailOtp.verifyEmail({email:R,otp:B,fetchOptions:{throw:!0}});"token"in F&&F.token?await O():(S(`${E}/${T.SIGN_IN}${window.location.search}`),b({variant:"success",message:t.EMAIL_VERIFICATION_SUCCESS}))}catch(F){b({variant:"error",message:kn({error:F,localization:t,localizeErrors:x})}),M.reset()}}async function j(){if(!f){p(!0),g(30);try{await v.emailOtp.sendVerificationOtp({email:R,type:"email-verification",fetchOptions:{throw:!0}}),b({variant:"success",message:t.EMAIL_OTP_VERIFICATION_SENT})}catch(B){b({variant:"error",message:kn({error:B,localization:t,localizeErrors:x})}),p(!1),g(0)}}}return R?C.jsx(Pi,{...M,children:C.jsxs("form",{method:"POST",onSubmit:M.handleSubmit(q),className:Ce("grid w-full gap-6",n,r?.base),children:[C.jsx(In,{control:M.control,name:"code",render:({field:B})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:r?.label,children:t.EMAIL_OTP}),C.jsx(qn,{children:C.jsx(zS,{...B,maxLength:6,onChange:F=>{B.onChange(F),F.length===6&&M.handleSubmit(q)()},containerClassName:r?.otpInputContainer,className:r?.otpInput,disabled:L,children:C.jsx(US,{otpSeparators:o})})}),C.jsx(Wn,{className:r?.error})]})}),C.jsxs("div",{className:"grid gap-4",children:[C.jsxs(sn,{type:"submit",disabled:L,className:Ce(r?.button,r?.primaryButton),children:[L&&C.jsx(Ar,{className:"animate-spin"}),t.EMAIL_OTP_VERIFY_ACTION]}),C.jsx(sn,{type:"button",variant:"outline",onClick:j,disabled:f||L,className:Ce("w-full",r?.button),children:f?`${t.RESEND_VERIFICATION_EMAIL} (${h}s)`:t.RESEND_VERIFICATION_EMAIL}),e&&C.jsx(sn,{type:"button",variant:"ghost",onClick:e,disabled:L,className:"w-full",children:t.CANCEL})]})]})}):C.jsx("div",{className:Ce("grid w-full gap-6",n),children:C.jsxs("div",{className:"text-center",children:[C.jsx("h2",{className:"font-semibold text-destructive text-lg",children:"Invalid Request"}),C.jsx("p",{className:"text-muted-foreground text-sm",children:t.EMAIL_REQUIRED||"Email address is required"})]})})}function Fte({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:o}){const s=ms(),{captchaRef:l,getCaptchaHeaders:c,resetCaptcha:d}=xf({localization:r}),{authClient:f,basePath:p,baseURL:h,localization:g,navigate:v,toast:_,viewPaths:b,localizeErrors:x}=P.useContext(vt);r={...g,...r};const S=be({email:$().email({message:`${r.EMAIL} ${r.IS_INVALID}`}).min(1,{message:`${r.EMAIL} ${r.IS_REQUIRED}`})}),E=Ci({resolver:Ai(S),defaultValues:{email:""}});n=n||E.formState.isSubmitting,P.useEffect(()=>{o?.(E.formState.isSubmitting)},[E.formState.isSubmitting,o]);async function T({email:R}){try{const O={throw:!0,headers:await c("/forget-password")};await f.requestPasswordReset({email:R,redirectTo:`${h}${p}/${b.RESET_PASSWORD}`,fetchOptions:O}),_({variant:"success",message:r.FORGOT_PASSWORD_EMAIL}),v(`${p}/${b.SIGN_IN}${window.location.search}`)}catch(O){_({variant:"error",message:kn({error:O,localization:r,localizeErrors:x})}),d()}}return C.jsx(Pi,{...E,children:C.jsxs("form",{method:"POST",onSubmit:E.handleSubmit(T),noValidate:s,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:E.control,name:"email",render:({field:R})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...R})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(Rf,{ref:l,localization:r,action:"/forget-password"}),C.jsx(sn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.FORGOT_PASSWORD_ACTION})]})})}function xA({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,redirectTo:s,setIsSubmitting:l}){const c=ms(),{captchaRef:d,getCaptchaHeaders:f,resetCaptcha:p}=xf({localization:o}),{authClient:h,basePath:g,baseURL:v,persistClient:_,localization:b,redirectTo:x,viewPaths:S,toast:E,localizeErrors:T}=P.useContext(vt);o={...b,...o};const R=P.useCallback(()=>s||gl("redirectTo")||x,[s,x]),O=P.useCallback(()=>`${v}${n||(_?`${g}/${S.CALLBACK}?redirectTo=${encodeURIComponent(R())}`:R())}`,[n,_,g,S,v,R]),A=be({email:$().email({message:`${o.EMAIL} ${o.IS_INVALID}`})}),I=Ci({resolver:Ai(A),defaultValues:{email:""}});r=r||I.formState.isSubmitting,P.useEffect(()=>{l?.(I.formState.isSubmitting)},[I.formState.isSubmitting,l]);async function M({email:L}){try{const q={throw:!0,headers:await f("/sign-in/magic-link")};await h.signIn.magicLink({email:L,callbackURL:O(),fetchOptions:q}),E({variant:"success",message:o.MAGIC_LINK_EMAIL}),I.reset()}catch(q){E({variant:"error",message:kn({error:q,localization:o,localizeErrors:T})}),p()}}return C.jsx(Pi,{...I,children:C.jsxs("form",{method:"POST",onSubmit:I.handleSubmit(M),noValidate:c,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:I.control,name:"email",render:({field:L})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:o.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:r,...L})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(Rf,{ref:d,localization:o,action:"/sign-in/magic-link"}),C.jsx(sn,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?C.jsx(Ar,{className:"animate-spin"}):o.MAGIC_LINK_ACTION})]})})}function Bte({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:o,setIsSubmitting:s}){const{authClient:l,localization:c,toast:d,localizeErrors:f}=P.useContext(vt);r={...c,...r};const{onSuccess:p,isPending:h}=Mi({redirectTo:o}),g=be({code:$().min(1,{message:r.BACKUP_CODE_REQUIRED})}),v=Ci({resolver:Ai(g),defaultValues:{code:""}});n=n||v.formState.isSubmitting||h,P.useEffect(()=>{s?.(v.formState.isSubmitting||h)},[v.formState.isSubmitting,h,s]);async function _({code:b}){try{await l.twoFactor.verifyBackupCode({code:b,fetchOptions:{throw:!0}}),await p()}catch(x){d({variant:"error",message:kn({error:x,localization:r,localizeErrors:f})}),v.reset()}}return C.jsx(Pi,{...v,children:C.jsxs("form",{method:"POST",onSubmit:v.handleSubmit(_),className:Ce("grid gap-6",e,t?.base),children:[C.jsx(In,{control:v.control,name:"code",render:({field:b})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:r.BACKUP_CODE}),C.jsx(qn,{children:C.jsx(ni,{placeholder:r.BACKUP_CODE_PLACEHOLDER,autoComplete:"off",className:t?.input,disabled:n,...b})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(sn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.RECOVER_ACCOUNT_ACTION})]})})}function Vte({className:e,classNames:t,localization:n,passwordValidation:r}){const o=P.useRef(!1),{authClient:s,basePath:l,credentials:c,localization:d,viewPaths:f,navigate:p,toast:h,localizeErrors:g}=P.useContext(vt),v=c?.confirmPassword,_=c?.passwordValidation;n={...d,...n},r={..._,...r};const b=be({newPassword:Wd(r,{PASSWORD_REQUIRED:n.NEW_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}),confirmPassword:v?Wd(r,{PASSWORD_REQUIRED:n.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}):$().optional()}).refine(T=>!v||T.newPassword===T.confirmPassword,{message:n.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),x=Ci({resolver:Ai(b),defaultValues:{newPassword:"",confirmPassword:""}}),S=x.formState.isSubmitting;P.useEffect(()=>{if(o.current)return;o.current=!0;const R=new URLSearchParams(window.location.search).get("token");(!R||R==="INVALID_TOKEN")&&(p(`${l}/${f.SIGN_IN}${window.location.search}`),h({variant:"error",message:n.INVALID_TOKEN}))},[l,p,h,f,n]);async function E({newPassword:T}){try{const O=new URLSearchParams(window.location.search).get("token");await s.resetPassword({newPassword:T,token:O,fetchOptions:{throw:!0}}),h({variant:"success",message:n.RESET_PASSWORD_SUCCESS}),p(`${l}/${f.SIGN_IN}${window.location.search}`)}catch(R){h({variant:"error",message:kn({error:R,localization:n,localizeErrors:g})}),x.reset()}}return C.jsx(Pi,{...x,children:C.jsxs("form",{method:"POST",onSubmit:x.handleSubmit(E),className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:x.control,name:"newPassword",render:({field:T})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:n.NEW_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:n.NEW_PASSWORD_PLACEHOLDER,disabled:S,...T})}),C.jsx(Wn,{className:t?.error})]})}),v&&C.jsx(In,{control:x.control,name:"confirmPassword",render:({field:T})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:n.CONFIRM_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:n.CONFIRM_PASSWORD_PLACEHOLDER,disabled:S,...T})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(sn,{type:"submit",disabled:S,className:Ce("w-full",t?.button,t?.primaryButton),children:S?C.jsx(Ar,{className:"animate-spin"}):n.RESET_PASSWORD_ACTION})]})})}function qte({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:o,setIsSubmitting:s,passwordValidation:l,callbackURL:c}){const d=ms(),{captchaRef:f,getCaptchaHeaders:p,resetCaptcha:h}=xf({localization:r}),{authClient:g,basePath:v,credentials:_,localization:b,viewPaths:x,navigate:S,toast:E,Link:T,localizeErrors:R,emailVerification:O}=P.useContext(vt),A=_?.rememberMe,I=_?.username,M=_?.passwordValidation;r={...b,...r},l={...M,...l};const{onSuccess:L,isPending:q}=Mi({redirectTo:o}),j=be({email:I?$().min(1,{message:`${r.USERNAME} ${r.IS_REQUIRED}`}):$().email({message:`${r.EMAIL} ${r.IS_INVALID}`}),password:Wd(l,r),rememberMe:Nt().optional()}),B=Ci({resolver:Ai(j),defaultValues:{email:"",password:"",rememberMe:!A}});n=n||B.formState.isSubmitting||q,P.useEffect(()=>{s?.(B.formState.isSubmitting||q)},[B.formState.isSubmitting,q,s]);async function F({email:Z,password:ie,rememberMe:H}){var W;try{let te={};if(I&&!NH(Z)){const le={throw:!0,headers:await p("/sign-in/username")};te=await g.signIn.username({username:Z,password:ie,rememberMe:H,fetchOptions:le,callbackURL:c})}else{const le={throw:!0,headers:await p("/sign-in/email")};te=await g.signIn.email({email:Z,password:ie,rememberMe:H,fetchOptions:le,callbackURL:c})}te.twoFactorRedirect?S(`${v}/${x.TWO_FACTOR}${window.location.search}`):await L()}catch(te){B.resetField("password"),h(),E({variant:"error",message:kn({error:te,localization:r,localizeErrors:R})}),O?.otp&&((W=te?.error)==null?void 0:W.code)==="EMAIL_NOT_VERIFIED"&&S(`${v}/${x.EMAIL_VERIFICATION}?email=${encodeURIComponent(Z)}`)}}return C.jsx(Pi,{...B,children:C.jsxs("form",{method:"POST",onSubmit:B.handleSubmit(F),noValidate:d,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:B.control,name:"email",render:({field:Z})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:I?r.USERNAME:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:I?"username":"email",className:t?.input,type:I?"text":"email",placeholder:I?r.SIGN_IN_USERNAME_PLACEHOLDER:r.EMAIL_PLACEHOLDER,disabled:n,...Z})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(In,{control:B.control,name:"password",render:({field:Z})=>C.jsxs(Pn,{children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx(Mn,{className:t?.label,children:r.PASSWORD}),_?.forgotPassword&&C.jsx(T,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${v}/${x.FORGOT_PASSWORD}${d?window.location.search:""}`,children:r.FORGOT_PASSWORD_LINK})]}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"current-password",className:t?.input,placeholder:r.PASSWORD_PLACEHOLDER,disabled:n,...Z})}),C.jsx(Wn,{className:t?.error})]})}),A&&C.jsx(In,{control:B.control,name:"rememberMe",render:({field:Z})=>C.jsxs(Pn,{className:"flex",children:[C.jsx(qn,{children:C.jsx(jS,{checked:Z.value,onCheckedChange:Z.onChange,disabled:n})}),C.jsx(Mn,{children:r.REMEMBER_ME})]})}),C.jsx(Rf,{ref:f,localization:r,action:"/sign-in/email"}),C.jsx(sn,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.SIGN_IN_ACTION})]})})}function Hte({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,redirectTo:s,setIsSubmitting:l,passwordValidation:c}){var d,f,p,h,g,v;const _=ms(),{captchaRef:b,getCaptchaHeaders:x,resetCaptcha:S}=xf({localization:o}),{additionalFields:E,authClient:T,basePath:R,baseURL:O,credentials:A,localization:I,nameRequired:M,persistClient:L,redirectTo:q,signUp:j,viewPaths:B,navigate:F,toast:Z,avatar:ie,localizeErrors:H,emailVerification:W}=P.useContext(vt),te=A?.confirmPassword,le=A?.username,Q=A?.usernameRequired??!0,k=A?.passwordValidation,G=j?.fields;o={...I,...o},c={...k,...c};const V=P.useRef(null),[D,U]=P.useState(null),[X,fe]=P.useState(!1),pe=P.useCallback(()=>s||gl("redirectTo")||q,[s,q]),xe=P.useCallback(()=>`${O}${n||(L?`${R}/${B.CALLBACK}?redirectTo=${encodeURIComponent(pe())}`:pe())}`,[n,L,R,B,O,pe]),{onSuccess:je,isPending:Y}=Mi({redirectTo:s}),re={email:$().email({message:`${o.EMAIL} ${o.IS_INVALID}`}),password:Wd(c,o),name:G?.includes("name")&&M?$().min(1,{message:`${o.NAME} ${o.IS_REQUIRED}`}):$().optional(),image:$().optional(),username:le&&Q?$().min(1,{message:`${o.USERNAME} ${o.IS_REQUIRED}`}):$().optional(),confirmPassword:te?Wd(c,{PASSWORD_REQUIRED:o.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:o.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:o.PASSWORD_TOO_LONG,INVALID_PASSWORD:o.INVALID_PASSWORD}):$().optional()},ve={};if(G)for(const Me of G){if(Me==="name"||Me==="image")continue;const Pe=E?.[Me];if(!Pe)continue;let Ue;Pe.type==="number"?Ue=Pe.required?Kw(K=>K?Number(K):void 0,dt({message:((d=Pe.errorMessage)==null?void 0:d.invalid)??`${Pe.label} ${o.IS_INVALID}`})):nN({message:((f=Pe.errorMessage)==null?void 0:f.invalid)??`${Pe.label} ${o.IS_INVALID}`}).optional():Pe.type==="boolean"?Ue=Pe.required?DT({message:((p=Pe.errorMessage)==null?void 0:p.invalid)??`${Pe.label} ${o.IS_INVALID}`}).refine(K=>K===!0,{message:((h=Pe.errorMessage)==null?void 0:h.required)??`${Pe.label} ${o.IS_REQUIRED}`}):DT({message:((g=Pe.errorMessage)==null?void 0:g.invalid)??`${Pe.label} ${o.IS_INVALID}`}).optional():Ue=Pe.required?$().min(1,((v=Pe.errorMessage)==null?void 0:v.required)??`${Pe.label} ${o.IS_REQUIRED}`):$().optional(),ve[Me]=Ue}const se=be(re).extend(ve).refine(Me=>te?Me.password===Me.confirmPassword:!0,{message:o.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),Se={email:"",password:"",...te&&{confirmPassword:""},...G?.includes("name")?{name:""}:{},...le?{username:""}:{},...G?.includes("image")&&ie?{image:""}:{}};if(G)for(const Me of G){if(Me==="name"||Me==="image")continue;const Pe=E?.[Me];Pe&&(Se[Me]=Pe.type==="boolean"?!1:"")}const Te=Ci({resolver:Ai(se),defaultValues:Se});r=r||Te.formState.isSubmitting||Y,P.useEffect(()=>{l?.(Te.formState.isSubmitting||Y)},[Te.formState.isSubmitting,Y,l]);const tt=async Me=>{if(ie){fe(!0);try{const Pe=await Xee(Me,crypto.randomUUID(),ie.size,ie.extension);let Ue;ie.upload?Ue=await ie.upload(Pe):Ue=await ete(Pe),Ue?(U(Ue),Te.setValue("image",Ue)):(U(null),Te.setValue("image",""))}catch(Pe){console.error(Pe),Z({variant:"error",message:kn({error:Pe,localization:o,localizeErrors:H})})}fe(!1)}},rt=()=>{U(null),Te.setValue("image","")},Be=()=>{var Me;return(Me=V.current)==null?void 0:Me.click()};async function Qe({email:Me,password:Pe,name:Ue,username:K,confirmPassword:ne,image:ae,...Oe}){var Ae,Ie;try{for(const[_t,Tt]of Object.entries(Oe)){const bt=E?.[_t];if(bt?.validate&&typeof Tt=="string"&&!await bt.validate(Tt)){Te.setError(_t,{message:((Ae=bt.errorMessage)==null?void 0:Ae.validate)??((Ie=bt.errorMessage)==null?void 0:Ie.invalid)??`${bt.label} ${o.IS_INVALID}`});return}}const ke={throw:!0,headers:await x("/sign-up/email")},Je={};K!==void 0&&(!Q&&(K===null||K===""||typeof K=="string"&&K.trim()==="")||(Je.username=K)),ae!==void 0&&(Je.image=ae);const et=await T.signUp.email({email:Me,password:Pe,name:Ue||"",...Je,...Oe,callbackURL:xe(),fetchOptions:ke});"token"in et&&et.token?await je():W?.otp?F(`${R}/${B.EMAIL_VERIFICATION}?email=${encodeURIComponent(Me)}`):(F(`${R}/${B.SIGN_IN}${window.location.search}`),Z({variant:"success",message:o.SIGN_UP_EMAIL}))}catch(ke){Z({variant:"error",message:kn({error:ke,localization:o,localizeErrors:H})}),Te.resetField("password"),Te.resetField("confirmPassword"),S()}}return C.jsx(Pi,{...Te,children:C.jsxs("form",{method:"POST",onSubmit:Te.handleSubmit(Qe),noValidate:_,className:Ce("grid w-full gap-6",e,t?.base),children:[G?.includes("image")&&ie&&C.jsxs(C.Fragment,{children:[C.jsx("input",{ref:V,accept:"image/*",disabled:X,hidden:!0,type:"file",onChange:Me=>{var Pe;const Ue=(Pe=Me.target.files)==null?void 0:Pe.item(0);Ue&&tt(Ue),Me.target.value=""}}),C.jsx(In,{control:Te.control,name:"image",render:()=>C.jsxs(Pn,{children:[C.jsx(Mn,{children:o.AVATAR}),C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsxs(tte,{children:[C.jsx(nte,{asChild:!0,children:C.jsx(sn,{className:"size-fit rounded-full",size:"icon",variant:"ghost",type:"button",children:C.jsx(ste,{isPending:X,className:"size-16",user:D?{name:Te.watch("name"),email:Te.watch("email"),image:D}:null,localization:o})})}),C.jsxs(rte,{align:"start",onCloseAutoFocus:Me=>Me.preventDefault(),children:[C.jsxs(SA,{onClick:Be,disabled:X,children:[C.jsx(nK,{}),o.UPLOAD_AVATAR]}),D&&C.jsxs(SA,{onClick:rt,disabled:X,variant:"destructive",children:[C.jsx(lK,{}),o.DELETE_AVATAR]})]})]}),C.jsxs(sn,{type:"button",variant:"outline",onClick:Be,disabled:X,children:[X&&C.jsx(Ar,{className:"animate-spin"}),o.UPLOAD]})]}),C.jsx(Wn,{})]})})]}),G?.includes("name")&&C.jsx(In,{control:Te.control,name:"name",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsxs(Mn,{className:t?.label,children:[o.NAME,!M&&C.jsx("span",{className:"ml-1 text-muted-foreground",children:o.OPTIONAL_BRACKETS})]}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"name",className:t?.input,placeholder:o.NAME_PLACEHOLDER,disabled:r,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),le&&C.jsx(In,{control:Te.control,name:"username",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsxs(Mn,{className:t?.label,children:[o.USERNAME,!Q&&C.jsx("span",{className:"ml-1 text-muted-foreground",children:o.OPTIONAL_BRACKETS})]}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"username",className:t?.input,placeholder:o.USERNAME_PLACEHOLDER,disabled:r,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(In,{control:Te.control,name:"email",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:o.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"email",className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:r,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(In,{control:Te.control,name:"password",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:o.PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:o.PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),te&&C.jsx(In,{control:Te.control,name:"confirmPassword",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:o.CONFIRM_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:o.CONFIRM_PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),G?.filter(Me=>Me!=="name"&&Me!=="image").map(Me=>{const Pe=E?.[Me];return Pe?Pe.type==="boolean"?C.jsx(In,{control:Te.control,name:Me,render:({field:Ue})=>C.jsxs(Pn,{className:"flex",children:[C.jsx(qn,{children:C.jsx(jS,{checked:Ue.value,onCheckedChange:Ue.onChange,disabled:r})}),C.jsx(Mn,{className:t?.label,children:Pe.label}),C.jsx(Wn,{className:t?.error})]})},Me):C.jsx(In,{control:Te.control,name:Me,render:({field:Ue})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:Pe.label}),C.jsx(qn,{children:Pe.type==="number"?C.jsx(ni,{className:t?.input,type:"number",placeholder:Pe.placeholder||(typeof Pe.label=="string"?Pe.label:""),disabled:r,...Ue,value:Ue.value}):Pe.multiline?C.jsx(lte,{className:t?.input,placeholder:Pe.placeholder||(typeof Pe.label=="string"?Pe.label:""),disabled:r,...Ue,value:Ue.value}):C.jsx(ni,{className:t?.input,type:"text",placeholder:Pe.placeholder||(typeof Pe.label=="string"?Pe.label:""),disabled:r,...Ue,value:Ue.value})}),C.jsx(Wn,{className:t?.error})]})},Me):(console.error(`Additional field ${Me} not found`),null)}),C.jsx(Rf,{ref:b,localization:o,action:"/sign-up/email"}),C.jsx(sn,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?C.jsx(Ar,{className:"animate-spin"}):o.SIGN_UP_ACTION})]})})}function Gte({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:o=0,redirectTo:s,setIsSubmitting:l}){var c;const d=ms(),f=d?gl("totpURI"):null,p=P.useRef(!1),{authClient:h,basePath:g,hooks:{useSession:v},localization:_,twoFactor:b,viewPaths:x,toast:S,Link:E,localizeErrors:T}=P.useContext(vt);r={..._,...r};const{onSuccess:R,isPending:O}=Mi({redirectTo:s}),{data:A}=v(),I=(c=A?.user)==null?void 0:c.twoFactorEnabled,[M,L]=P.useState(b?.length===1?b[0]:null),[q,j]=P.useState(!1),[B,F]=P.useState(0),Z=be({code:$().min(1,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_REQUIRED}`}).min(6,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_INVALID}`}),trustDevice:Nt().optional()}),ie=Ci({resolver:Ai(Z),defaultValues:{code:""}});n=n||ie.formState.isSubmitting||O,P.useEffect(()=>{l?.(ie.formState.isSubmitting||O)},[ie.formState.isSubmitting,O,l]),P.useEffect(()=>{M==="otp"&&B<=0&&!p.current&&(p.current=!0,H())},[M]),P.useEffect(()=>{if(B<=0)return;const te=setTimeout(()=>{F(le=>le-1)},1e3);return()=>clearTimeout(te)},[B]);const H=async()=>{if(!(q||B>0)){try{j(!0),await h.twoFactor.sendOtp({fetchOptions:{throw:!0}}),F(60)}catch(te){S({variant:"error",message:kn({error:te,localization:r,localizeErrors:T})}),te.error.code==="INVALID_TWO_FACTOR_COOKIE"&&history.back()}p.current=!1,j(!1)}};async function W({code:te,trustDevice:le}){try{await(M==="totp"?h.twoFactor.verifyTotp:h.twoFactor.verifyOtp)({code:te,trustDevice:le,fetchOptions:{throw:!0}}),await R(),A&&!I&&S({variant:"success",message:r?.TWO_FACTOR_ENABLED})}catch(Q){S({variant:"error",message:kn({error:Q,localization:r,localizeErrors:T})}),ie.reset()}}return C.jsx(Pi,{...ie,children:C.jsxs("form",{method:"POST",onSubmit:ie.handleSubmit(W),className:Ce("grid w-full gap-6",e,t?.base),children:[b?.includes("totp")&&f&&M==="totp"&&C.jsxs("div",{className:"space-y-3",children:[C.jsx(ZD,{className:t?.label,children:r.TWO_FACTOR_TOTP_LABEL}),C.jsx(Hee,{className:Ce("border shadow-xs",t?.qrCode),value:f})]}),M!==null&&C.jsxs(C.Fragment,{children:[C.jsx(In,{control:ie.control,name:"code",render:({field:te})=>C.jsxs(Pn,{children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx(Mn,{className:t?.label,children:r.ONE_TIME_PASSWORD}),C.jsx(E,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${g}/${x.RECOVER_ACCOUNT}${d?window.location.search:""}`,children:r.FORGOT_AUTHENTICATOR})]}),C.jsx(qn,{children:C.jsx(zS,{...te,maxLength:6,onChange:le=>{te.onChange(le),le.length===6&&ie.handleSubmit(W)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:C.jsx(US,{otpSeparators:o})})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(In,{control:ie.control,name:"trustDevice",render:({field:te})=>C.jsxs(Pn,{className:"flex",children:[C.jsx(qn,{children:C.jsx(jS,{checked:te.value,onCheckedChange:te.onChange,disabled:n,className:t?.checkbox})}),C.jsx(Mn,{className:t?.label,children:r.TRUST_DEVICE})]})})]}),C.jsxs("div",{className:"grid gap-4",children:[M!==null&&C.jsxs(sn,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&C.jsx(Ar,{className:"animate-spin"}),r.TWO_FACTOR_ACTION]}),M==="otp"&&b?.includes("otp")&&C.jsxs(sn,{type:"button",variant:"outline",onClick:H,disabled:B>0||q||n,className:Ce(t?.button,t?.outlineButton),children:[q?C.jsx(Ar,{className:"animate-spin"}):C.jsx(nC,{className:t?.icon}),r.RESEND_CODE,B>0&&` (${B})`]}),M!=="otp"&&b?.includes("otp")&&C.jsxs(sn,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>L("otp"),disabled:n,children:[C.jsx(nC,{className:t?.icon}),r.SEND_VERIFICATION_CODE]}),M!=="totp"&&b?.includes("totp")&&C.jsxs(sn,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>L("totp"),disabled:n,children:[C.jsx(aK,{className:t?.icon}),r.CONTINUE_WITH_AUTHENTICATOR]})]})]})})}function n5({redirectTo:e}){const t=P.useRef(!1),{authClient:n,basePath:r,viewPaths:o}=P.useContext(vt),{onSuccess:s}=Mi({redirectTo:e||`${r}/${o.SIGN_IN}`});return P.useEffect(()=>{t.current||(t.current=!0,n.signOut().finally(s))},[n,s]),C.jsx(Ar,{className:"animate-spin"})}function Kte({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,pathname:s,redirectTo:l,view:c,otpSeparators:d=0,setIsSubmitting:f}){const{basePath:p,credentials:h,localization:g,magicLink:v,emailOTP:_,signUp:b,twoFactor:x,viewPaths:S,replace:E}=P.useContext(vt),T=!!b;if(o={...g,...o},P.useEffect(()=>{s&&!Zb(S,s)&&(console.error(`Invalid auth view: ${s}`),E(`${p}/${S.SIGN_IN}${window.location.search}`))},[s,S,p,E]),c=c||Zb(S,s)||"SIGN_IN",P.useEffect(()=>{let R=!1;c==="MAGIC_LINK"&&(!v||!h&&!_)&&(R=!0),c==="EMAIL_OTP"&&(!_||!h&&!v)&&(R=!0),c==="SIGN_UP"&&!T&&(R=!0),!h&&["SIGN_UP","FORGOT_PASSWORD","RESET_PASSWORD","TWO_FACTOR","RECOVER_ACCOUNT"].includes(c)&&(R=!0),["TWO_FACTOR","RECOVER_ACCOUNT"].includes(c)&&!x&&(R=!0),R&&E(`${p}/${S.SIGN_IN}${window.location.search}`)},[p,c,S,h,E,_,T,v,x]),c==="SIGN_OUT")return C.jsx(n5,{redirectTo:l});if(c==="CALLBACK")return C.jsx(t5,{redirectTo:l});if(c==="SIGN_IN")return h?C.jsx(qte,{className:e,classNames:t,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f,callbackURL:n}):v?C.jsx(xA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):_?C.jsx(EA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):null;if(c==="TWO_FACTOR")return C.jsx(Gte,{className:e,classNames:t,localization:o,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="RECOVER_ACCOUNT")return C.jsx(Bte,{className:e,classNames:t,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="MAGIC_LINK")return C.jsx(xA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="EMAIL_OTP")return C.jsx(EA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="EMAIL_VERIFICATION")return C.jsx(Ute,{className:e,classNames:t,callbackURL:n,localization:o,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="FORGOT_PASSWORD")return C.jsx(Fte,{className:e,classNames:t,localization:o,isSubmitting:r,setIsSubmitting:f});if(c==="RESET_PASSWORD")return C.jsx(Vte,{className:e,classNames:t,localization:o});if(c==="SIGN_UP")return T&&C.jsx(Hte,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f})}function Zte({className:e,classNames:t,localization:n}){const{localization:r,redirectTo:o,replace:s,toast:l}=P.useContext(vt),c=P.useMemo(()=>({...r,...n}),[r,n]),{data:d}=Wee(),[f,p]=P.useState(null);return P.useEffect(()=>{const h=gl("invitationId");if(!h){l({variant:"error",message:c.INVITATION_NOT_FOUND}),s(o);return}p(h)},[c.INVITATION_NOT_FOUND,l,s,o]),!d||!f?C.jsx(r5,{className:e,classNames:t}):C.jsx(Yte,{className:e,classNames:t,localization:c,invitationId:f})}function Yte({className:e,classNames:t,localization:n,invitationId:r}){var o;const{authClient:s,hooks:{useInvitation:l},localization:c,organization:d,redirectTo:f,replace:p,toast:h,localizeErrors:g}=P.useContext(vt),v=P.useMemo(()=>({...c,...n}),[c,n]),[_,b]=P.useState(!1),[x,S]=P.useState(!1),E=_||x,{data:T,isPending:R}=l({query:{id:r}}),O=P.useCallback(()=>gl("redirectTo")||f,[f]);P.useEffect(()=>{if(!(R||!r)){if(!T){h({variant:"error",message:v.INVITATION_NOT_FOUND}),p(f);return}(T.status!=="pending"||new Date(T.expiresAt)<new Date)&&(h({variant:"error",message:new Date(T.expiresAt)<new Date?v.INVITATION_EXPIRED:v.INVITATION_NOT_FOUND}),p(f))}},[T,R,r,v,h,p,f]);const A=async()=>{S(!0);try{await s.organization.acceptInvitation({invitationId:r,fetchOptions:{throw:!0}}),h({variant:"success",message:v.INVITATION_ACCEPTED||"Invitation accepted"}),p(O())}catch(j){h({variant:"error",message:kn({error:j,localization:v,localizeErrors:g})}),S(!1)}},I=async()=>{b(!0);try{await s.organization.rejectInvitation({invitationId:r,fetchOptions:{throw:!0}}),h({variant:"success",message:v.INVITATION_REJECTED}),p(f)}catch(j){h({variant:"error",message:kn({error:j,localization:v,localizeErrors:g})}),b(!1)}},q=((o=[...[{role:"owner",label:v.OWNER},{role:"admin",label:v.ADMIN},{role:"member",label:v.MEMBER}],...d?.customRoles||[]].find(j=>j.role===T?.role))==null?void 0:o.label)||T?.role;return T?C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsxs(DS,{className:Ce("justify-items-center text-center",t?.header),children:[C.jsx(GD,{className:Ce("text-lg md:text-xl",t?.title),children:v.ACCEPT_INVITATION}),C.jsx(KD,{className:Ce("text-xs md:text-sm",t?.description),children:v.ACCEPT_INVITATION_DESCRIPTION})]}),C.jsxs(LS,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[C.jsxs(nf,{className:Ce("flex-row items-center p-4"),children:[C.jsx(e5,{organization:{id:T.organizationId,name:T.organizationName,slug:T.organizationSlug,logo:T.organizationLogo,createdAt:new Date},localization:v}),C.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:q})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsxs(sn,{variant:"outline",className:Ce(t?.button,t?.outlineButton),onClick:I,disabled:E,children:[_?C.jsx(Ar,{className:"animate-spin"}):C.jsx(uK,{}),v.REJECT]}),C.jsxs(sn,{className:Ce(t?.button,t?.primaryButton),onClick:A,disabled:E,children:[x?C.jsx(Ar,{className:"animate-spin"}):C.jsx(LN,{}),v.ACCEPT]})]})]})]}):C.jsx(r5,{className:e,classNames:t})}var r5=({className:e,classNames:t,localization:n})=>C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsxs(DS,{className:Ce("justify-items-center",t?.header),children:[C.jsx(ss,{className:Ce("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),C.jsx(ss,{className:Ce("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),C.jsxs(LS,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[C.jsxs(nf,{className:Ce("flex-row items-center p-4"),children:[C.jsx(e5,{isPending:!0,localization:n}),C.jsx(ss,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsx(ss,{className:"h-9 w-full"}),C.jsx(ss,{className:"h-9 w-full"})]})]})]});function RA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return C.jsx(Yee,{"data-slot":"separator",decorative:n,orientation:t,className:Ce("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Wte({classNames:e,isSubmitting:t,localization:n,view:r}){var o,s,l,c;const{viewPaths:d,navigate:f,basePath:p}=P.useContext(vt);return C.jsxs(sn,{className:Ce("w-full",(o=e?.form)==null?void 0:o.button,(s=e?.form)==null?void 0:s.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${p}/${r==="EMAIL_OTP"?d.SIGN_IN:d.EMAIL_OTP}${window.location.search}`),children:[r==="EMAIL_OTP"?C.jsx($N,{className:(l=e?.form)==null?void 0:l.icon}):C.jsx(jN,{className:(c=e?.form)==null?void 0:c.icon}),n.SIGN_IN_WITH," ",r==="EMAIL_OTP"?n.PASSWORD:n.EMAIL_OTP]})}function Qte({classNames:e,isSubmitting:t,localization:n,view:r}){var o,s,l,c;const{viewPaths:d,navigate:f,basePath:p,credentials:h}=P.useContext(vt);return C.jsxs(sn,{className:Ce("w-full",(o=e?.form)==null?void 0:o.button,(s=e?.form)==null?void 0:s.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${p}/${r==="MAGIC_LINK"||!h?d.SIGN_IN:d.MAGIC_LINK}${window.location.search}`),children:[r==="MAGIC_LINK"?C.jsx($N,{className:(l=e?.form)==null?void 0:l.icon}):C.jsx(jN,{className:(c=e?.form)==null?void 0:c.icon}),n.SIGN_IN_WITH," ",r==="MAGIC_LINK"?n.PASSWORD:n.MAGIC_LINK]})}function Xte({localization:e,redirectTo:t}){const{authClient:n,localization:r,toast:o,localizeErrors:s}=P.useContext(vt),l=P.useRef(!1);e=P.useMemo(()=>({...r,...e}),[r,e]);const{onSuccess:c}=Mi({redirectTo:t});return P.useEffect(()=>{if(!l.current){l.current=!0;try{n.oneTap({fetchOptions:{throw:!0,onSuccess:c}})}catch(d){o({variant:"error",message:kn({error:d,localization:e,localizeErrors:s})})}}},[n,e,s,c,o]),null}function Jte({classNames:e,isSubmitting:t,localization:n,redirectTo:r,setIsSubmitting:o}){var s,l;const{authClient:c,localization:d,toast:f,localizeErrors:p}=P.useContext(vt);n={...d,...n};const{onSuccess:h}=Mi({redirectTo:r}),g=async()=>{o?.(!0);try{const v=await c.signIn.passkey({fetchOptions:{throw:!0}});v?.error?(f({variant:"error",message:kn({error:v.error,localization:n,localizeErrors:p})}),o?.(!1)):h()}catch(v){f({variant:"error",message:kn({error:v,localization:n,localizeErrors:p})}),o?.(!1)}};return C.jsxs(sn,{className:Ce("w-full",(s=e?.form)==null?void 0:s.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,formNoValidate:!0,name:"passkey",value:"true",variant:"secondary",onClick:g,children:[C.jsx(iK,{}),n.SIGN_IN_WITH," ",n.PASSKEY]})}function OA({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,other:s,provider:l,redirectTo:c,socialLayout:d,setIsSubmitting:f}){var p,h,g,v;const{authClient:_,basePath:b,baseURL:x,persistClient:S,redirectTo:E,viewPaths:T,social:R,genericOAuth:O,toast:A,localizeErrors:I}=P.useContext(vt),M=P.useCallback(()=>c||gl("redirectTo")||E,[c,E]),L=P.useCallback(()=>`${x}${n||(S?`${b}/${T.CALLBACK}?redirectTo=${encodeURIComponent(M())}`:M())}`,[n,S,b,T,x,M]),q=async()=>{f(!0);try{if(s){const j={providerId:l.provider,callbackURL:L(),fetchOptions:{throw:!0}};O?.signIn?(await O.signIn(j),setTimeout(()=>{f(!1)},1e4)):await _.signIn.oauth2(j)}else{const j={provider:l.provider,callbackURL:L(),fetchOptions:{throw:!0}};R?.signIn?(await R.signIn(j),setTimeout(()=>{f(!1)},1e4)):await _.signIn.social(j)}}catch(j){A({variant:"error",message:kn({error:j,localization:o,localizeErrors:I})}),f(!1)}};return C.jsxs(sn,{className:Ce(d==="vertical"?"w-full":"grow",e,(p=t?.form)==null?void 0:p.button,(h=t?.form)==null?void 0:h.outlineButton,(g=t?.form)==null?void 0:g.providerButton),disabled:r,variant:"outline",onClick:q,children:[l.icon&&C.jsx(l.icon,{className:(v=t?.form)==null?void 0:v.icon}),d==="grid"&&l.name,d==="vertical"&&`${o.SIGN_IN_WITH} ${l.name}`]})}function rue({className:e,classNames:t,callbackURL:n,cardHeader:r,cardFooter:o,localization:s,path:l,pathname:c,redirectTo:d,socialLayout:f="auto",view:p,otpSeparators:h=0}){var g,v,_,b,x,S;const E=ms(),{basePath:T,credentials:R,localization:O,magicLink:A,emailOTP:I,oneTap:M,passkey:L,signUp:q,social:j,genericOAuth:B,viewPaths:F,Link:Z}=P.useContext(vt);s={...O,...s};let ie=f;ie==="auto"&&(ie=R&&j?.providers&&j.providers.length>2?"horizontal":"vertical");const H=l??c?.split("/").pop(),W=p||Zb(F,H)||"SIGN_IN",[te,le]=P.useState(!1);if(P.useEffect(()=>{const k=()=>le(!1);return window.addEventListener("pagehide",k),()=>{le(!1),window.removeEventListener("pagehide",k)}},[]),W==="CALLBACK")return C.jsx(t5,{redirectTo:d});if(W==="SIGN_OUT")return C.jsx(n5,{redirectTo:d});if(W==="ACCEPT_INVITATION")return C.jsx(Zte,{className:e,classNames:t});const Q=!R&&!A&&!I?s.DISABLED_CREDENTIALS_DESCRIPTION:s[`${W}_DESCRIPTION`];return C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsx(DS,{className:t?.header,children:r||C.jsxs(C.Fragment,{children:[C.jsx(GD,{className:Ce("text-lg md:text-xl",t?.title),children:s[W]}),Q&&C.jsx(KD,{className:Ce("text-xs md:text-sm",t?.description),children:Q})]})}),C.jsxs(LS,{className:Ce("grid gap-6",t?.content),children:[M&&["SIGN_IN","SIGN_UP","MAGIC_LINK","EMAIL_OTP"].includes(W)&&C.jsx(Xte,{localization:s,redirectTo:d}),(R||A||I)&&C.jsxs("div",{className:"grid gap-4",children:[C.jsx(Kte,{classNames:t?.form,callbackURL:n,isSubmitting:te,localization:s,otpSeparators:h,view:W,redirectTo:d,setIsSubmitting:le}),A&&(R&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||I&&W==="EMAIL_OTP")&&C.jsx(Qte,{classNames:t,localization:s,view:W,isSubmitting:te}),I&&(R&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||A&&["SIGN_IN","MAGIC_LINK"].includes(W))&&C.jsx(Wte,{classNames:t,localization:s,view:W,isSubmitting:te})]}),W!=="RESET_PASSWORD"&&W!=="EMAIL_VERIFICATION"&&(((g=j?.providers)==null?void 0:g.length)||((v=B?.providers)==null?void 0:v.length)||W==="SIGN_IN"&&L)&&C.jsxs(C.Fragment,{children:[(R||A||I)&&C.jsxs("div",{className:Ce("flex items-center gap-2",t?.continueWith),children:[C.jsx(RA,{className:Ce("!w-auto grow",t?.separator)}),C.jsx("span",{className:"flex-shrink-0 text-muted-foreground text-sm",children:s.OR_CONTINUE_WITH}),C.jsx(RA,{className:Ce("!w-auto grow",t?.separator)})]}),C.jsxs("div",{className:"grid gap-4",children:[(((_=j?.providers)==null?void 0:_.length)||((b=B?.providers)==null?void 0:b.length))&&C.jsxs("div",{className:Ce("flex w-full items-center justify-between gap-4",ie==="horizontal"&&"flex-wrap",ie==="vertical"&&"flex-col",ie==="grid"&&"grid grid-cols-2"),children:[(x=j?.providers)==null?void 0:x.map(k=>{const G=Mte.find(V=>V.provider===k);return G?C.jsx(OA,{classNames:t,callbackURL:n,isSubmitting:te,localization:s,provider:G,redirectTo:d,setIsSubmitting:le,socialLayout:ie},k):null}),(S=B?.providers)==null?void 0:S.map(k=>C.jsx(OA,{classNames:t,callbackURL:n,isSubmitting:te,localization:s,provider:k,redirectTo:d,setIsSubmitting:le,socialLayout:ie,other:!0},k.provider))]}),L&&["SIGN_IN","MAGIC_LINK","EMAIL_OTP","RECOVER_ACCOUNT","TWO_FACTOR","FORGOT_PASSWORD"].includes(W)&&C.jsx(Jte,{classNames:t,isSubmitting:te,localization:s,redirectTo:d,setIsSubmitting:le})]})]})]}),o&&C.jsx(wA,{className:t?.footer,children:o}),R&&q&&C.jsxs(wA,{className:Ce("justify-center gap-1.5 text-muted-foreground text-sm",t?.footer),children:[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?s.DONT_HAVE_AN_ACCOUNT:W==="SIGN_UP"?s.ALREADY_HAVE_AN_ACCOUNT:C.jsx(eK,{className:"size-3"}),W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"||W==="SIGN_UP"?C.jsx(Z,{className:Ce("text-foreground underline",t?.footerLink),href:`${T}/${F[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?"SIGN_UP":"SIGN_IN"]}${E?window.location.search:""}`,children:C.jsx(sn,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),children:W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?s.SIGN_UP:s.SIGN_IN})}):C.jsx(sn,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),onClick:()=>window.history.back(),children:s.GO_BACK})]})]})}function oue({children:e}){const{hooks:{useSession:t}}=P.useContext(vt),{isPending:n}=t();return n?e:null}function iue({children:e}){const{hooks:{useSession:t}}=P.useContext(vt),{data:n}=t();return n?e:null}function sue({children:e}){const{hooks:{useSession:t}}=P.useContext(vt),{data:n,isPending:r}=t();return!n&&!r?e:null}function ene(e){const t=Hn.c(8),{children:n}=e,r=Ng();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={basePath:"/",pathMode:"slug"},t[0]=o):o=t[0];let s,l;t[1]!==r?(s=d=>r({to:d}),l=d=>r({to:d,replace:!0}),t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let c;return t[4]!==n||t[5]!==s||t[6]!==l?(c=C.jsx(WG,{authClient:Vg,redirectTo:"/",organization:o,navigate:s,replace:l,Link:tne,children:n}),t[4]=n,t[5]=s,t[6]=l,t[7]=c):c=t[7],c}function tne(e){const{href:t,className:n,children:r,...o}=e;return C.jsx(Dg,{to:t,className:n,...o,children:r})}var me=typeof window<"u"?window:void 0,Xn=typeof globalThis<"u"?globalThis:me;typeof self>"u"&&(Xn.self=Xn),typeof File>"u"&&(Xn.File=function(){});var go=Xn?.navigator,Le=Xn?.document,pr=Xn?.location,_1=Xn?.fetch,b1=Xn!=null&&Xn.XMLHttpRequest&&"withCredentials"in new Xn.XMLHttpRequest?Xn.XMLHttpRequest:void 0,TA=Xn?.AbortController,nne=Xn?.CompressionStream,Yr=go?.userAgent,We=me??{},CA="1.372.3",$r={DEBUG:!1,LIB_VERSION:CA,LIB_NAME:"web",JS_SDK_VERSION:CA};function AA(e,t,n,r,o,s,l){try{var c=e[s](l),d=c.value}catch(f){return void n(f)}c.done?t(d):Promise.resolve(d).then(r,o)}function Lo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function l(d){AA(s,r,o,l,c,"next",d)}function c(d){AA(s,r,o,l,c,"throw",d)}l(void 0)}))}}function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ne.apply(null,arguments)}function o5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function w1(){return w1=Lo((function*(e,t,n){t===void 0&&(t=!0);try{var r=new CompressionStream("gzip"),o=r.writable.getWriter(),s=o.write(new TextEncoder().encode(e)).then((()=>o.close())).catch((function(){var d=Lo((function*(f){try{yield o.abort(f)}catch{}throw f}));return function(f){return d.apply(this,arguments)}})()),l=new Response(r.readable).blob(),[c]=yield Promise.all([l,s]);return c}catch(d){if(n!=null&&n.rethrow)throw d;return t&&console.error("Failed to gzip compress data",d),null}})),w1.apply(this,arguments)}var rne=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],IA=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return rne.concat(t).some((r=>{var o=r.toLowerCase();return n.indexOf(o)!==-1}))},one=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function Et(e,t){return e.indexOf(t)!==-1}var ov=function(e){return e.trim()},S1=function(e){return e.replace(/^\$/,"")},i5=Object.prototype,s5=i5.hasOwnProperty,iv=i5.toString,Mt=Array.isArray||function(e){return iv.call(e)==="[object Array]"},is=e=>typeof e=="function",An=e=>e===Object(e)&&!Mt(e),Ic=e=>{if(An(e)){for(var t in e)if(s5.call(e,t))return!1;return!0}return!1},ze=e=>e===void 0,_n=e=>iv.call(e)=="[object String]",Rm=e=>_n(e)&&e.trim().length===0,ys=e=>e===null,xt=e=>ze(e)||ys(e),Fo=e=>iv.call(e)=="[object Number]"&&e==e,Sc=e=>Fo(e)&&e>0,Ri=e=>iv.call(e)==="[object Boolean]",ine=e=>e instanceof FormData,sne=e=>Et(one,e);function a5(e){return e===null||typeof e!="object"}function og(e,t){return{}.toString.call(e)==="[object "+t+"]"}function FS(e){return typeof Event<"u"&&(function(t,n){try{return t instanceof n}catch{return!1}})(e,Event)}var ane=[!0,"true",1,"1","yes"],Z_=e=>Et(ane,e),lne=[!1,"false",0,"0","no"];function Oi(e,t,n,r,o){return t>n&&(r.warn("min cannot be greater than max."),t=n),Fo(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+o),Oi(o||n,t,n,r))}class cne{constructor(t){this.$t={},this.zt=t.zt,this.Ut=Oi(t.bucketSize,0,100,t.Gt),this.Wt=Oi(t.refillRate,0,this.Ut,t.Gt),this.Xt=Oi(t.refillInterval,0,864e5,t.Gt)}Jt(t,n){var r=Math.floor((n-t.lastAccess)/this.Xt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Wt,this.Ut),t.lastAccess=t.lastAccess+r*this.Xt)}consumeRateLimit(t){var n,r=Date.now(),o=String(t),s=this.$t[o];return s?this.Jt(s,r):this.$t[o]=s={tokens:this.Ut,lastAccess:r},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.zt)==null||n.call(this,t)),s.tokens===0)}stop(){this.$t={}}}var bp,PA,Y_,yo="Mobile",ig="iOS",cs="Android",Zc="Tablet",l5=cs+" "+Zc,c5="iPad",u5="Apple",d5=u5+" Watch",$d="Safari",Yc="BlackBerry",f5="Samsung",h5=f5+"Browser",p5=f5+" Internet",al="Chrome",une=al+" OS",m5=al+" "+ig,BS="Internet Explorer",g5=BS+" "+yo,VS="Opera",dne=VS+" Mini",qS="Edge",v5="Microsoft "+qS,Uc="Firefox",y5=Uc+" "+ig,of="Nintendo",sf="PlayStation",Fc="Xbox",_5=cs+" "+yo,b5=yo+" "+$d,Od="Windows",E1=Od+" Phone",MA="Nokia",x1="Ouya",w5="Generic",fne=w5+" "+yo.toLowerCase(),S5=w5+" "+Zc.toLowerCase(),R1="Konqueror",Lr="(\\d+(\\.\\d+)?)",W_=new RegExp("Version/"+Lr),hne=new RegExp(Fc,"i"),pne=new RegExp(sf+" \\w+","i"),mne=new RegExp(of+" \\w+","i"),HS=new RegExp(Yc+"|PlayBook|BB10","i"),gne={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},E5=function(e,t){return t=t||"",Et(e," OPR/")&&Et(e,"Mini")?dne:Et(e," OPR/")?VS:HS.test(e)?Yc:Et(e,"IE"+yo)||Et(e,"WPDesktop")?g5:Et(e,h5)?p5:Et(e,qS)||Et(e,"Edg/")?v5:Et(e,"FBIOS")?"Facebook "+yo:Et(e,"UCWEB")||Et(e,"UCBrowser")?"UC Browser":Et(e,"CriOS")?m5:Et(e,"CrMo")||Et(e,al)?al:Et(e,cs)&&Et(e,$d)?_5:Et(e,"FxiOS")?y5:Et(e.toLowerCase(),R1.toLowerCase())?R1:((n,r)=>r&&Et(r,u5)||(function(o){return Et(o,$d)&&!Et(o,al)&&!Et(o,cs)})(n))(e,t)?Et(e,yo)?b5:$d:Et(e,Uc)?Uc:Et(e,"MSIE")||Et(e,"Trident/")?BS:Et(e,"Gecko")?Uc:""},vne={[g5]:[new RegExp("rv:"+Lr)],[v5]:[new RegExp(qS+"?\\/"+Lr)],[al]:[new RegExp("("+al+"|CrMo)\\/"+Lr)],[m5]:[new RegExp("CriOS\\/"+Lr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Lr)],[$d]:[W_],[b5]:[W_],[VS]:[new RegExp("(Opera|OPR)\\/"+Lr)],[Uc]:[new RegExp(Uc+"\\/"+Lr)],[y5]:[new RegExp("FxiOS\\/"+Lr)],[R1]:[new RegExp("Konqueror[:/]?"+Lr,"i")],[Yc]:[new RegExp(Yc+" "+Lr),W_],[_5]:[new RegExp("android\\s"+Lr,"i")],[p5]:[new RegExp(h5+"\\/"+Lr)],[BS]:[new RegExp("(rv:|MSIE )"+Lr)],Mozilla:[new RegExp("rv:"+Lr)]},yne=function(e,t){var n=E5(e,t),r=vne[n];if(ze(r))return null;for(var o=0;r.length>o;o++){var s=e.match(r[o]);if(s)return parseFloat(s[s.length-2])}return null},NA=[[new RegExp(Fc+"; "+Fc+" (.*?)[);]","i"),e=>[Fc,e&&e[1]||""]],[new RegExp(of,"i"),[of,""]],[new RegExp(sf,"i"),[sf,""]],[HS,[Yc,""]],[new RegExp(Od,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[E1,""];if(new RegExp(yo).test(t)&&!/IEMobile\b/.test(t))return[Od+" "+yo,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=gne[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Od,r]}return[Od,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ig,[e[3],e[4],e[5]||"0"].join(".")]:[ig,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ze(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+cs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+cs+")","i"),e=>e&&e[2]?[cs,[e[2],e[3],e[4]||"0"].join(".")]:[cs,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[une,""]],[/Linux|debian/i,["Linux",""]]],kA=function(e){return mne.test(e)?of:pne.test(e)?sf:hne.test(e)?Fc:new RegExp(x1,"i").test(e)?x1:new RegExp("("+E1+"|WPDesktop)","i").test(e)?E1:/iPad/.test(e)?c5:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?d5:HS.test(e)?Yc:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(MA,"i").test(e)?MA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(yo).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?cs:l5:new RegExp("(pda|"+yo+")","i").test(e)?fne:new RegExp(Zc,"i").test(e)&&!new RegExp(Zc+" pc","i").test(e)?S5:""},_ne=e=>e instanceof Error,x5={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},bne=x5.info;function R5(e){if(Ri(e))return{boolValue:e};if(typeof e=="number")return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e=="string")return{stringValue:e};if(Mt(e))return{arrayValue:{values:e.map((t=>R5(t)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function DA(e){var t=[];for(var n in e){var r=e[n];ys(r)||ze(r)||t.push({key:n,value:R5(r)})}return t}function wne(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return Y_&&n.length===PA||(PA=n.length,Y_=n.reduce(((r,o)=>{bp||(bp={});var s=bp[o];if(s)r[s[0]]=s[1];else for(var l=e(o),c=l.length-1;c>=0;c--){var d=l[c],f=d?.filename,p=t[o];if(f&&p){r[f]=p,bp[o]=[f,p];break}}return r}),{})),Y_}}class Sne{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},o=this.buildCoercingContext(r,n,0).apply(t),s=this.buildParsingContext(n),l=this.parseStacktrace(o,s);return{$exception_list:this.convertToExceptionList(l,r),$exception_level:"error"}}modifyFrames(t){var n=this;return Lo((function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Mt(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t}))()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,o;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(o=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),Ne({},t,{cause:r,stack:o})}applyChunkIds(t,n){return t.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return Lo((function*(){var r=t;for(var o of n.modifiers)r=yield o(r);return r}))()}convertToExceptionList(t,n){var r,o,s,l={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(o=n.handled)===null||o===void 0||o,synthetic:(s=t.synthetic)!==null&&s!==void 0&&s}};t.stack&&(l.stacktrace={type:"raw",frames:t.stack});var c=[l];return t.cause!=null&&c.push(...this.convertToExceptionList(t.cause,Ne({},n,{handled:!0}))),c}buildParsingContext(t){var n;return{chunkIdMap:wne(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var o=(s,l)=>{if(4>=l){var c=this.buildCoercingContext(t,n,l);return this.applyCoercers(s,c)}};return Ne({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:s=>o(s,r),next:s=>o(s,r+1)})}}var Wc="?";function O1(e,t,n,r,o){var s={platform:e,filename:t,function:n==="<anonymous>"?Wc:n,in_app:!0};return ze(r)||(s.lineno=r),ze(o)||(s.colno=o),s}var O5=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Wc,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Ene=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xne=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Rne=/\((\S*)(?::(\d+))(?::(\d+))\)/,One=(e,t)=>{var n=Ene.exec(e);if(n){var[,r,o,s]=n;return O1(t,r,Wc,+o,+s)}var l=xne.exec(e);if(l){if(l[2]&&l[2].indexOf("eval")===0){var c=Rne.exec(l[2]);c&&(l[2]=c[1],l[3]=c[2],l[4]=c[3])}var[d,f]=O5(l[1]||Wc,l[2]);return O1(t,f,d,l[3]?+l[3]:void 0,l[4]?+l[4]:void 0)}},Tne=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Cne=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ane=(e,t)=>{var n=Tne.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Cne.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var o=n[3],s=n[1]||Wc;return[s,o]=O5(s,o),O1(t,o,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},LA=/\(error: (.*)\)/;class Ine{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=_n(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return og(t,"DOMException")}isDOMError(t){return og(t,"DOMError")}}class Pne{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Mne{constructor(){}match(t){return og(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r;return n.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var Nne=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class kne{match(t){return typeof t=="string"}coerce(t,n){var r,[o,s]=this.getInfos(t);return{type:o??"Error",value:s??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,o=t.match(Nne);return o&&(n=o[1],r=o[2]),[n,r]}}var Dne=["fatal","error","warning","log","info","debug"];function T5(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(t>=o.length)return r===n.length?o:o.length>t?o.slice(0,t)+"...":o}return""}class Lne{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,o=this.getErrorPropertyFromObject(t);return o?n.apply(o):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return FS(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+T5(t)}isSeverityLevel(t){return _n(t)&&!Rm(t)&&Dne.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if({}.hasOwnProperty.call(t,n)){var r=t[n];if(_ne(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class $ne{match(t){return FS(t)}coerce(t,n){var r,o=t.constructor.name;return{type:o,value:o+" captured as exception with keys: "+T5(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class jne{match(t){return a5(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class zne{match(t){return og(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!FS(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,o=this.getUnhandledRejectionReason(t);return a5(o)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(o)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var sg="$message",ag="$timestamp",Une=new Set([sg,ag]),Q_={enabled:!0,max_bytes:32768};function lg(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:Q_.enabled,max_bytes:Bne(e.max_bytes,Q_.max_bytes)}:Ne({},Q_)}class Fne{constructor(t){this.Kt=[],this.Qt=0,this.Bt=lg(t)}setConfig(t){this.Bt=lg(t),this.er()}add(t){var n=(function(o){var s=(function(p){var h=new WeakSet;try{return JSON.stringify(p,((g,v)=>{if(typeof v=="bigint")return v.toString();if(typeof v!="function"&&typeof v!="symbol"){if(v instanceof Date)return v.toISOString();if(v instanceof Error)return{name:v.name,message:v.message,stack:v.stack};if(v&&typeof v=="object"){if(h.has(v))return"[Circular]";h.add(v)}return v}}))}catch{return}})(o);if(s)try{var l=JSON.parse(s);if(!An(l))return;var c=l,d=c[sg],f=c[ag];return!_n(d)||d.trim().length===0||!_n(f)&&!Fo(f)?void 0:{step:c,json:s}}catch{return}})(t);if(n){var r=(function(o){if(typeof TextEncoder<"u")return new TextEncoder().encode(o).length;for(var s=encodeURIComponent(o),l=0,c=0;s.length>c;c++)s[c]==="%"?(l+=1,c+=2):l+=1;return l})(n.json);r>this.Bt.max_bytes||(this.Kt.push({step:n.step,bytes:r}),this.Qt+=r,this.er())}}getAttachable(){return this.Kt.map((t=>t.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var t=this.Kt.shift();t&&(this.Qt-=t.bytes)}}}function Bne(e,t){if(!Fo(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var C5=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={C(o){if(me&&($r.DEBUG||We.POSTHOG_DEBUG||n)&&!ze(me.console)&&me.console){for(var s=("__rrweb_original__"in me.console[o])?me.console[o].__rrweb_original__:me.console[o],l=arguments.length,c=new Array(l>1?l-1:0),d=1;l>d;d++)c[d-1]=arguments[d];s(e,...c)}},info(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("log",...s)},warn(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("warn",...s)},error(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("error",...s)},critical(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];console.error(e,...s)},uninitializedWarning(o){r.error("You must initialize PostHog before calling "+o)},createLogger:(o,s)=>C5(e+" "+o,s)};return r},$e=C5("[PostHog.js]"),mn=$e.createLogger,Vne=mn("[ExternalScriptsLoader]"),X_=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Vne.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Le?.querySelectorAll("script");if(r){for(var o,s=function(){if(r[l].src===t){var d=r[l];return d.__posthog_loading_callback_fired?{v:n()}:(d.addEventListener("load",(f=>{d.__posthog_loading_callback_fired=!0,n(void 0,f)})),d.onerror=f=>n(f),{v:void 0})}},l=0;r.length>l;l++)if(o=s())return o.v}var c=()=>{if(!Le)return n("document not found");var d=Le.createElement("script");if(d.type="text/javascript",d.crossOrigin="anonymous",d.src=t,d.onload=h=>{d.__posthog_loading_callback_fired=!0,n(void 0,h)},d.onerror=h=>n(h),e.config.prepare_external_dependency_script&&(d=e.config.prepare_external_dependency_script(d)),!d)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")Le.head.appendChild(d);else{var f,p=Le.querySelectorAll("body > script");p.length>0?(f=p[0].parentNode)==null||f.insertBefore(d,p[0]):Le.body.appendChild(d)}};Le!=null&&Le.body?c():Le?.addEventListener("DOMContentLoaded",c)};We.__PosthogExtensions__=We.__PosthogExtensions__||{},We.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!=="remote-config"){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var o="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var s=3e5;o=o+"&t="+Math.floor(Date.now()/s)*s}r=e.requestRouter.endpointFor("assets",o)}X_(e,r,n)}else{var l=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");X_(e,l,n)}},We.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);X_(e,r,n)};var A5="$people_distinct_id",cg="$device_id",Td="__alias",Cd="__timers",T1="$autocapture_disabled_server_side",C1="$heatmaps_enabled_server_side",A1="$exception_capture_enabled_server_side",I1="$error_tracking_suppression_rules",P1="$error_tracking_capture_extension_exceptions",M1="$web_vitals_enabled_server_side",GS="$dead_clicks_enabled_server_side",N1="$product_tours_enabled_server_side",k1="$web_vitals_allowed_metrics",Ad="$session_recording_remote_config",I5="$replay_override_sampling",P5="$replay_override_linked_flag",M5="$replay_override_url_trigger",N5="$replay_override_event_trigger",ug="$sesid",KS="$session_is_sampled",Pc="$enabled_feature_flags",Om="$active_feature_flags",Id="$early_access_features",D1="$feature_flag_details",L1="$feature_flag_payloads",$1="$feature_flag_request_id",os="$override_feature_flags",Ec="$override_feature_flag_payloads",Pd="$stored_person_properties",Wa="$stored_group_properties",j1="$surveys",z1="$surveys_activated",Tm="ph_product_tours",jd="$flag_call_reported",U1="$flag_call_reported_session_id",F1="$feature_flag_errors",dg="$feature_flag_evaluated_at",ei="$user_state",B1="$client_session_props",V1="$capture_rate_limit",q1="$initial_campaign_params",H1="$initial_referrer_info",fg="$initial_person_info",hg="$epp",k5="__POSTHOG_TOOLBAR__",wp="$posthog_cookieless",D5="$sdk_debug_extensions_init_method",L5="$sdk_debug_extensions_init_time_ms",$5="$sdk_debug_recording_script_not_loaded",ZS="PostHog loadExternalDependency extension not found.",Qa="on_reject",as="always",pc="anonymous",mc="identified",G1="identified_only",pg="visibilitychange",mg="beforeunload",xc="$pageview",J_="$pageleave",eb="$identify",$A="$groupidentify";function Sp(e,t){Mt(e)&&e.forEach(t)}function dn(e,t){if(!xt(e))if(Mt(e))e.forEach(t);else if(ine(e))e.forEach(((r,o)=>t(r,o)));else for(var n in e)s5.call(e,n)&&t(e[n],n)}var Rn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var o of n)for(var s in o)o[s]!==void 0&&(e[s]=o[s]);return e};function Cm(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var jA=function(e){try{return e()}catch{return}},qne=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(o){$e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$e.critical(o)}}},YS=function(e){var t={};return dn(e,(function(n,r){(_n(n)&&n.length>0||Fo(n))&&(t[r]=n)})),t},Hne=["herokuapp.com","vercel.app","netlify.app"];function Gne(e){var t=e?.hostname;if(!_n(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of Hne)if(n===r)return!1;return!0}function Vn(e,t,n,r){var{capture:o=!1,passive:s=!0}=r??{};e?.addEventListener(t,n,{capture:o,passive:s})}function j5(e){return e.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Fo(e)&&isFinite(e)&&Math.floor(e)===e});class gg{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,o){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||0>t||0>n||0>r||0>o||t>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=o>>>24,s[13]=o>>>16,s[14]=o>>>8,s[15]=o,new gg(s)}toString(){for(var t="",n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new gg(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;16>n;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Kne{constructor(){this.I=0,this.S=0,this.k=new Zne}generate(){var t=this.generateOrAbort();if(ze(t)){this.I=0;var n=this.generateOrAbort();if(ze(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.I)this.I=t,this.A();else{if(this.I>=t+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return gg.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var zA,z5=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};me&&!ze(me.crypto)&&crypto.getRandomValues&&(z5=e=>crypto.getRandomValues(e));class Zne{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(z5(this.T),this.N=0),this.T[this.N++]}}var na=()=>Yne().toString(),Yne=()=>(zA||(zA=new Kne)).generate(),ud="",Wne=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Ei={R:()=>!!Le,B(e){$e.error("cookieStore error: "+e)},O(e){if(Le){try{for(var t=e+"=",n=Le.cookie.split(";").filter((s=>s.length)),r=0;n.length>r;r++){for(var o=n[r];o.charAt(0)==" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return decodeURIComponent(o.substring(t.length,o.length))}}catch{}return null}},Z(e){var t;try{t=JSON.parse(Ei.O(e))||{}}catch{}return t},M(e,t,n,r,o){if(Le)try{var s="",l="",c=(function(p,h){if(h){var g=(function(_,b){if(b===void 0&&(b=Le),ud)return ud;if(!b||["localhost","127.0.0.1"].includes(_))return"";for(var x=_.split("."),S=Math.min(x.length,8),E="dmn_chk_"+na();!ud&&S--;){var T=x.slice(S).join("."),R=E+"=1;domain=."+T+";path=/";b.cookie=R+";max-age=3",b.cookie.includes(E)&&(b.cookie=R+";max-age=0",ud=T)}return ud})(p);if(!g){var v=(_=>{var b=_.match(Wne);return b?b[0]:""})(p);v!==g&&$e.info("Warning: cookie subdomain discovery mismatch",v,g),g=v}return g?"; domain=."+g:""}return""})(Le.location.hostname,r);if(n){var d=new Date;d.setTime(d.getTime()+864e5*n),s="; expires="+d.toUTCString()}o&&(l="; secure");var f=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+c+l;return f.length>3686.4&&$e.warn("cookieStore warning: large cookie, len="+f.length),Le.cookie=f,f}catch{return}},F(e,t){if(Le!=null&&Le.cookie)try{Ei.M(e,"",-1,t)}catch{return}}},tb=null,yn={R(){if(!ys(tb))return tb;var e=!0;if(ze(me))e=!1;else try{var t="__mplssupport__";yn.M(t,"xyz"),yn.O(t)!=='"xyz"'&&(e=!1),yn.F(t)}catch{e=!1}return e||$e.error("localStorage unsupported; falling back to cookie store"),tb=e,e},B(e){$e.error("localStorage error: "+e)},O(e){try{return me?.localStorage.getItem(e)}catch(t){yn.B(t)}return null},Z(e){try{return JSON.parse(yn.O(e))||{}}catch{}return null},M(e,t){try{me?.localStorage.setItem(e,JSON.stringify(t))}catch(n){yn.B(n)}},F(e){try{me?.localStorage.removeItem(e)}catch(t){yn.B(t)}}},Qne=[cg,"distinct_id",ug,KS,hg,fg,ei],Ep={},Xne={R:()=>!0,B(e){$e.error("memoryStorage error: "+e)},O:e=>Ep[e]||null,Z:e=>Ep[e]||null,M(e,t){Ep[e]=t},F(e){delete Ep[e]}},qa=null,mr={R(){if(!ys(qa))return qa;if(qa=!0,ze(me))qa=!1;else try{var e="__support__";mr.M(e,"xyz"),mr.O(e)!=='"xyz"'&&(qa=!1),mr.F(e)}catch{qa=!1}return qa},B(e){$e.error("sessionStorage error: ",e)},O(e){try{return me?.sessionStorage.getItem(e)}catch(t){mr.B(t)}return null},Z(e){try{return JSON.parse(mr.O(e))||null}catch{}return null},M(e,t){try{me?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){mr.B(n)}},F(e){try{me?.sessionStorage.removeItem(e)}catch(t){mr.B(t)}}};class Jne{constructor(t){this._instance=t}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===as||this.isRejected()||this.consent===-1&&this.Bt.cookieless_mode===Qa}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Bt.opt_out_capturing_by_default}optInOut(t){this.nr.M(this.sr,t?1:0,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get ir(){var t=this.nr.O(this.sr);return Z_(t)?1:Et(lne,t)?0:-1}get nr(){var t=this.Bt.opt_out_capturing_persistence_type,n=t==="localStorage"?yn:Ei;if(!this.ar||this.ar!==n){this.ar=n;var r=t==="localStorage"?Ei:yn;r.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(Z_(r.O(this.sr))),r.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[go?.doNotTrack,go?.msDoNotTrack,We.doNotTrack].some((t=>Z_(t)))}}var xp=mn("[Dead Clicks]"),ere=()=>!0,tre=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(GS)),r=e.instance.config.capture_dead_clicks;return Ri(r)?r:!!An(r)||n};class UA{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[GS]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(t){var n,r;(n=We.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(o=>{o?xp.error("failed to load script",o):t()}))}hr(){var t;if(Le){if(!this.lr&&(t=We.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=An(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.lr=We.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.lr.start(Le),xp.info("starting...")}}else xp.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,xp.info("stopping..."))}}var nb=mn("[SegmentIntegration]"),U5="posthog-js";function F5(e,t){var{organization:n,projectId:r,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:l=!0}=t===void 0?{}:t;return c=>{var d,f,p,h,g;if(s!=="*"&&!s.includes(c.level)||!e.__loaded)return c;c.tags||(c.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());c.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var _,b=((d=c.exception)==null?void 0:d.values)||[],x=b.map((E=>Ne({},E,{stacktrace:E.stacktrace?Ne({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map((T=>Ne({},T,{platform:"web:javascript"})))}):void 0}))),S={$exception_message:((f=b[0])==null?void 0:f.value)||c.message,$exception_type:(p=b[0])==null?void 0:p.type,$exception_level:c.level,$exception_list:x,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((h=b[0])==null?void 0:h.value)||c.message,$sentry_exception_type:(g=b[0])==null?void 0:g.type,$sentry_tags:c.tags};return n&&r&&(S.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+c.event_id),l&&((_=e.exceptions)==null||_.sendExceptionEvent(S)),c}}class nre{constructor(t,n,r,o,s,l){this.name=U5,this.setupOnce=function(c){c(F5(t,{organization:n,projectId:r,prefix:o,severityAllowList:s,sendExceptionsToPostHog:l==null||l}))}}}class FA{constructor(t){this.cr=(n,r,o)=>{o&&(o.noSessionId||o.activityTimeout||o.sessionPastMaximumLength)&&($e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:o}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.vr()}vr(){var t;this.pr=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.cr)}destroy(){var t;(t=this.pr)==null||t.call(this),this.pr=void 0}doPageView(t,n){var r,o=this.gr(t,n);return this.dr={pathname:(r=me?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),o}doPageLeave(t){var n;return this.gr(t,(n=this.dr)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.dr)==null?void 0:t.pageViewId}}gr(t,n){var r=this.dr;if(!r)return{$pageview_id:n};var o={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:l,lastScrollY:c,maxScrollY:d,maxContentHeight:f,lastContentY:p,maxContentY:h}=s;if(!(ze(l)||ze(c)||ze(d)||ze(f)||ze(p)||ze(h))){l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p),h=Math.ceil(h);var g=l>1?Oi(c/l,0,1,$e):1,v=l>1?Oi(d/l,0,1,$e):1,_=f>1?Oi(p/f,0,1,$e):1,b=f>1?Oi(h/f,0,1,$e):1;o=Rn(o,{$prev_pageview_last_scroll:c,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:d,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(o.$prev_pageview_pathname=r.pathname),r.timestamp&&(o.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),o}}var rre={[A5]:{exposure:"hidden"},[Td]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Cd]:{exposure:"hidden"},[T1]:{exposure:"event"},[C1]:{exposure:"hidden"},[A1]:{exposure:"event"},[I1]:{exposure:"hidden"},[P1]:{exposure:"event"},[M1]:{exposure:"event"},[GS]:{exposure:"event"},[N1]:{exposure:"hidden"},[k1]:{exposure:"event"},[Ad]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ug]:{exposure:"hidden"},[KS]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[Pc]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!An(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t["$feature/"+n[r]]=e[n[r]];return t}},[Om]:{exposure:"event"},[Id]:{exposure:"hidden"},[D1]:{exposure:"hidden"},[L1]:{exposure:"event"},[$1]:{exposure:"event"},[os]:{exposure:"event"},[Ec]:{exposure:"hidden"},[Pd]:{exposure:"hidden"},[Wa]:{exposure:"hidden"},[j1]:{exposure:"hidden"},[z1]:{exposure:"event"},[Tm]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[jd]:{exposure:"hidden"},[U1]:{exposure:"hidden"},[F1]:{exposure:"hidden"},[dg]:{exposure:"hidden"},[ei]:{exposure:"hidden"},[B1]:{exposure:"hidden"},[V1]:{exposure:"hidden"},[q1]:{exposure:"hidden"},[H1]:{exposure:"hidden"},[fg]:{exposure:"hidden"},[hg]:{exposure:"hidden"},[I5]:{exposure:"event"},[P5]:{exposure:"event"},[M5]:{exposure:"event"},[N5]:{exposure:"event"},[D5]:{exposure:"event"},[L5]:{exposure:"event"},[$5]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},ore=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],vg=e=>{var t=Le?.createElement("a");return ze(t)?null:(t.href=e,t)},yg=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),o=0;r.length>o;o++){var s=r[o].split("=");if(s[0]===t){n=s;break}}if(!Mt(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch{$e.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")},af=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),o=r[1],s=(r[0]||"").split("?"),l=s[1],c=s[0],d=(l||"").split("&"),f=[],p=0;d.length>p;p++){var h=d[p].split("=");Mt(h)&&(t.includes(h[0])?f.push(h[0]+"="+n):f.push(d[p]))}var g=c;return l!=null&&(g+="?"+f.join("&")),o!=null&&(g+="#"+o),g},_g=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Rp="https?://(.*)",Qc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ire=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qc],lf="<masked>",sre=["li_fat_id"];function B5(e,t,n){if(!Le)return{};var r,o=t?[...Qc,...n||[]]:[],s=V5(af(Le.URL,o,lf),e),l=(r={},dn(sre,(function(c){var d=Ei.O(c);r[c]=d||null})),r);return Rn(l,s)}function V5(e,t){var n=ire.concat(t||[]),r={};return dn(n,(function(o){var s=yg(e,o);r[o]=s||null})),r}function q5(e){var t=(function(s){return s?s.search(Rp+"google.([^/?]*)")===0?"google":s.search(Rp+"bing.com")===0?"bing":s.search(Rp+"yahoo.com")===0?"yahoo":s.search(Rp+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!ys(t)){r.$search_engine=t;var o=Le?yg(Le.referrer,n):"";o.length&&(r.ph_keyword=o)}return r}function BA(){return navigator.language||navigator.userLanguage}var bg="$direct";function H5(){return Le?.referrer||bg}function G5(e,t){var n=e?[...Qc,...t||[]]:[],r=pr?.href.substring(0,1e3);return{r:H5().substring(0,1e3),u:r?af(r,n,lf):void 0}}function K5(e){var t,{r:n,u:r}=e,o={$referrer:n,$referring_domain:n==null?void 0:n==bg?bg:(t=vg(n))==null?void 0:t.host};if(r){o.$current_url=r;var s=vg(r);o.$host=s?.host,o.$pathname=s?.pathname;var l=V5(r);Rn(o,l)}if(n){var c=q5(n);Rn(o,c)}return o}function Z5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function are(){try{return new Date().getTimezoneOffset()}catch{return}}var lre=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class rb{constructor(t,n){this.Bt=t,this.props={},this.mr=!1,this.yr=(r=>{var o="";return r.token&&(o=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+o+"_posthog"})(t),this.nr=this.br(t),this.load(),t.debug&&$e.info("Persistence loaded",t.persistence,Ne({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this._r}br(t){lre.indexOf(t.persistence.toLowerCase())===-1&&($e.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(o){o===void 0&&(o=[]);var s=[...Qne,...o];return Ne({},yn,{Z(l){try{var c={};try{c=Ei.Z(l)||{}}catch{}var d=Rn(c,JSON.parse(yn.O(l)||"{}"));return yn.M(l,d),d}catch{}return null},M(l,c,d,f,p,h){try{yn.M(l,c,void 0,void 0,h);var g={};s.forEach((v=>{c[v]&&(g[v]=c[v])})),Object.keys(g).length&&Ei.M(l,g,d,f,p,h)}catch(v){yn.B(v)}},F(l,c){try{me?.localStorage.removeItem(l),Ei.F(l,c)}catch(d){yn.B(d)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&yn.R()?yn:r==="localstorage+cookie"&&n.R()?n:r==="sessionstorage"&&mr.R()?mr:r==="memory"?Xne:r==="cookie"?Ei:n.R()?n:Ei}wr(t){var n=t??this.Bt.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[dg];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return dn(this.props,((n,r)=>{var o=(s=>{var l=rre[s];if(l)return l;for(var[c,d]of ore)if(s.indexOf(c)===0)return d})(r);if(o?.exposure==="derived"){if(o.shouldSkipFromEventProperties!=null&&o.shouldSkipFromEventProperties(n,r===Pc?()=>this.wr():()=>!1))return;o.transformToEventProperties&&Rn(t,o.transformToEventProperties(n))}else o&&o.exposure!=="event"||(t[r]=n)})),t}load(){if(!this._r){var t=this.nr.Z(this.yr);t&&(this.props=Rn({},t))}}save(){this._r||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(An(t)){ze(n)&&(n="None"),this.Ir=ze(r)?this.kr:r;var o=!1;if(dn(t,((s,l)=>{this.props.hasOwnProperty(l)&&this.props[l]!==n||(this.Tr(l,s),o=!0)})),o)return this.save(),!0}return!1}register(t,n){if(An(t)){this.Ir=ze(n)?this.kr:n;var r=!1;if(dn(t,((o,s)=>{t.hasOwnProperty(s)&&this.props[s]!==o&&(this.Tr(s,o),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Ar(t),this.save())}update_campaign_params(){if(!this.mr){var t=B5(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);Ic(YS(t))||this.register(t),this.mr=!0}}update_search_keyword(){var t;this.register((t=Le?.referrer)?q5(t):{})}update_referrer_info(){var t;this.register_once({$referrer:H5(),$referring_domain:Le!=null&&Le.referrer&&((t=vg(Le.referrer))==null?void 0:t.host)||bg},void 0)}set_initial_person_info(){this.props[q1]||this.props[H1]||this.register_once({[fg]:G5(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};dn([H1,q1],(l=>{var c=this.props[l];c&&dn(c,(function(d,f){t["$initial_"+S1(f)]=d}))}));var n,r,o=this.props[fg];if(o){var s=(n=K5(o),r={},dn(n,(function(l,c){r["$initial_"+S1(c)]=l})),r);Rn(t,s)}return t}safe_merge(t){return dn(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.kr=this.Ir=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((l,c)=>{if(l.length!==c.length)return!1;var d=[...l].sort(),f=[...c].sort();return d.every(((p,h)=>p===f[h]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var o=this.br(t),s=this.props;this.clear(),this.nr=o,this.props=s,this.save()}}set_disabled(t){this._r=t,this._r?this.remove():this.save()}set_cross_subdomain(t){t!==this.Cr&&(this.Cr=t,this.remove(),this.save())}set_secure(t){t!==this.Sr&&(this.Sr=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Cd]||{};r[t]=n,this.Tr(Cd,r),this.save()}remove_event_timer(t){var n=this.props[Cd]||{},r=n[t];return ze(r)||(delete n[t],this.Tr(Cd,n),this.save()),r}get_property(t){return this.props[t]}set_property(t,n){this.Tr(t,n),this.save()}Tr(t,n){this.props[t]=n}Ar(t){delete this.props[t]}}var dd={Activation:"events",Cancellation:"cancelEvents"},ob={Popover:"popover",API:"api",Widget:"widget"},Md={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},ib={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},K1={Popover:"popover",Inline:"inline"},cre={SHOWN:"product tour shown"},VA={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},qA=mn("[RateLimiter]");class ure{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((o=>{qA.info((o||"events")+" is quota limited."),this.serverLimits[o]=new Date().getTime()+6e4}))}catch(o){return void qA.warn('could not rate limit - continuing. Error: "'+o?.message+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,o;t===void 0&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:l}=this,c=new Date().getTime(),d=(n=(r=this.instance.persistence)==null?void 0:r.get_property(V1))!==null&&n!==void 0?n:{tokens:s,last:c};d.tokens+=(c-d.last)/1e3*l,d.last=c,d.tokens>s&&(d.tokens=s);var f=1>d.tokens;return f||t||(d.tokens=Math.max(0,d.tokens-1)),!f||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+l+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(o=this.instance.persistence)==null||o.set_property(V1,d),{isRateLimited:f,remainingTokens:d.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var fd=mn("[RemoteConfig]");class Y5{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=We._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}Er(t){var n,r;(n=We.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Rr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){t(n.json)}})}load(){try{if(this.remoteConfig)return fd.info("Using preloaded remote config",this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void fd.warn("Remote config is disabled. Falling back to local config.");this.Er((t=>{if(!t)return fd.info("No config found after loading remote JS config. Falling back to JSON."),void this.Rr((n=>{this.Nr(n),this.Mr()}));this.Nr(t),this.Mr()}))}catch(t){fd.error("Error loading remote config",t)}}stop(){this.Or&&(clearInterval(this.Or),this.Or=void 0)}refresh(){this._instance.Fr()||Le?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}Mr(){var t;if(!this.Or){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.Or=setInterval((()=>{this.refresh()}),n))}}Nr(t){var n;t||fd.error("Failed to fetch remote config from PostHog."),this._instance.Nr(t??{}),t?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var _i={GZipJS:"gzip-js",Base64:"base64"},Uo=Uint8Array,Jr=Uint16Array,Xc=Uint32Array,WS=new Uo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),QS=new Uo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),HA=new Uo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),W5=function(e,t){for(var n=new Jr(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var o=new Xc(n[30]);for(r=1;30>r;++r)for(var s=n[r];n[r+1]>s;++s)o[s]=s-n[r]<<5|r;return[n,o]},Q5=W5(WS,2),Z1=Q5[1];Q5[0][28]=258,Z1[258]=28;for(var GA=W5(QS,0)[1],X5=new Jr(32768),fn=0;32768>fn;++fn){var gc=(43690&fn)>>>1|(21845&fn)<<1;X5[fn]=((65280&(gc=(61680&(gc=(52428&gc)>>>2|(13107&gc)<<2))>>>4|(3855&gc)<<4))>>>8|(255&gc)<<8)>>>1}var zd=function(e,t,n){for(var r=e.length,o=0,s=new Jr(t);r>o;++o)++s[e[o]-1];var l,c=new Jr(t);for(o=0;t>o;++o)c[o]=c[o-1]+s[o-1]<<1;for(l=new Jr(r),o=0;r>o;++o)l[o]=X5[c[e[o]-1]++]>>>15-e[o];return l},dl=new Uo(288);for(fn=0;144>fn;++fn)dl[fn]=8;for(fn=144;256>fn;++fn)dl[fn]=9;for(fn=256;280>fn;++fn)dl[fn]=7;for(fn=280;288>fn;++fn)dl[fn]=8;var wg=new Uo(32);for(fn=0;32>fn;++fn)wg[fn]=5;var dre=zd(dl,9),fre=zd(wg,5),J5=function(e){return(e/8>>0)+(7&e&&1)},e6=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Jr?Jr:e instanceof Xc?Xc:Uo)(n-t);return r.set(e.subarray(t,n)),r},Ji=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},hd=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},sb=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,s=n.slice();if(!o)return[new Uo(0),0];if(o==1){var l=new Uo(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort((function(O,A){return O.f-A.f})),n.push({s:-1,f:25001});var c=n[0],d=n[1],f=0,p=1,h=2;for(n[0]={s:-1,f:c.f+d.f,l:c,r:d};p!=o-1;)c=n[n[h].f>n[f].f?f++:h++],d=n[f!=p&&n[h].f>n[f].f?f++:h++],n[p++]={s:-1,f:c.f+d.f,l:c,r:d};var g=s[0].s;for(r=1;o>r;++r)s[r].s>g&&(g=s[r].s);var v=new Jr(g+1),_=Y1(n[p-1],v,0);if(_>t){r=0;var b=0,x=_-t,S=1<<x;for(s.sort((function(O,A){return v[A.s]-v[O.s]||O.f-A.f}));o>r;++r){var E=s[r].s;if(t>=v[E])break;b+=S-(1<<_-v[E]),v[E]=t}for(b>>>=x;b>0;){var T=s[r].s;t>v[T]?b-=1<<t-v[T]++-1:++r}for(;r>=0&&b;--r){var R=s[r].s;v[R]==t&&(--v[R],++b)}_=t}return[new Uo(v),_]},Y1=function(e,t,n){return e.s==-1?Math.max(Y1(e.l,t,n+1),Y1(e.r,t,n+1)):t[e.s]=n},KA=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Jr(++t),r=0,o=e[0],s=1,l=function(d){n[r++]=d},c=1;t>=c;++c)if(e[c]==o&&c!=t)++s;else{if(!o&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(o),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(o);s=1,o=e[c]}return[n.subarray(0,r),t]},pd=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},W1=function(e,t,n){var r=n.length,o=J5(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var s=0;r>s;++s)e[o+s+4]=n[s];return 8*(o+4+r)},ZA=function(e,t,n,r,o,s,l,c,d,f,p){Ji(t,p++,n),++o[256];for(var h=sb(o,15),g=h[0],v=h[1],_=sb(s,15),b=_[0],x=_[1],S=KA(g),E=S[0],T=S[1],R=KA(b),O=R[0],A=R[1],I=new Jr(19),M=0;E.length>M;++M)I[31&E[M]]++;for(M=0;O.length>M;++M)I[31&O[M]]++;for(var L=sb(I,7),q=L[0],j=L[1],B=19;B>4&&!q[HA[B-1]];--B);var F,Z,ie,H,W=f+5<<3,te=pd(o,dl)+pd(s,wg)+l,le=pd(o,g)+pd(s,b)+l+14+3*B+pd(I,q)+(2*I[16]+3*I[17]+7*I[18]);if(te>=W&&le>=W)return W1(t,p,e.subarray(d,d+f));if(Ji(t,p,1+(te>le)),p+=2,te>le){F=zd(g,v),Z=g,ie=zd(b,x),H=b;var Q=zd(q,j);for(Ji(t,p,T-257),Ji(t,p+5,A-1),Ji(t,p+10,B-4),p+=14,M=0;B>M;++M)Ji(t,p+3*M,q[HA[M]]);p+=3*B;for(var k=[E,O],G=0;2>G;++G){var V=k[G];for(M=0;V.length>M;++M)Ji(t,p,Q[D=31&V[M]]),p+=q[D],D>15&&(Ji(t,p,V[M]>>>5&127),p+=V[M]>>>12)}}else F=dre,Z=dl,ie=fre,H=wg;for(M=0;c>M;++M)if(r[M]>255){var D;hd(t,p,F[257+(D=r[M]>>>18&31)]),p+=Z[D+257],D>7&&(Ji(t,p,r[M]>>>23&31),p+=WS[D]);var U=31&r[M];hd(t,p,ie[U]),p+=H[U],U>3&&(hd(t,p,r[M]>>>5&8191),p+=QS[U])}else hd(t,p,F[r[M]]),p+=Z[r[M]];return hd(t,p,F[256]),p+Z[256]},hre=new Xc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),pre=(function(){for(var e=new Xc(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),ab=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function mre(e,t){t===void 0&&(t={});var n=(function(){var h=4294967295;return{p(g){for(var v=h,_=0;g.length>_;++_)v=pre[255&v^g[_]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=e.length;n.p(e);var o,s,l,c,d,f=(c=10+((o=t).filename&&o.filename.length+1||0),d=8,(function(h,g,v,_,b,x){var S=h.length,E=new Uo(_+S+5*(1+Math.floor(S/7e3))+b),T=E.subarray(_,E.length-b),R=0;if(!g||8>S)for(var O=0;S>=O;O+=65535){var A=O+65535;S>A?R=W1(T,R,h.subarray(O,A)):(T[O]=!0,R=W1(T,R,h.subarray(O,S)))}else{for(var I=hre[g-1],M=I>>>13,L=8191&I,q=(1<<v)-1,j=new Jr(32768),B=new Jr(q+1),F=Math.ceil(v/3),Z=2*F,ie=function(Ue){return(h[Ue]^h[Ue+1]<<F^h[Ue+2]<<Z)&q},H=new Xc(25e3),W=new Jr(288),te=new Jr(32),le=0,Q=0,k=(O=0,0),G=0,V=0;S>O;++O){var D=ie(O),U=32767&O,X=B[D];if(j[U]=X,B[D]=U,O>=G){var fe=S-O;if((le>7e3||k>24576)&&fe>423){R=ZA(h,T,0,H,W,te,Q,k,V,O-V,R),k=le=Q=0,V=O;for(var pe=0;286>pe;++pe)W[pe]=0;for(pe=0;30>pe;++pe)te[pe]=0}var xe=2,je=0,Y=L,re=U-X&32767;if(fe>2&&D==ie(O-re))for(var ve=Math.min(M,fe)-1,se=Math.min(32767,O),Se=Math.min(258,fe);se>=re&&--Y&&U!=X;){if(h[O+xe]==h[O+xe-re]){for(var Te=0;Se>Te&&h[O+Te]==h[O+Te-re];++Te);if(Te>xe){if(xe=Te,je=re,Te>ve)break;var tt=Math.min(re,Te-2),rt=0;for(pe=0;tt>pe;++pe){var Be=O-re+pe+32768&32767,Qe=Be-j[Be]+32768&32767;Qe>rt&&(rt=Qe,X=Be)}}}re+=(U=X)-(X=j[U])+32768&32767}if(je){H[k++]=268435456|Z1[xe]<<18|GA[je];var Me=31&Z1[xe],Pe=31&GA[je];Q+=WS[Me]+QS[Pe],++W[257+Me],++te[Pe],G=O+xe,++le}else H[k++]=h[O],++W[h[O]]}}R=ZA(h,T,!0,H,W,te,Q,k,V,O-V,R)}return e6(E,0,_+J5(R)+b)})(s=e,(l=t).level==null?6:l.level,l.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+l.mem,c,d)),p=f.length;return(function(h,g){var v=g.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>g.level?4:g.level==9?2:0,h[9]=3,g.mtime!=0&&ab(h,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){h[3]=8;for(var _=0;v.length>=_;++_)h[_+10]=v.charCodeAt(_)}})(f,t),ab(f,p-8,n.d()),ab(f,p-4,r),f}var gre=!!b1||!!_1,t6="text/plain",YA=!1,sv=function(e,t,n){var r;n===void 0&&(n=!0);var[o,s]=e.split("?"),l=Ne({},t),c=(r=s?.split("&").map((f=>{var p,[h,g]=f.split("="),v=n&&(p=l[h])!==null&&p!==void 0?p:g;return delete l[h],h+"="+v})))!==null&&r!==void 0?r:[],d=(function(f,p){var h,g;p===void 0&&(p="&");var v=[];return dn(f,(function(_,b){ze(_)||ze(b)||b==="undefined"||(h=encodeURIComponent((x=>x instanceof File)(_)?_.name:_.toString()),g=encodeURIComponent(b),v[v.length]=g+"="+h)})),v.join(p)})(l);return d&&c.push(d),o+"?"+c.join("&")},Mc=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),lb=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===_i.GZipJS){var r=mre((function(c,d){var f=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var p=new Uo(c.length+(c.length>>>1)),h=0,g=function(x){p[h++]=x},v=0;f>v;++v){if(h+5>p.length){var _=new Uo(h+8+(f-v<<1));_.set(p),p=_}var b=c.charCodeAt(v);128>b?g(b):2048>b?(g(192|b>>>6),g(128|63&b)):b>55295&&57344>b?(g(240|(b=65536+(1047552&b)|1023&c.charCodeAt(++v))>>>18),g(128|b>>>12&63),g(128|b>>>6&63),g(128|63&b)):(g(224|b>>>12),g(128|b>>>6&63),g(128|63&b))}return e6(p,0,h)})(Mc(t)),{mtime:0});return{contentType:t6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===_i.Base64){var o=(function(c){return c&&btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,((d,f)=>String.fromCharCode(parseInt(f,16)))))})(Mc(t)),s=(c=>"data="+encodeURIComponent(typeof c=="string"?c:Mc(c)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var l=Mc(t);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},vre=(function(){var e=Lo((function*(t){var n=Mc(t.data),r=yield(function(s,l,c){return w1.apply(this,arguments)})(n,$r.DEBUG,{rethrow:!0});if(!r)return t;var o=yield r.arrayBuffer();return Ne({},t,{tr:{contentType:t6,body:o,estimatedSize:o.byteLength}})}));return function(t){return e.apply(this,arguments)}})(),WA=(e,t)=>sv(e,{_:new Date().getTime().toString(),ver:$r.JS_SDK_VERSION,compression:t}),Am=[];_1&&Am.push({transport:"fetch",method(e){var t,n,{contentType:r,body:o,estimatedSize:s}=(t=lb(e))!==null&&t!==void 0?t:{},l=new Headers;dn(e.headers,(function(p,h){l.append(h,p)})),r&&l.append("Content-Type",r);var c=e.url,d=null;if(TA){var f=new TA;d={signal:f.signal,timeout:setTimeout((()=>f.abort()),e.timeout)}}_1(c,Ne({method:e?.method||"GET",headers:l,keepalive:e.method==="POST"&&52428.8>(s||0),body:o,signal:(n=d)==null?void 0:n.signal},e.fetchOptions)).then((p=>p.text().then((h=>{var g={statusCode:p.status,text:h};if(p.status===200)try{g.json=JSON.parse(h)}catch(v){$e.error(v)}e.callback==null||e.callback(g)})))).catch((p=>{$e.error(p),e.callback==null||e.callback({statusCode:0,error:p})})).finally((()=>d?clearTimeout(d.timeout):null))}}),b1&&Am.push({transport:"XHR",method(e){var t,n=new b1;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:o}=(t=lb(e))!==null&&t!==void 0?t:{};dn(e.headers,(function(s,l){n.setRequestHeader(l,s)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(s)}},n.send(o)}}),go!=null&&go.sendBeacon&&Am.push({transport:"sendBeacon",method(e){var t=sv(e.url,{beacon:"1"});try{var n,{contentType:r,body:o}=(n=lb(e))!==null&&n!==void 0?n:{};if(!o)return;var s=o instanceof Blob?o:new Blob([o],{type:r});go.sendBeacon(t,s)}catch{}}});var Q1=3e3;class yre{constructor(t,n){this.Pr=!0,this.Lr=[],this.Dr=Oi(n?.flush_interval_ms||Q1,250,5e3,$e.createLogger("flush interval"),Q1),this.Br=t}enqueue(t){this.Lr.push(t),this.jr||this.$r()}unload(){this.qr();var t=this.Lr.length>0?this.Zr():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Br(Ne({},r,{transport:"sendBeacon"}))}))}enable(){this.Pr=!1,this.$r()}$r(){var t=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var n=this.Zr(),r=function(){var s=n[o],l=new Date().getTime();s.data&&Mt(s.data)&&dn(s.data,(c=>{c.offset=Math.abs(c.timestamp-l),delete c.timestamp})),t.Br(s)};for(var o in n)r()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var t={};return dn(this.Lr,(n=>{var r,o=n,s=(o?o.batchKey:null)||o.url;ze(t[s])&&(t[s]=Ne({},o,{data:[]})),(r=t[s].data)==null||r.push(o.data)})),this.Lr=[],t}}var _re=["retriesPerformedSoFar"];class bre{constructor(t){this.Vr=!1,this.Hr=3e3,this.Lr=[],this._instance=t,this.Lr=[],this.zr=!0,!ze(me)&&"onLine"in me.navigator&&(this.zr=me.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},Vn(me,"online",this.Ur),Vn(me,"offline",this.Gr))}get length(){return this.Lr.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=o5(t,_re);Sc(n)&&(r.url=sv(r.url,{retry_count:n})),this._instance._send_request(Ne({},r,{callback:o=>{o.statusCode===200||o.statusCode>=400&&500>o.statusCode||(n??0)>=10?r.callback==null||r.callback(o):this.Wr(Ne({retriesPerformedSoFar:n},r))}}))}Wr(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(l){var c=3e3*Math.pow(2,l),d=c/2,f=Math.min(18e5,c),p=Math.random()-.5;return Math.ceil(f+p*(f-d))})(n),o=Date.now()+r;this.Lr.push({retryAt:o,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),$e.warn(s),this.Vr||(this.Vr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),this.Lr.length===0)return this.Vr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Hr)}Yr(){var t=Date.now(),n=[],r=this.Lr.filter((s=>t>s.retryAt||(n.push(s),!1)));if(this.Lr=n,r.length>0)for(var{requestOptions:o}of r)this.retriableRequest(o)}unload(){for(var{requestOptions:t}of(this.Jr&&(clearTimeout(this.Jr),this.Jr=void 0),this.Vr=!1,ze(me)||(this.Ur&&(me.removeEventListener("online",this.Ur),this.Ur=void 0),this.Gr&&(me.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Lr))try{this._instance._send_request(Ne({},t,{transport:"sendBeacon"}))}catch(n){$e.error(n)}this.Lr=[]}}class wre{constructor(t){this.Kr=()=>{var n,r,o,s;this.Qr||(this.Qr={});var l=this.scrollElement(),c=this.scrollY(),d=l?Math.max(0,l.scrollHeight-l.clientHeight):0,f=c+(l?.clientHeight||0),p=l?.scrollHeight||0;this.Qr.lastScrollY=Math.ceil(c),this.Qr.maxScrollY=Math.max(c,(n=this.Qr.maxScrollY)!==null&&n!==void 0?n:0),this.Qr.maxScrollHeight=Math.max(d,(r=this.Qr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Qr.lastContentY=f,this.Qr.maxContentY=Math.max(f,(o=this.Qr.maxContentY)!==null&&o!==void 0?o:0),this.Qr.maxContentHeight=Math.max(p,(s=this.Qr.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var t=this.Qr;return setTimeout(this.Kr,0),t}startMeasuringScrollPosition(){Vn(me,"scroll",this.Kr,{capture:!0}),Vn(me,"scrollend",this.Kr,{capture:!0}),Vn(me,"resize",this.Kr)}scrollElement(){if(!this.ei)return me?.document.documentElement;var t=Mt(this.ei)?this.ei:[this.ei];for(var n of t){var r=me?.document.querySelector(n);if(r)return r}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return me&&(me.scrollY||me.pageYOffset||me.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return me&&(me.scrollX||me.pageXOffset||me.document.documentElement.scrollLeft)||0}}var Sre=e=>G5(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class QA{constructor(t,n,r,o){this.ti=s=>{var l=this.ri();if(!l||l.sessionId!==s){var c={sessionId:s,props:this.ii(this._instance)};this.ni.register({[B1]:c})}},this._instance=t,this.si=n,this.ni=r,this.ii=o||Sre,this.si.onSessionId(this.ti)}ri(){return this.ni.props[B1]}getSetOnceProps(){var t,n=(t=this.ri())==null?void 0:t.props;return n?"r"in n?K5(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return dn(YS(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+S1(r)]=n})),t}}class XS{constructor(){this.oi={}}on(t,n){return this.oi[t]||(this.oi[t]=[]),this.oi[t].push(n),()=>{this.oi[t]=this.oi[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.oi[t]||[])r(n);for(var o of this.oi["*"]||[])o(t,n)}}var cb=mn("[SessionId]");class XA{on(t,n){return this.ai.on(t,n)}constructor(t,n,r){var o;if(this.li=[],this.ui=void 0,this.ai=new XS,this.hi=(f,p)=>!(!Sc(f)||!Sc(p))&&Math.abs(f-p)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===as)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Bt=t.config,this.ni=t.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=n||na,this.fi=r||na;var s=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*Oi(this.Bt.session_idle_timeout_seconds||1800,60,36e3,cb.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+s+"_window_id",this.mi="ph_"+s+"_primary_window_exists",this.yi()){var l=mr.Z(this.gi),c=mr.Z(this.mi);l&&!c?this.ci=l:mr.F(this.gi),mr.M(this.mi,!0)}if((o=this.Bt.bootstrap)!=null&&o.sessionID)try{var d=(f=>{var p=this.Bt.bootstrap.sessionID.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})();this.bi(this.Bt.bootstrap.sessionID,new Date().getTime(),d)}catch(f){cb.error("Invalid sessionID in bootstrap",f)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ze(this.li)&&(this.li=[]),this.li.push(t),this.di&&t(this.di,this.ci),()=>{this.li=this.li.filter((n=>n!==t))}}yi(){return this.Bt.persistence!=="memory"&&!this.ni._r&&mr.R()}Ii(t){t!==this.ci&&(this.ci=t,this.yi()&&mr.M(this.gi,t))}Ci(){return this.ci?this.ci:this.yi()?mr.Z(this.gi):null}bi(t,n,r){t===this.di&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.di=t,this.ni.register({[ug]:[n,t,r]}))}Si(){var t=this.ni.props[ug];return Mt(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&me&&(me.removeEventListener(mg,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&mr.F(this.mi)},Vn(me,mg,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.Bt.cookieless_mode===as)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[o,s,l]=this.Si(),c=this.Ci(),d=Sc(l)&&Math.abs(r-l)>864e5,f=!1,p=!s,h=!p&&!t&&this.hi(r,o);p||h||d?(s=this.vi(),c=this.fi(),cb.info("new session ID generated",{sessionId:s,windowId:c,changeReason:{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}}),l=r,f=!0):c||(c=this.fi(),f=!0);var g=Sc(o)&&t&&!d?o:r,v=Sc(l)?l:new Date().getTime();return this.Ii(c),this.bi(s,g,v),t||this.pi(),f&&this.li.forEach((_=>_(s,c,f?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}:void 0))),{sessionId:s,windowId:c,sessionStartTimestamp:v,changeReason:f?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}:void 0,lastActivityTimestamp:o}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[t]=this.Si();if(this.hi(new Date().getTime(),t)){var n=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var n6=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&IA(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((o=>IA(o?.brand,t))))return!0}catch{}return!!e.webdriver},Sg=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function JA(e,t,n){return Mc({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var r6={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>Sg(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!Sg(n,r))))),icontains:(e,t)=>t.map(Op).some((n=>e.map(Op).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(Op).every((n=>e.map(Op).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((o=>r>parseFloat(o)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((o=>r<parseFloat(o)))}))},Op=e=>e.toLowerCase();function o6(e,t){return!e||Object.entries(e).every((n=>{var[r,o]=n,s=t?.[r];if(ze(s)||ys(s))return!1;var l=[String(s)],c=r6[o.operator];return!!c&&c(o.values,l)}))}var X1="custom",eI="i.posthog.com",Ere=/^\/static\//;class xre{constructor(t){this.ki={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+eI,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":X1),this.ki[this.apiHost]}Ti(t){var n=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof n=="string"&&Ere.test(t))return n.trim().replace(/\/$/,"")||void 0}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(t==="assets"){var r=this.Ti(n);if(r)return""+r+n}if(this.region===X1)return this.apiHost+n;var o=eI+n;switch(t){case"assets":return"https://"+this.region+"-assets."+o;case"api":return"https://"+this.region+"."+o}}}var Xt=mn("[Surveys]"),J1="seenSurvey_",Rre=[ob.Popover,ob.Widget,ob.API],Ore={ignoreConditions:!1,ignoreDelay:!1,displayType:K1.Popover},Tre=mn("[PostHog ExternalIntegrations]"),Cre={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Are{constructor(t){this._instance=t}ur(t,n){var r;(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(o=>{if(o)return Tre.error("failed to load script",o);n()}))}startIfEnabledOrStop(){var t=this,n=function(l){var c,d,f;!o||(c=We.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[l]||t.ur(Cre[l],(()=>{var p;(p=We.__PosthogExtensions__)==null||(p=p.integrations)==null||(p=p[l])==null||p.start(t._instance)})),!o&&(d=We.__PosthogExtensions__)!=null&&(d=d.integrations)!=null&&d[l]&&((f=We.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[l])==null||f.stop())};for(var[r,o]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var vc,Ud={},ub=0,ew=()=>{},tI='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',md="Surveys module not available",nI="sanitize_properties is deprecated. Use before_send instead",i6="Invalid value for property_denylist config: ",Rc="posthog",s6=!gre&&Yr?.indexOf("MSIE")===-1&&Yr?.indexOf("Mozilla")===-1,rI=e=>{var t;return Ne({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Gne(Le?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ew,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:pr&&_n(pr?.search)&&pr.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(me==null||(t=me.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){$e.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:G1,before_send:void 0,request_queue_config:{flush_interval_ms:Q1},error_tracking:{},_onCapture:ew,__preview_eager_load_replay:!1},(n=>({rageclick:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Ire=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],oI=e=>{var t={};for(var[n,r]of Ire)ze(e[n])||(t[r]=e[n]);var o=Rn({},t,e);return Mt(e.property_blacklist)&&(ze(e.property_denylist)?o.property_denylist=e.property_blacklist:Mt(e.property_denylist)?o.property_denylist=[...e.property_blacklist,...e.property_denylist]:$e.error(i6+e.property_denylist)),o};class Pre{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(t){$e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class $o{Ei(t,n){if(t){var r=this.Ri.indexOf(t);r!==-1&&this.Ri.splice(r,1)}return this.Ri.push(n),n.initialize==null||n.initialize(),n}Ni(){return this.config.cookieless_mode===as||this.config.cookieless_mode===Qa&&this.consent.isRejected()}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new Pre,this.Mi=!1,this.version=$r.LIB_VERSION,this.Fi=new XS,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rI(),this.SentryIntegration=nre,this.sentryIntegration=r=>(function(o,s){var l=F5(o,s);return{name:U5,processEvent:c=>l(c)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new wre(this),this.pageViewManager=new FA(this),this.rateLimiter=new ure(this),this.requestRouter=new xre(this),this.consent=new Jne(this),this.externalIntegrations=new Are(this);var n=(t=$o.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,o,s)=>{var l=_n(r)?{[r]:o}:r;this.setPersonProperties(l),s?.({})},set_once:(r,o,s)=>{var l=_n(r)?{[r]:o}:r;this.setPersonProperties(void 0,l),s?.({})}},this.on("eventCaptured",(r=>$e.info('send "'+r?.event+'"',r)))}init(t,n,r){if(r&&r!==Rc){var o,s=(o=Ud[r])!==null&&o!==void 0?o:new $o;return s._init(t,n,r),Ud[r]=s,Ud[Rc][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var o,s;if(n===void 0&&(n={}),ze(t)||Rm(t))return $e.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Bi(n.debug),this.ji=n,this.$i=[],n.person_profiles?this.Li=n.person_profiles:n.process_person&&(this.Li=n.process_person),this.set_config(Rn({},rI(n.defaults),oI(n),{name:r,token:t})),this.config.on_xhr_error&&$e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:_i.GZipJS;var l=this.qi();this.persistence=new rb(this.config,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new rb(Ne({},this.config,{persistence:"sessionStorage"}),l);var c=Ne({},this.persistence.props),d=Ne({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zi=new yre((x=>this.Vi(x)),this.config.request_queue_config),this.Hi=new bre(this),this.__request_queue=[];var f=this.Ni();if(f||(this.sessionManager=new XA(this),this.sessionPropsManager=new QA(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($e.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.zi(f)}),0)):($e.info("Initializing extensions synchronously"),this.zi(f)),$r.DEBUG=$r.DEBUG||this.config.debug,$r.DEBUG&&$e.info("Starting in debug mode",{this:this,config:n,thisC:Ne({},this.config),p:c,s:d}),!this.config.identity_distinct_id||(o=n.bootstrap)!=null&&o.distinctID||(n.bootstrap=Ne({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var p=n.bootstrap.distinctID,h=this.get_distinct_id(),g=this.persistence.get_property(ei);if(n.bootstrap.isIdentifiedID&&h!=null&&h!==p&&g===pc)this.identify(p);else if(n.bootstrap.isIdentifiedID&&h!=null&&h!==p&&g===mc)$e.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(na()),_=n.bootstrap.isIdentifiedID?v:p;this.persistence.set_property(ei,n.bootstrap.isIdentifiedID?mc:pc),this.register({distinct_id:p,$device_id:_})}}if(f)this.register_once({distinct_id:wp,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(na());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(ei,pc)}return Vn(me,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(x,S){var E=x.config.segment;if(!E)return S();(function(T,R){var O=T.config.segment;if(!O)return R();var A=M=>{var L=()=>M.anonymousId()||na();T.config.get_device_id=L,M.id()&&(T.register({distinct_id:M.id(),$device_id:L()}),T.persistence.set_property(ei,mc)),R()},I=O.user();"then"in I&&is(I.then)?I.then(A):A(I)})(x,(()=>{E.register((T=>{Promise&&Promise.resolve||nb.warn("This browser does not have Promise support, and can not use the segment integration");var R=(O,A)=>{if(!A)return O;O.event.userId||O.event.anonymousId===T.get_distinct_id()||(nb.info("No userId set, resetting PostHog"),T.reset()),O.event.userId&&O.event.userId!==T.get_distinct_id()&&(nb.info("UserId set, identifying with PostHog"),T.identify(O.event.userId));var I=T.calculateEventProperties(A,O.event.properties);return O.event.properties=Object.assign({},I,O.event.properties),O};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:O=>R(O,O.event.event),page:O=>R(O,xc),identify:O=>R(O,eb),screen:O=>R(O,"$screen")}})(x)).then((()=>{S()}))}))})(this,(()=>this.Ui())):this.Ui(),is(this.config._onCapture)&&this.config._onCapture!==ew&&($e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(x=>this.config._onCapture(x.event,x)))),this.config.ip&&$e.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(t){var n,r,o,s,l,c,d,f=performance.now(),p=Ne({},$o.__defaultExtensionClasses,this.config.__extensionClasses),h=[];p.featureFlags&&this.Ri.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ri.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ri.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ri.push(new p.tracingHeaders(this)),p.siteApps&&this.Ri.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!t&&this.Ri.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ri.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ri.push(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new p.surveys(this)),p.logs&&this.Ri.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new p.logs(this)),p.conversations&&this.Ri.push(this.conversations=(l=this.conversations)!==null&&l!==void 0?l:new p.conversations(this)),p.productTours&&this.Ri.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ri.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ri.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,tre)),p.toolbar&&this.Ri.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Ri.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new p.experiments(this)),this.Ri.forEach((g=>{g.initialize&&h.push((()=>{g.initialize==null||g.initialize()}))})),h.push((()=>{if(this.Yi){var g=this.Yi;this.Yi=void 0,this.Nr(g)}})),this.Gi(h,f)}Gi(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.Gi(t,n)}),0);var r=t.shift();if(r)try{r()}catch(s){$e.error("Error initializing extension:",s)}}var o=Math.round(performance.now()-n);this.register_for_session({[D5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[L5]:o}),this.config.__preview_deferred_init_extensions&&$e.info("PostHog extensions initialized ("+o+"ms)")}Nr(t){var n;if(!Le||!Le.body)return $e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Nr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=t),this.Wi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Et(t.supportedCompression,_i.GZipJS)?_i.GZipJS:Et(t.supportedCompression,_i.Base64)?_i.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:G1}),this.Ri.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t)))}Ui(){try{this.config.loaded(this)}catch(r){$e.critical("`loaded` function failed",r)}if(this.Xi(),this.config.internal_or_test_user_hostname&&pr!=null&&pr.hostname){var t=pr.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new Y5(this),this.Ki.load()}Xi(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Zi)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Sp(this.__request_queue,(t=>this.Vi(t))),this.__request_queue=[],this.Xi()}_handle_unload(){var t,n,r,o;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture(J_),(n=this.logs)==null||n.flushLogs("sendBeacon"),(r=this.Zi)==null||r.unload(),(o=this.Hi)==null||o.unload()):this.Qi()&&this.capture(J_,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(s6?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=sv(t.url,{ip:this.config.ip?1:0}),t.headers=Ne({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,o,s,l=Ne({},n);l.timeout=l.timeout||6e4,l.url=WA(l.url,l.compression);var c=(r=l.transport)!==null&&r!==void 0?r:"fetch",d=Am.filter((p=>!l.disableTransport||!p.transport||!l.disableTransport.includes(p.transport))),f=(o=(s=(function(p,h){for(var g=0;p.length>g;g++)if(p[g].transport===c)return p[g]})(d))==null?void 0:s.method)!==null&&o!==void 0?o:d[0].method;if(!f)throw new Error("No available transport method");c!=="sendBeacon"&&l.data&&l.compression===_i.GZipJS&&nne&&!YA?vre(l).then((p=>{f(p)})).catch((p=>{if((h=>!(!h||typeof h!="object")&&("name"in h?String(h.name):"")==="NotReadableError")(p))return YA=!0,void f(Ne({},l,{compression:void 0,url:WA(n.url,void 0)}));f(l)})):f(l)})(Ne({},t,{callback:n=>{var r,o;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(o=this.config).on_request_error)==null||r.call(o,n),t.callback==null||t.callback(n)}}))))}Vi(t){this.Hi?this.Hi.retriableRequest(t):this._send_request(t)}_execute_array(t){ub++;try{var n,r=[],o=[],s=[];Sp(t,(c=>{c&&(Mt(n=c[0])?s.push(c):is(c)?c.call(this):Mt(c)&&n==="alias"?r.push(c):Mt(c)&&n.indexOf("capture")!==-1&&is(this[n])?s.push(c):o.push(c))}));var l=function(c,d){Sp(c,(function(f){if(Mt(f[0])){var p=d;dn(f,(function(h){p=p[h[0]].apply(p,h.slice(1))}))}else d[f[0]].apply(d,f.slice(1))}))};l(r,this),l(o,this),l(s,this)}finally{ub--}}push(t){if(ub>0&&Mt(t)&&_n(t[0])){var n=$o.prototype[t[0]];is(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var o,s,l,c,d;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!ze(t)&&_n(t)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(p==null||!p.isRateLimited){n!=null&&n.$current_url&&!_n(n?.$current_url)&&($e.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.en||$e.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,g=r?.timestamp||h,v=na(),_={uuid:v,event:t,properties:this.calculateEventProperties(t,n||{},g,v)};t===xc&&this.config.__preview_capture_bot_pageviews&&f&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),p&&(_.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens),r?.$set&&(_.$set=r?.$set);var b,x,S,E=this.tn(r?.$set_once,t!==$A,t===eb);if(E&&(_.$set_once=E),r!=null&&r._noTruncate||(s=this.config.properties_string_max_length,l=_,c=L=>_n(L)?L.slice(0,s):L,d=new Set,_=(function L(q,j){return q!==Object(q)?c?c(q):q:d.has(q)?void 0:(d.add(q),Mt(q)?(B=[],Sp(q,(F=>{B.push(L(F))}))):(B={},dn(q,((F,Z)=>{d.has(F)||(B[Z]=L(F))}))),B);var B})(l)),_.timestamp=g,ze(r?.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=h),t===Md.DISMISSED||t===Md.SENT){var T=n?.[ib.SURVEY_ID],R=n?.[ib.SURVEY_ITERATION];(L=>{try{var q=(j=>((B,F)=>{var Z=""+J1+F.id;return F.current_iteration&&F.current_iteration>0&&(Z=""+J1+F.id+"_"+F.current_iteration),Z})(0,j))(L);if(localStorage.getItem(q))return;localStorage.setItem(q,"true")}catch(j){Xt.error("Failed to persist survey seen state",j)}})({id:T,current_iteration:R}),_.$set=Ne({},_.$set,{[(b={id:T,current_iteration:R},x=t===Md.SENT?"responded":"dismissed",S="$survey_"+x+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(S="$survey_"+x+"/"+b.id+"/"+b.current_iteration),S)]:!0})}else t===Md.SHOWN&&(_.$set=Ne({},_.$set,{[ib.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===cre.SHOWN){var O=n?.[VA.TOUR_TYPE];O&&(_.$set=Ne({},_.$set,{[VA.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var A=Ne({},_.properties.$set,_.$set);if(Ic(A)||this.setPersonPropertiesForFlags(A),!xt(this.config.before_send)){var I=this.rn(_);if(!I)return;_=I}this.Fi.emit("eventCaptured",_);var M={method:"POST",url:(o=r?._url)!==null&&o!==void 0?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:_,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Vi(M):this.Zi.enqueue(M),_}$e.critical("This capture call is ignored due to client rate limiting.")}}else $e.error("No event name provided to posthog.capture")}else $e.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,o,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var l=s?void 0:this.persistence.remove_event_timer(t),c=Ne({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ni()&&(c.$cookieless_mode=!0),t==="$snapshot"){var d=Ne({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=d.distinct_id,(!_n(c.distinct_id)&&!Fo(c.distinct_id)||Rm(c.distinct_id))&&$e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var f,p=(function(S,E){var T,R,O,A;if(!Yr)return{};var I,M,L,q,j,B,F,Z,ie=S?[...Qc,...E||[]]:[],[H,W]=(function(te){for(var le=0;NA.length>le;le++){var[Q,k]=NA[le],G=Q.exec(te),V=G&&(is(k)?k(G,te):k);if(V)return V}return["",""]})(Yr);return Rn(YS({$os:H,$os_version:W,$browser:E5(Yr,navigator.vendor),$device:kA(Yr),$device_type:(M=Yr,L={userAgentDataPlatform:(T=navigator)==null||(T=T.userAgentData)==null?void 0:T.platform,maxTouchPoints:(R=navigator)==null?void 0:R.maxTouchPoints,screenWidth:me==null||(O=me.screen)==null?void 0:O.width,screenHeight:me==null||(A=me.screen)==null?void 0:A.height,devicePixelRatio:me?.devicePixelRatio},Z=kA(M),Z===c5||Z===l5||Z==="Kobo"||Z==="Kindle Fire"||Z===S5?Zc:Z===of||Z===Fc||Z===sf||Z===x1?"Console":Z===d5?"Wearable":Z?yo:L?.userAgentDataPlatform==="Android"&&((q=L?.maxTouchPoints)!==null&&q!==void 0?q:0)>0?600>Math.min((j=L?.screenWidth)!==null&&j!==void 0?j:0,(B=L?.screenHeight)!==null&&B!==void 0?B:0)/((F=L?.devicePixelRatio)!==null&&F!==void 0?F:1)?yo:Zc:"Desktop"),$timezone:Z5(),$timezone_offset:are()}),{$current_url:af(pr?.href,ie,lf),$host:pr?.host,$pathname:pr?.pathname,$raw_user_agent:Yr.length>1e3?Yr.substring(0,997)+"...":Yr,$browser_version:yne(Yr,navigator.vendor),$browser_language:BA(),$browser_language_prefix:(I=BA(),typeof I=="string"?I.split("-")[0]:void 0),$screen_height:me?.screen.height,$screen_width:me?.screen.width,$viewport_height:me?.innerHeight,$viewport_width:me?.innerWidth,$lib:$r.LIB_NAME,$lib_version:$r.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());c.$session_id=h,c.$window_id=g}this.sessionPropsManager&&Rn(c,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&Rn(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=(v=this.Hi)==null?void 0:v.length}catch(S){c.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===X1&&(c.$lib_custom_api_host=this.config.api_host),f=t!==xc||s?t!==J_||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,o),c=Rn(c,f),t===xc&&Le&&(c.title=Le.title),!ze(l)){var _=r.getTime()-l;c.$duration=parseFloat((_/1e3).toFixed(3))}Yr&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=Rn({},p,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),Mt(this.config.property_denylist)?dn(this.config.property_denylist,(function(S){delete c[S]})):$e.error(i6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&($e.error(nI),c=b(c,t));var x=this.nn();return c.$process_person_profile=x,x&&!s&&this.sn("_calculate_event_properties"),c}tn(t,n,r){var o;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.nn()||this.Mi&&!r)return t;var s=this.persistence.get_initial_props(),l=(o=this.sessionPropsManager)==null?void 0:o.getSetOnceProps(),c=Rn({},s,l||{},t||{}),d=this.config.sanitize_properties;return d&&($e.error(nI),c=d(c,"$set_once")),n&&(this.Mi=!0),Ic(c)?void 0:c}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var o;(o=this.persistence)==null||o.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}an(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var o;(o=this.featureFlags)==null||o.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var o;(o=this.featureFlags)==null||o.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var o;return n===void 0&&(n=!1),(o=this.featureFlags)==null?void 0:o.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Fi.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:md}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:md})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:md})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=Ore),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:md}}canRenderSurveyAsync(t,n){var r,o;return n===void 0&&(n=!1),(r=(o=this.surveys)==null?void 0:o.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:md})}ln(t){return!t||Rm(t)?($e.critical("Unique user id has not been set in posthog.identify"),!1):t===wp?($e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||($e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return $e.uninitializedWarning("posthog.identify");if(Fo(t)&&(t=t.toString(),$e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ln(t)&&this.sn("posthog.identify")){var o=this.get_distinct_id();this.register({$user_id:t}),this.get_property(cg)||this.register_once({$had_persisted_distinct_id:!0,$device_id:o},""),t!==o&&t!==this.get_property(Td)&&(this.unregister(Td),this.register({distinct_id:t}));var s,l=(this.persistence.get_property(ei)||pc)===pc;t!==o&&l?(this.persistence.set_property(ei,mc),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(eb,{distinct_id:t,$anon_distinct_id:o},{$set:n||{},$set_once:r||{}}),this.Di=JA(t,n,r),(s=this.featureFlags)==null||s.setAnonymousDistinctId(o)):(n||r)&&this.setPersonProperties(n,r),t!==o&&(this.reloadFeatureFlags(),this.unregister(jd))}}setPersonProperties(t,n){if((t||n)&&this.sn("posthog.setPersonProperties")){var r=JA(this.get_distinct_id(),t,n);this.Di!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Di=r):$e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var o=this.getGroups(),s=o[t]!==n;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Ne({},o,{[t]:n})}),s||r){var l={$group_type:t,$group_key:n};r&&(l.$group_set=r),this.capture($A,l)}r&&this.setGroupPropertiesForFlags({[t]:r}),s&&!r&&this.reloadFeatureFlags()}else $e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.sn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,o,s,l,c,d,f;if($e.info("reset"),!this.__loaded)return $e.uninitializedWarning("posthog.reset");var p=this.get_property(cg);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(o=this.surveys)==null||o.reset(),(s=this.Ki)==null||s.stop(),(l=this.featureFlags)==null||l.reset(),(c=this.conversations)==null||c.reset(),(d=this.persistence)==null||d.set_property(ei,pc),(f=this.sessionManager)==null||f.resetSessionId(),this.Di=null,this.config.cookieless_mode===as)this.register_once({distinct_id:wp,$device_id:null},"");else{var h=this.config.get_device_id(na());this.register_once({distinct_id:h,$device_id:t?h:p},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,n){var r;this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)==null||r.un()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.hn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),o=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var s,l=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return o;o+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-l,0)}return o}alias(t,n){return t===this.get_property(A5)?($e.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(ze(n)&&(n=this.get_distinct_id()),t!==n?(this.an(Td,t),this.capture("$create_alias",{alias:t,distinct_id:n})):($e.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=Ne({},this.config);if(An(t)){var r,o,s,l,c,d,f,p,h,g;Rn(this.config,oI(t));var v=this.qi();(r=this.persistence)==null||r.update_config(this.config,n,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new rb(Ne({},this.config,{persistence:"sessionStorage"}),v);var _=this.Bi(this.config.debug);Ri(_)&&(this.config.debug=_),Ri(this.config.debug)&&(this.config.debug?($r.DEBUG=!0,yn.R()&&yn.M("ph_debug",!0),$e.info("set_config",{config:t,oldConfig:n,newConfig:Ne({},this.config)})):($r.DEBUG=!1,yn.R()&&yn.F("ph_debug"))),(o=this.exceptionObserver)==null||o.onConfigChange(),(s=this.exceptions)==null||s.onConfigChange(),(l=this.sessionRecording)==null||l.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(d=this.heatmaps)==null||d.startIfEnabled(),(f=this.exceptionObserver)==null||f.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(h=this.surveys)==null||h.loadIfEnabled(),this.cn(),(g=this.externalIntegrations)==null||g.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){$r.LIB_NAME=t,$r.LIB_VERSION=n}startSessionRecording(t){var n,r,o,s,l,c=t===!0,d={sampling:c||!(t==null||!t.sampling),linked_flag:c||!(t==null||!t.linked_flag),url_trigger:c||!(t==null||!t.url_trigger),event_trigger:c||!(t==null||!t.event_trigger)};Object.values(d).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),d.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),d.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),d.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),d.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),o=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Ne({},o,n))}}addExceptionStep(t,n){var r;(r=this.exceptions)==null||r.addExceptionStep(t,n)}captureLog(t){var n;(n=this.logs)==null||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)==null?void 0:n.logger)!==null&&t!==void 0?t:$o.dn}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Rc;return n!==Rc&&(n=Rc+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(ei))===mc||((n=this.sessionPersistence)==null?void 0:n.get_property(ei))===mc}nn(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===G1&&!this._isIdentified()&&Ic(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Td])&&((n=this.persistence)==null||(n=n.props)==null||!n[hg]))}Qi(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(t){return this.config.person_profiles==="never"?($e.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(hg,!0),!0)}qi(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Qa)}cn(){var t,n,r,o,s=this.qi();return((t=this.persistence)==null?void 0:t._r)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n._r)!==s&&((o=this.sessionPersistence)==null||o.set_disabled(s)),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==as){if(this.Ni()){var r,o,s,l,c;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(o=this.pageViewManager)==null||o.destroy(),this.sessionManager=new XA(this),this.pageViewManager=new FA(this),this.persistence&&(this.sessionPropsManager=new QA(this,this.sessionManager,this.persistence));var d,f=(s=(l=this.config.__extensionClasses)==null?void 0:l.sessionRecording)!==null&&s!==void 0?s:(c=$o.__defaultExtensionClasses)==null?void 0:c.sessionRecording;f&&(this.sessionRecording=this.Ei(this.sessionRecording,new f(this)),this.Wi&&((d=this.sessionRecording)==null||d.onRemoteConfig==null||d.onRemoteConfig(this.Wi)))}var p,h;this.consent.optInOut(!0),this.cn(),this.Xi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Qa&&((p=this.surveys)==null||p.loadIfEnabled()),(ze(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((h=t?.captureEventName)!==null&&h!==void 0?h:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else $e.warn(tI)}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!==as?(this.config.cookieless_mode===Qa&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Qa&&(this.register({distinct_id:wp,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.Ji())):$e.warn(tI)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===as||(this.config.cookieless_mode===Qa?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return go?n6(go,this.config.custom_blocked_useragents):void 0}Ji(){Le&&(Le.visibilityState==="visible"?this.Oi||(this.Oi=!0,this.capture(xc,{title:Le.title},{send_instantly:!0}),this.Pi&&(Le.removeEventListener(pg,this.Pi),this.Pi=null)):this.Pi||(this.Pi=this.Ji.bind(this),Vn(Le,pg,this.Pi)))}debug(t){t===!1?(me?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(me?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Fr(){var t,n,r,o,s,l,c=this.ji||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?($e.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",o=$e,s=(n="advanced_disable_flags")in(t=c)&&!xt(t[n]),l=r in t&&!xt(t[r]),s?t[n]:!!l&&(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]))}rn(t){if(xt(this.config.before_send))return t;var n=Mt(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var o of n){if(r=o(r),xt(r)){var s="Event '"+t.event+"' was rejected in beforeSend function";return sne(t.event)?$e.warn(s+". This can cause unexpected behavior."):$e.info(s),null}r.properties&&!Ic(r.properties)||$e.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.dr)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Bi(t){var n=Ri(t)&&!t,r=yn.R()&&yn.O("ph_debug")==="true";return!n&&(!!r||t)}}function iI(e){return e instanceof Element&&(e.id===k5||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function av(e){return!!e&&e.nodeType===1}function ua(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function a6(e){return!!e&&e.nodeType===3}function l6(e){return!!e&&e.nodeType===11}function JS(e){return e?ov(e).split(/\s+/):[]}function sI(e){var t=me?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function Eg(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return JS(t)}function c6(e){return xt(e)?null:ov(e).split(/(\s+)/).filter((t=>Fd(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function cf(e){var t="";return nw(e)&&!d6(e)&&e.childNodes&&e.childNodes.length&&dn(e.childNodes,(function(n){var r;a6(n)&&n.textContent&&(t+=(r=c6(n.textContent))!==null&&r!==void 0?r:"")})),ov(t)}function aI(e){return ze(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}$o.__defaultExtensionClasses={},$o.dn={trace:vc=()=>{},debug:vc,info:vc,warn:vc,error:vc,fatal:vc},(function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=qne(e.prototype[t[n]])})($o,["identify"]);var eE=["a","button","form","input","select","textarea","label"];function lI(e,t){if(ze(t))return!0;var n,r=function(s){if(t.some((l=>s.matches(l))))return{v:!0}};for(var o of e)if(n=r(o))return n.v;return!1}function u6(e){var t=e.parentNode;return!(!t||!av(t))&&t}var Mre=["next","previous","prev",">","<"],cI=[".ph-no-rageclick",".ph-no-capture"],tw=e=>!e||ua(e,"html")||!av(e),uI=(e,t)=>{if(!me||tw(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],o=e;o.parentNode&&!ua(o,"body");)if(l6(o.parentNode))r.push(o.parentNode.host),o=o.parentNode.host;else{var s=u6(o);if(!s)break;if(t||eE.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var l=me.getComputedStyle(s);l&&l.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),o=s}return{parentIsUsefulElement:n,targetElementList:r}};function nw(e){for(var t=e;t.parentNode&&!ua(t,"body");t=t.parentNode){var n=Eg(t);if(Et(n,"ph-sensitive")||Et(n,"ph-no-capture"))return!1}if(Et(Eg(e),"ph-include"))return!0;var r=e.type||"";if(_n(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!_n(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function d6(e){return!!(ua(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ua(e,"select")||ua(e,"textarea")||e.getAttribute("contenteditable")==="true")}var f6="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Nre=new RegExp("^(?:"+f6+")$"),kre=new RegExp(f6),h6="\\d{3}-?\\d{2}-?\\d{4}",Dre=new RegExp("^("+h6+")$"),Lre=new RegExp("("+h6+")");function Fd(e,t){return t===void 0&&(t=!0),!(xt(e)||_n(e)&&(e=ov(e),(t?Nre:kre).test((e||"").replace(/[- ]/g,""))||(t?Dre:Lre).test(e)))}function dI(e){var t=cf(e);return Fd(t=(t+" "+p6(e)).trim())?t:""}function p6(e){var t="";return e&&e.childNodes&&e.childNodes.length&&dn(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var o=cf(n);t=(t+" "+o).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+p6(n)).trim())}catch(s){$e.error("[AutoCapture]",s)}})),t}function fI(e){return e.replace(/"|\\"/g,'\\"')}function $re(e){var t=e.attr__class;return t?Mt(t)?t:JS(t):void 0}class hI{constructor(t){this.disabled=t===!1;var n=An(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var o=this.clicks[this.clicks.length-1];if(o&&Math.abs(t-o.x)+Math.abs(n-o.y)<this.thresholdPx&&this.timeoutMs>r-o.timestamp){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var db="$copy_autocapture",pI=mn("[AutoCapture]");function fb(e,t){return t.length>e?t.slice(0,e)+"...":t}function jre(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!av(t));return t}function zre(e,t){for(var n,r,{e:o,maskAllElementAttributes:s,maskAllText:l,elementAttributeIgnoreList:c,elementsChainAsString:d}=t,f=[e],p=e;p.parentNode&&!ua(p,"body");)l6(p.parentNode)?(f.push(p.parentNode.host),p=p.parentNode.host):(f.push(p.parentNode),p=p.parentNode);var h,g,v=[],_={},b=!1,x=!1;if(dn(f,(O=>{var A=nw(O);O.tagName.toLowerCase()==="a"&&(b=O.getAttribute("href"),b=A&&b&&Fd(b)&&b),Et(Eg(O),"ph-no-capture")&&(x=!0),v.push((function(M,L,q,j){var B=M.tagName.toLowerCase(),F={tag_name:B};eE.indexOf(B)>-1&&!q&&(F.$el_text=B.toLowerCase()==="a"||B.toLowerCase()==="button"?fb(1024,dI(M)):fb(1024,cf(M)));var Z=Eg(M);Z.length>0&&(F.classes=Z.filter((function(te){return te!==""}))),dn(M.attributes,(function(te){var le;if((!d6(M)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(j==null||!j.includes(te.name))&&!L&&Fd(te.value)&&(!_n(le=te.name)||le.substring(0,10)!=="_ngcontent"&&le.substring(0,7)!=="_nghost")){var Q=te.value;te.name==="class"&&(Q=JS(Q).join(" ")),F["attr__"+te.name]=fb(1024,Q)}}));for(var ie=1,H=1,W=M;W=jre(W);)ie++,W.tagName===M.tagName&&H++;return F.nth_child=ie,F.nth_of_type=H,F})(O,s,l,c));var I=(function(M){if(!nw(M))return{};var L={};return dn(M.attributes,(function(q){if(q.name&&q.name.indexOf("data-ph-capture-attribute")===0){var j=q.name.replace("data-ph-capture-attribute-",""),B=q.value;j&&B&&Fd(B)&&(L[j]=B)}})),L})(O);Rn(_,I)})),x)return{props:{},explicitNoCapture:x};if(l||(v[0].$el_text=e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?dI(e):cf(e)),b){var S,E;v[0].attr__href=b;var T=(S=vg(b))==null?void 0:S.host,R=me==null||(E=me.location)==null?void 0:E.host;T&&R&&T!==R&&(h=b)}return{props:Rn({$event_type:o.type,$ce_version:1},d?{}:{$elements:v},{$elements_chain:(g=v,(function(O){return O.map((A=>{var I,M,L="";if(A.tag_name&&(L+=A.tag_name),A.attr_class)for(var q of(A.attr_class.sort(),A.attr_class))L+="."+q.replace(/"/g,"");var j=Ne({},A.text?{text:A.text}:{},{"nth-child":(I=A.nth_child)!==null&&I!==void 0?I:0,"nth-of-type":(M=A.nth_of_type)!==null&&M!==void 0?M:0},A.href?{href:A.href}:{},A.attr_id?{attr_id:A.attr_id}:{},A.attributes),B={};return Cm(j).sort(((F,Z)=>{var[ie]=F,[H]=Z;return ie.localeCompare(H)})).forEach((F=>{var[Z,ie]=F;return B[fI(Z.toString())]=fI(ie.toString())})),(L+=":")+Cm(B).map((F=>{var[Z,ie]=F;return Z+'="'+ie+'"'})).join("")})).join(";")})((function(O){return O.map((A=>{var I,M,L={text:(I=A.$el_text)==null?void 0:I.slice(0,400),tag_name:A.tag_name,href:(M=A.attr__href)==null?void 0:M.slice(0,2048),attr_class:$re(A),attr_id:A.attr__id,nth_child:A.nth_child,nth_of_type:A.nth_of_type,attributes:{}};return Cm(A).filter((q=>{var[j]=q;return j.indexOf("attr__")===0})).forEach((q=>{var[j,B]=q;return L.attributes[j]=B})),L}))})(g)))},(n=v[0])!=null&&n.$el_text?{$el_text:(r=v[0])==null?void 0:r.$el_text}:{},h&&o.type==="click"?{$external_click_url:h}:{},_)}}var gd=mn("[ExceptionAutocapture]");function mI(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],o=n(r);return is(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var Ure=mn("[TracingHeaders]"),Zs=mn("[Web Vitals]"),gI=9e5,vI="disabled",yI="lazy_loading",vd="awaiting_config",Tp="missing_config";mn("[SessionRecording]"),mn("[SessionRecording]");var rw="[SessionRecording]",Ys=mn(rw),Fre=mn("[Heatmaps]");function _I(e){return An(e)&&"clientX"in e&&"clientY"in e&&Fo(e.clientX)&&Fo(e.clientY)}var bI=mn("[Product Tours]"),Bre=["$set_once","$set"],Ws=mn("[SiteApps]"),wI="Error while initializing PostHog app with config id ";function yc(e,t,n){if(xt(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class Vre{constructor(t){this.vn=new XS,this.fn=(n,r)=>this.pn(n,r)&&this.gn(n,r)&&this.mn(n,r)&&this.yn(n,r),this.pn=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=t,this.bn=new Set,this._n=new Set}init(){var t,n;ze((t=this._instance)==null?void 0:t._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,o)=>{this.on(r,o)}))}register(t){var n,r;if(!ze((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((l=>{var c,d;(c=this._n)==null||c.add(l),(d=l.steps)==null||d.forEach((f=>{var p;(p=this.bn)==null||p.add(f?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var o,s=new Set;t.forEach((l=>{var c;(c=l.steps)==null||c.forEach((d=>{d!=null&&d.selector&&s.add(d?.selector)}))})),(o=this._instance)==null||o.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.bn.has(t)||this.bn.has(n?.event))&&this._n&&((r=this._n)==null?void 0:r.size)>0&&this._n.forEach((o=>{this.wn(n,o)&&this.vn.emit("actionCaptured",o.name)}))}In(t){this.onAction("actionCaptured",(n=>t(n)))}wn(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.fn(t,r))return!0;return!1}onAction(t,n){return this.vn.on(t,n)}gn(t,n){if(n!=null&&n.url){var r,o=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!o||typeof o!="string"||!yc(o,n.url,n.url_matching||"contains"))return!1}return!0}mn(t,n){return!!this.Cn(t,n)&&!!this.Sn(t,n)&&!!this.xn(t,n)}Cn(t,n){var r;if(n==null||!n.href)return!0;var o=this.kn(t);if(o.length>0)return o.some((c=>yc(c.href,n.href,n.href_matching||"exact")));var s,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&yc((s=l.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}Sn(t,n){var r;if(n==null||!n.text)return!0;var o=this.kn(t);if(o.length>0)return o.some((f=>yc(f.text,n.text,n.text_matching||"exact")||yc(f.$el_text,n.text,n.text_matching||"exact")));var s,l,c,d=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!d&&(s=(function(f){for(var p,h=[],g=/(?::|")text="(.*?)"/g;!xt(p=g.exec(f));)h.includes(p[1])||h.push(p[1]);return h})(d),l=n.text,c=n.text_matching||"exact",s.some((f=>yc(f,l,c))))}xn(t,n){var r,o;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var l=(t==null||(o=t.properties)==null?void 0:o.$elements_chain)||"";if(n.selector_regex&&l)try{return new RegExp(n.selector_regex).test(l)}catch{return!1}return!1}kn(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t?.properties.$elements}yn(t,n){return n==null||!n.properties||n.properties.length===0||o6(n.properties.reduce(((r,o)=>{var s=Mt(o.value)?o.value.map(String):o.value!=null?[String(o.value)]:[];return r[o.key]={values:s,operator:o.operator||"exact"},r}),{}),t?.properties)}}class qre{constructor(t){this._instance=t,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(t,n){return!!t&&o6(t.propertyFilters,n?.properties)}Nn(t,n){var r=new Map;return t.forEach((o=>{var s;(s=o.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((l=>{if(l!=null&&l.name){var c=r.get(l.name)||[];c.push(o.id),r.set(l.name,c)}}))})),r}Mn(t,n,r){var o=(r===dd.Activation?this.Tn:this.An).get(t),s=[];return this.Fn((l=>{s=l.filter((c=>o?.includes(c.id)))})),s.filter((l=>{var c,d=(c=l.conditions)==null||(c=c[r])==null||(c=c.values)==null?void 0:c.find((f=>f.name===t));return this.Rn(d,n)}))}register(t){var n;ze((n=this._instance)==null?void 0:n._addCaptureHook)||(this.On(t),this.Pn(t))}Pn(t){var n=t.filter((r=>{var o,s;return((o=r.conditions)==null?void 0:o.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.Ln==null&&(this.Ln=new Vre(this._instance),this.Ln.init(),this.Ln.In((r=>{this.onAction(r)}))),n.forEach((r=>{var o,s,l,c,d;r.conditions&&(o=r.conditions)!=null&&o.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null?void 0:l.length)>0&&((c=this.Ln)==null||c.register(r.conditions.actions.values),(d=r.conditions)==null||(d=d.actions)==null||(d=d.values)==null||d.forEach((f=>{if(f&&f.name){var p=this.En.get(f.name);p&&p.push(r.id),this.En.set(f.name,p||[r.id])}})))})))}On(t){var n,r=t.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.events)&&((c=s.conditions)==null||(c=c.events)==null||(c=c.values)==null?void 0:c.length)>0})),o=t.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.cancelEvents)&&((c=s.conditions)==null||(c=c.cancelEvents)==null||(c=c.values)==null?void 0:c.length)>0}));r.length===0&&o.length===0||((n=this._instance)==null||n._addCaptureHook(((s,l)=>{this.onEvent(s,l)})),this.Tn=this.Nn(t,dd.Activation),this.An=this.Nn(t,dd.Cancellation))}onEvent(t,n){var r,o=this.le(),s=this.Dn(),l=this.Bn(),c=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(l===t&&n&&c.length>0){var d,f;o.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:c});var p=(n==null||(d=n.properties)==null?void 0:d.$survey_id)||(n==null||(f=n.properties)==null?void 0:f.$product_tour_id);if(p){var h=c.indexOf(p);0>h||(c.splice(h,1),this.jn(c))}}else{if(this.An.has(t)){var g=this.Mn(t,n,dd.Cancellation);g.length>0&&(o.info("cancel event matched, cancelling items",{event:t,itemsToCancel:g.map((_=>_.id))}),g.forEach((_=>{var b=c.indexOf(_.id);0>b||c.splice(b,1),this.$n(_.id)})),this.jn(c))}if(this.Tn.has(t)){o.info("event name matched",{event:t,eventPayload:n,items:this.Tn.get(t)});var v=this.Mn(t,n,dd.Activation);this.jn(c.concat(v.map((_=>_.id))||[]))}}}onAction(t){var n,r=this.Dn(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.En.has(t)&&this.jn(o.concat(this.En.get(t)||[]))}jn(t){var n=this.le(),r=[...new Set(t)].filter((o=>!this.qn(o)));n.info("updating activated items",{activatedItems:r}),this.Zn(r)}getActivatedIds(){var t,n=this.Dn();return((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[]}getEventToItemsMap(){return this.Tn}Vn(){return this.Ln}}class Hre extends qre{constructor(t){super(t)}Dn(){return z1}Bn(){return Md.SHOWN}Fn(t){var n;(n=this._instance)==null||n.getSurveys(t)}$n(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}le(){return Xt}Zn(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[z1]:t})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var hb="SDK is not enabled or survey functionality is not yet loaded",SI="Disabled. Not loading surveys.",Gre=me!=null&&me.location?_g(me.location.hash,"__posthog")||_g(location.hash,"state"):null,EI="_postHogToolbarParams",xI=mn("[Toolbar]"),Nr=mn("[FeatureFlags]"),Ha=mn("[FeatureFlags]",{debugEnabled:!0}),pb=`" failed. Feature flags didn't load in time.`,RI=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},OI=e=>{var t={};for(var[n,r]of Cm(e||{}))r&&(t[n]=r);return t},es=mn("[Error tracking]"),TI="Refusing to render web experiment since the viewer is a likely bot",Kre={icontains:(e,t)=>!!me&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!me&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!me&&Sg(t.href,e),not_regex:(e,t)=>!!me&&!Sg(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Rr{get Bt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((o=>{Rr.Hn("retrieved web experiments from the server"),n.zn=new Map,o.forEach((s=>{if(s.feature_flag_key){var l;n.zn&&(Rr.Hn("setting flag key ",s.feature_flag_key," to web experiment ",s),(l=n.zn)==null||l.set(s.feature_flag_key,s));var c=n._instance.getFeatureFlag(s.feature_flag_key);_n(c)&&s.variants[c]&&n.Un(s.name,c,s.variants[c].transforms)}else if(s.variants)for(var d in s.variants){var f=s.variants[d];Rr.Yn(f)&&n.Un(s.name,d,f.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Rr.Hn(TI);else if(!this.Bt.disable_web_experiments){if(xt(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rr.Hn("applying feature flags",t),t.forEach((n=>{var r;if(this.zn&&(r=this.zn)!=null&&r.has(n)){var o,s=this._instance.getFeatureFlag(n),l=(o=this.zn)==null?void 0:o.get(n);s&&l!=null&&l.variants[s]&&this.Un(l.name,s,l.variants[s].transforms)}}))}}previewWebExperiment(){var t=Rr.getWindowLocation();if(t!=null&&t.search){var n=yg(t?.search,"__experiment_id"),r=yg(t?.search,"__experiment_variant");n&&r&&(Rr.Hn("previewing web experiments "+n+" && "+r),this.getWebExperiments((o=>{this.Gn(parseInt(n),r,o)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.Bt.disable_web_experiments&&!r)return t([]);var o=this._instance.get_property("$web_experiments");if(o&&!n)return t(o);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Bt.token),method:"GET",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Gn(t,n,r){var o=r.filter((s=>s.id===t));o&&o.length>0&&(Rr.Hn("Previewing web experiment ["+o[0].name+"] with variant ["+n+"]"),this.Un(o[0].name,n,o[0].variants[n].transforms))}static Yn(t){return!xt(t.conditions)&&Rr.Wn(t)&&Rr.Xn(t)}static Wn(t){var n;if(xt(t.conditions)||xt((n=t.conditions)==null?void 0:n.url))return!0;var r,o,s,l=Rr.getWindowLocation();return!!l&&((r=t.conditions)==null||!r.url||Kre[(o=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l))}static getWindowLocation(){return me?.location}static Xn(t){var n;if(xt(t.conditions)||xt((n=t.conditions)==null?void 0:n.utm))return!0;var r=B5();if(r.utm_source){var o,s,l,c,d,f,p,h,g=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,v=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_source||((c=t.conditions)==null||(c=c.utm)==null?void 0:c.utm_source)==r.utm_source,_=(d=t.conditions)==null||(d=d.utm)==null||!d.utm_medium||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,b=(p=t.conditions)==null||(p=p.utm)==null||!p.utm_term||((h=t.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==r.utm_term;return g&&_&&b&&v}return!1}static Hn(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];$e.info("[WebExperiments] "+t,r)}Un(t,n,r){this._is_bot()?Rr.Hn(TI):n!=="control"?r.forEach((o=>{if(o.selector){var s;Rr.Hn("applying transform of variant "+n+" for experiment "+t+" ",o);var l=(s=document)==null?void 0:s.querySelectorAll(o.selector);l?.forEach((c=>{var d=c;o.html&&(d.innerHTML=o.html),o.css&&d.setAttribute("style",o.css)}))}})):Rr.Hn("Control variants leave the page unmodified.")}_is_bot(){return go&&this._instance?n6(go,this.Bt.custom_blocked_useragents):void 0}}var ko=mn("[Conversations]"),Ga="Conversations not available yet.",lv={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e,t;return(e=(t=this.ni)==null?void 0:t.wr(this.Bt.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,Nr.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var e,t=(e=this.Bt.evaluation_contexts)!==null&&e!==void 0?e:this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||(Nr.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),t!=null&&t.length?t.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||Nr.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}cs(){return this.hs().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var o,s,l=(o=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&o!==void 0?o:{},c=Object.keys(r).filter((f=>!!r[f])).reduce(((f,p)=>(f[p]=r[p]||!1,f)),{}),d=Object.keys(l).filter((f=>c[f])).reduce(((f,p)=>(l[p]&&(f[p]=l[p]),f)),{});this.receivedFeatureFlags({featureFlags:c,featureFlagPayloads:d})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},o=n!=null&&n.merge?this.getFlagPayloads():{},s=Ne({},r,e),l=Ne({},o,t),c={};for(var[d,f]of Object.entries(s)){var p=typeof f=="string";c[d]={key:d,enabled:!!p||!!f,variant:p?f:void 0,reason:void 0,metadata:ze(l?.[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.receivedFeatureFlags({flags:c})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(D1),t=this.os(os),n=this.os(Ec);if(!n&&!t)return e||{};var r=Rn({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of o){var l,c,d=r[s],f=t?.[s],p=ze(f)?(l=d?.enabled)!==null&&l!==void 0&&l:!!f,h=ze(f)?d.variant:typeof f=="string"?f:void 0,g=n?.[s],v=Ne({},d,{enabled:p,variant:p?h??d?.variant:void 0});p!==d?.enabled&&(v.original_enabled=d?.enabled),h!==d?.variant&&(v.original_variant=d?.variant),g&&(v.metadata=Ne({},d?.metadata,{payload:g,original_payload:d==null||(c=d.metadata)==null?void 0:c.payload})),r[s]=v}return this.Jn||(Nr.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Jn=!0),r}getFlagVariants(){var e=this.os(Pc),t=this.os(os);if(!t)return e||{};for(var n=Rn({},e),r=Object.keys(t),o=0;r.length>o;o++)n[r[o]]=t[r[o]];return this.Jn||(Nr.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Jn=!0),n}getFlagPayloads(){var e=this.os(L1),t=this.os(Ec);if(!t)return e||{};for(var n=Rn({},e||{}),r=Object.keys(t),o=0;r.length>o;o++)n[r[o]]=t[r[o]];return this.Jn||(Nr.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Jn=!0),n}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){var t;if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var n=this.Bt.token,r=this.os(cg),o={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ne({},((t=this.ni)==null?void 0:t.get_initial_props())||{},this.os(Pd)||{}),group_properties:this.os(Wa),timezone:Z5()};ys(r)||ze(r)||(o.$device_id=r),(e!=null&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.cs()&&(o.evaluation_contexts=this.hs());var s=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Bt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Qn=!0,this._instance._send_request({method:"POST",url:s,data:o,compression:this.Bt.disable_compression?void 0:_i.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback:l=>{var c,d,f,p=!0;if(l.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),p=!1),this.Qn=!1,!o.disable_flags||this.ts){this.rs=!p;var h=[];l.error?l.error instanceof Error?h.push(l.error.name==="AbortError"?"timeout":"connection_error"):h.push("unknown_error"):l.statusCode!==200&&h.push("api_error_"+l.statusCode),(c=l.json)!=null&&c.errorsWhileComputingFlags&&h.push("errors_while_computing_flags");var g,v=!((d=l.json)==null||(d=d.quotaLimited)==null||!d.includes("feature_flags"));v&&h.push("quota_limited"),(f=this.ni)==null||f.register({[F1]:h}),v?Nr.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(o.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},p,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var r=this.getFeatureFlagResult(e,t);return(n=r?.variant)!==null&&n!==void 0?n:r?.enabled}}else Nr.warn('getFeatureFlag for key "'+e+pb)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFlagVariants(),r=e in n,o=n[e],s=this.getFlagPayloads()[e],l=String(o),c=this.os($1)||void 0,d=this.os(dg)||void 0,f=this.os(jd)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var p,h=this._instance.get_session_id(),g=this.os(U1);h&&h!==g&&(f={},(p=this.ni)==null||p.register({[jd]:f,[U1]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in f)||!f[e].includes(l))){var v,_,b,x,S,E,T,R,O,A;Mt(f[e])?f[e].push(l):f[e]=[l],(v=this.ni)==null||v.register({[jd]:f});var I=this.getFeatureFlagDetails(e),M=[...(_=this.os(F1))!==null&&_!==void 0?_:[]];ze(o)&&M.push("flag_missing");var L={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:s||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:((b=this.Bt.bootstrap)==null||(b=b.featureFlags)==null?void 0:b[e])||null,$feature_flag_bootstrapped_payload:((x=this.Bt.bootstrap)==null||(x=x.featureFlagPayloads)==null?void 0:x[e])||null,$used_bootstrap_value:!this.rs};ze(I==null||(S=I.metadata)==null?void 0:S.version)||(L.$feature_flag_version=I.metadata.version);var q,j=(E=I==null||(T=I.reason)==null?void 0:T.description)!==null&&E!==void 0?E:I==null||(R=I.reason)==null?void 0:R.code;j&&(L.$feature_flag_reason=j),I!=null&&(O=I.metadata)!=null&&O.id&&(L.$feature_flag_id=I.metadata.id),ze(I?.original_variant)&&ze(I?.original_enabled)||(L.$feature_flag_original_response=ze(I.original_variant)?I.original_enabled:I.original_variant),I!=null&&(A=I.metadata)!=null&&A.original_payload&&(L.$feature_flag_original_payload=I==null||(q=I.metadata)==null?void 0:q.original_payload),M.length&&(L.$feature_flag_error=M.join(",")),this._instance.capture("$feature_flag_called",L)}if(r){var B=s;if(!ze(s))try{B=JSON.parse(s)}catch{}return{key:e,enabled:!!o,variant:typeof o=="string"?o:void 0,payload:B}}}}else Nr.warn('getFeatureFlagResult for key "'+e+pb)}getRemoteConfigPayload(e,t){var n=this.Bt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.cs()&&(r.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Bt.disable_compression?void 0:_i.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback(o){var s,l=(s=o.json)==null?void 0:s.featureFlagPayloads;t(l?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return ze(n)?void 0:!!n}Nr.warn('isFeatureEnabled for key "'+e+pb)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.ni){this.Kn=!0;var r=this.getFlagVariants(),o=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(l,c,d,f,p,h){d===void 0&&(d={}),f===void 0&&(f={}),p===void 0&&(p={});var g=(M=>{var L=M.flags;return L?(M.featureFlags=Object.fromEntries(Object.keys(L).map((q=>{var j;return[q,(j=L[q].variant)!==null&&j!==void 0?j:L[q].enabled]}))),M.featureFlagPayloads=Object.fromEntries(Object.keys(L).filter((q=>L[q].enabled)).filter((q=>{var j;return(j=L[q].metadata)==null?void 0:j.payload})).map((q=>{var j;return[q,(j=L[q].metadata)==null?void 0:j.payload]})))):Nr.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),M})(l),v=g.flags,_=g.featureFlags,b=g.featureFlagPayloads;if(_){var x=l.requestId,S=l.evaluatedAt;if(Mt(_)){Nr.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var E={};if(_)for(var T=0;_.length>T;T++)E[_[T]]=!0;c&&c.register({[Om]:_,[Pc]:E})}else{var R=_,O=b,A=v;if(h!=null&&h.partialResponse)R=Ne({},d,R),O=Ne({},f,O),A=Ne({},p,A);else if(l.errorsWhileComputingFlags)if(v){var I=new Set(Object.keys(v).filter((M=>{var L;return!((L=v[M])!=null&&L.failed)})));R=Ne({},d,Object.fromEntries(Object.entries(R).filter((M=>{var[L]=M;return I.has(L)})))),O=Ne({},f,Object.fromEntries(Object.entries(O||{}).filter((M=>{var[L]=M;return I.has(L)})))),A=Ne({},p,Object.fromEntries(Object.entries(A||{}).filter((M=>{var[L]=M;return I.has(L)}))))}else R=Ne({},d,R),O=Ne({},f,O),A=Ne({},p,A);c&&c.register(Ne({[Om]:Object.keys(OI(R)),[Pc]:R||{},[L1]:O||{},[D1]:A||{}},x?{[$1]:x}:{},S?{[dg]:S}:{}))}}})(e,this.ni,r,o,s,n),t||(this.ss=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),Nr.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return Nr.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this.ni.unregister(os),this.ni.unregister(Ec),this.ps(),Ha.info("All overrides cleared");if(Mt(e)){var t=RI(e);return this.ni.register({[os]:t}),this.ps(),Ha.info("Flag overrides set",{flags:e})}if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.ni.unregister(os),Ha.info("Flag overrides cleared");else if(r.flags){if(Mt(r.flags)){var o=RI(r.flags);this.ni.register({[os]:o})}else this.ni.register({[os]:r.flags});Ha.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.ni.unregister(Ec),Ha.info("Payload overrides cleared")):r.payloads&&(this.ni.register({[Ec]:r.payloads}),Ha.info("Payload overrides set",{payloads:r.payloads}))),void this.ps()}if(e&&typeof e=="object")return this.ni.register({[os]:e}),this.ps(),Ha.info("Flag overrides set",{flags:e});Nr.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:n}=this.gs();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,o=(this.os(Id)||[]).find((d=>d.flagKey===e)),s={["$feature_enrollment/"+e]:t},l={$feature_flag:e,$feature_enrollment:t,$set:s};o&&(l.$early_access_feature_name=o.name),n&&(l.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(s,!1);var c=Ne({},this.getFlagVariants(),{[e]:t});(r=this.ni)==null||r.register({[Om]:Object.keys(OI(c)),[Pc]:c}),this.ps()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.os(Id),o=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Bt.token+o),method:"GET",callback:s=>{var l,c;if(s.json){var d=s.json.earlyAccessFeatures;return(l=this.ni)==null||l.unregister(Id),(c=this.ni)==null||c.register({[Id]:d}),e(d)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((n=>t[n])),flagVariants:Object.keys(t).filter((n=>t[n])).reduce(((n,r)=>(n[r]=t[r],n)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Pd)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),o=e?.$set_once,s={};if(o)for(var l in o)({}).hasOwnProperty.call(o,l)&&(l in n||(s[l]=o[l]));this._instance.register({[Pd]:Ne({},n,s,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Pd)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Wa)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Ne({},n[r],e[r]),delete e[r]})),this._instance.register({[Wa]:Ne({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(Wa)||{};this._instance.register({[Wa]:Ne({},t,{[e]:{}})})}else this._instance.unregister(Wa)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},Zre={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){var e,t;return this.bs===vd||this.bs===Tp?this.bs:(e=(t=this.ys)==null?void 0:t.status)!==null&&e!==void 0?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=vI,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw Ys.error("started without valid sessionManager"),new Error(rw+" started without valid sessionManager. This is a bug.");if(this.Bt.cookieless_mode===as)throw new Error(rw+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!((e=this._instance.get_property(Ad))==null||!e.enabled),n=!this.Bt.disable_session_recording,r=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return me&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.ws||(t=this.ys)==null||!t.isStarted){var n=!ze(Object.assign)&&!ze(Array.from);this.ws&&n?(this.Is(e),Ys.info("starting")):(this.bs=vI,this.stopRecording())}}Is(e){var t,n,r;this.ws&&(this.bs!==vd&&this.bs!==Tp&&(this.bs=yI),We!=null&&(t=We.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=We.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Cs(e):(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(o=>{if(o)return Ys.error("could not load recorder",o);this.Cs(e)})))}stopRecording(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.stop()}xs(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.discard()}ks(){var e;(e=this.ni)==null||e.unregister(KS)}Ts(e,t){if(xt(e))return null;var n,r=Fo(e)?e:parseFloat(e);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Ys.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}As(e){if(this.ni){var t,n,r=this.ni,o=()=>{var s,l=e.sessionRecording===!1?void 0:e.sessionRecording,c=this.Ts((s=this.Bt.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),d=this.Ts(l?.sampleRate,"remote config sampleRate"),f=c??d;xt(f)&&this.ks();var p=l?.minimumDurationMilliseconds;r.register({[Ad]:Ne({cache_timestamp:Date.now(),enabled:!!l},l,{networkPayloadCapture:Ne({capturePerformance:e.capturePerformance},l?.networkPayloadCapture),canvasRecording:{enabled:l?.recordCanvas,fps:l?.canvasFps,quality:l?.canvasQuality},sampleRate:f,minimumDurationMilliseconds:ze(p)?null:p,endpoint:l?.endpoint,triggerMatchType:l?.triggerMatchType,masking:l?.masking,urlTriggers:l?.urlTriggers,version:l?.version,triggerGroups:l?.triggerGroups})})};o(),(t=this._s)==null||t.call(this),this._s=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(o)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.As(e),void this.xs()):(this.As(e),void this.startIfEnabledOrStop()):(this.bs===vd&&(this.bs=Tp,Ys.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Ys.warn("log called before recorder was ready")}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Ad);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Es(){var e,t=this._instance.get_property(Ad);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return 36e5>=Date.now()-n}Cs(e){var t,n;if((t=We.__PosthogExtensions__)==null||!t.initSessionRecording)return Ys.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[$5]:!0});if(this.ys||(this.ys=(n=We.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es())return this.bs===Tp||this.bs===vd?void 0:(this.bs=vd,Ys.info("persisted remote config is stale, requesting fresh config before starting"),void new Y5(this._instance).load());this.bs=yI,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.ni)==null||t.register({[P5]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[I5]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.ni)==null||n.register({[e==="url"?M5:N5]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.ys)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},Yre={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new hI(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e,t,n=An(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}Os(){if(this.isBrowserSupported()){if(me&&Le){var e=n=>{n=n||me?.event;try{this.Ps(n)}catch(r){pI.error("Failed to capture event",r)}};if(Vn(Le,"submit",e,{capture:!0}),Vn(Le,"change",e,{capture:!0}),Vn(Le,"click",e,{capture:!0}),this.Bt.capture_copied_text){var t=n=>{this.Ps(n=n||me?.event,db)};Vn(Le,"copy",t,{capture:!0}),Vn(Le,"cut",t,{capture:!0})}}}else pI.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[T1]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,n=[];return(t=this.Fs)==null||t.forEach((r=>{var o=Le?.querySelectorAll(r);o?.forEach((s=>{e===s&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[T1];if(ys(this.Ns)&&!Ri(n)&&!this.instance.Fr())return!1;var r=(t=this.Ns)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!r}Ps(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=aI(e);a6(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&(function(h,g){if(!me||tw(h))return!1;var v,_,b;if(Ri(g)?(v=!!g&&cI,_=void 0):(v=(b=g?.css_selector_ignorelist)!==null&&b!==void 0?b:cI,_=g?.content_ignorelist),v===!1)return!1;var{targetElementList:x}=uI(h,!1);return!(function(S,E){if(S===!1||ze(S))return!1;var T;if(S===!0)T=Mre;else{if(!Mt(S))return!1;if(S.length>10)return $e.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;T=S.map((R=>R.toLowerCase()))}return E.some((R=>{var{safeText:O,ariaLabel:A}=R;return T.some((I=>O.includes(I)||A.includes(I)))}))})(_,x.map((S=>{var E;return{safeText:cf(S).toLowerCase(),ariaLabel:((E=S.getAttribute("aria-label"))==null?void 0:E.toLowerCase().trim())||""}})))&&!lI(x,v)})(r,this.instance.config.rageclick)&&this.Ps(e,"$rageclick");var o=t===db;if(r&&(function(h,g,v,_,b){var x,S,E,T;if(v===void 0&&(v=void 0),!me||tw(h)||(x=v)!=null&&x.url_allowlist&&!sI(v.url_allowlist)||(S=v)!=null&&S.url_ignorelist&&sI(v.url_ignorelist))return!1;if((E=v)!=null&&E.dom_event_allowlist){var R=v.dom_event_allowlist;if(R&&!R.some((L=>g.type===L)))return!1}var{parentIsUsefulElement:O,targetElementList:A}=uI(h,_);if(!(function(L,q){var j=q?.element_allowlist;if(ze(j))return!0;var B,F=function(ie){if(j.some((H=>ie.tagName.toLowerCase()===H)))return{v:!0}};for(var Z of L)if(B=F(Z))return B.v;return!1})(A,v)||!lI(A,(T=v)==null?void 0:T.css_selector_allowlist))return!1;var I=me.getComputedStyle(h);if(I&&I.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0;var M=h.tagName.toLowerCase();switch(M){case"html":return!1;case"form":return(b||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(b||["change","click"]).indexOf(g.type)>=0;default:return O?(b||["click"]).indexOf(g.type)>=0:(b||["click"]).indexOf(g.type)>=0&&(eE.indexOf(M)>-1||h.getAttribute("contenteditable")==="true")}})(r,e,this.Bt,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:l}=zre(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(l)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(s.$element_selectors=c),t===db){var d,f=c6(me==null||(d=me.getSelection())==null?void 0:d.toString()),p=e.type||"clipboard";if(!f)return!1;s.$selected_content=f,s.$copy_type=p}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return is(Le?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ls=(me==null||(t=me.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&($e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,$e.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(me&&me.history){var n=this;(e=me.history.pushState)!=null&&e.__posthog_wrapped__||mI(me.history,"pushState",(r=>function(o,s,l){r.call(this,o,s,l),n.Bs("pushState")})),(t=me.history.replaceState)!=null&&t.__posthog_wrapped__||mI(me.history,"replaceState",(r=>function(o,s,l){r.call(this,o,s,l),n.Bs("replaceState")})),this.js()}}Bs(e){try{var t,n=me==null||(t=me.location)==null?void 0:t.pathname;if(!n)return;n!==this.Ls&&this.isEnabled&&this._instance.capture(xc,{navigation_type:e}),this.Ls=n}catch(r){$e.error("Error capturing "+e+" pageview",r)}}js(){if(!this.Ds){var e=()=>{this.Bs("popstate")};Vn(me,"popstate",e),this.Ds=()=>{me&&me.removeEventListener("popstate",e)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!((t=this.instance.persistence)==null||!t.props[C1]),this.rageclicks=new hI(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return An(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return xt(this.Bt.capture_heatmaps)?xt(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:this.Bt.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Fre.info("starting..."),this.Zs(),this.Ft()}else{var e;clearInterval((e=this.qs)!==null&&e!==void 0?e:void 0),this.Vs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[C1]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Hs(e){this.Tt(e.originalEvent,"deadclick")}Ft(){this.qs&&clearInterval(this.qs),this.qs=Le?.visibilityState==="visible"?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){me&&Le&&(this.zs=this.Yr.bind(this),Vn(me,mg,this.zs),this.Us=e=>this.Tt(e||me?.event),Vn(Le,"click",this.Us,{capture:!0}),this.Ys=e=>this.Gs(e||me?.event),Vn(Le,"mousemove",this.Ys,{capture:!0}),this.Ws=new UA(this.instance,ere,this.Hs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Ft.bind(this),Vn(Le,pg,this.Xs),this.Rs=!0)}Vs(){var e;me&&Le&&(this.zs&&me.removeEventListener(mg,this.zs),this.Us&&Le.removeEventListener("click",this.Us,{capture:!0}),this.Ys&&Le.removeEventListener("mousemove",this.Ys,{capture:!0}),this.Xs&&Le.removeEventListener(pg,this.Xs),clearTimeout(this.Js),(e=this.Ws)==null||e.stop(),this.Rs=!1)}Ks(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(l,c,d){for(var f=l;f&&av(f)&&!ua(f,"body");){if(f===d)return!1;if(Et(c,me?.getComputedStyle(f).position))return!0;f=u6(f)}return!1})(aI(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}Tt(e,t){var n;if(t===void 0&&(t="click"),!iI(e.target)&&_I(e)){var r=this.Ks(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Qs(Ne({},r,{type:"rageclick"})),this.Qs(r)}}Gs(e){!iI(e.target)&&_I(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,"mousemove"))}),500))}Qs(e){if(me){var t=me.location.href,n=this.Bt.custom_personal_data_properties,r=this.Bt.mask_personal_data_properties?[...Qc,...n||[]]:[],o=af(t,r,lf);this.T=this.T||{},this.T[o]||(this.T[o]=[]),this.T[o].push(e)}}Yr(){this.T&&!Ic(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:UA,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.T.metrics.length!==0&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((n,r)=>Ne({},n,{["$web_vitals_"+r.name+"_event"]:Ne({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(ze(o))Zs.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.io();ze(s)||(xt(n?.name)||xt(n?.value)?Zs.error("Invalid metric received",n):!this.no||this.no>n.value?(this.T.url!==s&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),ze(this.T.url)&&(this.T.url=s),this.T.firstMetricTimestamp=ze(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.T.metrics.push(Ne({},n,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):Zs.error("Ignoring metric with value >= "+this.no,n))}},this.so=()=>{if(!this.Rs){var n,r,o,s,l=We.__PosthogExtensions__;ze(l)||ze(l.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:s}=l.postHogWebVitalsCallbacks),n&&r&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.ht.bind(this)),this.Rs=!0):Zs.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.$s=!((t=this._instance.persistence)==null||!t.props[M1]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=An(this.oo)?(e=this.oo)==null?void 0:e.web_vitals_allowed_metrics:void 0;return xt(n)?((t=this._instance.persistence)==null?void 0:t.props[k1])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(An(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=An(this.oo)?this.oo.web_vitals_attribution:void 0;return e!=null&&e}get no(){var e=An(this.oo)&&Fo(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:gI;return e>0&&6e4>=e?gI:e}get isEnabled(){var e=pr?.protocol;if(e!=="http:"&&e!=="https:")return Zs.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=An(this.oo)?this.oo.web_vitals:Ri(this.oo)?this.oo:void 0;return Ri(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(Zs.info("enabled, starting..."),this.ur(this.so))}onRemoteConfig(e){if("capturePerformance"in e){var t=An(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=An(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[M1]:t}),this._instance.persistence.register({[k1]:n})),this.$s=t,this.startIfEnabled()}}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Zs.error("failed to load script",r):e()}))}io(){var e=me?me.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Qc,...t||[]]:[];return af(e,n,lf)}Zs.error("Could not determine current URL")}}},Wre={exceptionObserver:class{constructor(e){var t,n,r;this.so=()=>{var o;if(me&&this.isEnabled&&(o=We.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=We.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,l=We.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,c=We.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=s(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=l(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=c(this.captureException.bind(this)))}catch(d){gd.error("failed to start",d),this.ho()}}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[A1]),this.do=new cne({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,Gt:gd}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return An(e)?t=Ne({},t,e):(ze(e)?this.co:e)&&(t=Ne({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(gd.info("enabled"),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return gd.error("failed to load script",r);e()}))}ho(){var e,t,n;(e=this.ao)==null||e.call(this),this.ao=void 0,(t=this.lo)==null||t.call(this),this.lo=void 0,(n=this.uo)==null||n.call(this),this.uo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[A1]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,n,r,o=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.do.consumeRateLimit(o)?gd.info("Skipping exception capture because of client rate limiting.",{exception:o}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.fo=[],this.po=new Sne([new Ine,new zne,new Mne,new Pne,new $ne,new Lne,new kne,new jne],(function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;o>l;l++)s[l-1]=arguments[l];return function(c,d){d===void 0&&(d=0);for(var f=[],p=c.split(`
|
|
156
|
-
`),h=d;p.length>h;h++){var g=p[h];if(1024>=g.length){var v=LA.test(g)?g.replace(LA,"$1"):g;if(!v.match(/\S*Error: /)){for(var _ of s){var b=_(v,r);if(b){f.push(b);break}}if(f.length>=50)break}}}return(function(x){if(!x.length)return[];var S=Array.from(x);return S.reverse(),S.slice(0,50).map((E=>{return Ne({},E,{filename:E.filename||(T=S,T[T.length-1]||{}).filename,function:E.function||Wc});var T}))})(f)}})("web:javascript",One,Ane)),this._instance=e,this.fo=(t=(n=this._instance.persistence)==null?void 0:n.get_property(I1))!==null&&t!==void 0?t:[],this.mo=lg(this.yo()),this.bo=new Fne(this.mo)}onConfigChange(){this.mo=lg(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var o=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.fo=o,this._instance.persistence&&this._instance.persistence.register({[I1]:this.fo,[P1]:s})}}get _o(){var e,t=!!this._instance.get_property(P1),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!_n(e)||e.trim().length===0)return void es.warn("Ignoring exception step because message must be a non-empty string");var n=this.wo(t),{sanitizedProperties:r,droppedKeys:o}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};var l=[];return{sanitizedProperties:Object.keys(s).reduce(((c,d)=>Une.has(d)?(l.push(d),c):(c[d]=s[d],c)),{}),droppedKeys:l}})(n);o.length>0&&es.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this.bo.add(Ne({[sg]:e,[ag]:new Date().toISOString()},r))}catch(s){es.error("Failed to add exception step. Ignoring breadcrumb.",s)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Io(t)){if(this.Co(t))return this.So("Exception dropped: matched a suppression rule"),void es.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.xo(t))return this.So("Exception dropped: thrown by a browser extension"),void es.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ko(t))return this.So("Exception dropped: thrown by the PostHog SDK"),void es.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.mo.enabled&&xt(e.$exception_steps)?this.To(e):e;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return r&&this.bo.clear(),r}catch(o){return es.error("Failed to capture exception event. Dropping this exception.",o),void this.bo.clear()}}catch(o){return void es.error("Failed to process exception event. Ignoring this exception.",o)}}To(e){try{var t=this.bo.getAttachable();return t.length===0?e:Ne({},e,{$exception_steps:t})}catch(n){return es.error("Failed to read buffered exception steps. Capturing exception without steps.",n),e}}So(e){this.mo.enabled&&this.bo.add({[sg]:e,[ag]:new Date().toISOString()})}wo(e){return An(e)?Ne({},e):{}}yo(){var e,t;return(e=(t=this._instance.config.error_tracking)==null?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}Co(e){if(e.length===0)return!1;var t=e.reduce(((n,r)=>{var{type:o,value:s}=r;return _n(o)&&o.length>0&&n.$exception_types.push(o),_n(s)&&s.length>0&&n.$exception_values.push(s),n}),{$exception_types:[],$exception_values:[]});return this.fo.some((n=>{var r=n.values.map((o=>{var s,l=r6[o.operator],c=Mt(o.value)?o.value:[o.value],d=(s=t[o.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,d)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}xo(e){return e.flatMap((t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ko(e){if(e.length>0){var t,n,r,o,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],l=s[s.length-1];return(r=l==null||(o=l.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Io(e){return!xt(e)&&Mt(e)}}},Qre=Ne({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Ao=null,this.Eo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ni&&this.ni.register({[N1]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ao||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(N1)||this.ur((()=>this.Ro()))}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?bI.error("Could not load product tours script",r):e()}))}Ro(){var e;!this.Ao&&(e=We.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ao=We.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Mt(this.Eo)||t){var n=this.ni;if(n){var r=n.props[Tm];if(Mt(r)&&!t)return this.Eo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:o=>{var s=o.statusCode;if(s!==200||!o.json){var l="Product Tours API could not be loaded, status: "+s;return bI.error(l),void e([],{isLoaded:!1,error:l})}var c=Mt(o.json.product_tours)?o.json.product_tours:[];this.Eo=c,n&&n.register({[Tm]:c}),e(c,{isLoaded:!0})}})}else e(this.Eo,{isLoaded:!0})}getActiveProductTours(e){xt(this.Ao)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ao.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ao)==null||t.showTourById(e)}previewTour(e){this.Ao?this.Ao.previewTour(e):this.ur((()=>{var t;this.Ro(),(t=this.Ao)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ao)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ao)==null||e.nextStep()}previousStep(){var e;(e=this.Ao)==null||e.previousStep()}clearCache(){var e;this.Eo=null,(e=this.ni)==null||e.unregister(Tm)}resetTour(e){var t;(t=this.Ao)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Ao)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ao)==null||t.cancelPendingTour(e)}}},lv),Xre={siteApps:class{constructor(e){this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mo(e,t){if(t){var n=this.globalsForEvent(t);this.No.push(n),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return(e=We._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Mo.bind(this));this.Fo=()=>{e(),this.No=[],this.Fo=void 0}}}globalsForEvent(e){var t,n,r,o,s,l,c;if(!e)throw new Error("Event payload is required");var d={},f=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(p))d[h]={id:f[h],type:h,properties:g};var{$set_once:v,$set:_}=e;return{event:Ne({},o5(e,Bre),{properties:Ne({},e.properties,_?{$set:Ne({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},_)}:{},v?{$set_once:Ne({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},v)}:{}),elements_chain:(s=(l=e.properties)==null?void 0:l.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(c=e.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var l;!t.errored&&this.No.length&&(Ws.info("Processing "+this.No.length+" events for site app with id "+e.id),this.No.forEach((c=>t.processEvent==null?void 0:t.processEvent(c))),t.processedBuffer=!0),Object.values(this.apps).every((c=>c.processedBuffer||c.errored))&&((l=this.Fo)==null||l.call(this))},r=!1,o=l=>{t.errored=!l,t.loaded=!0,Ws.info("Site app with id "+e.id+" "+(l?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(l){o(l)}});s&&(t.processEvent=s),r=!0}catch(l){Ws.error(wI+e.id,l),o(!1)}if(r&&t.loaded)try{n()}catch(l){Ws.error("Error while processing buffered events PostHog app with config id "+e.id,l),t.errored=!0}}Oo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Po(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){Ws.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Oo(),void this._instance.on("eventCaptured",(d=>this.Po(d)))):void Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Fo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(d){var f;We["__$$ph_site_app_"+d]=o._instance,(f=We.__PosthogExtensions__)==null||f.loadSiteApp==null||f.loadSiteApp(o._instance,c,(p=>{if(p)return Ws.error(wI+d,p)}))};for(var{id:l,url:c}of e.siteApps)s(l)}else Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Jre={tracingHeaders:class{constructor(e){this.Lo=void 0,this.Do=void 0,this.so=()=>{var t,n,r=this.Bo()||[];ze(this.Lo)&&((t=We.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),ze(this.Do)&&((n=We.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return Ure.error("failed to load script",r);e()}))}Bo(){var e;return(e=this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Bo()?this.ur(this.so):((e=this.Lo)==null||e.call(this),(t=this.Do)==null||t.call(this),this.Lo=void 0,this.Do=void 0)}}},eoe=Ne({surveys:class{get Bt(){return this._instance.config}constructor(e){this.jo=void 0,this._surveyManager=null,this.$o=!1,this.qo=[],this.Zo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Bt.disable_surveys){var t=e.surveys;if(xt(t))return Xt.warn("Flags not loaded yet. Not loading surveys.");var n=Mt(t);this.jo=n?t.length>0:t,Xt.info("flags response received, isSurveysEnabled: "+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(J1)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.$o)Xt.info("Already initializing surveys, skipping...");else if(this.Bt.disable_surveys)Xt.info(SI);else if(this.Bt.cookieless_mode&&this._instance.consent.isOptedOut())Xt.info("Not loading surveys in cookieless mode without consent.");else{var e=We?.__PosthogExtensions__;if(e){if(!ze(this.jo)||this.Bt.advanced_enable_surveys){var t=this.jo||this.Bt.advanced_enable_surveys;this.$o=!0;try{var n=e.generateSurveys;if(n)return void this.Vo(n,t);var r=e.loadExternalDependency;if(!r)return void this.Ho(ZS);r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.Ho("Could not load surveys script",o):this.Vo(e.generateSurveys,t)}))}catch(o){throw this.Ho("Error initializing surveys",o),o}finally{this.$o=!1}}}else Xt.error("PostHog Extensions not found.")}}Vo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Hre(this._instance),Xt.info("Surveys loaded successfully"),this.zo({isLoaded:!0})}Ho(e,t){Xt.error(e,t),this.zo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.qo.push(e),this._surveyManager&&this.zo({isLoaded:!0}),()=>{this.qo=this.qo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Bt.disable_surveys)return Xt.info(SI),e([]);var n,r=this._instance.get_property(j1);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.Zo?this.Zo.then((o=>{var{surveys:s,context:l}=o;return e(s,l)})):(typeof Promise<"u"&&(this.Zo=new Promise((o=>{n=o}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Bt.token),method:"GET",timeout:this.Bt.surveys_request_timeout_ms,callback:o=>{var s;this.Zo=null;var l=o.statusCode;if(l!==200||!o.json){var c="Surveys API could not be loaded, status: "+l;Xt.error(c);var d={isLoaded:!1,error:c};return e([],d),void(n==null||n({surveys:[],context:d}))}var f,p=o.json.surveys||[],h=p.filter((v=>(function(_){return!(!_.start_date||_.end_date)})(v)&&((function(_){var b;return!((b=_.conditions)==null||(b=b.events)==null||(b=b.values)==null||!b.length)})(v)||(function(_){var b;return!((b=_.conditions)==null||(b=b.actions)==null||(b=b.values)==null||!b.length)})(v))));h.length>0&&((f=this._surveyEventReceiver)==null||f.register(h)),(s=this._instance.persistence)==null||s.register({[j1]:p});var g={isLoaded:!0};e(p,g),n?.({surveys:p,context:g})}}))}zo(e){for(var t of this.qo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){Xt.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!xt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Xt.warn("init was not called")}Uo(e){var t=null;return this.getSurveys((n=>{var r;t=(r=n.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),t}Yo(e){if(xt(this._surveyManager))return{eligible:!1,reason:hb};var t=typeof e=="string"?this.Uo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(xt(this._surveyManager))return Xt.warn("init was not called"),{visible:!1,disabledReason:hb};var t=this.Yo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return xt(this._surveyManager)?(Xt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:hb})):new Promise((n=>{this.getSurveys((r=>{var o,s=(o=r.find((c=>c.id===e)))!==null&&o!==void 0?o:null;if(s){var l=this.Yo(s);n({visible:l.eligible,disabledReason:l.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,n){var r;if(xt(this._surveyManager))Xt.warn("init was not called");else{var o=typeof e=="string"?this.Uo(e):e;if(o!=null&&o.id)if(Rre.includes(o.type)){var s=Le?.querySelector(t);if(s)return(r=o.appearance)!=null&&r.surveyPopupDelaySeconds?(Xt.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,c;Xt.info("Rendering survey "+o.id+" with delay of "+((l=o.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(o,s,n),Xt.info("Survey "+o.id+" rendered")}),1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,s,n);Xt.warn("Survey element not found")}else Xt.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Xt.warn("Survey not found")}}displaySurvey(e,t){var n;if(xt(this._surveyManager))Xt.warn("init was not called");else{var r=this.Uo(e);if(r){var o=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=Ne({},r,{appearance:Ne({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==K1.Popover&&t.initialResponses&&Xt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var s=this.canRenderSurvey(r);if(!s.visible)return void Xt.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==K1.Inline?this._surveyManager.handlePopoverSurvey(o,t):this.renderSurvey(o,t.selector,t.properties)}else Xt.warn("Survey not found")}}cancelPendingSurvey(e){xt(this._surveyManager)?Xt.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},lv),toe={toolbar:class{constructor(e){this.instance=e}Go(e){We.ph_toolbar_state=e}Wo(){var e;return(e=We.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),j5(this.instance.config)||!me||!Le)return!1;e=e??me.location,n=n??me.history;try{if(!t){try{me.localStorage.setItem("test","test"),me.localStorage.removeItem("test")}catch{return!1}t=me?.localStorage}var r,o=Gre||_g(e.hash,"__posthog")||_g(e.hash,"state"),s=o?jA((()=>JSON.parse(atob(decodeURIComponent(o)))))||jA((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(EI)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Xo(e){var t=We.ph_load_toolbar||We.ph_load_editor;!xt(t)&&is(t)?t(e,this.instance):xI.warn("No toolbar load function found")}loadToolbar(e){var t=!(Le==null||!Le.getElementById(k5));if(!me||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Ne({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(me.localStorage.setItem(EI,JSON.stringify(Ne({},r,{source:void 0}))),this.Wo()===2)this.Xo(r);else if(this.Wo()===0){var o;this.Go(1),(o=We.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return xI.error("[Toolbar] Failed to load",s),void this.Go(0);this.Go(2),this.Xo(r)})),Vn(me,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(r)}))}return!0}Jo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},noe=Ne({experiments:Rr},lv),roe={conversations:class{constructor(e){this.Ko=void 0,this._conversationsManager=null,this.Qo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;xt(t)||(Ri(t)?this.Ko=t:(this.Ko=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ko=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Qo||this._instance.config.disable_conversations||j5(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=We?.__PosthogExtensions__;if(e&&!ze(this.Ko)&&this.Ko)if(this.ea&&this.ea.token){this.Qo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Qo=!1);var n=e.loadExternalDependency;if(!n)return void this.ra(ZS);n(this._instance,"conversations",(r=>{r||!e.initConversations?this.ra("Could not load conversations script",r):this.ta(e.initConversations),this.Qo=!1}))}catch(r){this.ra("Error initializing conversations",r),this.Qo=!1}}else ko.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),ko.info("Conversations loaded successfully")}catch(t){this.ra("Error completing conversations initialization",t)}else ko.error("Cannot complete initialization: remote config is null")}ra(e,t){ko.error(e,t),this._conversationsManager=null,this.Qo=!1}show(){this._conversationsManager?this._conversationsManager.show():ko.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ko===!0&&!ys(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return Lo((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(ko.warn(Ga),null)}))()}getMessages(e,t){var n=this;return Lo((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(ko.warn(Ga),null)}))()}markAsRead(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ko.warn(Ga),null)}))()}getTickets(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ko.warn(Ga),null)}))()}requestRestoreLink(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ko.warn(Ga),null)}))()}restoreFromToken(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ko.warn(Ga),null)}))()}restoreFromUrlToken(){var e=this;return Lo((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ko.warn(Ga),null)}))()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}un(){var e;(e=this._conversationsManager)==null||e.setIdentity()}hn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},ooe={logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=mn("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.la=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!xt(n)&&n&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.oa=0,this.aa=0,this.la=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=We?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(n=>{var r;n||(r=e.logs)==null||!r.initializeLogs?this.Gt.error("Could not load logs script",n):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(ZS)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,n,r,o,s,l;if(this._instance.is_capturing())if(e&&e.body){var c=(t=(n=this._instance.config.logs)==null?void 0:n.flushIntervalMs)!==null&&t!==void 0?t:3e3,d=(r=(o=this._instance.config.logs)==null?void 0:o.maxLogsPerInterval)!==null&&r!==void 0?r:1e3,f=Date.now();if(c>f-this.aa||(this.aa=f,this.oa=0,this.la=!1),d>this.oa){this.oa++;var p=(function(h,g){var v=h.level||"info",{text:_,number:b}=x5[v]||bne,x=String(Date.now())+"000000",S={};g.distinctId&&(S.posthogDistinctId=g.distinctId),g.sessionId&&(S.sessionId=g.sessionId),g.currentUrl&&(S["url.full"]=g.currentUrl),g.screenName&&(S["screen.name"]=g.screenName),g.appState&&(S["app.state"]=g.appState),g.activeFeatureFlags&&g.activeFeatureFlags.length>0&&(S.feature_flags=g.activeFeatureFlags);var E=Ne({},S,h.attributes||{}),T={timeUnixNano:x,observedTimeUnixNano:x,severityNumber:b,severityText:_,body:{stringValue:h.body},attributes:DA(E)};return h.trace_id&&(T.traceId=h.trace_id),h.span_id&&(T.spanId=h.span_id),ze(h.trace_flags)||(T.flags=h.trace_flags),T})(e,this.ua());this.sa.push({record:p}),((s=(l=this._instance.config.logs)==null?void 0:l.maxBufferSize)!==null&&s!==void 0?s:100)>this.sa.length?this.ha():this.flushLogs()}else this.la||(this.Gt.warn("captureLog dropping logs: exceeded "+d+" logs per "+c+"ms"),this.la=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ca}flushLogs(e){if(this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.sa.length!==0){var t=this.sa;this.sa=[];var n=this._instance.config.logs,r=Ne({"service.name":n?.serviceName||"unknown_service"},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),o=(function(l,c,d,f){return{resourceLogs:[{resource:{attributes:DA(c)},scopeLogs:[{scope:{name:d,version:f},logRecords:l}]}]}})(t.map((l=>l.record)),r,$r.LIB_NAME,$r.LIB_VERSION),s=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Vi({method:"POST",url:s,data:o,compression:"best-available",batchKey:"logs",transport:e})}}ha(){var e,t;this.jr||(this.jr=setTimeout((()=>{this.jr=void 0,this.flushLogs()}),(e=(t=this._instance.config.logs)==null?void 0:t.flushIntervalMs)!==null&&e!==void 0?e:3e3))}ua(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(We!=null&&(e=We.location)!=null&&e.href&&(t.currentUrl=We.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}},ioe=Ne({},lv,Zre,Yre,Wre,Qre,Xre,eoe,Jre,toe,noe,roe,ooe);$o.__defaultExtensionClasses=Ne({},ioe);var CI,_l=(CI=Ud[Rc]=new $o,(function(){function e(){e.done||(e.done=!0,s6=!1,dn(Ud,(function(t){t._dom_loaded()})))}Le!=null&&Le.addEventListener?Le.readyState==="complete"?e():Vn(Le,"DOMContentLoaded",e,{capture:!1}):me&&$e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),CI);const soe={from({org:e,project:t}){return`${e}/${t}`},parse(e){e.startsWith("/")&&(e=e.slice(1));const[t,n]=e.split("/");if(!t||!n)throw new Error("Invalid locator");return{org:t,project:n}}},m6=P.createContext(void 0),aoe=()=>{const e=P.useContext(m6);if(!e)throw new Error("useProjectContext must be used within a ProjectContextProvider");return e},aue=()=>aoe().org,lue=e=>{const t=Hn.c(10),{children:n,org:r,project:o}=e;let s;t[0]!==r.id||t[1]!==o.id?(s=soe.from({org:r.id,project:o.id}),t[0]=r.id,t[1]=o.id,t[2]=s):s=t[2];const l=s;let c;t[3]!==l||t[4]!==r||t[5]!==o?(c={org:r,project:o,locator:l},t[3]=l,t[4]=r,t[5]=o,t[6]=c):c=t[6];const d=c;let f;return t[7]!==n||t[8]!==d?(f=C.jsx(m6.Provider,{value:d,children:n}),t[7]=n,t[8]=d,t[9]=f):f=t[9],f},cv={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n,r)=>["mcp","client",e,t,n,r],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpUiResourceHtml:(e,t,n)=>["mcp","ui-resource-html",e,t,n],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],virtualMcpLastUsed:(e,t)=>["virtual-mcp","last-used",e,t],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,r,o)=>[e,t,n,"collection",r,o],collectionList:(e,t,n,r,o)=>[e,t,n,"collection",r,"list",o],collectionListInfinite:(e,t,n,r,o)=>[e,t,n,"collection",r,"list-infinite",o],githubReadme:(e,t)=>["github-readme",e,t],githubBranches:(e,t,n,r,o)=>["github-branches",e,t,n,r,o],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e],registryApp:(e,t)=>["registry-app",e,t]},loe="2025-11-25",cue=[loe,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],coe="io.modelcontextprotocol/related-task",uv="2.0",Jn=SV(e=>e!==null&&(typeof e=="object"||typeof e=="function")),g6=nn([$(),dt().int()]),v6=$();vr({ttl:dt().optional(),pollInterval:dt().optional()});const uoe=be({ttl:dt().optional()}),doe=be({taskId:$()}),tE=vr({progressToken:g6.optional(),[coe]:doe.optional()}),wo=be({_meta:tE.optional()}),Of=wo.extend({task:uoe.optional()}),uue=e=>Of.safeParse(e).success,_r=be({method:$(),params:wo.loose().optional()}),Vo=be({_meta:tE.optional()}),qo=be({method:$(),params:Vo.loose().optional()}),br=vr({_meta:tE.optional()}),dv=nn([$(),dt().int()]),y6=be({jsonrpc:Ge(uv),id:dv,..._r.shape}).strict(),due=e=>y6.safeParse(e).success,_6=be({jsonrpc:Ge(uv),...qo.shape}).strict(),fue=e=>_6.safeParse(e).success,nE=be({jsonrpc:Ge(uv),id:dv,result:br}).strict(),hue=e=>nE.safeParse(e).success;var uf;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(uf||(uf={}));const rE=be({jsonrpc:Ge(uv),id:dv.optional(),error:be({code:dt().int(),message:$(),data:Gt().optional()})}).strict(),pue=e=>rE.safeParse(e).success,mue=nn([y6,_6,nE,rE]);nn([nE,rE]);const b6=br.strict(),foe=Vo.extend({requestId:dv.optional(),reason:$().optional()}),w6=qo.extend({method:Ge("notifications/cancelled"),params:foe}),hoe=be({src:$(),mimeType:$().optional(),sizes:Re($()).optional(),theme:rn(["light","dark"]).optional()}),Tf=be({icons:Re(hoe).optional()}),Jc=be({name:$(),title:$().optional()}),S6=Jc.extend({...Jc.shape,...Tf.shape,version:$(),websiteUrl:$().optional(),description:$().optional()}),poe=Hw(be({applyDefaults:Nt().optional()}),Pt($(),Gt())),moe=Kw(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Hw(be({form:poe.optional(),url:Jn.optional()}),Pt($(),Gt()).optional())),goe=vr({list:Jn.optional(),cancel:Jn.optional(),requests:vr({sampling:vr({createMessage:Jn.optional()}).optional(),elicitation:vr({create:Jn.optional()}).optional()}).optional()}),voe=vr({list:Jn.optional(),cancel:Jn.optional(),requests:vr({tools:vr({call:Jn.optional()}).optional()}).optional()}),yoe=be({experimental:Pt($(),Jn).optional(),sampling:be({context:Jn.optional(),tools:Jn.optional()}).optional(),elicitation:moe.optional(),roots:be({listChanged:Nt().optional()}).optional(),tasks:goe.optional(),extensions:Pt($(),Jn).optional()}),_oe=wo.extend({protocolVersion:$(),capabilities:yoe,clientInfo:S6}),boe=_r.extend({method:Ge("initialize"),params:_oe}),woe=be({experimental:Pt($(),Jn).optional(),logging:Jn.optional(),completions:Jn.optional(),prompts:be({listChanged:Nt().optional()}).optional(),resources:be({subscribe:Nt().optional(),listChanged:Nt().optional()}).optional(),tools:be({listChanged:Nt().optional()}).optional(),tasks:voe.optional(),extensions:Pt($(),Jn).optional()}),Soe=br.extend({protocolVersion:$(),capabilities:woe,serverInfo:S6,instructions:$().optional()}),E6=qo.extend({method:Ge("notifications/initialized"),params:Vo.optional()}),gue=e=>E6.safeParse(e).success,x6=_r.extend({method:Ge("ping"),params:wo.optional()}),Eoe=be({progress:dt(),total:bn(dt()),message:bn($())}),xoe=be({...Vo.shape,...Eoe.shape,progressToken:g6}),R6=qo.extend({method:Ge("notifications/progress"),params:xoe}),Roe=wo.extend({cursor:v6.optional()}),Cf=_r.extend({params:Roe.optional()}),Af=br.extend({nextCursor:v6.optional()}),Ooe=rn(["working","input_required","completed","failed","cancelled"]),If=be({taskId:$(),status:Ooe,ttl:nn([dt(),YB()]),createdAt:$(),lastUpdatedAt:$(),pollInterval:bn(dt()),statusMessage:bn($())}),O6=br.extend({task:If}),Toe=Vo.merge(If),T6=qo.extend({method:Ge("notifications/tasks/status"),params:Toe}),C6=_r.extend({method:Ge("tasks/get"),params:wo.extend({taskId:$()})}),A6=br.merge(If),I6=_r.extend({method:Ge("tasks/result"),params:wo.extend({taskId:$()})});br.loose();const P6=Cf.extend({method:Ge("tasks/list")}),M6=Af.extend({tasks:Re(If)}),N6=_r.extend({method:Ge("tasks/cancel"),params:wo.extend({taskId:$()})}),vue=br.merge(If),k6=be({uri:$(),mimeType:bn($()),_meta:Pt($(),Gt()).optional()}),D6=k6.extend({text:$()}),oE=$().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),L6=k6.extend({blob:oE}),Pf=rn(["user","assistant"]),iu=be({audience:Re(Pf).optional(),priority:dt().min(0).max(1).optional(),lastModified:K3({offset:!0}).optional()}),$6=be({...Jc.shape,...Tf.shape,uri:$(),description:bn($()),mimeType:bn($()),size:bn(dt()),annotations:iu.optional(),_meta:bn(vr({}))}),Coe=be({...Jc.shape,...Tf.shape,uriTemplate:$(),description:bn($()),mimeType:bn($()),annotations:iu.optional(),_meta:bn(vr({}))}),Aoe=Cf.extend({method:Ge("resources/list")}),Ioe=Af.extend({resources:Re($6)}),Poe=Cf.extend({method:Ge("resources/templates/list")}),Moe=Af.extend({resourceTemplates:Re(Coe)}),iE=wo.extend({uri:$()}),Noe=iE,koe=_r.extend({method:Ge("resources/read"),params:Noe}),Doe=br.extend({contents:Re(nn([D6,L6]))}),Loe=qo.extend({method:Ge("notifications/resources/list_changed"),params:Vo.optional()}),$oe=iE,joe=_r.extend({method:Ge("resources/subscribe"),params:$oe}),zoe=iE,Uoe=_r.extend({method:Ge("resources/unsubscribe"),params:zoe}),Foe=Vo.extend({uri:$()}),Boe=qo.extend({method:Ge("notifications/resources/updated"),params:Foe}),Voe=be({name:$(),description:bn($()),required:bn(Nt())}),qoe=be({...Jc.shape,...Tf.shape,description:bn($()),arguments:bn(Re(Voe)),_meta:bn(vr({}))}),Hoe=Cf.extend({method:Ge("prompts/list")}),Goe=Af.extend({prompts:Re(qoe)}),Koe=wo.extend({name:$(),arguments:Pt($(),$()).optional()}),Zoe=_r.extend({method:Ge("prompts/get"),params:Koe}),sE=be({type:Ge("text"),text:$(),annotations:iu.optional(),_meta:Pt($(),Gt()).optional()}),aE=be({type:Ge("image"),data:oE,mimeType:$(),annotations:iu.optional(),_meta:Pt($(),Gt()).optional()}),lE=be({type:Ge("audio"),data:oE,mimeType:$(),annotations:iu.optional(),_meta:Pt($(),Gt()).optional()}),Yoe=be({type:Ge("tool_use"),name:$(),id:$(),input:Pt($(),Gt()),_meta:Pt($(),Gt()).optional()}),Woe=be({type:Ge("resource"),resource:nn([D6,L6]),annotations:iu.optional(),_meta:Pt($(),Gt()).optional()}),Qoe=$6.extend({type:Ge("resource_link")}),cE=nn([sE,aE,lE,Qoe,Woe]),Xoe=be({role:Pf,content:cE}),Joe=br.extend({description:$().optional(),messages:Re(Xoe)}),eie=qo.extend({method:Ge("notifications/prompts/list_changed"),params:Vo.optional()}),tie=be({title:$().optional(),readOnlyHint:Nt().optional(),destructiveHint:Nt().optional(),idempotentHint:Nt().optional(),openWorldHint:Nt().optional()}),nie=be({taskSupport:rn(["required","optional","forbidden"]).optional()}),uE=be({...Jc.shape,...Tf.shape,description:$().optional(),inputSchema:be({type:Ge("object"),properties:Pt($(),Jn).optional(),required:Re($()).optional()}).catchall(Gt()),outputSchema:be({type:Ge("object"),properties:Pt($(),Jn).optional(),required:Re($()).optional()}).catchall(Gt()).optional(),annotations:tie.optional(),execution:nie.optional(),_meta:Pt($(),Gt()).optional()}),rie=Cf.extend({method:Ge("tools/list")}),oie=Af.extend({tools:Re(uE)}),j6=br.extend({content:Re(cE).default([]),structuredContent:Pt($(),Gt()).optional(),isError:Nt().optional()});j6.or(br.extend({toolResult:Gt()}));const iie=Of.extend({name:$(),arguments:Pt($(),Gt()).optional()}),sie=_r.extend({method:Ge("tools/call"),params:iie}),aie=qo.extend({method:Ge("notifications/tools/list_changed"),params:Vo.optional()}),yue=be({autoRefresh:Nt().default(!0),debounceMs:dt().int().nonnegative().default(300)}),z6=rn(["debug","info","notice","warning","error","critical","alert","emergency"]),lie=wo.extend({level:z6}),cie=_r.extend({method:Ge("logging/setLevel"),params:lie}),uie=Vo.extend({level:z6,logger:$().optional(),data:Gt()}),die=qo.extend({method:Ge("notifications/message"),params:uie}),fie=be({name:$().optional()}),hie=be({hints:Re(fie).optional(),costPriority:dt().min(0).max(1).optional(),speedPriority:dt().min(0).max(1).optional(),intelligencePriority:dt().min(0).max(1).optional()}),pie=be({mode:rn(["auto","required","none"]).optional()}),mie=be({type:Ge("tool_result"),toolUseId:$().describe("The unique identifier for the corresponding tool call."),content:Re(cE).default([]),structuredContent:be({}).loose().optional(),isError:Nt().optional(),_meta:Pt($(),Gt()).optional()}),gie=qw("type",[sE,aE,lE]),xg=qw("type",[sE,aE,lE,Yoe,mie]),vie=be({role:Pf,content:nn([xg,Re(xg)]),_meta:Pt($(),Gt()).optional()}),yie=Of.extend({messages:Re(vie),modelPreferences:hie.optional(),systemPrompt:$().optional(),includeContext:rn(["none","thisServer","allServers"]).optional(),temperature:dt().optional(),maxTokens:dt().int(),stopSequences:Re($()).optional(),metadata:Jn.optional(),tools:Re(uE).optional(),toolChoice:pie.optional()}),_ie=_r.extend({method:Ge("sampling/createMessage"),params:yie}),bie=br.extend({model:$(),stopReason:bn(rn(["endTurn","stopSequence","maxTokens"]).or($())),role:Pf,content:gie}),wie=br.extend({model:$(),stopReason:bn(rn(["endTurn","stopSequence","maxTokens","toolUse"]).or($())),role:Pf,content:nn([xg,Re(xg)])}),Sie=be({type:Ge("boolean"),title:$().optional(),description:$().optional(),default:Nt().optional()}),Eie=be({type:Ge("string"),title:$().optional(),description:$().optional(),minLength:dt().optional(),maxLength:dt().optional(),format:rn(["email","uri","date","date-time"]).optional(),default:$().optional()}),xie=be({type:rn(["number","integer"]),title:$().optional(),description:$().optional(),minimum:dt().optional(),maximum:dt().optional(),default:dt().optional()}),Rie=be({type:Ge("string"),title:$().optional(),description:$().optional(),enum:Re($()),default:$().optional()}),Oie=be({type:Ge("string"),title:$().optional(),description:$().optional(),oneOf:Re(be({const:$(),title:$()})),default:$().optional()}),Tie=be({type:Ge("string"),title:$().optional(),description:$().optional(),enum:Re($()),enumNames:Re($()).optional(),default:$().optional()}),Cie=nn([Rie,Oie]),Aie=be({type:Ge("array"),title:$().optional(),description:$().optional(),minItems:dt().optional(),maxItems:dt().optional(),items:be({type:Ge("string"),enum:Re($())}),default:Re($()).optional()}),Iie=be({type:Ge("array"),title:$().optional(),description:$().optional(),minItems:dt().optional(),maxItems:dt().optional(),items:be({anyOf:Re(be({const:$(),title:$()}))}),default:Re($()).optional()}),Pie=nn([Aie,Iie]),Mie=nn([Tie,Cie,Pie]),Nie=nn([Mie,Sie,Eie,xie]),kie=Of.extend({mode:Ge("form").optional(),message:$(),requestedSchema:be({type:Ge("object"),properties:Pt($(),Nie),required:Re($()).optional()})}),Die=Of.extend({mode:Ge("url"),message:$(),elicitationId:$(),url:$().url()}),Lie=nn([kie,Die]),$ie=_r.extend({method:Ge("elicitation/create"),params:Lie}),jie=Vo.extend({elicitationId:$()}),zie=qo.extend({method:Ge("notifications/elicitation/complete"),params:jie}),Uie=br.extend({action:rn(["accept","decline","cancel"]),content:Kw(e=>e===null?void 0:e,Pt($(),nn([$(),dt(),Nt(),Re($())])).optional())}),Fie=be({type:Ge("ref/resource"),uri:$()}),Bie=be({type:Ge("ref/prompt"),name:$()}),Vie=wo.extend({ref:nn([Bie,Fie]),argument:be({name:$(),value:$()}),context:be({arguments:Pt($(),$()).optional()}).optional()}),qie=_r.extend({method:Ge("completion/complete"),params:Vie}),Hie=br.extend({completion:vr({values:Re($()).max(100),total:bn(dt().int()),hasMore:bn(Nt())})}),Gie=be({uri:$().startsWith("file://"),name:$().optional(),_meta:Pt($(),Gt()).optional()}),Kie=_r.extend({method:Ge("roots/list"),params:wo.optional()}),Zie=br.extend({roots:Re(Gie)}),Yie=qo.extend({method:Ge("notifications/roots/list_changed"),params:Vo.optional()});nn([x6,boe,qie,cie,Zoe,Hoe,Aoe,Poe,koe,joe,Uoe,sie,rie,C6,I6,P6,N6]);nn([w6,R6,E6,Yie,T6]);nn([b6,bie,wie,Uie,Zie,A6,M6,O6]);nn([x6,_ie,$ie,Kie,C6,I6,P6,N6]);nn([w6,R6,die,Boe,Loe,aie,eie,T6,zie]);nn([b6,Soe,Hie,Joe,Goe,Ioe,Moe,Doe,j6,oie,A6,M6,O6]);class fv extends Error{constructor(t,n,r){super(`MCP error ${t}: ${n}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,n,r){if(t===uf.UrlElicitationRequired&&r){const o=r;if(o.elicitations)return new Wie(o.elicitations,n)}return new fv(t,n,r)}}class Wie extends fv{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(uf.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Cp={exports:{}},mb={},ts={},Ka={},gb={},vb={},yb={},AI;function Rg(){return AI||(AI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(E){if(super(),!e.IDENTIFIER.test(E))throw new Error("CodeGen: name must be a valid identifier");this.str=E}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(E){super(),this._items=typeof E=="string"?[E]:E}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const E=this._items[0];return E===""||E==='""'}get str(){var E;return(E=this._str)!==null&&E!==void 0?E:this._str=this._items.reduce((T,R)=>`${T}${R}`,"")}get names(){var E;return(E=this._names)!==null&&E!==void 0?E:this._names=this._items.reduce((T,R)=>(R instanceof n&&(T[R.str]=(T[R.str]||0)+1),T),{})}}e._Code=r,e.nil=new r("");function o(S,...E){const T=[S[0]];let R=0;for(;R<E.length;)c(T,E[R]),T.push(S[++R]);return new r(T)}e._=o;const s=new r("+");function l(S,...E){const T=[v(S[0])];let R=0;for(;R<E.length;)T.push(s),c(T,E[R]),T.push(s,v(S[++R]));return d(T),new r(T)}e.str=l;function c(S,E){E instanceof r?S.push(...E._items):E instanceof n?S.push(E):S.push(h(E))}e.addCodeArg=c;function d(S){let E=1;for(;E<S.length-1;){if(S[E]===s){const T=f(S[E-1],S[E+1]);if(T!==void 0){S.splice(E-1,3,T);continue}S[E++]="+"}E++}}function f(S,E){if(E==='""')return S;if(S==='""')return E;if(typeof S=="string")return E instanceof n||S[S.length-1]!=='"'?void 0:typeof E!="string"?`${S.slice(0,-1)}${E}"`:E[0]==='"'?S.slice(0,-1)+E.slice(1):void 0;if(typeof E=="string"&&E[0]==='"'&&!(S instanceof n))return`"${S}${E.slice(1)}`}function p(S,E){return E.emptyStr()?S:S.emptyStr()?E:l`${S}${E}`}e.strConcat=p;function h(S){return typeof S=="number"||typeof S=="boolean"||S===null?S:v(Array.isArray(S)?S.join(","):S)}function g(S){return new r(v(S))}e.stringify=g;function v(S){return JSON.stringify(S).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function _(S){return typeof S=="string"&&e.IDENTIFIER.test(S)?new r(`.${S}`):o`[${S}]`}e.getProperty=_;function b(S){if(typeof S=="string"&&e.IDENTIFIER.test(S))return new r(`${S}`);throw new Error(`CodeGen: invalid export name: ${S}, use explicit $id name mapping`)}e.getEsmExportName=b;function x(S){return new r(S.toString())}e.regexpCode=x})(yb)),yb}var _b={},II;function PI(){return II||(II=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Rg();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:f,parent:p}={}){this._names={},this._prefixes=f,this._parent=p}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const p=this._names[f]||this._nameGroup(f);return`${f}${p.index++}`}_nameGroup(f){var p,h;if(!((h=(p=this._parent)===null||p===void 0?void 0:p._prefixes)===null||h===void 0)&&h.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=o;class s extends t.Name{constructor(f,p){super(p),this.prefix=f}setValue(f,{property:p,itemIndex:h}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(p)}[${h}]`}}e.ValueScopeName=s;const l=(0,t._)`\n`;class c extends o{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?l:t.nil}}get(){return this._scope}name(f){return new s(f,this._newName(f))}value(f,p){var h;if(p.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(f),{prefix:v}=g,_=(h=p.key)!==null&&h!==void 0?h:p.ref;let b=this._values[v];if(b){const E=b.get(_);if(E)return E}else b=this._values[v]=new Map;b.set(_,g);const x=this._scope[v]||(this._scope[v]=[]),S=x.length;return x[S]=p.ref,g.setValue(p,{property:v,itemIndex:S}),g}getValue(f,p){const h=this._values[f];if(h)return h.get(p)}scopeRefs(f,p=this._values){return this._reduceValues(p,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${f}${h.scopePath}`})}scopeCode(f=this._values,p,h){return this._reduceValues(f,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},p,h)}_reduceValues(f,p,h={},g){let v=t.nil;for(const _ in f){const b=f[_];if(!b)continue;const x=h[_]=h[_]||new Map;b.forEach(S=>{if(x.has(S))return;x.set(S,r.Started);let E=p(S);if(E){const T=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${T} ${S} = ${E};${this.opts._n}`}else if(E=g?.(S))v=(0,t._)`${v}${E}${this.opts._n}`;else throw new n(S);x.set(S,r.Completed)})}return v}}e.ValueScope=c})(_b)),_b}var MI;function yt(){return MI||(MI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Rg(),n=PI();var r=Rg();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=PI();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(D,U){return this}}class l extends s{constructor(D,U,X){super(),this.varKind=D,this.name=U,this.rhs=X}render({es5:D,_n:U}){const X=D?n.varKinds.var:this.varKind,fe=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${fe};`+U}optimizeNames(D,U){if(D[this.name.str])return this.rhs&&(this.rhs=Z(this.rhs,D,U)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class c extends s{constructor(D,U,X){super(),this.lhs=D,this.rhs=U,this.sideEffects=X}render({_n:D}){return`${this.lhs} = ${this.rhs};`+D}optimizeNames(D,U){if(!(this.lhs instanceof t.Name&&!D[this.lhs.str]&&!this.sideEffects))return this.rhs=Z(this.rhs,D,U),this}get names(){const D=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(D,this.rhs)}}class d extends c{constructor(D,U,X,fe){super(D,X,fe),this.op=U}render({_n:D}){return`${this.lhs} ${this.op}= ${this.rhs};`+D}}class f extends s{constructor(D){super(),this.label=D,this.names={}}render({_n:D}){return`${this.label}:`+D}}class p extends s{constructor(D){super(),this.label=D,this.names={}}render({_n:D}){return`break${this.label?` ${this.label}`:""};`+D}}class h extends s{constructor(D){super(),this.error=D}render({_n:D}){return`throw ${this.error};`+D}get names(){return this.error.names}}class g extends s{constructor(D){super(),this.code=D}render({_n:D}){return`${this.code};`+D}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(D,U){return this.code=Z(this.code,D,U),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends s{constructor(D=[]){super(),this.nodes=D}render(D){return this.nodes.reduce((U,X)=>U+X.render(D),"")}optimizeNodes(){const{nodes:D}=this;let U=D.length;for(;U--;){const X=D[U].optimizeNodes();Array.isArray(X)?D.splice(U,1,...X):X?D[U]=X:D.splice(U,1)}return D.length>0?this:void 0}optimizeNames(D,U){const{nodes:X}=this;let fe=X.length;for(;fe--;){const pe=X[fe];pe.optimizeNames(D,U)||(ie(D,pe.names),X.splice(fe,1))}return X.length>0?this:void 0}get names(){return this.nodes.reduce((D,U)=>B(D,U.names),{})}}class _ extends v{render(D){return"{"+D._n+super.render(D)+"}"+D._n}}class b extends v{}class x extends _{}x.kind="else";class S extends _{constructor(D,U){super(U),this.condition=D}render(D){let U=`if(${this.condition})`+super.render(D);return this.else&&(U+="else "+this.else.render(D)),U}optimizeNodes(){super.optimizeNodes();const D=this.condition;if(D===!0)return this.nodes;let U=this.else;if(U){const X=U.optimizeNodes();U=this.else=Array.isArray(X)?new x(X):X}if(U)return D===!1?U instanceof S?U:U.nodes:this.nodes.length?this:new S(H(D),U instanceof S?[U]:U.nodes);if(!(D===!1||!this.nodes.length))return this}optimizeNames(D,U){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames(D,U),!!(super.optimizeNames(D,U)||this.else))return this.condition=Z(this.condition,D,U),this}get names(){const D=super.names;return F(D,this.condition),this.else&&B(D,this.else.names),D}}S.kind="if";class E extends _{}E.kind="for";class T extends E{constructor(D){super(),this.iteration=D}render(D){return`for(${this.iteration})`+super.render(D)}optimizeNames(D,U){if(super.optimizeNames(D,U))return this.iteration=Z(this.iteration,D,U),this}get names(){return B(super.names,this.iteration.names)}}class R extends E{constructor(D,U,X,fe){super(),this.varKind=D,this.name=U,this.from=X,this.to=fe}render(D){const U=D.es5?n.varKinds.var:this.varKind,{name:X,from:fe,to:pe}=this;return`for(${U} ${X}=${fe}; ${X}<${pe}; ${X}++)`+super.render(D)}get names(){const D=F(super.names,this.from);return F(D,this.to)}}class O extends E{constructor(D,U,X,fe){super(),this.loop=D,this.varKind=U,this.name=X,this.iterable=fe}render(D){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(D)}optimizeNames(D,U){if(super.optimizeNames(D,U))return this.iterable=Z(this.iterable,D,U),this}get names(){return B(super.names,this.iterable.names)}}class A extends _{constructor(D,U,X){super(),this.name=D,this.args=U,this.async=X}render(D){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(D)}}A.kind="func";class I extends v{render(D){return"return "+super.render(D)}}I.kind="return";class M extends _{render(D){let U="try"+super.render(D);return this.catch&&(U+=this.catch.render(D)),this.finally&&(U+=this.finally.render(D)),U}optimizeNodes(){var D,U;return super.optimizeNodes(),(D=this.catch)===null||D===void 0||D.optimizeNodes(),(U=this.finally)===null||U===void 0||U.optimizeNodes(),this}optimizeNames(D,U){var X,fe;return super.optimizeNames(D,U),(X=this.catch)===null||X===void 0||X.optimizeNames(D,U),(fe=this.finally)===null||fe===void 0||fe.optimizeNames(D,U),this}get names(){const D=super.names;return this.catch&&B(D,this.catch.names),this.finally&&B(D,this.finally.names),D}}class L extends _{constructor(D){super(),this.error=D}render(D){return`catch(${this.error})`+super.render(D)}}L.kind="catch";class q extends _{render(D){return"finally"+super.render(D)}}q.kind="finally";class j{constructor(D,U={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...U,_n:U.lines?`
|
|
155
|
+
`})]})]})}function Mi({redirectTo:e}){const{redirectTo:t}=P.useContext(vt),[n,r]=P.useState(!1),{navigate:o,hooks:{useSession:s},onSessionChange:l}=P.useContext(vt),{refetch:c}=s();return{onSuccess:P.useCallback(async()=>{r(!0),await c?.(),l&&await l(),r(!1);const f=e||gl("redirectTo")||t;o(f)},[c,l,o,e,t]),isPending:n}}function t5({redirectTo:e}){const{hooks:{useIsRestoring:t},persistClient:n}=P.useContext(vt),r=t?.(),o=P.useRef(!1),{onSuccess:s}=Mi({redirectTo:e});return P.useEffect(()=>{if(!o.current){if(!n){o.current=!0,s();return}r||(o.current=!0,s())}},[r,n,s]),C.jsx(Ar,{className:"animate-spin"})}function zS({className:e,containerClassName:t,...n}){return C.jsx(UD,{"data-slot":"input-otp",containerClassName:Ce("flex items-center gap-2 has-disabled:opacity-50",t),className:Ce("disabled:cursor-not-allowed",e),...n})}function hc({className:e,...t}){return C.jsx("div",{"data-slot":"input-otp-group",className:Ce("flex items-center",e),...t})}function rr({index:e,className:t,...n}){const r=P.useContext(zD),{char:o,hasFakeCaret:s,isActive:l}=r?.slots[e]??{};return C.jsxs("div",{"data-slot":"input-otp-slot","data-active":l,className:Ce("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[o,s&&C.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:C.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function K_({...e}){return C.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:C.jsx(sK,{})})}function US({otpSeparators:e=0}){return e===0?C.jsxs(hc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1}),C.jsx(rr,{index:2}),C.jsx(rr,{index:3}),C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]}):e===1?C.jsxs(C.Fragment,{children:[C.jsxs(hc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1}),C.jsx(rr,{index:2})]}),C.jsx(K_,{}),C.jsxs(hc,{children:[C.jsx(rr,{index:3}),C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]})]}):C.jsxs(C.Fragment,{children:[C.jsxs(hc,{children:[C.jsx(rr,{index:0}),C.jsx(rr,{index:1})]}),C.jsx(K_,{}),C.jsxs(hc,{children:[C.jsx(rr,{index:2}),C.jsx(rr,{index:3})]}),C.jsx(K_,{}),C.jsxs(hc,{children:[C.jsx(rr,{index:4}),C.jsx(rr,{index:5})]})]})}function EA(e){const[t,n]=P.useState();return t?C.jsx(zte,{...e,email:t}):C.jsx(jte,{...e,setEmail:n})}function jte({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:o,setEmail:s}){const l=ms(),{captchaRef:c,getCaptchaHeaders:d}=xf({localization:r}),{authClient:f,localization:p,toast:h,localizeErrors:g}=P.useContext(vt);r={...p,...r};const v=be({email:$().email({message:`${r.EMAIL} ${r.IS_INVALID}`})}),_=Ci({resolver:Ai(v),defaultValues:{email:""}});n=n||_.formState.isSubmitting,P.useEffect(()=>{o?.(_.formState.isSubmitting)},[_.formState.isSubmitting,o]);async function b({email:x}){const S={throw:!0,headers:await d("/email-otp/send-verification-otp")};try{await f.emailOtp.sendVerificationOtp({email:x,type:"sign-in",fetchOptions:S}),h({variant:"success",message:r.EMAIL_OTP_VERIFICATION_SENT}),s(x)}catch(E){h({variant:"error",message:kn({error:E,localization:r,localizeErrors:g})})}}return C.jsx(Pi,{..._,children:C.jsxs("form",{method:"POST",onSubmit:_.handleSubmit(b),noValidate:l,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:_.control,name:"email",render:({field:x})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...x})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(Rf,{ref:c,localization:r,action:"/email-otp/send-verification-otp"}),C.jsx(on,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.EMAIL_OTP_SEND_ACTION})]})})}function zte({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:o=0,redirectTo:s,setIsSubmitting:l,email:c}){const{authClient:d,localization:f,toast:p,localizeErrors:h}=P.useContext(vt);r={...f,...r};const{onSuccess:g,isPending:v}=Mi({redirectTo:s}),_=be({code:$().min(1,{message:`${r.EMAIL_OTP} ${r.IS_REQUIRED}`}).min(6,{message:`${r.EMAIL_OTP} ${r.IS_INVALID}`})}),b=Ci({resolver:Ai(_),defaultValues:{code:""}});n=n||b.formState.isSubmitting||v,P.useEffect(()=>{l?.(b.formState.isSubmitting||v)},[b.formState.isSubmitting,v,l]);async function x({code:S}){try{await d.signIn.emailOtp({email:c,otp:S,fetchOptions:{throw:!0}}),await g()}catch(E){p({variant:"error",message:kn({error:E,localization:r,localizeErrors:h})}),b.reset()}}return C.jsx(Pi,{...b,children:C.jsxs("form",{method:"POST",onSubmit:b.handleSubmit(x),className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:b.control,name:"code",render:({field:S})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:r.EMAIL_OTP}),C.jsx(qn,{children:C.jsx(zS,{...S,maxLength:6,onChange:E=>{S.onChange(E),E.length===6&&b.handleSubmit(x)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:C.jsx(US,{otpSeparators:o})})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx("div",{className:"grid gap-4",children:C.jsxs(on,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&C.jsx(Ar,{className:"animate-spin"}),r.EMAIL_OTP_VERIFY_ACTION]})})]})})}function Ute({onCancel:e,localization:t,className:n,classNames:r,otpSeparators:o,callbackURL:s,isSubmitting:l,redirectTo:c,setIsSubmitting:d}){const[f,p]=P.useState(!0),[h,g]=P.useState(30),{authClient:v,localization:_,toast:b,localizeErrors:x,navigate:S,basePath:E,viewPaths:T}=P.useContext(vt);t={..._,...t};const R=typeof window<"u"&&new URLSearchParams(window.location.search).get("email")||"",{onSuccess:O,isPending:A}=Mi({redirectTo:c}),I=be({code:$().min(1,{message:`${t.EMAIL_OTP} ${t.IS_REQUIRED}`}).min(6,{message:`${t.EMAIL_OTP} ${t.IS_INVALID}`})}),M=Ci({resolver:Ai(I),defaultValues:{code:""}}),L=l||M.formState.isSubmitting||A;P.useEffect(()=>{d?.(M.formState.isSubmitting||A)},[M.formState.isSubmitting,A,d]),P.useEffect(()=>{if(h>0){const B=setTimeout(()=>g(h-1),1e3);return()=>clearTimeout(B)}else p(!1)},[h]);async function q({code:B}){try{const F=await v.emailOtp.verifyEmail({email:R,otp:B,fetchOptions:{throw:!0}});"token"in F&&F.token?await O():(S(`${E}/${T.SIGN_IN}${window.location.search}`),b({variant:"success",message:t.EMAIL_VERIFICATION_SUCCESS}))}catch(F){b({variant:"error",message:kn({error:F,localization:t,localizeErrors:x})}),M.reset()}}async function j(){if(!f){p(!0),g(30);try{await v.emailOtp.sendVerificationOtp({email:R,type:"email-verification",fetchOptions:{throw:!0}}),b({variant:"success",message:t.EMAIL_OTP_VERIFICATION_SENT})}catch(B){b({variant:"error",message:kn({error:B,localization:t,localizeErrors:x})}),p(!1),g(0)}}}return R?C.jsx(Pi,{...M,children:C.jsxs("form",{method:"POST",onSubmit:M.handleSubmit(q),className:Ce("grid w-full gap-6",n,r?.base),children:[C.jsx(In,{control:M.control,name:"code",render:({field:B})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:r?.label,children:t.EMAIL_OTP}),C.jsx(qn,{children:C.jsx(zS,{...B,maxLength:6,onChange:F=>{B.onChange(F),F.length===6&&M.handleSubmit(q)()},containerClassName:r?.otpInputContainer,className:r?.otpInput,disabled:L,children:C.jsx(US,{otpSeparators:o})})}),C.jsx(Wn,{className:r?.error})]})}),C.jsxs("div",{className:"grid gap-4",children:[C.jsxs(on,{type:"submit",disabled:L,className:Ce(r?.button,r?.primaryButton),children:[L&&C.jsx(Ar,{className:"animate-spin"}),t.EMAIL_OTP_VERIFY_ACTION]}),C.jsx(on,{type:"button",variant:"outline",onClick:j,disabled:f||L,className:Ce("w-full",r?.button),children:f?`${t.RESEND_VERIFICATION_EMAIL} (${h}s)`:t.RESEND_VERIFICATION_EMAIL}),e&&C.jsx(on,{type:"button",variant:"ghost",onClick:e,disabled:L,className:"w-full",children:t.CANCEL})]})]})}):C.jsx("div",{className:Ce("grid w-full gap-6",n),children:C.jsxs("div",{className:"text-center",children:[C.jsx("h2",{className:"font-semibold text-destructive text-lg",children:"Invalid Request"}),C.jsx("p",{className:"text-muted-foreground text-sm",children:t.EMAIL_REQUIRED||"Email address is required"})]})})}function Fte({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:o}){const s=ms(),{captchaRef:l,getCaptchaHeaders:c,resetCaptcha:d}=xf({localization:r}),{authClient:f,basePath:p,baseURL:h,localization:g,navigate:v,toast:_,viewPaths:b,localizeErrors:x}=P.useContext(vt);r={...g,...r};const S=be({email:$().email({message:`${r.EMAIL} ${r.IS_INVALID}`}).min(1,{message:`${r.EMAIL} ${r.IS_REQUIRED}`})}),E=Ci({resolver:Ai(S),defaultValues:{email:""}});n=n||E.formState.isSubmitting,P.useEffect(()=>{o?.(E.formState.isSubmitting)},[E.formState.isSubmitting,o]);async function T({email:R}){try{const O={throw:!0,headers:await c("/forget-password")};await f.requestPasswordReset({email:R,redirectTo:`${h}${p}/${b.RESET_PASSWORD}`,fetchOptions:O}),_({variant:"success",message:r.FORGOT_PASSWORD_EMAIL}),v(`${p}/${b.SIGN_IN}${window.location.search}`)}catch(O){_({variant:"error",message:kn({error:O,localization:r,localizeErrors:x})}),d()}}return C.jsx(Pi,{...E,children:C.jsxs("form",{method:"POST",onSubmit:E.handleSubmit(T),noValidate:s,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:E.control,name:"email",render:({field:R})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...R})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(Rf,{ref:l,localization:r,action:"/forget-password"}),C.jsx(on,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.FORGOT_PASSWORD_ACTION})]})})}function xA({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,redirectTo:s,setIsSubmitting:l}){const c=ms(),{captchaRef:d,getCaptchaHeaders:f,resetCaptcha:p}=xf({localization:o}),{authClient:h,basePath:g,baseURL:v,persistClient:_,localization:b,redirectTo:x,viewPaths:S,toast:E,localizeErrors:T}=P.useContext(vt);o={...b,...o};const R=P.useCallback(()=>s||gl("redirectTo")||x,[s,x]),O=P.useCallback(()=>`${v}${n||(_?`${g}/${S.CALLBACK}?redirectTo=${encodeURIComponent(R())}`:R())}`,[n,_,g,S,v,R]),A=be({email:$().email({message:`${o.EMAIL} ${o.IS_INVALID}`})}),I=Ci({resolver:Ai(A),defaultValues:{email:""}});r=r||I.formState.isSubmitting,P.useEffect(()=>{l?.(I.formState.isSubmitting)},[I.formState.isSubmitting,l]);async function M({email:L}){try{const q={throw:!0,headers:await f("/sign-in/magic-link")};await h.signIn.magicLink({email:L,callbackURL:O(),fetchOptions:q}),E({variant:"success",message:o.MAGIC_LINK_EMAIL}),I.reset()}catch(q){E({variant:"error",message:kn({error:q,localization:o,localizeErrors:T})}),p()}}return C.jsx(Pi,{...I,children:C.jsxs("form",{method:"POST",onSubmit:I.handleSubmit(M),noValidate:c,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:I.control,name:"email",render:({field:L})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:o.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:r,...L})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(Rf,{ref:d,localization:o,action:"/sign-in/magic-link"}),C.jsx(on,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?C.jsx(Ar,{className:"animate-spin"}):o.MAGIC_LINK_ACTION})]})})}function Bte({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:o,setIsSubmitting:s}){const{authClient:l,localization:c,toast:d,localizeErrors:f}=P.useContext(vt);r={...c,...r};const{onSuccess:p,isPending:h}=Mi({redirectTo:o}),g=be({code:$().min(1,{message:r.BACKUP_CODE_REQUIRED})}),v=Ci({resolver:Ai(g),defaultValues:{code:""}});n=n||v.formState.isSubmitting||h,P.useEffect(()=>{s?.(v.formState.isSubmitting||h)},[v.formState.isSubmitting,h,s]);async function _({code:b}){try{await l.twoFactor.verifyBackupCode({code:b,fetchOptions:{throw:!0}}),await p()}catch(x){d({variant:"error",message:kn({error:x,localization:r,localizeErrors:f})}),v.reset()}}return C.jsx(Pi,{...v,children:C.jsxs("form",{method:"POST",onSubmit:v.handleSubmit(_),className:Ce("grid gap-6",e,t?.base),children:[C.jsx(In,{control:v.control,name:"code",render:({field:b})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:r.BACKUP_CODE}),C.jsx(qn,{children:C.jsx(ni,{placeholder:r.BACKUP_CODE_PLACEHOLDER,autoComplete:"off",className:t?.input,disabled:n,...b})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(on,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.RECOVER_ACCOUNT_ACTION})]})})}function Vte({className:e,classNames:t,localization:n,passwordValidation:r}){const o=P.useRef(!1),{authClient:s,basePath:l,credentials:c,localization:d,viewPaths:f,navigate:p,toast:h,localizeErrors:g}=P.useContext(vt),v=c?.confirmPassword,_=c?.passwordValidation;n={...d,...n},r={..._,...r};const b=be({newPassword:Wd(r,{PASSWORD_REQUIRED:n.NEW_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}),confirmPassword:v?Wd(r,{PASSWORD_REQUIRED:n.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}):$().optional()}).refine(T=>!v||T.newPassword===T.confirmPassword,{message:n.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),x=Ci({resolver:Ai(b),defaultValues:{newPassword:"",confirmPassword:""}}),S=x.formState.isSubmitting;P.useEffect(()=>{if(o.current)return;o.current=!0;const R=new URLSearchParams(window.location.search).get("token");(!R||R==="INVALID_TOKEN")&&(p(`${l}/${f.SIGN_IN}${window.location.search}`),h({variant:"error",message:n.INVALID_TOKEN}))},[l,p,h,f,n]);async function E({newPassword:T}){try{const O=new URLSearchParams(window.location.search).get("token");await s.resetPassword({newPassword:T,token:O,fetchOptions:{throw:!0}}),h({variant:"success",message:n.RESET_PASSWORD_SUCCESS}),p(`${l}/${f.SIGN_IN}${window.location.search}`)}catch(R){h({variant:"error",message:kn({error:R,localization:n,localizeErrors:g})}),x.reset()}}return C.jsx(Pi,{...x,children:C.jsxs("form",{method:"POST",onSubmit:x.handleSubmit(E),className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:x.control,name:"newPassword",render:({field:T})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:n.NEW_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:n.NEW_PASSWORD_PLACEHOLDER,disabled:S,...T})}),C.jsx(Wn,{className:t?.error})]})}),v&&C.jsx(In,{control:x.control,name:"confirmPassword",render:({field:T})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:n.CONFIRM_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:n.CONFIRM_PASSWORD_PLACEHOLDER,disabled:S,...T})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(on,{type:"submit",disabled:S,className:Ce("w-full",t?.button,t?.primaryButton),children:S?C.jsx(Ar,{className:"animate-spin"}):n.RESET_PASSWORD_ACTION})]})})}function qte({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:o,setIsSubmitting:s,passwordValidation:l,callbackURL:c}){const d=ms(),{captchaRef:f,getCaptchaHeaders:p,resetCaptcha:h}=xf({localization:r}),{authClient:g,basePath:v,credentials:_,localization:b,viewPaths:x,navigate:S,toast:E,Link:T,localizeErrors:R,emailVerification:O}=P.useContext(vt),A=_?.rememberMe,I=_?.username,M=_?.passwordValidation;r={...b,...r},l={...M,...l};const{onSuccess:L,isPending:q}=Mi({redirectTo:o}),j=be({email:I?$().min(1,{message:`${r.USERNAME} ${r.IS_REQUIRED}`}):$().email({message:`${r.EMAIL} ${r.IS_INVALID}`}),password:Wd(l,r),rememberMe:Nt().optional()}),B=Ci({resolver:Ai(j),defaultValues:{email:"",password:"",rememberMe:!A}});n=n||B.formState.isSubmitting||q,P.useEffect(()=>{s?.(B.formState.isSubmitting||q)},[B.formState.isSubmitting,q,s]);async function F({email:Z,password:ie,rememberMe:H}){var W;try{let te={};if(I&&!NH(Z)){const le={throw:!0,headers:await p("/sign-in/username")};te=await g.signIn.username({username:Z,password:ie,rememberMe:H,fetchOptions:le,callbackURL:c})}else{const le={throw:!0,headers:await p("/sign-in/email")};te=await g.signIn.email({email:Z,password:ie,rememberMe:H,fetchOptions:le,callbackURL:c})}te.twoFactorRedirect?S(`${v}/${x.TWO_FACTOR}${window.location.search}`):await L()}catch(te){B.resetField("password"),h(),E({variant:"error",message:kn({error:te,localization:r,localizeErrors:R})}),O?.otp&&((W=te?.error)==null?void 0:W.code)==="EMAIL_NOT_VERIFIED"&&S(`${v}/${x.EMAIL_VERIFICATION}?email=${encodeURIComponent(Z)}`)}}return C.jsx(Pi,{...B,children:C.jsxs("form",{method:"POST",onSubmit:B.handleSubmit(F),noValidate:d,className:Ce("grid w-full gap-6",e,t?.base),children:[C.jsx(In,{control:B.control,name:"email",render:({field:Z})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:I?r.USERNAME:r.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:I?"username":"email",className:t?.input,type:I?"text":"email",placeholder:I?r.SIGN_IN_USERNAME_PLACEHOLDER:r.EMAIL_PLACEHOLDER,disabled:n,...Z})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(In,{control:B.control,name:"password",render:({field:Z})=>C.jsxs(Pn,{children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx(Mn,{className:t?.label,children:r.PASSWORD}),_?.forgotPassword&&C.jsx(T,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${v}/${x.FORGOT_PASSWORD}${d?window.location.search:""}`,children:r.FORGOT_PASSWORD_LINK})]}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"current-password",className:t?.input,placeholder:r.PASSWORD_PLACEHOLDER,disabled:n,...Z})}),C.jsx(Wn,{className:t?.error})]})}),A&&C.jsx(In,{control:B.control,name:"rememberMe",render:({field:Z})=>C.jsxs(Pn,{className:"flex",children:[C.jsx(qn,{children:C.jsx(jS,{checked:Z.value,onCheckedChange:Z.onChange,disabled:n})}),C.jsx(Mn,{children:r.REMEMBER_ME})]})}),C.jsx(Rf,{ref:f,localization:r,action:"/sign-in/email"}),C.jsx(on,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?C.jsx(Ar,{className:"animate-spin"}):r.SIGN_IN_ACTION})]})})}function Hte({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,redirectTo:s,setIsSubmitting:l,passwordValidation:c}){var d,f,p,h,g,v;const _=ms(),{captchaRef:b,getCaptchaHeaders:x,resetCaptcha:S}=xf({localization:o}),{additionalFields:E,authClient:T,basePath:R,baseURL:O,credentials:A,localization:I,nameRequired:M,persistClient:L,redirectTo:q,signUp:j,viewPaths:B,navigate:F,toast:Z,avatar:ie,localizeErrors:H,emailVerification:W}=P.useContext(vt),te=A?.confirmPassword,le=A?.username,Q=A?.usernameRequired??!0,k=A?.passwordValidation,G=j?.fields;o={...I,...o},c={...k,...c};const V=P.useRef(null),[D,U]=P.useState(null),[X,fe]=P.useState(!1),pe=P.useCallback(()=>s||gl("redirectTo")||q,[s,q]),xe=P.useCallback(()=>`${O}${n||(L?`${R}/${B.CALLBACK}?redirectTo=${encodeURIComponent(pe())}`:pe())}`,[n,L,R,B,O,pe]),{onSuccess:je,isPending:Y}=Mi({redirectTo:s}),re={email:$().email({message:`${o.EMAIL} ${o.IS_INVALID}`}),password:Wd(c,o),name:G?.includes("name")&&M?$().min(1,{message:`${o.NAME} ${o.IS_REQUIRED}`}):$().optional(),image:$().optional(),username:le&&Q?$().min(1,{message:`${o.USERNAME} ${o.IS_REQUIRED}`}):$().optional(),confirmPassword:te?Wd(c,{PASSWORD_REQUIRED:o.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:o.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:o.PASSWORD_TOO_LONG,INVALID_PASSWORD:o.INVALID_PASSWORD}):$().optional()},ve={};if(G)for(const Me of G){if(Me==="name"||Me==="image")continue;const Pe=E?.[Me];if(!Pe)continue;let Ue;Pe.type==="number"?Ue=Pe.required?Kw(K=>K?Number(K):void 0,dt({message:((d=Pe.errorMessage)==null?void 0:d.invalid)??`${Pe.label} ${o.IS_INVALID}`})):nN({message:((f=Pe.errorMessage)==null?void 0:f.invalid)??`${Pe.label} ${o.IS_INVALID}`}).optional():Pe.type==="boolean"?Ue=Pe.required?DT({message:((p=Pe.errorMessage)==null?void 0:p.invalid)??`${Pe.label} ${o.IS_INVALID}`}).refine(K=>K===!0,{message:((h=Pe.errorMessage)==null?void 0:h.required)??`${Pe.label} ${o.IS_REQUIRED}`}):DT({message:((g=Pe.errorMessage)==null?void 0:g.invalid)??`${Pe.label} ${o.IS_INVALID}`}).optional():Ue=Pe.required?$().min(1,((v=Pe.errorMessage)==null?void 0:v.required)??`${Pe.label} ${o.IS_REQUIRED}`):$().optional(),ve[Me]=Ue}const se=be(re).extend(ve).refine(Me=>te?Me.password===Me.confirmPassword:!0,{message:o.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),Se={email:"",password:"",...te&&{confirmPassword:""},...G?.includes("name")?{name:""}:{},...le?{username:""}:{},...G?.includes("image")&&ie?{image:""}:{}};if(G)for(const Me of G){if(Me==="name"||Me==="image")continue;const Pe=E?.[Me];Pe&&(Se[Me]=Pe.type==="boolean"?!1:"")}const Te=Ci({resolver:Ai(se),defaultValues:Se});r=r||Te.formState.isSubmitting||Y,P.useEffect(()=>{l?.(Te.formState.isSubmitting||Y)},[Te.formState.isSubmitting,Y,l]);const tt=async Me=>{if(ie){fe(!0);try{const Pe=await Xee(Me,crypto.randomUUID(),ie.size,ie.extension);let Ue;ie.upload?Ue=await ie.upload(Pe):Ue=await ete(Pe),Ue?(U(Ue),Te.setValue("image",Ue)):(U(null),Te.setValue("image",""))}catch(Pe){console.error(Pe),Z({variant:"error",message:kn({error:Pe,localization:o,localizeErrors:H})})}fe(!1)}},rt=()=>{U(null),Te.setValue("image","")},Be=()=>{var Me;return(Me=V.current)==null?void 0:Me.click()};async function Qe({email:Me,password:Pe,name:Ue,username:K,confirmPassword:ne,image:ae,...Oe}){var Ae,Ie;try{for(const[_t,Tt]of Object.entries(Oe)){const bt=E?.[_t];if(bt?.validate&&typeof Tt=="string"&&!await bt.validate(Tt)){Te.setError(_t,{message:((Ae=bt.errorMessage)==null?void 0:Ae.validate)??((Ie=bt.errorMessage)==null?void 0:Ie.invalid)??`${bt.label} ${o.IS_INVALID}`});return}}const ke={throw:!0,headers:await x("/sign-up/email")},Je={};K!==void 0&&(!Q&&(K===null||K===""||typeof K=="string"&&K.trim()==="")||(Je.username=K)),ae!==void 0&&(Je.image=ae);const et=await T.signUp.email({email:Me,password:Pe,name:Ue||"",...Je,...Oe,callbackURL:xe(),fetchOptions:ke});"token"in et&&et.token?await je():W?.otp?F(`${R}/${B.EMAIL_VERIFICATION}?email=${encodeURIComponent(Me)}`):(F(`${R}/${B.SIGN_IN}${window.location.search}`),Z({variant:"success",message:o.SIGN_UP_EMAIL}))}catch(ke){Z({variant:"error",message:kn({error:ke,localization:o,localizeErrors:H})}),Te.resetField("password"),Te.resetField("confirmPassword"),S()}}return C.jsx(Pi,{...Te,children:C.jsxs("form",{method:"POST",onSubmit:Te.handleSubmit(Qe),noValidate:_,className:Ce("grid w-full gap-6",e,t?.base),children:[G?.includes("image")&&ie&&C.jsxs(C.Fragment,{children:[C.jsx("input",{ref:V,accept:"image/*",disabled:X,hidden:!0,type:"file",onChange:Me=>{var Pe;const Ue=(Pe=Me.target.files)==null?void 0:Pe.item(0);Ue&&tt(Ue),Me.target.value=""}}),C.jsx(In,{control:Te.control,name:"image",render:()=>C.jsxs(Pn,{children:[C.jsx(Mn,{children:o.AVATAR}),C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsxs(tte,{children:[C.jsx(nte,{asChild:!0,children:C.jsx(on,{className:"size-fit rounded-full",size:"icon",variant:"ghost",type:"button",children:C.jsx(ste,{isPending:X,className:"size-16",user:D?{name:Te.watch("name"),email:Te.watch("email"),image:D}:null,localization:o})})}),C.jsxs(rte,{align:"start",onCloseAutoFocus:Me=>Me.preventDefault(),children:[C.jsxs(SA,{onClick:Be,disabled:X,children:[C.jsx(nK,{}),o.UPLOAD_AVATAR]}),D&&C.jsxs(SA,{onClick:rt,disabled:X,variant:"destructive",children:[C.jsx(lK,{}),o.DELETE_AVATAR]})]})]}),C.jsxs(on,{type:"button",variant:"outline",onClick:Be,disabled:X,children:[X&&C.jsx(Ar,{className:"animate-spin"}),o.UPLOAD]})]}),C.jsx(Wn,{})]})})]}),G?.includes("name")&&C.jsx(In,{control:Te.control,name:"name",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsxs(Mn,{className:t?.label,children:[o.NAME,!M&&C.jsx("span",{className:"ml-1 text-muted-foreground",children:o.OPTIONAL_BRACKETS})]}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"name",className:t?.input,placeholder:o.NAME_PLACEHOLDER,disabled:r,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),le&&C.jsx(In,{control:Te.control,name:"username",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsxs(Mn,{className:t?.label,children:[o.USERNAME,!Q&&C.jsx("span",{className:"ml-1 text-muted-foreground",children:o.OPTIONAL_BRACKETS})]}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"username",className:t?.input,placeholder:o.USERNAME_PLACEHOLDER,disabled:r,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(In,{control:Te.control,name:"email",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:o.EMAIL}),C.jsx(qn,{children:C.jsx(ni,{autoComplete:"email",className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:r,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(In,{control:Te.control,name:"password",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:o.PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:o.PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),te&&C.jsx(In,{control:Te.control,name:"confirmPassword",render:({field:Me})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:o.CONFIRM_PASSWORD}),C.jsx(qn,{children:C.jsx(rf,{autoComplete:"new-password",className:t?.input,placeholder:o.CONFIRM_PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...Me,value:Me.value})}),C.jsx(Wn,{className:t?.error})]})}),G?.filter(Me=>Me!=="name"&&Me!=="image").map(Me=>{const Pe=E?.[Me];return Pe?Pe.type==="boolean"?C.jsx(In,{control:Te.control,name:Me,render:({field:Ue})=>C.jsxs(Pn,{className:"flex",children:[C.jsx(qn,{children:C.jsx(jS,{checked:Ue.value,onCheckedChange:Ue.onChange,disabled:r})}),C.jsx(Mn,{className:t?.label,children:Pe.label}),C.jsx(Wn,{className:t?.error})]})},Me):C.jsx(In,{control:Te.control,name:Me,render:({field:Ue})=>C.jsxs(Pn,{children:[C.jsx(Mn,{className:t?.label,children:Pe.label}),C.jsx(qn,{children:Pe.type==="number"?C.jsx(ni,{className:t?.input,type:"number",placeholder:Pe.placeholder||(typeof Pe.label=="string"?Pe.label:""),disabled:r,...Ue,value:Ue.value}):Pe.multiline?C.jsx(lte,{className:t?.input,placeholder:Pe.placeholder||(typeof Pe.label=="string"?Pe.label:""),disabled:r,...Ue,value:Ue.value}):C.jsx(ni,{className:t?.input,type:"text",placeholder:Pe.placeholder||(typeof Pe.label=="string"?Pe.label:""),disabled:r,...Ue,value:Ue.value})}),C.jsx(Wn,{className:t?.error})]})},Me):(console.error(`Additional field ${Me} not found`),null)}),C.jsx(Rf,{ref:b,localization:o,action:"/sign-up/email"}),C.jsx(on,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?C.jsx(Ar,{className:"animate-spin"}):o.SIGN_UP_ACTION})]})})}function Gte({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:o=0,redirectTo:s,setIsSubmitting:l}){var c;const d=ms(),f=d?gl("totpURI"):null,p=P.useRef(!1),{authClient:h,basePath:g,hooks:{useSession:v},localization:_,twoFactor:b,viewPaths:x,toast:S,Link:E,localizeErrors:T}=P.useContext(vt);r={..._,...r};const{onSuccess:R,isPending:O}=Mi({redirectTo:s}),{data:A}=v(),I=(c=A?.user)==null?void 0:c.twoFactorEnabled,[M,L]=P.useState(b?.length===1?b[0]:null),[q,j]=P.useState(!1),[B,F]=P.useState(0),Z=be({code:$().min(1,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_REQUIRED}`}).min(6,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_INVALID}`}),trustDevice:Nt().optional()}),ie=Ci({resolver:Ai(Z),defaultValues:{code:""}});n=n||ie.formState.isSubmitting||O,P.useEffect(()=>{l?.(ie.formState.isSubmitting||O)},[ie.formState.isSubmitting,O,l]),P.useEffect(()=>{M==="otp"&&B<=0&&!p.current&&(p.current=!0,H())},[M]),P.useEffect(()=>{if(B<=0)return;const te=setTimeout(()=>{F(le=>le-1)},1e3);return()=>clearTimeout(te)},[B]);const H=async()=>{if(!(q||B>0)){try{j(!0),await h.twoFactor.sendOtp({fetchOptions:{throw:!0}}),F(60)}catch(te){S({variant:"error",message:kn({error:te,localization:r,localizeErrors:T})}),te.error.code==="INVALID_TWO_FACTOR_COOKIE"&&history.back()}p.current=!1,j(!1)}};async function W({code:te,trustDevice:le}){try{await(M==="totp"?h.twoFactor.verifyTotp:h.twoFactor.verifyOtp)({code:te,trustDevice:le,fetchOptions:{throw:!0}}),await R(),A&&!I&&S({variant:"success",message:r?.TWO_FACTOR_ENABLED})}catch(Q){S({variant:"error",message:kn({error:Q,localization:r,localizeErrors:T})}),ie.reset()}}return C.jsx(Pi,{...ie,children:C.jsxs("form",{method:"POST",onSubmit:ie.handleSubmit(W),className:Ce("grid w-full gap-6",e,t?.base),children:[b?.includes("totp")&&f&&M==="totp"&&C.jsxs("div",{className:"space-y-3",children:[C.jsx(ZD,{className:t?.label,children:r.TWO_FACTOR_TOTP_LABEL}),C.jsx(Hee,{className:Ce("border shadow-xs",t?.qrCode),value:f})]}),M!==null&&C.jsxs(C.Fragment,{children:[C.jsx(In,{control:ie.control,name:"code",render:({field:te})=>C.jsxs(Pn,{children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx(Mn,{className:t?.label,children:r.ONE_TIME_PASSWORD}),C.jsx(E,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${g}/${x.RECOVER_ACCOUNT}${d?window.location.search:""}`,children:r.FORGOT_AUTHENTICATOR})]}),C.jsx(qn,{children:C.jsx(zS,{...te,maxLength:6,onChange:le=>{te.onChange(le),le.length===6&&ie.handleSubmit(W)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:C.jsx(US,{otpSeparators:o})})}),C.jsx(Wn,{className:t?.error})]})}),C.jsx(In,{control:ie.control,name:"trustDevice",render:({field:te})=>C.jsxs(Pn,{className:"flex",children:[C.jsx(qn,{children:C.jsx(jS,{checked:te.value,onCheckedChange:te.onChange,disabled:n,className:t?.checkbox})}),C.jsx(Mn,{className:t?.label,children:r.TRUST_DEVICE})]})})]}),C.jsxs("div",{className:"grid gap-4",children:[M!==null&&C.jsxs(on,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&C.jsx(Ar,{className:"animate-spin"}),r.TWO_FACTOR_ACTION]}),M==="otp"&&b?.includes("otp")&&C.jsxs(on,{type:"button",variant:"outline",onClick:H,disabled:B>0||q||n,className:Ce(t?.button,t?.outlineButton),children:[q?C.jsx(Ar,{className:"animate-spin"}):C.jsx(nC,{className:t?.icon}),r.RESEND_CODE,B>0&&` (${B})`]}),M!=="otp"&&b?.includes("otp")&&C.jsxs(on,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>L("otp"),disabled:n,children:[C.jsx(nC,{className:t?.icon}),r.SEND_VERIFICATION_CODE]}),M!=="totp"&&b?.includes("totp")&&C.jsxs(on,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>L("totp"),disabled:n,children:[C.jsx(aK,{className:t?.icon}),r.CONTINUE_WITH_AUTHENTICATOR]})]})]})})}function n5({redirectTo:e}){const t=P.useRef(!1),{authClient:n,basePath:r,viewPaths:o}=P.useContext(vt),{onSuccess:s}=Mi({redirectTo:e||`${r}/${o.SIGN_IN}`});return P.useEffect(()=>{t.current||(t.current=!0,n.signOut().finally(s))},[n,s]),C.jsx(Ar,{className:"animate-spin"})}function Kte({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,pathname:s,redirectTo:l,view:c,otpSeparators:d=0,setIsSubmitting:f}){const{basePath:p,credentials:h,localization:g,magicLink:v,emailOTP:_,signUp:b,twoFactor:x,viewPaths:S,replace:E}=P.useContext(vt),T=!!b;if(o={...g,...o},P.useEffect(()=>{s&&!Zb(S,s)&&(console.error(`Invalid auth view: ${s}`),E(`${p}/${S.SIGN_IN}${window.location.search}`))},[s,S,p,E]),c=c||Zb(S,s)||"SIGN_IN",P.useEffect(()=>{let R=!1;c==="MAGIC_LINK"&&(!v||!h&&!_)&&(R=!0),c==="EMAIL_OTP"&&(!_||!h&&!v)&&(R=!0),c==="SIGN_UP"&&!T&&(R=!0),!h&&["SIGN_UP","FORGOT_PASSWORD","RESET_PASSWORD","TWO_FACTOR","RECOVER_ACCOUNT"].includes(c)&&(R=!0),["TWO_FACTOR","RECOVER_ACCOUNT"].includes(c)&&!x&&(R=!0),R&&E(`${p}/${S.SIGN_IN}${window.location.search}`)},[p,c,S,h,E,_,T,v,x]),c==="SIGN_OUT")return C.jsx(n5,{redirectTo:l});if(c==="CALLBACK")return C.jsx(t5,{redirectTo:l});if(c==="SIGN_IN")return h?C.jsx(qte,{className:e,classNames:t,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f,callbackURL:n}):v?C.jsx(xA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):_?C.jsx(EA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):null;if(c==="TWO_FACTOR")return C.jsx(Gte,{className:e,classNames:t,localization:o,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="RECOVER_ACCOUNT")return C.jsx(Bte,{className:e,classNames:t,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="MAGIC_LINK")return C.jsx(xA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="EMAIL_OTP")return C.jsx(EA,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="EMAIL_VERIFICATION")return C.jsx(Ute,{className:e,classNames:t,callbackURL:n,localization:o,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(c==="FORGOT_PASSWORD")return C.jsx(Fte,{className:e,classNames:t,localization:o,isSubmitting:r,setIsSubmitting:f});if(c==="RESET_PASSWORD")return C.jsx(Vte,{className:e,classNames:t,localization:o});if(c==="SIGN_UP")return T&&C.jsx(Hte,{className:e,classNames:t,callbackURL:n,localization:o,redirectTo:l,isSubmitting:r,setIsSubmitting:f})}function Zte({className:e,classNames:t,localization:n}){const{localization:r,redirectTo:o,replace:s,toast:l}=P.useContext(vt),c=P.useMemo(()=>({...r,...n}),[r,n]),{data:d}=Wee(),[f,p]=P.useState(null);return P.useEffect(()=>{const h=gl("invitationId");if(!h){l({variant:"error",message:c.INVITATION_NOT_FOUND}),s(o);return}p(h)},[c.INVITATION_NOT_FOUND,l,s,o]),!d||!f?C.jsx(r5,{className:e,classNames:t}):C.jsx(Yte,{className:e,classNames:t,localization:c,invitationId:f})}function Yte({className:e,classNames:t,localization:n,invitationId:r}){var o;const{authClient:s,hooks:{useInvitation:l},localization:c,organization:d,redirectTo:f,replace:p,toast:h,localizeErrors:g}=P.useContext(vt),v=P.useMemo(()=>({...c,...n}),[c,n]),[_,b]=P.useState(!1),[x,S]=P.useState(!1),E=_||x,{data:T,isPending:R}=l({query:{id:r}}),O=P.useCallback(()=>gl("redirectTo")||f,[f]);P.useEffect(()=>{if(!(R||!r)){if(!T){h({variant:"error",message:v.INVITATION_NOT_FOUND}),p(f);return}(T.status!=="pending"||new Date(T.expiresAt)<new Date)&&(h({variant:"error",message:new Date(T.expiresAt)<new Date?v.INVITATION_EXPIRED:v.INVITATION_NOT_FOUND}),p(f))}},[T,R,r,v,h,p,f]);const A=async()=>{S(!0);try{await s.organization.acceptInvitation({invitationId:r,fetchOptions:{throw:!0}}),h({variant:"success",message:v.INVITATION_ACCEPTED||"Invitation accepted"}),p(O())}catch(j){h({variant:"error",message:kn({error:j,localization:v,localizeErrors:g})}),S(!1)}},I=async()=>{b(!0);try{await s.organization.rejectInvitation({invitationId:r,fetchOptions:{throw:!0}}),h({variant:"success",message:v.INVITATION_REJECTED}),p(f)}catch(j){h({variant:"error",message:kn({error:j,localization:v,localizeErrors:g})}),b(!1)}},q=((o=[...[{role:"owner",label:v.OWNER},{role:"admin",label:v.ADMIN},{role:"member",label:v.MEMBER}],...d?.customRoles||[]].find(j=>j.role===T?.role))==null?void 0:o.label)||T?.role;return T?C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsxs(DS,{className:Ce("justify-items-center text-center",t?.header),children:[C.jsx(GD,{className:Ce("text-lg md:text-xl",t?.title),children:v.ACCEPT_INVITATION}),C.jsx(KD,{className:Ce("text-xs md:text-sm",t?.description),children:v.ACCEPT_INVITATION_DESCRIPTION})]}),C.jsxs(LS,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[C.jsxs(nf,{className:Ce("flex-row items-center p-4"),children:[C.jsx(e5,{organization:{id:T.organizationId,name:T.organizationName,slug:T.organizationSlug,logo:T.organizationLogo,createdAt:new Date},localization:v}),C.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:q})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsxs(on,{variant:"outline",className:Ce(t?.button,t?.outlineButton),onClick:I,disabled:E,children:[_?C.jsx(Ar,{className:"animate-spin"}):C.jsx(uK,{}),v.REJECT]}),C.jsxs(on,{className:Ce(t?.button,t?.primaryButton),onClick:A,disabled:E,children:[x?C.jsx(Ar,{className:"animate-spin"}):C.jsx(LN,{}),v.ACCEPT]})]})]})]}):C.jsx(r5,{className:e,classNames:t})}var r5=({className:e,classNames:t,localization:n})=>C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsxs(DS,{className:Ce("justify-items-center",t?.header),children:[C.jsx(ss,{className:Ce("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),C.jsx(ss,{className:Ce("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),C.jsxs(LS,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[C.jsxs(nf,{className:Ce("flex-row items-center p-4"),children:[C.jsx(e5,{isPending:!0,localization:n}),C.jsx(ss,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsx(ss,{className:"h-9 w-full"}),C.jsx(ss,{className:"h-9 w-full"})]})]})]});function RA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return C.jsx(Yee,{"data-slot":"separator",decorative:n,orientation:t,className:Ce("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Wte({classNames:e,isSubmitting:t,localization:n,view:r}){var o,s,l,c;const{viewPaths:d,navigate:f,basePath:p}=P.useContext(vt);return C.jsxs(on,{className:Ce("w-full",(o=e?.form)==null?void 0:o.button,(s=e?.form)==null?void 0:s.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${p}/${r==="EMAIL_OTP"?d.SIGN_IN:d.EMAIL_OTP}${window.location.search}`),children:[r==="EMAIL_OTP"?C.jsx($N,{className:(l=e?.form)==null?void 0:l.icon}):C.jsx(jN,{className:(c=e?.form)==null?void 0:c.icon}),n.SIGN_IN_WITH," ",r==="EMAIL_OTP"?n.PASSWORD:n.EMAIL_OTP]})}function Qte({classNames:e,isSubmitting:t,localization:n,view:r}){var o,s,l,c;const{viewPaths:d,navigate:f,basePath:p,credentials:h}=P.useContext(vt);return C.jsxs(on,{className:Ce("w-full",(o=e?.form)==null?void 0:o.button,(s=e?.form)==null?void 0:s.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${p}/${r==="MAGIC_LINK"||!h?d.SIGN_IN:d.MAGIC_LINK}${window.location.search}`),children:[r==="MAGIC_LINK"?C.jsx($N,{className:(l=e?.form)==null?void 0:l.icon}):C.jsx(jN,{className:(c=e?.form)==null?void 0:c.icon}),n.SIGN_IN_WITH," ",r==="MAGIC_LINK"?n.PASSWORD:n.MAGIC_LINK]})}function Xte({localization:e,redirectTo:t}){const{authClient:n,localization:r,toast:o,localizeErrors:s}=P.useContext(vt),l=P.useRef(!1);e=P.useMemo(()=>({...r,...e}),[r,e]);const{onSuccess:c}=Mi({redirectTo:t});return P.useEffect(()=>{if(!l.current){l.current=!0;try{n.oneTap({fetchOptions:{throw:!0,onSuccess:c}})}catch(d){o({variant:"error",message:kn({error:d,localization:e,localizeErrors:s})})}}},[n,e,s,c,o]),null}function Jte({classNames:e,isSubmitting:t,localization:n,redirectTo:r,setIsSubmitting:o}){var s,l;const{authClient:c,localization:d,toast:f,localizeErrors:p}=P.useContext(vt);n={...d,...n};const{onSuccess:h}=Mi({redirectTo:r}),g=async()=>{o?.(!0);try{const v=await c.signIn.passkey({fetchOptions:{throw:!0}});v?.error?(f({variant:"error",message:kn({error:v.error,localization:n,localizeErrors:p})}),o?.(!1)):h()}catch(v){f({variant:"error",message:kn({error:v,localization:n,localizeErrors:p})}),o?.(!1)}};return C.jsxs(on,{className:Ce("w-full",(s=e?.form)==null?void 0:s.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,formNoValidate:!0,name:"passkey",value:"true",variant:"secondary",onClick:g,children:[C.jsx(iK,{}),n.SIGN_IN_WITH," ",n.PASSKEY]})}function OA({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:o,other:s,provider:l,redirectTo:c,socialLayout:d,setIsSubmitting:f}){var p,h,g,v;const{authClient:_,basePath:b,baseURL:x,persistClient:S,redirectTo:E,viewPaths:T,social:R,genericOAuth:O,toast:A,localizeErrors:I}=P.useContext(vt),M=P.useCallback(()=>c||gl("redirectTo")||E,[c,E]),L=P.useCallback(()=>`${x}${n||(S?`${b}/${T.CALLBACK}?redirectTo=${encodeURIComponent(M())}`:M())}`,[n,S,b,T,x,M]),q=async()=>{f(!0);try{if(s){const j={providerId:l.provider,callbackURL:L(),fetchOptions:{throw:!0}};O?.signIn?(await O.signIn(j),setTimeout(()=>{f(!1)},1e4)):await _.signIn.oauth2(j)}else{const j={provider:l.provider,callbackURL:L(),fetchOptions:{throw:!0}};R?.signIn?(await R.signIn(j),setTimeout(()=>{f(!1)},1e4)):await _.signIn.social(j)}}catch(j){A({variant:"error",message:kn({error:j,localization:o,localizeErrors:I})}),f(!1)}};return C.jsxs(on,{className:Ce(d==="vertical"?"w-full":"grow",e,(p=t?.form)==null?void 0:p.button,(h=t?.form)==null?void 0:h.outlineButton,(g=t?.form)==null?void 0:g.providerButton),disabled:r,variant:"outline",onClick:q,children:[l.icon&&C.jsx(l.icon,{className:(v=t?.form)==null?void 0:v.icon}),d==="grid"&&l.name,d==="vertical"&&`${o.SIGN_IN_WITH} ${l.name}`]})}function rue({className:e,classNames:t,callbackURL:n,cardHeader:r,cardFooter:o,localization:s,path:l,pathname:c,redirectTo:d,socialLayout:f="auto",view:p,otpSeparators:h=0}){var g,v,_,b,x,S;const E=ms(),{basePath:T,credentials:R,localization:O,magicLink:A,emailOTP:I,oneTap:M,passkey:L,signUp:q,social:j,genericOAuth:B,viewPaths:F,Link:Z}=P.useContext(vt);s={...O,...s};let ie=f;ie==="auto"&&(ie=R&&j?.providers&&j.providers.length>2?"horizontal":"vertical");const H=l??c?.split("/").pop(),W=p||Zb(F,H)||"SIGN_IN",[te,le]=P.useState(!1);if(P.useEffect(()=>{const k=()=>le(!1);return window.addEventListener("pagehide",k),()=>{le(!1),window.removeEventListener("pagehide",k)}},[]),W==="CALLBACK")return C.jsx(t5,{redirectTo:d});if(W==="SIGN_OUT")return C.jsx(n5,{redirectTo:d});if(W==="ACCEPT_INVITATION")return C.jsx(Zte,{className:e,classNames:t});const Q=!R&&!A&&!I?s.DISABLED_CREDENTIALS_DESCRIPTION:s[`${W}_DESCRIPTION`];return C.jsxs(nf,{className:Ce("w-full max-w-sm",e,t?.base),children:[C.jsx(DS,{className:t?.header,children:r||C.jsxs(C.Fragment,{children:[C.jsx(GD,{className:Ce("text-lg md:text-xl",t?.title),children:s[W]}),Q&&C.jsx(KD,{className:Ce("text-xs md:text-sm",t?.description),children:Q})]})}),C.jsxs(LS,{className:Ce("grid gap-6",t?.content),children:[M&&["SIGN_IN","SIGN_UP","MAGIC_LINK","EMAIL_OTP"].includes(W)&&C.jsx(Xte,{localization:s,redirectTo:d}),(R||A||I)&&C.jsxs("div",{className:"grid gap-4",children:[C.jsx(Kte,{classNames:t?.form,callbackURL:n,isSubmitting:te,localization:s,otpSeparators:h,view:W,redirectTo:d,setIsSubmitting:le}),A&&(R&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||I&&W==="EMAIL_OTP")&&C.jsx(Qte,{classNames:t,localization:s,view:W,isSubmitting:te}),I&&(R&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||A&&["SIGN_IN","MAGIC_LINK"].includes(W))&&C.jsx(Wte,{classNames:t,localization:s,view:W,isSubmitting:te})]}),W!=="RESET_PASSWORD"&&W!=="EMAIL_VERIFICATION"&&(((g=j?.providers)==null?void 0:g.length)||((v=B?.providers)==null?void 0:v.length)||W==="SIGN_IN"&&L)&&C.jsxs(C.Fragment,{children:[(R||A||I)&&C.jsxs("div",{className:Ce("flex items-center gap-2",t?.continueWith),children:[C.jsx(RA,{className:Ce("!w-auto grow",t?.separator)}),C.jsx("span",{className:"flex-shrink-0 text-muted-foreground text-sm",children:s.OR_CONTINUE_WITH}),C.jsx(RA,{className:Ce("!w-auto grow",t?.separator)})]}),C.jsxs("div",{className:"grid gap-4",children:[(((_=j?.providers)==null?void 0:_.length)||((b=B?.providers)==null?void 0:b.length))&&C.jsxs("div",{className:Ce("flex w-full items-center justify-between gap-4",ie==="horizontal"&&"flex-wrap",ie==="vertical"&&"flex-col",ie==="grid"&&"grid grid-cols-2"),children:[(x=j?.providers)==null?void 0:x.map(k=>{const G=Mte.find(V=>V.provider===k);return G?C.jsx(OA,{classNames:t,callbackURL:n,isSubmitting:te,localization:s,provider:G,redirectTo:d,setIsSubmitting:le,socialLayout:ie},k):null}),(S=B?.providers)==null?void 0:S.map(k=>C.jsx(OA,{classNames:t,callbackURL:n,isSubmitting:te,localization:s,provider:k,redirectTo:d,setIsSubmitting:le,socialLayout:ie,other:!0},k.provider))]}),L&&["SIGN_IN","MAGIC_LINK","EMAIL_OTP","RECOVER_ACCOUNT","TWO_FACTOR","FORGOT_PASSWORD"].includes(W)&&C.jsx(Jte,{classNames:t,isSubmitting:te,localization:s,redirectTo:d,setIsSubmitting:le})]})]})]}),o&&C.jsx(wA,{className:t?.footer,children:o}),R&&q&&C.jsxs(wA,{className:Ce("justify-center gap-1.5 text-muted-foreground text-sm",t?.footer),children:[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?s.DONT_HAVE_AN_ACCOUNT:W==="SIGN_UP"?s.ALREADY_HAVE_AN_ACCOUNT:C.jsx(eK,{className:"size-3"}),W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"||W==="SIGN_UP"?C.jsx(Z,{className:Ce("text-foreground underline",t?.footerLink),href:`${T}/${F[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?"SIGN_UP":"SIGN_IN"]}${E?window.location.search:""}`,children:C.jsx(on,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),children:W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?s.SIGN_UP:s.SIGN_IN})}):C.jsx(on,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),onClick:()=>window.history.back(),children:s.GO_BACK})]})]})}function oue({children:e}){const{hooks:{useSession:t}}=P.useContext(vt),{isPending:n}=t();return n?e:null}function iue({children:e}){const{hooks:{useSession:t}}=P.useContext(vt),{data:n}=t();return n?e:null}function sue({children:e}){const{hooks:{useSession:t}}=P.useContext(vt),{data:n,isPending:r}=t();return!n&&!r?e:null}function ene(e){const t=Hn.c(8),{children:n}=e,r=Ng();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={basePath:"/",pathMode:"slug"},t[0]=o):o=t[0];let s,l;t[1]!==r?(s=d=>r({to:d}),l=d=>r({to:d,replace:!0}),t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let c;return t[4]!==n||t[5]!==s||t[6]!==l?(c=C.jsx(WG,{authClient:Vg,redirectTo:"/",organization:o,navigate:s,replace:l,Link:tne,children:n}),t[4]=n,t[5]=s,t[6]=l,t[7]=c):c=t[7],c}function tne(e){const{href:t,className:n,children:r,...o}=e;return C.jsx(Dg,{to:t,className:n,...o,children:r})}var me=typeof window<"u"?window:void 0,Xn=typeof globalThis<"u"?globalThis:me;typeof self>"u"&&(Xn.self=Xn),typeof File>"u"&&(Xn.File=function(){});var go=Xn?.navigator,Le=Xn?.document,pr=Xn?.location,_1=Xn?.fetch,b1=Xn!=null&&Xn.XMLHttpRequest&&"withCredentials"in new Xn.XMLHttpRequest?Xn.XMLHttpRequest:void 0,TA=Xn?.AbortController,nne=Xn?.CompressionStream,Yr=go?.userAgent,We=me??{},CA="1.372.3",$r={DEBUG:!1,LIB_VERSION:CA,LIB_NAME:"web",JS_SDK_VERSION:CA};function AA(e,t,n,r,o,s,l){try{var c=e[s](l),d=c.value}catch(f){return void n(f)}c.done?t(d):Promise.resolve(d).then(r,o)}function Lo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function l(d){AA(s,r,o,l,c,"next",d)}function c(d){AA(s,r,o,l,c,"throw",d)}l(void 0)}))}}function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ne.apply(null,arguments)}function o5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function w1(){return w1=Lo((function*(e,t,n){t===void 0&&(t=!0);try{var r=new CompressionStream("gzip"),o=r.writable.getWriter(),s=o.write(new TextEncoder().encode(e)).then((()=>o.close())).catch((function(){var d=Lo((function*(f){try{yield o.abort(f)}catch{}throw f}));return function(f){return d.apply(this,arguments)}})()),l=new Response(r.readable).blob(),[c]=yield Promise.all([l,s]);return c}catch(d){if(n!=null&&n.rethrow)throw d;return t&&console.error("Failed to gzip compress data",d),null}})),w1.apply(this,arguments)}var rne=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],IA=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return rne.concat(t).some((r=>{var o=r.toLowerCase();return n.indexOf(o)!==-1}))},one=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function Et(e,t){return e.indexOf(t)!==-1}var ov=function(e){return e.trim()},S1=function(e){return e.replace(/^\$/,"")},i5=Object.prototype,s5=i5.hasOwnProperty,iv=i5.toString,Mt=Array.isArray||function(e){return iv.call(e)==="[object Array]"},is=e=>typeof e=="function",An=e=>e===Object(e)&&!Mt(e),Ic=e=>{if(An(e)){for(var t in e)if(s5.call(e,t))return!1;return!0}return!1},ze=e=>e===void 0,_n=e=>iv.call(e)=="[object String]",Rm=e=>_n(e)&&e.trim().length===0,ys=e=>e===null,xt=e=>ze(e)||ys(e),Fo=e=>iv.call(e)=="[object Number]"&&e==e,Sc=e=>Fo(e)&&e>0,Ri=e=>iv.call(e)==="[object Boolean]",ine=e=>e instanceof FormData,sne=e=>Et(one,e);function a5(e){return e===null||typeof e!="object"}function og(e,t){return{}.toString.call(e)==="[object "+t+"]"}function FS(e){return typeof Event<"u"&&(function(t,n){try{return t instanceof n}catch{return!1}})(e,Event)}var ane=[!0,"true",1,"1","yes"],Z_=e=>Et(ane,e),lne=[!1,"false",0,"0","no"];function Oi(e,t,n,r,o){return t>n&&(r.warn("min cannot be greater than max."),t=n),Fo(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+o),Oi(o||n,t,n,r))}class cne{constructor(t){this.$t={},this.zt=t.zt,this.Ut=Oi(t.bucketSize,0,100,t.Gt),this.Wt=Oi(t.refillRate,0,this.Ut,t.Gt),this.Xt=Oi(t.refillInterval,0,864e5,t.Gt)}Jt(t,n){var r=Math.floor((n-t.lastAccess)/this.Xt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Wt,this.Ut),t.lastAccess=t.lastAccess+r*this.Xt)}consumeRateLimit(t){var n,r=Date.now(),o=String(t),s=this.$t[o];return s?this.Jt(s,r):this.$t[o]=s={tokens:this.Ut,lastAccess:r},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.zt)==null||n.call(this,t)),s.tokens===0)}stop(){this.$t={}}}var bp,PA,Y_,yo="Mobile",ig="iOS",cs="Android",Zc="Tablet",l5=cs+" "+Zc,c5="iPad",u5="Apple",d5=u5+" Watch",$d="Safari",Yc="BlackBerry",f5="Samsung",h5=f5+"Browser",p5=f5+" Internet",al="Chrome",une=al+" OS",m5=al+" "+ig,BS="Internet Explorer",g5=BS+" "+yo,VS="Opera",dne=VS+" Mini",qS="Edge",v5="Microsoft "+qS,Uc="Firefox",y5=Uc+" "+ig,of="Nintendo",sf="PlayStation",Fc="Xbox",_5=cs+" "+yo,b5=yo+" "+$d,Od="Windows",E1=Od+" Phone",MA="Nokia",x1="Ouya",w5="Generic",fne=w5+" "+yo.toLowerCase(),S5=w5+" "+Zc.toLowerCase(),R1="Konqueror",Lr="(\\d+(\\.\\d+)?)",W_=new RegExp("Version/"+Lr),hne=new RegExp(Fc,"i"),pne=new RegExp(sf+" \\w+","i"),mne=new RegExp(of+" \\w+","i"),HS=new RegExp(Yc+"|PlayBook|BB10","i"),gne={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},E5=function(e,t){return t=t||"",Et(e," OPR/")&&Et(e,"Mini")?dne:Et(e," OPR/")?VS:HS.test(e)?Yc:Et(e,"IE"+yo)||Et(e,"WPDesktop")?g5:Et(e,h5)?p5:Et(e,qS)||Et(e,"Edg/")?v5:Et(e,"FBIOS")?"Facebook "+yo:Et(e,"UCWEB")||Et(e,"UCBrowser")?"UC Browser":Et(e,"CriOS")?m5:Et(e,"CrMo")||Et(e,al)?al:Et(e,cs)&&Et(e,$d)?_5:Et(e,"FxiOS")?y5:Et(e.toLowerCase(),R1.toLowerCase())?R1:((n,r)=>r&&Et(r,u5)||(function(o){return Et(o,$d)&&!Et(o,al)&&!Et(o,cs)})(n))(e,t)?Et(e,yo)?b5:$d:Et(e,Uc)?Uc:Et(e,"MSIE")||Et(e,"Trident/")?BS:Et(e,"Gecko")?Uc:""},vne={[g5]:[new RegExp("rv:"+Lr)],[v5]:[new RegExp(qS+"?\\/"+Lr)],[al]:[new RegExp("("+al+"|CrMo)\\/"+Lr)],[m5]:[new RegExp("CriOS\\/"+Lr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Lr)],[$d]:[W_],[b5]:[W_],[VS]:[new RegExp("(Opera|OPR)\\/"+Lr)],[Uc]:[new RegExp(Uc+"\\/"+Lr)],[y5]:[new RegExp("FxiOS\\/"+Lr)],[R1]:[new RegExp("Konqueror[:/]?"+Lr,"i")],[Yc]:[new RegExp(Yc+" "+Lr),W_],[_5]:[new RegExp("android\\s"+Lr,"i")],[p5]:[new RegExp(h5+"\\/"+Lr)],[BS]:[new RegExp("(rv:|MSIE )"+Lr)],Mozilla:[new RegExp("rv:"+Lr)]},yne=function(e,t){var n=E5(e,t),r=vne[n];if(ze(r))return null;for(var o=0;r.length>o;o++){var s=e.match(r[o]);if(s)return parseFloat(s[s.length-2])}return null},NA=[[new RegExp(Fc+"; "+Fc+" (.*?)[);]","i"),e=>[Fc,e&&e[1]||""]],[new RegExp(of,"i"),[of,""]],[new RegExp(sf,"i"),[sf,""]],[HS,[Yc,""]],[new RegExp(Od,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[E1,""];if(new RegExp(yo).test(t)&&!/IEMobile\b/.test(t))return[Od+" "+yo,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=gne[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Od,r]}return[Od,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ig,[e[3],e[4],e[5]||"0"].join(".")]:[ig,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ze(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+cs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+cs+")","i"),e=>e&&e[2]?[cs,[e[2],e[3],e[4]||"0"].join(".")]:[cs,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[une,""]],[/Linux|debian/i,["Linux",""]]],kA=function(e){return mne.test(e)?of:pne.test(e)?sf:hne.test(e)?Fc:new RegExp(x1,"i").test(e)?x1:new RegExp("("+E1+"|WPDesktop)","i").test(e)?E1:/iPad/.test(e)?c5:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?d5:HS.test(e)?Yc:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(MA,"i").test(e)?MA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(yo).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?cs:l5:new RegExp("(pda|"+yo+")","i").test(e)?fne:new RegExp(Zc,"i").test(e)&&!new RegExp(Zc+" pc","i").test(e)?S5:""},_ne=e=>e instanceof Error,x5={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},bne=x5.info;function R5(e){if(Ri(e))return{boolValue:e};if(typeof e=="number")return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e=="string")return{stringValue:e};if(Mt(e))return{arrayValue:{values:e.map((t=>R5(t)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function DA(e){var t=[];for(var n in e){var r=e[n];ys(r)||ze(r)||t.push({key:n,value:R5(r)})}return t}function wne(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return Y_&&n.length===PA||(PA=n.length,Y_=n.reduce(((r,o)=>{bp||(bp={});var s=bp[o];if(s)r[s[0]]=s[1];else for(var l=e(o),c=l.length-1;c>=0;c--){var d=l[c],f=d?.filename,p=t[o];if(f&&p){r[f]=p,bp[o]=[f,p];break}}return r}),{})),Y_}}class Sne{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},o=this.buildCoercingContext(r,n,0).apply(t),s=this.buildParsingContext(n),l=this.parseStacktrace(o,s);return{$exception_list:this.convertToExceptionList(l,r),$exception_level:"error"}}modifyFrames(t){var n=this;return Lo((function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Mt(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t}))()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,o;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(o=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),Ne({},t,{cause:r,stack:o})}applyChunkIds(t,n){return t.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return Lo((function*(){var r=t;for(var o of n.modifiers)r=yield o(r);return r}))()}convertToExceptionList(t,n){var r,o,s,l={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(o=n.handled)===null||o===void 0||o,synthetic:(s=t.synthetic)!==null&&s!==void 0&&s}};t.stack&&(l.stacktrace={type:"raw",frames:t.stack});var c=[l];return t.cause!=null&&c.push(...this.convertToExceptionList(t.cause,Ne({},n,{handled:!0}))),c}buildParsingContext(t){var n;return{chunkIdMap:wne(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var o=(s,l)=>{if(4>=l){var c=this.buildCoercingContext(t,n,l);return this.applyCoercers(s,c)}};return Ne({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:s=>o(s,r),next:s=>o(s,r+1)})}}var Wc="?";function O1(e,t,n,r,o){var s={platform:e,filename:t,function:n==="<anonymous>"?Wc:n,in_app:!0};return ze(r)||(s.lineno=r),ze(o)||(s.colno=o),s}var O5=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Wc,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Ene=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xne=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Rne=/\((\S*)(?::(\d+))(?::(\d+))\)/,One=(e,t)=>{var n=Ene.exec(e);if(n){var[,r,o,s]=n;return O1(t,r,Wc,+o,+s)}var l=xne.exec(e);if(l){if(l[2]&&l[2].indexOf("eval")===0){var c=Rne.exec(l[2]);c&&(l[2]=c[1],l[3]=c[2],l[4]=c[3])}var[d,f]=O5(l[1]||Wc,l[2]);return O1(t,f,d,l[3]?+l[3]:void 0,l[4]?+l[4]:void 0)}},Tne=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Cne=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ane=(e,t)=>{var n=Tne.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Cne.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var o=n[3],s=n[1]||Wc;return[s,o]=O5(s,o),O1(t,o,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},LA=/\(error: (.*)\)/;class Ine{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=_n(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return og(t,"DOMException")}isDOMError(t){return og(t,"DOMError")}}class Pne{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Mne{constructor(){}match(t){return og(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r;return n.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var Nne=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class kne{match(t){return typeof t=="string"}coerce(t,n){var r,[o,s]=this.getInfos(t);return{type:o??"Error",value:s??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,o=t.match(Nne);return o&&(n=o[1],r=o[2]),[n,r]}}var Dne=["fatal","error","warning","log","info","debug"];function T5(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(t>=o.length)return r===n.length?o:o.length>t?o.slice(0,t)+"...":o}return""}class Lne{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,o=this.getErrorPropertyFromObject(t);return o?n.apply(o):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return FS(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+T5(t)}isSeverityLevel(t){return _n(t)&&!Rm(t)&&Dne.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if({}.hasOwnProperty.call(t,n)){var r=t[n];if(_ne(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class $ne{match(t){return FS(t)}coerce(t,n){var r,o=t.constructor.name;return{type:o,value:o+" captured as exception with keys: "+T5(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class jne{match(t){return a5(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class zne{match(t){return og(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!FS(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,o=this.getUnhandledRejectionReason(t);return a5(o)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(o)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var sg="$message",ag="$timestamp",Une=new Set([sg,ag]),Q_={enabled:!0,max_bytes:32768};function lg(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:Q_.enabled,max_bytes:Bne(e.max_bytes,Q_.max_bytes)}:Ne({},Q_)}class Fne{constructor(t){this.Kt=[],this.Qt=0,this.Bt=lg(t)}setConfig(t){this.Bt=lg(t),this.er()}add(t){var n=(function(o){var s=(function(p){var h=new WeakSet;try{return JSON.stringify(p,((g,v)=>{if(typeof v=="bigint")return v.toString();if(typeof v!="function"&&typeof v!="symbol"){if(v instanceof Date)return v.toISOString();if(v instanceof Error)return{name:v.name,message:v.message,stack:v.stack};if(v&&typeof v=="object"){if(h.has(v))return"[Circular]";h.add(v)}return v}}))}catch{return}})(o);if(s)try{var l=JSON.parse(s);if(!An(l))return;var c=l,d=c[sg],f=c[ag];return!_n(d)||d.trim().length===0||!_n(f)&&!Fo(f)?void 0:{step:c,json:s}}catch{return}})(t);if(n){var r=(function(o){if(typeof TextEncoder<"u")return new TextEncoder().encode(o).length;for(var s=encodeURIComponent(o),l=0,c=0;s.length>c;c++)s[c]==="%"?(l+=1,c+=2):l+=1;return l})(n.json);r>this.Bt.max_bytes||(this.Kt.push({step:n.step,bytes:r}),this.Qt+=r,this.er())}}getAttachable(){return this.Kt.map((t=>t.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var t=this.Kt.shift();t&&(this.Qt-=t.bytes)}}}function Bne(e,t){if(!Fo(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var C5=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={C(o){if(me&&($r.DEBUG||We.POSTHOG_DEBUG||n)&&!ze(me.console)&&me.console){for(var s=("__rrweb_original__"in me.console[o])?me.console[o].__rrweb_original__:me.console[o],l=arguments.length,c=new Array(l>1?l-1:0),d=1;l>d;d++)c[d-1]=arguments[d];s(e,...c)}},info(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("log",...s)},warn(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("warn",...s)},error(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];r.C("error",...s)},critical(){for(var o=arguments.length,s=new Array(o),l=0;o>l;l++)s[l]=arguments[l];console.error(e,...s)},uninitializedWarning(o){r.error("You must initialize PostHog before calling "+o)},createLogger:(o,s)=>C5(e+" "+o,s)};return r},$e=C5("[PostHog.js]"),mn=$e.createLogger,Vne=mn("[ExternalScriptsLoader]"),X_=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Vne.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Le?.querySelectorAll("script");if(r){for(var o,s=function(){if(r[l].src===t){var d=r[l];return d.__posthog_loading_callback_fired?{v:n()}:(d.addEventListener("load",(f=>{d.__posthog_loading_callback_fired=!0,n(void 0,f)})),d.onerror=f=>n(f),{v:void 0})}},l=0;r.length>l;l++)if(o=s())return o.v}var c=()=>{if(!Le)return n("document not found");var d=Le.createElement("script");if(d.type="text/javascript",d.crossOrigin="anonymous",d.src=t,d.onload=h=>{d.__posthog_loading_callback_fired=!0,n(void 0,h)},d.onerror=h=>n(h),e.config.prepare_external_dependency_script&&(d=e.config.prepare_external_dependency_script(d)),!d)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")Le.head.appendChild(d);else{var f,p=Le.querySelectorAll("body > script");p.length>0?(f=p[0].parentNode)==null||f.insertBefore(d,p[0]):Le.body.appendChild(d)}};Le!=null&&Le.body?c():Le?.addEventListener("DOMContentLoaded",c)};We.__PosthogExtensions__=We.__PosthogExtensions__||{},We.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!=="remote-config"){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var o="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var s=3e5;o=o+"&t="+Math.floor(Date.now()/s)*s}r=e.requestRouter.endpointFor("assets",o)}X_(e,r,n)}else{var l=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");X_(e,l,n)}},We.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);X_(e,r,n)};var A5="$people_distinct_id",cg="$device_id",Td="__alias",Cd="__timers",T1="$autocapture_disabled_server_side",C1="$heatmaps_enabled_server_side",A1="$exception_capture_enabled_server_side",I1="$error_tracking_suppression_rules",P1="$error_tracking_capture_extension_exceptions",M1="$web_vitals_enabled_server_side",GS="$dead_clicks_enabled_server_side",N1="$product_tours_enabled_server_side",k1="$web_vitals_allowed_metrics",Ad="$session_recording_remote_config",I5="$replay_override_sampling",P5="$replay_override_linked_flag",M5="$replay_override_url_trigger",N5="$replay_override_event_trigger",ug="$sesid",KS="$session_is_sampled",Pc="$enabled_feature_flags",Om="$active_feature_flags",Id="$early_access_features",D1="$feature_flag_details",L1="$feature_flag_payloads",$1="$feature_flag_request_id",os="$override_feature_flags",Ec="$override_feature_flag_payloads",Pd="$stored_person_properties",Wa="$stored_group_properties",j1="$surveys",z1="$surveys_activated",Tm="ph_product_tours",jd="$flag_call_reported",U1="$flag_call_reported_session_id",F1="$feature_flag_errors",dg="$feature_flag_evaluated_at",ei="$user_state",B1="$client_session_props",V1="$capture_rate_limit",q1="$initial_campaign_params",H1="$initial_referrer_info",fg="$initial_person_info",hg="$epp",k5="__POSTHOG_TOOLBAR__",wp="$posthog_cookieless",D5="$sdk_debug_extensions_init_method",L5="$sdk_debug_extensions_init_time_ms",$5="$sdk_debug_recording_script_not_loaded",ZS="PostHog loadExternalDependency extension not found.",Qa="on_reject",as="always",pc="anonymous",mc="identified",G1="identified_only",pg="visibilitychange",mg="beforeunload",xc="$pageview",J_="$pageleave",eb="$identify",$A="$groupidentify";function Sp(e,t){Mt(e)&&e.forEach(t)}function dn(e,t){if(!xt(e))if(Mt(e))e.forEach(t);else if(ine(e))e.forEach(((r,o)=>t(r,o)));else for(var n in e)s5.call(e,n)&&t(e[n],n)}var Rn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var o of n)for(var s in o)o[s]!==void 0&&(e[s]=o[s]);return e};function Cm(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var jA=function(e){try{return e()}catch{return}},qne=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(o){$e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$e.critical(o)}}},YS=function(e){var t={};return dn(e,(function(n,r){(_n(n)&&n.length>0||Fo(n))&&(t[r]=n)})),t},Hne=["herokuapp.com","vercel.app","netlify.app"];function Gne(e){var t=e?.hostname;if(!_n(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of Hne)if(n===r)return!1;return!0}function Vn(e,t,n,r){var{capture:o=!1,passive:s=!0}=r??{};e?.addEventListener(t,n,{capture:o,passive:s})}function j5(e){return e.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Fo(e)&&isFinite(e)&&Math.floor(e)===e});class gg{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,o){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||0>t||0>n||0>r||0>o||t>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=o>>>24,s[13]=o>>>16,s[14]=o>>>8,s[15]=o,new gg(s)}toString(){for(var t="",n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new gg(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;16>n;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Kne{constructor(){this.I=0,this.S=0,this.k=new Zne}generate(){var t=this.generateOrAbort();if(ze(t)){this.I=0;var n=this.generateOrAbort();if(ze(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.I)this.I=t,this.A();else{if(this.I>=t+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return gg.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var zA,z5=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};me&&!ze(me.crypto)&&crypto.getRandomValues&&(z5=e=>crypto.getRandomValues(e));class Zne{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(z5(this.T),this.N=0),this.T[this.N++]}}var na=()=>Yne().toString(),Yne=()=>(zA||(zA=new Kne)).generate(),ud="",Wne=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Ei={R:()=>!!Le,B(e){$e.error("cookieStore error: "+e)},O(e){if(Le){try{for(var t=e+"=",n=Le.cookie.split(";").filter((s=>s.length)),r=0;n.length>r;r++){for(var o=n[r];o.charAt(0)==" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return decodeURIComponent(o.substring(t.length,o.length))}}catch{}return null}},Z(e){var t;try{t=JSON.parse(Ei.O(e))||{}}catch{}return t},M(e,t,n,r,o){if(Le)try{var s="",l="",c=(function(p,h){if(h){var g=(function(_,b){if(b===void 0&&(b=Le),ud)return ud;if(!b||["localhost","127.0.0.1"].includes(_))return"";for(var x=_.split("."),S=Math.min(x.length,8),E="dmn_chk_"+na();!ud&&S--;){var T=x.slice(S).join("."),R=E+"=1;domain=."+T+";path=/";b.cookie=R+";max-age=3",b.cookie.includes(E)&&(b.cookie=R+";max-age=0",ud=T)}return ud})(p);if(!g){var v=(_=>{var b=_.match(Wne);return b?b[0]:""})(p);v!==g&&$e.info("Warning: cookie subdomain discovery mismatch",v,g),g=v}return g?"; domain=."+g:""}return""})(Le.location.hostname,r);if(n){var d=new Date;d.setTime(d.getTime()+864e5*n),s="; expires="+d.toUTCString()}o&&(l="; secure");var f=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+c+l;return f.length>3686.4&&$e.warn("cookieStore warning: large cookie, len="+f.length),Le.cookie=f,f}catch{return}},F(e,t){if(Le!=null&&Le.cookie)try{Ei.M(e,"",-1,t)}catch{return}}},tb=null,yn={R(){if(!ys(tb))return tb;var e=!0;if(ze(me))e=!1;else try{var t="__mplssupport__";yn.M(t,"xyz"),yn.O(t)!=='"xyz"'&&(e=!1),yn.F(t)}catch{e=!1}return e||$e.error("localStorage unsupported; falling back to cookie store"),tb=e,e},B(e){$e.error("localStorage error: "+e)},O(e){try{return me?.localStorage.getItem(e)}catch(t){yn.B(t)}return null},Z(e){try{return JSON.parse(yn.O(e))||{}}catch{}return null},M(e,t){try{me?.localStorage.setItem(e,JSON.stringify(t))}catch(n){yn.B(n)}},F(e){try{me?.localStorage.removeItem(e)}catch(t){yn.B(t)}}},Qne=[cg,"distinct_id",ug,KS,hg,fg,ei],Ep={},Xne={R:()=>!0,B(e){$e.error("memoryStorage error: "+e)},O:e=>Ep[e]||null,Z:e=>Ep[e]||null,M(e,t){Ep[e]=t},F(e){delete Ep[e]}},qa=null,mr={R(){if(!ys(qa))return qa;if(qa=!0,ze(me))qa=!1;else try{var e="__support__";mr.M(e,"xyz"),mr.O(e)!=='"xyz"'&&(qa=!1),mr.F(e)}catch{qa=!1}return qa},B(e){$e.error("sessionStorage error: ",e)},O(e){try{return me?.sessionStorage.getItem(e)}catch(t){mr.B(t)}return null},Z(e){try{return JSON.parse(mr.O(e))||null}catch{}return null},M(e,t){try{me?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){mr.B(n)}},F(e){try{me?.sessionStorage.removeItem(e)}catch(t){mr.B(t)}}};class Jne{constructor(t){this._instance=t}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===as||this.isRejected()||this.consent===-1&&this.Bt.cookieless_mode===Qa}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Bt.opt_out_capturing_by_default}optInOut(t){this.nr.M(this.sr,t?1:0,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get ir(){var t=this.nr.O(this.sr);return Z_(t)?1:Et(lne,t)?0:-1}get nr(){var t=this.Bt.opt_out_capturing_persistence_type,n=t==="localStorage"?yn:Ei;if(!this.ar||this.ar!==n){this.ar=n;var r=t==="localStorage"?Ei:yn;r.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(Z_(r.O(this.sr))),r.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[go?.doNotTrack,go?.msDoNotTrack,We.doNotTrack].some((t=>Z_(t)))}}var xp=mn("[Dead Clicks]"),ere=()=>!0,tre=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(GS)),r=e.instance.config.capture_dead_clicks;return Ri(r)?r:!!An(r)||n};class UA{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[GS]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(t){var n,r;(n=We.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(o=>{o?xp.error("failed to load script",o):t()}))}hr(){var t;if(Le){if(!this.lr&&(t=We.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=An(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.lr=We.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.lr.start(Le),xp.info("starting...")}}else xp.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,xp.info("stopping..."))}}var nb=mn("[SegmentIntegration]"),U5="posthog-js";function F5(e,t){var{organization:n,projectId:r,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:l=!0}=t===void 0?{}:t;return c=>{var d,f,p,h,g;if(s!=="*"&&!s.includes(c.level)||!e.__loaded)return c;c.tags||(c.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());c.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var _,b=((d=c.exception)==null?void 0:d.values)||[],x=b.map((E=>Ne({},E,{stacktrace:E.stacktrace?Ne({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map((T=>Ne({},T,{platform:"web:javascript"})))}):void 0}))),S={$exception_message:((f=b[0])==null?void 0:f.value)||c.message,$exception_type:(p=b[0])==null?void 0:p.type,$exception_level:c.level,$exception_list:x,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((h=b[0])==null?void 0:h.value)||c.message,$sentry_exception_type:(g=b[0])==null?void 0:g.type,$sentry_tags:c.tags};return n&&r&&(S.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+c.event_id),l&&((_=e.exceptions)==null||_.sendExceptionEvent(S)),c}}class nre{constructor(t,n,r,o,s,l){this.name=U5,this.setupOnce=function(c){c(F5(t,{organization:n,projectId:r,prefix:o,severityAllowList:s,sendExceptionsToPostHog:l==null||l}))}}}class FA{constructor(t){this.cr=(n,r,o)=>{o&&(o.noSessionId||o.activityTimeout||o.sessionPastMaximumLength)&&($e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:o}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.vr()}vr(){var t;this.pr=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.cr)}destroy(){var t;(t=this.pr)==null||t.call(this),this.pr=void 0}doPageView(t,n){var r,o=this.gr(t,n);return this.dr={pathname:(r=me?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),o}doPageLeave(t){var n;return this.gr(t,(n=this.dr)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.dr)==null?void 0:t.pageViewId}}gr(t,n){var r=this.dr;if(!r)return{$pageview_id:n};var o={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:l,lastScrollY:c,maxScrollY:d,maxContentHeight:f,lastContentY:p,maxContentY:h}=s;if(!(ze(l)||ze(c)||ze(d)||ze(f)||ze(p)||ze(h))){l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p),h=Math.ceil(h);var g=l>1?Oi(c/l,0,1,$e):1,v=l>1?Oi(d/l,0,1,$e):1,_=f>1?Oi(p/f,0,1,$e):1,b=f>1?Oi(h/f,0,1,$e):1;o=Rn(o,{$prev_pageview_last_scroll:c,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:d,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(o.$prev_pageview_pathname=r.pathname),r.timestamp&&(o.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),o}}var rre={[A5]:{exposure:"hidden"},[Td]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Cd]:{exposure:"hidden"},[T1]:{exposure:"event"},[C1]:{exposure:"hidden"},[A1]:{exposure:"event"},[I1]:{exposure:"hidden"},[P1]:{exposure:"event"},[M1]:{exposure:"event"},[GS]:{exposure:"event"},[N1]:{exposure:"hidden"},[k1]:{exposure:"event"},[Ad]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ug]:{exposure:"hidden"},[KS]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[Pc]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!An(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t["$feature/"+n[r]]=e[n[r]];return t}},[Om]:{exposure:"event"},[Id]:{exposure:"hidden"},[D1]:{exposure:"hidden"},[L1]:{exposure:"event"},[$1]:{exposure:"event"},[os]:{exposure:"event"},[Ec]:{exposure:"hidden"},[Pd]:{exposure:"hidden"},[Wa]:{exposure:"hidden"},[j1]:{exposure:"hidden"},[z1]:{exposure:"event"},[Tm]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[jd]:{exposure:"hidden"},[U1]:{exposure:"hidden"},[F1]:{exposure:"hidden"},[dg]:{exposure:"hidden"},[ei]:{exposure:"hidden"},[B1]:{exposure:"hidden"},[V1]:{exposure:"hidden"},[q1]:{exposure:"hidden"},[H1]:{exposure:"hidden"},[fg]:{exposure:"hidden"},[hg]:{exposure:"hidden"},[I5]:{exposure:"event"},[P5]:{exposure:"event"},[M5]:{exposure:"event"},[N5]:{exposure:"event"},[D5]:{exposure:"event"},[L5]:{exposure:"event"},[$5]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},ore=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],vg=e=>{var t=Le?.createElement("a");return ze(t)?null:(t.href=e,t)},yg=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),o=0;r.length>o;o++){var s=r[o].split("=");if(s[0]===t){n=s;break}}if(!Mt(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch{$e.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")},af=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),o=r[1],s=(r[0]||"").split("?"),l=s[1],c=s[0],d=(l||"").split("&"),f=[],p=0;d.length>p;p++){var h=d[p].split("=");Mt(h)&&(t.includes(h[0])?f.push(h[0]+"="+n):f.push(d[p]))}var g=c;return l!=null&&(g+="?"+f.join("&")),o!=null&&(g+="#"+o),g},_g=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Rp="https?://(.*)",Qc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ire=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qc],lf="<masked>",sre=["li_fat_id"];function B5(e,t,n){if(!Le)return{};var r,o=t?[...Qc,...n||[]]:[],s=V5(af(Le.URL,o,lf),e),l=(r={},dn(sre,(function(c){var d=Ei.O(c);r[c]=d||null})),r);return Rn(l,s)}function V5(e,t){var n=ire.concat(t||[]),r={};return dn(n,(function(o){var s=yg(e,o);r[o]=s||null})),r}function q5(e){var t=(function(s){return s?s.search(Rp+"google.([^/?]*)")===0?"google":s.search(Rp+"bing.com")===0?"bing":s.search(Rp+"yahoo.com")===0?"yahoo":s.search(Rp+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!ys(t)){r.$search_engine=t;var o=Le?yg(Le.referrer,n):"";o.length&&(r.ph_keyword=o)}return r}function BA(){return navigator.language||navigator.userLanguage}var bg="$direct";function H5(){return Le?.referrer||bg}function G5(e,t){var n=e?[...Qc,...t||[]]:[],r=pr?.href.substring(0,1e3);return{r:H5().substring(0,1e3),u:r?af(r,n,lf):void 0}}function K5(e){var t,{r:n,u:r}=e,o={$referrer:n,$referring_domain:n==null?void 0:n==bg?bg:(t=vg(n))==null?void 0:t.host};if(r){o.$current_url=r;var s=vg(r);o.$host=s?.host,o.$pathname=s?.pathname;var l=V5(r);Rn(o,l)}if(n){var c=q5(n);Rn(o,c)}return o}function Z5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function are(){try{return new Date().getTimezoneOffset()}catch{return}}var lre=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class rb{constructor(t,n){this.Bt=t,this.props={},this.mr=!1,this.yr=(r=>{var o="";return r.token&&(o=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+o+"_posthog"})(t),this.nr=this.br(t),this.load(),t.debug&&$e.info("Persistence loaded",t.persistence,Ne({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this._r}br(t){lre.indexOf(t.persistence.toLowerCase())===-1&&($e.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(o){o===void 0&&(o=[]);var s=[...Qne,...o];return Ne({},yn,{Z(l){try{var c={};try{c=Ei.Z(l)||{}}catch{}var d=Rn(c,JSON.parse(yn.O(l)||"{}"));return yn.M(l,d),d}catch{}return null},M(l,c,d,f,p,h){try{yn.M(l,c,void 0,void 0,h);var g={};s.forEach((v=>{c[v]&&(g[v]=c[v])})),Object.keys(g).length&&Ei.M(l,g,d,f,p,h)}catch(v){yn.B(v)}},F(l,c){try{me?.localStorage.removeItem(l),Ei.F(l,c)}catch(d){yn.B(d)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&yn.R()?yn:r==="localstorage+cookie"&&n.R()?n:r==="sessionstorage"&&mr.R()?mr:r==="memory"?Xne:r==="cookie"?Ei:n.R()?n:Ei}wr(t){var n=t??this.Bt.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[dg];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return dn(this.props,((n,r)=>{var o=(s=>{var l=rre[s];if(l)return l;for(var[c,d]of ore)if(s.indexOf(c)===0)return d})(r);if(o?.exposure==="derived"){if(o.shouldSkipFromEventProperties!=null&&o.shouldSkipFromEventProperties(n,r===Pc?()=>this.wr():()=>!1))return;o.transformToEventProperties&&Rn(t,o.transformToEventProperties(n))}else o&&o.exposure!=="event"||(t[r]=n)})),t}load(){if(!this._r){var t=this.nr.Z(this.yr);t&&(this.props=Rn({},t))}}save(){this._r||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(An(t)){ze(n)&&(n="None"),this.Ir=ze(r)?this.kr:r;var o=!1;if(dn(t,((s,l)=>{this.props.hasOwnProperty(l)&&this.props[l]!==n||(this.Tr(l,s),o=!0)})),o)return this.save(),!0}return!1}register(t,n){if(An(t)){this.Ir=ze(n)?this.kr:n;var r=!1;if(dn(t,((o,s)=>{t.hasOwnProperty(s)&&this.props[s]!==o&&(this.Tr(s,o),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Ar(t),this.save())}update_campaign_params(){if(!this.mr){var t=B5(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);Ic(YS(t))||this.register(t),this.mr=!0}}update_search_keyword(){var t;this.register((t=Le?.referrer)?q5(t):{})}update_referrer_info(){var t;this.register_once({$referrer:H5(),$referring_domain:Le!=null&&Le.referrer&&((t=vg(Le.referrer))==null?void 0:t.host)||bg},void 0)}set_initial_person_info(){this.props[q1]||this.props[H1]||this.register_once({[fg]:G5(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};dn([H1,q1],(l=>{var c=this.props[l];c&&dn(c,(function(d,f){t["$initial_"+S1(f)]=d}))}));var n,r,o=this.props[fg];if(o){var s=(n=K5(o),r={},dn(n,(function(l,c){r["$initial_"+S1(c)]=l})),r);Rn(t,s)}return t}safe_merge(t){return dn(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.kr=this.Ir=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((l,c)=>{if(l.length!==c.length)return!1;var d=[...l].sort(),f=[...c].sort();return d.every(((p,h)=>p===f[h]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var o=this.br(t),s=this.props;this.clear(),this.nr=o,this.props=s,this.save()}}set_disabled(t){this._r=t,this._r?this.remove():this.save()}set_cross_subdomain(t){t!==this.Cr&&(this.Cr=t,this.remove(),this.save())}set_secure(t){t!==this.Sr&&(this.Sr=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Cd]||{};r[t]=n,this.Tr(Cd,r),this.save()}remove_event_timer(t){var n=this.props[Cd]||{},r=n[t];return ze(r)||(delete n[t],this.Tr(Cd,n),this.save()),r}get_property(t){return this.props[t]}set_property(t,n){this.Tr(t,n),this.save()}Tr(t,n){this.props[t]=n}Ar(t){delete this.props[t]}}var dd={Activation:"events",Cancellation:"cancelEvents"},ob={Popover:"popover",API:"api",Widget:"widget"},Md={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},ib={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},K1={Popover:"popover",Inline:"inline"},cre={SHOWN:"product tour shown"},VA={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},qA=mn("[RateLimiter]");class ure{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((o=>{qA.info((o||"events")+" is quota limited."),this.serverLimits[o]=new Date().getTime()+6e4}))}catch(o){return void qA.warn('could not rate limit - continuing. Error: "'+o?.message+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,o;t===void 0&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:l}=this,c=new Date().getTime(),d=(n=(r=this.instance.persistence)==null?void 0:r.get_property(V1))!==null&&n!==void 0?n:{tokens:s,last:c};d.tokens+=(c-d.last)/1e3*l,d.last=c,d.tokens>s&&(d.tokens=s);var f=1>d.tokens;return f||t||(d.tokens=Math.max(0,d.tokens-1)),!f||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+l+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(o=this.instance.persistence)==null||o.set_property(V1,d),{isRateLimited:f,remainingTokens:d.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var fd=mn("[RemoteConfig]");class Y5{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=We._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}Er(t){var n,r;(n=We.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Rr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){t(n.json)}})}load(){try{if(this.remoteConfig)return fd.info("Using preloaded remote config",this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void fd.warn("Remote config is disabled. Falling back to local config.");this.Er((t=>{if(!t)return fd.info("No config found after loading remote JS config. Falling back to JSON."),void this.Rr((n=>{this.Nr(n),this.Mr()}));this.Nr(t),this.Mr()}))}catch(t){fd.error("Error loading remote config",t)}}stop(){this.Or&&(clearInterval(this.Or),this.Or=void 0)}refresh(){this._instance.Fr()||Le?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}Mr(){var t;if(!this.Or){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.Or=setInterval((()=>{this.refresh()}),n))}}Nr(t){var n;t||fd.error("Failed to fetch remote config from PostHog."),this._instance.Nr(t??{}),t?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var _i={GZipJS:"gzip-js",Base64:"base64"},Uo=Uint8Array,Jr=Uint16Array,Xc=Uint32Array,WS=new Uo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),QS=new Uo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),HA=new Uo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),W5=function(e,t){for(var n=new Jr(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var o=new Xc(n[30]);for(r=1;30>r;++r)for(var s=n[r];n[r+1]>s;++s)o[s]=s-n[r]<<5|r;return[n,o]},Q5=W5(WS,2),Z1=Q5[1];Q5[0][28]=258,Z1[258]=28;for(var GA=W5(QS,0)[1],X5=new Jr(32768),fn=0;32768>fn;++fn){var gc=(43690&fn)>>>1|(21845&fn)<<1;X5[fn]=((65280&(gc=(61680&(gc=(52428&gc)>>>2|(13107&gc)<<2))>>>4|(3855&gc)<<4))>>>8|(255&gc)<<8)>>>1}var zd=function(e,t,n){for(var r=e.length,o=0,s=new Jr(t);r>o;++o)++s[e[o]-1];var l,c=new Jr(t);for(o=0;t>o;++o)c[o]=c[o-1]+s[o-1]<<1;for(l=new Jr(r),o=0;r>o;++o)l[o]=X5[c[e[o]-1]++]>>>15-e[o];return l},dl=new Uo(288);for(fn=0;144>fn;++fn)dl[fn]=8;for(fn=144;256>fn;++fn)dl[fn]=9;for(fn=256;280>fn;++fn)dl[fn]=7;for(fn=280;288>fn;++fn)dl[fn]=8;var wg=new Uo(32);for(fn=0;32>fn;++fn)wg[fn]=5;var dre=zd(dl,9),fre=zd(wg,5),J5=function(e){return(e/8>>0)+(7&e&&1)},e6=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Jr?Jr:e instanceof Xc?Xc:Uo)(n-t);return r.set(e.subarray(t,n)),r},Ji=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},hd=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},sb=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,s=n.slice();if(!o)return[new Uo(0),0];if(o==1){var l=new Uo(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort((function(O,A){return O.f-A.f})),n.push({s:-1,f:25001});var c=n[0],d=n[1],f=0,p=1,h=2;for(n[0]={s:-1,f:c.f+d.f,l:c,r:d};p!=o-1;)c=n[n[h].f>n[f].f?f++:h++],d=n[f!=p&&n[h].f>n[f].f?f++:h++],n[p++]={s:-1,f:c.f+d.f,l:c,r:d};var g=s[0].s;for(r=1;o>r;++r)s[r].s>g&&(g=s[r].s);var v=new Jr(g+1),_=Y1(n[p-1],v,0);if(_>t){r=0;var b=0,x=_-t,S=1<<x;for(s.sort((function(O,A){return v[A.s]-v[O.s]||O.f-A.f}));o>r;++r){var E=s[r].s;if(t>=v[E])break;b+=S-(1<<_-v[E]),v[E]=t}for(b>>>=x;b>0;){var T=s[r].s;t>v[T]?b-=1<<t-v[T]++-1:++r}for(;r>=0&&b;--r){var R=s[r].s;v[R]==t&&(--v[R],++b)}_=t}return[new Uo(v),_]},Y1=function(e,t,n){return e.s==-1?Math.max(Y1(e.l,t,n+1),Y1(e.r,t,n+1)):t[e.s]=n},KA=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Jr(++t),r=0,o=e[0],s=1,l=function(d){n[r++]=d},c=1;t>=c;++c)if(e[c]==o&&c!=t)++s;else{if(!o&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(o),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(o);s=1,o=e[c]}return[n.subarray(0,r),t]},pd=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},W1=function(e,t,n){var r=n.length,o=J5(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var s=0;r>s;++s)e[o+s+4]=n[s];return 8*(o+4+r)},ZA=function(e,t,n,r,o,s,l,c,d,f,p){Ji(t,p++,n),++o[256];for(var h=sb(o,15),g=h[0],v=h[1],_=sb(s,15),b=_[0],x=_[1],S=KA(g),E=S[0],T=S[1],R=KA(b),O=R[0],A=R[1],I=new Jr(19),M=0;E.length>M;++M)I[31&E[M]]++;for(M=0;O.length>M;++M)I[31&O[M]]++;for(var L=sb(I,7),q=L[0],j=L[1],B=19;B>4&&!q[HA[B-1]];--B);var F,Z,ie,H,W=f+5<<3,te=pd(o,dl)+pd(s,wg)+l,le=pd(o,g)+pd(s,b)+l+14+3*B+pd(I,q)+(2*I[16]+3*I[17]+7*I[18]);if(te>=W&&le>=W)return W1(t,p,e.subarray(d,d+f));if(Ji(t,p,1+(te>le)),p+=2,te>le){F=zd(g,v),Z=g,ie=zd(b,x),H=b;var Q=zd(q,j);for(Ji(t,p,T-257),Ji(t,p+5,A-1),Ji(t,p+10,B-4),p+=14,M=0;B>M;++M)Ji(t,p+3*M,q[HA[M]]);p+=3*B;for(var k=[E,O],G=0;2>G;++G){var V=k[G];for(M=0;V.length>M;++M)Ji(t,p,Q[D=31&V[M]]),p+=q[D],D>15&&(Ji(t,p,V[M]>>>5&127),p+=V[M]>>>12)}}else F=dre,Z=dl,ie=fre,H=wg;for(M=0;c>M;++M)if(r[M]>255){var D;hd(t,p,F[257+(D=r[M]>>>18&31)]),p+=Z[D+257],D>7&&(Ji(t,p,r[M]>>>23&31),p+=WS[D]);var U=31&r[M];hd(t,p,ie[U]),p+=H[U],U>3&&(hd(t,p,r[M]>>>5&8191),p+=QS[U])}else hd(t,p,F[r[M]]),p+=Z[r[M]];return hd(t,p,F[256]),p+Z[256]},hre=new Xc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),pre=(function(){for(var e=new Xc(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),ab=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function mre(e,t){t===void 0&&(t={});var n=(function(){var h=4294967295;return{p(g){for(var v=h,_=0;g.length>_;++_)v=pre[255&v^g[_]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=e.length;n.p(e);var o,s,l,c,d,f=(c=10+((o=t).filename&&o.filename.length+1||0),d=8,(function(h,g,v,_,b,x){var S=h.length,E=new Uo(_+S+5*(1+Math.floor(S/7e3))+b),T=E.subarray(_,E.length-b),R=0;if(!g||8>S)for(var O=0;S>=O;O+=65535){var A=O+65535;S>A?R=W1(T,R,h.subarray(O,A)):(T[O]=!0,R=W1(T,R,h.subarray(O,S)))}else{for(var I=hre[g-1],M=I>>>13,L=8191&I,q=(1<<v)-1,j=new Jr(32768),B=new Jr(q+1),F=Math.ceil(v/3),Z=2*F,ie=function(Ue){return(h[Ue]^h[Ue+1]<<F^h[Ue+2]<<Z)&q},H=new Xc(25e3),W=new Jr(288),te=new Jr(32),le=0,Q=0,k=(O=0,0),G=0,V=0;S>O;++O){var D=ie(O),U=32767&O,X=B[D];if(j[U]=X,B[D]=U,O>=G){var fe=S-O;if((le>7e3||k>24576)&&fe>423){R=ZA(h,T,0,H,W,te,Q,k,V,O-V,R),k=le=Q=0,V=O;for(var pe=0;286>pe;++pe)W[pe]=0;for(pe=0;30>pe;++pe)te[pe]=0}var xe=2,je=0,Y=L,re=U-X&32767;if(fe>2&&D==ie(O-re))for(var ve=Math.min(M,fe)-1,se=Math.min(32767,O),Se=Math.min(258,fe);se>=re&&--Y&&U!=X;){if(h[O+xe]==h[O+xe-re]){for(var Te=0;Se>Te&&h[O+Te]==h[O+Te-re];++Te);if(Te>xe){if(xe=Te,je=re,Te>ve)break;var tt=Math.min(re,Te-2),rt=0;for(pe=0;tt>pe;++pe){var Be=O-re+pe+32768&32767,Qe=Be-j[Be]+32768&32767;Qe>rt&&(rt=Qe,X=Be)}}}re+=(U=X)-(X=j[U])+32768&32767}if(je){H[k++]=268435456|Z1[xe]<<18|GA[je];var Me=31&Z1[xe],Pe=31&GA[je];Q+=WS[Me]+QS[Pe],++W[257+Me],++te[Pe],G=O+xe,++le}else H[k++]=h[O],++W[h[O]]}}R=ZA(h,T,!0,H,W,te,Q,k,V,O-V,R)}return e6(E,0,_+J5(R)+b)})(s=e,(l=t).level==null?6:l.level,l.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+l.mem,c,d)),p=f.length;return(function(h,g){var v=g.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>g.level?4:g.level==9?2:0,h[9]=3,g.mtime!=0&&ab(h,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){h[3]=8;for(var _=0;v.length>=_;++_)h[_+10]=v.charCodeAt(_)}})(f,t),ab(f,p-8,n.d()),ab(f,p-4,r),f}var gre=!!b1||!!_1,t6="text/plain",YA=!1,sv=function(e,t,n){var r;n===void 0&&(n=!0);var[o,s]=e.split("?"),l=Ne({},t),c=(r=s?.split("&").map((f=>{var p,[h,g]=f.split("="),v=n&&(p=l[h])!==null&&p!==void 0?p:g;return delete l[h],h+"="+v})))!==null&&r!==void 0?r:[],d=(function(f,p){var h,g;p===void 0&&(p="&");var v=[];return dn(f,(function(_,b){ze(_)||ze(b)||b==="undefined"||(h=encodeURIComponent((x=>x instanceof File)(_)?_.name:_.toString()),g=encodeURIComponent(b),v[v.length]=g+"="+h)})),v.join(p)})(l);return d&&c.push(d),o+"?"+c.join("&")},Mc=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),lb=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===_i.GZipJS){var r=mre((function(c,d){var f=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var p=new Uo(c.length+(c.length>>>1)),h=0,g=function(x){p[h++]=x},v=0;f>v;++v){if(h+5>p.length){var _=new Uo(h+8+(f-v<<1));_.set(p),p=_}var b=c.charCodeAt(v);128>b?g(b):2048>b?(g(192|b>>>6),g(128|63&b)):b>55295&&57344>b?(g(240|(b=65536+(1047552&b)|1023&c.charCodeAt(++v))>>>18),g(128|b>>>12&63),g(128|b>>>6&63),g(128|63&b)):(g(224|b>>>12),g(128|b>>>6&63),g(128|63&b))}return e6(p,0,h)})(Mc(t)),{mtime:0});return{contentType:t6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===_i.Base64){var o=(function(c){return c&&btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,((d,f)=>String.fromCharCode(parseInt(f,16)))))})(Mc(t)),s=(c=>"data="+encodeURIComponent(typeof c=="string"?c:Mc(c)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var l=Mc(t);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},vre=(function(){var e=Lo((function*(t){var n=Mc(t.data),r=yield(function(s,l,c){return w1.apply(this,arguments)})(n,$r.DEBUG,{rethrow:!0});if(!r)return t;var o=yield r.arrayBuffer();return Ne({},t,{tr:{contentType:t6,body:o,estimatedSize:o.byteLength}})}));return function(t){return e.apply(this,arguments)}})(),WA=(e,t)=>sv(e,{_:new Date().getTime().toString(),ver:$r.JS_SDK_VERSION,compression:t}),Am=[];_1&&Am.push({transport:"fetch",method(e){var t,n,{contentType:r,body:o,estimatedSize:s}=(t=lb(e))!==null&&t!==void 0?t:{},l=new Headers;dn(e.headers,(function(p,h){l.append(h,p)})),r&&l.append("Content-Type",r);var c=e.url,d=null;if(TA){var f=new TA;d={signal:f.signal,timeout:setTimeout((()=>f.abort()),e.timeout)}}_1(c,Ne({method:e?.method||"GET",headers:l,keepalive:e.method==="POST"&&52428.8>(s||0),body:o,signal:(n=d)==null?void 0:n.signal},e.fetchOptions)).then((p=>p.text().then((h=>{var g={statusCode:p.status,text:h};if(p.status===200)try{g.json=JSON.parse(h)}catch(v){$e.error(v)}e.callback==null||e.callback(g)})))).catch((p=>{$e.error(p),e.callback==null||e.callback({statusCode:0,error:p})})).finally((()=>d?clearTimeout(d.timeout):null))}}),b1&&Am.push({transport:"XHR",method(e){var t,n=new b1;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:o}=(t=lb(e))!==null&&t!==void 0?t:{};dn(e.headers,(function(s,l){n.setRequestHeader(l,s)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(s)}},n.send(o)}}),go!=null&&go.sendBeacon&&Am.push({transport:"sendBeacon",method(e){var t=sv(e.url,{beacon:"1"});try{var n,{contentType:r,body:o}=(n=lb(e))!==null&&n!==void 0?n:{};if(!o)return;var s=o instanceof Blob?o:new Blob([o],{type:r});go.sendBeacon(t,s)}catch{}}});var Q1=3e3;class yre{constructor(t,n){this.Pr=!0,this.Lr=[],this.Dr=Oi(n?.flush_interval_ms||Q1,250,5e3,$e.createLogger("flush interval"),Q1),this.Br=t}enqueue(t){this.Lr.push(t),this.jr||this.$r()}unload(){this.qr();var t=this.Lr.length>0?this.Zr():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Br(Ne({},r,{transport:"sendBeacon"}))}))}enable(){this.Pr=!1,this.$r()}$r(){var t=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var n=this.Zr(),r=function(){var s=n[o],l=new Date().getTime();s.data&&Mt(s.data)&&dn(s.data,(c=>{c.offset=Math.abs(c.timestamp-l),delete c.timestamp})),t.Br(s)};for(var o in n)r()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var t={};return dn(this.Lr,(n=>{var r,o=n,s=(o?o.batchKey:null)||o.url;ze(t[s])&&(t[s]=Ne({},o,{data:[]})),(r=t[s].data)==null||r.push(o.data)})),this.Lr=[],t}}var _re=["retriesPerformedSoFar"];class bre{constructor(t){this.Vr=!1,this.Hr=3e3,this.Lr=[],this._instance=t,this.Lr=[],this.zr=!0,!ze(me)&&"onLine"in me.navigator&&(this.zr=me.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},Vn(me,"online",this.Ur),Vn(me,"offline",this.Gr))}get length(){return this.Lr.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=o5(t,_re);Sc(n)&&(r.url=sv(r.url,{retry_count:n})),this._instance._send_request(Ne({},r,{callback:o=>{o.statusCode===200||o.statusCode>=400&&500>o.statusCode||(n??0)>=10?r.callback==null||r.callback(o):this.Wr(Ne({retriesPerformedSoFar:n},r))}}))}Wr(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(l){var c=3e3*Math.pow(2,l),d=c/2,f=Math.min(18e5,c),p=Math.random()-.5;return Math.ceil(f+p*(f-d))})(n),o=Date.now()+r;this.Lr.push({retryAt:o,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),$e.warn(s),this.Vr||(this.Vr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),this.Lr.length===0)return this.Vr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Hr)}Yr(){var t=Date.now(),n=[],r=this.Lr.filter((s=>t>s.retryAt||(n.push(s),!1)));if(this.Lr=n,r.length>0)for(var{requestOptions:o}of r)this.retriableRequest(o)}unload(){for(var{requestOptions:t}of(this.Jr&&(clearTimeout(this.Jr),this.Jr=void 0),this.Vr=!1,ze(me)||(this.Ur&&(me.removeEventListener("online",this.Ur),this.Ur=void 0),this.Gr&&(me.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Lr))try{this._instance._send_request(Ne({},t,{transport:"sendBeacon"}))}catch(n){$e.error(n)}this.Lr=[]}}class wre{constructor(t){this.Kr=()=>{var n,r,o,s;this.Qr||(this.Qr={});var l=this.scrollElement(),c=this.scrollY(),d=l?Math.max(0,l.scrollHeight-l.clientHeight):0,f=c+(l?.clientHeight||0),p=l?.scrollHeight||0;this.Qr.lastScrollY=Math.ceil(c),this.Qr.maxScrollY=Math.max(c,(n=this.Qr.maxScrollY)!==null&&n!==void 0?n:0),this.Qr.maxScrollHeight=Math.max(d,(r=this.Qr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Qr.lastContentY=f,this.Qr.maxContentY=Math.max(f,(o=this.Qr.maxContentY)!==null&&o!==void 0?o:0),this.Qr.maxContentHeight=Math.max(p,(s=this.Qr.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var t=this.Qr;return setTimeout(this.Kr,0),t}startMeasuringScrollPosition(){Vn(me,"scroll",this.Kr,{capture:!0}),Vn(me,"scrollend",this.Kr,{capture:!0}),Vn(me,"resize",this.Kr)}scrollElement(){if(!this.ei)return me?.document.documentElement;var t=Mt(this.ei)?this.ei:[this.ei];for(var n of t){var r=me?.document.querySelector(n);if(r)return r}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return me&&(me.scrollY||me.pageYOffset||me.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return me&&(me.scrollX||me.pageXOffset||me.document.documentElement.scrollLeft)||0}}var Sre=e=>G5(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class QA{constructor(t,n,r,o){this.ti=s=>{var l=this.ri();if(!l||l.sessionId!==s){var c={sessionId:s,props:this.ii(this._instance)};this.ni.register({[B1]:c})}},this._instance=t,this.si=n,this.ni=r,this.ii=o||Sre,this.si.onSessionId(this.ti)}ri(){return this.ni.props[B1]}getSetOnceProps(){var t,n=(t=this.ri())==null?void 0:t.props;return n?"r"in n?K5(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return dn(YS(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+S1(r)]=n})),t}}class XS{constructor(){this.oi={}}on(t,n){return this.oi[t]||(this.oi[t]=[]),this.oi[t].push(n),()=>{this.oi[t]=this.oi[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.oi[t]||[])r(n);for(var o of this.oi["*"]||[])o(t,n)}}var cb=mn("[SessionId]");class XA{on(t,n){return this.ai.on(t,n)}constructor(t,n,r){var o;if(this.li=[],this.ui=void 0,this.ai=new XS,this.hi=(f,p)=>!(!Sc(f)||!Sc(p))&&Math.abs(f-p)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===as)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Bt=t.config,this.ni=t.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=n||na,this.fi=r||na;var s=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*Oi(this.Bt.session_idle_timeout_seconds||1800,60,36e3,cb.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+s+"_window_id",this.mi="ph_"+s+"_primary_window_exists",this.yi()){var l=mr.Z(this.gi),c=mr.Z(this.mi);l&&!c?this.ci=l:mr.F(this.gi),mr.M(this.mi,!0)}if((o=this.Bt.bootstrap)!=null&&o.sessionID)try{var d=(f=>{var p=this.Bt.bootstrap.sessionID.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})();this.bi(this.Bt.bootstrap.sessionID,new Date().getTime(),d)}catch(f){cb.error("Invalid sessionID in bootstrap",f)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ze(this.li)&&(this.li=[]),this.li.push(t),this.di&&t(this.di,this.ci),()=>{this.li=this.li.filter((n=>n!==t))}}yi(){return this.Bt.persistence!=="memory"&&!this.ni._r&&mr.R()}Ii(t){t!==this.ci&&(this.ci=t,this.yi()&&mr.M(this.gi,t))}Ci(){return this.ci?this.ci:this.yi()?mr.Z(this.gi):null}bi(t,n,r){t===this.di&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.di=t,this.ni.register({[ug]:[n,t,r]}))}Si(){var t=this.ni.props[ug];return Mt(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&me&&(me.removeEventListener(mg,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&mr.F(this.mi)},Vn(me,mg,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.Bt.cookieless_mode===as)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[o,s,l]=this.Si(),c=this.Ci(),d=Sc(l)&&Math.abs(r-l)>864e5,f=!1,p=!s,h=!p&&!t&&this.hi(r,o);p||h||d?(s=this.vi(),c=this.fi(),cb.info("new session ID generated",{sessionId:s,windowId:c,changeReason:{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}}),l=r,f=!0):c||(c=this.fi(),f=!0);var g=Sc(o)&&t&&!d?o:r,v=Sc(l)?l:new Date().getTime();return this.Ii(c),this.bi(s,g,v),t||this.pi(),f&&this.li.forEach((_=>_(s,c,f?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}:void 0))),{sessionId:s,windowId:c,sessionStartTimestamp:v,changeReason:f?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:d}:void 0,lastActivityTimestamp:o}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[t]=this.Si();if(this.hi(new Date().getTime(),t)){var n=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var n6=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&IA(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((o=>IA(o?.brand,t))))return!0}catch{}return!!e.webdriver},Sg=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function JA(e,t,n){return Mc({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var r6={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>Sg(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!Sg(n,r))))),icontains:(e,t)=>t.map(Op).some((n=>e.map(Op).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(Op).every((n=>e.map(Op).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((o=>r>parseFloat(o)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((o=>r<parseFloat(o)))}))},Op=e=>e.toLowerCase();function o6(e,t){return!e||Object.entries(e).every((n=>{var[r,o]=n,s=t?.[r];if(ze(s)||ys(s))return!1;var l=[String(s)],c=r6[o.operator];return!!c&&c(o.values,l)}))}var X1="custom",eI="i.posthog.com",Ere=/^\/static\//;class xre{constructor(t){this.ki={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+eI,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":X1),this.ki[this.apiHost]}Ti(t){var n=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof n=="string"&&Ere.test(t))return n.trim().replace(/\/$/,"")||void 0}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(t==="assets"){var r=this.Ti(n);if(r)return""+r+n}if(this.region===X1)return this.apiHost+n;var o=eI+n;switch(t){case"assets":return"https://"+this.region+"-assets."+o;case"api":return"https://"+this.region+"."+o}}}var Xt=mn("[Surveys]"),J1="seenSurvey_",Rre=[ob.Popover,ob.Widget,ob.API],Ore={ignoreConditions:!1,ignoreDelay:!1,displayType:K1.Popover},Tre=mn("[PostHog ExternalIntegrations]"),Cre={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Are{constructor(t){this._instance=t}ur(t,n){var r;(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(o=>{if(o)return Tre.error("failed to load script",o);n()}))}startIfEnabledOrStop(){var t=this,n=function(l){var c,d,f;!o||(c=We.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[l]||t.ur(Cre[l],(()=>{var p;(p=We.__PosthogExtensions__)==null||(p=p.integrations)==null||(p=p[l])==null||p.start(t._instance)})),!o&&(d=We.__PosthogExtensions__)!=null&&(d=d.integrations)!=null&&d[l]&&((f=We.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[l])==null||f.stop())};for(var[r,o]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var vc,Ud={},ub=0,ew=()=>{},tI='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',md="Surveys module not available",nI="sanitize_properties is deprecated. Use before_send instead",i6="Invalid value for property_denylist config: ",Rc="posthog",s6=!gre&&Yr?.indexOf("MSIE")===-1&&Yr?.indexOf("Mozilla")===-1,rI=e=>{var t;return Ne({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Gne(Le?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ew,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:pr&&_n(pr?.search)&&pr.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(me==null||(t=me.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){$e.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:G1,before_send:void 0,request_queue_config:{flush_interval_ms:Q1},error_tracking:{},_onCapture:ew,__preview_eager_load_replay:!1},(n=>({rageclick:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Ire=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],oI=e=>{var t={};for(var[n,r]of Ire)ze(e[n])||(t[r]=e[n]);var o=Rn({},t,e);return Mt(e.property_blacklist)&&(ze(e.property_denylist)?o.property_denylist=e.property_blacklist:Mt(e.property_denylist)?o.property_denylist=[...e.property_blacklist,...e.property_denylist]:$e.error(i6+e.property_denylist)),o};class Pre{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(t){$e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class $o{Ei(t,n){if(t){var r=this.Ri.indexOf(t);r!==-1&&this.Ri.splice(r,1)}return this.Ri.push(n),n.initialize==null||n.initialize(),n}Ni(){return this.config.cookieless_mode===as||this.config.cookieless_mode===Qa&&this.consent.isRejected()}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new Pre,this.Mi=!1,this.version=$r.LIB_VERSION,this.Fi=new XS,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rI(),this.SentryIntegration=nre,this.sentryIntegration=r=>(function(o,s){var l=F5(o,s);return{name:U5,processEvent:c=>l(c)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new wre(this),this.pageViewManager=new FA(this),this.rateLimiter=new ure(this),this.requestRouter=new xre(this),this.consent=new Jne(this),this.externalIntegrations=new Are(this);var n=(t=$o.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,o,s)=>{var l=_n(r)?{[r]:o}:r;this.setPersonProperties(l),s?.({})},set_once:(r,o,s)=>{var l=_n(r)?{[r]:o}:r;this.setPersonProperties(void 0,l),s?.({})}},this.on("eventCaptured",(r=>$e.info('send "'+r?.event+'"',r)))}init(t,n,r){if(r&&r!==Rc){var o,s=(o=Ud[r])!==null&&o!==void 0?o:new $o;return s._init(t,n,r),Ud[r]=s,Ud[Rc][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var o,s;if(n===void 0&&(n={}),ze(t)||Rm(t))return $e.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Bi(n.debug),this.ji=n,this.$i=[],n.person_profiles?this.Li=n.person_profiles:n.process_person&&(this.Li=n.process_person),this.set_config(Rn({},rI(n.defaults),oI(n),{name:r,token:t})),this.config.on_xhr_error&&$e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:_i.GZipJS;var l=this.qi();this.persistence=new rb(this.config,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new rb(Ne({},this.config,{persistence:"sessionStorage"}),l);var c=Ne({},this.persistence.props),d=Ne({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zi=new yre((x=>this.Vi(x)),this.config.request_queue_config),this.Hi=new bre(this),this.__request_queue=[];var f=this.Ni();if(f||(this.sessionManager=new XA(this),this.sessionPropsManager=new QA(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($e.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.zi(f)}),0)):($e.info("Initializing extensions synchronously"),this.zi(f)),$r.DEBUG=$r.DEBUG||this.config.debug,$r.DEBUG&&$e.info("Starting in debug mode",{this:this,config:n,thisC:Ne({},this.config),p:c,s:d}),!this.config.identity_distinct_id||(o=n.bootstrap)!=null&&o.distinctID||(n.bootstrap=Ne({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var p=n.bootstrap.distinctID,h=this.get_distinct_id(),g=this.persistence.get_property(ei);if(n.bootstrap.isIdentifiedID&&h!=null&&h!==p&&g===pc)this.identify(p);else if(n.bootstrap.isIdentifiedID&&h!=null&&h!==p&&g===mc)$e.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(na()),_=n.bootstrap.isIdentifiedID?v:p;this.persistence.set_property(ei,n.bootstrap.isIdentifiedID?mc:pc),this.register({distinct_id:p,$device_id:_})}}if(f)this.register_once({distinct_id:wp,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(na());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(ei,pc)}return Vn(me,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(x,S){var E=x.config.segment;if(!E)return S();(function(T,R){var O=T.config.segment;if(!O)return R();var A=M=>{var L=()=>M.anonymousId()||na();T.config.get_device_id=L,M.id()&&(T.register({distinct_id:M.id(),$device_id:L()}),T.persistence.set_property(ei,mc)),R()},I=O.user();"then"in I&&is(I.then)?I.then(A):A(I)})(x,(()=>{E.register((T=>{Promise&&Promise.resolve||nb.warn("This browser does not have Promise support, and can not use the segment integration");var R=(O,A)=>{if(!A)return O;O.event.userId||O.event.anonymousId===T.get_distinct_id()||(nb.info("No userId set, resetting PostHog"),T.reset()),O.event.userId&&O.event.userId!==T.get_distinct_id()&&(nb.info("UserId set, identifying with PostHog"),T.identify(O.event.userId));var I=T.calculateEventProperties(A,O.event.properties);return O.event.properties=Object.assign({},I,O.event.properties),O};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:O=>R(O,O.event.event),page:O=>R(O,xc),identify:O=>R(O,eb),screen:O=>R(O,"$screen")}})(x)).then((()=>{S()}))}))})(this,(()=>this.Ui())):this.Ui(),is(this.config._onCapture)&&this.config._onCapture!==ew&&($e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(x=>this.config._onCapture(x.event,x)))),this.config.ip&&$e.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(t){var n,r,o,s,l,c,d,f=performance.now(),p=Ne({},$o.__defaultExtensionClasses,this.config.__extensionClasses),h=[];p.featureFlags&&this.Ri.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ri.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ri.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ri.push(new p.tracingHeaders(this)),p.siteApps&&this.Ri.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!t&&this.Ri.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ri.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ri.push(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new p.surveys(this)),p.logs&&this.Ri.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new p.logs(this)),p.conversations&&this.Ri.push(this.conversations=(l=this.conversations)!==null&&l!==void 0?l:new p.conversations(this)),p.productTours&&this.Ri.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ri.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ri.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,tre)),p.toolbar&&this.Ri.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Ri.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new p.experiments(this)),this.Ri.forEach((g=>{g.initialize&&h.push((()=>{g.initialize==null||g.initialize()}))})),h.push((()=>{if(this.Yi){var g=this.Yi;this.Yi=void 0,this.Nr(g)}})),this.Gi(h,f)}Gi(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.Gi(t,n)}),0);var r=t.shift();if(r)try{r()}catch(s){$e.error("Error initializing extension:",s)}}var o=Math.round(performance.now()-n);this.register_for_session({[D5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[L5]:o}),this.config.__preview_deferred_init_extensions&&$e.info("PostHog extensions initialized ("+o+"ms)")}Nr(t){var n;if(!Le||!Le.body)return $e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Nr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=t),this.Wi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Et(t.supportedCompression,_i.GZipJS)?_i.GZipJS:Et(t.supportedCompression,_i.Base64)?_i.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:G1}),this.Ri.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t)))}Ui(){try{this.config.loaded(this)}catch(r){$e.critical("`loaded` function failed",r)}if(this.Xi(),this.config.internal_or_test_user_hostname&&pr!=null&&pr.hostname){var t=pr.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new Y5(this),this.Ki.load()}Xi(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Zi)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Sp(this.__request_queue,(t=>this.Vi(t))),this.__request_queue=[],this.Xi()}_handle_unload(){var t,n,r,o;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture(J_),(n=this.logs)==null||n.flushLogs("sendBeacon"),(r=this.Zi)==null||r.unload(),(o=this.Hi)==null||o.unload()):this.Qi()&&this.capture(J_,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(s6?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=sv(t.url,{ip:this.config.ip?1:0}),t.headers=Ne({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,o,s,l=Ne({},n);l.timeout=l.timeout||6e4,l.url=WA(l.url,l.compression);var c=(r=l.transport)!==null&&r!==void 0?r:"fetch",d=Am.filter((p=>!l.disableTransport||!p.transport||!l.disableTransport.includes(p.transport))),f=(o=(s=(function(p,h){for(var g=0;p.length>g;g++)if(p[g].transport===c)return p[g]})(d))==null?void 0:s.method)!==null&&o!==void 0?o:d[0].method;if(!f)throw new Error("No available transport method");c!=="sendBeacon"&&l.data&&l.compression===_i.GZipJS&&nne&&!YA?vre(l).then((p=>{f(p)})).catch((p=>{if((h=>!(!h||typeof h!="object")&&("name"in h?String(h.name):"")==="NotReadableError")(p))return YA=!0,void f(Ne({},l,{compression:void 0,url:WA(n.url,void 0)}));f(l)})):f(l)})(Ne({},t,{callback:n=>{var r,o;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(o=this.config).on_request_error)==null||r.call(o,n),t.callback==null||t.callback(n)}}))))}Vi(t){this.Hi?this.Hi.retriableRequest(t):this._send_request(t)}_execute_array(t){ub++;try{var n,r=[],o=[],s=[];Sp(t,(c=>{c&&(Mt(n=c[0])?s.push(c):is(c)?c.call(this):Mt(c)&&n==="alias"?r.push(c):Mt(c)&&n.indexOf("capture")!==-1&&is(this[n])?s.push(c):o.push(c))}));var l=function(c,d){Sp(c,(function(f){if(Mt(f[0])){var p=d;dn(f,(function(h){p=p[h[0]].apply(p,h.slice(1))}))}else d[f[0]].apply(d,f.slice(1))}))};l(r,this),l(o,this),l(s,this)}finally{ub--}}push(t){if(ub>0&&Mt(t)&&_n(t[0])){var n=$o.prototype[t[0]];is(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var o,s,l,c,d;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!ze(t)&&_n(t)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(p==null||!p.isRateLimited){n!=null&&n.$current_url&&!_n(n?.$current_url)&&($e.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.en||$e.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,g=r?.timestamp||h,v=na(),_={uuid:v,event:t,properties:this.calculateEventProperties(t,n||{},g,v)};t===xc&&this.config.__preview_capture_bot_pageviews&&f&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),p&&(_.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens),r?.$set&&(_.$set=r?.$set);var b,x,S,E=this.tn(r?.$set_once,t!==$A,t===eb);if(E&&(_.$set_once=E),r!=null&&r._noTruncate||(s=this.config.properties_string_max_length,l=_,c=L=>_n(L)?L.slice(0,s):L,d=new Set,_=(function L(q,j){return q!==Object(q)?c?c(q):q:d.has(q)?void 0:(d.add(q),Mt(q)?(B=[],Sp(q,(F=>{B.push(L(F))}))):(B={},dn(q,((F,Z)=>{d.has(F)||(B[Z]=L(F))}))),B);var B})(l)),_.timestamp=g,ze(r?.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=h),t===Md.DISMISSED||t===Md.SENT){var T=n?.[ib.SURVEY_ID],R=n?.[ib.SURVEY_ITERATION];(L=>{try{var q=(j=>((B,F)=>{var Z=""+J1+F.id;return F.current_iteration&&F.current_iteration>0&&(Z=""+J1+F.id+"_"+F.current_iteration),Z})(0,j))(L);if(localStorage.getItem(q))return;localStorage.setItem(q,"true")}catch(j){Xt.error("Failed to persist survey seen state",j)}})({id:T,current_iteration:R}),_.$set=Ne({},_.$set,{[(b={id:T,current_iteration:R},x=t===Md.SENT?"responded":"dismissed",S="$survey_"+x+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(S="$survey_"+x+"/"+b.id+"/"+b.current_iteration),S)]:!0})}else t===Md.SHOWN&&(_.$set=Ne({},_.$set,{[ib.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===cre.SHOWN){var O=n?.[VA.TOUR_TYPE];O&&(_.$set=Ne({},_.$set,{[VA.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var A=Ne({},_.properties.$set,_.$set);if(Ic(A)||this.setPersonPropertiesForFlags(A),!xt(this.config.before_send)){var I=this.rn(_);if(!I)return;_=I}this.Fi.emit("eventCaptured",_);var M={method:"POST",url:(o=r?._url)!==null&&o!==void 0?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:_,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Vi(M):this.Zi.enqueue(M),_}$e.critical("This capture call is ignored due to client rate limiting.")}}else $e.error("No event name provided to posthog.capture")}else $e.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,o,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var l=s?void 0:this.persistence.remove_event_timer(t),c=Ne({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ni()&&(c.$cookieless_mode=!0),t==="$snapshot"){var d=Ne({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=d.distinct_id,(!_n(c.distinct_id)&&!Fo(c.distinct_id)||Rm(c.distinct_id))&&$e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var f,p=(function(S,E){var T,R,O,A;if(!Yr)return{};var I,M,L,q,j,B,F,Z,ie=S?[...Qc,...E||[]]:[],[H,W]=(function(te){for(var le=0;NA.length>le;le++){var[Q,k]=NA[le],G=Q.exec(te),V=G&&(is(k)?k(G,te):k);if(V)return V}return["",""]})(Yr);return Rn(YS({$os:H,$os_version:W,$browser:E5(Yr,navigator.vendor),$device:kA(Yr),$device_type:(M=Yr,L={userAgentDataPlatform:(T=navigator)==null||(T=T.userAgentData)==null?void 0:T.platform,maxTouchPoints:(R=navigator)==null?void 0:R.maxTouchPoints,screenWidth:me==null||(O=me.screen)==null?void 0:O.width,screenHeight:me==null||(A=me.screen)==null?void 0:A.height,devicePixelRatio:me?.devicePixelRatio},Z=kA(M),Z===c5||Z===l5||Z==="Kobo"||Z==="Kindle Fire"||Z===S5?Zc:Z===of||Z===Fc||Z===sf||Z===x1?"Console":Z===d5?"Wearable":Z?yo:L?.userAgentDataPlatform==="Android"&&((q=L?.maxTouchPoints)!==null&&q!==void 0?q:0)>0?600>Math.min((j=L?.screenWidth)!==null&&j!==void 0?j:0,(B=L?.screenHeight)!==null&&B!==void 0?B:0)/((F=L?.devicePixelRatio)!==null&&F!==void 0?F:1)?yo:Zc:"Desktop"),$timezone:Z5(),$timezone_offset:are()}),{$current_url:af(pr?.href,ie,lf),$host:pr?.host,$pathname:pr?.pathname,$raw_user_agent:Yr.length>1e3?Yr.substring(0,997)+"...":Yr,$browser_version:yne(Yr,navigator.vendor),$browser_language:BA(),$browser_language_prefix:(I=BA(),typeof I=="string"?I.split("-")[0]:void 0),$screen_height:me?.screen.height,$screen_width:me?.screen.width,$viewport_height:me?.innerHeight,$viewport_width:me?.innerWidth,$lib:$r.LIB_NAME,$lib_version:$r.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());c.$session_id=h,c.$window_id=g}this.sessionPropsManager&&Rn(c,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&Rn(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=(v=this.Hi)==null?void 0:v.length}catch(S){c.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===X1&&(c.$lib_custom_api_host=this.config.api_host),f=t!==xc||s?t!==J_||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,o),c=Rn(c,f),t===xc&&Le&&(c.title=Le.title),!ze(l)){var _=r.getTime()-l;c.$duration=parseFloat((_/1e3).toFixed(3))}Yr&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=Rn({},p,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),Mt(this.config.property_denylist)?dn(this.config.property_denylist,(function(S){delete c[S]})):$e.error(i6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&($e.error(nI),c=b(c,t));var x=this.nn();return c.$process_person_profile=x,x&&!s&&this.sn("_calculate_event_properties"),c}tn(t,n,r){var o;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.nn()||this.Mi&&!r)return t;var s=this.persistence.get_initial_props(),l=(o=this.sessionPropsManager)==null?void 0:o.getSetOnceProps(),c=Rn({},s,l||{},t||{}),d=this.config.sanitize_properties;return d&&($e.error(nI),c=d(c,"$set_once")),n&&(this.Mi=!0),Ic(c)?void 0:c}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var o;(o=this.persistence)==null||o.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}an(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var o;(o=this.featureFlags)==null||o.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var o;(o=this.featureFlags)==null||o.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var o;return n===void 0&&(n=!1),(o=this.featureFlags)==null?void 0:o.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Fi.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:md}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:md})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:md})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=Ore),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:md}}canRenderSurveyAsync(t,n){var r,o;return n===void 0&&(n=!1),(r=(o=this.surveys)==null?void 0:o.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:md})}ln(t){return!t||Rm(t)?($e.critical("Unique user id has not been set in posthog.identify"),!1):t===wp?($e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||($e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return $e.uninitializedWarning("posthog.identify");if(Fo(t)&&(t=t.toString(),$e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ln(t)&&this.sn("posthog.identify")){var o=this.get_distinct_id();this.register({$user_id:t}),this.get_property(cg)||this.register_once({$had_persisted_distinct_id:!0,$device_id:o},""),t!==o&&t!==this.get_property(Td)&&(this.unregister(Td),this.register({distinct_id:t}));var s,l=(this.persistence.get_property(ei)||pc)===pc;t!==o&&l?(this.persistence.set_property(ei,mc),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(eb,{distinct_id:t,$anon_distinct_id:o},{$set:n||{},$set_once:r||{}}),this.Di=JA(t,n,r),(s=this.featureFlags)==null||s.setAnonymousDistinctId(o)):(n||r)&&this.setPersonProperties(n,r),t!==o&&(this.reloadFeatureFlags(),this.unregister(jd))}}setPersonProperties(t,n){if((t||n)&&this.sn("posthog.setPersonProperties")){var r=JA(this.get_distinct_id(),t,n);this.Di!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Di=r):$e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var o=this.getGroups(),s=o[t]!==n;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Ne({},o,{[t]:n})}),s||r){var l={$group_type:t,$group_key:n};r&&(l.$group_set=r),this.capture($A,l)}r&&this.setGroupPropertiesForFlags({[t]:r}),s&&!r&&this.reloadFeatureFlags()}else $e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.sn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,o,s,l,c,d,f;if($e.info("reset"),!this.__loaded)return $e.uninitializedWarning("posthog.reset");var p=this.get_property(cg);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(o=this.surveys)==null||o.reset(),(s=this.Ki)==null||s.stop(),(l=this.featureFlags)==null||l.reset(),(c=this.conversations)==null||c.reset(),(d=this.persistence)==null||d.set_property(ei,pc),(f=this.sessionManager)==null||f.resetSessionId(),this.Di=null,this.config.cookieless_mode===as)this.register_once({distinct_id:wp,$device_id:null},"");else{var h=this.config.get_device_id(na());this.register_once({distinct_id:h,$device_id:t?h:p},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,n){var r;this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)==null||r.un()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.hn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),o=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var s,l=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return o;o+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-l,0)}return o}alias(t,n){return t===this.get_property(A5)?($e.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(ze(n)&&(n=this.get_distinct_id()),t!==n?(this.an(Td,t),this.capture("$create_alias",{alias:t,distinct_id:n})):($e.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=Ne({},this.config);if(An(t)){var r,o,s,l,c,d,f,p,h,g;Rn(this.config,oI(t));var v=this.qi();(r=this.persistence)==null||r.update_config(this.config,n,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new rb(Ne({},this.config,{persistence:"sessionStorage"}),v);var _=this.Bi(this.config.debug);Ri(_)&&(this.config.debug=_),Ri(this.config.debug)&&(this.config.debug?($r.DEBUG=!0,yn.R()&&yn.M("ph_debug",!0),$e.info("set_config",{config:t,oldConfig:n,newConfig:Ne({},this.config)})):($r.DEBUG=!1,yn.R()&&yn.F("ph_debug"))),(o=this.exceptionObserver)==null||o.onConfigChange(),(s=this.exceptions)==null||s.onConfigChange(),(l=this.sessionRecording)==null||l.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(d=this.heatmaps)==null||d.startIfEnabled(),(f=this.exceptionObserver)==null||f.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(h=this.surveys)==null||h.loadIfEnabled(),this.cn(),(g=this.externalIntegrations)==null||g.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){$r.LIB_NAME=t,$r.LIB_VERSION=n}startSessionRecording(t){var n,r,o,s,l,c=t===!0,d={sampling:c||!(t==null||!t.sampling),linked_flag:c||!(t==null||!t.linked_flag),url_trigger:c||!(t==null||!t.url_trigger),event_trigger:c||!(t==null||!t.event_trigger)};Object.values(d).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),d.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),d.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),d.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),d.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),o=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Ne({},o,n))}}addExceptionStep(t,n){var r;(r=this.exceptions)==null||r.addExceptionStep(t,n)}captureLog(t){var n;(n=this.logs)==null||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)==null?void 0:n.logger)!==null&&t!==void 0?t:$o.dn}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Rc;return n!==Rc&&(n=Rc+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(ei))===mc||((n=this.sessionPersistence)==null?void 0:n.get_property(ei))===mc}nn(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===G1&&!this._isIdentified()&&Ic(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Td])&&((n=this.persistence)==null||(n=n.props)==null||!n[hg]))}Qi(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(t){return this.config.person_profiles==="never"?($e.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(hg,!0),!0)}qi(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Qa)}cn(){var t,n,r,o,s=this.qi();return((t=this.persistence)==null?void 0:t._r)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n._r)!==s&&((o=this.sessionPersistence)==null||o.set_disabled(s)),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==as){if(this.Ni()){var r,o,s,l,c;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(o=this.pageViewManager)==null||o.destroy(),this.sessionManager=new XA(this),this.pageViewManager=new FA(this),this.persistence&&(this.sessionPropsManager=new QA(this,this.sessionManager,this.persistence));var d,f=(s=(l=this.config.__extensionClasses)==null?void 0:l.sessionRecording)!==null&&s!==void 0?s:(c=$o.__defaultExtensionClasses)==null?void 0:c.sessionRecording;f&&(this.sessionRecording=this.Ei(this.sessionRecording,new f(this)),this.Wi&&((d=this.sessionRecording)==null||d.onRemoteConfig==null||d.onRemoteConfig(this.Wi)))}var p,h;this.consent.optInOut(!0),this.cn(),this.Xi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Qa&&((p=this.surveys)==null||p.loadIfEnabled()),(ze(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((h=t?.captureEventName)!==null&&h!==void 0?h:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else $e.warn(tI)}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!==as?(this.config.cookieless_mode===Qa&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Qa&&(this.register({distinct_id:wp,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.Ji())):$e.warn(tI)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===as||(this.config.cookieless_mode===Qa?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return go?n6(go,this.config.custom_blocked_useragents):void 0}Ji(){Le&&(Le.visibilityState==="visible"?this.Oi||(this.Oi=!0,this.capture(xc,{title:Le.title},{send_instantly:!0}),this.Pi&&(Le.removeEventListener(pg,this.Pi),this.Pi=null)):this.Pi||(this.Pi=this.Ji.bind(this),Vn(Le,pg,this.Pi)))}debug(t){t===!1?(me?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(me?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Fr(){var t,n,r,o,s,l,c=this.ji||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?($e.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",o=$e,s=(n="advanced_disable_flags")in(t=c)&&!xt(t[n]),l=r in t&&!xt(t[r]),s?t[n]:!!l&&(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]))}rn(t){if(xt(this.config.before_send))return t;var n=Mt(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var o of n){if(r=o(r),xt(r)){var s="Event '"+t.event+"' was rejected in beforeSend function";return sne(t.event)?$e.warn(s+". This can cause unexpected behavior."):$e.info(s),null}r.properties&&!Ic(r.properties)||$e.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.dr)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Bi(t){var n=Ri(t)&&!t,r=yn.R()&&yn.O("ph_debug")==="true";return!n&&(!!r||t)}}function iI(e){return e instanceof Element&&(e.id===k5||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function av(e){return!!e&&e.nodeType===1}function ua(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function a6(e){return!!e&&e.nodeType===3}function l6(e){return!!e&&e.nodeType===11}function JS(e){return e?ov(e).split(/\s+/):[]}function sI(e){var t=me?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function Eg(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return JS(t)}function c6(e){return xt(e)?null:ov(e).split(/(\s+)/).filter((t=>Fd(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function cf(e){var t="";return nw(e)&&!d6(e)&&e.childNodes&&e.childNodes.length&&dn(e.childNodes,(function(n){var r;a6(n)&&n.textContent&&(t+=(r=c6(n.textContent))!==null&&r!==void 0?r:"")})),ov(t)}function aI(e){return ze(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}$o.__defaultExtensionClasses={},$o.dn={trace:vc=()=>{},debug:vc,info:vc,warn:vc,error:vc,fatal:vc},(function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=qne(e.prototype[t[n]])})($o,["identify"]);var eE=["a","button","form","input","select","textarea","label"];function lI(e,t){if(ze(t))return!0;var n,r=function(s){if(t.some((l=>s.matches(l))))return{v:!0}};for(var o of e)if(n=r(o))return n.v;return!1}function u6(e){var t=e.parentNode;return!(!t||!av(t))&&t}var Mre=["next","previous","prev",">","<"],cI=[".ph-no-rageclick",".ph-no-capture"],tw=e=>!e||ua(e,"html")||!av(e),uI=(e,t)=>{if(!me||tw(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],o=e;o.parentNode&&!ua(o,"body");)if(l6(o.parentNode))r.push(o.parentNode.host),o=o.parentNode.host;else{var s=u6(o);if(!s)break;if(t||eE.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var l=me.getComputedStyle(s);l&&l.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),o=s}return{parentIsUsefulElement:n,targetElementList:r}};function nw(e){for(var t=e;t.parentNode&&!ua(t,"body");t=t.parentNode){var n=Eg(t);if(Et(n,"ph-sensitive")||Et(n,"ph-no-capture"))return!1}if(Et(Eg(e),"ph-include"))return!0;var r=e.type||"";if(_n(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!_n(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function d6(e){return!!(ua(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ua(e,"select")||ua(e,"textarea")||e.getAttribute("contenteditable")==="true")}var f6="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Nre=new RegExp("^(?:"+f6+")$"),kre=new RegExp(f6),h6="\\d{3}-?\\d{2}-?\\d{4}",Dre=new RegExp("^("+h6+")$"),Lre=new RegExp("("+h6+")");function Fd(e,t){return t===void 0&&(t=!0),!(xt(e)||_n(e)&&(e=ov(e),(t?Nre:kre).test((e||"").replace(/[- ]/g,""))||(t?Dre:Lre).test(e)))}function dI(e){var t=cf(e);return Fd(t=(t+" "+p6(e)).trim())?t:""}function p6(e){var t="";return e&&e.childNodes&&e.childNodes.length&&dn(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var o=cf(n);t=(t+" "+o).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+p6(n)).trim())}catch(s){$e.error("[AutoCapture]",s)}})),t}function fI(e){return e.replace(/"|\\"/g,'\\"')}function $re(e){var t=e.attr__class;return t?Mt(t)?t:JS(t):void 0}class hI{constructor(t){this.disabled=t===!1;var n=An(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var o=this.clicks[this.clicks.length-1];if(o&&Math.abs(t-o.x)+Math.abs(n-o.y)<this.thresholdPx&&this.timeoutMs>r-o.timestamp){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var db="$copy_autocapture",pI=mn("[AutoCapture]");function fb(e,t){return t.length>e?t.slice(0,e)+"...":t}function jre(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!av(t));return t}function zre(e,t){for(var n,r,{e:o,maskAllElementAttributes:s,maskAllText:l,elementAttributeIgnoreList:c,elementsChainAsString:d}=t,f=[e],p=e;p.parentNode&&!ua(p,"body");)l6(p.parentNode)?(f.push(p.parentNode.host),p=p.parentNode.host):(f.push(p.parentNode),p=p.parentNode);var h,g,v=[],_={},b=!1,x=!1;if(dn(f,(O=>{var A=nw(O);O.tagName.toLowerCase()==="a"&&(b=O.getAttribute("href"),b=A&&b&&Fd(b)&&b),Et(Eg(O),"ph-no-capture")&&(x=!0),v.push((function(M,L,q,j){var B=M.tagName.toLowerCase(),F={tag_name:B};eE.indexOf(B)>-1&&!q&&(F.$el_text=B.toLowerCase()==="a"||B.toLowerCase()==="button"?fb(1024,dI(M)):fb(1024,cf(M)));var Z=Eg(M);Z.length>0&&(F.classes=Z.filter((function(te){return te!==""}))),dn(M.attributes,(function(te){var le;if((!d6(M)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(j==null||!j.includes(te.name))&&!L&&Fd(te.value)&&(!_n(le=te.name)||le.substring(0,10)!=="_ngcontent"&&le.substring(0,7)!=="_nghost")){var Q=te.value;te.name==="class"&&(Q=JS(Q).join(" ")),F["attr__"+te.name]=fb(1024,Q)}}));for(var ie=1,H=1,W=M;W=jre(W);)ie++,W.tagName===M.tagName&&H++;return F.nth_child=ie,F.nth_of_type=H,F})(O,s,l,c));var I=(function(M){if(!nw(M))return{};var L={};return dn(M.attributes,(function(q){if(q.name&&q.name.indexOf("data-ph-capture-attribute")===0){var j=q.name.replace("data-ph-capture-attribute-",""),B=q.value;j&&B&&Fd(B)&&(L[j]=B)}})),L})(O);Rn(_,I)})),x)return{props:{},explicitNoCapture:x};if(l||(v[0].$el_text=e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?dI(e):cf(e)),b){var S,E;v[0].attr__href=b;var T=(S=vg(b))==null?void 0:S.host,R=me==null||(E=me.location)==null?void 0:E.host;T&&R&&T!==R&&(h=b)}return{props:Rn({$event_type:o.type,$ce_version:1},d?{}:{$elements:v},{$elements_chain:(g=v,(function(O){return O.map((A=>{var I,M,L="";if(A.tag_name&&(L+=A.tag_name),A.attr_class)for(var q of(A.attr_class.sort(),A.attr_class))L+="."+q.replace(/"/g,"");var j=Ne({},A.text?{text:A.text}:{},{"nth-child":(I=A.nth_child)!==null&&I!==void 0?I:0,"nth-of-type":(M=A.nth_of_type)!==null&&M!==void 0?M:0},A.href?{href:A.href}:{},A.attr_id?{attr_id:A.attr_id}:{},A.attributes),B={};return Cm(j).sort(((F,Z)=>{var[ie]=F,[H]=Z;return ie.localeCompare(H)})).forEach((F=>{var[Z,ie]=F;return B[fI(Z.toString())]=fI(ie.toString())})),(L+=":")+Cm(B).map((F=>{var[Z,ie]=F;return Z+'="'+ie+'"'})).join("")})).join(";")})((function(O){return O.map((A=>{var I,M,L={text:(I=A.$el_text)==null?void 0:I.slice(0,400),tag_name:A.tag_name,href:(M=A.attr__href)==null?void 0:M.slice(0,2048),attr_class:$re(A),attr_id:A.attr__id,nth_child:A.nth_child,nth_of_type:A.nth_of_type,attributes:{}};return Cm(A).filter((q=>{var[j]=q;return j.indexOf("attr__")===0})).forEach((q=>{var[j,B]=q;return L.attributes[j]=B})),L}))})(g)))},(n=v[0])!=null&&n.$el_text?{$el_text:(r=v[0])==null?void 0:r.$el_text}:{},h&&o.type==="click"?{$external_click_url:h}:{},_)}}var gd=mn("[ExceptionAutocapture]");function mI(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],o=n(r);return is(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var Ure=mn("[TracingHeaders]"),Zs=mn("[Web Vitals]"),gI=9e5,vI="disabled",yI="lazy_loading",vd="awaiting_config",Tp="missing_config";mn("[SessionRecording]"),mn("[SessionRecording]");var rw="[SessionRecording]",Ys=mn(rw),Fre=mn("[Heatmaps]");function _I(e){return An(e)&&"clientX"in e&&"clientY"in e&&Fo(e.clientX)&&Fo(e.clientY)}var bI=mn("[Product Tours]"),Bre=["$set_once","$set"],Ws=mn("[SiteApps]"),wI="Error while initializing PostHog app with config id ";function yc(e,t,n){if(xt(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class Vre{constructor(t){this.vn=new XS,this.fn=(n,r)=>this.pn(n,r)&&this.gn(n,r)&&this.mn(n,r)&&this.yn(n,r),this.pn=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=t,this.bn=new Set,this._n=new Set}init(){var t,n;ze((t=this._instance)==null?void 0:t._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,o)=>{this.on(r,o)}))}register(t){var n,r;if(!ze((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((l=>{var c,d;(c=this._n)==null||c.add(l),(d=l.steps)==null||d.forEach((f=>{var p;(p=this.bn)==null||p.add(f?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var o,s=new Set;t.forEach((l=>{var c;(c=l.steps)==null||c.forEach((d=>{d!=null&&d.selector&&s.add(d?.selector)}))})),(o=this._instance)==null||o.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.bn.has(t)||this.bn.has(n?.event))&&this._n&&((r=this._n)==null?void 0:r.size)>0&&this._n.forEach((o=>{this.wn(n,o)&&this.vn.emit("actionCaptured",o.name)}))}In(t){this.onAction("actionCaptured",(n=>t(n)))}wn(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.fn(t,r))return!0;return!1}onAction(t,n){return this.vn.on(t,n)}gn(t,n){if(n!=null&&n.url){var r,o=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!o||typeof o!="string"||!yc(o,n.url,n.url_matching||"contains"))return!1}return!0}mn(t,n){return!!this.Cn(t,n)&&!!this.Sn(t,n)&&!!this.xn(t,n)}Cn(t,n){var r;if(n==null||!n.href)return!0;var o=this.kn(t);if(o.length>0)return o.some((c=>yc(c.href,n.href,n.href_matching||"exact")));var s,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&yc((s=l.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}Sn(t,n){var r;if(n==null||!n.text)return!0;var o=this.kn(t);if(o.length>0)return o.some((f=>yc(f.text,n.text,n.text_matching||"exact")||yc(f.$el_text,n.text,n.text_matching||"exact")));var s,l,c,d=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!d&&(s=(function(f){for(var p,h=[],g=/(?::|")text="(.*?)"/g;!xt(p=g.exec(f));)h.includes(p[1])||h.push(p[1]);return h})(d),l=n.text,c=n.text_matching||"exact",s.some((f=>yc(f,l,c))))}xn(t,n){var r,o;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var l=(t==null||(o=t.properties)==null?void 0:o.$elements_chain)||"";if(n.selector_regex&&l)try{return new RegExp(n.selector_regex).test(l)}catch{return!1}return!1}kn(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t?.properties.$elements}yn(t,n){return n==null||!n.properties||n.properties.length===0||o6(n.properties.reduce(((r,o)=>{var s=Mt(o.value)?o.value.map(String):o.value!=null?[String(o.value)]:[];return r[o.key]={values:s,operator:o.operator||"exact"},r}),{}),t?.properties)}}class qre{constructor(t){this._instance=t,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(t,n){return!!t&&o6(t.propertyFilters,n?.properties)}Nn(t,n){var r=new Map;return t.forEach((o=>{var s;(s=o.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((l=>{if(l!=null&&l.name){var c=r.get(l.name)||[];c.push(o.id),r.set(l.name,c)}}))})),r}Mn(t,n,r){var o=(r===dd.Activation?this.Tn:this.An).get(t),s=[];return this.Fn((l=>{s=l.filter((c=>o?.includes(c.id)))})),s.filter((l=>{var c,d=(c=l.conditions)==null||(c=c[r])==null||(c=c.values)==null?void 0:c.find((f=>f.name===t));return this.Rn(d,n)}))}register(t){var n;ze((n=this._instance)==null?void 0:n._addCaptureHook)||(this.On(t),this.Pn(t))}Pn(t){var n=t.filter((r=>{var o,s;return((o=r.conditions)==null?void 0:o.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.Ln==null&&(this.Ln=new Vre(this._instance),this.Ln.init(),this.Ln.In((r=>{this.onAction(r)}))),n.forEach((r=>{var o,s,l,c,d;r.conditions&&(o=r.conditions)!=null&&o.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null?void 0:l.length)>0&&((c=this.Ln)==null||c.register(r.conditions.actions.values),(d=r.conditions)==null||(d=d.actions)==null||(d=d.values)==null||d.forEach((f=>{if(f&&f.name){var p=this.En.get(f.name);p&&p.push(r.id),this.En.set(f.name,p||[r.id])}})))})))}On(t){var n,r=t.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.events)&&((c=s.conditions)==null||(c=c.events)==null||(c=c.values)==null?void 0:c.length)>0})),o=t.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.cancelEvents)&&((c=s.conditions)==null||(c=c.cancelEvents)==null||(c=c.values)==null?void 0:c.length)>0}));r.length===0&&o.length===0||((n=this._instance)==null||n._addCaptureHook(((s,l)=>{this.onEvent(s,l)})),this.Tn=this.Nn(t,dd.Activation),this.An=this.Nn(t,dd.Cancellation))}onEvent(t,n){var r,o=this.le(),s=this.Dn(),l=this.Bn(),c=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(l===t&&n&&c.length>0){var d,f;o.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:c});var p=(n==null||(d=n.properties)==null?void 0:d.$survey_id)||(n==null||(f=n.properties)==null?void 0:f.$product_tour_id);if(p){var h=c.indexOf(p);0>h||(c.splice(h,1),this.jn(c))}}else{if(this.An.has(t)){var g=this.Mn(t,n,dd.Cancellation);g.length>0&&(o.info("cancel event matched, cancelling items",{event:t,itemsToCancel:g.map((_=>_.id))}),g.forEach((_=>{var b=c.indexOf(_.id);0>b||c.splice(b,1),this.$n(_.id)})),this.jn(c))}if(this.Tn.has(t)){o.info("event name matched",{event:t,eventPayload:n,items:this.Tn.get(t)});var v=this.Mn(t,n,dd.Activation);this.jn(c.concat(v.map((_=>_.id))||[]))}}}onAction(t){var n,r=this.Dn(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.En.has(t)&&this.jn(o.concat(this.En.get(t)||[]))}jn(t){var n=this.le(),r=[...new Set(t)].filter((o=>!this.qn(o)));n.info("updating activated items",{activatedItems:r}),this.Zn(r)}getActivatedIds(){var t,n=this.Dn();return((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[]}getEventToItemsMap(){return this.Tn}Vn(){return this.Ln}}class Hre extends qre{constructor(t){super(t)}Dn(){return z1}Bn(){return Md.SHOWN}Fn(t){var n;(n=this._instance)==null||n.getSurveys(t)}$n(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}le(){return Xt}Zn(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[z1]:t})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var hb="SDK is not enabled or survey functionality is not yet loaded",SI="Disabled. Not loading surveys.",Gre=me!=null&&me.location?_g(me.location.hash,"__posthog")||_g(location.hash,"state"):null,EI="_postHogToolbarParams",xI=mn("[Toolbar]"),Nr=mn("[FeatureFlags]"),Ha=mn("[FeatureFlags]",{debugEnabled:!0}),pb=`" failed. Feature flags didn't load in time.`,RI=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},OI=e=>{var t={};for(var[n,r]of Cm(e||{}))r&&(t[n]=r);return t},es=mn("[Error tracking]"),TI="Refusing to render web experiment since the viewer is a likely bot",Kre={icontains:(e,t)=>!!me&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!me&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!me&&Sg(t.href,e),not_regex:(e,t)=>!!me&&!Sg(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Rr{get Bt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((o=>{Rr.Hn("retrieved web experiments from the server"),n.zn=new Map,o.forEach((s=>{if(s.feature_flag_key){var l;n.zn&&(Rr.Hn("setting flag key ",s.feature_flag_key," to web experiment ",s),(l=n.zn)==null||l.set(s.feature_flag_key,s));var c=n._instance.getFeatureFlag(s.feature_flag_key);_n(c)&&s.variants[c]&&n.Un(s.name,c,s.variants[c].transforms)}else if(s.variants)for(var d in s.variants){var f=s.variants[d];Rr.Yn(f)&&n.Un(s.name,d,f.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Rr.Hn(TI);else if(!this.Bt.disable_web_experiments){if(xt(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rr.Hn("applying feature flags",t),t.forEach((n=>{var r;if(this.zn&&(r=this.zn)!=null&&r.has(n)){var o,s=this._instance.getFeatureFlag(n),l=(o=this.zn)==null?void 0:o.get(n);s&&l!=null&&l.variants[s]&&this.Un(l.name,s,l.variants[s].transforms)}}))}}previewWebExperiment(){var t=Rr.getWindowLocation();if(t!=null&&t.search){var n=yg(t?.search,"__experiment_id"),r=yg(t?.search,"__experiment_variant");n&&r&&(Rr.Hn("previewing web experiments "+n+" && "+r),this.getWebExperiments((o=>{this.Gn(parseInt(n),r,o)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.Bt.disable_web_experiments&&!r)return t([]);var o=this._instance.get_property("$web_experiments");if(o&&!n)return t(o);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Bt.token),method:"GET",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Gn(t,n,r){var o=r.filter((s=>s.id===t));o&&o.length>0&&(Rr.Hn("Previewing web experiment ["+o[0].name+"] with variant ["+n+"]"),this.Un(o[0].name,n,o[0].variants[n].transforms))}static Yn(t){return!xt(t.conditions)&&Rr.Wn(t)&&Rr.Xn(t)}static Wn(t){var n;if(xt(t.conditions)||xt((n=t.conditions)==null?void 0:n.url))return!0;var r,o,s,l=Rr.getWindowLocation();return!!l&&((r=t.conditions)==null||!r.url||Kre[(o=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l))}static getWindowLocation(){return me?.location}static Xn(t){var n;if(xt(t.conditions)||xt((n=t.conditions)==null?void 0:n.utm))return!0;var r=B5();if(r.utm_source){var o,s,l,c,d,f,p,h,g=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,v=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_source||((c=t.conditions)==null||(c=c.utm)==null?void 0:c.utm_source)==r.utm_source,_=(d=t.conditions)==null||(d=d.utm)==null||!d.utm_medium||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,b=(p=t.conditions)==null||(p=p.utm)==null||!p.utm_term||((h=t.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==r.utm_term;return g&&_&&b&&v}return!1}static Hn(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];$e.info("[WebExperiments] "+t,r)}Un(t,n,r){this._is_bot()?Rr.Hn(TI):n!=="control"?r.forEach((o=>{if(o.selector){var s;Rr.Hn("applying transform of variant "+n+" for experiment "+t+" ",o);var l=(s=document)==null?void 0:s.querySelectorAll(o.selector);l?.forEach((c=>{var d=c;o.html&&(d.innerHTML=o.html),o.css&&d.setAttribute("style",o.css)}))}})):Rr.Hn("Control variants leave the page unmodified.")}_is_bot(){return go&&this._instance?n6(go,this.Bt.custom_blocked_useragents):void 0}}var ko=mn("[Conversations]"),Ga="Conversations not available yet.",lv={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e,t;return(e=(t=this.ni)==null?void 0:t.wr(this.Bt.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,Nr.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var e,t=(e=this.Bt.evaluation_contexts)!==null&&e!==void 0?e:this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||(Nr.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),t!=null&&t.length?t.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||Nr.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}cs(){return this.hs().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var o,s,l=(o=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&o!==void 0?o:{},c=Object.keys(r).filter((f=>!!r[f])).reduce(((f,p)=>(f[p]=r[p]||!1,f)),{}),d=Object.keys(l).filter((f=>c[f])).reduce(((f,p)=>(l[p]&&(f[p]=l[p]),f)),{});this.receivedFeatureFlags({featureFlags:c,featureFlagPayloads:d})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},o=n!=null&&n.merge?this.getFlagPayloads():{},s=Ne({},r,e),l=Ne({},o,t),c={};for(var[d,f]of Object.entries(s)){var p=typeof f=="string";c[d]={key:d,enabled:!!p||!!f,variant:p?f:void 0,reason:void 0,metadata:ze(l?.[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.receivedFeatureFlags({flags:c})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(D1),t=this.os(os),n=this.os(Ec);if(!n&&!t)return e||{};var r=Rn({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of o){var l,c,d=r[s],f=t?.[s],p=ze(f)?(l=d?.enabled)!==null&&l!==void 0&&l:!!f,h=ze(f)?d.variant:typeof f=="string"?f:void 0,g=n?.[s],v=Ne({},d,{enabled:p,variant:p?h??d?.variant:void 0});p!==d?.enabled&&(v.original_enabled=d?.enabled),h!==d?.variant&&(v.original_variant=d?.variant),g&&(v.metadata=Ne({},d?.metadata,{payload:g,original_payload:d==null||(c=d.metadata)==null?void 0:c.payload})),r[s]=v}return this.Jn||(Nr.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Jn=!0),r}getFlagVariants(){var e=this.os(Pc),t=this.os(os);if(!t)return e||{};for(var n=Rn({},e),r=Object.keys(t),o=0;r.length>o;o++)n[r[o]]=t[r[o]];return this.Jn||(Nr.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Jn=!0),n}getFlagPayloads(){var e=this.os(L1),t=this.os(Ec);if(!t)return e||{};for(var n=Rn({},e||{}),r=Object.keys(t),o=0;r.length>o;o++)n[r[o]]=t[r[o]];return this.Jn||(Nr.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Jn=!0),n}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){var t;if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var n=this.Bt.token,r=this.os(cg),o={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ne({},((t=this.ni)==null?void 0:t.get_initial_props())||{},this.os(Pd)||{}),group_properties:this.os(Wa),timezone:Z5()};ys(r)||ze(r)||(o.$device_id=r),(e!=null&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.cs()&&(o.evaluation_contexts=this.hs());var s=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Bt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Qn=!0,this._instance._send_request({method:"POST",url:s,data:o,compression:this.Bt.disable_compression?void 0:_i.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback:l=>{var c,d,f,p=!0;if(l.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),p=!1),this.Qn=!1,!o.disable_flags||this.ts){this.rs=!p;var h=[];l.error?l.error instanceof Error?h.push(l.error.name==="AbortError"?"timeout":"connection_error"):h.push("unknown_error"):l.statusCode!==200&&h.push("api_error_"+l.statusCode),(c=l.json)!=null&&c.errorsWhileComputingFlags&&h.push("errors_while_computing_flags");var g,v=!((d=l.json)==null||(d=d.quotaLimited)==null||!d.includes("feature_flags"));v&&h.push("quota_limited"),(f=this.ni)==null||f.register({[F1]:h}),v?Nr.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(o.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},p,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var r=this.getFeatureFlagResult(e,t);return(n=r?.variant)!==null&&n!==void 0?n:r?.enabled}}else Nr.warn('getFeatureFlag for key "'+e+pb)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFlagVariants(),r=e in n,o=n[e],s=this.getFlagPayloads()[e],l=String(o),c=this.os($1)||void 0,d=this.os(dg)||void 0,f=this.os(jd)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var p,h=this._instance.get_session_id(),g=this.os(U1);h&&h!==g&&(f={},(p=this.ni)==null||p.register({[jd]:f,[U1]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in f)||!f[e].includes(l))){var v,_,b,x,S,E,T,R,O,A;Mt(f[e])?f[e].push(l):f[e]=[l],(v=this.ni)==null||v.register({[jd]:f});var I=this.getFeatureFlagDetails(e),M=[...(_=this.os(F1))!==null&&_!==void 0?_:[]];ze(o)&&M.push("flag_missing");var L={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:s||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:((b=this.Bt.bootstrap)==null||(b=b.featureFlags)==null?void 0:b[e])||null,$feature_flag_bootstrapped_payload:((x=this.Bt.bootstrap)==null||(x=x.featureFlagPayloads)==null?void 0:x[e])||null,$used_bootstrap_value:!this.rs};ze(I==null||(S=I.metadata)==null?void 0:S.version)||(L.$feature_flag_version=I.metadata.version);var q,j=(E=I==null||(T=I.reason)==null?void 0:T.description)!==null&&E!==void 0?E:I==null||(R=I.reason)==null?void 0:R.code;j&&(L.$feature_flag_reason=j),I!=null&&(O=I.metadata)!=null&&O.id&&(L.$feature_flag_id=I.metadata.id),ze(I?.original_variant)&&ze(I?.original_enabled)||(L.$feature_flag_original_response=ze(I.original_variant)?I.original_enabled:I.original_variant),I!=null&&(A=I.metadata)!=null&&A.original_payload&&(L.$feature_flag_original_payload=I==null||(q=I.metadata)==null?void 0:q.original_payload),M.length&&(L.$feature_flag_error=M.join(",")),this._instance.capture("$feature_flag_called",L)}if(r){var B=s;if(!ze(s))try{B=JSON.parse(s)}catch{}return{key:e,enabled:!!o,variant:typeof o=="string"?o:void 0,payload:B}}}}else Nr.warn('getFeatureFlagResult for key "'+e+pb)}getRemoteConfigPayload(e,t){var n=this.Bt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.cs()&&(r.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Bt.disable_compression?void 0:_i.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback(o){var s,l=(s=o.json)==null?void 0:s.featureFlagPayloads;t(l?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return ze(n)?void 0:!!n}Nr.warn('isFeatureEnabled for key "'+e+pb)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.ni){this.Kn=!0;var r=this.getFlagVariants(),o=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(l,c,d,f,p,h){d===void 0&&(d={}),f===void 0&&(f={}),p===void 0&&(p={});var g=(M=>{var L=M.flags;return L?(M.featureFlags=Object.fromEntries(Object.keys(L).map((q=>{var j;return[q,(j=L[q].variant)!==null&&j!==void 0?j:L[q].enabled]}))),M.featureFlagPayloads=Object.fromEntries(Object.keys(L).filter((q=>L[q].enabled)).filter((q=>{var j;return(j=L[q].metadata)==null?void 0:j.payload})).map((q=>{var j;return[q,(j=L[q].metadata)==null?void 0:j.payload]})))):Nr.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),M})(l),v=g.flags,_=g.featureFlags,b=g.featureFlagPayloads;if(_){var x=l.requestId,S=l.evaluatedAt;if(Mt(_)){Nr.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var E={};if(_)for(var T=0;_.length>T;T++)E[_[T]]=!0;c&&c.register({[Om]:_,[Pc]:E})}else{var R=_,O=b,A=v;if(h!=null&&h.partialResponse)R=Ne({},d,R),O=Ne({},f,O),A=Ne({},p,A);else if(l.errorsWhileComputingFlags)if(v){var I=new Set(Object.keys(v).filter((M=>{var L;return!((L=v[M])!=null&&L.failed)})));R=Ne({},d,Object.fromEntries(Object.entries(R).filter((M=>{var[L]=M;return I.has(L)})))),O=Ne({},f,Object.fromEntries(Object.entries(O||{}).filter((M=>{var[L]=M;return I.has(L)})))),A=Ne({},p,Object.fromEntries(Object.entries(A||{}).filter((M=>{var[L]=M;return I.has(L)}))))}else R=Ne({},d,R),O=Ne({},f,O),A=Ne({},p,A);c&&c.register(Ne({[Om]:Object.keys(OI(R)),[Pc]:R||{},[L1]:O||{},[D1]:A||{}},x?{[$1]:x}:{},S?{[dg]:S}:{}))}}})(e,this.ni,r,o,s,n),t||(this.ss=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),Nr.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return Nr.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this.ni.unregister(os),this.ni.unregister(Ec),this.ps(),Ha.info("All overrides cleared");if(Mt(e)){var t=RI(e);return this.ni.register({[os]:t}),this.ps(),Ha.info("Flag overrides set",{flags:e})}if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.ni.unregister(os),Ha.info("Flag overrides cleared");else if(r.flags){if(Mt(r.flags)){var o=RI(r.flags);this.ni.register({[os]:o})}else this.ni.register({[os]:r.flags});Ha.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.ni.unregister(Ec),Ha.info("Payload overrides cleared")):r.payloads&&(this.ni.register({[Ec]:r.payloads}),Ha.info("Payload overrides set",{payloads:r.payloads}))),void this.ps()}if(e&&typeof e=="object")return this.ni.register({[os]:e}),this.ps(),Ha.info("Flag overrides set",{flags:e});Nr.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:n}=this.gs();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,o=(this.os(Id)||[]).find((d=>d.flagKey===e)),s={["$feature_enrollment/"+e]:t},l={$feature_flag:e,$feature_enrollment:t,$set:s};o&&(l.$early_access_feature_name=o.name),n&&(l.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(s,!1);var c=Ne({},this.getFlagVariants(),{[e]:t});(r=this.ni)==null||r.register({[Om]:Object.keys(OI(c)),[Pc]:c}),this.ps()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.os(Id),o=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Bt.token+o),method:"GET",callback:s=>{var l,c;if(s.json){var d=s.json.earlyAccessFeatures;return(l=this.ni)==null||l.unregister(Id),(c=this.ni)==null||c.register({[Id]:d}),e(d)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((n=>t[n])),flagVariants:Object.keys(t).filter((n=>t[n])).reduce(((n,r)=>(n[r]=t[r],n)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Pd)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),o=e?.$set_once,s={};if(o)for(var l in o)({}).hasOwnProperty.call(o,l)&&(l in n||(s[l]=o[l]));this._instance.register({[Pd]:Ne({},n,s,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Pd)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Wa)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Ne({},n[r],e[r]),delete e[r]})),this._instance.register({[Wa]:Ne({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(Wa)||{};this._instance.register({[Wa]:Ne({},t,{[e]:{}})})}else this._instance.unregister(Wa)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},Zre={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){var e,t;return this.bs===vd||this.bs===Tp?this.bs:(e=(t=this.ys)==null?void 0:t.status)!==null&&e!==void 0?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=vI,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw Ys.error("started without valid sessionManager"),new Error(rw+" started without valid sessionManager. This is a bug.");if(this.Bt.cookieless_mode===as)throw new Error(rw+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!((e=this._instance.get_property(Ad))==null||!e.enabled),n=!this.Bt.disable_session_recording,r=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return me&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.ws||(t=this.ys)==null||!t.isStarted){var n=!ze(Object.assign)&&!ze(Array.from);this.ws&&n?(this.Is(e),Ys.info("starting")):(this.bs=vI,this.stopRecording())}}Is(e){var t,n,r;this.ws&&(this.bs!==vd&&this.bs!==Tp&&(this.bs=yI),We!=null&&(t=We.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=We.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Cs(e):(r=We.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(o=>{if(o)return Ys.error("could not load recorder",o);this.Cs(e)})))}stopRecording(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.stop()}xs(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.discard()}ks(){var e;(e=this.ni)==null||e.unregister(KS)}Ts(e,t){if(xt(e))return null;var n,r=Fo(e)?e:parseFloat(e);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Ys.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}As(e){if(this.ni){var t,n,r=this.ni,o=()=>{var s,l=e.sessionRecording===!1?void 0:e.sessionRecording,c=this.Ts((s=this.Bt.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),d=this.Ts(l?.sampleRate,"remote config sampleRate"),f=c??d;xt(f)&&this.ks();var p=l?.minimumDurationMilliseconds;r.register({[Ad]:Ne({cache_timestamp:Date.now(),enabled:!!l},l,{networkPayloadCapture:Ne({capturePerformance:e.capturePerformance},l?.networkPayloadCapture),canvasRecording:{enabled:l?.recordCanvas,fps:l?.canvasFps,quality:l?.canvasQuality},sampleRate:f,minimumDurationMilliseconds:ze(p)?null:p,endpoint:l?.endpoint,triggerMatchType:l?.triggerMatchType,masking:l?.masking,urlTriggers:l?.urlTriggers,version:l?.version,triggerGroups:l?.triggerGroups})})};o(),(t=this._s)==null||t.call(this),this._s=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(o)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.As(e),void this.xs()):(this.As(e),void this.startIfEnabledOrStop()):(this.bs===vd&&(this.bs=Tp,Ys.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Ys.warn("log called before recorder was ready")}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Ad);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Es(){var e,t=this._instance.get_property(Ad);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return 36e5>=Date.now()-n}Cs(e){var t,n;if((t=We.__PosthogExtensions__)==null||!t.initSessionRecording)return Ys.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[$5]:!0});if(this.ys||(this.ys=(n=We.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es())return this.bs===Tp||this.bs===vd?void 0:(this.bs=vd,Ys.info("persisted remote config is stale, requesting fresh config before starting"),void new Y5(this._instance).load());this.bs=yI,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.ni)==null||t.register({[P5]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[I5]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.ni)==null||n.register({[e==="url"?M5:N5]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.ys)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},Yre={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new hI(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e,t,n=An(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}Os(){if(this.isBrowserSupported()){if(me&&Le){var e=n=>{n=n||me?.event;try{this.Ps(n)}catch(r){pI.error("Failed to capture event",r)}};if(Vn(Le,"submit",e,{capture:!0}),Vn(Le,"change",e,{capture:!0}),Vn(Le,"click",e,{capture:!0}),this.Bt.capture_copied_text){var t=n=>{this.Ps(n=n||me?.event,db)};Vn(Le,"copy",t,{capture:!0}),Vn(Le,"cut",t,{capture:!0})}}}else pI.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[T1]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,n=[];return(t=this.Fs)==null||t.forEach((r=>{var o=Le?.querySelectorAll(r);o?.forEach((s=>{e===s&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[T1];if(ys(this.Ns)&&!Ri(n)&&!this.instance.Fr())return!1;var r=(t=this.Ns)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!r}Ps(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=aI(e);a6(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&(function(h,g){if(!me||tw(h))return!1;var v,_,b;if(Ri(g)?(v=!!g&&cI,_=void 0):(v=(b=g?.css_selector_ignorelist)!==null&&b!==void 0?b:cI,_=g?.content_ignorelist),v===!1)return!1;var{targetElementList:x}=uI(h,!1);return!(function(S,E){if(S===!1||ze(S))return!1;var T;if(S===!0)T=Mre;else{if(!Mt(S))return!1;if(S.length>10)return $e.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;T=S.map((R=>R.toLowerCase()))}return E.some((R=>{var{safeText:O,ariaLabel:A}=R;return T.some((I=>O.includes(I)||A.includes(I)))}))})(_,x.map((S=>{var E;return{safeText:cf(S).toLowerCase(),ariaLabel:((E=S.getAttribute("aria-label"))==null?void 0:E.toLowerCase().trim())||""}})))&&!lI(x,v)})(r,this.instance.config.rageclick)&&this.Ps(e,"$rageclick");var o=t===db;if(r&&(function(h,g,v,_,b){var x,S,E,T;if(v===void 0&&(v=void 0),!me||tw(h)||(x=v)!=null&&x.url_allowlist&&!sI(v.url_allowlist)||(S=v)!=null&&S.url_ignorelist&&sI(v.url_ignorelist))return!1;if((E=v)!=null&&E.dom_event_allowlist){var R=v.dom_event_allowlist;if(R&&!R.some((L=>g.type===L)))return!1}var{parentIsUsefulElement:O,targetElementList:A}=uI(h,_);if(!(function(L,q){var j=q?.element_allowlist;if(ze(j))return!0;var B,F=function(ie){if(j.some((H=>ie.tagName.toLowerCase()===H)))return{v:!0}};for(var Z of L)if(B=F(Z))return B.v;return!1})(A,v)||!lI(A,(T=v)==null?void 0:T.css_selector_allowlist))return!1;var I=me.getComputedStyle(h);if(I&&I.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0;var M=h.tagName.toLowerCase();switch(M){case"html":return!1;case"form":return(b||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(b||["change","click"]).indexOf(g.type)>=0;default:return O?(b||["click"]).indexOf(g.type)>=0:(b||["click"]).indexOf(g.type)>=0&&(eE.indexOf(M)>-1||h.getAttribute("contenteditable")==="true")}})(r,e,this.Bt,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:l}=zre(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(l)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(s.$element_selectors=c),t===db){var d,f=c6(me==null||(d=me.getSelection())==null?void 0:d.toString()),p=e.type||"clipboard";if(!f)return!1;s.$selected_content=f,s.$copy_type=p}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return is(Le?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ls=(me==null||(t=me.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&($e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,$e.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(me&&me.history){var n=this;(e=me.history.pushState)!=null&&e.__posthog_wrapped__||mI(me.history,"pushState",(r=>function(o,s,l){r.call(this,o,s,l),n.Bs("pushState")})),(t=me.history.replaceState)!=null&&t.__posthog_wrapped__||mI(me.history,"replaceState",(r=>function(o,s,l){r.call(this,o,s,l),n.Bs("replaceState")})),this.js()}}Bs(e){try{var t,n=me==null||(t=me.location)==null?void 0:t.pathname;if(!n)return;n!==this.Ls&&this.isEnabled&&this._instance.capture(xc,{navigation_type:e}),this.Ls=n}catch(r){$e.error("Error capturing "+e+" pageview",r)}}js(){if(!this.Ds){var e=()=>{this.Bs("popstate")};Vn(me,"popstate",e),this.Ds=()=>{me&&me.removeEventListener("popstate",e)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!((t=this.instance.persistence)==null||!t.props[C1]),this.rageclicks=new hI(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return An(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return xt(this.Bt.capture_heatmaps)?xt(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:this.Bt.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Fre.info("starting..."),this.Zs(),this.Ft()}else{var e;clearInterval((e=this.qs)!==null&&e!==void 0?e:void 0),this.Vs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[C1]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Hs(e){this.Tt(e.originalEvent,"deadclick")}Ft(){this.qs&&clearInterval(this.qs),this.qs=Le?.visibilityState==="visible"?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){me&&Le&&(this.zs=this.Yr.bind(this),Vn(me,mg,this.zs),this.Us=e=>this.Tt(e||me?.event),Vn(Le,"click",this.Us,{capture:!0}),this.Ys=e=>this.Gs(e||me?.event),Vn(Le,"mousemove",this.Ys,{capture:!0}),this.Ws=new UA(this.instance,ere,this.Hs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Ft.bind(this),Vn(Le,pg,this.Xs),this.Rs=!0)}Vs(){var e;me&&Le&&(this.zs&&me.removeEventListener(mg,this.zs),this.Us&&Le.removeEventListener("click",this.Us,{capture:!0}),this.Ys&&Le.removeEventListener("mousemove",this.Ys,{capture:!0}),this.Xs&&Le.removeEventListener(pg,this.Xs),clearTimeout(this.Js),(e=this.Ws)==null||e.stop(),this.Rs=!1)}Ks(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(l,c,d){for(var f=l;f&&av(f)&&!ua(f,"body");){if(f===d)return!1;if(Et(c,me?.getComputedStyle(f).position))return!0;f=u6(f)}return!1})(aI(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}Tt(e,t){var n;if(t===void 0&&(t="click"),!iI(e.target)&&_I(e)){var r=this.Ks(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Qs(Ne({},r,{type:"rageclick"})),this.Qs(r)}}Gs(e){!iI(e.target)&&_I(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,"mousemove"))}),500))}Qs(e){if(me){var t=me.location.href,n=this.Bt.custom_personal_data_properties,r=this.Bt.mask_personal_data_properties?[...Qc,...n||[]]:[],o=af(t,r,lf);this.T=this.T||{},this.T[o]||(this.T[o]=[]),this.T[o].push(e)}}Yr(){this.T&&!Ic(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:UA,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.T.metrics.length!==0&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((n,r)=>Ne({},n,{["$web_vitals_"+r.name+"_event"]:Ne({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(ze(o))Zs.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.io();ze(s)||(xt(n?.name)||xt(n?.value)?Zs.error("Invalid metric received",n):!this.no||this.no>n.value?(this.T.url!==s&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),ze(this.T.url)&&(this.T.url=s),this.T.firstMetricTimestamp=ze(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.T.metrics.push(Ne({},n,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):Zs.error("Ignoring metric with value >= "+this.no,n))}},this.so=()=>{if(!this.Rs){var n,r,o,s,l=We.__PosthogExtensions__;ze(l)||ze(l.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:s}=l.postHogWebVitalsCallbacks),n&&r&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.ht.bind(this)),this.Rs=!0):Zs.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.$s=!((t=this._instance.persistence)==null||!t.props[M1]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=An(this.oo)?(e=this.oo)==null?void 0:e.web_vitals_allowed_metrics:void 0;return xt(n)?((t=this._instance.persistence)==null?void 0:t.props[k1])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(An(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=An(this.oo)?this.oo.web_vitals_attribution:void 0;return e!=null&&e}get no(){var e=An(this.oo)&&Fo(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:gI;return e>0&&6e4>=e?gI:e}get isEnabled(){var e=pr?.protocol;if(e!=="http:"&&e!=="https:")return Zs.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=An(this.oo)?this.oo.web_vitals:Ri(this.oo)?this.oo:void 0;return Ri(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(Zs.info("enabled, starting..."),this.ur(this.so))}onRemoteConfig(e){if("capturePerformance"in e){var t=An(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=An(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[M1]:t}),this._instance.persistence.register({[k1]:n})),this.$s=t,this.startIfEnabled()}}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Zs.error("failed to load script",r):e()}))}io(){var e=me?me.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Qc,...t||[]]:[];return af(e,n,lf)}Zs.error("Could not determine current URL")}}},Wre={exceptionObserver:class{constructor(e){var t,n,r;this.so=()=>{var o;if(me&&this.isEnabled&&(o=We.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=We.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,l=We.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,c=We.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=s(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=l(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=c(this.captureException.bind(this)))}catch(d){gd.error("failed to start",d),this.ho()}}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[A1]),this.do=new cne({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,Gt:gd}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return An(e)?t=Ne({},t,e):(ze(e)?this.co:e)&&(t=Ne({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(gd.info("enabled"),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return gd.error("failed to load script",r);e()}))}ho(){var e,t,n;(e=this.ao)==null||e.call(this),this.ao=void 0,(t=this.lo)==null||t.call(this),this.lo=void 0,(n=this.uo)==null||n.call(this),this.uo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[A1]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,n,r,o=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.do.consumeRateLimit(o)?gd.info("Skipping exception capture because of client rate limiting.",{exception:o}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.fo=[],this.po=new Sne([new Ine,new zne,new Mne,new Pne,new $ne,new Lne,new kne,new jne],(function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;o>l;l++)s[l-1]=arguments[l];return function(c,d){d===void 0&&(d=0);for(var f=[],p=c.split(`
|
|
156
|
+
`),h=d;p.length>h;h++){var g=p[h];if(1024>=g.length){var v=LA.test(g)?g.replace(LA,"$1"):g;if(!v.match(/\S*Error: /)){for(var _ of s){var b=_(v,r);if(b){f.push(b);break}}if(f.length>=50)break}}}return(function(x){if(!x.length)return[];var S=Array.from(x);return S.reverse(),S.slice(0,50).map((E=>{return Ne({},E,{filename:E.filename||(T=S,T[T.length-1]||{}).filename,function:E.function||Wc});var T}))})(f)}})("web:javascript",One,Ane)),this._instance=e,this.fo=(t=(n=this._instance.persistence)==null?void 0:n.get_property(I1))!==null&&t!==void 0?t:[],this.mo=lg(this.yo()),this.bo=new Fne(this.mo)}onConfigChange(){this.mo=lg(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var o=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.fo=o,this._instance.persistence&&this._instance.persistence.register({[I1]:this.fo,[P1]:s})}}get _o(){var e,t=!!this._instance.get_property(P1),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!_n(e)||e.trim().length===0)return void es.warn("Ignoring exception step because message must be a non-empty string");var n=this.wo(t),{sanitizedProperties:r,droppedKeys:o}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};var l=[];return{sanitizedProperties:Object.keys(s).reduce(((c,d)=>Une.has(d)?(l.push(d),c):(c[d]=s[d],c)),{}),droppedKeys:l}})(n);o.length>0&&es.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this.bo.add(Ne({[sg]:e,[ag]:new Date().toISOString()},r))}catch(s){es.error("Failed to add exception step. Ignoring breadcrumb.",s)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Io(t)){if(this.Co(t))return this.So("Exception dropped: matched a suppression rule"),void es.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.xo(t))return this.So("Exception dropped: thrown by a browser extension"),void es.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ko(t))return this.So("Exception dropped: thrown by the PostHog SDK"),void es.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.mo.enabled&&xt(e.$exception_steps)?this.To(e):e;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return r&&this.bo.clear(),r}catch(o){return es.error("Failed to capture exception event. Dropping this exception.",o),void this.bo.clear()}}catch(o){return void es.error("Failed to process exception event. Ignoring this exception.",o)}}To(e){try{var t=this.bo.getAttachable();return t.length===0?e:Ne({},e,{$exception_steps:t})}catch(n){return es.error("Failed to read buffered exception steps. Capturing exception without steps.",n),e}}So(e){this.mo.enabled&&this.bo.add({[sg]:e,[ag]:new Date().toISOString()})}wo(e){return An(e)?Ne({},e):{}}yo(){var e,t;return(e=(t=this._instance.config.error_tracking)==null?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}Co(e){if(e.length===0)return!1;var t=e.reduce(((n,r)=>{var{type:o,value:s}=r;return _n(o)&&o.length>0&&n.$exception_types.push(o),_n(s)&&s.length>0&&n.$exception_values.push(s),n}),{$exception_types:[],$exception_values:[]});return this.fo.some((n=>{var r=n.values.map((o=>{var s,l=r6[o.operator],c=Mt(o.value)?o.value:[o.value],d=(s=t[o.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,d)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}xo(e){return e.flatMap((t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ko(e){if(e.length>0){var t,n,r,o,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],l=s[s.length-1];return(r=l==null||(o=l.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Io(e){return!xt(e)&&Mt(e)}}},Qre=Ne({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Ao=null,this.Eo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ni&&this.ni.register({[N1]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ao||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(N1)||this.ur((()=>this.Ro()))}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?bI.error("Could not load product tours script",r):e()}))}Ro(){var e;!this.Ao&&(e=We.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ao=We.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Mt(this.Eo)||t){var n=this.ni;if(n){var r=n.props[Tm];if(Mt(r)&&!t)return this.Eo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:o=>{var s=o.statusCode;if(s!==200||!o.json){var l="Product Tours API could not be loaded, status: "+s;return bI.error(l),void e([],{isLoaded:!1,error:l})}var c=Mt(o.json.product_tours)?o.json.product_tours:[];this.Eo=c,n&&n.register({[Tm]:c}),e(c,{isLoaded:!0})}})}else e(this.Eo,{isLoaded:!0})}getActiveProductTours(e){xt(this.Ao)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ao.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ao)==null||t.showTourById(e)}previewTour(e){this.Ao?this.Ao.previewTour(e):this.ur((()=>{var t;this.Ro(),(t=this.Ao)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ao)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ao)==null||e.nextStep()}previousStep(){var e;(e=this.Ao)==null||e.previousStep()}clearCache(){var e;this.Eo=null,(e=this.ni)==null||e.unregister(Tm)}resetTour(e){var t;(t=this.Ao)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Ao)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ao)==null||t.cancelPendingTour(e)}}},lv),Xre={siteApps:class{constructor(e){this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mo(e,t){if(t){var n=this.globalsForEvent(t);this.No.push(n),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return(e=We._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Mo.bind(this));this.Fo=()=>{e(),this.No=[],this.Fo=void 0}}}globalsForEvent(e){var t,n,r,o,s,l,c;if(!e)throw new Error("Event payload is required");var d={},f=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(p))d[h]={id:f[h],type:h,properties:g};var{$set_once:v,$set:_}=e;return{event:Ne({},o5(e,Bre),{properties:Ne({},e.properties,_?{$set:Ne({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},_)}:{},v?{$set_once:Ne({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},v)}:{}),elements_chain:(s=(l=e.properties)==null?void 0:l.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(c=e.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var l;!t.errored&&this.No.length&&(Ws.info("Processing "+this.No.length+" events for site app with id "+e.id),this.No.forEach((c=>t.processEvent==null?void 0:t.processEvent(c))),t.processedBuffer=!0),Object.values(this.apps).every((c=>c.processedBuffer||c.errored))&&((l=this.Fo)==null||l.call(this))},r=!1,o=l=>{t.errored=!l,t.loaded=!0,Ws.info("Site app with id "+e.id+" "+(l?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(l){o(l)}});s&&(t.processEvent=s),r=!0}catch(l){Ws.error(wI+e.id,l),o(!1)}if(r&&t.loaded)try{n()}catch(l){Ws.error("Error while processing buffered events PostHog app with config id "+e.id,l),t.errored=!0}}Oo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Po(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){Ws.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Oo(),void this._instance.on("eventCaptured",(d=>this.Po(d)))):void Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Fo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(d){var f;We["__$$ph_site_app_"+d]=o._instance,(f=We.__PosthogExtensions__)==null||f.loadSiteApp==null||f.loadSiteApp(o._instance,c,(p=>{if(p)return Ws.error(wI+d,p)}))};for(var{id:l,url:c}of e.siteApps)s(l)}else Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Jre={tracingHeaders:class{constructor(e){this.Lo=void 0,this.Do=void 0,this.so=()=>{var t,n,r=this.Bo()||[];ze(this.Lo)&&((t=We.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),ze(this.Do)&&((n=We.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,n;(t=We.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=We.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return Ure.error("failed to load script",r);e()}))}Bo(){var e;return(e=this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Bo()?this.ur(this.so):((e=this.Lo)==null||e.call(this),(t=this.Do)==null||t.call(this),this.Lo=void 0,this.Do=void 0)}}},eoe=Ne({surveys:class{get Bt(){return this._instance.config}constructor(e){this.jo=void 0,this._surveyManager=null,this.$o=!1,this.qo=[],this.Zo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Bt.disable_surveys){var t=e.surveys;if(xt(t))return Xt.warn("Flags not loaded yet. Not loading surveys.");var n=Mt(t);this.jo=n?t.length>0:t,Xt.info("flags response received, isSurveysEnabled: "+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(J1)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.$o)Xt.info("Already initializing surveys, skipping...");else if(this.Bt.disable_surveys)Xt.info(SI);else if(this.Bt.cookieless_mode&&this._instance.consent.isOptedOut())Xt.info("Not loading surveys in cookieless mode without consent.");else{var e=We?.__PosthogExtensions__;if(e){if(!ze(this.jo)||this.Bt.advanced_enable_surveys){var t=this.jo||this.Bt.advanced_enable_surveys;this.$o=!0;try{var n=e.generateSurveys;if(n)return void this.Vo(n,t);var r=e.loadExternalDependency;if(!r)return void this.Ho(ZS);r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.Ho("Could not load surveys script",o):this.Vo(e.generateSurveys,t)}))}catch(o){throw this.Ho("Error initializing surveys",o),o}finally{this.$o=!1}}}else Xt.error("PostHog Extensions not found.")}}Vo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Hre(this._instance),Xt.info("Surveys loaded successfully"),this.zo({isLoaded:!0})}Ho(e,t){Xt.error(e,t),this.zo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.qo.push(e),this._surveyManager&&this.zo({isLoaded:!0}),()=>{this.qo=this.qo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Bt.disable_surveys)return Xt.info(SI),e([]);var n,r=this._instance.get_property(j1);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.Zo?this.Zo.then((o=>{var{surveys:s,context:l}=o;return e(s,l)})):(typeof Promise<"u"&&(this.Zo=new Promise((o=>{n=o}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Bt.token),method:"GET",timeout:this.Bt.surveys_request_timeout_ms,callback:o=>{var s;this.Zo=null;var l=o.statusCode;if(l!==200||!o.json){var c="Surveys API could not be loaded, status: "+l;Xt.error(c);var d={isLoaded:!1,error:c};return e([],d),void(n==null||n({surveys:[],context:d}))}var f,p=o.json.surveys||[],h=p.filter((v=>(function(_){return!(!_.start_date||_.end_date)})(v)&&((function(_){var b;return!((b=_.conditions)==null||(b=b.events)==null||(b=b.values)==null||!b.length)})(v)||(function(_){var b;return!((b=_.conditions)==null||(b=b.actions)==null||(b=b.values)==null||!b.length)})(v))));h.length>0&&((f=this._surveyEventReceiver)==null||f.register(h)),(s=this._instance.persistence)==null||s.register({[j1]:p});var g={isLoaded:!0};e(p,g),n?.({surveys:p,context:g})}}))}zo(e){for(var t of this.qo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){Xt.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!xt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Xt.warn("init was not called")}Uo(e){var t=null;return this.getSurveys((n=>{var r;t=(r=n.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),t}Yo(e){if(xt(this._surveyManager))return{eligible:!1,reason:hb};var t=typeof e=="string"?this.Uo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(xt(this._surveyManager))return Xt.warn("init was not called"),{visible:!1,disabledReason:hb};var t=this.Yo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return xt(this._surveyManager)?(Xt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:hb})):new Promise((n=>{this.getSurveys((r=>{var o,s=(o=r.find((c=>c.id===e)))!==null&&o!==void 0?o:null;if(s){var l=this.Yo(s);n({visible:l.eligible,disabledReason:l.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,n){var r;if(xt(this._surveyManager))Xt.warn("init was not called");else{var o=typeof e=="string"?this.Uo(e):e;if(o!=null&&o.id)if(Rre.includes(o.type)){var s=Le?.querySelector(t);if(s)return(r=o.appearance)!=null&&r.surveyPopupDelaySeconds?(Xt.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,c;Xt.info("Rendering survey "+o.id+" with delay of "+((l=o.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(o,s,n),Xt.info("Survey "+o.id+" rendered")}),1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,s,n);Xt.warn("Survey element not found")}else Xt.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Xt.warn("Survey not found")}}displaySurvey(e,t){var n;if(xt(this._surveyManager))Xt.warn("init was not called");else{var r=this.Uo(e);if(r){var o=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=Ne({},r,{appearance:Ne({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==K1.Popover&&t.initialResponses&&Xt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var s=this.canRenderSurvey(r);if(!s.visible)return void Xt.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==K1.Inline?this._surveyManager.handlePopoverSurvey(o,t):this.renderSurvey(o,t.selector,t.properties)}else Xt.warn("Survey not found")}}cancelPendingSurvey(e){xt(this._surveyManager)?Xt.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},lv),toe={toolbar:class{constructor(e){this.instance=e}Go(e){We.ph_toolbar_state=e}Wo(){var e;return(e=We.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),j5(this.instance.config)||!me||!Le)return!1;e=e??me.location,n=n??me.history;try{if(!t){try{me.localStorage.setItem("test","test"),me.localStorage.removeItem("test")}catch{return!1}t=me?.localStorage}var r,o=Gre||_g(e.hash,"__posthog")||_g(e.hash,"state"),s=o?jA((()=>JSON.parse(atob(decodeURIComponent(o)))))||jA((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(EI)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Xo(e){var t=We.ph_load_toolbar||We.ph_load_editor;!xt(t)&&is(t)?t(e,this.instance):xI.warn("No toolbar load function found")}loadToolbar(e){var t=!(Le==null||!Le.getElementById(k5));if(!me||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Ne({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(me.localStorage.setItem(EI,JSON.stringify(Ne({},r,{source:void 0}))),this.Wo()===2)this.Xo(r);else if(this.Wo()===0){var o;this.Go(1),(o=We.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return xI.error("[Toolbar] Failed to load",s),void this.Go(0);this.Go(2),this.Xo(r)})),Vn(me,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(r)}))}return!0}Jo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},noe=Ne({experiments:Rr},lv),roe={conversations:class{constructor(e){this.Ko=void 0,this._conversationsManager=null,this.Qo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;xt(t)||(Ri(t)?this.Ko=t:(this.Ko=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ko=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Qo||this._instance.config.disable_conversations||j5(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=We?.__PosthogExtensions__;if(e&&!ze(this.Ko)&&this.Ko)if(this.ea&&this.ea.token){this.Qo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Qo=!1);var n=e.loadExternalDependency;if(!n)return void this.ra(ZS);n(this._instance,"conversations",(r=>{r||!e.initConversations?this.ra("Could not load conversations script",r):this.ta(e.initConversations),this.Qo=!1}))}catch(r){this.ra("Error initializing conversations",r),this.Qo=!1}}else ko.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),ko.info("Conversations loaded successfully")}catch(t){this.ra("Error completing conversations initialization",t)}else ko.error("Cannot complete initialization: remote config is null")}ra(e,t){ko.error(e,t),this._conversationsManager=null,this.Qo=!1}show(){this._conversationsManager?this._conversationsManager.show():ko.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ko===!0&&!ys(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return Lo((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(ko.warn(Ga),null)}))()}getMessages(e,t){var n=this;return Lo((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(ko.warn(Ga),null)}))()}markAsRead(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ko.warn(Ga),null)}))()}getTickets(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ko.warn(Ga),null)}))()}requestRestoreLink(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ko.warn(Ga),null)}))()}restoreFromToken(e){var t=this;return Lo((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ko.warn(Ga),null)}))()}restoreFromUrlToken(){var e=this;return Lo((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ko.warn(Ga),null)}))()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}un(){var e;(e=this._conversationsManager)==null||e.setIdentity()}hn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},ooe={logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=mn("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.la=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!xt(n)&&n&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.oa=0,this.aa=0,this.la=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=We?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(n=>{var r;n||(r=e.logs)==null||!r.initializeLogs?this.Gt.error("Could not load logs script",n):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(ZS)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,n,r,o,s,l;if(this._instance.is_capturing())if(e&&e.body){var c=(t=(n=this._instance.config.logs)==null?void 0:n.flushIntervalMs)!==null&&t!==void 0?t:3e3,d=(r=(o=this._instance.config.logs)==null?void 0:o.maxLogsPerInterval)!==null&&r!==void 0?r:1e3,f=Date.now();if(c>f-this.aa||(this.aa=f,this.oa=0,this.la=!1),d>this.oa){this.oa++;var p=(function(h,g){var v=h.level||"info",{text:_,number:b}=x5[v]||bne,x=String(Date.now())+"000000",S={};g.distinctId&&(S.posthogDistinctId=g.distinctId),g.sessionId&&(S.sessionId=g.sessionId),g.currentUrl&&(S["url.full"]=g.currentUrl),g.screenName&&(S["screen.name"]=g.screenName),g.appState&&(S["app.state"]=g.appState),g.activeFeatureFlags&&g.activeFeatureFlags.length>0&&(S.feature_flags=g.activeFeatureFlags);var E=Ne({},S,h.attributes||{}),T={timeUnixNano:x,observedTimeUnixNano:x,severityNumber:b,severityText:_,body:{stringValue:h.body},attributes:DA(E)};return h.trace_id&&(T.traceId=h.trace_id),h.span_id&&(T.spanId=h.span_id),ze(h.trace_flags)||(T.flags=h.trace_flags),T})(e,this.ua());this.sa.push({record:p}),((s=(l=this._instance.config.logs)==null?void 0:l.maxBufferSize)!==null&&s!==void 0?s:100)>this.sa.length?this.ha():this.flushLogs()}else this.la||(this.Gt.warn("captureLog dropping logs: exceeded "+d+" logs per "+c+"ms"),this.la=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ca}flushLogs(e){if(this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.sa.length!==0){var t=this.sa;this.sa=[];var n=this._instance.config.logs,r=Ne({"service.name":n?.serviceName||"unknown_service"},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),o=(function(l,c,d,f){return{resourceLogs:[{resource:{attributes:DA(c)},scopeLogs:[{scope:{name:d,version:f},logRecords:l}]}]}})(t.map((l=>l.record)),r,$r.LIB_NAME,$r.LIB_VERSION),s=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Vi({method:"POST",url:s,data:o,compression:"best-available",batchKey:"logs",transport:e})}}ha(){var e,t;this.jr||(this.jr=setTimeout((()=>{this.jr=void 0,this.flushLogs()}),(e=(t=this._instance.config.logs)==null?void 0:t.flushIntervalMs)!==null&&e!==void 0?e:3e3))}ua(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(We!=null&&(e=We.location)!=null&&e.href&&(t.currentUrl=We.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}},ioe=Ne({},lv,Zre,Yre,Wre,Qre,Xre,eoe,Jre,toe,noe,roe,ooe);$o.__defaultExtensionClasses=Ne({},ioe);var CI,_l=(CI=Ud[Rc]=new $o,(function(){function e(){e.done||(e.done=!0,s6=!1,dn(Ud,(function(t){t._dom_loaded()})))}Le!=null&&Le.addEventListener?Le.readyState==="complete"?e():Vn(Le,"DOMContentLoaded",e,{capture:!1}):me&&$e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),CI);const soe={from({org:e,project:t}){return`${e}/${t}`},parse(e){e.startsWith("/")&&(e=e.slice(1));const[t,n]=e.split("/");if(!t||!n)throw new Error("Invalid locator");return{org:t,project:n}}},m6=P.createContext(void 0),aoe=()=>{const e=P.useContext(m6);if(!e)throw new Error("useProjectContext must be used within a ProjectContextProvider");return e},aue=()=>aoe().org,lue=e=>{const t=Hn.c(10),{children:n,org:r,project:o}=e;let s;t[0]!==r.id||t[1]!==o.id?(s=soe.from({org:r.id,project:o.id}),t[0]=r.id,t[1]=o.id,t[2]=s):s=t[2];const l=s;let c;t[3]!==l||t[4]!==r||t[5]!==o?(c={org:r,project:o,locator:l},t[3]=l,t[4]=r,t[5]=o,t[6]=c):c=t[6];const d=c;let f;return t[7]!==n||t[8]!==d?(f=C.jsx(m6.Provider,{value:d,children:n}),t[7]=n,t[8]=d,t[9]=f):f=t[9],f},cv={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n,r)=>["mcp","client",e,t,n,r],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpUiResourceHtml:(e,t,n)=>["mcp","ui-resource-html",e,t,n],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],virtualMcpLastUsed:(e,t)=>["virtual-mcp","last-used",e,t],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,r,o)=>[e,t,n,"collection",r,o],collectionList:(e,t,n,r,o)=>[e,t,n,"collection",r,"list",o],collectionListInfinite:(e,t,n,r,o)=>[e,t,n,"collection",r,"list-infinite",o],githubReadme:(e,t)=>["github-readme",e,t],githubBranches:(e,t,n,r,o)=>["github-branches",e,t,n,r,o],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e],registryApp:(e,t)=>["registry-app",e,t]},loe="2025-11-25",cue=[loe,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],coe="io.modelcontextprotocol/related-task",uv="2.0",Jn=SV(e=>e!==null&&(typeof e=="object"||typeof e=="function")),g6=nn([$(),dt().int()]),v6=$();vr({ttl:dt().optional(),pollInterval:dt().optional()});const uoe=be({ttl:dt().optional()}),doe=be({taskId:$()}),tE=vr({progressToken:g6.optional(),[coe]:doe.optional()}),wo=be({_meta:tE.optional()}),Of=wo.extend({task:uoe.optional()}),uue=e=>Of.safeParse(e).success,_r=be({method:$(),params:wo.loose().optional()}),Vo=be({_meta:tE.optional()}),qo=be({method:$(),params:Vo.loose().optional()}),br=vr({_meta:tE.optional()}),dv=nn([$(),dt().int()]),y6=be({jsonrpc:Ge(uv),id:dv,..._r.shape}).strict(),due=e=>y6.safeParse(e).success,_6=be({jsonrpc:Ge(uv),...qo.shape}).strict(),fue=e=>_6.safeParse(e).success,nE=be({jsonrpc:Ge(uv),id:dv,result:br}).strict(),hue=e=>nE.safeParse(e).success;var uf;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(uf||(uf={}));const rE=be({jsonrpc:Ge(uv),id:dv.optional(),error:be({code:dt().int(),message:$(),data:Gt().optional()})}).strict(),pue=e=>rE.safeParse(e).success,mue=nn([y6,_6,nE,rE]);nn([nE,rE]);const b6=br.strict(),foe=Vo.extend({requestId:dv.optional(),reason:$().optional()}),w6=qo.extend({method:Ge("notifications/cancelled"),params:foe}),hoe=be({src:$(),mimeType:$().optional(),sizes:Re($()).optional(),theme:an(["light","dark"]).optional()}),Tf=be({icons:Re(hoe).optional()}),Jc=be({name:$(),title:$().optional()}),S6=Jc.extend({...Jc.shape,...Tf.shape,version:$(),websiteUrl:$().optional(),description:$().optional()}),poe=Hw(be({applyDefaults:Nt().optional()}),Pt($(),Gt())),moe=Kw(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Hw(be({form:poe.optional(),url:Jn.optional()}),Pt($(),Gt()).optional())),goe=vr({list:Jn.optional(),cancel:Jn.optional(),requests:vr({sampling:vr({createMessage:Jn.optional()}).optional(),elicitation:vr({create:Jn.optional()}).optional()}).optional()}),voe=vr({list:Jn.optional(),cancel:Jn.optional(),requests:vr({tools:vr({call:Jn.optional()}).optional()}).optional()}),yoe=be({experimental:Pt($(),Jn).optional(),sampling:be({context:Jn.optional(),tools:Jn.optional()}).optional(),elicitation:moe.optional(),roots:be({listChanged:Nt().optional()}).optional(),tasks:goe.optional(),extensions:Pt($(),Jn).optional()}),_oe=wo.extend({protocolVersion:$(),capabilities:yoe,clientInfo:S6}),boe=_r.extend({method:Ge("initialize"),params:_oe}),woe=be({experimental:Pt($(),Jn).optional(),logging:Jn.optional(),completions:Jn.optional(),prompts:be({listChanged:Nt().optional()}).optional(),resources:be({subscribe:Nt().optional(),listChanged:Nt().optional()}).optional(),tools:be({listChanged:Nt().optional()}).optional(),tasks:voe.optional(),extensions:Pt($(),Jn).optional()}),Soe=br.extend({protocolVersion:$(),capabilities:woe,serverInfo:S6,instructions:$().optional()}),E6=qo.extend({method:Ge("notifications/initialized"),params:Vo.optional()}),gue=e=>E6.safeParse(e).success,x6=_r.extend({method:Ge("ping"),params:wo.optional()}),Eoe=be({progress:dt(),total:bn(dt()),message:bn($())}),xoe=be({...Vo.shape,...Eoe.shape,progressToken:g6}),R6=qo.extend({method:Ge("notifications/progress"),params:xoe}),Roe=wo.extend({cursor:v6.optional()}),Cf=_r.extend({params:Roe.optional()}),Af=br.extend({nextCursor:v6.optional()}),Ooe=an(["working","input_required","completed","failed","cancelled"]),If=be({taskId:$(),status:Ooe,ttl:nn([dt(),YB()]),createdAt:$(),lastUpdatedAt:$(),pollInterval:bn(dt()),statusMessage:bn($())}),O6=br.extend({task:If}),Toe=Vo.merge(If),T6=qo.extend({method:Ge("notifications/tasks/status"),params:Toe}),C6=_r.extend({method:Ge("tasks/get"),params:wo.extend({taskId:$()})}),A6=br.merge(If),I6=_r.extend({method:Ge("tasks/result"),params:wo.extend({taskId:$()})});br.loose();const P6=Cf.extend({method:Ge("tasks/list")}),M6=Af.extend({tasks:Re(If)}),N6=_r.extend({method:Ge("tasks/cancel"),params:wo.extend({taskId:$()})}),vue=br.merge(If),k6=be({uri:$(),mimeType:bn($()),_meta:Pt($(),Gt()).optional()}),D6=k6.extend({text:$()}),oE=$().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),L6=k6.extend({blob:oE}),Pf=an(["user","assistant"]),iu=be({audience:Re(Pf).optional(),priority:dt().min(0).max(1).optional(),lastModified:K3({offset:!0}).optional()}),$6=be({...Jc.shape,...Tf.shape,uri:$(),description:bn($()),mimeType:bn($()),size:bn(dt()),annotations:iu.optional(),_meta:bn(vr({}))}),Coe=be({...Jc.shape,...Tf.shape,uriTemplate:$(),description:bn($()),mimeType:bn($()),annotations:iu.optional(),_meta:bn(vr({}))}),Aoe=Cf.extend({method:Ge("resources/list")}),Ioe=Af.extend({resources:Re($6)}),Poe=Cf.extend({method:Ge("resources/templates/list")}),Moe=Af.extend({resourceTemplates:Re(Coe)}),iE=wo.extend({uri:$()}),Noe=iE,koe=_r.extend({method:Ge("resources/read"),params:Noe}),Doe=br.extend({contents:Re(nn([D6,L6]))}),Loe=qo.extend({method:Ge("notifications/resources/list_changed"),params:Vo.optional()}),$oe=iE,joe=_r.extend({method:Ge("resources/subscribe"),params:$oe}),zoe=iE,Uoe=_r.extend({method:Ge("resources/unsubscribe"),params:zoe}),Foe=Vo.extend({uri:$()}),Boe=qo.extend({method:Ge("notifications/resources/updated"),params:Foe}),Voe=be({name:$(),description:bn($()),required:bn(Nt())}),qoe=be({...Jc.shape,...Tf.shape,description:bn($()),arguments:bn(Re(Voe)),_meta:bn(vr({}))}),Hoe=Cf.extend({method:Ge("prompts/list")}),Goe=Af.extend({prompts:Re(qoe)}),Koe=wo.extend({name:$(),arguments:Pt($(),$()).optional()}),Zoe=_r.extend({method:Ge("prompts/get"),params:Koe}),sE=be({type:Ge("text"),text:$(),annotations:iu.optional(),_meta:Pt($(),Gt()).optional()}),aE=be({type:Ge("image"),data:oE,mimeType:$(),annotations:iu.optional(),_meta:Pt($(),Gt()).optional()}),lE=be({type:Ge("audio"),data:oE,mimeType:$(),annotations:iu.optional(),_meta:Pt($(),Gt()).optional()}),Yoe=be({type:Ge("tool_use"),name:$(),id:$(),input:Pt($(),Gt()),_meta:Pt($(),Gt()).optional()}),Woe=be({type:Ge("resource"),resource:nn([D6,L6]),annotations:iu.optional(),_meta:Pt($(),Gt()).optional()}),Qoe=$6.extend({type:Ge("resource_link")}),cE=nn([sE,aE,lE,Qoe,Woe]),Xoe=be({role:Pf,content:cE}),Joe=br.extend({description:$().optional(),messages:Re(Xoe)}),eie=qo.extend({method:Ge("notifications/prompts/list_changed"),params:Vo.optional()}),tie=be({title:$().optional(),readOnlyHint:Nt().optional(),destructiveHint:Nt().optional(),idempotentHint:Nt().optional(),openWorldHint:Nt().optional()}),nie=be({taskSupport:an(["required","optional","forbidden"]).optional()}),uE=be({...Jc.shape,...Tf.shape,description:$().optional(),inputSchema:be({type:Ge("object"),properties:Pt($(),Jn).optional(),required:Re($()).optional()}).catchall(Gt()),outputSchema:be({type:Ge("object"),properties:Pt($(),Jn).optional(),required:Re($()).optional()}).catchall(Gt()).optional(),annotations:tie.optional(),execution:nie.optional(),_meta:Pt($(),Gt()).optional()}),rie=Cf.extend({method:Ge("tools/list")}),oie=Af.extend({tools:Re(uE)}),j6=br.extend({content:Re(cE).default([]),structuredContent:Pt($(),Gt()).optional(),isError:Nt().optional()});j6.or(br.extend({toolResult:Gt()}));const iie=Of.extend({name:$(),arguments:Pt($(),Gt()).optional()}),sie=_r.extend({method:Ge("tools/call"),params:iie}),aie=qo.extend({method:Ge("notifications/tools/list_changed"),params:Vo.optional()}),yue=be({autoRefresh:Nt().default(!0),debounceMs:dt().int().nonnegative().default(300)}),z6=an(["debug","info","notice","warning","error","critical","alert","emergency"]),lie=wo.extend({level:z6}),cie=_r.extend({method:Ge("logging/setLevel"),params:lie}),uie=Vo.extend({level:z6,logger:$().optional(),data:Gt()}),die=qo.extend({method:Ge("notifications/message"),params:uie}),fie=be({name:$().optional()}),hie=be({hints:Re(fie).optional(),costPriority:dt().min(0).max(1).optional(),speedPriority:dt().min(0).max(1).optional(),intelligencePriority:dt().min(0).max(1).optional()}),pie=be({mode:an(["auto","required","none"]).optional()}),mie=be({type:Ge("tool_result"),toolUseId:$().describe("The unique identifier for the corresponding tool call."),content:Re(cE).default([]),structuredContent:be({}).loose().optional(),isError:Nt().optional(),_meta:Pt($(),Gt()).optional()}),gie=qw("type",[sE,aE,lE]),xg=qw("type",[sE,aE,lE,Yoe,mie]),vie=be({role:Pf,content:nn([xg,Re(xg)]),_meta:Pt($(),Gt()).optional()}),yie=Of.extend({messages:Re(vie),modelPreferences:hie.optional(),systemPrompt:$().optional(),includeContext:an(["none","thisServer","allServers"]).optional(),temperature:dt().optional(),maxTokens:dt().int(),stopSequences:Re($()).optional(),metadata:Jn.optional(),tools:Re(uE).optional(),toolChoice:pie.optional()}),_ie=_r.extend({method:Ge("sampling/createMessage"),params:yie}),bie=br.extend({model:$(),stopReason:bn(an(["endTurn","stopSequence","maxTokens"]).or($())),role:Pf,content:gie}),wie=br.extend({model:$(),stopReason:bn(an(["endTurn","stopSequence","maxTokens","toolUse"]).or($())),role:Pf,content:nn([xg,Re(xg)])}),Sie=be({type:Ge("boolean"),title:$().optional(),description:$().optional(),default:Nt().optional()}),Eie=be({type:Ge("string"),title:$().optional(),description:$().optional(),minLength:dt().optional(),maxLength:dt().optional(),format:an(["email","uri","date","date-time"]).optional(),default:$().optional()}),xie=be({type:an(["number","integer"]),title:$().optional(),description:$().optional(),minimum:dt().optional(),maximum:dt().optional(),default:dt().optional()}),Rie=be({type:Ge("string"),title:$().optional(),description:$().optional(),enum:Re($()),default:$().optional()}),Oie=be({type:Ge("string"),title:$().optional(),description:$().optional(),oneOf:Re(be({const:$(),title:$()})),default:$().optional()}),Tie=be({type:Ge("string"),title:$().optional(),description:$().optional(),enum:Re($()),enumNames:Re($()).optional(),default:$().optional()}),Cie=nn([Rie,Oie]),Aie=be({type:Ge("array"),title:$().optional(),description:$().optional(),minItems:dt().optional(),maxItems:dt().optional(),items:be({type:Ge("string"),enum:Re($())}),default:Re($()).optional()}),Iie=be({type:Ge("array"),title:$().optional(),description:$().optional(),minItems:dt().optional(),maxItems:dt().optional(),items:be({anyOf:Re(be({const:$(),title:$()}))}),default:Re($()).optional()}),Pie=nn([Aie,Iie]),Mie=nn([Tie,Cie,Pie]),Nie=nn([Mie,Sie,Eie,xie]),kie=Of.extend({mode:Ge("form").optional(),message:$(),requestedSchema:be({type:Ge("object"),properties:Pt($(),Nie),required:Re($()).optional()})}),Die=Of.extend({mode:Ge("url"),message:$(),elicitationId:$(),url:$().url()}),Lie=nn([kie,Die]),$ie=_r.extend({method:Ge("elicitation/create"),params:Lie}),jie=Vo.extend({elicitationId:$()}),zie=qo.extend({method:Ge("notifications/elicitation/complete"),params:jie}),Uie=br.extend({action:an(["accept","decline","cancel"]),content:Kw(e=>e===null?void 0:e,Pt($(),nn([$(),dt(),Nt(),Re($())])).optional())}),Fie=be({type:Ge("ref/resource"),uri:$()}),Bie=be({type:Ge("ref/prompt"),name:$()}),Vie=wo.extend({ref:nn([Bie,Fie]),argument:be({name:$(),value:$()}),context:be({arguments:Pt($(),$()).optional()}).optional()}),qie=_r.extend({method:Ge("completion/complete"),params:Vie}),Hie=br.extend({completion:vr({values:Re($()).max(100),total:bn(dt().int()),hasMore:bn(Nt())})}),Gie=be({uri:$().startsWith("file://"),name:$().optional(),_meta:Pt($(),Gt()).optional()}),Kie=_r.extend({method:Ge("roots/list"),params:wo.optional()}),Zie=br.extend({roots:Re(Gie)}),Yie=qo.extend({method:Ge("notifications/roots/list_changed"),params:Vo.optional()});nn([x6,boe,qie,cie,Zoe,Hoe,Aoe,Poe,koe,joe,Uoe,sie,rie,C6,I6,P6,N6]);nn([w6,R6,E6,Yie,T6]);nn([b6,bie,wie,Uie,Zie,A6,M6,O6]);nn([x6,_ie,$ie,Kie,C6,I6,P6,N6]);nn([w6,R6,die,Boe,Loe,aie,eie,T6,zie]);nn([b6,Soe,Hie,Joe,Goe,Ioe,Moe,Doe,j6,oie,A6,M6,O6]);class fv extends Error{constructor(t,n,r){super(`MCP error ${t}: ${n}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,n,r){if(t===uf.UrlElicitationRequired&&r){const o=r;if(o.elicitations)return new Wie(o.elicitations,n)}return new fv(t,n,r)}}class Wie extends fv{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(uf.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Cp={exports:{}},mb={},ts={},Ka={},gb={},vb={},yb={},AI;function Rg(){return AI||(AI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(E){if(super(),!e.IDENTIFIER.test(E))throw new Error("CodeGen: name must be a valid identifier");this.str=E}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(E){super(),this._items=typeof E=="string"?[E]:E}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const E=this._items[0];return E===""||E==='""'}get str(){var E;return(E=this._str)!==null&&E!==void 0?E:this._str=this._items.reduce((T,R)=>`${T}${R}`,"")}get names(){var E;return(E=this._names)!==null&&E!==void 0?E:this._names=this._items.reduce((T,R)=>(R instanceof n&&(T[R.str]=(T[R.str]||0)+1),T),{})}}e._Code=r,e.nil=new r("");function o(S,...E){const T=[S[0]];let R=0;for(;R<E.length;)c(T,E[R]),T.push(S[++R]);return new r(T)}e._=o;const s=new r("+");function l(S,...E){const T=[v(S[0])];let R=0;for(;R<E.length;)T.push(s),c(T,E[R]),T.push(s,v(S[++R]));return d(T),new r(T)}e.str=l;function c(S,E){E instanceof r?S.push(...E._items):E instanceof n?S.push(E):S.push(h(E))}e.addCodeArg=c;function d(S){let E=1;for(;E<S.length-1;){if(S[E]===s){const T=f(S[E-1],S[E+1]);if(T!==void 0){S.splice(E-1,3,T);continue}S[E++]="+"}E++}}function f(S,E){if(E==='""')return S;if(S==='""')return E;if(typeof S=="string")return E instanceof n||S[S.length-1]!=='"'?void 0:typeof E!="string"?`${S.slice(0,-1)}${E}"`:E[0]==='"'?S.slice(0,-1)+E.slice(1):void 0;if(typeof E=="string"&&E[0]==='"'&&!(S instanceof n))return`"${S}${E.slice(1)}`}function p(S,E){return E.emptyStr()?S:S.emptyStr()?E:l`${S}${E}`}e.strConcat=p;function h(S){return typeof S=="number"||typeof S=="boolean"||S===null?S:v(Array.isArray(S)?S.join(","):S)}function g(S){return new r(v(S))}e.stringify=g;function v(S){return JSON.stringify(S).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function _(S){return typeof S=="string"&&e.IDENTIFIER.test(S)?new r(`.${S}`):o`[${S}]`}e.getProperty=_;function b(S){if(typeof S=="string"&&e.IDENTIFIER.test(S))return new r(`${S}`);throw new Error(`CodeGen: invalid export name: ${S}, use explicit $id name mapping`)}e.getEsmExportName=b;function x(S){return new r(S.toString())}e.regexpCode=x})(yb)),yb}var _b={},II;function PI(){return II||(II=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Rg();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:f,parent:p}={}){this._names={},this._prefixes=f,this._parent=p}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const p=this._names[f]||this._nameGroup(f);return`${f}${p.index++}`}_nameGroup(f){var p,h;if(!((h=(p=this._parent)===null||p===void 0?void 0:p._prefixes)===null||h===void 0)&&h.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=o;class s extends t.Name{constructor(f,p){super(p),this.prefix=f}setValue(f,{property:p,itemIndex:h}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(p)}[${h}]`}}e.ValueScopeName=s;const l=(0,t._)`\n`;class c extends o{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?l:t.nil}}get(){return this._scope}name(f){return new s(f,this._newName(f))}value(f,p){var h;if(p.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(f),{prefix:v}=g,_=(h=p.key)!==null&&h!==void 0?h:p.ref;let b=this._values[v];if(b){const E=b.get(_);if(E)return E}else b=this._values[v]=new Map;b.set(_,g);const x=this._scope[v]||(this._scope[v]=[]),S=x.length;return x[S]=p.ref,g.setValue(p,{property:v,itemIndex:S}),g}getValue(f,p){const h=this._values[f];if(h)return h.get(p)}scopeRefs(f,p=this._values){return this._reduceValues(p,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${f}${h.scopePath}`})}scopeCode(f=this._values,p,h){return this._reduceValues(f,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},p,h)}_reduceValues(f,p,h={},g){let v=t.nil;for(const _ in f){const b=f[_];if(!b)continue;const x=h[_]=h[_]||new Map;b.forEach(S=>{if(x.has(S))return;x.set(S,r.Started);let E=p(S);if(E){const T=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${T} ${S} = ${E};${this.opts._n}`}else if(E=g?.(S))v=(0,t._)`${v}${E}${this.opts._n}`;else throw new n(S);x.set(S,r.Completed)})}return v}}e.ValueScope=c})(_b)),_b}var MI;function yt(){return MI||(MI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Rg(),n=PI();var r=Rg();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=PI();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(D,U){return this}}class l extends s{constructor(D,U,X){super(),this.varKind=D,this.name=U,this.rhs=X}render({es5:D,_n:U}){const X=D?n.varKinds.var:this.varKind,fe=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${fe};`+U}optimizeNames(D,U){if(D[this.name.str])return this.rhs&&(this.rhs=Z(this.rhs,D,U)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class c extends s{constructor(D,U,X){super(),this.lhs=D,this.rhs=U,this.sideEffects=X}render({_n:D}){return`${this.lhs} = ${this.rhs};`+D}optimizeNames(D,U){if(!(this.lhs instanceof t.Name&&!D[this.lhs.str]&&!this.sideEffects))return this.rhs=Z(this.rhs,D,U),this}get names(){const D=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(D,this.rhs)}}class d extends c{constructor(D,U,X,fe){super(D,X,fe),this.op=U}render({_n:D}){return`${this.lhs} ${this.op}= ${this.rhs};`+D}}class f extends s{constructor(D){super(),this.label=D,this.names={}}render({_n:D}){return`${this.label}:`+D}}class p extends s{constructor(D){super(),this.label=D,this.names={}}render({_n:D}){return`break${this.label?` ${this.label}`:""};`+D}}class h extends s{constructor(D){super(),this.error=D}render({_n:D}){return`throw ${this.error};`+D}get names(){return this.error.names}}class g extends s{constructor(D){super(),this.code=D}render({_n:D}){return`${this.code};`+D}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(D,U){return this.code=Z(this.code,D,U),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends s{constructor(D=[]){super(),this.nodes=D}render(D){return this.nodes.reduce((U,X)=>U+X.render(D),"")}optimizeNodes(){const{nodes:D}=this;let U=D.length;for(;U--;){const X=D[U].optimizeNodes();Array.isArray(X)?D.splice(U,1,...X):X?D[U]=X:D.splice(U,1)}return D.length>0?this:void 0}optimizeNames(D,U){const{nodes:X}=this;let fe=X.length;for(;fe--;){const pe=X[fe];pe.optimizeNames(D,U)||(ie(D,pe.names),X.splice(fe,1))}return X.length>0?this:void 0}get names(){return this.nodes.reduce((D,U)=>B(D,U.names),{})}}class _ extends v{render(D){return"{"+D._n+super.render(D)+"}"+D._n}}class b extends v{}class x extends _{}x.kind="else";class S extends _{constructor(D,U){super(U),this.condition=D}render(D){let U=`if(${this.condition})`+super.render(D);return this.else&&(U+="else "+this.else.render(D)),U}optimizeNodes(){super.optimizeNodes();const D=this.condition;if(D===!0)return this.nodes;let U=this.else;if(U){const X=U.optimizeNodes();U=this.else=Array.isArray(X)?new x(X):X}if(U)return D===!1?U instanceof S?U:U.nodes:this.nodes.length?this:new S(H(D),U instanceof S?[U]:U.nodes);if(!(D===!1||!this.nodes.length))return this}optimizeNames(D,U){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames(D,U),!!(super.optimizeNames(D,U)||this.else))return this.condition=Z(this.condition,D,U),this}get names(){const D=super.names;return F(D,this.condition),this.else&&B(D,this.else.names),D}}S.kind="if";class E extends _{}E.kind="for";class T extends E{constructor(D){super(),this.iteration=D}render(D){return`for(${this.iteration})`+super.render(D)}optimizeNames(D,U){if(super.optimizeNames(D,U))return this.iteration=Z(this.iteration,D,U),this}get names(){return B(super.names,this.iteration.names)}}class R extends E{constructor(D,U,X,fe){super(),this.varKind=D,this.name=U,this.from=X,this.to=fe}render(D){const U=D.es5?n.varKinds.var:this.varKind,{name:X,from:fe,to:pe}=this;return`for(${U} ${X}=${fe}; ${X}<${pe}; ${X}++)`+super.render(D)}get names(){const D=F(super.names,this.from);return F(D,this.to)}}class O extends E{constructor(D,U,X,fe){super(),this.loop=D,this.varKind=U,this.name=X,this.iterable=fe}render(D){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(D)}optimizeNames(D,U){if(super.optimizeNames(D,U))return this.iterable=Z(this.iterable,D,U),this}get names(){return B(super.names,this.iterable.names)}}class A extends _{constructor(D,U,X){super(),this.name=D,this.args=U,this.async=X}render(D){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(D)}}A.kind="func";class I extends v{render(D){return"return "+super.render(D)}}I.kind="return";class M extends _{render(D){let U="try"+super.render(D);return this.catch&&(U+=this.catch.render(D)),this.finally&&(U+=this.finally.render(D)),U}optimizeNodes(){var D,U;return super.optimizeNodes(),(D=this.catch)===null||D===void 0||D.optimizeNodes(),(U=this.finally)===null||U===void 0||U.optimizeNodes(),this}optimizeNames(D,U){var X,fe;return super.optimizeNames(D,U),(X=this.catch)===null||X===void 0||X.optimizeNames(D,U),(fe=this.finally)===null||fe===void 0||fe.optimizeNames(D,U),this}get names(){const D=super.names;return this.catch&&B(D,this.catch.names),this.finally&&B(D,this.finally.names),D}}class L extends _{constructor(D){super(),this.error=D}render(D){return`catch(${this.error})`+super.render(D)}}L.kind="catch";class q extends _{render(D){return"finally"+super.render(D)}}q.kind="finally";class j{constructor(D,U={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...U,_n:U.lines?`
|
|
157
157
|
`:""},this._extScope=D,this._scope=new n.Scope({parent:D}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(D){return this._scope.name(D)}scopeName(D){return this._extScope.name(D)}scopeValue(D,U){const X=this._extScope.value(D,U);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(D,U){return this._extScope.getValue(D,U)}scopeRefs(D){return this._extScope.scopeRefs(D,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(D,U,X,fe){const pe=this._scope.toName(U);return X!==void 0&&fe&&(this._constants[pe.str]=X),this._leafNode(new l(D,pe,X)),pe}const(D,U,X){return this._def(n.varKinds.const,D,U,X)}let(D,U,X){return this._def(n.varKinds.let,D,U,X)}var(D,U,X){return this._def(n.varKinds.var,D,U,X)}assign(D,U,X){return this._leafNode(new c(D,U,X))}add(D,U){return this._leafNode(new d(D,e.operators.ADD,U))}code(D){return typeof D=="function"?D():D!==t.nil&&this._leafNode(new g(D)),this}object(...D){const U=["{"];for(const[X,fe]of D)U.length>1&&U.push(","),U.push(X),(X!==fe||this.opts.es5)&&(U.push(":"),(0,t.addCodeArg)(U,fe));return U.push("}"),new t._Code(U)}if(D,U,X){if(this._blockNode(new S(D)),U&&X)this.code(U).else().code(X).endIf();else if(U)this.code(U).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(D){return this._elseNode(new S(D))}else(){return this._elseNode(new x)}endIf(){return this._endBlockNode(S,x)}_for(D,U){return this._blockNode(D),U&&this.code(U).endFor(),this}for(D,U){return this._for(new T(D),U)}forRange(D,U,X,fe,pe=this.opts.es5?n.varKinds.var:n.varKinds.let){const xe=this._scope.toName(D);return this._for(new R(pe,xe,U,X),()=>fe(xe))}forOf(D,U,X,fe=n.varKinds.const){const pe=this._scope.toName(D);if(this.opts.es5){const xe=U instanceof t.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,t._)`${xe}.length`,je=>{this.var(pe,(0,t._)`${xe}[${je}]`),X(pe)})}return this._for(new O("of",fe,pe,U),()=>X(pe))}forIn(D,U,X,fe=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(D,(0,t._)`Object.keys(${U})`,X);const pe=this._scope.toName(D);return this._for(new O("in",fe,pe,U),()=>X(pe))}endFor(){return this._endBlockNode(E)}label(D){return this._leafNode(new f(D))}break(D){return this._leafNode(new p(D))}return(D){const U=new I;if(this._blockNode(U),this.code(D),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(D,U,X){if(!U&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const fe=new M;if(this._blockNode(fe),this.code(D),U){const pe=this.name("e");this._currNode=fe.catch=new L(pe),U(pe)}return X&&(this._currNode=fe.finally=new q,this.code(X)),this._endBlockNode(L,q)}throw(D){return this._leafNode(new h(D))}block(D,U){return this._blockStarts.push(this._nodes.length),D&&this.code(D).endBlock(U),this}endBlock(D){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-U;if(X<0||D!==void 0&&X!==D)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${D} expected`);return this._nodes.length=U,this}func(D,U=t.nil,X,fe){return this._blockNode(new A(D,U,X)),fe&&this.code(fe).endFunc(),this}endFunc(){return this._endBlockNode(A)}optimize(D=1){for(;D-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(D){return this._currNode.nodes.push(D),this}_blockNode(D){this._currNode.nodes.push(D),this._nodes.push(D)}_endBlockNode(D,U){const X=this._currNode;if(X instanceof D||U&&X instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${D.kind}/${U.kind}`:D.kind}"`)}_elseNode(D){const U=this._currNode;if(!(U instanceof S))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=D,this}get _root(){return this._nodes[0]}get _currNode(){const D=this._nodes;return D[D.length-1]}set _currNode(D){const U=this._nodes;U[U.length-1]=D}}e.CodeGen=j;function B(V,D){for(const U in D)V[U]=(V[U]||0)+(D[U]||0);return V}function F(V,D){return D instanceof t._CodeOrName?B(V,D.names):V}function Z(V,D,U){if(V instanceof t.Name)return X(V);if(!fe(V))return V;return new t._Code(V._items.reduce((pe,xe)=>(xe instanceof t.Name&&(xe=X(xe)),xe instanceof t._Code?pe.push(...xe._items):pe.push(xe),pe),[]));function X(pe){const xe=U[pe.str];return xe===void 0||D[pe.str]!==1?pe:(delete D[pe.str],xe)}function fe(pe){return pe instanceof t._Code&&pe._items.some(xe=>xe instanceof t.Name&&D[xe.str]===1&&U[xe.str]!==void 0)}}function ie(V,D){for(const U in D)V[U]=(V[U]||0)-(D[U]||0)}function H(V){return typeof V=="boolean"||typeof V=="number"||V===null?!V:(0,t._)`!${G(V)}`}e.not=H;const W=k(e.operators.AND);function te(...V){return V.reduce(W)}e.and=te;const le=k(e.operators.OR);function Q(...V){return V.reduce(le)}e.or=Q;function k(V){return(D,U)=>D===t.nil?U:U===t.nil?D:(0,t._)`${G(D)} ${V} ${G(U)}`}function G(V){return V instanceof t.Name?V:(0,t._)`(${V})`}})(vb)),vb}var mt={},NI;function kt(){if(NI)return mt;NI=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.checkStrictMode=mt.getErrorPath=mt.Type=mt.useFunc=mt.setEvaluated=mt.evaluatedPropsToName=mt.mergeEvaluated=mt.eachItem=mt.unescapeJsonPointer=mt.escapeJsonPointer=mt.escapeFragment=mt.unescapeFragment=mt.schemaRefOrVal=mt.schemaHasRulesButRef=mt.schemaHasRules=mt.checkUnknownRules=mt.alwaysValidSchema=mt.toHash=void 0;const e=yt(),t=Rg();function n(O){const A={};for(const I of O)A[I]=!0;return A}mt.toHash=n;function r(O,A){return typeof A=="boolean"?A:Object.keys(A).length===0?!0:(o(O,A),!s(A,O.self.RULES.all))}mt.alwaysValidSchema=r;function o(O,A=O.schema){const{opts:I,self:M}=O;if(!I.strictSchema||typeof A=="boolean")return;const L=M.RULES.keywords;for(const q in A)L[q]||R(O,`unknown keyword: "${q}"`)}mt.checkUnknownRules=o;function s(O,A){if(typeof O=="boolean")return!O;for(const I in O)if(A[I])return!0;return!1}mt.schemaHasRules=s;function l(O,A){if(typeof O=="boolean")return!O;for(const I in O)if(I!=="$ref"&&A.all[I])return!0;return!1}mt.schemaHasRulesButRef=l;function c({topSchemaRef:O,schemaPath:A},I,M,L){if(!L){if(typeof I=="number"||typeof I=="boolean")return I;if(typeof I=="string")return(0,e._)`${I}`}return(0,e._)`${O}${A}${(0,e.getProperty)(M)}`}mt.schemaRefOrVal=c;function d(O){return h(decodeURIComponent(O))}mt.unescapeFragment=d;function f(O){return encodeURIComponent(p(O))}mt.escapeFragment=f;function p(O){return typeof O=="number"?`${O}`:O.replace(/~/g,"~0").replace(/\//g,"~1")}mt.escapeJsonPointer=p;function h(O){return O.replace(/~1/g,"/").replace(/~0/g,"~")}mt.unescapeJsonPointer=h;function g(O,A){if(Array.isArray(O))for(const I of O)A(I);else A(O)}mt.eachItem=g;function v({mergeNames:O,mergeToName:A,mergeValues:I,resultToName:M}){return(L,q,j,B)=>{const F=j===void 0?q:j instanceof e.Name?(q instanceof e.Name?O(L,q,j):A(L,q,j),j):q instanceof e.Name?(A(L,j,q),q):I(q,j);return B===e.Name&&!(F instanceof e.Name)?M(L,F):F}}mt.mergeEvaluated={props:v({mergeNames:(O,A,I)=>O.if((0,e._)`${I} !== true && ${A} !== undefined`,()=>{O.if((0,e._)`${A} === true`,()=>O.assign(I,!0),()=>O.assign(I,(0,e._)`${I} || {}`).code((0,e._)`Object.assign(${I}, ${A})`))}),mergeToName:(O,A,I)=>O.if((0,e._)`${I} !== true`,()=>{A===!0?O.assign(I,!0):(O.assign(I,(0,e._)`${I} || {}`),b(O,I,A))}),mergeValues:(O,A)=>O===!0?!0:{...O,...A},resultToName:_}),items:v({mergeNames:(O,A,I)=>O.if((0,e._)`${I} !== true && ${A} !== undefined`,()=>O.assign(I,(0,e._)`${A} === true ? true : ${I} > ${A} ? ${I} : ${A}`)),mergeToName:(O,A,I)=>O.if((0,e._)`${I} !== true`,()=>O.assign(I,A===!0?!0:(0,e._)`${I} > ${A} ? ${I} : ${A}`)),mergeValues:(O,A)=>O===!0?!0:Math.max(O,A),resultToName:(O,A)=>O.var("items",A)})};function _(O,A){if(A===!0)return O.var("props",!0);const I=O.var("props",(0,e._)`{}`);return A!==void 0&&b(O,I,A),I}mt.evaluatedPropsToName=_;function b(O,A,I){Object.keys(I).forEach(M=>O.assign((0,e._)`${A}${(0,e.getProperty)(M)}`,!0))}mt.setEvaluated=b;const x={};function S(O,A){return O.scopeValue("func",{ref:A,code:x[A.code]||(x[A.code]=new t._Code(A.code))})}mt.useFunc=S;var E;(function(O){O[O.Num=0]="Num",O[O.Str=1]="Str"})(E||(mt.Type=E={}));function T(O,A,I){if(O instanceof e.Name){const M=A===E.Num;return I?M?(0,e._)`"[" + ${O} + "]"`:(0,e._)`"['" + ${O} + "']"`:M?(0,e._)`"/" + ${O}`:(0,e._)`"/" + ${O}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return I?(0,e.getProperty)(O).toString():"/"+p(O)}mt.getErrorPath=T;function R(O,A,I=O.opts.strictSchema){if(I){if(A=`strict mode: ${A}`,I===!0)throw new Error(A);O.self.logger.warn(A)}}return mt.checkStrictMode=R,mt}var Ap={},kI;function wa(){if(kI)return Ap;kI=1,Object.defineProperty(Ap,"__esModule",{value:!0});const e=yt(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ap.default=t,Ap}var DI;function hv(){return DI||(DI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=yt(),n=kt(),r=wa();e.keywordError={message:({keyword:x})=>(0,t.str)`must pass "${x}" keyword validation`},e.keyword$DataError={message:({keyword:x,schemaType:S})=>S?(0,t.str)`"${x}" keyword must be ${S} ($data)`:(0,t.str)`"${x}" keyword is invalid ($data)`};function o(x,S=e.keywordError,E,T){const{it:R}=x,{gen:O,compositeRule:A,allErrors:I}=R,M=h(x,S,E);T??(A||I)?d(O,M):f(R,(0,t._)`[${M}]`)}e.reportError=o;function s(x,S=e.keywordError,E){const{it:T}=x,{gen:R,compositeRule:O,allErrors:A}=T,I=h(x,S,E);d(R,I),O||A||f(T,r.default.vErrors)}e.reportExtraError=s;function l(x,S){x.assign(r.default.errors,S),x.if((0,t._)`${r.default.vErrors} !== null`,()=>x.if(S,()=>x.assign((0,t._)`${r.default.vErrors}.length`,S),()=>x.assign(r.default.vErrors,null)))}e.resetErrorsCount=l;function c({gen:x,keyword:S,schemaValue:E,data:T,errsCount:R,it:O}){if(R===void 0)throw new Error("ajv implementation error");const A=x.name("err");x.forRange("i",R,r.default.errors,I=>{x.const(A,(0,t._)`${r.default.vErrors}[${I}]`),x.if((0,t._)`${A}.instancePath === undefined`,()=>x.assign((0,t._)`${A}.instancePath`,(0,t.strConcat)(r.default.instancePath,O.errorPath))),x.assign((0,t._)`${A}.schemaPath`,(0,t.str)`${O.errSchemaPath}/${S}`),O.opts.verbose&&(x.assign((0,t._)`${A}.schema`,E),x.assign((0,t._)`${A}.data`,T))})}e.extendErrors=c;function d(x,S){const E=x.const("err",S);x.if((0,t._)`${r.default.vErrors} === null`,()=>x.assign(r.default.vErrors,(0,t._)`[${E}]`),(0,t._)`${r.default.vErrors}.push(${E})`),x.code((0,t._)`${r.default.errors}++`)}function f(x,S){const{gen:E,validateName:T,schemaEnv:R}=x;R.$async?E.throw((0,t._)`new ${x.ValidationError}(${S})`):(E.assign((0,t._)`${T}.errors`,S),E.return(!1))}const p={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function h(x,S,E){const{createErrors:T}=x.it;return T===!1?(0,t._)`{}`:g(x,S,E)}function g(x,S,E={}){const{gen:T,it:R}=x,O=[v(R,E),_(x,E)];return b(x,S,O),T.object(...O)}function v({errorPath:x},{instancePath:S}){const E=S?(0,t.str)`${x}${(0,n.getErrorPath)(S,n.Type.Str)}`:x;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,E)]}function _({keyword:x,it:{errSchemaPath:S}},{schemaPath:E,parentSchema:T}){let R=T?S:(0,t.str)`${S}/${x}`;return E&&(R=(0,t.str)`${R}${(0,n.getErrorPath)(E,n.Type.Str)}`),[p.schemaPath,R]}function b(x,{params:S,message:E},T){const{keyword:R,data:O,schemaValue:A,it:I}=x,{opts:M,propertyName:L,topSchemaRef:q,schemaPath:j}=I;T.push([p.keyword,R],[p.params,typeof S=="function"?S(x):S||(0,t._)`{}`]),M.messages&&T.push([p.message,typeof E=="function"?E(x):E]),M.verbose&&T.push([p.schema,A],[p.parentSchema,(0,t._)`${q}${j}`],[r.default.data,O]),L&&T.push([p.propertyName,L])}})(gb)),gb}var LI;function Qie(){if(LI)return Ka;LI=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.boolOrEmptySchema=Ka.topBoolOrEmptySchema=void 0;const e=hv(),t=yt(),n=wa(),r={message:"boolean schema is false"};function o(c){const{gen:d,schema:f,validateName:p}=c;f===!1?l(c,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign((0,t._)`${p}.errors`,null),d.return(!0))}Ka.topBoolOrEmptySchema=o;function s(c,d){const{gen:f,schema:p}=c;p===!1?(f.var(d,!1),l(c)):f.var(d,!0)}Ka.boolOrEmptySchema=s;function l(c,d){const{gen:f,data:p}=c,h={gen:f,keyword:"false schema",data:p,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(h,r,void 0,d)}return Ka}var fr={},Za={},$I;function U6(){if($I)return Za;$I=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.getRules=Za.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(o){return typeof o=="string"&&t.has(o)}Za.isJSONType=n;function r(){const o={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...o,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},o.number,o.string,o.array,o.object],post:{rules:[]},all:{},keywords:{}}}return Za.getRules=r,Za}var ns={},jI;function F6(){if(jI)return ns;jI=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.shouldUseRule=ns.shouldUseGroup=ns.schemaHasRulesForType=void 0;function e({schema:r,self:o},s){const l=o.RULES.types[s];return l&&l!==!0&&t(r,l)}ns.schemaHasRulesForType=e;function t(r,o){return o.rules.some(s=>n(r,s))}ns.shouldUseGroup=t;function n(r,o){var s;return r[o.keyword]!==void 0||((s=o.definition.implements)===null||s===void 0?void 0:s.some(l=>r[l]!==void 0))}return ns.shouldUseRule=n,ns}var zI;function Og(){if(zI)return fr;zI=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.reportTypeError=fr.checkDataTypes=fr.checkDataType=fr.coerceAndCheckDataType=fr.getJSONTypes=fr.getSchemaTypes=fr.DataType=void 0;const e=U6(),t=F6(),n=hv(),r=yt(),o=kt();var s;(function(E){E[E.Correct=0]="Correct",E[E.Wrong=1]="Wrong"})(s||(fr.DataType=s={}));function l(E){const T=c(E.type);if(T.includes("null")){if(E.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!T.length&&E.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');E.nullable===!0&&T.push("null")}return T}fr.getSchemaTypes=l;function c(E){const T=Array.isArray(E)?E:E?[E]:[];if(T.every(e.isJSONType))return T;throw new Error("type must be JSONType or JSONType[]: "+T.join(","))}fr.getJSONTypes=c;function d(E,T){const{gen:R,data:O,opts:A}=E,I=p(T,A.coerceTypes),M=T.length>0&&!(I.length===0&&T.length===1&&(0,t.schemaHasRulesForType)(E,T[0]));if(M){const L=_(T,O,A.strictNumbers,s.Wrong);R.if(L,()=>{I.length?h(E,T,I):x(E)})}return M}fr.coerceAndCheckDataType=d;const f=new Set(["string","number","integer","boolean","null"]);function p(E,T){return T?E.filter(R=>f.has(R)||T==="array"&&R==="array"):[]}function h(E,T,R){const{gen:O,data:A,opts:I}=E,M=O.let("dataType",(0,r._)`typeof ${A}`),L=O.let("coerced",(0,r._)`undefined`);I.coerceTypes==="array"&&O.if((0,r._)`${M} == 'object' && Array.isArray(${A}) && ${A}.length == 1`,()=>O.assign(A,(0,r._)`${A}[0]`).assign(M,(0,r._)`typeof ${A}`).if(_(T,A,I.strictNumbers),()=>O.assign(L,A))),O.if((0,r._)`${L} !== undefined`);for(const j of R)(f.has(j)||j==="array"&&I.coerceTypes==="array")&&q(j);O.else(),x(E),O.endIf(),O.if((0,r._)`${L} !== undefined`,()=>{O.assign(A,L),g(E,L)});function q(j){switch(j){case"string":O.elseIf((0,r._)`${M} == "number" || ${M} == "boolean"`).assign(L,(0,r._)`"" + ${A}`).elseIf((0,r._)`${A} === null`).assign(L,(0,r._)`""`);return;case"number":O.elseIf((0,r._)`${M} == "boolean" || ${A} === null
|
|
158
158
|
|| (${M} == "string" && ${A} && ${A} == +${A})`).assign(L,(0,r._)`+${A}`);return;case"integer":O.elseIf((0,r._)`${M} === "boolean" || ${A} === null
|
|
159
159
|
|| (${M} === "string" && ${A} && ${A} == +${A} && !(${A} % 1))`).assign(L,(0,r._)`+${A}`);return;case"boolean":O.elseIf((0,r._)`${A} === "false" || ${A} === 0 || ${A} === null`).assign(L,!1).elseIf((0,r._)`${A} === "true" || ${A} === 1`).assign(L,!0);return;case"null":O.elseIf((0,r._)`${A} === "" || ${A} === 0 || ${A} === false`),O.assign(L,null);return;case"array":O.elseIf((0,r._)`${M} === "string" || ${M} === "number"
|
|
160
160
|
|| ${M} === "boolean" || ${A} === null`).assign(L,(0,r._)`[${A}]`)}}}function g({gen:E,parentData:T,parentDataProperty:R},O){E.if((0,r._)`${T} !== undefined`,()=>E.assign((0,r._)`${T}[${R}]`,O))}function v(E,T,R,O=s.Correct){const A=O===s.Correct?r.operators.EQ:r.operators.NEQ;let I;switch(E){case"null":return(0,r._)`${T} ${A} null`;case"array":I=(0,r._)`Array.isArray(${T})`;break;case"object":I=(0,r._)`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":I=M((0,r._)`!(${T} % 1) && !isNaN(${T})`);break;case"number":I=M();break;default:return(0,r._)`typeof ${T} ${A} ${E}`}return O===s.Correct?I:(0,r.not)(I);function M(L=r.nil){return(0,r.and)((0,r._)`typeof ${T} == "number"`,L,R?(0,r._)`isFinite(${T})`:r.nil)}}fr.checkDataType=v;function _(E,T,R,O){if(E.length===1)return v(E[0],T,R,O);let A;const I=(0,o.toHash)(E);if(I.array&&I.object){const M=(0,r._)`typeof ${T} != "object"`;A=I.null?M:(0,r._)`!${T} || ${M}`,delete I.null,delete I.array,delete I.object}else A=r.nil;I.number&&delete I.integer;for(const M in I)A=(0,r.and)(A,v(M,T,R,O));return A}fr.checkDataTypes=_;const b={message:({schema:E})=>`must be ${E}`,params:({schema:E,schemaValue:T})=>typeof E=="string"?(0,r._)`{type: ${E}}`:(0,r._)`{type: ${T}}`};function x(E){const T=S(E);(0,n.reportError)(T,b)}fr.reportTypeError=x;function S(E){const{gen:T,data:R,schema:O}=E,A=(0,o.schemaRefOrVal)(E,O,"type");return{gen:T,keyword:"type",data:R,schema:O.type,schemaCode:A,schemaValue:A,parentSchema:O,params:{},it:E}}return fr}var yd={},UI;function Xie(){if(UI)return yd;UI=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.assignDefaults=void 0;const e=yt(),t=kt();function n(o,s){const{properties:l,items:c}=o.schema;if(s==="object"&&l)for(const d in l)r(o,d,l[d].default);else s==="array"&&Array.isArray(c)&&c.forEach((d,f)=>r(o,f,d.default))}yd.assignDefaults=n;function r(o,s,l){const{gen:c,compositeRule:d,data:f,opts:p}=o;if(l===void 0)return;const h=(0,e._)`${f}${(0,e.getProperty)(s)}`;if(d){(0,t.checkStrictMode)(o,`default is ignored for: ${h}`);return}let g=(0,e._)`${h} === undefined`;p.useDefaults==="empty"&&(g=(0,e._)`${g} || ${h} === null || ${h} === ""`),c.if(g,(0,e._)`${h} = ${(0,e.stringify)(l)}`)}return yd}var Xo={},Ht={},FI;function li(){if(FI)return Ht;FI=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.validateUnion=Ht.validateArray=Ht.usePattern=Ht.callValidateCode=Ht.schemaProperties=Ht.allSchemaProperties=Ht.noPropertyInData=Ht.propertyInData=Ht.isOwnProperty=Ht.hasPropFunc=Ht.reportMissingProp=Ht.checkMissingProp=Ht.checkReportMissingProp=void 0;const e=yt(),t=kt(),n=wa(),r=kt();function o(E,T){const{gen:R,data:O,it:A}=E;R.if(p(R,O,T,A.opts.ownProperties),()=>{E.setParams({missingProperty:(0,e._)`${T}`},!0),E.error()})}Ht.checkReportMissingProp=o;function s({gen:E,data:T,it:{opts:R}},O,A){return(0,e.or)(...O.map(I=>(0,e.and)(p(E,T,I,R.ownProperties),(0,e._)`${A} = ${I}`)))}Ht.checkMissingProp=s;function l(E,T){E.setParams({missingProperty:T},!0),E.error()}Ht.reportMissingProp=l;function c(E){return E.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Ht.hasPropFunc=c;function d(E,T,R){return(0,e._)`${c(E)}.call(${T}, ${R})`}Ht.isOwnProperty=d;function f(E,T,R,O){const A=(0,e._)`${T}${(0,e.getProperty)(R)} !== undefined`;return O?(0,e._)`${A} && ${d(E,T,R)}`:A}Ht.propertyInData=f;function p(E,T,R,O){const A=(0,e._)`${T}${(0,e.getProperty)(R)} === undefined`;return O?(0,e.or)(A,(0,e.not)(d(E,T,R))):A}Ht.noPropertyInData=p;function h(E){return E?Object.keys(E).filter(T=>T!=="__proto__"):[]}Ht.allSchemaProperties=h;function g(E,T){return h(T).filter(R=>!(0,t.alwaysValidSchema)(E,T[R]))}Ht.schemaProperties=g;function v({schemaCode:E,data:T,it:{gen:R,topSchemaRef:O,schemaPath:A,errorPath:I},it:M},L,q,j){const B=j?(0,e._)`${E}, ${T}, ${O}${A}`:T,F=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,I)],[n.default.parentData,M.parentData],[n.default.parentDataProperty,M.parentDataProperty],[n.default.rootData,n.default.rootData]];M.opts.dynamicRef&&F.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const Z=(0,e._)`${B}, ${R.object(...F)}`;return q!==e.nil?(0,e._)`${L}.call(${q}, ${Z})`:(0,e._)`${L}(${Z})`}Ht.callValidateCode=v;const _=(0,e._)`new RegExp`;function b({gen:E,it:{opts:T}},R){const O=T.unicodeRegExp?"u":"",{regExp:A}=T.code,I=A(R,O);return E.scopeValue("pattern",{key:I.toString(),ref:I,code:(0,e._)`${A.code==="new RegExp"?_:(0,r.useFunc)(E,A)}(${R}, ${O})`})}Ht.usePattern=b;function x(E){const{gen:T,data:R,keyword:O,it:A}=E,I=T.name("valid");if(A.allErrors){const L=T.let("valid",!0);return M(()=>T.assign(L,!1)),L}return T.var(I,!0),M(()=>T.break()),I;function M(L){const q=T.const("len",(0,e._)`${R}.length`);T.forRange("i",0,q,j=>{E.subschema({keyword:O,dataProp:j,dataPropType:t.Type.Num},I),T.if((0,e.not)(I),L)})}}Ht.validateArray=x;function S(E){const{gen:T,schema:R,keyword:O,it:A}=E;if(!Array.isArray(R))throw new Error("ajv implementation error");if(R.some(q=>(0,t.alwaysValidSchema)(A,q))&&!A.opts.unevaluated)return;const M=T.let("valid",!1),L=T.name("_valid");T.block(()=>R.forEach((q,j)=>{const B=E.subschema({keyword:O,schemaProp:j,compositeRule:!0},L);T.assign(M,(0,e._)`${M} || ${L}`),E.mergeValidEvaluated(B,L)||T.if((0,e.not)(M))})),E.result(M,()=>E.reset(),()=>E.error(!0))}return Ht.validateUnion=S,Ht}var BI;function Jie(){if(BI)return Xo;BI=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.validateKeywordUsage=Xo.validSchemaType=Xo.funcKeywordCode=Xo.macroKeywordCode=void 0;const e=yt(),t=wa(),n=li(),r=hv();function o(g,v){const{gen:_,keyword:b,schema:x,parentSchema:S,it:E}=g,T=v.macro.call(E.self,x,S,E),R=f(_,b,T);E.opts.validateSchema!==!1&&E.self.validateSchema(T,!0);const O=_.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${E.errSchemaPath}/${b}`,topSchemaRef:R,compositeRule:!0},O),g.pass(O,()=>g.error(!0))}Xo.macroKeywordCode=o;function s(g,v){var _;const{gen:b,keyword:x,schema:S,parentSchema:E,$data:T,it:R}=g;d(R,v);const O=!T&&v.compile?v.compile.call(R.self,S,E,R):v.validate,A=f(b,x,O),I=b.let("valid");g.block$data(I,M),g.ok((_=v.valid)!==null&&_!==void 0?_:I);function M(){if(v.errors===!1)j(),v.modifying&&l(g),B(()=>g.error());else{const F=v.async?L():q();v.modifying&&l(g),B(()=>c(g,F))}}function L(){const F=b.let("ruleErrs",null);return b.try(()=>j((0,e._)`await `),Z=>b.assign(I,!1).if((0,e._)`${Z} instanceof ${R.ValidationError}`,()=>b.assign(F,(0,e._)`${Z}.errors`),()=>b.throw(Z))),F}function q(){const F=(0,e._)`${A}.errors`;return b.assign(F,null),j(e.nil),F}function j(F=v.async?(0,e._)`await `:e.nil){const Z=R.opts.passContext?t.default.this:t.default.self,ie=!("compile"in v&&!T||v.schema===!1);b.assign(I,(0,e._)`${F}${(0,n.callValidateCode)(g,A,Z,ie)}`,v.modifying)}function B(F){var Z;b.if((0,e.not)((Z=v.valid)!==null&&Z!==void 0?Z:I),F)}}Xo.funcKeywordCode=s;function l(g){const{gen:v,data:_,it:b}=g;v.if(b.parentData,()=>v.assign(_,(0,e._)`${b.parentData}[${b.parentDataProperty}]`))}function c(g,v){const{gen:_}=g;_.if((0,e._)`Array.isArray(${v})`,()=>{_.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${v} : ${t.default.vErrors}.concat(${v})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(g)},()=>g.error())}function d({schemaEnv:g},v){if(v.async&&!g.$async)throw new Error("async keyword in sync schema")}function f(g,v,_){if(_===void 0)throw new Error(`keyword "${v}" failed to compile`);return g.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,e.stringify)(_)})}function p(g,v,_=!1){return!v.length||v.some(b=>b==="array"?Array.isArray(g):b==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==b||_&&typeof g>"u")}Xo.validSchemaType=p;function h({schema:g,opts:v,self:_,errSchemaPath:b},x,S){if(Array.isArray(x.keyword)?!x.keyword.includes(S):x.keyword!==S)throw new Error("ajv implementation error");const E=x.dependencies;if(E?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw new Error(`parent schema must have dependencies of ${S}: ${E.join(",")}`);if(x.validateSchema&&!x.validateSchema(g[S])){const R=`keyword "${S}" value is invalid at path "${b}": `+_.errorsText(x.validateSchema.errors);if(v.validateSchema==="log")_.logger.error(R);else throw new Error(R)}}return Xo.validateKeywordUsage=h,Xo}var rs={},VI;function ese(){if(VI)return rs;VI=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.extendSubschemaMode=rs.extendSubschemaData=rs.getSubschema=void 0;const e=yt(),t=kt();function n(s,{keyword:l,schemaProp:c,schema:d,schemaPath:f,errSchemaPath:p,topSchemaRef:h}){if(l!==void 0&&d!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){const g=s.schema[l];return c===void 0?{schema:g,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${s.errSchemaPath}/${l}`}:{schema:g[c],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(c)}`,errSchemaPath:`${s.errSchemaPath}/${l}/${(0,t.escapeFragment)(c)}`}}if(d!==void 0){if(f===void 0||p===void 0||h===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:h,errSchemaPath:p}}throw new Error('either "keyword" or "schema" must be passed')}rs.getSubschema=n;function r(s,l,{dataProp:c,dataPropType:d,data:f,dataTypes:p,propertyName:h}){if(f!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:g}=l;if(c!==void 0){const{errorPath:_,dataPathArr:b,opts:x}=l,S=g.let("data",(0,e._)`${l.data}${(0,e.getProperty)(c)}`,!0);v(S),s.errorPath=(0,e.str)`${_}${(0,t.getErrorPath)(c,d,x.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${c}`,s.dataPathArr=[...b,s.parentDataProperty]}if(f!==void 0){const _=f instanceof e.Name?f:g.let("data",f,!0);v(_),h!==void 0&&(s.propertyName=h)}p&&(s.dataTypes=p);function v(_){s.data=_,s.dataLevel=l.dataLevel+1,s.dataTypes=[],l.definedProperties=new Set,s.parentData=l.data,s.dataNames=[...l.dataNames,_]}}rs.extendSubschemaData=r;function o(s,{jtdDiscriminator:l,jtdMetadata:c,compositeRule:d,createErrors:f,allErrors:p}){d!==void 0&&(s.compositeRule=d),f!==void 0&&(s.createErrors=f),p!==void 0&&(s.allErrors=p),s.jtdDiscriminator=l,s.jtdMetadata=c}return rs.extendSubschemaMode=o,rs}var kr={},bb,qI;function B6(){return qI||(qI=1,bb=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var l=s[o];if(!e(t[l],n[l]))return!1}return!0}return t!==t&&n!==n}),bb}var wb={exports:{}},HI;function tse(){if(HI)return wb.exports;HI=1;var e=wb.exports=function(r,o,s){typeof o=="function"&&(s=o,o={}),s=o.cb||s;var l=typeof s=="function"?s:s.pre||function(){},c=s.post||function(){};t(o,l,c,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,o,s,l,c,d,f,p,h,g){if(l&&typeof l=="object"&&!Array.isArray(l)){o(l,c,d,f,p,h,g);for(var v in l){var _=l[v];if(Array.isArray(_)){if(v in e.arrayKeywords)for(var b=0;b<_.length;b++)t(r,o,s,_[b],c+"/"+v+"/"+b,d,c,v,l,b)}else if(v in e.propsKeywords){if(_&&typeof _=="object")for(var x in _)t(r,o,s,_[x],c+"/"+v+"/"+n(x),d,c,v,l,x)}else(v in e.keywords||r.allKeys&&!(v in e.skipKeywords))&&t(r,o,s,_,c+"/"+v,d,c,v,l)}s(l,c,d,f,p,h,g)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return wb.exports}var GI;function pv(){if(GI)return kr;GI=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.getSchemaRefs=kr.resolveUrl=kr.normalizeId=kr._getFullPath=kr.getFullPath=kr.inlineRef=void 0;const e=kt(),t=B6(),n=tse(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function o(b,x=!0){return typeof b=="boolean"?!0:x===!0?!l(b):x?c(b)<=x:!1}kr.inlineRef=o;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(b){for(const x in b){if(s.has(x))return!0;const S=b[x];if(Array.isArray(S)&&S.some(l)||typeof S=="object"&&l(S))return!0}return!1}function c(b){let x=0;for(const S in b){if(S==="$ref")return 1/0;if(x++,!r.has(S)&&(typeof b[S]=="object"&&(0,e.eachItem)(b[S],E=>x+=c(E)),x===1/0))return 1/0}return x}function d(b,x="",S){S!==!1&&(x=h(x));const E=b.parse(x);return f(b,E)}kr.getFullPath=d;function f(b,x){return b.serialize(x).split("#")[0]+"#"}kr._getFullPath=f;const p=/#\/?$/;function h(b){return b?b.replace(p,""):""}kr.normalizeId=h;function g(b,x,S){return S=h(S),b.resolve(x,S)}kr.resolveUrl=g;const v=/^[a-z_][-a-z0-9._]*$/i;function _(b,x){if(typeof b=="boolean")return{};const{schemaId:S,uriResolver:E}=this.opts,T=h(b[S]||x),R={"":T},O=d(E,T,!1),A={},I=new Set;return n(b,{allKeys:!0},(q,j,B,F)=>{if(F===void 0)return;const Z=O+j;let ie=R[F];typeof q[S]=="string"&&(ie=H.call(this,q[S])),W.call(this,q.$anchor),W.call(this,q.$dynamicAnchor),R[j]=ie;function H(te){const le=this.opts.uriResolver.resolve;if(te=h(ie?le(ie,te):te),I.has(te))throw L(te);I.add(te);let Q=this.refs[te];return typeof Q=="string"&&(Q=this.refs[Q]),typeof Q=="object"?M(q,Q.schema,te):te!==h(Z)&&(te[0]==="#"?(M(q,A[te],te),A[te]=q):this.refs[te]=Z),te}function W(te){if(typeof te=="string"){if(!v.test(te))throw new Error(`invalid anchor "${te}"`);H.call(this,`#${te}`)}}}),A;function M(q,j,B){if(j!==void 0&&!t(q,j))throw L(B)}function L(q){return new Error(`reference "${q}" resolves to more than one schema`)}}return kr.getSchemaRefs=_,kr}var KI;function mv(){if(KI)return ts;KI=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.getData=ts.KeywordCxt=ts.validateFunctionCode=void 0;const e=Qie(),t=Og(),n=F6(),r=Og(),o=Xie(),s=Jie(),l=ese(),c=yt(),d=wa(),f=pv(),p=kt(),h=hv();function g(Y){if(O(Y)&&(I(Y),R(Y))){x(Y);return}v(Y,()=>(0,e.topBoolOrEmptySchema)(Y))}ts.validateFunctionCode=g;function v({gen:Y,validateName:re,schema:ve,schemaEnv:se,opts:Se},Te){Se.code.es5?Y.func(re,(0,c._)`${d.default.data}, ${d.default.valCxt}`,se.$async,()=>{Y.code((0,c._)`"use strict"; ${E(ve,Se)}`),b(Y,Se),Y.code(Te)}):Y.func(re,(0,c._)`${d.default.data}, ${_(Se)}`,se.$async,()=>Y.code(E(ve,Se)).code(Te))}function _(Y){return(0,c._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${Y.dynamicRef?(0,c._)`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`}function b(Y,re){Y.if(d.default.valCxt,()=>{Y.var(d.default.instancePath,(0,c._)`${d.default.valCxt}.${d.default.instancePath}`),Y.var(d.default.parentData,(0,c._)`${d.default.valCxt}.${d.default.parentData}`),Y.var(d.default.parentDataProperty,(0,c._)`${d.default.valCxt}.${d.default.parentDataProperty}`),Y.var(d.default.rootData,(0,c._)`${d.default.valCxt}.${d.default.rootData}`),re.dynamicRef&&Y.var(d.default.dynamicAnchors,(0,c._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{Y.var(d.default.instancePath,(0,c._)`""`),Y.var(d.default.parentData,(0,c._)`undefined`),Y.var(d.default.parentDataProperty,(0,c._)`undefined`),Y.var(d.default.rootData,d.default.data),re.dynamicRef&&Y.var(d.default.dynamicAnchors,(0,c._)`{}`)})}function x(Y){const{schema:re,opts:ve,gen:se}=Y;v(Y,()=>{ve.$comment&&re.$comment&&F(Y),q(Y),se.let(d.default.vErrors,null),se.let(d.default.errors,0),ve.unevaluated&&S(Y),M(Y),Z(Y)})}function S(Y){const{gen:re,validateName:ve}=Y;Y.evaluated=re.const("evaluated",(0,c._)`${ve}.evaluated`),re.if((0,c._)`${Y.evaluated}.dynamicProps`,()=>re.assign((0,c._)`${Y.evaluated}.props`,(0,c._)`undefined`)),re.if((0,c._)`${Y.evaluated}.dynamicItems`,()=>re.assign((0,c._)`${Y.evaluated}.items`,(0,c._)`undefined`))}function E(Y,re){const ve=typeof Y=="object"&&Y[re.schemaId];return ve&&(re.code.source||re.code.process)?(0,c._)`/*# sourceURL=${ve} */`:c.nil}function T(Y,re){if(O(Y)&&(I(Y),R(Y))){A(Y,re);return}(0,e.boolOrEmptySchema)(Y,re)}function R({schema:Y,self:re}){if(typeof Y=="boolean")return!Y;for(const ve in Y)if(re.RULES.all[ve])return!0;return!1}function O(Y){return typeof Y.schema!="boolean"}function A(Y,re){const{schema:ve,gen:se,opts:Se}=Y;Se.$comment&&ve.$comment&&F(Y),j(Y),B(Y);const Te=se.const("_errs",d.default.errors);M(Y,Te),se.var(re,(0,c._)`${Te} === ${d.default.errors}`)}function I(Y){(0,p.checkUnknownRules)(Y),L(Y)}function M(Y,re){if(Y.opts.jtd)return H(Y,[],!1,re);const ve=(0,t.getSchemaTypes)(Y.schema),se=(0,t.coerceAndCheckDataType)(Y,ve);H(Y,ve,!se,re)}function L(Y){const{schema:re,errSchemaPath:ve,opts:se,self:Se}=Y;re.$ref&&se.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(re,Se.RULES)&&Se.logger.warn(`$ref: keywords ignored in schema at path "${ve}"`)}function q(Y){const{schema:re,opts:ve}=Y;re.default!==void 0&&ve.useDefaults&&ve.strictSchema&&(0,p.checkStrictMode)(Y,"default is ignored in the schema root")}function j(Y){const re=Y.schema[Y.opts.schemaId];re&&(Y.baseId=(0,f.resolveUrl)(Y.opts.uriResolver,Y.baseId,re))}function B(Y){if(Y.schema.$async&&!Y.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:Y,schemaEnv:re,schema:ve,errSchemaPath:se,opts:Se}){const Te=ve.$comment;if(Se.$comment===!0)Y.code((0,c._)`${d.default.self}.logger.log(${Te})`);else if(typeof Se.$comment=="function"){const tt=(0,c.str)`${se}/$comment`,rt=Y.scopeValue("root",{ref:re.root});Y.code((0,c._)`${d.default.self}.opts.$comment(${Te}, ${tt}, ${rt}.schema)`)}}function Z(Y){const{gen:re,schemaEnv:ve,validateName:se,ValidationError:Se,opts:Te}=Y;ve.$async?re.if((0,c._)`${d.default.errors} === 0`,()=>re.return(d.default.data),()=>re.throw((0,c._)`new ${Se}(${d.default.vErrors})`)):(re.assign((0,c._)`${se}.errors`,d.default.vErrors),Te.unevaluated&&ie(Y),re.return((0,c._)`${d.default.errors} === 0`))}function ie({gen:Y,evaluated:re,props:ve,items:se}){ve instanceof c.Name&&Y.assign((0,c._)`${re}.props`,ve),se instanceof c.Name&&Y.assign((0,c._)`${re}.items`,se)}function H(Y,re,ve,se){const{gen:Se,schema:Te,data:tt,allErrors:rt,opts:Be,self:Qe}=Y,{RULES:Me}=Qe;if(Te.$ref&&(Be.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(Te,Me))){Se.block(()=>fe(Y,"$ref",Me.all.$ref.definition));return}Be.jtd||te(Y,re),Se.block(()=>{for(const Ue of Me.rules)Pe(Ue);Pe(Me.post)});function Pe(Ue){(0,n.shouldUseGroup)(Te,Ue)&&(Ue.type?(Se.if((0,r.checkDataType)(Ue.type,tt,Be.strictNumbers)),W(Y,Ue),re.length===1&&re[0]===Ue.type&&ve&&(Se.else(),(0,r.reportTypeError)(Y)),Se.endIf()):W(Y,Ue),rt||Se.if((0,c._)`${d.default.errors} === ${se||0}`))}}function W(Y,re){const{gen:ve,schema:se,opts:{useDefaults:Se}}=Y;Se&&(0,o.assignDefaults)(Y,re.type),ve.block(()=>{for(const Te of re.rules)(0,n.shouldUseRule)(se,Te)&&fe(Y,Te.keyword,Te.definition,re.type)})}function te(Y,re){Y.schemaEnv.meta||!Y.opts.strictTypes||(le(Y,re),Y.opts.allowUnionTypes||Q(Y,re),k(Y,Y.dataTypes))}function le(Y,re){if(re.length){if(!Y.dataTypes.length){Y.dataTypes=re;return}re.forEach(ve=>{V(Y.dataTypes,ve)||U(Y,`type "${ve}" not allowed by context "${Y.dataTypes.join(",")}"`)}),D(Y,re)}}function Q(Y,re){re.length>1&&!(re.length===2&&re.includes("null"))&&U(Y,"use allowUnionTypes to allow union type keyword")}function k(Y,re){const ve=Y.self.RULES.all;for(const se in ve){const Se=ve[se];if(typeof Se=="object"&&(0,n.shouldUseRule)(Y.schema,Se)){const{type:Te}=Se.definition;Te.length&&!Te.some(tt=>G(re,tt))&&U(Y,`missing type "${Te.join(",")}" for keyword "${se}"`)}}}function G(Y,re){return Y.includes(re)||re==="number"&&Y.includes("integer")}function V(Y,re){return Y.includes(re)||re==="integer"&&Y.includes("number")}function D(Y,re){const ve=[];for(const se of Y.dataTypes)V(re,se)?ve.push(se):re.includes("integer")&&se==="number"&&ve.push("integer");Y.dataTypes=ve}function U(Y,re){const ve=Y.schemaEnv.baseId+Y.errSchemaPath;re+=` at "${ve}" (strictTypes)`,(0,p.checkStrictMode)(Y,re,Y.opts.strictTypes)}class X{constructor(re,ve,se){if((0,s.validateKeywordUsage)(re,ve,se),this.gen=re.gen,this.allErrors=re.allErrors,this.keyword=se,this.data=re.data,this.schema=re.schema[se],this.$data=ve.$data&&re.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(re,this.schema,se,this.$data),this.schemaType=ve.schemaType,this.parentSchema=re.schema,this.params={},this.it=re,this.def=ve,this.$data)this.schemaCode=re.gen.const("vSchema",je(this.$data,re));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,ve.schemaType,ve.allowUndefined))throw new Error(`${se} value must be ${JSON.stringify(ve.schemaType)}`);("code"in ve?ve.trackErrors:ve.errors!==!1)&&(this.errsCount=re.gen.const("_errs",d.default.errors))}result(re,ve,se){this.failResult((0,c.not)(re),ve,se)}failResult(re,ve,se){this.gen.if(re),se?se():this.error(),ve?(this.gen.else(),ve(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(re,ve){this.failResult((0,c.not)(re),void 0,ve)}fail(re){if(re===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(re),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(re){if(!this.$data)return this.fail(re);const{schemaCode:ve}=this;this.fail((0,c._)`${ve} !== undefined && (${(0,c.or)(this.invalid$data(),re)})`)}error(re,ve,se){if(ve){this.setParams(ve),this._error(re,se),this.setParams({});return}this._error(re,se)}_error(re,ve){(re?h.reportExtraError:h.reportError)(this,this.def.error,ve)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(re){this.allErrors||this.gen.if(re)}setParams(re,ve){ve?Object.assign(this.params,re):this.params=re}block$data(re,ve,se=c.nil){this.gen.block(()=>{this.check$data(re,se),ve()})}check$data(re=c.nil,ve=c.nil){if(!this.$data)return;const{gen:se,schemaCode:Se,schemaType:Te,def:tt}=this;se.if((0,c.or)((0,c._)`${Se} === undefined`,ve)),re!==c.nil&&se.assign(re,!0),(Te.length||tt.validateSchema)&&(se.elseIf(this.invalid$data()),this.$dataError(),re!==c.nil&&se.assign(re,!1)),se.else()}invalid$data(){const{gen:re,schemaCode:ve,schemaType:se,def:Se,it:Te}=this;return(0,c.or)(tt(),rt());function tt(){if(se.length){if(!(ve instanceof c.Name))throw new Error("ajv implementation error");const Be=Array.isArray(se)?se:[se];return(0,c._)`${(0,r.checkDataTypes)(Be,ve,Te.opts.strictNumbers,r.DataType.Wrong)}`}return c.nil}function rt(){if(Se.validateSchema){const Be=re.scopeValue("validate$data",{ref:Se.validateSchema});return(0,c._)`!${Be}(${ve})`}return c.nil}}subschema(re,ve){const se=(0,l.getSubschema)(this.it,re);(0,l.extendSubschemaData)(se,this.it,re),(0,l.extendSubschemaMode)(se,re);const Se={...this.it,...se,items:void 0,props:void 0};return T(Se,ve),Se}mergeEvaluated(re,ve){const{it:se,gen:Se}=this;se.opts.unevaluated&&(se.props!==!0&&re.props!==void 0&&(se.props=p.mergeEvaluated.props(Se,re.props,se.props,ve)),se.items!==!0&&re.items!==void 0&&(se.items=p.mergeEvaluated.items(Se,re.items,se.items,ve)))}mergeValidEvaluated(re,ve){const{it:se,gen:Se}=this;if(se.opts.unevaluated&&(se.props!==!0||se.items!==!0))return Se.if(ve,()=>this.mergeEvaluated(re,c.Name)),!0}}ts.KeywordCxt=X;function fe(Y,re,ve,se){const Se=new X(Y,ve,re);"code"in ve?ve.code(Se,se):Se.$data&&ve.validate?(0,s.funcKeywordCode)(Se,ve):"macro"in ve?(0,s.macroKeywordCode)(Se,ve):(ve.compile||ve.validate)&&(0,s.funcKeywordCode)(Se,ve)}const pe=/^\/(?:[^~]|~0|~1)*$/,xe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function je(Y,{dataLevel:re,dataNames:ve,dataPathArr:se}){let Se,Te;if(Y==="")return d.default.rootData;if(Y[0]==="/"){if(!pe.test(Y))throw new Error(`Invalid JSON-pointer: ${Y}`);Se=Y,Te=d.default.rootData}else{const Qe=xe.exec(Y);if(!Qe)throw new Error(`Invalid JSON-pointer: ${Y}`);const Me=+Qe[1];if(Se=Qe[2],Se==="#"){if(Me>=re)throw new Error(Be("property/index",Me));return se[re-Me]}if(Me>re)throw new Error(Be("data",Me));if(Te=ve[re-Me],!Se)return Te}let tt=Te;const rt=Se.split("/");for(const Qe of rt)Qe&&(Te=(0,c._)`${Te}${(0,c.getProperty)((0,p.unescapeJsonPointer)(Qe))}`,tt=(0,c._)`${tt} && ${Te}`);return tt;function Be(Qe,Me){return`Cannot access ${Qe} ${Me} levels up, current level is ${re}`}}return ts.getData=je,ts}var Ip={},ZI;function dE(){if(ZI)return Ip;ZI=1,Object.defineProperty(Ip,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Ip.default=e,Ip}var Pp={},YI;function gv(){if(YI)return Pp;YI=1,Object.defineProperty(Pp,"__esModule",{value:!0});const e=pv();class t extends Error{constructor(r,o,s,l){super(l||`can't resolve reference ${s} from id ${o}`),this.missingRef=(0,e.resolveUrl)(r,o,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return Pp.default=t,Pp}var lo={},WI;function fE(){if(WI)return lo;WI=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.resolveSchema=lo.getCompilingSchema=lo.resolveRef=lo.compileSchema=lo.SchemaEnv=void 0;const e=yt(),t=dE(),n=wa(),r=pv(),o=kt(),s=mv();class l{constructor(S){var E;this.refs={},this.dynamicAnchors={};let T;typeof S.schema=="object"&&(T=S.schema),this.schema=S.schema,this.schemaId=S.schemaId,this.root=S.root||this,this.baseId=(E=S.baseId)!==null&&E!==void 0?E:(0,r.normalizeId)(T?.[S.schemaId||"$id"]),this.schemaPath=S.schemaPath,this.localRefs=S.localRefs,this.meta=S.meta,this.$async=T?.$async,this.refs={}}}lo.SchemaEnv=l;function c(x){const S=p.call(this,x);if(S)return S;const E=(0,r.getFullPath)(this.opts.uriResolver,x.root.baseId),{es5:T,lines:R}=this.opts.code,{ownProperties:O}=this.opts,A=new e.CodeGen(this.scope,{es5:T,lines:R,ownProperties:O});let I;x.$async&&(I=A.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const M=A.scopeName("validate");x.validateName=M;const L={gen:A,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:x.schema,code:(0,e.stringify)(x.schema)}:{ref:x.schema}),validateName:M,ValidationError:I,schema:x.schema,schemaEnv:x,rootId:E,baseId:x.baseId||E,schemaPath:e.nil,errSchemaPath:x.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let q;try{this._compilations.add(x),(0,s.validateFunctionCode)(L),A.optimize(this.opts.code.optimize);const j=A.toString();q=`${A.scopeRefs(n.default.scope)}return ${j}`,this.opts.code.process&&(q=this.opts.code.process(q,x));const F=new Function(`${n.default.self}`,`${n.default.scope}`,q)(this,this.scope.get());if(this.scope.value(M,{ref:F}),F.errors=null,F.schema=x.schema,F.schemaEnv=x,x.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:M,validateCode:j,scopeValues:A._values}),this.opts.unevaluated){const{props:Z,items:ie}=L;F.evaluated={props:Z instanceof e.Name?void 0:Z,items:ie instanceof e.Name?void 0:ie,dynamicProps:Z instanceof e.Name,dynamicItems:ie instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return x.validate=F,x}catch(j){throw delete x.validate,delete x.validateName,q&&this.logger.error("Error compiling schema, function code:",q),j}finally{this._compilations.delete(x)}}lo.compileSchema=c;function d(x,S,E){var T;E=(0,r.resolveUrl)(this.opts.uriResolver,S,E);const R=x.refs[E];if(R)return R;let O=g.call(this,x,E);if(O===void 0){const A=(T=x.localRefs)===null||T===void 0?void 0:T[E],{schemaId:I}=this.opts;A&&(O=new l({schema:A,schemaId:I,root:x,baseId:S}))}if(O!==void 0)return x.refs[E]=f.call(this,O)}lo.resolveRef=d;function f(x){return(0,r.inlineRef)(x.schema,this.opts.inlineRefs)?x.schema:x.validate?x:c.call(this,x)}function p(x){for(const S of this._compilations)if(h(S,x))return S}lo.getCompilingSchema=p;function h(x,S){return x.schema===S.schema&&x.root===S.root&&x.baseId===S.baseId}function g(x,S){let E;for(;typeof(E=this.refs[S])=="string";)S=E;return E||this.schemas[S]||v.call(this,x,S)}function v(x,S){const E=this.opts.uriResolver.parse(S),T=(0,r._getFullPath)(this.opts.uriResolver,E);let R=(0,r.getFullPath)(this.opts.uriResolver,x.baseId,void 0);if(Object.keys(x.schema).length>0&&T===R)return b.call(this,E,x);const O=(0,r.normalizeId)(T),A=this.refs[O]||this.schemas[O];if(typeof A=="string"){const I=v.call(this,x,A);return typeof I?.schema!="object"?void 0:b.call(this,E,I)}if(typeof A?.schema=="object"){if(A.validate||c.call(this,A),O===(0,r.normalizeId)(S)){const{schema:I}=A,{schemaId:M}=this.opts,L=I[M];return L&&(R=(0,r.resolveUrl)(this.opts.uriResolver,R,L)),new l({schema:I,schemaId:M,root:x,baseId:R})}return b.call(this,E,A)}}lo.resolveSchema=v;const _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function b(x,{baseId:S,schema:E,root:T}){var R;if(((R=x.fragment)===null||R===void 0?void 0:R[0])!=="/")return;for(const I of x.fragment.slice(1).split("/")){if(typeof E=="boolean")return;const M=E[(0,o.unescapeFragment)(I)];if(M===void 0)return;E=M;const L=typeof E=="object"&&E[this.opts.schemaId];!_.has(I)&&L&&(S=(0,r.resolveUrl)(this.opts.uriResolver,S,L))}let O;if(typeof E!="boolean"&&E.$ref&&!(0,o.schemaHasRulesButRef)(E,this.RULES)){const I=(0,r.resolveUrl)(this.opts.uriResolver,S,E.$ref);O=v.call(this,T,I)}const{schemaId:A}=this.opts;if(O=O||new l({schema:E,schemaId:A,root:T,baseId:S}),O.schema!==O.root.schema)return O}return lo}const nse="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",rse="Meta-schema for $data reference (JSON AnySchema extension proposal)",ose="object",ise=["$data"],sse={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ase=!1,lse={$id:nse,description:rse,type:ose,required:ise,properties:sse,additionalProperties:ase};var Mp={},_d={exports:{}},Sb,QI;function V6(){if(QI)return Sb;QI=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(g){let v="",_=0,b=0;for(b=0;b<g.length;b++)if(_=g[b].charCodeAt(0),_!==48){if(!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";v+=g[b];break}for(b+=1;b<g.length;b++){if(_=g[b].charCodeAt(0),!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";v+=g[b]}return v}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(g){return g.length=0,!0}function s(g,v,_){if(g.length){const b=n(g);if(b!=="")v.push(b);else return _.error=!0,!1;g.length=0}return!0}function l(g){let v=0;const _={error:!1,address:"",zone:""},b=[],x=[];let S=!1,E=!1,T=s;for(let R=0;R<g.length;R++){const O=g[R];if(!(O==="["||O==="]"))if(O===":"){if(S===!0&&(E=!0),!T(x,b,_))break;if(++v>7){_.error=!0;break}R>0&&g[R-1]===":"&&(S=!0),b.push(":");continue}else if(O==="%"){if(!T(x,b,_))break;T=o}else{x.push(O);continue}}return x.length&&(T===o?_.zone=x.join(""):E?b.push(x.join("")):b.push(n(x))),_.address=b.join(""),_}function c(g){if(d(g,":")<2)return{host:g,isIPV6:!1};const v=l(g);if(v.error)return{host:g,isIPV6:!1};{let _=v.address,b=v.address;return v.zone&&(_+="%"+v.zone,b+="%25"+v.zone),{host:_,isIPV6:!0,escapedHost:b}}}function d(g,v){let _=0;for(let b=0;b<g.length;b++)g[b]===v&&_++;return _}function f(g){let v=g;const _=[];let b=-1,x=0;for(;x=v.length;){if(x===1){if(v===".")break;if(v==="/"){_.push("/");break}else{_.push(v);break}}else if(x===2){if(v[0]==="."){if(v[1]===".")break;if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&(v[1]==="."||v[1]==="/")){_.push("/");break}}else if(x===3&&v==="/.."){_.length!==0&&_.pop(),_.push("/");break}if(v[0]==="."){if(v[1]==="."){if(v[2]==="/"){v=v.slice(3);continue}}else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&v[1]==="."){if(v[2]==="/"){v=v.slice(2);continue}else if(v[2]==="."&&v[3]==="/"){v=v.slice(3),_.length!==0&&_.pop();continue}}if((b=v.indexOf("/",1))===-1){_.push(v);break}else _.push(v.slice(0,b)),v=v.slice(b)}return _.join("")}function p(g,v){const _=v!==!0?escape:unescape;return g.scheme!==void 0&&(g.scheme=_(g.scheme)),g.userinfo!==void 0&&(g.userinfo=_(g.userinfo)),g.host!==void 0&&(g.host=_(g.host)),g.path!==void 0&&(g.path=_(g.path)),g.query!==void 0&&(g.query=_(g.query)),g.fragment!==void 0&&(g.fragment=_(g.fragment)),g}function h(g){const v=[];if(g.userinfo!==void 0&&(v.push(g.userinfo),v.push("@")),g.host!==void 0){let _=unescape(g.host);if(!t(_)){const b=c(_);b.isIPV6===!0?_=`[${b.escapedHost}]`:_=g.host}v.push(_)}return(typeof g.port=="number"||typeof g.port=="string")&&(v.push(":"),v.push(String(g.port))),v.length?v.join(""):void 0}return Sb={nonSimpleDomain:r,recomposeAuthority:h,normalizeComponentEncoding:p,removeDotSegments:f,isIPv4:t,isUUID:e,normalizeIPv6:c,stringArrayToHexStripped:n},Sb}var Eb,XI;function cse(){if(XI)return Eb;XI=1;const{isUUID:e}=V6(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(O){return n.indexOf(O)!==-1}function o(O){return O.secure===!0?!0:O.secure===!1?!1:O.scheme?O.scheme.length===3&&(O.scheme[0]==="w"||O.scheme[0]==="W")&&(O.scheme[1]==="s"||O.scheme[1]==="S")&&(O.scheme[2]==="s"||O.scheme[2]==="S"):!1}function s(O){return O.host||(O.error=O.error||"HTTP URIs must have a host."),O}function l(O){const A=String(O.scheme).toLowerCase()==="https";return(O.port===(A?443:80)||O.port==="")&&(O.port=void 0),O.path||(O.path="/"),O}function c(O){return O.secure=o(O),O.resourceName=(O.path||"/")+(O.query?"?"+O.query:""),O.path=void 0,O.query=void 0,O}function d(O){if((O.port===(o(O)?443:80)||O.port==="")&&(O.port=void 0),typeof O.secure=="boolean"&&(O.scheme=O.secure?"wss":"ws",O.secure=void 0),O.resourceName){const[A,I]=O.resourceName.split("?");O.path=A&&A!=="/"?A:void 0,O.query=I,O.resourceName=void 0}return O.fragment=void 0,O}function f(O,A){if(!O.path)return O.error="URN can not be parsed",O;const I=O.path.match(t);if(I){const M=A.scheme||O.scheme||"urn";O.nid=I[1].toLowerCase(),O.nss=I[2];const L=`${M}:${A.nid||O.nid}`,q=R(L);O.path=void 0,q&&(O=q.parse(O,A))}else O.error=O.error||"URN can not be parsed.";return O}function p(O,A){if(O.nid===void 0)throw new Error("URN without nid cannot be serialized");const I=A.scheme||O.scheme||"urn",M=O.nid.toLowerCase(),L=`${I}:${A.nid||M}`,q=R(L);q&&(O=q.serialize(O,A));const j=O,B=O.nss;return j.path=`${M||A.nid}:${B}`,A.skipEscape=!0,j}function h(O,A){const I=O;return I.uuid=I.nss,I.nss=void 0,!A.tolerant&&(!I.uuid||!e(I.uuid))&&(I.error=I.error||"UUID is not valid."),I}function g(O){const A=O;return A.nss=(O.uuid||"").toLowerCase(),A}const v={scheme:"http",domainHost:!0,parse:s,serialize:l},_={scheme:"https",domainHost:v.domainHost,parse:s,serialize:l},b={scheme:"ws",domainHost:!0,parse:c,serialize:d},x={scheme:"wss",domainHost:b.domainHost,parse:b.parse,serialize:b.serialize},T={http:v,https:_,ws:b,wss:x,urn:{scheme:"urn",parse:f,serialize:p,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:g,skipNormalize:!0}};Object.setPrototypeOf(T,null);function R(O){return O&&(T[O]||T[O.toLowerCase()])||void 0}return Eb={wsIsSecure:o,SCHEMES:T,isValidSchemeName:r,getSchemeHandler:R},Eb}var JI;function use(){if(JI)return _d.exports;JI=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:o,nonSimpleDomain:s}=V6(),{SCHEMES:l,getSchemeHandler:c}=cse();function d(x,S){return typeof x=="string"?x=g(_(x,S),S):typeof x=="object"&&(x=_(g(x,S),S)),x}function f(x,S,E){const T=E?Object.assign({scheme:"null"},E):{scheme:"null"},R=p(_(x,T),_(S,T),T,!0);return T.skipEscape=!0,g(R,T)}function p(x,S,E,T){const R={};return T||(x=_(g(x,E),E),S=_(g(S,E),E)),E=E||{},!E.tolerant&&S.scheme?(R.scheme=S.scheme,R.userinfo=S.userinfo,R.host=S.host,R.port=S.port,R.path=t(S.path||""),R.query=S.query):(S.userinfo!==void 0||S.host!==void 0||S.port!==void 0?(R.userinfo=S.userinfo,R.host=S.host,R.port=S.port,R.path=t(S.path||""),R.query=S.query):(S.path?(S.path[0]==="/"?R.path=t(S.path):((x.userinfo!==void 0||x.host!==void 0||x.port!==void 0)&&!x.path?R.path="/"+S.path:x.path?R.path=x.path.slice(0,x.path.lastIndexOf("/")+1)+S.path:R.path=S.path,R.path=t(R.path)),R.query=S.query):(R.path=x.path,S.query!==void 0?R.query=S.query:R.query=x.query),R.userinfo=x.userinfo,R.host=x.host,R.port=x.port),R.scheme=x.scheme),R.fragment=S.fragment,R}function h(x,S,E){return typeof x=="string"?(x=unescape(x),x=g(r(_(x,E),!0),{...E,skipEscape:!0})):typeof x=="object"&&(x=g(r(x,!0),{...E,skipEscape:!0})),typeof S=="string"?(S=unescape(S),S=g(r(_(S,E),!0),{...E,skipEscape:!0})):typeof S=="object"&&(S=g(r(S,!0),{...E,skipEscape:!0})),x.toLowerCase()===S.toLowerCase()}function g(x,S){const E={host:x.host,scheme:x.scheme,userinfo:x.userinfo,port:x.port,path:x.path,query:x.query,nid:x.nid,nss:x.nss,uuid:x.uuid,fragment:x.fragment,reference:x.reference,resourceName:x.resourceName,secure:x.secure,error:""},T=Object.assign({},S),R=[],O=c(T.scheme||E.scheme);O&&O.serialize&&O.serialize(E,T),E.path!==void 0&&(T.skipEscape?E.path=unescape(E.path):(E.path=escape(E.path),E.scheme!==void 0&&(E.path=E.path.split("%3A").join(":")))),T.reference!=="suffix"&&E.scheme&&R.push(E.scheme,":");const A=n(E);if(A!==void 0&&(T.reference!=="suffix"&&R.push("//"),R.push(A),E.path&&E.path[0]!=="/"&&R.push("/")),E.path!==void 0){let I=E.path;!T.absolutePath&&(!O||!O.absolutePath)&&(I=t(I)),A===void 0&&I[0]==="/"&&I[1]==="/"&&(I="/%2F"+I.slice(2)),R.push(I)}return E.query!==void 0&&R.push("?",E.query),E.fragment!==void 0&&R.push("#",E.fragment),R.join("")}const v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _(x,S){const E=Object.assign({},S),T={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let R=!1;E.reference==="suffix"&&(E.scheme?x=E.scheme+":"+x:x="//"+x);const O=x.match(v);if(O){if(T.scheme=O[1],T.userinfo=O[3],T.host=O[4],T.port=parseInt(O[5],10),T.path=O[6]||"",T.query=O[7],T.fragment=O[8],isNaN(T.port)&&(T.port=O[5]),T.host)if(o(T.host)===!1){const M=e(T.host);T.host=M.host.toLowerCase(),R=M.isIPV6}else R=!0;T.scheme===void 0&&T.userinfo===void 0&&T.host===void 0&&T.port===void 0&&T.query===void 0&&!T.path?T.reference="same-document":T.scheme===void 0?T.reference="relative":T.fragment===void 0?T.reference="absolute":T.reference="uri",E.reference&&E.reference!=="suffix"&&E.reference!==T.reference&&(T.error=T.error||"URI is not a "+E.reference+" reference.");const A=c(E.scheme||T.scheme);if(!E.unicodeSupport&&(!A||!A.unicodeSupport)&&T.host&&(E.domainHost||A&&A.domainHost)&&R===!1&&s(T.host))try{T.host=URL.domainToASCII(T.host.toLowerCase())}catch(I){T.error=T.error||"Host's domain name can not be converted to ASCII: "+I}(!A||A&&!A.skipNormalize)&&(x.indexOf("%")!==-1&&(T.scheme!==void 0&&(T.scheme=unescape(T.scheme)),T.host!==void 0&&(T.host=unescape(T.host))),T.path&&(T.path=escape(unescape(T.path))),T.fragment&&(T.fragment=encodeURI(decodeURIComponent(T.fragment)))),A&&A.parse&&A.parse(T,E)}else T.error=T.error||"URI can not be parsed.";return T}const b={SCHEMES:l,normalize:d,resolve:f,resolveComponent:p,equal:h,serialize:g,parse:_};return _d.exports=b,_d.exports.default=b,_d.exports.fastUri=b,_d.exports}var eP;function dse(){if(eP)return Mp;eP=1,Object.defineProperty(Mp,"__esModule",{value:!0});const e=use();return e.code='require("ajv/dist/runtime/uri").default',Mp.default=e,Mp}var tP;function fse(){return tP||(tP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=mv();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=yt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=dE(),o=gv(),s=U6(),l=fE(),c=yt(),d=pv(),f=Og(),p=kt(),h=lse,g=dse(),v=(Q,k)=>new RegExp(Q,k);v.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),x={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},S={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},E=200;function T(Q){var k,G,V,D,U,X,fe,pe,xe,je,Y,re,ve,se,Se,Te,tt,rt,Be,Qe,Me,Pe,Ue,K,ne;const ae=Q.strict,Oe=(k=Q.code)===null||k===void 0?void 0:k.optimize,Ae=Oe===!0||Oe===void 0?1:Oe||0,Ie=(V=(G=Q.code)===null||G===void 0?void 0:G.regExp)!==null&&V!==void 0?V:v,ke=(D=Q.uriResolver)!==null&&D!==void 0?D:g.default;return{strictSchema:(X=(U=Q.strictSchema)!==null&&U!==void 0?U:ae)!==null&&X!==void 0?X:!0,strictNumbers:(pe=(fe=Q.strictNumbers)!==null&&fe!==void 0?fe:ae)!==null&&pe!==void 0?pe:!0,strictTypes:(je=(xe=Q.strictTypes)!==null&&xe!==void 0?xe:ae)!==null&&je!==void 0?je:"log",strictTuples:(re=(Y=Q.strictTuples)!==null&&Y!==void 0?Y:ae)!==null&&re!==void 0?re:"log",strictRequired:(se=(ve=Q.strictRequired)!==null&&ve!==void 0?ve:ae)!==null&&se!==void 0?se:!1,code:Q.code?{...Q.code,optimize:Ae,regExp:Ie}:{optimize:Ae,regExp:Ie},loopRequired:(Se=Q.loopRequired)!==null&&Se!==void 0?Se:E,loopEnum:(Te=Q.loopEnum)!==null&&Te!==void 0?Te:E,meta:(tt=Q.meta)!==null&&tt!==void 0?tt:!0,messages:(rt=Q.messages)!==null&&rt!==void 0?rt:!0,inlineRefs:(Be=Q.inlineRefs)!==null&&Be!==void 0?Be:!0,schemaId:(Qe=Q.schemaId)!==null&&Qe!==void 0?Qe:"$id",addUsedSchema:(Me=Q.addUsedSchema)!==null&&Me!==void 0?Me:!0,validateSchema:(Pe=Q.validateSchema)!==null&&Pe!==void 0?Pe:!0,validateFormats:(Ue=Q.validateFormats)!==null&&Ue!==void 0?Ue:!0,unicodeRegExp:(K=Q.unicodeRegExp)!==null&&K!==void 0?K:!0,int32range:(ne=Q.int32range)!==null&&ne!==void 0?ne:!0,uriResolver:ke}}class R{constructor(k={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...T(k)};const{es5:G,lines:V}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:b,es5:G,lines:V}),this.logger=B(k.logger);const D=k.validateFormats;k.validateFormats=!1,this.RULES=(0,s.getRules)(),O.call(this,x,k,"NOT SUPPORTED"),O.call(this,S,k,"DEPRECATED","warn"),this._metaOpts=q.call(this),k.formats&&M.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&L.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),I.call(this),k.validateFormats=D}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:G,schemaId:V}=this.opts;let D=h;V==="id"&&(D={...h},D.id=D.$id,delete D.$id),G&&k&&this.addMetaSchema(D,D[V],!1)}defaultMeta(){const{meta:k,schemaId:G}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[G]||k:void 0}validate(k,G){let V;if(typeof k=="string"){if(V=this.getSchema(k),!V)throw new Error(`no schema with key or ref "${k}"`)}else V=this.compile(k);const D=V(G);return"$async"in V||(this.errors=V.errors),D}compile(k,G){const V=this._addSchema(k,G);return V.validate||this._compileSchemaEnv(V)}compileAsync(k,G){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:V}=this.opts;return D.call(this,k,G);async function D(je,Y){await U.call(this,je.$schema);const re=this._addSchema(je,Y);return re.validate||X.call(this,re)}async function U(je){je&&!this.getSchema(je)&&await D.call(this,{$ref:je},!0)}async function X(je){try{return this._compileSchemaEnv(je)}catch(Y){if(!(Y instanceof o.default))throw Y;return fe.call(this,Y),await pe.call(this,Y.missingSchema),X.call(this,je)}}function fe({missingSchema:je,missingRef:Y}){if(this.refs[je])throw new Error(`AnySchema ${je} is loaded but ${Y} cannot be resolved`)}async function pe(je){const Y=await xe.call(this,je);this.refs[je]||await U.call(this,Y.$schema),this.refs[je]||this.addSchema(Y,je,G)}async function xe(je){const Y=this._loading[je];if(Y)return Y;try{return await(this._loading[je]=V(je))}finally{delete this._loading[je]}}}addSchema(k,G,V,D=this.opts.validateSchema){if(Array.isArray(k)){for(const X of k)this.addSchema(X,void 0,V,D);return this}let U;if(typeof k=="object"){const{schemaId:X}=this.opts;if(U=k[X],U!==void 0&&typeof U!="string")throw new Error(`schema ${X} must be string`)}return G=(0,d.normalizeId)(G||U),this._checkUnique(G),this.schemas[G]=this._addSchema(k,V,G,D,!0),this}addMetaSchema(k,G,V=this.opts.validateSchema){return this.addSchema(k,G,!0,V),this}validateSchema(k,G){if(typeof k=="boolean")return!0;let V;if(V=k.$schema,V!==void 0&&typeof V!="string")throw new Error("$schema must be a string");if(V=V||this.opts.defaultMeta||this.defaultMeta(),!V)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const D=this.validate(V,k);if(!D&&G){const U="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(U);else throw new Error(U)}return D}getSchema(k){let G;for(;typeof(G=A.call(this,k))=="string";)k=G;if(G===void 0){const{schemaId:V}=this.opts,D=new l.SchemaEnv({schema:{},schemaId:V});if(G=l.resolveSchema.call(this,D,k),!G)return;this.refs[k]=G}return G.validate||this._compileSchemaEnv(G)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const G=A.call(this,k);return typeof G=="object"&&this._cache.delete(G.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{const G=k;this._cache.delete(G);let V=k[this.opts.schemaId];return V&&(V=(0,d.normalizeId)(V),delete this.schemas[V],delete this.refs[V]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(const G of k)this.addKeyword(G);return this}addKeyword(k,G){let V;if(typeof k=="string")V=k,typeof G=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),G.keyword=V);else if(typeof k=="object"&&G===void 0){if(G=k,V=G.keyword,Array.isArray(V)&&!V.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Z.call(this,V,G),!G)return(0,p.eachItem)(V,U=>ie.call(this,U)),this;W.call(this,G);const D={...G,type:(0,f.getJSONTypes)(G.type),schemaType:(0,f.getJSONTypes)(G.schemaType)};return(0,p.eachItem)(V,D.type.length===0?U=>ie.call(this,U,D):U=>D.type.forEach(X=>ie.call(this,U,D,X))),this}getKeyword(k){const G=this.RULES.all[k];return typeof G=="object"?G.definition:!!G}removeKeyword(k){const{RULES:G}=this;delete G.keywords[k],delete G.all[k];for(const V of G.rules){const D=V.rules.findIndex(U=>U.keyword===k);D>=0&&V.rules.splice(D,1)}return this}addFormat(k,G){return typeof G=="string"&&(G=new RegExp(G)),this.formats[k]=G,this}errorsText(k=this.errors,{separator:G=", ",dataVar:V="data"}={}){return!k||k.length===0?"No errors":k.map(D=>`${V}${D.instancePath} ${D.message}`).reduce((D,U)=>D+G+U)}$dataMetaSchema(k,G){const V=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const D of G){const U=D.split("/").slice(1);let X=k;for(const fe of U)X=X[fe];for(const fe in V){const pe=V[fe];if(typeof pe!="object")continue;const{$data:xe}=pe.definition,je=X[fe];xe&&je&&(X[fe]=le(je))}}return k}_removeAllSchemas(k,G){for(const V in k){const D=k[V];(!G||G.test(V))&&(typeof D=="string"?delete k[V]:D&&!D.meta&&(this._cache.delete(D.schema),delete k[V]))}}_addSchema(k,G,V,D=this.opts.validateSchema,U=this.opts.addUsedSchema){let X;const{schemaId:fe}=this.opts;if(typeof k=="object")X=k[fe];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let pe=this._cache.get(k);if(pe!==void 0)return pe;V=(0,d.normalizeId)(X||V);const xe=d.getSchemaRefs.call(this,k,V);return pe=new l.SchemaEnv({schema:k,schemaId:fe,meta:G,baseId:V,localRefs:xe}),this._cache.set(pe.schema,pe),U&&!V.startsWith("#")&&(V&&this._checkUnique(V),this.refs[V]=pe),D&&this.validateSchema(k,!0),pe}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):l.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){const G=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,k)}finally{this.opts=G}}}R.ValidationError=r.default,R.MissingRefError=o.default,e.default=R;function O(Q,k,G,V="error"){for(const D in Q){const U=D;U in k&&this.logger[V](`${G}: option ${D}. ${Q[U]}`)}}function A(Q){return Q=(0,d.normalizeId)(Q),this.schemas[Q]||this.refs[Q]}function I(){const Q=this.opts.schemas;if(Q)if(Array.isArray(Q))this.addSchema(Q);else for(const k in Q)this.addSchema(Q[k],k)}function M(){for(const Q in this.opts.formats){const k=this.opts.formats[Q];k&&this.addFormat(Q,k)}}function L(Q){if(Array.isArray(Q)){this.addVocabulary(Q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const k in Q){const G=Q[k];G.keyword||(G.keyword=k),this.addKeyword(G)}}function q(){const Q={...this.opts};for(const k of _)delete Q[k];return Q}const j={log(){},warn(){},error(){}};function B(Q){if(Q===!1)return j;if(Q===void 0)return console;if(Q.log&&Q.warn&&Q.error)return Q;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function Z(Q,k){const{RULES:G}=this;if((0,p.eachItem)(Q,V=>{if(G.keywords[V])throw new Error(`Keyword ${V} is already defined`);if(!F.test(V))throw new Error(`Keyword ${V} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw new Error('$data keyword must have "code" or "validate" function')}function ie(Q,k,G){var V;const D=k?.post;if(G&&D)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:U}=this;let X=D?U.post:U.rules.find(({type:pe})=>pe===G);if(X||(X={type:G,rules:[]},U.rules.push(X)),U.keywords[Q]=!0,!k)return;const fe={keyword:Q,definition:{...k,type:(0,f.getJSONTypes)(k.type),schemaType:(0,f.getJSONTypes)(k.schemaType)}};k.before?H.call(this,X,fe,k.before):X.rules.push(fe),U.all[Q]=fe,(V=k.implements)===null||V===void 0||V.forEach(pe=>this.addKeyword(pe))}function H(Q,k,G){const V=Q.rules.findIndex(D=>D.keyword===G);V>=0?Q.rules.splice(V,0,k):(Q.rules.push(k),this.logger.warn(`rule ${G} is not defined`))}function W(Q){let{metaSchema:k}=Q;k!==void 0&&(Q.$data&&this.opts.$data&&(k=le(k)),Q.validateSchema=this.compile(k,!0))}const te={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function le(Q){return{anyOf:[Q,te]}}})(mb)),mb}var Np={},kp={},Dp={},nP;function hse(){if(nP)return Dp;nP=1,Object.defineProperty(Dp,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Dp.default=e,Dp}var Qs={},rP;function pse(){if(rP)return Qs;rP=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.callRef=Qs.getValidate=void 0;const e=gv(),t=li(),n=yt(),r=wa(),o=fE(),s=kt(),l={keyword:"$ref",schemaType:"string",code(f){const{gen:p,schema:h,it:g}=f,{baseId:v,schemaEnv:_,validateName:b,opts:x,self:S}=g,{root:E}=_;if((h==="#"||h==="#/")&&v===E.baseId)return R();const T=o.resolveRef.call(S,E,v,h);if(T===void 0)throw new e.default(g.opts.uriResolver,v,h);if(T instanceof o.SchemaEnv)return O(T);return A(T);function R(){if(_===E)return d(f,b,_,_.$async);const I=p.scopeValue("root",{ref:E});return d(f,(0,n._)`${I}.validate`,E,E.$async)}function O(I){const M=c(f,I);d(f,M,I,I.$async)}function A(I){const M=p.scopeValue("schema",x.code.source===!0?{ref:I,code:(0,n.stringify)(I)}:{ref:I}),L=p.name("valid"),q=f.subschema({schema:I,dataTypes:[],schemaPath:n.nil,topSchemaRef:M,errSchemaPath:h},L);f.mergeEvaluated(q),f.ok(L)}}};function c(f,p){const{gen:h}=f;return p.validate?h.scopeValue("validate",{ref:p.validate}):(0,n._)`${h.scopeValue("wrapper",{ref:p})}.validate`}Qs.getValidate=c;function d(f,p,h,g){const{gen:v,it:_}=f,{allErrors:b,schemaEnv:x,opts:S}=_,E=S.passContext?r.default.this:n.nil;g?T():R();function T(){if(!x.$async)throw new Error("async schema referenced by sync schema");const I=v.let("valid");v.try(()=>{v.code((0,n._)`await ${(0,t.callValidateCode)(f,p,E)}`),A(p),b||v.assign(I,!0)},M=>{v.if((0,n._)`!(${M} instanceof ${_.ValidationError})`,()=>v.throw(M)),O(M),b||v.assign(I,!1)}),f.ok(I)}function R(){f.result((0,t.callValidateCode)(f,p,E),()=>A(p),()=>O(p))}function O(I){const M=(0,n._)`${I}.errors`;v.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${M} : ${r.default.vErrors}.concat(${M})`),v.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function A(I){var M;if(!_.opts.unevaluated)return;const L=(M=h?.validate)===null||M===void 0?void 0:M.evaluated;if(_.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(_.props=s.mergeEvaluated.props(v,L.props,_.props));else{const q=v.var("props",(0,n._)`${I}.evaluated.props`);_.props=s.mergeEvaluated.props(v,q,_.props,n.Name)}if(_.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(_.items=s.mergeEvaluated.items(v,L.items,_.items));else{const q=v.var("items",(0,n._)`${I}.evaluated.items`);_.items=s.mergeEvaluated.items(v,q,_.items,n.Name)}}}return Qs.callRef=d,Qs.default=l,Qs}var oP;function mse(){if(oP)return kp;oP=1,Object.defineProperty(kp,"__esModule",{value:!0});const e=hse(),t=pse(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return kp.default=n,kp}var Lp={},$p={},iP;function gse(){if(iP)return $p;iP=1,Object.defineProperty($p,"__esModule",{value:!0});const e=yt(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:s,schemaCode:l})=>(0,e.str)`must be ${n[s].okStr} ${l}`,params:({keyword:s,schemaCode:l})=>(0,e._)`{comparison: ${n[s].okStr}, limit: ${l}}`},o={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(s){const{keyword:l,data:c,schemaCode:d}=s;s.fail$data((0,e._)`${c} ${n[l].fail} ${d} || isNaN(${c})`)}};return $p.default=o,$p}var jp={},sP;function vse(){if(sP)return jp;sP=1,Object.defineProperty(jp,"__esModule",{value:!0});const e=yt(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:o,data:s,schemaCode:l,it:c}=r,d=c.opts.multipleOfPrecision,f=o.let("res"),p=d?(0,e._)`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:(0,e._)`${f} !== parseInt(${f})`;r.fail$data((0,e._)`(${l} === 0 || (${f} = ${s}/${l}, ${p}))`)}};return jp.default=n,jp}var zp={},Up={},aP;function yse(){if(aP)return Up;aP=1,Object.defineProperty(Up,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,o=0,s;for(;o<n;)r++,s=t.charCodeAt(o++),s>=55296&&s<=56319&&o<n&&(s=t.charCodeAt(o),(s&64512)===56320&&o++);return r}return Up.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Up}var lP;function _se(){if(lP)return zp;lP=1,Object.defineProperty(zp,"__esModule",{value:!0});const e=yt(),t=kt(),n=yse(),o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:l}){const c=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${c} than ${l} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:l,data:c,schemaCode:d,it:f}=s,p=l==="maxLength"?e.operators.GT:e.operators.LT,h=f.opts.unicode===!1?(0,e._)`${c}.length`:(0,e._)`${(0,t.useFunc)(s.gen,n.default)}(${c})`;s.fail$data((0,e._)`${h} ${p} ${d}`)}};return zp.default=o,zp}var Fp={},cP;function bse(){if(cP)return Fp;cP=1,Object.defineProperty(Fp,"__esModule",{value:!0});const e=li(),t=kt(),n=yt(),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,n.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,n._)`{pattern: ${s}}`},code(s){const{gen:l,data:c,$data:d,schema:f,schemaCode:p,it:h}=s,g=h.opts.unicodeRegExp?"u":"";if(d){const{regExp:v}=h.opts.code,_=v.code==="new RegExp"?(0,n._)`new RegExp`:(0,t.useFunc)(l,v),b=l.let("valid");l.try(()=>l.assign(b,(0,n._)`${_}(${p}, ${g}).test(${c})`),()=>l.assign(b,!1)),s.fail$data((0,n._)`!${b}`)}else{const v=(0,e.usePattern)(s,f);s.fail$data((0,n._)`!${v}.test(${c})`)}}};return Fp.default=o,Fp}var Bp={},uP;function wse(){if(uP)return Bp;uP=1,Object.defineProperty(Bp,"__esModule",{value:!0});const e=yt(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:o}){const s=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${o} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:o,data:s,schemaCode:l}=r,c=o==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${s}).length ${c} ${l}`)}};return Bp.default=n,Bp}var Vp={},dP;function Sse(){if(dP)return Vp;dP=1,Object.defineProperty(Vp,"__esModule",{value:!0});const e=li(),t=yt(),n=kt(),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:l,schema:c,schemaCode:d,data:f,$data:p,it:h}=s,{opts:g}=h;if(!p&&c.length===0)return;const v=c.length>=g.loopRequired;if(h.allErrors?_():b(),g.strictRequired){const E=s.parentSchema.properties,{definedProperties:T}=s.it;for(const R of c)if(E?.[R]===void 0&&!T.has(R)){const O=h.schemaEnv.baseId+h.errSchemaPath,A=`required property "${R}" is not defined at "${O}" (strictRequired)`;(0,n.checkStrictMode)(h,A,h.opts.strictRequired)}}function _(){if(v||p)s.block$data(t.nil,x);else for(const E of c)(0,e.checkReportMissingProp)(s,E)}function b(){const E=l.let("missing");if(v||p){const T=l.let("valid",!0);s.block$data(T,()=>S(E,T)),s.ok(T)}else l.if((0,e.checkMissingProp)(s,c,E)),(0,e.reportMissingProp)(s,E),l.else()}function x(){l.forOf("prop",d,E=>{s.setParams({missingProperty:E}),l.if((0,e.noPropertyInData)(l,f,E,g.ownProperties),()=>s.error())})}function S(E,T){s.setParams({missingProperty:E}),l.forOf(E,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,E,g.ownProperties)),l.if((0,t.not)(T),()=>{s.error(),l.break()})},t.nil)}}};return Vp.default=o,Vp}var qp={},fP;function Ese(){if(fP)return qp;fP=1,Object.defineProperty(qp,"__esModule",{value:!0});const e=yt(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:o}){const s=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${o} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:o,data:s,schemaCode:l}=r,c=o==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${s}.length ${c} ${l}`)}};return qp.default=n,qp}var Hp={},Gp={},hP;function hE(){if(hP)return Gp;hP=1,Object.defineProperty(Gp,"__esModule",{value:!0});const e=B6();return e.code='require("ajv/dist/runtime/equal").default',Gp.default=e,Gp}var pP;function xse(){if(pP)return Hp;pP=1,Object.defineProperty(Hp,"__esModule",{value:!0});const e=Og(),t=yt(),n=kt(),r=hE(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:c}})=>(0,t.str)`must NOT have duplicate items (items ## ${c} and ${l} are identical)`,params:({params:{i:l,j:c}})=>(0,t._)`{i: ${l}, j: ${c}}`},code(l){const{gen:c,data:d,$data:f,schema:p,parentSchema:h,schemaCode:g,it:v}=l;if(!f&&!p)return;const _=c.let("valid"),b=h.items?(0,e.getSchemaTypes)(h.items):[];l.block$data(_,x,(0,t._)`${g} === false`),l.ok(_);function x(){const R=c.let("i",(0,t._)`${d}.length`),O=c.let("j");l.setParams({i:R,j:O}),c.assign(_,!0),c.if((0,t._)`${R} > 1`,()=>(S()?E:T)(R,O))}function S(){return b.length>0&&!b.some(R=>R==="object"||R==="array")}function E(R,O){const A=c.name("item"),I=(0,e.checkDataTypes)(b,A,v.opts.strictNumbers,e.DataType.Wrong),M=c.const("indices",(0,t._)`{}`);c.for((0,t._)`;${R}--;`,()=>{c.let(A,(0,t._)`${d}[${R}]`),c.if(I,(0,t._)`continue`),b.length>1&&c.if((0,t._)`typeof ${A} == "string"`,(0,t._)`${A} += "_"`),c.if((0,t._)`typeof ${M}[${A}] == "number"`,()=>{c.assign(O,(0,t._)`${M}[${A}]`),l.error(),c.assign(_,!1).break()}).code((0,t._)`${M}[${A}] = ${R}`)})}function T(R,O){const A=(0,n.useFunc)(c,r.default),I=c.name("outer");c.label(I).for((0,t._)`;${R}--;`,()=>c.for((0,t._)`${O} = ${R}; ${O}--;`,()=>c.if((0,t._)`${A}(${d}[${R}], ${d}[${O}])`,()=>{l.error(),c.assign(_,!1).break(I)})))}}};return Hp.default=s,Hp}var Kp={},mP;function Rse(){if(mP)return Kp;mP=1,Object.defineProperty(Kp,"__esModule",{value:!0});const e=yt(),t=kt(),n=hE(),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:l,data:c,$data:d,schemaCode:f,schema:p}=s;d||p&&typeof p=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(l,n.default)}(${c}, ${f})`):s.fail((0,e._)`${p} !== ${c}`)}};return Kp.default=o,Kp}var Zp={},gP;function Ose(){if(gP)return Zp;gP=1,Object.defineProperty(Zp,"__esModule",{value:!0});const e=yt(),t=kt(),n=hE(),o={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:l,data:c,$data:d,schema:f,schemaCode:p,it:h}=s;if(!d&&f.length===0)throw new Error("enum must have non-empty array");const g=f.length>=h.opts.loopEnum;let v;const _=()=>v??(v=(0,t.useFunc)(l,n.default));let b;if(g||d)b=l.let("valid"),s.block$data(b,x);else{if(!Array.isArray(f))throw new Error("ajv implementation error");const E=l.const("vSchema",p);b=(0,e.or)(...f.map((T,R)=>S(E,R)))}s.pass(b);function x(){l.assign(b,!1),l.forOf("v",p,E=>l.if((0,e._)`${_()}(${c}, ${E})`,()=>l.assign(b,!0).break()))}function S(E,T){const R=f[T];return typeof R=="object"&&R!==null?(0,e._)`${_()}(${c}, ${E}[${T}])`:(0,e._)`${c} === ${R}`}}};return Zp.default=o,Zp}var vP;function Tse(){if(vP)return Lp;vP=1,Object.defineProperty(Lp,"__esModule",{value:!0});const e=gse(),t=vse(),n=_se(),r=bse(),o=wse(),s=Sse(),l=Ese(),c=xse(),d=Rse(),f=Ose(),p=[e.default,t.default,n.default,r.default,o.default,s.default,l.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];return Lp.default=p,Lp}var Yp={},_c={},yP;function q6(){if(yP)return _c;yP=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.validateAdditionalItems=void 0;const e=yt(),t=kt(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:l,it:c}=s,{items:d}=l;if(!Array.isArray(d)){(0,t.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}o(s,d)}};function o(s,l){const{gen:c,schema:d,data:f,keyword:p,it:h}=s;h.items=!0;const g=c.const("len",(0,e._)`${f}.length`);if(d===!1)s.setParams({len:l.length}),s.pass((0,e._)`${g} <= ${l.length}`);else if(typeof d=="object"&&!(0,t.alwaysValidSchema)(h,d)){const _=c.var("valid",(0,e._)`${g} <= ${l.length}`);c.if((0,e.not)(_),()=>v(_)),s.ok(_)}function v(_){c.forRange("i",l.length,g,b=>{s.subschema({keyword:p,dataProp:b,dataPropType:t.Type.Num},_),h.allErrors||c.if((0,e.not)(_),()=>c.break())})}}return _c.validateAdditionalItems=o,_c.default=r,_c}var Wp={},bc={},_P;function H6(){if(_P)return bc;_P=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.validateTuple=void 0;const e=yt(),t=kt(),n=li(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:l,it:c}=s;if(Array.isArray(l))return o(s,"additionalItems",l);c.items=!0,!(0,t.alwaysValidSchema)(c,l)&&s.ok((0,n.validateArray)(s))}};function o(s,l,c=s.schema){const{gen:d,parentSchema:f,data:p,keyword:h,it:g}=s;b(f),g.opts.unevaluated&&c.length&&g.items!==!0&&(g.items=t.mergeEvaluated.items(d,c.length,g.items));const v=d.name("valid"),_=d.const("len",(0,e._)`${p}.length`);c.forEach((x,S)=>{(0,t.alwaysValidSchema)(g,x)||(d.if((0,e._)`${_} > ${S}`,()=>s.subschema({keyword:h,schemaProp:S,dataProp:S},v)),s.ok(v))});function b(x){const{opts:S,errSchemaPath:E}=g,T=c.length,R=T===x.minItems&&(T===x.maxItems||x[l]===!1);if(S.strictTuples&&!R){const O=`"${h}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${E}"`;(0,t.checkStrictMode)(g,O,S.strictTuples)}}}return bc.validateTuple=o,bc.default=r,bc}var bP;function Cse(){if(bP)return Wp;bP=1,Object.defineProperty(Wp,"__esModule",{value:!0});const e=H6(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return Wp.default=t,Wp}var Qp={},wP;function Ase(){if(wP)return Qp;wP=1,Object.defineProperty(Qp,"__esModule",{value:!0});const e=yt(),t=kt(),n=li(),r=q6(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:c,parentSchema:d,it:f}=l,{prefixItems:p}=d;f.items=!0,!(0,t.alwaysValidSchema)(f,c)&&(p?(0,r.validateAdditionalItems)(l,p):l.ok((0,n.validateArray)(l)))}};return Qp.default=s,Qp}var Xp={},SP;function Ise(){if(SP)return Xp;SP=1,Object.defineProperty(Xp,"__esModule",{value:!0});const e=yt(),t=kt(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:o,max:s}})=>s===void 0?(0,e.str)`must contain at least ${o} valid item(s)`:(0,e.str)`must contain at least ${o} and no more than ${s} valid item(s)`,params:({params:{min:o,max:s}})=>s===void 0?(0,e._)`{minContains: ${o}}`:(0,e._)`{minContains: ${o}, maxContains: ${s}}`},code(o){const{gen:s,schema:l,parentSchema:c,data:d,it:f}=o;let p,h;const{minContains:g,maxContains:v}=c;f.opts.next?(p=g===void 0?1:g,h=v):p=1;const _=s.const("len",(0,e._)`${d}.length`);if(o.setParams({min:p,max:h}),h===void 0&&p===0){(0,t.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&p>h){(0,t.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),o.fail();return}if((0,t.alwaysValidSchema)(f,l)){let T=(0,e._)`${_} >= ${p}`;h!==void 0&&(T=(0,e._)`${T} && ${_} <= ${h}`),o.pass(T);return}f.items=!0;const b=s.name("valid");h===void 0&&p===1?S(b,()=>s.if(b,()=>s.break())):p===0?(s.let(b,!0),h!==void 0&&s.if((0,e._)`${d}.length > 0`,x)):(s.let(b,!1),x()),o.result(b,()=>o.reset());function x(){const T=s.name("_valid"),R=s.let("count",0);S(T,()=>s.if(T,()=>E(R)))}function S(T,R){s.forRange("i",0,_,O=>{o.subschema({keyword:"contains",dataProp:O,dataPropType:t.Type.Num,compositeRule:!0},T),R()})}function E(T){s.code((0,e._)`${T}++`),h===void 0?s.if((0,e._)`${T} >= ${p}`,()=>s.assign(b,!0).break()):(s.if((0,e._)`${T} > ${h}`,()=>s.assign(b,!1).break()),p===1?s.assign(b,!0):s.if((0,e._)`${T} >= ${p}`,()=>s.assign(b,!0)))}}};return Xp.default=r,Xp}var xb={},EP;function Pse(){return EP||(EP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=yt(),n=kt(),r=li();e.error={message:({params:{property:d,depsCount:f,deps:p}})=>{const h=f===1?"property":"properties";return(0,t.str)`must have ${h} ${p} when property ${d} is present`},params:({params:{property:d,depsCount:f,deps:p,missingProperty:h}})=>(0,t._)`{property: ${d},
|
|
161
161
|
missingProperty: ${h},
|
|
162
162
|
depsCount: ${f},
|
|
163
|
-
deps: ${p}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[f,p]=s(d);l(d,f),c(d,p)}};function s({schema:d}){const f={},p={};for(const h in d){if(h==="__proto__")continue;const g=Array.isArray(d[h])?f:p;g[h]=d[h]}return[f,p]}function l(d,f=d.schema){const{gen:p,data:h,it:g}=d;if(Object.keys(f).length===0)return;const v=p.let("missing");for(const _ in f){const b=f[_];if(b.length===0)continue;const x=(0,r.propertyInData)(p,h,_,g.opts.ownProperties);d.setParams({property:_,depsCount:b.length,deps:b.join(", ")}),g.allErrors?p.if(x,()=>{for(const S of b)(0,r.checkReportMissingProp)(d,S)}):(p.if((0,t._)`${x} && (${(0,r.checkMissingProp)(d,b,v)})`),(0,r.reportMissingProp)(d,v),p.else())}}e.validatePropertyDeps=l;function c(d,f=d.schema){const{gen:p,data:h,keyword:g,it:v}=d,_=p.name("valid");for(const b in f)(0,n.alwaysValidSchema)(v,f[b])||(p.if((0,r.propertyInData)(p,h,b,v.opts.ownProperties),()=>{const x=d.subschema({keyword:g,schemaProp:b},_);d.mergeValidEvaluated(x,_)},()=>p.var(_,!0)),d.ok(_))}e.validateSchemaDeps=c,e.default=o})(xb)),xb}var Jp={},xP;function Mse(){if(xP)return Jp;xP=1,Object.defineProperty(Jp,"__esModule",{value:!0});const e=yt(),t=kt(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:o})=>(0,e._)`{propertyName: ${o.propertyName}}`},code(o){const{gen:s,schema:l,data:c,it:d}=o;if((0,t.alwaysValidSchema)(d,l))return;const f=s.name("valid");s.forIn("key",c,p=>{o.setParams({propertyName:p}),o.subschema({keyword:"propertyNames",data:p,dataTypes:["string"],propertyName:p,compositeRule:!0},f),s.if((0,e.not)(f),()=>{o.error(!0),d.allErrors||s.break()})}),o.ok(f)}};return Jp.default=r,Jp}var em={},RP;function G6(){if(RP)return em;RP=1,Object.defineProperty(em,"__esModule",{value:!0});const e=li(),t=yt(),n=wa(),r=kt(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:c,schema:d,parentSchema:f,data:p,errsCount:h,it:g}=l;if(!h)throw new Error("ajv implementation error");const{allErrors:v,opts:_}=g;if(g.props=!0,_.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(g,d))return;const b=(0,e.allSchemaProperties)(f.properties),x=(0,e.allSchemaProperties)(f.patternProperties);S(),l.ok((0,t._)`${h} === ${n.default.errors}`);function S(){c.forIn("key",p,A=>{!b.length&&!x.length?R(A):c.if(E(A),()=>R(A))})}function E(A){let I;if(b.length>8){const M=(0,r.schemaRefOrVal)(g,f.properties,"properties");I=(0,e.isOwnProperty)(c,M,A)}else b.length?I=(0,t.or)(...b.map(M=>(0,t._)`${A} === ${M}`)):I=t.nil;return x.length&&(I=(0,t.or)(I,...x.map(M=>(0,t._)`${(0,e.usePattern)(l,M)}.test(${A})`))),(0,t.not)(I)}function T(A){c.code((0,t._)`delete ${p}[${A}]`)}function R(A){if(_.removeAdditional==="all"||_.removeAdditional&&d===!1){T(A);return}if(d===!1){l.setParams({additionalProperty:A}),l.error(),v||c.break();return}if(typeof d=="object"&&!(0,r.alwaysValidSchema)(g,d)){const I=c.name("valid");_.removeAdditional==="failing"?(O(A,I,!1),c.if((0,t.not)(I),()=>{l.reset(),T(A)})):(O(A,I),v||c.if((0,t.not)(I),()=>c.break()))}}function O(A,I,M){const L={keyword:"additionalProperties",dataProp:A,dataPropType:r.Type.Str};M===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(L,I)}}};return em.default=s,em}var tm={},OP;function Nse(){if(OP)return tm;OP=1,Object.defineProperty(tm,"__esModule",{value:!0});const e=mv(),t=li(),n=kt(),r=G6(),o={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:l,schema:c,parentSchema:d,data:f,it:p}=s;p.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(p,r.default,"additionalProperties"));const h=(0,t.allSchemaProperties)(c);for(const x of h)p.definedProperties.add(x);p.opts.unevaluated&&h.length&&p.props!==!0&&(p.props=n.mergeEvaluated.props(l,(0,n.toHash)(h),p.props));const g=h.filter(x=>!(0,n.alwaysValidSchema)(p,c[x]));if(g.length===0)return;const v=l.name("valid");for(const x of g)_(x)?b(x):(l.if((0,t.propertyInData)(l,f,x,p.opts.ownProperties)),b(x),p.allErrors||l.else().var(v,!0),l.endIf()),s.it.definedProperties.add(x),s.ok(v);function _(x){return p.opts.useDefaults&&!p.compositeRule&&c[x].default!==void 0}function b(x){s.subschema({keyword:"properties",schemaProp:x,dataProp:x},v)}}};return tm.default=o,tm}var nm={},TP;function kse(){if(TP)return nm;TP=1,Object.defineProperty(nm,"__esModule",{value:!0});const e=li(),t=yt(),n=kt(),r=kt(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:l,schema:c,data:d,parentSchema:f,it:p}=s,{opts:h}=p,g=(0,e.allSchemaProperties)(c),v=g.filter(R=>(0,n.alwaysValidSchema)(p,c[R]));if(g.length===0||v.length===g.length&&(!p.opts.unevaluated||p.props===!0))return;const _=h.strictSchema&&!h.allowMatchingProperties&&f.properties,b=l.name("valid");p.props!==!0&&!(p.props instanceof t.Name)&&(p.props=(0,r.evaluatedPropsToName)(l,p.props));const{props:x}=p;S();function S(){for(const R of g)_&&E(R),p.allErrors?T(R):(l.var(b,!0),T(R),l.if(b))}function E(R){for(const O in _)new RegExp(R).test(O)&&(0,n.checkStrictMode)(p,`property ${O} matches pattern ${R} (use allowMatchingProperties)`)}function T(R){l.forIn("key",d,O=>{l.if((0,t._)`${(0,e.usePattern)(s,R)}.test(${O})`,()=>{const A=v.includes(R);A||s.subschema({keyword:"patternProperties",schemaProp:R,dataProp:O,dataPropType:r.Type.Str},b),p.opts.unevaluated&&x!==!0?l.assign((0,t._)`${x}[${O}]`,!0):!A&&!p.allErrors&&l.if((0,t.not)(b),()=>l.break())})})}}};return nm.default=o,nm}var rm={},CP;function Dse(){if(CP)return rm;CP=1,Object.defineProperty(rm,"__esModule",{value:!0});const e=kt(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:o,it:s}=n;if((0,e.alwaysValidSchema)(s,o)){n.fail();return}const l=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return rm.default=t,rm}var om={},AP;function Lse(){if(AP)return om;AP=1,Object.defineProperty(om,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:li().validateUnion,error:{message:"must match a schema in anyOf"}};return om.default=t,om}var im={},IP;function $se(){if(IP)return im;IP=1,Object.defineProperty(im,"__esModule",{value:!0});const e=yt(),t=kt(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:o})=>(0,e._)`{passingSchemas: ${o.passing}}`},code(o){const{gen:s,schema:l,parentSchema:c,it:d}=o;if(!Array.isArray(l))throw new Error("ajv implementation error");if(d.opts.discriminator&&c.discriminator)return;const f=l,p=s.let("valid",!1),h=s.let("passing",null),g=s.name("_valid");o.setParams({passing:h}),s.block(v),o.result(p,()=>o.reset(),()=>o.error(!0));function v(){f.forEach((_,b)=>{let x;(0,t.alwaysValidSchema)(d,_)?s.var(g,!0):x=o.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},g),b>0&&s.if((0,e._)`${g} && ${p}`).assign(p,!1).assign(h,(0,e._)`[${h}, ${b}]`).else(),s.if(g,()=>{s.assign(p,!0),s.assign(h,b),x&&o.mergeEvaluated(x,e.Name)})})}}};return im.default=r,im}var sm={},PP;function jse(){if(PP)return sm;PP=1,Object.defineProperty(sm,"__esModule",{value:!0});const e=kt(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:o,it:s}=n;if(!Array.isArray(o))throw new Error("ajv implementation error");const l=r.name("valid");o.forEach((c,d)=>{if((0,e.alwaysValidSchema)(s,c))return;const f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};return sm.default=t,sm}var am={},MP;function zse(){if(MP)return am;MP=1,Object.defineProperty(am,"__esModule",{value:!0});const e=yt(),t=kt(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:l,parentSchema:c,it:d}=s;c.then===void 0&&c.else===void 0&&(0,t.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const f=o(d,"then"),p=o(d,"else");if(!f&&!p)return;const h=l.let("valid",!0),g=l.name("_valid");if(v(),s.reset(),f&&p){const b=l.let("ifClause");s.setParams({ifClause:b}),l.if(g,_("then",b),_("else",b))}else f?l.if(g,_("then")):l.if((0,e.not)(g),_("else"));s.pass(h,()=>s.error(!0));function v(){const b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(b)}function _(b,x){return()=>{const S=s.subschema({keyword:b},g);l.assign(h,g),s.mergeValidEvaluated(S,h),x?l.assign(x,(0,e._)`${b}`):s.setParams({ifClause:b})}}}};function o(s,l){const c=s.schema[l];return c!==void 0&&!(0,t.alwaysValidSchema)(s,c)}return am.default=r,am}var lm={},NP;function Use(){if(NP)return lm;NP=1,Object.defineProperty(lm,"__esModule",{value:!0});const e=kt(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:o}){r.if===void 0&&(0,e.checkStrictMode)(o,`"${n}" without "if" is ignored`)}};return lm.default=t,lm}var kP;function Fse(){if(kP)return Yp;kP=1,Object.defineProperty(Yp,"__esModule",{value:!0});const e=q6(),t=Cse(),n=H6(),r=Ase(),o=Ise(),s=Pse(),l=Mse(),c=G6(),d=Nse(),f=kse(),p=Dse(),h=Lse(),g=$se(),v=jse(),_=zse(),b=Use();function x(S=!1){const E=[p.default,h.default,g.default,v.default,_.default,b.default,l.default,c.default,s.default,d.default,f.default];return S?E.push(t.default,r.default):E.push(e.default,n.default),E.push(o.default),E}return Yp.default=x,Yp}var cm={},um={},DP;function Bse(){if(DP)return um;DP=1,Object.defineProperty(um,"__esModule",{value:!0});const e=yt(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,o){const{gen:s,data:l,$data:c,schema:d,schemaCode:f,it:p}=r,{opts:h,errSchemaPath:g,schemaEnv:v,self:_}=p;if(!h.validateFormats)return;c?b():x();function b(){const S=s.scopeValue("formats",{ref:_.formats,code:h.code.formats}),E=s.const("fDef",(0,e._)`${S}[${f}]`),T=s.let("fType"),R=s.let("format");s.if((0,e._)`typeof ${E} == "object" && !(${E} instanceof RegExp)`,()=>s.assign(T,(0,e._)`${E}.type || "string"`).assign(R,(0,e._)`${E}.validate`),()=>s.assign(T,(0,e._)`"string"`).assign(R,E)),r.fail$data((0,e.or)(O(),A()));function O(){return h.strictSchema===!1?e.nil:(0,e._)`${f} && !${R}`}function A(){const I=v.$async?(0,e._)`(${E}.async ? await ${R}(${l}) : ${R}(${l}))`:(0,e._)`${R}(${l})`,M=(0,e._)`(typeof ${R} == "function" ? ${I} : ${R}.test(${l}))`;return(0,e._)`${R} && ${R} !== true && ${T} === ${o} && !${M}`}}function x(){const S=_.formats[d];if(!S){O();return}if(S===!0)return;const[E,T,R]=A(S);E===o&&r.pass(I());function O(){if(h.strictSchema===!1){_.logger.warn(M());return}throw new Error(M());function M(){return`unknown format "${d}" ignored in schema at path "${g}"`}}function A(M){const L=M instanceof RegExp?(0,e.regexpCode)(M):h.code.formats?(0,e._)`${h.code.formats}${(0,e.getProperty)(d)}`:void 0,q=s.scopeValue("formats",{key:d,ref:M,code:L});return typeof M=="object"&&!(M instanceof RegExp)?[M.type||"string",M.validate,(0,e._)`${q}.validate`]:["string",M,q]}function I(){if(typeof S=="object"&&!(S instanceof RegExp)&&S.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${R}(${l})`}return typeof T=="function"?(0,e._)`${R}(${l})`:(0,e._)`${R}.test(${l})`}}}};return um.default=n,um}var LP;function Vse(){if(LP)return cm;LP=1,Object.defineProperty(cm,"__esModule",{value:!0});const t=[Bse().default];return cm.default=t,cm}var Ya={},$P;function qse(){return $P||($P=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.contentVocabulary=Ya.metadataVocabulary=void 0,Ya.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ya.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ya}var jP;function Hse(){if(jP)return Np;jP=1,Object.defineProperty(Np,"__esModule",{value:!0});const e=mse(),t=Tse(),n=Fse(),r=Vse(),o=qse(),s=[e.default,t.default,(0,n.default)(),r.default,o.metadataVocabulary,o.contentVocabulary];return Np.default=s,Np}var dm={},bd={},zP;function Gse(){if(zP)return bd;zP=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(bd.DiscrError=e={})),bd}var UP;function Kse(){if(UP)return dm;UP=1,Object.defineProperty(dm,"__esModule",{value:!0});const e=yt(),t=Gse(),n=fE(),r=gv(),o=kt(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:d}})=>c===t.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:c,tag:d,tagName:f}})=>(0,e._)`{error: ${c}, tag: ${f}, tagValue: ${d}}`},code(c){const{gen:d,data:f,schema:p,parentSchema:h,it:g}=c,{oneOf:v}=h;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");const _=p.propertyName;if(typeof _!="string")throw new Error("discriminator: requires propertyName");if(p.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const b=d.let("valid",!1),x=d.const("tag",(0,e._)`${f}${(0,e.getProperty)(_)}`);d.if((0,e._)`typeof ${x} == "string"`,()=>S(),()=>c.error(!1,{discrError:t.DiscrError.Tag,tag:x,tagName:_})),c.ok(b);function S(){const R=T();d.if(!1);for(const O in R)d.elseIf((0,e._)`${x} === ${O}`),d.assign(b,E(R[O]));d.else(),c.error(!1,{discrError:t.DiscrError.Mapping,tag:x,tagName:_}),d.endIf()}function E(R){const O=d.name("valid"),A=c.subschema({keyword:"oneOf",schemaProp:R},O);return c.mergeEvaluated(A,e.Name),O}function T(){var R;const O={},A=M(h);let I=!0;for(let j=0;j<v.length;j++){let B=v[j];if(B?.$ref&&!(0,o.schemaHasRulesButRef)(B,g.self.RULES)){const Z=B.$ref;if(B=n.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,Z),B instanceof n.SchemaEnv&&(B=B.schema),B===void 0)throw new r.default(g.opts.uriResolver,g.baseId,Z)}const F=(R=B?.properties)===null||R===void 0?void 0:R[_];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);I=I&&(A||M(B)),L(F,j)}if(!I)throw new Error(`discriminator: "${_}" must be required`);return O;function M({required:j}){return Array.isArray(j)&&j.includes(_)}function L(j,B){if(j.const)q(j.const,B);else if(j.enum)for(const F of j.enum)q(F,B);else throw new Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function q(j,B){if(typeof j!="string"||j in O)throw new Error(`discriminator: "${_}" values must be unique strings`);O[j]=B}}}};return dm.default=l,dm}const Zse="http://json-schema.org/draft-07/schema#",Yse="http://json-schema.org/draft-07/schema#",Wse="Core schema meta-schema",Qse={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Xse=["object","boolean"],Jse={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},eae={$schema:Zse,$id:Yse,title:Wse,definitions:Qse,type:Xse,properties:Jse,default:!0};var FP;function tae(){return FP||(FP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=fse(),r=Hse(),o=Kse(),s=eae,l=["/properties"],c="http://json-schema.org/draft-07/schema";class d extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(s,l):s;this.addMetaSchema(_,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var f=mv();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var p=yt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=dE();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var g=gv();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})(Cp,Cp.exports)),Cp.exports}var fm={exports:{}},Rb={},BP;function nae(){return BP||(BP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,B){return{validate:j,compare:B}}e.fullFormats={date:t(s,l),time:t(d(!0),f),"date-time":t(g(!0),v),"iso-time":t(d(),p),"iso-date-time":t(g(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:S,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:q,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:T,int32:{type:"number",validate:A},int64:{type:"number",validate:I},float:{type:"number",validate:M},double:{type:"number",validate:M},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,l),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(j){return j%4===0&&(j%100!==0||j%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){const B=r.exec(j);if(!B)return!1;const F=+B[1],Z=+B[2],ie=+B[3];return Z>=1&&Z<=12&&ie>=1&&ie<=(Z===2&&n(F)?29:o[Z])}function l(j,B){if(j&&B)return j>B?1:j<B?-1:0}const c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function d(j){return function(F){const Z=c.exec(F);if(!Z)return!1;const ie=+Z[1],H=+Z[2],W=+Z[3],te=Z[4],le=Z[5]==="-"?-1:1,Q=+(Z[6]||0),k=+(Z[7]||0);if(Q>23||k>59||j&&!te)return!1;if(ie<=23&&H<=59&&W<60)return!0;const G=H-k*le,V=ie-Q*le-(G<0?1:0);return(V===23||V===-1)&&(G===59||G===-1)&&W<61}}function f(j,B){if(!(j&&B))return;const F=new Date("2020-01-01T"+j).valueOf(),Z=new Date("2020-01-01T"+B).valueOf();if(F&&Z)return F-Z}function p(j,B){if(!(j&&B))return;const F=c.exec(j),Z=c.exec(B);if(F&&Z)return j=F[1]+F[2]+F[3],B=Z[1]+Z[2]+Z[3],j>B?1:j<B?-1:0}const h=/t|\s/i;function g(j){const B=d(j);return function(Z){const ie=Z.split(h);return ie.length===2&&s(ie[0])&&B(ie[1])}}function v(j,B){if(!(j&&B))return;const F=new Date(j).valueOf(),Z=new Date(B).valueOf();if(F&&Z)return F-Z}function _(j,B){if(!(j&&B))return;const[F,Z]=j.split(h),[ie,H]=B.split(h),W=l(F,ie);if(W!==void 0)return W||f(Z,H)}const b=/\/|:/,x=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function S(j){return b.test(j)&&x.test(j)}const E=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function T(j){return E.lastIndex=0,E.test(j)}const R=-2147483648,O=2**31-1;function A(j){return Number.isInteger(j)&&j<=O&&j>=R}function I(j){return Number.isInteger(j)}function M(){return!0}const L=/[^\\]\\Z/;function q(j){if(L.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(Rb)),Rb}var Ob={},VP;function rae(){return VP||(VP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=tae(),n=yt(),r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:c,schemaCode:d})=>(0,n.str)`should be ${o[c].okStr} ${d}`,params:({keyword:c,schemaCode:d})=>(0,n._)`{comparison: ${o[c].okStr}, limit: ${d}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(c){const{gen:d,data:f,schemaCode:p,keyword:h,it:g}=c,{opts:v,self:_}=g;if(!v.validateFormats)return;const b=new t.KeywordCxt(g,_.RULES.all.format.definition,"format");b.$data?x():S();function x(){const T=d.scopeValue("formats",{ref:_.formats,code:v.code.formats}),R=d.const("fmt",(0,n._)`${T}[${b.schemaCode}]`);c.fail$data((0,n.or)((0,n._)`typeof ${R} != "object"`,(0,n._)`${R} instanceof RegExp`,(0,n._)`typeof ${R}.compare != "function"`,E(R)))}function S(){const T=b.schema,R=_.formats[T];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${h}": format "${T}" does not define "compare" function`);const O=d.scopeValue("formats",{key:T,ref:R,code:v.code.formats?(0,n._)`${v.code.formats}${(0,n.getProperty)(T)}`:void 0});c.fail$data(E(O))}function E(T){return(0,n._)`${T}.compare(${f}, ${p}) ${o[h].fail} 0`}},dependencies:["format"]};const l=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=l})(Ob)),Ob}var qP;function oae(){return qP||(qP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=nae(),r=rae(),o=yt(),s=new o.Name("fullFormats"),l=new o.Name("fastFormats"),c=(f,p={keywords:!0})=>{if(Array.isArray(p))return d(f,p,n.fullFormats,s),f;const[h,g]=p.mode==="fast"?[n.fastFormats,l]:[n.fullFormats,s],v=p.formats||n.formatNames;return d(f,v,h,g),p.keywords&&(0,r.default)(f),f};c.get=(f,p="full")=>{const g=(p==="fast"?n.fastFormats:n.fullFormats)[f];if(!g)throw new Error(`Unknown format "${f}"`);return g};function d(f,p,h,g){var v,_;(v=(_=f.opts.code).formats)!==null&&v!==void 0||(_.formats=(0,o._)`require("ajv-formats/dist/formats").${g}`);for(const b of p)f.addFormat(b,h[b])}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c})(fm,fm.exports)),fm.exports}var iae=oae();const _ue=fl(iae);let pE;pE=globalThis.crypto;async function sae(e){return(await pE).getRandomValues(new Uint8Array(e))}async function aae(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const o=await sae(e-r.length);for(const s of o)s<n&&(r+=t[s%t.length])}return r}async function lae(e){return await aae(e)}async function cae(e){const t=await(await pE).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function bue(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await lae(e),n=await cae(t);return{code_verifier:t,code_challenge:n}}const gr=IB().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:RV.custom,message:"URL must be parseable",fatal:!0}),A9}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),wue=vr({resource:$().url(),authorization_servers:Re(gr).optional(),jwks_uri:$().url().optional(),scopes_supported:Re($()).optional(),bearer_methods_supported:Re($()).optional(),resource_signing_alg_values_supported:Re($()).optional(),resource_name:$().optional(),resource_documentation:$().optional(),resource_policy_uri:$().url().optional(),resource_tos_uri:$().url().optional(),tls_client_certificate_bound_access_tokens:Nt().optional(),authorization_details_types_supported:Re($()).optional(),dpop_signing_alg_values_supported:Re($()).optional(),dpop_bound_access_tokens_required:Nt().optional()}),uae=vr({issuer:$(),authorization_endpoint:gr,token_endpoint:gr,registration_endpoint:gr.optional(),scopes_supported:Re($()).optional(),response_types_supported:Re($()),response_modes_supported:Re($()).optional(),grant_types_supported:Re($()).optional(),token_endpoint_auth_methods_supported:Re($()).optional(),token_endpoint_auth_signing_alg_values_supported:Re($()).optional(),service_documentation:gr.optional(),revocation_endpoint:gr.optional(),revocation_endpoint_auth_methods_supported:Re($()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Re($()).optional(),introspection_endpoint:$().optional(),introspection_endpoint_auth_methods_supported:Re($()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Re($()).optional(),code_challenge_methods_supported:Re($()).optional(),client_id_metadata_document_supported:Nt().optional()}),dae=vr({issuer:$(),authorization_endpoint:gr,token_endpoint:gr,userinfo_endpoint:gr.optional(),jwks_uri:gr,registration_endpoint:gr.optional(),scopes_supported:Re($()).optional(),response_types_supported:Re($()),response_modes_supported:Re($()).optional(),grant_types_supported:Re($()).optional(),acr_values_supported:Re($()).optional(),subject_types_supported:Re($()),id_token_signing_alg_values_supported:Re($()),id_token_encryption_alg_values_supported:Re($()).optional(),id_token_encryption_enc_values_supported:Re($()).optional(),userinfo_signing_alg_values_supported:Re($()).optional(),userinfo_encryption_alg_values_supported:Re($()).optional(),userinfo_encryption_enc_values_supported:Re($()).optional(),request_object_signing_alg_values_supported:Re($()).optional(),request_object_encryption_alg_values_supported:Re($()).optional(),request_object_encryption_enc_values_supported:Re($()).optional(),token_endpoint_auth_methods_supported:Re($()).optional(),token_endpoint_auth_signing_alg_values_supported:Re($()).optional(),display_values_supported:Re($()).optional(),claim_types_supported:Re($()).optional(),claims_supported:Re($()).optional(),service_documentation:$().optional(),claims_locales_supported:Re($()).optional(),ui_locales_supported:Re($()).optional(),claims_parameter_supported:Nt().optional(),request_parameter_supported:Nt().optional(),request_uri_parameter_supported:Nt().optional(),require_request_uri_registration:Nt().optional(),op_policy_uri:gr.optional(),op_tos_uri:gr.optional(),client_id_metadata_document_supported:Nt().optional()}),Sue=be({...dae.shape,...uae.pick({code_challenge_methods_supported:!0}).shape}),Eue=be({access_token:$(),id_token:$().optional(),token_type:$(),expires_in:nN().optional(),scope:$().optional(),refresh_token:$().optional()}).strip(),xue=be({error:$(),error_description:$().optional(),error_uri:$().optional()}),HP=gr.optional().or(Ge("").transform(()=>{})),fae=be({redirect_uris:Re(gr),token_endpoint_auth_method:$().optional(),grant_types:Re($()).optional(),response_types:Re($()).optional(),client_name:$().optional(),client_uri:gr.optional(),logo_uri:HP,scope:$().optional(),contacts:Re($()).optional(),tos_uri:HP,policy_uri:$().optional(),jwks_uri:gr.optional(),jwks:QB().optional(),software_id:$().optional(),software_version:$().optional(),software_statement:$().optional()}).strip(),hae=be({client_id:$(),client_secret:$().optional(),client_id_issued_at:dt().optional(),client_secret_expires_at:dt().optional()}).strip(),Rue=fae.merge(hae);be({error:$(),error_description:$().optional()}).strip();be({token:$(),token_type_hint:$().optional()}).strip();class wr extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class ow extends wr{}ow.errorCode="invalid_request";class iw extends wr{}iw.errorCode="invalid_client";class sw extends wr{}sw.errorCode="invalid_grant";class aw extends wr{}aw.errorCode="unauthorized_client";class lw extends wr{}lw.errorCode="unsupported_grant_type";class cw extends wr{}cw.errorCode="invalid_scope";class uw extends wr{}uw.errorCode="access_denied";class dw extends wr{}dw.errorCode="server_error";class fw extends wr{}fw.errorCode="temporarily_unavailable";class hw extends wr{}hw.errorCode="unsupported_response_type";class pw extends wr{}pw.errorCode="unsupported_token_type";class mw extends wr{}mw.errorCode="invalid_token";class gw extends wr{}gw.errorCode="method_not_allowed";class vw extends wr{}vw.errorCode="too_many_requests";class yw extends wr{}yw.errorCode="invalid_client_metadata";class _w extends wr{}_w.errorCode="insufficient_scope";class bw extends wr{}bw.errorCode="invalid_target";const Oue={[ow.errorCode]:ow,[iw.errorCode]:iw,[sw.errorCode]:sw,[aw.errorCode]:aw,[lw.errorCode]:lw,[cw.errorCode]:cw,[uw.errorCode]:uw,[dw.errorCode]:dw,[fw.errorCode]:fw,[hw.errorCode]:hw,[pw.errorCode]:pw,[mw.errorCode]:mw,[gw.errorCode]:gw,[vw.errorCode]:vw,[yw.errorCode]:yw,[_w.errorCode]:_w,[bw.errorCode]:bw};async function K6(e){if(!e.getServerCapabilities()?.resources)return{resources:[]};try{return await e.listResources()}catch(n){if(n instanceof fv&&n.code===uf.MethodNotFound)return{resources:[]};throw n}}async function pae(e,t){return await e.readResource({uri:t})}function Tue(e){const t=Hn.c(12);let n,r;t[0]!==e?({client:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=cv.mcpResourcesList(n),t[3]=n,t[4]=o):o=t[4];let s;t[5]!==n?(s=()=>K6(n),t[5]=n,t[6]=s):s=t[6];const l=r.staleTime??3e4;let c;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==l?(c={...r,queryKey:o,queryFn:s,staleTime:l,retry:!1},t[7]=r,t[8]=o,t[9]=s,t[10]=l,t[11]=c):c=t[11],ff(c)}function Cue(e){const t=Hn.c(12);let n,r;t[0]!==e?({client:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=cv.mcpResourcesList(n),t[3]=n,t[4]=o):o=t[4];let s;t[5]!==n?(s=()=>K6(n),t[5]=n,t[6]=s):s=t[6];const l=r.staleTime??3e4;let c;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==l?(c={...r,queryKey:o,queryFn:s,staleTime:l,retry:!1},t[7]=r,t[8]=o,t[9]=s,t[10]=l,t[11]=c):c=t[11],yM(c)}function Aue(e){const t=Hn.c(15);let n,r,o;t[0]!==e?({client:n,uri:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o):(n=t[1],r=t[2],o=t[3]);let s;t[4]!==n||t[5]!==o?(s=cv.mcpReadResource(n,o),t[4]=n,t[5]=o,t[6]=s):s=t[6];let l;t[7]!==n||t[8]!==o?(l=()=>pae(n,o),t[7]=n,t[8]=o,t[9]=l):l=t[9];const c=r.staleTime??3e4;let d;return t[10]!==r||t[11]!==s||t[12]!==l||t[13]!==c?(d={...r,queryKey:s,queryFn:l,staleTime:c,retry:!1},t[10]=r,t[11]=s,t[12]=l,t[13]=c,t[14]=d):d=t[14],ff(d)}const Z6="ui-resource-html";function Iue(e){const t=Hn.c(20);let n,r,o,s,l;t[0]!==e?({orgSlug:o,connectionId:n,uri:l,meshUrl:r,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=l):(n=t[1],r=t[2],o=t[3],s=t[4],l=t[5]);let c;t[6]!==n||t[7]!==o||t[8]!==l?(c=cv.mcpUiResourceHtml(o,n,l),t[6]=n,t[7]=o,t[8]=l,t[9]=c):c=t[9];let d;t[10]!==n||t[11]!==r||t[12]!==o||t[13]!==l?(d=async()=>{const g=`${r??(typeof window<"u"?window.location.origin:"")}/api/${encodeURIComponent(o)}/mcp/${encodeURIComponent(n)}/ui-resource?uri=${encodeURIComponent(l)}`,v=await fetch(g,{credentials:"include"});if(!v.ok)throw new Error(`Failed to read UI resource (${v.status})`);return v.text()},t[10]=n,t[11]=r,t[12]=o,t[13]=l,t[14]=d):d=t[14];const f=s.staleTime??3e4;let p;return t[15]!==s||t[16]!==c||t[17]!==d||t[18]!==f?(p={...s,queryKey:c,queryFn:d,staleTime:f,retry:!1},t[15]=s,t[16]=c,t[17]=d,t[18]=f,t[19]=p):p=t[19],ff(p)}const mae=be({authorizationEndpoint:$().url(),tokenEndpoint:$().url(),introspectionEndpoint:$().url().optional(),clientId:$(),clientSecret:$().optional(),scopes:Re($()),grantType:rn(["authorization_code","client_credentials"])}),GP=be({type:Ge("object"),properties:Pt($(),Gt()).optional(),required:Re($()).optional()}).catchall(Gt()),gae=uE.extend({inputSchema:GP,outputSchema:GP.optional()}),vae=be({headers:Pt($(),$()).optional()}),yae=be({command:$().describe("Command to run (e.g., 'npx', 'node')"),args:Re($()).optional().describe("Command arguments"),cwd:$().optional().describe("Working directory"),envVars:Pt($(),$()).optional().describe("Environment variables (encrypted in storage)")}),Y6=be({id:$().describe("Unique identifier for the connection"),title:$().describe("Human-readable name for the connection"),created_at:$().describe("When the connection was created"),updated_at:$().describe("When the connection was last updated"),created_by:$().describe("User ID who created the connection"),updated_by:$().optional().describe("User ID who last updated the connection"),organization_id:$().describe("Organization ID this connection belongs to"),description:$().nullable().describe("Description of the connection"),icon:$().nullable().describe("Icon URL for the connection"),app_name:$().nullable().describe("Associated app name"),app_id:$().nullable().describe("Associated app ID"),slug:$().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:rn(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:$().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:$().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:nn([yae,vae]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:mae.nullable().describe("OAuth configuration"),configuration_state:Pt($(),Gt()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:Re($()).nullable().optional().describe("Configuration scopes"),metadata:Pt($(),Gt()).nullable().describe("Additional metadata (includes repository info)"),tools:Re(gae).nullable().describe("Discovered tools from MCP"),bindings:Re($()).nullable().describe("Detected bindings"),status:rn(["active","inactive","error"]).describe("Current status")});Y6.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:$().nullish()});Y6.partial();function Pue(e){return e!=null&&"command"in e}function Mue(e){return!e||!e.startsWith("virtual://")?null:e.replace("virtual://","")}const Nd=be({connection_id:$().describe("Connection ID"),selected_tools:Re($()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:Re($()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:Re($()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),W6=Nd.extend({selected_tools:Nd.shape.selected_tools.optional(),selected_resources:Nd.shape.selected_resources.optional(),selected_prompts:Nd.shape.selected_prompts.optional()}),_ae=be({connectionId:$(),toolName:$(),label:$(),icon:$().nullable().optional()}),bae=be({id:$().describe("Stable id; used as React key and ?tab= value"),title:$().describe("Tab label"),icon:$().optional().describe("Optional lucide icon name"),view:be({type:Ge("ext-app"),appId:$(),args:Pt($(),Gt()).optional()})}),wae=be({defaultMainView:be({type:$(),id:$().optional(),toolName:$().optional()}).nullable().optional(),chatDefaultOpen:Nt().nullable().optional(),tabs:Re(bae).optional()}),KP=be({tileId:$().optional(),connectionId:$().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:$().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:$().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:Pt($(),Gt()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:dt().int().positive().optional(),maxHeight:dt().int().positive().optional()}),mE=be({banner:$().nullable().optional(),bannerColor:$().nullable().optional(),icon:$().nullable().optional(),themeColor:$().nullable().optional(),pinnedViews:Re(_ae).nullable().optional(),layout:wae.nullable().optional(),homeTile:KP.nullable().optional(),homeTiles:Re(KP).nullable().optional(),homePrompts:Re($()).nullable().optional()});function Nue(e){const t=e?.homeTiles;if(Array.isArray(t)&&t.length>0)return t;const n=e?.homeTile;return n?[n]:[]}const Sae=/^[A-Za-z_][A-Za-z0-9_]*$/,ZP=$().min(1).regex(Sae,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),Eae=qw("kind",[be({key:ZP,kind:Ge("literal"),value:$()}),be({key:ZP,kind:Ge("secret"),secretId:$().min(1)})]),gE=be({selected:$().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:$().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:$().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:Re(Eae).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that mesh resolves via the credential vault before posting /_sandbox/config.")}),vE=be({url:$().describe("GitHub repository URL"),owner:$().describe("Repository owner"),name:$().describe("Repository name"),installationId:dt().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:$().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),xae=rn(["agent-sandbox","user-desktop"]),Rae=rn(["agent-sandbox","user-desktop","cluster"]);function Q6(e){return e==="cluster"?"agent-sandbox":e}const X6={sandboxHandle:$().describe("Provider-specific handle"),previewUrl:$().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:$().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:xae.optional(),createdAt:dt().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:be({packageManager:$().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:$().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:$().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},J6=be(X6),Oae=be({...X6,sandboxProviderKind:Rae.optional()});function Tae(e){const t=Oae.parse(e);return J6.parse({...t,sandboxProviderKind:t.sandboxProviderKind?Q6(t.sandboxProviderKind):void 0})}function kue(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t=e,n={};for(const[r,o]of Object.entries(t)){if(!o||typeof o!="object"||r!=="cluster"&&r!=="agent-sandbox"&&r!=="user-desktop")continue;const s=Q6(r);try{if(r==="cluster"&&n[s])continue;n[s]=Tae(o)}catch{}}return n}const yE=Pt($().describe("userId"),Pt($().describe("branch"),Pt($().describe("sandboxProviderKind"),J6))),Cae=be({id:$().describe("Stable identifier for this knowledge file"),name:$().describe("File name shown in the UI"),kind:rn(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:$().describe("Org filesystem (Library) volume the file lives in"),path:$().describe("Path within the volume"),url:$().describe("Same-origin URL to read the file (display/download)"),contentType:$().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:dt().nullable().optional().describe("File size in bytes"),addedAt:$().describe("ISO timestamp when the file was attached")}),_E=Re(Cae).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),Due=be({id:$().describe("Unique identifier"),title:$().describe("Human-readable name"),description:$().nullable().describe("Description"),icon:$().nullable().describe("Icon URL"),created_at:$().describe("Creation timestamp"),updated_at:$().describe("Last update timestamp"),created_by:$().describe("User ID who created this item"),updated_by:$().optional().describe("User ID who last updated this item"),organization_id:$().describe("Organization ID this item belongs to"),status:rn(["active","inactive"]).describe("Current status"),pinned:Nt().describe("Whether this space is pinned to the sidebar"),metadata:be({instructions:$().nullable().describe("Instructions also used as system prompt"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:mE.nullable().optional().describe("UI customization settings"),githubRepo:vE.nullable().optional().describe("Linked GitHub repository"),runtime:gE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:yE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:_E,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().describe("Metadata"),connections:Re(Nd).describe("Connections with their selected tools, resources, and prompts")}),eL=be({title:$().min(1).max(120).describe("Short label shown on the chip"),description:$().max(280).optional().describe("One-line subtitle shown under the title"),text:$().min(1).describe("The message sent to the agent when the prompt is clicked")});be({title:$().min(1).max(255).describe("Name for the virtual MCP"),description:$().nullable().optional().describe("Optional description"),icon:$().nullish().describe("Optional icon URL"),status:rn(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:Nt().optional().default(!1).describe("Pin to sidebar"),metadata:be({instructions:$().nullable().optional().describe("MCP server instructions"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:mE.nullable().optional().describe("UI customization settings"),githubRepo:vE.nullable().optional().describe("Linked GitHub repository"),runtime:gE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:yE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:_E,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Re(W6).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:Re(eL).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});be({title:$().min(1).max(255).optional().describe("New name"),description:$().nullable().optional().describe("New description (null to clear)"),icon:$().nullish().describe("New icon URL"),status:rn(["active","inactive"]).optional().describe("New status"),pinned:Nt().optional().describe("Pin/unpin from sidebar"),metadata:be({instructions:$().nullable().optional().describe("MCP server instructions"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:mE.nullable().optional().describe("UI customization settings"),githubRepo:vE.nullable().optional().describe("Linked GitHub repository"),runtime:gE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:yE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:_E,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Re(W6).optional().describe("New connections (replaces existing)"),prompts:Re(eL).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});var YP;(function(e){e.Completable="McpCompletable"})(YP||(YP={}));const Aae="mesh-ui-resources",Tg="html",Iae=10080*60*1e3,Pae=50,Mae=16*1024*1024;function Nae(e){return e[0]==="mcp"&&e[1]===Z6}function vv(){return new Promise((e,t)=>{const n=indexedDB.open(Aae,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(Tg)||n.result.createObjectStore(Tg)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}function eu(e,t){return e.transaction(Tg,t).objectStore(Tg)}function ww(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}async function kae(e){if(!(typeof indexedDB>"u"))try{const t=await vv(),n=eu(t,"readonly"),r=await ww(n.getAllKeys()),o=await ww(n.getAll()),s=Date.now(),l=r.map((f,p)=>({key:f,value:o[p]})).sort((f,p)=>(p.value?.updatedAt??0)-(f.value?.updatedAt??0)),c=[];let d=0;for(const{key:f,value:p}of l){if(!p||s-p.updatedAt>Iae||d>=Pae){c.push(f);continue}d++;try{const g=JSON.parse(String(f));e.getQueryData(g)===void 0&&e.setQueryData(g,p.html,{updatedAt:0})}catch{c.push(f)}}if(c.length>0){const f=eu(t,"readwrite");for(const p of c)f.delete(p)}}catch{}}function Dae(e){if(typeof indexedDB>"u")return()=>{};const t=vv().catch(()=>null);return e.getQueryCache().subscribe(n=>{const r=n.query;if(!Array.isArray(r.queryKey)||!Nae(r.queryKey)||r.state.status!=="success")return;const o=r.state.data;typeof o!="string"||o.length>Mae||t.then(s=>{if(s)try{eu(s,"readwrite").put({html:o,updatedAt:Date.now()},JSON.stringify(r.queryKey))}catch{}})})}function Lae(){typeof indexedDB>"u"||vv().then(e=>eu(e,"readwrite").clear()).catch(()=>{})}async function Lue(e){if(!(typeof indexedDB>"u"))try{const t=await vv(),n=await ww(eu(t,"readonly").getAllKeys()),r=eu(t,"readwrite");for(const o of n)try{const s=JSON.parse(String(o));s[1]===Z6&&s[3]===e&&r.delete(o)}catch{}}catch{}}const Cg="mesh:rq-cache",tL=1440*60*1e3,$ae=1e3,jae=new Set(["publicConfig","ai-provider-keys","organization-settings","home-next-actions"]),zae=new Set(["VIRTUAL_MCP","CONNECTIONS"]);let nL=!1,rL=!1;function Uae(e){const t=e[0];return typeof t=="string"&&jae.has(t)?!0:e[3]==="collection"&&typeof e[4]=="string"&&zae.has(e[4])}function Fae(e){if(!(typeof window>"u"))try{const t=window.localStorage.getItem(Cg);if(!t)return;const n=JSON.parse(t),r=!n.timestamp||Date.now()-n.timestamp>tL;if(n.buster!=="4.51.2"||r||!n.state){window.localStorage.removeItem(Cg);return}i8(e,n.state),nL=!0}catch{Vae()}}function Bae(e){if(typeof window>"u")return()=>{};let t=null;const n=()=>{t=null;try{const r=o8(e,{shouldDehydrateQuery:o=>o.state.status==="success"&&Uae(o.queryKey)});window.localStorage.setItem(Cg,JSON.stringify({buster:"4.51.2",timestamp:Date.now(),state:r}))}catch{}};return e.getQueryCache().subscribe(()=>{t==null&&(t=setTimeout(n,$ae))})}const oL="studio:org-cache:";function iL(e){return`${oL}${e}`}function $ue(e,t){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(iL(e));if(!n)return null;const r=JSON.parse(n)[t];return!r||Date.now()-r.updatedAt>tL?null:(rL=!0,r)}catch{return null}}function jue(e,t,n){if(!(typeof window>"u"))try{const r=iL(e),o=window.localStorage.getItem(r),s=o?JSON.parse(o):{};s[t]={data:n,updatedAt:Date.now()},window.localStorage.setItem(r,JSON.stringify(s))}catch{}}function Vae(){if(Lae(),!(typeof window>"u"))try{window.localStorage.removeItem(Cg);for(let e=window.localStorage.length-1;e>=0;e--){const t=window.localStorage.key(e);t?.startsWith(oL)&&window.localStorage.removeItem(t)}}catch{}}function qae(){return nL}function Hae(){return rL}let ps=!1,Sw=null,WP=!1;const bE="mesh:lp-distinct-id",Gae=1440*60*1e3;function sL(){try{const e=window.localStorage.getItem(bE);if(!e)return;const{id:t,ts:n}=JSON.parse(e);return typeof t!="string"||!t||typeof n!="number"?void 0:Date.now()-n<=Gae?t:void 0}catch{return}}function Kae(){try{window.localStorage.removeItem(bE)}catch{}}function Zae(){try{const e=new URL(window.location.href),t=e.searchParams.get("ph_did");t&&(window.localStorage.setItem(bE,JSON.stringify({id:t,ts:Date.now()})),e.searchParams.delete("ph_did"),window.history.replaceState(window.history.state,"",e.toString()));const n=t??sL();return n?Object.keys(window.localStorage).some(o=>o.startsWith("ph_")&&o.endsWith("_posthog"))?void 0:n:void 0}catch{return}}function Yae(e){const t=sL();if(t&&(Kae(),t!==e))try{_l.alias(t)}catch{}}function Wae(e,t){if(ps||typeof window>"u")return;const n=Zae();_l.init(e,{api_host:t,ui_host:"https://us.posthog.com",cross_subdomain_cookie:!0,...n?{bootstrap:{distinctID:n}}:{},capture_pageview:"history_change",capture_pageleave:!0,autocapture:!0,capture_performance:{web_vitals:!0,network_timing:!0},capture_exceptions:!0,session_recording:{maskAllInputs:!0,blockClass:"ph-no-capture"},person_profiles:"identified_only"}),ps=!0}function Qae(e,t){ps&&(_l.identify(e,t),Yae(e))}function Xae(){ps&&(_l.reset(),Sw=null)}function Jae(e,t){ps&&_l.capture(e,t)}function zue(){return ps}function Uue(){if(!ps||WP||typeof performance>"u")return;WP=!0;const e=performance.getEntriesByType("navigation")[0],t=n=>{const r=performance.getEntriesByName(n,"measure")[0];return r?Math.round(r.duration):void 0};Jae("perf_app_bootstrap",{nav_type:e?.type,ttfb_ms:e?Math.round(e.responseStart):void 0,dom_interactive_ms:e?Math.round(e.domInteractive):void 0,dom_content_loaded_ms:e?Math.round(e.domContentLoadedEventEnd):void 0,config_fetch_ms:t("mesh:config-fetch"),active_org_fetch_ms:t("mesh:active-org-fetch"),time_to_shell_ms:Math.round(performance.now()),cache_restored:qae(),org_cache_restored:Hae()})}function Fue(e,t){ps&&e!==Sw&&(_l.group("organization",e,t),Sw=e)}function aL(e,t){if(ps)try{_l.captureException(e,t)}catch{}}let hm=null;function ele({children:e}){const t=bM(),{data:n}=Vg.useSession();if(t.posthog){Wae(t.posthog.key,t.posthog.host);const r=n?.user?.id??null;r&&r!==hm?(Qae(r,{email:n?.user?.email,name:n?.user?.name}),hm=r):!r&&hm&&(Xae(),hm=null)}return C.jsx(C.Fragment,{children:e})}const wE=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));wE.displayName="AlertTriangle";const lL=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M4 7.997a2.295 2.295 0 0 1-.39-.035A2 2 0 0 1 2.038 6.39C2 6.197 2 5.965 2 5.5s0-.697.038-.89A2 2 0 0 1 3.61 3.038C3.803 3 4.035 3 4.5 3h15c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89s0 .697-.038.89a2 2 0 0 1-1.572 1.572c-.107.02-.226.03-.39.035M10 13h4M4 8h16v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 21 16.88 21 15.2 21H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 18.72 4 17.88 4 16.2V8Z"}));lL.displayName="Archive";const SE=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M12 2.25v2.5M12 18v4M5.75 12h-3.5m19 0h-1.5m-1.293 6.457-.707-.707m.914-12.334L17.25 6.83M4.922 19.078 7.75 16.25M5.129 5.209 7.25 7.33"}));SE.displayName="Loading01";const cL=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M17 10V8A5 5 0 0 0 7 8v2m5 4.5v2M8.8 21h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 18.72 20 17.88 20 16.2v-1.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 10 16.88 10 15.2 10H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 12.28 4 13.12 4 14.8v1.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 21 7.12 21 8.8 21Z"}));cL.displayName="Lock01";const uL=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M21 10s-2.005-2.732-3.634-4.362a9 9 0 1 0 2.282 8.862M21 10V4m0 6h-6"}));uL.displayName="RefreshCw01";function EE(){const e=Hn.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=C.jsx("div",{className:"flex items-center justify-center min-h-screen w-full",children:C.jsx(SE,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=t):t=e[0],t}function tle(e){try{return JSON.parse(e)}catch{return}}function QP(e,t){const n=localStorage.getItem(e),r=n?tle(n):void 0,o=typeof t=="function"?t(r):r??t;if(r===void 0||o!==r)try{const s=JSON.stringify(o);localStorage.setItem(e,s)}catch{}return o}function nle(e,t){const n=Hn.c(25),r=Iw();let o;n[0]!==e?(o=["localStorage",e],n[0]=e,n[1]=o):o=n[1];const s=o;let l,c;n[2]!==t||n[3]!==e?(l=()=>QP(e,t),c=()=>QP(e,t),n[2]=t,n[3]=e,n[4]=l,n[5]=c):(l=n[4],c=n[5]);let d;n[6]!==s||n[7]!==l||n[8]!==c?(d={queryKey:s,queryFn:l,initialData:c,staleTime:1/0,gcTime:1/0},n[6]=s,n[7]=l,n[8]=c,n[9]=d):d=n[9];const{data:f}=yM(d);let p;n[10]!==e?(p=async E=>{const T=JSON.stringify(E);return localStorage.setItem(e,T),E},n[10]=e,n[11]=p):p=n[11];let h;n[12]!==r||n[13]!==s?(h=E=>{r.setQueryData(s,E)},n[12]=r,n[13]=s,n[14]=h):h=n[14];let g;n[15]!==p||n[16]!==h?(g={mutationFn:p,onSuccess:h},n[15]=p,n[16]=h,n[17]=g):g=n[17];const v=A8(g);let _;n[18]!==v||n[19]!==r||n[20]!==s?(_=E=>{const T=r.getQueryData(s),R=typeof E=="function"?E(T):E;v.mutate(R)},n[18]=v,n[19]=r,n[20]=s,n[21]=_):_=n[21];const b=_,x=f;let S;return n[22]!==b||n[23]!==x?(S=[x,b],n[22]=b,n[23]=x,n[24]=S):S=n[24],S}const su={chatSelectedImageModel:e=>`mesh:chat:selectedImageModel:${e}`,chatSelectedWebSearchModel:e=>`mesh:chat:selectedWebSearchModel:${e}`,chatSelectedDeepResearchModel:e=>`mesh:chat:selectedDeepResearchModel:${e}`,chatSimpleModeTier:e=>`mesh:chat:simpleModeTier:${e}`,chatLastAgentOption:e=>`mesh:chat:lastAgentOption:${e}`,chatAutosend:(e,t)=>`mesh:chat:autosend:${e}:${t}`,chatDraft:(e,t)=>`mesh:chat:draft:${e}:${t}`,sidePanelWidth:()=>"mesh:side-panel:width",sidebarOpen:()=>"mesh:sidebar-open",preferences:()=>"mesh:user:preferences",lastOrgSlug:()=>"mesh:last-org-slug",lastLocation:()=>"mesh:last-location",connectionsTab:e=>`mesh:connections:tab:${e}`,taskLastViewed:e=>`mesh:chat:task-last-viewed:${e}`,sidebarGroupOrder:(e,t)=>`sidebar.group-order.${e}.${t}`},rle={toolApprovalLevel:"auto",enableNotifications:typeof Notification<"u",enableSounds:!1,theme:"system"},dL=["auto","readonly"],Bue=[{value:"readonly",label:"Ask before edit",short:"Ask"},{value:"auto",label:"Auto approve",short:"Auto"}],ole=["light","dark","system"];function Vue(){try{const e=JSON.parse(localStorage.getItem(su.preferences())??"{}");if(dL.includes(e.toolApprovalLevel))return e.toolApprovalLevel}catch{}return"auto"}function ile(){const e=Hn.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=su.preferences(),e[0]=t):t=e[0],nle(t,sle)}function sle(e){const t={...rle,...e};return dL.includes(t.toolApprovalLevel)||(t.toolApprovalLevel="auto"),ole.includes(t.theme)||(t.theme="system"),t}async function ale(){performance.mark("mesh:config-fetch:start");try{const e=await fetch("/api/config");if(!e.ok)throw new Error("Failed to load public configuration");const t=await e.json();if(!t.success)throw new Error(t.error||"Failed to load public configuration");return t.config}finally{performance.mark("mesh:config-fetch:end"),performance.measure("mesh:config-fetch","mesh:config-fetch:start","mesh:config-fetch:end")}}function lle(e){if(!e)return;const t=document.getElementById("mesh-theme-overrides");t&&t.remove();const n=[];if(e.light&&Object.keys(e.light).length>0){const r=Object.entries(e.light).map(([o,s])=>` ${o}: ${s};`).join(`
|
|
163
|
+
deps: ${p}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[f,p]=s(d);l(d,f),c(d,p)}};function s({schema:d}){const f={},p={};for(const h in d){if(h==="__proto__")continue;const g=Array.isArray(d[h])?f:p;g[h]=d[h]}return[f,p]}function l(d,f=d.schema){const{gen:p,data:h,it:g}=d;if(Object.keys(f).length===0)return;const v=p.let("missing");for(const _ in f){const b=f[_];if(b.length===0)continue;const x=(0,r.propertyInData)(p,h,_,g.opts.ownProperties);d.setParams({property:_,depsCount:b.length,deps:b.join(", ")}),g.allErrors?p.if(x,()=>{for(const S of b)(0,r.checkReportMissingProp)(d,S)}):(p.if((0,t._)`${x} && (${(0,r.checkMissingProp)(d,b,v)})`),(0,r.reportMissingProp)(d,v),p.else())}}e.validatePropertyDeps=l;function c(d,f=d.schema){const{gen:p,data:h,keyword:g,it:v}=d,_=p.name("valid");for(const b in f)(0,n.alwaysValidSchema)(v,f[b])||(p.if((0,r.propertyInData)(p,h,b,v.opts.ownProperties),()=>{const x=d.subschema({keyword:g,schemaProp:b},_);d.mergeValidEvaluated(x,_)},()=>p.var(_,!0)),d.ok(_))}e.validateSchemaDeps=c,e.default=o})(xb)),xb}var Jp={},xP;function Mse(){if(xP)return Jp;xP=1,Object.defineProperty(Jp,"__esModule",{value:!0});const e=yt(),t=kt(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:o})=>(0,e._)`{propertyName: ${o.propertyName}}`},code(o){const{gen:s,schema:l,data:c,it:d}=o;if((0,t.alwaysValidSchema)(d,l))return;const f=s.name("valid");s.forIn("key",c,p=>{o.setParams({propertyName:p}),o.subschema({keyword:"propertyNames",data:p,dataTypes:["string"],propertyName:p,compositeRule:!0},f),s.if((0,e.not)(f),()=>{o.error(!0),d.allErrors||s.break()})}),o.ok(f)}};return Jp.default=r,Jp}var em={},RP;function G6(){if(RP)return em;RP=1,Object.defineProperty(em,"__esModule",{value:!0});const e=li(),t=yt(),n=wa(),r=kt(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:c,schema:d,parentSchema:f,data:p,errsCount:h,it:g}=l;if(!h)throw new Error("ajv implementation error");const{allErrors:v,opts:_}=g;if(g.props=!0,_.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(g,d))return;const b=(0,e.allSchemaProperties)(f.properties),x=(0,e.allSchemaProperties)(f.patternProperties);S(),l.ok((0,t._)`${h} === ${n.default.errors}`);function S(){c.forIn("key",p,A=>{!b.length&&!x.length?R(A):c.if(E(A),()=>R(A))})}function E(A){let I;if(b.length>8){const M=(0,r.schemaRefOrVal)(g,f.properties,"properties");I=(0,e.isOwnProperty)(c,M,A)}else b.length?I=(0,t.or)(...b.map(M=>(0,t._)`${A} === ${M}`)):I=t.nil;return x.length&&(I=(0,t.or)(I,...x.map(M=>(0,t._)`${(0,e.usePattern)(l,M)}.test(${A})`))),(0,t.not)(I)}function T(A){c.code((0,t._)`delete ${p}[${A}]`)}function R(A){if(_.removeAdditional==="all"||_.removeAdditional&&d===!1){T(A);return}if(d===!1){l.setParams({additionalProperty:A}),l.error(),v||c.break();return}if(typeof d=="object"&&!(0,r.alwaysValidSchema)(g,d)){const I=c.name("valid");_.removeAdditional==="failing"?(O(A,I,!1),c.if((0,t.not)(I),()=>{l.reset(),T(A)})):(O(A,I),v||c.if((0,t.not)(I),()=>c.break()))}}function O(A,I,M){const L={keyword:"additionalProperties",dataProp:A,dataPropType:r.Type.Str};M===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(L,I)}}};return em.default=s,em}var tm={},OP;function Nse(){if(OP)return tm;OP=1,Object.defineProperty(tm,"__esModule",{value:!0});const e=mv(),t=li(),n=kt(),r=G6(),o={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:l,schema:c,parentSchema:d,data:f,it:p}=s;p.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(p,r.default,"additionalProperties"));const h=(0,t.allSchemaProperties)(c);for(const x of h)p.definedProperties.add(x);p.opts.unevaluated&&h.length&&p.props!==!0&&(p.props=n.mergeEvaluated.props(l,(0,n.toHash)(h),p.props));const g=h.filter(x=>!(0,n.alwaysValidSchema)(p,c[x]));if(g.length===0)return;const v=l.name("valid");for(const x of g)_(x)?b(x):(l.if((0,t.propertyInData)(l,f,x,p.opts.ownProperties)),b(x),p.allErrors||l.else().var(v,!0),l.endIf()),s.it.definedProperties.add(x),s.ok(v);function _(x){return p.opts.useDefaults&&!p.compositeRule&&c[x].default!==void 0}function b(x){s.subschema({keyword:"properties",schemaProp:x,dataProp:x},v)}}};return tm.default=o,tm}var nm={},TP;function kse(){if(TP)return nm;TP=1,Object.defineProperty(nm,"__esModule",{value:!0});const e=li(),t=yt(),n=kt(),r=kt(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:l,schema:c,data:d,parentSchema:f,it:p}=s,{opts:h}=p,g=(0,e.allSchemaProperties)(c),v=g.filter(R=>(0,n.alwaysValidSchema)(p,c[R]));if(g.length===0||v.length===g.length&&(!p.opts.unevaluated||p.props===!0))return;const _=h.strictSchema&&!h.allowMatchingProperties&&f.properties,b=l.name("valid");p.props!==!0&&!(p.props instanceof t.Name)&&(p.props=(0,r.evaluatedPropsToName)(l,p.props));const{props:x}=p;S();function S(){for(const R of g)_&&E(R),p.allErrors?T(R):(l.var(b,!0),T(R),l.if(b))}function E(R){for(const O in _)new RegExp(R).test(O)&&(0,n.checkStrictMode)(p,`property ${O} matches pattern ${R} (use allowMatchingProperties)`)}function T(R){l.forIn("key",d,O=>{l.if((0,t._)`${(0,e.usePattern)(s,R)}.test(${O})`,()=>{const A=v.includes(R);A||s.subschema({keyword:"patternProperties",schemaProp:R,dataProp:O,dataPropType:r.Type.Str},b),p.opts.unevaluated&&x!==!0?l.assign((0,t._)`${x}[${O}]`,!0):!A&&!p.allErrors&&l.if((0,t.not)(b),()=>l.break())})})}}};return nm.default=o,nm}var rm={},CP;function Dse(){if(CP)return rm;CP=1,Object.defineProperty(rm,"__esModule",{value:!0});const e=kt(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:o,it:s}=n;if((0,e.alwaysValidSchema)(s,o)){n.fail();return}const l=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return rm.default=t,rm}var om={},AP;function Lse(){if(AP)return om;AP=1,Object.defineProperty(om,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:li().validateUnion,error:{message:"must match a schema in anyOf"}};return om.default=t,om}var im={},IP;function $se(){if(IP)return im;IP=1,Object.defineProperty(im,"__esModule",{value:!0});const e=yt(),t=kt(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:o})=>(0,e._)`{passingSchemas: ${o.passing}}`},code(o){const{gen:s,schema:l,parentSchema:c,it:d}=o;if(!Array.isArray(l))throw new Error("ajv implementation error");if(d.opts.discriminator&&c.discriminator)return;const f=l,p=s.let("valid",!1),h=s.let("passing",null),g=s.name("_valid");o.setParams({passing:h}),s.block(v),o.result(p,()=>o.reset(),()=>o.error(!0));function v(){f.forEach((_,b)=>{let x;(0,t.alwaysValidSchema)(d,_)?s.var(g,!0):x=o.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},g),b>0&&s.if((0,e._)`${g} && ${p}`).assign(p,!1).assign(h,(0,e._)`[${h}, ${b}]`).else(),s.if(g,()=>{s.assign(p,!0),s.assign(h,b),x&&o.mergeEvaluated(x,e.Name)})})}}};return im.default=r,im}var sm={},PP;function jse(){if(PP)return sm;PP=1,Object.defineProperty(sm,"__esModule",{value:!0});const e=kt(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:o,it:s}=n;if(!Array.isArray(o))throw new Error("ajv implementation error");const l=r.name("valid");o.forEach((c,d)=>{if((0,e.alwaysValidSchema)(s,c))return;const f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};return sm.default=t,sm}var am={},MP;function zse(){if(MP)return am;MP=1,Object.defineProperty(am,"__esModule",{value:!0});const e=yt(),t=kt(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:l,parentSchema:c,it:d}=s;c.then===void 0&&c.else===void 0&&(0,t.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const f=o(d,"then"),p=o(d,"else");if(!f&&!p)return;const h=l.let("valid",!0),g=l.name("_valid");if(v(),s.reset(),f&&p){const b=l.let("ifClause");s.setParams({ifClause:b}),l.if(g,_("then",b),_("else",b))}else f?l.if(g,_("then")):l.if((0,e.not)(g),_("else"));s.pass(h,()=>s.error(!0));function v(){const b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(b)}function _(b,x){return()=>{const S=s.subschema({keyword:b},g);l.assign(h,g),s.mergeValidEvaluated(S,h),x?l.assign(x,(0,e._)`${b}`):s.setParams({ifClause:b})}}}};function o(s,l){const c=s.schema[l];return c!==void 0&&!(0,t.alwaysValidSchema)(s,c)}return am.default=r,am}var lm={},NP;function Use(){if(NP)return lm;NP=1,Object.defineProperty(lm,"__esModule",{value:!0});const e=kt(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:o}){r.if===void 0&&(0,e.checkStrictMode)(o,`"${n}" without "if" is ignored`)}};return lm.default=t,lm}var kP;function Fse(){if(kP)return Yp;kP=1,Object.defineProperty(Yp,"__esModule",{value:!0});const e=q6(),t=Cse(),n=H6(),r=Ase(),o=Ise(),s=Pse(),l=Mse(),c=G6(),d=Nse(),f=kse(),p=Dse(),h=Lse(),g=$se(),v=jse(),_=zse(),b=Use();function x(S=!1){const E=[p.default,h.default,g.default,v.default,_.default,b.default,l.default,c.default,s.default,d.default,f.default];return S?E.push(t.default,r.default):E.push(e.default,n.default),E.push(o.default),E}return Yp.default=x,Yp}var cm={},um={},DP;function Bse(){if(DP)return um;DP=1,Object.defineProperty(um,"__esModule",{value:!0});const e=yt(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,o){const{gen:s,data:l,$data:c,schema:d,schemaCode:f,it:p}=r,{opts:h,errSchemaPath:g,schemaEnv:v,self:_}=p;if(!h.validateFormats)return;c?b():x();function b(){const S=s.scopeValue("formats",{ref:_.formats,code:h.code.formats}),E=s.const("fDef",(0,e._)`${S}[${f}]`),T=s.let("fType"),R=s.let("format");s.if((0,e._)`typeof ${E} == "object" && !(${E} instanceof RegExp)`,()=>s.assign(T,(0,e._)`${E}.type || "string"`).assign(R,(0,e._)`${E}.validate`),()=>s.assign(T,(0,e._)`"string"`).assign(R,E)),r.fail$data((0,e.or)(O(),A()));function O(){return h.strictSchema===!1?e.nil:(0,e._)`${f} && !${R}`}function A(){const I=v.$async?(0,e._)`(${E}.async ? await ${R}(${l}) : ${R}(${l}))`:(0,e._)`${R}(${l})`,M=(0,e._)`(typeof ${R} == "function" ? ${I} : ${R}.test(${l}))`;return(0,e._)`${R} && ${R} !== true && ${T} === ${o} && !${M}`}}function x(){const S=_.formats[d];if(!S){O();return}if(S===!0)return;const[E,T,R]=A(S);E===o&&r.pass(I());function O(){if(h.strictSchema===!1){_.logger.warn(M());return}throw new Error(M());function M(){return`unknown format "${d}" ignored in schema at path "${g}"`}}function A(M){const L=M instanceof RegExp?(0,e.regexpCode)(M):h.code.formats?(0,e._)`${h.code.formats}${(0,e.getProperty)(d)}`:void 0,q=s.scopeValue("formats",{key:d,ref:M,code:L});return typeof M=="object"&&!(M instanceof RegExp)?[M.type||"string",M.validate,(0,e._)`${q}.validate`]:["string",M,q]}function I(){if(typeof S=="object"&&!(S instanceof RegExp)&&S.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${R}(${l})`}return typeof T=="function"?(0,e._)`${R}(${l})`:(0,e._)`${R}.test(${l})`}}}};return um.default=n,um}var LP;function Vse(){if(LP)return cm;LP=1,Object.defineProperty(cm,"__esModule",{value:!0});const t=[Bse().default];return cm.default=t,cm}var Ya={},$P;function qse(){return $P||($P=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.contentVocabulary=Ya.metadataVocabulary=void 0,Ya.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ya.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ya}var jP;function Hse(){if(jP)return Np;jP=1,Object.defineProperty(Np,"__esModule",{value:!0});const e=mse(),t=Tse(),n=Fse(),r=Vse(),o=qse(),s=[e.default,t.default,(0,n.default)(),r.default,o.metadataVocabulary,o.contentVocabulary];return Np.default=s,Np}var dm={},bd={},zP;function Gse(){if(zP)return bd;zP=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(bd.DiscrError=e={})),bd}var UP;function Kse(){if(UP)return dm;UP=1,Object.defineProperty(dm,"__esModule",{value:!0});const e=yt(),t=Gse(),n=fE(),r=gv(),o=kt(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:d}})=>c===t.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:c,tag:d,tagName:f}})=>(0,e._)`{error: ${c}, tag: ${f}, tagValue: ${d}}`},code(c){const{gen:d,data:f,schema:p,parentSchema:h,it:g}=c,{oneOf:v}=h;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");const _=p.propertyName;if(typeof _!="string")throw new Error("discriminator: requires propertyName");if(p.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const b=d.let("valid",!1),x=d.const("tag",(0,e._)`${f}${(0,e.getProperty)(_)}`);d.if((0,e._)`typeof ${x} == "string"`,()=>S(),()=>c.error(!1,{discrError:t.DiscrError.Tag,tag:x,tagName:_})),c.ok(b);function S(){const R=T();d.if(!1);for(const O in R)d.elseIf((0,e._)`${x} === ${O}`),d.assign(b,E(R[O]));d.else(),c.error(!1,{discrError:t.DiscrError.Mapping,tag:x,tagName:_}),d.endIf()}function E(R){const O=d.name("valid"),A=c.subschema({keyword:"oneOf",schemaProp:R},O);return c.mergeEvaluated(A,e.Name),O}function T(){var R;const O={},A=M(h);let I=!0;for(let j=0;j<v.length;j++){let B=v[j];if(B?.$ref&&!(0,o.schemaHasRulesButRef)(B,g.self.RULES)){const Z=B.$ref;if(B=n.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,Z),B instanceof n.SchemaEnv&&(B=B.schema),B===void 0)throw new r.default(g.opts.uriResolver,g.baseId,Z)}const F=(R=B?.properties)===null||R===void 0?void 0:R[_];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);I=I&&(A||M(B)),L(F,j)}if(!I)throw new Error(`discriminator: "${_}" must be required`);return O;function M({required:j}){return Array.isArray(j)&&j.includes(_)}function L(j,B){if(j.const)q(j.const,B);else if(j.enum)for(const F of j.enum)q(F,B);else throw new Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function q(j,B){if(typeof j!="string"||j in O)throw new Error(`discriminator: "${_}" values must be unique strings`);O[j]=B}}}};return dm.default=l,dm}const Zse="http://json-schema.org/draft-07/schema#",Yse="http://json-schema.org/draft-07/schema#",Wse="Core schema meta-schema",Qse={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Xse=["object","boolean"],Jse={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},eae={$schema:Zse,$id:Yse,title:Wse,definitions:Qse,type:Xse,properties:Jse,default:!0};var FP;function tae(){return FP||(FP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=fse(),r=Hse(),o=Kse(),s=eae,l=["/properties"],c="http://json-schema.org/draft-07/schema";class d extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(s,l):s;this.addMetaSchema(_,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var f=mv();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var p=yt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=dE();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var g=gv();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})(Cp,Cp.exports)),Cp.exports}var fm={exports:{}},Rb={},BP;function nae(){return BP||(BP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,B){return{validate:j,compare:B}}e.fullFormats={date:t(s,l),time:t(d(!0),f),"date-time":t(g(!0),v),"iso-time":t(d(),p),"iso-date-time":t(g(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:S,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:q,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:T,int32:{type:"number",validate:A},int64:{type:"number",validate:I},float:{type:"number",validate:M},double:{type:"number",validate:M},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,l),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(j){return j%4===0&&(j%100!==0||j%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){const B=r.exec(j);if(!B)return!1;const F=+B[1],Z=+B[2],ie=+B[3];return Z>=1&&Z<=12&&ie>=1&&ie<=(Z===2&&n(F)?29:o[Z])}function l(j,B){if(j&&B)return j>B?1:j<B?-1:0}const c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function d(j){return function(F){const Z=c.exec(F);if(!Z)return!1;const ie=+Z[1],H=+Z[2],W=+Z[3],te=Z[4],le=Z[5]==="-"?-1:1,Q=+(Z[6]||0),k=+(Z[7]||0);if(Q>23||k>59||j&&!te)return!1;if(ie<=23&&H<=59&&W<60)return!0;const G=H-k*le,V=ie-Q*le-(G<0?1:0);return(V===23||V===-1)&&(G===59||G===-1)&&W<61}}function f(j,B){if(!(j&&B))return;const F=new Date("2020-01-01T"+j).valueOf(),Z=new Date("2020-01-01T"+B).valueOf();if(F&&Z)return F-Z}function p(j,B){if(!(j&&B))return;const F=c.exec(j),Z=c.exec(B);if(F&&Z)return j=F[1]+F[2]+F[3],B=Z[1]+Z[2]+Z[3],j>B?1:j<B?-1:0}const h=/t|\s/i;function g(j){const B=d(j);return function(Z){const ie=Z.split(h);return ie.length===2&&s(ie[0])&&B(ie[1])}}function v(j,B){if(!(j&&B))return;const F=new Date(j).valueOf(),Z=new Date(B).valueOf();if(F&&Z)return F-Z}function _(j,B){if(!(j&&B))return;const[F,Z]=j.split(h),[ie,H]=B.split(h),W=l(F,ie);if(W!==void 0)return W||f(Z,H)}const b=/\/|:/,x=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function S(j){return b.test(j)&&x.test(j)}const E=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function T(j){return E.lastIndex=0,E.test(j)}const R=-2147483648,O=2**31-1;function A(j){return Number.isInteger(j)&&j<=O&&j>=R}function I(j){return Number.isInteger(j)}function M(){return!0}const L=/[^\\]\\Z/;function q(j){if(L.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(Rb)),Rb}var Ob={},VP;function rae(){return VP||(VP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=tae(),n=yt(),r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:c,schemaCode:d})=>(0,n.str)`should be ${o[c].okStr} ${d}`,params:({keyword:c,schemaCode:d})=>(0,n._)`{comparison: ${o[c].okStr}, limit: ${d}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(c){const{gen:d,data:f,schemaCode:p,keyword:h,it:g}=c,{opts:v,self:_}=g;if(!v.validateFormats)return;const b=new t.KeywordCxt(g,_.RULES.all.format.definition,"format");b.$data?x():S();function x(){const T=d.scopeValue("formats",{ref:_.formats,code:v.code.formats}),R=d.const("fmt",(0,n._)`${T}[${b.schemaCode}]`);c.fail$data((0,n.or)((0,n._)`typeof ${R} != "object"`,(0,n._)`${R} instanceof RegExp`,(0,n._)`typeof ${R}.compare != "function"`,E(R)))}function S(){const T=b.schema,R=_.formats[T];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${h}": format "${T}" does not define "compare" function`);const O=d.scopeValue("formats",{key:T,ref:R,code:v.code.formats?(0,n._)`${v.code.formats}${(0,n.getProperty)(T)}`:void 0});c.fail$data(E(O))}function E(T){return(0,n._)`${T}.compare(${f}, ${p}) ${o[h].fail} 0`}},dependencies:["format"]};const l=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=l})(Ob)),Ob}var qP;function oae(){return qP||(qP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=nae(),r=rae(),o=yt(),s=new o.Name("fullFormats"),l=new o.Name("fastFormats"),c=(f,p={keywords:!0})=>{if(Array.isArray(p))return d(f,p,n.fullFormats,s),f;const[h,g]=p.mode==="fast"?[n.fastFormats,l]:[n.fullFormats,s],v=p.formats||n.formatNames;return d(f,v,h,g),p.keywords&&(0,r.default)(f),f};c.get=(f,p="full")=>{const g=(p==="fast"?n.fastFormats:n.fullFormats)[f];if(!g)throw new Error(`Unknown format "${f}"`);return g};function d(f,p,h,g){var v,_;(v=(_=f.opts.code).formats)!==null&&v!==void 0||(_.formats=(0,o._)`require("ajv-formats/dist/formats").${g}`);for(const b of p)f.addFormat(b,h[b])}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c})(fm,fm.exports)),fm.exports}var iae=oae();const _ue=fl(iae);let pE;pE=globalThis.crypto;async function sae(e){return(await pE).getRandomValues(new Uint8Array(e))}async function aae(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const o=await sae(e-r.length);for(const s of o)s<n&&(r+=t[s%t.length])}return r}async function lae(e){return await aae(e)}async function cae(e){const t=await(await pE).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function bue(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await lae(e),n=await cae(t);return{code_verifier:t,code_challenge:n}}const gr=IB().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:RV.custom,message:"URL must be parseable",fatal:!0}),A9}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),wue=vr({resource:$().url(),authorization_servers:Re(gr).optional(),jwks_uri:$().url().optional(),scopes_supported:Re($()).optional(),bearer_methods_supported:Re($()).optional(),resource_signing_alg_values_supported:Re($()).optional(),resource_name:$().optional(),resource_documentation:$().optional(),resource_policy_uri:$().url().optional(),resource_tos_uri:$().url().optional(),tls_client_certificate_bound_access_tokens:Nt().optional(),authorization_details_types_supported:Re($()).optional(),dpop_signing_alg_values_supported:Re($()).optional(),dpop_bound_access_tokens_required:Nt().optional()}),uae=vr({issuer:$(),authorization_endpoint:gr,token_endpoint:gr,registration_endpoint:gr.optional(),scopes_supported:Re($()).optional(),response_types_supported:Re($()),response_modes_supported:Re($()).optional(),grant_types_supported:Re($()).optional(),token_endpoint_auth_methods_supported:Re($()).optional(),token_endpoint_auth_signing_alg_values_supported:Re($()).optional(),service_documentation:gr.optional(),revocation_endpoint:gr.optional(),revocation_endpoint_auth_methods_supported:Re($()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Re($()).optional(),introspection_endpoint:$().optional(),introspection_endpoint_auth_methods_supported:Re($()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Re($()).optional(),code_challenge_methods_supported:Re($()).optional(),client_id_metadata_document_supported:Nt().optional()}),dae=vr({issuer:$(),authorization_endpoint:gr,token_endpoint:gr,userinfo_endpoint:gr.optional(),jwks_uri:gr,registration_endpoint:gr.optional(),scopes_supported:Re($()).optional(),response_types_supported:Re($()),response_modes_supported:Re($()).optional(),grant_types_supported:Re($()).optional(),acr_values_supported:Re($()).optional(),subject_types_supported:Re($()),id_token_signing_alg_values_supported:Re($()),id_token_encryption_alg_values_supported:Re($()).optional(),id_token_encryption_enc_values_supported:Re($()).optional(),userinfo_signing_alg_values_supported:Re($()).optional(),userinfo_encryption_alg_values_supported:Re($()).optional(),userinfo_encryption_enc_values_supported:Re($()).optional(),request_object_signing_alg_values_supported:Re($()).optional(),request_object_encryption_alg_values_supported:Re($()).optional(),request_object_encryption_enc_values_supported:Re($()).optional(),token_endpoint_auth_methods_supported:Re($()).optional(),token_endpoint_auth_signing_alg_values_supported:Re($()).optional(),display_values_supported:Re($()).optional(),claim_types_supported:Re($()).optional(),claims_supported:Re($()).optional(),service_documentation:$().optional(),claims_locales_supported:Re($()).optional(),ui_locales_supported:Re($()).optional(),claims_parameter_supported:Nt().optional(),request_parameter_supported:Nt().optional(),request_uri_parameter_supported:Nt().optional(),require_request_uri_registration:Nt().optional(),op_policy_uri:gr.optional(),op_tos_uri:gr.optional(),client_id_metadata_document_supported:Nt().optional()}),Sue=be({...dae.shape,...uae.pick({code_challenge_methods_supported:!0}).shape}),Eue=be({access_token:$(),id_token:$().optional(),token_type:$(),expires_in:nN().optional(),scope:$().optional(),refresh_token:$().optional()}).strip(),xue=be({error:$(),error_description:$().optional(),error_uri:$().optional()}),HP=gr.optional().or(Ge("").transform(()=>{})),fae=be({redirect_uris:Re(gr),token_endpoint_auth_method:$().optional(),grant_types:Re($()).optional(),response_types:Re($()).optional(),client_name:$().optional(),client_uri:gr.optional(),logo_uri:HP,scope:$().optional(),contacts:Re($()).optional(),tos_uri:HP,policy_uri:$().optional(),jwks_uri:gr.optional(),jwks:QB().optional(),software_id:$().optional(),software_version:$().optional(),software_statement:$().optional()}).strip(),hae=be({client_id:$(),client_secret:$().optional(),client_id_issued_at:dt().optional(),client_secret_expires_at:dt().optional()}).strip(),Rue=fae.merge(hae);be({error:$(),error_description:$().optional()}).strip();be({token:$(),token_type_hint:$().optional()}).strip();class wr extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class ow extends wr{}ow.errorCode="invalid_request";class iw extends wr{}iw.errorCode="invalid_client";class sw extends wr{}sw.errorCode="invalid_grant";class aw extends wr{}aw.errorCode="unauthorized_client";class lw extends wr{}lw.errorCode="unsupported_grant_type";class cw extends wr{}cw.errorCode="invalid_scope";class uw extends wr{}uw.errorCode="access_denied";class dw extends wr{}dw.errorCode="server_error";class fw extends wr{}fw.errorCode="temporarily_unavailable";class hw extends wr{}hw.errorCode="unsupported_response_type";class pw extends wr{}pw.errorCode="unsupported_token_type";class mw extends wr{}mw.errorCode="invalid_token";class gw extends wr{}gw.errorCode="method_not_allowed";class vw extends wr{}vw.errorCode="too_many_requests";class yw extends wr{}yw.errorCode="invalid_client_metadata";class _w extends wr{}_w.errorCode="insufficient_scope";class bw extends wr{}bw.errorCode="invalid_target";const Oue={[ow.errorCode]:ow,[iw.errorCode]:iw,[sw.errorCode]:sw,[aw.errorCode]:aw,[lw.errorCode]:lw,[cw.errorCode]:cw,[uw.errorCode]:uw,[dw.errorCode]:dw,[fw.errorCode]:fw,[hw.errorCode]:hw,[pw.errorCode]:pw,[mw.errorCode]:mw,[gw.errorCode]:gw,[vw.errorCode]:vw,[yw.errorCode]:yw,[_w.errorCode]:_w,[bw.errorCode]:bw};async function K6(e){if(!e.getServerCapabilities()?.resources)return{resources:[]};try{return await e.listResources()}catch(n){if(n instanceof fv&&n.code===uf.MethodNotFound)return{resources:[]};throw n}}async function pae(e,t){return await e.readResource({uri:t})}function Tue(e){const t=Hn.c(12);let n,r;t[0]!==e?({client:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=cv.mcpResourcesList(n),t[3]=n,t[4]=o):o=t[4];let s;t[5]!==n?(s=()=>K6(n),t[5]=n,t[6]=s):s=t[6];const l=r.staleTime??3e4;let c;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==l?(c={...r,queryKey:o,queryFn:s,staleTime:l,retry:!1},t[7]=r,t[8]=o,t[9]=s,t[10]=l,t[11]=c):c=t[11],ff(c)}function Cue(e){const t=Hn.c(12);let n,r;t[0]!==e?({client:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=cv.mcpResourcesList(n),t[3]=n,t[4]=o):o=t[4];let s;t[5]!==n?(s=()=>K6(n),t[5]=n,t[6]=s):s=t[6];const l=r.staleTime??3e4;let c;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==l?(c={...r,queryKey:o,queryFn:s,staleTime:l,retry:!1},t[7]=r,t[8]=o,t[9]=s,t[10]=l,t[11]=c):c=t[11],yM(c)}function Aue(e){const t=Hn.c(15);let n,r,o;t[0]!==e?({client:n,uri:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o):(n=t[1],r=t[2],o=t[3]);let s;t[4]!==n||t[5]!==o?(s=cv.mcpReadResource(n,o),t[4]=n,t[5]=o,t[6]=s):s=t[6];let l;t[7]!==n||t[8]!==o?(l=()=>pae(n,o),t[7]=n,t[8]=o,t[9]=l):l=t[9];const c=r.staleTime??3e4;let d;return t[10]!==r||t[11]!==s||t[12]!==l||t[13]!==c?(d={...r,queryKey:s,queryFn:l,staleTime:c,retry:!1},t[10]=r,t[11]=s,t[12]=l,t[13]=c,t[14]=d):d=t[14],ff(d)}const Z6="ui-resource-html";function Iue(e){const t=Hn.c(20);let n,r,o,s,l;t[0]!==e?({orgSlug:o,connectionId:n,uri:l,meshUrl:r,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=l):(n=t[1],r=t[2],o=t[3],s=t[4],l=t[5]);let c;t[6]!==n||t[7]!==o||t[8]!==l?(c=cv.mcpUiResourceHtml(o,n,l),t[6]=n,t[7]=o,t[8]=l,t[9]=c):c=t[9];let d;t[10]!==n||t[11]!==r||t[12]!==o||t[13]!==l?(d=async()=>{const g=`${r??(typeof window<"u"?window.location.origin:"")}/api/${encodeURIComponent(o)}/mcp/${encodeURIComponent(n)}/ui-resource?uri=${encodeURIComponent(l)}`,v=await fetch(g,{credentials:"include"});if(!v.ok)throw new Error(`Failed to read UI resource (${v.status})`);return v.text()},t[10]=n,t[11]=r,t[12]=o,t[13]=l,t[14]=d):d=t[14];const f=s.staleTime??3e4;let p;return t[15]!==s||t[16]!==c||t[17]!==d||t[18]!==f?(p={...s,queryKey:c,queryFn:d,staleTime:f,retry:!1},t[15]=s,t[16]=c,t[17]=d,t[18]=f,t[19]=p):p=t[19],ff(p)}const mae=be({authorizationEndpoint:$().url(),tokenEndpoint:$().url(),introspectionEndpoint:$().url().optional(),clientId:$(),clientSecret:$().optional(),scopes:Re($()),grantType:an(["authorization_code","client_credentials"])}),GP=be({type:Ge("object"),properties:Pt($(),Gt()).optional(),required:Re($()).optional()}).catchall(Gt()),gae=uE.extend({inputSchema:GP,outputSchema:GP.optional()}),vae=be({headers:Pt($(),$()).optional()}),yae=be({command:$().describe("Command to run (e.g., 'npx', 'node')"),args:Re($()).optional().describe("Command arguments"),cwd:$().optional().describe("Working directory"),envVars:Pt($(),$()).optional().describe("Environment variables (encrypted in storage)")}),Y6=be({id:$().describe("Unique identifier for the connection"),title:$().describe("Human-readable name for the connection"),created_at:$().describe("When the connection was created"),updated_at:$().describe("When the connection was last updated"),created_by:$().describe("User ID who created the connection"),updated_by:$().optional().describe("User ID who last updated the connection"),organization_id:$().describe("Organization ID this connection belongs to"),description:$().nullable().describe("Description of the connection"),icon:$().nullable().describe("Icon URL for the connection"),app_name:$().nullable().describe("Associated app name"),app_id:$().nullable().describe("Associated app ID"),slug:$().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:an(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:$().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:$().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:nn([yae,vae]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:mae.nullable().describe("OAuth configuration"),configuration_state:Pt($(),Gt()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:Re($()).nullable().optional().describe("Configuration scopes"),metadata:Pt($(),Gt()).nullable().describe("Additional metadata (includes repository info)"),tools:Re(gae).nullable().describe("Discovered tools from MCP"),bindings:Re($()).nullable().describe("Detected bindings"),status:an(["active","inactive","error"]).describe("Current status")});Y6.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:$().nullish()});Y6.partial();function Pue(e){return e!=null&&"command"in e}function Mue(e){return!e||!e.startsWith("virtual://")?null:e.replace("virtual://","")}const Nd=be({connection_id:$().describe("Connection ID"),selected_tools:Re($()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:Re($()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:Re($()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),W6=Nd.extend({selected_tools:Nd.shape.selected_tools.optional(),selected_resources:Nd.shape.selected_resources.optional(),selected_prompts:Nd.shape.selected_prompts.optional()}),_ae=be({connectionId:$(),toolName:$(),label:$(),icon:$().nullable().optional()}),bae=be({id:$().describe("Stable id; used as React key and ?tab= value"),title:$().describe("Tab label"),icon:$().optional().describe("Optional lucide icon name"),view:be({type:Ge("ext-app"),appId:$(),args:Pt($(),Gt()).optional()})}),wae=be({defaultMainView:be({type:$(),id:$().optional(),toolName:$().optional()}).nullable().optional(),chatDefaultOpen:Nt().nullable().optional(),tabs:Re(bae).optional()}),KP=be({tileId:$().optional(),connectionId:$().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:$().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:$().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:Pt($(),Gt()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:dt().int().positive().optional(),maxHeight:dt().int().positive().optional()}),mE=be({banner:$().nullable().optional(),bannerColor:$().nullable().optional(),icon:$().nullable().optional(),themeColor:$().nullable().optional(),pinnedViews:Re(_ae).nullable().optional(),layout:wae.nullable().optional(),homeTile:KP.nullable().optional(),homeTiles:Re(KP).nullable().optional(),homePrompts:Re($()).nullable().optional()});function Nue(e){const t=e?.homeTiles;if(Array.isArray(t)&&t.length>0)return t;const n=e?.homeTile;return n?[n]:[]}const Sae=/^[A-Za-z_][A-Za-z0-9_]*$/,ZP=$().min(1).regex(Sae,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),Eae=qw("kind",[be({key:ZP,kind:Ge("literal"),value:$()}),be({key:ZP,kind:Ge("secret"),secretId:$().min(1)})]),gE=be({selected:$().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:$().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:$().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:Re(Eae).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that mesh resolves via the credential vault before posting /_sandbox/config.")}),vE=be({url:$().describe("GitHub repository URL"),owner:$().describe("Repository owner"),name:$().describe("Repository name"),installationId:dt().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:$().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),xae=an(["agent-sandbox","user-desktop"]),Rae=an(["agent-sandbox","user-desktop","cluster"]);function Q6(e){return e==="cluster"?"agent-sandbox":e}const X6={sandboxHandle:$().describe("Provider-specific handle"),previewUrl:$().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:$().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:xae.optional(),createdAt:dt().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:be({packageManager:$().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:$().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:$().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},J6=be(X6),Oae=be({...X6,sandboxProviderKind:Rae.optional()});function Tae(e){const t=Oae.parse(e);return J6.parse({...t,sandboxProviderKind:t.sandboxProviderKind?Q6(t.sandboxProviderKind):void 0})}function kue(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t=e,n={};for(const[r,o]of Object.entries(t)){if(!o||typeof o!="object"||r!=="cluster"&&r!=="agent-sandbox"&&r!=="user-desktop")continue;const s=Q6(r);try{if(r==="cluster"&&n[s])continue;n[s]=Tae(o)}catch{}}return n}const yE=Pt($().describe("userId"),Pt($().describe("branch"),Pt($().describe("sandboxProviderKind"),J6))),Cae=be({id:$().describe("Stable identifier for this knowledge file"),name:$().describe("File name shown in the UI"),kind:an(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:$().describe("Org filesystem (Library) volume the file lives in"),path:$().describe("Path within the volume"),url:$().describe("Same-origin URL to read the file (display/download)"),contentType:$().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:dt().nullable().optional().describe("File size in bytes"),addedAt:$().describe("ISO timestamp when the file was attached")}),_E=Re(Cae).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),Due=be({id:$().describe("Unique identifier"),title:$().describe("Human-readable name"),description:$().nullable().describe("Description"),icon:$().nullable().describe("Icon URL"),created_at:$().describe("Creation timestamp"),updated_at:$().describe("Last update timestamp"),created_by:$().describe("User ID who created this item"),updated_by:$().optional().describe("User ID who last updated this item"),organization_id:$().describe("Organization ID this item belongs to"),status:an(["active","inactive"]).describe("Current status"),pinned:Nt().describe("Whether this space is pinned to the sidebar"),metadata:be({instructions:$().nullable().describe("Instructions also used as system prompt"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:mE.nullable().optional().describe("UI customization settings"),githubRepo:vE.nullable().optional().describe("Linked GitHub repository"),runtime:gE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:yE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:_E,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().describe("Metadata"),connections:Re(Nd).describe("Connections with their selected tools, resources, and prompts")}),eL=be({title:$().min(1).max(120).describe("Short label shown on the chip"),description:$().max(280).optional().describe("One-line subtitle shown under the title"),text:$().min(1).describe("The message sent to the agent when the prompt is clicked")});be({title:$().min(1).max(255).describe("Name for the virtual MCP"),description:$().nullable().optional().describe("Optional description"),icon:$().nullish().describe("Optional icon URL"),status:an(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:Nt().optional().default(!1).describe("Pin to sidebar"),metadata:be({instructions:$().nullable().optional().describe("MCP server instructions"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:mE.nullable().optional().describe("UI customization settings"),githubRepo:vE.nullable().optional().describe("Linked GitHub repository"),runtime:gE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:yE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:_E,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Re(W6).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:Re(eL).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});be({title:$().min(1).max(255).optional().describe("New name"),description:$().nullable().optional().describe("New description (null to clear)"),icon:$().nullish().describe("New icon URL"),status:an(["active","inactive"]).optional().describe("New status"),pinned:Nt().optional().describe("Pin/unpin from sidebar"),metadata:be({instructions:$().nullable().optional().describe("MCP server instructions"),enabled_plugins:Re($()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:Re($()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:$().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:mE.nullable().optional().describe("UI customization settings"),githubRepo:vE.nullable().optional().describe("Linked GitHub repository"),runtime:gE.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:yE.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:_E,siteSlug:$().nullable().optional().describe("Linked asset site slug (managed storage tenancy)")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Re(W6).optional().describe("New connections (replaces existing)"),prompts:Re(eL).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});var YP;(function(e){e.Completable="McpCompletable"})(YP||(YP={}));const Aae="mesh-ui-resources",Tg="html",Iae=10080*60*1e3,Pae=50,Mae=16*1024*1024;function Nae(e){return e[0]==="mcp"&&e[1]===Z6}function vv(){return new Promise((e,t)=>{const n=indexedDB.open(Aae,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(Tg)||n.result.createObjectStore(Tg)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}function eu(e,t){return e.transaction(Tg,t).objectStore(Tg)}function ww(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}async function kae(e){if(!(typeof indexedDB>"u"))try{const t=await vv(),n=eu(t,"readonly"),r=await ww(n.getAllKeys()),o=await ww(n.getAll()),s=Date.now(),l=r.map((f,p)=>({key:f,value:o[p]})).sort((f,p)=>(p.value?.updatedAt??0)-(f.value?.updatedAt??0)),c=[];let d=0;for(const{key:f,value:p}of l){if(!p||s-p.updatedAt>Iae||d>=Pae){c.push(f);continue}d++;try{const g=JSON.parse(String(f));e.getQueryData(g)===void 0&&e.setQueryData(g,p.html,{updatedAt:0})}catch{c.push(f)}}if(c.length>0){const f=eu(t,"readwrite");for(const p of c)f.delete(p)}}catch{}}function Dae(e){if(typeof indexedDB>"u")return()=>{};const t=vv().catch(()=>null);return e.getQueryCache().subscribe(n=>{const r=n.query;if(!Array.isArray(r.queryKey)||!Nae(r.queryKey)||r.state.status!=="success")return;const o=r.state.data;typeof o!="string"||o.length>Mae||t.then(s=>{if(s)try{eu(s,"readwrite").put({html:o,updatedAt:Date.now()},JSON.stringify(r.queryKey))}catch{}})})}function Lae(){typeof indexedDB>"u"||vv().then(e=>eu(e,"readwrite").clear()).catch(()=>{})}async function Lue(e){if(!(typeof indexedDB>"u"))try{const t=await vv(),n=await ww(eu(t,"readonly").getAllKeys()),r=eu(t,"readwrite");for(const o of n)try{const s=JSON.parse(String(o));s[1]===Z6&&s[3]===e&&r.delete(o)}catch{}}catch{}}const Cg="mesh:rq-cache",tL=1440*60*1e3,$ae=1e3,jae=new Set(["publicConfig","ai-provider-keys","organization-settings","home-next-actions"]),zae=new Set(["VIRTUAL_MCP","CONNECTIONS"]);let nL=!1,rL=!1;function Uae(e){const t=e[0];return typeof t=="string"&&jae.has(t)?!0:e[3]==="collection"&&typeof e[4]=="string"&&zae.has(e[4])}function Fae(e){if(!(typeof window>"u"))try{const t=window.localStorage.getItem(Cg);if(!t)return;const n=JSON.parse(t),r=!n.timestamp||Date.now()-n.timestamp>tL;if(n.buster!=="4.52.1"||r||!n.state){window.localStorage.removeItem(Cg);return}i8(e,n.state),nL=!0}catch{Vae()}}function Bae(e){if(typeof window>"u")return()=>{};let t=null;const n=()=>{t=null;try{const r=o8(e,{shouldDehydrateQuery:o=>o.state.status==="success"&&Uae(o.queryKey)});window.localStorage.setItem(Cg,JSON.stringify({buster:"4.52.1",timestamp:Date.now(),state:r}))}catch{}};return e.getQueryCache().subscribe(()=>{t==null&&(t=setTimeout(n,$ae))})}const oL="studio:org-cache:";function iL(e){return`${oL}${e}`}function $ue(e,t){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(iL(e));if(!n)return null;const r=JSON.parse(n)[t];return!r||Date.now()-r.updatedAt>tL?null:(rL=!0,r)}catch{return null}}function jue(e,t,n){if(!(typeof window>"u"))try{const r=iL(e),o=window.localStorage.getItem(r),s=o?JSON.parse(o):{};s[t]={data:n,updatedAt:Date.now()},window.localStorage.setItem(r,JSON.stringify(s))}catch{}}function Vae(){if(Lae(),!(typeof window>"u"))try{window.localStorage.removeItem(Cg);for(let e=window.localStorage.length-1;e>=0;e--){const t=window.localStorage.key(e);t?.startsWith(oL)&&window.localStorage.removeItem(t)}}catch{}}function qae(){return nL}function Hae(){return rL}let ps=!1,Sw=null,WP=!1;const bE="mesh:lp-distinct-id",Gae=1440*60*1e3;function sL(){try{const e=window.localStorage.getItem(bE);if(!e)return;const{id:t,ts:n}=JSON.parse(e);return typeof t!="string"||!t||typeof n!="number"?void 0:Date.now()-n<=Gae?t:void 0}catch{return}}function Kae(){try{window.localStorage.removeItem(bE)}catch{}}function Zae(){try{const e=new URL(window.location.href),t=e.searchParams.get("ph_did");t&&(window.localStorage.setItem(bE,JSON.stringify({id:t,ts:Date.now()})),e.searchParams.delete("ph_did"),window.history.replaceState(window.history.state,"",e.toString()));const n=t??sL();return n?Object.keys(window.localStorage).some(o=>o.startsWith("ph_")&&o.endsWith("_posthog"))?void 0:n:void 0}catch{return}}function Yae(e){const t=sL();if(t&&(Kae(),t!==e))try{_l.alias(t)}catch{}}function Wae(e,t){if(ps||typeof window>"u")return;const n=Zae();_l.init(e,{api_host:t,ui_host:"https://us.posthog.com",cross_subdomain_cookie:!0,...n?{bootstrap:{distinctID:n}}:{},capture_pageview:"history_change",capture_pageleave:!0,autocapture:!0,capture_performance:{web_vitals:!0,network_timing:!0},capture_exceptions:!0,session_recording:{maskAllInputs:!0,blockClass:"ph-no-capture"},person_profiles:"identified_only"}),ps=!0}function Qae(e,t){ps&&(_l.identify(e,t),Yae(e))}function Xae(){ps&&(_l.reset(),Sw=null)}function Jae(e,t){ps&&_l.capture(e,t)}function zue(){return ps}function Uue(){if(!ps||WP||typeof performance>"u")return;WP=!0;const e=performance.getEntriesByType("navigation")[0],t=n=>{const r=performance.getEntriesByName(n,"measure")[0];return r?Math.round(r.duration):void 0};Jae("perf_app_bootstrap",{nav_type:e?.type,ttfb_ms:e?Math.round(e.responseStart):void 0,dom_interactive_ms:e?Math.round(e.domInteractive):void 0,dom_content_loaded_ms:e?Math.round(e.domContentLoadedEventEnd):void 0,config_fetch_ms:t("mesh:config-fetch"),active_org_fetch_ms:t("mesh:active-org-fetch"),time_to_shell_ms:Math.round(performance.now()),cache_restored:qae(),org_cache_restored:Hae()})}function Fue(e,t){ps&&e!==Sw&&(_l.group("organization",e,t),Sw=e)}function aL(e,t){if(ps)try{_l.captureException(e,t)}catch{}}let hm=null;function ele({children:e}){const t=bM(),{data:n}=Vg.useSession();if(t.posthog){Wae(t.posthog.key,t.posthog.host);const r=n?.user?.id??null;r&&r!==hm?(Qae(r,{email:n?.user?.email,name:n?.user?.name}),hm=r):!r&&hm&&(Xae(),hm=null)}return C.jsx(C.Fragment,{children:e})}const wE=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));wE.displayName="AlertTriangle";const lL=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M4 7.997a2.295 2.295 0 0 1-.39-.035A2 2 0 0 1 2.038 6.39C2 6.197 2 5.965 2 5.5s0-.697.038-.89A2 2 0 0 1 3.61 3.038C3.803 3 4.035 3 4.5 3h15c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89s0 .697-.038.89a2 2 0 0 1-1.572 1.572c-.107.02-.226.03-.39.035M10 13h4M4 8h16v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 21 16.88 21 15.2 21H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 18.72 4 17.88 4 16.2V8Z"}));lL.displayName="Archive";const SE=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M12 2.25v2.5M12 18v4M5.75 12h-3.5m19 0h-1.5m-1.293 6.457-.707-.707m.914-12.334L17.25 6.83M4.922 19.078 7.75 16.25M5.129 5.209 7.25 7.33"}));SE.displayName="Loading01";const cL=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M17 10V8A5 5 0 0 0 7 8v2m5 4.5v2M8.8 21h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 18.72 20 17.88 20 16.2v-1.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 10 16.88 10 15.2 10H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 12.28 4 13.12 4 14.8v1.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 21 7.12 21 8.8 21Z"}));cL.displayName="Lock01";const uL=({size:e=24,color:t="currentColor",...n})=>P.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},P.createElement("path",{d:"M21 10s-2.005-2.732-3.634-4.362a9 9 0 1 0 2.282 8.862M21 10V4m0 6h-6"}));uL.displayName="RefreshCw01";function EE(){const e=Hn.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=C.jsx("div",{className:"flex items-center justify-center min-h-screen w-full",children:C.jsx(SE,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=t):t=e[0],t}function tle(e){try{return JSON.parse(e)}catch{return}}function QP(e,t){const n=localStorage.getItem(e),r=n?tle(n):void 0,o=typeof t=="function"?t(r):r??t;if(r===void 0||o!==r)try{const s=JSON.stringify(o);localStorage.setItem(e,s)}catch{}return o}function nle(e,t){const n=Hn.c(25),r=Iw();let o;n[0]!==e?(o=["localStorage",e],n[0]=e,n[1]=o):o=n[1];const s=o;let l,c;n[2]!==t||n[3]!==e?(l=()=>QP(e,t),c=()=>QP(e,t),n[2]=t,n[3]=e,n[4]=l,n[5]=c):(l=n[4],c=n[5]);let d;n[6]!==s||n[7]!==l||n[8]!==c?(d={queryKey:s,queryFn:l,initialData:c,staleTime:1/0,gcTime:1/0},n[6]=s,n[7]=l,n[8]=c,n[9]=d):d=n[9];const{data:f}=yM(d);let p;n[10]!==e?(p=async E=>{const T=JSON.stringify(E);return localStorage.setItem(e,T),E},n[10]=e,n[11]=p):p=n[11];let h;n[12]!==r||n[13]!==s?(h=E=>{r.setQueryData(s,E)},n[12]=r,n[13]=s,n[14]=h):h=n[14];let g;n[15]!==p||n[16]!==h?(g={mutationFn:p,onSuccess:h},n[15]=p,n[16]=h,n[17]=g):g=n[17];const v=A8(g);let _;n[18]!==v||n[19]!==r||n[20]!==s?(_=E=>{const T=r.getQueryData(s),R=typeof E=="function"?E(T):E;v.mutate(R)},n[18]=v,n[19]=r,n[20]=s,n[21]=_):_=n[21];const b=_,x=f;let S;return n[22]!==b||n[23]!==x?(S=[x,b],n[22]=b,n[23]=x,n[24]=S):S=n[24],S}const su={chatSelectedImageModel:e=>`mesh:chat:selectedImageModel:${e}`,chatSelectedWebSearchModel:e=>`mesh:chat:selectedWebSearchModel:${e}`,chatSelectedDeepResearchModel:e=>`mesh:chat:selectedDeepResearchModel:${e}`,chatSimpleModeTier:e=>`mesh:chat:simpleModeTier:${e}`,chatLastAgentOption:e=>`mesh:chat:lastAgentOption:${e}`,chatAutosend:(e,t)=>`mesh:chat:autosend:${e}:${t}`,chatDraft:(e,t)=>`mesh:chat:draft:${e}:${t}`,sidePanelWidth:()=>"mesh:side-panel:width",sidebarOpen:()=>"mesh:sidebar-open",preferences:()=>"mesh:user:preferences",lastOrgSlug:()=>"mesh:last-org-slug",lastLocation:()=>"mesh:last-location",connectionsTab:e=>`mesh:connections:tab:${e}`,taskLastViewed:e=>`mesh:chat:task-last-viewed:${e}`,sidebarGroupOrder:(e,t)=>`sidebar.group-order.${e}.${t}`},rle={toolApprovalLevel:"auto",enableNotifications:typeof Notification<"u",enableSounds:!1,theme:"system"},dL=["auto","readonly"],Bue=[{value:"readonly",label:"Ask before edit",short:"Ask"},{value:"auto",label:"Auto approve",short:"Auto"}],ole=["light","dark","system"];function Vue(){try{const e=JSON.parse(localStorage.getItem(su.preferences())??"{}");if(dL.includes(e.toolApprovalLevel))return e.toolApprovalLevel}catch{}return"auto"}function ile(){const e=Hn.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=su.preferences(),e[0]=t):t=e[0],nle(t,sle)}function sle(e){const t={...rle,...e};return dL.includes(t.toolApprovalLevel)||(t.toolApprovalLevel="auto"),ole.includes(t.theme)||(t.theme="system"),t}async function ale(){performance.mark("mesh:config-fetch:start");try{const e=await fetch("/api/config");if(!e.ok)throw new Error("Failed to load public configuration");const t=await e.json();if(!t.success)throw new Error(t.error||"Failed to load public configuration");return t.config}finally{performance.mark("mesh:config-fetch:end"),performance.measure("mesh:config-fetch","mesh:config-fetch:start","mesh:config-fetch:end")}}function lle(e){if(!e)return;const t=document.getElementById("mesh-theme-overrides");t&&t.remove();const n=[];if(e.light&&Object.keys(e.light).length>0){const r=Object.entries(e.light).map(([o,s])=>` ${o}: ${s};`).join(`
|
|
164
164
|
`);n.push(`:root {
|
|
165
165
|
${r}
|
|
166
166
|
}`)}if(e.dark&&Object.keys(e.dark).length>0){const r=Object.entries(e.dark).map(([o,s])=>` ${o}: ${s};`).join(`
|
|
@@ -168,4 +168,4 @@ ${r}
|
|
|
168
168
|
${r}
|
|
169
169
|
}`)}if(n.length>0){const r=document.createElement("style");r.id="mesh-theme-overrides",r.textContent=n.join(`
|
|
170
170
|
|
|
171
|
-
`),document.head.appendChild(r)}}function cle(e){const t=Hn.c(9),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:_M.publicConfig(),queryFn:ale,staleTime:1/0},t[0]=r):r=t[0];const{data:o}=ff(r),[s]=ile();let l,c;t[1]!==o.theme?(l=()=>{lle(o.theme)},c=[o.theme],t[1]=o.theme,t[2]=l,t[3]=c):(l=t[2],c=t[3]),P.useLayoutEffect(l,c);let d,f;t[4]!==s.theme?(d=()=>{const h=document.documentElement,g=()=>{const x=document.querySelector('meta[name="theme-color"]');if(!x)return;const S=getComputedStyle(h).getPropertyValue("--sidebar").trim();if(!S)return;const E=document.createElement("canvas").getContext("2d");if(!E)return;E.fillStyle="#010203";const T=E.fillStyle;E.fillStyle=S;const R=E.fillStyle;R!==T&&(x.content=R)};if(s.theme==="dark"){h.classList.add("dark"),g();return}if(s.theme==="light"){h.classList.remove("dark"),g();return}const v=window.matchMedia("(prefers-color-scheme: dark)"),_=x=>{h.classList.toggle("dark",x),g()};_(v.matches);const b=x=>_(x.matches);return v.addEventListener("change",b),()=>v.removeEventListener("change",b)},f=[s.theme],t[4]=s.theme,t[5]=d,t[6]=f):(d=t[5],f=t[6]),P.useLayoutEffect(d,f);let p;return t[7]!==n?(p=C.jsx(C.Fragment,{children:n}),t[7]=n,t[8]=p):p=t[8],p}const Mf=new y8({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!0,refetchOnMount:!0,retry:1,gcTime:300*1e3}}});Fae(Mf);Bae(Mf);kae(Mf);Dae(Mf);function ule(e){const t=Hn.c(4),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=C.jsx(OG,{}),t[0]=r):r=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=C.jsx(EE,{}),t[1]=o):o=t[1];let s;return t[2]!==n?(s=C.jsxs(_8,{client:Mf,children:[r,C.jsx(P.Suspense,{fallback:o,children:C.jsx(cle,{children:C.jsx(P8,{children:C.jsx(ene,{children:C.jsx(ele,{children:n})})})})})]}),t[2]=n,t[3]=s):s=t[3],s}function xE(){const e=Hn.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=C.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 h-full w-full flex items-center justify-center",children:C.jsx(SE,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=t):t=e[0],t}function dle(...e){return IN(Yw(e))}const fle=e4("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:hover:bg-input/50 card-shadow",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",special:"bg-special text-special-foreground hover:bg-special/90 focus-visible:ring-special/20 dark:focus-visible:ring-special/40",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground"},size:{default:"h-8 px-3 has-[>svg]:px-2.5",sm:"h-7 gap-1.5 px-2.5 has-[>svg]:px-2",xs:"h-6 gap-1 px-1.5 text-xs has-[>svg]:px-1",lg:"h-10 px-3.5 has-[>svg]:px-3",xl:"h-12 px-4 has-[>svg]:px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}});function df(e){const t=Hn.c(14);let n,r,o,s,l;t[0]!==e?({className:n,variant:l,size:o,asChild:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=l):(n=t[1],r=t[2],o=t[3],s=t[4],l=t[5]);const d=(s===void 0?!1:s)?sS:"button";let f;t[6]!==n||t[7]!==o||t[8]!==l?(f=dle(fle({variant:l,size:o,className:n})),t[6]=n,t[7]=o,t[8]=l,t[9]=f):f=t[9];let p;return t[10]!==d||t[11]!==r||t[12]!==f?(p=C.jsx(d,{"data-slot":"button",className:f,...r}),t[10]=d,t[11]=r,t[12]=f,t[13]=p):p=t[13],p}const hle=["radial-gradient(ellipse 85% 85% at 0% 0%, rgba(165,149,255,0.6) 0%, transparent 72%)","radial-gradient(ellipse 85% 85% at 100% 100%, rgba(208,236,26,0.52) 0%, transparent 72%)","radial-gradient(ellipse 85% 85% at 0% 100%, rgba(255,193,22,0.48) 0%, transparent 72%)"].join(", ");function ple(e){const t=Hn.c(3),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=C.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:hle}}),t[0]=r):r=t[0];let o;return t[1]!==n?(o=C.jsxs("div",{className:"relative flex items-center justify-center min-h-screen bg-background overflow-hidden",children:[r,C.jsx("div",{className:"relative flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:n})]}),t[1]=n,t[2]=o):o=t[2],o}function fL(e){const t=Hn.c(9),{orgName:n}=e,r=mle;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=C.jsx("div",{className:"bg-muted p-3 rounded-full",children:C.jsx(lL,{className:"h-6 w-6 text-muted-foreground"})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=C.jsx("h3",{className:"text-lg font-medium",children:"Organization unavailable"}),t[1]=s):s=t[1];let l;t[2]!==n?(l=n?C.jsxs(C.Fragment,{children:[C.jsx("strong",{children:n})," has been deleted or is no longer available."]}):"This organization has been deleted or is no longer available.",t[2]=n,t[3]=l):l=t[3];let c;t[4]!==l?(c=C.jsxs("div",{className:"space-y-2",children:[s,C.jsx("p",{className:"text-sm text-muted-foreground",children:l})]}),t[4]=l,t[5]=c):c=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=C.jsx(df,{onClick:r,children:"Go to home"}),t[6]=d):d=t[6];let f;return t[7]!==c?(f=C.jsxs(ple,{children:[o,c,d]}),t[7]=c,t[8]=f):f=t[8],f}function mle(){window.location.href="/"}function gle(){const e=Hn.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/shell/$org"},e[0]=t):t=e[0];const{org:n}=Lw(t);let r;return e[1]!==n?(r=C.jsx(df,{variant:"outline",size:"sm",asChild:!0,children:C.jsx(Dg,{to:"/$org/settings/profile",params:{org:n},children:"Go to your profile"})}),e[1]=n,e[2]=r):r=e[2],r}function vle(e){const t=Hn.c(13),{area:n,description:r,action:o}=e,s=n?`No access to ${n}`:"No access",l=r??"Your role doesn't include permission for this section. Ask an organization admin to update your role if you need it.";let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=C.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:C.jsx(cL,{size:28})}),t[0]=c):c=t[0];let d;t[1]!==s?(d=C.jsx("h3",{className:"text-lg font-medium",children:s}),t[1]=s,t[2]=d):d=t[2];let f;t[3]!==l?(f=C.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:l}),t[3]=l,t[4]=f):f=t[4];let p;t[5]!==d||t[6]!==f?(p=C.jsxs("div",{className:"space-y-1",children:[d,f]}),t[5]=d,t[6]=f,t[7]=p):p=t[7];let h;t[8]!==o?(h=o??C.jsx(gle,{}),t[8]=o,t[9]=h):h=t[9];let g;return t[10]!==p||t[11]!==h?(g=C.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[c,p,h]}),t[10]=p,t[11]=h,t[12]=g):g=t[12],g}const XP="__mesh_chunk_reload_ts";function hL(e){return e?.message==="Organization is archived"}function yle(e){return!!e?.message?.includes("Access denied")}function JP(e){if(!e)return!1;const t=e.message||"";return t.includes("Failed to fetch dynamically imported module")||t.includes("Importing a module script failed")||t.includes("error loading dynamically imported module")||t.includes("Failed to fetch")&&e.name==="TypeError"}class que extends P.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),aL(t,{boundary:"default",error_name:t.name,error_message:t.message,component_stack:n.componentStack??null,route:typeof window<"u"?window.location.pathname:null})}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:t}=this.props;return typeof t=="function"?t({error:this.state.error,resetError:this.resetError}):t!==void 0?t:hL(this.state.error)?C.jsx(fL,{}):yle(this.state.error)?C.jsx(vle,{}):C.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:C.jsx(wE,{className:"h-6 w-6 text-destructive"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),C.jsx(df,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}class _le extends P.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n);const r=JP(t);if(aL(t,{boundary:"chunk_root",is_chunk_load_error:r,error_name:t.name,error_message:t.message,component_stack:n.componentStack??null,route:typeof window<"u"?window.location.pathname:null}),!r)return;const o=sessionStorage.getItem(XP),s=Date.now();(!o||s-Number(o)>1e4)&&(sessionStorage.setItem(XP,String(s)),window.location.reload())}render(){return this.state.hasError&&JP(this.state.error)?C.jsxs("div",{className:"flex min-h-dvh flex-col items-center justify-center p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:C.jsx(uL,{className:"h-6 w-6 text-primary"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"New version available"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:"A new version has been deployed. Refresh to continue."})]}),C.jsx(df,{onClick:()=>window.location.reload(),children:"Refresh"})]}):this.state.hasError?hL(this.state.error)?C.jsx(fL,{}):C.jsxs("div",{className:"flex min-h-dvh flex-col items-center justify-center p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:C.jsx(wE,{className:"h-6 w-6 text-destructive"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),C.jsx(df,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}function pL(e){try{localStorage.setItem(su.lastLocation(),JSON.stringify(e))}catch{}}function ble(){try{const e=localStorage.getItem(su.lastLocation());if(!e)return null;const t=JSON.parse(e);if(typeof t?.org=="string")return{org:t.org,taskId:typeof t.taskId=="string"?t.taskId:void 0,virtualmcpid:typeof t.virtualmcpid=="string"?t.virtualmcpid:void 0}}catch{}return null}function Hue(){try{localStorage.removeItem(su.lastLocation())}catch{}}let us=null,eM=!1;const Ew=new Set;function Ag(){for(const e of Ew)e()}function wle(){eM||typeof window>"u"||(eM=!0,window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),us=e,Ag()}),window.addEventListener("appinstalled",()=>{us=null,Ag()}))}function Gue(){us!==null&&(us=null,Ag())}function Sle(e){return Ew.add(e),()=>{Ew.delete(e)}}function Ele(){return us}function xle(){return null}function Rle(){if(typeof window>"u")return!1;const e=typeof window.matchMedia=="function"&&["(display-mode: standalone)","(display-mode: window-controls-overlay)"].some(n=>window.matchMedia(n).matches),t=navigator.standalone===!0;return e||t}function Ole(){if(typeof navigator>"u")return!1;const e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)?!0:e.includes("Macintosh")&&typeof document<"u"&&"ontouchend"in document}function Kue(){const e=Hn.c(5),t=P.useSyncExternalStore(Sle,Ele,xle);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rle(),e[0]=n):n=e[0];const r=n,o=t!==null&&!r;let s,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=Ole(),l=Tle,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let c;return e[3]!==o?(c={canPrompt:o,installed:r,ios:s,promptInstall:l},e[3]=o,e[4]=c):c=e[4],c}async function Tle(){if(!us)return"unavailable";await us.prompt();const e=await us.userChoice;return us=null,Ag(),e.outcome}const ci=s9({component:()=>C.jsx(_le,{children:C.jsx(ule,{children:C.jsx(P.Suspense,{fallback:C.jsx(EE,{}),children:C.jsx(WM,{})})})})}),Cle=st({getParentRoute:()=>ci,path:"/login",component:ht(()=>ft(()=>import("./login-BNl3DyrG.js"),__vite__mapDeps([0,1,2,3,4,5]))),validateSearch:ya(()=>be({next:$().optional(),client_id:$().optional(),redirect_uri:$().optional(),response_type:$().optional(),state:$().optional(),scope:$().optional(),code_challenge:$().optional(),code_challenge_method:$().optional()}))}),Ale=st({getParentRoute:()=>ci,path:"/cli/auth-success",component:ht(()=>ft(()=>import("./cli-auth-success-0s8PkjYa.js"),__vite__mapDeps([6,5])))}),Ile=st({getParentRoute:()=>ci,path:"/reset-password",component:ht(()=>ft(()=>import("./reset-password-Dsq-8-D_.js"),__vite__mapDeps([7,2]))),validateSearch:ya(()=>be({token:$().optional(),error:$().optional()}))}),Ple=st({getParentRoute:()=>ci,path:"/auth/$pathname",component:ht(()=>ft(()=>import("./auth-catchall-JbJLOIeZ.js"),[]))}),Mle=st({getParentRoute:()=>ci,path:"/oauth/callback",component:ht(()=>ft(()=>import("./oauth-callback-Dl7hbaaA.js"),__vite__mapDeps([8,9,10])))}),Nle=st({getParentRoute:()=>ci,path:"/oauth/callback/ai-provider",component:ht(()=>ft(()=>import("./oauth-callback-ai-provider-DZWV38Z5.js"),[]))}),yv=st({getParentRoute:()=>ci,path:"/_admin",component:ht(()=>ft(()=>import("./layout-CAQxuDfc.js"),__vite__mapDeps([11,12,13,14])))}),kle=st({getParentRoute:()=>yv,path:"/",beforeLoad:()=>{throw tl({to:"/_admin/users"})}}),Dle=st({getParentRoute:()=>yv,path:"/users",component:ht(()=>ft(()=>import("./users-CBHdkzLg.js"),__vite__mapDeps([15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35])))}),Lle=st({getParentRoute:()=>yv,path:"/orgs",component:ht(()=>ft(()=>import("./orgs-BiSSAVq9.js"),__vite__mapDeps([36,16,17,18,19,20,21,22,23,24,25,26,27,2,37,31,38,39,40,41,42,32,33,34])))}),$le=yv.addChildren([kle,Dle,Lle]),RE=st({getParentRoute:()=>ci,id:"shell",component:ht(()=>ft(()=>import("./shell-layout--i4S_y1a.js").then(e=>e.s),__vite__mapDeps([43,28,29,44,45,46,47,48,49,50,38,20,51,13,52,53,54,10,55,56,3,4,57,58,59,60])))}),jle=st({getParentRoute:()=>RE,path:"/",beforeLoad:async()=>{const e=ble();if(e)throw tl({to:"/$org",params:{org:e.org}});const t=localStorage.getItem(su.lastOrgSlug());if(t)throw tl({to:"/$org",params:{org:t}});const{data:n}=await pN();if(!n)return;const r=n[0];throw tl(r?{to:"/$org",params:{org:r.slug}}:{to:"/onboarding"})}}),zle=st({getParentRoute:()=>ci,path:"/onboarding",beforeLoad:async()=>{const{data:e}=await pN();if(e&&e.length>0)throw tl({to:"/"})},component:ht(()=>ft(()=>import("./onboarding-BSMPev5P.js"),__vite__mapDeps([61,13,5,62,28,29,2,37,63,44,48,64,65,66])))}),Ule=st({getParentRoute:()=>ci,path:"/commerce-onboarding",component:ht(()=>ft(()=>import("./commerce-onboarding-CSQzdWRv.js"),__vite__mapDeps([67,1,2,3,4,5,62,28,29,57,53,54,10,68,69,70,71,72,24,73,74,75,44,76,48,40,41,77,42,78,46,79,80,81,82,83,49,84,64,85,86,87,18,88,89,90,91,65,92,93,45,27,94,95,96,66,97,47,20,50,38,21,98,99,100,37,31,101,9]))),validateSearch:ya(()=>be({org:$().optional(),siteUrl:$().optional()}))}),_v=st({getParentRoute:()=>RE,path:"/$org",beforeLoad:({params:e})=>{pL({org:e.org})},component:ht(()=>ft(()=>import("./org-layout-CKgpdyFk.js"),[]))}),Nf=st({getParentRoute:()=>_v,id:"org-shell",component:ht(()=>ft(()=>import("./index-CPqDQfOw.js"),__vite__mapDeps([102,17,18,19,20,21,103,104,105,106,28,29,79,82,80,75,90,91,73,94,70,71,72,24,68,74,44,76,48,40,41,77,42,78,46,81,83,49,84,64,85,86,87,88,89,65,92,93,45,27,95,96,66,97,47,50,14,107,108,38,100,37,39,109,110,111,112,113,114,115,116,117,53,54,10,58,59,118,119,98,120,69,121,122,30,2,123,101,9,124,125,126,127,52,55,56,3,4,128,129,57,130,43,51,13,60,131,132,133,134,33,34,135,136,137,138,31,139,99,140])))}),mL=st({getParentRoute:()=>Nf,id:"agent-shell",pendingComponent:xE,component:ht(()=>ft(()=>import("./index-CZ4WVu9U.js").then(e=>e.aT),__vite__mapDeps([141,24,127,52,55,53,54,10,56,3,4,128,117,125,59,129,57,58,142,39,21,40,41,42,118,119,116,120,17,18,19,20,23,25,143,110,134,71,48,78,70,72,73,68,74,75,44,76,77,46,79,80,81,82,83,49,84,64,85,86,87,88,89,90,91,65,92,93,45,27,94,95,96,66,29,97,47,50,144,124,30,145,131,132,38,105,28,33,34,146,147,148,149,150,43,51,13,60,69,135,136,151,100,37,2,106,121,152,130,112,113,114,115,98,122,109,123,101,9,126,153,103,154,155,156,157,140,31,158,159,139,160,161,63,162,16,26,138,99,163,164,165,35,166,104,167,168,169])))}),Fle=be({virtualmcpid:$().optional(),tab:$().optional(),sidepanel:nn([rn(["chat","blocks"]),Ge(0)]).optional(),main:nn([$(),Ge(0)]).optional(),preview:$().optional(),id:$().optional(),toolName:$().optional(),tasks:dt().optional(),mainOpen:dt().optional(),autosend:$().optional(),runLocally:$().optional()}),Ble=st({getParentRoute:()=>mL,path:"/$taskId",validateSearch:Fle,beforeLoad:({params:e,search:t})=>{pL({org:e.org,taskId:e.taskId,virtualmcpid:t.virtualmcpid})},component:()=>null}),Vle=be({main:$().optional()}),qle=st({getParentRoute:()=>Nf,path:"/",validateSearch:Vle,pendingComponent:xE,component:ht(()=>ft(()=>import("./index-BcE0UPe9.js"),__vite__mapDeps([170,54,55,53,10,56,3,4,58,59,136])))}),Hle=be({path:$().optional(),preview:$().optional(),skill:$().optional()}),Gle=st({getParentRoute:()=>Nf,path:"/files",validateSearch:Hle,pendingComponent:xE,component:ht(()=>ft(()=>import("./index-DRgsUNzQ.js").then(e=>e.P),__vite__mapDeps([157,77,83,82,80,65,93,45,95,66,47,50,19,51,38,20,2,103,147,40,79,57,140,31,81,87,96,156,78,109,41,42,105,21,88,149,18])))}),Kle=st({getParentRoute:()=>Nf,path:"/board",component:ht(()=>ft(()=>import("./index-CylmZ2ca.js").then(e=>e.i),__vite__mapDeps([165,35,28,29,30,76,89,93,143,110,59,33,34,71,48,78,83,38,20,156,40,77,105,166,41,96])))}),Dn=st({getParentRoute:()=>_v,path:"/settings",component:ht(()=>ft(()=>import("./settings-layout-B_2KA4xq.js"),__vite__mapDeps([171,12,17,18,19,20,21,16,75,44,86,87,94,29,50,58,54,59,160,172,159,158,129,56,3,140,133,104])))}),Zle=st({getParentRoute:()=>_v,path:"/install",component:ht(()=>ft(()=>import("./org-install-ByQXqxL7.js"),[]))}),Yle=st({getParentRoute:()=>Dn,path:"/",component:ht(()=>ft(()=>import("./index-redirect-DOgz12Hs.js"),__vite__mapDeps([173,160,174])))}),Wle=st({getParentRoute:()=>Dn,path:"/connections",component:ht(()=>ft(()=>import("./connections-BCohgvy9.js"),__vite__mapDeps([175,98,53,54,10,176,156,40,77,78,24,85,89,21,177,30,26,27,122,114,113,115,116,117,58,59,118,119,120,69,68,70,71,72,73,74,75,44,76,48,41,42,46,79,80,81,82,83,49,84,64,86,87,18,88,90,91,65,92,93,45,94,95,96,66,29,97,47,20,50,25,16,17,19,178,51,160,179,145,38,106,100,37,2,39,109,128,123,101,9]))),validateSearch:ya(()=>be({action:rn(["create"]).optional(),tab:rn(["all","connected"]).optional()}))}),Qle=st({getParentRoute:()=>Dn,path:"/connections/$appSlug",component:ht(()=>ft(()=>import("./connection-detail-DWSgMsK8.js"),__vite__mapDeps([180,98,53,54,10,25,123,2,93,96,181,16,17,18,19,20,21,139,80,87,116,117,115,58,59,39,40,41,42,182,183,132,70,71,72,24,73,68,74,75,44,76,48,77,78,46,79,81,82,83,49,84,64,85,86,88,89,90,91,65,92,45,27,94,95,66,29,97,47,50,105,128,184,135,55,56,3,4,136,161,9,30,150,143,110,28,151,69,100,37,178,51,185,152,113,121,120,156]))),validateSearch:ya(()=>be({tab:$().optional()}))}),Xle=st({getParentRoute:()=>Dn,path:"/connections/$appSlug/$collectionName/$itemId",component:ht(()=>ft(()=>import("./collection-detail-UOi2wnnk.js"),__vite__mapDeps([186,25,117,53,54,10,100,37,2,109,181,16,17,18,19,20,21,139,80,87,116,98,115,58,59,93,39,40,41,42,182,183,132,70,71,72,24,73,68,74,75,44,76,48,77,78,46,79,81,82,83,49,84,64,85,86,88,89,90,91,65,92,45,27,94,95,96,66,29,97,47,50,105,128,184,135,55,56,3,4,136,150,187,137,113,161,9,30,148,149,127,52,125,129,57,69,43,28,38,51,13,60]))),validateSearch:ya(()=>be({replayId:$().optional()}))}),Jle=st({getParentRoute:()=>Dn,path:"/monitor",component:ht(()=>ft(()=>import("./index-C_F4X9gQ.js"),__vite__mapDeps([188,26,27,16,17,18,19,20,21,25,189,160,190,174,142,39,40,41,42,118,119,116,117,53,54,10,128,120,23,143,110,134,71,48,78,70,72,24,73,68,74,75,44,76,77,46,79,80,81,82,83,49,84,64,85,86,87,88,89,90,91,65,92,93,45,94,95,96,66,29,97,47,50,144,59,124,30,145,131,132,38,105,28,33,34,146,147,57,148,149,127,52,55,56,3,4,125,129,58,150,43,51,13,60,69,135,136,151,100,37,2,113,166,109,122,63,187,185,182]))),validateSearch:ya(()=>be({tab:rn(["overview","audit","dashboards","threads","automations"]).default("overview"),from:$().default("now-30m"),to:$().default("now"),connectionId:Re($()).optional().default([]),virtualMcpId:Re($()).optional().default([]),tool:$().default(""),status:rn(["all","success","errors"]).default("all"),search:$().default(""),page:dt().optional(),streaming:Nt().default(!0),propertyFilters:$().default(""),hideSystem:Nt().default(!1)}))}),ece=st({getParentRoute:()=>Dn,path:"/general",component:ht(()=>ft(()=>import("./general-DF7PHO03.js"),__vite__mapDeps([191,16,17,18,19,20,21,110,162,28,29,2,155,120,74,192,59,30,39,40,41,42,63,58,54,51,189,160,190,174])))}),tce=st({getParentRoute:()=>Dn,path:"/brand-context",component:ht(()=>ft(()=>import("./brand-context-D_AxwSWO.js"),__vite__mapDeps([193,41,77,84,88,93,96,50,51,2,109,16,17,18,19,20,21,59,162,189,160,190,174])))}),nce=st({getParentRoute:()=>Dn,path:"/ai-providers",component:ht(()=>ft(()=>import("./ai-providers-CQLJ_8tO.js"),__vite__mapDeps([194,71,16,17,18,19,20,21,103,155,120,74,125,59,48,127,52,55,53,54,10,56,3,4,128,117,129,57,58,153,38,106,145,40,2,39,41,42,73,72,87,27,154,90,77,28,29,83,126,79,95,162,130,51,93,96,164,34,189,160,190,174])))}),rce=st({getParentRoute:()=>Dn,path:"/secrets",component:ht(()=>ft(()=>import("./secrets-Bqyd0QgI.js"),__vite__mapDeps([195,71,93,29,97,38,20,2,37,39,21,40,41,42,103,109,16,17,18,19,155,120,74,163,59,189,160,190,174])))}),oce=st({getParentRoute:()=>Dn,path:"/files",component:ht(()=>ft(()=>import("./files-CcROi9t6.js"),[]))}),ice=st({getParentRoute:()=>Dn,path:"/buckets",component:ht(()=>ft(()=>import("./buckets-DucCPVYS.js"),__vite__mapDeps([196,71,86,93,96,51,38,20,2,37,39,21,40,41,42,63,103,109,16,17,18,19,155,120,74,167,59,189,160,190,174])))}),sce=st({getParentRoute:()=>Dn,path:"/members",component:ht(()=>ft(()=>import("./members-CFAG47YG.js"),__vite__mapDeps([197,176,156,40,77,78,24,85,89,21,177,30,26,27,16,17,18,19,20,22,23,25,108,38,100,37,39,41,42,109,110,111,155,120,74,172,160,59,28,29,33,34,35,143,51,81,87,94,96,47,145,131,132,105,93,189,190,174])))}),ace=st({getParentRoute:()=>Dn,path:"/roles",component:ht(()=>ft(()=>import("./roles-Bh63EYOm.js"),__vite__mapDeps([198,111,110,30,51,156,40,77,78,81,93,96,22,23,24,16,17,18,19,20,21,25,26,27,154,69,68,70,71,72,73,74,75,44,76,48,41,42,46,79,80,82,83,49,84,64,85,86,87,88,89,90,91,65,92,45,94,95,66,29,97,47,50,119,145,124,53,54,10,121,143,35,116,117,125,59,28,63,155,120,160,190,174]))),validateSearch:ya(()=>be({role:$().optional()}))}),lce=st({getParentRoute:()=>Dn,path:"/sso",component:ht(()=>ft(()=>import("./sso-CTXCmsBb.js"),__vite__mapDeps([199,192,59,155,120,74,30,2,39,21,40,41,42,16,17,18,19,20,63,60,96,189,160,190,174])))}),cce=st({getParentRoute:()=>Dn,path:"/profile",component:ht(()=>ft(()=>import("./profile-BSZd_-p5.js"),__vite__mapDeps([200,16,17,18,19,20,21,28,29,63,39,40,41,42,130,2,90,91,92,162,158,107,155,120,74])))}),uce=st({getParentRoute:()=>Dn,path:"/store",component:ht(()=>ft(()=>import("./store-CdG0vY93.js"),__vite__mapDeps([201,71,77,93,96,2,63,103,28,29,105,116,117,53,54,10,16,17,18,19,20,21,115,58,59,155,120,74,189,160,190,174])))}),dce=st({getParentRoute:()=>Dn,path:"/registry",component:ht(()=>ft(()=>import("./registry-OhtqP004.js"),__vite__mapDeps([202,189,160,190,174])))}),fce=st({getParentRoute:()=>Dn,path:"/store/registry",component:ht(()=>ft(()=>import("./store-registry-DZliD663.js"),__vite__mapDeps([203,189,160,190,174])))}),hce=st({getParentRoute:()=>Dn,path:"/agents",component:ht(()=>ft(()=>import("./agents-list-CaUeXqG0.js"),__vite__mapDeps([204,156,40,77,78,44,138,38,20,121,27,31,116,117,53,54,10,101,9,73,70,71,72,24,68,74,75,76,48,41,42,46,79,80,81,82,83,49,84,64,85,86,87,18,88,89,90,91,65,92,93,45,94,95,96,66,29,97,47,50,139,98,135,128,55,56,3,4,136,99,16,17,19,21,120,164,34,160,25,184,51,26])))}),pce=st({getParentRoute:()=>Dn,path:"/automations",component:ht(()=>ft(()=>import("./automations-k4gVYYGR.js"),__vite__mapDeps([205,93,50,26,27,16,17,18,19,20,21,25,144,53,54,10,59,135,128,117,55,56,3,4,136,168,51,156,40,77,78,46,81,96,70,71,72,24,73,68,74,75,44,76,48,41,42,79,80,82,83,49,84,64,85,86,87,88,89,90,91,65,92,45,94,95,66,29,97,47,189,160,190,174])))}),mce=Dn.addChildren([Yle,Wle,Qle,Xle,hce,pce,Jle,ece,tce,nce,rce,oce,ice,sce,ace,lce,cce,uce,fce,dce]),gce=mL.addChildren([Ble]),vce=Nf.addChildren([qle,Gle,Kle,gce]),yce=_v.addChildren([vce,mce,Zle]),_ce=RE.addChildren([jle,yce]),bce=ci.addChildren([_ce,$le,zle,Ule,Cle,Ale,Ile,Ple,Mle,Nle]),wce=v9({routeTree:bce,defaultPendingComponent:EE,defaultPendingMs:200,defaultNotFoundComponent:()=>C.jsx("div",{className:"flex h-full items-center justify-center",children:C.jsxs("div",{className:"flex flex-col items-center gap-4 p-8",children:[C.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Page not found"}),C.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-[300px]",children:"The page you are looking for does not exist or has been moved."}),C.jsx("button",{type:"button",onClick:()=>window.history.back(),className:"text-sm text-primary hover:underline",children:"Go back"})]})})});wle();const Sce=document.getElementById("root");jj.createRoot(Sce).render(C.jsx(P.StrictMode,{children:C.jsx(b9,{router:wce})}));export{bM as $,oue as A,df as B,Yn as C,C8 as D,j2 as E,x8 as F,R8 as G,be as H,$ as I,Ai as J,_M as K,Dg as L,Ci as M,Nce as N,WM as O,ff as P,dM as Q,Jae as R,EE as S,Cce as T,que as U,zue as V,Uce as W,Fce as X,su as Y,Mce as Z,nle as _,Vg as a,Kue as a$,Pce as a0,aoe as a1,hl as a2,ile as a3,hte as a4,Vae as a5,lL as a6,vt as a7,xE as a8,Re as a9,aW as aA,pae as aB,K6 as aC,cL as aD,Tue as aE,Due as aF,fK as aG,Bce as aH,Sae as aI,uL as aJ,ee as aK,Nue as aL,Sn as aM,M4 as aN,vl as aO,gf as aP,er as aQ,N4 as aR,ct as aS,la as aT,dt as aU,ft as aV,xce as aW,bo as aX,_o as aY,Ja as aZ,Gue as a_,rn as aa,Pt as ab,Nt as ac,pK as ad,Bue as ae,hK as af,Vue as ag,wE as ah,cv as ai,Ace as aj,kue as ak,LC as al,xw as am,vW as an,ii as ao,Jd as ap,kg as aq,yS as ar,Gc as as,pa as at,vs as au,si as av,L4 as aw,_W as ax,SW as ay,bW as az,Ng as b,lue as b$,Gt as b0,Mue as b1,Cue as b2,Pue as b3,ZW as b4,ik as b5,KW as b6,gs as b7,Lue as b8,Z6 as b9,Yee as bA,sD as bB,lD as bC,lX as bD,G4 as bE,kX as bF,dX as bG,G7 as bH,KM as bI,ri as bJ,aue as bK,oi as bL,Ece as bM,vY as bN,fle as bO,ma as bP,fv as bQ,uf as bR,ple as bS,ble as bT,Hue as bU,Fue as bV,Uue as bW,$ue as bX,hN as bY,fL as bZ,jue as b_,sS as ba,_ue as bb,QB as bc,Q3 as bd,YB as be,nn as bf,Ge as bg,Bw as bh,CB as bi,$ce as bj,eV as bk,SV as bl,Hw as bm,Vw as bn,oV as bo,jce as bp,mue as bq,oie as br,ya as bs,IB as bt,fl as bu,yt as bv,tae as bw,IN as bx,Yw as by,e4 as bz,Hn as c,lS as c$,Dce as c0,Woe as c1,Qoe as c2,cE as c3,j6 as c4,uE as c5,dv as c6,S6 as c7,die as c8,x6 as c9,wr as cA,dw as cB,xue as cC,Oue as cD,Rue as cE,bue as cF,yX as cG,_X as cH,vX as cI,yY as cJ,hY as cK,_Y as cL,mY as cM,bY as cN,gY as cO,cS as cP,aS as cQ,DW as cR,rk as cS,kW as cT,Z4 as cU,Vce as cV,LW as cW,pY as cX,m4 as cY,s4 as cZ,uS as c_,sie as ca,_ie as cb,Aoe as cc,Poe as cd,koe as ce,Hoe as cf,aie as cg,Ioe as ch,Moe as ci,Doe as cj,Loe as ck,Goe as cl,eie as cm,Iue as cn,Aue as co,nue as cp,Q6 as cq,wue as cr,uae as cs,Sue as ct,loe as cu,iw as cv,aw as cw,sw as cx,Eue as cy,yw as cz,A8 as d,NQ as d$,Xd as d0,K9 as d1,w6 as d2,R6 as d3,C6 as d4,I6 as d5,P6 as d6,N6 as d7,hue as d8,pue as d9,Hce as dA,qce as dB,gK as dC,mK as dD,qN as dE,Ice as dF,Oce as dG,Rce as dH,vM as dI,Sf as dJ,mf as dK,tX as dL,nX as dM,iX as dN,rX as dO,oX as dP,Gce as dQ,Kce as dR,Qce as dS,Xce as dT,Jce as dU,eue as dV,Zce as dW,Yce as dX,Wce as dY,EQ as dZ,CQ as d_,due as da,fue as db,coe as dc,uue as dd,O6 as de,A6 as df,M6 as dg,vue as dh,T6 as di,Soe as dj,cue as dk,b6 as dl,Hie as dm,Joe as dn,yue as dp,$ie as dq,Uie as dr,wie as ds,bie as dt,gue as du,_B as dv,kce as dw,zce as dx,qw as dy,Lce as dz,Lw as e,xQ as e0,RQ as e1,SQ as e2,dk as e3,OQ as e4,TQ as e5,AQ as e6,IQ as e7,PQ as e8,MQ as e9,kQ as ea,LQ as eb,$Q as ec,iue as f,rue as g,sue as h,SE as i,C as j,vle as k,dle as l,yM as m,Iw as n,tu as o,Qn as p,rM as q,P as r,Im as s,QT as t,HM as u,b8 as v,w8 as w,O8 as x,S8 as y,E8 as z};
|
|
171
|
+
`),document.head.appendChild(r)}}function cle(e){const t=Hn.c(9),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:_M.publicConfig(),queryFn:ale,staleTime:1/0},t[0]=r):r=t[0];const{data:o}=ff(r),[s]=ile();let l,c;t[1]!==o.theme?(l=()=>{lle(o.theme)},c=[o.theme],t[1]=o.theme,t[2]=l,t[3]=c):(l=t[2],c=t[3]),P.useLayoutEffect(l,c);let d,f;t[4]!==s.theme?(d=()=>{const h=document.documentElement,g=()=>{const x=document.querySelector('meta[name="theme-color"]');if(!x)return;const S=getComputedStyle(h).getPropertyValue("--sidebar").trim();if(!S)return;const E=document.createElement("canvas").getContext("2d");if(!E)return;E.fillStyle="#010203";const T=E.fillStyle;E.fillStyle=S;const R=E.fillStyle;R!==T&&(x.content=R)};if(s.theme==="dark"){h.classList.add("dark"),g();return}if(s.theme==="light"){h.classList.remove("dark"),g();return}const v=window.matchMedia("(prefers-color-scheme: dark)"),_=x=>{h.classList.toggle("dark",x),g()};_(v.matches);const b=x=>_(x.matches);return v.addEventListener("change",b),()=>v.removeEventListener("change",b)},f=[s.theme],t[4]=s.theme,t[5]=d,t[6]=f):(d=t[5],f=t[6]),P.useLayoutEffect(d,f);let p;return t[7]!==n?(p=C.jsx(C.Fragment,{children:n}),t[7]=n,t[8]=p):p=t[8],p}const Mf=new y8({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!0,refetchOnMount:!0,retry:1,gcTime:300*1e3}}});Fae(Mf);Bae(Mf);kae(Mf);Dae(Mf);function ule(e){const t=Hn.c(4),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=C.jsx(OG,{}),t[0]=r):r=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=C.jsx(EE,{}),t[1]=o):o=t[1];let s;return t[2]!==n?(s=C.jsxs(_8,{client:Mf,children:[r,C.jsx(P.Suspense,{fallback:o,children:C.jsx(cle,{children:C.jsx(P8,{children:C.jsx(ene,{children:C.jsx(ele,{children:n})})})})})]}),t[2]=n,t[3]=s):s=t[3],s}function xE(){const e=Hn.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=C.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 h-full w-full flex items-center justify-center",children:C.jsx(SE,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=t):t=e[0],t}function dle(...e){return IN(Yw(e))}const fle=e4("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:hover:bg-input/50 card-shadow",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",special:"bg-special text-special-foreground hover:bg-special/90 focus-visible:ring-special/20 dark:focus-visible:ring-special/40",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground"},size:{default:"h-8 px-3 has-[>svg]:px-2.5",sm:"h-7 gap-1.5 px-2.5 has-[>svg]:px-2",xs:"h-6 gap-1 px-1.5 text-xs has-[>svg]:px-1",lg:"h-10 px-3.5 has-[>svg]:px-3",xl:"h-12 px-4 has-[>svg]:px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}});function df(e){const t=Hn.c(14);let n,r,o,s,l;t[0]!==e?({className:n,variant:l,size:o,asChild:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=l):(n=t[1],r=t[2],o=t[3],s=t[4],l=t[5]);const d=(s===void 0?!1:s)?sS:"button";let f;t[6]!==n||t[7]!==o||t[8]!==l?(f=dle(fle({variant:l,size:o,className:n})),t[6]=n,t[7]=o,t[8]=l,t[9]=f):f=t[9];let p;return t[10]!==d||t[11]!==r||t[12]!==f?(p=C.jsx(d,{"data-slot":"button",className:f,...r}),t[10]=d,t[11]=r,t[12]=f,t[13]=p):p=t[13],p}const hle=["radial-gradient(ellipse 85% 85% at 0% 0%, rgba(165,149,255,0.6) 0%, transparent 72%)","radial-gradient(ellipse 85% 85% at 100% 100%, rgba(208,236,26,0.52) 0%, transparent 72%)","radial-gradient(ellipse 85% 85% at 0% 100%, rgba(255,193,22,0.48) 0%, transparent 72%)"].join(", ");function ple(e){const t=Hn.c(3),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=C.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:hle}}),t[0]=r):r=t[0];let o;return t[1]!==n?(o=C.jsxs("div",{className:"relative flex items-center justify-center min-h-screen bg-background overflow-hidden",children:[r,C.jsx("div",{className:"relative flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:n})]}),t[1]=n,t[2]=o):o=t[2],o}function fL(e){const t=Hn.c(9),{orgName:n}=e,r=mle;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=C.jsx("div",{className:"bg-muted p-3 rounded-full",children:C.jsx(lL,{className:"h-6 w-6 text-muted-foreground"})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=C.jsx("h3",{className:"text-lg font-medium",children:"Organization unavailable"}),t[1]=s):s=t[1];let l;t[2]!==n?(l=n?C.jsxs(C.Fragment,{children:[C.jsx("strong",{children:n})," has been deleted or is no longer available."]}):"This organization has been deleted or is no longer available.",t[2]=n,t[3]=l):l=t[3];let c;t[4]!==l?(c=C.jsxs("div",{className:"space-y-2",children:[s,C.jsx("p",{className:"text-sm text-muted-foreground",children:l})]}),t[4]=l,t[5]=c):c=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=C.jsx(df,{onClick:r,children:"Go to home"}),t[6]=d):d=t[6];let f;return t[7]!==c?(f=C.jsxs(ple,{children:[o,c,d]}),t[7]=c,t[8]=f):f=t[8],f}function mle(){window.location.href="/"}function gle(){const e=Hn.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/shell/$org"},e[0]=t):t=e[0];const{org:n}=Lw(t);let r;return e[1]!==n?(r=C.jsx(df,{variant:"outline",size:"sm",asChild:!0,children:C.jsx(Dg,{to:"/$org/settings/profile",params:{org:n},children:"Go to your profile"})}),e[1]=n,e[2]=r):r=e[2],r}function vle(e){const t=Hn.c(13),{area:n,description:r,action:o}=e,s=n?`No access to ${n}`:"No access",l=r??"Your role doesn't include permission for this section. Ask an organization admin to update your role if you need it.";let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=C.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:C.jsx(cL,{size:28})}),t[0]=c):c=t[0];let d;t[1]!==s?(d=C.jsx("h3",{className:"text-lg font-medium",children:s}),t[1]=s,t[2]=d):d=t[2];let f;t[3]!==l?(f=C.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:l}),t[3]=l,t[4]=f):f=t[4];let p;t[5]!==d||t[6]!==f?(p=C.jsxs("div",{className:"space-y-1",children:[d,f]}),t[5]=d,t[6]=f,t[7]=p):p=t[7];let h;t[8]!==o?(h=o??C.jsx(gle,{}),t[8]=o,t[9]=h):h=t[9];let g;return t[10]!==p||t[11]!==h?(g=C.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[c,p,h]}),t[10]=p,t[11]=h,t[12]=g):g=t[12],g}const XP="__mesh_chunk_reload_ts";function hL(e){return e?.message==="Organization is archived"}function yle(e){return!!e?.message?.includes("Access denied")}function JP(e){if(!e)return!1;const t=e.message||"";return t.includes("Failed to fetch dynamically imported module")||t.includes("Importing a module script failed")||t.includes("error loading dynamically imported module")||t.includes("Failed to fetch")&&e.name==="TypeError"}class que extends P.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),aL(t,{boundary:"default",error_name:t.name,error_message:t.message,component_stack:n.componentStack??null,route:typeof window<"u"?window.location.pathname:null})}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:t}=this.props;return typeof t=="function"?t({error:this.state.error,resetError:this.resetError}):t!==void 0?t:hL(this.state.error)?C.jsx(fL,{}):yle(this.state.error)?C.jsx(vle,{}):C.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:C.jsx(wE,{className:"h-6 w-6 text-destructive"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),C.jsx(df,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}class _le extends P.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n);const r=JP(t);if(aL(t,{boundary:"chunk_root",is_chunk_load_error:r,error_name:t.name,error_message:t.message,component_stack:n.componentStack??null,route:typeof window<"u"?window.location.pathname:null}),!r)return;const o=sessionStorage.getItem(XP),s=Date.now();(!o||s-Number(o)>1e4)&&(sessionStorage.setItem(XP,String(s)),window.location.reload())}render(){return this.state.hasError&&JP(this.state.error)?C.jsxs("div",{className:"flex min-h-dvh flex-col items-center justify-center p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:C.jsx(uL,{className:"h-6 w-6 text-primary"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"New version available"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:"A new version has been deployed. Refresh to continue."})]}),C.jsx(df,{onClick:()=>window.location.reload(),children:"Refresh"})]}):this.state.hasError?hL(this.state.error)?C.jsx(fL,{}):C.jsxs("div",{className:"flex min-h-dvh flex-col items-center justify-center p-6 text-center space-y-4",children:[C.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:C.jsx(wE,{className:"h-6 w-6 text-destructive"})}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),C.jsx(df,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}function pL(e){try{localStorage.setItem(su.lastLocation(),JSON.stringify(e))}catch{}}function ble(){try{const e=localStorage.getItem(su.lastLocation());if(!e)return null;const t=JSON.parse(e);if(typeof t?.org=="string")return{org:t.org,taskId:typeof t.taskId=="string"?t.taskId:void 0,virtualmcpid:typeof t.virtualmcpid=="string"?t.virtualmcpid:void 0}}catch{}return null}function Hue(){try{localStorage.removeItem(su.lastLocation())}catch{}}let us=null,eM=!1;const Ew=new Set;function Ag(){for(const e of Ew)e()}function wle(){eM||typeof window>"u"||(eM=!0,window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),us=e,Ag()}),window.addEventListener("appinstalled",()=>{us=null,Ag()}))}function Gue(){us!==null&&(us=null,Ag())}function Sle(e){return Ew.add(e),()=>{Ew.delete(e)}}function Ele(){return us}function xle(){return null}function Rle(){if(typeof window>"u")return!1;const e=typeof window.matchMedia=="function"&&["(display-mode: standalone)","(display-mode: window-controls-overlay)"].some(n=>window.matchMedia(n).matches),t=navigator.standalone===!0;return e||t}function Ole(){if(typeof navigator>"u")return!1;const e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)?!0:e.includes("Macintosh")&&typeof document<"u"&&"ontouchend"in document}function Kue(){const e=Hn.c(5),t=P.useSyncExternalStore(Sle,Ele,xle);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rle(),e[0]=n):n=e[0];const r=n,o=t!==null&&!r;let s,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=Ole(),l=Tle,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let c;return e[3]!==o?(c={canPrompt:o,installed:r,ios:s,promptInstall:l},e[3]=o,e[4]=c):c=e[4],c}async function Tle(){if(!us)return"unavailable";await us.prompt();const e=await us.userChoice;return us=null,Ag(),e.outcome}const ci=s9({component:()=>C.jsx(_le,{children:C.jsx(ule,{children:C.jsx(P.Suspense,{fallback:C.jsx(EE,{}),children:C.jsx(WM,{})})})})}),Cle=st({getParentRoute:()=>ci,path:"/login",component:ht(()=>ft(()=>import("./login-DyHUQRlz.js"),__vite__mapDeps([0,1,2,3,4,5]))),validateSearch:ya(()=>be({next:$().optional(),client_id:$().optional(),redirect_uri:$().optional(),response_type:$().optional(),state:$().optional(),scope:$().optional(),code_challenge:$().optional(),code_challenge_method:$().optional()}))}),Ale=st({getParentRoute:()=>ci,path:"/cli/auth-success",component:ht(()=>ft(()=>import("./cli-auth-success-BRy-NxMn.js"),__vite__mapDeps([6,5])))}),Ile=st({getParentRoute:()=>ci,path:"/reset-password",component:ht(()=>ft(()=>import("./reset-password-CldvJ8Wq.js"),__vite__mapDeps([7,2]))),validateSearch:ya(()=>be({token:$().optional(),error:$().optional()}))}),Ple=st({getParentRoute:()=>ci,path:"/auth/$pathname",component:ht(()=>ft(()=>import("./auth-catchall-ByT6IIRw.js"),[]))}),Mle=st({getParentRoute:()=>ci,path:"/oauth/callback",component:ht(()=>ft(()=>import("./oauth-callback-bZWA-VvB.js"),__vite__mapDeps([8,9,10])))}),Nle=st({getParentRoute:()=>ci,path:"/oauth/callback/ai-provider",component:ht(()=>ft(()=>import("./oauth-callback-ai-provider-Gt_5rwPH.js"),[]))}),yv=st({getParentRoute:()=>ci,path:"/_admin",component:ht(()=>ft(()=>import("./layout-DOGkXOpg.js"),__vite__mapDeps([11,12,13,14])))}),kle=st({getParentRoute:()=>yv,path:"/",beforeLoad:()=>{throw tl({to:"/_admin/users"})}}),Dle=st({getParentRoute:()=>yv,path:"/users",component:ht(()=>ft(()=>import("./users-B-Y5Y6VT.js"),__vite__mapDeps([15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35])))}),Lle=st({getParentRoute:()=>yv,path:"/orgs",component:ht(()=>ft(()=>import("./orgs-BUeLl6_Z.js"),__vite__mapDeps([36,16,17,18,19,20,21,22,23,24,25,26,27,2,37,31,38,39,40,41,42,32,33,34])))}),$le=yv.addChildren([kle,Dle,Lle]),RE=st({getParentRoute:()=>ci,id:"shell",component:ht(()=>ft(()=>import("./shell-layout-BmmfEuxL.js").then(e=>e.s),__vite__mapDeps([43,28,29,44,45,46,47,48,49,50,38,20,51,13,52,53,54,10,55,56,3,4,57,58,59,60])))}),jle=st({getParentRoute:()=>RE,path:"/",beforeLoad:async()=>{const e=ble();if(e)throw tl({to:"/$org",params:{org:e.org}});const t=localStorage.getItem(su.lastOrgSlug());if(t)throw tl({to:"/$org",params:{org:t}});const{data:n}=await pN();if(!n)return;const r=n[0];throw tl(r?{to:"/$org",params:{org:r.slug}}:{to:"/onboarding"})}}),zle=st({getParentRoute:()=>ci,path:"/onboarding",beforeLoad:async()=>{const{data:e}=await pN();if(e&&e.length>0)throw tl({to:"/"})},component:ht(()=>ft(()=>import("./onboarding-B3pVNKOu.js"),__vite__mapDeps([61,13,5,62,28,29,2,37,63,44,48,64,65,66])))}),Ule=st({getParentRoute:()=>ci,path:"/commerce-onboarding",component:ht(()=>ft(()=>import("./commerce-onboarding-BjeDrjZF.js"),__vite__mapDeps([67,1,2,3,4,5,62,28,29,57,53,54,10,68,69,70,71,72,24,73,74,75,44,76,48,40,41,77,42,78,46,79,80,81,82,83,49,84,64,85,86,87,18,88,89,90,91,65,92,93,45,27,94,95,96,66,97,47,20,50,38,21,98,99,100,37,31,101,9]))),validateSearch:ya(()=>be({org:$().optional(),siteUrl:$().optional()}))}),_v=st({getParentRoute:()=>RE,path:"/$org",beforeLoad:({params:e})=>{pL({org:e.org})},component:ht(()=>ft(()=>import("./org-layout-CHPBFBts.js"),[]))}),Nf=st({getParentRoute:()=>_v,id:"org-shell",component:ht(()=>ft(()=>import("./index-DRvJRGa6.js"),__vite__mapDeps([102,17,18,19,20,21,103,104,105,106,28,29,79,82,80,75,90,91,73,94,70,71,72,24,68,74,44,76,48,40,41,77,42,78,46,81,83,49,84,64,85,86,87,88,89,65,92,93,45,27,95,96,66,97,47,50,14,107,108,38,100,37,39,109,110,111,112,113,114,115,116,117,53,54,10,58,59,118,119,98,120,69,121,122,30,2,123,101,9,124,125,126,127,52,55,56,3,4,128,129,57,130,43,51,13,60,131,132,133,134,33,34,135,136,137,138,31,139,99,140])))}),mL=st({getParentRoute:()=>Nf,id:"agent-shell",pendingComponent:xE,component:ht(()=>ft(()=>import("./index-C1OKchwi.js").then(e=>e.aT),__vite__mapDeps([141,24,127,52,55,53,54,10,56,3,4,128,117,125,59,129,57,58,142,39,21,40,41,42,118,119,116,120,17,18,19,20,23,25,143,110,134,71,48,78,70,72,73,68,74,75,44,76,77,46,79,80,81,82,83,49,84,64,85,86,87,88,89,90,91,65,92,93,45,27,94,95,96,66,29,97,47,50,144,124,30,145,131,132,38,105,28,33,34,146,147,148,149,150,43,51,13,60,69,135,136,151,100,37,2,106,121,152,130,112,113,114,115,98,122,109,123,101,9,126,153,103,154,155,156,157,140,31,158,159,139,160,161,63,162,16,26,138,99,163,164,165,35,166,104,167,168,169])))}),Fle=be({virtualmcpid:$().optional(),tab:$().optional(),sidepanel:nn([Ge("chat"),Ge(0)]).optional(),main:nn([$(),Ge(0)]).optional(),preview:$().optional(),id:$().optional(),toolName:$().optional(),tasks:dt().optional(),mainOpen:dt().optional(),autosend:$().optional(),runLocally:$().optional()}),Ble=st({getParentRoute:()=>mL,path:"/$taskId",validateSearch:Fle,beforeLoad:({params:e,search:t})=>{pL({org:e.org,taskId:e.taskId,virtualmcpid:t.virtualmcpid})},component:()=>null}),Vle=be({main:$().optional()}),qle=st({getParentRoute:()=>Nf,path:"/",validateSearch:Vle,pendingComponent:xE,component:ht(()=>ft(()=>import("./index-JAv4b7xn.js"),__vite__mapDeps([170,54,55,53,10,56,3,4,58,59,136])))}),Hle=be({path:$().optional(),preview:$().optional(),skill:$().optional()}),Gle=st({getParentRoute:()=>Nf,path:"/files",validateSearch:Hle,pendingComponent:xE,component:ht(()=>ft(()=>import("./index-DXJraMAU.js").then(e=>e.P),__vite__mapDeps([157,77,83,82,80,65,93,45,95,66,47,50,19,51,38,20,2,103,147,40,79,57,140,31,81,87,96,156,78,109,41,42,105,21,88,149,18])))}),Kle=st({getParentRoute:()=>Nf,path:"/board",component:ht(()=>ft(()=>import("./index-C5c1_CFi.js").then(e=>e.i),__vite__mapDeps([165,35,28,29,30,76,89,93,143,110,59,33,34,71,48,78,83,38,20,156,40,77,105,166,41,96])))}),Dn=st({getParentRoute:()=>_v,path:"/settings",component:ht(()=>ft(()=>import("./settings-layout-BWtmqWri.js"),__vite__mapDeps([171,12,17,18,19,20,21,16,75,44,86,87,94,29,50,58,54,59,160,172,159,158,129,56,3,140,133,104])))}),Zle=st({getParentRoute:()=>_v,path:"/install",component:ht(()=>ft(()=>import("./org-install-DdMsBGUJ.js"),[]))}),Yle=st({getParentRoute:()=>Dn,path:"/",component:ht(()=>ft(()=>import("./index-redirect-XAsgVCK7.js"),__vite__mapDeps([173,160,174])))}),Wle=st({getParentRoute:()=>Dn,path:"/connections",component:ht(()=>ft(()=>import("./connections-GBz8DR7k.js"),__vite__mapDeps([175,98,53,54,10,176,156,40,77,78,24,85,89,21,177,30,26,27,122,114,113,115,116,117,58,59,118,119,120,69,68,70,71,72,73,74,75,44,76,48,41,42,46,79,80,81,82,83,49,84,64,86,87,18,88,90,91,65,92,93,45,94,95,96,66,29,97,47,20,50,25,16,17,19,178,51,160,179,145,38,106,100,37,2,39,109,128,123,101,9]))),validateSearch:ya(()=>be({action:an(["create"]).optional(),tab:an(["all","connected"]).optional()}))}),Qle=st({getParentRoute:()=>Dn,path:"/connections/$appSlug",component:ht(()=>ft(()=>import("./connection-detail-BwuDYyyX.js"),__vite__mapDeps([180,98,53,54,10,25,123,2,93,96,181,16,17,18,19,20,21,139,80,87,116,117,115,58,59,39,40,41,42,182,183,132,70,71,72,24,73,68,74,75,44,76,48,77,78,46,79,81,82,83,49,84,64,85,86,88,89,90,91,65,92,45,27,94,95,66,29,97,47,50,105,128,184,135,55,56,3,4,136,161,9,30,150,143,110,28,151,69,100,37,178,51,185,152,113,121,120,156]))),validateSearch:ya(()=>be({tab:$().optional()}))}),Xle=st({getParentRoute:()=>Dn,path:"/connections/$appSlug/$collectionName/$itemId",component:ht(()=>ft(()=>import("./collection-detail-AgoVpHZK.js"),__vite__mapDeps([186,25,117,53,54,10,100,37,2,109,181,16,17,18,19,20,21,139,80,87,116,98,115,58,59,93,39,40,41,42,182,183,132,70,71,72,24,73,68,74,75,44,76,48,77,78,46,79,81,82,83,49,84,64,85,86,88,89,90,91,65,92,45,27,94,95,96,66,29,97,47,50,105,128,184,135,55,56,3,4,136,150,187,137,113,161,9,30,148,149,127,52,125,129,57,69,43,28,38,51,13,60]))),validateSearch:ya(()=>be({replayId:$().optional()}))}),Jle=st({getParentRoute:()=>Dn,path:"/monitor",component:ht(()=>ft(()=>import("./index-Cz2K9IhP.js"),__vite__mapDeps([188,26,27,16,17,18,19,20,21,25,189,160,190,174,142,39,40,41,42,118,119,116,117,53,54,10,128,120,23,143,110,134,71,48,78,70,72,24,73,68,74,75,44,76,77,46,79,80,81,82,83,49,84,64,85,86,87,88,89,90,91,65,92,93,45,94,95,96,66,29,97,47,50,144,59,124,30,145,131,132,38,105,28,33,34,146,147,57,148,149,127,52,55,56,3,4,125,129,58,150,43,51,13,60,69,135,136,151,100,37,2,113,166,109,122,63,187,185,182]))),validateSearch:ya(()=>be({tab:an(["overview","audit","dashboards","threads","automations"]).default("overview"),from:$().default("now-30m"),to:$().default("now"),connectionId:Re($()).optional().default([]),virtualMcpId:Re($()).optional().default([]),tool:$().default(""),status:an(["all","success","errors"]).default("all"),search:$().default(""),page:dt().optional(),streaming:Nt().default(!0),propertyFilters:$().default(""),hideSystem:Nt().default(!1)}))}),ece=st({getParentRoute:()=>Dn,path:"/general",component:ht(()=>ft(()=>import("./general-0SucHlcy.js"),__vite__mapDeps([191,16,17,18,19,20,21,110,162,28,29,2,155,120,74,192,59,30,39,40,41,42,63,58,54,51,189,160,190,174])))}),tce=st({getParentRoute:()=>Dn,path:"/brand-context",component:ht(()=>ft(()=>import("./brand-context-CEEM_0kN.js"),__vite__mapDeps([193,41,77,84,88,93,96,50,51,2,109,16,17,18,19,20,21,59,162,189,160,190,174])))}),nce=st({getParentRoute:()=>Dn,path:"/ai-providers",component:ht(()=>ft(()=>import("./ai-providers-BXgftXJ-.js"),__vite__mapDeps([194,71,16,17,18,19,20,21,103,155,120,74,125,59,48,127,52,55,53,54,10,56,3,4,128,117,129,57,58,153,38,106,145,40,2,39,41,42,73,72,87,27,154,90,77,28,29,83,126,79,95,162,130,51,93,96,164,34,189,160,190,174])))}),rce=st({getParentRoute:()=>Dn,path:"/secrets",component:ht(()=>ft(()=>import("./secrets-c113z7Ow.js"),__vite__mapDeps([195,71,93,29,97,38,20,2,37,39,21,40,41,42,103,109,16,17,18,19,155,120,74,163,59,189,160,190,174])))}),oce=st({getParentRoute:()=>Dn,path:"/files",component:ht(()=>ft(()=>import("./files-CXE7GzEs.js"),[]))}),ice=st({getParentRoute:()=>Dn,path:"/buckets",component:ht(()=>ft(()=>import("./buckets-COiudA57.js"),__vite__mapDeps([196,71,86,93,96,51,38,20,2,37,39,21,40,41,42,63,103,109,16,17,18,19,155,120,74,167,59,189,160,190,174])))}),sce=st({getParentRoute:()=>Dn,path:"/members",component:ht(()=>ft(()=>import("./members-BwJT85YH.js"),__vite__mapDeps([197,176,156,40,77,78,24,85,89,21,177,30,26,27,16,17,18,19,20,22,23,25,108,38,100,37,39,41,42,109,110,111,155,120,74,172,160,59,28,29,33,34,35,143,51,81,87,94,96,47,145,131,132,105,93,189,190,174])))}),ace=st({getParentRoute:()=>Dn,path:"/roles",component:ht(()=>ft(()=>import("./roles-C2KkgwN_.js"),__vite__mapDeps([198,111,110,30,51,156,40,77,78,81,93,96,22,23,24,16,17,18,19,20,21,25,26,27,154,69,68,70,71,72,73,74,75,44,76,48,41,42,46,79,80,82,83,49,84,64,85,86,87,88,89,90,91,65,92,45,94,95,66,29,97,47,50,119,145,124,53,54,10,121,143,35,116,117,125,59,28,63,155,120,160,190,174]))),validateSearch:ya(()=>be({role:$().optional()}))}),lce=st({getParentRoute:()=>Dn,path:"/sso",component:ht(()=>ft(()=>import("./sso-CE7J0MVA.js"),__vite__mapDeps([199,192,59,155,120,74,30,2,39,21,40,41,42,16,17,18,19,20,63,60,96,189,160,190,174])))}),cce=st({getParentRoute:()=>Dn,path:"/profile",component:ht(()=>ft(()=>import("./profile-DLHF7ILW.js"),__vite__mapDeps([200,16,17,18,19,20,21,28,29,63,39,40,41,42,130,2,90,91,92,162,158,107,155,120,74])))}),uce=st({getParentRoute:()=>Dn,path:"/store",component:ht(()=>ft(()=>import("./store-CNLQyTjq.js"),__vite__mapDeps([201,71,77,93,96,2,63,103,28,29,105,116,117,53,54,10,16,17,18,19,20,21,115,58,59,155,120,74,189,160,190,174])))}),dce=st({getParentRoute:()=>Dn,path:"/registry",component:ht(()=>ft(()=>import("./registry-CYWFdNYv.js"),__vite__mapDeps([202,189,160,190,174])))}),fce=st({getParentRoute:()=>Dn,path:"/store/registry",component:ht(()=>ft(()=>import("./store-registry-As-nKPZf.js"),__vite__mapDeps([203,189,160,190,174])))}),hce=st({getParentRoute:()=>Dn,path:"/agents",component:ht(()=>ft(()=>import("./agents-list-DK6QZzyJ.js"),__vite__mapDeps([204,156,40,77,78,44,138,38,20,121,27,31,116,117,53,54,10,101,9,73,70,71,72,24,68,74,75,76,48,41,42,46,79,80,81,82,83,49,84,64,85,86,87,18,88,89,90,91,65,92,93,45,94,95,96,66,29,97,47,50,139,98,135,128,55,56,3,4,136,99,16,17,19,21,120,164,34,160,25,184,51,26])))}),pce=st({getParentRoute:()=>Dn,path:"/automations",component:ht(()=>ft(()=>import("./automations-DvN61x0o.js"),__vite__mapDeps([205,93,50,26,27,16,17,18,19,20,21,25,144,53,54,10,59,135,128,117,55,56,3,4,136,168,51,156,40,77,78,46,81,96,70,71,72,24,73,68,74,75,44,76,48,41,42,79,80,82,83,49,84,64,85,86,87,88,89,90,91,65,92,45,94,95,66,29,97,47,189,160,190,174])))}),mce=Dn.addChildren([Yle,Wle,Qle,Xle,hce,pce,Jle,ece,tce,nce,rce,oce,ice,sce,ace,lce,cce,uce,fce,dce]),gce=mL.addChildren([Ble]),vce=Nf.addChildren([qle,Gle,Kle,gce]),yce=_v.addChildren([vce,mce,Zle]),_ce=RE.addChildren([jle,yce]),bce=ci.addChildren([_ce,$le,zle,Ule,Cle,Ale,Ile,Ple,Mle,Nle]),wce=v9({routeTree:bce,defaultPendingComponent:EE,defaultPendingMs:200,defaultNotFoundComponent:()=>C.jsx("div",{className:"flex h-full items-center justify-center",children:C.jsxs("div",{className:"flex flex-col items-center gap-4 p-8",children:[C.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Page not found"}),C.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-[300px]",children:"The page you are looking for does not exist or has been moved."}),C.jsx("button",{type:"button",onClick:()=>window.history.back(),className:"text-sm text-primary hover:underline",children:"Go back"})]})})});wle();const Sce=document.getElementById("root");jj.createRoot(Sce).render(C.jsx(P.StrictMode,{children:C.jsx(b9,{router:wce})}));export{bM as $,oue as A,df as B,Yn as C,C8 as D,j2 as E,x8 as F,R8 as G,be as H,$ as I,Ai as J,_M as K,Dg as L,Ci as M,Nce as N,WM as O,ff as P,dM as Q,Jae as R,EE as S,Cce as T,que as U,zue as V,Uce as W,Fce as X,su as Y,Mce as Z,nle as _,Vg as a,Kue as a$,Pce as a0,aoe as a1,hl as a2,ile as a3,hte as a4,Vae as a5,lL as a6,vt as a7,xE as a8,Re as a9,aW as aA,pae as aB,K6 as aC,cL as aD,Tue as aE,Due as aF,fK as aG,Bce as aH,Sae as aI,uL as aJ,ee as aK,Nue as aL,Sn as aM,M4 as aN,vl as aO,gf as aP,er as aQ,N4 as aR,ct as aS,la as aT,dt as aU,ft as aV,xce as aW,bo as aX,_o as aY,Ja as aZ,Gue as a_,an as aa,Pt as ab,Nt as ac,pK as ad,Bue as ae,hK as af,Vue as ag,wE as ah,cv as ai,Ace as aj,kue as ak,LC as al,xw as am,vW as an,ii as ao,Jd as ap,kg as aq,yS as ar,Gc as as,pa as at,vs as au,si as av,L4 as aw,_W as ax,SW as ay,bW as az,Ng as b,lue as b$,Gt as b0,Mue as b1,Cue as b2,Pue as b3,ZW as b4,ik as b5,KW as b6,gs as b7,Lue as b8,Z6 as b9,Yee as bA,sD as bB,lD as bC,lX as bD,G4 as bE,kX as bF,dX as bG,G7 as bH,KM as bI,ri as bJ,aue as bK,oi as bL,Ece as bM,vY as bN,fle as bO,ma as bP,fv as bQ,uf as bR,ple as bS,ble as bT,Hue as bU,Fue as bV,Uue as bW,$ue as bX,hN as bY,fL as bZ,jue as b_,sS as ba,_ue as bb,QB as bc,Q3 as bd,YB as be,nn as bf,Ge as bg,Bw as bh,CB as bi,$ce as bj,eV as bk,SV as bl,Hw as bm,Vw as bn,oV as bo,jce as bp,mue as bq,oie as br,ya as bs,IB as bt,fl as bu,yt as bv,tae as bw,IN as bx,Yw as by,e4 as bz,Hn as c,lS as c$,Dce as c0,Woe as c1,Qoe as c2,cE as c3,j6 as c4,uE as c5,dv as c6,S6 as c7,die as c8,x6 as c9,wr as cA,dw as cB,xue as cC,Oue as cD,Rue as cE,bue as cF,yX as cG,_X as cH,vX as cI,yY as cJ,hY as cK,_Y as cL,mY as cM,bY as cN,gY as cO,cS as cP,aS as cQ,DW as cR,rk as cS,kW as cT,Z4 as cU,Vce as cV,LW as cW,pY as cX,m4 as cY,s4 as cZ,uS as c_,sie as ca,_ie as cb,Aoe as cc,Poe as cd,koe as ce,Hoe as cf,aie as cg,Ioe as ch,Moe as ci,Doe as cj,Loe as ck,Goe as cl,eie as cm,Iue as cn,Aue as co,nue as cp,Q6 as cq,wue as cr,uae as cs,Sue as ct,loe as cu,iw as cv,aw as cw,sw as cx,Eue as cy,yw as cz,A8 as d,NQ as d$,Xd as d0,K9 as d1,w6 as d2,R6 as d3,C6 as d4,I6 as d5,P6 as d6,N6 as d7,hue as d8,pue as d9,Hce as dA,qce as dB,gK as dC,mK as dD,qN as dE,Ice as dF,Oce as dG,Rce as dH,vM as dI,Sf as dJ,mf as dK,tX as dL,nX as dM,iX as dN,rX as dO,oX as dP,Gce as dQ,Kce as dR,Qce as dS,Xce as dT,Jce as dU,eue as dV,Zce as dW,Yce as dX,Wce as dY,EQ as dZ,CQ as d_,due as da,fue as db,coe as dc,uue as dd,O6 as de,A6 as df,M6 as dg,vue as dh,T6 as di,Soe as dj,cue as dk,b6 as dl,Hie as dm,Joe as dn,yue as dp,$ie as dq,Uie as dr,wie as ds,bie as dt,gue as du,_B as dv,kce as dw,zce as dx,qw as dy,Lce as dz,Lw as e,xQ as e0,RQ as e1,SQ as e2,dk as e3,OQ as e4,TQ as e5,AQ as e6,IQ as e7,PQ as e8,MQ as e9,kQ as ea,LQ as eb,$Q as ec,iue as f,rue as g,sue as h,SE as i,C as j,vle as k,dle as l,yM as m,Iw as n,tu as o,Qn as p,rM as q,P as r,Im as s,QT as t,HM as u,b8 as v,w8 as w,O8 as x,S8 as y,E8 as z};
|