@picked/client 0.0.71-next.1 → 0.0.71-next.2

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 (148) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/{api-CgqRvuKL.js → api-B0ydpQBE.js} +1 -1
  3. package/dist/{api-CH2FNa6S.cjs → api-CObostrU.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/server/index.js +1 -1
  7. package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
  8. package/dist/docs/explanation/feature-flag-allocation.md +176 -0
  9. package/dist/docs/explanation/how-picked-works.md +102 -0
  10. package/dist/docs/explanation/how-pickedql-works.md +76 -0
  11. package/dist/docs/explanation/pages-and-flows.md +64 -0
  12. package/dist/docs/explanation/the-content-model.md +77 -0
  13. package/dist/docs/explanation/the-two-apis.md +68 -0
  14. package/dist/docs/explanation/why-server-side-rendering.md +76 -0
  15. package/dist/docs/explanation/workspaces-and-versions.md +71 -0
  16. package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
  17. package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +19 -6
  18. package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
  19. package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
  20. package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
  21. package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
  22. package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
  23. package/dist/docs/{flow-builder/building-flows.md → how-to/build-a-flow.md} +13 -9
  24. package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
  25. package/dist/docs/how-to/create-a-project.md +29 -0
  26. package/dist/docs/how-to/create-an-experience.md +42 -0
  27. package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
  28. package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
  29. package/dist/docs/how-to/define-a-page-layout.md +39 -0
  30. package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
  31. package/dist/docs/{gtm-template.md → how-to/install-the-gtm-template.md} +9 -3
  32. package/dist/docs/how-to/install-the-sdk.md +68 -0
  33. package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
  34. package/dist/docs/how-to/invite-and-remove-members.md +34 -0
  35. package/dist/docs/how-to/preview-a-workspace.md +28 -0
  36. package/dist/docs/how-to/publish-a-workspace.md +30 -0
  37. package/dist/docs/how-to/read-a-feature-flag.md +101 -0
  38. package/dist/docs/how-to/register-a-component.md +55 -0
  39. package/dist/docs/how-to/register-an-action-handler.md +67 -0
  40. package/dist/docs/how-to/render-a-step-form.md +132 -0
  41. package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
  42. package/dist/docs/how-to/reuse-a-section.md +37 -0
  43. package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
  44. package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
  45. package/dist/docs/how-to/run-an-ab-test.md +49 -0
  46. package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
  47. package/dist/docs/how-to/server-render-a-page.md +81 -0
  48. package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
  49. package/dist/docs/how-to/set-up-mfa.md +69 -0
  50. package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
  51. package/dist/docs/how-to/validate-a-field.md +52 -0
  52. package/dist/docs/how-to/write-a-condition.md +45 -0
  53. package/dist/docs/how-to/write-a-predicate.md +60 -0
  54. package/dist/docs/index.md +41 -70
  55. package/dist/docs/reference/dashboard/actions.mdx +53 -0
  56. package/dist/docs/{api-keys.mdx → reference/dashboard/api-keys.mdx} +7 -15
  57. package/dist/docs/reference/dashboard/conditions.mdx +42 -0
  58. package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
  59. package/dist/docs/{content → reference/dashboard/content}/content-entries.mdx +11 -3
  60. package/dist/docs/{content → reference/dashboard/content}/layouts.mdx +11 -35
  61. package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
  62. package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
  63. package/dist/docs/{experiences.mdx → reference/dashboard/experiences.mdx} +9 -16
  64. package/dist/docs/{features.mdx → reference/dashboard/features.mdx} +26 -41
  65. package/dist/docs/{fields.mdx → reference/dashboard/fields.mdx} +26 -20
  66. package/dist/docs/{flow-builder/overview.mdx → reference/dashboard/flow-builder/canvas.mdx} +8 -13
  67. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/condition-builder.md +5 -13
  68. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/keyboard-shortcuts.md +7 -1
  69. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/nodes.md +10 -3
  70. package/dist/docs/reference/dashboard/projects.mdx +44 -0
  71. package/dist/docs/reference/dashboard/reports.mdx +43 -0
  72. package/dist/docs/reference/dashboard/steps.mdx +37 -0
  73. package/dist/docs/{team-management.md → reference/dashboard/team-management.md} +5 -22
  74. package/dist/docs/{workspace-versioning.mdx → reference/dashboard/workspace-versioning.mdx} +6 -10
  75. package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
  76. package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +11 -4
  77. package/dist/docs/reference/delivery-api/index.md +45 -0
  78. package/dist/docs/{delivery-api → reference/delivery-api}/preview-caching-crawling.md +12 -5
  79. package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +11 -4
  80. package/dist/docs/reference/glossary.md +173 -0
  81. package/dist/docs/reference/management-api/authentication.md +74 -0
  82. package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +10 -3
  83. package/dist/docs/{api → reference/management-api}/error-handling.md +9 -3
  84. package/dist/docs/{api → reference/management-api}/pagination.md +6 -0
  85. package/dist/docs/{pickedql → reference/pickedql}/data-sources.md +16 -9
  86. package/dist/docs/{pickedql → reference/pickedql}/dimensions.md +7 -0
  87. package/dist/docs/{pickedql → reference/pickedql}/filtering.md +7 -0
  88. package/dist/docs/reference/pickedql/index.md +18 -0
  89. package/dist/docs/{pickedql → reference/pickedql}/schema.md +13 -6
  90. package/dist/docs/{pickedql → reference/pickedql}/virtual-functions.md +7 -0
  91. package/dist/docs/reference/sdk/actions.md +30 -0
  92. package/dist/docs/{sdk → reference/sdk}/conditions.md +8 -1
  93. package/dist/docs/reference/sdk/content-security-policy.md +21 -0
  94. package/dist/docs/reference/sdk/experiences.md +51 -0
  95. package/dist/docs/{sdk → reference/sdk}/features.md +30 -117
  96. package/dist/docs/{sdk → reference/sdk}/fields.md +10 -88
  97. package/dist/docs/reference/sdk/index.md +68 -0
  98. package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +10 -22
  99. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +26 -0
  100. package/dist/docs/reference/sdk/plugins/index.md +29 -0
  101. package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
  102. package/dist/docs/reference/sdk/predicates.md +43 -0
  103. package/dist/docs/reference/sdk/ssr/index.md +33 -0
  104. package/dist/docs/{sdk → reference/sdk}/ssr/rendering-and-hydration.md +4 -63
  105. package/dist/docs/{sdk → reference/sdk}/ssr/serialize.md +6 -33
  106. package/dist/docs/{sdk → reference/sdk}/ssr/slots-and-placements.md +7 -1
  107. package/dist/docs/reference/sdk/steps.md +87 -0
  108. package/dist/docs/reference/tools/chrome-extension.md +16 -0
  109. package/dist/docs/{image-optimisation-service.md → reference/tools/image-optimisation-service.md} +8 -0
  110. package/dist/docs/{mcp.md → reference/tools/mcp.md} +5 -45
  111. package/dist/docs/{vite-plugin.md → reference/tools/vite-plugin.md} +8 -38
  112. package/dist/docs/{api/index.md → tutorials/first-api-call.md} +27 -15
  113. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
  114. package/dist/docs/tutorials/first-experience.mdx +255 -0
  115. package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
  116. package/dist/esm/index.js +260 -257
  117. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  118. package/dist/esm/server/index.js +1 -1
  119. package/dist/{plugin-DCW-tnjO.cjs → plugin-CNna0UjB.cjs} +1 -1
  120. package/dist/{plugin-D2UqFikQ.js → plugin-DUOJpHaq.js} +1 -1
  121. package/dist/types/entities/feature/feature.d.ts +16 -0
  122. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  123. package/dist/types/picked.d.ts.map +1 -1
  124. package/package.json +1 -1
  125. package/dist/docs/actions.mdx +0 -98
  126. package/dist/docs/api/authentication.md +0 -403
  127. package/dist/docs/chrome-extension.md +0 -68
  128. package/dist/docs/conditions.mdx +0 -72
  129. package/dist/docs/content/asset-library.mdx +0 -124
  130. package/dist/docs/content/pages.mdx +0 -82
  131. package/dist/docs/content/sections.mdx +0 -44
  132. package/dist/docs/delivery-api/index.md +0 -53
  133. package/dist/docs/guides/build-a-personalized-page.mdx +0 -161
  134. package/dist/docs/pickedql/index.md +0 -54
  135. package/dist/docs/projects.mdx +0 -44
  136. package/dist/docs/reports.mdx +0 -20
  137. package/dist/docs/sdk/actions.md +0 -82
  138. package/dist/docs/sdk/content-security-policy.md +0 -33
  139. package/dist/docs/sdk/experiences.md +0 -64
  140. package/dist/docs/sdk/feature-allocation.md +0 -161
  141. package/dist/docs/sdk/index.md +0 -98
  142. package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -84
  143. package/dist/docs/sdk/plugins/index.md +0 -9
  144. package/dist/docs/sdk/predicates.md +0 -128
  145. package/dist/docs/sdk/ssr/index.md +0 -79
  146. package/dist/docs/sdk/steps.md +0 -479
  147. package/dist/docs/steps.mdx +0 -53
  148. package/dist/docs/workspaces.mdx +0 -133
package/dist/esm/index.js CHANGED
@@ -5,7 +5,7 @@ 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
5
5
  import { a as _, i as v, r as ee, s as y, t as b } from "../dom-BqcToNL0.js";
6
6
  import { l as x, n as S, r as C, u as w } from "../experience-instance-DGk11d8a.js";
7
7
  import { i as T, n as E, r as D, t as O } from "../storage-1MW3-_As.js";
8
- import { n as te, r as ne } from "../api-CgqRvuKL.js";
8
+ import { n as te, r as ne } from "../api-B0ydpQBE.js";
9
9
  import { t as re } from "../id-Bo4RBeOs.js";
10
10
  import { n as ie, r as ae, t as oe } from "../inert-script-report-B_bMPRzp.js";
11
11
  import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, sample as I } from "effector";
@@ -258,13 +258,13 @@ var _e = L(({ client: e }) => {
258
258
  function ve(e) {
259
259
  return R(_e, e);
260
260
  }
261
- var ye = (e, t, n) => {
261
+ var B = (e, t, n) => {
262
262
  n.register({
263
263
  name: e,
264
264
  component: t
265
265
  });
266
- }, be = M("framework"), xe = L((e) => {
267
- let t = be.store({}), n = j(t, { register(e, t) {
266
+ }, ye = M("framework"), be = L((e) => {
267
+ let t = ye.store({}), n = j(t, { register(e, t) {
268
268
  return {
269
269
  ...e,
270
270
  [t.name]: t.framework
@@ -289,15 +289,15 @@ var ye = (e, t, n) => {
289
289
  listStore: a
290
290
  };
291
291
  });
292
- function Se(e) {
293
- return R(xe, e);
292
+ function xe(e) {
293
+ return R(be, e);
294
294
  }
295
- var Ce = (e, t) => {
295
+ var Se = (e, t) => {
296
296
  t.register({
297
297
  name: e.name,
298
298
  framework: e
299
299
  });
300
- }, we = L(({ client: e }) => {
300
+ }, Ce = L(({ client: e }) => {
301
301
  let t = "window" in globalThis, n = {
302
302
  location: t ? globalThis.location : void 0,
303
303
  document: t ? globalThis.document : void 0,
@@ -311,84 +311,84 @@ var Ce = (e, t) => {
311
311
  ...n
312
312
  }));
313
313
  });
314
- function Te(e) {
315
- return R(we, e);
314
+ function we(e) {
315
+ return R(Ce, e);
316
316
  }
317
317
  //#endregion
318
318
  //#region src/logic-engine.ts
319
- function Ee(e) {
319
+ function Te(e) {
320
320
  return typeof e == "number" && !isNaN(e);
321
321
  }
322
- function B(e) {
322
+ function V(e) {
323
323
  return typeof e == "string";
324
324
  }
325
- function V(e) {
325
+ function H(e) {
326
326
  return Array.isArray(e);
327
327
  }
328
- function De(e) {
328
+ function U(e) {
329
329
  return e instanceof Promise;
330
330
  }
331
- function Oe(e) {
331
+ function Ee(e) {
332
332
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
333
333
  }
334
- function H(e) {
335
- if (Ee(e)) return e;
334
+ function W(e) {
335
+ if (Te(e)) return e;
336
336
  let t = parseFloat(`${e}`);
337
337
  return isNaN(t) ? 0 : t;
338
338
  }
339
- function U(e) {
339
+ function G(e) {
340
340
  return `${e}`;
341
341
  }
342
- var ke = {
342
+ var De = {
343
343
  "==": (e, t) => e == t,
344
344
  "===": (e, t) => e === t,
345
345
  "!=": (e, t) => e != t,
346
346
  "!==": (e, t) => e !== t,
347
- ">": (e, t) => H(e) > H(t),
348
- ">=": (e, t) => H(e) >= H(t),
347
+ ">": (e, t) => W(e) > W(t),
348
+ ">=": (e, t) => W(e) >= W(t),
349
349
  "<": (e, t, n) => {
350
- let r = H(e), i = H(t);
350
+ let r = W(e), i = W(t);
351
351
  if (n === void 0) return r < i;
352
- let a = H(n);
352
+ let a = W(n);
353
353
  return r < i && i < a;
354
354
  },
355
355
  "<=": (e, t, n) => {
356
- let r = H(e), i = H(t);
356
+ let r = W(e), i = W(t);
357
357
  if (n === void 0) return r <= i;
358
- let a = H(n);
358
+ let a = W(n);
359
359
  return r <= i && i <= a;
360
360
  },
361
- "!!": async (e) => await G(e),
362
- "!": async (e) => !await G(e),
363
- "%": (e, t) => H(e) % H(t),
361
+ "!!": async (e) => await q(e),
362
+ "!": async (e) => !await q(e),
363
+ "%": (e, t) => W(e) % W(t),
364
364
  log: (e) => (console.log(e), e),
365
- in: (e, t) => t ? B(t) ? t.indexOf(U(e)) !== -1 : V(t) ? t.includes(e) : !1 : !1,
366
- cat: (...e) => e.map(U).join(""),
365
+ in: (e, t) => t ? V(t) ? t.indexOf(G(e)) !== -1 : H(t) ? t.includes(e) : !1 : !1,
366
+ cat: (...e) => e.map(G).join(""),
367
367
  substr: (e, t, n) => {
368
- let r = U(e), i = H(t);
368
+ let r = G(e), i = W(t);
369
369
  if (n === void 0) return r.substr(i);
370
- let a = H(n);
370
+ let a = W(n);
371
371
  if (a < 0) {
372
372
  let e = r.substr(i);
373
373
  return e.substr(0, e.length + a);
374
374
  }
375
375
  return r.substr(i, a);
376
376
  },
377
- "+": (...e) => e.reduce((e, t) => H(e) + H(t), 0),
378
- "*": (...e) => e.reduce((e, t) => H(e) * H(t), 1),
377
+ "+": (...e) => e.reduce((e, t) => W(e) + W(t), 0),
378
+ "*": (...e) => e.reduce((e, t) => W(e) * W(t), 1),
379
379
  "-": (e, t) => {
380
- let n = H(e);
381
- return t === void 0 ? -n : n - H(t);
380
+ let n = W(e);
381
+ return t === void 0 ? -n : n - W(t);
382
382
  },
383
- "/": (e, t) => H(e) / H(t),
384
- min: (...e) => Math.min(...e.map(H)),
385
- max: (...e) => Math.max(...e.map(H)),
386
- merge: (...e) => e.reduce((e, t) => V(t) ? e.concat(t) : e.concat([t]), []),
383
+ "/": (e, t) => W(e) / W(t),
384
+ min: (...e) => Math.min(...e.map(W)),
385
+ max: (...e) => Math.max(...e.map(W)),
386
+ merge: (...e) => e.reduce((e, t) => H(t) ? e.concat(t) : e.concat([t]), []),
387
387
  var(e, t) {
388
388
  let n = arguments.length > 1 ? t : null;
389
389
  if (e === "" || e === "." || e == null) return this;
390
390
  if (typeof e == "number" && Array.isArray(this)) return e >= 0 && e < this.length ? this[e] : n;
391
- let r = U(e);
391
+ let r = G(e);
392
392
  if (r === "" || r === ".") return this;
393
393
  let i = r.split("."), a = this;
394
394
  for (let e of i) {
@@ -401,126 +401,126 @@ var ke = {
401
401
  return a === void 0 ? n : a;
402
402
  },
403
403
  async missing(...e) {
404
- let t = V(e[0]) ? e[0] : e, n = [];
404
+ let t = H(e[0]) ? e[0] : e, n = [];
405
405
  for (let e of t) {
406
- let t = await W({ var: e }, this);
406
+ let t = await K({ var: e }, this);
407
407
  (t === null || t === "") && n.push(`${e}`);
408
408
  }
409
409
  return n;
410
410
  },
411
411
  async missing_some(e, t) {
412
- let n = await W({ missing: t }, this);
413
- if (!V(n) || !V(t)) return [];
414
- let r = n.filter(B);
415
- return t.filter(B).length - r.length >= H(e) ? [] : r;
412
+ let n = await K({ missing: t }, this);
413
+ if (!H(n) || !H(t)) return [];
414
+ let r = n.filter(V);
415
+ return t.filter(V).length - r.length >= W(e) ? [] : r;
416
416
  },
417
417
  invoke(...e) {
418
418
  let [t, ...n] = e;
419
419
  return typeof t == "function" ? Reflect.apply(t, null, n) : null;
420
420
  },
421
- startsWith: (e, t) => B(e) && B(t) && e.startsWith(t),
422
- endsWith: (e, t) => B(e) && B(t) && e.endsWith(t),
421
+ startsWith: (e, t) => V(e) && V(t) && e.startsWith(t),
422
+ endsWith: (e, t) => V(e) && V(t) && e.endsWith(t),
423
423
  regexp_matches(e, t) {
424
424
  let n = e, r = "";
425
- if (V(e)) {
425
+ if (H(e)) {
426
426
  let [t, i] = e;
427
427
  n = t, r = i;
428
428
  }
429
- return !B(n) || !B(r) ? !1 : new RegExp(n, r).test(U(t));
429
+ return !V(n) || !V(r) ? !1 : new RegExp(n, r).test(G(t));
430
430
  },
431
431
  throw(e) {
432
- throw Error(U(e));
432
+ throw Error(G(e));
433
433
  }
434
434
  };
435
- async function W(e, t) {
435
+ async function K(e, t) {
436
436
  if (!e) return e;
437
- if (De(e)) return W(await e, t);
438
- if (V(e)) return Promise.all(e.map((e) => W(e, t)));
439
- if (!Oe(e)) return e;
440
- let n = Ae(e), r = n ? e[n] ?? [] : [];
441
- switch (V(r) || (r = [r]), n) {
437
+ if (U(e)) return K(await e, t);
438
+ if (H(e)) return Promise.all(e.map((e) => K(e, t)));
439
+ if (!Ee(e)) return e;
440
+ let n = Oe(e), r = n ? e[n] ?? [] : [];
441
+ switch (H(r) || (r = [r]), n) {
442
442
  case "if":
443
443
  case "?:":
444
- for (let e = 0; e < r.length - 1; e += 2) if (await G(await W(r[e], t))) return W(r[e + 1], t);
445
- return r.length % 2 == 1 ? W(r[r.length - 1], t) : null;
444
+ for (let e = 0; e < r.length - 1; e += 2) if (await q(await K(r[e], t))) return K(r[e + 1], t);
445
+ return r.length % 2 == 1 ? K(r[r.length - 1], t) : null;
446
446
  case "and": {
447
447
  let e = null;
448
- for (let n of r) if (e = await W(n, t), !await G(e)) return e;
448
+ for (let n of r) if (e = await K(n, t), !await q(e)) return e;
449
449
  return e;
450
450
  }
451
451
  case "or": {
452
452
  let e = null;
453
- for (let n of r) if (e = await W(n, t), await G(e)) return e;
453
+ for (let n of r) if (e = await K(n, t), await q(e)) return e;
454
454
  return e;
455
455
  }
456
456
  case "map": {
457
- let e = await W(r[0], t);
458
- return V(e) ? await Promise.all(e.map((e) => W(r[1], e))) : [];
457
+ let e = await K(r[0], t);
458
+ return H(e) ? await Promise.all(e.map((e) => K(r[1], e))) : [];
459
459
  }
460
460
  case "filter": {
461
- let e = await W(r[0], t);
462
- return V(e) ? (await Promise.all(e.map(async (e) => ({
461
+ let e = await K(r[0], t);
462
+ return H(e) ? (await Promise.all(e.map(async (e) => ({
463
463
  item: e,
464
- shouldInclude: await G(await W(r[1], e))
464
+ shouldInclude: await q(await K(r[1], e))
465
465
  })))).filter(({ shouldInclude: e }) => e).map(({ item: e }) => e) : [];
466
466
  }
467
467
  case "reduce": {
468
- let e = await W(r[0], t);
469
- if (!V(e)) return r.length > 2 ? await W(r[2], t) : null;
470
- let n = r[1], i = r.length > 2 ? await W(r[2], t) : null;
471
- for (let t of e) i = await W(n, {
468
+ let e = await K(r[0], t);
469
+ if (!H(e)) return r.length > 2 ? await K(r[2], t) : null;
470
+ let n = r[1], i = r.length > 2 ? await K(r[2], t) : null;
471
+ for (let t of e) i = await K(n, {
472
472
  current: t,
473
473
  accumulator: i
474
474
  });
475
475
  return i;
476
476
  }
477
477
  case "all": {
478
- let e = await W(r[0], t);
479
- if (!V(e) || e.length === 0) return !1;
480
- for (let t of e) if (!await G(await W(r[1], t))) return !1;
478
+ let e = await K(r[0], t);
479
+ if (!H(e) || e.length === 0) return !1;
480
+ for (let t of e) if (!await q(await K(r[1], t))) return !1;
481
481
  return !0;
482
482
  }
483
483
  case "some": {
484
- let e = await W(r[0], t);
485
- if (!V(e)) return !1;
486
- for (let t of e) if (await G(await W(r[1], t))) return !0;
484
+ let e = await K(r[0], t);
485
+ if (!H(e)) return !1;
486
+ for (let t of e) if (await q(await K(r[1], t))) return !0;
487
487
  return !1;
488
488
  }
489
489
  case "none": {
490
- let e = await W(r[0], t);
491
- if (!V(e)) return !0;
492
- for (let t of e) if (await G(await W(r[1], t))) return !1;
490
+ let e = await K(r[0], t);
491
+ if (!H(e)) return !0;
492
+ for (let t of e) if (await q(await K(r[1], t))) return !1;
493
493
  return !0;
494
494
  }
495
495
  case "catch": try {
496
- return await W(r[0], t);
496
+ return await K(r[0], t);
497
497
  } catch (e) {
498
- return Oe(e) ? await W(e, t) : r[1] ? await W(r[1], e) : e instanceof Error ? e.message : e;
498
+ return Ee(e) ? await K(e, t) : r[1] ? await K(r[1], e) : e instanceof Error ? e.message : e;
499
499
  }
500
500
  }
501
- let i = await Promise.all(r.map((e) => W(e, t))), a = n ? ke[n] : void 0;
501
+ let i = await Promise.all(r.map((e) => K(e, t))), a = n ? De[n] : void 0;
502
502
  if (!a) throw Error(`Unrecognized operation ${n}`);
503
503
  return a.apply(t, i);
504
504
  }
505
- async function G(e) {
506
- return De(e) ? G(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
505
+ async function q(e) {
506
+ return U(e) ? q(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
507
507
  }
508
- function Ae(e) {
508
+ function Oe(e) {
509
509
  return Object.keys(e)[0];
510
510
  }
511
511
  //#endregion
512
512
  //#region src/lifecycle/rules-logic.ts
513
- function je(e, t, n) {
513
+ function ke(e, t, n) {
514
514
  return new Proxy(Object.create(null), { get(r, i) {
515
515
  if (typeof i != "string") return;
516
516
  let a = e.find((e) => e.key === i);
517
- if (a !== void 0) return async () => !n.has(i) && await W(a.logic, {
517
+ if (a !== void 0) return async () => !n.has(i) && await K(a.logic, {
518
518
  ...t,
519
- conditions: je(e, t, new Set(n).add(i))
519
+ conditions: ke(e, t, new Set(n).add(i))
520
520
  }) === !0;
521
521
  } });
522
522
  }
523
- var Me = L(({ client: e }) => k({
523
+ var Ae = L(({ client: e }) => k({
524
524
  source: {
525
525
  stateSnapshot: e.stateSnapshotStore,
526
526
  predicates: e.predicates.listStore,
@@ -557,21 +557,21 @@ var Me = L(({ client: e }) => k({
557
557
  features: u,
558
558
  ...s
559
559
  };
560
- return await W(o, {
560
+ return await K(o, {
561
561
  ...d,
562
- conditions: je(a, d, /* @__PURE__ */ new Set())
562
+ conditions: ke(a, d, /* @__PURE__ */ new Set())
563
563
  });
564
564
  }
565
565
  }));
566
- function Ne(e) {
567
- return R(Me, e);
566
+ function je(e) {
567
+ return R(Ae, e);
568
568
  }
569
569
  //#endregion
570
570
  //#region src/ping.ts
571
- var Pe = 6e3, Fe = O("last_ping", "global"), Ie = async (e) => {
571
+ var Me = 6e3, Ne = O("last_ping", "global"), Pe = async (e) => {
572
572
  try {
573
- let t = Date.now(), n = E.get(Fe), r = 0;
574
- if (n.isSet() && (r = n.json() ?? 0), r && t - r < Pe) return !0;
573
+ let t = Date.now(), n = E.get(Ne), r = 0;
574
+ if (n.isSet() && (r = n.json() ?? 0), r && t - r < Me) return !0;
575
575
  let i = {
576
576
  projectId: e.projectId,
577
577
  path: window.location.pathname
@@ -582,23 +582,23 @@ var Pe = 6e3, Fe = O("last_ping", "global"), Ie = async (e) => {
582
582
  } catch {
583
583
  return !1;
584
584
  }
585
- }, K = M("lifecycle"), Le = L(({ client: e }) => {
586
- let t = K.store(!1), r = F(void 0, {
585
+ }, J = M("lifecycle"), Fe = L(({ client: e }) => {
586
+ let t = J.store(!1), r = F(void 0, {
587
587
  skipVoid: !1,
588
- domain: K
588
+ domain: J
589
589
  }), i = F(void 0, {
590
590
  skipVoid: !1,
591
- domain: K
592
- }), a = K.store("idle"), o = K.store([]), s = F(void 0, {
591
+ domain: J
592
+ }), a = J.store("idle"), o = J.store([]), s = F(void 0, {
593
593
  skipVoid: !1,
594
- domain: K
594
+ domain: J
595
595
  }), l = F(void 0, {
596
596
  skipVoid: !1,
597
- domain: K
597
+ domain: J
598
598
  }), u = P(), d = P(), f = P(), p = P(), m = P(), h = P();
599
599
  o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t), l.on(h, (e, t) => t), t.on(d, () => !0);
600
600
  let g = N(() => {
601
- Ie(e);
601
+ Pe(e);
602
602
  }), _ = N(async () => {
603
603
  await ee();
604
604
  }), v = N(async () => {
@@ -731,13 +731,13 @@ var Pe = 6e3, Fe = O("last_ping", "global"), Ie = async (e) => {
731
731
  setCondition: h
732
732
  };
733
733
  });
734
- function Re(e) {
735
- return R(Le, e);
734
+ function Ie(e) {
735
+ return R(Fe, e);
736
736
  }
737
737
  //#endregion
738
738
  //#region src/entities/predicate/predicate.ts
739
- var ze = M("predicate"), Be = L(({ client: e }) => {
740
- let t = ze.store({}), n = j(t, { register(e, t) {
739
+ var Le = M("predicate"), Re = L(({ client: e }) => {
740
+ let t = Le.store({}), n = j(t, { register(e, t) {
741
741
  return {
742
742
  ...e,
743
743
  [t.name]: {
@@ -795,20 +795,23 @@ var ze = M("predicate"), Be = L(({ client: e }) => {
795
795
  getEvokablePredicate: s
796
796
  };
797
797
  });
798
- function Ve(e) {
799
- return R(Be, e);
798
+ function ze(e) {
799
+ return R(Re, e);
800
800
  }
801
- var He = (e, t, n) => {
801
+ var Be = (e, t, n) => {
802
802
  n.register({
803
803
  name: e,
804
804
  predicate: t
805
805
  });
806
- }, Ue = M("feature");
807
- function q(e) {
806
+ }, Ve = M("feature");
807
+ function Y(e) {
808
808
  return e?.enabled === !1;
809
809
  }
810
- var We = L(({ client: e }) => {
811
- let t = Ue.store({}), n = Ue.store([]), i = j(t, { register(e, t) {
810
+ function He(e) {
811
+ return e === "true" || e !== "false" && e;
812
+ }
813
+ var Ue = L(({ client: e }) => {
814
+ let t = Ve.store({}), n = Ve.store([]), i = j(t, { register(e, t) {
812
815
  return {
813
816
  ...e,
814
817
  [t.id]: t.feature
@@ -835,13 +838,13 @@ var We = L(({ client: e }) => {
835
838
  });
836
839
  let o = N(async ({ id: e, key: t, storage: n = "local", enabled: r }) => {
837
840
  if (r === !1) return null;
838
- let i = O(`feature:${e}:${t}`, "global"), a = (n === "session" ? D : E).get(i).boolean();
839
- return a === null ? null : {
841
+ let i = O(`feature:${e}:${t}`, "global"), a = (n === "session" ? D : E).get(i).text();
842
+ return a ? {
840
843
  id: e,
841
844
  key: t,
842
- bucket: a,
845
+ bucket: He(a),
843
846
  storage: n
844
- };
847
+ } : null;
845
848
  }), s = N((e) => {
846
849
  if (!e) return null;
847
850
  let t = O(`feature:${e.id}:${e.key}`, "global");
@@ -856,7 +859,7 @@ var We = L(({ client: e }) => {
856
859
  if (a) return a;
857
860
  let o = e[n];
858
861
  if (!o) throw Error(`Feature with id '${n}' not found`);
859
- if (q(o.feature)) return {
862
+ if (Y(o.feature)) return {
860
863
  id: o.id,
861
864
  bucket: !1,
862
865
  key: i,
@@ -898,7 +901,7 @@ var We = L(({ client: e }) => {
898
901
  }), I({
899
902
  source: t,
900
903
  clock: l.doneData,
901
- filter: (e, t) => !q(e[t.id]?.feature),
904
+ filter: (e, t) => !Y(e[t.id]?.feature),
902
905
  fn: (e, t) => {
903
906
  let { id: n, bucket: r, storage: i } = t, a = e[n]?.feature.key;
904
907
  return a ? {
@@ -942,7 +945,7 @@ var We = L(({ client: e }) => {
942
945
  resolvedFeatures: n,
943
946
  allFeatures: t
944
947
  },
945
- filter: ({ resolvedFeatures: e, allFeatures: t }, { id: n, key: r }) => !q(t[n]?.feature) && !e.some((e) => e.id === n && e.key === r),
948
+ filter: ({ resolvedFeatures: e, allFeatures: t }, { id: n, key: r }) => !Y(t[n]?.feature) && !e.some((e) => e.id === n && e.key === r),
946
949
  fn: (e, t) => t,
947
950
  target: e.eventBus.prepend((e) => ({
948
951
  type: "feature_decide",
@@ -954,7 +957,7 @@ var We = L(({ client: e }) => {
954
957
  resolvedFeatures: n,
955
958
  allFeatures: t
956
959
  },
957
- fn: ({ resolvedFeatures: e, allFeatures: t }, n) => !n || q(t[n.id]?.feature) || e.some((e) => e.id === n.id && e.key === n.key) ? e : [...e, n],
960
+ fn: ({ resolvedFeatures: e, allFeatures: t }, n) => !n || Y(t[n.id]?.feature) || e.some((e) => e.id === n.id && e.key === n.key) ? e : [...e, n],
958
961
  target: n
959
962
  });
960
963
  function d(e) {
@@ -988,16 +991,16 @@ var We = L(({ client: e }) => {
988
991
  getEvokableFeature: p
989
992
  };
990
993
  });
991
- function Ge(e) {
992
- return R(We, e);
994
+ function We(e) {
995
+ return R(Ue, e);
993
996
  }
994
- var Ke = (e, t, n) => {
997
+ var Ge = (e, t, n) => {
995
998
  n.register({
996
999
  id: e,
997
1000
  feature: t
998
1001
  });
999
- }, J = M("history");
1000
- function qe(e, t) {
1002
+ }, X = M("history");
1003
+ function Ke(e, t) {
1001
1004
  return {
1002
1005
  id: re(`history-entry-${Date.now()}-${Math.random()}}`),
1003
1006
  node: t,
@@ -1005,9 +1008,9 @@ function qe(e, t) {
1005
1008
  experienceId: e
1006
1009
  };
1007
1010
  }
1008
- var Je = L(() => {
1009
- let e = J.store({ entries: [] }), t = J.event(), n = J.event(), r = J.event(), i = J.event();
1010
- 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);
1011
+ var qe = L(() => {
1012
+ let e = X.store({ entries: [] }), t = X.event(), n = X.event(), r = X.event(), i = X.event();
1013
+ e.on(t, (e, t) => ({ entries: [...e.entries, Ke(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Ke(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
1011
1014
  function a(e, t) {
1012
1015
  let n = {
1013
1016
  lastStepIndex: -1,
@@ -1037,20 +1040,20 @@ var Je = L(() => {
1037
1040
  entriesStore: e.map((e) => e.entries)
1038
1041
  };
1039
1042
  });
1040
- function Ye() {
1041
- return R(Je);
1043
+ function Je() {
1044
+ return R(qe);
1042
1045
  }
1043
1046
  //#endregion
1044
1047
  //#region src/utils/events.ts
1045
- var Xe = 0, Ze = (e) => {
1048
+ var Ye = 0, Xe = (e) => {
1046
1049
  let t = F([]);
1047
1050
  return t.on(e, (e, t) => [...e, {
1048
- id: Xe++,
1051
+ id: Ye++,
1049
1052
  at: /* @__PURE__ */ new Date(),
1050
1053
  payload: t
1051
1054
  }]), t;
1052
- }, Qe = M("field"), $e = L(() => {
1053
- let e = Qe.store({}), t = j(e, {
1055
+ }, Ze = M("field"), Qe = L(() => {
1056
+ let e = Ze.store({}), t = j(e, {
1054
1057
  register(e, t) {
1055
1058
  return {
1056
1059
  ...e,
@@ -1098,13 +1101,13 @@ var Xe = 0, Ze = (e) => {
1098
1101
  getByName: c
1099
1102
  };
1100
1103
  });
1101
- function et() {
1102
- return R($e);
1104
+ function $e() {
1105
+ return R(Qe);
1103
1106
  }
1104
1107
  //#endregion
1105
1108
  //#region src/entities/step/step.ts
1106
- var tt = M("step"), nt = L(() => {
1107
- let e = tt.store({}), t = j(e, { register(e, t) {
1109
+ var et = M("step"), tt = L(() => {
1110
+ let e = et.store({}), t = j(e, { register(e, t) {
1108
1111
  return {
1109
1112
  ...e,
1110
1113
  [t.step.id]: t.step
@@ -1128,16 +1131,16 @@ var tt = M("step"), nt = L(() => {
1128
1131
  indexStore: e
1129
1132
  };
1130
1133
  });
1131
- function rt() {
1132
- return R(nt);
1134
+ function nt() {
1135
+ return R(tt);
1133
1136
  }
1134
- function it(e, t) {
1137
+ function rt(e, t) {
1135
1138
  t.register(e);
1136
1139
  }
1137
1140
  //#endregion
1138
1141
  //#region src/entities/content/content.ts
1139
- var at = M("content"), ot = L(() => {
1140
- let e = at.store({}), t = j(e, {
1142
+ var it = M("content"), at = L(() => {
1143
+ let e = it.store({}), t = j(e, {
1141
1144
  register(e, t) {
1142
1145
  return {
1143
1146
  ...e,
@@ -1178,16 +1181,16 @@ var at = M("content"), ot = L(() => {
1178
1181
  indexStore: e
1179
1182
  };
1180
1183
  });
1181
- function st() {
1182
- return R(ot);
1184
+ function ot() {
1185
+ return R(at);
1183
1186
  }
1184
- function ct(e, t) {
1187
+ function st(e, t) {
1185
1188
  t.register(e);
1186
1189
  }
1187
1190
  //#endregion
1188
1191
  //#region src/entities/action/action.ts
1189
- var lt = M("action"), ut = L(({ client: e }) => {
1190
- let t = lt.store({}), n = j(t, { register(e, t) {
1192
+ var ct = M("action"), lt = L(({ client: e }) => {
1193
+ let t = ct.store({}), n = j(t, { register(e, t) {
1191
1194
  return {
1192
1195
  ...e,
1193
1196
  [t.key]: {
@@ -1245,10 +1248,10 @@ var lt = M("action"), ut = L(({ client: e }) => {
1245
1248
  getEvokableAction: s
1246
1249
  };
1247
1250
  });
1248
- function dt(e) {
1249
- return R(ut, e);
1251
+ function ut(e) {
1252
+ return R(lt, e);
1250
1253
  }
1251
- var ft = (e, t, n) => {
1254
+ var dt = (e, t, n) => {
1252
1255
  n.register({
1253
1256
  key: e,
1254
1257
  action: t
@@ -1256,7 +1259,7 @@ var ft = (e, t, n) => {
1256
1259
  };
1257
1260
  //#endregion
1258
1261
  //#region src/entities/response/response-validation.ts
1259
- function Y(e, t, n, r) {
1262
+ function Z(e, t, n, r) {
1260
1263
  return {
1261
1264
  fieldKey: e.key,
1262
1265
  userMessage: n,
@@ -1264,62 +1267,62 @@ function Y(e, t, n, r) {
1264
1267
  value: t
1265
1268
  };
1266
1269
  }
1267
- function X(e) {
1270
+ function Q(e) {
1268
1271
  return e === null || e === "" || Array.isArray(e) && !e.length;
1269
1272
  }
1270
- function pt(e) {
1273
+ function ft(e) {
1271
1274
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
1272
1275
  }
1273
- function mt(e) {
1276
+ function pt(e) {
1274
1277
  try {
1275
1278
  return JSON.stringify(e), !0;
1276
1279
  } catch {
1277
1280
  return !1;
1278
1281
  }
1279
1282
  }
1280
- function ht(e, t) {
1283
+ function mt(e, t) {
1281
1284
  return t.find((t) => t.key === e) ?? null;
1282
1285
  }
1283
- function gt(e, t) {
1286
+ function ht(e, t) {
1284
1287
  return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
1285
1288
  }
1286
- function _t(e, t) {
1287
- if (e.type !== "object" || X(t)) return null;
1289
+ function gt(e, t) {
1290
+ if (e.type !== "object" || Q(t)) return null;
1288
1291
  if (e.multiple) {
1289
- if (!Array.isArray(t)) return Y(e, t, "This field expects multiple values", "Field expects an array of objects.");
1292
+ if (!Array.isArray(t)) return Z(e, t, "This field expects multiple values", "Field expects an array of objects.");
1290
1293
  for (let n of t) {
1291
- if (typeof n != "object" || !n) return Y(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
1292
- if (!mt(n)) return Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1294
+ if (typeof n != "object" || !n) return Z(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
1295
+ if (!pt(n)) return Z(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1293
1296
  }
1294
1297
  return null;
1295
1298
  }
1296
- return Array.isArray(t) ? Y(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? Y(e, t, "This field expects an object value", "Field expects an object value.") : mt(t) ? null : Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1299
+ return Array.isArray(t) ? Z(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? Z(e, t, "This field expects an object value", "Field expects an object value.") : pt(t) ? null : Z(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1297
1300
  }
1298
- function vt(e, t) {
1299
- if (X(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
1301
+ function _t(e, t) {
1302
+ if (Q(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
1300
1303
  let n = Array.isArray(t) ? t : [t];
1301
1304
  if (e.type === "object") {
1302
1305
  let r = new Set(e.options.map((e) => JSON.stringify(e.value)));
1303
- return n.every((e) => r.has(JSON.stringify(e))) ? null : Y(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
1306
+ return n.every((e) => r.has(JSON.stringify(e))) ? null : Z(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
1304
1307
  }
1305
1308
  let r = e.options.map((e) => e.value);
1306
- return n.every((e) => !pt(e) || e === null ? !1 : r.includes(e)) ? null : Y(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
1309
+ return n.every((e) => !ft(e) || e === null ? !1 : r.includes(e)) ? null : Z(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
1307
1310
  }
1308
- async function yt(t, n, r, i) {
1309
- if (n.validation && !e(n.validation) && !X(r)) {
1311
+ async function vt(t, n, r, i) {
1312
+ if (n.validation && !e(n.validation) && !Q(r)) {
1310
1313
  let e = i ? {
1311
1314
  $input: r,
1312
1315
  responses: i
1313
1316
  } : { $input: r }, a = await t(n.validation, e);
1314
- if (typeof a == "string") return Y(n, r, a, `Field validation resulted in an error: ${a}.`);
1315
- if (a === !1) return Y(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
1317
+ if (typeof a == "string") return Z(n, r, a, `Field validation resulted in an error: ${a}.`);
1318
+ if (a === !1) return Z(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
1316
1319
  }
1317
- return n.required && X(r) ? Y(n, r, "This field is required", "Field is required.") : !n.multiple && Array.isArray(r) && r.length > 1 ? Y(n, r, "This field expects a single response", "Field expects a single response.") : null;
1320
+ return n.required && Q(r) ? Z(n, r, "This field is required", "Field is required.") : !n.multiple && Array.isArray(r) && r.length > 1 ? Z(n, r, "This field expects a single response", "Field expects a single response.") : null;
1318
1321
  }
1319
1322
  //#endregion
1320
1323
  //#region src/entities/response/response.ts
1321
- var bt = M("response"), xt = L(({ client: e }) => {
1322
- let t = bt.store({}), r = P(), i = P(), a = j(t, {
1324
+ var yt = M("response"), bt = L(({ client: e }) => {
1325
+ let t = yt.store({}), r = P(), i = P(), a = j(t, {
1323
1326
  register(e, t) {
1324
1327
  return {
1325
1328
  ...e,
@@ -1358,7 +1361,7 @@ var bt = M("response"), xt = L(({ client: e }) => {
1358
1361
  ...t,
1359
1362
  ...n
1360
1363
  }, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
1361
- let o = ht(t, e);
1364
+ let o = mt(t, e);
1362
1365
  if (!o) {
1363
1366
  r.push({
1364
1367
  fieldKey: t,
@@ -1368,17 +1371,17 @@ var bt = M("response"), xt = L(({ client: e }) => {
1368
1371
  });
1369
1372
  return;
1370
1373
  }
1371
- let c = gt(o, n), l = await yt(s, o, c, a);
1374
+ let c = ht(o, n), l = await vt(s, o, c, a);
1372
1375
  if (l) {
1373
1376
  r.push(l);
1374
1377
  return;
1375
1378
  }
1376
- let u = _t(o, c);
1379
+ let u = gt(o, c);
1377
1380
  if (u) {
1378
1381
  r.push(u);
1379
1382
  return;
1380
1383
  }
1381
- let d = vt(o, c);
1384
+ let d = _t(o, c);
1382
1385
  if (d) {
1383
1386
  r.push(d);
1384
1387
  return;
@@ -1457,13 +1460,13 @@ var bt = M("response"), xt = L(({ client: e }) => {
1457
1460
  getByFieldName: _
1458
1461
  };
1459
1462
  });
1460
- function St(e) {
1461
- return R(xt, e);
1463
+ function xt(e) {
1464
+ return R(bt, e);
1462
1465
  }
1463
1466
  //#endregion
1464
1467
  //#region src/entities/condition/condition.ts
1465
- var Ct = M("condition"), wt = L(() => {
1466
- let e = Ct.store({}), t = j(e, { register(e, t) {
1468
+ var St = M("condition"), Ct = L(() => {
1469
+ let e = St.store({}), t = j(e, { register(e, t) {
1467
1470
  return {
1468
1471
  ...e,
1469
1472
  [t.condition.id]: t.condition
@@ -1487,12 +1490,12 @@ var Ct = M("condition"), wt = L(() => {
1487
1490
  indexStore: e
1488
1491
  };
1489
1492
  });
1490
- function Tt() {
1491
- return R(wt);
1493
+ function wt() {
1494
+ return R(Ct);
1492
1495
  }
1493
1496
  //#endregion
1494
1497
  //#region src/utils/api-url.ts
1495
- function Et() {
1498
+ function Tt() {
1496
1499
  if (c()) {
1497
1500
  let e = [
1498
1501
  document.currentScript,
@@ -1507,7 +1510,7 @@ function Et() {
1507
1510
  }
1508
1511
  //#endregion
1509
1512
  //#region src/utils/search-params.ts
1510
- function Dt() {
1513
+ function Et() {
1511
1514
  if (!s()) return {};
1512
1515
  let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
1513
1516
  for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
@@ -1525,13 +1528,13 @@ function Dt() {
1525
1528
  }
1526
1529
  //#endregion
1527
1530
  //#region src/entities/session/session.ts
1528
- var Ot = O("session", "global");
1529
- function kt() {
1531
+ var Dt = O("session", "global");
1532
+ function Ot() {
1530
1533
  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)}`;
1531
1534
  }
1532
- function At() {
1535
+ function kt() {
1533
1536
  if (!m()) return null;
1534
- let e = E.get(Ot);
1537
+ let e = E.get(Dt);
1535
1538
  if (!e.isSet()) return null;
1536
1539
  try {
1537
1540
  return e.json();
@@ -1539,8 +1542,8 @@ function At() {
1539
1542
  return null;
1540
1543
  }
1541
1544
  }
1542
- var jt = L(() => {
1543
- let e = At(), t = { id: e?.id ?? kt() };
1545
+ var At = L(() => {
1546
+ let e = kt(), t = { id: e?.id ?? Ot() };
1544
1547
  e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
1545
1548
  let n = F(t), r = j(n, {
1546
1549
  setIsUser: (e, t) => ({
@@ -1566,7 +1569,7 @@ var jt = L(() => {
1566
1569
  source: n,
1567
1570
  effect: (e) => {
1568
1571
  if (m()) try {
1569
- E.get(Ot).set(e);
1572
+ E.get(Dt).set(e);
1570
1573
  } catch {}
1571
1574
  }
1572
1575
  });
@@ -1580,39 +1583,39 @@ var jt = L(() => {
1580
1583
  removeIdentifier: r.removeIdentifier
1581
1584
  };
1582
1585
  });
1583
- function Mt() {
1584
- return R(jt, void 0);
1586
+ function jt() {
1587
+ return R(At, void 0);
1585
1588
  }
1586
1589
  //#endregion
1587
1590
  //#region src/utils/picked-config.ts
1588
- function Nt() {
1591
+ function Mt() {
1589
1592
  if (s()) return globalThis.window.pickedConfig;
1590
1593
  }
1591
- function Pt() {
1592
- if (s()) return Nt()?.projectId;
1594
+ function Nt() {
1595
+ if (s()) return Mt()?.projectId;
1593
1596
  }
1594
- function Ft() {
1597
+ function Pt() {
1595
1598
  if (!c()) return;
1596
1599
  let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
1597
1600
  if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
1598
1601
  }
1599
- function It(e) {
1602
+ function Ft(e) {
1600
1603
  if (e.projectId) return e.projectId;
1601
- let t = Pt();
1604
+ let t = Nt();
1602
1605
  if (t) return t;
1603
- let n = Ft();
1606
+ let n = Pt();
1604
1607
  if (n) return n;
1605
1608
  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.");
1606
1609
  }
1607
1610
  //#endregion
1608
1611
  //#region src/utils/render-string.ts
1609
- function Z(e) {
1612
+ function $(e) {
1610
1613
  return e == null || e === "" || Number.isNaN(e);
1611
1614
  }
1612
- var Lt = {
1613
- default: (e, t) => Z(e) ? String(t ?? "") : String(e),
1614
- append: (e, t) => t && !Z(e) ? `${e} ${t}` : e,
1615
- prepend: (e, t) => t && !Z(e) ? `${t} ${e}` : e,
1615
+ var It = {
1616
+ default: (e, t) => $(e) ? String(t ?? "") : String(e),
1617
+ append: (e, t) => t && !$(e) ? `${e} ${t}` : e,
1618
+ prepend: (e, t) => t && !$(e) ? `${t} ${e}` : e,
1616
1619
  upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
1617
1620
  lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
1618
1621
  capitalize: (e) => typeof e == "string" ? e.charAt(0).toUpperCase() + e.slice(1) : e,
@@ -1630,24 +1633,24 @@ var Lt = {
1630
1633
  return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
1631
1634
  }
1632
1635
  };
1633
- function Rt(e) {
1636
+ function Lt(e) {
1634
1637
  return typeof e == "object" && !!e;
1635
1638
  }
1636
- function zt(e, t) {
1639
+ function Rt(e, t) {
1637
1640
  let n = t;
1638
- for (let t of e.split(".")) if (Rt(n) && t in n) n = n[t];
1641
+ for (let t of e.split(".")) if (Lt(n) && t in n) n = n[t];
1639
1642
  else return;
1640
1643
  return typeof n == "function" ? n() : n;
1641
1644
  }
1642
- function Bt(e, t) {
1643
- let n = e.split("|").map((e) => e.trim()), r = zt(n.shift() ?? "", t);
1645
+ function zt(e, t) {
1646
+ let n = e.split("|").map((e) => e.trim()), r = Rt(n.shift() ?? "", t);
1644
1647
  for (let e of n) {
1645
- let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = Lt[i];
1648
+ let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = It[i];
1646
1649
  o && (r = o(r, a));
1647
1650
  }
1648
- return Z(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
1651
+ return $(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
1649
1652
  }
1650
- function Vt(e, t) {
1653
+ function Bt(e, t) {
1651
1654
  let n = "", r = 0;
1652
1655
  for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
1653
1656
  r += 2;
@@ -1659,15 +1662,15 @@ function Vt(e, t) {
1659
1662
  }
1660
1663
  i += e[r++];
1661
1664
  }
1662
- n += Bt(i.trim(), t);
1665
+ n += zt(i.trim(), t);
1663
1666
  } else n += e[r++];
1664
1667
  return n;
1665
1668
  }
1666
1669
  //#endregion
1667
1670
  //#region src/utils/preview-session.ts
1668
- var Q = "preview-token";
1671
+ var Vt = "preview-token";
1669
1672
  function Ht() {
1670
- return !s() || !h() ? !1 : !!Dt()[Q]?.[0];
1673
+ return !s() || !h() ? !1 : !!Et()[Vt]?.[0];
1671
1674
  }
1672
1675
  //#endregion
1673
1676
  //#region src/picked.ts
@@ -1684,43 +1687,43 @@ var Ut = class {
1684
1687
  apiUrl;
1685
1688
  dashboardUrl;
1686
1689
  documentationSiteUrl;
1687
- session = Mt();
1688
- searchParams = Dt();
1689
- history = Ye();
1690
+ session = jt();
1691
+ searchParams = Et();
1692
+ history = Je();
1690
1693
  components = ve({ client: this });
1691
1694
  experienceInstances = S({ client: this });
1692
1695
  experiences = ue({ client: this });
1693
- frameworks = Se({ client: this });
1694
- predicates = Ve({ client: this });
1695
- features = Ge({ client: this });
1696
- conditions = Tt();
1697
- fields = et();
1698
- responses = St({ client: this });
1699
- steps = rt();
1700
- contents = st();
1701
- actions = dt({ client: this });
1696
+ frameworks = xe({ client: this });
1697
+ predicates = ze({ client: this });
1698
+ features = We({ client: this });
1699
+ conditions = wt();
1700
+ fields = $e();
1701
+ responses = xt({ client: this });
1702
+ steps = nt();
1703
+ contents = ot();
1704
+ actions = ut({ client: this });
1702
1705
  conditionResults = C();
1703
- stateSnapshotStore = Te({ client: this });
1704
- evaluateRuleLogicFx = Ne({ client: this });
1706
+ stateSnapshotStore = we({ client: this });
1707
+ evaluateRuleLogicFx = je({ client: this });
1705
1708
  start;
1706
1709
  readyStore;
1707
1710
  preconditionPassedStore;
1708
1711
  conditionPassedStore;
1709
1712
  lifecycleStageStore;
1710
- lifecycle = Re({ client: this });
1713
+ lifecycle = Ie({ client: this });
1711
1714
  renderStringFx = k({
1712
1715
  source: this.responses.listStore,
1713
1716
  effect: (e, { template: t, context: n }) => {
1714
1717
  let r = {};
1715
1718
  for (let t of e) r[t.fieldKey] = t.value;
1716
- return Vt(t, {
1719
+ return Bt(t, {
1717
1720
  ...n,
1718
1721
  responses: r
1719
1722
  });
1720
1723
  }
1721
1724
  });
1722
1725
  constructor(e) {
1723
- this.events = Ze(this.eventBus), this.projectId = It(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Et(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
1726
+ this.events = Xe(this.eventBus), this.projectId = Ft(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Tt(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
1724
1727
  type: "load",
1725
1728
  version: ne()
1726
1729
  }), this.maybeStartPreviewChannel();
@@ -1729,10 +1732,10 @@ var Ut = class {
1729
1732
  Ht() && import("../preview-channel-CSr96XAo.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
1730
1733
  }
1731
1734
  registerFramework = (e) => {
1732
- Ce(e, this.frameworks);
1735
+ Se(e, this.frameworks);
1733
1736
  };
1734
1737
  registerComponent = (e, t) => {
1735
- ye(e, t, this.components);
1738
+ B(e, t, this.components);
1736
1739
  };
1737
1740
  registerPlugin = (e) => {
1738
1741
  pe(this, e, this.plugins);
@@ -1740,10 +1743,10 @@ var Ut = class {
1740
1743
  t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
1741
1744
  };
1742
1745
  registerFeature = (e, t) => {
1743
- Ke(e, t, this.features);
1746
+ Ge(e, t, this.features);
1744
1747
  };
1745
1748
  registerPredicate = (e, t) => {
1746
- He(e, t, this.predicates);
1749
+ Be(e, t, this.predicates);
1747
1750
  };
1748
1751
  registerCondition = (e) => {
1749
1752
  this.conditions.register(e);
@@ -1752,19 +1755,19 @@ var Ut = class {
1752
1755
  this.fields.register(e);
1753
1756
  };
1754
1757
  registerStep = (e) => {
1755
- it(e, this.steps);
1758
+ rt(e, this.steps);
1756
1759
  };
1757
1760
  registerContent = (e) => {
1758
- ct(e, this.contents);
1761
+ st(e, this.contents);
1759
1762
  };
1760
1763
  patchContent = (e, t) => {
1761
1764
  this.contents.patch(e, t);
1762
1765
  };
1763
1766
  registerAction = (e, t) => {
1764
- ft(e, t, this.actions);
1767
+ dt(e, t, this.actions);
1765
1768
  };
1766
1769
  registerExperience = (e) => {
1767
- e.component && ye(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
1770
+ e.component && B(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
1768
1771
  };
1769
1772
  launchExperienceById = async (e, t) => {
1770
1773
  this.experiences.launch({
@@ -1809,8 +1812,8 @@ var Ut = class {
1809
1812
  try {
1810
1813
  let [t, n] = e.split(":");
1811
1814
  if (!t || !n) return;
1812
- let r = n;
1813
- r === "true" && (r = !0), r === "false" && (r = !1), this.registerFeature(t, {
1815
+ let r = He(n);
1816
+ this.registerFeature(t, {
1814
1817
  key: `${r}`,
1815
1818
  name: t,
1816
1819
  decide: () => r,
@@ -1847,7 +1850,7 @@ var Ut = class {
1847
1850
  }
1848
1851
  getPluginConfig = (e) => this.plugins[e] ?? {};
1849
1852
  }, Wt = "application/picked-javascript", Gt = "application/picked-module", Kt = "data-picked-hydrated";
1850
- async function $(e) {
1853
+ async function qt(e) {
1851
1854
  if (!("document" in globalThis)) return;
1852
1855
  let t = "application/picked-module", n = "data-picked-hydrated";
1853
1856
  function r(e) {
@@ -1876,30 +1879,30 @@ async function $(e) {
1876
1879
  a && await a;
1877
1880
  }
1878
1881
  }
1879
- function qt() {
1880
- return `<script>(${$.toString()})(document)<\/script>`;
1882
+ function Jt() {
1883
+ return `<script>(${qt.toString()})(document)<\/script>`;
1881
1884
  }
1882
1885
  //#endregion
1883
1886
  //#region src/utils/html-asset-value.ts
1884
- function Jt(e) {
1887
+ function Yt(e) {
1885
1888
  return typeof e == "object" && !!e && "id" in e && typeof e.id == "string" && "content" in e && (typeof e.content == "string" || e.content === null);
1886
1889
  }
1887
1890
  //#endregion
1888
1891
  //#region src/entities/component/lazyComponent.ts
1889
- function Yt(e) {
1892
+ function Xt(e) {
1890
1893
  return {
1891
1894
  $$type: "lazy-component",
1892
1895
  load: e
1893
1896
  };
1894
1897
  }
1895
- function Xt(e) {
1898
+ function Zt(e) {
1896
1899
  return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
1897
1900
  }
1898
1901
  //#endregion
1899
1902
  //#region src/exports.ts
1900
- var Zt = (e) => {
1903
+ var Qt = (e) => {
1901
1904
  let t = new Ut(e);
1902
1905
  return u(t), t;
1903
1906
  };
1904
1907
  //#endregion
1905
- export { Kt as PICKED_HYDRATED_ATTR, Gt as PICKED_MODULE_SCRIPT_TYPE, Wt as PICKED_SCRIPT_TYPE, Q as PREVIEW_TOKEN_PARAM, Ut as Picked, qt as buildRehydrateBootstrap, Zt as createClient, fe as createPluginEffect, O as createStorageKey, n as evaluateRuleLogic, Nt as getPickedConfig, Jt as isHtmlAssetValue, h as isInsideIframe, Xt as isLazyLoader, _ as isPickedRoot, Ht as isPreviewSession, Yt as lazyComponent, E as localStore, oe as onInertScriptSubtrees, $ as rehydrateScripts, ie as reportInertScriptSubtrees, ae 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 };
1908
+ export { Kt as PICKED_HYDRATED_ATTR, Gt as PICKED_MODULE_SCRIPT_TYPE, Wt as PICKED_SCRIPT_TYPE, Vt as PREVIEW_TOKEN_PARAM, Ut as Picked, Jt as buildRehydrateBootstrap, Qt as createClient, fe as createPluginEffect, O as createStorageKey, n as evaluateRuleLogic, Mt as getPickedConfig, Yt as isHtmlAssetValue, h as isInsideIframe, Zt as isLazyLoader, _ as isPickedRoot, Ht as isPreviewSession, Xt as lazyComponent, E as localStore, oe as onInertScriptSubtrees, qt as rehydrateScripts, ie as reportInertScriptSubtrees, ae 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 };