@viamedici-spc/configurator-react 0.1.0 → 0.1.1
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/index.cjs +1 -1
- package/dist/index.js +656 -437
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,543 +1,762 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import "ts-pattern";
|
|
2
|
+
import { deepEqual as ge } from "fast-equals";
|
|
3
|
+
import { createContext as $, useContext as B, useMemo as m, useEffect as re } from "react";
|
|
4
|
+
import { jsx as k, Fragment as We } from "react/jsx-runtime";
|
|
5
|
+
import { createMachine as ne, assign as C, sendParent as de, spawn as ae, forwardTo as F, send as Ge } from "xstate";
|
|
6
|
+
import { log as S, pure as Ke, stop as ue } from "xstate/lib/actions";
|
|
7
|
+
import { useMachine as Qe } from "@xstate/react";
|
|
8
|
+
var Xe = globalThis && globalThis.__spreadArray || function(e, n, t) {
|
|
9
|
+
if (t || arguments.length === 2)
|
|
10
|
+
for (var i = 0, o = n.length, s; i < o; i++)
|
|
11
|
+
(s || !(i in n)) && (s || (s = Array.prototype.slice.call(n, 0, i)), s[i] = n[i]);
|
|
12
|
+
return e.concat(s || Array.prototype.slice.call(n));
|
|
13
|
+
};
|
|
14
|
+
function O(e) {
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
function pe(e) {
|
|
18
|
+
return function() {
|
|
19
|
+
return e;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
var Ye = /* @__PURE__ */ pe(null), Ce = /* @__PURE__ */ pe(void 0), Je = Ce;
|
|
23
|
+
function he(e, n, t, i, o, s, a, c, u) {
|
|
24
|
+
switch (arguments.length) {
|
|
25
|
+
case 1:
|
|
26
|
+
return e;
|
|
27
|
+
case 2:
|
|
28
|
+
return function() {
|
|
29
|
+
return n(e.apply(this, arguments));
|
|
30
|
+
};
|
|
31
|
+
case 3:
|
|
32
|
+
return function() {
|
|
33
|
+
return t(n(e.apply(this, arguments)));
|
|
34
|
+
};
|
|
35
|
+
case 4:
|
|
36
|
+
return function() {
|
|
37
|
+
return i(t(n(e.apply(this, arguments))));
|
|
38
|
+
};
|
|
39
|
+
case 5:
|
|
40
|
+
return function() {
|
|
41
|
+
return o(i(t(n(e.apply(this, arguments)))));
|
|
42
|
+
};
|
|
43
|
+
case 6:
|
|
44
|
+
return function() {
|
|
45
|
+
return s(o(i(t(n(e.apply(this, arguments))))));
|
|
46
|
+
};
|
|
47
|
+
case 7:
|
|
48
|
+
return function() {
|
|
49
|
+
return a(s(o(i(t(n(e.apply(this, arguments)))))));
|
|
50
|
+
};
|
|
51
|
+
case 8:
|
|
52
|
+
return function() {
|
|
53
|
+
return c(a(s(o(i(t(n(e.apply(this, arguments))))))));
|
|
54
|
+
};
|
|
55
|
+
case 9:
|
|
56
|
+
return function() {
|
|
57
|
+
return u(c(a(s(o(i(t(n(e.apply(this, arguments)))))))));
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function r(e, n, t, i, o, s, a, c, u) {
|
|
62
|
+
switch (arguments.length) {
|
|
63
|
+
case 1:
|
|
64
|
+
return e;
|
|
65
|
+
case 2:
|
|
66
|
+
return n(e);
|
|
67
|
+
case 3:
|
|
68
|
+
return t(n(e));
|
|
69
|
+
case 4:
|
|
70
|
+
return i(t(n(e)));
|
|
71
|
+
case 5:
|
|
72
|
+
return o(i(t(n(e))));
|
|
73
|
+
case 6:
|
|
74
|
+
return s(o(i(t(n(e)))));
|
|
75
|
+
case 7:
|
|
76
|
+
return a(s(o(i(t(n(e))))));
|
|
77
|
+
case 8:
|
|
78
|
+
return c(a(s(o(i(t(n(e)))))));
|
|
79
|
+
case 9:
|
|
80
|
+
return u(c(a(s(o(i(t(n(e))))))));
|
|
81
|
+
default: {
|
|
82
|
+
for (var d = arguments[0], p = 1; p < arguments.length; p++)
|
|
83
|
+
d = arguments[p](d);
|
|
84
|
+
return d;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
var te = function(e, n) {
|
|
89
|
+
var t = typeof e == "number" ? function(i) {
|
|
90
|
+
return i.length >= e;
|
|
91
|
+
} : e;
|
|
92
|
+
return function() {
|
|
93
|
+
var i = Array.from(arguments);
|
|
94
|
+
return t(arguments) ? n.apply(this, i) : function(o) {
|
|
95
|
+
return n.apply(void 0, Xe([o], i, !1));
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
10
99
|
globalThis && globalThis.__spreadArray;
|
|
11
|
-
var
|
|
100
|
+
var me = function(e) {
|
|
12
101
|
return e._tag === "Some";
|
|
102
|
+
}, Se = { _tag: "None" }, ye = function(e) {
|
|
103
|
+
return { _tag: "Some", value: e };
|
|
104
|
+
}, Le = function(e) {
|
|
105
|
+
return e.length > 0;
|
|
106
|
+
}, Ze = [], en = Object.prototype.hasOwnProperty;
|
|
107
|
+
function nn(e) {
|
|
108
|
+
return function(n, t) {
|
|
109
|
+
return e.chain(n, function(i) {
|
|
110
|
+
return e.map(t(i), function() {
|
|
111
|
+
return i;
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
var E = function(e) {
|
|
117
|
+
return {
|
|
118
|
+
equals: function(n, t) {
|
|
119
|
+
return n === t || e(n, t);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}, M = function(e) {
|
|
123
|
+
return E(function(n, t) {
|
|
124
|
+
for (var i in e)
|
|
125
|
+
if (!e[i].equals(n[i], t[i]))
|
|
126
|
+
return !1;
|
|
127
|
+
return !0;
|
|
128
|
+
});
|
|
129
|
+
}, ve = {
|
|
130
|
+
equals: function(e, n) {
|
|
131
|
+
return e === n;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
ve.equals;
|
|
135
|
+
var y = Se, q = ye;
|
|
136
|
+
function j(e) {
|
|
137
|
+
return function(n) {
|
|
138
|
+
return e(n) ? q(n) : y;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
var tn = function(e, n) {
|
|
142
|
+
return r(e, A(n));
|
|
143
|
+
}, on = function(e, n) {
|
|
144
|
+
return r(e, an(n));
|
|
145
|
+
}, sn = "Option", rn = function(e) {
|
|
146
|
+
return {
|
|
147
|
+
equals: function(n, t) {
|
|
148
|
+
return n === t || (v(n) ? v(t) : v(t) ? !1 : e.equals(n.value, t.value));
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}, A = function(e) {
|
|
152
|
+
return function(n) {
|
|
153
|
+
return v(n) ? y : q(e(n.value));
|
|
154
|
+
};
|
|
155
|
+
}, an = function(e) {
|
|
156
|
+
return function(n) {
|
|
157
|
+
return v(n) || v(e) ? y : q(n.value(e.value));
|
|
158
|
+
};
|
|
159
|
+
}, Ee = /* @__PURE__ */ te(2, function(e, n) {
|
|
160
|
+
return v(e) ? y : n(e.value);
|
|
161
|
+
}), un = {
|
|
162
|
+
URI: sn,
|
|
163
|
+
map: tn,
|
|
164
|
+
ap: on,
|
|
165
|
+
chain: Ee
|
|
166
|
+
}, R = function(e) {
|
|
167
|
+
return function(n) {
|
|
168
|
+
return v(n) ? y : e(n.value) ? n : y;
|
|
169
|
+
};
|
|
170
|
+
}, v = function(e) {
|
|
171
|
+
return e._tag === "None";
|
|
172
|
+
}, cn = function(e, n) {
|
|
173
|
+
return function(t) {
|
|
174
|
+
return v(t) ? e() : n(t.value);
|
|
175
|
+
};
|
|
176
|
+
}, ie = cn, ln = function(e) {
|
|
177
|
+
return function(n) {
|
|
178
|
+
return v(n) ? e() : n.value;
|
|
179
|
+
};
|
|
180
|
+
}, D = ln, fn = /* @__PURE__ */ te(2, nn(un)), l = function(e) {
|
|
181
|
+
return e == null ? y : q(e);
|
|
182
|
+
}, V = /* @__PURE__ */ ie(Ye, O), b = /* @__PURE__ */ ie(Ce, O), gn = Ee, dn = fn;
|
|
183
|
+
globalThis && globalThis.__spreadArray;
|
|
184
|
+
var pn = Ze, Cn = Le;
|
|
185
|
+
globalThis && globalThis.__spreadArray;
|
|
186
|
+
var hn = function(e) {
|
|
187
|
+
return e.length === 0;
|
|
188
|
+
}, Ae = Cn, mn = function(e) {
|
|
189
|
+
return function(n) {
|
|
190
|
+
if (hn(n))
|
|
191
|
+
return vn;
|
|
192
|
+
for (var t = [], i = 0; i < n.length; i++)
|
|
193
|
+
t.push.apply(t, e(i, n[i]));
|
|
194
|
+
return t;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
function Pe(e) {
|
|
198
|
+
return function(n) {
|
|
199
|
+
for (var t = 0; t < n.length; t++)
|
|
200
|
+
if (e(n[t]))
|
|
201
|
+
return ye(n[t]);
|
|
202
|
+
return Se;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
var Sn = function(e, n, t) {
|
|
206
|
+
for (var i = [], o = Math.min(e.length, n.length), s = 0; s < o; s++)
|
|
207
|
+
i[s] = t(e[s], n[s]);
|
|
208
|
+
return i;
|
|
13
209
|
};
|
|
14
|
-
function
|
|
210
|
+
function Me(e, n) {
|
|
211
|
+
return n === void 0 ? function(t) {
|
|
212
|
+
return Me(t, e);
|
|
213
|
+
} : Sn(e, n, function(t, i) {
|
|
214
|
+
return [t, i];
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
var qe = /* @__PURE__ */ te(2, function(e, n) {
|
|
218
|
+
return r(e, mn(function(t, i) {
|
|
219
|
+
return n(i, t);
|
|
220
|
+
}));
|
|
221
|
+
}), Re = /* @__PURE__ */ qe(O), P = function(e) {
|
|
222
|
+
return function(n) {
|
|
223
|
+
return n.map(function(t) {
|
|
224
|
+
return e(t);
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
}, h = function(e) {
|
|
228
|
+
return function(n) {
|
|
229
|
+
return n.filter(e);
|
|
230
|
+
};
|
|
231
|
+
}, yn = function(e) {
|
|
232
|
+
return function(n) {
|
|
233
|
+
for (var t = [], i = 0; i < n.length; i++) {
|
|
234
|
+
var o = e(i, n[i]);
|
|
235
|
+
me(o) && t.push(o.value);
|
|
236
|
+
}
|
|
237
|
+
return t;
|
|
238
|
+
};
|
|
239
|
+
}, U = function(e) {
|
|
240
|
+
return yn(function(n, t) {
|
|
241
|
+
return e(t);
|
|
242
|
+
});
|
|
243
|
+
}, Y = /* @__PURE__ */ U(O), H = function(e) {
|
|
244
|
+
return E(function(n, t) {
|
|
245
|
+
return n.length === t.length && n.every(function(i, o) {
|
|
246
|
+
return e.equals(i, t[o]);
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
}, vn = pn;
|
|
250
|
+
function En(e) {
|
|
251
|
+
return function(n) {
|
|
252
|
+
return n.every(e);
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
var An = qe, g = {
|
|
256
|
+
equals: function(e, n) {
|
|
257
|
+
return e === n;
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
g.equals;
|
|
261
|
+
function Ue(e) {
|
|
262
|
+
return function(n, t) {
|
|
263
|
+
if (t === void 0) {
|
|
264
|
+
var i = Ue(e);
|
|
265
|
+
return function(s) {
|
|
266
|
+
return i(s, n);
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
for (var o in n)
|
|
270
|
+
if (!en.call(t, o) || !e.equals(n[o], t[o]))
|
|
271
|
+
return !1;
|
|
272
|
+
return !0;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function xe(e) {
|
|
276
|
+
var n = Ue(e);
|
|
277
|
+
return E(function(t, i) {
|
|
278
|
+
return n(t)(i) && n(i)(t);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
function W(e) {
|
|
15
282
|
return {
|
|
16
283
|
equals(n, t) {
|
|
17
284
|
return n == null && t == null ? !0 : n == null || t === null || t === void 0 ? !1 : e.equals(n, t);
|
|
18
285
|
}
|
|
19
286
|
};
|
|
20
287
|
}
|
|
21
|
-
function
|
|
288
|
+
function _(e) {
|
|
22
289
|
return {
|
|
23
290
|
equals(n, t) {
|
|
24
|
-
const i = r(
|
|
25
|
-
return
|
|
291
|
+
const i = r(l(n), D(() => [])), o = r(l(t), D(() => []));
|
|
292
|
+
return H(e).equals(i, o);
|
|
26
293
|
}
|
|
27
294
|
};
|
|
28
295
|
}
|
|
29
|
-
const
|
|
30
|
-
localId: g
|
|
31
|
-
componentPath:
|
|
32
|
-
sharedConfigurationModel:
|
|
33
|
-
}),
|
|
34
|
-
attributeId:
|
|
35
|
-
decisions:
|
|
296
|
+
const ce = M({
|
|
297
|
+
localId: g,
|
|
298
|
+
componentPath: _(g),
|
|
299
|
+
sharedConfigurationModel: W(g)
|
|
300
|
+
}), Pn = rn(H(M({
|
|
301
|
+
attributeId: ce,
|
|
302
|
+
decisions: _(ce)
|
|
36
303
|
})));
|
|
37
|
-
|
|
38
|
-
configurationModelSource:
|
|
39
|
-
decisionsToRespect:
|
|
40
|
-
usageRuleParameters:
|
|
304
|
+
M({
|
|
305
|
+
configurationModelSource: E((e, n) => ge(e, n)),
|
|
306
|
+
decisionsToRespect: Pn,
|
|
307
|
+
usageRuleParameters: xe(g)
|
|
41
308
|
});
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return e.value === n.value;
|
|
51
|
-
}
|
|
52
|
-
}, Ue = {
|
|
53
|
-
equals(e, n) {
|
|
54
|
-
return e.state === n.state;
|
|
55
|
-
}
|
|
56
|
-
}, Ie = {
|
|
57
|
-
equals(e, n) {
|
|
58
|
-
return V.equals(e.attributeId, n.attributeId) ? ye({ x: e, y: n }).with({
|
|
59
|
-
x: {
|
|
60
|
-
type: "Choice"
|
|
61
|
-
/* Choice */
|
|
62
|
-
},
|
|
63
|
-
y: {
|
|
64
|
-
type: "Choice"
|
|
65
|
-
/* Choice */
|
|
66
|
-
}
|
|
67
|
-
}, (t, i) => xe.equals(i.x, i.y)).with({
|
|
68
|
-
x: {
|
|
69
|
-
type: "Numeric"
|
|
70
|
-
/* Numeric */
|
|
71
|
-
},
|
|
72
|
-
y: {
|
|
73
|
-
type: "Numeric"
|
|
74
|
-
/* Numeric */
|
|
75
|
-
}
|
|
76
|
-
}, (t, i) => Me.equals(i.x, i.y)).with({
|
|
77
|
-
x: {
|
|
78
|
-
type: "Boolean"
|
|
79
|
-
/* Boolean */
|
|
80
|
-
},
|
|
81
|
-
y: {
|
|
82
|
-
type: "Boolean"
|
|
83
|
-
/* Boolean */
|
|
84
|
-
}
|
|
85
|
-
}, (t, i) => Re.equals(i.x, i.y)).with({
|
|
86
|
-
x: {
|
|
87
|
-
type: "Component"
|
|
88
|
-
/* Component */
|
|
89
|
-
},
|
|
90
|
-
y: {
|
|
91
|
-
type: "Component"
|
|
92
|
-
/* Component */
|
|
93
|
-
}
|
|
94
|
-
}, (t, i) => Ue.equals(i.x, i.y)).otherwise(() => !1) : !1;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
o.getEq(Ie);
|
|
98
|
-
const ne = f.struct({
|
|
99
|
-
localId: g.Eq,
|
|
100
|
-
componentPath: q(g.Eq),
|
|
101
|
-
sharedConfigurationModelId: w(g.Eq)
|
|
102
|
-
}), De = f.struct({
|
|
103
|
-
localId: g.Eq,
|
|
104
|
-
componentPath: q(g.Eq),
|
|
105
|
-
sharedConfigurationModelId: w(g.Eq)
|
|
309
|
+
const Ie = M({
|
|
310
|
+
localId: g,
|
|
311
|
+
componentPath: _(g),
|
|
312
|
+
sharedConfigurationModelId: W(g)
|
|
313
|
+
}), Mn = M({
|
|
314
|
+
localId: g,
|
|
315
|
+
componentPath: _(g),
|
|
316
|
+
sharedConfigurationModelId: W(g)
|
|
106
317
|
});
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
localId: g
|
|
110
|
-
componentPath:
|
|
111
|
-
sharedConfigurationModelId:
|
|
318
|
+
var Z = /* @__PURE__ */ ((e) => (e.Choice = "Choice", e.ChoiceValue = "ChoiceValue", e))(Z || {}), f = /* @__PURE__ */ ((e) => (e.Boolean = "Boolean", e.Numeric = "Numeric", e.Choice = "Choice", e.Component = "Component", e))(f || {}), G = /* @__PURE__ */ ((e) => (e.Implicit = "Implicit", e.Explicit = "Explicit", e))(G || {});
|
|
319
|
+
M({
|
|
320
|
+
localId: g,
|
|
321
|
+
componentPath: _(g),
|
|
322
|
+
sharedConfigurationModelId: W(g)
|
|
112
323
|
});
|
|
113
|
-
function
|
|
324
|
+
function qn(e, n) {
|
|
114
325
|
return r(
|
|
115
326
|
e.values,
|
|
116
|
-
|
|
327
|
+
U((t) => r(
|
|
117
328
|
t.decision,
|
|
118
|
-
|
|
119
|
-
|
|
329
|
+
l,
|
|
330
|
+
R((i) => i.kind === n)
|
|
120
331
|
))
|
|
121
332
|
);
|
|
122
333
|
}
|
|
123
|
-
function
|
|
334
|
+
function Rn(e) {
|
|
124
335
|
return r(
|
|
125
336
|
e.decision,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
337
|
+
l,
|
|
338
|
+
R((n) => n.kind === G.Explicit),
|
|
339
|
+
V
|
|
129
340
|
);
|
|
130
341
|
}
|
|
131
|
-
function
|
|
342
|
+
function Un(e) {
|
|
132
343
|
return r(
|
|
133
344
|
e.decision,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
345
|
+
l,
|
|
346
|
+
R((n) => n.kind === G.Explicit),
|
|
347
|
+
V
|
|
137
348
|
);
|
|
138
349
|
}
|
|
139
|
-
function
|
|
350
|
+
function xn(e) {
|
|
140
351
|
return r(
|
|
141
352
|
e.decision,
|
|
142
|
-
|
|
143
|
-
|
|
353
|
+
l,
|
|
354
|
+
V
|
|
144
355
|
);
|
|
145
356
|
}
|
|
146
|
-
const
|
|
147
|
-
function
|
|
357
|
+
const De = (e) => e.type === f.Boolean, be = (e) => e.type === f.Choice, _e = (e) => e.type === f.Numeric, we = (e) => e.type === f.Component, In = _(g);
|
|
358
|
+
function Dn(e, n, t) {
|
|
148
359
|
var i;
|
|
149
|
-
const
|
|
150
|
-
return r(e,
|
|
151
|
-
var
|
|
152
|
-
const
|
|
153
|
-
return t ?
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
) :
|
|
360
|
+
const o = ((i = n.componentPath) == null ? void 0 : i.length) ?? 0;
|
|
361
|
+
return r(e, h((s) => {
|
|
362
|
+
var a;
|
|
363
|
+
const c = ((a = s.id.componentPath) == null ? void 0 : a.length) ?? 0;
|
|
364
|
+
return t ? o > c ? !1 : r(
|
|
365
|
+
s.id.componentPath ?? [],
|
|
366
|
+
Me(n.componentPath ?? []),
|
|
367
|
+
En(([u, d]) => u === d)
|
|
368
|
+
) : In.equals(s.id.componentPath, n.componentPath);
|
|
158
369
|
}));
|
|
159
370
|
}
|
|
160
|
-
function
|
|
371
|
+
function bn(e, n, t) {
|
|
161
372
|
return [];
|
|
162
373
|
}
|
|
163
|
-
function
|
|
164
|
-
return r(e,
|
|
374
|
+
function _n(e) {
|
|
375
|
+
return r(e, h((n) => {
|
|
165
376
|
const t = r(
|
|
166
377
|
n.id.componentPath,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
378
|
+
l,
|
|
379
|
+
A((o) => o.length === 0),
|
|
380
|
+
D(() => !0)
|
|
170
381
|
), i = r(
|
|
171
382
|
n.id.sharedConfigurationModelId,
|
|
172
|
-
|
|
173
|
-
|
|
383
|
+
l,
|
|
384
|
+
ie(() => !0, () => !1)
|
|
174
385
|
);
|
|
175
386
|
return t && i;
|
|
176
387
|
}));
|
|
177
388
|
}
|
|
178
|
-
function
|
|
389
|
+
function wn(e, n) {
|
|
179
390
|
return r(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
391
|
+
Ne(e),
|
|
392
|
+
P((t) => qn(t, n)),
|
|
393
|
+
Re,
|
|
394
|
+
U((t) => l(t))
|
|
184
395
|
);
|
|
185
396
|
}
|
|
186
|
-
function
|
|
397
|
+
function Nn(e, n) {
|
|
187
398
|
return r(
|
|
188
|
-
|
|
189
|
-
|
|
399
|
+
ke(e),
|
|
400
|
+
h((t) => {
|
|
190
401
|
var i;
|
|
191
402
|
return ((i = t.decision) == null ? void 0 : i.kind) === n;
|
|
192
403
|
}),
|
|
193
|
-
|
|
194
|
-
|
|
404
|
+
P((t) => Rn(t)),
|
|
405
|
+
U((t) => l(t))
|
|
195
406
|
);
|
|
196
407
|
}
|
|
197
|
-
function
|
|
408
|
+
function Tn(e, n) {
|
|
198
409
|
return r(
|
|
199
|
-
|
|
200
|
-
|
|
410
|
+
Oe(e),
|
|
411
|
+
h((t) => {
|
|
201
412
|
var i;
|
|
202
413
|
return ((i = t.decision) == null ? void 0 : i.kind) === n;
|
|
203
414
|
}),
|
|
204
|
-
|
|
205
|
-
|
|
415
|
+
P((t) => Un(t)),
|
|
416
|
+
U((t) => l(t))
|
|
206
417
|
);
|
|
207
418
|
}
|
|
208
|
-
function
|
|
419
|
+
function kn(e, n) {
|
|
209
420
|
return r(
|
|
210
|
-
|
|
211
|
-
|
|
421
|
+
Te(e),
|
|
422
|
+
h((t) => {
|
|
212
423
|
var i;
|
|
213
424
|
return ((i = t.decision) == null ? void 0 : i.kind) === n;
|
|
214
425
|
}),
|
|
215
|
-
|
|
216
|
-
|
|
426
|
+
P((t) => xn(t)),
|
|
427
|
+
U((t) => l(t))
|
|
217
428
|
);
|
|
218
429
|
}
|
|
219
|
-
function
|
|
430
|
+
function Ne(e) {
|
|
220
431
|
return r(
|
|
221
432
|
e.attributes,
|
|
222
|
-
|
|
433
|
+
h(be)
|
|
223
434
|
);
|
|
224
435
|
}
|
|
225
|
-
function
|
|
436
|
+
function Te(e) {
|
|
226
437
|
return r(
|
|
227
438
|
e.attributes,
|
|
228
|
-
|
|
439
|
+
h(we)
|
|
229
440
|
);
|
|
230
441
|
}
|
|
231
|
-
function
|
|
442
|
+
function ke(e) {
|
|
232
443
|
return r(
|
|
233
444
|
e.attributes,
|
|
234
|
-
|
|
445
|
+
h(_e)
|
|
235
446
|
);
|
|
236
447
|
}
|
|
237
|
-
function
|
|
448
|
+
function Oe(e) {
|
|
238
449
|
return r(
|
|
239
450
|
e.attributes,
|
|
240
|
-
|
|
451
|
+
h(De)
|
|
241
452
|
);
|
|
242
453
|
}
|
|
243
|
-
function
|
|
454
|
+
function On(e, n) {
|
|
244
455
|
return r(
|
|
245
|
-
|
|
246
|
-
|
|
456
|
+
z(e, n),
|
|
457
|
+
b
|
|
247
458
|
);
|
|
248
459
|
}
|
|
249
|
-
function
|
|
460
|
+
function zn(e, n) {
|
|
250
461
|
return r(
|
|
251
|
-
|
|
252
|
-
|
|
462
|
+
ze(e, n),
|
|
463
|
+
b
|
|
253
464
|
);
|
|
254
465
|
}
|
|
255
|
-
function
|
|
466
|
+
function Fn(e, n, t) {
|
|
256
467
|
return r(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
468
|
+
ze(e, n),
|
|
469
|
+
A((i) => i.values),
|
|
470
|
+
gn(he(Pe((i) => i.id === t))),
|
|
471
|
+
b
|
|
261
472
|
);
|
|
262
473
|
}
|
|
263
|
-
function
|
|
474
|
+
function $n(e, n) {
|
|
264
475
|
return r(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
476
|
+
z(e, n),
|
|
477
|
+
R(_e),
|
|
478
|
+
b
|
|
268
479
|
);
|
|
269
480
|
}
|
|
270
|
-
function
|
|
481
|
+
function Bn(e, n) {
|
|
271
482
|
return r(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
483
|
+
z(e, n),
|
|
484
|
+
R(De),
|
|
485
|
+
b
|
|
275
486
|
);
|
|
276
487
|
}
|
|
277
|
-
function
|
|
488
|
+
function jn(e, n) {
|
|
278
489
|
return r(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
490
|
+
z(e, n),
|
|
491
|
+
R(we),
|
|
492
|
+
b
|
|
282
493
|
);
|
|
283
494
|
}
|
|
284
|
-
function
|
|
495
|
+
function z(e, n) {
|
|
285
496
|
return r(
|
|
286
497
|
e.attributes,
|
|
287
|
-
|
|
498
|
+
Pe((t) => Ie.equals(t.id, n))
|
|
288
499
|
);
|
|
289
500
|
}
|
|
290
|
-
function
|
|
501
|
+
function ze(e, n) {
|
|
291
502
|
return r(
|
|
292
|
-
|
|
293
|
-
|
|
503
|
+
z(e, n),
|
|
504
|
+
R(be)
|
|
294
505
|
);
|
|
295
506
|
}
|
|
296
|
-
const
|
|
507
|
+
const w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
297
508
|
__proto__: null,
|
|
298
|
-
filterAttributesOfComponent:
|
|
299
|
-
filterAttributesOfRoot:
|
|
300
|
-
filterAttributesOfShared:
|
|
301
|
-
getAttribute:
|
|
302
|
-
getBooleanAttribute:
|
|
303
|
-
getBooleanAttributes:
|
|
304
|
-
getBooleanDecisions:
|
|
305
|
-
getChoiceAttribute:
|
|
306
|
-
getChoiceAttributes:
|
|
307
|
-
getChoiceDecisions:
|
|
308
|
-
getChoiceValue:
|
|
309
|
-
getComponentAttribute:
|
|
310
|
-
getComponentAttributes:
|
|
311
|
-
getComponentDecisions:
|
|
312
|
-
getNumericAttribute:
|
|
313
|
-
getNumericAttributes:
|
|
314
|
-
getNumericDecisions:
|
|
315
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
509
|
+
filterAttributesOfComponent: Dn,
|
|
510
|
+
filterAttributesOfRoot: _n,
|
|
511
|
+
filterAttributesOfShared: bn,
|
|
512
|
+
getAttribute: On,
|
|
513
|
+
getBooleanAttribute: Bn,
|
|
514
|
+
getBooleanAttributes: Oe,
|
|
515
|
+
getBooleanDecisions: Tn,
|
|
516
|
+
getChoiceAttribute: zn,
|
|
517
|
+
getChoiceAttributes: Ne,
|
|
518
|
+
getChoiceDecisions: wn,
|
|
519
|
+
getChoiceValue: Fn,
|
|
520
|
+
getComponentAttribute: jn,
|
|
521
|
+
getComponentAttributes: Te,
|
|
522
|
+
getComponentDecisions: kn,
|
|
523
|
+
getNumericAttribute: $n,
|
|
524
|
+
getNumericAttributes: ke,
|
|
525
|
+
getNumericDecisions: Nn
|
|
526
|
+
}, Symbol.toStringTag, { value: "Module" })), le = Ie.equals;
|
|
527
|
+
Mn.equals;
|
|
528
|
+
function ee(e) {
|
|
529
|
+
return E(
|
|
530
|
+
(n, t) => {
|
|
531
|
+
const i = n == null, o = t == null;
|
|
532
|
+
return i && o || !i && !o && e.equals(n, t);
|
|
533
|
+
}
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
const Fe = $(null), $e = $(null), Be = $(null), je = $(null), oe = () => B(Fe), N = () => B(je), Ve = "The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";
|
|
537
|
+
function se(e) {
|
|
319
538
|
if (!e)
|
|
320
|
-
throw new Error(
|
|
539
|
+
throw new Error(Ve);
|
|
321
540
|
}
|
|
322
|
-
function
|
|
541
|
+
function T(e) {
|
|
323
542
|
if (!e)
|
|
324
|
-
throw new Error(
|
|
543
|
+
throw new Error(Ve);
|
|
325
544
|
}
|
|
326
|
-
function
|
|
327
|
-
const e =
|
|
328
|
-
return
|
|
545
|
+
function Vn() {
|
|
546
|
+
const e = oe();
|
|
547
|
+
return se(e), m(() => ({
|
|
329
548
|
explainChoiceAttributeConsequence: (n, t, i) => e.explain({
|
|
330
|
-
type:
|
|
549
|
+
type: Z.ChoiceValue,
|
|
331
550
|
attributeId: n,
|
|
332
551
|
choiceValueId: t,
|
|
333
552
|
question: i
|
|
334
553
|
}),
|
|
335
554
|
explainChoiceAttributeConsequences: (n, t) => e.explain({
|
|
336
|
-
type:
|
|
555
|
+
type: Z.Choice,
|
|
337
556
|
attributeId: n,
|
|
338
557
|
question: t
|
|
339
558
|
}),
|
|
340
559
|
applySolution: (n) => e.applySolution(n)
|
|
341
560
|
}), [e]);
|
|
342
561
|
}
|
|
343
|
-
function
|
|
344
|
-
const e =
|
|
345
|
-
return
|
|
562
|
+
function K() {
|
|
563
|
+
const e = oe();
|
|
564
|
+
return se(e), m(() => ({
|
|
346
565
|
makeDecision: (n) => e.makeDecision(n),
|
|
347
566
|
setManyDecision: (n, t) => e.setMany(n, t)
|
|
348
567
|
}), [e]);
|
|
349
568
|
}
|
|
350
|
-
var
|
|
569
|
+
var Q = function(e) {
|
|
351
570
|
return function(n) {
|
|
352
|
-
return
|
|
571
|
+
return me(e(n));
|
|
353
572
|
};
|
|
354
573
|
};
|
|
355
|
-
const
|
|
356
|
-
function
|
|
357
|
-
return e.decision != null && e.decision.kind ===
|
|
574
|
+
const Hn = Q((e) => e.type === f.Choice ? q(e) : y), Wn = Q((e) => e.type === f.Numeric ? q(e) : y), Gn = Q((e) => e.type === f.Boolean ? q(e) : y), Kn = Q((e) => e.type === f.Component ? q(e) : y);
|
|
575
|
+
function X(e) {
|
|
576
|
+
return e.decision != null && e.decision.kind === G.Explicit;
|
|
358
577
|
}
|
|
359
|
-
function
|
|
578
|
+
function He(e) {
|
|
360
579
|
return r(
|
|
361
580
|
e.values,
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
type:
|
|
581
|
+
h(X),
|
|
582
|
+
P((n) => ({
|
|
583
|
+
type: f.Choice,
|
|
365
584
|
attributeId: e.id,
|
|
366
585
|
choiceValueId: n.id,
|
|
367
586
|
state: null
|
|
368
587
|
}))
|
|
369
588
|
);
|
|
370
589
|
}
|
|
371
|
-
function
|
|
590
|
+
function Qn(e) {
|
|
372
591
|
return r(
|
|
373
592
|
e,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
type:
|
|
593
|
+
j(X),
|
|
594
|
+
A(() => ({
|
|
595
|
+
type: f.Numeric,
|
|
377
596
|
attributeId: e.id,
|
|
378
597
|
state: null
|
|
379
598
|
}))
|
|
380
599
|
);
|
|
381
600
|
}
|
|
382
|
-
function
|
|
601
|
+
function Xn(e) {
|
|
383
602
|
return r(
|
|
384
603
|
e,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
type:
|
|
604
|
+
j(X),
|
|
605
|
+
A(() => ({
|
|
606
|
+
type: f.Boolean,
|
|
388
607
|
attributeId: e.id,
|
|
389
608
|
state: null
|
|
390
609
|
}))
|
|
391
610
|
);
|
|
392
611
|
}
|
|
393
|
-
function
|
|
612
|
+
function Yn(e) {
|
|
394
613
|
return r(
|
|
395
614
|
e,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
type:
|
|
615
|
+
j(X),
|
|
616
|
+
A(() => ({
|
|
617
|
+
type: f.Component,
|
|
399
618
|
attributeId: e.id,
|
|
400
619
|
state: null
|
|
401
620
|
}))
|
|
402
621
|
);
|
|
403
622
|
}
|
|
404
|
-
function
|
|
623
|
+
function Jn(e, n) {
|
|
405
624
|
return r(
|
|
406
|
-
|
|
625
|
+
w.filterAttributesOfComponent(n, e, !0),
|
|
407
626
|
(t) => [
|
|
408
627
|
r(
|
|
409
628
|
t,
|
|
410
|
-
|
|
411
|
-
|
|
629
|
+
h(Hn),
|
|
630
|
+
An(He)
|
|
412
631
|
),
|
|
413
632
|
r(
|
|
414
633
|
t,
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
634
|
+
h(Wn),
|
|
635
|
+
P(Qn),
|
|
636
|
+
Y
|
|
418
637
|
),
|
|
419
638
|
r(
|
|
420
639
|
t,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
640
|
+
h(Gn),
|
|
641
|
+
P(Xn),
|
|
642
|
+
Y
|
|
424
643
|
),
|
|
425
644
|
r(
|
|
426
645
|
t,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
646
|
+
h(Kn),
|
|
647
|
+
P(Yn),
|
|
648
|
+
Y
|
|
430
649
|
)
|
|
431
650
|
],
|
|
432
|
-
|
|
651
|
+
Re
|
|
433
652
|
);
|
|
434
653
|
}
|
|
435
|
-
function
|
|
436
|
-
const t =
|
|
437
|
-
return
|
|
654
|
+
function ht(e, n) {
|
|
655
|
+
const t = N();
|
|
656
|
+
return T(t), m(
|
|
438
657
|
() => r(
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
n ?? !1 ?
|
|
658
|
+
l(e),
|
|
659
|
+
A(he(
|
|
660
|
+
P((i) => w.getAttribute(t, i)),
|
|
661
|
+
n ?? !1 ? O : U(l)
|
|
443
662
|
)),
|
|
444
|
-
|
|
663
|
+
D(() => t.attributes)
|
|
445
664
|
),
|
|
446
665
|
[e, t, n]
|
|
447
666
|
);
|
|
448
667
|
}
|
|
449
|
-
function
|
|
450
|
-
const n =
|
|
451
|
-
|
|
452
|
-
const
|
|
453
|
-
explainConsequence: (
|
|
454
|
-
explainConsequences: (
|
|
455
|
-
makeDecision: (
|
|
456
|
-
type:
|
|
668
|
+
function mt(e) {
|
|
669
|
+
const n = N(), { explainChoiceAttributeConsequence: t, explainChoiceAttributeConsequences: i, applySolution: o } = Vn(), { makeDecision: s, setManyDecision: a } = K();
|
|
670
|
+
T(n);
|
|
671
|
+
const c = w.getChoiceAttribute(n, e), u = m(() => ({
|
|
672
|
+
explainConsequence: (p, x) => t(e, p, x),
|
|
673
|
+
explainConsequences: (p) => i(e, p),
|
|
674
|
+
makeDecision: (p, x) => s({
|
|
675
|
+
type: f.Choice,
|
|
457
676
|
attributeId: e,
|
|
458
|
-
choiceValueId:
|
|
459
|
-
state:
|
|
677
|
+
choiceValueId: p,
|
|
678
|
+
state: x
|
|
460
679
|
}),
|
|
461
680
|
clearDecisions: r(
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
681
|
+
c,
|
|
682
|
+
l,
|
|
683
|
+
A(He),
|
|
465
684
|
// Only setMany if there are decisions to clear.
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
685
|
+
R(Ae),
|
|
686
|
+
A((p) => () => a(p, { type: "Default" })),
|
|
687
|
+
D(() => () => Promise.resolve())
|
|
469
688
|
),
|
|
470
|
-
applySolution:
|
|
471
|
-
}), [e,
|
|
689
|
+
applySolution: o
|
|
690
|
+
}), [e, c, s, a, t, i, o]), d = m(() => ({
|
|
472
691
|
...u,
|
|
473
|
-
attribute:
|
|
474
|
-
}), [
|
|
475
|
-
if (
|
|
476
|
-
return
|
|
692
|
+
attribute: c
|
|
693
|
+
}), [c, u]);
|
|
694
|
+
if (c)
|
|
695
|
+
return d;
|
|
477
696
|
}
|
|
478
|
-
function
|
|
479
|
-
const n =
|
|
480
|
-
|
|
481
|
-
const i =
|
|
482
|
-
makeDecision: (
|
|
483
|
-
type:
|
|
697
|
+
function St(e) {
|
|
698
|
+
const n = N(), { makeDecision: t } = K();
|
|
699
|
+
T(n);
|
|
700
|
+
const i = w.getNumericAttribute(n, e), o = m(() => ({
|
|
701
|
+
makeDecision: (a) => t({
|
|
702
|
+
type: f.Numeric,
|
|
484
703
|
attributeId: e,
|
|
485
|
-
state:
|
|
704
|
+
state: a
|
|
486
705
|
})
|
|
487
|
-
}), [e, t]),
|
|
488
|
-
...
|
|
706
|
+
}), [e, t]), s = m(() => ({
|
|
707
|
+
...o,
|
|
489
708
|
attribute: i
|
|
490
|
-
}), [i,
|
|
709
|
+
}), [i, o]);
|
|
491
710
|
if (i)
|
|
492
|
-
return
|
|
711
|
+
return s;
|
|
493
712
|
}
|
|
494
|
-
function
|
|
495
|
-
const n =
|
|
496
|
-
|
|
497
|
-
const i =
|
|
498
|
-
makeDecision: (
|
|
499
|
-
type:
|
|
713
|
+
function yt(e) {
|
|
714
|
+
const n = N(), { makeDecision: t } = K();
|
|
715
|
+
T(n);
|
|
716
|
+
const i = w.getBooleanAttribute(n, e), o = m(() => ({
|
|
717
|
+
makeDecision: (a) => t({
|
|
718
|
+
type: f.Boolean,
|
|
500
719
|
attributeId: e,
|
|
501
|
-
state:
|
|
720
|
+
state: a
|
|
502
721
|
})
|
|
503
|
-
}), [e, t]),
|
|
504
|
-
...
|
|
722
|
+
}), [e, t]), s = m(() => ({
|
|
723
|
+
...o,
|
|
505
724
|
attribute: i
|
|
506
|
-
}), [i,
|
|
725
|
+
}), [i, o]);
|
|
507
726
|
if (i)
|
|
508
|
-
return
|
|
727
|
+
return s;
|
|
509
728
|
}
|
|
510
|
-
function
|
|
511
|
-
const n =
|
|
512
|
-
|
|
513
|
-
const
|
|
729
|
+
function vt(e) {
|
|
730
|
+
const n = N(), { makeDecision: t, setManyDecision: i } = K();
|
|
731
|
+
T(n);
|
|
732
|
+
const o = n.attributes, s = w.getComponentAttribute(n, e), a = m(() => ({
|
|
514
733
|
makeDecision: (u) => t({
|
|
515
|
-
type:
|
|
734
|
+
type: f.Component,
|
|
516
735
|
attributeId: e,
|
|
517
736
|
state: u
|
|
518
737
|
}),
|
|
519
738
|
clearSubtree: r(
|
|
520
|
-
|
|
739
|
+
Jn(e, o),
|
|
521
740
|
// Only setMany if there are decisions to clear.
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
741
|
+
j(Ae),
|
|
742
|
+
A((u) => () => i(u, { type: "Default" })),
|
|
743
|
+
D(() => () => Promise.resolve())
|
|
525
744
|
)
|
|
526
|
-
}), [e, t,
|
|
527
|
-
...
|
|
528
|
-
attribute:
|
|
529
|
-
}), [
|
|
530
|
-
if (
|
|
531
|
-
return
|
|
745
|
+
}), [e, t, o, i]), c = m(() => ({
|
|
746
|
+
...a,
|
|
747
|
+
attribute: s
|
|
748
|
+
}), [s, a]);
|
|
749
|
+
if (s)
|
|
750
|
+
return c;
|
|
532
751
|
}
|
|
533
|
-
const
|
|
534
|
-
attributeId:
|
|
535
|
-
decisions:
|
|
536
|
-
}),
|
|
537
|
-
configurationModelSource:
|
|
538
|
-
attributeRelations:
|
|
539
|
-
usageRuleParameters:
|
|
540
|
-
}),
|
|
752
|
+
const Ln = E((e, n) => xe(g).equals(e ?? {}, n ?? {})), Zn = M({
|
|
753
|
+
attributeId: E(le),
|
|
754
|
+
decisions: H(E(le))
|
|
755
|
+
}), et = E((e, n) => H(Zn).equals(e ?? [], n ?? [])), J = M({
|
|
756
|
+
configurationModelSource: E((e, n) => ge(e, n)),
|
|
757
|
+
attributeRelations: et,
|
|
758
|
+
usageRuleParameters: Ln
|
|
759
|
+
}), nt = ve, L = ee(nt), tt = () => ne({
|
|
541
760
|
predictableActionArguments: !0,
|
|
542
761
|
preserveActionOrder: !0,
|
|
543
762
|
schema: {
|
|
@@ -563,14 +782,14 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
|
|
|
563
782
|
}
|
|
564
783
|
},
|
|
565
784
|
exit: [
|
|
566
|
-
|
|
785
|
+
S("Shutting down", "SessionManagement:"),
|
|
567
786
|
"disposeOldSession"
|
|
568
787
|
],
|
|
569
788
|
states: {
|
|
570
789
|
ProcessChanges: {
|
|
571
790
|
entry: [
|
|
572
|
-
|
|
573
|
-
|
|
791
|
+
S("Entering ProcessChanges", "SessionManagement:"),
|
|
792
|
+
I(
|
|
574
793
|
2
|
|
575
794
|
/* Other */
|
|
576
795
|
)
|
|
@@ -583,8 +802,8 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
|
|
|
583
802
|
},
|
|
584
803
|
DisposeSession: {
|
|
585
804
|
entry: [
|
|
586
|
-
|
|
587
|
-
|
|
805
|
+
S("Entering DisposeSession", "SessionManagement:"),
|
|
806
|
+
I(
|
|
588
807
|
2
|
|
589
808
|
/* Other */
|
|
590
809
|
)
|
|
@@ -596,8 +815,8 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
|
|
|
596
815
|
},
|
|
597
816
|
CreateSession: {
|
|
598
817
|
entry: [
|
|
599
|
-
|
|
600
|
-
|
|
818
|
+
S("Entering CreateSession", "SessionManagement:"),
|
|
819
|
+
I(
|
|
601
820
|
0
|
|
602
821
|
/* CreateSession */
|
|
603
822
|
)
|
|
@@ -617,8 +836,8 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
|
|
|
617
836
|
},
|
|
618
837
|
SessionCreationFailed: {
|
|
619
838
|
entry: [
|
|
620
|
-
|
|
621
|
-
|
|
839
|
+
S("Entering SessionCreationFailed", "SessionManagement:"),
|
|
840
|
+
I(
|
|
622
841
|
2
|
|
623
842
|
/* Other */
|
|
624
843
|
)
|
|
@@ -630,20 +849,20 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
|
|
|
630
849
|
cond: "shallImmediatelyProcessChangesAfterSessionCreationError"
|
|
631
850
|
},
|
|
632
851
|
exit: [
|
|
633
|
-
|
|
852
|
+
S("Exiting SessionCreationFailed", "SessionManagement:"),
|
|
634
853
|
"clearSessionCreationError"
|
|
635
854
|
],
|
|
636
855
|
on: {
|
|
637
856
|
RetrySessionCreation: {
|
|
638
857
|
target: "ProcessChanges",
|
|
639
|
-
actions:
|
|
858
|
+
actions: S("Retrying session creation", "SessionManagement:")
|
|
640
859
|
}
|
|
641
860
|
}
|
|
642
861
|
},
|
|
643
862
|
UpdateSession: {
|
|
644
863
|
entry: [
|
|
645
|
-
|
|
646
|
-
|
|
864
|
+
S("Entering UpdateSession", "SessionManagement:"),
|
|
865
|
+
I(
|
|
647
866
|
1
|
|
648
867
|
/* UpdateSession */
|
|
649
868
|
)
|
|
@@ -662,8 +881,8 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
|
|
|
662
881
|
},
|
|
663
882
|
SessionUpdateFailed: {
|
|
664
883
|
entry: [
|
|
665
|
-
|
|
666
|
-
|
|
884
|
+
S("Entering SessionUpdateFailed", "SessionManagement:"),
|
|
885
|
+
I(
|
|
667
886
|
2
|
|
668
887
|
/* Other */
|
|
669
888
|
)
|
|
@@ -675,43 +894,43 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
|
|
|
675
894
|
cond: "shallImmediatelyProcessChangesAfterSessionUpdateError"
|
|
676
895
|
},
|
|
677
896
|
exit: [
|
|
678
|
-
|
|
897
|
+
S("Exiting SessionUpdateFailed", "SessionManagement:"),
|
|
679
898
|
"clearSessionUpdateError"
|
|
680
899
|
],
|
|
681
900
|
on: {
|
|
682
901
|
RetrySessionUpdate: {
|
|
683
902
|
target: "ProcessChanges",
|
|
684
|
-
actions:
|
|
903
|
+
actions: S("Retrying session update", "SessionManagement:")
|
|
685
904
|
}
|
|
686
905
|
}
|
|
687
906
|
}
|
|
688
907
|
}
|
|
689
908
|
}, {
|
|
690
909
|
actions: {
|
|
691
|
-
saveDesiredClient:
|
|
910
|
+
saveDesiredClient: C({
|
|
692
911
|
desiredClient: (e, n) => n.client
|
|
693
912
|
}),
|
|
694
|
-
saveDesiredSessionContext:
|
|
913
|
+
saveDesiredSessionContext: C({
|
|
695
914
|
desiredSessionContext: (e, n) => n.sessionContext
|
|
696
915
|
}),
|
|
697
|
-
disposeOldSession:
|
|
916
|
+
disposeOldSession: C((e, n) => (e.session && e.session.close().then(Je).catch((t) => {
|
|
698
917
|
}), {
|
|
699
918
|
session: null,
|
|
700
919
|
actualClient: null
|
|
701
920
|
})),
|
|
702
|
-
setSessionCreationResult:
|
|
921
|
+
setSessionCreationResult: C((e, n) => ({
|
|
703
922
|
session: n.data.session,
|
|
704
923
|
actualClient: n.data.client
|
|
705
924
|
})),
|
|
706
|
-
setSessionCreationError:
|
|
925
|
+
setSessionCreationError: C((e, n) => ({
|
|
707
926
|
sessionCreationError: n.data
|
|
708
927
|
})),
|
|
709
|
-
clearSessionCreationError:
|
|
710
|
-
setSessionUpdateError:
|
|
928
|
+
clearSessionCreationError: C({ sessionCreationError: () => null }),
|
|
929
|
+
setSessionUpdateError: C((e, n) => ({
|
|
711
930
|
sessionUpdateError: n.data
|
|
712
931
|
})),
|
|
713
|
-
clearSessionUpdateError:
|
|
714
|
-
setHasEverSuccessfullyCreatedSession:
|
|
932
|
+
clearSessionUpdateError: C({ sessionUpdateError: () => null }),
|
|
933
|
+
setHasEverSuccessfullyCreatedSession: C({
|
|
715
934
|
hasEverSuccessfullyCreatedSession: () => !0
|
|
716
935
|
})
|
|
717
936
|
},
|
|
@@ -730,38 +949,38 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
|
|
|
730
949
|
}))
|
|
731
950
|
},
|
|
732
951
|
guards: {
|
|
733
|
-
shallDisposeSession: (e) => e.session != null && (e.desiredSessionContext == null || e.desiredClient == null || !
|
|
952
|
+
shallDisposeSession: (e) => e.session != null && (e.desiredSessionContext == null || e.desiredClient == null || !L.equals(e.actualClient, e.desiredClient)),
|
|
734
953
|
shallCreateSession: (e) => e.session == null && e.desiredClient != null && e.desiredSessionContext != null,
|
|
735
|
-
shallUpdateSession: (e) => e.session != null && !
|
|
954
|
+
shallUpdateSession: (e) => e.session != null && !J.equals(e.session.getSessionContext(), e.desiredSessionContext),
|
|
736
955
|
shallImmediatelyProcessChangesAfterSessionCreationError: (e) => (
|
|
737
956
|
// The desired client and the desired session context is not the same that resulted in the error.
|
|
738
|
-
!
|
|
957
|
+
!L.equals(e.desiredClient, e.sessionCreationError.client) || !ee(J).equals(e.desiredSessionContext, e.sessionCreationError.sessionContext)
|
|
739
958
|
),
|
|
740
959
|
shallImmediatelyProcessChangesAfterSessionUpdateError: (e) => (
|
|
741
960
|
// The desired client was changed
|
|
742
|
-
!
|
|
961
|
+
!L.equals(e.desiredClient, e.actualClient) || !ee(J).equals(e.desiredSessionContext, e.sessionUpdateError.sessionContext)
|
|
743
962
|
)
|
|
744
963
|
}
|
|
745
964
|
});
|
|
746
|
-
function
|
|
965
|
+
function I(e) {
|
|
747
966
|
const n = e === 0, t = e === 1;
|
|
748
|
-
return
|
|
749
|
-
const
|
|
967
|
+
return Ke((i, o) => {
|
|
968
|
+
const s = {
|
|
750
969
|
isInitializing: (!i.hasEverSuccessfullyCreatedSession || n) && i.sessionCreationError == null,
|
|
751
970
|
errorType: i.sessionCreationError && i.sessionCreationError.type
|
|
752
|
-
},
|
|
971
|
+
}, a = {
|
|
753
972
|
isUpdating: t && i.sessionUpdateError == null,
|
|
754
973
|
errorType: i.sessionUpdateError && i.sessionUpdateError.type
|
|
755
974
|
};
|
|
756
|
-
return
|
|
975
|
+
return de({
|
|
757
976
|
type: "SessionManagementStateChanged",
|
|
758
|
-
sessionInitialization:
|
|
759
|
-
sessionUpdating:
|
|
977
|
+
sessionInitialization: s,
|
|
978
|
+
sessionUpdating: a,
|
|
760
979
|
session: i.session
|
|
761
980
|
});
|
|
762
981
|
});
|
|
763
982
|
}
|
|
764
|
-
const
|
|
983
|
+
const it = (e) => (n) => (n({
|
|
765
984
|
type: "ConfigurationChanged",
|
|
766
985
|
session: e,
|
|
767
986
|
configuration: e.getConfiguration()
|
|
@@ -773,7 +992,7 @@ const dn = (e) => (n) => (n({
|
|
|
773
992
|
});
|
|
774
993
|
}), () => {
|
|
775
994
|
e.setOnConfigurationChangedHandler(null);
|
|
776
|
-
}),
|
|
995
|
+
}), ot = () => ne({
|
|
777
996
|
predictableActionArguments: !0,
|
|
778
997
|
preserveActionOrder: !0,
|
|
779
998
|
schema: {
|
|
@@ -787,7 +1006,7 @@ const dn = (e) => (n) => (n({
|
|
|
787
1006
|
// Forward the configuration data to the parent.
|
|
788
1007
|
ConfigurationChanged: {
|
|
789
1008
|
actions: [
|
|
790
|
-
|
|
1009
|
+
de((e, n) => n)
|
|
791
1010
|
]
|
|
792
1011
|
}
|
|
793
1012
|
},
|
|
@@ -795,7 +1014,7 @@ const dn = (e) => (n) => (n({
|
|
|
795
1014
|
states: {
|
|
796
1015
|
ProcessChanges: {
|
|
797
1016
|
entry: [
|
|
798
|
-
|
|
1017
|
+
S("Entering ProcessChanges", "ConfigurationSubscriptionManagement:")
|
|
799
1018
|
],
|
|
800
1019
|
on: {
|
|
801
1020
|
ChangeSession: {
|
|
@@ -813,7 +1032,7 @@ const dn = (e) => (n) => (n({
|
|
|
813
1032
|
},
|
|
814
1033
|
Subscribe: {
|
|
815
1034
|
entry: [
|
|
816
|
-
|
|
1035
|
+
S("Entering Subscribe", "ConfigurationSubscriptionManagement:")
|
|
817
1036
|
],
|
|
818
1037
|
on: {
|
|
819
1038
|
ChangeSession: {
|
|
@@ -826,33 +1045,33 @@ const dn = (e) => (n) => (n({
|
|
|
826
1045
|
},
|
|
827
1046
|
invoke: {
|
|
828
1047
|
id: "configurationSubscriptionActor",
|
|
829
|
-
src: (e, n) =>
|
|
1048
|
+
src: (e, n) => it(e.session)
|
|
830
1049
|
}
|
|
831
1050
|
}
|
|
832
1051
|
}
|
|
833
1052
|
}, {
|
|
834
1053
|
actions: {
|
|
835
|
-
saveSession:
|
|
1054
|
+
saveSession: C((e, n) => ({
|
|
836
1055
|
session: n.session
|
|
837
1056
|
}))
|
|
838
1057
|
}
|
|
839
|
-
}),
|
|
1058
|
+
}), st = () => {
|
|
840
1059
|
let e, n;
|
|
841
1060
|
return {
|
|
842
|
-
promise: new Promise((i,
|
|
843
|
-
e = i, n =
|
|
1061
|
+
promise: new Promise((i, o) => {
|
|
1062
|
+
e = i, n = o;
|
|
844
1063
|
}),
|
|
845
1064
|
resolve: e,
|
|
846
1065
|
reject: n
|
|
847
1066
|
};
|
|
848
|
-
},
|
|
849
|
-
const e =
|
|
1067
|
+
}, fe = () => {
|
|
1068
|
+
const e = st();
|
|
850
1069
|
return {
|
|
851
1070
|
capsule: { promise: e.promise },
|
|
852
1071
|
resolve: e.resolve,
|
|
853
1072
|
reject: e.reject
|
|
854
1073
|
};
|
|
855
|
-
},
|
|
1074
|
+
}, rt = () => ne({
|
|
856
1075
|
predictableActionArguments: !0,
|
|
857
1076
|
preserveActionOrder: !0,
|
|
858
1077
|
schema: {
|
|
@@ -866,50 +1085,50 @@ const dn = (e) => (n) => (n({
|
|
|
866
1085
|
sessionUpdating: null,
|
|
867
1086
|
session: null,
|
|
868
1087
|
configuration: null,
|
|
869
|
-
isReadyPromise:
|
|
1088
|
+
isReadyPromise: fe()
|
|
870
1089
|
},
|
|
871
1090
|
entry: [
|
|
872
|
-
|
|
873
|
-
sessionManagementActor: () =>
|
|
874
|
-
configurationSubscriptionManagementActor: () =>
|
|
1091
|
+
C({
|
|
1092
|
+
sessionManagementActor: () => ae(tt()),
|
|
1093
|
+
configurationSubscriptionManagementActor: () => ae(ot())
|
|
875
1094
|
})
|
|
876
1095
|
],
|
|
877
1096
|
exit: [
|
|
878
|
-
|
|
879
|
-
|
|
1097
|
+
ue((e) => e.sessionManagementActor),
|
|
1098
|
+
ue((e) => e.configurationSubscriptionManagementActor)
|
|
880
1099
|
],
|
|
881
1100
|
on: {
|
|
882
1101
|
// Forward events for sessionManagement
|
|
883
1102
|
ChangeConfigurationClient: {
|
|
884
1103
|
actions: [
|
|
885
|
-
|
|
1104
|
+
F((e) => e.sessionManagementActor)
|
|
886
1105
|
]
|
|
887
1106
|
},
|
|
888
1107
|
ChangeSessionContext: {
|
|
889
1108
|
actions: [
|
|
890
|
-
|
|
1109
|
+
F((e) => e.sessionManagementActor)
|
|
891
1110
|
]
|
|
892
1111
|
},
|
|
893
1112
|
RetrySessionCreation: {
|
|
894
1113
|
actions: [
|
|
895
|
-
|
|
1114
|
+
F((e) => e.sessionManagementActor)
|
|
896
1115
|
]
|
|
897
1116
|
},
|
|
898
1117
|
RetrySessionUpdate: {
|
|
899
1118
|
actions: [
|
|
900
|
-
|
|
1119
|
+
F((e) => e.sessionManagementActor)
|
|
901
1120
|
]
|
|
902
1121
|
},
|
|
903
1122
|
SessionManagementStateChanged: {
|
|
904
1123
|
actions: [
|
|
905
1124
|
// Assign the received data
|
|
906
|
-
|
|
1125
|
+
C((e, n) => ({
|
|
907
1126
|
session: n.session,
|
|
908
1127
|
sessionInitialization: n.sessionInitialization,
|
|
909
1128
|
sessionUpdating: n.sessionUpdating
|
|
910
1129
|
})),
|
|
911
1130
|
// Forward the session to the configuration subscription
|
|
912
|
-
|
|
1131
|
+
Ge((e) => ({
|
|
913
1132
|
type: "ChangeSession",
|
|
914
1133
|
session: e.session
|
|
915
1134
|
}), { to: (e) => e.configurationSubscriptionManagementActor }),
|
|
@@ -918,7 +1137,7 @@ const dn = (e) => (n) => (n({
|
|
|
918
1137
|
},
|
|
919
1138
|
ConfigurationChanged: {
|
|
920
1139
|
actions: [
|
|
921
|
-
|
|
1140
|
+
C((e, n) => ({
|
|
922
1141
|
configuration: {
|
|
923
1142
|
session: n.session,
|
|
924
1143
|
configuration: n.configuration
|
|
@@ -934,30 +1153,30 @@ const dn = (e) => (n) => (n({
|
|
|
934
1153
|
}
|
|
935
1154
|
}, {
|
|
936
1155
|
actions: {
|
|
937
|
-
calculateReadyState:
|
|
938
|
-
var
|
|
939
|
-
const t = !((
|
|
1156
|
+
calculateReadyState: C((e, n) => {
|
|
1157
|
+
var o;
|
|
1158
|
+
const t = !((o = e.sessionInitialization) != null && o.isInitializing) && e.session != null && e.configuration != null && e.configuration.session === e.session;
|
|
940
1159
|
return e.isReadyPromise && t && (e.isReadyPromise.resolve(), e.isReadyPromise.capsule.promise = null), {
|
|
941
|
-
isReadyPromise: (() => t ? null : e.isReadyPromise != null ? e.isReadyPromise :
|
|
1160
|
+
isReadyPromise: (() => t ? null : e.isReadyPromise != null ? e.isReadyPromise : fe())()
|
|
942
1161
|
};
|
|
943
1162
|
})
|
|
944
1163
|
}
|
|
945
1164
|
});
|
|
946
|
-
function
|
|
947
|
-
var
|
|
948
|
-
const [n, t] =
|
|
1165
|
+
function at(e) {
|
|
1166
|
+
var a, c;
|
|
1167
|
+
const [n, t] = Qe(rt, {
|
|
949
1168
|
logger: (...u) => console.log("ConfigurationManagement:", ...u)
|
|
950
1169
|
});
|
|
951
|
-
|
|
1170
|
+
re(() => {
|
|
952
1171
|
t({
|
|
953
1172
|
type: "ChangeConfigurationClient",
|
|
954
1173
|
client: e.configuratorClient
|
|
955
1174
|
}), e.configuratorClient || console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.");
|
|
956
|
-
}, [e.configuratorClient]),
|
|
1175
|
+
}, [e.configuratorClient]), re(() => {
|
|
957
1176
|
const u = r(
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1177
|
+
l(e.sessionContext),
|
|
1178
|
+
dn((d) => l(d.configurationModelSource)),
|
|
1179
|
+
V
|
|
961
1180
|
);
|
|
962
1181
|
t({
|
|
963
1182
|
type: "ChangeSessionContext",
|
|
@@ -966,74 +1185,74 @@ function mn(e) {
|
|
|
966
1185
|
}, [e.sessionContext]);
|
|
967
1186
|
const i = m(
|
|
968
1187
|
() => {
|
|
969
|
-
var u,
|
|
1188
|
+
var u, d, p, x;
|
|
970
1189
|
return {
|
|
971
|
-
isInitializing: ((
|
|
972
|
-
isInitializingPromise: (
|
|
973
|
-
error: ((
|
|
1190
|
+
isInitializing: ((d = (u = n.context.isReadyPromise) == null ? void 0 : u.capsule) == null ? void 0 : d.promise) != null,
|
|
1191
|
+
isInitializingPromise: (p = n.context.isReadyPromise) == null ? void 0 : p.capsule,
|
|
1192
|
+
error: ((x = n.context.sessionInitialization) == null ? void 0 : x.errorType) && {
|
|
974
1193
|
type: n.context.sessionInitialization.errorType,
|
|
975
1194
|
retry: () => t({ type: "RetrySessionCreation" })
|
|
976
1195
|
}
|
|
977
1196
|
};
|
|
978
1197
|
},
|
|
979
1198
|
[n.context.sessionInitialization, n.context.isReadyPromise]
|
|
980
|
-
),
|
|
1199
|
+
), o = m(
|
|
981
1200
|
() => {
|
|
982
|
-
var u,
|
|
1201
|
+
var u, d;
|
|
983
1202
|
return {
|
|
984
1203
|
isUpdating: (u = n.context.sessionUpdating) == null ? void 0 : u.isUpdating,
|
|
985
|
-
error: ((
|
|
1204
|
+
error: ((d = n.context.sessionUpdating) == null ? void 0 : d.errorType) && {
|
|
986
1205
|
type: n.context.sessionUpdating.errorType,
|
|
987
1206
|
retry: () => t({ type: "RetrySessionUpdate" })
|
|
988
1207
|
}
|
|
989
1208
|
};
|
|
990
1209
|
},
|
|
991
1210
|
[n.context.sessionUpdating]
|
|
992
|
-
),
|
|
1211
|
+
), s = ((a = n.context.configuration) == null ? void 0 : a.session) === n.context.session ? (c = n.context.configuration) == null ? void 0 : c.configuration : null;
|
|
993
1212
|
return {
|
|
994
1213
|
configurationInitialization: i,
|
|
995
|
-
configurationUpdating:
|
|
1214
|
+
configurationUpdating: o,
|
|
996
1215
|
session: n.context.session,
|
|
997
|
-
configuration:
|
|
1216
|
+
configuration: s
|
|
998
1217
|
};
|
|
999
1218
|
}
|
|
1000
|
-
function
|
|
1001
|
-
const { configurationInitialization: n, configurationUpdating: t, session: i, configuration:
|
|
1219
|
+
function Et(e) {
|
|
1220
|
+
const { configurationInitialization: n, configurationUpdating: t, session: i, configuration: o } = at({
|
|
1002
1221
|
configuratorClient: e.configuratorClient,
|
|
1003
1222
|
sessionContext: e
|
|
1004
1223
|
});
|
|
1005
|
-
return /* @__PURE__ */
|
|
1224
|
+
return /* @__PURE__ */ k($e.Provider, { value: n, children: /* @__PURE__ */ k(Be.Provider, { value: t, children: /* @__PURE__ */ k(Fe.Provider, { value: i, children: /* @__PURE__ */ k(je.Provider, { value: o, children: e.children }) }) }) });
|
|
1006
1225
|
}
|
|
1007
|
-
function
|
|
1008
|
-
return
|
|
1226
|
+
function ut() {
|
|
1227
|
+
return B($e);
|
|
1009
1228
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return
|
|
1229
|
+
function At() {
|
|
1230
|
+
return B(Be);
|
|
1012
1231
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const { children: n } = e, { isInitializingPromise: t } =
|
|
1232
|
+
function Pt(e) {
|
|
1233
|
+
const { children: n } = e, { isInitializingPromise: t } = ut();
|
|
1015
1234
|
if (t != null && t.promise)
|
|
1016
1235
|
throw t.promise;
|
|
1017
|
-
return /* @__PURE__ */
|
|
1236
|
+
return /* @__PURE__ */ k(We, { children: n });
|
|
1018
1237
|
}
|
|
1019
|
-
function
|
|
1020
|
-
const e =
|
|
1021
|
-
return
|
|
1238
|
+
function Mt() {
|
|
1239
|
+
const e = oe(), n = N();
|
|
1240
|
+
return se(e), T(n), m(() => ({
|
|
1022
1241
|
configuration: n,
|
|
1023
1242
|
restoreConfiguration: (t) => e.restoreConfiguration(t)
|
|
1024
1243
|
}), [n, e]);
|
|
1025
1244
|
}
|
|
1026
1245
|
export {
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1246
|
+
Et as Configuration,
|
|
1247
|
+
Pt as ConfigurationSuspender,
|
|
1248
|
+
ht as useAttributes,
|
|
1249
|
+
yt as useBooleanAttribute,
|
|
1250
|
+
mt as useChoiceAttribute,
|
|
1251
|
+
vt as useComponentAttribute,
|
|
1252
|
+
Mt as useConfiguration,
|
|
1253
|
+
ut as useConfigurationInitialization,
|
|
1254
|
+
At as useConfigurationUpdating,
|
|
1255
|
+
K as useDecision,
|
|
1256
|
+
Vn as useExplain,
|
|
1257
|
+
St as useNumericAttribute
|
|
1039
1258
|
};
|