@picked/client 0.0.1-dev.1778730134956 → 0.0.1-dev.1780458499348
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/{api-B-CbCRqb.js → api-BTAT4D4u.js} +1 -1
- package/dist/{api-CPRRXVw6.cjs → api-DQiViS84.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dom-observer/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/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/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/image-optimisation-service.md +6 -6
- package/dist/docs/sdk/content-security-policy.md +8 -7
- package/dist/docs/sdk/fields.md +2 -2
- package/dist/{dom-DGePXPpM.js → dom-DjfSrkpp.js} +7 -7
- package/dist/{dom-C3C6Fmwz.cjs → dom-sqnnO-CT.cjs} +1 -1
- package/dist/esm/index.js +322 -331
- package/dist/esm/plugins/dom-observer/index.js +2 -2
- package/dist/esm/plugins/dynamic-experiences/index.js +3 -234
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-indexeddb/index.js +1 -1
- package/dist/esm/plugins/single-page-app/index.js +14 -14
- package/dist/esm/plugins/web-components/index.js +2 -2
- package/dist/esm/plugins/window-object/index.js +1 -1
- package/dist/esm/server/index.js +84 -51
- package/dist/experience-instance-B2Xb6TAm.cjs +1 -0
- package/dist/{experience-instance-BOhvCj_F.js → experience-instance-Brph8SaR.js} +155 -73
- package/dist/plugin-CVaiEzy8.cjs +1 -0
- package/dist/plugin-DozhuiMM.js +240 -0
- package/dist/preview-bridge-CGyx7dEx.js +33 -0
- package/dist/preview-bridge-DIdDvNXQ.cjs +1 -0
- package/dist/supports-34OzZK5j.cjs +1 -0
- package/dist/{supports-0XIfd4-R.js → supports-BgjwyijI.js} +11 -4
- package/dist/types/entities/experience-instance/experience-instance.d.ts +0 -12
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +0 -3
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +0 -1
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/lifecycle/condition-selection.d.ts +98 -0
- package/dist/types/lifecycle/condition-selection.d.ts.map +1 -0
- package/dist/types/lifecycle/lifecycle.d.ts.map +1 -1
- package/dist/types/picked.d.ts +19 -4
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +23 -0
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +5 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/preview-bridge/index.d.ts +14 -0
- package/dist/types/preview-bridge/index.d.ts.map +1 -0
- package/dist/types/server/index.d.ts +8 -0
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/server/serialize.d.ts +67 -0
- package/dist/types/server/serialize.d.ts.map +1 -0
- package/dist/types/utils/supports.d.ts +85 -0
- package/dist/types/utils/supports.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/experience-instance-D8yKenBU.cjs +0 -1
- package/dist/supports-Dsjg-82e.cjs +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as e } from "../object-DvUDOytC.js";
|
|
2
2
|
import { n as t, t as n } from "../rules-logic-D_CVBuv7.js";
|
|
3
3
|
import { t as r } from "../logger-6z_gb4rA.js";
|
|
4
|
-
import { a as i, c as a, d as o,
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
import { i as
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
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, r as p, s as m, t as h, u as g } from "../supports-BgjwyijI.js";
|
|
5
|
+
import { a as _, i as v, r as ee, s as y, t as b } from "../dom-DjfSrkpp.js";
|
|
6
|
+
import { c as x, n as S, r as C, s as w } from "../experience-instance-Brph8SaR.js";
|
|
7
|
+
import { i as T, n as E, r as D, t as O } from "../storage-hOHCCXvP.js";
|
|
8
|
+
import { n as te, r as ne } from "../api-BTAT4D4u.js";
|
|
9
|
+
import { t as re } from "../id-n2yrHvNo.js";
|
|
10
10
|
import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, sample as I } from "effector";
|
|
11
11
|
import { createFactory as L, invoke as R } from "@withease/factories";
|
|
12
12
|
//#region src/entities/experience/experience.ts
|
|
13
|
-
var z = M("experience"),
|
|
13
|
+
var z = M("experience"), ie = L(({ client: e, experience: r }) => {
|
|
14
14
|
let i = z.store(r), a = j(i, { merge(e, t) {
|
|
15
15
|
return {
|
|
16
16
|
...e,
|
|
@@ -22,7 +22,7 @@ var z = M("experience"), ne = L(({ client: e, experience: r }) => {
|
|
|
22
22
|
targetSelectors: e.targets,
|
|
23
23
|
initializeOpenLogic: e.initializeOpen
|
|
24
24
|
})), s = A(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 = A(i, e.steps.indexStore, e.conditions.indexStore, (e, t, n) => {
|
|
25
|
-
let r = e.nodes.filter(x).map((e) => t[e.stepId]).filter((e) => e !== void 0), i = e.nodes.filter(
|
|
25
|
+
let r = e.nodes.filter(x).map((e) => t[e.stepId]).filter((e) => e !== void 0), i = e.nodes.filter(w).map((e) => n[e.conditionId]).filter((e) => e !== void 0);
|
|
26
26
|
return {
|
|
27
27
|
steps: r,
|
|
28
28
|
nodes: e.nodes,
|
|
@@ -32,7 +32,7 @@ var z = M("experience"), ne = L(({ client: e, experience: r }) => {
|
|
|
32
32
|
}), l = r.actions ?? [], u, d = k({
|
|
33
33
|
source: o,
|
|
34
34
|
effect: (t, n) => {
|
|
35
|
-
let i =
|
|
35
|
+
let i = v(t.targetSelectors, r.id);
|
|
36
36
|
i.forEach(({ elements: e }) => e.forEach((e) => y(e, r.id))), b(i, r.id, r.key).forEach((t) => {
|
|
37
37
|
n ? e.experienceInstances.spawn(u, t, n) : e.experienceInstances.spawn(u, t);
|
|
38
38
|
});
|
|
@@ -46,7 +46,7 @@ var z = M("experience"), ne = L(({ client: e, experience: r }) => {
|
|
|
46
46
|
effect: async ({ preconditionPassed: i, isUser: a, config: o }) => {
|
|
47
47
|
if (!i || !a) return !1;
|
|
48
48
|
let { decisionLogic: s, targetSelectors: c } = o;
|
|
49
|
-
return c.length === 0 ||
|
|
49
|
+
return c.length === 0 || v(c, r.id).length < 1 ? !1 : s === void 0 ? !0 : t(s) ? await n(e, s) === !0 : !0;
|
|
50
50
|
}
|
|
51
51
|
}), p = N(async () => {
|
|
52
52
|
if (!e.contentLoader) return !0;
|
|
@@ -97,17 +97,17 @@ var z = M("experience"), ne = L(({ client: e, experience: r }) => {
|
|
|
97
97
|
prepareExperienceContentFx: p
|
|
98
98
|
}, u;
|
|
99
99
|
});
|
|
100
|
-
function
|
|
101
|
-
return R(
|
|
100
|
+
function ae(e) {
|
|
101
|
+
return R(ie, e);
|
|
102
102
|
}
|
|
103
|
-
var
|
|
103
|
+
var oe = L(({ client: e }) => {
|
|
104
104
|
let t = z.store({}), n = j(t, { register(e, t) {
|
|
105
105
|
return {
|
|
106
106
|
...e,
|
|
107
107
|
[t.id]: t
|
|
108
108
|
};
|
|
109
109
|
} }), r = P(), i = N((t) => {
|
|
110
|
-
n.register(
|
|
110
|
+
n.register(ae({
|
|
111
111
|
client: e,
|
|
112
112
|
experience: t
|
|
113
113
|
}));
|
|
@@ -192,20 +192,20 @@ var ie = L(({ client: e }) => {
|
|
|
192
192
|
})
|
|
193
193
|
};
|
|
194
194
|
});
|
|
195
|
-
function
|
|
196
|
-
return R(
|
|
195
|
+
function se(e) {
|
|
196
|
+
return R(oe, e);
|
|
197
197
|
}
|
|
198
|
-
var
|
|
198
|
+
var ce = async (e) => {
|
|
199
199
|
await e.experiences.initialiseExperiencesFx();
|
|
200
200
|
};
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region src/entities/plugin/plugin.ts
|
|
203
|
-
function
|
|
203
|
+
function le(e) {
|
|
204
204
|
return N(async () => {
|
|
205
205
|
await e();
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
var
|
|
208
|
+
var ue = (e, t, n) => {
|
|
209
209
|
let r = t.name, i = t.setup(e);
|
|
210
210
|
if (i) {
|
|
211
211
|
let e = n[r] ?? {};
|
|
@@ -214,16 +214,16 @@ var ce = (e, t, n) => {
|
|
|
214
214
|
...i
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
-
},
|
|
217
|
+
}, de = M("component"), fe = L(({ client: e, component: t, name: n }) => ({
|
|
218
218
|
name: n,
|
|
219
219
|
component: t,
|
|
220
220
|
frameworkStore: e.frameworks.getByName(t.frameworkName)
|
|
221
221
|
}));
|
|
222
|
-
function
|
|
223
|
-
return R(
|
|
222
|
+
function pe(e) {
|
|
223
|
+
return R(fe, e);
|
|
224
224
|
}
|
|
225
|
-
var
|
|
226
|
-
let t =
|
|
225
|
+
var me = L(({ client: e }) => {
|
|
226
|
+
let t = de.store({}), n = j(t, { register(e, t) {
|
|
227
227
|
return {
|
|
228
228
|
...e,
|
|
229
229
|
[t.name]: t
|
|
@@ -236,7 +236,7 @@ var fe = L(({ client: e }) => {
|
|
|
236
236
|
fn: (e, { name: t }) => `Component '${t}' already registered. Registering again will override the previous registration.`
|
|
237
237
|
}).watch((e) => /* @__PURE__ */ r("warn", e)), I({
|
|
238
238
|
clock: i,
|
|
239
|
-
fn: ({ name: t, component: n }) =>
|
|
239
|
+
fn: ({ name: t, component: n }) => pe({
|
|
240
240
|
client: e,
|
|
241
241
|
name: t,
|
|
242
242
|
component: n
|
|
@@ -253,16 +253,16 @@ var fe = L(({ client: e }) => {
|
|
|
253
253
|
listStore: a
|
|
254
254
|
};
|
|
255
255
|
});
|
|
256
|
-
function
|
|
257
|
-
return R(
|
|
256
|
+
function he(e) {
|
|
257
|
+
return R(me, e);
|
|
258
258
|
}
|
|
259
259
|
var B = (e, t, n) => {
|
|
260
260
|
n.register({
|
|
261
261
|
name: e,
|
|
262
262
|
component: t
|
|
263
263
|
});
|
|
264
|
-
},
|
|
265
|
-
let t =
|
|
264
|
+
}, ge = M("framework"), _e = L((e) => {
|
|
265
|
+
let t = ge.store({}), n = j(t, { register(e, t) {
|
|
266
266
|
return {
|
|
267
267
|
...e,
|
|
268
268
|
[t.name]: t.framework
|
|
@@ -287,15 +287,15 @@ var B = (e, t, n) => {
|
|
|
287
287
|
listStore: a
|
|
288
288
|
};
|
|
289
289
|
});
|
|
290
|
-
function
|
|
291
|
-
return R(
|
|
290
|
+
function ve(e) {
|
|
291
|
+
return R(_e, e);
|
|
292
292
|
}
|
|
293
|
-
var
|
|
293
|
+
var ye = (e, t) => {
|
|
294
294
|
t.register({
|
|
295
295
|
name: e.name,
|
|
296
296
|
framework: e
|
|
297
297
|
});
|
|
298
|
-
},
|
|
298
|
+
}, be = L(({ client: e }) => {
|
|
299
299
|
let t = "window" in globalThis, n = {
|
|
300
300
|
location: t ? globalThis.location : void 0,
|
|
301
301
|
document: t ? globalThis.document : void 0,
|
|
@@ -309,12 +309,12 @@ var _e = (e, t) => {
|
|
|
309
309
|
...n
|
|
310
310
|
}));
|
|
311
311
|
});
|
|
312
|
-
function
|
|
313
|
-
return R(
|
|
312
|
+
function xe(e) {
|
|
313
|
+
return R(be, e);
|
|
314
314
|
}
|
|
315
315
|
//#endregion
|
|
316
316
|
//#region src/logic-engine.ts
|
|
317
|
-
function
|
|
317
|
+
function Se(e) {
|
|
318
318
|
return typeof e == "number" && !isNaN(e);
|
|
319
319
|
}
|
|
320
320
|
function V(e) {
|
|
@@ -323,70 +323,70 @@ function V(e) {
|
|
|
323
323
|
function H(e) {
|
|
324
324
|
return Array.isArray(e);
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Ce(e) {
|
|
327
327
|
return e instanceof Promise;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function we(e) {
|
|
330
330
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
if (
|
|
332
|
+
function U(e) {
|
|
333
|
+
if (Se(e)) return e;
|
|
334
334
|
let t = parseFloat(`${e}`);
|
|
335
335
|
return isNaN(t) ? 0 : t;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function W(e) {
|
|
338
338
|
return `${e}`;
|
|
339
339
|
}
|
|
340
|
-
var
|
|
340
|
+
var Te = {
|
|
341
341
|
"==": (e, t) => e == t,
|
|
342
342
|
"===": (e, t) => e === t,
|
|
343
343
|
"!=": (e, t) => e != t,
|
|
344
344
|
"!==": (e, t) => e !== t,
|
|
345
|
-
">": (e, t) =>
|
|
346
|
-
">=": (e, t) =>
|
|
345
|
+
">": (e, t) => U(e) > U(t),
|
|
346
|
+
">=": (e, t) => U(e) >= U(t),
|
|
347
347
|
"<": (e, t, n) => {
|
|
348
|
-
let r =
|
|
348
|
+
let r = U(e), i = U(t);
|
|
349
349
|
if (n === void 0) return r < i;
|
|
350
|
-
let a =
|
|
350
|
+
let a = U(n);
|
|
351
351
|
return r < i && i < a;
|
|
352
352
|
},
|
|
353
353
|
"<=": (e, t, n) => {
|
|
354
|
-
let r =
|
|
354
|
+
let r = U(e), i = U(t);
|
|
355
355
|
if (n === void 0) return r <= i;
|
|
356
|
-
let a =
|
|
356
|
+
let a = U(n);
|
|
357
357
|
return r <= i && i <= a;
|
|
358
358
|
},
|
|
359
|
-
"!!": async (e) => await
|
|
360
|
-
"!": async (e) => !await
|
|
361
|
-
"%": (e, t) =>
|
|
359
|
+
"!!": async (e) => await K(e),
|
|
360
|
+
"!": async (e) => !await K(e),
|
|
361
|
+
"%": (e, t) => U(e) % U(t),
|
|
362
362
|
log: (e) => (console.log(e), e),
|
|
363
|
-
in: (e, t) => t ? V(t) ? t.indexOf(
|
|
364
|
-
cat: (...e) => e.map(
|
|
363
|
+
in: (e, t) => t ? V(t) ? t.indexOf(W(e)) !== -1 : H(t) ? t.includes(e) : !1 : !1,
|
|
364
|
+
cat: (...e) => e.map(W).join(""),
|
|
365
365
|
substr: (e, t, n) => {
|
|
366
|
-
let r =
|
|
366
|
+
let r = W(e), i = U(t);
|
|
367
367
|
if (n === void 0) return r.substr(i);
|
|
368
|
-
let a =
|
|
368
|
+
let a = U(n);
|
|
369
369
|
if (a < 0) {
|
|
370
370
|
let e = r.substr(i);
|
|
371
371
|
return e.substr(0, e.length + a);
|
|
372
372
|
}
|
|
373
373
|
return r.substr(i, a);
|
|
374
374
|
},
|
|
375
|
-
"+": (...e) => e.reduce((e, t) =>
|
|
376
|
-
"*": (...e) => e.reduce((e, t) =>
|
|
375
|
+
"+": (...e) => e.reduce((e, t) => U(e) + U(t), 0),
|
|
376
|
+
"*": (...e) => e.reduce((e, t) => U(e) * U(t), 1),
|
|
377
377
|
"-": (e, t) => {
|
|
378
|
-
let n =
|
|
379
|
-
return t === void 0 ? -n : n -
|
|
378
|
+
let n = U(e);
|
|
379
|
+
return t === void 0 ? -n : n - U(t);
|
|
380
380
|
},
|
|
381
|
-
"/": (e, t) =>
|
|
382
|
-
min: (...e) => Math.min(...e.map(
|
|
383
|
-
max: (...e) => Math.max(...e.map(
|
|
381
|
+
"/": (e, t) => U(e) / U(t),
|
|
382
|
+
min: (...e) => Math.min(...e.map(U)),
|
|
383
|
+
max: (...e) => Math.max(...e.map(U)),
|
|
384
384
|
merge: (...e) => e.reduce((e, t) => H(t) ? e.concat(t) : e.concat([t]), []),
|
|
385
385
|
var(e, t) {
|
|
386
386
|
let n = arguments.length > 1 ? t : null;
|
|
387
387
|
if (e === "" || e === "." || e == null) return this;
|
|
388
388
|
if (typeof e == "number" && Array.isArray(this)) return e >= 0 && e < this.length ? this[e] : n;
|
|
389
|
-
let r =
|
|
389
|
+
let r = W(e);
|
|
390
390
|
if (r === "" || r === ".") return this;
|
|
391
391
|
let i = r.split("."), a = this;
|
|
392
392
|
for (let e of i) {
|
|
@@ -401,16 +401,16 @@ var xe = {
|
|
|
401
401
|
async missing(...e) {
|
|
402
402
|
let t = H(e[0]) ? e[0] : e, n = [];
|
|
403
403
|
for (let e of t) {
|
|
404
|
-
let t = await
|
|
404
|
+
let t = await G({ var: e }, this);
|
|
405
405
|
(t === null || t === "") && n.push(`${e}`);
|
|
406
406
|
}
|
|
407
407
|
return n;
|
|
408
408
|
},
|
|
409
409
|
async missing_some(e, t) {
|
|
410
|
-
let n = await
|
|
410
|
+
let n = await G({ missing: t }, this);
|
|
411
411
|
if (!H(n) || !H(t)) return [];
|
|
412
412
|
let r = n.filter(V);
|
|
413
|
-
return t.filter(V).length - r.length >=
|
|
413
|
+
return t.filter(V).length - r.length >= U(e) ? [] : r;
|
|
414
414
|
},
|
|
415
415
|
invoke(...e) {
|
|
416
416
|
let [t, ...n] = e;
|
|
@@ -424,91 +424,91 @@ var xe = {
|
|
|
424
424
|
let [t, i] = e;
|
|
425
425
|
n = t, r = i;
|
|
426
426
|
}
|
|
427
|
-
return !V(n) || !V(r) ? !1 : new RegExp(n, r).test(
|
|
427
|
+
return !V(n) || !V(r) ? !1 : new RegExp(n, r).test(W(t));
|
|
428
428
|
},
|
|
429
429
|
throw(e) {
|
|
430
|
-
throw Error(
|
|
430
|
+
throw Error(W(e));
|
|
431
431
|
}
|
|
432
432
|
};
|
|
433
|
-
async function
|
|
433
|
+
async function G(e, t) {
|
|
434
434
|
if (!e) return e;
|
|
435
|
-
if (
|
|
436
|
-
if (H(e)) return Promise.all(e.map((e) =>
|
|
437
|
-
if (!
|
|
438
|
-
let n =
|
|
435
|
+
if (Ce(e)) return G(await e, t);
|
|
436
|
+
if (H(e)) return Promise.all(e.map((e) => G(e, t)));
|
|
437
|
+
if (!we(e)) return e;
|
|
438
|
+
let n = Ee(e), r = n ? e[n] ?? [] : [];
|
|
439
439
|
switch (H(r) || (r = [r]), n) {
|
|
440
440
|
case "if":
|
|
441
441
|
case "?:":
|
|
442
|
-
for (let e = 0; e < r.length - 1; e += 2) if (await
|
|
443
|
-
return r.length % 2 == 1 ?
|
|
442
|
+
for (let e = 0; e < r.length - 1; e += 2) if (await K(await G(r[e], t))) return G(r[e + 1], t);
|
|
443
|
+
return r.length % 2 == 1 ? G(r[r.length - 1], t) : null;
|
|
444
444
|
case "and": {
|
|
445
445
|
let e = null;
|
|
446
|
-
for (let n of r) if (e = await
|
|
446
|
+
for (let n of r) if (e = await G(n, t), !await K(e)) return e;
|
|
447
447
|
return e;
|
|
448
448
|
}
|
|
449
449
|
case "or": {
|
|
450
450
|
let e = null;
|
|
451
|
-
for (let n of r) if (e = await
|
|
451
|
+
for (let n of r) if (e = await G(n, t), await K(e)) return e;
|
|
452
452
|
return e;
|
|
453
453
|
}
|
|
454
454
|
case "map": {
|
|
455
|
-
let e = await
|
|
456
|
-
return H(e) ? await Promise.all(e.map((e) =>
|
|
455
|
+
let e = await G(r[0], t);
|
|
456
|
+
return H(e) ? await Promise.all(e.map((e) => G(r[1], e))) : [];
|
|
457
457
|
}
|
|
458
458
|
case "filter": {
|
|
459
|
-
let e = await
|
|
459
|
+
let e = await G(r[0], t);
|
|
460
460
|
return H(e) ? (await Promise.all(e.map(async (e) => ({
|
|
461
461
|
item: e,
|
|
462
|
-
shouldInclude: await
|
|
462
|
+
shouldInclude: await K(await G(r[1], e))
|
|
463
463
|
})))).filter(({ shouldInclude: e }) => e).map(({ item: e }) => e) : [];
|
|
464
464
|
}
|
|
465
465
|
case "reduce": {
|
|
466
|
-
let e = await
|
|
467
|
-
if (!H(e)) return r.length > 2 ? await
|
|
468
|
-
let n = r[1], i = r.length > 2 ? await
|
|
469
|
-
for (let t of e) i = await
|
|
466
|
+
let e = await G(r[0], t);
|
|
467
|
+
if (!H(e)) return r.length > 2 ? await G(r[2], t) : null;
|
|
468
|
+
let n = r[1], i = r.length > 2 ? await G(r[2], t) : null;
|
|
469
|
+
for (let t of e) i = await G(n, {
|
|
470
470
|
current: t,
|
|
471
471
|
accumulator: i
|
|
472
472
|
});
|
|
473
473
|
return i;
|
|
474
474
|
}
|
|
475
475
|
case "all": {
|
|
476
|
-
let e = await
|
|
476
|
+
let e = await G(r[0], t);
|
|
477
477
|
if (!H(e) || e.length === 0) return !1;
|
|
478
|
-
for (let t of e) if (!await
|
|
478
|
+
for (let t of e) if (!await K(await G(r[1], t))) return !1;
|
|
479
479
|
return !0;
|
|
480
480
|
}
|
|
481
481
|
case "some": {
|
|
482
|
-
let e = await
|
|
482
|
+
let e = await G(r[0], t);
|
|
483
483
|
if (!H(e)) return !1;
|
|
484
|
-
for (let t of e) if (await
|
|
484
|
+
for (let t of e) if (await K(await G(r[1], t))) return !0;
|
|
485
485
|
return !1;
|
|
486
486
|
}
|
|
487
487
|
case "none": {
|
|
488
|
-
let e = await
|
|
488
|
+
let e = await G(r[0], t);
|
|
489
489
|
if (!H(e)) return !0;
|
|
490
|
-
for (let t of e) if (await
|
|
490
|
+
for (let t of e) if (await K(await G(r[1], t))) return !1;
|
|
491
491
|
return !0;
|
|
492
492
|
}
|
|
493
493
|
case "catch": try {
|
|
494
|
-
return await
|
|
494
|
+
return await G(r[0], t);
|
|
495
495
|
} catch (e) {
|
|
496
|
-
return
|
|
496
|
+
return we(e) ? await G(e, t) : r[1] ? await G(r[1], e) : e instanceof Error ? e.message : e;
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
let i = await Promise.all(r.map((e) =>
|
|
499
|
+
let i = await Promise.all(r.map((e) => G(e, t))), a = n ? Te[n] : void 0;
|
|
500
500
|
if (!a) throw Error(`Unrecognized operation ${n}`);
|
|
501
501
|
return a.apply(t, i);
|
|
502
502
|
}
|
|
503
|
-
async function
|
|
504
|
-
return
|
|
503
|
+
async function K(e) {
|
|
504
|
+
return Ce(e) ? K(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Ee(e) {
|
|
507
507
|
return Object.keys(e)[0];
|
|
508
508
|
}
|
|
509
509
|
//#endregion
|
|
510
510
|
//#region src/lifecycle/rules-logic.ts
|
|
511
|
-
var
|
|
511
|
+
var De = L(({ client: e }) => k({
|
|
512
512
|
source: {
|
|
513
513
|
stateSnapshot: e.stateSnapshotStore,
|
|
514
514
|
predicates: e.predicates.listStore,
|
|
@@ -527,7 +527,7 @@ var Ce = L(({ client: e }) => k({
|
|
|
527
527
|
let { bucket: e } = await t.getBucket();
|
|
528
528
|
return e;
|
|
529
529
|
}, e), {});
|
|
530
|
-
return await
|
|
530
|
+
return await G(a, {
|
|
531
531
|
responses: i,
|
|
532
532
|
location: typeof e.location == "object" ? {
|
|
533
533
|
hash: e.location.hash,
|
|
@@ -547,138 +547,140 @@ var Ce = L(({ client: e }) => k({
|
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
549
|
}));
|
|
550
|
-
function
|
|
551
|
-
return R(
|
|
550
|
+
function Oe(e) {
|
|
551
|
+
return R(De, e);
|
|
552
552
|
}
|
|
553
553
|
//#endregion
|
|
554
554
|
//#region src/ping.ts
|
|
555
|
-
var
|
|
555
|
+
var ke = 6e3, Ae = O("last_ping", "global"), je = async (e) => {
|
|
556
556
|
try {
|
|
557
|
-
let t = Date.now(), n =
|
|
558
|
-
if (n.isSet() && (r = n.json() ?? 0), r && t - r <
|
|
557
|
+
let t = Date.now(), n = E.get(Ae), r = 0;
|
|
558
|
+
if (n.isSet() && (r = n.json() ?? 0), r && t - r < ke) return !0;
|
|
559
559
|
let i = {
|
|
560
560
|
projectId: e.projectId,
|
|
561
561
|
path: window.location.pathname
|
|
562
562
|
}, a = {}, o = document.getElementById("picked_script")?.dataset.verceltoken;
|
|
563
563
|
o && (a["x-vercel-protection-bypass"] = o);
|
|
564
|
-
let s = (await
|
|
564
|
+
let s = (await te(e.apiUrl, "ping", i, a)).ok;
|
|
565
565
|
return s && n.set(t), s;
|
|
566
566
|
} catch {
|
|
567
567
|
return !1;
|
|
568
568
|
}
|
|
569
|
-
},
|
|
570
|
-
let t =
|
|
569
|
+
}, q = M("lifecycle"), Me = L(({ client: e }) => {
|
|
570
|
+
let t = q.store(!1), r = F(void 0, {
|
|
571
571
|
skipVoid: !1,
|
|
572
|
-
domain:
|
|
572
|
+
domain: q
|
|
573
573
|
}), i = F(void 0, {
|
|
574
574
|
skipVoid: !1,
|
|
575
|
-
domain:
|
|
576
|
-
}), a =
|
|
575
|
+
domain: q
|
|
576
|
+
}), a = q.store("idle"), o = q.store([]), s = F(void 0, {
|
|
577
577
|
skipVoid: !1,
|
|
578
|
-
domain:
|
|
579
|
-
}),
|
|
578
|
+
domain: q
|
|
579
|
+
}), l = F(void 0, {
|
|
580
580
|
skipVoid: !1,
|
|
581
|
-
domain:
|
|
582
|
-
}),
|
|
583
|
-
o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t),
|
|
581
|
+
domain: q
|
|
582
|
+
}), u = P(), d = P(), f = P(), p = P(), m = P(), h = P();
|
|
583
|
+
o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t), l.on(h, (e, t) => t), t.on(d, () => !0);
|
|
584
584
|
let g = N(() => {
|
|
585
|
-
|
|
585
|
+
je(e);
|
|
586
586
|
}), _ = N(async () => {
|
|
587
|
-
await
|
|
588
|
-
}),
|
|
589
|
-
await
|
|
590
|
-
}),
|
|
587
|
+
await ee();
|
|
588
|
+
}), v = N(async () => {
|
|
589
|
+
await ce(e);
|
|
590
|
+
}), y = k({ effect: v }), b = k({
|
|
591
591
|
source: o,
|
|
592
592
|
effect: async (e) => {
|
|
593
593
|
for (let t of e) await t();
|
|
594
594
|
}
|
|
595
|
-
}),
|
|
595
|
+
}), x = k({
|
|
596
596
|
source: s,
|
|
597
597
|
effect: async (t) => t === void 0 ? !0 : typeof t == "boolean" ? t : await n(e, t) === !0
|
|
598
|
-
}),
|
|
599
|
-
source:
|
|
598
|
+
}), S = k({
|
|
599
|
+
source: l,
|
|
600
600
|
effect: async (t) => t === void 0 ? !0 : typeof t == "boolean" ? t : await n(e, t) === !0
|
|
601
|
-
}),
|
|
602
|
-
clock:
|
|
603
|
-
|
|
601
|
+
}), C = I({
|
|
602
|
+
clock: u,
|
|
603
|
+
source: a,
|
|
604
|
+
filter: (e) => e === "idle" && c(),
|
|
605
|
+
fn: () => void 0
|
|
604
606
|
});
|
|
605
607
|
I({
|
|
606
|
-
clock:
|
|
608
|
+
clock: C,
|
|
607
609
|
fn: () => "starting",
|
|
608
610
|
target: a
|
|
609
611
|
}), I({
|
|
610
|
-
clock:
|
|
612
|
+
clock: C,
|
|
611
613
|
target: g
|
|
612
614
|
}), I({
|
|
613
|
-
clock:
|
|
614
|
-
target:
|
|
615
|
+
clock: C,
|
|
616
|
+
target: b
|
|
615
617
|
}), I({
|
|
616
|
-
clock:
|
|
618
|
+
clock: C,
|
|
617
619
|
target: _
|
|
618
620
|
}), I({
|
|
619
|
-
clock:
|
|
620
|
-
target:
|
|
621
|
+
clock: b.done,
|
|
622
|
+
target: x
|
|
621
623
|
}), I({
|
|
622
|
-
clock:
|
|
624
|
+
clock: x.doneData,
|
|
623
625
|
target: r
|
|
624
626
|
}), I({
|
|
625
|
-
clock:
|
|
627
|
+
clock: S.doneData,
|
|
626
628
|
target: i
|
|
627
629
|
}), I({
|
|
628
|
-
clock:
|
|
630
|
+
clock: x.doneData,
|
|
629
631
|
filter: (e) => e,
|
|
630
|
-
target:
|
|
632
|
+
target: S
|
|
631
633
|
}), I({
|
|
632
|
-
clock:
|
|
634
|
+
clock: S.doneData,
|
|
633
635
|
target: e.session.setIsUser
|
|
634
636
|
}), I({
|
|
635
|
-
clock:
|
|
637
|
+
clock: S.doneData,
|
|
636
638
|
fn: (e) => ({
|
|
637
639
|
type: "user_decide",
|
|
638
640
|
value: e
|
|
639
641
|
}),
|
|
640
642
|
target: e.eventBus
|
|
641
643
|
}), I({
|
|
642
|
-
clock:
|
|
644
|
+
clock: x.doneData,
|
|
643
645
|
filter: (e) => !e,
|
|
644
646
|
fn: () => void 0,
|
|
645
|
-
target:
|
|
647
|
+
target: f
|
|
646
648
|
}), I({
|
|
647
|
-
clock:
|
|
649
|
+
clock: S.doneData,
|
|
648
650
|
fn: () => void 0,
|
|
649
|
-
target:
|
|
651
|
+
target: f
|
|
650
652
|
}), I({
|
|
651
|
-
clock:
|
|
653
|
+
clock: f,
|
|
652
654
|
fn: () => ({ type: "initialize" }),
|
|
653
655
|
target: e.eventBus
|
|
654
656
|
});
|
|
655
|
-
let
|
|
657
|
+
let w = F(!1).on(_.done, () => !0), T = F(!1).on(f, () => !0), E = F(!1).on(y.done, () => !0), D = A(r, i, (e, t) => e === !0 && t === !0);
|
|
656
658
|
return I({
|
|
657
|
-
clock:
|
|
658
|
-
source:
|
|
659
|
+
clock: f,
|
|
660
|
+
source: D,
|
|
659
661
|
filter: (e) => e,
|
|
660
662
|
fn: () => void 0,
|
|
661
|
-
target:
|
|
663
|
+
target: v
|
|
662
664
|
}), I({
|
|
663
|
-
clock: A(
|
|
665
|
+
clock: A(w, T, D, (e, t, n) => e && t && n),
|
|
664
666
|
filter: (e) => e,
|
|
665
667
|
fn: () => void 0,
|
|
666
|
-
target:
|
|
668
|
+
target: y
|
|
667
669
|
}), I({
|
|
668
|
-
clock: A(
|
|
670
|
+
clock: A(w, T, D, E, (e, t, n, r) => e && t && (!n || r)),
|
|
669
671
|
filter: (e) => e,
|
|
670
672
|
fn: () => void 0,
|
|
671
|
-
target:
|
|
673
|
+
target: d
|
|
672
674
|
}), I({
|
|
673
|
-
clock:
|
|
675
|
+
clock: d,
|
|
674
676
|
fn: () => "ready",
|
|
675
677
|
target: a
|
|
676
678
|
}), I({
|
|
677
|
-
clock:
|
|
679
|
+
clock: d,
|
|
678
680
|
fn: () => ({ type: "ready" }),
|
|
679
681
|
target: e.eventBus
|
|
680
682
|
}), I({
|
|
681
|
-
clock:
|
|
683
|
+
clock: d,
|
|
682
684
|
source: e.session.store,
|
|
683
685
|
fn: ({ id: e, isUser: t, identifiers: n }) => ({
|
|
684
686
|
type: "session",
|
|
@@ -689,17 +691,17 @@ var Te = 6e3, Ee = D("last_ping", "global"), De = async (e) => {
|
|
|
689
691
|
target: e.eventBus
|
|
690
692
|
}), I({
|
|
691
693
|
clock: [
|
|
694
|
+
b.fail,
|
|
692
695
|
x.fail,
|
|
693
696
|
S.fail,
|
|
694
|
-
|
|
697
|
+
v.fail,
|
|
695
698
|
y.fail,
|
|
696
|
-
b.fail,
|
|
697
699
|
_.fail
|
|
698
700
|
],
|
|
699
701
|
fn: () => "failed",
|
|
700
702
|
target: a
|
|
701
703
|
}), {
|
|
702
|
-
start:
|
|
704
|
+
start: u,
|
|
703
705
|
readyStore: t,
|
|
704
706
|
preconditionPassedStore: r,
|
|
705
707
|
conditionPassedStore: i,
|
|
@@ -709,13 +711,13 @@ var Te = 6e3, Ee = D("last_ping", "global"), De = async (e) => {
|
|
|
709
711
|
setCondition: h
|
|
710
712
|
};
|
|
711
713
|
});
|
|
712
|
-
function
|
|
713
|
-
return R(
|
|
714
|
+
function Ne(e) {
|
|
715
|
+
return R(Me, e);
|
|
714
716
|
}
|
|
715
717
|
//#endregion
|
|
716
718
|
//#region src/entities/predicate/predicate.ts
|
|
717
|
-
var
|
|
718
|
-
let t =
|
|
719
|
+
var Pe = M("predicate"), Fe = L(({ client: e }) => {
|
|
720
|
+
let t = Pe.store({}), n = j(t, { register(e, t) {
|
|
719
721
|
return {
|
|
720
722
|
...e,
|
|
721
723
|
[t.name]: {
|
|
@@ -773,16 +775,16 @@ var Ae = M("predicate"), je = L(({ client: e }) => {
|
|
|
773
775
|
getEvokablePredicate: s
|
|
774
776
|
};
|
|
775
777
|
});
|
|
776
|
-
function
|
|
777
|
-
return R(
|
|
778
|
+
function Ie(e) {
|
|
779
|
+
return R(Fe, e);
|
|
778
780
|
}
|
|
779
|
-
var
|
|
781
|
+
var Le = (e, t, n) => {
|
|
780
782
|
n.register({
|
|
781
783
|
name: e,
|
|
782
784
|
predicate: t
|
|
783
785
|
});
|
|
784
|
-
},
|
|
785
|
-
let t =
|
|
786
|
+
}, J = M("feature"), Re = L(({ client: e }) => {
|
|
787
|
+
let t = J.store({}), n = J.store([]), i = j(t, { register(e, t) {
|
|
786
788
|
return {
|
|
787
789
|
...e,
|
|
788
790
|
[t.id]: t.feature
|
|
@@ -808,7 +810,7 @@ var Ne = (e, t, n) => {
|
|
|
808
810
|
target: i.register
|
|
809
811
|
});
|
|
810
812
|
let o = N(async ({ id: e, key: t, storage: n = "local" }) => {
|
|
811
|
-
let r =
|
|
813
|
+
let r = O(`feature:${e}:${t}`, "global"), i = (n === "session" ? D : E).get(r).boolean();
|
|
812
814
|
return i === null ? null : {
|
|
813
815
|
id: e,
|
|
814
816
|
key: t,
|
|
@@ -817,8 +819,8 @@ var Ne = (e, t, n) => {
|
|
|
817
819
|
};
|
|
818
820
|
}), s = N((e) => {
|
|
819
821
|
if (!e) return null;
|
|
820
|
-
let t =
|
|
821
|
-
(e.storage === "session" ?
|
|
822
|
+
let t = O(`feature:${e.id}:${e.key}`, "global");
|
|
823
|
+
(e.storage === "session" ? D : E).set(t, e.bucket);
|
|
822
824
|
}), c = /* @__PURE__ */ new Map(), l = k({
|
|
823
825
|
source: {
|
|
824
826
|
allFeaturesStore: t,
|
|
@@ -943,27 +945,27 @@ var Ne = (e, t, n) => {
|
|
|
943
945
|
getEvokableFeature: p
|
|
944
946
|
};
|
|
945
947
|
});
|
|
946
|
-
function
|
|
947
|
-
return R(
|
|
948
|
+
function ze(e) {
|
|
949
|
+
return R(Re, e);
|
|
948
950
|
}
|
|
949
|
-
var
|
|
951
|
+
var Be = (e, t, n) => {
|
|
950
952
|
n.register({
|
|
951
953
|
id: e,
|
|
952
954
|
feature: t
|
|
953
955
|
});
|
|
954
|
-
},
|
|
955
|
-
function
|
|
956
|
+
}, Y = M("history");
|
|
957
|
+
function Ve(e, t) {
|
|
956
958
|
return {
|
|
957
|
-
id:
|
|
959
|
+
id: re(`history-entry-${Date.now()}-${Math.random()}}`),
|
|
958
960
|
node: t,
|
|
959
961
|
at: Date.now(),
|
|
960
962
|
experienceId: e
|
|
961
963
|
};
|
|
962
964
|
}
|
|
963
|
-
var
|
|
964
|
-
let e =
|
|
965
|
-
e.on(t, (e, t) => ({ entries: [...e.entries,
|
|
966
|
-
function
|
|
965
|
+
var He = L(() => {
|
|
966
|
+
let e = Y.store({ entries: [] }), t = Y.event(), n = Y.event(), r = Y.event(), i = Y.event();
|
|
967
|
+
e.on(t, (e, t) => ({ entries: [...e.entries, Ve(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Ve(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
|
|
968
|
+
function a(e, t) {
|
|
967
969
|
let n = {
|
|
968
970
|
lastStepIndex: -1,
|
|
969
971
|
secondLastStepIndex: -1
|
|
@@ -979,7 +981,7 @@ var ze = L(() => {
|
|
|
979
981
|
return n;
|
|
980
982
|
}
|
|
981
983
|
return e.on(r, (e, t) => {
|
|
982
|
-
let { secondLastStepIndex: n } =
|
|
984
|
+
let { secondLastStepIndex: n } = a(e.entries, t.experienceId), r = n === -1 ? e.entries : e.entries.slice(0, n + 1);
|
|
983
985
|
return {
|
|
984
986
|
...e,
|
|
985
987
|
entries: r
|
|
@@ -989,24 +991,23 @@ var ze = L(() => {
|
|
|
989
991
|
replace: n,
|
|
990
992
|
back: r,
|
|
991
993
|
restore: i,
|
|
992
|
-
resetExperience: a,
|
|
993
994
|
entriesStore: e.map((e) => e.entries)
|
|
994
995
|
};
|
|
995
996
|
});
|
|
996
|
-
function
|
|
997
|
-
return R(
|
|
997
|
+
function Ue() {
|
|
998
|
+
return R(He);
|
|
998
999
|
}
|
|
999
1000
|
//#endregion
|
|
1000
1001
|
//#region src/utils/events.ts
|
|
1001
|
-
var
|
|
1002
|
+
var We = 0, Ge = (e) => {
|
|
1002
1003
|
let t = F([]);
|
|
1003
1004
|
return t.on(e, (e, t) => [...e, {
|
|
1004
|
-
id:
|
|
1005
|
+
id: We++,
|
|
1005
1006
|
at: /* @__PURE__ */ new Date(),
|
|
1006
1007
|
payload: t
|
|
1007
1008
|
}]), t;
|
|
1008
|
-
},
|
|
1009
|
-
let e =
|
|
1009
|
+
}, Ke = M("field"), qe = L(() => {
|
|
1010
|
+
let e = Ke.store({}), t = j(e, {
|
|
1010
1011
|
register(e, t) {
|
|
1011
1012
|
return {
|
|
1012
1013
|
...e,
|
|
@@ -1054,13 +1055,13 @@ var Ve = 0, He = (e) => {
|
|
|
1054
1055
|
getByName: c
|
|
1055
1056
|
};
|
|
1056
1057
|
});
|
|
1057
|
-
function
|
|
1058
|
-
return R(
|
|
1058
|
+
function Je() {
|
|
1059
|
+
return R(qe);
|
|
1059
1060
|
}
|
|
1060
1061
|
//#endregion
|
|
1061
1062
|
//#region src/entities/step/step.ts
|
|
1062
|
-
var
|
|
1063
|
-
let e =
|
|
1063
|
+
var Ye = M("step"), Xe = L(() => {
|
|
1064
|
+
let e = Ye.store({}), t = j(e, { register(e, t) {
|
|
1064
1065
|
return {
|
|
1065
1066
|
...e,
|
|
1066
1067
|
[t.step.id]: t.step
|
|
@@ -1084,16 +1085,16 @@ var Ke = M("step"), qe = L(() => {
|
|
|
1084
1085
|
indexStore: e
|
|
1085
1086
|
};
|
|
1086
1087
|
});
|
|
1087
|
-
function
|
|
1088
|
-
return R(
|
|
1088
|
+
function Ze() {
|
|
1089
|
+
return R(Xe);
|
|
1089
1090
|
}
|
|
1090
|
-
function
|
|
1091
|
+
function Qe(e, t) {
|
|
1091
1092
|
t.register(e);
|
|
1092
1093
|
}
|
|
1093
1094
|
//#endregion
|
|
1094
1095
|
//#region src/entities/content/content.ts
|
|
1095
|
-
var
|
|
1096
|
-
let e =
|
|
1096
|
+
var $e = M("content"), et = L(() => {
|
|
1097
|
+
let e = $e.store({}), t = j(e, { register(e, t) {
|
|
1097
1098
|
return {
|
|
1098
1099
|
...e,
|
|
1099
1100
|
[t.content.id]: t.content
|
|
@@ -1113,16 +1114,16 @@ var Xe = M("content"), Ze = L(() => {
|
|
|
1113
1114
|
indexStore: e
|
|
1114
1115
|
};
|
|
1115
1116
|
});
|
|
1116
|
-
function
|
|
1117
|
-
return R(
|
|
1117
|
+
function tt() {
|
|
1118
|
+
return R(et);
|
|
1118
1119
|
}
|
|
1119
|
-
function
|
|
1120
|
+
function nt(e, t) {
|
|
1120
1121
|
t.register(e);
|
|
1121
1122
|
}
|
|
1122
1123
|
//#endregion
|
|
1123
1124
|
//#region src/entities/action/action.ts
|
|
1124
|
-
var
|
|
1125
|
-
let t =
|
|
1125
|
+
var rt = M("action"), it = L(({ client: e }) => {
|
|
1126
|
+
let t = rt.store({}), n = j(t, { register(e, t) {
|
|
1126
1127
|
return {
|
|
1127
1128
|
...e,
|
|
1128
1129
|
[t.key]: {
|
|
@@ -1180,10 +1181,10 @@ var et = M("action"), tt = L(({ client: e }) => {
|
|
|
1180
1181
|
getEvokableAction: s
|
|
1181
1182
|
};
|
|
1182
1183
|
});
|
|
1183
|
-
function
|
|
1184
|
-
return R(
|
|
1184
|
+
function at(e) {
|
|
1185
|
+
return R(it, e);
|
|
1185
1186
|
}
|
|
1186
|
-
var
|
|
1187
|
+
var ot = (e, t, n) => {
|
|
1187
1188
|
n.register({
|
|
1188
1189
|
key: e,
|
|
1189
1190
|
action: t
|
|
@@ -1191,7 +1192,7 @@ var rt = (e, t, n) => {
|
|
|
1191
1192
|
};
|
|
1192
1193
|
//#endregion
|
|
1193
1194
|
//#region src/entities/response/response-validation.ts
|
|
1194
|
-
function
|
|
1195
|
+
function X(e, t, n, r) {
|
|
1195
1196
|
return {
|
|
1196
1197
|
fieldKey: e.key,
|
|
1197
1198
|
userMessage: n,
|
|
@@ -1199,62 +1200,62 @@ function Z(e, t, n, r) {
|
|
|
1199
1200
|
value: t
|
|
1200
1201
|
};
|
|
1201
1202
|
}
|
|
1202
|
-
function
|
|
1203
|
+
function Z(e) {
|
|
1203
1204
|
return e === null || e === "" || Array.isArray(e) && !e.length;
|
|
1204
1205
|
}
|
|
1205
|
-
function
|
|
1206
|
+
function st(e) {
|
|
1206
1207
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
|
|
1207
1208
|
}
|
|
1208
|
-
function
|
|
1209
|
+
function ct(e) {
|
|
1209
1210
|
try {
|
|
1210
1211
|
return JSON.stringify(e), !0;
|
|
1211
1212
|
} catch {
|
|
1212
1213
|
return !1;
|
|
1213
1214
|
}
|
|
1214
1215
|
}
|
|
1215
|
-
function
|
|
1216
|
+
function lt(e, t) {
|
|
1216
1217
|
return t.find((t) => t.key === e) ?? null;
|
|
1217
1218
|
}
|
|
1218
|
-
function
|
|
1219
|
+
function ut(e, t) {
|
|
1219
1220
|
return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
|
|
1220
1221
|
}
|
|
1221
|
-
function
|
|
1222
|
-
if (e.type !== "object" ||
|
|
1222
|
+
function dt(e, t) {
|
|
1223
|
+
if (e.type !== "object" || Z(t)) return null;
|
|
1223
1224
|
if (e.multiple) {
|
|
1224
|
-
if (!Array.isArray(t)) return
|
|
1225
|
+
if (!Array.isArray(t)) return X(e, t, "This field expects multiple values", "Field expects an array of objects.");
|
|
1225
1226
|
for (let n of t) {
|
|
1226
|
-
if (typeof n != "object" || !n) return
|
|
1227
|
-
if (!
|
|
1227
|
+
if (typeof n != "object" || !n) return X(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
|
|
1228
|
+
if (!ct(n)) return X(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1228
1229
|
}
|
|
1229
1230
|
return null;
|
|
1230
1231
|
}
|
|
1231
|
-
return Array.isArray(t) ?
|
|
1232
|
+
return Array.isArray(t) ? X(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? X(e, t, "This field expects an object value", "Field expects an object value.") : ct(t) ? null : X(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1232
1233
|
}
|
|
1233
|
-
function
|
|
1234
|
-
if (
|
|
1234
|
+
function ft(e, t) {
|
|
1235
|
+
if (Z(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
|
|
1235
1236
|
let n = Array.isArray(t) ? t : [t];
|
|
1236
1237
|
if (e.type === "object") {
|
|
1237
1238
|
let r = new Set(e.options.map((e) => JSON.stringify(e.value)));
|
|
1238
|
-
return n.every((e) => r.has(JSON.stringify(e))) ? null :
|
|
1239
|
+
return n.every((e) => r.has(JSON.stringify(e))) ? null : X(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
|
|
1239
1240
|
}
|
|
1240
1241
|
let r = e.options.map((e) => e.value);
|
|
1241
|
-
return n.every((e) => !
|
|
1242
|
+
return n.every((e) => !st(e) || e === null ? !1 : r.includes(e)) ? null : X(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
|
|
1242
1243
|
}
|
|
1243
|
-
async function
|
|
1244
|
-
if (n.validation && !e(n.validation) && !
|
|
1244
|
+
async function pt(t, n, r, i) {
|
|
1245
|
+
if (n.validation && !e(n.validation) && !Z(r)) {
|
|
1245
1246
|
let e = i ? {
|
|
1246
1247
|
$input: r,
|
|
1247
1248
|
responses: i
|
|
1248
1249
|
} : { $input: r }, a = await t(n.validation, e);
|
|
1249
|
-
if (typeof a == "string") return
|
|
1250
|
-
if (a === !1) return
|
|
1250
|
+
if (typeof a == "string") return X(n, r, a, `Field validation resulted in an error: ${a}.`);
|
|
1251
|
+
if (a === !1) return X(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
|
|
1251
1252
|
}
|
|
1252
|
-
return n.required &&
|
|
1253
|
+
return n.required && Z(r) ? X(n, r, "This field is required", "Field is required.") : !n.multiple && Array.isArray(r) && r.length > 1 ? X(n, r, "This field expects a single response", "Field expects a single response.") : null;
|
|
1253
1254
|
}
|
|
1254
1255
|
//#endregion
|
|
1255
1256
|
//#region src/entities/response/response.ts
|
|
1256
|
-
var
|
|
1257
|
-
let t =
|
|
1257
|
+
var mt = M("response"), ht = L(({ client: e }) => {
|
|
1258
|
+
let t = mt.store({}), r = P(), i = P(), a = j(t, {
|
|
1258
1259
|
register(e, t) {
|
|
1259
1260
|
return {
|
|
1260
1261
|
...e,
|
|
@@ -1293,7 +1294,7 @@ var dt = M("response"), ft = L(({ client: e }) => {
|
|
|
1293
1294
|
...t,
|
|
1294
1295
|
...n
|
|
1295
1296
|
}, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
|
|
1296
|
-
let o =
|
|
1297
|
+
let o = lt(t, e);
|
|
1297
1298
|
if (!o) {
|
|
1298
1299
|
r.push({
|
|
1299
1300
|
fieldKey: t,
|
|
@@ -1303,17 +1304,17 @@ var dt = M("response"), ft = L(({ client: e }) => {
|
|
|
1303
1304
|
});
|
|
1304
1305
|
return;
|
|
1305
1306
|
}
|
|
1306
|
-
let c =
|
|
1307
|
+
let c = ut(o, n), l = await pt(s, o, c, a);
|
|
1307
1308
|
if (l) {
|
|
1308
1309
|
r.push(l);
|
|
1309
1310
|
return;
|
|
1310
1311
|
}
|
|
1311
|
-
let u =
|
|
1312
|
+
let u = dt(o, c);
|
|
1312
1313
|
if (u) {
|
|
1313
1314
|
r.push(u);
|
|
1314
1315
|
return;
|
|
1315
1316
|
}
|
|
1316
|
-
let d =
|
|
1317
|
+
let d = ft(o, c);
|
|
1317
1318
|
if (d) {
|
|
1318
1319
|
r.push(d);
|
|
1319
1320
|
return;
|
|
@@ -1373,30 +1374,16 @@ var dt = M("response"), ft = L(({ client: e }) => {
|
|
|
1373
1374
|
function _(t) {
|
|
1374
1375
|
return m(e.fields.getByName(t));
|
|
1375
1376
|
}
|
|
1376
|
-
I({
|
|
1377
|
+
return I({
|
|
1377
1378
|
clock: r,
|
|
1378
1379
|
target: a.clearAll
|
|
1379
1380
|
}), I({
|
|
1380
1381
|
clock: i,
|
|
1381
1382
|
target: a.clear
|
|
1382
|
-
})
|
|
1383
|
-
let v = k({
|
|
1384
|
-
source: e.experiences.listStore,
|
|
1385
|
-
effect: (e, t) => {
|
|
1386
|
-
let n = e.find((e) => e.id === t);
|
|
1387
|
-
if (!n) return;
|
|
1388
|
-
let { steps: r } = n.treeStore.getState(), a = r.flatMap((e) => e.fieldKeys);
|
|
1389
|
-
for (let e of a) i(e);
|
|
1390
|
-
}
|
|
1391
|
-
});
|
|
1392
|
-
function y(e) {
|
|
1393
|
-
v(e);
|
|
1394
|
-
}
|
|
1395
|
-
return {
|
|
1383
|
+
}), {
|
|
1396
1384
|
register: o,
|
|
1397
1385
|
clearAll: r,
|
|
1398
1386
|
clear: i,
|
|
1399
|
-
clearByExperience: y,
|
|
1400
1387
|
commit: d,
|
|
1401
1388
|
getResponsesToCommit: l,
|
|
1402
1389
|
listStore: p,
|
|
@@ -1406,13 +1393,13 @@ var dt = M("response"), ft = L(({ client: e }) => {
|
|
|
1406
1393
|
getByFieldName: _
|
|
1407
1394
|
};
|
|
1408
1395
|
});
|
|
1409
|
-
function
|
|
1410
|
-
return R(
|
|
1396
|
+
function gt(e) {
|
|
1397
|
+
return R(ht, e);
|
|
1411
1398
|
}
|
|
1412
1399
|
//#endregion
|
|
1413
1400
|
//#region src/entities/condition/condition.ts
|
|
1414
|
-
var
|
|
1415
|
-
let e =
|
|
1401
|
+
var _t = M("condition"), vt = L(() => {
|
|
1402
|
+
let e = _t.store({}), t = j(e, { register(e, t) {
|
|
1416
1403
|
return {
|
|
1417
1404
|
...e,
|
|
1418
1405
|
[t.condition.id]: t.condition
|
|
@@ -1436,13 +1423,13 @@ var mt = M("condition"), ht = L(() => {
|
|
|
1436
1423
|
indexStore: e
|
|
1437
1424
|
};
|
|
1438
1425
|
});
|
|
1439
|
-
function
|
|
1440
|
-
return R(
|
|
1426
|
+
function yt() {
|
|
1427
|
+
return R(vt);
|
|
1441
1428
|
}
|
|
1442
1429
|
//#endregion
|
|
1443
1430
|
//#region src/utils/api-url.ts
|
|
1444
|
-
function
|
|
1445
|
-
if (
|
|
1431
|
+
function bt() {
|
|
1432
|
+
if (c()) {
|
|
1446
1433
|
let e = [
|
|
1447
1434
|
document.currentScript,
|
|
1448
1435
|
document.getElementById("picked_script"),
|
|
@@ -1456,31 +1443,31 @@ function _t() {
|
|
|
1456
1443
|
}
|
|
1457
1444
|
//#endregion
|
|
1458
1445
|
//#region src/utils/search-params.ts
|
|
1459
|
-
function
|
|
1460
|
-
if (!
|
|
1446
|
+
function xt() {
|
|
1447
|
+
if (!s()) return {};
|
|
1461
1448
|
let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
|
|
1462
1449
|
for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
|
|
1463
1450
|
for (let r of n) {
|
|
1464
1451
|
let n = r.replace("picked-", "");
|
|
1465
1452
|
t[n] = e.getAll(r);
|
|
1466
1453
|
}
|
|
1467
|
-
let r =
|
|
1468
|
-
if (n.size > 0)
|
|
1454
|
+
let r = O("s");
|
|
1455
|
+
if (n.size > 0) D.set(r, t);
|
|
1469
1456
|
else {
|
|
1470
|
-
let e =
|
|
1457
|
+
let e = D.get(r);
|
|
1471
1458
|
if (e) return e.json() || {};
|
|
1472
1459
|
}
|
|
1473
1460
|
return t;
|
|
1474
1461
|
}
|
|
1475
1462
|
//#endregion
|
|
1476
1463
|
//#region src/entities/session/session.ts
|
|
1477
|
-
var
|
|
1478
|
-
function
|
|
1479
|
-
return
|
|
1464
|
+
var St = O("session", "global");
|
|
1465
|
+
function Ct() {
|
|
1466
|
+
return p() ? 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)}`;
|
|
1480
1467
|
}
|
|
1481
|
-
function
|
|
1482
|
-
if (!
|
|
1483
|
-
let e =
|
|
1468
|
+
function wt() {
|
|
1469
|
+
if (!m()) return null;
|
|
1470
|
+
let e = E.get(St);
|
|
1484
1471
|
if (!e.isSet()) return null;
|
|
1485
1472
|
try {
|
|
1486
1473
|
return e.json();
|
|
@@ -1488,8 +1475,8 @@ function xt() {
|
|
|
1488
1475
|
return null;
|
|
1489
1476
|
}
|
|
1490
1477
|
}
|
|
1491
|
-
var
|
|
1492
|
-
let e =
|
|
1478
|
+
var Tt = L(() => {
|
|
1479
|
+
let e = wt(), t = { id: e?.id ?? Ct() };
|
|
1493
1480
|
e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
|
|
1494
1481
|
let n = F(t), r = j(n, {
|
|
1495
1482
|
setIsUser: (e, t) => ({
|
|
@@ -1517,8 +1504,8 @@ var St = L(() => {
|
|
|
1517
1504
|
target: k({
|
|
1518
1505
|
source: n,
|
|
1519
1506
|
effect: (e) => {
|
|
1520
|
-
if (
|
|
1521
|
-
|
|
1507
|
+
if (m()) try {
|
|
1508
|
+
E.get(St).set(e);
|
|
1522
1509
|
} catch {}
|
|
1523
1510
|
}
|
|
1524
1511
|
})
|
|
@@ -1529,39 +1516,39 @@ var St = L(() => {
|
|
|
1529
1516
|
removeIdentifier: r.removeIdentifier
|
|
1530
1517
|
};
|
|
1531
1518
|
});
|
|
1532
|
-
function
|
|
1533
|
-
return R(
|
|
1519
|
+
function Et() {
|
|
1520
|
+
return R(Tt, void 0);
|
|
1534
1521
|
}
|
|
1535
1522
|
//#endregion
|
|
1536
1523
|
//#region src/utils/picked-config.ts
|
|
1537
|
-
function
|
|
1538
|
-
if (
|
|
1524
|
+
function Dt() {
|
|
1525
|
+
if (s()) return globalThis.window.pickedConfig;
|
|
1539
1526
|
}
|
|
1540
|
-
function
|
|
1541
|
-
if (
|
|
1527
|
+
function Ot() {
|
|
1528
|
+
if (s()) return Dt()?.projectId;
|
|
1542
1529
|
}
|
|
1543
|
-
function
|
|
1544
|
-
if (!
|
|
1530
|
+
function kt() {
|
|
1531
|
+
if (!c()) return;
|
|
1545
1532
|
let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
|
|
1546
1533
|
if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
|
|
1547
1534
|
}
|
|
1548
|
-
function
|
|
1535
|
+
function At(e) {
|
|
1549
1536
|
if (e.projectId) return e.projectId;
|
|
1550
|
-
let t =
|
|
1537
|
+
let t = Ot();
|
|
1551
1538
|
if (t) return t;
|
|
1552
|
-
let n =
|
|
1539
|
+
let n = kt();
|
|
1553
1540
|
if (n) return n;
|
|
1554
1541
|
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.");
|
|
1555
1542
|
}
|
|
1556
1543
|
//#endregion
|
|
1557
1544
|
//#region src/utils/render-string.ts
|
|
1558
|
-
function
|
|
1545
|
+
function Q(e) {
|
|
1559
1546
|
return e == null || e === "" || Number.isNaN(e);
|
|
1560
1547
|
}
|
|
1561
|
-
var
|
|
1562
|
-
default: (e, t) =>
|
|
1563
|
-
append: (e, t) => t &&
|
|
1564
|
-
prepend: (e, t) => t &&
|
|
1548
|
+
var jt = {
|
|
1549
|
+
default: (e, t) => Q(e) ? String(t ?? "") : String(e),
|
|
1550
|
+
append: (e, t) => t && !Q(e) ? `${e} ${t}` : e,
|
|
1551
|
+
prepend: (e, t) => t && !Q(e) ? `${t} ${e}` : e,
|
|
1565
1552
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
1566
1553
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
|
|
1567
1554
|
capitalize: (e) => typeof e == "string" ? e.charAt(0).toUpperCase() + e.slice(1) : e,
|
|
@@ -1579,24 +1566,24 @@ var Ot = {
|
|
|
1579
1566
|
return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
|
|
1580
1567
|
}
|
|
1581
1568
|
};
|
|
1582
|
-
function
|
|
1569
|
+
function Mt(e) {
|
|
1583
1570
|
return typeof e == "object" && !!e;
|
|
1584
1571
|
}
|
|
1585
|
-
function
|
|
1572
|
+
function Nt(e, t) {
|
|
1586
1573
|
let n = t;
|
|
1587
|
-
for (let t of e.split(".")) if (
|
|
1574
|
+
for (let t of e.split(".")) if (Mt(n) && t in n) n = n[t];
|
|
1588
1575
|
else return;
|
|
1589
1576
|
return typeof n == "function" ? n() : n;
|
|
1590
1577
|
}
|
|
1591
|
-
function
|
|
1592
|
-
let n = e.split("|").map((e) => e.trim()), r =
|
|
1578
|
+
function Pt(e, t) {
|
|
1579
|
+
let n = e.split("|").map((e) => e.trim()), r = Nt(n.shift() ?? "", t);
|
|
1593
1580
|
for (let e of n) {
|
|
1594
|
-
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o =
|
|
1581
|
+
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = jt[i];
|
|
1595
1582
|
o && (r = o(r, a));
|
|
1596
1583
|
}
|
|
1597
|
-
return
|
|
1584
|
+
return Q(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
|
|
1598
1585
|
}
|
|
1599
|
-
function
|
|
1586
|
+
function Ft(e, t) {
|
|
1600
1587
|
let n = "", r = 0;
|
|
1601
1588
|
for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
|
|
1602
1589
|
r += 2;
|
|
@@ -1608,13 +1595,13 @@ function Mt(e, t) {
|
|
|
1608
1595
|
}
|
|
1609
1596
|
i += e[r++];
|
|
1610
1597
|
}
|
|
1611
|
-
n +=
|
|
1598
|
+
n += Pt(i.trim(), t);
|
|
1612
1599
|
} else n += e[r++];
|
|
1613
1600
|
return n;
|
|
1614
1601
|
}
|
|
1615
1602
|
//#endregion
|
|
1616
1603
|
//#region src/picked.ts
|
|
1617
|
-
var
|
|
1604
|
+
var $ = class {
|
|
1618
1605
|
static logger = r;
|
|
1619
1606
|
options;
|
|
1620
1607
|
dataSource = null;
|
|
@@ -1626,62 +1613,66 @@ var Nt = class {
|
|
|
1626
1613
|
apiUrl;
|
|
1627
1614
|
dashboardUrl;
|
|
1628
1615
|
documentationSiteUrl;
|
|
1629
|
-
session =
|
|
1630
|
-
searchParams =
|
|
1631
|
-
history =
|
|
1632
|
-
components =
|
|
1616
|
+
session = Et();
|
|
1617
|
+
searchParams = xt();
|
|
1618
|
+
history = Ue();
|
|
1619
|
+
components = he({ client: this });
|
|
1633
1620
|
experienceInstances = S({ client: this });
|
|
1634
|
-
experiences =
|
|
1635
|
-
frameworks =
|
|
1636
|
-
predicates =
|
|
1637
|
-
features =
|
|
1638
|
-
conditions =
|
|
1639
|
-
fields =
|
|
1640
|
-
responses =
|
|
1641
|
-
steps =
|
|
1642
|
-
contents =
|
|
1643
|
-
actions =
|
|
1644
|
-
|
|
1645
|
-
|
|
1621
|
+
experiences = se({ client: this });
|
|
1622
|
+
frameworks = ve({ client: this });
|
|
1623
|
+
predicates = Ie({ client: this });
|
|
1624
|
+
features = ze({ client: this });
|
|
1625
|
+
conditions = yt();
|
|
1626
|
+
fields = Je();
|
|
1627
|
+
responses = gt({ client: this });
|
|
1628
|
+
steps = Ze();
|
|
1629
|
+
contents = tt();
|
|
1630
|
+
actions = at({ client: this });
|
|
1631
|
+
conditionResults = C();
|
|
1632
|
+
stateSnapshotStore = xe({ client: this });
|
|
1633
|
+
evaluateRuleLogicFx = Oe({ client: this });
|
|
1646
1634
|
start;
|
|
1647
1635
|
readyStore;
|
|
1648
1636
|
preconditionPassedStore;
|
|
1649
1637
|
conditionPassedStore;
|
|
1650
1638
|
lifecycleStageStore;
|
|
1651
|
-
lifecycle =
|
|
1639
|
+
lifecycle = Ne({ client: this });
|
|
1652
1640
|
renderStringFx = k({
|
|
1653
1641
|
source: this.responses.listStore,
|
|
1654
1642
|
effect: (e, { template: t, context: n }) => {
|
|
1655
1643
|
let r = {};
|
|
1656
1644
|
for (let t of e) r[t.fieldKey] = t.value;
|
|
1657
|
-
return
|
|
1645
|
+
return Ft(t, {
|
|
1658
1646
|
...n,
|
|
1659
1647
|
responses: r
|
|
1660
1648
|
});
|
|
1661
1649
|
}
|
|
1662
1650
|
});
|
|
1663
1651
|
constructor(e) {
|
|
1664
|
-
this.events =
|
|
1652
|
+
this.events = Ge(this.eventBus), this.projectId = At(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || bt(), 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.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
|
|
1665
1653
|
type: "load",
|
|
1666
|
-
version:
|
|
1667
|
-
});
|
|
1654
|
+
version: ne()
|
|
1655
|
+
}), this.maybeStartPreviewBridge();
|
|
1656
|
+
}
|
|
1657
|
+
maybeStartPreviewBridge() {
|
|
1658
|
+
!s() || !h() || this.searchParams["preview-token"]?.[0] && import("../preview-bridge-CGyx7dEx.js").then((e) => e.initPreviewBridge()).catch(() => void 0);
|
|
1668
1659
|
}
|
|
1669
1660
|
registerFramework = (e) => {
|
|
1670
|
-
|
|
1661
|
+
ye(e, this.frameworks);
|
|
1671
1662
|
};
|
|
1672
1663
|
registerComponent = (e, t) => {
|
|
1673
1664
|
B(e, t, this.components);
|
|
1674
1665
|
};
|
|
1675
1666
|
registerPlugin = (e) => {
|
|
1676
|
-
|
|
1667
|
+
ue(this, e, this.plugins);
|
|
1677
1668
|
let t = this.plugins[e.name];
|
|
1678
1669
|
t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
|
|
1679
1670
|
};
|
|
1680
1671
|
registerFeature = (e, t) => {
|
|
1681
|
-
|
|
1672
|
+
Be(e, t, this.features);
|
|
1682
1673
|
};
|
|
1683
1674
|
registerPredicate = (e, t) => {
|
|
1684
|
-
|
|
1675
|
+
Le(e, t, this.predicates);
|
|
1685
1676
|
};
|
|
1686
1677
|
registerCondition = (e) => {
|
|
1687
1678
|
this.conditions.register(e);
|
|
@@ -1690,13 +1681,13 @@ var Nt = class {
|
|
|
1690
1681
|
this.fields.register(e);
|
|
1691
1682
|
};
|
|
1692
1683
|
registerStep = (e) => {
|
|
1693
|
-
|
|
1684
|
+
Qe(e, this.steps);
|
|
1694
1685
|
};
|
|
1695
1686
|
registerContent = (e) => {
|
|
1696
|
-
|
|
1687
|
+
nt(e, this.contents);
|
|
1697
1688
|
};
|
|
1698
1689
|
registerAction = (e, t) => {
|
|
1699
|
-
|
|
1690
|
+
ot(e, t, this.actions);
|
|
1700
1691
|
};
|
|
1701
1692
|
registerExperience = (e) => {
|
|
1702
1693
|
e.component && B(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
|
|
@@ -1784,20 +1775,20 @@ var Nt = class {
|
|
|
1784
1775
|
};
|
|
1785
1776
|
//#endregion
|
|
1786
1777
|
//#region src/entities/component/lazyComponent.ts
|
|
1787
|
-
function
|
|
1778
|
+
function It(e) {
|
|
1788
1779
|
return {
|
|
1789
1780
|
$$type: "lazy-component",
|
|
1790
1781
|
load: e
|
|
1791
1782
|
};
|
|
1792
1783
|
}
|
|
1793
|
-
function
|
|
1784
|
+
function Lt(e) {
|
|
1794
1785
|
return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
|
|
1795
1786
|
}
|
|
1796
1787
|
//#endregion
|
|
1797
1788
|
//#region src/exports.ts
|
|
1798
|
-
var
|
|
1799
|
-
let t = new
|
|
1800
|
-
return
|
|
1789
|
+
var Rt = (e) => {
|
|
1790
|
+
let t = new $(e);
|
|
1791
|
+
return u(t), t;
|
|
1801
1792
|
};
|
|
1802
1793
|
//#endregion
|
|
1803
|
-
export {
|
|
1794
|
+
export { $ as Picked, Rt as createClient, le as createPluginEffect, O as createStorageKey, n as evaluateRuleLogic, Dt as getPickedConfig, h as isInsideIframe, Lt as isLazyLoader, _ as isPickedRoot, It as lazyComponent, E as localStore, D as sessionStore, T as subscribe, d as supportsCookies, p as supportsCryptoRandomUUID, c as supportsDocument, i as supportsHistory, f as supportsIntersectionObserver, m as supportsLocalStorage, a as supportsLocation, l as supportsSessionStorage, g as supportsShadowRoot, o as supportsWebComponents, s as supportsWindow };
|