@picked/client 0.0.1-dev.1786070942751 → 0.0.1-dev.1786405786333
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/{api-BqZglw7-.js → api-CJXSNevv.js} +1 -1
- package/dist/{api-C5vMi1gb.cjs → api-CP8La6ax.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/explanation/content-references.md +99 -0
- package/dist/docs/explanation/the-content-model.md +38 -28
- package/dist/docs/how-to/create-a-content-entry.md +48 -0
- package/dist/docs/how-to/define-a-page-layout.md +12 -5
- package/dist/docs/how-to/point-one-entry-at-another.md +61 -0
- package/dist/docs/how-to/read-a-referenced-entry.md +111 -0
- package/dist/docs/how-to/reuse-a-section.md +26 -10
- package/dist/docs/index.md +1 -1
- package/dist/docs/reference/dashboard/content/blocks.mdx +57 -0
- package/dist/docs/reference/dashboard/content/content-entries.mdx +61 -10
- package/dist/docs/reference/dashboard/content/models.mdx +108 -0
- package/dist/docs/reference/dashboard/content/pages.mdx +4 -3
- package/dist/docs/reference/dashboard/fields.mdx +1 -1
- package/dist/docs/reference/dashboard/steps.mdx +2 -2
- package/dist/docs/reference/delivery-api/experience-content.md +68 -13
- package/dist/docs/reference/glossary.md +13 -5
- package/dist/docs/reference/management-api/error-handling.md +2 -2
- package/dist/docs/reference/sdk/content.md +216 -0
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +1 -1
- package/dist/docs/reference/sdk/ssr/serialize.md +6 -3
- package/dist/docs/tutorials/first-api-call.md +1 -1
- package/dist/docs/tutorials/first-server-rendered-page.mdx +1 -1
- package/dist/esm/index.js +365 -292
- package/dist/esm/plugins/dynamic-experiences/index.js +3 -3
- package/dist/esm/server/index.js +2 -2
- package/dist/{plugin-EFn9ALEF.cjs → plugin-DkSWIASL.cjs} +1 -1
- package/dist/{plugin-YytfMG0n.js → plugin-DviILBha.js} +1 -1
- package/dist/{provider-Bng22ugW.cjs → provider-DIV6y0Wi.cjs} +1 -1
- package/dist/{provider-hAf_rar9.js → provider-DnRTKPsK.js} +1 -1
- package/dist/{registry-CdPPoopn.js → registry-D9oWMcgF.js} +1 -1
- package/dist/{registry-DpNNJt2g.cjs → registry-a4Uk2Ivo.cjs} +1 -1
- package/dist/types/entities/content/reference.d.ts +101 -0
- package/dist/types/entities/content/reference.d.ts.map +1 -0
- package/dist/types/entities/feature/feature.d.ts +9 -2
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/exports.d.ts +2 -0
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/picked.d.ts +2 -1
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +10 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/server/serialize.d.ts +20 -15
- package/dist/types/server/serialize.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/docs/reference/dashboard/content/layouts.mdx +0 -62
- package/dist/docs/reference/dashboard/content/sections.mdx +0 -28
package/dist/esm/index.js
CHANGED
|
@@ -5,13 +5,13 @@ 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-
|
|
8
|
+
import { n as te, r as ne } from "../api-CJXSNevv.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
|
-
import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, sample as I } from "effector";
|
|
11
|
+
import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, is as se, sample as I } from "effector";
|
|
12
12
|
import { createFactory as L, invoke as R } from "@withease/factories";
|
|
13
13
|
//#region src/entities/experience/experience.ts
|
|
14
|
-
var z = M("experience"),
|
|
14
|
+
var z = M("experience"), ce = L(({ client: e, experience: r }) => {
|
|
15
15
|
let i = z.store(r), a = j(i, { merge(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
...e,
|
|
@@ -98,17 +98,17 @@ var z = M("experience"), se = L(({ client: e, experience: r }) => {
|
|
|
98
98
|
prepareExperienceContentFx: m
|
|
99
99
|
}, u;
|
|
100
100
|
});
|
|
101
|
-
function
|
|
102
|
-
return R(
|
|
101
|
+
function le(e) {
|
|
102
|
+
return R(ce, e);
|
|
103
103
|
}
|
|
104
|
-
var
|
|
104
|
+
var ue = L(({ client: e }) => {
|
|
105
105
|
let t = z.store({}), n = j(t, { register(e, t) {
|
|
106
106
|
return {
|
|
107
107
|
...e,
|
|
108
108
|
[t.id]: t
|
|
109
109
|
};
|
|
110
110
|
} }), r = P(), i = N((t) => {
|
|
111
|
-
n.register(
|
|
111
|
+
n.register(le({
|
|
112
112
|
client: e,
|
|
113
113
|
experience: t
|
|
114
114
|
}));
|
|
@@ -194,20 +194,20 @@ var le = L(({ client: e }) => {
|
|
|
194
194
|
})
|
|
195
195
|
};
|
|
196
196
|
});
|
|
197
|
-
function
|
|
198
|
-
return R(
|
|
197
|
+
function de(e) {
|
|
198
|
+
return R(ue, e);
|
|
199
199
|
}
|
|
200
|
-
var
|
|
200
|
+
var fe = async (e) => {
|
|
201
201
|
await e.experiences.initialiseExperiencesFx();
|
|
202
202
|
};
|
|
203
203
|
//#endregion
|
|
204
204
|
//#region src/entities/plugin/plugin.ts
|
|
205
|
-
function
|
|
205
|
+
function pe(e) {
|
|
206
206
|
return N(async () => {
|
|
207
207
|
await e();
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
|
-
var
|
|
210
|
+
var me = (e, t, n) => {
|
|
211
211
|
let r = t.name, i = t.setup(e);
|
|
212
212
|
if (i) {
|
|
213
213
|
let e = n[r] ?? {};
|
|
@@ -216,16 +216,16 @@ var pe = (e, t, n) => {
|
|
|
216
216
|
...i
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, he = M("component"), ge = L(({ client: e, component: t, name: n }) => ({
|
|
220
220
|
name: n,
|
|
221
221
|
component: t,
|
|
222
222
|
frameworkStore: e.frameworks.getByName(t.frameworkName)
|
|
223
223
|
}));
|
|
224
|
-
function
|
|
225
|
-
return R(
|
|
224
|
+
function _e(e) {
|
|
225
|
+
return R(ge, e);
|
|
226
226
|
}
|
|
227
|
-
var
|
|
228
|
-
let t =
|
|
227
|
+
var ve = L(({ client: e }) => {
|
|
228
|
+
let t = he.store({}), n = j(t, { register(e, t) {
|
|
229
229
|
return {
|
|
230
230
|
...e,
|
|
231
231
|
[t.name]: t
|
|
@@ -238,7 +238,7 @@ var _e = L(({ client: e }) => {
|
|
|
238
238
|
fn: (e, { name: t }) => `Component '${t}' already registered. Registering again will override the previous registration.`
|
|
239
239
|
}).watch((e) => /* @__PURE__ */ r("warn", e)), I({
|
|
240
240
|
clock: i,
|
|
241
|
-
fn: ({ name: t, component: n }) =>
|
|
241
|
+
fn: ({ name: t, component: n }) => _e({
|
|
242
242
|
client: e,
|
|
243
243
|
name: t,
|
|
244
244
|
component: n
|
|
@@ -255,16 +255,16 @@ var _e = L(({ client: e }) => {
|
|
|
255
255
|
listStore: a
|
|
256
256
|
};
|
|
257
257
|
});
|
|
258
|
-
function
|
|
259
|
-
return R(
|
|
258
|
+
function ye(e) {
|
|
259
|
+
return R(ve, e);
|
|
260
260
|
}
|
|
261
|
-
var
|
|
261
|
+
var be = (e, t, n) => {
|
|
262
262
|
n.register({
|
|
263
263
|
name: e,
|
|
264
264
|
component: t
|
|
265
265
|
});
|
|
266
|
-
},
|
|
267
|
-
let t =
|
|
266
|
+
}, xe = M("framework"), Se = L((e) => {
|
|
267
|
+
let t = xe.store({}), n = j(t, { register(e, t) {
|
|
268
268
|
return {
|
|
269
269
|
...e,
|
|
270
270
|
[t.name]: t.framework
|
|
@@ -289,15 +289,15 @@ var B = (e, t, n) => {
|
|
|
289
289
|
listStore: a
|
|
290
290
|
};
|
|
291
291
|
});
|
|
292
|
-
function
|
|
293
|
-
return R(
|
|
292
|
+
function Ce(e) {
|
|
293
|
+
return R(Se, e);
|
|
294
294
|
}
|
|
295
|
-
var
|
|
295
|
+
var we = (e, t) => {
|
|
296
296
|
t.register({
|
|
297
297
|
name: e.name,
|
|
298
298
|
framework: e
|
|
299
299
|
});
|
|
300
|
-
},
|
|
300
|
+
}, Te = 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 Se = (e, t) => {
|
|
|
311
311
|
...n
|
|
312
312
|
}));
|
|
313
313
|
});
|
|
314
|
-
function
|
|
315
|
-
return R(
|
|
314
|
+
function Ee(e) {
|
|
315
|
+
return R(Te, e);
|
|
316
316
|
}
|
|
317
317
|
//#endregion
|
|
318
318
|
//#region src/logic-engine.ts
|
|
319
|
-
function
|
|
319
|
+
function De(e) {
|
|
320
320
|
return typeof e == "number" && !isNaN(e);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function B(e) {
|
|
323
323
|
return typeof e == "string";
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function V(e) {
|
|
326
326
|
return Array.isArray(e);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Oe(e) {
|
|
329
329
|
return e instanceof Promise;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function ke(e) {
|
|
332
332
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
if (
|
|
334
|
+
function H(e) {
|
|
335
|
+
if (De(e)) return e;
|
|
336
336
|
let t = parseFloat(`${e}`);
|
|
337
337
|
return isNaN(t) ? 0 : t;
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function U(e) {
|
|
340
340
|
return `${e}`;
|
|
341
341
|
}
|
|
342
|
-
var
|
|
342
|
+
var Ae = {
|
|
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) =>
|
|
348
|
-
">=": (e, t) =>
|
|
347
|
+
">": (e, t) => H(e) > H(t),
|
|
348
|
+
">=": (e, t) => H(e) >= H(t),
|
|
349
349
|
"<": (e, t, n) => {
|
|
350
|
-
let r =
|
|
350
|
+
let r = H(e), i = H(t);
|
|
351
351
|
if (n === void 0) return r < i;
|
|
352
|
-
let a =
|
|
352
|
+
let a = H(n);
|
|
353
353
|
return r < i && i < a;
|
|
354
354
|
},
|
|
355
355
|
"<=": (e, t, n) => {
|
|
356
|
-
let r =
|
|
356
|
+
let r = H(e), i = H(t);
|
|
357
357
|
if (n === void 0) return r <= i;
|
|
358
|
-
let a =
|
|
358
|
+
let a = H(n);
|
|
359
359
|
return r <= i && i <= a;
|
|
360
360
|
},
|
|
361
|
-
"!!": async (e) => await
|
|
362
|
-
"!": async (e) => !await
|
|
363
|
-
"%": (e, t) =>
|
|
361
|
+
"!!": async (e) => await G(e),
|
|
362
|
+
"!": async (e) => !await G(e),
|
|
363
|
+
"%": (e, t) => H(e) % H(t),
|
|
364
364
|
log: (e) => (console.log(e), e),
|
|
365
|
-
in: (e, t) => t ?
|
|
366
|
-
cat: (...e) => e.map(
|
|
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(""),
|
|
367
367
|
substr: (e, t, n) => {
|
|
368
|
-
let r =
|
|
368
|
+
let r = U(e), i = H(t);
|
|
369
369
|
if (n === void 0) return r.substr(i);
|
|
370
|
-
let a =
|
|
370
|
+
let a = H(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) =>
|
|
378
|
-
"*": (...e) => e.reduce((e, t) =>
|
|
377
|
+
"+": (...e) => e.reduce((e, t) => H(e) + H(t), 0),
|
|
378
|
+
"*": (...e) => e.reduce((e, t) => H(e) * H(t), 1),
|
|
379
379
|
"-": (e, t) => {
|
|
380
|
-
let n =
|
|
381
|
-
return t === void 0 ? -n : n -
|
|
380
|
+
let n = H(e);
|
|
381
|
+
return t === void 0 ? -n : n - H(t);
|
|
382
382
|
},
|
|
383
|
-
"/": (e, t) =>
|
|
384
|
-
min: (...e) => Math.min(...e.map(
|
|
385
|
-
max: (...e) => Math.max(...e.map(
|
|
386
|
-
merge: (...e) => e.reduce((e, t) =>
|
|
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]), []),
|
|
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 =
|
|
391
|
+
let r = U(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 De = {
|
|
|
401
401
|
return a === void 0 ? n : a;
|
|
402
402
|
},
|
|
403
403
|
async missing(...e) {
|
|
404
|
-
let t =
|
|
404
|
+
let t = V(e[0]) ? e[0] : e, n = [];
|
|
405
405
|
for (let e of t) {
|
|
406
|
-
let t = await
|
|
406
|
+
let t = await W({ 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
|
|
413
|
-
if (!
|
|
414
|
-
let r = n.filter(
|
|
415
|
-
return t.filter(
|
|
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;
|
|
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) =>
|
|
422
|
-
endsWith: (e, t) =>
|
|
421
|
+
startsWith: (e, t) => B(e) && B(t) && e.startsWith(t),
|
|
422
|
+
endsWith: (e, t) => B(e) && B(t) && e.endsWith(t),
|
|
423
423
|
regexp_matches(e, t) {
|
|
424
424
|
let n = e, r = "";
|
|
425
|
-
if (
|
|
425
|
+
if (V(e)) {
|
|
426
426
|
let [t, i] = e;
|
|
427
427
|
n = t, r = i;
|
|
428
428
|
}
|
|
429
|
-
return !
|
|
429
|
+
return !B(n) || !B(r) ? !1 : new RegExp(n, r).test(U(t));
|
|
430
430
|
},
|
|
431
431
|
throw(e) {
|
|
432
|
-
throw Error(
|
|
432
|
+
throw Error(U(e));
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
|
-
async function
|
|
435
|
+
async function W(e, t) {
|
|
436
436
|
if (!e) return e;
|
|
437
|
-
if (
|
|
438
|
-
if (
|
|
439
|
-
if (!
|
|
440
|
-
let n =
|
|
441
|
-
switch (
|
|
437
|
+
if (Oe(e)) return W(await e, t);
|
|
438
|
+
if (V(e)) return Promise.all(e.map((e) => W(e, t)));
|
|
439
|
+
if (!ke(e)) return e;
|
|
440
|
+
let n = je(e), r = n ? e[n] ?? [] : [];
|
|
441
|
+
switch (V(r) || (r = [r]), n) {
|
|
442
442
|
case "if":
|
|
443
443
|
case "?:":
|
|
444
|
-
for (let e = 0; e < r.length - 1; e += 2) if (await
|
|
445
|
-
return r.length % 2 == 1 ?
|
|
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;
|
|
446
446
|
case "and": {
|
|
447
447
|
let e = null;
|
|
448
|
-
for (let n of r) if (e = await
|
|
448
|
+
for (let n of r) if (e = await W(n, t), !await G(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
|
|
453
|
+
for (let n of r) if (e = await W(n, t), await G(e)) return e;
|
|
454
454
|
return e;
|
|
455
455
|
}
|
|
456
456
|
case "map": {
|
|
457
|
-
let e = await
|
|
458
|
-
return
|
|
457
|
+
let e = await W(r[0], t);
|
|
458
|
+
return V(e) ? await Promise.all(e.map((e) => W(r[1], e))) : [];
|
|
459
459
|
}
|
|
460
460
|
case "filter": {
|
|
461
|
-
let e = await
|
|
462
|
-
return
|
|
461
|
+
let e = await W(r[0], t);
|
|
462
|
+
return V(e) ? (await Promise.all(e.map(async (e) => ({
|
|
463
463
|
item: e,
|
|
464
|
-
shouldInclude: await
|
|
464
|
+
shouldInclude: await G(await W(r[1], e))
|
|
465
465
|
})))).filter(({ shouldInclude: e }) => e).map(({ item: e }) => e) : [];
|
|
466
466
|
}
|
|
467
467
|
case "reduce": {
|
|
468
|
-
let e = await
|
|
469
|
-
if (!
|
|
470
|
-
let n = r[1], i = r.length > 2 ? await
|
|
471
|
-
for (let t of e) i = await
|
|
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, {
|
|
472
472
|
current: t,
|
|
473
473
|
accumulator: i
|
|
474
474
|
});
|
|
475
475
|
return i;
|
|
476
476
|
}
|
|
477
477
|
case "all": {
|
|
478
|
-
let e = await
|
|
479
|
-
if (!
|
|
480
|
-
for (let t of e) if (!await
|
|
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;
|
|
481
481
|
return !0;
|
|
482
482
|
}
|
|
483
483
|
case "some": {
|
|
484
|
-
let e = await
|
|
485
|
-
if (!
|
|
486
|
-
for (let t of e) if (await
|
|
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;
|
|
487
487
|
return !1;
|
|
488
488
|
}
|
|
489
489
|
case "none": {
|
|
490
|
-
let e = await
|
|
491
|
-
if (!
|
|
492
|
-
for (let t of e) if (await
|
|
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;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
495
|
case "catch": try {
|
|
496
|
-
return await
|
|
496
|
+
return await W(r[0], t);
|
|
497
497
|
} catch (e) {
|
|
498
|
-
return
|
|
498
|
+
return ke(e) ? await W(e, t) : r[1] ? await W(r[1], e) : e instanceof Error ? e.message : e;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
let i = await Promise.all(r.map((e) =>
|
|
501
|
+
let i = await Promise.all(r.map((e) => W(e, t))), a = n ? Ae[n] : void 0;
|
|
502
502
|
if (!a) throw Error(`Unrecognized operation ${n}`);
|
|
503
503
|
return a.apply(t, i);
|
|
504
504
|
}
|
|
505
|
-
async function
|
|
506
|
-
return
|
|
505
|
+
async function G(e) {
|
|
506
|
+
return Oe(e) ? G(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function je(e) {
|
|
509
509
|
return Object.keys(e)[0];
|
|
510
510
|
}
|
|
511
511
|
//#endregion
|
|
512
512
|
//#region src/lifecycle/rules-logic.ts
|
|
513
|
-
function
|
|
513
|
+
function Me(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
|
|
517
|
+
if (a !== void 0) return async () => !n.has(i) && await W(a.logic, {
|
|
518
518
|
...t,
|
|
519
|
-
conditions:
|
|
519
|
+
conditions: Me(e, t, new Set(n).add(i))
|
|
520
520
|
}) === !0;
|
|
521
521
|
} });
|
|
522
522
|
}
|
|
523
|
-
var
|
|
523
|
+
var Ne = L(({ client: e }) => k({
|
|
524
524
|
source: {
|
|
525
525
|
stateSnapshot: e.stateSnapshotStore,
|
|
526
526
|
predicates: e.predicates.listStore,
|
|
@@ -557,21 +557,21 @@ var Ae = L(({ client: e }) => k({
|
|
|
557
557
|
features: u,
|
|
558
558
|
...s
|
|
559
559
|
};
|
|
560
|
-
return await
|
|
560
|
+
return await W(o, {
|
|
561
561
|
...d,
|
|
562
|
-
conditions:
|
|
562
|
+
conditions: Me(a, d, /* @__PURE__ */ new Set())
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
565
|
}));
|
|
566
|
-
function
|
|
567
|
-
return R(
|
|
566
|
+
function Pe(e) {
|
|
567
|
+
return R(Ne, e);
|
|
568
568
|
}
|
|
569
569
|
//#endregion
|
|
570
570
|
//#region src/ping.ts
|
|
571
|
-
var
|
|
571
|
+
var Fe = 6e3, Ie = O("last_ping", "global"), Le = async (e) => {
|
|
572
572
|
try {
|
|
573
|
-
let t = Date.now(), n = E.get(
|
|
574
|
-
if (n.isSet() && (r = n.json() ?? 0), r && t - r <
|
|
573
|
+
let t = Date.now(), n = E.get(Ie), r = 0;
|
|
574
|
+
if (n.isSet() && (r = n.json() ?? 0), r && t - r < Fe) return !0;
|
|
575
575
|
let i = {
|
|
576
576
|
projectId: e.projectId,
|
|
577
577
|
path: window.location.pathname
|
|
@@ -582,27 +582,27 @@ var Me = 6e3, Ne = O("last_ping", "global"), Pe = async (e) => {
|
|
|
582
582
|
} catch {
|
|
583
583
|
return !1;
|
|
584
584
|
}
|
|
585
|
-
},
|
|
586
|
-
let t =
|
|
585
|
+
}, K = M("lifecycle"), Re = L(({ client: e }) => {
|
|
586
|
+
let t = K.store(!1), r = F(void 0, {
|
|
587
587
|
skipVoid: !1,
|
|
588
|
-
domain:
|
|
588
|
+
domain: K
|
|
589
589
|
}), i = F(void 0, {
|
|
590
590
|
skipVoid: !1,
|
|
591
|
-
domain:
|
|
592
|
-
}), a =
|
|
591
|
+
domain: K
|
|
592
|
+
}), a = K.store("idle"), o = K.store([]), s = F(void 0, {
|
|
593
593
|
skipVoid: !1,
|
|
594
|
-
domain:
|
|
594
|
+
domain: K
|
|
595
595
|
}), l = F(void 0, {
|
|
596
596
|
skipVoid: !1,
|
|
597
|
-
domain:
|
|
597
|
+
domain: K
|
|
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
|
-
|
|
601
|
+
Le(e);
|
|
602
602
|
}), _ = N(async () => {
|
|
603
603
|
await ee();
|
|
604
604
|
}), v = N(async () => {
|
|
605
|
-
await
|
|
605
|
+
await fe(e);
|
|
606
606
|
}), y = k({ effect: v }), b = k({
|
|
607
607
|
source: o,
|
|
608
608
|
effect: async (e) => {
|
|
@@ -731,13 +731,13 @@ var Me = 6e3, Ne = O("last_ping", "global"), Pe = async (e) => {
|
|
|
731
731
|
setCondition: h
|
|
732
732
|
};
|
|
733
733
|
});
|
|
734
|
-
function
|
|
735
|
-
return R(
|
|
734
|
+
function ze(e) {
|
|
735
|
+
return R(Re, e);
|
|
736
736
|
}
|
|
737
737
|
//#endregion
|
|
738
738
|
//#region src/entities/predicate/predicate.ts
|
|
739
|
-
var
|
|
740
|
-
let t =
|
|
739
|
+
var Be = M("predicate"), Ve = L(({ client: e }) => {
|
|
740
|
+
let t = Be.store({}), n = j(t, { register(e, t) {
|
|
741
741
|
return {
|
|
742
742
|
...e,
|
|
743
743
|
[t.name]: {
|
|
@@ -795,23 +795,23 @@ var Le = M("predicate"), Re = L(({ client: e }) => {
|
|
|
795
795
|
getEvokablePredicate: s
|
|
796
796
|
};
|
|
797
797
|
});
|
|
798
|
-
function
|
|
799
|
-
return R(
|
|
798
|
+
function He(e) {
|
|
799
|
+
return R(Ve, e);
|
|
800
800
|
}
|
|
801
|
-
var
|
|
801
|
+
var Ue = (e, t, n) => {
|
|
802
802
|
n.register({
|
|
803
803
|
name: e,
|
|
804
804
|
predicate: t
|
|
805
805
|
});
|
|
806
|
-
},
|
|
807
|
-
function
|
|
806
|
+
}, We = M("feature");
|
|
807
|
+
function q(e) {
|
|
808
808
|
return e?.enabled === !1;
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function Ge(e) {
|
|
811
811
|
return e === "true" || e !== "false" && e;
|
|
812
812
|
}
|
|
813
|
-
var
|
|
814
|
-
let t =
|
|
813
|
+
var Ke = L(({ client: e }) => {
|
|
814
|
+
let t = We.store({}), n = We.store([]), i = j(t, { register(e, t) {
|
|
815
815
|
return {
|
|
816
816
|
...e,
|
|
817
817
|
[t.id]: t.feature
|
|
@@ -842,7 +842,7 @@ var Ue = L(({ client: e }) => {
|
|
|
842
842
|
return a ? {
|
|
843
843
|
id: e,
|
|
844
844
|
key: t,
|
|
845
|
-
bucket:
|
|
845
|
+
bucket: Ge(a),
|
|
846
846
|
storage: n
|
|
847
847
|
} : null;
|
|
848
848
|
}), s = N((e) => {
|
|
@@ -859,7 +859,7 @@ var Ue = L(({ client: e }) => {
|
|
|
859
859
|
if (a) return a;
|
|
860
860
|
let o = e[n];
|
|
861
861
|
if (!o) throw Error(`Feature with id '${n}' not found`);
|
|
862
|
-
if (
|
|
862
|
+
if (q(o.feature)) return {
|
|
863
863
|
id: o.id,
|
|
864
864
|
bucket: !1,
|
|
865
865
|
key: i,
|
|
@@ -901,7 +901,7 @@ var Ue = L(({ client: e }) => {
|
|
|
901
901
|
}), I({
|
|
902
902
|
source: t,
|
|
903
903
|
clock: l.doneData,
|
|
904
|
-
filter: (e, t) => !
|
|
904
|
+
filter: (e, t) => !q(e[t.id]?.feature),
|
|
905
905
|
fn: (e, t) => {
|
|
906
906
|
let { id: n, bucket: r, storage: i } = t, a = e[n]?.feature.key;
|
|
907
907
|
return a ? {
|
|
@@ -945,7 +945,7 @@ var Ue = L(({ client: e }) => {
|
|
|
945
945
|
resolvedFeatures: n,
|
|
946
946
|
allFeatures: t
|
|
947
947
|
},
|
|
948
|
-
filter: ({ resolvedFeatures: e, allFeatures: t }, { id: n, key: r }) => !
|
|
948
|
+
filter: ({ resolvedFeatures: e, allFeatures: t }, { id: n, key: r }) => !q(t[n]?.feature) && !e.some((e) => e.id === n && e.key === r),
|
|
949
949
|
fn: (e, t) => t,
|
|
950
950
|
target: e.eventBus.prepend((e) => ({
|
|
951
951
|
type: "feature_decide",
|
|
@@ -957,25 +957,31 @@ var Ue = L(({ client: e }) => {
|
|
|
957
957
|
resolvedFeatures: n,
|
|
958
958
|
allFeatures: t
|
|
959
959
|
},
|
|
960
|
-
fn: ({ resolvedFeatures: e, allFeatures: t }, n) => !n ||
|
|
960
|
+
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],
|
|
961
961
|
target: n
|
|
962
962
|
});
|
|
963
963
|
function d(e) {
|
|
964
964
|
return u.map((t) => t.find((t) => t.id === e));
|
|
965
965
|
}
|
|
966
|
-
|
|
966
|
+
let f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
967
|
+
function h(e) {
|
|
968
|
+
let t = f.get(e);
|
|
969
|
+
if (t) return t;
|
|
970
|
+
let n = d(e);
|
|
971
|
+
return f.set(e, n), n;
|
|
972
|
+
}
|
|
973
|
+
function g(e) {
|
|
967
974
|
return t.map((t) => t[e], { skipVoid: !1 });
|
|
968
975
|
}
|
|
969
|
-
function
|
|
970
|
-
let t = F(async () => void 0, { skipVoid: !1 }), r = k({
|
|
971
|
-
source:
|
|
976
|
+
function _(e) {
|
|
977
|
+
let t = F(async () => void 0, { skipVoid: !1 }), n = h(e), r = k({
|
|
978
|
+
source: n,
|
|
972
979
|
effect: async (e) => {
|
|
973
980
|
if (e) return async () => (await e.getBucket()).bucket;
|
|
974
981
|
}
|
|
975
982
|
});
|
|
976
983
|
return I({
|
|
977
|
-
|
|
978
|
-
filter: (t) => t.some((t) => t.id === e),
|
|
984
|
+
clock: n,
|
|
979
985
|
target: r
|
|
980
986
|
}), I({
|
|
981
987
|
clock: r.doneData,
|
|
@@ -983,24 +989,57 @@ var Ue = L(({ client: e }) => {
|
|
|
983
989
|
target: t
|
|
984
990
|
}), r(), t;
|
|
985
991
|
}
|
|
992
|
+
function v(e) {
|
|
993
|
+
let t = p.get(e);
|
|
994
|
+
if (t) return t;
|
|
995
|
+
let n = _(e);
|
|
996
|
+
return p.set(e, n), n;
|
|
997
|
+
}
|
|
998
|
+
function ee(e) {
|
|
999
|
+
let t = v(e), n = F(void 0, { skipVoid: !1 }), r = k({
|
|
1000
|
+
source: t,
|
|
1001
|
+
mapParams: (e, t) => t,
|
|
1002
|
+
effect: N(async (e) => await e())
|
|
1003
|
+
});
|
|
1004
|
+
return I({
|
|
1005
|
+
clock: r.doneData,
|
|
1006
|
+
fn: (t) => {
|
|
1007
|
+
if (t !== void 0) return {
|
|
1008
|
+
id: e,
|
|
1009
|
+
bucket: t
|
|
1010
|
+
};
|
|
1011
|
+
},
|
|
1012
|
+
target: n
|
|
1013
|
+
}), I({
|
|
1014
|
+
clock: t,
|
|
1015
|
+
target: r
|
|
1016
|
+
}), r(), n;
|
|
1017
|
+
}
|
|
1018
|
+
function y(e) {
|
|
1019
|
+
let t = m.get(e);
|
|
1020
|
+
if (t) return t;
|
|
1021
|
+
let n = ee(e);
|
|
1022
|
+
return m.set(e, n), n;
|
|
1023
|
+
}
|
|
986
1024
|
return {
|
|
987
1025
|
register: a,
|
|
988
|
-
getById:
|
|
989
|
-
getByName:
|
|
1026
|
+
getById: h,
|
|
1027
|
+
getByName: g,
|
|
990
1028
|
listStore: u,
|
|
991
|
-
getEvokableFeature:
|
|
1029
|
+
getEvokableFeature: v,
|
|
1030
|
+
getFeatureResult: y
|
|
992
1031
|
};
|
|
993
1032
|
});
|
|
994
|
-
function
|
|
995
|
-
return R(
|
|
1033
|
+
function qe(e) {
|
|
1034
|
+
return R(Ke, e);
|
|
996
1035
|
}
|
|
997
|
-
var
|
|
1036
|
+
var Je = (e, t, n) => {
|
|
998
1037
|
n.register({
|
|
999
1038
|
id: e,
|
|
1000
1039
|
feature: t
|
|
1001
1040
|
});
|
|
1002
|
-
},
|
|
1003
|
-
function
|
|
1041
|
+
}, J = M("history");
|
|
1042
|
+
function Ye(e, t) {
|
|
1004
1043
|
return {
|
|
1005
1044
|
id: re(`history-entry-${Date.now()}-${Math.random()}}`),
|
|
1006
1045
|
node: t,
|
|
@@ -1008,9 +1047,9 @@ function Ke(e, t) {
|
|
|
1008
1047
|
experienceId: e
|
|
1009
1048
|
};
|
|
1010
1049
|
}
|
|
1011
|
-
var
|
|
1012
|
-
let e =
|
|
1013
|
-
e.on(t, (e, t) => ({ entries: [...e.entries,
|
|
1050
|
+
var Xe = L(() => {
|
|
1051
|
+
let e = J.store({ entries: [] }), t = J.event(), n = J.event(), r = J.event(), i = J.event();
|
|
1052
|
+
e.on(t, (e, t) => ({ entries: [...e.entries, Ye(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Ye(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
|
|
1014
1053
|
function a(e, t) {
|
|
1015
1054
|
let n = {
|
|
1016
1055
|
lastStepIndex: -1,
|
|
@@ -1040,20 +1079,20 @@ var qe = L(() => {
|
|
|
1040
1079
|
entriesStore: e.map((e) => e.entries)
|
|
1041
1080
|
};
|
|
1042
1081
|
});
|
|
1043
|
-
function
|
|
1044
|
-
return R(
|
|
1082
|
+
function Ze() {
|
|
1083
|
+
return R(Xe);
|
|
1045
1084
|
}
|
|
1046
1085
|
//#endregion
|
|
1047
1086
|
//#region src/utils/events.ts
|
|
1048
|
-
var
|
|
1087
|
+
var Qe = 0, $e = (e) => {
|
|
1049
1088
|
let t = F([]);
|
|
1050
1089
|
return t.on(e, (e, t) => [...e, {
|
|
1051
|
-
id:
|
|
1090
|
+
id: Qe++,
|
|
1052
1091
|
at: /* @__PURE__ */ new Date(),
|
|
1053
1092
|
payload: t
|
|
1054
1093
|
}]), t;
|
|
1055
|
-
},
|
|
1056
|
-
let e =
|
|
1094
|
+
}, et = M("field"), tt = L(() => {
|
|
1095
|
+
let e = et.store({}), t = j(e, {
|
|
1057
1096
|
register(e, t) {
|
|
1058
1097
|
return {
|
|
1059
1098
|
...e,
|
|
@@ -1101,13 +1140,13 @@ var Ye = 0, Xe = (e) => {
|
|
|
1101
1140
|
getByName: c
|
|
1102
1141
|
};
|
|
1103
1142
|
});
|
|
1104
|
-
function
|
|
1105
|
-
return R(
|
|
1143
|
+
function nt() {
|
|
1144
|
+
return R(tt);
|
|
1106
1145
|
}
|
|
1107
1146
|
//#endregion
|
|
1108
1147
|
//#region src/entities/step/step.ts
|
|
1109
|
-
var
|
|
1110
|
-
let e =
|
|
1148
|
+
var rt = M("step"), it = L(() => {
|
|
1149
|
+
let e = rt.store({}), t = j(e, { register(e, t) {
|
|
1111
1150
|
return {
|
|
1112
1151
|
...e,
|
|
1113
1152
|
[t.step.id]: t.step
|
|
@@ -1131,16 +1170,16 @@ var et = M("step"), tt = L(() => {
|
|
|
1131
1170
|
indexStore: e
|
|
1132
1171
|
};
|
|
1133
1172
|
});
|
|
1134
|
-
function
|
|
1135
|
-
return R(
|
|
1173
|
+
function at() {
|
|
1174
|
+
return R(it);
|
|
1136
1175
|
}
|
|
1137
|
-
function
|
|
1176
|
+
function ot(e, t) {
|
|
1138
1177
|
t.register(e);
|
|
1139
1178
|
}
|
|
1140
1179
|
//#endregion
|
|
1141
1180
|
//#region src/entities/content/content.ts
|
|
1142
|
-
var
|
|
1143
|
-
let e =
|
|
1181
|
+
var st = M("content"), ct = L(() => {
|
|
1182
|
+
let e = st.store({}), t = j(e, {
|
|
1144
1183
|
register(e, t) {
|
|
1145
1184
|
return {
|
|
1146
1185
|
...e,
|
|
@@ -1181,16 +1220,16 @@ var it = M("content"), at = L(() => {
|
|
|
1181
1220
|
indexStore: e
|
|
1182
1221
|
};
|
|
1183
1222
|
});
|
|
1184
|
-
function
|
|
1185
|
-
return R(
|
|
1223
|
+
function lt() {
|
|
1224
|
+
return R(ct);
|
|
1186
1225
|
}
|
|
1187
|
-
function
|
|
1226
|
+
function ut(e, t) {
|
|
1188
1227
|
t.register(e);
|
|
1189
1228
|
}
|
|
1190
1229
|
//#endregion
|
|
1191
1230
|
//#region src/entities/action/action.ts
|
|
1192
|
-
var
|
|
1193
|
-
let t =
|
|
1231
|
+
var dt = M("action"), ft = L(({ client: e }) => {
|
|
1232
|
+
let t = dt.store({}), n = j(t, { register(e, t) {
|
|
1194
1233
|
return {
|
|
1195
1234
|
...e,
|
|
1196
1235
|
[t.key]: {
|
|
@@ -1248,10 +1287,10 @@ var ct = M("action"), lt = L(({ client: e }) => {
|
|
|
1248
1287
|
getEvokableAction: s
|
|
1249
1288
|
};
|
|
1250
1289
|
});
|
|
1251
|
-
function
|
|
1252
|
-
return R(
|
|
1290
|
+
function pt(e) {
|
|
1291
|
+
return R(ft, e);
|
|
1253
1292
|
}
|
|
1254
|
-
var
|
|
1293
|
+
var mt = (e, t, n) => {
|
|
1255
1294
|
n.register({
|
|
1256
1295
|
key: e,
|
|
1257
1296
|
action: t
|
|
@@ -1259,7 +1298,7 @@ var dt = (e, t, n) => {
|
|
|
1259
1298
|
};
|
|
1260
1299
|
//#endregion
|
|
1261
1300
|
//#region src/entities/response/response-validation.ts
|
|
1262
|
-
function
|
|
1301
|
+
function Y(e, t, n, r) {
|
|
1263
1302
|
return {
|
|
1264
1303
|
fieldKey: e.key,
|
|
1265
1304
|
userMessage: n,
|
|
@@ -1267,62 +1306,62 @@ function Z(e, t, n, r) {
|
|
|
1267
1306
|
value: t
|
|
1268
1307
|
};
|
|
1269
1308
|
}
|
|
1270
|
-
function
|
|
1309
|
+
function X(e) {
|
|
1271
1310
|
return e === null || e === "" || Array.isArray(e) && !e.length;
|
|
1272
1311
|
}
|
|
1273
|
-
function
|
|
1312
|
+
function ht(e) {
|
|
1274
1313
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
|
|
1275
1314
|
}
|
|
1276
|
-
function
|
|
1315
|
+
function gt(e) {
|
|
1277
1316
|
try {
|
|
1278
1317
|
return JSON.stringify(e), !0;
|
|
1279
1318
|
} catch {
|
|
1280
1319
|
return !1;
|
|
1281
1320
|
}
|
|
1282
1321
|
}
|
|
1283
|
-
function
|
|
1322
|
+
function _t(e, t) {
|
|
1284
1323
|
return t.find((t) => t.key === e) ?? null;
|
|
1285
1324
|
}
|
|
1286
|
-
function
|
|
1325
|
+
function vt(e, t) {
|
|
1287
1326
|
return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
|
|
1288
1327
|
}
|
|
1289
|
-
function
|
|
1290
|
-
if (e.type !== "object" ||
|
|
1328
|
+
function yt(e, t) {
|
|
1329
|
+
if (e.type !== "object" || X(t)) return null;
|
|
1291
1330
|
if (e.multiple) {
|
|
1292
|
-
if (!Array.isArray(t)) return
|
|
1331
|
+
if (!Array.isArray(t)) return Y(e, t, "This field expects multiple values", "Field expects an array of objects.");
|
|
1293
1332
|
for (let n of t) {
|
|
1294
|
-
if (typeof n != "object" || !n) return
|
|
1295
|
-
if (!
|
|
1333
|
+
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.");
|
|
1334
|
+
if (!gt(n)) return Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1296
1335
|
}
|
|
1297
1336
|
return null;
|
|
1298
1337
|
}
|
|
1299
|
-
return Array.isArray(t) ?
|
|
1338
|
+
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.") : gt(t) ? null : Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1300
1339
|
}
|
|
1301
|
-
function
|
|
1302
|
-
if (
|
|
1340
|
+
function bt(e, t) {
|
|
1341
|
+
if (X(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
|
|
1303
1342
|
let n = Array.isArray(t) ? t : [t];
|
|
1304
1343
|
if (e.type === "object") {
|
|
1305
1344
|
let r = new Set(e.options.map((e) => JSON.stringify(e.value)));
|
|
1306
|
-
return n.every((e) => r.has(JSON.stringify(e))) ? null :
|
|
1345
|
+
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.");
|
|
1307
1346
|
}
|
|
1308
1347
|
let r = e.options.map((e) => e.value);
|
|
1309
|
-
return n.every((e) => !
|
|
1348
|
+
return n.every((e) => !ht(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(", ")}`);
|
|
1310
1349
|
}
|
|
1311
|
-
async function
|
|
1312
|
-
if (n.validation && !e(n.validation) && !
|
|
1350
|
+
async function xt(t, n, r, i) {
|
|
1351
|
+
if (n.validation && !e(n.validation) && !X(r)) {
|
|
1313
1352
|
let e = i ? {
|
|
1314
1353
|
$input: r,
|
|
1315
1354
|
responses: i
|
|
1316
1355
|
} : { $input: r }, a = await t(n.validation, e);
|
|
1317
|
-
if (typeof a == "string") return
|
|
1318
|
-
if (a === !1) return
|
|
1356
|
+
if (typeof a == "string") return Y(n, r, a, `Field validation resulted in an error: ${a}.`);
|
|
1357
|
+
if (a === !1) return Y(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
|
|
1319
1358
|
}
|
|
1320
|
-
return n.required &&
|
|
1359
|
+
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;
|
|
1321
1360
|
}
|
|
1322
1361
|
//#endregion
|
|
1323
1362
|
//#region src/entities/response/response.ts
|
|
1324
|
-
var
|
|
1325
|
-
let t =
|
|
1363
|
+
var St = M("response"), Ct = L(({ client: e }) => {
|
|
1364
|
+
let t = St.store({}), r = P(), i = P(), a = j(t, {
|
|
1326
1365
|
register(e, t) {
|
|
1327
1366
|
return {
|
|
1328
1367
|
...e,
|
|
@@ -1361,7 +1400,7 @@ var yt = M("response"), bt = L(({ client: e }) => {
|
|
|
1361
1400
|
...t,
|
|
1362
1401
|
...n
|
|
1363
1402
|
}, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
|
|
1364
|
-
let o =
|
|
1403
|
+
let o = _t(t, e);
|
|
1365
1404
|
if (!o) {
|
|
1366
1405
|
r.push({
|
|
1367
1406
|
fieldKey: t,
|
|
@@ -1371,17 +1410,17 @@ var yt = M("response"), bt = L(({ client: e }) => {
|
|
|
1371
1410
|
});
|
|
1372
1411
|
return;
|
|
1373
1412
|
}
|
|
1374
|
-
let c =
|
|
1413
|
+
let c = vt(o, n), l = await xt(s, o, c, a);
|
|
1375
1414
|
if (l) {
|
|
1376
1415
|
r.push(l);
|
|
1377
1416
|
return;
|
|
1378
1417
|
}
|
|
1379
|
-
let u =
|
|
1418
|
+
let u = yt(o, c);
|
|
1380
1419
|
if (u) {
|
|
1381
1420
|
r.push(u);
|
|
1382
1421
|
return;
|
|
1383
1422
|
}
|
|
1384
|
-
let d =
|
|
1423
|
+
let d = bt(o, c);
|
|
1385
1424
|
if (d) {
|
|
1386
1425
|
r.push(d);
|
|
1387
1426
|
return;
|
|
@@ -1460,13 +1499,13 @@ var yt = M("response"), bt = L(({ client: e }) => {
|
|
|
1460
1499
|
getByFieldName: _
|
|
1461
1500
|
};
|
|
1462
1501
|
});
|
|
1463
|
-
function
|
|
1464
|
-
return R(
|
|
1502
|
+
function wt(e) {
|
|
1503
|
+
return R(Ct, e);
|
|
1465
1504
|
}
|
|
1466
1505
|
//#endregion
|
|
1467
1506
|
//#region src/entities/condition/condition.ts
|
|
1468
|
-
var
|
|
1469
|
-
let e =
|
|
1507
|
+
var Tt = M("condition"), Et = L(() => {
|
|
1508
|
+
let e = Tt.store({}), t = j(e, { register(e, t) {
|
|
1470
1509
|
return {
|
|
1471
1510
|
...e,
|
|
1472
1511
|
[t.condition.id]: t.condition
|
|
@@ -1490,12 +1529,12 @@ var St = M("condition"), Ct = L(() => {
|
|
|
1490
1529
|
indexStore: e
|
|
1491
1530
|
};
|
|
1492
1531
|
});
|
|
1493
|
-
function
|
|
1494
|
-
return R(
|
|
1532
|
+
function Dt() {
|
|
1533
|
+
return R(Et);
|
|
1495
1534
|
}
|
|
1496
1535
|
//#endregion
|
|
1497
1536
|
//#region src/utils/api-url.ts
|
|
1498
|
-
function
|
|
1537
|
+
function Ot() {
|
|
1499
1538
|
if (c()) {
|
|
1500
1539
|
let e = [
|
|
1501
1540
|
document.currentScript,
|
|
@@ -1510,7 +1549,7 @@ function Tt() {
|
|
|
1510
1549
|
}
|
|
1511
1550
|
//#endregion
|
|
1512
1551
|
//#region src/utils/search-params.ts
|
|
1513
|
-
function
|
|
1552
|
+
function kt() {
|
|
1514
1553
|
if (!s()) return {};
|
|
1515
1554
|
let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
|
|
1516
1555
|
for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
|
|
@@ -1528,13 +1567,13 @@ function Et() {
|
|
|
1528
1567
|
}
|
|
1529
1568
|
//#endregion
|
|
1530
1569
|
//#region src/entities/session/session.ts
|
|
1531
|
-
var
|
|
1532
|
-
function
|
|
1570
|
+
var At = O("session", "global");
|
|
1571
|
+
function jt() {
|
|
1533
1572
|
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)}`;
|
|
1534
1573
|
}
|
|
1535
|
-
function
|
|
1574
|
+
function Mt() {
|
|
1536
1575
|
if (!m()) return null;
|
|
1537
|
-
let e = E.get(
|
|
1576
|
+
let e = E.get(At);
|
|
1538
1577
|
if (!e.isSet()) return null;
|
|
1539
1578
|
try {
|
|
1540
1579
|
return e.json();
|
|
@@ -1542,8 +1581,8 @@ function kt() {
|
|
|
1542
1581
|
return null;
|
|
1543
1582
|
}
|
|
1544
1583
|
}
|
|
1545
|
-
var
|
|
1546
|
-
let e =
|
|
1584
|
+
var Nt = L(() => {
|
|
1585
|
+
let e = Mt(), t = { id: e?.id ?? jt() };
|
|
1547
1586
|
e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
|
|
1548
1587
|
let n = F(t), r = j(n, {
|
|
1549
1588
|
setIsUser: (e, t) => ({
|
|
@@ -1569,7 +1608,7 @@ var At = L(() => {
|
|
|
1569
1608
|
source: n,
|
|
1570
1609
|
effect: (e) => {
|
|
1571
1610
|
if (m()) try {
|
|
1572
|
-
E.get(
|
|
1611
|
+
E.get(At).set(e);
|
|
1573
1612
|
} catch {}
|
|
1574
1613
|
}
|
|
1575
1614
|
});
|
|
@@ -1583,39 +1622,39 @@ var At = L(() => {
|
|
|
1583
1622
|
removeIdentifier: r.removeIdentifier
|
|
1584
1623
|
};
|
|
1585
1624
|
});
|
|
1586
|
-
function
|
|
1587
|
-
return R(
|
|
1625
|
+
function Pt() {
|
|
1626
|
+
return R(Nt, void 0);
|
|
1588
1627
|
}
|
|
1589
1628
|
//#endregion
|
|
1590
1629
|
//#region src/utils/picked-config.ts
|
|
1591
|
-
function
|
|
1630
|
+
function Ft() {
|
|
1592
1631
|
if (s()) return globalThis.window.pickedConfig;
|
|
1593
1632
|
}
|
|
1594
|
-
function
|
|
1595
|
-
if (s()) return
|
|
1633
|
+
function It() {
|
|
1634
|
+
if (s()) return Ft()?.projectId;
|
|
1596
1635
|
}
|
|
1597
|
-
function
|
|
1636
|
+
function Lt() {
|
|
1598
1637
|
if (!c()) return;
|
|
1599
1638
|
let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
|
|
1600
1639
|
if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
|
|
1601
1640
|
}
|
|
1602
|
-
function
|
|
1641
|
+
function Rt(e) {
|
|
1603
1642
|
if (e.projectId) return e.projectId;
|
|
1604
|
-
let t =
|
|
1643
|
+
let t = It();
|
|
1605
1644
|
if (t) return t;
|
|
1606
|
-
let n =
|
|
1645
|
+
let n = Lt();
|
|
1607
1646
|
if (n) return n;
|
|
1608
1647
|
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.");
|
|
1609
1648
|
}
|
|
1610
1649
|
//#endregion
|
|
1611
1650
|
//#region src/utils/render-string.ts
|
|
1612
|
-
function
|
|
1651
|
+
function Z(e) {
|
|
1613
1652
|
return e == null || e === "" || Number.isNaN(e);
|
|
1614
1653
|
}
|
|
1615
|
-
var
|
|
1616
|
-
default: (e, t) =>
|
|
1617
|
-
append: (e, t) => t &&
|
|
1618
|
-
prepend: (e, t) => t &&
|
|
1654
|
+
var zt = {
|
|
1655
|
+
default: (e, t) => Z(e) ? String(t ?? "") : String(e),
|
|
1656
|
+
append: (e, t) => t && !Z(e) ? `${e} ${t}` : e,
|
|
1657
|
+
prepend: (e, t) => t && !Z(e) ? `${t} ${e}` : e,
|
|
1619
1658
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
1620
1659
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
|
|
1621
1660
|
capitalize: (e) => typeof e == "string" ? e.charAt(0).toUpperCase() + e.slice(1) : e,
|
|
@@ -1633,24 +1672,24 @@ var It = {
|
|
|
1633
1672
|
return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
|
|
1634
1673
|
}
|
|
1635
1674
|
};
|
|
1636
|
-
function
|
|
1675
|
+
function Bt(e) {
|
|
1637
1676
|
return typeof e == "object" && !!e;
|
|
1638
1677
|
}
|
|
1639
|
-
function
|
|
1678
|
+
function Vt(e, t) {
|
|
1640
1679
|
let n = t;
|
|
1641
|
-
for (let t of e.split(".")) if (
|
|
1680
|
+
for (let t of e.split(".")) if (Bt(n) && t in n) n = n[t];
|
|
1642
1681
|
else return;
|
|
1643
1682
|
return typeof n == "function" ? n() : n;
|
|
1644
1683
|
}
|
|
1645
|
-
function
|
|
1646
|
-
let n = e.split("|").map((e) => e.trim()), r =
|
|
1684
|
+
function Ht(e, t) {
|
|
1685
|
+
let n = e.split("|").map((e) => e.trim()), r = Vt(n.shift() ?? "", t);
|
|
1647
1686
|
for (let e of n) {
|
|
1648
|
-
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o =
|
|
1687
|
+
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = zt[i];
|
|
1649
1688
|
o && (r = o(r, a));
|
|
1650
1689
|
}
|
|
1651
|
-
return
|
|
1690
|
+
return Z(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
|
|
1652
1691
|
}
|
|
1653
|
-
function
|
|
1692
|
+
function Ut(e, t) {
|
|
1654
1693
|
let n = "", r = 0;
|
|
1655
1694
|
for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
|
|
1656
1695
|
r += 2;
|
|
@@ -1662,19 +1701,19 @@ function Bt(e, t) {
|
|
|
1662
1701
|
}
|
|
1663
1702
|
i += e[r++];
|
|
1664
1703
|
}
|
|
1665
|
-
n +=
|
|
1704
|
+
n += Ht(i.trim(), t);
|
|
1666
1705
|
} else n += e[r++];
|
|
1667
1706
|
return n;
|
|
1668
1707
|
}
|
|
1669
1708
|
//#endregion
|
|
1670
1709
|
//#region src/utils/preview-session.ts
|
|
1671
|
-
var
|
|
1672
|
-
function
|
|
1673
|
-
return !s() || !h() ? !1 : !!
|
|
1710
|
+
var Wt = "preview-token";
|
|
1711
|
+
function Gt() {
|
|
1712
|
+
return !s() || !h() ? !1 : !!kt()[Wt]?.[0];
|
|
1674
1713
|
}
|
|
1675
1714
|
//#endregion
|
|
1676
1715
|
//#region src/picked.ts
|
|
1677
|
-
var
|
|
1716
|
+
var Kt = class {
|
|
1678
1717
|
static logger = r;
|
|
1679
1718
|
options;
|
|
1680
1719
|
dataSource = null;
|
|
@@ -1690,43 +1729,43 @@ var Ut = class {
|
|
|
1690
1729
|
apiUrl;
|
|
1691
1730
|
dashboardUrl;
|
|
1692
1731
|
documentationSiteUrl;
|
|
1693
|
-
session =
|
|
1694
|
-
searchParams =
|
|
1695
|
-
history =
|
|
1696
|
-
components =
|
|
1732
|
+
session = Pt();
|
|
1733
|
+
searchParams = kt();
|
|
1734
|
+
history = Ze();
|
|
1735
|
+
components = ye({ client: this });
|
|
1697
1736
|
experienceInstances = S({ client: this });
|
|
1698
|
-
experiences =
|
|
1699
|
-
frameworks =
|
|
1700
|
-
predicates =
|
|
1701
|
-
features =
|
|
1702
|
-
conditions =
|
|
1703
|
-
fields =
|
|
1704
|
-
responses =
|
|
1705
|
-
steps =
|
|
1706
|
-
contents =
|
|
1707
|
-
actions =
|
|
1737
|
+
experiences = de({ client: this });
|
|
1738
|
+
frameworks = Ce({ client: this });
|
|
1739
|
+
predicates = He({ client: this });
|
|
1740
|
+
features = qe({ client: this });
|
|
1741
|
+
conditions = Dt();
|
|
1742
|
+
fields = nt();
|
|
1743
|
+
responses = wt({ client: this });
|
|
1744
|
+
steps = at();
|
|
1745
|
+
contents = lt();
|
|
1746
|
+
actions = pt({ client: this });
|
|
1708
1747
|
conditionResults = C();
|
|
1709
|
-
stateSnapshotStore =
|
|
1710
|
-
evaluateRuleLogicFx =
|
|
1748
|
+
stateSnapshotStore = Ee({ client: this });
|
|
1749
|
+
evaluateRuleLogicFx = Pe({ client: this });
|
|
1711
1750
|
start;
|
|
1712
1751
|
readyStore;
|
|
1713
1752
|
preconditionPassedStore;
|
|
1714
1753
|
conditionPassedStore;
|
|
1715
1754
|
lifecycleStageStore;
|
|
1716
|
-
lifecycle =
|
|
1755
|
+
lifecycle = ze({ client: this });
|
|
1717
1756
|
renderStringFx = k({
|
|
1718
1757
|
source: this.responses.listStore,
|
|
1719
1758
|
effect: (e, { template: t, context: n }) => {
|
|
1720
1759
|
let r = {};
|
|
1721
1760
|
for (let t of e) r[t.fieldKey] = t.value;
|
|
1722
|
-
return
|
|
1761
|
+
return Ut(t, {
|
|
1723
1762
|
...n,
|
|
1724
1763
|
responses: r
|
|
1725
1764
|
});
|
|
1726
1765
|
}
|
|
1727
1766
|
});
|
|
1728
1767
|
constructor(e) {
|
|
1729
|
-
this.events =
|
|
1768
|
+
this.events = $e(this.eventBus), this.projectId = Rt(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.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
|
|
1730
1769
|
type: "load",
|
|
1731
1770
|
version: ne()
|
|
1732
1771
|
}), this.maybeStartPreviewChannel();
|
|
@@ -1734,7 +1773,7 @@ var Ut = class {
|
|
|
1734
1773
|
dataProviderFor(e) {
|
|
1735
1774
|
let t = e ?? "", n = this.dataProviders.get(t);
|
|
1736
1775
|
if (n) return n;
|
|
1737
|
-
let r = import("../provider-
|
|
1776
|
+
let r = import("../provider-DnRTKPsK.js").then((t) => t.createPickedDataProvider({
|
|
1738
1777
|
apiUrl: this.apiUrl,
|
|
1739
1778
|
projectId: this.projectId,
|
|
1740
1779
|
...e !== void 0 && { previewToken: e }
|
|
@@ -1750,24 +1789,24 @@ var Ut = class {
|
|
|
1750
1789
|
return (await this.dataProviderFor(t?.previewToken)).getContent(e, t?.signal === void 0 ? void 0 : { signal: t.signal });
|
|
1751
1790
|
}
|
|
1752
1791
|
maybeStartPreviewChannel() {
|
|
1753
|
-
|
|
1792
|
+
Gt() && import("../preview-channel-CSr96XAo.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
|
|
1754
1793
|
}
|
|
1755
1794
|
registerFramework = (e) => {
|
|
1756
|
-
|
|
1795
|
+
we(e, this.frameworks);
|
|
1757
1796
|
};
|
|
1758
1797
|
registerComponent = (e, t) => {
|
|
1759
|
-
|
|
1798
|
+
be(e, t, this.components);
|
|
1760
1799
|
};
|
|
1761
1800
|
registerPlugin = (e) => {
|
|
1762
|
-
|
|
1801
|
+
me(this, e, this.plugins);
|
|
1763
1802
|
let t = this.plugins[e.name];
|
|
1764
1803
|
t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
|
|
1765
1804
|
};
|
|
1766
1805
|
registerFeature = (e, t) => {
|
|
1767
|
-
|
|
1806
|
+
Je(e, t, this.features);
|
|
1768
1807
|
};
|
|
1769
1808
|
registerPredicate = (e, t) => {
|
|
1770
|
-
|
|
1809
|
+
Ue(e, t, this.predicates);
|
|
1771
1810
|
};
|
|
1772
1811
|
registerCondition = (e) => {
|
|
1773
1812
|
this.conditions.register(e);
|
|
@@ -1776,19 +1815,19 @@ var Ut = class {
|
|
|
1776
1815
|
this.fields.register(e);
|
|
1777
1816
|
};
|
|
1778
1817
|
registerStep = (e) => {
|
|
1779
|
-
|
|
1818
|
+
ot(e, this.steps);
|
|
1780
1819
|
};
|
|
1781
1820
|
registerContent = (e) => {
|
|
1782
|
-
|
|
1821
|
+
ut(e, this.contents);
|
|
1783
1822
|
};
|
|
1784
1823
|
patchContent = (e, t) => {
|
|
1785
1824
|
this.contents.patch(e, t);
|
|
1786
1825
|
};
|
|
1787
1826
|
registerAction = (e, t) => {
|
|
1788
|
-
|
|
1827
|
+
mt(e, t, this.actions);
|
|
1789
1828
|
};
|
|
1790
1829
|
registerExperience = (e) => {
|
|
1791
|
-
e.component &&
|
|
1830
|
+
e.component && be(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
|
|
1792
1831
|
};
|
|
1793
1832
|
launchExperienceById = async (e, t) => {
|
|
1794
1833
|
this.experiences.launch({
|
|
@@ -1833,7 +1872,7 @@ var Ut = class {
|
|
|
1833
1872
|
try {
|
|
1834
1873
|
let [t, n] = e.split(":");
|
|
1835
1874
|
if (!t || !n) return;
|
|
1836
|
-
let r =
|
|
1875
|
+
let r = Ge(n);
|
|
1837
1876
|
this.registerFeature(t, {
|
|
1838
1877
|
key: `${r}`,
|
|
1839
1878
|
name: t,
|
|
@@ -1870,8 +1909,8 @@ var Ut = class {
|
|
|
1870
1909
|
});
|
|
1871
1910
|
}
|
|
1872
1911
|
getPluginConfig = (e) => this.plugins[e] ?? {};
|
|
1873
|
-
},
|
|
1874
|
-
async function
|
|
1912
|
+
}, qt = "application/picked-javascript", Jt = "application/picked-module", Yt = "data-picked-hydrated";
|
|
1913
|
+
async function Xt(e) {
|
|
1875
1914
|
if (!("document" in globalThis)) return;
|
|
1876
1915
|
let t = "application/picked-module", n = "data-picked-hydrated";
|
|
1877
1916
|
function r(e) {
|
|
@@ -1900,30 +1939,64 @@ async function qt(e) {
|
|
|
1900
1939
|
a && await a;
|
|
1901
1940
|
}
|
|
1902
1941
|
}
|
|
1903
|
-
function
|
|
1904
|
-
return `<script>(${
|
|
1942
|
+
function Zt() {
|
|
1943
|
+
return `<script>(${Xt.toString()})(document)<\/script>`;
|
|
1905
1944
|
}
|
|
1906
1945
|
//#endregion
|
|
1907
1946
|
//#region src/utils/html-asset-value.ts
|
|
1908
|
-
function
|
|
1947
|
+
function Qt(e) {
|
|
1909
1948
|
return typeof e == "object" && !!e && "id" in e && typeof e.id == "string" && "content" in e && (typeof e.content == "string" || e.content === null);
|
|
1910
1949
|
}
|
|
1911
1950
|
//#endregion
|
|
1912
1951
|
//#region src/entities/component/lazyComponent.ts
|
|
1913
|
-
function
|
|
1952
|
+
function $t(e) {
|
|
1914
1953
|
return {
|
|
1915
1954
|
$$type: "lazy-component",
|
|
1916
1955
|
load: e
|
|
1917
1956
|
};
|
|
1918
1957
|
}
|
|
1919
|
-
function
|
|
1958
|
+
function en(e) {
|
|
1920
1959
|
return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
|
|
1921
1960
|
}
|
|
1922
1961
|
//#endregion
|
|
1962
|
+
//#region src/entities/content/reference.ts
|
|
1963
|
+
function Q(e) {
|
|
1964
|
+
return typeof e == "object" && !!e && !Array.isArray(e) && "contentEntryId" in e && typeof e.contentEntryId == "string";
|
|
1965
|
+
}
|
|
1966
|
+
function $(e) {
|
|
1967
|
+
return Q(e) ? e.contentEntryId : null;
|
|
1968
|
+
}
|
|
1969
|
+
function tn(e) {
|
|
1970
|
+
let t = Array.isArray(e) ? e : [e], n = [];
|
|
1971
|
+
for (let e of t) Q(e) && n.push(e.contentEntryId);
|
|
1972
|
+
return n;
|
|
1973
|
+
}
|
|
1974
|
+
function nn(e, t) {
|
|
1975
|
+
return t === null ? null : e[t] ?? null;
|
|
1976
|
+
}
|
|
1977
|
+
function rn(e, t) {
|
|
1978
|
+
let n = [];
|
|
1979
|
+
for (let r of t) {
|
|
1980
|
+
let t = e[r];
|
|
1981
|
+
t !== void 0 && n.push(t);
|
|
1982
|
+
}
|
|
1983
|
+
return n;
|
|
1984
|
+
}
|
|
1985
|
+
function an(e, t) {
|
|
1986
|
+
if (se.store(t)) return A(t, e.indexStore, (e, t) => nn(t, $(e)));
|
|
1987
|
+
let n = $(t);
|
|
1988
|
+
return e.indexStore.map((e) => nn(e, n), { skipVoid: !1 });
|
|
1989
|
+
}
|
|
1990
|
+
function on(e, t) {
|
|
1991
|
+
if (se.store(t)) return A(t, e.indexStore, (e, t) => rn(t, tn(e)));
|
|
1992
|
+
let n = tn(t);
|
|
1993
|
+
return e.indexStore.map((e) => rn(e, n), { skipVoid: !1 });
|
|
1994
|
+
}
|
|
1995
|
+
//#endregion
|
|
1923
1996
|
//#region src/exports.ts
|
|
1924
|
-
var
|
|
1925
|
-
let t = new
|
|
1997
|
+
var sn = (e) => {
|
|
1998
|
+
let t = new Kt(e);
|
|
1926
1999
|
return u(t), t;
|
|
1927
2000
|
};
|
|
1928
2001
|
//#endregion
|
|
1929
|
-
export {
|
|
2002
|
+
export { Yt as PICKED_HYDRATED_ATTR, Jt as PICKED_MODULE_SCRIPT_TYPE, qt as PICKED_SCRIPT_TYPE, Wt as PREVIEW_TOKEN_PARAM, Kt as Picked, Zt as buildRehydrateBootstrap, sn as createClient, pe as createPluginEffect, O as createStorageKey, an as deriveReference, on as deriveReferences, n as evaluateRuleLogic, Ft as getPickedConfig, Q as isContentReference, Qt as isHtmlAssetValue, h as isInsideIframe, en as isLazyLoader, _ as isPickedRoot, Gt as isPreviewSession, $t as lazyComponent, E as localStore, oe as onInertScriptSubtrees, $ as readReferenceId, tn as readReferenceIds, Xt 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 };
|