@abyss-project/commons-front-core 21.4.5 → 21.5.0

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 (38) hide show
  1. package/dist/{CookieConsentSettings-D6qJrTf0.js → CookieConsentSettings-JnVg_LK2.js} +1 -1
  2. package/dist/{Surface-kJ0pYDPu.js → Surface-BSaVNCQB.js} +144 -92
  3. package/dist/{Tabs-GYqe9875.js → Tabs-DlztwHTB.js} +1 -1
  4. package/dist/components/LinkStatsPanel/LinkStatsPanel.spec.d.ts +1 -0
  5. package/dist/components/LinkStatsPanel/index.d.ts +3 -0
  6. package/dist/components/LinkStatsPanel/link-stats-range.d.ts +10 -0
  7. package/dist/components/LinkStatsPanel/link-stats-range.spec.d.ts +1 -0
  8. package/dist/components/LinkStatsPanel/use-link-stats-by-origin.d.ts +13 -0
  9. package/dist/components/index.d.ts +1 -0
  10. package/dist/cookie-consent.js +2 -2
  11. package/dist/{editors-BKkoTems.js → editors-DtSWARzF.js} +27 -27
  12. package/dist/editors.js +1 -1
  13. package/dist/hooks/use-rich-intl.hook.d.ts +64 -2
  14. package/dist/{index-CHyxyPCF.js → index-3QNmXVou.js} +2 -2
  15. package/dist/{index-CE-2Fzvx.js → index-B27TqeVc.js} +2 -2
  16. package/dist/{index-E3p81Gdb.js → index-B_brfyuS.js} +2 -2
  17. package/dist/{index-DTNTq4T2.js → index-BeM8FRDV.js} +2 -2
  18. package/dist/{index-BHMADiJj.js → index-BhIJ2JLT.js} +3 -3
  19. package/dist/{index-BKC5knIZ.js → index-BypVAuSd.js} +2 -2
  20. package/dist/{index-DBF3n3_7.js → index-CWpn58Dl.js} +2 -2
  21. package/dist/{index-CLiBng7V.js → index-CoHmgDgN.js} +2 -2
  22. package/dist/{index-BISl9uEZ.js → index-CrCFfSgX.js} +2 -2
  23. package/dist/{index-CdwwSewX.js → index-D1hPS3Ao.js} +4 -4
  24. package/dist/{index-BAcsxuQi.js → index-DDykQjHr.js} +2 -2
  25. package/dist/{index-By_tXOX3.js → index-DJwDjPvp.js} +2 -2
  26. package/dist/{index-ElYFRH1k.js → index-DWM_TDWv.js} +4 -4
  27. package/dist/{index-Wxotqkts.js → index-DYr8EuPL.js} +3 -3
  28. package/dist/{index-BzKX2-fH.js → index-DuQKxzT3.js} +2 -2
  29. package/dist/{index-DU_tE0Bf.js → index-H8Fs3-Nw.js} +1 -1
  30. package/dist/{index-B5m1ExnW.js → index-NadodU95.js} +3 -3
  31. package/dist/{index-BeMy09Ia.js → index-PV6fILN2.js} +2 -2
  32. package/dist/{index-DqMALsky.js → index-cHcfvTo0.js} +3 -3
  33. package/dist/{index-BRfww3Me.js → index-ezygrHM0.js} +2 -2
  34. package/dist/{index-CqexA4-e.js → index-vSNwWEdM.js} +4 -4
  35. package/dist/index.js +21121 -19218
  36. package/dist/translations/en.d.ts +32 -1
  37. package/dist/translations/fr.d.ts +32 -1
  38. package/package.json +5 -3
@@ -3,7 +3,7 @@ import { useState as v, useCallback as b, useEffect as T, useLayoutEffect as ie,
3
3
  import w from "@mui/material/Button";
4
4
  import Q from "@mui/material/Switch";
5
5
  import { styled as y } from "@mui/material/styles";
6
- import { T as K, w as O, p as f, d as D, D as N, S as R, a as V, u as M, M as C, b as X, h as ae, c as ce, e as le } from "./Surface-kJ0pYDPu.js";
6
+ import { T as K, w as O, p as f, d as D, D as N, S as R, a as V, u as M, M as C, b as X, h as ae, c as ce, e as le } from "./Surface-BSaVNCQB.js";
7
7
  import { useQuery as de, useMutation as ue } from "@tanstack/react-query";
8
8
  import { AbyssCore as j } from "@abyss-project/main";
9
9
  import { createPortal as fe } from "react-dom";
@@ -1,12 +1,12 @@
1
1
  import { jsx as d, jsxs as C } from "react/jsx-runtime";
2
- import { createContext as ue, useContext as pe, useId as B, useRef as j, useState as V, useCallback as Q, useMemo as me, forwardRef as he } from "react";
2
+ import { createContext as ue, useContext as pe, useId as B, useRef as Y, useState as q, useCallback as Q, useMemo as me, forwardRef as he } from "react";
3
3
  import { useIntl as G } from "react-intl";
4
4
  import ge from "@mui/material/Dialog";
5
5
  import Z from "@mui/material/IconButton";
6
- import { alpha as fe, styled as p, useTheme as ye } from "@mui/material/styles";
6
+ import { alpha as fe, styled as p, useTheme as ve } from "@mui/material/styles";
7
7
  import ee from "@mui/icons-material/Close";
8
- import q from "@mui/material/useMediaQuery";
9
- import ve from "@mui/material/Modal";
8
+ import V from "@mui/material/useMediaQuery";
9
+ import ye from "@mui/material/Modal";
10
10
  import Ae from "@mui/material/Slide";
11
11
  import { enTranslation as be, frTranslation as Ee } from "@abyss-project/main";
12
12
  import { l as te } from "./lazy-value-Co76vxsM.js";
@@ -127,9 +127,9 @@ const re = {
127
127
  }), _e = (e, t, o = "fast") => t.map(
128
128
  (r) => `${r} ${e.design.durations[o]}ms ${e.design.easings.standard}`
129
129
  ).join(", "), Ie = () => {
130
- const e = q(k.up(R.Desktop), {
130
+ const e = V(k.up(R.Desktop), {
131
131
  noSsr: !0
132
- }), t = q(k.down(R.Tablet), {
132
+ }), t = V(k.down(R.Tablet), {
133
133
  noSsr: !0
134
134
  });
135
135
  return e ? R.Desktop : t ? R.Mobile : R.Tablet;
@@ -144,7 +144,7 @@ const D = (e, t) => `calc(${a(t)} + env(safe-area-inset-${e}))`, we = 0.3, De =
144
144
  display: "flex",
145
145
  outline: "none"
146
146
  }), ke = p("div")(({ theme: e }) => {
147
- const { tokens: t, radii: o, space: r, elevations: i, fonts: n } = e.design;
147
+ const { tokens: t, radii: o, space: r, elevations: i, fonts: s } = e.design;
148
148
  return {
149
149
  flex: "1 1 auto",
150
150
  minWidth: 0,
@@ -158,7 +158,7 @@ const D = (e, t) => `calc(${a(t)} + env(safe-area-inset-${e}))`, we = 0.3, De =
158
158
  paddingRight: D(I.Right, r[4]),
159
159
  backgroundColor: t["bg.surface"],
160
160
  color: t["text.primary"],
161
- fontFamily: n.sans,
161
+ fontFamily: s.sans,
162
162
  borderTop: L(t["border.strong"]),
163
163
  borderTopLeftRadius: a(o.lg),
164
164
  borderTopRightRadius: a(o.lg),
@@ -224,29 +224,29 @@ function ze({
224
224
  title: o,
225
225
  titleIcon: r,
226
226
  closeLabel: i,
227
- footer: n,
228
- children: v
227
+ footer: s,
228
+ children: y
229
229
  }) {
230
- const y = ye(), A = G(), f = B(), T = j(null), m = j(null), [N, u] = V(0), [l, s] = V(!1), h = (S) => {
231
- S.currentTarget.setPointerCapture(S.pointerId), m.current = S.clientY, s(!0);
230
+ const v = ve(), A = G(), f = B(), T = Y(null), m = Y(null), [N, u] = q(0), [l, n] = q(!1), h = (S) => {
231
+ S.currentTarget.setPointerCapture(S.pointerId), m.current = S.clientY, n(!0);
232
232
  }, b = (S) => {
233
233
  m.current !== null && u(Math.max(0, S.clientY - m.current));
234
234
  }, E = (S) => {
235
- var Y;
235
+ var j;
236
236
  if (m.current === null)
237
237
  return;
238
- const de = Math.max(0, S.clientY - m.current), z = ((Y = T.current) == null ? void 0 : Y.getBoundingClientRect().height) ?? 0;
239
- m.current = null, s(!1), u(0), z > 0 && de >= z * we && t();
238
+ const de = Math.max(0, S.clientY - m.current), z = ((j = T.current) == null ? void 0 : j.getBoundingClientRect().height) ?? 0;
239
+ m.current = null, n(!1), u(0), z > 0 && de >= z * we && t();
240
240
  }, _ = () => {
241
- m.current = null, s(!1), u(0);
241
+ m.current = null, n(!1), u(0);
242
242
  };
243
- return /* @__PURE__ */ d(ve, { open: e, onClose: () => t(), children: /* @__PURE__ */ d(
243
+ return /* @__PURE__ */ d(ye, { open: e, onClose: () => t(), children: /* @__PURE__ */ d(
244
244
  Ae,
245
245
  {
246
246
  in: e,
247
247
  direction: "up",
248
- timeout: y.design.durations.slow,
249
- easing: y.design.easings.sheet,
248
+ timeout: v.design.durations.slow,
249
+ easing: v.design.easings.sheet,
250
250
  children: /* @__PURE__ */ d(Le, { children: /* @__PURE__ */ C(
251
251
  ke,
252
252
  {
@@ -261,7 +261,7 @@ function ze({
261
261
  // `position: fixed` inside it (the cookie banner hosted by the sheet), and would anchor it to
262
262
  // the panel instead of the viewport.
263
263
  transform: N === 0 && !l ? "none" : `translateY(${a(N)})`,
264
- transition: l ? "none" : `transform ${y.design.durations.base}ms ${y.design.easings.sheet}`
264
+ transition: l ? "none" : `transform ${v.design.durations.base}ms ${v.design.easings.sheet}`
265
265
  },
266
266
  children: [
267
267
  /* @__PURE__ */ C(
@@ -282,17 +282,17 @@ function ze({
282
282
  }
283
283
  ),
284
284
  i !== void 0 && /* @__PURE__ */ d(Pe, { "aria-label": i, onClick: () => t(), children: /* @__PURE__ */ d(ee, { "aria-hidden": !0 }) }),
285
- /* @__PURE__ */ d(Be, { children: v }),
286
- n !== void 0 && /* @__PURE__ */ d(Ge, { children: n })
285
+ /* @__PURE__ */ d(Be, { children: y }),
286
+ s !== void 0 && /* @__PURE__ */ d(Ge, { children: s })
287
287
  ]
288
288
  }
289
289
  ) })
290
290
  }
291
291
  ) });
292
292
  }
293
- const Bt = "--abyss-toast-clearance", Gt = "--abyss-cookie-banner-modal-clearance", zt = "--abyss-toast-dialog-foot-clearance", Ye = "data-abyss-dialog-foot";
294
- var je = /* @__PURE__ */ ((e) => (e.Small = "sm", e.Medium = "md", e.Large = "lg", e))(je || {});
295
- const Ve = p(ge)(({ theme: e }) => {
293
+ const Bt = "--abyss-toast-clearance", Gt = "--abyss-cookie-banner-modal-clearance", zt = "--abyss-toast-dialog-foot-clearance", je = "data-abyss-dialog-foot";
294
+ var Ye = /* @__PURE__ */ ((e) => (e.Small = "sm", e.Medium = "md", e.Large = "lg", e))(Ye || {});
295
+ const qe = p(ge)(({ theme: e }) => {
296
296
  const { tokens: t, fonts: o, space: r } = e.design;
297
297
  return {
298
298
  "& .MuiDialog-paper": {
@@ -307,7 +307,7 @@ const Ve = p(ge)(({ theme: e }) => {
307
307
  width: `calc(100% - ${a(r[7])})`
308
308
  }
309
309
  };
310
- }), qe = p("div")(({ theme: e }) => {
310
+ }), Ve = p("div")(({ theme: e }) => {
311
311
  const { tokens: t, space: o } = e.design;
312
312
  return {
313
313
  flex: "none",
@@ -370,15 +370,15 @@ const Ve = p(ge)(({ theme: e }) => {
370
370
  // stacks them, each growing to the full width.
371
371
  "& > *": { flex: "1 1 auto", minWidth: "fit-content" }
372
372
  }));
373
- function Yt({
373
+ function jt({
374
374
  open: e,
375
375
  onClose: t,
376
376
  title: o,
377
377
  titleIcon: r,
378
378
  description: i,
379
- size: n = "md",
380
- actions: v,
381
- children: y
379
+ size: s = "md",
380
+ actions: y,
381
+ children: v
382
382
  }) {
383
383
  const A = G(), f = Ie() === R.Mobile, T = B(), m = B();
384
384
  return f ? /* @__PURE__ */ C(
@@ -389,23 +389,23 @@ function Yt({
389
389
  title: o,
390
390
  titleIcon: r,
391
391
  closeLabel: A.formatMessage({ id: "ds.layers.modal.close" }),
392
- footer: v !== void 0 ? /* @__PURE__ */ d(et, { [Ye]: "", children: v }) : void 0,
392
+ footer: y !== void 0 ? /* @__PURE__ */ d(et, { [je]: "", children: y }) : void 0,
393
393
  children: [
394
394
  i !== void 0 && /* @__PURE__ */ d(Ze, { children: i }),
395
- y
395
+ v
396
396
  ]
397
397
  }
398
398
  ) : /* @__PURE__ */ C(
399
- Ve,
399
+ qe,
400
400
  {
401
401
  open: e,
402
402
  onClose: () => t(),
403
- maxWidth: n,
403
+ maxWidth: s,
404
404
  fullWidth: !0,
405
405
  "aria-labelledby": T,
406
406
  "aria-describedby": i !== void 0 ? m : void 0,
407
407
  children: [
408
- /* @__PURE__ */ C(qe, { children: [
408
+ /* @__PURE__ */ C(Ve, { children: [
409
409
  /* @__PURE__ */ C(We, { children: [
410
410
  r !== void 0 && /* @__PURE__ */ d(Ke, { "aria-hidden": "true", children: r }),
411
411
  /* @__PURE__ */ C(He, { children: [
@@ -422,8 +422,8 @@ function Yt({
422
422
  }
423
423
  )
424
424
  ] }),
425
- /* @__PURE__ */ d($e, { children: y }),
426
- v !== void 0 && /* @__PURE__ */ d(Qe, { children: v })
425
+ /* @__PURE__ */ d($e, { children: v }),
426
+ y !== void 0 && /* @__PURE__ */ d(Qe, { children: y })
427
427
  ]
428
428
  }
429
429
  );
@@ -564,8 +564,8 @@ const W = (e) => e, ie = {
564
564
  BANKING_SYSTEM_RESNAPSHOTS_MONTH: "System resnapshots / month"
565
565
  })
566
566
  };
567
- var ae = /* @__PURE__ */ ((e) => (e.DRAW = "draw", e.BOARD = "board", e.ATLAS = "atlas", e.RETROSPECTIVE = "retrospective", e.SHORT_LINK = "short_link", e.SPACE = "SPACE", e.FOLDER = "FOLDER", e.FILE = "FILE", e.CLOUD_FOLDER = "cloud_folder", e.CLOUD_GALLERY = "cloud_gallery", e.FORM = "form", e.SPOTLIGHT_PROJECT = "spotlight_project", e.EVENT = "event", e.REPORT = "report", e.BANKING_ORG = "banking_org", e.ASSET = "asset", e.WRAPPED_REPORT = "wrapped_report", e.DAILY_DIGEST = "daily_digest", e.ANALYTICS_SNAPSHOT = "analytics_snapshot", e.BANKING_VIEW_ACCOUNT = "banking_view_account", e.EXTRACTION_FILE = "extraction_file", e.EXTRACTION_TEMPLATE = "extraction_template", e.EXTRACTION_RESULT = "extraction_result", e.BEAM = "beam", e.BANKING_SCORE_SHARE_SET = "banking_score_share_set", e))(ae || {}), ne = /* @__PURE__ */ ((e) => (e.VIEW = "VIEW", e.EDIT = "EDIT", e.MANAGE = "MANAGE", e))(ne || {});
568
- const tt = (e) => e.toLowerCase().replace(/_/g, "-"), jt = Object.values(ae).map(tt), Vt = (e) => typeof e == "string" && Object.values(ne).includes(e) ? e : "unknown", K = (e) => e, P = {
567
+ var ae = /* @__PURE__ */ ((e) => (e.DRAW = "draw", e.BOARD = "board", e.ATLAS = "atlas", e.RETROSPECTIVE = "retrospective", e.SHORT_LINK = "short_link", e.SPACE = "SPACE", e.FOLDER = "FOLDER", e.FILE = "FILE", e.CLOUD_FOLDER = "cloud_folder", e.CLOUD_GALLERY = "cloud_gallery", e.FORM = "form", e.SPOTLIGHT_PROJECT = "spotlight_project", e.EVENT = "event", e.REPORT = "report", e.BANKING_ORG = "banking_org", e.ASSET = "asset", e.WRAPPED_REPORT = "wrapped_report", e.DAILY_DIGEST = "daily_digest", e.ANALYTICS_SNAPSHOT = "analytics_snapshot", e.BANKING_VIEW_ACCOUNT = "banking_view_account", e.EXTRACTION_FILE = "extraction_file", e.EXTRACTION_TEMPLATE = "extraction_template", e.EXTRACTION_RESULT = "extraction_result", e.BEAM = "beam", e.BANKING_SCORE_SHARE_SET = "banking_score_share_set", e))(ae || {}), se = /* @__PURE__ */ ((e) => (e.VIEW = "VIEW", e.EDIT = "EDIT", e.MANAGE = "MANAGE", e))(se || {});
568
+ const tt = (e) => e.toLowerCase().replace(/_/g, "-"), Yt = Object.values(ae).map(tt), qt = (e) => typeof e == "string" && Object.values(se).includes(e) ? e : "unknown", K = (e) => e, P = {
569
569
  fr: K({
570
570
  labels: {
571
571
  draw: "un dessin",
@@ -628,7 +628,7 @@ const tt = (e) => e.toLowerCase().replace(/_/g, "-"), jt = Object.values(ae).map
628
628
  },
629
629
  withName: '{label} "{name}"'
630
630
  })
631
- }, X = (e) => e, se = {
631
+ }, X = (e) => e, ne = {
632
632
  fr: X({
633
633
  VIEW: "accès en lecture",
634
634
  EDIT: "accès en édition",
@@ -648,18 +648,18 @@ const ot = {
648
648
  [w.DEFAULT]: "paid",
649
649
  [w.SYSTEM]: O.INTERNAL,
650
650
  [w.CUSTOM]: O.CUSTOM
651
- }, rt = new Set(Object.values(O)), U = (e) => e ? e.tier === w.CUSTOM ? O.CUSTOM : e.catalogKey && rt.has(e.catalogKey) ? e.catalogKey : ot[e.tier] ?? "paid" : O.FREEMIUM, qt = (e, t) => {
652
- const o = (y) => {
653
- const A = e[`${y}Tier`];
651
+ }, rt = new Set(Object.values(O)), U = (e) => e ? e.tier === w.CUSTOM ? O.CUSTOM : e.catalogKey && rt.has(e.catalogKey) ? e.catalogKey : ot[e.tier] ?? "paid" : O.FREEMIUM, Vt = (e, t) => {
652
+ const o = (v) => {
653
+ const A = e[`${v}Tier`];
654
654
  if (typeof A != "string")
655
655
  return null;
656
- const f = e[`${y}CatalogKey`];
656
+ const f = e[`${v}CatalogKey`];
657
657
  return {
658
658
  tier: A,
659
659
  catalogKey: typeof f == "string" ? f : null
660
660
  };
661
- }, r = {}, i = o("plan"), n = o("oldPlan"), v = o("newPlan");
662
- return i && (r.planName = t(U(i))), n && (r.oldPlanName = t(U(n))), v && (r.newPlanName = t(U(v))), r;
661
+ }, r = {}, i = o("plan"), s = o("oldPlan"), y = o("newPlan");
662
+ return i && (r.planName = t(U(i))), s && (r.oldPlanName = t(U(s))), y && (r.newPlanName = t(U(y))), r;
663
663
  }, J = (e) => e, g = {
664
664
  fr: J({
665
665
  freemium: "Gratuit",
@@ -1093,7 +1093,7 @@ const ot = {
1093
1093
  label: P.fr.labels,
1094
1094
  "label-with-name": P.fr.withName,
1095
1095
  // Same entry, same shape: `content-share.permission.<value>`, `unknown` for any other (#834).
1096
- permission: se.fr
1096
+ permission: ne.fr
1097
1097
  },
1098
1098
  "pending-invitations": {
1099
1099
  label: "Invitations en attente",
@@ -1109,6 +1109,32 @@ const ot = {
1109
1109
  "group-own": "Projets de l'organisation",
1110
1110
  "group-shared": "Projets partagés avec vous"
1111
1111
  },
1112
+ "link-stats": {
1113
+ title: "Ouvertures de l’adresse courte",
1114
+ "period-default": "Sur les 30 derniers jours",
1115
+ "period-since": "Depuis le {date}",
1116
+ visits: {
1117
+ label: "Ouvertures"
1118
+ },
1119
+ "unique-visitors": {
1120
+ label: "Visiteurs uniques par jour",
1121
+ subtext: "Somme des visiteurs distincts de chaque jour"
1122
+ },
1123
+ "last-visit": {
1124
+ subtext: "Dernière ouverture : {elapsed}",
1125
+ never: "Dernière ouverture : jamais"
1126
+ },
1127
+ "no-address": {
1128
+ title: "Pas encore d’adresse courte",
1129
+ description: "L’adresse courte de cette ressource n’a pas encore été créée. Ses ouvertures apparaîtront ici."
1130
+ },
1131
+ "no-visits": {
1132
+ title: "Aucune ouverture sur la période",
1133
+ description: "Personne n’a encore ouvert l’adresse courte. Partagez-la pour voir ses ouvertures ici."
1134
+ },
1135
+ forbidden: "Les statistiques s’ouvrent à partir du droit de modification sur cette ressource.",
1136
+ error: "Les statistiques de l’adresse courte n’ont pas pu être chargées."
1137
+ },
1112
1138
  "no-subscription": "Aucun abonnement",
1113
1139
  "user-settings": {
1114
1140
  profile: {
@@ -3089,7 +3115,7 @@ const ot = {
3089
3115
  show: "Afficher le mot de passe",
3090
3116
  hide: "Masquer le mot de passe"
3091
3117
  }
3092
- }, nt = {
3118
+ }, st = {
3093
3119
  banner: {
3094
3120
  title: "Demo account",
3095
3121
  summary: "{label} · expires on {date}",
@@ -3104,8 +3130,8 @@ const ot = {
3104
3130
  }
3105
3131
  },
3106
3132
  blocked: "Unavailable in demo"
3107
- }, st = {
3108
- demo: nt,
3133
+ }, nt = {
3134
+ demo: st,
3109
3135
  "space-display-name": {
3110
3136
  personal: "My Cloud",
3111
3137
  "perso-in-org": "My Cloud (in org)",
@@ -3497,7 +3523,7 @@ const ot = {
3497
3523
  label: P.en.labels,
3498
3524
  "label-with-name": P.en.withName,
3499
3525
  // Same entry, same shape: `content-share.permission.<value>`, `unknown` for any other (#834).
3500
- permission: se.en
3526
+ permission: ne.en
3501
3527
  },
3502
3528
  "pending-invitations": {
3503
3529
  label: "Pending invitations",
@@ -3513,6 +3539,32 @@ const ot = {
3513
3539
  "group-own": "Organization projects",
3514
3540
  "group-shared": "Projects shared with you"
3515
3541
  },
3542
+ "link-stats": {
3543
+ title: "Short address openings",
3544
+ "period-default": "Over the last 30 days",
3545
+ "period-since": "Since {date}",
3546
+ visits: {
3547
+ label: "Openings"
3548
+ },
3549
+ "unique-visitors": {
3550
+ label: "Unique visitors per day",
3551
+ subtext: "Sum of each day’s distinct visitors"
3552
+ },
3553
+ "last-visit": {
3554
+ subtext: "Last opening: {elapsed}",
3555
+ never: "Last opening: never"
3556
+ },
3557
+ "no-address": {
3558
+ title: "No short address yet",
3559
+ description: "The short address of this resource has not been created yet. Its openings will show here."
3560
+ },
3561
+ "no-visits": {
3562
+ title: "No openings over the period",
3563
+ description: "Nobody has opened the short address yet. Share it to see its openings here."
3564
+ },
3565
+ forbidden: "Statistics are available from the edit permission on this resource.",
3566
+ error: "The short address statistics could not be loaded."
3567
+ },
3516
3568
  "no-subscription": "No subscription",
3517
3569
  "user-settings": {
3518
3570
  profile: {
@@ -5504,35 +5556,35 @@ function lt() {
5504
5556
  function t(i) {
5505
5557
  return i;
5506
5558
  }
5507
- function o(i, n) {
5508
- n = n || {};
5509
- const v = n.delimiter || ".", y = n.maxDepth, A = n.transformKey || t, f = {};
5559
+ function o(i, s) {
5560
+ s = s || {};
5561
+ const y = s.delimiter || ".", v = s.maxDepth, A = s.transformKey || t, f = {};
5510
5562
  function T(m, N, u) {
5511
5563
  u = u || 1, Object.keys(m).forEach(function(l) {
5512
- const s = m[l], h = n.safe && Array.isArray(s), b = Object.prototype.toString.call(s), E = e(s), _ = b === "[object Object]" || b === "[object Array]", S = N ? N + v + A(l) : A(l);
5513
- if (!h && !E && _ && Object.keys(s).length && (!n.maxDepth || u < y))
5514
- return T(s, S, u + 1);
5515
- f[S] = s;
5564
+ const n = m[l], h = s.safe && Array.isArray(n), b = Object.prototype.toString.call(n), E = e(n), _ = b === "[object Object]" || b === "[object Array]", S = N ? N + y + A(l) : A(l);
5565
+ if (!h && !E && _ && Object.keys(n).length && (!s.maxDepth || u < v))
5566
+ return T(n, S, u + 1);
5567
+ f[S] = n;
5516
5568
  });
5517
5569
  }
5518
5570
  return T(i), f;
5519
5571
  }
5520
- function r(i, n) {
5521
- n = n || {};
5522
- const v = n.delimiter || ".", y = n.overwrite || !1, A = n.transformKey || t, f = {};
5572
+ function r(i, s) {
5573
+ s = s || {};
5574
+ const y = s.delimiter || ".", v = s.overwrite || !1, A = s.transformKey || t, f = {};
5523
5575
  if (e(i) || Object.prototype.toString.call(i) !== "[object Object]")
5524
5576
  return i;
5525
5577
  function m(l) {
5526
- const s = Number(l);
5527
- return isNaN(s) || l.indexOf(".") !== -1 || n.object ? l : s;
5578
+ const n = Number(l);
5579
+ return isNaN(n) || l.indexOf(".") !== -1 || s.object ? l : n;
5528
5580
  }
5529
- function N(l, s, h) {
5581
+ function N(l, n, h) {
5530
5582
  return Object.keys(h).reduce(function(b, E) {
5531
- return b[l + v + E] = h[E], b;
5532
- }, s);
5583
+ return b[l + y + E] = h[E], b;
5584
+ }, n);
5533
5585
  }
5534
5586
  function u(l) {
5535
- const s = Object.prototype.toString.call(l), h = s === "[object Array]", b = s === "[object Object]";
5587
+ const n = Object.prototype.toString.call(l), h = n === "[object Array]", b = n === "[object Object]";
5536
5588
  if (l) {
5537
5589
  if (h)
5538
5590
  return !l.length;
@@ -5540,25 +5592,25 @@ function lt() {
5540
5592
  return !Object.keys(l).length;
5541
5593
  } else return !0;
5542
5594
  }
5543
- return i = Object.keys(i).reduce(function(l, s) {
5544
- const h = Object.prototype.toString.call(i[s]);
5545
- return !(h === "[object Object]" || h === "[object Array]") || u(i[s]) ? (l[s] = i[s], l) : N(
5546
- s,
5595
+ return i = Object.keys(i).reduce(function(l, n) {
5596
+ const h = Object.prototype.toString.call(i[n]);
5597
+ return !(h === "[object Object]" || h === "[object Array]") || u(i[n]) ? (l[n] = i[n], l) : N(
5598
+ n,
5547
5599
  l,
5548
- o(i[s], n)
5600
+ o(i[n], s)
5549
5601
  );
5550
5602
  }, {}), Object.keys(i).forEach(function(l) {
5551
- const s = l.split(v).map(A);
5552
- let h = m(s.shift()), b = m(s[0]), E = f;
5603
+ const n = l.split(y).map(A);
5604
+ let h = m(n.shift()), b = m(n[0]), E = f;
5553
5605
  for (; b !== void 0; ) {
5554
5606
  if (h === "__proto__")
5555
5607
  return;
5556
5608
  const _ = Object.prototype.toString.call(E[h]), S = _ === "[object Object]" || _ === "[object Array]";
5557
- if (!y && !S && typeof E[h] < "u")
5609
+ if (!v && !S && typeof E[h] < "u")
5558
5610
  return;
5559
- (y && !S || !y && E[h] == null) && (E[h] = typeof b == "number" && !n.object ? [] : {}), E = E[h], s.length > 0 && (h = m(s.shift()), b = m(s[0]));
5611
+ (v && !S || !v && E[h] == null) && (E[h] = typeof b == "number" && !s.object ? [] : {}), E = E[h], n.length > 0 && (h = m(n.shift()), b = m(n[0]));
5560
5612
  }
5561
- E[h] = r(i[l], n);
5613
+ E[h] = r(i[l], s);
5562
5614
  }), f;
5563
5615
  }
5564
5616
  return F;
@@ -5566,7 +5618,7 @@ function lt() {
5566
5618
  var le = lt();
5567
5619
  const ce = {
5568
5620
  fr: { ...at, common: Ee },
5569
- en: { ...st, common: be }
5621
+ en: { ...nt, common: be }
5570
5622
  }, ct = te(
5571
5623
  () => le.flatten(ce.fr)
5572
5624
  ), dt = te(
@@ -5625,9 +5677,9 @@ const ce = {
5625
5677
  padding: o = 4,
5626
5678
  component: r = "div",
5627
5679
  children: i,
5628
- onKeyDown: n,
5629
- role: v,
5630
- tabIndex: y,
5680
+ onKeyDown: s,
5681
+ role: y,
5682
+ tabIndex: v,
5631
5683
  ...A
5632
5684
  }, f) {
5633
5685
  const T = t && typeof r == "string" && !pt.has(r), m = Q(
@@ -5642,10 +5694,10 @@ const ce = {
5642
5694
  ref: m,
5643
5695
  as: r,
5644
5696
  ownerState: { interactive: t, padding: o },
5645
- role: v ?? (T ? "button" : void 0),
5646
- tabIndex: y ?? (T ? 0 : void 0),
5697
+ role: y ?? (T ? "button" : void 0),
5698
+ tabIndex: v ?? (T ? 0 : void 0),
5647
5699
  onKeyDown: (u) => {
5648
- n == null || n(u), T && !u.defaultPrevented && u.target === u.currentTarget && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.currentTarget.click());
5700
+ s == null || s(u), T && !u.defaultPrevented && u.target === u.currentTarget && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.currentTarget.click());
5649
5701
  },
5650
5702
  ...A,
5651
5703
  children: i
@@ -5661,26 +5713,26 @@ export {
5661
5713
  _t as F,
5662
5714
  Mt as G,
5663
5715
  zt as H,
5664
- Ye as I,
5716
+ je as I,
5665
5717
  U as J,
5666
- qt as K,
5667
- Vt as L,
5718
+ Vt as K,
5719
+ qt as L,
5668
5720
  Gt as M,
5669
- jt as N,
5670
- nt as O,
5721
+ Yt as N,
5722
+ st as O,
5671
5723
  it as P,
5672
5724
  kt as Q,
5673
5725
  ce as R,
5674
5726
  I as S,
5675
5727
  Bt as T,
5676
5728
  ut as U,
5677
- st as V,
5729
+ nt as V,
5678
5730
  at as W,
5679
5731
  oe as a,
5680
5732
  Kt as b,
5681
- Yt as c,
5733
+ jt as c,
5682
5734
  k as d,
5683
- je as e,
5735
+ Ye as e,
5684
5736
  Ht as f,
5685
5737
  _e as g,
5686
5738
  L as h,
@@ -8,7 +8,7 @@ import Ja from "@mui/material/Select";
8
8
  import { styled as w, useTheme as Qa, getContrastRatio as Nt } from "@mui/material/styles";
9
9
  import { visuallyHidden as $t } from "@mui/utils";
10
10
  import { useIntl as ge } from "react-intl";
11
- import { p as c, h as me, d as Ce, D as Te, a as ve, t as Wn, s as ct, g as Ne, i as qe, c as qn, e as Hn, j as ei, B as ti } from "./Surface-kJ0pYDPu.js";
11
+ import { p as c, h as me, d as Ce, D as Te, a as ve, t as Wn, s as ct, g as Ne, i as qe, c as qn, e as Hn, j as ei, B as ti } from "./Surface-BSaVNCQB.js";
12
12
  import Oe from "@mui/material/Button";
13
13
  import { byteSizeIEC as ni } from "@abyss-project/main";
14
14
  import ai from "@mui/icons-material/FileUploadOutlined";
@@ -0,0 +1,3 @@
1
+ export { LinkStatsPanel, StatTileGrid, StatTileGridSkeleton, type LinkStatsPanelProps, } from './LinkStatsPanel';
2
+ export { linkStatsFrom } from './link-stats-range';
3
+ export { retryServerFaults, useLinkStatsByOrigin, } from './use-link-stats-by-origin';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Longest period Link's statistics accept (`MAX_LINK_STATS_RANGE_DAYS`, 1 096 days, in the Link
3
+ * API validator), less a day so a period ending at the end of today stays inside it.
4
+ */
5
+ export declare const LINK_STATS_MAX_RANGE_DAYS = 1095;
6
+ /**
7
+ * Start of the period of a resource's statistics: since its creation, within the longest period
8
+ * Link accepts. Pass `now` to freeze the clock; callers memoize the result (it keys the query).
9
+ */
10
+ export declare const linkStatsFrom: (createdAt: string | Date | null | undefined, now?: Date) => Date;
@@ -0,0 +1,13 @@
1
+ import { ILinkOrigin, ILinkStats } from '@abyss-project/link';
2
+ import { UseQueryResult } from '@tanstack/react-query';
3
+ /** HTTP status of a failed SDK call, when the failure came from the API. */
4
+ export declare const httpStatusOf: (error: unknown) => number | undefined;
5
+ /** Retries the network faults and server errors twice, never a refusal or a missing address. */
6
+ export declare const retryServerFaults: (failureCount: number, error: unknown) => boolean;
7
+ /**
8
+ * The statistics of a product resource's AbyssLink address (`sdk.link.getStatsByOrigin`). The
9
+ * API answers 403 below EDIT on the resource and 404 while the resource has no address yet. Without
10
+ * `from`, the period is Link's default: the last 30 days. `from` must keep its identity between
11
+ * renders (memoized by the caller): it is part of the query key.
12
+ */
13
+ export declare const useLinkStatsByOrigin: (origin: ILinkOrigin, from?: Date) => UseQueryResult<ILinkStats, unknown>;
@@ -8,3 +8,4 @@ export * from './navigation';
8
8
  export * from './states';
9
9
  export * from './structure';
10
10
  export * from './ScanStatus';
11
+ export * from './LinkStatsPanel';
@@ -1,5 +1,5 @@
1
- import { A as o, g as a, h as n, e as C, i as t, f as i, j as r, k as A, C as E, b as O, c as S, D as _, R as k, o as I, m as c, l as d, n as N, r as T, p as l, u as f, d as D, a as R, w as V } from "./CookieConsentSettings-D6qJrTf0.js";
2
- import { f as p } from "./Surface-kJ0pYDPu.js";
1
+ import { A as o, g as a, h as n, e as C, i as t, f as i, j as r, k as A, C as E, b as O, c as S, D as _, R as k, o as I, m as c, l as d, n as N, r as T, p as l, u as f, d as D, a as R, w as V } from "./CookieConsentSettings-JnVg_LK2.js";
2
+ import { f as p } from "./Surface-BSaVNCQB.js";
3
3
  export {
4
4
  o as AbyssCookieConsentProvider,
5
5
  a as CONSENT_VALIDITY_DAYS,