@sarafapp/iron_core 1.0.37 → 1.0.39
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/IronCore.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import O from "dayjs";
|
|
2
|
-
import { toRaw as He, reactive as st, ref as
|
|
2
|
+
import { toRaw as He, reactive as st, ref as M, watch as yt, computed as w, onBeforeUnmount as St } from "vue";
|
|
3
3
|
import { JsonConvert as wt, JsonProperty as U, JsonObject as ke } from "json2typescript";
|
|
4
4
|
import { defineStore as nt } from "pinia";
|
|
5
5
|
var xe = /* @__PURE__ */ ((t) => (t.BankCard = "####-####-####-####", t.Iban = "##-####-####-####-####-####-##", t))(xe || {}), se = /* @__PURE__ */ ((t) => (t.FullDate = "YYYY/M/D HH:mm", t.SimpleDate = "YYYY/M/D", t.CompactGregorianDate = "YYYYMMDD", t.ShortJalaliDate = "YYMM", t.JustHour = "HH:mm:ss", t))(se || {});
|
|
@@ -634,7 +634,7 @@ var he = {
|
|
|
634
634
|
if (!i(this))
|
|
635
635
|
return b.bind(this)(c, h);
|
|
636
636
|
var S = l(h) ? !0 : h, I = a(c), y = function(W, T) {
|
|
637
|
-
var
|
|
637
|
+
var x = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : p.$jy, le = he.G(x, T + 1, W), P = ce(le, 3), re = P[0], ue = P[1], mt = P[2], qe = J(new Date(re, ue - 1, mt), p);
|
|
638
638
|
return (S ? qe : qe.endOf(K)).$set("hour", 1);
|
|
639
639
|
}, R = (this.$W + (7 - r.$fdow)) % 7;
|
|
640
640
|
switch (I) {
|
|
@@ -652,7 +652,7 @@ var he = {
|
|
|
652
652
|
if (!i(this))
|
|
653
653
|
return q.bind(this)(c, h);
|
|
654
654
|
var S = a(c), I = function(R, oe) {
|
|
655
|
-
var W = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : p.$jy, T = he.G(W, oe + 1, R),
|
|
655
|
+
var W = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : p.$jy, T = he.G(W, oe + 1, R), x = ce(T, 3), le = x[0], P = x[1], re = x[2];
|
|
656
656
|
return p.$d.setFullYear(le), p.$d.setMonth(P - 1), p.$d.setDate(re), p;
|
|
657
657
|
};
|
|
658
658
|
switch (S) {
|
|
@@ -690,8 +690,8 @@ var he = {
|
|
|
690
690
|
return T.setDate(T.getDate() + c), J(T, this);
|
|
691
691
|
}
|
|
692
692
|
if (["w", Ke].indexOf(S) > -1) {
|
|
693
|
-
var
|
|
694
|
-
return
|
|
693
|
+
var x = new Date(this.$d);
|
|
694
|
+
return x.setDate(x.getDate() + c * 7), J(x, this);
|
|
695
695
|
}
|
|
696
696
|
return H.bind(this)(c, h);
|
|
697
697
|
}, s.format = function(c, h) {
|
|
@@ -815,12 +815,12 @@ class ye {
|
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
Qt();
|
|
818
|
-
class
|
|
818
|
+
class C {
|
|
819
819
|
static toCurrency(e, r) {
|
|
820
820
|
return e.toLocaleString("en-US", r);
|
|
821
821
|
}
|
|
822
822
|
static toCurrencyWithDotSeparator(e) {
|
|
823
|
-
return
|
|
823
|
+
return C.toCurrency(e).replaceAll(",", ".");
|
|
824
824
|
}
|
|
825
825
|
static applyMask(e, r) {
|
|
826
826
|
let s = "", n = 0, i = 0;
|
|
@@ -838,10 +838,10 @@ class _ {
|
|
|
838
838
|
return s;
|
|
839
839
|
}
|
|
840
840
|
static applyBankCardMask(e) {
|
|
841
|
-
return
|
|
841
|
+
return C.applyMask(xe.BankCard, String(e));
|
|
842
842
|
}
|
|
843
843
|
static applyIbanMask(e) {
|
|
844
|
-
return
|
|
844
|
+
return C.applyMask(xe.Iban, String(e));
|
|
845
845
|
}
|
|
846
846
|
static toEnglishDigits(e) {
|
|
847
847
|
const r = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"], s = ["١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩", "٠"], n = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
|
|
@@ -856,9 +856,9 @@ class _ {
|
|
|
856
856
|
var g = /* @__PURE__ */ ((t) => (t.FetchList = "fetchList", t.AutoRefresh = "autoRefresh", t.FetchItem = "fetchItem", t.FetchLastItems = "fetchLastItems", t.FetchPreviousItems = "fetchPreviousItems", t.Create = "CREATE", t.Update = "UPDATE", t.Delete = "DELETE", t.Search = "SEARCH", t.Sort = "SORT", t.Success = "SUCCESS", t.Error = "ERROR", t.Idle = "IDLE", t))(g || {}), V = /* @__PURE__ */ ((t) => (t.Width = "width", t.Height = "height", t[t.DefaultWidth = 500] = "DefaultWidth", t[t.DefaultHeight = 350] = "DefaultHeight", t[t.MinimalAvailableSize = 0] = "MinimalAvailableSize", t))(V || {}), L = /* @__PURE__ */ ((t) => (t.ASC = "ASC", t.DESC = "DESC", t))(L || {}), er = /* @__PURE__ */ ((t) => (t.ASC = "ascend", t.DESC = "descend", t))(er || {}), $e = /* @__PURE__ */ ((t) => (t.Left = "left", t.Right = "right", t.Center = "center", t))($e || {}), Ve = /* @__PURE__ */ ((t) => (t.Text = "text", t))(Ve || {}), Ne = /* @__PURE__ */ ((t) => (t.Text = "text", t.ACTION = "action", t.Tag = "tag", t.Iban = "iban", t.BankCard = "bankCard", t.Symbol = "symbol", t.TradeDetail = "tradeDetail", t.SymbolPrice = "symbolPrice", t.TradeSymbol = "tradeSymbol", t.Price = "price", t.DynamicCurrencyPrice = "dynamicCurrencyPrice", t.TradeDate = "tradeDate", t.RequestResponseIdentity = "requestResponseIdentity", t.Image = "image", t))(Ne || {}), at = /* @__PURE__ */ ((t) => (t[t.MINIMAL_LOADABLE_HEADER_COUNT = 0] = "MINIMAL_LOADABLE_HEADER_COUNT", t[t.DEFAULT_ITEM_COUNT_PER_PAGE = 20] = "DEFAULT_ITEM_COUNT_PER_PAGE", t.PAGINATION_POSITION = "bottomCenter", t))(at || {}), Fe = /* @__PURE__ */ ((t) => (t.FontFamily = "IRANSansX", t))(Fe || {}), ne = /* @__PURE__ */ ((t) => (t.Open = "open", t.Close = "close", t))(ne || {}), tr = /* @__PURE__ */ ((t) => (t[t.NotFound = 404] = "NotFound", t[t.Unauthorized = 401] = "Unauthorized", t[t.ServerError = 500] = "ServerError", t))(tr || {}), Se = /* @__PURE__ */ ((t) => (t[t.Invalid = 0] = "Invalid", t[t.Valid = 1] = "Valid", t))(Se || {}), B = /* @__PURE__ */ ((t) => (t.Theme = "theme", t.AccessList = "accessList", t.Token = "token", t.SSO_ACCESS_LIST = "ssoAccessList", t))(B || {}), Fe = /* @__PURE__ */ ((t) => (t.Light = "light", t.Dark = "dark", t))(Fe || {}), je = /* @__PURE__ */ ((t) => (t.Dialog = "dialog", t.Drawer = "drawer", t.Module = "module", t.Toast = "toast", t))(je || {}), rr = /* @__PURE__ */ ((t) => (t.USDT = "USDT", t))(rr || {});
|
|
857
857
|
class Q {
|
|
858
858
|
static getBankImageBaseOnCardInfo(e, r) {
|
|
859
|
-
return e === void 0 ? "/img/banks/shetab.png" : r === "IBAN" ? (e =
|
|
859
|
+
return e === void 0 ? "/img/banks/shetab.png" : r === "IBAN" ? (e = C.toEnglishDigits(
|
|
860
860
|
e.replace(/IR/g, "").split(" ").join("")
|
|
861
|
-
), `/img/banks/${Q.iban(e).english}.png`) : (e =
|
|
861
|
+
), `/img/banks/${Q.iban(e).english}.png`) : (e = C.toEnglishDigits(
|
|
862
862
|
e.replace(/ /g, "")
|
|
863
863
|
), `/img/banks/${Q.card(e).english}.png`);
|
|
864
864
|
}
|
|
@@ -1292,7 +1292,7 @@ class Qr {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
1294
|
function es(t, e = !1) {
|
|
1295
|
-
const r = st(t), s =
|
|
1295
|
+
const r = st(t), s = M(
|
|
1296
1296
|
Se.Invalid
|
|
1297
1297
|
);
|
|
1298
1298
|
return yt(
|
|
@@ -1464,7 +1464,7 @@ class ar {
|
|
|
1464
1464
|
};
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
|
-
class
|
|
1467
|
+
class D {
|
|
1468
1468
|
constructor(e) {
|
|
1469
1469
|
this.observers = [], this.next(e);
|
|
1470
1470
|
}
|
|
@@ -1487,7 +1487,7 @@ class x {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
class ss extends ar {
|
|
1489
1489
|
constructor(e) {
|
|
1490
|
-
super(e), this.selectedRows = new
|
|
1490
|
+
super(e), this.selectedRows = new D(/* @__PURE__ */ new Map()), this.rowSelect = this.rowSelect.bind(this), this.selectAll = this.selectAll.bind(this), this.isEveryRowSelected = this.isEveryRowSelected.bind(this), this.handlePagination = this.handlePagination.bind(this), this.clearAllSelectedItems = this.clearAllSelectedItems.bind(this), this.getSelectedRows = this.getSelectedRows.bind(this), this.getSelectedRowsAsArray = this.getSelectedRowsAsArray.bind(this), this.getSelectedRowIds = this.getSelectedRowIds.bind(this);
|
|
1491
1491
|
}
|
|
1492
1492
|
rowSelect(e) {
|
|
1493
1493
|
this.getSelectedRowsValue().has(e.id) ? (this.getSelectedRowsValue().delete(e.id), this.selectedRows.next(this.selectedRows.getValue())) : (this.selectedRows.getValue().set(e.id, e), this.selectedRows.next(this.selectedRows.getValue()));
|
|
@@ -1596,9 +1596,7 @@ class cs {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
class or {
|
|
1598
1598
|
constructor(e) {
|
|
1599
|
-
this.rows = new
|
|
1600
|
-
1
|
|
1601
|
-
), this.currentPageSize = new x(20), this.currentSortDetail = new x(new Ye("id", L.DESC)), this.scrollDetail = new x(null), this.isExpandable = new x(!1), this.tableSource = e, this.accessService = ie.GetInstance();
|
|
1599
|
+
this.rows = new D([]), this.headerSchema = new D([]), this.currentPage = new D(1), this.currentPageSize = new D(20), this.totalItems = new D(0), this.currentSortDetail = new D(new Ye("id", L.DESC)), this.scrollDetail = new D(null), this.isExpandable = new D(!1), this.tableSource = e, this.accessService = ie.GetInstance();
|
|
1602
1600
|
}
|
|
1603
1601
|
async load() {
|
|
1604
1602
|
this.rows.next(await this.tableSource.loadRows()), this.headerSchema.next(
|
|
@@ -1653,7 +1651,7 @@ class or {
|
|
|
1653
1651
|
}
|
|
1654
1652
|
class hs extends or {
|
|
1655
1653
|
constructor(e) {
|
|
1656
|
-
super(e), this.selectedRows = new
|
|
1654
|
+
super(e), this.selectedRows = new D(
|
|
1657
1655
|
/* @__PURE__ */ new Map()
|
|
1658
1656
|
), this.selectRow = this.selectRow.bind(this), this.selectAll = this.selectAll.bind(this), this.isEveryRowSelected = this.isEveryRowSelected.bind(this), this.clearAllSelectedItems = this.clearAllSelectedItems.bind(this), this.getSelectedRowsAsArray = this.getSelectedRowsAsArray.bind(this), this.getSelectedRowIds = this.getSelectedRowIds.bind(this);
|
|
1659
1657
|
}
|
|
@@ -2269,9 +2267,9 @@ function ps(t) {
|
|
|
2269
2267
|
};
|
|
2270
2268
|
}
|
|
2271
2269
|
function Er() {
|
|
2272
|
-
const t =
|
|
2270
|
+
const t = M(
|
|
2273
2271
|
/* @__PURE__ */ new Map()
|
|
2274
|
-
), e =
|
|
2272
|
+
), e = M(0), r = M(null), s = w(() => Array.from(t.value.values()));
|
|
2275
2273
|
function n(v) {
|
|
2276
2274
|
e.value = v;
|
|
2277
2275
|
}
|
|
@@ -2328,7 +2326,7 @@ class gs {
|
|
|
2328
2326
|
}
|
|
2329
2327
|
const et = new xr();
|
|
2330
2328
|
function Or() {
|
|
2331
|
-
const t =
|
|
2329
|
+
const t = M(structuredClone(et));
|
|
2332
2330
|
function e() {
|
|
2333
2331
|
t.value.pageNumber = t.value.pageNumber + 1;
|
|
2334
2332
|
}
|
|
@@ -2392,7 +2390,7 @@ function Or() {
|
|
|
2392
2390
|
};
|
|
2393
2391
|
}
|
|
2394
2392
|
function Lr() {
|
|
2395
|
-
const t =
|
|
2393
|
+
const t = M(/* @__PURE__ */ new Set()), e = w(() => t.value.has(g.FetchList)), r = w(() => t.value.has(g.FetchItem)), s = w(() => t.value.has(g.FetchLastItems)), n = w(() => t.value.has(g.FetchPreviousItems)), i = w(() => t.value.has(g.Create)), a = w(() => t.value.has(g.Update)), l = w(() => t.value.has(g.Delete)), o = w(() => t.value.has(g.Search)), u = w(() => t.value.has(g.Sort));
|
|
2396
2394
|
function f(v) {
|
|
2397
2395
|
t.value.add(v);
|
|
2398
2396
|
}
|
|
@@ -2529,7 +2527,7 @@ function ms(t) {
|
|
|
2529
2527
|
};
|
|
2530
2528
|
}
|
|
2531
2529
|
function ys(t) {
|
|
2532
|
-
const e =
|
|
2530
|
+
const e = M(t), r = w(() => ({
|
|
2533
2531
|
getData() {
|
|
2534
2532
|
return {
|
|
2535
2533
|
totalItems: e.value.length,
|
|
@@ -2564,7 +2562,7 @@ function ys(t) {
|
|
|
2564
2562
|
};
|
|
2565
2563
|
}
|
|
2566
2564
|
function Ss() {
|
|
2567
|
-
const t =
|
|
2565
|
+
const t = M(/* @__PURE__ */ new Map()), e = M(0), r = w(() => e.value), s = w(() => Array.from(t.value.values()));
|
|
2568
2566
|
function n(f) {
|
|
2569
2567
|
e.value = f;
|
|
2570
2568
|
}
|
|
@@ -2650,23 +2648,23 @@ class Rs {
|
|
|
2650
2648
|
async handleWarning() {
|
|
2651
2649
|
}
|
|
2652
2650
|
}
|
|
2653
|
-
const
|
|
2651
|
+
const _ = class _ {
|
|
2654
2652
|
constructor() {
|
|
2655
2653
|
}
|
|
2656
2654
|
static GetInstance() {
|
|
2657
|
-
return
|
|
2655
|
+
return _.instance || (_.instance = new _()), _.instance;
|
|
2658
2656
|
}
|
|
2659
2657
|
static registerHandler(e, r) {
|
|
2660
|
-
|
|
2658
|
+
_.handlers.set(e, r);
|
|
2661
2659
|
}
|
|
2662
2660
|
handle(e) {
|
|
2663
2661
|
var n;
|
|
2664
|
-
const r = ((n = e.response) == null ? void 0 : n.status) ?? 0, s =
|
|
2662
|
+
const r = ((n = e.response) == null ? void 0 : n.status) ?? 0, s = _.handlers.get(r);
|
|
2665
2663
|
s && s.handleError(e);
|
|
2666
2664
|
}
|
|
2667
2665
|
};
|
|
2668
|
-
|
|
2669
|
-
let tt =
|
|
2666
|
+
_.handlers = /* @__PURE__ */ new Map(), _.instance = null;
|
|
2667
|
+
let tt = _;
|
|
2670
2668
|
class As {
|
|
2671
2669
|
constructor(e) {
|
|
2672
2670
|
this.axiosInstance = e;
|
|
@@ -2825,7 +2823,7 @@ const Ms = nt(je.Dialog, () => {
|
|
|
2825
2823
|
hasDefaultHeader: r
|
|
2826
2824
|
};
|
|
2827
2825
|
}), Es = nt(je.Drawer, () => {
|
|
2828
|
-
const t =
|
|
2826
|
+
const t = M(ne.Close), e = w(() => t.value === ne.Open);
|
|
2829
2827
|
function r() {
|
|
2830
2828
|
t.value = ne.Close;
|
|
2831
2829
|
}
|
|
@@ -2967,7 +2965,7 @@ class ks {
|
|
|
2967
2965
|
});
|
|
2968
2966
|
}
|
|
2969
2967
|
}
|
|
2970
|
-
var kr = Object.defineProperty, $r = Object.getOwnPropertyDescriptor,
|
|
2968
|
+
var kr = Object.defineProperty, $r = Object.getOwnPropertyDescriptor, E = (t, e, r, s) => {
|
|
2971
2969
|
for (var n = s > 1 ? void 0 : s ? $r(e, r) : e, i = t.length - 1, a; i >= 0; i--)
|
|
2972
2970
|
(a = t[i]) && (n = (s ? a(e, r, n) : a(n)) || n);
|
|
2973
2971
|
return s && n && kr(e, r, n), n;
|
|
@@ -2985,13 +2983,13 @@ let Re = class {
|
|
|
2985
2983
|
});
|
|
2986
2984
|
}
|
|
2987
2985
|
};
|
|
2988
|
-
|
|
2986
|
+
E([
|
|
2989
2987
|
U("value", String, !0)
|
|
2990
2988
|
], Re.prototype, "value", 2);
|
|
2991
|
-
|
|
2989
|
+
E([
|
|
2992
2990
|
U("symbol", String)
|
|
2993
2991
|
], Re.prototype, "symbol", 2);
|
|
2994
|
-
Re =
|
|
2992
|
+
Re = E([
|
|
2995
2993
|
ke("Amount")
|
|
2996
2994
|
], Re);
|
|
2997
2995
|
let Ae = class {
|
|
@@ -3004,27 +3002,27 @@ let Ae = class {
|
|
|
3004
3002
|
return t;
|
|
3005
3003
|
}
|
|
3006
3004
|
};
|
|
3007
|
-
|
|
3005
|
+
E([
|
|
3008
3006
|
U("id", Object)
|
|
3009
3007
|
], Ae.prototype, "id", 2);
|
|
3010
|
-
Ae =
|
|
3008
|
+
Ae = E([
|
|
3011
3009
|
ke("BaseModel")
|
|
3012
3010
|
], Ae);
|
|
3013
3011
|
let ee = class extends Ae {
|
|
3014
3012
|
};
|
|
3015
|
-
|
|
3013
|
+
E([
|
|
3016
3014
|
U("symbol", String)
|
|
3017
3015
|
], ee.prototype, "symbol", 2);
|
|
3018
|
-
|
|
3016
|
+
E([
|
|
3019
3017
|
U("enName", String)
|
|
3020
3018
|
], ee.prototype, "enName", 2);
|
|
3021
|
-
|
|
3019
|
+
E([
|
|
3022
3020
|
U("faName", String)
|
|
3023
3021
|
], ee.prototype, "faName", 2);
|
|
3024
|
-
|
|
3022
|
+
E([
|
|
3025
3023
|
U("image", String)
|
|
3026
3024
|
], ee.prototype, "image", 2);
|
|
3027
|
-
ee =
|
|
3025
|
+
ee = E([
|
|
3028
3026
|
ke("MinifiedSymbolModel")
|
|
3029
3027
|
], ee);
|
|
3030
3028
|
class $s {
|
|
@@ -3032,16 +3030,16 @@ class $s {
|
|
|
3032
3030
|
this.requestedDate = e, this.executedDate = r;
|
|
3033
3031
|
}
|
|
3034
3032
|
get requestedDateInJalali() {
|
|
3035
|
-
return
|
|
3033
|
+
return C.mapUnixToDate(this.requestedDate, se.SimpleDate);
|
|
3036
3034
|
}
|
|
3037
3035
|
get requestedTime() {
|
|
3038
|
-
return
|
|
3036
|
+
return C.mapUnixToDate(this.requestedDate, se.JustHour);
|
|
3039
3037
|
}
|
|
3040
3038
|
get executedDateInJalali() {
|
|
3041
|
-
return
|
|
3039
|
+
return C.mapUnixToDate(this.executedDate, se.SimpleDate);
|
|
3042
3040
|
}
|
|
3043
3041
|
get executedDateTime() {
|
|
3044
|
-
return
|
|
3042
|
+
return C.mapUnixToDate(this.executedDate, se.JustHour);
|
|
3045
3043
|
}
|
|
3046
3044
|
}
|
|
3047
3045
|
class Vs {
|
|
@@ -3084,7 +3082,7 @@ export {
|
|
|
3084
3082
|
Oe as AuthorizationService,
|
|
3085
3083
|
Ae as BaseModel,
|
|
3086
3084
|
ar as BaseTable,
|
|
3087
|
-
|
|
3085
|
+
D as BehaviorSubject,
|
|
3088
3086
|
Ne as CellType,
|
|
3089
3087
|
Ps as ClientArraySearch,
|
|
3090
3088
|
Pr as ClientSearch,
|
|
@@ -3104,7 +3102,7 @@ export {
|
|
|
3104
3102
|
vs as FetchListResponse,
|
|
3105
3103
|
Qr as FormManager,
|
|
3106
3104
|
Se as FormValidationStatus,
|
|
3107
|
-
|
|
3105
|
+
C as Formatter,
|
|
3108
3106
|
fs as GColumn,
|
|
3109
3107
|
ps as GTable,
|
|
3110
3108
|
Is as HandleError,
|
package/dist/IronCore.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(o,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("dayjs"),require("vue"),require("json2typescript"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","dayjs","vue","json2typescript","pinia"],_):(o=typeof globalThis<"u"?globalThis:o||self,_(o.IronCore={},o.dayjs,o.Vue,o.json2typescript,o.pinia))})(this,function(o,_,g,C,Ke){"use strict";var oe=(t=>(t.BankCard="####-####-####-####",t.Iban="##-####-####-####-####-####-##",t))(oe||{}),J=(t=>(t.FullDate="YYYY/M/D HH:mm",t.SimpleDate="YYYY/M/D",t.CompactGregorianDate="YYYYMMDD",t.ShortJalaliDate="YYMM",t.JustHour="HH:mm:ss",t))(J||{});const Ze=[{62198619:{persian:"بلو",english:"blue"}},{603799:{persian:"بانک ملی ایران",english:"melli"}},{589210:{persian:"بانک سپه",english:"sepah"}},{627648:{persian:"بانک توسعه صادرات",english:"export-development"}},{627961:{persian:"بانک صنعت و معدن",english:"industry-mine"}},{603770:{persian:"بانک کشاورزی",english:"agriculture"}},{628023:{persian:"بانک مسکن",english:"housing"}},{627760:{persian:"پست بانک ایران",english:"post"}},{502908:{persian:"بانک توسعه تعاون",english:"development-cooperation"}},{627412:{persian:"بانک اقتصاد نوین",english:"eghtesad-novin"}},{622106:{persian:"بانک پارسیان",english:"parsian"}},{502229:{persian:"بانک پاسارگاد",english:"pasargad"}},{639599:{persian:"بانک قوامین",english:"ghavamin"}},{627488:{persian:"بانک کارآفرین",english:"karafarin"}},{621986:{persian:"بانک سامان",english:"saman"}},{639346:{persian:"بانک سینا",english:"sina"}},{639607:{persian:"بانک سرمایه",english:"sarmayeh"}},{504706:{persian:"بانک شهر",english:"shahr"}},{502806:{persian:"بانک شهر",english:"shahr"}},{502938:{persian:"بانک دی",english:"day"}},{603769:{persian:"بانک صادرات",english:"saderat"}},{610433:{persian:"بانک ملت",english:"mellat"}},{627353:{persian:"بانک تجارت",english:"tejarat"}},{585983:{persian:"بانک تجارت",english:"tejarat"}},{589463:{persian:"بانک رفاه",english:"refah"}},{627381:{persian:"بانک انصار",english:"ansar"}},{639370:{persian:"بانک مهر اقتصاد",english:"mehr-eqtesad"}},{505801:{persian:"موسسه اعتباری کوثر",english:"kosar"}},{606373:{persian:"بانک قرض الحسنه مهرایرانیان",english:"mehr"}},{186214:{persian:"بانک آینده",english:"ayandeh"}},{504172:{persian:"بانک قرض الحسنه رسالت",english:"resalat"}},{505416:{persian:"بانک گردشگری",english:"tourism"}},{505785:{persian:"بانک ایرانزمین",english:"iran-zamin"}},{505809:{persian:"بانک خاورمیانه",english:"middle-east"}},{585947:{persian:"بانک خاورمیانه",english:"middle-east"}},{604932:{persian:"بانک سپه",english:"sepah"}},{627961:{persian:"بانک صنعت و معدن",english:"industry-mine"}},{636214:{persian:"بانک آینده",english:"ayandeh"}},{636795:{persian:"بانک مرکزی",english:"markazi"}},{636949:{persian:"بانک حکمت ایرانیان",english:"hekmat-iranian"}},{639217:{persian:"بانک کشاورزی",english:"agriculture"}}],Xe=[{"010":{persian:"بانک مرکزی",english:"markazi"}},{"011":{persian:"بانک صنعت و معدن",english:"industry-mine"}},{"012":{persian:"بانک ملت",english:"mellat"}},{"013":{persian:"بانک رفاه",english:"refah"}},{"014":{persian:"بانک مسکن",english:"housing"}},{"015":{persian:"بانک سپه",english:"sepah"}},{"016":{persian:"بانک کشاورزی",english:"agriculture"}},{"017":{persian:"بانک ملّی ایران",english:"melli"}},{"018":{persian:"بانک تجارت",english:"tejarat"}},{"019":{persian:"بانک صادرات",english:"saderat"}},{"020":{persian:"بانک توسعه صادرات",english:"export-development"}},{"021":{persian:"پست بانک",english:"post"}},{"053":{persian:"بانک کارآفرین",english:"karafarin"}},{"054":{persian:"بانک پارسیان",english:"parsian"}},{"055":{persian:"بانک اقتصاد نوین",english:"eghtesad-novin"}},{"056":{persian:"بانک سامان",english:"saman"}},{"057":{persian:"بانک پاسارگاد",english:"pasargad"}},{"058":{persian:"بانک سرمایه",english:"sarmayeh"}},{"059":{persian:"بانک سینا",english:"sina"}},{"060":{persian:"بانک قرض الحسنه مهرایرانیان",english:"mehr"}},{"061":{persian:"بانک شهر",english:"shahr"}},{"062":{persian:"بانک آینده",english:"ayandeh"}},{"065":{persian:"بانک حکمت ایرانیان",english:"hekmat-iranian"}},{"066":{persian:"بانک دی",english:"day"}},{"069":{persian:"بانک ایران زمین",english:"iran-zamin"}},{"070":{persian:"بانک قرض الحسنه رسالت",english:"resalat"}},{"078":{persian:"بانک خاورمیانه",english:"middle-east"}}];var Qe=(t=>(t.Normal="YYYY-MM-DD",t.ContainsHour="YYYY-MM-DD HH:mm",t.OnlyHour="HH:mm",t))(Qe||{});function le(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ue={exports:{}},Ct=ue.exports,et;function Mt(){return et||(et=1,function(t,e){(function(r,s){t.exports=s()})(Ct,function(){return function(r,s){s.prototype.weekday=function(n){var i=this.$locale().weekStart||0,a=this.$W,u=(a<i?a+7:a)-i;return this.$utils().u(n)?u:this.subtract(u,"day").add(n,"day")}}})}(ue)),ue.exports}var Tt=Mt();const Et=le(Tt);var ce={exports:{}},Lt=ce.exports,tt;function Ot(){return tt||(tt=1,function(t,e){(function(r,s){t.exports=s()})(Lt,function(){var r="week",s="year";return function(n,i,a){var u=i.prototype;u.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var v=a(this).startOf(s).add(1,s).date(c),f=a(this).endOf(r);if(v.isBefore(f))return 1}var p=a(this).startOf(s).date(c).startOf(r).subtract(1,"millisecond"),S=this.diff(p,r,!0);return S<0?a(this).startOf("week").week():Math.ceil(S)},u.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(ce)),ce.exports}var Pt=Ot();const kt=le(Pt);var he={exports:{}},Vt=he.exports,rt;function $t(){return rt||(rt=1,function(t,e){(function(r,s){t.exports=s()})(Vt,function(){return function(r,s){s.prototype.weekYear=function(){var n=this.month(),i=this.week(),a=this.year();return i===1&&n===11?a+1:n===0&&i>=52?a-1:a}}})}(he)),he.exports}var Ft=$t();const Nt=le(Ft);var de={exports:{}},Bt=de.exports,st;function jt(){return st||(st=1,function(t,e){(function(r,s){t.exports=s(_)})(Bt,function(r){function s(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var n=s(r),i={name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return n.default.locale(i,null,!0),i})}(de)),de.exports}var Ut=jt();const Yt=le(Ut);function fe(t,e){return Ht(t)||qt(t,e)||zt()}function Ht(t){if(Array.isArray(t))return t}function qt(t,e){var r=[],s=!0,n=!1,i=void 0;try{for(var a=t[Symbol.iterator](),u;!(s=(u=a.next()).done)&&(r.push(u.value),!(e&&r.length===e));s=!0);}catch(l){n=!0,i=l}finally{try{!s&&a.return!=null&&a.return()}finally{if(n)throw i}}return r}function zt(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function nt(t,e,r){e<=2&&(t-=1,e+=12);var s=Math.floor(t/100),n=2-s+Math.floor(s/4),i=Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+n-1524.5;return i}function Jt(t){t=t+.5;var e=Math.floor(t),r=t-e,s=e;if(e>=2299161){var n=Math.floor((e-186721625e-2)/36524.25);s=e+1+n-Math.floor(n/4)}var i=s+1524,a=Math.floor((i-122.1)/365.25),u=Math.floor(365.25*a),l=Math.floor((i-u)/30.6001),c=i-u-Math.floor(30.6001*l)+r,v=l<14?l-1:l-13,f=v>2?a-4716:a-4715;return Wt(f,v,c)}function Gt(t){t=t+.5;var e=Math.floor(t),r=t-e,s=e;if(e>=2299161){var n=Math.floor((e-186721625e-2)/36524.25);s=e+1+n-Math.floor(n/4)}var i=s+1524,a=Math.floor((i-122.1)/365.25),u=Math.floor(365.25*a),l=Math.floor((i-u)/30.6001),c=i-u-Math.floor(30.6001*l)+r,v=l<14?l-1:l-13,f=v>2?a-4716:a-4715;return[Math.floor(f),Math.floor(v),Math.floor(c)]}function xt(t,e,r){var s=[31,28,31,30,31,30,31,31,30,31,30,31],n=[31,31,31,31,31,31,30,30,30,30,30,29];function i(S,A){return Math.floor(S/A)}t-=979;for(var a=365*t+i(t,33)*8+i(t%33+3,4),u=0;u<e-1;++u)a+=n[u];a+=r-1;var l=a+79,c=1600+400*i(l,146097);l=l%146097;var v=!0;for(l>=36525&&(l--,c+=100*i(l,36524),l=l%36524,l>=365?l++:v=!1),c+=4*i(l,1461),l%=1461,l>=366&&(v=!1,l--,c+=i(l,365),l=l%365),u=0;l>=s[u]+(u==1&&v);u++)l-=s[u]+(u==1&&v);var f=u+1,p=l+1;return nt(c,f,p)}function Wt(t,e,r){var s=[31,28,31,30,31,30,31,31,30,31,30,31],n=[31,31,31,31,31,31,30,30,30,30,30,29];function i(Q,ee){return Math.floor(Q/ee)}for(var a=t-1600,u=e-1,l=r-1,c=365*a+i(a+3,4)-i(a+99,100)+i(a+399,400),v=0;v<u;++v)c+=s[v];u>1&&(t%4==0&&t%100!=0||t%400==0)&&c++,c+=l;var f=c-79,p=i(f,12053);f%=12053;var S=979+33*p+4*i(f,1461);f%=1461,f>=366&&(S+=i(f-1,365),f=(f-1)%365);for(var A=0;A<11&&f>=n[A];++A)f-=n[A];var Z=A+1,X=f+1;return[S,Z,X]}var ve={J:function(e,r,s){return Jt(nt(e,r,s))},G:function(e,r,s){return Gt(xt(e,r,s))}},Kt=/^(\d{4})[-/]?(\d{1,2})[-/]?(\d{0,2})(.*)?$/,Zt=/\[.*?\]|jY{2,4}|jM{1,4}|jD{1,2}|Y{2,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,Ee="date",G="day",$="month",F="year",it="week",Xt="YYYY-MM-DDTHH:mm:ssZ",Qt={jmonths:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_")},er=function(t,e,r){var s=e.prototype,n=s.$utils(),i=function(d){return d.$C==="jalali"},a=n.prettyUnit||n.p,u=n.isUndefined||n.u,l=n.padStart||n.s,c=n.monthDiff||n.m,v=n.absFloor||n.a,f=function(d){return function(){var m=d.bind(this).apply(void 0,arguments);return m.$C=this.$C,m.isJalali()&&m.InitJalali(),m}};s.startOf=f(s.startOf),s.endOf=f(s.endOf),s.add=f(s.add),s.subtract=f(s.subtract),s.set=f(s.set);var p=s.parse,S=s.init,A=s.startOf,Z=s.$set,X=s.add,Q=s.format,ee=s.diff,Ge=s.year,xe=s.month,_e=s.date,We=s.daysInMonth,ie=s.toArray;r.$C="gregory",r.$fdow=6,r.calendar=function(h){return r.$C=h,r},s.calendar=function(h){var d=this.clone();return d.$C=h,d.isJalali()&&d.InitJalali(),d},s.isJalali=function(){return i(this)},r.en.jmonths="Farvardin_Ordibehesht_Khordaad_Tir_Mordaad_Shahrivar_Mehr_Aabaan_Aazar_Dey_Bahman_Esfand".split("_"),r.locale("fa",Object.assign({},Yt,{},Qt),!0);var te=function(d,m){return r(d,{locale:m.$L,utc:m.$u,calendar:m.$C})};s.init=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};S.bind(this)(h),this.isJalali()&&this.InitJalali()},s.parse=function(h){var d;if(this.$C=h.calendar||this.$C||r.$C,h.jalali&&typeof h.date=="string"&&/.*[^Z]$/i.test(h.date)&&(d=h.date.match(Kt))){var m=ve.G(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3]||1,10)),I=fe(m,3),b=I[0],w=I[1],R=I[2];h.date="".concat(b,"-").concat(w,"-").concat(R).concat(d[4]||"")}return p.bind(this)(h)},s.InitJalali=function(){var h=ve.J(this.$y,this.$M+1,this.$D),d=fe(h,3),m=d[0],I=d[1],b=d[2];this.$jy=m,this.$jM=I-1,this.$jD=b},s.startOf=function(h,d){var m=this;if(!i(this))return A.bind(this)(h,d);var I=u(d)?!0:d,b=a(h),w=function(re,q){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.$jy,Me=ve.G(P,q+1,re),z=fe(Me,3),ae=z[0],Te=z[1],Ds=z[2],_t=te(new Date(ae,Te-1,Ds),m);return(I?_t:_t.endOf(G)).$set("hour",1)},R=(this.$W+(7-r.$fdow))%7;switch(b){case F:return I?w(1,0):w(0,0,this.$jy+1);case $:return I?w(1,this.$jM):w(0,(this.$jM+1)%12,this.$jy+parseInt((this.$jM+1)/12,10));case it:return I?w(this.$jD-R,this.$jM):w(this.$jD+(6-R),this.$jM);default:return A.bind(this)(h,d)}},s.$set=function(h,d){var m=this;if(!i(this))return Z.bind(this)(h,d);var I=a(h),b=function(R,Ce){var re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.$jy,q=ve.G(re,Ce+1,R),P=fe(q,3),Me=P[0],z=P[1],ae=P[2];return m.$d.setFullYear(Me),m.$d.setMonth(z-1),m.$d.setDate(ae),m};switch(I){case Ee:case G:b(d,this.$jM);break;case $:b(this.$jD,d);break;case F:b(this.$jD,this.$jM,d);break;default:return Z.bind(this)(h,d)}return this.init(),this},s.add=function(h,d){var m=this;if(!i(this))return X.bind(this)(h,d);h=Number(h);var I=d&&(d.length===1||d==="ms")?d:a(d),b=function(z,ae){var Te=m.set(Ee,1).set(z,ae+h);return Te.set(Ee,Math.min(m.$jD,Te.daysInMonth()))};if(["M",$].indexOf(I)>-1){var w=this.$jM+h,R=w<0?-Math.ceil(-w/12):Math.floor(w/12),Ce=this.$jD,re=this.set(G,1).add(R,F).set($,w-R*12);return re.set(G,Math.min(re.daysInMonth(),Ce))}if(["y",F].indexOf(I)>-1)return b(F,this.$jy);if(["d",G].indexOf(I)>-1){var q=new Date(this.$d);return q.setDate(q.getDate()+h),te(q,this)}if(["w",it].indexOf(I)>-1){var P=new Date(this.$d);return P.setDate(P.getDate()+h*7),te(P,this)}return X.bind(this)(h,d)},s.format=function(h,d){var m=this;if(!i(this))return Q.bind(this)(h,d);var I=h||Xt,b=d||this.$locale(),w=b.jmonths;return I.replace(Zt,function(R){if(R.indexOf("[")>-1)return R.replace(/\[|\]/g,"");switch(R){case"YY":return String(m.$jy).slice(-2);case"YYYY":return String(m.$jy);case"M":return String(m.$jM+1);case"MM":return l(m.$jM+1,2,"0");case"MMM":return w[m.$jM].slice(0,3);case"MMMM":return w[m.$jM];case"D":return String(m.$jD);case"DD":return l(m.$jD,2,"0");default:return Q.bind(m)(R,d)}})},s.diff=function(h,d,m){if(!i(this))return ee.bind(this)(h,d,m);var I=a(d),b=r(h),w=c(this,b);switch(I){case F:w/=12;break;case $:break;default:return ee.bind(this)(h,d,m)}return m?w:v(w)},s.$g=function(h,d,m){return u(h)?this[d]:this.set(m,h)},s.year=function(h){return i(this)?this.$g(h,"$jy",F):Ge.bind(this)(h)},s.month=function(h){return i(this)?this.$g(h,"$jM",$):xe.bind(this)(h)},s.date=function(h){return i(this)?this.$g(h,"$jD",G):_e.bind(this)(h)},s.daysInMonth=function(){return i(this)?this.endOf($).$jD:We.bind(this)()},ie&&(s.toArray=function(){return i(this)?[this.$jy,this.$jM,this.$jD,this.$H,this.$m,this.$s,this.$ms]:ie.bind(this)()}),s.clone=function(){return te(this.toDate(),this)}};const tr={ordinal(t){},relativeTime:void 0,name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),months:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),monthsShort:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),weekStart:6,formats:{L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};function at(){_.extend(er),_.calendar("jalali"),_.extend(Et),_.extend(kt),_.extend(Nt),_.locale(tr,{},!0)}class rr{constructor(e,r){this.start=e,this.end=r}}class sr{constructor(e,r,s){this.maxDate=e,this.minDate=r,this.disabledDates=s}}class N{static standardToUnix(e){return Math.floor(new Date(e).getTime()/1e3)}static unixToStandard(e){return new Date(e*1e3).toString()}static getUnixEndOfDayInUnix(e){return _.unix(e).endOf("day").unix()}}class se{static isDateDisabled(e,r){for(const s of e.disabledDates)if(se.areUnixesInSameDate(s,r.unix()))return!0;return!!(e.maxDate&&se.isDateGraterOrSame(e.maxDate,r.unix())||e.minDate&&se.isDateLowerOrSame(e.minDate,r.unix()))}static areUnixesInSameDate(e,r){return N.getUnixEndOfDayInUnix(e)===N.getUnixEndOfDayInUnix(r)}static isDateGraterOrSame(e,r){return N.getUnixEndOfDayInUnix(r)>=N.getUnixEndOfDayInUnix(e)}static isDateLowerOrSame(e,r){return N.getUnixEndOfDayInUnix(r)<=N.getUnixEndOfDayInUnix(e)}}at();class M{static toCurrency(e,r){return e.toLocaleString("en-US",r)}static toCurrencyWithDotSeparator(e){return M.toCurrency(e).replaceAll(",",".")}static applyMask(e,r){let s="",n=0,i=0;for(;n<e.length;){if(e[n]==="#"){if(i>=r.length)throw new Error("Value length does not match the format.");s+=r[i],i++}else s+=e[n];n++}if(i!==r.length)throw new Error("Value length does not match the format.");return s}static applyBankCardMask(e){return M.applyMask(oe.BankCard,String(e))}static applyIbanMask(e){return M.applyMask(oe.Iban,String(e))}static toEnglishDigits(e){const r=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],s=["١","٢","٣","٤","٥","٦","٧","٨","٩","٠"],n=["1","2","3","4","5","6","7","8","9","0"];return e.split("").map(i=>n[r.indexOf(i)]||n[s.indexOf(i)]||i).join("")}static mapUnixToDate(e,r){return _(new Date(e)).subtract(1,"day").format(r)}}var y=(t=>(t.FetchList="fetchList",t.AutoRefresh="autoRefresh",t.FetchItem="fetchItem",t.FetchLastItems="fetchLastItems",t.FetchPreviousItems="fetchPreviousItems",t.Create="CREATE",t.Update="UPDATE",t.Delete="DELETE",t.Search="SEARCH",t.Sort="SORT",t.Success="SUCCESS",t.Error="ERROR",t.Idle="IDLE",t))(y||{}),k=(t=>(t.Width="width",t.Height="height",t[t.DefaultWidth=500]="DefaultWidth",t[t.DefaultHeight=350]="DefaultHeight",t[t.MinimalAvailableSize=0]="MinimalAvailableSize",t))(k||{}),O=(t=>(t.ASC="ASC",t.DESC="DESC",t))(O||{}),ot=(t=>(t.ASC="ascend",t.DESC="descend",t))(ot||{}),me=(t=>(t.Left="left",t.Right="right",t.Center="center",t))(me||{}),pe=(t=>(t.Text="text",t))(pe||{}),ge=(t=>(t.Text="text",t.ACTION="action",t.Tag="tag",t.Iban="iban",t.BankCard="bankCard",t.Symbol="symbol",t.TradeDetail="tradeDetail",t.SymbolPrice="symbolPrice",t.TradeSymbol="tradeSymbol",t.Price="price",t.DynamicCurrencyPrice="dynamicCurrencyPrice",t.TradeDate="tradeDate",t.RequestResponseIdentity="requestResponseIdentity",t.Image="image",t))(ge||{}),Le=(t=>(t[t.MINIMAL_LOADABLE_HEADER_COUNT=0]="MINIMAL_LOADABLE_HEADER_COUNT",t[t.DEFAULT_ITEM_COUNT_PER_PAGE=20]="DEFAULT_ITEM_COUNT_PER_PAGE",t.PAGINATION_POSITION="bottomCenter",t))(Le||{});o.ApplicationTheme=(t=>(t.FontFamily="IRANSansX",t))(o.ApplicationTheme||{});var x=(t=>(t.Open="open",t.Close="close",t))(x||{}),lt=(t=>(t[t.NotFound=404]="NotFound",t[t.Unauthorized=401]="Unauthorized",t[t.ServerError=500]="ServerError",t))(lt||{}),ne=(t=>(t[t.Invalid=0]="Invalid",t[t.Valid=1]="Valid",t))(ne||{}),V=(t=>(t.Theme="theme",t.AccessList="accessList",t.Token="token",t.SSO_ACCESS_LIST="ssoAccessList",t))(V||{});o.ApplicationTheme=(t=>(t.Light="light",t.Dark="dark",t))(o.ApplicationTheme||{});var ye=(t=>(t.Dialog="dialog",t.Drawer="drawer",t.Module="module",t.Toast="toast",t))(ye||{}),ut=(t=>(t.USDT="USDT",t))(ut||{});class B{static getBankImageBaseOnCardInfo(e,r){return e===void 0?"/img/banks/shetab.png":r==="IBAN"?(e=M.toEnglishDigits(e.replace(/IR/g,"").split(" ").join("")),`/img/banks/${B.iban(e).english}.png`):(e=M.toEnglishDigits(e.replace(/ /g,"")),`/img/banks/${B.card(e).english}.png`)}static card(e){const r={persian:"نامشخص",english:"shetab"};if(e==null)return r;e=e.substring(0,6);try{const s=Ze.find(n=>Object.keys(n)[0]===e);return s===void 0?r:Object.values(s)[0]}catch{return r}}static iban(e){const r={persian:"نامشخص",english:"shetab"};if(e==null)return r;e=e.substring(2,5);try{const s=Xe.find(n=>Object.keys(n)[0]===e);return s===void 0?r:Object.values(s)[0]}catch{return r}}static async copyValueToClipboard(e){await navigator.clipboard.writeText(String(e))}static downloadBlob(e,r=B.extractFileNameFromHeader(e)){const s=document.createElement("a");s.href=URL.createObjectURL(e.data),s.download=r,s.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0})),s.remove()}static extractFileNameFromHeader(e){var s,n,i,a;return((a=(s=e.headers["content-disposition"])==null?void 0:s.split("filename=")[1])==null?void 0:a.slice(1,((i=(n=e.headers["content-disposition"])==null?void 0:n.split("filename="))==null?void 0:i[1].length)-1))||"Saraf-File"}static removeSpacesFromString(e){return e&&typeof e.normalize=="function"&&(e=e.normalize("NFC")),e.replace(/[\s\u00A0\u1680\u180E\u2000-\u200A\u200B-\u200D\u2060\uFEFF\u2028\u2029\u202F\u205F\u3000]+/g,"")}static isArraySorted(e,r=n=>n,s=O.ASC){return e.every((n,i)=>e.length-1===i?!0:s===O.ASC?r(n)<=r(e[i+1]):r(n)>=r(e[i+1]))}}const U=class U{constructor(){this.availableAccesses=new Set}setAvailableAccesses(e){this.setAccessListToStorage(e);for(const r of e)this.availableAccesses.add(r)}setAccessListToStorage(e){localStorage.setItem(V.AccessList,JSON.stringify(e))}everyAccess(e){return e.every(r=>this.availableAccesses.has(r))}someAccess(e){return e.some(r=>this.availableAccesses.has(r))}clearAvailableAccesses(){this.availableAccesses.clear(),localStorage.removeItem(V.AccessList)}initialize(){const e=localStorage.getItem(V.AccessList);e!==null&&this.setAvailableAccesses(JSON.parse(e))}static GetInstance(){return U.Instance||(U.Instance=new U),U.Instance}};U.Instance=null;let W=U;class Oe{constructor(){this.mounted=(e,r)=>{this.checkAccess(e,r.value)},this.updated=(e,r)=>{this.checkAccess(e,r.value)},this.checkAccess=(e,r)=>{this.hasAccess(r)||e.remove()},this.accessService=W.GetInstance()}}class nr extends Oe{hasAccess(e){return this.accessService.everyAccess(e)}}class ir extends Oe{hasAccess(e){return this.accessService.someAccess(e)}}const Y=class Y{constructor(){this._accessLevels=new Map}initialize(){this.setAccessLevelFromStorage()}setAccessLevels(e){for(const r in e)this._accessLevels.set(r,new Set(e[r]));this.setAccessLevelsToStorage(e)}setAccessLevelsToStorage(e){localStorage.setItem(V.SSO_ACCESS_LIST,JSON.stringify(e))}getAccessLevelsFromStorage(){let e=localStorage.getItem(V.SSO_ACCESS_LIST);return e!==null?JSON.parse(e):e}getAccessLevelsOfScope(e){if(this._accessLevels.has(e))return this._accessLevels.get(e);throw new Error(`The scope is not exists ${e}`)}setAccessLevelFromStorage(){const e=this.getAccessLevelsFromStorage();e&&this.setAccessLevels(e)}everyAccess(e,r){const s=this.getAccessLevelsOfScope(e);return s?r.every(n=>s.has(n)):!1}someAccess(e,r){const s=this.getAccessLevelsOfScope(e);return s?r.some(n=>s.has(n)):!1}hasScope(e){return this._accessLevels.has(e)}clear(){localStorage.removeItem(V.SSO_ACCESS_LIST),this._accessLevels=new Map}static GetInstance(){return Y._instance||(Y._instance=new Y),Y._instance}};Y._instance=null;let Se=Y;class Pe{constructor(){this._authorizationService=Se.GetInstance(),this.mounted=this.mounted.bind(this),this.updated=this.updated.bind(this),this.hasAccess=this.hasAccess.bind(this),this.manageElement=this.manageElement.bind(this)}mounted(e,r,s){this.manageElement(e,r.arg,r.modifiers)}updated(e,r,s){this.manageElement(e,r.arg,r.modifiers)}manageElement(e,r,s){if(!this._authorizationService.hasScope(r)){e.remove();return}const n=this.getAccessLevels(r,s);this.hasAccess(r,n)||e.remove()}getAccessLevels(e,r){var n;let s=Object.keys(r);return s.length||(s=Array.from(((n=this._authorizationService.getAccessLevelsOfScope(e))==null?void 0:n.values())??[])),s}}class ar extends Pe{hasAccess(e,r){return this._authorizationService.everyAccess(e,r)}}class or extends Pe{hasAccess(e,r){return this._authorizationService.someAccess(e,r)}}class ct{constructor(){this.value=null,this.initialValue=null,this.name="",this.isValid=!1,this.isBlurSensitive=!1,this.isRequired=!1,this.isIncludeInRequestBody=!0,this.isChangeSensitive=!1,this.notValidMessage="",this.isEmptySensitive=!0,this.hasCustomValidationCheck=!1,this.shouldRemoveValidationMessageOnInteract=!1}}function lr(t){return t===1}function ur(t,e){return t-1===e}function ht(t){return String(t).length===0||t===null||t===void 0}function cr(t){t()}class hr{constructor(e,r){this.initialData=null,this.data=new ct,this._validators=[],this._id=Math.random(),this.data.value=r,this.data.name=e,this.shouldRunValidation()&&this.runValidation(!0)}shouldRunValidation(){return this.data.hasCustomValidationCheck?!1:this.data.isRequired?!0:!ht(this.data.value)}async runValidation(e=!1){for(const r of this._validators){const s=await r.validate(this.data.value);if(s){this.setFormToInvalidState(e,s);return}}this.setFormToValidState()}setFormToInvalidState(e,r){this.data.isValid=!1,(this.data.isChangeSensitive||e)&&this.setNotValidMessage(r)}setFormToValidState(){this.data.isValid=!0,this.setNotValidMessage("")}reset(){this.initialData?this.data=structuredClone(g.toRaw(this.initialData)):console.warn("The "+this.data.name+`input control has no initial data,
|
|
2
|
-
the initial data will be available after calling the [markAsInitial] method on this instance`)}markAsInitial(){this.initialData=structuredClone(g.toRaw(this.data))}setValidators(e){this._validators=e}getChangeSensitive(){return this.data.isChangeSensitive}setChangeSensitive(e){if(e&&this.data.shouldRemoveValidationMessageOnInteract)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.isChangeSensitive=e}getIsBlurSensitive(){return this.data.isBlurSensitive}setIsBlurSensitive(e){this.data.isBlurSensitive=e}getIsRequired(){return this.data.isRequired}setIsRequired(e){this.data.isRequired=e}getIsValid(){return this.data.isValid}setIsValid(e){this.data.isValid=e}getIsIncludeInRequestBody(){return this.data.isIncludeInRequestBody}setIsIncludeInRequestBody(e){this.data.isIncludeInRequestBody=e}getNotValidMessage(){return this.data.notValidMessage}setNotValidMessage(e){this.data.notValidMessage=e}getName(){return this.data.name}setName(e){this.data.name=e}setId(e){this._id=e}getId(){return this._id}getIsEmptySensitive(){return this.data.isEmptySensitive}setIsEmptySensitive(e){this.data.isEmptySensitive=e}setHasCustomValidationCheck(e){this.data.hasCustomValidationCheck=e}setShouldRemoveValidationOnInteract(e){if(e&&this.data.isChangeSensitive)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.shouldRemoveValidationMessageOnInteract=e}getShouldRemoveValidationOnInteract(){return this.data.shouldRemoveValidationMessageOnInteract}hasCustomValidationCheck(){return this.data.hasCustomValidationCheck}set value(e){this.data.value=e,this.shouldRunValidation()&&this.runValidation(),this.getShouldRemoveValidationOnInteract()&&this.setNotValidMessage("")}get value(){return this.data.value}}class dr{constructor(e){this._inputControl=e}setValidators(e){return this._inputControl.setValidators(e),this}setChangeSensitive(){return this._inputControl.setChangeSensitive(!0),this}setRequired(){return this._inputControl.setIsRequired(!0),this}setValid(){return this._inputControl.setIsValid(!0),this}setBlurSensitive(){return this._inputControl.setIsBlurSensitive(!0),this}setId(e){return this._inputControl.setId(e),this}removeEmptySensitive(){return this._inputControl.setIsEmptySensitive(!1),this}setHasCustomValidationCheck(){return this._inputControl.setHasCustomValidationCheck(!0),this}removeErrorOnInteract(){return this._inputControl.setShouldRemoveValidationOnInteract(!0),this}build(){return this._inputControl}}class fr{constructor(){this.mounted=(e,r)=>{r.value&&r.value.getIsBlurSensitive()&&(e.addEventListener("click",this.handleFocus.bind(this,r.value)),e.addEventListener("blur",this.handleBlur.bind(this,r.value),!0))},this.beforeUnMount=(e,r)=>{e.removeEventListener("blur",this.handleBlur.bind(this,r.value)),e.removeEventListener("click",this.handleFocus.bind(this,r.value))}}handleBlur(e){e.runValidation(!0)}handleFocus(e){e.value||e.getIsEmptySensitive()||e.setNotValidMessage("")}}class vr{constructor(){this._inputControls=new Map,this._isValid=!1,this._id=Math.random()}getInputControlsAsArray(){return Array.from(this._inputControls.values())}async runValidation(e){let r=!0;for(const s of this.getInputControlsAsArray())if(e&&await s.runValidation(!0),!s.getIsValid()&&(r=!1,!e)){this._isValid=!1;return}this._isValid=r}addInputControls(e){for(const r of e)this._inputControls.set(r.getName(),r)}getInputControl(e){const r=this._inputControls.get(e);if(!r)throw new Error(`The provided input name (${e}}) has no controls.`);return r}resetControls(e){for(const r of e){const s=this._inputControls.get(r);s?s.reset():console.warn(`Provided input name ${r} has no controllers in this form`)}}resetAll(){for(const e of this.getInputControlsAsArray())e.reset()}createRequestBody(){const e={};for(const r of this.getInputControlsAsArray())r.getIsIncludeInRequestBody()&&(e[r.getName()]=r.value);return e}setIsValid(e){this._isValid=e}getIsValid(){return this._isValid}setId(e){this._id=e}getId(){return this._id}}function mr(t,e=!1){const r=g.reactive(t),s=g.ref(ne.Invalid);return g.watch(()=>r.getInputControlsAsArray(),()=>{e||(r.runValidation(),r.getIsValid()?s.value=ne.Valid:s.value=ne.Invalid)},{immediate:!0,deep:!0}),{reactiveForm:r,validationStatus:s}}class ke{constructor(e){this.timerId=null,this.setupInterval=this.setupInterval.bind(this),this.schedule=e}setupInterval(e){const r=this;this.timerId=setTimeout(async function s(){await r.schedule.runAction(),r.timerId=setTimeout(()=>{s()},e)},e)}clearInterval(){this.timerId&&clearInterval(this.timerId)}}const Ve="150px",$e=2,pr={path:"id",key:"id",title:"عملیات",colspan:$e,width:Ve,cellType:ge.ACTION,align:me.Center,headerType:pe.Text,accessLevel:null},dt={width:Ve,align:me.Center,headerType:pe.Text,cellType:ge.Text,colspan:$e};class we{constructor(e,r){this.key=e,this.order=r}}class Fe{aSort(e,r){return e.sort((s,n)=>{const i=s[r]??s,a=n[r]??n;if(typeof i=="string"&&typeof a=="string")return i.localeCompare(a);if(typeof i=="number"&&typeof a=="number")return i-a;throw new Error("Not supported data type")})}bSort(e,r){return e.sort((s,n)=>{const i=s[r]??s,a=n[r]??n;if(typeof i=="string"&&typeof a=="string")return a.localeCompare(i);if(typeof i=="number"&&typeof a=="number")return a-i;throw new Error("Not supported data type")})}}class gr{arrayOfObjectSort(e,r,s,n=new Fe){return s===O.ASC?n.aSort(e,r):n.bSort(e,r)}arraySort(e,r,s=new Fe){return r===O.ASC?s.aSort(e):s.bSort(e)}}class ft{constructor(e){this.currentPage=1,this.currentPageSize=20,this.currentSortDetail=new we("id",O.DESC),this.loadedRows=[],this.headerSchema=[],this.service=e,this.accessService=W.GetInstance()}addHeader(e){this.headerSchema.push(e)}async load(){this.headerSchema=this.filterItemsBaseOnAccessLevel(await this.loadHeader()),await this.loadRows()}filterItemsBaseOnAccessLevel(e){return e.filter(r=>r.hasAccess?r.hasAccess():!0)}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail=e,this.loadedRows=(await this.handleSort(this.currentSortDetail)).items)}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.key||e.order!==this.currentSortDetail.order}async paginate(e,r){this.shouldSendPaginationRequest(e,r)&&(this.currentPage=e,this.currentPageSize=r,this.loadedRows=(await this.handlePagination(this.currentPage,this.currentPageSize)).items)}shouldSendPaginationRequest(e,r){return this.currentPage!==e||this.currentPageSize!==r}async loadRows(){return this.loadedRows=(await this.service.fetchRows()).items,this.loadedRows}getData(){return this.service.getData()}async handleSort(e){return await this.service.sort(e)}async handlePagination(e,r){return await this.service.paginate(e,r)}getItemCountPerPage(){return Le.DEFAULT_ITEM_COUNT_PER_PAGE}isLoading(){const e=this.getLoadingStatuses();return e.has(y.Search)||e.has(y.FetchList)||e.has(y.Sort)||e.has(y.FetchLastItems)||e.has(y.FetchPreviousItems)}getLoadingStatuses(){return this.getData().loadingStatus}hasAnyAction(){for(const e of this.loadedRows)if(this.getAccessedActions(e).length)return!0;return!1}getAccessedActions(e){return this.filterItemsBaseOnAccessLevel(this.getActions(e))}getActions(e){return[]}getScrollDetail(){return null}isExpandable(){return!1}async handleClick(e){}async handleMetaClick(e){}async handleDoubleClick(e){}async onDestroy(){}async loadHeader(){throw new Error("No header provided for the table.")}loadSummarySchema(){return{summaryTitle:"",summaryItems:[]}}}class T{constructor(e){this.observers=[],this.next(e)}attach(e){this.observers.push(e)}detach(e){this.observers=this.observers.filter(r=>r!==e)}notify(){for(const e of this.observers)typeof e=="function"?e(this._value):e.update(this._value)}next(e){typeof e=="function"?this._value=e(this._value):this._value=e,this.notify()}getValue(){return this._value}}class yr extends ft{constructor(e){super(e),this.selectedRows=new T(new Map),this.rowSelect=this.rowSelect.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.handlePagination=this.handlePagination.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRows=this.getSelectedRows.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}rowSelect(e){this.getSelectedRowsValue().has(e.id)?(this.getSelectedRowsValue().delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.loadedRows)this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRowsValue().size===this.currentPageSize||this.loadedRows.length===this.getSelectedRowsValue().size}async handlePagination(e,r){return this.clearAllSelectedItems(),await super.handlePagination(e,r)}async handleSort(e){return this.clearAllSelectedItems(),await super.handleSort(e)}clearAllSelectedItems(){this.selectedRows.getValue().clear(),this.selectedRows.next(this.selectedRows.getValue())}getSelectedRows(){return this.selectedRows}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}getSelectedRowsValue(){return this.selectedRows.getValue()}}function Sr(t){return{...dt,...t}}function wr(t){return function(r,s){r.constructor.prototype.headers||(r.constructor.prototype.headers=[]),r.constructor.prototype.headers.push({path:s,...t})}}function Ir(t){return function(r){async function s(){return r.prototype._table=this,r.prototype.headers}function n(u){const l=[],c=r.prototype.actions||[];for(const v of c){if(!v.isAvailable(u))continue;const f={handler:v.handler.bind(u),accessLevel:v.accessLevel,actionName:v.actionName};l.push(f)}return l}async function i(u){r.prototype.rowClick&&await r.prototype.rowClick.call(u)}async function a(){r.prototype.tableDestroy&&await r.prototype.tableDestroy()}t.prototype.loadHeader=s,t.prototype.getActions=n,t.prototype.handleClick=i,t.prototype.onDestroy=a}}function br(t){return function(r,s,n){r.constructor.prototype.actions||(r.constructor.prototype.actions=[]),t.handler=n.value,r.constructor.prototype.actions.push(t)}}function Ar(){return function(e,r,s){e.constructor.prototype.tableDestroy=s.value}}function Dr(){return function(e,r,s){e.constructor.prototype.rowClick=s.value}}class Rr{constructor(){this.observers=[]}attach(e){this.observers.push(e)}detach(e){this.observers=this.observers.filter(r=>r!==e)}notify(){for(const e of this.observers)e.update(this)}}class vt{constructor(e){this.rows=new T([]),this.headerSchema=new T([]),this.currentPage=new T(1),this.currentPageSize=new T(20),this.currentSortDetail=new T(new we("id",O.DESC)),this.scrollDetail=new T(null),this.isExpandable=new T(!1),this.tableSource=e,this.accessService=W.GetInstance()}async load(){this.rows.next(await this.tableSource.loadRows()),this.headerSchema.next(this.filterItemsBaseOnAccessLevel(await this.tableSource.loadHeaderSchema()))}async paginate(e,r){this.shouldSendPaginationRequest(e,r)&&(this.currentPage.next(e),this.currentPageSize.next(r),this.rows.next(await this.tableSource.paginate(e,r)))}shouldSendPaginationRequest(e,r){return this.currentPage.getValue()!==e||this.currentPageSize.getValue()!==r}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail.next(e),this.rows.next(await this.tableSource.sort(e)))}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.getValue().key||e.order!==this.currentSortDetail.getValue().order}async handleClick(e){this.tableSource.onRowClick&&await this.tableSource.onRowClick()}async handleMetaClick(e){this.tableSource.onRowMetaClick&&await this.tableSource.onRowMetaClick}async handleDoubleClick(e){this.tableSource.onRowDoubleClick&&await this.tableSource.onRowDoubleClick()}hasAnyAction(){for(const e of this.rows.getValue())if(this.getRowActions(e).length)return!0;return!1}getRowActions(e){return this.filterItemsBaseOnAccessLevel(this.tableSource.loadRowActions(e))}loadSummarySchema(){return this.tableSource.loadSummarySchema?this.tableSource.loadSummarySchema():{summaryTitle:"",summaryItems:[]}}filterItemsBaseOnAccessLevel(e){return e.filter(r=>r.hasAccess?r.hasAccess():!0)}async onDestroy(){this.tableSource.onTableDestroy()}}class _r extends vt{constructor(e){super(e),this.selectedRows=new T(new Map),this.selectRow=this.selectRow.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}selectRow(e){const r=this.getSelectedRows();r.has(e.id)?(r.delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(r.set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.rows.getValue())this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRows().size===this.currentPageSize.getValue()||this.rows.getValue().length===this.getSelectedRows().size}clearAllSelectedItems(){this.getSelectedRows().clear(),this.selectedRows.next(this.selectedRows.getValue)}getSelectedRows(){return this.selectedRows.getValue()}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}}var Ne;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(Ne||(Ne={}));const D=Ne;/*! *****************************************************************************
|
|
2
|
+
the initial data will be available after calling the [markAsInitial] method on this instance`)}markAsInitial(){this.initialData=structuredClone(g.toRaw(this.data))}setValidators(e){this._validators=e}getChangeSensitive(){return this.data.isChangeSensitive}setChangeSensitive(e){if(e&&this.data.shouldRemoveValidationMessageOnInteract)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.isChangeSensitive=e}getIsBlurSensitive(){return this.data.isBlurSensitive}setIsBlurSensitive(e){this.data.isBlurSensitive=e}getIsRequired(){return this.data.isRequired}setIsRequired(e){this.data.isRequired=e}getIsValid(){return this.data.isValid}setIsValid(e){this.data.isValid=e}getIsIncludeInRequestBody(){return this.data.isIncludeInRequestBody}setIsIncludeInRequestBody(e){this.data.isIncludeInRequestBody=e}getNotValidMessage(){return this.data.notValidMessage}setNotValidMessage(e){this.data.notValidMessage=e}getName(){return this.data.name}setName(e){this.data.name=e}setId(e){this._id=e}getId(){return this._id}getIsEmptySensitive(){return this.data.isEmptySensitive}setIsEmptySensitive(e){this.data.isEmptySensitive=e}setHasCustomValidationCheck(e){this.data.hasCustomValidationCheck=e}setShouldRemoveValidationOnInteract(e){if(e&&this.data.isChangeSensitive)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.shouldRemoveValidationMessageOnInteract=e}getShouldRemoveValidationOnInteract(){return this.data.shouldRemoveValidationMessageOnInteract}hasCustomValidationCheck(){return this.data.hasCustomValidationCheck}set value(e){this.data.value=e,this.shouldRunValidation()&&this.runValidation(),this.getShouldRemoveValidationOnInteract()&&this.setNotValidMessage("")}get value(){return this.data.value}}class dr{constructor(e){this._inputControl=e}setValidators(e){return this._inputControl.setValidators(e),this}setChangeSensitive(){return this._inputControl.setChangeSensitive(!0),this}setRequired(){return this._inputControl.setIsRequired(!0),this}setValid(){return this._inputControl.setIsValid(!0),this}setBlurSensitive(){return this._inputControl.setIsBlurSensitive(!0),this}setId(e){return this._inputControl.setId(e),this}removeEmptySensitive(){return this._inputControl.setIsEmptySensitive(!1),this}setHasCustomValidationCheck(){return this._inputControl.setHasCustomValidationCheck(!0),this}removeErrorOnInteract(){return this._inputControl.setShouldRemoveValidationOnInteract(!0),this}build(){return this._inputControl}}class fr{constructor(){this.mounted=(e,r)=>{r.value&&r.value.getIsBlurSensitive()&&(e.addEventListener("click",this.handleFocus.bind(this,r.value)),e.addEventListener("blur",this.handleBlur.bind(this,r.value),!0))},this.beforeUnMount=(e,r)=>{e.removeEventListener("blur",this.handleBlur.bind(this,r.value)),e.removeEventListener("click",this.handleFocus.bind(this,r.value))}}handleBlur(e){e.runValidation(!0)}handleFocus(e){e.value||e.getIsEmptySensitive()||e.setNotValidMessage("")}}class vr{constructor(){this._inputControls=new Map,this._isValid=!1,this._id=Math.random()}getInputControlsAsArray(){return Array.from(this._inputControls.values())}async runValidation(e){let r=!0;for(const s of this.getInputControlsAsArray())if(e&&await s.runValidation(!0),!s.getIsValid()&&(r=!1,!e)){this._isValid=!1;return}this._isValid=r}addInputControls(e){for(const r of e)this._inputControls.set(r.getName(),r)}getInputControl(e){const r=this._inputControls.get(e);if(!r)throw new Error(`The provided input name (${e}}) has no controls.`);return r}resetControls(e){for(const r of e){const s=this._inputControls.get(r);s?s.reset():console.warn(`Provided input name ${r} has no controllers in this form`)}}resetAll(){for(const e of this.getInputControlsAsArray())e.reset()}createRequestBody(){const e={};for(const r of this.getInputControlsAsArray())r.getIsIncludeInRequestBody()&&(e[r.getName()]=r.value);return e}setIsValid(e){this._isValid=e}getIsValid(){return this._isValid}setId(e){this._id=e}getId(){return this._id}}function mr(t,e=!1){const r=g.reactive(t),s=g.ref(ne.Invalid);return g.watch(()=>r.getInputControlsAsArray(),()=>{e||(r.runValidation(),r.getIsValid()?s.value=ne.Valid:s.value=ne.Invalid)},{immediate:!0,deep:!0}),{reactiveForm:r,validationStatus:s}}class ke{constructor(e){this.timerId=null,this.setupInterval=this.setupInterval.bind(this),this.schedule=e}setupInterval(e){const r=this;this.timerId=setTimeout(async function s(){await r.schedule.runAction(),r.timerId=setTimeout(()=>{s()},e)},e)}clearInterval(){this.timerId&&clearInterval(this.timerId)}}const Ve="150px",$e=2,pr={path:"id",key:"id",title:"عملیات",colspan:$e,width:Ve,cellType:ge.ACTION,align:me.Center,headerType:pe.Text,accessLevel:null},dt={width:Ve,align:me.Center,headerType:pe.Text,cellType:ge.Text,colspan:$e};class we{constructor(e,r){this.key=e,this.order=r}}class Fe{aSort(e,r){return e.sort((s,n)=>{const i=s[r]??s,a=n[r]??n;if(typeof i=="string"&&typeof a=="string")return i.localeCompare(a);if(typeof i=="number"&&typeof a=="number")return i-a;throw new Error("Not supported data type")})}bSort(e,r){return e.sort((s,n)=>{const i=s[r]??s,a=n[r]??n;if(typeof i=="string"&&typeof a=="string")return a.localeCompare(i);if(typeof i=="number"&&typeof a=="number")return a-i;throw new Error("Not supported data type")})}}class gr{arrayOfObjectSort(e,r,s,n=new Fe){return s===O.ASC?n.aSort(e,r):n.bSort(e,r)}arraySort(e,r,s=new Fe){return r===O.ASC?s.aSort(e):s.bSort(e)}}class ft{constructor(e){this.currentPage=1,this.currentPageSize=20,this.currentSortDetail=new we("id",O.DESC),this.loadedRows=[],this.headerSchema=[],this.service=e,this.accessService=W.GetInstance()}addHeader(e){this.headerSchema.push(e)}async load(){this.headerSchema=this.filterItemsBaseOnAccessLevel(await this.loadHeader()),await this.loadRows()}filterItemsBaseOnAccessLevel(e){return e.filter(r=>r.hasAccess?r.hasAccess():!0)}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail=e,this.loadedRows=(await this.handleSort(this.currentSortDetail)).items)}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.key||e.order!==this.currentSortDetail.order}async paginate(e,r){this.shouldSendPaginationRequest(e,r)&&(this.currentPage=e,this.currentPageSize=r,this.loadedRows=(await this.handlePagination(this.currentPage,this.currentPageSize)).items)}shouldSendPaginationRequest(e,r){return this.currentPage!==e||this.currentPageSize!==r}async loadRows(){return this.loadedRows=(await this.service.fetchRows()).items,this.loadedRows}getData(){return this.service.getData()}async handleSort(e){return await this.service.sort(e)}async handlePagination(e,r){return await this.service.paginate(e,r)}getItemCountPerPage(){return Le.DEFAULT_ITEM_COUNT_PER_PAGE}isLoading(){const e=this.getLoadingStatuses();return e.has(y.Search)||e.has(y.FetchList)||e.has(y.Sort)||e.has(y.FetchLastItems)||e.has(y.FetchPreviousItems)}getLoadingStatuses(){return this.getData().loadingStatus}hasAnyAction(){for(const e of this.loadedRows)if(this.getAccessedActions(e).length)return!0;return!1}getAccessedActions(e){return this.filterItemsBaseOnAccessLevel(this.getActions(e))}getActions(e){return[]}getScrollDetail(){return null}isExpandable(){return!1}async handleClick(e){}async handleMetaClick(e){}async handleDoubleClick(e){}async onDestroy(){}async loadHeader(){throw new Error("No header provided for the table.")}loadSummarySchema(){return{summaryTitle:"",summaryItems:[]}}}class T{constructor(e){this.observers=[],this.next(e)}attach(e){this.observers.push(e)}detach(e){this.observers=this.observers.filter(r=>r!==e)}notify(){for(const e of this.observers)typeof e=="function"?e(this._value):e.update(this._value)}next(e){typeof e=="function"?this._value=e(this._value):this._value=e,this.notify()}getValue(){return this._value}}class yr extends ft{constructor(e){super(e),this.selectedRows=new T(new Map),this.rowSelect=this.rowSelect.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.handlePagination=this.handlePagination.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRows=this.getSelectedRows.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}rowSelect(e){this.getSelectedRowsValue().has(e.id)?(this.getSelectedRowsValue().delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.loadedRows)this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRowsValue().size===this.currentPageSize||this.loadedRows.length===this.getSelectedRowsValue().size}async handlePagination(e,r){return this.clearAllSelectedItems(),await super.handlePagination(e,r)}async handleSort(e){return this.clearAllSelectedItems(),await super.handleSort(e)}clearAllSelectedItems(){this.selectedRows.getValue().clear(),this.selectedRows.next(this.selectedRows.getValue())}getSelectedRows(){return this.selectedRows}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}getSelectedRowsValue(){return this.selectedRows.getValue()}}function Sr(t){return{...dt,...t}}function wr(t){return function(r,s){r.constructor.prototype.headers||(r.constructor.prototype.headers=[]),r.constructor.prototype.headers.push({path:s,...t})}}function Ir(t){return function(r){async function s(){return r.prototype._table=this,r.prototype.headers}function n(u){const l=[],c=r.prototype.actions||[];for(const v of c){if(!v.isAvailable(u))continue;const f={handler:v.handler.bind(u),accessLevel:v.accessLevel,actionName:v.actionName};l.push(f)}return l}async function i(u){r.prototype.rowClick&&await r.prototype.rowClick.call(u)}async function a(){r.prototype.tableDestroy&&await r.prototype.tableDestroy()}t.prototype.loadHeader=s,t.prototype.getActions=n,t.prototype.handleClick=i,t.prototype.onDestroy=a}}function br(t){return function(r,s,n){r.constructor.prototype.actions||(r.constructor.prototype.actions=[]),t.handler=n.value,r.constructor.prototype.actions.push(t)}}function Ar(){return function(e,r,s){e.constructor.prototype.tableDestroy=s.value}}function Dr(){return function(e,r,s){e.constructor.prototype.rowClick=s.value}}class Rr{constructor(){this.observers=[]}attach(e){this.observers.push(e)}detach(e){this.observers=this.observers.filter(r=>r!==e)}notify(){for(const e of this.observers)e.update(this)}}class vt{constructor(e){this.rows=new T([]),this.headerSchema=new T([]),this.currentPage=new T(1),this.currentPageSize=new T(20),this.totalItems=new T(0),this.currentSortDetail=new T(new we("id",O.DESC)),this.scrollDetail=new T(null),this.isExpandable=new T(!1),this.tableSource=e,this.accessService=W.GetInstance()}async load(){this.rows.next(await this.tableSource.loadRows()),this.headerSchema.next(this.filterItemsBaseOnAccessLevel(await this.tableSource.loadHeaderSchema()))}async paginate(e,r){this.shouldSendPaginationRequest(e,r)&&(this.currentPage.next(e),this.currentPageSize.next(r),this.rows.next(await this.tableSource.paginate(e,r)))}shouldSendPaginationRequest(e,r){return this.currentPage.getValue()!==e||this.currentPageSize.getValue()!==r}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail.next(e),this.rows.next(await this.tableSource.sort(e)))}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.getValue().key||e.order!==this.currentSortDetail.getValue().order}async handleClick(e){this.tableSource.onRowClick&&await this.tableSource.onRowClick()}async handleMetaClick(e){this.tableSource.onRowMetaClick&&await this.tableSource.onRowMetaClick}async handleDoubleClick(e){this.tableSource.onRowDoubleClick&&await this.tableSource.onRowDoubleClick()}hasAnyAction(){for(const e of this.rows.getValue())if(this.getRowActions(e).length)return!0;return!1}getRowActions(e){return this.filterItemsBaseOnAccessLevel(this.tableSource.loadRowActions(e))}loadSummarySchema(){return this.tableSource.loadSummarySchema?this.tableSource.loadSummarySchema():{summaryTitle:"",summaryItems:[]}}filterItemsBaseOnAccessLevel(e){return e.filter(r=>r.hasAccess?r.hasAccess():!0)}async onDestroy(){this.tableSource.onTableDestroy()}}class _r extends vt{constructor(e){super(e),this.selectedRows=new T(new Map),this.selectRow=this.selectRow.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}selectRow(e){const r=this.getSelectedRows();r.has(e.id)?(r.delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(r.set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.rows.getValue())this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRows().size===this.currentPageSize.getValue()||this.rows.getValue().length===this.getSelectedRows().size}clearAllSelectedItems(){this.getSelectedRows().clear(),this.selectedRows.next(this.selectedRows.getValue)}getSelectedRows(){return this.selectedRows.getValue()}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}}var Ne;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(Ne||(Ne={}));const D=Ne;/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -9,8 +9,9 @@ import { TableAction } from '../TableAction';
|
|
|
9
9
|
export declare class TableGenerator<T> {
|
|
10
10
|
rows: BehaviorSubject<T[]>;
|
|
11
11
|
headerSchema: BehaviorSubject<TableHeaderSchema<T>[]>;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
currentPage: BehaviorSubject<number>;
|
|
13
|
+
currentPageSize: BehaviorSubject<number>;
|
|
14
|
+
totalItems: BehaviorSubject<number>;
|
|
14
15
|
protected currentSortDetail: BehaviorSubject<SortDetail<T>>;
|
|
15
16
|
scrollDetail: BehaviorSubject<Nullable<boolean | {
|
|
16
17
|
x?: number;
|