@hot-updater/console 1.2.0-rc.2 → 1.2.0-rc.21

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 (251) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{-native-builds-search-C-TGpFAm.js → -native-builds-search-OlRj4Jz0.js} +1 -1
  3. package/.output/public/assets/BundleIdDisplay-CP6rsdFO.js +1 -0
  4. package/.output/public/assets/{ConsoleFeatureUnavailable-CUtcXuY2.js → ConsoleFeatureUnavailable-DUqlpHCp.js} +1 -1
  5. package/.output/public/assets/EventDetails-Dcpdu7re.js +1 -0
  6. package/.output/public/assets/HashValueDisplay-MoZMmTeP.js +1 -0
  7. package/.output/public/assets/{InsightsPageHeader-DHhqY3DT.js → InsightsPageHeader-CSas9gM0.js} +1 -1
  8. package/.output/public/assets/{PlatformIcon-BBWQlWm9.js → PlatformIcon-CJ69KopR.js} +1 -1
  9. package/.output/public/assets/RelativeTime-CiZ7yXNJ.js +1 -0
  10. package/.output/public/assets/RolloutPercentageBadge-D-tZKnX7.js +1 -0
  11. package/.output/public/assets/StoreSubmission-F00RL5rI.js +1 -0
  12. package/.output/public/assets/TargetDisplay-CoYY8Fs4.js +1 -0
  13. package/.output/public/assets/api-LQJH44FU.js +1 -0
  14. package/.output/public/assets/api-keys-3IL4dIHe.js +1 -0
  15. package/.output/public/assets/api-keys-4w2-ofii.js +1 -0
  16. package/.output/public/assets/badge-laIuYW1U.js +1 -0
  17. package/.output/public/assets/card-ulgg5xHn.js +1 -0
  18. package/.output/public/assets/{index-CqP5HPV6.js → index-Cde2QQJq.js} +3 -3
  19. package/.output/public/assets/insights-0TUItqwh.js +1 -0
  20. package/.output/public/assets/insights-DDRfERph.js +2 -0
  21. package/.output/public/assets/insights-_6iMn8GR.js +42 -0
  22. package/.output/public/assets/{insights-search-DghCbEnk.js → insights-search-CYPrQVUC.js} +1 -1
  23. package/.output/public/assets/{insights-usage-rpc-CKQH0pUS.js → insights-usage-rpc-BbFllvi_.js} +1 -1
  24. package/.output/public/assets/insights_.distribution-AZcfvK7x.js +1 -0
  25. package/.output/public/assets/insights_.distribution-BGAqgPi0.js +1 -0
  26. package/.output/public/assets/insights_.distribution-CjYkDRA4.js +2 -0
  27. package/.output/public/assets/installations-Ap2G2tDs.js +1 -0
  28. package/.output/public/assets/{installations-B674P5Z5.js → installations-CSZfo1rG.js} +2 -2
  29. package/.output/public/assets/installations-CwQYwQ6K.js +1 -0
  30. package/.output/public/assets/native-builds-cT9Ha-jZ.js +1 -0
  31. package/.output/public/assets/native-builds-v5wez34c.js +2 -0
  32. package/.output/public/assets/native-builds_._buildId-BBwE8Pcc.js +2 -0
  33. package/.output/public/assets/native-builds_._buildId-DZPcR_up.js +1 -0
  34. package/.output/public/assets/package-ytYrywZH.js +1 -0
  35. package/.output/public/assets/remote-config-CIAEArwq.js +1 -0
  36. package/.output/public/assets/{remote-config-WjpozBG5.js → remote-config-Dwdc-sij.js} +1 -1
  37. package/.output/public/assets/remote-config-ZJ_IRSKE.js +6 -0
  38. package/.output/public/assets/routes-BUWLcUqW.js +1 -0
  39. package/.output/public/assets/routes-Rtz-KcQO.js +2 -0
  40. package/.output/public/assets/styles-bNNic0NS.css +2 -0
  41. package/.output/public/assets/valueToPercent-B6X9rUJM.js +1 -0
  42. package/.output/server/{__23tanstack-start-server-fn-resolver-BcDgi7Q7.mjs → __23tanstack-start-server-fn-resolver-C-9gAWtP.mjs} +58 -46
  43. package/.output/server/_chunks/ssr-renderer.mjs +2 -2
  44. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
  45. package/.output/server/_libs/_.mjs +2 -0
  46. package/.output/server/_libs/lucide-react.mjs +1 -27
  47. package/.output/server/_ssr/{-native-builds-search-CwNcoXf4.mjs → -native-builds-search-Cl8EZ0Ud.mjs} +2 -2
  48. package/.output/server/_ssr/{BundleIdDisplay-ys5eRBiX.mjs → BundleIdDisplay-gVoZLoqU.mjs} +2 -2
  49. package/.output/server/_ssr/{ConsoleFeatureUnavailable-DFrogDwc.mjs → ConsoleFeatureUnavailable-Dcibk9QQ.mjs} +7 -7
  50. package/.output/server/_ssr/{EventDetails-BOJR7vO-.mjs → EventDetails-CCZ9mS_F.mjs} +8 -8
  51. package/.output/server/_ssr/{HashValueDisplay-d4OxpYG1.mjs → HashValueDisplay-BxHC8iAG.mjs} +6 -6
  52. package/.output/server/_ssr/{InsightsPageHeader-D_ON_oXO.mjs → InsightsPageHeader-CqJqdi-m.mjs} +8 -8
  53. package/.output/server/_ssr/{NotFoundPage-BJKqYxfO.mjs → NotFoundPage-BLIrdxfa.mjs} +2 -2
  54. package/.output/server/_ssr/{PlatformIcon-CFLiTjh1.mjs → PlatformIcon-Cuhy0CIO.mjs} +12 -2
  55. package/.output/server/_ssr/RelativeTime-B1Sy1q_O.mjs +209 -0
  56. package/.output/server/_ssr/{git-CTA8Aqr0.mjs → RolloutPercentageBadge-BmWPR_Tb.mjs} +19 -3
  57. package/.output/server/_ssr/StoreSubmission-DIsoEgf-.mjs +65 -0
  58. package/.output/server/_ssr/TargetDisplay-C2ROSppY.mjs +100 -0
  59. package/.output/server/_ssr/{alert-dialog-BU7QeAL9.mjs → alert-dialog-C1y2G90R.mjs} +1 -1
  60. package/.output/server/_ssr/{api-Dn2NwWiq.mjs → api-D8gN7V0h.mjs} +99 -22
  61. package/.output/server/_ssr/{api-keys-D5rW-eAH.mjs → api-keys-DybL9aTC.mjs} +2 -2
  62. package/.output/server/_ssr/{api-keys-Ckoc4av7.mjs → api-keys-W6eabF-V.mjs} +10 -9
  63. package/.output/server/_ssr/{api-keys-rpc-Bf2x7mQb.mjs → api-keys-rpc-CEaSDqVK.mjs} +4 -4
  64. package/.output/server/_ssr/{api-rpc-Bg7CTu5A.mjs → api-rpc-DloD35JY.mjs} +43 -18
  65. package/.output/server/_ssr/{auth-rpc-C41fl9Q5.mjs → auth-rpc-DOGHWAlV.mjs} +5 -5
  66. package/.output/server/_ssr/{auth.server-Dfa8DroN.mjs → auth.server-BO8fBOxh.mjs} +165 -149
  67. package/.output/server/_ssr/{badge-B-YGm4ng.mjs → badge-DFQ0dCIK.mjs} +2 -44
  68. package/.output/server/_ssr/{bundleActivity-MLrjNJCT.mjs → bundleActivity-BGVvqWx7.mjs} +1 -1
  69. package/.output/server/_ssr/card-Ec0pJUEs.mjs +49 -0
  70. package/.output/server/_ssr/{config.server-DBX318ww.mjs → config.server-AfVsZPlA.mjs} +4 -4
  71. package/.output/server/_ssr/{console-access-CwSkUsOn.mjs → console-access-fb0N6Nkh.mjs} +2 -2
  72. package/.output/server/_ssr/{console-features-BTV-XuhQ.mjs → console-features-CgdQJQlX.mjs} +1 -1
  73. package/.output/server/_ssr/{console-features-api-BbojT91g.mjs → console-features-api-VIcoTdNC.mjs} +5 -5
  74. package/.output/server/_ssr/{console-features-rpc-3bq2wS5U.mjs → console-features-rpc-BNjlCLLR.mjs} +4 -4
  75. package/.output/server/_ssr/{createServerRpc-BVvRVOz5.mjs → createServerRpc-DJZel12M.mjs} +1 -1
  76. package/.output/server/_ssr/{databaseConfig-B_Bg7qS5.mjs → databaseConfig-XAvDetmn.mjs} +1 -1
  77. package/.output/server/_ssr/{databaseJsonValue-kS7cvEtz.mjs → databaseJsonValue-DuUoft8j.mjs} +1 -1
  78. package/.output/server/_ssr/{databaseRows-B6H8Cmgq.mjs → databaseRows-BtRVBD0C.mjs} +3 -3
  79. package/.output/server/_ssr/{dialog-RPz_4IaA.mjs → dialog-CqqX-d24.mjs} +1 -1
  80. package/.output/server/_ssr/{dist-TEpM_UAD.mjs → dist-B6-irDRA.mjs} +1 -1
  81. package/.output/server/_ssr/{downloadBundle-DCmr7vsj.mjs → downloadBundle-BX8ODCZT.mjs} +1 -1
  82. package/.output/server/_ssr/{empty-BE1Gn6IB.mjs → empty-o55VPF-m.mjs} +2 -2
  83. package/.output/server/_ssr/{empty-plugin-adapters-zrZ0xs6n.mjs → empty-plugin-adapters-BYBYBaxo.mjs} +1 -1
  84. package/.output/server/_ssr/{failureReports-Cn_zU9S8.mjs → failureReports-C_CmBF4x.mjs} +3 -3
  85. package/.output/server/_ssr/{field-DUwSBic5.mjs → field-yKSsJRQo.mjs} +2 -2
  86. package/.output/server/_ssr/{getBundleChildren-rtkEEJw5.mjs → getBundleChildren-BJTufthT.mjs} +2 -2
  87. package/.output/server/_ssr/{input-group-BHI0ziHT.mjs → input-group-DlSVwRKN.mjs} +1 -1
  88. package/.output/server/_ssr/{insights-DVvFyEOH.mjs → insights-D1hSSSnf.mjs} +5 -5
  89. package/.output/server/_ssr/{insights-BGzKbtLf.mjs → insights-DmskI16o.mjs} +28 -27
  90. package/.output/server/_ssr/{insights-api-Bw_ZEDUY.mjs → insights-api-BedUQeHn.mjs} +5 -5
  91. package/.output/server/_ssr/{insights-errors-7BCwFybo.mjs → insights-errors-Bz3sWNZm.mjs} +2 -2
  92. package/.output/server/_ssr/{insights-failures-B9VPkzZE.mjs → insights-failures-DNQ9qVVf.mjs} +2 -2
  93. package/.output/server/_ssr/{insights-failures-rpc-BuRU2I5g.mjs → insights-failures-rpc-pyvkJiMW.mjs} +11 -11
  94. package/.output/server/_ssr/{insights-DF0SkYDy.mjs → insights-oydyzlp4.mjs} +2 -2
  95. package/.output/server/_ssr/{insights-recovery-BtXVU3ro.mjs → insights-recovery-DOkpqnQ8.mjs} +1 -1
  96. package/.output/server/_ssr/{insights-recovery-rpc-CsWe72mW.mjs → insights-recovery-rpc-C8oSWMSL.mjs} +7 -7
  97. package/.output/server/_ssr/{insights-rpc-CD5VaLy2.mjs → insights-rpc-Bt3dM8UW.mjs} +4 -4
  98. package/.output/server/_ssr/{insights-search-C3R6mzW-.mjs → insights-search-CH_Q2pPQ.mjs} +4 -4
  99. package/.output/server/_ssr/{insights-usage-DiGnuxW8.mjs → insights-usage-4KDIN3Kg.mjs} +1 -1
  100. package/.output/server/_ssr/{insights-usage-rpc-Bbg14JFS.mjs → insights-usage-rpc-CTZ63vhq.mjs} +7 -7
  101. package/.output/server/_ssr/{insights-usage-rpc-Duqu3q-H.mjs → insights-usage-rpc-CTt1yIIY.mjs} +4 -4
  102. package/.output/server/_ssr/{insightsUsage-ClAmoUz8.mjs → insightsUsage-DmQdJZqT.mjs} +3 -3
  103. package/.output/server/_ssr/{insights_.distribution-HZrwJteU.mjs → insights_.distribution-CxB6jrKu.mjs} +5 -5
  104. package/.output/server/_ssr/{insights_.distribution-DH_9B5XU.mjs → insights_.distribution-DG4pvrB8.mjs} +16 -15
  105. package/.output/server/_ssr/{insights_.distribution-DIA0Gi7f.mjs → insights_.distribution-DS8Dc6_5.mjs} +2 -2
  106. package/.output/server/_ssr/{installations-SuuoQ-xH.mjs → installations-BgVrlTdW.mjs} +12 -12
  107. package/.output/server/_ssr/{installations-Ct7njvit.mjs → installations-ChOjrcPZ.mjs} +4 -4
  108. package/.output/server/_ssr/{installations-D-O92-Nr.mjs → installations-_PSpNZM6.mjs} +2 -2
  109. package/.output/server/_ssr/{listReleases-D_GY00SQ.mjs → listReleases-CQEceg8j.mjs} +1 -1
  110. package/.output/server/_ssr/{request-guard-CPdRBuGW.mjs → local-console-Dtxlsav0.mjs} +2 -9
  111. package/.output/server/_ssr/native-artifact-H1MDP0Jz.mjs +593 -0
  112. package/.output/server/_ssr/native-builds-CHOxmjmm.mjs +548 -0
  113. package/.output/server/_ssr/{native-builds-DhXL5zf_.mjs → native-builds-CWA9Y__P.mjs} +58 -20
  114. package/.output/server/_ssr/{native-builds-DhVG-4du.mjs → native-builds-DqJ41IA-.mjs} +3 -3
  115. package/.output/server/_ssr/{native-builds_._buildId-dDLkfNFZ.mjs → native-builds_._buildId-Bb-mVQnh.mjs} +3 -3
  116. package/.output/server/_ssr/native-builds_._buildId-C1lMUjaj.mjs +1294 -0
  117. package/.output/server/_ssr/nativeBuildDevice-Dn16gNmZ.mjs +230 -0
  118. package/.output/server/_ssr/nativeBuildDownloadLink-wyUj7Oyi.mjs +96 -0
  119. package/.output/server/_ssr/nativeBuildInstall-i5f-2-qd.mjs +203 -0
  120. package/.output/server/_ssr/nativeBuildQr-P9qKcI7l.mjs +115 -0
  121. package/.output/server/_ssr/{nativeBuilds-B_7BPjt_.mjs → nativeBuilds-ByQdDnHG.mjs} +61 -29
  122. package/.output/server/_ssr/{plugins-RIryUNWj.mjs → plugins-CX7wutet.mjs} +6 -6
  123. package/.output/server/_ssr/publicConsoleBase-3IHSHvqd.mjs +27 -0
  124. package/.output/server/_ssr/{qr-code-C7kNRIDX.mjs → qr-code-pENFuyy9.mjs} +1 -1
  125. package/.output/server/_ssr/{release-adoption-DoAtNPED.mjs → release-adoption-C7sUFDwa.mjs} +2 -2
  126. package/.output/server/_ssr/{release-adoption-rpc-Cc2AJ-yS.mjs → release-adoption-rpc-BUPLEJYw.mjs} +9 -9
  127. package/.output/server/_ssr/{releaseAdoption-a2byXMfz.mjs → releaseAdoption-LLYlRnUB.mjs} +4 -4
  128. package/.output/server/_ssr/{releaseCatalogCompiler-DLcean2k.mjs → releaseCatalogCompiler-D9dAMI17.mjs} +3 -3
  129. package/.output/server/_ssr/{releaseManagement-DHUux2az.mjs → releaseManagement-EPhok_Py.mjs} +1 -1
  130. package/.output/server/_ssr/{releaseReachability-DZOK_dH-.mjs → releaseReachability-DaZ7ifUF.mjs} +2 -2
  131. package/.output/server/_ssr/{remote-config-BYyQFBG8.mjs → remote-config-BMdoiYuB.mjs} +2 -2
  132. package/.output/server/_ssr/{remote-config-CTZ_zxNg.mjs → remote-config-DvM_KKl6.mjs} +20 -19
  133. package/.output/server/_ssr/{remote-config-DvMHWxja.mjs → remote-config-XmtJFUKn.mjs} +2 -2
  134. package/.output/server/_ssr/{remote-config-rpc-DibiGuw7.mjs → remote-config-rpc-DFRsn7f8.mjs} +5 -5
  135. package/.output/server/_ssr/request-guard-BPLyogIN.mjs +11 -0
  136. package/.output/server/_ssr/{router-Da0sMVN2.mjs → router-KM_t8okm.mjs} +103 -52
  137. package/.output/server/_ssr/{routes-CHl0_VK3.mjs → routes-Beckr53C.mjs} +260 -383
  138. package/.output/server/_ssr/{routes-FE2SJgBr.mjs → routes-MrSajWvI.mjs} +14 -18
  139. package/.output/server/_ssr/{runtime.server-BdMY1blX.mjs → runtime.server-BsTTLV-B.mjs} +4 -4
  140. package/.output/server/_ssr/{schema-ChlRtZIo.mjs → schema-3oDJJFWa.mjs} +1 -1
  141. package/.output/server/_ssr/{schema-migration-rpc-Bh7oEZEG.mjs → schema-migration-rpc-BqNKpOrg.mjs} +4 -4
  142. package/.output/server/_ssr/{select-BhPCNdHx.mjs → select-CUCLbsEW.mjs} +2 -2
  143. package/.output/server/_ssr/{server-BjkQXKZR.mjs → server-DpE_idiZ.mjs} +6 -6
  144. package/.output/server/_ssr/{sidebar-B7OTpt-8.mjs → sidebar-xs2XmYh9.mjs} +2 -2
  145. package/.output/server/_ssr/ssr.mjs +1 -1
  146. package/.output/server/_ssr/{start-BvDsQehg.mjs → start-C0XSSCq4.mjs} +2 -2
  147. package/.output/server/_ssr/{switch-CIkMfFrN.mjs → switch-CWp_RWCq.mjs} +2 -2
  148. package/.output/server/_ssr/{table-BIzH49v-.mjs → table-DtPvFx_v.mjs} +1 -1
  149. package/.output/server/_ssr/{tabs-WDYlrXEm.mjs → tabs-D0Jdy8v4.mjs} +2 -2
  150. package/.output/server/_ssr/{updateFailures-n-tGv90S.mjs → updateFailures-DPYzv9bE.mjs} +3 -3
  151. package/.output/server/_ssr/{uuidv7-BIF4nb_q.mjs → uuidv7-CmHbryZT.mjs} +2 -2
  152. package/.output/server/_ssr/{version-CQ98ZBpL-CWSkTT9J.mjs → version-CQ98ZBpL-NmbU0MD2.mjs} +1 -1
  153. package/.output/server/_tanstack-start-manifest_v-AYP07Vaf.mjs +194 -0
  154. package/.output/server/index.mjs +318 -297
  155. package/package.json +7 -7
  156. package/src/components/ChannelBadge.tsx +9 -9
  157. package/src/components/DataTable.tsx +303 -0
  158. package/src/components/HashValueDisplay.tsx +6 -3
  159. package/src/components/PlatformIcon.tsx +10 -0
  160. package/src/components/RelativeTime.tsx +31 -0
  161. package/src/components/TargetDisplay.tsx +69 -0
  162. package/src/components/features/channels/ChannelManagementDialog.tsx +3 -8
  163. package/src/components/features/insights/ReleaseActivity.tsx +1 -1
  164. package/src/components/features/native-builds/BuiltInBundleCard.tsx +108 -58
  165. package/src/components/features/native-builds/CommitLink.tsx +1 -1
  166. package/src/components/features/native-builds/ImportBuild.tsx +1 -1
  167. package/src/components/features/native-builds/InstallCard.tsx +246 -46
  168. package/src/components/features/native-builds/IosInstall.tsx +300 -0
  169. package/src/components/features/native-builds/NativeBuildDetailPage.tsx +4 -1
  170. package/src/components/features/native-builds/NativeBuildsPage.tsx +63 -76
  171. package/src/components/features/native-builds/NativeBuildsTable.tsx +436 -315
  172. package/src/components/features/native-builds/PatchesCard.tsx +3 -2
  173. package/src/components/features/native-builds/ReleaseNativeBuildLink.tsx +4 -4
  174. package/src/components/features/native-builds/ServedNowCard.tsx +33 -1
  175. package/src/components/features/native-builds/ShortHash.tsx +1 -1
  176. package/src/components/features/native-builds/StoreSubmission.tsx +12 -3
  177. package/src/lib/api-rpc.ts +55 -6
  178. package/src/lib/api.ts +85 -12
  179. package/src/lib/native-builds.ts +95 -17
  180. package/src/lib/server/local-console.ts +1 -1
  181. package/src/lib/server/nativeBuildDevice.ts +274 -0
  182. package/src/lib/server/nativeBuildDownloadLink.ts +193 -0
  183. package/src/lib/server/nativeBuildInstall.ts +355 -0
  184. package/src/lib/server/nativeBuildQr.ts +114 -24
  185. package/src/lib/server/nativeBuilds.ts +87 -33
  186. package/src/lib/server/plistText.ts +17 -0
  187. package/src/lib/server/publicConsoleBase.ts +17 -0
  188. package/src/routeTree.gen.ts +114 -0
  189. package/src/routes/[_]hot-updater/native-builds/$buildId/device-response.ts +17 -0
  190. package/src/routes/[_]hot-updater/native-builds/$buildId/device.ts +17 -0
  191. package/src/routes/[_]hot-updater/native-builds/$buildId/device[.]mobileconfig.ts +17 -0
  192. package/src/routes/[_]hot-updater/native-builds/$buildId/manifest[.]plist.ts +22 -0
  193. package/src/routes/[_]hot-updater/native-builds/preview-qr.ts +14 -0
  194. package/src/routes/api/native-builds/$buildId/download.ts +22 -1
  195. package/src/routes/index.tsx +290 -429
  196. package/src/styles.css +16 -0
  197. package/.output/public/assets/EventDetails-Dl2RvPAk.js +0 -1
  198. package/.output/public/assets/HashValueDisplay-6lNRxDJX.js +0 -1
  199. package/.output/public/assets/RolloutPercentageBadge-Cxogpi8F.js +0 -1
  200. package/.output/public/assets/StoreSubmission-ViTkW4eJ.js +0 -1
  201. package/.output/public/assets/api-P2g8dCNg.js +0 -1
  202. package/.output/public/assets/api-keys-DWQC2q6y.js +0 -1
  203. package/.output/public/assets/api-keys-FueRkF9q.js +0 -1
  204. package/.output/public/assets/badge-DWFcDWho.js +0 -1
  205. package/.output/public/assets/download-Cf24LBde.js +0 -1
  206. package/.output/public/assets/insights-B-0odqpt.js +0 -42
  207. package/.output/public/assets/insights-BSVGfxSL.js +0 -1
  208. package/.output/public/assets/insights-NK5B6ReS.js +0 -2
  209. package/.output/public/assets/insights_.distribution-CJvgwcVZ.js +0 -2
  210. package/.output/public/assets/insights_.distribution-DblZM0mO.js +0 -1
  211. package/.output/public/assets/insights_.distribution-dvk6vYDM.js +0 -1
  212. package/.output/public/assets/installations-BWxczZ2t.js +0 -1
  213. package/.output/public/assets/installations-Dv4kWQYz.js +0 -1
  214. package/.output/public/assets/native-builds-BOC71grI.js +0 -1
  215. package/.output/public/assets/native-builds-D6rldpSh.js +0 -2
  216. package/.output/public/assets/native-builds-DAy2678K.js +0 -1
  217. package/.output/public/assets/native-builds_._buildId-DD58_Phd.js +0 -1
  218. package/.output/public/assets/native-builds_._buildId-DvQDKnUQ.js +0 -2
  219. package/.output/public/assets/remote-config-B7ujqhLa.js +0 -6
  220. package/.output/public/assets/remote-config-gXeH6PBW.js +0 -1
  221. package/.output/public/assets/routes-BDdBIxYS.js +0 -1
  222. package/.output/public/assets/routes-CCD33Azv.js +0 -2
  223. package/.output/public/assets/styles-uK-0vUMk.css +0 -2
  224. package/.output/public/assets/valueToPercent-BLwGy_xK.js +0 -1
  225. package/.output/server/_ssr/RolloutPercentageBadge-BpI_iTsm.mjs +0 -21
  226. package/.output/server/_ssr/StoreSubmission-CXMFpHyp.mjs +0 -139
  227. package/.output/server/_ssr/native-builds-bTSKsvYp.mjs +0 -510
  228. package/.output/server/_ssr/native-builds_._buildId-D20tGR3l.mjs +0 -813
  229. package/.output/server/_ssr/nativeBuildQr-84cnFQPX.mjs +0 -59
  230. package/.output/server/_tanstack-start-manifest_v-B5nsO5L4.mjs +0 -184
  231. /package/.output/public/assets/{NotFoundPage-DZ3DxyRA.js → NotFoundPage-Ckb5GMhh.js} +0 -0
  232. /package/.output/public/assets/{alert-dialog-BqYScr9y.js → alert-dialog-DiRLrFVe.js} +0 -0
  233. /package/.output/public/assets/{dialog-CNUPxNxH.js → dialog-CLIaC82_.js} +0 -0
  234. /package/.output/public/assets/{dist-CPlO6ko9.js → dist-Bf1BPKMs.js} +0 -0
  235. /package/.output/public/assets/{empty-B3Uwdd6k.js → empty-Bhlj8PEo.js} +0 -0
  236. /package/.output/public/assets/{field-D-2-mnNh.js → field-q4sTYzNU.js} +0 -0
  237. /package/.output/public/assets/{history-DqHlgSuV.js → history-DakJoeSM.js} +0 -0
  238. /package/.output/public/assets/{input-group-D3OUBk4n.js → input-group-D_NfhUbX.js} +0 -0
  239. /package/.output/public/assets/{key-round-DwNKkHhy.js → key-round-DzBe6DHr.js} +0 -0
  240. /package/.output/public/assets/{list--NIee1FZ.js → list-B6GeoQ_b.js} +0 -0
  241. /package/.output/public/assets/{plus-BReVKct-.js → plus-BVhOauU3.js} +0 -0
  242. /package/.output/public/assets/{refresh-cw-B9HHjLej.js → refresh-cw-C-tvoCcE.js} +0 -0
  243. /package/.output/public/assets/{relativeTime-YQt84dYr.js → relativeTime-DvyxGIsm.js} +0 -0
  244. /package/.output/public/assets/{rotate-cw-Cv2aVbYr.js → rotate-cw-Clk5xTeE.js} +0 -0
  245. /package/.output/public/assets/{search-BCel4Oy6.js → search-nnvSOTEB.js} +0 -0
  246. /package/.output/public/assets/{smartphone-CMaSy_ir.js → smartphone-r0rRdPas.js} +0 -0
  247. /package/.output/public/assets/{switch-BpdiHL_t.js → switch-CP6GsHmN.js} +0 -0
  248. /package/.output/public/assets/{table-Bpy3SvSo.js → table-TUtVz-2l.js} +0 -0
  249. /package/.output/public/assets/{tabs-Xmt7tZeG.js → tabs-CP3CSmtI.js} +0 -0
  250. /package/.output/public/assets/{undo-2-CUX96_BG.js → undo-2-Bt0YXG26.js} +0 -0
  251. /package/.output/public/assets/{uuidv7-zXMtwR9Q.js → uuidv7-cI6C63Fm.js} +0 -0
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-CUtcXuY2.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/insights-BSVGfxSL.js","assets/ConsoleFeatureUnavailable-CUtcXuY2.js","assets/sidebar-Di9SN47G.js","assets/console-features-api-DEXSwFtc.js","assets/arrow-up-right-DK8Zdg40.js","assets/NotFoundPage-DZ3DxyRA.js","assets/link-DTEyW70e.js","assets/empty-B3Uwdd6k.js","assets/insights-B-0odqpt.js","assets/alert-dialog-BqYScr9y.js","assets/select-CBIU0_M1.js","assets/useCompositeListItem-JmyDfo3-.js","assets/check-CXVR3s3X.js","assets/tabs-Xmt7tZeG.js","assets/insights-usage-rpc-CKQH0pUS.js","assets/valueToPercent-BLwGy_xK.js","assets/EventDetails-Dl2RvPAk.js","assets/insights-api-BVCXJsoV.js","assets/useInfiniteQuery-DX4WpBRG.js","assets/copy-DsuLj3oj.js","assets/download-Cf24LBde.js","assets/input-group-D3OUBk4n.js","assets/smartphone-CMaSy_ir.js","assets/badge-DWFcDWho.js","assets/dist-CPlO6ko9.js","assets/HashValueDisplay-6lNRxDJX.js","assets/InsightsPageHeader-DHhqY3DT.js","assets/list--NIee1FZ.js","assets/arrow-right-CNII8TYn.js","assets/chevron-right-BoUXo82O.js","assets/circle-off-C7Muo0ss.js","assets/refresh-cw-B9HHjLej.js","assets/rotate-cw-Cv2aVbYr.js","assets/undo-2-CUX96_BG.js","assets/insights-search-DghCbEnk.js","assets/uuidv7-zXMtwR9Q.js","assets/PlatformIcon-BBWQlWm9.js","assets/table-Bpy3SvSo.js","assets/api-P2g8dCNg.js","assets/useMutation-DbYw7boA.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./preload-helper-B44EvKhG.js";import{r}from"./console-features-api-DEXSwFtc.js";import{a as i}from"./insights-search-DghCbEnk.js";var a=t(`/insights`)({beforeLoad:({context:e})=>r(e.queryClient,`insightsAnalytics`),notFoundComponent:e(()=>n(()=>import(`./insights-BSVGfxSL.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`notFoundComponent`),component:e(()=>n(()=>import(`./insights-B-0odqpt.js`),__vite__mapDeps([8,2,9,10,11,12,13,14,15,6,16,17,18,19,20,21,22,23,24,25,26,3,27,7,28,4,29,30,31,32,33,34,35,36,37,38,39])),`component`),validateSearch:i});export{a as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-DblZM0mO.js","assets/ConsoleFeatureUnavailable-CUtcXuY2.js","assets/sidebar-Di9SN47G.js","assets/console-features-api-DEXSwFtc.js","assets/arrow-up-right-DK8Zdg40.js","assets/NotFoundPage-DZ3DxyRA.js","assets/link-DTEyW70e.js","assets/empty-B3Uwdd6k.js","assets/insights_.distribution-dvk6vYDM.js","assets/select-CBIU0_M1.js","assets/useCompositeListItem-JmyDfo3-.js","assets/check-CXVR3s3X.js","assets/insights-usage-rpc-CKQH0pUS.js","assets/valueToPercent-BLwGy_xK.js","assets/arrow-left-g9cKqXuC.js","assets/insights-api-BVCXJsoV.js","assets/useInfiniteQuery-DX4WpBRG.js","assets/rotate-cw-Cv2aVbYr.js","assets/badge-DWFcDWho.js","assets/insights-search-DghCbEnk.js","assets/uuidv7-zXMtwR9Q.js","assets/PlatformIcon-BBWQlWm9.js","assets/InsightsPageHeader-DHhqY3DT.js","assets/tabs-Xmt7tZeG.js","assets/list--NIee1FZ.js","assets/field-D-2-mnNh.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./preload-helper-B44EvKhG.js";import{r}from"./console-features-api-DEXSwFtc.js";import{i}from"./insights-search-DghCbEnk.js";var a=t(`/insights_/distribution`)({beforeLoad:({context:e})=>r(e.queryClient,`insightsAnalytics`),notFoundComponent:e(()=>n(()=>import(`./insights_.distribution-DblZM0mO.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`notFoundComponent`),component:e(()=>n(()=>import(`./insights_.distribution-dvk6vYDM.js`),__vite__mapDeps([8,2,9,10,11,12,13,6,14,4,15,16,17,18,19,20,21,22,23,3,24,7,25])),`component`),validateSearch:i});export{a as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-CUtcXuY2.js";var t=e;export{t as notFoundComponent};
@@ -1 +0,0 @@
1
- import{$ as e,Fn as t,In as n,Wr as r,ar as i}from"./sidebar-Di9SN47G.js";import{t as a}from"./link-DTEyW70e.js";import{t as o}from"./arrow-left-g9cKqXuC.js";import{t as s}from"./arrow-up-right-DK8Zdg40.js";import{o as c,u as l}from"./insights-api-BVCXJsoV.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./select-CBIU0_M1.js";import{t as g}from"./rotate-cw-Cv2aVbYr.js";import{a as _,d as v,i as y,l as ee,n as te,o as ne,s as re,t as b,u as x}from"./badge-DWFcDWho.js";import{a as S,o as C}from"./insights-search-DghCbEnk.js";import{i as w,o as T,r as E,t as D}from"./empty-B3Uwdd6k.js";import{t as O}from"./PlatformIcon-BBWQlWm9.js";import{a as k,t as A}from"./field-D-2-mnNh.js";import{t as j}from"./insights_.distribution-CJvgwcVZ.js";import{i as M}from"./valueToPercent-BLwGy_xK.js";import{n as N,t as P}from"./insights-usage-rpc-CKQH0pUS.js";import{c as ie,n as F,o as I,t as L}from"./InsightsPageHeader-DHhqY3DT.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)(M,{bundleId:e,className:`text-muted-foreground`})]})}function U(){let r=j.useSearch(),M=c(),F=j.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:()=>P({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=S(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(M),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)(g,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(A,{className:`w-full sm:w-64`,children:[(0,R.jsx)(k,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(h,{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)(u,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(p,{})}),(0,R.jsx)(f,{children:(0,R.jsxs)(m,{children:[(0,R.jsx)(d,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(d,{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)(b,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(O,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(b,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(b,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(ne,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(x,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(v,{children:`Bundles by app version`}),(0,R.jsxs)(C,{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)(re,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(te,{children:[(0,R.jsx)(_,{children:`Partial history`}),(0,R.jsxs)(y,{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)(D,{children:[(0,R.jsxs)(w,{children:[(0,R.jsx)(T,{children:`No bundles reported`}),(0,R.jsx)(E,{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)(O,{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)(N,{"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)(ee,{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{$ as e,Fn as t,In as n,Ln as r,Wr as i,et as a,ii as o,rr as s,ti as c}from"./sidebar-Di9SN47G.js";import{h as l,i as u,m as d,t as f}from"./link-DTEyW70e.js";import{o as p,s as m}from"./preload-helper-B44EvKhG.js";import{a as h,n as g,o as _,r as v,t as y}from"./EventDetails-Dl2RvPAk.js";import{t as b}from"./arrow-left-g9cKqXuC.js";import{t as x}from"./arrow-up-right-DK8Zdg40.js";import{a as S,c as C,i as w,l as T,n as E,o as ee,r as te}from"./insights-api-BVCXJsoV.js";import{t as D}from"./check-CXVR3s3X.js";import{a as O}from"./useCompositeListItem-JmyDfo3-.js";import{t as k}from"./refresh-cw-B9HHjLej.js";import{i as A,n as j,r as M,t as N}from"./input-group-D3OUBk4n.js";import{t as P}from"./search-BCel4Oy6.js";import{c as ne,d as F,o as I,s as L,u as R}from"./badge-DWFcDWho.js";import{a as z,i as re,n as ie,o as ae,r as oe,t as B}from"./installations-B674P5Z5.js";import{a as se,t as ce}from"./field-D-2-mnNh.js";import{a as V,i as H,n as le,o as U,r as W,t as G}from"./table-Bpy3SvSo.js";import{n as ue,t as K}from"./HashValueDisplay-6lNRxDJX.js";import{a as de,c as q,n as fe,r as pe,t as me}from"./InsightsPageHeader-DHhqY3DT.js";function he(){l(u(),!0)}function ge(e){return he(),d(u(),e)}function _e(e){let t=u();return m(t.stores.location,p(e,t))}var J=o(c(),1),Y=i();function ve({events:e,formatter:t,renderIdentity:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,Y.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,Y.jsx)(v,{event:e}),(0,Y.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,Y.jsx)(g,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,Y.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,Y.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,Y.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,Y.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,Y.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,Y.jsx)(y,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:n,nextCursor:r,onNext:i,onPrevious:a,pageLength:o,pageNumber:s}){return(0,Y.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,Y.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.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,Y.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 ye=e=>oe.filter((t,n)=>n===0||z[t].durationMs<=e*864e5);function be({event:e,eventsLocation:t,touch:r=!1}){return(0,Y.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,Y.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,Y.jsx)(`span`,{className:r?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,Y.jsx)(x,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,Y.jsx)(K,{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:b=`All events`}){let x=_(),S=p>1,C=ye(h),w=m===void 0?void 0:ae(m),T=w!==void 0&&C.includes(w)?w:void 0,E=T!==void 0&&d?(0,Y.jsx)(t,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(T),type:`button`,variant:`outline`,children:`Show the last ${z[T].period}`}):null;return(0,Y.jsxs)(I,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,Y.jsxs)(R,{className:`gap-4 p-4 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(F,{children:(0,Y.jsx)(`h2`,{children:b})}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[m!==void 0&&d?(0,Y.jsx)(de,{label:`Time range`,onPeriodChange:d,period:m,periods:C.map(e=>({value:e,name:`Last ${z[e].period}`}))}):null,(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,Y.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),r?(0,Y.jsx)(ne,{children:r}):null]}),n]}),(0,Y.jsx)(L,{className:`min-w-0 p-0`,children:c?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,Y.jsx)(e,{className:`h-12 w-full`}),(0,Y.jsx)(e,{className:`h-12 w-full`}),(0,Y.jsx)(e,{className:`h-12 w-full`})]}):i?(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(q,{error:i,fallbackTitle:`Event history unavailable`})}):o?(0,Y.jsxs)(Y.Fragment,{children:[o.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,Y.jsx)(ve,{events:o.data,formatter:x,renderIdentity:e=>(0,Y.jsx)(be,{event:e,eventsLocation:a,touch:!0})})}),(0,Y.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,Y.jsxs)(G,{className:`min-w-4xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(U,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-48`,children:`User / installation`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(le,{children:o.data.map(e=>(0,Y.jsxs)(U,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(W,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(g,{value:e.receivedAtMs,formatter:x})}),(0,Y.jsx)(W,{children:(0,Y.jsx)(v,{event:e})}),(0,Y.jsx)(W,{children:(0,Y.jsx)(be,{event:e,eventsLocation:a})}),(0,Y.jsx)(W,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(W,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(y,{event:e})})]},e.id))})]})})]}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S?`No older events in this range.`:m===void 0?b===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${z[m].period}.`}),S?null:E]}),m!==void 0&&o.nextCursor===null&&(o.data.length>0||S)?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),E]}):null,o.data.length>0||S||o.nextCursor?(0,Y.jsx)(X,{hasPrevious:S,label:b,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:o,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=C,selectedEvent:d,selectedInstallId:f}){let p=_(),m=d?Ce(d):void 0,b=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,Y.jsxs)(I,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(R,{className:`p-4 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsx)(F,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,Y.jsxs)(ne,{children:[`Bundle changes and update failures are kept for`,` `,T(u.rawDays),`; the latest report, for`,` `,T(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:i,children:[(0,Y.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,Y.jsxs)(L,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,Y.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Se(d)})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,Y.jsx)(K,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,Y.jsxs)(`dd`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 font-mono text-xs`,children:[m?(0,Y.jsx)(K,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`,pe(m,d.minBundleId)?(0,Y.jsx)(fe,{}):null]})]}),b?(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Not launched yet`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,Y.jsx)(K,{value:b})})]}):null]}),d.httpResponse?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(h,{event:d})}):null]}),(0,Y.jsx)(a,{})]}):null,f===void 0?null:i?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,Y.jsx)(e,{className:`h-10 w-full`}),(0,Y.jsx)(e,{className:`h-10 w-full`}),(0,Y.jsx)(e,{className:`h-10 w-full`})]}):n?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:n instanceof Error?n:Error(),fallbackTitle:`Installation history unavailable`})}):r&&r.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,Y.jsx)(ve,{events:r.data,formatter:p})}),(0,Y.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,Y.jsxs)(G,{className:`min-w-3xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(U,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(le,{children:r.data.map(e=>(0,Y.jsxs)(U,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(W,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(g,{value:e.receivedAtMs,formatter:p})}),(0,Y.jsx)(W,{children:(0,Y.jsx)(v,{event:e})}),(0,Y.jsx)(W,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(W,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(y,{event:e})})]},e.id))})]})}),(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:r.nextCursor,onNext:o,onPrevious:s,pageLength:r.data.length,pageNumber:l})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.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,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:r.nextCursor,onNext:o,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,J.useState)(!1),f=(0,J.useId)(),p=(0,J.useRef)(null),m=!e&&c&&c.data.length>0;return(0,Y.jsxs)(I,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(R,{className:`p-4 sm:px-6`,children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,Y.jsx)(F,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:`Matching installations`})})}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:m?(0,Y.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,Y.jsx)(O,{"aria-hidden":`true`,className:r(u&&`rotate-180`)})}):null})]})}),(0,Y.jsxs)(L,{className:r(`min-h-0 p-0`,m&&!u&&`hidden lg:block`),id:f,children:[e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):c&&c.data.length>0?(0,Y.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:c.data.map(e=>{let t=Te(e),n=e.installId===l;return(0,Y.jsx)(`li`,{children:(0,Y.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,Y.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:Ee(e)}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,Y.jsx)(D,{"aria-hidden":`true`,className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,Y.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:ue(e.installId)})}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:ue(t)}):(0,Y.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,Y.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,Y.jsx)(X,{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,Y.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&r()},role:`search`,children:(0,Y.jsxs)(ce,{className:`gap-2`,children:[(0,Y.jsx)(se,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(N,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,Y.jsx)(j,{children:(0,Y.jsx)(P,{"aria-hidden":`true`})}),(0,Y.jsx)(A,{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,Y.jsx)(j,{align:`inline-end`,children:(0,Y.jsx)(M,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,Y.jsx)(s,{"aria-hidden":`true`})})}):null]}),(0,Y.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,Y.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,Y.jsx)(e,{className:`h-64 w-full lg:h-full`}),(0,Y.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=B.useSearch(),n=B.useNavigate(),r=ee(),[i,a]=(0,J.useState)(e.query??``),[o]=(0,J.useState)(Z),[s]=(0,J.useState)(Z),c=_e({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,J.useEffect)(()=>{a(e.query??``)},[e.query]),(0,J.useEffect)(()=>{e.eventsBefore===void 0&&y({eventsBefore:g},!0)},[g,e.eventsBefore]),(0,J.useEffect)(()=>{m&&e.historyBefore===void 0&&y({historyBefore:v},!0)},[m,v,e.historyBefore]);let x=E({...re(_,g),cursor:e.eventsCursor,limit:20},!h),C=S({cursor:e.searchCursor,identity:f,limit:Ae},p);(0,J.useEffect)(()=>{let e=C.data?.data[0]?.installId;!p||m||e===void 0||y({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,C.data?.data]);let D=w(e.installId??``,m),O=te({beforeReceivedAtMs:v,cursor:e.historyCursor,installId:e.installId??``,limit:je},m),k=D.data??C.data?.data.find(({installId:t})=>t===e.installId)??O.data?.data[0],A=h?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,j=(0,J.useRef)(null),M=ge({id:A,getKey:ie});(0,J.useLayoutEffect)(()=>{!h&&!x.isLoading&&j.current&&(j.current.scrollTop=M?.scrollY??0)},[x.isLoading,h,M?.scrollY,A]);let N=()=>{a(``),y({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},P=(0,Y.jsx)(Oe,{draftQuery:i,onClear:N,onDraftQueryChange:a,onSubmit:()=>{let e=i.trim();if(!e){N();return}y({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:e,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})}});return(0,Y.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,Y.jsx)(me,{view:`events`}),(0,Y.jsx)(`div`,{ref:j,"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,Y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[h?(0,Y.jsx)(I,{className:`shadow-sm`,children:(0,Y.jsxs)(L,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,Y.jsxs)(t,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:N,variant:`ghost`,children:[(0,Y.jsx)(b,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),P]})}):null,h?C.isLoading&&p?(0,Y.jsx)(ke,{}):(0,Y.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,Y.jsx)(De,{error:C.error,onNext:()=>{C.data?.nextCursor&&y({installId:void 0,searchCursor:C.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:C.data,selectedInstallId:e.installId}):null,(0,Y.jsx)(we,{error:O.error??D.error,history:O.data,isLoading:O.isLoading||D.isLoading,onNext:()=>{O.data?.nextCursor&&y({historyCursor:O.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:k,selectedInstallId:e.installId})]}):(0,Y.jsx)(xe,{description:`Downloads, launches, crashes, update failures, and other changes to what an installation runs, newest first, kept for ${T(r.rawDays)}. Launches that change nothing aren't listed.`,error:x.error,eventsLocation:{eventsBefore:g,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:x.data,isFetching:x.isFetching,isLoading:x.isLoading,onNext:()=>{x.data?.nextCursor&&y({eventsCursor:x.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:P})]})},A)]})}export{Me as component};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-CUtcXuY2.js";var t=e;export{t as notFoundComponent};
@@ -1 +0,0 @@
1
- import{Wr as e,ii as t,ir as n}from"./sidebar-Di9SN47G.js";import{f as r,p as i,t as a}from"./uuidv7-zXMtwR9Q.js";import{n as o,t as s}from"./relativeTime-YQt84dYr.js";var c=n(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),l=t(o(),1),u=t(s(),1),d=e();l.default.extend(u.default);function f({uuid:e,format:t=`relative`}){let n=(0,l.default)(a(e));return t===`relative`?(0,d.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,d.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,d.jsxs)(`div`,{className:`flex flex-col`,children:[(0,d.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,d.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}var p=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$/,``)},m=(e,t)=>{if(!e?.trim())return null;let n=p(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}`},h=e=>/^[\w@%+=:,./-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`,g={apk:{label:`APK`,installs:`Android device or emulator`},aab:{label:`AAB`,installs:`Google Play or bundletool`},app:{label:`Simulator app`,installs:`iOS Simulator`},ipa:{label:`IPA`,installs:`registered iOS devices`}},_=e=>e===`ios`?`iOS`:`Android`,v=e=>`/api/native-builds/${encodeURIComponent(e)}/download`,y=e=>i(e.channel_id.slice(8)),b=e=>{if(e.fingerprintHash!==null)return{platform:e.platform,channel:e.channel,fingerprintHash:e.fingerprintHash,appVersion:null};let t=e.targetAppVersion;return t===null||r(t)!==t?null:{platform:e.platform,channel:e.channel,fingerprintHash:null,appVersion:t}},x=e=>{let t=(e.artifact_storage_uri.split(/[?#]/,1)[0]??``).split(`/`).at(-1)??``;try{return decodeURIComponent(t)}catch{return t}},S=e=>e.app_version===null?{label:`Fingerprint`,value:e.fingerprint_hash??``}:{label:`App version`,value:e.app_version},C=[`B`,`KB`,`MB`,`GB`],w=e=>{let t=e,n=0;for(;t>=1024&&n<C.length-1;)t/=1024,n+=1;return`${n===0?t:t.toFixed(1)} ${C[n]}`},T=e=>{let t=x(e),n=t.replace(/\.zip$/,``);return`unzip -o ${h(t)} && xcrun simctl install booted ${h(n)}`},E=e=>`adb install -r ${h(x(e))}`;export{v as a,_ as c,m as d,f,y as i,b as l,w as n,x as o,c as p,g as r,S as s,E as t,T as u};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds-DAy2678K.js","assets/sidebar-Di9SN47G.js","assets/preload-helper-B44EvKhG.js","assets/link-DTEyW70e.js","assets/select-CBIU0_M1.js","assets/useCompositeListItem-JmyDfo3-.js","assets/check-CXVR3s3X.js","assets/arrow-up-right-DK8Zdg40.js","assets/native-builds-BOC71grI.js","assets/relativeTime-YQt84dYr.js","assets/uuidv7-zXMtwR9Q.js","assets/chevron-right-BoUXo82O.js","assets/download-Cf24LBde.js","assets/-native-builds-search-C-TGpFAm.js","assets/refresh-cw-B9HHjLej.js","assets/StoreSubmission-ViTkW4eJ.js","assets/copy-DsuLj3oj.js","assets/badge-DWFcDWho.js","assets/dist-CPlO6ko9.js","assets/api-P2g8dCNg.js","assets/useMutation-DbYw7boA.js","assets/PlatformIcon-BBWQlWm9.js","assets/dialog-CNUPxNxH.js","assets/table-Bpy3SvSo.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./preload-helper-B44EvKhG.js";import{n as r}from"./-native-builds-search-C-TGpFAm.js";var i=t(`/native-builds`)({component:e(()=>n(()=>import(`./native-builds-DAy2678K.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`component`),validateSearch:r});export{i as t};
@@ -1 +0,0 @@
1
- import{$ as e,Fn as t,In as n,Wr as r,ir as i,p as a}from"./sidebar-Di9SN47G.js";import{t as o}from"./link-DTEyW70e.js";import{a as s}from"./preload-helper-B44EvKhG.js";import{t as c}from"./arrow-up-right-DK8Zdg40.js";import{a as l,c as u,f as d,i as ee,n as f,o as p,p as m,r as h,s as g}from"./native-builds-BOC71grI.js";import{t as _}from"./chevron-right-BoUXo82O.js";import{a as v,i as y,n as te,o as ne,r as re,t as ie}from"./select-CBIU0_M1.js";import{t as ae}from"./download-Cf24LBde.js";import{r as oe}from"./-native-builds-search-C-TGpFAm.js";import{t as b}from"./refresh-cw-B9HHjLej.js";import{a as x,i as S,r as C,t as w}from"./StoreSubmission-ViTkW4eJ.js";import{a as T,f as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./badge-DWFcDWho.js";import{t as N}from"./native-builds-D6rldpSh.js";import{t as P}from"./PlatformIcon-BBWQlWm9.js";import{a as F,n as I,o as L,r as R,s as z,t as se}from"./dialog-CNUPxNxH.js";import{f as B,i as V}from"./api-P2g8dCNg.js";import{a as H,i as U,n as W,o as G,r as K,t as ce}from"./table-Bpy3SvSo.js";var le=i(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),ue=i(`hard-drive-download`,[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m16 6-4 4-4-4`,key:`6wukr`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]),q=r(),J=`npx hot-updater native-build import <file>`,Y=`https://hot-updater.dev/docs/guides/native-build#import-a-build-made-elsewhere`;function de(){return(0,q.jsxs)(se,{children:[(0,q.jsxs)(z,{render:(0,q.jsx)(t,{"aria-label":`Import a build`,className:`min-h-11 sm:min-h-7`,size:`sm`,variant:`outline`}),children:[(0,q.jsx)(le,{"data-icon":`inline-start`}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`Import a build`})]}),(0,q.jsxs)(I,{className:`sm:max-w-lg`,children:[(0,q.jsxs)(F,{children:[(0,q.jsx)(L,{children:`Import a build`}),(0,q.jsx)(R,{children:`Track an .ipa, .aab, .apk or .app built elsewhere as a patch base.`})]}),(0,q.jsx)(x,{label:`the import command`,value:J,wrap:!0}),(0,q.jsxs)(`a`,{className:n({className:`min-h-11 w-full sm:min-h-8 sm:w-fit`,variant:`outline`}),href:Y,rel:`noreferrer`,target:`_blank`,children:[`Import guide`,(0,q.jsx)(c,{"data-icon":`inline-end`})]})]})]})}var fe=`https://hot-updater.dev/docs/guides/native-build#register-a-build`,pe=6;function me({channel:e,paged:r,onClearChannel:i,onNewest:a}){return(0,q.jsx)(G,{children:(0,q.jsx)(K,{className:`h-44 text-center text-muted-foreground`,colSpan:pe,children:(0,q.jsxs)(`div`,{className:`mx-auto flex max-w-sm flex-col items-center gap-2 whitespace-normal`,children:[(0,q.jsx)(ue,{"aria-hidden":`true`,className:`size-5`}),r?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`font-medium text-foreground`,children:`No more native builds`}),(0,q.jsx)(t,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:a,variant:`outline`,children:`Show the newest builds`})]}):e===void 0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`font-medium text-foreground`,children:`No native builds`}),(0,q.jsxs)(`p`,{children:[`Build one with`,` `,(0,q.jsx)(`code`,{className:`font-mono text-xs`,children:`native-build android`}),` `,`or `,(0,q.jsx)(`code`,{className:`font-mono text-xs`,children:`native-build ios`}),`, or import one built elsewhere:`]}),(0,q.jsx)(`div`,{className:`w-full text-left`,children:(0,q.jsx)(x,{label:`the import command`,value:J,wrap:!0})}),(0,q.jsxs)(`a`,{className:n({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),href:fe,rel:`noreferrer`,target:`_blank`,children:[`Native build guide`,(0,q.jsx)(c,{"data-icon":`inline-end`})]}),(0,q.jsxs)(`a`,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:Y,rel:`noreferrer`,target:`_blank`,children:[`Import guide`,(0,q.jsx)(c,{"data-icon":`inline-end`})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`font-medium text-foreground`,children:[`No native build embeds `,(0,q.jsx)(`span`,{translate:`no`,children:e})]}),(0,q.jsx)(`p`,{children:`A build embeds the channel it was built on. Build one on this channel, or list every channel's builds.`}),(0,q.jsx)(t,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:i,variant:`outline`,children:`Show all channels`})]})]})})})}function he(){return Array.from({length:3},(t,n)=>(0,q.jsxs)(G,{children:[(0,q.jsxs)(K,{className:`space-y-2 py-3`,children:[n===0?(0,q.jsx)(`span`,{className:`sr-only`,children:`Loading native builds`}):null,(0,q.jsx)(e,{className:`h-3.5 w-40`}),(0,q.jsx)(e,{className:`h-3 w-24`})]}),(0,q.jsx)(K,{className:`hidden md:table-cell`,children:(0,q.jsx)(e,{className:`h-5 w-20`})}),(0,q.jsx)(K,{className:`hidden xl:table-cell`,children:(0,q.jsx)(e,{className:`h-3.5 w-28`})}),(0,q.jsx)(K,{className:`hidden xl:table-cell`,children:(0,q.jsx)(e,{className:`h-3.5 w-14`})}),(0,q.jsx)(K,{className:`hidden sm:table-cell`,children:(0,q.jsx)(e,{className:`h-3.5 w-20`})}),(0,q.jsx)(K,{children:(0,q.jsx)(e,{className:`ml-auto h-6 w-16`})})]},n))}function ge({build:e,onChannel:t}){let r=s(),i=g(e),a=ee(e),c=`${u(e.platform)} ${h[e.artifact_kind].label}`;return(0,q.jsxs)(G,{className:`cursor-pointer`,onClick:()=>void r({to:`/native-builds/$buildId`,params:{buildId:e.id}}),children:[(0,q.jsx)(K,{className:`py-3 whitespace-normal`,children:(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,q.jsx)(P,{className:`size-3.5 shrink-0 text-muted-foreground`,platform:e.platform}),(0,q.jsx)(o,{className:`font-medium underline-offset-4 hover:underline`,onClick:e=>e.stopPropagation(),params:{buildId:e.id},to:`/native-builds/$buildId`,children:c}),(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:f(e.byte_size)}),(0,q.jsx)(w,{build:e,withTime:!0})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,q.jsx)(`span`,{children:i.label}),e.fingerprint_hash===null?(0,q.jsx)(`span`,{className:`font-mono text-foreground`,translate:`no`,children:i.value}):(0,q.jsx)(S,{label:`fingerprint`,length:12,value:e.fingerprint_hash}),e.build_number?(0,q.jsxs)(`span`,{className:`tabular-nums`,translate:`no`,children:[`· build `,e.build_number]}):null,(0,q.jsxs)(`span`,{className:`md:hidden`,translate:`no`,children:[`· `,a]}),e.git_commit_hash===null?null:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1 xl:hidden`,children:[`· commit `,(0,q.jsx)(C,{hash:e.git_commit_hash})]})]}),(0,q.jsxs)(`div`,{className:`text-xs text-muted-foreground xl:hidden`,children:[`Built-in bundle`,` `,(0,q.jsx)(`span`,{className:`font-mono [overflow-wrap:anywhere] text-foreground`,translate:`no`,children:e.min_bundle_id})]})]})}),(0,q.jsx)(K,{className:`hidden md:table-cell`,children:(0,q.jsx)(`button`,{"aria-label":`Show the builds that embed ${a}`,className:`rounded-md text-left focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:e=>{e.stopPropagation(),t(a)},type:`button`,children:(0,q.jsx)(M,{className:`whitespace-nowrap`,translate:`no`,variant:`outline`,children:a})})}),(0,q.jsx)(K,{className:`hidden xl:table-cell`,children:(0,q.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,translate:`no`,children:e.min_bundle_id})}),(0,q.jsx)(K,{className:`hidden xl:table-cell`,children:(0,q.jsx)(C,{hash:e.git_commit_hash})}),(0,q.jsx)(K,{className:`hidden sm:table-cell`,children:(0,q.jsx)(d,{uuid:e.id})}),(0,q.jsx)(K,{className:`text-right`,children:(0,q.jsxs)(`a`,{"aria-label":`Download ${p(e)}`,className:n({className:`min-h-11 sm:min-h-7`,size:`sm`,variant:`outline`}),download:!0,href:l(e.id),onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(ae,{"data-icon":`inline-start`}),`Download`]})})]})}function X({builds:e,channel:n,paged:r,onChannel:i,onPage:a}){let o=e.data?.data,{next:s,previous:c}=e.data??{};return e.isError?(0,q.jsx)(`div`,{className:`p-4`,children:(0,q.jsxs)(O,{variant:`destructive`,children:[(0,q.jsx)(E,{}),(0,q.jsx)(T,{children:`Native builds couldn't be loaded`}),(0,q.jsx)(D,{children:`Check your connection and try again.`}),(0,q.jsx)(A,{children:(0,q.jsxs)(t,{onClick:()=>void e.refetch(),size:`xs`,variant:`outline`,children:[(0,q.jsx)(b,{"data-icon":`inline-start`}),`Retry`]})})]})}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(ce,{"aria-busy":e.isPlaceholderData,"aria-label":`Native builds`,children:[(0,q.jsx)(H,{children:(0,q.jsxs)(G,{children:[(0,q.jsx)(U,{children:`Build`}),(0,q.jsx)(U,{className:`hidden md:table-cell`,children:`Channel`}),(0,q.jsx)(U,{className:`hidden xl:table-cell`,children:`Built-in bundle`}),(0,q.jsx)(U,{className:`hidden xl:table-cell`,children:`Commit`}),(0,q.jsx)(U,{className:`hidden sm:table-cell`,children:`Created`}),(0,q.jsx)(U,{className:`text-right`,children:(0,q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,q.jsx)(W,{children:e.isLoading?(0,q.jsx)(he,{}):o?.length===0?(0,q.jsx)(me,{channel:n,onClearChannel:()=>i(void 0),onNewest:()=>a({}),paged:r}):o?.map(e=>(0,q.jsx)(ge,{build:e,onChannel:i},e.id))})]}),s!==void 0||c!==void 0?(0,q.jsxs)(`nav`,{"aria-label":`Native build pages`,className:`flex items-center justify-end gap-2 border-t px-4 py-2`,children:[(0,q.jsxs)(t,{className:`min-h-11 sm:min-h-7`,disabled:c===void 0||e.isPlaceholderData,onClick:()=>a({after:c}),size:`sm`,variant:`ghost`,children:[(0,q.jsx)(m,{"data-icon":`inline-start`}),`Newer`]}),(0,q.jsxs)(t,{className:`min-h-11 sm:min-h-7`,disabled:s===void 0||e.isPlaceholderData,onClick:()=>a({before:s}),size:`sm`,variant:`ghost`,children:[`Older`,(0,q.jsx)(_,{"data-icon":`inline-end`})]})]}):null]})}var Z=`all`,Q=`channel:`,$=e=>`${Q}${e}`;function _e({search:e,onSearchChange:n}){let{channel:r,before:i,after:o}=e,s=B(e),c=V(),l=c.data?.map(({name:e})=>e)??[],u=r===void 0||l.includes(r)?l:[r,...l],d=e=>n(e===void 0?{}:{channel:e});return(0,q.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,q.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b bg-background px-3 py-3 sm:min-h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,q.jsx)(a,{className:`-ml-1 size-11 lg:size-7`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(oe,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,q.jsx)(`h1`,{className:`text-sm font-medium`,children:`Native builds`})]}),(0,q.jsx)(`p`,{className:`basis-full pl-12 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`Store and test builds, each the built-in bundle its OTAs patch from.`})]}),(0,q.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,q.jsxs)(k,{className:`mx-auto w-full max-w-6xl overflow-hidden shadow-sm`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-3`,children:[(0,q.jsxs)(ie,{items:[{label:`All channels`,value:Z},...u.map(e=>({label:e,value:$(e)}))],onOpenChange:e=>{e&&c.refetch()},onValueChange:e=>d(e?.startsWith(Q)?e.slice(8):void 0),value:r===void 0?Z:$(r),children:[(0,q.jsx)(v,{"aria-label":`Channel`,className:`h-11 min-w-0 flex-1 text-xs sm:h-8 sm:w-48 sm:flex-none`,children:(0,q.jsx)(ne,{})}),(0,q.jsx)(te,{children:(0,q.jsxs)(re,{children:[(0,q.jsx)(y,{value:Z,children:`All channels`}),u.map(e=>(0,q.jsx)(y,{translate:`no`,value:$(e),children:e},e))]})})]}),(0,q.jsx)(`div`,{className:`ml-auto`,children:(0,q.jsx)(de,{})}),(0,q.jsx)(t,{"aria-label":`Refresh native builds`,className:`size-11 sm:size-7`,disabled:s.isLoading,onClick:()=>void s.refetch(),size:`icon-sm`,variant:`ghost`,children:(0,q.jsx)(b,{"aria-hidden":`true`})})]}),(0,q.jsx)(j,{className:`p-0`,children:(0,q.jsx)(X,{builds:s,channel:r,onChannel:d,onPage:e=>n({...r===void 0?{}:{channel:r},...e}),paged:i!==void 0||o!==void 0})})]})})]})}function ve(){let e=N.useSearch(),t=N.useNavigate();return(0,q.jsx)(_e,{onSearchChange:e=>void t({search:e}),search:e})}export{ve as component};
@@ -1 +0,0 @@
1
- import{$ as e,Fn as t,In as n,Ln as r,Wr as i,ii as a,ir as o,p as s,ti as c}from"./sidebar-Di9SN47G.js";import{t as l}from"./link-DTEyW70e.js";import{t as u}from"./arrow-up-right-DK8Zdg40.js";import{a as d,c as f,f as p,n as m,o as ee,p as te,r as ne,s as re,t as ie,u as ae}from"./native-builds-BOC71grI.js";import{t as oe}from"./chevron-right-BoUXo82O.js";import{n as se,t as h}from"./native-builds_._buildId-DvQDKnUQ.js";import{t as ce}from"./download-Cf24LBde.js";import{n as le,t as ue}from"./history-DqHlgSuV.js";import{r as de}from"./-native-builds-search-C-TGpFAm.js";import{t as fe}from"./refresh-cw-B9HHjLej.js";import{a as g,i as pe,n as _,r as me,t as he}from"./StoreSubmission-ViTkW4eJ.js";import{a as v,d as y,f as b,i as x,n as S,o as C,r as ge,s as w,t as T,u as E}from"./badge-DWFcDWho.js";import{r as _e}from"./uuidv7-zXMtwR9Q.js";import{a as D,i as O,n as k,o as A,r as j,t as M}from"./empty-B3Uwdd6k.js";import{t as ve}from"./PlatformIcon-BBWQlWm9.js";import{d as ye,l as be,u as xe}from"./api-P2g8dCNg.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./table-Bpy3SvSo.js";import{t as Se}from"./RolloutPercentageBadge-Cxogpi8F.js";var Ce=o(`package-open`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),z=i();function B({label:e,children:t}){return(0,z.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[10rem_minmax(0,1fr)] sm:gap-4`,children:[(0,z.jsx)(`dt`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,z.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}function we({detail:e}){let{build:t,newestInScope:n}=e;return n===null?null:n.id===t.id?(0,z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/40 p-3 text-xs`,children:[(0,z.jsx)(se,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,z.jsxs)(`p`,{children:[(0,z.jsx)(`span`,{className:`font-medium`,children:`Current baseline.`}),` New deploys to this scope add a patch from this build's bundle.`]})]}):(0,z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/40 p-3 text-xs`,children:[(0,z.jsx)(ue,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,z.jsxs)(`p`,{children:[(0,z.jsx)(`span`,{className:`font-medium`,children:`Superseded`}),` by`,` `,(0,z.jsxs)(l,{className:`inline-flex items-center gap-0.5 font-medium underline underline-offset-4`,params:{buildId:n.id},to:`/native-builds/$buildId`,children:[f(n.platform),` `,ne[n.artifact_kind].label,` ·`,` `,(0,z.jsx)(p,{uuid:n.id}),(0,z.jsx)(u,{"aria-hidden":`true`,className:`size-3`})]}),`. New deploys patch from that build, so this one gets no new patches.`]})]})}function Te({detail:e}){let{build:t,builtInBundle:n,channel:r}=e,i=re(t),a=n?.childCount??0;return(0,z.jsxs)(C,{className:`overflow-hidden shadow-sm`,children:[(0,z.jsx)(E,{className:`border-b px-4 py-3`,children:(0,z.jsx)(y,{className:`text-sm`,children:(0,z.jsx)(`h2`,{children:`Built-in bundle`})})}),(0,z.jsxs)(w,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,z.jsxs)(`dl`,{className:`flex flex-col gap-3`,children:[(0,z.jsx)(B,{label:`Bundle ID`,children:(0,z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:t.min_bundle_id})}),(0,z.jsx)(B,{label:`OTAs patching from it`,children:(0,z.jsx)(`span`,{className:`tabular-nums`,children:a===1?`1 bundle`:`${a} bundles`})}),(0,z.jsx)(B,{label:`Scope`,children:(0,z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,z.jsx)(l,{"aria-label":`Show the builds that embed ${r}`,search:{channel:r},to:`/native-builds`,children:(0,z.jsx)(T,{translate:`no`,variant:`outline`,children:r})}),(0,z.jsx)(`span`,{className:`text-xs`,children:f(t.platform)}),(0,z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`· `,i.label]}),t.fingerprint_hash===null?(0,z.jsx)(`span`,{className:`font-mono text-xs`,translate:`no`,children:i.value}):(0,z.jsx)(pe,{label:`fingerprint`,length:12,value:t.fingerprint_hash})]})}),t.build_number?(0,z.jsx)(B,{label:`Build number`,children:(0,z.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,translate:`no`,children:t.build_number})}):null,_(t)?(0,z.jsx)(B,{label:`Store`,children:(0,z.jsx)(he,{build:t,withTime:!0})}):null,(0,z.jsx)(B,{label:`Commit`,children:(0,z.jsx)(me,{hash:t.git_commit_hash})}),(0,z.jsx)(B,{label:`Created`,children:(0,z.jsx)(p,{format:`both`,uuid:t.id})})]}),(0,z.jsx)(we,{detail:e}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A store or test install of this build runs this bundle until its first OTA. That OTA downloads as a patch from this bundle when one exists, and as the full bundle otherwise.`})]})]})}var Ee=a(c(),1),V=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(V||{}),De=[0,1],Oe=[1,0],ke=[2,3],Ae=[3,2],je={L:De,M:Oe,Q:ke,H:Ae},Me=/^\d*$/,Ne=/^[A-Z0-9 $%*+./:-]*$/,H=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,U=1,W=40,Pe=3,Fe=3,G=40,Ie=10,Le=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Re=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],ze=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<U||e>W)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,V.Timing),this.setFunctionModule(e,6,e%2==0,V.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,q(r,e));this.setFunctionModule(8,7,q(r,6)),this.setFunctionModule(8,8,q(r,7)),this.setFunctionModule(7,8,q(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,q(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,q(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,q(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=q(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,V.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,V.Alignment)}setFunctionModule(e,t,n,r=V.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==X(t,n))throw RangeError(`Invalid argument`);let r=Re[n[0]][t],i=Le[n[0]][t],a=Math.floor(Y(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=Qe(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=$e(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(Y(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=q(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=Pe:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*G),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*G}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=Pe:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*G),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*G}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=Fe)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*Ie,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function K(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function q(e,t){return(e>>>t&1)!=0}var J=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},Be=[1,10,12,14],Ve=[2,9,11,13],He=[4,8,16,16];function Ue(e,t){return e[Math.floor((t+7)/17)+1]}function We(e){let t=[];for(let n of e)K(n,8,t);return new J(He,e.length,t)}function Ge(e){if(!Je(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);K(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new J(Be,e.length,t)}function Ke(e){if(!Ye(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n;for(n=0;n+2<=e.length;n+=2){let r=H.indexOf(e.charAt(n))*45;r+=H.indexOf(e.charAt(n+1)),K(r,11,t)}return n<e.length&&K(H.indexOf(e.charAt(n)),6,t),new J(Ve,e.length,t)}function qe(e){return e===``?[]:Je(e)?[Ge(e)]:Ye(e)?[Ke(e)]:[We(Ze(e))]}function Je(e){return Me.test(e)}function Ye(e){return Ne.test(e)}function Xe(e,t){let n=0;for(let r of e){let e=Ue(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function Ze(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function Y(e){if(e<U||e>W)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function X(e,t){return Math.floor(Y(e)/8)-Le[t[0]][e]*Re[t[0]][e]}function Qe(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=Z(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=Z(n,2)}return t}function $e(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=Z(t,e))}return n}function Z(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function et(e,t,n=1,r=40,i=-1,a=!0){if(!(U<=n&&n<=r&&r<=W)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=X(o,t)*8,i=Xe(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[Oe,ke,Ae])a&&s<=X(o,e)*8&&(t=e);let c=[];for(let t of e){K(t.mode[0],4,c),K(t.numChars,Ue(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=X(o,t)*8;K(0,Math.min(4,l-c.length),c),K(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)K(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new ze(o,t,u,i)}function tt(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?qe(e):Array.isArray(e)?[We(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=et(c,je[n],i,a,o,r),u=nt({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function nt(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=V.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}var rt=e=>{let{data:t,size:n}=tt(e,{ecc:`M`,border:4}),r=``;return t.forEach((e,t)=>e.forEach((e,n)=>{e&&(r+=`M${n} ${t}h1v1h-1z`)})),{size:n,path:r}};function it({value:e,label:t,className:n}){let{size:i,path:a}=(0,Ee.useMemo)(()=>rt(e),[e]);return(0,z.jsxs)(`svg`,{"aria-label":t,className:r(`aspect-square rounded-md`,n),role:`img`,shapeRendering:`crispEdges`,viewBox:`0 0 ${i} ${i}`,children:[(0,z.jsx)(`rect`,{fill:`#fff`,height:i,width:i}),(0,z.jsx)(`path`,{d:a,fill:`#000`})]})}var Q={ipa:`The .ipa installs only on devices its signing profile allows (development or ad hoc); an App Store export reaches testers through TestFlight.`,aab:`The .aab installs through Google Play or bundletool, not from the file.`},at={apk:`Scan with an Android phone's camera, then open the APK to install it.`,ipa:`Scan to download. ${Q.ipa}`,aab:`Scan to download. ${Q.aab}`,app:`Scan to download the .app.zip on a Mac.`};function ot({build:t}){let n=xe(t.id,!0),r=n.data?.url;if(r===null){let e=Q[t.artifact_kind];return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 text-xs text-muted-foreground`,children:[(0,z.jsx)(`p`,{children:`This storage gives no download link a phone can open without signing in, so there is no QR code. Download the build here, or open this page on the phone signed in to the console.`}),e?(0,z.jsx)(`p`,{children:e}):null]})}return(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[r===void 0?n.isError?(0,z.jsxs)(S,{variant:`destructive`,children:[(0,z.jsx)(b,{}),(0,z.jsx)(v,{children:`The download link couldn't be created`}),(0,z.jsx)(x,{children:n.error.message})]}):(0,z.jsx)(e,{className:`size-48`}):(0,z.jsx)(it,{className:`size-48`,label:`Download ${ee(t)}`,value:r}),(0,z.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:at[t.artifact_kind]})]})}function $({build:e}){return(0,z.jsx)(`span`,{className:`font-mono text-foreground`,translate:`no`,children:e.submitted_version??`this build`})}function st({build:e}){switch(e.artifact_kind){case`apk`:return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On an emulator or a phone over USB, download the APK and install it:`}),(0,z.jsx)(g,{label:`the install command`,value:ie(e)})]});case`app`:return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It runs only in the iOS Simulator. Install it on the booted one:`}),(0,z.jsx)(g,{label:`the install command`,value:ae(e)})]});case`aab`:return _(e)?(0,z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Submitted to Google Play internal testing as`,` `,(0,z.jsx)($,{build:e}),`. Testers get it once its release is rolled out; on an app Play Console hasn't published, the release is a draft you roll out in Play Console.`]}):(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`For testers, build and release to internal testing:`}),(0,z.jsx)(g,{label:`the Google Play command`,value:`npx hot-updater google-play upload`})]});case`ipa`:return _(e)?(0,z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`On TestFlight as `,(0,z.jsx)($,{build:e}),`.`]}):(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Over USB, Xcode or Apple Configurator installs it. For testers:`}),(0,z.jsx)(g,{label:`the TestFlight command`,value:`npx hot-updater testflight`})]})}}function ct({build:e}){let t=ee(e);return(0,z.jsxs)(C,{className:`overflow-hidden shadow-sm`,children:[(0,z.jsx)(E,{className:`border-b px-4 py-3`,children:(0,z.jsx)(y,{className:`text-sm`,children:(0,z.jsx)(`h2`,{children:`Install`})})}),(0,z.jsxs)(w,{className:`grid gap-6 p-4 sm:grid-cols-[12rem_minmax(0,1fr)] sm:p-6`,children:[(0,z.jsx)(ot,{build:e}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,z.jsx)(st,{build:e}),(0,z.jsxs)(`a`,{className:n({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`,variant:`outline`}),download:!0,href:d(e.id),children:[(0,z.jsx)(ce,{"data-icon":`inline-start`}),(0,z.jsxs)(`span`,{className:`text-left [overflow-wrap:anywhere]`,children:[`Download `,t]})]})]})]})]})}var lt=`https://hot-updater.dev/docs/guides/bundle-diffing#first-ota-update`;function ut({detail:r,page:i,onPage:a}){let o=i.before!==void 0||i.after!==void 0,s=ye(r.build.min_bundle_id,i,o),c=o?s.data:r.patches,{next:d,previous:f}=c??{};return(0,z.jsxs)(C,{className:`overflow-hidden shadow-sm`,id:`patches`,children:[(0,z.jsx)(E,{className:`border-b px-4 py-3`,children:(0,z.jsx)(y,{className:`text-sm`,children:(0,z.jsx)(`h2`,{children:`Patches from this build`})})}),(0,z.jsxs)(w,{className:`p-0`,children:[o&&s.isError?(0,z.jsx)(`div`,{className:`p-4`,children:(0,z.jsxs)(S,{variant:`destructive`,children:[(0,z.jsx)(b,{}),(0,z.jsx)(v,{children:`Patches couldn't be loaded`}),(0,z.jsx)(x,{children:s.error.message}),(0,z.jsx)(ge,{children:(0,z.jsxs)(t,{onClick:()=>void s.refetch(),size:`xs`,variant:`outline`,children:[(0,z.jsx)(fe,{"data-icon":`inline-start`}),`Retry`]})})]})}):c===void 0?(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:`Loading patches`}),(0,z.jsx)(e,{className:`h-4 w-full`}),(0,z.jsx)(e,{className:`h-4 w-2/3`})]}):c.data.length===0?o?(0,z.jsxs)(M,{className:`py-10`,children:[(0,z.jsx)(O,{children:(0,z.jsx)(A,{children:`No more patches`})}),(0,z.jsx)(t,{className:`min-h-11 sm:min-h-8`,onClick:()=>a({}),variant:`outline`,children:`Show the newest patches`})]}):(0,z.jsxs)(M,{className:`py-10`,children:[(0,z.jsxs)(O,{children:[(0,z.jsx)(D,{variant:`icon`,children:(0,z.jsx)(le,{})}),(0,z.jsx)(A,{children:`No patches from this build`}),(0,z.jsxs)(j,{children:[`A deploy adds a patch from this build's bundle while it is its scope's newest build and the deploy config turns patches on, with `,(0,z.jsx)(`code`,{className:`font-mono`,children:`patch`}),` in`,` `,(0,z.jsx)(`code`,{className:`font-mono`,children:`hot-updater.config.ts`}),`.`]})]}),(0,z.jsx)(k,{children:(0,z.jsxs)(`a`,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:lt,rel:`noreferrer`,target:`_blank`,children:[`Bundle diffing guide`,(0,z.jsx)(u,{"data-icon":`inline-end`})]})})]}):(0,z.jsxs)(R,{"aria-busy":o&&s.isPlaceholderData,"aria-label":`Patches from this build`,className:`table-fixed`,children:[(0,z.jsx)(N,{children:(0,z.jsxs)(I,{children:[(0,z.jsx)(P,{children:`Target bundle`}),(0,z.jsx)(P,{className:`w-28`,children:`Patch size`}),(0,z.jsx)(P,{className:`hidden w-32 sm:table-cell`,children:`Created`})]})}),(0,z.jsx)(F,{children:c.data.map(e=>(0,z.jsxs)(I,{children:[(0,z.jsx)(L,{className:`py-3 whitespace-normal`,children:(0,z.jsx)(l,{className:`block font-mono text-xs [overflow-wrap:anywhere] underline-offset-4 hover:underline`,search:{bundleId:e.bundleId},title:e.bundleId,to:`/`,translate:`no`,children:e.bundleId})}),(0,z.jsx)(L,{className:`text-xs tabular-nums`,children:m(e.byteSize)}),(0,z.jsx)(L,{className:`hidden sm:table-cell`,children:(0,z.jsx)(p,{uuid:e.bundleId})})]},e.bundleId))})]}),d!==void 0||f!==void 0?(0,z.jsxs)(`nav`,{"aria-label":`Patch pages`,className:`flex items-center justify-end gap-2 border-t px-4 py-2`,children:[(0,z.jsxs)(t,{className:`min-h-11 sm:min-h-7`,disabled:f===void 0||o&&s.isPlaceholderData,onClick:()=>a({after:f}),size:`sm`,variant:`ghost`,children:[(0,z.jsx)(te,{"data-icon":`inline-start`}),`Newer`]}),(0,z.jsxs)(t,{className:`min-h-11 sm:min-h-7`,disabled:d===void 0||o&&s.isPlaceholderData,onClick:()=>a({before:d}),size:`sm`,variant:`ghost`,children:[`Older`,(0,z.jsx)(oe,{"data-icon":`inline-end`})]})]}):null]})]})}var dt=(e,t)=>{let n=e.data.find(e=>e.bundleId===t);if(n!==void 0)return{kind:`patch`,byteSize:n.byteSize};let r=e.data.at(-1)?.bundleId;return e.next!==void 0&&r!==void 0&&t<r?{kind:`unknown`}:{kind:`full`}};function ft({download:e}){switch(e.kind){case`patch`:return(0,z.jsxs)(`span`,{className:`text-xs`,children:[`Patch`,` `,(0,z.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`(`,m(e.byteSize),`)`]})]});case`full`:return(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Full bundle`});case`unknown`:return(0,z.jsx)(`a`,{className:`text-xs underline-offset-4 hover:underline`,href:`#patches`,children:`See patches`})}}function pt({detail:e}){let{servedNow:t,patches:r,catalogScopeKey:i}=e,a=(0,z.jsxs)(l,{className:`inline-flex items-center gap-0.5 underline-offset-4 hover:underline`,search:{scopeKey:i},to:`/`,children:[`All releases in this scope`,(0,z.jsx)(u,{"aria-hidden":`true`,className:`size-3`})]});return(0,z.jsxs)(C,{className:`overflow-hidden shadow-sm`,children:[(0,z.jsx)(E,{className:`border-b px-4 py-3`,children:(0,z.jsx)(y,{className:`text-sm`,children:(0,z.jsx)(`h2`,{children:`Served now`})})}),(0,z.jsx)(w,{className:`p-0`,children:t.length===0?(0,z.jsxs)(M,{className:`py-10`,children:[(0,z.jsxs)(O,{children:[(0,z.jsx)(D,{variant:`icon`,children:(0,z.jsx)(Ce,{})}),(0,z.jsx)(A,{children:`No OTA for this build yet`}),(0,z.jsxs)(j,{children:[`No release in this build's scope is newer than its built-in bundle. Deploy one with`,` `,(0,z.jsx)(`code`,{className:`font-mono`,children:`hot-updater deploy`}),`, and it shows here.`]})]}),(0,z.jsx)(k,{children:(0,z.jsx)(l,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),search:{scopeKey:i},to:`/`,children:`All releases in this scope`})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(R,{"aria-label":`Served now`,className:`table-fixed`,children:[(0,z.jsx)(N,{children:(0,z.jsxs)(I,{children:[(0,z.jsx)(P,{children:`Bundle`}),(0,z.jsx)(P,{className:`hidden w-40 md:table-cell`,children:`Rollout`}),(0,z.jsx)(P,{className:`hidden w-32 sm:table-cell`,children:`Created`}),(0,z.jsx)(P,{className:`w-32`,children:`First OTA download`})]})}),(0,z.jsx)(F,{children:t.map(e=>{let t=e.bundleId,n=e.rolloutCohortCount/_e*100;return(0,z.jsxs)(I,{children:[(0,z.jsx)(L,{className:`py-3 whitespace-normal`,children:(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,z.jsx)(l,{className:`font-mono text-xs [overflow-wrap:anywhere] underline-offset-4 hover:underline`,search:{releaseId:e.releaseId},title:t,to:`/`,translate:`no`,children:t}),e.message?(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.message}):null]})}),(0,z.jsx)(L,{className:`hidden md:table-cell`,children:(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.targetCohorts.length>0?(0,z.jsx)(T,{variant:`secondary`,children:e.targetCohorts.length===1?`1 cohort`:`${e.targetCohorts.length} cohorts`}):(0,z.jsx)(Se,{percentage:n}),e.shouldForceUpdate?(0,z.jsx)(T,{variant:`outline`,children:`Forced`}):null]})}),(0,z.jsx)(L,{className:`hidden sm:table-cell`,children:(0,z.jsx)(p,{uuid:t})}),(0,z.jsx)(L,{children:(0,z.jsx)(ft,{download:dt(r,t)})})]},e.releaseId)})})]}),(0,z.jsxs)(`p`,{className:`border-t px-4 py-3 text-xs text-muted-foreground`,children:[`What the update check serves an install of this build now, newest first: not the history. `,a]})]})})]})}function mt({buildId:r,search:i,onSearchChange:a}){let o=be(r),c=o.data,u={...i.patchesBefore===void 0?{}:{before:i.patchesBefore},...i.patchesAfter===void 0?{}:{after:i.patchesAfter}};return(0,z.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 items-center gap-x-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,z.jsx)(s,{className:`-ml-1 size-11 lg:size-7`}),(0,z.jsxs)(l,{className:n({className:`min-h-11 sm:min-h-7`,size:`sm`,variant:`ghost`}),to:`/native-builds`,children:[(0,z.jsx)(te,{"data-icon":`inline-start`}),`Native builds`]}),c?(0,z.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-1.5 text-sm font-medium`,children:[(0,z.jsx)(ve,{className:`size-3.5 shrink-0 text-muted-foreground`,platform:c.build.platform}),(0,z.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[f(c.build.platform),` `,ne[c.build.artifact_kind].label,` ·`,` `,(0,z.jsx)(`span`,{translate:`no`,children:c.channel})]}),(0,z.jsx)(`span`,{className:`hidden text-xs font-normal text-muted-foreground tabular-nums sm:inline`,children:m(c.build.byte_size)})]}):(0,z.jsx)(`h1`,{className:`sr-only`,children:`Native build`})]}),(0,z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,z.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 sm:gap-6`,children:o.isError?(0,z.jsxs)(S,{variant:`destructive`,children:[(0,z.jsx)(b,{}),(0,z.jsx)(v,{children:`The native build couldn't be loaded`}),(0,z.jsx)(x,{children:o.error.message}),(0,z.jsx)(ge,{children:(0,z.jsxs)(t,{onClick:()=>void o.refetch(),size:`xs`,variant:`outline`,children:[(0,z.jsx)(fe,{"data-icon":`inline-start`}),`Retry`]})})]}):c===void 0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`sr-only`,children:`Loading the native build`}),(0,z.jsx)(e,{className:`h-56 w-full rounded-xl`}),(0,z.jsx)(e,{className:`h-64 w-full rounded-xl`})]}):c===null?(0,z.jsxs)(M,{className:`border py-16`,children:[(0,z.jsxs)(O,{children:[(0,z.jsx)(D,{variant:`icon`,children:(0,z.jsx)(de,{})}),(0,z.jsx)(A,{children:`Native build not found`}),(0,z.jsxs)(j,{children:[`No native build has this ID. It may have been deleted with`,` `,(0,z.jsx)(`code`,{className:`font-mono`,children:`native-build delete`}),`, or be from another console.`]})]}),(0,z.jsx)(k,{children:(0,z.jsx)(l,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),to:`/native-builds`,children:`Show all native builds`})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ct,{build:c.build}),(0,z.jsx)(Te,{detail:c}),(0,z.jsx)(pt,{detail:c}),(0,z.jsx)(ut,{detail:c,onPage:e=>a({...e.before===void 0?{}:{patchesBefore:e.before},...e.after===void 0?{}:{patchesAfter:e.after}}),page:u})]})})})]})}function ht(){let{buildId:e}=h.useParams(),t=h.useSearch(),n=h.useNavigate();return(0,z.jsx)(mt,{buildId:e,onSearchChange:e=>void n({search:e,replace:!0}),search:t})}export{ht as component};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds_._buildId-DD58_Phd.js","assets/sidebar-Di9SN47G.js","assets/link-DTEyW70e.js","assets/arrow-up-right-DK8Zdg40.js","assets/native-builds-BOC71grI.js","assets/relativeTime-YQt84dYr.js","assets/uuidv7-zXMtwR9Q.js","assets/chevron-right-BoUXo82O.js","assets/download-Cf24LBde.js","assets/history-DqHlgSuV.js","assets/-native-builds-search-C-TGpFAm.js","assets/refresh-cw-B9HHjLej.js","assets/StoreSubmission-ViTkW4eJ.js","assets/copy-DsuLj3oj.js","assets/badge-DWFcDWho.js","assets/dist-CPlO6ko9.js","assets/api-P2g8dCNg.js","assets/useMutation-DbYw7boA.js","assets/PlatformIcon-BBWQlWm9.js","assets/RolloutPercentageBadge-Cxogpi8F.js","assets/empty-B3Uwdd6k.js","assets/table-Bpy3SvSo.js"])))=>i.map(i=>d[i]);
2
- import{ir as e}from"./sidebar-Di9SN47G.js";import{n as t,r as n,t as r}from"./preload-helper-B44EvKhG.js";import{t as i}from"./-native-builds-search-C-TGpFAm.js";var a=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),o=n(`/native-builds_/$buildId`)({component:t(()=>r(()=>import(`./native-builds_._buildId-DD58_Phd.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),`component`),validateSearch:i});export{a as n,o as t};
@@ -1,6 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-config-gXeH6PBW.js","assets/ConsoleFeatureUnavailable-CUtcXuY2.js","assets/sidebar-Di9SN47G.js","assets/console-features-api-DEXSwFtc.js","assets/arrow-up-right-DK8Zdg40.js","assets/NotFoundPage-DZ3DxyRA.js","assets/link-DTEyW70e.js","assets/empty-B3Uwdd6k.js","assets/remote-config-WjpozBG5.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,Bn as t,Fn as n,Gn as r,Gr as i,Hn as a,Jn as o,Ln as s,Or as c,Rn as l,Vn as u,Vr as d,Wr as f,Yt as p,Z as m,Zn as h,ar as g,fn as _,ii as v,ir as y,nr as b,p as x,rr as S,ti as C,ut as ee,zr as w}from"./sidebar-Di9SN47G.js";import{n as te,r as ne,t as T}from"./preload-helper-B44EvKhG.js";import{t as E}from"./useInfiniteQuery-DX4WpBRG.js";import{t as D}from"./useMutation-DbYw7boA.js";import{r as O}from"./console-features-api-DEXSwFtc.js";import{t as re}from"./arrow-right-CNII8TYn.js";import{i as ie}from"./useCompositeListItem-JmyDfo3-.js";import{a as ae,i as k,n as oe,o as se,r as ce,s as le,t as A}from"./select-CBIU0_M1.js";import{t as ue}from"./clipboard-DQbOcrL7.js";import{n as de,t as fe}from"./history-DqHlgSuV.js";import{n as pe,t as j}from"./plus-BReVKct-.js";import{t as me}from"./refresh-cw-B9HHjLej.js";import{i as he,n as ge,o as _e,r as ve,s as ye,t as be}from"./input-group-D3OUBk4n.js";import{t as xe}from"./search-BCel4Oy6.js";import{a as Se,i as Ce,n as M,r as we,t as Te}from"./switch-BpdiHL_t.js";import{t as Ee}from"./smartphone-CMaSy_ir.js";import{a as N,c as De,d as Oe,f as P,i as F,n as I,o as L,r as R,s as ke,t as z,u as Ae}from"./badge-DWFcDWho.js";import{t as je}from"./undo-2-CUX96_BG.js";import{n as B}from"./dist-CPlO6ko9.js";import{a as Me,i as Ne,n as Pe,o as Fe,r as Ie,t as V}from"./empty-B3Uwdd6k.js";import{n as Le,t as Re}from"./relativeTime-YQt84dYr.js";import{a as ze,i as Be,n as Ve,o as He,r as Ue,t as We}from"./tabs-Xmt7tZeG.js";import{a as Ge,i as Ke,l as qe,n as Je,o as Ye,r as Xe,s as Ze,t as Qe}from"./alert-dialog-BqYScr9y.js";import{t as $e}from"./PlatformIcon-BBWQlWm9.js";import{a as et,i as tt,n as nt,o as rt,r as it,t as at}from"./dialog-CNUPxNxH.js";import{a as H,i as ot,n as st,o as ct,r as U,s as lt,t as W}from"./field-D-2-mnNh.js";import{i as ut}from"./api-P2g8dCNg.js";var dt=y(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),ft=y(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),pt=y(`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`}]]),mt=y(`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`}]]),ht=y(`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=y(`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=v(C()),K=f(),_t=v(Le(),1),vt=v(Re(),1),yt=d({method:`GET`}).middleware([b]).handler(i(`0ccfae64b399b03d820328fa98a38e2caa0b622d3da5a7ca633c5a0e8101e3f6`)),bt=d({method:`GET`}).middleware([b]).handler(i(`3377db68b9d1d971971595469029c0466da0777a177b294d655cd0c039737f1a`)),xt=d({method:`GET`}).middleware([b]).handler(i(`af71e3c55a659ce46093e33b9d70e729359610eec7d576502e8f0e26c785b317`)),St=d({method:`POST`}).middleware([b]).handler(i(`4182bf9ccbb675700638f30bc6122517ccd90b16a339a6823a0f5f6c808d70a6`)),Ct=d({method:`POST`}).middleware([b]).handler(i(`98c10bdc514eb4d3fe65af546be44452b492a81092cfe45625778a4c9f731727`)),wt=d({method:`POST`}).middleware([b]).handler(i(`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})=>E({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=w();return async()=>{await Promise.all([e.invalidateQueries({queryKey:q.active}),e.invalidateQueries({queryKey:q.versions})])}},kt=()=>{let e=Ot();return D({mutationFn:e=>St({data:e}),onSuccess:async t=>{(t.status===`published`||t.status===`conflict`)&&await e()}})},At=()=>D({mutationFn:e=>Ct({data:e}),onSuccess:Ot()}),jt=e=>g({queryKey:q.preview(e),queryFn:()=>wt({data:e}),placeholderData:c,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:i,state:o=a,props:s=u,refs:c=u,metadata:l,stateAttributesMapping:d,tag:f=`div`,...p}=e,{compositeProps:m,compositeRef:h}=He({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:f,nativeButton:m=!0,style:h,...g}=e,v=ee(f||void 0),y=hn(),b=y?.value??[],x=y?void 0:a,S=(o||y?.disabled)??!1,[C,w]=ie({controlled:y?v!==void 0&&b.indexOf(v)>-1:l,default:x,name:`Toggle`,state:`pressed`}),{getButtonProps:te,buttonRef:ne}=r({disabled:S,native:m}),T={disabled:S,pressed:C},E=[ne,n],D=[{"aria-pressed":C,onClick(e){let t=!C,n=p(_,e.nativeEvent);v&&y?.setGroupValue?.(v,t,n),c?.(t,n),!n.isCanceled&&w(t)}},g,te],O=t(`button`,e,{enabled:!y,state:T,ref:E,props:D});return y?(0,K.jsx)(gn,{tag:`button`,render:u,className:i,style:h,state:T,refs:E,props:D}):O}),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,...m}=e,g=le(!0),_=G.useMemo(()=>l!==void 0||r!==void 0,[l,r]),v=(g?.disabled??!1)||i,[y,b]=ie({controlled:l,default:l===void 0?r??u:void 0,name:`ToggleGroup`,state:`value`}),x=h((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,_]),ee={role:`group`},w=t(`div`,e,{enabled:!!g,state:S,ref:n,props:[ee,m],stateAttributesMapping:yn});return(0,K.jsx)(mn.Provider,{value:C,children:g?w:(0,K.jsx)(ze,{render:f,className:d,style:p,state:S,refs:[n],props:[ee,m],stateAttributesMapping:yn,loopFocus:a,enableHomeAndEndKeys:!0,orientation:s})})}),xn=l(`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)(_e,{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)(m,{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)(be,{className:`h-11 sm:h-9`,children:[(0,K.jsx)(he,{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)(ge,{align:`inline-end`,children:(0,K.jsx)(ve,{"aria-label":`Clear ${t.toLowerCase()}`,className:`size-11 sm:size-5`,onClick:()=>a(void 0),size:`icon-xs`,children:(0,K.jsx)(S,{})})})]}),(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=ut();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)($e,{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)(j,{"data-icon":`inline-start`}),r]},r))]}):null]})}case`appVersion`:return(0,K.jsx)(m,{"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)(m,{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)(m,{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)(m,{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=we(e);return(0,K.jsx)(at,{onOpenChange:t,open:e,children:(0,K.jsx)(nt,{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,p]=(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(),p(!0),!b&&r({name:g.trim(),rules:u.map(e=>e.type===`appVersion`?{...e,range:e.range.trim()}:e)})},children:[(0,K.jsxs)(et,{children:[(0,K.jsx)(rt,{children:e===null?`Add condition`:`Edit condition`}),(0,K.jsx)(it,{children:`A device matches when it matches every rule.`})]}),(0,K.jsxs)(ot,{children:[(0,K.jsxs)(W,{"data-invalid":f&&_!==null||void 0,children:[(0,K.jsx)(H,{htmlFor:`${a}-name`,children:`Name`}),(0,K.jsx)(m,{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)(st,{children:`Optional: without one, it is named after its rules.`}),(0,K.jsx)(U,{children:f?_:null})]}),(0,K.jsxs)(lt,{children:[(0,K.jsx)(ct,{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)(Ce,{})})]}),(0,K.jsx)(kn,{onChange:e=>d(u.map((n,r)=>r===t?e:n)),rule:e}),(0,K.jsx)(st,{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)(A,{items:Object.fromEntries(y.map(e=>[e,Y[e]])),onValueChange:e=>{e!==null&&d([...u,pn(e)])},value:null,children:[(0,K.jsxs)(ae,{"aria-label":`Add a rule`,className:`min-h-11 w-full sm:min-h-9 sm:w-56`,children:[(0,K.jsx)(j,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(se,{placeholder:`Add a rule`})]}),(0,K.jsx)(oe,{alignItemWithTrigger:!1,children:(0,K.jsx)(ce,{children:y.map(e=>(0,K.jsx)(k,{value:e,children:Y[e]},e))})})]}):null]})]}),(0,K.jsxs)(tt,{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=M(a),u=M(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)(L,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Ae,{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)(Oe,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Conditions`})}),(0,K.jsx)(De,{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)(j,{"data-icon":`inline-start`}),`Add condition`]})]}),(0,K.jsx)(ke,{className:`p-0`,children:f.length===0?(0,K.jsxs)(V,{className:`py-10`,children:[(0,K.jsxs)(Ne,{children:[(0,K.jsx)(Me,{variant:`icon`,children:(0,K.jsx)(de,{})}),(0,K.jsx)(Fe,{children:`No conditions`}),(0,K.jsx)(Ie,{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)(Pe,{children:(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-7`,onClick:()=>o({condition:null}),children:[(0,K.jsx)(j,{"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)(ft,{})}),(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)(dt,{})}),(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)(Ce,{})})]})]},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)(Qe,{onOpenChange:e=>{e||c(null)},open:s!==null,children:(0,K.jsxs)(Ke,{children:[(0,K.jsxs)(Ze,{children:[(0,K.jsxs)(qe,{children:[`Delete `,u?.name,`?`]}),(0,K.jsxs)(Ge,{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)(Ye,{children:[(0,K.jsx)(Xe,{children:`Cancel`}),(0,K.jsx)(Je,{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)(Te,{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)(m,{"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)(_e,{"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)(pt,{"data-icon":`inline-start`}),`Format JSON`]})]}):(0,K.jsx)(_e,{"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=we(e);return(0,K.jsx)(at,{onOpenChange:t,open:e,children:(0,K.jsx)(nt,{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,p]=(0,G.useState)(t?.valueType??`STRING`),[h,g]=(0,G.useState)(t?.description??``),_=h.trim().length>256,[v,y]=(0,G.useState)(t?.defaultValue??{value:``}),[b,x]=(0,G.useState)(t?.conditionalValues??{}),[C,ee]=(0,G.useState)({}),[w,te]=(0,G.useState)(!1),[ne,T]=(0,G.useState)(!1),E=sn(u.trim(),r),D=i.filter(({name:e})=>X(b,e)!==void 0),O=i.filter(({name:e})=>X(b,e)===void 0),re=E!==null||_||[v,...Object.values(b)].some(e=>In(f,e)!==null),ie=e=>{p(e),y(Bn(v,e)),x(Object.fromEntries(Object.entries(b).map(([t,n])=>[t,Bn(n,e)])))},le=e=>{let t=X(C,e);x({...b,[e]:t===void 0?{value:Fn(f)}:Bn(t,f)})},ue=e=>{let{[e]:t,...n}=b;t!==void 0&&ee({...C,[e]:t}),x(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(),te(!0),re)return;let t=Object.fromEntries(D.map(({name:e})=>[e,X(b,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)(et,{children:[(0,K.jsx)(rt,{children:e===null?`Add parameter`:`Edit parameter`}),(0,K.jsxs)(it,{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)(ot,{children:[(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-[minmax(0,1fr)_11rem]`,children:[(0,K.jsxs)(W,{"data-invalid":w&&E!==null||void 0,children:[(0,K.jsx)(H,{htmlFor:`${c}-key`,children:`Key`}),(0,K.jsx)(m,{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:w?E:null})]}),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${c}-type`,children:`Type`}),(0,K.jsxs)(A,{items:J,onValueChange:e=>{e!==null&&ie(e)},value:f,children:[(0,K.jsx)(ae,{className:`min-h-11 w-full sm:min-h-9`,id:`${c}-type`,children:(0,K.jsx)(se,{})}),(0,K.jsx)(oe,{children:(0,K.jsx)(ce,{children:Rn.map(e=>(0,K.jsx)(k,{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)(m,{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:y,showErrors:w,value:v,valueType:f}),(0,K.jsxs)(lt,{children:[(0,K.jsx)(ct,{variant:`label`,children:`Conditional values`}),(0,K.jsx)(st,{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.`}),D.length>0?(0,K.jsx)(`ul`,{className:`flex flex-col gap-3`,children:D.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:()=>ue(e.name),size:`sm`,type:`button`,variant:`ghost`,children:[(0,K.jsx)(S,{"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=>x({...b,[e.name]:t}),showErrors:w,value:X(b,e.name),valueType:f})]},e.name))}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[O.length>0?(0,K.jsxs)(A,{items:Object.fromEntries(O.map(({name:e})=>[e,e])),onValueChange:e=>{e!==null&&le(e)},value:null,children:[(0,K.jsxs)(ae,{"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)(j,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(se,{placeholder:`Add a value for a condition`})]}),(0,K.jsx)(oe,{alignItemWithTrigger:!1,children:(0,K.jsx)(ce,{children:O.map(({name:e})=>(0,K.jsx)(k,{value:e,children:e},e))})})]}):null,(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-9`,onClick:()=>T(!0),type:`button`,variant:`outline`,children:[(0,K.jsx)(j,{"data-icon":`inline-start`}),`New condition`]})]})]})]}),(0,K.jsxs)(tt,{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:T,onSave:e=>{s(e),le(e.name)},open:ne,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)(z,{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)(Ce,{})})]})]})}function Gn({template:e,onSaveParameter:t,onRemoveParameter:r,onAddCondition:i}){let[a,o]=(0,G.useState)(null),s=M(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)(L,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Ae,{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)(Oe,{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)(be,{className:`min-h-11 w-full sm:min-h-8 sm:w-56`,children:[(0,K.jsx)(ge,{children:(0,K.jsx)(xe,{"aria-hidden":`true`})}),(0,K.jsx)(he,{"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)(j,{"data-icon":`inline-start`}),`Add parameter`]})]})]}),(0,K.jsx)(ke,{className:`p-0`,children:u.length===0?(0,K.jsxs)(V,{className:`py-10`,children:[(0,K.jsxs)(Ne,{children:[(0,K.jsx)(Me,{variant:`icon`,children:(0,K.jsx)(Se,{})}),(0,K.jsx)(Fe,{children:`No parameters`}),(0,K.jsx)(Ie,{children:`Add a parameter, give it a default, then publish to change the app without a new build.`})]}),(0,K.jsx)(Pe,{children:(0,K.jsxs)(n,{className:`min-h-11 sm:min-h-7`,onClick:()=>o({key:null,parameter:null}),children:[(0,K.jsx)(j,{"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)(L,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Ae,{className:`border-b px-4 py-3 sm:px-6`,children:[(0,K.jsx)(Oe,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Preview a device`})}),(0,K.jsx)(De,{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)(ke,{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)(A,{items:{ios:`iOS`,android:`Android`},onValueChange:e=>{(e===`ios`||e===`android`)&&d(`platform`,e)},value:i.platform,children:[(0,K.jsx)(ae,{className:`min-h-11 w-full sm:min-h-9`,id:`${r}-platform`,children:(0,K.jsxs)(se,{children:[(0,K.jsx)($e,{className:`size-3.5`,platform:i.platform}),i.platform===`ios`?`iOS`:`Android`]})}),(0,K.jsx)(oe,{children:(0,K.jsxs)(ce,{children:[(0,K.jsxs)(k,{value:`ios`,children:[(0,K.jsx)($e,{className:`size-3.5`,platform:`ios`}),`iOS`]}),(0,K.jsxs)(k,{value:`android`,children:[(0,K.jsx)($e,{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)(m,{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)(be,{className:`h-11 sm:h-9`,children:[(0,K.jsx)(he,{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)(ge,{align:`inline-end`,children:(0,K.jsx)(ve,{className:`min-h-11 sm:min-h-6`,onClick:()=>d(`at`,``),size:`xs`,children:`Now`})})]})]})]}),u.length===0?(0,K.jsx)(V,{className:`border py-8`,children:(0,K.jsxs)(Ne,{children:[(0,K.jsx)(Me,{variant:`icon`,children:(0,K.jsx)(Ee,{})}),(0,K.jsx)(Fe,{children:`Nothing to preview`}),(0,K.jsx)(Ie,{children:`Add a parameter, and its value for this device shows here.`})]})}):l.data?.status===`invalid`?(0,K.jsxs)(I,{variant:`destructive`,children:[(0,K.jsx)(P,{}),(0,K.jsx)(N,{children:`The draft has problems to fix first`}),(0,K.jsx)(F,{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)(I,{variant:`destructive`,children:[(0,K.jsx)(P,{}),(0,K.jsx)(N,{children:`The preview couldn't be loaded`}),(0,K.jsx)(F,{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)(z,{variant:`outline`,children:`Default value`}):(0,K.jsx)(z,{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)(re,{"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)(``),[p,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)(at,{onOpenChange:x,open:e,children:(0,K.jsx)(nt,{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)(et,{children:[(0,K.jsx)(rt,{children:`Publish changes`}),(0,K.jsxs)(it,{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]}),p?.status===`invalid`?(0,K.jsxs)(I,{variant:`destructive`,children:[(0,K.jsx)(P,{}),(0,K.jsx)(N,{children:`The server refused the template`}),(0,K.jsx)(F,{children:(0,K.jsx)(`ul`,{className:`list-disc pl-4`,children:p.issues.slice(0,6).map(e=>(0,K.jsxs)(`li`,{children:[e.path===``?``:`${e.path}: `,e.message]},`${e.path}:${e.message}`))})})]}):null,p?.status===`conflict`?(0,K.jsxs)(I,{children:[(0,K.jsx)(P,{}),(0,K.jsxs)(N,{children:[`Version `,p.currentVersion,` was published while you edited`]}),(0,K.jsx)(F,{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 `,p.currentVersion]}),(0,K.jsx)(n,{onClick:()=>{c(p.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)(m,{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)(st,{children:`Shown in the version history.`}),(0,K.jsx)(U,{children:b?`Use 256 characters or fewer.`:null})]}),(0,K.jsxs)(tt,{children:[(0,K.jsx)(n,{disabled:u.isPending,onClick:()=>x(!1),type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsxs)(n,{disabled:u.isPending||p?.status===`conflict`,type:`submit`,children:[u.isPending?(0,K.jsx)(pe,{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)(at,{onOpenChange:i,open:t,children:(0,K.jsxs)(nt,{className:`max-h-[calc(100svh-2rem)] grid-rows-[auto_minmax(0,1fr)] sm:max-w-2xl`,children:[(0,K.jsxs)(et,{children:[(0,K.jsxs)(rt,{children:[`Version `,r]}),(0,K.jsx)(it,{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)(I,{variant:`destructive`,children:[(0,K.jsx)(P,{}),(0,K.jsx)(N,{children:`This version couldn't be loaded`}),(0,K.jsx)(F,{children:`Check the connection and try again.`}),(0,K.jsx)(R,{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)(ue,{"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=M(c),p=M(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)(L,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsx)(Ae,{className:`border-b px-4 py-3 sm:px-6`,children:(0,K.jsx)(Oe,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Versions`})})}),(0,K.jsx)(ke,{className:`p-0`,children:o.isError?(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsxs)(I,{variant:`destructive`,children:[(0,K.jsx)(P,{}),(0,K.jsx)(N,{children:`Versions couldn't be loaded`}),(0,K.jsx)(F,{children:`Check the connection and try again.`}),(0,K.jsx)(R,{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)(V,{className:`py-10`,children:[(0,K.jsxs)(Ne,{children:[(0,K.jsx)(Me,{variant:`icon`,children:(0,K.jsx)(fe,{})}),(0,K.jsx)(Fe,{children:`No versions yet`}),(0,K.jsx)(Ie,{children:`Your first publish becomes version 1. Every publish after it is kept here, ready to roll back to.`})]}),(0,K.jsx)(Pe,{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)(z,{children:`Active`}):null,e.updateType===`ROLLBACK`?(0,K.jsxs)(z,{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)(mt,{"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)(ye,{"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)(pe,{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)(Qe,{onOpenChange:e=>{!s.isPending&&!e&&d(null)},open:u!==null,children:(0,K.jsxs)(Ke,{children:[(0,K.jsxs)(Ze,{children:[(0,K.jsxs)(qe,{children:[`Roll back to version `,p?.source,`?`]}),(0,K.jsxs)(Ge,{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)(Ye,{children:[(0,K.jsx)(Xe,{disabled:s.isPending,children:`Cancel`}),(0,K.jsxs)(Je,{disabled:s.isPending,onClick:e=>void h(e),children:[s.isPending?(0,K.jsx)(pe,{className:`animate-spin`,"data-icon":`inline-start`}):(0,K.jsx)(ye,{"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)(x,{className:`-ml-1 size-11 lg:size-7`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(Se,{"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)(z,{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)(je,{"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)(I,{variant:`destructive`,children:[(0,K.jsx)(P,{}),(0,K.jsx)(N,{children:`Remote Config couldn't be loaded`}),(0,K.jsx)(F,{children:`Check the connection and try again.`}),(0,K.jsx)(R,{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)(I,{children:[(0,K.jsx)(fe,{}),(0,K.jsx)(N,{children:`Your unpublished changes are back`}),(0,K.jsxs)(F,{children:[`This browser kept them from your last visit, on version`,` `,a.baseVersion,`.`]}),(0,K.jsx)(R,{children:(0,K.jsx)(n,{onClick:_,size:`xs`,variant:`outline`,children:`Discard them`})})]}):null,g&&a!==null&&p!==void 0?(0,K.jsxs)(I,{children:[(0,K.jsx)(P,{}),(0,K.jsxs)(N,{children:[`Version `,p.version,` was published while you edited`]}),(0,K.jsxs)(F,{children:[`Your draft started from version `,a.baseVersion,`. Discard it to review version `,p.version,`, or publish yours after it.`]}),(0,K.jsx)(R,{children:(0,K.jsxs)(n,{onClick:_,size:`xs`,variant:`outline`,children:[`Load version `,p.version]})})]}):null,(0,K.jsxs)(We,{onValueChange:e=>r(e),value:t,children:[(0,K.jsx)(Ue,{"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)(Be,{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)(Ve,{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)(Ve,{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)(Ve,{value:`preview`,children:(0,K.jsx)(Jn,{isDraft:h,template:m})}),(0,K.jsx)(Ve,{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=ne(`/remote-config`)({beforeLoad:({context:e})=>O(e.queryClient,`remoteConfig`),notFoundComponent:te(()=>T(()=>import(`./remote-config-gXeH6PBW.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`notFoundComponent`),component:te(()=>T(()=>import(`./remote-config-WjpozBG5.js`),__vite__mapDeps([8,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{t as e}from"./ConsoleFeatureUnavailable-CUtcXuY2.js";var t=e;export{t as notFoundComponent};
@@ -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,Wr as S,Xn as C,Xt as w,Yn as T,Yt as ee,Z as te,Zn as E,_ as ne,an as re,b as ie,bn as ae,er as oe,et as se,g as ce,h as D,ii as le,ir as O,ln as k,lt as ue,mn as de,p as fe,qt as pe,rr as me,ti 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-Di9SN47G.js";import{t as F}from"./link-DTEyW70e.js";import{t as I}from"./arrow-right-CNII8TYn.js";import{t as ye}from"./arrow-up-right-DK8Zdg40.js";import{a as be,c as xe,i as Se,n as L,r as Ce,s as we,t as R}from"./routes-CCD33Azv.js";import{t as z}from"./check-CXVR3s3X.js";import{a as B,i as Te,n as Ee,r as De}from"./useCompositeListItem-JmyDfo3-.js";import{c as V,d as Oe,f as ke,l as Ae,p as je,r as Me}from"./native-builds-BOC71grI.js";import{t as Ne}from"./chevron-right-BoUXo82O.js";import{A as Pe,D as Fe,E as Ie,M as Le,N as Re,T as ze,a as Be,d as Ve,f as He,h as Ue,i as H,m as U,n as W,o as G,r as We,t as Ge}from"./select-CBIU0_M1.js";import{t as Ke}from"./circle-off-C7Muo0ss.js";import{t as qe}from"./download-Cf24LBde.js";import{t as Je}from"./list--NIee1FZ.js";import{n as Ye,t as Xe}from"./plus-BReVKct-.js";import{a as Ze,i as Qe,n as $e,o as et,s as tt,t as nt}from"./input-group-D3OUBk4n.js";import{i as rt,n as it,t as at}from"./switch-BpdiHL_t.js";import{a as ot,c as st,d as ct,f as lt,i as ut,n as dt,o as ft,s as pt,t as K,u as mt}from"./badge-DWFcDWho.js";import{n as q}from"./dist-CPlO6ko9.js";import{o as ht}from"./insights-search-DghCbEnk.js";import{a as gt,c as _t,i as vt,l as yt,n as bt,o as xt,r as St,s as Ct,u as wt}from"./uuidv7-zXMtwR9Q.js";import{a as Tt,i as Et,l as Dt,n as Ot,o as kt,r as At,s as jt,t as Mt}from"./alert-dialog-BqYScr9y.js";import{t as Nt}from"./PlatformIcon-BBWQlWm9.js";import{a as Pt,i as Ft,n as It,o as Lt,r as Rt,s as zt,t as Bt}from"./dialog-CNUPxNxH.js";import{a as Vt,c as Ht,i as Ut,n as Wt,r as Gt,t as Kt}from"./field-D-2-mnNh.js";import{_ as qt,a as Jt,c as Yt,g as Xt,h as Zt,i as Qt,m as $t,n as en,o as tn,p as nn,r as rn,s as an,t as on,v as sn,y as cn}from"./api-P2g8dCNg.js";import{a as ln,i as J,n as un,o as dn,r as Y,t as fn}from"./table-Bpy3SvSo.js";import{i as pn,n as mn,t as hn}from"./valueToPercent-BLwGy_xK.js";import{t as gn}from"./HashValueDisplay-6lNRxDJX.js";import{t as _n}from"./RolloutPercentageBadge-Cxogpi8F.js";var vn=O(`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`}]]),yn=O(`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`}]]),bn=O(`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`}]]),xn=O(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Sn=O(`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`}]]),Cn=O(`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`}]]),wn=y();function Tn(){return v}function En(){return!1}function Dn(){return!0}function On(){return(0,wn.useSyncExternalStore)(Tn,En,Dn)}var X=le(A(),1),Z=S(),kn={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 An({channel:e,className:t}){return(0,Z.jsx)(K,{variant:`outline`,className:p(kn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function jn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(z,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(xn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(me,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}function Mn({panelId:t,bundle:n,bundles:r,loading:a,onDetailClick:o}){let s=D();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)(pn,{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)(pn,{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)(pn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(I,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(pn,{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)(ke,{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)(fn,{className:`min-w-max`,children:[(0,Z.jsx)(ln,{children:(0,Z.jsxs)(dn,{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)(un,{children:r.map(e=>(0,Z.jsxs)(dn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(pn,{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)(pn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(I,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(pn,{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)(ke,{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 Nn({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=it(a),{data:c=[],isPending:l}=Qt(),u=tn(),d=an(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?q.success(`Channel ${e.row.name} created`):q.info(`Channel ${e.row.name} already exists`)}catch(e){q.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?q.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?q.error(`Channel ${a.name} is still in use and cannot be deleted`):q.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){q.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Bt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(It,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsxs)(Lt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Sn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(Rt,{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)(Ut,{className:`gap-2`,children:(0,Z.jsxs)(Kt,{orientation:`horizontal`,children:[(0,Z.jsx)(Vt,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(te,{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)(Ye,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Xe,{"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)(Ye,{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)(Mt,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(Et,{children:[(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(Dt,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(Tt,{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)(kt,{children:[(0,Z.jsx)(At,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Ot,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Pn=`[a-zA-Z0-9-]`,Fn=String.raw`0|[1-9]\d*`,In=String.raw`\d+`,Ln=String.raw`\d*[a-zA-Z-]${Pn}*`,Rn=String.raw`(${Fn})\.(${Fn})\.(${Fn})`,zn=String.raw`(${In})\.(${In})\.(${In})`,Bn=`(?:${Ln}|${Fn})`,Vn=`(?:${Ln}|${In})`,Hn=String.raw`(?:-(${Bn}(?:\.${Bn})*))`,Un=String.raw`(?:-?(${Vn}(?:\.${Vn})*))`,Wn=`${Pn}+`,Gn=String.raw`(?:\+(${Wn}(?:\.${Wn})*))`,Kn=`v?${Rn}${Hn}?${Gn}?`,qn=String.raw`[v=\s]*${zn}${Un}?${Gn}?`,Jn=`((?:<|>)?=?)`,Yn=String.raw`${Fn}|x|X|\*`,Xn=String.raw`${In}|x|X|\*`,Zn=String.raw`[v=\s]*(${Yn})(?:\.(${Yn})(?:\.(${Yn})(?:${Hn})?${Gn}?)?)?`,Qn=String.raw`[v=\s]*(${Xn})(?:\.(${Xn})(?:\.(${Xn})(?:${Un})?${Gn}?)?)?`,$n=`(?:~>?)`,er=String.raw`(?:\^)`,tr=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${tr}(?:$|[^\d])`,String.raw`${tr}(?:${Hn})?(?:${Gn})?(?:$|[^\d])`;function nr(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Pn,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(nr(e),t)}var rr=Q(`^${Kn}$`),ir=Q(`^${qn}$`),ar=/^\d+$/;function or(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function sr(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?ir:rr);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(ar.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 cr=Q(String.raw`^${Jn}\s*(${Kn})$|^$`),lr=Q(String.raw`^${Jn}\s*(${qn})$|^$`);function ur(e){return e.version?`${e.operator}${or(e.version)}`:``}function dr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?lr:cr);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?sr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${or(a)}`:``,version:a}}function fr(e){return e.sets.map(e=>e.map(ur).join(` `)).join(`||`)}var pr=new RegExp(Gn,`g`),mr=Q(Gn),hr=Q(String.raw`^\s*(${Zn})\s+-\s+(${Zn})\s*$`),gr=Q(String.raw`^\s*(${Qn})\s+-\s+(${Qn})\s*$`),_r=Q(String.raw`(\s*)${Jn}\s*(${qn}|${Zn})`,`g`),vr=Q(String.raw`(\s*)${$n}\s+`,`g`),yr=Q(String.raw`(\s*)${er}\s+`,`g`),br=Q(`^${$n}${Zn}$`),xr=Q(`^${$n}${Qn}$`),Sr=Q(`^${er}${Zn}$`),Cr=Q(`^${er}${Qn}$`),wr=Q(String.raw`^${Jn}\s*${Zn}$`),Tr=Q(String.raw`^${Jn}\s*${Qn}$`),Er=Q(String.raw`(<|>)?=?\s*\*`),Dr=/^\s*>=\s*0\.0\.0\s*$/,Or=/^\s*>=\s*0\.0\.0-0\s*$/,kr=Q(String.raw`^${Jn}\s*(${qn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Ar(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}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}.${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 Mr(e,t){return e.trim().split(/\s+/).map(e=>jr(e,t)).join(` `)}function Nr(e,t){let n=t.loose?Cr:Sr,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 Pr(e,t){return e.trim().split(/\s+/).map(e=>Nr(e,t)).join(` `)}function Fr(e,t){let n=t.loose?Tr:wr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Ar(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 Ir(e,t){return e.split(/\s+/).map(e=>Fr(e,t)).join(` `)}function Lr(e,t){let n=t.loose?gr:hr;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 Rr(e,t){return Ir(Mr(Pr(e.replace(mr,``),t),t),t).trim().replace(Er,``)}function zr(e,t){let n=Lr(e.replace(pr,``),t).replace(_r,`$1$2$3`).replace(vr,`$1~`).replace(yr,`$1^`).split(` `).map(e=>Rr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Or:Dr,``));t.loose&&(n=n.filter(e=>kr.test(e)));let r=new Map;for(let e of n.map(e=>dr(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 Br(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>zr(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 Vr(e,t={}){try{return Br(e,t)}catch{return null}}function Hr(e,t={}){let n=Vr(e,t);return n?fr(n)||`*`:null}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}=Jt(),i=e?Ct(e):null,a=e?xt(e):null,o=e?.gitCommitHash&&r?Oe(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)(ft,{children:[(0,Z.jsx)(mt,{className:`p-4 pb-3`,children:(0,Z.jsx)(ct,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(pt,{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)(gn,{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)(vn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Ur,{label:`Manifest hash`,value:(0,Z.jsx)(gn,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Ur,{label:`Base hash`,value:(0,Z.jsx)(gn,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Ur,{label:`Patch hash`,value:(0,Z.jsx)(gn,{maxLength:16,value:i})}):null]})})]}):null}var Gr=Array.from({length:St},(e,t)=>t+1);function Kr({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=wt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===St,l=D(),u=c?Gr:s?Gr.filter(t=>vt(e,t)<r):[],d=(r/10).toFixed(1),f=c?St:u.length,p=St-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)(ft,{children:(0,Z.jsxs)(mt,{className:`p-4`,children:[(0,Z.jsx)(st,{children:`Selected cohorts`}),(0,Z.jsx)(ct,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(mt,{className:`p-4`,children:[(0,Z.jsx)(st,{children:`Excluded cohorts`}),(0,Z.jsx)(ct,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(ft,{children:[(0,Z.jsxs)(mt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(ct,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(st,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(pt,{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)(ft,{children:[(0,Z.jsx)(mt,{className:`p-4 pb-3`,children:(0,Z.jsx)(ct,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(pt,{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)(Bt,{children:[(0,Z.jsxs)(zt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Je,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(It,{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)(Pt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Lt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Rt,{children:[d,`% includes `,f,` of`,` `,St,` 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)(Ft,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Lt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Rt,{children:[d,`% includes `,f,` of`,` `,St,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Ft,{showCloseButton:!0})]})})]})}function qr({release:t,channel:n,bundle:r}){let i=t.bundle_id===null?null:{platform:t.platform,channel:n,fingerprintHash:t.fingerprint_hash,targetAppVersion:t.target_app_version},a=i!==null&&Ae(i)!==null,o=Xt(a?i:null);if(!a)return null;let s=o.data;return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Native build`}),o.isPending?(0,Z.jsx)(e,{className:`h-4 w-40`}):s?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(F,{className:`inline-flex flex-wrap items-center gap-x-1 gap-y-0.5 text-xs text-foreground underline-offset-4 hover:underline`,params:{buildId:s.id},to:`/native-builds/$buildId`,children:[V(s.platform),` `,Me[s.artifact_kind].label,` ·`,` `,(0,Z.jsx)(`span`,{className:`font-mono`,translate:`no`,children:s.min_bundle_id}),(0,Z.jsx)(ye,{"aria-hidden":`true`,className:`size-3`})]}),r?(0,Z.jsx)(K,{variant:`secondary`,children:(r.patches??[]).some(({baseBundleId:e})=>e===s.min_bundle_id)?`Patches from it`:`No patch from it`}):null]}):o.isError?(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Couldn't load the scope's native build.`,` `,(0,Z.jsx)(`button`,{className:`underline underline-offset-4`,onClick:()=>void o.refetch(),type:`button`,children:`Retry`})]}):(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`None tracked for this scope ·`,` `,(0,Z.jsx)(F,{className:`underline-offset-4 hover:text-foreground hover:underline`,search:{channel:n},to:`/native-builds`,children:`This channel's builds`})]})]})}function Jr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Yr(e,t){return e-t}function Xr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Yr)}function Zr(e,t,n,r,i,a){let o=e;return o=U(o,n,r),i&&(o=Xr(a,t,U(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Qr(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 $r={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...Le},ei=X.createContext(void 0);function ti(){let e=X.useContext(ei);if(e===void 0)throw Error(l(62));return e}function ni(e){return`key`in e?k:re}function ri(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Jr(e,t):!1}var ii=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:S=`push`,thumbAlignment:T=`center`,value:te,style:ne,...re}=e,ie=j(c),oe=Ve(ie),se=E(v),ce=E(y),{clearErrors:D}=Ue(),{state:le,disabled:O,name:k,setTouched:ue,setDirty:de,validityData:fe,shouldValidateOnChange:me,validation:A}=Pe(),{labelId:he}=Ie(),[ge,_e]=X.useState(),N=r??He(he,ge),P=O||s,F=k??_,[I,ye]=Te({controlled:te,default:o??m,name:`Slider`}),be=X.useRef(null),xe=X.useRef(null),Se=X.useRef([]),L=X.useRef(null),Ce=X.useRef(null),we=X.useRef(-1),R=X.useRef(null),z=X.useRef(null),B=X.useRef(`none`),Ee=pe(l),[V,Oe]=X.useState(-1),[ke,Ae]=X.useState(-1),[je,Me]=X.useState(!1),[Ne,Le]=X.useState(()=>new Map),[Re,ze]=X.useState([void 0,void 0]),Be=E(e=>{Oe(e),e!==-1&&Ae(e)});Fe(xe,ie,I),M(I,()=>{D(F),me()?A.commit(I):A.commit(I,!0);let e=fe.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!Jr(I,e):I!==e,de(t)});let H=E(e=>{e&&(xe.current=e)}),W=Array.isArray(I),G=X.useMemo(()=>W?I.slice().sort(Yr):[U(I,m,p)],[p,m,W,I]),We=E((e,t)=>{if(Number.isNaN(e)||ri(e,I))return;let n=t??ee(`none`,void 0,void 0,{activeThumbIndex:-1});B.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,z.current=e,se(e,n),!n.isCanceled&&ye(e)}),Ge=E((e,t,n)=>{let r=Zr(e,t,m,p,W,G);if(Qr(r,x,h)){let e=ni(n);We(r,ee(e,n.nativeEvent,void 0,{activeThumbIndex:t})),ue(!0),ce(z.current??r,w(e,n.nativeEvent))}});C(()=>{let e=ve(a(be.current));P&&ae(be.current,e)&&e.blur()},[P]),P&&V!==-1&&Be(-1);let Ke=X.useMemo(()=>({...le,activeThumbIndex:V,disabled:P,dragging:je,orientation:b,max:p,min:m,minStepsBetweenValues:h,step:x,values:G}),[le,V,P,je,p,m,h,b,x,G]),qe=X.useMemo(()=>({active:V,controlRef:xe,disabled:P,dragging:je,validation:A,formatOptionsRef:Ee,handleInputChange:Ge,indicatorPosition:Re,inset:T!==`center`,labelId:N,rootLabelId:oe,largeStep:u,lastUsedThumbIndex:ke,lastChangedValueRef:z,lastChangeReasonRef:B,form:g,locale:d,max:p,min:m,minStepsBetweenValues:h,name:F,onValueCommitted:ce,orientation:b,pressedInputRef:L,pressedThumbCenterOffsetRef:Ce,pressedThumbIndexRef:we,pressedValuesRef:R,registerFieldControlRef:H,renderBeforeHydration:T===`edge`,setActive:Be,setDragging:Me,setIndicatorPosition:ze,setLabelId:_e,setValue:We,state:Ke,step:x,thumbCollisionBehavior:S,thumbMap:Ne,thumbRefs:Se,values:G}),[V,xe,N,oe,P,je,A,Ee,Ge,Re,u,ke,z,B,g,d,p,m,h,F,ce,b,L,Ce,we,R,H,Be,Me,ze,_e,We,Ke,x,S,T,Ne,Se,G]),Je=n(`div`,e,{state:Ke,ref:[t,be],props:[{"aria-labelledby":N,id:ie,role:`group`},A.getValidationProps,re],stateAttributesMapping:$r});return(0,Z.jsx)(ei.Provider,{value:qe,children:(0,Z.jsx)(De,{elementsRef:Se,onMapChange:Le,children:Je})})});function ai(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function oi(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 si(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(oi(t),oi(n))))}function ci({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]=U(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]=U(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]=U(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function li({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=U(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=ci({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=U(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:ci({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=U(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 ui=2;function di(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 fi(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 pi=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:C,pressedValuesRef:T,registerFieldControlRef:te,renderBeforeHydration:ne,setActive:re,setDragging:ie,setValue:se,state:ce,step:D,thumbCollisionBehavior:le,thumbRefs:O,values:k}=ti(),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),I=pe(k);function ye(e){C.current!==e&&(C.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=di(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=U(((A?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=si(m,D,_),m=U(m,_,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=C.current;if(h<0)return null;let y=li({behavior:le,values:k,currentValues:I.current??k,initialValues:T.current,pressedIndex:h,nextValue:m,min:_,max:g,step:D,minStepsBetweenValues:v});return le===`swap`&&y.didSwap?ye(y.thumbIndex):C.current=y.thumbIndex,y}function xe(e){T.current=me?k.slice():null,I.current=k;let t=C.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=ai(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&ye(n),p){let e=O.current[n];oe(e)&&(F.current=e.getBoundingClientRect()[A?`height`:`width`]/2)}}function Se(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let L=E(e=>{let t=fi(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){Ce(e);return}let n=be(t);n!=null&&Qr(n.value,D,v)&&(!f&&P.current>ui&&ie(!0),se(n.value,ee(he,e,void 0,{activeThumbIndex:n.thumbIndex})),I.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&Se(n.thumbIndex))});function Ce(e){re(-1),ie(!1),x.current=null,S.current=null;let t=fi(e,M),n=t==null?null:be(t);if(n!=null){let t=h.current;y(m.current??n.value,w(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),C.current=-1,M.current=null,T.current=null,R()}let we=E(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=fi(e,M);if(n!=null){xe(n);let t=be(n);if(t==null)return;Se(t.thumbIndex),se(t.value,ee(de,e,void 0,{activeThumbIndex:t.thumbIndex})),I.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&Se(t.thumbIndex)}P.current=0;let r=a(j.current);r.addEventListener(`touchmove`,L,{passive:!0}),r.addEventListener(`touchend`,Ce,{passive:!0})}),R=E(()=>{let e=a(j.current);e.removeEventListener(`pointermove`,L),e.removeEventListener(`pointerup`,Ce),e.removeEventListener(`touchmove`,L),e.removeEventListener(`touchend`,Ce),T.current=null}),z=d();return X.useEffect(()=>{let e=j.current;if(!e)return()=>R();let t=u(e,`touchstart`,we,{passive:!0});return()=>{t(),z.cancel(),R()}},[R,we,j,z]),X.useEffect(()=>{l&&R()},[l,R]),n(`div`,e,{state:ce,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=fi(e,M);if(r!=null){xe(r);let n=be(r);if(n==null)return;ae(O.current[n.thumbIndex],ve(a(t)))?e.preventDefault():z.request(()=>{Se(n.thumbIndex)}),ie(!0),S.current??(se(n.value,ee(de,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),I.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&Se(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),P.current=0;let i=a(j.current);i.addEventListener(`pointermove`,L,{passive:!0}),i.addEventListener(`pointerup`,Ce,{once:!0})}},c],stateAttributesMapping:$r})}),mi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=ti();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:$r})}),hi=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}({}),gi=new Set([...f,_,o]);function _i(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${mn(e[t],r,n)} start range`:`${mn(e[t],r,n)} end range`:n?mn(e[t],r,n):void 0}function vi(e,t,n,r,i){let a=n===1?e+t:e-t;return U(Number(a.toFixed(Math.max(oi(e),oi(t),oi(r)))),r,i)}var yi=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:S,id:w,index:ee,inputRef:te,onBlur:ne,onFocus:re,onKeyDown:ie,tabIndex:ae,style:oe,...se}=e,{nonce:ce}=Re(),D=j(w),{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:I,orientation:ye,pressedInputRef:be,pressedThumbCenterOffsetRef:xe,pressedThumbIndexRef:Se,renderBeforeHydration:L,setActive:Ce,setIndicatorPosition:we,state:R,step:z,values:B}=ti(),Te=ue(),De=v||de,V=B.length>1,Oe=ye===`vertical`,ke=Te===`rtl`,{setTouched:Ae,setFocused:je,validationMode:Me}=Pe(),Ne=X.useRef(null),Fe=X.useRef(null),Ie=X.useRef(!1),Le=j(),Be=ze(),Ve=V?Le:Be,{ref:He,index:Ue}=Ee({metadata:X.useMemo(()=>({inputId:Ve}),[Ve])}),H=V?ee??Ue:0,U=H===B.length-1,W=B[H],G=hn(W,P,N),[We,Ge]=X.useState(),Ke=On(),qe=O>=0&&O<B.length?O:-1,Je=E(()=>{let e=k.current,t=Ne.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Oe?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*G/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ge(s),H===0?we(e=>[s,e[1]]):U&&we(e=>[e[0],s])});C(()=>{A&&queueMicrotask(Je)},[Je,A]),C(()=>{A&&Je()},[Je,A,G]),C(()=>{if(!A)return;let e=k.current,n=Ne.current;if(!e||!n)return;let r=t(e).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Je);return i.observe(e),i.observe(n),()=>{i.disconnect()}},[k,Je,A]);let Ye=Oe?`bottom`:`insetInlineStart`,Xe=Oe?`left`:`top`,Ze;V?le===H?Ze=2:qe===H&&(Ze=1):le===H&&(Ze=1);let Qe;Qe=A?{"--position":`${We??0}%`,visibility:L&&Ke||We===void 0?`hidden`:void 0,position:`absolute`,[Ye]:`var(--position)`,[Xe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Ze}:Number.isFinite(G)?{position:`absolute`,[Ye]:`${G}%`,[Xe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Ze}:b;let $e;ye===`vertical`&&($e=ke?`vertical-rl`:`vertical-lr`);let et=typeof y==`function`?y(H):d,tt=T({"aria-label":et,"aria-labelledby":p??(et==null?he:void 0),"aria-describedby":u,"aria-orientation":ye,"aria-valuenow":W,"aria-valuetext":typeof S==`function`?S(mn(W,M,pe.current??void 0),W,H):_i(B,H,pe.current??void 0,M),disabled:De,form:F,id:Ve,max:N,min:P,name:I,onChange(e){me(e.currentTarget.valueAsNumber,H,e)},onFocus(e){let t=Ie.current;Ie.current=!1,Ce(H),je(!0),t&&e.stopPropagation()},onBlur(e){if(Ie.current){e.stopPropagation();return}Ne.current&&(Ce(-1),Ae(!0),je(!1),Me===`onBlur`&&fe.commit(Zr(W,H,P,N,V,B)))},onKeyDown(e){if(!gi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=si(W,z,P);switch(e.key){case s:t=vi(n,e.shiftKey?ge:z,1,P,N);break;case r:t=vi(n,e.shiftKey?ge:z,ke?-1:1,P,N);break;case m:t=vi(n,e.shiftKey?ge:z,-1,P,N);break;case h:t=vi(n,e.shiftKey?ge:z,ke?1:-1,P,N);break;case _:t=vi(n,ge,1,P,N);break;case o:t=vi(n,ge,-1,P,N);break;case`End`:t=N,V&&(t=Number.isFinite(B[H+1])?B[H+1]-z*ve:N);break;case g:t=P,V&&(t=Number.isFinite(B[H-1])?B[H-1]+z*ve:P);break;default:break}if(t!==null){let n=e.currentTarget;_e(n)||(Ie.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),me(t,H,e),e.preventDefault()}},step:z,style:{...b,width:`100%`,height:`100%`,writingMode:$e},tabIndex:ae??void 0,type:`range`,value:W??``},fe.getInputValidationProps),nt=x(Fe,fe.inputRef,te);return n(`div`,e,{state:R,ref:[i,He,Ne],props:[{[hi.index]:H,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:nt,...tt,suppressHydrationWarning:!0}),A&&Ke&&L&&U&&(0,Z.jsx)(`script`,{nonce:ce,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:D,onBlur:ne,onFocus:re,onPointerDown(e){if(Se.current=H,Ne.current!=null){let t=ye===`horizontal`?`x`:`y`,n=ai(Ne.current);xe.current=(ye===`horizontal`?e.clientX:e.clientY)-n[t]}Fe.current!=null&&be.current!==Fe.current&&(be.current=Fe.current)},style:Qe,suppressHydrationWarning:L||void 0},se],stateAttributesMapping:$r})});function bi(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 xi(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 Si=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}=ti(),h=On(),g=d===`vertical`,_=m.length>1,v=c?bi(g,_,s[0],s[1],f,h):xi(g,_,hn(m[0],u,l),hn(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:$r})});function Ci({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)(ii,{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)(pi,{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)(mi,{"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)(Si,{"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)(yi,{"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 wi=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Ti=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]}),Ei=(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}),Di=e=>(e/10).toFixed(1),Oi=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},ki=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Ai({value:e,onChange:t}){let[n,r]=(0,X.useState)(Di(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Di(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Ci,{"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)(nt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Qe,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=ki(n)??e;a(!1),r(Di(i)),t(i)},onChange:e=>{let n=Oi(e.target.value);r(n);let i=ki(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)($e,{align:`inline-end`,children:(0,Z.jsx)(Ze,{children:`%`})})]})]})}function ji({channels:t,onOpenChange:n,onShowScope:r,open:a,releaseId:o}){let s=qt(o),c=s.data,l=rn(c?.bundle_id??``),u=l.data,d=u?gt(u):null,f=Zt(c?.scope_key??``),p=cn(),m=nn(),h=Yt(),g=$t(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[T,ee]=(0,X.useState)(!1),[E,re]=(0,X.useState)(!1),[ae,oe]=(0,X.useState)(``),[D,le]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?Ti(c):null),S(``)},[c]);let O=c?Ti(c):null,k=_!==null&&O!==null&&JSON.stringify(_)!==JSON.stringify(O),ue=m.isPending||p.isPending||h.isPending||g.isPending,de=()=>{if(!ue){if(k){w(!0);return}n(!1)}},fe=()=>{if(!_)return;let e=yt(y);if(!_t(e)){S(bt);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},pe=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(yt);if(e.some(e=>!_t(e))){S(bt);return}if(c.strategy===`APP_VERSION`&&!Hr(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ei(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),q.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=ae.trim(),M=D===`copy`,N=_?Hr(_.targetAppVersion.trim()):null,ve=()=>{oe(``),le(`move`)},F=e=>{!e&&g.isPending||(re(e),e||ve())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ce,{onOpenChange:e=>e?void 0:de(),open:a,children:(0,Z.jsxs)(ne,{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)(ie,{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)(Nt,{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)(pn,{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})]}),A?(0,Z.jsx)(qr,{bundle:u,channel:A,release:c}):null,(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)(dt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(lt,{}),(0,Z.jsx)(ot,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(ut,{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)(be,{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)(Ut,{className:`gap-6`,children:[(0,Z.jsxs)(Kt,{children:[(0,Z.jsx)(Vt,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(et,{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)(Kt,{children:[(0,Z.jsx)(Vt,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(te,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),N?(0,Z.jsx)(Wt,{children:N}):null]}):null,(0,Z.jsx)(Kt,{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)(Vt,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(ht,{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)(at,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(Kt,{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)(Vt,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(ht,{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)(at,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(Kt,{children:[(0,Z.jsx)(Vt,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Ai,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(Kt,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(Vt,{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)(te,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),fe())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:fe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Xe,{})})]}),_.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)(me,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Wt,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Gt,{children:x}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!k||ue,onClick:pe,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||ue,onClick:()=>re(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:ue,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),q.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(qe,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:c.enabled||ue,onClick:()=>ee(!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)(dt,{variant:`destructive`,children:[(0,Z.jsx)(lt,{}),(0,Z.jsx)(ot,{children:`Build details are unavailable`}),(0,Z.jsx)(ut,{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)(Mt,{onOpenChange:w,open:C,children:(0,Z.jsxs)(Et,{children:[(0,Z.jsxs)(jt,{children:[(0,Z.jsx)(Dt,{children:`Discard unsaved changes?`}),(0,Z.jsx)(Tt,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(kt,{children:[(0,Z.jsx)(At,{children:`Keep editing`}),(0,Z.jsx)(Ot,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(Mt,{onOpenChange:ee,open:T,children:(0,Z.jsxs)(Et,{children:[(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(Dt,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(Tt,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(kt,{children:[(0,Z.jsx)(At,{children:`Cancel`}),(0,Z.jsx)(Ot,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),q.success(`Bundle removed from ${A??`the channel`}`),ee(!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)(Bt,{onOpenChange:F,open:E,children:(0,Z.jsxs)(It,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Lt,{children:`Promote to Channel`}),(0,Z.jsx)(Rt,{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)(Ht,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(Ge,{disabled:g.isPending,items:wi,onValueChange:e=>le(e),value:D,children:[(0,Z.jsx)(Be,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(G,{placeholder:`Select an action`})}),(0,Z.jsx)(W,{children:(0,Z.jsxs)(We,{children:[(0,Z.jsx)(H,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(H,{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)(Ht,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(Ge,{disabled:g.isPending,items:j,onValueChange:e=>oe(e??``),value:ae||null,children:[(0,Z.jsx)(Be,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(G,{placeholder:`Select a channel`})}),(0,Z.jsx)(W,{className:`max-h-64`,children:(0,Z.jsx)(We,{children:he.map(e=>(0,Z.jsx)(H,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Ft,{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:D,expectedRevision:c.revision,releaseId:c.id,targetChannel:_e}),F(!1),q.success(M?`Bundle copied to ${_e}`:`Bundle moved to ${_e}`)}catch(e){q.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?M?`Copying…`:`Moving…`:M?`Copy`:`Move`})]})]})})]})}function Mi({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)(z,{className:`size-3`}):(0,Z.jsx)(Ke,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}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=L(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)(bn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(Ge,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(Be,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(G,{})}),(0,Z.jsx)(W,{children:(0,Z.jsxs)(We,{children:[(0,Z.jsx)(H,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(H,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(Ge,{disabled:!s,items:Pi,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(Be,{"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)(G,{})}),(0,Z.jsx)(W,{children:(0,Z.jsxs)(We,{children:[(0,Z.jsx)(H,{value:`ios`,children:`iOS`}),(0,Z.jsx)(H,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(Ge,{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)(Be,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(G,{})}),(0,Z.jsx)(W,{children:(0,Z.jsxs)(We,{children:[(0,Z.jsx)(H,{value:`all`,children:`Any Status`}),(0,Z.jsx)(H,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(H,{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)(Cn,{})}),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)(me,{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)(me,{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)(me,{"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)(B,{}):(0,Z.jsx)(Ne,{})}):(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)(pn,{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)(tt,{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)(Ke,{className:`size-3.5`}),`Unreachable`]}):null]})}function Vi({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=rn(i),o=en(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)(Mn,{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=R.useSearch(),n=R.useNavigate(),r=D(),[a,o]=(0,X.useState)(!1),[s,l]=(0,X.useState)(),u=sn({afterReleaseId:t.afterReleaseId,beforeReleaseId:t.beforeReleaseId,filter:Ce(t),limit:Ni}),d=Qt().data??[],f=u.data?.data??[],m=on(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=we(),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(Se(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,T=g?{...t,afterReleaseId:g,beforeReleaseId:void 0,releaseId:void 0}:null,ee=h?{...t,afterReleaseId:void 0,beforeReleaseId:h,releaseId:void 0}:null,te={...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)(dt,{variant:`destructive`,children:[(0,Z.jsx)(lt,{}),(0,Z.jsx)(ot,{children:`Bundles could not be loaded`}),(0,Z.jsx)(ut,{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)(An,{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)(Nt,{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)(_n,{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)(Mi,{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.`:L(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(fn,{className:`min-w-max`,children:[(0,Z.jsx)(ln,{className:`bg-muted/40`,children:(0,Z.jsxs)(dn,{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)(un,{children:[u.isPending?Array.from({length:7},(t,n)=>(0,Z.jsx)(dn,{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)(dn,{"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)(An,{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)(Nt,{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)(xe,{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)(yn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(gn,{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)(jn,{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)(jn,{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)(_n,{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)(dn,{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)(dn,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:y,children:w?`No more bundles on this side.`:L(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:te,to:`/`,children:`Newest`}):null,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:[(0,Z.jsx)(je,{"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)(je,{"data-icon":`inline-start`}),`Previous`]}),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:[`Next`,(0,Z.jsx)(Ne,{"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)(Ne,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(ji,{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)(Nn,{onOpenChange:o,open:a})]})}export{Hi as component};