@hot-updater/console 1.2.0-rc.26 → 1.2.0-rc.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{-native-builds-search-OlRj4Jz0.js → -native-builds-search-7blX2yQW.js} +1 -1
- package/.output/public/assets/BundleIdDisplay-B0gAH01c.js +1 -0
- package/.output/public/assets/CompositeItem-Dy4xgOMg.js +1 -0
- package/.output/public/assets/{ConsoleFeatureUnavailable-DUqlpHCp.js → ConsoleFeatureUnavailable-cy_snb33.js} +1 -1
- package/.output/public/assets/{EventDetails-DZsRlDHk.js → EventDetails-sxag8Hfc.js} +1 -1
- package/.output/public/assets/{HashValueDisplay-MoZMmTeP.js → HashValueDisplay-DMweha_0.js} +1 -1
- package/.output/public/assets/{InsightsPageHeader-2bTrjXln.js → InsightsPageHeader-D5TJspVe.js} +1 -1
- package/.output/public/assets/IosInstall-B5NspihF.js +1 -0
- package/.output/public/assets/NativeBuildsNav-CjOOlbEu.js +1 -0
- package/.output/public/assets/{NotFoundPage-Ckb5GMhh.js → NotFoundPage-DDOJarFa.js} +1 -1
- package/.output/public/assets/{PlatformIcon-CJ69KopR.js → PlatformIcon-BBvlg6JY.js} +1 -1
- package/.output/public/assets/RelativeTime-CY1dKZpv.js +1 -0
- package/.output/public/assets/{RolloutPercentageBadge-G6qt8rVb.js → RolloutPercentageBadge-BHgHkBGB.js} +1 -1
- package/.output/public/assets/RowReason-BMx_vclu.js +1 -0
- package/.output/public/assets/SandboxBadge-irEkMf1P.js +1 -0
- package/.output/public/assets/TargetDisplay-DB8D019f.js +1 -0
- package/.output/public/assets/{alert-dialog-DiRLrFVe.js → alert-dialog-CLC_h1fL.js} +1 -1
- package/.output/public/assets/api-DLryz9hA.js +1 -0
- package/.output/public/assets/api-keys-Cd-aNt-v.js +1 -0
- package/.output/public/assets/api-keys-D3tAc4Uu.js +1 -0
- package/.output/public/assets/arrow-left-DQjHJAnT.js +1 -0
- package/.output/public/assets/arrow-right-CXp_K3xK.js +1 -0
- package/.output/public/assets/arrow-up-right-BFafIOrq.js +1 -0
- package/.output/public/assets/{badge-D0NFvUY5.js → badge-DJMW4YVM.js} +1 -1
- package/.output/public/assets/card-C4sBAMU-.js +1 -0
- package/.output/public/assets/check-CqWNyG93.js +1 -0
- package/.output/public/assets/chevron-right-DNbYTBX1.js +1 -0
- package/.output/public/assets/{circle-off-C7Muo0ss.js → circle-off-BCkZpskJ.js} +1 -1
- package/.output/public/assets/{clipboard-DQbOcrL7.js → clipboard-DZrZK5gR.js} +1 -1
- package/.output/public/assets/{console-features-api-DEXSwFtc.js → console-features-api-BO5V64P3.js} +1 -1
- package/.output/public/assets/{copy-DsuLj3oj.js → copy-CH1__JAW.js} +1 -1
- package/.output/public/assets/dialog-tCTZmAo8.js +1 -0
- package/.output/public/assets/{dist-Bf1BPKMs.js → dist-Bw_uSBJn.js} +1 -1
- package/.output/public/assets/empty-DsbLxQ1w.js +1 -0
- package/.output/public/assets/field-DL4OXTJ7.js +1 -0
- package/.output/public/assets/git-branch-ByZMEBxZ.js +1 -0
- package/.output/public/assets/history-wYnPoVmT.js +1 -0
- package/.output/public/assets/index-CAnjb7M2.js +10 -0
- package/.output/public/assets/{input-group-D_NfhUbX.js → input-group-B7jx0icS.js} +1 -1
- package/.output/public/assets/insights-DIs4nJI9.js +2 -0
- package/.output/public/assets/insights-DTF7C4jb.js +42 -0
- package/.output/public/assets/insights-api-B6Gj74n5.js +1 -0
- package/.output/public/assets/insights-bUk3ChoU.js +1 -0
- package/.output/public/assets/{insights-search-CYPrQVUC.js → insights-search-TfRz5kGG.js} +1 -1
- package/.output/public/assets/insights-usage-rpc-B4V-Qqo4.js +1 -0
- package/.output/public/assets/insights_.distribution-BPl5oRt4.js +2 -0
- package/.output/public/assets/{insights_.distribution-_dZi1_ay.js → insights_.distribution-BqfzAuAf.js} +1 -1
- package/.output/public/assets/insights_.distribution-BqtmnGTt.js +1 -0
- package/.output/public/assets/installations-6U8c_03X.js +1 -0
- package/.output/public/assets/{installations-Y_7QW_p8.js → installations-BU65zztK.js} +1 -1
- package/.output/public/assets/installations-D3MbzcFb.js +2 -0
- package/.output/public/assets/{key-round-DzBe6DHr.js → key-round-B-P_hhUB.js} +1 -1
- package/.output/public/assets/{link-DTEyW70e.js → link-CN3iHC4A.js} +2 -2
- package/.output/public/assets/{list-B6GeoQ_b.js → list-fFsS8Wxe.js} +1 -1
- package/.output/public/assets/loader-circle-GWIgH0fo.js +1 -0
- package/.output/public/assets/native-builds-BdzfAFnF.js +1 -0
- package/.output/public/assets/native-builds-CWwvuOXr.js +2 -0
- package/.output/public/assets/native-builds-Eh72Vr2G.js +1 -0
- package/.output/public/assets/native-builds_._buildId-33ksAlnZ.js +1 -0
- package/.output/public/assets/native-builds_._buildId-BVA5GnZP.js +2 -0
- package/.output/public/assets/native-builds_.devices-CElovmwq.js +1 -0
- package/.output/public/assets/native-builds_.devices-DWtcOVYO.js +2 -0
- package/.output/public/assets/{package-ytYrywZH.js → package-CXSDZsME.js} +1 -1
- package/.output/public/assets/plus-Cx-yFNd9.js +1 -0
- package/.output/public/assets/preload-helper-CRQjUQaZ.js +1 -0
- package/.output/public/assets/{refresh-cw-C-tvoCcE.js → refresh-cw-BgiOaFX3.js} +1 -1
- package/.output/public/assets/{relativeTime-DvyxGIsm.js → relativeTime-CBmDq8wh.js} +1 -1
- package/.output/public/assets/remote-config-B3oq9qR0.js +1 -0
- package/.output/public/assets/remote-config-CGbqsPh_.js +6 -0
- package/.output/public/assets/remote-config-D1OkfQKt.js +1 -0
- package/.output/public/assets/{rotate-cw-Clk5xTeE.js → rotate-cw-C1v7YuN7.js} +1 -1
- package/.output/public/assets/{routes-gQXSzO_n.js → routes-BTG3rg0l.js} +2 -2
- package/.output/public/assets/routes-CVbPjRKo.js +1 -0
- package/.output/public/assets/search-DiOSjaYL.js +1 -0
- package/.output/public/assets/select-CA8r-UUe.js +1 -0
- package/.output/public/assets/send-BgXZNiEA.js +1 -0
- package/.output/public/assets/{sidebar-Di9SN47G.js → sidebar-yC7KdImc.js} +1 -1
- package/.output/public/assets/smartphone-CxP0GGT6.js +1 -0
- package/.output/public/assets/styles-B0kzy3kp.css +2 -0
- package/.output/public/assets/switch-BTHWmKQ5.js +1 -0
- package/.output/public/assets/table-CwF7yxj4.js +1 -0
- package/.output/public/assets/tabs-CHNnCyvw.js +1 -0
- package/.output/public/assets/trash-2-CYISg7ZF.js +1 -0
- package/.output/public/assets/{undo-2-Bt0YXG26.js → undo-2-Bod3vw7x.js} +1 -1
- package/.output/public/assets/{useCompositeListItem-JmyDfo3-.js → useCompositeListItem-lAmUsXcc.js} +1 -1
- package/.output/public/assets/{useMutation-DbYw7boA.js → useMutation-w3qYaU2L.js} +1 -1
- package/.output/server/{__23tanstack-start-server-fn-resolver-z8rr63xV.mjs → __23tanstack-start-server-fn-resolver-BFiPs5uv.mjs} +85 -49
- package/.output/server/_libs/@base-ui/react+[...].mjs +1488 -183
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/_.mjs +1 -1
- package/.output/server/_libs/lucide-react.mjs +22 -2
- package/.output/server/_libs/next-themes.mjs +1 -1
- package/.output/server/_libs/react-redux+[...].mjs +1 -1
- package/.output/server/_libs/recharts+[...].mjs +1 -1
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tanstack__react-query.mjs +1 -1
- package/.output/server/_ssr/{-native-builds-search-M6t7EIt4.mjs → -native-builds-search-Mm_AZoRU.mjs} +8 -2
- package/.output/server/_ssr/{BundleIdDisplay-DRnAzJse.mjs → BundleIdDisplay-BSBR5eJ3.mjs} +3 -3
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-BEU7r4aH.mjs → ConsoleFeatureUnavailable-DcZ4JBVq.mjs} +8 -8
- package/.output/server/_ssr/CopyableText-DgNEsByt.mjs +33 -0
- package/.output/server/_ssr/{EventDetails-CjT6o2sJ.mjs → EventDetails-CUHZuwei.mjs} +9 -9
- package/.output/server/_ssr/{HashValueDisplay-Bkim8r3-.mjs → HashValueDisplay-B9ORaCcP.mjs} +3 -3
- package/.output/server/_ssr/{InsightsPageHeader-Ctw4N3SZ.mjs → InsightsPageHeader-C0bJqC-n.mjs} +9 -9
- package/.output/server/_ssr/IosInstall-C5Y5gnDY.mjs +574 -0
- package/.output/server/_ssr/NativeBuildsNav-hFiyBaFW.mjs +38 -0
- package/.output/server/_ssr/{NotFoundPage-Bh3gFsR6.mjs → NotFoundPage-D4xRjmIA.mjs} +3 -3
- package/.output/server/_ssr/{PlatformIcon-CMLs3Wez.mjs → PlatformIcon-BpGOEXjU.mjs} +2 -2
- package/.output/server/_ssr/{RelativeTime-DjdCU0J7.mjs → RelativeTime-DnvxB666.mjs} +20 -9
- package/.output/server/_ssr/{RolloutPercentageBadge-BiIHw-V2.mjs → RolloutPercentageBadge-NBnIOzY9.mjs} +4 -4
- package/.output/server/_ssr/RowReason-B_jZN48d.mjs +169 -0
- package/.output/server/_ssr/{StoreSubmission-Cv59joPo.mjs → SandboxBadge-CFtTG1ZJ.mjs} +17 -17
- package/.output/server/_ssr/{TargetDisplay-D1PKOupt.mjs → TargetDisplay-0sb03v_6.mjs} +7 -33
- package/.output/server/_ssr/{alert-dialog-BOKQTpmP.mjs → alert-dialog-SLr1Q_AI.mjs} +2 -2
- package/.output/server/_ssr/{api-CDvGGB1B.mjs → api-CkgOQzSb.mjs} +74 -17
- package/.output/server/_ssr/{api-keys-DvbSgd9L.mjs → api-keys-BP7NJtoX.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-NYJ0VaDB.mjs → api-keys-BcSzq0TA.mjs} +11 -11
- package/.output/server/_ssr/{api-keys-rpc-B0MrcD15.mjs → api-keys-rpc-IWPOq5vn.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-CIB9gcI7.mjs → api-rpc-cNJTB3v4.mjs} +48 -32
- package/.output/server/_ssr/{auth-rpc-DsIffEXe.mjs → auth-rpc-oaBbtxSP.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-Dt9XHLs_.mjs → auth.server-WQw9JjMm.mjs} +587 -19
- package/.output/server/_ssr/{badge-KS3YftV5.mjs → badge-n3c0OTBQ.mjs} +2 -2
- package/.output/server/_ssr/{bundleActivity-BGVvqWx7.mjs → bundleActivity-BP40zYSt.mjs} +1 -1
- package/.output/server/_ssr/{card-CG5GqIoA.mjs → card-CYgCcRUd.mjs} +2 -2
- package/.output/server/_ssr/{config.server-CJs-9Zd_.mjs → config.server-R3KQbcML.mjs} +4 -4
- package/.output/server/_ssr/{console-access-ClmTMpo_.mjs → console-access-BLVi82IN.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-CpMYF0Pb.mjs → console-features-api-B2JvJOlE.mjs} +4 -4
- package/.output/server/_ssr/{console-features-rpc-D-dr-WF8.mjs → console-features-rpc-LAxQoSNw.mjs} +3 -3
- package/.output/server/_ssr/{console-features-CRP-pfov.mjs → console-features-xaGDhRC9.mjs} +1 -1
- package/.output/server/_ssr/deviceProfileToken-CwWb1lPq.mjs +82 -0
- package/.output/server/_ssr/{dialog-DvHMJkq7.mjs → dialog-eru_h5oK.mjs} +2 -2
- package/.output/server/_ssr/{downloadBundle-BX8ODCZT.mjs → downloadBundle-DnoYpi36.mjs} +1 -1
- package/.output/server/_ssr/{empty-Bx8DnyWN.mjs → empty-Bu4qodCx.mjs} +3 -3
- package/.output/server/_ssr/{failureReports-C_CmBF4x.mjs → failureReports-BA2eg11O.mjs} +3 -3
- package/.output/server/_ssr/{field-BVI4lxoz.mjs → field-DA5lwO5U.mjs} +3 -3
- package/.output/server/_ssr/foldedPage-CqpVk31Q.mjs +176 -0
- package/.output/server/_ssr/{getBundleChildren-BJTufthT.mjs → getBundleChildren-CdqFonhl.mjs} +1 -1
- package/.output/server/_ssr/{input-group-CpJwooTk.mjs → input-group-VV5E3q78.mjs} +2 -2
- package/.output/server/_ssr/{insights-b1hq1O0p.mjs → insights-BJIt1xuT.mjs} +2 -2
- package/.output/server/_ssr/{insights-B-VtObqr.mjs → insights-C23mopzv.mjs} +5 -5
- package/.output/server/_ssr/{insights-DxlHHXPK.mjs → insights-Ci82qdkq.mjs} +27 -27
- package/.output/server/_ssr/{insights-api-8PWQ7PiR.mjs → insights-api-BwXMKUSe.mjs} +5 -5
- package/.output/server/_ssr/{insights-errors-Bz3sWNZm.mjs → insights-errors-CXHg1lLV.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-DNQ9qVVf.mjs → insights-failures-7zH97WOO.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-rpc-pY2KV9HI.mjs → insights-failures-rpc-BuZ-jnby.mjs} +10 -10
- package/.output/server/_ssr/{insights-recovery-DOkpqnQ8.mjs → insights-recovery-BhOg6kz2.mjs} +1 -1
- package/.output/server/_ssr/{insights-recovery-rpc-CejmWL_y.mjs → insights-recovery-rpc-DrXSy9aA.mjs} +6 -6
- package/.output/server/_ssr/{insights-rpc-D_7d_AAJ.mjs → insights-rpc-DyrIZg3a.mjs} +3 -3
- package/.output/server/_ssr/{insights-search-CoMkZvRt.mjs → insights-search-CNkNB-aa.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-4KDIN3Kg.mjs → insights-usage-h8fipPTv.mjs} +1 -1
- package/.output/server/_ssr/{insights-usage-rpc-CrGZDHzO.mjs → insights-usage-rpc-C7UC1lom.mjs} +6 -6
- package/.output/server/_ssr/{insights-usage-rpc-B1XSuara.mjs → insights-usage-rpc-cTgmD-Ej.mjs} +5 -5
- package/.output/server/_ssr/{insightsUsage-DmQdJZqT.mjs → insightsUsage-BjSiV_X_.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-EOOOOTb6.mjs → insights_.distribution-BauOpBTE.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-CpqnDZNG.mjs → insights_.distribution-CIY_IGmh.mjs} +16 -16
- package/.output/server/_ssr/{insights_.distribution-B9sPDvG4.mjs → insights_.distribution-wfFKEv-Z.mjs} +5 -5
- package/.output/server/_ssr/{installations-BOI_y7Ma.mjs → installations-Ba3YVrAf.mjs} +13 -13
- package/.output/server/_ssr/{installations-dWlOOS7Y.mjs → installations-VzacOKHp.mjs} +2 -2
- package/.output/server/_ssr/{installations-D0_0hzdi.mjs → installations-jGW7nvEV.mjs} +4 -4
- package/.output/server/_ssr/ios-devices-rpc-Bhn7VVIh.mjs +138 -0
- package/.output/server/_ssr/iosDeviceProfile-_XT8TpgZ.mjs +176 -0
- package/.output/server/_ssr/iosDevices-Bc27J72d.mjs +129 -0
- package/.output/server/_ssr/listReleases-DYYA5alS.mjs +94 -0
- package/.output/server/_ssr/{native-builds-OUdRtp6m.mjs → native-builds-BXBkklfA.mjs} +28 -6
- package/.output/server/_ssr/{native-builds-Bx_az6YZ.mjs → native-builds-DZFJGcHy.mjs} +3 -3
- package/.output/server/_ssr/{native-builds-C721Rw23.mjs → native-builds-DiNkKHly.mjs} +221 -86
- package/.output/server/_ssr/{native-builds_._buildId-ubi48Sfs.mjs → native-builds_._buildId-CuM1PsT6.mjs} +108 -294
- package/.output/server/_ssr/{native-builds_._buildId-YItxv8j9.mjs → native-builds_._buildId-D0n4QZY6.mjs} +3 -3
- package/.output/server/_ssr/native-builds_.devices-D0JJlX8E.mjs +689 -0
- package/.output/server/_ssr/native-builds_.devices-DiM2FdcW.mjs +10 -0
- package/.output/server/_ssr/{nativeBuildDownloadLink-C0I8eLpS.mjs → nativeBuildDownloadLink-CvvWuhh0.mjs} +3 -3
- package/.output/server/_ssr/{nativeBuildInstall-CxG8K8TL.mjs → nativeBuildInstall-BqcVHBaD.mjs} +54 -7
- package/.output/server/_ssr/{nativeBuilds-CRLmvFaO.mjs → nativeBuilds-Cub0EUGN.mjs} +135 -13
- package/.output/server/_ssr/{publicConsoleBase-DvHYxDaG.mjs → publicConsoleBase-f67NLLXZ.mjs} +11 -3
- package/.output/server/_ssr/{release-adoption-C7sUFDwa.mjs → release-adoption-DeICczY7.mjs} +2 -2
- package/.output/server/_ssr/{release-adoption-rpc-DcZAYRWJ.mjs → release-adoption-rpc-Dm-5yAJG.mjs} +8 -8
- package/.output/server/_ssr/{releaseAdoption-D6ScSu-W.mjs → releaseAdoption-kHZo8P90.mjs} +3 -3
- package/.output/server/_ssr/{remote-config-gKqDKMxk.mjs → remote-config-D1BhIBKu.mjs} +3 -3
- package/.output/server/_ssr/{remote-config-DOcSXzxG.mjs → remote-config-D7RruPiO.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-BZ_vGV97.mjs → remote-config-ZFm-l4Gi.mjs} +20 -20
- package/.output/server/_ssr/{remote-config-rpc-CVPd3V69.mjs → remote-config-rpc-C7AZy37o.mjs} +3 -3
- package/.output/server/_ssr/{router-Bcyej4cr.mjs → router-BGkGFMsT.mjs} +72 -75
- package/.output/server/_ssr/{routes-B10xsCh4.mjs → routes-CJJxz-Ak.mjs} +304 -230
- package/.output/server/_ssr/{routes-ddBRVSju.mjs → routes-CiJ2dhL9.mjs} +14 -13
- package/.output/server/_ssr/{runtime.server-wcHT2Cop.mjs → runtime.server-CkSbWaZm.mjs} +2 -2
- package/.output/server/_ssr/{schema-migration-rpc-iWZzLv70.mjs → schema-migration-rpc-D4YlwvGH.mjs} +3 -3
- package/.output/server/_ssr/{select-i4WT0c9r.mjs → select-BB8GE7OZ.mjs} +3 -3
- package/.output/server/_ssr/{server-CMgMPrDx.mjs → server-DAHTchcr.mjs} +5 -5
- package/.output/server/_ssr/{sidebar-mIQgB0iy.mjs → sidebar-CsKVgZHa.mjs} +3 -3
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{start-By4wHYjG.mjs → start-D3noqqOK.mjs} +1 -1
- package/.output/server/_ssr/{switch-DR8EAh5C.mjs → switch-BvvmP7Y3.mjs} +3 -3
- package/.output/server/_ssr/{table-DXmK6G7A.mjs → table-WKKzprFn.mjs} +2 -2
- package/.output/server/_ssr/{tabs-DAfypcYe.mjs → tabs-BJ-4SgmC.mjs} +4 -4
- package/.output/server/_ssr/{updateFailures-DNiv3S_y.mjs → updateFailures-D0bP_Ume.mjs} +3 -3
- package/.output/server/_tanstack-start-manifest_v-CSUJeG5D.mjs +219 -0
- package/.output/server/index.mjs +436 -366
- package/lib/index.d.mts +9 -0
- package/package.json +7 -30
- package/src/components/DataTable.tsx +21 -2
- package/src/components/FoldedRows.tsx +201 -0
- package/src/components/RowReason.tsx +56 -0
- package/src/components/features/native-builds/InstallCard.tsx +1 -1
- package/src/components/features/native-builds/IosDevicesPage.tsx +892 -0
- package/src/components/features/native-builds/IosInstall.tsx +292 -62
- package/src/components/features/native-builds/IpaDevicesCard.tsx +107 -0
- package/src/components/features/native-builds/NativeBuildDetailPage.tsx +7 -0
- package/src/components/features/native-builds/NativeBuildsNav.tsx +44 -0
- package/src/components/features/native-builds/NativeBuildsPage.tsx +2 -0
- package/src/components/features/native-builds/NativeBuildsTable.tsx +214 -30
- package/src/components/features/native-builds/OlderBuildLabel.tsx +61 -0
- package/src/index.ts +9 -0
- package/src/lib/api-rpc.ts +56 -29
- package/src/lib/api.ts +65 -2
- package/src/lib/ios-devices-api.ts +110 -0
- package/src/lib/ios-devices-rpc.ts +174 -0
- package/src/lib/native-builds.ts +72 -7
- package/src/lib/server/console-runtime.server.ts +9 -2
- package/src/lib/server/deviceProfileToken.ts +187 -0
- package/src/lib/server/foldedPage.ts +360 -0
- package/src/lib/server/iosDeviceProfile.ts +230 -0
- package/src/lib/server/iosDevices.ts +223 -0
- package/src/lib/server/listReleases.ts +101 -62
- package/src/lib/server/nativeBuildInstall.ts +138 -7
- package/src/lib/server/nativeBuilds.ts +221 -26
- package/src/routeTree.gen.ts +64 -67
- package/src/routes/-native-builds-search.ts +20 -0
- package/src/routes/[_]hot-updater/devices/device-response.ts +21 -0
- package/src/routes/[_]hot-updater/devices/device[.]mobileconfig.ts +17 -0
- package/src/routes/index.tsx +444 -299
- package/src/routes/native-builds_.devices.tsx +21 -0
- package/.output/public/assets/BundleIdDisplay-CP6rsdFO.js +0 -1
- package/.output/public/assets/RelativeTime-TCmpOVPg.js +0 -1
- package/.output/public/assets/StoreSubmission-CqSg880n.js +0 -1
- package/.output/public/assets/TargetDisplay-DwOaMOiI.js +0 -1
- package/.output/public/assets/api-LQJH44FU.js +0 -1
- package/.output/public/assets/api-keys-4w2-ofii.js +0 -1
- package/.output/public/assets/api-keys-uFY8FsN9.js +0 -1
- package/.output/public/assets/arrow-left-g9cKqXuC.js +0 -1
- package/.output/public/assets/arrow-right-CNII8TYn.js +0 -1
- package/.output/public/assets/arrow-up-right-DK8Zdg40.js +0 -1
- package/.output/public/assets/card-ulgg5xHn.js +0 -1
- package/.output/public/assets/check-CXVR3s3X.js +0 -1
- package/.output/public/assets/chevron-right-BoUXo82O.js +0 -1
- package/.output/public/assets/dialog-CLIaC82_.js +0 -1
- package/.output/public/assets/empty-Bhlj8PEo.js +0 -1
- package/.output/public/assets/field-q4sTYzNU.js +0 -1
- package/.output/public/assets/history-DakJoeSM.js +0 -1
- package/.output/public/assets/index-CJclLsbG.js +0 -10
- package/.output/public/assets/insights-0TUItqwh.js +0 -1
- package/.output/public/assets/insights-B75txQ_F.js +0 -42
- package/.output/public/assets/insights-C17Z0whn.js +0 -2
- package/.output/public/assets/insights-api-BVCXJsoV.js +0 -1
- package/.output/public/assets/insights-usage-rpc-BbFllvi_.js +0 -1
- package/.output/public/assets/insights_.distribution-AZcfvK7x.js +0 -1
- package/.output/public/assets/insights_.distribution-gDqNqI5E.js +0 -2
- package/.output/public/assets/installations-Ap2G2tDs.js +0 -1
- package/.output/public/assets/installations-D0g3xvw8.js +0 -2
- package/.output/public/assets/native-builds-Ba6cEZfm.js +0 -2
- package/.output/public/assets/native-builds-C3_-21we.js +0 -1
- package/.output/public/assets/native-builds_._buildId-BnP31v32.js +0 -1
- package/.output/public/assets/native-builds_._buildId-Cp9LJiMP.js +0 -2
- package/.output/public/assets/plus-BVhOauU3.js +0 -1
- package/.output/public/assets/preload-helper-B44EvKhG.js +0 -1
- package/.output/public/assets/remote-config-BRdy8QFR.js +0 -1
- package/.output/public/assets/remote-config-C9p5Pcdj.js +0 -6
- package/.output/public/assets/remote-config-CIAEArwq.js +0 -1
- package/.output/public/assets/routes-BLTF7nwe.js +0 -1
- package/.output/public/assets/search-nnvSOTEB.js +0 -1
- package/.output/public/assets/select-CBIU0_M1.js +0 -1
- package/.output/public/assets/smartphone-r0rRdPas.js +0 -1
- package/.output/public/assets/styles-BdlrKlVs.css +0 -2
- package/.output/public/assets/switch-CP6GsHmN.js +0 -1
- package/.output/public/assets/table-TUtVz-2l.js +0 -1
- package/.output/public/assets/tabs-CP3CSmtI.js +0 -1
- package/.output/public/assets/useInfiniteQuery-DX4WpBRG.js +0 -1
- package/.output/server/_ssr/listReleases-CQEceg8j.mjs +0 -79
- package/.output/server/_ssr/nativeBuildDevice-DJUAzAIj.mjs +0 -210
- package/.output/server/_tanstack-start-manifest_v-8M7ggCuB.mjs +0 -192
- package/src/lib/server/nativeBuildDevice.ts +0 -253
- package/src/routes/[_]hot-updater/native-builds/$buildId/device-response.ts +0 -17
- package/src/routes/[_]hot-updater/native-builds/$buildId/device.ts +0 -17
- package/src/routes/[_]hot-updater/native-builds/$buildId/device[.]mobileconfig.ts +0 -17
- /package/.output/public/assets/{uuidv7-cI6C63Fm.js → uuidv7-CVJ09bBG.js} +0 -0
- /package/.output/public/assets/{valueToPercent-B6X9rUJM.js → valueToPercent-Db73Kirz.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Di as e,Vr as t,_r as n,gr as r,h as i,p as a}from"./sidebar-yC7KdImc.js";import{t as o}from"./link-CN3iHC4A.js";import{o as s}from"./preload-helper-CRQjUQaZ.js";import{t as c}from"./arrow-up-right-BFafIOrq.js";import{S as l,_ as u,c as d,d as f,f as p,m as ee,p as te,y as m}from"./native-builds-BdzfAFnF.js";import{a as ne,i as h,n as re,o as ie,r as ae,t as oe}from"./select-CA8r-UUe.js";import{r as se}from"./HashValueDisplay-DMweha_0.js";import{i as ce,n as g,r as _,t as v}from"./TargetDisplay-DB8D019f.js";import{i as y}from"./-native-builds-search-7blX2yQW.js";import{t as le}from"./history-wYnPoVmT.js";import{t as b}from"./refresh-cw-BgiOaFX3.js";import{a as ue,i as de,n as fe,o as pe,r as me,t as he}from"./badge-DJMW4YVM.js";import{t as ge}from"./uuidv7-CVJ09bBG.js";import{t as x}from"./native-builds-CWwvuOXr.js";import{n as _e,t as ve}from"./PlatformIcon-BBvlg6JY.js";import{a as ye,n as be,o as xe,r as Se,s as Ce,t as we}from"./dialog-tCTZmAo8.js";import{g as Te,i as Ee,p as De}from"./api-DLryz9hA.js";import{i as S,r as C}from"./table-CwF7yxj4.js";import{a as w,c as T,d as E,f as Oe,i as ke,l as Ae,n as je,o as D,p as Me,r as Ne,s as O,t as k,u as Pe}from"./RelativeTime-CY1dKZpv.js";import{a as A,c as Fe,i as j,n as Ie,o as Le,r as Re,s as ze,t as M}from"./RowReason-BMx_vclu.js";import{t as Be}from"./NativeBuildsNav-CjOOlbEu.js";import{i as Ve,n as He,r as N,t as P}from"./SandboxBadge-irEkMf1P.js";var Ue=t(`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`}]]),F=e(),I=`npx hot-updater native-build import <file>`,L=`https://hot-updater.dev/docs/guides/native-build#import-a-build-made-elsewhere`;function We(){return(0,F.jsxs)(we,{children:[(0,F.jsxs)(Ce,{render:(0,F.jsx)(r,{"aria-label":`Import a build`,className:`min-h-11 min-w-11 sm:min-h-7 sm:min-w-0`,size:`sm`,variant:`outline`}),children:[(0,F.jsx)(Ue,{"data-icon":`inline-start`}),(0,F.jsx)(`span`,{className:`hidden sm:inline`,children:`Import a build`})]}),(0,F.jsxs)(be,{className:`sm:max-w-lg`,children:[(0,F.jsxs)(ye,{children:[(0,F.jsx)(xe,{children:`Import a build`}),(0,F.jsx)(Se,{children:`Track an .ipa, .aab, .apk or .app built elsewhere as a patch base.`})]}),(0,F.jsx)(l,{label:`the import command`,value:I,wrap:!0}),(0,F.jsxs)(`a`,{className:n({className:`min-h-11 w-full sm:min-h-8 sm:w-fit`,variant:`outline`}),href:L,rel:`noreferrer`,target:`_blank`,children:[`Import guide`,(0,F.jsx)(c,{"data-icon":`inline-end`})]})]})]})}var Ge={"app-store":`App Store`,"ad-hoc":`ad hoc`,development:`development`,enterprise:`enterprise`},R=e=>{let t=f[e.artifact_kind].label,n=e.submitted_to===null?e.artifact_kind===`ipa`&&e.export_method!==null?`${Ge[e.export_method]} ${t}`:t:`${Ve[e.submitted_to]} build`;return e.is_sandbox?`sandbox ${n}`:n},Ke=e=>{if(e===void 0)return{sentence:`A newer build on its channel reaches people the same way.`,label:`Older: a newer build on its channel reaches people the same way`};let t=u(e);return{sentence:`A newer ${R(e)} exists${t===null?`.`:`: ${t}`}`,label:`Older: a newer ${R(e)} exists${t===null?``:`, ${t}`}`}};function z({newer:e}){let t=Ke(e);return(0,F.jsx)(M,{icon:le,label:t.label,reason:t.sentence,children:`Older`})}var qe=`https://hot-updater.dev/docs/guides/native-build#how-a-build-is-tracked`,B=10,V=e=>e===void 0?{}:{channel:e},Je={one:`older build`,other:`older builds`};function Ye({channel:e,paged:t,folded:i,onClearChannel:a}){return t||i?(0,F.jsx)(O,{icon:y,title:i?`Each build here has a newer one`:`No more native builds`,children:(0,F.jsx)(o,{className:n({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:V(e),to:`/native-builds`,children:`Show the newest builds`})}):e===void 0?(0,F.jsxs)(O,{icon:y,title:`No native builds`,children:[(0,F.jsxs)(`p`,{children:[`Build one with`,` `,(0,F.jsx)(`code`,{className:`font-mono text-xs`,children:`native-build android`}),` or`,` `,(0,F.jsx)(`code`,{className:`font-mono text-xs`,children:`native-build ios`}),`, or import one built elsewhere:`]}),(0,F.jsx)(`div`,{className:`w-full text-left`,children:(0,F.jsx)(l,{label:`the import command`,value:I,wrap:!0})}),(0,F.jsxs)(`a`,{className:n({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),href:qe,rel:`noreferrer`,target:`_blank`,children:[`Native build guide`,(0,F.jsx)(c,{"data-icon":`inline-end`})]}),(0,F.jsxs)(`a`,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:L,rel:`noreferrer`,target:`_blank`,children:[`Import guide`,(0,F.jsx)(c,{"data-icon":`inline-end`})]})]}):(0,F.jsxs)(O,{icon:y,title:(0,F.jsxs)(F.Fragment,{children:[`No native build embeds `,(0,F.jsx)(`span`,{translate:`no`,children:e})]}),children:[(0,F.jsx)(`p`,{children:`A build embeds the channel it was built on. Build one on this channel, or list every channel's builds.`}),(0,F.jsx)(r,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:a,variant:`outline`,children:`Show all channels`})]})}var H=e=>`${m(e.platform)} ${f[e.artifact_kind].label}`;function U({build:e}){return(0,F.jsx)(o,{"aria-label":H(e),className:`relative rounded-sm font-medium whitespace-nowrap text-foreground transition-colors underline-offset-4 after:absolute after:-inset-x-[10px] after:-inset-y-[10px] hover:text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:after:hidden`,params:{buildId:e.id},to:`/native-builds/$buildId`,children:f[e.artifact_kind].label})}function W({build:e,inTable:t=!1}){return t?(0,F.jsxs)(`span`,{className:`flex max-w-24 flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,F.jsx)(U,{build:e}),(0,F.jsx)(P,{build:e})]}):(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,F.jsx)(U,{build:e}),(0,F.jsx)(P,{build:e})]})}function G({channel:e,onChannel:t}){return(0,F.jsx)(`button`,{"aria-label":`Show the builds that embed ${e}`,className:`relative flex max-w-full min-w-0 rounded-md text-left after:absolute after:inset-x-0 after:-inset-y-[11px] focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:after:hidden`,onClick:()=>t(e),title:e,type:`button`,children:(0,F.jsx)(ce,{channel:e,className:`block max-w-32 truncate`})})}function Xe({build:e}){return!N(e)&&!e.is_store_build?(0,F.jsx)(g,{}):(0,F.jsx)(K,{build:e,className:`flex flex-col items-start gap-1`})}function K({build:e,className:t}){return(0,F.jsxs)(`span`,{className:t,children:[(0,F.jsx)(He,{build:e}),e.is_store_build?(0,F.jsx)(he,{className:`px-1.5`,variant:`muted`,children:`Store build`}):null]})}function q({build:e}){return(0,F.jsxs)(`a`,{"aria-label":`Download ${ee(e)}`,className:n({className:`min-h-11 sm:min-h-8`,size:`sm`,variant:`outline`}),download:!0,href:te(e.id),children:[(0,F.jsx)(se,{"data-icon":`inline-start`}),`Download`]})}function Ze({build:e}){return e.build_number?(0,F.jsx)(`span`,{className:`font-mono tabular-nums`,translate:`no`,children:e.build_number}):(0,F.jsx)(g,{})}var J=e=>ge(e.id);function Y({build:e,older:t=!1,newer:n,onChannel:r}){let i=s(),a=p(e);return(0,F.jsxs)(E,{"aria-label":`Open native build ${e.id}`,className:`data-[older=true]:bg-muted/35 data-[older=true]:saturate-50 data-[older=true]:hover:bg-muted/50 data-[older=true]:hover:saturate-100 data-[older=true]:focus-within:saturate-100`,"data-older":t?!0:void 0,onOpen:()=>void i({to:`/native-builds/$buildId`,params:{buildId:e.id}}),children:[(0,F.jsx)(C,{children:(0,F.jsx)(W,{build:e,inTable:!0})}),(0,F.jsx)(C,{children:(0,F.jsx)(G,{channel:a,onChannel:r})}),(0,F.jsx)(C,{className:`whitespace-nowrap`,children:(0,F.jsx)(_e,{platform:e.platform})}),(0,F.jsx)(C,{children:(0,F.jsx)(Ze,{build:e})}),(0,F.jsx)(C,{children:(0,F.jsx)(_,{appVersion:e.app_version,fingerprintHash:e.fingerprint_hash})}),(0,F.jsx)(C,{children:(0,F.jsx)(v,{value:e.build_key})}),(0,F.jsx)(C,{children:(0,F.jsx)(Xe,{build:e})}),(0,F.jsx)(C,{className:`whitespace-nowrap text-muted-foreground tabular-nums`,children:d(e.byte_size)}),(0,F.jsx)(C,{className:`text-xs text-muted-foreground`,children:t?(0,F.jsxs)(`span`,{className:`flex flex-col items-start gap-1`,children:[(0,F.jsx)(k,{ms:J(e)}),(0,F.jsx)(z,{newer:n})]}):(0,F.jsx)(k,{ms:J(e)})}),(0,F.jsx)(C,{className:`text-right`,children:(0,F.jsx)(q,{build:e})})]})}function X({build:e,older:t=!1,newer:n,onChannel:r}){let i=s(),a=p(e),o=N(e)||e.is_store_build;return(0,F.jsxs)(je,{"aria-label":`Native build ${H(e)} ${e.id}`,className:`gap-3 border-b-0 data-[older=true]:bg-muted/35 data-[older=true]:saturate-50 data-[older=true]:hover:bg-muted/50 data-[older=true]:hover:saturate-100 data-[older=true]:focus-within:saturate-100`,"data-older":t?!0:void 0,onClick:Me(()=>void i({to:`/native-builds/$buildId`,params:{buildId:e.id}})),children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-x-2.5`,children:[(0,F.jsx)(ve,{className:`size-4 shrink-0 text-muted-foreground`,platform:e.platform}),(0,F.jsx)(W,{build:e}),t?(0,F.jsx)(z,{newer:n}):null]}),(0,F.jsx)(q,{build:e})]}),(0,F.jsx)(`div`,{className:`flex min-w-0`,children:(0,F.jsx)(G,{channel:a,onChannel:r})}),(0,F.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:m(e.platform)}),e.build_number?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{translate:`no`,children:[`Build`,` `,(0,F.jsx)(`span`,{className:`font-mono tabular-nums text-foreground`,children:e.build_number})]}),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`})]}):null,(0,F.jsx)(`span`,{className:`tabular-nums`,children:d(e.byte_size)}),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,F.jsx)(k,{ms:J(e)})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-6 text-xs`,children:[(0,F.jsxs)(`span`,{className:`flex items-center`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:`Target `}),(0,F.jsx)(_,{appVersion:e.app_version,fingerprintHash:e.fingerprint_hash})]}),e.build_key?(0,F.jsxs)(`span`,{className:`flex items-center`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:`Build key `}),(0,F.jsx)(v,{value:e.build_key})]}):null]}),o?(0,F.jsx)(K,{build:e,className:`flex flex-wrap items-center gap-1.5`}):null]})}function Qe({fold:e,channel:t,isMobile:n,open:r,onOpenChange:i,onChannel:a}){let o=De(t,{...e.from===void 0?{}:{from:e.from},to:e.to},r),s=o.data?.pages??[],c=Object.assign({},...s.map(e=>e.newer)),l=s.flatMap(e=>e.rows),u=n?void 0:B,d=o.isError?(0,F.jsx)(j,{columns:u,label:`Older builds`,onRetry:()=>void o.refetch(),state:`error`}):o.isPending||o.isFetchingNextPage?(0,F.jsx)(j,{columns:u,label:`Loading older builds`,state:`loading`}):o.hasNextPage?(0,F.jsx)(j,{columns:u,label:`Older builds`,onMore:()=>void o.fetchNextPage(),state:`more`}):null,f={label:Le(e,Je),open:r,onOpenChange:i,panelId:`native-build-fold-${e.to}`};return n?(0,F.jsxs)(Ie,{...f,inList:!0,children:[l.map(e=>(0,F.jsx)(`div`,{className:`border-b last:border-b-0`,role:`listitem`,children:(0,F.jsx)(X,{build:e,newer:c[e.id],older:!0,onChannel:a})},e.id)),d]}):(0,F.jsxs)(Re,{...f,columns:B,children:[l.map(e=>(0,F.jsx)(Y,{build:e,newer:c[e.id],older:!0,onChannel:a},e.id)),d]})}function $e({builds:e,channel:t,paged:n,onChannel:a}){let o=i(),s=Fe(),c=e.data?.entries,{next:l,previous:u}=e.data??{},d=c?.filter(({kind:e})=>e===`row`).length??0;if(e.isError)return(0,F.jsxs)(fe,{variant:`destructive`,children:[(0,F.jsx)(pe,{}),(0,F.jsx)(ue,{children:`Native builds couldn't be loaded`}),(0,F.jsx)(de,{children:`Check your connection and try again.`}),(0,F.jsx)(me,{children:(0,F.jsxs)(r,{onClick:()=>void e.refetch(),size:`xs`,variant:`outline`,children:[(0,F.jsx)(b,{"data-icon":`inline-start`}),`Retry`]})})]});let f=(0,F.jsx)(Ye,{channel:t,folded:(c?.length??0)>0,onClearChannel:()=>a(void 0),paged:n}),p=e=>(0,F.jsx)(Qe,{channel:t,fold:e,isMobile:o,onChannel:a,onOpenChange:t=>s.set(A(e),t),open:s.isOpen(A(e))},`fold-${e.to}`);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(T,{children:o?(0,F.jsx)(`div`,{"aria-busy":e.isPlaceholderData,"aria-label":`Native builds`,className:`h-full overflow-y-auto aria-busy:opacity-60`,role:`list`,children:e.isLoading?(0,F.jsx)(Ne,{label:`Loading native builds`}):(0,F.jsxs)(F.Fragment,{children:[d===0?(0,F.jsx)(ke,{children:f}):null,c?.map(e=>e.kind===`fold`?p(e):(0,F.jsx)(`div`,{className:`border-b last:border-b-0`,role:`listitem`,children:(0,F.jsx)(X,{build:e.row,onChannel:a})},e.row.id))]})}):(0,F.jsx)(w,{"aria-busy":e.isPlaceholderData,"aria-label":`Native builds`,className:`aria-busy:opacity-60 [&_td]:px-1.5 [&_th]:px-1.5`,header:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(S,{children:`Artifact`}),(0,F.jsx)(S,{children:`Channel`}),(0,F.jsx)(S,{children:`Platform`}),(0,F.jsx)(S,{children:`Build`}),(0,F.jsx)(S,{children:`Target`}),(0,F.jsx)(S,{children:`Build key`}),(0,F.jsx)(S,{children:`Store`}),(0,F.jsx)(S,{children:`Size`}),(0,F.jsx)(S,{children:`Created`}),(0,F.jsx)(S,{className:`text-right`,children:(0,F.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),rowGroups:!0,children:e.isLoading?(0,F.jsx)(D,{children:(0,F.jsx)(Oe,{columns:B,label:`Loading native builds`})}):(0,F.jsxs)(F.Fragment,{children:[d===0?(0,F.jsx)(D,{children:(0,F.jsx)(Ae,{columns:B,children:f})}):null,ze(c??[]).map(e=>e.kind===`fold`?p(e.fold):(0,F.jsx)(D,{children:e.rows.map(e=>(0,F.jsx)(Y,{build:e,onChannel:a},e.id))},`rows-${e.rows[0].id}`))]})})}),e.isLoading||c===void 0?null:(0,F.jsx)(Pe,{count:d,label:`Native build pages`,pending:e.isPlaceholderData,newest:n?{search:V(t),to:`/native-builds`}:void 0,next:l===void 0?void 0:{search:{...V(t),before:l},to:`/native-builds`},previous:u===void 0?void 0:{search:{...V(t),...u},to:`/native-builds`}})]})}var Z=`all`,Q=`channel:`,$=e=>`${Q}${e}`;function et({search:e,onSearchChange:t}){let{channel:n,before:i,after:o}=e,s=Te(e),c=Ee(),l=c.data?.map(({name:e})=>e)??[],u=n===void 0||l.includes(n)?l:[n,...l],d=e=>t(e===void 0?{}:{channel:e});return(0,F.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,F.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,F.jsx)(a,{className:`-ml-1 size-11 lg:size-7`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,F.jsx)(`h1`,{className:`text-sm font-medium`,children:`Native builds`})]}),(0,F.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,F.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4 bg-muted/5 p-3 sm:p-6`,children:[(0,F.jsx)(Be,{current:`builds`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(oe,{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:n===void 0?Z:$(n),children:[(0,F.jsx)(ne,{"aria-label":`Channel`,className:`min-w-0 flex-1 text-xs data-[size=default]:h-11 sm:w-48 sm:flex-none sm:data-[size=default]:h-8`,children:(0,F.jsx)(ie,{})}),(0,F.jsx)(re,{children:(0,F.jsxs)(ae,{children:[(0,F.jsx)(h,{value:Z,children:`All channels`}),u.map(e=>(0,F.jsx)(h,{translate:`no`,value:$(e),children:e},e))]})})]}),(0,F.jsx)(`div`,{className:`ml-auto`,children:(0,F.jsx)(We,{})}),(0,F.jsx)(r,{"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,F.jsx)(b,{"aria-hidden":`true`})})]}),(0,F.jsx)($e,{builds:s,channel:n,onChannel:d,paged:i!==void 0||o!==void 0})]})]})}function tt(){let e=x.useSearch(),t=x.useNavigate();return(0,F.jsx)(et,{onSearchChange:e=>void t({search:e}),search:e})}export{tt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,Di as t,Vi as n,Vr as r,_r as i,gr as a,p as o}from"./sidebar-yC7KdImc.js";import{t as s}from"./link-CN3iHC4A.js";import{t as c}from"./arrow-up-right-BFafIOrq.js";import{C as l,S as u,_ as d,c as f,d as p,h as m,m as h,p as g,v as ee,x as _,y as v}from"./native-builds-BdzfAFnF.js";import{t as te}from"./chevron-right-DNbYTBX1.js";import{n as ne,t as y}from"./native-builds_._buildId-BVA5GnZP.js";import{r as b}from"./HashValueDisplay-DMweha_0.js";import{i as re,n as ie,r as x,t as ae}from"./RolloutPercentageBadge-BHgHkBGB.js";import{i as oe,r as se,t as ce}from"./TargetDisplay-DB8D019f.js";import{t as le}from"./git-branch-ByZMEBxZ.js";import{i as ue}from"./-native-builds-search-7blX2yQW.js";import{t as de}from"./history-wYnPoVmT.js";import{t as S}from"./refresh-cw-BgiOaFX3.js";import{t as fe}from"./smartphone-CxP0GGT6.js";import{a as C,i as w,n as T,o as E,r as D,t as pe}from"./badge-DJMW4YVM.js";import{n as O}from"./dist-Bw_uSBJn.js";import{a as k,n as A,o as j,t as M}from"./card-C4sBAMU-.js";import{r as me}from"./uuidv7-CVJ09bBG.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./empty-DsbLxQ1w.js";import{n as he}from"./relativeTime-CBmDq8wh.js";import{t as ge}from"./PlatformIcon-BBvlg6JY.js";import{a as _e,d as ve,f as ye,h as be,l as xe,u as Se}from"./api-DLryz9hA.js";import{a as z,i as B,n as V,o as H,r as U,t as W}from"./table-CwF7yxj4.js";import{t as Ce}from"./BundleIdDisplay-B0gAH01c.js";import{a as G,n as we,r as K,t as Te}from"./SandboxBadge-irEkMf1P.js";import{l as q,n as Ee,o as De,t as Oe}from"./IosInstall-B5NspihF.js";var ke=r(`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`}]]),J=t();function Ae({value:e,length:t,label:n}){let r=async()=>{try{await navigator.clipboard.writeText(e),O.success(`Copied to clipboard`,{description:e})}catch{O.error(`Could not copy the ${n}`)}};return(0,J.jsx)(`button`,{"aria-label":`Copy the ${n} ${e}`,className:`relative cursor-copy rounded-sm font-mono after:absolute after:-inset-x-2 after:-inset-y-4 sm:after:hidden text-xs whitespace-nowrap tabular-nums underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:e=>{e.stopPropagation(),r()},title:e,translate:`no`,type:`button`,children:e.slice(0,t)})}function je({hash:e}){let t=_e();if(e===null)return(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let n=ie(t.data?.console.gitUrl,e);return n===null?(0,J.jsx)(Ae,{label:`commit`,length:7,value:e}):(0,J.jsx)(`a`,{className:`relative font-mono text-xs whitespace-nowrap underline-offset-4 after:absolute after:-inset-x-2 after:-inset-y-4 hover:underline sm:after:hidden`,href:n,onClick:e=>e.stopPropagation(),rel:`noreferrer`,target:`_blank`,title:e,translate:`no`,children:e.slice(0,7)})}function Y({label:e,children:t}){return(0,J.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[10rem_minmax(0,1fr)] sm:gap-4`,children:[(0,J.jsx)(`dt`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,J.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}function Me({detail:e}){let{build:t}=e,n=xe();if(t.is_sandbox)return null;let r=!t.is_store_build;return(0,J.jsx)(a,{className:`min-h-11 shrink-0 sm:min-h-8`,disabled:n.isPending,onClick:()=>n.mutate({id:t.id,storeBuild:r},{onSuccess:()=>{O.success(r?`Marked as the store build`:`Mark cleared`)},onError:e=>{O.error(`Could not change the mark`,{description:e.message})}}),size:`sm`,type:`button`,variant:`outline`,children:r?`Mark as store build`:`Clear mark`})}function Ne({detail:e}){let{build:t,newestInScope:n,storeBuildInScope:r}=e,i=r??n;if(i===null)return null;let a=i.id===t.id;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border bg-muted/40 p-3 text-xs sm:flex-row sm:items-center sm:justify-between`,children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,J.jsx)(a?ne:de,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),r?.id===t.id?(0,J.jsxs)(`p`,{children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Store build.`}),` New deploys to this scope patch from this build.`]}):a?(0,J.jsxs)(`p`,{children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Current baseline.`}),` The newest build, and no store build is marked. New deploys to this scope patch from this build.`]}):(0,J.jsxs)(`p`,{children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Not the base.`}),` New deploys patch from`,` `,(0,J.jsxs)(s,{className:`inline-flex items-center gap-0.5 font-medium underline underline-offset-4`,params:{buildId:i.id},to:`/native-builds/$buildId`,children:[d(i)??(0,J.jsxs)(J.Fragment,{children:[v(i.platform),` `,p[i.artifact_kind].label,` ·`,` `,(0,J.jsx)(x,{uuid:i.id})]}),(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-3`})]}),`, so this one gets no new patches.`]})]}),(0,J.jsx)(Me,{detail:e})]})}function Pe({detail:e}){let{build:t,builtInBundle:n,channel:r}=e,i=n?.childCount??0;return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Built-in bundle`})})}),(0,J.jsxs)(A,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,J.jsxs)(`dl`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(Y,{label:`Bundle ID`,children:(0,J.jsx)(Ce,{bundleId:t.min_bundle_id})}),(0,J.jsx)(Y,{label:`OTAs patching from it`,children:(0,J.jsx)(`span`,{className:`tabular-nums`,children:i===1?`1 bundle`:`${i} bundles`})}),(0,J.jsx)(Y,{label:`Scope`,children:(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,J.jsx)(s,{"aria-label":`Show the builds that embed ${r}`,className:`relative rounded-md after:absolute after:inset-x-0 after:-inset-y-[11px] sm:after:hidden`,search:{channel:r},to:`/native-builds`,children:(0,J.jsx)(oe,{channel:r})}),(0,J.jsx)(`span`,{className:`text-xs`,children:v(t.platform)})]})}),(0,J.jsx)(Y,{label:`Target`,children:(0,J.jsx)(`span`,{className:`text-xs`,children:(0,J.jsx)(se,{appVersion:t.app_version,fingerprintHash:t.fingerprint_hash})})}),(0,J.jsx)(Y,{label:`Build key`,children:(0,J.jsx)(`span`,{className:`text-xs`,children:(0,J.jsx)(ce,{value:t.build_key})})}),t.build_number?(0,J.jsx)(Y,{label:`Build`,children:(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,translate:`no`,children:t.build_number})}):null,K(t)?(0,J.jsx)(Y,{label:`Store`,children:(0,J.jsx)(we,{build:t,withTime:!0})}):null,(0,J.jsx)(Y,{label:`Commit`,children:(0,J.jsx)(je,{hash:t.git_commit_hash})}),(0,J.jsx)(Y,{label:`Created`,children:(0,J.jsx)(x,{format:`both`,uuid:t.id})})]}),(0,J.jsx)(Ne,{detail:e}),(0,J.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 Fe=n(he(),1),X={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.`},Ie={apk:`Scan with an Android phone's camera, then open the APK to install it.`,ipa:`Scan to download. ${X.ipa}`,aab:`Scan to download. ${X.aab}`,app:`Scan to download the .app.zip on a Mac.`};function Le(){let{origin:e,pathname:t}=window.location;return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(q,{className:`size-48`,label:`Open this page on an iPhone`,value:`${e}${t}`}),(0,J.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:`Scan with an iPhone to install this build from here. The phone signs in to the Console first.`})]})}function Z({build:e,url:t,note:n}){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(q,{className:`size-48`,label:`Download ${h(e)}`,value:t}),(0,J.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:Ie[e.artifact_kind]}),n?(0,J.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:n}):null]})}function Q({message:e}){return(0,J.jsxs)(T,{variant:`destructive`,children:[(0,J.jsx)(E,{}),(0,J.jsx)(C,{children:`The download link couldn't be created`}),(0,J.jsx)(w,{children:e})]})}function Re({build:t}){let n=ye(t.id),r=n.data?.url;if(r===null){let e=X[t.artifact_kind];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 text-xs text-muted-foreground`,children:[(0,J.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,J.jsx)(`p`,{children:e}):null]})}return r===void 0?n.isError?(0,J.jsx)(Q,{message:n.error.message}):(0,J.jsx)(e,{className:`size-48`}):(0,J.jsx)(Z,{build:t,note:`This link expires. If the download fails, reload this page.`,url:r})}function $({build:e}){return(0,J.jsx)(`span`,{className:`font-mono text-foreground`,translate:`no`,children:e.submitted_version??`this build`})}function ze({build:e}){let t=e.submitted_to===`testflight`?{name:`App Store Connect`,url:`https://appstoreconnect.apple.com/apps`}:{name:`Play Console`,url:`https://play.google.com/console`};return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Install`})})}),(0,J.jsxs)(A,{className:`flex min-w-0 flex-col gap-4 p-4 sm:p-6`,children:[(0,J.jsx)(Be,{build:e}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[(0,J.jsxs)(`a`,{className:i({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`}),href:t.url,rel:`noreferrer`,target:`_blank`,children:[(0,J.jsx)(re,{"data-icon":`inline-start`}),`Open `,t.name]}),(0,J.jsxs)(`a`,{className:i({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:g(e.id),children:[(0,J.jsx)(b,{"data-icon":`inline-start`}),(0,J.jsxs)(`span`,{className:`text-left [overflow-wrap:anywhere]`,children:[`Download `,h(e)]})]})]})]})]})}function Be({build:e}){switch(e.artifact_kind){case`apk`:return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your browser needs the "Install unknown apps" permission.`}),e.is_sandbox?(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Its .sandbox ID installs it beside a Play copy.`}):(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`If this package is already installed with another signing key, such as a Play copy, the install fails. Uninstall that copy first, or build with sandbox: true, whose .sandbox ID installs beside it.`}),(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On an emulator or a phone over USB, install and open it from your project:`}),(0,J.jsx)(u,{label:`the install command`,value:m(e)})]});case`app`:return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It runs only in the iOS Simulator. In your project, install and open it on the booted one:`}),(0,J.jsx)(u,{label:`the install command`,value:m(e)})]});case`aab`:return K(e)?(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Submitted to`,` `,e.submitted_to===`play-internal`?G[`play-internal`].name:G[e.submitted_to].label,` `,`as `,(0,J.jsx)($,{build:e}),`.`,` `,e.submitted_to===`play-production`?`Users`:`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,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`For testers, build and release to internal testing:`}),(0,J.jsx)(u,{label:`the Google Play command`,value:`npx hot-updater google-play upload`})]});case`ipa`:return K(e)?(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`On TestFlight as `,(0,J.jsx)($,{build:e}),`. Internal testers install it from the TestFlight app once App Store Connect has processed it, and a preview's pull request comment shows that state.`]}):(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Over USB, Xcode or Apple Configurator installs it. For testers without a registered device:`}),(0,J.jsx)(u,{label:`the TestFlight command`,value:`npx hot-updater testflight`})]})}}function Ve({link:e,url:t}){return e?.status===`no-secret`?(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,e.secretName,` on the Console to create links.`]}):e?.status!==`issued`||t===null?null:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(u,{label:`the download link`,value:t}),(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Anyone with this link can download this build until`,` `,(0,J.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,Fe.default)(e.expiresAt).format(`YYYY-MM-DD`),`.`]})]})]})}function He({build:e}){return K(e)&&(e.artifact_kind===`ipa`||e.artifact_kind===`aab`)?(0,J.jsx)(ze,{build:e}):(0,J.jsx)(Ue,{build:e})}function Ue({build:t}){let n=h(t),r=ve(t.id),a=r.data?.status===`issued`?ee(window.location,t.id,r.data.token):null,o=Ee(),s=t.artifact_kind===`ipa`,c=s&&o?.ios===!0;return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Install`})})}),(0,J.jsxs)(A,{className:c?`flex min-w-0 flex-col gap-6 p-4 sm:p-6`:`grid gap-6 p-4 sm:grid-cols-[12rem_minmax(0,1fr)] sm:p-6`,children:[c?(0,J.jsx)(Oe,{build:t,device:o}):s&&a!==null?(0,J.jsx)(Le,{}):a===null?r.data===void 0?r.isError?(0,J.jsx)(Q,{message:r.error.message}):(0,J.jsx)(e,{className:`size-48`}):(0,J.jsx)(Re,{build:t}):(0,J.jsx)(Z,{build:t,url:a}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,J.jsx)(Be,{build:t}),(0,J.jsxs)(`a`,{className:i({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:a??g(t.id),children:[(0,J.jsx)(b,{"data-icon":`inline-start`}),(0,J.jsxs)(`span`,{className:`text-left [overflow-wrap:anywhere]`,children:[`Download `,n]})]}),(0,J.jsx)(Ve,{link:r.data,url:a})]})]})]})}function We({build:t}){let n=De(t.id),r=n.data;if(r?.status===`store`||r?.status===`enterprise`)return null;let o=r?.status===`listed`?r.devices:null;return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsxs)(k,{className:`flex flex-row items-center gap-2 border-b px-4 py-3`,children:[(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Devices in this build`})}),o===null?null:(0,J.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:o.length}),(0,J.jsx)(s,{className:i({className:`ml-auto h-11 sm:h-7`,size:`sm`,variant:`ghost`}),to:`/native-builds/devices`,children:`iOS devices`})]}),(0,J.jsx)(A,{className:`p-0`,children:n.isPending?(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Reading this IPA's devices`}),(0,J.jsx)(e,{className:`h-8 w-full`}),(0,J.jsx)(e,{className:`h-8 w-full`})]}):n.isError||r?.status===`unavailable`?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4 text-xs text-muted-foreground`,children:[(0,J.jsx)(`p`,{className:`min-w-0 flex-1`,children:`The Console couldn't read this IPA's devices from storage.`}),(0,J.jsxs)(a,{className:`h-11 sm:h-7`,onClick:()=>void n.refetch(),size:`sm`,variant:`outline`,children:[(0,J.jsx)(S,{"data-icon":`inline-start`}),`Retry`]})]}):o?.length===0?(0,J.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:`This IPA lists no devices.`}):(0,J.jsx)(`ul`,{"aria-label":`Devices in this build`,className:`divide-y`,children:o?.map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-11 min-w-0 items-center gap-3 px-4 py-2 text-sm`,children:[(0,J.jsx)(fe,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),e.name===null?(0,J.jsx)(`span`,{className:`min-w-0 font-mono text-xs [overflow-wrap:anywhere]`,translate:`no`,children:e.udid}):(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:e.name}),(0,J.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,translate:`no`,children:[`…`,e.udid.slice(-6)]})]})]},e.udid))})})]})}var Ge=`https://hot-updater.dev/docs/guides/bundle-diffing#first-ota-update`;function Ke({detail:t,page:n,onPage:r}){let o=n.before!==void 0||n.after!==void 0,u=be(t.build.min_bundle_id,n,o),d=o?u.data:t.patches,{next:p,previous:m}=d??{};return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,id:`patches`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Patches from this build`})})}),(0,J.jsxs)(A,{className:`p-0`,children:[o&&u.isError?(0,J.jsx)(`div`,{className:`p-4`,children:(0,J.jsxs)(T,{variant:`destructive`,children:[(0,J.jsx)(E,{}),(0,J.jsx)(C,{children:`Patches couldn't be loaded`}),(0,J.jsx)(w,{children:u.error.message}),(0,J.jsx)(D,{children:(0,J.jsxs)(a,{onClick:()=>void u.refetch(),size:`xs`,variant:`outline`,children:[(0,J.jsx)(S,{"data-icon":`inline-start`}),`Retry`]})})]})}):d===void 0?(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Loading patches`}),(0,J.jsx)(e,{className:`h-4 w-full`}),(0,J.jsx)(e,{className:`h-4 w-2/3`})]}):d.data.length===0?o?(0,J.jsxs)(R,{className:`py-10`,children:[(0,J.jsx)(P,{children:(0,J.jsx)(I,{children:`No more patches`})}),(0,J.jsx)(a,{className:`min-h-11 sm:min-h-8`,onClick:()=>r({}),variant:`outline`,children:`Show the newest patches`})]}):(0,J.jsxs)(R,{className:`py-10`,children:[(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(le,{})}),(0,J.jsx)(I,{children:`No patches from this build`}),(0,J.jsxs)(L,{children:[`A deploy adds a patch from this build's bundle while it is its scope's store build, or its newest build with none marked, and the deploy config turns patches on, with`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:`patch`}),` in`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:`hot-updater.config.ts`}),`.`]})]}),(0,J.jsx)(F,{children:(0,J.jsxs)(`a`,{className:i({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:Ge,rel:`noreferrer`,target:`_blank`,children:[`Bundle diffing guide`,(0,J.jsx)(c,{"data-icon":`inline-end`})]})})]}):(0,J.jsxs)(W,{"aria-busy":o&&u.isPlaceholderData,"aria-label":`Patches from this build`,className:`table-fixed`,children:[(0,J.jsx)(z,{children:(0,J.jsxs)(H,{children:[(0,J.jsx)(B,{children:`Target bundle`}),(0,J.jsx)(B,{className:`w-28`,children:`Patch size`}),(0,J.jsx)(B,{className:`hidden w-32 sm:table-cell`,children:`Created`})]})}),(0,J.jsx)(V,{children:d.data.map(e=>(0,J.jsxs)(H,{children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsx)(s,{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,J.jsx)(U,{className:`text-xs tabular-nums`,children:f(e.byteSize)}),(0,J.jsx)(U,{className:`hidden sm:table-cell`,children:(0,J.jsx)(x,{uuid:e.bundleId})})]},e.bundleId))})]}),p!==void 0||m!==void 0?(0,J.jsxs)(`nav`,{"aria-label":`Patch pages`,className:`flex items-center justify-end gap-2 border-t px-4 py-2`,children:[(0,J.jsxs)(a,{className:`min-h-11 sm:min-h-7`,disabled:m===void 0||o&&u.isPlaceholderData,onClick:()=>r({after:m}),size:`sm`,variant:`ghost`,children:[(0,J.jsx)(l,{"data-icon":`inline-start`}),`Newer`]}),(0,J.jsxs)(a,{className:`min-h-11 sm:min-h-7`,disabled:p===void 0||o&&u.isPlaceholderData,onClick:()=>r({before:p}),size:`sm`,variant:`ghost`,children:[`Older`,(0,J.jsx)(te,{"data-icon":`inline-end`})]})]}):null]})]})}var qe=(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 Je({download:e}){switch(e.kind){case`patch`:return(0,J.jsxs)(`span`,{className:`text-xs`,children:[`Patch`,` `,(0,J.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`(`,f(e.byteSize),`)`]})]});case`full`:return(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Full bundle`});case`unknown`:return(0,J.jsx)(`a`,{className:`text-xs underline-offset-4 hover:underline`,href:`#patches`,children:`See patches`})}}function Ye({detail:e}){let{build:t,channel:n,servedNow:r,patches:a,catalogScopeKey:o}=e,l=r.find(({rolloutCohortCount:e,targetCohorts:t})=>e>0||t.length>0)?.bundleId,d=t.is_store_build&&l!=null&&qe(a,l).kind===`full`?[`npx hot-updater patch`,`-p ${t.platform}`,`-c ${_(n)}`,`-b ${_(l)}`,`--base-artifact-id ${_(t.min_bundle_id)}`].join(` `):null,f=(0,J.jsxs)(s,{className:`inline-flex items-center gap-0.5 underline-offset-4 hover:underline`,search:{scopeKey:o},to:`/`,children:[`All releases in this scope`,(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-3`})]});return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Served now`})})}),(0,J.jsx)(A,{className:`p-0`,children:r.length===0?(0,J.jsxs)(R,{className:`py-10`,children:[(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(ke,{})}),(0,J.jsx)(I,{children:`No OTA for this build yet`}),(0,J.jsxs)(L,{children:[`No release in this build's scope is newer than its built-in bundle. Deploy one with`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:`hot-updater deploy`}),`, and it shows here.`]})]}),(0,J.jsx)(F,{children:(0,J.jsx)(s,{className:i({className:`min-h-11 sm:min-h-8`,variant:`outline`}),search:{scopeKey:o},to:`/`,children:`All releases in this scope`})})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(W,{"aria-label":`Served now`,className:`table-fixed`,children:[(0,J.jsx)(z,{children:(0,J.jsxs)(H,{children:[(0,J.jsx)(B,{children:`Bundle`}),(0,J.jsx)(B,{className:`hidden w-40 md:table-cell`,children:`Rollout`}),(0,J.jsx)(B,{className:`hidden w-32 sm:table-cell`,children:`Created`}),(0,J.jsx)(B,{className:`w-32`,children:`First OTA download`})]})}),(0,J.jsx)(V,{children:r.map(e=>{let t=e.bundleId,n=e.rolloutCohortCount/me*100;return(0,J.jsxs)(H,{children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsx)(s,{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,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.message}):null]})}),(0,J.jsx)(U,{className:`hidden md:table-cell`,children:(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.targetCohorts.length>0?(0,J.jsx)(pe,{variant:`secondary`,children:e.targetCohorts.length===1?`1 cohort`:`${e.targetCohorts.length} cohorts`}):(0,J.jsx)(ae,{percentage:n}),e.shouldForceUpdate?(0,J.jsx)(pe,{variant:`outline`,children:`Forced`}):null]})}),(0,J.jsx)(U,{className:`hidden sm:table-cell`,children:(0,J.jsx)(x,{uuid:t})}),(0,J.jsx)(U,{children:(0,J.jsx)(Je,{download:qe(a,t)})})]},e.releaseId)})})]}),d===null?null:(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t px-4 py-3 text-xs`,children:[(0,J.jsx)(`p`,{children:`The OTA fresh installs get first has no patch from this store build, so they download all of it. Add one from your project:`}),(0,J.jsx)(u,{label:`the patch command`,value:d})]}),(0,J.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. `,f]})]})})]})}function Xe({buildId:t,search:n,onSearchChange:r}){let c=Se(t),u=c.data,d={...n.patchesBefore===void 0?{}:{before:n.patchesBefore},...n.patchesAfter===void 0?{}:{after:n.patchesAfter}};return(0,J.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,J.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,J.jsx)(o,{className:`-ml-1 size-11 lg:size-7`}),(0,J.jsxs)(s,{className:i({className:`min-h-11 sm:min-h-7`,size:`sm`,variant:`ghost`}),to:`/native-builds`,children:[(0,J.jsx)(l,{"data-icon":`inline-start`}),`Native builds`]}),u?(0,J.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-1.5 text-sm font-medium`,children:[(0,J.jsx)(ge,{className:`size-3.5 shrink-0 text-muted-foreground`,platform:u.build.platform}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,J.jsxs)(`span`,{className:`sr-only`,children:[v(u.build.platform),` `]}),p[u.build.artifact_kind].label,(0,J.jsx)(Te,{build:u.build})]}),(0,J.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`· `,(0,J.jsx)(`span`,{translate:`no`,children:u.channel})]})]}),(0,J.jsx)(`span`,{className:`hidden text-xs font-normal text-muted-foreground tabular-nums sm:inline`,children:f(u.build.byte_size)})]}):(0,J.jsx)(`h1`,{className:`sr-only`,children:`Native build`})]}),(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,J.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 sm:gap-6`,children:c.isError?(0,J.jsxs)(T,{variant:`destructive`,children:[(0,J.jsx)(E,{}),(0,J.jsx)(C,{children:`The native build couldn't be loaded`}),(0,J.jsx)(w,{children:c.error.message}),(0,J.jsx)(D,{children:(0,J.jsxs)(a,{onClick:()=>void c.refetch(),size:`xs`,variant:`outline`,children:[(0,J.jsx)(S,{"data-icon":`inline-start`}),`Retry`]})})]}):u===void 0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Loading the native build`}),(0,J.jsx)(e,{className:`h-56 w-full rounded-xl`}),(0,J.jsx)(e,{className:`h-64 w-full rounded-xl`})]}):u===null?(0,J.jsxs)(R,{className:`border py-16`,children:[(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(ue,{})}),(0,J.jsx)(I,{children:`Native build not found`}),(0,J.jsxs)(L,{children:[`No native build has this ID. It may have been deleted with`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:`native-build delete`}),`, or be from another console.`]})]}),(0,J.jsx)(F,{children:(0,J.jsx)(s,{className:i({className:`min-h-11 sm:min-h-8`,variant:`outline`}),to:`/native-builds`,children:`Show all native builds`})})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(He,{build:u.build}),u.build.artifact_kind===`ipa`&&!K(u.build)?(0,J.jsx)(We,{build:u.build}):null,(0,J.jsx)(Pe,{detail:u}),(0,J.jsx)(Ye,{detail:u}),(0,J.jsx)(Ke,{detail:u,onPage:e=>r({...e.before===void 0?{}:{patchesBefore:e.before},...e.after===void 0?{}:{patchesAfter:e.after}}),page:d})]})})})]})}function Ze(){let{buildId:e}=y.useParams(),t=y.useSearch(),n=y.useNavigate();return(0,J.jsx)(Xe,{buildId:e,onSearchChange:e=>void n({search:e,replace:!0}),search:t})}export{Ze as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds_._buildId-33ksAlnZ.js","assets/sidebar-yC7KdImc.js","assets/link-CN3iHC4A.js","assets/relativeTime-CBmDq8wh.js","assets/arrow-up-right-BFafIOrq.js","assets/native-builds-BdzfAFnF.js","assets/copy-CH1__JAW.js","assets/dist-Bw_uSBJn.js","assets/uuidv7-CVJ09bBG.js","assets/chevron-right-DNbYTBX1.js","assets/HashValueDisplay-DMweha_0.js","assets/RolloutPercentageBadge-BHgHkBGB.js","assets/badge-DJMW4YVM.js","assets/TargetDisplay-DB8D019f.js","assets/key-round-B-P_hhUB.js","assets/package-CXSDZsME.js","assets/git-branch-ByZMEBxZ.js","assets/-native-builds-search-7blX2yQW.js","assets/history-wYnPoVmT.js","assets/refresh-cw-BgiOaFX3.js","assets/smartphone-CxP0GGT6.js","assets/IosInstall-B5NspihF.js","assets/useMutation-w3qYaU2L.js","assets/loader-circle-GWIgH0fo.js","assets/send-BgXZNiEA.js","assets/field-DL4OXTJ7.js","assets/api-DLryz9hA.js","assets/preload-helper-CRQjUQaZ.js","assets/BundleIdDisplay-B0gAH01c.js","assets/PlatformIcon-BBvlg6JY.js","assets/SandboxBadge-irEkMf1P.js","assets/card-C4sBAMU-.js","assets/empty-DsbLxQ1w.js","assets/table-CwF7yxj4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Vr as e}from"./sidebar-yC7KdImc.js";import{i as t,r as n,t as r}from"./preload-helper-CRQjUQaZ.js";import{n as i}from"./-native-builds-search-7blX2yQW.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=t(`/native-builds_/$buildId`)({component:n(()=>r(()=>import(`./native-builds_._buildId-33ksAlnZ.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,24,25,26,27,28,29,30,31,32,33])),`component`),validateSearch:i});export{a as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,An as n,Ar as r,At as i,Bt as a,C as o,Cr as s,Ct as c,Di as l,Dt as u,Er as d,Et as f,Ft as p,Gt as m,Hn as h,Ht as ee,In as g,Jt as _,Kt as te,L as ne,Li as v,Lr as y,Mr as b,Mt as x,Nr as S,Or as C,Ot as w,Pr as T,Pt as re,Qn as E,Qt as D,Ri as O,Rr as ie,Rt as k,Sn as A,Sr as ae,St as j,Tr as M,Tt as oe,Ut as N,Vi as P,Vr as F,Vt as se,Wt as I,Xt as ce,Yt as L,Z as R,Zt as z,_r as B,_t as le,ct as V,dt as ue,en as H,fr as de,ft as U,gr as W,gt as fe,h as pe,hn as me,hr as he,jn as ge,jr as _e,kr as G,kt as ve,lt as K,mr as q,mt as ye,nn as be,ot as xe,p as J,pr as Se,pt as Ce,qt as we,rn as Y,st as Te,tn as Ee,tt as De,ur as Oe,ut as ke,vn as Ae,vr as je,vt as Me,wn as Ne,wt as Pe,xr as Fe,xt as Ie,yt as Le}from"./sidebar-yC7KdImc.js";import{t as Re}from"./link-CN3iHC4A.js";import{t as ze}from"./check-CqWNyG93.js";import{n as Be,r as Ve}from"./useCompositeListItem-lAmUsXcc.js";import{S as He,l as Ue,n as We,s as Ge,t as Ke,u as qe}from"./native-builds-BdzfAFnF.js";import{F as Je,P as Ye,a as Xe,i as Ze,l as Qe,n as $e,o as et,r as tt,s as nt,t as rt,u as it}from"./select-CA8r-UUe.js";import{i as at}from"./-native-builds-search-7blX2yQW.js";import{t as ot}from"./loader-circle-GWIgH0fo.js";import{n as st,t as ct}from"./CompositeItem-Dy4xgOMg.js";import{t as lt}from"./refresh-cw-BgiOaFX3.js";import{t as ut}from"./smartphone-CxP0GGT6.js";import{t as dt}from"./trash-2-CYISg7ZF.js";import{a as ft,i as pt,n as mt,o as ht,r as gt,t as _t}from"./badge-DJMW4YVM.js";import{a as vt,n as yt,o as bt,t as xt}from"./card-C4sBAMU-.js";import{t as St}from"./uuidv7-CVJ09bBG.js";import{n as Ct}from"./relativeTime-CBmDq8wh.js";import{a as wt,i as Tt,l as Et,n as Dt,o as Ot,r as kt,s as At,t as jt}from"./alert-dialog-CLC_h1fL.js";import{a as Mt,i as Nt,n as Pt,o as Ft,r as It,t as Lt}from"./dialog-tCTZmAo8.js";import{a as Rt,i as zt,n as Bt,r as Vt,t as Ht}from"./field-DL4OXTJ7.js";import{t as Ut}from"./native-builds_.devices-DWtcOVYO.js";import{i as X,o as Wt,r as Z}from"./table-CwF7yxj4.js";import{a as Gt,c as Kt,f as qt,i as Jt,l as Yt,n as Xt,r as Zt,s as Qt,t as $t}from"./RelativeTime-CY1dKZpv.js";import{t as en}from"./NativeBuildsNav-CjOOlbEu.js";import{a as tn,c as nn,i as rn,l as an,n as on,r as sn,s as cn}from"./IosInstall-B5NspihF.js";var ln=F(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Q=P(O()),un=Q.createContext(void 0);function dn(e=!0){let t=Q.useContext(un);if(t===void 0&&!e)throw Error(G(25));return t}var fn=Q.createContext(void 0);function pn(e){let t=Q.useContext(fn);if(t===void 0&&!e)throw Error(G(33));return t}var mn=Q.createContext(void 0);function hn(e){let t=Q.useContext(mn);if(t===void 0&&!e)throw Error(G(36));return t}function gn(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=dn(!0),d=u!==void 0;return Q.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:g})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||d&&!Oe&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,a,o,s,u,d,c])}var _n={type:`regular-item`};function vn(e){let{closeOnClick:t,disabled:n=!1,highlighted:i,id:a,store:o,typingRef:s=o.context.typingRef,nativeButton:c,itemMetadata:l,nodeId:u}=e,f=Q.useRef(null),{getButtonProps:p,buttonRef:m}=d({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),h=gn({closeOnClick:t,highlighted:i,id:a,nodeId:u,store:o,typingRef:s,itemRef:f,itemMetadata:l}),ee=Q.useCallback(e=>r(h,{onMouseEnter(){l.type===`submenu-trigger`&&l.setActive()}},e,p),[h,p,l]),g=M(f,m);return Q.useMemo(()=>({getItemProps:ee,itemRef:g}),[ee,g])}var yn=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=Be({label:a}),f=pn(!0),p=U(i),{store:m}=hn(),h=m.useState(`isActive`,d.index),ee=m.useState(`itemProps`),{getItemProps:g,itemRef:_}=vn({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:_n});return Fe(`div`,e,{state:{disabled:s,highlighted:h},props:[ee,u,g],ref:[_,t,d.ref]})}),$=l(),bn={...Ce,...x},xn=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=hn(),{side:c,align:l}=pn(),u=nt(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),te=s.useState(`lastOpenChangeReason`),v=s.useState(`rootId`),y=s.useState(`floatingRootContext`),b=s.useState(`floatingTreeRoot`),x=s.useState(`closeDelay`),S=s.useState(`activeTriggerElement`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=_.type===`context-menu`;ve({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),Q.useEffect(()=>{function e(e){s.setOpen(!1,A(e.reason,e.domEvent))}return b.events.on(`close`,e),()=>{b.events.off(`close`,e)}},[b.events,s]),Me(y,{enabled:C&&!w&&!T&&_.type!==`menubar`,closeDelay:x});let re=Q.useCallback(e=>{s.set(`popupElement`,e)},[s]),E=Fe(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,re],stateAttributesMapping:bn,props:[p,{onKeyDown(e){u&&ne.has(e.key)&&e.stopPropagation()}},V(f),o,{"data-rootownerid":v}]}),D=_.type===void 0||T;return(g||_.type===`menubar`&&te!==`outside-press`)&&(D=!0),(0,$.jsx)(ee,{context:y,modal:T,disabled:!m,returnFocus:a===void 0?D:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:b,previousFocusableElement:S,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:E})}),Sn=Q.createContext(void 0);function Cn(){let e=Q.useContext(Sn);if(e===void 0)throw Error(G(32));return e}var wn=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=hn();return i.useState(`mounted`)||n?(0,$.jsx)(Sn.Provider,{value:n,children:(0,$.jsx)(L,{ref:t,...r})}):null}),Tn=Q.forwardRef(function(e,n){let{anchor:r,positionMethod:a=`absolute`,className:o,render:s,side:c,align:l,sideOffset:u=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p=5,arrowPadding:m=5,sticky:ee=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=ce,style:te,...ne}=e,{store:v}=hn(),y=Cn(),b=dn(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),re=v.useState(`modal`),E=v.useState(`openMethod`),D=v.useState(`activeTriggerElement`),O=v.useState(`transitionStatus`),ie=v.useState(`positionerElement`),k=v.useState(`instantType`),ae=v.useState(`hasViewport`),j=v.useState(`lastOpenChangeReason`),M=v.useState(`floatingNodeId`),oe=v.useState(`floatingParentNodeId`),P=S.useState(`domReferenceElement`),F=Q.useRef(null),se=i(ie,!1,!1),I=r,L=u,R=d,B=l,le=_;x.type===`context-menu`&&(I=r??x.context?.anchor,B??=`start`,!c&&B!==`center`&&(R=e.alignOffset??2,L=e.sideOffset??-5));let V=c,ue=B;x.type===`menu`?(V??=`inline-end`,ue??=`start`,le=e.collisionAvoidance??z):x.type===`menubar`&&(V??=`bottom`,ue??=`start`);let H=x.type===`context-menu`,U=K({anchor:I,floatingRootContext:S,positionMethod:b?`fixed`:a,mounted:w,side:V,sideOffset:L,align:ue,alignOffset:R,arrowPadding:H?0:m,collisionBoundary:f,collisionPadding:p,sticky:ee,nodeId:M,keepMounted:y,disableAnchorTracking:g,collisionAvoidance:le,shiftCrossAxis:H&&!(`side`in le&&le.side===`flip`),externalTree:C,adaptiveOrigin:ae?ke:void 0});Q.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===M&&v.set(`hoverEnabled`,!1),e.nodeId!==M&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,A(h)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,M]),Q.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,A(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let W=de();Q.useEffect(()=>{T||W.clear()},[T,W]),Q.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&D&&D!==e.target){let e=v.select(`closeDelay`);e>0?W.isStarted()||W.start(e,()=>{v.setOpen(!1,A(h))}):v.setOpen(!1,A(h))}else W.clear()}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,D,v,W]),Q.useEffect(()=>{let e={open:T,nodeId:M,parentNodeId:oe,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,M,oe]),_e(()=>{let e=P,t=F.current;if(e&&(F.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return se(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,se,v]);let fe={open:T,side:U.side,align:U.align,anchorHidden:U.anchorHidden,nested:x.type===`menu`,instant:k},pe=x.type===`menubar`&&x.context.modal;Qe(T&&(pe||re&&j!==`trigger-hover`),E===`touch`,ie,D);let me=Te(e,fe,{styles:U.positionerStyles,transitionStatus:O,props:ne,refs:[n,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),he=w&&x.type!==`menu`&&(x.type!==`menubar`&&re&&j!==`trigger-hover`||x.type===`menubar`&&x.context.modal),ge=null;return x.type===`menubar`?ge=x.context.contentElement:x.type===void 0&&(ge=D),(0,$.jsxs)(fn.Provider,{value:U,children:[he&&(0,$.jsx)(t,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:xe(!T),cutout:ge}),(0,$.jsx)(N,{id:M,children:(0,$.jsx)(Ve,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:me})})]})}),En=Q.createContext(null);function Dn(e){let t=Q.useContext(En);if(t===null&&!e)throw Error(G(5));return t}var On={...j,disabled:k(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:k(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),openMethod:k(e=>e.openMethod),allowMouseEnter:k(e=>e.allowMouseEnter),stickIfOpen:k(e=>e.stickIfOpen),parent:k(e=>e.parent),rootId:k(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:k(e=>e.activeIndex),isActive:k((e,t)=>e.activeIndex===t),hoverEnabled:k(e=>e.hoverEnabled),instantType:k(e=>e.instantType),lastOpenChangeReason:k(e=>e.openChangeReason),floatingTreeRoot:k(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:k(e=>e.floatingNodeId),floatingParentNodeId:k(e=>e.floatingParentNodeId),itemProps:k(e=>e.itemProps),closeDelay:k(e=>e.closeDelay),hasViewport:k(e=>e.hasViewport),keyboardEventRelay:k(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},kn=class e extends p{constructor(e){super({...An(),...e},{positionerRef:Q.createRef(),popupRef:Q.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Q.createRef(),beforeContentFocusGuardRef:Q.createRef(),onOpenChangeComplete:void 0,triggerElements:new c},On),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=S(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function An(){return{...Ie(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new _,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:s,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var jn=Q.createContext(void 0);function Mn(){return Q.useContext(jn)}var Nn=q(function(e){let{children:t,open:n,onOpenChange:i,onOpenChangeComplete:c,defaultOpen:l=!1,disabled:d=!1,modal:p,loopFocus:h=!0,orientation:ee=`vertical`,actionsRef:g,closeParentOnEsc:_=!1,handle:ne,triggerId:v,defaultTriggerId:y=null,highlightItemOnHover:x=!0}=e,S=dn(!0),C=hn(!0),w=Dn(!0),T=Mn(),E=Q.useMemo(()=>T&&C?{type:`menu`,store:C.store}:w?{type:`menubar`,context:w}:S&&!C?{type:`context-menu`,context:S}:{type:void 0},[S,C,w,T]),O=kn.useStore(ne?.store,{open:l,openProp:n,activeTriggerId:y,triggerIdProp:v,parent:E});Se(()=>{n===void 0&&O.state.open===!1&&l===!0&&O.update({open:!0,activeTriggerId:y})}),O.useControlledProp(`openProp`,n),O.useControlledProp(`triggerIdProp`,v),O.useContextCallback(`onOpenChangeComplete`,c);let ie=D(),k=D(),j=O.useState(`floatingTreeRoot`),M=m(j),N=te(),P=O.useState(`open`),F=O.useState(`activeTriggerElement`),se=O.useState(`positionerElement`),ce=O.useState(`hoverEnabled`),L=O.useState(`disabled`),R=O.useState(`lastOpenChangeReason`),z=O.useState(`parent`),B=O.useState(`activeIndex`),le=O.useState(`payload`),V=O.useState(`floatingParentNodeId`),H=Q.useRef(null),U=Q.useRef(z.type!==`context-menu`),W=de(),fe=Q.useRef(!0),pe=de(),me=V!=null,{openMethod:he,triggerProps:G}=o(P);O.useSyncedValues({disabled:d,modal:z.type===void 0?p:void 0,openMethod:he,rootId:ie}),oe(O);let{forceUnmount:ve}=f(P,O,()=>{O.update({allowMouseEnter:!1,stickIfOpen:!0})});_e(()=>{S&&!C?O.update({parent:{type:`context-menu`,context:S},floatingNodeId:M,floatingParentNodeId:N}):C&&O.update({floatingNodeId:M,floatingParentNodeId:N})},[S,C,M,N,O]),Q.useEffect(()=>{if(P||(H.current=null),z.type===`context-menu`){if(!P){W.clear(),U.current=!1;return}W.start(500,()=>{U.current=!0})}},[W,P,z.type]),_e(()=>{!P&&!ce&&O.set(`hoverEnabled`,!0)},[P,ce,O]);let K=b((e,t)=>{let n=t.reason;if(P===e&&t.trigger===F&&R===n||(t.preventUnmountOnClose=()=>{O.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=F??void 0),i?.(e,t),t.isCanceled))return;O.state.floatingRootContext.dispatchOpenChange(e,t);let r=t.event;if(e===!1&&r?.type===`click`&&r.pointerType===`touch`&&!fe.current)return;if(!e&&B!==null){let e=O.context.itemDomElements.current[B];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(fe.current=!1,pe.start(300,()=>{fe.current=!0})):(fe.current=!0,pe.clear());let a=(n===`trigger-press`||n===`item-press`)&&r.detail===0&&r?.isTrusted,o=!e&&(n===`escape-key`||n==null),s={open:e,openChangeReason:n};H.current=t.event??null;let c=t.trigger?.id??null;(c||e)&&(s.activeTriggerId=c,s.activeTriggerElement=t.trigger??null),O.update(s),z.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?O.set(`instantType`,`group`):a||o?O.set(`instantType`,a?`click`:`dismiss`):O.set(`instantType`,void 0)}),q=re({popupStore:O,floatingId:k,nested:N!=null,onOpenChange:K}),ye=q.context.events;Q.useEffect(()=>{let e=({open:e,eventDetails:t})=>K(e,t);return ye.on(`setOpen`,e),()=>{ye?.off(`setOpen`,e)}},[ye,K]);let be=Q.useCallback(()=>{O.setOpen(!1,A(ge))},[O]);Q.useImperativeHandle(g,()=>({unmount:ve,close:be}),[ve,be]);let xe;z.type===`context-menu`&&(xe=z.context),Q.useImperativeHandle(xe?.positionerRef,()=>se,[se]),Q.useImperativeHandle(xe?.actionsRef,()=>({setOpen:K}),[K]);let J=a(q,{enabled:!L,bubbles:{escapeKey:_&&z.type===`menu`},outsidePress(){return z.type!==`context-menu`||H.current?.type===`contextmenu`?!0:U.current},externalTree:me?j:void 0}),Ce=ue(),we=Q.useCallback(e=>{O.select(`activeIndex`)!==e&&O.set(`activeIndex`,e)},[O]),Y=Je(q,{enabled:!L,listRef:O.context.itemDomElements,activeIndex:B,nested:z.type!==void 0,loopFocus:h,orientation:ee,parentOrientation:z.type===`menubar`?z.context.orientation:void 0,rtl:Ce===`rtl`,disabledIndices:ae,onNavigate:we,openOnArrowKeyDown:z.type!==`context-menu`,externalTree:me?j:void 0,focusItemOnHover:x}),Te=Q.useCallback(e=>{O.context.typingRef.current=e},[O]),Ee=Ye(q,{listRef:O.context.itemLabels,elementsRef:O.context.itemDomElements,activeIndex:B,resetMs:500,onMatch:e=>{P&&e!==B&&O.set(`activeIndex`,e)},onTyping:Te});u(O,{floatingRootContext:q,activeTriggerProps:Q.useMemo(()=>{let e=r(Ee.reference,Y.reference,J.reference,{onMouseMove(){O.set(`allowMouseEnter`,!0)}},G);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=P,e},[O,Ee.reference,Y.reference,J.reference,G,P]),inactiveTriggerProps:Q.useMemo(()=>{let e=r(Y.trigger,J.trigger,G);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Y.trigger,J.trigger,G]),popupProps:Q.useMemo(()=>r(Pe,{id:k,role:`menu`,"aria-labelledby":F?.id,onMouseMove(){O.set(`allowMouseEnter`,!0),z.type===`menu`&&O.set(`hoverEnabled`,!1)},onClick(){O.select(`hoverEnabled`)&&O.set(`hoverEnabled`,!1)},onKeyDown(e){let t=O.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ee.floating,Y.floating,J.floating),[F,k,z.type,O,Ee.floating,Y.floating,J.floating]),itemProps:Y.item??s});let De=Q.useMemo(()=>({store:O,parent:E}),[O,E]),Oe=(0,$.jsx)(mn.Provider,{value:De,children:typeof t==`function`?t({payload:le}):t});return z.type===void 0||z.type===`context-menu`?(0,$.jsx)(I,{externalTree:j,children:Oe}):Oe});function Pn(e){if(y(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!ie(e))return Pn(T(e))}var Fn=P(v());function In(e,t){let r=Q.useRef(null);function i(t){Fn.flushSync(()=>{e.setOpen(!1,A(n,t.nativeEvent,t.currentTarget))}),be(r.current)?.focus()}function a(r){let i=e.select(`positionerElement`);if(i&&Y(r,i))e.context.beforeContentFocusGuardRef.current?.focus();else{Fn.flushSync(()=>{e.setOpen(!1,A(n,r.nativeEvent,r.currentTarget))});let a=Ee(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&E(i,a);){let e=a;if(a=H(a),a===e)break}a?.focus()}}return{preFocusGuardRef:r,handlePreFocusGuardFocus:i,handleFocusTargetFocus:a}}function Ln(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Q.useRef(!1);return Q.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Ae(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:s,[t,n,r])}var Rn=2,zn=he(function(e,t){let{render:n,className:i,style:a,disabled:o=!1,nativeButton:c=!0,id:l,openOnHover:u,delay:f=100,closeDelay:p=0,handle:h,payload:ee,...g}=e,ne=hn(!0),v=h?.store??ne?.store;if(!v)throw Error(G(85));let y=U(l),x=v.useState(`isTriggerActive`,y),S=v.useState(`floatingRootContext`),T=v.useState(`isOpenedByTrigger`,y),re=v.useState(`triggerPopupId`,y),D=Q.useRef(null),O=Vn(),ie=C(!0),k=we(),A=Q.useMemo(()=>k??new _,[k]),{registerTrigger:ae,isMountedByThisTrigger:j}=w(y,D,v,{payload:ee,closeDelay:p,parent:O,floatingTreeRoot:A,floatingNodeId:m(A),floatingParentNodeId:te(),keyboardEventRelay:ie?.relayKeyboardEvent}),M=O.type===`menubar`,oe=v.useState(`disabled`),N=o||oe||M&&O.context.disabled,{getButtonProps:P,buttonRef:F}=d({disabled:N,native:c});Q.useEffect(()=>{!T&&O.type===void 0&&(v.context.allowMouseUpTriggerRef.current=!1)},[v,T,O.type]);let I=Q.useRef(null),ce=de(),L=b(e=>{if(!I.current)return;ce.clear(),v.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(E(I.current,t)||E(v.select(`positionerElement`),t)||t===I.current||t!=null&&Pn(t)===v.select(`rootId`))return;let n=it(I.current);e.clientX>=n.left-Rn&&e.clientX<=n.right+Rn&&e.clientY>=n.top-Rn&&e.clientY<=n.bottom+Rn||A.events.emit(`close`,{domEvent:e,reason:Ne})});Q.useEffect(()=>{T&&v.select(`lastOpenChangeReason`)===`trigger-hover`&&Ae(I.current).addEventListener(`mouseup`,L,{once:!0})},[T,L,v]);let R=M&&O.context.hasSubmenuOpen,z=le(S,{enabled:(u??R)&&!N&&O.type!==`context-menu`&&(!M||R&&!j),handleClose:fe({blockPointerEvents:!M}),mouseOnly:!0,move:!1,restMs:O.type===void 0?f:void 0,delay:{close:p},triggerElementRef:D,externalTree:A,isActiveTrigger:x,isClosing:()=>v.select(`transitionStatus`)===`ending`}),B=Bn(T,v.select(`lastOpenChangeReason`)),V=se(S,{enabled:!N&&O.type!==`context-menu`,event:T&&M?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:O.type===void 0?B:!1}),ue=Le(S,{enabled:!N&&R}),H=Ln({open:T,enabled:M,mouseDownAction:`open`}),W=Q.useMemo(()=>r(ue.reference,V.reference),[ue.reference,V.reference]),pe=v.useState(`triggerProps`,j),{preFocusGuardRef:he,handlePreFocusGuardFocus:ge,handleFocusTargetFocus:_e}=In(v,D),ve={disabled:N,open:T},K=[I,t,F,ae,D],q=[W,z??s,pe,{"aria-haspopup":`menu`,"aria-controls":re,id:y,onMouseDown:e=>{v.select(`open`)||(ce.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),Ae(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},M?{role:`menuitem`}:{},H,g,P],be=Fe(`button`,e,{enabled:!M,stateAttributesMapping:ye,state:ve,ref:K,props:q});return M?(0,$.jsx)(ct,{tag:`button`,render:n,className:i,style:a,state:ve,refs:K,props:q,stateAttributesMapping:ye}):T?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(me,{ref:he,onFocus:ge},`${y}-pre-focus-guard`),(0,$.jsx)(Q.Fragment,{children:be},y),(0,$.jsx)(me,{ref:v.context.triggerFocusTargetRef,onFocus:_e},`${y}-post-focus-guard`)]}):(0,$.jsx)(Q.Fragment,{children:be},y)});function Bn(e,t){let n=de(),[r,i]=Q.useState(!1);return _e(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Vn(){let e=dn(!0),t=hn(!0),n=Dn(!0);return Q.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}var Hn=P(Ct(),1);function Un({...e}){return(0,$.jsx)(Nn,{"data-slot":`dropdown-menu`,...e})}function Wn({...e}){return(0,$.jsx)(zn,{"data-slot":`dropdown-menu-trigger`,...e})}function Gn({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,$.jsx)(wn,{children:(0,$.jsx)(Tn,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,$.jsx)(xn,{"data-slot":`dropdown-menu-content`,className:je(`dark z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function Kn({className:e,inset:t,variant:n=`default`,...r}){return(0,$.jsx)(yn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:je(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function qn({className:e,...t}){return(0,$.jsx)(De,{"data-slot":`dropdown-menu-separator`,className:je(`-mx-1 my-1 h-px bg-border/50`,e),...t})}var Jn={pending:`Requested`,approved:`Approved`,registered:`Registered`},Yn={pending:`warning`,approved:`secondary`,registered:`muted`},Xn=`all`,Zn=6,Qn=()=>window.location.pathname.endsWith(`/native-builds/devices`)?window.location.pathname.slice(0,-We.length):Ge(window.location,``),$n=(e,t)=>({approve:t.canApprove&&e.status===`pending`,rename:t.canApprove,remove:t.canApprove,withdraw:!t.canApprove&&e.status===`pending`&&e.requested_by===t.email});function er({device:e}){return e.apple_error===null?null:(0,$.jsx)(`span`,{className:`max-w-64 text-xs whitespace-normal text-muted-foreground`,children:e.apple_error})}function tr({device:e,withError:t=!0}){return(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 flex-col items-start gap-1`,children:[(0,$.jsx)(_t,{variant:Yn[e.status],children:Jn[e.status]}),t?(0,$.jsx)(er,{device:e}):null]})}function nr({device:e}){if(e.build_id===null)return(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let t=`A build`;try{t=`Build of ${(0,Hn.default)(St(e.build_id)).format(`MMM D`)}`}catch{}return(0,$.jsx)(Re,{className:`text-xs font-medium underline-offset-4 hover:underline`,params:{buildId:e.build_id},to:`/native-builds/$buildId`,children:t})}function rr({device:e,viewer:t,onOpen:n}){let r=$n(e,t);return!r.approve&&!r.rename&&!r.remove&&!r.withdraw?null:(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[r.approve?(0,$.jsxs)(W,{className:`h-11 sm:h-7`,onClick:()=>n({kind:`approve`,device:e}),size:`sm`,children:[(0,$.jsx)(ze,{"data-icon":`inline-start`}),`Approve`]}):null,r.withdraw?(0,$.jsx)(W,{className:`h-11 sm:h-7`,onClick:()=>n({kind:`remove`,device:e}),size:`sm`,variant:`outline`,children:`Withdraw`}):null,r.rename||r.remove?(0,$.jsxs)(Un,{children:[(0,$.jsx)(Wn,{render:(0,$.jsx)(W,{"aria-label":`More actions for ${e.name}`,className:`size-11 sm:size-7`,size:`icon-sm`,variant:`ghost`}),children:(0,$.jsx)(ln,{"aria-hidden":`true`})}),(0,$.jsxs)(Gn,{align:`end`,children:[(0,$.jsxs)(Kn,{onClick:()=>n({kind:`rename`,device:e}),children:[(0,$.jsx)(st,{"aria-hidden":`true`}),`Rename`]}),(0,$.jsx)(qn,{}),(0,$.jsxs)(Kn,{onClick:()=>n({kind:`remove`,device:e}),variant:`destructive`,children:[(0,$.jsx)(dt,{"aria-hidden":`true`}),e.status===`pending`?`Decline`:`Remove`]})]})]}):null]})}function ir({device:e,viewer:t,onOpen:n}){return(0,$.jsxs)(Wt,{children:[(0,$.jsx)(Z,{className:`font-medium`,children:e.name}),(0,$.jsx)(Z,{children:(0,$.jsx)(`span`,{className:`font-mono text-xs`,title:e.udid,translate:`no`,children:qe(e.udid)})}),(0,$.jsx)(Z,{className:`text-xs`,children:e.requested_by??(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Terminal`})}),(0,$.jsx)(Z,{children:(0,$.jsx)(tr,{device:e})}),(0,$.jsx)(Z,{className:`text-xs`,children:(0,$.jsx)($t,{ms:e.created_at_ms})}),(0,$.jsx)(Z,{children:(0,$.jsx)(nr,{device:e})}),(0,$.jsx)(Z,{className:`text-right`,children:(0,$.jsx)(rr,{device:e,onOpen:n,viewer:t})})]})}function ar({device:e,viewer:t,onOpen:n}){return(0,$.jsxs)(Xt,{className:`cursor-default gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.name}),(0,$.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,translate:`no`,children:qe(e.udid)})]}),(0,$.jsx)(tr,{device:e,withError:!1})]}),(0,$.jsx)(er,{device:e}),(0,$.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:e.requested_by??`Terminal`}),(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,$.jsx)($t,{ms:e.created_at_ms}),e.build_id===null?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,$.jsx)(nr,{device:e})]})]}),(0,$.jsx)(rr,{device:e,onOpen:n,viewer:t})]})}function or({target:e,onClose:t}){let n=sn(),r=nn(),i=e.kind===`approve`?n:r,[a,o]=(0,Q.useState)(e.device.name),s=a.trim();return(0,$.jsx)(Lt,{onOpenChange:e=>e?null:t(),open:!0,children:(0,$.jsxs)(Pt,{children:[(0,$.jsxs)(Mt,{children:[(0,$.jsx)(Ft,{children:e.kind===`approve`?`Approve ${e.device.name}?`:`Rename ${e.device.name}`}),(0,$.jsx)(It,{children:e.kind===`approve`?`The next ad hoc build registers this iPhone with your Apple account. Each new iPhone uses one of the account's 100 a year, and removing it never gives the slot back.`:`The registry shows this name. The next ad hoc build doesn't rename it at Apple.`})]}),(0,$.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),s!==``&&i.mutate({id:e.device.id,name:s},{onSuccess:t})},children:[(0,$.jsxs)(zt,{children:[e.kind===`approve`?(0,$.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm`,children:[(0,$.jsx)(`dt`,{className:`text-muted-foreground`,children:`Requested by`}),(0,$.jsx)(`dd`,{className:`truncate`,children:e.device.requested_by??`Terminal`}),(0,$.jsx)(`dt`,{className:`text-muted-foreground`,children:`UDID`}),(0,$.jsx)(`dd`,{className:`font-mono text-xs`,translate:`no`,children:qe(e.device.udid)})]}):null,(0,$.jsxs)(Ht,{"data-invalid":i.isError||void 0,children:[(0,$.jsx)(Rt,{htmlFor:`ios-device-dialog-name`,children:`Name`}),(0,$.jsx)(R,{autoComplete:`off`,id:`ios-device-dialog-name`,maxLength:100,onChange:e=>o(e.target.value),value:a}),e.kind===`approve`?(0,$.jsx)(Bt,{children:`The iPhone's ID comes from the person who asked. Approve devices you recognize.`}):null,(0,$.jsx)(Vt,{children:i.isError?`Couldn't ${e.kind===`approve`?`approve`:`rename`} ${e.device.name}. Check your connection and try again.`:null})]})]}),(0,$.jsx)(Nt,{className:`mt-4`,children:(0,$.jsxs)(W,{className:`h-11 sm:h-8`,disabled:s===``||i.isPending,type:`submit`,children:[i.isPending?(0,$.jsx)(ot,{className:`animate-spin`,"data-icon":`inline-start`}):(0,$.jsx)(ze,{"data-icon":`inline-start`}),e.kind===`approve`?`Approve`:`Rename`]})})]})]})})}function sr({device:e,viewer:t,onClose:n}){let r=cn(),i=!t.canApprove,a=e.status===`pending`;return(0,$.jsx)(jt,{onOpenChange:e=>e?null:n(),open:!0,children:(0,$.jsxs)(Tt,{children:[(0,$.jsxs)(At,{children:[(0,$.jsx)(Et,{children:i?`Withdraw ${e.name}?`:a?`Decline ${e.name}?`:`Remove ${e.name}?`}),(0,$.jsx)(wt,{children:a?`It leaves the list. Its owner can request it again.`:`It leaves the registry, but it stays in new ad hoc builds while it's enabled in your Apple account: Xcode's automatic ad hoc profile takes every enabled device on the team. A build that is running may already have registered it.`})]}),a||!t.canApprove?null:(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 text-xs text-muted-foreground [&_code]:break-words [&_code]:whitespace-normal`,children:[(0,$.jsx)(`p`,{children:`To keep it out of new builds, disable it at Apple from a terminal. Its slot isn't returned until the membership year renews.`}),(0,$.jsx)(He,{label:`the command that disables it`,value:`npx hot-updater native-build devices remove --udid ${e.udid}`,wrap:!0})]}),r.isError?(0,$.jsxs)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:[`Couldn't `,i?`withdraw`:a?`decline`:`remove`,` `,e.name,`. Check your connection and try again.`]}):null,(0,$.jsxs)(Ot,{children:[(0,$.jsx)(kt,{disabled:r.isPending,children:`Cancel`}),(0,$.jsxs)(Dt,{disabled:r.isPending,onClick:t=>{t.preventDefault(),r.mutate({udid:e.udid},{onSuccess:n})},variant:`destructive`,children:[r.isPending?(0,$.jsx)(ot,{className:`animate-spin`,"data-icon":`inline-start`}):null,i?`Withdraw`:a?`Decline`:`Remove`]})]})]})})}function cr({view:t,devices:n}){let r=on(),[i,a]=(0,Q.useState)(null),o=i??t?.defaultName??``,[s,c]=(0,Q.useState)(o);(0,Q.useEffect)(()=>{let e=setTimeout(()=>c(o.trim()),400);return()=>clearTimeout(e)},[o]);let l=r?.ios===!0,u=rn({mode:`register`,name:s||`iPhone`},l&&t?.registration===`ready`),d=r===null||window.location.protocol===`https:`,f=r?.requested&&r.udid!==null?n?.find(e=>e.udid===r.udid?.toLowerCase()):void 0,p=r===null?(0,$.jsx)(e,{"aria-label":`Loading`,className:`h-36 w-full`}):f===void 0?t?.registration===`local-console`?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:`iPhones register through your hosted Console: an iPhone can't reach this computer's.`}):t?.registration===`no-secret`?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:`Set BETTER_AUTH_SECRET on this Console to register iPhones.`}):l?d?u.data?.status===`local-console`?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:`iPhones register through your hosted Console: an iPhone can't reach this computer's.`}):u.data?.status===`no-secret`?(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,u.data.secretName,` on this Console to register iPhones.`]}):(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,$.jsxs)(Ht,{children:[(0,$.jsx)(Rt,{htmlFor:`ios-device-register-name`,children:`This iPhone's name`}),(0,$.jsx)(R,{autoComplete:`off`,className:`h-11`,id:`ios-device-register-name`,maxLength:100,onChange:e=>a(e.target.value),value:o})]}),u.data?.status===`issued`&&s===o.trim()?(0,$.jsxs)(`a`,{className:B({className:`h-auto min-h-11 w-full whitespace-normal`}),href:Ue(Qn(),u.data.token),children:[(0,$.jsx)(ut,{"data-icon":`inline-start`}),`Install profile`]}):(0,$.jsx)(e,{"aria-label":`Preparing the profile`,className:`h-11 w-full`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Safari only. Allow the download, then install it in Settings, where iOS calls it not signed. Safari comes back here, and nothing stays installed.`})]}):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:`iPhones need this Console on HTTPS.`}):(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-4 sm:flex-row sm:items-center`,children:[(0,$.jsx)(an,{className:`size-36 shrink-0`,label:`Open this page on an iPhone`,value:`${window.location.origin}${Qn()}${We}`}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:`Open this page on the iPhone, in Safari.`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It installs a profile that reads the iPhone's ID, then lists the iPhone here as requested. Nothing stays installed.`})]})]}):(0,$.jsxs)(`p`,{className:`text-sm`,role:`status`,children:[(0,$.jsx)(`span`,{className:`font-medium`,children:f.name}),` ·`,` `,Jn[f.status],`.`,` `,f.status===`pending`?`A maintainer approves it next, and it joins the next ad hoc build.`:`It joins the next ad hoc build.`]});return(0,$.jsxs)(xt,{className:`shadow-sm`,children:[(0,$.jsx)(vt,{className:`border-b px-4 py-3`,children:(0,$.jsx)(bt,{className:`text-sm`,children:(0,$.jsx)(`h2`,{children:`Register an iPhone`})})}),(0,$.jsx)(yt,{className:`p-4 sm:p-6`,children:p})]})}function lr({search:e,onSearchChange:t}){let n=pe(),r=tn(e.status),i=r.data,a=i?.devices,[o,s]=(0,Q.useState)(null),c=()=>s(null),l=(0,$.jsx)(Qt,{icon:ut,title:e.status===void 0?`No iPhones yet`:`No ${Jn[e.status].toLowerCase()} iPhones`,children:e.status===void 0?(0,$.jsx)(`p`,{children:`Open this page on an iPhone to register it.`}):(0,$.jsx)(W,{className:`h-11 sm:h-7`,onClick:()=>t({}),size:`sm`,variant:`outline`,children:`Show all`})});return(0,$.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,$.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,$.jsx)(J,{className:`-ml-1 size-11 lg:size-7`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(at,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`text-sm font-medium`,children:`Native builds`})]}),(0,$.jsx)(`p`,{className:`basis-full pl-12 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`The iPhones and iPads ad hoc builds install on. Android needs none.`})]}),(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:[(0,$.jsx)(en,{current:`devices`}),(0,$.jsx)(cr,{devices:a,view:i}),i!==void 0&&!i.viewer.approversConfigured?(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 text-xs text-muted-foreground`,children:[(0,$.jsx)(`p`,{children:`Nobody approves in this Console. Approve from a terminal:`}),(0,$.jsx)(He,{label:`the approve command`,value:Ke})]}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(rt,{items:[{label:`All statuses`,value:Xn},...Object.keys(Jn).map(e=>({label:Jn[e],value:e}))],onValueChange:e=>t(e===null||e===Xn?{}:{status:e}),value:e.status??Xn,children:[(0,$.jsx)(Xe,{"aria-label":`Status`,className:`min-w-0 flex-1 text-xs data-[size=default]:h-11 sm:w-44 sm:flex-none sm:data-[size=default]:h-8`,children:(0,$.jsx)(et,{})}),(0,$.jsx)($e,{children:(0,$.jsxs)(tt,{children:[(0,$.jsx)(Ze,{value:Xn,children:`All statuses`}),Object.keys(Jn).map(e=>(0,$.jsx)(Ze,{value:e,children:Jn[e]},e))]})})]}),(0,$.jsx)(W,{"aria-label":`Refresh iOS devices`,className:`ml-auto size-11 sm:size-7`,disabled:r.isFetching,onClick:()=>void r.refetch(),size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(lt,{"aria-hidden":`true`})})]}),r.isError?(0,$.jsxs)(mt,{variant:`destructive`,children:[(0,$.jsx)(ht,{}),(0,$.jsx)(ft,{children:`iOS devices couldn't be loaded`}),(0,$.jsx)(pt,{children:`Check your connection and try again.`}),(0,$.jsx)(gt,{children:(0,$.jsxs)(W,{onClick:()=>void r.refetch(),size:`xs`,variant:`outline`,children:[(0,$.jsx)(lt,{"data-icon":`inline-start`}),`Retry`]})})]}):(0,$.jsx)(Kt,{children:n?(0,$.jsx)(`div`,{"aria-busy":r.isPlaceholderData,"aria-label":`iOS devices`,className:`aria-busy:opacity-60`,role:`list`,children:r.isLoading?(0,$.jsx)(Zt,{label:`Loading iOS devices`}):a?.length===0?(0,$.jsx)(Jt,{children:l}):a?.map(e=>(0,$.jsx)(`div`,{className:`border-b last:border-b-0`,role:`listitem`,children:(0,$.jsx)(ar,{device:e,onOpen:s,viewer:i.viewer})},e.id))}):(0,$.jsx)(Gt,{"aria-busy":r.isPlaceholderData,"aria-label":`iOS devices`,className:`aria-busy:opacity-60`,header:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(X,{children:`Name`}),(0,$.jsx)(X,{children:`UDID`}),(0,$.jsx)(X,{children:`Requested by`}),(0,$.jsx)(X,{children:`Status`}),(0,$.jsx)(X,{children:`Added`}),(0,$.jsx)(X,{children:`Build`}),(0,$.jsx)(X,{className:`text-right`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:r.isLoading?(0,$.jsx)(qt,{columns:Zn+1,label:`Loading iOS devices`}):a?.length===0?(0,$.jsx)(Yt,{columns:Zn+1,children:l}):a?.map(e=>(0,$.jsx)(ir,{device:e,onOpen:s,viewer:i.viewer},e.id))})})]}),o!==null&&o.kind!==`remove`?(0,$.jsx)(or,{onClose:c,target:o},o.device.id):null,o?.kind===`remove`&&i!==void 0?(0,$.jsx)(sr,{device:o.device,onClose:c,viewer:i.viewer},o.device.id):null]})}function ur(){let e=Ut.useSearch(),t=Ut.useNavigate();return(0,$.jsx)(lr,{onSearchChange:e=>void t({search:e,replace:!0}),search:e})}export{ur as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds_.devices-CElovmwq.js","assets/sidebar-yC7KdImc.js","assets/alert-dialog-CLC_h1fL.js","assets/select-CA8r-UUe.js","assets/useCompositeListItem-lAmUsXcc.js","assets/check-CqWNyG93.js","assets/CompositeItem-Dy4xgOMg.js","assets/tabs-CHNnCyvw.js","assets/link-CN3iHC4A.js","assets/relativeTime-CBmDq8wh.js","assets/native-builds-BdzfAFnF.js","assets/copy-CH1__JAW.js","assets/dist-Bw_uSBJn.js","assets/uuidv7-CVJ09bBG.js","assets/-native-builds-search-7blX2yQW.js","assets/loader-circle-GWIgH0fo.js","assets/refresh-cw-BgiOaFX3.js","assets/smartphone-CxP0GGT6.js","assets/trash-2-CYISg7ZF.js","assets/badge-DJMW4YVM.js","assets/IosInstall-B5NspihF.js","assets/useMutation-w3qYaU2L.js","assets/send-BgXZNiEA.js","assets/field-DL4OXTJ7.js","assets/api-DLryz9hA.js","assets/preload-helper-CRQjUQaZ.js","assets/RelativeTime-CY1dKZpv.js","assets/chevron-right-DNbYTBX1.js","assets/table-CwF7yxj4.js","assets/NativeBuildsNav-CjOOlbEu.js","assets/card-C4sBAMU-.js","assets/dialog-tCTZmAo8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,r as t,t as n}from"./preload-helper-CRQjUQaZ.js";import{t as r}from"./-native-builds-search-7blX2yQW.js";var i=e(`/native-builds_/devices`)({component:t(()=>n(()=>import(`./native-builds_.devices-CElovmwq.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,24,25,26,27,28,29,30,31])),`component`),validateSearch:r});export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Vr as e}from"./sidebar-yC7KdImc.js";var t=e(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Vr as e}from"./sidebar-yC7KdImc.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Di as e,Ni as t,Qr as n,Ri as r,Ti as i,Ur as a,Vi as o,ei as s,ji as c,ti as l}from"./sidebar-yC7KdImc.js";import{S as u,_ as d,g as f,i as p,n as m,p as h,r as g,t as _,v,w as y}from"./link-CN3iHC4A.js";var b=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=h:this.parentRoute||c();let r=n?h:t?.path;r&&r!==`/`&&(r=d(r));let i=t?.id||r,a=n?h:f((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:f(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=v(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>t({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},x=class extends b{constructor(e){super(e)}},S=o(r(),1),C=S.use,w=S.useLayoutEffect,T=i();function E(e,t){return e===t}function D(e,t=e=>e,n){let r=n?.compare??E,i=(0,S.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,S.useCallback)(()=>e.get(),[e]);return(0,T.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var O={};function k(e,t){let n=S.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=y(n.current,i):i}}function A(e){let t=p(),n=S.useContext(e.from?m:g),r=e.from??n,i=t.stores.getMatchStore(r),a=k(e,t),o=D(i,e=>e?a(e):O);if(o!==O)return o;(e.shouldThrow??!0)&&c()}function j(e){return A({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function M(e){let{select:t,...n}=e;return A({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function N(e){return A({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function P(e){return A({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function F(e){let t=p();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function I(e){return A({...e,select:t=>e.select?e.select(t.context):t.context})}var L=e(),R=class extends b{constructor(e){super(e),this.useMatch=e=>A({...e,from:this.id}),this.useRouteContext=e=>I({...e,from:this.id}),this.useSearch=e=>P({...e,from:this.id}),this.useParams=e=>N({...e,from:this.id}),this.useLoaderDeps=e=>M({...e,from:this.id}),this.useLoaderData=e=>j({...e,from:this.id}),this.useNavigate=()=>F({from:this.fullPath}),this.Link=S.forwardRef((e,t)=>(0,L.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function z(e){return new R(e)}function B(){return e=>H(e)}var V=class extends x{constructor(e){super(e),this.useMatch=e=>A({...e,from:this.id}),this.useRouteContext=e=>I({...e,from:this.id}),this.useSearch=e=>P({...e,from:this.id}),this.useParams=e=>N({...e,from:this.id}),this.useLoaderDeps=e=>M({...e,from:this.id}),this.useLoaderData=e=>j({...e,from:this.id}),this.useNavigate=()=>F({from:this.fullPath}),this.Link=S.forwardRef((e,t)=>(0,L.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function H(e){return new V(e)}function U(e){return e=>{let t=z(e);return t.isRoot=!1,t}}function W(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(u(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(C)C(a());else throw a();return S.createElement(r,e)};return o.preload=a,o}var G=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:c}=r,u=n.fetchMeta?.fetchMore?.direction,d=o&&u===`forward`,f=i&&u===`forward`,p=o&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:s(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:c&&!d&&!p,isRefetching:a&&!f&&!m}}};function K(e,t){return a(e,G,t)}var q=`modulepreload`,J=function(e){return`/`+e},Y={},X=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=J(t,n),t in Y)return;Y[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:q,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{B as a,D as c,U as i,C as l,K as n,F as o,W as r,k as s,X as t,w as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Vr as e}from"./sidebar-yC7KdImc.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{zi as e}from"./sidebar-yC7KdImc.js";var t=e(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),n=e(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))}));export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ConsoleFeatureUnavailable-cy_snb33.js";var t=e;export{t as notFoundComponent};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-config-B3oq9qR0.js","assets/ConsoleFeatureUnavailable-cy_snb33.js","assets/sidebar-yC7KdImc.js","assets/console-features-api-BO5V64P3.js","assets/arrow-up-right-BFafIOrq.js","assets/NotFoundPage-DDOJarFa.js","assets/link-CN3iHC4A.js","assets/empty-DsbLxQ1w.js","assets/remote-config-D1OkfQKt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,Bn as t,Br as n,Di as r,Er as i,Hr as a,Mr as o,Oi as s,Ri as c,Si as l,Sn as u,Sr as d,Vi as f,Vr as p,Z as m,di as h,ft as g,gr as _,kr as v,p as y,vr as b,wi as x,xr as S,yr as C,zr as w}from"./sidebar-yC7KdImc.js";import{i as T,n as ee,r as te,t as E}from"./preload-helper-CRQjUQaZ.js";import{t as D}from"./useMutation-w3qYaU2L.js";import{r as O}from"./console-features-api-BO5V64P3.js";import{t as k}from"./arrow-right-CXp_K3xK.js";import{i as ne}from"./useCompositeListItem-lAmUsXcc.js";import{a as re,i as A,n as ie,o as j,r as ae,s as oe,t as se}from"./select-CA8r-UUe.js";import{t as ce}from"./clipboard-DZrZK5gR.js";import{t as le}from"./git-branch-ByZMEBxZ.js";import{t as ue}from"./history-wYnPoVmT.js";import{t as de}from"./loader-circle-GWIgH0fo.js";import{n as fe,t as pe}from"./CompositeItem-Dy4xgOMg.js";import{t as M}from"./plus-Cx-yFNd9.js";import{t as me}from"./refresh-cw-BgiOaFX3.js";import{i as he,n as ge,o as _e,r as ve,s as ye,t as be}from"./input-group-B7jx0icS.js";import{t as xe}from"./search-DiOSjaYL.js";import{i as Se,n as N,r as Ce,t as we}from"./switch-BTHWmKQ5.js";import{t as Te}from"./smartphone-CxP0GGT6.js";import{t as Ee}from"./trash-2-CYISg7ZF.js";import{a as P,i as F,n as I,o as L,r as R,t as z}from"./badge-DJMW4YVM.js";import{t as De}from"./undo-2-Bod3vw7x.js";import{n as B}from"./dist-Bw_uSBJn.js";import{a as Oe,n as ke,o as Ae,r as je,t as Me}from"./card-C4sBAMU-.js";import{a as Ne,i as Pe,n as Fe,o as Ie,r as Le,t as Re}from"./empty-DsbLxQ1w.js";import{n as ze,t as Be}from"./relativeTime-CBmDq8wh.js";import{i as Ve,n as He,o as Ue,r as We,t as Ge}from"./tabs-CHNnCyvw.js";import{a as Ke,i as qe,l as Je,n as Ye,o as Xe,r as Ze,s as Qe,t as $e}from"./alert-dialog-CLC_h1fL.js";import{t as et}from"./PlatformIcon-BBvlg6JY.js";import{a as tt,i as nt,n as rt,o as it,r as at,t as V}from"./dialog-tCTZmAo8.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-DL4OXTJ7.js";import{i as ut}from"./api-DLryz9hA.js";var dt=p(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),ft=p(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),pt=p(`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=p(`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=p(`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=f(c()),K=r(),gt=f(ze(),1),_t=f(Be(),1),vt=x({method:`GET`}).middleware([w]).handler(s(`0ccfae64b399b03d820328fa98a38e2caa0b622d3da5a7ca633c5a0e8101e3f6`)),yt=x({method:`GET`}).middleware([w]).handler(s(`3377db68b9d1d971971595469029c0466da0777a177b294d655cd0c039737f1a`)),bt=x({method:`GET`}).middleware([w]).handler(s(`af71e3c55a659ce46093e33b9d70e729359610eec7d576502e8f0e26c785b317`)),xt=x({method:`POST`}).middleware([w]).handler(s(`4182bf9ccbb675700638f30bc6122517ccd90b16a339a6823a0f5f6c808d70a6`)),St=x({method:`POST`}).middleware([w]).handler(s(`98c10bdc514eb4d3fe65af546be44452b492a81092cfe45625778a4c9f731727`)),Ct=x({method:`POST`}).middleware([w]).handler(s(`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]},wt=()=>a({queryKey:q.active,queryFn:()=>vt(),staleTime:6e4}),Tt=({enabled:e})=>ee({queryKey:q.versions,queryFn:({pageParam:e})=>yt({data:e===void 0?{}:{cursor:e}}),initialPageParam:void 0,getNextPageParam:e=>e.next,staleTime:6e4,enabled:e}),Et=e=>a({queryKey:q.version(e??0),queryFn:()=>bt({data:{version:e}}),enabled:e!==null,staleTime:1/0}),Dt=()=>{let e=l();return async()=>{await Promise.all([e.invalidateQueries({queryKey:q.active}),e.invalidateQueries({queryKey:q.versions})])}},Ot=()=>{let e=Dt();return D({mutationFn:e=>xt({data:e}),onSuccess:async t=>{(t.status===`published`||t.status===`conflict`)&&await e()}})},kt=()=>D({mutationFn:e=>St({data:e}),onSuccess:Dt()}),At=e=>a({queryKey:q.preview(e),queryFn:()=>Ct({data:e}),placeholderData:h,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,jt=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Mt=(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)}},Nt=(e,t)=>({...e,parameters:Object.fromEntries(Object.entries(e.parameters).filter(([e])=>e!==t))}),Pt=(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)}]})),Ft=(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:Pt(e,e=>e===t?n.name:e)},It=(e,t)=>({conditions:e.conditions.filter(e=>e.name!==t),parameters:Pt(e,e=>e===t?null:e)}),Lt=(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}},Rt=(e,t)=>Object.entries(e.parameters).filter(([,e])=>X(e.conditionalValues,t)!==void 0).map(([e])=>e),zt=(e,t=3)=>e.length<=t?e.join(`, `):`${e.slice(0,t).join(`, `)} +${e.length-t}`,Bt=e=>Number.isInteger(e)?String(e):e.toFixed(1),Vt=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))},Ht=Vt(`UTC`),Ut=(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()}]},Wt=(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)}]},Gt=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())}`},Kt=e=>{if(e.length===0)return;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toISOString():void 0},qt=(e,t=Ht)=>{switch(e.type){case`platform`:return`Platform is ${zt(e.platforms.map(e=>e===`ios`?`iOS`:`Android`))}`;case`channel`:return`Channel is ${zt(e.channels)}`;case`appVersion`:return`App version ${e.range}`;case`cohort`:return`Cohort is ${zt(e.cohorts)}`;case`percent`:return e.from===0?`${Bt(e.to)}% of installs`:`${Bt(e.from)}–${Bt(e.to)}% of installs`;case`fingerprint`:return`Fingerprint is ${zt(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`,Jt=()=>{let e=crypto.getRandomValues(new Uint8Array(6));return Array.from(e,e=>e.toString(36).padStart(2,`0`)).join(``).slice(0,8)},Yt=(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))}),Xt=(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:Yt(e.parameters,t.parameters),conditions:Yt(n(e),n(t)),reordered:r(e,t).join(`
|
|
3
|
+
`)!==r(t,e).join(`
|
|
4
|
+
`)}},Q=`Not set`,Zt=(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},Qt=(e,t,n=Ht)=>{let r=e=>e.rules.map(e=>qt(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}]},$t=`hot-updater:remote-config-draft`,$=e=>typeof e==`object`&&!!e&&!Array.isArray(e),en=e=>$(e)&&(typeof e.value==`string`||e.useInAppDefault===!0),tn=e=>$(e)&&$(e.parameters)&&Array.isArray(e.conditions)&&Object.values(e.parameters).every(e=>$(e)&&Object.hasOwn(J,String(e.valueType))&&en(e.defaultValue)&&(e.conditionalValues===void 0||$(e.conditionalValues)&&Object.values(e.conditionalValues).every(en)))&&e.conditions.every(e=>$(e)&&typeof e.name==`string`&&Array.isArray(e.rules)&&e.rules.every(e=>$(e)&&Object.hasOwn(Y,String(e.type)))),nn=e=>{try{let t=window.localStorage.getItem($t);if(t===null)return null;let n=JSON.parse(t);return!$(n)||n.baseVersion!==e.version||!tn(n.base)||!tn(n.template)||!jt(n.base,e.template)||jt(n.template,e.template)?null:{baseVersion:e.version,base:n.base,template:n.template}}catch{return null}},rn=e=>{try{return e===null?window.localStorage.removeItem($t):window.localStorage.setItem($t,JSON.stringify(e)),!0}catch{return!1}},an=/^[A-Za-z_][A-Za-z0-9_]{0,255}$/u,on=(e,t)=>e.length===0?`Enter a key.`:an.test(e)?t.includes(e)?`Another parameter uses this key.`:null:`Start with a letter or _, then use letters, digits, and _.`,sn=(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},cn=(e,t,n)=>{let r=e.map(e=>qt(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}},ln=(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},un=e=>[...new Set(e.split(/[\n,]/u).map(e=>e.trim()).filter(e=>e.length>0))],dn=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}},fn=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:Jt(),from:0,to:10};case`fingerprint`:return{type:e,hashes:[]};case`dateTime`:return{type:e,from:Ut()[1].iso}}},pn=G.createContext(void 0);function mn(e=!0){let t=G.useContext(pn);if(t===void 0&&!e)throw Error(v(7));return t}var hn=G.forwardRef(function(e,n){let{className:r,defaultPressed:a=!1,disabled:o=!1,form:s,onPressedChange:c,pressed:l,render:d,type:f,value:p,nativeButton:m=!0,style:h,..._}=e,v=g(p||void 0),y=mn(),b=y?.value??[],x=y?void 0:a,C=(o||y?.disabled)??!1,[w,T]=ne({controlled:y?v!==void 0&&b.indexOf(v)>-1:l,default:x,name:`Toggle`,state:`pressed`}),{getButtonProps:ee,buttonRef:te}=i({disabled:C,native:m}),E={disabled:C,pressed:w},D=[te,n],O=[{"aria-pressed":w,onClick(e){let n=!w,r=u(t,e.nativeEvent);v&&y?.setGroupValue?.(v,n,r),c?.(n,r),!r.isCanceled&&T(n)}},_,ee],k=S(`button`,e,{enabled:!y,state:E,ref:D,props:O});return y?(0,K.jsx)(pe,{tag:`button`,render:d,className:r,style:h,state:E,refs:D,props:O}):k}),gn=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),_n={multiple(e){return e?{[gn.multiple]:``}:null}},vn=G.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:s=`horizontal`,multiple:c=!1,value:l,className:u,render:f,style:p,...m}=e,h=oe(!0),g=G.useMemo(()=>l!==void 0||n!==void 0,[l,n]),_=(h?.disabled??!1)||r,[v,y]=ne({controlled:l,default:l===void 0?n??d:void 0,name:`ToggleGroup`,state:`value`}),b=o((e,t,n)=>{let r;c?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),x={disabled:_,multiple:c,orientation:s},C=G.useMemo(()=>({disabled:_,orientation:s,setGroupValue:b,value:v,isValueInitialized:g}),[_,s,b,v,g]),w={role:`group`},T=S(`div`,e,{enabled:!!h,state:x,ref:t,props:[w,m],stateAttributesMapping:_n});return(0,K.jsx)(pn.Provider,{value:C,children:h?T:(0,K.jsx)(Ue,{render:f,className:u,style:p,state:x,refs:[t],props:[w,m],stateAttributesMapping:_n,loopFocus:i,enableHomeAndEndKeys:!0,orientation:s})})}),yn=C(`group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-7 min-w-7 px-2 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,sm:`h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,lg:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),bn=G.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function xn({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,K.jsx)(vn,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:b(`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)(bn.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function Sn({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=G.useContext(bn);return(0,K.jsx)(hn,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:b(`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`,yn({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}function Cn(){let[e,t]=(0,G.useState)(`UTC`);return(0,G.useEffect)(()=>{t(Intl.DateTimeFormat().resolvedOptions().timeZone)},[]),{timeZone:e,dateTimeText:(0,G.useMemo)(()=>Vt(e),[e])}}var wn=Object.keys(Y);function Tn({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),un(a).join(`
|
|
5
|
+
`)!==t.join(`
|
|
6
|
+
`)&&o(t.join(`, `)));let l=e=>{o(e),n(un(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 En({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(Kt(e.target.value)),type:`datetime-local`,value:Gt(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)(n,{})})})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,K.jsx)(_,{"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 Dn({rule:e,onChange:t}){let n=(0,G.useId)(),r=ut();switch(e.type){case`platform`:return(0,K.jsx)(xn,{"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)(Sn,{className:`min-h-11 px-3 sm:min-h-8`,value:e,children:[(0,K.jsx)(et,{className:`size-3.5`,platform:e}),e===`ios`?`iOS`:`Android`]},e))});case`channel`:{let i=(r.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)(Tn,{id:`${n}-channels`,onChange:n=>t({...e,channels:n}),placeholder:`production, beta`,values:e.channels}),i.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:`}),i.slice(0,8).map(n=>(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-6`,onClick:()=>t({...e,channels:[...e.channels,n]}),size:`xs`,type:`button`,variant:`outline`,children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),n]},n))]}):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)(Tn,{id:`${n}-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:`${n}-from`,children:`From %`}),(0,K.jsx)(m,{className:`min-h-11 tabular-nums sm:min-h-9`,id:`${n}-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:`${n}-to`,children:`To %`}),(0,K.jsx)(m,{className:`min-h-11 tabular-nums sm:min-h-9`,id:`${n}-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:`${n}-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:`${n}-seed`,onChange:n=>t({...e,seed:n.target.value}),value:e.seed}),(0,K.jsx)(_,{"aria-label":`New seed`,className:`size-11 sm:size-9`,onClick:()=>t({...e,seed:Jt()}),size:`icon`,type:`button`,variant:`outline`,children:(0,K.jsx)(me,{})})]})]})]});case`fingerprint`:return(0,K.jsx)(Tn,{id:`${n}-hashes`,multiline:!0,onChange:n=>t({...e,hashes:n}),placeholder:`One fingerprint hash per line`,values:e.hashes});case`dateTime`:{let r=(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)(En,{id:`${n}-from`,label:`From`,onChange:e=>r(`from`,e),presets:Ut(),value:e.from}),(0,K.jsx)(En,{id:`${n}-until`,label:`Until`,onChange:e=>r(`to`,e),presets:Wt(e.from),value:e.to})]})}}}var On={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 kn({open:e,onOpenChange:t,condition:n,takenNames:r,onSave:i}){let a=Ce(e);return(0,K.jsx)(V,{onOpenChange:t,open:e,children:(0,K.jsx)(rt,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto sm:max-w-xl`,children:(0,K.jsx)(An,{condition:n,onCancel:()=>t(!1),onSave:e=>{i(e),t(!1)},takenNames:r},a)})})}function An({condition:e,takenNames:t,onSave:n,onCancel:r}){let i=(0,G.useId)(),{dateTimeText:a,timeZone:o}=Cn(),[s,c]=(0,G.useState)(()=>e===null||e.name===cn(e.rules,t,a)?``:e.name),[l,u]=(0,G.useState)(e===null?[fn(`platform`)]:[...e.rules]),[d,f]=(0,G.useState)(!1),p=cn(l,t,a),h=s.trim().length===0?p:s,g=ln(h,t),v=l.map(dn),y=wn.filter(e=>!l.some(t=>t.type===e)),b=g!==null||l.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(),f(!0),!b&&n({name:h.trim(),rules:l.map(e=>e.type===`appVersion`?{...e,range:e.range.trim()}:e)})},children:[(0,K.jsxs)(tt,{children:[(0,K.jsx)(it,{children:e===null?`Add condition`:`Edit condition`}),(0,K.jsx)(at,{children:`A device matches when it matches every rule.`})]}),(0,K.jsxs)(ot,{children:[(0,K.jsxs)(W,{"data-invalid":d&&g!==null||void 0,children:[(0,K.jsx)(H,{htmlFor:`${i}-name`,children:`Name`}),(0,K.jsx)(m,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:`${i}-name`,maxLength:101,onChange:e=>c(e.target.value),placeholder:p||`Beta testers on iOS`,value:s}),(0,K.jsx)(st,{children:`Optional: without one, it is named after its rules.`}),(0,K.jsx)(U,{children:d?g:null})]}),(0,K.jsxs)(lt,{children:[(0,K.jsx)(ct,{variant:`label`,children:`Rules`}),l.length===0?(0,K.jsx)(U,{children:d?`Add at least one rule.`:null}):null,(0,K.jsx)(`ol`,{className:`flex flex-col gap-3`,children:l.map((e,t)=>(0,K.jsx)(`li`,{className:`rounded-lg border p-3`,children:(0,K.jsxs)(W,{"data-invalid":d&&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)(_,{"aria-label":`Remove the ${Y[e.type].toLowerCase()} rule`,className:`size-11 sm:size-7`,onClick:()=>u(l.filter((e,n)=>n!==t)),size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,K.jsx)(Ee,{})})]}),(0,K.jsx)(Dn,{onChange:e=>u(l.map((n,r)=>r===t?e:n)),rule:e}),(0,K.jsx)(st,{children:e.type===`dateTime`?`In your time zone, ${o}. ${On.dateTime}`:On[e.type]}),(0,K.jsx)(U,{children:d?v[t]:null})]})},e.type))}),y.length>0?(0,K.jsxs)(se,{items:Object.fromEntries(y.map(e=>[e,Y[e]])),onValueChange:e=>{e!==null&&u([...l,fn(e)])},value:null,children:[(0,K.jsxs)(re,{"aria-label":`Add a rule`,className:`min-h-11 w-full sm:min-h-9 sm:w-56`,children:[(0,K.jsx)(M,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(j,{placeholder:`Add a rule`})]}),(0,K.jsx)(ie,{alignItemWithTrigger:!1,children:(0,K.jsx)(ae,{children:y.map(e=>(0,K.jsx)(A,{value:e,children:Y[e]},e))})})]}):null]})]}),(0,K.jsxs)(nt,{children:[(0,K.jsx)(_,{onClick:r,type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsx)(_,{type:`submit`,children:e===null?`Add condition`:`Save condition`})]})]})}function jn({condition:e,dateTimeText:t}){let n=e.rules.map(e=>qt(e,t)).join(` · `);return n===e.name?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})}function Mn({template:e,onSaveCondition:t,onRemoveCondition:n,onMoveCondition:r}){let[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(null),c=N(i),l=N(o),{dateTimeText:u}=Cn(),{conditions:d}=e,f=c?.condition?.name??null,p=t=>{let r=Rt(e,t);r.length===0?n(t):s({name:t,users:r})};return(0,K.jsxs)(Me,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Oe,{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)(Ae,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Conditions`})}),(0,K.jsx)(je,{className:`text-xs`,children:`Listed by priority: when several match a device, the first wins.`})]}),(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-7`,onClick:()=>a({condition:null}),children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`Add condition`]})]}),(0,K.jsx)(ke,{className:`p-0`,children:d.length===0?(0,K.jsxs)(Re,{className:`py-10`,children:[(0,K.jsxs)(Pe,{children:[(0,K.jsx)(Ne,{variant:`icon`,children:(0,K.jsx)(le,{})}),(0,K.jsx)(Ie,{children:`No conditions`}),(0,K.jsx)(Le,{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)(Fe,{children:(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-7`,onClick:()=>a({condition:null}),children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`Add condition`]})})]}):(0,K.jsx)(`ol`,{"aria-label":`Conditions`,className:`divide-y`,children:d.map((t,n)=>{let i=Rt(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 ${n+1}`,className:`flex size-6 items-center justify-center rounded-md bg-muted text-xs font-medium tabular-nums`,children:n+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)(jn,{condition:t,dateTimeText:u}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:i.length===0?`No parameter uses it yet`:`Sets ${i.length===1?`1 parameter`:`${i.length} parameters`}: ${i.slice(0,3).join(`, `)}${i.length>3?`…`:``}`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-1 md:justify-end`,children:[(0,K.jsx)(_,{"aria-label":`Move ${t.name} up`,className:`size-11 md:size-7`,disabled:n===0,onClick:()=>r(n,-1),size:`icon`,variant:`ghost`,children:(0,K.jsx)(ft,{})}),(0,K.jsx)(_,{"aria-label":`Move ${t.name} down`,className:`size-11 md:size-7`,disabled:n===d.length-1,onClick:()=>r(n,1),size:`icon`,variant:`ghost`,children:(0,K.jsx)(dt,{})}),(0,K.jsxs)(_,{"aria-label":`Edit ${t.name}`,className:`min-h-11 md:min-h-7`,onClick:()=>a({condition:t}),size:`sm`,variant:`outline`,children:[(0,K.jsx)(fe,{"data-icon":`inline-start`}),`Edit`]}),(0,K.jsx)(_,{"aria-label":`Delete ${t.name}`,className:`size-11 md:size-7`,onClick:()=>p(t.name),size:`icon`,variant:`ghost`,children:(0,K.jsx)(Ee,{})})]})]},t.name)})})}),(0,K.jsx)(kn,{condition:c?.condition??null,onOpenChange:e=>{e||a(null)},onSave:e=>t(f,e),open:i!==null,takenNames:d.map(({name:e})=>e).filter(e=>e!==f)}),(0,K.jsx)($e,{onOpenChange:e=>{e||s(null)},open:o!==null,children:(0,K.jsxs)(qe,{children:[(0,K.jsxs)(Qe,{children:[(0,K.jsxs)(Je,{children:[`Delete `,l?.name,`?`]}),(0,K.jsxs)(Ke,{children:[l?.users.length===1?`1 parameter has a value for it`:`${l?.users.length} parameters have a value for it`,` `,`(`,l?.users.join(`, `),`). Those values are removed too, so matching devices get the default value after you publish.`]})]}),(0,K.jsxs)(Xe,{children:[(0,K.jsx)(Ze,{children:`Cancel`}),(0,K.jsx)(Ye,{onClick:e=>{e.preventDefault(),o!==null&&n(o.name),s(null)},variant:`destructive`,children:`Delete condition`})]})]})})]})}var Nn=e=>e===`BOOLEAN`?`false`:e===`NUMBER`?`0`:e===`JSON`?`{}`:``,Pn=(e,t)=>`value`in t?sn(e,t.value):null;function Fn({id:e,label:t,valueType:n,value:r,onChange:i,showErrors:a}){let o=!(`value`in r),s=`value`in r?r.value:``,c=a?Pn(n,r):null,l=e=>i({value:e});return(0,K.jsxs)(W,{"data-invalid":c!==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)(we,{checked:o,id:`${e}-in-app-default`,onCheckedChange:e=>i(e?{useInAppDefault:!0}:{value:Nn(n)})}),(0,K.jsx)(`label`,{htmlFor:`${e}-in-app-default`,children:`Use in-app default`})]})]}),o?(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 }`,`)`]}),`.`]}):n===`BOOLEAN`?(0,K.jsxs)(xn,{"aria-labelledby":`${e}-label`,id:e,onValueChange:e=>{let[t]=e;(t===`true`||t===`false`)&&l(t)},value:[s],variant:`outline`,children:[(0,K.jsx)(Sn,{className:`min-h-11 px-4 sm:min-h-8`,value:`true`,children:`true`}),(0,K.jsx)(Sn,{className:`min-h-11 px-4 sm:min-h-8`,value:`false`,children:`false`})]}):n===`NUMBER`?(0,K.jsx)(m,{"aria-invalid":c!==null||void 0,autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,id:e,inputMode:`decimal`,onChange:e=>l(e.target.value),value:s}):n===`JSON`?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(_e,{"aria-invalid":c!==null||void 0,className:`min-h-24 font-mono text-xs`,id:e,onChange:e=>l(e.target.value),spellCheck:!1,value:s}),(0,K.jsxs)(_,{className:`self-start`,disabled:sn(`JSON`,s)!==null,onClick:()=>l(JSON.stringify(JSON.parse(s),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":c!==null||void 0,className:`min-h-11 text-sm sm:min-h-9`,id:e,onChange:e=>l(e.target.value),rows:2,value:s}),(0,K.jsx)(U,{children:c})]})}var In=Object.keys(J),Ln={STRING:`getString`,NUMBER:`getNumber`,BOOLEAN:`getBoolean`,JSON:`getString`},Rn=(e,t)=>`value`in e&&Pn(t,e)!==null?{value:Nn(t)}:e;function zn({open:e,onOpenChange:t,parameterKey:n,parameter:r,takenKeys:i,conditions:a,onSave:o,onAddCondition:s}){let c=Ce(e);return(0,K.jsx)(V,{onOpenChange:t,open:e,children:(0,K.jsx)(rt,{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)(Bn,{conditions:a,onAddCondition:s,onCancel:()=>t(!1),onSave:(e,n)=>{o(e,n),t(!1)},parameter:r,parameterKey:n,takenKeys:i},c)})})}function Bn({parameterKey:e,parameter:t,takenKeys:r,conditions:i,onSave:a,onCancel:o,onAddCondition:s}){let c=(0,G.useId)(),{dateTimeText:l}=Cn(),[u,d]=(0,G.useState)(e??``),[f,p]=(0,G.useState)(t?.valueType??`STRING`),[h,g]=(0,G.useState)(t?.description??``),v=h.trim().length>256,[y,b]=(0,G.useState)(t?.defaultValue??{value:``}),[x,S]=(0,G.useState)(t?.conditionalValues??{}),[C,w]=(0,G.useState)({}),[T,ee]=(0,G.useState)(!1),[te,E]=(0,G.useState)(!1),D=on(u.trim(),r),O=i.filter(({name:e})=>X(x,e)!==void 0),k=i.filter(({name:e})=>X(x,e)===void 0),ne=D!==null||v||[y,...Object.values(x)].some(e=>Pn(f,e)!==null),oe=e=>{p(e),b(Rn(y,e)),S(Object.fromEntries(Object.entries(x).map(([t,n])=>[t,Rn(n,e)])))},ce=e=>{let t=X(C,e);S({...x,[e]:t===void 0?{value:Nn(f)}:Rn(t,f)})},le=e=>{let{[e]:t,...n}=x;t!==void 0&&w({...C,[e]:t}),S(n)};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:e=>{if(e.preventDefault(),ee(!0),ne)return;let t=Object.fromEntries(O.map(({name:e})=>[e,X(x,e)]));a(u.trim(),{valueType:f,defaultValue:y,...Object.keys(t).length===0?{}:{conditionalValues:t},...h.trim().length===0?{}:{description:h.trim()}})},children:[(0,K.jsxs)(tt,{children:[(0,K.jsx)(it,{children:e===null?`Add parameter`:`Edit parameter`}),(0,K.jsxs)(at,{children:[`The app reads it with`,` `,(0,K.jsxs)(`code`,{className:`font-mono`,children:[`hotUpdater.remoteConfig.`,Ln[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":T&&D!==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:T?D:null})]}),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${c}-type`,children:`Type`}),(0,K.jsxs)(se,{items:J,onValueChange:e=>{e!==null&&oe(e)},value:f,children:[(0,K.jsx)(re,{className:`min-h-11 w-full sm:min-h-9`,id:`${c}-type`,children:(0,K.jsx)(j,{})}),(0,K.jsx)(ie,{children:(0,K.jsx)(ae,{children:In.map(e=>(0,K.jsx)(A,{value:e,children:J[e]},e))})})]})]})]}),(0,K.jsxs)(W,{"data-invalid":v||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:v?`Use 256 characters or fewer.`:null})]}),(0,K.jsx)(Fn,{id:`${c}-default`,label:`Default value`,onChange:b,showErrors:T,value:y,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.`}),O.length>0?(0,K.jsx)(`ul`,{className:`flex flex-col gap-3`,children:O.map(e=>(0,K.jsxs)(`li`,{className:`rounded-lg border p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-start justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.name}),(0,K.jsx)(jn,{condition:e,dateTimeText:l})]}),(0,K.jsxs)(_,{"aria-label":`Remove the value for ${e.name}`,className:`min-h-11 shrink-0 text-muted-foreground sm:min-h-7`,onClick:()=>le(e.name),size:`sm`,type:`button`,variant:`ghost`,children:[(0,K.jsx)(n,{"data-icon":`inline-start`}),`Remove value`]})]}),(0,K.jsx)(Fn,{id:`${c}-${e.name}`,label:(0,K.jsxs)(K.Fragment,{children:[`Value`,(0,K.jsxs)(`span`,{className:`sr-only`,children:[` for `,e.name]})]}),onChange:t=>S({...x,[e.name]:t}),showErrors:T,value:X(x,e.name),valueType:f})]},e.name))}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[k.length>0?(0,K.jsxs)(se,{items:Object.fromEntries(k.map(({name:e})=>[e,e])),onValueChange:e=>{e!==null&&ce(e)},value:null,children:[(0,K.jsxs)(re,{"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)(M,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(j,{placeholder:`Add a value for a condition`})]}),(0,K.jsx)(ie,{alignItemWithTrigger:!1,children:(0,K.jsx)(ae,{children:k.map(({name:e})=>(0,K.jsx)(A,{value:e,children:e},e))})})]}):null,(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-9`,onClick:()=>E(!0),type:`button`,variant:`outline`,children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`New condition`]})]})]})]}),(0,K.jsxs)(nt,{children:[(0,K.jsx)(_,{onClick:o,type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsx)(_,{type:`submit`,children:e===null?`Add parameter`:`Save parameter`})]})]}),(0,K.jsx)(kn,{condition:null,onOpenChange:E,onSave:e=>{s(e),ce(e.name)},open:te,takenNames:i.map(({name:e})=>e)})]})}function Vn({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 Hn({parameterKey:e,parameter:t,conditions:n,onEdit:r,onRemove:i}){let a=n.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:[a.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)(Vn,{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)(Vn,{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)(_,{"aria-label":`Edit ${e}`,className:`min-h-11 md:min-h-7`,onClick:r,size:`sm`,variant:`outline`,children:[(0,K.jsx)(fe,{"data-icon":`inline-start`}),`Edit`]}),(0,K.jsx)(_,{"aria-label":`Delete ${e}`,className:`size-11 md:size-7`,onClick:i,size:`icon`,variant:`ghost`,children:(0,K.jsx)(Ee,{})})]})]})}function Un({template:e,onSaveParameter:t,onRemoveParameter:n,onAddCondition:r}){let[i,a]=(0,G.useState)(null),o=N(i),[s,c]=(0,G.useState)(``),l=Object.keys(e.parameters),u=l.filter(e=>e.toLowerCase().includes(s.trim().toLowerCase())),d=o?.key??null;return(0,K.jsxs)(Me,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Oe,{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)(Ae,{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:[l.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=>c(e.target.value),placeholder:`Filter by key`,value:s})]}):null,(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-7`,onClick:()=>a({key:null,parameter:null}),children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`Add parameter`]})]})]}),(0,K.jsx)(ke,{className:`p-0`,children:l.length===0?(0,K.jsxs)(Re,{className:`py-10`,children:[(0,K.jsxs)(Pe,{children:[(0,K.jsx)(Ne,{variant:`icon`,children:(0,K.jsx)(Se,{})}),(0,K.jsx)(Ie,{children:`No parameters`}),(0,K.jsx)(Le,{children:`Add a parameter, give it a default, then publish to change the app without a new build.`})]}),(0,K.jsx)(Fe,{children:(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-7`,onClick:()=>a({key:null,parameter:null}),children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`Add parameter`]})})]}):u.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)(_,{onClick:()=>c(``),size:`sm`,variant:`outline`,children:`Clear filter`})]}):(0,K.jsx)(`ul`,{"aria-label":`Parameters`,className:`divide-y`,children:u.map(t=>(0,K.jsx)(Hn,{conditions:e.conditions,onEdit:()=>a({key:t,parameter:e.parameters[t]??null}),onRemove:()=>n(t),parameter:e.parameters[t],parameterKey:t},t))})}),(0,K.jsx)(zn,{conditions:e.conditions,onAddCondition:r,onOpenChange:e=>{e||a(null)},onSave:(e,n)=>t(d,e,n),open:i!==null,parameter:o?.parameter??null,parameterKey:d,takenKeys:l.filter(e=>e!==d)})]})}var Wn={platform:`ios`,channel:`production`,appVersion:`1.0.0`,cohort:`1`,fingerprintHash:``,at:``},Gn=(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 Kn({template:t,isDraft:n}){let r=(0,G.useId)(),[i,a]=(0,G.useState)(Wn),{at:o,...s}=Gn(i),c=Kt(o),l=At({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)(Me,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Oe,{className:`border-b px-4 py-3 sm:px-6`,children:[(0,K.jsx)(Ae,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Preview a device`})}),(0,K.jsx)(je,{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)(se,{items:{ios:`iOS`,android:`Android`},onValueChange:e=>{(e===`ios`||e===`android`)&&d(`platform`,e)},value:i.platform,children:[(0,K.jsx)(re,{className:`min-h-11 w-full sm:min-h-9`,id:`${r}-platform`,children:(0,K.jsxs)(j,{children:[(0,K.jsx)(et,{className:`size-3.5`,platform:i.platform}),i.platform===`ios`?`iOS`:`Android`]})}),(0,K.jsx)(ie,{children:(0,K.jsxs)(ae,{children:[(0,K.jsxs)(A,{value:`ios`,children:[(0,K.jsx)(et,{className:`size-3.5`,platform:`ios`}),`iOS`]}),(0,K.jsxs)(A,{value:`android`,children:[(0,K.jsx)(et,{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)(Re,{className:`border py-8`,children:(0,K.jsxs)(Pe,{children:[(0,K.jsx)(Ne,{variant:`icon`,children:(0,K.jsx)(Te,{})}),(0,K.jsx)(Ie,{children:`Nothing to preview`}),(0,K.jsx)(Le,{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)(L,{}),(0,K.jsx)(P,{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)(L,{}),(0,K.jsx)(P,{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 qn({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)(k,{"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 Jn({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)(qn,{fields:n(e),name:e},e))})})]},e))})]})}function Yn({open:e,onOpenChange:t,base:n,baseVersion:r,draft:i,onPublished:a,onLoadLatest:o,onPublishOver:s}){let c=(0,G.useId)(),l=Ot(),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(null),{dateTimeText:h}=Cn(),g=Xt(n,i),v=e=>{let t=Object.hasOwn(n.parameters,e)?n.parameters[e]:null,r=Object.hasOwn(i.parameters,e)?i.parameters[e]:null;return r===null?[]:Zt(t,r)},y=e=>{let t=n.conditions.find(t=>t.name===e)??null,r=i.conditions.find(t=>t.name===e)??null;return r===null?[]:Qt(t,r,h)},b=u.trim().length>256,x=e=>{l.isPending||(t(e),e||(p(null),l.reset()))};return(0,K.jsx)(V,{onOpenChange:x,open:e,children:(0,K.jsx)(rt,{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 l.mutateAsync({template:i,baseVersion:r,...u.trim().length===0?{}:{description:u.trim()}});p(e),e.status===`published`&&(B.success(`Published version ${e.version.version}`),d(``),p(null),t(!1),a())}catch(e){B.error(e instanceof Error?e.message:`Unable to publish`)}},children:[(0,K.jsxs)(tt,{children:[(0,K.jsx)(it,{children:`Publish changes`}),(0,K.jsxs)(at,{children:[`This becomes version `,r+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)(Jn,{changes:g.parameters,describe:v,label:`Parameters`}),(0,K.jsx)(Jn,{changes:g.conditions,describe:y,label:`Conditions`}),g.reordered?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Condition priority changed.`}):null]}),f?.status===`invalid`?(0,K.jsxs)(I,{variant:`destructive`,children:[(0,K.jsx)(L,{}),(0,K.jsx)(P,{children:`The server refused the template`}),(0,K.jsx)(F,{children:(0,K.jsx)(`ul`,{className:`list-disc pl-4`,children:f.issues.slice(0,6).map(e=>(0,K.jsxs)(`li`,{children:[e.path===``?``:`${e.path}: `,e.message]},`${e.path}:${e.message}`))})})]}):null,f?.status===`conflict`?(0,K.jsxs)(I,{children:[(0,K.jsx)(L,{}),(0,K.jsxs)(P,{children:[`Version `,f.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)(_,{onClick:()=>{x(!1),o()},size:`sm`,type:`button`,variant:`outline`,children:[`Load version `,f.currentVersion]}),(0,K.jsx)(_,{onClick:()=>{s(f.currentVersion),p(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:`${c}-description`,children:`Description`}),(0,K.jsx)(m,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:`${c}-description`,onChange:e=>d(e.target.value),placeholder:`What changed and why`,value:u}),(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)(nt,{children:[(0,K.jsx)(_,{disabled:l.isPending,onClick:()=>x(!1),type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsxs)(_,{disabled:l.isPending||f?.status===`conflict`,type:`submit`,children:[l.isPending?(0,K.jsx)(de,{className:`animate-spin`,"data-icon":`inline-start`}):(0,K.jsx)(ht,{"data-icon":`inline-start`}),`Publish version `,r+1]})]})]})})})}function Xn({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,gt.default)(e).format(`YYYY/MM/DD HH:mm`)})}function Zn({open:t,version:n,onOpenChange:r}){let i=Et(n),a=i.data===null||i.data===void 0?null:JSON.stringify(i.data.template,null,2);return(0,K.jsx)(V,{onOpenChange:r,open:t,children:(0,K.jsxs)(rt,{className:`max-h-[calc(100svh-2rem)] grid-rows-[auto_minmax(0,1fr)] sm:max-w-2xl`,children:[(0,K.jsxs)(tt,{children:[(0,K.jsxs)(it,{children:[`Version `,n]}),(0,K.jsx)(at,{children:`The template as it was published, in the JSON the admin API takes.`})]}),i.isLoading?(0,K.jsx)(e,{className:`h-48 w-full`}):i.isError?(0,K.jsxs)(I,{variant:`destructive`,children:[(0,K.jsx)(L,{}),(0,K.jsx)(P,{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)(_,{onClick:()=>void i.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(me,{"data-icon":`inline-start`}),`Retry`]})})]}):a===null?(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Version `,n,` 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:a}),(0,K.jsxs)(_,{className:`self-end`,onClick:()=>{navigator.clipboard.writeText(a).then(()=>B.success(`Template JSON copied`),()=>B.error(`Unable to copy the template`))},size:`sm`,variant:`outline`,children:[(0,K.jsx)(ce,{"data-icon":`inline-start`}),`Copy JSON`]})]})]})})}function Qn({activeVersion:t,hasDraft:n,onRolledBack:r,onStartEditing:i}){let a=Tt({enabled:!0}),o=kt(),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),d=N(s),f=N(l),p=a.data?.pages.flatMap(e=>e.versions)??[],m=async e=>{if(e.preventDefault(),l!==null)try{let e=await o.mutateAsync({version:l.source,baseVersion:l.next-1});e.status===`published`?(B.success(`Version ${e.version.version} restores version ${l.source}`),r()):e.status===`conflict`?B.error(`Version ${e.currentVersion} was published meanwhile. Review it, then roll back again.`):B.error(`That version no longer exists.`),u(null)}catch(e){B.error(e instanceof Error?e.message:`Unable to roll back`)}};return(0,K.jsxs)(Me,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsx)(Oe,{className:`border-b px-4 py-3 sm:px-6`,children:(0,K.jsx)(Ae,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Versions`})})}),(0,K.jsx)(ke,{className:`p-0`,children:a.isError?(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsxs)(I,{variant:`destructive`,children:[(0,K.jsx)(L,{}),(0,K.jsx)(P,{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)(_,{onClick:()=>void a.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(me,{"data-icon":`inline-start`}),`Retry`]})})]})}):a.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))]}):p.length===0?(0,K.jsxs)(Re,{className:`py-10`,children:[(0,K.jsxs)(Pe,{children:[(0,K.jsx)(Ne,{variant:`icon`,children:(0,K.jsx)(ue,{})}),(0,K.jsx)(Ie,{children:`No versions yet`}),(0,K.jsx)(Le,{children:`Your first publish becomes version 1. Every publish after it is kept here, ready to roll back to.`})]}),(0,K.jsx)(Fe,{children:(0,K.jsx)(_,{className:`min-h-11 sm:min-h-7`,onClick:i,children:`Add a parameter`})})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`ol`,{"aria-label":`Versions`,className:`divide-y`,children:p.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)(Xn,{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)(_,{"aria-label":`View version ${e.version}`,className:`min-h-11 md:min-h-7`,onClick:()=>c(e.version),size:`sm`,variant:`ghost`,children:[(0,K.jsx)(mt,{"data-icon":`inline-start`}),`View`]}),(0,K.jsxs)(_,{"aria-label":`Roll back to version ${e.version}`,className:`min-h-11 md:min-h-7`,disabled:e.version===t,onClick:()=>u({source:e.version,next:t+1}),size:`sm`,variant:`outline`,children:[(0,K.jsx)(ye,{"data-icon":`inline-start`}),`Roll back`]})]})]},e.version))}),a.hasNextPage?(0,K.jsx)(`div`,{className:`border-t px-4 py-3 sm:px-6`,children:(0,K.jsxs)(_,{className:`min-h-11 w-full sm:min-h-7 sm:w-auto`,disabled:a.isFetchingNextPage,onClick:()=>void a.fetchNextPage(),variant:`outline`,children:[a.isFetchingNextPage?(0,K.jsx)(de,{className:`animate-spin`,"data-icon":`inline-start`}):null,`Load older versions`]})}):null]})}),(0,K.jsx)(Zn,{onOpenChange:e=>{e||c(null)},open:s!==null,version:d}),(0,K.jsx)($e,{onOpenChange:e=>{!o.isPending&&!e&&u(null)},open:l!==null,children:(0,K.jsxs)(qe,{children:[(0,K.jsxs)(Qe,{children:[(0,K.jsxs)(Je,{children:[`Roll back to version `,f?.source,`?`]}),(0,K.jsxs)(Ke,{children:[`Version `,f?.next,` will publish a copy of version`,` `,f?.source,`, and devices get its values on their next fetch.`,n?` Your unpublished changes are discarded.`:``]})]}),(0,K.jsxs)(Xe,{children:[(0,K.jsx)(Ze,{disabled:o.isPending,children:`Cancel`}),(0,K.jsxs)(Ye,{disabled:o.isPending,onClick:e=>void m(e),children:[o.isPending?(0,K.jsx)(de,{className:`animate-spin`,"data-icon":`inline-start`}):(0,K.jsx)(ye,{"data-icon":`inline-start`}),`Roll back`]})]})]})})]})}gt.default.extend(_t.default);var $n=[`parameters`,`conditions`,`preview`,`versions`];function er({tab:t,onTabChange:n}){let r=wt(),[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(!1),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(!1),f=r.data,p=i?.template??f?.template,m=i!==null&&f!==void 0&&!jt(i.template,f.template),h=m&&f!==void 0&&i.baseVersion!==f.version;(0,G.useEffect)(()=>{if(o||f===void 0)return;s(!0);let e=nn(f);e!==null&&(a(e),l(!0))},[f,o]),(0,G.useEffect)(()=>{if(i===null||!m||rn(i))return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[i,m]);let g=()=>{a(null),l(!1),rn(null)},v=e=>{f===void 0||p===void 0||(l(!1),a({baseVersion:i?.baseVersion??f.version,base:i?.base??f.template,template:e(p)}))},b={parameters:p===void 0?null:Object.keys(p.parameters).length,conditions:p?.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)(y,{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`})]}),f===void 0?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f.version===0?`Nothing published yet`:(0,K.jsxs)(K.Fragment,{children:[`Version `,f.version,f.updatedAtMs===null?null:(0,K.jsxs)(K.Fragment,{children:[` · published `,(0,K.jsx)(`time`,{dateTime:new Date(f.updatedAtMs).toISOString(),title:(0,gt.default)(f.updatedAtMs).format(`YYYY/MM/DD HH:mm:ss`),children:(0,gt.default)(f.updatedAtMs).fromNow()})]})]})}),m?(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)(_,{className:`min-h-11 lg:min-h-7`,onClick:g,variant:`ghost`,children:[(0,K.jsx)(De,{"data-icon":`inline-start`}),`Discard`]}),(0,K.jsxs)(_,{className:`min-h-11 lg:min-h-7`,onClick:()=>d(!0),children:[(0,K.jsx)(ht,{"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:[r.isError?(0,K.jsxs)(I,{variant:`destructive`,children:[(0,K.jsx)(L,{}),(0,K.jsx)(P,{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)(_,{onClick:()=>void r.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(me,{"data-icon":`inline-start`}),`Retry`]})})]}):null,c&&m&&i!==null?(0,K.jsxs)(I,{children:[(0,K.jsx)(ue,{}),(0,K.jsx)(P,{children:`Your unpublished changes are back`}),(0,K.jsxs)(F,{children:[`This browser kept them from your last visit, on version`,` `,i.baseVersion,`.`]}),(0,K.jsx)(R,{children:(0,K.jsx)(_,{onClick:g,size:`xs`,variant:`outline`,children:`Discard them`})})]}):null,h&&i!==null&&f!==void 0?(0,K.jsxs)(I,{children:[(0,K.jsx)(L,{}),(0,K.jsxs)(P,{children:[`Version `,f.version,` was published while you edited`]}),(0,K.jsxs)(F,{children:[`Your draft started from version `,i.baseVersion,`. Discard it to review version `,f.version,`, or publish yours after it.`]}),(0,K.jsx)(R,{children:(0,K.jsxs)(_,{onClick:g,size:`xs`,variant:`outline`,children:[`Load version `,f.version]})})]}):null,(0,K.jsxs)(Ge,{onValueChange:e=>n(e),value:t,children:[(0,K.jsx)(We,{"aria-label":`Remote Config views`,className:`max-w-full group-data-horizontal/tabs:h-auto`,children:[[`parameters`,`Parameters`,b.parameters],[`conditions`,`Conditions`,b.conditions],[`preview`,`Preview`,null],[`versions`,`Versions`,null]].map(([e,t,n])=>(0,K.jsxs)(Ve,{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))}),p===void 0||f===void 0?r.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)(He,{value:`parameters`,children:(0,K.jsx)(Un,{onAddCondition:e=>v(t=>Ft(t,null,e)),onRemoveParameter:e=>v(t=>Nt(t,e)),onSaveParameter:(e,t,n)=>v(r=>Mt(r,e,t,n)),template:p})}),(0,K.jsx)(He,{value:`conditions`,children:(0,K.jsx)(Mn,{onMoveCondition:(e,t)=>v(n=>Lt(n,e,t)),onRemoveCondition:e=>v(t=>It(t,e)),onSaveCondition:(e,t)=>v(n=>Ft(n,e,t)),template:p})}),(0,K.jsx)(He,{value:`preview`,children:(0,K.jsx)(Kn,{isDraft:m,template:p})}),(0,K.jsx)(He,{value:`versions`,children:(0,K.jsx)(Qn,{activeVersion:f.version,hasDraft:m,onRolledBack:g,onStartEditing:()=>n(`parameters`)})})]})]})]})}),f!==void 0&&i!==null?(0,K.jsx)(Yn,{base:f.template,baseVersion:i.baseVersion,draft:i.template,onLoadLatest:g,onOpenChange:d,onPublishOver:e=>a({...i,baseVersion:e,base:f.template}),onPublished:g,open:u}):null]})}var tr=T(`/remote-config`)({beforeLoad:({context:e})=>O(e.queryClient,`remoteConfig`),notFoundComponent:te(()=>E(()=>import(`./remote-config-B3oq9qR0.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`notFoundComponent`),component:te(()=>E(()=>import(`./remote-config-D1OkfQKt.js`),__vite__mapDeps([8,2])),`component`),validateSearch:e=>$n.includes(e.tab)&&e.tab!==`parameters`?{tab:e.tab}:{}});export{er as n,tr as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Di as e}from"./sidebar-yC7KdImc.js";import{n as t,t as n}from"./remote-config-CGbqsPh_.js";var r=e();function i(){let{tab:e=`parameters`}=n.useSearch(),i=n.useNavigate();return(0,r.jsx)(t,{onTabChange:e=>void i({search:e===`parameters`?{}:{tab:e},replace:!0}),tab:e})}export{i as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Vr as e}from"./sidebar-yC7KdImc.js";var t=e(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-
|
|
2
|
-
import{$ as e,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-CVbPjRKo.js","assets/sidebar-yC7KdImc.js","assets/alert-dialog-CLC_h1fL.js","assets/select-CA8r-UUe.js","assets/useCompositeListItem-lAmUsXcc.js","assets/check-CqWNyG93.js","assets/switch-BTHWmKQ5.js","assets/valueToPercent-Db73Kirz.js","assets/link-CN3iHC4A.js","assets/arrow-right-CXp_K3xK.js","assets/arrow-up-right-BFafIOrq.js","assets/native-builds-BdzfAFnF.js","assets/copy-CH1__JAW.js","assets/dist-Bw_uSBJn.js","assets/uuidv7-CVJ09bBG.js","assets/chevron-right-DNbYTBX1.js","assets/circle-off-BCkZpskJ.js","assets/HashValueDisplay-DMweha_0.js","assets/RolloutPercentageBadge-BHgHkBGB.js","assets/relativeTime-CBmDq8wh.js","assets/badge-DJMW4YVM.js","assets/TargetDisplay-DB8D019f.js","assets/key-round-B-P_hhUB.js","assets/package-CXSDZsME.js","assets/list-fFsS8Wxe.js","assets/loader-circle-GWIgH0fo.js","assets/plus-Cx-yFNd9.js","assets/input-group-B7jx0icS.js","assets/trash-2-CYISg7ZF.js","assets/BundleIdDisplay-B0gAH01c.js","assets/RelativeTime-CY1dKZpv.js","assets/table-CwF7yxj4.js","assets/RowReason-BMx_vclu.js","assets/insights-search-TfRz5kGG.js","assets/insights-api-B6Gj74n5.js","assets/preload-helper-CRQjUQaZ.js","assets/PlatformIcon-BBvlg6JY.js","assets/card-C4sBAMU-.js","assets/dialog-tCTZmAo8.js","assets/field-DL4OXTJ7.js","assets/api-DLryz9hA.js","assets/useMutation-w3qYaU2L.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,Di as t,Hr as n,Oi as r,Vr as i,_r as a,et as o,vr as s,wi as c,zr as l}from"./sidebar-yC7KdImc.js";import{t as u}from"./link-CN3iHC4A.js";import{i as d,r as f,t as p}from"./preload-helper-CRQjUQaZ.js";import{a as m,i as h,o as g}from"./console-features-api-BO5V64P3.js";import{_,m as v,s as ee,x as y}from"./insights-api-B6Gj74n5.js";import{t as b}from"./key-round-B-P_hhUB.js";import{i as x}from"./switch-BTHWmKQ5.js";import{n as S,o as C}from"./insights-search-TfRz5kGG.js";import{a as w,i as T,n as E,o as D,t as O}from"./card-C4sBAMU-.js";var k=i(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),A=t(),j={apiKeys:{navigation:{icon:(0,A.jsx)(b,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(u,{to:`/api-keys`,onClick:e})}}},M=c({method:`GET`}).middleware([l]).handler(r(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return n({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(C,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:t,loading:n=!1,input:r,variant:i=`inline`}){if(!t)return n?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:i===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let a=r?.builtIn===!0,o=a?0:I(t),c=(0,A.jsx)(`dl`,{className:s(i===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:e,field:n,color:r})=>(0,A.jsxs)(`div`,{className:s(`flex`,i===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsxs)(`dd`,{className:s(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,i===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[n]>0&&!(n===`downloads`&&a)?r:`text-muted-foreground`),children:[n===`downloads`&&a?(0,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):t[n].toLocaleString(),n===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(t),`)`]}):null]})]},n))});return(0,A.jsxs)(`div`,{className:s(`flex`,i===`card`?`flex-col gap-2`:`items-center gap-1`),children:[r?(0,A.jsx)(u,{className:`relative min-w-0 rounded-sm after:absolute after:inset-x-0 after:-inset-y-3 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,to:`/insights`,search:{platform:r.platform,channel:r.channel,releaseId:r.releaseId,bundleWindow:S(r.releaseId)},children:c}):c,i===`card`&&o>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[o.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,i===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let n=ee({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),r=n.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[r?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:s(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,r.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[r.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,_(v(r)),`)`]})]})]})}):n.isPending?(0,A.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(C,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:e}){let t=N([e]);return(0,A.jsxs)(O,{children:[(0,A.jsxs)(w,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(D,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(E,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:e,loading:t.isFetching,report:t.data?.[e.releaseId]}),(0,A.jsx)(o,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(T,{className:`px-4 pb-4`,children:(0,A.jsxs)(u,{className:a({variant:`outline`,size:`sm`}),to:`/insights`,search:{platform:e.platform,channel:e.channel,releaseId:e.releaseId,bundleWindow:S(e.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return h(`insightsAnalytics`)?null:(0,A.jsxs)(O,{children:[(0,A.jsx)(w,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(D,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(E,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function H({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var U={Cell:H},W={insights:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(u,{to:`/insights`,onClick:t}):(0,A.jsx)(u,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:U,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},G={remoteConfig:{navigation:{icon:(0,A.jsx)(x,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(u,{to:`/remote-config`,onClick:e})}}},K={...W,...j,...G},q=Object.keys(g),J=()=>{let e=m().data?.features;return e===void 0?[]:q.flatMap(t=>{let n=K[t];return n!==void 0&&e[t]?[{...n,feature:t,label:g[t].label,features:e}]:[]})},Y=()=>J().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function X({release:e}){return J().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var Z=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Q(e){let t=Z(e.beforeReleaseId),n=t?void 0:Z(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=Z(e.bundleId),a=i?void 0:Z(e.scopeKey),o=i||a?void 0:Z(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:Z(e.releaseId),scopeKey:a}}function $(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function te(e){return $(e).kind!==`all`}function ne(e,t){let n={...e,...t};return t.bundleId?Q({bundleId:n.bundleId}):t.scopeKey?Q({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Q({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Q({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var re=d(`/`)({component:f(()=>p(()=>import(`./routes-CVbPjRKo.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,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41])),`component`),validateSearch:Q});export{X as a,ne as i,te as n,J as o,$ as r,Y as s,re as t};
|