@picked/client 0.0.1-dev.1772073931707 → 0.0.1-dev.1772083499814
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-CbXfbi_s.js +19 -0
- package/dist/api-DzSCgBQ2.cjs +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -0
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +662 -712
- package/dist/esm/plugins/create-experience/index.js +228 -194
- package/dist/esm/plugins/dynamic-experiences/index.js +115 -0
- package/dist/esm/plugins/web-components/index.js +5 -5
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-BsXG5XJ4.cjs +1 -0
- package/dist/{experience-instance-CLR80xop.js → experience-instance-fvSEb72i.js} +358 -358
- package/dist/types/client.d.ts +10 -12
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/action/action.d.ts +2 -5
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +2 -1
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/component/lazyComponent.d.ts +11 -0
- package/dist/types/entities/component/lazyComponent.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +49 -5
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +4 -3
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +14 -51
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +4 -1
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/exports.d.ts +2 -0
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/picked.d.ts +48 -18
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +23 -26
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/hash.d.ts +18 -0
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -0
- package/dist/types/plugins/dynamic-experiences/index.d.ts +3 -0
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -0
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +23 -0
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts +15 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -0
- package/dist/types/utils/api.d.ts +3 -0
- package/dist/types/utils/api.d.ts.map +1 -0
- package/dist/types/utils/get-step-fields.d.ts +1 -2
- package/dist/types/utils/get-step-fields.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/package.json +7 -1
- package/dist/experience-instance-5rr_D--s.cjs +0 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { createDomain as
|
|
2
|
-
import { createFactory as
|
|
3
|
-
import {
|
|
4
|
-
import { l as
|
|
5
|
-
import { i as
|
|
6
|
-
function
|
|
1
|
+
import { createDomain as kt, createEvent as k, combine as D, createApi as lt, createEffect as _, attach as O, sample as m, split as bt } from "effector";
|
|
2
|
+
import { createFactory as dt, invoke as pt } from "@withease/factories";
|
|
3
|
+
import { a as vt, s as gt, j as At } from "./supports-8YT4QKI7.js";
|
|
4
|
+
import { l as I } from "./logger-C9a75KZn.js";
|
|
5
|
+
import { i as Ot } from "./object-JwZ58NOH.js";
|
|
6
|
+
function Ft(t) {
|
|
7
7
|
return typeof t == "number" && !isNaN(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function j(t) {
|
|
10
10
|
return typeof t == "string";
|
|
11
11
|
}
|
|
12
12
|
function N(t) {
|
|
13
13
|
return Array.isArray(t);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function mt(t) {
|
|
16
16
|
return t instanceof Promise;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function st(t) {
|
|
19
19
|
return typeof t == "object" && t !== null && !Array.isArray(t) && Object.keys(t).length === 1;
|
|
20
20
|
}
|
|
21
21
|
function g(t) {
|
|
22
|
-
if (
|
|
22
|
+
if (Ft(t)) return t;
|
|
23
23
|
const e = parseFloat(`${t}`);
|
|
24
24
|
return isNaN(e) ? 0 : e;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function R(t) {
|
|
27
27
|
return `${t}`;
|
|
28
28
|
}
|
|
29
29
|
const Bt = {
|
|
@@ -38,32 +38,32 @@ const Bt = {
|
|
|
38
38
|
"<": (t, e, r) => {
|
|
39
39
|
const n = g(t), s = g(e);
|
|
40
40
|
if (r === void 0) return n < s;
|
|
41
|
-
const
|
|
42
|
-
return n < s && s <
|
|
41
|
+
const a = g(r);
|
|
42
|
+
return n < s && s < a;
|
|
43
43
|
},
|
|
44
44
|
"<=": (t, e, r) => {
|
|
45
45
|
const n = g(t), s = g(e);
|
|
46
46
|
if (r === void 0) return n <= s;
|
|
47
|
-
const
|
|
48
|
-
return n <= s && s <=
|
|
47
|
+
const a = g(r);
|
|
48
|
+
return n <= s && s <= a;
|
|
49
49
|
},
|
|
50
50
|
"!!": async (t) => await v(t),
|
|
51
51
|
"!": async (t) => !await v(t),
|
|
52
52
|
"%": (t, e) => g(t) % g(e),
|
|
53
53
|
// eslint-disable-next-line sonarjs/function-return-type
|
|
54
54
|
log: (t) => (console.log(t), t),
|
|
55
|
-
in: (t, e) => e ?
|
|
56
|
-
cat: (...t) => t.map(
|
|
55
|
+
in: (t, e) => e ? j(e) ? e.indexOf(R(t)) !== -1 : N(e) ? e.includes(t) : !1 : !1,
|
|
56
|
+
cat: (...t) => t.map(R).join(""),
|
|
57
57
|
/* eslint-disable sonarjs/deprecation */
|
|
58
58
|
substr: (t, e, r) => {
|
|
59
|
-
const n =
|
|
59
|
+
const n = R(t), s = g(e);
|
|
60
60
|
if (r === void 0) return n.substr(s);
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
61
|
+
const a = g(r);
|
|
62
|
+
if (a < 0) {
|
|
63
63
|
const o = n.substr(s);
|
|
64
|
-
return o.substr(0, o.length +
|
|
64
|
+
return o.substr(0, o.length + a);
|
|
65
65
|
}
|
|
66
|
-
return n.substr(s,
|
|
66
|
+
return n.substr(s, a);
|
|
67
67
|
},
|
|
68
68
|
/* eslint-enable sonarjs/deprecation */
|
|
69
69
|
"+": (...t) => t.reduce((e, r) => g(e) + g(r), 0),
|
|
@@ -82,21 +82,21 @@ const Bt = {
|
|
|
82
82
|
return this;
|
|
83
83
|
if (typeof t == "number" && Array.isArray(this))
|
|
84
84
|
return t >= 0 && t < this.length ? this[t] : r;
|
|
85
|
-
const n =
|
|
85
|
+
const n = R(t);
|
|
86
86
|
if (n === "" || n === ".")
|
|
87
87
|
return this;
|
|
88
88
|
const s = n.split(".");
|
|
89
|
-
let
|
|
89
|
+
let a = this;
|
|
90
90
|
for (const o of s) {
|
|
91
|
-
if (
|
|
91
|
+
if (a == null)
|
|
92
92
|
return r;
|
|
93
|
-
if (Array.isArray(
|
|
93
|
+
if (Array.isArray(a)) {
|
|
94
94
|
const u = parseInt(o, 10);
|
|
95
|
-
isNaN(u) ?
|
|
95
|
+
isNaN(u) ? a = a[o] : a = a[u];
|
|
96
96
|
} else
|
|
97
|
-
|
|
97
|
+
a = a[o];
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return a !== void 0 ? a : r;
|
|
100
100
|
},
|
|
101
101
|
async missing(...t) {
|
|
102
102
|
const e = N(t[0]) ? t[0] : t, r = [];
|
|
@@ -109,8 +109,8 @@ const Bt = {
|
|
|
109
109
|
async missing_some(t, e) {
|
|
110
110
|
const r = await p({ missing: e }, this);
|
|
111
111
|
if (!N(r) || !N(e)) return [];
|
|
112
|
-
const n = r.filter(
|
|
113
|
-
return e.filter(
|
|
112
|
+
const n = r.filter(j);
|
|
113
|
+
return e.filter(j).length - n.length >= g(t) ? [] : n;
|
|
114
114
|
},
|
|
115
115
|
/**
|
|
116
116
|
* Invoke operator - executes a function with optional arguments
|
|
@@ -131,23 +131,23 @@ const Bt = {
|
|
|
131
131
|
regexp_matches(t, e) {
|
|
132
132
|
let r = t, n = "";
|
|
133
133
|
if (N(t)) {
|
|
134
|
-
const [
|
|
135
|
-
r =
|
|
134
|
+
const [a, o] = t;
|
|
135
|
+
r = a, n = o;
|
|
136
136
|
}
|
|
137
|
-
return !
|
|
137
|
+
return !j(r) || !j(n) ? !1 : new RegExp(r, n).test(R(e));
|
|
138
138
|
},
|
|
139
139
|
throw(t) {
|
|
140
|
-
throw new Error(
|
|
140
|
+
throw new Error(R(t));
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
async function p(t, e) {
|
|
144
144
|
if (!t) return t;
|
|
145
|
-
if (
|
|
145
|
+
if (mt(t))
|
|
146
146
|
return p(await t, e);
|
|
147
147
|
if (N(t))
|
|
148
148
|
return Promise.all(t.map((o) => p(o, e)));
|
|
149
|
-
if (!
|
|
150
|
-
const r =
|
|
149
|
+
if (!st(t)) return t;
|
|
150
|
+
const r = _t(t);
|
|
151
151
|
let n = r ? t[r] ?? [] : [];
|
|
152
152
|
switch (N(n) || (n = [n]), r) {
|
|
153
153
|
case "if":
|
|
@@ -177,8 +177,8 @@ async function p(t, e) {
|
|
|
177
177
|
const o = await p(n[0], e);
|
|
178
178
|
return N(o) ? (await Promise.all(
|
|
179
179
|
o.map(async (d) => {
|
|
180
|
-
const
|
|
181
|
-
return { item: d, shouldInclude:
|
|
180
|
+
const y = await v(await p(n[1], d));
|
|
181
|
+
return { item: d, shouldInclude: y };
|
|
182
182
|
})
|
|
183
183
|
)).filter(({ shouldInclude: d }) => d).map(({ item: d }) => d) : [];
|
|
184
184
|
}
|
|
@@ -187,10 +187,10 @@ async function p(t, e) {
|
|
|
187
187
|
if (!N(o))
|
|
188
188
|
return n.length > 2 ? await p(n[2], e) : null;
|
|
189
189
|
const u = n[1];
|
|
190
|
-
let
|
|
191
|
-
for (const
|
|
192
|
-
|
|
193
|
-
return
|
|
190
|
+
let y = n.length > 2 ? await p(n[2], e) : null;
|
|
191
|
+
for (const b of o)
|
|
192
|
+
y = await p(u, { current: b, accumulator: y });
|
|
193
|
+
return y;
|
|
194
194
|
}
|
|
195
195
|
case "all": {
|
|
196
196
|
const o = await p(n[0], e);
|
|
@@ -217,36 +217,34 @@ async function p(t, e) {
|
|
|
217
217
|
try {
|
|
218
218
|
return await p(n[0], e);
|
|
219
219
|
} catch (o) {
|
|
220
|
-
return
|
|
220
|
+
return st(o) ? await p(o, e) : n[1] ? await p(n[1], o) : o instanceof Error ? o.message : o;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
const s = await Promise.all(n.map((o) => p(o, e))),
|
|
224
|
-
if (!
|
|
225
|
-
return
|
|
223
|
+
const s = await Promise.all(n.map((o) => p(o, e))), a = r ? Bt[r] : void 0;
|
|
224
|
+
if (!a) throw new Error(`Unrecognized operation ${r}`);
|
|
225
|
+
return a.apply(e, s);
|
|
226
226
|
}
|
|
227
227
|
async function v(t) {
|
|
228
|
-
return
|
|
228
|
+
return mt(t) ? v(await t) : !(Array.isArray(t) && t.length === 0) && !!t;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function _t(t) {
|
|
231
231
|
return Object.keys(t)[0];
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
return !
|
|
233
|
+
function $t(t) {
|
|
234
|
+
return !Ot(t);
|
|
235
235
|
}
|
|
236
|
-
async function
|
|
237
|
-
const n = t.getStateSnapshot(), s = t.predicates.listStore.getState().reduce((
|
|
238
|
-
...
|
|
239
|
-
[
|
|
240
|
-
}), {}),
|
|
241
|
-
...
|
|
242
|
-
[
|
|
243
|
-
const { bucket:
|
|
244
|
-
return
|
|
236
|
+
async function at(t, e, r) {
|
|
237
|
+
const n = t.getStateSnapshot(), s = t.predicates.listStore.getState().reduce((u, d) => ({
|
|
238
|
+
...u,
|
|
239
|
+
[d.name]: (...y) => d.predicate({ ...n, args: y })
|
|
240
|
+
}), {}), a = t.features.listStore.getState().reduce((u, d) => ({
|
|
241
|
+
...u,
|
|
242
|
+
[d.id]: async () => {
|
|
243
|
+
const { bucket: y } = await d.getBucket();
|
|
244
|
+
return y;
|
|
245
245
|
}
|
|
246
|
-
}), {}), o =
|
|
247
|
-
...
|
|
248
|
-
[m.name]: (w) => m.action(w)
|
|
249
|
-
}), {}), u = {
|
|
246
|
+
}), {}), o = {
|
|
247
|
+
...r,
|
|
250
248
|
responses: t.responses.getAllStore.getState(),
|
|
251
249
|
location: typeof n.location == "object" ? {
|
|
252
250
|
hash: n.location.hash,
|
|
@@ -260,50 +258,48 @@ async function st(t, e, r) {
|
|
|
260
258
|
search: n.location.search
|
|
261
259
|
} : void 0,
|
|
262
260
|
predicates: s,
|
|
263
|
-
features:
|
|
264
|
-
actions: o,
|
|
265
|
-
...r
|
|
261
|
+
features: a
|
|
266
262
|
};
|
|
267
|
-
return await p(e,
|
|
263
|
+
return await p(e, o);
|
|
268
264
|
}
|
|
269
|
-
function
|
|
270
|
-
return !
|
|
265
|
+
function Mt(t) {
|
|
266
|
+
return !vt() || !gt() ? [] : Array.from(window.document.querySelectorAll(t)).filter(
|
|
271
267
|
(e) => e instanceof HTMLElement
|
|
272
268
|
);
|
|
273
269
|
}
|
|
274
|
-
const
|
|
275
|
-
function
|
|
276
|
-
if (!
|
|
270
|
+
const Tt = "open";
|
|
271
|
+
function Lt(t) {
|
|
272
|
+
if (!At())
|
|
277
273
|
throw new Error("Shadow DOM is not supported in this environment");
|
|
278
|
-
return t.attachShadow({ mode:
|
|
274
|
+
return t.attachShadow({ mode: Tt });
|
|
279
275
|
}
|
|
280
|
-
function
|
|
276
|
+
function te() {
|
|
281
277
|
return new Promise((t, e) => {
|
|
282
|
-
if (!
|
|
278
|
+
if (!gt()) {
|
|
283
279
|
e();
|
|
284
280
|
return;
|
|
285
281
|
}
|
|
286
282
|
document.readyState !== "loading" ? t() : document.addEventListener("readystatechange", () => t(), { once: !0 });
|
|
287
283
|
});
|
|
288
284
|
}
|
|
289
|
-
function
|
|
285
|
+
function Dt(t, e) {
|
|
290
286
|
const r = new MutationObserver((n) => {
|
|
291
287
|
document.contains(t) || (r.disconnect(), e());
|
|
292
288
|
});
|
|
293
289
|
r.observe(document.body, { childList: !0, subtree: !0 });
|
|
294
290
|
}
|
|
295
|
-
const K = "picked-root", V = "picked-target",
|
|
296
|
-
function
|
|
291
|
+
const K = "picked-root", V = "picked-target", Rt = "picked-root";
|
|
292
|
+
function ee(t, e) {
|
|
297
293
|
return [
|
|
298
294
|
...t,
|
|
299
295
|
// Target and replace picked-root web components
|
|
300
296
|
{
|
|
301
|
-
selector: `${
|
|
297
|
+
selector: `${Rt}[experience-id="${e}"]`,
|
|
302
298
|
placement: "replace"
|
|
303
299
|
}
|
|
304
300
|
].flatMap((n) => {
|
|
305
|
-
const s =
|
|
306
|
-
(
|
|
301
|
+
const s = Mt(n.selector).filter(
|
|
302
|
+
(a) => !Pt(a, e) && !Ct(a, e)
|
|
307
303
|
);
|
|
308
304
|
return {
|
|
309
305
|
...n,
|
|
@@ -311,25 +307,25 @@ function te(t, e) {
|
|
|
311
307
|
};
|
|
312
308
|
});
|
|
313
309
|
}
|
|
314
|
-
function ee(t, e) {
|
|
315
|
-
return t.flatMap((r) => r.elements.map((n) => Ht(n, r.placement, e)));
|
|
316
|
-
}
|
|
317
310
|
function ne(t, e) {
|
|
311
|
+
return t.flatMap((r) => r.elements.map((n) => jt(n, r.placement, e)));
|
|
312
|
+
}
|
|
313
|
+
function re(t, e) {
|
|
318
314
|
t.classList.add(V), t.classList.add(`${V}-${e}`);
|
|
319
315
|
}
|
|
320
|
-
function
|
|
316
|
+
function Pt(t, e) {
|
|
321
317
|
return e ? t.classList.contains(`${V}-${e}`) : t.classList.contains(`${V}`);
|
|
322
318
|
}
|
|
323
|
-
function
|
|
319
|
+
function Ct(t, e) {
|
|
324
320
|
return e ? t.classList.contains(`${K}-${e}`) : t.classList.contains(K);
|
|
325
321
|
}
|
|
326
|
-
function
|
|
322
|
+
function Ht(t) {
|
|
327
323
|
const e = document.createElement("div");
|
|
328
324
|
return e.style.display = "block", e.classList.add(K), e.classList.add(`${K}-${t}`), e;
|
|
329
325
|
}
|
|
330
|
-
function
|
|
326
|
+
function jt(t, e, r) {
|
|
331
327
|
let n;
|
|
332
|
-
const s =
|
|
328
|
+
const s = Ht(r);
|
|
333
329
|
if (t instanceof Document)
|
|
334
330
|
n = t.body.appendChild(s);
|
|
335
331
|
else {
|
|
@@ -357,212 +353,212 @@ function Ht(t, e, r) {
|
|
|
357
353
|
function ct(t) {
|
|
358
354
|
return t.type === "conditional";
|
|
359
355
|
}
|
|
360
|
-
function
|
|
356
|
+
function P(t) {
|
|
361
357
|
return t.type === "step";
|
|
362
358
|
}
|
|
363
|
-
function
|
|
359
|
+
function ut(t) {
|
|
364
360
|
return t.type === "experience";
|
|
365
361
|
}
|
|
366
|
-
function
|
|
362
|
+
function Y(t) {
|
|
367
363
|
return t.type === "origin";
|
|
368
364
|
}
|
|
369
|
-
function
|
|
365
|
+
function ft(t) {
|
|
370
366
|
return t.type === "action";
|
|
371
367
|
}
|
|
372
|
-
const
|
|
368
|
+
const St = (t, e, r, n, s = /* @__PURE__ */ new Set()) => s.has(r.id) ? [] : (s.add(r.id), P(r) && !n ? [r] : e.filter((o) => o.sourceNodeId === r.id).flatMap((o) => {
|
|
373
369
|
const u = t.find((d) => d.id === o.destinationNodeId);
|
|
374
|
-
return u ?
|
|
375
|
-
})),
|
|
370
|
+
return u ? St(t, e, u, !1, s) : [];
|
|
371
|
+
})), Ut = (t, e, r) => St(t, e, r, !0, /* @__PURE__ */ new Set()), yt = (t, e, r, n, s = /* @__PURE__ */ new Set()) => {
|
|
376
372
|
if (s.has(r.id)) return [-1, -1];
|
|
377
373
|
s.add(r.id);
|
|
378
|
-
const
|
|
379
|
-
if (
|
|
374
|
+
const a = e.filter((d) => d.sourceNodeId === r.id);
|
|
375
|
+
if (a.length === 0) return [0, 0];
|
|
380
376
|
let o = 1 / 0, u = -1 / 0;
|
|
381
|
-
for (const d of
|
|
382
|
-
const
|
|
383
|
-
if (!
|
|
384
|
-
const [
|
|
377
|
+
for (const d of a) {
|
|
378
|
+
const y = t.find((M) => M.id === d.destinationNodeId);
|
|
379
|
+
if (!y) continue;
|
|
380
|
+
const [b, F] = yt(
|
|
385
381
|
t,
|
|
386
382
|
e,
|
|
387
|
-
|
|
383
|
+
y,
|
|
388
384
|
!1,
|
|
389
385
|
new Set(s)
|
|
390
386
|
);
|
|
391
|
-
|
|
387
|
+
b !== -1 && (o = Math.min(o, b + 1), u = Math.max(u, F + 1));
|
|
392
388
|
}
|
|
393
389
|
return o === 1 / 0 ? [-1, -1] : [o, u];
|
|
394
|
-
},
|
|
390
|
+
}, Wt = (t, e, r) => yt(t, e, r, !0, /* @__PURE__ */ new Set()), ht = (t, e, r, n = /* @__PURE__ */ new Set()) => {
|
|
395
391
|
if (n.has(r.id)) return [-1, -1];
|
|
396
392
|
if (n.add(r.id), r.type === "origin") return [0, 0];
|
|
397
393
|
const s = e.filter((u) => u.destinationNodeId === r.id);
|
|
398
394
|
if (s.length === 0) return [-1, -1];
|
|
399
|
-
let
|
|
395
|
+
let a = 1 / 0, o = -1 / 0;
|
|
400
396
|
for (const u of s) {
|
|
401
397
|
const d = t.find((F) => F.id === u.sourceNodeId);
|
|
402
398
|
if (!d) continue;
|
|
403
|
-
const [
|
|
399
|
+
const [y, b] = ht(
|
|
404
400
|
t,
|
|
405
401
|
e,
|
|
406
402
|
d,
|
|
407
403
|
new Set(n)
|
|
408
404
|
);
|
|
409
|
-
|
|
405
|
+
y !== -1 && (a = Math.min(a, y + 1), o = Math.max(o, b + 1));
|
|
410
406
|
}
|
|
411
|
-
return
|
|
412
|
-
},
|
|
407
|
+
return a === 1 / 0 ? [-1, -1] : [a, o];
|
|
408
|
+
}, Gt = (t, e, r) => ht(t, e, r, /* @__PURE__ */ new Set()), wt = (t) => t.find((r) => r.type === "origin") || null, Z = (t, e, r) => {
|
|
413
409
|
if (!t)
|
|
414
|
-
return
|
|
415
|
-
const n = r.find((
|
|
410
|
+
return wt(e);
|
|
411
|
+
const n = r.find((a) => a.sourceNodeId === t.id);
|
|
416
412
|
if (!n)
|
|
417
413
|
return null;
|
|
418
|
-
const s = e.find((
|
|
414
|
+
const s = e.find((a) => a.id === n.destinationNodeId);
|
|
419
415
|
return s || null;
|
|
420
416
|
};
|
|
421
|
-
async function
|
|
422
|
-
const s = t ? "true" : "false",
|
|
417
|
+
async function Kt(t, e, r, n) {
|
|
418
|
+
const s = t ? "true" : "false", a = n.find(
|
|
423
419
|
(o) => o.sourceNodeHandle === s && o.sourceNodeId === e
|
|
424
420
|
);
|
|
425
|
-
return r.find((o) => o.id ===
|
|
421
|
+
return r.find((o) => o.id === a?.destinationNodeId);
|
|
426
422
|
}
|
|
427
|
-
const
|
|
423
|
+
const tt = kt("experience-instance"), Vt = dt(
|
|
428
424
|
({
|
|
429
425
|
client: t,
|
|
430
426
|
experience: e,
|
|
431
|
-
target: r
|
|
427
|
+
target: r,
|
|
428
|
+
options: n
|
|
432
429
|
}) => {
|
|
433
|
-
const
|
|
430
|
+
const s = k(), a = k(), o = k(), u = k(), d = k(), y = k(), b = e.componentStore, F = tt.store("transitioning"), M = t.history.entriesStore.map((i) => i.filter((l) => l.experienceId === e.id)), U = M.map((i) => i.filter((l) => P(l.node))), c = M.map((i) => i.at(-1)?.node || null), S = D(
|
|
434
431
|
e.treeStore,
|
|
435
|
-
|
|
436
|
-
({ steps: i }, l) => i.find((
|
|
437
|
-
),
|
|
432
|
+
c,
|
|
433
|
+
({ steps: i }, l) => i.find((f) => l && P(l) && f.id === l.stepId) || null
|
|
434
|
+
), x = D(
|
|
438
435
|
e.treeStore,
|
|
439
|
-
|
|
436
|
+
U,
|
|
440
437
|
({ steps: i }, l) => {
|
|
441
|
-
const
|
|
442
|
-
if (!
|
|
438
|
+
const f = l.at(-2);
|
|
439
|
+
if (!f || !P(f.node))
|
|
443
440
|
return null;
|
|
444
|
-
const h =
|
|
445
|
-
return i.find((
|
|
441
|
+
const h = f.node;
|
|
442
|
+
return i.find((B) => B.id === h.stepId) || null;
|
|
446
443
|
}
|
|
447
|
-
),
|
|
444
|
+
), T = D(
|
|
448
445
|
e.treeStore,
|
|
449
|
-
|
|
450
|
-
({ nodes: i, edges: l },
|
|
451
|
-
),
|
|
446
|
+
c,
|
|
447
|
+
({ nodes: i, edges: l }, f) => f ? Ut(i, l, f) : []
|
|
448
|
+
), C = D(
|
|
452
449
|
e.treeStore,
|
|
453
|
-
|
|
454
|
-
({ nodes: i, edges: l },
|
|
455
|
-
),
|
|
450
|
+
c,
|
|
451
|
+
({ nodes: i, edges: l }, f) => f ? Gt(i, l, f) : [-1, -1]
|
|
452
|
+
), q = D(
|
|
456
453
|
e.treeStore,
|
|
457
|
-
|
|
458
|
-
({ nodes: i, edges: l },
|
|
459
|
-
),
|
|
454
|
+
c,
|
|
455
|
+
({ nodes: i, edges: l }, f) => f ? Wt(i, l, f) : [-1, -1]
|
|
456
|
+
), L = tt.store(!1), W = lt(L, {
|
|
460
457
|
open: () => !0,
|
|
461
458
|
close: () => !1,
|
|
462
459
|
toggle: (i) => !i,
|
|
463
460
|
set: (i, l) => l
|
|
464
|
-
}),
|
|
461
|
+
}), xt = _(async () => {
|
|
465
462
|
t.history.back({ experienceId: e.id });
|
|
466
|
-
}),
|
|
463
|
+
}), Nt = O({
|
|
467
464
|
source: e.treeStore,
|
|
468
465
|
effect: async (i, l) => {
|
|
469
|
-
const
|
|
470
|
-
|
|
466
|
+
const f = i.nodes.find((h) => P(h) && h.stepId === l);
|
|
467
|
+
f && t.history.push({ experienceId: e.id, node: f });
|
|
471
468
|
}
|
|
472
|
-
}),
|
|
473
|
-
source:
|
|
469
|
+
}), et = O({
|
|
470
|
+
source: c,
|
|
474
471
|
effect: (i) => {
|
|
475
472
|
}
|
|
476
|
-
}),
|
|
473
|
+
}), z = O({
|
|
477
474
|
source: e.treeStore,
|
|
478
|
-
effect: async ({ nodes: i }) =>
|
|
479
|
-
}),
|
|
475
|
+
effect: async ({ nodes: i }) => wt(i)
|
|
476
|
+
}), X = O({
|
|
480
477
|
source: e.treeStore,
|
|
481
|
-
effect: async ({ nodes: i, edges: l },
|
|
482
|
-
if (
|
|
483
|
-
return
|
|
478
|
+
effect: async ({ nodes: i, edges: l }, f) => {
|
|
479
|
+
if (Y(f))
|
|
480
|
+
return Z(f, i, l);
|
|
484
481
|
}
|
|
485
|
-
}),
|
|
482
|
+
}), J = O({
|
|
486
483
|
source: e.treeStore,
|
|
487
|
-
effect: async ({ nodes: i, edges: l, conditionals:
|
|
484
|
+
effect: async ({ nodes: i, edges: l, conditionals: f }, h) => {
|
|
488
485
|
if (!ct(h))
|
|
489
486
|
return;
|
|
490
|
-
const
|
|
491
|
-
if (
|
|
487
|
+
const B = f.find((A) => A.id === h.conditionalId);
|
|
488
|
+
if (!B)
|
|
492
489
|
return;
|
|
493
|
-
const
|
|
494
|
-
return
|
|
490
|
+
const E = h.id, w = await at(t, B.condition);
|
|
491
|
+
return Kt(!!w, E, i, l);
|
|
495
492
|
}
|
|
496
|
-
}),
|
|
493
|
+
}), nt = O({
|
|
497
494
|
source: e.treeStore,
|
|
498
|
-
effect: async ({ nodes: i, edges: l },
|
|
499
|
-
if (!
|
|
495
|
+
effect: async ({ nodes: i, edges: l }, f) => {
|
|
496
|
+
if (!ft(f))
|
|
500
497
|
return;
|
|
501
|
-
const h =
|
|
498
|
+
const h = f.action;
|
|
502
499
|
if (!h) {
|
|
503
|
-
|
|
500
|
+
I("warn", `Action node ${f.id} has no action name`);
|
|
504
501
|
return;
|
|
505
502
|
}
|
|
506
|
-
const
|
|
507
|
-
if (
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
(
|
|
503
|
+
const B = t.actions.getByName(h).getState();
|
|
504
|
+
if (!B) {
|
|
505
|
+
I("warn", `Action '${h}' not registered on client`);
|
|
506
|
+
const E = l.find(
|
|
507
|
+
(w) => w.sourceNodeId === f.id && w.sourceNodeHandle === "false"
|
|
511
508
|
);
|
|
512
|
-
return
|
|
509
|
+
return E ? i.find((w) => w.id === E.destinationNodeId) : null;
|
|
513
510
|
}
|
|
514
|
-
if (typeof
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
(
|
|
511
|
+
if (typeof B.action != "function") {
|
|
512
|
+
I("warn", `Action '${h}' is not a function`);
|
|
513
|
+
const E = l.find(
|
|
514
|
+
(w) => w.sourceNodeId === f.id && w.sourceNodeHandle === "false"
|
|
518
515
|
);
|
|
519
|
-
return
|
|
516
|
+
return E ? i.find((w) => w.id === E.destinationNodeId) : null;
|
|
520
517
|
}
|
|
521
518
|
try {
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
(
|
|
519
|
+
I("info", `Executing action: ${h}`), await B.action(h);
|
|
520
|
+
const E = l.find(
|
|
521
|
+
(A) => A.sourceNodeId === f.id && A.sourceNodeHandle === "true"
|
|
525
522
|
);
|
|
526
|
-
if (!
|
|
527
|
-
return
|
|
528
|
-
const
|
|
529
|
-
return
|
|
530
|
-
} catch (
|
|
531
|
-
|
|
532
|
-
const
|
|
533
|
-
(G) => G.sourceNodeId ===
|
|
523
|
+
if (!E)
|
|
524
|
+
return I("warn", `No 'true' edge found for action node ${f.id}`), null;
|
|
525
|
+
const w = i.find((A) => A.id === E.destinationNodeId);
|
|
526
|
+
return I("info", `Action '${h}' succeeded, moving to node ${w?.id}`), w || null;
|
|
527
|
+
} catch (E) {
|
|
528
|
+
I("warn", `Action '${h}' failed:`, E);
|
|
529
|
+
const w = l.find(
|
|
530
|
+
(G) => G.sourceNodeId === f.id && G.sourceNodeHandle === "false"
|
|
534
531
|
);
|
|
535
|
-
if (!
|
|
536
|
-
return
|
|
537
|
-
const
|
|
538
|
-
return
|
|
532
|
+
if (!w)
|
|
533
|
+
return I("warn", `No 'false' edge found for action node ${f.id}`), null;
|
|
534
|
+
const A = i.find((G) => G.id === w.destinationNodeId);
|
|
535
|
+
return I("info", `Action '${h}' failed, moving to node ${A?.id}`), A || null;
|
|
539
536
|
}
|
|
540
537
|
}
|
|
541
|
-
}),
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}), Et = M((i) => {
|
|
538
|
+
}), It = _((i) => {
|
|
539
|
+
ut(i) && t.experiences.launch({ id: i.experienceId });
|
|
540
|
+
}), rt = O({
|
|
541
|
+
source: [c, e.treeStore],
|
|
542
|
+
effect: async ([i, { nodes: l, edges: f }]) => Z(i, l, f)
|
|
543
|
+
}), H = O({
|
|
544
|
+
source: [c, e.treeStore],
|
|
545
|
+
effect: async ([i, { nodes: l, edges: f }]) => Z(i, l, f)
|
|
546
|
+
}), Et = _((i) => {
|
|
551
547
|
t.history.push({ experienceId: e.id, node: i });
|
|
552
|
-
}),
|
|
548
|
+
}), ot = O({
|
|
553
549
|
source: e.configStore,
|
|
554
|
-
effect: async ({ initializeOpenLogic: i }) =>
|
|
555
|
-
}),
|
|
550
|
+
effect: async ({ initializeOpenLogic: i }) => n?.initialiseOpen !== void 0 ? n.initialiseOpen : $t(i) ? !!await at(t, i) : i ?? !1
|
|
551
|
+
}), $ = Object.freeze({
|
|
556
552
|
id: Math.random().toString(36).substring(7),
|
|
557
553
|
// config
|
|
558
554
|
experienceId: e.id,
|
|
559
555
|
configStore: e.configStore,
|
|
560
556
|
target: r,
|
|
561
|
-
componentStore:
|
|
557
|
+
componentStore: b,
|
|
562
558
|
// state
|
|
563
|
-
stateStore:
|
|
559
|
+
stateStore: F,
|
|
564
560
|
// open close
|
|
565
|
-
isOpenStore:
|
|
561
|
+
isOpenStore: L,
|
|
566
562
|
open: W.open,
|
|
567
563
|
close: W.close,
|
|
568
564
|
toggleOpen: W.toggle,
|
|
@@ -570,250 +566,254 @@ const Z = It("experience-instance"), Kt = lt(
|
|
|
570
566
|
// nodes
|
|
571
567
|
treeStore: e.treeStore,
|
|
572
568
|
fieldsStore: e.fieldsStore,
|
|
573
|
-
currentNodeStore:
|
|
574
|
-
currentStepStore:
|
|
575
|
-
previousStepStore:
|
|
576
|
-
nextReachableStepNodesStore:
|
|
577
|
-
stepsToOriginStore:
|
|
578
|
-
stepsToLeafStore:
|
|
569
|
+
currentNodeStore: c,
|
|
570
|
+
currentStepStore: S,
|
|
571
|
+
previousStepStore: x,
|
|
572
|
+
nextReachableStepNodesStore: T,
|
|
573
|
+
stepsToOriginStore: C,
|
|
574
|
+
stepsToLeafStore: q,
|
|
579
575
|
// history
|
|
580
|
-
goToNextStep:
|
|
581
|
-
goToPreviousStep:
|
|
582
|
-
goToStepById:
|
|
583
|
-
stepsHistoryStore:
|
|
584
|
-
}),
|
|
585
|
-
return
|
|
586
|
-
source:
|
|
587
|
-
target:
|
|
588
|
-
}),
|
|
589
|
-
clock:
|
|
576
|
+
goToNextStep: a,
|
|
577
|
+
goToPreviousStep: o,
|
|
578
|
+
goToStepById: u,
|
|
579
|
+
stepsHistoryStore: U
|
|
580
|
+
}), Q = k(), it = k();
|
|
581
|
+
return m({
|
|
582
|
+
source: c,
|
|
583
|
+
target: Q
|
|
584
|
+
}), m({
|
|
585
|
+
clock: Q,
|
|
590
586
|
filter: (i) => i === null,
|
|
591
|
-
target:
|
|
592
|
-
}),
|
|
593
|
-
clock:
|
|
587
|
+
target: z
|
|
588
|
+
}), m({
|
|
589
|
+
clock: Q,
|
|
594
590
|
filter: (i) => i !== null,
|
|
595
|
-
target:
|
|
596
|
-
}),
|
|
597
|
-
source:
|
|
598
|
-
match: (i) => ct(i) ? "condition" :
|
|
591
|
+
target: it
|
|
592
|
+
}), bt({
|
|
593
|
+
source: it,
|
|
594
|
+
match: (i) => ct(i) ? "condition" : P(i) ? "step" : ut(i) ? "launchExperience" : Y(i) ? "origin" : ft(i) ? "action" : "other",
|
|
599
595
|
cases: {
|
|
600
|
-
origin:
|
|
601
|
-
condition:
|
|
602
|
-
step:
|
|
603
|
-
launchExperience:
|
|
604
|
-
action:
|
|
605
|
-
__:
|
|
596
|
+
origin: X,
|
|
597
|
+
condition: J,
|
|
598
|
+
step: et,
|
|
599
|
+
launchExperience: It,
|
|
600
|
+
action: nt,
|
|
601
|
+
__: k()
|
|
606
602
|
}
|
|
607
|
-
}),
|
|
603
|
+
}), m({
|
|
608
604
|
clock: [
|
|
605
|
+
J.doneData,
|
|
609
606
|
X.doneData,
|
|
610
607
|
z.doneData,
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
nt.doneData
|
|
614
|
-
et.doneData
|
|
608
|
+
H.doneData,
|
|
609
|
+
rt.doneData,
|
|
610
|
+
nt.doneData
|
|
615
611
|
],
|
|
616
612
|
filter: Boolean,
|
|
617
613
|
target: Et
|
|
618
|
-
}),
|
|
619
|
-
clock:
|
|
620
|
-
target:
|
|
621
|
-
}),
|
|
622
|
-
clock:
|
|
623
|
-
source:
|
|
614
|
+
}), m({
|
|
615
|
+
clock: a,
|
|
616
|
+
target: H
|
|
617
|
+
}), m({
|
|
618
|
+
clock: a,
|
|
619
|
+
source: S,
|
|
624
620
|
filter: Boolean,
|
|
625
621
|
target: t.eventBus.prepend((i) => ({
|
|
626
622
|
type: "step_submit",
|
|
627
623
|
step: i,
|
|
628
|
-
experience:
|
|
624
|
+
experience: $
|
|
629
625
|
}))
|
|
630
|
-
}),
|
|
631
|
-
clock:
|
|
632
|
-
source:
|
|
626
|
+
}), m({
|
|
627
|
+
clock: H.done,
|
|
628
|
+
source: S,
|
|
633
629
|
filter: Boolean,
|
|
634
630
|
target: t.eventBus.prepend((i) => ({
|
|
635
631
|
type: "step_submit_success",
|
|
636
632
|
step: i,
|
|
637
|
-
experience:
|
|
633
|
+
experience: $
|
|
638
634
|
}))
|
|
639
|
-
}),
|
|
640
|
-
clock:
|
|
641
|
-
source:
|
|
635
|
+
}), m({
|
|
636
|
+
clock: H.fail,
|
|
637
|
+
source: S,
|
|
642
638
|
filter: Boolean,
|
|
643
639
|
target: t.eventBus.prepend((i) => ({
|
|
644
640
|
type: "step_submit_error",
|
|
645
641
|
step: i,
|
|
646
|
-
experience:
|
|
642
|
+
experience: $
|
|
647
643
|
}))
|
|
648
|
-
}),
|
|
649
|
-
clock:
|
|
650
|
-
target:
|
|
651
|
-
}),
|
|
652
|
-
source:
|
|
644
|
+
}), m({
|
|
645
|
+
clock: o,
|
|
646
|
+
target: xt
|
|
647
|
+
}), m({ clock: u, target: Nt }), m({
|
|
648
|
+
source: D([
|
|
649
|
+
J.pending,
|
|
653
650
|
X.pending,
|
|
654
651
|
z.pending,
|
|
655
|
-
|
|
656
|
-
j.pending
|
|
652
|
+
H.pending
|
|
657
653
|
]),
|
|
658
654
|
fn: (i) => i.some(Boolean) ? "transitioning" : "ready",
|
|
659
|
-
target:
|
|
660
|
-
}),
|
|
661
|
-
clock:
|
|
662
|
-
source:
|
|
655
|
+
target: F
|
|
656
|
+
}), m({
|
|
657
|
+
clock: et.doneData,
|
|
658
|
+
source: S,
|
|
663
659
|
filter: Boolean,
|
|
664
660
|
target: t.eventBus.prepend((i) => ({
|
|
665
661
|
type: "step_enter",
|
|
666
662
|
step: i,
|
|
667
|
-
experience:
|
|
663
|
+
experience: $
|
|
668
664
|
}))
|
|
669
|
-
}),
|
|
670
|
-
clock:
|
|
671
|
-
target:
|
|
672
|
-
}),
|
|
673
|
-
source:
|
|
665
|
+
}), m({
|
|
666
|
+
clock: y,
|
|
667
|
+
target: ot
|
|
668
|
+
}), m({
|
|
669
|
+
source: ot.doneData,
|
|
674
670
|
fn: Boolean,
|
|
675
|
-
target:
|
|
676
|
-
}),
|
|
677
|
-
source:
|
|
678
|
-
clock:
|
|
679
|
-
filter: (i) => i ?
|
|
680
|
-
target:
|
|
681
|
-
}),
|
|
682
|
-
source:
|
|
671
|
+
target: L
|
|
672
|
+
}), m({
|
|
673
|
+
source: c,
|
|
674
|
+
clock: s,
|
|
675
|
+
filter: (i) => i ? Y(i) : !0,
|
|
676
|
+
target: rt
|
|
677
|
+
}), m({
|
|
678
|
+
source: L,
|
|
683
679
|
filter: Boolean,
|
|
684
|
-
target:
|
|
685
|
-
}),
|
|
686
|
-
source:
|
|
680
|
+
target: s
|
|
681
|
+
}), m({
|
|
682
|
+
source: L,
|
|
687
683
|
filter: Boolean,
|
|
688
684
|
target: t.eventBus.prepend(() => ({
|
|
689
685
|
type: "experience_open",
|
|
690
|
-
experience:
|
|
686
|
+
experience: $
|
|
691
687
|
}))
|
|
692
|
-
}),
|
|
693
|
-
source:
|
|
688
|
+
}), m({
|
|
689
|
+
source: L,
|
|
694
690
|
filter: (i) => !i,
|
|
695
691
|
target: t.eventBus.prepend(() => ({
|
|
696
692
|
type: "experience_close",
|
|
697
|
-
experience:
|
|
693
|
+
experience: $
|
|
698
694
|
}))
|
|
699
|
-
}),
|
|
700
|
-
clock:
|
|
701
|
-
target: [
|
|
702
|
-
}),
|
|
695
|
+
}), m({
|
|
696
|
+
clock: d,
|
|
697
|
+
target: [y]
|
|
698
|
+
}), d(), $;
|
|
703
699
|
}
|
|
704
700
|
);
|
|
705
|
-
function
|
|
706
|
-
return
|
|
701
|
+
function qt(t) {
|
|
702
|
+
return pt(Vt, t);
|
|
707
703
|
}
|
|
708
|
-
const
|
|
709
|
-
const e =
|
|
710
|
-
register(
|
|
711
|
-
const
|
|
712
|
-
...
|
|
704
|
+
const zt = dt(({ client: t }) => {
|
|
705
|
+
const e = tt.store({}), r = k(), n = k(), s = k(), a = lt(e, {
|
|
706
|
+
register(c, S) {
|
|
707
|
+
const x = [
|
|
708
|
+
...c[S.experienceId] ?? []
|
|
713
709
|
];
|
|
714
|
-
return
|
|
715
|
-
...
|
|
716
|
-
[
|
|
710
|
+
return x.push(S), {
|
|
711
|
+
...c,
|
|
712
|
+
[S.experienceId]: x
|
|
717
713
|
};
|
|
718
714
|
},
|
|
719
|
-
unregister(
|
|
720
|
-
const
|
|
721
|
-
(
|
|
715
|
+
unregister(c, S) {
|
|
716
|
+
const x = S.experienceId, T = c[x]?.filter(
|
|
717
|
+
(C) => C !== S
|
|
722
718
|
);
|
|
723
719
|
return {
|
|
724
|
-
...
|
|
725
|
-
[
|
|
720
|
+
...c,
|
|
721
|
+
[x]: T ?? []
|
|
726
722
|
};
|
|
727
723
|
}
|
|
728
|
-
}), o =
|
|
729
|
-
({
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
724
|
+
}), o = _(
|
|
725
|
+
({
|
|
726
|
+
experience: c,
|
|
727
|
+
target: S,
|
|
728
|
+
options: x
|
|
729
|
+
}) => qt({ client: t, experience: c, target: S, options: x })
|
|
730
|
+
), u = _((c) => {
|
|
731
|
+
a.register(c);
|
|
732
|
+
}), d = _(
|
|
733
|
+
(c) => {
|
|
734
|
+
c.target && Dt(c.target, () => {
|
|
735
|
+
s(c);
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
|
-
),
|
|
739
|
-
|
|
740
|
-
}),
|
|
741
|
-
const
|
|
742
|
-
if (!
|
|
743
|
-
|
|
738
|
+
), y = _((c) => {
|
|
739
|
+
a.unregister(c);
|
|
740
|
+
}), b = _((c) => {
|
|
741
|
+
const S = c.componentStore.getState();
|
|
742
|
+
if (!S) {
|
|
743
|
+
I("warn", "No app component registered. Skipping init.");
|
|
744
744
|
return;
|
|
745
745
|
}
|
|
746
|
-
const
|
|
747
|
-
if (!
|
|
748
|
-
|
|
746
|
+
const x = S.frameworkStore.getState();
|
|
747
|
+
if (!x) {
|
|
748
|
+
I(
|
|
749
749
|
"error",
|
|
750
|
-
`No framework registered for component '${
|
|
750
|
+
`No framework registered for component '${S.name}'. Skipping rendering.`
|
|
751
751
|
);
|
|
752
752
|
return;
|
|
753
753
|
}
|
|
754
|
-
const
|
|
755
|
-
if (!
|
|
756
|
-
|
|
754
|
+
const T = c.target;
|
|
755
|
+
if (!T) {
|
|
756
|
+
I(
|
|
757
757
|
"error",
|
|
758
|
-
`No target element registered for experience '${
|
|
758
|
+
`No target element registered for experience '${c.experienceId}'. Skipping rendering.`
|
|
759
759
|
);
|
|
760
760
|
return;
|
|
761
761
|
}
|
|
762
|
-
const
|
|
762
|
+
const C = Lt(T);
|
|
763
763
|
try {
|
|
764
|
-
|
|
765
|
-
} catch (
|
|
766
|
-
|
|
764
|
+
x.render(C, S.component, t, c);
|
|
765
|
+
} catch (q) {
|
|
766
|
+
I("error", q);
|
|
767
767
|
}
|
|
768
768
|
});
|
|
769
|
-
|
|
769
|
+
m({
|
|
770
770
|
clock: r,
|
|
771
771
|
target: o
|
|
772
|
-
}),
|
|
772
|
+
}), m({
|
|
773
773
|
clock: s,
|
|
774
|
-
target:
|
|
775
|
-
}),
|
|
774
|
+
target: y
|
|
775
|
+
}), m({
|
|
776
776
|
clock: o.doneData,
|
|
777
777
|
target: [
|
|
778
778
|
u,
|
|
779
779
|
d,
|
|
780
780
|
n
|
|
781
781
|
]
|
|
782
|
-
}),
|
|
782
|
+
}), m({
|
|
783
783
|
clock: o.doneData,
|
|
784
|
-
target: t.eventBus.prepend((
|
|
784
|
+
target: t.eventBus.prepend((c) => ({
|
|
785
785
|
type: "experience_initialize",
|
|
786
|
-
experience:
|
|
786
|
+
experience: c
|
|
787
787
|
}))
|
|
788
|
-
}),
|
|
788
|
+
}), m({
|
|
789
789
|
clock: n,
|
|
790
|
-
target:
|
|
790
|
+
target: b
|
|
791
791
|
});
|
|
792
|
-
function F(
|
|
793
|
-
r({ experience:
|
|
792
|
+
function F(c, S, x) {
|
|
793
|
+
r({ experience: c, target: S, options: x });
|
|
794
794
|
}
|
|
795
|
-
const
|
|
796
|
-
function
|
|
797
|
-
return e.map((
|
|
795
|
+
const M = e.map((c) => Object.values(c).flat());
|
|
796
|
+
function U(c) {
|
|
797
|
+
return e.map((S) => S[c] || [], { skipVoid: !1 });
|
|
798
798
|
}
|
|
799
799
|
return {
|
|
800
800
|
spawn: F,
|
|
801
|
-
getByExperienceId:
|
|
802
|
-
listStore:
|
|
801
|
+
getByExperienceId: U,
|
|
802
|
+
listStore: M
|
|
803
803
|
};
|
|
804
804
|
});
|
|
805
|
-
function
|
|
806
|
-
return
|
|
805
|
+
function oe(t) {
|
|
806
|
+
return pt(zt, t);
|
|
807
807
|
}
|
|
808
808
|
export {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
809
|
+
P as a,
|
|
810
|
+
oe as b,
|
|
811
|
+
ne as c,
|
|
812
|
+
te as d,
|
|
813
|
+
at as e,
|
|
814
|
+
Ct as f,
|
|
815
|
+
ee as g,
|
|
816
|
+
qt as h,
|
|
817
|
+
$t as i,
|
|
818
|
+
re as t
|
|
819
819
|
};
|