@funnelsgrove/runtime 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/components/FunnelContext.d.ts +5 -2
- package/dist/components/FunnelContext.js +3 -0
- package/dist/components/FunnelEditorPanel.d.ts +3 -5
- package/dist/components/FunnelEditorPanel.js +3 -3
- package/dist/components/ManageSubscriptionScreen.d.ts +51 -0
- package/dist/components/ManageSubscriptionScreen.js +349 -0
- package/dist/components/RuntimeDevInfoBox.d.ts +23 -0
- package/dist/components/RuntimeDevInfoBox.js +363 -0
- package/dist/components/SubscriptionHandoffScreen.d.ts +31 -0
- package/dist/components/SubscriptionHandoffScreen.js +338 -0
- package/dist/config/builder-preview.protocol.d.ts +73 -0
- package/dist/config/builder-preview.protocol.js +3 -0
- package/dist/config/env.config.d.ts +44 -0
- package/dist/config/env.config.js +161 -0
- package/dist/config/font-config.d.ts +14 -0
- package/dist/config/font-config.js +101 -0
- package/dist/config/funnel-theme.d.ts +61 -10
- package/dist/config/funnel-theme.js +355 -35
- package/dist/config/funnel.manifest.types.d.ts +13 -7
- package/dist/content/step-content.d.ts +130 -0
- package/dist/content/step-content.js +381 -0
- package/dist/index.d.ts +33 -21
- package/dist/index.js +33 -21
- package/dist/runtime/browser-helpers.d.ts +1 -0
- package/dist/runtime/browser-helpers.js +14 -0
- package/dist/runtime/experiment-assignment.d.ts +13 -4
- package/dist/runtime/experiment-assignment.js +9 -27
- package/dist/runtime/funnel-attribution.d.ts +18 -0
- package/dist/runtime/funnel-attribution.js +226 -0
- package/dist/runtime/funnel-flow.d.ts +9 -10
- package/dist/runtime/funnel-flow.js +4 -18
- package/dist/runtime/funnel-manifest.validation.d.ts +1 -1
- package/dist/runtime/funnel-manifest.validation.js +2 -6
- package/dist/runtime/funnel-runtime.d.ts +2 -3
- package/dist/runtime/funnel-runtime.js +6 -13
- package/dist/runtime/posthog-flags.d.ts +30 -0
- package/dist/runtime/posthog-flags.js +71 -0
- package/dist/runtime/preview-bridge.d.ts +13 -3
- package/dist/runtime/preview-bridge.js +96 -4
- package/dist/runtime/preview-definition-overrides.d.ts +20 -0
- package/dist/runtime/preview-definition-overrides.js +148 -0
- package/dist/runtime/route-resolver.d.ts +2 -3
- package/dist/runtime/route-resolver.js +15 -26
- package/dist/runtime/subscription-handoff.d.ts +32 -0
- package/dist/runtime/subscription-handoff.js +113 -0
- package/dist/runtime/use-funnel-flow-controller.d.ts +19 -10
- package/dist/runtime/use-funnel-flow-controller.js +190 -159
- package/dist/sdk/userAnswers.d.ts +2 -2
- package/dist/services/api.service.d.ts +21 -4
- package/dist/services/api.service.js +165 -35
- package/dist/services/funnel-state.service.d.ts +8 -0
- package/dist/services/funnel-state.service.js +44 -0
- package/dist/services/preview-frame.service.d.ts +2 -2
- package/dist/services/preview-frame.service.js +2 -2
- package/dist/services/public-env.d.ts +69 -0
- package/dist/services/public-env.js +105 -0
- package/dist/services/runtime-api.config.d.ts +5 -0
- package/dist/services/runtime-api.config.js +12 -7
- package/dist/services/runtime-mode.service.d.ts +3 -0
- package/dist/services/runtime-mode.service.js +142 -4
- package/package.json +8 -2
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo, useState, useSyncExternalStore } from 'react';
|
|
4
|
+
import { getFunnelUserAttribution } from '../runtime/funnel-attribution.js';
|
|
5
|
+
import { resolveSubscriptionHandoff } from '../runtime/subscription-handoff.js';
|
|
6
|
+
import { runtimePublicConfig } from '../services/public-env.js';
|
|
7
|
+
import { useFunnel } from './FunnelContext.js';
|
|
8
|
+
const QR_CODE_IMAGE_SIZE = 320;
|
|
9
|
+
const browserSnapshotSeparator = '\n';
|
|
10
|
+
const subscribeToBrowserSnapshot = () => () => undefined;
|
|
11
|
+
const buildQrCodeImageUrl = (value) => {
|
|
12
|
+
if (!value) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return `https://api.qrserver.com/v1/create-qr-code/?size=${QR_CODE_IMAGE_SIZE}x${QR_CODE_IMAGE_SIZE}&data=${encodeURIComponent(value)}`;
|
|
16
|
+
};
|
|
17
|
+
const buildMailtoHref = (input) => {
|
|
18
|
+
const searchParams = new URLSearchParams({
|
|
19
|
+
subject: input.subject,
|
|
20
|
+
body: input.lines.join('\n'),
|
|
21
|
+
});
|
|
22
|
+
return `mailto:${encodeURIComponent(input.recipient || '')}?${searchParams.toString()}`;
|
|
23
|
+
};
|
|
24
|
+
const getStoreLinkContent = (links, id) => {
|
|
25
|
+
var _a;
|
|
26
|
+
return (_a = links.find((link) => link.id === id)) !== null && _a !== void 0 ? _a : null;
|
|
27
|
+
};
|
|
28
|
+
function AppleBadgeIcon() {
|
|
29
|
+
return (_jsx("svg", { viewBox: '0 0 24 24', "aria-hidden": 'true', className: 'subscription-handoff-store-icon', children: _jsx("path", { fill: 'currentColor', d: 'M16.78 12.28c.03 3.21 2.82 4.28 2.85 4.29-.02.08-.44 1.52-1.46 3.01-.88 1.29-1.8 2.57-3.24 2.6-1.41.03-1.86-.84-3.46-.84-1.6 0-2.1.82-3.44.87-1.39.05-2.44-1.39-3.33-2.68-1.81-2.62-3.2-7.4-1.34-10.63.93-1.6 2.58-2.62 4.37-2.65 1.37-.03 2.67.92 3.46.92.79 0 2.27-1.14 3.83-.97.65.03 2.49.26 3.66 1.98-.09.06-2.19 1.28-2.16 3.8Zm-2.63-6.9c.73-.89 1.22-2.13 1.08-3.38-1.05.04-2.31.7-3.07 1.59-.67.77-1.25 2.02-1.09 3.21 1.17.09 2.35-.59 3.08-1.42Z' }) }));
|
|
30
|
+
}
|
|
31
|
+
function PlayStoreIcon() {
|
|
32
|
+
return (_jsxs("svg", { viewBox: '0 0 24 24', "aria-hidden": 'true', className: 'subscription-handoff-store-icon', children: [_jsx("path", { fill: '#34A853', d: 'M4.2 4.4 13.9 12 4.2 19.6a2.2 2.2 0 0 1-.2-.96V5.36c0-.34.07-.67.2-.96Z' }), _jsx("path", { fill: '#4285F4', d: 'M15.72 13.43 6.2 20.84l7.28-4.17 2.24-3.24Z' }), _jsx("path", { fill: '#FBBC04', d: 'm20.53 10.54-2.8-1.61-2.52 2.23 2.52 2.24 2.85-1.63c.96-.55.96-1.69-.05-2.23Z' }), _jsx("path", { fill: '#EA4335', d: 'M6.2 3.16 15.72 10.57l-2.24 3.24Z' })] }));
|
|
33
|
+
}
|
|
34
|
+
function WebLinkIcon() {
|
|
35
|
+
return (_jsx("svg", { viewBox: '0 0 24 24', "aria-hidden": 'true', className: 'subscription-handoff-store-icon', children: _jsx("path", { fill: 'none', stroke: 'currentColor', strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: '1.8', d: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 0c2.5 2.47 3.75 5.47 3.75 9S14.5 18.53 12 21m0-18c-2.5 2.47-3.75 5.47-3.75 9S9.5 18.53 12 21M3.6 9h16.8M3.6 15h16.8' }) }));
|
|
36
|
+
}
|
|
37
|
+
const renderStoreIcon = (variant) => {
|
|
38
|
+
if (variant === 'ios') {
|
|
39
|
+
return _jsx(AppleBadgeIcon, {});
|
|
40
|
+
}
|
|
41
|
+
if (variant === 'android') {
|
|
42
|
+
return _jsx(PlayStoreIcon, {});
|
|
43
|
+
}
|
|
44
|
+
return _jsx(WebLinkIcon, {});
|
|
45
|
+
};
|
|
46
|
+
export function SubscriptionHandoffScreen({ stepId, content, confirmationUrl, nodeId, }) {
|
|
47
|
+
const { user } = useFunnel();
|
|
48
|
+
const [autoOpenAttempted, setAutoOpenAttempted] = useState(false);
|
|
49
|
+
const [emailSent, setEmailSent] = useState(false);
|
|
50
|
+
const browserSnapshotKey = useSyncExternalStore(subscribeToBrowserSnapshot, () => [
|
|
51
|
+
confirmationUrl !== null && confirmationUrl !== void 0 ? confirmationUrl : window.location.href,
|
|
52
|
+
navigator.userAgent,
|
|
53
|
+
].join(browserSnapshotSeparator), () => [
|
|
54
|
+
confirmationUrl !== null && confirmationUrl !== void 0 ? confirmationUrl : '',
|
|
55
|
+
'',
|
|
56
|
+
].join(browserSnapshotSeparator));
|
|
57
|
+
const browserSnapshot = useMemo(() => {
|
|
58
|
+
const [resolvedConfirmationUrl = '', userAgent = ''] = browserSnapshotKey.split(browserSnapshotSeparator);
|
|
59
|
+
return {
|
|
60
|
+
confirmationUrl: resolvedConfirmationUrl || null,
|
|
61
|
+
userAgent: userAgent || null,
|
|
62
|
+
};
|
|
63
|
+
}, [browserSnapshotKey]);
|
|
64
|
+
const handoff = useMemo(() => {
|
|
65
|
+
return resolveSubscriptionHandoff({
|
|
66
|
+
userId: user.id,
|
|
67
|
+
email: user.email,
|
|
68
|
+
confirmationUrl: browserSnapshot.confirmationUrl,
|
|
69
|
+
userAgent: browserSnapshot.userAgent,
|
|
70
|
+
attribution: getFunnelUserAttribution(user.document),
|
|
71
|
+
config: {
|
|
72
|
+
iosAppStoreUrl: runtimePublicConfig.iosAppStoreUrl,
|
|
73
|
+
androidPlayStoreUrl: runtimePublicConfig.androidPlayStoreUrl,
|
|
74
|
+
universalLink: runtimePublicConfig.universalLink,
|
|
75
|
+
iosDeepLink: runtimePublicConfig.iosDeepLink,
|
|
76
|
+
androidDeepLink: runtimePublicConfig.androidDeepLink,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}, [browserSnapshot, user.document, user.email, user.id]);
|
|
80
|
+
const qrCodeImageUrl = useMemo(() => buildQrCodeImageUrl(handoff.qrConfirmationUrl), [handoff.qrConfirmationUrl]);
|
|
81
|
+
const installLinks = useMemo(() => {
|
|
82
|
+
const links = [];
|
|
83
|
+
const iosLinkContent = getStoreLinkContent(content.storeLinks, 'ios');
|
|
84
|
+
if (handoff.iosStoreUrl && iosLinkContent) {
|
|
85
|
+
links.push({
|
|
86
|
+
id: 'ios',
|
|
87
|
+
href: handoff.iosStoreUrl,
|
|
88
|
+
eyebrow: iosLinkContent.eyebrow,
|
|
89
|
+
title: iosLinkContent.title,
|
|
90
|
+
variant: 'ios',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const androidLinkContent = getStoreLinkContent(content.storeLinks, 'android');
|
|
94
|
+
if (handoff.androidStoreUrl && androidLinkContent) {
|
|
95
|
+
links.push({
|
|
96
|
+
id: 'android',
|
|
97
|
+
href: handoff.androidStoreUrl,
|
|
98
|
+
eyebrow: androidLinkContent.eyebrow,
|
|
99
|
+
title: androidLinkContent.title,
|
|
100
|
+
variant: 'android',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const webLinkContent = getStoreLinkContent(content.storeLinks, 'web');
|
|
104
|
+
const shouldShowWebLink = handoff.platform === 'desktop' || handoff.platform === 'android';
|
|
105
|
+
if (shouldShowWebLink && handoff.webLinkUrl && webLinkContent) {
|
|
106
|
+
links.push({
|
|
107
|
+
id: 'web',
|
|
108
|
+
href: handoff.webLinkUrl,
|
|
109
|
+
eyebrow: webLinkContent.eyebrow,
|
|
110
|
+
title: webLinkContent.title,
|
|
111
|
+
variant: 'web',
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return links;
|
|
115
|
+
}, [
|
|
116
|
+
content.storeLinks,
|
|
117
|
+
handoff.androidStoreUrl,
|
|
118
|
+
handoff.iosStoreUrl,
|
|
119
|
+
handoff.platform,
|
|
120
|
+
handoff.webLinkUrl,
|
|
121
|
+
]);
|
|
122
|
+
const emailHref = useMemo(() => {
|
|
123
|
+
const lines = [
|
|
124
|
+
content.emailIntro,
|
|
125
|
+
'',
|
|
126
|
+
handoff.emailOpenAppUrl ? `${content.emailOpenAppLabel}: ${handoff.emailOpenAppUrl}` : null,
|
|
127
|
+
handoff.emailIosDeepLinkUrl
|
|
128
|
+
? `${content.emailIosDeepLinkLabel}: ${handoff.emailIosDeepLinkUrl}`
|
|
129
|
+
: null,
|
|
130
|
+
handoff.emailAndroidDeepLinkUrl
|
|
131
|
+
? `${content.emailAndroidDeepLinkLabel}: ${handoff.emailAndroidDeepLinkUrl}`
|
|
132
|
+
: null,
|
|
133
|
+
handoff.emailIosStoreUrl
|
|
134
|
+
? `${content.emailStoreLabels.ios}: ${handoff.emailIosStoreUrl}`
|
|
135
|
+
: null,
|
|
136
|
+
handoff.emailAndroidStoreUrl
|
|
137
|
+
? `${content.emailStoreLabels.android}: ${handoff.emailAndroidStoreUrl}`
|
|
138
|
+
: null,
|
|
139
|
+
].filter((line) => Boolean(line));
|
|
140
|
+
return buildMailtoHref({
|
|
141
|
+
recipient: user.email || null,
|
|
142
|
+
subject: content.emailSubject,
|
|
143
|
+
lines,
|
|
144
|
+
});
|
|
145
|
+
}, [content, handoff, user.email]);
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
const openAppUrl = handoff.openAppUrl;
|
|
148
|
+
if (handoff.platform === 'desktop' || typeof window === 'undefined' || !openAppUrl) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const attemptKey = `app-deals:deep-link-attempt:${stepId}:${user.id}`;
|
|
152
|
+
if (window.sessionStorage.getItem(attemptKey) === '1') {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
window.sessionStorage.setItem(attemptKey, '1');
|
|
156
|
+
const timer = window.setTimeout(() => {
|
|
157
|
+
window.location.assign(openAppUrl);
|
|
158
|
+
setAutoOpenAttempted(true);
|
|
159
|
+
}, 500);
|
|
160
|
+
return () => window.clearTimeout(timer);
|
|
161
|
+
}, [handoff.openAppUrl, handoff.platform, stepId, user.id]);
|
|
162
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: 'subscription-handoff-step', "data-node-id": nodeId || stepId, children: [_jsxs("header", { className: 'subscription-handoff-head', children: [_jsx("p", { className: 'subscription-handoff-kicker', children: content.kicker }), _jsx("h2", { className: 'subscription-handoff-title', children: content.title })] }), installLinks.length > 0 ? (_jsx("div", { className: 'subscription-handoff-store-links', children: installLinks.map((link) => (_jsxs("a", { href: link.href, target: '_blank', rel: 'noopener noreferrer', "aria-label": `${link.eyebrow} ${link.title}`, className: `subscription-handoff-store-badge is-${link.variant}`, children: [renderStoreIcon(link.variant), _jsxs("span", { className: 'subscription-handoff-store-copy', children: [_jsx("span", { className: 'subscription-handoff-store-eyebrow', children: link.eyebrow }), _jsx("span", { className: 'subscription-handoff-store-title', children: link.title })] })] }, link.id))) })) : null, _jsx("p", { className: 'subscription-handoff-copy', children: qrCodeImageUrl ? content.copyWithQr : content.copyWithoutQr }), qrCodeImageUrl && handoff.qrConfirmationUrl ? (_jsx("a", { href: handoff.qrConfirmationUrl, className: 'subscription-handoff-qr-card', target: '_blank', rel: 'noopener noreferrer', "aria-label": content.qrOpenLabel, children: _jsx("span", { "aria-hidden": 'true', className: 'subscription-handoff-qr-image', style: { backgroundImage: `url(${qrCodeImageUrl})` } }) })) : null, _jsx("p", { className: 'subscription-handoff-note', children: content.note }), handoff.platform !== 'desktop' && handoff.openAppUrl ? (_jsx("a", { href: handoff.openAppUrl, className: 'subscription-handoff-open-app', children: content.openAppLabel })) : null, _jsx("a", { href: emailHref, className: 'subscription-handoff-email-button', onClick: () => setEmailSent(true), children: content.emailButtonLabel }), emailSent ? (_jsx("p", { className: 'subscription-handoff-status', children: content.emailSentStatus })) : null, autoOpenAttempted ? (_jsx("p", { className: 'subscription-handoff-status', children: content.autoOpenStatus })) : null] }), _jsx("style", { children: subscriptionHandoffScreenStyles })] }));
|
|
163
|
+
}
|
|
164
|
+
const subscriptionHandoffScreenStyles = `
|
|
165
|
+
.subscription-handoff-step {
|
|
166
|
+
position: absolute;
|
|
167
|
+
inset: 0;
|
|
168
|
+
overflow-y: auto;
|
|
169
|
+
-webkit-overflow-scrolling: touch;
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
align-items: center;
|
|
173
|
+
text-align: center;
|
|
174
|
+
gap: 16px;
|
|
175
|
+
padding: calc(env(safe-area-inset-top, 0px) + 84px) 20px calc(env(safe-area-inset-bottom, 0px) + 32px);
|
|
176
|
+
background: var(--color-bg, #f5f7fa);
|
|
177
|
+
color: var(--color-text, #262729);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.subscription-handoff-head {
|
|
181
|
+
width: min(100%, 360px);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.subscription-handoff-kicker {
|
|
185
|
+
margin: 0;
|
|
186
|
+
color: var(--color-secondary, #f28100);
|
|
187
|
+
font-size: clamp(36px, 9vw, 52px);
|
|
188
|
+
line-height: 1;
|
|
189
|
+
font-weight: 800;
|
|
190
|
+
letter-spacing: -0.03em;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.subscription-handoff-title {
|
|
194
|
+
margin: 14px 0 0;
|
|
195
|
+
color: var(--color-text, #262729);
|
|
196
|
+
font-size: clamp(28px, 7vw, 36px);
|
|
197
|
+
line-height: 1.12;
|
|
198
|
+
font-weight: 800;
|
|
199
|
+
letter-spacing: -0.03em;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.subscription-handoff-store-links {
|
|
203
|
+
width: min(100%, 360px);
|
|
204
|
+
display: grid;
|
|
205
|
+
gap: 12px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.subscription-handoff-store-badge {
|
|
209
|
+
box-sizing: border-box;
|
|
210
|
+
min-height: 72px;
|
|
211
|
+
border-radius: 18px;
|
|
212
|
+
padding: 12px 16px;
|
|
213
|
+
display: flex;
|
|
214
|
+
align-items: center;
|
|
215
|
+
gap: 14px;
|
|
216
|
+
text-decoration: none;
|
|
217
|
+
background: #101114;
|
|
218
|
+
color: #fff;
|
|
219
|
+
box-shadow: 0 18px 40px rgb(16 17 20 / 16%);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.subscription-handoff-store-badge.is-android {
|
|
223
|
+
background: linear-gradient(135deg, #151717 0%, #111827 100%);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.subscription-handoff-store-badge.is-web {
|
|
227
|
+
border: 1px solid rgb(38 39 41 / 12%);
|
|
228
|
+
background: #fff;
|
|
229
|
+
color: var(--color-text, #262729);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.subscription-handoff-store-icon {
|
|
233
|
+
width: 28px;
|
|
234
|
+
height: 28px;
|
|
235
|
+
flex: 0 0 auto;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.subscription-handoff-store-copy {
|
|
239
|
+
display: flex;
|
|
240
|
+
flex-direction: column;
|
|
241
|
+
align-items: flex-start;
|
|
242
|
+
text-align: left;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.subscription-handoff-store-eyebrow {
|
|
246
|
+
font-size: 12px;
|
|
247
|
+
line-height: 1.1;
|
|
248
|
+
font-weight: 500;
|
|
249
|
+
opacity: 0.82;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.subscription-handoff-store-title {
|
|
253
|
+
margin-top: 2px;
|
|
254
|
+
font-size: 24px;
|
|
255
|
+
line-height: 1.08;
|
|
256
|
+
font-weight: 700;
|
|
257
|
+
letter-spacing: -0.02em;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.subscription-handoff-copy,
|
|
261
|
+
.subscription-handoff-note,
|
|
262
|
+
.subscription-handoff-status {
|
|
263
|
+
width: min(100%, 360px);
|
|
264
|
+
margin: 0;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.subscription-handoff-copy {
|
|
268
|
+
color: var(--color-text, #262729);
|
|
269
|
+
font-size: 16px;
|
|
270
|
+
line-height: 1.5;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.subscription-handoff-qr-card {
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
justify-content: center;
|
|
277
|
+
width: min(100%, 272px);
|
|
278
|
+
aspect-ratio: 1;
|
|
279
|
+
padding: 18px;
|
|
280
|
+
border-radius: 24px;
|
|
281
|
+
background: #fff;
|
|
282
|
+
box-shadow: 0 20px 48px rgb(38 39 41 / 12%);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.subscription-handoff-qr-image {
|
|
286
|
+
display: block;
|
|
287
|
+
width: 100%;
|
|
288
|
+
height: 100%;
|
|
289
|
+
background: center / contain no-repeat;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.subscription-handoff-note {
|
|
293
|
+
color: rgb(38 39 41 / 72%);
|
|
294
|
+
font-size: 14px;
|
|
295
|
+
line-height: 1.5;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.subscription-handoff-open-app,
|
|
299
|
+
.subscription-handoff-email-button {
|
|
300
|
+
width: min(100%, 360px);
|
|
301
|
+
min-height: 56px;
|
|
302
|
+
border-radius: 16px;
|
|
303
|
+
display: inline-flex;
|
|
304
|
+
align-items: center;
|
|
305
|
+
justify-content: center;
|
|
306
|
+
text-decoration: none;
|
|
307
|
+
font-size: 18px;
|
|
308
|
+
line-height: 1.2;
|
|
309
|
+
font-weight: 700;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.subscription-handoff-open-app {
|
|
313
|
+
background: var(--color-primary, #4db53f);
|
|
314
|
+
color: #fff;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.subscription-handoff-email-button {
|
|
318
|
+
border: 1px solid rgb(38 39 41 / 12%);
|
|
319
|
+
background: #fff;
|
|
320
|
+
color: var(--color-text, #262729);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.subscription-handoff-status {
|
|
324
|
+
font-size: 14px;
|
|
325
|
+
line-height: 1.45;
|
|
326
|
+
color: rgb(38 39 41 / 72%);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
@media (max-width: 480px) {
|
|
330
|
+
.subscription-handoff-step {
|
|
331
|
+
padding-inline: 16px;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.subscription-handoff-store-title {
|
|
335
|
+
font-size: 22px;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
`;
|
|
@@ -2,3 +2,76 @@ export declare const BUILDER_PREVIEW_READY = "builder.preview.ready";
|
|
|
2
2
|
export declare const BUILDER_PREVIEW_ACTIVE_STEP_CHANGED = "builder.preview.activeStepChanged";
|
|
3
3
|
export declare const BUILDER_PREVIEW_GO_TO_STEP = "builder.preview.goToStep";
|
|
4
4
|
export declare const BUILDER_PREVIEW_RUNTIME_MODE_CHANGED = "builder.preview.runtimeModeChanged";
|
|
5
|
+
export declare const BUILDER_PREVIEW_DEFINITION_PATCH = "builder.preview.definitionPatch";
|
|
6
|
+
export declare const BUILDER_PREVIEW_VARIABLE_VALUES_CHANGED = "builder.preview.variableValuesChanged";
|
|
7
|
+
export declare const BUILDER_PREVIEW_PAYWALL_PLANS_CHANGED = "builder.preview.paywallPlansChanged";
|
|
8
|
+
export type BuilderPreviewReadyMessage = {
|
|
9
|
+
type: typeof BUILDER_PREVIEW_READY;
|
|
10
|
+
stepId: string;
|
|
11
|
+
};
|
|
12
|
+
export type BuilderPreviewActiveStepChangedMessage = {
|
|
13
|
+
type: typeof BUILDER_PREVIEW_ACTIVE_STEP_CHANGED;
|
|
14
|
+
stepId: string;
|
|
15
|
+
};
|
|
16
|
+
export type BuilderPreviewRuntimeModeChangedMessage = {
|
|
17
|
+
type: typeof BUILDER_PREVIEW_RUNTIME_MODE_CHANGED;
|
|
18
|
+
mode: 'test' | 'live';
|
|
19
|
+
};
|
|
20
|
+
export type BuilderPreviewGoToStepMessage = {
|
|
21
|
+
type: typeof BUILDER_PREVIEW_GO_TO_STEP;
|
|
22
|
+
stepId: string;
|
|
23
|
+
};
|
|
24
|
+
export type BuilderPreviewContentDefinitionPatch = {
|
|
25
|
+
kind: 'content';
|
|
26
|
+
stepId: string;
|
|
27
|
+
locale: string;
|
|
28
|
+
content: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
export type BuilderPreviewPricingDefinitionPatch = {
|
|
31
|
+
kind: 'pricing';
|
|
32
|
+
stepId: string;
|
|
33
|
+
pricing: {
|
|
34
|
+
defaultOfferKey: string;
|
|
35
|
+
defaultOfferOrder: readonly string[];
|
|
36
|
+
countryOverrides?: Record<string, {
|
|
37
|
+
defaultOfferKey?: string;
|
|
38
|
+
offerOrder?: readonly string[];
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type BuilderPreviewDefinitionPatch = BuilderPreviewContentDefinitionPatch | BuilderPreviewPricingDefinitionPatch;
|
|
43
|
+
export type BuilderPreviewDefinitionPatchMessage = {
|
|
44
|
+
type: typeof BUILDER_PREVIEW_DEFINITION_PATCH;
|
|
45
|
+
patch: BuilderPreviewDefinitionPatch;
|
|
46
|
+
};
|
|
47
|
+
export type BuilderPreviewVariableValuesChangedMessage = {
|
|
48
|
+
type: typeof BUILDER_PREVIEW_VARIABLE_VALUES_CHANGED;
|
|
49
|
+
stepId: string;
|
|
50
|
+
values: Record<string, string>;
|
|
51
|
+
};
|
|
52
|
+
export type BuilderPreviewPaywallPlan = {
|
|
53
|
+
id: string;
|
|
54
|
+
title: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
providerPlanId?: string;
|
|
57
|
+
priceLabel: string;
|
|
58
|
+
oldPriceLabel?: string;
|
|
59
|
+
featuredTag?: string;
|
|
60
|
+
perDayAmount: string;
|
|
61
|
+
perDayLabel: string;
|
|
62
|
+
amountCents: number;
|
|
63
|
+
comparison?: {
|
|
64
|
+
perDay?: string;
|
|
65
|
+
perWeek?: string;
|
|
66
|
+
perMonth?: string;
|
|
67
|
+
perYear?: string;
|
|
68
|
+
};
|
|
69
|
+
checkoutOriginalAmountCents?: number;
|
|
70
|
+
checkoutSummaryLabel?: string;
|
|
71
|
+
source: 'stripe' | 'config';
|
|
72
|
+
};
|
|
73
|
+
export type BuilderPreviewPaywallPlansChangedMessage = {
|
|
74
|
+
type: typeof BUILDER_PREVIEW_PAYWALL_PLANS_CHANGED;
|
|
75
|
+
stepId: string;
|
|
76
|
+
plans: BuilderPreviewPaywallPlan[];
|
|
77
|
+
};
|
|
@@ -2,3 +2,6 @@ export const BUILDER_PREVIEW_READY = 'builder.preview.ready';
|
|
|
2
2
|
export const BUILDER_PREVIEW_ACTIVE_STEP_CHANGED = 'builder.preview.activeStepChanged';
|
|
3
3
|
export const BUILDER_PREVIEW_GO_TO_STEP = 'builder.preview.goToStep';
|
|
4
4
|
export const BUILDER_PREVIEW_RUNTIME_MODE_CHANGED = 'builder.preview.runtimeModeChanged';
|
|
5
|
+
export const BUILDER_PREVIEW_DEFINITION_PATCH = 'builder.preview.definitionPatch';
|
|
6
|
+
export const BUILDER_PREVIEW_VARIABLE_VALUES_CHANGED = 'builder.preview.variableValuesChanged';
|
|
7
|
+
export const BUILDER_PREVIEW_PAYWALL_PLANS_CHANGED = 'builder.preview.paywallPlansChanged';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const readRuntimeEnv: (reader: () => string | undefined) => string | undefined;
|
|
2
|
+
export declare const isDevelopmentRuntime: () => boolean;
|
|
3
|
+
export declare const RUNTIME_ENV_KEYS: {
|
|
4
|
+
readonly appDealsApiBaseUrl: readonly ["NEXT_PUBLIC_APP_DEALS_API_BASE_URL", "APP_DEALS_API_BASE_URL"];
|
|
5
|
+
readonly funnelSdkPublishableKey: readonly ["NEXT_PUBLIC_FUNNEL_SDK_PUBLISHABLE_KEY", "NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY", "FUNNEL_SDK_PUBLISHABLE_KEY"];
|
|
6
|
+
readonly funnelId: readonly ["NEXT_PUBLIC_FUNNEL_ID", "FUNNEL_ID", "NEXT_PUBLIC_RAG_FUNNEL_ID", "RAG_FUNNEL_ID", "NEXT_PUBLIC_PREVIEW_TEST_FUNNEL_ID", "PREVIEW_TEST_FUNNEL_ID"];
|
|
7
|
+
readonly projectId: readonly ["NEXT_PUBLIC_PROJECT_ID", "PROJECT_ID"];
|
|
8
|
+
readonly funnelVersionId: readonly ["NEXT_PUBLIC_FUNNEL_VERSION_ID", "FUNNEL_VERSION_ID"];
|
|
9
|
+
readonly posthogProjectApiKey: readonly ["NEXT_PUBLIC_POSTHOG_PROJECT_API_KEY", "POSTHOG_PROJECT_API_KEY"];
|
|
10
|
+
readonly supportEmail: readonly ["NEXT_PUBLIC_FUNNEL_SUPPORT_EMAIL", "FUNNEL_SUPPORT_EMAIL"];
|
|
11
|
+
readonly iosAppStoreUrl: readonly ["NEXT_PUBLIC_IOS_APP_STORE_URL", "IOS_APP_STORE_URL"];
|
|
12
|
+
readonly androidPlayStoreUrl: readonly ["NEXT_PUBLIC_ANDROID_PLAY_STORE_URL", "ANDROID_PLAY_STORE_URL", "GOOGLE_PLAY_URL"];
|
|
13
|
+
readonly appStoreId: readonly ["NEXT_PUBLIC_FUNNEL_APP_STORE_ID", "FUNNEL_APP_STORE_ID"];
|
|
14
|
+
readonly googleStoreId: readonly ["NEXT_PUBLIC_FUNNEL_GOOGLE_STORE_ID", "FUNNEL_GOOGLE_STORE_ID"];
|
|
15
|
+
readonly timezone: readonly ["NEXT_PUBLIC_FUNNEL_TIMEZONE", "FUNNEL_TIMEZONE"];
|
|
16
|
+
readonly faviconUrl: readonly ["NEXT_PUBLIC_FUNNEL_FAVICON_URL", "FUNNEL_FAVICON_URL"];
|
|
17
|
+
readonly pageTitle: readonly ["NEXT_PUBLIC_FUNNEL_PAGE_TITLE", "FUNNEL_PAGE_TITLE"];
|
|
18
|
+
readonly pageDescription: readonly ["NEXT_PUBLIC_FUNNEL_PAGE_DESCRIPTION", "FUNNEL_PAGE_DESCRIPTION"];
|
|
19
|
+
readonly pagePreviewImageUrl: readonly ["NEXT_PUBLIC_FUNNEL_PAGE_PREVIEW_IMAGE_URL", "FUNNEL_PAGE_PREVIEW_IMAGE_URL"];
|
|
20
|
+
readonly companyName: readonly ["NEXT_PUBLIC_FUNNEL_COMPANY_NAME", "FUNNEL_COMPANY_NAME"];
|
|
21
|
+
readonly companyAddress: readonly ["NEXT_PUBLIC_FUNNEL_COMPANY_ADDRESS", "FUNNEL_COMPANY_ADDRESS"];
|
|
22
|
+
readonly companyCountry: readonly ["NEXT_PUBLIC_FUNNEL_COMPANY_COUNTRY", "FUNNEL_COMPANY_COUNTRY"];
|
|
23
|
+
readonly privacyUrl: readonly ["NEXT_PUBLIC_FUNNEL_PRIVACY_URL", "FUNNEL_PRIVACY_URL"];
|
|
24
|
+
readonly termsUrl: readonly ["NEXT_PUBLIC_FUNNEL_TERMS_URL", "FUNNEL_TERMS_URL"];
|
|
25
|
+
readonly universalLink: readonly ["NEXT_PUBLIC_FUNNEL_UNIVERSAL_LINK", "WEB_LANDING_URL", "FUNNEL_UNIVERSAL_LINK"];
|
|
26
|
+
readonly iosDeepLink: readonly ["NEXT_PUBLIC_FUNNEL_IOS_DEEP_LINK", "APPSTORE_DEEPLINK_URL", "FUNNEL_IOS_DEEP_LINK"];
|
|
27
|
+
readonly androidDeepLink: readonly ["NEXT_PUBLIC_FUNNEL_ANDROID_DEEP_LINK", "FUNNEL_ANDROID_DEEP_LINK"];
|
|
28
|
+
readonly qrTarget: readonly ["NEXT_PUBLIC_FUNNEL_QR_TARGET", "FUNNEL_QR_TARGET"];
|
|
29
|
+
readonly stripeEnabled: readonly ["STRIPE_ENABLED"];
|
|
30
|
+
readonly stripeActiveMode: readonly ["NEXT_PUBLIC_STRIPE_ACTIVE_MODE", "STRIPE_ACTIVE_MODE"];
|
|
31
|
+
readonly stripePublishableKey: readonly ["NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY", "STRIPE_PUBLISHABLE_KEY"];
|
|
32
|
+
readonly stripeTestPublishableKey: readonly ["NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLE_KEY", "STRIPE_TEST_PUBLISHABLE_KEY"];
|
|
33
|
+
readonly stripeLivePublishableKey: readonly ["NEXT_PUBLIC_STRIPE_LIVE_PUBLISHABLE_KEY", "STRIPE_LIVE_PUBLISHABLE_KEY"];
|
|
34
|
+
readonly metaPixelEnabled: readonly ["NEXT_PUBLIC_META_PIXEL_ENABLED", "META_PIXEL_ENABLED"];
|
|
35
|
+
readonly metaPixelId: readonly ["NEXT_PUBLIC_META_PIXEL_ID", "META_PIXEL_ID"];
|
|
36
|
+
readonly funnelCustomDomain: readonly ["FUNNEL_CUSTOM_DOMAIN"];
|
|
37
|
+
readonly claimbeeWeeklyPriceId: readonly ["NEXT_PUBLIC_CLAIMBEE_WEEKLY_PRICE_ID", "CLAIMBEE_WEEKLY_PRICE_ID"];
|
|
38
|
+
readonly claimbeeMonthlyPriceId: readonly ["NEXT_PUBLIC_CLAIMBEE_MONTHLY_PRICE_ID", "CLAIMBEE_MONTHLY_PRICE_ID"];
|
|
39
|
+
readonly claimbeeYearlyPriceId: readonly ["NEXT_PUBLIC_CLAIMBEE_YEARLY_PRICE_ID", "CLAIMBEE_YEARLY_PRICE_ID"];
|
|
40
|
+
};
|
|
41
|
+
export type RuntimeEnvConfig = {
|
|
42
|
+
readonly [Key in keyof typeof RUNTIME_ENV_KEYS]: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
export declare const runtimeEnvConfig: RuntimeEnvConfig;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
export const readRuntimeEnv = (reader) => {
|
|
2
|
+
try {
|
|
3
|
+
const value = reader();
|
|
4
|
+
return typeof value === 'string' ? value : undefined;
|
|
5
|
+
}
|
|
6
|
+
catch (_a) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
export const isDevelopmentRuntime = () => {
|
|
11
|
+
const nodeEnv = readRuntimeEnv(() => process.env.NODE_ENV);
|
|
12
|
+
return typeof nodeEnv === 'string' && nodeEnv !== 'production';
|
|
13
|
+
};
|
|
14
|
+
export const RUNTIME_ENV_KEYS = {
|
|
15
|
+
appDealsApiBaseUrl: ['NEXT_PUBLIC_APP_DEALS_API_BASE_URL', 'APP_DEALS_API_BASE_URL'],
|
|
16
|
+
funnelSdkPublishableKey: [
|
|
17
|
+
'NEXT_PUBLIC_FUNNEL_SDK_PUBLISHABLE_KEY',
|
|
18
|
+
'NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY',
|
|
19
|
+
'FUNNEL_SDK_PUBLISHABLE_KEY',
|
|
20
|
+
],
|
|
21
|
+
funnelId: [
|
|
22
|
+
'NEXT_PUBLIC_FUNNEL_ID',
|
|
23
|
+
'FUNNEL_ID',
|
|
24
|
+
'NEXT_PUBLIC_RAG_FUNNEL_ID',
|
|
25
|
+
'RAG_FUNNEL_ID',
|
|
26
|
+
'NEXT_PUBLIC_PREVIEW_TEST_FUNNEL_ID',
|
|
27
|
+
'PREVIEW_TEST_FUNNEL_ID',
|
|
28
|
+
],
|
|
29
|
+
projectId: ['NEXT_PUBLIC_PROJECT_ID', 'PROJECT_ID'],
|
|
30
|
+
funnelVersionId: ['NEXT_PUBLIC_FUNNEL_VERSION_ID', 'FUNNEL_VERSION_ID'],
|
|
31
|
+
posthogProjectApiKey: ['NEXT_PUBLIC_POSTHOG_PROJECT_API_KEY', 'POSTHOG_PROJECT_API_KEY'],
|
|
32
|
+
supportEmail: ['NEXT_PUBLIC_FUNNEL_SUPPORT_EMAIL', 'FUNNEL_SUPPORT_EMAIL'],
|
|
33
|
+
iosAppStoreUrl: ['NEXT_PUBLIC_IOS_APP_STORE_URL', 'IOS_APP_STORE_URL'],
|
|
34
|
+
androidPlayStoreUrl: ['NEXT_PUBLIC_ANDROID_PLAY_STORE_URL', 'ANDROID_PLAY_STORE_URL', 'GOOGLE_PLAY_URL'],
|
|
35
|
+
appStoreId: ['NEXT_PUBLIC_FUNNEL_APP_STORE_ID', 'FUNNEL_APP_STORE_ID'],
|
|
36
|
+
googleStoreId: ['NEXT_PUBLIC_FUNNEL_GOOGLE_STORE_ID', 'FUNNEL_GOOGLE_STORE_ID'],
|
|
37
|
+
timezone: ['NEXT_PUBLIC_FUNNEL_TIMEZONE', 'FUNNEL_TIMEZONE'],
|
|
38
|
+
faviconUrl: ['NEXT_PUBLIC_FUNNEL_FAVICON_URL', 'FUNNEL_FAVICON_URL'],
|
|
39
|
+
pageTitle: ['NEXT_PUBLIC_FUNNEL_PAGE_TITLE', 'FUNNEL_PAGE_TITLE'],
|
|
40
|
+
pageDescription: ['NEXT_PUBLIC_FUNNEL_PAGE_DESCRIPTION', 'FUNNEL_PAGE_DESCRIPTION'],
|
|
41
|
+
pagePreviewImageUrl: ['NEXT_PUBLIC_FUNNEL_PAGE_PREVIEW_IMAGE_URL', 'FUNNEL_PAGE_PREVIEW_IMAGE_URL'],
|
|
42
|
+
companyName: ['NEXT_PUBLIC_FUNNEL_COMPANY_NAME', 'FUNNEL_COMPANY_NAME'],
|
|
43
|
+
companyAddress: ['NEXT_PUBLIC_FUNNEL_COMPANY_ADDRESS', 'FUNNEL_COMPANY_ADDRESS'],
|
|
44
|
+
companyCountry: ['NEXT_PUBLIC_FUNNEL_COMPANY_COUNTRY', 'FUNNEL_COMPANY_COUNTRY'],
|
|
45
|
+
privacyUrl: ['NEXT_PUBLIC_FUNNEL_PRIVACY_URL', 'FUNNEL_PRIVACY_URL'],
|
|
46
|
+
termsUrl: ['NEXT_PUBLIC_FUNNEL_TERMS_URL', 'FUNNEL_TERMS_URL'],
|
|
47
|
+
universalLink: ['NEXT_PUBLIC_FUNNEL_UNIVERSAL_LINK', 'WEB_LANDING_URL', 'FUNNEL_UNIVERSAL_LINK'],
|
|
48
|
+
iosDeepLink: ['NEXT_PUBLIC_FUNNEL_IOS_DEEP_LINK', 'APPSTORE_DEEPLINK_URL', 'FUNNEL_IOS_DEEP_LINK'],
|
|
49
|
+
androidDeepLink: ['NEXT_PUBLIC_FUNNEL_ANDROID_DEEP_LINK', 'FUNNEL_ANDROID_DEEP_LINK'],
|
|
50
|
+
qrTarget: ['NEXT_PUBLIC_FUNNEL_QR_TARGET', 'FUNNEL_QR_TARGET'],
|
|
51
|
+
stripeEnabled: ['STRIPE_ENABLED'],
|
|
52
|
+
stripeActiveMode: ['NEXT_PUBLIC_STRIPE_ACTIVE_MODE', 'STRIPE_ACTIVE_MODE'],
|
|
53
|
+
stripePublishableKey: ['NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY', 'STRIPE_PUBLISHABLE_KEY'],
|
|
54
|
+
stripeTestPublishableKey: ['NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLE_KEY', 'STRIPE_TEST_PUBLISHABLE_KEY'],
|
|
55
|
+
stripeLivePublishableKey: ['NEXT_PUBLIC_STRIPE_LIVE_PUBLISHABLE_KEY', 'STRIPE_LIVE_PUBLISHABLE_KEY'],
|
|
56
|
+
metaPixelEnabled: ['NEXT_PUBLIC_META_PIXEL_ENABLED', 'META_PIXEL_ENABLED'],
|
|
57
|
+
metaPixelId: ['NEXT_PUBLIC_META_PIXEL_ID', 'META_PIXEL_ID'],
|
|
58
|
+
funnelCustomDomain: ['FUNNEL_CUSTOM_DOMAIN'],
|
|
59
|
+
claimbeeWeeklyPriceId: ['NEXT_PUBLIC_CLAIMBEE_WEEKLY_PRICE_ID', 'CLAIMBEE_WEEKLY_PRICE_ID'],
|
|
60
|
+
claimbeeMonthlyPriceId: ['NEXT_PUBLIC_CLAIMBEE_MONTHLY_PRICE_ID', 'CLAIMBEE_MONTHLY_PRICE_ID'],
|
|
61
|
+
claimbeeYearlyPriceId: ['NEXT_PUBLIC_CLAIMBEE_YEARLY_PRICE_ID', 'CLAIMBEE_YEARLY_PRICE_ID'],
|
|
62
|
+
};
|
|
63
|
+
const RUNTIME_ENV_VALUES = {
|
|
64
|
+
APP_DEALS_API_BASE_URL: readRuntimeEnv(() => process.env.APP_DEALS_API_BASE_URL),
|
|
65
|
+
FUNNEL_ID: readRuntimeEnv(() => process.env.FUNNEL_ID),
|
|
66
|
+
FUNNEL_VERSION_ID: readRuntimeEnv(() => process.env.FUNNEL_VERSION_ID),
|
|
67
|
+
FUNNEL_SDK_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.FUNNEL_SDK_PUBLISHABLE_KEY),
|
|
68
|
+
PROJECT_ID: readRuntimeEnv(() => process.env.PROJECT_ID),
|
|
69
|
+
POSTHOG_PROJECT_API_KEY: readRuntimeEnv(() => process.env.POSTHOG_PROJECT_API_KEY),
|
|
70
|
+
FUNNEL_SUPPORT_EMAIL: readRuntimeEnv(() => process.env.FUNNEL_SUPPORT_EMAIL),
|
|
71
|
+
IOS_APP_STORE_URL: readRuntimeEnv(() => process.env.IOS_APP_STORE_URL),
|
|
72
|
+
ANDROID_PLAY_STORE_URL: readRuntimeEnv(() => process.env.ANDROID_PLAY_STORE_URL),
|
|
73
|
+
GOOGLE_PLAY_URL: readRuntimeEnv(() => process.env.GOOGLE_PLAY_URL),
|
|
74
|
+
FUNNEL_APP_STORE_ID: readRuntimeEnv(() => process.env.FUNNEL_APP_STORE_ID),
|
|
75
|
+
FUNNEL_GOOGLE_STORE_ID: readRuntimeEnv(() => process.env.FUNNEL_GOOGLE_STORE_ID),
|
|
76
|
+
FUNNEL_TIMEZONE: readRuntimeEnv(() => process.env.FUNNEL_TIMEZONE),
|
|
77
|
+
FUNNEL_FAVICON_URL: readRuntimeEnv(() => process.env.FUNNEL_FAVICON_URL),
|
|
78
|
+
FUNNEL_PAGE_TITLE: readRuntimeEnv(() => process.env.FUNNEL_PAGE_TITLE),
|
|
79
|
+
FUNNEL_PAGE_DESCRIPTION: readRuntimeEnv(() => process.env.FUNNEL_PAGE_DESCRIPTION),
|
|
80
|
+
FUNNEL_PAGE_PREVIEW_IMAGE_URL: readRuntimeEnv(() => process.env.FUNNEL_PAGE_PREVIEW_IMAGE_URL),
|
|
81
|
+
FUNNEL_COMPANY_NAME: readRuntimeEnv(() => process.env.FUNNEL_COMPANY_NAME),
|
|
82
|
+
FUNNEL_COMPANY_ADDRESS: readRuntimeEnv(() => process.env.FUNNEL_COMPANY_ADDRESS),
|
|
83
|
+
FUNNEL_COMPANY_COUNTRY: readRuntimeEnv(() => process.env.FUNNEL_COMPANY_COUNTRY),
|
|
84
|
+
FUNNEL_PRIVACY_URL: readRuntimeEnv(() => process.env.FUNNEL_PRIVACY_URL),
|
|
85
|
+
FUNNEL_TERMS_URL: readRuntimeEnv(() => process.env.FUNNEL_TERMS_URL),
|
|
86
|
+
WEB_LANDING_URL: readRuntimeEnv(() => process.env.WEB_LANDING_URL),
|
|
87
|
+
FUNNEL_UNIVERSAL_LINK: readRuntimeEnv(() => process.env.FUNNEL_UNIVERSAL_LINK),
|
|
88
|
+
APPSTORE_DEEPLINK_URL: readRuntimeEnv(() => process.env.APPSTORE_DEEPLINK_URL),
|
|
89
|
+
FUNNEL_IOS_DEEP_LINK: readRuntimeEnv(() => process.env.FUNNEL_IOS_DEEP_LINK),
|
|
90
|
+
FUNNEL_ANDROID_DEEP_LINK: readRuntimeEnv(() => process.env.FUNNEL_ANDROID_DEEP_LINK),
|
|
91
|
+
FUNNEL_QR_TARGET: readRuntimeEnv(() => process.env.FUNNEL_QR_TARGET),
|
|
92
|
+
STRIPE_ENABLED: readRuntimeEnv(() => process.env.STRIPE_ENABLED),
|
|
93
|
+
STRIPE_ACTIVE_MODE: readRuntimeEnv(() => process.env.STRIPE_ACTIVE_MODE),
|
|
94
|
+
STRIPE_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.STRIPE_PUBLISHABLE_KEY),
|
|
95
|
+
STRIPE_TEST_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.STRIPE_TEST_PUBLISHABLE_KEY),
|
|
96
|
+
STRIPE_LIVE_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.STRIPE_LIVE_PUBLISHABLE_KEY),
|
|
97
|
+
META_PIXEL_ENABLED: readRuntimeEnv(() => process.env.META_PIXEL_ENABLED),
|
|
98
|
+
META_PIXEL_ID: readRuntimeEnv(() => process.env.META_PIXEL_ID),
|
|
99
|
+
FUNNEL_CUSTOM_DOMAIN: readRuntimeEnv(() => process.env.FUNNEL_CUSTOM_DOMAIN),
|
|
100
|
+
CLAIMBEE_WEEKLY_PRICE_ID: readRuntimeEnv(() => process.env.CLAIMBEE_WEEKLY_PRICE_ID),
|
|
101
|
+
CLAIMBEE_MONTHLY_PRICE_ID: readRuntimeEnv(() => process.env.CLAIMBEE_MONTHLY_PRICE_ID),
|
|
102
|
+
CLAIMBEE_YEARLY_PRICE_ID: readRuntimeEnv(() => process.env.CLAIMBEE_YEARLY_PRICE_ID),
|
|
103
|
+
RAG_FUNNEL_ID: readRuntimeEnv(() => process.env.RAG_FUNNEL_ID),
|
|
104
|
+
PREVIEW_TEST_FUNNEL_ID: readRuntimeEnv(() => process.env.PREVIEW_TEST_FUNNEL_ID),
|
|
105
|
+
NEXT_PUBLIC_APP_DEALS_API_BASE_URL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_APP_DEALS_API_BASE_URL),
|
|
106
|
+
NEXT_PUBLIC_FUNNEL_SDK_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_SDK_PUBLISHABLE_KEY),
|
|
107
|
+
NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY),
|
|
108
|
+
NEXT_PUBLIC_FUNNEL_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_ID),
|
|
109
|
+
NEXT_PUBLIC_FUNNEL_VERSION_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_VERSION_ID),
|
|
110
|
+
NEXT_PUBLIC_PROJECT_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_PROJECT_ID),
|
|
111
|
+
NEXT_PUBLIC_POSTHOG_PROJECT_API_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_POSTHOG_PROJECT_API_KEY),
|
|
112
|
+
NEXT_PUBLIC_FUNNEL_SUPPORT_EMAIL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_SUPPORT_EMAIL),
|
|
113
|
+
NEXT_PUBLIC_IOS_APP_STORE_URL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_IOS_APP_STORE_URL),
|
|
114
|
+
NEXT_PUBLIC_ANDROID_PLAY_STORE_URL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_ANDROID_PLAY_STORE_URL),
|
|
115
|
+
NEXT_PUBLIC_FUNNEL_APP_STORE_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_APP_STORE_ID),
|
|
116
|
+
NEXT_PUBLIC_FUNNEL_GOOGLE_STORE_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_GOOGLE_STORE_ID),
|
|
117
|
+
NEXT_PUBLIC_FUNNEL_TIMEZONE: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_TIMEZONE),
|
|
118
|
+
NEXT_PUBLIC_FUNNEL_FAVICON_URL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_FAVICON_URL),
|
|
119
|
+
NEXT_PUBLIC_FUNNEL_PAGE_TITLE: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_PAGE_TITLE),
|
|
120
|
+
NEXT_PUBLIC_FUNNEL_PAGE_DESCRIPTION: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_PAGE_DESCRIPTION),
|
|
121
|
+
NEXT_PUBLIC_FUNNEL_PAGE_PREVIEW_IMAGE_URL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_PAGE_PREVIEW_IMAGE_URL),
|
|
122
|
+
NEXT_PUBLIC_FUNNEL_COMPANY_NAME: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_COMPANY_NAME),
|
|
123
|
+
NEXT_PUBLIC_FUNNEL_COMPANY_ADDRESS: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_COMPANY_ADDRESS),
|
|
124
|
+
NEXT_PUBLIC_FUNNEL_COMPANY_COUNTRY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_COMPANY_COUNTRY),
|
|
125
|
+
NEXT_PUBLIC_FUNNEL_PRIVACY_URL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_PRIVACY_URL),
|
|
126
|
+
NEXT_PUBLIC_FUNNEL_TERMS_URL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_TERMS_URL),
|
|
127
|
+
NEXT_PUBLIC_FUNNEL_UNIVERSAL_LINK: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_UNIVERSAL_LINK),
|
|
128
|
+
NEXT_PUBLIC_FUNNEL_IOS_DEEP_LINK: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_IOS_DEEP_LINK),
|
|
129
|
+
NEXT_PUBLIC_FUNNEL_ANDROID_DEEP_LINK: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_ANDROID_DEEP_LINK),
|
|
130
|
+
NEXT_PUBLIC_FUNNEL_QR_TARGET: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_QR_TARGET),
|
|
131
|
+
NEXT_PUBLIC_RAG_FUNNEL_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_RAG_FUNNEL_ID),
|
|
132
|
+
NEXT_PUBLIC_PREVIEW_TEST_FUNNEL_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_PREVIEW_TEST_FUNNEL_ID),
|
|
133
|
+
NEXT_PUBLIC_STRIPE_ACTIVE_MODE: readRuntimeEnv(() => process.env.NEXT_PUBLIC_STRIPE_ACTIVE_MODE),
|
|
134
|
+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY),
|
|
135
|
+
NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLE_KEY),
|
|
136
|
+
NEXT_PUBLIC_STRIPE_LIVE_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_STRIPE_LIVE_PUBLISHABLE_KEY),
|
|
137
|
+
NEXT_PUBLIC_META_PIXEL_ENABLED: readRuntimeEnv(() => process.env.NEXT_PUBLIC_META_PIXEL_ENABLED),
|
|
138
|
+
NEXT_PUBLIC_META_PIXEL_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_META_PIXEL_ID),
|
|
139
|
+
NEXT_PUBLIC_CLAIMBEE_WEEKLY_PRICE_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_CLAIMBEE_WEEKLY_PRICE_ID),
|
|
140
|
+
NEXT_PUBLIC_CLAIMBEE_MONTHLY_PRICE_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_CLAIMBEE_MONTHLY_PRICE_ID),
|
|
141
|
+
NEXT_PUBLIC_CLAIMBEE_YEARLY_PRICE_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_CLAIMBEE_YEARLY_PRICE_ID),
|
|
142
|
+
};
|
|
143
|
+
const readKnownRuntimeEnvValue = (key) => {
|
|
144
|
+
if (Object.prototype.hasOwnProperty.call(RUNTIME_ENV_VALUES, key)) {
|
|
145
|
+
return RUNTIME_ENV_VALUES[key];
|
|
146
|
+
}
|
|
147
|
+
return readRuntimeEnv(() => process.env[key]);
|
|
148
|
+
};
|
|
149
|
+
const readFirstRuntimeEnvValue = (keys) => {
|
|
150
|
+
for (const key of keys) {
|
|
151
|
+
const value = readKnownRuntimeEnvValue(key);
|
|
152
|
+
if (typeof value === 'string') {
|
|
153
|
+
return value;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return undefined;
|
|
157
|
+
};
|
|
158
|
+
export const runtimeEnvConfig = Object.freeze(Object.fromEntries(Object.entries(RUNTIME_ENV_KEYS).map(([key, aliases]) => [
|
|
159
|
+
key,
|
|
160
|
+
readFirstRuntimeEnvValue(aliases),
|
|
161
|
+
])));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FunnelThemeFont } from './funnel-theme.js';
|
|
2
|
+
export type FontDefinition = {
|
|
3
|
+
name: string;
|
|
4
|
+
category: 'sans-serif' | 'serif' | 'monospace' | 'display';
|
|
5
|
+
fallbacks: string;
|
|
6
|
+
weights: number[];
|
|
7
|
+
hasItalic: boolean;
|
|
8
|
+
source: 'system' | 'google' | 'custom';
|
|
9
|
+
googleFontFamily?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const getFontRegistry: () => FontDefinition[];
|
|
12
|
+
export declare const getFontByName: (name: string) => FontDefinition | undefined;
|
|
13
|
+
export declare const buildFontFamilyString: (font: FunnelThemeFont) => string;
|
|
14
|
+
export declare const buildGoogleFontsUrl: (font: FunnelThemeFont) => string | null;
|