@hot-updater/console 1.0.0-rc.1 → 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.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/InsightsErrorAlert-1cg6LDJG.js +1 -0
- package/.output/public/assets/InsightsPageHeader-oNIg_lcd.js +1 -0
- package/.output/public/assets/InsightsRolloutCard-Zsv9gBjU.js +42 -0
- package/.output/public/assets/api-keys-ChJjsbP2.js +1 -0
- package/.output/public/assets/api-keys-api-LchP65vQ.js +1 -0
- package/.output/public/assets/card-iD7iiy4T.js +1 -0
- package/.output/public/assets/{chart-no-axes-combined-FaYMGmQS.js → chart-no-axes-combined-C0G0fQ3J.js} +1 -1
- package/.output/public/assets/{createServerFn-gM2-LFBy.js → createServerFn-DHc2erub.js} +1 -1
- package/.output/public/assets/dialog-DX6o8qCL.js +1 -0
- package/.output/public/assets/dist-BPrb_vuw.js +1 -0
- package/.output/public/assets/index-C6Nb14xG.js +10 -0
- package/.output/public/assets/input-group-Pa3SAbEI.js +1 -0
- package/.output/public/assets/insights-C1uKy3p2.js +1 -0
- package/.output/public/assets/installations-Bj5AzZ3T.js +1 -0
- package/.output/public/assets/installations-DDTw9DSK.js +2 -0
- package/.output/public/assets/lazyRouteComponent-BN0MS05o.js +1 -0
- package/.output/public/assets/link-BG06whwB.js +1 -0
- package/.output/public/assets/loader-circle-Bbp8LGVC.js +1 -0
- package/.output/public/assets/{refresh-cw-BkbfZ62O.js → refresh-cw-DZgiAOMk.js} +1 -1
- package/.output/public/assets/routes-9E2okfpG.js +1 -0
- package/.output/public/assets/{routes-BuoI5-Cr.js → routes-B3JviaDV.js} +2 -2
- package/.output/public/assets/{shield-check-DE_hVuHu.js → shield-check-DoIiaaXU.js} +1 -1
- package/.output/public/assets/signing-BKy9fIdB.js +1 -0
- package/.output/public/assets/styles-C5-su40i.css +2 -0
- package/.output/public/assets/table-bpgpQkPz.js +1 -0
- package/.output/public/assets/useOpenInteractionType-4dPacbwb.js +1 -0
- package/.output/public/assets/x-Cr_sPM8E.js +1 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-Dftxlm2E.mjs → __23tanstack-start-server-fn-resolver-EMel9KYs.mjs} +50 -54
- package/.output/server/_libs/@base-ui/react+[...].mjs +2248 -4382
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +51 -3
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/es-toolkit.mjs +26 -1
- package/.output/server/_libs/lucide-react.mjs +35 -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 +1559 -1040
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tanstack__react-query.mjs +1 -1
- package/.output/server/_libs/verkit.mjs +20 -15
- package/.output/server/_ssr/InsightsErrorAlert-DzDVdfgW.mjs +169 -0
- package/.output/server/_ssr/InsightsPageHeader-CZ2AaQGk.mjs +372 -0
- package/.output/server/_ssr/InsightsRolloutCard-DHB2iM4t.mjs +693 -0
- package/.output/server/_ssr/{api-keys-CpBqHpuC.mjs → api-keys-BBl84_lN.mjs} +8 -10
- package/.output/server/_ssr/{api-keys-api-Czkp57UV.mjs → api-keys-api-KSH04dLB.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-rpc-BTtMDSoR.mjs → api-keys-rpc-DBmgnW5o.mjs} +5 -5
- package/.output/server/_ssr/{api-rpc-BEX8ISai.mjs → api-rpc-DX5B6b-L.mjs} +73 -142
- package/.output/server/_ssr/{auth-rpc-BFMEC-TT.mjs → auth-rpc-gaibR719.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-DW71WzsD.mjs → auth.server-DF_shCeq.mjs} +1 -1
- package/.output/server/_ssr/{bundle-signing-rpc-BbCFUQSu.mjs → bundle-signing-rpc-C01EKpb-.mjs} +2 -2
- package/.output/server/_ssr/{bundle-signing.server-C4NW5mWx.mjs → bundle-signing.server-Co_zHdJx.mjs} +1 -1
- package/.output/server/_ssr/{card-Bsc8mRis.mjs → card-gGh8F6kQ.mjs} +25 -3
- package/.output/server/_ssr/{config.server-DQYEr_5X.mjs → config.server-NIXXHk-e.mjs} +15 -8
- package/.output/server/_ssr/{createSsrRpc-DhfrxEjg.mjs → createSsrRpc-4rr4IJh3.mjs} +5 -5
- package/.output/server/_ssr/databaseJsonValue-d6I3nAS4.mjs +45 -0
- package/.output/server/_ssr/{databaseRows-QlCYLi0H.mjs → databaseRows-5bCRTxm-.mjs} +4 -44
- package/.output/server/_ssr/{deleteBundle-Cu_XOMt0.mjs → deleteBundle-C71v1GBr.mjs} +2 -2
- package/.output/server/_ssr/{dialog-C0vKUp8R.mjs → dialog-DNtKYR5K.mjs} +2 -2
- package/.output/server/_ssr/{dist-BVSLTpoP.mjs → dist-CyzPaI5v.mjs} +2 -2
- package/.output/server/_ssr/{downloadBundle-CNnYxYO2.mjs → downloadBundle-A9zYC2go.mjs} +1 -1
- package/.output/server/_ssr/{getBundleChildren-BcRMFoDF.mjs → getBundleChildren-CMGSGBWv.mjs} +2 -2
- package/.output/server/_ssr/input-group-Oj4kUnE4.mjs +70 -0
- package/.output/server/_ssr/insights-oK2n5WBp.mjs +406 -0
- package/.output/server/_ssr/insights-recovery-DSFM-YTL.mjs +21 -0
- package/.output/server/_ssr/insights-recovery-rpc-CgeCAs2K.mjs +16 -0
- package/.output/server/_ssr/insights-rpc-DBf0ouen.mjs +57 -0
- package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +303 -0
- package/.output/server/_ssr/insightsRecovery-DFkXGFjd.mjs +108 -0
- package/.output/server/_ssr/installations-DBmYuVBi.mjs +29 -0
- package/.output/server/_ssr/installations-DQyJN-pZ.mjs +627 -0
- package/.output/server/_ssr/{router-BxBEvtF1.mjs → router-C8J4nYEG.mjs} +24 -33
- package/.output/server/_ssr/{routes-BC7rn-tf.mjs → routes-C2RIYhyl.mjs} +3 -3
- package/.output/server/_ssr/{routes-CM5KAwpB.mjs → routes-NlTRKPML.mjs} +411 -463
- package/.output/server/_ssr/runtime.server-DLZpzphL.mjs +438 -0
- package/.output/server/_ssr/{server-CpzW--lT.mjs → server-hgrXpJQY.mjs} +5 -5
- package/.output/server/_ssr/{signing-jk4HANnl.mjs → signing-bfOvUMSJ.mjs} +5 -6
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{field-DASCh-5d.mjs → table-QQ9cnWf2.mjs} +50 -4
- package/.output/server/_ssr/{uuidv7-CaKuKXrV.mjs → uuidv7-D0QFkPL_.mjs} +3 -3
- package/.output/server/_tanstack-start-manifest_v-BAb_a_eC.mjs +97 -0
- package/.output/server/index.mjs +161 -175
- package/lib/index.d.mts +4 -3
- package/lib/vite-internal.mjs +1 -1
- package/lib/vite.d.mts +0 -1
- package/package.json +7 -7
- package/src/components/AppSidebar.tsx +10 -14
- package/src/components/ConsoleAccessPage.tsx +1 -1
- package/src/components/HashValueDisplay.tsx +11 -2
- package/src/components/features/bundles/BundleChildrenPanel.tsx +7 -6
- package/src/components/features/bundles/BundleMetadata.tsx +1 -20
- package/src/components/features/channels/ChannelManagementDialog.tsx +1 -1
- package/src/components/features/insights/EventDetails.tsx +151 -0
- package/src/components/features/insights/EventHistoryCard.tsx +245 -0
- package/src/components/features/insights/EventHistoryList.tsx +63 -0
- package/src/components/features/insights/InsightsBundleReports.tsx +51 -0
- package/src/components/features/insights/InsightsControls.tsx +82 -76
- package/src/components/features/insights/InsightsErrorAlert.tsx +5 -5
- package/src/components/features/insights/InsightsOverview.tsx +156 -161
- package/src/components/features/insights/InsightsPageHeader.tsx +48 -0
- package/src/components/features/insights/InsightsPagination.tsx +52 -0
- package/src/components/features/insights/InsightsRolloutCard.tsx +505 -0
- package/src/components/features/insights/InstallationHistoryCard.tsx +178 -176
- package/src/components/features/insights/InstallationMatchesCard.tsx +111 -65
- package/src/components/features/insights/InstallationPageHeader.tsx +57 -105
- package/src/components/features/releases/ReleaseEditorSheet.tsx +37 -24
- package/src/components/ui/badge.tsx +2 -0
- package/src/components/ui/combobox.tsx +1 -0
- package/src/components/ui/empty.tsx +101 -0
- package/src/components/ui/skeleton.tsx +4 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/index.ts +7 -2
- package/src/lib/api-rpc.ts +19 -90
- package/src/lib/api.ts +0 -99
- package/src/lib/insights-api.ts +93 -137
- package/src/lib/insights-recovery-rpc.ts +14 -0
- package/src/lib/insights-recovery.ts +55 -0
- package/src/lib/insights-rpc.ts +69 -199
- package/src/lib/insights-view.ts +15 -0
- package/src/lib/public-bundle-error.ts +19 -0
- package/src/lib/server/insightsRecovery.ts +157 -0
- package/src/lib/server/releaseReachability.ts +1 -4
- package/src/lib/server/runtime.server.ts +5 -141
- package/src/router.tsx +3 -0
- package/src/routes/-installations-search.ts +25 -12
- package/src/routes/__root.tsx +6 -16
- package/src/routes/index.tsx +21 -81
- package/src/routes/insights.tsx +52 -105
- package/src/routes/installations.tsx +290 -138
- package/src/styles.css +6 -0
- package/.output/public/assets/BundleIdDisplay-D4ErdU5_.js +0 -1
- package/.output/public/assets/InsightsCapabilityContext-B42VqvP6.js +0 -1
- package/.output/public/assets/api-keys-api-DGVTTvTJ.js +0 -1
- package/.output/public/assets/api-keys-z16OZIP4.js +0 -1
- package/.output/public/assets/badge-Br_KDO0J.js +0 -1
- package/.output/public/assets/card-DzuEXvyJ.js +0 -1
- package/.output/public/assets/dialog-BeAENgez.js +0 -1
- package/.output/public/assets/dist-Bssh_cv0.js +0 -1
- package/.output/public/assets/field-Buq148-A.js +0 -1
- package/.output/public/assets/index-uOpQAIC4.js +0 -10
- package/.output/public/assets/input-group-B3p5UpyW.js +0 -1
- package/.output/public/assets/insights-DJTr7Ozn.js +0 -1
- package/.output/public/assets/insights-api-DVMOoRMS.js +0 -1
- package/.output/public/assets/installations-BY64iIAK.js +0 -2
- package/.output/public/assets/installations-D5v9i3AL.js +0 -1
- package/.output/public/assets/lazyRouteComponent-DKYu5cZJ.js +0 -1
- package/.output/public/assets/routes-C8fvgETO.js +0 -1
- package/.output/public/assets/search-qsIDvS2I.js +0 -1
- package/.output/public/assets/signing-mJD88Y4C.js +0 -1
- package/.output/public/assets/styles-BZIG7t42.css +0 -2
- package/.output/public/assets/table-RamFEclP.js +0 -1
- package/.output/public/assets/useCompositeListItem-ChzDqdpc.js +0 -42
- package/.output/public/assets/useMutation-JsGVjQMY.js +0 -1
- package/.output/public/assets/useOpenInteractionType-Dwfy-SpA.js +0 -1
- package/.output/server/_ssr/BundleActivityChart-CWcdPuUn.mjs +0 -288
- package/.output/server/_ssr/BundleIdDisplay-BEvB3MvA.mjs +0 -13
- package/.output/server/_ssr/InsightsCapabilityContext-Cx8fjm2s.mjs +0 -15
- package/.output/server/_ssr/badge-CpWXQwyF.mjs +0 -26
- package/.output/server/_ssr/input-group-etIsBUqv.mjs +0 -288
- package/.output/server/_ssr/insights-api-C1F7UreR.mjs +0 -71
- package/.output/server/_ssr/insights-input-9fEJF-ZG.mjs +0 -96
- package/.output/server/_ssr/insights-rpc-C-8R6kED.mjs +0 -155
- package/.output/server/_ssr/insights-ygT_aIfo.mjs +0 -858
- package/.output/server/_ssr/installations-DqRT1QTd.mjs +0 -535
- package/.output/server/_ssr/installations-K8TCYTYh.mjs +0 -19
- package/.output/server/_ssr/runtime.server-la7TRAH_.mjs +0 -527
- package/.output/server/_ssr/table-CU58HeI7.mjs +0 -53
- package/.output/server/_tanstack-start-manifest_v-Mz9MmSlD.mjs +0 -103
- package/src/components/features/bundles/BundleActivityChart.tsx +0 -193
- package/src/components/features/bundles/BundleInsightsSummary.tsx +0 -123
- package/src/components/features/insights/ActivityChart.tsx +0 -150
- package/src/components/features/insights/BundleDistribution.tsx +0 -133
- package/src/components/features/insights/BundleSelector.tsx +0 -114
- package/src/components/features/insights/InsightsCapabilityContext.tsx +0 -24
- package/src/components/features/insights/InstallationPagination.tsx +0 -48
- package/src/components/features/insights/InstallationSearch.tsx +0 -230
- package/src/components/features/insights/UpdateOutcomes.tsx +0 -147
- package/src/lib/insights-error.ts +0 -19
- package/src/lib/insights-input.ts +0 -187
- package/src/lib/insights-overview.ts +0 -170
- package/src/lib/server/releaseActivity.ts +0 -27
- /package/.output/public/assets/{preload-helper-CQ36nxok.js → preload-helper-B_l5jfgx.js} +0 -0
package/.output/nitro.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Gn as e,Kn as t,Or as n,Qn as r,_ as i,g as a,jr as o,xn as s,y as c}from"./createServerFn-DHc2erub.js";import{p as l}from"./table-bpgpQkPz.js";import{n as u}from"./dist-BPrb_vuw.js";import{c as d,d as f,s as p,u as m}from"./card-iD7iiy4T.js";var h=t(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),g=t(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),_=t(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),v=t(`package-check`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 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.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),y=t(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),b=o(n(),1),x=r(),S=(e,t=12)=>e.length>t?`${e.slice(0,Math.max(1,t-4))}…${e.slice(-4)}`:e;function C({value:e,maxLength:t=12,className:n,buttonClassName:r}){let o=e.length>t,l=S(e,t),d=async()=>{try{await navigator.clipboard.writeText(e),u.success(`Copied to clipboard`,{description:e})}catch{u.error(`Failed to copy value`)}},f=e=>{e.preventDefault(),e.stopPropagation(),d()},p=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),d())},m=(0,x.jsx)(`span`,{translate:`no`,className:s(`font-mono text-xs tabular-nums whitespace-nowrap`,n),children:l});return(0,x.jsxs)(a,{children:[(0,x.jsx)(c,{render:(0,x.jsx)(`button`,{type:`button`,"aria-label":`Copy full value: ${e}`,translate:`no`,className:s(`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`,!o&&`cursor-copy`,r),onClick:f,onKeyDown:p}),children:m}),(0,x.jsx)(i,{hidden:!o,children:(0,x.jsx)(`p`,{translate:`no`,className:`break-all font-mono text-xs tabular-nums`,children:e})})]})}var w={UPDATE_APPLIED:{label:`Bundle applied`,variant:`success`,icon:l},RECOVERED:{label:`Recovered`,variant:`warning`,icon:y},RELEASE_ADOPTED:{label:`Bundle adopted`,variant:`success`,icon:v},UNCHANGED:{label:`Activity reported`,variant:`secondary`,icon:h}};function T(){let[e,t]=(0,b.useState)(`UTC`);return(0,b.useEffect)(()=>{t(Intl.DateTimeFormat().resolvedOptions().timeZone)},[]),new Intl.DateTimeFormat(`en`,{timeZone:e,timeZoneName:`shortOffset`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`})}function E(e,t){let n=Object.fromEntries(t.formatToParts(new Date(e)).map(({type:e,value:t})=>[e,t])),r=n.timeZoneName===`GMT`?`GMT+0`:n.timeZoneName;return`${n.year}/${n.month}/${n.day} ${n.hour}:${n.minute}:${n.second} ${r}`}function D({value:e,formatter:t,touch:n=!1}){let r=new Date(e),i=E(e,t);return(0,x.jsxs)(`details`,{className:`group/time`,children:[(0,x.jsx)(`summary`,{className:`cursor-pointer list-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-details-marker]:hidden ${n?`flex min-h-11 items-center`:``}`,children:(0,x.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(`time`,{dateTime:r.toISOString(),className:`whitespace-nowrap`,children:i}),(0,x.jsx)(_,{"aria-hidden":`true`,className:`size-3 text-muted-foreground group-open/time:rotate-180`})]})}),(0,x.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:r.toISOString().replace(`T`,` `).replace(`Z`,` UTC`)})]})}function O({type:e}){let t=w[e],n=t.icon;return(0,x.jsxs)(p,{variant:t.variant,className:`gap-1 whitespace-nowrap [&_svg]:size-3`,title:e===`UNCHANGED`?`App activity reported on the current bundle without a bundle transition.`:e===`RELEASE_ADOPTED`?`A different release was adopted without changing the bundle.`:void 0,children:[(0,x.jsx)(n,{"aria-hidden":`true`}),t.label]})}function k({event:e,touch:t=!1}){return(0,x.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-2`,children:[e.fromBundleId?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:`From`}),(0,x.jsx)(`dd`,{children:(0,x.jsx)(C,{value:e.fromBundleId,buttonClassName:t?`min-h-11 px-3`:void 0})})]}):null,(0,x.jsx)(`dt`,{className:`text-muted-foreground`,children:e.type===`UNCHANGED`?`Current`:`To`}),(0,x.jsx)(`dd`,{children:(0,x.jsx)(C,{value:e.toBundleId,buttonClassName:t?`min-h-11 px-3`:void 0})})]})}function A({fallbackTitle:t}){return(0,x.jsxs)(d,{variant:`destructive`,children:[(0,x.jsx)(e,{"aria-hidden":`true`}),(0,x.jsx)(f,{children:t}),(0,x.jsx)(m,{children:`Refresh to try again. If this keeps happening, check your Insights provider connection.`})]})}export{T as a,y as c,O as i,_ as l,k as n,C as o,D as r,S as s,A as t,g as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Qn as e,Yn as t,bn as n,gn as r,m as i,t as a,vr as o,yn as s}from"./createServerFn-DHc2erub.js";import{t as c}from"./link-BG06whwB.js";import{a as l,i as u,n as d,o as f,r as p,t as m,u as h}from"./InsightsErrorAlert-1cg6LDJG.js";import{t as g}from"./chart-no-axes-combined-C0G0fQ3J.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./table-bpgpQkPz.js";import{t as C}from"./refresh-cw-DZgiAOMk.js";import{a as w,n as T,o as E,t as D}from"./card-iD7iiy4T.js";var O=a({method:`GET`}).handler(o(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`)),k=a({method:`GET`}).handler(o(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),A=a({method:`GET`}).handler(o(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),j=a({method:`GET`}).handler(o(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),M=a({method:`GET`}).handler(o(`735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1`)),N=3e4,P={reportingInstallations:e=>[`insights`,`reporting-installations`,e],events:e=>[`insights`,`events`,e],installations:e=>[`insights`,`installations`,e],installation:e=>[`insights`,`installation`,e],installationEvents:e=>[`insights`,`installation-events`,e]},F=e=>t({queryKey:P.reportingInstallations(e),queryFn:()=>O({data:e}),refetchOnWindowFocus:!0,staleTime:N}),I=(e,n)=>t({queryKey:P.events(e),queryFn:()=>k({data:e}),enabled:n,refetchOnWindowFocus:!0,staleTime:N}),L=(e,n)=>t({queryKey:P.installations(e),queryFn:()=>M({data:e}),enabled:n&&e.identity.length>0,staleTime:N}),R=(e,n)=>t({queryKey:P.installation(e),queryFn:()=>j({data:{installId:e}}),enabled:n&&e.length>0,staleTime:N}),z=(e,n)=>t({queryKey:P.installationEvents(e),queryFn:()=>A({data:e}),enabled:n&&e.installId.length>0,refetchOnWindowFocus:!0,staleTime:N}),B=e();function V({events:e,formatter:t,renderIdentity:n}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,B.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,B.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,B.jsx)(u,{type:e.type}),(0,B.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,B.jsx)(p,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,B.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,B.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,B.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,B.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,B.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,B.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,B.jsx)(d,{event:e,touch:!0})})]},e.id))})]})}function H({hasPrevious:e,label:t,nextCursor:n,onNext:r,onPrevious:i,pageLength:a,pageNumber:o}){return(0,B.jsxs)(`nav`,{"aria-label":`${t} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,B.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,o,` · `,a.toLocaleString(),` rows`]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(s,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,B.jsx)(s,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:n===null,onClick:r,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}function U({event:e,eventsLocation:t,touch:r=!1}){return(0,B.jsxs)(`div`,{className:r?`flex min-w-0 flex-wrap items-center justify-between gap-2`:`flex min-w-0 flex-col items-start gap-2`,children:[(0,B.jsxs)(c,{className:n({className:r?`-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm`:`-ml-2 max-w-full justify-start`,size:`sm`,variant:`ghost`}),to:`/installations`,search:{...t,query:e.installId||void 0,installId:e.installId},"aria-label":`View history for ${e.userId??e.username??`anonymous installation`} (${e.installId})`,children:[(0,B.jsx)(`span`,{className:r?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??e.username??`Anonymous installation`}),(0,B.jsx)(h,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,B.jsx)(f,{value:e.installId,maxLength:13,buttonClassName:r?`min-h-11 px-3`:void 0})]})}function W({children:e,error:t,eventsLocation:n,history:i,isFetching:a,isLoading:o,onNext:c,onPrevious:f,onRefresh:h,pageNumber:g,title:O=`All events`}){let k=l(),A=g>1;return(0,B.jsxs)(D,{className:`@container min-w-0 shadow-sm`,"aria-busy":a,children:[(0,B.jsxs)(w,{className:`gap-4 p-4 sm:p-6`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(E,{children:(0,B.jsx)(`h2`,{children:O})}),(0,B.jsxs)(s,{className:`h-11 lg:h-8`,disabled:a,onClick:h,size:`lg`,variant:`outline`,children:[(0,B.jsx)(C,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]}),e]}),(0,B.jsx)(T,{className:`min-w-0 p-0`,children:o?(0,B.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,B.jsx)(r,{className:`h-12 w-full`}),(0,B.jsx)(r,{className:`h-12 w-full`}),(0,B.jsx)(r,{className:`h-12 w-full`})]}):t?(0,B.jsx)(`div`,{className:`px-6 pb-6`,children:(0,B.jsx)(m,{error:t,fallbackTitle:`Event history unavailable`})}):i?(0,B.jsxs)(B.Fragment,{children:[i.data.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,B.jsx)(V,{events:i.data,formatter:k,renderIdentity:e=>(0,B.jsx)(U,{event:e,eventsLocation:n,touch:!0})})}),(0,B.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,B.jsxs)(S,{className:`min-w-4xl table-fixed`,children:[(0,B.jsx)(_,{children:(0,B.jsxs)(b,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,B.jsx)(v,{className:`w-64`,children:`Time`}),(0,B.jsx)(v,{className:`w-48`,children:`Event`}),(0,B.jsx)(v,{className:`w-48`,children:`User / installation`}),(0,B.jsx)(v,{className:`w-32`,children:`App`}),(0,B.jsx)(v,{className:`w-52`,children:`Bundle`})]})}),(0,B.jsx)(y,{children:i.data.map(e=>(0,B.jsxs)(b,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,B.jsx)(x,{className:`whitespace-normal text-xs tabular-nums`,children:(0,B.jsx)(p,{value:e.receivedAtMs,formatter:k})}),(0,B.jsx)(x,{children:(0,B.jsx)(u,{type:e.type})}),(0,B.jsx)(x,{children:(0,B.jsx)(U,{event:e,eventsLocation:n})}),(0,B.jsx)(x,{className:`whitespace-normal text-xs`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,B.jsx)(x,{className:`whitespace-normal text-xs`,children:(0,B.jsx)(d,{event:e})})]},e.id))})]})})]}):(0,B.jsx)(`div`,{className:`px-6 pb-6 text-sm text-muted-foreground`,children:A||i.nextCursor?`No events on this page`:O===`All events`?`No events recorded yet`:`No matching reports in this period`}),i.data.length>0||A||i.nextCursor?(0,B.jsx)(H,{hasPrevious:A,label:O,nextCursor:i.nextCursor,onNext:c,onPrevious:f,pageLength:i.data.length,pageNumber:g}):null]}):null})]})}function G({view:e}){return(0,B.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-3 border-b bg-background px-3 py-3 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,B.jsx)(i,{className:`-ml-1 size-11 lg:size-7`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(g,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,B.jsx)(`h1`,{className:`text-sm font-medium`,children:`Insights`})]}),(0,B.jsxs)(`nav`,{"aria-label":`Insights views`,className:`ml-auto flex gap-1`,children:[(0,B.jsx)(c,{"aria-current":e===`overview`?`page`:void 0,className:n({className:`h-11 px-3 lg:h-8 lg:px-2.5`,size:`lg`,variant:e===`overview`?`secondary`:`ghost`}),to:`/insights`,children:`Overview`}),(0,B.jsx)(c,{"aria-current":e===`events`?`page`:void 0,className:n({className:`h-11 px-3 lg:h-8 lg:px-2.5`,size:`lg`,variant:e===`events`?`secondary`:`ghost`}),to:`/installations`,children:`Events`})]})]})}export{I as a,L as c,V as i,F as l,W as n,z as o,H as r,R as s,G as t};
|