mantur-components 0.1.13-beta.2 → 0.1.13-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mantur-components.js +892 -892
- package/dist/mantur-components.umd.cjs +3 -3
- package/package.json +1 -1
|
@@ -470,55 +470,357 @@ function ct() {
|
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
//#endregion
|
|
473
|
+
//#region src/utils/date.ts
|
|
474
|
+
var lt = /* @__PURE__ */ G((/* @__PURE__ */ U(((e, t) => {
|
|
475
|
+
(function(n, r) {
|
|
476
|
+
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
477
|
+
})(e, (function() {
|
|
478
|
+
var e = 1e3, t = 6e4, n = 36e5, r = "millisecond", i = "second", a = "minute", o = "hour", s = "day", c = "week", l = "month", u = "quarter", d = "year", f = "date", p = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, g = {
|
|
479
|
+
name: "en",
|
|
480
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
481
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
482
|
+
ordinal: function(e) {
|
|
483
|
+
var t = [
|
|
484
|
+
"th",
|
|
485
|
+
"st",
|
|
486
|
+
"nd",
|
|
487
|
+
"rd"
|
|
488
|
+
], n = e % 100;
|
|
489
|
+
return "[" + e + (t[(n - 20) % 10] || t[n] || t[0]) + "]";
|
|
490
|
+
}
|
|
491
|
+
}, _ = function(e, t, n) {
|
|
492
|
+
var r = String(e);
|
|
493
|
+
return !r || r.length >= t ? e : "" + Array(t + 1 - r.length).join(n) + e;
|
|
494
|
+
}, v = {
|
|
495
|
+
s: _,
|
|
496
|
+
z: function(e) {
|
|
497
|
+
var t = -e.utcOffset(), n = Math.abs(t), r = Math.floor(n / 60), i = n % 60;
|
|
498
|
+
return (t <= 0 ? "+" : "-") + _(r, 2, "0") + ":" + _(i, 2, "0");
|
|
499
|
+
},
|
|
500
|
+
m: function e(t, n) {
|
|
501
|
+
if (t.date() < n.date()) return -e(n, t);
|
|
502
|
+
var r = 12 * (n.year() - t.year()) + (n.month() - t.month()), i = t.clone().add(r, l), a = n - i < 0, o = t.clone().add(r + (a ? -1 : 1), l);
|
|
503
|
+
return +(-(r + (n - i) / (a ? i - o : o - i)) || 0);
|
|
504
|
+
},
|
|
505
|
+
a: function(e) {
|
|
506
|
+
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
|
|
507
|
+
},
|
|
508
|
+
p: function(e) {
|
|
509
|
+
return {
|
|
510
|
+
M: l,
|
|
511
|
+
y: d,
|
|
512
|
+
w: c,
|
|
513
|
+
d: s,
|
|
514
|
+
D: f,
|
|
515
|
+
h: o,
|
|
516
|
+
m: a,
|
|
517
|
+
s: i,
|
|
518
|
+
ms: r,
|
|
519
|
+
Q: u
|
|
520
|
+
}[e] || String(e || "").toLowerCase().replace(/s$/, "");
|
|
521
|
+
},
|
|
522
|
+
u: function(e) {
|
|
523
|
+
return e === void 0;
|
|
524
|
+
}
|
|
525
|
+
}, y = "en", b = {};
|
|
526
|
+
b[y] = g;
|
|
527
|
+
var x = "$isDayjsObject", S = function(e) {
|
|
528
|
+
return e instanceof E || !(!e || !e[x]);
|
|
529
|
+
}, C = function e(t, n, r) {
|
|
530
|
+
var i;
|
|
531
|
+
if (!t) return y;
|
|
532
|
+
if (typeof t == "string") {
|
|
533
|
+
var a = t.toLowerCase();
|
|
534
|
+
b[a] && (i = a), n && (b[a] = n, i = a);
|
|
535
|
+
var o = t.split("-");
|
|
536
|
+
if (!i && o.length > 1) return e(o[0]);
|
|
537
|
+
} else {
|
|
538
|
+
var s = t.name;
|
|
539
|
+
b[s] = t, i = s;
|
|
540
|
+
}
|
|
541
|
+
return !r && i && (y = i), i || !r && y;
|
|
542
|
+
}, w = function(e, t) {
|
|
543
|
+
if (S(e)) return e.clone();
|
|
544
|
+
var n = typeof t == "object" ? t : {};
|
|
545
|
+
return n.date = e, n.args = arguments, new E(n);
|
|
546
|
+
}, T = v;
|
|
547
|
+
T.l = C, T.i = S, T.w = function(e, t) {
|
|
548
|
+
return w(e, {
|
|
549
|
+
locale: t.$L,
|
|
550
|
+
utc: t.$u,
|
|
551
|
+
x: t.$x,
|
|
552
|
+
$offset: t.$offset
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
var E = function() {
|
|
556
|
+
function g(e) {
|
|
557
|
+
this.$L = C(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[x] = !0;
|
|
558
|
+
}
|
|
559
|
+
var _ = g.prototype;
|
|
560
|
+
return _.parse = function(e) {
|
|
561
|
+
this.$d = function(e) {
|
|
562
|
+
var t = e.date, n = e.utc;
|
|
563
|
+
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
564
|
+
if (T.u(t)) return /* @__PURE__ */ new Date();
|
|
565
|
+
if (t instanceof Date) return new Date(t);
|
|
566
|
+
if (typeof t == "string" && !/Z$/i.test(t)) {
|
|
567
|
+
var r = t.match(m);
|
|
568
|
+
if (r) {
|
|
569
|
+
var i = r[2] - 1 || 0, a = (r[7] || "0").substring(0, 3);
|
|
570
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return new Date(t);
|
|
574
|
+
}(e), this.init();
|
|
575
|
+
}, _.init = function() {
|
|
576
|
+
var e = this.$d;
|
|
577
|
+
this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
|
|
578
|
+
}, _.$utils = function() {
|
|
579
|
+
return T;
|
|
580
|
+
}, _.isValid = function() {
|
|
581
|
+
return this.$d.toString() !== p;
|
|
582
|
+
}, _.isSame = function(e, t) {
|
|
583
|
+
var n = w(e);
|
|
584
|
+
return this.startOf(t) <= n && n <= this.endOf(t);
|
|
585
|
+
}, _.isAfter = function(e, t) {
|
|
586
|
+
return w(e) < this.startOf(t);
|
|
587
|
+
}, _.isBefore = function(e, t) {
|
|
588
|
+
return this.endOf(t) < w(e);
|
|
589
|
+
}, _.$g = function(e, t, n) {
|
|
590
|
+
return T.u(e) ? this[t] : this.set(n, e);
|
|
591
|
+
}, _.unix = function() {
|
|
592
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
593
|
+
}, _.valueOf = function() {
|
|
594
|
+
return this.$d.getTime();
|
|
595
|
+
}, _.startOf = function(e, t) {
|
|
596
|
+
var n = this, r = !!T.u(t) || t, u = T.p(e), p = function(e, t) {
|
|
597
|
+
var i = T.w(n.$u ? Date.UTC(n.$y, t, e) : new Date(n.$y, t, e), n);
|
|
598
|
+
return r ? i : i.endOf(s);
|
|
599
|
+
}, m = function(e, t) {
|
|
600
|
+
return T.w(n.toDate()[e].apply(n.toDate("s"), (r ? [
|
|
601
|
+
0,
|
|
602
|
+
0,
|
|
603
|
+
0,
|
|
604
|
+
0
|
|
605
|
+
] : [
|
|
606
|
+
23,
|
|
607
|
+
59,
|
|
608
|
+
59,
|
|
609
|
+
999
|
|
610
|
+
]).slice(t)), n);
|
|
611
|
+
}, h = this.$W, g = this.$M, _ = this.$D, v = "set" + (this.$u ? "UTC" : "");
|
|
612
|
+
switch (u) {
|
|
613
|
+
case d: return r ? p(1, 0) : p(31, 11);
|
|
614
|
+
case l: return r ? p(1, g) : p(0, g + 1);
|
|
615
|
+
case c:
|
|
616
|
+
var y = this.$locale().weekStart || 0, b = (h < y ? h + 7 : h) - y;
|
|
617
|
+
return p(r ? _ - b : _ + (6 - b), g);
|
|
618
|
+
case s:
|
|
619
|
+
case f: return m(v + "Hours", 0);
|
|
620
|
+
case o: return m(v + "Minutes", 1);
|
|
621
|
+
case a: return m(v + "Seconds", 2);
|
|
622
|
+
case i: return m(v + "Milliseconds", 3);
|
|
623
|
+
default: return this.clone();
|
|
624
|
+
}
|
|
625
|
+
}, _.endOf = function(e) {
|
|
626
|
+
return this.startOf(e, !1);
|
|
627
|
+
}, _.$set = function(e, t) {
|
|
628
|
+
var n, c = T.p(e), u = "set" + (this.$u ? "UTC" : ""), p = (n = {}, n[s] = u + "Date", n[f] = u + "Date", n[l] = u + "Month", n[d] = u + "FullYear", n[o] = u + "Hours", n[a] = u + "Minutes", n[i] = u + "Seconds", n[r] = u + "Milliseconds", n)[c], m = c === s ? this.$D + (t - this.$W) : t;
|
|
629
|
+
if (c === l || c === d) {
|
|
630
|
+
var h = this.clone().set(f, 1);
|
|
631
|
+
h.$d[p](m), h.init(), this.$d = h.set(f, Math.min(this.$D, h.daysInMonth())).$d;
|
|
632
|
+
} else p && this.$d[p](m);
|
|
633
|
+
return this.init(), this;
|
|
634
|
+
}, _.set = function(e, t) {
|
|
635
|
+
return this.clone().$set(e, t);
|
|
636
|
+
}, _.get = function(e) {
|
|
637
|
+
return this[T.p(e)]();
|
|
638
|
+
}, _.add = function(r, u) {
|
|
639
|
+
var f, p = this;
|
|
640
|
+
r = Number(r);
|
|
641
|
+
var m = T.p(u), h = function(e) {
|
|
642
|
+
var t = w(p);
|
|
643
|
+
return T.w(t.date(t.date() + Math.round(e * r)), p);
|
|
644
|
+
};
|
|
645
|
+
if (m === l) return this.set(l, this.$M + r);
|
|
646
|
+
if (m === d) return this.set(d, this.$y + r);
|
|
647
|
+
if (m === s) return h(1);
|
|
648
|
+
if (m === c) return h(7);
|
|
649
|
+
var g = (f = {}, f[a] = t, f[o] = n, f[i] = e, f)[m] || 1, _ = this.$d.getTime() + r * g;
|
|
650
|
+
return T.w(_, this);
|
|
651
|
+
}, _.subtract = function(e, t) {
|
|
652
|
+
return this.add(-1 * e, t);
|
|
653
|
+
}, _.format = function(e) {
|
|
654
|
+
var t = this, n = this.$locale();
|
|
655
|
+
if (!this.isValid()) return n.invalidDate || p;
|
|
656
|
+
var r = e || "YYYY-MM-DDTHH:mm:ssZ", i = T.z(this), a = this.$H, o = this.$m, s = this.$M, c = n.weekdays, l = n.months, u = n.meridiem, d = function(e, n, i, a) {
|
|
657
|
+
return e && (e[n] || e(t, r)) || i[n].slice(0, a);
|
|
658
|
+
}, f = function(e) {
|
|
659
|
+
return T.s(a % 12 || 12, e, "0");
|
|
660
|
+
}, m = u || function(e, t, n) {
|
|
661
|
+
var r = e < 12 ? "AM" : "PM";
|
|
662
|
+
return n ? r.toLowerCase() : r;
|
|
663
|
+
};
|
|
664
|
+
return r.replace(h, (function(e, r) {
|
|
665
|
+
return r || function(e) {
|
|
666
|
+
switch (e) {
|
|
667
|
+
case "YY": return String(t.$y).slice(-2);
|
|
668
|
+
case "YYYY": return T.s(t.$y, 4, "0");
|
|
669
|
+
case "M": return s + 1;
|
|
670
|
+
case "MM": return T.s(s + 1, 2, "0");
|
|
671
|
+
case "MMM": return d(n.monthsShort, s, l, 3);
|
|
672
|
+
case "MMMM": return d(l, s);
|
|
673
|
+
case "D": return t.$D;
|
|
674
|
+
case "DD": return T.s(t.$D, 2, "0");
|
|
675
|
+
case "d": return String(t.$W);
|
|
676
|
+
case "dd": return d(n.weekdaysMin, t.$W, c, 2);
|
|
677
|
+
case "ddd": return d(n.weekdaysShort, t.$W, c, 3);
|
|
678
|
+
case "dddd": return c[t.$W];
|
|
679
|
+
case "H": return String(a);
|
|
680
|
+
case "HH": return T.s(a, 2, "0");
|
|
681
|
+
case "h": return f(1);
|
|
682
|
+
case "hh": return f(2);
|
|
683
|
+
case "a": return m(a, o, !0);
|
|
684
|
+
case "A": return m(a, o, !1);
|
|
685
|
+
case "m": return String(o);
|
|
686
|
+
case "mm": return T.s(o, 2, "0");
|
|
687
|
+
case "s": return String(t.$s);
|
|
688
|
+
case "ss": return T.s(t.$s, 2, "0");
|
|
689
|
+
case "SSS": return T.s(t.$ms, 3, "0");
|
|
690
|
+
case "Z": return i;
|
|
691
|
+
}
|
|
692
|
+
return null;
|
|
693
|
+
}(e) || i.replace(":", "");
|
|
694
|
+
}));
|
|
695
|
+
}, _.utcOffset = function() {
|
|
696
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
697
|
+
}, _.diff = function(r, f, p) {
|
|
698
|
+
var m, h = this, g = T.p(f), _ = w(r), v = (_.utcOffset() - this.utcOffset()) * t, y = this - _, b = function() {
|
|
699
|
+
return T.m(h, _);
|
|
700
|
+
};
|
|
701
|
+
switch (g) {
|
|
702
|
+
case d:
|
|
703
|
+
m = b() / 12;
|
|
704
|
+
break;
|
|
705
|
+
case l:
|
|
706
|
+
m = b();
|
|
707
|
+
break;
|
|
708
|
+
case u:
|
|
709
|
+
m = b() / 3;
|
|
710
|
+
break;
|
|
711
|
+
case c:
|
|
712
|
+
m = (y - v) / 6048e5;
|
|
713
|
+
break;
|
|
714
|
+
case s:
|
|
715
|
+
m = (y - v) / 864e5;
|
|
716
|
+
break;
|
|
717
|
+
case o:
|
|
718
|
+
m = y / n;
|
|
719
|
+
break;
|
|
720
|
+
case a:
|
|
721
|
+
m = y / t;
|
|
722
|
+
break;
|
|
723
|
+
case i:
|
|
724
|
+
m = y / e;
|
|
725
|
+
break;
|
|
726
|
+
default: m = y;
|
|
727
|
+
}
|
|
728
|
+
return p ? m : T.a(m);
|
|
729
|
+
}, _.daysInMonth = function() {
|
|
730
|
+
return this.endOf(l).$D;
|
|
731
|
+
}, _.$locale = function() {
|
|
732
|
+
return b[this.$L];
|
|
733
|
+
}, _.locale = function(e, t) {
|
|
734
|
+
if (!e) return this.$L;
|
|
735
|
+
var n = this.clone(), r = C(e, t, !0);
|
|
736
|
+
return r && (n.$L = r), n;
|
|
737
|
+
}, _.clone = function() {
|
|
738
|
+
return T.w(this.$d, this);
|
|
739
|
+
}, _.toDate = function() {
|
|
740
|
+
return new Date(this.valueOf());
|
|
741
|
+
}, _.toJSON = function() {
|
|
742
|
+
return this.isValid() ? this.toISOString() : null;
|
|
743
|
+
}, _.toISOString = function() {
|
|
744
|
+
return this.$d.toISOString();
|
|
745
|
+
}, _.toString = function() {
|
|
746
|
+
return this.$d.toUTCString();
|
|
747
|
+
}, g;
|
|
748
|
+
}(), D = E.prototype;
|
|
749
|
+
return w.prototype = D, [
|
|
750
|
+
["$ms", r],
|
|
751
|
+
["$s", i],
|
|
752
|
+
["$m", a],
|
|
753
|
+
["$H", o],
|
|
754
|
+
["$W", s],
|
|
755
|
+
["$M", l],
|
|
756
|
+
["$y", d],
|
|
757
|
+
["$D", f]
|
|
758
|
+
].forEach((function(e) {
|
|
759
|
+
D[e[1]] = function(t) {
|
|
760
|
+
return this.$g(t, e[0], e[1]);
|
|
761
|
+
};
|
|
762
|
+
})), w.extend = function(e, t) {
|
|
763
|
+
return e.$i ||= (e(t, E, w), !0), w;
|
|
764
|
+
}, w.locale = C, w.isDayjs = S, w.unix = function(e) {
|
|
765
|
+
return w(1e3 * e);
|
|
766
|
+
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
767
|
+
}));
|
|
768
|
+
})))(), 1);
|
|
769
|
+
function ut(e, t = "datetime", n) {
|
|
770
|
+
if (!e) return "-";
|
|
771
|
+
let r = (n ? Y(n) : nt()).startsWith("en"), i = t === "date" ? r ? "MM/DD/YYYY" : "YYYY-MM-DD" : r ? "MM/DD/YYYY HH:mm:ss" : "YYYY-MM-DD HH:mm:ss";
|
|
772
|
+
return (0, lt.default)(e).format(i);
|
|
773
|
+
}
|
|
774
|
+
//#endregion
|
|
473
775
|
//#region src/header/components/PointsDetailModal.tsx
|
|
474
|
-
var { RangePicker:
|
|
776
|
+
var { RangePicker: dt } = u, ft = 7, pt = [1], mt = [
|
|
475
777
|
3,
|
|
476
778
|
5,
|
|
477
779
|
6,
|
|
478
780
|
7
|
|
479
|
-
],
|
|
480
|
-
function
|
|
781
|
+
], ht = [1], gt = [2];
|
|
782
|
+
function _t(e) {
|
|
481
783
|
return e === "recharge" ? "arcoblue" : e === "gift" ? "cyan" : e === "expired" ? "gray" : "orange";
|
|
482
784
|
}
|
|
483
|
-
function
|
|
484
|
-
if (e === "income") return
|
|
485
|
-
if (e === "expense") return
|
|
785
|
+
function vt(e) {
|
|
786
|
+
if (e === "income") return pt;
|
|
787
|
+
if (e === "expense") return mt;
|
|
486
788
|
}
|
|
487
|
-
function
|
|
488
|
-
if (e === "recharge") return
|
|
489
|
-
if (e === "gift") return
|
|
789
|
+
function yt(e) {
|
|
790
|
+
if (e === "recharge") return ht;
|
|
791
|
+
if (e === "gift") return gt;
|
|
490
792
|
}
|
|
491
|
-
function
|
|
793
|
+
function bt(e, t) {
|
|
492
794
|
if (e) return /^\d{4}-\d{2}-\d{2}$/.test(e) ? `${e}T${t}` : e;
|
|
493
795
|
}
|
|
494
|
-
function
|
|
796
|
+
function xt(e) {
|
|
495
797
|
let t = Number(e.amount || 0);
|
|
496
798
|
return t < 0 ? t : e.direction === 3 || e.direction === 6 || e.direction === 7 ? -t : t;
|
|
497
799
|
}
|
|
498
|
-
function
|
|
499
|
-
return e.pointType === 1 ? "recharge" : e.pointType === 2 ? "gift" : e.direction === 6 || e.bizType === 5 ? "expired" :
|
|
800
|
+
function St(e) {
|
|
801
|
+
return e.pointType === 1 ? "recharge" : e.pointType === 2 ? "gift" : e.direction === 6 || e.bizType === 5 ? "expired" : xt(e) < 0 ? "deducted" : "recharge";
|
|
500
802
|
}
|
|
501
|
-
function
|
|
502
|
-
return e.pointType === 1 ? t.sourceRecharge : e.pointType === 2 ? t.sourceGifted : e.actionName || (
|
|
803
|
+
function Ct(e, t) {
|
|
804
|
+
return e.pointType === 1 ? t.sourceRecharge : e.pointType === 2 ? t.sourceGifted : e.actionName || (xt(e) < 0 ? t.expense : t.income);
|
|
503
805
|
}
|
|
504
|
-
function
|
|
806
|
+
function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
505
807
|
let [d, f] = a("all"), [p, m] = a("all"), [g, _] = a([]), [S, E] = a(1), [O, k] = a([]), [A, j] = a(0), [M, N] = a(!1), P = i(0), I = (e) => new Intl.NumberFormat().format(e), L = t((e) => {
|
|
506
808
|
let [t, n] = g;
|
|
507
809
|
return {
|
|
508
810
|
pageNum: e,
|
|
509
|
-
pageSize:
|
|
510
|
-
directions:
|
|
511
|
-
bizTypes:
|
|
512
|
-
fromTime:
|
|
513
|
-
toTime:
|
|
811
|
+
pageSize: ft,
|
|
812
|
+
directions: vt(d),
|
|
813
|
+
bizTypes: yt(p),
|
|
814
|
+
fromTime: bt(t, "00:00:00"),
|
|
815
|
+
toTime: bt(n, "23:59:59")
|
|
514
816
|
};
|
|
515
817
|
}, [
|
|
516
818
|
g,
|
|
517
819
|
p,
|
|
518
820
|
d
|
|
519
821
|
]), R = t((e, t, n) => {
|
|
520
|
-
let r =
|
|
521
|
-
e.createTime,
|
|
822
|
+
let r = xt(e), i = [
|
|
823
|
+
e.createTime ? ut(e.createTime) : void 0,
|
|
522
824
|
e.contextDisplay,
|
|
523
825
|
e.bizRefId ? `ID ${e.bizRefId}` : void 0,
|
|
524
826
|
e.balanceAfter === void 0 ? void 0 : `${o.currentBalance}: ${I(Number(e.balanceAfter || 0))}`
|
|
@@ -528,8 +830,8 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
528
830
|
name: e.actionName || (r < 0 ? o.expense : o.income),
|
|
529
831
|
meta: i.join(" · "),
|
|
530
832
|
amount: r,
|
|
531
|
-
badgeKind:
|
|
532
|
-
badgeText:
|
|
833
|
+
badgeKind: St(e),
|
|
834
|
+
badgeText: Ct(e, o)
|
|
533
835
|
};
|
|
534
836
|
}, [o]), z = t(async (e = S, t = !1) => {
|
|
535
837
|
let n = P.current + 1;
|
|
@@ -586,7 +888,7 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
586
888
|
width: 110,
|
|
587
889
|
align: "right",
|
|
588
890
|
render: (e, t) => /* @__PURE__ */ B(T, {
|
|
589
|
-
color:
|
|
891
|
+
color: _t(t.badgeKind),
|
|
590
892
|
children: t.badgeText
|
|
591
893
|
})
|
|
592
894
|
}
|
|
@@ -723,7 +1025,7 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
723
1025
|
})
|
|
724
1026
|
]
|
|
725
1027
|
}),
|
|
726
|
-
/* @__PURE__ */ B(
|
|
1028
|
+
/* @__PURE__ */ B(dt, {
|
|
727
1029
|
value: g,
|
|
728
1030
|
onChange: (e) => {
|
|
729
1031
|
_(e || []), E(1);
|
|
@@ -748,7 +1050,7 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
748
1050
|
/* @__PURE__ */ B(b, {
|
|
749
1051
|
className: "mt-3 flex justify-center!",
|
|
750
1052
|
current: S,
|
|
751
|
-
pageSize:
|
|
1053
|
+
pageSize: ft,
|
|
752
1054
|
total: A,
|
|
753
1055
|
onChange: E
|
|
754
1056
|
})
|
|
@@ -769,17 +1071,17 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
769
1071
|
}
|
|
770
1072
|
//#endregion
|
|
771
1073
|
//#region src/labels.ts
|
|
772
|
-
var
|
|
773
|
-
function
|
|
1074
|
+
var Tt = Je;
|
|
1075
|
+
function Et(e) {
|
|
774
1076
|
return {
|
|
775
|
-
...
|
|
1077
|
+
...Tt,
|
|
776
1078
|
...e
|
|
777
1079
|
};
|
|
778
1080
|
}
|
|
779
1081
|
//#endregion
|
|
780
1082
|
//#region src/header/components/ProfileModal.tsx
|
|
781
|
-
var
|
|
782
|
-
function
|
|
1083
|
+
var Dt = 2048, Ot = 2 * 1024 * 1024;
|
|
1084
|
+
function kt(e) {
|
|
783
1085
|
return new Promise((t, n) => {
|
|
784
1086
|
let r = URL.createObjectURL(e), i = new Image();
|
|
785
1087
|
i.onload = () => {
|
|
@@ -792,8 +1094,8 @@ function Dt(e) {
|
|
|
792
1094
|
}, i.src = r;
|
|
793
1095
|
});
|
|
794
1096
|
}
|
|
795
|
-
function
|
|
796
|
-
let u =
|
|
1097
|
+
function At({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
1098
|
+
let u = Et(r), [d] = m.useForm(), [f, p] = a(!1), [h, _] = a(null), [b, x] = a(null), S = i(null);
|
|
797
1099
|
n(() => () => {
|
|
798
1100
|
S.current &&= (URL.revokeObjectURL(S.current), null);
|
|
799
1101
|
}, []), n(() => {
|
|
@@ -860,10 +1162,10 @@ function Ot({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
860
1162
|
accept: "image/*",
|
|
861
1163
|
showUploadList: !1,
|
|
862
1164
|
beforeUpload: async (e) => {
|
|
863
|
-
if (e.size >
|
|
1165
|
+
if (e.size > Ot) return C(u.profileAvatarTooLarge), !1;
|
|
864
1166
|
try {
|
|
865
|
-
let { width: t, height: n } = await
|
|
866
|
-
if (t >
|
|
1167
|
+
let { width: t, height: n } = await kt(e);
|
|
1168
|
+
if (t > Dt || n > Dt) return C(u.profileAvatarDimensionExceeded), !1;
|
|
867
1169
|
} catch (e) {
|
|
868
1170
|
return C(u.profileAvatarInvalidImage, e), !1;
|
|
869
1171
|
}
|
|
@@ -891,7 +1193,7 @@ function Ot({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
891
1193
|
}
|
|
892
1194
|
//#endregion
|
|
893
1195
|
//#region src/header/mock.ts
|
|
894
|
-
var
|
|
1196
|
+
var jt = [
|
|
895
1197
|
{
|
|
896
1198
|
id: "points-500",
|
|
897
1199
|
points: 500,
|
|
@@ -911,10 +1213,10 @@ var kt = [
|
|
|
911
1213
|
];
|
|
912
1214
|
//#endregion
|
|
913
1215
|
//#region src/header/components/UserAvatar.tsx
|
|
914
|
-
function
|
|
1216
|
+
function Mt(e) {
|
|
915
1217
|
return e?.nickname?.[0] || e?.username?.[0] || "U";
|
|
916
1218
|
}
|
|
917
|
-
function
|
|
1219
|
+
function Nt({ user: e, size: t, className: n = "" }) {
|
|
918
1220
|
return /* @__PURE__ */ B(s, {
|
|
919
1221
|
size: t,
|
|
920
1222
|
className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
|
|
@@ -922,20 +1224,20 @@ function jt({ user: e, size: t, className: n = "" }) {
|
|
|
922
1224
|
src: e.avatar,
|
|
923
1225
|
alt: "avatar",
|
|
924
1226
|
className: "h-full w-full object-cover"
|
|
925
|
-
}) :
|
|
1227
|
+
}) : Mt(e)
|
|
926
1228
|
});
|
|
927
1229
|
}
|
|
928
1230
|
//#endregion
|
|
929
1231
|
//#region src/header/components/RechargeModal.tsx
|
|
930
|
-
var
|
|
1232
|
+
var Pt = {
|
|
931
1233
|
minHeight: 292,
|
|
932
1234
|
height: "100%",
|
|
933
1235
|
display: "flex",
|
|
934
1236
|
flexDirection: "column",
|
|
935
1237
|
justifyContent: "space-between"
|
|
936
|
-
},
|
|
937
|
-
function
|
|
938
|
-
let [m, _] = a(
|
|
1238
|
+
}, Ft = "relative h-full! min-h-[292px]! w-full! overflow-hidden rounded-lg! border shadow-sm! transition-all duration-200 before:absolute before:inset-x-0 before:top-0 before:h-1 before:bg-linear-to-r before:from-arco-primary before:to-transparent hover:shadow-md! [&_.arco-card-body]:flex! [&_.arco-card-body]:h-full! [&_.arco-card-body]:flex-col! [&_.arco-card-body]:justify-between!";
|
|
1239
|
+
function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoading: u = !1, submitting: d = !1, onCancel: f, onPay: p }) {
|
|
1240
|
+
let [m, _] = a(jt[2].id), [v, b] = a(""), x = i(null), S = s?.length ? s : jt, C = (e) => new Intl.NumberFormat().format(e), w = v.trim(), E = Number(w), O = w.length > 0, A = m === "custom", j = O && Number.isFinite(E) && Number.isInteger(E) && E >= 10, M = S.find((e) => e.id === m), N = A && j ? {
|
|
939
1241
|
id: "custom",
|
|
940
1242
|
price: E,
|
|
941
1243
|
points: E * 100,
|
|
@@ -993,7 +1295,7 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
993
1295
|
className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
|
|
994
1296
|
children: [/* @__PURE__ */ V("div", {
|
|
995
1297
|
className: "w-full border-arco-border-1 bg-arco-fill-1 text-arco-text-2 flex items-center gap-2.5 rounded-lg border px-3.5 py-3 text-sm",
|
|
996
|
-
children: [/* @__PURE__ */ B(
|
|
1298
|
+
children: [/* @__PURE__ */ B(Nt, {
|
|
997
1299
|
user: t,
|
|
998
1300
|
size: 32,
|
|
999
1301
|
className: "shrink-0"
|
|
@@ -1028,8 +1330,8 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1028
1330
|
onKeyDown: (t) => {
|
|
1029
1331
|
(t.key === "Enter" || t.key === " ") && F(e.id);
|
|
1030
1332
|
},
|
|
1031
|
-
bodyStyle:
|
|
1032
|
-
className: `${
|
|
1333
|
+
bodyStyle: Pt,
|
|
1334
|
+
className: `${Ft} border-arco-border-2! bg-arco-bg-2! cursor-pointer ${m === e.id ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : "hover:border-arco-primary-6!"}`,
|
|
1033
1335
|
children: [
|
|
1034
1336
|
m === e.id ? /* @__PURE__ */ B(k, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
|
|
1035
1337
|
"recommended" in e && e.recommended ? /* @__PURE__ */ B(T, {
|
|
@@ -1072,8 +1374,8 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1072
1374
|
onKeyDown: (e) => {
|
|
1073
1375
|
(e.key === "Enter" || e.key === " ") && I();
|
|
1074
1376
|
},
|
|
1075
|
-
bodyStyle:
|
|
1076
|
-
className: `${
|
|
1377
|
+
bodyStyle: Pt,
|
|
1378
|
+
className: `${Ft} cursor-text ${j ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : O && A ? "border-arco-danger-6! bg-arco-bg-1! hover:border-arco-danger-6!" : "border-arco-primary-6/30! bg-arco-primary-light-1/20! hover:border-arco-primary-6!"}`,
|
|
1077
1379
|
children: [
|
|
1078
1380
|
j ? /* @__PURE__ */ B(k, { className: "text-arco-primary-6! absolute top-4 right-4 text-xl" }) : null,
|
|
1079
1381
|
/* @__PURE__ */ V("div", {
|
|
@@ -1160,7 +1462,7 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1160
1462
|
}
|
|
1161
1463
|
//#endregion
|
|
1162
1464
|
//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
1163
|
-
var
|
|
1465
|
+
var Lt = /* @__PURE__ */ U(((e) => {
|
|
1164
1466
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1165
1467
|
function b(e) {
|
|
1166
1468
|
if (typeof e == "object" && e) {
|
|
@@ -1216,7 +1518,7 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1216
1518
|
}, e.isValidElementType = function(e) {
|
|
1217
1519
|
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
1218
1520
|
}, e.typeOf = b;
|
|
1219
|
-
})),
|
|
1521
|
+
})), Rt = /* @__PURE__ */ U(((e) => {
|
|
1220
1522
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1221
1523
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1222
1524
|
function b(e) {
|
|
@@ -1292,9 +1594,9 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1292
1594
|
}
|
|
1293
1595
|
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = B, e.isForwardRef = V, e.isFragment = ee, e.isLazy = te, e.isMemo = H, e.isPortal = ne, e.isProfiler = re, e.isStrictMode = ie, e.isSuspense = ae, e.isValidElementType = b, e.typeOf = x;
|
|
1294
1596
|
})();
|
|
1295
|
-
})),
|
|
1296
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
1297
|
-
})),
|
|
1597
|
+
})), zt = /* @__PURE__ */ U(((e, t) => {
|
|
1598
|
+
process.env.NODE_ENV === "production" ? t.exports = Lt() : t.exports = Rt();
|
|
1599
|
+
})), Bt = /* @__PURE__ */ U(((e, t) => {
|
|
1298
1600
|
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
1299
1601
|
function a(e) {
|
|
1300
1602
|
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
@@ -1327,14 +1629,14 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1327
1629
|
}
|
|
1328
1630
|
return s;
|
|
1329
1631
|
};
|
|
1330
|
-
})),
|
|
1632
|
+
})), Vt = /* @__PURE__ */ U(((e, t) => {
|
|
1331
1633
|
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1332
|
-
})),
|
|
1634
|
+
})), Ht = /* @__PURE__ */ U(((e, t) => {
|
|
1333
1635
|
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1334
|
-
})),
|
|
1636
|
+
})), Ut = /* @__PURE__ */ U(((e, t) => {
|
|
1335
1637
|
var n = function() {};
|
|
1336
1638
|
if (process.env.NODE_ENV !== "production") {
|
|
1337
|
-
var r =
|
|
1639
|
+
var r = Vt(), i = {}, a = Ht();
|
|
1338
1640
|
n = function(e) {
|
|
1339
1641
|
var t = "Warning: " + e;
|
|
1340
1642
|
typeof console < "u" && console.error(t);
|
|
@@ -1367,8 +1669,8 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1367
1669
|
o.resetWarningCache = function() {
|
|
1368
1670
|
process.env.NODE_ENV !== "production" && (i = {});
|
|
1369
1671
|
}, t.exports = o;
|
|
1370
|
-
})),
|
|
1371
|
-
var n =
|
|
1672
|
+
})), Wt = /* @__PURE__ */ U(((e, t) => {
|
|
1673
|
+
var n = zt(), r = Bt(), i = Vt(), a = Ht(), o = Ut(), s = function() {};
|
|
1372
1674
|
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
1373
1675
|
var t = "Warning: " + e;
|
|
1374
1676
|
typeof console < "u" && console.error(t);
|
|
@@ -1626,8 +1928,8 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1626
1928
|
}
|
|
1627
1929
|
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
1628
1930
|
};
|
|
1629
|
-
})),
|
|
1630
|
-
var n =
|
|
1931
|
+
})), Gt = /* @__PURE__ */ U(((e, t) => {
|
|
1932
|
+
var n = Vt();
|
|
1631
1933
|
function r() {}
|
|
1632
1934
|
function i() {}
|
|
1633
1935
|
i.resetWarningCache = r, t.exports = function() {
|
|
@@ -1668,11 +1970,11 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1668
1970
|
};
|
|
1669
1971
|
})), X = /* @__PURE__ */ G((/* @__PURE__ */ U(((e, t) => {
|
|
1670
1972
|
if (process.env.NODE_ENV !== "production") {
|
|
1671
|
-
var n =
|
|
1672
|
-
t.exports =
|
|
1673
|
-
} else t.exports =
|
|
1973
|
+
var n = zt();
|
|
1974
|
+
t.exports = Wt()(n.isElement, !0);
|
|
1975
|
+
} else t.exports = Gt()();
|
|
1674
1976
|
})))(), 1);
|
|
1675
|
-
function
|
|
1977
|
+
function Kt(e, t) {
|
|
1676
1978
|
var n = Object.keys(e);
|
|
1677
1979
|
if (Object.getOwnPropertySymbols) {
|
|
1678
1980
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -1682,26 +1984,26 @@ function Wt(e, t) {
|
|
|
1682
1984
|
}
|
|
1683
1985
|
return n;
|
|
1684
1986
|
}
|
|
1685
|
-
function
|
|
1987
|
+
function qt(e) {
|
|
1686
1988
|
for (var t = 1; t < arguments.length; t++) {
|
|
1687
1989
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
1688
|
-
t % 2 ?
|
|
1689
|
-
|
|
1690
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
1990
|
+
t % 2 ? Kt(Object(n), !0).forEach(function(t) {
|
|
1991
|
+
Yt(e, t, n[t]);
|
|
1992
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Kt(Object(n)).forEach(function(t) {
|
|
1691
1993
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
1692
1994
|
});
|
|
1693
1995
|
}
|
|
1694
1996
|
return e;
|
|
1695
1997
|
}
|
|
1696
|
-
function
|
|
1998
|
+
function Jt(e) {
|
|
1697
1999
|
"@babel/helpers - typeof";
|
|
1698
|
-
return
|
|
2000
|
+
return Jt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1699
2001
|
return typeof e;
|
|
1700
2002
|
} : function(e) {
|
|
1701
2003
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1702
|
-
},
|
|
2004
|
+
}, Jt(e);
|
|
1703
2005
|
}
|
|
1704
|
-
function
|
|
2006
|
+
function Yt(e, t, n) {
|
|
1705
2007
|
return t in e ? Object.defineProperty(e, t, {
|
|
1706
2008
|
value: n,
|
|
1707
2009
|
enumerable: !0,
|
|
@@ -1709,28 +2011,28 @@ function qt(e, t, n) {
|
|
|
1709
2011
|
writable: !0
|
|
1710
2012
|
}) : e[t] = n, e;
|
|
1711
2013
|
}
|
|
1712
|
-
function
|
|
2014
|
+
function Xt(e, t) {
|
|
1713
2015
|
if (e == null) return {};
|
|
1714
2016
|
var n = {}, r = Object.keys(e), i, a;
|
|
1715
2017
|
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
1716
2018
|
return n;
|
|
1717
2019
|
}
|
|
1718
|
-
function
|
|
2020
|
+
function Zt(e, t) {
|
|
1719
2021
|
if (e == null) return {};
|
|
1720
|
-
var n =
|
|
2022
|
+
var n = Xt(e, t), r, i;
|
|
1721
2023
|
if (Object.getOwnPropertySymbols) {
|
|
1722
2024
|
var a = Object.getOwnPropertySymbols(e);
|
|
1723
2025
|
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
1724
2026
|
}
|
|
1725
2027
|
return n;
|
|
1726
2028
|
}
|
|
1727
|
-
function
|
|
1728
|
-
return
|
|
2029
|
+
function Qt(e, t) {
|
|
2030
|
+
return $t(e) || en(e, t) || tn(e, t) || rn();
|
|
1729
2031
|
}
|
|
1730
|
-
function
|
|
2032
|
+
function $t(e) {
|
|
1731
2033
|
if (Array.isArray(e)) return e;
|
|
1732
2034
|
}
|
|
1733
|
-
function
|
|
2035
|
+
function en(e, t) {
|
|
1734
2036
|
var n = e && (typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]);
|
|
1735
2037
|
if (n != null) {
|
|
1736
2038
|
var r = [], i = !0, a = !1, o, s;
|
|
@@ -1748,56 +2050,56 @@ function Qt(e, t) {
|
|
|
1748
2050
|
return r;
|
|
1749
2051
|
}
|
|
1750
2052
|
}
|
|
1751
|
-
function
|
|
2053
|
+
function tn(e, t) {
|
|
1752
2054
|
if (e) {
|
|
1753
|
-
if (typeof e == "string") return
|
|
2055
|
+
if (typeof e == "string") return nn(e, t);
|
|
1754
2056
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
1755
2057
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
1756
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
2058
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return nn(e, t);
|
|
1757
2059
|
}
|
|
1758
2060
|
}
|
|
1759
|
-
function
|
|
2061
|
+
function nn(e, t) {
|
|
1760
2062
|
(t == null || t > e.length) && (t = e.length);
|
|
1761
2063
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
1762
2064
|
return r;
|
|
1763
2065
|
}
|
|
1764
|
-
function
|
|
2066
|
+
function rn() {
|
|
1765
2067
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1766
2068
|
}
|
|
1767
|
-
var
|
|
1768
|
-
return e !== null &&
|
|
1769
|
-
},
|
|
1770
|
-
return
|
|
1771
|
-
},
|
|
1772
|
-
return
|
|
1773
|
-
},
|
|
1774
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1775
|
-
if (e === null ||
|
|
2069
|
+
var an = function(e) {
|
|
2070
|
+
return e !== null && Jt(e) === "object";
|
|
2071
|
+
}, on = function(e) {
|
|
2072
|
+
return an(e) && typeof e.then == "function";
|
|
2073
|
+
}, sn = function(e) {
|
|
2074
|
+
return an(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
|
|
2075
|
+
}, cn = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", ln = function(e) {
|
|
2076
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : cn;
|
|
2077
|
+
if (e === null || sn(e)) return e;
|
|
1776
2078
|
throw Error(t);
|
|
1777
|
-
},
|
|
1778
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1779
|
-
if (
|
|
2079
|
+
}, un = function(e) {
|
|
2080
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : cn;
|
|
2081
|
+
if (on(e)) return {
|
|
1780
2082
|
tag: "async",
|
|
1781
2083
|
stripePromise: Promise.resolve(e).then(function(e) {
|
|
1782
|
-
return
|
|
2084
|
+
return ln(e, t);
|
|
1783
2085
|
})
|
|
1784
2086
|
};
|
|
1785
|
-
var n =
|
|
2087
|
+
var n = ln(e, t);
|
|
1786
2088
|
return n === null ? { tag: "empty" } : {
|
|
1787
2089
|
tag: "sync",
|
|
1788
2090
|
stripe: n
|
|
1789
2091
|
};
|
|
1790
|
-
},
|
|
2092
|
+
}, dn = function(t) {
|
|
1791
2093
|
var n = e.useRef(t);
|
|
1792
2094
|
return e.useEffect(function() {
|
|
1793
2095
|
n.current = t;
|
|
1794
2096
|
}, [t]), n.current;
|
|
1795
|
-
},
|
|
1796
|
-
if (!
|
|
2097
|
+
}, fn = "[object Object]", pn = function e(t, n) {
|
|
2098
|
+
if (!an(t) || !an(n)) return t === n;
|
|
1797
2099
|
var r = Array.isArray(t);
|
|
1798
2100
|
if (r !== Array.isArray(n)) return !1;
|
|
1799
|
-
var i = Object.prototype.toString.call(t) ===
|
|
1800
|
-
if (i !== (Object.prototype.toString.call(n) ===
|
|
2101
|
+
var i = Object.prototype.toString.call(t) === fn;
|
|
2102
|
+
if (i !== (Object.prototype.toString.call(n) === fn)) return !1;
|
|
1801
2103
|
if (!i && !r) return t === n;
|
|
1802
2104
|
var a = Object.keys(t), o = Object.keys(n);
|
|
1803
2105
|
if (a.length !== o.length) return !1;
|
|
@@ -1809,7 +2111,7 @@ var nn = function(e) {
|
|
|
1809
2111
|
return u.every(function(t) {
|
|
1810
2112
|
return e(d[t], f[t]);
|
|
1811
2113
|
});
|
|
1812
|
-
},
|
|
2114
|
+
}, mn = function(e) {
|
|
1813
2115
|
!e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
|
|
1814
2116
|
name: "react-stripe-js",
|
|
1815
2117
|
version: "6.4.0"
|
|
@@ -1818,58 +2120,58 @@ var nn = function(e) {
|
|
|
1818
2120
|
version: "6.4.0",
|
|
1819
2121
|
url: "https://stripe.com/docs/stripe-js/react"
|
|
1820
2122
|
}));
|
|
1821
|
-
},
|
|
1822
|
-
return
|
|
1823
|
-
var a = !
|
|
1824
|
-
return n.includes(i) ? (a && console.warn(`Unsupported prop change: options.${i} is not a mutable property.`), r) : a ?
|
|
2123
|
+
}, hn = function(e, t, n) {
|
|
2124
|
+
return an(e) ? Object.keys(e).reduce(function(r, i) {
|
|
2125
|
+
var a = !an(t) || !pn(e[i], t[i]);
|
|
2126
|
+
return n.includes(i) ? (a && console.warn(`Unsupported prop change: options.${i} is not a mutable property.`), r) : a ? qt(qt({}, r || {}), {}, Yt({}, i, e[i])) : r;
|
|
1825
2127
|
}, null) : null;
|
|
1826
|
-
},
|
|
1827
|
-
|
|
1828
|
-
var
|
|
2128
|
+
}, gn = /* @__PURE__ */ e.createContext(null);
|
|
2129
|
+
gn.displayName = "ElementsContext";
|
|
2130
|
+
var _n = function(e, t) {
|
|
1829
2131
|
if (!e) throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);
|
|
1830
2132
|
return e;
|
|
1831
2133
|
};
|
|
1832
2134
|
X.default.any, X.default.object, X.default.func.isRequired;
|
|
1833
|
-
var
|
|
1834
|
-
|
|
1835
|
-
var
|
|
2135
|
+
var vn = ["on", "loadActions"], yn = ["getSession"], bn = /* @__PURE__ */ e.createContext(null);
|
|
2136
|
+
bn.displayName = "CheckoutContext";
|
|
2137
|
+
var xn = function(e, t) {
|
|
1836
2138
|
if (!e) throw Error(`Could not find checkout context; You need to wrap the part of your app that ${t} in a <CheckoutElementsProvider> or <CheckoutFormProvider> provider.`);
|
|
1837
2139
|
return e;
|
|
1838
|
-
},
|
|
1839
|
-
var n = e.useContext(
|
|
2140
|
+
}, Sn = function(t) {
|
|
2141
|
+
var n = e.useContext(bn), r = e.useContext(gn);
|
|
1840
2142
|
if (n) {
|
|
1841
2143
|
if (r) throw Error(`You cannot wrap the part of your app that ${t} in both a checkout provider and <Elements> provider.`);
|
|
1842
2144
|
return n;
|
|
1843
|
-
} else return
|
|
1844
|
-
},
|
|
2145
|
+
} else return _n(r, t);
|
|
2146
|
+
}, Cn = function(e) {
|
|
1845
2147
|
if (e.type === "success") {
|
|
1846
2148
|
var t = e.sdk, n = e.session, r = e.checkoutActions;
|
|
1847
2149
|
t.on, t.loadActions;
|
|
1848
|
-
var i =
|
|
2150
|
+
var i = Zt(t, vn);
|
|
1849
2151
|
r.getSession;
|
|
1850
|
-
var a =
|
|
2152
|
+
var a = Zt(r, yn);
|
|
1851
2153
|
return {
|
|
1852
2154
|
type: "success",
|
|
1853
|
-
checkout:
|
|
2155
|
+
checkout: qt(qt(qt({}, n), i), a)
|
|
1854
2156
|
};
|
|
1855
2157
|
} else if (e.type === "loading") return { type: "loading" };
|
|
1856
2158
|
else return {
|
|
1857
2159
|
type: "error",
|
|
1858
2160
|
error: e.error
|
|
1859
2161
|
};
|
|
1860
|
-
},
|
|
1861
|
-
var t =
|
|
2162
|
+
}, wn = function() {
|
|
2163
|
+
var t = xn(e.useContext(bn), "calls useCheckoutElements()").checkoutState;
|
|
1862
2164
|
if (t.type === "success" && t.sdkKind !== "elements") throw Error("useCheckoutElements() must be used inside <CheckoutElementsProvider>. Inside <CheckoutFormProvider>, use useCheckoutForm() instead.");
|
|
1863
|
-
return
|
|
1864
|
-
},
|
|
2165
|
+
return Cn(t);
|
|
2166
|
+
}, Tn = "Invalid prop `stripe` supplied to `CheckoutElementsProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", En = function(e) {
|
|
1865
2167
|
return e.type === "success" || e.type === "loading" ? e.sdk : null;
|
|
1866
|
-
},
|
|
2168
|
+
}, Dn = function(t) {
|
|
1867
2169
|
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
1868
|
-
return
|
|
1869
|
-
}, [n]), o =
|
|
2170
|
+
return un(n, Tn);
|
|
2171
|
+
}, [n]), o = Qt(e.useState({
|
|
1870
2172
|
type: "loading",
|
|
1871
2173
|
sdk: null
|
|
1872
|
-
}), 2), s = o[0], c = o[1], l =
|
|
2174
|
+
}), 2), s = o[0], c = o[1], l = Qt(e.useState(null), 2), u = l[0], d = l[1], f = e.useRef(!1);
|
|
1873
2175
|
e.useEffect(function() {
|
|
1874
2176
|
var e = !0, t = function(t) {
|
|
1875
2177
|
var n = t.stripe;
|
|
@@ -1921,16 +2223,16 @@ var yn = function(e, t) {
|
|
|
1921
2223
|
r,
|
|
1922
2224
|
c
|
|
1923
2225
|
]);
|
|
1924
|
-
var p =
|
|
2226
|
+
var p = dn(n);
|
|
1925
2227
|
e.useEffect(function() {
|
|
1926
2228
|
p !== null && p !== n && console.warn("Unsupported prop change on CheckoutElementsProvider: You cannot change the `stripe` prop after setting it.");
|
|
1927
2229
|
}, [p, n]);
|
|
1928
|
-
var m =
|
|
2230
|
+
var m = En(s), h = dn(r);
|
|
1929
2231
|
e.useEffect(function() {
|
|
1930
2232
|
if (m) {
|
|
1931
|
-
var e = h?.elementsOptions?.appearance, t = r?.elementsOptions?.appearance, n = !
|
|
2233
|
+
var e = h?.elementsOptions?.appearance, t = r?.elementsOptions?.appearance, n = !pn(t, e);
|
|
1932
2234
|
t && n && m.changeAppearance(t);
|
|
1933
|
-
var i = h?.elementsOptions?.fonts, a = r?.elementsOptions?.fonts, o = !
|
|
2235
|
+
var i = h?.elementsOptions?.fonts, a = r?.elementsOptions?.fonts, o = !pn(i, a);
|
|
1934
2236
|
a && o && m.loadFonts(a);
|
|
1935
2237
|
}
|
|
1936
2238
|
}, [
|
|
@@ -1938,7 +2240,7 @@ var yn = function(e, t) {
|
|
|
1938
2240
|
h,
|
|
1939
2241
|
m
|
|
1940
2242
|
]), e.useEffect(function() {
|
|
1941
|
-
|
|
2243
|
+
mn(u);
|
|
1942
2244
|
}, [u]);
|
|
1943
2245
|
var g = e.useMemo(function() {
|
|
1944
2246
|
return {
|
|
@@ -1946,22 +2248,22 @@ var yn = function(e, t) {
|
|
|
1946
2248
|
checkoutState: s
|
|
1947
2249
|
};
|
|
1948
2250
|
}, [u, s]);
|
|
1949
|
-
return /* @__PURE__ */ e.createElement(
|
|
2251
|
+
return /* @__PURE__ */ e.createElement(bn.Provider, { value: g }, i);
|
|
1950
2252
|
};
|
|
1951
|
-
|
|
2253
|
+
Dn.propTypes = {
|
|
1952
2254
|
stripe: X.default.any,
|
|
1953
2255
|
options: X.default.shape({
|
|
1954
2256
|
clientSecret: X.default.oneOfType([X.default.string, X.default.instanceOf(Promise)]).isRequired,
|
|
1955
2257
|
elementsOptions: X.default.object
|
|
1956
2258
|
}).isRequired
|
|
1957
2259
|
};
|
|
1958
|
-
var
|
|
2260
|
+
var On = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", kn = function(t) {
|
|
1959
2261
|
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
1960
|
-
return
|
|
1961
|
-
}, [n]), o =
|
|
2262
|
+
return un(n, On);
|
|
2263
|
+
}, [n]), o = Qt(e.useState({
|
|
1962
2264
|
type: "loading",
|
|
1963
2265
|
sdk: null
|
|
1964
|
-
}), 2), s = o[0], c = o[1], l =
|
|
2266
|
+
}), 2), s = o[0], c = o[1], l = Qt(e.useState(null), 2), u = l[0], d = l[1], f = e.useRef(!1);
|
|
1965
2267
|
e.useEffect(function() {
|
|
1966
2268
|
var e = !0, t = function(t) {
|
|
1967
2269
|
var n = t.stripe;
|
|
@@ -2013,16 +2315,16 @@ var En = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend
|
|
|
2013
2315
|
r,
|
|
2014
2316
|
c
|
|
2015
2317
|
]);
|
|
2016
|
-
var p =
|
|
2318
|
+
var p = dn(n);
|
|
2017
2319
|
e.useEffect(function() {
|
|
2018
2320
|
p !== null && p !== n && console.warn("Unsupported prop change on CheckoutFormProvider: You cannot change the `stripe` prop after setting it.");
|
|
2019
2321
|
}, [p, n]);
|
|
2020
|
-
var m = s.type === "success" || s.type === "loading" ? s.sdk : null, h =
|
|
2322
|
+
var m = s.type === "success" || s.type === "loading" ? s.sdk : null, h = dn(r);
|
|
2021
2323
|
e.useEffect(function() {
|
|
2022
2324
|
if (m) {
|
|
2023
|
-
var e = h?.appearance, t = r?.appearance, n = !
|
|
2325
|
+
var e = h?.appearance, t = r?.appearance, n = !pn(t, e);
|
|
2024
2326
|
t && n && m.changeAppearance(t);
|
|
2025
|
-
var i = h?.fonts, a = r?.fonts, o = !
|
|
2327
|
+
var i = h?.fonts, a = r?.fonts, o = !pn(i, a);
|
|
2026
2328
|
a && o && m.loadFonts(a);
|
|
2027
2329
|
}
|
|
2028
2330
|
}, [
|
|
@@ -2030,7 +2332,7 @@ var En = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend
|
|
|
2030
2332
|
h,
|
|
2031
2333
|
m
|
|
2032
2334
|
]), e.useEffect(function() {
|
|
2033
|
-
|
|
2335
|
+
mn(u);
|
|
2034
2336
|
}, [u]);
|
|
2035
2337
|
var g = e.useMemo(function() {
|
|
2036
2338
|
return {
|
|
@@ -2038,9 +2340,9 @@ var En = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend
|
|
|
2038
2340
|
checkoutState: s
|
|
2039
2341
|
};
|
|
2040
2342
|
}, [u, s]);
|
|
2041
|
-
return /* @__PURE__ */ e.createElement(
|
|
2343
|
+
return /* @__PURE__ */ e.createElement(bn.Provider, { value: g }, i);
|
|
2042
2344
|
};
|
|
2043
|
-
|
|
2345
|
+
kn.propTypes = {
|
|
2044
2346
|
stripe: X.default.any,
|
|
2045
2347
|
options: X.default.shape({
|
|
2046
2348
|
clientSecret: X.default.oneOfType([X.default.string, X.default.instanceOf(Promise)]).isRequired,
|
|
@@ -2069,18 +2371,18 @@ var Z = function(t, n, r) {
|
|
|
2069
2371
|
t,
|
|
2070
2372
|
a
|
|
2071
2373
|
]);
|
|
2072
|
-
},
|
|
2374
|
+
}, An = ["mode"], jn = function(e) {
|
|
2073
2375
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
2074
2376
|
}, Q = function(t, n, r) {
|
|
2075
|
-
var i = r || `${
|
|
2076
|
-
|
|
2377
|
+
var i = r || `${jn(t)}Element`, a = n ? function(t) {
|
|
2378
|
+
Sn(`mounts <${i}>`);
|
|
2077
2379
|
var n = t.id, r = t.className;
|
|
2078
2380
|
return /* @__PURE__ */ e.createElement("div", {
|
|
2079
2381
|
id: n,
|
|
2080
2382
|
className: r
|
|
2081
2383
|
});
|
|
2082
2384
|
} : function(n) {
|
|
2083
|
-
var r = n.id, a = n.className, o = n.options, s = o === void 0 ? {} : o, c = n.onBlur, l = n.onFocus, u = n.onReady, d = n.onChange, f = n.onEscape, p = n.onClick, m = n.onLoadError, h = n.onLoaderStart, g = n.onNetworksChange, _ = n.onConfirm, v = n.onCancel, y = n.onShippingAddressChange, b = n.onShippingRateChange, x = n.onSavedPaymentMethodRemove, S = n.onSavedPaymentMethodUpdate, C = n.onAvailablePaymentMethodsChange, w =
|
|
2385
|
+
var r = n.id, a = n.className, o = n.options, s = o === void 0 ? {} : o, c = n.onBlur, l = n.onFocus, u = n.onReady, d = n.onChange, f = n.onEscape, p = n.onClick, m = n.onLoadError, h = n.onLoaderStart, g = n.onNetworksChange, _ = n.onConfirm, v = n.onCancel, y = n.onShippingAddressChange, b = n.onShippingRateChange, x = n.onSavedPaymentMethodRemove, S = n.onSavedPaymentMethodUpdate, C = n.onAvailablePaymentMethodsChange, w = Sn(`mounts <${i}>`), T = "elements" in w ? w.elements : null, E = "checkoutState" in w ? w.checkoutState : null, D = E?.type === "success" || E?.type === "loading" ? E.sdk : null, O = Qt(e.useState(null), 2), k = O[0], A = O[1], j = e.useRef(null), M = e.useRef(null);
|
|
2084
2386
|
Z(k, "blur", c), Z(k, "focus", l), Z(k, "escape", f), Z(k, "click", p), Z(k, "loaderror", m), Z(k, "loaderstart", h), Z(k, "networkschange", g), Z(k, "confirm", _), Z(k, "cancel", v), Z(k, "shippingaddresschange", y), Z(k, "shippingratechange", b), Z(k, "savedpaymentmethodremove", x), Z(k, "savedpaymentmethodupdate", S), Z(k, "availablepaymentmethodschange", C), Z(k, "change", d);
|
|
2085
2387
|
var N;
|
|
2086
2388
|
u && (N = t === "expressCheckout" ? u : function() {
|
|
@@ -2099,7 +2401,7 @@ var Z = function(t, n, r) {
|
|
|
2099
2401
|
break;
|
|
2100
2402
|
case "address":
|
|
2101
2403
|
if ("mode" in s) {
|
|
2102
|
-
var a = s.mode, o =
|
|
2404
|
+
var a = s.mode, o = Zt(s, An);
|
|
2103
2405
|
if (a === "shipping") e = n.createShippingAddressElement(o);
|
|
2104
2406
|
else if (a === "billing") e = n.createBillingAddressElement(o);
|
|
2105
2407
|
else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
@@ -2127,10 +2429,10 @@ var Z = function(t, n, r) {
|
|
|
2127
2429
|
D,
|
|
2128
2430
|
s
|
|
2129
2431
|
]);
|
|
2130
|
-
var P =
|
|
2432
|
+
var P = dn(s);
|
|
2131
2433
|
return e.useEffect(function() {
|
|
2132
2434
|
if (j.current) {
|
|
2133
|
-
var e =
|
|
2435
|
+
var e = hn(s, P, ["paymentRequest"]);
|
|
2134
2436
|
e && "update" in j.current && j.current.update(e);
|
|
2135
2437
|
}
|
|
2136
2438
|
}, [s, P]), e.useLayoutEffect(function() {
|
|
@@ -2168,113 +2470,113 @@ var Z = function(t, n, r) {
|
|
|
2168
2470
|
}, a.displayName = i, a.__elementType = t, a;
|
|
2169
2471
|
}, $ = typeof window > "u";
|
|
2170
2472
|
Q("currencySelector", $);
|
|
2171
|
-
var
|
|
2473
|
+
var Mn = Q("payment", $);
|
|
2172
2474
|
Q("paymentForm", $, "CheckoutForm"), Q("expressCheckout", $), Q("taxId", $);
|
|
2173
|
-
var
|
|
2475
|
+
var Nn = Q("contactDetails", $);
|
|
2174
2476
|
Q("address", $);
|
|
2175
2477
|
//#endregion
|
|
2176
2478
|
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
2177
|
-
function
|
|
2479
|
+
function Pn(e) {
|
|
2178
2480
|
"@babel/helpers - typeof";
|
|
2179
|
-
return
|
|
2481
|
+
return Pn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2180
2482
|
return typeof e;
|
|
2181
2483
|
} : function(e) {
|
|
2182
2484
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2183
|
-
},
|
|
2485
|
+
}, Pn(e);
|
|
2184
2486
|
}
|
|
2185
|
-
var
|
|
2487
|
+
var Fn = "dahlia", In = function(e) {
|
|
2186
2488
|
return e === 3 ? "v3" : e;
|
|
2187
|
-
},
|
|
2188
|
-
return
|
|
2189
|
-
},
|
|
2190
|
-
for (var e = document.querySelectorAll(`script[src^="${
|
|
2489
|
+
}, Ln = "https://js.stripe.com", Rn = `${Ln}/${Fn}/stripe.js`, zn = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, Bn = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, Vn = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", Hn = function(e) {
|
|
2490
|
+
return zn.test(e) || Bn.test(e);
|
|
2491
|
+
}, Un = function() {
|
|
2492
|
+
for (var e = document.querySelectorAll(`script[src^="${Ln}"]`), t = 0; t < e.length; t++) {
|
|
2191
2493
|
var n = e[t];
|
|
2192
|
-
if (
|
|
2494
|
+
if (Hn(n.src)) return n;
|
|
2193
2495
|
}
|
|
2194
2496
|
return null;
|
|
2195
|
-
},
|
|
2497
|
+
}, Wn = function(e) {
|
|
2196
2498
|
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
2197
|
-
n.src = `${
|
|
2499
|
+
n.src = `${Rn}${t}`;
|
|
2198
2500
|
var r = document.head || document.body;
|
|
2199
2501
|
if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
2200
2502
|
return r.appendChild(n), n;
|
|
2201
|
-
},
|
|
2503
|
+
}, Gn = function(e, t) {
|
|
2202
2504
|
!e || !e._registerWrapper || e._registerWrapper({
|
|
2203
2505
|
name: "stripe-js",
|
|
2204
2506
|
version: "9.6.0",
|
|
2205
2507
|
startTime: t
|
|
2206
2508
|
});
|
|
2207
|
-
},
|
|
2509
|
+
}, Kn = null, qn = null, Jn = null, Yn = function(e) {
|
|
2208
2510
|
return function(t) {
|
|
2209
2511
|
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
2210
2512
|
};
|
|
2211
|
-
},
|
|
2513
|
+
}, Xn = function(e, t) {
|
|
2212
2514
|
return function() {
|
|
2213
2515
|
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
2214
2516
|
};
|
|
2215
|
-
},
|
|
2216
|
-
return
|
|
2517
|
+
}, Zn = function(e) {
|
|
2518
|
+
return Kn === null ? (Kn = new Promise(function(t, n) {
|
|
2217
2519
|
if (typeof window > "u" || typeof document > "u") {
|
|
2218
2520
|
t(null);
|
|
2219
2521
|
return;
|
|
2220
2522
|
}
|
|
2221
|
-
if (window.Stripe && e && console.warn(
|
|
2523
|
+
if (window.Stripe && e && console.warn(Vn), window.Stripe) {
|
|
2222
2524
|
t(window.Stripe);
|
|
2223
2525
|
return;
|
|
2224
2526
|
}
|
|
2225
2527
|
try {
|
|
2226
|
-
var r =
|
|
2227
|
-
if (r && e) console.warn(
|
|
2228
|
-
else if (!r) r =
|
|
2229
|
-
else if (r &&
|
|
2528
|
+
var r = Un();
|
|
2529
|
+
if (r && e) console.warn(Vn);
|
|
2530
|
+
else if (!r) r = Wn(e);
|
|
2531
|
+
else if (r && Jn !== null && qn !== null) {
|
|
2230
2532
|
var i;
|
|
2231
|
-
r.removeEventListener("load",
|
|
2533
|
+
r.removeEventListener("load", Jn), r.removeEventListener("error", qn), (i = r.parentNode) == null || i.removeChild(r), r = Wn(e);
|
|
2232
2534
|
}
|
|
2233
|
-
|
|
2535
|
+
Jn = Xn(t, n), qn = Yn(n), r.addEventListener("load", Jn), r.addEventListener("error", qn);
|
|
2234
2536
|
} catch (e) {
|
|
2235
2537
|
n(e);
|
|
2236
2538
|
return;
|
|
2237
2539
|
}
|
|
2238
|
-
}),
|
|
2239
|
-
return
|
|
2240
|
-
})) :
|
|
2241
|
-
},
|
|
2540
|
+
}), Kn.catch(function(e) {
|
|
2541
|
+
return Kn = null, Promise.reject(e);
|
|
2542
|
+
})) : Kn;
|
|
2543
|
+
}, Qn = function(e, t, n) {
|
|
2242
2544
|
if (e === null) return null;
|
|
2243
2545
|
var r = t[0];
|
|
2244
|
-
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${
|
|
2245
|
-
var i = r.match(/^pk_test/), a =
|
|
2546
|
+
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${Pn(r)} instead.`);
|
|
2547
|
+
var i = r.match(/^pk_test/), a = In(e.version), o = Fn;
|
|
2246
2548
|
i && a !== o && console.warn(`Stripe.js@${a} was loaded on the page, but @stripe/stripe-js@9.6.0 expected Stripe.js@${o}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);
|
|
2247
2549
|
var s = e.apply(void 0, t);
|
|
2248
|
-
return
|
|
2249
|
-
},
|
|
2250
|
-
return
|
|
2251
|
-
return
|
|
2252
|
-
}),
|
|
2550
|
+
return Gn(s, n), s;
|
|
2551
|
+
}, $n, er = !1, tr = function() {
|
|
2552
|
+
return $n || ($n = Zn(null).catch(function(e) {
|
|
2553
|
+
return $n = null, Promise.reject(e);
|
|
2554
|
+
}), $n);
|
|
2253
2555
|
};
|
|
2254
2556
|
Promise.resolve().then(function() {
|
|
2255
|
-
return
|
|
2557
|
+
return tr();
|
|
2256
2558
|
}).catch(function(e) {
|
|
2257
|
-
|
|
2559
|
+
er || console.warn(e);
|
|
2258
2560
|
});
|
|
2259
|
-
var
|
|
2561
|
+
var nr = function() {
|
|
2260
2562
|
var e = [...arguments];
|
|
2261
|
-
|
|
2563
|
+
er = !0;
|
|
2262
2564
|
var t = Date.now();
|
|
2263
|
-
return
|
|
2264
|
-
return
|
|
2565
|
+
return tr().then(function(n) {
|
|
2566
|
+
return Qn(n, e, t);
|
|
2265
2567
|
});
|
|
2266
|
-
},
|
|
2267
|
-
function
|
|
2268
|
-
return e === void 0 ?
|
|
2568
|
+
}, rr = "-";
|
|
2569
|
+
function ir(e) {
|
|
2570
|
+
return e === void 0 ? rr : `$${new Intl.NumberFormat("en-US").format(Number(e || 0))}`;
|
|
2269
2571
|
}
|
|
2270
|
-
function
|
|
2572
|
+
function ar(e) {
|
|
2271
2573
|
return /* @__PURE__ */ B(D.Text, {
|
|
2272
2574
|
className: "text-arco-text-1! text-3xl! leading-tight! font-bold!",
|
|
2273
|
-
children:
|
|
2575
|
+
children: ir(e)
|
|
2274
2576
|
});
|
|
2275
2577
|
}
|
|
2276
|
-
function
|
|
2277
|
-
let n =
|
|
2578
|
+
function or({ text: e, onSuccess: t }) {
|
|
2579
|
+
let n = wn(), [r, i] = a(""), [s, l] = a(!1);
|
|
2278
2580
|
if (n.type === "loading") return /* @__PURE__ */ B("div", {
|
|
2279
2581
|
className: "flex min-h-80 items-center justify-center",
|
|
2280
2582
|
children: /* @__PURE__ */ B(S, { tip: e.stripePaymentLoading })
|
|
@@ -2310,7 +2612,7 @@ function ir({ text: e, onSuccess: t }) {
|
|
|
2310
2612
|
heading: 6,
|
|
2311
2613
|
className: "text-arco-text-1! mb-0!",
|
|
2312
2614
|
children: e.stripeContactDetails
|
|
2313
|
-
}), /* @__PURE__ */ B(
|
|
2615
|
+
}), /* @__PURE__ */ B(Nn, {})]
|
|
2314
2616
|
}),
|
|
2315
2617
|
/* @__PURE__ */ V("div", {
|
|
2316
2618
|
className: "flex flex-col gap-3",
|
|
@@ -2318,7 +2620,7 @@ function ir({ text: e, onSuccess: t }) {
|
|
|
2318
2620
|
heading: 6,
|
|
2319
2621
|
className: "text-arco-text-1! mb-0!",
|
|
2320
2622
|
children: e.stripePaymentSection
|
|
2321
|
-
}), /* @__PURE__ */ B(
|
|
2623
|
+
}), /* @__PURE__ */ B(Mn, { id: "mantur-stripe-payment-element" })]
|
|
2322
2624
|
}),
|
|
2323
2625
|
/* @__PURE__ */ V(c, {
|
|
2324
2626
|
htmlType: "submit",
|
|
@@ -2340,8 +2642,8 @@ function ir({ text: e, onSuccess: t }) {
|
|
|
2340
2642
|
]
|
|
2341
2643
|
});
|
|
2342
2644
|
}
|
|
2343
|
-
function
|
|
2344
|
-
let { resolvedTheme: p } = ee(), [m, h] = a(!1), g = i(!1), _ = s?.clientSecret || s?.stripeClientSecret, v = r(() => n ?
|
|
2645
|
+
function sr({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onSuccess: f }) {
|
|
2646
|
+
let { resolvedTheme: p } = ee(), [m, h] = a(!1), g = i(!1), _ = s?.clientSecret || s?.stripeClientSecret, v = r(() => n ? nr(n) : null, [n]), b = p === "dark" ? "night" : "flat", x = r(() => _ ? {
|
|
2345
2647
|
clientSecret: _,
|
|
2346
2648
|
elementsOptions: { appearance: {
|
|
2347
2649
|
theme: b,
|
|
@@ -2349,10 +2651,10 @@ function ar({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onS
|
|
|
2349
2651
|
} }
|
|
2350
2652
|
} : void 0, [_, b]), S = r(() => [{
|
|
2351
2653
|
label: l.stripePaymentTotalAmount,
|
|
2352
|
-
value:
|
|
2654
|
+
value: ar(s?.amount)
|
|
2353
2655
|
}, {
|
|
2354
2656
|
label: l.stripePaymentOrderNo,
|
|
2355
|
-
value: s?.orderNo ||
|
|
2657
|
+
value: s?.orderNo || rr
|
|
2356
2658
|
}], [
|
|
2357
2659
|
s?.amount,
|
|
2358
2660
|
s?.orderNo,
|
|
@@ -2376,10 +2678,10 @@ function ar({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onS
|
|
|
2376
2678
|
}, [u, s?.orderNo]), w = !n || !v ? /* @__PURE__ */ B(o, {
|
|
2377
2679
|
type: "error",
|
|
2378
2680
|
content: l.stripePaymentConfigMissing
|
|
2379
|
-
}) : _ ? _.startsWith("cs_") ? x ? /* @__PURE__ */ B(
|
|
2681
|
+
}) : _ ? _.startsWith("cs_") ? x ? /* @__PURE__ */ B(Dn, {
|
|
2380
2682
|
stripe: v,
|
|
2381
2683
|
options: x,
|
|
2382
|
-
children: /* @__PURE__ */ B(
|
|
2684
|
+
children: /* @__PURE__ */ B(or, {
|
|
2383
2685
|
text: l,
|
|
2384
2686
|
onSuccess: f
|
|
2385
2687
|
})
|
|
@@ -2447,692 +2749,390 @@ function ar({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onS
|
|
|
2447
2749
|
}
|
|
2448
2750
|
//#endregion
|
|
2449
2751
|
//#region src/header/components/UserMenu.tsx
|
|
2450
|
-
function
|
|
2752
|
+
function cr({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: o }) {
|
|
2451
2753
|
let s = (e) => new Intl.NumberFormat().format(e);
|
|
2452
2754
|
return /* @__PURE__ */ V("div", {
|
|
2453
|
-
className: "w-80 overflow-hidden rounded-xl border border-arco-border-2 bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)]",
|
|
2454
|
-
children: [
|
|
2455
|
-
/* @__PURE__ */ V("div", {
|
|
2456
|
-
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
2457
|
-
children: [/* @__PURE__ */ B(jt, {
|
|
2458
|
-
user: e,
|
|
2459
|
-
size: 48,
|
|
2460
|
-
className: "shrink-0"
|
|
2461
|
-
}), /* @__PURE__ */ V("div", {
|
|
2462
|
-
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
2463
|
-
children: [/* @__PURE__ */ V("div", {
|
|
2464
|
-
className: "flex min-w-0 items-center gap-1.5",
|
|
2465
|
-
children: [/* @__PURE__ */ B("span", {
|
|
2466
|
-
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
2467
|
-
children: e?.nickname || e?.username
|
|
2468
|
-
}), /* @__PURE__ */ B(c, {
|
|
2469
|
-
type: "text",
|
|
2470
|
-
size: "mini",
|
|
2471
|
-
icon: /* @__PURE__ */ B(j, {}),
|
|
2472
|
-
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
2473
|
-
onClick: r
|
|
2474
|
-
})]
|
|
2475
|
-
}), e?.email ? /* @__PURE__ */ B("span", {
|
|
2476
|
-
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
2477
|
-
children: e.email
|
|
2478
|
-
}) : null]
|
|
2479
|
-
})]
|
|
2480
|
-
}),
|
|
2481
|
-
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2482
|
-
/* @__PURE__ */ V("ul", {
|
|
2483
|
-
className: "flex flex-col gap-3.5 px-6 py-4",
|
|
2484
|
-
children: [
|
|
2485
|
-
/* @__PURE__ */ V("li", {
|
|
2486
|
-
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2487
|
-
children: [/* @__PURE__ */ B("span", { children: n.myPoints }), /* @__PURE__ */ B("strong", {
|
|
2488
|
-
className: "text-arco-primary-6 text-base font-bold",
|
|
2489
|
-
children: s(t.total)
|
|
2490
|
-
})]
|
|
2491
|
-
}),
|
|
2492
|
-
/* @__PURE__ */ V("li", {
|
|
2493
|
-
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2494
|
-
children: [/* @__PURE__ */ B("span", { children: n.rechargePoints }), /* @__PURE__ */ B("strong", {
|
|
2495
|
-
className: "text-arco-text-1 text-base font-bold",
|
|
2496
|
-
children: s(t.recharge)
|
|
2497
|
-
})]
|
|
2498
|
-
}),
|
|
2499
|
-
/* @__PURE__ */ V("li", {
|
|
2500
|
-
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2501
|
-
children: [/* @__PURE__ */ B("span", { children: n.giftedPoints }), /* @__PURE__ */ B("strong", {
|
|
2502
|
-
className: "text-arco-text-1 text-base font-bold",
|
|
2503
|
-
children: s(t.gifted)
|
|
2504
|
-
})]
|
|
2505
|
-
})
|
|
2506
|
-
]
|
|
2507
|
-
}),
|
|
2508
|
-
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2509
|
-
/* @__PURE__ */ V("div", {
|
|
2510
|
-
className: "flex flex-col gap-2 px-6 py-4",
|
|
2511
|
-
children: [/* @__PURE__ */ B(c, {
|
|
2512
|
-
type: "primary",
|
|
2513
|
-
long: !0,
|
|
2514
|
-
icon: /* @__PURE__ */ B(F, {}),
|
|
2515
|
-
shape: "round",
|
|
2516
|
-
className: "h-10! font-medium!",
|
|
2517
|
-
onClick: i,
|
|
2518
|
-
children: n.recharge
|
|
2519
|
-
}), /* @__PURE__ */ B(c, {
|
|
2520
|
-
long: !0,
|
|
2521
|
-
shape: "round",
|
|
2522
|
-
icon: /* @__PURE__ */ B(M, {}),
|
|
2523
|
-
className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! font-medium!",
|
|
2524
|
-
onClick: a,
|
|
2525
|
-
children: n.pointsDetail
|
|
2526
|
-
})]
|
|
2527
|
-
}),
|
|
2528
|
-
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2529
|
-
/* @__PURE__ */ B("div", {
|
|
2530
|
-
className: "px-6 py-4",
|
|
2531
|
-
children: /* @__PURE__ */ B(c, {
|
|
2532
|
-
icon: /* @__PURE__ */ B(I, {}),
|
|
2533
|
-
type: "text",
|
|
2534
|
-
status: "danger",
|
|
2535
|
-
long: !0,
|
|
2536
|
-
className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
|
|
2537
|
-
onClick: () => void o?.(),
|
|
2538
|
-
children: n.logout
|
|
2539
|
-
})
|
|
2540
|
-
})
|
|
2541
|
-
]
|
|
2542
|
-
});
|
|
2543
|
-
}
|
|
2544
|
-
//#endregion
|
|
2545
|
-
//#region src/header/ManturHeader.tsx
|
|
2546
|
-
var sr = "https://mantur.ai/images/logo.png", cr = [
|
|
2547
|
-
"from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
|
|
2548
|
-
"from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
|
|
2549
|
-
"from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
|
|
2550
|
-
"from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
|
|
2551
|
-
];
|
|
2552
|
-
function lr(e, t = !1) {
|
|
2553
|
-
return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${cr[e % cr.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
|
|
2554
|
-
}
|
|
2555
|
-
function ur(e) {
|
|
2556
|
-
return e?.tenantName?.[0]?.toUpperCase() || "T";
|
|
2557
|
-
}
|
|
2558
|
-
function dr(e, t, n) {
|
|
2559
|
-
let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
|
|
2560
|
-
return r?.length ? r.join(", ") : e?.isOwner ? t : n;
|
|
2561
|
-
}
|
|
2562
|
-
function fr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l, appName: u, mainPrefix: d, stripePublishableKey: f }) {
|
|
2563
|
-
let [m, h] = a(() => nt()), g = rt(m), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(!1), [T, D] = a(e), [O, k] = a([]), [j, M] = a(), [N, P] = a(!1), [F, I] = a(!1), [L, R] = a(!1), [z, ee] = a([]), [te, H] = a(), ne = i(l), re = f || (typeof window < "u" ? window.__MANTUR_COMPONENTS_STRIPE_PUBLISHABLE_KEY__ : void 0) || "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv", ie = d ?? (typeof window < "u" ? window.__MANTUR_MAIN_PREFIX__ : void 0) ?? void 0, [ae, U] = a({
|
|
2564
|
-
total: 0,
|
|
2565
|
-
recharge: 0,
|
|
2566
|
-
gifted: 0
|
|
2567
|
-
}), W = j?.tenantId || "", G = o, K = {
|
|
2568
|
-
total: ae.total ?? 0,
|
|
2569
|
-
recharge: ae.recharge ?? 0,
|
|
2570
|
-
gifted: ae.gifted ?? 0
|
|
2571
|
-
}, oe = async (e) => {
|
|
2572
|
-
let t = await ke(e);
|
|
2573
|
-
return t && D(t), t;
|
|
2574
|
-
};
|
|
2575
|
-
n(() => {
|
|
2576
|
-
D(e);
|
|
2577
|
-
}, [e]), n(() => {
|
|
2578
|
-
ne.current = l;
|
|
2579
|
-
}, [l]);
|
|
2580
|
-
let q = t((e) => {
|
|
2581
|
-
k(e.tenants), M(e.currentTenant), ne.current?.(e);
|
|
2582
|
-
}, []);
|
|
2583
|
-
n(() => {
|
|
2584
|
-
P(!0), Ke().then(q).catch((e) => {
|
|
2585
|
-
console.warn("Failed to refresh Mantur tenant context.", e), v.error(g.error);
|
|
2586
|
-
}).finally(() => P(!1));
|
|
2587
|
-
}, [q, g.error]), n(() => {
|
|
2588
|
-
let e = (e) => {
|
|
2589
|
-
e instanceof CustomEvent && U(e.detail);
|
|
2590
|
-
};
|
|
2591
|
-
return window.addEventListener(ye, e), Me().catch((e) => {
|
|
2592
|
-
console.warn("Failed to refresh Mantur user points.", e);
|
|
2593
|
-
}), () => {
|
|
2594
|
-
window.removeEventListener(ye, e);
|
|
2595
|
-
};
|
|
2596
|
-
}, []), n(() => {
|
|
2597
|
-
let e = (e) => {
|
|
2598
|
-
h(e instanceof CustomEvent ? Y(e.detail) : nt());
|
|
2599
|
-
};
|
|
2600
|
-
return window.addEventListener(et, e), window.addEventListener("storage", e), () => {
|
|
2601
|
-
window.removeEventListener(et, e), window.removeEventListener("storage", e);
|
|
2602
|
-
};
|
|
2603
|
-
}, []), n(() => {
|
|
2604
|
-
x && (I(!0), Ne().then((e) => {
|
|
2605
|
-
let t = e.filter((e) => e.id && e.amount !== void 0 && e.points !== void 0).sort((e, t) => (e.sortOrder ?? 0) - (t.sortOrder ?? 0)).map((e) => ({
|
|
2606
|
-
id: e.id,
|
|
2607
|
-
packageCode: e.packageCode,
|
|
2608
|
-
packageName: e.packageName,
|
|
2609
|
-
packageNameEn: e.packageNameEn,
|
|
2610
|
-
price: Number(e.amount || 0),
|
|
2611
|
-
points: Number(e.points || 0),
|
|
2612
|
-
recommended: e.isRecommended,
|
|
2613
|
-
sortOrder: e.sortOrder
|
|
2614
|
-
}));
|
|
2615
|
-
t.length > 0 && ee(t);
|
|
2616
|
-
}).catch((e) => {
|
|
2617
|
-
console.warn("Failed to load Mantur recharge packages.", e);
|
|
2618
|
-
}).finally(() => I(!1)));
|
|
2619
|
-
}, [x]);
|
|
2620
|
-
let se = (e) => {
|
|
2621
|
-
v.success(e);
|
|
2622
|
-
}, ce = (e, t) => {
|
|
2623
|
-
console.error(t), v.error(e);
|
|
2624
|
-
}, le = t(async (e) => {
|
|
2625
|
-
if (!G && e !== W) try {
|
|
2626
|
-
P(!0), q(await qe(e)), se(g.switchedToTeam);
|
|
2627
|
-
} catch (e) {
|
|
2628
|
-
ce(g.error, e);
|
|
2629
|
-
} finally {
|
|
2630
|
-
P(!1);
|
|
2631
|
-
}
|
|
2632
|
-
}, [
|
|
2633
|
-
q,
|
|
2634
|
-
W,
|
|
2635
|
-
G,
|
|
2636
|
-
g.error,
|
|
2637
|
-
g.switchedToTeam
|
|
2638
|
-
]), ue = async (e) => {
|
|
2639
|
-
let t = u?.trim();
|
|
2640
|
-
try {
|
|
2641
|
-
R(!0);
|
|
2642
|
-
let n = await Pe({
|
|
2643
|
-
..."custom" in e && e.custom ? { customAmount: e.price } : { packageId: e.id },
|
|
2644
|
-
...t ? { app: t } : {},
|
|
2645
|
-
uiMode: "elements"
|
|
2646
|
-
});
|
|
2647
|
-
if (!n) {
|
|
2648
|
-
v.error(g.stripePaymentClientSecretMissing);
|
|
2649
|
-
return;
|
|
2650
|
-
}
|
|
2651
|
-
typeof window < "u" && window.dispatchEvent(new CustomEvent(be, { detail: n })), v.success(g.rechargeOrderCreated), S(!1), H(n);
|
|
2652
|
-
} catch (e) {
|
|
2653
|
-
ce(g.error, e);
|
|
2654
|
-
} finally {
|
|
2655
|
-
R(!1);
|
|
2656
|
-
}
|
|
2657
|
-
}, de = t(() => {
|
|
2658
|
-
he(ie);
|
|
2659
|
-
}, [ie]), fe = r(() => /* @__PURE__ */ V(_, {
|
|
2660
|
-
className: "w-56 rounded-xl bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)] [&_.arco-menu-inner]:px-2 [&_.arco-menu-inner]:py-1",
|
|
2661
|
-
selectedKeys: W ? [W] : [],
|
|
2662
|
-
onClickMenuItem: le,
|
|
2663
|
-
children: [/* @__PURE__ */ B("div", {
|
|
2664
|
-
className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
|
|
2665
|
-
children: g.switchTeam
|
|
2666
|
-
}), O.map((e, t) => /* @__PURE__ */ B(_.Item, {
|
|
2667
|
-
className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
|
|
2668
|
-
children: /* @__PURE__ */ V("div", {
|
|
2669
|
-
className: "flex w-full items-center gap-3 leading-normal",
|
|
2670
|
-
children: [/* @__PURE__ */ B("div", {
|
|
2671
|
-
className: lr(t),
|
|
2672
|
-
children: ur(e)
|
|
2673
|
-
}), /* @__PURE__ */ V("div", {
|
|
2674
|
-
className: "flex min-w-0 flex-col justify-center gap-0.75",
|
|
2675
|
-
children: [/* @__PURE__ */ B("span", {
|
|
2676
|
-
className: "text-sm leading-5 font-medium text-arco-text-1",
|
|
2677
|
-
children: e.tenantName
|
|
2678
|
-
}), /* @__PURE__ */ B("span", {
|
|
2679
|
-
className: "text-xs leading-4 text-arco-text-3",
|
|
2680
|
-
children: dr(e, g.owner, g.member)
|
|
2681
|
-
})]
|
|
2682
|
-
})]
|
|
2683
|
-
})
|
|
2684
|
-
}, e.tenantId))]
|
|
2685
|
-
}), [
|
|
2686
|
-
le,
|
|
2687
|
-
W,
|
|
2688
|
-
O,
|
|
2689
|
-
g
|
|
2690
|
-
]), pe = /* @__PURE__ */ B(or, {
|
|
2691
|
-
user: T,
|
|
2692
|
-
points: K,
|
|
2693
|
-
text: g,
|
|
2694
|
-
onEditProfile: () => b(!0),
|
|
2695
|
-
onRecharge: () => S(!0),
|
|
2696
|
-
onPointsDetail: () => w(!0),
|
|
2697
|
-
onLogout: Oe
|
|
2698
|
-
}), me = Math.max(0, O.findIndex((e) => e.tenantId === j?.tenantId));
|
|
2699
|
-
return /* @__PURE__ */ V("div", {
|
|
2700
|
-
className: "flex h-20 items-center justify-between bg-transparent pr-8 shadow-[0_2px_10px_rgb(0_0_0/2%)] backdrop-blur-md max-md:pr-4",
|
|
2755
|
+
className: "w-80 overflow-hidden rounded-xl border border-arco-border-2 bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)]",
|
|
2701
2756
|
children: [
|
|
2702
2757
|
/* @__PURE__ */ V("div", {
|
|
2703
|
-
className: "flex items-center gap-6",
|
|
2704
|
-
children: [/* @__PURE__ */
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
children:
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
})]
|
|
2727
|
-
}), /* @__PURE__ */ B(p, {
|
|
2728
|
-
droplist: fe,
|
|
2729
|
-
trigger: "click",
|
|
2730
|
-
position: "bl",
|
|
2731
|
-
disabled: G,
|
|
2732
|
-
children: /* @__PURE__ */ V("div", {
|
|
2733
|
-
"aria-disabled": G,
|
|
2734
|
-
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${G ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
2735
|
-
children: [
|
|
2736
|
-
/* @__PURE__ */ B("div", {
|
|
2737
|
-
className: lr(me, !0),
|
|
2738
|
-
children: ur(j)
|
|
2739
|
-
}),
|
|
2740
|
-
/* @__PURE__ */ V("div", {
|
|
2741
|
-
className: "flex min-w-0 flex-col",
|
|
2742
|
-
children: [/* @__PURE__ */ B("span", {
|
|
2743
|
-
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
2744
|
-
children: N ? g.loading : j?.tenantName || g.loading
|
|
2745
|
-
}), /* @__PURE__ */ B("span", {
|
|
2746
|
-
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
2747
|
-
children: dr(j, g.owner, g.member)
|
|
2748
|
-
})]
|
|
2749
|
-
}),
|
|
2750
|
-
/* @__PURE__ */ B(A, { className: "ml-1 text-arco-text-3" })
|
|
2751
|
-
]
|
|
2752
|
-
})
|
|
2758
|
+
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
2759
|
+
children: [/* @__PURE__ */ B(Nt, {
|
|
2760
|
+
user: e,
|
|
2761
|
+
size: 48,
|
|
2762
|
+
className: "shrink-0"
|
|
2763
|
+
}), /* @__PURE__ */ V("div", {
|
|
2764
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
2765
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2766
|
+
className: "flex min-w-0 items-center gap-1.5",
|
|
2767
|
+
children: [/* @__PURE__ */ B("span", {
|
|
2768
|
+
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
2769
|
+
children: e?.nickname || e?.username
|
|
2770
|
+
}), /* @__PURE__ */ B(c, {
|
|
2771
|
+
type: "text",
|
|
2772
|
+
size: "mini",
|
|
2773
|
+
icon: /* @__PURE__ */ B(j, {}),
|
|
2774
|
+
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
2775
|
+
onClick: r
|
|
2776
|
+
})]
|
|
2777
|
+
}), e?.email ? /* @__PURE__ */ B("span", {
|
|
2778
|
+
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
2779
|
+
children: e.email
|
|
2780
|
+
}) : null]
|
|
2753
2781
|
})]
|
|
2754
2782
|
}),
|
|
2755
|
-
/* @__PURE__ */ B("
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
})
|
|
2772
|
-
},
|
|
2773
|
-
|
|
2774
|
-
className: "
|
|
2775
|
-
children: [
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
user: T,
|
|
2780
|
-
size: 36
|
|
2781
|
-
}), /* @__PURE__ */ B("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
2782
|
-
}),
|
|
2783
|
-
/* @__PURE__ */ B("div", {
|
|
2784
|
-
className: "hidden flex-col md:flex",
|
|
2785
|
-
children: /* @__PURE__ */ B("span", {
|
|
2786
|
-
className: "text-arco-text-1 text-sm font-medium",
|
|
2787
|
-
children: T?.nickname || T?.username
|
|
2788
|
-
})
|
|
2789
|
-
}),
|
|
2790
|
-
/* @__PURE__ */ B(A, { className: "text-arco-text-3 ml-1" })
|
|
2791
|
-
]
|
|
2783
|
+
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2784
|
+
/* @__PURE__ */ V("ul", {
|
|
2785
|
+
className: "flex flex-col gap-3.5 px-6 py-4",
|
|
2786
|
+
children: [
|
|
2787
|
+
/* @__PURE__ */ V("li", {
|
|
2788
|
+
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2789
|
+
children: [/* @__PURE__ */ B("span", { children: n.myPoints }), /* @__PURE__ */ B("strong", {
|
|
2790
|
+
className: "text-arco-primary-6 text-base font-bold",
|
|
2791
|
+
children: s(t.total)
|
|
2792
|
+
})]
|
|
2793
|
+
}),
|
|
2794
|
+
/* @__PURE__ */ V("li", {
|
|
2795
|
+
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2796
|
+
children: [/* @__PURE__ */ B("span", { children: n.rechargePoints }), /* @__PURE__ */ B("strong", {
|
|
2797
|
+
className: "text-arco-text-1 text-base font-bold",
|
|
2798
|
+
children: s(t.recharge)
|
|
2799
|
+
})]
|
|
2800
|
+
}),
|
|
2801
|
+
/* @__PURE__ */ V("li", {
|
|
2802
|
+
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2803
|
+
children: [/* @__PURE__ */ B("span", { children: n.giftedPoints }), /* @__PURE__ */ B("strong", {
|
|
2804
|
+
className: "text-arco-text-1 text-base font-bold",
|
|
2805
|
+
children: s(t.gifted)
|
|
2806
|
+
})]
|
|
2792
2807
|
})
|
|
2793
|
-
|
|
2794
|
-
}),
|
|
2795
|
-
/* @__PURE__ */ B(Ot, {
|
|
2796
|
-
visible: y,
|
|
2797
|
-
user: T,
|
|
2798
|
-
labels: g,
|
|
2799
|
-
onCancel: () => b(!1),
|
|
2800
|
-
onSubmit: oe
|
|
2801
|
-
}),
|
|
2802
|
-
/* @__PURE__ */ B(Pt, {
|
|
2803
|
-
visible: x,
|
|
2804
|
-
user: T,
|
|
2805
|
-
points: K,
|
|
2806
|
-
text: g,
|
|
2807
|
-
packages: z,
|
|
2808
|
-
packageLoading: F,
|
|
2809
|
-
submitting: L,
|
|
2810
|
-
onCancel: () => S(!1),
|
|
2811
|
-
onPay: ue
|
|
2812
|
-
}),
|
|
2813
|
-
/* @__PURE__ */ B(St, {
|
|
2814
|
-
visible: C,
|
|
2815
|
-
points: K,
|
|
2816
|
-
text: g,
|
|
2817
|
-
onCancel: () => w(!1),
|
|
2818
|
-
onRecharge: () => S(!0)
|
|
2808
|
+
]
|
|
2819
2809
|
}),
|
|
2820
|
-
/* @__PURE__ */ B(
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
}
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
"
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
b[s] = t, i = s;
|
|
2903
|
-
}
|
|
2904
|
-
return !r && i && (y = i), i || !r && y;
|
|
2905
|
-
}, w = function(e, t) {
|
|
2906
|
-
if (S(e)) return e.clone();
|
|
2907
|
-
var n = typeof t == "object" ? t : {};
|
|
2908
|
-
return n.date = e, n.args = arguments, new E(n);
|
|
2909
|
-
}, T = v;
|
|
2910
|
-
T.l = C, T.i = S, T.w = function(e, t) {
|
|
2911
|
-
return w(e, {
|
|
2912
|
-
locale: t.$L,
|
|
2913
|
-
utc: t.$u,
|
|
2914
|
-
x: t.$x,
|
|
2915
|
-
$offset: t.$offset
|
|
2916
|
-
});
|
|
2810
|
+
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2811
|
+
/* @__PURE__ */ V("div", {
|
|
2812
|
+
className: "flex flex-col gap-2 px-6 py-4",
|
|
2813
|
+
children: [/* @__PURE__ */ B(c, {
|
|
2814
|
+
type: "primary",
|
|
2815
|
+
long: !0,
|
|
2816
|
+
icon: /* @__PURE__ */ B(F, {}),
|
|
2817
|
+
shape: "round",
|
|
2818
|
+
className: "h-10! font-medium!",
|
|
2819
|
+
onClick: i,
|
|
2820
|
+
children: n.recharge
|
|
2821
|
+
}), /* @__PURE__ */ B(c, {
|
|
2822
|
+
long: !0,
|
|
2823
|
+
shape: "round",
|
|
2824
|
+
icon: /* @__PURE__ */ B(M, {}),
|
|
2825
|
+
className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! font-medium!",
|
|
2826
|
+
onClick: a,
|
|
2827
|
+
children: n.pointsDetail
|
|
2828
|
+
})]
|
|
2829
|
+
}),
|
|
2830
|
+
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2831
|
+
/* @__PURE__ */ B("div", {
|
|
2832
|
+
className: "px-6 py-4",
|
|
2833
|
+
children: /* @__PURE__ */ B(c, {
|
|
2834
|
+
icon: /* @__PURE__ */ B(I, {}),
|
|
2835
|
+
type: "text",
|
|
2836
|
+
status: "danger",
|
|
2837
|
+
long: !0,
|
|
2838
|
+
className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
|
|
2839
|
+
onClick: () => void o?.(),
|
|
2840
|
+
children: n.logout
|
|
2841
|
+
})
|
|
2842
|
+
})
|
|
2843
|
+
]
|
|
2844
|
+
});
|
|
2845
|
+
}
|
|
2846
|
+
//#endregion
|
|
2847
|
+
//#region src/header/ManturHeader.tsx
|
|
2848
|
+
var lr = "https://mantur.ai/images/logo.png", ur = [
|
|
2849
|
+
"from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
|
|
2850
|
+
"from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
|
|
2851
|
+
"from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
|
|
2852
|
+
"from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
|
|
2853
|
+
];
|
|
2854
|
+
function dr(e, t = !1) {
|
|
2855
|
+
return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${ur[e % ur.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
|
|
2856
|
+
}
|
|
2857
|
+
function fr(e) {
|
|
2858
|
+
return e?.tenantName?.[0]?.toUpperCase() || "T";
|
|
2859
|
+
}
|
|
2860
|
+
function pr(e, t, n) {
|
|
2861
|
+
let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
|
|
2862
|
+
return r?.length ? r.join(", ") : e?.isOwner ? t : n;
|
|
2863
|
+
}
|
|
2864
|
+
function mr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l, appName: u, mainPrefix: d, stripePublishableKey: f }) {
|
|
2865
|
+
let [m, h] = a(() => nt()), g = rt(m), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(!1), [T, D] = a(e), [O, k] = a([]), [j, M] = a(), [N, P] = a(!1), [F, I] = a(!1), [L, R] = a(!1), [z, ee] = a([]), [te, H] = a(), ne = i(l), re = f || (typeof window < "u" ? window.__MANTUR_COMPONENTS_STRIPE_PUBLISHABLE_KEY__ : void 0) || "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv", ie = d ?? (typeof window < "u" ? window.__MANTUR_MAIN_PREFIX__ : void 0) ?? void 0, [ae, U] = a({
|
|
2866
|
+
total: 0,
|
|
2867
|
+
recharge: 0,
|
|
2868
|
+
gifted: 0
|
|
2869
|
+
}), W = j?.tenantId || "", G = o, K = {
|
|
2870
|
+
total: ae.total ?? 0,
|
|
2871
|
+
recharge: ae.recharge ?? 0,
|
|
2872
|
+
gifted: ae.gifted ?? 0
|
|
2873
|
+
}, oe = async (e) => {
|
|
2874
|
+
let t = await ke(e);
|
|
2875
|
+
return t && D(t), t;
|
|
2876
|
+
};
|
|
2877
|
+
n(() => {
|
|
2878
|
+
D(e);
|
|
2879
|
+
}, [e]), n(() => {
|
|
2880
|
+
ne.current = l;
|
|
2881
|
+
}, [l]);
|
|
2882
|
+
let q = t((e) => {
|
|
2883
|
+
k(e.tenants), M(e.currentTenant), ne.current?.(e);
|
|
2884
|
+
}, []);
|
|
2885
|
+
n(() => {
|
|
2886
|
+
P(!0), Ke().then(q).catch((e) => {
|
|
2887
|
+
console.warn("Failed to refresh Mantur tenant context.", e), v.error(g.error);
|
|
2888
|
+
}).finally(() => P(!1));
|
|
2889
|
+
}, [q, g.error]), n(() => {
|
|
2890
|
+
let e = (e) => {
|
|
2891
|
+
e instanceof CustomEvent && U(e.detail);
|
|
2917
2892
|
};
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
}
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
2893
|
+
return window.addEventListener(ye, e), Me().catch((e) => {
|
|
2894
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
2895
|
+
}), () => {
|
|
2896
|
+
window.removeEventListener(ye, e);
|
|
2897
|
+
};
|
|
2898
|
+
}, []), n(() => {
|
|
2899
|
+
let e = (e) => {
|
|
2900
|
+
h(e instanceof CustomEvent ? Y(e.detail) : nt());
|
|
2901
|
+
};
|
|
2902
|
+
return window.addEventListener(et, e), window.addEventListener("storage", e), () => {
|
|
2903
|
+
window.removeEventListener(et, e), window.removeEventListener("storage", e);
|
|
2904
|
+
};
|
|
2905
|
+
}, []), n(() => {
|
|
2906
|
+
x && (I(!0), Ne().then((e) => {
|
|
2907
|
+
let t = e.filter((e) => e.id && e.amount !== void 0 && e.points !== void 0).sort((e, t) => (e.sortOrder ?? 0) - (t.sortOrder ?? 0)).map((e) => ({
|
|
2908
|
+
id: e.id,
|
|
2909
|
+
packageCode: e.packageCode,
|
|
2910
|
+
packageName: e.packageName,
|
|
2911
|
+
packageNameEn: e.packageNameEn,
|
|
2912
|
+
price: Number(e.amount || 0),
|
|
2913
|
+
points: Number(e.points || 0),
|
|
2914
|
+
recommended: e.isRecommended,
|
|
2915
|
+
sortOrder: e.sortOrder
|
|
2916
|
+
}));
|
|
2917
|
+
t.length > 0 && ee(t);
|
|
2918
|
+
}).catch((e) => {
|
|
2919
|
+
console.warn("Failed to load Mantur recharge packages.", e);
|
|
2920
|
+
}).finally(() => I(!1)));
|
|
2921
|
+
}, [x]);
|
|
2922
|
+
let se = (e) => {
|
|
2923
|
+
v.success(e);
|
|
2924
|
+
}, ce = (e, t) => {
|
|
2925
|
+
console.error(t), v.error(e);
|
|
2926
|
+
}, le = t(async (e) => {
|
|
2927
|
+
if (!G && e !== W) try {
|
|
2928
|
+
P(!0), q(await qe(e)), se(g.switchedToTeam);
|
|
2929
|
+
} catch (e) {
|
|
2930
|
+
ce(g.error, e);
|
|
2931
|
+
} finally {
|
|
2932
|
+
P(!1);
|
|
2933
|
+
}
|
|
2934
|
+
}, [
|
|
2935
|
+
q,
|
|
2936
|
+
W,
|
|
2937
|
+
G,
|
|
2938
|
+
g.error,
|
|
2939
|
+
g.switchedToTeam
|
|
2940
|
+
]), ue = async (e) => {
|
|
2941
|
+
let t = u?.trim();
|
|
2942
|
+
try {
|
|
2943
|
+
R(!0);
|
|
2944
|
+
let n = await Pe({
|
|
2945
|
+
..."custom" in e && e.custom ? { customAmount: e.price } : { packageId: e.id },
|
|
2946
|
+
...t ? { app: t } : {},
|
|
2947
|
+
uiMode: "elements"
|
|
2948
|
+
});
|
|
2949
|
+
if (!n) {
|
|
2950
|
+
v.error(g.stripePaymentClientSecretMissing);
|
|
2951
|
+
return;
|
|
2952
|
+
}
|
|
2953
|
+
typeof window < "u" && window.dispatchEvent(new CustomEvent(be, { detail: n })), v.success(g.rechargeOrderCreated), S(!1), H(n);
|
|
2954
|
+
} catch (e) {
|
|
2955
|
+
ce(g.error, e);
|
|
2956
|
+
} finally {
|
|
2957
|
+
R(!1);
|
|
2958
|
+
}
|
|
2959
|
+
}, de = t(() => {
|
|
2960
|
+
he(ie);
|
|
2961
|
+
}, [ie]), fe = r(() => /* @__PURE__ */ V(_, {
|
|
2962
|
+
className: "w-56 rounded-xl bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)] [&_.arco-menu-inner]:px-2 [&_.arco-menu-inner]:py-1",
|
|
2963
|
+
selectedKeys: W ? [W] : [],
|
|
2964
|
+
onClickMenuItem: le,
|
|
2965
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2966
|
+
className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
|
|
2967
|
+
children: g.switchTeam
|
|
2968
|
+
}), O.map((e, t) => /* @__PURE__ */ B(_.Item, {
|
|
2969
|
+
className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
|
|
2970
|
+
children: /* @__PURE__ */ V("div", {
|
|
2971
|
+
className: "flex w-full items-center gap-3 leading-normal",
|
|
2972
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2973
|
+
className: dr(t),
|
|
2974
|
+
children: fr(e)
|
|
2975
|
+
}), /* @__PURE__ */ V("div", {
|
|
2976
|
+
className: "flex min-w-0 flex-col justify-center gap-0.75",
|
|
2977
|
+
children: [/* @__PURE__ */ B("span", {
|
|
2978
|
+
className: "text-sm leading-5 font-medium text-arco-text-1",
|
|
2979
|
+
children: e.tenantName
|
|
2980
|
+
}), /* @__PURE__ */ B("span", {
|
|
2981
|
+
className: "text-xs leading-4 text-arco-text-3",
|
|
2982
|
+
children: pr(e, g.owner, g.member)
|
|
2983
|
+
})]
|
|
2984
|
+
})]
|
|
2985
|
+
})
|
|
2986
|
+
}, e.tenantId))]
|
|
2987
|
+
}), [
|
|
2988
|
+
le,
|
|
2989
|
+
W,
|
|
2990
|
+
O,
|
|
2991
|
+
g
|
|
2992
|
+
]), pe = /* @__PURE__ */ B(cr, {
|
|
2993
|
+
user: T,
|
|
2994
|
+
points: K,
|
|
2995
|
+
text: g,
|
|
2996
|
+
onEditProfile: () => b(!0),
|
|
2997
|
+
onRecharge: () => S(!0),
|
|
2998
|
+
onPointsDetail: () => w(!0),
|
|
2999
|
+
onLogout: Oe
|
|
3000
|
+
}), me = Math.max(0, O.findIndex((e) => e.tenantId === j?.tenantId));
|
|
3001
|
+
return /* @__PURE__ */ V("div", {
|
|
3002
|
+
className: "flex h-20 items-center justify-between bg-transparent pr-8 shadow-[0_2px_10px_rgb(0_0_0/2%)] backdrop-blur-md max-md:pr-4",
|
|
3003
|
+
children: [
|
|
3004
|
+
/* @__PURE__ */ V("div", {
|
|
3005
|
+
className: "flex items-center gap-6",
|
|
3006
|
+
children: [/* @__PURE__ */ V("div", {
|
|
3007
|
+
className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
|
|
3008
|
+
children: [/* @__PURE__ */ B(E, {
|
|
3009
|
+
content: g.home,
|
|
3010
|
+
position: "bottom",
|
|
3011
|
+
children: /* @__PURE__ */ B("button", {
|
|
3012
|
+
type: "button",
|
|
3013
|
+
"aria-label": g.home,
|
|
3014
|
+
className: "relative flex w-12 cursor-pointer items-center justify-center overflow-hidden rounded-md border-0 bg-transparent p-0 transition-opacity hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-arco-primary-6",
|
|
3015
|
+
onClick: de,
|
|
3016
|
+
children: /* @__PURE__ */ B("img", {
|
|
3017
|
+
src: lr,
|
|
3018
|
+
alt: "logo",
|
|
3019
|
+
className: "w-full object-contain",
|
|
3020
|
+
onError: (e) => {
|
|
3021
|
+
e.currentTarget.style.display = "none";
|
|
3022
|
+
}
|
|
3023
|
+
})
|
|
3024
|
+
})
|
|
3025
|
+
}), s ?? /* @__PURE__ */ B("span", {
|
|
3026
|
+
className: "text-lg font-bold tracking-normal text-arco-text-1",
|
|
3027
|
+
children: g.title
|
|
3028
|
+
})]
|
|
3029
|
+
}), /* @__PURE__ */ B(p, {
|
|
3030
|
+
droplist: fe,
|
|
3031
|
+
trigger: "click",
|
|
3032
|
+
position: "bl",
|
|
3033
|
+
disabled: G,
|
|
3034
|
+
children: /* @__PURE__ */ V("div", {
|
|
3035
|
+
"aria-disabled": G,
|
|
3036
|
+
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${G ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
3037
|
+
children: [
|
|
3038
|
+
/* @__PURE__ */ B("div", {
|
|
3039
|
+
className: dr(me, !0),
|
|
3040
|
+
children: fr(j)
|
|
3041
|
+
}),
|
|
3042
|
+
/* @__PURE__ */ V("div", {
|
|
3043
|
+
className: "flex min-w-0 flex-col",
|
|
3044
|
+
children: [/* @__PURE__ */ B("span", {
|
|
3045
|
+
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
3046
|
+
children: N ? g.loading : j?.tenantName || g.loading
|
|
3047
|
+
}), /* @__PURE__ */ B("span", {
|
|
3048
|
+
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
3049
|
+
children: pr(j, g.owner, g.member)
|
|
3050
|
+
})]
|
|
3051
|
+
}),
|
|
3052
|
+
/* @__PURE__ */ B(A, { className: "ml-1 text-arco-text-3" })
|
|
3053
|
+
]
|
|
3054
|
+
})
|
|
3055
|
+
})]
|
|
3056
|
+
}),
|
|
3057
|
+
/* @__PURE__ */ B("div", {
|
|
3058
|
+
className: "flex-1",
|
|
3059
|
+
children: c
|
|
3060
|
+
}),
|
|
3061
|
+
/* @__PURE__ */ V("div", {
|
|
3062
|
+
className: "flex items-center gap-4",
|
|
3063
|
+
children: [/* @__PURE__ */ V("div", {
|
|
3064
|
+
className: "flex items-center gap-4",
|
|
3065
|
+
children: [/* @__PURE__ */ B(ct, {}), /* @__PURE__ */ B(st, {})]
|
|
3066
|
+
}), /* @__PURE__ */ B(p, {
|
|
3067
|
+
droplist: pe,
|
|
3068
|
+
trigger: "click",
|
|
3069
|
+
position: "br",
|
|
3070
|
+
onVisibleChange: (e) => {
|
|
3071
|
+
e && Me().catch((e) => {
|
|
3072
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
3073
|
+
});
|
|
3074
|
+
},
|
|
3075
|
+
children: /* @__PURE__ */ V("div", {
|
|
3076
|
+
className: "hover:bg-arco-fill-2 flex cursor-pointer items-center gap-2.5 rounded-full border border-transparent p-1 pr-2 transition-all",
|
|
3077
|
+
children: [
|
|
3078
|
+
/* @__PURE__ */ V("div", {
|
|
3079
|
+
className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
|
|
3080
|
+
children: [/* @__PURE__ */ B(Nt, {
|
|
3081
|
+
user: T,
|
|
3082
|
+
size: 36
|
|
3083
|
+
}), /* @__PURE__ */ B("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
3084
|
+
}),
|
|
3085
|
+
/* @__PURE__ */ B("div", {
|
|
3086
|
+
className: "hidden flex-col md:flex",
|
|
3087
|
+
children: /* @__PURE__ */ B("span", {
|
|
3088
|
+
className: "text-arco-text-1 text-sm font-medium",
|
|
3089
|
+
children: T?.nickname || T?.username
|
|
3090
|
+
})
|
|
3091
|
+
}),
|
|
3092
|
+
/* @__PURE__ */ B(A, { className: "text-arco-text-3 ml-1" })
|
|
3093
|
+
]
|
|
3094
|
+
})
|
|
3095
|
+
})]
|
|
3096
|
+
}),
|
|
3097
|
+
/* @__PURE__ */ B(At, {
|
|
3098
|
+
visible: y,
|
|
3099
|
+
user: T,
|
|
3100
|
+
labels: g,
|
|
3101
|
+
onCancel: () => b(!1),
|
|
3102
|
+
onSubmit: oe
|
|
3103
|
+
}),
|
|
3104
|
+
/* @__PURE__ */ B(It, {
|
|
3105
|
+
visible: x,
|
|
3106
|
+
user: T,
|
|
3107
|
+
points: K,
|
|
3108
|
+
text: g,
|
|
3109
|
+
packages: z,
|
|
3110
|
+
packageLoading: F,
|
|
3111
|
+
submitting: L,
|
|
3112
|
+
onCancel: () => S(!1),
|
|
3113
|
+
onPay: ue
|
|
3114
|
+
}),
|
|
3115
|
+
/* @__PURE__ */ B(wt, {
|
|
3116
|
+
visible: C,
|
|
3117
|
+
points: K,
|
|
3118
|
+
text: g,
|
|
3119
|
+
onCancel: () => w(!1),
|
|
3120
|
+
onRecharge: () => S(!0)
|
|
3121
|
+
}),
|
|
3122
|
+
/* @__PURE__ */ B(sr, {
|
|
3123
|
+
visible: !!te,
|
|
3124
|
+
publishableKey: re,
|
|
3125
|
+
order: te,
|
|
3126
|
+
text: g,
|
|
3127
|
+
onCancel: () => H(void 0),
|
|
3128
|
+
onSuccess: () => {
|
|
3129
|
+
v.success(g.rechargeSuccess), H(void 0), Me().catch((e) => {
|
|
3130
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
3131
|
+
});
|
|
3090
3132
|
}
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
}, _.$locale = function() {
|
|
3095
|
-
return b[this.$L];
|
|
3096
|
-
}, _.locale = function(e, t) {
|
|
3097
|
-
if (!e) return this.$L;
|
|
3098
|
-
var n = this.clone(), r = C(e, t, !0);
|
|
3099
|
-
return r && (n.$L = r), n;
|
|
3100
|
-
}, _.clone = function() {
|
|
3101
|
-
return T.w(this.$d, this);
|
|
3102
|
-
}, _.toDate = function() {
|
|
3103
|
-
return new Date(this.valueOf());
|
|
3104
|
-
}, _.toJSON = function() {
|
|
3105
|
-
return this.isValid() ? this.toISOString() : null;
|
|
3106
|
-
}, _.toISOString = function() {
|
|
3107
|
-
return this.$d.toISOString();
|
|
3108
|
-
}, _.toString = function() {
|
|
3109
|
-
return this.$d.toUTCString();
|
|
3110
|
-
}, g;
|
|
3111
|
-
}(), D = E.prototype;
|
|
3112
|
-
return w.prototype = D, [
|
|
3113
|
-
["$ms", r],
|
|
3114
|
-
["$s", i],
|
|
3115
|
-
["$m", a],
|
|
3116
|
-
["$H", o],
|
|
3117
|
-
["$W", s],
|
|
3118
|
-
["$M", l],
|
|
3119
|
-
["$y", d],
|
|
3120
|
-
["$D", f]
|
|
3121
|
-
].forEach((function(e) {
|
|
3122
|
-
D[e[1]] = function(t) {
|
|
3123
|
-
return this.$g(t, e[0], e[1]);
|
|
3124
|
-
};
|
|
3125
|
-
})), w.extend = function(e, t) {
|
|
3126
|
-
return e.$i ||= (e(t, E, w), !0), w;
|
|
3127
|
-
}, w.locale = C, w.isDayjs = S, w.unix = function(e) {
|
|
3128
|
-
return w(1e3 * e);
|
|
3129
|
-
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
3130
|
-
}));
|
|
3131
|
-
})))(), 1);
|
|
3132
|
-
function mr(e, t = "datetime", n) {
|
|
3133
|
-
if (!e) return "-";
|
|
3134
|
-
let r = (n ? Y(n) : nt()).startsWith("en"), i = t === "date" ? r ? "MM/DD/YYYY" : "YYYY-MM-DD" : r ? "MM/DD/YYYY HH:mm:ss" : "YYYY-MM-DD HH:mm:ss";
|
|
3135
|
-
return (0, pr.default)(e).format(i);
|
|
3133
|
+
})
|
|
3134
|
+
]
|
|
3135
|
+
});
|
|
3136
3136
|
}
|
|
3137
3137
|
//#endregion
|
|
3138
3138
|
//#region src/utils/stripe-payment-window.ts
|
|
@@ -3176,4 +3176,4 @@ function wr(e, t = {}) {
|
|
|
3176
3176
|
return Cr(e, t) || e.paymentUrl || e.checkoutUrl || e.url || e.returnUrl;
|
|
3177
3177
|
}
|
|
3178
3178
|
//#endregion
|
|
3179
|
-
export { ye as MANTUR_POINTS_REFRESH_EVENT, be as MANTUR_RECHARGE_ORDER_CREATED_EVENT, gr as MANTUR_STRIPE_PAYMENT_ROUTE, hr as MANTUR_STRIPE_PAYMENT_WINDOW_MESSAGE_TYPE, xe as MANTUR_TENANT_CONTEXT_CHANGE_EVENT,
|
|
3179
|
+
export { ye as MANTUR_POINTS_REFRESH_EVENT, be as MANTUR_RECHARGE_ORDER_CREATED_EVENT, gr as MANTUR_STRIPE_PAYMENT_ROUTE, hr as MANTUR_STRIPE_PAYMENT_WINDOW_MESSAGE_TYPE, xe as MANTUR_TENANT_CONTEXT_CHANGE_EVENT, mr as ManturHeader, Ie as cancelManturRechargeOrder, Pe as createManturRechargeOrder, ut as formatDateByLang, ze as getManturBillingAccount, Be as getManturBillingLedger, Ne as getManturBillingPackages, Re as getManturPricingChargePoint, Le as getManturPricingChargePoints, Fe as getManturRechargeOrder, pe as getManturRechargeRedirectContext, _r as isManturStripePaymentWindowMessage, vr as postManturStripePaymentWindowMessage, ge as redirectToManturMain, he as redirectToManturMainHome, Ke as refreshManturTenantContext, Me as refreshManturUserPoints, me as resolveManturMainHomeUrl, wr as resolveManturRechargePaymentPageUrl, Cr as resolveManturStripePaymentPageUrl };
|