@picked/client 0.0.1-dev.1787543060859 → 0.0.1-dev.1788925875333
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/.tsbuildinfo +1 -1
- package/dist/api-DbMJli3H.js +22 -0
- package/dist/api-qiqq8lgz.cjs +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/plugins/telemetry/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/how-to/fill-and-publish-a-page.md +18 -2
- package/dist/docs/reference/dashboard/content/pages.mdx +25 -0
- package/dist/docs/reference/dashboard/fields.mdx +17 -11
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +1 -1
- package/dist/docs/reference/sdk/features.md +5 -0
- package/dist/docs/reference/sdk/fields.md +62 -16
- package/dist/docs/reference/sdk/type-generation.md +18 -7
- package/dist/docs/reference/tools/mcp.md +3 -1
- package/dist/esm/index.js +468 -439
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/plugins/responses-browser-storage/index.js +50 -16
- package/dist/esm/plugins/responses-indexeddb/index.js +1 -1
- package/dist/esm/plugins/telemetry/index.js +46 -47
- package/dist/esm/server/index.js +1 -1
- package/dist/{plugin-BcFzHPC7.cjs → plugin-BcLaCLm1.cjs} +1 -1
- package/dist/{plugin-L5y4NdFX.js → plugin-De_BJSwE.js} +3 -2
- package/dist/provider-C_9u0yGJ.cjs +1 -0
- package/dist/provider-ovM-CBX_.js +98 -0
- package/dist/types/client.d.ts +21 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/data-source/api.d.ts.map +1 -1
- package/dist/types/data-source/provider.d.ts +3 -0
- package/dist/types/data-source/provider.d.ts.map +1 -1
- package/dist/types/data-source/request-observer.d.ts +38 -22
- package/dist/types/data-source/request-observer.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +29 -4
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/field/policies.d.ts +35 -0
- package/dist/types/entities/field/policies.d.ts.map +1 -0
- package/dist/types/entities/plugin/plugin.d.ts +3 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lifecycle/lifecycle.d.ts +1 -1
- package/dist/types/lifecycle/lifecycle.d.ts.map +1 -1
- package/dist/types/picked.d.ts +9 -11
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +3 -8
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +11 -0
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
- package/dist/types/plugins/telemetry/emit.d.ts +3 -3
- package/dist/types/plugins/telemetry/emit.d.ts.map +1 -1
- package/dist/types/plugins/telemetry/plugin.d.ts +10 -1
- package/dist/types/plugins/telemetry/plugin.d.ts.map +1 -1
- package/dist/types/utils/client-telemetry.d.ts +25 -0
- package/dist/types/utils/client-telemetry.d.ts.map +1 -0
- package/dist/types/utils/user-timing.d.ts +16 -13
- package/dist/types/utils/user-timing.d.ts.map +1 -1
- package/dist/{version-BqU6f22c.cjs → version-BvLZaTMC.cjs} +1 -1
- package/dist/{version-DAFO6eas.js → version-VvasRUfR.js} +2 -2
- package/package.json +3 -3
- package/dist/api-CahTmEWe.cjs +0 -1
- package/dist/api-DwTNwuWK.js +0 -33
- package/dist/provider-BLDm3i8g.cjs +0 -1
- package/dist/provider-Dx6VjvZg.js +0 -69
- package/dist/request-observer-BXDfOU0V.cjs +0 -1
- package/dist/request-observer-DtG0cRfz.js +0 -19
- package/dist/types/ping.d.ts +0 -11
- package/dist/types/ping.d.ts.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -4,16 +4,15 @@ import { t as r } from "../logger-DMN6TxJJ.js";
|
|
|
4
4
|
import { a as i, c as a, d as o, f as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _ } from "../supports-CO9bJGNl.js";
|
|
5
5
|
import { a as v, i as y, r as ee, s as b, t as x } from "../dom-BqcToNL0.js";
|
|
6
6
|
import { l as S, n as C, r as w, u as T } from "../experience-instance-DGk11d8a.js";
|
|
7
|
-
import { i as
|
|
8
|
-
import { i as
|
|
9
|
-
import { t as
|
|
10
|
-
import { n as
|
|
11
|
-
import { attach as
|
|
12
|
-
import { createFactory as
|
|
13
|
-
import { sendPing as de } from "@picked/delivery-api-client";
|
|
7
|
+
import { i as E, n as D, r as O, t as k } from "../storage-1MW3-_As.js";
|
|
8
|
+
import { i as te, n as ne, r as re, t as ie } from "../version-VvasRUfR.js";
|
|
9
|
+
import { t as ae } from "../id-Bo4RBeOs.js";
|
|
10
|
+
import { n as oe, r as se, t as ce } from "../inert-script-report-B_bMPRzp.js";
|
|
11
|
+
import { attach as A, combine as j, createApi as M, createDomain as N, createEffect as P, createEvent as F, createStore as I, is as le, sample as L } from "effector";
|
|
12
|
+
import { createFactory as R, invoke as z } from "@withease/factories";
|
|
14
13
|
//#region src/entities/experience/experience.ts
|
|
15
|
-
var
|
|
16
|
-
let i =
|
|
14
|
+
var B = N("experience"), ue = R(({ client: e, experience: r }) => {
|
|
15
|
+
let i = B.store(r), a = M(i, { merge(e, t) {
|
|
17
16
|
return {
|
|
18
17
|
...e,
|
|
19
18
|
...t.experience
|
|
@@ -23,7 +22,7 @@ var z = M("experience"), fe = L(({ client: e, experience: r }) => {
|
|
|
23
22
|
decisionLogic: e.condition,
|
|
24
23
|
targetSelectors: e.targets,
|
|
25
24
|
initializeOpenLogic: e.initializeOpen
|
|
26
|
-
})), s =
|
|
25
|
+
})), s = j(i, e.components.listStore, (e, t) => (e.componentName ? t.find((t) => t.name === e.componentName) : void 0) || t.find((t) => t.name === `experience:${e.id}`) || t.find((e) => e.name === "experience"), { skipVoid: !1 }), c = j(i, e.steps.indexStore, e.conditions.indexStore, (e, t, n) => {
|
|
27
26
|
let r = e.nodes.filter(T).map((e) => t[e.stepId]).filter((e) => e !== void 0), i = e.nodes.filter(S).map((e) => n[e.conditionId]).filter((e) => e !== void 0);
|
|
28
27
|
return {
|
|
29
28
|
steps: r,
|
|
@@ -31,7 +30,7 @@ var z = M("experience"), fe = L(({ client: e, experience: r }) => {
|
|
|
31
30
|
edges: e.edges,
|
|
32
31
|
conditions: i
|
|
33
32
|
};
|
|
34
|
-
}), l = r.actions ?? [], u, d =
|
|
33
|
+
}), l = r.actions ?? [], u, d = A({
|
|
35
34
|
source: o,
|
|
36
35
|
effect: (t, n) => {
|
|
37
36
|
let i = y(t.targetSelectors, r.id);
|
|
@@ -39,18 +38,18 @@ var z = M("experience"), fe = L(({ client: e, experience: r }) => {
|
|
|
39
38
|
n ? e.experienceInstances.spawn(u, t, n) : e.experienceInstances.spawn(u, t);
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
|
-
}), f =
|
|
41
|
+
}), f = j({
|
|
43
42
|
preconditionPassed: e.preconditionPassedStore,
|
|
44
43
|
isUser: e.session.store.map((e) => e.isUser, { skipVoid: !1 }),
|
|
45
44
|
config: o
|
|
46
|
-
}), p =
|
|
45
|
+
}), p = A({
|
|
47
46
|
source: f,
|
|
48
47
|
effect: async ({ preconditionPassed: i, isUser: a, config: o }) => {
|
|
49
48
|
if (!i || !a) return !1;
|
|
50
49
|
let { decisionLogic: s, targetSelectors: c } = o;
|
|
51
50
|
return c.length === 0 || y(c, r.id).length < 1 ? !1 : s === void 0 || !t(s) || await n(e, s) === !0;
|
|
52
51
|
}
|
|
53
|
-
}), m =
|
|
52
|
+
}), m = P(async () => {
|
|
54
53
|
if (!e.contentLoader) return !0;
|
|
55
54
|
try {
|
|
56
55
|
await e.contentLoader({
|
|
@@ -61,26 +60,26 @@ var z = M("experience"), fe = L(({ client: e, experience: r }) => {
|
|
|
61
60
|
`${r.id}`;
|
|
62
61
|
}
|
|
63
62
|
return !0;
|
|
64
|
-
}), h =
|
|
65
|
-
return
|
|
63
|
+
}), h = F(), g = F(), _ = B.createStore(void 0, { skipVoid: !1 }).on(h, (e, t) => t).on(g, (e, t) => t);
|
|
64
|
+
return L({
|
|
66
65
|
clock: h,
|
|
67
66
|
target: p
|
|
68
|
-
}),
|
|
67
|
+
}), L({
|
|
69
68
|
clock: p.doneData,
|
|
70
69
|
source: _,
|
|
71
70
|
filter: (e, t) => t,
|
|
72
71
|
fn: (e) => e,
|
|
73
72
|
target: d
|
|
74
|
-
}),
|
|
73
|
+
}), L({
|
|
75
74
|
clock: p.doneData,
|
|
76
75
|
filter: Boolean,
|
|
77
76
|
target: m
|
|
78
|
-
}),
|
|
77
|
+
}), L({
|
|
79
78
|
clock: g,
|
|
80
79
|
source: _,
|
|
81
80
|
fn: (e) => e,
|
|
82
81
|
target: d
|
|
83
|
-
}),
|
|
82
|
+
}), L({
|
|
84
83
|
clock: g,
|
|
85
84
|
target: m
|
|
86
85
|
}), u = {
|
|
@@ -99,22 +98,22 @@ var z = M("experience"), fe = L(({ client: e, experience: r }) => {
|
|
|
99
98
|
prepareExperienceContentFx: m
|
|
100
99
|
}, u;
|
|
101
100
|
});
|
|
102
|
-
function
|
|
103
|
-
return
|
|
101
|
+
function de(e) {
|
|
102
|
+
return z(ue, e);
|
|
104
103
|
}
|
|
105
|
-
var
|
|
106
|
-
let t =
|
|
104
|
+
var fe = R(({ client: e }) => {
|
|
105
|
+
let t = B.store({}), n = M(t, { register(e, t) {
|
|
107
106
|
return {
|
|
108
107
|
...e,
|
|
109
108
|
[t.id]: t
|
|
110
109
|
};
|
|
111
|
-
} }), r =
|
|
112
|
-
n.register(
|
|
110
|
+
} }), r = F(), i = P((t) => {
|
|
111
|
+
n.register(de({
|
|
113
112
|
client: e,
|
|
114
113
|
experience: t
|
|
115
114
|
}));
|
|
116
115
|
});
|
|
117
|
-
|
|
116
|
+
L({
|
|
118
117
|
clock: r,
|
|
119
118
|
source: t,
|
|
120
119
|
filter: (e, t) => e[t.id] !== void 0,
|
|
@@ -127,7 +126,7 @@ var me = L(({ client: e }) => {
|
|
|
127
126
|
experience: t,
|
|
128
127
|
strategy: "override"
|
|
129
128
|
});
|
|
130
|
-
}),
|
|
129
|
+
}), L({
|
|
131
130
|
clock: r,
|
|
132
131
|
source: t,
|
|
133
132
|
filter: (e, t) => e[t.id] === void 0,
|
|
@@ -141,7 +140,7 @@ var me = L(({ client: e }) => {
|
|
|
141
140
|
function s(e) {
|
|
142
141
|
return t.map((t) => Object.values(t).find((t) => t.key === e) ?? t[e], { skipVoid: !1 });
|
|
143
142
|
}
|
|
144
|
-
let c =
|
|
143
|
+
let c = A({
|
|
145
144
|
source: t,
|
|
146
145
|
effect: (e, t) => {
|
|
147
146
|
let n = "key" in t ? Object.values(e).find((e) => e.key === t.key) : e[t.id];
|
|
@@ -159,7 +158,7 @@ var me = L(({ client: e }) => {
|
|
|
159
158
|
getById: o,
|
|
160
159
|
getByKey: s,
|
|
161
160
|
launch: c,
|
|
162
|
-
open:
|
|
161
|
+
open: A({
|
|
163
162
|
source: {
|
|
164
163
|
experiences: t,
|
|
165
164
|
instances: e.experienceInstances.listStore
|
|
@@ -187,7 +186,7 @@ var me = L(({ client: e }) => {
|
|
|
187
186
|
}
|
|
188
187
|
}),
|
|
189
188
|
listStore: a,
|
|
190
|
-
initialiseExperiencesFx:
|
|
189
|
+
initialiseExperiencesFx: A({
|
|
191
190
|
source: a,
|
|
192
191
|
effect: (e) => {
|
|
193
192
|
for (let t of e) t.initialiseRequested(void 0);
|
|
@@ -195,48 +194,48 @@ var me = L(({ client: e }) => {
|
|
|
195
194
|
})
|
|
196
195
|
};
|
|
197
196
|
});
|
|
198
|
-
function
|
|
199
|
-
return
|
|
197
|
+
function pe(e) {
|
|
198
|
+
return z(fe, e);
|
|
200
199
|
}
|
|
201
|
-
var
|
|
200
|
+
var me = async (e) => {
|
|
202
201
|
await e.experiences.initialiseExperiencesFx();
|
|
203
202
|
};
|
|
204
203
|
//#endregion
|
|
205
204
|
//#region src/entities/plugin/plugin.ts
|
|
206
|
-
function
|
|
207
|
-
return
|
|
205
|
+
function he(e) {
|
|
206
|
+
return P(async () => {
|
|
208
207
|
await e();
|
|
209
208
|
});
|
|
210
209
|
}
|
|
211
|
-
var
|
|
210
|
+
var ge = (e, t, n) => {
|
|
212
211
|
let r = t.name, i = t.setup(e), a = n[r] ?? {};
|
|
213
212
|
n[r] = Object.freeze({
|
|
214
213
|
...a,
|
|
215
214
|
...i
|
|
216
215
|
});
|
|
217
|
-
},
|
|
216
|
+
}, _e = N("component"), ve = R(({ client: e, component: t, name: n }) => ({
|
|
218
217
|
name: n,
|
|
219
218
|
component: t,
|
|
220
219
|
frameworkStore: e.frameworks.getByName(t.frameworkName)
|
|
221
220
|
}));
|
|
222
|
-
function
|
|
223
|
-
return
|
|
221
|
+
function ye(e) {
|
|
222
|
+
return z(ve, e);
|
|
224
223
|
}
|
|
225
|
-
var
|
|
226
|
-
let t =
|
|
224
|
+
var be = R(({ client: e }) => {
|
|
225
|
+
let t = _e.store({}), n = M(t, { register(e, t) {
|
|
227
226
|
return {
|
|
228
227
|
...e,
|
|
229
228
|
[t.name]: t
|
|
230
229
|
};
|
|
231
|
-
} }), i =
|
|
232
|
-
|
|
230
|
+
} }), i = F();
|
|
231
|
+
L({
|
|
233
232
|
clock: i,
|
|
234
233
|
source: t,
|
|
235
234
|
filter: (e, { name: t }) => e[t] !== void 0,
|
|
236
235
|
fn: (e, { name: t }) => `Component '${t}' already registered. Registering again will override the previous registration.`
|
|
237
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
236
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
238
237
|
clock: i,
|
|
239
|
-
fn: ({ name: t, component: n }) =>
|
|
238
|
+
fn: ({ name: t, component: n }) => ye({
|
|
240
239
|
client: e,
|
|
241
240
|
name: t,
|
|
242
241
|
component: n
|
|
@@ -253,27 +252,27 @@ var Se = L(({ client: e }) => {
|
|
|
253
252
|
listStore: a
|
|
254
253
|
};
|
|
255
254
|
});
|
|
256
|
-
function
|
|
257
|
-
return
|
|
255
|
+
function xe(e) {
|
|
256
|
+
return z(be, e);
|
|
258
257
|
}
|
|
259
|
-
var
|
|
258
|
+
var Se = (e, t, n) => {
|
|
260
259
|
n.register({
|
|
261
260
|
name: e,
|
|
262
261
|
component: t
|
|
263
262
|
});
|
|
264
|
-
},
|
|
265
|
-
let t =
|
|
263
|
+
}, Ce = N("framework"), we = R((e) => {
|
|
264
|
+
let t = Ce.store({}), n = M(t, { register(e, t) {
|
|
266
265
|
return {
|
|
267
266
|
...e,
|
|
268
267
|
[t.name]: t.framework
|
|
269
268
|
};
|
|
270
|
-
} }), i =
|
|
271
|
-
|
|
269
|
+
} }), i = F();
|
|
270
|
+
L({
|
|
272
271
|
clock: i,
|
|
273
272
|
source: t,
|
|
274
273
|
filter: (e, { name: t }) => e[t] !== void 0,
|
|
275
274
|
fn: (e, { name: t }) => `Framework '${t}' already registered. Registering again will override the previous registration.`
|
|
276
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
275
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
277
276
|
clock: i,
|
|
278
277
|
target: n.register
|
|
279
278
|
});
|
|
@@ -287,106 +286,106 @@ var we = (e, t, n) => {
|
|
|
287
286
|
listStore: a
|
|
288
287
|
};
|
|
289
288
|
});
|
|
290
|
-
function
|
|
291
|
-
return
|
|
289
|
+
function Te(e) {
|
|
290
|
+
return z(we, e);
|
|
292
291
|
}
|
|
293
|
-
var
|
|
292
|
+
var Ee = (e, t) => {
|
|
294
293
|
t.register({
|
|
295
294
|
name: e.name,
|
|
296
295
|
framework: e
|
|
297
296
|
});
|
|
298
|
-
},
|
|
297
|
+
}, De = R(({ client: e }) => {
|
|
299
298
|
let t = "window" in globalThis, n = {
|
|
300
299
|
location: t ? globalThis.location : void 0,
|
|
301
300
|
document: t ? globalThis.document : void 0,
|
|
302
301
|
sessionStorage: t ? globalThis.sessionStorage : void 0,
|
|
303
302
|
localStorage: t ? globalThis.localStorage : void 0
|
|
304
303
|
};
|
|
305
|
-
return
|
|
304
|
+
return j(e.responses.listStore, e.fields.listStore, (t, r) => Object.freeze({
|
|
306
305
|
client: e,
|
|
307
306
|
responses: t,
|
|
308
307
|
fields: r,
|
|
309
308
|
...n
|
|
310
309
|
}));
|
|
311
310
|
});
|
|
312
|
-
function
|
|
313
|
-
return
|
|
311
|
+
function Oe(e) {
|
|
312
|
+
return z(De, e);
|
|
314
313
|
}
|
|
315
314
|
//#endregion
|
|
316
315
|
//#region src/logic-engine.ts
|
|
317
|
-
function
|
|
316
|
+
function ke(e) {
|
|
318
317
|
return typeof e == "number" && !isNaN(e);
|
|
319
318
|
}
|
|
320
|
-
function
|
|
319
|
+
function V(e) {
|
|
321
320
|
return typeof e == "string";
|
|
322
321
|
}
|
|
323
|
-
function
|
|
322
|
+
function H(e) {
|
|
324
323
|
return Array.isArray(e);
|
|
325
324
|
}
|
|
326
|
-
function
|
|
325
|
+
function Ae(e) {
|
|
327
326
|
return e instanceof Promise;
|
|
328
327
|
}
|
|
329
|
-
function
|
|
328
|
+
function je(e) {
|
|
330
329
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
|
|
331
330
|
}
|
|
332
|
-
function
|
|
333
|
-
if (
|
|
331
|
+
function U(e) {
|
|
332
|
+
if (ke(e)) return e;
|
|
334
333
|
let t = parseFloat(`${e}`);
|
|
335
334
|
return isNaN(t) ? 0 : t;
|
|
336
335
|
}
|
|
337
|
-
function
|
|
336
|
+
function W(e) {
|
|
338
337
|
return `${e}`;
|
|
339
338
|
}
|
|
340
|
-
var
|
|
339
|
+
var Me = {
|
|
341
340
|
"==": (e, t) => e == t,
|
|
342
341
|
"===": (e, t) => e === t,
|
|
343
342
|
"!=": (e, t) => e != t,
|
|
344
343
|
"!==": (e, t) => e !== t,
|
|
345
|
-
">": (e, t) =>
|
|
346
|
-
">=": (e, t) =>
|
|
344
|
+
">": (e, t) => U(e) > U(t),
|
|
345
|
+
">=": (e, t) => U(e) >= U(t),
|
|
347
346
|
"<": (e, t, n) => {
|
|
348
|
-
let r =
|
|
347
|
+
let r = U(e), i = U(t);
|
|
349
348
|
if (n === void 0) return r < i;
|
|
350
|
-
let a =
|
|
349
|
+
let a = U(n);
|
|
351
350
|
return r < i && i < a;
|
|
352
351
|
},
|
|
353
352
|
"<=": (e, t, n) => {
|
|
354
|
-
let r =
|
|
353
|
+
let r = U(e), i = U(t);
|
|
355
354
|
if (n === void 0) return r <= i;
|
|
356
|
-
let a =
|
|
355
|
+
let a = U(n);
|
|
357
356
|
return r <= i && i <= a;
|
|
358
357
|
},
|
|
359
|
-
"!!": async (e) => await
|
|
360
|
-
"!": async (e) => !await
|
|
361
|
-
"%": (e, t) =>
|
|
358
|
+
"!!": async (e) => await K(e),
|
|
359
|
+
"!": async (e) => !await K(e),
|
|
360
|
+
"%": (e, t) => U(e) % U(t),
|
|
362
361
|
log: (e) => (console.log(e), e),
|
|
363
|
-
in: (e, t) => t ?
|
|
364
|
-
cat: (...e) => e.map(
|
|
362
|
+
in: (e, t) => t ? V(t) ? t.indexOf(W(e)) !== -1 : H(t) ? t.includes(e) : !1 : !1,
|
|
363
|
+
cat: (...e) => e.map(W).join(""),
|
|
365
364
|
substr: (e, t, n) => {
|
|
366
|
-
let r =
|
|
365
|
+
let r = W(e), i = U(t);
|
|
367
366
|
if (n === void 0) return r.substr(i);
|
|
368
|
-
let a =
|
|
367
|
+
let a = U(n);
|
|
369
368
|
if (a < 0) {
|
|
370
369
|
let e = r.substr(i);
|
|
371
370
|
return e.substr(0, e.length + a);
|
|
372
371
|
}
|
|
373
372
|
return r.substr(i, a);
|
|
374
373
|
},
|
|
375
|
-
"+": (...e) => e.reduce((e, t) =>
|
|
376
|
-
"*": (...e) => e.reduce((e, t) =>
|
|
374
|
+
"+": (...e) => e.reduce((e, t) => U(e) + U(t), 0),
|
|
375
|
+
"*": (...e) => e.reduce((e, t) => U(e) * U(t), 1),
|
|
377
376
|
"-": (e, t) => {
|
|
378
|
-
let n =
|
|
379
|
-
return t === void 0 ? -n : n -
|
|
377
|
+
let n = U(e);
|
|
378
|
+
return t === void 0 ? -n : n - U(t);
|
|
380
379
|
},
|
|
381
|
-
"/": (e, t) =>
|
|
382
|
-
min: (...e) => Math.min(...e.map(
|
|
383
|
-
max: (...e) => Math.max(...e.map(
|
|
384
|
-
merge: (...e) => e.reduce((e, t) =>
|
|
380
|
+
"/": (e, t) => U(e) / U(t),
|
|
381
|
+
min: (...e) => Math.min(...e.map(U)),
|
|
382
|
+
max: (...e) => Math.max(...e.map(U)),
|
|
383
|
+
merge: (...e) => e.reduce((e, t) => H(t) ? e.concat(t) : e.concat([t]), []),
|
|
385
384
|
var(e, t) {
|
|
386
385
|
let n = arguments.length > 1 ? t : null;
|
|
387
386
|
if (e === "" || e === "." || e == null) return this;
|
|
388
387
|
if (typeof e == "number" && Array.isArray(this)) return e >= 0 && e < this.length ? this[e] : n;
|
|
389
|
-
let r =
|
|
388
|
+
let r = W(e);
|
|
390
389
|
if (r === "" || r === ".") return this;
|
|
391
390
|
let i = r.split("."), a = this;
|
|
392
391
|
for (let e of i) {
|
|
@@ -399,126 +398,126 @@ var Pe = {
|
|
|
399
398
|
return a === void 0 ? n : a;
|
|
400
399
|
},
|
|
401
400
|
async missing(...e) {
|
|
402
|
-
let t =
|
|
401
|
+
let t = H(e[0]) ? e[0] : e, n = [];
|
|
403
402
|
for (let e of t) {
|
|
404
|
-
let t = await
|
|
403
|
+
let t = await G({ var: e }, this);
|
|
405
404
|
(t === null || t === "") && n.push(`${e}`);
|
|
406
405
|
}
|
|
407
406
|
return n;
|
|
408
407
|
},
|
|
409
408
|
async missing_some(e, t) {
|
|
410
|
-
let n = await
|
|
411
|
-
if (!
|
|
412
|
-
let r = n.filter(
|
|
413
|
-
return t.filter(
|
|
409
|
+
let n = await G({ missing: t }, this);
|
|
410
|
+
if (!H(n) || !H(t)) return [];
|
|
411
|
+
let r = n.filter(V);
|
|
412
|
+
return t.filter(V).length - r.length >= U(e) ? [] : r;
|
|
414
413
|
},
|
|
415
414
|
invoke(...e) {
|
|
416
415
|
let [t, ...n] = e;
|
|
417
416
|
return typeof t == "function" ? Reflect.apply(t, null, n) : null;
|
|
418
417
|
},
|
|
419
|
-
startsWith: (e, t) =>
|
|
420
|
-
endsWith: (e, t) =>
|
|
418
|
+
startsWith: (e, t) => V(e) && V(t) && e.startsWith(t),
|
|
419
|
+
endsWith: (e, t) => V(e) && V(t) && e.endsWith(t),
|
|
421
420
|
regexp_matches(e, t) {
|
|
422
421
|
let n = e, r = "";
|
|
423
|
-
if (
|
|
422
|
+
if (H(e)) {
|
|
424
423
|
let [t, i] = e;
|
|
425
424
|
n = t, r = i;
|
|
426
425
|
}
|
|
427
|
-
return !
|
|
426
|
+
return !V(n) || !V(r) ? !1 : new RegExp(n, r).test(W(t));
|
|
428
427
|
},
|
|
429
428
|
throw(e) {
|
|
430
|
-
throw Error(
|
|
429
|
+
throw Error(W(e));
|
|
431
430
|
}
|
|
432
431
|
};
|
|
433
|
-
async function
|
|
432
|
+
async function G(e, t) {
|
|
434
433
|
if (!e) return e;
|
|
435
|
-
if (
|
|
436
|
-
if (
|
|
437
|
-
if (!
|
|
438
|
-
let n =
|
|
439
|
-
switch (
|
|
434
|
+
if (Ae(e)) return G(await e, t);
|
|
435
|
+
if (H(e)) return Promise.all(e.map((e) => G(e, t)));
|
|
436
|
+
if (!je(e)) return e;
|
|
437
|
+
let n = Ne(e), r = n ? e[n] ?? [] : [];
|
|
438
|
+
switch (H(r) || (r = [r]), n) {
|
|
440
439
|
case "if":
|
|
441
440
|
case "?:":
|
|
442
|
-
for (let e = 0; e < r.length - 1; e += 2) if (await
|
|
443
|
-
return r.length % 2 == 1 ?
|
|
441
|
+
for (let e = 0; e < r.length - 1; e += 2) if (await K(await G(r[e], t))) return G(r[e + 1], t);
|
|
442
|
+
return r.length % 2 == 1 ? G(r[r.length - 1], t) : null;
|
|
444
443
|
case "and": {
|
|
445
444
|
let e = null;
|
|
446
|
-
for (let n of r) if (e = await
|
|
445
|
+
for (let n of r) if (e = await G(n, t), !await K(e)) return e;
|
|
447
446
|
return e;
|
|
448
447
|
}
|
|
449
448
|
case "or": {
|
|
450
449
|
let e = null;
|
|
451
|
-
for (let n of r) if (e = await
|
|
450
|
+
for (let n of r) if (e = await G(n, t), await K(e)) return e;
|
|
452
451
|
return e;
|
|
453
452
|
}
|
|
454
453
|
case "map": {
|
|
455
|
-
let e = await
|
|
456
|
-
return
|
|
454
|
+
let e = await G(r[0], t);
|
|
455
|
+
return H(e) ? await Promise.all(e.map((e) => G(r[1], e))) : [];
|
|
457
456
|
}
|
|
458
457
|
case "filter": {
|
|
459
|
-
let e = await
|
|
460
|
-
return
|
|
458
|
+
let e = await G(r[0], t);
|
|
459
|
+
return H(e) ? (await Promise.all(e.map(async (e) => ({
|
|
461
460
|
item: e,
|
|
462
|
-
shouldInclude: await
|
|
461
|
+
shouldInclude: await K(await G(r[1], e))
|
|
463
462
|
})))).filter(({ shouldInclude: e }) => e).map(({ item: e }) => e) : [];
|
|
464
463
|
}
|
|
465
464
|
case "reduce": {
|
|
466
|
-
let e = await
|
|
467
|
-
if (!
|
|
468
|
-
let n = r[1], i = r.length > 2 ? await
|
|
469
|
-
for (let t of e) i = await
|
|
465
|
+
let e = await G(r[0], t);
|
|
466
|
+
if (!H(e)) return r.length > 2 ? await G(r[2], t) : null;
|
|
467
|
+
let n = r[1], i = r.length > 2 ? await G(r[2], t) : null;
|
|
468
|
+
for (let t of e) i = await G(n, {
|
|
470
469
|
current: t,
|
|
471
470
|
accumulator: i
|
|
472
471
|
});
|
|
473
472
|
return i;
|
|
474
473
|
}
|
|
475
474
|
case "all": {
|
|
476
|
-
let e = await
|
|
477
|
-
if (!
|
|
478
|
-
for (let t of e) if (!await
|
|
475
|
+
let e = await G(r[0], t);
|
|
476
|
+
if (!H(e) || e.length === 0) return !1;
|
|
477
|
+
for (let t of e) if (!await K(await G(r[1], t))) return !1;
|
|
479
478
|
return !0;
|
|
480
479
|
}
|
|
481
480
|
case "some": {
|
|
482
|
-
let e = await
|
|
483
|
-
if (!
|
|
484
|
-
for (let t of e) if (await
|
|
481
|
+
let e = await G(r[0], t);
|
|
482
|
+
if (!H(e)) return !1;
|
|
483
|
+
for (let t of e) if (await K(await G(r[1], t))) return !0;
|
|
485
484
|
return !1;
|
|
486
485
|
}
|
|
487
486
|
case "none": {
|
|
488
|
-
let e = await
|
|
489
|
-
if (!
|
|
490
|
-
for (let t of e) if (await
|
|
487
|
+
let e = await G(r[0], t);
|
|
488
|
+
if (!H(e)) return !0;
|
|
489
|
+
for (let t of e) if (await K(await G(r[1], t))) return !1;
|
|
491
490
|
return !0;
|
|
492
491
|
}
|
|
493
492
|
case "catch": try {
|
|
494
|
-
return await
|
|
493
|
+
return await G(r[0], t);
|
|
495
494
|
} catch (e) {
|
|
496
|
-
return
|
|
495
|
+
return je(e) ? await G(e, t) : r[1] ? await G(r[1], e) : e instanceof Error ? e.message : e;
|
|
497
496
|
}
|
|
498
497
|
}
|
|
499
|
-
let i = await Promise.all(r.map((e) =>
|
|
498
|
+
let i = await Promise.all(r.map((e) => G(e, t))), a = n ? Me[n] : void 0;
|
|
500
499
|
if (!a) throw Error(`Unrecognized operation ${n}`);
|
|
501
500
|
return a.apply(t, i);
|
|
502
501
|
}
|
|
503
|
-
async function
|
|
504
|
-
return
|
|
502
|
+
async function K(e) {
|
|
503
|
+
return Ae(e) ? K(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
|
|
505
504
|
}
|
|
506
|
-
function
|
|
505
|
+
function Ne(e) {
|
|
507
506
|
return Object.keys(e)[0];
|
|
508
507
|
}
|
|
509
508
|
//#endregion
|
|
510
509
|
//#region src/lifecycle/rules-logic.ts
|
|
511
|
-
function
|
|
510
|
+
function Pe(e, t, n) {
|
|
512
511
|
return new Proxy(Object.create(null), { get(r, i) {
|
|
513
512
|
if (typeof i != "string") return;
|
|
514
513
|
let a = e.find((e) => e.key === i);
|
|
515
|
-
if (a !== void 0) return async () => !n.has(i) && await
|
|
514
|
+
if (a !== void 0) return async () => !n.has(i) && await G(a.logic, {
|
|
516
515
|
...t,
|
|
517
|
-
conditions:
|
|
516
|
+
conditions: Pe(e, t, new Set(n).add(i))
|
|
518
517
|
}) === !0;
|
|
519
518
|
} });
|
|
520
519
|
}
|
|
521
|
-
var
|
|
520
|
+
var Fe = R(({ client: e }) => A({
|
|
522
521
|
source: {
|
|
523
522
|
stateSnapshot: e.stateSnapshotStore,
|
|
524
523
|
predicates: e.predicates.listStore,
|
|
@@ -555,169 +554,130 @@ var Le = L(({ client: e }) => k({
|
|
|
555
554
|
features: u,
|
|
556
555
|
...s
|
|
557
556
|
};
|
|
558
|
-
return await
|
|
557
|
+
return await G(o, {
|
|
559
558
|
...d,
|
|
560
|
-
conditions:
|
|
559
|
+
conditions: Pe(a, d, /* @__PURE__ */ new Set())
|
|
561
560
|
});
|
|
562
561
|
}
|
|
563
562
|
}));
|
|
564
|
-
function
|
|
565
|
-
return
|
|
566
|
-
}
|
|
567
|
-
//#endregion
|
|
568
|
-
//#region src/ping.ts
|
|
569
|
-
var ze = 6e3, Be = O("last_ping", "global"), Ve = async (e) => {
|
|
570
|
-
try {
|
|
571
|
-
let t = Date.now(), n = E.get(Be), r = 0;
|
|
572
|
-
if (n.isSet() && (r = n.json() ?? 0), r && t - r < ze) return !0;
|
|
573
|
-
let i = {}, a = document.getElementById("picked_script")?.dataset.verceltoken;
|
|
574
|
-
a && (i["x-vercel-protection-bypass"] = a);
|
|
575
|
-
let o = await de(e.apiUrl, {
|
|
576
|
-
projectId: e.projectId,
|
|
577
|
-
path: window.location.pathname
|
|
578
|
-
}, { headers: i });
|
|
579
|
-
return o && n.set(t), o;
|
|
580
|
-
} catch {
|
|
581
|
-
return !1;
|
|
582
|
-
}
|
|
583
|
-
}, He = "picked:start:begin", Ue = "picked:start";
|
|
584
|
-
function We() {
|
|
585
|
-
try {
|
|
586
|
-
return s() && !!p.window && "performance" in p;
|
|
587
|
-
} catch {
|
|
588
|
-
return !1;
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
function Ge() {
|
|
592
|
-
if (We()) try {
|
|
593
|
-
performance.mark(He);
|
|
594
|
-
} catch {}
|
|
595
|
-
}
|
|
596
|
-
function Ke() {
|
|
597
|
-
if (We()) try {
|
|
598
|
-
performance.measure(Ue, He);
|
|
599
|
-
} catch {}
|
|
563
|
+
function Ie(e) {
|
|
564
|
+
return z(Fe, e);
|
|
600
565
|
}
|
|
601
566
|
//#endregion
|
|
602
567
|
//#region src/lifecycle/lifecycle.ts
|
|
603
|
-
var
|
|
604
|
-
let t =
|
|
568
|
+
var q = N("lifecycle"), Le = R(({ client: e }) => {
|
|
569
|
+
let t = q.store(!1), r = I(void 0, {
|
|
605
570
|
skipVoid: !1,
|
|
606
|
-
domain:
|
|
607
|
-
}), i =
|
|
571
|
+
domain: q
|
|
572
|
+
}), i = I(void 0, {
|
|
608
573
|
skipVoid: !1,
|
|
609
|
-
domain:
|
|
610
|
-
}), a =
|
|
574
|
+
domain: q
|
|
575
|
+
}), a = q.store("idle"), o = q.store([]), s = I(void 0, {
|
|
611
576
|
skipVoid: !1,
|
|
612
|
-
domain:
|
|
613
|
-
}), l =
|
|
577
|
+
domain: q
|
|
578
|
+
}), l = I(void 0, {
|
|
614
579
|
skipVoid: !1,
|
|
615
|
-
domain:
|
|
616
|
-
}), u =
|
|
580
|
+
domain: q
|
|
581
|
+
}), u = F(), d = F(), f = F(), p = F(), m = F(), h = F();
|
|
617
582
|
o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t), l.on(h, (e, t) => t), t.on(d, () => !0);
|
|
618
|
-
let g =
|
|
619
|
-
Ve(e);
|
|
620
|
-
}), _ = N(async () => {
|
|
583
|
+
let g = P(async () => {
|
|
621
584
|
await ee();
|
|
622
|
-
}),
|
|
623
|
-
await
|
|
624
|
-
}),
|
|
585
|
+
}), _ = P(async () => {
|
|
586
|
+
await me(e);
|
|
587
|
+
}), v = A({ effect: _ }), y = A({
|
|
625
588
|
source: o,
|
|
626
589
|
effect: async (e) => {
|
|
627
590
|
for (let t of e) await t();
|
|
628
591
|
}
|
|
629
|
-
}),
|
|
592
|
+
}), b = A({
|
|
630
593
|
source: s,
|
|
631
594
|
effect: async (t) => t === void 0 ? !0 : typeof t == "boolean" ? t : await n(e, t) === !0
|
|
632
|
-
}),
|
|
595
|
+
}), x = A({
|
|
633
596
|
source: l,
|
|
634
597
|
effect: async (t) => t === void 0 ? !0 : typeof t == "boolean" ? t : await n(e, t) === !0
|
|
635
|
-
}),
|
|
598
|
+
}), S = L({
|
|
636
599
|
clock: u,
|
|
637
600
|
source: a,
|
|
638
601
|
filter: (e) => e === "idle" && c(),
|
|
639
602
|
fn: () => void 0
|
|
640
603
|
});
|
|
641
|
-
|
|
642
|
-
clock:
|
|
604
|
+
L({
|
|
605
|
+
clock: S,
|
|
643
606
|
fn: () => "starting",
|
|
644
607
|
target: a
|
|
645
|
-
}),
|
|
646
|
-
clock:
|
|
608
|
+
}), S.watch(e.performance.markBegin), d.watch(e.performance.measure), L({
|
|
609
|
+
clock: S,
|
|
610
|
+
target: y
|
|
611
|
+
}), L({
|
|
612
|
+
clock: S,
|
|
647
613
|
target: g
|
|
648
|
-
}),
|
|
649
|
-
clock:
|
|
614
|
+
}), L({
|
|
615
|
+
clock: y.done,
|
|
650
616
|
target: b
|
|
651
|
-
}),
|
|
652
|
-
clock:
|
|
653
|
-
target: _
|
|
654
|
-
}), I({
|
|
655
|
-
clock: b.done,
|
|
656
|
-
target: x
|
|
657
|
-
}), I({
|
|
658
|
-
clock: x.doneData,
|
|
617
|
+
}), L({
|
|
618
|
+
clock: b.doneData,
|
|
659
619
|
target: r
|
|
660
|
-
}),
|
|
661
|
-
clock: S.doneData,
|
|
662
|
-
target: i
|
|
663
|
-
}), I({
|
|
620
|
+
}), L({
|
|
664
621
|
clock: x.doneData,
|
|
622
|
+
target: i
|
|
623
|
+
}), L({
|
|
624
|
+
clock: b.doneData,
|
|
665
625
|
filter: (e) => e,
|
|
666
|
-
target:
|
|
667
|
-
}),
|
|
668
|
-
clock:
|
|
626
|
+
target: x
|
|
627
|
+
}), L({
|
|
628
|
+
clock: x.doneData,
|
|
669
629
|
target: e.session.setIsUser
|
|
670
|
-
}),
|
|
671
|
-
clock:
|
|
630
|
+
}), L({
|
|
631
|
+
clock: x.doneData,
|
|
672
632
|
fn: (e) => ({
|
|
673
633
|
type: "user_decide",
|
|
674
634
|
value: e
|
|
675
635
|
}),
|
|
676
636
|
target: e.eventBus
|
|
677
|
-
}),
|
|
678
|
-
clock:
|
|
637
|
+
}), L({
|
|
638
|
+
clock: b.doneData,
|
|
679
639
|
filter: (e) => !e,
|
|
680
640
|
fn: () => void 0,
|
|
681
641
|
target: f
|
|
682
|
-
}),
|
|
683
|
-
clock:
|
|
642
|
+
}), L({
|
|
643
|
+
clock: x.doneData,
|
|
684
644
|
fn: () => void 0,
|
|
685
645
|
target: f
|
|
686
|
-
}),
|
|
646
|
+
}), L({
|
|
687
647
|
clock: f,
|
|
688
648
|
fn: () => ({ type: "initialize" }),
|
|
689
649
|
target: e.eventBus
|
|
690
650
|
});
|
|
691
|
-
let
|
|
692
|
-
|
|
651
|
+
let C = I(!1).on(g.done, () => !0), w = I(!1).on(f, () => !0), T = I(!1).on(v.done, () => !0), E = j(r, i, (e, t) => e === !0 && t === !0);
|
|
652
|
+
L({
|
|
693
653
|
clock: f,
|
|
694
654
|
source: E,
|
|
695
655
|
filter: (e) => e,
|
|
696
656
|
fn: () => void 0,
|
|
697
|
-
target:
|
|
657
|
+
target: _
|
|
698
658
|
});
|
|
699
|
-
let D =
|
|
700
|
-
|
|
659
|
+
let D = j(C, w, E, (e, t, n) => e && t && n);
|
|
660
|
+
L({
|
|
701
661
|
clock: D,
|
|
702
662
|
filter: (e) => e,
|
|
703
663
|
fn: () => void 0,
|
|
704
|
-
target:
|
|
664
|
+
target: v
|
|
705
665
|
});
|
|
706
|
-
let O =
|
|
707
|
-
return
|
|
666
|
+
let O = j(C, w, E, T, (e, t, n, r) => e && t && (!n || r));
|
|
667
|
+
return L({
|
|
708
668
|
clock: O,
|
|
709
669
|
filter: (e) => e,
|
|
710
670
|
fn: () => void 0,
|
|
711
671
|
target: d
|
|
712
|
-
}),
|
|
672
|
+
}), L({
|
|
713
673
|
clock: d,
|
|
714
674
|
fn: () => "ready",
|
|
715
675
|
target: a
|
|
716
|
-
}),
|
|
676
|
+
}), L({
|
|
717
677
|
clock: d,
|
|
718
678
|
fn: () => ({ type: "ready" }),
|
|
719
679
|
target: e.eventBus
|
|
720
|
-
}),
|
|
680
|
+
}), L({
|
|
721
681
|
clock: d,
|
|
722
682
|
source: e.session.store,
|
|
723
683
|
fn: ({ id: e, isUser: t, identifiers: n }) => ({
|
|
@@ -727,14 +687,14 @@ var K = M("lifecycle"), qe = L(({ client: e }) => {
|
|
|
727
687
|
identifiers: n
|
|
728
688
|
}),
|
|
729
689
|
target: e.eventBus
|
|
730
|
-
}),
|
|
690
|
+
}), L({
|
|
731
691
|
clock: [
|
|
692
|
+
y.fail,
|
|
732
693
|
b.fail,
|
|
733
694
|
x.fail,
|
|
734
|
-
|
|
695
|
+
_.fail,
|
|
735
696
|
v.fail,
|
|
736
|
-
|
|
737
|
-
_.fail
|
|
697
|
+
g.fail
|
|
738
698
|
],
|
|
739
699
|
fn: () => "failed",
|
|
740
700
|
target: a
|
|
@@ -749,13 +709,13 @@ var K = M("lifecycle"), qe = L(({ client: e }) => {
|
|
|
749
709
|
setCondition: h
|
|
750
710
|
};
|
|
751
711
|
});
|
|
752
|
-
function
|
|
753
|
-
return
|
|
712
|
+
function Re(e) {
|
|
713
|
+
return z(Le, e);
|
|
754
714
|
}
|
|
755
715
|
//#endregion
|
|
756
716
|
//#region src/entities/predicate/predicate.ts
|
|
757
|
-
var
|
|
758
|
-
let t =
|
|
717
|
+
var ze = N("predicate"), Be = R(({ client: e }) => {
|
|
718
|
+
let t = ze.store({}), n = M(t, { register(e, t) {
|
|
759
719
|
return {
|
|
760
720
|
...e,
|
|
761
721
|
[t.name]: {
|
|
@@ -763,13 +723,13 @@ var Ye = M("predicate"), Xe = L(({ client: e }) => {
|
|
|
763
723
|
predicate: t.predicate
|
|
764
724
|
}
|
|
765
725
|
};
|
|
766
|
-
} }), i =
|
|
767
|
-
|
|
726
|
+
} }), i = F();
|
|
727
|
+
L({
|
|
768
728
|
clock: i,
|
|
769
729
|
source: t,
|
|
770
730
|
filter: (e, { name: t }) => e[t] !== void 0,
|
|
771
731
|
fn: (e, { name: t }) => `Predicate '${t}' already registered. Registering again will override the previous registration.`
|
|
772
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
732
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
773
733
|
clock: i,
|
|
774
734
|
fn: ({ name: e, predicate: t }) => Object.freeze({
|
|
775
735
|
name: e,
|
|
@@ -782,7 +742,7 @@ var Ye = M("predicate"), Xe = L(({ client: e }) => {
|
|
|
782
742
|
return t.map((t) => t[e]?.predicate, { skipVoid: !1 });
|
|
783
743
|
}
|
|
784
744
|
function s(t) {
|
|
785
|
-
let n =
|
|
745
|
+
let n = I(() => void 0, { skipVoid: !1 }), r = A({
|
|
786
746
|
source: {
|
|
787
747
|
predicate: o(t),
|
|
788
748
|
snapshot: e.stateSnapshotStore
|
|
@@ -794,13 +754,13 @@ var Ye = M("predicate"), Xe = L(({ client: e }) => {
|
|
|
794
754
|
});
|
|
795
755
|
}
|
|
796
756
|
});
|
|
797
|
-
return
|
|
757
|
+
return L({
|
|
798
758
|
source: {
|
|
799
759
|
responses: e.responses.listStore,
|
|
800
760
|
fields: e.fields.listStore
|
|
801
761
|
},
|
|
802
762
|
target: r
|
|
803
|
-
}),
|
|
763
|
+
}), L({
|
|
804
764
|
clock: r.doneData,
|
|
805
765
|
filter: (e) => e !== void 0,
|
|
806
766
|
target: n
|
|
@@ -813,26 +773,26 @@ var Ye = M("predicate"), Xe = L(({ client: e }) => {
|
|
|
813
773
|
getEvokablePredicate: s
|
|
814
774
|
};
|
|
815
775
|
});
|
|
816
|
-
function
|
|
817
|
-
return
|
|
776
|
+
function Ve(e) {
|
|
777
|
+
return z(Be, e);
|
|
818
778
|
}
|
|
819
|
-
var
|
|
779
|
+
var He = (e, t, n) => {
|
|
820
780
|
n.register({
|
|
821
781
|
name: e,
|
|
822
782
|
predicate: t
|
|
823
783
|
});
|
|
824
|
-
},
|
|
825
|
-
function
|
|
784
|
+
}, J = N("history");
|
|
785
|
+
function Ue(e, t) {
|
|
826
786
|
return {
|
|
827
|
-
id:
|
|
787
|
+
id: ae(`history-entry-${Date.now()}-${Math.random()}}`),
|
|
828
788
|
node: t,
|
|
829
789
|
at: Date.now(),
|
|
830
790
|
experienceId: e
|
|
831
791
|
};
|
|
832
792
|
}
|
|
833
|
-
var
|
|
834
|
-
let e =
|
|
835
|
-
e.on(t, (e, t) => ({ entries: [...e.entries,
|
|
793
|
+
var We = R(() => {
|
|
794
|
+
let e = J.store({ entries: [] }), t = J.event(), n = J.event(), r = J.event(), i = J.event();
|
|
795
|
+
e.on(t, (e, t) => ({ entries: [...e.entries, Ue(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Ue(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
|
|
836
796
|
function a(e, t) {
|
|
837
797
|
let n = {
|
|
838
798
|
lastStepIndex: -1,
|
|
@@ -862,32 +822,49 @@ var et = L(() => {
|
|
|
862
822
|
entriesStore: e.map((e) => e.entries)
|
|
863
823
|
};
|
|
864
824
|
});
|
|
865
|
-
function
|
|
866
|
-
return
|
|
825
|
+
function Ge() {
|
|
826
|
+
return z(We);
|
|
867
827
|
}
|
|
868
828
|
//#endregion
|
|
869
829
|
//#region src/utils/events.ts
|
|
870
|
-
var
|
|
871
|
-
let t =
|
|
830
|
+
var Ke = 0, qe = (e) => {
|
|
831
|
+
let t = I([]);
|
|
872
832
|
return t.on(e, (e, t) => [...e, {
|
|
873
|
-
id:
|
|
833
|
+
id: Ke++,
|
|
874
834
|
at: /* @__PURE__ */ new Date(),
|
|
875
835
|
payload: t
|
|
876
836
|
}]), t;
|
|
877
|
-
}
|
|
878
|
-
|
|
837
|
+
};
|
|
838
|
+
//#endregion
|
|
839
|
+
//#region src/entities/field/policies.ts
|
|
840
|
+
function Je(e) {
|
|
841
|
+
let { doNotTrackValue: t, doNotStoreValue: n } = e ?? {}, r = e?.trackValue ?? t === !1, i = e?.storeValue ?? n === !1;
|
|
842
|
+
return {
|
|
843
|
+
trackValue: r,
|
|
844
|
+
storeValue: i,
|
|
845
|
+
doNotTrackValue: !r,
|
|
846
|
+
doNotStoreValue: !i
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
//#endregion
|
|
850
|
+
//#region src/entities/field/field.ts
|
|
851
|
+
var Ye = N("field"), Xe = R(() => {
|
|
852
|
+
let e = Ye.store({}), t = M(e, {
|
|
879
853
|
register(e, t) {
|
|
854
|
+
let n = Object.assign({}, t.field, { policies: Je(t.field.policies) });
|
|
880
855
|
return {
|
|
881
856
|
...e,
|
|
882
|
-
[
|
|
857
|
+
[n.id]: n
|
|
883
858
|
};
|
|
884
859
|
},
|
|
885
860
|
updateByKey(e, t) {
|
|
886
861
|
let n = Object.values(e).find((e) => e.key === t.fieldKey);
|
|
887
|
-
|
|
862
|
+
if (!n) return e;
|
|
863
|
+
let r = Object.assign({}, n, t.updates);
|
|
864
|
+
return {
|
|
888
865
|
...e,
|
|
889
|
-
[n.id]: Object.assign({},
|
|
890
|
-
}
|
|
866
|
+
[n.id]: Object.assign({}, r, { policies: Je(r.policies) })
|
|
867
|
+
};
|
|
891
868
|
}
|
|
892
869
|
});
|
|
893
870
|
function n(e) {
|
|
@@ -923,13 +900,13 @@ var nt = 0, rt = (e) => {
|
|
|
923
900
|
getByName: c
|
|
924
901
|
};
|
|
925
902
|
});
|
|
926
|
-
function
|
|
927
|
-
return
|
|
903
|
+
function Ze() {
|
|
904
|
+
return z(Xe);
|
|
928
905
|
}
|
|
929
906
|
//#endregion
|
|
930
907
|
//#region src/entities/step/step.ts
|
|
931
|
-
var
|
|
932
|
-
let e =
|
|
908
|
+
var Qe = N("step"), $e = R(() => {
|
|
909
|
+
let e = Qe.store({}), t = M(e, { register(e, t) {
|
|
933
910
|
return {
|
|
934
911
|
...e,
|
|
935
912
|
[t.step.id]: t.step
|
|
@@ -953,16 +930,16 @@ var st = M("step"), ct = L(() => {
|
|
|
953
930
|
indexStore: e
|
|
954
931
|
};
|
|
955
932
|
});
|
|
956
|
-
function
|
|
957
|
-
return
|
|
933
|
+
function et() {
|
|
934
|
+
return z($e);
|
|
958
935
|
}
|
|
959
|
-
function
|
|
936
|
+
function tt(e, t) {
|
|
960
937
|
t.register(e);
|
|
961
938
|
}
|
|
962
939
|
//#endregion
|
|
963
940
|
//#region src/entities/content/content.ts
|
|
964
|
-
var
|
|
965
|
-
let e =
|
|
941
|
+
var nt = N("content"), rt = R(() => {
|
|
942
|
+
let e = nt.store({}), t = M(e, {
|
|
966
943
|
register(e, t) {
|
|
967
944
|
return {
|
|
968
945
|
...e,
|
|
@@ -1003,16 +980,16 @@ var dt = M("content"), ft = L(() => {
|
|
|
1003
980
|
indexStore: e
|
|
1004
981
|
};
|
|
1005
982
|
});
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
983
|
+
function it() {
|
|
984
|
+
return z(rt);
|
|
1008
985
|
}
|
|
1009
|
-
function
|
|
986
|
+
function at(e, t) {
|
|
1010
987
|
t.register(e);
|
|
1011
988
|
}
|
|
1012
989
|
//#endregion
|
|
1013
990
|
//#region src/entities/action/action.ts
|
|
1014
|
-
var
|
|
1015
|
-
let t =
|
|
991
|
+
var ot = N("action"), st = R(({ client: e }) => {
|
|
992
|
+
let t = ot.store({}), n = M(t, { register(e, t) {
|
|
1016
993
|
return {
|
|
1017
994
|
...e,
|
|
1018
995
|
[t.key]: {
|
|
@@ -1020,13 +997,13 @@ var ht = M("action"), gt = L(({ client: e }) => {
|
|
|
1020
997
|
action: t.action
|
|
1021
998
|
}
|
|
1022
999
|
};
|
|
1023
|
-
} }), i =
|
|
1024
|
-
|
|
1000
|
+
} }), i = F();
|
|
1001
|
+
L({
|
|
1025
1002
|
clock: i,
|
|
1026
1003
|
source: t,
|
|
1027
1004
|
filter: (e, { key: t }) => e[t] !== void 0,
|
|
1028
1005
|
fn: (e, { key: t }) => `Action '${t}' already registered. Registering again will override the previous registration.`
|
|
1029
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
1006
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
1030
1007
|
clock: i,
|
|
1031
1008
|
fn: ({ key: e, action: t }) => Object.freeze({
|
|
1032
1009
|
key: e,
|
|
@@ -1039,7 +1016,7 @@ var ht = M("action"), gt = L(({ client: e }) => {
|
|
|
1039
1016
|
return t.map((t) => t[e]?.action, { skipVoid: !1 });
|
|
1040
1017
|
}
|
|
1041
1018
|
function s(t, n) {
|
|
1042
|
-
let r =
|
|
1019
|
+
let r = I(() => void 0, { skipVoid: !1 }), i = n ? { experience: n.experience } : null, a = A({
|
|
1043
1020
|
source: {
|
|
1044
1021
|
action: o(t),
|
|
1045
1022
|
snapshot: e.stateSnapshotStore
|
|
@@ -1051,13 +1028,13 @@ var ht = M("action"), gt = L(({ client: e }) => {
|
|
|
1051
1028
|
}, i);
|
|
1052
1029
|
}
|
|
1053
1030
|
});
|
|
1054
|
-
return
|
|
1031
|
+
return L({
|
|
1055
1032
|
source: {
|
|
1056
1033
|
responses: e.responses.listStore,
|
|
1057
1034
|
fields: e.fields.listStore
|
|
1058
1035
|
},
|
|
1059
1036
|
target: a
|
|
1060
|
-
}),
|
|
1037
|
+
}), L({
|
|
1061
1038
|
clock: a.doneData,
|
|
1062
1039
|
filter: (e) => e !== void 0,
|
|
1063
1040
|
target: r
|
|
@@ -1070,10 +1047,10 @@ var ht = M("action"), gt = L(({ client: e }) => {
|
|
|
1070
1047
|
getEvokableAction: s
|
|
1071
1048
|
};
|
|
1072
1049
|
});
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
1050
|
+
function ct(e) {
|
|
1051
|
+
return z(st, e);
|
|
1075
1052
|
}
|
|
1076
|
-
var
|
|
1053
|
+
var lt = (e, t, n) => {
|
|
1077
1054
|
n.register({
|
|
1078
1055
|
key: e,
|
|
1079
1056
|
action: t
|
|
@@ -1081,7 +1058,7 @@ var vt = (e, t, n) => {
|
|
|
1081
1058
|
};
|
|
1082
1059
|
//#endregion
|
|
1083
1060
|
//#region src/entities/response/response-validation.ts
|
|
1084
|
-
function
|
|
1061
|
+
function Y(e, t, n, r) {
|
|
1085
1062
|
return {
|
|
1086
1063
|
fieldKey: e.key,
|
|
1087
1064
|
userMessage: n,
|
|
@@ -1089,62 +1066,62 @@ function J(e, t, n, r) {
|
|
|
1089
1066
|
value: t
|
|
1090
1067
|
};
|
|
1091
1068
|
}
|
|
1092
|
-
function
|
|
1069
|
+
function X(e) {
|
|
1093
1070
|
return e === null || e === "" || Array.isArray(e) && !e.length;
|
|
1094
1071
|
}
|
|
1095
|
-
function
|
|
1072
|
+
function ut(e) {
|
|
1096
1073
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
|
|
1097
1074
|
}
|
|
1098
|
-
function
|
|
1075
|
+
function dt(e) {
|
|
1099
1076
|
try {
|
|
1100
1077
|
return JSON.stringify(e), !0;
|
|
1101
1078
|
} catch {
|
|
1102
1079
|
return !1;
|
|
1103
1080
|
}
|
|
1104
1081
|
}
|
|
1105
|
-
function
|
|
1082
|
+
function ft(e, t) {
|
|
1106
1083
|
return t.find((t) => t.key === e) ?? null;
|
|
1107
1084
|
}
|
|
1108
|
-
function
|
|
1085
|
+
function pt(e, t) {
|
|
1109
1086
|
return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
|
|
1110
1087
|
}
|
|
1111
|
-
function
|
|
1112
|
-
if (e.type !== "object" ||
|
|
1088
|
+
function mt(e, t) {
|
|
1089
|
+
if (e.type !== "object" || X(t)) return null;
|
|
1113
1090
|
if (e.multiple) {
|
|
1114
|
-
if (!Array.isArray(t)) return
|
|
1091
|
+
if (!Array.isArray(t)) return Y(e, t, "This field expects multiple values", "Field expects an array of objects.");
|
|
1115
1092
|
for (let n of t) {
|
|
1116
|
-
if (typeof n != "object" || !n) return
|
|
1117
|
-
if (!
|
|
1093
|
+
if (typeof n != "object" || !n) return Y(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
|
|
1094
|
+
if (!dt(n)) return Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1118
1095
|
}
|
|
1119
1096
|
return null;
|
|
1120
1097
|
}
|
|
1121
|
-
return Array.isArray(t) ?
|
|
1098
|
+
return Array.isArray(t) ? Y(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? Y(e, t, "This field expects an object value", "Field expects an object value.") : dt(t) ? null : Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1122
1099
|
}
|
|
1123
|
-
function
|
|
1124
|
-
if (
|
|
1100
|
+
function ht(e, t) {
|
|
1101
|
+
if (X(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
|
|
1125
1102
|
let n = Array.isArray(t) ? t : [t];
|
|
1126
1103
|
if (e.type === "object") {
|
|
1127
1104
|
let r = new Set(e.options.map((e) => JSON.stringify(e.value)));
|
|
1128
|
-
return n.every((e) => r.has(JSON.stringify(e))) ? null :
|
|
1105
|
+
return n.every((e) => r.has(JSON.stringify(e))) ? null : Y(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
|
|
1129
1106
|
}
|
|
1130
1107
|
let r = e.options.map((e) => e.value);
|
|
1131
|
-
return n.every((e) => !
|
|
1108
|
+
return n.every((e) => !ut(e) || e === null ? !1 : r.includes(e)) ? null : Y(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
|
|
1132
1109
|
}
|
|
1133
|
-
async function
|
|
1134
|
-
if (n.validation && !e(n.validation) && !
|
|
1110
|
+
async function gt(t, n, r, i) {
|
|
1111
|
+
if (n.validation && !e(n.validation) && !X(r)) {
|
|
1135
1112
|
let e = i ? {
|
|
1136
1113
|
$input: r,
|
|
1137
1114
|
responses: i
|
|
1138
1115
|
} : { $input: r }, a = await t(n.validation, e);
|
|
1139
|
-
if (typeof a == "string") return
|
|
1140
|
-
if (a === !1) return
|
|
1116
|
+
if (typeof a == "string") return Y(n, r, a, `Field validation resulted in an error: ${a}.`);
|
|
1117
|
+
if (a === !1) return Y(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
|
|
1141
1118
|
}
|
|
1142
|
-
return n.required &&
|
|
1119
|
+
return n.required && X(r) ? Y(n, r, "This field is required", "Field is required.") : !n.multiple && Array.isArray(r) && r.length > 1 ? Y(n, r, "This field expects a single response", "Field expects a single response.") : null;
|
|
1143
1120
|
}
|
|
1144
1121
|
//#endregion
|
|
1145
1122
|
//#region src/entities/response/response.ts
|
|
1146
|
-
var
|
|
1147
|
-
let t =
|
|
1123
|
+
var _t = N("response"), vt = R(({ client: e }) => {
|
|
1124
|
+
let t = _t.store({}), r = F(), i = F(), a = M(t, {
|
|
1148
1125
|
register(e, t) {
|
|
1149
1126
|
return {
|
|
1150
1127
|
...e,
|
|
@@ -1173,7 +1150,7 @@ var Et = M("response"), Dt = L(({ client: e }) => {
|
|
|
1173
1150
|
});
|
|
1174
1151
|
} else a.registerBatch(e);
|
|
1175
1152
|
}
|
|
1176
|
-
let s = (t, r) => n(e, t, r), c =
|
|
1153
|
+
let s = (t, r) => n(e, t, r), c = A({
|
|
1177
1154
|
source: {
|
|
1178
1155
|
allFields: e.fields.listStore,
|
|
1179
1156
|
existingResponses: t
|
|
@@ -1183,7 +1160,7 @@ var Et = M("response"), Dt = L(({ client: e }) => {
|
|
|
1183
1160
|
...t,
|
|
1184
1161
|
...n
|
|
1185
1162
|
}, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
|
|
1186
|
-
let o =
|
|
1163
|
+
let o = ft(t, e);
|
|
1187
1164
|
if (!o) {
|
|
1188
1165
|
r.push({
|
|
1189
1166
|
fieldKey: t,
|
|
@@ -1193,17 +1170,17 @@ var Et = M("response"), Dt = L(({ client: e }) => {
|
|
|
1193
1170
|
});
|
|
1194
1171
|
return;
|
|
1195
1172
|
}
|
|
1196
|
-
let c =
|
|
1173
|
+
let c = pt(o, n), l = await gt(s, o, c, a);
|
|
1197
1174
|
if (l) {
|
|
1198
1175
|
r.push(l);
|
|
1199
1176
|
return;
|
|
1200
1177
|
}
|
|
1201
|
-
let u =
|
|
1178
|
+
let u = mt(o, c);
|
|
1202
1179
|
if (u) {
|
|
1203
1180
|
r.push(u);
|
|
1204
1181
|
return;
|
|
1205
1182
|
}
|
|
1206
|
-
let d =
|
|
1183
|
+
let d = ht(o, c);
|
|
1207
1184
|
if (d) {
|
|
1208
1185
|
r.push(d);
|
|
1209
1186
|
return;
|
|
@@ -1231,7 +1208,7 @@ var Et = M("response"), Dt = L(({ client: e }) => {
|
|
|
1231
1208
|
async function l(e) {
|
|
1232
1209
|
return c(e);
|
|
1233
1210
|
}
|
|
1234
|
-
let u =
|
|
1211
|
+
let u = A({
|
|
1235
1212
|
source: t,
|
|
1236
1213
|
effect: async (e, t) => {
|
|
1237
1214
|
let { responsesToCommit: n, validationErrors: r } = await c(t);
|
|
@@ -1246,7 +1223,7 @@ var Et = M("response"), Dt = L(({ client: e }) => {
|
|
|
1246
1223
|
value: t
|
|
1247
1224
|
})));
|
|
1248
1225
|
function m(e) {
|
|
1249
|
-
return
|
|
1226
|
+
return j({
|
|
1250
1227
|
f: e,
|
|
1251
1228
|
s: t
|
|
1252
1229
|
}, ({ f: e, s: t }) => {
|
|
@@ -1263,10 +1240,10 @@ var Et = M("response"), Dt = L(({ client: e }) => {
|
|
|
1263
1240
|
function _(t) {
|
|
1264
1241
|
return m(e.fields.getByName(t));
|
|
1265
1242
|
}
|
|
1266
|
-
return
|
|
1243
|
+
return L({
|
|
1267
1244
|
clock: r,
|
|
1268
1245
|
target: a.clearAll
|
|
1269
|
-
}),
|
|
1246
|
+
}), L({
|
|
1270
1247
|
clock: i,
|
|
1271
1248
|
target: a.clear
|
|
1272
1249
|
}), {
|
|
@@ -1282,13 +1259,13 @@ var Et = M("response"), Dt = L(({ client: e }) => {
|
|
|
1282
1259
|
getByFieldName: _
|
|
1283
1260
|
};
|
|
1284
1261
|
});
|
|
1285
|
-
function
|
|
1286
|
-
return
|
|
1262
|
+
function yt(e) {
|
|
1263
|
+
return z(vt, e);
|
|
1287
1264
|
}
|
|
1288
1265
|
//#endregion
|
|
1289
1266
|
//#region src/entities/condition/condition.ts
|
|
1290
|
-
var
|
|
1291
|
-
let e =
|
|
1267
|
+
var bt = N("condition"), xt = R(() => {
|
|
1268
|
+
let e = bt.store({}), t = M(e, { register(e, t) {
|
|
1292
1269
|
return {
|
|
1293
1270
|
...e,
|
|
1294
1271
|
[t.condition.id]: t.condition
|
|
@@ -1312,12 +1289,12 @@ var kt = M("condition"), At = L(() => {
|
|
|
1312
1289
|
indexStore: e
|
|
1313
1290
|
};
|
|
1314
1291
|
});
|
|
1315
|
-
function
|
|
1316
|
-
return
|
|
1292
|
+
function St() {
|
|
1293
|
+
return z(xt);
|
|
1317
1294
|
}
|
|
1318
1295
|
//#endregion
|
|
1319
1296
|
//#region src/utils/api-url.ts
|
|
1320
|
-
function
|
|
1297
|
+
function Ct() {
|
|
1321
1298
|
if (c()) {
|
|
1322
1299
|
let e = [
|
|
1323
1300
|
document.currentScript,
|
|
@@ -1332,7 +1309,7 @@ function Mt() {
|
|
|
1332
1309
|
}
|
|
1333
1310
|
//#endregion
|
|
1334
1311
|
//#region src/utils/search-params.ts
|
|
1335
|
-
function
|
|
1312
|
+
function wt() {
|
|
1336
1313
|
if (!s()) return {};
|
|
1337
1314
|
let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
|
|
1338
1315
|
for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
|
|
@@ -1340,23 +1317,64 @@ function Nt() {
|
|
|
1340
1317
|
let n = r.replace("picked-", "");
|
|
1341
1318
|
t[n] = e.getAll(r);
|
|
1342
1319
|
}
|
|
1343
|
-
let r =
|
|
1344
|
-
if (n.size > 0)
|
|
1320
|
+
let r = k("s");
|
|
1321
|
+
if (n.size > 0) O.set(r, t);
|
|
1345
1322
|
else {
|
|
1346
|
-
let e =
|
|
1323
|
+
let e = O.get(r);
|
|
1347
1324
|
if (e) return e.json() || {};
|
|
1348
1325
|
}
|
|
1349
1326
|
return t;
|
|
1350
1327
|
}
|
|
1351
1328
|
//#endregion
|
|
1329
|
+
//#region src/utils/user-timing.ts
|
|
1330
|
+
var Tt = "picked:start:begin", Et = "picked:start";
|
|
1331
|
+
function Dt() {
|
|
1332
|
+
try {
|
|
1333
|
+
return s() && !!p.window && "performance" in p;
|
|
1334
|
+
} catch {
|
|
1335
|
+
return !1;
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
function Ot() {
|
|
1339
|
+
let e = null, t = null;
|
|
1340
|
+
return {
|
|
1341
|
+
markBegin: () => {
|
|
1342
|
+
if (Dt()) try {
|
|
1343
|
+
e = performance.mark(Tt).startTime;
|
|
1344
|
+
} catch {}
|
|
1345
|
+
},
|
|
1346
|
+
measure: () => {
|
|
1347
|
+
if (!(!Dt() || e === null)) try {
|
|
1348
|
+
t = performance.measure(Et, { start: e });
|
|
1349
|
+
} catch {}
|
|
1350
|
+
},
|
|
1351
|
+
get startMeasure() {
|
|
1352
|
+
return t;
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
//#endregion
|
|
1357
|
+
//#region src/utils/client-telemetry.ts
|
|
1358
|
+
function kt() {
|
|
1359
|
+
let e = null;
|
|
1360
|
+
return {
|
|
1361
|
+
observeDeliveryAPIRequests: (t) => {
|
|
1362
|
+
e = t;
|
|
1363
|
+
},
|
|
1364
|
+
get deliveryAPIRequestObserver() {
|
|
1365
|
+
return e;
|
|
1366
|
+
}
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
//#endregion
|
|
1352
1370
|
//#region src/entities/session/session.ts
|
|
1353
|
-
var
|
|
1354
|
-
function
|
|
1371
|
+
var At = k("session", "global");
|
|
1372
|
+
function jt() {
|
|
1355
1373
|
return m() ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}`;
|
|
1356
1374
|
}
|
|
1357
|
-
function
|
|
1375
|
+
function Mt() {
|
|
1358
1376
|
if (!h()) return null;
|
|
1359
|
-
let e =
|
|
1377
|
+
let e = D.get(At);
|
|
1360
1378
|
if (!e.isSet()) return null;
|
|
1361
1379
|
try {
|
|
1362
1380
|
return e.json();
|
|
@@ -1364,10 +1382,10 @@ function It() {
|
|
|
1364
1382
|
return null;
|
|
1365
1383
|
}
|
|
1366
1384
|
}
|
|
1367
|
-
var
|
|
1368
|
-
let e =
|
|
1385
|
+
var Nt = R(() => {
|
|
1386
|
+
let e = Mt(), t = { id: e?.id ?? jt() };
|
|
1369
1387
|
e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
|
|
1370
|
-
let n =
|
|
1388
|
+
let n = I(t), r = M(n, {
|
|
1371
1389
|
setIsUser: (e, t) => ({
|
|
1372
1390
|
...e,
|
|
1373
1391
|
isUser: t
|
|
@@ -1387,15 +1405,15 @@ var Lt = L(() => {
|
|
|
1387
1405
|
let i = { id: e.id };
|
|
1388
1406
|
return e.isUser !== void 0 && (i.isUser = e.isUser), Object.keys(r).length > 0 && (i.identifiers = r), i;
|
|
1389
1407
|
}
|
|
1390
|
-
}), i =
|
|
1408
|
+
}), i = A({
|
|
1391
1409
|
source: n,
|
|
1392
1410
|
effect: (e) => {
|
|
1393
1411
|
if (h()) try {
|
|
1394
|
-
|
|
1412
|
+
D.get(At).set(e);
|
|
1395
1413
|
} catch {}
|
|
1396
1414
|
}
|
|
1397
1415
|
});
|
|
1398
|
-
return
|
|
1416
|
+
return L({
|
|
1399
1417
|
source: n,
|
|
1400
1418
|
target: i
|
|
1401
1419
|
}), {
|
|
@@ -1405,39 +1423,39 @@ var Lt = L(() => {
|
|
|
1405
1423
|
removeIdentifier: r.removeIdentifier
|
|
1406
1424
|
};
|
|
1407
1425
|
});
|
|
1408
|
-
function
|
|
1409
|
-
return
|
|
1426
|
+
function Pt() {
|
|
1427
|
+
return z(Nt, void 0);
|
|
1410
1428
|
}
|
|
1411
1429
|
//#endregion
|
|
1412
1430
|
//#region src/utils/picked-config.ts
|
|
1413
|
-
function
|
|
1431
|
+
function Ft() {
|
|
1414
1432
|
if (s()) return globalThis.window.pickedConfig;
|
|
1415
1433
|
}
|
|
1416
|
-
function
|
|
1417
|
-
if (s()) return
|
|
1434
|
+
function It() {
|
|
1435
|
+
if (s()) return Ft()?.projectId;
|
|
1418
1436
|
}
|
|
1419
|
-
function
|
|
1437
|
+
function Lt() {
|
|
1420
1438
|
if (!c()) return;
|
|
1421
1439
|
let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
|
|
1422
1440
|
if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
|
|
1423
1441
|
}
|
|
1424
|
-
function
|
|
1442
|
+
function Rt(e) {
|
|
1425
1443
|
if (e.projectId) return e.projectId;
|
|
1426
|
-
let t =
|
|
1444
|
+
let t = It();
|
|
1427
1445
|
if (t) return t;
|
|
1428
|
-
let n =
|
|
1446
|
+
let n = Lt();
|
|
1429
1447
|
if (n) return n;
|
|
1430
1448
|
throw Error("projectId is required. You can provide it via one of:\n (1) createClient({ projectId }) options;\n (2) window.pickedConfig = { projectId };\n (3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes a data-projectid (or project-id) attribute.");
|
|
1431
1449
|
}
|
|
1432
1450
|
//#endregion
|
|
1433
1451
|
//#region src/utils/render-string.ts
|
|
1434
|
-
function
|
|
1452
|
+
function Z(e) {
|
|
1435
1453
|
return e == null || e === "" || Number.isNaN(e);
|
|
1436
1454
|
}
|
|
1437
|
-
var
|
|
1438
|
-
default: (e, t) =>
|
|
1439
|
-
append: (e, t) => t && !
|
|
1440
|
-
prepend: (e, t) => t && !
|
|
1455
|
+
var zt = {
|
|
1456
|
+
default: (e, t) => Z(e) ? String(t ?? "") : String(e),
|
|
1457
|
+
append: (e, t) => t && !Z(e) ? `${e} ${t}` : e,
|
|
1458
|
+
prepend: (e, t) => t && !Z(e) ? `${t} ${e}` : e,
|
|
1441
1459
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
1442
1460
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
|
|
1443
1461
|
capitalize: (e) => typeof e == "string" ? e.charAt(0).toUpperCase() + e.slice(1) : e,
|
|
@@ -1455,24 +1473,24 @@ var Ut = {
|
|
|
1455
1473
|
return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
|
|
1456
1474
|
}
|
|
1457
1475
|
};
|
|
1458
|
-
function
|
|
1476
|
+
function Bt(e) {
|
|
1459
1477
|
return typeof e == "object" && !!e;
|
|
1460
1478
|
}
|
|
1461
|
-
function
|
|
1479
|
+
function Vt(e, t) {
|
|
1462
1480
|
let n = t;
|
|
1463
|
-
for (let t of e.split(".")) if (
|
|
1481
|
+
for (let t of e.split(".")) if (Bt(n) && t in n) n = n[t];
|
|
1464
1482
|
else return;
|
|
1465
1483
|
return typeof n == "function" ? n() : n;
|
|
1466
1484
|
}
|
|
1467
|
-
function
|
|
1468
|
-
let n = e.split("|").map((e) => e.trim()), r =
|
|
1485
|
+
function Ht(e, t) {
|
|
1486
|
+
let n = e.split("|").map((e) => e.trim()), r = Vt(n.shift() ?? "", t);
|
|
1469
1487
|
for (let e of n) {
|
|
1470
|
-
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o =
|
|
1488
|
+
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = zt[i];
|
|
1471
1489
|
o && (r = o(r, a));
|
|
1472
1490
|
}
|
|
1473
|
-
return
|
|
1491
|
+
return Z(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
|
|
1474
1492
|
}
|
|
1475
|
-
function
|
|
1493
|
+
function Ut(e, t) {
|
|
1476
1494
|
let n = "", r = 0;
|
|
1477
1495
|
for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
|
|
1478
1496
|
r += 2;
|
|
@@ -1484,19 +1502,19 @@ function qt(e, t) {
|
|
|
1484
1502
|
}
|
|
1485
1503
|
i += e[r++];
|
|
1486
1504
|
}
|
|
1487
|
-
n +=
|
|
1505
|
+
n += Ht(i.trim(), t);
|
|
1488
1506
|
} else n += e[r++];
|
|
1489
1507
|
return n;
|
|
1490
1508
|
}
|
|
1491
1509
|
//#endregion
|
|
1492
1510
|
//#region src/utils/preview-session.ts
|
|
1493
|
-
var
|
|
1494
|
-
function
|
|
1495
|
-
return !s() || !g() ? !1 : !!
|
|
1511
|
+
var Wt = "preview-token";
|
|
1512
|
+
function Gt() {
|
|
1513
|
+
return !s() || !g() ? !1 : !!wt()[Wt]?.[0];
|
|
1496
1514
|
}
|
|
1497
1515
|
//#endregion
|
|
1498
1516
|
//#region src/picked.ts
|
|
1499
|
-
var
|
|
1517
|
+
var Kt = class {
|
|
1500
1518
|
static logger = r;
|
|
1501
1519
|
options;
|
|
1502
1520
|
dataSource = null;
|
|
@@ -1505,63 +1523,63 @@ var Xt = class {
|
|
|
1505
1523
|
contentLoader;
|
|
1506
1524
|
previewEmbedderOrigins = null;
|
|
1507
1525
|
plugins = {};
|
|
1508
|
-
|
|
1509
|
-
return Object.keys(this.plugins);
|
|
1510
|
-
}
|
|
1526
|
+
telemetry = kt();
|
|
1511
1527
|
dataProviders = /* @__PURE__ */ new Map();
|
|
1512
|
-
eventBus =
|
|
1528
|
+
eventBus = F();
|
|
1513
1529
|
events;
|
|
1514
1530
|
projectId;
|
|
1515
1531
|
apiUrl;
|
|
1516
1532
|
dashboardUrl;
|
|
1517
1533
|
documentationSiteUrl;
|
|
1518
|
-
session =
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1534
|
+
session = Pt();
|
|
1535
|
+
performance = Ot();
|
|
1536
|
+
searchParams = wt();
|
|
1537
|
+
history = Ge();
|
|
1538
|
+
components = xe({ client: this });
|
|
1522
1539
|
experienceInstances = C({ client: this });
|
|
1523
|
-
experiences =
|
|
1524
|
-
frameworks =
|
|
1525
|
-
predicates =
|
|
1526
|
-
features =
|
|
1527
|
-
conditions =
|
|
1528
|
-
fields =
|
|
1529
|
-
responses =
|
|
1530
|
-
steps =
|
|
1531
|
-
contents =
|
|
1532
|
-
actions =
|
|
1540
|
+
experiences = pe({ client: this });
|
|
1541
|
+
frameworks = Te({ client: this });
|
|
1542
|
+
predicates = Ve({ client: this });
|
|
1543
|
+
features = ne({ client: this });
|
|
1544
|
+
conditions = St();
|
|
1545
|
+
fields = Ze();
|
|
1546
|
+
responses = yt({ client: this });
|
|
1547
|
+
steps = et();
|
|
1548
|
+
contents = it();
|
|
1549
|
+
actions = ct({ client: this });
|
|
1533
1550
|
conditionResults = w();
|
|
1534
|
-
stateSnapshotStore =
|
|
1535
|
-
evaluateRuleLogicFx =
|
|
1551
|
+
stateSnapshotStore = Oe({ client: this });
|
|
1552
|
+
evaluateRuleLogicFx = Ie({ client: this });
|
|
1536
1553
|
start;
|
|
1537
1554
|
readyStore;
|
|
1538
1555
|
preconditionPassedStore;
|
|
1539
1556
|
conditionPassedStore;
|
|
1540
1557
|
lifecycleStageStore;
|
|
1541
|
-
lifecycle =
|
|
1542
|
-
renderStringFx =
|
|
1558
|
+
lifecycle = Re({ client: this });
|
|
1559
|
+
renderStringFx = A({
|
|
1543
1560
|
source: this.responses.listStore,
|
|
1544
1561
|
effect: (e, { template: t, context: n }) => {
|
|
1545
1562
|
let r = {};
|
|
1546
1563
|
for (let t of e) r[t.fieldKey] = t.value;
|
|
1547
|
-
return
|
|
1564
|
+
return Ut(t, {
|
|
1548
1565
|
...n,
|
|
1549
1566
|
responses: r
|
|
1550
1567
|
});
|
|
1551
1568
|
}
|
|
1552
1569
|
});
|
|
1553
1570
|
constructor(e) {
|
|
1554
|
-
this.events =
|
|
1571
|
+
this.events = qe(this.eventBus), this.projectId = Rt(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Ct(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupFields(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
|
|
1555
1572
|
type: "load",
|
|
1556
|
-
version:
|
|
1573
|
+
version: ie()
|
|
1557
1574
|
}), this.maybeStartPreviewChannel();
|
|
1558
1575
|
}
|
|
1559
1576
|
dataProviderFor(e) {
|
|
1560
1577
|
let t = e ?? "", n = this.dataProviders.get(t);
|
|
1561
1578
|
if (n) return n;
|
|
1562
|
-
let r = import("../provider-
|
|
1579
|
+
let r = import("../provider-ovM-CBX_.js").then((t) => t.createPickedDataProvider({
|
|
1563
1580
|
apiUrl: this.apiUrl,
|
|
1564
1581
|
projectId: this.projectId,
|
|
1582
|
+
getRequestObserver: () => this.telemetry.deliveryAPIRequestObserver,
|
|
1565
1583
|
...e !== void 0 && { previewToken: e }
|
|
1566
1584
|
}));
|
|
1567
1585
|
return this.dataProviders.set(t, r), r;
|
|
@@ -1575,24 +1593,24 @@ var Xt = class {
|
|
|
1575
1593
|
return (await this.dataProviderFor(t?.previewToken)).getContent(e, t?.signal === void 0 ? void 0 : { signal: t.signal });
|
|
1576
1594
|
}
|
|
1577
1595
|
maybeStartPreviewChannel() {
|
|
1578
|
-
|
|
1596
|
+
Gt() && import("../preview-channel-CSr96XAo.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
|
|
1579
1597
|
}
|
|
1580
1598
|
registerFramework = (e) => {
|
|
1581
|
-
|
|
1599
|
+
Ee(e, this.frameworks);
|
|
1582
1600
|
};
|
|
1583
1601
|
registerComponent = (e, t) => {
|
|
1584
|
-
|
|
1602
|
+
Se(e, t, this.components);
|
|
1585
1603
|
};
|
|
1586
1604
|
registerPlugin = (e) => {
|
|
1587
|
-
|
|
1605
|
+
ge(this, e, this.plugins);
|
|
1588
1606
|
let t = this.plugins[e.name];
|
|
1589
1607
|
t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
|
|
1590
1608
|
};
|
|
1591
1609
|
registerFeature = (e, t) => {
|
|
1592
|
-
|
|
1610
|
+
te(e, t, this.features);
|
|
1593
1611
|
};
|
|
1594
1612
|
registerPredicate = (e, t) => {
|
|
1595
|
-
|
|
1613
|
+
He(e, t, this.predicates);
|
|
1596
1614
|
};
|
|
1597
1615
|
registerCondition = (e) => {
|
|
1598
1616
|
this.conditions.register(e);
|
|
@@ -1601,19 +1619,19 @@ var Xt = class {
|
|
|
1601
1619
|
this.fields.register(e);
|
|
1602
1620
|
};
|
|
1603
1621
|
registerStep = (e) => {
|
|
1604
|
-
|
|
1622
|
+
tt(e, this.steps);
|
|
1605
1623
|
};
|
|
1606
1624
|
registerContent = (e) => {
|
|
1607
|
-
|
|
1625
|
+
at(e, this.contents);
|
|
1608
1626
|
};
|
|
1609
1627
|
patchContent = (e, t) => {
|
|
1610
1628
|
this.contents.patch(e, t);
|
|
1611
1629
|
};
|
|
1612
1630
|
registerAction = (e, t) => {
|
|
1613
|
-
|
|
1631
|
+
lt(e, t, this.actions);
|
|
1614
1632
|
};
|
|
1615
1633
|
registerExperience = (e) => {
|
|
1616
|
-
e.component &&
|
|
1634
|
+
e.component && Se(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
|
|
1617
1635
|
};
|
|
1618
1636
|
launchExperienceById = async (e, t) => {
|
|
1619
1637
|
this.experiences.launch({
|
|
@@ -1656,12 +1674,13 @@ var Xt = class {
|
|
|
1656
1674
|
this.registerFeature(e, n);
|
|
1657
1675
|
}), this.searchParams.feature && this.searchParams.feature.forEach((e) => {
|
|
1658
1676
|
try {
|
|
1659
|
-
let t =
|
|
1677
|
+
let t = re(e);
|
|
1660
1678
|
if (!t) return;
|
|
1661
1679
|
let { id: n, bucket: r } = t;
|
|
1662
1680
|
this.registerFeature(n, {
|
|
1663
1681
|
key: `${r}`,
|
|
1664
1682
|
name: n,
|
|
1683
|
+
enabled: !0,
|
|
1665
1684
|
decide: () => r,
|
|
1666
1685
|
storage: "session"
|
|
1667
1686
|
});
|
|
@@ -1688,6 +1707,16 @@ var Xt = class {
|
|
|
1688
1707
|
this.registerAction(e, t);
|
|
1689
1708
|
});
|
|
1690
1709
|
}
|
|
1710
|
+
setupFields() {
|
|
1711
|
+
let e = this.options.fields;
|
|
1712
|
+
e && Object.entries(e).forEach(([e, t]) => {
|
|
1713
|
+
let n = typeof t == "function" ? t() : t;
|
|
1714
|
+
this.registerField({
|
|
1715
|
+
...n,
|
|
1716
|
+
key: n.key ?? e
|
|
1717
|
+
});
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1691
1720
|
setupComponents() {
|
|
1692
1721
|
let e = this.options.components;
|
|
1693
1722
|
e && Object.entries(e).forEach(([e, t]) => {
|
|
@@ -1695,8 +1724,8 @@ var Xt = class {
|
|
|
1695
1724
|
});
|
|
1696
1725
|
}
|
|
1697
1726
|
getPluginConfig = (e) => this.plugins[e] ?? {};
|
|
1698
|
-
},
|
|
1699
|
-
async function
|
|
1727
|
+
}, qt = "application/picked-javascript", Jt = "application/picked-module", Yt = "data-picked-hydrated";
|
|
1728
|
+
async function Xt(e) {
|
|
1700
1729
|
if (!("document" in globalThis)) return;
|
|
1701
1730
|
let t = "application/picked-module", n = "data-picked-hydrated";
|
|
1702
1731
|
function r(e) {
|
|
@@ -1725,42 +1754,42 @@ async function en(e) {
|
|
|
1725
1754
|
a && await a;
|
|
1726
1755
|
}
|
|
1727
1756
|
}
|
|
1728
|
-
function
|
|
1729
|
-
return `<script>(${
|
|
1757
|
+
function Zt() {
|
|
1758
|
+
return `<script>(${Xt.toString()})(document)<\/script>`;
|
|
1730
1759
|
}
|
|
1731
1760
|
//#endregion
|
|
1732
1761
|
//#region src/utils/html-asset-value.ts
|
|
1733
|
-
function
|
|
1762
|
+
function Qt(e) {
|
|
1734
1763
|
return typeof e == "object" && !!e && "id" in e && typeof e.id == "string" && "content" in e && (typeof e.content == "string" || e.content === null);
|
|
1735
1764
|
}
|
|
1736
1765
|
//#endregion
|
|
1737
1766
|
//#region src/entities/component/lazyComponent.ts
|
|
1738
|
-
function
|
|
1767
|
+
function $t(e) {
|
|
1739
1768
|
return {
|
|
1740
1769
|
$$type: "lazy-component",
|
|
1741
1770
|
load: e
|
|
1742
1771
|
};
|
|
1743
1772
|
}
|
|
1744
|
-
function
|
|
1773
|
+
function en(e) {
|
|
1745
1774
|
return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
|
|
1746
1775
|
}
|
|
1747
1776
|
//#endregion
|
|
1748
1777
|
//#region src/entities/content/reference.ts
|
|
1749
|
-
function Z(e) {
|
|
1750
|
-
return typeof e == "object" && !!e && !Array.isArray(e) && "contentEntryId" in e && typeof e.contentEntryId == "string";
|
|
1751
|
-
}
|
|
1752
1778
|
function Q(e) {
|
|
1753
|
-
return
|
|
1779
|
+
return typeof e == "object" && !!e && !Array.isArray(e) && "contentEntryId" in e && typeof e.contentEntryId == "string";
|
|
1754
1780
|
}
|
|
1755
1781
|
function $(e) {
|
|
1782
|
+
return Q(e) ? e.contentEntryId : null;
|
|
1783
|
+
}
|
|
1784
|
+
function tn(e) {
|
|
1756
1785
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
1757
|
-
for (let e of t)
|
|
1786
|
+
for (let e of t) Q(e) && n.push(e.contentEntryId);
|
|
1758
1787
|
return n;
|
|
1759
1788
|
}
|
|
1760
|
-
function
|
|
1789
|
+
function nn(e, t) {
|
|
1761
1790
|
return t === null ? null : e[t] ?? null;
|
|
1762
1791
|
}
|
|
1763
|
-
function
|
|
1792
|
+
function rn(e, t) {
|
|
1764
1793
|
let n = [];
|
|
1765
1794
|
for (let r of t) {
|
|
1766
1795
|
let t = e[r];
|
|
@@ -1768,29 +1797,29 @@ function sn(e, t) {
|
|
|
1768
1797
|
}
|
|
1769
1798
|
return n;
|
|
1770
1799
|
}
|
|
1771
|
-
function
|
|
1772
|
-
if (
|
|
1773
|
-
let n = Q(t);
|
|
1774
|
-
return e.indexStore.map((e) => on(e, n), { skipVoid: !1 });
|
|
1775
|
-
}
|
|
1776
|
-
function ln(e, t) {
|
|
1777
|
-
if (ue.store(t)) return A(t, e.indexStore, (e, t) => sn(t, $(e)));
|
|
1800
|
+
function an(e, t) {
|
|
1801
|
+
if (le.store(t)) return j(t, e.indexStore, (e, t) => nn(t, $(e)));
|
|
1778
1802
|
let n = $(t);
|
|
1779
|
-
return e.indexStore.map((e) =>
|
|
1803
|
+
return e.indexStore.map((e) => nn(e, n), { skipVoid: !1 });
|
|
1804
|
+
}
|
|
1805
|
+
function on(e, t) {
|
|
1806
|
+
if (le.store(t)) return j(t, e.indexStore, (e, t) => rn(t, tn(e)));
|
|
1807
|
+
let n = tn(t);
|
|
1808
|
+
return e.indexStore.map((e) => rn(e, n), { skipVoid: !1 });
|
|
1780
1809
|
}
|
|
1781
1810
|
//#endregion
|
|
1782
1811
|
//#region src/exports.ts
|
|
1783
|
-
var
|
|
1784
|
-
let t = new
|
|
1812
|
+
var sn = (e) => {
|
|
1813
|
+
let t = new Kt(e);
|
|
1785
1814
|
return u(t), t;
|
|
1786
1815
|
};
|
|
1787
1816
|
//#endregion
|
|
1788
1817
|
//#region src/typed-content.ts
|
|
1789
|
-
function
|
|
1818
|
+
function cn(e) {
|
|
1790
1819
|
return typeof e.data == "object";
|
|
1791
1820
|
}
|
|
1792
|
-
function
|
|
1793
|
-
return e.map((e) => !e || !
|
|
1821
|
+
function ln(e) {
|
|
1822
|
+
return e.map((e) => !e || !cn(e) ? null : e, { skipVoid: !1 });
|
|
1794
1823
|
}
|
|
1795
1824
|
//#endregion
|
|
1796
|
-
export {
|
|
1825
|
+
export { Yt as PICKED_HYDRATED_ATTR, Jt as PICKED_MODULE_SCRIPT_TYPE, qt as PICKED_SCRIPT_TYPE, Wt as PREVIEW_TOKEN_PARAM, Kt as Picked, Zt as buildRehydrateBootstrap, sn as createClient, he as createPluginEffect, k as createStorageKey, an as deriveReference, on as deriveReferences, n as evaluateRuleLogic, Ft as getPickedConfig, Q as isContentReference, Qt as isHtmlAssetValue, g as isInsideIframe, en as isLazyLoader, v as isPickedRoot, Gt as isPreviewSession, $t as lazyComponent, D as localStore, ce as onInertScriptSubtrees, $ as readReferenceId, tn as readReferenceIds, Xt as rehydrateScripts, oe as reportInertScriptSubtrees, se as resetInertScriptReport, O as sessionStore, E as subscribe, d as supportsCookies, m as supportsCryptoRandomUUID, c as supportsDocument, i as supportsHistory, f as supportsIntersectionObserver, h as supportsLocalStorage, a as supportsLocation, l as supportsSessionStorage, _ as supportsShadowRoot, o as supportsWebComponents, s as supportsWindow, ln as toTypedContentStore };
|