@medipha/feed 0.2.5 → 0.2.6

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/dist/index.js CHANGED
@@ -9153,46 +9153,73 @@ function __({ event: e }) {
9153
9153
  });
9154
9154
  }
9155
9155
  //#endregion
9156
+ //#region src/features/feed/sidebar/rail-section-head.tsx
9157
+ function v_({ title: e, open: t, onToggle: n, summary: r }) {
9158
+ return /* @__PURE__ */ H("button", {
9159
+ type: "button",
9160
+ className: "med-feed-rail-head",
9161
+ "aria-expanded": t,
9162
+ onClick: n,
9163
+ children: [
9164
+ /* @__PURE__ */ V("span", {
9165
+ className: "med-feed-rail-head__title",
9166
+ children: e
9167
+ }),
9168
+ !t && r && /* @__PURE__ */ V("span", {
9169
+ className: "med-feed-rail-head__summary",
9170
+ children: r
9171
+ }),
9172
+ /* @__PURE__ */ V("span", {
9173
+ className: t ? "med-feed-nav-item__chevron med-feed-nav-item__chevron--up" : "med-feed-nav-item__chevron",
9174
+ "aria-hidden": !0,
9175
+ children: /* @__PURE__ */ V(Ie, {})
9176
+ })
9177
+ ]
9178
+ });
9179
+ }
9180
+ //#endregion
9156
9181
  //#region src/features/feed/sidebar/category-nav.tsx
9157
- var v_ = 5, y_ = {
9182
+ var y_ = 5, b_ = {
9158
9183
  culture: /* @__PURE__ */ V(Pe, {}),
9159
9184
  innovation: /* @__PURE__ */ V(Ce, {}),
9160
9185
  training: /* @__PURE__ */ V(St, {})
9161
9186
  };
9162
- function b_({ categories: e, filters: t, onSelect: n }) {
9163
- let [r, i] = z(!1), a = e.filter((e) => !e.hidden), o = a.length > v_, s = o && !r ? a.slice(0, v_) : a;
9187
+ function x_({ categories: e, filters: t, onSelect: n }) {
9188
+ let [r, i] = z(!0), [a, o] = z(!1), s = e.filter((e) => !e.hidden), l = s.length > y_, u = l && !a ? s.slice(0, y_) : s, d = s.find((e) => e.id === t.categoryId);
9164
9189
  return /* @__PURE__ */ H(c, {
9165
9190
  bordered: !1,
9166
9191
  className: "med-feed-category-nav",
9167
9192
  children: [
9168
- /* @__PURE__ */ V("div", {
9169
- className: "med-feed-category-nav__head",
9170
- children: "Chuyên mục Bảng tin"
9193
+ /* @__PURE__ */ V(v_, {
9194
+ title: "Chuyên mục Bảng tin",
9195
+ open: r,
9196
+ onToggle: () => i((e) => !e),
9197
+ summary: d?.name
9171
9198
  }),
9172
- s.map((e) => /* @__PURE__ */ V(x_, {
9173
- icon: (e.icon && y_[e.icon]) ?? /* @__PURE__ */ V(jt, {}),
9199
+ r && u.map((e) => /* @__PURE__ */ V(S_, {
9200
+ icon: (e.icon && b_[e.icon]) ?? /* @__PURE__ */ V(jt, {}),
9174
9201
  iconColor: e.color ?? void 0,
9175
9202
  label: e.name,
9176
9203
  active: t.categoryId === e.id,
9177
9204
  onClick: () => n({ categoryId: t.categoryId === e.id ? null : e.id })
9178
9205
  }, e.id)),
9179
- o && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", { className: "med-feed-category-nav__divider" }), /* @__PURE__ */ H("button", {
9206
+ r && l && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", { className: "med-feed-category-nav__divider" }), /* @__PURE__ */ H("button", {
9180
9207
  type: "button",
9181
9208
  className: "med-feed-nav-item med-feed-nav-item--more",
9182
- "aria-expanded": r,
9183
- onClick: () => i((e) => !e),
9209
+ "aria-expanded": a,
9210
+ onClick: () => o((e) => !e),
9184
9211
  children: [/* @__PURE__ */ V("span", {
9185
- className: r ? "med-feed-nav-item__chevron med-feed-nav-item__chevron--up" : "med-feed-nav-item__chevron",
9212
+ className: a ? "med-feed-nav-item__chevron med-feed-nav-item__chevron--up" : "med-feed-nav-item__chevron",
9186
9213
  children: /* @__PURE__ */ V(Ie, {})
9187
9214
  }), /* @__PURE__ */ V("span", {
9188
9215
  className: "med-feed-nav-item__label",
9189
- children: r ? "Thu gọn" : `+${a.length - v_} chuyên mục`
9216
+ children: a ? "Thu gọn" : `+${s.length - y_} chuyên mục`
9190
9217
  })]
9191
9218
  })] })
9192
9219
  ]
9193
9220
  });
9194
9221
  }
9195
- function x_({ icon: e, iconColor: t, label: n, active: r, onClick: i }) {
9222
+ function S_({ icon: e, iconColor: t, label: n, active: r, onClick: i }) {
9196
9223
  return /* @__PURE__ */ H("button", {
9197
9224
  type: "button",
9198
9225
  className: r ? "med-feed-nav-item med-feed-nav-item--active" : "med-feed-nav-item",
@@ -9210,7 +9237,7 @@ function x_({ icon: e, iconColor: t, label: n, active: r, onClick: i }) {
9210
9237
  }
9211
9238
  //#endregion
9212
9239
  //#region src/features/feed/sidebar/feed-calendar.tsx
9213
- var S_ = [
9240
+ var C_ = [
9214
9241
  "T2",
9215
9242
  "T3",
9216
9243
  "T4",
@@ -9218,7 +9245,7 @@ var S_ = [
9218
9245
  "T6",
9219
9246
  "T7",
9220
9247
  "CN"
9221
- ], C_ = [
9248
+ ], w_ = [
9222
9249
  "Tháng 1",
9223
9250
  "Tháng 2",
9224
9251
  "Tháng 3",
@@ -9232,15 +9259,15 @@ var S_ = [
9232
9259
  "Tháng 11",
9233
9260
  "Tháng 12"
9234
9261
  ];
9235
- function w_(e, t, n) {
9262
+ function T_(e, t, n) {
9236
9263
  return `${e}-${String(t + 1).padStart(2, "0")}-${String(n).padStart(2, "0")}`;
9237
9264
  }
9238
- function T_(e) {
9265
+ function E_(e) {
9239
9266
  let [, t, n] = e.split("-");
9240
9267
  return `${n}/${t}`;
9241
9268
  }
9242
- function E_({ filters: e, onSelect: t }) {
9243
- let n = /* @__PURE__ */ new Date(), [r, i] = z(null), [a, o] = z(() => {
9269
+ function D_({ filters: e, onSelect: t }) {
9270
+ let n = /* @__PURE__ */ new Date(), [r, i] = z(!0), [a, o] = z(null), [s, l] = z(() => {
9244
9271
  if (e.from) {
9245
9272
  let [t, n] = e.from.split("-").map(Number);
9246
9273
  return {
@@ -9252,21 +9279,21 @@ function E_({ filters: e, onSelect: t }) {
9252
9279
  year: n.getFullYear(),
9253
9280
  month: n.getMonth()
9254
9281
  };
9255
- }), s = (new Date(a.year, a.month, 1).getDay() + 6) % 7, l = new Date(a.year, a.month + 1, 0).getDate(), u = w_(n.getFullYear(), n.getMonth(), n.getDate()), d = (e) => {
9256
- o((t) => {
9282
+ }), u = (new Date(s.year, s.month, 1).getDay() + 6) % 7, d = new Date(s.year, s.month + 1, 0).getDate(), f = T_(n.getFullYear(), n.getMonth(), n.getDate()), p = (e) => {
9283
+ l((t) => {
9257
9284
  let n = new Date(t.year, t.month + e, 1);
9258
9285
  return {
9259
9286
  year: n.getFullYear(),
9260
9287
  month: n.getMonth()
9261
9288
  };
9262
9289
  });
9263
- }, f = [...Array.from({ length: s }, () => null), ...Array.from({ length: l }, (e, t) => w_(a.year, a.month, t + 1))], p = (n) => {
9264
- if (!(n > u)) {
9265
- if (r) {
9266
- let [e, a] = r <= n ? [r, n] : [n, r];
9267
- i(null), t({
9290
+ }, m = [...Array.from({ length: u }, () => null), ...Array.from({ length: d }, (e, t) => T_(s.year, s.month, t + 1))], h = (n) => {
9291
+ if (!(n > f)) {
9292
+ if (a) {
9293
+ let [e, r] = a <= n ? [a, n] : [n, a];
9294
+ o(null), t({
9268
9295
  from: e,
9269
- to: a
9296
+ to: r
9270
9297
  });
9271
9298
  return;
9272
9299
  }
@@ -9277,13 +9304,18 @@ function E_({ filters: e, onSelect: t }) {
9277
9304
  });
9278
9305
  return;
9279
9306
  }
9280
- i(n);
9307
+ o(n);
9281
9308
  }
9282
- }, m = (t) => !!(e.from && e.to && t >= e.from && t <= e.to), h = e.from && e.to ? e.from === e.to ? T_(e.from) : `${T_(e.from)} – ${T_(e.to)}` : r ? `Từ ${T_(r)}…` : null;
9309
+ }, g = (t) => !!(e.from && e.to && t >= e.from && t <= e.to), _ = e.from && e.to ? e.from === e.to ? E_(e.from) : `${E_(e.from)} – ${E_(e.to)}` : a ? `Từ ${E_(a)}…` : null;
9283
9310
  return /* @__PURE__ */ H(c, {
9284
9311
  bordered: !1,
9285
9312
  className: "med-feed-calendar",
9286
- children: [
9313
+ children: [/* @__PURE__ */ V(v_, {
9314
+ title: "Lọc theo ngày",
9315
+ open: r,
9316
+ onToggle: () => i((e) => !e),
9317
+ summary: _
9318
+ }), r && /* @__PURE__ */ H(B, { children: [
9287
9319
  /* @__PURE__ */ H("div", {
9288
9320
  className: "med-feed-calendar__head",
9289
9321
  children: [
@@ -9291,74 +9323,74 @@ function E_({ filters: e, onSelect: t }) {
9291
9323
  type: "button",
9292
9324
  className: "med-feed-calendar__nav",
9293
9325
  "aria-label": "Tháng trước",
9294
- onClick: () => d(-1),
9326
+ onClick: () => p(-1),
9295
9327
  children: "‹"
9296
9328
  }),
9297
9329
  /* @__PURE__ */ H("span", {
9298
9330
  className: "med-feed-calendar__label",
9299
9331
  children: [
9300
- C_[a.month],
9332
+ w_[s.month],
9301
9333
  " ",
9302
- a.year
9334
+ s.year
9303
9335
  ]
9304
9336
  }),
9305
9337
  /* @__PURE__ */ V("button", {
9306
9338
  type: "button",
9307
9339
  className: "med-feed-calendar__nav",
9308
9340
  "aria-label": "Tháng sau",
9309
- onClick: () => d(1),
9341
+ onClick: () => p(1),
9310
9342
  children: "›"
9311
9343
  })
9312
9344
  ]
9313
9345
  }),
9314
9346
  /* @__PURE__ */ V("div", {
9315
- className: ["med-feed-calendar__range", h ? "" : "med-feed-calendar__range--empty"].filter(Boolean).join(" "),
9316
- children: h ?? "Chọn ngày để lọc"
9347
+ className: ["med-feed-calendar__range", _ ? "" : "med-feed-calendar__range--empty"].filter(Boolean).join(" "),
9348
+ children: _ ?? "Chọn ngày để lọc"
9317
9349
  }),
9318
9350
  /* @__PURE__ */ V("div", {
9319
9351
  className: "med-feed-calendar__weekdays",
9320
- children: S_.map((e) => /* @__PURE__ */ V("span", { children: e }, e))
9352
+ children: C_.map((e) => /* @__PURE__ */ V("span", { children: e }, e))
9321
9353
  }),
9322
9354
  /* @__PURE__ */ V("div", {
9323
9355
  className: "med-feed-calendar__grid",
9324
- children: f.map((t, n) => t === null ? /* @__PURE__ */ V("span", {}, `empty-${n}`) : /* @__PURE__ */ V("button", {
9356
+ children: m.map((t, n) => t === null ? /* @__PURE__ */ V("span", {}, `empty-${n}`) : /* @__PURE__ */ V("button", {
9325
9357
  type: "button",
9326
- disabled: t > u,
9358
+ disabled: t > f,
9327
9359
  className: [
9328
9360
  "med-feed-calendar__day",
9329
- t === e.from || t === e.to || t === r ? "med-feed-calendar__day--active" : m(t) ? "med-feed-calendar__day--range" : "",
9330
- t === u ? "med-feed-calendar__day--today" : "",
9331
- t > u ? "med-feed-calendar__day--disabled" : ""
9361
+ t === e.from || t === e.to || t === a ? "med-feed-calendar__day--active" : g(t) ? "med-feed-calendar__day--range" : "",
9362
+ t === f ? "med-feed-calendar__day--today" : "",
9363
+ t > f ? "med-feed-calendar__day--disabled" : ""
9332
9364
  ].filter(Boolean).join(" "),
9333
- onClick: () => p(t),
9365
+ onClick: () => h(t),
9334
9366
  children: Number(t.slice(8))
9335
9367
  }, t))
9336
9368
  }),
9337
9369
  /* @__PURE__ */ V("button", {
9338
9370
  type: "button",
9339
9371
  className: "med-feed-calendar__clear",
9340
- disabled: !e.from && !r,
9372
+ disabled: !e.from && !a,
9341
9373
  onClick: () => {
9342
- i(null), t({
9374
+ o(null), t({
9343
9375
  from: null,
9344
9376
  to: null
9345
9377
  });
9346
9378
  },
9347
9379
  children: "Xoá lọc ngày"
9348
9380
  })
9349
- ]
9381
+ ] })]
9350
9382
  });
9351
9383
  }
9352
9384
  //#endregion
9353
9385
  //#region src/features/feed/left-rail.tsx
9354
- function D_({ categories: e, filters: t, onSelect: n }) {
9386
+ function O_({ categories: e, filters: t, onSelect: n }) {
9355
9387
  return /* @__PURE__ */ H("div", {
9356
9388
  className: "med-feed-left-rail",
9357
- children: [/* @__PURE__ */ V(b_, {
9389
+ children: [/* @__PURE__ */ V(x_, {
9358
9390
  categories: e,
9359
9391
  filters: t,
9360
9392
  onSelect: n
9361
- }), /* @__PURE__ */ V(E_, {
9393
+ }), /* @__PURE__ */ V(D_, {
9362
9394
  filters: t,
9363
9395
  onSelect: n
9364
9396
  })]
@@ -9366,11 +9398,11 @@ function D_({ categories: e, filters: t, onSelect: n }) {
9366
9398
  }
9367
9399
  //#endregion
9368
9400
  //#region src/features/feed/feed-page.tsx
9369
- var O_ = 20, k_ = [];
9370
- function A_() {
9371
- let { api: e } = G(), { filters: t, setFilters: n } = u_(), r = K(F(() => e.listCategories(), [e]), "categories").data ?? k_, i = jn(F((n) => e.listFeedPosts({
9401
+ var k_ = 20, A_ = [];
9402
+ function j_() {
9403
+ let { api: e } = G(), { filters: t, setFilters: n } = u_(), r = K(F(() => e.listCategories(), [e]), "categories").data ?? A_, i = jn(F((n) => e.listFeedPosts({
9372
9404
  cursor: n,
9373
- limit: O_,
9405
+ limit: k_,
9374
9406
  q: t.q ?? void 0,
9375
9407
  categoryId: t.categoryId ?? void 0,
9376
9408
  departmentId: t.departmentId ?? void 0,
@@ -9391,7 +9423,7 @@ function A_() {
9391
9423
  children: [
9392
9424
  /* @__PURE__ */ V("aside", {
9393
9425
  className: "med-feed-layout__left",
9394
- children: /* @__PURE__ */ V(D_, {
9426
+ children: /* @__PURE__ */ V(O_, {
9395
9427
  categories: r,
9396
9428
  filters: t,
9397
9429
  onSelect: n
@@ -9431,7 +9463,7 @@ function A_() {
9431
9463
  }
9432
9464
  //#endregion
9433
9465
  //#region src/features/feed/post-detail-page.tsx
9434
- function j_() {
9466
+ function M_() {
9435
9467
  let { postId: e = "" } = ve(), { api: t, basePath: n, me: r } = G(), i = _e(), a = K(F(() => t.getPost(e), [t, e]), e);
9436
9468
  if (a.loading) return /* @__PURE__ */ V("div", {
9437
9469
  className: "med-feed-column",
@@ -9464,17 +9496,17 @@ function j_() {
9464
9496
  }
9465
9497
  //#endregion
9466
9498
  //#region src/app/newsfeed-routes.tsx
9467
- function M_() {
9499
+ function N_() {
9468
9500
  return /* @__PURE__ */ V("div", {
9469
9501
  className: "med-feed-content",
9470
9502
  children: /* @__PURE__ */ H(ge, { children: [
9471
9503
  /* @__PURE__ */ V(U, {
9472
9504
  index: !0,
9473
- element: /* @__PURE__ */ V(A_, {})
9505
+ element: /* @__PURE__ */ V(j_, {})
9474
9506
  }),
9475
9507
  /* @__PURE__ */ V(U, {
9476
9508
  path: "posts/:postId",
9477
- element: /* @__PURE__ */ V(j_, {})
9509
+ element: /* @__PURE__ */ V(M_, {})
9478
9510
  }),
9479
9511
  /* @__PURE__ */ V(U, {
9480
9512
  path: "*",
@@ -9488,15 +9520,15 @@ function M_() {
9488
9520
  }
9489
9521
  //#endregion
9490
9522
  //#region src/app/newsfeed-module.tsx
9491
- function N_(e) {
9523
+ function P_(e) {
9492
9524
  return /* @__PURE__ */ V(kn, {
9493
9525
  runtimeProps: e,
9494
- children: /* @__PURE__ */ V(M_, {})
9526
+ children: /* @__PURE__ */ V(N_, {})
9495
9527
  });
9496
9528
  }
9497
9529
  //#endregion
9498
9530
  //#region src/features/composer/category-select.tsx
9499
- function P_({ categories: e, value: t, onChange: n }) {
9531
+ function F_({ categories: e, value: t, onChange: n }) {
9500
9532
  let r = e.filter((e) => !e.hidden).map((e) => ({
9501
9533
  value: e.id,
9502
9534
  label: e.name
@@ -9514,60 +9546,60 @@ function P_({ categories: e, value: t, onChange: n }) {
9514
9546
  }
9515
9547
  //#endregion
9516
9548
  //#region src/features/composer/format-text.ts
9517
- var F_ = (e) => $t.includes(e), I_ = (e) => Qt.includes(e), L_ = {
9549
+ var I_ = (e) => $t.includes(e), L_ = (e) => Qt.includes(e), R_ = {
9518
9550
  bold: "**",
9519
9551
  italic: "*",
9520
9552
  underline: "__",
9521
9553
  strike: "~~"
9522
- }, R_ = {
9554
+ }, z_ = {
9523
9555
  bold: "chữ đậm",
9524
9556
  italic: "chữ nghiêng",
9525
9557
  underline: "chữ gạch chân",
9526
9558
  strike: "chữ gạch ngang"
9527
9559
  };
9528
- function z_(e, t, n, r) {
9529
- let i = L_[r], a = e.slice(0, t), o = e.slice(t, n), s = e.slice(n);
9560
+ function B_(e, t, n, r) {
9561
+ let i = R_[r], a = e.slice(0, t), o = e.slice(t, n), s = e.slice(n);
9530
9562
  if (a.endsWith(i) && s.startsWith(i)) return {
9531
9563
  text: a.slice(0, -i.length) + o + s.slice(i.length),
9532
9564
  selectionStart: t - i.length,
9533
9565
  selectionEnd: n - i.length
9534
9566
  };
9535
- let c = o || R_[r];
9567
+ let c = o || z_[r];
9536
9568
  return {
9537
9569
  text: `${a}${i}${c}${i}${s}`,
9538
9570
  selectionStart: t + i.length,
9539
9571
  selectionEnd: t + i.length + c.length
9540
9572
  };
9541
9573
  }
9542
- var B_ = {
9574
+ var V_ = {
9543
9575
  heading: () => "# ",
9544
9576
  bullets: () => "- ",
9545
9577
  numbers: (e) => `${e + 1}. `,
9546
9578
  quote: () => "> "
9547
- }, V_ = {
9579
+ }, H_ = {
9548
9580
  heading: /^#{1,3}\s+/,
9549
9581
  bullets: /^[-•]\s+/,
9550
9582
  numbers: /^\d{1,3}[.)]\s+/,
9551
9583
  quote: /^>\s?/
9552
- }, H_ = /^(#{1,3}\s+|[-•]\s+|\d{1,3}[.)]\s+|>\s?)/;
9553
- function U_(e, t) {
9584
+ }, U_ = /^(#{1,3}\s+|[-•]\s+|\d{1,3}[.)]\s+|>\s?)/;
9585
+ function W_(e, t) {
9554
9586
  let n = 0, r = 0;
9555
9587
  for (; (n = e.indexOf(t, n)) !== -1;) r += 1, n += t.length;
9556
9588
  return r;
9557
9589
  }
9558
- function W_(e, t, n) {
9559
- let r = L_[n];
9560
- return U_(e, r) % 2 == 1 && U_(t, r) > 0;
9561
- }
9562
9590
  function G_(e, t, n) {
9591
+ let r = R_[n];
9592
+ return W_(e, r) % 2 == 1 && W_(t, r) > 0;
9593
+ }
9594
+ function K_(e, t, n) {
9563
9595
  let r = e.slice(0, t), i = e.slice(n);
9564
- return Object.keys(L_).filter((e) => W_(r, i, e));
9596
+ return Object.keys(R_).filter((e) => G_(r, i, e));
9565
9597
  }
9566
- function K_(e, t) {
9598
+ function q_(e, t) {
9567
9599
  let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t), i = e.slice(n, r === -1 ? e.length : r).trimStart();
9568
- return Object.keys(V_).filter((e) => V_[e].test(i));
9600
+ return Object.keys(H_).filter((e) => H_[e].test(i));
9569
9601
  }
9570
- function q_(e, t) {
9602
+ function J_(e, t) {
9571
9603
  let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t), i = r === -1 ? e.length : r, a = e.slice(n, i), o = a.match(/^ */)?.[0] ?? "", s = a.slice(o.length), c = s.match(/^(\d{1,3})[.)]\s+/), l = s.match(/^[-•]\s+/), u = s.match(/^>\s?/), d = c?.[0] ?? l?.[0] ?? u?.[0];
9572
9604
  if (!d) return null;
9573
9605
  if (!s.slice(d.length).trim()) return {
@@ -9582,22 +9614,22 @@ function q_(e, t) {
9582
9614
  selectionEnd: t + f.length
9583
9615
  };
9584
9616
  }
9585
- function J_(e, t, n, r) {
9617
+ function Y_(e, t, n, r) {
9586
9618
  let i = e.lastIndexOf("\n", t - 1) + 1, a = e.indexOf("\n", n), o = a === -1 ? e.length : a, s = e.slice(i, o).split("\n").map((e) => ({
9587
9619
  indent: e.match(/^ */)?.[0] ?? "",
9588
9620
  rest: e.trimStart()
9589
- })), c = s.every(({ rest: e }) => V_[r].test(e)), l = s.map(({ indent: e, rest: t }, n) => c ? e + t.replace(V_[r], "") : e + B_[r](n) + t.replace(H_, "")).join("\n");
9621
+ })), c = s.every(({ rest: e }) => H_[r].test(e)), l = s.map(({ indent: e, rest: t }, n) => c ? e + t.replace(H_[r], "") : e + V_[r](n) + t.replace(U_, "")).join("\n");
9590
9622
  return {
9591
9623
  text: e.slice(0, i) + l + e.slice(o),
9592
9624
  selectionStart: i,
9593
9625
  selectionEnd: i + l.length
9594
9626
  };
9595
9627
  }
9596
- var Y_ = " ";
9597
- function X_(e, t, n, r) {
9628
+ var X_ = " ";
9629
+ function Z_(e, t, n, r) {
9598
9630
  let i = e.lastIndexOf("\n", t - 1) + 1, a = e.indexOf("\n", n), o = a === -1 ? e.length : a, s = e.slice(i, o).split("\n"), c = s.map((e) => {
9599
9631
  let t = Math.min(Math.floor((e.match(/^ */)?.[0].length ?? 0) / 2), 4), n = Math.max(0, Math.min(4, t + r));
9600
- return Y_.repeat(n) + e.trimStart();
9632
+ return X_.repeat(n) + e.trimStart();
9601
9633
  }), l = c.join("\n"), u = c[0].length - s[0].length;
9602
9634
  return {
9603
9635
  text: e.slice(0, i) + l + e.slice(o),
@@ -9605,18 +9637,18 @@ function X_(e, t, n, r) {
9605
9637
  selectionEnd: Math.max(i, n + l.length - s.join("\n").length)
9606
9638
  };
9607
9639
  }
9608
- function Z_(e, t, n, r, i) {
9640
+ function Q_(e, t, n, r, i) {
9609
9641
  let a = e.slice(0, t), o = e.slice(n), s = a.lastIndexOf("{");
9610
9642
  if (s !== -1 && a.indexOf("}", s) === -1 && o.startsWith("}")) {
9611
9643
  let i = a.slice(s + 1), c = i.indexOf("|");
9612
9644
  if (c !== -1) {
9613
- let a = i.slice(0, c).split(" "), l = i.slice(c + 1), u = e.slice(t, n), d = F_(r), f = a.filter((e) => e !== r && F_(e) !== d), p = a.includes(r) ? f : [...f, r], m = s + l.length;
9645
+ let a = i.slice(0, c).split(" "), l = i.slice(c + 1), u = e.slice(t, n), d = I_(r), f = a.filter((e) => e !== r && I_(e) !== d), p = a.includes(r) ? f : [...f, r], m = s + l.length;
9614
9646
  if (p.length === 0) return {
9615
9647
  text: e.slice(0, s) + l + u + o.slice(1),
9616
9648
  selectionStart: m,
9617
9649
  selectionEnd: m + u.length
9618
9650
  };
9619
- let h = `{${[...p.filter((e) => !F_(e)), ...p.filter(F_)].join(" ")}|`;
9651
+ let h = `{${[...p.filter((e) => !I_(e)), ...p.filter(I_)].join(" ")}|`;
9620
9652
  return {
9621
9653
  text: `${e.slice(0, s)}${h}${l}${u}}${o.slice(1)}`,
9622
9654
  selectionStart: s + h.length + l.length,
@@ -9631,27 +9663,27 @@ function Z_(e, t, n, r, i) {
9631
9663
  selectionEnd: t + c.length + l.length
9632
9664
  };
9633
9665
  }
9634
- function Q_(e, t, n, r) {
9635
- return Z_(e, t, n, r, "chữ đổi màu");
9636
- }
9637
9666
  function $_(e, t, n, r) {
9638
- return Z_(e, t, n, r, "chữ đổi cỡ");
9667
+ return Q_(e, t, n, r, "chữ đổi màu");
9639
9668
  }
9640
- function ev(e, t) {
9669
+ function ev(e, t, n, r) {
9670
+ return Q_(e, t, n, r, "chữ đổi cỡ");
9671
+ }
9672
+ function tv(e, t) {
9641
9673
  let n = e.slice(0, t), r = n.lastIndexOf("{");
9642
9674
  if (r === -1 || n.indexOf("}", r) !== -1) return [];
9643
9675
  let i = n.slice(r + 1), a = i.indexOf("|");
9644
9676
  return a === -1 ? [] : i.slice(0, a).split(" ");
9645
9677
  }
9646
- function tv(e, t) {
9647
- return ev(e, t).find(I_) ?? null;
9648
- }
9649
9678
  function nv(e, t) {
9650
- return ev(e, t).find(F_) ?? null;
9679
+ return tv(e, t).find(L_) ?? null;
9680
+ }
9681
+ function rv(e, t) {
9682
+ return tv(e, t).find(I_) ?? null;
9651
9683
  }
9652
9684
  //#endregion
9653
9685
  //#region src/features/composer/format-toolbar.tsx
9654
- var rv = [
9686
+ var iv = [
9655
9687
  {
9656
9688
  format: "bold",
9657
9689
  label: "In đậm (Ctrl+B)",
@@ -9672,7 +9704,7 @@ var rv = [
9672
9704
  label: "Gạch ngang",
9673
9705
  icon: /* @__PURE__ */ V(At, {})
9674
9706
  }
9675
- ], iv = [
9707
+ ], av = [
9676
9708
  {
9677
9709
  format: "heading",
9678
9710
  label: "Tiêu đề",
@@ -9696,7 +9728,7 @@ var rv = [
9696
9728
  children: "❝"
9697
9729
  })
9698
9730
  }
9699
- ], av = [
9731
+ ], ov = [
9700
9732
  {
9701
9733
  color: "red",
9702
9734
  hex: "#dc2626",
@@ -9727,7 +9759,7 @@ var rv = [
9727
9759
  hex: "#6b7280",
9728
9760
  label: "Xám"
9729
9761
  }
9730
- ], ov = [
9762
+ ], sv = [
9731
9763
  {
9732
9764
  size: "sm",
9733
9765
  label: "Nhỏ",
@@ -9744,7 +9776,7 @@ var rv = [
9744
9776
  preview: 21
9745
9777
  }
9746
9778
  ];
9747
- function sv({ onInline: e, onLines: t, activeInline: n = [], activeLines: r = [], onColor: i, activeColor: a, onIndent: o, onSize: c, activeSize: l, onUndo: u, onRedo: d, canUndo: f, canRedo: p }) {
9779
+ function cv({ onInline: e, onLines: t, activeInline: n = [], activeLines: r = [], onColor: i, activeColor: a, onIndent: o, onSize: c, activeSize: l, onUndo: u, onRedo: d, canUndo: f, canRedo: p }) {
9748
9780
  let m = (e) => e.preventDefault(), h = (e, t, n, r, i, a = !1) => /* @__PURE__ */ V(A, {
9749
9781
  title: e,
9750
9782
  children: /* @__PURE__ */ V(s, {
@@ -9770,7 +9802,7 @@ function sv({ onInline: e, onLines: t, activeInline: n = [], activeLines: r = []
9770
9802
  className: "med-feed-format-bar__divider",
9771
9803
  "aria-hidden": !0
9772
9804
  }),
9773
- rv.map((t) => h(t.label, t.icon, n.includes(t.format), () => e(t.format), t.format)),
9805
+ iv.map((t) => h(t.label, t.icon, n.includes(t.format), () => e(t.format), t.format)),
9774
9806
  /* @__PURE__ */ V(C, {
9775
9807
  trigger: "click",
9776
9808
  placement: "bottom",
@@ -9778,7 +9810,7 @@ function sv({ onInline: e, onLines: t, activeInline: n = [], activeLines: r = []
9778
9810
  className: "med-feed-format-bar__colors",
9779
9811
  role: "menu",
9780
9812
  "aria-label": "Màu chữ",
9781
- children: av.map((e) => /* @__PURE__ */ V("button", {
9813
+ children: ov.map((e) => /* @__PURE__ */ V("button", {
9782
9814
  type: "button",
9783
9815
  role: "menuitem",
9784
9816
  "aria-label": `Màu ${e.label}`,
@@ -9809,7 +9841,7 @@ function sv({ onInline: e, onLines: t, activeInline: n = [], activeLines: r = []
9809
9841
  className: "med-feed-format-bar__sizes",
9810
9842
  role: "menu",
9811
9843
  "aria-label": "Cỡ chữ",
9812
- children: ov.map((e) => /* @__PURE__ */ H("button", {
9844
+ children: sv.map((e) => /* @__PURE__ */ H("button", {
9813
9845
  type: "button",
9814
9846
  role: "menuitem",
9815
9847
  "aria-label": `Cỡ chữ ${e.label}`,
@@ -9843,7 +9875,7 @@ function sv({ onInline: e, onLines: t, activeInline: n = [], activeLines: r = []
9843
9875
  className: "med-feed-format-bar__divider",
9844
9876
  "aria-hidden": !0
9845
9877
  }),
9846
- iv.map((e) => h(e.label, e.icon, r.includes(e.format), () => t(e.format), e.format)),
9878
+ av.map((e) => h(e.label, e.icon, r.includes(e.format), () => t(e.format), e.format)),
9847
9879
  h("Thụt đầu dòng", /* @__PURE__ */ V(ct, {}), !1, () => o?.(1), "indent"),
9848
9880
  h("Bỏ thụt đầu dòng", /* @__PURE__ */ V(st, {}), !1, () => o?.(-1), "outdent")
9849
9881
  ]
@@ -9851,10 +9883,10 @@ function sv({ onInline: e, onLines: t, activeInline: n = [], activeLines: r = []
9851
9883
  }
9852
9884
  //#endregion
9853
9885
  //#region src/shared/utils/upload-error.ts
9854
- function cv(e, t) {
9886
+ function lv(e, t) {
9855
9887
  return e instanceof Ht && e.status >= 400 && e.status < 500 ? `${t}: ${e.message}` : `Không tải lên được ${t}`;
9856
9888
  }
9857
- var lv = [
9889
+ var uv = [
9858
9890
  {
9859
9891
  key: "image",
9860
9892
  label: "Ảnh",
@@ -9877,11 +9909,11 @@ var lv = [
9877
9909
  kind: "document"
9878
9910
  }
9879
9911
  ];
9880
- function uv({ count: e, disabled: t, variant: n = "label", onUploadStart: r, onUploaded: i, onQuestion: a }) {
9912
+ function dv({ count: e, disabled: t, variant: n = "label", onUploadStart: r, onUploaded: i, onQuestion: a }) {
9881
9913
  let { api: o, me: c } = G(), l = c.mediaLimitsMb ?? Zt, u = ({ file: e }) => {
9882
9914
  let t = e;
9883
9915
  r(), o.uploadMedia(t, t.name).then(i, (e) => {
9884
- M.error(cv(e, t.name)), i(null);
9916
+ M.error(lv(e, t.name)), i(null);
9885
9917
  });
9886
9918
  }, d = (t) => (n, r) => e + r.length > 10 ? (M.warning("Mỗi bài tối đa 10 tệp"), ie.LIST_IGNORE) : n.size > l[t] * 1024 * 1024 ? (M.warning(`${n.name}: tối đa ${l[t]} MB`), ie.LIST_IGNORE) : !0, f = (e, r, i) => n === "icon" ? /* @__PURE__ */ V(A, {
9887
9919
  title: e,
@@ -9902,7 +9934,7 @@ function uv({ count: e, disabled: t, variant: n = "label", onUploadStart: r, onU
9902
9934
  onClick: i,
9903
9935
  children: e
9904
9936
  });
9905
- return /* @__PURE__ */ H(B, { children: [lv.map((e) => /* @__PURE__ */ V(ie, {
9937
+ return /* @__PURE__ */ H(B, { children: [uv.map((e) => /* @__PURE__ */ V(ie, {
9906
9938
  accept: e.accept,
9907
9939
  multiple: !0,
9908
9940
  showUploadList: !1,
@@ -9911,7 +9943,7 @@ function uv({ count: e, disabled: t, variant: n = "label", onUploadStart: r, onU
9911
9943
  children: f(e.label, e.icon)
9912
9944
  }, e.key)), a && f("Hỏi đáp", /* @__PURE__ */ V(xt, { style: { color: "#f7b928" } }), a)] });
9913
9945
  }
9914
- function dv({ media: e, uploadingCount: t, onRemove: n }) {
9946
+ function fv({ media: e, uploadingCount: t, onRemove: n }) {
9915
9947
  let r = e.filter((e) => e.kind !== "DOCUMENT"), i = e.filter((e) => e.kind === "DOCUMENT");
9916
9948
  return e.length === 0 && t === 0 ? null : /* @__PURE__ */ H("div", {
9917
9949
  className: "med-feed-attached",
@@ -9965,15 +9997,15 @@ function dv({ media: e, uploadingCount: t, onRemove: n }) {
9965
9997
  }
9966
9998
  //#endregion
9967
9999
  //#region src/features/composer/composer-form.tsx
9968
- var fv = "hỏi đáp", pv = 85;
9969
- function mv(e) {
9970
- return e.find((e) => e.name.trim().toLowerCase() === fv);
10000
+ var pv = "hỏi đáp", mv = 85;
10001
+ function hv(e) {
10002
+ return e.find((e) => e.name.trim().toLowerCase() === pv);
9971
10003
  }
9972
- var hv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", onDirtyChange: r, onSaved: i, zoomed: a = !1, showPreview: o = !1 }, c) {
9973
- let { api: l, me: u } = G(), d = R(null), f = R(new Map(t?.mentionedUsers.map((e) => [e.fullName, e]))), p = R(crypto.randomUUID()), m = mv(e), [h, _] = z(mh(t?.content ?? "", t?.mentionedUsers ?? [])), [v, y] = z(t?.category?.id ?? (n === "question" ? m?.id ?? null : null)), [b, x] = z(t?.media ?? []), [S, w] = z(0), [T, E] = z(null), [D, O] = z(null), [k, ee] = z(""), [te, ne] = z(!1), [j, ie] = z(!0), [ae, N] = z({
10004
+ var gv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", onDirtyChange: r, onSaved: i, zoomed: a = !1, showPreview: o = !1 }, c) {
10005
+ let { api: l, me: u } = G(), d = R(null), f = R(new Map(t?.mentionedUsers.map((e) => [e.fullName, e]))), p = R(crypto.randomUUID()), m = hv(e), [h, _] = z(mh(t?.content ?? "", t?.mentionedUsers ?? [])), [v, y] = z(t?.category?.id ?? (n === "question" ? m?.id ?? null : null)), [b, x] = z(t?.media ?? []), [S, w] = z(0), [T, E] = z(null), [D, O] = z(null), [k, ee] = z(""), [te, ne] = z(!1), [j, ie] = z(!0), [ae, N] = z({
9974
10006
  start: 0,
9975
10007
  end: 0
9976
- }), [P, oe] = z([]), [se, ce] = z([]), F = !!t, le = !h.trim() && b.length === 0, de = xn(h), L = T !== null || S > 0, fe = b.length === 0 && h.length < pv && !h.includes("\n"), B = G_(h, ae.start, ae.end), pe = K_(h, ae.start), me = (e) => {
10008
+ }), [P, oe] = z([]), [se, ce] = z([]), F = !!t, le = !h.trim() && b.length === 0, de = xn(h), L = T !== null || S > 0, fe = b.length === 0 && h.length < mv && !h.includes("\n"), B = K_(h, ae.start, ae.end), pe = q_(h, ae.start), me = (e) => {
9977
10009
  e !== h && (oe((e) => [...e.slice(-99), h]), ce([]), _(e));
9978
10010
  }, he = () => {
9979
10011
  if (P.length === 0) return;
@@ -10027,7 +10059,7 @@ var hv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", o
10027
10059
  }, be = (e) => {
10028
10060
  let t = _e(), n = t?.selectionStart ?? h.length, r = t?.selectionEnd ?? h.length;
10029
10061
  ye(e(h, n, r));
10030
- }, Se = (e) => be((t, n, r) => z_(t, n, r, e)), Ce = (e) => be((t, n, r) => J_(t, n, r, e)), we = {
10062
+ }, Se = (e) => be((t, n, r) => B_(t, n, r, e)), Ce = (e) => be((t, n, r) => Y_(t, n, r, e)), we = {
10031
10063
  b: "bold",
10032
10064
  i: "italic",
10033
10065
  u: "underline"
@@ -10042,7 +10074,7 @@ var hv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", o
10042
10074
  return;
10043
10075
  }
10044
10076
  if (e.key === "Enter" && !e.shiftKey && n === r) {
10045
- let t = q_(h, n);
10077
+ let t = J_(h, n);
10046
10078
  if (t) {
10047
10079
  e.preventDefault(), ye(t);
10048
10080
  return;
@@ -10094,7 +10126,7 @@ var hv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", o
10094
10126
  children: tg.name
10095
10127
  }), /* @__PURE__ */ V("span", {
10096
10128
  className: "med-feed-composer-form__pills",
10097
- children: /* @__PURE__ */ V(P_, {
10129
+ children: /* @__PURE__ */ V(F_, {
10098
10130
  categories: e,
10099
10131
  value: v,
10100
10132
  onChange: y
@@ -10105,16 +10137,16 @@ var hv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", o
10105
10137
  /* @__PURE__ */ H("div", {
10106
10138
  className: "med-feed-composer-form__body",
10107
10139
  children: [
10108
- j && /* @__PURE__ */ V(sv, {
10140
+ j && /* @__PURE__ */ V(cv, {
10109
10141
  onInline: Se,
10110
10142
  onLines: Ce,
10111
10143
  activeInline: B,
10112
10144
  activeLines: pe,
10113
- onColor: (e) => be((t, n, r) => Q_(t, n, r, e)),
10114
- activeColor: tv(h, ae.start),
10115
- onIndent: (e) => be((t, n, r) => X_(t, n, r, e)),
10116
- onSize: (e) => be((t, n, r) => $_(t, n, r, e)),
10117
- activeSize: nv(h, ae.start),
10145
+ onColor: (e) => be((t, n, r) => $_(t, n, r, e)),
10146
+ activeColor: nv(h, ae.start),
10147
+ onIndent: (e) => be((t, n, r) => Z_(t, n, r, e)),
10148
+ onSize: (e) => be((t, n, r) => ev(t, n, r, e)),
10149
+ activeSize: rv(h, ae.start),
10118
10150
  onUndo: he,
10119
10151
  onRedo: U,
10120
10152
  canUndo: P.length > 0,
@@ -10154,7 +10186,7 @@ var hv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", o
10154
10186
  children: k
10155
10187
  }),
10156
10188
  de && /* @__PURE__ */ V(vg, { url: de }),
10157
- /* @__PURE__ */ V(dv, {
10189
+ /* @__PURE__ */ V(fv, {
10158
10190
  media: b,
10159
10191
  uploadingCount: S,
10160
10192
  onRemove: (e) => x((t) => t.filter((t) => t.id !== e))
@@ -10243,7 +10275,7 @@ var hv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", o
10243
10275
  children: "Thêm vào bài viết của bạn"
10244
10276
  }), /* @__PURE__ */ H("span", {
10245
10277
  className: "med-feed-composer-form__add-actions",
10246
- children: [/* @__PURE__ */ V(uv, {
10278
+ children: [/* @__PURE__ */ V(dv, {
10247
10279
  variant: "icon",
10248
10280
  count: b.length + S,
10249
10281
  disabled: T !== null,
@@ -10325,7 +10357,7 @@ var hv = ce(function({ categories: e = [], initialPost: t, intent: n = "text", o
10325
10357
  });
10326
10358
  //#endregion
10327
10359
  //#region src/features/composer/create-post-modal.tsx
10328
- function gv({ open: e, categories: t, intent: n, initialPost: r, onClose: i, onSaved: a }) {
10360
+ function _v({ open: e, categories: t, intent: n, initialPost: r, onClose: i, onSaved: a }) {
10329
10361
  let o = R(!1), c = R(null), [l, u] = z(!1), [d, f] = z(!1), [p, m] = z(!1), [h, g] = z(!1), _ = F((e) => {
10330
10362
  o.current = e;
10331
10363
  }, []), v = () => {
@@ -10389,7 +10421,7 @@ function gv({ open: e, categories: t, intent: n, initialPost: r, onClose: i, onS
10389
10421
  onCancel: v,
10390
10422
  closeIcon: /* @__PURE__ */ V(Ae, {}),
10391
10423
  className: p ? "med-feed-portal med-feed-create-modal med-feed-create-modal--fullscreen" : "med-feed-portal med-feed-create-modal",
10392
- children: /* @__PURE__ */ V(hv, {
10424
+ children: /* @__PURE__ */ V(gv, {
10393
10425
  ref: c,
10394
10426
  zoomed: p,
10395
10427
  showPreview: h,
@@ -10435,7 +10467,7 @@ function gv({ open: e, categories: t, intent: n, initialPost: r, onClose: i, onS
10435
10467
  }
10436
10468
  //#endregion
10437
10469
  //#region src/features/composer/create-post-button.tsx
10438
- function _v({ categories: e, onSaved: t }) {
10470
+ function vv({ categories: e, onSaved: t }) {
10439
10471
  let { me: n } = G(), [r, i] = z(null);
10440
10472
  return n.canPost ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H(s, {
10441
10473
  type: "primary",
@@ -10445,7 +10477,7 @@ function _v({ categories: e, onSaved: t }) {
10445
10477
  className: "med-feed-create-button__icon",
10446
10478
  "aria-hidden": !0
10447
10479
  }), "Tạo bài viết"]
10448
- }), /* @__PURE__ */ V(gv, {
10480
+ }), /* @__PURE__ */ V(_v, {
10449
10481
  open: r !== null,
10450
10482
  categories: e,
10451
10483
  intent: "text",
@@ -10455,7 +10487,7 @@ function _v({ categories: e, onSaved: t }) {
10455
10487
  }
10456
10488
  //#endregion
10457
10489
  //#region src/shared/components/page-header.tsx
10458
- function vv({ title: e, description: t, extra: n }) {
10490
+ function yv({ title: e, description: t, extra: n }) {
10459
10491
  return /* @__PURE__ */ H("div", {
10460
10492
  className: "med-feed-page-header",
10461
10493
  children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(j.Title, {
@@ -10470,7 +10502,7 @@ function vv({ title: e, description: t, extra: n }) {
10470
10502
  }
10471
10503
  //#endregion
10472
10504
  //#region src/features/feed/my-posts-page.tsx
10473
- var yv = [
10505
+ var bv = [
10474
10506
  {
10475
10507
  key: "ALL",
10476
10508
  label: "Tất cả"
@@ -10496,7 +10528,7 @@ var yv = [
10496
10528
  label: "Đã gỡ"
10497
10529
  }
10498
10530
  ];
10499
- function bv() {
10531
+ function xv() {
10500
10532
  let { api: e, me: t, isPostFeed: n } = G(), [r, i] = z("ALL"), [a, o] = z(null), c = r === "ALL" ? void 0 : r, l = K(F(() => e.listCategories(), [e]), "categories"), u = jn(F((t) => e.listMyPosts({
10501
10533
  status: c,
10502
10534
  cursor: t
@@ -10511,10 +10543,10 @@ function bv() {
10511
10543
  return /* @__PURE__ */ H("div", {
10512
10544
  className: "med-feed-my-posts med-feed-stack",
10513
10545
  children: [
10514
- /* @__PURE__ */ V(vv, {
10546
+ /* @__PURE__ */ V(yv, {
10515
10547
  title: "Bài của tôi",
10516
10548
  description: "Quản lý nháp, bài chờ duyệt và bài đang phát hành của bạn",
10517
- extra: n && /* @__PURE__ */ V(_v, {
10549
+ extra: n && /* @__PURE__ */ V(vv, {
10518
10550
  categories: l.data ?? [],
10519
10551
  onSaved: (e) => {
10520
10552
  (r === "ALL" || r === e.status) && u.prependItem(e);
@@ -10524,7 +10556,7 @@ function bv() {
10524
10556
  /* @__PURE__ */ V(ne, {
10525
10557
  activeKey: r,
10526
10558
  onChange: (e) => i(e),
10527
- items: yv.map((e) => ({
10559
+ items: bv.map((e) => ({
10528
10560
  key: e.key,
10529
10561
  label: e.label
10530
10562
  }))
@@ -10553,7 +10585,7 @@ function bv() {
10553
10585
  })
10554
10586
  })
10555
10587
  }),
10556
- /* @__PURE__ */ V(gv, {
10588
+ /* @__PURE__ */ V(_v, {
10557
10589
  open: a !== null,
10558
10590
  categories: l.data ?? [],
10559
10591
  intent: "text",
@@ -10566,7 +10598,7 @@ function bv() {
10566
10598
  }
10567
10599
  //#endregion
10568
10600
  //#region src/shared/components/image-upload-field.tsx
10569
- function xv({ value: e, onChange: t, aspectRatio: n = "16 / 9", maxWidth: r }) {
10601
+ function Sv({ value: e, onChange: t, aspectRatio: n = "16 / 9", maxWidth: r }) {
10570
10602
  let { api: i } = G(), a = R(null), [o, s] = z(!1), [c, l] = z(!1), u = async (e) => {
10571
10603
  if (e) {
10572
10604
  if (!e.type.startsWith("image/")) {
@@ -10635,8 +10667,8 @@ function xv({ value: e, onChange: t, aspectRatio: n = "16 / 9", maxWidth: r }) {
10635
10667
  }
10636
10668
  //#endregion
10637
10669
  //#region src/features/manage/events/events-admin-page.tsx
10638
- var Sv = "DD/MM/YYYY HH:mm";
10639
- function Cv() {
10670
+ var Cv = "DD/MM/YYYY HH:mm";
10671
+ function wv() {
10640
10672
  let { api: e } = G(), t = K(F(() => e.listManageEvents(), [e]), "manage-events"), [n, r] = z(null), [i, a] = z(!1), [o] = m.useForm(), c = (e) => {
10641
10673
  o.setFieldsValue(e === "new" ? {
10642
10674
  title: "",
@@ -10680,7 +10712,7 @@ function Cv() {
10680
10712
  return /* @__PURE__ */ H("div", {
10681
10713
  className: "med-feed-wide med-feed-events-admin",
10682
10714
  children: [
10683
- /* @__PURE__ */ V(vv, {
10715
+ /* @__PURE__ */ V(yv, {
10684
10716
  title: "Sự kiện",
10685
10717
  description: "Khung bên phải bảng tin hiện sự kiện mới tạo gần nhất",
10686
10718
  extra: /* @__PURE__ */ V(s, {
@@ -10780,7 +10812,7 @@ function Cv() {
10780
10812
  required: !0,
10781
10813
  message: "Cần có ảnh bìa"
10782
10814
  }],
10783
- children: /* @__PURE__ */ V(xv, { aspectRatio: "16 / 9" })
10815
+ children: /* @__PURE__ */ V(Sv, { aspectRatio: "16 / 9" })
10784
10816
  }),
10785
10817
  /* @__PURE__ */ V(m.Item, {
10786
10818
  name: "title",
@@ -10808,7 +10840,7 @@ function Cv() {
10808
10840
  children: /* @__PURE__ */ V(u, {
10809
10841
  size: "large",
10810
10842
  showTime: !0,
10811
- format: Sv,
10843
+ format: Cv,
10812
10844
  style: { width: "100%" }
10813
10845
  })
10814
10846
  }), /* @__PURE__ */ V(m.Item, {
@@ -10822,7 +10854,7 @@ function Cv() {
10822
10854
  children: /* @__PURE__ */ V(u, {
10823
10855
  size: "large",
10824
10856
  showTime: !0,
10825
- format: Sv,
10857
+ format: Cv,
10826
10858
  placeholder: "Không bắt buộc",
10827
10859
  style: { width: "100%" }
10828
10860
  })
@@ -10855,8 +10887,8 @@ function Cv() {
10855
10887
  }
10856
10888
  //#endregion
10857
10889
  //#region src/features/manage/posts/author-select.tsx
10858
- var wv = 300;
10859
- function Tv({ value: e, onChange: t, placeholder: n = "Tất cả tác giả" }) {
10890
+ var Tv = 300;
10891
+ function Ev({ value: e, onChange: t, placeholder: n = "Tất cả tác giả" }) {
10860
10892
  let { api: r } = G(), [i, a] = z([]), [o, s] = z(!1), c = R();
10861
10893
  return I(() => () => clearTimeout(c.current), []), /* @__PURE__ */ V(E, {
10862
10894
  showSearch: !0,
@@ -10870,7 +10902,7 @@ function Tv({ value: e, onChange: t, placeholder: n = "Tất cả tác giả" })
10870
10902
  r.searchUsers(e).then((e) => {
10871
10903
  a(e), s(!1);
10872
10904
  }, () => s(!1));
10873
- }, wv));
10905
+ }, Tv));
10874
10906
  },
10875
10907
  onChange: (e) => t(e),
10876
10908
  notFoundContent: o ? /* @__PURE__ */ V(k, { size: "small" }) : "Gõ tên hoặc mã nhân viên",
@@ -10884,40 +10916,40 @@ function Tv({ value: e, onChange: t, placeholder: n = "Tất cả tác giả" })
10884
10916
  }
10885
10917
  //#endregion
10886
10918
  //#region src/shared/utils/date-range.ts
10887
- var Ev = {
10919
+ var Dv = {
10888
10920
  "7d": "7 ngày gần nhất",
10889
10921
  "30d": "30 ngày gần nhất",
10890
10922
  "90d": "90 ngày gần nhất",
10891
10923
  "this-month": "Tháng này",
10892
10924
  "this-year": "Năm nay"
10893
10925
  };
10894
- function Dv(e) {
10926
+ function Ov(e) {
10895
10927
  let t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
10896
10928
  return `${e.getFullYear()}-${t}-${n}`;
10897
10929
  }
10898
- function Ov(e) {
10930
+ function kv(e) {
10899
10931
  return typeof e == "object";
10900
10932
  }
10901
- function kv(e, t = /* @__PURE__ */ new Date()) {
10902
- if (Ov(e)) return e;
10933
+ function Av(e, t = /* @__PURE__ */ new Date()) {
10934
+ if (kv(e)) return e;
10903
10935
  let n = e, r = new Date(t);
10904
10936
  return n === "this-month" ? r.setDate(1) : n === "this-year" ? r.setMonth(0, 1) : r.setDate(t.getDate() - (Number.parseInt(n, 10) - 1)), {
10905
- from: Dv(r),
10906
- to: Dv(t)
10937
+ from: Ov(r),
10938
+ to: Ov(t)
10907
10939
  };
10908
10940
  }
10909
10941
  //#endregion
10910
10942
  //#region src/shared/components/date-range-select.tsx
10911
- var Av = "YYYY-MM-DD";
10912
- function jv({ value: e, onChange: t }) {
10913
- let n = kv(e), r = L(() => Object.fromEntries(Object.keys(Ev).map((e) => {
10914
- let { from: t, to: n } = kv(e);
10915
- return [Ev[e], [Bt(t, Av), Bt(n, Av)]];
10943
+ var jv = "YYYY-MM-DD";
10944
+ function Mv({ value: e, onChange: t }) {
10945
+ let n = Av(e), r = L(() => Object.fromEntries(Object.keys(Dv).map((e) => {
10946
+ let { from: t, to: n } = Av(e);
10947
+ return [Dv[e], [Bt(t, jv), Bt(n, jv)]];
10916
10948
  })), []);
10917
10949
  return /* @__PURE__ */ V("span", {
10918
10950
  className: "med-feed-date-range med-feed-pill-fields",
10919
10951
  children: /* @__PURE__ */ V(u.RangePicker, {
10920
- value: [Bt(n.from, Av), Bt(n.to, Av)],
10952
+ value: [Bt(n.from, jv), Bt(n.to, jv)],
10921
10953
  format: "DD/MM/YYYY",
10922
10954
  allowClear: !1,
10923
10955
  ranges: r,
@@ -10926,8 +10958,8 @@ function jv({ value: e, onChange: t }) {
10926
10958
  onChange: (e) => {
10927
10959
  let [n, r] = e ?? [];
10928
10960
  n && r && t({
10929
- from: n.format(Av),
10930
- to: r.format(Av)
10961
+ from: n.format(jv),
10962
+ to: r.format(jv)
10931
10963
  });
10932
10964
  }
10933
10965
  })
@@ -10935,7 +10967,7 @@ function jv({ value: e, onChange: t }) {
10935
10967
  }
10936
10968
  //#endregion
10937
10969
  //#region src/features/manage/posts/post-summary-cell.tsx
10938
- function Mv({ post: e, onOpen: t }) {
10970
+ function Nv({ post: e, onOpen: t }) {
10939
10971
  let n = new Map(e.mentionedUsers.map((e) => [e.id, e.fullName])), r = e.media.find((e) => e.kind === "IMAGE");
10940
10972
  return /* @__PURE__ */ H("button", {
10941
10973
  type: "button",
@@ -10964,7 +10996,7 @@ function Mv({ post: e, onOpen: t }) {
10964
10996
  }
10965
10997
  //#endregion
10966
10998
  //#region src/features/manage/posts/review-drawer.tsx
10967
- function Nv({ post: e, onClose: t, onChanged: n, onRemoved: r, onEdit: i, readOnly: a = !1 }) {
10999
+ function Pv({ post: e, onClose: t, onChanged: n, onRemoved: r, onEdit: i, readOnly: a = !1 }) {
10968
11000
  let { api: o } = G(), [c, l] = z(!1), u = async (e, r) => {
10969
11001
  l(!0);
10970
11002
  try {
@@ -11056,7 +11088,7 @@ function Nv({ post: e, onClose: t, onChanged: n, onRemoved: r, onEdit: i, readOn
11056
11088
  }
11057
11089
  //#endregion
11058
11090
  //#region src/features/manage/posts/manage-posts-page.tsx
11059
- var Pv = 10, Fv = [
11091
+ var Fv = 10, Iv = [
11060
11092
  {
11061
11093
  key: "PENDING",
11062
11094
  label: "Chờ duyệt",
@@ -11094,14 +11126,14 @@ var Pv = 10, Fv = [
11094
11126
  tone: "all"
11095
11127
  }
11096
11128
  ];
11097
- function Iv() {
11098
- let { api: e } = G(), [t, n] = z("30d"), [r, i] = z("PENDING"), [a, o] = z(), [c, l] = z(""), [u, d] = z(""), [f, p] = z(1), [m, h] = z([]), [_, v] = z(null), [y, b] = z(null), [x, S] = z(null), C = L(() => kv(t), [t]), w = K(F(() => e.listCategories(), [e]), "categories"), T = K(F(() => e.listManagePosts({
11129
+ function Lv() {
11130
+ let { api: e } = G(), [t, n] = z("30d"), [r, i] = z("PENDING"), [a, o] = z(), [c, l] = z(""), [u, d] = z(""), [f, p] = z(1), [m, h] = z([]), [_, v] = z(null), [y, b] = z(null), [x, S] = z(null), C = L(() => Av(t), [t]), w = K(F(() => e.listCategories(), [e]), "categories"), T = K(F(() => e.listManagePosts({
11099
11131
  ...C,
11100
11132
  status: r === "ALL" ? void 0 : r,
11101
11133
  authorId: a,
11102
11134
  q: c || void 0,
11103
11135
  page: f,
11104
- pageSize: Pv
11136
+ pageSize: Fv
11105
11137
  }), [
11106
11138
  e,
11107
11139
  C,
@@ -11157,10 +11189,10 @@ function Iv() {
11157
11189
  return /* @__PURE__ */ H("div", {
11158
11190
  className: "med-feed-wide med-feed-manage",
11159
11191
  children: [
11160
- /* @__PURE__ */ V(vv, {
11192
+ /* @__PURE__ */ V(yv, {
11161
11193
  title: "Trung tâm duyệt bài viết",
11162
11194
  description: "Duyệt, phát hành, gỡ và theo dõi tương tác của mọi bài viết trên bảng tin",
11163
- extra: /* @__PURE__ */ V(_v, {
11195
+ extra: /* @__PURE__ */ V(vv, {
11164
11196
  categories: w.data ?? [],
11165
11197
  onSaved: D
11166
11198
  })
@@ -11172,7 +11204,7 @@ function Iv() {
11172
11204
  className: "med-feed-manage__tabs",
11173
11205
  role: "tablist",
11174
11206
  "aria-label": "Lọc theo trạng thái",
11175
- children: Fv.map((e) => {
11207
+ children: Iv.map((e) => {
11176
11208
  let t = e.key === "ALL" ? E.data ? E.data.PENDING + E.data.APPROVED + E.data.PUBLISHED + E.data.UNPUBLISHED + E.data.DELETED : void 0 : E.data?.[e.key], n = r === e.key;
11177
11209
  return /* @__PURE__ */ H("button", {
11178
11210
  type: "button",
@@ -11202,15 +11234,15 @@ function Iv() {
11202
11234
  d(e.target.value), e.target.value || k(l)("");
11203
11235
  }
11204
11236
  }),
11205
- /* @__PURE__ */ V(jv, {
11237
+ /* @__PURE__ */ V(Mv, {
11206
11238
  value: t,
11207
11239
  onChange: k(n)
11208
11240
  }),
11209
- /* @__PURE__ */ V(Tv, {
11241
+ /* @__PURE__ */ V(Ev, {
11210
11242
  value: a,
11211
11243
  onChange: k(o)
11212
11244
  }),
11213
- (c || a || JSON.stringify(C) !== JSON.stringify(kv("30d"))) && /* @__PURE__ */ V(s, {
11245
+ (c || a || JSON.stringify(C) !== JSON.stringify(Av("30d"))) && /* @__PURE__ */ V(s, {
11214
11246
  type: "link",
11215
11247
  icon: /* @__PURE__ */ V(ke, {}),
11216
11248
  className: "med-feed-manage__clear",
@@ -11244,7 +11276,7 @@ function Iv() {
11244
11276
  {
11245
11277
  title: "Bài viết",
11246
11278
  key: "content",
11247
- render: (e, t) => /* @__PURE__ */ V(Mv, {
11279
+ render: (e, t) => /* @__PURE__ */ V(Nv, {
11248
11280
  post: t,
11249
11281
  onOpen: v
11250
11282
  })
@@ -11341,7 +11373,7 @@ function Iv() {
11341
11373
  scroll: { x: 1040 },
11342
11374
  pagination: {
11343
11375
  current: f,
11344
- pageSize: Pv,
11376
+ pageSize: Fv,
11345
11377
  total: T.data?.total ?? 0,
11346
11378
  showSizeChanger: !1,
11347
11379
  showTotal: (e, [t, n]) => `Hiển thị ${t}–${n} trong ${$(e)} bài viết`,
@@ -11352,14 +11384,14 @@ function Iv() {
11352
11384
  })
11353
11385
  ]
11354
11386
  }),
11355
- /* @__PURE__ */ V(Nv, {
11387
+ /* @__PURE__ */ V(Pv, {
11356
11388
  post: _,
11357
11389
  onClose: () => v(null),
11358
11390
  onChanged: D,
11359
11391
  onRemoved: D,
11360
11392
  onEdit: S
11361
11393
  }),
11362
- /* @__PURE__ */ V(gv, {
11394
+ /* @__PURE__ */ V(_v, {
11363
11395
  open: x !== null,
11364
11396
  categories: w.data ?? [],
11365
11397
  intent: "text",
@@ -11372,8 +11404,8 @@ function Iv() {
11372
11404
  }
11373
11405
  //#endregion
11374
11406
  //#region src/features/manage/banner/banner-settings-page.tsx
11375
- var Lv = /^https?:\/\/\S+$/;
11376
- function Rv() {
11407
+ var Rv = /^https?:\/\/\S+$/;
11408
+ function zv() {
11377
11409
  let { api: e } = G(), t = K(F(() => e.getRightBanner(), [e]), "banner-settings"), [n] = m.useForm(), [r, i] = z(!1), a = t.data?.imageUrl ? t.data : null;
11378
11410
  I(() => {
11379
11411
  t.data && n.setFieldsValue({
@@ -11406,7 +11438,7 @@ function Rv() {
11406
11438
  };
11407
11439
  return /* @__PURE__ */ H("div", {
11408
11440
  className: "med-feed-banner-settings",
11409
- children: [/* @__PURE__ */ V(vv, {
11441
+ children: [/* @__PURE__ */ V(yv, {
11410
11442
  title: "Banner bên phải",
11411
11443
  description: "Ảnh quảng cáo hiện dưới khung sự kiện ở cột phải bảng tin"
11412
11444
  }), /* @__PURE__ */ V("section", {
@@ -11424,7 +11456,7 @@ function Rv() {
11424
11456
  required: !0,
11425
11457
  message: "Cần chọn ảnh banner"
11426
11458
  }],
11427
- children: /* @__PURE__ */ V(xv, {
11459
+ children: /* @__PURE__ */ V(Sv, {
11428
11460
  aspectRatio: "4 / 7",
11429
11461
  maxWidth: 280
11430
11462
  })
@@ -11433,7 +11465,7 @@ function Rv() {
11433
11465
  name: "linkUrl",
11434
11466
  label: "Đường dẫn khi bấm vào (không bắt buộc)",
11435
11467
  rules: [{
11436
- pattern: Lv,
11468
+ pattern: Rv,
11437
11469
  message: "Đường dẫn phải bắt đầu bằng http:// hoặc https://"
11438
11470
  }],
11439
11471
  children: /* @__PURE__ */ V(g, {
@@ -11469,18 +11501,18 @@ function Rv() {
11469
11501
  }
11470
11502
  //#endregion
11471
11503
  //#region src/features/manage/categories/category-settings-page.tsx
11472
- var zv = "#2ea053";
11473
- function Bv() {
11504
+ var Bv = "#2ea053";
11505
+ function Vv() {
11474
11506
  let { api: e } = G(), t = K(F(() => e.listManageCategories(), [e]), "manage-categories"), [n, r] = z(null), [i, a] = z(!1), [o] = m.useForm(), c = m.useWatch("color", o), l = m.useWatch("name", o), u = n === "new" || !n ? null : n.id, d = c ? (t.data ?? []).find((e) => e.id !== u && e.color?.toLowerCase() === c.toLowerCase()) : void 0, f = (e) => {
11475
11507
  let n = (t.data ?? []).reduce((e, t) => Math.max(e, t.sortOrder + 1), 0);
11476
11508
  o.setFieldsValue(e === "new" ? {
11477
11509
  name: "",
11478
- color: zv,
11510
+ color: Bv,
11479
11511
  sortOrder: n,
11480
11512
  hidden: !1
11481
11513
  } : {
11482
11514
  name: e.name,
11483
- color: e.color ?? zv,
11515
+ color: e.color ?? Bv,
11484
11516
  sortOrder: e.sortOrder,
11485
11517
  hidden: e.hidden
11486
11518
  }), r(e);
@@ -11531,7 +11563,7 @@ function Bv() {
11531
11563
  return /* @__PURE__ */ H("div", {
11532
11564
  className: "med-feed-categories",
11533
11565
  children: [
11534
- /* @__PURE__ */ V(vv, {
11566
+ /* @__PURE__ */ V(yv, {
11535
11567
  title: "Thiết lập chuyên mục",
11536
11568
  description: "Tạo, sửa, ẩn hoặc xoá các chuyên mục của bảng tin",
11537
11569
  extra: /* @__PURE__ */ V(s, {
@@ -11567,7 +11599,7 @@ function Bv() {
11567
11599
  {
11568
11600
  title: "Chuyên mục",
11569
11601
  dataIndex: "name",
11570
- render: (e, t) => /* @__PURE__ */ V(Vv, {
11602
+ render: (e, t) => /* @__PURE__ */ V(Hv, {
11571
11603
  name: e,
11572
11604
  color: t.color
11573
11605
  })
@@ -11659,7 +11691,7 @@ function Bv() {
11659
11691
  children: [
11660
11692
  /* @__PURE__ */ H("div", {
11661
11693
  className: "med-feed-category-preview",
11662
- children: ["Xem trước", /* @__PURE__ */ V(Vv, {
11694
+ children: ["Xem trước", /* @__PURE__ */ V(Hv, {
11663
11695
  name: l?.trim() || "Tên chuyên mục",
11664
11696
  color: c
11665
11697
  })]
@@ -11683,7 +11715,7 @@ function Bv() {
11683
11715
  }],
11684
11716
  validateStatus: d ? "warning" : void 0,
11685
11717
  help: d ? `Màu này đã dùng cho "${d.name}"` : void 0,
11686
- children: /* @__PURE__ */ V(Hv, {})
11718
+ children: /* @__PURE__ */ V(Uv, {})
11687
11719
  }),
11688
11720
  /* @__PURE__ */ V(m.Item, {
11689
11721
  name: "sortOrder",
@@ -11702,7 +11734,7 @@ function Bv() {
11702
11734
  ]
11703
11735
  });
11704
11736
  }
11705
- function Vv({ name: e, color: t }) {
11737
+ function Hv({ name: e, color: t }) {
11706
11738
  return /* @__PURE__ */ H("span", {
11707
11739
  className: "med-feed-category-chip",
11708
11740
  style: t ? { "--tone": t } : void 0,
@@ -11715,14 +11747,14 @@ function Vv({ name: e, color: t }) {
11715
11747
  })]
11716
11748
  });
11717
11749
  }
11718
- function Hv({ value: e, onChange: t }) {
11750
+ function Uv({ value: e, onChange: t }) {
11719
11751
  let n = /^#[0-9a-fA-F]{6}$/.test(e ?? "");
11720
11752
  return /* @__PURE__ */ H("div", {
11721
11753
  className: "med-feed-category-color",
11722
11754
  children: [/* @__PURE__ */ V("input", {
11723
11755
  type: "color",
11724
11756
  "aria-label": "Chọn màu",
11725
- value: n ? e : zv,
11757
+ value: n ? e : Bv,
11726
11758
  onChange: (e) => t?.(e.target.value)
11727
11759
  }), /* @__PURE__ */ V(g, {
11728
11760
  maxLength: 7,
@@ -11734,7 +11766,7 @@ function Hv({ value: e, onChange: t }) {
11734
11766
  }
11735
11767
  //#endregion
11736
11768
  //#region src/features/manage/settings/settings-page.tsx
11737
- function Uv() {
11769
+ function Wv() {
11738
11770
  let { basePath: e } = G(), t = `${e.replace(/\/+$/, "")}/settings`, n = [{
11739
11771
  to: `${t}/categories`,
11740
11772
  label: "Thiết lập chuyên mục"
@@ -11762,24 +11794,24 @@ function Uv() {
11762
11794
  }),
11763
11795
  /* @__PURE__ */ V(U, {
11764
11796
  path: "categories",
11765
- element: /* @__PURE__ */ V(Bv, {})
11797
+ element: /* @__PURE__ */ V(Vv, {})
11766
11798
  }),
11767
11799
  /* @__PURE__ */ V(U, {
11768
11800
  path: "banner",
11769
- element: /* @__PURE__ */ V(Rv, {})
11801
+ element: /* @__PURE__ */ V(zv, {})
11770
11802
  })
11771
11803
  ] })]
11772
11804
  });
11773
11805
  }
11774
11806
  //#endregion
11775
11807
  //#region src/features/manage/reports/overview-cards.tsx
11776
- var Wv = {
11808
+ var Gv = {
11777
11809
  ZALO: "Zalo",
11778
11810
  FACEBOOK: "Facebook",
11779
11811
  CHAT: "Chat",
11780
11812
  LINK: "Liên kết"
11781
11813
  };
11782
- function Gv({ title: e, value: t, icon: n, tone: r, detail: i, loading: a }) {
11814
+ function Kv({ title: e, value: t, icon: n, tone: r, detail: i, loading: a }) {
11783
11815
  return /* @__PURE__ */ H("div", {
11784
11816
  className: `med-feed-kpi med-feed-kpi--${r}`,
11785
11817
  children: [/* @__PURE__ */ V("span", {
@@ -11805,7 +11837,7 @@ function Gv({ title: e, value: t, icon: n, tone: r, detail: i, loading: a }) {
11805
11837
  })]
11806
11838
  });
11807
11839
  }
11808
- function Kv({ overview: e, loading: t }) {
11840
+ function qv({ overview: e, loading: t }) {
11809
11841
  let n = Tn.filter((t) => (e?.reactionsByType[t] ?? 0) > 0), r = e?.postsByStatus ?? {}, i = [
11810
11842
  "ZALO",
11811
11843
  "FACEBOOK",
@@ -11815,7 +11847,7 @@ function Kv({ overview: e, loading: t }) {
11815
11847
  return /* @__PURE__ */ H("div", {
11816
11848
  className: "med-feed-kpis",
11817
11849
  children: [
11818
- /* @__PURE__ */ V(Gv, {
11850
+ /* @__PURE__ */ V(Kv, {
11819
11851
  title: "Bài viết",
11820
11852
  tone: "posts",
11821
11853
  value: e?.postCount,
@@ -11823,7 +11855,7 @@ function Kv({ overview: e, loading: t }) {
11823
11855
  loading: t,
11824
11856
  detail: `${$(r.PUBLISHED ?? 0)} đang phát hành · ${$(r.UNPUBLISHED ?? 0)} đã gỡ · ${$(r.PENDING ?? 0)} chờ duyệt`
11825
11857
  }),
11826
- /* @__PURE__ */ V(Gv, {
11858
+ /* @__PURE__ */ V(Kv, {
11827
11859
  title: "Reaction",
11828
11860
  tone: "reactions",
11829
11861
  value: e?.reactionTotal,
@@ -11831,7 +11863,7 @@ function Kv({ overview: e, loading: t }) {
11831
11863
  loading: t,
11832
11864
  detail: n.length > 0 ? n.map((t) => `${jg[t].label} ${$(e?.reactionsByType[t] ?? 0)}`).join(" · ") : "Chưa có cảm xúc nào"
11833
11865
  }),
11834
- /* @__PURE__ */ V(Gv, {
11866
+ /* @__PURE__ */ V(Kv, {
11835
11867
  title: "Bình luận",
11836
11868
  tone: "comments",
11837
11869
  value: e?.commentCount,
@@ -11839,20 +11871,20 @@ function Kv({ overview: e, loading: t }) {
11839
11871
  loading: t,
11840
11872
  detail: `${$(e?.rootCommentCount ?? 0)} bình luận · ${$(e?.replyCount ?? 0)} trả lời`
11841
11873
  }),
11842
- /* @__PURE__ */ V(Gv, {
11874
+ /* @__PURE__ */ V(Kv, {
11843
11875
  title: "Chia sẻ",
11844
11876
  tone: "shares",
11845
11877
  value: e?.shareTotal,
11846
11878
  icon: /* @__PURE__ */ V(Dt, {}),
11847
11879
  loading: t,
11848
- detail: i.length > 0 ? i.map((t) => `${Wv[t]} ${$(e?.sharesByChannel?.[t] ?? 0)}`).join(" · ") : "Chưa có lượt chia sẻ"
11880
+ detail: i.length > 0 ? i.map((t) => `${Gv[t]} ${$(e?.sharesByChannel?.[t] ?? 0)}`).join(" · ") : "Chưa có lượt chia sẻ"
11849
11881
  })
11850
11882
  ]
11851
11883
  });
11852
11884
  }
11853
11885
  //#endregion
11854
11886
  //#region src/features/manage/reports/period-switch.tsx
11855
- var qv = [
11887
+ var Jv = [
11856
11888
  {
11857
11889
  value: "day",
11858
11890
  label: "Ngày"
@@ -11866,33 +11898,33 @@ var qv = [
11866
11898
  label: "Tháng"
11867
11899
  }
11868
11900
  ];
11869
- function Jv(e) {
11901
+ function Yv(e) {
11870
11902
  let t = String(e.getMonth() + 1).padStart(2, "0");
11871
11903
  return `${e.getFullYear()}-${t}-${String(e.getDate()).padStart(2, "0")}`;
11872
11904
  }
11873
- function Yv(e, t = /* @__PURE__ */ new Date()) {
11905
+ function Xv(e, t = /* @__PURE__ */ new Date()) {
11874
11906
  let n = new Date(t);
11875
11907
  return e === "week" && n.setDate(t.getDate() - (t.getDay() + 6) % 7), e === "month" && n.setDate(1), {
11876
- from: Jv(n),
11877
- to: Jv(t)
11908
+ from: Yv(n),
11909
+ to: Yv(t)
11878
11910
  };
11879
11911
  }
11880
- function Xv({ value: e, onChange: t }) {
11881
- let n = kv(e), r = qv.find(({ value: e }) => {
11882
- let t = Yv(e);
11912
+ function Zv({ value: e, onChange: t }) {
11913
+ let n = Av(e), r = Jv.find(({ value: e }) => {
11914
+ let t = Xv(e);
11883
11915
  return t.from === n.from && t.to === n.to;
11884
11916
  })?.value;
11885
11917
  return /* @__PURE__ */ V(w.Group, {
11886
11918
  className: "med-feed-segmented",
11887
11919
  optionType: "button",
11888
- options: qv,
11920
+ options: Jv,
11889
11921
  value: r,
11890
- onChange: (e) => t(Yv(e.target.value))
11922
+ onChange: (e) => t(Xv(e.target.value))
11891
11923
  });
11892
11924
  }
11893
11925
  //#endregion
11894
11926
  //#region src/features/manage/reports/top-posts-table.tsx
11895
- var Zv = 10, Qv = [
11927
+ var Qv = 10, $v = [
11896
11928
  {
11897
11929
  value: "total",
11898
11930
  label: "Tổng tương tác"
@@ -11906,13 +11938,13 @@ var Zv = 10, Qv = [
11906
11938
  label: "Bình luận"
11907
11939
  }
11908
11940
  ];
11909
- function $v({ range: e }) {
11941
+ function ey({ range: e }) {
11910
11942
  let { api: t } = G(), [n, r] = z("total"), [i, a] = z({
11911
11943
  from: e.from,
11912
11944
  to: e.to
11913
11945
  }), [o, c] = z(""), [l, u] = z(""), [d, f] = z(null), p = L(() => ({
11914
11946
  ...e,
11915
- ...kv(i),
11947
+ ...Av(i),
11916
11948
  ...l ? { q: l } : {}
11917
11949
  }), [
11918
11950
  e,
@@ -11921,7 +11953,7 @@ function $v({ range: e }) {
11921
11953
  ]), m = K(F(() => t.getTopPosts({
11922
11954
  ...p,
11923
11955
  sortBy: n,
11924
- limit: Zv
11956
+ limit: Qv
11925
11957
  }), [
11926
11958
  t,
11927
11959
  p,
@@ -11942,18 +11974,18 @@ function $v({ range: e }) {
11942
11974
  c(e.target.value), e.target.value || u("");
11943
11975
  }
11944
11976
  }),
11945
- /* @__PURE__ */ V(Xv, {
11977
+ /* @__PURE__ */ V(Zv, {
11946
11978
  value: i,
11947
11979
  onChange: a
11948
11980
  }),
11949
- /* @__PURE__ */ V(jv, {
11981
+ /* @__PURE__ */ V(Mv, {
11950
11982
  value: i,
11951
11983
  onChange: a
11952
11984
  }),
11953
11985
  /* @__PURE__ */ V(E, {
11954
11986
  value: n,
11955
11987
  onChange: r,
11956
- options: Qv,
11988
+ options: $v,
11957
11989
  style: { minWidth: 170 },
11958
11990
  "aria-label": "Xếp theo"
11959
11991
  })
@@ -11980,7 +12012,7 @@ function $v({ range: e }) {
11980
12012
  {
11981
12013
  title: "Bài viết",
11982
12014
  key: "post",
11983
- render: (e, t) => /* @__PURE__ */ V(Mv, {
12015
+ render: (e, t) => /* @__PURE__ */ V(Nv, {
11984
12016
  post: t,
11985
12017
  onOpen: f
11986
12018
  })
@@ -12045,7 +12077,7 @@ function $v({ range: e }) {
12045
12077
  }
12046
12078
  ]
12047
12079
  }),
12048
- /* @__PURE__ */ V(Nv, {
12080
+ /* @__PURE__ */ V(Pv, {
12049
12081
  post: d,
12050
12082
  onClose: () => f(null),
12051
12083
  onChanged: () => m.reload(),
@@ -12056,14 +12088,14 @@ function $v({ range: e }) {
12056
12088
  }
12057
12089
  //#endregion
12058
12090
  //#region src/features/manage/reports/top-users-table.tsx
12059
- var ey = 10;
12060
- function ty({ range: e }) {
12091
+ var ty = 10;
12092
+ function ny({ range: e }) {
12061
12093
  let { api: t } = G(), [n, r] = z({
12062
12094
  from: e.from,
12063
12095
  to: e.to
12064
12096
  }), [i, a] = z(), [o, s] = z(null), c = L(() => ({
12065
12097
  ...e,
12066
- ...kv(n),
12098
+ ...Av(n),
12067
12099
  ...i ? { userId: i } : {}
12068
12100
  }), [
12069
12101
  e,
@@ -12071,22 +12103,22 @@ function ty({ range: e }) {
12071
12103
  i
12072
12104
  ]), l = K(F(() => t.getTopUsers({
12073
12105
  ...c,
12074
- limit: ey
12106
+ limit: ty
12075
12107
  }), [t, c]), JSON.stringify(c));
12076
12108
  return /* @__PURE__ */ H(B, { children: [
12077
12109
  /* @__PURE__ */ H("div", {
12078
12110
  className: "med-feed-report-toolbar med-feed-pill-fields",
12079
12111
  children: [
12080
- /* @__PURE__ */ V(Tv, {
12112
+ /* @__PURE__ */ V(Ev, {
12081
12113
  value: i,
12082
12114
  onChange: a,
12083
12115
  placeholder: "Tất cả nhân viên"
12084
12116
  }),
12085
- /* @__PURE__ */ V(Xv, {
12117
+ /* @__PURE__ */ V(Zv, {
12086
12118
  value: n,
12087
12119
  onChange: r
12088
12120
  }),
12089
- /* @__PURE__ */ V(jv, {
12121
+ /* @__PURE__ */ V(Mv, {
12090
12122
  value: n,
12091
12123
  onChange: r
12092
12124
  })
@@ -12125,7 +12157,7 @@ function ty({ range: e }) {
12125
12157
  {
12126
12158
  title: "Bài tương tác nhiều nhất",
12127
12159
  key: "topPost",
12128
- render: (e, t) => t.topPost ? /* @__PURE__ */ V(Mv, {
12160
+ render: (e, t) => t.topPost ? /* @__PURE__ */ V(Nv, {
12129
12161
  post: t.topPost.post,
12130
12162
  onOpen: s
12131
12163
  }) : /* @__PURE__ */ V("span", {
@@ -12163,7 +12195,7 @@ function ty({ range: e }) {
12163
12195
  }
12164
12196
  ]
12165
12197
  }),
12166
- /* @__PURE__ */ V(Nv, {
12198
+ /* @__PURE__ */ V(Pv, {
12167
12199
  post: o,
12168
12200
  onClose: () => s(null),
12169
12201
  onChanged: () => l.reload(),
@@ -12174,11 +12206,11 @@ function ty({ range: e }) {
12174
12206
  }
12175
12207
  //#endregion
12176
12208
  //#region src/features/manage/reports/trend-chart.tsx
12177
- var ny = [
12209
+ var ry = [
12178
12210
  "#7c3aed",
12179
12211
  "#2563eb",
12180
12212
  "#0d9488"
12181
- ], ry = [
12213
+ ], iy = [
12182
12214
  {
12183
12215
  label: "Ngày",
12184
12216
  value: "day"
@@ -12192,17 +12224,17 @@ var ny = [
12192
12224
  value: "month"
12193
12225
  }
12194
12226
  ];
12195
- function iy(e, t) {
12227
+ function ay(e, t) {
12196
12228
  let [n, r, i] = e.slice(0, 10).split("-");
12197
12229
  return t === "month" ? `${r}/${n}` : t === "week" ? `Tuần ${i}/${r}` : `${i}/${r}`;
12198
12230
  }
12199
- function ay({ range: e }) {
12231
+ function oy({ range: e }) {
12200
12232
  let { api: t } = G(), [n, r] = z("day"), [i, a] = z({
12201
12233
  from: e.from,
12202
12234
  to: e.to
12203
12235
  }), o = L(() => ({
12204
12236
  ...e,
12205
- ...kv(i)
12237
+ ...Av(i)
12206
12238
  }), [e, i]), [l, u] = z(!1), d = K(F(() => t.getReportsTimeseries({
12207
12239
  ...o,
12208
12240
  groupBy: n
@@ -12210,14 +12242,14 @@ function ay({ range: e }) {
12210
12242
  t,
12211
12243
  o,
12212
12244
  n
12213
- ]), `${JSON.stringify(o)}|${n}`), f = d.data ?? [], m = f.map((e) => iy(e.bucket, n)), h = {
12245
+ ]), `${JSON.stringify(o)}|${n}`), f = d.data ?? [], m = f.map((e) => ay(e.bucket, n)), h = {
12214
12246
  chart: {
12215
12247
  type: "line",
12216
12248
  toolbar: { show: !1 },
12217
12249
  zoom: { enabled: !1 },
12218
12250
  fontFamily: "inherit"
12219
12251
  },
12220
- colors: ny,
12252
+ colors: ry,
12221
12253
  stroke: {
12222
12254
  width: 2,
12223
12255
  curve: "smooth"
@@ -12263,7 +12295,7 @@ function ay({ range: e }) {
12263
12295
  extra: /* @__PURE__ */ H(O, {
12264
12296
  wrap: !0,
12265
12297
  children: [
12266
- /* @__PURE__ */ V(jv, {
12298
+ /* @__PURE__ */ V(Mv, {
12267
12299
  value: i,
12268
12300
  onChange: a
12269
12301
  }),
@@ -12271,7 +12303,7 @@ function ay({ range: e }) {
12271
12303
  size: "small",
12272
12304
  className: "med-feed-segmented",
12273
12305
  optionType: "button",
12274
- options: ry,
12306
+ options: iy,
12275
12307
  value: n,
12276
12308
  onChange: (e) => r(e.target.value)
12277
12309
  }),
@@ -12297,7 +12329,7 @@ function ay({ range: e }) {
12297
12329
  {
12298
12330
  title: "Thời gian",
12299
12331
  key: "bucket",
12300
- render: (e, t) => iy(t.bucket, n)
12332
+ render: (e, t) => ay(t.bucket, n)
12301
12333
  },
12302
12334
  {
12303
12335
  title: "Reaction",
@@ -12328,36 +12360,36 @@ function ay({ range: e }) {
12328
12360
  }
12329
12361
  //#endregion
12330
12362
  //#region src/features/manage/reports/reports-page.tsx
12331
- function oy() {
12332
- let { api: e } = G(), [t, n] = z("30d"), r = L(() => kv(t), [t]), i = K(F(() => e.getReportsOverview(r), [e, r]), JSON.stringify(r));
12363
+ function sy() {
12364
+ let { api: e } = G(), [t, n] = z("30d"), r = L(() => Av(t), [t]), i = K(F(() => e.getReportsOverview(r), [e, r]), JSON.stringify(r));
12333
12365
  return /* @__PURE__ */ H("div", {
12334
12366
  className: "med-feed-wide",
12335
- children: [/* @__PURE__ */ V(vv, {
12367
+ children: [/* @__PURE__ */ V(yv, {
12336
12368
  title: "Thống kê & báo cáo",
12337
12369
  description: "Tương tác trên bảng tin nội bộ theo khoảng thời gian",
12338
- extra: /* @__PURE__ */ V(jv, {
12370
+ extra: /* @__PURE__ */ V(Mv, {
12339
12371
  value: t,
12340
12372
  onChange: n
12341
12373
  })
12342
12374
  }), /* @__PURE__ */ H("div", {
12343
12375
  className: "med-feed-stack",
12344
12376
  children: [
12345
- /* @__PURE__ */ V(Kv, {
12377
+ /* @__PURE__ */ V(qv, {
12346
12378
  overview: i.data,
12347
12379
  loading: i.loading
12348
12380
  }),
12349
- /* @__PURE__ */ V(ay, { range: r }, JSON.stringify(r)),
12381
+ /* @__PURE__ */ V(oy, { range: r }, JSON.stringify(r)),
12350
12382
  /* @__PURE__ */ V(c, {
12351
12383
  bordered: !1,
12352
12384
  className: "med-feed-report-panel med-feed-report-tabs",
12353
12385
  children: /* @__PURE__ */ V(ne, { items: [{
12354
12386
  key: "posts",
12355
12387
  label: "Bài có tương tác cao",
12356
- children: /* @__PURE__ */ V($v, { range: r }, JSON.stringify(r))
12388
+ children: /* @__PURE__ */ V(ey, { range: r }, JSON.stringify(r))
12357
12389
  }, {
12358
12390
  key: "people",
12359
12391
  label: "Người tương tác nhiều nhất",
12360
- children: /* @__PURE__ */ V(ty, { range: r }, JSON.stringify(r))
12392
+ children: /* @__PURE__ */ V(ny, { range: r }, JSON.stringify(r))
12361
12393
  }] })
12362
12394
  })
12363
12395
  ]
@@ -12366,7 +12398,7 @@ function oy() {
12366
12398
  }
12367
12399
  //#endregion
12368
12400
  //#region src/app/admin/newsfeed-admin-routes.tsx
12369
- function sy() {
12401
+ function cy() {
12370
12402
  let { me: e, basePath: t } = G(), n = t.replace(/\/+$/, ""), r = [
12371
12403
  ...e.canManage ? [{
12372
12404
  to: n || "/",
@@ -12442,42 +12474,42 @@ function sy() {
12442
12474
  children: /* @__PURE__ */ H(ge, { children: [
12443
12475
  /* @__PURE__ */ V(U, {
12444
12476
  index: !0,
12445
- element: e.canManage ? /* @__PURE__ */ V(Iv, {}) : /* @__PURE__ */ V(he, {
12477
+ element: e.canManage ? /* @__PURE__ */ V(Lv, {}) : /* @__PURE__ */ V(he, {
12446
12478
  to: `${n}/my-posts`,
12447
12479
  replace: !0
12448
12480
  })
12449
12481
  }),
12450
12482
  /* @__PURE__ */ V(U, {
12451
12483
  path: "my-posts",
12452
- element: /* @__PURE__ */ V(cy, {
12484
+ element: /* @__PURE__ */ V(ly, {
12453
12485
  allowed: e.canPost,
12454
- page: /* @__PURE__ */ V(bv, {})
12486
+ page: /* @__PURE__ */ V(xv, {})
12455
12487
  })
12456
12488
  }),
12457
12489
  /* @__PURE__ */ V(U, {
12458
12490
  path: "reports",
12459
- element: /* @__PURE__ */ V(cy, {
12491
+ element: /* @__PURE__ */ V(ly, {
12460
12492
  allowed: e.canManage,
12461
- page: /* @__PURE__ */ V(oy, {})
12493
+ page: /* @__PURE__ */ V(sy, {})
12462
12494
  })
12463
12495
  }),
12464
12496
  /* @__PURE__ */ V(U, {
12465
12497
  path: "events",
12466
- element: /* @__PURE__ */ V(cy, {
12498
+ element: /* @__PURE__ */ V(ly, {
12467
12499
  allowed: e.canManage,
12468
- page: /* @__PURE__ */ V(Cv, {})
12500
+ page: /* @__PURE__ */ V(wv, {})
12469
12501
  })
12470
12502
  }),
12471
12503
  /* @__PURE__ */ V(U, {
12472
12504
  path: "settings/*",
12473
- element: /* @__PURE__ */ V(cy, {
12505
+ element: /* @__PURE__ */ V(ly, {
12474
12506
  allowed: e.canManage,
12475
- page: /* @__PURE__ */ V(Uv, {})
12507
+ page: /* @__PURE__ */ V(Wv, {})
12476
12508
  })
12477
12509
  }),
12478
12510
  /* @__PURE__ */ V(U, {
12479
12511
  path: "posts/:postId",
12480
- element: /* @__PURE__ */ V(j_, {})
12512
+ element: /* @__PURE__ */ V(M_, {})
12481
12513
  }),
12482
12514
  /* @__PURE__ */ V(U, {
12483
12515
  path: "*",
@@ -12490,7 +12522,7 @@ function sy() {
12490
12522
  })]
12491
12523
  });
12492
12524
  }
12493
- function cy({ allowed: e, page: t }) {
12525
+ function ly({ allowed: e, page: t }) {
12494
12526
  return e ? /* @__PURE__ */ V(B, { children: t }) : /* @__PURE__ */ V(T, {
12495
12527
  status: "403",
12496
12528
  title: "Bạn không có quyền truy cập trang này"
@@ -12498,15 +12530,15 @@ function cy({ allowed: e, page: t }) {
12498
12530
  }
12499
12531
  //#endregion
12500
12532
  //#region src/app/admin/newsfeed-admin-module.tsx
12501
- function ly(e) {
12533
+ function uy(e) {
12502
12534
  return /* @__PURE__ */ V(kn, {
12503
12535
  runtimeProps: {
12504
12536
  ...e,
12505
12537
  isPostFeed: !0
12506
12538
  },
12507
12539
  isAdmin: !0,
12508
- children: /* @__PURE__ */ V(sy, {})
12540
+ children: /* @__PURE__ */ V(cy, {})
12509
12541
  });
12510
12542
  }
12511
12543
  //#endregion
12512
- export { ly as NewsfeedAdminModule, N_ as NewsfeedModule };
12544
+ export { uy as NewsfeedAdminModule, P_ as NewsfeedModule };