@onside/install-widget 1.0.4 → 1.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/dist-lib/AndroidPlatformModal-Bo8KL9YE.cjs +1 -0
- package/dist-lib/AndroidPlatformModal-DGNUxRkK.js +48 -0
- package/dist-lib/CheckInstallModal-BAx1q0Eh.js +76 -0
- package/dist-lib/CheckInstallModal-CamMs4Ky.cjs +1 -0
- package/dist-lib/Dialog-BpvFTl3s.js +95 -0
- package/dist-lib/Dialog-H1GsCMbd.cjs +1 -0
- package/dist-lib/FaqModal-B6YPov5t.js +103 -0
- package/dist-lib/FaqModal-BYENishJ.cjs +1 -0
- package/dist-lib/GoToSafariModal-B1EWxzWE.cjs +1 -0
- package/dist-lib/{GoToSafariModal-C_KBizh8.js → GoToSafariModal-pXhEb2yy.js} +36 -36
- package/dist-lib/UpdateIOSModal-B-jqDkQO.cjs +1 -0
- package/dist-lib/UpdateIOSModal-D-cikTQ4.js +81 -0
- package/dist-lib/cdn-DQucWvIe.js +99 -0
- package/dist-lib/cdn-ToXHpWOt.cjs +1 -0
- package/dist-lib/hooks.cjs +1 -1
- package/dist-lib/hooks.js +4 -3
- package/dist-lib/index-BqoWsHcB.js +195 -0
- package/dist-lib/index-DFXiHkdo.cjs +1 -0
- package/dist-lib/install-package-5TE9fTFQ.cjs +1 -0
- package/dist-lib/install-package-S3saul1C.js +451 -0
- package/dist-lib/install-package.cjs +1 -1
- package/dist-lib/install-package.d.ts +82 -17
- package/dist-lib/install-package.js +14 -12
- package/dist-lib/install-widget.css +1 -1
- package/dist-lib/useInstallUrl-McaAuMPK.js +65 -0
- package/dist-lib/useInstallUrl-iPCPqYWB.cjs +1 -0
- package/package.json +12 -4
- package/dist-lib/AndroidPlatformModal-2Ykjo2V7.js +0 -48
- package/dist-lib/AndroidPlatformModal-DTglyxUG.cjs +0 -1
- package/dist-lib/Dialog-yEP-7Deb.js +0 -1399
- package/dist-lib/Dialog-yZ9bWtK1.cjs +0 -45
- package/dist-lib/GoToSafariModal-Cgx0X0rg.cjs +0 -1
- package/dist-lib/UpdateIOSModal-BGWvssyd.js +0 -170
- package/dist-lib/UpdateIOSModal-CE-d3YCr.cjs +0 -1
- package/dist-lib/install-package-B17QfMPy.cjs +0 -1
- package/dist-lib/install-package-DowlG4hO.js +0 -3036
- package/dist-lib/useInstallUrl-CjUspi0p.cjs +0 -1
- package/dist-lib/useInstallUrl-JIdkWpgj.js +0 -87
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { jsx as s, jsxs as w, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import * as S from "react";
|
|
3
|
+
import { createContext as R, useContext as j, useState as H, useRef as F, useCallback as I, useEffect as W, lazy as C, useMemo as Y, Suspense as K } from "react";
|
|
4
|
+
import { S as B, u as Q, i as Z } from "./useInstallUrl-McaAuMPK.js";
|
|
5
|
+
import { trackModalEvent as J, trackEvent as X, resolveInstallConditions as ee, getDeviceInfo as te } from "./utils.js";
|
|
6
|
+
import { create as ne } from "zustand";
|
|
7
|
+
import "./installUrlService-CrJfYPwM.js";
|
|
8
|
+
function G(e) {
|
|
9
|
+
var t, o, n = "";
|
|
10
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
11
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
12
|
+
var a = e.length;
|
|
13
|
+
for (t = 0; t < a; t++) e[t] && (o = G(e[t])) && (n && (n += " "), n += o);
|
|
14
|
+
} else for (o in e) e[o] && (n && (n += " "), n += o);
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
function oe() {
|
|
18
|
+
for (var e, t, o = 0, n = "", a = arguments.length; o < a; o++) (e = arguments[o]) && (t = G(e)) && (n && (n += " "), n += t);
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
function p(...e) {
|
|
22
|
+
return oe(e);
|
|
23
|
+
}
|
|
24
|
+
const ae = {
|
|
25
|
+
primary: "rounded-full whitespace-nowrap leading-none font-medium transition-bg font-sans duration-300 flex items-center justify-center text-center",
|
|
26
|
+
secondary: "rounded-full whitespace-nowrap leading-none font-medium font-sans bg-transparent border transition-bg transition-color duration-300 flex items-center justify-center text-center",
|
|
27
|
+
text: "whitespace-nowrap leading-none font-medium font-sans transition-colors duration-300 flex items-center justify-center text-center",
|
|
28
|
+
transparent: "rounded-full whitespace-nowrap leading-none font-medium transition-opacity duration-300 flex items-center justify-center text-center"
|
|
29
|
+
}, se = {
|
|
30
|
+
primary: {
|
|
31
|
+
blue: "bg-blue text-white hover:bg-buttonHover focus:bg-blue disabled:bg-buttonDisabled",
|
|
32
|
+
lightBlue: "bg-[#e2eaf8] text-blue hover:opacity-60 focus:opacity-100",
|
|
33
|
+
white: "bg-white text-blue hover:opacity-90 focus:opacity-100 disabled:opacity-50"
|
|
34
|
+
},
|
|
35
|
+
secondary: {
|
|
36
|
+
blue: "border-blue text-blue hover:bg-blue hover:text-white focus:bg-blue focus:text-white",
|
|
37
|
+
lightBlue: "border-[#e2eaf8] text-[#e2eaf8] hover:bg-[#e2eaf8] hover:text-white focus:bg-[#e2eaf8] focus:text-white",
|
|
38
|
+
white: "border-white text-white hover:bg-white hover:text-blue focus:bg-white focus:text-blue"
|
|
39
|
+
},
|
|
40
|
+
text: {
|
|
41
|
+
blue: "bg-transparent text-blue hover:underline focus:underline",
|
|
42
|
+
lightBlue: "bg-transparent text-[#e2eaf8] hover:underline focus:underline",
|
|
43
|
+
white: "bg-transparent text-white hover:underline focus:underline"
|
|
44
|
+
},
|
|
45
|
+
transparent: {
|
|
46
|
+
blue: "bg-transparent text-blue hover:opacity-75",
|
|
47
|
+
lightBlue: "bg-transparent text-[#e2eaf8] hover:opacity-75",
|
|
48
|
+
white: "bg-transparent text-white hover:opacity-75"
|
|
49
|
+
}
|
|
50
|
+
}, le = {
|
|
51
|
+
lg: "py-4 px-8 font-sans font-medium text-lg sm:text-xl leading-none!",
|
|
52
|
+
md: "py-3 px-5 font-sans font-medium text-base sm:text-lg leading-none!"
|
|
53
|
+
};
|
|
54
|
+
function M({ className: e, ...t }) {
|
|
55
|
+
const o = t.variant ?? "primary", n = t.color ?? "blue", a = t.size ?? "md", l = p(
|
|
56
|
+
ae[o],
|
|
57
|
+
le[o !== "text" ? a : "md"],
|
|
58
|
+
se[o][n],
|
|
59
|
+
e
|
|
60
|
+
);
|
|
61
|
+
if (typeof t.href > "u")
|
|
62
|
+
return /* @__PURE__ */ s("button", { className: l, ...t });
|
|
63
|
+
const i = t, { pureLink: g, ...r } = i, b = ("rel" in r ? r.rel : void 0) ?? (r.target === "_blank" ? "noopener noreferrer" : void 0);
|
|
64
|
+
return g ? /* @__PURE__ */ s("a", { className: l, rel: b, ...r }) : /* @__PURE__ */ s("a", { className: l, rel: b, ...r });
|
|
65
|
+
}
|
|
66
|
+
const u = " ", ie = "ʹ", D = {
|
|
67
|
+
button: {
|
|
68
|
+
install: "Install Onside",
|
|
69
|
+
regionUnavailable: "Only available in the EU. Install from an eligible region.",
|
|
70
|
+
androidOnly: "Onside is for iPhone and iPad",
|
|
71
|
+
loading: "Loading...",
|
|
72
|
+
linkError: "Unable to load install link. Please try again."
|
|
73
|
+
},
|
|
74
|
+
modal: {
|
|
75
|
+
close: "Close",
|
|
76
|
+
goToSafari: {
|
|
77
|
+
title: "Open in Safari",
|
|
78
|
+
caption: "Copy the link and open it in Safari to continue.",
|
|
79
|
+
description: "Onside can only be installed from the Safari browser on your device.",
|
|
80
|
+
openButton: "Open in Safari",
|
|
81
|
+
linkCopied: "Link copied",
|
|
82
|
+
linkPaste: "Paste the link in Safari"
|
|
83
|
+
},
|
|
84
|
+
updateIos: {
|
|
85
|
+
title: "Update your iOS",
|
|
86
|
+
description: "To install Onside, update your iPhone or iPad to the latest version of iOS.",
|
|
87
|
+
breadcrumbs: ["Settings", "General", "Software Update"]
|
|
88
|
+
},
|
|
89
|
+
getApproved: {
|
|
90
|
+
title: "Get approved for Onside",
|
|
91
|
+
steps: [
|
|
92
|
+
"Open the link and sign in with your Apple ID.",
|
|
93
|
+
"Complete the approval steps in the browser.",
|
|
94
|
+
"Return here and tap Install to continue."
|
|
95
|
+
],
|
|
96
|
+
installing: "Installing…",
|
|
97
|
+
openApp: "Open the Onside app",
|
|
98
|
+
openAppDescription: "Start using Onside from your home screen.",
|
|
99
|
+
openAppButton: "Open app"
|
|
100
|
+
},
|
|
101
|
+
checkInstall: {
|
|
102
|
+
title: "Did you install Onside?",
|
|
103
|
+
description: "Let us know if the installation completed successfully.",
|
|
104
|
+
yes: "Yes, I installed it",
|
|
105
|
+
no: "No, I need help"
|
|
106
|
+
},
|
|
107
|
+
android: {
|
|
108
|
+
title: "Onside is for iPhone and iPad",
|
|
109
|
+
description: "To install Onside, please use an iPhone or iPad."
|
|
110
|
+
},
|
|
111
|
+
faq: {
|
|
112
|
+
title: "Frequently asked questions",
|
|
113
|
+
items: [
|
|
114
|
+
{
|
|
115
|
+
question: "How can I install Onside store app outside EU region?",
|
|
116
|
+
answer: `You can install the${u}Onside store app only if${u}you are using your iPhone in${u}the${u}EU${u}region`
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
question: `I am in EU region but still can${ie}t install Onside store app`,
|
|
120
|
+
answer: "Turn off your VPN and check that country of your Appstore belongs to EU region. You can find instructions on how to change the region",
|
|
121
|
+
action: { event: "change_region", word: "here" }
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
question: `Could not install app due${u}to content restrictions`,
|
|
125
|
+
answer: "Go to content restrictions in Settings, then “App Store, Media, Web & games” then “Apps” and set to unrated"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
question: "I have another problem",
|
|
129
|
+
answer: "If you have any other problems, please",
|
|
130
|
+
action: { event: "support", word: "contact us" }
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
changeRegion: {
|
|
134
|
+
title: `Change your App Store country to install Onside${u}store${u}app`,
|
|
135
|
+
label: "To change, please go to:",
|
|
136
|
+
breadcrumbs: [
|
|
137
|
+
"Settings",
|
|
138
|
+
"Your name",
|
|
139
|
+
"Media & Purchases",
|
|
140
|
+
"View Account",
|
|
141
|
+
"Country & Region",
|
|
142
|
+
"Change"
|
|
143
|
+
],
|
|
144
|
+
caption: "Then follow the on-screen instructions"
|
|
145
|
+
},
|
|
146
|
+
needHelp: "Need help?",
|
|
147
|
+
faqLink: "FAQ",
|
|
148
|
+
didntFind: "Didn’t find an answer?"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, $ = R(D), re = () => j($), Be = 7 * B, ce = 7 * B, de = 2 * B, q = ne((e) => ({
|
|
152
|
+
activeModal: null,
|
|
153
|
+
openModal: (t) => e({ activeModal: t }),
|
|
154
|
+
closeModal: () => e({ activeModal: null })
|
|
155
|
+
})), ue = {
|
|
156
|
+
INSTALL_BUTTON_CLICK: "install_button_click"
|
|
157
|
+
}, pe = (e = {}, t) => ({
|
|
158
|
+
trackInstallEvent: (a) => {
|
|
159
|
+
const l = X(ue.INSTALL_BUTTON_CLICK, {
|
|
160
|
+
...e,
|
|
161
|
+
event_type: a
|
|
162
|
+
});
|
|
163
|
+
l && t?.onEvent?.(l);
|
|
164
|
+
},
|
|
165
|
+
trackOpenModalEvent: (a) => {
|
|
166
|
+
const l = J(a, "opened", "install_button", {
|
|
167
|
+
...e
|
|
168
|
+
});
|
|
169
|
+
l && t?.onEvent?.(l);
|
|
170
|
+
}
|
|
171
|
+
}), fe = (e) => e ? "ios_18_6_plus" : "install_click", he = (e, t) => {
|
|
172
|
+
e(fe(t));
|
|
173
|
+
}, me = (e) => {
|
|
174
|
+
e("no_condition_matched");
|
|
175
|
+
}, ge = (e) => {
|
|
176
|
+
const { id: t, location: o = "hero", customAnalytics: n, handleCustomStep: a, pathname: l } = e, i = ee(te()), g = i.installState === "install_available", { data: r, error: b } = Q(g), f = r?.url ?? null, A = r?.onside_token ?? null, E = r?.attribution_token ?? null, h = r?.is_eligible ?? null, { openModal: c } = q(), [_, k] = H(!1), x = F(void 0), { trackOpenModalEvent: d, trackInstallEvent: v } = pe(
|
|
177
|
+
{
|
|
178
|
+
page: l,
|
|
179
|
+
location: o,
|
|
180
|
+
button_id: t ?? void 0,
|
|
181
|
+
onside_token: A ?? void 0,
|
|
182
|
+
attribution_token: E ?? void 0
|
|
183
|
+
},
|
|
184
|
+
n
|
|
185
|
+
), m = I(() => {
|
|
186
|
+
k(!0);
|
|
187
|
+
const y = setTimeout(() => {
|
|
188
|
+
k(!1);
|
|
189
|
+
}, de);
|
|
190
|
+
return () => clearTimeout(y);
|
|
191
|
+
}, []), O = I(
|
|
192
|
+
(y) => {
|
|
193
|
+
if (!f || !Z) {
|
|
194
|
+
y.preventDefault();
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (m(), a) {
|
|
198
|
+
setTimeout(() => a(), 100);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
he(v, i.usesNewInstallFlow), setTimeout(() => {
|
|
202
|
+
if (i.usesNewInstallFlow) {
|
|
203
|
+
clearTimeout(x.current), x.current = setTimeout(() => {
|
|
204
|
+
c("checkInstall"), d("check_install");
|
|
205
|
+
}, ce);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
c("getApproved"), d("get_approved");
|
|
209
|
+
}, 100);
|
|
210
|
+
},
|
|
211
|
+
[
|
|
212
|
+
f,
|
|
213
|
+
a,
|
|
214
|
+
i.usesNewInstallFlow,
|
|
215
|
+
v,
|
|
216
|
+
d,
|
|
217
|
+
c,
|
|
218
|
+
m
|
|
219
|
+
]
|
|
220
|
+
), N = I(() => {
|
|
221
|
+
if (m(), i.installState === "go_to_safari") {
|
|
222
|
+
d("go_to_safari"), c("goToSafari");
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (i.installState === "update_ios") {
|
|
226
|
+
d("update_ios"), c("updateIOS");
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
me(v);
|
|
230
|
+
}, [
|
|
231
|
+
i.installState,
|
|
232
|
+
c,
|
|
233
|
+
m,
|
|
234
|
+
v,
|
|
235
|
+
d
|
|
236
|
+
]), T = I(() => {
|
|
237
|
+
d("is_android"), c("isAndroid");
|
|
238
|
+
}, [c, d]);
|
|
239
|
+
return {
|
|
240
|
+
viewMode: i.installState === "android" ? "android" : _ ? "loading" : f && g ? "link" : "button",
|
|
241
|
+
installUrl: f,
|
|
242
|
+
error: b,
|
|
243
|
+
isEligible: h,
|
|
244
|
+
conditions: i,
|
|
245
|
+
handleInstallClick: O,
|
|
246
|
+
handleModalFlowClick: N,
|
|
247
|
+
handleAndroidClick: T
|
|
248
|
+
};
|
|
249
|
+
}, be = (e) => /* @__PURE__ */ S.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.createElement("path", { d: "M12.1268 5.74646C11.3368 5.74646 10.1139 4.84824 8.82613 4.88071C7.12708 4.90235 5.56872 5.8655 4.69214 7.39139C2.92817 10.454 4.23762 14.9776 5.95831 17.4667C6.80243 18.6787 7.79805 20.0423 9.11832 19.999C10.3845 19.9449 10.8607 19.1765 12.3974 19.1765C13.9233 19.1765 14.3562 19.999 15.6981 19.9665C17.0617 19.9449 17.9274 18.7328 18.7607 17.5099C19.7239 16.1031 20.1243 14.7395 20.1459 14.6638C20.1134 14.653 17.4945 13.6465 17.4621 10.6164C17.4404 8.084 19.5291 6.87195 19.6265 6.81784C18.436 5.0755 16.6071 4.88071 15.9686 4.83742C14.3021 4.70755 12.906 5.74646 12.1268 5.74646ZM14.9406 3.19248C15.644 2.34837 16.1093 1.16877 15.9795 0C14.973 0.0432878 13.761 0.670965 13.0359 1.51508C12.3866 2.26179 11.8238 3.46303 11.9753 4.61016C13.09 4.69673 14.2371 4.03659 14.9406 3.19248Z", fill: "currentColor" })), ve = ({
|
|
250
|
+
className: e,
|
|
251
|
+
onClick: t,
|
|
252
|
+
children: o,
|
|
253
|
+
id: n,
|
|
254
|
+
androidClassName: a,
|
|
255
|
+
androidTextClassName: l
|
|
256
|
+
}) => /* @__PURE__ */ s(
|
|
257
|
+
M,
|
|
258
|
+
{
|
|
259
|
+
id: n,
|
|
260
|
+
className: p("bg-white px-7", e, a),
|
|
261
|
+
variant: "secondary",
|
|
262
|
+
size: "lg",
|
|
263
|
+
onClick: t,
|
|
264
|
+
children: /* @__PURE__ */ w("span", { className: "flex flex-row items-center gap-1", children: [
|
|
265
|
+
/* @__PURE__ */ s(be, { className: l ? "text-[#FF465D]" : void 0 }),
|
|
266
|
+
/* @__PURE__ */ s("span", { className: p("flex-1", l), children: o })
|
|
267
|
+
] })
|
|
268
|
+
}
|
|
269
|
+
), ye = ({
|
|
270
|
+
href: e,
|
|
271
|
+
onClick: t,
|
|
272
|
+
children: o,
|
|
273
|
+
className: n,
|
|
274
|
+
id: a
|
|
275
|
+
}) => /* @__PURE__ */ s(
|
|
276
|
+
M,
|
|
277
|
+
{
|
|
278
|
+
id: a,
|
|
279
|
+
href: e,
|
|
280
|
+
pureLink: !0,
|
|
281
|
+
size: "lg",
|
|
282
|
+
onClick: t,
|
|
283
|
+
className: n,
|
|
284
|
+
children: o
|
|
285
|
+
}
|
|
286
|
+
), U = (e) => /* @__PURE__ */ S.createElement("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.createElement("path", { d: "M17.5 10.0001C17.4999 11.5839 16.9984 13.1271 16.0674 14.4084C15.1364 15.6897 13.8237 16.6434 12.3174 17.1328C10.8111 17.6221 9.1885 17.6221 7.6822 17.1326C6.17591 16.6432 4.86323 15.6894 3.9323 14.4081C3.00138 13.1267 2.49999 11.5835 2.5 9.9997C2.50001 8.41588 3.00142 6.87271 3.93237 5.59137C4.86331 4.31003 6.176 3.3563 7.6823 2.86685C9.1886 2.37741 10.8112 2.37739 12.3175 2.86679", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })), we = (e) => {
|
|
287
|
+
const { id: t, className: o, children: n, showLoaderOnly: a } = e;
|
|
288
|
+
return /* @__PURE__ */ s(M, { id: t, className: p("px-8 py-4", o), disabled: !0, children: /* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: a ? /* @__PURE__ */ s(U, { className: "animate-spin" }) : /* @__PURE__ */ w(P, { children: [
|
|
289
|
+
/* @__PURE__ */ s(U, { className: "animate-spin" }),
|
|
290
|
+
n
|
|
291
|
+
] }) }) });
|
|
292
|
+
}, Ce = ({ message: e }) => /* @__PURE__ */ s("p", { className: "mt-2 text-center text-sm text-error", children: e ?? "Unable to load install link. Please try again." }), V = R(!1), ke = () => typeof window < "u" ? window.location.pathname : "", Ue = (e) => {
|
|
293
|
+
const t = re(), {
|
|
294
|
+
className: o,
|
|
295
|
+
children: n,
|
|
296
|
+
handleCustomStep: a,
|
|
297
|
+
location: l = "hero",
|
|
298
|
+
caption: i,
|
|
299
|
+
captionClassName: g,
|
|
300
|
+
showCaption: r = !0,
|
|
301
|
+
showLoaderOnly: b = !1,
|
|
302
|
+
androidClassName: f,
|
|
303
|
+
androidTextClassName: A,
|
|
304
|
+
customAnalytics: E,
|
|
305
|
+
id: h
|
|
306
|
+
} = e, c = n ?? t.button.install, _ = F(ke()), k = j(V), {
|
|
307
|
+
viewMode: x,
|
|
308
|
+
installUrl: d,
|
|
309
|
+
error: v,
|
|
310
|
+
isEligible: m,
|
|
311
|
+
handleInstallClick: O,
|
|
312
|
+
handleModalFlowClick: N,
|
|
313
|
+
handleAndroidClick: T
|
|
314
|
+
} = ge({
|
|
315
|
+
id: h,
|
|
316
|
+
location: l,
|
|
317
|
+
customAnalytics: E,
|
|
318
|
+
handleCustomStep: a,
|
|
319
|
+
pathname: _.current
|
|
320
|
+
});
|
|
321
|
+
W(() => {
|
|
322
|
+
}, [k]);
|
|
323
|
+
const L = r && (!m || i) && /* @__PURE__ */ s(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
className: p(
|
|
327
|
+
"text-2xs font-mono opacity-60",
|
|
328
|
+
g
|
|
329
|
+
),
|
|
330
|
+
children: m ? i : t.button.regionUnavailable
|
|
331
|
+
}
|
|
332
|
+
), y = {
|
|
333
|
+
android: /* @__PURE__ */ s(
|
|
334
|
+
ve,
|
|
335
|
+
{
|
|
336
|
+
id: h,
|
|
337
|
+
className: o,
|
|
338
|
+
androidClassName: f,
|
|
339
|
+
androidTextClassName: A,
|
|
340
|
+
onClick: T,
|
|
341
|
+
children: t.button.androidOnly
|
|
342
|
+
}
|
|
343
|
+
),
|
|
344
|
+
loading: /* @__PURE__ */ s(
|
|
345
|
+
we,
|
|
346
|
+
{
|
|
347
|
+
showLoaderOnly: b,
|
|
348
|
+
id: h,
|
|
349
|
+
className: p("bg-buttonHover!", o),
|
|
350
|
+
children: t.button.loading
|
|
351
|
+
}
|
|
352
|
+
),
|
|
353
|
+
link: /* @__PURE__ */ w(P, { children: [
|
|
354
|
+
/* @__PURE__ */ w(
|
|
355
|
+
ye,
|
|
356
|
+
{
|
|
357
|
+
id: h,
|
|
358
|
+
className: p(o, "flex-col gap-1"),
|
|
359
|
+
href: d ?? "",
|
|
360
|
+
onClick: O,
|
|
361
|
+
children: [
|
|
362
|
+
c,
|
|
363
|
+
L
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
v && /* @__PURE__ */ s(Ce, { message: t.button.linkError })
|
|
368
|
+
] }),
|
|
369
|
+
button: /* @__PURE__ */ w(
|
|
370
|
+
M,
|
|
371
|
+
{
|
|
372
|
+
id: h,
|
|
373
|
+
className: p(o, "flex-col gap-1"),
|
|
374
|
+
size: "lg",
|
|
375
|
+
onClick: N,
|
|
376
|
+
children: [
|
|
377
|
+
c,
|
|
378
|
+
L
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
};
|
|
383
|
+
return /* @__PURE__ */ s(P, { children: y[x] ?? y.button });
|
|
384
|
+
};
|
|
385
|
+
function z(e, t) {
|
|
386
|
+
if (!t) return e;
|
|
387
|
+
const o = { ...e };
|
|
388
|
+
for (const n of Object.keys(t)) {
|
|
389
|
+
const a = o[n], l = t[n];
|
|
390
|
+
l !== void 0 && (typeof a == "object" && a !== null && !Array.isArray(a) && typeof l == "object" && l !== null && !Array.isArray(l) ? o[n] = z(
|
|
391
|
+
a,
|
|
392
|
+
l
|
|
393
|
+
) : o[n] = l);
|
|
394
|
+
}
|
|
395
|
+
return o;
|
|
396
|
+
}
|
|
397
|
+
const xe = C(async () => ({ default: (await import("./AndroidPlatformModal-DGNUxRkK.js")).AndroidPlatformModal })), Ie = C(async () => ({ default: (await import("./GoToSafariModal-pXhEb2yy.js")).GoToSafariModal })), Se = C(async () => ({ default: (await import("./UpdateIOSModal-D-cikTQ4.js")).UpdateIOSModal })), Me = C(async () => ({ default: (await import("./index-BqoWsHcB.js")).GetApprovedModal })), Ae = C(async () => ({ default: (await import("./CheckInstallModal-BAx1q0Eh.js")).CheckInstallModal })), Ee = () => {
|
|
398
|
+
const { activeModal: e, closeModal: t, openModal: o } = q();
|
|
399
|
+
let n = null;
|
|
400
|
+
switch (e) {
|
|
401
|
+
case "goToSafari":
|
|
402
|
+
n = /* @__PURE__ */ s(Ie, { open: !0, onClose: t });
|
|
403
|
+
break;
|
|
404
|
+
case "updateIOS":
|
|
405
|
+
n = /* @__PURE__ */ s(Se, { open: !0, onClose: t });
|
|
406
|
+
break;
|
|
407
|
+
case "isAndroid":
|
|
408
|
+
n = /* @__PURE__ */ s(xe, { open: !0, onClose: t });
|
|
409
|
+
break;
|
|
410
|
+
case "getApproved":
|
|
411
|
+
n = /* @__PURE__ */ s(
|
|
412
|
+
Me,
|
|
413
|
+
{
|
|
414
|
+
open: !0,
|
|
415
|
+
onClose: t,
|
|
416
|
+
onStep3Complete: () => o("checkInstall")
|
|
417
|
+
}
|
|
418
|
+
);
|
|
419
|
+
break;
|
|
420
|
+
case "checkInstall":
|
|
421
|
+
n = /* @__PURE__ */ s(Ae, { open: !0, onClose: t });
|
|
422
|
+
break;
|
|
423
|
+
default:
|
|
424
|
+
n = null;
|
|
425
|
+
}
|
|
426
|
+
return /* @__PURE__ */ s(K, { fallback: null, children: n });
|
|
427
|
+
}, Re = ({
|
|
428
|
+
children: e,
|
|
429
|
+
messages: t
|
|
430
|
+
}) => {
|
|
431
|
+
const o = Y(
|
|
432
|
+
() => z(D, t),
|
|
433
|
+
[t]
|
|
434
|
+
);
|
|
435
|
+
return /* @__PURE__ */ s($.Provider, { value: o, children: /* @__PURE__ */ w(V.Provider, { value: !0, children: [
|
|
436
|
+
e,
|
|
437
|
+
/* @__PURE__ */ s(Ee, {})
|
|
438
|
+
] }) });
|
|
439
|
+
};
|
|
440
|
+
export {
|
|
441
|
+
ce as A,
|
|
442
|
+
M as B,
|
|
443
|
+
Ue as I,
|
|
444
|
+
p as a,
|
|
445
|
+
Be as b,
|
|
446
|
+
oe as c,
|
|
447
|
+
Re as d,
|
|
448
|
+
de as e,
|
|
449
|
+
D as f,
|
|
450
|
+
re as u
|
|
451
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./install-package-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./install-package-5TE9fTFQ.cjs"),s=require("./useInstallUrl-iPCPqYWB.cjs"),t=require("./installUrlService-AjG03i8i.cjs"),l=require("./utils.cjs");exports.AVERAGE_CHECK_TIME=e.AVERAGE_CHECK_TIME;exports.AVERAGE_INSTALL_TIME=e.AVERAGE_INSTALL_TIME;exports.AVERAGE_LOADING_TIME=e.AVERAGE_LOADING_TIME;exports.InstallAppButton=e.InstallAppButton;exports.InstallWidgetProvider=e.InstallWidgetProvider;exports.defaultMessages=e.defaultMessages;exports.useInstallUrl=s.useInstallUrl;exports.useInstallUrlStore=s.useInstallUrlStore;exports.generateUUID=t.generateUUID;exports.getCookie=t.getCookie;exports.getInstallUrl=t.getInstallUrl;exports.getOnsideToken=t.getOnsideToken;exports.setCookie=t.setCookie;exports.compareVersions=l.compareVersions;exports.getDeviceInfo=l.getDeviceInfo;exports.resolveInstallConditions=l.resolveInstallConditions;exports.trackEvent=l.trackEvent;exports.trackModalEvent=l.trackModalEvent;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
1
|
import { JSX } from 'react/jsx-runtime';
|
|
3
2
|
import { PropsWithChildren } from 'react';
|
|
4
3
|
import { StoreApi } from 'zustand';
|
|
@@ -20,6 +19,16 @@ declare type ButtonLocation = "hero" | "header" | "fixed_bottom" | "install_guid
|
|
|
20
19
|
|
|
21
20
|
export declare const compareVersions: (a: string, b: string) => -1 | 0 | 1;
|
|
22
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Recursively makes all properties optional, allowing consumers to override
|
|
24
|
+
* only the strings they need while falling back to defaults.
|
|
25
|
+
*/
|
|
26
|
+
export declare type DeepPartial<T> = {
|
|
27
|
+
[P in keyof T]?: T[P] extends Array<unknown> ? T[P] : T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export declare const defaultMessages: InstallWidgetMessages;
|
|
31
|
+
|
|
23
32
|
export declare type DeviceInfo = {
|
|
24
33
|
platform: Platform;
|
|
25
34
|
browser: Browser;
|
|
@@ -71,7 +80,6 @@ export declare interface InstallAppButtonProps {
|
|
|
71
80
|
location?: ButtonLocation;
|
|
72
81
|
caption?: string;
|
|
73
82
|
showCaption?: boolean;
|
|
74
|
-
styleVars?: InstallWidgetStyleVars;
|
|
75
83
|
id?: string;
|
|
76
84
|
showLoaderOnly?: boolean;
|
|
77
85
|
}
|
|
@@ -118,21 +126,78 @@ export declare type InstallUrlStoreData = {
|
|
|
118
126
|
reset: () => void;
|
|
119
127
|
};
|
|
120
128
|
|
|
121
|
-
export declare
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
export declare interface InstallWidgetMessages {
|
|
130
|
+
button: {
|
|
131
|
+
install: string;
|
|
132
|
+
regionUnavailable: string;
|
|
133
|
+
androidOnly: string;
|
|
134
|
+
loading: string;
|
|
135
|
+
linkError: string;
|
|
136
|
+
};
|
|
137
|
+
modal: {
|
|
138
|
+
close: string;
|
|
139
|
+
goToSafari: {
|
|
140
|
+
title: string;
|
|
141
|
+
caption: string;
|
|
142
|
+
description: string;
|
|
143
|
+
openButton: string;
|
|
144
|
+
linkCopied: string;
|
|
145
|
+
linkPaste: string;
|
|
146
|
+
};
|
|
147
|
+
updateIos: {
|
|
148
|
+
title: string;
|
|
149
|
+
description: string;
|
|
150
|
+
breadcrumbs: string[];
|
|
151
|
+
};
|
|
152
|
+
getApproved: {
|
|
153
|
+
title: string;
|
|
154
|
+
steps: string[];
|
|
155
|
+
installing: string;
|
|
156
|
+
openApp: string;
|
|
157
|
+
openAppDescription: string;
|
|
158
|
+
openAppButton: string;
|
|
159
|
+
};
|
|
160
|
+
checkInstall: {
|
|
161
|
+
title: string;
|
|
162
|
+
description: string;
|
|
163
|
+
yes: string;
|
|
164
|
+
no: string;
|
|
165
|
+
};
|
|
166
|
+
android: {
|
|
167
|
+
title: string;
|
|
168
|
+
description: string;
|
|
169
|
+
};
|
|
170
|
+
faq: {
|
|
171
|
+
title: string;
|
|
172
|
+
items: Array<{
|
|
173
|
+
question: string;
|
|
174
|
+
answer: string;
|
|
175
|
+
action?: {
|
|
176
|
+
event: "change_region" | "support";
|
|
177
|
+
word: string;
|
|
178
|
+
};
|
|
179
|
+
}>;
|
|
180
|
+
changeRegion: {
|
|
181
|
+
title: string;
|
|
182
|
+
label: string;
|
|
183
|
+
breadcrumbs: string[];
|
|
184
|
+
caption: string;
|
|
185
|
+
};
|
|
186
|
+
needHelp: string;
|
|
187
|
+
faqLink: string;
|
|
188
|
+
didntFind: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export declare const InstallWidgetProvider: ({ children, messages: messageOverrides, }: PropsWithChildren<InstallWidgetProviderProps>) => JSX.Element;
|
|
194
|
+
|
|
195
|
+
export declare interface InstallWidgetProviderProps {
|
|
196
|
+
/** Partial or full message overrides (deep-merged with defaults). */
|
|
197
|
+
messages?: DeepPartial<InstallWidgetMessages>;
|
|
198
|
+
/** Analytics callbacks forwarded to all install buttons. */
|
|
199
|
+
customAnalytics?: InstallAnalyticsCallbacks;
|
|
200
|
+
}
|
|
136
201
|
|
|
137
202
|
export declare type IOSDeviceClass = "iphone" | "ipad" | "ipod" | "unknown";
|
|
138
203
|
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { A as a, b as t, e as o, I as r, d as l, f as n } from "./install-package-S3saul1C.js";
|
|
3
|
+
import { u as E, a as i } from "./useInstallUrl-McaAuMPK.js";
|
|
4
|
+
import { c as g, b as d, g as f, a as p, s as c } from "./installUrlService-CrJfYPwM.js";
|
|
5
|
+
import { compareVersions as _, getDeviceInfo as k, resolveInstallConditions as m, trackEvent as v, trackModalEvent as C } from "./utils.js";
|
|
5
6
|
export {
|
|
6
7
|
a as AVERAGE_CHECK_TIME,
|
|
7
8
|
t as AVERAGE_INSTALL_TIME,
|
|
8
9
|
o as AVERAGE_LOADING_TIME,
|
|
9
10
|
r as InstallAppButton,
|
|
10
11
|
l as InstallWidgetProvider,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
g as
|
|
12
|
+
_ as compareVersions,
|
|
13
|
+
n as defaultMessages,
|
|
14
|
+
g as generateUUID,
|
|
15
|
+
d as getCookie,
|
|
14
16
|
k as getDeviceInfo,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
f as getInstallUrl,
|
|
18
|
+
p as getOnsideToken,
|
|
17
19
|
m as resolveInstallConditions,
|
|
18
|
-
|
|
20
|
+
c as setCookie,
|
|
19
21
|
v as trackEvent,
|
|
20
22
|
C as trackModalEvent,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
E as useInstallUrl,
|
|
24
|
+
i as useInstallUrlStore
|
|
23
25
|
};
|