@hot-updater/console 1.1.4 → 1.2.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/-native-builds-search-C-TGpFAm.js +1 -0
  3. package/.output/public/assets/{ConsoleFeatureUnavailable-C0KfsKWL.js → ConsoleFeatureUnavailable-CUtcXuY2.js} +1 -1
  4. package/.output/public/assets/EventDetails-Dl2RvPAk.js +1 -0
  5. package/.output/public/assets/HashValueDisplay-6lNRxDJX.js +1 -0
  6. package/.output/public/assets/InsightsPageHeader-DHhqY3DT.js +1 -0
  7. package/.output/public/assets/NotFoundPage-DZ3DxyRA.js +1 -0
  8. package/.output/public/assets/PlatformIcon-BBWQlWm9.js +1 -0
  9. package/.output/public/assets/RolloutPercentageBadge-Cxogpi8F.js +1 -0
  10. package/.output/public/assets/StoreSubmission-JpngSvHS.js +1 -0
  11. package/.output/public/assets/alert-dialog-BqYScr9y.js +1 -0
  12. package/.output/public/assets/api-P2g8dCNg.js +1 -0
  13. package/.output/public/assets/api-keys-DWQC2q6y.js +1 -0
  14. package/.output/public/assets/api-keys-FueRkF9q.js +1 -0
  15. package/.output/public/assets/arrow-left-g9cKqXuC.js +1 -0
  16. package/.output/public/assets/arrow-right-CNII8TYn.js +1 -0
  17. package/.output/public/assets/arrow-up-right-DK8Zdg40.js +1 -0
  18. package/.output/public/assets/badge-DWFcDWho.js +1 -0
  19. package/.output/public/assets/check-CXVR3s3X.js +1 -0
  20. package/.output/public/assets/chevron-right-BoUXo82O.js +1 -0
  21. package/.output/public/assets/circle-off-C7Muo0ss.js +1 -0
  22. package/.output/public/assets/{clipboard-DTkrlIMn.js → clipboard-DQbOcrL7.js} +1 -1
  23. package/.output/public/assets/console-features-api-DEXSwFtc.js +1 -0
  24. package/.output/public/assets/copy-DsuLj3oj.js +1 -0
  25. package/.output/public/assets/dialog-CNUPxNxH.js +1 -0
  26. package/.output/public/assets/{dist-dDj-R6uh.js → dist-CPlO6ko9.js} +1 -1
  27. package/.output/public/assets/download-Cf24LBde.js +1 -0
  28. package/.output/public/assets/{empty-Bf4DanOL.js → empty-B3Uwdd6k.js} +1 -1
  29. package/.output/public/assets/{field-GxF9SyUo.js → field-D-2-mnNh.js} +1 -1
  30. package/.output/public/assets/history-DqHlgSuV.js +1 -0
  31. package/.output/public/assets/index-BWU6owTG.js +10 -0
  32. package/.output/public/assets/{input-group-B4nrqIh0.js → input-group-D3OUBk4n.js} +1 -1
  33. package/.output/public/assets/insights-B-0odqpt.js +42 -0
  34. package/.output/public/assets/insights-BSVGfxSL.js +1 -0
  35. package/.output/public/assets/insights-NK5B6ReS.js +2 -0
  36. package/.output/public/assets/insights-api-BVCXJsoV.js +1 -0
  37. package/.output/public/assets/insights-search-DghCbEnk.js +1 -0
  38. package/.output/public/assets/insights-usage-rpc-CKQH0pUS.js +1 -0
  39. package/.output/public/assets/insights_.distribution-CJvgwcVZ.js +2 -0
  40. package/.output/public/assets/insights_.distribution-DblZM0mO.js +1 -0
  41. package/.output/public/assets/insights_.distribution-dvk6vYDM.js +1 -0
  42. package/.output/public/assets/installations-B674P5Z5.js +2 -0
  43. package/.output/public/assets/installations-BWxczZ2t.js +1 -0
  44. package/.output/public/assets/installations-Dv4kWQYz.js +1 -0
  45. package/.output/public/assets/{key-round-B4fI1psK.js → key-round-DwNKkHhy.js} +1 -1
  46. package/.output/public/assets/link-DTEyW70e.js +2 -0
  47. package/.output/public/assets/{list-Dtj7TtzV.js → list--NIee1FZ.js} +1 -1
  48. package/.output/public/assets/native-builds-BOC71grI.js +1 -0
  49. package/.output/public/assets/native-builds-BswZazmc.js +1 -0
  50. package/.output/public/assets/native-builds-c4BpOLAe.js +2 -0
  51. package/.output/public/assets/native-builds_._buildId-D_Spjl10.js +1 -0
  52. package/.output/public/assets/native-builds_._buildId-DtoXD8rz.js +2 -0
  53. package/.output/public/assets/plus-BReVKct-.js +1 -0
  54. package/.output/public/assets/preload-helper-B44EvKhG.js +1 -0
  55. package/.output/public/assets/{refresh-cw-DjIKjmrS.js → refresh-cw-B9HHjLej.js} +1 -1
  56. package/.output/public/assets/relativeTime-YQt84dYr.js +1 -0
  57. package/.output/public/assets/remote-config-B7ujqhLa.js +6 -0
  58. package/.output/public/assets/remote-config-WjpozBG5.js +1 -0
  59. package/.output/public/assets/remote-config-gXeH6PBW.js +1 -0
  60. package/.output/public/assets/rotate-cw-Cv2aVbYr.js +1 -0
  61. package/.output/public/assets/routes-BDdBIxYS.js +1 -0
  62. package/.output/public/assets/routes-CCD33Azv.js +2 -0
  63. package/.output/public/assets/search-BCel4Oy6.js +1 -0
  64. package/.output/public/assets/select-CBIU0_M1.js +1 -0
  65. package/.output/public/assets/{sidebar-BqX460IW.js → sidebar-Di9SN47G.js} +1 -1
  66. package/.output/public/assets/smartphone-CMaSy_ir.js +1 -0
  67. package/.output/public/assets/styles-Ccxthuz1.css +2 -0
  68. package/.output/public/assets/switch-BpdiHL_t.js +1 -0
  69. package/.output/public/assets/{table-ek1DmRHq.js → table-Bpy3SvSo.js} +1 -1
  70. package/.output/public/assets/{tabs-CgEH_fMT.js → tabs-Xmt7tZeG.js} +1 -1
  71. package/.output/public/assets/{undo-2-DxXx9Zvr.js → undo-2-CUX96_BG.js} +1 -1
  72. package/.output/public/assets/useCompositeListItem-JmyDfo3-.js +1 -0
  73. package/.output/public/assets/useInfiniteQuery-DX4WpBRG.js +1 -0
  74. package/.output/public/assets/useMutation-DbYw7boA.js +1 -0
  75. package/.output/public/assets/uuidv7-zXMtwR9Q.js +1 -0
  76. package/.output/public/assets/{valueToPercent-B44vDssN.js → valueToPercent-BLwGy_xK.js} +1 -1
  77. package/.output/server/{__23tanstack-start-server-fn-resolver-KpQ5Z_24.mjs → __23tanstack-start-server-fn-resolver-CygMPYHZ.mjs} +64 -40
  78. package/.output/server/_chunks/ssr-renderer.mjs +2 -2
  79. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  80. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
  81. package/.output/server/_libs/lucide-react.mjs +88 -1
  82. package/.output/server/_libs/uqr.mjs +858 -0
  83. package/.output/server/_ssr/-native-builds-search-CwNcoXf4.mjs +37 -0
  84. package/.output/server/_ssr/{BundleIdDisplay-CjSnY65J.mjs → BundleIdDisplay-DOPz4pUS.mjs} +2 -2
  85. package/.output/server/_ssr/{ConsoleFeatureUnavailable-CHxn9f-w.mjs → ConsoleFeatureUnavailable-Xb1JKqcc.mjs} +7 -7
  86. package/.output/server/_ssr/{EventDetails-l6dF54zp.mjs → EventDetails-D7MejFCN.mjs} +8 -8
  87. package/.output/server/_ssr/{HashValueDisplay-Zs7ABoOi.mjs → HashValueDisplay-Dd-wu5rY.mjs} +2 -2
  88. package/.output/server/_ssr/{InsightsPageHeader-ZlAlDxQy.mjs → InsightsPageHeader-CWf1n4Vt.mjs} +13 -11
  89. package/.output/server/_ssr/{NotFoundPage-u28ndvp1.mjs → NotFoundPage-C5rFdUpg.mjs} +2 -2
  90. package/.output/server/_ssr/PlatformIcon-CFLiTjh1.mjs +29 -0
  91. package/.output/server/_ssr/RolloutPercentageBadge-g0Bhfl3M.mjs +21 -0
  92. package/.output/server/_ssr/StoreSubmission-JZ2Zltak.mjs +139 -0
  93. package/.output/server/_ssr/{alert-dialog-B8AqlJwo.mjs → alert-dialog-CvNvTvIJ.mjs} +1 -1
  94. package/.output/server/_ssr/{api-C_0B7NXM.mjs → api-0vtwA5vY.mjs} +126 -7
  95. package/.output/server/_ssr/{api-keys-pRNvn2-9.mjs → api-keys-D5dyA4D1.mjs} +10 -10
  96. package/.output/server/_ssr/{api-keys-rpc-wecWs0nA.mjs → api-keys-rpc-BOIUHhDi.mjs} +5 -5
  97. package/.output/server/_ssr/{api-keys-CLH38u9B.mjs → api-keys-yFlQDwQF.mjs} +2 -2
  98. package/.output/server/_ssr/{api-rpc-DWN8eOHS.mjs → api-rpc-COeFOpYi.mjs} +79 -12
  99. package/.output/server/_ssr/{auth-UP0wXs4i.mjs → auth-Z-wLddzh.mjs} +1 -1
  100. package/.output/server/_ssr/{auth-rpc-CLRArbIl.mjs → auth-rpc-D1ss2GUI.mjs} +6 -6
  101. package/.output/server/_ssr/{auth.server-DR9zc0EU.mjs → auth.server-DYS1OJ6P.mjs} +771 -641
  102. package/.output/server/_ssr/{badge-BpT7r-ng.mjs → badge-CEdVRgyl.mjs} +1 -1
  103. package/.output/server/_ssr/{bundleActivity-0qFIcvqt.mjs → bundleActivity-MLrjNJCT.mjs} +1 -1
  104. package/.output/server/_ssr/{config-WVX4IxSR.mjs → config-CjIBFhJX.mjs} +1 -1
  105. package/.output/server/_ssr/config.server-NnMFjMFX.mjs +43 -0
  106. package/.output/server/_ssr/{console-access-aUpQs49I.mjs → console-access-33BNlH97.mjs} +3 -3
  107. package/.output/server/_ssr/{console-features-4xAGfZHw.mjs → console-features-BTV-XuhQ.mjs} +1 -1
  108. package/.output/server/_ssr/{console-features-api-DSSgCV3v.mjs → console-features-api-v1fSycue.mjs} +6 -6
  109. package/.output/server/_ssr/{console-features-rpc-D6kMlR2A.mjs → console-features-rpc-C7XNVqm0.mjs} +5 -5
  110. package/.output/server/_ssr/createCsrfMiddleware-BwHbC8n-.mjs +159 -0
  111. package/.output/server/_ssr/createMiddleware-C3ACsfuG.mjs +24 -0
  112. package/.output/server/_ssr/{createMiddleware-B1iPez7u.mjs → createServerFn-AQvBMBjJ.mjs} +2 -23
  113. package/.output/server/_ssr/{createServerRpc-BaDJLGBx.mjs → createServerRpc-BVvRVOz5.mjs} +2 -2
  114. package/.output/server/_ssr/{databaseConfig-C5SkAyUy.mjs → databaseConfig-B_Bg7qS5.mjs} +1 -1
  115. package/.output/server/_ssr/{databaseJsonValue-Csbuzc9Q.mjs → databaseJsonValue-kS7cvEtz.mjs} +1 -1
  116. package/.output/server/_ssr/{databaseRows-CPphvbag.mjs → databaseRows-B6H8Cmgq.mjs} +3 -3
  117. package/.output/server/_ssr/{dialog-B4ALf7NJ.mjs → dialog-C8CS8RMt.mjs} +1 -1
  118. package/.output/server/_ssr/{dist-CbQbBIw-.mjs → dist-TEpM_UAD.mjs} +125 -125
  119. package/.output/server/_ssr/{downloadBundle-94jPBGSO.mjs → downloadBundle-DCmr7vsj.mjs} +1 -1
  120. package/.output/server/_ssr/{empty-Bh1FEeYF.mjs → empty-CkdEAvCY.mjs} +2 -2
  121. package/.output/server/_ssr/{empty-plugin-adapters-CpCHi1TV.mjs → empty-plugin-adapters-zrZ0xs6n.mjs} +1 -1
  122. package/.output/server/_ssr/{failureReports-Bh22wois.mjs → failureReports-Cn_zU9S8.mjs} +3 -3
  123. package/.output/server/_ssr/{field-HKCaPH3e.mjs → field-CW08sZXd.mjs} +2 -2
  124. package/.output/server/_ssr/{getBundleChildren-DfxB2K8D.mjs → getBundleChildren-rtkEEJw5.mjs} +2 -2
  125. package/.output/server/_ssr/git-CTA8Aqr0.mjs +56 -0
  126. package/.output/server/_ssr/{input-group-xm3LzDuq.mjs → input-group-D-TpFPuG.mjs} +1 -1
  127. package/.output/server/_ssr/{insights-BKZpJ_K4.mjs → insights-CMyzPs8l.mjs} +28 -27
  128. package/.output/server/_ssr/{insights-CCyTACIw.mjs → insights-CYeBl8N9.mjs} +5 -5
  129. package/.output/server/_ssr/{insights-CNqWQLJR.mjs → insights-DAi9KknT.mjs} +2 -2
  130. package/.output/server/_ssr/{insights-api-DtRFz5X3.mjs → insights-api-BFARQ5ct.mjs} +6 -6
  131. package/.output/server/_ssr/{insights-errors-Iy-lBaM7.mjs → insights-errors-7BCwFybo.mjs} +2 -2
  132. package/.output/server/_ssr/{insights-failures-BJN3RfLu.mjs → insights-failures-B9VPkzZE.mjs} +2 -2
  133. package/.output/server/_ssr/{insights-failures-rpc-DLZ91uOG.mjs → insights-failures-rpc-Q4WNNJkU.mjs} +12 -12
  134. package/.output/server/_ssr/{insights-recovery-BUuQdlA3.mjs → insights-recovery-BtXVU3ro.mjs} +1 -1
  135. package/.output/server/_ssr/{insights-recovery-rpc-BQHUhPi7.mjs → insights-recovery-rpc-CY5RYJKa.mjs} +8 -8
  136. package/.output/server/_ssr/{insights-rpc-C6Vukyn7.mjs → insights-rpc-BO7_evvs.mjs} +5 -5
  137. package/.output/server/_ssr/{insights-search-CBYoxT7v.mjs → insights-search-DKfxgHD3.mjs} +5 -5
  138. package/.output/server/_ssr/{insights-usage-CHqvtehH.mjs → insights-usage-DiGnuxW8.mjs} +1 -1
  139. package/.output/server/_ssr/{insights-usage-rpc-BJ7a-xco.mjs → insights-usage-rpc-B4czku50.mjs} +8 -8
  140. package/.output/server/_ssr/{insights-usage-rpc-C-lNUIsD.mjs → insights-usage-rpc-CUCTFska.mjs} +5 -5
  141. package/.output/server/_ssr/{insightsUsage-COUG-_-U.mjs → insightsUsage-ClAmoUz8.mjs} +3 -3
  142. package/.output/server/_ssr/{insights_.distribution-DmLW8I8a.mjs → insights_.distribution-BDeUhZGj.mjs} +2 -2
  143. package/.output/server/_ssr/{insights_.distribution-CTwilMPm.mjs → insights_.distribution-BRrbZN1X.mjs} +5 -5
  144. package/.output/server/_ssr/{insights_.distribution-DztDyrBj.mjs → insights_.distribution-C2MXpzKd.mjs} +15 -14
  145. package/.output/server/_ssr/{installations-Bct7ag5y.mjs → installations-BVk7okiY.mjs} +4 -4
  146. package/.output/server/_ssr/{installations-B6MK5iA8.mjs → installations-BjLMgBoH.mjs} +2 -2
  147. package/.output/server/_ssr/{installations-_N4PtYFl.mjs → installations-DxGZEC5G.mjs} +12 -12
  148. package/.output/server/_ssr/{listReleases-BfUBlCHo.mjs → listReleases-D_GY00SQ.mjs} +1 -1
  149. package/.output/server/_ssr/native-builds-CSCgFB21.mjs +10 -0
  150. package/.output/server/_ssr/native-builds-CdlyAldW.mjs +569 -0
  151. package/.output/server/_ssr/native-builds-DhXL5zf_.mjs +137 -0
  152. package/.output/server/_ssr/native-builds_._buildId-CMp1h8dT.mjs +10 -0
  153. package/.output/server/_ssr/native-builds_._buildId-GHpGaYyE.mjs +813 -0
  154. package/.output/server/_ssr/nativeBuildQr-84cnFQPX.mjs +59 -0
  155. package/.output/server/_ssr/nativeBuilds-B_7BPjt_.mjs +133 -0
  156. package/.output/server/_ssr/{plugins-BaD1slHx.mjs → plugins-RIryUNWj.mjs} +6 -5
  157. package/.output/server/_ssr/qr-code-C7kNRIDX.mjs +22 -0
  158. package/.output/server/_ssr/{release-adoption-DuYJTGuX.mjs → release-adoption-DoAtNPED.mjs} +2 -2
  159. package/.output/server/_ssr/{release-adoption-rpc-CHl7G_Zy.mjs → release-adoption-rpc-BJXZvtoQ.mjs} +10 -10
  160. package/.output/server/_ssr/{releaseAdoption-B39cpvfo.mjs → releaseAdoption-a2byXMfz.mjs} +4 -4
  161. package/.output/server/_ssr/releaseCatalogCompiler-DLcean2k.mjs +364 -0
  162. package/.output/server/_ssr/{releaseManagement-DFMUnDF5.mjs → releaseManagement-DHUux2az.mjs} +1 -1
  163. package/.output/server/_ssr/{releaseReachability-bFsuElSS.mjs → releaseReachability-DZOK_dH-.mjs} +2 -2
  164. package/.output/server/_ssr/{remote-config-Mj05qVYZ.mjs → remote-config-DjsEl270.mjs} +20 -19
  165. package/.output/server/_ssr/{remote-config-10-obSZ0.mjs → remote-config-DlyyohL2.mjs} +2 -2
  166. package/.output/server/_ssr/{remote-config-Dj1eTYi4.mjs → remote-config-XdYuByHz.mjs} +2 -2
  167. package/.output/server/_ssr/{remote-config-rpc-lteqDSLn.mjs → remote-config-rpc-GMLPb-90.mjs} +6 -6
  168. package/.output/server/_ssr/request-guard-CPdRBuGW.mjs +108 -0
  169. package/.output/server/_ssr/{router-Dr4jjjhx.mjs → router-vpxd56RW.mjs} +317 -71
  170. package/.output/server/_ssr/{routes-BZbrY_qw.mjs → routes-DyEM4b3x.mjs} +14 -14
  171. package/.output/server/_ssr/{routes-B5KrCDwk.mjs → routes-dQe3XhiS.mjs} +99 -81
  172. package/.output/server/_ssr/{runtime.server-DsHqVqTr.mjs → runtime.server-BdMY1blX.mjs} +4 -4
  173. package/.output/server/_ssr/schema-ChlRtZIo.mjs +23 -0
  174. package/.output/server/_ssr/schema-migration-rpc-BfGzEK_o.mjs +65 -0
  175. package/.output/server/_ssr/{select-BtdGNSmp.mjs → select-DM1uwtk9.mjs} +3 -27
  176. package/.output/server/_ssr/{server-BxaHSwHh.mjs → server-BUUKNSPI.mjs} +7 -161
  177. package/.output/server/_ssr/{sidebar-CVsgosaD.mjs → sidebar-DB2YQlok.mjs} +4 -4
  178. package/.output/server/_ssr/ssr.mjs +1 -1
  179. package/.output/server/_ssr/start-BvDsQehg.mjs +49 -0
  180. package/.output/server/_ssr/{switch-BmARgkUP.mjs → switch-DLD58zLy.mjs} +2 -2
  181. package/.output/server/_ssr/{table-M5P3YUfY.mjs → table-P4TnAZhl.mjs} +1 -1
  182. package/.output/server/_ssr/{tabs-CrmfOlJj.mjs → tabs-B7ZeLicF.mjs} +2 -2
  183. package/.output/server/_ssr/{updateFailures-z1IQy_4q.mjs → updateFailures-n-tGv90S.mjs} +3 -3
  184. package/.output/server/_ssr/{uuidv7-C88s9jWF.mjs → uuidv7-BIF4nb_q.mjs} +2 -2
  185. package/.output/server/_ssr/{schema-BiAVyEj2.mjs → version-CQ98ZBpL-CWSkTT9J.mjs} +2 -22
  186. package/.output/server/_tanstack-start-manifest_v-C-KC63Zq.mjs +184 -0
  187. package/.output/server/index.mjs +432 -271
  188. package/lib/vite-internal.mjs +32 -1
  189. package/package.json +8 -7
  190. package/src/components/AppSidebar.tsx +12 -1
  191. package/src/components/ConsoleAccessPage.tsx +49 -3
  192. package/src/components/QrCode.tsx +35 -0
  193. package/src/components/SchemaMigrationRequired.tsx +139 -0
  194. package/src/components/features/insights/BuiltinBundle.tsx +5 -3
  195. package/src/components/features/native-builds/BuiltInBundleCard.tsx +163 -0
  196. package/src/components/features/native-builds/CommitLink.tsx +30 -0
  197. package/src/components/features/native-builds/CopyableText.tsx +48 -0
  198. package/src/components/features/native-builds/ImportBuild.tsx +91 -0
  199. package/src/components/features/native-builds/InstallCard.tsx +205 -0
  200. package/src/components/features/native-builds/NativeBuildDetailPage.tsx +175 -0
  201. package/src/components/features/native-builds/NativeBuildsPage.tsx +151 -0
  202. package/src/components/features/native-builds/NativeBuildsTable.tsx +426 -0
  203. package/src/components/features/native-builds/PatchesCard.tsx +222 -0
  204. package/src/components/features/native-builds/ReleaseNativeBuildLink.tsx +101 -0
  205. package/src/components/features/native-builds/ServedNowCard.tsx +214 -0
  206. package/src/components/features/native-builds/ShortHash.tsx +41 -0
  207. package/src/components/features/native-builds/StoreSubmission.tsx +73 -0
  208. package/src/components/features/releases/ReleaseEditorSheet.tsx +8 -0
  209. package/src/lib/api-rpc.ts +98 -0
  210. package/src/lib/api.ts +120 -0
  211. package/src/lib/native-builds.ts +162 -0
  212. package/src/lib/qr-code.ts +16 -0
  213. package/src/lib/schema-migration-api.ts +54 -0
  214. package/src/lib/schema-migration-rpc.ts +26 -0
  215. package/src/lib/schema-migration.ts +101 -0
  216. package/src/lib/server/config.server.ts +23 -14
  217. package/src/lib/server/console-runtime.server.ts +4 -6
  218. package/src/lib/server/local-console.ts +164 -0
  219. package/src/lib/server/nativeBuildQr.ts +73 -0
  220. package/src/lib/server/nativeBuilds.ts +288 -0
  221. package/src/lib/shell.ts +9 -0
  222. package/src/routeTree.gen.ts +88 -1
  223. package/src/router.tsx +11 -1
  224. package/src/routes/-native-builds-search.ts +51 -0
  225. package/src/routes/[_]hot-updater/native-builds/qr.ts +14 -0
  226. package/src/routes/__root.tsx +11 -1
  227. package/src/routes/api/native-builds/$buildId/download.ts +50 -0
  228. package/src/routes/native-builds.tsx +21 -0
  229. package/src/routes/native-builds_.$buildId.tsx +23 -0
  230. package/src/start.ts +33 -0
  231. package/src/virtual-modules.d.ts +18 -0
  232. package/src/vite-internal.ts +57 -1
  233. package/.output/public/assets/EventDetails-gbD_fCqc.js +0 -1
  234. package/.output/public/assets/HashValueDisplay-BGkDPaYi.js +0 -1
  235. package/.output/public/assets/InsightsPageHeader-BRw8XkJW.js +0 -1
  236. package/.output/public/assets/NotFoundPage-Cei6W2lm.js +0 -1
  237. package/.output/public/assets/alert-dialog-BtVg50WQ.js +0 -1
  238. package/.output/public/assets/api-DoicFJfd.js +0 -1
  239. package/.output/public/assets/api-keys-D81VHHNM.js +0 -1
  240. package/.output/public/assets/api-keys-Dia6i8K1.js +0 -1
  241. package/.output/public/assets/arrow-left-DsivSewE.js +0 -1
  242. package/.output/public/assets/arrow-up-right-B5aM0F7f.js +0 -1
  243. package/.output/public/assets/badge-Bqf3UDee.js +0 -1
  244. package/.output/public/assets/circle-off-BsbZQtsF.js +0 -1
  245. package/.output/public/assets/console-features-api-DPE4C06Y.js +0 -2
  246. package/.output/public/assets/dialog-CGKPxz3n.js +0 -1
  247. package/.output/public/assets/index-DrkdiRIn.js +0 -10
  248. package/.output/public/assets/insights-C-5t8wh2.js +0 -2
  249. package/.output/public/assets/insights-D_ngQdiz.js +0 -1
  250. package/.output/public/assets/insights-KigRBDgC.js +0 -42
  251. package/.output/public/assets/insights-api-1ZjVu3Sb.js +0 -1
  252. package/.output/public/assets/insights-search-aT8BVCci.js +0 -1
  253. package/.output/public/assets/insights-usage-rpc-DqTiXI1_.js +0 -1
  254. package/.output/public/assets/insights_.distribution-Bzl6RFBR.js +0 -2
  255. package/.output/public/assets/insights_.distribution-Cthgttqb.js +0 -1
  256. package/.output/public/assets/insights_.distribution-D2c2v1bu.js +0 -1
  257. package/.output/public/assets/installations-2Nx8Htf-.js +0 -1
  258. package/.output/public/assets/installations-BskJ1xQr.js +0 -2
  259. package/.output/public/assets/installations-K2iJ_r0h.js +0 -1
  260. package/.output/public/assets/remote-config-D9X3NiwV.js +0 -6
  261. package/.output/public/assets/remote-config-DzOOiBIO.js +0 -1
  262. package/.output/public/assets/remote-config-ikg7kak0.js +0 -1
  263. package/.output/public/assets/routes-9rb9P5Y7.js +0 -2
  264. package/.output/public/assets/routes-P7683vKQ.js +0 -1
  265. package/.output/public/assets/search-DuI1FBpg.js +0 -1
  266. package/.output/public/assets/select-M3H2gxCc.js +0 -1
  267. package/.output/public/assets/smartphone-CtsHuiIC.js +0 -1
  268. package/.output/public/assets/styles-CpiW_YdW.css +0 -2
  269. package/.output/public/assets/switch-By_vfm8I.js +0 -1
  270. package/.output/public/assets/useCompositeListItem-B-UkrDlu.js +0 -1
  271. package/.output/server/_ssr/config.server-DTdsG47T.mjs +0 -35
  272. package/.output/server/_ssr/start-B6ECIE_7.mjs +0 -4
  273. package/.output/server/_tanstack-start-manifest_v-_BY9hYTm.mjs +0 -136
@@ -1 +0,0 @@
1
- import{Wr as e,ar as t,cr as n,nr as r,rr as i}from"./sidebar-BqX460IW.js";import{m as a}from"./useCompositeListItem-B-UkrDlu.js";var o=t(`chart-no-axes-combined`,[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14v7`,key:`1g90b9`}],[`path`,{d:`M20 10v11`,key:`1iqoj0`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18v3`,key:`1yp0dc`}],[`path`,{d:`M8 14v7`,key:`n3cwzv`}]]),s=t(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),c={"24h":{durationMs:864e5,intervalMs:36e5},"7d":{durationMs:7*864e5,intervalMs:6*36e5},"30d":{durationMs:30*864e5,intervalMs:864e5}},l=e=>Math.ceil(e/36e5)*36e5;function u(e){if(!e||e.platform!==`all`&&e.platform!==`ios`&&e.platform!==`android`||typeof e.channel!=`string`||!e.channel.trim()||e.channel.length>1024||e.releaseId!==void 0&&(typeof e.releaseId!=`string`||!e.releaseId.trim()||e.releaseId.length>36)||(e.window===void 0?e.releaseId===void 0:!Object.hasOwn(c,e.window)))throw Error(`Choose a platform, channel, and time window.`);return e}var d=({failedUpdates:e,downloads:t})=>e+t===0?null:e/(e+t),f=({failedInstallations:e,activeInstallations:t})=>t===0?null:Math.min(1,e/t),p=e=>e===null?`—`:`${(e*100).toFixed(2)}%`,m={check:`Update check`,download:`Download`,install:`Install`},h={network:`Network`,http:`HTTP error`,invalid_response:`Invalid response`,hash_mismatch:`Hash mismatch`,signature:`Signature`,patch:`Patch`,extract:`Extract`,storage:`Storage`,unknown:`No reason reported`},g=e=>m[e]??`Unknown stage`,_=e=>h[e]??`Unknown reason`,v=e=>[...e.httpStatus==null?[]:[`HTTP ${e.httpStatus}`],...e.originCode==null?[]:[e.originCode],...e.transport==null?[]:[e.transport],...e.resource==null?[]:[e.resource]],y=e=>{let t=e.errorMessage||(e.reason===`unknown`?`The client did not report a detailed cause`:_(e.reason));return[`${g(e.stage)} failed: ${t}`,...v(e)].join(` · `)},b=i({method:`GET`}).middleware([r]).handler(e(`0d1dacdd1e5ee6b100e5c142fb9af03602b6f2c6fe6af79312b36c223d7f8f97`)),x=i({method:`GET`}).middleware([r]).handler(e(`b4388826a9b515fb4d2113270aa8ded1c50ba13d7f07ac2b268c41396e87d0a3`)),S={rawDays:90,dailyDays:400},C=e=>`${e.toLocaleString(`en`)} ${e===1?`day`:`days`}`,w=({dailyDays:e})=>e>=364;i({method:`GET`}).middleware([r]).handler(e(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`));var T=i({method:`GET`}).middleware([r]).handler(e(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),E=i({method:`GET`}).middleware([r]).handler(e(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),D=i({method:`GET`}).middleware([r]).handler(e(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),O=i({method:`GET`}).middleware([r]).handler(e(`c6f18db42ac40385dbff247095197ee9f3fd3a97dc914efd368ce0ded1f098c6`)),k=i({method:`GET`}).middleware([r]).handler(e(`735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1`)),A=3e4,j={reportingInstallations:e=>[`insights`,`reporting-installations`,e],events:e=>[`insights`,`events`,e],installations:e=>[`insights`,`installations`,e],installation:e=>[`insights`,`installation`,e],installationEvents:e=>[`insights`,`installation-events`,e]},M=(e,t)=>n({queryKey:j.events(e),queryFn:()=>T({data:e}),enabled:t,refetchOnWindowFocus:!0,staleTime:A}),N=(e,t)=>n({queryKey:j.installations(e),queryFn:()=>k({data:e}),enabled:t&&e.identity.length>0,staleTime:A}),P=(e,t)=>n({queryKey:j.installation(e),queryFn:()=>D({data:{installId:e}}),enabled:t&&e.length>0,staleTime:A}),F=(e,t)=>n({queryKey:j.installationEvents(e),queryFn:()=>E({data:e}),enabled:t&&e.installId.length>0,refetchOnWindowFocus:!0,staleTime:A}),I=(e,t=!0)=>n({queryKey:[`insights`,`update-failures`,e],queryFn:()=>b({data:u(e)}),enabled:t,refetchOnWindowFocus:!0,staleTime:A}),L=()=>n({queryKey:[`insights`,`retention`],queryFn:()=>O(),staleTime:1/0}).data??S,R=(e,t)=>a({queryKey:[`insights`,`failure-reports`,e],queryFn:({pageParam:t})=>x({data:{...e,cursor:t}}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,enabled:t,staleTime:A});export{p as _,N as a,s as b,S as c,f as d,y as f,g,_ as h,P as i,C as l,d as m,M as n,L as o,v as p,F as r,I as s,R as t,w as u,l as v,o as x,c as y};
@@ -1 +0,0 @@
1
- import{Fn as e,Ur as t,ei as n,it as r,nt as i,ri as a,tt as ee}from"./sidebar-BqX460IW.js";import{b as o}from"./insights-api-1ZjVu3Sb.js";var s=a(n(),1),c=t();function l({label:t,children:n}){let a=(0,s.useId)(),[l,u]=(0,s.useState)(!1);return(0,c.jsxs)(ee,{open:l,onOpenChange:u,triggerId:a,children:[(0,c.jsx)(r,{id:a,"aria-describedby":l?`${a}-description`:void 0,closeOnClick:!1,onClick:()=>u(e=>!e),render:(0,c.jsx)(e,{"aria-label":t,className:`size-11 sm:size-7`,size:`icon`,variant:`ghost`}),children:(0,c.jsx)(o,{})}),(0,c.jsx)(i,{id:`${a}-description`,role:`tooltip`,className:`max-w-64`,side:`bottom`,children:n})]})}var u=`[a-zA-Z0-9-]`,d=String.raw`0|[1-9]\d*`,f=String.raw`\d+`,p=String.raw`\d*[a-zA-Z-]${u}*`,m=String.raw`(${d})\.(${d})\.(${d})`,h=String.raw`(${f})\.(${f})\.(${f})`,g=`(?:${p}|${d})`,_=`(?:${p}|${f})`,v=String.raw`(?:-(${g}(?:\.${g})*))`,y=String.raw`(?:-?(${_}(?:\.${_})*))`,b=`${u}+`,x=String.raw`(?:\+(${b}(?:\.${b})*))`,S=`v?${m}${v}?${x}?`,C=String.raw`[v=\s]*${h}${y}?${x}?`,w=String.raw`${d}|x|X|\*`,T=String.raw`${f}|x|X|\*`;String.raw`[v=\s]*(${w})(?:\.(${w})(?:\.(${w})(?:${v})?${x}?)?)?`,String.raw`[v=\s]*(${T})(?:\.(${T})(?:\.(${T})(?:${y})?${x}?)?)?`,String.raw`(?:\^)`;var E=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`,D=String.raw`${E}(?:$|[^\d])`,te=String.raw`${E}(?:${v})?(?:${x})?(?:$|[^\d])`;function ne(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[u,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function O(e,t){return new RegExp(ne(e),t)}O(`^${S}$`),O(`^${C}$`),O(D),O(te),O(`^${v}$`),O(`^${y}$`);var re=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.baseBundleId==`string`&&typeof t.baseFileHash==`string`&&typeof t.patchFileHash==`string`&&typeof t.patchStorageUri==`string`},ie=e=>Array.isArray(e)?e.filter(re):[],ae=e=>{let t=ie(e.patches),n=new Set;return t.filter(e=>n.has(e.baseBundleId)?!1:(n.add(e.baseBundleId),!0))},k=e=>ae(e)[0]??null,A=e=>k(e)?.baseBundleId??null,j=e=>k(e)?.baseFileHash??null,M=e=>k(e)?.patchFileHash??null,N=1e3,P=N,F=`Invalid cohort. Use 1-1000 or a lowercase slug without spaces, up to 64 characters.`,I=/^[a-z0-9-]+$/;function L(e){if(!/^\d+$/.test(e))return null;let t=Number.parseInt(e,10);return Number.isNaN(t)||t<1||t>1e3?null:t}function R(e,t){return(e%t+t)%t}function z(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function B(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let e=n%r;n=r,r=e}return n}function V(e,t){let n=0,r=1,i=t,a=R(e,t);for(;a!==0;){let e=Math.floor(i/a);[n,r]=[r,n-e*r],[i,a]=[a,i-e*a]}if(i>1)throw Error(`No modular inverse for ${e} mod ${t}`);return R(n,t)}function H(e){let t=R(z(`${e}:multiplier`),997);for(t===0&&(t=1);B(t,N)!==1;)t=R(t+1,N),t===0&&(t=1);let n=R(z(`${e}:offset`),N);return{multiplier:t,offset:n,inverseMultiplier:V(t,N)}}function U(e){return e==null?P:e<=0?0:e>=1e3?N:Math.floor(e)}function W(e){let t=e.trim().toLowerCase(),n=L(t);return n===null?t:String(n)}function oe(e){return L(W(e))}function G(e){return oe(e)!==null}function K(e){let t=W(e);return t.length>0&&t.length<=64&&!/^\d+$/.test(t)&&I.test(t)}function q(e){let t=W(e);return G(t)||K(t)}function se(e,t){if(t<1||t>1e3)throw Error(`Invalid numeric cohort: ${t}`);let{offset:n,inverseMultiplier:r}=H(e);return R(r*(t-1-n),N)}var ce=/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,J=e=>typeof e==`string`&&ce.test(e),Y=e=>{if(!J(e))throw TypeError(`Expected a canonical lowercase UUIDv7`);let t=e.split(`-`).join(``).slice(0,12);return Number.parseInt(t,16)},X=e=>typeof e==`string`&&e.trim().length>0&&e.length<=1024?e:void 0,Z=e=>e===`24h`||e===`7d`||e===`30d`?e:void 0,le=e=>e===`adoption`||e===`crashes`?e:void 0,ue=e=>e===`12m`?e:Z(e),Q=`production`,de=e=>e===`all`||e===`ios`||e===`android`?e:void 0;function $(e){return{platform:de(e.platform),channel:X(e.channel),appVersion:X(e.appVersion),window:ue(e.window),bundleWindow:Z(e.bundleWindow),releaseId:X(e.releaseId),healthChart:le(e.healthChart),bundles:X(e.bundles)}}function fe(e){return{...$(e),version:X(e.version),page:typeof e.page==`number`&&Number.isSafeInteger(e.page)&&e.page>0?e.page:void 0}}function pe(e,t=Date.now()){if(!J(e))return`7d`;let n=t-Y(e);return n<=864e5?`24h`:n<=7*864e5?`7d`:`30d`}var me=e=>e===void 0?void 0:[...new Set(e.split(`,`).filter(e=>e.length>0))];export{l as _,$ as a,N as c,j as d,M as f,U as g,W as h,fe as i,se as l,q as m,pe as n,Y as o,J as p,me as r,F as s,Q as t,A as u};
@@ -1 +0,0 @@
1
- import{Bn as e,Jn as t,Ln as n,Ur as r,Ut as i,Wr as a,ar as o,ei as s,nr as c,qt as l,ri as u,rr as d}from"./sidebar-BqX460IW.js";import{r as f,t as p}from"./valueToPercent-B44vDssN.js";var m=o(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),h=u(s()),g=h.createContext(void 0);function _(){let e=h.useContext(g);if(e===void 0)throw Error(t(51));return e}var v=function(e){return e.complete=`data-complete`,e.indeterminate=`data-indeterminate`,e.progressing=`data-progressing`,e}({}),y={status(e){return e===`progressing`?{[v.progressing]:``}:e===`complete`?{[v.complete]:``}:e===`indeterminate`?{[v.indeterminate]:``}:null}},b=r();function x(e,t){return t==null?`indeterminate progress`:e||`${t}%`}var S=h.forwardRef(function(t,n){let{format:r,getAriaValueText:a=x,locale:o,max:s=100,min:c=0,value:u,render:d,className:p,children:m,style:_,...v}=t,[S,C]=h.useState(),w=l(r),T=`indeterminate`;Number.isFinite(u)&&(T=u===s?`complete`:`progressing`);let E=f(u,o,w.current),D=h.useMemo(()=>({status:T}),[T]),O={"aria-labelledby":S,"aria-valuemax":s,"aria-valuemin":c,"aria-valuenow":u??void 0,"aria-valuetext":a(E,u),role:`progressbar`,children:(0,b.jsxs)(h.Fragment,{children:[m,(0,b.jsx)(`span`,{role:`presentation`,style:i,children:`x`})]})},k=h.useMemo(()=>({formattedValue:E,max:s,min:c,setLabelId:C,state:D,status:T,value:u}),[E,s,c,C,D,T,u]),A=e(`div`,t,{state:D,ref:n,props:[O,v],stateAttributesMapping:y});return(0,b.jsx)(g.Provider,{value:k,children:A})}),C=h.forwardRef(function(t,n){let{render:r,className:i,style:a,...o}=t,{state:s}=_();return e(`div`,t,{state:s,ref:n,props:o,stateAttributesMapping:y})}),w=h.forwardRef(function(t,n){let{render:r,className:i,style:a,...o}=t,{max:s,min:c,value:l,state:u}=_(),d=Number.isFinite(l)&&l!==null?p(l,c,s):null;return e(`div`,t,{state:u,ref:n,props:[{style:d==null?{}:{insetInlineStart:0,height:`inherit`,width:`${d}%`}},o],stateAttributesMapping:y})});function T({className:e,children:t,value:r,...i}){return(0,b.jsxs)(S,{value:r,"data-slot":`progress`,className:n(`w-full`,e),...i,children:[t,(0,b.jsx)(E,{children:(0,b.jsx)(D,{})})]})}function E({className:e,...t}){return(0,b.jsx)(C,{className:n(`relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted`,e),"data-slot":`progress-track`,...t})}function D({className:e,...t}){return(0,b.jsx)(w,{"data-slot":`progress-indicator`,className:n(`h-full bg-primary transition-transform motion-reduce:transition-none`,e),...t})}var O=d({method:`GET`}).middleware([c]).handler(a(`8a98cd9c178e4a54185d62c25a95f09d3d59850c43d3f5baa1563e1614ad942e`));export{T as n,m as r,O as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-D2c2v1bu.js","assets/ConsoleFeatureUnavailable-C0KfsKWL.js","assets/sidebar-BqX460IW.js","assets/console-features-api-DPE4C06Y.js","assets/arrow-up-right-B5aM0F7f.js","assets/NotFoundPage-Cei6W2lm.js","assets/empty-Bf4DanOL.js","assets/insights_.distribution-Cthgttqb.js","assets/select-M3H2gxCc.js","assets/useCompositeListItem-B-UkrDlu.js","assets/badge-Bqf3UDee.js","assets/insights-usage-rpc-DqTiXI1_.js","assets/valueToPercent-B44vDssN.js","assets/arrow-left-DsivSewE.js","assets/insights-api-1ZjVu3Sb.js","assets/insights-search-aT8BVCci.js","assets/InsightsPageHeader-BRw8XkJW.js","assets/tabs-CgEH_fMT.js","assets/list-Dtj7TtzV.js","assets/field-GxF9SyUo.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./console-features-api-DPE4C06Y.js";import{a as t,c as n,s as r}from"./useCompositeListItem-B-UkrDlu.js";import{i}from"./insights-search-aT8BVCci.js";var a=n(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:r(()=>t(()=>import(`./insights_.distribution-D2c2v1bu.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`notFoundComponent`),component:r(()=>t(()=>import(`./insights_.distribution-Cthgttqb.js`),__vite__mapDeps([7,2,8,9,3,10,11,12,13,4,14,15,16,17,18,6,19])),`component`),validateSearch:i});export{a as t};
@@ -1 +0,0 @@
1
- import{$ as e,Fn as t,In as n,Ur as r,cr as i}from"./sidebar-BqX460IW.js";import{l as a}from"./console-features-api-DPE4C06Y.js";import{t as o}from"./arrow-left-DsivSewE.js";import{t as s}from"./arrow-up-right-B5aM0F7f.js";import{o as c,u as l}from"./insights-api-1ZjVu3Sb.js";import{a as ee,d as u,i as d,l as f,n as p,o as m,s as h,t as g,u as _}from"./badge-Bqf3UDee.js";import{N as v,a as te,i as y,n as ne,o as re,r as b,t as x}from"./select-M3H2gxCc.js";import{n as S,r as C,t as w}from"./insights-usage-rpc-DqTiXI1_.js";import{_ as T,a as E}from"./insights-search-aT8BVCci.js";import{i as D,o as O,r as k,t as A}from"./empty-Bf4DanOL.js";import{a as j,t as M}from"./field-GxF9SyUo.js";import{t as N}from"./insights_.distribution-Bzl6RFBR.js";import{i as P}from"./valueToPercent-B44vDssN.js";import{c as ie,n as F,o as I,t as L}from"./InsightsPageHeader-BRw8XkJW.js";var R=r(),z=20,B=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`}),V=e=>e.releaseId??(e.builtinBundleId?`Built-in bundle ${e.builtinBundleId}`:`Unknown bundle`);function H({bundleId:e}){return(0,R.jsxs)(`div`,{className:`flex min-h-11 min-w-0 flex-wrap items-center gap-2 md:min-h-9`,children:[(0,R.jsx)(F,{}),(0,R.jsx)(P,{bundleId:e,className:`text-muted-foreground`})]})}function U(){let r=N.useSearch(),P=c(),F=N.useNavigate(),U={platform:r.platform??`all`,channel:r.channel??`production`,appVersion:r.appVersion,window:r.window??`24h`},W=i({queryKey:[`insights`,`app-usage`,U],queryFn:()=>w({data:U}),staleTime:3e4}),G=W.error?void 0:W.data,K=G?`since ${B.format(G.distributionSinceMs)}, 00:00 UTC`:`in this period`,q=(G?.bundleDistribution??[]).filter(e=>!r.version||e.appVersion===r.version),J=q.reduce((e,t)=>e+t.installations,0),Y=Math.max(1,Math.ceil(q.length/z)),X=Math.min(r.page??1,Y),Z=[...new Set([...G?.versions.map(e=>e.name)??[],...r.version?[r.version]:[]])],Q=E(r),$=e=>void F({search:{...r,page:void 0,...e}});return(0,R.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,R.jsx)(L,{view:`distribution`,overviewSearch:Q}),(0,R.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 px-4 py-6 sm:p-8`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[(0,R.jsxs)(a,{to:`/insights`,search:Q,className:n({variant:`ghost`,className:`h-11 w-fit sm:h-9`}),children:[(0,R.jsx)(o,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to overview`]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,R.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:`Distribution`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(I,{twelveMonths:l(P),window:U.window,onWindowChange:e=>$({window:e})}),(0,R.jsx)(t,{"aria-label":`Refresh distribution`,variant:`ghost`,size:`icon`,className:`size-11 sm:size-9`,disabled:W.isFetching,onClick:()=>void W.refetch(),children:(0,R.jsx)(C,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(M,{className:`w-full sm:w-64`,children:[(0,R.jsx)(j,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(x,{items:Object.fromEntries([[`all`,`All versions`],...Z.map(e=>[`version:${e}`,e])]),value:r.version?`version:${r.version}`:`all`,onValueChange:e=>{e!==null&&$({version:e===`all`?void 0:e.slice(8)})},children:[(0,R.jsx)(te,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(re,{})}),(0,R.jsx)(ne,{children:(0,R.jsxs)(b,{children:[(0,R.jsx)(y,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(y,{value:`version:${e}`,children:e},e))]})})]})]}),(0,R.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center gap-2`,"aria-label":`Distribution scope`,children:[(0,R.jsxs)(g,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(v,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(g,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(g,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(m,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(_,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(u,{children:`Bundles by app version`}),(0,R.jsxs)(T,{label:`How bundle distribution is counted`,children:[`Each installation counts once, by its latest report`,` `,K,`. Shares are within each app version. Built-in bundle: the bundle the native build shipped, by its ID. Unknown bundle: no deployment and no built-in bundle ID.`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[W.isPending?(0,R.jsx)(e,{className:`h-9 w-16`}):(0,R.jsx)(`p`,{className:`text-3xl font-semibold tabular-nums`,children:G?`${G.truncated?`≥`:``}${J.toLocaleString()}`:`—`}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Reporting installations`})]})]}),(0,R.jsxs)(h,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(p,{children:[(0,R.jsx)(ee,{children:`Partial history`}),(0,R.jsxs)(d,{children:[`Counts and shares reflect reports since`,` `,new Date(G.sinceMs).toLocaleString(`en`,{timeZone:`UTC`}),` `,`UTC. Choose a shorter period for a more complete view.`]})]}):null,W.isPending?(0,R.jsx)(e,{"aria-label":`Loading bundle distribution`,className:`h-64`}):W.error?(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-4`,children:[(0,R.jsx)(ie,{error:W.error,fallbackTitle:`Distribution unavailable`}),(0,R.jsx)(t,{variant:`outline`,onClick:()=>void W.refetch(),children:`Retry distribution`})]}):q.length===0?(0,R.jsxs)(A,{children:[(0,R.jsxs)(D,{children:[(0,R.jsx)(O,{children:`No bundles reported`}),(0,R.jsx)(k,{children:`Choose another version or period, or change the filters in the overview.`})]}),(0,R.jsx)(t,{variant:`outline`,onClick:()=>$({version:void 0}),children:`Show all versions`})]}):(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] gap-4 border-b px-3 pb-3 text-xs text-muted-foreground md:grid`,children:[(0,R.jsx)(`span`,{children:`App version`}),(0,R.jsx)(`span`,{children:`Bundle ID`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Active installations`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Version share`})]}),(0,R.jsx)(`ul`,{"aria-label":`Bundle distribution`,className:`divide-y`,children:q.slice((X-1)*z,X*z).map(e=>{let t=G?.versions.find(t=>t.name===e.appVersion)?.installations??0,n=t>0?e.installations/t*100:0;return(0,R.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-3 px-1 py-4 md:grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] md:px-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm font-medium`,title:e.appVersion,children:e.appVersion}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(v,{platform:e.platform,className:`size-3.5`}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,R.jsxs)(`div`,{className:`col-span-2 row-start-2 min-w-0 md:col-span-1 md:row-auto`,children:[e.releaseId?(0,R.jsxs)(a,{to:`/`,search:{releaseId:e.releaseId},"aria-label":`Review bundle ${e.releaseId} for app version ${e.appVersion}`,className:`flex min-h-11 min-w-0 items-center gap-2 text-xs underline-offset-4 hover:underline md:min-h-9`,children:[(0,R.jsx)(`span`,{className:`break-all font-mono`,children:e.releaseId}),(0,R.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):e.builtinBundleId?null:(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unknown bundle`}),e.builtinBundleId?(0,R.jsx)(H,{bundleId:e.builtinBundleId}):null]}),(0,R.jsxs)(`div`,{className:`col-start-2 row-start-1 text-right md:col-auto md:row-auto`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:e.installations.toLocaleString()}),(0,R.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground md:sr-only`,children:`active`}),(0,R.jsxs)(`p`,{className:`mt-1 text-xs tabular-nums text-muted-foreground md:hidden`,children:[n.toFixed(1),`% of version`]})]}),(0,R.jsxs)(`div`,{className:`hidden flex-col gap-2 md:flex`,children:[(0,R.jsxs)(`span`,{className:`text-right text-sm tabular-nums`,children:[n.toFixed(1),`%`]}),(0,R.jsx)(S,{"aria-label":`${V(e)} share in ${e.appVersion} on ${e.platform}`,value:n})]})]},JSON.stringify([e.appVersion,e.platform,e.releaseId,e.builtinBundleId]))})})]})]}),G&&q.length>0?(0,R.jsxs)(f,{className:`flex flex-wrap items-center justify-between gap-3 border-t pt-4`,children:[(0,R.jsxs)(`p`,{className:`text-xs tabular-nums text-muted-foreground`,children:[(X-1)*z+1,`–`,Math.min(X*z,q.length),` of `,q.length]}),(0,R.jsxs)(`nav`,{"aria-label":`Distribution pages`,className:`flex gap-2`,children:[(0,R.jsx)(t,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X<=1,onClick:()=>$({page:X-1}),children:`Previous`}),(0,R.jsx)(t,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X>=Y,onClick:()=>$({page:X+1}),children:`Next`})]})]}):null]})]})})]})}export{U as component};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-C0KfsKWL.js";var t=e;export{t as notFoundComponent};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-C0KfsKWL.js";var t=e;export{t as notFoundComponent};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-2Nx8Htf-.js","assets/ConsoleFeatureUnavailable-C0KfsKWL.js","assets/sidebar-BqX460IW.js","assets/console-features-api-DPE4C06Y.js","assets/arrow-up-right-B5aM0F7f.js","assets/NotFoundPage-Cei6W2lm.js","assets/empty-Bf4DanOL.js","assets/installations-K2iJ_r0h.js","assets/useCompositeListItem-B-UkrDlu.js","assets/EventDetails-gbD_fCqc.js","assets/insights-api-1ZjVu3Sb.js","assets/badge-Bqf3UDee.js","assets/HashValueDisplay-BGkDPaYi.js","assets/dist-dDj-R6uh.js","assets/input-group-B4nrqIh0.js","assets/smartphone-CtsHuiIC.js","assets/InsightsPageHeader-BRw8XkJW.js","assets/tabs-CgEH_fMT.js","assets/list-Dtj7TtzV.js","assets/arrow-left-DsivSewE.js","assets/refresh-cw-DjIKjmrS.js","assets/search-DuI1FBpg.js","assets/field-GxF9SyUo.js","assets/table-ek1DmRHq.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./console-features-api-DPE4C06Y.js";import{a as t,c as n,s as r}from"./useCompositeListItem-B-UkrDlu.js";var i=864e5,a={"24h":{period:`24 hours`,durationMs:i},"7d":{period:`7 days`,durationMs:7*i},"30d":{period:`30 days`,durationMs:30*i},"90d":{period:`90 days`,durationMs:90*i}},o=Object.keys(a),s=e=>o[o.indexOf(e)+1],c=(e,t)=>({beforeReceivedAtMs:t,sinceMs:Math.max(0,t-a[e].durationMs)}),l=e=>typeof e==`string`&&e.length>0?e:void 0,u=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0,d=e=>o.find(t=>t===e);function f(e){let t=p(e.search);return t.query===void 0&&t.installId===void 0?`/installations?eventsBefore=${t.eventsBefore??`new`}&eventsRange=${t.eventsRange??`7d`}&eventsCursor=${t.eventsCursor??`first`}`:e.state.__TSR_key}function p(e){return{query:typeof e.query==`string`?e.query:void 0,installId:typeof e.installId==`string`?e.installId:void 0,eventsCursor:l(e.eventsCursor),eventsBefore:u(e.eventsBefore),eventsRange:d(e.eventsRange),searchCursor:l(e.searchCursor),historyCursor:l(e.historyCursor),historyBefore:u(e.historyBefore)}}var m=n(`/installations`)({beforeLoad:({context:t})=>e(t.queryClient,`insights`),notFoundComponent:r(()=>t(()=>import(`./installations-2Nx8Htf-.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`notFoundComponent`),component:r(()=>t(()=>import(`./installations-K2iJ_r0h.js`),__vite__mapDeps([7,2,8,3,9,10,11,12,13,14,15,16,17,18,6,19,4,20,21,22,23])),`component`),staticData:{scrollRestorationKey:f},validateSearch:p});export{a,c as i,f as n,s as o,o as r,m as t};
@@ -1 +0,0 @@
1
- import{$ as e,Fn as t,In as n,Ln as r,Ur as i,ei as a,et as o,ir as s,ri as c}from"./sidebar-BqX460IW.js";import{C as l,S as u,f as d,l as f}from"./console-features-api-DPE4C06Y.js";import{d as p,o as m,u as h}from"./useCompositeListItem-B-UkrDlu.js";import{a as g,n as _,o as v,r as y,t as b}from"./EventDetails-gbD_fCqc.js";import{t as x}from"./arrow-left-DsivSewE.js";import{t as S}from"./arrow-up-right-B5aM0F7f.js";import{a as C,c as w,i as T,l as E,n as ee,o as te,r as ne}from"./insights-api-1ZjVu3Sb.js";import{c as D,d as O,o as k,p as A,s as j,u as M}from"./badge-Bqf3UDee.js";import{n as N,t as P}from"./HashValueDisplay-BGkDPaYi.js";import{t as F}from"./refresh-cw-DjIKjmrS.js";import{i as re,n as I,r as ie,t as ae}from"./input-group-B4nrqIh0.js";import{t as oe}from"./search-DuI1FBpg.js";import{a as L,i as se,n as ce,o as le,r as ue,t as R}from"./installations-BskJ1xQr.js";import{a as de,t as fe}from"./field-GxF9SyUo.js";import{a as z,i as B,n as V,o as H,r as U,t as W}from"./table-ek1DmRHq.js";import{a as pe,c as G,n as me,r as he,t as ge}from"./InsightsPageHeader-BRw8XkJW.js";function _e(){l(d(),!0)}function ve(e){return _e(),u(d(),e)}function ye(e){let t=d();return p(t.stores.location,h(e,t))}var K=c(a(),1),q=i();function J({events:e,formatter:t,renderIdentity:n}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,q.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,q.jsx)(y,{event:e}),(0,q.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,q.jsx)(_,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,q.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,q.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,q.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,q.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,q.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,q.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,q.jsx)(b,{event:e,touch:!0})})]},e.id))})]})}function Y({hasPrevious:e,label:n,nextCursor:r,onNext:i,onPrevious:a,pageLength:o,pageNumber:s}){return(0,q.jsxs)(`nav`,{"aria-label":`${n} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,q.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:a,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,q.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:r===null,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}var be=e=>ue.filter((t,n)=>n===0||L[t].durationMs<=e*864e5);function X({event:e,eventsLocation:t,touch:r=!1}){return(0,q.jsxs)(`div`,{className:r?`flex min-w-0 flex-wrap items-center justify-between gap-2`:`flex min-w-0 flex-col items-start gap-2`,children:[(0,q.jsxs)(f,{className:n({className:r?`-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm`:`-ml-2 max-w-full justify-start`,size:`sm`,variant:`ghost`}),to:`/installations`,search:{...t,query:e.installId||void 0,installId:e.installId},state:e=>({insightsPagination:{eventsBack:e.insightsPagination?.eventsBack}}),"aria-label":`View history for ${e.userId??`anonymous installation`} (${e.installId})`,children:[(0,q.jsx)(`span`,{className:r?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,q.jsx)(S,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,q.jsx)(P,{value:e.installId,maxLength:13,buttonClassName:r?`min-h-11 px-3`:void 0})]})}function xe({children:n,description:r,error:i,eventsLocation:a,history:o,isFetching:s,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:p,range:m,rawDays:h=90,title:g=`All events`}){let x=v(),S=p>1,C=be(h),w=m===void 0?void 0:le(m),T=w!==void 0&&C.includes(w)?w:void 0,E=T!==void 0&&d?(0,q.jsx)(t,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(T),type:`button`,variant:`outline`,children:`Show the last ${L[T].period}`}):null;return(0,q.jsxs)(k,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,q.jsxs)(M,{className:`gap-4 p-4 sm:p-6`,children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,q.jsx)(O,{children:(0,q.jsx)(`h2`,{children:g})}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[m!==void 0&&d?(0,q.jsx)(pe,{label:`Time range`,onPeriodChange:d,period:m,periods:C.map(e=>({value:e,name:`Last ${L[e].period}`}))}):null,(0,q.jsxs)(t,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,q.jsx)(F,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),r?(0,q.jsx)(D,{children:r}):null]}),n]}),(0,q.jsx)(j,{className:`min-w-0 p-0`,children:c?(0,q.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,q.jsx)(e,{className:`h-12 w-full`}),(0,q.jsx)(e,{className:`h-12 w-full`}),(0,q.jsx)(e,{className:`h-12 w-full`})]}):i?(0,q.jsx)(`div`,{className:`px-6 pb-6`,children:(0,q.jsx)(G,{error:i,fallbackTitle:`Event history unavailable`})}):o?(0,q.jsxs)(q.Fragment,{children:[o.data.length>0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,q.jsx)(J,{events:o.data,formatter:x,renderIdentity:e=>(0,q.jsx)(X,{event:e,eventsLocation:a,touch:!0})})}),(0,q.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,q.jsxs)(W,{className:`min-w-4xl table-fixed`,children:[(0,q.jsx)(z,{children:(0,q.jsxs)(H,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,q.jsx)(B,{className:`w-64`,children:`Time`}),(0,q.jsx)(B,{className:`w-48`,children:`Event`}),(0,q.jsx)(B,{className:`w-48`,children:`User / installation`}),(0,q.jsx)(B,{className:`w-32`,children:`App`}),(0,q.jsx)(B,{className:`w-52`,children:`Bundle`})]})}),(0,q.jsx)(V,{children:o.data.map(e=>(0,q.jsxs)(H,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,q.jsx)(U,{className:`whitespace-normal text-xs tabular-nums`,children:(0,q.jsx)(_,{value:e.receivedAtMs,formatter:x})}),(0,q.jsx)(U,{children:(0,q.jsx)(y,{event:e})}),(0,q.jsx)(U,{children:(0,q.jsx)(X,{event:e,eventsLocation:a})}),(0,q.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,q.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,q.jsx)(b,{event:e})})]},e.id))})]})})]}):(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S?`No older events in this range.`:m===void 0?g===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${L[m].period}.`}),S?null:E]}),m!==void 0&&o.nextCursor===null&&(o.data.length>0||S)?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),E]}):null,o.data.length>0||S||o.nextCursor?(0,q.jsx)(Y,{hasPrevious:S,label:g,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:p}):null]}):null})]})}var Se=e=>e.userId??`—`,Ce=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function we({error:n,history:r,isLoading:i,onNext:a,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=w,selectedEvent:d,selectedInstallId:f}){let p=v(),m=d?Ce(d):void 0,h=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,q.jsxs)(k,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,q.jsx)(M,{className:`p-4 sm:p-6`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,q.jsx)(O,{className:`text-sm font-medium`,children:(0,q.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,q.jsxs)(D,{children:[`Bundle changes and update failures are kept for`,` `,E(u.rawDays),`; the latest report, for`,` `,E(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,q.jsxs)(t,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:i,children:[(0,q.jsx)(F,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,q.jsxs)(j,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,q.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,q.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,q.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,q.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Se(d)})]}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,q.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,q.jsx)(P,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,q.jsxs)(`dd`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 font-mono text-xs`,children:[m?(0,q.jsx)(P,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`,he(m,d.minBundleId)?(0,q.jsx)(me,{}):null]})]}),h?(0,q.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Not launched yet`}),(0,q.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,q.jsx)(P,{value:h})})]}):null]}),d.httpResponse?(0,q.jsx)(`div`,{className:`mt-4`,children:(0,q.jsx)(g,{event:d})}):null]}),(0,q.jsx)(o,{})]}):null,f===void 0?null:i?(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,q.jsx)(e,{className:`h-10 w-full`}),(0,q.jsx)(e,{className:`h-10 w-full`}),(0,q.jsx)(e,{className:`h-10 w-full`})]}):n?(0,q.jsx)(`div`,{className:`p-6`,children:(0,q.jsx)(G,{error:n instanceof Error?n:Error(),fallbackTitle:`Installation history unavailable`})}):r&&r.data.length>0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,q.jsx)(J,{events:r.data,formatter:p})}),(0,q.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,q.jsxs)(W,{className:`min-w-3xl table-fixed`,children:[(0,q.jsx)(z,{children:(0,q.jsxs)(H,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,q.jsx)(B,{className:`w-64`,children:`Time`}),(0,q.jsx)(B,{className:`w-48`,children:`Event`}),(0,q.jsx)(B,{className:`w-32`,children:`App`}),(0,q.jsx)(B,{className:`w-52`,children:`Bundle`})]})}),(0,q.jsx)(V,{children:r.data.map(e=>(0,q.jsxs)(H,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,q.jsx)(U,{className:`whitespace-normal text-xs tabular-nums`,children:(0,q.jsx)(_,{value:e.receivedAtMs,formatter:p})}),(0,q.jsx)(U,{children:(0,q.jsx)(y,{event:e})}),(0,q.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,q.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,q.jsx)(b,{event:e})})]},e.id))})]})}),(0,q.jsx)(Y,{hasPrevious:l>1,label:`Installation history`,nextCursor:r.nextCursor,onNext:a,onPrevious:s,pageLength:r.data.length,pageNumber:l})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:l>1?`No older bundle changes.`:`No bundle changes recorded yet.`}),r&&(l>1||r.nextCursor)?(0,q.jsx)(Y,{hasPrevious:l>1,label:`Installation history`,nextCursor:r.nextCursor,onNext:a,onPrevious:s,pageLength:0,pageNumber:l}):null]})]})]})}var Te=e=>e.lastKnownBundleId,Ee=e=>e.userId??`—`;function De({error:e,onNext:i,onPrevious:a,onSelect:o,pageNumber:s,results:c,selectedInstallId:l}){let[u,d]=(0,K.useState)(!1),f=(0,K.useId)(),p=(0,K.useRef)(null),h=!e&&c&&c.data.length>0;return(0,q.jsxs)(k,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,q.jsx)(M,{className:`p-4 sm:px-6`,children:(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,q.jsx)(O,{className:`text-sm font-medium`,children:(0,q.jsx)(`h2`,{children:`Matching installations`})})}),(0,q.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:h?(0,q.jsx)(t,{"aria-controls":f,"aria-expanded":u,"aria-label":u?`Hide matching installations`:`Show matching installations`,className:`size-11 lg:hidden`,onClick:()=>d(!u),ref:p,size:`icon-lg`,variant:`ghost`,children:(0,q.jsx)(m,{"aria-hidden":`true`,className:r(u&&`rotate-180`)})}):null})]})}),(0,q.jsxs)(j,{className:r(`min-h-0 p-0`,h&&!u&&`hidden lg:block`),id:f,children:[e?(0,q.jsx)(`div`,{className:`p-6`,children:(0,q.jsx)(G,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):c&&c.data.length>0?(0,q.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:c.data.map(e=>{let t=Te(e),n=e.installId===l;return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{"aria-label":`${Ee(e)}, install ID ${e.installId}`,"aria-pressed":n,className:`group flex w-full min-w-0 flex-col gap-2 border-l-2 border-transparent px-4 py-4 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60 motion-reduce:transition-none sm:px-6`,onClick:()=>{o(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,q.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,q.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:Ee(e)}),n?(0,q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,q.jsx)(A,{"aria-hidden":`true`,className:`size-3.5`}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,q.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,q.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:N(e.installId)})}),(0,q.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,q.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:N(t)}):(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,q.jsx)(`a`,{className:n({variant:`outline`,className:`h-11 px-3 lg:h-8`}),href:`#installation-history-search`,children:`Edit search`})]}),c&&(c.data.length>0||s>1||c.nextCursor)?(0,q.jsx)(Y,{hasPrevious:s>1,label:`Installation results`,nextCursor:c.nextCursor,onNext:i,onPrevious:a,pageLength:c.data.length,pageNumber:s}):null]})]})}function Oe({draftQuery:e,onDraftQueryChange:n,onSubmit:r,onClear:i}){return(0,q.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&r()},role:`search`,children:(0,q.jsxs)(fe,{className:`gap-2`,children:[(0,q.jsx)(de,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,q.jsxs)(ae,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,q.jsx)(I,{children:(0,q.jsx)(oe,{"aria-hidden":`true`})}),(0,q.jsx)(re,{autoComplete:`off`,className:`h-11 text-base md:text-base lg:h-8 lg:text-xs`,id:`installation-history-search`,maxLength:1024,name:`installation`,onChange:e=>n(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,q.jsx)(I,{align:`inline-end`,children:(0,q.jsx)(ie,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,q.jsx)(s,{"aria-hidden":`true`})})}):null]}),(0,q.jsx)(t,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:e.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function ke(){return(0,q.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,q.jsx)(e,{className:`h-64 w-full lg:h-full`}),(0,q.jsx)(e,{className:`h-64 w-full lg:h-full`})]})}var Ae=20,je=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Me(){let e=R.useSearch(),n=R.useNavigate(),r=te(),[i,a]=(0,K.useState)(e.query??``),[o]=(0,K.useState)(Z),[s]=(0,K.useState)(Z),c=ye({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=e.query?.trim()??``,p=f.length>0,m=e.installId!==void 0,h=p||m,g=e.eventsBefore??o,_=e.eventsRange??`7d`,v=e.historyBefore??s,y=(t,r=!1,i={})=>{n({to:`/installations`,search:{...e,...t},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,K.useEffect)(()=>{a(e.query??``)},[e.query]),(0,K.useEffect)(()=>{e.eventsBefore===void 0&&y({eventsBefore:g},!0)},[g,e.eventsBefore]),(0,K.useEffect)(()=>{m&&e.historyBefore===void 0&&y({historyBefore:v},!0)},[m,v,e.historyBefore]);let b=ee({...se(_,g),cursor:e.eventsCursor,limit:20},!h),S=C({cursor:e.searchCursor,identity:f,limit:Ae},p);(0,K.useEffect)(()=>{let e=S.data?.data[0]?.installId;!p||m||e===void 0||y({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,S.data?.data]);let w=T(e.installId??``,m),D=ne({beforeReceivedAtMs:v,cursor:e.historyCursor,installId:e.installId??``,limit:je},m),O=w.data??S.data?.data.find(({installId:t})=>t===e.installId)??D.data?.data[0],A=h?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,M=(0,K.useRef)(null),N=ve({id:A,getKey:ce});(0,K.useLayoutEffect)(()=>{!h&&!b.isLoading&&M.current&&(M.current.scrollTop=N?.scrollY??0)},[b.isLoading,h,N?.scrollY,A]);let P=()=>{a(``),y({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},F=(0,q.jsx)(Oe,{draftQuery:i,onClear:P,onDraftQueryChange:a,onSubmit:()=>{let e=i.trim();if(!e){P();return}y({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:e,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})}});return(0,q.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,q.jsx)(ge,{view:`events`}),(0,q.jsx)(`div`,{ref:M,"data-scroll-restoration-id":A,id:`insights-events-scroll`,className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[h?(0,q.jsx)(k,{className:`shadow-sm`,children:(0,q.jsxs)(j,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,q.jsxs)(t,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:P,variant:`ghost`,children:[(0,q.jsx)(x,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),F]})}):null,h?S.isLoading&&p?(0,q.jsx)(ke,{}):(0,q.jsxs)(`div`,{className:`grid min-h-0 min-w-0 items-stretch gap-4 sm:gap-6 ${p?`lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`:`lg:grid-cols-1`}`,children:[p?(0,q.jsx)(De,{error:S.error,onNext:()=>{S.data?.nextCursor&&y({installId:void 0,searchCursor:S.data.nextCursor},!0,{searchBack:Q(u,e.searchCursor)})},onPrevious:()=>{let e=$(u);y({installId:void 0,searchCursor:e.cursor},!0,{searchBack:e.stack})},onSelect:e=>{y({historyBefore:Z(),historyCursor:void 0,installId:e},!1,{historyBack:[]})},pageNumber:u.length+1,results:S.data,selectedInstallId:e.installId}):null,(0,q.jsx)(we,{error:D.error??w.error,history:D.data,isLoading:D.isLoading||w.isLoading,onNext:()=>{D.data?.nextCursor&&y({historyCursor:D.data.nextCursor},!0,{historyBack:Q(d,e.historyCursor)})},onPrevious:()=>{let e=$(d);y({historyCursor:e.cursor},!0,{historyBack:e.stack})},onRefresh:()=>{y({historyBefore:Z(),historyCursor:void 0},!0,{historyBack:[]})},pageNumber:d.length+1,retention:r,selectedEvent:O,selectedInstallId:e.installId})]}):(0,q.jsx)(xe,{description:`Downloads, launches, crashes, update failures, and other changes to what an installation runs, newest first, kept for ${E(r.rawDays)}. Launches that change nothing aren't listed.`,error:b.error,eventsLocation:{eventsBefore:g,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:b.data,isFetching:b.isFetching,isLoading:b.isLoading,onNext:()=>{b.data?.nextCursor&&y({eventsCursor:b.data.nextCursor},!0,{eventsBack:Q(l,e.eventsCursor)})},onPrevious:()=>{let e=$(l);y({eventsCursor:e.cursor},!0,{eventsBack:e.stack})},onRangeChange:e=>{y({eventsBefore:Z(),eventsCursor:void 0,eventsRange:e},!1,{eventsBack:[]})},onRefresh:()=>{y({eventsBefore:Z(),eventsCursor:void 0},!0,{eventsBack:[]})},pageNumber:l.length+1,range:_,rawDays:r.rawDays,children:F})]})},A)]})}export{Me as component};
@@ -1,6 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-config-ikg7kak0.js","assets/ConsoleFeatureUnavailable-C0KfsKWL.js","assets/sidebar-BqX460IW.js","assets/console-features-api-DPE4C06Y.js","assets/arrow-up-right-B5aM0F7f.js","assets/NotFoundPage-Cei6W2lm.js","assets/empty-Bf4DanOL.js","assets/remote-config-DzOOiBIO.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,Bn as t,Fn as n,Gn as r,Hn as i,Hr as a,Jn as o,Ln as s,Rn as c,Ur as l,Vn as u,Wr as d,Yt as f,Z as p,Zn as m,ar as h,cr as g,ei as _,fn as v,ir as y,jr as b,nr as x,p as S,ri as C,rr as w,ut as T}from"./sidebar-BqX460IW.js";import{r as ee}from"./console-features-api-DPE4C06Y.js";import{a as te,c as E,i as D,m as O,s as k}from"./useCompositeListItem-B-UkrDlu.js";import{a as ne,d as re,i as ie,l as ae,n as oe,o as se,r as ce,s as le,t as ue}from"./alert-dialog-BtVg50WQ.js";import{h as de,i as fe}from"./api-DoicFJfd.js";import{a as A,c as pe,d as me,f as j,i as M,n as N,o as he,r as P,s as ge,t as F,u as _e}from"./badge-Bqf3UDee.js";import{N as ve,a as ye,i as I,n as be,o as L,r as xe,s as Se,t as Ce}from"./select-M3H2gxCc.js";import{t as we}from"./clipboard-DTkrlIMn.js";import{a as Te,c as R,i as Ee,l as De,n as Oe,o as ke,r as Ae,t as je}from"./dialog-CGKPxz3n.js";import{t as Me}from"./refresh-cw-DjIKjmrS.js";import{i as Ne,n as Pe,o as Fe,r as Ie,s as Le,t as Re}from"./input-group-B4nrqIh0.js";import{t as ze}from"./search-DuI1FBpg.js";import{a as Be,i as Ve,n as z,o as He,r as Ue,s as We,t as Ge}from"./switch-By_vfm8I.js";import{t as Ke}from"./smartphone-CtsHuiIC.js";import{t as qe}from"./undo-2-DxXx9Zvr.js";import{n as B}from"./dist-dDj-R6uh.js";import{a as Je,i as Ye,n as Xe,o as Ze,r as Qe,t as $e}from"./tabs-CgEH_fMT.js";import{a as et,i as tt,n as nt,o as rt,r as V,t as it}from"./empty-Bf4DanOL.js";import{a as H,i as at,n as ot,o as st,r as U,s as ct,t as W}from"./field-GxF9SyUo.js";var lt=h(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),ut=h(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),dt=h(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),ft=h(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),pt=h(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),mt=h(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ht=h(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),gt=h(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),G=C(_()),K=l(),_t=C(Be(),1),vt=C(Ve(),1),yt=w({method:`GET`}).middleware([x]).handler(d(`0ccfae64b399b03d820328fa98a38e2caa0b622d3da5a7ca633c5a0e8101e3f6`)),bt=w({method:`GET`}).middleware([x]).handler(d(`3377db68b9d1d971971595469029c0466da0777a177b294d655cd0c039737f1a`)),xt=w({method:`GET`}).middleware([x]).handler(d(`af71e3c55a659ce46093e33b9d70e729359610eec7d576502e8f0e26c785b317`)),St=w({method:`POST`}).middleware([x]).handler(d(`4182bf9ccbb675700638f30bc6122517ccd90b16a339a6823a0f5f6c808d70a6`)),Ct=w({method:`POST`}).middleware([x]).handler(d(`98c10bdc514eb4d3fe65af546be44452b492a81092cfe45625778a4c9f731727`)),wt=w({method:`POST`}).middleware([x]).handler(d(`1371bff16085636e2c44b60a573ae434b556c63045c40a0a93a93ab69ec47999`)),q={all:[`remote-config`],active:[`remote-config`,`active`],versions:[`remote-config`,`versions`],version:e=>[`remote-config`,`version`,e],preview:e=>[`remote-config`,`preview`,e]},Tt=()=>g({queryKey:q.active,queryFn:()=>yt(),staleTime:6e4}),Et=({enabled:e})=>O({queryKey:q.versions,queryFn:({pageParam:e})=>bt({data:e===void 0?{}:{cursor:e}}),initialPageParam:void 0,getNextPageParam:e=>e.next,staleTime:6e4,enabled:e}),Dt=e=>g({queryKey:q.version(e??0),queryFn:()=>xt({data:{version:e}}),enabled:e!==null,staleTime:1/0}),Ot=()=>{let e=a();return async()=>{await Promise.all([e.invalidateQueries({queryKey:q.active}),e.invalidateQueries({queryKey:q.versions})])}},kt=()=>{let e=Ot();return re({mutationFn:e=>St({data:e}),onSuccess:async t=>{(t.status===`published`||t.status===`conflict`)&&await e()}})},At=()=>re({mutationFn:e=>Ct({data:e}),onSuccess:Ot()}),jt=e=>g({queryKey:q.preview(e),queryFn:()=>wt({data:e}),placeholderData:b,staleTime:1/0}),J={STRING:`String`,NUMBER:`Number`,BOOLEAN:`Boolean`,JSON:`JSON`},Y={platform:`Platform`,channel:`Channel`,appVersion:`App version`,percent:`Percentage of installs`,cohort:`Cohort`,fingerprint:`Fingerprint`,dateTime:`Date and time`},X=(e,t)=>e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0,Mt=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Nt=(e,t,n,r)=>{let i=Object.entries(e.parameters),a=t===null?-1:i.findIndex(([e])=>e===t),o=a===-1?[...i.filter(([e])=>e!==n),[n,r]]:i.map((e,t)=>t===a?[n,r]:e);return{...e,parameters:Object.fromEntries(o)}},Pt=(e,t)=>({...e,parameters:Object.fromEntries(Object.entries(e.parameters).filter(([e])=>e!==t))}),Ft=(e,t)=>Object.fromEntries(Object.entries(e.parameters).map(([e,n])=>{let{conditionalValues:r,...i}=n,a=Object.entries(r??{}).flatMap(([e,n])=>{let r=t(e);return r===null?[]:[[r,n]]});return[e,a.length===0?i:{...i,conditionalValues:Object.fromEntries(a)}]})),It=(e,t,n)=>t===null?{...e,conditions:[...e.conditions,n]}:{conditions:e.conditions.map(e=>e.name===t?n:e),parameters:t===n.name?e.parameters:Ft(e,e=>e===t?n.name:e)},Lt=(e,t)=>({conditions:e.conditions.filter(e=>e.name!==t),parameters:Ft(e,e=>e===t?null:e)}),Rt=(e,t,n)=>{let r=t+n;if(r<0||r>=e.conditions.length)return e;let i=[...e.conditions];return[i[t],i[r]]=[i[r],i[t]],{...e,conditions:i}},zt=(e,t)=>Object.entries(e.parameters).filter(([,e])=>X(e.conditionalValues,t)!==void 0).map(([e])=>e),Bt=(e,t=3)=>e.length<=t?e.join(`, `):`${e.slice(0,t).join(`, `)} +${e.length-t}`,Vt=e=>Number.isInteger(e)?String(e):e.toFixed(1),Ht=e=>{let t=new Intl.DateTimeFormat(`en`,{timeZone:e,timeZoneName:e===`UTC`?`short`:`shortOffset`,year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`});return e=>t.format(new Date(e))},Ut=Ht(`UTC`),Wt=(e=new Date)=>{let t=new Date(e);t.setMinutes(60,0,0);let n=new Date(e);n.setDate(n.getDate()+1),n.setHours(9,0,0,0);let r=new Date(e);return r.setSeconds(0,0),[{label:`Now`,iso:r.toISOString()},{label:`Next hour`,iso:t.toISOString()},{label:`Tomorrow 09:00`,iso:n.toISOString()}]},Gt=(e,t=new Date)=>{let n=e===void 0?t:new Date(e),r=e=>{let t=new Date(n);return t.setDate(t.getDate()+e),t.setSeconds(0,0),t.toISOString()};return[{label:`+1 day`,iso:r(1)},{label:`+1 week`,iso:r(7)}]},Kt=e=>{if(e===void 0)return``;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`},qt=e=>{if(e.length===0)return;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toISOString():void 0},Jt=(e,t=Ut)=>{switch(e.type){case`platform`:return`Platform is ${Bt(e.platforms.map(e=>e===`ios`?`iOS`:`Android`))}`;case`channel`:return`Channel is ${Bt(e.channels)}`;case`appVersion`:return`App version ${e.range}`;case`cohort`:return`Cohort is ${Bt(e.cohorts)}`;case`percent`:return e.from===0?`${Vt(e.to)}% of installs`:`${Vt(e.from)}–${Vt(e.to)}% of installs`;case`fingerprint`:return`Fingerprint is ${Bt(e.hashes.map(e=>e.slice(0,8)))}`;case`dateTime`:return e.from!==void 0&&e.to!==void 0?`From ${t(e.from)} until ${t(e.to)}`:e.from===void 0?`Until ${t(e.to??``)}`:`From ${t(e.from)}`}},Z=e=>`value`in e?e.value.length===0?`""`:e.value:`In-app default`,Yt=()=>{let e=crypto.getRandomValues(new Uint8Array(6));return Array.from(e,e=>e.toString(36).padStart(2,`0`)).join(``).slice(0,8)},Xt=(e,t)=>({added:Object.keys(t).filter(t=>!Object.hasOwn(e,t)),changed:Object.keys(t).filter(n=>Object.hasOwn(e,n)&&JSON.stringify(e[n])!==JSON.stringify(t[n])),removed:Object.keys(e).filter(e=>!Object.hasOwn(t,e))}),Zt=(e,t)=>{let n=e=>Object.fromEntries(e.conditions.map(e=>[e.name,e])),r=(e,t)=>e.conditions.map(({name:e})=>e).filter(e=>t.conditions.some(t=>t.name===e));return{parameters:Xt(e.parameters,t.parameters),conditions:Xt(n(e),n(t)),reordered:r(e,t).join(`
3
- `)!==r(t,e).join(`
4
- `)}},Q=`Not set`,Qt=(e,t)=>{let n=[],r=(e,t,r)=>{(t===null?r!==Q:t!==r)&&n.push({field:e,before:t,after:r})};r(`Type`,e===null?null:J[e.valueType],J[t.valueType]),r(`Default`,e===null?null:Z(e.defaultValue),Z(t.defaultValue));let i=new Set([...Object.keys(e?.conditionalValues??{}),...Object.keys(t.conditionalValues??{})]);for(let n of i){let i=X(e?.conditionalValues,n),a=X(t.conditionalValues,n);r(`When ${n}`,e===null?null:i===void 0?Q:Z(i),a===void 0?Q:Z(a))}return r(`Description`,e===null?null:e.description??Q,t.description??Q),n},$t=(e,t,n=Ut)=>{let r=e=>e.rules.map(e=>Jt(e,n)).join(` · `),i=r(t);if(e===null)return[{field:`Rules`,before:null,after:i}];let a=r(e);return a===i?[]:[{field:`Rules`,before:a,after:i}]},en=`hot-updater:remote-config-draft`,$=e=>typeof e==`object`&&!!e&&!Array.isArray(e),tn=e=>$(e)&&(typeof e.value==`string`||e.useInAppDefault===!0),nn=e=>$(e)&&$(e.parameters)&&Array.isArray(e.conditions)&&Object.values(e.parameters).every(e=>$(e)&&Object.hasOwn(J,String(e.valueType))&&tn(e.defaultValue)&&(e.conditionalValues===void 0||$(e.conditionalValues)&&Object.values(e.conditionalValues).every(tn)))&&e.conditions.every(e=>$(e)&&typeof e.name==`string`&&Array.isArray(e.rules)&&e.rules.every(e=>$(e)&&Object.hasOwn(Y,String(e.type)))),rn=e=>{try{let t=window.localStorage.getItem(en);if(t===null)return null;let n=JSON.parse(t);return!$(n)||n.baseVersion!==e.version||!nn(n.base)||!nn(n.template)||!Mt(n.base,e.template)||Mt(n.template,e.template)?null:{baseVersion:e.version,base:n.base,template:n.template}}catch{return null}},an=e=>{try{return e===null?window.localStorage.removeItem(en):window.localStorage.setItem(en,JSON.stringify(e)),!0}catch{return!1}},on=/^[A-Za-z_][A-Za-z0-9_]{0,255}$/u,sn=(e,t)=>e.length===0?`Enter a key.`:on.test(e)?t.includes(e)?`Another parameter uses this key.`:null:`Start with a letter or _, then use letters, digits, and _.`,cn=(e,t)=>{if(e===`NUMBER`)return t.trim().length>0&&Number.isFinite(Number(t))?null:`Enter a number.`;if(e===`JSON`)try{return JSON.parse(t),null}catch{return`Enter valid JSON.`}return e===`BOOLEAN`&&t!==`true`&&t!==`false`?`Choose true or false.`:null},ln=(e,t,n)=>{let r=e.map(e=>Jt(e,n)).join(` · `),i=r.length<=100?r:`${r.slice(0,99).trimEnd()}…`;if(i.length===0||!t.includes(i))return i;for(let e=2;;e+=1){let n=` (${e})`,r=`${i.slice(0,100-n.length)}${n}`;if(!t.includes(r))return r}},un=(e,t)=>{let n=e.trim();return n.length===0?`Enter a name.`:n.length>100?`Use 100 characters or fewer.`:t.includes(n)?`Another condition uses this name.`:null},dn=e=>[...new Set(e.split(/[\n,]/u).map(e=>e.trim()).filter(e=>e.length>0))],fn=e=>{switch(e.type){case`platform`:return e.platforms.length===0?`Choose a platform.`:null;case`channel`:return e.channels.length===0?`Enter a channel.`:null;case`appVersion`:return e.range.trim().length===0?`Enter a version range, such as >=1.4.0.`:null;case`cohort`:return e.cohorts.length===0?`Enter a cohort.`:null;case`percent`:return e.from>=e.to||e.from<0||e.to>100||Math.abs(e.to*10-Math.round(e.to*10))>1e-9||Math.abs(e.from*10-Math.round(e.from*10))>1e-9?`Use a range from 0 to 100 in steps of 0.1.`:null;case`fingerprint`:return e.hashes.length===0?`Enter a fingerprint.`:null;case`dateTime`:return e.from===void 0&&e.to===void 0?`Choose a start, an end, or both.`:e.from!==void 0&&e.to!==void 0&&e.from>=e.to?`End after the start.`:null}},pn=e=>{switch(e){case`platform`:return{type:e,platforms:[`ios`]};case`channel`:return{type:e,channels:[]};case`appVersion`:return{type:e,range:``};case`cohort`:return{type:e,cohorts:[]};case`percent`:return{type:e,seed:Yt(),from:0,to:10};case`fingerprint`:return{type:e,hashes:[]};case`dateTime`:return{type:e,from:Wt()[1].iso}}},mn=G.createContext(void 0);function hn(e=!0){let t=G.useContext(mn);if(t===void 0&&!e)throw Error(o(7));return t}function gn(e){let{render:n,className:r,style:a,state:o=i,props:s=u,refs:c=u,metadata:l,stateAttributesMapping:d,tag:f=`div`,...p}=e,{compositeProps:m,compositeRef:h}=Ze({metadata:l});return t(f,e,{state:o,ref:[...c,h],props:[m,...s,p],stateAttributesMapping:d})}var _n=G.forwardRef(function(e,n){let{className:i,defaultPressed:a=!1,disabled:o=!1,form:s,onPressedChange:c,pressed:l,render:u,type:d,value:p,nativeButton:m=!0,style:h,...g}=e,_=T(p||void 0),y=hn(),b=y?.value??[],x=y?void 0:a,S=(o||y?.disabled)??!1,[C,w]=D({controlled:y?_!==void 0&&b.indexOf(_)>-1:l,default:x,name:`Toggle`,state:`pressed`}),{getButtonProps:ee,buttonRef:te}=r({disabled:S,native:m}),E={disabled:S,pressed:C},O=[te,n],k=[{"aria-pressed":C,onClick(e){let t=!C,n=f(v,e.nativeEvent);_&&y?.setGroupValue?.(_,t,n),c?.(t,n),!n.isCanceled&&w(t)}},g,ee],ne=t(`button`,e,{enabled:!y,state:E,ref:O,props:k});return y?(0,K.jsx)(gn,{tag:`button`,render:u,className:i,style:h,state:E,refs:O,props:k}):ne}),vn=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),yn={multiple(e){return e?{[vn.multiple]:``}:null}},bn=G.forwardRef(function(e,n){let{defaultValue:r,disabled:i=!1,loopFocus:a=!0,onValueChange:o,orientation:s=`horizontal`,multiple:c=!1,value:l,className:d,render:f,style:p,...h}=e,g=Se(!0),_=G.useMemo(()=>l!==void 0||r!==void 0,[l,r]),v=(g?.disabled??!1)||i,[y,b]=D({controlled:l,default:l===void 0?r??u:void 0,name:`ToggleGroup`,state:`value`}),x=m((e,t,n)=>{let r;c?(r=y.slice(),t?r.push(e):r.splice(y.indexOf(e),1)):r=t?[e]:[],o?.(r,n),!n.isCanceled&&b(r)}),S={disabled:v,multiple:c,orientation:s},C=G.useMemo(()=>({disabled:v,orientation:s,setGroupValue:x,value:y,isValueInitialized:_}),[v,s,x,y,_]),w={role:`group`},T=t(`div`,e,{enabled:!!g,state:S,ref:n,props:[w,h],stateAttributesMapping:yn});return(0,K.jsx)(mn.Provider,{value:C,children:g?T:(0,K.jsx)(Je,{render:f,className:d,style:p,state:S,refs:[n],props:[w,h],stateAttributesMapping:yn,loopFocus:a,enableHomeAndEndKeys:!0,orientation:s})})}),xn=c(`group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-7 min-w-7 px-2 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,sm:`h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,lg:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),Sn=G.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function Cn({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,K.jsx)(bn,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:s(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,K.jsx)(Sn.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function wn({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=G.useContext(Sn);return(0,K.jsx)(_n,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:s(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,xn({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}function Tn(){let[e,t]=(0,G.useState)(`UTC`);return(0,G.useEffect)(()=>{t(Intl.DateTimeFormat().resolvedOptions().timeZone)},[]),{timeZone:e,dateTimeText:(0,G.useMemo)(()=>Ht(e),[e])}}var En=Object.keys(Y);function Dn({id:e,values:t,onChange:n,placeholder:r,multiline:i=!1}){let[a,o]=(0,G.useState)(t.join(`, `)),[s,c]=(0,G.useState)(t);s!==t&&(c(t),dn(a).join(`
5
- `)!==t.join(`
6
- `)&&o(t.join(`, `)));let l=e=>{o(e),n(dn(e))};return i?(0,K.jsx)(Fe,{className:`min-h-20 font-mono text-xs`,id:e,onChange:e=>l(e.target.value),placeholder:r,spellCheck:!1,value:a}):(0,K.jsx)(p,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:e,onChange:e=>l(e.target.value),placeholder:r,value:a})}function On({id:e,label:t,value:r,presets:i,onChange:a}){return(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:e,children:t}),(0,K.jsxs)(Re,{className:`h-11 sm:h-9`,children:[(0,K.jsx)(Ne,{className:`h-11 tabular-nums sm:h-9`,id:e,onChange:e=>a(qt(e.target.value)),type:`datetime-local`,value:Kt(r)}),r===void 0?null:(0,K.jsx)(Pe,{align:`inline-end`,children:(0,K.jsx)(Ie,{"aria-label":`Clear ${t.toLowerCase()}`,className:`size-11 sm:size-5`,onClick:()=>a(void 0),size:`icon-xs`,children:(0,K.jsx)(y,{})})})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,K.jsx)(n,{"aria-pressed":e.iso===r,className:`min-h-11 sm:min-h-6`,onClick:()=>a(e.iso),size:`xs`,type:`button`,variant:e.iso===r?`secondary`:`outline`,children:e.label},e.label))})]})}function kn({rule:e,onChange:t}){let r=(0,G.useId)(),i=fe();switch(e.type){case`platform`:return(0,K.jsx)(Cn,{"aria-label":`Platforms`,multiple:!0,onValueChange:n=>t({...e,platforms:n.filter(e=>e===`ios`||e===`android`)}),value:[...e.platforms],variant:`outline`,children:[`ios`,`android`].map(e=>(0,K.jsxs)(wn,{className:`min-h-11 px-3 sm:min-h-8`,value:e,children:[(0,K.jsx)(ve,{className:`size-3.5`,platform:e}),e===`ios`?`iOS`:`Android`]},e))});case`channel`:{let a=(i.data??[]).map(({name:e})=>e).filter(t=>!e.channels.includes(t));return(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(Dn,{id:`${r}-channels`,onChange:n=>t({...e,channels:n}),placeholder:`production, beta`,values:e.channels}),a.length>0?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Add:`}),a.slice(0,8).map(r=>(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-6`,onClick:()=>t({...e,channels:[...e.channels,r]}),size:`xs`,type:`button`,variant:`outline`,children:[(0,K.jsx)(R,{"data-icon":`inline-start`}),r]},r))]}):null]})}case`appVersion`:return(0,K.jsx)(p,{"aria-label":`App version range`,autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,onChange:n=>t({...e,range:n.target.value}),placeholder:`>=1.4.0`,value:e.range});case`cohort`:return(0,K.jsx)(Dn,{id:`${r}-cohorts`,onChange:n=>t({...e,cohorts:n}),placeholder:`1, 2, beta-testers`,values:e.cohorts});case`percent`:return(0,K.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[repeat(2,minmax(0,8rem))_minmax(0,1fr)]`,children:[(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-from`,children:`From %`}),(0,K.jsx)(p,{className:`min-h-11 tabular-nums sm:min-h-9`,id:`${r}-from`,inputMode:`decimal`,max:100,min:0,onChange:n=>t({...e,from:Number(n.target.value)}),step:.1,type:`number`,value:e.from})]}),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-to`,children:`To %`}),(0,K.jsx)(p,{className:`min-h-11 tabular-nums sm:min-h-9`,id:`${r}-to`,inputMode:`decimal`,max:100,min:0,onChange:n=>t({...e,to:Number(n.target.value)}),step:.1,type:`number`,value:e.to})]}),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-seed`,children:`Seed`}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(p,{autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,id:`${r}-seed`,onChange:n=>t({...e,seed:n.target.value}),value:e.seed}),(0,K.jsx)(n,{"aria-label":`New seed`,className:`size-11 sm:size-9`,onClick:()=>t({...e,seed:Yt()}),size:`icon`,type:`button`,variant:`outline`,children:(0,K.jsx)(Me,{})})]})]})]});case`fingerprint`:return(0,K.jsx)(Dn,{id:`${r}-hashes`,multiline:!0,onChange:n=>t({...e,hashes:n}),placeholder:`One fingerprint hash per line`,values:e.hashes});case`dateTime`:{let n=(n,r)=>{let{[n]:i,...a}=e;t(r===void 0?a:{...a,[n]:r})};return(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(On,{id:`${r}-from`,label:`From`,onChange:e=>n(`from`,e),presets:Wt(),value:e.from}),(0,K.jsx)(On,{id:`${r}-until`,label:`Until`,onChange:e=>n(`to`,e),presets:Gt(e.from),value:e.to})]})}}}var An={platform:`Devices on any of these platforms.`,channel:`Devices on any of these channels, separated by commas.`,appVersion:`A semver range of native app versions, as release targets use: 2.x, >=1.4.0 <2.0.0.`,percent:`Installs whose numeric cohort lands in this share. Rules with one seed split the same order, so 0–10 and 10–20 never overlap.`,cohort:`Numeric cohorts from 1 to 1000, or custom cohort names.`,fingerprint:`Native builds with any of these fingerprints.`,dateTime:`Leave either end empty to keep it open. Devices get the change at their next fetch.`};function jn({open:e,onOpenChange:t,condition:n,takenNames:r,onSave:i}){let a=Ue(e);return(0,K.jsx)(je,{onOpenChange:t,open:e,children:(0,K.jsx)(Oe,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto sm:max-w-xl`,children:(0,K.jsx)(Mn,{condition:n,onCancel:()=>t(!1),onSave:e=>{i(e),t(!1)},takenNames:r},a)})})}function Mn({condition:e,takenNames:t,onSave:r,onCancel:i}){let a=(0,G.useId)(),{dateTimeText:o,timeZone:s}=Tn(),[c,l]=(0,G.useState)(()=>e===null||e.name===ln(e.rules,t,o)?``:e.name),[u,d]=(0,G.useState)(e===null?[pn(`platform`)]:[...e.rules]),[f,m]=(0,G.useState)(!1),h=ln(u,t,o),g=c.trim().length===0?h:c,_=un(g,t),v=u.map(fn),y=En.filter(e=>!u.some(t=>t.type===e)),b=_!==null||u.length===0||v.some(e=>e!==null);return(0,K.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),m(!0),!b&&r({name:g.trim(),rules:u.map(e=>e.type===`appVersion`?{...e,range:e.range.trim()}:e)})},children:[(0,K.jsxs)(Te,{children:[(0,K.jsx)(ke,{children:e===null?`Add condition`:`Edit condition`}),(0,K.jsx)(Ae,{children:`A device matches when it matches every rule.`})]}),(0,K.jsxs)(at,{children:[(0,K.jsxs)(W,{"data-invalid":f&&_!==null||void 0,children:[(0,K.jsx)(H,{htmlFor:`${a}-name`,children:`Name`}),(0,K.jsx)(p,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:`${a}-name`,maxLength:101,onChange:e=>l(e.target.value),placeholder:h||`Beta testers on iOS`,value:c}),(0,K.jsx)(ot,{children:`Optional: without one, it is named after its rules.`}),(0,K.jsx)(U,{children:f?_:null})]}),(0,K.jsxs)(ct,{children:[(0,K.jsx)(st,{variant:`label`,children:`Rules`}),u.length===0?(0,K.jsx)(U,{children:f?`Add at least one rule.`:null}):null,(0,K.jsx)(`ol`,{className:`flex flex-col gap-3`,children:u.map((e,t)=>(0,K.jsx)(`li`,{className:`rounded-lg border p-3`,children:(0,K.jsxs)(W,{"data-invalid":f&&v[t]!==null||void 0,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:Y[e.type]}),(0,K.jsx)(n,{"aria-label":`Remove the ${Y[e.type].toLowerCase()} rule`,className:`size-11 sm:size-7`,onClick:()=>d(u.filter((e,n)=>n!==t)),size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,K.jsx)(He,{})})]}),(0,K.jsx)(kn,{onChange:e=>d(u.map((n,r)=>r===t?e:n)),rule:e}),(0,K.jsx)(ot,{children:e.type===`dateTime`?`In your time zone, ${s}. ${An.dateTime}`:An[e.type]}),(0,K.jsx)(U,{children:f?v[t]:null})]})},e.type))}),y.length>0?(0,K.jsxs)(Ce,{items:Object.fromEntries(y.map(e=>[e,Y[e]])),onValueChange:e=>{e!==null&&d([...u,pn(e)])},value:null,children:[(0,K.jsxs)(ye,{"aria-label":`Add a rule`,className:`min-h-11 w-full sm:min-h-9 sm:w-56`,children:[(0,K.jsx)(R,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(L,{placeholder:`Add a rule`})]}),(0,K.jsx)(be,{alignItemWithTrigger:!1,children:(0,K.jsx)(xe,{children:y.map(e=>(0,K.jsx)(I,{value:e,children:Y[e]},e))})})]}):null]})]}),(0,K.jsxs)(Ee,{children:[(0,K.jsx)(n,{onClick:i,type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsx)(n,{type:`submit`,children:e===null?`Add condition`:`Save condition`})]})]})}function Nn({condition:e,dateTimeText:t}){let n=e.rules.map(e=>Jt(e,t)).join(` · `);return n===e.name?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})}function Pn({template:e,onSaveCondition:t,onRemoveCondition:r,onMoveCondition:i}){let[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),l=z(a),u=z(s),{dateTimeText:d}=Tn(),{conditions:f}=e,p=l?.condition?.name??null,m=t=>{let n=zt(e,t);n.length===0?r(t):c({name:t,users:n})};return(0,K.jsxs)(he,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(_e,{className:`flex-row flex-wrap items-center justify-between gap-3 space-y-0 border-b px-4 py-3 sm:px-6`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(me,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Conditions`})}),(0,K.jsx)(pe,{className:`text-xs`,children:`Listed by priority: when several match a device, the first wins.`})]}),(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-7`,onClick:()=>o({condition:null}),children:[(0,K.jsx)(R,{"data-icon":`inline-start`}),`Add condition`]})]}),(0,K.jsx)(ge,{className:`p-0`,children:f.length===0?(0,K.jsxs)(it,{className:`py-10`,children:[(0,K.jsxs)(tt,{children:[(0,K.jsx)(et,{variant:`icon`,children:(0,K.jsx)(pt,{})}),(0,K.jsx)(rt,{children:`No conditions`}),(0,K.jsx)(V,{children:`Add a condition to give some devices other values: a platform, channel, app version range, cohort, or a share of installs.`})]}),(0,K.jsx)(nt,{children:(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-7`,onClick:()=>o({condition:null}),children:[(0,K.jsx)(R,{"data-icon":`inline-start`}),`Add condition`]})})]}):(0,K.jsx)(`ol`,{"aria-label":`Conditions`,className:`divide-y`,children:f.map((t,r)=>{let a=zt(e,t.name);return(0,K.jsxs)(`li`,{className:`grid gap-3 px-4 py-3 sm:px-6 md:grid-cols-[auto_minmax(0,1fr)_auto] md:items-center`,children:[(0,K.jsx)(`span`,{"aria-label":`Priority ${r+1}`,className:`flex size-6 items-center justify-center rounded-md bg-muted text-xs font-medium tabular-nums`,children:r+1}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:t.name}),(0,K.jsx)(Nn,{condition:t,dateTimeText:d}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:a.length===0?`No parameter uses it yet`:`Sets ${a.length===1?`1 parameter`:`${a.length} parameters`}: ${a.slice(0,3).join(`, `)}${a.length>3?`…`:``}`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-1 md:justify-end`,children:[(0,K.jsx)(n,{"aria-label":`Move ${t.name} up`,className:`size-11 md:size-7`,disabled:r===0,onClick:()=>i(r,-1),size:`icon`,variant:`ghost`,children:(0,K.jsx)(ut,{})}),(0,K.jsx)(n,{"aria-label":`Move ${t.name} down`,className:`size-11 md:size-7`,disabled:r===f.length-1,onClick:()=>i(r,1),size:`icon`,variant:`ghost`,children:(0,K.jsx)(lt,{})}),(0,K.jsxs)(n,{"aria-label":`Edit ${t.name}`,className:`min-h-11 md:min-h-7`,onClick:()=>o({condition:t}),size:`sm`,variant:`outline`,children:[(0,K.jsx)(ht,{"data-icon":`inline-start`}),`Edit`]}),(0,K.jsx)(n,{"aria-label":`Delete ${t.name}`,className:`size-11 md:size-7`,onClick:()=>m(t.name),size:`icon`,variant:`ghost`,children:(0,K.jsx)(He,{})})]})]},t.name)})})}),(0,K.jsx)(jn,{condition:l?.condition??null,onOpenChange:e=>{e||o(null)},onSave:e=>t(p,e),open:a!==null,takenNames:f.map(({name:e})=>e).filter(e=>e!==p)}),(0,K.jsx)(ue,{onOpenChange:e=>{e||c(null)},open:s!==null,children:(0,K.jsxs)(ie,{children:[(0,K.jsxs)(le,{children:[(0,K.jsxs)(ae,{children:[`Delete `,u?.name,`?`]}),(0,K.jsxs)(ne,{children:[u?.users.length===1?`1 parameter has a value for it`:`${u?.users.length} parameters have a value for it`,` `,`(`,u?.users.join(`, `),`). Those values are removed too, so matching devices get the default value after you publish.`]})]}),(0,K.jsxs)(se,{children:[(0,K.jsx)(ce,{children:`Cancel`}),(0,K.jsx)(oe,{onClick:e=>{e.preventDefault(),s!==null&&r(s.name),c(null)},variant:`destructive`,children:`Delete condition`})]})]})})]})}var Fn=e=>e===`BOOLEAN`?`false`:e===`NUMBER`?`0`:e===`JSON`?`{}`:``,In=(e,t)=>`value`in t?cn(e,t.value):null;function Ln({id:e,label:t,valueType:r,value:i,onChange:a,showErrors:o}){let s=!(`value`in i),c=`value`in i?i.value:``,l=o?In(r,i):null,u=e=>a({value:e});return(0,K.jsxs)(W,{"data-invalid":l!==null||void 0,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(H,{htmlFor:e,id:`${e}-label`,children:t}),(0,K.jsxs)(`div`,{className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground sm:min-h-0`,children:[(0,K.jsx)(Ge,{checked:s,id:`${e}-in-app-default`,onCheckedChange:e=>a(e?{useInAppDefault:!0}:{value:Fn(r)})}),(0,K.jsx)(`label`,{htmlFor:`${e}-in-app-default`,children:`Use in-app default`})]})]}),s?(0,K.jsxs)(`p`,{className:`rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground`,id:e,children:[`Devices keep the default set in the app's`,` `,(0,K.jsxs)(`code`,{className:`font-mono`,children:[`remoteConfig(`,`{ defaults }`,`)`]}),`.`]}):r===`BOOLEAN`?(0,K.jsxs)(Cn,{"aria-labelledby":`${e}-label`,id:e,onValueChange:e=>{let[t]=e;(t===`true`||t===`false`)&&u(t)},value:[c],variant:`outline`,children:[(0,K.jsx)(wn,{className:`min-h-11 px-4 sm:min-h-8`,value:`true`,children:`true`}),(0,K.jsx)(wn,{className:`min-h-11 px-4 sm:min-h-8`,value:`false`,children:`false`})]}):r===`NUMBER`?(0,K.jsx)(p,{"aria-invalid":l!==null||void 0,autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,id:e,inputMode:`decimal`,onChange:e=>u(e.target.value),value:c}):r===`JSON`?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(Fe,{"aria-invalid":l!==null||void 0,className:`min-h-24 font-mono text-xs`,id:e,onChange:e=>u(e.target.value),spellCheck:!1,value:c}),(0,K.jsxs)(n,{className:`self-start`,disabled:cn(`JSON`,c)!==null,onClick:()=>u(JSON.stringify(JSON.parse(c),null,2)),size:`sm`,type:`button`,variant:`outline`,children:[(0,K.jsx)(dt,{"data-icon":`inline-start`}),`Format JSON`]})]}):(0,K.jsx)(Fe,{"aria-invalid":l!==null||void 0,className:`min-h-11 text-sm sm:min-h-9`,id:e,onChange:e=>u(e.target.value),rows:2,value:c}),(0,K.jsx)(U,{children:l})]})}var Rn=Object.keys(J),zn={STRING:`getString`,NUMBER:`getNumber`,BOOLEAN:`getBoolean`,JSON:`getString`},Bn=(e,t)=>`value`in e&&In(t,e)!==null?{value:Fn(t)}:e;function Vn({open:e,onOpenChange:t,parameterKey:n,parameter:r,takenKeys:i,conditions:a,onSave:o,onAddCondition:s}){let c=Ue(e);return(0,K.jsx)(je,{onOpenChange:t,open:e,children:(0,K.jsx)(Oe,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto data-nested-dialog-open:after:absolute data-nested-dialog-open:after:inset-0 data-nested-dialog-open:after:rounded-xl data-nested-dialog-open:after:bg-background/70 sm:max-w-2xl`,children:(0,K.jsx)(Hn,{conditions:a,onAddCondition:s,onCancel:()=>t(!1),onSave:(e,n)=>{o(e,n),t(!1)},parameter:r,parameterKey:n,takenKeys:i},c)})})}function Hn({parameterKey:e,parameter:t,takenKeys:r,conditions:i,onSave:a,onCancel:o,onAddCondition:s}){let c=(0,G.useId)(),{dateTimeText:l}=Tn(),[u,d]=(0,G.useState)(e??``),[f,m]=(0,G.useState)(t?.valueType??`STRING`),[h,g]=(0,G.useState)(t?.description??``),_=h.trim().length>256,[v,b]=(0,G.useState)(t?.defaultValue??{value:``}),[x,S]=(0,G.useState)(t?.conditionalValues??{}),[C,w]=(0,G.useState)({}),[T,ee]=(0,G.useState)(!1),[te,E]=(0,G.useState)(!1),D=sn(u.trim(),r),O=i.filter(({name:e})=>X(x,e)!==void 0),k=i.filter(({name:e})=>X(x,e)===void 0),ne=D!==null||_||[v,...Object.values(x)].some(e=>In(f,e)!==null),re=e=>{m(e),b(Bn(v,e)),S(Object.fromEntries(Object.entries(x).map(([t,n])=>[t,Bn(n,e)])))},ie=e=>{let t=X(C,e);S({...x,[e]:t===void 0?{value:Fn(f)}:Bn(t,f)})},ae=e=>{let{[e]:t,...n}=x;t!==void 0&&w({...C,[e]:t}),S(n)};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:e=>{if(e.preventDefault(),ee(!0),ne)return;let t=Object.fromEntries(O.map(({name:e})=>[e,X(x,e)]));a(u.trim(),{valueType:f,defaultValue:v,...Object.keys(t).length===0?{}:{conditionalValues:t},...h.trim().length===0?{}:{description:h.trim()}})},children:[(0,K.jsxs)(Te,{children:[(0,K.jsx)(ke,{children:e===null?`Add parameter`:`Edit parameter`}),(0,K.jsxs)(Ae,{children:[`The app reads it with`,` `,(0,K.jsxs)(`code`,{className:`font-mono`,children:[`hotUpdater.remoteConfig.`,zn[f],`("`,u.trim()||`key`,`")`]}),`, which is null when neither the server nor the app's defaults have a value.`]})]}),(0,K.jsxs)(at,{children:[(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-[minmax(0,1fr)_11rem]`,children:[(0,K.jsxs)(W,{"data-invalid":T&&D!==null||void 0,children:[(0,K.jsx)(H,{htmlFor:`${c}-key`,children:`Key`}),(0,K.jsx)(p,{autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,id:`${c}-key`,maxLength:257,onChange:e=>d(e.target.value),placeholder:`welcome_message`,spellCheck:!1,value:u}),(0,K.jsx)(U,{children:T?D:null})]}),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${c}-type`,children:`Type`}),(0,K.jsxs)(Ce,{items:J,onValueChange:e=>{e!==null&&re(e)},value:f,children:[(0,K.jsx)(ye,{className:`min-h-11 w-full sm:min-h-9`,id:`${c}-type`,children:(0,K.jsx)(L,{})}),(0,K.jsx)(be,{children:(0,K.jsx)(xe,{children:Rn.map(e=>(0,K.jsx)(I,{value:e,children:J[e]},e))})})]})]})]}),(0,K.jsxs)(W,{"data-invalid":_||void 0,children:[(0,K.jsx)(H,{htmlFor:`${c}-description`,children:`Description`}),(0,K.jsx)(p,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:`${c}-description`,onChange:e=>g(e.target.value),placeholder:`Optional: what the app does with it`,value:h}),(0,K.jsx)(U,{children:_?`Use 256 characters or fewer.`:null})]}),(0,K.jsx)(Ln,{id:`${c}-default`,label:`Default value`,onChange:b,showErrors:T,value:v,valueType:f}),(0,K.jsxs)(ct,{children:[(0,K.jsx)(st,{variant:`label`,children:`Conditional values`}),(0,K.jsx)(ot,{children:`Devices that match a condition get its value. When several match, the first in the Conditions list wins. Removing a value keeps the condition, and its devices get the default value.`}),O.length>0?(0,K.jsx)(`ul`,{className:`flex flex-col gap-3`,children:O.map(e=>(0,K.jsxs)(`li`,{className:`rounded-lg border p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-start justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.name}),(0,K.jsx)(Nn,{condition:e,dateTimeText:l})]}),(0,K.jsxs)(n,{"aria-label":`Remove the value for ${e.name}`,className:`min-h-11 shrink-0 text-muted-foreground sm:min-h-7`,onClick:()=>ae(e.name),size:`sm`,type:`button`,variant:`ghost`,children:[(0,K.jsx)(y,{"data-icon":`inline-start`}),`Remove value`]})]}),(0,K.jsx)(Ln,{id:`${c}-${e.name}`,label:(0,K.jsxs)(K.Fragment,{children:[`Value`,(0,K.jsxs)(`span`,{className:`sr-only`,children:[` for `,e.name]})]}),onChange:t=>S({...x,[e.name]:t}),showErrors:T,value:X(x,e.name),valueType:f})]},e.name))}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[k.length>0?(0,K.jsxs)(Ce,{items:Object.fromEntries(k.map(({name:e})=>[e,e])),onValueChange:e=>{e!==null&&ie(e)},value:null,children:[(0,K.jsxs)(ye,{"aria-label":`Add a value for a condition`,className:`min-h-11 w-full sm:min-h-9 sm:w-64`,children:[(0,K.jsx)(R,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(L,{placeholder:`Add a value for a condition`})]}),(0,K.jsx)(be,{alignItemWithTrigger:!1,children:(0,K.jsx)(xe,{children:k.map(({name:e})=>(0,K.jsx)(I,{value:e,children:e},e))})})]}):null,(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-9`,onClick:()=>E(!0),type:`button`,variant:`outline`,children:[(0,K.jsx)(R,{"data-icon":`inline-start`}),`New condition`]})]})]})]}),(0,K.jsxs)(Ee,{children:[(0,K.jsx)(n,{onClick:o,type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsx)(n,{type:`submit`,children:e===null?`Add parameter`:`Save parameter`})]})]}),(0,K.jsx)(jn,{condition:null,onOpenChange:E,onSave:e=>{s(e),ie(e.name)},open:te,takenNames:i.map(({name:e})=>e)})]})}function Un({text:e}){return(0,K.jsx)(`span`,{className:`line-clamp-2 block min-w-0 break-words font-mono text-xs text-foreground`,title:e,children:e})}function Wn({parameterKey:e,parameter:t,conditions:r,onEdit:i,onRemove:a}){let o=r.filter(({name:e})=>X(t.conditionalValues,e)!==void 0);return(0,K.jsxs)(`li`,{className:`grid gap-3 px-4 py-3 sm:px-6 md:grid-cols-[minmax(0,15rem)_minmax(0,1fr)_auto] md:items-start`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate font-mono text-sm font-medium`,children:e}),(0,K.jsx)(F,{className:`shrink-0`,variant:`outline`,children:J[t.valueType]})]}),t.description===void 0?null:(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t.description})]}),(0,K.jsxs)(`dl`,{className:`grid min-w-0 grid-cols-[minmax(0,9rem)_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-xs`,children:[o.map(({name:e})=>(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`dt`,{className:`line-clamp-2 break-words text-muted-foreground`,title:e,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0`,children:(0,K.jsx)(Un,{text:Z(X(t.conditionalValues,e))})})]},e)),(0,K.jsx)(`dt`,{className:`text-muted-foreground`,children:`Default`}),(0,K.jsx)(`dd`,{className:`min-w-0`,children:`value`in t.defaultValue?(0,K.jsx)(Un,{text:Z(t.defaultValue)}):(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`In-app default`})})]}),(0,K.jsxs)(`div`,{className:`flex gap-1 md:justify-end`,children:[(0,K.jsxs)(n,{"aria-label":`Edit ${e}`,className:`min-h-11 md:min-h-7`,onClick:i,size:`sm`,variant:`outline`,children:[(0,K.jsx)(ht,{"data-icon":`inline-start`}),`Edit`]}),(0,K.jsx)(n,{"aria-label":`Delete ${e}`,className:`size-11 md:size-7`,onClick:a,size:`icon`,variant:`ghost`,children:(0,K.jsx)(He,{})})]})]})}function Gn({template:e,onSaveParameter:t,onRemoveParameter:r,onAddCondition:i}){let[a,o]=(0,G.useState)(null),s=z(a),[c,l]=(0,G.useState)(``),u=Object.keys(e.parameters),d=u.filter(e=>e.toLowerCase().includes(c.trim().toLowerCase())),f=s?.key??null;return(0,K.jsxs)(he,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(_e,{className:`flex-row flex-wrap items-center justify-between gap-3 space-y-0 border-b px-4 py-3 sm:px-6`,children:[(0,K.jsx)(me,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Parameters`})}),(0,K.jsxs)(`div`,{className:`flex w-full flex-wrap gap-2 sm:w-auto`,children:[u.length>5?(0,K.jsxs)(Re,{className:`min-h-11 w-full sm:min-h-8 sm:w-56`,children:[(0,K.jsx)(Pe,{children:(0,K.jsx)(ze,{"aria-hidden":`true`})}),(0,K.jsx)(Ne,{"aria-label":`Filter parameters by key`,className:`text-base sm:text-xs`,onChange:e=>l(e.target.value),placeholder:`Filter by key`,value:c})]}):null,(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-7`,onClick:()=>o({key:null,parameter:null}),children:[(0,K.jsx)(R,{"data-icon":`inline-start`}),`Add parameter`]})]})]}),(0,K.jsx)(ge,{className:`p-0`,children:u.length===0?(0,K.jsxs)(it,{className:`py-10`,children:[(0,K.jsxs)(tt,{children:[(0,K.jsx)(et,{variant:`icon`,children:(0,K.jsx)(We,{})}),(0,K.jsx)(rt,{children:`No parameters`}),(0,K.jsx)(V,{children:`Add a parameter, give it a default, then publish to change the app without a new build.`})]}),(0,K.jsx)(nt,{children:(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-7`,onClick:()=>o({key:null,parameter:null}),children:[(0,K.jsx)(R,{"data-icon":`inline-start`}),`Add parameter`]})})]}):d.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-center text-xs text-muted-foreground`,children:[(0,K.jsx)(`p`,{className:`font-medium text-foreground`,children:`No matching keys`}),(0,K.jsx)(n,{onClick:()=>l(``),size:`sm`,variant:`outline`,children:`Clear filter`})]}):(0,K.jsx)(`ul`,{"aria-label":`Parameters`,className:`divide-y`,children:d.map(t=>(0,K.jsx)(Wn,{conditions:e.conditions,onEdit:()=>o({key:t,parameter:e.parameters[t]??null}),onRemove:()=>r(t),parameter:e.parameters[t],parameterKey:t},t))})}),(0,K.jsx)(Vn,{conditions:e.conditions,onAddCondition:i,onOpenChange:e=>{e||o(null)},onSave:(e,n)=>t(f,e,n),open:a!==null,parameter:s?.parameter??null,parameterKey:f,takenKeys:u.filter(e=>e!==f)})]})}var Kn={platform:`ios`,channel:`production`,appVersion:`1.0.0`,cohort:`1`,fingerprintHash:``,at:``},qn=(e,t=300)=>{let[n,r]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n};function Jn({template:t,isDraft:n}){let r=(0,G.useId)(),[i,a]=(0,G.useState)(Kn),{at:o,...s}=qn(i),c=qt(o),l=jt({template:t,context:{...s,...c===void 0?{}:{now:Date.parse(c)}}}),u=Object.keys(t.parameters),d=(e,t)=>a({...i,[e]:t});return(0,K.jsxs)(he,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(_e,{className:`border-b px-4 py-3 sm:px-6`,children:[(0,K.jsx)(me,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Preview a device`})}),(0,K.jsx)(pe,{className:`text-xs`,children:n?`The values this device would get once your changes are published, now or at the time you pick.`:`The values this device gets from the active version, now or at the time you pick.`})]}),(0,K.jsxs)(ge,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:[(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-platform`,children:`Platform`}),(0,K.jsxs)(Ce,{items:{ios:`iOS`,android:`Android`},onValueChange:e=>{(e===`ios`||e===`android`)&&d(`platform`,e)},value:i.platform,children:[(0,K.jsx)(ye,{className:`min-h-11 w-full sm:min-h-9`,id:`${r}-platform`,children:(0,K.jsxs)(L,{children:[(0,K.jsx)(ve,{className:`size-3.5`,platform:i.platform}),i.platform===`ios`?`iOS`:`Android`]})}),(0,K.jsx)(be,{children:(0,K.jsxs)(xe,{children:[(0,K.jsxs)(I,{value:`ios`,children:[(0,K.jsx)(ve,{className:`size-3.5`,platform:`ios`}),`iOS`]}),(0,K.jsxs)(I,{value:`android`,children:[(0,K.jsx)(ve,{className:`size-3.5`,platform:`android`}),`Android`]})]})})]})]}),[[`channel`,`Channel`,`production`],[`appVersion`,`App version`,`1.0.0`],[`cohort`,`Cohort`,`1-1000 or a name`],[`fingerprintHash`,`Fingerprint`,`Optional`]].map(([e,t,n])=>(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-${e}`,children:t}),(0,K.jsx)(p,{autoComplete:`off`,className:`min-h-11 text-base sm:min-h-9 sm:text-xs`,id:`${r}-${e}`,onChange:t=>d(e,t.target.value),placeholder:n,spellCheck:!1,value:i[e]})]},e)),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-at`,children:`Time`}),(0,K.jsxs)(Re,{className:`h-11 sm:h-9`,children:[(0,K.jsx)(Ne,{className:`h-11 text-base tabular-nums sm:h-9 sm:text-xs`,id:`${r}-at`,onChange:e=>d(`at`,e.target.value),type:`datetime-local`,value:i.at}),i.at.length===0?null:(0,K.jsx)(Pe,{align:`inline-end`,children:(0,K.jsx)(Ie,{className:`min-h-11 sm:min-h-6`,onClick:()=>d(`at`,``),size:`xs`,children:`Now`})})]})]})]}),u.length===0?(0,K.jsx)(it,{className:`border py-8`,children:(0,K.jsxs)(tt,{children:[(0,K.jsx)(et,{variant:`icon`,children:(0,K.jsx)(Ke,{})}),(0,K.jsx)(rt,{children:`Nothing to preview`}),(0,K.jsx)(V,{children:`Add a parameter, and its value for this device shows here.`})]})}):l.data?.status===`invalid`?(0,K.jsxs)(N,{variant:`destructive`,children:[(0,K.jsx)(j,{}),(0,K.jsx)(A,{children:`The draft has problems to fix first`}),(0,K.jsx)(M,{children:(0,K.jsx)(`ul`,{className:`list-disc pl-4`,children:l.data.issues.slice(0,5).map(e=>(0,K.jsxs)(`li`,{children:[e.path===``?``:`${e.path}: `,e.message]},`${e.path}:${e.message}`))})})]}):l.isError?(0,K.jsxs)(N,{variant:`destructive`,children:[(0,K.jsx)(j,{}),(0,K.jsx)(A,{children:`The preview couldn't be loaded`}),(0,K.jsx)(M,{children:`Check the connection, then change a field to try again.`})]}):l.data===void 0?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:`Loading the preview`}),u.slice(0,4).map(t=>(0,K.jsx)(e,{className:`h-8 w-full`},t))]}):(0,K.jsx)(`dl`,{"aria-busy":l.isFetching||void 0,className:`divide-y rounded-lg border`,children:u.map(e=>{let t=l.data.status===`ok`?l.data.parameters[e]:void 0;return(0,K.jsxs)(`div`,{className:`grid gap-1 px-3 py-2.5 sm:grid-cols-[minmax(0,14rem)_minmax(0,1fr)_auto] sm:items-center sm:gap-3`,children:[(0,K.jsx)(`dt`,{className:`truncate font-mono text-xs font-medium`,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0 truncate font-mono text-xs`,children:t===void 0?`…`:t.value===null?(0,K.jsx)(`span`,{className:`font-sans text-muted-foreground`,children:`In-app default`}):(0,K.jsx)(`span`,{title:t.value,children:t.value.length===0?`""`:t.value})}),(0,K.jsx)(`dd`,{children:t?.condition===void 0?null:t.condition===null?(0,K.jsx)(F,{variant:`outline`,children:`Default value`}):(0,K.jsx)(F,{variant:`secondary`,children:t.condition})})]},e)})})]})]})}function Yn({name:e,fields:t}){return(0,K.jsxs)(`li`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`break-words font-mono`,children:e}),t.length===0?null:(0,K.jsx)(`ul`,{className:`mt-0.5 flex flex-col gap-0.5`,children:t.map(e=>(0,K.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:e.field}),e.before===null?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`max-w-full truncate font-mono line-through decoration-muted-foreground/60`,title:e.before,children:e.before}),(0,K.jsx)(de,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`to`})]}),(0,K.jsx)(`span`,{className:`max-w-full truncate font-mono text-foreground`,title:e.after,children:e.after})]},e.field))})]})}function Xn({label:e,changes:t,describe:n}){let r=[[`Added`,t.added],[`Changed`,t.changed],[`Removed`,t.removed]];return r.every(([,e])=>e.length===0)?null:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:e}),(0,K.jsx)(`dl`,{className:`mt-1 grid grid-cols-[5rem_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs`,children:r.map(([e,t])=>t.length===0?null:(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0`,children:e===`Removed`?(0,K.jsx)(`span`,{className:`break-words font-mono`,children:t.join(`, `)}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:t.map(e=>(0,K.jsx)(Yn,{fields:n(e),name:e},e))})})]},e))})]})}function Zn({open:e,onOpenChange:t,base:r,baseVersion:i,draft:a,onPublished:o,onLoadLatest:s,onPublishOver:c}){let l=(0,G.useId)(),u=kt(),[d,f]=(0,G.useState)(``),[m,h]=(0,G.useState)(null),{dateTimeText:g}=Tn(),_=Zt(r,a),v=e=>{let t=Object.hasOwn(r.parameters,e)?r.parameters[e]:null,n=Object.hasOwn(a.parameters,e)?a.parameters[e]:null;return n===null?[]:Qt(t,n)},y=e=>{let t=r.conditions.find(t=>t.name===e)??null,n=a.conditions.find(t=>t.name===e)??null;return n===null?[]:$t(t,n,g)},b=d.trim().length>256,x=e=>{u.isPending||(t(e),e||(h(null),u.reset()))};return(0,K.jsx)(je,{onOpenChange:x,open:e,children:(0,K.jsx)(Oe,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto sm:max-w-lg`,children:(0,K.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:async e=>{if(e.preventDefault(),!b)try{let e=await u.mutateAsync({template:a,baseVersion:i,...d.trim().length===0?{}:{description:d.trim()}});h(e),e.status===`published`&&(B.success(`Published version ${e.version.version}`),f(``),h(null),t(!1),o())}catch(e){B.error(e instanceof Error?e.message:`Unable to publish`)}},children:[(0,K.jsxs)(Te,{children:[(0,K.jsx)(ke,{children:`Publish changes`}),(0,K.jsxs)(Ae,{children:[`This becomes version `,i+1,`. Devices get its values on their next fetch; earlier versions stay available to roll back to.`]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,K.jsx)(Xn,{changes:_.parameters,describe:v,label:`Parameters`}),(0,K.jsx)(Xn,{changes:_.conditions,describe:y,label:`Conditions`}),_.reordered?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Condition priority changed.`}):null]}),m?.status===`invalid`?(0,K.jsxs)(N,{variant:`destructive`,children:[(0,K.jsx)(j,{}),(0,K.jsx)(A,{children:`The server refused the template`}),(0,K.jsx)(M,{children:(0,K.jsx)(`ul`,{className:`list-disc pl-4`,children:m.issues.slice(0,6).map(e=>(0,K.jsxs)(`li`,{children:[e.path===``?``:`${e.path}: `,e.message]},`${e.path}:${e.message}`))})})]}):null,m?.status===`conflict`?(0,K.jsxs)(N,{children:[(0,K.jsx)(j,{}),(0,K.jsxs)(A,{children:[`Version `,m.currentVersion,` was published while you edited`]}),(0,K.jsx)(M,{children:`Load it to review what changed, or publish yours after it, replacing its values.`}),(0,K.jsxs)(`div`,{className:`col-span-full mt-2 flex flex-wrap gap-2`,children:[(0,K.jsxs)(n,{onClick:()=>{x(!1),s()},size:`sm`,type:`button`,variant:`outline`,children:[`Load version `,m.currentVersion]}),(0,K.jsx)(n,{onClick:()=>{c(m.currentVersion),h(null)},size:`sm`,type:`button`,variant:`ghost`,children:`Publish mine after it`})]})]}):null,(0,K.jsxs)(W,{"data-invalid":b||void 0,children:[(0,K.jsx)(H,{htmlFor:`${l}-description`,children:`Description`}),(0,K.jsx)(p,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:`${l}-description`,onChange:e=>f(e.target.value),placeholder:`What changed and why`,value:d}),(0,K.jsx)(ot,{children:`Shown in the version history.`}),(0,K.jsx)(U,{children:b?`Use 256 characters or fewer.`:null})]}),(0,K.jsxs)(Ee,{children:[(0,K.jsx)(n,{disabled:u.isPending,onClick:()=>x(!1),type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsxs)(n,{disabled:u.isPending||m?.status===`conflict`,type:`submit`,children:[u.isPending?(0,K.jsx)(De,{className:`animate-spin`,"data-icon":`inline-start`}):(0,K.jsx)(gt,{"data-icon":`inline-start`}),`Publish version `,i+1]})]})]})})})}function Qn({ms:e}){let t=new Date(e);return(0,K.jsx)(`time`,{className:`tabular-nums`,dateTime:t.toISOString(),title:`${t.toISOString().replace(`T`,` `).slice(0,19)} UTC`,children:(0,_t.default)(e).format(`YYYY/MM/DD HH:mm`)})}function $n({open:t,version:r,onOpenChange:i}){let a=Dt(r),o=a.data===null||a.data===void 0?null:JSON.stringify(a.data.template,null,2);return(0,K.jsx)(je,{onOpenChange:i,open:t,children:(0,K.jsxs)(Oe,{className:`max-h-[calc(100svh-2rem)] grid-rows-[auto_minmax(0,1fr)] sm:max-w-2xl`,children:[(0,K.jsxs)(Te,{children:[(0,K.jsxs)(ke,{children:[`Version `,r]}),(0,K.jsx)(Ae,{children:`The template as it was published, in the JSON the admin API takes.`})]}),a.isLoading?(0,K.jsx)(e,{className:`h-48 w-full`}):a.isError?(0,K.jsxs)(N,{variant:`destructive`,children:[(0,K.jsx)(j,{}),(0,K.jsx)(A,{children:`This version couldn't be loaded`}),(0,K.jsx)(M,{children:`Check the connection and try again.`}),(0,K.jsx)(P,{children:(0,K.jsxs)(n,{onClick:()=>void a.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(Me,{"data-icon":`inline-start`}),`Retry`]})})]}):o===null?(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Version `,r,` no longer exists.`]}):(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-2`,children:[(0,K.jsx)(`pre`,{className:`min-h-0 overflow-auto rounded-md bg-muted p-3 font-mono text-xs`,children:o}),(0,K.jsxs)(n,{className:`self-end`,onClick:()=>{navigator.clipboard.writeText(o).then(()=>B.success(`Template JSON copied`),()=>B.error(`Unable to copy the template`))},size:`sm`,variant:`outline`,children:[(0,K.jsx)(we,{"data-icon":`inline-start`}),`Copy JSON`]})]})]})})}function er({activeVersion:t,hasDraft:r,onRolledBack:i,onStartEditing:a}){let o=Et({enabled:!0}),s=At(),[c,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(null),f=z(c),p=z(u),m=o.data?.pages.flatMap(e=>e.versions)??[],h=async e=>{if(e.preventDefault(),u!==null)try{let e=await s.mutateAsync({version:u.source,baseVersion:u.next-1});e.status===`published`?(B.success(`Version ${e.version.version} restores version ${u.source}`),i()):e.status===`conflict`?B.error(`Version ${e.currentVersion} was published meanwhile. Review it, then roll back again.`):B.error(`That version no longer exists.`),d(null)}catch(e){B.error(e instanceof Error?e.message:`Unable to roll back`)}};return(0,K.jsxs)(he,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsx)(_e,{className:`border-b px-4 py-3 sm:px-6`,children:(0,K.jsx)(me,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Versions`})})}),(0,K.jsx)(ge,{className:`p-0`,children:o.isError?(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsxs)(N,{variant:`destructive`,children:[(0,K.jsx)(j,{}),(0,K.jsx)(A,{children:`Versions couldn't be loaded`}),(0,K.jsx)(M,{children:`Check the connection and try again.`}),(0,K.jsx)(P,{children:(0,K.jsxs)(n,{onClick:()=>void o.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(Me,{"data-icon":`inline-start`}),`Retry`]})})]})}):o.isLoading?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:`Loading versions`}),Array.from({length:3},(t,n)=>(0,K.jsx)(e,{className:`h-10 w-full`},n))]}):m.length===0?(0,K.jsxs)(it,{className:`py-10`,children:[(0,K.jsxs)(tt,{children:[(0,K.jsx)(et,{variant:`icon`,children:(0,K.jsx)(mt,{})}),(0,K.jsx)(rt,{children:`No versions yet`}),(0,K.jsx)(V,{children:`Your first publish becomes version 1. Every publish after it is kept here, ready to roll back to.`})]}),(0,K.jsx)(nt,{children:(0,K.jsx)(n,{className:`min-h-11 sm:min-h-7`,onClick:a,children:`Add a parameter`})})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`ol`,{"aria-label":`Versions`,className:`divide-y`,children:m.map(e=>(0,K.jsxs)(`li`,{className:`grid gap-2 px-4 py-3 sm:px-6 md:grid-cols-[minmax(0,1fr)_auto] md:items-center`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`span`,{className:`text-sm font-medium tabular-nums`,children:[`Version `,e.version]}),e.version===t?(0,K.jsx)(F,{children:`Active`}):null,e.updateType===`ROLLBACK`?(0,K.jsxs)(F,{variant:`outline`,children:[`Rollback to v`,e.rollbackSource]}):null]}),(0,K.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[(0,K.jsx)(Qn,{ms:e.createdAtMs}),e.description===null||e.updateType===`ROLLBACK`&&e.description===`Rollback to version ${e.rollbackSource}`?null:(0,K.jsxs)(K.Fragment,{children:[` · `,e.description]})]})]}),(0,K.jsxs)(`div`,{className:`flex gap-1 md:justify-end`,children:[(0,K.jsxs)(n,{"aria-label":`View version ${e.version}`,className:`min-h-11 md:min-h-7`,onClick:()=>l(e.version),size:`sm`,variant:`ghost`,children:[(0,K.jsx)(ft,{"data-icon":`inline-start`}),`View`]}),(0,K.jsxs)(n,{"aria-label":`Roll back to version ${e.version}`,className:`min-h-11 md:min-h-7`,disabled:e.version===t,onClick:()=>d({source:e.version,next:t+1}),size:`sm`,variant:`outline`,children:[(0,K.jsx)(Le,{"data-icon":`inline-start`}),`Roll back`]})]})]},e.version))}),o.hasNextPage?(0,K.jsx)(`div`,{className:`border-t px-4 py-3 sm:px-6`,children:(0,K.jsxs)(n,{className:`min-h-11 w-full sm:min-h-7 sm:w-auto`,disabled:o.isFetchingNextPage,onClick:()=>void o.fetchNextPage(),variant:`outline`,children:[o.isFetchingNextPage?(0,K.jsx)(De,{className:`animate-spin`,"data-icon":`inline-start`}):null,`Load older versions`]})}):null]})}),(0,K.jsx)($n,{onOpenChange:e=>{e||l(null)},open:c!==null,version:f}),(0,K.jsx)(ue,{onOpenChange:e=>{!s.isPending&&!e&&d(null)},open:u!==null,children:(0,K.jsxs)(ie,{children:[(0,K.jsxs)(le,{children:[(0,K.jsxs)(ae,{children:[`Roll back to version `,p?.source,`?`]}),(0,K.jsxs)(ne,{children:[`Version `,p?.next,` will publish a copy of version`,` `,p?.source,`, and devices get its values on their next fetch.`,r?` Your unpublished changes are discarded.`:``]})]}),(0,K.jsxs)(se,{children:[(0,K.jsx)(ce,{disabled:s.isPending,children:`Cancel`}),(0,K.jsxs)(oe,{disabled:s.isPending,onClick:e=>void h(e),children:[s.isPending?(0,K.jsx)(De,{className:`animate-spin`,"data-icon":`inline-start`}):(0,K.jsx)(Le,{"data-icon":`inline-start`}),`Roll back`]})]})]})})]})}_t.default.extend(vt.default);var tr=[`parameters`,`conditions`,`preview`,`versions`];function nr({tab:t,onTabChange:r}){let i=Tt(),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(!1),[d,f]=(0,G.useState)(!1),p=i.data,m=a?.template??p?.template,h=a!==null&&p!==void 0&&!Mt(a.template,p.template),g=h&&p!==void 0&&a.baseVersion!==p.version;(0,G.useEffect)(()=>{if(s||p===void 0)return;c(!0);let e=rn(p);e!==null&&(o(e),u(!0))},[p,s]),(0,G.useEffect)(()=>{if(a===null||!h||an(a))return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[a,h]);let _=()=>{o(null),u(!1),an(null)},v=e=>{p===void 0||m===void 0||(u(!1),o({baseVersion:a?.baseVersion??p.version,base:a?.base??p.template,template:e(m)}))},y={parameters:m===void 0?null:Object.keys(m.parameters).length,conditions:m?.conditions.length??null};return(0,K.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,K.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b bg-background px-3 py-3 sm:min-h-12 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,K.jsx)(S,{className:`-ml-1 size-11 lg:size-7`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(We,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,K.jsx)(`h1`,{className:`text-sm font-medium`,children:`Remote Config`})]}),p===void 0?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p.version===0?`Nothing published yet`:(0,K.jsxs)(K.Fragment,{children:[`Version `,p.version,p.updatedAtMs===null?null:(0,K.jsxs)(K.Fragment,{children:[` · published `,(0,K.jsx)(`time`,{dateTime:new Date(p.updatedAtMs).toISOString(),title:(0,_t.default)(p.updatedAtMs).format(`YYYY/MM/DD HH:mm:ss`),children:(0,_t.default)(p.updatedAtMs).fromNow()})]})]})}),h?(0,K.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,K.jsx)(F,{className:`hidden sm:inline-flex`,variant:`secondary`,children:`Unpublished changes`}),(0,K.jsxs)(n,{className:`min-h-11 lg:min-h-7`,onClick:_,variant:`ghost`,children:[(0,K.jsx)(qe,{"data-icon":`inline-start`}),`Discard`]}),(0,K.jsxs)(n,{className:`min-h-11 lg:min-h-7`,onClick:()=>f(!0),children:[(0,K.jsx)(gt,{"data-icon":`inline-start`}),`Publish changes`]})]}):null]}),(0,K.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4`,children:[i.isError?(0,K.jsxs)(N,{variant:`destructive`,children:[(0,K.jsx)(j,{}),(0,K.jsx)(A,{children:`Remote Config couldn't be loaded`}),(0,K.jsx)(M,{children:`Check the connection and try again.`}),(0,K.jsx)(P,{children:(0,K.jsxs)(n,{onClick:()=>void i.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(Me,{"data-icon":`inline-start`}),`Retry`]})})]}):null,l&&h&&a!==null?(0,K.jsxs)(N,{children:[(0,K.jsx)(mt,{}),(0,K.jsx)(A,{children:`Your unpublished changes are back`}),(0,K.jsxs)(M,{children:[`This browser kept them from your last visit, on version`,` `,a.baseVersion,`.`]}),(0,K.jsx)(P,{children:(0,K.jsx)(n,{onClick:_,size:`xs`,variant:`outline`,children:`Discard them`})})]}):null,g&&a!==null&&p!==void 0?(0,K.jsxs)(N,{children:[(0,K.jsx)(j,{}),(0,K.jsxs)(A,{children:[`Version `,p.version,` was published while you edited`]}),(0,K.jsxs)(M,{children:[`Your draft started from version `,a.baseVersion,`. Discard it to review version `,p.version,`, or publish yours after it.`]}),(0,K.jsx)(P,{children:(0,K.jsxs)(n,{onClick:_,size:`xs`,variant:`outline`,children:[`Load version `,p.version]})})]}):null,(0,K.jsxs)($e,{onValueChange:e=>r(e),value:t,children:[(0,K.jsx)(Qe,{"aria-label":`Remote Config views`,className:`max-w-full group-data-horizontal/tabs:h-auto`,children:[[`parameters`,`Parameters`,y.parameters],[`conditions`,`Conditions`,y.conditions],[`preview`,`Preview`,null],[`versions`,`Versions`,null]].map(([e,t,n])=>(0,K.jsxs)(Ye,{className:`min-h-11 flex-none px-3 lg:min-h-7`,value:e,children:[t,n===null?null:(0,K.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:n})]},e))}),m===void 0||p===void 0?i.isError?null:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 pt-2`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:`Loading Remote Config`}),(0,K.jsx)(e,{className:`h-14 w-full`}),(0,K.jsx)(e,{className:`h-14 w-full`}),(0,K.jsx)(e,{className:`h-14 w-full`})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Xe,{value:`parameters`,children:(0,K.jsx)(Gn,{onAddCondition:e=>v(t=>It(t,null,e)),onRemoveParameter:e=>v(t=>Pt(t,e)),onSaveParameter:(e,t,n)=>v(r=>Nt(r,e,t,n)),template:m})}),(0,K.jsx)(Xe,{value:`conditions`,children:(0,K.jsx)(Pn,{onMoveCondition:(e,t)=>v(n=>Rt(n,e,t)),onRemoveCondition:e=>v(t=>Lt(t,e)),onSaveCondition:(e,t)=>v(n=>It(n,e,t)),template:m})}),(0,K.jsx)(Xe,{value:`preview`,children:(0,K.jsx)(Jn,{isDraft:h,template:m})}),(0,K.jsx)(Xe,{value:`versions`,children:(0,K.jsx)(er,{activeVersion:p.version,hasDraft:h,onRolledBack:_,onStartEditing:()=>r(`parameters`)})})]})]})]})}),p!==void 0&&a!==null?(0,K.jsx)(Zn,{base:p.template,baseVersion:a.baseVersion,draft:a.template,onLoadLatest:_,onOpenChange:f,onPublishOver:e=>o({...a,baseVersion:e,base:p.template}),onPublished:_,open:d}):null]})}var rr=E(`/remote-config`)({beforeLoad:({context:e})=>ee(e.queryClient,`remoteConfig`),notFoundComponent:k(()=>te(()=>import(`./remote-config-ikg7kak0.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`notFoundComponent`),component:k(()=>te(()=>import(`./remote-config-DzOOiBIO.js`),__vite__mapDeps([7,2])),`component`),validateSearch:e=>tr.includes(e.tab)&&e.tab!==`parameters`?{tab:e.tab}:{}});export{nr as n,rr as t};
@@ -1 +0,0 @@
1
- import{Ur as e}from"./sidebar-BqX460IW.js";import{n as t,t as n}from"./remote-config-D9X3NiwV.js";var r=e();function i(){let{tab:e=`parameters`}=n.useSearch(),i=n.useNavigate();return(0,r.jsx)(t,{onTabChange:e=>void i({search:e===`parameters`?{}:{tab:e},replace:!0}),tab:e})}export{i as component};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-C0KfsKWL.js";var t=e;export{t as notFoundComponent};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-P7683vKQ.js","assets/sidebar-BqX460IW.js","assets/useCompositeListItem-B-UkrDlu.js","assets/console-features-api-DPE4C06Y.js","assets/alert-dialog-BtVg50WQ.js","assets/select-M3H2gxCc.js","assets/badge-Bqf3UDee.js","assets/switch-By_vfm8I.js","assets/valueToPercent-B44vDssN.js","assets/api-DoicFJfd.js","assets/circle-off-BsbZQtsF.js","assets/HashValueDisplay-BGkDPaYi.js","assets/dist-dDj-R6uh.js","assets/list-Dtj7TtzV.js","assets/dialog-CGKPxz3n.js","assets/input-group-B4nrqIh0.js","assets/insights-search-aT8BVCci.js","assets/insights-api-1ZjVu3Sb.js","assets/field-GxF9SyUo.js","assets/table-ek1DmRHq.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,In as t,Ln as n,Ur as r,Wr as i,ar as a,cr as o,et as s,nr as c,rr as l}from"./sidebar-BqX460IW.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-DPE4C06Y.js";import{a as ee,c as m,s as h}from"./useCompositeListItem-B-UkrDlu.js";import{_ as g,m as _,s as v,x as y}from"./insights-api-1ZjVu3Sb.js";import{d as b,l as x,o as S,s as C,u as w}from"./badge-Bqf3UDee.js";import{t as T}from"./key-round-B4fI1psK.js";import{s as te}from"./switch-By_vfm8I.js";import{_ as E,n as D}from"./insights-search-aT8BVCci.js";var O=a(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),k=a(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),A=r(),j={apiKeys:{navigation:{icon:(0,A.jsx)(T,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/api-keys`,onClick:e})}}},M=l({method:`GET`}).middleware([c]).handler(i(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return o({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(E,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:t,loading:r=!1,input:i,variant:a=`inline`}){if(!t)return r?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:I(t),c=(0,A.jsx)(`dl`,{className:n(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:e,field:r,color:i})=>(0,A.jsxs)(`div`,{className:n(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsxs)(`dd`,{className:n(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[r]>0&&!(r===`downloads`&&o)?i:`text-muted-foreground`),children:[r===`downloads`&&o?(0,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):t[r].toLocaleString(),r===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(t),`)`]}):null]})]},r))});return(0,A.jsxs)(`div`,{className:n(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,A.jsx)(f,{className:`min-w-0 rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,to:`/insights`,search:{platform:i.platform,channel:i.channel,releaseId:i.releaseId,bundleWindow:D(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let r=v({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),i=r.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:n(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,g(_(i)),`)`]})]})]})}):r.isPending?(0,A.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(E,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:e}){let n=N([e]);return(0,A.jsxs)(S,{children:[(0,A.jsxs)(w,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(b,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(C,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:e,loading:n.isFetching,report:n.data?.[e.releaseId]}),(0,A.jsx)(s,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(x,{className:`px-4 pb-4`,children:(0,A.jsxs)(f,{className:t({variant:`outline`,size:`sm`}),to:`/insights`,search:{platform:e.platform,channel:e.channel,releaseId:e.releaseId,bundleWindow:D(e.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(O,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return d(`insightsAnalytics`)?null:(0,A.jsxs)(S,{children:[(0,A.jsx)(w,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(b,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(C,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function H({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var U={Cell:H},W={insights:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(f,{to:`/insights`,onClick:t}):(0,A.jsx)(f,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:U,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},G={remoteConfig:{navigation:{icon:(0,A.jsx)(te,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/remote-config`,onClick:e})}}},K={...W,...j,...G},q=Object.keys(p),J=()=>{let e=u().data?.features;return e===void 0?[]:q.flatMap(t=>{let n=K[t];return n!==void 0&&e[t]?[{...n,feature:t,label:p[t].label,features:e}]:[]})},Y=()=>J().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function X({release:e}){return J().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var Z=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Q(e){let t=Z(e.beforeReleaseId),n=t?void 0:Z(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=Z(e.bundleId),a=i?void 0:Z(e.scopeKey),o=i||a?void 0:Z(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:Z(e.releaseId),scopeKey:a}}function $(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function ne(e){return $(e).kind!==`all`}function re(e,t){let n={...e,...t};return t.bundleId?Q({bundleId:n.bundleId}):t.scopeKey?Q({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Q({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Q({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var ie=m(`/`)({component:h(()=>ee(()=>import(`./routes-P7683vKQ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),`component`),validateSearch:Q});export{X as a,k as c,re as i,ne as n,J as o,$ as r,Y as s,ie as t};
@@ -1 +0,0 @@
1
- import{$ as e,$n as t,Bn as n,F as r,Fn as i,Gt as a,H as o,I as s,In as c,Jn as l,Jt as u,Kt as d,L as f,Ln as p,M as m,P as h,R as g,U as _,Un as v,Ur as y,Ut as b,Wn as x,Xn as S,Xt as C,Yn as w,Yt as ee,Z as T,Zn as E,_ as te,an as ne,ar as D,b as re,bn as ie,ei as ae,er as oe,et as se,g as ce,h as le,ir as O,ln as k,lt as ue,mn as de,p as fe,qt as pe,ri as me,sr as A,tn as he,ut as j,v as ge,vn as _e,w as M,xn as N,y as P,yn as ve}from"./sidebar-BqX460IW.js";import{l as F}from"./console-features-api-DPE4C06Y.js";import{i as ye,n as I,o as be,r as xe}from"./useCompositeListItem-B-UkrDlu.js";import{a as L,i as R,l as z,n as Se,o as B,r as Ce,s as V,t as H}from"./alert-dialog-BtVg50WQ.js";import{a as we,c as Te,d as U,f as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le}from"./api-DoicFJfd.js";import{a as Re,c as W,i as ze,n as G,r as Be,s as Ve,t as He}from"./routes-9rb9P5Y7.js";import{a as Ue,c as We,d as Ge,f as Ke,i as qe,n as Je,o as Ye,p as Xe,s as Ze,t as K,u as Qe}from"./badge-Bqf3UDee.js";import{n as $e,t as et}from"./circle-off-BsbZQtsF.js";import{A as tt,D as nt,E as rt,M as it,N as at,P as ot,T as st,a as ct,d as lt,f as ut,h as dt,i as ft,m as q,n as pt,o as mt,r as ht,t as gt}from"./select-M3H2gxCc.js";import{r as _t,t as vt}from"./HashValueDisplay-BGkDPaYi.js";import{t as yt}from"./list-Dtj7TtzV.js";import{a as bt,c as xt,i as St,l as Ct,n as wt,o as Tt,r as Et,s as Dt,t as Ot}from"./dialog-CGKPxz3n.js";import{a as kt,i as At,n as jt,o as Mt,s as Nt,t as Pt}from"./input-group-B4nrqIh0.js";import{a as Ft,i as It,n as Lt,o as Rt,t as zt}from"./switch-By_vfm8I.js";import{n as Bt}from"./dist-dDj-R6uh.js";import{_ as Vt,c as Ht,d as Ut,f as Wt,g as Gt,h as Kt,l as qt,m as Jt,o as Yt,s as Xt,u as Zt}from"./insights-search-aT8BVCci.js";import{a as Qt,c as $t,i as en,n as tn,r as nn,t as rn}from"./field-GxF9SyUo.js";import{a as an,i as J,n as on,o as sn,r as Y,t as cn}from"./table-ek1DmRHq.js";import{i as ln,n as un,t as dn}from"./valueToPercent-B44vDssN.js";var fn=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),pn=D(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),mn=D(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),hn=D(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),gn=D(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),_n=D(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),vn=D(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),yn=A();function bn(){return v}function xn(){return!1}function Sn(){return!0}function Cn(){return(0,yn.useSyncExternalStore)(bn,xn,Sn)}var X=me(ae(),1),Z=y(),wn={production:`bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20`,dev:`bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20`,staging:`bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20`};function Tn({channel:e,className:t}){return(0,Z.jsx)(K,{variant:`outline`,className:p(wn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function En({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(Xe,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(gn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(O,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Dn=me(Ft(),1),On=me(It(),1);Dn.default.extend(On.default);function kn({uuid:e,format:t=`relative`}){let n=(0,Dn.default)(Yt(e));return t===`relative`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function An({panelId:t,bundle:n,bundles:r,loading:a,onDetailClick:o}){let s=le();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):r.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),s?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Z.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(kn,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>o(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(cn,{className:`min-w-max`,children:[(0,Z.jsx)(an,{children:(0,Z.jsxs)(sn,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(J,{children:`Target artifact ID`}),(0,Z.jsx)(J,{children:`Relation`}),(0,Z.jsx)(J,{children:`Artifact`}),(0,Z.jsx)(J,{children:`Created`}),(0,Z.jsx)(J,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Z.jsx)(on,{children:r.map(e=>(0,Z.jsxs)(sn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Z.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(kn,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>o(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function jn({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=Lt(a),{data:c=[],isPending:l}=Oe(),u=Me(),d=Fe(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?Bt.success(`Channel ${e.row.name} created`):Bt.info(`Channel ${e.row.name} already exists`)}catch(e){Bt.error(`Failed to create channel`),console.error(e)}},m=async()=>{if(!(!a||d.isPending))try{let e=await d.mutateAsync({id:a.id});e.deleted?Bt.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?Bt.error(`Channel ${a.name} is still in use and cannot be deleted`):Bt.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){Bt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ot,{open:e,onOpenChange:t,children:(0,Z.jsxs)(wt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(bt,{children:[(0,Z.jsxs)(Tt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_n,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(Et,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:p,children:(0,Z.jsx)(en,{className:`gap-2`,children:(0,Z.jsxs)(rn,{orientation:`horizontal`,children:[(0,Z.jsx)(Qt,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(T,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:u.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!f||u.isPending,children:[u.isPending?(0,Z.jsx)(Ct,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(xt,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(Ct,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):c.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:c.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,Z.jsx)(i,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:d.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(Rt,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(H,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(L,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Se,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Mn=`[a-zA-Z0-9-]`,Nn=String.raw`0|[1-9]\d*`,Pn=String.raw`\d+`,Fn=String.raw`\d*[a-zA-Z-]${Mn}*`,In=String.raw`(${Nn})\.(${Nn})\.(${Nn})`,Ln=String.raw`(${Pn})\.(${Pn})\.(${Pn})`,Rn=`(?:${Fn}|${Nn})`,zn=`(?:${Fn}|${Pn})`,Bn=String.raw`(?:-(${Rn}(?:\.${Rn})*))`,Vn=String.raw`(?:-?(${zn}(?:\.${zn})*))`,Hn=`${Mn}+`,Un=String.raw`(?:\+(${Hn}(?:\.${Hn})*))`,Wn=`v?${In}${Bn}?${Un}?`,Gn=String.raw`[v=\s]*${Ln}${Vn}?${Un}?`,Kn=`((?:<|>)?=?)`,qn=String.raw`${Nn}|x|X|\*`,Jn=String.raw`${Pn}|x|X|\*`,Yn=String.raw`[v=\s]*(${qn})(?:\.(${qn})(?:\.(${qn})(?:${Bn})?${Un}?)?)?`,Xn=String.raw`[v=\s]*(${Jn})(?:\.(${Jn})(?:\.(${Jn})(?:${Vn})?${Un}?)?)?`,Zn=`(?:~>?)`,Qn=String.raw`(?:\^)`,$n=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${$n}(?:$|[^\d])`,String.raw`${$n}(?:${Bn})?(?:${Un})?(?:$|[^\d])`;function er(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Mn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(er(e),t)}var tr=Q(`^${Wn}$`),nr=Q(`^${Gn}$`),rr=/^\d+$/;function ir(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function ar(e,t={}){if(typeof e!=`string`)return e;if(e.length>256)throw TypeError(`Version exceeds the maximum length of 256 characters`);let n=e.trim().match(t.loose?nr:tr);if(!n)throw TypeError(`Invalid version syntax: ${e}`);let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(r>2**53-1||r<0)throw TypeError(`Invalid major version: ${n[1]}`);if(i>2**53-1||i<0)throw TypeError(`Invalid minor version: ${n[2]}`);if(a>2**53-1||a<0)throw TypeError(`Invalid patch version: ${n[3]}`);let o=n[4]?n[4].split(`.`).map(e=>{if(rr.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var or=Q(String.raw`^${Kn}\s*(${Wn})$|^$`),sr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function cr(e){return e.version?`${e.operator}${ir(e.version)}`:``}function lr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?sr:or);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?ar(r[2],t):null;return{operator:i,options:t,value:a?`${i}${ir(a)}`:``,version:a}}function ur(e){return e.sets.map(e=>e.map(cr).join(` `)).join(`||`)}var dr=new RegExp(Un,`g`),fr=Q(Un),pr=Q(String.raw`^\s*(${Yn})\s+-\s+(${Yn})\s*$`),mr=Q(String.raw`^\s*(${Xn})\s+-\s+(${Xn})\s*$`),hr=Q(String.raw`(\s*)${Kn}\s*(${Gn}|${Yn})`,`g`),gr=Q(String.raw`(\s*)${Zn}\s+`,`g`),_r=Q(String.raw`(\s*)${Qn}\s+`,`g`),vr=Q(`^${Zn}${Yn}$`),yr=Q(`^${Zn}${Xn}$`),br=Q(`^${Qn}${Yn}$`),xr=Q(`^${Qn}${Xn}$`),Sr=Q(String.raw`^${Kn}\s*${Yn}$`),Cr=Q(String.raw`^${Kn}\s*${Xn}$`),wr=Q(String.raw`(<|>)?=?\s*\*`),Tr=/^\s*>=\s*0\.0\.0\s*$/,Er=/^\s*>=\s*0\.0\.0-0\s*$/,Dr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Or(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function kr(e,t){let n=t.loose?yr:vr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`)}function Ar(e,t){return e.trim().split(/\s+/).map(e=>kr(e,t)).join(` `)}function jr(e,t){let n=t.loose?xr:br,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function Mr(e,t){return e.trim().split(/\s+/).map(e=>jr(e,t)).join(` `)}function Nr(e,t){let n=t.loose?Cr:Sr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Or(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function Pr(e,t){return e.split(/\s+/).map(e=>Nr(e,t)).join(` `)}function Fr(e,t){let n=t.loose?mr:pr;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n,m=c;return p=$(r)?``:$(i)?`>=${r}.0.0${t.includePrerelease?`-0`:``}`:$(a)?`>=${r}.${i}.0${t.includePrerelease?`-0`:``}`:o?`>=${p}`:`>=${p}${t.includePrerelease?`-0`:``}`,m=$(l)?``:$(u)?`<${Number(l)+1}.0.0-0`:$(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t.includePrerelease?`<${l}.${u}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()})}function Ir(e,t){return Pr(Ar(Mr(e.replace(fr,``),t),t),t).trim().replace(wr,``)}function Lr(e,t){let n=Fr(e.replace(dr,``),t).replace(hr,`$1$2$3`).replace(gr,`$1~`).replace(_r,`$1^`).split(` `).map(e=>Ir(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Er:Tr,``));t.loose&&(n=n.filter(e=>Dr.test(e)));let r=new Map;for(let e of n.map(e=>lr(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Rr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Lr(e.trim(),n)).filter(e=>e.length);if(!i.length)throw TypeError(`Range contains no valid comparator sets: ${r}`);if(i.length>1){let e=i[0];if(i=i.filter(e=>e[0]?.value!==`<0.0.0-0`),!i.length)i=[e];else if(i.length>1){let e=i.find(e=>e.length===1&&e[0]?.value===``);e&&(i=[e])}}return{options:n,sets:i}}function zr(e,t={}){try{return Rr(e,t)}catch{return null}}function Br(e,t={}){let n=zr(e,t);return n?ur(n)||`*`:null}var Vr=e=>{let t=e.trim();if(t.startsWith(`git@`)){let e=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(e)return`https://${e[1]}/${e[2]}`}if(t.startsWith(`ssh://`))try{let e=new URL(t);return`https://${e.hostname}${e.pathname}`.replace(/\/+$/,``).replace(/\.git$/,``)}catch{return t.replace(/\/+$/,``).replace(/\.git$/,``)}return t.replace(/\/+$/,``).replace(/\.git$/,``)},Hr=(e,t)=>{if(!e?.trim())return null;let n=Vr(e);try{let{hostname:e}=new URL(n);if(e.includes(`gitlab`))return`${n}/-/commit/${t}`;if(e.includes(`bitbucket`))return`${n}/commits/${t}`}catch{}return`${n}/commit/${t}`};function Ur({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function Wr({bundle:e,release:t}){let{data:n,isFetched:r}=we(),i=e?Wt(e):null,a=e?Ut(e):null,o=e?.gitCommitHash&&r?Hr(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(Ye,{children:[(0,Z.jsx)(Qe,{className:`p-4 pb-3`,children:(0,Z.jsx)(Ge,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Ze,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Ur,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(Ur,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(vt,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(pn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Ur,{label:`Manifest hash`,value:(0,Z.jsx)(vt,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Ur,{label:`Base hash`,value:(0,Z.jsx)(vt,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Ur,{label:`Patch hash`,value:(0,Z.jsx)(vt,{maxLength:16,value:i})}):null]})})]}):null}var Gr=Array.from({length:Ht},(e,t)=>t+1);function Kr({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Gt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===Ht,l=le(),u=c?Gr:s?Gr.filter(t=>qt(e,t)<r):[],d=(r/10).toFixed(1),f=c?Ht:u.length,p=Ht-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(Ye,{children:(0,Z.jsxs)(Qe,{className:`p-4`,children:[(0,Z.jsx)(We,{children:`Selected cohorts`}),(0,Z.jsx)(Ge,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(Ye,{children:(0,Z.jsxs)(Qe,{className:`p-4`,children:[(0,Z.jsx)(We,{children:`Excluded cohorts`}),(0,Z.jsx)(Ge,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(Ye,{children:[(0,Z.jsxs)(Qe,{className:`p-4 pb-3`,children:[(0,Z.jsx)(Ge,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(We,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Ze,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:a.map(e=>(0,Z.jsx)(K,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(Ye,{children:[(0,Z.jsx)(Qe,{className:`p-4 pb-3`,children:(0,Z.jsx)(Ge,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Ze,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(K,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Ot,{children:[(0,Z.jsxs)(Dt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(yt,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(wt,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(bt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Tt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Et,{children:[d,`% includes `,f,` of`,` `,Ht,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(St,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(Tt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Et,{children:[d,`% includes `,f,` of`,` `,Ht,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(St,{showCloseButton:!0})]})})]})}function qr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Jr(e,t){return e-t}function Yr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Jr)}function Xr(e,t,n,r,i,a){let o=e;return o=q(o,n,r),i&&(o=Yr(a,t,q(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Zr(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var Qr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...it},$r=X.createContext(void 0);function ei(){let e=X.useContext($r);if(e===void 0)throw Error(l(62));return e}function ti(e){return`key`in e?k:ne}function ni(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?qr(e,t):!1}var ri=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:h=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:b=`horizontal`,step:x=1,thumbCollisionBehavior:w=`push`,thumbAlignment:T=`center`,value:te,style:ne,...D}=e,re=j(c),ae=lt(re),oe=E(v),se=E(y),{clearErrors:ce}=dt(),{state:le,disabled:O,name:k,setTouched:ue,setDirty:de,validityData:fe,shouldValidateOnChange:me,validation:A}=tt(),{labelId:he}=rt(),[ge,_e]=X.useState(),N=r??ut(he,ge),P=O||s,F=k??_,[I,be]=ye({controlled:te,default:o??m,name:`Slider`}),L=X.useRef(null),R=X.useRef(null),z=X.useRef([]),Se=X.useRef(null),B=X.useRef(null),Ce=X.useRef(-1),V=X.useRef(null),H=X.useRef(null),we=X.useRef(`none`),Te=pe(l),[U,Ee]=X.useState(-1),[De,Oe]=X.useState(-1),[ke,Ae]=X.useState(!1),[je,Me]=X.useState(()=>new Map),[Ne,Pe]=X.useState([void 0,void 0]),Fe=E(e=>{Ee(e),e!==-1&&Oe(e)});nt(R,re,I),M(I,()=>{ce(F),me()?A.commit(I):A.commit(I,!0);let e=fe.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!qr(I,e):I!==e,de(t)});let Ie=E(e=>{e&&(R.current=e)}),Le=Array.isArray(I),Re=X.useMemo(()=>Le?I.slice().sort(Jr):[q(I,m,p)],[p,m,Le,I]),W=E((e,t)=>{if(Number.isNaN(e)||ni(e,I))return;let n=t??ee(`none`,void 0,void 0,{activeThumbIndex:-1});we.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:F}}),n.event=i,H.current=e,oe(e,n),!n.isCanceled&&be(e)}),ze=E((e,t,n)=>{let r=Xr(e,t,m,p,Le,Re);if(Zr(r,x,h)){let e=ti(n);W(r,ee(e,n.nativeEvent,void 0,{activeThumbIndex:t})),ue(!0),se(H.current??r,C(e,n.nativeEvent))}});S(()=>{let e=ve(a(L.current));P&&ie(L.current,e)&&e.blur()},[P]),P&&U!==-1&&Fe(-1);let G=X.useMemo(()=>({...le,activeThumbIndex:U,disabled:P,dragging:ke,orientation:b,max:p,min:m,minStepsBetweenValues:h,step:x,values:Re}),[le,U,P,ke,p,m,h,b,x,Re]),Be=X.useMemo(()=>({active:U,controlRef:R,disabled:P,dragging:ke,validation:A,formatOptionsRef:Te,handleInputChange:ze,indicatorPosition:Ne,inset:T!==`center`,labelId:N,rootLabelId:ae,largeStep:u,lastUsedThumbIndex:De,lastChangedValueRef:H,lastChangeReasonRef:we,form:g,locale:d,max:p,min:m,minStepsBetweenValues:h,name:F,onValueCommitted:se,orientation:b,pressedInputRef:Se,pressedThumbCenterOffsetRef:B,pressedThumbIndexRef:Ce,pressedValuesRef:V,registerFieldControlRef:Ie,renderBeforeHydration:T===`edge`,setActive:Fe,setDragging:Ae,setIndicatorPosition:Pe,setLabelId:_e,setValue:W,state:G,step:x,thumbCollisionBehavior:w,thumbMap:je,thumbRefs:z,values:Re}),[U,R,N,ae,P,ke,A,Te,ze,Ne,u,De,H,we,g,d,p,m,h,F,se,b,Se,B,Ce,V,Ie,Fe,Ae,Pe,_e,W,G,x,w,T,je,z,Re]),Ve=n(`div`,e,{state:G,ref:[t,L],props:[{"aria-labelledby":N,id:re,role:`group`},A.getValidationProps,D],stateAttributesMapping:Qr});return(0,Z.jsx)($r.Provider,{value:Be,children:(0,Z.jsx)(xe,{elementsRef:z,onMapChange:Me,children:Ve})})});function ii(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ai(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function oi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ai(t),ai(n))))}function si({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=q(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=q(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=q(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ci({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=q(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=si({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=q(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:si({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=q(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var li=2;function ui(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function di(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var fi=X.forwardRef(function(e,r){let{render:i,className:o,style:s,...c}=e,{disabled:l,dragging:f,inset:p,lastChangedValueRef:m,lastChangeReasonRef:h,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:S,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:te,renderBeforeHydration:ne,setActive:D,setDragging:re,setValue:ae,state:se,step:ce,thumbCollisionBehavior:le,thumbRefs:O,values:k}=ei(),fe=ue(),me=k.length>1,A=b===`vertical`,j=X.useRef(null),ge=X.useRef(null),_e=E(e=>{e&&ge.current==null&&(ge.current=t(e).getComputedStyle(e))}),M=X.useRef(null),P=X.useRef(0),F=X.useRef(0),ye=pe(k);function I(e){w.current!==e&&(w.current=e);let t=O.current[e];if(!t){S.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function be(e){let t=j.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=ui(ge.current,A),c=F.current,l=(A?r:n)-s.start-s.end-c*2,u=S.current??0,d=e.x-u,f=e.y-u,p=q(((A?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=oi(m,ce,_),m=q(m,_,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let y=ci({behavior:le,values:k,currentValues:ye.current??k,initialValues:T.current,pressedIndex:h,nextValue:m,min:_,max:g,step:ce,minStepsBetweenValues:v});return le===`swap`&&y.didSwap?I(y.thumbIndex):w.current=y.thumbIndex,y}function xe(e){T.current=me?k.slice():null,ye.current=k;let t=w.current,n=t;if(t>-1&&t<k.length){if(k[t]===g){let e=t;for(;e>0&&k[e-1]===g;)--e;n=e}}else{let t=A?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(oe(a)){let o=ii(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&I(n),p){let e=O.current[n];oe(e)&&(F.current=e.getBoundingClientRect()[A?`height`:`width`]/2)}}function L(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let R=E(e=>{let t=di(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){z(e);return}let n=be(t);n!=null&&Zr(n.value,ce,v)&&(!f&&P.current>li&&re(!0),ae(n.value,ee(he,e,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))});function z(e){D(-1),re(!1),x.current=null,S.current=null;let t=di(e,M),n=t==null?null:be(t);if(n!=null){let t=h.current;y(m.current??n.value,C(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),w.current=-1,M.current=null,T.current=null,B()}let Se=E(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=di(e,M);if(n!=null){xe(n);let t=be(n);if(t==null)return;L(t.thumbIndex),ae(t.value,ee(de,e,void 0,{activeThumbIndex:t.thumbIndex})),ye.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&L(t.thumbIndex)}P.current=0;let r=a(j.current);r.addEventListener(`touchmove`,R,{passive:!0}),r.addEventListener(`touchend`,z,{passive:!0})}),B=E(()=>{let e=a(j.current);e.removeEventListener(`pointermove`,R),e.removeEventListener(`pointerup`,z),e.removeEventListener(`touchmove`,R),e.removeEventListener(`touchend`,z),T.current=null}),Ce=d();return X.useEffect(()=>{let e=j.current;if(!e)return()=>B();let t=u(e,`touchstart`,Se,{passive:!0});return()=>{t(),Ce.cancel(),B()}},[B,Se,j,Ce]),X.useEffect(()=>{l&&B()},[l,B]),n(`div`,e,{state:se,ref:[r,te,j,_e],props:[{"data-base-ui-slider-control":ne?``:void 0,onPointerDown(e){let t=j.current,n=N(e.nativeEvent);if(!t||l||e.defaultPrevented||!oe(n)||e.button!==0)return;let r=di(e,M);if(r!=null){xe(r);let n=be(r);if(n==null)return;ie(O.current[n.thumbIndex],ve(a(t)))?e.preventDefault():Ce.request(()=>{L(n.thumbIndex)}),re(!0),S.current??(ae(n.value,ee(de,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),P.current=0;let i=a(j.current);i.addEventListener(`pointermove`,R,{passive:!0}),i.addEventListener(`pointerup`,z,{once:!0})}},c],stateAttributesMapping:Qr})}),pi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=ei();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Qr})}),mi=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),hi=new Set([...f,_,o]);function gi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${un(e[t],r,n)} start range`:`${un(e[t],r,n)} end range`:n?un(e[t],r,n):void 0}function _i(e,t,n,r,i){let a=n===1?e+t:e-t;return q(Number(a.toFixed(Math.max(ai(e),ai(t),ai(r)))),r,i)}var vi=X.forwardRef(function(e,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:v=!1,getAriaLabel:y,getAriaValueText:C,id:ee,index:T,inputRef:te,onBlur:ne,onFocus:D,onKeyDown:re,tabIndex:ie,style:ae,...oe}=e,{nonce:se}=ot(),ce=j(ee),{active:le,lastUsedThumbIndex:O,controlRef:k,disabled:de,validation:fe,formatOptionsRef:pe,handleInputChange:me,inset:A,labelId:he,largeStep:ge,locale:M,max:N,min:P,minStepsBetweenValues:ve,form:F,name:ye,orientation:be,pressedInputRef:xe,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:R,renderBeforeHydration:z,setActive:Se,setIndicatorPosition:B,state:Ce,step:V,values:H}=ei(),we=ue(),Te=v||de,U=H.length>1,Ee=be===`vertical`,De=we===`rtl`,{setTouched:Oe,setFocused:ke,validationMode:Ae}=tt(),je=X.useRef(null),Me=X.useRef(null),Ne=X.useRef(!1),Pe=j(),Fe=st(),Ie=U?Pe:Fe,{ref:Le,index:Re}=I({metadata:X.useMemo(()=>({inputId:Ie}),[Ie])}),W=U?T??Re:0,ze=W===H.length-1,G=H[W],Be=dn(G,P,N),[Ve,He]=X.useState(),Ue=Cn(),We=O>=0&&O<H.length?O:-1,Ge=E(()=>{let e=k.current,t=je.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ee?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Be/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;He(s),W===0?B(e=>[s,e[1]]):ze&&B(e=>[e[0],s])});S(()=>{A&&queueMicrotask(Ge)},[Ge,A]),S(()=>{A&&Ge()},[Ge,A,Be]),S(()=>{if(!A)return;let e=k.current,n=je.current;if(!e||!n)return;let r=t(e).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ge);return i.observe(e),i.observe(n),()=>{i.disconnect()}},[k,Ge,A]);let Ke=Ee?`bottom`:`insetInlineStart`,qe=Ee?`left`:`top`,Je;U?le===W?Je=2:We===W&&(Je=1):le===W&&(Je=1);let Ye;Ye=A?{"--position":`${Ve??0}%`,visibility:z&&Ue||Ve===void 0?`hidden`:void 0,position:`absolute`,[Ke]:`var(--position)`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:Number.isFinite(Be)?{position:`absolute`,[Ke]:`${Be}%`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:b;let Xe;be===`vertical`&&(Xe=De?`vertical-rl`:`vertical-lr`);let Ze=typeof y==`function`?y(W):d,K=w({"aria-label":Ze,"aria-labelledby":p??(Ze==null?he:void 0),"aria-describedby":u,"aria-orientation":be,"aria-valuenow":G,"aria-valuetext":typeof C==`function`?C(un(G,M,pe.current??void 0),G,W):gi(H,W,pe.current??void 0,M),disabled:Te,form:F,id:Ie,max:N,min:P,name:ye,onChange(e){me(e.currentTarget.valueAsNumber,W,e)},onFocus(e){let t=Ne.current;Ne.current=!1,Se(W),ke(!0),t&&e.stopPropagation()},onBlur(e){if(Ne.current){e.stopPropagation();return}je.current&&(Se(-1),Oe(!0),ke(!1),Ae===`onBlur`&&fe.commit(Xr(G,W,P,N,U,H)))},onKeyDown(e){if(!hi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=oi(G,V,P);switch(e.key){case s:t=_i(n,e.shiftKey?ge:V,1,P,N);break;case r:t=_i(n,e.shiftKey?ge:V,De?-1:1,P,N);break;case m:t=_i(n,e.shiftKey?ge:V,-1,P,N);break;case h:t=_i(n,e.shiftKey?ge:V,De?1:-1,P,N);break;case _:t=_i(n,ge,1,P,N);break;case o:t=_i(n,ge,-1,P,N);break;case`End`:t=N,U&&(t=Number.isFinite(H[W+1])?H[W+1]-V*ve:N);break;case g:t=P,U&&(t=Number.isFinite(H[W-1])?H[W-1]+V*ve:P);break;default:break}if(t!==null){let n=e.currentTarget;_e(n)||(Ne.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),me(t,W,e),e.preventDefault()}},step:V,style:{...b,width:`100%`,height:`100%`,writingMode:Xe},tabIndex:ie??void 0,type:`range`,value:G??``},fe.getInputValidationProps),Qe=x(Me,fe.inputRef,te);return n(`div`,e,{state:Ce,ref:[i,Le,je],props:[{[mi.index]:W,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:Qe,...K,suppressHydrationWarning:!0}),A&&Ue&&z&&ze&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:ce,onBlur:ne,onFocus:D,onPointerDown(e){if(R.current=W,je.current!=null){let t=be===`horizontal`?`x`:`y`,n=ii(je.current);L.current=(be===`horizontal`?e.clientX:e.clientY)-n[t]}Me.current!=null&&xe.current!==Me.current&&(xe.current=Me.current)},style:Ye,suppressHydrationWarning:z||void 0},oe],stateAttributesMapping:Qr})});function yi(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function bi(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var xi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=ei(),h=Cn(),g=d===`vertical`,_=m.length>1,v=c?yi(g,_,s[0],s[1],f,h):bi(g,_,dn(m[0],u,l),dn(m[m.length-1],u,l));return n(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Qr})});function Si({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=Array.isArray(n)?n:n===void 0?Array.isArray(t)?t:t===void 0?[r]:[t]:[n];return(0,Z.jsx)(ri,{className:p(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(fi,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(pi,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-primary/20 select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5`,children:(0,Z.jsx)(xi,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(vi,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ci=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],wi=e=>({enabled:e.enabled,message:e.message??``,rolloutCohortCount:e.rollout_cohort_count,shouldForceUpdate:e.should_force_update,targetAppVersion:e.target_app_version??``,targetCohorts:[...e.target_cohorts]}),Ti=(e,t)=>({enabled:t.enabled,message:t.message.trim()||null,rolloutCohortCount:t.rolloutCohortCount,shouldForceUpdate:t.shouldForceUpdate,...e.strategy===`APP_VERSION`?{targetAppVersion:t.targetAppVersion.trim()}:{},targetCohorts:t.targetCohorts}),Ei=e=>(e/10).toFixed(1),Di=e=>{let t=e.replace(`,`,`.`),[n=``,...r]=t.split(`.`),i=n.replace(/\D/g,``).slice(0,3),a=r.join(``).replace(/\D/g,``).slice(0,1);return t.includes(`.`)?`${i}.${a}`:i},Oi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function ki({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ei(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ei(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Si,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(Pt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(At,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Oi(n)??e;a(!1),r(Ei(i)),t(i)},onChange:e=>{let n=Di(e.target.value);r(n);let i=Oi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(jt,{align:`inline-end`,children:(0,Z.jsx)(kt,{children:`%`})})]})]})}function Ai({channels:t,onOpenChange:n,onShowScope:r,open:a,releaseId:o}){let s=Ee(o),c=s.data,l=Pe(c?.bundle_id??``),u=l.data,d=u?Zt(u):null,f=U(c?.scope_key??``),p=Ae(),m=ke(),h=Te(),g=Le(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[ee,E]=(0,X.useState)(!1),[ne,D]=(0,X.useState)(!1),[ie,ae]=(0,X.useState)(``),[oe,le]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?wi(c):null),S(``)},[c]);let k=c?wi(c):null,ue=_!==null&&k!==null&&JSON.stringify(_)!==JSON.stringify(k),de=m.isPending||p.isPending||h.isPending||g.isPending,fe=()=>{if(!de){if(ue){w(!0);return}n(!1)}},pe=()=>{if(!_)return;let e=Kt(y);if(!Jt(e)){S(Xt);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},me=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(Kt);if(e.some(e=>!Jt(e))){S(Xt);return}if(c.strategy===`APP_VERSION`&&!Br(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ti(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),Bt.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,he=t.filter(e=>e.id!==c?.channel_id),j=he.map(e=>({label:e.name,value:e.name})),_e=ie.trim(),M=oe===`copy`,N=_?Br(_.targetAppVersion.trim()):null,ve=()=>{ae(``),le(`move`)},F=e=>{!e&&g.isPending||(D(e),e||ve())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ce,{onOpenChange:e=>e?void 0:fe(),open:a,children:(0,Z.jsxs)(te,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(P,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(re,{children:`Bundle Detail`}),(0,Z.jsx)(ge,{className:`sr-only`,children:`Edit bundle delivery settings.`}),c?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(at,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(ln,{bundleId:c.id,fullOnMobile:!0,maxLength:18}),c.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:A})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:c.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(e,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[s.isError?(0,Z.jsxs)(Je,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Ke,{}),(0,Z.jsx)(Ue,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(qe,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[A?(0,Z.jsx)(Re,{release:{platform:c.platform,channel:A,releaseId:c.id,builtIn:!c.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(en,{className:`gap-6`,children:[(0,Z.jsxs)(rn,{children:[(0,Z.jsx)(Qt,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(Mt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(rn,{children:[(0,Z.jsx)(Qt,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(T,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),N?(0,Z.jsx)(tn,{children:N}):null]}):null,(0,Z.jsx)(rn,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Qt,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Vt,{label:`About Enabled`,children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsx)(zt,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(rn,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Qt,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Vt,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(zt,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(rn,{children:[(0,Z.jsx)(Qt,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(ki,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(rn,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(Qt,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Kr,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(T,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),pe())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:pe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(xt,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(K,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(tn,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(nn,{children:x}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!ue||de,onClick:me,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(se,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(i,{className:`w-full`,disabled:!c.bundle_id||de,onClick:()=>D(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:de,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Bt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(_t,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:c.enabled||de,onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),c.bundle_id&&l.isPending?(0,Z.jsx)(e,{className:`h-40 w-full`}):null,c.bundle_id&&l.isError?(0,Z.jsxs)(Je,{variant:`destructive`,children:[(0,Z.jsx)(Ke,{}),(0,Z.jsx)(Ue,{children:`Build details are unavailable`}),(0,Z.jsx)(qe,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(Wr,{bundle:u,release:c}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:c.revision})]}),d?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:d})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?`${f.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.scope_key}),r?(0,Z.jsx)(i,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(c.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(H,{onOpenChange:w,open:C,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(z,{children:`Discard unsaved changes?`}),(0,Z.jsx)(L,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Keep editing`}),(0,Z.jsx)(Se,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(H,{onOpenChange:E,open:ee,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(L,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Cancel`}),(0,Z.jsx)(Se,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),Bt.success(`Bundle removed from ${A??`the channel`}`),E(!1),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Ot,{onOpenChange:F,open:ne,children:(0,Z.jsxs)(wt,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(Tt,{children:`Promote to Channel`}),(0,Z.jsx)(Et,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)($t,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(gt,{disabled:g.isPending,items:Ci,onValueChange:e=>le(e),value:oe,children:[(0,Z.jsx)(ct,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(mt,{placeholder:`Select an action`})}),(0,Z.jsx)(pt,{children:(0,Z.jsxs)(ht,{children:[(0,Z.jsx)(ft,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(ft,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)($t,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(gt,{disabled:g.isPending,items:j,onValueChange:e=>ae(e??``),value:ie||null,children:[(0,Z.jsx)(ct,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(mt,{placeholder:`Select a channel`})}),(0,Z.jsx)(pt,{className:`max-h-64`,children:(0,Z.jsx)(ht,{children:he.map(e=>(0,Z.jsx)(ft,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(St,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>F(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!_e||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:oe,expectedRevision:c.revision,releaseId:c.id,targetChannel:_e}),F(!1),Bt.success(M?`Bundle copied to ${_e}`:`Bundle moved to ${_e}`)}catch(e){Bt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?M?`Copying…`:`Moving…`:M?`Copy`:`Move`})]})]})})]})}function ji({release:e}){return(0,Z.jsxs)(K,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(Xe,{className:`size-3`}):(0,Z.jsx)(et,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Mi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(K,{className:p(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(Ke,{className:`h-3 w-3`}):null,r,`%`]})}var Ni=20,Pi=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],Fi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ii=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Li=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Ri=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function zi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=G(a),s=a.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(fe,{className:`-ml-1`}),(0,Z.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Z.jsx)(hn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(gt,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(ct,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(mt,{})}),(0,Z.jsx)(pt,{children:(0,Z.jsxs)(ht,{children:[(0,Z.jsx)(ft,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(ft,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(gt,{disabled:!s,items:Pi,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(ct,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(mt,{})}),(0,Z.jsx)(pt,{children:(0,Z.jsxs)(ht,{children:[(0,Z.jsx)(ft,{value:`ios`,children:`iOS`}),(0,Z.jsx)(ft,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(gt,{disabled:!s&&a.scopeKey===void 0,items:Fi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:a.enabled===void 0?`all`:a.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(ct,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(mt,{})}),(0,Z.jsx)(pt,{children:(0,Z.jsxs)(ht,{children:[(0,Z.jsx)(ft,{value:`all`,children:`Any Status`}),(0,Z.jsx)(ft,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(ft,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(i,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(vn,{})}),a.bundleId?(0,Z.jsxs)(K,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(K,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(i,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(O,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Bi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let a=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(i,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(be,{}):(0,Z.jsx)($e,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(0,Z.jsxs)(`button`,{"aria-label":`Open details for ID ${r.id}`,className:`min-w-0 rounded-sm text-left text-foreground transition-colors underline-offset-4 hover:text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t,title:r.id,type:`button`,children:[(0,Z.jsx)(ln,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(Nt,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(K,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(et,{className:`size-3.5`}),`Unreachable`]}):null]})}function Vi({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=Pe(i),o=je(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(An,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Bundle details are unavailable.`})}function Hi(){let t=He.useSearch(),n=He.useNavigate(),r=le(),[a,o]=(0,X.useState)(!1),[s,l]=(0,X.useState)(),u=Ne({afterReleaseId:t.afterReleaseId,beforeReleaseId:t.beforeReleaseId,filter:Be(t),limit:Ni}),d=Oe().data??[],f=u.data?.data??[],m=Ie(Array.from(new Set(f.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},h=u.data?.next,g=u.data?.previous,_=f.flatMap(e=>{let t=d.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),v=Ve(),y=10+v.length,b=new Map(d.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{s&&!f.some(e=>e.id===s)&&l(void 0)},[s,f]);let x=(e,t=!0)=>void n({resetScroll:t,search:e,to:`/`}),S=e=>x(ze(t,e)),C=e=>{let n=f.find(t=>t.bundle_id===e.id);if(l(void 0),n){x({...t,releaseId:n.id},!1);return}S({bundleId:e.id})},w=t.afterReleaseId!==void 0||t.beforeReleaseId!==void 0,ee=g?{...t,afterReleaseId:g,beforeReleaseId:void 0,releaseId:void 0}:null,T=h?{...t,afterReleaseId:void 0,beforeReleaseId:h,releaseId:void 0}:null,E={...t,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(zi,{channels:d,onChange:S,onClear:()=>x({}),onManageChannels:()=>o(!0),search:t}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[u.isError?(0,Z.jsxs)(Je,{variant:`destructive`,children:[(0,Z.jsx)(Ke,{}),(0,Z.jsx)(Ue,{children:`Bundles could not be loaded`}),(0,Z.jsx)(qe,{children:u.error.message})]}):(0,Z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm [&_[data-slot=table-container]]:h-full [&_[data-slot=table-container]]:overflow-auto`,children:r?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:u.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(t,n)=>(0,Z.jsx)(e,{className:`h-44 w-full`},n))}):f.length?f.map(e=>{let n=b.get(e.channel_id)??e.channel_id,r=e.bundle_id?m[e.bundle_id]:0,i=s===e.id,a=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${e.id}`,className:p(`flex cursor-pointer touch-manipulation flex-col gap-4 border-b p-4 transition-[background-color,filter] last:border-b-0 hover:bg-muted/10 active:bg-muted/20 motion-reduce:transition-none data-[state=selected]:bg-muted/15`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Bi,{expanded:i,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(i?void 0:e.id),release:e}),(0,Z.jsx)(Tn,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,Z.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(at,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,Z.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Ii.format(e.created_at_ms)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:(0,Z.jsx)(Mi,{percentage:e.rollout_cohort_count/10})})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),v.map(({Cell:t,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(t,{releaseId:e.id,releases:_})})]},n)),(0,Z.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(ji,{release:e}),e.should_force_update?(0,Z.jsx)(K,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:e.target_app_version??e.fingerprint_hash??`—`})]}),(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:e.message||`—`})]})]})]})]}),i&&e.bundle_id?(0,Z.jsx)(Vi,{onDetailClick:C,panelId:a,release:e}):null]},e.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(cn,{className:`min-w-max`,children:[(0,Z.jsx)(an,{className:`bg-muted/40`,children:(0,Z.jsxs)(sn,{className:`border-b border-border/60 hover:bg-transparent [&>th]:h-10 [&>th]:text-xs [&>th]:font-semibold [&>th]:uppercase [&>th]:text-muted-foreground/70`,children:[(0,Z.jsx)(J,{children:`ID`}),(0,Z.jsx)(J,{children:`Channel`}),(0,Z.jsx)(J,{children:`Platform`}),(0,Z.jsx)(J,{children:`Patches`}),(0,Z.jsx)(J,{children:`Target`}),(0,Z.jsx)(J,{children:`Enabled`}),(0,Z.jsx)(J,{children:`Force update`}),(0,Z.jsx)(J,{children:`Rollout`}),v.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]})}),(0,Z.jsxs)(on,{children:[u.isPending?Array.from({length:7},(t,n)=>(0,Z.jsx)(sn,{children:(0,Z.jsx)(Y,{colSpan:y,children:(0,Z.jsx)(e,{className:`h-8 w-full`})})},n)):f.map(e=>{let n=s===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(sn,{"aria-label":`Open bundle ${e.id}`,className:p(`cursor-pointer transition-[background-color,filter] hover:bg-muted/10 focus-within:bg-muted/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none data-[state=selected]:bg-muted/15 [&>td]:py-3`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...t,releaseId:e.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Bi,{expanded:n,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(n?void 0:e.id),release:e})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Tn,{channel:b.get(e.channel_id)??e.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(at,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:e.bundle_id&&m[e.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&m[e.bundle_id]>0?(0,Z.jsxs)(K,{variant:`secondary`,children:[m[e.bundle_id],` `,m[e.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:e.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(W,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:e.target_app_version})]}):e.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(mn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(vt,{maxLength:12,value:e.fingerprint_hash})]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(En,{enabled:e.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(En,{enabled:e.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Mi,{percentage:e.rollout_cohort_count/10})}),v.map(({Cell:t,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(t,{releaseId:e.id,releases:_})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ii.format(e.created_at_ms),children:Li.format(e.created_at_ms)})]}),n&&e.bundle_id?(0,Z.jsx)(sn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:y,children:(0,Z.jsx)(Vi,{onDetailClick:C,panelId:r,release:e})})}):null]},e.id)}),!u.isPending&&f.length===0?(0,Z.jsx)(sn,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:y,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!u.isError&&!u.isPending?(0,Z.jsxs)(`nav`,{"aria-label":`Bundle pagination`,className:`flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:f.length}),` `,f.length===1?`entry`:`entries`,`, newest first`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[w?(0,Z.jsx)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:E,to:`/`,children:`Newest`}):null,ee?(0,Z.jsxs)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:ee,to:`/`,children:[(0,Z.jsx)(fn,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(i,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Z.jsx)(fn,{"data-icon":`inline-start`}),`Previous`]}),T?(0,Z.jsxs)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,Z.jsx)($e,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(i,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)($e,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Ai,{channels:d,onOpenChange:e=>!e&&x({...t,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!t.releaseId,releaseId:t.releaseId??``}),(0,Z.jsx)(jn,{onOpenChange:o,open:a})]})}export{Hi as component};
@@ -1 +0,0 @@
1
- import{ar as e}from"./sidebar-BqX460IW.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};