@frak-labs/components 1.4.0 → 1.5.0
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/Ambassador.CZAN1-jx.js +519 -0
- package/cdn/Banner.2WJ4pT6E.js +227 -0
- package/cdn/{ButtonShare.C7A2tEvB.js → ButtonShare.DSGvJfJ-.js} +1 -1
- package/cdn/{ButtonWallet.Cg2OK1di.js → ButtonWallet.DHpHCl4c.js} +2 -2
- package/cdn/GiftIcon.DYg5xgHg.js +1 -0
- package/cdn/InstallQr.CHImaq56.js +1 -0
- package/cdn/{OpenInAppButton.Djz_cb9Y.js → OpenInAppButton.CxBzRNKw.js} +1 -1
- package/cdn/PostPurchase.CVZlV54f.js +124 -0
- package/cdn/RewardReminder.C6o8lgak.js +369 -0
- package/cdn/components.js +1 -1
- package/cdn/format.D2Ai5cCn.js +1 -0
- package/cdn/{GiftIcon.CW1SwrXH.js → icons.CdzHzZIJ.js} +1 -1
- package/cdn/jsxRuntime.module.7FJBZ9bf.js +58 -0
- package/cdn/loader.js +20 -16
- package/cdn/mountRewardReminder.BlmSRJDe.js +1 -0
- package/cdn/previewSummary.DxyobqED.js +1 -0
- package/cdn/rewardSummaryStore.DyjI-vPH.js +1 -0
- package/cdn/{rewards.t-rH9M3s.js → rewards.CeNLrK54.js} +1 -1
- package/cdn/useGlobalComponents.CNnOzerU.js +1 -0
- package/cdn/{useLightDomStyles.B72V1WPK.js → useLightDomStyles.557xWurb.js} +1 -1
- package/cdn/usePlacement.DYgmdkfr.js +1 -0
- package/cdn/{useReward.D2kXQbtD.js → useReward.BzUL3ijd.js} +1 -1
- package/dist/GiftIcon-Csu31jtf.js +62 -0
- package/dist/InstallQr-kpb44cfg.js +84 -0
- package/dist/ambassador.d.ts +16 -1
- package/dist/ambassador.js +534 -178
- package/dist/banner.d.ts +20 -6
- package/dist/banner.js +235 -13
- package/dist/format-zGdbUoX_.js +283 -0
- package/dist/i18n/defaults.d.ts +72 -0
- package/dist/i18n/defaults.js +108 -6
- package/dist/{GiftIcon-B9k_syq6.js → icons-iN3qH_Bv.js} +1 -61
- package/dist/postPurchase.d.ts +6 -1
- package/dist/postPurchase.js +187 -33
- package/dist/previewSummary-CMc6q8vI.js +37 -0
- package/dist/rewardReminder.d.ts +50 -0
- package/dist/rewardReminder.js +809 -0
- package/dist/{sharedBaseCss.css-nYy9vlzH.js → sharedBaseCss.css-D2HG4Ty8.js} +1 -1
- package/package.json +17 -11
- package/cdn/Ambassador.BDu4aVZ9.js +0 -392
- package/cdn/Banner.BqfCxKs3.js +0 -208
- package/cdn/PostPurchase.DIZneqoT.js +0 -102
- package/cdn/jsxRuntime.module.DWH-kRVd.js +0 -58
- package/cdn/useGlobalComponents.DVgSWfOp.js +0 -1
- package/cdn/usePlacement.DEOEf5_6.js +0 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import{a as e,c as t,f as n,g as r,h as i,l as a,m as o,n as s,t as c,u as l}from"./jsxRuntime.module.7FJBZ9bf.js";import{E as u,P as d,b as f,l as p,m,o as h,p as g,r as _}from"./loader.js";import{i as v}from"./rewards.CeNLrK54.js";import{i as y,n as ee,r as b,t as x}from"./icons.CdzHzZIJ.js";import{t as S}from"./useGlobalComponents.CNnOzerU.js";import{t as C}from"./useLightDomStyles.557xWurb.js";import{t as w}from"./usePlacement.DYgmdkfr.js";import{t as T}from"./useReward.BzUL3ijd.js";import{t as te}from"./GiftIcon.DYg5xgHg.js";import{a as E,l as D,n as O,o as k,r as A,s as j,t as ne,u as M}from"./format.D2Ai5cCn.js";import{n as re,t as N}from"./previewSummary.DxyobqED.js";import{i as P,n as F,o as I}from"./rewardSummaryStore.DyjI-vPH.js";var L=`inAppBanner_body__1ibpiy74`,R=`inAppBanner_closeButton__1ibpiy77`,ie=`inAppBanner_container__1ibpiy70`,z=`inAppBanner_cta__1ibpiy76`,B=`inAppBanner_description__1ibpiy75`,V=`inAppBanner_header__1ibpiy71`,H=`inAppBanner_iconWrapper__1ibpiy72`,U=`inAppBanner_title__1ibpiy73`;function ae({title:e,description:t,cta:n,dismissLabel:r,onAction:i,onDismiss:a,className:o,classNames:s}){return/* @__PURE__ */ c(`div`,{className:`${ie}${o?` ${o}`:``}`,role:`alert`,children:[/* @__PURE__ */ c(`div`,{className:V,children:[/* @__PURE__ */ c(`span`,{className:`${H}${s?.icon?` ${s.icon}`:``}`,children:/* @__PURE__ */ c(x,{width:20,height:20})}),/* @__PURE__ */ c(`p`,{className:`${U}${s?.title?` ${s.title}`:``}`,children:e})]}),/* @__PURE__ */ c(`div`,{className:L,children:[/* @__PURE__ */ c(`p`,{className:`${B}${s?.description?` ${s.description}`:``}`,children:t}),/* @__PURE__ */ c(`button`,{type:`button`,className:`${z}${s?.cta?` ${s.cta}`:``}`,onClick:i,children:[n,/* @__PURE__ */ c(b,{width:14,height:14})]})]}),/* @__PURE__ */ c(`button`,{type:`button`,className:`${R}${s?.close?` ${s.close}`:``}`,onClick:a,"aria-label":r,children:/* @__PURE__ */ c(y,{width:16,height:16})})]})}var oe=`Banner_frakLogo__1gnumzic`,se=`Banner_iconSvg__1gnumzi1`,W=`Banner_pendingBody__1gnumzia`,G=`Banner_pendingClose__1gnumzib sharedBaseCss_buttonReset__7cswil0`,K=`Banner_pendingCta__1gnumzi9 Banner_referralCta__1gnumzi8 sharedBaseCss_buttonReset__7cswil0`,ce=`Banner_referral__1gnumzi2 reset_base__1831jhd0 Banner_rootBase__1gnumzi0`,le=`Banner_referralBody__1gnumzi5`,ue=`Banner_referralCta__1gnumzi8 sharedBaseCss_buttonReset__7cswil0`,de=`Banner_referralDescription__1gnumzi7 reset_base__1831jhd0`,fe=`Banner_referralIconWrapper__1gnumzi3`,pe=`Banner_referralImage__1gnumzi4`,me=`Banner_referralTitle__1gnumzi6 reset_base__1831jhd0`;function q(e,t){return e?A(e,t):void 0}function he({pending:t,isPreview:r,isClientReady:d,placementId:f,classname:p,imageUrl:m,config:g,overrides:_}){let v=e(),[y,b]=n(void 0),x=a(!1),S=l(()=>k(t.expiresAt),[t.expiresAt]),C=S?.days,w=t.lockedCount>0;D(!r);let T=i(e=>{r||u(window.FrakSetup?.client,e,{surface:`banner`,placement:f,days_left:C,locked:w})},[r,f,C,w]);o(()=>{if(r||!d)return;let e=!1;return h().then(t=>{e||b(t)}).catch(()=>{}),()=>{e=!0}},[r,d]),o(()=>{r||!d||x.current||(x.current=!0,T(`reward_reminder_impression`))},[r,d,T]);let A=(()=>{let e=s[v].banner,n=t.nextUnlockAt?new Date(t.nextUnlockAt):void 0,r=t.lockedCount>=t.count&&n!==void 0&&!Number.isNaN(n.getTime()),i={reward:O(t.total,E()),days:S?.days,date:q(r?n:S?.date,v)},a=[r?e.pendingDescriptionLocked:e.pendingDescription,S&&`${re(S.days,v)}.`].filter(Boolean).join(` `),o=e=>ne(e,i);return{title:o(_.title??g?.pendingTitle??e.pendingTitle),description:o(_.description??g?.pendingDescription??a),cta:o(_.cta??g?.pendingCta??e.pendingCta)}})(),j=i(e=>{r||(y?(P(),u(window.FrakSetup?.client,`banner_resolved`,{placement:f,variant:`pending`,outcome:`clicked`}),T(`reward_reminder_claim_clicked`)):e.preventDefault())},[r,y,f,T]),M=i(()=>{r||(u(window.FrakSetup?.client,`banner_resolved`,{placement:f,variant:`pending`,outcome:`dismissed`}),T(`reward_reminder_dismissed`),I())},[r,f,T]),N=!r&&!y,F=[ce,`frak-banner`,`frak-banner--pending`,p].filter(Boolean).join(` `);return/* @__PURE__ */ c(`section`,{class:F,"aria-label":A.title,children:[/* @__PURE__ */ c(`div`,{class:`${fe} frak-banner__icon`,children:m?/* @__PURE__ */ c(`img`,{src:m,alt:``,class:pe}):/* @__PURE__ */ c(te,{class:se})}),/* @__PURE__ */ c(`div`,{class:`${le} ${W} frak-banner__text`,children:[/* @__PURE__ */ c(`p`,{class:`${me} frak-banner__title`,children:A.title}),/* @__PURE__ */ c(`p`,{class:`${de} frak-banner__description`,children:A.description}),/* @__PURE__ */ c(`a`,{class:`${K} frak-banner__cta`,href:r?`#`:y,target:r?void 0:`_blank`,rel:`noopener`,role:N?`link`:void 0,tabIndex:N?0:void 0,"aria-disabled":N?`true`:void 0,onClick:j,children:A.cta})]}),/* @__PURE__ */ c(`button`,{type:`button`,class:`${G} frak-banner__close`,"aria-label":s[v].banner.dismissLabel,onClick:M,children:`×`}),/* @__PURE__ */ c(ee,{class:`${oe} frak-banner__logo`,width:42,height:24})]})}function ge(e,t){let n=M(),{summary:r}=j(e===null&&t);return l(()=>e===`pending`?N():e!==null||n?null:F(r)?r.pending:null,[e,n,r])}function _e(e){return e===`inapp`||e===`pending`?e:`referral`}function J({placement:r,classname:h=``,interaction:y,products:b,referralTitle:x,referralDescription:E,referralCta:D,inappTitle:O,inappDescription:k,inappCta:A,pendingTitle:j,pendingDescription:ne,pendingCta:M,imageUrl:re,preview:N,previewMode:P,allowInappRedirect:F}){let I=!!N,L=e(),R=_e(P),ie=F===!0||F===`true`,z=w(r),{shouldRender:B,isHidden:V,isClientReady:H}=t();C(`frak-banner`,r,z?.components?.banner?.css,`@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
to {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@keyframes keyframes_fadeOut__mnqmlt1 {
|
|
12
|
+
from {
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
to {
|
|
17
|
+
opacity: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes keyframes_fadeInDown__mnqmlt2 {
|
|
22
|
+
from {
|
|
23
|
+
opacity: 0;
|
|
24
|
+
transform: translateY(-4px);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
to {
|
|
28
|
+
opacity: 1;
|
|
29
|
+
transform: translateY(0);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.inAppBanner_container__1ibpiy70 {
|
|
33
|
+
top: max(8px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
|
|
34
|
+
z-index: 1000;
|
|
35
|
+
-webkit-backdrop-filter: blur(12px);
|
|
36
|
+
backdrop-filter: blur(12px);
|
|
37
|
+
color: var(--text-onAction__pbq4ak6);
|
|
38
|
+
background-color: #000c;
|
|
39
|
+
border-radius: 12px;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 4px;
|
|
42
|
+
padding: 12px 32px 12px 16px;
|
|
43
|
+
animation: .3s ease-out keyframes_fadeInDown__mnqmlt2;
|
|
44
|
+
display: flex;
|
|
45
|
+
position: fixed;
|
|
46
|
+
left: 16px;
|
|
47
|
+
right: 16px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.inAppBanner_header__1ibpiy71 {
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: 8px;
|
|
53
|
+
display: flex;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.inAppBanner_iconWrapper__1ibpiy72 {
|
|
57
|
+
width: 20px;
|
|
58
|
+
height: 20px;
|
|
59
|
+
color: var(--text-onAction__pbq4ak6);
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
align-items: center;
|
|
63
|
+
display: flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.inAppBanner_title__1ibpiy73 {
|
|
67
|
+
color: var(--text-onAction__pbq4ak6);
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0;
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
line-height: 26px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.inAppBanner_body__1ibpiy74 {
|
|
76
|
+
flex-wrap: wrap;
|
|
77
|
+
align-items: baseline;
|
|
78
|
+
gap: 0 4px;
|
|
79
|
+
display: flex;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.inAppBanner_description__1ibpiy75 {
|
|
83
|
+
color: var(--text-onAction__pbq4ak6);
|
|
84
|
+
opacity: .96;
|
|
85
|
+
margin: 0;
|
|
86
|
+
padding: 0;
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
line-height: 22px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.inAppBanner_cta__1ibpiy76 {
|
|
92
|
+
all: unset;
|
|
93
|
+
color: #2bb2ff;
|
|
94
|
+
text-underline-offset: 2px;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
align-items: center;
|
|
97
|
+
gap: 4px;
|
|
98
|
+
font-size: 14px;
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
text-decoration: underline;
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.inAppBanner_cta__1ibpiy76:focus-visible {
|
|
105
|
+
outline-offset: 2px;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
outline: 2px solid #2bb2ff;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.inAppBanner_closeButton__1ibpiy77 {
|
|
111
|
+
all: unset;
|
|
112
|
+
color: #fff9;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
border-radius: 9999px;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
align-items: center;
|
|
117
|
+
width: 28px;
|
|
118
|
+
height: 28px;
|
|
119
|
+
display: flex;
|
|
120
|
+
position: absolute;
|
|
121
|
+
top: 8px;
|
|
122
|
+
right: 8px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.inAppBanner_closeButton__1ibpiy77:focus-visible {
|
|
126
|
+
outline: 2px solid var(--text-onAction__pbq4ak6);
|
|
127
|
+
outline-offset: 2px;
|
|
128
|
+
}
|
|
129
|
+
.Banner_rootBase__1gnumzi0 {
|
|
130
|
+
animation: .3s ease-out keyframes_fadeInDown__mnqmlt2;
|
|
131
|
+
display: flex;
|
|
132
|
+
position: relative;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.Banner_iconSvg__1gnumzi1 {
|
|
136
|
+
width: 100%;
|
|
137
|
+
height: 100%;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.Banner_referral__1gnumzi2 {
|
|
141
|
+
color: var(--text-primary__pbq4ak0);
|
|
142
|
+
border: 1px solid var(--border-default__pbq4akv);
|
|
143
|
+
background-color: #fff;
|
|
144
|
+
border-radius: 12px;
|
|
145
|
+
flex-direction: row;
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: 16px;
|
|
148
|
+
padding: 16px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.Banner_referralIconWrapper__1gnumzi3 {
|
|
152
|
+
flex-shrink: 0;
|
|
153
|
+
justify-content: center;
|
|
154
|
+
align-self: flex-start;
|
|
155
|
+
align-items: center;
|
|
156
|
+
width: 40px;
|
|
157
|
+
height: 40px;
|
|
158
|
+
display: flex;
|
|
159
|
+
overflow: hidden;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.Banner_referralImage__1gnumzi4 {
|
|
163
|
+
object-fit: contain;
|
|
164
|
+
width: auto;
|
|
165
|
+
max-width: 100%;
|
|
166
|
+
height: auto;
|
|
167
|
+
max-height: 100%;
|
|
168
|
+
display: block;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.Banner_referralBody__1gnumzi5 {
|
|
172
|
+
flex: 1;
|
|
173
|
+
min-width: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.Banner_referralTitle__1gnumzi6 {
|
|
177
|
+
color: var(--text-primary__pbq4ak0);
|
|
178
|
+
font-size: 16px;
|
|
179
|
+
font-weight: 600;
|
|
180
|
+
line-height: 22px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.Banner_referralDescription__1gnumzi7 {
|
|
184
|
+
color: #979797;
|
|
185
|
+
margin-bottom: 8px;
|
|
186
|
+
font-size: 14px;
|
|
187
|
+
line-height: 22px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.Banner_referralCta__1gnumzi8 {
|
|
191
|
+
color: var(--text-primary__pbq4ak0);
|
|
192
|
+
text-transform: uppercase;
|
|
193
|
+
border: 1px solid #000;
|
|
194
|
+
border-radius: 9999px;
|
|
195
|
+
padding: 8px 16px;
|
|
196
|
+
font-size: 10px;
|
|
197
|
+
font-weight: 700;
|
|
198
|
+
line-height: 12px;
|
|
199
|
+
display: inline-block;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.Banner_pendingCta__1gnumzi9 {
|
|
203
|
+
text-decoration: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.Banner_pendingBody__1gnumzia {
|
|
207
|
+
padding-right: 24px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.Banner_pendingClose__1gnumzib {
|
|
211
|
+
color: #979797;
|
|
212
|
+
width: 24px;
|
|
213
|
+
height: 24px;
|
|
214
|
+
font-size: 18px;
|
|
215
|
+
line-height: 24px;
|
|
216
|
+
position: absolute;
|
|
217
|
+
top: 8px;
|
|
218
|
+
right: 8px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.Banner_frakLogo__1gnumzic {
|
|
222
|
+
pointer-events: none;
|
|
223
|
+
position: absolute;
|
|
224
|
+
bottom: 12px;
|
|
225
|
+
right: 16px;
|
|
226
|
+
}
|
|
227
|
+
`,d);let[U,W]=n(!1),[G,K]=n(()=>I?R:ie&&m?`inapp`:null),q=ge(G,!I&&H&&B&&!V),J=G??(q?`pending`:null),Y=a(null);o(()=>{I&&K(R)},[I,R]);let ve=l(()=>f(b),[b]),{reward:X}=T(J===`referral`&&H,y,`referee`,ve),[ye,be]=n(null);o(()=>{let e=window.FrakSetup?.client;J===`inapp`&&!I&&H&&e&&p(e).then(e=>be(e)).catch(()=>{})},[J,I,H]),o(()=>{I||!J||U||Y.current!==J&&H&&(u(window.FrakSetup?.client,`banner_impression`,{placement:r,variant:J,has_reward:J===`referral`?!!X:void 0}),Y.current=J)},[J,U,H,I,r]),o(()=>{if(I||G===`inapp`)return;let e=()=>K(`referral`);return window.addEventListener(_,e),()=>window.removeEventListener(_,e)},[I,G]);let xe=i(async()=>{if(I)return;if(u(window.FrakSetup?.client,`banner_resolved`,{placement:r,variant:J??`referral`,outcome:`clicked`}),J===`referral`){W(!0);return}let e=ye;if(!e&&window.FrakSetup?.client)try{e=await p(window.FrakSetup?.client)}catch{}let t=window.location.href;if(e){let n=new URL(t);n.searchParams.set(`fmt`,e),t=n.toString()}g(t)},[I,J,ye,r]),Se=i(()=>{I||(u(window.FrakSetup?.client,`banner_resolved`,{placement:r,variant:J??`referral`,outcome:`dismissed`}),W(!0))},[I,J,r]),Ce=S(),Z=z?.components?.banner??Ce?.banner,Q=re??Z?.imageUrl,$=l(()=>{let e=s[L].banner;if(J===`referral`){let t=X?e.referralTitleReward:e.referralTitle;return{title:v(x??Z?.referralTitle??t,X),description:v(E??Z?.referralDescription??e.referralDescription,X),cta:D??Z?.referralCta??e.referralCta}}return{title:v(O??Z?.inappTitle??e.inappTitle,void 0),description:v(k??Z?.inappDescription??e.inappDescription,void 0),cta:A??Z?.inappCta??e.inappCta}},[L,J,X,Z,x,E,D,O,k,A]);if(!J||!I&&(!B||V||U))return null;if(q)return/* @__PURE__ */ c(he,{pending:q,isPreview:I,isClientReady:H,placementId:r,classname:h,imageUrl:Q,config:Z,overrides:{title:j,description:ne,cta:M}});let we=[ce,`frak-banner`,`frak-banner--${J}`,h].filter(Boolean).join(` `);return J===`inapp`?/* @__PURE__ */ c(ae,{title:$.title,description:$.description,cta:$.cta,dismissLabel:s[L].banner.dismissLabel,onAction:xe,onDismiss:Se,className:[`frak-banner`,`frak-banner--inapp`,h].filter(Boolean).join(` `),classNames:{icon:`frak-banner__icon`,title:`frak-banner__title`,description:`frak-banner__description`,cta:`frak-banner__cta`,close:`frak-banner__close`}}):/* @__PURE__ */ c(`div`,{class:we,role:`alert`,children:[/* @__PURE__ */ c(`div`,{class:`${fe} frak-banner__icon`,children:Q?/* @__PURE__ */ c(`img`,{src:Q,alt:``,class:pe}):/* @__PURE__ */ c(te,{class:se})}),/* @__PURE__ */ c(`div`,{class:`${le} frak-banner__text`,children:[/* @__PURE__ */ c(`p`,{class:`${me} frak-banner__title`,children:$.title}),/* @__PURE__ */ c(`p`,{class:`${de} frak-banner__description`,children:$.description}),/* @__PURE__ */ c(`button`,{type:`button`,class:`${ue} frak-banner__cta`,onClick:xe,children:$.cta})]}),/* @__PURE__ */ c(ee,{class:`${oe} frak-banner__logo`,width:42,height:24})]})}r(J,`frak-banner`,[`placement`,`classname`,`interaction`,`products`,`referralTitle`,`referralDescription`,`referralCta`,`inappTitle`,`inappDescription`,`inappCta`,`pendingTitle`,`pendingDescription`,`pendingCta`,`preview`,`previewMode`,`imageUrl`,`allowInappRedirect`],{shadow:!1});export{J as Banner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,
|
|
1
|
+
import{a as e,c as t,g as n,h as r,l as i,m as a,n as o,t as s,u as c}from"./jsxRuntime.module.7FJBZ9bf.js";import{E as l,f as u,n as d}from"./loader.js";import{i as f}from"./rewards.CeNLrK54.js";import{t as p}from"./useGlobalComponents.CNnOzerU.js";import{t as m}from"./useLightDomStyles.557xWurb.js";import{t as h}from"./usePlacement.DYgmdkfr.js";import{t as g}from"./useReward.BzUL3ijd.js";function _({placement:n,text:_,classname:v=``,noRewardText:y,targetInteraction:b,products:x,clickAction:S,preview:C}){let w=!!C,T=e(),E=h(n),D=p(),O=E?.components?.buttonShare??D?.buttonShare;m(`frak-button-share`,n,O?.css);let k=E?.targetInteraction===void 0?b:E.targetInteraction,A=O?.text??_??o[T].buttonShare.text,j=O?.noRewardText??y,M=A.includes(`{REWARD}`),N=O?.clickAction??S??`sharing-page`,{shouldRender:P,isHidden:F,isClientReady:I}=t(),L=c(()=>u(x),[x]),{reward:R}=g(M&&I,k,void 0,L),z=c(()=>M?R?f(A,R):j??f(A,void 0):A,[M,A,j,R]),B=i(!1);a(()=>{w||B.current||I&&P&&!F&&(l(window.FrakSetup?.client,`share_button_impression`,{placement:n,target_interaction:k,has_reward:!!R}),B.current=!0)},[w,I,P,F,n,k]);let V=r(()=>{w||(l(window.FrakSetup.client,`share_button_clicked`,{placement:n,target_interaction:k,has_reward:!!R,click_action:N}),d(`share_button`,k,n,{products:L}))},[w,N,k,n,R,L]);if(!w&&(!P||F))return null;let H=[`button`,`button__fadeIn`,v].filter(Boolean).join(` `);return/* @__PURE__ */ s(`button`,{type:`button`,disabled:!w&&!I,class:H,onClick:V,children:z})}n(_,`frak-button-share`,[`text`,`placement`,`classname`,`clickAction`,`noRewardText`,`targetInteraction`,`products`,`preview`],{shadow:!1});export{_ as ButtonShare};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{_ as e,a as t,c as n,g as r,h as i,l as a,m as o,n as s,r as c,t as l}from"./jsxRuntime.module.7FJBZ9bf.js";import{E as u,n as d}from"./loader.js";import{t as f}from"./usePlacement.DYgmdkfr.js";import{t as p}from"./useReward.BzUL3ijd.js";function m(){`vibrate`in navigator&&navigator.vibrate(10)}function h(e){return/* @__PURE__ */ l(`svg`,{fill:`none`,height:`1em`,viewBox:`0 0 28 28`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[/* @__PURE__ */ l(`title`,{children:`Gift icon`}),/* @__PURE__ */ l(`path`,{d:`m23.14 14v11.43h-18.29v-11.43m9.14 11.43v-17.14m0 0h-5.14c-0.76 0-1.48-0.3-2.02-0.84s-0.84-1.26-0.84-2.020.3-1.480.84-2.02 1.26-0.84 2.02-0.84c4 0 5.14 5.71 5.14 5.71zm0 0h5.14c0.76 0 1.48-0.3 2.02-0.84s0.84-1.260.84-2.02-0.3-1.48-0.84-2.02-1.26-0.84-2.02-0.84c-4 0-5.14 5.71-5.14 5.71zm-11.43 0h22.86v5.71h-22.86z`,stroke:`#fff`,"stroke-linecap":`round`,"stroke-linejoin":`round`})]})}function g({placement:r,classname:g=``,useReward:_,targetInteraction:v}){let y=t(),b=f(r),x=b?.targetInteraction===void 0?v:b.targetInteraction,S=_===!0,{shouldRender:C,isHidden:w,isClientReady:T}=n(),{reward:E}=p(S&&T,x),D=b?.components?.buttonWallet?.position??window.FrakSetup?.modalWalletConfig?.metadata?.position??`right`,O=a(!1);o(()=>{O.current||T&&C&&!w&&(u(window.FrakSetup?.client,`share_button_impression`,{placement:r,target_interaction:x,has_reward:!!E}),O.current=!0)},[T,C,w,r,x]);let k=i(()=>{u(window.FrakSetup.client,`share_button_clicked`,{placement:r,target_interaction:x,has_reward:!!E,click_action:`sharing-page`}),m(),d(`share_button`,x,r)},[r,x,E]);if(!C||w)return null;let A=[`button`,`button__fadeIn`,D===`left`?`button__left`:`button__right`,g].filter(Boolean).join(` `);return/* @__PURE__ */ l(e,{children:[/* @__PURE__ */ l(`style`,{children:c(`
|
|
2
2
|
.button {
|
|
3
3
|
all: unset;
|
|
4
4
|
position: fixed;
|
|
@@ -37,4 +37,4 @@ import{a as e,c as t,g as n,h as r,l as i,m as a,n as o,p as s,r as c,t as l}fro
|
|
|
37
37
|
white-space: nowrap;
|
|
38
38
|
line-height: 9px;
|
|
39
39
|
}
|
|
40
|
-
`,b?.components?.buttonWallet?.css)}),/* @__PURE__ */ l(`button`,{type:`button`,"aria-label":
|
|
40
|
+
`,b?.components?.buttonWallet?.css)}),/* @__PURE__ */ l(`button`,{type:`button`,"aria-label":s[y].buttonWallet.ariaLabel,part:`button`,disabled:!T,class:A,onClick:k,children:[/* @__PURE__ */ l(h,{}),E&&/* @__PURE__ */ l(`span`,{class:`reward`,children:E})]})]})}r(g,`frak-button-wallet`,[`placement`,`classname`,`useReward`,`targetInteraction`],{shadow:!0});export{g as ButtonWallet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsxRuntime.module.7FJBZ9bf.js";function t({ink:t=`#222222`,...n}){return/* @__PURE__ */ e(`svg`,{viewBox:`0 0 100 100`,fill:`none`,"aria-hidden":`true`,...n,children:[/* @__PURE__ */ e(`circle`,{cx:`38`,cy:`28`,r:`23`,fill:`#FFF533`}),/* @__PURE__ */ e(`path`,{d:`M50 38C30 10 12 30 50 38Z`,stroke:t,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),/* @__PURE__ */ e(`path`,{d:`M50 38C70 10 88 30 50 38Z`,stroke:t,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),/* @__PURE__ */ e(`rect`,{x:`10`,y:`38`,width:`80`,height:`16`,rx:`2`,stroke:t,"stroke-width":`4`}),/* @__PURE__ */ e(`path`,{d:`M15 54V89C15 90.6 16.4 92 18 92H82C83.6 92 85 90.6 85 89V54`,stroke:t,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),/* @__PURE__ */ e(`line`,{x1:`50`,y1:`54`,x2:`50`,y2:`92`,stroke:t,"stroke-width":`4`,"stroke-linecap":`round`})]})}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,m as t,t as n}from"./jsxRuntime.module.7FJBZ9bf.js";function r(n){let[r]=e(o),[i,a]=e(()=>r?.matches??!1),[s,c]=e(null);return t(()=>{if(!r)return;let e=e=>a(e.matches);return r.addEventListener(`change`,e),()=>r.removeEventListener(`change`,e)},[r]),t(()=>{if(!i||!n)return;let e=!1;return import(`./qr.vkJgq9pN.js`).then(({encodeQR:t})=>{e||c(t(n,`raw`,{border:4,ecc:`low`}))}).catch(()=>{}),()=>{e=!0}},[i,n]),{wide:i,grid:i&&n?s:null}}function i({grid:e,label:t,class:r}){let i=e.length;return/* @__PURE__ */ n(`svg`,{class:r,width:200,height:200,viewBox:`0 0 ${i} ${i}`,xmlns:`http://www.w3.org/2000/svg`,role:`img`,"aria-label":t,focusable:`false`,children:[/* @__PURE__ */ n(`rect`,{width:i,height:i,fill:`#fff`}),/* @__PURE__ */ n(`path`,{d:s(e),fill:`#000`})]})}function a({url:e,label:t,caption:a,class:o,captionClass:s}){let{grid:c}=r(e);return c?/* @__PURE__ */ n(`figure`,{class:o,children:[/* @__PURE__ */ n(i,{grid:c,label:t}),/* @__PURE__ */ n(`figcaption`,{class:s,children:a})]}):null}function o(){return typeof window>`u`||typeof window.matchMedia!=`function`?null:window.matchMedia(`(min-width: 768px)`)}function s(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];for(let e=0;e<r.length;e++)r[e]&&(t+=`M${e},${n}h1v1h-1z`)}return t}export{i as n,r,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,
|
|
1
|
+
import{a as e,c as t,g as n,n as r,t as i}from"./jsxRuntime.module.7FJBZ9bf.js";import{E as a,_ as o,g as s,y as c}from"./loader.js";import{t as l}from"./useLightDomStyles.557xWurb.js";import{t as u}from"./usePlacement.DYgmdkfr.js";function d(e=`wallet`,t){let n=window.FrakSetup?.client;n&&a(n,`open_in_app_clicked`,{path:e,placement:t});let r=`${c}${e}`;s(r,{onFallback:()=>{n&&a(n,`app_not_installed`,{path:e,placement:t})}})}function f(){return{isMobile:o()}}function p({placement:n,text:a,classname:o=``}){let s=e(),c=u(n),{shouldRender:p,isHidden:m,isClientReady:h}=t(),{isMobile:g}=f();l(`frak-open-in-app`,n,c?.components?.openInApp?.css);let _=c?.components?.openInApp?.text??a??r[s].openInApp.text;if(!g||!p||m)return null;let v=()=>{d(void 0,n)},y=[`button`,`button__fadeIn`,o].filter(Boolean).join(` `);return/* @__PURE__ */ i(`button`,{type:`button`,"aria-label":r[s].openInApp.ariaLabel,disabled:!h,class:y,onClick:v,children:_})}n(p,`frak-open-in-app`,[`text`,`placement`,`classname`],{shadow:!1});export{p as OpenInAppButton};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import{a as e,c as t,f as n,g as r,h as i,l as a,m as o,n as s,t as c,u as l}from"./jsxRuntime.module.7FJBZ9bf.js";import{A as u,E as d,P as f,a as p,f as m,i as h,j as g,n as _,o as v,s as y}from"./loader.js";import{i as b,n as x,t as S}from"./rewards.CeNLrK54.js";import{n as C}from"./icons.CdzHzZIJ.js";import{t as ee}from"./useGlobalComponents.CNnOzerU.js";import{t as te}from"./useLightDomStyles.557xWurb.js";import{t as ne}from"./usePlacement.DYgmdkfr.js";import{t as re}from"./GiftIcon.DYg5xgHg.js";import{a as w,l as T,n as E,o as D,s as O}from"./format.D2Ai5cCn.js";import{i as k,n as A}from"./rewardSummaryStore.DyjI-vPH.js";var ie=`PostPurchase_actions__5fv5lh9`,ae=`PostPurchase_card__5fv5lh0`,oe=`PostPurchase_cardLayout__5fv5lh1`,se=`PostPurchase_cardLeft__5fv5lh2`,ce=`PostPurchase_cardRight__5fv5lh3`,j=`PostPurchase_claimLink__5fv5lh7`,M=`PostPurchase_cta__5fv5lh6 sharedBaseCss_buttonReset__7cswil0`,N=`PostPurchase_ctaSecondary__5fv5lh8`,le=`PostPurchase_customImage__5fv5lhd`,ue=`PostPurchase_frakLogo__5fv5lhe`,de=`PostPurchase_giftIcon__5fv5lhb`,fe=`PostPurchase_icon__5fv5lha`,pe=`PostPurchase_imageWrapper__5fv5lhc`,me=`PostPurchase_message__5fv5lh5`;function he({isPreview:e,isClientReady:t,isReferee:r,rewardText:i,lang:c,propText:l,configText:u}){let d=!e&&t&&r,{status:f,summary:p}=O(d),[m,h]=n(!1),g=f===`ready`;o(()=>{if(!d||g)return;let e=setTimeout(()=>h(!0),1500);return()=>clearTimeout(e)},[d,g]);let _=a(!1);f===`ready`&&(_.current=!0);let v=A(p)?p:null,y=v?E(v.pending.total,w()):i,x=r&&p?.linked!==!0,S=s[c].postPurchase,C=y?S.claimCtaText:S.claimCtaNoRewardText;return{awaitingSummary:!e&&r&&!_.current&&!m,show:x,claimable:v!==null,shareClassName:x?`${M} ${N} button`:`${M} button`,text:b(l??u??C,y),daysLeft:v?D(v.pending.expiresAt)?.days:void 0,locked:(v?.pending.lockedCount??0)>0}}function ge({claim:e,...t}){return e.show?/* @__PURE__ */ c(P,{claim:e,...t}):null}function P({claim:{text:e,daysLeft:t,locked:r,claimable:i},token:s,merchantId:l,placement:u,isPreview:f,isClientReady:p}){let[m,h]=n(),g=a(!1),_={surface:`post_purchase`,placement:u,days_left:t,locked:r};T(!f),o(()=>{if(f||!p)return;let e=!1;return v({merchantId:l,checkoutToken:s}).then(t=>{e||h(t)}).catch(e=>void 0),()=>{e=!0}},[f,p,l,s]),o(()=>{!f&&p&&i&&!g.current&&(g.current=!0,d(window.FrakSetup?.client,`reward_reminder_impression`,_))},[f,p,i,_]);let y=e=>{f||(m===void 0?e.preventDefault():(k(),d(window.FrakSetup?.client,`post_purchase_clicked`,{placement:u,variant:`referee`,action:`claim`}),d(window.FrakSetup?.client,`reward_reminder_claim_clicked`,_)))},b=m===void 0;return/* @__PURE__ */ c(`a`,{className:`${M} ${j} button`,href:m,role:b?`link`:void 0,tabIndex:b?0:void 0,"aria-disabled":b?`true`:void 0,onClick:y,children:e})}function _e(e){let t=e?.trim();if(!t)return;let n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{return new URL(n).toString()}catch{return}}function ve(e,t,n,r){let i=e?.isReferred?`referee`:`referrer`,a=x(t.rewards,{targetInteraction:`purchase`,currency:n,audience:i,products:r});if(!a)return null;let{campaign:o}=a,s=e?.isReferred&&o.referee?`referee`:`referrer`;return{variant:s,reward:s===`referee`?o.referee:o.referrer,merchantDomain:t.onChainMetadata.domain}}function F({customerId:r,orderId:v,token:x,sharingUrl:w,merchantId:T,placement:E,classname:D=``,variant:O,badgeText:k,referrerText:A,refereeText:j,ctaText:M,claimCtaText:N,preview:P,previewVariant:F,products:I,imageUrl:ye}){let L=!!P,{shouldRender:R,isHidden:z,isClientReady:B}=t(),V=ne(E),H=e(),U=l(()=>m(I),[I]);te(`frak-post-purchase`,E,V?.components?.postPurchase?.css,`.PostPurchase_card__5fv5lh0 {
|
|
2
|
+
background-color: var(--surface-background__pbq4akc);
|
|
3
|
+
border: 1px solid var(--border-default__pbq4akv);
|
|
4
|
+
border-radius: 12px;
|
|
5
|
+
padding: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.PostPurchase_cardLayout__5fv5lh1 {
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 32px;
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.PostPurchase_cardLeft__5fv5lh2 {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
gap: 8px;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
display: flex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.PostPurchase_cardRight__5fv5lh3 {
|
|
24
|
+
text-align: right;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
align-items: flex-end;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.PostPurchase_badge__5fv5lh4 {
|
|
33
|
+
color: var(--text-primary__pbq4ak0);
|
|
34
|
+
background-color: #fff534;
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
align-self: flex-start;
|
|
37
|
+
padding: 4px 8px;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
line-height: 12px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.PostPurchase_message__5fv5lh5 {
|
|
44
|
+
color: var(--text-primary__pbq4ak0);
|
|
45
|
+
margin: 0;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
line-height: 22px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.PostPurchase_cta__5fv5lh6 {
|
|
52
|
+
background-color: var(--text-primary__pbq4ak0);
|
|
53
|
+
color: var(--text-onAction__pbq4ak6);
|
|
54
|
+
text-transform: uppercase;
|
|
55
|
+
border-radius: 9999px;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 4px;
|
|
59
|
+
padding: 12px 16px;
|
|
60
|
+
font-size: 12px;
|
|
61
|
+
font-weight: bold;
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.PostPurchase_cta__5fv5lh6:disabled {
|
|
66
|
+
opacity: .7;
|
|
67
|
+
cursor: default;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.PostPurchase_claimLink__5fv5lh7 {
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.PostPurchase_claimLink__5fv5lh7:hover, .PostPurchase_claimLink__5fv5lh7:visited, .PostPurchase_claimLink__5fv5lh7:focus-visible {
|
|
75
|
+
color: var(--text-onAction__pbq4ak6);
|
|
76
|
+
text-decoration: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.PostPurchase_ctaSecondary__5fv5lh8 {
|
|
80
|
+
color: var(--text-primary__pbq4ak0);
|
|
81
|
+
border: 1px solid var(--border-default__pbq4akv);
|
|
82
|
+
background-color: #0000;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.PostPurchase_actions__5fv5lh9 {
|
|
86
|
+
flex-wrap: wrap;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: 8px;
|
|
89
|
+
display: flex;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.PostPurchase_icon__5fv5lha {
|
|
93
|
+
margin: -2px 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.PostPurchase_giftIcon__5fv5lhb {
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
display: block;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.PostPurchase_imageWrapper__5fv5lhc {
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
width: 80px;
|
|
106
|
+
height: 80px;
|
|
107
|
+
display: flex;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.PostPurchase_customImage__5fv5lhd {
|
|
112
|
+
object-fit: contain;
|
|
113
|
+
width: auto;
|
|
114
|
+
max-width: 100%;
|
|
115
|
+
height: auto;
|
|
116
|
+
max-height: 100%;
|
|
117
|
+
display: block;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.PostPurchase_frakLogo__5fv5lhe {
|
|
121
|
+
margin-left: auto;
|
|
122
|
+
display: block;
|
|
123
|
+
}
|
|
124
|
+
`,f);let[W,be]=n(null),[G,K]=n(!1);o(()=>{L||B&&r&&v&&x&&h({customerId:r,orderId:v,token:x,merchantId:T}).catch(()=>{})},[L,B,r,v,x,T]),o(()=>{if(L||!B||G)return;let e=window.FrakSetup?.client;e&&Promise.all([p(e),y(e)]).then(([e,t])=>{K(!0),be({referralStatus:e,merchantInfo:t})}).catch(e=>{e instanceof g&&e.code===u.configError&&K(!0)})},[L,B,G]);let q=l(()=>W?ve(W.referralStatus,W.merchantInfo,window.FrakSetup?.client?.config?.metadata?.currency,U):null,[W,U]),J=a(null),Y=O??q?.variant??(L?F??`referrer`:void 0),xe=_e(w??q?.merchantDomain),X=l(()=>{if(!q?.reward)return;let e=window.FrakSetup?.client?.config?.metadata?.currency;return S(q.reward,e)},[q?.reward]),Se=ee(),Z=V?.components?.postPurchase??Se?.postPurchase,Ce=k??Z?.badgeText,we=ye??Z?.imageUrl,Q=l(()=>{let e=s[H].postPurchase;return{message:Y===`referee`?X?b(j??Z?.refereeText??e.refereeText,X):j??Z?.refereeNoRewardText??e.refereeNoRewardText:X?b(A??Z?.referrerText??e.referrerText,X):A??Z?.referrerNoRewardText??e.referrerNoRewardText,cta:X?b(M??Z?.ctaText??e.ctaText,X):M??Z?.ctaNoRewardText??e.ctaNoRewardText}},[H,Y,X,Z,A,j,M]),$=he({isPreview:L,isClientReady:B,isReferee:Y===`referee`,rewardText:X,lang:H,propText:N,configText:Z?.claimCtaText});o(()=>{Y&&J.current!==Y&&B&&(L||R&&!z)&&($.awaitingSummary||(d(window.FrakSetup?.client,`post_purchase_impression`,{placement:E,variant:Y,has_reward:!!q?.reward}),J.current=Y))},[Y,R,z,B,L,E,q?.reward,$.awaitingSummary]);let Te=i(()=>{Y&&(d(window.FrakSetup?.client,`post_purchase_clicked`,{placement:E,variant:Y,action:`share`}),_(`post_purchase`,void 0,E,{link:xe,products:U,checkoutToken:x}))},[Y,E,xe,U,x]);if(!Y||!L&&(!R||z||!q||$.awaitingSummary))return null;let Ee=[ae,D].filter(Boolean).join(` `);return/* @__PURE__ */ c(`div`,{className:Ee,children:/* @__PURE__ */ c(`div`,{class:oe,children:[/* @__PURE__ */ c(`div`,{class:se,children:[Ce&&/* @__PURE__ */ c(`span`,{class:`PostPurchase_badge__5fv5lh4`,children:Ce}),/* @__PURE__ */ c(`p`,{class:me,children:Q.message}),/* @__PURE__ */ c(`div`,{class:ie,children:[/* @__PURE__ */ c(ge,{claim:$,token:x,merchantId:T,placement:E,isPreview:L,isClientReady:B}),/* @__PURE__ */ c(`button`,{type:`button`,className:$.shareClassName,disabled:!L&&!B,onClick:L?void 0:Te,children:[Q.cta,/* @__PURE__ */ c(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`${fe} button`,children:/* @__PURE__ */ c(`path`,{d:`M13.9 11.14C13.99 11.05 14.15 11.11 14.15 11.24V11.64C14.15 13.05 12.63 14.19 10.75 14.19C8.87 14.19 7.34 13.05 7.34 11.64V11.24C7.34 11.11 7.51 11.05 7.59 11.14C8.35 11.93 9.48 12.43 10.75 12.43C12.01 12.43 13.15 11.93 13.9 11.14ZM1.85 9.65C1.85 9.51 2.01 9.44 2.1 9.54C2.85 10.32 3.99 10.82 5.25 10.82C5.52 10.82 5.79 10.8 6.04 10.76C6.26 10.72 6.47 10.88 6.47 11.1V12.17C6.47 12.32 6.37 12.45 6.22 12.48C5.92 12.55 5.59 12.59 5.25 12.59C3.37 12.59 1.85 11.45 1.85 10.04V9.65ZM10.75 6.21C12.63 6.21 14.15 7.35 14.15 8.75C14.15 10.16 12.63 11.3 10.75 11.3C8.87 11.3 7.34 10.16 7.34 8.75C7.34 7.35 8.87 6.21 10.75 6.21ZM1.85 6.85C1.85 6.71 2.01 6.65 2.1 6.74C2.85 7.53 3.99 8.03 5.25 8.03C5.52 8.03 5.79 8 6.04 7.96C6.26 7.92 6.47 8.09 6.47 8.3V9.37C6.47 9.52 6.37 9.65 6.22 9.69C5.92 9.75 5.59 9.79 5.25 9.79C3.37 9.79 1.85 8.65 1.85 7.24V6.85ZM5.25 1.81C7.13 1.81 8.66 2.95 8.66 4.36C8.66 5.76 7.13 6.9 5.25 6.9C3.37 6.9 1.85 5.76 1.85 4.36C1.85 2.95 3.37 1.81 5.25 1.81Z`,fill:`currentColor`})})]})]})]}),/* @__PURE__ */ c(`div`,{class:ce,children:[we?/* @__PURE__ */ c(`span`,{class:pe,children:/* @__PURE__ */ c(`img`,{src:we,alt:``,class:le})}):/* @__PURE__ */ c(re,{className:de,width:80,height:80}),/* @__PURE__ */ c(C,{className:ue,width:42,height:24})]})]})})}r(F,`frak-post-purchase`,[`customerId`,`orderId`,`token`,`sharingUrl`,`merchantId`,`placement`,`classname`,`variant`,`badgeText`,`referrerText`,`refereeText`,`ctaText`,`claimCtaText`,`products`,`preview`,`previewVariant`,`imageUrl`],{shadow:!1});export{F as PostPurchase};
|