@picked/client 0.0.78-next.2 → 0.0.78-next.3

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 (44) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/{api-gGqMLTec.js → api-DxTpQr1S.js} +1 -1
  3. package/dist/{api-R3q_6NiX.cjs → api-bRP9T5NV.cjs} +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/plugins/telemetry/index.js +1 -0
  7. package/dist/cjs/server/index.js +1 -1
  8. package/dist/emit-D-tLiWL1.cjs +1 -0
  9. package/dist/emit-Ds2EG7CB.js +14 -0
  10. package/dist/esm/index.js +270 -229
  11. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  12. package/dist/esm/plugins/telemetry/index.js +97 -0
  13. package/dist/esm/server/index.js +1 -1
  14. package/dist/{plugin-CaJyXwSN.js → plugin-Bx7a4qw2.js} +2 -2
  15. package/dist/{plugin-D4WVP2aO.cjs → plugin-C24Ybji7.cjs} +1 -1
  16. package/dist/provider-DH9rfY2L.js +94 -0
  17. package/dist/provider-OA5InC6Z.cjs +1 -0
  18. package/dist/types/data-source/api.d.ts.map +1 -1
  19. package/dist/types/data-source/provider.d.ts +3 -0
  20. package/dist/types/data-source/provider.d.ts.map +1 -1
  21. package/dist/types/data-source/request-observer.d.ts +58 -0
  22. package/dist/types/data-source/request-observer.d.ts.map +1 -0
  23. package/dist/types/entities/plugin/plugin.d.ts +4 -0
  24. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  25. package/dist/types/lifecycle/lifecycle.d.ts.map +1 -1
  26. package/dist/types/picked.d.ts +8 -1
  27. package/dist/types/picked.d.ts.map +1 -1
  28. package/dist/types/plugins/telemetry/emit.d.ts +18 -0
  29. package/dist/types/plugins/telemetry/emit.d.ts.map +1 -0
  30. package/dist/types/plugins/telemetry/index.d.ts +4 -0
  31. package/dist/types/plugins/telemetry/index.d.ts.map +1 -0
  32. package/dist/types/plugins/telemetry/plugin-summary.d.ts +10 -0
  33. package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +1 -0
  34. package/dist/types/plugins/telemetry/plugin.d.ts +45 -0
  35. package/dist/types/plugins/telemetry/plugin.d.ts.map +1 -0
  36. package/dist/types/utils/client-telemetry.d.ts +25 -0
  37. package/dist/types/utils/client-telemetry.d.ts.map +1 -0
  38. package/dist/types/utils/user-timing.d.ts +21 -0
  39. package/dist/types/utils/user-timing.d.ts.map +1 -0
  40. package/dist/{version-CaCM83j4.js → version-CWSfnbGk.js} +1 -1
  41. package/dist/{version-ZVJWOz2D.cjs → version-D9Eq71fx.cjs} +1 -1
  42. package/package.json +16 -4
  43. package/dist/provider-C12099cw.cjs +0 -1
  44. package/dist/provider-D5CCq15k.js +0 -69
package/dist/esm/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { t as e } from "../object-BUDGxEqy.js";
2
2
  import { n as t, t as n } from "../rules-logic-HesIUCu6.js";
3
3
  import { t as r } from "../logger-DMN6TxJJ.js";
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-CO9bJGNl.js";
5
- import { a as _, i as v, r as ee, s as y, t as b } from "../dom-BqcToNL0.js";
6
- import { l as x, n as S, r as C, u as w } from "../experience-instance-DGk11d8a.js";
7
- import { i as T, n as E, r as D, t as O } from "../storage-1MW3-_As.js";
8
- import { i as te, n as ne, r as re, t as ie } from "../version-CaCM83j4.js";
9
- import { t as ae } from "../id-Bo4RBeOs.js";
10
- import { n as oe, r as se, t as ce } from "../inert-script-report-B_bMPRzp.js";
11
- import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, is as le, sample as I } from "effector";
4
+ import { a as i, c as a, d as o, f as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _ } from "../supports-CO9bJGNl.js";
5
+ import { a as v, i as y, r as ee, s as b, t as x } from "../dom-BqcToNL0.js";
6
+ import { l as S, n as C, r as w, u as T } from "../experience-instance-DGk11d8a.js";
7
+ import { i as te, n as E, r as D, t as O } from "../storage-1MW3-_As.js";
8
+ import { i as ne, n as re, r as ie, t as ae } from "../version-CWSfnbGk.js";
9
+ import { t as oe } from "../id-Bo4RBeOs.js";
10
+ import { n as se, r as ce, t as le } from "../inert-script-report-B_bMPRzp.js";
11
+ import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, is as ue, sample as I } from "effector";
12
12
  import { createFactory as L, invoke as R } from "@withease/factories";
13
- import { sendPing as ue } from "@picked/delivery-api-client";
13
+ import { sendPing as de } from "@picked/delivery-api-client";
14
14
  //#region src/entities/experience/experience.ts
15
- var z = M("experience"), de = L(({ client: e, experience: r }) => {
15
+ var z = M("experience"), fe = L(({ client: e, experience: r }) => {
16
16
  let i = z.store(r), a = j(i, { merge(e, t) {
17
17
  return {
18
18
  ...e,
@@ -24,7 +24,7 @@ var z = M("experience"), de = L(({ client: e, experience: r }) => {
24
24
  targetSelectors: e.targets,
25
25
  initializeOpenLogic: e.initializeOpen
26
26
  })), 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) => {
27
- let r = e.nodes.filter(w).map((e) => t[e.stepId]).filter((e) => e !== void 0), i = e.nodes.filter(x).map((e) => n[e.conditionId]).filter((e) => e !== void 0);
27
+ let r = e.nodes.filter(T).map((e) => t[e.stepId]).filter((e) => e !== void 0), i = e.nodes.filter(S).map((e) => n[e.conditionId]).filter((e) => e !== void 0);
28
28
  return {
29
29
  steps: r,
30
30
  nodes: e.nodes,
@@ -34,8 +34,8 @@ var z = M("experience"), de = L(({ client: e, experience: r }) => {
34
34
  }), l = r.actions ?? [], u, d = k({
35
35
  source: o,
36
36
  effect: (t, n) => {
37
- let i = v(t.targetSelectors, r.id);
38
- i.forEach(({ elements: e }) => e.forEach((e) => y(e, r.id))), b(i, r.id, r.key).forEach((t) => {
37
+ let i = y(t.targetSelectors, r.id);
38
+ i.forEach(({ elements: e }) => e.forEach((e) => b(e, r.id))), x(i, r.id, r.key).forEach((t) => {
39
39
  n ? e.experienceInstances.spawn(u, t, n) : e.experienceInstances.spawn(u, t);
40
40
  });
41
41
  }
@@ -48,7 +48,7 @@ var z = M("experience"), de = L(({ client: e, experience: r }) => {
48
48
  effect: async ({ preconditionPassed: i, isUser: a, config: o }) => {
49
49
  if (!i || !a) return !1;
50
50
  let { decisionLogic: s, targetSelectors: c } = o;
51
- return c.length === 0 || v(c, r.id).length < 1 ? !1 : s === void 0 || !t(s) || await n(e, s) === !0;
51
+ return c.length === 0 || y(c, r.id).length < 1 ? !1 : s === void 0 || !t(s) || await n(e, s) === !0;
52
52
  }
53
53
  }), m = N(async () => {
54
54
  if (!e.contentLoader) return !0;
@@ -99,17 +99,17 @@ var z = M("experience"), de = L(({ client: e, experience: r }) => {
99
99
  prepareExperienceContentFx: m
100
100
  }, u;
101
101
  });
102
- function fe(e) {
103
- return R(de, e);
102
+ function pe(e) {
103
+ return R(fe, e);
104
104
  }
105
- var pe = L(({ client: e }) => {
105
+ var me = L(({ client: e }) => {
106
106
  let t = z.store({}), n = j(t, { register(e, t) {
107
107
  return {
108
108
  ...e,
109
109
  [t.id]: t
110
110
  };
111
111
  } }), r = P(), i = N((t) => {
112
- n.register(fe({
112
+ n.register(pe({
113
113
  client: e,
114
114
  experience: t
115
115
  }));
@@ -195,38 +195,35 @@ var pe = L(({ client: e }) => {
195
195
  })
196
196
  };
197
197
  });
198
- function me(e) {
199
- return R(pe, e);
198
+ function he(e) {
199
+ return R(me, e);
200
200
  }
201
- var he = async (e) => {
201
+ var ge = async (e) => {
202
202
  await e.experiences.initialiseExperiencesFx();
203
203
  };
204
204
  //#endregion
205
205
  //#region src/entities/plugin/plugin.ts
206
- function ge(e) {
206
+ function _e(e) {
207
207
  return N(async () => {
208
208
  await e();
209
209
  });
210
210
  }
211
- var _e = (e, t, n) => {
212
- let r = t.name, i = t.setup(e);
213
- if (i) {
214
- let e = n[r] ?? {};
215
- n[r] = Object.freeze({
216
- ...e,
217
- ...i
218
- });
219
- }
220
- }, ve = M("component"), ye = L(({ client: e, component: t, name: n }) => ({
211
+ var ve = (e, t, n) => {
212
+ let r = t.name, i = t.setup(e), a = n[r] ?? {};
213
+ n[r] = Object.freeze({
214
+ ...a,
215
+ ...i
216
+ });
217
+ }, ye = M("component"), be = L(({ client: e, component: t, name: n }) => ({
221
218
  name: n,
222
219
  component: t,
223
220
  frameworkStore: e.frameworks.getByName(t.frameworkName)
224
221
  }));
225
- function be(e) {
226
- return R(ye, e);
222
+ function xe(e) {
223
+ return R(be, e);
227
224
  }
228
- var xe = L(({ client: e }) => {
229
- let t = ve.store({}), n = j(t, { register(e, t) {
225
+ var Se = L(({ client: e }) => {
226
+ let t = ye.store({}), n = j(t, { register(e, t) {
230
227
  return {
231
228
  ...e,
232
229
  [t.name]: t
@@ -239,7 +236,7 @@ var xe = L(({ client: e }) => {
239
236
  fn: (e, { name: t }) => `Component '${t}' already registered. Registering again will override the previous registration.`
240
237
  }).watch((e) => /* @__PURE__ */ r("warn", e)), I({
241
238
  clock: i,
242
- fn: ({ name: t, component: n }) => be({
239
+ fn: ({ name: t, component: n }) => xe({
243
240
  client: e,
244
241
  name: t,
245
242
  component: n
@@ -256,16 +253,16 @@ var xe = L(({ client: e }) => {
256
253
  listStore: a
257
254
  };
258
255
  });
259
- function Se(e) {
260
- return R(xe, e);
256
+ function Ce(e) {
257
+ return R(Se, e);
261
258
  }
262
- var Ce = (e, t, n) => {
259
+ var we = (e, t, n) => {
263
260
  n.register({
264
261
  name: e,
265
262
  component: t
266
263
  });
267
- }, we = M("framework"), Te = L((e) => {
268
- let t = we.store({}), n = j(t, { register(e, t) {
264
+ }, Te = M("framework"), Ee = L((e) => {
265
+ let t = Te.store({}), n = j(t, { register(e, t) {
269
266
  return {
270
267
  ...e,
271
268
  [t.name]: t.framework
@@ -290,15 +287,15 @@ var Ce = (e, t, n) => {
290
287
  listStore: a
291
288
  };
292
289
  });
293
- function Ee(e) {
294
- return R(Te, e);
290
+ function De(e) {
291
+ return R(Ee, e);
295
292
  }
296
- var De = (e, t) => {
293
+ var Oe = (e, t) => {
297
294
  t.register({
298
295
  name: e.name,
299
296
  framework: e
300
297
  });
301
- }, Oe = L(({ client: e }) => {
298
+ }, ke = L(({ client: e }) => {
302
299
  let t = "window" in globalThis, n = {
303
300
  location: t ? globalThis.location : void 0,
304
301
  document: t ? globalThis.document : void 0,
@@ -312,12 +309,12 @@ var De = (e, t) => {
312
309
  ...n
313
310
  }));
314
311
  });
315
- function ke(e) {
316
- return R(Oe, e);
312
+ function Ae(e) {
313
+ return R(ke, e);
317
314
  }
318
315
  //#endregion
319
316
  //#region src/logic-engine.ts
320
- function Ae(e) {
317
+ function je(e) {
321
318
  return typeof e == "number" && !isNaN(e);
322
319
  }
323
320
  function B(e) {
@@ -326,21 +323,21 @@ function B(e) {
326
323
  function V(e) {
327
324
  return Array.isArray(e);
328
325
  }
329
- function je(e) {
326
+ function Me(e) {
330
327
  return e instanceof Promise;
331
328
  }
332
- function Me(e) {
329
+ function Ne(e) {
333
330
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
334
331
  }
335
332
  function H(e) {
336
- if (Ae(e)) return e;
333
+ if (je(e)) return e;
337
334
  let t = parseFloat(`${e}`);
338
335
  return isNaN(t) ? 0 : t;
339
336
  }
340
337
  function U(e) {
341
338
  return `${e}`;
342
339
  }
343
- var Ne = {
340
+ var Pe = {
344
341
  "==": (e, t) => e == t,
345
342
  "===": (e, t) => e === t,
346
343
  "!=": (e, t) => e != t,
@@ -435,10 +432,10 @@ var Ne = {
435
432
  };
436
433
  async function W(e, t) {
437
434
  if (!e) return e;
438
- if (je(e)) return W(await e, t);
435
+ if (Me(e)) return W(await e, t);
439
436
  if (V(e)) return Promise.all(e.map((e) => W(e, t)));
440
- if (!Me(e)) return e;
441
- let n = Pe(e), r = n ? e[n] ?? [] : [];
437
+ if (!Ne(e)) return e;
438
+ let n = Fe(e), r = n ? e[n] ?? [] : [];
442
439
  switch (V(r) || (r = [r]), n) {
443
440
  case "if":
444
441
  case "?:":
@@ -496,32 +493,32 @@ async function W(e, t) {
496
493
  case "catch": try {
497
494
  return await W(r[0], t);
498
495
  } catch (e) {
499
- return Me(e) ? await W(e, t) : r[1] ? await W(r[1], e) : e instanceof Error ? e.message : e;
496
+ return Ne(e) ? await W(e, t) : r[1] ? await W(r[1], e) : e instanceof Error ? e.message : e;
500
497
  }
501
498
  }
502
- let i = await Promise.all(r.map((e) => W(e, t))), a = n ? Ne[n] : void 0;
499
+ let i = await Promise.all(r.map((e) => W(e, t))), a = n ? Pe[n] : void 0;
503
500
  if (!a) throw Error(`Unrecognized operation ${n}`);
504
501
  return a.apply(t, i);
505
502
  }
506
503
  async function G(e) {
507
- return je(e) ? G(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
504
+ return Me(e) ? G(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
508
505
  }
509
- function Pe(e) {
506
+ function Fe(e) {
510
507
  return Object.keys(e)[0];
511
508
  }
512
509
  //#endregion
513
510
  //#region src/lifecycle/rules-logic.ts
514
- function Fe(e, t, n) {
511
+ function Ie(e, t, n) {
515
512
  return new Proxy(Object.create(null), { get(r, i) {
516
513
  if (typeof i != "string") return;
517
514
  let a = e.find((e) => e.key === i);
518
515
  if (a !== void 0) return async () => !n.has(i) && await W(a.logic, {
519
516
  ...t,
520
- conditions: Fe(e, t, new Set(n).add(i))
517
+ conditions: Ie(e, t, new Set(n).add(i))
521
518
  }) === !0;
522
519
  } });
523
520
  }
524
- var Ie = L(({ client: e }) => k({
521
+ var Le = L(({ client: e }) => k({
525
522
  source: {
526
523
  stateSnapshot: e.stateSnapshotStore,
527
524
  predicates: e.predicates.listStore,
@@ -560,22 +557,22 @@ var Ie = L(({ client: e }) => k({
560
557
  };
561
558
  return await W(o, {
562
559
  ...d,
563
- conditions: Fe(a, d, /* @__PURE__ */ new Set())
560
+ conditions: Ie(a, d, /* @__PURE__ */ new Set())
564
561
  });
565
562
  }
566
563
  }));
567
- function Le(e) {
568
- return R(Ie, e);
564
+ function Re(e) {
565
+ return R(Le, e);
569
566
  }
570
567
  //#endregion
571
568
  //#region src/ping.ts
572
- var Re = 6e3, ze = O("last_ping", "global"), Be = async (e) => {
569
+ var ze = 6e3, Be = O("last_ping", "global"), Ve = async (e) => {
573
570
  try {
574
- let t = Date.now(), n = E.get(ze), r = 0;
575
- if (n.isSet() && (r = n.json() ?? 0), r && t - r < Re) return !0;
571
+ let t = Date.now(), n = E.get(Be), r = 0;
572
+ if (n.isSet() && (r = n.json() ?? 0), r && t - r < ze) return !0;
576
573
  let i = {}, a = document.getElementById("picked_script")?.dataset.verceltoken;
577
574
  a && (i["x-vercel-protection-bypass"] = a);
578
- let o = await ue(e.apiUrl, {
575
+ let o = await de(e.apiUrl, {
579
576
  projectId: e.projectId,
580
577
  path: window.location.pathname
581
578
  }, { headers: i });
@@ -583,7 +580,7 @@ var Re = 6e3, ze = O("last_ping", "global"), Be = async (e) => {
583
580
  } catch {
584
581
  return !1;
585
582
  }
586
- }, K = M("lifecycle"), Ve = L(({ client: e }) => {
583
+ }, K = M("lifecycle"), He = L(({ client: e }) => {
587
584
  let t = K.store(!1), r = F(void 0, {
588
585
  skipVoid: !1,
589
586
  domain: K
@@ -599,11 +596,11 @@ var Re = 6e3, ze = O("last_ping", "global"), Be = async (e) => {
599
596
  }), u = P(), d = P(), f = P(), p = P(), m = P(), h = P();
600
597
  o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t), l.on(h, (e, t) => t), t.on(d, () => !0);
601
598
  let g = N(() => {
602
- Be(e);
599
+ Ve(e);
603
600
  }), _ = N(async () => {
604
601
  await ee();
605
602
  }), v = N(async () => {
606
- await he(e);
603
+ await ge(e);
607
604
  }), y = k({ effect: v }), b = k({
608
605
  source: o,
609
606
  effect: async (e) => {
@@ -625,7 +622,7 @@ var Re = 6e3, ze = O("last_ping", "global"), Be = async (e) => {
625
622
  clock: C,
626
623
  fn: () => "starting",
627
624
  target: a
628
- }), I({
625
+ }), C.watch(e.performance.markBegin), d.watch(e.performance.measure), I({
629
626
  clock: C,
630
627
  target: g
631
628
  }), I({
@@ -671,24 +668,24 @@ var Re = 6e3, ze = O("last_ping", "global"), Be = async (e) => {
671
668
  fn: () => ({ type: "initialize" }),
672
669
  target: e.eventBus
673
670
  });
674
- 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);
671
+ let w = F(!1).on(_.done, () => !0), T = F(!1).on(f, () => !0), te = F(!1).on(y.done, () => !0), E = A(r, i, (e, t) => e === !0 && t === !0);
675
672
  I({
676
673
  clock: f,
677
- source: D,
674
+ source: E,
678
675
  filter: (e) => e,
679
676
  fn: () => void 0,
680
677
  target: v
681
678
  });
682
- let O = A(w, T, D, (e, t, n) => e && t && n);
679
+ let D = A(w, T, E, (e, t, n) => e && t && n);
683
680
  I({
684
- clock: O,
681
+ clock: D,
685
682
  filter: (e) => e,
686
683
  fn: () => void 0,
687
684
  target: y
688
685
  });
689
- let te = A(w, T, D, E, (e, t, n, r) => e && t && (!n || r));
686
+ let O = A(w, T, E, te, (e, t, n, r) => e && t && (!n || r));
690
687
  return I({
691
- clock: te,
688
+ clock: O,
692
689
  filter: (e) => e,
693
690
  fn: () => void 0,
694
691
  target: d
@@ -732,13 +729,13 @@ var Re = 6e3, ze = O("last_ping", "global"), Be = async (e) => {
732
729
  setCondition: h
733
730
  };
734
731
  });
735
- function He(e) {
736
- return R(Ve, e);
732
+ function Ue(e) {
733
+ return R(He, e);
737
734
  }
738
735
  //#endregion
739
736
  //#region src/entities/predicate/predicate.ts
740
- var Ue = M("predicate"), We = L(({ client: e }) => {
741
- let t = Ue.store({}), n = j(t, { register(e, t) {
737
+ var We = M("predicate"), Ge = L(({ client: e }) => {
738
+ let t = We.store({}), n = j(t, { register(e, t) {
742
739
  return {
743
740
  ...e,
744
741
  [t.name]: {
@@ -796,26 +793,26 @@ var Ue = M("predicate"), We = L(({ client: e }) => {
796
793
  getEvokablePredicate: s
797
794
  };
798
795
  });
799
- function Ge(e) {
800
- return R(We, e);
796
+ function Ke(e) {
797
+ return R(Ge, e);
801
798
  }
802
- var Ke = (e, t, n) => {
799
+ var qe = (e, t, n) => {
803
800
  n.register({
804
801
  name: e,
805
802
  predicate: t
806
803
  });
807
804
  }, q = M("history");
808
- function qe(e, t) {
805
+ function Je(e, t) {
809
806
  return {
810
- id: ae(`history-entry-${Date.now()}-${Math.random()}}`),
807
+ id: oe(`history-entry-${Date.now()}-${Math.random()}}`),
811
808
  node: t,
812
809
  at: Date.now(),
813
810
  experienceId: e
814
811
  };
815
812
  }
816
- var Je = L(() => {
813
+ var Ye = L(() => {
817
814
  let e = q.store({ entries: [] }), t = q.event(), n = q.event(), r = q.event(), i = q.event();
818
- e.on(t, (e, t) => ({ entries: [...e.entries, qe(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), qe(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
815
+ e.on(t, (e, t) => ({ entries: [...e.entries, Je(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Je(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
819
816
  function a(e, t) {
820
817
  let n = {
821
818
  lastStepIndex: -1,
@@ -823,7 +820,7 @@ var Je = L(() => {
823
820
  };
824
821
  for (let r = e.length - 1; r >= 0; r--) {
825
822
  let i = e[r], a = i?.node;
826
- if (!(!a || !w(a)) && !(t && i.experienceId !== t)) if (n.lastStepIndex === -1) n.lastStepIndex = r;
823
+ if (!(!a || !T(a)) && !(t && i.experienceId !== t)) if (n.lastStepIndex === -1) n.lastStepIndex = r;
827
824
  else {
828
825
  n.secondLastStepIndex = r;
829
826
  break;
@@ -845,22 +842,22 @@ var Je = L(() => {
845
842
  entriesStore: e.map((e) => e.entries)
846
843
  };
847
844
  });
848
- function Ye() {
849
- return R(Je);
845
+ function Xe() {
846
+ return R(Ye);
850
847
  }
851
848
  //#endregion
852
849
  //#region src/utils/events.ts
853
- var Xe = 0, Ze = (e) => {
850
+ var Ze = 0, Qe = (e) => {
854
851
  let t = F([]);
855
852
  return t.on(e, (e, t) => [...e, {
856
- id: Xe++,
853
+ id: Ze++,
857
854
  at: /* @__PURE__ */ new Date(),
858
855
  payload: t
859
856
  }]), t;
860
857
  };
861
858
  //#endregion
862
859
  //#region src/entities/field/policies.ts
863
- function Qe(e) {
860
+ function $e(e) {
864
861
  let { doNotTrackValue: t, doNotStoreValue: n } = e ?? {}, r = e?.trackValue ?? t === !1, i = e?.storeValue ?? n === !1;
865
862
  return {
866
863
  trackValue: r,
@@ -871,10 +868,10 @@ function Qe(e) {
871
868
  }
872
869
  //#endregion
873
870
  //#region src/entities/field/field.ts
874
- var $e = M("field"), et = L(() => {
875
- let e = $e.store({}), t = j(e, {
871
+ var et = M("field"), tt = L(() => {
872
+ let e = et.store({}), t = j(e, {
876
873
  register(e, t) {
877
- let n = Object.assign({}, t.field, { policies: Qe(t.field.policies) });
874
+ let n = Object.assign({}, t.field, { policies: $e(t.field.policies) });
878
875
  return {
879
876
  ...e,
880
877
  [n.id]: n
@@ -886,7 +883,7 @@ var $e = M("field"), et = L(() => {
886
883
  let r = Object.assign({}, n, t.updates);
887
884
  return {
888
885
  ...e,
889
- [n.id]: Object.assign({}, r, { policies: Qe(r.policies) })
886
+ [n.id]: Object.assign({}, r, { policies: $e(r.policies) })
890
887
  };
891
888
  }
892
889
  });
@@ -923,13 +920,13 @@ var $e = M("field"), et = L(() => {
923
920
  getByName: c
924
921
  };
925
922
  });
926
- function tt() {
927
- return R(et);
923
+ function nt() {
924
+ return R(tt);
928
925
  }
929
926
  //#endregion
930
927
  //#region src/entities/step/step.ts
931
- var nt = M("step"), rt = L(() => {
932
- let e = nt.store({}), t = j(e, { register(e, t) {
928
+ var rt = M("step"), it = L(() => {
929
+ let e = rt.store({}), t = j(e, { register(e, t) {
933
930
  return {
934
931
  ...e,
935
932
  [t.step.id]: t.step
@@ -953,16 +950,16 @@ var nt = M("step"), rt = L(() => {
953
950
  indexStore: e
954
951
  };
955
952
  });
956
- function it() {
957
- return R(rt);
953
+ function at() {
954
+ return R(it);
958
955
  }
959
- function at(e, t) {
956
+ function ot(e, t) {
960
957
  t.register(e);
961
958
  }
962
959
  //#endregion
963
960
  //#region src/entities/content/content.ts
964
- var ot = M("content"), st = L(() => {
965
- let e = ot.store({}), t = j(e, {
961
+ var st = M("content"), ct = L(() => {
962
+ let e = st.store({}), t = j(e, {
966
963
  register(e, t) {
967
964
  return {
968
965
  ...e,
@@ -1003,16 +1000,16 @@ var ot = M("content"), st = L(() => {
1003
1000
  indexStore: e
1004
1001
  };
1005
1002
  });
1006
- function ct() {
1007
- return R(st);
1003
+ function lt() {
1004
+ return R(ct);
1008
1005
  }
1009
- function lt(e, t) {
1006
+ function ut(e, t) {
1010
1007
  t.register(e);
1011
1008
  }
1012
1009
  //#endregion
1013
1010
  //#region src/entities/action/action.ts
1014
- var ut = M("action"), dt = L(({ client: e }) => {
1015
- let t = ut.store({}), n = j(t, { register(e, t) {
1011
+ var dt = M("action"), ft = L(({ client: e }) => {
1012
+ let t = dt.store({}), n = j(t, { register(e, t) {
1016
1013
  return {
1017
1014
  ...e,
1018
1015
  [t.key]: {
@@ -1070,10 +1067,10 @@ var ut = M("action"), dt = L(({ client: e }) => {
1070
1067
  getEvokableAction: s
1071
1068
  };
1072
1069
  });
1073
- function ft(e) {
1074
- return R(dt, e);
1070
+ function pt(e) {
1071
+ return R(ft, e);
1075
1072
  }
1076
- var pt = (e, t, n) => {
1073
+ var mt = (e, t, n) => {
1077
1074
  n.register({
1078
1075
  key: e,
1079
1076
  action: t
@@ -1092,35 +1089,35 @@ function J(e, t, n, r) {
1092
1089
  function Y(e) {
1093
1090
  return e === null || e === "" || Array.isArray(e) && !e.length;
1094
1091
  }
1095
- function mt(e) {
1092
+ function ht(e) {
1096
1093
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
1097
1094
  }
1098
- function ht(e) {
1095
+ function gt(e) {
1099
1096
  try {
1100
1097
  return JSON.stringify(e), !0;
1101
1098
  } catch {
1102
1099
  return !1;
1103
1100
  }
1104
1101
  }
1105
- function gt(e, t) {
1102
+ function _t(e, t) {
1106
1103
  return t.find((t) => t.key === e) ?? null;
1107
1104
  }
1108
- function _t(e, t) {
1105
+ function vt(e, t) {
1109
1106
  return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
1110
1107
  }
1111
- function vt(e, t) {
1108
+ function yt(e, t) {
1112
1109
  if (e.type !== "object" || Y(t)) return null;
1113
1110
  if (e.multiple) {
1114
1111
  if (!Array.isArray(t)) return J(e, t, "This field expects multiple values", "Field expects an array of objects.");
1115
1112
  for (let n of t) {
1116
1113
  if (typeof n != "object" || !n) return J(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
1117
- if (!ht(n)) return J(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1114
+ if (!gt(n)) return J(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1118
1115
  }
1119
1116
  return null;
1120
1117
  }
1121
- return Array.isArray(t) ? J(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? J(e, t, "This field expects an object value", "Field expects an object value.") : ht(t) ? null : J(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1118
+ return Array.isArray(t) ? J(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? J(e, t, "This field expects an object value", "Field expects an object value.") : gt(t) ? null : J(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1122
1119
  }
1123
- function yt(e, t) {
1120
+ function bt(e, t) {
1124
1121
  if (Y(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
1125
1122
  let n = Array.isArray(t) ? t : [t];
1126
1123
  if (e.type === "object") {
@@ -1128,9 +1125,9 @@ function yt(e, t) {
1128
1125
  return n.every((e) => r.has(JSON.stringify(e))) ? null : J(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
1129
1126
  }
1130
1127
  let r = e.options.map((e) => e.value);
1131
- return n.every((e) => !mt(e) || e === null ? !1 : r.includes(e)) ? null : J(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
1128
+ return n.every((e) => !ht(e) || e === null ? !1 : r.includes(e)) ? null : J(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
1132
1129
  }
1133
- async function bt(t, n, r, i) {
1130
+ async function xt(t, n, r, i) {
1134
1131
  if (n.validation && !e(n.validation) && !Y(r)) {
1135
1132
  let e = i ? {
1136
1133
  $input: r,
@@ -1143,8 +1140,8 @@ async function bt(t, n, r, i) {
1143
1140
  }
1144
1141
  //#endregion
1145
1142
  //#region src/entities/response/response.ts
1146
- var xt = M("response"), St = L(({ client: e }) => {
1147
- let t = xt.store({}), r = P(), i = P(), a = j(t, {
1143
+ var St = M("response"), Ct = L(({ client: e }) => {
1144
+ let t = St.store({}), r = P(), i = P(), a = j(t, {
1148
1145
  register(e, t) {
1149
1146
  return {
1150
1147
  ...e,
@@ -1183,7 +1180,7 @@ var xt = M("response"), St = L(({ client: e }) => {
1183
1180
  ...t,
1184
1181
  ...n
1185
1182
  }, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
1186
- let o = gt(t, e);
1183
+ let o = _t(t, e);
1187
1184
  if (!o) {
1188
1185
  r.push({
1189
1186
  fieldKey: t,
@@ -1193,17 +1190,17 @@ var xt = M("response"), St = L(({ client: e }) => {
1193
1190
  });
1194
1191
  return;
1195
1192
  }
1196
- let c = _t(o, n), l = await bt(s, o, c, a);
1193
+ let c = vt(o, n), l = await xt(s, o, c, a);
1197
1194
  if (l) {
1198
1195
  r.push(l);
1199
1196
  return;
1200
1197
  }
1201
- let u = vt(o, c);
1198
+ let u = yt(o, c);
1202
1199
  if (u) {
1203
1200
  r.push(u);
1204
1201
  return;
1205
1202
  }
1206
- let d = yt(o, c);
1203
+ let d = bt(o, c);
1207
1204
  if (d) {
1208
1205
  r.push(d);
1209
1206
  return;
@@ -1282,13 +1279,13 @@ var xt = M("response"), St = L(({ client: e }) => {
1282
1279
  getByFieldName: _
1283
1280
  };
1284
1281
  });
1285
- function Ct(e) {
1286
- return R(St, e);
1282
+ function wt(e) {
1283
+ return R(Ct, e);
1287
1284
  }
1288
1285
  //#endregion
1289
1286
  //#region src/entities/condition/condition.ts
1290
- var wt = M("condition"), Tt = L(() => {
1291
- let e = wt.store({}), t = j(e, { register(e, t) {
1287
+ var Tt = M("condition"), Et = L(() => {
1288
+ let e = Tt.store({}), t = j(e, { register(e, t) {
1292
1289
  return {
1293
1290
  ...e,
1294
1291
  [t.condition.id]: t.condition
@@ -1312,12 +1309,12 @@ var wt = M("condition"), Tt = L(() => {
1312
1309
  indexStore: e
1313
1310
  };
1314
1311
  });
1315
- function Et() {
1316
- return R(Tt);
1312
+ function Dt() {
1313
+ return R(Et);
1317
1314
  }
1318
1315
  //#endregion
1319
1316
  //#region src/utils/api-url.ts
1320
- function Dt() {
1317
+ function Ot() {
1321
1318
  if (c()) {
1322
1319
  let e = [
1323
1320
  document.currentScript,
@@ -1332,7 +1329,7 @@ function Dt() {
1332
1329
  }
1333
1330
  //#endregion
1334
1331
  //#region src/utils/search-params.ts
1335
- function Ot() {
1332
+ function kt() {
1336
1333
  if (!s()) return {};
1337
1334
  let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
1338
1335
  for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
@@ -1349,14 +1346,55 @@ function Ot() {
1349
1346
  return t;
1350
1347
  }
1351
1348
  //#endregion
1349
+ //#region src/utils/user-timing.ts
1350
+ var At = "picked:start:begin", jt = "picked:start";
1351
+ function Mt() {
1352
+ try {
1353
+ return s() && !!p.window && "performance" in p;
1354
+ } catch {
1355
+ return !1;
1356
+ }
1357
+ }
1358
+ function Nt() {
1359
+ let e = null, t = null;
1360
+ return {
1361
+ markBegin: () => {
1362
+ if (Mt()) try {
1363
+ e = performance.mark(At).startTime;
1364
+ } catch {}
1365
+ },
1366
+ measure: () => {
1367
+ if (!(!Mt() || e === null)) try {
1368
+ t = performance.measure(jt, { start: e });
1369
+ } catch {}
1370
+ },
1371
+ get startMeasure() {
1372
+ return t;
1373
+ }
1374
+ };
1375
+ }
1376
+ //#endregion
1377
+ //#region src/utils/client-telemetry.ts
1378
+ function Pt() {
1379
+ let e = null;
1380
+ return {
1381
+ observeDeliveryAPIRequests: (t) => {
1382
+ e = t;
1383
+ },
1384
+ get deliveryAPIRequestObserver() {
1385
+ return e;
1386
+ }
1387
+ };
1388
+ }
1389
+ //#endregion
1352
1390
  //#region src/entities/session/session.ts
1353
- var kt = O("session", "global");
1354
- function At() {
1355
- 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)}`;
1391
+ var Ft = O("session", "global");
1392
+ function It() {
1393
+ return m() ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}`;
1356
1394
  }
1357
- function jt() {
1358
- if (!m()) return null;
1359
- let e = E.get(kt);
1395
+ function Lt() {
1396
+ if (!h()) return null;
1397
+ let e = E.get(Ft);
1360
1398
  if (!e.isSet()) return null;
1361
1399
  try {
1362
1400
  return e.json();
@@ -1364,8 +1402,8 @@ function jt() {
1364
1402
  return null;
1365
1403
  }
1366
1404
  }
1367
- var Mt = L(() => {
1368
- let e = jt(), t = { id: e?.id ?? At() };
1405
+ var Rt = L(() => {
1406
+ let e = Lt(), t = { id: e?.id ?? It() };
1369
1407
  e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
1370
1408
  let n = F(t), r = j(n, {
1371
1409
  setIsUser: (e, t) => ({
@@ -1390,8 +1428,8 @@ var Mt = L(() => {
1390
1428
  }), i = k({
1391
1429
  source: n,
1392
1430
  effect: (e) => {
1393
- if (m()) try {
1394
- E.get(kt).set(e);
1431
+ if (h()) try {
1432
+ E.get(Ft).set(e);
1395
1433
  } catch {}
1396
1434
  }
1397
1435
  });
@@ -1405,27 +1443,27 @@ var Mt = L(() => {
1405
1443
  removeIdentifier: r.removeIdentifier
1406
1444
  };
1407
1445
  });
1408
- function Nt() {
1409
- return R(Mt, void 0);
1446
+ function zt() {
1447
+ return R(Rt, void 0);
1410
1448
  }
1411
1449
  //#endregion
1412
1450
  //#region src/utils/picked-config.ts
1413
- function Pt() {
1451
+ function Bt() {
1414
1452
  if (s()) return globalThis.window.pickedConfig;
1415
1453
  }
1416
- function Ft() {
1417
- if (s()) return Pt()?.projectId;
1454
+ function Vt() {
1455
+ if (s()) return Bt()?.projectId;
1418
1456
  }
1419
- function It() {
1457
+ function Ht() {
1420
1458
  if (!c()) return;
1421
1459
  let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
1422
1460
  if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
1423
1461
  }
1424
- function Lt(e) {
1462
+ function Ut(e) {
1425
1463
  if (e.projectId) return e.projectId;
1426
- let t = Ft();
1464
+ let t = Vt();
1427
1465
  if (t) return t;
1428
- let n = It();
1466
+ let n = Ht();
1429
1467
  if (n) return n;
1430
1468
  throw Error("projectId is required. You can provide it via one of:\n (1) createClient({ projectId }) options;\n (2) window.pickedConfig = { projectId };\n (3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes a data-projectid (or project-id) attribute.");
1431
1469
  }
@@ -1434,7 +1472,7 @@ function Lt(e) {
1434
1472
  function X(e) {
1435
1473
  return e == null || e === "" || Number.isNaN(e);
1436
1474
  }
1437
- var Rt = {
1475
+ var Wt = {
1438
1476
  default: (e, t) => X(e) ? String(t ?? "") : String(e),
1439
1477
  append: (e, t) => t && !X(e) ? `${e} ${t}` : e,
1440
1478
  prepend: (e, t) => t && !X(e) ? `${t} ${e}` : e,
@@ -1455,24 +1493,24 @@ var Rt = {
1455
1493
  return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
1456
1494
  }
1457
1495
  };
1458
- function zt(e) {
1496
+ function Gt(e) {
1459
1497
  return typeof e == "object" && !!e;
1460
1498
  }
1461
- function Bt(e, t) {
1499
+ function Kt(e, t) {
1462
1500
  let n = t;
1463
- for (let t of e.split(".")) if (zt(n) && t in n) n = n[t];
1501
+ for (let t of e.split(".")) if (Gt(n) && t in n) n = n[t];
1464
1502
  else return;
1465
1503
  return typeof n == "function" ? n() : n;
1466
1504
  }
1467
- function Vt(e, t) {
1468
- let n = e.split("|").map((e) => e.trim()), r = Bt(n.shift() ?? "", t);
1505
+ function qt(e, t) {
1506
+ let n = e.split("|").map((e) => e.trim()), r = Kt(n.shift() ?? "", t);
1469
1507
  for (let e of n) {
1470
- let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = Rt[i];
1508
+ let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = Wt[i];
1471
1509
  o && (r = o(r, a));
1472
1510
  }
1473
1511
  return X(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
1474
1512
  }
1475
- function Ht(e, t) {
1513
+ function Jt(e, t) {
1476
1514
  let n = "", r = 0;
1477
1515
  for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
1478
1516
  r += 2;
@@ -1484,19 +1522,19 @@ function Ht(e, t) {
1484
1522
  }
1485
1523
  i += e[r++];
1486
1524
  }
1487
- n += Vt(i.trim(), t);
1525
+ n += qt(i.trim(), t);
1488
1526
  } else n += e[r++];
1489
1527
  return n;
1490
1528
  }
1491
1529
  //#endregion
1492
1530
  //#region src/utils/preview-session.ts
1493
- var Ut = "preview-token";
1494
- function Wt() {
1495
- return !s() || !h() ? !1 : !!Ot()[Ut]?.[0];
1531
+ var Yt = "preview-token";
1532
+ function Xt() {
1533
+ return !s() || !g() ? !1 : !!kt()[Yt]?.[0];
1496
1534
  }
1497
1535
  //#endregion
1498
1536
  //#region src/picked.ts
1499
- var Gt = class {
1537
+ var Zt = class {
1500
1538
  static logger = r;
1501
1539
  options;
1502
1540
  dataSource = null;
@@ -1505,6 +1543,7 @@ var Gt = class {
1505
1543
  contentLoader;
1506
1544
  previewEmbedderOrigins = null;
1507
1545
  plugins = {};
1546
+ telemetry = Pt();
1508
1547
  dataProviders = /* @__PURE__ */ new Map();
1509
1548
  eventBus = P();
1510
1549
  events;
@@ -1512,53 +1551,55 @@ var Gt = class {
1512
1551
  apiUrl;
1513
1552
  dashboardUrl;
1514
1553
  documentationSiteUrl;
1515
- session = Nt();
1516
- searchParams = Ot();
1517
- history = Ye();
1518
- components = Se({ client: this });
1519
- experienceInstances = S({ client: this });
1520
- experiences = me({ client: this });
1521
- frameworks = Ee({ client: this });
1522
- predicates = Ge({ client: this });
1523
- features = ne({ client: this });
1524
- conditions = Et();
1525
- fields = tt();
1526
- responses = Ct({ client: this });
1527
- steps = it();
1528
- contents = ct();
1529
- actions = ft({ client: this });
1530
- conditionResults = C();
1531
- stateSnapshotStore = ke({ client: this });
1532
- evaluateRuleLogicFx = Le({ client: this });
1554
+ session = zt();
1555
+ performance = Nt();
1556
+ searchParams = kt();
1557
+ history = Xe();
1558
+ components = Ce({ client: this });
1559
+ experienceInstances = C({ client: this });
1560
+ experiences = he({ client: this });
1561
+ frameworks = De({ client: this });
1562
+ predicates = Ke({ client: this });
1563
+ features = re({ client: this });
1564
+ conditions = Dt();
1565
+ fields = nt();
1566
+ responses = wt({ client: this });
1567
+ steps = at();
1568
+ contents = lt();
1569
+ actions = pt({ client: this });
1570
+ conditionResults = w();
1571
+ stateSnapshotStore = Ae({ client: this });
1572
+ evaluateRuleLogicFx = Re({ client: this });
1533
1573
  start;
1534
1574
  readyStore;
1535
1575
  preconditionPassedStore;
1536
1576
  conditionPassedStore;
1537
1577
  lifecycleStageStore;
1538
- lifecycle = He({ client: this });
1578
+ lifecycle = Ue({ client: this });
1539
1579
  renderStringFx = k({
1540
1580
  source: this.responses.listStore,
1541
1581
  effect: (e, { template: t, context: n }) => {
1542
1582
  let r = {};
1543
1583
  for (let t of e) r[t.fieldKey] = t.value;
1544
- return Ht(t, {
1584
+ return Jt(t, {
1545
1585
  ...n,
1546
1586
  responses: r
1547
1587
  });
1548
1588
  }
1549
1589
  });
1550
1590
  constructor(e) {
1551
- this.events = Ze(this.eventBus), this.projectId = Lt(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Dt(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupFields(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
1591
+ this.events = Qe(this.eventBus), this.projectId = Ut(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Ot(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupFields(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
1552
1592
  type: "load",
1553
- version: ie()
1593
+ version: ae()
1554
1594
  }), this.maybeStartPreviewChannel();
1555
1595
  }
1556
1596
  dataProviderFor(e) {
1557
1597
  let t = e ?? "", n = this.dataProviders.get(t);
1558
1598
  if (n) return n;
1559
- let r = import("../provider-D5CCq15k.js").then((t) => t.createPickedDataProvider({
1599
+ let r = import("../provider-DH9rfY2L.js").then((t) => t.createPickedDataProvider({
1560
1600
  apiUrl: this.apiUrl,
1561
1601
  projectId: this.projectId,
1602
+ getRequestObserver: () => this.telemetry.deliveryAPIRequestObserver,
1562
1603
  ...e !== void 0 && { previewToken: e }
1563
1604
  }));
1564
1605
  return this.dataProviders.set(t, r), r;
@@ -1572,24 +1613,24 @@ var Gt = class {
1572
1613
  return (await this.dataProviderFor(t?.previewToken)).getContent(e, t?.signal === void 0 ? void 0 : { signal: t.signal });
1573
1614
  }
1574
1615
  maybeStartPreviewChannel() {
1575
- Wt() && import("../preview-channel-CSr96XAo.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
1616
+ Xt() && import("../preview-channel-CSr96XAo.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
1576
1617
  }
1577
1618
  registerFramework = (e) => {
1578
- De(e, this.frameworks);
1619
+ Oe(e, this.frameworks);
1579
1620
  };
1580
1621
  registerComponent = (e, t) => {
1581
- Ce(e, t, this.components);
1622
+ we(e, t, this.components);
1582
1623
  };
1583
1624
  registerPlugin = (e) => {
1584
- _e(this, e, this.plugins);
1625
+ ve(this, e, this.plugins);
1585
1626
  let t = this.plugins[e.name];
1586
1627
  t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
1587
1628
  };
1588
1629
  registerFeature = (e, t) => {
1589
- te(e, t, this.features);
1630
+ ne(e, t, this.features);
1590
1631
  };
1591
1632
  registerPredicate = (e, t) => {
1592
- Ke(e, t, this.predicates);
1633
+ qe(e, t, this.predicates);
1593
1634
  };
1594
1635
  registerCondition = (e) => {
1595
1636
  this.conditions.register(e);
@@ -1598,19 +1639,19 @@ var Gt = class {
1598
1639
  this.fields.register(e);
1599
1640
  };
1600
1641
  registerStep = (e) => {
1601
- at(e, this.steps);
1642
+ ot(e, this.steps);
1602
1643
  };
1603
1644
  registerContent = (e) => {
1604
- lt(e, this.contents);
1645
+ ut(e, this.contents);
1605
1646
  };
1606
1647
  patchContent = (e, t) => {
1607
1648
  this.contents.patch(e, t);
1608
1649
  };
1609
1650
  registerAction = (e, t) => {
1610
- pt(e, t, this.actions);
1651
+ mt(e, t, this.actions);
1611
1652
  };
1612
1653
  registerExperience = (e) => {
1613
- e.component && Ce(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
1654
+ e.component && we(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
1614
1655
  };
1615
1656
  launchExperienceById = async (e, t) => {
1616
1657
  this.experiences.launch({
@@ -1653,7 +1694,7 @@ var Gt = class {
1653
1694
  this.registerFeature(e, n);
1654
1695
  }), this.searchParams.feature && this.searchParams.feature.forEach((e) => {
1655
1696
  try {
1656
- let t = re(e);
1697
+ let t = ie(e);
1657
1698
  if (!t) return;
1658
1699
  let { id: n, bucket: r } = t;
1659
1700
  this.registerFeature(n, {
@@ -1703,8 +1744,8 @@ var Gt = class {
1703
1744
  });
1704
1745
  }
1705
1746
  getPluginConfig = (e) => this.plugins[e] ?? {};
1706
- }, Kt = "application/picked-javascript", qt = "application/picked-module", Jt = "data-picked-hydrated";
1707
- async function Yt(e) {
1747
+ }, Qt = "application/picked-javascript", $t = "application/picked-module", en = "data-picked-hydrated";
1748
+ async function tn(e) {
1708
1749
  if (!("document" in globalThis)) return;
1709
1750
  let t = "application/picked-module", n = "data-picked-hydrated";
1710
1751
  function r(e) {
@@ -1733,23 +1774,23 @@ async function Yt(e) {
1733
1774
  a && await a;
1734
1775
  }
1735
1776
  }
1736
- function Xt() {
1737
- return `<script>(${Yt.toString()})(document)<\/script>`;
1777
+ function nn() {
1778
+ return `<script>(${tn.toString()})(document)<\/script>`;
1738
1779
  }
1739
1780
  //#endregion
1740
1781
  //#region src/utils/html-asset-value.ts
1741
- function Zt(e) {
1782
+ function rn(e) {
1742
1783
  return typeof e == "object" && !!e && "id" in e && typeof e.id == "string" && "content" in e && (typeof e.content == "string" || e.content === null);
1743
1784
  }
1744
1785
  //#endregion
1745
1786
  //#region src/entities/component/lazyComponent.ts
1746
- function Qt(e) {
1787
+ function an(e) {
1747
1788
  return {
1748
1789
  $$type: "lazy-component",
1749
1790
  load: e
1750
1791
  };
1751
1792
  }
1752
- function $t(e) {
1793
+ function on(e) {
1753
1794
  return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
1754
1795
  }
1755
1796
  //#endregion
@@ -1765,10 +1806,10 @@ function $(e) {
1765
1806
  for (let e of t) Z(e) && n.push(e.contentEntryId);
1766
1807
  return n;
1767
1808
  }
1768
- function en(e, t) {
1809
+ function sn(e, t) {
1769
1810
  return t === null ? null : e[t] ?? null;
1770
1811
  }
1771
- function tn(e, t) {
1812
+ function cn(e, t) {
1772
1813
  let n = [];
1773
1814
  for (let r of t) {
1774
1815
  let t = e[r];
@@ -1776,29 +1817,29 @@ function tn(e, t) {
1776
1817
  }
1777
1818
  return n;
1778
1819
  }
1779
- function nn(e, t) {
1780
- if (le.store(t)) return A(t, e.indexStore, (e, t) => en(t, Q(e)));
1820
+ function ln(e, t) {
1821
+ if (ue.store(t)) return A(t, e.indexStore, (e, t) => sn(t, Q(e)));
1781
1822
  let n = Q(t);
1782
- return e.indexStore.map((e) => en(e, n), { skipVoid: !1 });
1823
+ return e.indexStore.map((e) => sn(e, n), { skipVoid: !1 });
1783
1824
  }
1784
- function rn(e, t) {
1785
- if (le.store(t)) return A(t, e.indexStore, (e, t) => tn(t, $(e)));
1825
+ function un(e, t) {
1826
+ if (ue.store(t)) return A(t, e.indexStore, (e, t) => cn(t, $(e)));
1786
1827
  let n = $(t);
1787
- return e.indexStore.map((e) => tn(e, n), { skipVoid: !1 });
1828
+ return e.indexStore.map((e) => cn(e, n), { skipVoid: !1 });
1788
1829
  }
1789
1830
  //#endregion
1790
1831
  //#region src/exports.ts
1791
- var an = (e) => {
1792
- let t = new Gt(e);
1832
+ var dn = (e) => {
1833
+ let t = new Zt(e);
1793
1834
  return u(t), t;
1794
1835
  };
1795
1836
  //#endregion
1796
1837
  //#region src/typed-content.ts
1797
- function on(e) {
1838
+ function fn(e) {
1798
1839
  return typeof e.data == "object";
1799
1840
  }
1800
- function sn(e) {
1801
- return e.map((e) => !e || !on(e) ? null : e, { skipVoid: !1 });
1841
+ function pn(e) {
1842
+ return e.map((e) => !e || !fn(e) ? null : e, { skipVoid: !1 });
1802
1843
  }
1803
1844
  //#endregion
1804
- export { Jt as PICKED_HYDRATED_ATTR, qt as PICKED_MODULE_SCRIPT_TYPE, Kt as PICKED_SCRIPT_TYPE, Ut as PREVIEW_TOKEN_PARAM, Gt as Picked, Xt as buildRehydrateBootstrap, an as createClient, ge as createPluginEffect, O as createStorageKey, nn as deriveReference, rn as deriveReferences, n as evaluateRuleLogic, Pt as getPickedConfig, Z as isContentReference, Zt as isHtmlAssetValue, h as isInsideIframe, $t as isLazyLoader, _ as isPickedRoot, Wt as isPreviewSession, Qt as lazyComponent, E as localStore, ce as onInertScriptSubtrees, Q as readReferenceId, $ as readReferenceIds, Yt as rehydrateScripts, oe as reportInertScriptSubtrees, se as resetInertScriptReport, 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, sn as toTypedContentStore };
1845
+ export { en as PICKED_HYDRATED_ATTR, $t as PICKED_MODULE_SCRIPT_TYPE, Qt as PICKED_SCRIPT_TYPE, Yt as PREVIEW_TOKEN_PARAM, Zt as Picked, nn as buildRehydrateBootstrap, dn as createClient, _e as createPluginEffect, O as createStorageKey, ln as deriveReference, un as deriveReferences, n as evaluateRuleLogic, Bt as getPickedConfig, Z as isContentReference, rn as isHtmlAssetValue, g as isInsideIframe, on as isLazyLoader, v as isPickedRoot, Xt as isPreviewSession, an as lazyComponent, E as localStore, le as onInertScriptSubtrees, Q as readReferenceId, $ as readReferenceIds, tn as rehydrateScripts, se as reportInertScriptSubtrees, ce as resetInertScriptReport, D as sessionStore, te as subscribe, d as supportsCookies, m as supportsCryptoRandomUUID, c as supportsDocument, i as supportsHistory, f as supportsIntersectionObserver, h as supportsLocalStorage, a as supportsLocation, l as supportsSessionStorage, _ as supportsShadowRoot, o as supportsWebComponents, s as supportsWindow, pn as toTypedContentStore };