@picked/client 0.0.1-dev.1773729274420 → 0.0.1-dev.1773807602703
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-DuHeVrL4.js → api-GlH9T8_1.js} +1 -1
- package/dist/{api-47L967ES.cjs → api-GvmToTw0.cjs} +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/server/index.js +1 -1
- package/dist/esm/index.js +738 -741
- package/dist/esm/plugins/create-experience/index.js +360 -286
- package/dist/esm/plugins/dynamic-experiences/index.js +145 -78
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-indexeddb/index.js +46 -51
- package/dist/esm/plugins/single-page-app/index.js +24 -24
- package/dist/esm/server/index.js +7 -7
- package/dist/experience-instance-CxiOyYPf.cjs +1 -0
- package/dist/{experience-instance-DTyL1fNb.js → experience-instance-DCknHRkX.js} +328 -349
- package/dist/nodes-DQt4TfuO.js +26 -0
- package/dist/nodes-DsL8kMSX.cjs +1 -0
- package/dist/object-BbFTsGh3.cjs +1 -0
- package/dist/{object-CJssU1Pm.js → object-JwZ58NOH.js} +1 -1
- package/dist/storage-Be5xWNPC.cjs +1 -0
- package/dist/{storage-B2d81EOI.js → storage-Co_LbKr_.js} +30 -35
- package/dist/types/entities/action/action.d.ts +2 -5
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/condition/condition.d.ts +17 -0
- package/dist/types/entities/condition/condition.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +48 -31
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -2
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +23 -52
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +9 -7
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +20 -0
- package/dist/types/entities/step/step.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +8 -2
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +41 -32
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +70 -43
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +1 -1
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +20 -5
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +46 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -2
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -2
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -2
- 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 +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +3 -0
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +2 -2
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +1 -0
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +1 -2
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/key.d.ts +12 -0
- package/dist/types/utils/key.d.ts.map +1 -0
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +3 -3
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +7 -2
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +8 -0
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/picked-config.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +2 -16
- package/dist/experience-instance-BX0aqKsC.cjs +0 -1
- package/dist/object-mwaxtjLG.cjs +0 -1
- package/dist/storage-58NoTSsc.cjs +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,144 +1,155 @@
|
|
|
1
|
-
import { createDomain as
|
|
2
|
-
import { createFactory as
|
|
3
|
-
import { g as
|
|
4
|
-
import {
|
|
5
|
-
import { l as
|
|
6
|
-
import { c as
|
|
7
|
-
import { a as
|
|
8
|
-
import { p as ce, g as ue } from "../api-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { createDomain as j, createApi as w, attach as V, combine as A, createStore as L, createEffect as C, sample as v, createEvent as D } from "effector";
|
|
2
|
+
import { createFactory as k, invoke as b } from "@withease/factories";
|
|
3
|
+
import { g as Z, t as ne, c as se, i as ie, e as _, a as oe, d as ae } from "../experience-instance-DCknHRkX.js";
|
|
4
|
+
import { b as Gt } from "../experience-instance-DCknHRkX.js";
|
|
5
|
+
import { l as F } from "../logger-C9a75KZn.js";
|
|
6
|
+
import { c as z, l as R, s as M } from "../storage-Co_LbKr_.js";
|
|
7
|
+
import { a as qt } from "../storage-Co_LbKr_.js";
|
|
8
|
+
import { p as ce, g as ue } from "../api-GlH9T8_1.js";
|
|
9
|
+
import { i as de } from "../nodes-DQt4TfuO.js";
|
|
10
|
+
import { g as le } from "../id-BW-g3y32.js";
|
|
11
|
+
import { i as fe } from "../object-JwZ58NOH.js";
|
|
12
|
+
import { s as H, a as G, b as pe, c as ge, d as me } from "../supports-8YT4QKI7.js";
|
|
13
|
+
import { e as Wt, f as Yt, g as Qt, h as Xt, i as Zt, j as er, k as tr } from "../supports-8YT4QKI7.js";
|
|
14
|
+
const U = j("experience"), ye = k(
|
|
14
15
|
({ client: t, experience: e }) => {
|
|
15
|
-
const r =
|
|
16
|
-
merge(
|
|
16
|
+
const r = U.store(e), n = w(r, {
|
|
17
|
+
merge(p, f) {
|
|
17
18
|
return {
|
|
18
|
-
...
|
|
19
|
-
...
|
|
19
|
+
...p,
|
|
20
|
+
...f.experience
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
}),
|
|
23
|
-
name:
|
|
24
|
-
decisionLogic:
|
|
25
|
-
targetSelectors:
|
|
23
|
+
}), i = r.map((p) => ({
|
|
24
|
+
name: p.name,
|
|
25
|
+
decisionLogic: p.condition,
|
|
26
|
+
targetSelectors: p.targets,
|
|
26
27
|
initializeOpenLogic: e.initializeOpen
|
|
27
|
-
})),
|
|
28
|
-
|
|
28
|
+
})), u = e.component ? {
|
|
29
|
+
name: `experience:${e.id}`,
|
|
30
|
+
component: e.component,
|
|
31
|
+
frameworkStore: t.frameworks.getByName(e.component.frameworkName)
|
|
32
|
+
} : void 0, s = t.components.listStore.map(
|
|
33
|
+
(p) => u || (e.componentName ? p.find((f) => f.name === e.componentName) : void 0) || p.find((f) => f.name === `experience:${e.id}`) || p.find((f) => f.name === "experience"),
|
|
29
34
|
{ skipVoid: !1 }
|
|
30
|
-
),
|
|
31
|
-
steps:
|
|
32
|
-
nodes:
|
|
33
|
-
edges:
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
), o = r.map((p) => ({
|
|
36
|
+
steps: p.steps,
|
|
37
|
+
nodes: p.nodes,
|
|
38
|
+
edges: p.edges,
|
|
39
|
+
// eslint-disable-next-line sonarjs/deprecation -- backwards-compat fallback for conditionals
|
|
40
|
+
conditions: p.conditions ?? p.conditionals ?? []
|
|
41
|
+
})), l = e.actions ?? [];
|
|
36
42
|
return {
|
|
37
43
|
id: e.id,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
key: e.key,
|
|
45
|
+
name: e.name,
|
|
46
|
+
configStore: i,
|
|
47
|
+
treeStore: o,
|
|
48
|
+
componentStore: s,
|
|
49
|
+
actions: l,
|
|
43
50
|
merge: n.merge
|
|
44
51
|
};
|
|
45
52
|
}
|
|
46
53
|
);
|
|
47
54
|
function he(t) {
|
|
48
|
-
return
|
|
55
|
+
return b(ye, t);
|
|
49
56
|
}
|
|
50
|
-
const
|
|
51
|
-
const e =
|
|
52
|
-
register(f,
|
|
57
|
+
const Se = k(({ client: t }) => {
|
|
58
|
+
const e = U.store({}), r = U.store({}), n = w(e, {
|
|
59
|
+
register(f, h) {
|
|
53
60
|
return {
|
|
54
61
|
...f,
|
|
55
|
-
[
|
|
62
|
+
[h.id]: h
|
|
56
63
|
};
|
|
57
64
|
}
|
|
65
|
+
}), i = w(r, {
|
|
66
|
+
register(f, { key: h, id: S }) {
|
|
67
|
+
return { ...f, [h]: S };
|
|
68
|
+
}
|
|
58
69
|
});
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
70
|
+
function u(f) {
|
|
71
|
+
const h = e.getState()[f.id];
|
|
72
|
+
if (h) {
|
|
73
|
+
h.merge({ experience: f, strategy: "override" }), f.key && i.register({ key: f.key, id: f.id });
|
|
63
74
|
return;
|
|
64
75
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
76
|
+
const S = he({ client: t, experience: f });
|
|
77
|
+
n.register(S), f.key && i.register({ key: f.key, id: f.id });
|
|
67
78
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
70
|
-
return e
|
|
79
|
+
const s = e.map((f) => Object.values(f));
|
|
80
|
+
function o(f) {
|
|
81
|
+
return A(e, r, (h, S) => h[f] ?? h[S[f] ?? ""], { skipVoid: !1 });
|
|
71
82
|
}
|
|
72
|
-
const
|
|
73
|
-
source: e,
|
|
74
|
-
effect: async (f, { id:
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
|
|
83
|
+
const l = V({
|
|
84
|
+
source: { experiences: e, keys: r },
|
|
85
|
+
effect: async ({ experiences: f, keys: h }, { id: S, options: g }) => {
|
|
86
|
+
const a = f[S] ?? f[h[S] ?? ""];
|
|
87
|
+
if (!a) {
|
|
88
|
+
F("warn", `Experience with id '${S}' not found.`);
|
|
78
89
|
return;
|
|
79
90
|
}
|
|
80
|
-
if (
|
|
81
|
-
|
|
91
|
+
if (g?.bypassCondition) {
|
|
92
|
+
N(t, a, g);
|
|
82
93
|
return;
|
|
83
94
|
}
|
|
84
|
-
await
|
|
95
|
+
await ee(t, a) && N(t, a, g);
|
|
85
96
|
}
|
|
86
|
-
}),
|
|
87
|
-
source: t.experienceInstances.listStore,
|
|
88
|
-
effect: (f, { id:
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
for (const
|
|
92
|
-
|
|
97
|
+
}), p = V({
|
|
98
|
+
source: { instances: t.experienceInstances.listStore, keys: r },
|
|
99
|
+
effect: ({ instances: f, keys: h }, { id: S, options: g }) => {
|
|
100
|
+
const a = h[S] ?? S, c = f.filter((d) => d.experienceId === a);
|
|
101
|
+
if (c.length > 0)
|
|
102
|
+
for (const d of c)
|
|
103
|
+
d.open();
|
|
93
104
|
else
|
|
94
|
-
|
|
105
|
+
l({ id: a, options: { ...g, initialiseOpen: !0 } });
|
|
95
106
|
}
|
|
96
107
|
});
|
|
97
108
|
return {
|
|
98
109
|
/** Registers an experience in the index. If an experience with the same ID already exists, it is merged. */
|
|
99
|
-
register:
|
|
100
|
-
/** Returns a derived store for an experience by its ID. The store value is `undefined` when no match exists. */
|
|
101
|
-
get:
|
|
110
|
+
register: u,
|
|
111
|
+
/** Returns a derived store for an experience by its ID or key. The store value is `undefined` when no match exists. */
|
|
112
|
+
get: o,
|
|
102
113
|
/** @deprecated Use `experiences.get(id)` instead. */
|
|
103
|
-
getById:
|
|
104
|
-
/** Effector effect that launches an experience by ID, creating instances for each DOM target. */
|
|
105
|
-
launch:
|
|
114
|
+
getById: o,
|
|
115
|
+
/** Effector effect that launches an experience by ID or key, creating instances for each DOM target. */
|
|
116
|
+
launch: l,
|
|
106
117
|
/** Effector effect that opens an experience's existing instances, or launches it with `initialiseOpen` if none exist. */
|
|
107
|
-
open:
|
|
118
|
+
open: p,
|
|
108
119
|
/** Derived store containing all registered experiences as an array. */
|
|
109
|
-
listStore:
|
|
120
|
+
listStore: s
|
|
110
121
|
};
|
|
111
122
|
});
|
|
112
|
-
function
|
|
113
|
-
return
|
|
123
|
+
function ke(t) {
|
|
124
|
+
return b(Se, t);
|
|
114
125
|
}
|
|
115
|
-
const
|
|
126
|
+
const be = (t, e) => {
|
|
116
127
|
e.register(t);
|
|
117
|
-
},
|
|
118
|
-
const { targetSelectors: n } = e.configStore.getState(),
|
|
119
|
-
|
|
120
|
-
({ elements:
|
|
121
|
-
), se(
|
|
122
|
-
r ? t.experienceInstances.spawn(e,
|
|
128
|
+
}, N = (t, e, r) => {
|
|
129
|
+
const { targetSelectors: n } = e.configStore.getState(), i = Z(n, e.id);
|
|
130
|
+
i.forEach(
|
|
131
|
+
({ elements: s }) => s.forEach((o) => ne(o, e.id))
|
|
132
|
+
), se(i, e.id).forEach((s) => {
|
|
133
|
+
r ? t.experienceInstances.spawn(e, s, r) : t.experienceInstances.spawn(e, s);
|
|
123
134
|
});
|
|
124
|
-
},
|
|
135
|
+
}, K = async (t) => {
|
|
125
136
|
await Promise.all(
|
|
126
137
|
t.experiences.listStore.getState().map(async (e) => {
|
|
127
|
-
await
|
|
138
|
+
await ee(t, e) && N(t, e);
|
|
128
139
|
})
|
|
129
140
|
);
|
|
130
|
-
},
|
|
141
|
+
}, ee = async (t, e) => {
|
|
131
142
|
if (!t.preconditionPassed || !t.session?.isUser)
|
|
132
143
|
return !1;
|
|
133
144
|
const { decisionLogic: r, targetSelectors: n } = e.configStore.getState();
|
|
134
|
-
return
|
|
135
|
-
},
|
|
136
|
-
const n = e.name,
|
|
137
|
-
if (
|
|
138
|
-
const
|
|
139
|
-
r[n] = Object.freeze({ ...
|
|
145
|
+
return Z(n, e.id).length < 1 || n.length === 0 ? !1 : r === void 0 ? !0 : ie(r) ? await _(t, r) === !0 : !0;
|
|
146
|
+
}, we = (t, e, r) => {
|
|
147
|
+
const n = e.name, i = e.setup(t);
|
|
148
|
+
if (i) {
|
|
149
|
+
const u = r[n] ?? {};
|
|
150
|
+
r[n] = Object.freeze({ ...u, ...i });
|
|
140
151
|
}
|
|
141
|
-
},
|
|
152
|
+
}, Ie = j("component"), ve = k(
|
|
142
153
|
({ client: t, component: e, name: r }) => {
|
|
143
154
|
const n = t.frameworks.getByName(e.frameworkName);
|
|
144
155
|
return {
|
|
@@ -148,89 +159,89 @@ const Se = (t, e) => {
|
|
|
148
159
|
};
|
|
149
160
|
}
|
|
150
161
|
);
|
|
151
|
-
function
|
|
152
|
-
return
|
|
162
|
+
function Fe(t) {
|
|
163
|
+
return b(ve, t);
|
|
153
164
|
}
|
|
154
|
-
const
|
|
155
|
-
const e =
|
|
156
|
-
register(
|
|
165
|
+
const je = k(({ client: t }) => {
|
|
166
|
+
const e = Ie.store({}), r = w(e, {
|
|
167
|
+
register(s, o) {
|
|
157
168
|
return {
|
|
158
|
-
...
|
|
159
|
-
[
|
|
169
|
+
...s,
|
|
170
|
+
[o.name]: o
|
|
160
171
|
};
|
|
161
172
|
}
|
|
162
173
|
});
|
|
163
|
-
function n(
|
|
164
|
-
e.getState()[
|
|
174
|
+
function n(s, o) {
|
|
175
|
+
e.getState()[s] && F(
|
|
165
176
|
"warn",
|
|
166
|
-
`Component '${
|
|
177
|
+
`Component '${s}' already registered. Registering again will override the previous registration.`
|
|
167
178
|
);
|
|
168
|
-
const
|
|
169
|
-
r.register(
|
|
179
|
+
const p = Fe({ client: t, name: s, component: o });
|
|
180
|
+
r.register(p);
|
|
170
181
|
}
|
|
171
|
-
const
|
|
172
|
-
function
|
|
173
|
-
return e.map((
|
|
182
|
+
const i = e.map((s) => Object.values(s));
|
|
183
|
+
function u(s) {
|
|
184
|
+
return e.map((o) => o[s], { skipVoid: !1 });
|
|
174
185
|
}
|
|
175
186
|
return {
|
|
176
187
|
register: n,
|
|
177
|
-
getByName:
|
|
178
|
-
listStore:
|
|
188
|
+
getByName: u,
|
|
189
|
+
listStore: i
|
|
179
190
|
};
|
|
180
191
|
});
|
|
181
|
-
function
|
|
182
|
-
return
|
|
192
|
+
function Ee(t) {
|
|
193
|
+
return b(je, t);
|
|
183
194
|
}
|
|
184
|
-
const
|
|
195
|
+
const W = (t, e, r) => {
|
|
185
196
|
r.register(t, e);
|
|
186
|
-
},
|
|
187
|
-
const e =
|
|
188
|
-
register(
|
|
197
|
+
}, xe = j("framework"), Pe = k(({ client: t }) => {
|
|
198
|
+
const e = xe.store({}), r = w(e, {
|
|
199
|
+
register(s, o) {
|
|
189
200
|
return {
|
|
190
|
-
...
|
|
191
|
-
[
|
|
201
|
+
...s,
|
|
202
|
+
[o.name]: o.framework
|
|
192
203
|
};
|
|
193
204
|
}
|
|
194
205
|
});
|
|
195
|
-
function n(
|
|
196
|
-
e.getState()[
|
|
206
|
+
function n(s, o) {
|
|
207
|
+
e.getState()[s] && F(
|
|
197
208
|
"warn",
|
|
198
|
-
`Framework '${
|
|
199
|
-
), r.register({ name:
|
|
209
|
+
`Framework '${s}' already registered. Registering again will override the previous registration.`
|
|
210
|
+
), r.register({ name: s, framework: o });
|
|
200
211
|
}
|
|
201
|
-
const
|
|
202
|
-
function
|
|
203
|
-
return e.map((
|
|
212
|
+
const i = e.map((s) => Object.values(s));
|
|
213
|
+
function u(s) {
|
|
214
|
+
return e.map((o) => o[s], { skipVoid: !1 });
|
|
204
215
|
}
|
|
205
216
|
return {
|
|
206
217
|
register: n,
|
|
207
|
-
getByName:
|
|
208
|
-
listStore:
|
|
218
|
+
getByName: u,
|
|
219
|
+
listStore: i
|
|
209
220
|
};
|
|
210
221
|
});
|
|
211
222
|
function Ae(t) {
|
|
212
|
-
return
|
|
223
|
+
return b(Pe, t);
|
|
213
224
|
}
|
|
214
|
-
const
|
|
225
|
+
const Be = (t, e) => {
|
|
215
226
|
e.register(t.name, t);
|
|
216
|
-
}, $e = 6e3,
|
|
227
|
+
}, $e = 6e3, ze = z("last_ping", "global"), Ce = async (t) => {
|
|
217
228
|
try {
|
|
218
|
-
const e = Date.now(), r =
|
|
229
|
+
const e = Date.now(), r = R.get(ze);
|
|
219
230
|
let n = 0;
|
|
220
231
|
if (r.isSet() && (n = r.json() ?? 0), n && e - n < $e)
|
|
221
232
|
return !0;
|
|
222
|
-
const
|
|
233
|
+
const i = {
|
|
223
234
|
projectId: t.projectId,
|
|
224
235
|
path: window.location.pathname
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
return
|
|
236
|
+
}, u = {}, o = document.getElementById("picked_script")?.dataset.verceltoken;
|
|
237
|
+
o && (u["x-vercel-protection-bypass"] = o);
|
|
238
|
+
const p = (await ce(t.apiUrl, "ping", i, u)).ok;
|
|
239
|
+
return p && r.set(e), p;
|
|
229
240
|
} catch (e) {
|
|
230
|
-
return
|
|
241
|
+
return F("error", e), !1;
|
|
231
242
|
}
|
|
232
243
|
};
|
|
233
|
-
function
|
|
244
|
+
function te(t) {
|
|
234
245
|
const e = typeof window < "u", r = {
|
|
235
246
|
client: t,
|
|
236
247
|
responses: t.responses.listStore.getState(),
|
|
@@ -242,685 +253,663 @@ function ee(t) {
|
|
|
242
253
|
};
|
|
243
254
|
return Object.freeze(r);
|
|
244
255
|
}
|
|
245
|
-
const
|
|
246
|
-
const e =
|
|
247
|
-
register(
|
|
256
|
+
const Oe = j("predicate"), Re = k(({ client: t }) => {
|
|
257
|
+
const e = Oe.store({}), r = w(e, {
|
|
258
|
+
register(o, l) {
|
|
248
259
|
return {
|
|
249
|
-
...
|
|
250
|
-
[
|
|
251
|
-
name:
|
|
252
|
-
predicate:
|
|
260
|
+
...o,
|
|
261
|
+
[l.name]: {
|
|
262
|
+
name: l.name,
|
|
263
|
+
predicate: l.predicate
|
|
253
264
|
}
|
|
254
265
|
};
|
|
255
266
|
}
|
|
256
267
|
});
|
|
257
|
-
function n(
|
|
258
|
-
e.getState()[
|
|
268
|
+
function n(o, l) {
|
|
269
|
+
e.getState()[o] && F(
|
|
259
270
|
"warn",
|
|
260
|
-
`Predicate '${
|
|
261
|
-
), r.register(Object.freeze({ name:
|
|
271
|
+
`Predicate '${o}' already registered. Registering again will override the previous registration.`
|
|
272
|
+
), r.register(Object.freeze({ name: o, predicate: l }));
|
|
262
273
|
}
|
|
263
|
-
const
|
|
264
|
-
function
|
|
265
|
-
return e.map((
|
|
274
|
+
const i = e.map((o) => Object.values(o));
|
|
275
|
+
function u(o) {
|
|
276
|
+
return e.map((l) => l[o]?.predicate, { skipVoid: !1 });
|
|
266
277
|
}
|
|
267
|
-
function
|
|
268
|
-
const
|
|
278
|
+
function s(o) {
|
|
279
|
+
const l = L(() => {
|
|
269
280
|
}, {
|
|
270
281
|
skipVoid: !1
|
|
271
|
-
}),
|
|
272
|
-
const
|
|
273
|
-
if (!
|
|
282
|
+
}), p = C(async () => {
|
|
283
|
+
const f = u(o).getState();
|
|
284
|
+
if (!f)
|
|
274
285
|
return;
|
|
275
|
-
const
|
|
276
|
-
return (...
|
|
286
|
+
const h = te(t);
|
|
287
|
+
return (...S) => f({ ...h, args: S });
|
|
277
288
|
});
|
|
278
|
-
return
|
|
289
|
+
return v({
|
|
279
290
|
source: { responses: t.responses.listStore, fields: t.fields.listStore },
|
|
280
|
-
target:
|
|
281
|
-
}),
|
|
282
|
-
clock:
|
|
283
|
-
filter: (
|
|
284
|
-
target:
|
|
285
|
-
}),
|
|
291
|
+
target: p
|
|
292
|
+
}), v({
|
|
293
|
+
clock: p.doneData,
|
|
294
|
+
filter: (f) => f !== void 0,
|
|
295
|
+
target: l
|
|
296
|
+
}), p(), l;
|
|
286
297
|
}
|
|
287
298
|
return {
|
|
288
299
|
register: n,
|
|
289
|
-
getByName:
|
|
290
|
-
listStore:
|
|
291
|
-
getEvokablePredicate:
|
|
300
|
+
getByName: u,
|
|
301
|
+
listStore: i,
|
|
302
|
+
getEvokablePredicate: s
|
|
292
303
|
};
|
|
293
304
|
});
|
|
294
305
|
function Me(t) {
|
|
295
|
-
return
|
|
306
|
+
return b(Re, t);
|
|
296
307
|
}
|
|
297
|
-
const
|
|
308
|
+
const Ve = (t, e, r) => {
|
|
298
309
|
r.register(t, e);
|
|
299
|
-
},
|
|
300
|
-
const e =
|
|
301
|
-
register(
|
|
310
|
+
}, Y = j("feature"), De = k(({ client: t }) => {
|
|
311
|
+
const e = Y.store({}), r = Y.store([]), n = w(e, {
|
|
312
|
+
register(g, a) {
|
|
302
313
|
return {
|
|
303
|
-
...
|
|
304
|
-
[
|
|
314
|
+
...g,
|
|
315
|
+
[a.id]: a.feature
|
|
305
316
|
};
|
|
306
317
|
}
|
|
307
318
|
});
|
|
308
|
-
function
|
|
309
|
-
e.getState()[
|
|
319
|
+
function i(g, a) {
|
|
320
|
+
e.getState()[g] && F(
|
|
310
321
|
"warn",
|
|
311
|
-
`Feature '${
|
|
322
|
+
`Feature '${g}' already registered. Registering again will override the previous registration.`
|
|
312
323
|
);
|
|
313
|
-
const
|
|
314
|
-
id:
|
|
324
|
+
const d = {
|
|
325
|
+
id: g,
|
|
315
326
|
feature: {
|
|
316
|
-
...
|
|
317
|
-
id:
|
|
327
|
+
...a,
|
|
328
|
+
id: g
|
|
318
329
|
}
|
|
319
330
|
};
|
|
320
331
|
n.register(
|
|
321
332
|
Object.freeze({
|
|
322
|
-
id:
|
|
323
|
-
feature:
|
|
333
|
+
id: g,
|
|
334
|
+
feature: d
|
|
324
335
|
})
|
|
325
336
|
);
|
|
326
337
|
}
|
|
327
|
-
const
|
|
338
|
+
const u = C(
|
|
328
339
|
async ({
|
|
329
|
-
id:
|
|
330
|
-
key:
|
|
331
|
-
storage:
|
|
340
|
+
id: g,
|
|
341
|
+
key: a,
|
|
342
|
+
storage: c = "local"
|
|
332
343
|
}) => {
|
|
333
|
-
const
|
|
334
|
-
return
|
|
344
|
+
const d = z(`feature:${g}:${a}`, "global"), y = (c === "session" ? M : R).get(d).boolean();
|
|
345
|
+
return y === null ? null : { id: g, key: a, bucket: y, storage: c };
|
|
335
346
|
}
|
|
336
|
-
),
|
|
337
|
-
if (!
|
|
347
|
+
), s = C((g) => {
|
|
348
|
+
if (!g)
|
|
338
349
|
return null;
|
|
339
|
-
const
|
|
340
|
-
(
|
|
341
|
-
}),
|
|
350
|
+
const a = z(`feature:${g.id}:${g.key}`, "global");
|
|
351
|
+
(g.storage === "session" ? M : R).set(a, g.bucket);
|
|
352
|
+
}), o = /* @__PURE__ */ new Map(), l = V({
|
|
342
353
|
source: { allFeaturesStore: e, resolvedFeaturesStore: r },
|
|
343
|
-
effect: async ({ allFeaturesStore:
|
|
344
|
-
const
|
|
345
|
-
(
|
|
354
|
+
effect: async ({ allFeaturesStore: g, resolvedFeaturesStore: a }, { id: c, decide: d, key: m }) => {
|
|
355
|
+
const y = a.find(
|
|
356
|
+
(P) => P.id === c && P.key === m
|
|
346
357
|
);
|
|
347
|
-
if (
|
|
348
|
-
return
|
|
349
|
-
const
|
|
350
|
-
if (!
|
|
351
|
-
throw new Error(`Feature with id '${
|
|
352
|
-
const
|
|
353
|
-
if (
|
|
354
|
-
const
|
|
355
|
-
return { id:
|
|
358
|
+
if (y)
|
|
359
|
+
return y;
|
|
360
|
+
const I = g[c];
|
|
361
|
+
if (!I)
|
|
362
|
+
throw new Error(`Feature with id '${c}' not found`);
|
|
363
|
+
const E = o.get(`${c}:${m}`);
|
|
364
|
+
if (E !== void 0) {
|
|
365
|
+
const P = await E;
|
|
366
|
+
return { id: I.id, bucket: P, key: m, storage: I.feature.storage };
|
|
356
367
|
}
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
return { id:
|
|
368
|
+
const x = d();
|
|
369
|
+
o.set(`${c}:${m}`, x);
|
|
370
|
+
const B = await x;
|
|
371
|
+
return { id: I.id, bucket: B, key: m, storage: I.feature.storage };
|
|
361
372
|
}
|
|
362
373
|
});
|
|
363
|
-
|
|
374
|
+
v({
|
|
364
375
|
clock: n.register,
|
|
365
|
-
fn: (
|
|
366
|
-
const { id:
|
|
367
|
-
return { id:
|
|
376
|
+
fn: (g) => {
|
|
377
|
+
const { id: a, feature: c } = g;
|
|
378
|
+
return { id: a, key: c.feature.key, storage: c.feature.storage };
|
|
368
379
|
},
|
|
369
|
-
target:
|
|
370
|
-
}),
|
|
380
|
+
target: u
|
|
381
|
+
}), v({
|
|
371
382
|
source: e,
|
|
372
|
-
clock:
|
|
373
|
-
fn: (
|
|
374
|
-
const { id:
|
|
375
|
-
return
|
|
383
|
+
clock: l.doneData,
|
|
384
|
+
fn: (g, a) => {
|
|
385
|
+
const { id: c, bucket: d, storage: m } = a, y = g[c]?.feature.key;
|
|
386
|
+
return y ? { key: y, id: c, bucket: d, storage: m } : null;
|
|
376
387
|
},
|
|
377
|
-
target:
|
|
388
|
+
target: s
|
|
378
389
|
});
|
|
379
|
-
const
|
|
390
|
+
const p = A({ allFeaturesStore: e, resolvedFeaturesStore: r }).map(
|
|
380
391
|
({
|
|
381
|
-
allFeaturesStore:
|
|
382
|
-
resolvedFeaturesStore:
|
|
383
|
-
}) => Object.values(
|
|
384
|
-
const
|
|
385
|
-
(
|
|
392
|
+
allFeaturesStore: g,
|
|
393
|
+
resolvedFeaturesStore: a
|
|
394
|
+
}) => Object.values(g).map((c) => {
|
|
395
|
+
const d = a.find(
|
|
396
|
+
(m) => m.id === c.id && m.key === c.feature.key
|
|
386
397
|
);
|
|
387
|
-
return
|
|
388
|
-
id:
|
|
389
|
-
name:
|
|
390
|
-
key:
|
|
391
|
-
getBucket: () => ({ id:
|
|
398
|
+
return d ? {
|
|
399
|
+
id: c.id,
|
|
400
|
+
name: c.feature.name,
|
|
401
|
+
key: c.feature.key,
|
|
402
|
+
getBucket: () => ({ id: c.id, bucket: d.bucket }),
|
|
392
403
|
isResolved: !0
|
|
393
404
|
} : {
|
|
394
|
-
id:
|
|
395
|
-
name:
|
|
396
|
-
key:
|
|
397
|
-
getBucket: async () => await
|
|
405
|
+
id: c.id,
|
|
406
|
+
name: c.feature.name,
|
|
407
|
+
key: c.feature.key,
|
|
408
|
+
getBucket: async () => await l(c.feature),
|
|
398
409
|
isResolved: !1
|
|
399
410
|
};
|
|
400
411
|
})
|
|
401
412
|
);
|
|
402
|
-
|
|
403
|
-
clock:
|
|
413
|
+
v({
|
|
414
|
+
clock: l.doneData,
|
|
404
415
|
source: { resolvedFeatures: r },
|
|
405
|
-
filter: ({ resolvedFeatures:
|
|
406
|
-
(
|
|
416
|
+
filter: ({ resolvedFeatures: g }, { id: a, key: c }) => !g.some(
|
|
417
|
+
(m) => m.id === a && m.key === c
|
|
407
418
|
),
|
|
408
|
-
fn: (
|
|
409
|
-
target: t.eventBus.prepend((
|
|
419
|
+
fn: (g, a) => a,
|
|
420
|
+
target: t.eventBus.prepend((g) => ({
|
|
410
421
|
type: "feature_decide",
|
|
411
|
-
feature:
|
|
422
|
+
feature: g
|
|
412
423
|
}))
|
|
413
|
-
}),
|
|
414
|
-
clock: [
|
|
424
|
+
}), v({
|
|
425
|
+
clock: [u.doneData, l.doneData],
|
|
415
426
|
source: r,
|
|
416
|
-
fn: (
|
|
417
|
-
(
|
|
418
|
-
) ?
|
|
427
|
+
fn: (g, a) => !a || g.some(
|
|
428
|
+
(d) => d.id === a.id && d.key === a.key
|
|
429
|
+
) ? g : [...g, a],
|
|
419
430
|
target: r
|
|
420
431
|
});
|
|
421
|
-
function
|
|
422
|
-
return
|
|
432
|
+
function f(g) {
|
|
433
|
+
return p.map((a) => a.find((c) => c.id === g));
|
|
423
434
|
}
|
|
424
|
-
function
|
|
425
|
-
return e.map((
|
|
435
|
+
function h(g) {
|
|
436
|
+
return e.map((a) => a[g], { skipVoid: !1 });
|
|
426
437
|
}
|
|
427
|
-
function
|
|
428
|
-
const
|
|
438
|
+
function S(g) {
|
|
439
|
+
const a = L(
|
|
429
440
|
async () => {
|
|
430
441
|
},
|
|
431
442
|
{ skipVoid: !1 }
|
|
432
|
-
),
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
return async () => (await
|
|
443
|
+
), c = C(async () => {
|
|
444
|
+
const d = f(g).getState();
|
|
445
|
+
if (d)
|
|
446
|
+
return async () => (await d.getBucket()).bucket;
|
|
436
447
|
});
|
|
437
|
-
return
|
|
448
|
+
return v({
|
|
438
449
|
source: r,
|
|
439
|
-
filter: (
|
|
440
|
-
target:
|
|
441
|
-
}),
|
|
442
|
-
clock:
|
|
443
|
-
filter: (
|
|
444
|
-
target:
|
|
445
|
-
}),
|
|
450
|
+
filter: (d) => d.some((m) => m.id === g),
|
|
451
|
+
target: c
|
|
452
|
+
}), v({
|
|
453
|
+
clock: c.doneData,
|
|
454
|
+
filter: (d) => d !== void 0,
|
|
455
|
+
target: a
|
|
456
|
+
}), c(), a;
|
|
446
457
|
}
|
|
447
458
|
return {
|
|
448
|
-
register:
|
|
449
|
-
getById:
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
getEvokableFeature: m
|
|
459
|
+
register: i,
|
|
460
|
+
getById: f,
|
|
461
|
+
getByName: h,
|
|
462
|
+
listStore: p,
|
|
463
|
+
getEvokableFeature: S
|
|
454
464
|
};
|
|
455
465
|
});
|
|
456
466
|
function Ue(t) {
|
|
457
|
-
return
|
|
467
|
+
return b(De, t);
|
|
458
468
|
}
|
|
459
|
-
const
|
|
469
|
+
const Ne = (t, e, r) => {
|
|
460
470
|
r.register(t, e);
|
|
461
|
-
},
|
|
462
|
-
function
|
|
471
|
+
}, $ = j("history");
|
|
472
|
+
function Q(t, e) {
|
|
463
473
|
return {
|
|
464
474
|
// eslint-disable-next-line sonarjs/pseudo-random
|
|
465
|
-
id:
|
|
475
|
+
id: le(`history-entry-${Date.now()}-${Math.random()}}`),
|
|
466
476
|
node: e,
|
|
467
477
|
at: Date.now(),
|
|
468
478
|
experienceId: t
|
|
469
479
|
};
|
|
470
480
|
}
|
|
471
|
-
const
|
|
472
|
-
const t =
|
|
473
|
-
t.on(e, (
|
|
474
|
-
entries: [...
|
|
475
|
-
})), t.on(r, (
|
|
481
|
+
const Te = k(() => {
|
|
482
|
+
const t = $.store({ entries: [] }), e = $.event(), r = $.event(), n = $.event(), i = $.event();
|
|
483
|
+
t.on(e, (s, o) => ({
|
|
484
|
+
entries: [...s.entries, Q(o.experienceId, o.node)]
|
|
485
|
+
})), t.on(r, (s, o) => ({
|
|
476
486
|
entries: [
|
|
477
|
-
...
|
|
478
|
-
|
|
487
|
+
...s.entries.slice(0, -1),
|
|
488
|
+
Q(o.experienceId, o.node)
|
|
479
489
|
]
|
|
480
|
-
})), t.on(
|
|
481
|
-
function
|
|
482
|
-
const
|
|
483
|
-
for (let
|
|
484
|
-
const
|
|
485
|
-
if (!(!
|
|
486
|
-
if (
|
|
487
|
-
|
|
490
|
+
})), t.on(i, (s, o) => o);
|
|
491
|
+
function u(s, o) {
|
|
492
|
+
const l = { lastStepIndex: -1, secondLastStepIndex: -1 };
|
|
493
|
+
for (let p = s.length - 1; p >= 0; p--) {
|
|
494
|
+
const f = s[p], h = f?.node;
|
|
495
|
+
if (!(!h || !de(h)) && !(o && f?.experienceId !== o))
|
|
496
|
+
if (l.lastStepIndex === -1)
|
|
497
|
+
l.lastStepIndex = p;
|
|
488
498
|
else {
|
|
489
|
-
|
|
499
|
+
l.secondLastStepIndex = p;
|
|
490
500
|
break;
|
|
491
501
|
}
|
|
492
502
|
}
|
|
493
|
-
return
|
|
503
|
+
return l;
|
|
494
504
|
}
|
|
495
|
-
return t.on(n, (
|
|
496
|
-
const { secondLastStepIndex:
|
|
505
|
+
return t.on(n, (s, o) => {
|
|
506
|
+
const { secondLastStepIndex: l } = u(s.entries, o.experienceId), p = l !== -1 ? s.entries.slice(0, l + 1) : s.entries;
|
|
497
507
|
return {
|
|
498
|
-
...
|
|
499
|
-
entries:
|
|
508
|
+
...s,
|
|
509
|
+
entries: p
|
|
500
510
|
};
|
|
501
511
|
}), {
|
|
502
512
|
push: e,
|
|
503
513
|
replace: r,
|
|
504
514
|
back: n,
|
|
505
|
-
restore:
|
|
506
|
-
entriesStore: t.map((
|
|
515
|
+
restore: i,
|
|
516
|
+
entriesStore: t.map((s) => s.entries)
|
|
507
517
|
};
|
|
508
518
|
});
|
|
509
|
-
function
|
|
510
|
-
return
|
|
519
|
+
function Le() {
|
|
520
|
+
return b(Te);
|
|
511
521
|
}
|
|
512
|
-
let
|
|
513
|
-
const
|
|
514
|
-
const e =
|
|
515
|
-
return
|
|
522
|
+
let _e = 0;
|
|
523
|
+
const He = (t) => {
|
|
524
|
+
const e = L([]);
|
|
525
|
+
return v({
|
|
516
526
|
clock: t,
|
|
517
527
|
source: e,
|
|
518
528
|
fn: (r, n) => [
|
|
519
529
|
...r,
|
|
520
530
|
{
|
|
521
|
-
id:
|
|
531
|
+
id: _e++,
|
|
522
532
|
at: /* @__PURE__ */ new Date(),
|
|
523
533
|
payload: n
|
|
524
534
|
}
|
|
525
535
|
],
|
|
526
536
|
target: e
|
|
527
537
|
}), e;
|
|
528
|
-
},
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
(e) => typeof e == "object" && e !== null && "id" in e && "label" in e && "value" in e
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
function V(t, e) {
|
|
535
|
-
const r = Array.isArray(t.options) ? t.options : null, n = e ?? { status: "idle", options: r };
|
|
536
|
-
return {
|
|
537
|
-
...t,
|
|
538
|
-
...n,
|
|
539
|
-
options: n.options ?? r
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
const Ge = I(({ client: t }) => {
|
|
543
|
-
const e = U.store({}), r = j(e, {
|
|
544
|
-
register(s, i) {
|
|
538
|
+
}, Ge = j("field"), Je = k(() => {
|
|
539
|
+
const t = Ge.store({}), e = w(t, {
|
|
540
|
+
register(l, p) {
|
|
545
541
|
return {
|
|
546
|
-
...
|
|
547
|
-
[
|
|
542
|
+
...l,
|
|
543
|
+
[p.field.id]: p.field
|
|
548
544
|
};
|
|
549
|
-
},
|
|
550
|
-
updateById(s, i) {
|
|
551
|
-
const o = s[i.fieldId];
|
|
552
|
-
return o ? { ...s, [i.fieldId]: Object.assign({}, o, i.updates) } : s;
|
|
553
545
|
}
|
|
554
546
|
});
|
|
555
|
-
function
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
function a(s, i) {
|
|
559
|
-
r.updateById({ fieldId: s, updates: i });
|
|
547
|
+
function r(l) {
|
|
548
|
+
e.register({ field: l });
|
|
560
549
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
return E(e, l, (i, o) => {
|
|
568
|
-
const g = i[s];
|
|
569
|
-
return g ? V(g, o[s]) : null;
|
|
550
|
+
function n(l, p) {
|
|
551
|
+
const f = t.getState()[l] ?? null;
|
|
552
|
+
if (!f)
|
|
553
|
+
return;
|
|
554
|
+
const h = Object.assign({}, f, {
|
|
555
|
+
...p
|
|
570
556
|
});
|
|
557
|
+
e.register({ field: { ...h } });
|
|
571
558
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
return g ? V(g, o[g.id]) : null;
|
|
576
|
-
});
|
|
559
|
+
const i = t.map((l) => Object.values(l));
|
|
560
|
+
function u(l) {
|
|
561
|
+
return t.map((p) => p[l] ?? null);
|
|
577
562
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
...s,
|
|
603
|
-
[i]: { status: "resolved", options: o }
|
|
604
|
-
})), l.on(d.fail, (s, { params: { fieldId: i } }) => ({
|
|
605
|
-
...s,
|
|
606
|
-
[i]: { status: "error", options: null, error: "Failed to resolve field options" }
|
|
607
|
-
}));
|
|
608
|
-
const h = P();
|
|
609
|
-
l.on(h, (s, i) => ({
|
|
610
|
-
...s,
|
|
611
|
-
[i]: { status: "waiting", options: null }
|
|
612
|
-
}));
|
|
613
|
-
const y = P();
|
|
614
|
-
t && w({
|
|
615
|
-
clock: y,
|
|
616
|
-
source: {
|
|
617
|
-
states: l,
|
|
618
|
-
fields: e
|
|
619
|
-
},
|
|
620
|
-
filter: ({ states: s }, { fieldId: i, force: o }) => {
|
|
621
|
-
if (o) return !0;
|
|
622
|
-
const g = s[i];
|
|
623
|
-
return !g || g.status === "idle";
|
|
624
|
-
},
|
|
625
|
-
fn: ({ fields: s }, { fieldId: i, context: o }) => {
|
|
626
|
-
const g = s[i] ?? null;
|
|
563
|
+
function s(l) {
|
|
564
|
+
return t.map((p) => Object.values(p).find((f) => f.key === l) ?? null);
|
|
565
|
+
}
|
|
566
|
+
function o(l) {
|
|
567
|
+
return t.map((p) => Object.values(p).find((f) => f.name === l) ?? null);
|
|
568
|
+
}
|
|
569
|
+
return {
|
|
570
|
+
register: r,
|
|
571
|
+
update: n,
|
|
572
|
+
// eslint-disable-next-line sonarjs/deprecation -- returned for backwards compatibility; callers should use getByKey
|
|
573
|
+
getById: u,
|
|
574
|
+
getByKey: s,
|
|
575
|
+
listStore: i,
|
|
576
|
+
getByName: o
|
|
577
|
+
};
|
|
578
|
+
});
|
|
579
|
+
function qe() {
|
|
580
|
+
return b(Je);
|
|
581
|
+
}
|
|
582
|
+
const Ke = (t, e) => {
|
|
583
|
+
e.register(t);
|
|
584
|
+
}, We = j("step"), Ye = k(() => {
|
|
585
|
+
const t = We.store({}), e = w(t, {
|
|
586
|
+
register(u, s) {
|
|
627
587
|
return {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
context: o
|
|
588
|
+
...u,
|
|
589
|
+
[s.step.id]: s.step
|
|
631
590
|
};
|
|
632
|
-
}
|
|
633
|
-
target: d
|
|
591
|
+
}
|
|
634
592
|
});
|
|
635
|
-
function
|
|
636
|
-
|
|
593
|
+
function r(u) {
|
|
594
|
+
e.register({ step: u });
|
|
637
595
|
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
596
|
+
const n = t.map((u) => Object.values(u));
|
|
597
|
+
function i(u) {
|
|
598
|
+
return t.map((s) => s[u] ?? null);
|
|
641
599
|
}
|
|
642
600
|
return {
|
|
643
|
-
register:
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
listStore: p,
|
|
647
|
-
getByName: f,
|
|
648
|
-
resolve: m,
|
|
649
|
-
resolveAll: c,
|
|
650
|
-
setWaiting: h
|
|
601
|
+
register: r,
|
|
602
|
+
getById: i,
|
|
603
|
+
listStore: n
|
|
651
604
|
};
|
|
652
605
|
});
|
|
653
|
-
function
|
|
654
|
-
return
|
|
606
|
+
function Qe() {
|
|
607
|
+
return b(Ye);
|
|
655
608
|
}
|
|
656
|
-
|
|
609
|
+
function Xe(t, e) {
|
|
657
610
|
e.register(t);
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
|
|
611
|
+
}
|
|
612
|
+
const Ze = j("action"), et = k(() => {
|
|
613
|
+
const t = Ze.store({}), e = w(t, {
|
|
614
|
+
register(s, o) {
|
|
661
615
|
return {
|
|
662
|
-
...
|
|
663
|
-
[
|
|
664
|
-
name:
|
|
665
|
-
action:
|
|
616
|
+
...s,
|
|
617
|
+
[o.name]: {
|
|
618
|
+
name: o.name,
|
|
619
|
+
action: o.action
|
|
666
620
|
}
|
|
667
621
|
};
|
|
668
622
|
}
|
|
669
623
|
});
|
|
670
|
-
function
|
|
671
|
-
|
|
624
|
+
function r(s, o) {
|
|
625
|
+
e.register({ name: s, action: o });
|
|
672
626
|
}
|
|
673
|
-
const
|
|
674
|
-
function
|
|
675
|
-
return
|
|
627
|
+
const n = t.map((s) => Object.values(s));
|
|
628
|
+
function i(s) {
|
|
629
|
+
return t.map((o) => o[s], { skipVoid: !1 });
|
|
676
630
|
}
|
|
677
|
-
function
|
|
678
|
-
return
|
|
679
|
-
(
|
|
680
|
-
const
|
|
681
|
-
return
|
|
631
|
+
function u(s) {
|
|
632
|
+
return t.map(
|
|
633
|
+
(o) => {
|
|
634
|
+
const l = o[s];
|
|
635
|
+
return l ? l.action : void 0;
|
|
682
636
|
},
|
|
683
637
|
{ skipVoid: !1 }
|
|
684
638
|
);
|
|
685
639
|
}
|
|
686
640
|
return {
|
|
687
|
-
register:
|
|
688
|
-
getByName:
|
|
689
|
-
listStore:
|
|
690
|
-
getEvokableAction:
|
|
641
|
+
register: r,
|
|
642
|
+
getByName: i,
|
|
643
|
+
listStore: n,
|
|
644
|
+
getEvokableAction: u
|
|
691
645
|
};
|
|
692
646
|
});
|
|
693
|
-
function
|
|
694
|
-
return
|
|
647
|
+
function tt() {
|
|
648
|
+
return b(et);
|
|
695
649
|
}
|
|
696
|
-
const
|
|
650
|
+
const rt = (t, e, r) => {
|
|
697
651
|
r.register(t, e);
|
|
698
652
|
};
|
|
699
|
-
function
|
|
653
|
+
function T(t) {
|
|
700
654
|
return typeof t > "u" || t === null || t === "" || Array.isArray(t) && !t.length;
|
|
701
655
|
}
|
|
702
|
-
function
|
|
656
|
+
function nt(t) {
|
|
703
657
|
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null;
|
|
704
658
|
}
|
|
705
|
-
function
|
|
659
|
+
function X(t) {
|
|
706
660
|
try {
|
|
707
661
|
return JSON.stringify(t), !0;
|
|
708
662
|
} catch {
|
|
709
663
|
return !1;
|
|
710
664
|
}
|
|
711
665
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
666
|
+
function st(t, e) {
|
|
667
|
+
return e.find((r) => r.id === t) ?? e.find((r) => r.key === t) ?? null;
|
|
668
|
+
}
|
|
669
|
+
function it(t, e) {
|
|
670
|
+
return t.multiple && (typeof e == "string" || typeof e == "number" || typeof e == "boolean") ? [e] : e;
|
|
671
|
+
}
|
|
672
|
+
function ot(t, e, r) {
|
|
673
|
+
if (t.type !== "object" || T(r)) return null;
|
|
674
|
+
if (t.multiple) {
|
|
675
|
+
if (!Array.isArray(r))
|
|
715
676
|
return {
|
|
716
|
-
|
|
677
|
+
fieldId: e,
|
|
678
|
+
userMessage: "This field expects multiple values",
|
|
679
|
+
systemMessage: "Field expects an array of objects.",
|
|
680
|
+
value: r
|
|
681
|
+
};
|
|
682
|
+
for (const n of r) {
|
|
683
|
+
if (typeof n != "object" || n === null)
|
|
684
|
+
return {
|
|
685
|
+
fieldId: e,
|
|
686
|
+
userMessage: "This field expects object values",
|
|
687
|
+
systemMessage: "Field expects an array of objects, but received non-object value.",
|
|
688
|
+
value: r
|
|
689
|
+
};
|
|
690
|
+
if (!X(n))
|
|
691
|
+
return {
|
|
692
|
+
fieldId: e,
|
|
693
|
+
userMessage: "This field contains non-serializable data",
|
|
694
|
+
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
695
|
+
value: r
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
return null;
|
|
699
|
+
}
|
|
700
|
+
return Array.isArray(r) ? {
|
|
701
|
+
fieldId: e,
|
|
702
|
+
userMessage: "This field expects a single value",
|
|
703
|
+
systemMessage: "Field expects a single object, not an array.",
|
|
704
|
+
value: r
|
|
705
|
+
} : typeof r != "object" || r === null ? {
|
|
706
|
+
fieldId: e,
|
|
707
|
+
userMessage: "This field expects an object value",
|
|
708
|
+
systemMessage: "Field expects an object value.",
|
|
709
|
+
value: r
|
|
710
|
+
} : X(r) ? null : {
|
|
711
|
+
fieldId: e,
|
|
712
|
+
userMessage: "This field contains non-serializable data",
|
|
713
|
+
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
714
|
+
value: r
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
function at(t, e, r) {
|
|
718
|
+
if (!Array.isArray(t.options) || t.options.length === 0) return null;
|
|
719
|
+
const n = Array.isArray(r) ? r : [r];
|
|
720
|
+
if (t.type === "object") {
|
|
721
|
+
const s = t.options.map((l) => JSON.stringify(l.value));
|
|
722
|
+
return n.every((l) => s.includes(JSON.stringify(l))) ? null : {
|
|
723
|
+
fieldId: e,
|
|
724
|
+
userMessage: "This field expects a valid option",
|
|
725
|
+
systemMessage: "Field expects a valid option from the defined choices.",
|
|
726
|
+
value: r
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
const i = t.options.map((s) => s.value);
|
|
730
|
+
return n.every((s) => !nt(s) || s === null ? !1 : i.includes(s)) ? null : {
|
|
731
|
+
fieldId: e,
|
|
732
|
+
userMessage: "This field expects a valid option",
|
|
733
|
+
systemMessage: `Field expects a valid option. Valid options are: ${i.join(", ")}`,
|
|
734
|
+
value: r
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
const ct = j("response"), ut = k(({ client: t }) => {
|
|
738
|
+
const e = ct.store({}), r = D(), n = D(), i = w(e, {
|
|
739
|
+
register(a, c) {
|
|
740
|
+
return {
|
|
741
|
+
...a,
|
|
717
742
|
[c.fieldId]: c.response
|
|
718
743
|
};
|
|
719
744
|
},
|
|
720
|
-
registerBatch(
|
|
745
|
+
registerBatch(a, c) {
|
|
721
746
|
return {
|
|
722
|
-
...
|
|
747
|
+
...a,
|
|
723
748
|
...c
|
|
724
749
|
};
|
|
725
750
|
},
|
|
726
|
-
clear(
|
|
727
|
-
|
|
728
|
-
return i;
|
|
751
|
+
clear(a, c) {
|
|
752
|
+
return Object.fromEntries(Object.entries(a).filter(([d]) => d !== c));
|
|
729
753
|
},
|
|
730
754
|
clearAll() {
|
|
731
755
|
return {};
|
|
732
756
|
}
|
|
733
757
|
});
|
|
734
|
-
function
|
|
735
|
-
if (typeof
|
|
758
|
+
function u(a, c) {
|
|
759
|
+
if (typeof a == "string") {
|
|
736
760
|
if (c === void 0)
|
|
737
761
|
throw new Error("Response is required when registering a single field");
|
|
738
|
-
|
|
762
|
+
i.register({ fieldId: a, response: c });
|
|
739
763
|
} else
|
|
740
|
-
|
|
764
|
+
i.registerBatch(a);
|
|
741
765
|
}
|
|
742
|
-
async function
|
|
743
|
-
|
|
766
|
+
async function s(a, c, d) {
|
|
767
|
+
if (a.validation && !fe(a.validation) && !T(d)) {
|
|
768
|
+
const m = await _(t, a.validation, { $input: d });
|
|
769
|
+
if (typeof m == "string")
|
|
770
|
+
return {
|
|
771
|
+
fieldId: c,
|
|
772
|
+
userMessage: m,
|
|
773
|
+
systemMessage: `Field validation resulted in an error: ${m}.`,
|
|
774
|
+
value: d
|
|
775
|
+
};
|
|
776
|
+
if (m === !1)
|
|
777
|
+
return {
|
|
778
|
+
fieldId: c,
|
|
779
|
+
userMessage: "This field is invalid",
|
|
780
|
+
systemMessage: "Field validation resulted in an unspecified error.",
|
|
781
|
+
value: d
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
return a.required && T(d) ? {
|
|
785
|
+
fieldId: c,
|
|
786
|
+
userMessage: "This field is required",
|
|
787
|
+
systemMessage: "Field is required.",
|
|
788
|
+
value: d
|
|
789
|
+
} : !a.multiple && Array.isArray(d) && d.length > 1 ? {
|
|
790
|
+
fieldId: c,
|
|
791
|
+
userMessage: "This field expects a single response",
|
|
792
|
+
systemMessage: "Field expects a single response.",
|
|
793
|
+
value: d
|
|
794
|
+
} : null;
|
|
795
|
+
}
|
|
796
|
+
async function o(a) {
|
|
797
|
+
const c = [], d = {}, m = t.fields.listStore.getState();
|
|
744
798
|
return await Promise.allSettled(
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
const g = t.fields.getById(s).getState();
|
|
749
|
-
if (!g) {
|
|
799
|
+
Object.entries(a).map(async ([y, I]) => {
|
|
800
|
+
const E = st(y, m);
|
|
801
|
+
if (!E) {
|
|
750
802
|
c.push({
|
|
751
|
-
fieldId:
|
|
752
|
-
userMessage: `Field '${
|
|
753
|
-
systemMessage: `No field with ID '${
|
|
754
|
-
value:
|
|
803
|
+
fieldId: y,
|
|
804
|
+
userMessage: `Field '${y}' not found`,
|
|
805
|
+
systemMessage: `No field with ID or key '${y}' exists. Available field IDs are: ${m.map((re) => re.id).join(",")}.`,
|
|
806
|
+
value: I
|
|
755
807
|
});
|
|
756
808
|
return;
|
|
757
809
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
responses: v
|
|
762
|
-
});
|
|
763
|
-
if (typeof S == "string") {
|
|
764
|
-
c.push({
|
|
765
|
-
fieldId: s,
|
|
766
|
-
userMessage: S,
|
|
767
|
-
systemMessage: `Field validation resulted in an error: ${S}.`,
|
|
768
|
-
value: o
|
|
769
|
-
});
|
|
770
|
-
return;
|
|
771
|
-
}
|
|
772
|
-
if (S === !1) {
|
|
773
|
-
c.push({
|
|
774
|
-
fieldId: s,
|
|
775
|
-
userMessage: "This field is invalid",
|
|
776
|
-
systemMessage: "Field validation resulted in an unspecified error.",
|
|
777
|
-
value: o
|
|
778
|
-
});
|
|
779
|
-
return;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
if (g.required && N(o)) {
|
|
783
|
-
c.push({
|
|
784
|
-
fieldId: s,
|
|
785
|
-
userMessage: "This field is required",
|
|
786
|
-
systemMessage: "Field is required.",
|
|
787
|
-
value: o
|
|
788
|
-
});
|
|
810
|
+
const x = E.id, B = it(E, I), P = await s(E, x, B);
|
|
811
|
+
if (P) {
|
|
812
|
+
c.push(P);
|
|
789
813
|
return;
|
|
790
814
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
userMessage: "This field expects a single response",
|
|
795
|
-
systemMessage: "Field expects a single response.",
|
|
796
|
-
value: o
|
|
797
|
-
});
|
|
815
|
+
const J = ot(E, x, B);
|
|
816
|
+
if (J) {
|
|
817
|
+
c.push(J);
|
|
798
818
|
return;
|
|
799
819
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
if (!Array.isArray(o)) {
|
|
803
|
-
c.push({
|
|
804
|
-
fieldId: s,
|
|
805
|
-
userMessage: "This field expects multiple values",
|
|
806
|
-
systemMessage: "Field expects an array of objects.",
|
|
807
|
-
value: o
|
|
808
|
-
});
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
811
|
-
for (const v of o) {
|
|
812
|
-
if (typeof v != "object" || v === null) {
|
|
813
|
-
c.push({
|
|
814
|
-
fieldId: s,
|
|
815
|
-
userMessage: "This field expects object values",
|
|
816
|
-
systemMessage: "Field expects an array of objects, but received non-object value.",
|
|
817
|
-
value: o
|
|
818
|
-
});
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
if (!Y(v)) {
|
|
822
|
-
c.push({
|
|
823
|
-
fieldId: s,
|
|
824
|
-
userMessage: "This field contains non-serializable data",
|
|
825
|
-
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
826
|
-
value: o
|
|
827
|
-
});
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
} else {
|
|
832
|
-
if (Array.isArray(o)) {
|
|
833
|
-
c.push({
|
|
834
|
-
fieldId: s,
|
|
835
|
-
userMessage: "This field expects a single value",
|
|
836
|
-
systemMessage: "Field expects a single object, not an array.",
|
|
837
|
-
value: o
|
|
838
|
-
});
|
|
839
|
-
return;
|
|
840
|
-
}
|
|
841
|
-
if (typeof o != "object" || o === null) {
|
|
842
|
-
c.push({
|
|
843
|
-
fieldId: s,
|
|
844
|
-
userMessage: "This field expects an object value",
|
|
845
|
-
systemMessage: "Field expects an object value.",
|
|
846
|
-
value: o
|
|
847
|
-
});
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
if (!Y(o)) {
|
|
851
|
-
c.push({
|
|
852
|
-
fieldId: s,
|
|
853
|
-
userMessage: "This field contains non-serializable data",
|
|
854
|
-
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
855
|
-
value: o
|
|
856
|
-
});
|
|
857
|
-
return;
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
if (Array.isArray(g.options) && g.options.length > 0) {
|
|
861
|
-
const v = Array.isArray(o) ? o : [o];
|
|
862
|
-
if (g.type === "object") {
|
|
863
|
-
const S = g.options.map((k) => JSON.stringify(k.value));
|
|
864
|
-
v.every((k) => S.includes(JSON.stringify(k))) || c.push({
|
|
865
|
-
fieldId: s,
|
|
866
|
-
userMessage: "This field expects a valid option",
|
|
867
|
-
systemMessage: "Field expects a valid option from the defined choices.",
|
|
868
|
-
value: o
|
|
869
|
-
});
|
|
870
|
-
} else {
|
|
871
|
-
const S = g.options.map((k) => k.value);
|
|
872
|
-
v.every((k) => !Xe(k) || k === null ? !1 : S.includes(k)) || c.push({
|
|
873
|
-
fieldId: s,
|
|
874
|
-
userMessage: "This field expects a valid option",
|
|
875
|
-
systemMessage: `Field expects a valid option. Valid options are: ${S.join(", ")}`,
|
|
876
|
-
value: o
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
}
|
|
820
|
+
const q = at(E, x, B);
|
|
821
|
+
q && c.push(q), d[x] = I;
|
|
880
822
|
})
|
|
881
|
-
), { responsesToCommit:
|
|
823
|
+
), { responsesToCommit: d, validationErrors: c };
|
|
882
824
|
}
|
|
883
|
-
async function
|
|
884
|
-
const { responsesToCommit: c, validationErrors:
|
|
885
|
-
return
|
|
825
|
+
async function l(a) {
|
|
826
|
+
const { responsesToCommit: c, validationErrors: d } = await o(a);
|
|
827
|
+
return d.length ? { errors: d } : (i.registerBatch(c), { errors: [] });
|
|
886
828
|
}
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
829
|
+
const p = e.map((a) => a), f = A(
|
|
830
|
+
{ responses: e, fields: t.fields.listStore },
|
|
831
|
+
({ responses: a, fields: c }) => Object.entries(a).map(([d, m]) => {
|
|
832
|
+
const y = c.find((I) => I.id === d);
|
|
833
|
+
return {
|
|
834
|
+
fieldId: d,
|
|
835
|
+
fieldKey: y?.key ?? d,
|
|
836
|
+
value: m
|
|
837
|
+
};
|
|
838
|
+
})
|
|
839
|
+
);
|
|
840
|
+
function h(a) {
|
|
841
|
+
const c = t.fields.listStore.map(
|
|
842
|
+
(m) => m.find((y) => y.id === a) ?? null
|
|
843
|
+
), d = e.map((m) => m[a] ?? null);
|
|
844
|
+
return A({ f: c, r: d }, ({ f: m, r: y }) => y !== null ? y : m?.defaultValue ? m.defaultValue : null);
|
|
845
|
+
}
|
|
846
|
+
function S(a) {
|
|
847
|
+
const c = t.fields.getByKey(a);
|
|
848
|
+
return A({ f: c, s: e }, ({ f: d, s: m }) => {
|
|
849
|
+
const y = d ? m[d.id] ?? null : null;
|
|
850
|
+
return y || (d?.defaultValue ? d.defaultValue : null);
|
|
851
|
+
});
|
|
894
852
|
}
|
|
895
|
-
function
|
|
896
|
-
const c = t.fields.getByName(
|
|
897
|
-
return
|
|
898
|
-
const
|
|
899
|
-
return
|
|
853
|
+
function g(a) {
|
|
854
|
+
const c = t.fields.getByName(a);
|
|
855
|
+
return A({ f: c, s: e }, ({ f: d, s: m }) => {
|
|
856
|
+
const y = d && m[d.id] || null;
|
|
857
|
+
return y || (d?.defaultValue ? d.defaultValue : null);
|
|
900
858
|
});
|
|
901
859
|
}
|
|
902
|
-
return
|
|
860
|
+
return v({
|
|
903
861
|
clock: r,
|
|
904
|
-
target:
|
|
905
|
-
}),
|
|
862
|
+
target: i.clearAll
|
|
863
|
+
}), v({
|
|
906
864
|
clock: n,
|
|
907
|
-
target:
|
|
865
|
+
target: i.clear
|
|
908
866
|
}), {
|
|
909
|
-
register:
|
|
867
|
+
register: u,
|
|
910
868
|
clearAll: r,
|
|
911
869
|
clear: n,
|
|
912
|
-
commit:
|
|
913
|
-
getResponsesToCommit:
|
|
914
|
-
listStore:
|
|
915
|
-
getAllStore:
|
|
870
|
+
commit: l,
|
|
871
|
+
getResponsesToCommit: o,
|
|
872
|
+
listStore: f,
|
|
873
|
+
getAllStore: p,
|
|
874
|
+
// eslint-disable-next-line sonarjs/deprecation -- returned for backwards compatibility; callers should use getByFieldKey
|
|
916
875
|
getByFieldId: h,
|
|
917
|
-
|
|
876
|
+
getByFieldKey: S,
|
|
877
|
+
getByFieldName: g
|
|
878
|
+
};
|
|
879
|
+
});
|
|
880
|
+
function dt(t) {
|
|
881
|
+
return b(ut, t);
|
|
882
|
+
}
|
|
883
|
+
const lt = j("condition"), ft = k(() => {
|
|
884
|
+
const t = lt.store({}), e = w(t, {
|
|
885
|
+
register(s, o) {
|
|
886
|
+
return {
|
|
887
|
+
...s,
|
|
888
|
+
[o.condition.id]: o.condition
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
function r(s) {
|
|
893
|
+
e.register({ condition: s });
|
|
894
|
+
}
|
|
895
|
+
const n = t.map((s) => Object.values(s));
|
|
896
|
+
function i(s) {
|
|
897
|
+
return t.map((o) => o[s] ?? null);
|
|
898
|
+
}
|
|
899
|
+
function u(s) {
|
|
900
|
+
return t.map((o) => Object.values(o).find((l) => l.key === s) ?? null);
|
|
901
|
+
}
|
|
902
|
+
return {
|
|
903
|
+
register: r,
|
|
904
|
+
getById: i,
|
|
905
|
+
getByKey: u,
|
|
906
|
+
listStore: n
|
|
918
907
|
};
|
|
919
908
|
});
|
|
920
|
-
function
|
|
921
|
-
return
|
|
909
|
+
function pt() {
|
|
910
|
+
return b(ft);
|
|
922
911
|
}
|
|
923
|
-
function
|
|
912
|
+
function gt() {
|
|
924
913
|
if (H()) {
|
|
925
914
|
const t = [
|
|
926
915
|
document.currentScript,
|
|
@@ -935,69 +924,69 @@ function rt() {
|
|
|
935
924
|
}
|
|
936
925
|
return "https://api.picked.app";
|
|
937
926
|
}
|
|
938
|
-
function
|
|
927
|
+
function mt() {
|
|
939
928
|
if (!G())
|
|
940
929
|
return {};
|
|
941
930
|
const t = new URLSearchParams(window.location.search), e = {}, r = /* @__PURE__ */ new Set();
|
|
942
|
-
for (const [
|
|
943
|
-
|
|
944
|
-
for (const
|
|
945
|
-
const
|
|
946
|
-
e[
|
|
931
|
+
for (const [i] of t.entries())
|
|
932
|
+
i.startsWith("picked-") && r.add(i);
|
|
933
|
+
for (const i of r) {
|
|
934
|
+
const u = i.replace("picked-", "");
|
|
935
|
+
e[u] = t.getAll(i);
|
|
947
936
|
}
|
|
948
|
-
const n =
|
|
937
|
+
const n = z("s");
|
|
949
938
|
if (r.size > 0)
|
|
950
|
-
|
|
939
|
+
M.set(n, e);
|
|
951
940
|
else {
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
954
|
-
return
|
|
941
|
+
const i = M.get(n);
|
|
942
|
+
if (i)
|
|
943
|
+
return i.json() || {};
|
|
955
944
|
}
|
|
956
945
|
return e;
|
|
957
946
|
}
|
|
958
|
-
function
|
|
959
|
-
if (
|
|
947
|
+
function yt() {
|
|
948
|
+
if (ge())
|
|
960
949
|
return crypto.randomUUID();
|
|
961
950
|
const t = Date.now().toString(36), e = Math.random().toString(36).substring(2, 15), r = Math.random().toString(36).substring(2, 15), n = Math.random().toString(36).substring(2, 15);
|
|
962
951
|
return `${t}-${e}-${r}-${n}`;
|
|
963
952
|
}
|
|
964
|
-
const
|
|
965
|
-
const t =
|
|
953
|
+
const ht = z("session", "global"), St = () => {
|
|
954
|
+
const t = R.get(ht);
|
|
966
955
|
let e;
|
|
967
956
|
t.isSet() && (e = t.json());
|
|
968
|
-
const r = (
|
|
969
|
-
id:
|
|
970
|
-
isUser:
|
|
971
|
-
identifiers:
|
|
957
|
+
const r = (i) => t.set({
|
|
958
|
+
id: i.id,
|
|
959
|
+
isUser: i.isUser,
|
|
960
|
+
identifiers: i.identifiers
|
|
972
961
|
}), n = {
|
|
973
|
-
id: e?.id ??
|
|
962
|
+
id: e?.id ?? yt(),
|
|
974
963
|
isUser: e?.isUser ?? void 0,
|
|
975
964
|
identifiers: e?.identifiers ?? void 0,
|
|
976
|
-
setIsUser(
|
|
977
|
-
this.isUser =
|
|
965
|
+
setIsUser(i) {
|
|
966
|
+
this.isUser = i, r(this);
|
|
978
967
|
},
|
|
979
|
-
setIdentifier(
|
|
980
|
-
this.identifiers = { ...this.identifiers, [
|
|
968
|
+
setIdentifier(i, u) {
|
|
969
|
+
this.identifiers = { ...this.identifiers, [i]: u }, r(this);
|
|
981
970
|
},
|
|
982
|
-
removeIdentifier(
|
|
971
|
+
removeIdentifier(i) {
|
|
983
972
|
this.identifiers && (this.identifiers = Object.fromEntries(
|
|
984
|
-
Object.entries(this.identifiers).filter(([
|
|
973
|
+
Object.entries(this.identifiers).filter(([u]) => u !== i)
|
|
985
974
|
), this.identifiers = Object.keys(this.identifiers).length ? this.identifiers : void 0, r(this));
|
|
986
975
|
}
|
|
987
976
|
};
|
|
988
977
|
return r(n), n;
|
|
989
|
-
},
|
|
990
|
-
function
|
|
978
|
+
}, kt = () => pe() ? St() : null;
|
|
979
|
+
function bt() {
|
|
991
980
|
if (G())
|
|
992
981
|
return globalThis.window.pickedConfig;
|
|
993
982
|
}
|
|
994
|
-
function
|
|
983
|
+
function wt() {
|
|
995
984
|
if (!G())
|
|
996
985
|
return;
|
|
997
|
-
const t =
|
|
986
|
+
const t = bt(), e = t?.organizationId, r = t?.projectId;
|
|
998
987
|
return e && r ? { organizationId: e, projectId: r } : void 0;
|
|
999
988
|
}
|
|
1000
|
-
function
|
|
989
|
+
function It() {
|
|
1001
990
|
if (!H())
|
|
1002
991
|
return;
|
|
1003
992
|
const t = document.getElementById("picked_script") || document.querySelector("script#picked") || // legacy support for 'cvly' script tag
|
|
@@ -1007,16 +996,16 @@ function dt() {
|
|
|
1007
996
|
const e = t.dataset.organizationid || t.getAttribute("organization-id"), r = t.dataset.projectid || t.getAttribute("project-id");
|
|
1008
997
|
return e && r ? { organizationId: e, projectId: r } : void 0;
|
|
1009
998
|
}
|
|
1010
|
-
function
|
|
999
|
+
function vt(t) {
|
|
1011
1000
|
const { organizationId: e, projectId: r } = t;
|
|
1012
1001
|
if (e && r)
|
|
1013
1002
|
return { organizationId: e, projectId: r };
|
|
1014
|
-
const n =
|
|
1003
|
+
const n = wt();
|
|
1015
1004
|
if (n)
|
|
1016
1005
|
return n;
|
|
1017
|
-
const
|
|
1018
|
-
if (
|
|
1019
|
-
return
|
|
1006
|
+
const i = It();
|
|
1007
|
+
if (i)
|
|
1008
|
+
return i;
|
|
1020
1009
|
throw new Error(
|
|
1021
1010
|
`organizationId and projectId are required. You can provide them via one of:
|
|
1022
1011
|
(1) createClient({ organizationId, projectId }) options;
|
|
@@ -1024,13 +1013,13 @@ function lt(t) {
|
|
|
1024
1013
|
(3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes data-organizationid/data-projectid (or organization-id/project-id) attributes.`
|
|
1025
1014
|
);
|
|
1026
1015
|
}
|
|
1027
|
-
function
|
|
1016
|
+
function O(t) {
|
|
1028
1017
|
return t == null || t === "" || Number.isNaN(t);
|
|
1029
1018
|
}
|
|
1030
|
-
const
|
|
1031
|
-
default: (t, e) =>
|
|
1032
|
-
append: (t, e) => e && !
|
|
1033
|
-
prepend: (t, e) => e && !
|
|
1019
|
+
const Ft = {
|
|
1020
|
+
default: (t, e) => O(t) ? String(e ?? "") : String(t),
|
|
1021
|
+
append: (t, e) => e && !O(t) ? `${t} ${e}` : t,
|
|
1022
|
+
prepend: (t, e) => e && !O(t) ? `${e} ${t}` : t,
|
|
1034
1023
|
upper: (t) => typeof t == "string" ? t.toUpperCase() : t,
|
|
1035
1024
|
lower: (t) => typeof t == "string" ? t.toLowerCase() : t,
|
|
1036
1025
|
capitalize: (t) => typeof t == "string" ? t.charAt(0).toUpperCase() + t.slice(1) : t,
|
|
@@ -1041,59 +1030,59 @@ const pt = {
|
|
|
1041
1030
|
if (Array.isArray(t))
|
|
1042
1031
|
return e.format(t.map(String));
|
|
1043
1032
|
if (t instanceof Map) {
|
|
1044
|
-
const r = Array.from(t.entries()).map(([n,
|
|
1033
|
+
const r = Array.from(t.entries()).map(([n, i]) => `${n}: ${i}`);
|
|
1045
1034
|
return e.format(r);
|
|
1046
1035
|
}
|
|
1047
1036
|
return t instanceof Set ? e.format(Array.from(t).map(String)) : t;
|
|
1048
1037
|
}
|
|
1049
1038
|
};
|
|
1050
|
-
function
|
|
1039
|
+
function jt(t) {
|
|
1051
1040
|
return typeof t == "object" && t !== null;
|
|
1052
1041
|
}
|
|
1053
|
-
function
|
|
1042
|
+
function Et(t, e) {
|
|
1054
1043
|
let r = e;
|
|
1055
1044
|
for (const n of t.split("."))
|
|
1056
|
-
if (
|
|
1045
|
+
if (jt(r) && n in r)
|
|
1057
1046
|
r = r[n];
|
|
1058
1047
|
else
|
|
1059
1048
|
return;
|
|
1060
1049
|
return typeof r == "function" ? r() : r;
|
|
1061
1050
|
}
|
|
1062
|
-
function
|
|
1063
|
-
const r = t.split("|").map((
|
|
1064
|
-
let
|
|
1065
|
-
for (const
|
|
1066
|
-
const [
|
|
1067
|
-
|
|
1051
|
+
function xt(t, e) {
|
|
1052
|
+
const r = t.split("|").map((u) => u.trim()), n = r.shift() ?? "";
|
|
1053
|
+
let i = Et(n, e);
|
|
1054
|
+
for (const u of r) {
|
|
1055
|
+
const [s, ...o] = u.split(":"), l = s?.trim() ?? "", p = o.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), f = Ft[l];
|
|
1056
|
+
f && (i = f(i, p));
|
|
1068
1057
|
}
|
|
1069
|
-
return
|
|
1058
|
+
return O(i) ? "" : typeof i == "object" ? JSON.stringify(i) : String(i);
|
|
1070
1059
|
}
|
|
1071
|
-
function
|
|
1060
|
+
function Pt(t, e) {
|
|
1072
1061
|
let r = "", n = 0;
|
|
1073
1062
|
for (; n < t.length; )
|
|
1074
1063
|
if (t[n] === "{" && t[n + 1] === "{") {
|
|
1075
1064
|
n += 2;
|
|
1076
|
-
let
|
|
1065
|
+
let i = "";
|
|
1077
1066
|
for (; n < t.length; ) {
|
|
1078
1067
|
if (t[n] === "}" && t[n + 1] === "}") {
|
|
1079
1068
|
n += 2;
|
|
1080
1069
|
break;
|
|
1081
1070
|
}
|
|
1082
|
-
|
|
1071
|
+
i += t[n++];
|
|
1083
1072
|
}
|
|
1084
|
-
r +=
|
|
1073
|
+
r += xt(i.trim(), e);
|
|
1085
1074
|
} else
|
|
1086
1075
|
r += t[n++];
|
|
1087
1076
|
return r;
|
|
1088
1077
|
}
|
|
1089
|
-
class
|
|
1090
|
-
static logger =
|
|
1078
|
+
class At {
|
|
1079
|
+
static logger = F;
|
|
1091
1080
|
options;
|
|
1092
1081
|
isReady = !1;
|
|
1093
1082
|
project;
|
|
1094
1083
|
plugins = {};
|
|
1095
1084
|
pluginStartHooks = [];
|
|
1096
|
-
eventBus =
|
|
1085
|
+
eventBus = D();
|
|
1097
1086
|
events;
|
|
1098
1087
|
organizationId;
|
|
1099
1088
|
projectId;
|
|
@@ -1104,24 +1093,26 @@ class yt {
|
|
|
1104
1093
|
precondition;
|
|
1105
1094
|
condition;
|
|
1106
1095
|
preconditionPassed;
|
|
1107
|
-
searchParams =
|
|
1108
|
-
history =
|
|
1109
|
-
components =
|
|
1096
|
+
searchParams = mt();
|
|
1097
|
+
history = Le();
|
|
1098
|
+
components = Ee({ client: this });
|
|
1110
1099
|
experienceInstances = oe({ client: this });
|
|
1111
|
-
experiences =
|
|
1100
|
+
experiences = ke({ client: this });
|
|
1112
1101
|
frameworks = Ae({ client: this });
|
|
1113
1102
|
predicates = Me({ client: this });
|
|
1114
1103
|
features = Ue({ client: this });
|
|
1115
|
-
|
|
1116
|
-
fields =
|
|
1117
|
-
|
|
1104
|
+
conditions = pt();
|
|
1105
|
+
fields = qe();
|
|
1106
|
+
responses = dt({ client: this });
|
|
1107
|
+
steps = Qe();
|
|
1108
|
+
actions = tt();
|
|
1118
1109
|
constructor(e) {
|
|
1119
|
-
|
|
1120
|
-
const { organizationId: r, projectId: n } =
|
|
1121
|
-
this.organizationId = r, this.projectId = n, this.options = Object.freeze(e), this.apiUrl = e.apiUrl ||
|
|
1110
|
+
F("info", "Picked client initializing."), this.events = He(this.eventBus);
|
|
1111
|
+
const { organizationId: r, projectId: n } = vt(e);
|
|
1112
|
+
this.organizationId = r, this.projectId = n, this.options = Object.freeze(e), this.apiUrl = e.apiUrl || gt(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.session = kt(), this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.precondition = e.precondition, this.condition = e.condition, this.eventBus({ type: "load", version: ue() }), F("info", "Picked client initialized.");
|
|
1122
1113
|
}
|
|
1123
1114
|
start = () => {
|
|
1124
|
-
|
|
1115
|
+
Ce(this), (async () => {
|
|
1125
1116
|
if (!H())
|
|
1126
1117
|
return;
|
|
1127
1118
|
await this.runPluginStartHooks();
|
|
@@ -1129,44 +1120,50 @@ class yt {
|
|
|
1129
1120
|
this.preconditionPassed = r;
|
|
1130
1121
|
let n;
|
|
1131
1122
|
r && (n = await this.evaluateGate(this.condition));
|
|
1132
|
-
const
|
|
1123
|
+
const i = r && n === !0;
|
|
1133
1124
|
if (typeof n == "boolean" && this.session) {
|
|
1134
|
-
const
|
|
1135
|
-
this.session.setIsUser(
|
|
1125
|
+
const u = n;
|
|
1126
|
+
this.session.setIsUser(u), this.eventBus({ type: "user_decide", value: u });
|
|
1136
1127
|
}
|
|
1137
|
-
if (this.eventBus({ type: "initialize" }),
|
|
1138
|
-
const { id:
|
|
1139
|
-
this.eventBus({ type: "session", id:
|
|
1128
|
+
if (this.eventBus({ type: "initialize" }), i && K(this), await ae(), i && K(this), this.eventBus({ type: "ready" }), this.isReady = !0, this.session) {
|
|
1129
|
+
const { id: u, isUser: s, identifiers: o } = this.session;
|
|
1130
|
+
this.eventBus({ type: "session", id: u, isUser: s, identifiers: o });
|
|
1140
1131
|
}
|
|
1141
1132
|
})();
|
|
1142
1133
|
};
|
|
1143
1134
|
registerFramework = (e) => {
|
|
1144
|
-
|
|
1135
|
+
Be(e, this.frameworks);
|
|
1145
1136
|
};
|
|
1146
1137
|
registerComponent = (e, r) => {
|
|
1147
|
-
|
|
1138
|
+
W(e, r, this.components);
|
|
1148
1139
|
};
|
|
1149
1140
|
registerPlugin = (e) => {
|
|
1150
|
-
|
|
1141
|
+
we(this, e, this.plugins);
|
|
1151
1142
|
const r = this.plugins[e.name];
|
|
1152
1143
|
r?.onStart && this.pluginStartHooks.push(r.onStart);
|
|
1153
1144
|
};
|
|
1154
1145
|
registerFeature = (e, r) => {
|
|
1155
|
-
|
|
1146
|
+
Ne(e, r, this.features);
|
|
1156
1147
|
};
|
|
1157
1148
|
registerPredicate = (e, r) => {
|
|
1158
|
-
|
|
1149
|
+
Ve(e, r, this.predicates);
|
|
1150
|
+
};
|
|
1151
|
+
registerCondition = (e) => {
|
|
1152
|
+
this.conditions.register(e);
|
|
1159
1153
|
};
|
|
1160
1154
|
registerField = (e) => {
|
|
1161
|
-
|
|
1155
|
+
Ke(e, this.fields);
|
|
1156
|
+
};
|
|
1157
|
+
registerStep = (e) => {
|
|
1158
|
+
Xe(e, this.steps);
|
|
1162
1159
|
};
|
|
1163
1160
|
registerAction = (e, r) => {
|
|
1164
|
-
|
|
1161
|
+
rt(e, r, this.actions);
|
|
1165
1162
|
};
|
|
1166
1163
|
registerExperience = (e) => {
|
|
1167
|
-
e.component &&
|
|
1164
|
+
e.component && W(`experience:${e.id}`, e.component, this.components), be(e, this.experiences);
|
|
1168
1165
|
};
|
|
1169
|
-
getStateSnapshot = () =>
|
|
1166
|
+
getStateSnapshot = () => te(this);
|
|
1170
1167
|
/** @deprecated Use `client.experiences.launch({ id: experienceId })` instead. */
|
|
1171
1168
|
launchExperienceById = async (e, r) => {
|
|
1172
1169
|
this.experiences.launch({ id: e, options: r });
|
|
@@ -1180,7 +1177,7 @@ class yt {
|
|
|
1180
1177
|
await e();
|
|
1181
1178
|
}
|
|
1182
1179
|
async evaluateGate(e) {
|
|
1183
|
-
return e === void 0 ? !0 : typeof e == "boolean" ? e : await
|
|
1180
|
+
return e === void 0 ? !0 : typeof e == "boolean" ? e : await _(this, e) === !0;
|
|
1184
1181
|
}
|
|
1185
1182
|
setupPlugins() {
|
|
1186
1183
|
this.options.plugins?.forEach((e) => {
|
|
@@ -1201,20 +1198,20 @@ class yt {
|
|
|
1201
1198
|
setupFeatures() {
|
|
1202
1199
|
const e = this.options.features;
|
|
1203
1200
|
e && (Object.entries(e).forEach(([r, n]) => {
|
|
1204
|
-
const
|
|
1205
|
-
this.registerFeature(r,
|
|
1201
|
+
const i = typeof n == "function" ? n() : n;
|
|
1202
|
+
this.registerFeature(r, i);
|
|
1206
1203
|
}), this.searchParams.feature && this.searchParams.feature.forEach((r) => {
|
|
1207
1204
|
try {
|
|
1208
|
-
const [n,
|
|
1209
|
-
if (!n || !
|
|
1205
|
+
const [n, i] = r.split(":");
|
|
1206
|
+
if (!n || !i)
|
|
1210
1207
|
return;
|
|
1211
|
-
let
|
|
1212
|
-
|
|
1213
|
-
key: `${
|
|
1208
|
+
let u = i;
|
|
1209
|
+
u === "true" && (u = !0), u === "false" && (u = !1), this.registerFeature(n, {
|
|
1210
|
+
key: `${u}`,
|
|
1214
1211
|
// use the assigned bucket value as the key
|
|
1215
1212
|
name: n,
|
|
1216
|
-
// eslint-disable-next-line sonarjs/function-return-type
|
|
1217
|
-
decide: () =>
|
|
1213
|
+
// eslint-disable-next-line sonarjs/function-return-type -- feature decide returns either string bucket or boolean; union return is intentional
|
|
1214
|
+
decide: () => u,
|
|
1218
1215
|
storage: "session"
|
|
1219
1216
|
});
|
|
1220
1217
|
} catch {
|
|
@@ -1225,7 +1222,7 @@ class yt {
|
|
|
1225
1222
|
const e = this.options.predicates;
|
|
1226
1223
|
e && Object.entries(e).forEach(([r, n]) => {
|
|
1227
1224
|
if (typeof n != "function") {
|
|
1228
|
-
|
|
1225
|
+
F("warn", `Predicate "${r}" is not a function.`);
|
|
1229
1226
|
return;
|
|
1230
1227
|
}
|
|
1231
1228
|
this.registerPredicate(r, n);
|
|
@@ -1235,7 +1232,7 @@ class yt {
|
|
|
1235
1232
|
const e = this.options.actions;
|
|
1236
1233
|
e && Object.entries(e).forEach(([r, n]) => {
|
|
1237
1234
|
if (typeof n != "function") {
|
|
1238
|
-
|
|
1235
|
+
F("warn", `Action "${r}" is not a function.`);
|
|
1239
1236
|
return;
|
|
1240
1237
|
}
|
|
1241
1238
|
this.registerAction(r, n);
|
|
@@ -1291,47 +1288,47 @@ class yt {
|
|
|
1291
1288
|
* // => "Fruits: apple, banana, and cherry"
|
|
1292
1289
|
*/
|
|
1293
1290
|
renderString = (e, r) => {
|
|
1294
|
-
const n = this.responses.listStore.getState().reduce((
|
|
1295
|
-
return
|
|
1291
|
+
const n = this.responses.listStore.getState().reduce((i, u) => (i[u.fieldId] = u.value, i), {});
|
|
1292
|
+
return Pt(e, {
|
|
1296
1293
|
...r,
|
|
1297
1294
|
responses: n
|
|
1298
1295
|
});
|
|
1299
1296
|
};
|
|
1300
1297
|
}
|
|
1301
|
-
function
|
|
1298
|
+
function Nt(t) {
|
|
1302
1299
|
return {
|
|
1303
1300
|
$$type: "lazy-component",
|
|
1304
1301
|
load: t
|
|
1305
1302
|
};
|
|
1306
1303
|
}
|
|
1307
|
-
function
|
|
1304
|
+
function Tt(t) {
|
|
1308
1305
|
return typeof t == "object" && t !== null && "$$type" in t && t.$$type === "lazy-component";
|
|
1309
1306
|
}
|
|
1310
|
-
const
|
|
1311
|
-
const e = new
|
|
1312
|
-
return
|
|
1307
|
+
const Lt = (t) => {
|
|
1308
|
+
const e = new At(t);
|
|
1309
|
+
return me(e), e;
|
|
1313
1310
|
};
|
|
1314
1311
|
export {
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1312
|
+
At as Picked,
|
|
1313
|
+
Lt as createClient,
|
|
1314
|
+
z as createStorageKey,
|
|
1315
|
+
_ as evaluateRuleLogic,
|
|
1316
|
+
bt as getPickedConfig,
|
|
1317
|
+
Tt as isLazyLoader,
|
|
1318
|
+
Gt as isPickedRoot,
|
|
1319
|
+
Nt as lazyComponent,
|
|
1320
|
+
R as localStore,
|
|
1321
|
+
M as sessionStore,
|
|
1322
|
+
qt as subscribe,
|
|
1323
|
+
Wt as supportsCookies,
|
|
1324
|
+
ge as supportsCryptoRandomUUID,
|
|
1328
1325
|
H as supportsDocument,
|
|
1329
|
-
|
|
1330
|
-
|
|
1326
|
+
Yt as supportsHistory,
|
|
1327
|
+
Qt as supportsIntersectionObserver,
|
|
1331
1328
|
pe as supportsLocalStorage,
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1329
|
+
Xt as supportsLocation,
|
|
1330
|
+
Zt as supportsSessionStorage,
|
|
1331
|
+
er as supportsShadowRoot,
|
|
1332
|
+
tr as supportsWebComponents,
|
|
1336
1333
|
G as supportsWindow
|
|
1337
1334
|
};
|