@builder.io/sdk-react 3.0.5 → 3.0.7
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/lib/browser/blocks-exports.cjs +167 -30
- package/lib/browser/blocks-exports.mjs +1370 -931
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +17 -16
- package/lib/{edge/server-entry-67bfc740.js → browser/server-entry-20c79b90.js} +319 -274
- package/lib/browser/server-entry-762e29e0.cjs +2 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-190c4426.cjs → accordion-071aa4f9.cjs} +1 -1
- package/lib/edge/{accordion-cd6e0363.js → accordion-22c2c037.js} +1 -1
- package/lib/edge/{blocks-fe2d7c1a.js → blocks-2989e629.js} +1343 -1318
- package/lib/edge/blocks-d3f37507.cjs +30 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +13 -12
- package/lib/edge/{button-6a27481c.js → button-2b5270c4.js} +2 -2
- package/lib/edge/{button-694fcd4f.cjs → button-a2cc6565.cjs} +1 -1
- package/lib/edge/{columns-90e6407e.js → columns-21b9be25.js} +3 -3
- package/lib/edge/{columns-b38bf0f7.cjs → columns-b7240242.cjs} +1 -1
- package/lib/edge/{content-variants-cbb89349.js → content-variants-88f4dc64.js} +165 -124
- package/lib/edge/content-variants-fdd5ee50.cjs +134 -0
- package/lib/edge/dynamic-blocks-exports.cjs +3 -1
- package/lib/edge/dynamic-blocks-exports.mjs +5 -2
- package/lib/edge/{form-547645eb.cjs → form-77687883.cjs} +1 -1
- package/lib/edge/{form-16bbf874.js → form-d29f3cc0.js} +3 -3
- package/lib/edge/{get-class-prop-name-8b719c6b.js → get-class-prop-name-dbc5d99c.js} +1 -1
- package/lib/edge/{get-class-prop-name-58770197.cjs → get-class-prop-name-f597545d.cjs} +1 -1
- package/lib/edge/{img-8859c851.cjs → img-03f9002b.cjs} +1 -1
- package/lib/edge/{img-d3351743.js → img-fed70928.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +18 -17
- package/lib/edge/{input-24c601b4.js → input-083c3c35.js} +1 -1
- package/lib/edge/{input-4fe0fc6d.cjs → input-1e548fd0.cjs} +1 -1
- package/lib/edge/personalization-container-bcff3433.js +384 -0
- package/lib/edge/personalization-container-dde10a09.cjs +138 -0
- package/lib/edge/{select-c73bd418.cjs → select-21e33225.cjs} +1 -1
- package/lib/edge/{select-af05377b.js → select-9f22c2ba.js} +1 -1
- package/lib/{browser/server-entry-785c0408.js → edge/server-entry-43a6f5be.js} +339 -298
- package/lib/edge/server-entry-ac35a5c8.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-759c8dd9.cjs → slot-a9f5d6c0.cjs} +1 -1
- package/lib/edge/{slot-32a4df0c.js → slot-ca171e8c.js} +3 -3
- package/lib/edge/{symbol-50360a37.js → symbol-8f6ff028.js} +2 -2
- package/lib/edge/{symbol-8d63aa7d.cjs → symbol-a2015c7e.cjs} +1 -1
- package/lib/edge/{tabs-6535c934.js → tabs-6b67fca2.js} +3 -3
- package/lib/edge/{tabs-fc6c1700.cjs → tabs-880c9088.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +168 -31
- package/lib/node/blocks-exports.mjs +1343 -904
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +17 -16
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/server-entry-0b433783.cjs +2 -0
- package/lib/node/{server-entry-ffc70868.js → server-entry-6626257d.js} +280 -237
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-4ce0db03.cjs → setIvm-49abbae6.cjs} +1 -1
- package/lib/node/{setIvm-2cea7252.js → setIvm-5cb298bf.js} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-d3e6df07.cjs → should-force-browser-runtime-in-node-11e8399e.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-c0d50009.js → should-force-browser-runtime-in-node-94f1a5b3.js} +1 -1
- package/package.json +1 -1
- package/types/blocks/personalization-container/component-info.d.ts +2 -0
- package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
- package/types/blocks/personalization-container/helpers.d.ts +27 -0
- package/types/blocks/personalization-container/index.d.ts +1 -0
- package/types/blocks/personalization-container/personalization-container.d.ts +4 -0
- package/types/blocks/personalization-container/personalization-container.types.d.ts +14 -0
- package/types/constants/device-sizes.d.ts +3 -2
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/user-attributes.d.ts +17 -0
- package/types/index-helpers/blocks-exports.d.ts +1 -0
- package/types/types/builder-block.d.ts +0 -1
- package/types/types/builder-content.d.ts +1 -0
- package/types/types/input.d.ts +1 -0
- package/lib/browser/server-entry-101d66b8.cjs +0 -2
- package/lib/edge/blocks-766e8d45.cjs +0 -30
- package/lib/edge/content-variants-4e385c19.cjs +0 -134
- package/lib/edge/server-entry-3c7fa63a.cjs +0 -2
- package/lib/node/server-entry-95273908.cjs +0 -2
|
@@ -1,38 +1,77 @@
|
|
|
1
|
-
const v = "react",
|
|
1
|
+
const v = "react", I = "[Builder.io]: ", f = {
|
|
2
|
+
log: (...t) => console.log(I, ...t),
|
|
3
|
+
error: (...t) => console.error(I, ...t),
|
|
4
|
+
warn: (...t) => console.warn(I, ...t),
|
|
5
|
+
debug: (...t) => console.debug(I, ...t)
|
|
6
|
+
};
|
|
7
|
+
function c() {
|
|
8
|
+
return typeof window != "undefined" && typeof document != "undefined";
|
|
9
|
+
}
|
|
10
|
+
const ot = (t) => {
|
|
2
11
|
const e = {};
|
|
3
12
|
return t.forEach((n, r) => {
|
|
4
13
|
e[r] = n;
|
|
5
14
|
}), e;
|
|
6
|
-
},
|
|
7
|
-
function
|
|
8
|
-
return typeof window != "undefined" && typeof document != "undefined";
|
|
9
|
-
}
|
|
10
|
-
function ot() {
|
|
15
|
+
}, M = (t) => t instanceof URLSearchParams ? ot(t) : t, K = (t) => typeof t == "string" ? t : t instanceof URLSearchParams ? t.toString() : new URLSearchParams(t).toString();
|
|
16
|
+
function it() {
|
|
11
17
|
return c() && window.self !== window.top;
|
|
12
18
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
|
|
19
|
+
function at(t) {
|
|
20
|
+
return it() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
21
|
+
K(t || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
16
22
|
}
|
|
17
|
-
|
|
23
|
+
const ct = () => {
|
|
24
|
+
if (c()) {
|
|
25
|
+
const t = new URL(location.href);
|
|
26
|
+
return t.pathname === "" && (t.pathname = "/"), t;
|
|
27
|
+
} else
|
|
28
|
+
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
29
|
+
}, ut = () => typeof navigator == "object" && navigator.userAgent || "", lt = () => {
|
|
30
|
+
const t = ut(), e = {
|
|
31
|
+
Android() {
|
|
32
|
+
return t.match(/Android/i);
|
|
33
|
+
},
|
|
34
|
+
BlackBerry() {
|
|
35
|
+
return t.match(/BlackBerry/i);
|
|
36
|
+
},
|
|
37
|
+
iOS() {
|
|
38
|
+
return t.match(/iPhone|iPod/i);
|
|
39
|
+
},
|
|
40
|
+
Opera() {
|
|
41
|
+
return t.match(/Opera Mini/i);
|
|
42
|
+
},
|
|
43
|
+
Windows() {
|
|
44
|
+
return t.match(/IEMobile/i) || t.match(/WPDesktop/i);
|
|
45
|
+
},
|
|
46
|
+
any() {
|
|
47
|
+
return e.Android() || e.BlackBerry() || e.iOS() || e.Opera() || e.Windows() || v === "reactNative";
|
|
48
|
+
}
|
|
49
|
+
}, n = t.match(/Tablet|iPad/i), r = ct();
|
|
50
|
+
return {
|
|
51
|
+
urlPath: r == null ? void 0 : r.pathname,
|
|
52
|
+
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
53
|
+
device: n ? "tablet" : e.any() ? "mobile" : "desktop"
|
|
54
|
+
};
|
|
55
|
+
}, y = (t) => t != null;
|
|
56
|
+
function ee(t) {
|
|
18
57
|
const e = t || (c() ? window.location.search : void 0);
|
|
19
|
-
return e ?
|
|
58
|
+
return e ? K(e).indexOf("builder.preview=") !== -1 : !1;
|
|
20
59
|
}
|
|
21
|
-
const
|
|
60
|
+
const ne = (t) => ({
|
|
22
61
|
type: "builder.registerComponent",
|
|
23
|
-
data:
|
|
24
|
-
}),
|
|
62
|
+
data: j(t)
|
|
63
|
+
}), dt = (t) => {
|
|
25
64
|
const e = t.toString().trim(), n = /^[a-zA-Z0-9_]+\s*=>/i.test(e);
|
|
26
65
|
return `return (${!e.startsWith("function") && !e.startsWith("async") && !e.startsWith("(") && !n ? "function " : ""}${e}).apply(this, arguments)`;
|
|
27
66
|
};
|
|
28
|
-
function
|
|
29
|
-
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ?
|
|
67
|
+
function j(t) {
|
|
68
|
+
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ? dt(n) : n));
|
|
30
69
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
33
|
-
t === "plugin" && (e =
|
|
34
|
-
let n =
|
|
35
|
-
if (n || (n =
|
|
70
|
+
const R = {};
|
|
71
|
+
function ft(t, e) {
|
|
72
|
+
t === "plugin" && (e = j(e));
|
|
73
|
+
let n = R[t];
|
|
74
|
+
if (n || (n = R[t] = []), n.push(e), c()) {
|
|
36
75
|
const r = {
|
|
37
76
|
type: "builder.register",
|
|
38
77
|
data: {
|
|
@@ -42,52 +81,47 @@ function at(t, e) {
|
|
|
42
81
|
};
|
|
43
82
|
try {
|
|
44
83
|
parent.postMessage(r, "*"), parent !== window && window.postMessage(r, "*");
|
|
45
|
-
} catch (
|
|
46
|
-
console.debug("Could not postmessage",
|
|
84
|
+
} catch (s) {
|
|
85
|
+
console.debug("Could not postmessage", s);
|
|
47
86
|
}
|
|
48
87
|
}
|
|
49
88
|
}
|
|
50
|
-
const
|
|
51
|
-
function
|
|
89
|
+
const L = {};
|
|
90
|
+
function re(t) {
|
|
52
91
|
if (c()) {
|
|
53
|
-
Object.assign(
|
|
92
|
+
Object.assign(L, t);
|
|
54
93
|
const e = {
|
|
55
94
|
type: "builder.settingsChange",
|
|
56
|
-
data:
|
|
95
|
+
data: L
|
|
57
96
|
};
|
|
58
97
|
parent.postMessage(e, "*");
|
|
59
98
|
}
|
|
60
99
|
}
|
|
61
|
-
const
|
|
100
|
+
const V = "builder.", ht = "options.", W = (t) => {
|
|
62
101
|
if (!t)
|
|
63
102
|
return {};
|
|
64
|
-
const e =
|
|
103
|
+
const e = M(t), n = {};
|
|
65
104
|
return Object.keys(e).forEach((r) => {
|
|
66
|
-
if (r.startsWith(
|
|
67
|
-
const
|
|
68
|
-
n[
|
|
105
|
+
if (r.startsWith(V)) {
|
|
106
|
+
const s = r.replace(V, "").replace(ht, "");
|
|
107
|
+
n[s] = e[r];
|
|
69
108
|
}
|
|
70
109
|
}), n;
|
|
71
|
-
},
|
|
110
|
+
}, gt = () => {
|
|
72
111
|
if (!c())
|
|
73
112
|
return {};
|
|
74
113
|
const t = new URLSearchParams(window.location.search);
|
|
75
|
-
return
|
|
76
|
-
},
|
|
77
|
-
log: (...t) => console.log(I, ...t),
|
|
78
|
-
error: (...t) => console.error(I, ...t),
|
|
79
|
-
warn: (...t) => console.warn(I, ...t),
|
|
80
|
-
debug: (...t) => console.debug(I, ...t)
|
|
81
|
-
}, K = "3.0.5", j = () => ({
|
|
114
|
+
return W(t);
|
|
115
|
+
}, _ = "3.0.7", $ = () => ({
|
|
82
116
|
"X-Builder-SDK": v,
|
|
83
117
|
"X-Builder-SDK-GEN": "2",
|
|
84
|
-
"X-Builder-SDK-Version":
|
|
85
|
-
}),
|
|
118
|
+
"X-Builder-SDK-Version": _
|
|
119
|
+
}), pt = (t) => {
|
|
86
120
|
if (t === "localhost" || t === "127.0.0.1")
|
|
87
121
|
return t;
|
|
88
122
|
const e = t.split(".");
|
|
89
123
|
return e.length > 2 ? e.slice(1).join(".") : t;
|
|
90
|
-
},
|
|
124
|
+
}, O = ({
|
|
91
125
|
name: t,
|
|
92
126
|
canTrack: e
|
|
93
127
|
}) => {
|
|
@@ -98,14 +132,14 @@ const R = "builder.", ct = "options.", M = (t) => {
|
|
|
98
132
|
f.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
99
133
|
return;
|
|
100
134
|
}
|
|
101
|
-
},
|
|
135
|
+
}, G = async (t) => O(t), mt = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(y).join("; "), yt = [["secure", ""], ["SameSite", "None"]], bt = ({
|
|
102
136
|
name: t,
|
|
103
137
|
value: e,
|
|
104
138
|
expires: n
|
|
105
139
|
}) => {
|
|
106
|
-
const
|
|
107
|
-
return
|
|
108
|
-
},
|
|
140
|
+
const s = (c() ? location.protocol === "https:" : !0) ? yt : [[]], o = n ? [["expires", n.toUTCString()]] : [[]], i = [[t, e], ...o, ["path", "/"], ["domain", pt(window.location.hostname)], ...s];
|
|
141
|
+
return mt(i);
|
|
142
|
+
}, P = async ({
|
|
109
143
|
name: t,
|
|
110
144
|
value: e,
|
|
111
145
|
expires: n,
|
|
@@ -114,135 +148,103 @@ const R = "builder.", ct = "options.", M = (t) => {
|
|
|
114
148
|
try {
|
|
115
149
|
if (!r)
|
|
116
150
|
return;
|
|
117
|
-
const
|
|
151
|
+
const s = bt({
|
|
118
152
|
name: t,
|
|
119
153
|
value: e,
|
|
120
154
|
expires: n
|
|
121
155
|
});
|
|
122
|
-
document.cookie =
|
|
123
|
-
} catch (
|
|
124
|
-
f.warn("[COOKIE] SET error: ", (
|
|
156
|
+
document.cookie = s;
|
|
157
|
+
} catch (s) {
|
|
158
|
+
f.warn("[COOKIE] SET error: ", (s == null ? void 0 : s.message) || s);
|
|
125
159
|
}
|
|
126
160
|
};
|
|
127
|
-
function
|
|
161
|
+
function St() {
|
|
128
162
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
|
|
129
163
|
const e = Math.random() * 16 | 0;
|
|
130
164
|
return (t == "x" ? e : e & 3 | 8).toString(16);
|
|
131
165
|
});
|
|
132
166
|
}
|
|
133
|
-
function
|
|
134
|
-
return
|
|
167
|
+
function J() {
|
|
168
|
+
return St().replace(/-/g, "");
|
|
135
169
|
}
|
|
136
|
-
const
|
|
170
|
+
const X = "builderSessionId", wt = async ({
|
|
137
171
|
canTrack: t
|
|
138
172
|
}) => {
|
|
139
173
|
if (!t)
|
|
140
174
|
return;
|
|
141
|
-
const e = await
|
|
142
|
-
name:
|
|
175
|
+
const e = await G({
|
|
176
|
+
name: X,
|
|
143
177
|
canTrack: t
|
|
144
178
|
});
|
|
145
179
|
if (y(e))
|
|
146
180
|
return e;
|
|
147
181
|
{
|
|
148
|
-
const n =
|
|
149
|
-
return
|
|
182
|
+
const n = vt();
|
|
183
|
+
return It({
|
|
150
184
|
id: n,
|
|
151
185
|
canTrack: t
|
|
152
186
|
}), n;
|
|
153
187
|
}
|
|
154
|
-
},
|
|
188
|
+
}, vt = () => J(), It = ({
|
|
155
189
|
id: t,
|
|
156
190
|
canTrack: e
|
|
157
|
-
}) =>
|
|
158
|
-
name:
|
|
191
|
+
}) => P({
|
|
192
|
+
name: X,
|
|
159
193
|
value: t,
|
|
160
194
|
canTrack: e
|
|
161
|
-
}),
|
|
195
|
+
}), z = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, kt = ({
|
|
162
196
|
key: t,
|
|
163
197
|
canTrack: e
|
|
164
198
|
}) => {
|
|
165
199
|
var n;
|
|
166
200
|
try {
|
|
167
|
-
return e ? (n =
|
|
201
|
+
return e ? (n = z()) == null ? void 0 : n.getItem(t) : void 0;
|
|
168
202
|
} catch (r) {
|
|
169
203
|
console.debug("[LocalStorage] GET error: ", r);
|
|
170
204
|
return;
|
|
171
205
|
}
|
|
172
|
-
},
|
|
206
|
+
}, At = ({
|
|
173
207
|
key: t,
|
|
174
208
|
canTrack: e,
|
|
175
209
|
value: n
|
|
176
210
|
}) => {
|
|
177
211
|
var r;
|
|
178
212
|
try {
|
|
179
|
-
e && ((r =
|
|
180
|
-
} catch (
|
|
181
|
-
console.debug("[LocalStorage] SET error: ",
|
|
213
|
+
e && ((r = z()) == null || r.setItem(t, n));
|
|
214
|
+
} catch (s) {
|
|
215
|
+
console.debug("[LocalStorage] SET error: ", s);
|
|
182
216
|
}
|
|
183
|
-
},
|
|
217
|
+
}, H = "builderVisitorId", Et = ({
|
|
184
218
|
canTrack: t
|
|
185
219
|
}) => {
|
|
186
220
|
if (!t)
|
|
187
221
|
return;
|
|
188
|
-
const e =
|
|
189
|
-
key:
|
|
222
|
+
const e = kt({
|
|
223
|
+
key: H,
|
|
190
224
|
canTrack: t
|
|
191
225
|
});
|
|
192
226
|
if (y(e))
|
|
193
227
|
return e;
|
|
194
228
|
{
|
|
195
|
-
const n =
|
|
196
|
-
return
|
|
229
|
+
const n = Ot();
|
|
230
|
+
return Pt({
|
|
197
231
|
id: n,
|
|
198
232
|
canTrack: t
|
|
199
233
|
}), n;
|
|
200
234
|
}
|
|
201
|
-
},
|
|
235
|
+
}, Ot = () => J(), Pt = ({
|
|
202
236
|
id: t,
|
|
203
237
|
canTrack: e
|
|
204
|
-
}) =>
|
|
205
|
-
key:
|
|
238
|
+
}) => At({
|
|
239
|
+
key: H,
|
|
206
240
|
value: t,
|
|
207
241
|
canTrack: e
|
|
208
242
|
});
|
|
209
|
-
function
|
|
243
|
+
function Ct(t) {
|
|
210
244
|
var e;
|
|
211
245
|
typeof process != "undefined" && ((e = process.env) != null && e.DEBUG) && String(process.env.DEBUG) == "true" && f.log(t);
|
|
212
246
|
}
|
|
213
|
-
const
|
|
214
|
-
if (c()) {
|
|
215
|
-
const t = new URL(location.href);
|
|
216
|
-
return t.pathname === "" && (t.pathname = "/"), t;
|
|
217
|
-
} else
|
|
218
|
-
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
219
|
-
}, At = () => typeof navigator == "object" && navigator.userAgent || "", Pt = () => {
|
|
220
|
-
const t = At(), e = {
|
|
221
|
-
Android() {
|
|
222
|
-
return t.match(/Android/i);
|
|
223
|
-
},
|
|
224
|
-
BlackBerry() {
|
|
225
|
-
return t.match(/BlackBerry/i);
|
|
226
|
-
},
|
|
227
|
-
iOS() {
|
|
228
|
-
return t.match(/iPhone|iPod/i);
|
|
229
|
-
},
|
|
230
|
-
Opera() {
|
|
231
|
-
return t.match(/Opera Mini/i);
|
|
232
|
-
},
|
|
233
|
-
Windows() {
|
|
234
|
-
return t.match(/IEMobile/i) || t.match(/WPDesktop/i);
|
|
235
|
-
},
|
|
236
|
-
any() {
|
|
237
|
-
return e.Android() || e.BlackBerry() || e.iOS() || e.Opera() || e.Windows() || v === "reactNative";
|
|
238
|
-
}
|
|
239
|
-
}, n = t.match(/Tablet|iPad/i), r = Et();
|
|
240
|
-
return {
|
|
241
|
-
urlPath: r == null ? void 0 : r.pathname,
|
|
242
|
-
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
243
|
-
device: n ? "tablet" : e.any() ? "mobile" : "desktop"
|
|
244
|
-
};
|
|
245
|
-
}, Ot = async ({
|
|
247
|
+
const Ut = async ({
|
|
246
248
|
canTrack: t
|
|
247
249
|
}) => {
|
|
248
250
|
if (!t)
|
|
@@ -250,33 +252,33 @@ const Et = () => {
|
|
|
250
252
|
visitorId: void 0,
|
|
251
253
|
sessionId: void 0
|
|
252
254
|
};
|
|
253
|
-
const e = await
|
|
255
|
+
const e = await wt({
|
|
254
256
|
canTrack: t
|
|
255
|
-
}), n =
|
|
257
|
+
}), n = Et({
|
|
256
258
|
canTrack: t
|
|
257
259
|
});
|
|
258
260
|
return {
|
|
259
261
|
sessionId: e,
|
|
260
262
|
visitorId: n
|
|
261
263
|
};
|
|
262
|
-
},
|
|
264
|
+
}, Tt = async ({
|
|
263
265
|
type: t,
|
|
264
266
|
canTrack: e,
|
|
265
267
|
apiKey: n,
|
|
266
268
|
metadata: r,
|
|
267
|
-
...
|
|
269
|
+
...s
|
|
268
270
|
}) => ({
|
|
269
271
|
type: t,
|
|
270
272
|
data: {
|
|
271
|
-
...
|
|
273
|
+
...s,
|
|
272
274
|
metadata: {
|
|
273
275
|
url: location.href,
|
|
274
276
|
...r
|
|
275
277
|
},
|
|
276
|
-
...await
|
|
278
|
+
...await Ut({
|
|
277
279
|
canTrack: e
|
|
278
280
|
}),
|
|
279
|
-
userAttributes:
|
|
281
|
+
userAttributes: lt(),
|
|
280
282
|
ownerId: n
|
|
281
283
|
}
|
|
282
284
|
});
|
|
@@ -288,35 +290,35 @@ async function xt({
|
|
|
288
290
|
f.error("Missing API key for track call. Please provide your API key.");
|
|
289
291
|
return;
|
|
290
292
|
}
|
|
291
|
-
if (!e.canTrack ||
|
|
293
|
+
if (!e.canTrack || at() || !(c() || v === "reactNative"))
|
|
292
294
|
return;
|
|
293
295
|
const r = `${t || "https://cdn.builder.io"}/api/v1/track`;
|
|
294
|
-
return
|
|
296
|
+
return Ct(r), fetch(r, {
|
|
295
297
|
method: "POST",
|
|
296
298
|
body: JSON.stringify({
|
|
297
|
-
events: [await
|
|
299
|
+
events: [await Tt(e)]
|
|
298
300
|
}),
|
|
299
301
|
headers: {
|
|
300
302
|
"content-type": "application/json",
|
|
301
|
-
|
|
303
|
+
...$()
|
|
302
304
|
},
|
|
303
305
|
mode: "cors"
|
|
304
|
-
}).catch((
|
|
305
|
-
console.error("Failed to track: ",
|
|
306
|
+
}).catch((s) => {
|
|
307
|
+
console.error("Failed to track: ", s);
|
|
306
308
|
});
|
|
307
309
|
}
|
|
308
|
-
const
|
|
310
|
+
const se = (t) => xt({
|
|
309
311
|
...t,
|
|
310
312
|
canTrack: !0
|
|
311
|
-
}),
|
|
312
|
-
function
|
|
313
|
+
}), Bt = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
314
|
+
function Q(t, e) {
|
|
313
315
|
if (!e.origin.startsWith("http") && !e.origin.startsWith("https"))
|
|
314
316
|
return !1;
|
|
315
317
|
const n = new URL(e.origin), r = n.hostname;
|
|
316
|
-
return (t ||
|
|
318
|
+
return (t || Bt).findIndex((s) => s.startsWith("*.") ? r.endsWith(s.slice(1)) : s === r) > -1;
|
|
317
319
|
}
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
+
const oe = () => {
|
|
321
|
+
ft("insertMenu", {
|
|
320
322
|
name: "_default",
|
|
321
323
|
default: !0,
|
|
322
324
|
items: [{
|
|
@@ -338,19 +340,21 @@ const ne = () => {
|
|
|
338
340
|
}]
|
|
339
341
|
});
|
|
340
342
|
};
|
|
341
|
-
let
|
|
342
|
-
const
|
|
343
|
+
let N = !1;
|
|
344
|
+
const Rt = (t = {}) => {
|
|
343
345
|
var e, n;
|
|
344
|
-
|
|
346
|
+
N || (N = !0, c() && ((e = window.parent) == null || e.postMessage({
|
|
345
347
|
type: "builder.sdkInfo",
|
|
346
348
|
data: {
|
|
347
349
|
target: v,
|
|
348
|
-
version:
|
|
350
|
+
version: _,
|
|
349
351
|
supportsPatchUpdates: !1,
|
|
350
352
|
// Supports builder-model="..." attribute which is needed to
|
|
351
353
|
// scope our '+ add block' button styling
|
|
352
354
|
supportsAddBlockScoping: !0,
|
|
353
|
-
supportsCustomBreakpoints: !0
|
|
355
|
+
supportsCustomBreakpoints: !0,
|
|
356
|
+
supportsXSmallBreakpoint: !0,
|
|
357
|
+
blockLevelPersonalization: !0
|
|
354
358
|
}
|
|
355
359
|
}, "*"), (n = window.parent) == null || n.postMessage({
|
|
356
360
|
type: "builder.updateContent",
|
|
@@ -358,23 +362,23 @@ const Ut = (t = {}) => {
|
|
|
358
362
|
options: t
|
|
359
363
|
}
|
|
360
364
|
}, "*"), window.addEventListener("message", (r) => {
|
|
361
|
-
var
|
|
362
|
-
if (!
|
|
365
|
+
var o, i;
|
|
366
|
+
if (!Q(t.trustedHosts, r))
|
|
363
367
|
return;
|
|
364
368
|
const {
|
|
365
|
-
data:
|
|
369
|
+
data: s
|
|
366
370
|
} = r;
|
|
367
|
-
if (
|
|
368
|
-
switch (
|
|
371
|
+
if (s != null && s.type)
|
|
372
|
+
switch (s.type) {
|
|
369
373
|
case "builder.evaluate": {
|
|
370
|
-
const u =
|
|
374
|
+
const u = s.data.text, b = s.data.arguments || [], p = s.data.id, k = new Function(u);
|
|
371
375
|
let l, h = null;
|
|
372
376
|
try {
|
|
373
|
-
l = k.apply(null,
|
|
377
|
+
l = k.apply(null, b);
|
|
374
378
|
} catch (g) {
|
|
375
379
|
h = g;
|
|
376
380
|
}
|
|
377
|
-
h ? (
|
|
381
|
+
h ? (o = window.parent) == null || o.postMessage({
|
|
378
382
|
type: "builder.evaluateError",
|
|
379
383
|
data: {
|
|
380
384
|
id: p,
|
|
@@ -400,38 +404,38 @@ const Ut = (t = {}) => {
|
|
|
400
404
|
}
|
|
401
405
|
}
|
|
402
406
|
})));
|
|
403
|
-
},
|
|
407
|
+
}, Lt = ({
|
|
404
408
|
model: t,
|
|
405
409
|
trustedHosts: e,
|
|
406
410
|
callbacks: n
|
|
407
411
|
}) => (r) => {
|
|
408
|
-
if (!
|
|
412
|
+
if (!Q(e, r))
|
|
409
413
|
return;
|
|
410
414
|
const {
|
|
411
|
-
data:
|
|
415
|
+
data: s
|
|
412
416
|
} = r;
|
|
413
|
-
if (
|
|
414
|
-
switch (
|
|
417
|
+
if (s)
|
|
418
|
+
switch (s.type) {
|
|
415
419
|
case "builder.configureSdk": {
|
|
416
|
-
n.configureSdk(
|
|
420
|
+
n.configureSdk(s.data);
|
|
417
421
|
break;
|
|
418
422
|
}
|
|
419
423
|
case "builder.triggerAnimation": {
|
|
420
|
-
n.animation(
|
|
424
|
+
n.animation(s.data);
|
|
421
425
|
break;
|
|
422
426
|
}
|
|
423
427
|
case "builder.contentUpdate": {
|
|
424
|
-
const
|
|
428
|
+
const o = s.data, i = o.key || o.alias || o.entry || o.modelName, u = o.data;
|
|
425
429
|
i === t && n.contentUpdate(u);
|
|
426
430
|
break;
|
|
427
431
|
}
|
|
428
432
|
}
|
|
429
|
-
},
|
|
433
|
+
}, ie = (t, e, n) => {
|
|
430
434
|
if (!c)
|
|
431
435
|
return f.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
|
|
432
436
|
};
|
|
433
|
-
|
|
434
|
-
const r =
|
|
437
|
+
Rt();
|
|
438
|
+
const r = Lt({
|
|
435
439
|
callbacks: {
|
|
436
440
|
contentUpdate: e,
|
|
437
441
|
animation: () => {
|
|
@@ -445,45 +449,45 @@ const Ut = (t = {}) => {
|
|
|
445
449
|
return window.addEventListener("message", r), () => {
|
|
446
450
|
window.removeEventListener("message", r);
|
|
447
451
|
};
|
|
448
|
-
},
|
|
452
|
+
}, Vt = "builder.tests", C = (t) => `${Vt}.${t}`, Nt = ({
|
|
449
453
|
contentId: t
|
|
450
|
-
}) =>
|
|
451
|
-
name:
|
|
454
|
+
}) => G({
|
|
455
|
+
name: C(t),
|
|
452
456
|
canTrack: !0
|
|
453
|
-
}),
|
|
457
|
+
}), Ft = ({
|
|
454
458
|
contentId: t
|
|
455
|
-
}) =>
|
|
456
|
-
name:
|
|
459
|
+
}) => O({
|
|
460
|
+
name: C(t),
|
|
457
461
|
canTrack: !0
|
|
458
|
-
}),
|
|
462
|
+
}), Dt = ({
|
|
459
463
|
contentId: t,
|
|
460
464
|
value: e
|
|
461
|
-
}) =>
|
|
462
|
-
name:
|
|
465
|
+
}) => P({
|
|
466
|
+
name: C(t),
|
|
463
467
|
value: e,
|
|
464
468
|
canTrack: !0
|
|
465
|
-
}),
|
|
469
|
+
}), Y = (t) => y(t.id) && y(t.variations) && Object.keys(t.variations).length > 0, Mt = ({
|
|
466
470
|
id: t,
|
|
467
471
|
variations: e
|
|
468
472
|
}) => {
|
|
469
|
-
var
|
|
473
|
+
var s;
|
|
470
474
|
let n = 0;
|
|
471
475
|
const r = Math.random();
|
|
472
|
-
for (const
|
|
473
|
-
const i = (
|
|
476
|
+
for (const o in e) {
|
|
477
|
+
const i = (s = e[o]) == null ? void 0 : s.testRatio;
|
|
474
478
|
if (n += i, r < n)
|
|
475
|
-
return
|
|
479
|
+
return o;
|
|
476
480
|
}
|
|
477
481
|
return t;
|
|
478
|
-
},
|
|
479
|
-
const e =
|
|
480
|
-
return
|
|
482
|
+
}, Z = (t) => {
|
|
483
|
+
const e = Mt(t);
|
|
484
|
+
return Dt({
|
|
481
485
|
contentId: t.id,
|
|
482
486
|
value: e
|
|
483
487
|
}).catch((n) => {
|
|
484
488
|
f.error("could not store A/B test variation: ", n);
|
|
485
489
|
}), e;
|
|
486
|
-
},
|
|
490
|
+
}, q = ({
|
|
487
491
|
item: t,
|
|
488
492
|
testGroupId: e
|
|
489
493
|
}) => {
|
|
@@ -497,7 +501,7 @@ const Ut = (t = {}) => {
|
|
|
497
501
|
testVariationId: n.id,
|
|
498
502
|
testVariationName: n.name || (n.id === t.id ? "Default" : "")
|
|
499
503
|
};
|
|
500
|
-
},
|
|
504
|
+
}, ae = ({
|
|
501
505
|
item: t,
|
|
502
506
|
canTrack: e
|
|
503
507
|
}) => {
|
|
@@ -505,14 +509,14 @@ const Ut = (t = {}) => {
|
|
|
505
509
|
return t;
|
|
506
510
|
if (!t)
|
|
507
511
|
return;
|
|
508
|
-
if (!
|
|
512
|
+
if (!Y(t))
|
|
509
513
|
return t;
|
|
510
|
-
const n =
|
|
514
|
+
const n = Ft({
|
|
511
515
|
contentId: t.id
|
|
512
|
-
}) ||
|
|
516
|
+
}) || Z({
|
|
513
517
|
variations: t.variations,
|
|
514
518
|
id: t.id
|
|
515
|
-
}), r =
|
|
519
|
+
}), r = q({
|
|
516
520
|
item: t,
|
|
517
521
|
testGroupId: n
|
|
518
522
|
});
|
|
@@ -520,125 +524,164 @@ const Ut = (t = {}) => {
|
|
|
520
524
|
...t,
|
|
521
525
|
...r
|
|
522
526
|
};
|
|
523
|
-
},
|
|
527
|
+
}, Kt = async ({
|
|
524
528
|
item: t,
|
|
525
529
|
canTrack: e
|
|
526
530
|
}) => {
|
|
527
|
-
if (!e || !
|
|
531
|
+
if (!e || !Y(t))
|
|
528
532
|
return t;
|
|
529
|
-
const r = await
|
|
533
|
+
const r = await Nt({
|
|
530
534
|
contentId: t.id
|
|
531
|
-
}) ||
|
|
535
|
+
}) || Z({
|
|
532
536
|
variations: t.variations,
|
|
533
537
|
id: t.id
|
|
534
|
-
}),
|
|
538
|
+
}), s = q({
|
|
535
539
|
item: t,
|
|
536
540
|
testGroupId: r
|
|
537
541
|
});
|
|
538
542
|
return {
|
|
539
543
|
...t,
|
|
540
|
-
...
|
|
544
|
+
...s
|
|
545
|
+
};
|
|
546
|
+
}, F = "builder.userAttributes";
|
|
547
|
+
function jt() {
|
|
548
|
+
let t = !0;
|
|
549
|
+
const e = /* @__PURE__ */ new Set();
|
|
550
|
+
return {
|
|
551
|
+
setUserAttributes(n) {
|
|
552
|
+
if (!c())
|
|
553
|
+
return;
|
|
554
|
+
const r = {
|
|
555
|
+
...this.getUserAttributes(),
|
|
556
|
+
...n
|
|
557
|
+
};
|
|
558
|
+
P({
|
|
559
|
+
name: F,
|
|
560
|
+
value: JSON.stringify(r),
|
|
561
|
+
canTrack: t
|
|
562
|
+
}), e.forEach((s) => s(r));
|
|
563
|
+
},
|
|
564
|
+
getUserAttributes() {
|
|
565
|
+
return c() ? JSON.parse(O({
|
|
566
|
+
name: F,
|
|
567
|
+
canTrack: t
|
|
568
|
+
}) || "{}") : {};
|
|
569
|
+
},
|
|
570
|
+
subscribeOnUserAttributesChange(n) {
|
|
571
|
+
return e.add(n), () => {
|
|
572
|
+
e.delete(n);
|
|
573
|
+
};
|
|
574
|
+
},
|
|
575
|
+
setCanTrack(n) {
|
|
576
|
+
t = n;
|
|
577
|
+
}
|
|
541
578
|
};
|
|
542
|
-
}
|
|
543
|
-
|
|
579
|
+
}
|
|
580
|
+
const tt = jt(), ce = (t) => {
|
|
581
|
+
tt.setUserAttributes(t);
|
|
582
|
+
}, Wt = (t) => {
|
|
583
|
+
const e = y(t) ? t : !0;
|
|
584
|
+
return tt.setCanTrack(e), e;
|
|
585
|
+
};
|
|
586
|
+
function _t() {
|
|
544
587
|
return typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : globalThis;
|
|
545
588
|
}
|
|
546
|
-
function
|
|
547
|
-
const t =
|
|
589
|
+
function $t() {
|
|
590
|
+
const t = _t().fetch;
|
|
548
591
|
if (typeof t == "undefined")
|
|
549
592
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
550
593
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
551
594
|
return t;
|
|
552
595
|
}
|
|
553
|
-
const
|
|
554
|
-
function
|
|
555
|
-
return Object.keys(t).reduce((r,
|
|
556
|
-
const
|
|
557
|
-
return [typeof
|
|
596
|
+
const Gt = $t();
|
|
597
|
+
function E(t, e = null, n = ".") {
|
|
598
|
+
return Object.keys(t).reduce((r, s) => {
|
|
599
|
+
const o = t[s], i = [e, s].filter(Boolean).join(n);
|
|
600
|
+
return [typeof o == "object", o !== null, !(Array.isArray(o) && o.length === 0)].every(Boolean) ? {
|
|
558
601
|
...r,
|
|
559
|
-
...
|
|
602
|
+
...E(o, i, n)
|
|
560
603
|
} : {
|
|
561
604
|
...r,
|
|
562
|
-
[i]:
|
|
605
|
+
[i]: o
|
|
563
606
|
};
|
|
564
607
|
}, {});
|
|
565
608
|
}
|
|
566
|
-
function
|
|
609
|
+
function et(t, e, n = {}) {
|
|
567
610
|
for (const r in t) {
|
|
568
|
-
const
|
|
569
|
-
|
|
611
|
+
const s = t[r], o = e ? e + "." + r : r;
|
|
612
|
+
s && typeof s == "object" && !Array.isArray(s) && !Object.keys(s).find((i) => i.startsWith("$")) ? et(s, o, n) : n[o] = s;
|
|
570
613
|
}
|
|
571
614
|
return n;
|
|
572
615
|
}
|
|
573
|
-
function
|
|
616
|
+
function Jt(t) {
|
|
574
617
|
const e = {};
|
|
575
618
|
for (const n in t) {
|
|
576
619
|
const r = n.split(".");
|
|
577
|
-
let
|
|
578
|
-
for (let
|
|
579
|
-
const i = r[
|
|
580
|
-
|
|
620
|
+
let s = e;
|
|
621
|
+
for (let o = 0; o < r.length; o++) {
|
|
622
|
+
const i = r[o];
|
|
623
|
+
o === r.length - 1 ? s[i] = t[n] : (s[i] = s[i] || {}, s = s[i]);
|
|
581
624
|
}
|
|
582
625
|
}
|
|
583
626
|
return e;
|
|
584
627
|
}
|
|
585
|
-
const
|
|
628
|
+
const Xt = "v3", D = (t) => typeof t == "number" && !isNaN(t) && t >= 0, U = (t) => {
|
|
586
629
|
const {
|
|
587
630
|
limit: e = 30,
|
|
588
631
|
userAttributes: n,
|
|
589
632
|
query: r,
|
|
590
|
-
model:
|
|
591
|
-
apiKey:
|
|
633
|
+
model: s,
|
|
634
|
+
apiKey: o,
|
|
592
635
|
enrich: i,
|
|
593
636
|
locale: u,
|
|
594
|
-
apiVersion:
|
|
637
|
+
apiVersion: b = Xt,
|
|
595
638
|
fields: p,
|
|
596
639
|
omit: k,
|
|
597
640
|
offset: l,
|
|
598
641
|
cacheSeconds: h,
|
|
599
642
|
staleCacheSeconds: g,
|
|
600
643
|
sort: S,
|
|
601
|
-
includeUnpublished:
|
|
602
|
-
apiHost:
|
|
644
|
+
includeUnpublished: T,
|
|
645
|
+
apiHost: nt
|
|
603
646
|
} = t;
|
|
604
|
-
if (!
|
|
647
|
+
if (!o)
|
|
605
648
|
throw new Error("Missing API key");
|
|
606
|
-
if (!["v3"].includes(
|
|
607
|
-
throw new Error(`Invalid apiVersion: expected 'v3', received '${
|
|
608
|
-
const
|
|
609
|
-
a.searchParams.set("apiKey",
|
|
610
|
-
const
|
|
649
|
+
if (!["v3"].includes(b))
|
|
650
|
+
throw new Error(`Invalid apiVersion: expected 'v3', received '${b}'`);
|
|
651
|
+
const rt = e !== 1, st = nt || "https://cdn.builder.io", a = new URL(`${st}/api/${b}/content/${s}`);
|
|
652
|
+
a.searchParams.set("apiKey", o), a.searchParams.set("limit", String(e)), a.searchParams.set("noTraverse", String(rt)), a.searchParams.set("includeRefs", String(!0));
|
|
653
|
+
const A = u || (n == null ? void 0 : n.locale);
|
|
611
654
|
let m = n || {};
|
|
612
|
-
if (
|
|
613
|
-
locale:
|
|
655
|
+
if (A && (a.searchParams.set("locale", A), m = {
|
|
656
|
+
locale: A,
|
|
614
657
|
...m
|
|
615
|
-
}), i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit", k || "meta.componentsUsed"), p && a.searchParams.set("fields", p), Number.isFinite(l) && l > -1 && a.searchParams.set("offset", String(Math.floor(l))), typeof
|
|
616
|
-
const d =
|
|
658
|
+
}), i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit", k || "meta.componentsUsed"), p && a.searchParams.set("fields", p), Number.isFinite(l) && l > -1 && a.searchParams.set("offset", String(Math.floor(l))), typeof T == "boolean" && a.searchParams.set("includeUnpublished", String(T)), h && D(h) && a.searchParams.set("cacheSeconds", String(h)), g && D(g) && a.searchParams.set("staleCacheSeconds", String(g)), S) {
|
|
659
|
+
const d = E({
|
|
617
660
|
sort: S
|
|
618
661
|
});
|
|
619
|
-
for (const
|
|
620
|
-
a.searchParams.set(
|
|
662
|
+
for (const w in d)
|
|
663
|
+
a.searchParams.set(w, JSON.stringify(d[w]));
|
|
621
664
|
}
|
|
622
665
|
const x = {
|
|
623
|
-
...
|
|
624
|
-
...
|
|
666
|
+
...gt(),
|
|
667
|
+
...M(t.options || {})
|
|
625
668
|
};
|
|
626
669
|
m = {
|
|
627
670
|
...m,
|
|
628
671
|
...Ht(x)
|
|
629
672
|
};
|
|
630
|
-
const
|
|
631
|
-
for (const d in
|
|
632
|
-
a.searchParams.set(d, String(
|
|
673
|
+
const B = E(x);
|
|
674
|
+
for (const d in B)
|
|
675
|
+
a.searchParams.set(d, String(B[d]));
|
|
633
676
|
if (Object.keys(m).length > 0 && a.searchParams.set("userAttributes", JSON.stringify(m)), r) {
|
|
634
|
-
const d =
|
|
677
|
+
const d = et({
|
|
635
678
|
query: r
|
|
636
679
|
});
|
|
637
|
-
for (const
|
|
638
|
-
a.searchParams.set(
|
|
680
|
+
for (const w in d)
|
|
681
|
+
a.searchParams.set(w, JSON.stringify(d[w]));
|
|
639
682
|
}
|
|
640
683
|
return a;
|
|
641
|
-
},
|
|
684
|
+
}, zt = (t) => {
|
|
642
685
|
const e = {};
|
|
643
686
|
for (const n in t)
|
|
644
687
|
n.startsWith("userAttributes.") && (e[n] = t[n], delete t[n]);
|
|
@@ -646,60 +689,60 @@ const _t = "v3", V = (t) => typeof t == "number" && !isNaN(t) && t >= 0, O = (t)
|
|
|
646
689
|
}, Ht = (t) => {
|
|
647
690
|
if (c() && t.preview === "BUILDER_STUDIO") {
|
|
648
691
|
t["userAttributes.urlPath"] = window.location.pathname, t["userAttributes.host"] = window.location.host;
|
|
649
|
-
const e =
|
|
692
|
+
const e = zt(t), {
|
|
650
693
|
userAttributes: n
|
|
651
|
-
} =
|
|
694
|
+
} = Jt(e);
|
|
652
695
|
return n;
|
|
653
696
|
}
|
|
654
697
|
return {};
|
|
655
|
-
},
|
|
656
|
-
async function
|
|
657
|
-
const e = await
|
|
698
|
+
}, Qt = (t) => "results" in t;
|
|
699
|
+
async function Yt(t) {
|
|
700
|
+
const e = await te({
|
|
658
701
|
...t,
|
|
659
702
|
limit: 1
|
|
660
703
|
});
|
|
661
704
|
return e && e[0] || null;
|
|
662
705
|
}
|
|
663
|
-
const
|
|
706
|
+
const Zt = async (t) => {
|
|
664
707
|
var i, u;
|
|
665
|
-
const e =
|
|
708
|
+
const e = U(t), n = (i = t.fetch) != null ? i : Gt, r = {
|
|
666
709
|
...t.fetchOptions,
|
|
667
710
|
headers: {
|
|
668
711
|
...(u = t.fetchOptions) == null ? void 0 : u.headers,
|
|
669
|
-
|
|
712
|
+
...$()
|
|
670
713
|
}
|
|
671
714
|
};
|
|
672
715
|
return await (await n(e.href, r)).json();
|
|
673
|
-
},
|
|
674
|
-
const r =
|
|
716
|
+
}, qt = async (t, e, n = U(t)) => {
|
|
717
|
+
const r = Wt(t.canTrack);
|
|
675
718
|
if (n.search.includes("preview="), !r || !(c() || v === "reactNative"))
|
|
676
719
|
return e.results;
|
|
677
720
|
try {
|
|
678
|
-
const
|
|
679
|
-
for (const
|
|
680
|
-
|
|
681
|
-
item:
|
|
721
|
+
const s = [];
|
|
722
|
+
for (const o of e.results)
|
|
723
|
+
s.push(await Kt({
|
|
724
|
+
item: o,
|
|
682
725
|
canTrack: r
|
|
683
726
|
}));
|
|
684
|
-
e.results =
|
|
685
|
-
} catch (
|
|
686
|
-
f.error("Could not process A/B tests. ",
|
|
727
|
+
e.results = s;
|
|
728
|
+
} catch (s) {
|
|
729
|
+
f.error("Could not process A/B tests. ", s);
|
|
687
730
|
}
|
|
688
731
|
return e.results;
|
|
689
732
|
};
|
|
690
|
-
async function
|
|
691
|
-
const e =
|
|
692
|
-
if (!
|
|
733
|
+
async function te(t) {
|
|
734
|
+
const e = U(t), n = await Zt(t);
|
|
735
|
+
if (!Qt(n))
|
|
693
736
|
throw f.error("Error fetching data. ", {
|
|
694
737
|
url: e,
|
|
695
738
|
content: n,
|
|
696
739
|
options: t
|
|
697
740
|
}), n;
|
|
698
|
-
return
|
|
741
|
+
return qt(t, n);
|
|
699
742
|
}
|
|
700
|
-
const
|
|
701
|
-
var r,
|
|
702
|
-
const e = t.path || ((r = t.url) == null ? void 0 : r.pathname) || ((
|
|
743
|
+
const ue = async (t) => {
|
|
744
|
+
var r, s, o;
|
|
745
|
+
const e = t.path || ((r = t.url) == null ? void 0 : r.pathname) || ((s = t.userAttributes) == null ? void 0 : s.urlPath), n = {
|
|
703
746
|
...t,
|
|
704
747
|
apiKey: t.apiKey,
|
|
705
748
|
model: t.model || "page",
|
|
@@ -709,38 +752,40 @@ const se = async (t) => {
|
|
|
709
752
|
urlPath: e
|
|
710
753
|
} : {}
|
|
711
754
|
},
|
|
712
|
-
options:
|
|
755
|
+
options: W(t.searchParams || ((o = t.url) == null ? void 0 : o.searchParams) || t.options)
|
|
713
756
|
};
|
|
714
757
|
return {
|
|
715
758
|
apiKey: n.apiKey,
|
|
716
759
|
model: n.model,
|
|
717
|
-
content: await
|
|
760
|
+
content: await Yt(n)
|
|
718
761
|
};
|
|
719
762
|
};
|
|
720
763
|
export {
|
|
721
764
|
v as TARGET,
|
|
722
|
-
|
|
765
|
+
qt as _processContentResult,
|
|
723
766
|
xt as _track,
|
|
724
767
|
y as checkIsDefined,
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
768
|
+
Lt as createEditorListener,
|
|
769
|
+
ne as createRegisterComponentMessage,
|
|
770
|
+
ue as fetchBuilderProps,
|
|
771
|
+
te as fetchEntries,
|
|
772
|
+
Yt as fetchOneEntry,
|
|
773
|
+
W as getBuilderSearchParams,
|
|
774
|
+
Wt as getDefaultCanTrack,
|
|
775
|
+
lt as getUserAttributes,
|
|
776
|
+
ae as handleABTestingSync,
|
|
734
777
|
c as isBrowser,
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
778
|
+
at as isEditing,
|
|
779
|
+
ee as isPreviewing,
|
|
780
|
+
Ct as logFetch,
|
|
738
781
|
f as logger,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
782
|
+
ft as register,
|
|
783
|
+
oe as registerInsertMenu,
|
|
784
|
+
j as serializeIncludingFunctions,
|
|
785
|
+
ce as setClientUserAttributes,
|
|
786
|
+
re as setEditorSettings,
|
|
787
|
+
Rt as setupBrowserForEditing,
|
|
788
|
+
ie as subscribeToEditor,
|
|
789
|
+
se as track,
|
|
790
|
+
tt as userAttributesService
|
|
746
791
|
};
|