@picked/client 0.0.9-next.1 → 0.0.9

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.
Files changed (41) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
  3. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  4. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  5. package/dist/cjs/plugins/shopify/index.js +1 -1
  6. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  7. package/dist/cjs/plugins/web-components/index.js +1 -1
  8. package/dist/cjs/plugins/window-object/index.js +1 -1
  9. package/dist/cjs/server/index.js +1 -1
  10. package/dist/esm/index.js +126 -145
  11. package/dist/esm/plugins/experience-browser-storage/index.js +14 -15
  12. package/dist/esm/plugins/history-browser-storage/index.js +1 -1
  13. package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
  14. package/dist/esm/plugins/shopify/index.js +33 -32
  15. package/dist/esm/plugins/single-page-app/index.js +3 -3
  16. package/dist/esm/plugins/web-components/index.js +1 -1
  17. package/dist/esm/plugins/window-object/index.js +1 -1
  18. package/dist/esm/server/index.js +1 -1
  19. package/dist/{experience-instance-BEKoIaYp.js → experience-instance-C1Ky25uw.js} +151 -156
  20. package/dist/{experience-instance-D4dHslLZ.cjs → experience-instance-DNI5sbjx.cjs} +1 -1
  21. package/dist/storage-BPJwmlva.cjs +1 -0
  22. package/dist/{storage-BxBBl9Bw.js → storage-D87xFySf.js} +31 -39
  23. package/dist/supports-B6KShYPU.cjs +1 -0
  24. package/dist/{supports-BjhuLJ8z.js → supports-yKVnaaMQ.js} +12 -20
  25. package/dist/types/entities/experience-instance/experience-instance.d.ts +7 -7
  26. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  27. package/dist/types/picked.d.ts +0 -2
  28. package/dist/types/picked.d.ts.map +1 -1
  29. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  30. package/dist/types/plugins/shopify/plugin.d.ts.map +1 -1
  31. package/dist/types/utils/events.d.ts +24 -23
  32. package/dist/types/utils/events.d.ts.map +1 -1
  33. package/dist/types/utils/storage.d.ts +0 -3
  34. package/dist/types/utils/storage.d.ts.map +1 -1
  35. package/dist/types/utils/supports.d.ts +0 -1
  36. package/dist/types/utils/supports.d.ts.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/storage-LI3UdcCr.cjs +0 -1
  39. package/dist/supports-YvpQZxbh.cjs +0 -1
  40. package/dist/types/utils/user-session.d.ts +0 -6
  41. package/dist/types/utils/user-session.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
- import { createDomain as ft, createEvent as b, combine as F, createApi as J, sample as S, createEffect as B, attach as _, split as lt } from "effector";
1
+ import { createDomain as ft, createEvent as b, combine as F, createApi as J, sample as S, createEffect as v, attach as _, split as pt } from "effector";
2
2
  import { createFactory as Q, invoke as Y } from "@withease/factories";
3
- import { i as pt, s as Z, a as dt } from "./supports-BjhuLJ8z.js";
3
+ import { h as lt, s as Z, a as dt } from "./supports-yKVnaaMQ.js";
4
4
  import { l as D } from "./logger-C9a75KZn.js";
5
5
  import { i as gt } from "./object-JwZ58NOH.js";
6
6
  function mt(t) {
@@ -23,7 +23,7 @@ function d(t) {
23
23
  const e = parseFloat(`${t}`);
24
24
  return isNaN(e) ? 0 : e;
25
25
  }
26
- function M(t) {
26
+ function L(t) {
27
27
  return `${t}`;
28
28
  }
29
29
  const ht = {
@@ -38,32 +38,32 @@ const ht = {
38
38
  "<": (t, e, r) => {
39
39
  const n = d(t), i = d(e);
40
40
  if (r === void 0) return n < i;
41
- const a = d(r);
42
- return n < i && i < a;
41
+ const c = d(r);
42
+ return n < i && i < c;
43
43
  },
44
44
  "<=": (t, e, r) => {
45
45
  const n = d(t), i = d(e);
46
46
  if (r === void 0) return n <= i;
47
- const a = d(r);
48
- return n <= i && i <= a;
47
+ const c = d(r);
48
+ return n <= i && i <= c;
49
49
  },
50
50
  "!!": async (t) => await I(t),
51
51
  "!": async (t) => !await I(t),
52
52
  "%": (t, e) => d(t) % d(e),
53
53
  // eslint-disable-next-line sonarjs/function-return-type
54
54
  log: (t) => (console.log(t), t),
55
- in: (t, e) => e ? O(e) ? e.indexOf(M(t)) !== -1 : w(e) ? e.includes(t) : !1 : !1,
56
- cat: (...t) => t.map(M).join(""),
55
+ in: (t, e) => e ? O(e) ? e.indexOf(L(t)) !== -1 : w(e) ? e.includes(t) : !1 : !1,
56
+ cat: (...t) => t.map(L).join(""),
57
57
  /* eslint-disable sonarjs/deprecation */
58
58
  substr: (t, e, r) => {
59
- const n = M(t), i = d(e);
59
+ const n = L(t), i = d(e);
60
60
  if (r === void 0) return n.substr(i);
61
- const a = d(r);
62
- if (a < 0) {
61
+ const c = d(r);
62
+ if (c < 0) {
63
63
  const o = n.substr(i);
64
- return o.substr(0, o.length + a);
64
+ return o.substr(0, o.length + c);
65
65
  }
66
- return n.substr(i, a);
66
+ return n.substr(i, c);
67
67
  },
68
68
  /* eslint-enable sonarjs/deprecation */
69
69
  "+": (...t) => t.reduce((e, r) => d(e) + d(r), 0),
@@ -82,32 +82,32 @@ const ht = {
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 = M(t);
85
+ const n = L(t);
86
86
  if (n === "" || n === ".")
87
87
  return this;
88
88
  const i = n.split(".");
89
- let a = this;
89
+ let c = this;
90
90
  for (const o of i) {
91
- if (a == null)
91
+ if (c == null)
92
92
  return r;
93
- if (Array.isArray(a)) {
94
- const c = parseInt(o, 10);
95
- isNaN(c) ? a = a[o] : a = a[c];
93
+ if (Array.isArray(c)) {
94
+ const a = parseInt(o, 10);
95
+ isNaN(a) ? c = c[o] : c = c[a];
96
96
  } else
97
- a = a[o];
97
+ c = c[o];
98
98
  }
99
- return a !== void 0 ? a : r;
99
+ return c !== void 0 ? c : r;
100
100
  },
101
101
  async missing(...t) {
102
102
  const e = w(t[0]) ? t[0] : t, r = [];
103
103
  for (const n of e) {
104
- const i = await p({ var: n }, this);
104
+ const i = await l({ var: n }, this);
105
105
  (i === null || i === "") && r.push(`${n}`);
106
106
  }
107
107
  return r;
108
108
  },
109
109
  async missing_some(t, e) {
110
- const r = await p({ missing: e }, this);
110
+ const r = await l({ missing: e }, this);
111
111
  if (!w(r) || !w(e)) return [];
112
112
  const n = r.filter(O);
113
113
  return e.filter(O).length - n.length >= d(t) ? [] : n;
@@ -119,21 +119,21 @@ const ht = {
119
119
  regexp_matches(t, e) {
120
120
  let r = t, n = "";
121
121
  if (w(t)) {
122
- const [a, o] = t;
123
- r = a, n = o;
122
+ const [c, o] = t;
123
+ r = c, n = o;
124
124
  }
125
- return !O(r) || !O(n) ? !1 : new RegExp(r, n).test(M(e));
125
+ return !O(r) || !O(n) ? !1 : new RegExp(r, n).test(L(e));
126
126
  },
127
127
  throw(t) {
128
- throw new Error(M(t));
128
+ throw new Error(L(t));
129
129
  }
130
130
  };
131
- async function p(t, e) {
131
+ async function l(t, e) {
132
132
  if (!t) return t;
133
133
  if (tt(t))
134
- return p(await t, e);
134
+ return l(await t, e);
135
135
  if (w(t))
136
- return Promise.all(t.map((o) => p(o, e)));
136
+ return Promise.all(t.map((o) => l(o, e)));
137
137
  if (!z(t)) return t;
138
138
  const r = St(t);
139
139
  let n = r ? t[r] ?? [] : [];
@@ -141,76 +141,76 @@ async function p(t, e) {
141
141
  case "if":
142
142
  case "?:":
143
143
  for (let o = 0; o < n.length - 1; o += 2)
144
- if (await I(await p(n[o], e)))
145
- return p(n[o + 1], e);
146
- return n.length % 2 === 1 ? p(n[n.length - 1], e) : null;
144
+ if (await I(await l(n[o], e)))
145
+ return l(n[o + 1], e);
146
+ return n.length % 2 === 1 ? l(n[n.length - 1], e) : null;
147
147
  case "and": {
148
148
  let o = null;
149
- for (const c of n)
150
- if (o = await p(c, e), !await I(o))
149
+ for (const a of n)
150
+ if (o = await l(a, e), !await I(o))
151
151
  return o;
152
152
  return o;
153
153
  }
154
154
  case "or": {
155
155
  let o = null;
156
- for (const c of n)
157
- if (o = await p(c, e), await I(o)) return o;
156
+ for (const a of n)
157
+ if (o = await l(a, e), await I(o)) return o;
158
158
  return o;
159
159
  }
160
160
  case "map": {
161
- const o = await p(n[0], e);
162
- return w(o) ? await Promise.all(o.map((c) => p(n[1], c))) : [];
161
+ const o = await l(n[0], e);
162
+ return w(o) ? await Promise.all(o.map((a) => l(n[1], a))) : [];
163
163
  }
164
164
  case "filter": {
165
- const o = await p(n[0], e);
165
+ const o = await l(n[0], e);
166
166
  return w(o) ? (await Promise.all(
167
167
  o.map(async (u) => {
168
- const h = await I(await p(n[1], u));
168
+ const h = await I(await l(n[1], u));
169
169
  return { item: u, shouldInclude: h };
170
170
  })
171
171
  )).filter(({ shouldInclude: u }) => u).map(({ item: u }) => u) : [];
172
172
  }
173
173
  case "reduce": {
174
- const o = await p(n[0], e);
174
+ const o = await l(n[0], e);
175
175
  if (!w(o))
176
- return n.length > 2 ? await p(n[2], e) : null;
177
- const c = n[1];
178
- let h = n.length > 2 ? await p(n[2], e) : null;
176
+ return n.length > 2 ? await l(n[2], e) : null;
177
+ const a = n[1];
178
+ let h = n.length > 2 ? await l(n[2], e) : null;
179
179
  for (const E of o)
180
- h = await p(c, { current: E, accumulator: h });
180
+ h = await l(a, { current: E, accumulator: h });
181
181
  return h;
182
182
  }
183
183
  case "all": {
184
- const o = await p(n[0], e);
184
+ const o = await l(n[0], e);
185
185
  if (!w(o) || o.length === 0) return !1;
186
- for (const c of o)
187
- if (!await I(await p(n[1], c))) return !1;
186
+ for (const a of o)
187
+ if (!await I(await l(n[1], a))) return !1;
188
188
  return !0;
189
189
  }
190
190
  case "some": {
191
- const o = await p(n[0], e);
191
+ const o = await l(n[0], e);
192
192
  if (!w(o)) return !1;
193
- for (const c of o)
194
- if (await I(await p(n[1], c))) return !0;
193
+ for (const a of o)
194
+ if (await I(await l(n[1], a))) return !0;
195
195
  return !1;
196
196
  }
197
197
  case "none": {
198
- const o = await p(n[0], e);
198
+ const o = await l(n[0], e);
199
199
  if (!w(o)) return !0;
200
- for (const c of o)
201
- if (await I(await p(n[1], c))) return !1;
200
+ for (const a of o)
201
+ if (await I(await l(n[1], a))) return !1;
202
202
  return !0;
203
203
  }
204
204
  case "catch":
205
205
  try {
206
- return await p(n[0], e);
206
+ return await l(n[0], e);
207
207
  } catch (o) {
208
- return z(o) ? await p(o, e) : n[1] ? await p(n[1], o) : o instanceof Error ? o.message : o;
208
+ return z(o) ? await l(o, e) : n[1] ? await l(n[1], o) : o instanceof Error ? o.message : o;
209
209
  }
210
210
  }
211
- const i = await Promise.all(n.map((o) => p(o, e))), a = r ? ht[r] : void 0;
212
- if (!a) throw new Error(`Unrecognized operation ${r}`);
213
- return a.apply(e, i);
211
+ const i = await Promise.all(n.map((o) => l(o, e))), c = r ? ht[r] : void 0;
212
+ if (!c) throw new Error(`Unrecognized operation ${r}`);
213
+ return c.apply(e, i);
214
214
  }
215
215
  async function I(t) {
216
216
  return tt(t) ? I(await t) : !(Array.isArray(t) && t.length === 0) && !!t;
@@ -222,11 +222,11 @@ function jt(t) {
222
222
  return !gt(t);
223
223
  }
224
224
  async function yt(t, e, r) {
225
- const n = t.getStateSnapshot(), i = t.predicates.listStore.getState().reduce((c, u) => ({
226
- ...c,
225
+ const n = t.getStateSnapshot(), i = t.predicates.listStore.getState().reduce((a, u) => ({
226
+ ...a,
227
227
  [u.name]: () => u.predicate(n)
228
- }), {}), a = t.features.listStore.getState().reduce((c, u) => ({
229
- ...c,
228
+ }), {}), c = t.features.listStore.getState().reduce((a, u) => ({
229
+ ...a,
230
230
  [u.id]: async () => {
231
231
  const { bucket: h } = await u.getBucket();
232
232
  return h;
@@ -246,9 +246,9 @@ async function yt(t, e, r) {
246
246
  search: n.location.search
247
247
  } : void 0,
248
248
  predicates: i,
249
- features: a
249
+ features: c
250
250
  };
251
- return await p(e, o);
251
+ return await l(e, o);
252
252
  }
253
253
  function wt(t) {
254
254
  return !dt() || !Z() ? [] : Array.from(window.document.querySelectorAll(t)).filter(
@@ -256,7 +256,7 @@ function wt(t) {
256
256
  );
257
257
  }
258
258
  function xt(t) {
259
- if (!pt())
259
+ if (!lt())
260
260
  throw new Error("Shadow DOM is not supported in this environment");
261
261
  return t.attachShadow({ mode: "closed" });
262
262
  }
@@ -286,7 +286,7 @@ function Kt(t, e) {
286
286
  }
287
287
  ].flatMap((n) => {
288
288
  const i = wt(n.selector).filter(
289
- (a) => !It(a, e) && !Nt(a, e)
289
+ (c) => !It(c, e) && !Nt(c, e)
290
290
  );
291
291
  return {
292
292
  ...n,
@@ -295,7 +295,7 @@ function Kt(t, e) {
295
295
  });
296
296
  }
297
297
  function Ut(t, e) {
298
- return t.flatMap((r) => r.elements.map((n) => Bt(n, r.placement, e)));
298
+ return t.flatMap((r) => r.elements.map((n) => vt(n, r.placement, e)));
299
299
  }
300
300
  function Vt(t, e) {
301
301
  t.classList.add(R), t.classList.add(`${R}-${e}`);
@@ -310,7 +310,7 @@ function bt(t) {
310
310
  const e = document.createElement("div");
311
311
  return e.style.display = "block", e.classList.add(P), e.classList.add(`${P}-${t}`), e;
312
312
  }
313
- function Bt(t, e, r) {
313
+ function vt(t, e, r) {
314
314
  let n;
315
315
  const i = bt(r);
316
316
  if (t instanceof Document)
@@ -343,22 +343,22 @@ function _t(t) {
343
343
  function $(t) {
344
344
  return t.type === "step";
345
345
  }
346
- function vt(t) {
346
+ function At(t) {
347
347
  return t.type === "experience";
348
348
  }
349
349
  function X(t) {
350
350
  return t.type === "origin";
351
351
  }
352
352
  const et = (t, e, r, n, i = /* @__PURE__ */ new Set()) => i.has(r.id) ? [] : (i.add(r.id), $(r) && !n ? [r] : e.filter((o) => o.sourceNodeId === r.id).flatMap((o) => {
353
- const c = t.find((u) => u.id === o.destinationNodeId);
354
- return c ? et(t, e, c, !1, i) : [];
355
- })), At = (t, e, r) => et(t, e, r, !0, /* @__PURE__ */ new Set()), nt = (t, e, r, n, i = /* @__PURE__ */ new Set()) => {
353
+ const a = t.find((u) => u.id === o.destinationNodeId);
354
+ return a ? et(t, e, a, !1, i) : [];
355
+ })), Mt = (t, e, r) => et(t, e, r, !0, /* @__PURE__ */ new Set()), nt = (t, e, r, n, i = /* @__PURE__ */ new Set()) => {
356
356
  if (i.has(r.id)) return [-1, -1];
357
357
  i.add(r.id);
358
- const a = e.filter((u) => u.sourceNodeId === r.id);
359
- if (a.length === 0) return [0, 0];
360
- let o = 1 / 0, c = -1 / 0;
361
- for (const u of a) {
358
+ const c = e.filter((u) => u.sourceNodeId === r.id);
359
+ if (c.length === 0) return [0, 0];
360
+ let o = 1 / 0, a = -1 / 0;
361
+ for (const u of c) {
362
362
  const h = t.find((k) => k.id === u.destinationNodeId);
363
363
  if (!h) continue;
364
364
  const [E, y] = nt(
@@ -368,17 +368,17 @@ const et = (t, e, r, n, i = /* @__PURE__ */ new Set()) => i.has(r.id) ? [] : (i.
368
368
  !1,
369
369
  new Set(i)
370
370
  );
371
- E !== -1 && (o = Math.min(o, E + 1), c = Math.max(c, y + 1));
371
+ E !== -1 && (o = Math.min(o, E + 1), a = Math.max(a, y + 1));
372
372
  }
373
- return o === 1 / 0 ? [-1, -1] : [o, c];
374
- }, Mt = (t, e, r) => nt(t, e, r, !0, /* @__PURE__ */ new Set()), rt = (t, e, r, n = /* @__PURE__ */ new Set()) => {
373
+ return o === 1 / 0 ? [-1, -1] : [o, a];
374
+ }, Lt = (t, e, r) => nt(t, e, r, !0, /* @__PURE__ */ new Set()), rt = (t, e, r, n = /* @__PURE__ */ new Set()) => {
375
375
  if (n.has(r.id)) return [-1, -1];
376
376
  if (n.add(r.id), r.type === "origin") return [0, 0];
377
- const i = e.filter((c) => c.destinationNodeId === r.id);
377
+ const i = e.filter((a) => a.destinationNodeId === r.id);
378
378
  if (i.length === 0) return [-1, -1];
379
- let a = 1 / 0, o = -1 / 0;
380
- for (const c of i) {
381
- const u = t.find((y) => y.id === c.sourceNodeId);
379
+ let c = 1 / 0, o = -1 / 0;
380
+ for (const a of i) {
381
+ const u = t.find((y) => y.id === a.sourceNodeId);
382
382
  if (!u) continue;
383
383
  const [h, E] = rt(
384
384
  t,
@@ -386,23 +386,23 @@ const et = (t, e, r, n, i = /* @__PURE__ */ new Set()) => i.has(r.id) ? [] : (i.
386
386
  u,
387
387
  new Set(n)
388
388
  );
389
- h !== -1 && (a = Math.min(a, h + 1), o = Math.max(o, E + 1));
389
+ h !== -1 && (c = Math.min(c, h + 1), o = Math.max(o, E + 1));
390
390
  }
391
- return a === 1 / 0 ? [-1, -1] : [a, o];
392
- }, Lt = (t, e, r) => rt(t, e, r, /* @__PURE__ */ new Set()), ot = (t) => t.find((r) => r.type === "origin") || null, K = (t, e, r) => {
391
+ return c === 1 / 0 ? [-1, -1] : [c, o];
392
+ }, Tt = (t, e, r) => rt(t, e, r, /* @__PURE__ */ new Set()), ot = (t) => t.find((r) => r.type === "origin") || null, K = (t, e, r) => {
393
393
  if (!t)
394
394
  return ot(e);
395
- const n = r.find((a) => a.sourceNodeId === t.id);
395
+ const n = r.find((c) => c.sourceNodeId === t.id);
396
396
  if (!n)
397
397
  return null;
398
- const i = e.find((a) => a.id === n.destinationNodeId);
398
+ const i = e.find((c) => c.id === n.destinationNodeId);
399
399
  return i || null;
400
400
  };
401
- async function Tt(t, e, r, n) {
402
- const i = t ? "true" : "false", a = n.find(
401
+ async function Bt(t, e, r, n) {
402
+ const i = t ? "true" : "false", c = n.find(
403
403
  (o) => o.sourceNodeHandle === i && o.sourceNodeId === e
404
404
  );
405
- return r.find((o) => o.id === (a == null ? void 0 : a.destinationNodeId));
405
+ return r.find((o) => o.id === (c == null ? void 0 : c.destinationNodeId));
406
406
  }
407
407
  const U = ft("experience-instance"), Ft = Q(
408
408
  ({
@@ -410,30 +410,30 @@ const U = ft("experience-instance"), Ft = Q(
410
410
  experience: e,
411
411
  target: r
412
412
  }) => {
413
- const n = b(), i = b(), a = b(), o = b(), c = e.componentStore, u = U.store("transitioning"), h = t.history.entriesStore.map((s) => s.filter((l) => l.experienceId === e.id)), E = h.map((s) => s.filter((l) => $(l.node))), y = h.map((s) => {
414
- var l;
415
- return ((l = s[s.length - 1]) == null ? void 0 : l.node) || null;
413
+ const n = b(), i = b(), c = b(), o = b(), a = e.componentStore, u = U.store("transitioning"), h = t.history.entriesStore.map((s) => s.filter((p) => p.experienceId === e.id)), E = h.map((s) => s.filter((p) => $(p.node))), y = h.map((s) => {
414
+ var p;
415
+ return ((p = s[s.length - 1]) == null ? void 0 : p.node) || null;
416
416
  }), k = F(
417
417
  e.treeStore,
418
418
  y,
419
- ({ steps: s }, l) => s.find((g) => l && $(l) && g.id === l.stepId) || null
419
+ ({ steps: s }, p) => s.find((g) => p && $(p) && g.id === p.stepId) || null
420
420
  ), C = F(
421
421
  e.treeStore,
422
422
  y,
423
- ({ nodes: s, edges: l }, g) => g ? At(s, l, g) : []
423
+ ({ nodes: s, edges: p }, g) => g ? Mt(s, p, g) : []
424
424
  ), f = F(
425
425
  e.treeStore,
426
426
  y,
427
- ({ nodes: s, edges: l }, g) => g ? Lt(s, l, g) : [-1, -1]
427
+ ({ nodes: s, edges: p }, g) => g ? Tt(s, p, g) : [-1, -1]
428
428
  ), m = F(
429
429
  e.treeStore,
430
430
  y,
431
- ({ nodes: s, edges: l }, g) => g ? Mt(s, l, g) : [-1, -1]
431
+ ({ nodes: s, edges: p }, g) => g ? Lt(s, p, g) : [-1, -1]
432
432
  ), x = U.store(!0), N = J(x, {
433
433
  open: () => !0,
434
434
  close: () => !1,
435
435
  toggle: (s) => !s,
436
- set: (s, l) => l
436
+ set: (s, p) => p
437
437
  });
438
438
  S({
439
439
  source: x,
@@ -450,12 +450,12 @@ const U = ft("experience-instance"), Ft = Q(
450
450
  experience: e
451
451
  }))
452
452
  });
453
- const v = B(async () => {
453
+ const A = v(async () => {
454
454
  t.history.back({ experienceId: e.id });
455
- }), L = _({
455
+ }), T = _({
456
456
  source: e.treeStore,
457
- effect: async (s, l) => {
458
- const g = s.nodes.find((A) => $(A) && A.stepId === l);
457
+ effect: async (s, p) => {
458
+ const g = s.nodes.find((M) => $(M) && M.stepId === p);
459
459
  g && t.history.push({ experienceId: e.id, node: g });
460
460
  }
461
461
  }), V = _({
@@ -467,33 +467,33 @@ const U = ft("experience-instance"), Ft = Q(
467
467
  effect: async ({ nodes: s }) => ot(s)
468
468
  }), j = _({
469
469
  source: e.treeStore,
470
- effect: async ({ nodes: s, edges: l }, g) => K(g, s, l)
470
+ effect: async ({ nodes: s, edges: p }, g) => K(g, s, p)
471
471
  }), G = _({
472
472
  source: e.treeStore,
473
- effect: async ({ nodes: s, edges: l, conditionals: g }, A) => {
474
- if (!A)
473
+ effect: async ({ nodes: s, edges: p, conditionals: g }, M) => {
474
+ if (!M)
475
475
  return;
476
- const q = g.find((ut) => ut.id === A.conditionalId);
476
+ const q = g.find((ut) => ut.id === M.conditionalId);
477
477
  if (!q)
478
478
  return;
479
- const at = A.id, ct = await yt(t, q.condition);
480
- return Tt(!!ct, at, s, l);
479
+ const ct = M.id, at = await yt(t, q.condition);
480
+ return Bt(!!at, ct, s, p);
481
481
  }
482
- }), st = B((s) => {
482
+ }), st = v((s) => {
483
483
  if (s)
484
484
  return t.launchExperienceById(s.experienceId);
485
485
  }), W = _({
486
486
  source: [y, e.treeStore],
487
- effect: async ([s, { nodes: l, edges: g }]) => K(s, l, g)
488
- }), T = _({
487
+ effect: async ([s, { nodes: p, edges: g }]) => K(s, p, g)
488
+ }), B = _({
489
489
  source: [y, e.treeStore],
490
- effect: async ([s, { nodes: l, edges: g }]) => K(s, l, g)
491
- }), it = B((s) => {
490
+ effect: async ([s, { nodes: p, edges: g }]) => K(s, p, g)
491
+ }), it = v((s) => {
492
492
  t.history.push({ experienceId: e.id, node: s });
493
493
  });
494
- return lt({
494
+ return pt({
495
495
  source: y,
496
- match: (s) => s ? _t(s) ? "condition" : $(s) ? "step" : vt(s) ? "launchExperience" : X(s) ? "origin" : "other" : "none",
496
+ match: (s) => s ? _t(s) ? "condition" : $(s) ? "step" : At(s) ? "launchExperience" : X(s) ? "origin" : "other" : "none",
497
497
  cases: {
498
498
  none: H,
499
499
  origin: j,
@@ -507,69 +507,64 @@ const U = ft("experience-instance"), Ft = Q(
507
507
  G.doneData,
508
508
  j.doneData,
509
509
  H.doneData,
510
- T.doneData,
510
+ B.doneData,
511
511
  W.doneData
512
512
  ],
513
513
  filter: Boolean,
514
514
  target: it
515
515
  }), S({
516
516
  clock: i,
517
- target: T
517
+ target: B
518
518
  }), S({
519
519
  clock: i,
520
520
  source: k,
521
- filter: Boolean,
522
521
  target: t.eventBus.prepend((s) => ({
523
522
  type: "step_submit",
524
- step: s,
523
+ step: s ?? void 0,
525
524
  experience: e
526
525
  }))
527
526
  }), S({
528
- clock: T.done,
527
+ clock: B.done,
529
528
  source: k,
530
- filter: Boolean,
531
529
  target: t.eventBus.prepend((s) => ({
532
530
  type: "step_submit_success",
533
- step: s,
531
+ step: s ?? void 0,
534
532
  experience: e
535
533
  }))
536
534
  }), S({
537
- clock: T.fail,
535
+ clock: B.fail,
538
536
  source: k,
539
- filter: Boolean,
540
537
  target: t.eventBus.prepend((s) => ({
541
538
  type: "step_submit_error",
542
- step: s,
539
+ step: s ?? void 0,
543
540
  experience: e
544
541
  }))
545
542
  }), S({
546
- clock: a,
547
- target: v
543
+ clock: c,
544
+ target: A
548
545
  }), S({
549
- clock: a,
546
+ clock: c,
550
547
  source: k,
551
- filter: Boolean,
552
548
  target: t.eventBus.prepend((s) => ({
553
549
  type: "step_submit",
554
- step: s,
550
+ step: s ?? void 0,
555
551
  experience: e
556
552
  }))
557
- }), S({ clock: o, target: L }), S({
553
+ }), S({ clock: o, target: T }), S({
558
554
  source: F([
559
555
  G.pending,
560
556
  j.pending,
561
557
  H.pending,
562
- T.pending
558
+ B.pending
563
559
  ]),
564
560
  fn: (s) => s.some(Boolean) ? "transitioning" : "ready",
565
561
  target: u
566
562
  }), S({
567
563
  clock: V.doneData,
568
564
  source: k,
569
- filter: Boolean,
570
565
  target: t.eventBus.prepend((s) => ({
571
566
  type: "step_enter",
572
- step: s,
567
+ step: s ?? void 0,
573
568
  experience: e
574
569
  }))
575
570
  }), S({
@@ -583,7 +578,7 @@ const U = ft("experience-instance"), Ft = Q(
583
578
  experienceId: e.id,
584
579
  configStore: e.configStore,
585
580
  target: r,
586
- componentStore: c,
581
+ componentStore: a,
587
582
  // state
588
583
  stateStore: u,
589
584
  // open close
@@ -601,7 +596,7 @@ const U = ft("experience-instance"), Ft = Q(
601
596
  stepsToLeafStore: m,
602
597
  // history
603
598
  goToNextStep: i,
604
- goToPreviousStep: a,
599
+ goToPreviousStep: c,
605
600
  goToStepById: o,
606
601
  stepsHistoryStore: E
607
602
  };
@@ -611,7 +606,7 @@ function Ot(t) {
611
606
  return Y(Ft, t);
612
607
  }
613
608
  const $t = Q(({ client: t }) => {
614
- const e = U.store({}), r = b(), n = b(), i = b(), a = J(e, {
609
+ const e = U.store({}), r = b(), n = b(), i = b(), c = J(e, {
615
610
  register(f, m) {
616
611
  const x = [
617
612
  ...f[m.experienceId] ?? []
@@ -622,28 +617,28 @@ const $t = Q(({ client: t }) => {
622
617
  };
623
618
  },
624
619
  unregister(f, m) {
625
- var v;
626
- const x = m.experienceId, N = (v = f[x]) == null ? void 0 : v.filter(
627
- (L) => L !== m
620
+ var A;
621
+ const x = m.experienceId, N = (A = f[x]) == null ? void 0 : A.filter(
622
+ (T) => T !== m
628
623
  );
629
624
  return {
630
625
  ...f,
631
626
  [x]: N ?? []
632
627
  };
633
628
  }
634
- }), o = B(
629
+ }), o = v(
635
630
  ({ experience: f, target: m }) => Ot({ client: t, experience: f, target: m })
636
- ), c = B((f) => {
637
- a.register(f);
638
- }), u = B(
631
+ ), a = v((f) => {
632
+ c.register(f);
633
+ }), u = v(
639
634
  (f) => {
640
635
  f.target && Et(f.target, () => {
641
636
  i(f);
642
637
  });
643
638
  }
644
- ), h = B((f) => {
645
- a.unregister(f);
646
- }), E = B((f) => {
639
+ ), h = v((f) => {
640
+ c.unregister(f);
641
+ }), E = v((f) => {
647
642
  const m = f.componentStore.getState();
648
643
  if (!m) {
649
644
  D("warn", "No app component registered. Skipping init.");
@@ -665,11 +660,11 @@ const $t = Q(({ client: t }) => {
665
660
  );
666
661
  return;
667
662
  }
668
- const v = xt(N);
663
+ const A = xt(N);
669
664
  try {
670
- x.render(v, m.component, t, f);
671
- } catch (L) {
672
- D("error", L);
665
+ x.render(A, m.component, t, f);
666
+ } catch (T) {
667
+ D("error", T);
673
668
  }
674
669
  });
675
670
  S({
@@ -681,7 +676,7 @@ const $t = Q(({ client: t }) => {
681
676
  }), S({
682
677
  clock: o.doneData,
683
678
  target: [
684
- c,
679
+ a,
685
680
  u,
686
681
  n
687
682
  ]