@leatcom/portal-sessions 0.0.75-beta.1 → 0.0.75-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,7 +15,7 @@ declare type Attribute = {
|
|
|
15
15
|
value: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
declare type ContactResource = {
|
|
18
|
+
export declare type ContactResource = {
|
|
19
19
|
id: number;
|
|
20
20
|
uuid: string;
|
|
21
21
|
email: string;
|
|
@@ -24,12 +24,8 @@ declare type ContactResource = {
|
|
|
24
24
|
subscriptions: Array<Subscription>;
|
|
25
25
|
credit_balance: CreditBalance;
|
|
26
26
|
prepaid_balance: PrepaidBalance;
|
|
27
|
-
current_values: {
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
current_display_values: {
|
|
31
|
-
[key: string]: string;
|
|
32
|
-
};
|
|
27
|
+
current_values: { [key: string]: string | number };
|
|
28
|
+
current_display_values: { [key: string]: string };
|
|
33
29
|
};
|
|
34
30
|
|
|
35
31
|
declare type CreditBalance = {
|
|
@@ -39,32 +35,25 @@ declare type CreditBalance = {
|
|
|
39
35
|
|
|
40
36
|
export declare function DefaultSession({ uuid, host }: DefaultSessionProps): JSX_2.Element;
|
|
41
37
|
|
|
42
|
-
|
|
38
|
+
declare type DefaultSessionProps = {
|
|
43
39
|
uuid: string;
|
|
44
40
|
host?: string;
|
|
45
41
|
};
|
|
46
42
|
|
|
47
|
-
declare enum FacingMode {
|
|
43
|
+
export declare enum FacingMode {
|
|
48
44
|
USER = "user",
|
|
49
|
-
ENVIRONMENT = "environment"
|
|
45
|
+
ENVIRONMENT = "environment",
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
declare type GiftcardTransactionResource = {
|
|
48
|
+
export declare type GiftcardTransactionResource = {
|
|
53
49
|
id: number;
|
|
54
50
|
uuid: string;
|
|
55
51
|
amount_in_cents: number;
|
|
56
52
|
type: string;
|
|
57
53
|
settled: boolean;
|
|
58
|
-
card: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
shop: {
|
|
63
|
-
id: number;
|
|
64
|
-
uuid: string;
|
|
65
|
-
name: string;
|
|
66
|
-
};
|
|
67
|
-
settlements: [];
|
|
54
|
+
card: { id: number; uuid: string };
|
|
55
|
+
shop: { id: number; uuid: string; name: string };
|
|
56
|
+
settlements: []; // GiftcardTransactionSettlementResource
|
|
68
57
|
created_at: string;
|
|
69
58
|
};
|
|
70
59
|
|
|
@@ -82,7 +71,7 @@ declare type Media = {
|
|
|
82
71
|
|
|
83
72
|
export declare function PortalSession(props: PortalSessionProps): ReactElement;
|
|
84
73
|
|
|
85
|
-
|
|
74
|
+
declare type PortalSessionProps = {
|
|
86
75
|
type?: keyof typeof PortalType;
|
|
87
76
|
host?: string;
|
|
88
77
|
apiKey: string;
|
|
@@ -102,7 +91,7 @@ export declare type PortalSessionProps = {
|
|
|
102
91
|
primaryIdentificationMethod?: PrimaryIdentificationMethod;
|
|
103
92
|
};
|
|
104
93
|
|
|
105
|
-
declare enum PortalType {
|
|
94
|
+
export declare enum PortalType {
|
|
106
95
|
GENERIC = "GENERIC",
|
|
107
96
|
GIFTCARD = "GIFTCARD",
|
|
108
97
|
REDEEM_GIFTCARD = "REDEEM_GIFTCARD",
|
|
@@ -111,7 +100,7 @@ declare enum PortalType {
|
|
|
111
100
|
PAY_PREPAID = "PAY_PREPAID",
|
|
112
101
|
TOP_UP_PREPAID = "TOP_UP_PREPAID",
|
|
113
102
|
POINTS_TRANSACTION = "POINTS_TRANSACTION",
|
|
114
|
-
VOUCHER = "VOUCHER"
|
|
103
|
+
VOUCHER = "VOUCHER",
|
|
115
104
|
}
|
|
116
105
|
|
|
117
106
|
declare type PrepaidBalance = {
|
|
@@ -120,7 +109,7 @@ declare type PrepaidBalance = {
|
|
|
120
109
|
|
|
121
110
|
declare enum PrimaryIdentificationMethod {
|
|
122
111
|
IDENTIFIER = "identifier",
|
|
123
|
-
EMAIL = "email"
|
|
112
|
+
EMAIL = "email",
|
|
124
113
|
}
|
|
125
114
|
|
|
126
115
|
declare type Promotion = {
|
|
@@ -131,11 +120,9 @@ declare type Promotion = {
|
|
|
131
120
|
limit_per_contact: number;
|
|
132
121
|
expiration_duration: number;
|
|
133
122
|
image: Image_2;
|
|
134
|
-
} & {
|
|
135
|
-
[p: string]: string | boolean | number;
|
|
136
|
-
};
|
|
123
|
+
} & { [p: string]: string | boolean | number };
|
|
137
124
|
|
|
138
|
-
declare type RewardResource = {
|
|
125
|
+
export declare type RewardResource = {
|
|
139
126
|
uuid: string;
|
|
140
127
|
title: string;
|
|
141
128
|
description: string;
|
|
@@ -145,9 +132,7 @@ declare type RewardResource = {
|
|
|
145
132
|
media: Media;
|
|
146
133
|
reward_type: string;
|
|
147
134
|
stock: number;
|
|
148
|
-
} & {
|
|
149
|
-
[attributeKey: string]: string | number | boolean;
|
|
150
|
-
};
|
|
135
|
+
} & { [attributeKey: string]: string | number | boolean };
|
|
151
136
|
|
|
152
137
|
declare type Subscription = {
|
|
153
138
|
is_subscribed: boolean;
|
|
@@ -165,24 +150,25 @@ declare type Subscription = {
|
|
|
165
150
|
declare enum SubscriptionStatus {
|
|
166
151
|
SUBSCRIBED = "SUBSCRIBED",
|
|
167
152
|
UNSUBSCRIBED = "UNSUBSCRIBED",
|
|
168
|
-
PENDING_CONFIRMATION = "PENDING_CONFIRMATION"
|
|
153
|
+
PENDING_CONFIRMATION = "PENDING_CONFIRMATION",
|
|
169
154
|
}
|
|
170
155
|
|
|
171
156
|
declare enum SubscriptionStrategy {
|
|
172
157
|
OPT_OUT = "OPT_OUT",
|
|
173
158
|
OPT_IN = "OPT_IN",
|
|
174
159
|
DOUBLE_OPT_IN = "DOUBLE_OPT_IN",
|
|
175
|
-
FUNCTIONAL = "FUNCTIONAL"
|
|
160
|
+
FUNCTIONAL = "FUNCTIONAL",
|
|
176
161
|
}
|
|
177
162
|
|
|
178
163
|
declare type Tier = {
|
|
179
164
|
description: string;
|
|
165
|
+
// media:
|
|
180
166
|
name: string;
|
|
181
167
|
position: number;
|
|
182
168
|
uuid: string;
|
|
183
169
|
};
|
|
184
170
|
|
|
185
|
-
declare type VoucherResource = {
|
|
171
|
+
export declare type VoucherResource = {
|
|
186
172
|
uuid: string;
|
|
187
173
|
code: string;
|
|
188
174
|
status: VoucherStatus;
|
|
@@ -207,7 +193,7 @@ declare enum VoucherStatus {
|
|
|
207
193
|
EXPIRED = "EXPIRED",
|
|
208
194
|
LOCKED = "LOCKED",
|
|
209
195
|
REDEEMED = "REDEEMED",
|
|
210
|
-
DEACTIVATED = "DEACTIVATED"
|
|
196
|
+
DEACTIVATED = "DEACTIVATED",
|
|
211
197
|
}
|
|
212
198
|
|
|
213
199
|
export { }
|
|
@@ -29006,12 +29006,6 @@ function z1({ children: e }) {
|
|
|
29006
29006
|
/* @__PURE__ */ m.jsx(XO, { className: "lg:top-14" })
|
|
29007
29007
|
] }) }) });
|
|
29008
29008
|
}
|
|
29009
|
-
function J1({ message: e = "" }) {
|
|
29010
|
-
return /* @__PURE__ */ m.jsxs("div", { className: "flex h-screen w-full items-center justify-center gap-4 text-core-gray-500", children: [
|
|
29011
|
-
/* @__PURE__ */ m.jsx(fa, { className: "h-[48px] w-[48px]" }),
|
|
29012
|
-
e && /* @__PURE__ */ m.jsx("p", { className: "text-xl", children: e })
|
|
29013
|
-
] });
|
|
29014
|
-
}
|
|
29015
29009
|
function Yr() {
|
|
29016
29010
|
const { sessionUuid: e } = Mt(), { data: t, error: n, isLoading: r, isValidating: i, mutate: s } = xr({
|
|
29017
29011
|
url: `${e}/contacts`
|
|
@@ -29072,14 +29066,14 @@ function sj({ contact: e }) {
|
|
|
29072
29066
|
] })
|
|
29073
29067
|
] });
|
|
29074
29068
|
}
|
|
29075
|
-
function
|
|
29069
|
+
function J1({ loyaltyTransaction: e }) {
|
|
29076
29070
|
const { t } = ot();
|
|
29077
29071
|
return /* @__PURE__ */ m.jsxs("div", { className: "mb-2 flex justify-between", children: [
|
|
29078
29072
|
/* @__PURE__ */ m.jsx("p", { className: "text-xs text-core-gray-500", children: e.type === mb.CREDIT_RECEPTION ? t("transaction") : `${t("isRedeemed")} '${e.loyalty_transaction_data.title}'` }),
|
|
29079
29073
|
/* @__PURE__ */ m.jsx("p", { className: "text-xs font-semibold", children: e.credits > 0 ? "+" + e.credits : e.credits })
|
|
29080
29074
|
] });
|
|
29081
29075
|
}
|
|
29082
|
-
function
|
|
29076
|
+
function X1({ subscription: e, onChange: t, editable: n = !1 }) {
|
|
29083
29077
|
const { t: r } = ot();
|
|
29084
29078
|
return /* @__PURE__ */ m.jsxs("div", { className: "mb-2 flex justify-between", children: [
|
|
29085
29079
|
/* @__PURE__ */ m.jsx("p", { className: "text-xs font-semibold", children: e.subscription_type.name }),
|
|
@@ -29157,7 +29151,7 @@ function qu() {
|
|
|
29157
29151
|
mutate: s
|
|
29158
29152
|
};
|
|
29159
29153
|
}
|
|
29160
|
-
function
|
|
29154
|
+
function Z1() {
|
|
29161
29155
|
const { sessionUuid: e } = Mt(), { data: t, error: n, isLoading: r, isValidating: i, mutate: s } = xr({
|
|
29162
29156
|
url: `${e}/subscriptions/contact`
|
|
29163
29157
|
// onData: setSubscriptions,
|
|
@@ -29174,7 +29168,7 @@ function ew() {
|
|
|
29174
29168
|
function aj() {
|
|
29175
29169
|
const { contact: e, isLoading: t } = Yr(), {
|
|
29176
29170
|
session: { loyalty_program: n, currency: r }
|
|
29177
|
-
} = xt(), { t: i } = ot(), s = Yt(), { loyaltyTransactions: o } = qu(), { subscriptions: c } =
|
|
29171
|
+
} = xt(), { t: i } = ot(), s = Yt(), { loyaltyTransactions: o } = qu(), { subscriptions: c } = Z1();
|
|
29178
29172
|
return t || !e ? /* @__PURE__ */ m.jsx(m.Fragment, {}) : /* @__PURE__ */ m.jsxs(Wt, { children: [
|
|
29179
29173
|
/* @__PURE__ */ m.jsx(Gt, { children: /* @__PURE__ */ m.jsx(oj, { contact: e }) }),
|
|
29180
29174
|
/* @__PURE__ */ m.jsx($t, { children: /* @__PURE__ */ m.jsxs("div", { className: "grid grid-cols-1 gap-x-2 gap-y-2 lg:grid-cols-4", children: [
|
|
@@ -29192,7 +29186,7 @@ function aj() {
|
|
|
29192
29186
|
/* @__PURE__ */ m.jsx(io, { children: /* @__PURE__ */ m.jsxs("div", { className: "flex h-full flex-col justify-between gap-4", children: [
|
|
29193
29187
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
29194
29188
|
/* @__PURE__ */ m.jsx("p", { className: "text-lg font-semibold leading-7", children: i("activities") }),
|
|
29195
|
-
o && o.length ? /* @__PURE__ */ m.jsx("div", { children: o.slice(0, 5).map((u) => /* @__PURE__ */ m.jsx(
|
|
29189
|
+
o && o.length ? /* @__PURE__ */ m.jsx("div", { children: o.slice(0, 5).map((u) => /* @__PURE__ */ m.jsx(J1, { loyaltyTransaction: u }, u.uuid)) }) : /* @__PURE__ */ m.jsx("p", { className: "text-sm text-core-gray-500", children: i("noActivity") })
|
|
29196
29190
|
] }),
|
|
29197
29191
|
/* @__PURE__ */ m.jsx(
|
|
29198
29192
|
yt,
|
|
@@ -29209,7 +29203,7 @@ function aj() {
|
|
|
29209
29203
|
/* @__PURE__ */ m.jsx("div", { children: c == null ? void 0 : c.filter(
|
|
29210
29204
|
(u) => u.subscription_type.strategy !== Ni.FUNCTIONAL
|
|
29211
29205
|
).map((u) => /* @__PURE__ */ m.jsx(
|
|
29212
|
-
|
|
29206
|
+
X1,
|
|
29213
29207
|
{
|
|
29214
29208
|
subscription: u
|
|
29215
29209
|
},
|
|
@@ -29251,12 +29245,12 @@ function cj() {
|
|
|
29251
29245
|
/* @__PURE__ */ m.jsx($t, { children: /* @__PURE__ */ m.jsxs("div", { className: "md:max-h-[528px]", children: [
|
|
29252
29246
|
/* @__PURE__ */ m.jsx("p", { className: "text-sm font-medium", children: e("allActivities") }),
|
|
29253
29247
|
/* @__PURE__ */ m.jsx("p", { className: "mb-4 text-sm text-core-gray-500", children: e("checkOutAllActivitiesOfName", { name: n.current_display_values.firstname }) }),
|
|
29254
|
-
/* @__PURE__ */ m.jsx("div", { className: "overflow-auto", children: t == null ? void 0 : t.map((r) => /* @__PURE__ */ m.jsx(
|
|
29248
|
+
/* @__PURE__ */ m.jsx("div", { className: "overflow-auto", children: t == null ? void 0 : t.map((r) => /* @__PURE__ */ m.jsx(J1, { loyaltyTransaction: r }, r.uuid)) })
|
|
29255
29249
|
] }) })
|
|
29256
29250
|
] }) });
|
|
29257
29251
|
}
|
|
29258
29252
|
function uj() {
|
|
29259
|
-
const { t: e } = ot(), { subscriptions: t, mutate: n } =
|
|
29253
|
+
const { t: e } = ot(), { subscriptions: t, mutate: n } = Z1(), [r, i] = Ce(
|
|
29260
29254
|
{}
|
|
29261
29255
|
), [s, o] = Ce(!1);
|
|
29262
29256
|
Oe(() => {
|
|
@@ -29279,7 +29273,7 @@ function uj() {
|
|
|
29279
29273
|
/* @__PURE__ */ m.jsx("p", { className: "text-sm font-medium", children: e("subscriptions") }),
|
|
29280
29274
|
/* @__PURE__ */ m.jsx("p", { className: "mb-4 text-sm text-core-gray-500", children: e("manageEmailPreferences") }),
|
|
29281
29275
|
t == null ? void 0 : t.filter((f) => f.subscription_type.strategy !== Ni.FUNCTIONAL).map((f) => /* @__PURE__ */ m.jsx(
|
|
29282
|
-
|
|
29276
|
+
X1,
|
|
29283
29277
|
{
|
|
29284
29278
|
subscription: f,
|
|
29285
29279
|
onChange: c,
|
|
@@ -29316,7 +29310,7 @@ function lj({ identifier: e, onClear: t }) {
|
|
|
29316
29310
|
)
|
|
29317
29311
|
] });
|
|
29318
29312
|
}
|
|
29319
|
-
function
|
|
29313
|
+
function ew() {
|
|
29320
29314
|
const { sessionUuid: e } = Mt(), { data: t, error: n, isLoading: r, isValidating: i, mutate: s } = xr({
|
|
29321
29315
|
url: `${e}/contact-identifiers`
|
|
29322
29316
|
// onData: setContactIdentifiers,
|
|
@@ -29331,7 +29325,7 @@ function tw() {
|
|
|
29331
29325
|
};
|
|
29332
29326
|
}
|
|
29333
29327
|
function dj() {
|
|
29334
|
-
const { t: e } = ot(), t = Yt(), { identifiers: n, isLoading: r, mutate: i } =
|
|
29328
|
+
const { t: e } = ot(), t = Yt(), { identifiers: n, isLoading: r, mutate: i } = ew(), [s, o] = Ce(""), [c, u] = Ce(!1), d = (p) => {
|
|
29335
29329
|
o(p), u(!0);
|
|
29336
29330
|
}, f = async () => {
|
|
29337
29331
|
await oM.clear({ value: s }), await i(), u(!1);
|
|
@@ -29383,7 +29377,7 @@ function dj() {
|
|
|
29383
29377
|
] });
|
|
29384
29378
|
}
|
|
29385
29379
|
function fj() {
|
|
29386
|
-
const { t: e } = ot(), { contact: t } = Yr(), { mutate: n } =
|
|
29380
|
+
const { t: e } = ot(), { contact: t } = Yr(), { mutate: n } = ew(), { errorToast: r } = $i(), i = Yt(), [s, o] = Ce(""), [c, u] = Ce(!1), [d, f] = Ce(!1), p = () => {
|
|
29387
29381
|
!s || !t || !t.email || (u(!0), Bo.linkIdentifier(s, t.email).then(() => {
|
|
29388
29382
|
n(), i("/portal/profile/contact-identifiers");
|
|
29389
29383
|
}).catch(r).finally(() => {
|
|
@@ -29852,7 +29846,7 @@ function Ej() {
|
|
|
29852
29846
|
function xj() {
|
|
29853
29847
|
return /* @__PURE__ */ m.jsx(wn, { children: /* @__PURE__ */ m.jsx(ku, { state: { redirectRoute: `${bt.PORTAL}` } }) });
|
|
29854
29848
|
}
|
|
29855
|
-
function
|
|
29849
|
+
function tw({ onSubmit: e, children: t }) {
|
|
29856
29850
|
const n = (r) => {
|
|
29857
29851
|
r.preventDefault(), e && e(r);
|
|
29858
29852
|
};
|
|
@@ -29881,7 +29875,7 @@ function qs() {
|
|
|
29881
29875
|
/* @__PURE__ */ m.jsx(wn, { children: /* @__PURE__ */ m.jsxs(Wt, { id: Gr, children: [
|
|
29882
29876
|
/* @__PURE__ */ m.jsx(Gt, { children: /* @__PURE__ */ m.jsx("div", { className: "flex h-16 items-center", children: /* @__PURE__ */ m.jsx("p", { children: t("fillInXBelow", { x: t("emailAddress").toLowerCase() }) }) }) }),
|
|
29883
29877
|
/* @__PURE__ */ m.jsx($t, { children: /* @__PURE__ */ m.jsx(
|
|
29884
|
-
|
|
29878
|
+
tw,
|
|
29885
29879
|
{
|
|
29886
29880
|
onSubmit: () => {
|
|
29887
29881
|
u && !f && a();
|
|
@@ -30035,7 +30029,7 @@ function va() {
|
|
|
30035
30029
|
/* @__PURE__ */ m.jsx(Gt, { children: /* @__PURE__ */ m.jsx("div", { className: "flex h-16 items-center", children: n("linkContact") }) }),
|
|
30036
30030
|
/* @__PURE__ */ m.jsx($t, { children: /* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
30037
30031
|
/* @__PURE__ */ m.jsx(HM, { body: n("noEmailAddressLinkedToIdentifier") }),
|
|
30038
|
-
/* @__PURE__ */ m.jsx(
|
|
30032
|
+
/* @__PURE__ */ m.jsx(tw, { onSubmit: y, children: /* @__PURE__ */ m.jsx(
|
|
30039
30033
|
Fs,
|
|
30040
30034
|
{
|
|
30041
30035
|
id: "new-contact-identifier-input",
|
|
@@ -30199,7 +30193,7 @@ function Cj() {
|
|
|
30199
30193
|
/* @__PURE__ */ m.jsx(un, { children: /* @__PURE__ */ m.jsx(yt, { label: n("submit"), className: "w-full", onClick: b, disabled: !s || c }) })
|
|
30200
30194
|
] }) });
|
|
30201
30195
|
}
|
|
30202
|
-
function
|
|
30196
|
+
function nw(e) {
|
|
30203
30197
|
const { sessionUuid: t } = Mt(), { data: n, error: r, isLoading: i, isValidating: s, mutate: o } = xr({
|
|
30204
30198
|
url: `${t}/giftcards/${e}`
|
|
30205
30199
|
// onData: setGiftcard,
|
|
@@ -30214,7 +30208,7 @@ function rw(e) {
|
|
|
30214
30208
|
};
|
|
30215
30209
|
}
|
|
30216
30210
|
function Aj() {
|
|
30217
|
-
const { t: e } = ot(), { hash: t } = Sv(), { giftcard: n, isLoading: r, mutate: i } =
|
|
30211
|
+
const { t: e } = ot(), { hash: t } = Sv(), { giftcard: n, isLoading: r, mutate: i } = nw(t), { session: s, mutate: o } = xt(), { onUseGiftcard: c } = Mt(), u = Yt(), d = (s == null ? void 0 : s.input_data.amount_in_cents) ?? 0, [f] = Ce(
|
|
30218
30212
|
s.results.remaining_amount ? +s.results.remaining_amount : +d
|
|
30219
30213
|
), p = (s == null ? void 0 : s.input_data.allow_multiple_giftcards) ?? !0;
|
|
30220
30214
|
if (r)
|
|
@@ -30278,7 +30272,7 @@ function Aj() {
|
|
|
30278
30272
|
] }) });
|
|
30279
30273
|
}
|
|
30280
30274
|
function Tj() {
|
|
30281
|
-
const { t: e } = ot(), { hash: t } = Sv(), { giftcard: n, isLoading: r, mutate: i } =
|
|
30275
|
+
const { t: e } = ot(), { hash: t } = Sv(), { giftcard: n, isLoading: r, mutate: i } = nw(t), { mutate: s } = xt(), { onUseGiftcard: o } = Mt();
|
|
30282
30276
|
if (r)
|
|
30283
30277
|
return /* @__PURE__ */ m.jsx("div", { className: "flex h-screen w-screen items-center justify-center text-core-primary-500", children: /* @__PURE__ */ m.jsx(fa, { className: "h-[48px] w-[48px]" }) });
|
|
30284
30278
|
if (!n)
|
|
@@ -30376,7 +30370,7 @@ function Nj() {
|
|
|
30376
30370
|
/* @__PURE__ */ m.jsx(Ne, { path: "/transaction", element: /* @__PURE__ */ m.jsx(ir, { element: /* @__PURE__ */ m.jsx(Oj, {}) }) })
|
|
30377
30371
|
] });
|
|
30378
30372
|
}
|
|
30379
|
-
function
|
|
30373
|
+
function rw() {
|
|
30380
30374
|
const { state: e } = Qt(), t = Yt(), { session: n } = xt(), r = {
|
|
30381
30375
|
redirectRoute: n.type === gt.TOP_UP_PREPAID ? `${bt.TOP_UP_PREPAID}/top-up` : `${bt.PAY_PREPAID}/pay`
|
|
30382
30376
|
};
|
|
@@ -30386,7 +30380,7 @@ function iw() {
|
|
|
30386
30380
|
});
|
|
30387
30381
|
}, []), /* @__PURE__ */ m.jsx(wn, { children: /* @__PURE__ */ m.jsx(ku, { state: r }) });
|
|
30388
30382
|
}
|
|
30389
|
-
function
|
|
30383
|
+
function iw() {
|
|
30390
30384
|
const { sessionUuid: e } = Mt(), { data: t, error: n, isLoading: r, isValidating: i, mutate: s } = xr({
|
|
30391
30385
|
url: `${e}/prepaid`
|
|
30392
30386
|
// onData: setPrepaidBalance,
|
|
@@ -30401,7 +30395,7 @@ function sw() {
|
|
|
30401
30395
|
};
|
|
30402
30396
|
}
|
|
30403
30397
|
function Mj() {
|
|
30404
|
-
const { state: e } = Qt(), { t } = ot(), { balance: n, mutate: r } =
|
|
30398
|
+
const { state: e } = Qt(), { t } = ot(), { balance: n, mutate: r } = iw(), { mutate: i } = xt(), { contact: s } = Yr(), o = async (c) => {
|
|
30405
30399
|
c && (await gb.transaction({
|
|
30406
30400
|
amount_in_cents: c,
|
|
30407
30401
|
contact_identifier_value: e.contactIdentifier ?? void 0
|
|
@@ -30417,7 +30411,7 @@ function Mj() {
|
|
|
30417
30411
|
) });
|
|
30418
30412
|
}
|
|
30419
30413
|
function Dj() {
|
|
30420
|
-
const { state: e } = Qt(), { t } = ot(), { balance: n, mutate: r } =
|
|
30414
|
+
const { state: e } = Qt(), { t } = ot(), { balance: n, mutate: r } = iw(), { contact: i } = Yr(), {
|
|
30421
30415
|
session: { input_data: s, currency: o, events: c },
|
|
30422
30416
|
mutate: u
|
|
30423
30417
|
} = xt(), d = s.amount_in_cents ? +s.amount_in_cents : 0;
|
|
@@ -30477,7 +30471,7 @@ function Dj() {
|
|
|
30477
30471
|
}
|
|
30478
30472
|
function Pj() {
|
|
30479
30473
|
return /* @__PURE__ */ m.jsxs(Er, { children: [
|
|
30480
|
-
/* @__PURE__ */ m.jsx(Ne, { path: "/", element: /* @__PURE__ */ m.jsx(
|
|
30474
|
+
/* @__PURE__ */ m.jsx(Ne, { path: "/", element: /* @__PURE__ */ m.jsx(rw, {}) }),
|
|
30481
30475
|
/* @__PURE__ */ m.jsx(Ne, { path: "/email", element: /* @__PURE__ */ m.jsx(qs, {}) }),
|
|
30482
30476
|
/* @__PURE__ */ m.jsx(Ne, { path: "/email/new-contact", element: /* @__PURE__ */ m.jsx(cr, {}) }),
|
|
30483
30477
|
/* @__PURE__ */ m.jsx(Ne, { path: "/link-identifier", element: /* @__PURE__ */ m.jsx(va, {}) }),
|
|
@@ -30487,7 +30481,7 @@ function Pj() {
|
|
|
30487
30481
|
}
|
|
30488
30482
|
function jj() {
|
|
30489
30483
|
return /* @__PURE__ */ m.jsxs(Er, { children: [
|
|
30490
|
-
/* @__PURE__ */ m.jsx(Ne, { path: "/", element: /* @__PURE__ */ m.jsx(
|
|
30484
|
+
/* @__PURE__ */ m.jsx(Ne, { path: "/", element: /* @__PURE__ */ m.jsx(rw, {}) }),
|
|
30491
30485
|
/* @__PURE__ */ m.jsx(Ne, { path: "/email", element: /* @__PURE__ */ m.jsx(qs, {}) }),
|
|
30492
30486
|
/* @__PURE__ */ m.jsx(Ne, { path: "/email/new-contact", element: /* @__PURE__ */ m.jsx(cr, {}) }),
|
|
30493
30487
|
/* @__PURE__ */ m.jsx(Ne, { path: "/link-identifier", element: /* @__PURE__ */ m.jsx(va, {}) }),
|
|
@@ -30607,6 +30601,12 @@ function Vj() {
|
|
|
30607
30601
|
) : /* @__PURE__ */ m.jsx("p", { className: "text-error-600", children: `${t("somethingWentWrong")} ${t("portalSessionNotFound")}.` })
|
|
30608
30602
|
] });
|
|
30609
30603
|
}
|
|
30604
|
+
function sw({ message: e = "" }) {
|
|
30605
|
+
return /* @__PURE__ */ m.jsxs("div", { className: "flex h-screen w-full items-center justify-center gap-4 text-core-gray-500", children: [
|
|
30606
|
+
/* @__PURE__ */ m.jsx(fa, { className: "h-[48px] w-[48px]" }),
|
|
30607
|
+
e && /* @__PURE__ */ m.jsx("p", { className: "text-xl", children: e })
|
|
30608
|
+
] });
|
|
30609
|
+
}
|
|
30610
30610
|
const $j = {
|
|
30611
30611
|
[gt.GENERIC]: bt.GENERIC,
|
|
30612
30612
|
[gt.PORTAL]: bt.PORTAL,
|
|
@@ -30622,7 +30622,7 @@ function Gj() {
|
|
|
30622
30622
|
const e = Yt(), { t } = ot(), { sessionUuid: n } = Mt(), { session: r, isLoading: i, mutate: s } = xt();
|
|
30623
30623
|
return Oe(() => {
|
|
30624
30624
|
!i && r && e($j[r.type]);
|
|
30625
|
-
}, [i, s, e, r]), i ? /* @__PURE__ */ m.jsx(
|
|
30625
|
+
}, [i, s, e, r]), i ? /* @__PURE__ */ m.jsx(sw, {}) : /* @__PURE__ */ m.jsx("div", { className: "text-error-600 flex w-full items-center justify-center", children: `${t(
|
|
30626
30626
|
"portalSessionNotFound"
|
|
30627
30627
|
)} (${n})` });
|
|
30628
30628
|
}
|
|
@@ -30698,7 +30698,12 @@ function xi({
|
|
|
30698
30698
|
const { session: n } = xt();
|
|
30699
30699
|
return n ? (Array.isArray(e) ? [...e, gt.GENERIC].includes(n.type) : n.type === e || n.type === gt.GENERIC) ? t : /* @__PURE__ */ m.jsx(ca, { to: "/" }) : void 0;
|
|
30700
30700
|
}
|
|
30701
|
-
function Kj(e) {
|
|
30701
|
+
function Kj({ uuid: e, host: t }) {
|
|
30702
|
+
return Oe(() => {
|
|
30703
|
+
t && sessionStorage.setItem("apiHost", JSON.stringify(t)), It.initialize(void 0, t);
|
|
30704
|
+
}, []), /* @__PURE__ */ m.jsx(Bv, { sessionUuid: e, children: /* @__PURE__ */ m.jsx(z1, { children: /* @__PURE__ */ m.jsx(Av, { children: /* @__PURE__ */ m.jsx(ow, {}) }) }) });
|
|
30705
|
+
}
|
|
30706
|
+
function Qj(e) {
|
|
30702
30707
|
const t = js(), { errorToast: n } = $i(), [r, i] = Ce(""), s = () => {
|
|
30703
30708
|
const c = {
|
|
30704
30709
|
type: e.type ?? gt.PORTAL,
|
|
@@ -30719,14 +30724,9 @@ function Kj(e) {
|
|
|
30719
30724
|
};
|
|
30720
30725
|
return Oe(() => {
|
|
30721
30726
|
localStorage.setItem("apiKey", JSON.stringify(e.apiKey)), e.host && sessionStorage.setItem("apiHost", JSON.stringify(e.host)), It.initialize(e.apiKey, e.host), o();
|
|
30722
|
-
}, []), r ? /* @__PURE__ */ m.jsx(Bv, { ...e, sessionUuid: r, children: /* @__PURE__ */ m.jsx(z1, { children: /* @__PURE__ */ m.jsx(Av, { children: /* @__PURE__ */ m.jsx(ow, {}) }) }) }) : /* @__PURE__ */ m.jsx(
|
|
30723
|
-
}
|
|
30724
|
-
function Qj({ uuid: e, host: t }) {
|
|
30725
|
-
return Oe(() => {
|
|
30726
|
-
t && sessionStorage.setItem("apiHost", JSON.stringify(t)), It.initialize(void 0, t);
|
|
30727
|
-
}, []), /* @__PURE__ */ m.jsx(Bv, { sessionUuid: e, children: /* @__PURE__ */ m.jsx(z1, { children: /* @__PURE__ */ m.jsx(Av, { children: /* @__PURE__ */ m.jsx(ow, {}) }) }) });
|
|
30727
|
+
}, []), r ? /* @__PURE__ */ m.jsx(Bv, { ...e, sessionUuid: r, children: /* @__PURE__ */ m.jsx(z1, { children: /* @__PURE__ */ m.jsx(Av, { children: /* @__PURE__ */ m.jsx(ow, {}) }) }) }) : /* @__PURE__ */ m.jsx(sw, {});
|
|
30728
30728
|
}
|
|
30729
30729
|
export {
|
|
30730
|
-
|
|
30731
|
-
|
|
30730
|
+
Kj as DefaultSession,
|
|
30731
|
+
Qj as PortalSession
|
|
30732
30732
|
};
|