@picked/client 0.0.1-dev.1777513622441 → 0.0.1-dev.1777530309364
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{api-DlDrrct4.js → api-Axu2IRHZ.js} +1 -1
- package/dist/{api-DJvKbj_l.cjs → api-D0-Cl9bN.cjs} +1 -1
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/{actions.mdx → actions.md} +0 -7
- package/dist/docs/{api-keys.mdx → api-keys.md} +0 -7
- package/dist/docs/{conditions.mdx → conditions.md} +0 -7
- package/dist/docs/{experiences.mdx → experiences.md} +0 -7
- package/dist/docs/{features.mdx → features.md} +0 -7
- package/dist/docs/{fields.mdx → fields.md} +0 -7
- package/dist/docs/flow-builder/{overview.mdx → overview.md} +0 -7
- package/dist/docs/pickedql/data-sources.md +2 -49
- package/dist/docs/pickedql/dimensions.md +0 -20
- package/dist/docs/pickedql/examples.md +1 -1
- package/dist/docs/pickedql/filtering.md +0 -22
- package/dist/docs/pickedql/index.md +1 -2
- package/dist/docs/pickedql/schema.md +1 -34
- package/dist/docs/pickedql/virtual-functions.md +4 -4
- package/dist/docs/{projects.mdx → projects.md} +0 -7
- package/dist/docs/{reports.mdx → reports.md} +0 -7
- package/dist/docs/{steps.mdx → steps.md} +0 -7
- package/dist/docs/{workspaces.mdx → workspaces.md} +0 -8
- package/dist/esm/form/index.js +6 -21
- package/dist/esm/index.js +169 -295
- package/dist/esm/plugins/create-experience/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/plugins/experience-browser-storage/index.js +19 -21
- package/dist/esm/plugins/history-browser-storage/index.js +15 -17
- package/dist/esm/plugins/responses-browser-storage/index.js +19 -21
- package/dist/esm/plugins/responses-indexeddb/index.js +35 -37
- package/dist/esm/plugins/single-page-app/index.js +28 -14
- package/dist/esm/plugins/web-components/index.js +1 -1
- package/dist/esm/plugins/window-object/index.js +1 -1
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-CNIhapU2.js +136 -0
- package/dist/experience-CTEBY-it.cjs +1 -0
- package/dist/experience-instance-B0tFPMAU.js +396 -0
- package/dist/experience-instance-BN0RZG1b.cjs +1 -0
- package/dist/nodes-2fst8XKi.js +101 -0
- package/dist/nodes-DBK4N9YY.cjs +1 -0
- package/dist/rules-logic-D7dL30U1.js +263 -0
- package/dist/rules-logic-DJhGFqhC.cjs +1 -0
- package/dist/types/entities/action/action.d.ts +4 -30
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -4
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +2 -0
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/response/response-validation.d.ts +17 -17
- package/dist/types/entities/response/response-validation.d.ts.map +1 -1
- package/dist/types/form/create-field-evaluator.d.ts.map +1 -1
- package/dist/types/form/create-submit-pipeline.d.ts.map +1 -1
- package/dist/types/picked.d.ts +1 -3
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts +15 -4
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/experience-instance-DC2gKwA6.cjs +0 -1
- package/dist/experience-instance-DJaNc5Ob.js +0 -486
- package/dist/object-C82v79xc.js +0 -25
- package/dist/object-CUJOjanb.cjs +0 -1
- package/dist/rules-logic-BTIxfrJJ.js +0 -240
- package/dist/rules-logic-DNLOv90w.cjs +0 -1
- /package/dist/{id-Bv44ilEo.cjs → id-Cg7fVl1O.cjs} +0 -0
- /package/dist/{id-CRqy981z.js → id-n2yrHvNo.js} +0 -0
- /package/dist/{logger-6z_gb4rA.js → logger-C44jSdYl.js} +0 -0
- /package/dist/{logger-fbvQC40v.cjs → logger-CJUj90QX.cjs} +0 -0
- /package/dist/{supports-0XIfd4-R.js → supports-B_trw6lj.js} +0 -0
- /package/dist/{supports-Dsjg-82e.cjs → supports-CKSVYpQx.cjs} +0 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
//#region src/logic-engine.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return typeof e == "number" && !isNaN(e);
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return typeof e == "string";
|
|
7
|
+
}
|
|
8
|
+
function n(e) {
|
|
9
|
+
return Array.isArray(e);
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
return e instanceof Promise;
|
|
13
|
+
}
|
|
14
|
+
function i(e) {
|
|
15
|
+
return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
|
|
16
|
+
}
|
|
17
|
+
function a(t) {
|
|
18
|
+
if (e(t)) return t;
|
|
19
|
+
let n = parseFloat(`${t}`);
|
|
20
|
+
return isNaN(n) ? 0 : n;
|
|
21
|
+
}
|
|
22
|
+
function o(e) {
|
|
23
|
+
return `${e}`;
|
|
24
|
+
}
|
|
25
|
+
var s = {
|
|
26
|
+
"==": (e, t) => e == t,
|
|
27
|
+
"===": (e, t) => e === t,
|
|
28
|
+
"!=": (e, t) => e != t,
|
|
29
|
+
"!==": (e, t) => e !== t,
|
|
30
|
+
">": (e, t) => a(e) > a(t),
|
|
31
|
+
">=": (e, t) => a(e) >= a(t),
|
|
32
|
+
"<": (e, t, n) => {
|
|
33
|
+
let r = a(e), i = a(t);
|
|
34
|
+
if (n === void 0) return r < i;
|
|
35
|
+
let o = a(n);
|
|
36
|
+
return r < i && i < o;
|
|
37
|
+
},
|
|
38
|
+
"<=": (e, t, n) => {
|
|
39
|
+
let r = a(e), i = a(t);
|
|
40
|
+
if (n === void 0) return r <= i;
|
|
41
|
+
let o = a(n);
|
|
42
|
+
return r <= i && i <= o;
|
|
43
|
+
},
|
|
44
|
+
"!!": async (e) => await l(e),
|
|
45
|
+
"!": async (e) => !await l(e),
|
|
46
|
+
"%": (e, t) => a(e) % a(t),
|
|
47
|
+
log: (e) => (console.log(e), e),
|
|
48
|
+
in: (e, r) => r ? t(r) ? r.indexOf(o(e)) !== -1 : n(r) ? r.includes(e) : !1 : !1,
|
|
49
|
+
cat: (...e) => e.map(o).join(""),
|
|
50
|
+
substr: (e, t, n) => {
|
|
51
|
+
let r = o(e), i = a(t);
|
|
52
|
+
if (n === void 0) return r.substr(i);
|
|
53
|
+
let s = a(n);
|
|
54
|
+
if (s < 0) {
|
|
55
|
+
let e = r.substr(i);
|
|
56
|
+
return e.substr(0, e.length + s);
|
|
57
|
+
}
|
|
58
|
+
return r.substr(i, s);
|
|
59
|
+
},
|
|
60
|
+
"+": (...e) => e.reduce((e, t) => a(e) + a(t), 0),
|
|
61
|
+
"*": (...e) => e.reduce((e, t) => a(e) * a(t), 1),
|
|
62
|
+
"-": (e, t) => {
|
|
63
|
+
let n = a(e);
|
|
64
|
+
return t === void 0 ? -n : n - a(t);
|
|
65
|
+
},
|
|
66
|
+
"/": (e, t) => a(e) / a(t),
|
|
67
|
+
min: (...e) => Math.min(...e.map(a)),
|
|
68
|
+
max: (...e) => Math.max(...e.map(a)),
|
|
69
|
+
merge: (...e) => e.reduce((e, t) => n(t) ? e.concat(t) : e.concat([t]), []),
|
|
70
|
+
var(e, t) {
|
|
71
|
+
let n = arguments.length > 1 ? t : null;
|
|
72
|
+
if (e === "" || e === "." || e == null) return this;
|
|
73
|
+
if (typeof e == "number" && Array.isArray(this)) return e >= 0 && e < this.length ? this[e] : n;
|
|
74
|
+
let r = o(e);
|
|
75
|
+
if (r === "" || r === ".") return this;
|
|
76
|
+
let i = r.split("."), a = this;
|
|
77
|
+
for (let e of i) {
|
|
78
|
+
if (a == null) return n;
|
|
79
|
+
if (Array.isArray(a)) {
|
|
80
|
+
let t = parseInt(e, 10);
|
|
81
|
+
a = isNaN(t) ? a[e] : a[t];
|
|
82
|
+
} else a = a[e];
|
|
83
|
+
}
|
|
84
|
+
return a === void 0 ? n : a;
|
|
85
|
+
},
|
|
86
|
+
async missing(...e) {
|
|
87
|
+
let t = n(e[0]) ? e[0] : e, r = [];
|
|
88
|
+
for (let e of t) {
|
|
89
|
+
let t = await c({ var: e }, this);
|
|
90
|
+
(t === null || t === "") && r.push(`${e}`);
|
|
91
|
+
}
|
|
92
|
+
return r;
|
|
93
|
+
},
|
|
94
|
+
async missing_some(e, r) {
|
|
95
|
+
let i = await c({ missing: r }, this);
|
|
96
|
+
if (!n(i) || !n(r)) return [];
|
|
97
|
+
let o = i.filter(t);
|
|
98
|
+
return r.filter(t).length - o.length >= a(e) ? [] : o;
|
|
99
|
+
},
|
|
100
|
+
invoke(...e) {
|
|
101
|
+
let [t, ...n] = e;
|
|
102
|
+
return typeof t == "function" ? Reflect.apply(t, null, n) : null;
|
|
103
|
+
},
|
|
104
|
+
startsWith: (e, n) => t(e) && t(n) && e.startsWith(n),
|
|
105
|
+
endsWith: (e, n) => t(e) && t(n) && e.endsWith(n),
|
|
106
|
+
regexp_matches(e, r) {
|
|
107
|
+
let i = e, a = "";
|
|
108
|
+
if (n(e)) {
|
|
109
|
+
let [t, n] = e;
|
|
110
|
+
i = t, a = n;
|
|
111
|
+
}
|
|
112
|
+
return !t(i) || !t(a) ? !1 : new RegExp(i, a).test(o(r));
|
|
113
|
+
},
|
|
114
|
+
throw(e) {
|
|
115
|
+
throw Error(o(e));
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
async function c(e, t) {
|
|
119
|
+
if (!e) return e;
|
|
120
|
+
if (r(e)) return c(await e, t);
|
|
121
|
+
if (n(e)) return Promise.all(e.map((e) => c(e, t)));
|
|
122
|
+
if (!i(e)) return e;
|
|
123
|
+
let a = u(e), o = a ? e[a] ?? [] : [];
|
|
124
|
+
switch (n(o) || (o = [o]), a) {
|
|
125
|
+
case "if":
|
|
126
|
+
case "?:":
|
|
127
|
+
for (let e = 0; e < o.length - 1; e += 2) if (await l(await c(o[e], t))) return c(o[e + 1], t);
|
|
128
|
+
return o.length % 2 == 1 ? c(o[o.length - 1], t) : null;
|
|
129
|
+
case "and": {
|
|
130
|
+
let e = null;
|
|
131
|
+
for (let n of o) if (e = await c(n, t), !await l(e)) return e;
|
|
132
|
+
return e;
|
|
133
|
+
}
|
|
134
|
+
case "or": {
|
|
135
|
+
let e = null;
|
|
136
|
+
for (let n of o) if (e = await c(n, t), await l(e)) return e;
|
|
137
|
+
return e;
|
|
138
|
+
}
|
|
139
|
+
case "map": {
|
|
140
|
+
let e = await c(o[0], t);
|
|
141
|
+
return n(e) ? await Promise.all(e.map((e) => c(o[1], e))) : [];
|
|
142
|
+
}
|
|
143
|
+
case "filter": {
|
|
144
|
+
let e = await c(o[0], t);
|
|
145
|
+
return n(e) ? (await Promise.all(e.map(async (e) => ({
|
|
146
|
+
item: e,
|
|
147
|
+
shouldInclude: await l(await c(o[1], e))
|
|
148
|
+
})))).filter(({ shouldInclude: e }) => e).map(({ item: e }) => e) : [];
|
|
149
|
+
}
|
|
150
|
+
case "reduce": {
|
|
151
|
+
let e = await c(o[0], t);
|
|
152
|
+
if (!n(e)) return o.length > 2 ? await c(o[2], t) : null;
|
|
153
|
+
let r = o[1], i = o.length > 2 ? await c(o[2], t) : null;
|
|
154
|
+
for (let t of e) i = await c(r, {
|
|
155
|
+
current: t,
|
|
156
|
+
accumulator: i
|
|
157
|
+
});
|
|
158
|
+
return i;
|
|
159
|
+
}
|
|
160
|
+
case "all": {
|
|
161
|
+
let e = await c(o[0], t);
|
|
162
|
+
if (!n(e) || e.length === 0) return !1;
|
|
163
|
+
for (let t of e) if (!await l(await c(o[1], t))) return !1;
|
|
164
|
+
return !0;
|
|
165
|
+
}
|
|
166
|
+
case "some": {
|
|
167
|
+
let e = await c(o[0], t);
|
|
168
|
+
if (!n(e)) return !1;
|
|
169
|
+
for (let t of e) if (await l(await c(o[1], t))) return !0;
|
|
170
|
+
return !1;
|
|
171
|
+
}
|
|
172
|
+
case "none": {
|
|
173
|
+
let e = await c(o[0], t);
|
|
174
|
+
if (!n(e)) return !0;
|
|
175
|
+
for (let t of e) if (await l(await c(o[1], t))) return !1;
|
|
176
|
+
return !0;
|
|
177
|
+
}
|
|
178
|
+
case "catch": try {
|
|
179
|
+
return await c(o[0], t);
|
|
180
|
+
} catch (e) {
|
|
181
|
+
return i(e) ? await c(e, t) : o[1] ? await c(o[1], e) : e instanceof Error ? e.message : e;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
let d = await Promise.all(o.map((e) => c(e, t))), f = a ? s[a] : void 0;
|
|
185
|
+
if (!f) throw Error(`Unrecognized operation ${a}`);
|
|
186
|
+
return f.apply(t, d);
|
|
187
|
+
}
|
|
188
|
+
async function l(e) {
|
|
189
|
+
return r(e) ? l(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
|
|
190
|
+
}
|
|
191
|
+
function u(e) {
|
|
192
|
+
return Object.keys(e)[0];
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/utils/object.ts
|
|
196
|
+
function d(e, t, n) {
|
|
197
|
+
if (!(t in e)) return;
|
|
198
|
+
let r = e[t];
|
|
199
|
+
if (typeof r != "function") throw Error(`Expected '${String(t)}' to be a function`);
|
|
200
|
+
let i = n(r);
|
|
201
|
+
p(i, r), e[t] = i;
|
|
202
|
+
}
|
|
203
|
+
function f(e, t, n) {
|
|
204
|
+
Object.defineProperty(e, t, {
|
|
205
|
+
enumerable: !1,
|
|
206
|
+
value: n,
|
|
207
|
+
writable: !0,
|
|
208
|
+
configurable: !0
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function p(e, t) {
|
|
212
|
+
let n = t.prototype || {};
|
|
213
|
+
t.prototype = n, e.prototype = n, f(e, "__picked_original", t);
|
|
214
|
+
}
|
|
215
|
+
function m(e) {
|
|
216
|
+
return e === void 0 || typeof e == "object" && !!e && e.constructor === Object && Object.keys(e).length === 0;
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/utils/rules-logic.ts
|
|
220
|
+
function h(e) {
|
|
221
|
+
return !m(e);
|
|
222
|
+
}
|
|
223
|
+
async function g(e, t, n) {
|
|
224
|
+
let r = e.getStateSnapshot(), i = e.predicates.listStore.getState().reduce((e, t) => ({
|
|
225
|
+
...e,
|
|
226
|
+
[t.name]: (...e) => t.predicate({
|
|
227
|
+
...r,
|
|
228
|
+
args: e
|
|
229
|
+
})
|
|
230
|
+
}), {}), a = e.actions.listStore.getState().reduce((e, t) => ({
|
|
231
|
+
...e,
|
|
232
|
+
[t.key]: (...e) => t.action({
|
|
233
|
+
...r,
|
|
234
|
+
args: e
|
|
235
|
+
})
|
|
236
|
+
}), {}), o = e.features.listStore.getState().reduce((e, t) => ({
|
|
237
|
+
...e,
|
|
238
|
+
[t.id]: async () => {
|
|
239
|
+
let { bucket: e } = await t.getBucket();
|
|
240
|
+
return e;
|
|
241
|
+
}
|
|
242
|
+
}), {});
|
|
243
|
+
return await c(t, {
|
|
244
|
+
responses: e.responses.getAllStore.getState(),
|
|
245
|
+
location: typeof r.location == "object" ? {
|
|
246
|
+
hash: r.location.hash,
|
|
247
|
+
host: r.location.host,
|
|
248
|
+
hostname: r.location.hostname,
|
|
249
|
+
href: r.location.href,
|
|
250
|
+
origin: r.location.origin,
|
|
251
|
+
pathname: r.location.pathname,
|
|
252
|
+
port: r.location.port,
|
|
253
|
+
protocol: r.location.protocol,
|
|
254
|
+
search: r.location.search
|
|
255
|
+
} : void 0,
|
|
256
|
+
predicates: i,
|
|
257
|
+
actions: a,
|
|
258
|
+
features: o,
|
|
259
|
+
...n
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
export { d as i, h as n, m as r, g as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return typeof e==`number`&&!isNaN(e)}function t(e){return typeof e==`string`}function n(e){return Array.isArray(e)}function r(e){return e instanceof Promise}function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).length===1}function a(t){if(e(t))return t;let n=parseFloat(`${t}`);return isNaN(n)?0:n}function o(e){return`${e}`}var s={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>a(e)>a(t),">=":(e,t)=>a(e)>=a(t),"<":(e,t,n)=>{let r=a(e),i=a(t);if(n===void 0)return r<i;let o=a(n);return r<i&&i<o},"<=":(e,t,n)=>{let r=a(e),i=a(t);if(n===void 0)return r<=i;let o=a(n);return r<=i&&i<=o},"!!":async e=>await l(e),"!":async e=>!await l(e),"%":(e,t)=>a(e)%a(t),log:e=>(console.log(e),e),in:(e,r)=>r?t(r)?r.indexOf(o(e))!==-1:n(r)?r.includes(e):!1:!1,cat:(...e)=>e.map(o).join(``),substr:(e,t,n)=>{let r=o(e),i=a(t);if(n===void 0)return r.substr(i);let s=a(n);if(s<0){let e=r.substr(i);return e.substr(0,e.length+s)}return r.substr(i,s)},"+":(...e)=>e.reduce((e,t)=>a(e)+a(t),0),"*":(...e)=>e.reduce((e,t)=>a(e)*a(t),1),"-":(e,t)=>{let n=a(e);return t===void 0?-n:n-a(t)},"/":(e,t)=>a(e)/a(t),min:(...e)=>Math.min(...e.map(a)),max:(...e)=>Math.max(...e.map(a)),merge:(...e)=>e.reduce((e,t)=>n(t)?e.concat(t):e.concat([t]),[]),var(e,t){let n=arguments.length>1?t:null;if(e===``||e===`.`||e==null)return this;if(typeof e==`number`&&Array.isArray(this))return e>=0&&e<this.length?this[e]:n;let r=o(e);if(r===``||r===`.`)return this;let i=r.split(`.`),a=this;for(let e of i){if(a==null)return n;if(Array.isArray(a)){let t=parseInt(e,10);a=isNaN(t)?a[e]:a[t]}else a=a[e]}return a===void 0?n:a},async missing(...e){let t=n(e[0])?e[0]:e,r=[];for(let e of t){let t=await c({var:e},this);(t===null||t===``)&&r.push(`${e}`)}return r},async missing_some(e,r){let i=await c({missing:r},this);if(!n(i)||!n(r))return[];let o=i.filter(t);return r.filter(t).length-o.length>=a(e)?[]:o},invoke(...e){let[t,...n]=e;return typeof t==`function`?Reflect.apply(t,null,n):null},startsWith:(e,n)=>t(e)&&t(n)&&e.startsWith(n),endsWith:(e,n)=>t(e)&&t(n)&&e.endsWith(n),regexp_matches(e,r){let i=e,a=``;if(n(e)){let[t,n]=e;i=t,a=n}return!t(i)||!t(a)?!1:new RegExp(i,a).test(o(r))},throw(e){throw Error(o(e))}};async function c(e,t){if(!e)return e;if(r(e))return c(await e,t);if(n(e))return Promise.all(e.map(e=>c(e,t)));if(!i(e))return e;let a=u(e),o=a?e[a]??[]:[];switch(n(o)||(o=[o]),a){case`if`:case`?:`:for(let e=0;e<o.length-1;e+=2)if(await l(await c(o[e],t)))return c(o[e+1],t);return o.length%2==1?c(o[o.length-1],t):null;case`and`:{let e=null;for(let n of o)if(e=await c(n,t),!await l(e))return e;return e}case`or`:{let e=null;for(let n of o)if(e=await c(n,t),await l(e))return e;return e}case`map`:{let e=await c(o[0],t);return n(e)?await Promise.all(e.map(e=>c(o[1],e))):[]}case`filter`:{let e=await c(o[0],t);return n(e)?(await Promise.all(e.map(async e=>({item:e,shouldInclude:await l(await c(o[1],e))})))).filter(({shouldInclude:e})=>e).map(({item:e})=>e):[]}case`reduce`:{let e=await c(o[0],t);if(!n(e))return o.length>2?await c(o[2],t):null;let r=o[1],i=o.length>2?await c(o[2],t):null;for(let t of e)i=await c(r,{current:t,accumulator:i});return i}case`all`:{let e=await c(o[0],t);if(!n(e)||e.length===0)return!1;for(let t of e)if(!await l(await c(o[1],t)))return!1;return!0}case`some`:{let e=await c(o[0],t);if(!n(e))return!1;for(let t of e)if(await l(await c(o[1],t)))return!0;return!1}case`none`:{let e=await c(o[0],t);if(!n(e))return!0;for(let t of e)if(await l(await c(o[1],t)))return!1;return!0}case`catch`:try{return await c(o[0],t)}catch(e){return i(e)?await c(e,t):o[1]?await c(o[1],e):e instanceof Error?e.message:e}}let d=await Promise.all(o.map(e=>c(e,t))),f=a?s[a]:void 0;if(!f)throw Error(`Unrecognized operation ${a}`);return f.apply(t,d)}async function l(e){return r(e)?l(await e):!(Array.isArray(e)&&e.length===0)&&!!e}function u(e){return Object.keys(e)[0]}function d(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)throw Error(`Expected '${String(t)}' to be a function`);let i=n(r);p(i,r),e[t]=i}function f(e,t,n){Object.defineProperty(e,t,{enumerable:!1,value:n,writable:!0,configurable:!0})}function p(e,t){let n=t.prototype||{};t.prototype=n,e.prototype=n,f(e,`__picked_original`,t)}function m(e){return e===void 0||typeof e==`object`&&!!e&&e.constructor===Object&&Object.keys(e).length===0}function h(e){return!m(e)}async function g(e,t,n){let r=e.getStateSnapshot(),i=e.predicates.listStore.getState().reduce((e,t)=>({...e,[t.name]:(...e)=>t.predicate({...r,args:e})}),{}),a=e.actions.listStore.getState().reduce((e,t)=>({...e,[t.key]:(...e)=>t.action({...r,args:e})}),{}),o=e.features.listStore.getState().reduce((e,t)=>({...e,[t.id]:async()=>{let{bucket:e}=await t.getBucket();return e}}),{});return await c(t,{responses:e.responses.getAllStore.getState(),location:typeof r.location==`object`?{hash:r.location.hash,host:r.location.host,hostname:r.location.hostname,href:r.location.href,origin:r.location.origin,pathname:r.location.pathname,port:r.location.port,protocol:r.location.protocol,search:r.location.search}:void 0,predicates:i,actions:a,features:o,...n})}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
|
|
@@ -1,37 +1,13 @@
|
|
|
1
1
|
import { Store } from 'effector';
|
|
2
2
|
import { StateSnapshot } from '../../utils/state-snaphot';
|
|
3
3
|
import { Picked } from '../../picked';
|
|
4
|
-
import { ExperienceInstance } from '../experience-instance/experience-instance';
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export interface ActionContext {
|
|
10
|
-
/** The experience instance whose ActionNode triggered this action. */
|
|
11
|
-
experience: ExperienceInstance;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* A named callable function that receives a state snapshot, action args, and a context.
|
|
15
|
-
*
|
|
16
|
-
* `context` is an {@link ActionContext} only when the action is executed as an
|
|
17
|
-
* ActionNode in an experience flow. It is `null` for every other invocation path,
|
|
18
|
-
* including `getEvokableAction` and actions referenced from rule logic (condition
|
|
19
|
-
* rules, `initializeOpenLogic`, launch decisions, feature gates, field
|
|
20
|
-
* validation/visibility). Rule-logic paths evaluate the action against a snapshot
|
|
21
|
-
* only and have no triggering instance.
|
|
22
|
-
*
|
|
23
|
-
* Re-entrancy: do not synchronously call navigation events (`goToNextStep`,
|
|
24
|
-
* `goToPreviousStep`, `goToStepById`) or open-state events (`open`, `close`,
|
|
25
|
-
* `toggleOpen`, `setOpen`) on `context.experience` before the handler's returned
|
|
26
|
-
* promise resolves. Those writes race the flow runtime's post-action history
|
|
27
|
-
* push and produce non-deterministic ordering. Perform control flow after your
|
|
28
|
-
* side effect resolves.
|
|
29
|
-
*
|
|
30
|
-
* Returns a value (boolean, string, string[]) or runs a side effect (void).
|
|
5
|
+
* A named callable function that receives a state snapshot and optional arguments.
|
|
6
|
+
* Actions can return values (boolean, string, string[]) or execute side effects (void).
|
|
31
7
|
*/
|
|
32
8
|
export type Action = (snapshot: StateSnapshot & {
|
|
33
9
|
args: unknown[];
|
|
34
|
-
}
|
|
10
|
+
}) => boolean | Promise<boolean> | string | Promise<string> | string[] | Promise<string[]> | void | Promise<void> | undefined;
|
|
35
11
|
export type ActionsStore = ReturnType<typeof createActionIndexFactory>;
|
|
36
12
|
export interface ActionIndexItem {
|
|
37
13
|
key: string;
|
|
@@ -43,9 +19,7 @@ declare const createActionIndexFactory: ({ client }: {
|
|
|
43
19
|
register: (key: string, action: Action) => void;
|
|
44
20
|
getByKey: (key: string) => Store<Action | undefined>;
|
|
45
21
|
listStore: Store<ActionIndexItem[]>;
|
|
46
|
-
getEvokableAction: (actionKey: string
|
|
47
|
-
experience: ExperienceInstance;
|
|
48
|
-
}) => Store<() => ReturnType<Action>>;
|
|
22
|
+
getEvokableAction: (actionKey: string) => Store<() => ReturnType<Action>>;
|
|
49
23
|
};
|
|
50
24
|
/**
|
|
51
25
|
* Creates an action index with lifecycle stores and registration logic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/entities/action/action.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAA8D,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAGjG,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/entities/action/action.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAA8D,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAGjG,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,CACnB,QAAQ,EAAE,aAAa,GAAG;IAAE,IAAI,EAAE,OAAO,EAAE,CAAA;CAAE,KAE3C,OAAO,GACP,OAAO,CAAC,OAAO,CAAC,GAChB,MAAM,GACN,OAAO,CAAC,MAAM,CAAC,GACf,MAAM,EAAE,GACR,OAAO,CAAC,MAAM,EAAE,CAAC,GACjB,IAAI,GACJ,OAAO,CAAC,IAAI,CAAC,GACb,SAAS,CAAA;AAEb,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEtE,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;CACf;AAKD,QAAA,MAAM,wBAAwB,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;oBA2BrD,MAAM,UAAU,MAAM,KAAG,IAAI;oBA2B7B,MAAM;;mCAiBS,MAAM,KAAG,KAAK,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;CAuC9E,CAAA;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,EACxF,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAE7C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,EAAE,SAAS,YAAY,KAAG,IAEhF,CAAA"}
|
|
@@ -42,8 +42,7 @@ declare const createExperienceInstanceFactory: ({ client, experience, target, op
|
|
|
42
42
|
/**
|
|
43
43
|
* Creates an experience instance with lifecycle stores and navigation logic.
|
|
44
44
|
*
|
|
45
|
-
* @param
|
|
46
|
-
* @returns {ExperienceInstance} The created experience instance.
|
|
45
|
+
* @param params - Factory parameters including the client and experience store.
|
|
47
46
|
* @example
|
|
48
47
|
* ```typescript
|
|
49
48
|
* const instance = createExperienceInstance({ client, experience })
|
|
@@ -61,8 +60,7 @@ declare const createExperienceInstanceIndexFactory: ({ client }: {
|
|
|
61
60
|
/**
|
|
62
61
|
* Creates an index that tracks all experience instances keyed by experience ID.
|
|
63
62
|
*
|
|
64
|
-
* @param
|
|
65
|
-
* @returns {ExperienceInstanceIndex} The created experience-instance index.
|
|
63
|
+
* @param params - Factory parameters including the client.
|
|
66
64
|
* @example
|
|
67
65
|
* ```typescript
|
|
68
66
|
* const index = createExperienceInstanceIndex({ client })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAOL,KAAK,aAAa,EAGlB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,CAAA;IAChC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAC9B,WAAW,EAAE,eAAe,CAAC,aAAa,CAAC,CAAA;IAC3C,MAAM,EAAE,WAAW,GAAG,SAAS,CAAA;IAC/B,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;IACjD,UAAU,EAAE,KAAK,CAAC,eAAe,GAAG,OAAO,CAAC,C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,iCAgdF,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAOL,KAAK,aAAa,EAGlB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,CAAA;IAChC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAC9B,WAAW,EAAE,eAAe,CAAC,aAAa,CAAC,CAAA;IAC3C,MAAM,EAAE,WAAW,GAAG,SAAS,CAAA;IAC/B,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;IACjD,UAAU,EAAE,KAAK,CAAC,eAAe,GAAG,OAAO,CAAC,CAAA;IAC5C,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IAC3B,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IACzB,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IAC1B,UAAU,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IAC/B,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAC/B,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAA;IACvC,gBAAgB,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,gBAAgB,EAAE,KAAK,CAAC,cAAc,GA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G;AACH,wBAAgB,6BAA6B,CAC3C,CAAC,SAAS,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAAC,CAAC,CAAC,EACpE,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAEpE"}
|
|
@@ -5,6 +5,7 @@ export type FrameworksStore = ReturnType<typeof createFrameworkIndex>;
|
|
|
5
5
|
export interface Framework {
|
|
6
6
|
name: string;
|
|
7
7
|
render: FrameworkRender;
|
|
8
|
+
unRender?: FrameworkUnRender;
|
|
8
9
|
}
|
|
9
10
|
declare const createFrameworkIndexFactory: ({ client }: {
|
|
10
11
|
client: Picked;
|
|
@@ -15,6 +16,7 @@ declare const createFrameworkIndexFactory: ({ client }: {
|
|
|
15
16
|
};
|
|
16
17
|
export declare function createFrameworkIndex<T extends Parameters<typeof createFrameworkIndexFactory>[0]>(params: T): ReturnType<typeof createFrameworkIndexFactory>;
|
|
17
18
|
export type FrameworkRender = (shadowRoot: ShadowRoot, component: AdaptedComponent, client: Picked, experience: ExperienceInstance) => void;
|
|
19
|
+
export type FrameworkUnRender = (shadowRoot: ShadowRoot) => void;
|
|
18
20
|
export declare const setupFramework: (framework: Framework, frameworks: FrameworksStore) => void;
|
|
19
21
|
export {};
|
|
20
22
|
//# sourceMappingURL=framework.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../../../src/entities/framework/framework.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../../../src/entities/framework/framework.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AAEpF,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAIrE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC7B;AAGD,QAAA,MAAM,2BAA2B,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;qBAcvD,MAAM,aAAa,SAAS,KAAG,IAAI;sBAiBlC,MAAM;;CAS/B,CAAA;AAEF,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,EAC9F,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAEhD;AAED,MAAM,MAAM,eAAe,GAAG,CAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,KAC3B,IAAI,CAAA;AAET,MAAM,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAA;AAEhE,eAAO,MAAM,cAAc,GAAI,WAAW,SAAS,EAAE,YAAY,eAAe,KAAG,IAElF,CAAA"}
|
|
@@ -11,9 +11,9 @@ type RuleEvaluator = (logic: LogicRule, context?: LogicObject) => Promise<unknow
|
|
|
11
11
|
/**
|
|
12
12
|
* Resolves a field from an array by id or key.
|
|
13
13
|
*
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @returns
|
|
14
|
+
* @param inputKey - The field id or key to look up.
|
|
15
|
+
* @param allFields - All registered fields.
|
|
16
|
+
* @returns The matching field, or null if not found.
|
|
17
17
|
* @example
|
|
18
18
|
* ```typescript
|
|
19
19
|
* resolveField('email', allFields) // Field | null
|
|
@@ -23,9 +23,9 @@ export declare function resolveField(inputKey: string, allFields: Field[]): Fiel
|
|
|
23
23
|
/**
|
|
24
24
|
* Coerces a scalar value into a single-element array when the field expects multiple values.
|
|
25
25
|
*
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
28
|
-
* @returns
|
|
26
|
+
* @param field - The field definition.
|
|
27
|
+
* @param value - The response value to coerce.
|
|
28
|
+
* @returns The original or coerced value.
|
|
29
29
|
* @example
|
|
30
30
|
* ```typescript
|
|
31
31
|
* coerceToArray(multipleField, 'hello') // ['hello']
|
|
@@ -35,9 +35,9 @@ export declare function coerceToArray(field: Field, value: FieldValue): FieldVal
|
|
|
35
35
|
/**
|
|
36
36
|
* Validates that an object field value has the correct shape and is JSON-serializable.
|
|
37
37
|
*
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @returns
|
|
38
|
+
* @param field - The field definition.
|
|
39
|
+
* @param value - The response value to validate.
|
|
40
|
+
* @returns A validation error if the value is invalid, or null if valid.
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
43
|
* getObjectValueError(objectField, { key: 'val' }) // null
|
|
@@ -47,9 +47,9 @@ export declare function getObjectValueError(field: Field, value: FieldValue): Va
|
|
|
47
47
|
/**
|
|
48
48
|
* Validates that a response value matches one of the field's allowed options.
|
|
49
49
|
*
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @returns
|
|
50
|
+
* @param field - The field definition with options.
|
|
51
|
+
* @param value - The response value to validate.
|
|
52
|
+
* @returns A validation error if the value is not a valid option, or null if valid.
|
|
53
53
|
* @example
|
|
54
54
|
* ```typescript
|
|
55
55
|
* getOptionsError(fieldWithOptions, 'valid-option') // null
|
|
@@ -59,11 +59,11 @@ export declare function getOptionsError(field: Field, value: FieldValue): Valida
|
|
|
59
59
|
/**
|
|
60
60
|
* Runs field-level validation including rule-based validation, required checks, and multiplicity checks.
|
|
61
61
|
*
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @returns
|
|
62
|
+
* @param evaluateRule - Callback to evaluate rule-based validation logic.
|
|
63
|
+
* @param field - The field definition.
|
|
64
|
+
* @param value - The response value to validate.
|
|
65
|
+
* @param responses - All current responses for cross-field validation.
|
|
66
|
+
* @returns A validation error if the field fails validation, or null if valid.
|
|
67
67
|
* @example
|
|
68
68
|
* ```typescript
|
|
69
69
|
* await getFieldValidationError(evaluate, field, 'hello') // null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-validation.d.ts","sourceRoot":"","sources":["../../../../src/entities/response/response-validation.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAuB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAGhE,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,UAAU,CAAA;CAClB;AAED,qEAAqE;AACrE,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"response-validation.d.ts","sourceRoot":"","sources":["../../../../src/entities/response/response-validation.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAuB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAGhE,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,UAAU,CAAA;CAClB;AAED,qEAAqE;AACrE,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,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E,CAAC,EAC1B,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAC3D;IAAE,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"create-field-evaluator.d.ts","sourceRoot":"","sources":["../../../src/form/create-field-evaluator.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,OAAO,EAA6C,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AACpG,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGvC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,EAC1B,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAC3D;IAAE,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAwCjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-submit-pipeline.d.ts","sourceRoot":"","sources":["../../../src/form/create-submit-pipeline.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAOL,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,MAA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KAAK,CAAC,eAAe,EAAE,CAAC,CAAA;CACnD;AA2CD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,YAAY,GACb,EAAE,oBAAoB,GAAG,cAAc,CAiMvC"}
|
package/dist/types/picked.d.ts
CHANGED
|
@@ -241,9 +241,7 @@ export declare class Picked {
|
|
|
241
241
|
register: (key: string, action: Action) => void;
|
|
242
242
|
getByKey: (key: string) => import('effector').Store<Action | undefined>;
|
|
243
243
|
listStore: import('effector').Store<import('.').ActionIndexItem[]>;
|
|
244
|
-
getEvokableAction: (actionKey: string
|
|
245
|
-
experience: import('.').ExperienceInstance;
|
|
246
|
-
}) => import('effector').Store<() => ReturnType<Action>>;
|
|
244
|
+
getEvokableAction: (actionKey: string) => import('effector').Store<() => ReturnType<Action>>;
|
|
247
245
|
};
|
|
248
246
|
constructor(options: CreateClientOptions);
|
|
249
247
|
start: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,uBAAuB,EAC7B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAC3F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,gCAAgC,CAAA;AAGvC,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAE/D,OAAO,KAAK,EAAE,OAAO,EAAE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IAEH,oBAAoB,GAClB,cAAc,MAAM,EACpB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IACD;;;;;;;;;OASG;IAEH,qBAAqB,GACnB,eAAe,MAAM,EACrB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;;;;;;;OAQG;IAEH,kBAAkB,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;IAED;;;;;;;;OAQG;IAEH,mBAAmB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;YAEa,mBAAmB;YAMnB,YAAY;IAc1B,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,eAAe;IAWvB,eAAe,GAAI,YAAY,MAAM,KAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1F;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,YAAY,GAAI,UAAU,MAAM,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,CAY3E;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,UAAU,8BAA8B;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,8BAA8B,GAAI,eAE5C,8BAAmC,KAAG,MA6CxC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,cAAc;AACd,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,2BAA2B,GAAI,eAEzC,2BAAgC,KAAG,MA4BrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,UAAU,6BAA6B;IACrC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAiCD,eAAO,MAAM,6BAA6B,GAAI,eAE3C,6BAAkC,KAAG,MAqCvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,eAAO,MAAM,wBAAwB,QAAO,MAqE3C,CAAA"}
|
|
@@ -9,12 +9,14 @@ interface SinglePageAppPluginOptions {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Enables compatibility with Single Page Applications (SPAs).
|
|
12
|
-
* This plugin monitors browser history events and
|
|
13
|
-
*
|
|
12
|
+
* This plugin monitors browser history events and reconciles experiences with the
|
|
13
|
+
* new route's DOM: after a route change it re-runs the per-experience spawn pass
|
|
14
|
+
* (`initialiseExperiences`) immediately and again on each DOM mutation batch until
|
|
15
|
+
* the DOM settles, so widgets re-appear when their target elements are (re)rendered
|
|
16
|
+
* by the host framework.
|
|
14
17
|
*
|
|
15
|
-
* @param {SinglePageAppPluginOptions}
|
|
18
|
+
* @param {SinglePageAppPluginOptions} _options - Configuration options for the SPA plugin.
|
|
16
19
|
* @returns {Plugin} The plugin.
|
|
17
|
-
*
|
|
18
20
|
* @example
|
|
19
21
|
* ```typescript
|
|
20
22
|
* createClient({
|
|
@@ -27,6 +29,15 @@ interface SinglePageAppPluginOptions {
|
|
|
27
29
|
* ```
|
|
28
30
|
*/
|
|
29
31
|
export declare const singlePageAppPlugin: (_options: SinglePageAppPluginOptions) => Plugin;
|
|
32
|
+
/**
|
|
33
|
+
* Instruments browser history so the callback fires whenever the navigation
|
|
34
|
+
* URL changes via `popstate`, `pushState`, or `replaceState`. Same-URL events
|
|
35
|
+
* are ignored so repeated replaces of the current location don't re-trigger.
|
|
36
|
+
*
|
|
37
|
+
* @param {() => void} callback - Invoked once per URL change.
|
|
38
|
+
* @example
|
|
39
|
+
* instrumentHistory(() => console.log('route changed'))
|
|
40
|
+
*/
|
|
30
41
|
export declare function instrumentHistory(callback: () => void): void;
|
|
31
42
|
export {};
|
|
32
43
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/single-page-app/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/single-page-app/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAS1D,UAAU,0BAA0B;IAClC;;;;OAIG;IACH,iBAAiB,EAAE,IAAI,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,0BAA0B,KAAG,MAyD1E,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAiD5D"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./rules-logic-DNLOv90w.cjs`);require(`./logger-fbvQC40v.cjs`);const t=require(`./supports-Dsjg-82e.cjs`);let n=require(`effector`),r=require(`@withease/factories`);function i(e){return!t.d()||!t.r()?[]:Array.from(window.document.querySelectorAll(e)).filter(e=>e instanceof HTMLElement)}var a=`open`;function o(e){if(!t.l())throw Error(`Shadow DOM is not supported in this environment`);return e.attachShadow({mode:a})}function s(){return new Promise((e,n)=>{if(!t.r()){n();return}document.readyState===`loading`?document.addEventListener(`readystatechange`,()=>e(),{once:!0}):e()})}function c(e,t){let n=new MutationObserver(r=>{document.contains(e)||(n.disconnect(),t())});n.observe(document.body,{childList:!0,subtree:!0})}var l=`picked-root`,u=`picked-target`,d=`picked-root`;function f(e,t){return[...e,{selector:`${d}[experience-id="${t}"]`,placement:`replace`}].flatMap(e=>{let n=i(e.selector).filter(e=>!h(e,t)&&!g(e,t));return{...e,elements:n}})}function p(e,t,n){return e.flatMap(e=>e.elements.map(r=>v(r,e.placement,t,n)))}function m(e,t){e.classList.add(u),e.classList.add(`${u}-${t}`)}function h(e,t){return t?e.classList.contains(`${u}-${t}`):e.classList.contains(`${u}`)}function g(e,t){return t?e.classList.contains(`${l}-${t}`):e.classList.contains(l)}function _(e,t){let n=document.createElement(`div`);return n.style.display=`block`,n.classList.add(l),n.classList.add(`${l}-${e}`),n.classList.add(`${l}-${t}`),n}function v(e,t,n,r){let i,a=_(n,r);if(e instanceof Document)i=e.body.appendChild(a);else{switch(t){case`replace`:e.replaceWith(a);break;case`before`:e.before(a);break;case`after`:e.after(a);break;case`prepend`:e.prepend(a);break;case`append`:e.append(a);break}i=a}return i}function y(e){return e.type===`condition`}function b(e){return e.type===`step`}function x(e){return e.type===`experience`}function S(e){return e.type===`origin`}function C(e){return e.type===`action`}var w=(e,t,n,r,i=new Set)=>i.has(n.id)?[]:(i.add(n.id),b(n)&&!r?[n]:t.filter(e=>e.sourceNodeId===n.id).flatMap(n=>{let r=e.find(e=>e.id===n.destinationNodeId);return r?w(e,t,r,!1,i):[]})),T=(e,t,n)=>w(e,t,n,!0,new Set),E=(e,t,n,r,i=new Set)=>{if(i.has(n.id))return[-1,-1];i.add(n.id);let a=t.filter(e=>e.sourceNodeId===n.id);if(a.length===0)return[0,0];let o=1/0,s=-1/0;for(let n of a){let r=e.find(e=>e.id===n.destinationNodeId);if(!r)continue;let[a,c]=E(e,t,r,!1,new Set(i));a!==-1&&(o=Math.min(o,a+1),s=Math.max(s,c+1))}return o===1/0?[-1,-1]:[o,s]},D=(e,t,n)=>E(e,t,n,!0,new Set),O=(e,t,n,r=new Set)=>{if(r.has(n.id))return[-1,-1];if(r.add(n.id),n.type===`origin`)return[0,0];let i=t.filter(e=>e.destinationNodeId===n.id);if(i.length===0)return[-1,-1];let a=1/0,o=-1/0;for(let n of i){let i=e.find(e=>e.id===n.sourceNodeId);if(!i)continue;let[s,c]=O(e,t,i,new Set(r));s!==-1&&(a=Math.min(a,s+1),o=Math.max(o,c+1))}return a===1/0?[-1,-1]:[a,o]},k=(e,t,n)=>O(e,t,n,new Set),A=e=>e.find(e=>e.type===`origin`)||null,j=(e,t,n)=>{if(!e)return A(t);let r=n.find(t=>t.sourceNodeId===e.id);return r&&t.find(e=>e.id===r.destinationNodeId)||null};async function M(e,t,n,r){let i=e?`true`:`false`,a=r.find(e=>e.sourceHandle===i&&e.sourceNodeId===t);return n.find(e=>e.id===a?.destinationNodeId)}var N=(0,n.createDomain)(`experience-instance`),P=(0,r.createFactory)(({client:t,experience:r,target:i,options:a})=>{let o=(0,n.createEvent)(),s=(0,n.createEvent)(),c=(0,n.createEvent)(),l=(0,n.createEvent)(),u=(0,n.createEvent)(),d=(0,n.createEvent)(),f=r.componentStore,p=N.store(`transitioning`),m=t.history.entriesStore.map(e=>e.filter(e=>e.experienceId===r.id)),h=m.map(e=>e.filter(e=>b(e.node))),g=m.map(e=>e.at(-1)?.node||null),_=(0,n.combine)(t.steps.listStore,g,(e,t)=>e.find(e=>t&&b(t)&&e.id===t.stepId)||null),v=(0,n.combine)(t.steps.listStore,h,(e,t)=>{let n=t.at(-2);if(!n||!b(n.node))return null;let r=n.node;return e.find(e=>e.id===r.stepId)||null}),w=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?T(e,t,n):[]),E=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?k(e,t,n):[-1,-1]),O=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?D(e,t,n):[-1,-1]),P=N.store(!1),F=(0,n.createApi)(P,{open:()=>!0,close:()=>!1,toggle:e=>!e,set:(e,t)=>t}),I=(0,n.createEffect)(async()=>{t.history.back({experienceId:r.id})}),L=(0,n.attach)({source:r.treeStore,effect:async(e,n)=>{let i=e.nodes.find(e=>b(e)&&e.stepId===n);i&&t.history.push({experienceId:r.id,node:i})}}),R=(0,n.attach)({source:g,effect:e=>{}}),z=(0,n.attach)({source:r.treeStore,effect:async({nodes:e})=>A(e)}),B=(0,n.attach)({source:r.treeStore,effect:async({nodes:e,edges:t},n)=>{if(S(n))return j(n,e,t)}}),V=(0,n.attach)({source:r.treeStore,effect:async({nodes:n,edges:r,conditions:i},a)=>{if(!y(a))return;let o=i.find(e=>e.id===a.conditionId)?.logic;return o?M(!!await e.t(t,o),a.id,n,r):void 0}}),H=(0,n.attach)({source:r.treeStore,effect:async({nodes:e,edges:n},r)=>{if(!C(r))return;let i=r.actionKey;if(!i){`${r.id}`;return}let a=t.actions.getByKey(i).getState();if(!a){`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return t?e.find(e=>e.id===t.destinationNodeId):null}if(typeof a!=`function`){`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return t?e.find(e=>e.id===t.destinationNodeId):null}try{`${i}`,await a({...t.getStateSnapshot(),args:[]},{experience:J});let o=n.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`true`);if(!o)return`${r.id}`,null;let s=e.find(e=>e.id===o.destinationNodeId);return`${i}${s?.id}`,s||null}catch{`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);if(!t)return`${r.id}`,null;let a=e.find(e=>e.id===t.destinationNodeId);return`${i}${a?.id}`,a||null}}}),U=(0,n.createEffect)(e=>{x(e)&&t.experiences.launch({key:e.experienceKey})}),W=(0,n.attach)({source:[g,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),G=(0,n.attach)({source:[g,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),K=(0,n.createEffect)(e=>{t.history.push({experienceId:r.id,node:e})}),q=(0,n.attach)({source:r.configStore,effect:async({initializeOpenLogic:n})=>a?.initialiseOpen===void 0?e.n(n)?!!await e.t(t,n):n??!1:a.initialiseOpen}),J=Object.freeze({id:Math.random().toString(36).substring(7),experienceKey:r.key,experienceId:r.id,configStore:r.configStore,target:i,componentStore:f,stateStore:p,isOpenStore:P,open:F.open,close:F.close,toggleOpen:F.toggle,setOpen:F.set,treeStore:r.treeStore,currentNodeStore:g,currentStepStore:_,previousStepStore:v,nextReachableStepNodesStore:w,stepsToOriginStore:E,stepsToLeafStore:O,goToNextStep:s,goToPreviousStep:c,goToStepById:l,stepsHistoryStore:h}),Y=(0,n.createEvent)(),X=(0,n.createEvent)();return(0,n.sample)({clock:g,target:Y}),(0,n.sample)({clock:Y,filter:e=>e===null,target:z}),(0,n.sample)({clock:Y,filter:e=>e!==null,target:X}),(0,n.split)({source:X,match:e=>y(e)?`condition`:b(e)?`step`:x(e)?`launchExperience`:S(e)?`origin`:C(e)?`action`:`other`,cases:{origin:B,condition:V,step:R,launchExperience:U,action:H,__:(0,n.createEvent)()}}),(0,n.sample)({clock:[V.doneData,B.doneData,z.doneData,G.doneData,W.doneData,H.doneData],filter:Boolean,target:K}),(0,n.sample)({clock:s,target:G}),(0,n.sample)({clock:s,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit`,step:e,experience:J}))}),(0,n.sample)({clock:G.done,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_success`,step:e,experience:J}))}),(0,n.sample)({clock:G.fail,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_error`,step:e,experience:J}))}),(0,n.sample)({clock:c,target:I}),(0,n.sample)({clock:l,target:L}),(0,n.sample)({source:(0,n.combine)([V.pending,B.pending,z.pending,G.pending]),fn:e=>e.some(Boolean)?`transitioning`:`ready`,target:p}),(0,n.sample)({clock:R.doneData,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_enter`,step:e,experience:J}))}),(0,n.sample)({clock:d,target:q}),(0,n.sample)({source:q.doneData,fn:Boolean,target:P}),(0,n.sample)({source:g,clock:o,filter:e=>e?S(e):!0,target:W}),(0,n.sample)({source:P,filter:Boolean,target:o}),(0,n.sample)({source:P,filter:Boolean,target:t.eventBus.prepend(()=>({type:`experience_open`,experience:J}))}),(0,n.sample)({source:P,filter:e=>!e,target:t.eventBus.prepend(()=>({type:`experience_close`,experience:J}))}),(0,n.sample)({clock:u,target:[d]}),u(),J});function F(e){return(0,r.invoke)(P,e)}var I=(0,r.createFactory)(({client:e})=>{let t=N.store({}),r=(0,n.createEvent)(),i=(0,n.createEvent)(),a=(0,n.createEvent)(),s=(0,n.createApi)(t,{register(e,t){let n=[...e[t.experienceId]??[]];return n.push(t),{...e,[t.experienceId]:n}},unregister(e,t){let n=t.experienceId,r=e[n]?.filter(e=>e!==t);return{...e,[n]:r??[]}}}),l=(0,n.createEffect)(({experience:t,target:n,options:r})=>F({client:e,experience:t,target:n,options:r})),u=(0,n.createEffect)(e=>{s.register(e)}),d=(0,n.createEffect)(e=>{e.target&&c(e.target,()=>{a(e)})}),f=(0,n.createEffect)(e=>{s.unregister(e)}),p=(0,n.createEffect)(t=>{let n=t.componentStore.getState();if(!n)return;let r=n.frameworkStore.getState();if(!r){`${n.name}`;return}let i=t.target;if(!i){`${t.experienceId}`;return}let a=o(i);try{r.render(a,n.component,e,t)}catch{}});(0,n.sample)({clock:r,target:l}),(0,n.sample)({clock:a,target:f}),(0,n.sample)({clock:l.doneData,target:[u,d,i]}),(0,n.sample)({clock:l.doneData,target:e.eventBus.prepend(e=>({type:`experience_initialize`,experience:e}))}),(0,n.sample)({clock:i,target:p});function m(e,t,n){r({experience:e,target:t,options:n})}let h=t.map(e=>Object.values(e).flat());function g(e){return h.map(t=>t.filter(t=>t.experienceKey===e),{skipVoid:!1})}function _(e){return t.map(t=>t[e]||[],{skipVoid:!1})}return{spawn:m,getByExperienceKey:g,getByExperienceId:_,listStore:h}});function L(e){return(0,r.invoke)(I,e)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return F}});
|