@frak-labs/components 0.0.26-beta.5c72d134 → 0.0.26-beta.638e744b
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/cdn/Banner.BrrxJ-YP.js +132 -0
- package/cdn/{ButtonShare.BfQyNjgk.js → ButtonShare.D6sav-O3.js} +1 -1
- package/cdn/{ButtonWallet.DHrL4faA.js → ButtonWallet.DalZLwGv.js} +1 -1
- package/cdn/{OpenInAppButton.BuQXYJth.js → OpenInAppButton.BBj09SVF.js} +1 -1
- package/cdn/{PostPurchase.CpkvA80k.js → PostPurchase.CXHETVu7.js} +2 -2
- package/cdn/components.js +1 -1
- package/cdn/formatReward.CU8k_jx9.js +1 -0
- package/cdn/jsxRuntime.module.D7jbXhdY.js +58 -0
- package/cdn/loader.js +4 -4
- package/cdn/{sprinkles.css.ts.vanilla.BKH7Z6IK.js → sprinkles.css.ts.vanilla.BtNHSSRm.js} +1 -1
- package/cdn/{useLightDomStyles.ICOW93sC.js → useLightDomStyles.x0mCz8nV.js} +1 -1
- package/cdn/useReward.Cbh2WzQ3.js +1 -0
- package/cdn/useShareModal.DsoI-v9u.js +1 -0
- package/dist/banner.js +32 -5
- package/package.json +7 -7
- package/cdn/Banner.BV0CYYyJ.js +0 -132
- package/cdn/formatReward.DXMr8a-D.js +0 -1
- package/cdn/jsxRuntime.module.Cw8k9d3Z.js +0 -58
- package/cdn/useReward.CtWbol8A.js +0 -1
- package/cdn/useShareModal.DBb9gEAh.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./jsxRuntime.module.
|
|
1
|
+
import{t as e}from"./jsxRuntime.module.D7jbXhdY.js";function t(t){return e(`svg`,{viewBox:`0 0 100 100`,fill:`none`,"aria-hidden":`true`,...t,children:[e(`circle`,{cx:`38`,cy:`28`,r:`23`,fill:`#FFF533`}),e(`path`,{d:`M50 38C30 10 12 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`path`,{d:`M50 38C70 10 88 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`rect`,{x:`10`,y:`38`,width:`80`,height:`16`,rx:`2`,stroke:`#222222`,"stroke-width":`4`}),e(`path`,{d:`M15 54V89C15 90.6 16.4 92 18 92H82C83.6 92 85 90.6 85 89V54`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`line`,{x1:`50`,y1:`54`,x2:`50`,y2:`92`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`})]})}const n=`.reset_base__1831jhd0 {
|
|
2
2
|
margin: 0;
|
|
3
3
|
padding: 0;
|
|
4
4
|
border: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./loader.js";import{i as t,l as n}from"./jsxRuntime.module.
|
|
1
|
+
import{t as e}from"./loader.js";import{i as t,l as n}from"./jsxRuntime.module.D7jbXhdY.js";function r(r,i,a,o){n(()=>{e.injectBase(r,o??t)},[r]),n(()=>{!i||!a||e.injectPlacement(r,i,a)},[r,i,a])}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,v as t,x as n}from"./loader.js";import{l as r,s as i}from"./jsxRuntime.module.D7jbXhdY.js";import{t as a}from"./formatReward.CU8k_jx9.js";function o(e,t){switch(e.payoutType){case`fixed`:return e.amount[t];case`tiered`:return e.tiers.reduce((e,n)=>Math.max(e,n.amount[t]),0);case`percentage`:return 0}}function s({rewards:e},r,i){let s=(i?e.filter(e=>e.interactionTypeKey===i):e).map(e=>e.referrer).filter(e=>e!==void 0);if(s.length===0)return;let c=n(t(r)),l=s[0],u=o(l,c);for(let e=1;e<s.length;e++){let t=o(s[e],c);t>u&&(l=s[e],u=t)}if(u<=0){let e=s.find(e=>e.payoutType===`percentage`);if(!e)return;l=e}return a(l,r)}function c(t,n){let[a,o]=i(void 0);return r(()=>{if(!t)return;let r=window.FrakSetup?.client;r&&e(r).then(e=>{let t=r.config.metadata?.currency,i=s(e,t,n);i&&o(i)}).catch(()=>{})},[t,n]),{reward:a}}export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,T as t,s as n,w as r,y as i}from"./loader.js";import{c as a,s as o}from"./jsxRuntime.module.D7jbXhdY.js";function s(s,c,l){let[u,d]=o(void 0),[f,p]=o(!1);return{handleShare:a(async()=>{if(!window.FrakSetup?.client){console.error(`Frak client not found`),d(i.empty().formatDebugInfo(`Frak client not found`)),p(!0);return}let a=n(window.FrakSetup.client,{});try{await a.sharing(l?{link:l}:{}).display(e=>({...e,targetInteraction:s}),c)}catch(n){if(n instanceof t&&n.code===r.clientAborted){console.debug(`User aborted the modal`);return}let i=window.FrakSetup.client.debugInfo.formatDebugInfo(n);e(window.FrakSetup.client,`share_modal_error`,{error:n instanceof Object&&`message`in n?n.message:`Unknown error`,debugInfo:i}),d(i),p(!0),console.error(`Error while opening the modal`,n)}},[s,c,l]),isError:f,debugInfo:u}}export{s as t};
|
package/dist/banner.js
CHANGED
|
@@ -3,7 +3,7 @@ import { t as useLightDomStyles } from "./useLightDomStyles-Cjpf0MnX.js";
|
|
|
3
3
|
import { t as useReward } from "./useReward-XF2hB_C_.js";
|
|
4
4
|
import { i as cssSource$2, n as cssSource$4, r as cssSource$3, t as GiftIcon } from "./GiftIcon-BrNVWoWm.js";
|
|
5
5
|
import { isInAppBrowser, redirectToExternalBrowser } from "@frak-labs/core-sdk";
|
|
6
|
-
import { REFERRAL_SUCCESS_EVENT } from "@frak-labs/core-sdk/actions";
|
|
6
|
+
import { REFERRAL_SUCCESS_EVENT, getMergeToken } from "@frak-labs/core-sdk/actions";
|
|
7
7
|
import { useCallback, useEffect, useMemo, useState } from "preact/hooks";
|
|
8
8
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
9
9
|
//#region src/components/icons/CloseIcon.tsx
|
|
@@ -251,17 +251,44 @@ function Banner({ placement: placementId, classname = "", interaction, referralT
|
|
|
251
251
|
if (isPreview) setMode(resolvedPreviewMode);
|
|
252
252
|
}, [isPreview, resolvedPreviewMode]);
|
|
253
253
|
const { reward } = useReward(mode === "referral" && isClientReady, interaction);
|
|
254
|
+
const [prefetchedMergeToken, setPrefetchedMergeToken] = useState(null);
|
|
255
|
+
useEffect(() => {
|
|
256
|
+
const client = window.FrakSetup?.client;
|
|
257
|
+
if (mode !== "inapp" || isPreview || !isClientReady || !client) return;
|
|
258
|
+
getMergeToken(client).then((token) => setPrefetchedMergeToken(token)).catch(() => {});
|
|
259
|
+
}, [
|
|
260
|
+
mode,
|
|
261
|
+
isPreview,
|
|
262
|
+
isClientReady
|
|
263
|
+
]);
|
|
254
264
|
useEffect(() => {
|
|
255
265
|
if (isPreview || mode === "inapp") return;
|
|
256
266
|
const handler = () => setMode("referral");
|
|
257
267
|
window.addEventListener(REFERRAL_SUCCESS_EVENT, handler);
|
|
258
268
|
return () => window.removeEventListener(REFERRAL_SUCCESS_EVENT, handler);
|
|
259
269
|
}, [isPreview, mode]);
|
|
260
|
-
const handleAction = useCallback(() => {
|
|
270
|
+
const handleAction = useCallback(async () => {
|
|
261
271
|
if (isPreview) return;
|
|
262
|
-
if (mode === "referral")
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
if (mode === "referral") {
|
|
273
|
+
setDismissed(true);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
let mergeToken = prefetchedMergeToken;
|
|
277
|
+
if (!mergeToken && window.FrakSetup?.client) try {
|
|
278
|
+
mergeToken = await getMergeToken(window.FrakSetup?.client);
|
|
279
|
+
} catch {}
|
|
280
|
+
let targetUrl = window.location.href;
|
|
281
|
+
if (mergeToken) {
|
|
282
|
+
const url = new URL(targetUrl);
|
|
283
|
+
url.searchParams.set("fmt", mergeToken);
|
|
284
|
+
targetUrl = url.toString();
|
|
285
|
+
}
|
|
286
|
+
redirectToExternalBrowser(targetUrl);
|
|
287
|
+
}, [
|
|
288
|
+
isPreview,
|
|
289
|
+
mode,
|
|
290
|
+
prefetchedMergeToken
|
|
291
|
+
]);
|
|
265
292
|
const handleDismiss = useCallback(() => {
|
|
266
293
|
if (isPreview) return;
|
|
267
294
|
setDismissed(true);
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.26-beta.
|
|
14
|
+
"version": "0.0.26-beta.638e744b",
|
|
15
15
|
"description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"publish": "echo 'Publishing components...'"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@frak-labs/core-sdk": "0.2.1-beta.
|
|
90
|
-
"@frak-labs/frame-connector": "0.2.0-beta.
|
|
89
|
+
"@frak-labs/core-sdk": "0.2.1-beta.638e744b",
|
|
90
|
+
"@frak-labs/frame-connector": "0.2.0-beta.638e744b",
|
|
91
91
|
"preact": "^10.29.0",
|
|
92
92
|
"preact-custom-element": "^4.6.0",
|
|
93
93
|
"@frak-labs/design-system": "0.0.0"
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@testing-library/preact": "^3.2.4",
|
|
102
102
|
"@testing-library/user-event": "^14.6.1",
|
|
103
103
|
"@types/jsdom": "^28.0.0",
|
|
104
|
-
"@types/node": "^
|
|
104
|
+
"@types/node": "^25.6.0",
|
|
105
105
|
"@types/preact-custom-element": "^4.0.4",
|
|
106
106
|
"@vanilla-extract/css": "^1.20.1",
|
|
107
107
|
"@vanilla-extract/integration": "^8.0.10",
|
|
@@ -110,8 +110,8 @@
|
|
|
110
110
|
"@vitest/coverage-v8": "^4.1.0",
|
|
111
111
|
"@vitest/ui": "^4.1.0",
|
|
112
112
|
"jsdom": "^29.0.0",
|
|
113
|
-
"tsdown": "^0.21.
|
|
114
|
-
"typescript": "^
|
|
115
|
-
"vitest": "^4.1.
|
|
113
|
+
"tsdown": "^0.21.8",
|
|
114
|
+
"typescript": "^6.0.2",
|
|
115
|
+
"vitest": "^4.1.4"
|
|
116
116
|
}
|
|
117
117
|
}
|
package/cdn/Banner.BV0CYYyJ.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import{f as e,m as t,p as n}from"./loader.js";import{a as r,c as i,l as a,n as o,o as s,s as c,t as l,u}from"./jsxRuntime.module.Cw8k9d3Z.js";import{t as ee}from"./useLightDomStyles.ICOW93sC.js";import{t as te}from"./useReward.CtWbol8A.js";import{i as d,n as f,r as p,t as m}from"./sprinkles.css.ts.vanilla.BKH7Z6IK.js";function h(e){return l(`svg`,{width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,"aria-hidden":`true`,...e,children:l(`path`,{d:`M7.33301 0C11.383 0 14.6668 3.28307 14.667 7.33301C14.667 11.3831 11.3831 14.667 7.33301 14.667C3.28307 14.6668 0 11.383 0 7.33301C0.000175746 3.28318 3.28318 0.000175742 7.33301 0ZM10.3896 4.27734C10.151 4.0388 9.76303 4.03775 9.52441 4.27637L7.33301 6.46777L5.14258 4.27637C4.90397 4.03776 4.51601 4.03882 4.27734 4.27734C4.03869 4.516 4.03771 4.90392 4.27637 5.14258L6.4668 7.33398L4.27637 9.52441C4.03807 9.76306 4.03891 10.1511 4.27734 10.3896C4.51589 10.6282 4.9039 10.629 5.14258 10.3906L7.33301 8.2002L9.52344 10.3906C9.76198 10.629 10.15 10.6279 10.3887 10.3896C10.6273 10.151 10.6283 9.76209 10.3896 9.52344L8.2002 7.33398L10.3906 5.14258C10.6293 4.90392 10.6283 4.516 10.3896 4.27734Z`,fill:`currentColor`})})}function g(e){return l(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,...e,children:l(`path`,{d:`M5.45508 0C5.75614 0.000209333 6 0.244788 6 0.545898C5.99979 0.846831 5.75601 1.09159 5.45508 1.0918H4.36426C3.05445 1.0918 2.27964 1.35707 1.81836 1.81836C1.35714 2.27966 1.0918 3.05454 1.0918 4.36426V7.63672C1.09186 8.94625 1.35713 9.72139 1.81836 10.1826C2.2797 10.6436 3.05488 10.9092 4.36426 10.9092H7.63672C8.94628 10.9091 9.72135 10.6438 10.1826 10.1826C10.6438 9.72139 10.9091 8.94625 10.9092 7.63672V6.5459C10.9092 6.24466 11.1538 6 11.4551 6C11.7561 6.00028 12 6.24483 12 6.5459V7.63672C11.9999 9.05391 11.72 10.1882 10.9541 10.9541C10.1882 11.7199 9.05394 12 7.63672 12H4.36426C2.94714 12 1.81283 11.7197 1.04688 10.9541C0.280997 10.1882 6.04321e-05 9.05391 0 7.63672V4.36426C0 2.94692 0.28099 1.81283 1.04688 1.04688C1.81284 0.280915 2.94686 0 4.36426 0H5.45508ZM11.4541 0C11.7553 2.20143e-05 11.999 0.244672 11.999 0.545898V3.16406C11.9988 3.46509 11.7552 3.70896 11.4541 3.70898C11.1532 3.70873 10.9084 3.46495 10.9082 3.16406V1.8623L6.93066 5.83984C6.71766 6.05283 6.37218 6.05283 6.15918 5.83984C5.94657 5.62681 5.94632 5.28124 6.15918 5.06836L10.1357 1.0918H8.83594C8.53504 1.09154 8.29025 0.846803 8.29004 0.545898C8.29004 0.244816 8.53491 0.000254588 8.83594 0H11.4541Z`,fill:`currentColor`})})}function _(e){return l(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,...e,children:l(`path`,{d:`M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5ZM8.10352 10.207C8.82025 10.2071 9.23531 10.6346 9.23535 11.3262C9.23535 12.0304 8.82028 12.4579 8.10352 12.458C7.36167 12.4579 6.97168 12.0304 6.97168 11.3262C6.97172 10.6346 7.36171 10.2072 8.10352 10.207ZM8.84766 3.54102C9.01311 3.54121 9.14736 3.67535 9.14746 3.84082V4.74805L8.84375 8.37012C8.83069 8.52552 8.6999 8.64551 8.54395 8.64551H7.62891C7.47133 8.64523 7.34074 8.52251 7.33008 8.36523L7.08496 4.74805V3.84082C7.08507 3.67533 7.2193 3.54119 7.38477 3.54102H8.84766Z`,fill:`currentColor`})})}var v=`Banner_iconSvg__1gnumzi2`,y=`Banner_inapp__1gnumzi9 reset_base__1831jhd0 Banner_rootBase__1gnumzi1`,b=`Banner_inappClose__1gnumzif reset_element_button__1831jhd6 reset_fieldAppearance__1831jhd2 reset_focusRing__1831jhd1`,x=`Banner_inappCta__1gnumzie reset_element_button__1831jhd6 reset_fieldAppearance__1831jhd2 reset_focusRing__1831jhd1`,S=`Banner_inappDescription__1gnumzid reset_base__1831jhd0`,C=`Banner_inappHeader__1gnumzia`,ne=`Banner_inappIconWrapper__1gnumzib`,w=`Banner_inappTitle__1gnumzic reset_base__1831jhd0`,T=`Banner_referral__1gnumzi3 reset_base__1831jhd0 Banner_rootBase__1gnumzi1`,E=`Banner_referralBody__1gnumzi5`,D=`Banner_referralCta__1gnumzi8 reset_element_button__1831jhd6 reset_fieldAppearance__1831jhd2 reset_focusRing__1831jhd1`,O=`Banner_referralDescription__1gnumzi7 reset_base__1831jhd0`,k=`Banner_referralIconWrapper__1gnumzi4`,A=`Banner_referralTitle__1gnumzi6 reset_base__1831jhd0`;const j=p+f+m+`@keyframes Banner_fadeIn__1gnumzi0 {
|
|
2
|
-
from {
|
|
3
|
-
opacity: 0;
|
|
4
|
-
transform: translateY(-4px);
|
|
5
|
-
}
|
|
6
|
-
to {
|
|
7
|
-
opacity: 1;
|
|
8
|
-
transform: translateY(0);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
.Banner_rootBase__1gnumzi1 {
|
|
12
|
-
position: relative;
|
|
13
|
-
display: flex;
|
|
14
|
-
animation: Banner_fadeIn__1gnumzi0 300ms ease-out;
|
|
15
|
-
}
|
|
16
|
-
.Banner_iconSvg__1gnumzi2 {
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 100%;
|
|
19
|
-
}
|
|
20
|
-
.Banner_referral__1gnumzi3 {
|
|
21
|
-
flex-direction: row;
|
|
22
|
-
align-items: center;
|
|
23
|
-
gap: 16px;
|
|
24
|
-
padding: 16px;
|
|
25
|
-
background-color: #ffffff;
|
|
26
|
-
color: var(--text-primary__pbq4ak0);
|
|
27
|
-
}
|
|
28
|
-
.Banner_referralIconWrapper__1gnumzi4 {
|
|
29
|
-
flex-shrink: 0;
|
|
30
|
-
align-self: flex-start;
|
|
31
|
-
width: 40px;
|
|
32
|
-
height: 40px;
|
|
33
|
-
}
|
|
34
|
-
.Banner_referralBody__1gnumzi5 {
|
|
35
|
-
flex: 1;
|
|
36
|
-
min-width: 0;
|
|
37
|
-
}
|
|
38
|
-
.Banner_referralTitle__1gnumzi6 {
|
|
39
|
-
font-size: 16px;
|
|
40
|
-
font-weight: 600;
|
|
41
|
-
color: var(--text-primary__pbq4ak0);
|
|
42
|
-
line-height: 22px;
|
|
43
|
-
}
|
|
44
|
-
.Banner_referralDescription__1gnumzi7 {
|
|
45
|
-
margin-bottom: 8px;
|
|
46
|
-
font-size: 14px;
|
|
47
|
-
color: #979797;
|
|
48
|
-
line-height: 22px;
|
|
49
|
-
}
|
|
50
|
-
.Banner_referralCta__1gnumzi8 {
|
|
51
|
-
display: inline-block;
|
|
52
|
-
padding: 8px 16px;
|
|
53
|
-
border: 1px solid #000000;
|
|
54
|
-
border-radius: 9999px;
|
|
55
|
-
color: var(--text-primary__pbq4ak0);
|
|
56
|
-
font-size: 10px;
|
|
57
|
-
font-weight: 700;
|
|
58
|
-
line-height: 12px;
|
|
59
|
-
text-transform: uppercase;
|
|
60
|
-
}
|
|
61
|
-
.Banner_referralCta__1gnumzi8:focus-visible {
|
|
62
|
-
outline: 2px solid #000000;
|
|
63
|
-
outline-offset: 2px;
|
|
64
|
-
}
|
|
65
|
-
.Banner_inapp__1gnumzi9 {
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
gap: 4px;
|
|
68
|
-
padding: 12px 16px;
|
|
69
|
-
padding-right: 32px;
|
|
70
|
-
border-radius: 12px;
|
|
71
|
-
background-color: #000000CC;
|
|
72
|
-
backdrop-filter: blur(12px);
|
|
73
|
-
-webkit-backdrop-filter: blur(12px);
|
|
74
|
-
color: #ffffff;
|
|
75
|
-
}
|
|
76
|
-
.Banner_inappHeader__1gnumzia {
|
|
77
|
-
display: flex;
|
|
78
|
-
align-items: center;
|
|
79
|
-
gap: 8px;
|
|
80
|
-
}
|
|
81
|
-
.Banner_inappIconWrapper__1gnumzib {
|
|
82
|
-
flex-shrink: 0;
|
|
83
|
-
width: 20px;
|
|
84
|
-
height: 20px;
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
justify-content: center;
|
|
88
|
-
color: #ffffff;
|
|
89
|
-
}
|
|
90
|
-
.Banner_inappTitle__1gnumzic {
|
|
91
|
-
font-size: 16px;
|
|
92
|
-
font-weight: 500;
|
|
93
|
-
line-height: 26px;
|
|
94
|
-
color: var(--text-onAction__pbq4ak6);
|
|
95
|
-
}
|
|
96
|
-
.Banner_inappDescription__1gnumzid {
|
|
97
|
-
font-size: 14px;
|
|
98
|
-
color: var(--text-onAction__pbq4ak6);
|
|
99
|
-
line-height: 22px;
|
|
100
|
-
opacity: 0.96;
|
|
101
|
-
}
|
|
102
|
-
.Banner_inappCta__1gnumzie {
|
|
103
|
-
display: inline-flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
gap: 4px;
|
|
106
|
-
color: #2BB2FF;
|
|
107
|
-
font-size: 14px;
|
|
108
|
-
font-weight: 600;
|
|
109
|
-
text-decoration: underline;
|
|
110
|
-
text-underline-offset: 2px;
|
|
111
|
-
}
|
|
112
|
-
.Banner_inappCta__1gnumzie:focus-visible {
|
|
113
|
-
outline: 2px solid #2BB2FF;
|
|
114
|
-
outline-offset: 2px;
|
|
115
|
-
border-radius: 4px;
|
|
116
|
-
}
|
|
117
|
-
.Banner_inappClose__1gnumzif {
|
|
118
|
-
position: absolute;
|
|
119
|
-
top: 8px;
|
|
120
|
-
right: 8px;
|
|
121
|
-
width: 28px;
|
|
122
|
-
height: 28px;
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
justify-content: center;
|
|
126
|
-
border-radius: 9999px;
|
|
127
|
-
color: rgba(255, 255, 255, 0.6);
|
|
128
|
-
}
|
|
129
|
-
.Banner_inappClose__1gnumzif:focus-visible {
|
|
130
|
-
outline: 2px solid #ffffff;
|
|
131
|
-
outline-offset: 2px;
|
|
132
|
-
}`;function M({placement:u,classname:f=``,interaction:p,referralTitle:m,referralDescription:M,referralCta:N,inappTitle:P,inappDescription:F,inappCta:I,preview:L,previewMode:R}){let z=!!L,B=R===`inapp`?`inapp`:`referral`,V=o(u),{shouldRender:H,isHidden:U,isClientReady:W}=r();ee(`frak-banner`,u,V?.components?.banner?.css,j);let[G,K]=c(!1),[q,J]=c(()=>z?B:t?`inapp`:null);a(()=>{z&&J(B)},[z,B]);let{reward:Y}=te(q===`referral`&&W,p);a(()=>{if(z||q===`inapp`)return;let t=()=>J(`referral`);return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[z,q]);let X=i(()=>{z||(q===`referral`?K(!0):n(window.location.href))},[z,q]),re=i(()=>{z||K(!0)},[z]),Z=V?.components?.banner,Q=s(()=>{if(q===`referral`){let e=Y?`Earn ${Y} on purchases on this site`:`You've been referred!`;return{title:m??Z?.referralTitle??e,description:M??Z?.referralDescription??`Earn rewards after your purchase via the Frak partner app.`,cta:N??Z?.referralCta??`Got it`}}return{title:P??Z?.inappTitle??`Open in your browser`,description:F??Z?.inappDescription??`For a better experience and to earn your rewards, open this page in your default browser.`,cta:I??Z?.inappCta??`Open browser`}},[q,Y,Z,m,M,N,P,F,I]);if(!q||!z&&(!H||U||G))return null;let $=[q===`inapp`?y:T,`frak-banner`,`frak-banner--${q}`,f].filter(Boolean).join(` `);return q===`inapp`?l(`div`,{class:$,role:`alert`,children:[l(`div`,{class:C,children:[l(`span`,{class:`${ne} frak-banner__icon`,children:l(_,{})}),l(`p`,{class:`${w} frak-banner__title`,children:Q.title})]}),l(`p`,{class:`${S} frak-banner__description`,children:Q.description}),l(`button`,{type:`button`,class:`${x} frak-banner__cta`,onClick:X,children:[Q.cta,l(g,{})]}),l(`button`,{type:`button`,class:`${b} frak-banner__close`,onClick:re,"aria-label":`Dismiss`,children:l(h,{})})]}):l(`div`,{class:$,role:`alert`,children:[l(`div`,{class:`${k} frak-banner__icon`,children:l(d,{class:v})}),l(`div`,{class:`${E} frak-banner__text`,children:[l(`p`,{class:`${A} frak-banner__title`,children:Q.title}),l(`p`,{class:`${O} frak-banner__description`,children:Q.description}),l(`button`,{type:`button`,class:`${D} frak-banner__cta`,onClick:X,children:Q.cta})]})]})}u(M,`frak-banner`,[`placement`,`classname`,`interaction`,`referralTitle`,`referralDescription`,`referralCta`,`inappTitle`,`inappDescription`,`inappCta`,`preview`,`previewMode`],{shadow:!1});export{M as Banner};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,h as n}from"./loader.js";function r(r,i,a){let o=e(i),s=t(o);switch(r.payoutType){case`fixed`:return n(Math.round(r.amount[s]),o);case`percentage`:return a===void 0?`${r.percent} %`:n(Math.round(r.percent*a/100),o);case`tiered`:{let e=r.tiers.reduce((e,t)=>Math.max(e,t.amount[s]),0);return n(Math.round(e),o)}}}export{r as t};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,x as r}from"./loader.js";var i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function x(e,t,n){var r,a,o,s={};for(o in t)o==`key`?r=t[o]:o==`ref`?a=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return S(e,s,r,a,null)}function S(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++o,__i:-1,__u:0};return i==null&&a.vnode!=null&&a.vnode(s),s}function C(e){return e.children}function w(e,t){this.props=e,this.context=t}function T(e,t){if(t==null)return e.__?T(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?T(e):null}function E(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=y({},t);o.__v=t.__v+1,a.vnode&&a.vnode(o),F(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??T(t),!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,re(r,o,i),t.__e=t.__=null,o.__e!=n&&D(o)}}function D(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),D(e)}function O(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!k.__r++||c!=a.debounceRendering)&&((c=a.debounceRendering)||l)(k)}function k(){try{for(var e,t=1;s.length;)s.length>t&&s.sort(u),e=s.shift(),t=s.length,E(e)}finally{s.length=k.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y,b=r&&r.__k||g,x=t.length;for(c=A(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||h,p.__i=d,v=F(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&L(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_==null&&m!=null&&(_=m),(y=!!(4&p.__u))||f.__k===p.__k?c=j(p,c,e,y):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function A(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=S(null,o,null,null,null):v(o)?o=e.__k[a]=S(C,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=S(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=te(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=T(s)),oe(s,s));return r}function j(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=j(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=T(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function M(e,t){return t||=[],e==null||typeof e==`boolean`||(v(e)?e.some(function(e){M(e,t)}):t.push(e)),t}function te(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ne(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||_.test(t)?n:n+`px`}function N(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ne(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ne(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(d,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=f,e.addEventListener(t,a?m:p,a)):e.removeEventListener(t,a?m:p,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function P(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=f++;else if(t.t<n.u)return;return n(a.event?a.event(t):t)}}}function F(e,t,n,r,i,o,s,c,l,u){var d,f,p,m,h,_,x,S,T,E,D,O,k,A,j,M=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[c=t.__e=n.__e]),(d=a.__b)&&d(t);n:if(typeof M==`function`)try{if(S=t.props,T=M.prototype&&M.prototype.render,E=(d=M.contextType)&&r[d.__c],D=d?E?E.props.value:d.__:r,n.__c?x=(f=t.__c=n.__c).__=f.__E:(T?t.__c=f=new M(S,D):(t.__c=f=new w(S,D),f.constructor=M,f.render=se),E&&E.sub(f),f.state||={},f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),T&&f.__s==null&&(f.__s=f.state),T&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=y({},f.__s)),y(f.__s,M.getDerivedStateFromProps(S,f.__s))),m=f.props,h=f.state,f.__v=t,p)T&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),T&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(T&&M.getDerivedStateFromProps==null&&S!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(S,D),t.__v==n.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(S,f.__s,D)){t.__v!=n.__v&&(f.props=S,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(S,f.__s,D),T&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,_)})}if(f.context=D,f.props=S,f.__P=e,f.__e=!1,O=a.__r,k=0,T)f.state=f.__s,f.__d=!1,O&&O(t),d=f.render(f.props,f.state,f.context),g.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,O&&O(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++k<25);f.state=f.__s,f.getChildContext!=null&&(r=y(y({},r),f.getChildContext())),T&&!p&&f.getSnapshotBeforeUpdate!=null&&(_=f.getSnapshotBeforeUpdate(m,h)),A=d!=null&&d.type===C&&d.key==null?ie(d.props.children):d,c=ee(e,v(A)?A:[A],t,n,r,i,o,s,c,l,u),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),x&&(f.__E=f.__=null)}catch(e){if(t.__v=null,l||o!=null)if(e.then){for(t.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else{for(j=o.length;j--;)b(o[j]);I(t)}else t.__e=n.__e,t.__k=n.__k,e.then||I(t);a.__e(e,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=ae(n.__e,t,n,r,i,o,s,l,u);return(d=a.diffed)&&d(t),128&t.__u?void 0:c}function I(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(I))}function re(e,t,n){for(var r=0;r<n.length;r++)L(n[r],n[++r],n[++r]);a.__c&&a.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){a.__e(e,t.__v)}})}function ie(e){return typeof e!=`object`||!e||e.__b>0?e:v(e)?e.map(ie):y({},e)}function ae(e,t,n,r,o,s,c,l,u){var d,f,p,m,g,_,y,x=n.props||h,S=t.props,C=t.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){e=g,s[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(S);e=document.createElementNS(o,C,S.is&&S),l&&=(a.__m&&a.__m(t,s),!1),s=null}if(C==null)x===S||l&&e.data==S||(e.data=S);else{if(s&&=i.call(e.childNodes),!l&&s!=null)for(x={},d=0;d<e.attributes.length;d++)x[(g=e.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||N(e,d,null,g,o);for(d in S)g=S[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?_=g:d==`checked`?y=g:l&&typeof g!=`function`||x[d]===g||N(e,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(p&&(e.innerHTML=``),ee(t.type==`template`?e.content:e,v(m)?m:[m],t,n,r,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:n.__k&&T(n,0),l,u),s!=null)for(d=s.length;d--;)b(s[d]);l||(d=`value`,C==`progress`&&_==null?e.removeAttribute(`value`):_!=null&&(_!==e[d]||C==`progress`&&!_||C==`option`&&_!=x[d])&&N(e,d,_,x[d],o),d=`checked`,y!=null&&y!=e[d]&&N(e,d,y,x[d],o))}return e}function L(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){a.__e(e,n)}}function oe(e,t,n){var r,i;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||L(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){a.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&oe(r[i],t,n||typeof e.type!=`function`);n||b(e.__e),e.__c=e.__=e.__e=void 0}function se(e,t,n){return this.constructor(e,n)}function R(e,t,n){var r,o,s,c;t==document&&(t=document.documentElement),a.__&&a.__(e,t),o=(r=typeof n==`function`)?null:n&&n.__k||t.__k,s=[],c=[],F(t,e=(!r&&n||t).__k=x(C,null,[e]),o||h,h,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?i.call(t.childNodes):null,s,!r&&n?n:o?o.__e:t.firstChild,r,c),re(s,e,c)}function z(e,t){R(e,t,z)}function B(e,t,n){var r,a,o,s,c=y({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)o==`key`?r=t[o]:o==`ref`?a=t[o]:c[o]=t[o]===void 0&&s!=null?s[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?i.call(arguments,2):n),S(e.type,c,r||e.key,a||e.ref,null)}i=g.slice,a={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},o=0,w.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=y({},this.state);typeof e==`function`&&(e=e(y({},n),this.props)),e&&y(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),O(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},w.prototype.render=C,s=[],l=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},k.__r=0,d=/(PointerCapture)$|Capture$/i,f=0,p=P(!1),m=P(!0);function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function H(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}var ce=[`context`,`children`],le=[`useFragment`];function ue(e,t,n,r){function i(){var t,n=Reflect.construct(HTMLElement,[],i);return n._vdomComponent=e,r&&r.shadow?(n._root=n.attachShadow({mode:r.mode||`open`,serializable:(t=r.serializable)!=null&&t}),r.adoptedStyleSheets&&(n._root.adoptedStyleSheets=r.adoptedStyleSheets)):n._root=n,n}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=function(){fe.call(this,r)},i.prototype.attributeChangedCallback=me,i.prototype.disconnectedCallback=he,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,e.formAssociated&&(i.formAssociated=!0),n.forEach(function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||={},this._props[e]=t);var n=typeof t;t!=null&&n!==`string`&&n!==`boolean`&&n!==`number`||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,i),i}function de(e){this.getChildContext=function(){return e.context};var t=e.children;return B(t,H(e,ce))}function fe(e){var t=new CustomEvent(`_preact`,{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=x(de,V({},this._props,{context:t.detail.context}),_e(this,this._vdomComponent,e)),(this.hasAttribute(`hydrate`)?z:R)(this._vdom,this._root)}function pe(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():``})}function me(e,t,n){if(this._vdom){var r={};r[e]=n??=void 0,r[pe(e)]=n,this._vdom=B(this._vdom,r),R(this._vdom,this._root)}}function he(){R(this._vdom=null,this._root)}function ge(e,t){var n=this,r=e.useFragment,i=H(e,le);return x(r?C:`slot`,V({},i,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener(`_preact`,n._listener))):n.ref.removeEventListener(`_preact`,n._listener)}}))}function _e(e,t,n){if(e.nodeType===3)return e.data;if(e.nodeType!==1)return null;var r=[],i={},a=0,o=e.attributes,s=e.childNodes;for(a=o.length;a--;)o[a].name!==`slot`&&(i[o[a].name]=o[a].value,i[pe(o[a].name)]=o[a].value);for(a=s.length;a--;){var c=_e(s[a],null,n),l=s[a].slot;l?i[l]=x(ge,{name:l},c):r[a]=c}var u=!(!n||!n.shadow),d=t?x(ge,{useFragment:!u},r):r;return!u&&t&&(e.innerHTML=``),x(t||e.nodeName.toLowerCase(),i,d)}function ve(e,r,i=[],a={shadow:!0}){typeof window<`u`&&(t(n),customElements.get(r)||ue(e,r,i,a))}var U,W,G,ye,K=0,be=[],q=a,xe=q.__b,Se=q.__r,Ce=q.diffed,we=q.__c,Te=q.unmount,Ee=q.__;function J(e,t){q.__h&&q.__h(W,e,K||t),K=0;var n=W.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function Y(e){return K=1,De(Ne,e)}function De(e,t,n){var r=J(U++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ne(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=W,!W.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};W.__f=!0;var a=W.shouldComponentUpdate,o=W.componentWillUpdate;W.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},W.shouldComponentUpdate=i}return r.__N||r.__}function X(e,t){var n=J(U++,3);!q.__s&&Me(n.__H,t)&&(n.__=e,n.u=t,W.__H.__h.push(n))}function Z(e,t){var n=J(U++,7);return Me(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Oe(e,t){return K=8,Z(function(){return e},t)}function ke(){for(var e;e=be.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Q),t.__h.some($),t.__h=[]}catch(n){t.__h=[],q.__e(n,e.__v)}}}q.__b=function(e){W=null,xe&&xe(e)},q.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ee&&Ee(e,t)},q.__r=function(e){Se&&Se(e),U=0;var t=(W=e.__c).__H;t&&(G===W?(t.__h=[],W.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Q),t.__h.some($),t.__h=[],U=0)),G=W},q.diffed=function(e){Ce&&Ce(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(be.push(t)!==1&&ye===q.requestAnimationFrame||((ye=q.requestAnimationFrame)||je)(ke)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),G=W=null},q.__c=function(e,t){t.some(function(e){try{e.__h.some(Q),e.__h=e.__h.filter(function(e){return!e.__||$(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],q.__e(n,e.__v)}}),we&&we(e,t)},q.unmount=function(e){Te&&Te(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Q(e)}catch(e){t=e}}),n.__H=void 0,t&&q.__e(t,n.__v))};var Ae=typeof requestAnimationFrame==`function`;function je(e){var t,n=function(){clearTimeout(r),Ae&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ae&&(t=requestAnimationFrame(n))}function Q(e){var t=W,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),W=t}function $(e){var t=W;e.__c=e.__(),W=t}function Me(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Ne(e,t){return typeof t==`function`?t(e):t}function Pe(){let[t,n]=Y(()=>window.FrakSetup?.config?.waitForBackendConfig===!1?!0:r.isResolved),[i,a]=Y(()=>r.getConfig().hidden??!1),[o,s]=Y(()=>!!window.FrakSetup?.client);return X(()=>{let t=r.getConfig();t.isResolved&&(n(!0),a(t.hidden??!1)),window.FrakSetup?.client&&s(!0);let i=e=>{let t=e.detail;t.isResolved&&n(!0),a(t.hidden??!1)};window.addEventListener(`frak:config`,i);let o=()=>s(!0);return e(`add`,o),()=>{window.removeEventListener(`frak:config`,i),e(`remove`,o)}},[]),{shouldRender:t,isHidden:i,isClientReady:o}}const Fe=`
|
|
2
|
-
:host {
|
|
3
|
-
display: contents;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
:host([hidden]) {
|
|
7
|
-
display: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.button:disabled {
|
|
11
|
-
opacity: 0.7;
|
|
12
|
-
cursor: default;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.button__fadeIn {
|
|
16
|
-
animation: frak-fadeIn 300ms ease-in;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@keyframes frak-fadeIn {
|
|
20
|
-
from {
|
|
21
|
-
opacity: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
to {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`;function Ie(e,t){return t?`${Fe}\n${e}\n${t}`:`${Fe}\n${e}`}const Le=`
|
|
29
|
-
:where(frak-button-share, frak-open-in-app) {
|
|
30
|
-
display: contents;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:where(frak-button-share .button, frak-open-in-app .button) {
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
gap: 10px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:where(frak-button-share .button:disabled, frak-open-in-app .button:disabled) {
|
|
41
|
-
opacity: 0.7;
|
|
42
|
-
cursor: default;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:where(frak-button-share .button__fadeIn, frak-open-in-app .button__fadeIn) {
|
|
46
|
-
animation: frak-fadeIn 300ms ease-in;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@keyframes frak-fadeIn {
|
|
50
|
-
from {
|
|
51
|
-
opacity: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
to {
|
|
55
|
-
opacity: 1;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
`;function Re(e){return r.getConfig().placements?.[e]}function ze(e){let[t,n]=Y(0);return X(()=>{let e=e=>{n(e=>e+1)};return window.addEventListener(`frak:config`,e),n(e=>e+1),()=>window.removeEventListener(`frak:config`,e)},[]),Z(()=>e?Re(e):void 0,[e,t])}var Be=0;Array.isArray;function Ve(e,t,n,r,i,o){t||={};var s,c,l=t;if(`ref`in l)for(c in l={},t)c==`ref`?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Be,__i:-1,__u:0,__source:i,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return a.vnode&&a.vnode(u),u}export{Pe as a,Oe as c,M as d,x as f,w as h,Le as i,X as l,a as m,ze as n,Z as o,C as p,Ie as r,Y as s,Ve as t,ve as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,l as n}from"./loader.js";import{l as r,s as i}from"./jsxRuntime.module.Cw8k9d3Z.js";import{t as a}from"./formatReward.DXMr8a-D.js";function o(e,t){switch(e.payoutType){case`fixed`:return e.amount[t];case`tiered`:return e.tiers.reduce((e,n)=>Math.max(e,n.amount[t]),0);case`percentage`:return 0}}function s({rewards:n},r,i){let s=(i?n.filter(e=>e.interactionTypeKey===i):n).map(e=>e.referrer).filter(e=>e!==void 0);if(s.length===0)return;let c=t(e(r)),l=s[0],u=o(l,c);for(let e=1;e<s.length;e++){let t=o(s[e],c);t>u&&(l=s[e],u=t)}if(u<=0){let e=s.find(e=>e.payoutType===`percentage`);if(!e)return;l=e}return a(l,r)}function c(e,t){let[a,o]=i(void 0);return r(()=>{if(!e)return;let r=window.FrakSetup?.client;r&&n(r).then(e=>{let n=r.config.metadata?.currency,i=s(e,n,t);i&&o(i)}).catch(()=>{})},[e,t]),{reward:a}}export{c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,S as t,u as n,v as r,w as i}from"./loader.js";import{c as a,s as o}from"./jsxRuntime.module.Cw8k9d3Z.js";function s(s,c,l){let[u,d]=o(void 0),[f,p]=o(!1);return{handleShare:a(async()=>{if(!window.FrakSetup?.client){console.error(`Frak client not found`),d(r.empty().formatDebugInfo(`Frak client not found`)),p(!0);return}let a=n(window.FrakSetup.client,{});try{await a.sharing(l?{link:l}:{}).display(e=>({...e,targetInteraction:s}),c)}catch(n){if(n instanceof i&&n.code===e.clientAborted){console.debug(`User aborted the modal`);return}let r=window.FrakSetup.client.debugInfo.formatDebugInfo(n);t(window.FrakSetup.client,`share_modal_error`,{error:n instanceof Object&&`message`in n?n.message:`Unknown error`,debugInfo:r}),d(r),p(!0),console.error(`Error while opening the modal`,n)}},[s,c,l]),isError:f,debugInfo:u}}export{s as t};
|