@webority/support-react 0.18.0 → 0.19.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.
@@ -74,16 +74,16 @@ function ee(e, t = "/api/support") {
74
74
  }
75
75
  //#endregion
76
76
  //#region src/context.js
77
- var te = e(null);
78
- function B() {
79
- let e = n(te);
77
+ var B = e(null);
78
+ function V() {
79
+ let e = n(B);
80
80
  if (!e) throw Error("Support components and hooks must be used inside <SupportProvider>.");
81
81
  return e;
82
82
  }
83
- function V() {
84
- return B().client;
83
+ function H() {
84
+ return V().client;
85
85
  }
86
- function H(e, n, i = !0) {
86
+ function U(e, n, i = !0) {
87
87
  let [a, c] = s({
88
88
  data: null,
89
89
  loading: i,
@@ -132,8 +132,8 @@ function H(e, n, i = !0) {
132
132
  setData: m
133
133
  };
134
134
  }
135
- function U() {
136
- let { loadConfig: e } = B(), { data: t, loading: n, error: r, reload: i } = H(e, "config");
135
+ function W() {
136
+ let { loadConfig: e } = V(), { data: t, loading: n, error: r, reload: i } = U(e, "config");
137
137
  return {
138
138
  config: t,
139
139
  loading: n,
@@ -141,8 +141,8 @@ function U() {
141
141
  reload: i
142
142
  };
143
143
  }
144
- function ne(e = {}) {
145
- let t = V(), { status: n, search: r, page: i, pageSize: a } = e, { data: o, loading: s, error: c, reload: l } = H(() => t.listTickets({
144
+ function G(e = {}) {
145
+ let t = H(), { status: n, search: r, page: i, pageSize: a } = e, { data: o, loading: s, error: c, reload: l } = U(() => t.listTickets({
146
146
  status: n,
147
147
  search: r,
148
148
  page: i,
@@ -163,8 +163,8 @@ function ne(e = {}) {
163
163
  reload: l
164
164
  };
165
165
  }
166
- function W() {
167
- let e = V(), { data: t, loading: n, error: r, reload: i } = H(() => e.getTicketCounts(), "ticket-counts");
166
+ function K() {
167
+ let e = H(), { data: t, loading: n, error: r, reload: i } = U(() => e.getTicketCounts(), "ticket-counts");
168
168
  return {
169
169
  counts: t,
170
170
  loading: n,
@@ -172,8 +172,8 @@ function W() {
172
172
  reload: i
173
173
  };
174
174
  }
175
- function re(e) {
176
- let n = V(), { data: r, loading: i, error: a, reload: o, setData: s } = H(() => n.getTicket(e), e ?? "", !!e), c = t(async (e) => {
175
+ function q(e) {
176
+ let n = H(), { data: r, loading: i, error: a, reload: o, setData: s } = U(() => n.getTicket(e), e ?? "", !!e), c = t(async (e) => {
177
177
  let t = await e();
178
178
  return s(t), t;
179
179
  }, [s]);
@@ -201,20 +201,36 @@ function re(e) {
201
201
  }
202
202
  //#endregion
203
203
  //#region src/lib/format.js
204
- var ie = new Intl.DateTimeFormat(void 0, {
205
- day: "numeric",
206
- month: "short",
204
+ var te = new Intl.DateTimeFormat("en-IN", {
205
+ day: "2-digit",
206
+ month: "numeric",
207
207
  year: "numeric",
208
208
  hour: "numeric",
209
209
  minute: "2-digit",
210
+ hour12: !0,
210
211
  timeZoneName: "short"
211
- });
212
- function G(e) {
212
+ }), ne = [
213
+ "Jan",
214
+ "Feb",
215
+ "Mar",
216
+ "Apr",
217
+ "May",
218
+ "Jun",
219
+ "Jul",
220
+ "Aug",
221
+ "Sep",
222
+ "Oct",
223
+ "Nov",
224
+ "Dec"
225
+ ];
226
+ function J(e) {
213
227
  if (!e) return "-";
214
228
  let t = new Date(e);
215
- return Number.isNaN(t.getTime()) ? "-" : ie.format(t);
229
+ if (Number.isNaN(t.getTime())) return "-";
230
+ let n = Object.fromEntries(te.formatToParts(t).map((e) => [e.type, e.value]));
231
+ return `${n.day} ${ne[Number(n.month) - 1]} ${n.year}, ${n.hour}:${n.minute} ${n.dayPeriod.toLowerCase()} ${n.timeZoneName}`;
216
232
  }
217
- function K(e) {
233
+ function Y(e) {
218
234
  if (!Number.isFinite(e) || e < 0) return "-";
219
235
  if (e < 1024) return `${e} B`;
220
236
  if (e < 1024 * 1024) return `${Math.round(e / 1024)} KB`;
@@ -223,10 +239,10 @@ function K(e) {
223
239
  }
224
240
  //#endregion
225
241
  //#region src/lib/files.js
226
- function ae(e) {
242
+ function re(e) {
227
243
  return (e?.allowedContentTypes ?? []).join(",");
228
244
  }
229
- function oe(e, t) {
245
+ function ie(e, t) {
230
246
  if (t.length === 0) return !0;
231
247
  let n = (e || "").toLowerCase();
232
248
  return t.some((e) => {
@@ -234,17 +250,17 @@ function oe(e, t) {
234
250
  return t.endsWith("/*") ? n.startsWith(t.slice(0, -1)) : n === t;
235
251
  });
236
252
  }
237
- function q(e, t) {
253
+ function X(e, t) {
238
254
  let n = e ?? [], r = t?.maxAttachmentsPerMessage ?? 0, i = t?.maxAttachmentBytes ?? 0, a = t?.allowedContentTypes ?? [];
239
255
  if (r > 0 && n.length > r) return r === 1 ? "You can attach one file." : `You can attach up to ${r} files.`;
240
256
  for (let e of n) {
241
257
  let t = e.name || "This file";
242
- if (!oe(e.type, a)) return `${t} is a file type we cannot accept.`;
243
- if (i > 0 && e.size > i) return `${t} is larger than ${K(i)}.`;
258
+ if (!ie(e.type, a)) return `${t} is a file type we cannot accept.`;
259
+ if (i > 0 && e.size > i) return `${t} is larger than ${Y(i)}.`;
244
260
  }
245
261
  return null;
246
262
  }
247
- function J(e) {
263
+ function ae(e) {
248
264
  let t = Array.from(e.clipboardData?.items ?? []), n = Date.now();
249
265
  return t.filter((e) => e.kind === "file" && e.type.startsWith("image/")).map((e) => e.getAsFile()).filter(Boolean).map((e, t) => {
250
266
  let r = (e.type.split("/")[1] || "png").replace("jpeg", "jpg");
@@ -253,7 +269,7 @@ function J(e) {
253
269
  }
254
270
  //#endregion
255
271
  //#region src/components/AttachmentField.jsx
256
- function Y({ id: e, label: t = "Attachments", files: n, onChange: r, config: i, error: a }) {
272
+ function oe({ id: e, label: t = "Attachments", files: n, onChange: r, config: i, error: a }) {
257
273
  let o = i?.maxAttachmentBytes ?? 0, s = o > 0 ? Math.max(.1, Math.round(o / (1024 * 1024) * 10) / 10) : 0;
258
274
  return /* @__PURE__ */ j(h, {
259
275
  id: e,
@@ -262,7 +278,7 @@ function Y({ id: e, label: t = "Attachments", files: n, onChange: r, config: i,
262
278
  multiple: !0,
263
279
  value: n,
264
280
  onChange: r,
265
- accept: ae(i),
281
+ accept: re(i),
266
282
  maxSizeMb: s,
267
283
  validate: !1,
268
284
  error: a || void 0
@@ -273,20 +289,20 @@ function Y({ id: e, label: t = "Attachments", files: n, onChange: r, config: i,
273
289
  function se(e, t) {
274
290
  return t && e.includes(t) ? t : e[0] ?? "";
275
291
  }
276
- function X({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit: i, onBusyChange: a, children: o }) {
292
+ function ce({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit: i, onBusyChange: a, children: o }) {
277
293
  let l = t?.categories ?? [], [u, d] = s(() => se(l, n)), [f, p] = s(""), [m, h] = s(""), [g, _] = s([]), [y, b] = s({}), [x, C] = s(""), w = (e) => {
278
294
  _(e), b((n) => ({
279
295
  ...n,
280
- files: q([...r, ...e], t) ?? void 0
296
+ files: X([...r, ...e], t) ?? void 0
281
297
  }));
282
298
  }, T = (e) => {
283
- let t = J(e);
299
+ let t = ae(e);
284
300
  t.length > 0 && w([...g, ...t]);
285
301
  };
286
302
  function E() {
287
303
  let e = {};
288
304
  u || (e.category = "Choose a category."), f.trim() || (e.subject = "Give your ticket a subject."), m.trim() || (e.body = "Tell us what happened.");
289
- let n = q([...r, ...g], t);
305
+ let n = X([...r, ...g], t);
290
306
  return n && (e.files = n), b(e), Object.keys(e).length === 0;
291
307
  }
292
308
  async function D(e) {
@@ -353,7 +369,7 @@ function X({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit:
353
369
  error: y.body
354
370
  }),
355
371
  o,
356
- /* @__PURE__ */ j(Y, {
372
+ /* @__PURE__ */ j(oe, {
357
373
  id: `${e}-files`,
358
374
  files: g,
359
375
  onChange: w,
@@ -365,16 +381,16 @@ function X({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit:
365
381
  }
366
382
  //#endregion
367
383
  //#region src/ReportIssue.jsx
368
- var ce = "supportCapture", le = { zIndex: "var(--wui-z-fixed)" }, ue = (e) => e?.dataset?.[ce] !== "exclude";
369
- async function de() {
384
+ var le = "supportCapture", ue = { zIndex: "var(--wui-z-fixed)" }, de = (e) => e?.dataset?.[le] !== "exclude";
385
+ async function fe() {
370
386
  let e = await k(document.body, {
371
- filter: ue,
387
+ filter: de,
372
388
  pixelRatio: Math.min(window.devicePixelRatio || 1, 2)
373
389
  });
374
390
  if (!e) throw Error("The page capture came back empty.");
375
391
  return new File([e], "screenshot.png", { type: "image/png" });
376
392
  }
377
- function fe({ file: e, onRemove: t }) {
393
+ function pe({ file: e, onRemove: t }) {
378
394
  let [n, i] = s(null);
379
395
  return r(() => {
380
396
  let t = URL.createObjectURL(e);
@@ -402,12 +418,12 @@ function fe({ file: e, onRemove: t }) {
402
418
  ]
403
419
  });
404
420
  }
405
- function pe({ label: e = "Report an issue", floating: t = !1, defaultCategory: n = "Bug report", appVersion: r, getTicketHref: a, onOpenTicket: o, onCreated: l, className: u, style: f }) {
406
- let p = V(), { config: m, error: h } = U(), g = `support-report-${i().replace(/[^a-zA-Z0-9-]/g, "")}`, [_, v] = s(!1), [y, x] = s(!1), [S, C] = s(null), [w, T] = s(!1), [E, D] = s(!1), [O, k] = s(null);
421
+ function me({ label: e = "Report an issue", floating: t = !1, defaultCategory: n = "Bug report", appVersion: r, getTicketHref: a, onOpenTicket: o, onCreated: l, className: u, style: f }) {
422
+ let p = H(), { config: m, error: h } = W(), g = `support-report-${i().replace(/[^a-zA-Z0-9-]/g, "")}`, [_, v] = s(!1), [y, x] = s(!1), [S, C] = s(null), [w, T] = s(!1), [E, D] = s(!1), [O, k] = s(null);
407
423
  async function N() {
408
424
  x(!0), k(null);
409
425
  try {
410
- C(await de()), T(!1);
426
+ C(await fe()), T(!1);
411
427
  } catch {
412
428
  C(null), T(!0);
413
429
  } finally {
@@ -459,7 +475,7 @@ function pe({ label: e = "Report an issue", floating: t = !1, defaultCategory: n
459
475
  "data-support-capture": "exclude",
460
476
  className: [t ? "position-fixed bottom-0 end-0 m-3" : "d-inline-block", u].filter(Boolean).join(" "),
461
477
  style: t ? {
462
- ...le,
478
+ ...ue,
463
479
  ...f
464
480
  } : f,
465
481
  children: /* @__PURE__ */ j(d, {
@@ -484,14 +500,14 @@ function pe({ label: e = "Report an issue", floating: t = !1, defaultCategory: n
484
500
  role: "status",
485
501
  title: `Ticket ${O.number} is with the support team`,
486
502
  children: "We reply by email. You can follow the ticket on your support page."
487
- }) : m ? /* @__PURE__ */ j(X, {
503
+ }) : m ? /* @__PURE__ */ j(ce, {
488
504
  id: g,
489
505
  config: m,
490
506
  defaultCategory: n,
491
507
  extraFiles: S ? [S] : [],
492
508
  onSubmit: F,
493
509
  onBusyChange: D,
494
- children: S ? /* @__PURE__ */ j(fe, {
510
+ children: S ? /* @__PURE__ */ j(pe, {
495
511
  file: S,
496
512
  onRemove: () => C(null)
497
513
  }) : w ? /* @__PURE__ */ j(c, {
@@ -506,8 +522,8 @@ function pe({ label: e = "Report an issue", floating: t = !1, defaultCategory: n
506
522
  }
507
523
  //#endregion
508
524
  //#region src/components/NewTicketModal.jsx
509
- function me({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a, appVersion: o }) {
510
- let c = V(), l = `support-new-${i().replace(/[^a-zA-Z0-9-]/g, "")}`, [u, f] = s(!1);
525
+ function he({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a, appVersion: o }) {
526
+ let c = H(), l = `support-new-${i().replace(/[^a-zA-Z0-9-]/g, "")}`, [u, f] = s(!1);
511
527
  async function p(e) {
512
528
  n(await c.createTicket({
513
529
  ...e,
@@ -539,7 +555,7 @@ function me({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a,
539
555
  children: "Send ticket"
540
556
  })]
541
557
  }),
542
- children: e && /* @__PURE__ */ j(X, {
558
+ children: e && /* @__PURE__ */ j(ce, {
543
559
  id: l,
544
560
  config: r,
545
561
  defaultCategory: a,
@@ -550,23 +566,23 @@ function me({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a,
550
566
  }
551
567
  //#endregion
552
568
  //#region src/lib/status.js
553
- var he = {
569
+ var ge = {
554
570
  Open: "warning",
555
571
  InProgress: "info",
556
572
  Resolved: "success",
557
573
  Closed: "neutral"
558
574
  };
559
- function ge(e) {
560
- return he[e] ?? "neutral";
575
+ function _e(e) {
576
+ return ge[e] ?? "neutral";
561
577
  }
562
578
  //#endregion
563
579
  //#region src/components/AttachmentThumb.jsx
564
- var _e = {
580
+ var ve = {
565
581
  width: 140,
566
582
  maxWidth: "100%"
567
- }, ve = { height: 84 };
568
- function ye({ attachment: e }) {
569
- let t = V(), n = (e.contentType || "").startsWith("image/"), [i, a] = s(null), [o, c] = s(!1);
583
+ }, ye = { height: 84 };
584
+ function be({ attachment: e }) {
585
+ let t = H(), n = (e.contentType || "").startsWith("image/"), [i, a] = s(null), [o, c] = s(!1);
570
586
  r(() => {
571
587
  let n = !0, r = null;
572
588
  return a(null), c(!1), t.fetchAttachment(e.id).then((e) => {
@@ -580,12 +596,12 @@ function ye({ attachment: e }) {
580
596
  children: [
581
597
  e.fileName,
582
598
  ", ",
583
- K(e.sizeBytes)
599
+ Y(e.sizeBytes)
584
600
  ]
585
601
  });
586
602
  return o ? /* @__PURE__ */ M("span", {
587
603
  className: "d-inline-flex flex-column border rounded overflow-hidden",
588
- style: _e,
604
+ style: ve,
589
605
  children: [/* @__PURE__ */ M("span", {
590
606
  className: "d-flex align-items-center justify-content-center gap-1 p-2 wui-text-xs text-body-secondary",
591
607
  children: [/* @__PURE__ */ j(g, {
@@ -595,7 +611,7 @@ function ye({ attachment: e }) {
595
611
  }), u]
596
612
  }) : /* @__PURE__ */ M("a", {
597
613
  className: "d-inline-flex flex-column border rounded overflow-hidden text-decoration-none",
598
- style: _e,
614
+ style: ve,
599
615
  href: i ?? void 0,
600
616
  target: "_blank",
601
617
  rel: "noopener noreferrer",
@@ -603,7 +619,7 @@ function ye({ attachment: e }) {
603
619
  "aria-busy": !i || void 0,
604
620
  children: [/* @__PURE__ */ j("span", {
605
621
  className: "d-flex align-items-center justify-content-center bg-body-tertiary",
606
- style: ve,
622
+ style: ye,
607
623
  children: i ? n ? /* @__PURE__ */ j("img", {
608
624
  src: i,
609
625
  alt: e.fileName,
@@ -620,11 +636,11 @@ function ye({ attachment: e }) {
620
636
  }
621
637
  //#endregion
622
638
  //#region src/components/MessageThread.jsx
623
- var be = {
639
+ var xe = {
624
640
  whiteSpace: "pre-wrap",
625
641
  overflowWrap: "anywhere"
626
642
  };
627
- function xe({ messages: e }) {
643
+ function Se({ messages: e }) {
628
644
  return /* @__PURE__ */ j("ol", {
629
645
  className: "list-unstyled d-flex flex-column gap-3 mb-0",
630
646
  "aria-label": "Conversation",
@@ -632,7 +648,7 @@ function xe({ messages: e }) {
632
648
  let t = /* @__PURE__ */ j("time", {
633
649
  dateTime: e.createdDateTimeUtc,
634
650
  className: "wui-text-xs text-body-secondary text-nowrap",
635
- children: G(e.createdDateTimeUtc)
651
+ children: J(e.createdDateTimeUtc)
636
652
  });
637
653
  if (e.authorKind === "System") return /* @__PURE__ */ M("li", {
638
654
  className: "text-center wui-text-xs text-body-secondary",
@@ -668,12 +684,12 @@ function xe({ messages: e }) {
668
684
  }),
669
685
  /* @__PURE__ */ j("div", {
670
686
  className: "wui-text-sm",
671
- style: be,
687
+ style: xe,
672
688
  children: e.body
673
689
  }),
674
690
  e.attachments?.length > 0 && /* @__PURE__ */ j("div", {
675
691
  className: "d-flex flex-wrap gap-2 mt-2",
676
- children: e.attachments.map((e) => /* @__PURE__ */ j(ye, { attachment: e }, e.id))
692
+ children: e.attachments.map((e) => /* @__PURE__ */ j(be, { attachment: e }, e.id))
677
693
  })
678
694
  ]
679
695
  })]
@@ -683,7 +699,7 @@ function xe({ messages: e }) {
683
699
  }
684
700
  //#endregion
685
701
  //#region src/components/RatingPanel.jsx
686
- function Se({ satisfaction: e, comment: t, canRate: n = !1, commentMaxLength: r, onRate: a }) {
702
+ function Ce({ satisfaction: e, comment: t, canRate: n = !1, commentMaxLength: r, onRate: a }) {
687
703
  let o = i(), [l, u] = s(""), [p, m] = s(null), [h, g] = s("");
688
704
  if (e) return /* @__PURE__ */ M(c, {
689
705
  variant: e === "Satisfied" ? "success" : "info",
@@ -751,11 +767,11 @@ function Se({ satisfaction: e, comment: t, canRate: n = !1, commentMaxLength: r,
751
767
  }
752
768
  //#endregion
753
769
  //#region src/components/ReplyBox.jsx
754
- function Ce({ onSend: e, config: t, reopens: n = !1 }) {
770
+ function we({ onSend: e, config: t, reopens: n = !1 }) {
755
771
  let r = i(), [a, o] = s(""), [l, u] = s([]), [f, p] = s(""), [m, h] = s(""), [g, _] = s(!1), v = (e) => {
756
- u(e), p(q(e, t) ?? "");
772
+ u(e), p(X(e, t) ?? "");
757
773
  }, y = (e) => {
758
- let t = J(e);
774
+ let t = ae(e);
759
775
  t.length > 0 && v([...l, ...t]);
760
776
  };
761
777
  async function b(n) {
@@ -765,7 +781,7 @@ function Ce({ onSend: e, config: t, reopens: n = !1 }) {
765
781
  h("Write a message before you send it.");
766
782
  return;
767
783
  }
768
- let i = q(l, t);
784
+ let i = X(l, t);
769
785
  if (i) {
770
786
  p(i);
771
787
  return;
@@ -804,7 +820,7 @@ function Ce({ onSend: e, config: t, reopens: n = !1 }) {
804
820
  hint: n ? "Sending a reply reopens this ticket. You can paste an image into the message." : "You can paste an image into the message.",
805
821
  required: !0
806
822
  }),
807
- /* @__PURE__ */ j(Y, {
823
+ /* @__PURE__ */ j(oe, {
808
824
  id: `${r}-files`,
809
825
  files: l,
810
826
  onChange: v,
@@ -837,8 +853,8 @@ function Z({ label: e, children: t }) {
837
853
  })]
838
854
  });
839
855
  }
840
- function we({ ticketId: e, onBack: t, onChanged: n }) {
841
- let { config: r } = U(), { ticket: i, loading: a, error: o, reload: l, reply: u, reopen: f, rate: p } = re(e), [m, h] = s(!1), [g, _] = s(""), v = async (e) => {
856
+ function Te({ ticketId: e, onBack: t, onChanged: n }) {
857
+ let { config: r } = W(), { ticket: i, loading: a, error: o, reload: l, reply: u, reopen: f, rate: p } = q(e), [m, h] = s(!1), [g, _] = s(""), v = async (e) => {
842
858
  let t = await e();
843
859
  return n?.(), t;
844
860
  };
@@ -894,7 +910,7 @@ function we({ ticketId: e, onBack: t, onChanged: n }) {
894
910
  children: i.subject
895
911
  }), i.statusLabel && /* @__PURE__ */ j(T, {
896
912
  label: i.statusLabel,
897
- tone: ge(i.status)
913
+ tone: _e(i.status)
898
914
  })]
899
915
  }),
900
916
  /* @__PURE__ */ M("div", {
@@ -912,14 +928,14 @@ function we({ ticketId: e, onBack: t, onChanged: n }) {
912
928
  label: "Opened",
913
929
  children: /* @__PURE__ */ j("time", {
914
930
  dateTime: i.createdDateTimeUtc,
915
- children: G(i.createdDateTimeUtc)
931
+ children: J(i.createdDateTimeUtc)
916
932
  })
917
933
  }),
918
934
  /* @__PURE__ */ j(Z, {
919
935
  label: "Last update",
920
936
  children: /* @__PURE__ */ j("time", {
921
937
  dateTime: i.updatedDateTimeUtc,
922
- children: G(i.updatedDateTimeUtc)
938
+ children: J(i.updatedDateTimeUtc)
923
939
  })
924
940
  })
925
941
  ]
@@ -947,15 +963,15 @@ function we({ ticketId: e, onBack: t, onChanged: n }) {
947
963
  className: "align-self-start",
948
964
  children: "Reopen ticket"
949
965
  }),
950
- /* @__PURE__ */ j(Se, {
966
+ /* @__PURE__ */ j(Ce, {
951
967
  satisfaction: i.satisfaction,
952
968
  comment: i.satisfactionComment,
953
969
  canRate: i.canRate,
954
970
  commentMaxLength: r?.satisfactionCommentMaxLength,
955
971
  onRate: (e) => v(() => p(e))
956
972
  }),
957
- /* @__PURE__ */ j(xe, { messages: i.messages ?? [] }),
958
- /* @__PURE__ */ j(Ce, {
973
+ /* @__PURE__ */ j(Se, { messages: i.messages ?? [] }),
974
+ /* @__PURE__ */ j(we, {
959
975
  config: r,
960
976
  reopens: x,
961
977
  onSend: (e) => v(() => u(e))
@@ -966,22 +982,22 @@ function we({ ticketId: e, onBack: t, onChanged: n }) {
966
982
  //#endregion
967
983
  //#region src/lib/url.js
968
984
  var Q = "ticket";
969
- function Te() {
985
+ function Ee() {
970
986
  return typeof window > "u" ? null : new URLSearchParams(window.location.search).get(Q);
971
987
  }
972
- function Ee(e) {
988
+ function De(e) {
973
989
  if (typeof window > "u") return e ? `?${Q}=${encodeURIComponent(e)}` : "?";
974
990
  let t = new URL(window.location.href);
975
991
  return e ? t.searchParams.set(Q, e) : t.searchParams.delete(Q), `${t.pathname}${t.search}${t.hash}`;
976
992
  }
977
- function De(e) {
993
+ function Oe(e) {
978
994
  if (typeof window > "u") return;
979
- let t = Ee(e);
995
+ let t = De(e);
980
996
  t !== `${window.location.pathname}${window.location.search}${window.location.hash}` && window.history.replaceState(window.history.state, "", t);
981
997
  }
982
998
  //#endregion
983
999
  //#region src/components/TicketList.jsx
984
- var Oe = [
1000
+ var ke = [
985
1001
  {
986
1002
  key: "all",
987
1003
  label: "All",
@@ -1008,7 +1024,7 @@ var Oe = [
1008
1024
  countKey: "closed"
1009
1025
  }
1010
1026
  ];
1011
- function ke({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a, onStatusChange: o, counts: s, search: l, onSearchChange: u, pagination: f }) {
1027
+ function Ae({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a, onStatusChange: o, counts: s, search: l, onSearchChange: u, pagination: f }) {
1012
1028
  return /* @__PURE__ */ M("div", {
1013
1029
  className: "d-flex flex-column gap-3",
1014
1030
  children: [
@@ -1028,7 +1044,7 @@ function ke({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1028
1044
  /* @__PURE__ */ M("div", {
1029
1045
  className: "d-flex flex-column flex-md-row gap-2 align-items-md-center justify-content-between",
1030
1046
  children: [/* @__PURE__ */ j(D, {
1031
- tabs: Oe.map(({ key: e, label: t, countKey: n }) => ({
1047
+ tabs: ke.map(({ key: e, label: t, countKey: n }) => ({
1032
1048
  key: e,
1033
1049
  label: t,
1034
1050
  count: s?.[n]
@@ -1053,7 +1069,7 @@ function ke({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1053
1069
  className: "d-flex flex-column",
1054
1070
  style: { minWidth: 0 },
1055
1071
  children: [/* @__PURE__ */ j(y, {
1056
- href: Ee(e.id),
1072
+ href: De(e.id),
1057
1073
  animation: "none",
1058
1074
  className: "fw-semibold text-break",
1059
1075
  onClick: (t) => {
@@ -1076,7 +1092,7 @@ function ke({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1076
1092
  label: "Status",
1077
1093
  render: (e) => e.statusLabel ? /* @__PURE__ */ j(T, {
1078
1094
  label: e.statusLabel,
1079
- tone: ge(e.status)
1095
+ tone: _e(e.status)
1080
1096
  }) : "-"
1081
1097
  },
1082
1098
  {
@@ -1091,7 +1107,7 @@ function ke({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1091
1107
  cellClassName: "wui-text-sm text-body-secondary text-nowrap",
1092
1108
  render: (e) => /* @__PURE__ */ j("time", {
1093
1109
  dateTime: e.updatedDateTimeUtc,
1094
- children: G(e.updatedDateTimeUtc)
1110
+ children: J(e.updatedDateTimeUtc)
1095
1111
  })
1096
1112
  }
1097
1113
  ],
@@ -1117,7 +1133,7 @@ function ke({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1117
1133
  }
1118
1134
  //#endregion
1119
1135
  //#region src/lib/useDebouncedValue.js
1120
- function Ae(e, t) {
1136
+ function je(e, t) {
1121
1137
  let [n, i] = s(e);
1122
1138
  return r(() => {
1123
1139
  let n = setTimeout(() => i(e), t);
@@ -1126,20 +1142,20 @@ function Ae(e, t) {
1126
1142
  }
1127
1143
  //#endregion
1128
1144
  //#region src/SupportCenter.jsx
1129
- var je = 300, Me = 10;
1130
- function Ne({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1131
- let { config: i, error: a, reload: o } = U(), [l, u] = s("all"), [f, p] = s(""), m = Ae(f.trim(), je), [h, g] = s(Me), _ = `${l}|${m}|${h}`, [v, y] = s({
1145
+ var Me = 300, Ne = 10;
1146
+ function Pe({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1147
+ let { config: i, error: a, reload: o } = W(), [l, u] = s("all"), [f, p] = s(""), m = je(f.trim(), Me), [h, g] = s(Ne), _ = `${l}|${m}|${h}`, [v, y] = s({
1132
1148
  key: _,
1133
1149
  page: 1
1134
1150
  }), b = v.key === _ ? v.page : 1, x = (e) => y({
1135
1151
  key: _,
1136
1152
  page: e
1137
- }), S = ne({
1153
+ }), S = G({
1138
1154
  status: l === "all" ? void 0 : l,
1139
1155
  search: m || void 0,
1140
1156
  page: b,
1141
1157
  pageSize: h
1142
- }), { counts: C, reload: w } = W(), [T, E] = s(() => e || Te()), [D, O] = s(!1), k = S.totalPages;
1158
+ }), { counts: C, reload: w } = K(), [T, E] = s(() => e || Ee()), [D, O] = s(!1), k = S.totalPages;
1143
1159
  r(() => {
1144
1160
  k > 0 && b > k && y({
1145
1161
  key: _,
@@ -1153,9 +1169,9 @@ function Ne({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1153
1169
  let A = () => {
1154
1170
  S.reload(), w();
1155
1171
  }, N = (e) => {
1156
- E(e), De(e);
1172
+ E(e), Oe(e);
1157
1173
  };
1158
- if (T) return /* @__PURE__ */ j(we, {
1174
+ if (T) return /* @__PURE__ */ j(Te, {
1159
1175
  ticketId: T,
1160
1176
  onBack: () => N(null),
1161
1177
  onChanged: A
@@ -1198,7 +1214,7 @@ function Ne({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1198
1214
  })
1199
1215
  ]
1200
1216
  }),
1201
- /* @__PURE__ */ j(ke, {
1217
+ /* @__PURE__ */ j(Ae, {
1202
1218
  tickets: S.tickets,
1203
1219
  loading: S.loading,
1204
1220
  error: S.error,
@@ -1211,7 +1227,7 @@ function Ne({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1211
1227
  onSearchChange: p,
1212
1228
  pagination: P
1213
1229
  }),
1214
- i && /* @__PURE__ */ j(me, {
1230
+ i && /* @__PURE__ */ j(he, {
1215
1231
  open: D,
1216
1232
  onClose: () => O(!1),
1217
1233
  config: i,
@@ -1227,8 +1243,8 @@ function Ne({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1227
1243
  //#endregion
1228
1244
  //#region src/SupportContact.jsx
1229
1245
  var $ = (e) => typeof e == "string" && e.trim() !== "";
1230
- function Pe({ className: e }) {
1231
- let { config: t } = U();
1246
+ function Fe({ className: e }) {
1247
+ let { config: t } = W();
1232
1248
  if (!t) return null;
1233
1249
  let n = [];
1234
1250
  return $(t.supportEmail) && n.push({
@@ -1270,7 +1286,7 @@ function Pe({ className: e }) {
1270
1286
  }
1271
1287
  //#endregion
1272
1288
  //#region src/SupportProvider.jsx
1273
- function Fe({ client: e, children: n }) {
1289
+ function Ie({ client: e, children: n }) {
1274
1290
  let r = o(null), i = t((t = !1) => {
1275
1291
  let n = r.current;
1276
1292
  if (t || !n || n.client !== e) {
@@ -1287,10 +1303,10 @@ function Fe({ client: e, children: n }) {
1287
1303
  client: e,
1288
1304
  loadConfig: i
1289
1305
  }), [e, i]);
1290
- return /* @__PURE__ */ j(te.Provider, {
1306
+ return /* @__PURE__ */ j(B.Provider, {
1291
1307
  value: s,
1292
1308
  children: n
1293
1309
  });
1294
1310
  }
1295
1311
  //#endregion
1296
- export { pe as ReportIssue, P as SupportApiError, Ne as SupportCenter, Pe as SupportContact, Fe as SupportProvider, ee as createSupportClient, V as useSupportClient, U as useSupportConfig, re as useSupportTicket, W as useSupportTicketCounts, ne as useSupportTickets };
1312
+ export { me as ReportIssue, P as SupportApiError, Pe as SupportCenter, Fe as SupportContact, Ie as SupportProvider, ee as createSupportClient, H as useSupportClient, W as useSupportConfig, q as useSupportTicket, K as useSupportTicketCounts, G as useSupportTickets };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * A timestamp in the viewer's own time zone, with the zone named so the reader knows which clock
3
- * it is. Returns a plain hyphen for a missing or unreadable value.
2
+ * A timestamp in the viewer's own time zone as "21 Sep 2026, 3:30 pm IST", with the zone named
3
+ * so the reader knows which clock it is. Returns a plain hyphen for a missing or unreadable value.
4
4
  *
5
5
  * @param {string|null|undefined} iso
6
6
  * @returns {string}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/support-react",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "Webority customer support for React portals: ticket centre, report-an-issue with a page screenshot, and support contact details, built on @webority/ui-react.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "react": "^19.0.0",
33
33
  "react-bootstrap": "^2.10.0",
34
34
  "react-dom": "^19.0.0",
35
- "@webority/ui-react": "0.18.0"
35
+ "@webority/ui-react": "0.19.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@testing-library/dom": "10.4.2",
@@ -50,7 +50,7 @@
50
50
  "typescript": "^7.0.2",
51
51
  "vite": "^8.0.12",
52
52
  "vitest": "5.0.1",
53
- "@webority/ui-react": "0.18.0"
53
+ "@webority/ui-react": "0.19.0"
54
54
  },
55
55
  "dependencies": {
56
56
  "html-to-image": "^1.11.13"