decocms 4.319.1 → 4.319.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/dist/client/assets/{AlertCircle-CvTl8GUk.js → AlertCircle-D9xToIMB.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DJSypADj.js → AreaChart-CxkPRYZA.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-En4cxPnP.js → ArrowLeft-BjMncG6U.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-D8TsT0Lm.js → ArrowUp-CrGAU3G2.js} +1 -1
  5. package/dist/client/assets/{Check-DSjqiSlI.js → Check-DrJ5WDdf.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-D6G-NhwM.js → CheckCircle-waoO5z0g.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DhjGSQsl.js → ChevronDown-BsHyJSwB.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CFq-xjDr.js → ChevronRight-6fJEb030.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-BE4HzvdJ.js → ChevronSelectorVertical-BtjD2Krx.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-B8O2JP9t.js → ChevronUp-CCrhZnmK.js} +1 -1
  11. package/dist/client/assets/{Copy01-DFbLtEE_.js → Copy01-CUcc1rT7.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-BedV58xE.js → CreditCard01-Lvg_l2cC.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-D9HzRd7W.js → DotsVertical-D-G3pLTC.js} +1 -1
  14. package/dist/client/assets/{Download01-fMmULFBI.js → Download01-CHg3oeOm.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-CVm5cqF_.js → ErrorBarContext-Byj5YBDV.js} +1 -1
  16. package/dist/client/assets/{Eye-Dsgi67Qs.js → Eye-D7CF9t7J.js} +1 -1
  17. package/dist/client/assets/{FilterLines-_6k9yUOL.js → FilterLines-tHfmLV3o.js} +1 -1
  18. package/dist/client/assets/{GitBranch01-DtCvW7mH.js → GitBranch01-cVkQTFYe.js} +1 -1
  19. package/dist/client/assets/{Globe01-CpbZ1qSV.js → Globe01-fsAll_5J.js} +1 -1
  20. package/dist/client/assets/{Globe04-sA6q1ulU.js → Globe04-iZWncuvw.js} +1 -1
  21. package/dist/client/assets/{HardDrive-jZCTSG6y.js → HardDrive-DWD1AAge.js} +1 -1
  22. package/dist/client/assets/{Image01-QhTk0EJi.js → Image01-BuDmuyt4.js} +1 -1
  23. package/dist/client/assets/{Key01-DI1s7GXT.js → Key01-NqAAYAzO.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-BZQeEyC_.js → LinkExternal01-CnH1drDd.js} +1 -1
  25. package/dist/client/assets/{LockUnlocked01-D6aTu88G.js → LockUnlocked01-Dy39VZD5.js} +1 -1
  26. package/dist/client/assets/{LogOut01-C-Z_9N06.js → LogOut01-CepTDjIg.js} +1 -1
  27. package/dist/client/assets/{Monitor01-CKGo6W4T.js → Monitor01-DuJsYKiY.js} +1 -1
  28. package/dist/client/assets/{Package-GAQe_Wih.js → Package-CYdI6izf.js} +1 -1
  29. package/dist/client/assets/{Palette-wN0ma8Xt.js → Palette-gW-UafNV.js} +1 -1
  30. package/dist/client/assets/{Play-C9_Cyluj.js → Play-D9HObFa4.js} +1 -1
  31. package/dist/client/assets/{Plus-C1-Ar8V6.js → Plus-DBZfXSlG.js} +1 -1
  32. package/dist/client/assets/{SearchLg-C6D1oQXi.js → SearchLg-W2Sns64K.js} +1 -1
  33. package/dist/client/assets/{SearchMd-Cbw_793f.js → SearchMd-ohuS85CT.js} +1 -1
  34. package/dist/client/assets/{Sector-Bf-Qay5j.js → Sector-Bg-HDvfD.js} +1 -1
  35. package/dist/client/assets/{Settings02-vjLIHGa1.js → Settings02-DmnWdsnV.js} +1 -1
  36. package/dist/client/assets/{Share07-C1Uf7qgT.js → Share07-DbERY_pc.js} +1 -1
  37. package/dist/client/assets/{Shield01-Ce5yG-A0.js → Shield01-QpK6G-Gm.js} +1 -1
  38. package/dist/client/assets/{Stars01-DrMQPFwe.js → Stars01-YS6onfeZ.js} +1 -1
  39. package/dist/client/assets/{Stars02-CNJhdHZL.js → Stars02-r7zSgG8J.js} +1 -1
  40. package/dist/client/assets/{Sun-C_FOMwDI.js → Sun-1VzmYVaz.js} +1 -1
  41. package/dist/client/assets/{SwitchHorizontal01-CVGPFZX2.js → SwitchHorizontal01-Du4rbjq3.js} +1 -1
  42. package/dist/client/assets/{Tool01-FZuiStzo.js → Tool01-CCBlQ0Zq.js} +1 -1
  43. package/dist/client/assets/{Tool02-4ay4Rltz.js → Tool02-Bgo46UaV.js} +1 -1
  44. package/dist/client/assets/{Trash01-B6uMSqgT.js → Trash01-6BnXuuT1.js} +1 -1
  45. package/dist/client/assets/{TrendUp01-BlXVhMez.js → TrendUp01-8KB74JpW.js} +1 -1
  46. package/dist/client/assets/{Upload01-ILgL8mQU.js → Upload01-B9Jn6SFL.js} +1 -1
  47. package/dist/client/assets/{User01-BP-jVp5a.js → User01-DPbWRvQH.js} +1 -1
  48. package/dist/client/assets/{UserSquare-Ci10BLiP.js → UserSquare-CIzmAXPF.js} +1 -1
  49. package/dist/client/assets/{Users01-7X-sDRIV.js → Users01-BVp8PWY9.js} +1 -1
  50. package/dist/client/assets/{Users03-DoYa8GlE.js → Users03-Cwe_MBwk.js} +1 -1
  51. package/dist/client/assets/{XCircle-fDpSGJss.js → XCircle-DET_WiPa.js} +1 -1
  52. package/dist/client/assets/{XClose-Bk3zrAvS.js → XClose-BXQKrstX.js} +1 -1
  53. package/dist/client/assets/{YAxis-JqlW1pzJ.js → YAxis-PomXVlSd.js} +1 -1
  54. package/dist/client/assets/{Zap-CWUKEmdj.js → Zap-BqvTeTTF.js} +1 -1
  55. package/dist/client/assets/{ZapSquare-CuLB3vSB.js → ZapSquare-CKJZ8MMK.js} +1 -1
  56. package/dist/client/assets/{ZoomOut-DBEFR5j8.js → ZoomOut-DEARxChf.js} +1 -1
  57. package/dist/client/assets/{access-gate-R7rS3NRc.js → access-gate-CAnPAIdH.js} +1 -1
  58. package/dist/client/assets/{agent-icon-XAlp8Jca.js → agent-icon-B7KCMUKT.js} +1 -1
  59. package/dist/client/assets/{agents-list-DJDHQl_p.js → agents-list-BsLY-OrZ.js} +1 -1
  60. package/dist/client/assets/{ai-providers-ovKzvoUf.js → ai-providers-CzMAl3al.js} +1 -1
  61. package/dist/client/assets/{alert-B_ty8fFy.js → alert-B-kSlW5B.js} +1 -1
  62. package/dist/client/assets/{alert-dialog-DaZn9Nvz.js → alert-dialog-BX_76dkp.js} +1 -1
  63. package/dist/client/assets/{analytics-tab-_iyzvtNR.js → analytics-tab-C-jyBHy-.js} +1 -1
  64. package/dist/client/assets/{api-keys-Bb9QXkN-.js → api-keys-BT-Q2Njw.js} +1 -1
  65. package/dist/client/assets/{app-editor-DNjE3Tws.js → app-editor-5gg5JYa_.js} +1 -1
  66. package/dist/client/assets/{auth-u2nXBxlp.js → auth-7vEypH_C.js} +1 -1
  67. package/dist/client/assets/{auth-catchall-Cz340bxQ.js → auth-catchall-DcnRS6UR.js} +1 -1
  68. package/dist/client/assets/{auth-entry-Db8RbPsZ.js → auth-entry-DxGAUUiT.js} +1 -1
  69. package/dist/client/assets/{auth-split-layout-DM1xIRfw.js → auth-split-layout-CK5SZyA4.js} +1 -1
  70. package/dist/client/assets/{authenticate-and-persist-oauth-BIKOg1Y0.js → authenticate-and-persist-oauth-DmV864sJ.js} +1 -1
  71. package/dist/client/assets/{automation-list-row-B2rpCbUW.js → automation-list-row-C3SkObA3.js} +1 -1
  72. package/dist/client/assets/{automation-runs-CEP_ybkW.js → automation-runs-BRlHTbJm.js} +1 -1
  73. package/dist/client/assets/automations-qVdHEF5m.js +1 -0
  74. package/dist/client/assets/{avatar-BbSi4Ahi.js → avatar-C68r2IKR.js} +1 -1
  75. package/dist/client/assets/{badge-uxylkj2W.js → badge-PMvZlcsL.js} +1 -1
  76. package/dist/client/assets/{block-document-2dSaUuES.js → block-document-t85_nrmf.js} +1 -1
  77. package/dist/client/assets/{breadcrumb-ClZlgUkn.js → breadcrumb-CNiJbftU.js} +1 -1
  78. package/dist/client/assets/{buckets-C1McOmnw.js → buckets-CV02urs5.js} +1 -1
  79. package/dist/client/assets/{bulk-category-panel-cHla35pG.js → bulk-category-panel-CXC2ADm8.js} +1 -1
  80. package/dist/client/assets/{capability-load-error-C_sjvMSo.js → capability-load-error-B0FOp6ZJ.js} +1 -1
  81. package/dist/client/assets/{cards-CImABGVq.js → cards-DBV_vuEJ.js} +1 -1
  82. package/dist/client/assets/{category-editor-D98MjsDA.js → category-editor-BZFOv_At.js} +1 -1
  83. package/dist/client/assets/{cdn-tab-JA-Kz5p8.js → cdn-tab-CCweLl8k.js} +1 -1
  84. package/dist/client/assets/{chart-GkhxWJ7A.js → chart-CV1nYiMO.js} +1 -1
  85. package/dist/client/assets/{chat-context-BmrkHxvs.js → chat-context-Zn18Z3ax.js} +1 -1
  86. package/dist/client/assets/{checkbox-BBMI6E1M.js → checkbox-Bq0DvC7H.js} +1 -1
  87. package/dist/client/assets/{choose-editor-Bc3VbNpZ.js → choose-editor-pnS7Oq3J.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-BXpopNQp.js → cli-auth-success-psqbnXT9.js} +1 -1
  89. package/dist/client/assets/{collection-detail-CUg20CSh.js → collection-detail-2d3bTI3G.js} +1 -1
  90. package/dist/client/assets/{collection-display-button-3azPhvCh.js → collection-display-button-CExej5ZS.js} +1 -1
  91. package/dist/client/assets/{collection-search-CMowvqDA.js → collection-search-CCxZPf1G.js} +1 -1
  92. package/dist/client/assets/{collection-table-wrapper-C__SydZ0.js → collection-table-wrapper-C_waHWeW.js} +1 -1
  93. package/dist/client/assets/{collection-tabs-CuiCeffA.js → collection-tabs-CI3Rpip3.js} +1 -1
  94. package/dist/client/assets/{command-BDxbk6Rw.js → command-Bi7-0rva.js} +1 -1
  95. package/dist/client/assets/{commerce-onboarding-CU85ItiC.js → commerce-onboarding-DcRSodo7.js} +1 -1
  96. package/dist/client/assets/{config-BzzgD7df.js → config-CqVzIvRg.js} +1 -1
  97. package/dist/client/assets/{connect-Cyogzaom.js → connect-xC594bA5.js} +1 -1
  98. package/dist/client/assets/{connection-DsGtWkhk.js → connection-CHkAUVu6.js} +1 -1
  99. package/dist/client/assets/{connection-card-zpHiniPN.js → connection-card-8FPfJwxj.js} +1 -1
  100. package/dist/client/assets/{connection-detail-CWttNhAC.js → connection-detail-BCSxeAui.js} +1 -1
  101. package/dist/client/assets/{connection-form-helpers-ic8oRIkL.js → connection-form-helpers-leEWaGzs.js} +1 -1
  102. package/dist/client/assets/{connections-B_nL0W0U.js → connections-CbkuNYMp.js} +1 -1
  103. package/dist/client/assets/{decopilot-sse-pool-BRSPyUN1.js → decopilot-sse-pool-DQeLKSQU.js} +1 -1
  104. package/dist/client/assets/{dialog-DTBCjL3p.js → dialog-RnHnbV2_.js} +1 -1
  105. package/dist/client/assets/{domain-settings-COCrk0x3.js → domain-settings-C1MzNkZ3.js} +1 -1
  106. package/dist/client/assets/{drawer-RsO7C1I2.js → drawer-BF4YBqbu.js} +1 -1
  107. package/dist/client/assets/{dropdown-menu-FLYHHrdp.js → dropdown-menu-CcSRV6X6.js} +1 -1
  108. package/dist/client/assets/{e2e-tab-PaXKH9Cw.js → e2e-tab-BnvxibR_.js} +1 -1
  109. package/dist/client/assets/{editor-B1qIIE_V.js → editor-DOrxdGH1.js} +1 -1
  110. package/dist/client/assets/{empty-state-DKcBij1q.js → empty-state-CnB1NOOy.js} +1 -1
  111. package/dist/client/assets/{empty-state-tnyEwnqd.js → empty-state-DBQAydU_.js} +1 -1
  112. package/dist/client/assets/{extract-connection-data-TCmhOKLZ.js → extract-connection-data-CCWg7dLs.js} +1 -1
  113. package/dist/client/assets/{file-explorer-BTlDwvay.js → file-explorer-DxEj1-uh.js} +1 -1
  114. package/dist/client/assets/{file-type-icon-CEM_VOCL.js → file-type-icon-D3H2SAiO.js} +1 -1
  115. package/dist/client/assets/{folder-icon-DcobLOu-.js → folder-icon-CEkJkTKM.js} +1 -1
  116. package/dist/client/assets/{form-BD0h205i.js → form-B6rNtu5n.js} +1 -1
  117. package/dist/client/assets/{general-DULiHd3G.js → general-DQG7bfIk.js} +1 -1
  118. package/dist/client/assets/{github-repo-picker-Bk4yNfvo.js → github-repo-picker-Cj0tedJk.js} +1 -1
  119. package/dist/client/assets/{hooks-D5T_ngz5.js → hooks-CW9tPvKI.js} +1 -1
  120. package/dist/client/assets/{hosting-tab-AlW6z3Ts.js → hosting-tab-BWz1Rifu.js} +1 -1
  121. package/dist/client/assets/{index-DzWX3Cp7.js → index-B1nt3Xdg.js} +3 -3
  122. package/dist/client/assets/{index-B4wbJl2-.js → index-B7UTyiz1.js} +1 -1
  123. package/dist/client/assets/{index-CNT7bMK2.js → index-BY6Y74a-.js} +1 -1
  124. package/dist/client/assets/{index-CUbU69yL.js → index-Bh7YQlM-.js} +6 -6
  125. package/dist/client/assets/{index-hfWuXEpo.js → index-CX217zO_.js} +1 -1
  126. package/dist/client/assets/{index-Pso9Jce7.js → index-CcFQdqTB.js} +1 -1
  127. package/dist/client/assets/{index-BO-tSOuS.js → index-DBkSX1EH.js} +1 -1
  128. package/dist/client/assets/{index-CljteriX.js → index-De3PwXta.js} +1 -1
  129. package/dist/client/assets/{index-L0M-Tq0q.js → index-Y3J6_aX3.js} +1 -1
  130. package/dist/client/assets/{index-redirect-CQGI1LqZ.js → index-redirect-BdxnsoLD.js} +1 -1
  131. package/dist/client/assets/{infra-billing-B9ehXqR3.js → infra-billing-De-zJaVt.js} +1 -1
  132. package/dist/client/assets/{input-CeihZKzh.js → input-AdYfWDmT.js} +1 -1
  133. package/dist/client/assets/{integration-icon-BoEQOkUl.js → integration-icon-YJyRf5_z.js} +1 -1
  134. package/dist/client/assets/{invite-member-dialog-DvQQSsRa.js → invite-member-dialog-IekHsbTT.js} +1 -1
  135. package/dist/client/assets/{label-CSACuw4I.js → label-4zu9GnvJ.js} +1 -1
  136. package/dist/client/assets/{layout-BsnmkJl7.js → layout-D2Og4zyW.js} +1 -1
  137. package/dist/client/assets/{login-Ci_HosYv.js → login-DHpeps8b.js} +1 -1
  138. package/dist/client/assets/{markdown-CC0DcQj5.js → markdown-BGpHEHgs.js} +1 -1
  139. package/dist/client/assets/{mcp-oauth-BtBczYS0.js → mcp-oauth-Bo0lMjNG.js} +1 -1
  140. package/dist/client/assets/{members-9AKRU2nz.js → members-BbL_rO2A.js} +1 -1
  141. package/dist/client/assets/{monaco-editor-D2SIw1Et.js → monaco-editor-CNVDinF9.js} +1 -1
  142. package/dist/client/assets/{monitoring-stats-row-DTQH8sNd.js → monitoring-stats-row-D3Yva9xu.js} +1 -1
  143. package/dist/client/assets/{multi-select-DxWXmPWH.js → multi-select-DZWacpH9.js} +1 -1
  144. package/dist/client/assets/{oauth-callback-paI3XED5.js → oauth-callback-DMR_8NzV.js} +1 -1
  145. package/dist/client/assets/{oauth-callback-ai-provider-BUZWpy0b.js → oauth-callback-ai-provider-pclp7BS9.js} +1 -1
  146. package/dist/client/assets/{onboarding-DhjYcdmw.js → onboarding-B7tzD_wv.js} +1 -1
  147. package/dist/client/assets/{org-layout-C1xAd8Q3.js → org-layout-BcgRtVYv.js} +1 -1
  148. package/dist/client/assets/{organization-choice-MfVQ1OYv.js → organization-choice-ChXQyt1W.js} +1 -1
  149. package/dist/client/assets/{orgs-D_fEEc2L.js → orgs-MgLRr29s.js} +1 -1
  150. package/dist/client/assets/{page-seo-form-DRkzT-Ul.js → page-seo-form-ZRPTbq0Y.js} +1 -1
  151. package/dist/client/assets/{popover-VOQv4Dwp.js → popover-d5pnR-7w.js} +1 -1
  152. package/dist/client/assets/{post-calendar-D5IWrV90.js → post-calendar-D-wwbyry.js} +1 -1
  153. package/dist/client/assets/{post-editor-B5MVT2nZ.js → post-editor-C8lc6qEV.js} +1 -1
  154. package/dist/client/assets/{primitives-D6jSNUFx.js → primitives-Bps96uJM.js} +1 -1
  155. package/dist/client/assets/{profile-KluKzf4t.js → profile-DiMlv_H2.js} +1 -1
  156. package/dist/client/assets/{project-app-view-B-jIEdf5.js → project-app-view-CUt_liAa.js} +1 -1
  157. package/dist/client/assets/{prompts-CrPIhdaR.js → prompts-D2Mgo7FE.js} +1 -1
  158. package/dist/client/assets/record-editor-DOFAihnC.js +1 -0
  159. package/dist/client/assets/{redirect-editor-Bijres5C.js → redirect-editor-DNwDB1vG.js} +1 -1
  160. package/dist/client/assets/registry-DifJku7O.js +2 -0
  161. package/dist/client/assets/{registry-layout-_CAlX2VJ.js → registry-layout-birBFMDD.js} +1 -1
  162. package/dist/client/assets/{reports-AmEF8q2O.js → reports-mijRGZeE.js} +1 -1
  163. package/dist/client/assets/{require-capability-DJ721q13.js → require-capability-CupXunWP.js} +1 -1
  164. package/dist/client/assets/{required-auth-layout-ByPgJ6gr.js → required-auth-layout-C_aaKZ8h.js} +1 -1
  165. package/dist/client/assets/{reset-password-DSdZQfIo.js → reset-password-C8o9h2HB.js} +1 -1
  166. package/dist/client/assets/{review-settings-ByCcJhQ1.js → review-settings-BUXLiYmT.js} +1 -1
  167. package/dist/client/assets/{roles-Cb7b2DDM.js → roles-npiwCAmS.js} +1 -1
  168. package/dist/client/assets/{schema-D8AYNAy-.js → schema-t2BCCSG_.js} +1 -1
  169. package/dist/client/assets/{scroll-area-B1JJpr8q.js → scroll-area-B65aUbeU.js} +1 -1
  170. package/dist/client/assets/{search-input-CXLNkNlg.js → search-input-B8CD4GuP.js} +1 -1
  171. package/dist/client/assets/{secrets-Ca2KPdh8.js → secrets-C6sHJALS.js} +1 -1
  172. package/dist/client/assets/{sections-editor-CNhE5pkV.js → sections-editor-BslE1_a0.js} +1 -1
  173. package/dist/client/assets/{select-BmVeV1Oo.js → select-BPrUFCUH.js} +1 -1
  174. package/dist/client/assets/{select-model-DkVH4gVC.js → select-model-tWr3AELq.js} +1 -1
  175. package/dist/client/assets/{self-tool-result-B86OvIYq.js → self-tool-result-CFOjIdNd.js} +1 -1
  176. package/dist/client/assets/{seo-editor-5tJg1G9U.js → seo-editor-91mKoEGU.js} +1 -1
  177. package/dist/client/assets/{settings-layout-CAPV6Q6Z.js → settings-layout-B82LAkUC.js} +1 -1
  178. package/dist/client/assets/{shell-controls-Cpo2ou-z.js → shell-controls-WnpG5EUP.js} +1 -1
  179. package/dist/client/assets/{shell-layout-DRlxyJgc.js → shell-layout-Br2i63X9.js} +1 -1
  180. package/dist/client/assets/{skill-preview-BX5g9fdR.js → skill-preview-CdOTeq68.js} +1 -1
  181. package/dist/client/assets/{skills-DBsfZCk9.js → skills-D-6GjN0l.js} +1 -1
  182. package/dist/client/assets/{spinner-C4CawlPH.js → spinner-qaRZoI-h.js} +1 -1
  183. package/dist/client/assets/{sso-CISXL3nq.js → sso-CVzxB6QV.js} +1 -1
  184. package/dist/client/assets/{store-j8ILUeQ1.js → store-Chd7Y-fP.js} +1 -1
  185. package/dist/client/assets/store-registry-DeONfXCw.js +2 -0
  186. package/dist/client/assets/{super-agent-icon-BgHgBnGI.js → super-agent-icon-0ovU2hoU.js} +1 -1
  187. package/dist/client/assets/{switch-Bjx8pCq6.js → switch-CQSBTLyw.js} +1 -1
  188. package/dist/client/assets/{synced-repos-p7vjIRrV.js → synced-repos-D_5GK1W1.js} +1 -1
  189. package/dist/client/assets/{table-CH6JgQ5S.js → table-BvVnzPED.js} +1 -1
  190. package/dist/client/assets/{tabs-CQgkEoZ3.js → tabs-BQt0J04y.js} +1 -1
  191. package/dist/client/assets/{task-board-5gg33Ohs.js → task-board-BkvpnY9-.js} +1 -1
  192. package/dist/client/assets/{tasks-D60a-Odp.js → tasks-Dfa_uAGS.js} +1 -1
  193. package/dist/client/assets/{textarea-9Rz3z4Fn.js → textarea-CV-ocC88.js} +1 -1
  194. package/dist/client/assets/{thread-route-DeHkzwDt.js → thread-route-DN2Q30L2.js} +1 -1
  195. package/dist/client/assets/{toggle-group-ZsqxhHJY.js → toggle-group-UoWQ_AtK.js} +1 -1
  196. package/dist/client/assets/{toolbar-CElQJFOW.js → toolbar-D-0oFxmT.js} +1 -1
  197. package/dist/client/assets/{track-Bm2TIrkx.js → track-Cub3Lb2y.js} +1 -1
  198. package/dist/client/assets/{types-DQk9hRll.js → types-BTwf5TlH.js} +1 -1
  199. package/dist/client/assets/{use-ai-providers-aLNvcjYm.js → use-ai-providers-Cn2yDSye.js} +1 -1
  200. package/dist/client/assets/{use-api-keys-UXPEqfgx.js → use-api-keys-D6gaGAjx.js} +1 -1
  201. package/dist/client/assets/{use-automations-CFWyNfS1.js → use-automations-iQEkQijk.js} +1 -1
  202. package/dist/client/assets/{use-autosave-Dq4geAJo.js → use-autosave-DadYZ6sr.js} +1 -1
  203. package/dist/client/assets/{use-connection-VZ53ErwX.js → use-connection-DcqZj-F6.js} +1 -1
  204. package/dist/client/assets/{use-copy-CG3mMOGM.js → use-copy-CITJlsiy.js} +1 -1
  205. package/dist/client/assets/{use-create-virtual-mcp-DFwltqic.js → use-create-virtual-mcp-Ih6DOo09.js} +1 -1
  206. package/dist/client/assets/{use-debounced-autosave-C5UaQZ0N.js → use-debounced-autosave-Btd2LOd8.js} +1 -1
  207. package/dist/client/assets/{use-debounced-value-CbZNeTWE.js → use-debounced-value-BxU7i6-p.js} +1 -1
  208. package/dist/client/assets/{use-decopilot-events-DjOPFnW5.js → use-decopilot-events-DuC0EbuZ.js} +1 -1
  209. package/dist/client/assets/{use-delete-connection-D_vjQVZS.js → use-delete-connection-DFHWsi9k.js} +1 -1
  210. package/dist/client/assets/{use-deployment-admin-BDwdk9i9.js → use-deployment-admin-BjOMAAY-.js} +1 -1
  211. package/dist/client/assets/{use-destination-route-5ohWT7Qh.js → use-destination-route-Bwq_DPii.js} +1 -1
  212. package/dist/client/assets/{use-file-configs-CsmxRybV.js → use-file-configs-B9XSPn7m.js} +1 -1
  213. package/dist/client/assets/{use-infinite-scroll-BlsiddiC.js → use-infinite-scroll-C2jw4kdn.js} +1 -1
  214. package/dist/client/assets/{use-join-requests-BGqw0ibm.js → use-join-requests-CKexvxjN.js} +1 -1
  215. package/dist/client/assets/{use-mcp-auth-status-BMecBA5H.js → use-mcp-auth-status-B6vKC19j.js} +1 -1
  216. package/dist/client/assets/{use-mcp-client-BSJVCOyq.js → use-mcp-client-DutrBTnT.js} +1 -1
  217. package/dist/client/assets/{use-mcp-tools-Cfilxpil.js → use-mcp-tools-DzgtLEIJ.js} +1 -1
  218. package/dist/client/assets/{use-members-j7jWCFsT.js → use-members-DbV9xmyX.js} +1 -1
  219. package/dist/client/assets/{use-navigate-to-agent-q-tSB2RT.js → use-navigate-to-agent-CcVU_Ryk.js} +1 -1
  220. package/dist/client/assets/{use-org-auth-client-ByKmCPrY.js → use-org-auth-client-B6iUTUcY.js} +1 -1
  221. package/dist/client/assets/{use-org-repo-syncs-C0jcZ4_s.js → use-org-repo-syncs-EJuBIpSm.js} +1 -1
  222. package/dist/client/assets/{use-org-sso-DQw6J9tz.js → use-org-sso-QzYNJ2_E.js} +1 -1
  223. package/dist/client/assets/{use-organization-roles-CGewgr2G.js → use-organization-roles-CJUZNmDU.js} +1 -1
  224. package/dist/client/assets/{use-organization-settings-MqNQsyj4.js → use-organization-settings-BKp-wao-.js} +1 -1
  225. package/dist/client/assets/{use-panel-navigate-DgzMtV_g.js → use-panel-navigate-Hc2laixt.js} +1 -1
  226. package/dist/client/assets/{use-registry-connections-eAaDtKjz.js → use-registry-connections-DoFwJATj.js} +1 -1
  227. package/dist/client/assets/{use-secrets-L2RIZChP.js → use-secrets-ZK76w5qn.js} +1 -1
  228. package/dist/client/assets/{use-section-preview-base-D4Uenzpk.js → use-section-preview-base-CcgeQUfT.js} +1 -1
  229. package/dist/client/assets/{use-status-sounds-BEnPvRlF.js → use-status-sounds-DFquzdaG.js} +1 -1
  230. package/dist/client/assets/{use-tags-DtZPkyN3.js → use-tags-BBJMCH1R.js} +1 -1
  231. package/dist/client/assets/{use-view-mode-Co0Tc3Mm.js → use-view-mode-BmofvN5B.js} +1 -1
  232. package/dist/client/assets/{use-virtual-mcp-rD7iTKaS.js → use-virtual-mcp-RRdOWPQj.js} +1 -1
  233. package/dist/client/assets/useInfiniteQuery-DWm9g10K.js +1 -0
  234. package/dist/client/assets/useSuspenseInfiniteQuery-DT-LGN37.js +1 -0
  235. package/dist/client/assets/{users-DzAbrtJN.js → users-BUfRCBZX.js} +1 -1
  236. package/dist/client/assets/{variant-calendar-KXgZBkDT.js → variant-calendar-BH8j4l6C.js} +1 -1
  237. package/dist/client/assets/{view-mode-toggle-C51uvdGs.js → view-mode-toggle-Cc_85Q-g.js} +1 -1
  238. package/dist/client/index.html +1 -1
  239. package/dist/server/cli.js +1 -1
  240. package/dist/server/server.js +1 -1
  241. package/package.json +1 -1
  242. package/dist/client/assets/automations-B5H5aosp.js +0 -1
  243. package/dist/client/assets/record-editor-BHDcqWBQ.js +0 -1
  244. package/dist/client/assets/registry-B651gXvI.js +0 -2
  245. package/dist/client/assets/store-registry-CZfZeq46.js +0 -2
  246. package/dist/client/assets/useInfiniteQuery-Dq0Mnrq6.js +0 -1
  247. package/dist/client/assets/useSuspenseInfiniteQuery-Cohw3A6l.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as ae,b as xe,H as Tt,o as nt,K as Be,r as ne,j as t,Y as Ue,n as qe,p as Ze,e as Fe,t as ge,B as be}from"./index-DzWX3Cp7.js";import{e as De,b2 as vt,ax as Nt}from"./agent-icon-XAlp8Jca.js";import{i as Pt}from"./Check-DSjqiSlI.js";import{i as wt}from"./ChevronRight-CFq-xjDr.js";import{a as it}from"./Copy01-DFbLtEE_.js";import{a as St}from"./UserSquare-Ci10BLiP.js";import{s as kt}from"./Trash01-B6uMSqgT.js";import{B as Le}from"./badge-uxylkj2W.js";import{C as Je}from"./checkbox-BBMI6E1M.js";import{I as Qe}from"./input-CeihZKzh.js";import{L as Oe}from"./label-CSACuw4I.js";import{a as st,d as _t,T as Ct,c as Kt,e as $t,b as Et}from"./table-CH6JgQ5S.js";import{k as At,m as Dt,b as Ot,C as qt,a as Lt}from"./chart-GkhxWJ7A.js";import{g as zt,c as Mt,d as Rt,b as Ft,f as It,e as Bt,a as Vt,A as Ht}from"./alert-dialog-DaZn9Nvz.js";import{c as rt,d as ot,b as ct,D as dt,e as Ut}from"./dialog-DTBCjL3p.js";import{E as Re}from"./empty-state-tnyEwnqd.js";import{a as Qt}from"./use-virtual-mcp-rD7iTKaS.js";import{r as Yt}from"./site-slug-uya6Wp4-.js";import{A as Wt,a as Gt,X as Jt}from"./AreaChart-DJSypADj.js";import{C as Xt,Y as Zt}from"./YAxis-JqlW1pzJ.js";import"./AlertCircle-CvTl8GUk.js";import"./Tool01-FZuiStzo.js";import"./ArrowUp-D8TsT0Lm.js";import"./ArrowLeft-En4cxPnP.js";import"./Tool02-4ay4Rltz.js";import"./XCircle-fDpSGJss.js";import"./TrendUp01-BlXVhMez.js";import"./ZapSquare-CuLB3vSB.js";import"./ZoomOut-DBEFR5j8.js";import"./Users03-DoYa8GlE.js";import"./CheckCircle-D6G-NhwM.js";import"./ChevronDown-DhjGSQsl.js";import"./ChevronSelectorVertical-BE4HzvdJ.js";import"./ChevronUp-B8O2JP9t.js";import"./DotsVertical-D9HzRd7W.js";import"./Stars02-CNJhdHZL.js";import"./CreditCard01-BedV58xE.js";import"./Download01-fMmULFBI.js";import"./Settings02-vjLIHGa1.js";import"./Eye-Dsgi67Qs.js";import"./FilterLines-_6k9yUOL.js";import"./Share07-C1Uf7qgT.js";import"./GitBranch01-DtCvW7mH.js";import"./Globe01-CpbZ1qSV.js";import"./Globe04-sA6q1ulU.js";import"./SwitchHorizontal01-CVGPFZX2.js";import"./HardDrive-jZCTSG6y.js";import"./Image01-QhTk0EJi.js";import"./Key01-DI1s7GXT.js";import"./LinkExternal01-BZQeEyC_.js";import"./LockUnlocked01-D6aTu88G.js";import"./LogOut01-C-Z_9N06.js";import"./Monitor01-CKGo6W4T.js";import"./Sun-C_FOMwDI.js";import"./Package-GAQe_Wih.js";import"./Palette-wN0ma8Xt.js";import"./Play-C9_Cyluj.js";import"./Plus-C1-Ar8V6.js";import"./SearchLg-C6D1oQXi.js";import"./SearchMd-Cbw_793f.js";import"./Shield01-Ce5yG-A0.js";import"./Stars01-DrMQPFwe.js";import"./Upload01-ILgL8mQU.js";import"./User01-BP-jVp5a.js";import"./Users01-7X-sDRIV.js";import"./XClose-Bk3zrAvS.js";import"./Zap-CWUKEmdj.js";import"./index-CljteriX.js";import"./use-mcp-client-BSJVCOyq.js";import"./constants-dLUUoWH7.js";import"./auth-u2nXBxlp.js";const mt=[{key:"core",labelKey:"mainPanelTabs.analyticsTab.moduleCore",hintKey:"mainPanelTabs.analyticsTab.moduleCoreHint"},{key:"commerce",labelKey:"mainPanelTabs.analyticsTab.moduleCommerce",hintKey:"mainPanelTabs.analyticsTab.moduleCommerceHint"},{key:"vitals",labelKey:"mainPanelTabs.analyticsTab.moduleVitals",hintKey:"mainPanelTabs.analyticsTab.moduleVitalsHint"},{key:"errors",labelKey:"mainPanelTabs.analyticsTab.moduleErrors",hintKey:"mainPanelTabs.analyticsTab.moduleErrorsHint"},{key:"engagement",labelKey:"mainPanelTabs.analyticsTab.moduleEngagement",hintKey:"mainPanelTabs.analyticsTab.moduleEngagementHint"}],es=[{view:"live",labelKey:"mainPanelTabs.analyticsTab.viewLive"},{view:"overview",labelKey:"mainPanelTabs.analyticsTab.viewOverview"},{view:"behaviour",labelKey:"mainPanelTabs.analyticsTab.viewBehaviour"},{view:"events",labelKey:"mainPanelTabs.analyticsTab.viewEvents"},{view:"errors",labelKey:"mainPanelTabs.analyticsTab.viewErrors"},{view:"experiments",labelKey:"mainPanelTabs.analyticsTab.viewExperiments"},{view:"vitals",labelKey:"mainPanelTabs.analyticsTab.viewVitals"},{view:"quality",labelKey:"mainPanelTabs.analyticsTab.viewQuality"},{view:"usage",labelKey:"mainPanelTabs.analyticsTab.viewUsage"}],ts=["5m","15m","30m","1h","24h","7d","30d"],ss=new Set(["usageScope","currency","currencies","dimensions","operators","goals","goal","range","site","view","propKey","filters","usageExplained"]),ft=/^(t|ts|bucket|minute|min|hour|day|date)$/i;function as(r){const e=r instanceof Error?r.message.toLowerCase():"";return e.includes("unauthorized")||e.includes("401")}function ut(r){const e=r instanceof Error?r.message.toLowerCase():"";return e.includes("not_configured")||e.includes("not configured")}function Ve(r){return r instanceof Error?r.message:String(r)}function je(r){const e=r.replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return e.charAt(0).toUpperCase()+e.slice(1)}function Ye(r){const e=typeof r=="number"?r:Number(r);return Number.isFinite(e)?new Intl.NumberFormat().format(e):"—"}function We(r){if(r==null||r==="")return"—";if(Array.isArray(r))return r.length?r.map(e=>String(e)).join(", "):"—";if(typeof r=="number")return Ye(r);if(typeof r=="object")try{return JSON.stringify(r)}catch{return String(r)}return String(r)}function ls(r){return r===null||["string","number","boolean"].includes(typeof r)}async function xt(r){const e=await fetch(r),n=await e.json().catch(()=>({}));if(!e.ok){const a=n&&typeof n=="object"&&"error"in n?String(n.error):`request failed (${e.status})`;throw new Error(a)}return n}async function Ie(r,e,n){const a=await fetch(r,{method:e,headers:n!==void 0?{"Content-Type":"application/json"}:{},body:n!==void 0?JSON.stringify(n):void 0}),c=await a.json().catch(()=>({}));if(!a.ok){const o=c&&typeof c=="object"&&"error"in c?String(c.error):`request failed (${a.status})`;throw new Error(o)}return c}function he(r){const e=ae.c(12),{title:n,action:a,children:c}=r;let o;e[0]!==n?(o=t.jsx("h3",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let s;e[2]!==a?(s=a&&t.jsx("div",{className:"ml-auto",children:a}),e[2]=a,e[3]=s):s=e[3];let l;e[4]!==o||e[5]!==s?(l=t.jsxs("header",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[o,s]}),e[4]=o,e[5]=s,e[6]=l):l=e[6];let i;e[7]!==c?(i=t.jsx("div",{className:"p-4",children:c}),e[7]=c,e[8]=i):i=e[8];let d;return e[9]!==l||e[10]!==i?(d=t.jsxs("section",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,i]}),e[9]=l,e[10]=i,e[11]=d):d=e[11],d}function Ge(r,e){if(e==null)return"—";const n=Number(e);if(!Number.isFinite(n))return We(e);if(/(pct|rate|bounce|ratio)/i.test(r))return`${Math.round(n)}%`;if(/(_s$|duration|seconds)/i.test(r)){const a=Math.floor(n/60);return a?`${a}m ${Math.round(n%60)}s`:`${Math.round(n)}s`}return Ye(n)}const ns={kpis:"Overview",series:"Traffic over time",funnel:"Funnel",sources:"Top sources",pages:"Top pages",entryPages:"Entry pages",exitPages:"Exit pages",devices:"Devices",os:"Operating systems",browser:"Browsers",countries:"Countries",regions:"Regions",cities:"Cities",channels:"Channels",channelConversion:"Channel conversion",campaigns:"Campaigns",campaignNames:"Campaign names",attribution:"Attribution",products:"Top products",events:"Events",errors:"Errors",propKeys:"Property keys",propValues:"Property values",scrollDepth:"Scroll depth",searches:"Site searches",outbound:"Outbound links",downloads:"Downloads",variants:"Experiment variants",vitals:"Web vitals",vitalsByPage:"Vitals by page",liveVisitors:"Live visitors",livePages:"Active pages",liveFeed:"Live feed",liveByMinute:"Visitors per minute",usage:"Usage",usageTrend:"Usage over time",usageSites:"Usage by site"},at=["pages","sources","channels","devices","browser","os","countries","regions","cities","entryPages","exitPages","campaigns","products","events","errors"];function pt(r){return ns[r]??je(r)}function is(r){if(r.length<4)return null;const e=Math.floor(r.length/2),n=r.slice(0,e).reduce((c,o)=>c+o,0),a=r.slice(e).reduce((c,o)=>c+o,0);return n===0?null:(a-n)/n*100}function rs(r){const e=ae.c(8),{pct:n,goodDown:a}=r,c=n>=0,s=(a?!c:c)?"text-[var(--chart-2,#16a34a)]":"text-destructive";let l;e[0]!==s?(l=qe("text-xs font-medium tabular-nums",s),e[0]=s,e[1]=l):l=e[1];const i=c?"↑":"↓";let d;e[2]!==n?(d=Math.abs(Math.round(n)),e[2]=n,e[3]=d):d=e[3];let m;return e[4]!==l||e[5]!==i||e[6]!==d?(m=t.jsxs("span",{className:l,children:[i,d,"%"]}),e[4]=l,e[5]=i,e[6]=d,e[7]=m):m=e[7],m}const os=new Set(["min_sampling","sessions_built"]);function cs(r){const e=ae.c(2),{row:n}=r;let a;if(e[0]!==n){const c=Object.entries(n).filter(ms);a=t.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:c.map(ds)}),e[0]=n,e[1]=a}else a=e[1];return a}function ds(r){const[e,n]=r;return t.jsxs("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-4",children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:je(e)}),t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:Ge(e,n)})]},e)}function ms(r){const[e,n]=r;return(typeof n=="number"||n===null)&&!os.has(e)}function fs(r){if(!Number.isFinite(r))return"";const e=Math.abs(r);return e>=1e6?`${(r/1e6).toFixed(1)}M`:e>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function bt(r){const e=ae.c(39),{rows:n,timeKey:a,metricKeys:c}=r;let o,s,l,i,d,m,g,b,p,u,v,h,y;if(e[0]!==c||e[1]!==n||e[2]!==a){l=c.filter(Boolean).slice(0,4);const T=l.map(xs),N=n.map(S=>{const P={label:String(S[a]??"")};for(const w of l)P[w]=Number(S[w])||0;return P}),_=Object.fromEntries(l.map((S,P)=>[S,{label:je(S),color:T[P]}]));s=Ot,y=_,d="h-64 w-full",o=Gt,i=N,e[16]===Symbol.for("react.memo_cache_sentinel")?(m={top:8,right:-8,bottom:8,left:0},e[16]=m):m=e[16],g=t.jsx("defs",{children:l.map((S,P)=>t.jsxs("linearGradient",{id:`dq-grad-${S}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:T[P],stopOpacity:.2}),t.jsx("stop",{offset:"100%",stopColor:T[P],stopOpacity:0})]},S))}),e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Xt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[17]=b):b=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Jt,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},tickMargin:8,minTickGap:40,interval:"preserveStartEnd",tickFormatter:us}),e[18]=p):p=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Zt,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},tickFormatter:fs,width:40,tickCount:5}),e[19]=u):u=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(qt,{content:t.jsx(Lt,{indicator:"line"})}),e[20]=v):v=e[20],h=l.map((S,P)=>t.jsx(Wt,{type:"linear",dataKey:S,stroke:T[P],strokeWidth:2,fill:`url(#dq-grad-${S})`,dot:!1,activeDot:{r:4,fill:T[P],stroke:"var(--background)",strokeWidth:2},animationDuration:300},S)),e[0]=c,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=i,e[7]=d,e[8]=m,e[9]=g,e[10]=b,e[11]=p,e[12]=u,e[13]=v,e[14]=h,e[15]=y}else o=e[3],s=e[4],l=e[5],i=e[6],d=e[7],m=e[8],g=e[9],b=e[10],p=e[11],u=e[12],v=e[13],h=e[14],y=e[15];let x;e[21]!==l.length?(x=l.length>1&&t.jsx(At,{content:t.jsx(Dt,{})}),e[21]=l.length,e[22]=x):x=e[22];let j;e[23]!==o||e[24]!==i||e[25]!==x||e[26]!==m||e[27]!==g||e[28]!==b||e[29]!==p||e[30]!==u||e[31]!==v||e[32]!==h?(j=t.jsxs(o,{data:i,margin:m,children:[g,b,p,u,v,h,x]}),e[23]=o,e[24]=i,e[25]=x,e[26]=m,e[27]=g,e[28]=b,e[29]=p,e[30]=u,e[31]=v,e[32]=h,e[33]=j):j=e[33];let f;return e[34]!==s||e[35]!==d||e[36]!==j||e[37]!==y?(f=t.jsx(s,{config:y,className:d,children:j}),e[34]=s,e[35]=d,e[36]=j,e[37]=y,e[38]=f):f=e[38],f}function us(r){return r.replace("T"," ").slice(5,16)}function xs(r,e){return`var(--chart-${e%5+1})`}function et(r){const e=ae.c(37),{rows:n,labelKey:a,valueKey:c}=r;let o,s,l,i;if(e[0]!==a||e[1]!==n||e[2]!==c){let g;e[7]!==c?(g=(N,_)=>(Number(_[c])||0)-(Number(N[c])||0),e[7]=c,e[8]=g):g=e[8];const b=[...n].sort(g).slice(0,10);let p;e[9]!==c?(p=N=>Number(N[c])||0,e[9]=c,e[10]=p):p=e[10];const u=Math.max(1,...b.map(p));let v;e[11]!==n||e[12]!==c?(v=n.reduce((N,_)=>N+(Number(_[c])||0),0)||1,e[11]=n,e[12]=c,e[13]=v):v=e[13];const h=v;l="flex flex-col";let y;e[14]!==a?(y=je(a),e[14]=a,e[15]=y):y=e[15];let x;e[16]!==y?(x=t.jsx("span",{children:y}),e[16]=y,e[17]=x):x=e[17];let j;e[18]!==c?(j=je(c),e[18]=c,e[19]=j):j=e[19];let f;e[20]!==j?(f=t.jsx("span",{children:j}),e[20]=j,e[21]=f):f=e[21],e[22]!==f||e[23]!==x?(i=t.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:[x,f]}),e[22]=f,e[23]=x,e[24]=i):i=e[24],o="flex flex-col gap-0.5";let T;e[25]!==a||e[26]!==u||e[27]!==h||e[28]!==c?(T=(N,_)=>{const S=Number(N[c])||0;return t.jsxs("div",{className:"relative flex items-center justify-between gap-3 overflow-hidden rounded-md px-2.5 py-2",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-md bg-muted",style:{width:`${S/u*100}%`}}),t.jsx("span",{className:"relative z-10 truncate font-mono text-xs text-foreground",children:We(N[a])||"—"}),t.jsxs("span",{className:"relative z-10 shrink-0 text-sm tabular-nums text-foreground",children:[Ye(S),t.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:[Math.round(S/h*100),"%"]})]})]},_)},e[25]=a,e[26]=u,e[27]=h,e[28]=c,e[29]=T):T=e[29],s=b.map(T),e[0]=a,e[1]=n,e[2]=c,e[3]=o,e[4]=s,e[5]=l,e[6]=i}else o=e[3],s=e[4],l=e[5],i=e[6];let d;e[30]!==o||e[31]!==s?(d=t.jsx("div",{className:o,children:s}),e[30]=o,e[31]=s,e[32]=d):d=e[32];let m;return e[33]!==l||e[34]!==i||e[35]!==d?(m=t.jsxs("div",{className:l,children:[i,d]}),e[33]=l,e[34]=i,e[35]=d,e[36]=m):m=e[36],m}function gt(r){const e=ae.c(7),{row:n}=r;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[["viewed","Viewed"],["view_item","View item"],["view_item_list","View list"],["select_item","Select item"],["add_to_cart","Add to cart"],["begin_checkout","Begin checkout"],["purchase","Purchase"]],e[0]=a):a=e[0];const c=a;let o;e[1]!==n?(o=c.filter(d=>{const[m]=d;return m in n}),e[1]=n,e[2]=o):o=e[2];const s=o,l=Number(n[s[0]?.[0]??""])||1;let i;return e[3]!==l||e[4]!==n||e[5]!==s?(i=t.jsx("div",{className:"flex flex-col gap-1.5",children:s.map(d=>{const[m,g]=d,b=Number(n[m])||0;return t.jsxs("div",{className:"relative flex items-center justify-between gap-3 overflow-hidden rounded-md px-2.5 py-2",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-md bg-primary/15",style:{width:`${b/l*100}%`}}),t.jsx("span",{className:"relative z-10 text-sm text-foreground",children:g}),t.jsxs("span",{className:"relative z-10 shrink-0 text-sm tabular-nums text-muted-foreground",children:[Ye(b),t.jsxs("span",{className:"ml-2 text-xs opacity-70",children:[Math.round(b/l*100),"%"]})]})]},m)})}),e[3]=l,e[4]=n,e[5]=s,e[6]=i):i=e[6],i}function ht(r){const e=ae.c(18),{rows:n}=r;let a,c,o,s,l;if(e[0]!==n){const g=Array.from(n.reduce(ps,new Set)),b=new Set(g.filter(h=>n.some(y=>typeof y[h]=="number"))),p=g.find(h=>b.has(h)),u=[...n].sort((h,y)=>p?(Number(y[p])||0)-(Number(h[p])||0):0).slice(0,50);l="overflow-x-auto",c=Kt;const v=t.jsx(st,{className:"border-border hover:bg-transparent",children:g.map(h=>t.jsx(_t,{className:qe("h-8 whitespace-nowrap text-[11px] font-medium uppercase tracking-wide text-muted-foreground",b.has(h)&&"text-right"),children:je(h)},h))});e[6]!==v?(s=t.jsx($t,{children:v}),e[6]=v,e[7]=s):s=e[7],a=Et,o=u.map((h,y)=>t.jsx(st,{className:"border-border/50",children:g.map(x=>t.jsx(Ct,{className:qe("whitespace-nowrap py-1.5 text-sm tabular-nums",b.has(x)?"text-right text-foreground":"font-mono text-xs text-muted-foreground"),children:typeof h[x]=="number"?Ge(x,h[x]):We(h[x])},x))},y)),e[0]=n,e[1]=a,e[2]=c,e[3]=o,e[4]=s,e[5]=l}else a=e[1],c=e[2],o=e[3],s=e[4],l=e[5];let i;e[8]!==a||e[9]!==o?(i=t.jsx(a,{children:o}),e[8]=a,e[9]=o,e[10]=i):i=e[10];let d;e[11]!==c||e[12]!==s||e[13]!==i?(d=t.jsxs(c,{children:[s,i]}),e[11]=c,e[12]=s,e[13]=i,e[14]=d):d=e[14];let m;return e[15]!==l||e[16]!==d?(m=t.jsx("div",{className:l,children:d}),e[15]=l,e[16]=d,e[17]=m):m=e[17],m}function ps(r,e){return Object.keys(e).forEach(n=>r.add(n)),r}function bs(r){if(r.length===0)return null;const e=r[0]??{},n=Object.keys(e);if(r.length===1&&("viewed"in e||"purchase"in e||"add_to_cart"in e))return{kind:"funnel"};const a=n.find(l=>ft.test(l)),c=a?n.filter(l=>l!==a&&typeof e[l]=="number"):[];if(a&&c.length>0&&r.length>1)return{kind:"series",timeKey:a,metricKeys:c};const o=n.find(l=>l!==a&&typeof e[l]=="string"),s=n.find(l=>typeof e[l]=="number");return o&&s&&n.length<=3?{kind:"bars",labelKey:o,valueKey:s}:r.length===1&&!a&&!o&&Object.values(e).every(ls)?{kind:"kpi"}:{kind:"table"}}function tt(r){const e=ae.c(18),{rows:n,meta:a}=r;let c;e[0]!==n[0]?(c=n[0]??{},e[0]=n[0],e[1]=c):c=e[1];const o=c;switch(a.kind){case"kpi":{let s;return e[2]!==o?(s=t.jsx(cs,{row:o}),e[2]=o,e[3]=s):s=e[3],s}case"funnel":{let s;return e[4]!==o?(s=t.jsx(gt,{row:o}),e[4]=o,e[5]=s):s=e[5],s}case"series":{const s=a.timeKey??"";let l;e[6]!==a.metricKeys?(l=a.metricKeys??[],e[6]=a.metricKeys,e[7]=l):l=e[7];let i;return e[8]!==n||e[9]!==s||e[10]!==l?(i=t.jsx(bt,{rows:n,timeKey:s,metricKeys:l}),e[8]=n,e[9]=s,e[10]=l,e[11]=i):i=e[11],i}case"bars":{const s=a.labelKey??"",l=a.valueKey??"";let i;return e[12]!==n||e[13]!==s||e[14]!==l?(i=t.jsx(et,{rows:n,labelKey:s,valueKey:l}),e[12]=n,e[13]=s,e[14]=l,e[15]=i):i=e[15],i}default:{let s;return e[16]!==n?(s=t.jsx(ht,{rows:n}),e[16]=n,e[17]=s):s=e[17],s}}}function lt(r){const e=ae.c(8),{payload:n,t:a}=r;let c,o;if(e[0]!==n||e[1]!==a){o=Symbol.for("react.early_return_sentinel");e:{const s=Object.entries(n).filter(Ss).map(ws).filter(Ps);if(s.length===0){let m;e[4]!==a?(m=a("mainPanelTabs.analyticsTab.emptyView"),e[4]=a,e[5]=m):m=e[5];let g;e[6]!==m?(g=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[6]=m,e[7]=g):g=e[7],o=g;break e}const l=s.filter(Ns),i=s.filter(vs),d=s.filter(Ts).sort(js);c=t.jsxs("div",{className:"flex flex-col gap-4",children:[l.map(ys),i.map(hs),d.length>0&&t.jsx("div",{className:"grid gap-4 lg:grid-cols-2 xl:grid-cols-3",children:d.map(gs)})]})}e[0]=n,e[1]=a,e[2]=c,e[3]=o}else c=e[2],o=e[3];return o!==Symbol.for("react.early_return_sentinel")?o:c}function gs(r){return t.jsx(he,{title:pt(r.name),children:t.jsx(tt,{rows:r.rows,meta:r.meta})},r.name)}function hs(r){return t.jsx(he,{title:pt(r.name),children:t.jsx(tt,{rows:r.rows,meta:r.meta})},r.name)}function ys(r){return t.jsx(tt,{rows:r.rows,meta:r.meta},r.name)}function js(r,e){const n=at.indexOf(r.name),a=at.indexOf(e.name);return(n<0?999:n)-(a<0?999:a)}function Ts(r){return r.meta.kind==="bars"||r.meta.kind==="table"}function vs(r){return r.meta.kind==="series"||r.meta.kind==="funnel"}function Ns(r){return r.meta.kind==="kpi"}function Ps(r){return!!r.meta}function ws(r){const[e,n]=r;return{name:e,rows:n,meta:bs(n)}}function Ss(r){const[e,n]=r;return!ss.has(e)&&Array.isArray(n)}const ks=[["visitors","Visitors"],["pageviews","Pageviews"],["sessions","Sessions"],["bounce_pct","Bounce rate"],["duration_s","Avg duration"]];function _s(r){const e=ae.c(24),{payload:n}=r,a=xe();let c;e[0]!==n?(c=P=>Array.isArray(n[P])?n[P]:[],e[0]=n,e[1]=c):c=e[1];const o=c,s=o("kpis")[0]??{},l=o("series");let i;e[2]!==o?(i=o("sources"),e[2]=o,e[3]=i):i=e[3];const d=i;let m;e[4]!==o?(m=o("funnel"),e[4]=o,e[5]=m):m=e[5];const g=m[0],b=l[0]?Object.keys(l[0]).filter(P=>!ft.test(P)&&typeof l[0]?.[P]=="number"):[],p=ks.filter(P=>{const[w]=P;return w in s}),[u,v]=ne.useState(p.find(P=>{const[w]=P;return b.includes(w)})?.[0]??b[0]??""),h="flex flex-col gap-4",y="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",x=p.map(P=>{const[w,$]=P,k=b.includes(w),E=u===w,K=k?is(l.map(A=>Number(A[w])||0)):null;return t.jsxs("button",{type:"button",disabled:!k,onClick:()=>k&&v(w),className:qe("flex flex-col gap-1.5 rounded-xl border p-4 text-left transition-colors",E?"border-[var(--chart-1)] bg-[var(--chart-1)]/5":"border-border bg-card",k?"cursor-pointer hover:border-[var(--chart-1)]/60":"cursor-default"),children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:$}),t.jsxs("span",{className:"flex items-baseline gap-2",children:[t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:Ge(w,s[w])}),K!==null&&t.jsx(rs,{pct:K,goodDown:w==="bounce_pct"})]})]},w)});let j;e[6]!==x?(j=t.jsx("div",{className:y,children:x}),e[6]=x,e[7]=j):j=e[7];let f;e[8]!==u||e[9]!==l?(f=u&&l.length>0&&t.jsx(he,{title:`${je(u)} over time`,children:t.jsx(bt,{rows:l,timeKey:"t",metricKeys:[u]})}),e[8]=u,e[9]=l,e[10]=f):f=e[10];let T;e[11]!==d||e[12]!==a?(T=d.length>0&&t.jsx(he,{title:a("mainPanelTabs.analyticsTab.cardTopSources"),children:t.jsx(et,{rows:d,labelKey:"k",valueKey:"n"})}),e[11]=d,e[12]=a,e[13]=T):T=e[13];let N;e[14]!==g||e[15]!==a?(N=g&&t.jsx(he,{title:a("mainPanelTabs.analyticsTab.cardFunnel"),children:t.jsx(gt,{row:g})}),e[14]=g,e[15]=a,e[16]=N):N=e[16];let _;e[17]!==T||e[18]!==N?(_=t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[T,N]}),e[17]=T,e[18]=N,e[19]=_):_=e[19];let S;return e[20]!==j||e[21]!==f||e[22]!==_?(S=t.jsxs("div",{className:h,children:[j,f,_]}),e[20]=j,e[21]=f,e[22]=_,e[23]=S):S=e[23],S}function Cs(r){const e=ae.c(46),{payload:n}=r,a=xe();let c;e[0]!==n?(c=T=>Array.isArray(n[T])?n[T]:[],e[0]=n,e[1]=c):c=e[1];const o=c;let s,l,i,d,m,g;if(e[2]!==o||e[3]!==a){const T=o("liveVisitors")[0]??{};let N;e[10]!==o?(N=o("liveFeed"),e[10]=o,e[11]=N):N=e[11],s=N;let _;e[12]!==o?(_=o("livePages"),e[12]=o,e[13]=_):_=e[13],l=_;const S=[["visitors","Visitors"],["pageviews","Pageviews"],["events","Events"],["last_event","Last event"]];m="flex flex-col gap-4";let P;e[14]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs("span",{className:"relative flex size-2",children:[t.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-[var(--chart-1)] opacity-75"}),t.jsx("span",{className:"relative inline-flex size-2 rounded-full bg-[var(--chart-1)]"})]}),e[14]=P):P=e[14];let w;e[15]!==a?(w=a("mainPanelTabs.analyticsTab.liveHint"),e[15]=a,e[16]=w):w=e[16],e[17]!==w?(g=t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[P,w]}),e[17]=w,e[18]=g):g=e[18],i="grid grid-cols-2 gap-3 sm:grid-cols-4",d=S.map($=>{const[k,E]=$;return t.jsxs("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-4",children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:E}),t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:k==="last_event"?We(T[k]):Ge(k,T[k])})]},k)}),e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=i,e[7]=d,e[8]=m,e[9]=g}else s=e[4],l=e[5],i=e[6],d=e[7],m=e[8],g=e[9];let b;e[19]!==i||e[20]!==d?(b=t.jsx("div",{className:i,children:d}),e[19]=i,e[20]=d,e[21]=b):b=e[21];let p;e[22]!==a?(p=a("mainPanelTabs.analyticsTab.cardLiveFeed"),e[22]=a,e[23]=p):p=e[23];let u;e[24]!==s||e[25]!==a?(u=s.length>0?t.jsx(ht,{rows:s}):t.jsx("p",{className:"text-sm text-muted-foreground",children:a("mainPanelTabs.analyticsTab.emptyLive")}),e[24]=s,e[25]=a,e[26]=u):u=e[26];let v;e[27]!==p||e[28]!==u?(v=t.jsx(he,{title:p,children:u}),e[27]=p,e[28]=u,e[29]=v):v=e[29];let h;e[30]!==a?(h=a("mainPanelTabs.analyticsTab.cardPagesNow"),e[30]=a,e[31]=h):h=e[31];let y;e[32]!==l||e[33]!==a?(y=l.length>0?t.jsx(et,{rows:l,labelKey:"k",valueKey:"n"}):t.jsx("p",{className:"text-sm text-muted-foreground",children:a("mainPanelTabs.analyticsTab.emptyView")}),e[32]=l,e[33]=a,e[34]=y):y=e[34];let x;e[35]!==h||e[36]!==y?(x=t.jsx(he,{title:h,children:y}),e[35]=h,e[36]=y,e[37]=x):x=e[37];let j;e[38]!==x||e[39]!==v?(j=t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[v,x]}),e[38]=x,e[39]=v,e[40]=j):j=e[40];let f;return e[41]!==j||e[42]!==m||e[43]!==g||e[44]!==b?(f=t.jsxs("div",{className:m,children:[g,b,j]}),e[41]=j,e[42]=m,e[43]=g,e[44]=b,e[45]=f):f=e[45],f}function Ks(r){const e=ae.c(42),{base:n,orgSlug:a,site:c,view:o,range:s,quota:l}=r,i=xe(),d=o==="live",m=d?"5m":s;let g;e[0]!==m||e[1]!==a||e[2]!==c||e[3]!==o?(g=Be.analyticsData(a,c,o,m),e[0]=m,e[1]=a,e[2]=c,e[3]=o,e[4]=g):g=e[4];let b;e[5]!==n||e[6]!==m||e[7]!==o?(b=()=>xt(`${n}/analytics/data?view=${encodeURIComponent(o)}&range=${encodeURIComponent(m)}`),e[5]=n,e[6]=m,e[7]=o,e[8]=b):b=e[8];const p=d?0:3e4,u=d?5e3:!1;let v;e[9]!==g||e[10]!==b||e[11]!==p||e[12]!==u?(v={queryKey:g,queryFn:b,retry:!1,staleTime:p,refetchInterval:u},e[9]=g,e[10]=b,e[11]=p,e[12]=u,e[13]=v):v=e[13];const h=nt(v);if(h.isLoading){let f;return e[14]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Ue,{className:"h-20 w-full"}),t.jsx(Ue,{className:"h-64 w-full"})]}),e[14]=f):f=e[14],f}if(h.error){let f;e[15]!==h.error||e[16]!==i?(f=ut(h.error)?i("mainPanelTabs.analyticsTab.dataNotConfiguredDescription"):i("mainPanelTabs.analyticsTab.dataLoadError"),e[15]=h.error,e[16]=i,e[17]=f):f=e[17];let T;return e[18]!==f?(T=t.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[18]=f,e[19]=T):T=e[19],T}let y;e[20]!==h.data?(y=h.data??{},e[20]=h.data,e[21]=y):y=e[21];const x=y;if(!x.data){let f;e[22]!==i?(f=i("mainPanelTabs.analyticsTab.emptyView"),e[22]=i,e[23]=f):f=e[23];let T;return e[24]!==f?(T=t.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[24]=f,e[25]=T):T=e[25],T}if(d){let f;return e[26]!==x.data?(f=t.jsx(Cs,{payload:x.data}),e[26]=x.data,e[27]=f):f=e[27],f}if(o==="overview"){let f;return e[28]!==x.data?(f=t.jsx(_s,{payload:x.data}),e[28]=x.data,e[29]=f):f=e[29],f}if(o==="usage"){let f;e[30]!==l||e[31]!==x.data?(f=t.jsx($s,{quota:l,payload:x.data}),e[30]=l,e[31]=x.data,e[32]=f):f=e[32];let T;e[33]!==x.data||e[34]!==i?(T=t.jsx(lt,{payload:x.data,t:i}),e[33]=x.data,e[34]=i,e[35]=T):T=e[35];let N;return e[36]!==f||e[37]!==T?(N=t.jsxs("div",{className:"flex flex-col gap-5",children:[f,T]}),e[36]=f,e[37]=T,e[38]=N):N=e[38],N}let j;return e[39]!==x.data||e[40]!==i?(j=t.jsx(lt,{payload:x.data,t:i}),e[39]=x.data,e[40]=i,e[41]=j):j=e[41],j}function $s(r){const e=ae.c(27),{quota:n,payload:a}=r,c=xe(),o=typeof n=="number"&&n>0;let s,l,i;if(e[0]!==o||e[1]!==a||e[2]!==n||e[3]!==c){let g=null;for(const y of Object.values(a)){const x=y&&typeof y=="object"&&!Array.isArray(y)?y:Array.isArray(y)&&y[0]&&typeof y[0]=="object"?y[0]:null;if(!x)continue;const j=x.events_accepted??x.accepted??x.events;if(typeof j=="number"){g=j;break}}const b=Es;s="flex flex-col gap-2 rounded-xl border border-border bg-card p-4";let p;e[7]!==c?(p=c("mainPanelTabs.analyticsTab.monthlyQuota"),e[7]=c,e[8]=p):p=e[8];let u;e[9]!==p?(u=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:p}),e[9]=p,e[10]=u):u=e[10];let v;e[11]!==o||e[12]!==n||e[13]!==c?(v=o?`${b(n)} ${c("mainPanelTabs.analyticsTab.eventsPerMonthSuffix")}`:c("mainPanelTabs.analyticsTab.uncapped"),e[11]=o,e[12]=n,e[13]=c,e[14]=v):v=e[14];let h;e[15]!==v?(h=t.jsx("span",{className:"font-mono text-sm tabular-nums text-foreground",children:v}),e[15]=v,e[16]=h):h=e[16],e[17]!==u||e[18]!==h?(l=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u,h]}),e[17]=u,e[18]=h,e[19]=l):l=e[19],i=o&&g!==null&&t.jsx("p",{className:"text-xs text-muted-foreground",children:c("mainPanelTabs.analyticsTab.acceptedInRange",{count:b(g)})}),e[0]=o,e[1]=a,e[2]=n,e[3]=c,e[4]=s,e[5]=l,e[6]=i}else s=e[4],l=e[5],i=e[6];let d;e[20]!==o?(d=!o&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No monthly cap is set — every accepted event is stored. Set one in Configuration to enforce a limit."}),e[20]=o,e[21]=d):d=e[21];let m;return e[22]!==s||e[23]!==l||e[24]!==i||e[25]!==d?(m=t.jsxs("div",{className:s,children:[l,i,d]}),e[22]=s,e[23]=l,e[24]=i,e[25]=d,e[26]=m):m=e[26],m}function Es(r){return r.toLocaleString()}function As(r){const e=ae.c(53),{status:n}=r,a=xe(),c=n.config?.id??"",o=n.key??null,s=`<script async src="https://analytics.decocdn.com/_dq/a.js?k=${o??"YOUR_TOKEN"}"><\/script>`;let l;e[0]!==a?(l=a("mainPanelTabs.analyticsTab.installTitle"),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.analyticsTab.installHow"),e[2]=a,e[3]=i):i=e[3];let d;e[4]!==i?(d=t.jsx("p",{className:"text-sm text-muted-foreground",children:i}),e[4]=i,e[5]=d):d=e[5];let m;e[6]!==a?(m=a("mainPanelTabs.analyticsTab.installHostTitle"),e[6]=a,e[7]=m):m=e[7];let g;e[8]!==m?(g=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:m}),e[8]=m,e[9]=g):g=e[9];let b;e[10]!==a?(b=a("mainPanelTabs.analyticsTab.installAuto"),e[10]=a,e[11]=b):b=e[11];let p;e[12]!==b?(p=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[12]=b,e[13]=p):p=e[13];let u;e[14]!==g||e[15]!==p?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,p]}),e[14]=g,e[15]=p,e[16]=u):u=e[16];let v;e[17]!==a?(v=a("mainPanelTabs.analyticsTab.installKeyTitle"),e[17]=a,e[18]=v):v=e[18];let h;e[19]!==v?(h=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:v}),e[19]=v,e[20]=h):h=e[20];let y;e[21]!==o?(y=o&&t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-1.5",children:[t.jsx("code",{className:"overflow-x-auto text-xs text-foreground",children:o}),t.jsx(Xe,{text:o})]}),e[21]=o,e[22]=y):y=e[22];let x;e[23]!==s?(x=t.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[t.jsx("code",{className:"overflow-x-auto whitespace-pre-wrap break-all text-xs text-muted-foreground",children:s}),t.jsx(Xe,{text:s})]}),e[23]=s,e[24]=x):x=e[24];let j;e[25]!==a||e[26]!==o?(j=!o&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a("mainPanelTabs.analyticsTab.installTokenNote")}),e[25]=a,e[26]=o,e[27]=j):j=e[27];let f;e[28]!==h||e[29]!==y||e[30]!==x||e[31]!==j?(f=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,y,x,j]}),e[28]=h,e[29]=y,e[30]=x,e[31]=j,e[32]=f):f=e[32];let T;e[33]!==a?(T=a("mainPanelTabs.analyticsTab.installTrackPrefix"),e[33]=a,e[34]=T):T=e[34];let N;e[35]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"font-mono",children:"window.__dq"}),e[35]=N):N=e[35];let _;e[36]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"font-mono",children:"pageview()"}),e[36]=_):_=e[36];let S;e[37]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("span",{className:"font-mono",children:"track(name, props)"}),e[37]=S):S=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("span",{className:"font-mono",children:"purchase({…})"}),e[38]=P):P=e[38];let w;e[39]!==T?(w=t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T,N," —"," ",_,","," ",S,","," ",P,"."]}),e[39]=T,e[40]=w):w=e[40];let $;e[41]!==c||e[42]!==a?($=c&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("mainPanelTabs.analyticsTab.installSiteId"),":"," ",t.jsx("span",{className:"font-mono text-foreground",children:c})]}),e[41]=c,e[42]=a,e[43]=$):$=e[43];let k;e[44]!==f||e[45]!==w||e[46]!==$||e[47]!==d||e[48]!==u?(k=t.jsxs("div",{className:"flex flex-col gap-4",children:[d,u,f,w,$]}),e[44]=f,e[45]=w,e[46]=$,e[47]=d,e[48]=u,e[49]=k):k=e[49];let E;return e[50]!==l||e[51]!==k?(E=t.jsx(he,{title:l,children:k}),e[50]=l,e[51]=k,e[52]=E):E=e[52],E}function Xe(r){const e=ae.c(11),{text:n}=r,a=xe(),[c,o]=ne.useState(!1);let s;e[0]!==n?(s=()=>{navigator.clipboard?.writeText(n)?.then(()=>{o(!0),setTimeout(()=>o(!1),1500)},Ds)},e[0]=n,e[1]=s):s=e[1];let l;e[2]!==c?(l=c?t.jsx(Pt,{className:"size-4"}):t.jsx(it,{className:"size-4"}),e[2]=c,e[3]=l):l=e[3];let i;e[4]!==c||e[5]!==a?(i=a(c?"mainPanelTabs.analyticsTab.copied":"mainPanelTabs.analyticsTab.copy"),e[4]=c,e[5]=a,e[6]=i):i=e[6];let d;return e[7]!==s||e[8]!==l||e[9]!==i?(d=t.jsxs(be,{variant:"ghost",size:"sm",onClick:s,children:[l,i]}),e[7]=s,e[8]=l,e[9]=i,e[10]=d):d=e[10],d}function Ds(){}function yt(r){const e=ae.c(27),{result:n,onDismiss:a}=r,c=xe();let o;e[0]!==n.notes?(o=n.notes??[],e[0]=n.notes,e[1]=o):o=e[1];const s=o,l=!!n.key;if(!l&&!n.snippet&&s.length===0)return null;let i;e[2]!==l||e[3]!==c?(i=c(l?"mainPanelTabs.analyticsTab.tokenTitle":"mainPanelTabs.analyticsTab.registeredOk"),e[2]=l,e[3]=c,e[4]=i):i=e[4];let d;e[5]!==i?(d=t.jsx("h3",{className:"text-sm font-medium text-foreground",children:i}),e[5]=i,e[6]=d):d=e[6];let m;e[7]!==c?(m=c("mainPanelTabs.analyticsTab.dismiss"),e[7]=c,e[8]=m):m=e[8];let g;e[9]!==a||e[10]!==m?(g=t.jsx(be,{variant:"ghost",size:"sm",onClick:a,children:m}),e[9]=a,e[10]=m,e[11]=g):g=e[11];let b;e[12]!==d||e[13]!==g?(b=t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d,g]}),e[12]=d,e[13]=g,e[14]=b):b=e[14];let p;e[15]!==l||e[16]!==c?(p=l&&t.jsx("p",{className:"text-xs text-muted-foreground",children:c("mainPanelTabs.analyticsTab.tokenOnce")}),e[15]=l,e[16]=c,e[17]=p):p=e[17];let u;e[18]!==n.snippet?(u=n.snippet&&t.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[t.jsx("code",{className:"overflow-x-auto whitespace-pre-wrap break-all text-xs text-muted-foreground",children:n.snippet}),t.jsx(Xe,{text:n.snippet})]}),e[18]=n.snippet,e[19]=u):u=e[19];let v;e[20]!==s?(v=s.length>0&&t.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(Os)}),e[20]=s,e[21]=v):v=e[21];let h;return e[22]!==b||e[23]!==p||e[24]!==u||e[25]!==v?(h=t.jsxs("section",{className:"flex flex-col gap-3 rounded-xl border border-primary/30 bg-primary/5 p-4",children:[b,p,u,v]}),e[22]=b,e[23]=p,e[24]=u,e[25]=v,e[26]=h):h=e[26],h}function Os(r,e){return t.jsx("li",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-400",children:r},e)}function qs(r){const e=ae.c(96),{base:n,orgSlug:a,site:c,host:o,onRegistered:s}=r,l=xe(),i=Ze();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=new Set(["core","commerce","vitals"]),e[0]=d):d=e[0];const[m,g]=ne.useState(d),[b,p]=ne.useState(""),[u,v]=ne.useState(!1),[h,y]=ne.useState("");let x;e[1]!==n?(x=C=>Ie(`${n}/analytics/register`,"POST",C),e[1]=n,e[2]=x):x=e[2];let j;e[3]!==s||e[4]!==a||e[5]!==i||e[6]!==c||e[7]!==l?(j=C=>{i.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),s(C),ge.success(l("mainPanelTabs.analyticsTab.toastRegistered"))},e[3]=s,e[4]=a,e[5]=i,e[6]=c,e[7]=l,e[8]=j):j=e[8];let f;e[9]!==x||e[10]!==j?(f={mutationFn:x,onSuccess:j,onError:zs},e[9]=x,e[10]=j,e[11]=f):f=e[11];const T=Fe(f);let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=C=>{C!=="core"&&g(Y=>{const L=new Set(Y);return L.has(C)?L.delete(C):L.add(C),L})},e[12]=N):N=e[12];const _=N;let S,P,w,$,k,E,K;if(e[13]!==h||e[14]!==o||e[15]!==b||e[16]!==T||e[17]!==m||e[18]!==l||e[19]!==u){P=h.split(/[\s,]+/).map(Ls).filter(Boolean),w=()=>{if(u){T.mutate({key:!0,domains:P,modules:[...m]});return}const Y=b.trim();T.mutate({modules:[...m],...Y?{host:Y}:{}})};const C=b.trim()||o||l("mainPanelTabs.analyticsTab.registerHostFallback");S=he,e[27]!==l?(K=l("mainPanelTabs.analyticsTab.registerTitle"),e[27]=l,e[28]=K):K=e[28],E="flex flex-col gap-5",$="text-sm text-muted-foreground",k=l("mainPanelTabs.analyticsTab.registerDescription",{host:u?P[0]||"your domains":C}),e[13]=h,e[14]=o,e[15]=b,e[16]=T,e[17]=m,e[18]=l,e[19]=u,e[20]=S,e[21]=P,e[22]=w,e[23]=$,e[24]=k,e[25]=E,e[26]=K}else S=e[20],P=e[21],w=e[22],$=e[23],k=e[24],E=e[25],K=e[26];let A;e[29]!==$||e[30]!==k?(A=t.jsx("p",{className:$,children:k}),e[29]=$,e[30]=k,e[31]=A):A=e[31];let te;e[32]!==l?(te=l("mainPanelTabs.analyticsTab.modules"),e[32]=l,e[33]=te):te=e[33];let D;e[34]!==te?(D=t.jsx(Oe,{children:te}),e[34]=te,e[35]=D):D=e[35];let W;e[36]!==m||e[37]!==l?(W=mt.map(C=>{const Y=C.key==="core",L=Y||m.has(C.key);return t.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 hover:border-border/70",children:[t.jsx(Je,{checked:L,disabled:Y,onCheckedChange:()=>_(C.key),className:"mt-0.5"}),t.jsxs("span",{className:"flex flex-col",children:[t.jsx("span",{className:"text-sm font-medium text-foreground",children:l(C.labelKey)}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l(C.hintKey)})]})]},C.key)}),e[36]=m,e[37]=l,e[38]=W):W=e[38];let O;e[39]!==W?(O=t.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:W}),e[39]=W,e[40]=O):O=e[40];let G;e[41]!==D||e[42]!==O?(G=t.jsxs("div",{className:"flex flex-col gap-2",children:[D,O]}),e[41]=D,e[42]=O,e[43]=G):G=e[43];let M;e[44]===Symbol.for("react.memo_cache_sentinel")?(M=C=>v(!!C),e[44]=M):M=e[44];let X;e[45]!==u?(X=t.jsx(Je,{checked:u,onCheckedChange:M,className:"mt-0.5"}),e[45]=u,e[46]=X):X=e[46];let R;e[47]!==l?(R=l("mainPanelTabs.analyticsTab.registerByKey"),e[47]=l,e[48]=R):R=e[48];let F;e[49]!==R?(F=t.jsx("span",{className:"text-sm font-medium text-foreground",children:R}),e[49]=R,e[50]=F):F=e[50];let Z;e[51]!==l?(Z=l("mainPanelTabs.analyticsTab.registerByKeyHint"),e[51]=l,e[52]=Z):Z=e[52];let ee;e[53]!==Z?(ee=t.jsx("span",{className:"text-xs text-muted-foreground",children:Z}),e[53]=Z,e[54]=ee):ee=e[54];let I;e[55]!==F||e[56]!==ee?(I=t.jsxs("span",{className:"flex flex-col",children:[F,ee]}),e[55]=F,e[56]=ee,e[57]=I):I=e[57];let B;e[58]!==X||e[59]!==I?(B=t.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 hover:border-border/70",children:[X,I]}),e[58]=X,e[59]=I,e[60]=B):B=e[60];let V;e[61]!==h||e[62]!==o||e[63]!==b||e[64]!==l||e[65]!==u?(V=u?t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Oe,{htmlFor:"analytics-domains",children:l("mainPanelTabs.analyticsTab.domainsLabel")}),t.jsx(Qe,{id:"analytics-domains",value:h,onChange:C=>y(C.target.value),placeholder:l("mainPanelTabs.analyticsTab.domainsPlaceholder"),className:"font-mono text-xs"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l("mainPanelTabs.analyticsTab.domainsHint")})]}):!o&&t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Oe,{htmlFor:"analytics-host",children:l("mainPanelTabs.analyticsTab.hostLabel")}),t.jsx(Qe,{id:"analytics-host",value:b,onChange:C=>p(C.target.value),placeholder:l("mainPanelTabs.analyticsTab.hostPlaceholder"),className:"font-mono text-xs"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l("mainPanelTabs.analyticsTab.hostHint")})]}),e[61]=h,e[62]=o,e[63]=b,e[64]=l,e[65]=u,e[66]=V):V=e[66];let H;e[67]!==l?(H=l("mainPanelTabs.analyticsTab.registerInstallHint"),e[67]=l,e[68]=H):H=e[68];let q;e[69]!==H?(q=t.jsx("p",{className:"text-xs text-muted-foreground",children:H}),e[69]=H,e[70]=q):q=e[70];let U;e[71]!==P||e[72]!==o||e[73]!==b||e[74]!==T.isPending||e[75]!==u?(U=T.isPending||(u?P.length===0:!o&&!b.trim()),e[71]=P,e[72]=o,e[73]=b,e[74]=T.isPending,e[75]=u,e[76]=U):U=e[76];let Q;e[77]!==T.isPending||e[78]!==l?(Q=T.isPending?l("mainPanelTabs.analyticsTab.enabling"):l("mainPanelTabs.analyticsTab.enableAnalytics"),e[77]=T.isPending,e[78]=l,e[79]=Q):Q=e[79];let J;e[80]!==w||e[81]!==U||e[82]!==Q?(J=t.jsx("div",{className:"flex justify-end",children:t.jsx(be,{onClick:w,disabled:U,children:Q})}),e[80]=w,e[81]=U,e[82]=Q,e[83]=J):J=e[83];let se;e[84]!==A||e[85]!==G||e[86]!==B||e[87]!==V||e[88]!==q||e[89]!==J||e[90]!==E?(se=t.jsxs("div",{className:E,children:[A,G,B,V,q,J]}),e[84]=A,e[85]=G,e[86]=B,e[87]=V,e[88]=q,e[89]=J,e[90]=E,e[91]=se):se=e[91];let le;return e[92]!==S||e[93]!==se||e[94]!==K?(le=t.jsx(S,{title:K,children:se}),e[92]=S,e[93]=se,e[94]=K,e[95]=le):le=e[95],le}function Ls(r){return r.trim()}function zs(r){return ge.error(Ve(r))}function Ms(r){const e=ae.c(108),{base:n,orgSlug:a,site:c,config:o,open:s,onOpenChange:l}=r,i=xe(),d=Ze();let m;e[0]!==o.modules?(m=o.modules??["core"],e[0]=o.modules,e[1]=m):m=e[1];let g;e[2]!==m?(g=new Set(m),e[2]=m,e[3]=g):g=e[3];const[b,p]=ne.useState(g);let u;e[4]!==o.sampling?(u=Math.round((o.sampling??1)*100),e[4]=o.sampling,e[5]=u):u=e[5];const[v,h]=ne.useState(String(u)),[y,x]=ne.useState(typeof o.quota=="number"&&o.quota>0?String(o.quota):"");let j;e[6]!==n?(j=z=>Ie(`${n}/analytics/config`,"PUT",z),e[6]=n,e[7]=j):j=e[7];let f;e[8]!==l||e[9]!==a||e[10]!==d||e[11]!==c||e[12]!==i?(f=()=>{d.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),ge.success(i("mainPanelTabs.analyticsTab.toastCollectionUpdated")),l(!1)},e[8]=l,e[9]=a,e[10]=d,e[11]=c,e[12]=i,e[13]=f):f=e[13];let T;e[14]!==j||e[15]!==f?(T={mutationFn:j,onSuccess:f,onError:Rs},e[14]=j,e[15]=f,e[16]=T):T=e[16];const N=Fe(T);let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=z=>{z!=="core"&&p(fe=>{const ue=new Set(fe);return ue.has(z)?ue.delete(z):ue.add(z),ue})},e[17]=_):_=e[17];const S=_;let P;e[18]!==y?(P=y.trim()===""?null:Number(y),e[18]=y,e[19]=P):P=e[19];const w=P,$=w!==null&&(!Number.isInteger(w)||w<1)?"Quota must be a positive whole number of events.":null;let k;e[20]!==o.quota||e[21]!==y?(k=y.trim()===""&&typeof o.quota=="number"&&o.quota>0,e[20]=o.quota,e[21]=y,e[22]=k):k=e[22];const E=k;let K;e[23]!==$||e[24]!==w||e[25]!==v||e[26]!==N||e[27]!==b?(K=()=>{if($)return;const z=Number(v),fe=Number.isFinite(z)&&z>0?Math.min(z,100)/100:1;N.mutate({modules:[...b],sampling:fe,...w!==null?{quota:w}:{}})},e[23]=$,e[24]=w,e[25]=v,e[26]=N,e[27]=b,e[28]=K):K=e[28];const A=K;let te;e[29]!==i?(te=i("mainPanelTabs.analyticsTab.editTitle"),e[29]=i,e[30]=te):te=e[30];let D;e[31]!==te?(D=t.jsx(rt,{children:t.jsx(ot,{children:te})}),e[31]=te,e[32]=D):D=e[32];let W;e[33]!==i?(W=i("mainPanelTabs.analyticsTab.editModules"),e[33]=i,e[34]=W):W=e[34];let O;e[35]!==W?(O=t.jsx(Oe,{children:W}),e[35]=W,e[36]=O):O=e[36];let G;e[37]!==b||e[38]!==i?(G=mt.map(z=>{const fe=z.key==="core",ue=fe||b.has(z.key);return t.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border px-3 py-2 hover:border-border/70",children:[t.jsx(Je,{checked:ue,disabled:fe,onCheckedChange:()=>S(z.key)}),t.jsx("span",{className:"text-sm text-foreground",children:i(z.labelKey)})]},z.key)}),e[37]=b,e[38]=i,e[39]=G):G=e[39];let M;e[40]!==G?(M=t.jsx("div",{className:"grid grid-cols-1 gap-2",children:G}),e[40]=G,e[41]=M):M=e[41];let X;e[42]!==O||e[43]!==M?(X=t.jsxs("div",{className:"flex flex-col gap-2",children:[O,M]}),e[42]=O,e[43]=M,e[44]=X):X=e[44];let R;e[45]!==i?(R=i("mainPanelTabs.analyticsTab.editSampling"),e[45]=i,e[46]=R):R=e[46];let F;e[47]!==R?(F=t.jsx(Oe,{htmlFor:"analytics-sampling",children:R}),e[47]=R,e[48]=F):F=e[48];let Z;e[49]===Symbol.for("react.memo_cache_sentinel")?(Z=z=>h(z.target.value),e[49]=Z):Z=e[49];let ee;e[50]!==v?(ee=t.jsx(Qe,{id:"analytics-sampling",type:"number",min:1,max:100,value:v,onChange:Z,className:"font-mono text-xs"}),e[50]=v,e[51]=ee):ee=e[51];let I;e[52]!==i?(I=i("mainPanelTabs.analyticsTab.editSamplingHint"),e[52]=i,e[53]=I):I=e[53];let B;e[54]!==I?(B=t.jsx("span",{className:"text-xs text-muted-foreground",children:I}),e[54]=I,e[55]=B):B=e[55];let V;e[56]!==F||e[57]!==ee||e[58]!==B?(V=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[F,ee,B]}),e[56]=F,e[57]=ee,e[58]=B,e[59]=V):V=e[59];let H;e[60]!==i?(H=i("mainPanelTabs.analyticsTab.monthlyQuota"),e[60]=i,e[61]=H):H=e[61];let q;e[62]!==H?(q=t.jsx(Oe,{htmlFor:"analytics-quota",children:H}),e[62]=H,e[63]=q):q=e[63];let U;e[64]!==i?(U=i("mainPanelTabs.analyticsTab.uncapped"),e[64]=i,e[65]=U):U=e[65];let Q;e[66]===Symbol.for("react.memo_cache_sentinel")?(Q=z=>x(z.target.value),e[66]=Q):Q=e[66];const J=$!=null;let se;e[67]!==y||e[68]!==U||e[69]!==J?(se=t.jsx(Qe,{id:"analytics-quota",type:"number",min:1,value:y,placeholder:U,onChange:Q,"aria-invalid":J,className:"font-mono text-xs"}),e[67]=y,e[68]=U,e[69]=J,e[70]=se):se=e[70];let le;e[71]!==E||e[72]!==$?(le=$?t.jsx("span",{className:"text-xs text-destructive",children:$}):E?t.jsx("span",{className:"text-xs text-amber-600 dark:text-amber-500",children:"Leaving this blank keeps the current cap — clearing a quota isn't a patch. Unregister + re-register to make it uncapped."}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"Accepted events per calendar month. Once the reconciler flags the site as over, the collector drops further events. Blank = uncapped."}),e[71]=E,e[72]=$,e[73]=le):le=e[73];let C;e[74]!==q||e[75]!==se||e[76]!==le?(C=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,se,le]}),e[74]=q,e[75]=se,e[76]=le,e[77]=C):C=e[77];let Y;e[78]!==X||e[79]!==V||e[80]!==C?(Y=t.jsxs("div",{className:"flex flex-col gap-4",children:[X,V,C]}),e[78]=X,e[79]=V,e[80]=C,e[81]=Y):Y=e[81];let L;e[82]!==l?(L=()=>l(!1),e[82]=l,e[83]=L):L=e[83];const ze=N.isPending;let ie;e[84]!==i?(ie=i("mainPanelTabs.analyticsTab.cancel"),e[84]=i,e[85]=ie):ie=e[85];let re;e[86]!==N.isPending||e[87]!==L||e[88]!==ie?(re=t.jsx(be,{variant:"outline",type:"button",onClick:L,disabled:ze,children:ie}),e[86]=N.isPending,e[87]=L,e[88]=ie,e[89]=re):re=e[89];const ye=N.isPending||$!=null;let oe;e[90]!==N.isPending||e[91]!==i?(oe=N.isPending?i("mainPanelTabs.analyticsTab.saving"):i("mainPanelTabs.analyticsTab.save"),e[90]=N.isPending,e[91]=i,e[92]=oe):oe=e[92];let ce;e[93]!==A||e[94]!==ye||e[95]!==oe?(ce=t.jsx(be,{type:"button",onClick:A,disabled:ye,children:oe}),e[93]=A,e[94]=ye,e[95]=oe,e[96]=ce):ce=e[96];let de;e[97]!==re||e[98]!==ce?(de=t.jsxs(Ut,{children:[re,ce]}),e[97]=re,e[98]=ce,e[99]=de):de=e[99];let me;e[100]!==D||e[101]!==Y||e[102]!==de?(me=t.jsxs(ct,{className:"sm:max-w-md",children:[D,Y,de]}),e[100]=D,e[101]=Y,e[102]=de,e[103]=me):me=e[103];let pe;return e[104]!==l||e[105]!==s||e[106]!==me?(pe=t.jsx(dt,{open:s,onOpenChange:l,children:me}),e[104]=l,e[105]=s,e[106]=me,e[107]=pe):pe=e[107],pe}function Rs(r){return ge.error(Ve(r))}function Fs(r){const e=ae.c(151),{base:n,orgSlug:a,site:c,status:o}=r,s=xe(),l=Ze(),i=o.config??{},d=i.enabled!==!1,[m,g]=ne.useState(!1),[b,p]=ne.useState(!1),[u,v]=ne.useState(null),h=(i.domains?.length??0)>0;let y;e[0]!==a||e[1]!==l||e[2]!==c?(y=()=>l.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),e[0]=a,e[1]=l,e[2]=c,e[3]=y):y=e[3];const x=y;let j;e[4]!==n?(j=()=>Ie(`${n}/analytics/rotate-key`,"POST"),e[4]=n,e[5]=j):j=e[5];let f;e[6]!==x||e[7]!==s?(f=Me=>{x(),v(Me),ge.success(s("mainPanelTabs.analyticsTab.toastTokenRotated"))},e[6]=x,e[7]=s,e[8]=f):f=e[8];let T;e[9]!==j||e[10]!==f?(T={mutationFn:j,onSuccess:f,onError:Hs},e[9]=j,e[10]=f,e[11]=T):T=e[11];const N=Fe(T);let _;e[12]!==n?(_=Me=>Ie(`${n}/analytics/disable`,"PUT",{enabled:Me}),e[12]=n,e[13]=_):_=e[13];let S;e[14]!==x||e[15]!==s?(S=()=>{x(),ge.success(s("mainPanelTabs.analyticsTab.toastCollectionUpdated"))},e[14]=x,e[15]=s,e[16]=S):S=e[16];let P;e[17]!==_||e[18]!==S?(P={mutationFn:_,onSuccess:S,onError:Vs},e[17]=_,e[18]=S,e[19]=P):P=e[19];const w=Fe(P);let $;e[20]!==n?($=()=>Ie(`${n}/analytics`,"DELETE"),e[20]=n,e[21]=$):$=e[21];let k;e[22]!==x||e[23]!==p||e[24]!==s?(k=()=>{x(),ge.success(s("mainPanelTabs.analyticsTab.toastUnregistered")),p(!1)},e[22]=x,e[23]=p,e[24]=s,e[25]=k):k=e[25];let E;e[26]!==$||e[27]!==k?(E={mutationFn:$,onSuccess:k,onError:Bs},e[26]=$,e[27]=k,e[28]=E):E=e[28];const K=Fe(E),A=i.modules??["core"],te="flex flex-col gap-6";let D;e[29]!==u?(D=u&&t.jsx(yt,{result:u,onDismiss:()=>v(null)}),e[29]=u,e[30]=D):D=e[30];const W=he;let O;e[31]!==s?(O=s("mainPanelTabs.analyticsTab.collection"),e[31]=s,e[32]=O):O=e[32];const G=d?"outline":"default";let M;e[33]!==d||e[34]!==w?(M=()=>w.mutate(!d),e[33]=d,e[34]=w,e[35]=M):M=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(vt,{className:"size-4"}),e[36]=X):X=e[36];let R;e[37]!==d||e[38]!==s?(R=s(d?"mainPanelTabs.analyticsTab.pause":"mainPanelTabs.analyticsTab.resume"),e[37]=d,e[38]=s,e[39]=R):R=e[39];let F;e[40]!==G||e[41]!==M||e[42]!==R||e[43]!==w.isPending?(F=t.jsxs(be,{size:"sm",variant:G,disabled:w.isPending,onClick:M,children:[X,R]}),e[40]=G,e[41]=M,e[42]=R,e[43]=w.isPending,e[44]=F):F=e[44];let Z;e[45]!==g?(Z=()=>g(!0),e[45]=g,e[46]=Z):Z=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(Nt,{className:"size-4"}),e[47]=ee):ee=e[47];let I;e[48]!==s?(I=s("mainPanelTabs.analyticsTab.edit"),e[48]=s,e[49]=I):I=e[49];let B;e[50]!==Z||e[51]!==I?(B=t.jsxs(be,{size:"sm",variant:"ghost",onClick:Z,children:[ee,I]}),e[50]=Z,e[51]=I,e[52]=B):B=e[52];let V;e[53]!==h||e[54]!==N?(V=h&&t.jsxs(be,{size:"sm",variant:"ghost",disabled:N.isPending,onClick:()=>N.mutate(),children:[t.jsx(it,{className:"size-4"}),N.isPending?"Rotating…":"Rotate token"]}),e[53]=h,e[54]=N,e[55]=V):V=e[55];let H;e[56]!==s?(H=s("mainPanelTabs.analyticsTab.unregister"),e[56]=s,e[57]=H):H=e[57];let q;e[58]!==p?(q=()=>p(!0),e[58]=p,e[59]=q):q=e[59];let U;e[60]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(kt,{className:"size-4"}),e[60]=U):U=e[60];let Q;e[61]!==H||e[62]!==q?(Q=t.jsx(be,{size:"icon-sm",variant:"ghost","aria-label":H,className:"text-muted-foreground hover:text-destructive",onClick:q,children:U}),e[61]=H,e[62]=q,e[63]=Q):Q=e[63];let J;e[64]!==F||e[65]!==B||e[66]!==V||e[67]!==Q?(J=t.jsxs("div",{className:"flex items-center gap-1.5",children:[F,B,V,Q]}),e[64]=F,e[65]=B,e[66]=V,e[67]=Q,e[68]=J):J=e[68];const se="flex flex-col gap-3",le="flex flex-wrap items-center gap-2",C=d?"success":"outline";let Y;e[69]!==d||e[70]!==s?(Y=s(d?"mainPanelTabs.analyticsTab.active":"mainPanelTabs.analyticsTab.paused"),e[69]=d,e[70]=s,e[71]=Y):Y=e[71];let L;e[72]!==C||e[73]!==Y?(L=t.jsx(Le,{variant:C,children:Y}),e[72]=C,e[73]=Y,e[74]=L):L=e[74];const ze=o.host??"—";let ie;e[75]!==s||e[76]!==ze?(ie=s("mainPanelTabs.analyticsTab.collectingUnder",{host:ze}),e[75]=s,e[76]=ze,e[77]=ie):ie=e[77];let re;e[78]!==ie?(re=t.jsx("span",{className:"text-sm text-muted-foreground",children:ie}),e[78]=ie,e[79]=re):re=e[79];const ye=i.id&&t.jsx("span",{className:"font-mono text-xs text-muted-foreground/80",children:s("mainPanelTabs.analyticsTab.idLabel",{id:i.id})});let oe;e[80]!==L||e[81]!==re||e[82]!==ye?(oe=t.jsxs("div",{className:le,children:[L,re,ye]}),e[80]=L,e[81]=re,e[82]=ye,e[83]=oe):oe=e[83];let ce;e[84]!==A?(ce=A.map(Is),e[84]=A,e[85]=ce):ce=e[85];let de;e[86]!==i.sampling||e[87]!==s?(de=typeof i.sampling=="number"&&i.sampling<1&&t.jsx(Le,{variant:"outline",children:s("mainPanelTabs.analyticsTab.sampling",{percent:String(Math.round(i.sampling*100))})}),e[86]=i.sampling,e[87]=s,e[88]=de):de=e[88];let me;e[89]!==ce||e[90]!==de?(me=t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[ce,de]}),e[89]=ce,e[90]=de,e[91]=me):me=e[91];let pe;e[92]!==oe||e[93]!==me?(pe=t.jsxs("div",{className:se,children:[oe,me]}),e[92]=oe,e[93]=me,e[94]=pe):pe=e[94];let z;e[95]!==W||e[96]!==O||e[97]!==J||e[98]!==pe?(z=t.jsx(W,{title:O,action:J,children:pe}),e[95]=W,e[96]=O,e[97]=J,e[98]=pe,e[99]=z):z=e[99];let fe;e[100]!==o?(fe=t.jsx(As,{status:o}),e[100]=o,e[101]=fe):fe=e[101];let ue;e[102]!==n||e[103]!==i||e[104]!==m||e[105]!==a||e[106]!==g||e[107]!==c?(ue=t.jsx(Ms,{base:n,orgSlug:a,site:c,config:i,open:m,onOpenChange:g}),e[102]=n,e[103]=i,e[104]=m,e[105]=a,e[106]=g,e[107]=c,e[108]=ue):ue=e[108];let Te;e[109]!==s?(Te=s("mainPanelTabs.analyticsTab.unregisterTitle"),e[109]=s,e[110]=Te):Te=e[110];let ve;e[111]!==Te?(ve=t.jsx(Mt,{children:Te}),e[111]=Te,e[112]=ve):ve=e[112];let Ne;e[113]!==c||e[114]!==s?(Ne=s("mainPanelTabs.analyticsTab.unregisterDescription",{site:c}),e[113]=c,e[114]=s,e[115]=Ne):Ne=e[115];let Pe;e[116]!==Ne?(Pe=t.jsx(Rt,{children:Ne}),e[116]=Ne,e[117]=Pe):Pe=e[117];let we;e[118]!==ve||e[119]!==Pe?(we=t.jsxs(Ft,{children:[ve,Pe]}),e[118]=ve,e[119]=Pe,e[120]=we):we=e[120];const jt=K.isPending;let Se;e[121]!==s?(Se=s("mainPanelTabs.analyticsTab.cancel"),e[121]=s,e[122]=Se):Se=e[122];let ke;e[123]!==K.isPending||e[124]!==Se?(ke=t.jsx(It,{disabled:jt,children:Se}),e[123]=K.isPending,e[124]=Se,e[125]=ke):ke=e[125];let _e;e[126]!==K?(_e=Me=>{Me.preventDefault(),K.mutate()},e[126]=K,e[127]=_e):_e=e[127];let Ce;e[128]!==K.isPending||e[129]!==s?(Ce=K.isPending?s("mainPanelTabs.analyticsTab.unregistering"):s("mainPanelTabs.analyticsTab.unregister"),e[128]=K.isPending,e[129]=s,e[130]=Ce):Ce=e[130];let Ke;e[131]!==K.isPending||e[132]!==_e||e[133]!==Ce?(Ke=t.jsx(zt,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:_e,disabled:K.isPending,children:Ce}),e[131]=K.isPending,e[132]=_e,e[133]=Ce,e[134]=Ke):Ke=e[134];let $e;e[135]!==ke||e[136]!==Ke?($e=t.jsxs(Bt,{children:[ke,Ke]}),e[135]=ke,e[136]=Ke,e[137]=$e):$e=e[137];let Ee;e[138]!==we||e[139]!==$e?(Ee=t.jsxs(Vt,{children:[we,$e]}),e[138]=we,e[139]=$e,e[140]=Ee):Ee=e[140];let Ae;e[141]!==b||e[142]!==p||e[143]!==Ee?(Ae=t.jsx(Ht,{open:b,onOpenChange:p,children:Ee}),e[141]=b,e[142]=p,e[143]=Ee,e[144]=Ae):Ae=e[144];let He;return e[145]!==D||e[146]!==z||e[147]!==fe||e[148]!==ue||e[149]!==Ae?(He=t.jsxs("div",{className:te,children:[D,z,fe,ue,Ae]}),e[145]=D,e[146]=z,e[147]=fe,e[148]=ue,e[149]=Ae,e[150]=He):He=e[150],He}function Is(r){return t.jsx(Le,{variant:"secondary",children:r},r)}function Bs(r){return ge.error(Ve(r))}function Vs(r){return ge.error(Ve(r))}function Hs(r){return ge.error(Ve(r))}function Us(r){const e=ae.c(95),{base:n,orgSlug:a,site:c,status:o}=r,s=xe(),[l,i]=ne.useState("24h"),[d,m]=ne.useState("overview"),[g,b]=ne.useState(!1);let p,u,v,h,y,x,j,f,T,N;if(e[0]!==d||e[1]!==o.config||e[2]!==o.host||e[3]!==s){p=o.config??{};const C=p.enabled!==!1;v=p.modules??["core"],u=d==="live",N="flex flex-col gap-5",T="flex flex-wrap items-start justify-between gap-3",f="flex flex-col gap-2",h="flex flex-wrap items-center gap-2";const Y=C?"success":"outline";let L;e[14]!==C||e[15]!==s?(L=s(C?"mainPanelTabs.analyticsTab.active":"mainPanelTabs.analyticsTab.paused"),e[14]=C,e[15]=s,e[16]=L):L=e[16],e[17]!==Y||e[18]!==L?(y=t.jsx(Le,{variant:Y,children:L}),e[17]=Y,e[18]=L,e[19]=y):y=e[19],x=t.jsx("span",{className:"text-sm text-muted-foreground",children:s("mainPanelTabs.analyticsTab.collectingUnder",{host:o.host??p.id??"—"})}),j=p.id&&t.jsx("span",{className:"font-mono text-xs text-muted-foreground/70",children:s("mainPanelTabs.analyticsTab.idLabel",{id:p.id})}),e[0]=d,e[1]=o.config,e[2]=o.host,e[3]=s,e[4]=p,e[5]=u,e[6]=v,e[7]=h,e[8]=y,e[9]=x,e[10]=j,e[11]=f,e[12]=T,e[13]=N}else p=e[4],u=e[5],v=e[6],h=e[7],y=e[8],x=e[9],j=e[10],f=e[11],T=e[12],N=e[13];let _;e[20]!==h||e[21]!==y||e[22]!==x||e[23]!==j?(_=t.jsxs("div",{className:h,children:[y,x,j]}),e[20]=h,e[21]=y,e[22]=x,e[23]=j,e[24]=_):_=e[24];let S;e[25]!==v?(S=v.map(Qs),e[25]=v,e[26]=S):S=e[26];let P;e[27]!==p.sampling||e[28]!==s?(P=typeof p.sampling=="number"&&p.sampling<1&&t.jsx(Le,{variant:"outline",children:s("mainPanelTabs.analyticsTab.sampling",{percent:String(Math.round(p.sampling*100))})}),e[27]=p.sampling,e[28]=s,e[29]=P):P=e[29];let w;e[30]!==P||e[31]!==S?(w=t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[S,P]}),e[30]=P,e[31]=S,e[32]=w):w=e[32];let $;e[33]!==w||e[34]!==f||e[35]!==_?($=t.jsxs("div",{className:f,children:[_,w]}),e[33]=w,e[34]=f,e[35]=_,e[36]=$):$=e[36];let k;e[37]!==u||e[38]!==l?(k=!u&&t.jsx("div",{className:"flex items-center gap-0.5 rounded-lg border border-border p-0.5",children:ts.map(C=>t.jsx("button",{type:"button",onClick:()=>i(C),className:qe("rounded-md px-2 py-1 text-xs font-medium tabular-nums transition-colors",l===C?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:C},C))}),e[37]=u,e[38]=l,e[39]=k):k=e[39];let E,K;e[40]===Symbol.for("react.memo_cache_sentinel")?(E=()=>b(!0),K=t.jsx(St,{className:"size-4"}),e[40]=E,e[41]=K):(E=e[40],K=e[41]);let A;e[42]!==s?(A=s("mainPanelTabs.analyticsTab.configSectionTitle"),e[42]=s,e[43]=A):A=e[43];let te;e[44]!==A?(te=t.jsxs(be,{variant:"outline",size:"sm",onClick:E,children:[K,A]}),e[44]=A,e[45]=te):te=e[45];let D;e[46]!==k||e[47]!==te?(D=t.jsxs("div",{className:"flex items-center gap-2",children:[k,te]}),e[46]=k,e[47]=te,e[48]=D):D=e[48];let W;e[49]!==$||e[50]!==D||e[51]!==T?(W=t.jsxs("div",{className:T,children:[$,D]}),e[49]=$,e[50]=D,e[51]=T,e[52]=W):W=e[52];let O;e[53]!==d||e[54]!==s?(O=es.map(C=>t.jsx("button",{type:"button",onClick:()=>m(C.view),className:qe("shrink-0 border-b-2 px-3 py-2 text-sm font-medium transition-colors",d===C.view?"border-[var(--chart-1)] text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:s(C.labelKey)},C.view)),e[53]=d,e[54]=s,e[55]=O):O=e[55];let G;e[56]!==O?(G=t.jsx("div",{className:"flex items-center gap-1 overflow-x-auto border-b border-border",children:O}),e[56]=O,e[57]=G):G=e[57];let M;e[58]!==d||e[59]!==n||e[60]!==p.quota||e[61]!==a||e[62]!==l||e[63]!==c?(M=t.jsx(Ks,{base:n,orgSlug:a,site:c,view:d,range:l,quota:p.quota},d),e[58]=d,e[59]=n,e[60]=p.quota,e[61]=a,e[62]=l,e[63]=c,e[64]=M):M=e[64];let X;e[65]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-4 py-3 text-sm font-medium text-foreground hover:bg-muted/40",children:[t.jsx(wt,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-90"}),"Send custom events from your code"]}),e[65]=X):X=e[65];let R;e[66]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsxs("p",{children:["Analytics is active automatically — pageviews are collected with no code. For custom events, call the public client API on"," ",t.jsx("span",{className:"font-mono text-foreground",children:"window.__dq"}),":"]}),e[66]=R):R=e[66];let F;e[67]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"pageview()"}),t.jsx("dd",{className:"text-xs",children:"Record a pageview manually (SPA route change)."})]}),e[67]=F):F=e[67];let Z;e[68]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"track(name, props?)"}),e[68]=Z):Z=e[68];let ee;e[69]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx("span",{className:"font-mono",children:"name"}),e[69]=ee):ee=e[69];let I;e[70]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[Z,t.jsxs("dd",{className:"text-xs",children:["A custom event. ",ee," is lowercase a–z, digits and underscore, up to 40 characters;"," ",t.jsx("span",{className:"font-mono",children:"props"})," is an optional flat object."]})]}),e[70]=I):I=e[70];let B;e[71]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"purchase({ transactionId, value, currency, items, itemIds })"}),e[71]=B):B=e[71];let V;e[72]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs("dl",{className:"flex flex-col gap-2",children:[F,I,t.jsxs("div",{className:"flex flex-col gap-0.5",children:[B,t.jsxs("dd",{className:"text-xs",children:["A purchase. ",t.jsx("span",{className:"font-mono",children:"transactionId"})," ","dedupes a reloaded confirmation page so a sale isn't counted twice."]})]})]}),e[72]=V):V=e[72];let H;e[73]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsxs("details",{className:"group rounded-xl border border-border bg-card",children:[X,t.jsxs("div",{className:"flex flex-col gap-3 border-t border-border px-4 py-4 text-sm text-muted-foreground",children:[R,V,t.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2",children:t.jsx("code",{className:"whitespace-pre-wrap break-all text-xs text-muted-foreground",children:`window.__dq.track("newsletter_signup", { plan: "pro" })
1
+ import{c as ae,b as xe,H as Tt,o as nt,K as Be,r as ne,j as t,Y as Ue,n as qe,p as Ze,e as Fe,t as ge,B as be}from"./index-B1nt3Xdg.js";import{e as De,b2 as vt,ax as Nt}from"./agent-icon-B7KCMUKT.js";import{i as Pt}from"./Check-DrJ5WDdf.js";import{i as wt}from"./ChevronRight-6fJEb030.js";import{a as it}from"./Copy01-CUcc1rT7.js";import{a as St}from"./UserSquare-CIzmAXPF.js";import{s as kt}from"./Trash01-6BnXuuT1.js";import{B as Le}from"./badge-PMvZlcsL.js";import{C as Je}from"./checkbox-Bq0DvC7H.js";import{I as Qe}from"./input-AdYfWDmT.js";import{L as Oe}from"./label-4zu9GnvJ.js";import{a as st,d as _t,T as Ct,c as Kt,e as $t,b as Et}from"./table-BvVnzPED.js";import{k as At,m as Dt,b as Ot,C as qt,a as Lt}from"./chart-CV1nYiMO.js";import{g as zt,c as Mt,d as Rt,b as Ft,f as It,e as Bt,a as Vt,A as Ht}from"./alert-dialog-BX_76dkp.js";import{c as rt,d as ot,b as ct,D as dt,e as Ut}from"./dialog-RnHnbV2_.js";import{E as Re}from"./empty-state-DBQAydU_.js";import{a as Qt}from"./use-virtual-mcp-RRdOWPQj.js";import{r as Yt}from"./site-slug-uya6Wp4-.js";import{A as Wt,a as Gt,X as Jt}from"./AreaChart-CxkPRYZA.js";import{C as Xt,Y as Zt}from"./YAxis-PomXVlSd.js";import"./AlertCircle-D9xToIMB.js";import"./Tool01-CCBlQ0Zq.js";import"./ArrowUp-CrGAU3G2.js";import"./ArrowLeft-BjMncG6U.js";import"./Tool02-Bgo46UaV.js";import"./XCircle-DET_WiPa.js";import"./TrendUp01-8KB74JpW.js";import"./ZapSquare-CKJZ8MMK.js";import"./ZoomOut-DEARxChf.js";import"./Users03-Cwe_MBwk.js";import"./CheckCircle-waoO5z0g.js";import"./ChevronDown-BsHyJSwB.js";import"./ChevronSelectorVertical-BtjD2Krx.js";import"./ChevronUp-CCrhZnmK.js";import"./DotsVertical-D-G3pLTC.js";import"./Stars02-r7zSgG8J.js";import"./CreditCard01-Lvg_l2cC.js";import"./Download01-CHg3oeOm.js";import"./Settings02-DmnWdsnV.js";import"./Eye-D7CF9t7J.js";import"./FilterLines-tHfmLV3o.js";import"./Share07-DbERY_pc.js";import"./GitBranch01-cVkQTFYe.js";import"./Globe01-fsAll_5J.js";import"./Globe04-iZWncuvw.js";import"./SwitchHorizontal01-Du4rbjq3.js";import"./HardDrive-DWD1AAge.js";import"./Image01-BuDmuyt4.js";import"./Key01-NqAAYAzO.js";import"./LinkExternal01-CnH1drDd.js";import"./LockUnlocked01-Dy39VZD5.js";import"./LogOut01-CepTDjIg.js";import"./Monitor01-DuJsYKiY.js";import"./Sun-1VzmYVaz.js";import"./Package-CYdI6izf.js";import"./Palette-gW-UafNV.js";import"./Play-D9HObFa4.js";import"./Plus-DBZfXSlG.js";import"./SearchLg-W2Sns64K.js";import"./SearchMd-ohuS85CT.js";import"./Shield01-QpK6G-Gm.js";import"./Stars01-YS6onfeZ.js";import"./Upload01-B9Jn6SFL.js";import"./User01-DPbWRvQH.js";import"./Users01-BVp8PWY9.js";import"./XClose-BXQKrstX.js";import"./Zap-BqvTeTTF.js";import"./index-De3PwXta.js";import"./use-mcp-client-DutrBTnT.js";import"./constants-dLUUoWH7.js";import"./auth-7vEypH_C.js";const mt=[{key:"core",labelKey:"mainPanelTabs.analyticsTab.moduleCore",hintKey:"mainPanelTabs.analyticsTab.moduleCoreHint"},{key:"commerce",labelKey:"mainPanelTabs.analyticsTab.moduleCommerce",hintKey:"mainPanelTabs.analyticsTab.moduleCommerceHint"},{key:"vitals",labelKey:"mainPanelTabs.analyticsTab.moduleVitals",hintKey:"mainPanelTabs.analyticsTab.moduleVitalsHint"},{key:"errors",labelKey:"mainPanelTabs.analyticsTab.moduleErrors",hintKey:"mainPanelTabs.analyticsTab.moduleErrorsHint"},{key:"engagement",labelKey:"mainPanelTabs.analyticsTab.moduleEngagement",hintKey:"mainPanelTabs.analyticsTab.moduleEngagementHint"}],es=[{view:"live",labelKey:"mainPanelTabs.analyticsTab.viewLive"},{view:"overview",labelKey:"mainPanelTabs.analyticsTab.viewOverview"},{view:"behaviour",labelKey:"mainPanelTabs.analyticsTab.viewBehaviour"},{view:"events",labelKey:"mainPanelTabs.analyticsTab.viewEvents"},{view:"errors",labelKey:"mainPanelTabs.analyticsTab.viewErrors"},{view:"experiments",labelKey:"mainPanelTabs.analyticsTab.viewExperiments"},{view:"vitals",labelKey:"mainPanelTabs.analyticsTab.viewVitals"},{view:"quality",labelKey:"mainPanelTabs.analyticsTab.viewQuality"},{view:"usage",labelKey:"mainPanelTabs.analyticsTab.viewUsage"}],ts=["5m","15m","30m","1h","24h","7d","30d"],ss=new Set(["usageScope","currency","currencies","dimensions","operators","goals","goal","range","site","view","propKey","filters","usageExplained"]),ft=/^(t|ts|bucket|minute|min|hour|day|date)$/i;function as(r){const e=r instanceof Error?r.message.toLowerCase():"";return e.includes("unauthorized")||e.includes("401")}function ut(r){const e=r instanceof Error?r.message.toLowerCase():"";return e.includes("not_configured")||e.includes("not configured")}function Ve(r){return r instanceof Error?r.message:String(r)}function je(r){const e=r.replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return e.charAt(0).toUpperCase()+e.slice(1)}function Ye(r){const e=typeof r=="number"?r:Number(r);return Number.isFinite(e)?new Intl.NumberFormat().format(e):"—"}function We(r){if(r==null||r==="")return"—";if(Array.isArray(r))return r.length?r.map(e=>String(e)).join(", "):"—";if(typeof r=="number")return Ye(r);if(typeof r=="object")try{return JSON.stringify(r)}catch{return String(r)}return String(r)}function ls(r){return r===null||["string","number","boolean"].includes(typeof r)}async function xt(r){const e=await fetch(r),n=await e.json().catch(()=>({}));if(!e.ok){const a=n&&typeof n=="object"&&"error"in n?String(n.error):`request failed (${e.status})`;throw new Error(a)}return n}async function Ie(r,e,n){const a=await fetch(r,{method:e,headers:n!==void 0?{"Content-Type":"application/json"}:{},body:n!==void 0?JSON.stringify(n):void 0}),c=await a.json().catch(()=>({}));if(!a.ok){const o=c&&typeof c=="object"&&"error"in c?String(c.error):`request failed (${a.status})`;throw new Error(o)}return c}function he(r){const e=ae.c(12),{title:n,action:a,children:c}=r;let o;e[0]!==n?(o=t.jsx("h3",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let s;e[2]!==a?(s=a&&t.jsx("div",{className:"ml-auto",children:a}),e[2]=a,e[3]=s):s=e[3];let l;e[4]!==o||e[5]!==s?(l=t.jsxs("header",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[o,s]}),e[4]=o,e[5]=s,e[6]=l):l=e[6];let i;e[7]!==c?(i=t.jsx("div",{className:"p-4",children:c}),e[7]=c,e[8]=i):i=e[8];let d;return e[9]!==l||e[10]!==i?(d=t.jsxs("section",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,i]}),e[9]=l,e[10]=i,e[11]=d):d=e[11],d}function Ge(r,e){if(e==null)return"—";const n=Number(e);if(!Number.isFinite(n))return We(e);if(/(pct|rate|bounce|ratio)/i.test(r))return`${Math.round(n)}%`;if(/(_s$|duration|seconds)/i.test(r)){const a=Math.floor(n/60);return a?`${a}m ${Math.round(n%60)}s`:`${Math.round(n)}s`}return Ye(n)}const ns={kpis:"Overview",series:"Traffic over time",funnel:"Funnel",sources:"Top sources",pages:"Top pages",entryPages:"Entry pages",exitPages:"Exit pages",devices:"Devices",os:"Operating systems",browser:"Browsers",countries:"Countries",regions:"Regions",cities:"Cities",channels:"Channels",channelConversion:"Channel conversion",campaigns:"Campaigns",campaignNames:"Campaign names",attribution:"Attribution",products:"Top products",events:"Events",errors:"Errors",propKeys:"Property keys",propValues:"Property values",scrollDepth:"Scroll depth",searches:"Site searches",outbound:"Outbound links",downloads:"Downloads",variants:"Experiment variants",vitals:"Web vitals",vitalsByPage:"Vitals by page",liveVisitors:"Live visitors",livePages:"Active pages",liveFeed:"Live feed",liveByMinute:"Visitors per minute",usage:"Usage",usageTrend:"Usage over time",usageSites:"Usage by site"},at=["pages","sources","channels","devices","browser","os","countries","regions","cities","entryPages","exitPages","campaigns","products","events","errors"];function pt(r){return ns[r]??je(r)}function is(r){if(r.length<4)return null;const e=Math.floor(r.length/2),n=r.slice(0,e).reduce((c,o)=>c+o,0),a=r.slice(e).reduce((c,o)=>c+o,0);return n===0?null:(a-n)/n*100}function rs(r){const e=ae.c(8),{pct:n,goodDown:a}=r,c=n>=0,s=(a?!c:c)?"text-[var(--chart-2,#16a34a)]":"text-destructive";let l;e[0]!==s?(l=qe("text-xs font-medium tabular-nums",s),e[0]=s,e[1]=l):l=e[1];const i=c?"↑":"↓";let d;e[2]!==n?(d=Math.abs(Math.round(n)),e[2]=n,e[3]=d):d=e[3];let m;return e[4]!==l||e[5]!==i||e[6]!==d?(m=t.jsxs("span",{className:l,children:[i,d,"%"]}),e[4]=l,e[5]=i,e[6]=d,e[7]=m):m=e[7],m}const os=new Set(["min_sampling","sessions_built"]);function cs(r){const e=ae.c(2),{row:n}=r;let a;if(e[0]!==n){const c=Object.entries(n).filter(ms);a=t.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:c.map(ds)}),e[0]=n,e[1]=a}else a=e[1];return a}function ds(r){const[e,n]=r;return t.jsxs("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-4",children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:je(e)}),t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:Ge(e,n)})]},e)}function ms(r){const[e,n]=r;return(typeof n=="number"||n===null)&&!os.has(e)}function fs(r){if(!Number.isFinite(r))return"";const e=Math.abs(r);return e>=1e6?`${(r/1e6).toFixed(1)}M`:e>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function bt(r){const e=ae.c(39),{rows:n,timeKey:a,metricKeys:c}=r;let o,s,l,i,d,m,g,b,p,u,v,h,y;if(e[0]!==c||e[1]!==n||e[2]!==a){l=c.filter(Boolean).slice(0,4);const T=l.map(xs),N=n.map(S=>{const P={label:String(S[a]??"")};for(const w of l)P[w]=Number(S[w])||0;return P}),_=Object.fromEntries(l.map((S,P)=>[S,{label:je(S),color:T[P]}]));s=Ot,y=_,d="h-64 w-full",o=Gt,i=N,e[16]===Symbol.for("react.memo_cache_sentinel")?(m={top:8,right:-8,bottom:8,left:0},e[16]=m):m=e[16],g=t.jsx("defs",{children:l.map((S,P)=>t.jsxs("linearGradient",{id:`dq-grad-${S}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:T[P],stopOpacity:.2}),t.jsx("stop",{offset:"100%",stopColor:T[P],stopOpacity:0})]},S))}),e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Xt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[17]=b):b=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Jt,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},tickMargin:8,minTickGap:40,interval:"preserveStartEnd",tickFormatter:us}),e[18]=p):p=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Zt,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},tickFormatter:fs,width:40,tickCount:5}),e[19]=u):u=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(qt,{content:t.jsx(Lt,{indicator:"line"})}),e[20]=v):v=e[20],h=l.map((S,P)=>t.jsx(Wt,{type:"linear",dataKey:S,stroke:T[P],strokeWidth:2,fill:`url(#dq-grad-${S})`,dot:!1,activeDot:{r:4,fill:T[P],stroke:"var(--background)",strokeWidth:2},animationDuration:300},S)),e[0]=c,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=i,e[7]=d,e[8]=m,e[9]=g,e[10]=b,e[11]=p,e[12]=u,e[13]=v,e[14]=h,e[15]=y}else o=e[3],s=e[4],l=e[5],i=e[6],d=e[7],m=e[8],g=e[9],b=e[10],p=e[11],u=e[12],v=e[13],h=e[14],y=e[15];let x;e[21]!==l.length?(x=l.length>1&&t.jsx(At,{content:t.jsx(Dt,{})}),e[21]=l.length,e[22]=x):x=e[22];let j;e[23]!==o||e[24]!==i||e[25]!==x||e[26]!==m||e[27]!==g||e[28]!==b||e[29]!==p||e[30]!==u||e[31]!==v||e[32]!==h?(j=t.jsxs(o,{data:i,margin:m,children:[g,b,p,u,v,h,x]}),e[23]=o,e[24]=i,e[25]=x,e[26]=m,e[27]=g,e[28]=b,e[29]=p,e[30]=u,e[31]=v,e[32]=h,e[33]=j):j=e[33];let f;return e[34]!==s||e[35]!==d||e[36]!==j||e[37]!==y?(f=t.jsx(s,{config:y,className:d,children:j}),e[34]=s,e[35]=d,e[36]=j,e[37]=y,e[38]=f):f=e[38],f}function us(r){return r.replace("T"," ").slice(5,16)}function xs(r,e){return`var(--chart-${e%5+1})`}function et(r){const e=ae.c(37),{rows:n,labelKey:a,valueKey:c}=r;let o,s,l,i;if(e[0]!==a||e[1]!==n||e[2]!==c){let g;e[7]!==c?(g=(N,_)=>(Number(_[c])||0)-(Number(N[c])||0),e[7]=c,e[8]=g):g=e[8];const b=[...n].sort(g).slice(0,10);let p;e[9]!==c?(p=N=>Number(N[c])||0,e[9]=c,e[10]=p):p=e[10];const u=Math.max(1,...b.map(p));let v;e[11]!==n||e[12]!==c?(v=n.reduce((N,_)=>N+(Number(_[c])||0),0)||1,e[11]=n,e[12]=c,e[13]=v):v=e[13];const h=v;l="flex flex-col";let y;e[14]!==a?(y=je(a),e[14]=a,e[15]=y):y=e[15];let x;e[16]!==y?(x=t.jsx("span",{children:y}),e[16]=y,e[17]=x):x=e[17];let j;e[18]!==c?(j=je(c),e[18]=c,e[19]=j):j=e[19];let f;e[20]!==j?(f=t.jsx("span",{children:j}),e[20]=j,e[21]=f):f=e[21],e[22]!==f||e[23]!==x?(i=t.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:[x,f]}),e[22]=f,e[23]=x,e[24]=i):i=e[24],o="flex flex-col gap-0.5";let T;e[25]!==a||e[26]!==u||e[27]!==h||e[28]!==c?(T=(N,_)=>{const S=Number(N[c])||0;return t.jsxs("div",{className:"relative flex items-center justify-between gap-3 overflow-hidden rounded-md px-2.5 py-2",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-md bg-muted",style:{width:`${S/u*100}%`}}),t.jsx("span",{className:"relative z-10 truncate font-mono text-xs text-foreground",children:We(N[a])||"—"}),t.jsxs("span",{className:"relative z-10 shrink-0 text-sm tabular-nums text-foreground",children:[Ye(S),t.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:[Math.round(S/h*100),"%"]})]})]},_)},e[25]=a,e[26]=u,e[27]=h,e[28]=c,e[29]=T):T=e[29],s=b.map(T),e[0]=a,e[1]=n,e[2]=c,e[3]=o,e[4]=s,e[5]=l,e[6]=i}else o=e[3],s=e[4],l=e[5],i=e[6];let d;e[30]!==o||e[31]!==s?(d=t.jsx("div",{className:o,children:s}),e[30]=o,e[31]=s,e[32]=d):d=e[32];let m;return e[33]!==l||e[34]!==i||e[35]!==d?(m=t.jsxs("div",{className:l,children:[i,d]}),e[33]=l,e[34]=i,e[35]=d,e[36]=m):m=e[36],m}function gt(r){const e=ae.c(7),{row:n}=r;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[["viewed","Viewed"],["view_item","View item"],["view_item_list","View list"],["select_item","Select item"],["add_to_cart","Add to cart"],["begin_checkout","Begin checkout"],["purchase","Purchase"]],e[0]=a):a=e[0];const c=a;let o;e[1]!==n?(o=c.filter(d=>{const[m]=d;return m in n}),e[1]=n,e[2]=o):o=e[2];const s=o,l=Number(n[s[0]?.[0]??""])||1;let i;return e[3]!==l||e[4]!==n||e[5]!==s?(i=t.jsx("div",{className:"flex flex-col gap-1.5",children:s.map(d=>{const[m,g]=d,b=Number(n[m])||0;return t.jsxs("div",{className:"relative flex items-center justify-between gap-3 overflow-hidden rounded-md px-2.5 py-2",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-md bg-primary/15",style:{width:`${b/l*100}%`}}),t.jsx("span",{className:"relative z-10 text-sm text-foreground",children:g}),t.jsxs("span",{className:"relative z-10 shrink-0 text-sm tabular-nums text-muted-foreground",children:[Ye(b),t.jsxs("span",{className:"ml-2 text-xs opacity-70",children:[Math.round(b/l*100),"%"]})]})]},m)})}),e[3]=l,e[4]=n,e[5]=s,e[6]=i):i=e[6],i}function ht(r){const e=ae.c(18),{rows:n}=r;let a,c,o,s,l;if(e[0]!==n){const g=Array.from(n.reduce(ps,new Set)),b=new Set(g.filter(h=>n.some(y=>typeof y[h]=="number"))),p=g.find(h=>b.has(h)),u=[...n].sort((h,y)=>p?(Number(y[p])||0)-(Number(h[p])||0):0).slice(0,50);l="overflow-x-auto",c=Kt;const v=t.jsx(st,{className:"border-border hover:bg-transparent",children:g.map(h=>t.jsx(_t,{className:qe("h-8 whitespace-nowrap text-[11px] font-medium uppercase tracking-wide text-muted-foreground",b.has(h)&&"text-right"),children:je(h)},h))});e[6]!==v?(s=t.jsx($t,{children:v}),e[6]=v,e[7]=s):s=e[7],a=Et,o=u.map((h,y)=>t.jsx(st,{className:"border-border/50",children:g.map(x=>t.jsx(Ct,{className:qe("whitespace-nowrap py-1.5 text-sm tabular-nums",b.has(x)?"text-right text-foreground":"font-mono text-xs text-muted-foreground"),children:typeof h[x]=="number"?Ge(x,h[x]):We(h[x])},x))},y)),e[0]=n,e[1]=a,e[2]=c,e[3]=o,e[4]=s,e[5]=l}else a=e[1],c=e[2],o=e[3],s=e[4],l=e[5];let i;e[8]!==a||e[9]!==o?(i=t.jsx(a,{children:o}),e[8]=a,e[9]=o,e[10]=i):i=e[10];let d;e[11]!==c||e[12]!==s||e[13]!==i?(d=t.jsxs(c,{children:[s,i]}),e[11]=c,e[12]=s,e[13]=i,e[14]=d):d=e[14];let m;return e[15]!==l||e[16]!==d?(m=t.jsx("div",{className:l,children:d}),e[15]=l,e[16]=d,e[17]=m):m=e[17],m}function ps(r,e){return Object.keys(e).forEach(n=>r.add(n)),r}function bs(r){if(r.length===0)return null;const e=r[0]??{},n=Object.keys(e);if(r.length===1&&("viewed"in e||"purchase"in e||"add_to_cart"in e))return{kind:"funnel"};const a=n.find(l=>ft.test(l)),c=a?n.filter(l=>l!==a&&typeof e[l]=="number"):[];if(a&&c.length>0&&r.length>1)return{kind:"series",timeKey:a,metricKeys:c};const o=n.find(l=>l!==a&&typeof e[l]=="string"),s=n.find(l=>typeof e[l]=="number");return o&&s&&n.length<=3?{kind:"bars",labelKey:o,valueKey:s}:r.length===1&&!a&&!o&&Object.values(e).every(ls)?{kind:"kpi"}:{kind:"table"}}function tt(r){const e=ae.c(18),{rows:n,meta:a}=r;let c;e[0]!==n[0]?(c=n[0]??{},e[0]=n[0],e[1]=c):c=e[1];const o=c;switch(a.kind){case"kpi":{let s;return e[2]!==o?(s=t.jsx(cs,{row:o}),e[2]=o,e[3]=s):s=e[3],s}case"funnel":{let s;return e[4]!==o?(s=t.jsx(gt,{row:o}),e[4]=o,e[5]=s):s=e[5],s}case"series":{const s=a.timeKey??"";let l;e[6]!==a.metricKeys?(l=a.metricKeys??[],e[6]=a.metricKeys,e[7]=l):l=e[7];let i;return e[8]!==n||e[9]!==s||e[10]!==l?(i=t.jsx(bt,{rows:n,timeKey:s,metricKeys:l}),e[8]=n,e[9]=s,e[10]=l,e[11]=i):i=e[11],i}case"bars":{const s=a.labelKey??"",l=a.valueKey??"";let i;return e[12]!==n||e[13]!==s||e[14]!==l?(i=t.jsx(et,{rows:n,labelKey:s,valueKey:l}),e[12]=n,e[13]=s,e[14]=l,e[15]=i):i=e[15],i}default:{let s;return e[16]!==n?(s=t.jsx(ht,{rows:n}),e[16]=n,e[17]=s):s=e[17],s}}}function lt(r){const e=ae.c(8),{payload:n,t:a}=r;let c,o;if(e[0]!==n||e[1]!==a){o=Symbol.for("react.early_return_sentinel");e:{const s=Object.entries(n).filter(Ss).map(ws).filter(Ps);if(s.length===0){let m;e[4]!==a?(m=a("mainPanelTabs.analyticsTab.emptyView"),e[4]=a,e[5]=m):m=e[5];let g;e[6]!==m?(g=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[6]=m,e[7]=g):g=e[7],o=g;break e}const l=s.filter(Ns),i=s.filter(vs),d=s.filter(Ts).sort(js);c=t.jsxs("div",{className:"flex flex-col gap-4",children:[l.map(ys),i.map(hs),d.length>0&&t.jsx("div",{className:"grid gap-4 lg:grid-cols-2 xl:grid-cols-3",children:d.map(gs)})]})}e[0]=n,e[1]=a,e[2]=c,e[3]=o}else c=e[2],o=e[3];return o!==Symbol.for("react.early_return_sentinel")?o:c}function gs(r){return t.jsx(he,{title:pt(r.name),children:t.jsx(tt,{rows:r.rows,meta:r.meta})},r.name)}function hs(r){return t.jsx(he,{title:pt(r.name),children:t.jsx(tt,{rows:r.rows,meta:r.meta})},r.name)}function ys(r){return t.jsx(tt,{rows:r.rows,meta:r.meta},r.name)}function js(r,e){const n=at.indexOf(r.name),a=at.indexOf(e.name);return(n<0?999:n)-(a<0?999:a)}function Ts(r){return r.meta.kind==="bars"||r.meta.kind==="table"}function vs(r){return r.meta.kind==="series"||r.meta.kind==="funnel"}function Ns(r){return r.meta.kind==="kpi"}function Ps(r){return!!r.meta}function ws(r){const[e,n]=r;return{name:e,rows:n,meta:bs(n)}}function Ss(r){const[e,n]=r;return!ss.has(e)&&Array.isArray(n)}const ks=[["visitors","Visitors"],["pageviews","Pageviews"],["sessions","Sessions"],["bounce_pct","Bounce rate"],["duration_s","Avg duration"]];function _s(r){const e=ae.c(24),{payload:n}=r,a=xe();let c;e[0]!==n?(c=P=>Array.isArray(n[P])?n[P]:[],e[0]=n,e[1]=c):c=e[1];const o=c,s=o("kpis")[0]??{},l=o("series");let i;e[2]!==o?(i=o("sources"),e[2]=o,e[3]=i):i=e[3];const d=i;let m;e[4]!==o?(m=o("funnel"),e[4]=o,e[5]=m):m=e[5];const g=m[0],b=l[0]?Object.keys(l[0]).filter(P=>!ft.test(P)&&typeof l[0]?.[P]=="number"):[],p=ks.filter(P=>{const[w]=P;return w in s}),[u,v]=ne.useState(p.find(P=>{const[w]=P;return b.includes(w)})?.[0]??b[0]??""),h="flex flex-col gap-4",y="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",x=p.map(P=>{const[w,$]=P,k=b.includes(w),E=u===w,K=k?is(l.map(A=>Number(A[w])||0)):null;return t.jsxs("button",{type:"button",disabled:!k,onClick:()=>k&&v(w),className:qe("flex flex-col gap-1.5 rounded-xl border p-4 text-left transition-colors",E?"border-[var(--chart-1)] bg-[var(--chart-1)]/5":"border-border bg-card",k?"cursor-pointer hover:border-[var(--chart-1)]/60":"cursor-default"),children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:$}),t.jsxs("span",{className:"flex items-baseline gap-2",children:[t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:Ge(w,s[w])}),K!==null&&t.jsx(rs,{pct:K,goodDown:w==="bounce_pct"})]})]},w)});let j;e[6]!==x?(j=t.jsx("div",{className:y,children:x}),e[6]=x,e[7]=j):j=e[7];let f;e[8]!==u||e[9]!==l?(f=u&&l.length>0&&t.jsx(he,{title:`${je(u)} over time`,children:t.jsx(bt,{rows:l,timeKey:"t",metricKeys:[u]})}),e[8]=u,e[9]=l,e[10]=f):f=e[10];let T;e[11]!==d||e[12]!==a?(T=d.length>0&&t.jsx(he,{title:a("mainPanelTabs.analyticsTab.cardTopSources"),children:t.jsx(et,{rows:d,labelKey:"k",valueKey:"n"})}),e[11]=d,e[12]=a,e[13]=T):T=e[13];let N;e[14]!==g||e[15]!==a?(N=g&&t.jsx(he,{title:a("mainPanelTabs.analyticsTab.cardFunnel"),children:t.jsx(gt,{row:g})}),e[14]=g,e[15]=a,e[16]=N):N=e[16];let _;e[17]!==T||e[18]!==N?(_=t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[T,N]}),e[17]=T,e[18]=N,e[19]=_):_=e[19];let S;return e[20]!==j||e[21]!==f||e[22]!==_?(S=t.jsxs("div",{className:h,children:[j,f,_]}),e[20]=j,e[21]=f,e[22]=_,e[23]=S):S=e[23],S}function Cs(r){const e=ae.c(46),{payload:n}=r,a=xe();let c;e[0]!==n?(c=T=>Array.isArray(n[T])?n[T]:[],e[0]=n,e[1]=c):c=e[1];const o=c;let s,l,i,d,m,g;if(e[2]!==o||e[3]!==a){const T=o("liveVisitors")[0]??{};let N;e[10]!==o?(N=o("liveFeed"),e[10]=o,e[11]=N):N=e[11],s=N;let _;e[12]!==o?(_=o("livePages"),e[12]=o,e[13]=_):_=e[13],l=_;const S=[["visitors","Visitors"],["pageviews","Pageviews"],["events","Events"],["last_event","Last event"]];m="flex flex-col gap-4";let P;e[14]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs("span",{className:"relative flex size-2",children:[t.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-[var(--chart-1)] opacity-75"}),t.jsx("span",{className:"relative inline-flex size-2 rounded-full bg-[var(--chart-1)]"})]}),e[14]=P):P=e[14];let w;e[15]!==a?(w=a("mainPanelTabs.analyticsTab.liveHint"),e[15]=a,e[16]=w):w=e[16],e[17]!==w?(g=t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[P,w]}),e[17]=w,e[18]=g):g=e[18],i="grid grid-cols-2 gap-3 sm:grid-cols-4",d=S.map($=>{const[k,E]=$;return t.jsxs("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-4",children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:E}),t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:k==="last_event"?We(T[k]):Ge(k,T[k])})]},k)}),e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=i,e[7]=d,e[8]=m,e[9]=g}else s=e[4],l=e[5],i=e[6],d=e[7],m=e[8],g=e[9];let b;e[19]!==i||e[20]!==d?(b=t.jsx("div",{className:i,children:d}),e[19]=i,e[20]=d,e[21]=b):b=e[21];let p;e[22]!==a?(p=a("mainPanelTabs.analyticsTab.cardLiveFeed"),e[22]=a,e[23]=p):p=e[23];let u;e[24]!==s||e[25]!==a?(u=s.length>0?t.jsx(ht,{rows:s}):t.jsx("p",{className:"text-sm text-muted-foreground",children:a("mainPanelTabs.analyticsTab.emptyLive")}),e[24]=s,e[25]=a,e[26]=u):u=e[26];let v;e[27]!==p||e[28]!==u?(v=t.jsx(he,{title:p,children:u}),e[27]=p,e[28]=u,e[29]=v):v=e[29];let h;e[30]!==a?(h=a("mainPanelTabs.analyticsTab.cardPagesNow"),e[30]=a,e[31]=h):h=e[31];let y;e[32]!==l||e[33]!==a?(y=l.length>0?t.jsx(et,{rows:l,labelKey:"k",valueKey:"n"}):t.jsx("p",{className:"text-sm text-muted-foreground",children:a("mainPanelTabs.analyticsTab.emptyView")}),e[32]=l,e[33]=a,e[34]=y):y=e[34];let x;e[35]!==h||e[36]!==y?(x=t.jsx(he,{title:h,children:y}),e[35]=h,e[36]=y,e[37]=x):x=e[37];let j;e[38]!==x||e[39]!==v?(j=t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[v,x]}),e[38]=x,e[39]=v,e[40]=j):j=e[40];let f;return e[41]!==j||e[42]!==m||e[43]!==g||e[44]!==b?(f=t.jsxs("div",{className:m,children:[g,b,j]}),e[41]=j,e[42]=m,e[43]=g,e[44]=b,e[45]=f):f=e[45],f}function Ks(r){const e=ae.c(42),{base:n,orgSlug:a,site:c,view:o,range:s,quota:l}=r,i=xe(),d=o==="live",m=d?"5m":s;let g;e[0]!==m||e[1]!==a||e[2]!==c||e[3]!==o?(g=Be.analyticsData(a,c,o,m),e[0]=m,e[1]=a,e[2]=c,e[3]=o,e[4]=g):g=e[4];let b;e[5]!==n||e[6]!==m||e[7]!==o?(b=()=>xt(`${n}/analytics/data?view=${encodeURIComponent(o)}&range=${encodeURIComponent(m)}`),e[5]=n,e[6]=m,e[7]=o,e[8]=b):b=e[8];const p=d?0:3e4,u=d?5e3:!1;let v;e[9]!==g||e[10]!==b||e[11]!==p||e[12]!==u?(v={queryKey:g,queryFn:b,retry:!1,staleTime:p,refetchInterval:u},e[9]=g,e[10]=b,e[11]=p,e[12]=u,e[13]=v):v=e[13];const h=nt(v);if(h.isLoading){let f;return e[14]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Ue,{className:"h-20 w-full"}),t.jsx(Ue,{className:"h-64 w-full"})]}),e[14]=f):f=e[14],f}if(h.error){let f;e[15]!==h.error||e[16]!==i?(f=ut(h.error)?i("mainPanelTabs.analyticsTab.dataNotConfiguredDescription"):i("mainPanelTabs.analyticsTab.dataLoadError"),e[15]=h.error,e[16]=i,e[17]=f):f=e[17];let T;return e[18]!==f?(T=t.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[18]=f,e[19]=T):T=e[19],T}let y;e[20]!==h.data?(y=h.data??{},e[20]=h.data,e[21]=y):y=e[21];const x=y;if(!x.data){let f;e[22]!==i?(f=i("mainPanelTabs.analyticsTab.emptyView"),e[22]=i,e[23]=f):f=e[23];let T;return e[24]!==f?(T=t.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[24]=f,e[25]=T):T=e[25],T}if(d){let f;return e[26]!==x.data?(f=t.jsx(Cs,{payload:x.data}),e[26]=x.data,e[27]=f):f=e[27],f}if(o==="overview"){let f;return e[28]!==x.data?(f=t.jsx(_s,{payload:x.data}),e[28]=x.data,e[29]=f):f=e[29],f}if(o==="usage"){let f;e[30]!==l||e[31]!==x.data?(f=t.jsx($s,{quota:l,payload:x.data}),e[30]=l,e[31]=x.data,e[32]=f):f=e[32];let T;e[33]!==x.data||e[34]!==i?(T=t.jsx(lt,{payload:x.data,t:i}),e[33]=x.data,e[34]=i,e[35]=T):T=e[35];let N;return e[36]!==f||e[37]!==T?(N=t.jsxs("div",{className:"flex flex-col gap-5",children:[f,T]}),e[36]=f,e[37]=T,e[38]=N):N=e[38],N}let j;return e[39]!==x.data||e[40]!==i?(j=t.jsx(lt,{payload:x.data,t:i}),e[39]=x.data,e[40]=i,e[41]=j):j=e[41],j}function $s(r){const e=ae.c(27),{quota:n,payload:a}=r,c=xe(),o=typeof n=="number"&&n>0;let s,l,i;if(e[0]!==o||e[1]!==a||e[2]!==n||e[3]!==c){let g=null;for(const y of Object.values(a)){const x=y&&typeof y=="object"&&!Array.isArray(y)?y:Array.isArray(y)&&y[0]&&typeof y[0]=="object"?y[0]:null;if(!x)continue;const j=x.events_accepted??x.accepted??x.events;if(typeof j=="number"){g=j;break}}const b=Es;s="flex flex-col gap-2 rounded-xl border border-border bg-card p-4";let p;e[7]!==c?(p=c("mainPanelTabs.analyticsTab.monthlyQuota"),e[7]=c,e[8]=p):p=e[8];let u;e[9]!==p?(u=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:p}),e[9]=p,e[10]=u):u=e[10];let v;e[11]!==o||e[12]!==n||e[13]!==c?(v=o?`${b(n)} ${c("mainPanelTabs.analyticsTab.eventsPerMonthSuffix")}`:c("mainPanelTabs.analyticsTab.uncapped"),e[11]=o,e[12]=n,e[13]=c,e[14]=v):v=e[14];let h;e[15]!==v?(h=t.jsx("span",{className:"font-mono text-sm tabular-nums text-foreground",children:v}),e[15]=v,e[16]=h):h=e[16],e[17]!==u||e[18]!==h?(l=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u,h]}),e[17]=u,e[18]=h,e[19]=l):l=e[19],i=o&&g!==null&&t.jsx("p",{className:"text-xs text-muted-foreground",children:c("mainPanelTabs.analyticsTab.acceptedInRange",{count:b(g)})}),e[0]=o,e[1]=a,e[2]=n,e[3]=c,e[4]=s,e[5]=l,e[6]=i}else s=e[4],l=e[5],i=e[6];let d;e[20]!==o?(d=!o&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No monthly cap is set — every accepted event is stored. Set one in Configuration to enforce a limit."}),e[20]=o,e[21]=d):d=e[21];let m;return e[22]!==s||e[23]!==l||e[24]!==i||e[25]!==d?(m=t.jsxs("div",{className:s,children:[l,i,d]}),e[22]=s,e[23]=l,e[24]=i,e[25]=d,e[26]=m):m=e[26],m}function Es(r){return r.toLocaleString()}function As(r){const e=ae.c(53),{status:n}=r,a=xe(),c=n.config?.id??"",o=n.key??null,s=`<script async src="https://analytics.decocdn.com/_dq/a.js?k=${o??"YOUR_TOKEN"}"><\/script>`;let l;e[0]!==a?(l=a("mainPanelTabs.analyticsTab.installTitle"),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.analyticsTab.installHow"),e[2]=a,e[3]=i):i=e[3];let d;e[4]!==i?(d=t.jsx("p",{className:"text-sm text-muted-foreground",children:i}),e[4]=i,e[5]=d):d=e[5];let m;e[6]!==a?(m=a("mainPanelTabs.analyticsTab.installHostTitle"),e[6]=a,e[7]=m):m=e[7];let g;e[8]!==m?(g=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:m}),e[8]=m,e[9]=g):g=e[9];let b;e[10]!==a?(b=a("mainPanelTabs.analyticsTab.installAuto"),e[10]=a,e[11]=b):b=e[11];let p;e[12]!==b?(p=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[12]=b,e[13]=p):p=e[13];let u;e[14]!==g||e[15]!==p?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,p]}),e[14]=g,e[15]=p,e[16]=u):u=e[16];let v;e[17]!==a?(v=a("mainPanelTabs.analyticsTab.installKeyTitle"),e[17]=a,e[18]=v):v=e[18];let h;e[19]!==v?(h=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:v}),e[19]=v,e[20]=h):h=e[20];let y;e[21]!==o?(y=o&&t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-1.5",children:[t.jsx("code",{className:"overflow-x-auto text-xs text-foreground",children:o}),t.jsx(Xe,{text:o})]}),e[21]=o,e[22]=y):y=e[22];let x;e[23]!==s?(x=t.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[t.jsx("code",{className:"overflow-x-auto whitespace-pre-wrap break-all text-xs text-muted-foreground",children:s}),t.jsx(Xe,{text:s})]}),e[23]=s,e[24]=x):x=e[24];let j;e[25]!==a||e[26]!==o?(j=!o&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a("mainPanelTabs.analyticsTab.installTokenNote")}),e[25]=a,e[26]=o,e[27]=j):j=e[27];let f;e[28]!==h||e[29]!==y||e[30]!==x||e[31]!==j?(f=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,y,x,j]}),e[28]=h,e[29]=y,e[30]=x,e[31]=j,e[32]=f):f=e[32];let T;e[33]!==a?(T=a("mainPanelTabs.analyticsTab.installTrackPrefix"),e[33]=a,e[34]=T):T=e[34];let N;e[35]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"font-mono",children:"window.__dq"}),e[35]=N):N=e[35];let _;e[36]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"font-mono",children:"pageview()"}),e[36]=_):_=e[36];let S;e[37]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("span",{className:"font-mono",children:"track(name, props)"}),e[37]=S):S=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("span",{className:"font-mono",children:"purchase({…})"}),e[38]=P):P=e[38];let w;e[39]!==T?(w=t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T,N," —"," ",_,","," ",S,","," ",P,"."]}),e[39]=T,e[40]=w):w=e[40];let $;e[41]!==c||e[42]!==a?($=c&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("mainPanelTabs.analyticsTab.installSiteId"),":"," ",t.jsx("span",{className:"font-mono text-foreground",children:c})]}),e[41]=c,e[42]=a,e[43]=$):$=e[43];let k;e[44]!==f||e[45]!==w||e[46]!==$||e[47]!==d||e[48]!==u?(k=t.jsxs("div",{className:"flex flex-col gap-4",children:[d,u,f,w,$]}),e[44]=f,e[45]=w,e[46]=$,e[47]=d,e[48]=u,e[49]=k):k=e[49];let E;return e[50]!==l||e[51]!==k?(E=t.jsx(he,{title:l,children:k}),e[50]=l,e[51]=k,e[52]=E):E=e[52],E}function Xe(r){const e=ae.c(11),{text:n}=r,a=xe(),[c,o]=ne.useState(!1);let s;e[0]!==n?(s=()=>{navigator.clipboard?.writeText(n)?.then(()=>{o(!0),setTimeout(()=>o(!1),1500)},Ds)},e[0]=n,e[1]=s):s=e[1];let l;e[2]!==c?(l=c?t.jsx(Pt,{className:"size-4"}):t.jsx(it,{className:"size-4"}),e[2]=c,e[3]=l):l=e[3];let i;e[4]!==c||e[5]!==a?(i=a(c?"mainPanelTabs.analyticsTab.copied":"mainPanelTabs.analyticsTab.copy"),e[4]=c,e[5]=a,e[6]=i):i=e[6];let d;return e[7]!==s||e[8]!==l||e[9]!==i?(d=t.jsxs(be,{variant:"ghost",size:"sm",onClick:s,children:[l,i]}),e[7]=s,e[8]=l,e[9]=i,e[10]=d):d=e[10],d}function Ds(){}function yt(r){const e=ae.c(27),{result:n,onDismiss:a}=r,c=xe();let o;e[0]!==n.notes?(o=n.notes??[],e[0]=n.notes,e[1]=o):o=e[1];const s=o,l=!!n.key;if(!l&&!n.snippet&&s.length===0)return null;let i;e[2]!==l||e[3]!==c?(i=c(l?"mainPanelTabs.analyticsTab.tokenTitle":"mainPanelTabs.analyticsTab.registeredOk"),e[2]=l,e[3]=c,e[4]=i):i=e[4];let d;e[5]!==i?(d=t.jsx("h3",{className:"text-sm font-medium text-foreground",children:i}),e[5]=i,e[6]=d):d=e[6];let m;e[7]!==c?(m=c("mainPanelTabs.analyticsTab.dismiss"),e[7]=c,e[8]=m):m=e[8];let g;e[9]!==a||e[10]!==m?(g=t.jsx(be,{variant:"ghost",size:"sm",onClick:a,children:m}),e[9]=a,e[10]=m,e[11]=g):g=e[11];let b;e[12]!==d||e[13]!==g?(b=t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d,g]}),e[12]=d,e[13]=g,e[14]=b):b=e[14];let p;e[15]!==l||e[16]!==c?(p=l&&t.jsx("p",{className:"text-xs text-muted-foreground",children:c("mainPanelTabs.analyticsTab.tokenOnce")}),e[15]=l,e[16]=c,e[17]=p):p=e[17];let u;e[18]!==n.snippet?(u=n.snippet&&t.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[t.jsx("code",{className:"overflow-x-auto whitespace-pre-wrap break-all text-xs text-muted-foreground",children:n.snippet}),t.jsx(Xe,{text:n.snippet})]}),e[18]=n.snippet,e[19]=u):u=e[19];let v;e[20]!==s?(v=s.length>0&&t.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(Os)}),e[20]=s,e[21]=v):v=e[21];let h;return e[22]!==b||e[23]!==p||e[24]!==u||e[25]!==v?(h=t.jsxs("section",{className:"flex flex-col gap-3 rounded-xl border border-primary/30 bg-primary/5 p-4",children:[b,p,u,v]}),e[22]=b,e[23]=p,e[24]=u,e[25]=v,e[26]=h):h=e[26],h}function Os(r,e){return t.jsx("li",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-400",children:r},e)}function qs(r){const e=ae.c(96),{base:n,orgSlug:a,site:c,host:o,onRegistered:s}=r,l=xe(),i=Ze();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=new Set(["core","commerce","vitals"]),e[0]=d):d=e[0];const[m,g]=ne.useState(d),[b,p]=ne.useState(""),[u,v]=ne.useState(!1),[h,y]=ne.useState("");let x;e[1]!==n?(x=C=>Ie(`${n}/analytics/register`,"POST",C),e[1]=n,e[2]=x):x=e[2];let j;e[3]!==s||e[4]!==a||e[5]!==i||e[6]!==c||e[7]!==l?(j=C=>{i.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),s(C),ge.success(l("mainPanelTabs.analyticsTab.toastRegistered"))},e[3]=s,e[4]=a,e[5]=i,e[6]=c,e[7]=l,e[8]=j):j=e[8];let f;e[9]!==x||e[10]!==j?(f={mutationFn:x,onSuccess:j,onError:zs},e[9]=x,e[10]=j,e[11]=f):f=e[11];const T=Fe(f);let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=C=>{C!=="core"&&g(Y=>{const L=new Set(Y);return L.has(C)?L.delete(C):L.add(C),L})},e[12]=N):N=e[12];const _=N;let S,P,w,$,k,E,K;if(e[13]!==h||e[14]!==o||e[15]!==b||e[16]!==T||e[17]!==m||e[18]!==l||e[19]!==u){P=h.split(/[\s,]+/).map(Ls).filter(Boolean),w=()=>{if(u){T.mutate({key:!0,domains:P,modules:[...m]});return}const Y=b.trim();T.mutate({modules:[...m],...Y?{host:Y}:{}})};const C=b.trim()||o||l("mainPanelTabs.analyticsTab.registerHostFallback");S=he,e[27]!==l?(K=l("mainPanelTabs.analyticsTab.registerTitle"),e[27]=l,e[28]=K):K=e[28],E="flex flex-col gap-5",$="text-sm text-muted-foreground",k=l("mainPanelTabs.analyticsTab.registerDescription",{host:u?P[0]||"your domains":C}),e[13]=h,e[14]=o,e[15]=b,e[16]=T,e[17]=m,e[18]=l,e[19]=u,e[20]=S,e[21]=P,e[22]=w,e[23]=$,e[24]=k,e[25]=E,e[26]=K}else S=e[20],P=e[21],w=e[22],$=e[23],k=e[24],E=e[25],K=e[26];let A;e[29]!==$||e[30]!==k?(A=t.jsx("p",{className:$,children:k}),e[29]=$,e[30]=k,e[31]=A):A=e[31];let te;e[32]!==l?(te=l("mainPanelTabs.analyticsTab.modules"),e[32]=l,e[33]=te):te=e[33];let D;e[34]!==te?(D=t.jsx(Oe,{children:te}),e[34]=te,e[35]=D):D=e[35];let W;e[36]!==m||e[37]!==l?(W=mt.map(C=>{const Y=C.key==="core",L=Y||m.has(C.key);return t.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 hover:border-border/70",children:[t.jsx(Je,{checked:L,disabled:Y,onCheckedChange:()=>_(C.key),className:"mt-0.5"}),t.jsxs("span",{className:"flex flex-col",children:[t.jsx("span",{className:"text-sm font-medium text-foreground",children:l(C.labelKey)}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l(C.hintKey)})]})]},C.key)}),e[36]=m,e[37]=l,e[38]=W):W=e[38];let O;e[39]!==W?(O=t.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:W}),e[39]=W,e[40]=O):O=e[40];let G;e[41]!==D||e[42]!==O?(G=t.jsxs("div",{className:"flex flex-col gap-2",children:[D,O]}),e[41]=D,e[42]=O,e[43]=G):G=e[43];let M;e[44]===Symbol.for("react.memo_cache_sentinel")?(M=C=>v(!!C),e[44]=M):M=e[44];let X;e[45]!==u?(X=t.jsx(Je,{checked:u,onCheckedChange:M,className:"mt-0.5"}),e[45]=u,e[46]=X):X=e[46];let R;e[47]!==l?(R=l("mainPanelTabs.analyticsTab.registerByKey"),e[47]=l,e[48]=R):R=e[48];let F;e[49]!==R?(F=t.jsx("span",{className:"text-sm font-medium text-foreground",children:R}),e[49]=R,e[50]=F):F=e[50];let Z;e[51]!==l?(Z=l("mainPanelTabs.analyticsTab.registerByKeyHint"),e[51]=l,e[52]=Z):Z=e[52];let ee;e[53]!==Z?(ee=t.jsx("span",{className:"text-xs text-muted-foreground",children:Z}),e[53]=Z,e[54]=ee):ee=e[54];let I;e[55]!==F||e[56]!==ee?(I=t.jsxs("span",{className:"flex flex-col",children:[F,ee]}),e[55]=F,e[56]=ee,e[57]=I):I=e[57];let B;e[58]!==X||e[59]!==I?(B=t.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 hover:border-border/70",children:[X,I]}),e[58]=X,e[59]=I,e[60]=B):B=e[60];let V;e[61]!==h||e[62]!==o||e[63]!==b||e[64]!==l||e[65]!==u?(V=u?t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Oe,{htmlFor:"analytics-domains",children:l("mainPanelTabs.analyticsTab.domainsLabel")}),t.jsx(Qe,{id:"analytics-domains",value:h,onChange:C=>y(C.target.value),placeholder:l("mainPanelTabs.analyticsTab.domainsPlaceholder"),className:"font-mono text-xs"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l("mainPanelTabs.analyticsTab.domainsHint")})]}):!o&&t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Oe,{htmlFor:"analytics-host",children:l("mainPanelTabs.analyticsTab.hostLabel")}),t.jsx(Qe,{id:"analytics-host",value:b,onChange:C=>p(C.target.value),placeholder:l("mainPanelTabs.analyticsTab.hostPlaceholder"),className:"font-mono text-xs"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l("mainPanelTabs.analyticsTab.hostHint")})]}),e[61]=h,e[62]=o,e[63]=b,e[64]=l,e[65]=u,e[66]=V):V=e[66];let H;e[67]!==l?(H=l("mainPanelTabs.analyticsTab.registerInstallHint"),e[67]=l,e[68]=H):H=e[68];let q;e[69]!==H?(q=t.jsx("p",{className:"text-xs text-muted-foreground",children:H}),e[69]=H,e[70]=q):q=e[70];let U;e[71]!==P||e[72]!==o||e[73]!==b||e[74]!==T.isPending||e[75]!==u?(U=T.isPending||(u?P.length===0:!o&&!b.trim()),e[71]=P,e[72]=o,e[73]=b,e[74]=T.isPending,e[75]=u,e[76]=U):U=e[76];let Q;e[77]!==T.isPending||e[78]!==l?(Q=T.isPending?l("mainPanelTabs.analyticsTab.enabling"):l("mainPanelTabs.analyticsTab.enableAnalytics"),e[77]=T.isPending,e[78]=l,e[79]=Q):Q=e[79];let J;e[80]!==w||e[81]!==U||e[82]!==Q?(J=t.jsx("div",{className:"flex justify-end",children:t.jsx(be,{onClick:w,disabled:U,children:Q})}),e[80]=w,e[81]=U,e[82]=Q,e[83]=J):J=e[83];let se;e[84]!==A||e[85]!==G||e[86]!==B||e[87]!==V||e[88]!==q||e[89]!==J||e[90]!==E?(se=t.jsxs("div",{className:E,children:[A,G,B,V,q,J]}),e[84]=A,e[85]=G,e[86]=B,e[87]=V,e[88]=q,e[89]=J,e[90]=E,e[91]=se):se=e[91];let le;return e[92]!==S||e[93]!==se||e[94]!==K?(le=t.jsx(S,{title:K,children:se}),e[92]=S,e[93]=se,e[94]=K,e[95]=le):le=e[95],le}function Ls(r){return r.trim()}function zs(r){return ge.error(Ve(r))}function Ms(r){const e=ae.c(108),{base:n,orgSlug:a,site:c,config:o,open:s,onOpenChange:l}=r,i=xe(),d=Ze();let m;e[0]!==o.modules?(m=o.modules??["core"],e[0]=o.modules,e[1]=m):m=e[1];let g;e[2]!==m?(g=new Set(m),e[2]=m,e[3]=g):g=e[3];const[b,p]=ne.useState(g);let u;e[4]!==o.sampling?(u=Math.round((o.sampling??1)*100),e[4]=o.sampling,e[5]=u):u=e[5];const[v,h]=ne.useState(String(u)),[y,x]=ne.useState(typeof o.quota=="number"&&o.quota>0?String(o.quota):"");let j;e[6]!==n?(j=z=>Ie(`${n}/analytics/config`,"PUT",z),e[6]=n,e[7]=j):j=e[7];let f;e[8]!==l||e[9]!==a||e[10]!==d||e[11]!==c||e[12]!==i?(f=()=>{d.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),ge.success(i("mainPanelTabs.analyticsTab.toastCollectionUpdated")),l(!1)},e[8]=l,e[9]=a,e[10]=d,e[11]=c,e[12]=i,e[13]=f):f=e[13];let T;e[14]!==j||e[15]!==f?(T={mutationFn:j,onSuccess:f,onError:Rs},e[14]=j,e[15]=f,e[16]=T):T=e[16];const N=Fe(T);let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=z=>{z!=="core"&&p(fe=>{const ue=new Set(fe);return ue.has(z)?ue.delete(z):ue.add(z),ue})},e[17]=_):_=e[17];const S=_;let P;e[18]!==y?(P=y.trim()===""?null:Number(y),e[18]=y,e[19]=P):P=e[19];const w=P,$=w!==null&&(!Number.isInteger(w)||w<1)?"Quota must be a positive whole number of events.":null;let k;e[20]!==o.quota||e[21]!==y?(k=y.trim()===""&&typeof o.quota=="number"&&o.quota>0,e[20]=o.quota,e[21]=y,e[22]=k):k=e[22];const E=k;let K;e[23]!==$||e[24]!==w||e[25]!==v||e[26]!==N||e[27]!==b?(K=()=>{if($)return;const z=Number(v),fe=Number.isFinite(z)&&z>0?Math.min(z,100)/100:1;N.mutate({modules:[...b],sampling:fe,...w!==null?{quota:w}:{}})},e[23]=$,e[24]=w,e[25]=v,e[26]=N,e[27]=b,e[28]=K):K=e[28];const A=K;let te;e[29]!==i?(te=i("mainPanelTabs.analyticsTab.editTitle"),e[29]=i,e[30]=te):te=e[30];let D;e[31]!==te?(D=t.jsx(rt,{children:t.jsx(ot,{children:te})}),e[31]=te,e[32]=D):D=e[32];let W;e[33]!==i?(W=i("mainPanelTabs.analyticsTab.editModules"),e[33]=i,e[34]=W):W=e[34];let O;e[35]!==W?(O=t.jsx(Oe,{children:W}),e[35]=W,e[36]=O):O=e[36];let G;e[37]!==b||e[38]!==i?(G=mt.map(z=>{const fe=z.key==="core",ue=fe||b.has(z.key);return t.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border px-3 py-2 hover:border-border/70",children:[t.jsx(Je,{checked:ue,disabled:fe,onCheckedChange:()=>S(z.key)}),t.jsx("span",{className:"text-sm text-foreground",children:i(z.labelKey)})]},z.key)}),e[37]=b,e[38]=i,e[39]=G):G=e[39];let M;e[40]!==G?(M=t.jsx("div",{className:"grid grid-cols-1 gap-2",children:G}),e[40]=G,e[41]=M):M=e[41];let X;e[42]!==O||e[43]!==M?(X=t.jsxs("div",{className:"flex flex-col gap-2",children:[O,M]}),e[42]=O,e[43]=M,e[44]=X):X=e[44];let R;e[45]!==i?(R=i("mainPanelTabs.analyticsTab.editSampling"),e[45]=i,e[46]=R):R=e[46];let F;e[47]!==R?(F=t.jsx(Oe,{htmlFor:"analytics-sampling",children:R}),e[47]=R,e[48]=F):F=e[48];let Z;e[49]===Symbol.for("react.memo_cache_sentinel")?(Z=z=>h(z.target.value),e[49]=Z):Z=e[49];let ee;e[50]!==v?(ee=t.jsx(Qe,{id:"analytics-sampling",type:"number",min:1,max:100,value:v,onChange:Z,className:"font-mono text-xs"}),e[50]=v,e[51]=ee):ee=e[51];let I;e[52]!==i?(I=i("mainPanelTabs.analyticsTab.editSamplingHint"),e[52]=i,e[53]=I):I=e[53];let B;e[54]!==I?(B=t.jsx("span",{className:"text-xs text-muted-foreground",children:I}),e[54]=I,e[55]=B):B=e[55];let V;e[56]!==F||e[57]!==ee||e[58]!==B?(V=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[F,ee,B]}),e[56]=F,e[57]=ee,e[58]=B,e[59]=V):V=e[59];let H;e[60]!==i?(H=i("mainPanelTabs.analyticsTab.monthlyQuota"),e[60]=i,e[61]=H):H=e[61];let q;e[62]!==H?(q=t.jsx(Oe,{htmlFor:"analytics-quota",children:H}),e[62]=H,e[63]=q):q=e[63];let U;e[64]!==i?(U=i("mainPanelTabs.analyticsTab.uncapped"),e[64]=i,e[65]=U):U=e[65];let Q;e[66]===Symbol.for("react.memo_cache_sentinel")?(Q=z=>x(z.target.value),e[66]=Q):Q=e[66];const J=$!=null;let se;e[67]!==y||e[68]!==U||e[69]!==J?(se=t.jsx(Qe,{id:"analytics-quota",type:"number",min:1,value:y,placeholder:U,onChange:Q,"aria-invalid":J,className:"font-mono text-xs"}),e[67]=y,e[68]=U,e[69]=J,e[70]=se):se=e[70];let le;e[71]!==E||e[72]!==$?(le=$?t.jsx("span",{className:"text-xs text-destructive",children:$}):E?t.jsx("span",{className:"text-xs text-amber-600 dark:text-amber-500",children:"Leaving this blank keeps the current cap — clearing a quota isn't a patch. Unregister + re-register to make it uncapped."}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"Accepted events per calendar month. Once the reconciler flags the site as over, the collector drops further events. Blank = uncapped."}),e[71]=E,e[72]=$,e[73]=le):le=e[73];let C;e[74]!==q||e[75]!==se||e[76]!==le?(C=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,se,le]}),e[74]=q,e[75]=se,e[76]=le,e[77]=C):C=e[77];let Y;e[78]!==X||e[79]!==V||e[80]!==C?(Y=t.jsxs("div",{className:"flex flex-col gap-4",children:[X,V,C]}),e[78]=X,e[79]=V,e[80]=C,e[81]=Y):Y=e[81];let L;e[82]!==l?(L=()=>l(!1),e[82]=l,e[83]=L):L=e[83];const ze=N.isPending;let ie;e[84]!==i?(ie=i("mainPanelTabs.analyticsTab.cancel"),e[84]=i,e[85]=ie):ie=e[85];let re;e[86]!==N.isPending||e[87]!==L||e[88]!==ie?(re=t.jsx(be,{variant:"outline",type:"button",onClick:L,disabled:ze,children:ie}),e[86]=N.isPending,e[87]=L,e[88]=ie,e[89]=re):re=e[89];const ye=N.isPending||$!=null;let oe;e[90]!==N.isPending||e[91]!==i?(oe=N.isPending?i("mainPanelTabs.analyticsTab.saving"):i("mainPanelTabs.analyticsTab.save"),e[90]=N.isPending,e[91]=i,e[92]=oe):oe=e[92];let ce;e[93]!==A||e[94]!==ye||e[95]!==oe?(ce=t.jsx(be,{type:"button",onClick:A,disabled:ye,children:oe}),e[93]=A,e[94]=ye,e[95]=oe,e[96]=ce):ce=e[96];let de;e[97]!==re||e[98]!==ce?(de=t.jsxs(Ut,{children:[re,ce]}),e[97]=re,e[98]=ce,e[99]=de):de=e[99];let me;e[100]!==D||e[101]!==Y||e[102]!==de?(me=t.jsxs(ct,{className:"sm:max-w-md",children:[D,Y,de]}),e[100]=D,e[101]=Y,e[102]=de,e[103]=me):me=e[103];let pe;return e[104]!==l||e[105]!==s||e[106]!==me?(pe=t.jsx(dt,{open:s,onOpenChange:l,children:me}),e[104]=l,e[105]=s,e[106]=me,e[107]=pe):pe=e[107],pe}function Rs(r){return ge.error(Ve(r))}function Fs(r){const e=ae.c(151),{base:n,orgSlug:a,site:c,status:o}=r,s=xe(),l=Ze(),i=o.config??{},d=i.enabled!==!1,[m,g]=ne.useState(!1),[b,p]=ne.useState(!1),[u,v]=ne.useState(null),h=(i.domains?.length??0)>0;let y;e[0]!==a||e[1]!==l||e[2]!==c?(y=()=>l.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),e[0]=a,e[1]=l,e[2]=c,e[3]=y):y=e[3];const x=y;let j;e[4]!==n?(j=()=>Ie(`${n}/analytics/rotate-key`,"POST"),e[4]=n,e[5]=j):j=e[5];let f;e[6]!==x||e[7]!==s?(f=Me=>{x(),v(Me),ge.success(s("mainPanelTabs.analyticsTab.toastTokenRotated"))},e[6]=x,e[7]=s,e[8]=f):f=e[8];let T;e[9]!==j||e[10]!==f?(T={mutationFn:j,onSuccess:f,onError:Hs},e[9]=j,e[10]=f,e[11]=T):T=e[11];const N=Fe(T);let _;e[12]!==n?(_=Me=>Ie(`${n}/analytics/disable`,"PUT",{enabled:Me}),e[12]=n,e[13]=_):_=e[13];let S;e[14]!==x||e[15]!==s?(S=()=>{x(),ge.success(s("mainPanelTabs.analyticsTab.toastCollectionUpdated"))},e[14]=x,e[15]=s,e[16]=S):S=e[16];let P;e[17]!==_||e[18]!==S?(P={mutationFn:_,onSuccess:S,onError:Vs},e[17]=_,e[18]=S,e[19]=P):P=e[19];const w=Fe(P);let $;e[20]!==n?($=()=>Ie(`${n}/analytics`,"DELETE"),e[20]=n,e[21]=$):$=e[21];let k;e[22]!==x||e[23]!==p||e[24]!==s?(k=()=>{x(),ge.success(s("mainPanelTabs.analyticsTab.toastUnregistered")),p(!1)},e[22]=x,e[23]=p,e[24]=s,e[25]=k):k=e[25];let E;e[26]!==$||e[27]!==k?(E={mutationFn:$,onSuccess:k,onError:Bs},e[26]=$,e[27]=k,e[28]=E):E=e[28];const K=Fe(E),A=i.modules??["core"],te="flex flex-col gap-6";let D;e[29]!==u?(D=u&&t.jsx(yt,{result:u,onDismiss:()=>v(null)}),e[29]=u,e[30]=D):D=e[30];const W=he;let O;e[31]!==s?(O=s("mainPanelTabs.analyticsTab.collection"),e[31]=s,e[32]=O):O=e[32];const G=d?"outline":"default";let M;e[33]!==d||e[34]!==w?(M=()=>w.mutate(!d),e[33]=d,e[34]=w,e[35]=M):M=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(vt,{className:"size-4"}),e[36]=X):X=e[36];let R;e[37]!==d||e[38]!==s?(R=s(d?"mainPanelTabs.analyticsTab.pause":"mainPanelTabs.analyticsTab.resume"),e[37]=d,e[38]=s,e[39]=R):R=e[39];let F;e[40]!==G||e[41]!==M||e[42]!==R||e[43]!==w.isPending?(F=t.jsxs(be,{size:"sm",variant:G,disabled:w.isPending,onClick:M,children:[X,R]}),e[40]=G,e[41]=M,e[42]=R,e[43]=w.isPending,e[44]=F):F=e[44];let Z;e[45]!==g?(Z=()=>g(!0),e[45]=g,e[46]=Z):Z=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(Nt,{className:"size-4"}),e[47]=ee):ee=e[47];let I;e[48]!==s?(I=s("mainPanelTabs.analyticsTab.edit"),e[48]=s,e[49]=I):I=e[49];let B;e[50]!==Z||e[51]!==I?(B=t.jsxs(be,{size:"sm",variant:"ghost",onClick:Z,children:[ee,I]}),e[50]=Z,e[51]=I,e[52]=B):B=e[52];let V;e[53]!==h||e[54]!==N?(V=h&&t.jsxs(be,{size:"sm",variant:"ghost",disabled:N.isPending,onClick:()=>N.mutate(),children:[t.jsx(it,{className:"size-4"}),N.isPending?"Rotating…":"Rotate token"]}),e[53]=h,e[54]=N,e[55]=V):V=e[55];let H;e[56]!==s?(H=s("mainPanelTabs.analyticsTab.unregister"),e[56]=s,e[57]=H):H=e[57];let q;e[58]!==p?(q=()=>p(!0),e[58]=p,e[59]=q):q=e[59];let U;e[60]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(kt,{className:"size-4"}),e[60]=U):U=e[60];let Q;e[61]!==H||e[62]!==q?(Q=t.jsx(be,{size:"icon-sm",variant:"ghost","aria-label":H,className:"text-muted-foreground hover:text-destructive",onClick:q,children:U}),e[61]=H,e[62]=q,e[63]=Q):Q=e[63];let J;e[64]!==F||e[65]!==B||e[66]!==V||e[67]!==Q?(J=t.jsxs("div",{className:"flex items-center gap-1.5",children:[F,B,V,Q]}),e[64]=F,e[65]=B,e[66]=V,e[67]=Q,e[68]=J):J=e[68];const se="flex flex-col gap-3",le="flex flex-wrap items-center gap-2",C=d?"success":"outline";let Y;e[69]!==d||e[70]!==s?(Y=s(d?"mainPanelTabs.analyticsTab.active":"mainPanelTabs.analyticsTab.paused"),e[69]=d,e[70]=s,e[71]=Y):Y=e[71];let L;e[72]!==C||e[73]!==Y?(L=t.jsx(Le,{variant:C,children:Y}),e[72]=C,e[73]=Y,e[74]=L):L=e[74];const ze=o.host??"—";let ie;e[75]!==s||e[76]!==ze?(ie=s("mainPanelTabs.analyticsTab.collectingUnder",{host:ze}),e[75]=s,e[76]=ze,e[77]=ie):ie=e[77];let re;e[78]!==ie?(re=t.jsx("span",{className:"text-sm text-muted-foreground",children:ie}),e[78]=ie,e[79]=re):re=e[79];const ye=i.id&&t.jsx("span",{className:"font-mono text-xs text-muted-foreground/80",children:s("mainPanelTabs.analyticsTab.idLabel",{id:i.id})});let oe;e[80]!==L||e[81]!==re||e[82]!==ye?(oe=t.jsxs("div",{className:le,children:[L,re,ye]}),e[80]=L,e[81]=re,e[82]=ye,e[83]=oe):oe=e[83];let ce;e[84]!==A?(ce=A.map(Is),e[84]=A,e[85]=ce):ce=e[85];let de;e[86]!==i.sampling||e[87]!==s?(de=typeof i.sampling=="number"&&i.sampling<1&&t.jsx(Le,{variant:"outline",children:s("mainPanelTabs.analyticsTab.sampling",{percent:String(Math.round(i.sampling*100))})}),e[86]=i.sampling,e[87]=s,e[88]=de):de=e[88];let me;e[89]!==ce||e[90]!==de?(me=t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[ce,de]}),e[89]=ce,e[90]=de,e[91]=me):me=e[91];let pe;e[92]!==oe||e[93]!==me?(pe=t.jsxs("div",{className:se,children:[oe,me]}),e[92]=oe,e[93]=me,e[94]=pe):pe=e[94];let z;e[95]!==W||e[96]!==O||e[97]!==J||e[98]!==pe?(z=t.jsx(W,{title:O,action:J,children:pe}),e[95]=W,e[96]=O,e[97]=J,e[98]=pe,e[99]=z):z=e[99];let fe;e[100]!==o?(fe=t.jsx(As,{status:o}),e[100]=o,e[101]=fe):fe=e[101];let ue;e[102]!==n||e[103]!==i||e[104]!==m||e[105]!==a||e[106]!==g||e[107]!==c?(ue=t.jsx(Ms,{base:n,orgSlug:a,site:c,config:i,open:m,onOpenChange:g}),e[102]=n,e[103]=i,e[104]=m,e[105]=a,e[106]=g,e[107]=c,e[108]=ue):ue=e[108];let Te;e[109]!==s?(Te=s("mainPanelTabs.analyticsTab.unregisterTitle"),e[109]=s,e[110]=Te):Te=e[110];let ve;e[111]!==Te?(ve=t.jsx(Mt,{children:Te}),e[111]=Te,e[112]=ve):ve=e[112];let Ne;e[113]!==c||e[114]!==s?(Ne=s("mainPanelTabs.analyticsTab.unregisterDescription",{site:c}),e[113]=c,e[114]=s,e[115]=Ne):Ne=e[115];let Pe;e[116]!==Ne?(Pe=t.jsx(Rt,{children:Ne}),e[116]=Ne,e[117]=Pe):Pe=e[117];let we;e[118]!==ve||e[119]!==Pe?(we=t.jsxs(Ft,{children:[ve,Pe]}),e[118]=ve,e[119]=Pe,e[120]=we):we=e[120];const jt=K.isPending;let Se;e[121]!==s?(Se=s("mainPanelTabs.analyticsTab.cancel"),e[121]=s,e[122]=Se):Se=e[122];let ke;e[123]!==K.isPending||e[124]!==Se?(ke=t.jsx(It,{disabled:jt,children:Se}),e[123]=K.isPending,e[124]=Se,e[125]=ke):ke=e[125];let _e;e[126]!==K?(_e=Me=>{Me.preventDefault(),K.mutate()},e[126]=K,e[127]=_e):_e=e[127];let Ce;e[128]!==K.isPending||e[129]!==s?(Ce=K.isPending?s("mainPanelTabs.analyticsTab.unregistering"):s("mainPanelTabs.analyticsTab.unregister"),e[128]=K.isPending,e[129]=s,e[130]=Ce):Ce=e[130];let Ke;e[131]!==K.isPending||e[132]!==_e||e[133]!==Ce?(Ke=t.jsx(zt,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:_e,disabled:K.isPending,children:Ce}),e[131]=K.isPending,e[132]=_e,e[133]=Ce,e[134]=Ke):Ke=e[134];let $e;e[135]!==ke||e[136]!==Ke?($e=t.jsxs(Bt,{children:[ke,Ke]}),e[135]=ke,e[136]=Ke,e[137]=$e):$e=e[137];let Ee;e[138]!==we||e[139]!==$e?(Ee=t.jsxs(Vt,{children:[we,$e]}),e[138]=we,e[139]=$e,e[140]=Ee):Ee=e[140];let Ae;e[141]!==b||e[142]!==p||e[143]!==Ee?(Ae=t.jsx(Ht,{open:b,onOpenChange:p,children:Ee}),e[141]=b,e[142]=p,e[143]=Ee,e[144]=Ae):Ae=e[144];let He;return e[145]!==D||e[146]!==z||e[147]!==fe||e[148]!==ue||e[149]!==Ae?(He=t.jsxs("div",{className:te,children:[D,z,fe,ue,Ae]}),e[145]=D,e[146]=z,e[147]=fe,e[148]=ue,e[149]=Ae,e[150]=He):He=e[150],He}function Is(r){return t.jsx(Le,{variant:"secondary",children:r},r)}function Bs(r){return ge.error(Ve(r))}function Vs(r){return ge.error(Ve(r))}function Hs(r){return ge.error(Ve(r))}function Us(r){const e=ae.c(95),{base:n,orgSlug:a,site:c,status:o}=r,s=xe(),[l,i]=ne.useState("24h"),[d,m]=ne.useState("overview"),[g,b]=ne.useState(!1);let p,u,v,h,y,x,j,f,T,N;if(e[0]!==d||e[1]!==o.config||e[2]!==o.host||e[3]!==s){p=o.config??{};const C=p.enabled!==!1;v=p.modules??["core"],u=d==="live",N="flex flex-col gap-5",T="flex flex-wrap items-start justify-between gap-3",f="flex flex-col gap-2",h="flex flex-wrap items-center gap-2";const Y=C?"success":"outline";let L;e[14]!==C||e[15]!==s?(L=s(C?"mainPanelTabs.analyticsTab.active":"mainPanelTabs.analyticsTab.paused"),e[14]=C,e[15]=s,e[16]=L):L=e[16],e[17]!==Y||e[18]!==L?(y=t.jsx(Le,{variant:Y,children:L}),e[17]=Y,e[18]=L,e[19]=y):y=e[19],x=t.jsx("span",{className:"text-sm text-muted-foreground",children:s("mainPanelTabs.analyticsTab.collectingUnder",{host:o.host??p.id??"—"})}),j=p.id&&t.jsx("span",{className:"font-mono text-xs text-muted-foreground/70",children:s("mainPanelTabs.analyticsTab.idLabel",{id:p.id})}),e[0]=d,e[1]=o.config,e[2]=o.host,e[3]=s,e[4]=p,e[5]=u,e[6]=v,e[7]=h,e[8]=y,e[9]=x,e[10]=j,e[11]=f,e[12]=T,e[13]=N}else p=e[4],u=e[5],v=e[6],h=e[7],y=e[8],x=e[9],j=e[10],f=e[11],T=e[12],N=e[13];let _;e[20]!==h||e[21]!==y||e[22]!==x||e[23]!==j?(_=t.jsxs("div",{className:h,children:[y,x,j]}),e[20]=h,e[21]=y,e[22]=x,e[23]=j,e[24]=_):_=e[24];let S;e[25]!==v?(S=v.map(Qs),e[25]=v,e[26]=S):S=e[26];let P;e[27]!==p.sampling||e[28]!==s?(P=typeof p.sampling=="number"&&p.sampling<1&&t.jsx(Le,{variant:"outline",children:s("mainPanelTabs.analyticsTab.sampling",{percent:String(Math.round(p.sampling*100))})}),e[27]=p.sampling,e[28]=s,e[29]=P):P=e[29];let w;e[30]!==P||e[31]!==S?(w=t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[S,P]}),e[30]=P,e[31]=S,e[32]=w):w=e[32];let $;e[33]!==w||e[34]!==f||e[35]!==_?($=t.jsxs("div",{className:f,children:[_,w]}),e[33]=w,e[34]=f,e[35]=_,e[36]=$):$=e[36];let k;e[37]!==u||e[38]!==l?(k=!u&&t.jsx("div",{className:"flex items-center gap-0.5 rounded-lg border border-border p-0.5",children:ts.map(C=>t.jsx("button",{type:"button",onClick:()=>i(C),className:qe("rounded-md px-2 py-1 text-xs font-medium tabular-nums transition-colors",l===C?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:C},C))}),e[37]=u,e[38]=l,e[39]=k):k=e[39];let E,K;e[40]===Symbol.for("react.memo_cache_sentinel")?(E=()=>b(!0),K=t.jsx(St,{className:"size-4"}),e[40]=E,e[41]=K):(E=e[40],K=e[41]);let A;e[42]!==s?(A=s("mainPanelTabs.analyticsTab.configSectionTitle"),e[42]=s,e[43]=A):A=e[43];let te;e[44]!==A?(te=t.jsxs(be,{variant:"outline",size:"sm",onClick:E,children:[K,A]}),e[44]=A,e[45]=te):te=e[45];let D;e[46]!==k||e[47]!==te?(D=t.jsxs("div",{className:"flex items-center gap-2",children:[k,te]}),e[46]=k,e[47]=te,e[48]=D):D=e[48];let W;e[49]!==$||e[50]!==D||e[51]!==T?(W=t.jsxs("div",{className:T,children:[$,D]}),e[49]=$,e[50]=D,e[51]=T,e[52]=W):W=e[52];let O;e[53]!==d||e[54]!==s?(O=es.map(C=>t.jsx("button",{type:"button",onClick:()=>m(C.view),className:qe("shrink-0 border-b-2 px-3 py-2 text-sm font-medium transition-colors",d===C.view?"border-[var(--chart-1)] text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:s(C.labelKey)},C.view)),e[53]=d,e[54]=s,e[55]=O):O=e[55];let G;e[56]!==O?(G=t.jsx("div",{className:"flex items-center gap-1 overflow-x-auto border-b border-border",children:O}),e[56]=O,e[57]=G):G=e[57];let M;e[58]!==d||e[59]!==n||e[60]!==p.quota||e[61]!==a||e[62]!==l||e[63]!==c?(M=t.jsx(Ks,{base:n,orgSlug:a,site:c,view:d,range:l,quota:p.quota},d),e[58]=d,e[59]=n,e[60]=p.quota,e[61]=a,e[62]=l,e[63]=c,e[64]=M):M=e[64];let X;e[65]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-4 py-3 text-sm font-medium text-foreground hover:bg-muted/40",children:[t.jsx(wt,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-90"}),"Send custom events from your code"]}),e[65]=X):X=e[65];let R;e[66]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsxs("p",{children:["Analytics is active automatically — pageviews are collected with no code. For custom events, call the public client API on"," ",t.jsx("span",{className:"font-mono text-foreground",children:"window.__dq"}),":"]}),e[66]=R):R=e[66];let F;e[67]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"pageview()"}),t.jsx("dd",{className:"text-xs",children:"Record a pageview manually (SPA route change)."})]}),e[67]=F):F=e[67];let Z;e[68]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"track(name, props?)"}),e[68]=Z):Z=e[68];let ee;e[69]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx("span",{className:"font-mono",children:"name"}),e[69]=ee):ee=e[69];let I;e[70]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[Z,t.jsxs("dd",{className:"text-xs",children:["A custom event. ",ee," is lowercase a–z, digits and underscore, up to 40 characters;"," ",t.jsx("span",{className:"font-mono",children:"props"})," is an optional flat object."]})]}),e[70]=I):I=e[70];let B;e[71]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"purchase({ transactionId, value, currency, items, itemIds })"}),e[71]=B):B=e[71];let V;e[72]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs("dl",{className:"flex flex-col gap-2",children:[F,I,t.jsxs("div",{className:"flex flex-col gap-0.5",children:[B,t.jsxs("dd",{className:"text-xs",children:["A purchase. ",t.jsx("span",{className:"font-mono",children:"transactionId"})," ","dedupes a reloaded confirmation page so a sale isn't counted twice."]})]})]}),e[72]=V):V=e[72];let H;e[73]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsxs("details",{className:"group rounded-xl border border-border bg-card",children:[X,t.jsxs("div",{className:"flex flex-col gap-3 border-t border-border px-4 py-4 text-sm text-muted-foreground",children:[R,V,t.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2",children:t.jsx("code",{className:"whitespace-pre-wrap break-all text-xs text-muted-foreground",children:`window.__dq.track("newsletter_signup", { plan: "pro" })
2
2
  window.__dq.purchase({ transactionId: "A123", value: 99.9, currency: "BRL" })`})})]})]}),e[73]=H):H=e[73];let q;e[74]!==s?(q=s("mainPanelTabs.analyticsTab.configSectionTitle"),e[74]=s,e[75]=q):q=e[75];let U;e[76]!==q?(U=t.jsx(rt,{children:t.jsx(ot,{children:q})}),e[76]=q,e[77]=U):U=e[77];let Q;e[78]!==n||e[79]!==a||e[80]!==c||e[81]!==o?(Q=t.jsx(Fs,{base:n,orgSlug:a,site:c,status:o}),e[78]=n,e[79]=a,e[80]=c,e[81]=o,e[82]=Q):Q=e[82];let J;e[83]!==U||e[84]!==Q?(J=t.jsxs(ct,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[U,Q]}),e[83]=U,e[84]=Q,e[85]=J):J=e[85];let se;e[86]!==g||e[87]!==J?(se=t.jsx(dt,{open:g,onOpenChange:b,children:J}),e[86]=g,e[87]=J,e[88]=se):se=e[88];let le;return e[89]!==W||e[90]!==G||e[91]!==M||e[92]!==se||e[93]!==N?(le=t.jsxs("div",{className:N,children:[W,G,M,H,se]}),e[89]=W,e[90]=G,e[91]=M,e[92]=se,e[93]=N,e[94]=le):le=e[94],le}function Qs(r){return t.jsx(Le,{variant:"secondary",children:r},r)}function ml(r){const e=ae.c(46),{virtualMcpId:n}=r,a=xe(),{org:c}=Tt(),o=Qt(n),s=Yt(o),l=!!s,i=s?`/api/${c.slug}/hosting/${encodeURIComponent(s)}`:"";let d;e[0]!==i?(d=()=>xt(`${i}/analytics/status`),e[0]=i,e[1]=d):d=e[1];const m=nt({queryKey:Be.analyticsStatus(c.slug,s??""),queryFn:d,enabled:l,retry:!1,staleTime:3e4}),[g,b]=ne.useState(null);if(!s){let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(De,{className:"size-5"}),e[2]=k):k=e[2];let E;e[3]!==a?(E=a("mainPanelTabs.analyticsTab.noSiteTitle"),e[3]=a,e[4]=E):E=e[4];let K;e[5]!==a?(K=a("mainPanelTabs.analyticsTab.noSiteDescription"),e[5]=a,e[6]=K):K=e[6];let A;return e[7]!==E||e[8]!==K?(A=t.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:t.jsx(Re,{icon:k,title:E,description:K})}),e[7]=E,e[8]=K,e[9]=A):A=e[9],A}if(as(m.error)){let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(De,{className:"size-5"}),e[10]=k):k=e[10];let E;e[11]!==a?(E=a("mainPanelTabs.analyticsTab.notConnectedTitle"),e[11]=a,e[12]=E):E=e[12];let K;e[13]!==a?(K=a("mainPanelTabs.analyticsTab.notConnectedDescription"),e[13]=a,e[14]=K):K=e[14];let A;return e[15]!==E||e[16]!==K?(A=t.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:t.jsx(Re,{icon:k,title:E,description:K})}),e[15]=E,e[16]=K,e[17]=A):A=e[17],A}let p;e[18]!==m.data?(p=m.data??{},e[18]=m.data,e[19]=p):p=e[19];const u=p,v="h-full min-h-0 overflow-y-auto",h="mx-auto flex w-full max-w-[1400px] flex-col gap-6 p-6",y="flex flex-col gap-1";let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(De,{className:"size-[18px] text-muted-foreground"}),e[20]=x):x=e[20];let j;e[21]!==a?(j=a("mainPanelTabs.analyticsTab.title"),e[21]=a,e[22]=j):j=e[22];let f;e[23]!==j?(f=t.jsxs("div",{className:"flex items-center gap-2",children:[x,t.jsx("h2",{className:"text-base font-semibold text-foreground",children:j})]}),e[23]=j,e[24]=f):f=e[24];const T="text-sm text-muted-foreground",N=a("mainPanelTabs.analyticsTab.subtitle",{site:s});let _;e[25]!==N?(_=t.jsx("p",{className:T,children:N}),e[25]=N,e[26]=_):_=e[26];let S;e[27]!==_||e[28]!==f?(S=t.jsxs("div",{className:y,children:[f,_]}),e[27]=_,e[28]=f,e[29]=S):S=e[29];let P;e[30]!==g||e[31]!==b?(P=g&&t.jsx(yt,{result:g,onDismiss:()=>b(null)}),e[30]=g,e[31]=b,e[32]=P):P=e[32];let w;e[33]!==i||e[34]!==c.slug||e[35]!==b||e[36]!==s||e[37]!==u||e[38]!==m.error||e[39]!==m.isLoading||e[40]!==a?(w=m.isLoading?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Ue,{className:"h-8 w-full"}),t.jsx(Ue,{className:"h-40 w-full"})]}):m.error?ut(m.error)?t.jsx(Re,{icon:t.jsx(De,{className:"size-5"}),title:a("mainPanelTabs.analyticsTab.backendNotConfiguredTitle"),description:a("mainPanelTabs.analyticsTab.backendNotConfiguredDescription")}):t.jsx(Re,{icon:t.jsx(De,{className:"size-5"}),title:a("mainPanelTabs.analyticsTab.statusError")}):u.configured===!1?t.jsx(Re,{icon:t.jsx(De,{className:"size-5"}),title:a("mainPanelTabs.analyticsTab.backendNotConfiguredTitle"),description:a("mainPanelTabs.analyticsTab.backendNotConfiguredDescription")}):u.registered?t.jsx(Us,{base:i,orgSlug:c.slug,site:s,status:u}):t.jsx(qs,{base:i,orgSlug:c.slug,site:s,host:u.host??null,onRegistered:b}),e[33]=i,e[34]=c.slug,e[35]=b,e[36]=s,e[37]=u,e[38]=m.error,e[39]=m.isLoading,e[40]=a,e[41]=w):w=e[41];let $;return e[42]!==S||e[43]!==P||e[44]!==w?($=t.jsx("div",{className:v,children:t.jsxs("div",{className:h,children:[S,P,w]})}),e[42]=S,e[43]=P,e[44]=w,e[45]=$):$=e[45],$}export{ml as AnalyticsTab};
@@ -1 +1 @@
1
- import{c as v,j as t,dy as se,b as F,r as L,B as N,t as R}from"./index-DzWX3Cp7.js";import{i as ie}from"./AlertCircle-CvTl8GUk.js";import{a as le}from"./Copy01-DFbLtEE_.js";import{i as J}from"./Key01-DI1s7GXT.js";import{s as M}from"./Plus-C1-Ar8V6.js";import{s as ne}from"./Trash01-B6uMSqgT.js";import{A as ae,a as re,b as oe,c as ce,d as de,e as me,f as fe,g as pe}from"./alert-dialog-DaZn9Nvz.js";import{d as Q,h as U,c as V,e as W,b as X,D as Y}from"./dialog-DTBCjL3p.js";import{I as Z}from"./input-CeihZKzh.js";import{L as ue}from"./label-CSACuw4I.js";import{a as xe,b as ge,u as ye}from"./use-api-keys-UXPEqfgx.js";import{R as he}from"./require-capability-DJ721q13.js";import"./use-mcp-client-BSJVCOyq.js";import"./constants-dLUUoWH7.js";import"./auth-u2nXBxlp.js";import"./access-gate-R7rS3NRc.js";import"./capability-load-error-C_sjvMSo.js";function je(c){const e=v.c(6),{error:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ie,{size:16}),e[0]=i):i=e[0];let s;e[1]!==d.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:d.message}),e[1]=d.message,e[2]=r,e[3]=s):s=e[3];let l;return e[4]!==s?(l=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,t.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=l):l=e[5],l}function Ke(c){const e=v.c(20),{apiKey:d,onDelete:r}=c,i=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(J,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let l;e[1]!==d.name?(l=t.jsx("span",{className:"font-medium text-sm truncate block",children:d.name}),e[1]=d.name,e[2]=l):l=e[2];let o;e[3]!==d.createdAt||e[4]!==i?(o=i("settings.apiKeys.createdAt",{date:new Date(d.createdAt).toLocaleDateString()}),e[3]=d.createdAt,e[4]=i,e[5]=o):o=e[5];let n;e[6]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o}),e[6]=o,e[7]=n):n=e[7];let m;e[8]!==l||e[9]!==n?(m=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[l,n]})]}),e[8]=l,e[9]=n,e[10]=m):m=e[10];let a;e[11]!==i?(a=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=a):a=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ne,{size:14}),e[13]=f):f=e[13];let u;e[14]!==r||e[15]!==a?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":a,children:f}),e[14]=r,e[15]=a,e[16]=u):u=e[16];let p;return e[17]!==m||e[18]!==u?(p=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=p):p=e[19],p}function be(c){const e=v.c(21),{onCreate:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(J,{size:20,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let l;e[3]!==s?(l=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=l):l=e[4];let o;e[5]!==r?(o=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=o):o=e[6];let n;e[7]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=n):n=e[8];let m;e[9]!==l||e[10]!==n?(m=t.jsxs("div",{children:[l,n]}),e[9]=l,e[10]=n,e[11]=m):m=e[11];let a;e[12]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(M,{size:14}),e[12]=a):a=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let u;e[15]!==d||e[16]!==f?(u=t.jsxs(N,{onClick:d,size:"sm",className:"mt-2",children:[a,f]}),e[15]=d,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==m||e[19]!==u?(p=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[i,m,u]}),e[18]=m,e[19]=u,e[20]=p):p=e[20],p}function H(c){const e=v.c(40),{createdKey:d,onClose:r}=c,i=F(),s=d!==null;let l;e[0]!==r?(l=A=>!A&&r(),e[0]=r,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=o):o=e[3];let n;e[4]!==o?(n=t.jsx(Q,{children:o}),e[4]=o,e[5]=n):n=e[5];let m;e[6]!==i?(m=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=m):m=e[7];let a;e[8]!==m?(a=t.jsx(U,{children:m}),e[8]=m,e[9]=a):a=e[9];let f;e[10]!==n||e[11]!==a?(f=t.jsxs(V,{children:[n,a]}),e[10]=n,e[11]=a,e[12]=f):f=e[12];const u=d?.key??"";let p;e[13]!==u?(p=t.jsx(Z,{readOnly:!0,value:u,className:"font-mono text-xs"}),e[13]=u,e[14]=p):p=e[14];let x;e[15]!==d||e[16]!==i?(x=()=>{d&&(navigator.clipboard?.writeText(d.key),R.success(i("settings.apiKeys.copied")))},e[15]=d,e[16]=i,e[17]=x):x=e[17];let g;e[18]!==i?(g=i("settings.apiKeys.copyKey"),e[18]=i,e[19]=g):g=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(le,{size:14}),e[20]=b):b=e[20];let y;e[21]!==x||e[22]!==g?(y=t.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:x,"aria-label":g,children:b}),e[21]=x,e[22]=g,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==p?(h=t.jsxs("div",{className:"flex items-center gap-2",children:[p,y]}),e[24]=y,e[25]=p,e[26]=h):h=e[26];let j;e[27]!==i?(j=i("settings.apiKeys.done"),e[27]=i,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=t.jsx(W,{children:t.jsx(N,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let C;e[32]!==h||e[33]!==K||e[34]!==f?(C=t.jsxs(X,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==l?(D=t.jsx(Y,{open:s,onOpenChange:l,children:C}),e[36]=s,e[37]=C,e[38]=l,e[39]=D):D=e[39],D}function G(c){const e=v.c(64),{open:d,onOpenChange:r,onCreated:i}=c,s=F(),[l,o]=L.useState(""),n=ye();let m;e[0]!==r?(m=function(){o(""),r(!1)},e[0]=r,e[1]=m):m=e[1];const a=m;let f;e[2]!==n||e[3]!==a||e[4]!==l||e[5]!==i||e[6]!==s?(f=async function(te){if(te.preventDefault(),!!l.trim())try{const I=await n.mutateAsync({name:l.trim()});a(),i(I)}catch(I){const q=I;R.error(q instanceof Error?q.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=n,e[3]=a,e[4]=l,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==a||e[9]!==r?(p=$=>{$?r($):a()},e[8]=a,e[9]=r,e[10]=p):p=e[10];let x;e[11]!==s?(x=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Q,{children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==s?(b=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(U,{children:b}),e[17]=b,e[18]=y):y=e[18];let h;e[19]!==g||e[20]!==y?(h=t.jsxs(V,{children:[g,y]}),e[19]=g,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=t.jsx(ue,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=$=>o($.target.value),e[26]=C):C=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let A;e[29]!==l||e[30]!==D?(A=t.jsx(Z,{id:"api-key-name",value:l,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=l,e[30]=D,e[31]=A):A=e[31];let k;e[32]!==K||e[33]!==A?(k=t.jsxs("div",{className:"space-y-1.5",children:[K,A]}),e[32]=K,e[33]=A,e[34]=k):k=e[34];const ee=n.isPending;let S;e[35]!==s?(S=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=S):S=e[36];let _;e[37]!==n.isPending||e[38]!==a||e[39]!==S?(_=t.jsx(N,{type:"button",variant:"outline",onClick:a,disabled:ee,children:S}),e[37]=n.isPending,e[38]=a,e[39]=S,e[40]=_):_=e[40];let w;e[41]!==n.isPending||e[42]!==l?(w=n.isPending||!l.trim(),e[41]=n.isPending,e[42]=l,e[43]=w):w=e[43];let P;e[44]!==n.isPending||e[45]!==s?(P=n.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=n.isPending,e[45]=s,e[46]=P):P=e[46];let z;e[47]!==w||e[48]!==P?(z=t.jsx(N,{type:"submit",disabled:w,children:P}),e[47]=w,e[48]=P,e[49]=z):z=e[49];let T;e[50]!==_||e[51]!==z?(T=t.jsxs(W,{children:[_,z]}),e[50]=_,e[51]=z,e[52]=T):T=e[52];let O;e[53]!==u||e[54]!==k||e[55]!==T?(O=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[k,T]}),e[53]=u,e[54]=k,e[55]=T,e[56]=O):O=e[56];let E;e[57]!==O||e[58]!==h?(E=t.jsxs(X,{className:"sm:max-w-lg",children:[h,O]}),e[57]=O,e[58]=h,e[59]=E):E=e[59];let B;return e[60]!==d||e[61]!==E||e[62]!==p?(B=t.jsx(Y,{open:d,onOpenChange:p,children:E}),e[60]=d,e[61]=E,e[62]=p,e[63]=B):B=e[63],B}function Ce(){const c=F(),{data:e=[]}=xe(),d=ge(),[r,i]=L.useState(!1),[s,l]=L.useState(null),[o,n]=L.useState(null);async function m(){if(o)try{await d.mutateAsync(o.id),R.success(c("settings.apiKeys.keyDeleted",{name:o.name}))}catch(a){R.error(a instanceof Error?a.message:c("settings.apiKeys.failedToDeleteKey"))}finally{n(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(be,{onCreate:()=>i(!0)}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:c(e.length===1?"settings.apiKeys.keysCountSingular":"settings.apiKeys.keysCountPlural",{count:e.length})}),t.jsxs(N,{onClick:()=>i(!0),size:"sm",children:[t.jsx(M,{size:14}),c("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(a=>t.jsx(Ke,{apiKey:a,onDelete:()=>n(a)},a.id))})}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)}),t.jsx(ae,{open:o!==null,onOpenChange:a=>{a||n(null)},children:t.jsxs(re,{children:[t.jsxs(oe,{children:[t.jsx(ce,{children:c("settings.apiKeys.deleteTitle",{name:o?.name??""})}),t.jsx(de,{children:c("settings.apiKeys.deleteDescription")})]}),t.jsxs(me,{children:[t.jsx(fe,{children:c("settings.apiKeys.cancelButton")}),t.jsx(pe,{onClick:m,children:c("settings.apiKeys.deleteKey")})]})]})})]})}function De(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(se,{group:"connect",errorFallback:Ae,children:t.jsx(Ce,{})}),c[0]=e):e=c[0],e}function Ae(c){const{error:e}=c;return t.jsx(je,{error:e??new Error("Failed to load API keys")})}function qe(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(he,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(De,{})}),c[0]=e):e=c[0],e}export{qe as default};
1
+ import{c as v,j as t,dy as se,b as F,r as L,B as N,t as R}from"./index-B1nt3Xdg.js";import{i as ie}from"./AlertCircle-D9xToIMB.js";import{a as le}from"./Copy01-CUcc1rT7.js";import{i as J}from"./Key01-NqAAYAzO.js";import{s as M}from"./Plus-DBZfXSlG.js";import{s as ne}from"./Trash01-6BnXuuT1.js";import{A as ae,a as re,b as oe,c as ce,d as de,e as me,f as fe,g as pe}from"./alert-dialog-BX_76dkp.js";import{d as Q,h as U,c as V,e as W,b as X,D as Y}from"./dialog-RnHnbV2_.js";import{I as Z}from"./input-AdYfWDmT.js";import{L as ue}from"./label-4zu9GnvJ.js";import{a as xe,b as ge,u as ye}from"./use-api-keys-D6gaGAjx.js";import{R as he}from"./require-capability-CupXunWP.js";import"./use-mcp-client-DutrBTnT.js";import"./constants-dLUUoWH7.js";import"./auth-7vEypH_C.js";import"./access-gate-CAnPAIdH.js";import"./capability-load-error-B0FOp6ZJ.js";function je(c){const e=v.c(6),{error:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ie,{size:16}),e[0]=i):i=e[0];let s;e[1]!==d.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:d.message}),e[1]=d.message,e[2]=r,e[3]=s):s=e[3];let l;return e[4]!==s?(l=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,t.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=l):l=e[5],l}function Ke(c){const e=v.c(20),{apiKey:d,onDelete:r}=c,i=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(J,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let l;e[1]!==d.name?(l=t.jsx("span",{className:"font-medium text-sm truncate block",children:d.name}),e[1]=d.name,e[2]=l):l=e[2];let o;e[3]!==d.createdAt||e[4]!==i?(o=i("settings.apiKeys.createdAt",{date:new Date(d.createdAt).toLocaleDateString()}),e[3]=d.createdAt,e[4]=i,e[5]=o):o=e[5];let n;e[6]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o}),e[6]=o,e[7]=n):n=e[7];let m;e[8]!==l||e[9]!==n?(m=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[l,n]})]}),e[8]=l,e[9]=n,e[10]=m):m=e[10];let a;e[11]!==i?(a=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=a):a=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ne,{size:14}),e[13]=f):f=e[13];let u;e[14]!==r||e[15]!==a?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":a,children:f}),e[14]=r,e[15]=a,e[16]=u):u=e[16];let p;return e[17]!==m||e[18]!==u?(p=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=p):p=e[19],p}function be(c){const e=v.c(21),{onCreate:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(J,{size:20,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let l;e[3]!==s?(l=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=l):l=e[4];let o;e[5]!==r?(o=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=o):o=e[6];let n;e[7]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=n):n=e[8];let m;e[9]!==l||e[10]!==n?(m=t.jsxs("div",{children:[l,n]}),e[9]=l,e[10]=n,e[11]=m):m=e[11];let a;e[12]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(M,{size:14}),e[12]=a):a=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let u;e[15]!==d||e[16]!==f?(u=t.jsxs(N,{onClick:d,size:"sm",className:"mt-2",children:[a,f]}),e[15]=d,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==m||e[19]!==u?(p=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[i,m,u]}),e[18]=m,e[19]=u,e[20]=p):p=e[20],p}function H(c){const e=v.c(40),{createdKey:d,onClose:r}=c,i=F(),s=d!==null;let l;e[0]!==r?(l=A=>!A&&r(),e[0]=r,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=o):o=e[3];let n;e[4]!==o?(n=t.jsx(Q,{children:o}),e[4]=o,e[5]=n):n=e[5];let m;e[6]!==i?(m=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=m):m=e[7];let a;e[8]!==m?(a=t.jsx(U,{children:m}),e[8]=m,e[9]=a):a=e[9];let f;e[10]!==n||e[11]!==a?(f=t.jsxs(V,{children:[n,a]}),e[10]=n,e[11]=a,e[12]=f):f=e[12];const u=d?.key??"";let p;e[13]!==u?(p=t.jsx(Z,{readOnly:!0,value:u,className:"font-mono text-xs"}),e[13]=u,e[14]=p):p=e[14];let x;e[15]!==d||e[16]!==i?(x=()=>{d&&(navigator.clipboard?.writeText(d.key),R.success(i("settings.apiKeys.copied")))},e[15]=d,e[16]=i,e[17]=x):x=e[17];let g;e[18]!==i?(g=i("settings.apiKeys.copyKey"),e[18]=i,e[19]=g):g=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(le,{size:14}),e[20]=b):b=e[20];let y;e[21]!==x||e[22]!==g?(y=t.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:x,"aria-label":g,children:b}),e[21]=x,e[22]=g,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==p?(h=t.jsxs("div",{className:"flex items-center gap-2",children:[p,y]}),e[24]=y,e[25]=p,e[26]=h):h=e[26];let j;e[27]!==i?(j=i("settings.apiKeys.done"),e[27]=i,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=t.jsx(W,{children:t.jsx(N,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let C;e[32]!==h||e[33]!==K||e[34]!==f?(C=t.jsxs(X,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==l?(D=t.jsx(Y,{open:s,onOpenChange:l,children:C}),e[36]=s,e[37]=C,e[38]=l,e[39]=D):D=e[39],D}function G(c){const e=v.c(64),{open:d,onOpenChange:r,onCreated:i}=c,s=F(),[l,o]=L.useState(""),n=ye();let m;e[0]!==r?(m=function(){o(""),r(!1)},e[0]=r,e[1]=m):m=e[1];const a=m;let f;e[2]!==n||e[3]!==a||e[4]!==l||e[5]!==i||e[6]!==s?(f=async function(te){if(te.preventDefault(),!!l.trim())try{const I=await n.mutateAsync({name:l.trim()});a(),i(I)}catch(I){const q=I;R.error(q instanceof Error?q.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=n,e[3]=a,e[4]=l,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==a||e[9]!==r?(p=$=>{$?r($):a()},e[8]=a,e[9]=r,e[10]=p):p=e[10];let x;e[11]!==s?(x=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Q,{children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==s?(b=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(U,{children:b}),e[17]=b,e[18]=y):y=e[18];let h;e[19]!==g||e[20]!==y?(h=t.jsxs(V,{children:[g,y]}),e[19]=g,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=t.jsx(ue,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=$=>o($.target.value),e[26]=C):C=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let A;e[29]!==l||e[30]!==D?(A=t.jsx(Z,{id:"api-key-name",value:l,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=l,e[30]=D,e[31]=A):A=e[31];let k;e[32]!==K||e[33]!==A?(k=t.jsxs("div",{className:"space-y-1.5",children:[K,A]}),e[32]=K,e[33]=A,e[34]=k):k=e[34];const ee=n.isPending;let S;e[35]!==s?(S=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=S):S=e[36];let _;e[37]!==n.isPending||e[38]!==a||e[39]!==S?(_=t.jsx(N,{type:"button",variant:"outline",onClick:a,disabled:ee,children:S}),e[37]=n.isPending,e[38]=a,e[39]=S,e[40]=_):_=e[40];let w;e[41]!==n.isPending||e[42]!==l?(w=n.isPending||!l.trim(),e[41]=n.isPending,e[42]=l,e[43]=w):w=e[43];let P;e[44]!==n.isPending||e[45]!==s?(P=n.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=n.isPending,e[45]=s,e[46]=P):P=e[46];let z;e[47]!==w||e[48]!==P?(z=t.jsx(N,{type:"submit",disabled:w,children:P}),e[47]=w,e[48]=P,e[49]=z):z=e[49];let T;e[50]!==_||e[51]!==z?(T=t.jsxs(W,{children:[_,z]}),e[50]=_,e[51]=z,e[52]=T):T=e[52];let O;e[53]!==u||e[54]!==k||e[55]!==T?(O=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[k,T]}),e[53]=u,e[54]=k,e[55]=T,e[56]=O):O=e[56];let E;e[57]!==O||e[58]!==h?(E=t.jsxs(X,{className:"sm:max-w-lg",children:[h,O]}),e[57]=O,e[58]=h,e[59]=E):E=e[59];let B;return e[60]!==d||e[61]!==E||e[62]!==p?(B=t.jsx(Y,{open:d,onOpenChange:p,children:E}),e[60]=d,e[61]=E,e[62]=p,e[63]=B):B=e[63],B}function Ce(){const c=F(),{data:e=[]}=xe(),d=ge(),[r,i]=L.useState(!1),[s,l]=L.useState(null),[o,n]=L.useState(null);async function m(){if(o)try{await d.mutateAsync(o.id),R.success(c("settings.apiKeys.keyDeleted",{name:o.name}))}catch(a){R.error(a instanceof Error?a.message:c("settings.apiKeys.failedToDeleteKey"))}finally{n(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(be,{onCreate:()=>i(!0)}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:c(e.length===1?"settings.apiKeys.keysCountSingular":"settings.apiKeys.keysCountPlural",{count:e.length})}),t.jsxs(N,{onClick:()=>i(!0),size:"sm",children:[t.jsx(M,{size:14}),c("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(a=>t.jsx(Ke,{apiKey:a,onDelete:()=>n(a)},a.id))})}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)}),t.jsx(ae,{open:o!==null,onOpenChange:a=>{a||n(null)},children:t.jsxs(re,{children:[t.jsxs(oe,{children:[t.jsx(ce,{children:c("settings.apiKeys.deleteTitle",{name:o?.name??""})}),t.jsx(de,{children:c("settings.apiKeys.deleteDescription")})]}),t.jsxs(me,{children:[t.jsx(fe,{children:c("settings.apiKeys.cancelButton")}),t.jsx(pe,{onClick:m,children:c("settings.apiKeys.deleteKey")})]})]})})]})}function De(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(se,{group:"connect",errorFallback:Ae,children:t.jsx(Ce,{})}),c[0]=e):e=c[0],e}function Ae(c){const{error:e}=c;return t.jsx(je,{error:e??new Error("Failed to load API keys")})}function qe(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(he,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(De,{})}),c[0]=e):e=c[0],e}export{qe as default};
@@ -1 +1 @@
1
- import{c as jt,b as Bt,r as A,j as o,n as _t,k as wt,t as ht}from"./index-DzWX3Cp7.js";import{b as At}from"./chat-context-BmrkHxvs.js";import{i as Et}from"./ChevronRight-CFq-xjDr.js";import{S as Nt}from"./scroll-area-B1JJpr8q.js";import{u as Rt,A as Tt}from"./use-section-preview-base-D4Uenzpk.js";import{n as Ct,r as Kt,c as Pt,d as Ft,e as $t,g as Ot,h as Ut,S as It,i as zt,j as Lt}from"./index-CUbU69yL.js";import"./use-panel-navigate-DgzMtV_g.js";import"./use-destination-route-5ohWT7Qh.js";import"./thread-route-DeHkzwDt.js";import"./dialog-DTBCjL3p.js";import"./Check-DSjqiSlI.js";import"./Copy01-DFbLtEE_.js";import"./Download01-fMmULFBI.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-D5T_ngz5.js";import"./use-mcp-client-BSJVCOyq.js";import"./auth-u2nXBxlp.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BRSPyUN1.js";import"./task-board-5gg33Ohs.js";import"./schema-D8AYNAy-.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-rD7iTKaS.js";import"./use-ai-providers-aLNvcjYm.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DjOPFnW5.js";import"./use-organization-settings-MqNQsyj4.js";import"./select-BmVeV1Oo.js";import"./ChevronDown-DhjGSQsl.js";import"./ChevronUp-B8O2JP9t.js";import"./agent-icon-XAlp8Jca.js";import"./AlertCircle-CvTl8GUk.js";import"./UserSquare-Ci10BLiP.js";import"./Tool01-FZuiStzo.js";import"./ArrowUp-D8TsT0Lm.js";import"./ArrowLeft-En4cxPnP.js";import"./Tool02-4ay4Rltz.js";import"./XCircle-fDpSGJss.js";import"./TrendUp01-BlXVhMez.js";import"./ZapSquare-CuLB3vSB.js";import"./ZoomOut-DBEFR5j8.js";import"./Users03-DoYa8GlE.js";import"./CheckCircle-D6G-NhwM.js";import"./ChevronSelectorVertical-BE4HzvdJ.js";import"./DotsVertical-D9HzRd7W.js";import"./Stars02-CNJhdHZL.js";import"./CreditCard01-BedV58xE.js";import"./Settings02-vjLIHGa1.js";import"./Eye-Dsgi67Qs.js";import"./FilterLines-_6k9yUOL.js";import"./Share07-C1Uf7qgT.js";import"./GitBranch01-DtCvW7mH.js";import"./Globe01-CpbZ1qSV.js";import"./Globe04-sA6q1ulU.js";import"./SwitchHorizontal01-CVGPFZX2.js";import"./HardDrive-jZCTSG6y.js";import"./Image01-QhTk0EJi.js";import"./Key01-DI1s7GXT.js";import"./LinkExternal01-BZQeEyC_.js";import"./LockUnlocked01-D6aTu88G.js";import"./LogOut01-C-Z_9N06.js";import"./Monitor01-CKGo6W4T.js";import"./Sun-C_FOMwDI.js";import"./Package-GAQe_Wih.js";import"./Palette-wN0ma8Xt.js";import"./Play-C9_Cyluj.js";import"./Plus-C1-Ar8V6.js";import"./SearchLg-C6D1oQXi.js";import"./SearchMd-Cbw_793f.js";import"./Shield01-Ce5yG-A0.js";import"./Stars01-DrMQPFwe.js";import"./Trash01-B6uMSqgT.js";import"./Upload01-ILgL8mQU.js";import"./User01-BP-jVp5a.js";import"./Users01-7X-sDRIV.js";import"./XClose-Bk3zrAvS.js";import"./Zap-CWUKEmdj.js";import"./input-CeihZKzh.js";import"./automation-runs-CEP_ybkW.js";import"./useInfiniteQuery-Dq0Mnrq6.js";import"./use-infinite-scroll-BlsiddiC.js";import"./use-connection-VZ53ErwX.js";import"./table-CH6JgQ5S.js";import"./empty-state-DKcBij1q.js";import"./use-members-j7jWCFsT.js";import"./use-org-auth-client-ByKmCPrY.js";import"./use-automations-CFWyNfS1.js";import"./useSuspenseInfiniteQuery-Cohw3A6l.js";import"./avatar-BbSi4Ahi.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CG3mMOGM.js";import"./markdown-CC0DcQj5.js";import"./monaco-editor-D2SIw1Et.js";import"./spinner-C4CawlPH.js";import"./editor-B1qIIE_V.js";import"./types-DQk9hRll.js";import"./shell-layout-DRlxyJgc.js";import"./required-auth-layout-ByPgJ6gr.js";import"./use-org-sso-DQw6J9tz.js";import"./integration-icon-BoEQOkUl.js";import"./use-navigate-to-agent-q-tSB2RT.js";import"./chart-GkhxWJ7A.js";import"./index-CljteriX.js";import"./AreaChart-DJSypADj.js";import"./form-BD0h205i.js";import"./label-CSACuw4I.js";import"./file-type-icon-CEM_VOCL.js";import"./drawer-RsO7C1I2.js";import"./collection-search-CMowvqDA.js";import"./agent-capabilities-B52k7xCe.js";import"./use-mcp-tools-Cfilxpil.js";import"./tabs-CQgkEoZ3.js";import"./toggle-group-ZsqxhHJY.js";import"./super-agent-icon-BgHgBnGI.js";import"./self-tool-result-B86OvIYq.js";import"./alert-dialog-DaZn9Nvz.js";import"./extract-connection-data-TCmhOKLZ.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-CbZNeTWE.js";import"./authenticate-and-persist-oauth-BIKOg1Y0.js";import"./mcp-oauth-BtBczYS0.js";import"./track-Bm2TIrkx.js";import"./popover-VOQv4Dwp.js";import"./toolbar-CElQJFOW.js";import"./github-repo-picker-Bk4yNfvo.js";import"./connection-card-zpHiniPN.js";import"./use-registry-connections-eAaDtKjz.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-9Rz3z4Fn.js";import"./connection-form-helpers-ic8oRIkL.js";import"./collection-tabs-CuiCeffA.js";import"./badge-uxylkj2W.js";import"./select-model-DkVH4gVC.js";import"./checkbox-BBMI6E1M.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-DcobLOu-.js";import"./dropdown-menu-FLYHHrdp.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BEnPvRlF.js";import"./skill-preview-BX5g9fdR.js";import"./use-file-configs-CsmxRybV.js";import"./site-slug-uya6Wp4-.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-C5UaQZ0N.js";import"./search-input-CXLNkNlg.js";import"./use-mcp-auth-status-BMecBA5H.js";import"./switch-Bjx8pCq6.js";import"./use-secrets-L2RIZChP.js";import"./config-BzzgD7df.js";import"./command-BDxbk6Rw.js";import"./index-Pso9Jce7.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-ClZlgUkn.js";import"./use-tags-DtZPkyN3.js";import"./automation-list-row-B2rpCbUW.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-C0jcZ4_s.js";import"./cards-CImABGVq.js";function Vt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",s=Ct(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function Gr(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:s,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=At()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=Kt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Pt(p,x,a):p);let C;t[9]!==s||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Ft(C);let K;t[13]!==s||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=$t(K);let P;t[17]!==S?(P=zt((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),$=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Mt),xt([]));let O;t[20]!==x?(O=x??{},t[20]=x,t[21]=O):O=t[21];const rt=O;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let U;t[24]!==rt||t[25]!==y?(U={...rt,...y},t[24]=rt,t[25]=y,t[26]=U):U=t[26];const it=U;let I;t[27]!==p||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await k(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const pt=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=Ot(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ut(g,r)),ft(qt)},title:f,className:_t("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let j;t[42]!==W?(j=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let _;t[47]!==p||t[48]!==s||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==st||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(It,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:st,sandbox:{orgSlug:m,virtualMcpId:i,branch:s,threadId:G}},`${p}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=s,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=st,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=t[67];let w;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(w=h&&o.jsx(Tt,{open:ot,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=w):w=t[74];let M;return t[75]!==B||t[76]!==_||t[77]!==w?(M=o.jsxs("div",{className:gt,children:[B,_,w]}),t[75]=B,t[76]=_,t[77]=w,t[78]=M):M=t[78],M}function qt(n){return n+1}function Mt(n){return n+1}export{Gr as AppEditor};
1
+ import{c as jt,b as Bt,r as A,j as o,n as _t,k as wt,t as ht}from"./index-B1nt3Xdg.js";import{b as At}from"./chat-context-Zn18Z3ax.js";import{i as Et}from"./ChevronRight-6fJEb030.js";import{S as Nt}from"./scroll-area-B65aUbeU.js";import{u as Rt,A as Tt}from"./use-section-preview-base-CcgeQUfT.js";import{n as Ct,r as Kt,c as Pt,d as Ft,e as $t,g as Ot,h as Ut,S as It,i as zt,j as Lt}from"./index-Bh7YQlM-.js";import"./use-panel-navigate-Hc2laixt.js";import"./use-destination-route-Bwq_DPii.js";import"./thread-route-DN2Q30L2.js";import"./dialog-RnHnbV2_.js";import"./Check-DrJ5WDdf.js";import"./Copy01-CUcc1rT7.js";import"./Download01-CHg3oeOm.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-CW9tPvKI.js";import"./use-mcp-client-DutrBTnT.js";import"./auth-7vEypH_C.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DQeLKSQU.js";import"./task-board-BkvpnY9-.js";import"./schema-t2BCCSG_.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-RRdOWPQj.js";import"./use-ai-providers-Cn2yDSye.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DuC0EbuZ.js";import"./use-organization-settings-BKp-wao-.js";import"./select-BPrUFCUH.js";import"./ChevronDown-BsHyJSwB.js";import"./ChevronUp-CCrhZnmK.js";import"./agent-icon-B7KCMUKT.js";import"./AlertCircle-D9xToIMB.js";import"./UserSquare-CIzmAXPF.js";import"./Tool01-CCBlQ0Zq.js";import"./ArrowUp-CrGAU3G2.js";import"./ArrowLeft-BjMncG6U.js";import"./Tool02-Bgo46UaV.js";import"./XCircle-DET_WiPa.js";import"./TrendUp01-8KB74JpW.js";import"./ZapSquare-CKJZ8MMK.js";import"./ZoomOut-DEARxChf.js";import"./Users03-Cwe_MBwk.js";import"./CheckCircle-waoO5z0g.js";import"./ChevronSelectorVertical-BtjD2Krx.js";import"./DotsVertical-D-G3pLTC.js";import"./Stars02-r7zSgG8J.js";import"./CreditCard01-Lvg_l2cC.js";import"./Settings02-DmnWdsnV.js";import"./Eye-D7CF9t7J.js";import"./FilterLines-tHfmLV3o.js";import"./Share07-DbERY_pc.js";import"./GitBranch01-cVkQTFYe.js";import"./Globe01-fsAll_5J.js";import"./Globe04-iZWncuvw.js";import"./SwitchHorizontal01-Du4rbjq3.js";import"./HardDrive-DWD1AAge.js";import"./Image01-BuDmuyt4.js";import"./Key01-NqAAYAzO.js";import"./LinkExternal01-CnH1drDd.js";import"./LockUnlocked01-Dy39VZD5.js";import"./LogOut01-CepTDjIg.js";import"./Monitor01-DuJsYKiY.js";import"./Sun-1VzmYVaz.js";import"./Package-CYdI6izf.js";import"./Palette-gW-UafNV.js";import"./Play-D9HObFa4.js";import"./Plus-DBZfXSlG.js";import"./SearchLg-W2Sns64K.js";import"./SearchMd-ohuS85CT.js";import"./Shield01-QpK6G-Gm.js";import"./Stars01-YS6onfeZ.js";import"./Trash01-6BnXuuT1.js";import"./Upload01-B9Jn6SFL.js";import"./User01-DPbWRvQH.js";import"./Users01-BVp8PWY9.js";import"./XClose-BXQKrstX.js";import"./Zap-BqvTeTTF.js";import"./input-AdYfWDmT.js";import"./automation-runs-BRlHTbJm.js";import"./useInfiniteQuery-DWm9g10K.js";import"./use-infinite-scroll-C2jw4kdn.js";import"./use-connection-DcqZj-F6.js";import"./table-BvVnzPED.js";import"./empty-state-CnB1NOOy.js";import"./use-members-DbV9xmyX.js";import"./use-org-auth-client-B6iUTUcY.js";import"./use-automations-iQEkQijk.js";import"./useSuspenseInfiniteQuery-DT-LGN37.js";import"./avatar-C68r2IKR.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CITJlsiy.js";import"./markdown-BGpHEHgs.js";import"./monaco-editor-CNVDinF9.js";import"./spinner-qaRZoI-h.js";import"./editor-DOrxdGH1.js";import"./types-BTwf5TlH.js";import"./shell-layout-Br2i63X9.js";import"./required-auth-layout-C_aaKZ8h.js";import"./use-org-sso-QzYNJ2_E.js";import"./integration-icon-YJyRf5_z.js";import"./use-navigate-to-agent-CcVU_Ryk.js";import"./chart-CV1nYiMO.js";import"./index-De3PwXta.js";import"./AreaChart-CxkPRYZA.js";import"./form-B6rNtu5n.js";import"./label-4zu9GnvJ.js";import"./file-type-icon-D3H2SAiO.js";import"./drawer-BF4YBqbu.js";import"./collection-search-CCxZPf1G.js";import"./agent-capabilities-B52k7xCe.js";import"./use-mcp-tools-DzgtLEIJ.js";import"./tabs-BQt0J04y.js";import"./toggle-group-UoWQ_AtK.js";import"./super-agent-icon-0ovU2hoU.js";import"./self-tool-result-CFOjIdNd.js";import"./alert-dialog-BX_76dkp.js";import"./extract-connection-data-CCWg7dLs.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-BxU7i6-p.js";import"./authenticate-and-persist-oauth-DmV864sJ.js";import"./mcp-oauth-Bo0lMjNG.js";import"./track-Cub3Lb2y.js";import"./popover-d5pnR-7w.js";import"./toolbar-D-0oFxmT.js";import"./github-repo-picker-Cj0tedJk.js";import"./connection-card-8FPfJwxj.js";import"./use-registry-connections-DoFwJATj.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CV-ocC88.js";import"./connection-form-helpers-leEWaGzs.js";import"./collection-tabs-CI3Rpip3.js";import"./badge-PMvZlcsL.js";import"./select-model-tWr3AELq.js";import"./checkbox-Bq0DvC7H.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-CEkJkTKM.js";import"./dropdown-menu-CcSRV6X6.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DFquzdaG.js";import"./skill-preview-CdOTeq68.js";import"./use-file-configs-B9XSPn7m.js";import"./site-slug-uya6Wp4-.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-Btd2LOd8.js";import"./search-input-B8CD4GuP.js";import"./use-mcp-auth-status-B6vKC19j.js";import"./switch-CQSBTLyw.js";import"./use-secrets-ZK76w5qn.js";import"./config-CqVzIvRg.js";import"./command-Bi7-0rva.js";import"./index-CcFQdqTB.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-CNiJbftU.js";import"./use-tags-BBJMCH1R.js";import"./automation-list-row-C3SkObA3.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-EJuBIpSm.js";import"./cards-DBV_vuEJ.js";function Vt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",s=Ct(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function Gr(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:s,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=At()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=Kt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Pt(p,x,a):p);let C;t[9]!==s||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Ft(C);let K;t[13]!==s||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=$t(K);let P;t[17]!==S?(P=zt((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),$=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Mt),xt([]));let O;t[20]!==x?(O=x??{},t[20]=x,t[21]=O):O=t[21];const rt=O;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let U;t[24]!==rt||t[25]!==y?(U={...rt,...y},t[24]=rt,t[25]=y,t[26]=U):U=t[26];const it=U;let I;t[27]!==p||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await k(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const pt=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=Ot(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ut(g,r)),ft(qt)},title:f,className:_t("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let j;t[42]!==W?(j=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let _;t[47]!==p||t[48]!==s||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==st||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(It,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:st,sandbox:{orgSlug:m,virtualMcpId:i,branch:s,threadId:G}},`${p}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=s,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=st,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=t[67];let w;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(w=h&&o.jsx(Tt,{open:ot,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=w):w=t[74];let M;return t[75]!==B||t[76]!==_||t[77]!==w?(M=o.jsxs("div",{className:gt,children:[B,_,w]}),t[75]=B,t[76]=_,t[77]=w,t[78]=M):M=t[78],M}function qt(n){return n+1}function Mt(n){return n+1}export{Gr as AppEditor};
@@ -1 +1 @@
1
- import{dK as v,dL as $,dM as W,dN as L,dO as H,dP as V,dQ as D,dR as x,dS as q,dT as j,dU as y,dV as N,dW as B,dX as Z,dY as F}from"./index-DzWX3Cp7.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof V)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof D)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(b),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await F(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
1
+ import{dK as v,dL as $,dM as W,dN as L,dO as H,dP as V,dQ as D,dR as x,dS as q,dT as j,dU as y,dV as N,dW as B,dX as Z,dY as F}from"./index-B1nt3Xdg.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof V)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof D)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(b),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await F(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
@@ -1 +1 @@
1
- import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-DzWX3Cp7.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
1
+ import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-B1nt3Xdg.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};