@feedmepos/mf-connect 0.1.97-prod → 0.1.98-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/{App-DHAyGCKP.js → App-BWBeJksP.js} +118 -106
  2. package/dist/AuditLogs-CWVUX5o0.js +2013 -0
  3. package/dist/{Bin-BxyU2xtK.js → Bin-jXmZpGfg.js} +8 -8
  4. package/dist/{Broadcast-BJjehb02.js → Broadcast-C76pTADb.js} +18 -17
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCxP8rEW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-9kfq8OXE.js} +5 -6
  6. package/dist/{Card-BYDuADCn.js → Card-qXn83BYu.js} +19 -19
  7. package/dist/{Collections-BlPEkNm8.js → Collections-DGXUQSbz.js} +197 -185
  8. package/dist/{Credit-D9Eqxv2E.js → Credit-CpmrPZx9.js} +18 -17
  9. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DAnw5TFZ.js +3377 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hpNgkLOt.js → EffectSheet.vue_vue_type_style_index_0_lang-BCAotF0P.js} +6 -6
  12. package/dist/{Experience-DGumSpYK.js → Experience-CuOq7hd3.js} +35 -34
  13. package/dist/{FileSaver.min-D_TpPHp3.js → FileSaver.min-Cjv6SzrG.js} +1 -1
  14. package/dist/{Game-DDsYLdKu.js → Game-D0KfLD-b.js} +16 -15
  15. package/dist/Grab-L1h7bHD7.js +300 -0
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-R00i7YNe.js → ImageInput.vue_vue_type_script_setup_true_lang-DMAaHxzm.js} +1 -1
  17. package/dist/{Index-DwRbFOsj.js → Index-DxwMHEV3.js} +10 -10
  18. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-i9-B25xO.js +48 -0
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-D_HOJBzW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D84v7zC_.js} +1 -1
  20. package/dist/LoyaltyDashboard-B5wg1EUC.js +1082 -0
  21. package/dist/{MainLayout-BEUAguIP.js → MainLayout-Cgi3Z3EM.js} +1 -1
  22. package/dist/{Marketing-WdhEZvmz.js → Marketing-Cl5OSBI1.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-DUIkUA79.js → MarketingMaterialEdit-CzYTbdJd.js} +214 -211
  24. package/dist/{Member-jL3RMGsZ.js → Member-D29x5Cic.js} +20 -20
  25. package/dist/{MemberList-B1bdPK63.js → MemberList-DDPe6Ymr.js} +50 -51
  26. package/dist/{MemberTransactions-BNKJ0wtr.js → MemberTransactions-3mboVWAx.js} +1 -1
  27. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cvsz00_4.js → MessageInput.vue_vue_type_script_setup_true_lang-C2HlA9O8.js} +11 -11
  28. package/dist/{Mission-CoXzS7U6.js → Mission-CMPc4NLe.js} +35 -34
  29. package/dist/{Overview-B16wZUSV.js → Overview-sJ2kuP4U.js} +19 -19
  30. package/dist/{Point-CORBv0y2.js → Point-BBP4UEhf.js} +30 -29
  31. package/dist/{Promotion-DQ4WnFkH.js → Promotion-Bt0RLGsd.js} +111 -105
  32. package/dist/{Queue-BW97QEY2.js → Queue-CzVsoIDM.js} +43 -43
  33. package/dist/{Record-DZOhwf13.js → Record-CAoGgaxo.js} +10 -10
  34. package/dist/Review-CVBJlwGK.js +959 -0
  35. package/dist/ReviewFacebookCallback-RGWdxXYf.js +243 -0
  36. package/dist/ReviewGoogleCallback-L7_Jjbkx.js +208 -0
  37. package/dist/{Reward-Bi9mpuyH.js → Reward-CrpFlr0a.js} +17 -17
  38. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dtosx1wE.js → RewardGroup.vue_vue_type_script_setup_true_lang-DW-WFNI6.js} +12 -12
  39. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DlcsO8fk.js +1911 -0
  40. package/dist/{Segment-COhS8SPv.js → Segment-Cy-QwYQQ.js} +77 -78
  41. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-By_BQodK.js → SelectItems.vue_vue_type_script_setup_true_lang-ovvxxcrQ.js} +3 -3
  42. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BoEnwoYd.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D69bJtyd.js} +12 -12
  43. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DonadRJT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DQyoPZ_6.js} +4 -4
  44. package/dist/{Setting-BNtYrzdN.js → Setting-DEQIJ4fY.js} +259 -248
  45. package/dist/{SettingAdvertisements-Cne8GikV.js → SettingAdvertisements-NuwjCPLN.js} +13 -13
  46. package/dist/{Store-iTgtmUVL.js → Store-Cw2J_ecA.js} +24 -24
  47. package/dist/{StoreRewards-DLawXBsl.js → StoreRewards-BK5rDAaK.js} +16 -16
  48. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B3jwaYHX.js +1130 -0
  49. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D_OdWctk.js +7007 -0
  50. package/dist/{Tier-BbZMbFSd.js → Tier-CwZ40RYc.js} +544 -469
  51. package/dist/{Title-Co5XWIJm.js → Title-DU7KmsK2.js} +93 -92
  52. package/dist/{Transaction-CoUbt5rr.js → Transaction-Uh5Ozt93.js} +2 -2
  53. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzJpNT94.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BtnUNkcS.js} +6 -6
  54. package/dist/{Voucher-CXojttH0.js → Voucher-BF6ARaRe.js} +28 -27
  55. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bxkds9_4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C7msPJdi.js} +12 -12
  56. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CHVqFzLm.js → ZodTextField.vue_vue_type_script_setup_true_lang-BrR2WA1K.js} +2 -2
  57. package/dist/{app-_LtKE4PZ.js → app-DlECkPwT.js} +3408 -2913
  58. package/dist/app.js +4 -3
  59. package/dist/{business-CchrWCX9.js → business-BSe9C-xG.js} +1 -1
  60. package/dist/{campaign-N2x2N6OP.js → campaign-BNS2RxKc.js} +114 -64
  61. package/dist/{campaign-D2RzC0L1.js → campaign-CXw3jpdr.js} +13 -7
  62. package/dist/{campaign.enum-DqJsu1At.js → campaign.enum-CnMa2Tia.js} +3 -2
  63. package/dist/{campaign.fn-Da4r_dvc.js → campaign.fn-CNOinW8t.js} +131 -131
  64. package/dist/{collectible.enum-CHheiKkA.js → collectible.enum-BIvEz79q.js} +1 -1
  65. package/dist/duplicateCampaign-Co2TdbrL.js +51 -0
  66. package/dist/{effect-DADvE7lZ.js → effect-Bt8PE3-M.js} +1 -1
  67. package/dist/{email-addresses-DzUHQuVs.js → email-addresses-Dh95ALqP.js} +2 -2
  68. package/dist/{export-uzECYleM.js → export-DIIgAwP7.js} +3 -3
  69. package/dist/{helper-DMsYRFIM.js → helper-8zEdQ9jm.js} +1 -1
  70. package/dist/{index-CEVpWmjC.js → index-0BNEvaYc.js} +7 -7
  71. package/dist/{index-r8TuEpzi.js → index-BAlFstx4.js} +1 -1
  72. package/dist/{index-C2h4SP0A.js → index-BP5qSDQw.js} +806 -205
  73. package/dist/{index-KYtKBtvK.js → index-Bqxe3Gbq.js} +3 -3
  74. package/dist/{index-CrPHsZg1.js → index-CWypTyOP.js} +1554 -1270
  75. package/dist/{index-DXl_Qtu-.js → index-CfxDirFl.js} +1 -1
  76. package/dist/{index-Bc-pgOn6.js → index-DDp0nMys.js} +1 -1
  77. package/dist/index-DW4-mTTG.js +52 -0
  78. package/dist/{timezone-B_KZGqyd.js → index-DdCPfF8x.js} +21 -20
  79. package/dist/index-IPOrNVQw.js +67 -0
  80. package/dist/{index-XJX8_Wlh.js → index-SsUBL4IR.js} +1 -1
  81. package/dist/{index-Ct1Qf7kH.js → index-VS1hWlhk.js} +1 -1
  82. package/dist/{index-B9RmImNP.js → index-ZKJoXi1-.js} +3 -3
  83. package/dist/{index-DQ6H1MEw.js → index-rwlkBKrS.js} +1996 -1968
  84. package/dist/{index.esm2017-D9jjiQqn.js → index.esm2017-CgR02aQB.js} +209 -209
  85. package/dist/{loading-DK8UdxtS.js → loading-CxY9qhzD.js} +1 -1
  86. package/dist/{lodash-CgcQgDO8.js → lodash-CELsN1M_.js} +1 -1
  87. package/dist/{membership-Cs4GzRnn.js → membership-BoQMuerb.js} +3 -3
  88. package/dist/{money-TgbWserQ.js → money-CH913hGN.js} +1 -1
  89. package/dist/{number-fLCh4B45.js → number-CO-WbLdr.js} +1 -1
  90. package/dist/object-BYyQ0PZp.js +18 -0
  91. package/dist/objectid-BM2Ygj-U.js +145 -0
  92. package/dist/{plugins-DYcrIMpx.js → plugins-YK45gSb1.js} +94 -95
  93. package/dist/{reward-uQ8Oz8Fd.js → reward-3aFPahH6.js} +1 -1
  94. package/dist/{rule-BcbgF0xS.js → rule-DC9my0Vg.js} +505 -487
  95. package/dist/style.css +1 -1
  96. package/dist/template-tDq12e1p.js +188 -0
  97. package/dist/{trigger-c-_77EFL.js → trigger-DoPHRgKt.js} +5 -5
  98. package/dist/{useMarketingMaterialActions-BCqwGe4e.js → useMarketingMaterialActions-CEd6ODsz.js} +3 -3
  99. package/dist/{usePagination-C3cT5BmC.js → usePagination-C8FUj5q_.js} +1 -1
  100. package/dist/{user-CRIo5MyA.js → user-Dhlhrnf8.js} +1 -1
  101. package/dist/{vue-i18n-BU_SuDqj.js → vue-i18n-B-92uhPn.js} +175 -175
  102. package/dist/{xlsx-Bw1AshOG.js → xlsx-Dmxne1eM.js} +166 -166
  103. package/dist/{zod-CzlTW8Al.js → zod-Dcdy9Dm3.js} +1 -1
  104. package/package.json +8 -4
  105. package/dist/Analytic-Ccb5IKBy.js +0 -426
  106. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bf8Rc-Eh.js +0 -2223
  107. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CrvTdEPu.js +0 -1888
  108. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cl8JEYjx.js +0 -1118
  109. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DEEz7iEu.js +0 -142
  110. package/dist/collection.fn-BqDPyvUe.js +0 -26
  111. package/dist/dto-CstKk_3g.js +0 -216
  112. package/dist/index-_KlH62Ed.js +0 -55
  113. package/dist/object-qECH92oz.js +0 -26
  114. package/dist/objectid-CVxLIQ5K.js +0 -145
  115. package/dist/rule-builder-CIkRKgap.js +0 -102
  116. package/dist/template-wZEVj8lZ.js +0 -236
@@ -1,142 +0,0 @@
1
- import { defineComponent as N, ref as U, computed as w, watch as M, resolveComponent as v, openBlock as a, createElementBlock as i, Fragment as p, toDisplayString as F, createCommentVNode as T, createElementVNode as j, createVNode as h, unref as n, renderList as S, createBlock as k, isRef as $, withCtx as C } from "vue";
2
- import { u as q } from "./business-CchrWCX9.js";
3
- import { u as D } from "./vue-i18n-BU_SuDqj.js";
4
- function K(l, s, o) {
5
- return l.some(
6
- o instanceof Function ? o : (u) => u === s
7
- ) || l.push(s), l;
8
- }
9
- function O(l, s, o) {
10
- return l.filter(
11
- o instanceof Function ? (u) => !o(u) : (u) => u !== s
12
- );
13
- }
14
- const R = {
15
- key: 0,
16
- class: "fm-typo-en-body-lg-400"
17
- }, z = {
18
- key: 1,
19
- class: "space-y-4"
20
- }, A = { key: 0 }, G = { key: 1 }, H = { key: 2 }, W = /* @__PURE__ */ N({
21
- __name: "TargetLocationInput",
22
- props: {
23
- label: {
24
- type: String
25
- },
26
- type: {
27
- type: String,
28
- default: "select"
29
- },
30
- modelValue: {
31
- type: Object,
32
- required: !0
33
- }
34
- },
35
- emits: ["update:model-value"],
36
- setup(l, { emit: s }) {
37
- const o = q(), { t: u } = D(), c = l, r = U(""), B = w(() => o.locations.filter(
38
- (d) => {
39
- var t;
40
- return d.name.toLowerCase().includes(r.value.toLowerCase()) || ((t = d == null ? void 0 : d.code) == null ? void 0 : t.toLowerCase().includes(r.value.toLowerCase()));
41
- }
42
- )), b = s;
43
- function L(d, t) {
44
- const m = d ? K(c.modelValue || [], t.toString()) : O(
45
- c.modelValue || o.locations.map((g) => g._id.toString()),
46
- t.toString()
47
- );
48
- return b("update:model-value", m);
49
- }
50
- const V = U(!1), I = w(() => {
51
- var m, g;
52
- const t = ((m = c.modelValue) == null ? void 0 : m.slice(0, 5).map((f) => {
53
- var y;
54
- return ((y = o.locationById(f)) == null ? void 0 : y.name) || f;
55
- })) || [];
56
- return c.modelValue && ((g = c.modelValue) == null ? void 0 : g.length) > 5 && t.push(`+${c.modelValue.length - 5} more`), t;
57
- });
58
- return M(V, (d) => {
59
- d && (r.value = "");
60
- }), (d, t) => {
61
- const m = v("FmCheckbox"), g = v("FmChip"), f = v("FmField"), y = v("FmTextField"), E = v("FmMenu");
62
- return a(), i(p, null, [
63
- l.label ? (a(), i("div", R, F(l.label), 1)) : T("", !0),
64
- l.type === "checkbox" ? (a(), i("div", z, [
65
- j("div", null, [
66
- h(m, {
67
- value: null,
68
- indeterminate: l.modelValue != null && l.modelValue.length > 0 && l.modelValue.length < n(o).locations.length,
69
- label: n(u)("connect.setting.location.allLocations"),
70
- "model-value": l.modelValue == null || l.modelValue.length === n(o).locations.length,
71
- "onUpdate:modelValue": t[0] || (t[0] = (e) => b("update:model-value", e ? null : []))
72
- }, null, 8, ["indeterminate", "label", "model-value"])
73
- ]),
74
- (a(!0), i(p, null, S(n(o).locations, (e) => (a(), i("div", {
75
- key: e._id.toString()
76
- }, [
77
- h(m, {
78
- value: e._id.toString(),
79
- label: `${e.code ? `${e.code} - ` : ""} ${e.name}`,
80
- "model-value": !l.modelValue || l.modelValue.includes(e._id.toString()),
81
- "onUpdate:modelValue": (x) => L(x, e._id.toString())
82
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"])
83
- ]))), 128))
84
- ])) : (a(), k(E, {
85
- key: 2,
86
- modelValue: n(V),
87
- "onUpdate:modelValue": t[3] || (t[3] = (e) => $(V) ? V.value = e : null),
88
- onMenuChanged: t[4] || (t[4] = (e) => V.value = e),
89
- placement: "top-end"
90
- }, {
91
- "menu-button": C(() => [
92
- h(f, {
93
- "append-icon": n(V) ? "expand_more" : "expand_less",
94
- class: "!h-auto"
95
- }, {
96
- default: C(() => [
97
- !l.modelValue || l.modelValue.length == n(o).locations.length ? (a(), i("div", A, F(n(u)("connect.setting.location.allLocations")), 1)) : l.modelValue.length ? (a(), i("div", H, [
98
- (a(!0), i(p, null, S(n(I), (e) => (a(), k(g, {
99
- key: e,
100
- label: e,
101
- class: "max-w-[130px] text-ellipsis"
102
- }, null, 8, ["label"]))), 128))
103
- ])) : (a(), i("div", G, F(n(u)("connect.setting.location.noLocations")), 1))
104
- ]),
105
- _: 1
106
- }, 8, ["append-icon"])
107
- ]),
108
- default: C(() => [
109
- h(y, {
110
- modelValue: n(r),
111
- "onUpdate:modelValue": t[1] || (t[1] = (e) => $(r) ? r.value = e : null),
112
- placeholder: n(u)("connect.setting.location.searchLocations"),
113
- class: "my-8"
114
- }, null, 8, ["modelValue", "placeholder"]),
115
- h(m, {
116
- class: "my-8",
117
- value: null,
118
- indeterminate: l.modelValue != null && l.modelValue.length > 0 && l.modelValue.length < n(o).locations.length,
119
- label: n(u)("connect.setting.location.allLocations"),
120
- "model-value": l.modelValue == null || l.modelValue.length === n(o).locations.length,
121
- "onUpdate:modelValue": t[2] || (t[2] = (e) => b("update:model-value", e ? null : []))
122
- }, null, 8, ["indeterminate", "label", "model-value"]),
123
- (a(!0), i(p, null, S(n(B), (e) => (a(), k(m, {
124
- class: "my-8",
125
- key: e._id.toString(),
126
- value: e._id.toString(),
127
- label: `${e.code ? `${e.code} - ` : ""} ${e.name}`,
128
- "model-value": !l.modelValue || l.modelValue.includes(e._id.toString()),
129
- "onUpdate:modelValue": (x) => L(x, e._id.toString())
130
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
131
- ]),
132
- _: 1
133
- }, 8, ["modelValue"]))
134
- ], 64);
135
- };
136
- }
137
- });
138
- export {
139
- W as _,
140
- K as p,
141
- O as r
142
- };
@@ -1,26 +0,0 @@
1
- import "./index-DQ6H1MEw.js";
2
- import "./index-KYtKBtvK.js";
3
- function r(e) {
4
- switch (e) {
5
- case "PROMOTION":
6
- return "Promotion";
7
- case "VOUCHER":
8
- return "Voucher";
9
- case "CREDIT":
10
- return "Credit";
11
- case "POINT":
12
- return "Experience";
13
- case "COIN":
14
- return "Point";
15
- case "GAME":
16
- return "Game";
17
- default:
18
- return e;
19
- }
20
- }
21
- const o = {
22
- formattedType: r
23
- };
24
- export {
25
- o as C
26
- };
@@ -1,216 +0,0 @@
1
- import { F as o, z as t } from "./index-KYtKBtvK.js";
2
- import { u as h, a as r, v as _ } from "./index-CrPHsZg1.js";
3
- import { F as u } from "./index-DQ6H1MEw.js";
4
- import { i as I, R as d } from "./rule-builder-CIkRKgap.js";
5
- function N(n, e) {
6
- var p, l;
7
- if (!n) return;
8
- const a = n.campaign;
9
- if (!a) return;
10
- const i = a.event.rule;
11
- if (!i || !I(i)) {
12
- e.addIssue({
13
- code: "custom",
14
- path: ["campaign", "event", "rule"],
15
- params: {
16
- i18n: "connectZodCustom:campaign.rule_required",
17
- type: a.event.type
18
- }
19
- });
20
- return;
21
- }
22
- switch (a.type) {
23
- case "MISSION": {
24
- a.earningOption.amount > a.mission.end && e.addIssue({
25
- code: "custom",
26
- path: ["campaign", "earningOption"],
27
- params: {
28
- i18n: "connectZodCustom:campaign.earning_amount_exceed",
29
- max: a.mission.end
30
- }
31
- });
32
- break;
33
- }
34
- case "CREDIT": {
35
- const c = (p = a.config) == null ? void 0 : p.validityOption;
36
- (!c || ["validForDay", "validBefore"].every((g) => c[g] == null)) && e.addIssue({
37
- code: "custom",
38
- path: ["campaign", "config", "validityOption"],
39
- params: {
40
- i18n: "connectZodCustom:campaign.credit_validity_required"
41
- }
42
- });
43
- }
44
- }
45
- switch (a.event.type) {
46
- case "BILL_COMPLETED":
47
- a.type === "MISSION" && a.rewards.length && (a.rewards.forEach((c, m) => {
48
- (c.threshold < 0 || c.threshold > a.mission.end) && e.addIssue({
49
- code: "custom",
50
- path: ["campaign", "rewards", m, "threshold"],
51
- params: {
52
- i18n: "connectZodCustom:campaign.reward_threshold_range"
53
- }
54
- });
55
- }), (l = a.config) != null && l.validityOption.followFirstReceive || e.addIssue({
56
- code: "custom",
57
- path: ["campaign", "config", "validityOption"],
58
- params: {
59
- i18n: "connectZodCustom:campaign.mission_first_receive"
60
- }
61
- }));
62
- break;
63
- case "SCHEDULE": {
64
- if (!i.rules.g_schedule) {
65
- e.addIssue({
66
- code: "custom",
67
- path: ["campaign", "event", "rule"],
68
- params: {
69
- i18n: "connectZodCustom:campaign.schedule_period_required"
70
- },
71
- fatal: !0
72
- });
73
- return;
74
- }
75
- const c = d.getRules(
76
- i.rules.g_schedule
77
- ), m = [
78
- {
79
- property: "trigger.date",
80
- operator: ["_isOnDate", "_rrule"]
81
- },
82
- {
83
- property: "trigger.time",
84
- operator: ["_isOnTime"]
85
- }
86
- ];
87
- m.length == c.length && m.every((O) => c.some((C) => {
88
- const f = d.simplify(C);
89
- return f.property === O.property && O.operator.includes(f.operator);
90
- })) || e.addIssue({
91
- code: "custom",
92
- path: ["campaign", "event", "rule"],
93
- params: {
94
- i18n: "connectZodCustom:campaign.active_period_invalid"
95
- }
96
- });
97
- break;
98
- }
99
- default: {
100
- "earningOption" in a && a.earningOption.type != "FIXED" && e.addIssue({
101
- code: "custom",
102
- path: ["campaign", "earningOption"],
103
- params: {
104
- i18n: "connectZodCustom:campaign.fixed_earning_required"
105
- }
106
- });
107
- break;
108
- }
109
- }
110
- }
111
- function D(n) {
112
- var a;
113
- if (n.campaign.type === "VOUCHER" && "configs" in n) {
114
- const i = n.configs;
115
- i.extras.targetLocation = n.campaign.targetLocation;
116
- const p = Math.max(
117
- n.campaign.earningOption.amount,
118
- i.options.maxUse ?? 1
119
- );
120
- n.campaign.earningOption.amount = p, i.options.maxUse = p, n.campaign.earningOption = {
121
- type: "FIXED",
122
- amount: 1
123
- };
124
- }
125
- if (n.campaign.type == "MISSION" && "configs" in n) {
126
- const i = n.configs;
127
- i.options.validityOption = (a = n.campaign.config) == null ? void 0 : a.validityOption;
128
- }
129
- const e = n.campaign.event;
130
- return e.type != "BILL_COMPLETED" && e.rule && I(e.rule) && (e.rule = d.removeEntry(e.rule, "g_bill"), n.campaign.event = e), n;
131
- }
132
- function s(n) {
133
- const e = _.optionsMap.get(n).extend({
134
- _id: o.optional(),
135
- collectible: t.string().nullish()
136
- });
137
- switch (n) {
138
- case "VOUCHER":
139
- return t.object({
140
- campaign: e,
141
- templateId: o,
142
- configs: u,
143
- updateCollections: t.boolean().optional(),
144
- code: t.string().optional()
145
- });
146
- case "PROMOTION":
147
- return t.object({
148
- campaign: e,
149
- templateId: o
150
- });
151
- case "POINT":
152
- return t.object({
153
- campaign: e,
154
- templateId: o
155
- });
156
- case "CREDIT":
157
- return t.object({
158
- campaign: e,
159
- templateId: o
160
- });
161
- case "BROADCAST":
162
- return t.object({
163
- campaign: e,
164
- templateId: o
165
- });
166
- case "COIN":
167
- return t.object({
168
- campaign: e,
169
- templateId: o
170
- });
171
- case "REWARD_POOL":
172
- return t.object({
173
- campaign: e,
174
- templateId: o,
175
- updateCollections: t.boolean().optional()
176
- });
177
- case "GAME":
178
- return t.object({
179
- campaign: e,
180
- configs: u,
181
- templateId: o,
182
- updateCollections: t.boolean().optional()
183
- });
184
- case "MISSION":
185
- return t.object({
186
- campaign: e,
187
- configs: u,
188
- templateId: o,
189
- updateCollections: t.boolean().optional()
190
- });
191
- default:
192
- throw new Error("Not implemented");
193
- }
194
- }
195
- const T = h.extend({
196
- _id: o.optional(),
197
- name: t.string().min(1).max(300),
198
- business: o.optional(),
199
- campaigns: t.array(o).optional()
200
- }), A = {
201
- [r.enum.VOUCHER]: s("VOUCHER"),
202
- [r.enum.PROMOTION]: s("PROMOTION"),
203
- [r.enum.POINT]: s("POINT"),
204
- [r.enum.CREDIT]: s("CREDIT"),
205
- [r.enum.BROADCAST]: s("BROADCAST"),
206
- [r.enum.COIN]: s("COIN"),
207
- [r.enum.REWARD_POOL]: s("REWARD_POOL"),
208
- [r.enum.GAME]: s("GAME"),
209
- [r.enum.MISSION]: s("MISSION")
210
- };
211
- export {
212
- A as C,
213
- T as F,
214
- D as a,
215
- N as c
216
- };
@@ -1,55 +0,0 @@
1
- import { g as t, a as n, S as o, b as c } from "./index-CEVpWmjC.js";
2
- const a = () => {
3
- const e = o.getBusinessId();
4
- if (!e) throw new Error("Invalid business ID");
5
- return c(`businesses/${e}/transactions`, {
6
- noIdRequired: !0
7
- });
8
- }, p = {
9
- async readAll(e, r) {
10
- const s = t(
11
- await a().get("", {
12
- params: { ...e, ...r }
13
- })
14
- );
15
- return {
16
- meta: s.meta,
17
- resources: s.resources
18
- };
19
- },
20
- async readAllCursor(e, r) {
21
- const s = t(
22
- await a().get("cursor", {
23
- params: { ...e, ...r }
24
- })
25
- );
26
- return {
27
- meta: s.meta,
28
- resources: s.resources
29
- };
30
- },
31
- async readStoreTransactions(e, r) {
32
- const s = t(
33
- await a().get("/store", {
34
- params: { ...e, ...r }
35
- })
36
- );
37
- return {
38
- meta: s.meta,
39
- resources: s.resources
40
- };
41
- },
42
- async readBills(e, r, s) {
43
- return (await n("").get(
44
- `/restaurants/${e}/receipt?start=${r}&end=${s}`
45
- )).data;
46
- },
47
- async readPurchaseCountByMember(e) {
48
- return t(
49
- await a().get(`/store/${e}`)
50
- );
51
- }
52
- };
53
- export {
54
- p as t
55
- };
@@ -1,26 +0,0 @@
1
- function f(r) {
2
- if (Array.isArray(r))
3
- return r.map((t) => f(t));
4
- if (typeof r == "object" && r !== null) {
5
- const t = {};
6
- for (const n in r)
7
- r.hasOwnProperty(n) && !n.startsWith("pf_") && (t[n] = f(r[n]));
8
- return t;
9
- }
10
- return r;
11
- }
12
- function i(r) {
13
- return JSON.parse(JSON.stringify(r));
14
- }
15
- function a(r, t, n) {
16
- const s = r.reduce((e, c) => {
17
- const u = t(c);
18
- return e[u] || (e[u] = []), e[u].push(c), e;
19
- }, {});
20
- return n ? Object.keys(s).reduce((e, c) => (e[c] = n(s[c]), e), {}) : s;
21
- }
22
- export {
23
- f as a,
24
- i as c,
25
- a as g
26
- };
@@ -1,145 +0,0 @@
1
- import { g as l } from "./app-_LtKE4PZ.js";
2
- var o = { env: { GITHUB_STATE: "/home/runner/work/_temp/_runner_file_commands/save_state_30e05157-e9ef-4114-b01c-41f58eda67b3", npm_package_dependencies_zod: "3.22.4", npm_package_devDependencies__types_node: "^18.19.41", DOTNET_NOLOGO: "1", npm_package_dependencies_pinia: "^2.1.7", npm_package_dependencies_vite_plugin_vue_devtools: "^7.6.4", npm_package_devDependencies_vitest: "^2.1.9", USER: "runner", npm_config_user_agent: "pnpm/9.15.9 npm/? node/v20.20.2 linux x64", CI: "true", npm_package_dependencies_vue: "^3.5.13", USE_BAZEL_FALLBACK_VERSION: "silent:", RUNNER_ENVIRONMENT: "github-hosted", GITHUB_ENV: "/home/runner/work/_temp/_runner_file_commands/set_env_30e05157-e9ef-4114-b01c-41f58eda67b3", PIPX_HOME: "/opt/pipx", npm_package_devDependencies_vite: "^5.3.4", npm_node_execpath: "/opt/hostedtoolcache/node/20.20.2/x64/bin/node", JAVA_HOME_8_X64: "/usr/lib/jvm/temurin-8-jdk-amd64", SHLVL: "1", HCA_CLOUD_PROVIDER: "azure", npm_package_files_0: "dist", HOME: "/home/runner", npm_package_dependencies_moment_timezone: "^0.6.0", RUNNER_TEMP: "/home/runner/work/_temp", GITHUB_EVENT_PATH: "/home/runner/work/_temp/_github_workflow/event.json", npm_package_scripts_build_mf_dev: "vite build --mode fmmf", npm_package_dependencies__types_qrcode: "^1.5.5", JAVA_HOME_11_X64: "/usr/lib/jvm/temurin-11-jdk-amd64", PIPX_BIN_DIR: "/opt/pipx_bin", GITHUB_REPOSITORY_OWNER: "feedmepos", npm_package_scripts_build_mf_prod: "vite build --mode fmmf:prod", npm_package_dependencies_change_case: "^5.4.4", NODE_OPTIONS: "--max-old-space-size=8096", GRADLE_HOME: "/usr/share/gradle-9.6.1", ANDROID_NDK_LATEST_HOME: "/usr/local/lib/android/sdk/ndk/29.0.14206865", JAVA_HOME_21_X64: "/usr/lib/jvm/temurin-21-jdk-amd64", GITHUB_RETENTION_DAYS: "90", npm_package_dependencies__feedmepos_mf_common: "1.29.23", npm_package_dependencies_fabric: "^6.4.2", npm_package_dependencies_zod_i18n_map: "2.27.0", GITHUB_REPOSITORY_OWNER_ID: "54831515", POWERSHELL_DISTRIBUTION_CHANNEL: "GitHub-Actions-Linux", AZURE_EXTENSION_DIR: "/opt/az/azcliextensions", GITHUB_HEAD_REF: "", npm_package_devDependencies__types_file_saver: "^2.0.7", SYSTEMD_EXEC_PID: "1868", ACTIONS_ORCHESTRATION_ID: "08e54b96-31c1-4b9b-a871-096b1b6f7ad2.deploy.__default", npm_package_dependencies__feedmepos_ui_library: "1.10.4", npm_package_dependencies_dayjs: "^1.11.12", npm_package_dependencies_dotenv: "^16.4.5", npm_package_dependencies_moment: "^2.30.1", GITHUB_GRAPHQL_URL: "https://api.github.com/graphql", npm_package_scripts_build_only_dev: "pnpm build:mf:dev", npm_package_dependencies__tailwindcss_typography: "^0.5.16", npm_package_dependencies_i18next: "24.2.1", npm_package_devDependencies_tailwindcss: "^3.4.6", npm_package_devDependencies_typescript: "^5.5.3", JAVA_HOME_25_X64: "/usr/lib/jvm/temurin-25-jdk-amd64", NVM_DIR: "/home/runner/.nvm", npm_package_scripts_build_dev: "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode development", npm_package_scripts_build_only_prod: "pnpm build:mf:prod", npm_package_dependencies_xlsx: "^0.18.5", npm_package_devDependencies_vue_tsc: "^2.0.26", DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1", JAVA_HOME_17_X64: "/usr/lib/jvm/temurin-17-jdk-amd64", ImageVersion: "20260628.225.1", npm_package_scripts_dev: "vite", npm_package_scripts_build_prod: "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode production", npm_package_dependencies_unplugin_auto_import: "^0.17.8", LOGNAME: "runner", RUNNER_OS: "Linux", GITHUB_API_URL: "https://api.github.com", STORE_PATH: "/home/runner/setup-pnpm/node_modules/.bin/store/v3", SWIFT_PATH: "/usr/share/swift/usr/bin", npm_package_type: "module", CHROMEWEBDRIVER: "/usr/local/share/chromedriver-linux64", JOURNAL_STREAM: "9:15260", GITHUB_WORKFLOW: "[CD:prod] connect-portal (mf-connect)", _: "/home/runner/setup-pnpm/node_modules/.bin/pnpm", npm_package_module: "./dist/app.js", npm_package_devDependencies_autoprefixer: "^10.4.19", MEMORY_PRESSURE_WATCH: "/sys/fs/cgroup/system.slice/hosted-compute-agent.service/memory.pressure", GOROOT_1_24_X64: "/opt/hostedtoolcache/go/1.24.13/x64", npm_package_devDependencies__types_uuid: "^9.0.8", npm_package_devDependencies_unlayer_types: "^1.157.0", npm_config_registry: "https://registry.npmjs.org/", ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: "/opt/actionarchivecache", GOROOT_1_25_X64: "/opt/hostedtoolcache/go/1.25.11/x64", GITHUB_RUN_ID: "28890641025", npm_package_dependencies_bson_objectid: "^2.0.4", npm_package_devDependencies__types_lodash: "^4.17.7", GITHUB_REF_TYPE: "tag", BOOTSTRAP_HASKELL_NONINTERACTIVE: "1", GITHUB_WORKFLOW_SHA: "3a4180bfac5d1079d6095cfad2d02f99ff80c267", GOROOT_1_26_X64: "/opt/hostedtoolcache/go/1.26.4/x64", GITHUB_BASE_REF: "", ImageOS: "ubuntu24", npm_package_exports___import: "./dist/app.js", npm_package_dependencies__ckeditor_ckeditor5_vue: "^7.3.0", npm_package_devDependencies__vitejs_plugin_vue: "^5.0.5", GITHUB_WORKFLOW_REF: "feedmepos/marketing-services/.github/workflows/[PROD] deploy-mf-connect.yml@refs/tags/mf-connect-0.1.97-prod", GITHUB_ACTION_REPOSITORY: "", ENABLE_RUNNER_TRACING: "true", npm_package_dependencies_axios: "^1.7.2", npm_config_node_gyp: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js", PATH: "/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/dist/node-gyp-bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/20.20.2/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", ANT_HOME: "/usr/share/ant", DOTNET_MULTILEVEL_LOOKUP: "0", RUNNER_TRACKING_ID: "github_29c079a4-200b-4d04-ab9c-fa63d5e3d08c", INVOCATION_ID: "8198eee44bb9411ea09ea6cf5e77df05", RUNNER_TOOL_CACHE: "/opt/hostedtoolcache", NODE: "/opt/hostedtoolcache/node/20.20.2/x64/bin/node", npm_package_name: "@feedmepos/mf-connect", npm_package_scripts_deploy_dev: "pnpm run build-only:dev && pnpm publish --no-git-checks .", npm_package_dependencies_cross_env: "^7.0.3", npm_package_dependencies_file_saver: "^2.0.5", GITHUB_ACTION: "__run_5", GITHUB_RUN_NUMBER: "81", GITHUB_TRIGGERING_ACTOR: "qaijunse", RUNNER_ARCH: "X64", XDG_RUNTIME_DIR: "/run/user/1001", AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache", npm_package_scripts_deploy_prod: "pnpm run build-only:prod && pnpm publish --no-git-checks .", npm_config_frozen_lockfile: "", LANG: "C.UTF-8", VCPKG_INSTALLATION_ROOT: "/usr/local/share/vcpkg", npm_package_dependencies__feedmepos_mf_core_ui: "1.0.25", CONDA: "/usr/share/miniconda", RUNNER_NAME: "GitHub Actions 1000085622", XDG_CONFIG_HOME: "/home/runner/.config", GITHUB_REF_NAME: "mf-connect-0.1.97-prod", GITHUB_REPOSITORY: "feedmepos/marketing-services", npm_package_scripts_build_dts: "vue-tsc --declaration --noEmit false --emitDeclarationOnly -p tsconfig.json --outDir ./dist && mv ./dist/src/* dist", npm_package_scripts_build_types: "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.json --outDir dist --composite false", npm_package_dependencies__feedmepos_core: "2.15.21", npm_lifecycle_script: "vite build --mode fmmf:prod", ANDROID_NDK_ROOT: "/usr/local/lib/android/sdk/ndk/27.3.13750724", GITHUB_ACTION_REF: "", DEBIAN_FRONTEND: "noninteractive", npm_package_scripts_test: "vitest run", npm_package_dependencies_rrule: "^2.8.1", npm_package_dependencies_vue3_lottie: "^3.3.0", SHELL: "/bin/bash", GITHUB_REPOSITORY_ID: "615151795", GITHUB_ACTIONS: "true", NODE_PATH: "/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules/vite/bin/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules/vite/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules", npm_package_version: "0.1.97-prod", npm_package_dependencies__feedmepos_hrm_permission: "1.0.14", npm_package_dependencies_ckeditor5: "^44.3.0", npm_lifecycle_event: "build:mf:prod", GITHUB_REF_PROTECTED: "false", npm_package_scripts_build: "vue-tsc && vite build", npm_package_dependencies_uuid: "^10.0.0", npm_package_dependencies_vue_i18n: "10.0.5", GITHUB_WORKSPACE: "/home/runner/work/marketing-services/marketing-services", ACCEPT_EULA: "Y", GITHUB_JOB: "deploy", npm_package_dependencies_lodash: "^4.17.21", GITHUB_SHA: "3a4180bfac5d1079d6095cfad2d02f99ff80c267", GITHUB_RUN_ATTEMPT: "1", npm_package_exports___style: "./dist/style.css", npm_package_dependencies__ckeditor_ckeditor5_build_classic: "^44.3.0", npm_package_dependencies_vue_router: "^4.4.0", ACTIONS_RUNNER_RETURN_JOB_RESULT_FOR_HOSTED: "1", GITHUB_REF: "refs/tags/mf-connect-0.1.97-prod", GITHUB_ACTOR: "qaijunse", ANDROID_SDK_ROOT: "/usr/local/lib/android/sdk", npm_package_license: "UNLICENSED", npm_package_dependencies_email_addresses: "^5.0.0", npm_package_scripts_test_watch: "vitest", npm_package_dependencies_firebase: "^10.12.4", npm_package_dependencies_qrcode: "^1.5.3", GITHUB_PATH: "/home/runner/work/_temp/_runner_file_commands/add_path_30e05157-e9ef-4114-b01c-41f58eda67b3", JAVA_HOME: "/usr/lib/jvm/temurin-17-jdk-amd64", PWD: "/home/runner/work/marketing-services/marketing-services/packages/connect", GITHUB_ACTOR_ID: "39590157", RUNNER_WORKSPACE: "/home/runner/work/marketing-services", npm_execpath: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.15.9/node_modules/pnpm/bin/pnpm.cjs", HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: "3650", GITHUB_EVENT_NAME: "push", HOMEBREW_NO_AUTO_UPDATE: "1", ANDROID_HOME: "/usr/local/lib/android/sdk", GITHUB_SERVER_URL: "https://github.com", GECKOWEBDRIVER: "/usr/local/share/gecko_driver", GHCUP_INSTALL_BASE_PREFIX: "/usr/local", GITHUB_OUTPUT: "/home/runner/work/_temp/_runner_file_commands/set_output_30e05157-e9ef-4114-b01c-41f58eda67b3", npm_package_exports___types: "./dist/packages/connect/src/app.d.ts", EDGEWEBDRIVER: "/usr/local/share/edge_driver", PNPM_SCRIPT_SRC_DIR: "/home/runner/work/marketing-services/marketing-services/packages/connect", npm_package_devDependencies_postcss: "^8.4.39", npm_command: "run-script", ANDROID_NDK: "/usr/local/lib/android/sdk/ndk/27.3.13750724", SGX_AESM_ADDR: "1", PSModulePath: "/root/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules:/usr/share/az_15.6.1", CHROME_BIN: "/usr/bin/google-chrome", npm_package_scripts_preview: "vite preview", SELENIUM_JAR_PATH: "/usr/share/java/selenium-server.jar", MEMORY_PRESSURE_WRITE: "c29tZSAyMDAwMDAgMjAwMDAwMAA=", PNPM_HOME: "/home/runner/setup-pnpm/node_modules/.bin", npm_package_dependencies__feedmepos_menu: "1.0.34", ANDROID_NDK_HOME: "/usr/local/lib/android/sdk/ndk/27.3.13750724", GITHUB_STEP_SUMMARY: "/home/runner/work/_temp/_runner_file_commands/step_summary_30e05157-e9ef-4114-b01c-41f58eda67b3", INIT_CWD: "/home/runner/work/marketing-services/marketing-services/packages/connect", npm_package_dependencies__feedmepos_mf_remy_panel: "0.15.0", NODE_ENV: "production", FEEDME_NAMESPACE: "prod", FIREBASE_API_KEY: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", FIREBASE_AUTH_DOMAIN: "feedme-253402.firebaseapp.com", FIREBASE_DATABASE_URL: "https://feedme-253402.firebaseio.com", FIREBASE_PROJECT_ID: "feedme-253402", FIREBASE_STORAGE_BUCKET: "image.feedme.cc", FIREBASE_MESSAGING_SENDER_ID: "128512026847", FIREBASE_APP_ID: "1:128512026847:web:7c5c8ab7e8b90502dc616a", FIREBASE_MEASUREMENT_ID: "G-LTKS7N2HQS", ASSET_STORAGE_BUCKET: "static.feedme.cc", IMPORT_FILES_STORAGE_BUCKET: "feedme-253402.appspot.com", AUTH_URL: "https://portal-v2.feedmeapi.com/", SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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", MEMBER_APP_URL: "member.feedme.cc", CRM_APP_URL: "crm.feedme.cc", MARKETING_V1_PORTAL: "https://marketing-v1.feedme.cc", CLIENT_ID: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476", PAYMENT_PORTAL_URL: "https://portal.feedme.cc/payment/payout-account", LICENSE_PORTAL_URL: "https://license.feedme.cc/", VOUCHER_APP_URL: "https://voucher.feedme.cc/" } }, i = Math.floor(Math.random() * 16777215), a = n.index = parseInt(Math.random() * 16777215, 10), c = (typeof o > "u" || typeof o.pid != "number" ? Math.floor(Math.random() * 1e5) : o.pid) % 65535, d = (() => {
3
- try {
4
- return _Buffer;
5
- } catch {
6
- try {
7
- return Buffer;
8
- } catch {
9
- return null;
10
- }
11
- }
12
- })(), r = function(e) {
13
- return !!(e != null && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e));
14
- }, u = [];
15
- for (var p = 0; p < 256; p++)
16
- u[p] = (p <= 15 ? "0" : "") + p.toString(16);
17
- var m = new RegExp("^[0-9a-fA-F]{24}$"), s = [];
18
- p = 0;
19
- for (; p < 10; ) s[48 + p] = p++;
20
- for (; p < 16; ) s[55 + p] = s[87 + p] = p++;
21
- function n(e) {
22
- if (!(this instanceof n)) return new n(e);
23
- if (e && (e instanceof n || e._bsontype === "ObjectID"))
24
- return e;
25
- if (this._bsontype = "ObjectID", e == null || typeof e == "number") {
26
- this.id = this.generate(e);
27
- return;
28
- }
29
- var _ = n.isValid(e);
30
- if (!_ && e != null)
31
- throw new Error(
32
- "Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
33
- );
34
- if (_ && typeof e == "string" && e.length === 24)
35
- return n.createFromHexString(e);
36
- if (e != null && e.length === 12)
37
- this.id = e;
38
- else {
39
- if (e != null && typeof e.toHexString == "function")
40
- return e;
41
- throw new Error(
42
- "Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
43
- );
44
- }
45
- }
46
- var g = n;
47
- n.default = n;
48
- n.createFromTime = function(e) {
49
- return e = parseInt(e, 10) % 4294967295, new n(f(8, e) + "0000000000000000");
50
- };
51
- n.createFromHexString = function(e) {
52
- if (typeof e > "u" || e != null && e.length !== 24)
53
- throw new Error(
54
- "Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
55
- );
56
- for (var _ = "", t = 0; t < 24; )
57
- _ += String.fromCharCode(s[e.charCodeAt(t++)] << 4 | s[e.charCodeAt(t++)]);
58
- return new n(_);
59
- };
60
- n.isValid = function(e) {
61
- return e == null ? !1 : typeof e == "number" ? !0 : typeof e == "string" ? e.length === 12 || e.length === 24 && m.test(e) : e instanceof n ? !0 : r(e) ? n.isValid(e.toString("hex")) : typeof e.toHexString == "function" && d && (e.id instanceof d || typeof e.id == "string") ? e.id.length === 12 || e.id.length === 24 && m.test(e.id) : !1;
62
- };
63
- n.prototype = {
64
- constructor: n,
65
- /**
66
- * Return the ObjectID id as a 24 byte hex string representation
67
- *
68
- * @return {String} return the 24 byte hex string representation.
69
- * @api public
70
- */
71
- toHexString: function() {
72
- if (!this.id || !this.id.length)
73
- throw new Error(
74
- "invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [" + JSON.stringify(this.id) + "]"
75
- );
76
- if (this.id.length === 24)
77
- return this.id;
78
- if (r(this.id))
79
- return this.id.toString("hex");
80
- for (var e = "", _ = 0; _ < this.id.length; _++)
81
- e += u[this.id.charCodeAt(_)];
82
- return e;
83
- },
84
- /**
85
- * Compares the equality of this ObjectID with `otherID`.
86
- *
87
- * @param {Object} otherId ObjectID instance to compare against.
88
- * @return {Boolean} the result of comparing two ObjectID's
89
- * @api public
90
- */
91
- equals: function(e) {
92
- return e instanceof n ? this.toString() === e.toString() : typeof e == "string" && n.isValid(e) && e.length === 12 && r(this.id) ? e === this.id.toString("binary") : typeof e == "string" && n.isValid(e) && e.length === 24 ? e.toLowerCase() === this.toHexString() : typeof e == "string" && n.isValid(e) && e.length === 12 ? e === this.id : e != null && (e instanceof n || e.toHexString) ? e.toHexString() === this.toHexString() : !1;
93
- },
94
- /**
95
- * Returns the generation date (accurate up to the second) that this ID was generated.
96
- *
97
- * @return {Date} the generation date
98
- * @api public
99
- */
100
- getTimestamp: function() {
101
- var e = /* @__PURE__ */ new Date(), _;
102
- return r(this.id) ? _ = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24 : _ = this.id.charCodeAt(3) | this.id.charCodeAt(2) << 8 | this.id.charCodeAt(1) << 16 | this.id.charCodeAt(0) << 24, e.setTime(Math.floor(_) * 1e3), e;
103
- },
104
- /**
105
- * Generate a 12 byte id buffer used in ObjectID's
106
- *
107
- * @method
108
- * @param {number} [time] optional parameter allowing to pass in a second based timestamp.
109
- * @return {string} return the 12 byte id buffer string.
110
- */
111
- generate: function(e) {
112
- typeof e != "number" && (e = ~~(Date.now() / 1e3)), e = parseInt(e, 10) % 4294967295;
113
- var _ = E();
114
- return String.fromCharCode(
115
- e >> 24 & 255,
116
- e >> 16 & 255,
117
- e >> 8 & 255,
118
- e & 255,
119
- i >> 16 & 255,
120
- i >> 8 & 255,
121
- i & 255,
122
- c >> 8 & 255,
123
- c & 255,
124
- _ >> 16 & 255,
125
- _ >> 8 & 255,
126
- _ & 255
127
- );
128
- }
129
- };
130
- function E() {
131
- return a = (a + 1) % 16777215;
132
- }
133
- function f(e, _) {
134
- return _ = _.toString(16), _.length === e ? _ : "00000000".substring(_.length, e) + _;
135
- }
136
- var h = Symbol && Symbol.for && Symbol.for("nodejs.util.inspect.custom") || "inspect";
137
- n.prototype[h] = function() {
138
- return "ObjectID(" + this + ")";
139
- };
140
- n.prototype.toJSON = n.prototype.toHexString;
141
- n.prototype.toString = n.prototype.toHexString;
142
- const T = /* @__PURE__ */ l(g);
143
- export {
144
- T as O
145
- };