@hot-updater/console 1.0.0-rc.2 → 1.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/InsightsErrorAlert-1cg6LDJG.js +1 -0
  3. package/.output/public/assets/InsightsPageHeader-oNIg_lcd.js +1 -0
  4. package/.output/public/assets/InsightsRolloutCard-Zsv9gBjU.js +42 -0
  5. package/.output/public/assets/{api-keys-BzKocqRy.js → api-keys-ChJjsbP2.js} +1 -1
  6. package/.output/public/assets/{api-keys-api-BHcODB7q.js → api-keys-api-LchP65vQ.js} +1 -1
  7. package/.output/public/assets/{card-Dhr_eFYj.js → card-iD7iiy4T.js} +1 -1
  8. package/.output/public/assets/{chart-no-axes-combined-Dy4WJv2U.js → chart-no-axes-combined-C0G0fQ3J.js} +1 -1
  9. package/.output/public/assets/createServerFn-DHc2erub.js +3 -0
  10. package/.output/public/assets/dialog-DX6o8qCL.js +1 -0
  11. package/.output/public/assets/{dist-C_NydL0e.js → dist-BPrb_vuw.js} +1 -1
  12. package/.output/public/assets/index-C6Nb14xG.js +10 -0
  13. package/.output/public/assets/{input-group-cSOG4wh_.js → input-group-Pa3SAbEI.js} +1 -1
  14. package/.output/public/assets/insights-C1uKy3p2.js +1 -0
  15. package/.output/public/assets/installations-Bj5AzZ3T.js +1 -0
  16. package/.output/public/assets/{installations-CE33wgbY.js → installations-DDTw9DSK.js} +2 -2
  17. package/.output/public/assets/{lazyRouteComponent-Ccp3bwBY.js → lazyRouteComponent-BN0MS05o.js} +1 -1
  18. package/.output/public/assets/{link-CI8idAUi.js → link-BG06whwB.js} +1 -1
  19. package/.output/public/assets/{loader-circle-BoxLrsOu.js → loader-circle-Bbp8LGVC.js} +1 -1
  20. package/.output/public/assets/{refresh-cw-Bqc72UZG.js → refresh-cw-DZgiAOMk.js} +1 -1
  21. package/.output/public/assets/routes-9E2okfpG.js +1 -0
  22. package/.output/public/assets/{routes-DGVXdzpw.js → routes-B3JviaDV.js} +2 -2
  23. package/.output/public/assets/{shield-check-uK3MHWJZ.js → shield-check-DoIiaaXU.js} +1 -1
  24. package/.output/public/assets/{signing-CMf4aqDO.js → signing-BKy9fIdB.js} +1 -1
  25. package/.output/public/assets/styles-C5-su40i.css +2 -0
  26. package/.output/public/assets/{table-2vcV89QB.js → table-bpgpQkPz.js} +1 -1
  27. package/.output/public/assets/useOpenInteractionType-4dPacbwb.js +1 -0
  28. package/.output/public/assets/x-Cr_sPM8E.js +1 -0
  29. package/.output/server/{__23tanstack-start-server-fn-resolver-B7ioJhtE.mjs → __23tanstack-start-server-fn-resolver-EMel9KYs.mjs} +36 -32
  30. package/.output/server/_libs/@base-ui/react+[...].mjs +1051 -1051
  31. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
  32. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  33. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
  34. package/.output/server/_libs/d3-array.mjs +231 -0
  35. package/.output/server/_libs/d3-color.mjs +330 -0
  36. package/.output/server/_libs/d3-format.mjs +252 -0
  37. package/.output/server/_libs/d3-interpolate.mjs +207 -0
  38. package/.output/server/_libs/d3-path.mjs +77 -0
  39. package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
  40. package/.output/server/_libs/d3-shape.mjs +818 -0
  41. package/.output/server/_libs/decimal.js-light.mjs +884 -0
  42. package/.output/server/_libs/es-toolkit.mjs +1159 -0
  43. package/.output/server/_libs/eventemitter3.mjs +236 -0
  44. package/.output/server/_libs/immer.mjs +532 -0
  45. package/.output/server/_libs/lucide-react.mjs +1 -1
  46. package/.output/server/_libs/next-themes.mjs +1 -1
  47. package/.output/server/_libs/react-redux+[...].mjs +205 -0
  48. package/.output/server/_libs/recharts+[...].mjs +14636 -0
  49. package/.output/server/_libs/sonner.mjs +1 -1
  50. package/.output/server/_libs/tanstack__react-query.mjs +1 -1
  51. package/.output/server/_runtime.mjs +10 -1
  52. package/.output/server/_ssr/InsightsErrorAlert-DzDVdfgW.mjs +169 -0
  53. package/.output/server/_ssr/{InsightsPageHeader-Df4Brj8u.mjs → InsightsPageHeader-CZ2AaQGk.mjs} +8 -120
  54. package/.output/server/_ssr/InsightsRolloutCard-DHB2iM4t.mjs +693 -0
  55. package/.output/server/_ssr/{api-keys-CZeTPQys.mjs → api-keys-BBl84_lN.mjs} +7 -7
  56. package/.output/server/_ssr/{api-keys-api-BUPQVSpk.mjs → api-keys-api-KSH04dLB.mjs} +2 -2
  57. package/.output/server/_ssr/{api-keys-rpc-Cs7tS5_j.mjs → api-keys-rpc-DBmgnW5o.mjs} +3 -3
  58. package/.output/server/_ssr/{api-rpc-tAupfGQm.mjs → api-rpc-DX5B6b-L.mjs} +25 -25
  59. package/.output/server/_ssr/{auth-rpc-DUaeOWKK.mjs → auth-rpc-gaibR719.mjs} +4 -4
  60. package/.output/server/_ssr/{auth.server-DW71WzsD.mjs → auth.server-DF_shCeq.mjs} +1 -1
  61. package/.output/server/_ssr/{bundle-signing-rpc-BhnBw0-d.mjs → bundle-signing-rpc-C01EKpb-.mjs} +2 -2
  62. package/.output/server/_ssr/{bundle-signing.server-C4NW5mWx.mjs → bundle-signing.server-Co_zHdJx.mjs} +1 -1
  63. package/.output/server/_ssr/{card-BRiPmi0C.mjs → card-gGh8F6kQ.mjs} +1 -1
  64. package/.output/server/_ssr/{config.server-afDuAwaG.mjs → config.server-NIXXHk-e.mjs} +5 -5
  65. package/.output/server/_ssr/{createSsrRpc-DjWNJ0uc.mjs → createSsrRpc-4rr4IJh3.mjs} +3 -3
  66. package/.output/server/_ssr/{deleteBundle-BTGwBgzx.mjs → deleteBundle-C71v1GBr.mjs} +1 -1
  67. package/.output/server/_ssr/{dialog-DS-nw-pA.mjs → dialog-DNtKYR5K.mjs} +1 -1
  68. package/.output/server/_ssr/{downloadBundle-CNnYxYO2.mjs → downloadBundle-A9zYC2go.mjs} +1 -1
  69. package/.output/server/_ssr/{getBundleChildren-C0vh4ZvE.mjs → getBundleChildren-CMGSGBWv.mjs} +1 -1
  70. package/.output/server/_ssr/{input-group-BpsnmvZw.mjs → input-group-Oj4kUnE4.mjs} +1 -1
  71. package/.output/server/_ssr/{insights-BdS364Xu.mjs → insights-oK2n5WBp.mjs} +13 -67
  72. package/.output/server/_ssr/insights-recovery-DSFM-YTL.mjs +21 -0
  73. package/.output/server/_ssr/insights-recovery-rpc-CgeCAs2K.mjs +16 -0
  74. package/.output/server/_ssr/{insights-rpc-38DujK0G.mjs → insights-rpc-DBf0ouen.mjs} +2 -2
  75. package/.output/server/_ssr/insightsRecovery-DFkXGFjd.mjs +108 -0
  76. package/.output/server/_ssr/{installations-CtA59MQG.mjs → installations-DBmYuVBi.mjs} +2 -2
  77. package/.output/server/_ssr/{installations-DiVKEF5T.mjs → installations-DQyJN-pZ.mjs} +9 -9
  78. package/.output/server/_ssr/{router-B9wG_9f8.mjs → router-C8J4nYEG.mjs} +13 -13
  79. package/.output/server/_ssr/{routes-CKrrS2q2.mjs → routes-C2RIYhyl.mjs} +2 -2
  80. package/.output/server/_ssr/{routes-D7Yh_jfj.mjs → routes-NlTRKPML.mjs} +21 -86
  81. package/.output/server/_ssr/{runtime.server-DacU1TBV.mjs → runtime.server-DLZpzphL.mjs} +1 -1
  82. package/.output/server/_ssr/{server-D_C2rMzf.mjs → server-hgrXpJQY.mjs} +3 -3
  83. package/.output/server/_ssr/{signing-Dz1WkZOf.mjs → signing-bfOvUMSJ.mjs} +3 -3
  84. package/.output/server/_ssr/ssr.mjs +1 -1
  85. package/.output/server/_ssr/{table-CnZmon_Z.mjs → table-QQ9cnWf2.mjs} +3 -3
  86. package/.output/server/_tanstack-start-manifest_v-BAb_a_eC.mjs +97 -0
  87. package/.output/server/index.mjs +152 -152
  88. package/package.json +5 -5
  89. package/src/components/features/insights/InsightsRolloutCard.tsx +505 -0
  90. package/src/components/features/releases/ReleaseEditorSheet.tsx +13 -0
  91. package/src/components/ui/empty.tsx +101 -0
  92. package/src/lib/insights-recovery-rpc.ts +14 -0
  93. package/src/lib/insights-recovery.ts +55 -0
  94. package/src/lib/server/insightsRecovery.ts +157 -0
  95. package/src/routes/insights.tsx +2 -0
  96. package/.output/public/assets/HashValueDisplay-CB0Eskit.js +0 -1
  97. package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +0 -1
  98. package/.output/public/assets/composite-Bp98A0Ld.js +0 -1
  99. package/.output/public/assets/createServerFn-CA8fs7QD.js +0 -3
  100. package/.output/public/assets/dialog-CUTrcPlB.js +0 -1
  101. package/.output/public/assets/index-DdAz-CXv.js +0 -10
  102. package/.output/public/assets/insights-C0PBSZ-n.js +0 -1
  103. package/.output/public/assets/installations-CStZja8x.js +0 -1
  104. package/.output/public/assets/routes-DTlwOr8I.js +0 -1
  105. package/.output/public/assets/styles-BCvbtKsm.css +0 -2
  106. package/.output/public/assets/useCompositeListItem-CHLITE_4.js +0 -1
  107. package/.output/public/assets/x-DCd0j8c6.js +0 -1
  108. package/.output/server/_ssr/HashValueDisplay-DwpGLfrl.mjs +0 -55
  109. package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +0 -97
  110. /package/.output/public/assets/{preload-helper-CQ36nxok.js → preload-helper-B_l5jfgx.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { r as __toESM } from "../_runtime.mjs";
1
+ import { i as __toESM } from "../_runtime.mjs";
2
2
  import { H as require_react_dom, J as require_react } from "./@base-ui/react+[...].mjs";
3
3
  //#region ../../node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/sonner/dist/index.mjs
4
4
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
@@ -1,4 +1,4 @@
1
- import { r as __toESM } from "../_runtime.mjs";
1
+ import { i as __toESM } from "../_runtime.mjs";
2
2
  import { J as require_react, q as require_jsx_runtime } from "./@base-ui/react+[...].mjs";
3
3
  import { c as noop, i as notifyManager, l as shouldThrowError, n as MutationObserver, r as QueryObserver, s as environmentManager } from "./tanstack__query-core.mjs";
4
4
  //#region ../../node_modules/.pnpm/@tanstack+react-query@5.101.0_react@19.2.6/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
@@ -7,6 +7,15 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
10
+ var __exportAll = (all, no_symbols) => {
11
+ let target = {};
12
+ for (var name in all) __defProp(target, name, {
13
+ get: all[name],
14
+ enumerable: true
15
+ });
16
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
17
+ return target;
18
+ };
10
19
  var __copyProps = (to, from, except, desc) => {
11
20
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
21
  key = keys[i];
@@ -23,4 +32,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
32
  }) : target, mod));
24
33
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
25
34
  //#endregion
26
- export { __require as n, __toESM as r, __commonJSMin as t };
35
+ export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
@@ -0,0 +1,169 @@
1
+ import { i as __toESM } from "../_runtime.mjs";
2
+ import { J as require_react, q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
+ import { N as ChevronDown, P as Check, h as PackageCheck, n as TriangleAlert, u as RotateCcw, z as Activity } from "../_libs/lucide-react.mjs";
4
+ import { C as cn, v as Tooltip$1, x as TooltipTrigger, y as TooltipContent } from "./createSsrRpc-4rr4IJh3.mjs";
5
+ import { a as Badge, i as AlertTitle, r as AlertDescription, t as Alert } from "./card-gGh8F6kQ.mjs";
6
+ import { n as toast } from "../_libs/sonner.mjs";
7
+ //#region node_modules/.nitro/vite/services/ssr/assets/InsightsErrorAlert-DzDVdfgW.js
8
+ var import_react = /* @__PURE__ */ __toESM(require_react());
9
+ var import_jsx_runtime = require_jsx_runtime();
10
+ var shortenIdentifier = (value, maxLength = 12) => value.length > maxLength ? `${value.slice(0, Math.max(1, maxLength - 4))}…${value.slice(-4)}` : value;
11
+ function HashValueDisplay({ value, maxLength = 12, className, buttonClassName }) {
12
+ const isTruncated = value.length > maxLength;
13
+ const truncated = shortenIdentifier(value, maxLength);
14
+ const copyValue = async () => {
15
+ try {
16
+ await navigator.clipboard.writeText(value);
17
+ toast.success("Copied to clipboard", { description: value });
18
+ } catch {
19
+ toast.error("Failed to copy value");
20
+ }
21
+ };
22
+ const handleClick = (event) => {
23
+ event.preventDefault();
24
+ event.stopPropagation();
25
+ copyValue();
26
+ };
27
+ const handleKeyDown = (event) => {
28
+ if (event.key === "Enter" || event.key === " ") {
29
+ event.preventDefault();
30
+ event.stopPropagation();
31
+ copyValue();
32
+ }
33
+ };
34
+ const content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
35
+ translate: "no",
36
+ className: cn("font-mono text-xs tabular-nums whitespace-nowrap", className),
37
+ children: truncated
38
+ });
39
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tooltip$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger, {
40
+ render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
41
+ type: "button",
42
+ "aria-label": `Copy full value: ${value}`,
43
+ translate: "no",
44
+ className: cn("ring-ring/30 bg-muted/40 border-border/70 inline-flex min-w-0 max-w-full cursor-pointer items-center rounded-md border px-1.5 py-0.5 align-top shadow-xs outline-none transition-[background-color,border-color,transform,box-shadow]", "hover:bg-muted/70 active:scale-[0.98] active:bg-muted/85 focus-visible:ring-[2px]", "touch-manipulation select-none motion-reduce:transition-none motion-reduce:active:scale-100", !isTruncated && "cursor-copy", buttonClassName),
45
+ onClick: handleClick,
46
+ onKeyDown: handleKeyDown
47
+ }),
48
+ children: content
49
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContent, {
50
+ hidden: !isTruncated,
51
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
52
+ translate: "no",
53
+ className: "break-all font-mono text-xs tabular-nums",
54
+ children: value
55
+ })
56
+ })] });
57
+ }
58
+ var eventTypes = {
59
+ UPDATE_APPLIED: {
60
+ label: "Bundle applied",
61
+ variant: "success",
62
+ icon: Check
63
+ },
64
+ RECOVERED: {
65
+ label: "Recovered",
66
+ variant: "warning",
67
+ icon: RotateCcw
68
+ },
69
+ RELEASE_ADOPTED: {
70
+ label: "Bundle adopted",
71
+ variant: "success",
72
+ icon: PackageCheck
73
+ },
74
+ UNCHANGED: {
75
+ label: "Activity reported",
76
+ variant: "secondary",
77
+ icon: Activity
78
+ }
79
+ };
80
+ function useInsightsTimeFormat() {
81
+ const [timeZone, setTimeZone] = (0, import_react.useState)("UTC");
82
+ (0, import_react.useEffect)(() => {
83
+ setTimeZone(Intl.DateTimeFormat().resolvedOptions().timeZone);
84
+ }, []);
85
+ return new Intl.DateTimeFormat("en", {
86
+ timeZone,
87
+ timeZoneName: "shortOffset",
88
+ year: "numeric",
89
+ month: "2-digit",
90
+ day: "2-digit",
91
+ hour: "2-digit",
92
+ minute: "2-digit",
93
+ second: "2-digit",
94
+ hourCycle: "h23"
95
+ });
96
+ }
97
+ function formatInsightsTimestamp(value, formatter) {
98
+ const parts = Object.fromEntries(formatter.formatToParts(new Date(value)).map(({ type, value }) => [type, value]));
99
+ const offset = parts.timeZoneName === "GMT" ? "GMT+0" : parts.timeZoneName;
100
+ return `${parts.year}/${parts.month}/${parts.day} ${parts.hour}:${parts.minute}:${parts.second} ${offset}`;
101
+ }
102
+ function EventTimestamp({ value, formatter, touch = false }) {
103
+ const date = new Date(value);
104
+ const localTime = formatInsightsTimestamp(value, formatter);
105
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
106
+ className: "group/time",
107
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", {
108
+ className: `cursor-pointer list-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-details-marker]:hidden ${touch ? "flex min-h-11 items-center" : ""}`,
109
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
110
+ className: "flex items-center gap-1",
111
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {
112
+ dateTime: date.toISOString(),
113
+ className: "whitespace-nowrap",
114
+ children: localTime
115
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, {
116
+ "aria-hidden": "true",
117
+ className: "size-3 text-muted-foreground group-open/time:rotate-180"
118
+ })]
119
+ })
120
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
121
+ className: "mt-2 text-muted-foreground",
122
+ children: date.toISOString().replace("T", " ").replace("Z", " UTC")
123
+ })]
124
+ });
125
+ }
126
+ function EventTypeBadge({ type }) {
127
+ const eventType = eventTypes[type];
128
+ const Icon = eventType.icon;
129
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
130
+ variant: eventType.variant,
131
+ className: "gap-1 whitespace-nowrap [&_svg]:size-3",
132
+ title: type === "UNCHANGED" ? "App activity reported on the current bundle without a bundle transition." : type === "RELEASE_ADOPTED" ? "A different release was adopted without changing the bundle." : void 0,
133
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { "aria-hidden": "true" }), eventType.label]
134
+ });
135
+ }
136
+ function EventBundleTransition({ event, touch = false }) {
137
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
138
+ className: "grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-2",
139
+ children: [
140
+ event.fromBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
141
+ className: "text-muted-foreground",
142
+ children: "From"
143
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
144
+ value: event.fromBundleId,
145
+ buttonClassName: touch ? "min-h-11 px-3" : void 0
146
+ }) })] }) : null,
147
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
148
+ className: "text-muted-foreground",
149
+ children: event.type === "UNCHANGED" ? "Current" : "To"
150
+ }),
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
152
+ value: event.toBundleId,
153
+ buttonClassName: touch ? "min-h-11 px-3" : void 0
154
+ }) })
155
+ ]
156
+ });
157
+ }
158
+ function InsightsErrorAlert({ fallbackTitle }) {
159
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, {
160
+ variant: "destructive",
161
+ children: [
162
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, { "aria-hidden": "true" }),
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: fallbackTitle }),
164
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: "Refresh to try again. If this keeps happening, check your Insights provider connection." })
165
+ ]
166
+ });
167
+ }
168
+ //#endregion
169
+ export { InsightsErrorAlert as a, HashValueDisplay as i, EventTimestamp as n, shortenIdentifier as o, EventTypeBadge as r, useInsightsTimeFormat as s, EventBundleTransition as t };
@@ -1,15 +1,13 @@
1
- import { r as __toESM } from "../_runtime.mjs";
2
1
  import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
3
- import { J as require_react, q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
4
- import { F as ChartNoAxesCombined, I as ArrowUpRight, N as ChevronDown, P as Check, d as RefreshCw, h as PackageCheck, n as TriangleAlert, u as RotateCcw, z as Activity } from "../_libs/lucide-react.mjs";
5
- import { S as buttonVariants, _ as Skeleton, g as SidebarTrigger, t as Button$1, w as createSsrRpc } from "./createSsrRpc-DjWNJ0uc.mjs";
2
+ import { q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
+ import { F as ChartNoAxesCombined, I as ArrowUpRight, d as RefreshCw } from "../_libs/lucide-react.mjs";
4
+ import { S as buttonVariants, _ as Skeleton, g as SidebarTrigger, t as Button$1, w as createSsrRpc } from "./createSsrRpc-4rr4IJh3.mjs";
6
5
  import { m as Link } from "../_libs/@tanstack/react-router+[...].mjs";
7
6
  import { n as useQuery } from "../_libs/tanstack__react-query.mjs";
8
- import { a as Badge, d as CardTitle, i as AlertTitle, o as Card, r as AlertDescription, s as CardContent, t as Alert, u as CardHeader } from "./card-BRiPmi0C.mjs";
9
- import { c as TableBody, d as TableHeader, f as TableRow, l as TableCell, s as Table, u as TableHead } from "./table-CnZmon_Z.mjs";
10
- import { t as HashValueDisplay } from "./HashValueDisplay-DwpGLfrl.mjs";
11
- //#region node_modules/.nitro/vite/services/ssr/assets/InsightsPageHeader-Df4Brj8u.js
12
- var import_react = /* @__PURE__ */ __toESM(require_react());
7
+ import { d as CardTitle, o as Card, s as CardContent, u as CardHeader } from "./card-gGh8F6kQ.mjs";
8
+ import { c as TableBody, d as TableHeader, f as TableRow, l as TableCell, s as Table, u as TableHead } from "./table-QQ9cnWf2.mjs";
9
+ import { a as InsightsErrorAlert, i as HashValueDisplay, n as EventTimestamp, r as EventTypeBadge, s as useInsightsTimeFormat, t as EventBundleTransition } from "./InsightsErrorAlert-DzDVdfgW.mjs";
10
+ //#region node_modules/.nitro/vite/services/ssr/assets/InsightsPageHeader-CZ2AaQGk.js
13
11
  var import_jsx_runtime = require_jsx_runtime();
14
12
  var readOverview = (input) => input;
15
13
  var readEventsPage = (input) => input;
@@ -81,106 +79,6 @@ var useInsightsInstallationEventsQuery = (input, enabled) => useQuery({
81
79
  refetchOnWindowFocus: true,
82
80
  staleTime: STALE_TIME_MS
83
81
  });
84
- var eventTypes = {
85
- UPDATE_APPLIED: {
86
- label: "Bundle applied",
87
- variant: "success",
88
- icon: Check
89
- },
90
- RECOVERED: {
91
- label: "Recovered",
92
- variant: "warning",
93
- icon: RotateCcw
94
- },
95
- RELEASE_ADOPTED: {
96
- label: "Bundle adopted",
97
- variant: "success",
98
- icon: PackageCheck
99
- },
100
- UNCHANGED: {
101
- label: "Activity reported",
102
- variant: "secondary",
103
- icon: Activity
104
- }
105
- };
106
- function useInsightsTimeFormat() {
107
- const [timeZone, setTimeZone] = (0, import_react.useState)("UTC");
108
- (0, import_react.useEffect)(() => {
109
- setTimeZone(Intl.DateTimeFormat().resolvedOptions().timeZone);
110
- }, []);
111
- return new Intl.DateTimeFormat("en", {
112
- timeZone,
113
- timeZoneName: "shortOffset",
114
- year: "numeric",
115
- month: "2-digit",
116
- day: "2-digit",
117
- hour: "2-digit",
118
- minute: "2-digit",
119
- second: "2-digit",
120
- hourCycle: "h23"
121
- });
122
- }
123
- function formatInsightsTimestamp(value, formatter) {
124
- const parts = Object.fromEntries(formatter.formatToParts(new Date(value)).map(({ type, value }) => [type, value]));
125
- const offset = parts.timeZoneName === "GMT" ? "GMT+0" : parts.timeZoneName;
126
- return `${parts.year}/${parts.month}/${parts.day} ${parts.hour}:${parts.minute}:${parts.second} ${offset}`;
127
- }
128
- function EventTimestamp({ value, formatter, touch = false }) {
129
- const date = new Date(value);
130
- const localTime = formatInsightsTimestamp(value, formatter);
131
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
132
- className: "group/time",
133
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", {
134
- className: `cursor-pointer list-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-details-marker]:hidden ${touch ? "flex min-h-11 items-center" : ""}`,
135
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
136
- className: "flex items-center gap-1",
137
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {
138
- dateTime: date.toISOString(),
139
- className: "whitespace-nowrap",
140
- children: localTime
141
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, {
142
- "aria-hidden": "true",
143
- className: "size-3 text-muted-foreground group-open/time:rotate-180"
144
- })]
145
- })
146
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
147
- className: "mt-2 text-muted-foreground",
148
- children: date.toISOString().replace("T", " ").replace("Z", " UTC")
149
- })]
150
- });
151
- }
152
- function EventTypeBadge({ type }) {
153
- const eventType = eventTypes[type];
154
- const Icon = eventType.icon;
155
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
156
- variant: eventType.variant,
157
- className: "gap-1 whitespace-nowrap [&_svg]:size-3",
158
- title: type === "UNCHANGED" ? "App activity reported on the current bundle without a bundle transition." : type === "RELEASE_ADOPTED" ? "A different release was adopted without changing the bundle." : void 0,
159
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { "aria-hidden": "true" }), eventType.label]
160
- });
161
- }
162
- function EventBundleTransition({ event, touch = false }) {
163
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
164
- className: "grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-2",
165
- children: [
166
- event.fromBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
167
- className: "text-muted-foreground",
168
- children: "From"
169
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
170
- value: event.fromBundleId,
171
- buttonClassName: touch ? "min-h-11 px-3" : void 0
172
- }) })] }) : null,
173
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
174
- className: "text-muted-foreground",
175
- children: event.type === "UNCHANGED" ? "Current" : "To"
176
- }),
177
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
178
- value: event.toBundleId,
179
- buttonClassName: touch ? "min-h-11 px-3" : void 0
180
- }) })
181
- ]
182
- });
183
- }
184
82
  function EventHistoryList({ events, formatter, renderIdentity }) {
185
83
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
186
84
  className: "px-4 pb-2 text-xs text-muted-foreground sm:px-6",
@@ -235,16 +133,6 @@ function EventHistoryList({ events, formatter, renderIdentity }) {
235
133
  }, event.id))
236
134
  })] });
237
135
  }
238
- function InsightsErrorAlert({ fallbackTitle }) {
239
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, {
240
- variant: "destructive",
241
- children: [
242
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, { "aria-hidden": "true" }),
243
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: fallbackTitle }),
244
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: "Refresh to try again. If this keeps happening, check your Insights provider connection." })
245
- ]
246
- });
247
- }
248
136
  function InsightsPagination({ hasPrevious, label, nextCursor, onNext, onPrevious, pageLength, pageNumber }) {
249
137
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
250
138
  "aria-label": `${label} pagination`,
@@ -481,4 +369,4 @@ function InsightsPageHeader({ view }) {
481
369
  });
482
370
  }
483
371
  //#endregion
484
- export { EventTypeBadge as a, InsightsPagination as c, useInsightsInstallationQuery as d, useInsightsInstallationsQuery as f, EventTimestamp as i, useInsightsEventsQuery as l, useReportingInstallationsQuery as m, EventHistoryCard as n, InsightsErrorAlert as o, useInsightsTimeFormat as p, EventHistoryList as r, InsightsPageHeader as s, EventBundleTransition as t, useInsightsInstallationEventsQuery as u };
372
+ export { useInsightsEventsQuery as a, useInsightsInstallationsQuery as c, InsightsPagination as i, useReportingInstallationsQuery as l, EventHistoryList as n, useInsightsInstallationEventsQuery as o, InsightsPageHeader as r, useInsightsInstallationQuery as s, EventHistoryCard as t };