@superlogic/spree-pay 0.1.42 → 0.2.1
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/build/CryptoComTab-WWW23OV5.js +169 -0
- package/build/CryptoTab-HISSGXAC.js +838 -0
- package/build/chunk-2V675UEC.js +56 -0
- package/build/chunk-FGNS5H2Q.js +278 -0
- package/build/chunk-RQX2IOTB.js +795 -0
- package/build/index.cjs +4374 -3869
- package/build/index.css +60 -21
- package/build/index.js +1507 -3510
- package/package.json +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogContent,
|
|
4
|
+
DialogTitle
|
|
5
|
+
} from "./chunk-RQX2IOTB.js";
|
|
6
|
+
|
|
7
|
+
// src/modals/Iframe3ds.tsx
|
|
8
|
+
import { useEffect } from "react";
|
|
9
|
+
import NiceModal, { useModal } from "@ebay/nice-modal-react";
|
|
10
|
+
|
|
11
|
+
// src/services/eventBus.ts
|
|
12
|
+
var emit = (name, detail) => {
|
|
13
|
+
window.dispatchEvent(new CustomEvent(name, { detail }));
|
|
14
|
+
};
|
|
15
|
+
var on = (name, handler) => {
|
|
16
|
+
const callback = ((event) => handler(event.detail));
|
|
17
|
+
window.addEventListener(name, callback);
|
|
18
|
+
return () => window.removeEventListener(name, callback);
|
|
19
|
+
};
|
|
20
|
+
var bus = { emit, on };
|
|
21
|
+
if (typeof window !== "undefined") {
|
|
22
|
+
window.SP_EVENT_BUS ||= bus;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/modals/Iframe3ds.tsx
|
|
26
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
+
var Iframe3ds = NiceModal.create(({ url }) => {
|
|
28
|
+
const modal = useModal();
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
return bus.on("paymentIntent", (data) => {
|
|
31
|
+
modal.resolve(data.paymentIntent);
|
|
32
|
+
modal.remove();
|
|
33
|
+
});
|
|
34
|
+
}, [modal]);
|
|
35
|
+
const handleClose = () => {
|
|
36
|
+
modal.reject();
|
|
37
|
+
modal.remove();
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ jsx(Dialog, { open: modal.visible, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-h-[600px] w-full max-w-[680px] p-0", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "hidden", children: "Payment Verification" }),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"iframe",
|
|
43
|
+
{
|
|
44
|
+
src: url,
|
|
45
|
+
id: "3ds-iframe",
|
|
46
|
+
title: "Payment Verificatio",
|
|
47
|
+
className: "h-[731px] w-full rounded-lg border-0"
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] }) });
|
|
51
|
+
});
|
|
52
|
+
Iframe3ds.displayName = "Iframe3ds";
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
Iframe3ds
|
|
56
|
+
};
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InfoBanner,
|
|
3
|
+
Legal,
|
|
4
|
+
cn,
|
|
5
|
+
useSpreePayConfig,
|
|
6
|
+
useSpreePayEnv,
|
|
7
|
+
useSpreePaymentMethod,
|
|
8
|
+
useStaticConfig
|
|
9
|
+
} from "./chunk-RQX2IOTB.js";
|
|
10
|
+
|
|
11
|
+
// src/components/common/PointsSwitch.tsx
|
|
12
|
+
import { useId } from "react";
|
|
13
|
+
|
|
14
|
+
// src/hooks/useSlapiBalance.ts
|
|
15
|
+
import useSWR from "swr";
|
|
16
|
+
var useSlapiBalance = () => {
|
|
17
|
+
const { data, isLoading, mutate } = useSWR(`/v1/loyalty/accounts`);
|
|
18
|
+
return { balance: data?.detail, isBalanceLoading: isLoading, mutateBalance: mutate };
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// src/ui/label.tsx
|
|
22
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
23
|
+
import { jsx } from "react/jsx-runtime";
|
|
24
|
+
function Label({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
LabelPrimitive.Root,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "label",
|
|
29
|
+
className: cn(
|
|
30
|
+
"flex items-center gap-2 text-sm leading-none font-medium text-(--primary) select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/ui/switch.tsx
|
|
39
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
40
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
41
|
+
function Switch({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx2(
|
|
43
|
+
SwitchPrimitive.Root,
|
|
44
|
+
{
|
|
45
|
+
"data-slot": "switch",
|
|
46
|
+
className: cn(
|
|
47
|
+
"peer focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-(--s-brand) data-[state=unchecked]:bg-(--s-tertiary)",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props,
|
|
51
|
+
children: /* @__PURE__ */ jsx2(
|
|
52
|
+
SwitchPrimitive.Thumb,
|
|
53
|
+
{
|
|
54
|
+
"data-slot": "switch-thumb",
|
|
55
|
+
className: "pointer-events-none block size-4 rounded-full bg-(--s-default) ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// src/utils/format.ts
|
|
63
|
+
var formatUSD = (amount, currency = "USD") => {
|
|
64
|
+
const formattedAmount = new Intl.NumberFormat("en-US", {
|
|
65
|
+
currency,
|
|
66
|
+
style: "currency",
|
|
67
|
+
maximumFractionDigits: 5,
|
|
68
|
+
minimumFractionDigits: 2
|
|
69
|
+
}).format(amount);
|
|
70
|
+
return formattedAmount;
|
|
71
|
+
};
|
|
72
|
+
var formatPoints = (amount, pointsTitle = "") => {
|
|
73
|
+
const formattedAmount = new Intl.NumberFormat("en-US", {
|
|
74
|
+
notation: "compact",
|
|
75
|
+
style: "decimal",
|
|
76
|
+
maximumFractionDigits: 1,
|
|
77
|
+
minimumFractionDigits: 0
|
|
78
|
+
}).format(amount);
|
|
79
|
+
return `${formattedAmount} ${pointsTitle}`;
|
|
80
|
+
};
|
|
81
|
+
var formatCoin = (amount, currency = "USDC") => {
|
|
82
|
+
const formattedAmount = new Intl.NumberFormat("en-US", {
|
|
83
|
+
style: "decimal",
|
|
84
|
+
maximumFractionDigits: 5,
|
|
85
|
+
minimumFractionDigits: 2
|
|
86
|
+
}).format(amount);
|
|
87
|
+
return `${formattedAmount} ${currency}`;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// src/components/common/PointsSwitch.tsx
|
|
91
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
92
|
+
var PointsSwitch = (props) => {
|
|
93
|
+
const { disabled = false, value, onChange, message } = props;
|
|
94
|
+
const { spreePayConfig } = useSpreePayConfig();
|
|
95
|
+
const { appProps } = useStaticConfig();
|
|
96
|
+
const { balance } = useSlapiBalance();
|
|
97
|
+
const id = useId();
|
|
98
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
99
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
101
|
+
/* @__PURE__ */ jsx3(Switch, { checked: value, onCheckedChange: onChange, disabled, id }),
|
|
102
|
+
/* @__PURE__ */ jsxs(
|
|
103
|
+
Label,
|
|
104
|
+
{
|
|
105
|
+
htmlFor: id,
|
|
106
|
+
className: "text-md flex-col items-baseline gap-0 leading-[1.3] font-medium text-(--brand-primary) sm:flex-row sm:gap-2 md:text-[22px]",
|
|
107
|
+
children: [
|
|
108
|
+
"Use Points ",
|
|
109
|
+
/* @__PURE__ */ jsx3("span", { className: "text-xs font-medium text-(--tertiary)", children: "Optional" })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
115
|
+
balance?.availablePoints ? /* @__PURE__ */ jsxs("p", { className: "flex-1 text-right text-sm font-medium text-(--brand-primary)", children: [
|
|
116
|
+
formatPoints(balance.availablePoints, spreePayConfig?.pointsTitle),
|
|
117
|
+
!!spreePayConfig?.pointsConversionRatio && /* @__PURE__ */ jsx3("span", { className: "text-(--secondary)", children: ` \xB7 ${formatUSD(balance.availablePoints * spreePayConfig.pointsConversionRatio)}` })
|
|
118
|
+
] }) : null,
|
|
119
|
+
Boolean(appProps.topUpLink) && /* @__PURE__ */ jsx3(
|
|
120
|
+
"a",
|
|
121
|
+
{
|
|
122
|
+
className: "cursor-pointer rounded-full bg-(--s-brand) px-2 py-1.5 text-xs font-medium text-(--inverse) hover:bg-(--s-brand-hover)",
|
|
123
|
+
rel: "noreferrer",
|
|
124
|
+
target: "_blank",
|
|
125
|
+
href: appProps.topUpLink,
|
|
126
|
+
children: "Top Up"
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] })
|
|
130
|
+
] }),
|
|
131
|
+
message && /* @__PURE__ */ jsx3(InfoBanner, { type: "warning", message })
|
|
132
|
+
] });
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// src/ui/spinner.tsx
|
|
136
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
137
|
+
var Spinner = (props) => {
|
|
138
|
+
const { size = "md", className } = props;
|
|
139
|
+
const sizeClasses = {
|
|
140
|
+
xs: "size-4",
|
|
141
|
+
sm: "size-6",
|
|
142
|
+
md: "size-8",
|
|
143
|
+
lg: "size-12",
|
|
144
|
+
xl: "size-16"
|
|
145
|
+
};
|
|
146
|
+
return /* @__PURE__ */ jsxs2(
|
|
147
|
+
"svg",
|
|
148
|
+
{
|
|
149
|
+
className: cn(`${sizeClasses[size]} animate-spin text-(--tertiary)`, className),
|
|
150
|
+
viewBox: "0 0 64 64",
|
|
151
|
+
fill: "none",
|
|
152
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
153
|
+
width: "24",
|
|
154
|
+
height: "24",
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ jsx4(
|
|
157
|
+
"path",
|
|
158
|
+
{
|
|
159
|
+
d: "M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",
|
|
160
|
+
stroke: "currentColor",
|
|
161
|
+
strokeWidth: "5",
|
|
162
|
+
strokeLinecap: "round",
|
|
163
|
+
strokeLinejoin: "round"
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ jsx4(
|
|
167
|
+
"path",
|
|
168
|
+
{
|
|
169
|
+
d: "M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",
|
|
170
|
+
stroke: "currentColor",
|
|
171
|
+
strokeWidth: "5",
|
|
172
|
+
strokeLinecap: "round",
|
|
173
|
+
strokeLinejoin: "round",
|
|
174
|
+
className: "text-(--brand-primary)"
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// src/utils/split.ts
|
|
183
|
+
var getSplitAmount = (amount, splitTokens, pointsConversionRatio) => {
|
|
184
|
+
if (!Number.isFinite(amount) || !Number.isFinite(splitTokens) || !pointsConversionRatio || !Number.isFinite(pointsConversionRatio)) {
|
|
185
|
+
return amount;
|
|
186
|
+
}
|
|
187
|
+
if (pointsConversionRatio <= 0) return amount;
|
|
188
|
+
const usdCoveredByPoints = splitTokens * pointsConversionRatio;
|
|
189
|
+
const remaining = amount - usdCoveredByPoints;
|
|
190
|
+
return Math.max(0, parseFloat(remaining.toFixed(2)));
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// src/utils/transactionFee.ts
|
|
194
|
+
var getTransactionFee = (amount = 0, transactionFeePercentage) => {
|
|
195
|
+
if (!Number.isFinite(amount) || amount <= 0) return 0;
|
|
196
|
+
if (!Number.isFinite(transactionFeePercentage) || !transactionFeePercentage || transactionFeePercentage <= 0) {
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
const fee = amount * transactionFeePercentage;
|
|
200
|
+
return Math.round((fee + Number.EPSILON) * 100) / 100;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// src/components/CheckoutButton.tsx
|
|
204
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
205
|
+
var CheckoutButton = ({ isLoggedIn }) => {
|
|
206
|
+
const { appProps, staticConfig } = useStaticConfig();
|
|
207
|
+
const { amount, onProcess, isProcessing, transactionFeePercentage } = appProps;
|
|
208
|
+
const { spreePayConfig } = useSpreePayConfig();
|
|
209
|
+
const { env } = useSpreePayEnv();
|
|
210
|
+
const { selectedPaymentMethod, isInternalProcessing } = useSpreePaymentMethod();
|
|
211
|
+
const { splitAmount, type, method } = selectedPaymentMethod;
|
|
212
|
+
const usdAmount = getSplitAmount(amount ?? 0, splitAmount ?? 0, spreePayConfig?.pointsConversionRatio);
|
|
213
|
+
const isDisabled = !amount || !method && usdAmount !== 0 || !!isProcessing || isInternalProcessing || !isLoggedIn;
|
|
214
|
+
const isCC = type === "CREDIT_CARD" /* CREDIT_CARD */;
|
|
215
|
+
const isCrypto = type === "CRYPTO" /* CRYPTO */;
|
|
216
|
+
const getCheckoutContent = () => {
|
|
217
|
+
if (!!isProcessing || isInternalProcessing) {
|
|
218
|
+
return /* @__PURE__ */ jsx5(Spinner, { className: "inline", size: "sm" });
|
|
219
|
+
}
|
|
220
|
+
if (isCC && amount) {
|
|
221
|
+
if (splitAmount && usdAmount) {
|
|
222
|
+
return `Pay ${formatUSD(usdAmount + getTransactionFee(usdAmount, transactionFeePercentage))} + ${formatPoints(splitAmount, spreePayConfig?.pointsTitle)}`;
|
|
223
|
+
}
|
|
224
|
+
if (usdAmount) {
|
|
225
|
+
return `Pay ${formatUSD(usdAmount + getTransactionFee(usdAmount, transactionFeePercentage))}`;
|
|
226
|
+
}
|
|
227
|
+
if (splitAmount) {
|
|
228
|
+
return `Pay ${formatPoints(splitAmount, spreePayConfig?.pointsTitle)}`;
|
|
229
|
+
}
|
|
230
|
+
return "Checkout";
|
|
231
|
+
}
|
|
232
|
+
if (isCrypto && amount) {
|
|
233
|
+
return `Pay ${formatCoin(amount)}`;
|
|
234
|
+
}
|
|
235
|
+
return "Checkout";
|
|
236
|
+
};
|
|
237
|
+
const checkoutClass = "text-(--inverse) h-14 w-full cursor-pointer rounded-4xl bg-(--s-brand) hover:bg-(--s-brand-hover) px-4 text-center text-xl leading-6 font-medium disabled:cursor-not-allowed disabled:bg-(--s-disabled) disabled:text-(--disabled)";
|
|
238
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-col gap-4 bg-(--s-default) p-6 text-xs leading-5 font-medium text-(--secondary) md:px-7", children: [
|
|
239
|
+
/* @__PURE__ */ jsx5(Legal, {}),
|
|
240
|
+
isLoggedIn ? /* @__PURE__ */ jsx5(Fragment, { children: onProcess && /* @__PURE__ */ jsx5("button", { disabled: isDisabled, onClick: onProcess, className: checkoutClass, children: getCheckoutContent() }) }) : /* @__PURE__ */ jsx5(
|
|
241
|
+
"a",
|
|
242
|
+
{
|
|
243
|
+
href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${staticConfig.keycloakClientId}&response_type=code&redirect_uri=${window.location.href}`,
|
|
244
|
+
className: checkoutClass,
|
|
245
|
+
children: "Log in / Sign up for an AIR account"
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
/* @__PURE__ */ jsxs3("a", { href: "https://www.spree.finance/", className: "flex items-center justify-center gap-2 hover:underline", children: [
|
|
249
|
+
/* @__PURE__ */ jsx5("p", { children: "Powered by" }),
|
|
250
|
+
/* @__PURE__ */ jsx5("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", className: "h-[30px]", viewBox: "0 0 66 30", children: /* @__PURE__ */ jsx5(
|
|
251
|
+
"path",
|
|
252
|
+
{
|
|
253
|
+
fill: "currentColor",
|
|
254
|
+
d: "M57.79 25.48a5 5 0 0 1-1.55-.25l.55-1.86q.51.15.92.15c.41 0 .51-.1.72-.26q.32-.24.53-.81l.2-.55-3.65-10.3h2.52l2.32 7.62h.1l2.34-7.62h2.53l-4.04 11.31q-.28.81-.75 1.38t-1.14.88-1.6.3Zm-8.84-3.58a4 4 0 0 1-1.73-.35q-.75-.34-1.2-1.02a3 3 0 0 1-.44-1.67 2.4 2.4 0 0 1 1.18-2.3q.53-.35 1.22-.5.69-.19 1.42-.27l1.44-.16q.56-.08.8-.24.27-.15.26-.5v-.04q0-.75-.44-1.15-.45-.4-1.27-.4-.87 0-1.38.37-.51.39-.69.9l-2.22-.31a3.5 3.5 0 0 1 2.35-2.47 6.3 6.3 0 0 1 3.38-.14q.72.16 1.32.56.6.38.96 1.06.37.66.37 1.67v6.75h-2.29v-1.38h-.08a3 3 0 0 1-1.59 1.37q-.58.21-1.37.22m.62-1.75q.72 0 1.24-.28.53-.3.8-.77.3-.46.3-1.03V16.9q-.11.09-.38.17a18 18 0 0 1-1.8.32q-.54.07-.96.23-.42.17-.66.46t-.24.75q0 .66.48 1t1.22.33ZM34.43 21.7V8.23h5.05q1.55 0 2.6.58 1.05.57 1.6 1.59.54 1 .54 2.28 0 1.3-.55 2.3a4 4 0 0 1-1.6 1.59q-1.07.57-2.63.57H36.1v-2h3.01q.9 0 1.49-.32.57-.32.85-.87.3-.55.29-1.27 0-.71-.29-1.26a2 2 0 0 0-.86-.84 3 3 0 0 0-1.49-.31h-2.23v11.41h-2.44ZM14.54.46a14.54 14.54 0 1 1 0 29.08 14.54 14.54 0 0 1 0-29.08M5.59 18.12l-.84 3.35h.83l.84-3.35zm1.66 0-.83 3.35h1.66l.84-3.35zm3.35-9.58c-1.03 0-2.08.84-2.34 1.87l-1.1 4.4c-.26 1.03.37 1.87 1.4 1.87h9.64l-.34 1.44h-8.1l-.85 3.35h9.6c1.04 0 2.1-.85 2.35-1.89l1.05-4.4c.25-1.03-.38-1.85-1.4-1.85h-9.63l.36-1.44h8.13l.84-3.35zm10.44 0-.84 3.35h1.67l.83-3.35zm2.5 0-.84 3.35h.83l.84-3.35z"
|
|
255
|
+
}
|
|
256
|
+
) })
|
|
257
|
+
] })
|
|
258
|
+
] });
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
// ../ui/src/lib/utils.ts
|
|
262
|
+
import { clsx } from "clsx";
|
|
263
|
+
import { twMerge } from "tailwind-merge";
|
|
264
|
+
function cn2(...inputs) {
|
|
265
|
+
return twMerge(clsx(inputs));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export {
|
|
269
|
+
getTransactionFee,
|
|
270
|
+
getSplitAmount,
|
|
271
|
+
useSlapiBalance,
|
|
272
|
+
formatUSD,
|
|
273
|
+
formatPoints,
|
|
274
|
+
Label,
|
|
275
|
+
PointsSwitch,
|
|
276
|
+
CheckoutButton,
|
|
277
|
+
cn2 as cn
|
|
278
|
+
};
|