@frak-labs/components 1.3.3-beta.b5bbb625 → 1.3.3-beta.c4b15093
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.Cmb0kX5D.js +519 -0
- package/cdn/Banner.2WJ4pT6E.js +227 -0
- package/cdn/{ButtonShare.C7xLonci.js → ButtonShare.DSGvJfJ-.js} +1 -1
- package/cdn/{ButtonWallet.CYf4UqML.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.C75q-9BM.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.F9iOJSNk.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.g4cWDddX.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 +536 -180
- package/dist/banner.d.ts +20 -6
- package/dist/banner.js +237 -15
- package/dist/buttonShare.js +2 -2
- package/dist/buttonWallet.js +1 -1
- 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 +188 -34
- package/dist/previewSummary-CMc6q8vI.js +37 -0
- package/dist/rewardReminder.d.ts +50 -0
- package/dist/rewardReminder.js +809 -0
- package/dist/{rewards-CfGynCt6.js → rewards-BuNthAR2.js} +49 -46
- package/dist/{sharedBaseCss.css-nYy9vlzH.js → sharedBaseCss.css-D2HG4Ty8.js} +1 -1
- package/dist/{useReward-DmukZKoh.js → useReward-cQ54x8q-.js} +1 -1
- package/package.json +18 -12
- package/cdn/Ambassador.DIumLn1z.js +0 -392
- package/cdn/Banner.8mqstDGK.js +0 -208
- package/cdn/PostPurchase.CxuZ9cs-.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
package/dist/ambassador.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-SKmJGZgN.js";
|
|
2
|
-
import { i as w } from "./rewards-
|
|
2
|
+
import { i as w } from "./rewards-BuNthAR2.js";
|
|
3
3
|
import { t as useGlobalComponents } from "./useGlobalComponents-BF47jsBt.js";
|
|
4
4
|
import { t as useLightDomStyles } from "./useLightDomStyles-wGaNXHqN.js";
|
|
5
|
-
import { t as useReward } from "./useReward-
|
|
5
|
+
import { t as useReward } from "./useReward-cQ54x8q-.js";
|
|
6
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
|
-
import { t as cssSource$2 } from "./sharedBaseCss.css-
|
|
8
|
-
import {
|
|
7
|
+
import { t as cssSource$2 } from "./sharedBaseCss.css-D2HG4Ty8.js";
|
|
8
|
+
import { a as resolveRewardCurrency, c as isClaimable, d as useInlineReminderRegistration, i as pickFiat, l as markClaimStarted, n as formatFiat, o as getRewardCountdown, r as formatRewardDate, s as useRewardSummary, t as fillReminderText } from "./format-zGdbUoX_.js";
|
|
9
|
+
import { n as QrSvg, r as useInstallQr, t as InstallQr } from "./InstallQr-kpb44cfg.js";
|
|
10
|
+
import { getEnvironment, isMobile, trackEvent } from "@frak-labs/core-sdk";
|
|
9
11
|
import { getInstallUrl } from "@frak-labs/core-sdk/actions";
|
|
10
|
-
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
12
|
+
import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
11
13
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
12
14
|
// src/hooks/useHostTheme.ts
|
|
13
15
|
const QUIET_BORDER_DISTANCE = 120;
|
|
@@ -637,13 +639,140 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
637
639
|
display: block;
|
|
638
640
|
}
|
|
639
641
|
|
|
640
|
-
.
|
|
642
|
+
.Ambassador_myRewards__awpcg0r {
|
|
643
|
+
text-align: center;
|
|
644
|
+
justify-items: center;
|
|
645
|
+
gap: 1em;
|
|
646
|
+
padding: 2em 1.75em;
|
|
647
|
+
display: grid;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.Ambassador_myRewardsWithStub__awpcg0s {
|
|
651
|
+
text-align: start;
|
|
652
|
+
flex-wrap: wrap;
|
|
653
|
+
align-items: stretch;
|
|
654
|
+
gap: 0;
|
|
655
|
+
padding: 0;
|
|
656
|
+
display: flex;
|
|
657
|
+
overflow: hidden;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.Ambassador_myRewardsMain__awpcg0t {
|
|
661
|
+
flex: 999 24em;
|
|
662
|
+
align-content: center;
|
|
663
|
+
justify-items: start;
|
|
664
|
+
gap: .9em;
|
|
665
|
+
min-width: 0;
|
|
666
|
+
padding: 2.25em 2.5em;
|
|
667
|
+
display: grid;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.Ambassador_myRewardsStub__awpcg0u {
|
|
671
|
+
color: #111;
|
|
672
|
+
text-align: center;
|
|
673
|
+
background-color: #fff;
|
|
674
|
+
border-left: 2px dashed #11111138;
|
|
675
|
+
flex: 1 0 auto;
|
|
676
|
+
align-content: center;
|
|
677
|
+
justify-items: center;
|
|
678
|
+
gap: .75em;
|
|
679
|
+
padding: 2em 1.75em;
|
|
680
|
+
display: grid;
|
|
681
|
+
-webkit-mask-image: radial-gradient(.75em at 0 0, #0000 97%, #000 100%), radial-gradient(.75em at 0 100%, #0000 97%, #000 100%);
|
|
682
|
+
mask-image: radial-gradient(.75em at 0 0, #0000 97%, #000 100%), radial-gradient(.75em at 0 100%, #0000 97%, #000 100%);
|
|
683
|
+
-webkit-mask-position: top, bottom;
|
|
684
|
+
mask-position: top, bottom;
|
|
685
|
+
-webkit-mask-size: 100% 51%;
|
|
686
|
+
mask-size: 100% 51%;
|
|
687
|
+
-webkit-mask-repeat: no-repeat;
|
|
688
|
+
mask-repeat: no-repeat;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.Ambassador_myRewardsStubHeading__awpcg0v {
|
|
692
|
+
margin: 0;
|
|
693
|
+
font-size: 1.05em;
|
|
694
|
+
font-weight: 700;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.Ambassador_myRewardsStubQr__awpcg0w {
|
|
698
|
+
display: block;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.Ambassador_myRewardsStubQrPlaceholder__awpcg0x {
|
|
702
|
+
background-color: #f3f4f6;
|
|
703
|
+
width: 200px;
|
|
704
|
+
height: 200px;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.Ambassador_myRewardsStubCaption__awpcg0y {
|
|
708
|
+
color: #555;
|
|
709
|
+
max-width: 14em;
|
|
710
|
+
margin: 0;
|
|
711
|
+
font-size: .85em;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.Ambassador_myRewardsAmount__awpcg0z {
|
|
715
|
+
margin: 0;
|
|
716
|
+
font-size: clamp(3em, 12vw, 5.5em);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.Ambassador_myRewardsBreakdown__awpcg010 {
|
|
720
|
+
gap: .4em;
|
|
721
|
+
width: 100%;
|
|
722
|
+
max-width: 26em;
|
|
723
|
+
margin: 0;
|
|
724
|
+
padding: 0;
|
|
725
|
+
list-style: none;
|
|
726
|
+
display: grid;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.Ambassador_myRewardsRow__awpcg011 {
|
|
730
|
+
justify-content: space-between;
|
|
731
|
+
gap: 1em;
|
|
732
|
+
margin: 0;
|
|
733
|
+
display: flex;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
.Ambassador_myRewardsRowValue__awpcg012 {
|
|
737
|
+
font-weight: 700;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.Ambassador_myRewardsCountdown__awpcg013 {
|
|
741
|
+
margin: 0;
|
|
742
|
+
font-weight: 700;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.Ambassador_myRewardsActions__awpcg014 {
|
|
746
|
+
flex-wrap: wrap;
|
|
747
|
+
justify-content: center;
|
|
748
|
+
align-items: center;
|
|
749
|
+
gap: 1em 1.5em;
|
|
750
|
+
display: flex;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.Ambassador_myRewardsActionsStart__awpcg015 {
|
|
754
|
+
justify-content: flex-start;
|
|
755
|
+
gap: .75em;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.Ambassador_myRewardsSecondaryCta__awpcg016 {
|
|
759
|
+
color: var(--frak-amb-accent-text, var(--frak-amb-accent, #111));
|
|
760
|
+
border: 1px solid var(--frak-amb-border, #11111126);
|
|
761
|
+
background-color: #0000;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.Ambassador_myRewardsSecondaryCta__awpcg016:hover {
|
|
765
|
+
opacity: 1;
|
|
766
|
+
background-color: var(--frak-amb-surface, #1111110a);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.Ambassador_stepsGrid__awpcg017 {
|
|
641
770
|
grid-template-columns: repeat(auto-fit, minmax(min(15em, 100%), 1fr));
|
|
642
771
|
gap: 1.25em;
|
|
643
772
|
display: grid;
|
|
644
773
|
}
|
|
645
774
|
|
|
646
|
-
.
|
|
775
|
+
.Ambassador_stepNumber__awpcg018 {
|
|
647
776
|
border-radius: var(--frak-amb-cta-radius, 999px);
|
|
648
777
|
background-color: var(--frak-amb-accent, #111);
|
|
649
778
|
block-size: 1.9em;
|
|
@@ -656,19 +785,19 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
656
785
|
display: grid;
|
|
657
786
|
}
|
|
658
787
|
|
|
659
|
-
.
|
|
788
|
+
.Ambassador_stepIcon__awpcg019 {
|
|
660
789
|
object-fit: contain;
|
|
661
790
|
width: 40px;
|
|
662
791
|
height: 40px;
|
|
663
792
|
}
|
|
664
793
|
|
|
665
|
-
.
|
|
794
|
+
.Ambassador_stepTitle__awpcg01a {
|
|
666
795
|
margin: 0;
|
|
667
796
|
font-size: 1.05em;
|
|
668
797
|
line-height: 1.3;
|
|
669
798
|
}
|
|
670
799
|
|
|
671
|
-
.
|
|
800
|
+
.Ambassador_winWinCards__awpcg01b {
|
|
672
801
|
grid-template-columns: repeat(auto-fit, minmax(min(15em, 100%), 1fr));
|
|
673
802
|
gap: 1.25em;
|
|
674
803
|
width: 100%;
|
|
@@ -676,21 +805,21 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
676
805
|
display: grid;
|
|
677
806
|
}
|
|
678
807
|
|
|
679
|
-
.
|
|
808
|
+
.Ambassador_winWinCard__awpcg01c {
|
|
680
809
|
text-align: center;
|
|
681
810
|
justify-items: center;
|
|
682
811
|
}
|
|
683
812
|
|
|
684
|
-
.
|
|
813
|
+
.Ambassador_winWinCardAmount__awpcg01d {
|
|
685
814
|
margin: 0;
|
|
686
815
|
font-size: clamp(2em, 6vw, 3em);
|
|
687
816
|
}
|
|
688
817
|
|
|
689
|
-
.
|
|
818
|
+
.Ambassador_referralCta__awpcg01e {
|
|
690
819
|
justify-self: start;
|
|
691
820
|
}
|
|
692
821
|
|
|
693
|
-
.
|
|
822
|
+
.Ambassador_store__awpcg01f {
|
|
694
823
|
grid-template-columns: repeat(auto-fit, minmax(min(14em, 100%), 1fr));
|
|
695
824
|
align-items: center;
|
|
696
825
|
gap: 1.75em;
|
|
@@ -698,14 +827,14 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
698
827
|
display: grid;
|
|
699
828
|
}
|
|
700
829
|
|
|
701
|
-
.
|
|
830
|
+
.Ambassador_storeBody__awpcg01g {
|
|
702
831
|
align-content: start;
|
|
703
832
|
gap: .75em;
|
|
704
833
|
min-width: 0;
|
|
705
834
|
display: grid;
|
|
706
835
|
}
|
|
707
836
|
|
|
708
|
-
.
|
|
837
|
+
.Ambassador_storeQr__awpcg01h {
|
|
709
838
|
text-align: center;
|
|
710
839
|
justify-items: center;
|
|
711
840
|
gap: .5em;
|
|
@@ -713,14 +842,14 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
713
842
|
display: grid;
|
|
714
843
|
}
|
|
715
844
|
|
|
716
|
-
.
|
|
845
|
+
.Ambassador_storeBadges__awpcg01i {
|
|
717
846
|
flex-wrap: wrap;
|
|
718
847
|
align-items: center;
|
|
719
848
|
gap: .75em;
|
|
720
849
|
display: flex;
|
|
721
850
|
}
|
|
722
851
|
|
|
723
|
-
.
|
|
852
|
+
.Ambassador_storeBadge__awpcg01j {
|
|
724
853
|
border-radius: 8px;
|
|
725
854
|
align-items: center;
|
|
726
855
|
line-height: 0;
|
|
@@ -731,12 +860,12 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
731
860
|
background-color: #000 !important;
|
|
732
861
|
}
|
|
733
862
|
|
|
734
|
-
.
|
|
863
|
+
.Ambassador_storeBadge__awpcg01j:focus-visible {
|
|
735
864
|
outline-color: #000;
|
|
736
865
|
box-shadow: 0 0 0 2px #fff;
|
|
737
866
|
}
|
|
738
867
|
|
|
739
|
-
.
|
|
868
|
+
.Ambassador_storeBadgeArt__awpcg01k {
|
|
740
869
|
display: block;
|
|
741
870
|
border: 0 !important;
|
|
742
871
|
border-radius: 0 !important;
|
|
@@ -746,22 +875,22 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
746
875
|
margin: 0 !important;
|
|
747
876
|
}
|
|
748
877
|
|
|
749
|
-
.
|
|
878
|
+
.Ambassador_faqItem__awpcg01l {
|
|
750
879
|
border-bottom: 1px solid var(--frak-amb-border, #11111126);
|
|
751
880
|
padding: .9em 0;
|
|
752
881
|
}
|
|
753
882
|
|
|
754
|
-
.
|
|
883
|
+
.Ambassador_faqQuestion__awpcg01m {
|
|
755
884
|
cursor: pointer;
|
|
756
885
|
font-weight: 700;
|
|
757
886
|
list-style: none;
|
|
758
887
|
}
|
|
759
888
|
|
|
760
|
-
.
|
|
889
|
+
.Ambassador_faqQuestion__awpcg01m::-webkit-details-marker {
|
|
761
890
|
display: none;
|
|
762
891
|
}
|
|
763
892
|
|
|
764
|
-
.
|
|
893
|
+
.Ambassador_faqQuestion__awpcg01m:after {
|
|
765
894
|
content: "+";
|
|
766
895
|
float: right;
|
|
767
896
|
color: var(--frak-amb-accent-text, var(--frak-amb-accent, #111));
|
|
@@ -769,20 +898,20 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
769
898
|
font-weight: 700;
|
|
770
899
|
}
|
|
771
900
|
|
|
772
|
-
.
|
|
901
|
+
.Ambassador_faqItem__awpcg01l[open] .Ambassador_faqQuestion__awpcg01m:after {
|
|
773
902
|
content: "–";
|
|
774
903
|
}
|
|
775
904
|
|
|
776
|
-
.
|
|
905
|
+
.Ambassador_faqAnswer__awpcg01n {
|
|
777
906
|
opacity: .75;
|
|
778
907
|
margin: .6em 0 0;
|
|
779
908
|
}
|
|
780
909
|
|
|
781
|
-
.
|
|
910
|
+
.Ambassador_faqAttribution__awpcg01o {
|
|
782
911
|
text-align: center;
|
|
783
912
|
}
|
|
784
913
|
|
|
785
|
-
.
|
|
914
|
+
.Ambassador_frakLink__awpcg01p {
|
|
786
915
|
color: inherit;
|
|
787
916
|
text-underline-offset: .15em;
|
|
788
917
|
text-decoration: underline;
|
|
@@ -794,7 +923,7 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
794
923
|
border: 1px solid var(--frak-amb-border, color-mix(in srgb, var(--frak-amb-accent, #111) 15%, transparent));
|
|
795
924
|
}
|
|
796
925
|
|
|
797
|
-
.
|
|
926
|
+
.Ambassador_faqItem__awpcg01l {
|
|
798
927
|
border-bottom: 1px solid var(--frak-amb-border, color-mix(in srgb, var(--frak-amb-accent, #111) 15%, transparent));
|
|
799
928
|
}
|
|
800
929
|
}
|
|
@@ -803,12 +932,12 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
803
932
|
var amountUnit = "Ambassador_amountUnit__awpcg0a";
|
|
804
933
|
var amountWords = "Ambassador_amountWords__awpcg0b";
|
|
805
934
|
var faq = "Ambassador_region__awpcg03";
|
|
806
|
-
var faqAnswer = "
|
|
807
|
-
var faqAttribution = "
|
|
808
|
-
var faqItem = "
|
|
809
|
-
var faqQuestion = "
|
|
935
|
+
var faqAnswer = "Ambassador_faqAnswer__awpcg01n";
|
|
936
|
+
var faqAttribution = "Ambassador_faqAttribution__awpcg01o Ambassador_mutedSmall__awpcg07";
|
|
937
|
+
var faqItem = "Ambassador_faqItem__awpcg01l";
|
|
938
|
+
var faqQuestion = "Ambassador_faqQuestion__awpcg01m";
|
|
810
939
|
var faqTitle = "Ambassador_regionTitle__awpcg05";
|
|
811
|
-
var frakLink = "
|
|
940
|
+
var frakLink = "Ambassador_frakLink__awpcg01p";
|
|
812
941
|
var hero = "Ambassador_hero__awpcg0d Ambassador_region__awpcg03";
|
|
813
942
|
var heroAmount = "Ambassador_heroAmount__awpcg0l";
|
|
814
943
|
var heroArt = "Ambassador_heroArt__awpcg0g Ambassador_panel__awpcg00";
|
|
@@ -824,8 +953,29 @@ var heroRewardCaption = "Ambassador_heroRewardCaption__awpcg0m";
|
|
|
824
953
|
var heroTag = "Ambassador_heroTag__awpcg0j";
|
|
825
954
|
var heroTagMain = "Ambassador_heroTagMain__awpcg0k";
|
|
826
955
|
var heroTitle = "Ambassador_heroTitle__awpcg0f";
|
|
956
|
+
var myRewards = "Ambassador_myRewards__awpcg0r Ambassador_panel__awpcg00";
|
|
957
|
+
var myRewardsActions = "Ambassador_myRewardsActions__awpcg014";
|
|
958
|
+
var myRewardsActionsStart = "Ambassador_myRewardsActionsStart__awpcg015";
|
|
959
|
+
var myRewardsAmount = "Ambassador_myRewardsAmount__awpcg0z Ambassador_bigFigure__awpcg0c";
|
|
960
|
+
var myRewardsBreakdown = "Ambassador_myRewardsBreakdown__awpcg010";
|
|
961
|
+
var myRewardsCountdown = "Ambassador_myRewardsCountdown__awpcg013";
|
|
962
|
+
var myRewardsCta = "Ambassador_ctaButton__awpcg02 sharedBaseCss_buttonReset__7cswil0";
|
|
963
|
+
var myRewardsEyebrow = "Ambassador_mutedSmall__awpcg07";
|
|
964
|
+
var myRewardsFooter = "Ambassador_mutedSmall__awpcg07";
|
|
965
|
+
var myRewardsHeading = "Ambassador_regionTitle__awpcg05";
|
|
966
|
+
var myRewardsMain = "Ambassador_myRewardsMain__awpcg0t";
|
|
967
|
+
var myRewardsNote = "Ambassador_mutedSmall__awpcg07";
|
|
968
|
+
var myRewardsRow = "Ambassador_myRewardsRow__awpcg011";
|
|
969
|
+
var myRewardsRowValue = "Ambassador_myRewardsRowValue__awpcg012";
|
|
970
|
+
var myRewardsSecondaryCta = "Ambassador_myRewardsSecondaryCta__awpcg016 Ambassador_ctaButton__awpcg02 sharedBaseCss_buttonReset__7cswil0";
|
|
971
|
+
var myRewardsStub = "Ambassador_myRewardsStub__awpcg0u";
|
|
972
|
+
var myRewardsStubCaption = "Ambassador_myRewardsStubCaption__awpcg0y";
|
|
973
|
+
var myRewardsStubHeading = "Ambassador_myRewardsStubHeading__awpcg0v";
|
|
974
|
+
var myRewardsStubQr = "Ambassador_myRewardsStubQr__awpcg0w";
|
|
975
|
+
var myRewardsStubQrPlaceholder = "Ambassador_myRewardsStubQrPlaceholder__awpcg0x";
|
|
976
|
+
var myRewardsWithStub = "Ambassador_myRewardsWithStub__awpcg0s";
|
|
827
977
|
var referral = "Ambassador_region__awpcg03";
|
|
828
|
-
var referralCta = "
|
|
978
|
+
var referralCta = "Ambassador_referralCta__awpcg01e Ambassador_ctaButton__awpcg02 sharedBaseCss_buttonReset__7cswil0";
|
|
829
979
|
var referralLede = "Ambassador_lede__awpcg06";
|
|
830
980
|
var referralTitle = "Ambassador_regionTitle__awpcg05";
|
|
831
981
|
var reward = "Ambassador_centeredRegion__awpcg04 Ambassador_region__awpcg03";
|
|
@@ -840,97 +990,274 @@ var rewardLede = "Ambassador_lede__awpcg06";
|
|
|
840
990
|
var root = "Ambassador_root__awpcg01";
|
|
841
991
|
var step = "Ambassador_card__awpcg09 Ambassador_panel__awpcg00";
|
|
842
992
|
var stepDescription = "Ambassador_muted__awpcg08";
|
|
843
|
-
var stepIcon = "
|
|
844
|
-
var stepNumber = "
|
|
845
|
-
var stepTitle = "
|
|
993
|
+
var stepIcon = "Ambassador_stepIcon__awpcg019";
|
|
994
|
+
var stepNumber = "Ambassador_stepNumber__awpcg018";
|
|
995
|
+
var stepTitle = "Ambassador_stepTitle__awpcg01a";
|
|
846
996
|
var steps = "Ambassador_region__awpcg03";
|
|
847
|
-
var stepsGrid = "
|
|
997
|
+
var stepsGrid = "Ambassador_stepsGrid__awpcg017";
|
|
848
998
|
var stepsLede = "Ambassador_lede__awpcg06";
|
|
849
999
|
var stepsTitle = "Ambassador_regionTitle__awpcg05";
|
|
850
|
-
var store = "
|
|
851
|
-
var storeBadge = "
|
|
852
|
-
var storeBadgeArt = "
|
|
853
|
-
var storeBadges = "
|
|
854
|
-
var storeBody = "
|
|
1000
|
+
var store = "Ambassador_store__awpcg01f Ambassador_panel__awpcg00";
|
|
1001
|
+
var storeBadge = "Ambassador_storeBadge__awpcg01j sharedBaseCss_buttonReset__7cswil0";
|
|
1002
|
+
var storeBadgeArt = "Ambassador_storeBadgeArt__awpcg01k";
|
|
1003
|
+
var storeBadges = "Ambassador_storeBadges__awpcg01i";
|
|
1004
|
+
var storeBody = "Ambassador_storeBody__awpcg01g";
|
|
855
1005
|
var storeLede = "Ambassador_lede__awpcg06";
|
|
856
|
-
var storeQr = "
|
|
1006
|
+
var storeQr = "Ambassador_storeQr__awpcg01h";
|
|
857
1007
|
var storeQrCaption = "Ambassador_mutedSmall__awpcg07";
|
|
858
1008
|
var storeTitle = "Ambassador_regionTitle__awpcg05";
|
|
859
1009
|
var winWin = "Ambassador_centeredRegion__awpcg04 Ambassador_region__awpcg03";
|
|
860
|
-
var winWinCard = "
|
|
861
|
-
var winWinCardAmount = "
|
|
1010
|
+
var winWinCard = "Ambassador_winWinCard__awpcg01c Ambassador_card__awpcg09 Ambassador_panel__awpcg00";
|
|
1011
|
+
var winWinCardAmount = "Ambassador_winWinCardAmount__awpcg01d Ambassador_bigFigure__awpcg0c";
|
|
862
1012
|
var winWinCardDescription = "Ambassador_muted__awpcg08";
|
|
863
1013
|
var winWinCardLabel = "Ambassador_mutedSmall__awpcg07";
|
|
864
|
-
var winWinCards = "
|
|
1014
|
+
var winWinCards = "Ambassador_winWinCards__awpcg01b";
|
|
865
1015
|
var winWinLede = "Ambassador_lede__awpcg06";
|
|
866
1016
|
var winWinTitle = "Ambassador_regionTitle__awpcg05";
|
|
867
1017
|
const cssSource = cssSource$1;
|
|
868
|
-
// src/components/Ambassador/
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
const
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1018
|
+
// src/components/Ambassador/Figure.tsx
|
|
1019
|
+
const FIGURE = /^(\D*?)(\d[\d\s.,\u00A0\u202F]*?)(\D*)$/;
|
|
1020
|
+
/** Draws the currency of a formatted amount smaller; wording without a figure passes through. */
|
|
1021
|
+
function Figure({ amount }) {
|
|
1022
|
+
const parts = FIGURE.exec(amount);
|
|
1023
|
+
if (!parts) return /* @__PURE__ */ jsx("span", {
|
|
1024
|
+
class: `${amountWords} frak-ambassador__amount-words`,
|
|
1025
|
+
children: amount
|
|
1026
|
+
});
|
|
1027
|
+
const [, before, figure, after] = parts;
|
|
1028
|
+
const unit = (text) => text ? /* @__PURE__ */ jsx("small", {
|
|
1029
|
+
class: `${amountUnit} frak-ambassador__amount-unit`,
|
|
1030
|
+
children: text
|
|
1031
|
+
}) : null;
|
|
1032
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1033
|
+
unit(before),
|
|
1034
|
+
figure,
|
|
1035
|
+
unit(after)
|
|
1036
|
+
] });
|
|
1037
|
+
}
|
|
1038
|
+
// src/components/Ambassador/MyRewards.tsx
|
|
1039
|
+
/** Unlinked visitors with something waiting claim it; linked ones see what this merchant paid or owes. */
|
|
1040
|
+
function resolveMyRewardsView(summary) {
|
|
1041
|
+
if (!summary) return null;
|
|
1042
|
+
if (isClaimable(summary)) return "claim";
|
|
1043
|
+
if (!summary.linked) return null;
|
|
1044
|
+
const hasEarned = !!summary.earned && pickFiat(summary.earned.total, resolveRewardCurrency()) > 0;
|
|
1045
|
+
const hasPending = !!summary.pending && summary.pending.count > 0;
|
|
1046
|
+
return hasEarned || hasPending ? "earned" : null;
|
|
1047
|
+
}
|
|
1048
|
+
function formatDate(iso, lang) {
|
|
1049
|
+
if (!iso || Number.isNaN(Date.parse(iso))) return void 0;
|
|
1050
|
+
return formatRewardDate(new Date(iso), lang);
|
|
1051
|
+
}
|
|
1052
|
+
function countdownText(copy, countdown, lang) {
|
|
1053
|
+
if (!countdown) return void 0;
|
|
1054
|
+
let template = copy.myRewardsCountdown;
|
|
1055
|
+
if (countdown.days === 0) template = copy.myRewardsCountdownToday;
|
|
1056
|
+
else if (countdown.days === 1) template = copy.myRewardsCountdownOneDay;
|
|
1057
|
+
return fillReminderText(template, {
|
|
1058
|
+
days: countdown.days,
|
|
1059
|
+
date: formatRewardDate(countdown.date, lang)
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
function ClaimStub({ copy, grid, qrLabel }) {
|
|
1063
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1064
|
+
class: `${myRewardsStub} frak-ambassador__my-rewards-stub`,
|
|
1065
|
+
children: [
|
|
1066
|
+
/* @__PURE__ */ jsx("p", {
|
|
1067
|
+
class: myRewardsStubHeading,
|
|
1068
|
+
children: copy.myRewardsQrHeading
|
|
1069
|
+
}),
|
|
1070
|
+
grid ? /* @__PURE__ */ jsx(QrSvg, {
|
|
1071
|
+
grid,
|
|
1072
|
+
label: qrLabel,
|
|
1073
|
+
class: myRewardsStubQr
|
|
1074
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
1075
|
+
class: myRewardsStubQrPlaceholder,
|
|
1076
|
+
"aria-hidden": "true"
|
|
1077
|
+
}),
|
|
1078
|
+
/* @__PURE__ */ jsx("p", {
|
|
1079
|
+
class: myRewardsStubCaption,
|
|
1080
|
+
children: copy.myRewardsQrCaption
|
|
1081
|
+
})
|
|
1082
|
+
]
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
function ClaimRewards({ summary, lang, brand, overrides, installUrl, isClientReady, onShare, footer, qrLabel, isDesktop }) {
|
|
1086
|
+
const { wide, grid } = useInstallQr(isDesktop ? installUrl : void 0);
|
|
1087
|
+
const withStub = isDesktop && wide;
|
|
1088
|
+
const { pending } = summary;
|
|
1089
|
+
const copy = componentDefaults[lang].ambassador;
|
|
1090
|
+
const currency = resolveRewardCurrency();
|
|
1091
|
+
const total = formatFiat(pending.total, currency);
|
|
1092
|
+
const countdown = getRewardCountdown(pending.expiresAt);
|
|
1093
|
+
const locked = pending.lockedCount > 0;
|
|
1094
|
+
const unlockDate = locked ? formatDate(pending.nextUnlockAt, lang) : void 0;
|
|
1095
|
+
const reminder = {
|
|
1096
|
+
surface: "ambassador",
|
|
1097
|
+
days_left: countdown?.days,
|
|
1098
|
+
locked
|
|
1099
|
+
};
|
|
1100
|
+
const allLocked = pending.lockedCount >= pending.count;
|
|
1101
|
+
const impressionTracked = useRef(false);
|
|
1102
|
+
const eyebrowId = useId();
|
|
1103
|
+
const inert = installUrl === void 0;
|
|
1104
|
+
useInlineReminderRegistration(true);
|
|
883
1105
|
useEffect(() => {
|
|
884
|
-
if (
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
1106
|
+
if (impressionTracked.current) return;
|
|
1107
|
+
impressionTracked.current = true;
|
|
1108
|
+
trackEvent(window.FrakSetup?.client, "reward_reminder_impression", reminder);
|
|
1109
|
+
}, [reminder]);
|
|
1110
|
+
const rows = [[copy.myRewardsCashbackLabel, pending.cashback], [copy.myRewardsFriendsLabel, pending.fromFriends]];
|
|
1111
|
+
const countdownLine = countdownText(copy, countdown, lang);
|
|
1112
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1113
|
+
/* @__PURE__ */ jsx("p", {
|
|
1114
|
+
id: eyebrowId,
|
|
1115
|
+
class: `${myRewardsEyebrow} frak-ambassador__my-rewards-eyebrow`,
|
|
1116
|
+
children: overrides.myRewardsEyebrow ?? copy.myRewardsEyebrow
|
|
1117
|
+
}),
|
|
1118
|
+
/* @__PURE__ */ jsx("p", {
|
|
1119
|
+
class: `${myRewardsAmount} frak-ambassador__my-rewards-amount`,
|
|
1120
|
+
children: /* @__PURE__ */ jsx(Figure, { amount: total })
|
|
1121
|
+
}),
|
|
1122
|
+
/* @__PURE__ */ jsx("div", {
|
|
1123
|
+
class: `${myRewardsBreakdown} frak-ambassador__my-rewards-breakdown`,
|
|
1124
|
+
children: rows.filter(([, amounts]) => pickFiat(amounts, currency) > 0).map(([label, amounts]) => /* @__PURE__ */ jsxs("p", {
|
|
1125
|
+
class: `${myRewardsRow} frak-ambassador__my-rewards-row`,
|
|
1126
|
+
children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx("span", {
|
|
1127
|
+
class: myRewardsRowValue,
|
|
1128
|
+
children: formatFiat(amounts, currency)
|
|
1129
|
+
})]
|
|
1130
|
+
}, label))
|
|
1131
|
+
}),
|
|
1132
|
+
countdownLine ? /* @__PURE__ */ jsx("p", {
|
|
1133
|
+
class: `${myRewardsCountdown} frak-ambassador__my-rewards-countdown`,
|
|
1134
|
+
children: countdownLine
|
|
1135
|
+
}) : null,
|
|
1136
|
+
unlockDate ? /* @__PURE__ */ jsx("p", {
|
|
1137
|
+
class: `${myRewardsNote} frak-ambassador__my-rewards-unlock`,
|
|
1138
|
+
children: fillReminderText(allLocked ? copy.myRewardsUnlockNoteAll : copy.myRewardsUnlockNote, { date: unlockDate })
|
|
1139
|
+
}) : null,
|
|
1140
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1141
|
+
class: `${myRewardsActions}${withStub ? ` ${myRewardsActionsStart}` : ""} frak-ambassador__my-rewards-actions`,
|
|
1142
|
+
children: [/* @__PURE__ */ jsx("a", {
|
|
1143
|
+
class: `${myRewardsCta} frak-ambassador__my-rewards-cta`,
|
|
1144
|
+
href: installUrl,
|
|
1145
|
+
role: inert ? "link" : void 0,
|
|
1146
|
+
tabIndex: inert ? 0 : void 0,
|
|
1147
|
+
"aria-disabled": inert ? "true" : void 0,
|
|
1148
|
+
onClick: (event) => {
|
|
1149
|
+
if (inert) {
|
|
1150
|
+
event.preventDefault();
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
markClaimStarted();
|
|
1154
|
+
trackEvent(window.FrakSetup?.client, "reward_reminder_claim_clicked", reminder);
|
|
1155
|
+
},
|
|
1156
|
+
children: fillReminderText(overrides.myRewardsClaimCtaLabel ?? copy.myRewardsClaimCta, {
|
|
1157
|
+
reward: total,
|
|
1158
|
+
brand
|
|
1159
|
+
})
|
|
1160
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1161
|
+
type: "button",
|
|
1162
|
+
class: `${myRewardsSecondaryCta} frak-ambassador__my-rewards-share`,
|
|
1163
|
+
disabled: !isClientReady,
|
|
1164
|
+
onClick: onShare,
|
|
1165
|
+
children: fillReminderText(overrides.myRewardsShareCtaLabel ?? copy.myRewardsShareCta, { brand })
|
|
916
1166
|
})]
|
|
917
|
-
}),
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1167
|
+
}),
|
|
1168
|
+
/* @__PURE__ */ jsx("p", {
|
|
1169
|
+
class: `${myRewardsFooter} frak-ambassador__my-rewards-footer`,
|
|
1170
|
+
children: footer
|
|
1171
|
+
})
|
|
1172
|
+
] });
|
|
1173
|
+
return /* @__PURE__ */ jsx("section", {
|
|
1174
|
+
"aria-labelledby": eyebrowId,
|
|
1175
|
+
class: `${myRewards}${withStub ? ` ${myRewardsWithStub}` : ""} frak-ambassador__my-rewards frak-ambassador__my-rewards--claim`,
|
|
1176
|
+
children: withStub ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
1177
|
+
class: `${myRewardsMain} frak-ambassador__my-rewards-main`,
|
|
1178
|
+
children: content
|
|
1179
|
+
}), /* @__PURE__ */ jsx(ClaimStub, {
|
|
1180
|
+
copy,
|
|
1181
|
+
grid,
|
|
1182
|
+
qrLabel
|
|
1183
|
+
})] }) : content
|
|
921
1184
|
});
|
|
922
1185
|
}
|
|
923
|
-
function
|
|
924
|
-
|
|
925
|
-
|
|
1186
|
+
function EarnedRewards({ summary, lang, brand, overrides, isClientReady, onShare }) {
|
|
1187
|
+
const copy = componentDefaults[lang].ambassador;
|
|
1188
|
+
const currency = resolveRewardCurrency();
|
|
1189
|
+
const { earned, pending } = summary;
|
|
1190
|
+
const receivedTotal = earned && pickFiat(earned.total, currency) > 0 ? formatFiat(earned.total, currency) : void 0;
|
|
1191
|
+
const unlockDate = pending && pending.lockedCount > 0 ? formatDate(pending.nextUnlockAt, lang) : void 0;
|
|
1192
|
+
const pendingTemplate = unlockDate ? copy.myRewardsOnItsWayUnlock : copy.myRewardsOnItsWay;
|
|
1193
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
1194
|
+
class: `${myRewards} frak-ambassador__my-rewards frak-ambassador__my-rewards--earned`,
|
|
1195
|
+
children: [
|
|
1196
|
+
/* @__PURE__ */ jsx("h2", {
|
|
1197
|
+
class: `${myRewardsHeading} frak-ambassador__my-rewards-heading`,
|
|
1198
|
+
children: fillReminderText(overrides.myRewardsLinkedHeading ?? copy.myRewardsLinkedHeading, { brand })
|
|
1199
|
+
}),
|
|
1200
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1201
|
+
class: `${myRewardsBreakdown} frak-ambassador__my-rewards-breakdown`,
|
|
1202
|
+
children: [receivedTotal ? /* @__PURE__ */ jsx("p", {
|
|
1203
|
+
class: `${myRewardsCountdown} frak-ambassador__my-rewards-earned`,
|
|
1204
|
+
children: fillReminderText(copy.myRewardsReceived, { reward: receivedTotal })
|
|
1205
|
+
}) : null, pending && pending.count > 0 ? /* @__PURE__ */ jsx("p", {
|
|
1206
|
+
class: `${myRewardsCountdown} frak-ambassador__my-rewards-pending`,
|
|
1207
|
+
children: fillReminderText(pendingTemplate, {
|
|
1208
|
+
reward: formatFiat(pending.total, currency),
|
|
1209
|
+
date: unlockDate
|
|
1210
|
+
})
|
|
1211
|
+
}) : null]
|
|
1212
|
+
}),
|
|
1213
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1214
|
+
class: `${myRewardsActions} frak-ambassador__my-rewards-actions`,
|
|
1215
|
+
children: [/* @__PURE__ */ jsx("a", {
|
|
1216
|
+
class: `${myRewardsCta} frak-ambassador__my-rewards-cta`,
|
|
1217
|
+
href: `${getEnvironment().wallet}/wallet`,
|
|
1218
|
+
target: "_blank",
|
|
1219
|
+
rel: "noopener",
|
|
1220
|
+
children: fillReminderText(overrides.myRewardsWalletCtaLabel ?? copy.myRewardsWalletCta, { brand })
|
|
1221
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1222
|
+
type: "button",
|
|
1223
|
+
class: `${myRewardsSecondaryCta} frak-ambassador__my-rewards-share`,
|
|
1224
|
+
disabled: !isClientReady,
|
|
1225
|
+
onClick: onShare,
|
|
1226
|
+
children: fillReminderText(overrides.myRewardsShareAgainCtaLabel ?? copy.myRewardsShareAgainCta, { brand })
|
|
1227
|
+
})]
|
|
1228
|
+
})
|
|
1229
|
+
]
|
|
1230
|
+
});
|
|
926
1231
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1232
|
+
/** The page's reward summary, plus the formatted pending total while it can be claimed. */
|
|
1233
|
+
function useMyRewards(isClientReady) {
|
|
1234
|
+
const { summary } = useRewardSummary(isClientReady);
|
|
1235
|
+
return {
|
|
1236
|
+
summary,
|
|
1237
|
+
claimReward: isClaimable(summary) ? formatFiat(summary.pending.total, resolveRewardCurrency()) : void 0
|
|
1238
|
+
};
|
|
1239
|
+
}
|
|
1240
|
+
/** While a reward waits, the store block sells the claim unless the merchant wrote its own heading. */
|
|
1241
|
+
function claimStoreHeading(defaults, override, claimReward, brand) {
|
|
1242
|
+
if (!claimReward || override !== void 0) return void 0;
|
|
1243
|
+
return fillReminderText(defaults.storeHeadingClaim, {
|
|
1244
|
+
reward: claimReward,
|
|
1245
|
+
brand
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
/** The claim prompt sits above the hero, the linked recap below it. */
|
|
1249
|
+
function MyRewardsSlot({ placement, summary, ...props }) {
|
|
1250
|
+
const view = resolveMyRewardsView(summary);
|
|
1251
|
+
if (placement === "above" && view === "claim" && isClaimable(summary)) return /* @__PURE__ */ jsx(ClaimRewards, {
|
|
1252
|
+
...props,
|
|
1253
|
+
summary,
|
|
1254
|
+
isDesktop: !isMobile()
|
|
1255
|
+
});
|
|
1256
|
+
if (placement === "below" && view === "earned" && summary) return /* @__PURE__ */ jsx(EarnedRewards, {
|
|
1257
|
+
...props,
|
|
1258
|
+
summary
|
|
1259
|
+
});
|
|
1260
|
+
return null;
|
|
934
1261
|
}
|
|
935
1262
|
// src/components/Ambassador/storeBadges.tsx
|
|
936
1263
|
function AppStoreBadgeArtFr(props) {
|
|
@@ -1187,6 +1514,58 @@ function PlayStoreBadgeArt({ lang, ...props }) {
|
|
|
1187
1514
|
...props
|
|
1188
1515
|
});
|
|
1189
1516
|
}
|
|
1517
|
+
// src/components/Ambassador/Store.tsx
|
|
1518
|
+
function StoreSection({ lang, installUrl, heading, lede, appBadgeAriaLabel, playBadgeAriaLabel, qrLabel, qrCaption }) {
|
|
1519
|
+
const inert = installUrl === void 0;
|
|
1520
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
1521
|
+
class: `${store} frak-ambassador__store`,
|
|
1522
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1523
|
+
class: `${storeBody} frak-ambassador__store-body`,
|
|
1524
|
+
children: [
|
|
1525
|
+
/* @__PURE__ */ jsx("h2", {
|
|
1526
|
+
class: `${storeTitle} frak-ambassador__store-title`,
|
|
1527
|
+
children: heading
|
|
1528
|
+
}),
|
|
1529
|
+
/* @__PURE__ */ jsx("p", {
|
|
1530
|
+
class: `${storeLede} frak-ambassador__store-lede`,
|
|
1531
|
+
children: lede
|
|
1532
|
+
}),
|
|
1533
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1534
|
+
class: `${storeBadges} frak-ambassador__store-badges`,
|
|
1535
|
+
children: [/* @__PURE__ */ jsx("a", {
|
|
1536
|
+
class: `${storeBadge} frak-ambassador__store-badge frak-ambassador__store-badge--app`,
|
|
1537
|
+
"aria-label": appBadgeAriaLabel,
|
|
1538
|
+
href: installUrl,
|
|
1539
|
+
role: inert ? "link" : void 0,
|
|
1540
|
+
tabIndex: inert ? 0 : void 0,
|
|
1541
|
+
"aria-disabled": inert ? "true" : void 0,
|
|
1542
|
+
children: /* @__PURE__ */ jsx(AppStoreBadgeArt, {
|
|
1543
|
+
lang,
|
|
1544
|
+
class: `${storeBadgeArt} frak-ambassador__store-badge-art`
|
|
1545
|
+
})
|
|
1546
|
+
}), /* @__PURE__ */ jsx("a", {
|
|
1547
|
+
class: `${storeBadge} frak-ambassador__store-badge frak-ambassador__store-badge--play`,
|
|
1548
|
+
"aria-label": playBadgeAriaLabel,
|
|
1549
|
+
href: installUrl,
|
|
1550
|
+
role: inert ? "link" : void 0,
|
|
1551
|
+
tabIndex: inert ? 0 : void 0,
|
|
1552
|
+
"aria-disabled": inert ? "true" : void 0,
|
|
1553
|
+
children: /* @__PURE__ */ jsx(PlayStoreBadgeArt, {
|
|
1554
|
+
lang,
|
|
1555
|
+
class: `${storeBadgeArt} frak-ambassador__store-badge-art`
|
|
1556
|
+
})
|
|
1557
|
+
})]
|
|
1558
|
+
})
|
|
1559
|
+
]
|
|
1560
|
+
}), /* @__PURE__ */ jsx(InstallQr, {
|
|
1561
|
+
url: installUrl,
|
|
1562
|
+
label: qrLabel,
|
|
1563
|
+
caption: qrCaption,
|
|
1564
|
+
class: `${storeQr} frak-ambassador__store-qr`,
|
|
1565
|
+
captionClass: `${storeQrCaption} frak-ambassador__store-qr-caption`
|
|
1566
|
+
})]
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1190
1569
|
// src/components/Ambassador/Ambassador.tsx
|
|
1191
1570
|
const FRAK_URL = "https://frak.id";
|
|
1192
1571
|
/**
|
|
@@ -1197,25 +1576,6 @@ const FRAK_URL = "https://frak.id";
|
|
|
1197
1576
|
function resolveBrandName() {
|
|
1198
1577
|
return window.FrakSetup?.config?.metadata?.name || document.querySelector("meta[property=\"og:site_name\"]")?.getAttribute("content") || window.location.hostname.replace(/^www\./, "");
|
|
1199
1578
|
}
|
|
1200
|
-
const FIGURE = /^(\D*?)(\d[\d\s.,\u00A0\u202F]*?)(\D*)$/;
|
|
1201
|
-
/** Draws the currency of a formatted amount smaller; wording without a figure passes through. */
|
|
1202
|
-
function Figure({ amount }) {
|
|
1203
|
-
const parts = FIGURE.exec(amount);
|
|
1204
|
-
if (!parts) return /* @__PURE__ */ jsx("span", {
|
|
1205
|
-
class: `${amountWords} frak-ambassador__amount-words`,
|
|
1206
|
-
children: amount
|
|
1207
|
-
});
|
|
1208
|
-
const [, before, figure, after] = parts;
|
|
1209
|
-
const unit = (text) => text ? /* @__PURE__ */ jsx("small", {
|
|
1210
|
-
class: `${amountUnit} frak-ambassador__amount-unit`,
|
|
1211
|
-
children: text
|
|
1212
|
-
}) : null;
|
|
1213
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1214
|
-
unit(before),
|
|
1215
|
-
figure,
|
|
1216
|
-
unit(after)
|
|
1217
|
-
] });
|
|
1218
|
-
}
|
|
1219
1579
|
function headingText(text) {
|
|
1220
1580
|
return text ? /* @__PURE__ */ jsx("span", {
|
|
1221
1581
|
class: `${rewardHeadingText} frak-ambassador__reward-heading-text`,
|
|
@@ -1309,7 +1669,7 @@ function Ambassador(props) {
|
|
|
1309
1669
|
for (const field of DASHBOARD_FIELDS) merged[field] = props[field] ?? dashboard?.[field];
|
|
1310
1670
|
return /* @__PURE__ */ jsx(AmbassadorPage, { ...merged });
|
|
1311
1671
|
}
|
|
1312
|
-
function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle: propHeroTitle, heroEyebrow: propHeroEyebrow, heroLede: propHeroLede, heroCtaLabel: propHeroCtaLabel, heroFacesCaption: propHeroFacesCaption, heroImageUrl, heroImageAlt: propHeroImageAlt, heroRewardCaption: propHeroRewardCaption, heroRewardRefereePill: propHeroRewardRefereePill, rewardEyebrow: propRewardEyebrow, rewardHeading: propRewardHeading, rewardEstimateCaption: propRewardEstimateCaption, rewardLede: propRewardLede, rewardCtaLabel: propRewardCtaLabel, rewardFooterCaption: propRewardFooterCaption, rewardNoBankDetails: propRewardNoBankDetails, rewardFallbackLabel: propRewardFallbackLabel, explainerTitle: propExplainerTitle, explainerLede: propExplainerLede, step1Title: propStep1Title, step1Description: propStep1Description, step1ImageUrl, step1ImageAlt: propStep1ImageAlt, step2Title: propStep2Title, step2Description: propStep2Description, step2ImageUrl, step2ImageAlt: propStep2ImageAlt, step3Title: propStep3Title, step3Description: propStep3Description, step3ImageUrl, step3ImageAlt: propStep3ImageAlt, winWinHeading: propWinWinHeading, winWinLede: propWinWinLede, winWinCard1Title: propWinWinCard1Title, winWinCard1Description: propWinWinCard1Description, winWinCard2Title: propWinWinCard2Title, winWinCard2Description: propWinWinCard2Description, referralHeading: propReferralHeading, referralLede: propReferralLede, referralCtaLabel: propReferralCtaLabel, storeHeading: propStoreHeading, storeLede: propStoreLede, storeAppBadgeAriaLabel: propStoreAppBadgeAriaLabel, storePlayBadgeAriaLabel: propStorePlayBadgeAriaLabel, storeQrLabel: propStoreQrLabel, storeQrCaption: propStoreQrCaption, faqHeading: propFaqHeading, faq1Question: propFaq1Question, faq1Answer: propFaq1Answer, faq2Question: propFaq2Question, faq2Answer: propFaq2Answer, faq3Question: propFaq3Question, faq3Answer: propFaq3Answer, faq4Question: propFaq4Question, faq4Answer: propFaq4Answer, faq5Question: propFaq5Question, faq5AnswerBeforeLink: propFaq5AnswerBeforeLink, faq5AnswerLinkText: propFaq5AnswerLinkText, faq5AnswerAfterLink: propFaq5AnswerAfterLink, attributionBeforeLink: propAttributionBeforeLink, attributionLinkText: propAttributionLinkText, faq5Answer: dashboardFaq5Answer, accentColor }) {
|
|
1672
|
+
function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle: propHeroTitle, heroEyebrow: propHeroEyebrow, heroLede: propHeroLede, heroCtaLabel: propHeroCtaLabel, heroFacesCaption: propHeroFacesCaption, heroImageUrl, heroImageAlt: propHeroImageAlt, heroRewardCaption: propHeroRewardCaption, heroRewardRefereePill: propHeroRewardRefereePill, rewardEyebrow: propRewardEyebrow, rewardHeading: propRewardHeading, rewardEstimateCaption: propRewardEstimateCaption, rewardLede: propRewardLede, rewardCtaLabel: propRewardCtaLabel, rewardFooterCaption: propRewardFooterCaption, rewardNoBankDetails: propRewardNoBankDetails, rewardFallbackLabel: propRewardFallbackLabel, explainerTitle: propExplainerTitle, explainerLede: propExplainerLede, step1Title: propStep1Title, step1Description: propStep1Description, step1ImageUrl, step1ImageAlt: propStep1ImageAlt, step2Title: propStep2Title, step2Description: propStep2Description, step2ImageUrl, step2ImageAlt: propStep2ImageAlt, step3Title: propStep3Title, step3Description: propStep3Description, step3ImageUrl, step3ImageAlt: propStep3ImageAlt, winWinHeading: propWinWinHeading, winWinLede: propWinWinLede, winWinCard1Title: propWinWinCard1Title, winWinCard1Description: propWinWinCard1Description, winWinCard2Title: propWinWinCard2Title, winWinCard2Description: propWinWinCard2Description, referralHeading: propReferralHeading, referralLede: propReferralLede, referralCtaLabel: propReferralCtaLabel, storeHeading: propStoreHeading, storeLede: propStoreLede, storeAppBadgeAriaLabel: propStoreAppBadgeAriaLabel, storePlayBadgeAriaLabel: propStorePlayBadgeAriaLabel, storeQrLabel: propStoreQrLabel, storeQrCaption: propStoreQrCaption, faqHeading: propFaqHeading, faq1Question: propFaq1Question, faq1Answer: propFaq1Answer, faq2Question: propFaq2Question, faq2Answer: propFaq2Answer, faq3Question: propFaq3Question, faq3Answer: propFaq3Answer, faq4Question: propFaq4Question, faq4Answer: propFaq4Answer, faq5Question: propFaq5Question, faq5AnswerBeforeLink: propFaq5AnswerBeforeLink, faq5AnswerLinkText: propFaq5AnswerLinkText, faq5AnswerAfterLink: propFaq5AnswerAfterLink, attributionBeforeLink: propAttributionBeforeLink, attributionLinkText: propAttributionLinkText, myRewardsEyebrow, myRewardsLinkedHeading, myRewardsClaimCtaLabel, myRewardsShareCtaLabel, myRewardsWalletCtaLabel, myRewardsShareAgainCtaLabel, faq5Answer: dashboardFaq5Answer, accentColor }) {
|
|
1313
1673
|
const { shouldRender, isHidden, isClientReady } = useClientReady();
|
|
1314
1674
|
const lang = useLang();
|
|
1315
1675
|
const rootRef = useRef(null);
|
|
@@ -1317,6 +1677,15 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1317
1677
|
useLightDomStyles("frak-ambassador", void 0, void 0, cssSource, cssSource$2);
|
|
1318
1678
|
const { reward: reward$1 } = useReward(isClientReady, void 0, "referrer");
|
|
1319
1679
|
const { reward: refereeReward, hasReward: hasRefereeReward } = useReward(isClientReady, void 0, "referee");
|
|
1680
|
+
const { summary, claimReward } = useMyRewards(isClientReady);
|
|
1681
|
+
const myRewardsOverrides = {
|
|
1682
|
+
myRewardsEyebrow,
|
|
1683
|
+
myRewardsLinkedHeading,
|
|
1684
|
+
myRewardsClaimCtaLabel,
|
|
1685
|
+
myRewardsShareCtaLabel,
|
|
1686
|
+
myRewardsWalletCtaLabel,
|
|
1687
|
+
myRewardsShareAgainCtaLabel
|
|
1688
|
+
};
|
|
1320
1689
|
const [installUrl, setInstallUrl] = useState(void 0);
|
|
1321
1690
|
const [failedHeroUrl, setFailedHeroUrl] = useState();
|
|
1322
1691
|
useEffect(() => {
|
|
@@ -1344,7 +1713,6 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1344
1713
|
openSharingPage("ambassador");
|
|
1345
1714
|
}, [isClientReady]);
|
|
1346
1715
|
const brand = resolveBrandName();
|
|
1347
|
-
const inert = installUrl === void 0;
|
|
1348
1716
|
const texts = useMemo(() => {
|
|
1349
1717
|
const defaults = componentDefaults[lang].ambassador;
|
|
1350
1718
|
const brandize = (text) => text.replaceAll("{BRAND}", () => brand);
|
|
@@ -1428,7 +1796,7 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1428
1796
|
referralHeading: resolve(propReferralHeading, defaults.referralHeading),
|
|
1429
1797
|
referralLede: resolve(propReferralLede, defaults.referralLede),
|
|
1430
1798
|
referralCtaLabel: resolve(propReferralCtaLabel, defaults.referralCtaLabel),
|
|
1431
|
-
storeHeading: resolve(propStoreHeading, defaults.storeHeading),
|
|
1799
|
+
storeHeading: claimStoreHeading(defaults, propStoreHeading, claimReward, brand) ?? resolve(propStoreHeading, defaults.storeHeading),
|
|
1432
1800
|
storeLede: resolve(propStoreLede, defaults.storeLede),
|
|
1433
1801
|
storeAppBadgeAriaLabel: resolve(propStoreAppBadgeAriaLabel, defaults.storeAppBadgeAriaLabel),
|
|
1434
1802
|
storePlayBadgeAriaLabel: resolve(propStorePlayBadgeAriaLabel, defaults.storePlayBadgeAriaLabel),
|
|
@@ -1454,6 +1822,7 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1454
1822
|
refereeReward,
|
|
1455
1823
|
hasRefereeReward,
|
|
1456
1824
|
brand,
|
|
1825
|
+
claimReward,
|
|
1457
1826
|
propHeroTitle,
|
|
1458
1827
|
propHeroEyebrow,
|
|
1459
1828
|
propHeroLede,
|
|
@@ -1523,11 +1892,26 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1523
1892
|
"frak-ambassador",
|
|
1524
1893
|
classname
|
|
1525
1894
|
].filter(Boolean).join(" ");
|
|
1895
|
+
const myRewardsProps = {
|
|
1896
|
+
summary,
|
|
1897
|
+
lang,
|
|
1898
|
+
brand,
|
|
1899
|
+
overrides: myRewardsOverrides,
|
|
1900
|
+
isClientReady,
|
|
1901
|
+
onShare: handleShare,
|
|
1902
|
+
installUrl,
|
|
1903
|
+
footer: texts.rewardFooterCaption,
|
|
1904
|
+
qrLabel: texts.storeQrLabel
|
|
1905
|
+
};
|
|
1526
1906
|
return /* @__PURE__ */ jsxs("div", {
|
|
1527
1907
|
ref: rootRef,
|
|
1528
1908
|
class: rootClass,
|
|
1529
1909
|
lang,
|
|
1530
1910
|
children: [
|
|
1911
|
+
/* @__PURE__ */ jsx(MyRewardsSlot, {
|
|
1912
|
+
placement: "above",
|
|
1913
|
+
...myRewardsProps
|
|
1914
|
+
}),
|
|
1531
1915
|
/* @__PURE__ */ jsxs("section", {
|
|
1532
1916
|
class: `${hero} frak-ambassador__hero`,
|
|
1533
1917
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -1586,6 +1970,10 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1586
1970
|
})]
|
|
1587
1971
|
})]
|
|
1588
1972
|
}),
|
|
1973
|
+
/* @__PURE__ */ jsx(MyRewardsSlot, {
|
|
1974
|
+
placement: "below",
|
|
1975
|
+
...myRewardsProps
|
|
1976
|
+
}),
|
|
1589
1977
|
/* @__PURE__ */ jsxs("section", {
|
|
1590
1978
|
class: `${reward} frak-ambassador__reward`,
|
|
1591
1979
|
children: [
|
|
@@ -1716,53 +2104,15 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1716
2104
|
})
|
|
1717
2105
|
]
|
|
1718
2106
|
}),
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
/* @__PURE__ */ jsx("p", {
|
|
1729
|
-
class: `${storeLede} frak-ambassador__store-lede`,
|
|
1730
|
-
children: texts.storeLede
|
|
1731
|
-
}),
|
|
1732
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1733
|
-
class: `${storeBadges} frak-ambassador__store-badges`,
|
|
1734
|
-
children: [/* @__PURE__ */ jsx("a", {
|
|
1735
|
-
class: `${storeBadge} frak-ambassador__store-badge frak-ambassador__store-badge--app`,
|
|
1736
|
-
"aria-label": texts.storeAppBadgeAriaLabel,
|
|
1737
|
-
href: installUrl,
|
|
1738
|
-
role: inert ? "link" : void 0,
|
|
1739
|
-
tabIndex: inert ? 0 : void 0,
|
|
1740
|
-
"aria-disabled": inert ? "true" : void 0,
|
|
1741
|
-
children: /* @__PURE__ */ jsx(AppStoreBadgeArt, {
|
|
1742
|
-
lang,
|
|
1743
|
-
class: `${storeBadgeArt} frak-ambassador__store-badge-art`
|
|
1744
|
-
})
|
|
1745
|
-
}), /* @__PURE__ */ jsx("a", {
|
|
1746
|
-
class: `${storeBadge} frak-ambassador__store-badge frak-ambassador__store-badge--play`,
|
|
1747
|
-
"aria-label": texts.storePlayBadgeAriaLabel,
|
|
1748
|
-
href: installUrl,
|
|
1749
|
-
role: inert ? "link" : void 0,
|
|
1750
|
-
tabIndex: inert ? 0 : void 0,
|
|
1751
|
-
"aria-disabled": inert ? "true" : void 0,
|
|
1752
|
-
children: /* @__PURE__ */ jsx(PlayStoreBadgeArt, {
|
|
1753
|
-
lang,
|
|
1754
|
-
class: `${storeBadgeArt} frak-ambassador__store-badge-art`
|
|
1755
|
-
})
|
|
1756
|
-
})]
|
|
1757
|
-
})
|
|
1758
|
-
]
|
|
1759
|
-
}), /* @__PURE__ */ jsx(InstallQr, {
|
|
1760
|
-
url: installUrl,
|
|
1761
|
-
label: texts.storeQrLabel,
|
|
1762
|
-
caption: texts.storeQrCaption,
|
|
1763
|
-
class: `${storeQr} frak-ambassador__store-qr`,
|
|
1764
|
-
captionClass: `${storeQrCaption} frak-ambassador__store-qr-caption`
|
|
1765
|
-
})]
|
|
2107
|
+
summary?.linked ? null : /* @__PURE__ */ jsx(StoreSection, {
|
|
2108
|
+
lang,
|
|
2109
|
+
installUrl,
|
|
2110
|
+
heading: texts.storeHeading,
|
|
2111
|
+
lede: texts.storeLede,
|
|
2112
|
+
appBadgeAriaLabel: texts.storeAppBadgeAriaLabel,
|
|
2113
|
+
playBadgeAriaLabel: texts.storePlayBadgeAriaLabel,
|
|
2114
|
+
qrLabel: texts.storeQrLabel,
|
|
2115
|
+
qrCaption: texts.storeQrCaption
|
|
1766
2116
|
}),
|
|
1767
2117
|
/* @__PURE__ */ jsxs("section", {
|
|
1768
2118
|
class: `${faq} frak-ambassador__faq`,
|
|
@@ -1792,7 +2142,7 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1792
2142
|
children: texts.faq5Answer ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1793
2143
|
texts.faq5AnswerBeforeLink,
|
|
1794
2144
|
/* @__PURE__ */ jsx("a", {
|
|
1795
|
-
class: `
|
|
2145
|
+
class: `Ambassador_frakLink__awpcg01p frak-ambassador__faq-answer-link frak-link`,
|
|
1796
2146
|
href: FRAK_URL,
|
|
1797
2147
|
target: "_blank",
|
|
1798
2148
|
rel: "noopener",
|
|
@@ -1881,6 +2231,12 @@ registerWebComponent(Ambassador, "frak-ambassador", [...[
|
|
|
1881
2231
|
"faq5AnswerLinkText",
|
|
1882
2232
|
"faq5AnswerAfterLink",
|
|
1883
2233
|
"attributionBeforeLink",
|
|
1884
|
-
"attributionLinkText"
|
|
2234
|
+
"attributionLinkText",
|
|
2235
|
+
"myRewardsEyebrow",
|
|
2236
|
+
"myRewardsLinkedHeading",
|
|
2237
|
+
"myRewardsClaimCtaLabel",
|
|
2238
|
+
"myRewardsShareCtaLabel",
|
|
2239
|
+
"myRewardsWalletCtaLabel",
|
|
2240
|
+
"myRewardsShareAgainCtaLabel"
|
|
1885
2241
|
]], { shadow: false });
|
|
1886
2242
|
export { Ambassador };
|