@airalogy/aimd-recorder 1.25.0 → 1.26.0
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/README.md +16 -0
- package/README.zh-CN.md +16 -0
- package/dist/{AimdDnaSequenceField-BHV1_c2o.js → AimdDnaSequenceField-CKfd3-_9.js} +1 -1
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-phvUVTHV.js → AimdEditor.vue_vue_type_style_index_0_lang-C1XlvrNT.js} +8311 -7173
- package/dist/{AimdEntityRefField-COzwbHwr.js → AimdEntityRefField-CX67car3.js} +1 -1
- package/dist/{AimdEntityRefField.vue_vue_type_script_setup_true_lang-BIvUuZFV.js → AimdEntityRefField.vue_vue_type_script_setup_true_lang-JISqbfKY.js} +1 -1
- package/dist/{AimdMarkdownField-t8hqazDv.js → AimdMarkdownField-BuRsjOB5.js} +9 -9
- package/dist/{AimdMarkdownNoteField-BGjkSXEY.js → AimdMarkdownNoteField-NRA9ut3_.js} +6 -6
- package/dist/{AimdResourceRefField-BBaRSLcL.js → AimdResourceRefField-B71MVFFK.js} +2 -2
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-CsBMJYPv.js → arc-2NNDEUZL.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-BeKUSqHO.js → architectureDiagram-3BPJPVTR-BGU_a_9z.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-CJeAC_1p.js → blockDiagram-GPEHLZMM-ChLqLSJn.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-LoQMp4kW.js → c4Diagram-AAUBKEIU-BXt823OA.js} +2 -2
- package/dist/{channel-BoLQO6Dk.js → channel-D1EuKFn5.js} +1 -1
- package/dist/{chunk-2J33WTMH-D1vw38h5.js → chunk-2J33WTMH-XJPmqQtr.js} +1 -1
- package/dist/{chunk-4BX2VUAB-BFSVnsyi.js → chunk-4BX2VUAB-CbV5jCeG.js} +1 -1
- package/dist/{chunk-55IACEB6-D13UaCP1.js → chunk-55IACEB6-C8gv1Mc0.js} +1 -1
- package/dist/{chunk-727SXJPM-BCcz4POX.js → chunk-727SXJPM-Bs2EpCWN.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-DTOfpg2m.js → chunk-AQP2D5EJ-CngahRo6.js} +3 -3
- package/dist/{chunk-FMBD7UC4-XGRN-sFg.js → chunk-FMBD7UC4-DPBfEP1E.js} +1 -1
- package/dist/{chunk-ND2GUHAM-DSgp1I9F.js → chunk-ND2GUHAM-BlEzeiST.js} +1 -1
- package/dist/{chunk-QZHKN3VN-DQl3-kKo.js → chunk-QZHKN3VN-DGOFj8Bc.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-CI-4bhme.js → classDiagram-4FO5ZUOK-BUQqoFF9.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-CI-4bhme.js → classDiagram-v2-Q7XG4LA2-BUQqoFF9.js} +2 -2
- package/dist/components.js +3885 -3650
- package/dist/composables.js +55 -53
- package/dist/{cose-bilkent-S5V4N54A-CU1K-fx3.js → cose-bilkent-S5V4N54A-Qxs9suxa.js} +1 -1
- package/dist/{dagre-BM42HDAG-HIHsvvPF.js → dagre-BM42HDAG-CqV8IXIy.js} +3 -3
- package/dist/{diagram-2AECGRRQ-XlYRVMia.js → diagram-2AECGRRQ-D0mYOaE1.js} +2 -2
- package/dist/{diagram-5GNKFQAL-BeA9dVE2.js → diagram-5GNKFQAL-Dvjcs9SL.js} +3 -3
- package/dist/{diagram-KO2AKTUF-D501LuyG.js → diagram-KO2AKTUF-rSovr72L.js} +2 -2
- package/dist/{diagram-LMA3HP47-ClkmdOf_.js → diagram-LMA3HP47-CirCeq88.js} +2 -2
- package/dist/{diagram-OG6HWLK6-30O5epks.js → diagram-OG6HWLK6-rk46c1hT.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-Dk5azNFu.js → erDiagram-TEJ5UH35--_m5yDSV.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-C4K9bB2d.js → flowDiagram-I6XJVG4X-DU-TlDfY.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-sFuSkRH3.js → ganttDiagram-6RSMTGT7-CrMwQSQi.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-CC4Kf_0S.js → gitGraphDiagram-PVQCEYII-Q-bwtX2H.js} +3 -3
- package/dist/{graph-BBr12s4M.js → graph-CvyYQarK.js} +58 -58
- package/dist/index.js +124 -121
- package/dist/{infoDiagram-5YYISTIA-PObcwLKW.js → infoDiagram-5YYISTIA-BejjAcMI.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-B93dpm60.js → ishikawaDiagram-YF4QCWOH-CbRBA5Ak.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-Z0_jIQ5z.js → journeyDiagram-JHISSGLW-D_6-qOB8.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-BicW7pfZ.js → kanban-definition-UN3LZRKU-DyGjEqu5.js} +2 -2
- package/dist/{layout-jm5q2dTB.js → layout-Z5g42JDg.js} +93 -93
- package/dist/{linear-Bv4EbUf4.js → linear-DSunMwcT.js} +1 -1
- package/dist/{mermaid.core-BN0BM26i.js → mermaid.core-B-O2uDZ3.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-Ba85mo62.js → mindmap-definition-RKZ34NQL-CC_NhwV9.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-CfU3ahlI.js → pieDiagram-4H26LBE5-CHlBAazu.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-BPTjR1PA.js → quadrantDiagram-W4KKPZXB-BM6pMzVZ.js} +2 -2
- package/dist/record.js +23 -23
- package/dist/{requirementDiagram-4Y6WPE33-DVfyUAUL.js → requirementDiagram-4Y6WPE33-CNkZDYpb.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-B_9c0VJt.js → sankeyDiagram-5OEKKPKP-Cq6DjItn.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-BFSDCMig.js → sequenceDiagram-3UESZ5HK-BIzn9dmF.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-DNCya3UT.js → stateDiagram-AJRCARHV-DbSpH-v9.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-BlmsFnk2.js → stateDiagram-v2-BHNVJYJU-Cnv8BTgy.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-B297WQKg.js → timeline-definition-PNZ67QCA-Bhs5_-8Z.js} +2 -2
- package/dist/useCodeBlockRendering-IjoDTQ64.js +35 -0
- package/dist/{useFieldRendering-DQN_MbSg.js → useFieldRendering-r1bAnHjk.js} +253 -254
- package/dist/useVarHelpers-xrbf4f60.js +7008 -0
- package/dist/{validation-Dn_j1py1.js → validation-ZmPcMCY0.js} +991 -989
- package/dist/{vennDiagram-CIIHVFJN-gDmDgx6K.js → vennDiagram-CIIHVFJN-DJSLUotN.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-ek5B-FUl.js → wardleyDiagram-YWT4CUSO-Bk66hVLg.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-DRtlxacH.js → xychartDiagram-2RQKCTM6-Bss5MLVp.js} +2 -2
- package/package.json +4 -4
- package/src/__tests__/check-field-render.test.ts +65 -0
- package/src/__tests__/compact-field-types.test.ts +181 -0
- package/src/__tests__/compact-fields.test.ts +31 -0
- package/src/__tests__/multi-select-field.test.ts +54 -0
- package/src/__tests__/quoted-check-wysiwyg.test.ts +56 -0
- package/src/__tests__/recorder-field-authoring.test.ts +92 -0
- package/src/__tests__/recorder-wysiwyg-field-host.test.ts +115 -1
- package/src/__tests__/step-field.test.ts +54 -1
- package/src/components/AimdMultiSelectField.vue +56 -0
- package/src/components/AimdRecorder.vue +21 -4
- package/src/components/AimdRecorderEditor.vue +4 -0
- package/src/components/AimdRecorderWysiwygFieldHost.vue +8 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +220 -8
- package/src/components/AimdStepCheckField.vue +36 -7
- package/src/components/AimdVarField.vue +48 -4
- package/src/components/AimdVarTableField.vue +3 -0
- package/src/components/index.ts +2 -0
- package/src/components/recorderMilkdownPlugin.ts +36 -6
- package/src/composables/__tests__/useVarHelpers.test.ts +15 -0
- package/src/composables/__tests__/workbenchFieldEditing.test.ts +10 -0
- package/src/composables/index.ts +3 -0
- package/src/composables/useFieldPresentation.ts +7 -0
- package/src/composables/useFieldRendering.ts +1 -0
- package/src/composables/useVarHelpers.ts +20 -101
- package/src/composables/workbenchFieldEditing.ts +5 -7
- package/src/index.ts +1 -0
- package/src/record/validation.ts +6 -0
- package/src/styles/recorder-compact.css +45 -0
- package/src/styles/recorder-surface.css +14 -5
- package/src/styles/recorder.css +4 -0
- package/src/type-utils.ts +5 -1
- package/src/types.ts +1 -1
- package/dist/useCodeBlockRendering-D2viVPtA.js +0 -3158
- package/dist/useVarHelpers-D00Za8e6.js +0 -3524
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { f as q,
|
|
3
|
-
import { p as Ae } from "./useCodeBlockRendering-D2viVPtA.js";
|
|
1
|
+
import { reactive as $ } from "vue";
|
|
2
|
+
import { f as q, b3 as re, a2 as ne, T as oe, b4 as ie, b5 as se, b6 as ae, b7 as ce, m as le, a5 as ue, b8 as fe, b9 as de, a6 as D, Z as L, a0 as me, C as pe, B as ge, ag as ye, ba as B, I as H, q as we, ai as be, H as he, b2 as Ae } from "./useVarHelpers-xrbf4f60.js";
|
|
4
3
|
function x(e) {
|
|
5
4
|
return typeof e == "string" && e.trim() ? e.trim() : void 0;
|
|
6
5
|
}
|
|
@@ -101,7 +100,7 @@ function X(e) {
|
|
|
101
100
|
function je(e) {
|
|
102
101
|
return e.replace(/\s+/g, "").match(/Observation\[(.+?)\]/)?.[1] ?? "str";
|
|
103
102
|
}
|
|
104
|
-
function
|
|
103
|
+
function dt(e, t) {
|
|
105
104
|
const r = je(e).toLowerCase();
|
|
106
105
|
if (r === "str" || r === "string") return { ok: !0, value: t };
|
|
107
106
|
if (r === "int" || r === "integer")
|
|
@@ -120,8 +119,8 @@ function mt(e, t) {
|
|
|
120
119
|
return { ok: !1 };
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
|
-
function
|
|
124
|
-
const t =
|
|
122
|
+
function mt(e) {
|
|
123
|
+
const t = $({}), r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
125
124
|
let s = 0;
|
|
126
125
|
function c(o) {
|
|
127
126
|
return Ee(e.fields(), o);
|
|
@@ -129,7 +128,7 @@ function pt(e) {
|
|
|
129
128
|
function f(o) {
|
|
130
129
|
const a = t[o];
|
|
131
130
|
if (a) return a;
|
|
132
|
-
const u =
|
|
131
|
+
const u = $({
|
|
133
132
|
status: "idle",
|
|
134
133
|
sampleCount: W(e.record.var[o])
|
|
135
134
|
});
|
|
@@ -138,13 +137,13 @@ function pt(e) {
|
|
|
138
137
|
function d(o, a) {
|
|
139
138
|
Object.assign(f(o), a);
|
|
140
139
|
}
|
|
141
|
-
function
|
|
140
|
+
function g(o, a) {
|
|
142
141
|
const u = c(o);
|
|
143
142
|
if (!u) return;
|
|
144
|
-
const m = e.record.var[o],
|
|
145
|
-
e.onChange(o,
|
|
143
|
+
const m = e.record.var[o], p = u.isList ? [...Array.isArray(m) ? m : [], a] : a;
|
|
144
|
+
e.onChange(o, p), d(o, {
|
|
146
145
|
lastObservedAt: a.observed_at,
|
|
147
|
-
sampleCount: W(
|
|
146
|
+
sampleCount: W(p)
|
|
148
147
|
});
|
|
149
148
|
}
|
|
150
149
|
async function h(o) {
|
|
@@ -170,7 +169,7 @@ function pt(e) {
|
|
|
170
169
|
record: q(e.record),
|
|
171
170
|
signal: a
|
|
172
171
|
});
|
|
173
|
-
a.aborted ||
|
|
172
|
+
a.aborted || g(o.field.id, ve(m, o));
|
|
174
173
|
}
|
|
175
174
|
async function E(o) {
|
|
176
175
|
const a = c(o);
|
|
@@ -186,14 +185,14 @@ function pt(e) {
|
|
|
186
185
|
const u = s;
|
|
187
186
|
i.add(o);
|
|
188
187
|
try {
|
|
189
|
-
const
|
|
188
|
+
const p = await h(a);
|
|
190
189
|
if (u !== s) return;
|
|
191
|
-
if (!
|
|
190
|
+
if (!p) {
|
|
192
191
|
d(o, { status: "error", error: "permission_denied" });
|
|
193
192
|
return;
|
|
194
193
|
}
|
|
195
|
-
} catch (
|
|
196
|
-
const O = X(
|
|
194
|
+
} catch (p) {
|
|
195
|
+
const O = X(p);
|
|
197
196
|
d(o, { status: "error", error: O }), e.onError?.(O);
|
|
198
197
|
return;
|
|
199
198
|
} finally {
|
|
@@ -207,13 +206,13 @@ function pt(e) {
|
|
|
207
206
|
return;
|
|
208
207
|
}
|
|
209
208
|
d(o, { status: "collecting" });
|
|
210
|
-
const
|
|
209
|
+
const p = a.collector.interval_ms ?? 1e3;
|
|
211
210
|
for (; !m.signal.aborted && (await T(a, m.signal), !m.signal.aborted); )
|
|
212
|
-
await Fe(
|
|
211
|
+
await Fe(p, m.signal);
|
|
213
212
|
d(o, { status: "completed" });
|
|
214
|
-
} catch (
|
|
213
|
+
} catch (p) {
|
|
215
214
|
if (!m.signal.aborted) {
|
|
216
|
-
const O = X(
|
|
215
|
+
const O = X(p);
|
|
217
216
|
d(o, { status: "error", error: O }), e.onError?.(O);
|
|
218
217
|
}
|
|
219
218
|
} finally {
|
|
@@ -234,7 +233,7 @@ function pt(e) {
|
|
|
234
233
|
}
|
|
235
234
|
function v(o, a, u) {
|
|
236
235
|
const m = c(o);
|
|
237
|
-
return !m || !m.collector.manual_fallback || !u.trim() ? !1 : (
|
|
236
|
+
return !m || !m.collector.manual_fallback || !u.trim() ? !1 : (g(o, xe(a, u, m, e.actorId())), d(o, { status: "completed", error: void 0 }), !0);
|
|
238
237
|
}
|
|
239
238
|
function F(o) {
|
|
240
239
|
const a = c(o);
|
|
@@ -255,24 +254,147 @@ function pt(e) {
|
|
|
255
254
|
writeManual: v
|
|
256
255
|
};
|
|
257
256
|
}
|
|
257
|
+
const Ve = [
|
|
258
|
+
{
|
|
259
|
+
pattern: /\b(?:import|export|class|new|async|await|yield|throw|try|catch|switch|while|for|do)\b/,
|
|
260
|
+
message: "contains unsupported control-flow or module syntax"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
pattern: /=>/,
|
|
264
|
+
message: "does not allow arrow functions"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
pattern: /\b(?:window|document|globalThis|self|fetch|XMLHttpRequest|WebSocket|Function|eval|setTimeout|setInterval)\b/,
|
|
268
|
+
message: "uses blocked runtime globals"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
pattern: /\b(?:__proto__|prototype|constructor|this)\b/,
|
|
272
|
+
message: "uses blocked object metaprogramming features"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
pattern: /\bMath\s*\.\s*random\b/,
|
|
276
|
+
message: "must not use randomness"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
pattern: /\bDate\b/,
|
|
280
|
+
message: "must not use time-dependent APIs"
|
|
281
|
+
}
|
|
282
|
+
], De = {
|
|
283
|
+
ImportDeclaration: "contains unsupported control-flow or module syntax",
|
|
284
|
+
ImportExpression: "contains unsupported control-flow or module syntax",
|
|
285
|
+
ExportNamedDeclaration: "contains unsupported control-flow or module syntax",
|
|
286
|
+
ExportDefaultDeclaration: "contains unsupported control-flow or module syntax",
|
|
287
|
+
ExportAllDeclaration: "contains unsupported control-flow or module syntax",
|
|
288
|
+
ClassDeclaration: "contains unsupported control-flow or module syntax",
|
|
289
|
+
ClassExpression: "contains unsupported control-flow or module syntax",
|
|
290
|
+
NewExpression: "contains unsupported control-flow or module syntax",
|
|
291
|
+
ArrowFunctionExpression: "does not allow arrow functions",
|
|
292
|
+
AwaitExpression: "contains unsupported control-flow or module syntax",
|
|
293
|
+
YieldExpression: "contains unsupported control-flow or module syntax",
|
|
294
|
+
ThrowStatement: "contains unsupported control-flow or module syntax",
|
|
295
|
+
TryStatement: "contains unsupported control-flow or module syntax",
|
|
296
|
+
SwitchStatement: "contains unsupported control-flow or module syntax",
|
|
297
|
+
WhileStatement: "contains unsupported control-flow or module syntax",
|
|
298
|
+
ForStatement: "contains unsupported control-flow or module syntax",
|
|
299
|
+
ForInStatement: "contains unsupported control-flow or module syntax",
|
|
300
|
+
ForOfStatement: "contains unsupported control-flow or module syntax",
|
|
301
|
+
DoWhileStatement: "contains unsupported control-flow or module syntax"
|
|
302
|
+
}, Me = /* @__PURE__ */ new Set([
|
|
303
|
+
"window",
|
|
304
|
+
"document",
|
|
305
|
+
"globalThis",
|
|
306
|
+
"self",
|
|
307
|
+
"fetch",
|
|
308
|
+
"XMLHttpRequest",
|
|
309
|
+
"WebSocket",
|
|
310
|
+
"Function",
|
|
311
|
+
"eval",
|
|
312
|
+
"setTimeout",
|
|
313
|
+
"setInterval"
|
|
314
|
+
]), ke = /* @__PURE__ */ new Set([
|
|
315
|
+
"__proto__",
|
|
316
|
+
"prototype",
|
|
317
|
+
"constructor"
|
|
318
|
+
]);
|
|
319
|
+
function z(e, t) {
|
|
320
|
+
if (!(!e || typeof e != "object")) {
|
|
321
|
+
t(e);
|
|
322
|
+
for (const r of Object.keys(e)) {
|
|
323
|
+
if (r === "type" || r === "start" || r === "end") continue;
|
|
324
|
+
const n = e[r];
|
|
325
|
+
if (Array.isArray(n))
|
|
326
|
+
for (const i of n)
|
|
327
|
+
i && typeof i.type == "string" && z(i, t);
|
|
328
|
+
else n && typeof n == "object" && typeof n.type == "string" && z(n, t);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function Y(e, t) {
|
|
333
|
+
if (Me.has(e))
|
|
334
|
+
throw new Error(`client assigner "${t}" uses blocked runtime globals`);
|
|
335
|
+
if (ke.has(e))
|
|
336
|
+
throw new Error(`client assigner "${t}" uses blocked object metaprogramming features`);
|
|
337
|
+
if (e === "Date")
|
|
338
|
+
throw new Error(`client assigner "${t}" must not use time-dependent APIs`);
|
|
339
|
+
}
|
|
340
|
+
function Re(e, t) {
|
|
341
|
+
let r;
|
|
342
|
+
try {
|
|
343
|
+
r = re(e, {
|
|
344
|
+
ecmaVersion: 2022,
|
|
345
|
+
sourceType: "script"
|
|
346
|
+
});
|
|
347
|
+
} catch {
|
|
348
|
+
throw new Error(`client assigner "${t}" contains invalid JavaScript syntax`);
|
|
349
|
+
}
|
|
350
|
+
let n = 0, i = !1;
|
|
351
|
+
if (z(r, (s) => {
|
|
352
|
+
const c = De[s.type];
|
|
353
|
+
if (c)
|
|
354
|
+
throw new Error(`client assigner "${t}" ${c}`);
|
|
355
|
+
if (s.type === "FunctionDeclaration" || s.type === "FunctionExpression") {
|
|
356
|
+
if (n++, s.async)
|
|
357
|
+
throw new Error(`client assigner "${t}" contains unsupported control-flow or module syntax`);
|
|
358
|
+
if (s.generator)
|
|
359
|
+
throw new Error(`client assigner "${t}" contains unsupported control-flow or module syntax`);
|
|
360
|
+
}
|
|
361
|
+
if (s.type === "ReturnStatement" && (i = !0), s.type === "ThisExpression")
|
|
362
|
+
throw new Error(`client assigner "${t}" uses blocked object metaprogramming features`);
|
|
363
|
+
if (s.type === "Identifier" && Y(s.name, t), s.type === "MemberExpression" && s.computed && s.property?.type === "Literal" && typeof s.property.value == "string" && Y(s.property.value, t), s.type === "MemberExpression" && !s.computed && s.object?.type === "Identifier" && s.object.name === "Math" && s.property?.type === "Identifier" && s.property.name === "random")
|
|
364
|
+
throw new Error(`client assigner "${t}" must not use randomness`);
|
|
365
|
+
}), n !== 1)
|
|
366
|
+
throw new Error(`client assigner "${t}" must contain exactly one function definition`);
|
|
367
|
+
if (!i)
|
|
368
|
+
throw new Error(`client assigner "${t}" must return an object containing assigned field values`);
|
|
369
|
+
}
|
|
370
|
+
function Ne(e, t) {
|
|
371
|
+
if ((e.match(/\bfunction\b/g) ?? []).length !== 1)
|
|
372
|
+
throw new Error(`client assigner "${t}" must contain exactly one function definition`);
|
|
373
|
+
for (const { pattern: n, message: i } of Ve)
|
|
374
|
+
if (n.test(e))
|
|
375
|
+
throw new Error(`client assigner "${t}" ${i}`);
|
|
376
|
+
if (!/\breturn\b/.test(e))
|
|
377
|
+
throw new Error(`client assigner "${t}" must return an object containing assigned field values`);
|
|
378
|
+
Re(e, t);
|
|
379
|
+
}
|
|
258
380
|
function A(e) {
|
|
259
381
|
return e !== null && typeof e == "object" && !Array.isArray(e);
|
|
260
382
|
}
|
|
261
|
-
function
|
|
383
|
+
function Ce(e) {
|
|
262
384
|
return A(e) && Object.keys(e).length === 0;
|
|
263
385
|
}
|
|
264
|
-
function
|
|
386
|
+
function Z(e, t) {
|
|
265
387
|
for (const r of t) {
|
|
266
388
|
const n = e[r];
|
|
267
389
|
if (typeof n == "string" && n.trim())
|
|
268
390
|
return n.trim();
|
|
269
391
|
}
|
|
270
392
|
}
|
|
271
|
-
function
|
|
393
|
+
function J(e) {
|
|
272
394
|
if (typeof e == "string" && e.trim())
|
|
273
395
|
return e.trim();
|
|
274
396
|
if (A(e))
|
|
275
|
-
return
|
|
397
|
+
return Z(e, [
|
|
276
398
|
"error_message",
|
|
277
399
|
"errorMessage",
|
|
278
400
|
"message",
|
|
@@ -280,41 +402,41 @@ function Y(e) {
|
|
|
280
402
|
"reason"
|
|
281
403
|
]);
|
|
282
404
|
}
|
|
283
|
-
function
|
|
405
|
+
function Q(e) {
|
|
284
406
|
const t = [e], r = (n) => {
|
|
285
407
|
A(n) && (t.push(n.data), t.push(n.result), A(n.data) && t.push(n.data.result), A(n.result) && t.push(n.result.data));
|
|
286
408
|
};
|
|
287
409
|
return r(e), A(e) && (r(e.data), r(e.result)), t;
|
|
288
410
|
}
|
|
289
|
-
function
|
|
411
|
+
function Le(e) {
|
|
290
412
|
if (typeof e == "string" && e.trim()) return e.trim();
|
|
291
413
|
if (!A(e)) return "";
|
|
292
414
|
const t = e.name ?? e.id;
|
|
293
415
|
return typeof t == "string" && t.trim() ? t.trim() : "";
|
|
294
416
|
}
|
|
295
417
|
function M(e) {
|
|
296
|
-
return Array.isArray(e) ? new Set(e.map(
|
|
418
|
+
return Array.isArray(e) ? new Set(e.map(Le).filter(Boolean)) : /* @__PURE__ */ new Set();
|
|
297
419
|
}
|
|
298
420
|
function ee(e) {
|
|
299
421
|
if (!A(e)) return [];
|
|
300
422
|
const t = e.dependent_fields;
|
|
301
423
|
return Array.isArray(t) ? t.map((r) => typeof r == "string" ? r.trim() : "").filter(Boolean) : [];
|
|
302
424
|
}
|
|
303
|
-
function
|
|
425
|
+
function $e(e) {
|
|
304
426
|
return A(e) ? (Array.isArray(e.assigned_fields) ? e.assigned_fields : Array.isArray(e.assignedFields) ? e.assignedFields : []).map((r) => typeof r == "string" ? r.trim() : "").filter(Boolean) : [];
|
|
305
427
|
}
|
|
306
|
-
function
|
|
428
|
+
function ze(e) {
|
|
307
429
|
if (!A(e)) return "manual";
|
|
308
430
|
const t = e.mode;
|
|
309
431
|
return typeof t == "string" && t.trim() ? t.trim() : "manual";
|
|
310
432
|
}
|
|
311
|
-
function
|
|
433
|
+
function pt(e) {
|
|
312
434
|
return e === "auto" || e === "auto_first" || e === "auto_force" || e === "manual" || e === "manual_readonly" || e === "auto_readonly" ? e : "manual";
|
|
313
435
|
}
|
|
314
|
-
function
|
|
436
|
+
function gt(e) {
|
|
315
437
|
return e === "auto_readonly" || e === "manual_readonly";
|
|
316
438
|
}
|
|
317
|
-
function
|
|
439
|
+
function Pe(e) {
|
|
318
440
|
return {
|
|
319
441
|
var: M(e?.var),
|
|
320
442
|
varTable: M(e?.var_table),
|
|
@@ -322,7 +444,7 @@ function Re(e) {
|
|
|
322
444
|
check: M(e?.check)
|
|
323
445
|
};
|
|
324
446
|
}
|
|
325
|
-
function
|
|
447
|
+
function Ie(e, t = {}) {
|
|
326
448
|
const r = e.trim();
|
|
327
449
|
if (r.includes(".")) {
|
|
328
450
|
const [n, ...i] = r.split(".");
|
|
@@ -330,20 +452,20 @@ function Ne(e, t = {}) {
|
|
|
330
452
|
}
|
|
331
453
|
return t.varTable?.has(r) ? `var_table:${r}` : t.step?.has(r) ? `step:${r}` : t.check?.has(r) ? `check:${r}` : `var:${r}`;
|
|
332
454
|
}
|
|
333
|
-
function
|
|
455
|
+
function yt(e, t) {
|
|
334
456
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
335
457
|
return [];
|
|
336
|
-
const r =
|
|
458
|
+
const r = Pe(t);
|
|
337
459
|
return Object.entries(e).flatMap(([n, i]) => {
|
|
338
460
|
const s = n.trim();
|
|
339
461
|
if (!s) return [];
|
|
340
|
-
const c = A(i) ? i : {}, f =
|
|
462
|
+
const c = A(i) ? i : {}, f = ze(c), d = ee(c);
|
|
341
463
|
return [.../* @__PURE__ */ new Set([
|
|
342
464
|
s,
|
|
343
|
-
|
|
465
|
+
...$e(c)
|
|
344
466
|
])].map((h) => ({
|
|
345
467
|
assignedField: h,
|
|
346
|
-
fieldKey:
|
|
468
|
+
fieldKey: Ie(h, r),
|
|
347
469
|
mode: f,
|
|
348
470
|
dependentFields: d,
|
|
349
471
|
assigner: c
|
|
@@ -353,21 +475,21 @@ function wt(e, t) {
|
|
|
353
475
|
function k(e) {
|
|
354
476
|
if (e !== "") {
|
|
355
477
|
if (Array.isArray(e))
|
|
356
|
-
return e.map((r) => k(r)).filter((r) => r !== void 0 && !
|
|
478
|
+
return e.map((r) => k(r)).filter((r) => r !== void 0 && !Ce(r));
|
|
357
479
|
if (A(e)) {
|
|
358
|
-
const t =
|
|
359
|
-
return
|
|
480
|
+
const t = ie(e);
|
|
481
|
+
return se(t) ? t : Object.fromEntries(
|
|
360
482
|
Object.entries(e).map(([n, i]) => [n, k(i)]).filter(([, n]) => n !== void 0)
|
|
361
483
|
);
|
|
362
484
|
}
|
|
363
485
|
return e;
|
|
364
486
|
}
|
|
365
487
|
}
|
|
366
|
-
function
|
|
488
|
+
function qe(e) {
|
|
367
489
|
const t = k(e);
|
|
368
490
|
return A(t) ? t : {};
|
|
369
491
|
}
|
|
370
|
-
function
|
|
492
|
+
function Be(e, t) {
|
|
371
493
|
if (Object.prototype.hasOwnProperty.call(e.var, t)) return e.var[t];
|
|
372
494
|
if (Object.prototype.hasOwnProperty.call(e.step, t)) return e.step[t];
|
|
373
495
|
if (Object.prototype.hasOwnProperty.call(e.check, t)) return e.check[t];
|
|
@@ -378,14 +500,14 @@ function Le(e, t) {
|
|
|
378
500
|
return s.map((c) => A(c) ? c[i] : void 0);
|
|
379
501
|
}
|
|
380
502
|
}
|
|
381
|
-
function
|
|
503
|
+
function wt(e, t) {
|
|
382
504
|
const r = Array.isArray(t?.dependentFields) ? t.dependentFields : ee(t);
|
|
383
|
-
return r.length === 0 ?
|
|
384
|
-
r.map((n) => [n, k(
|
|
505
|
+
return r.length === 0 ? qe(e.var) : Object.fromEntries(
|
|
506
|
+
r.map((n) => [n, k(Be(e, n))]).filter(([, n]) => n !== void 0)
|
|
385
507
|
);
|
|
386
508
|
}
|
|
387
|
-
function
|
|
388
|
-
const t =
|
|
509
|
+
function bt(e) {
|
|
510
|
+
const t = Q(e);
|
|
389
511
|
for (const r of t) {
|
|
390
512
|
if (!A(r)) continue;
|
|
391
513
|
const n = r.assigned_fields;
|
|
@@ -395,44 +517,44 @@ function ht(e) {
|
|
|
395
517
|
}
|
|
396
518
|
return {};
|
|
397
519
|
}
|
|
398
|
-
function
|
|
399
|
-
const t =
|
|
520
|
+
function ht(e) {
|
|
521
|
+
const t = Q(e);
|
|
400
522
|
for (const r of t) {
|
|
401
523
|
if (!A(r)) continue;
|
|
402
524
|
const n = r.success, i = r.status;
|
|
403
525
|
if (n === !1 || n === "false" || i === "error" || i === "failed")
|
|
404
|
-
return
|
|
526
|
+
return Z(r, [
|
|
405
527
|
"error_message",
|
|
406
528
|
"errorMessage",
|
|
407
529
|
"message",
|
|
408
530
|
"detail",
|
|
409
531
|
"reason",
|
|
410
532
|
"output"
|
|
411
|
-
]) ??
|
|
533
|
+
]) ?? J(r.error) ?? J(r.exception) ?? "Assigner failed";
|
|
412
534
|
}
|
|
413
535
|
}
|
|
414
|
-
function
|
|
536
|
+
function At(e, t) {
|
|
415
537
|
let r = !1;
|
|
416
538
|
for (const [n, i] of Object.entries(t)) {
|
|
417
539
|
const s = n.trim();
|
|
418
540
|
if (s) {
|
|
419
541
|
if (s.includes(".")) {
|
|
420
|
-
const [c, ...f] = s.split("."), d = f.join("."),
|
|
421
|
-
if (Array.isArray(
|
|
422
|
-
Array.isArray(i) ?
|
|
542
|
+
const [c, ...f] = s.split("."), d = f.join("."), g = e.var[c];
|
|
543
|
+
if (Array.isArray(g) && d) {
|
|
544
|
+
Array.isArray(i) ? g.forEach((h, T) => {
|
|
423
545
|
A(h) && T < i.length && (h[d] = i[T]);
|
|
424
|
-
}) :
|
|
546
|
+
}) : g.forEach((h) => {
|
|
425
547
|
A(h) && (h[d] = i);
|
|
426
548
|
}), r = !0;
|
|
427
549
|
continue;
|
|
428
550
|
}
|
|
429
551
|
}
|
|
430
552
|
if (Object.prototype.hasOwnProperty.call(e.step, s)) {
|
|
431
|
-
e.step[s] =
|
|
553
|
+
e.step[s] = ne(i), r = !0;
|
|
432
554
|
continue;
|
|
433
555
|
}
|
|
434
556
|
if (Object.prototype.hasOwnProperty.call(e.check, s)) {
|
|
435
|
-
e.check[s] =
|
|
557
|
+
e.check[s] = oe(i), r = !0;
|
|
436
558
|
continue;
|
|
437
559
|
}
|
|
438
560
|
e.var[s] = i, r = !0;
|
|
@@ -440,21 +562,21 @@ function _t(e, t) {
|
|
|
440
562
|
}
|
|
441
563
|
return r;
|
|
442
564
|
}
|
|
443
|
-
function
|
|
565
|
+
function _t(e, t) {
|
|
444
566
|
const r = `${e}:`;
|
|
445
567
|
return t.startsWith(r) ? t.slice(r.length) : t;
|
|
446
568
|
}
|
|
447
|
-
function
|
|
569
|
+
function He(e) {
|
|
448
570
|
if (typeof window > "u")
|
|
449
571
|
return !1;
|
|
450
572
|
const t = window.getComputedStyle(e), r = t.overflowY || t.overflow, n = t.overflowX || t.overflow, i = /(auto|scroll|overlay)/.test(r) && e.scrollHeight > e.clientHeight, s = /(auto|scroll|overlay)/.test(n) && e.scrollWidth > e.clientWidth;
|
|
451
573
|
return i || s;
|
|
452
574
|
}
|
|
453
|
-
function
|
|
575
|
+
function We(e, t) {
|
|
454
576
|
const r = [], n = /* @__PURE__ */ new Set(), i = (s) => {
|
|
455
577
|
let c = s;
|
|
456
578
|
for (; c && c !== document.body; )
|
|
457
|
-
!n.has(c) &&
|
|
579
|
+
!n.has(c) && He(c) && (n.add(c), r.push({
|
|
458
580
|
element: c,
|
|
459
581
|
top: c.scrollTop,
|
|
460
582
|
left: c.scrollLeft
|
|
@@ -462,7 +584,7 @@ function $e(e, t) {
|
|
|
462
584
|
};
|
|
463
585
|
return i(t), i(e), r.length ? r : void 0;
|
|
464
586
|
}
|
|
465
|
-
function
|
|
587
|
+
function Tt(e) {
|
|
466
588
|
if (typeof document > "u" || !e)
|
|
467
589
|
return null;
|
|
468
590
|
const t = document.activeElement;
|
|
@@ -472,9 +594,9 @@ function Et(e) {
|
|
|
472
594
|
if (!r)
|
|
473
595
|
return null;
|
|
474
596
|
const n = { key: r };
|
|
475
|
-
return (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) && (n.selectionStart = t.selectionStart, n.selectionEnd = t.selectionEnd, n.selectionDirection = t.selectionDirection), n.scrollTargets =
|
|
597
|
+
return (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) && (n.selectionStart = t.selectionStart, n.selectionEnd = t.selectionEnd, n.selectionDirection = t.selectionDirection), n.scrollTargets = We(e, t), n.windowScrollX = window.scrollX, n.windowScrollY = window.scrollY, n;
|
|
476
598
|
}
|
|
477
|
-
function
|
|
599
|
+
function Et(e, t) {
|
|
478
600
|
if (!t || !e)
|
|
479
601
|
return;
|
|
480
602
|
const r = e.querySelectorAll("[data-rec-focus-key]");
|
|
@@ -504,129 +626,6 @@ function St(e, t) {
|
|
|
504
626
|
typeof window < "u" && window.scrollTo(t.windowScrollX ?? window.scrollX, t.windowScrollY ?? window.scrollY);
|
|
505
627
|
}
|
|
506
628
|
}
|
|
507
|
-
const Pe = [
|
|
508
|
-
{
|
|
509
|
-
pattern: /\b(?:import|export|class|new|async|await|yield|throw|try|catch|switch|while|for|do)\b/,
|
|
510
|
-
message: "contains unsupported control-flow or module syntax"
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
pattern: /=>/,
|
|
514
|
-
message: "does not allow arrow functions"
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
pattern: /\b(?:window|document|globalThis|self|fetch|XMLHttpRequest|WebSocket|Function|eval|setTimeout|setInterval)\b/,
|
|
518
|
-
message: "uses blocked runtime globals"
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
pattern: /\b(?:__proto__|prototype|constructor|this)\b/,
|
|
522
|
-
message: "uses blocked object metaprogramming features"
|
|
523
|
-
},
|
|
524
|
-
{
|
|
525
|
-
pattern: /\bMath\s*\.\s*random\b/,
|
|
526
|
-
message: "must not use randomness"
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
pattern: /\bDate\b/,
|
|
530
|
-
message: "must not use time-dependent APIs"
|
|
531
|
-
}
|
|
532
|
-
], Ie = {
|
|
533
|
-
ImportDeclaration: "contains unsupported control-flow or module syntax",
|
|
534
|
-
ImportExpression: "contains unsupported control-flow or module syntax",
|
|
535
|
-
ExportNamedDeclaration: "contains unsupported control-flow or module syntax",
|
|
536
|
-
ExportDefaultDeclaration: "contains unsupported control-flow or module syntax",
|
|
537
|
-
ExportAllDeclaration: "contains unsupported control-flow or module syntax",
|
|
538
|
-
ClassDeclaration: "contains unsupported control-flow or module syntax",
|
|
539
|
-
ClassExpression: "contains unsupported control-flow or module syntax",
|
|
540
|
-
NewExpression: "contains unsupported control-flow or module syntax",
|
|
541
|
-
ArrowFunctionExpression: "does not allow arrow functions",
|
|
542
|
-
AwaitExpression: "contains unsupported control-flow or module syntax",
|
|
543
|
-
YieldExpression: "contains unsupported control-flow or module syntax",
|
|
544
|
-
ThrowStatement: "contains unsupported control-flow or module syntax",
|
|
545
|
-
TryStatement: "contains unsupported control-flow or module syntax",
|
|
546
|
-
SwitchStatement: "contains unsupported control-flow or module syntax",
|
|
547
|
-
WhileStatement: "contains unsupported control-flow or module syntax",
|
|
548
|
-
ForStatement: "contains unsupported control-flow or module syntax",
|
|
549
|
-
ForInStatement: "contains unsupported control-flow or module syntax",
|
|
550
|
-
ForOfStatement: "contains unsupported control-flow or module syntax",
|
|
551
|
-
DoWhileStatement: "contains unsupported control-flow or module syntax"
|
|
552
|
-
}, qe = /* @__PURE__ */ new Set([
|
|
553
|
-
"window",
|
|
554
|
-
"document",
|
|
555
|
-
"globalThis",
|
|
556
|
-
"self",
|
|
557
|
-
"fetch",
|
|
558
|
-
"XMLHttpRequest",
|
|
559
|
-
"WebSocket",
|
|
560
|
-
"Function",
|
|
561
|
-
"eval",
|
|
562
|
-
"setTimeout",
|
|
563
|
-
"setInterval"
|
|
564
|
-
]), Be = /* @__PURE__ */ new Set([
|
|
565
|
-
"__proto__",
|
|
566
|
-
"prototype",
|
|
567
|
-
"constructor"
|
|
568
|
-
]);
|
|
569
|
-
function $(e, t) {
|
|
570
|
-
if (!(!e || typeof e != "object")) {
|
|
571
|
-
t(e);
|
|
572
|
-
for (const r of Object.keys(e)) {
|
|
573
|
-
if (r === "type" || r === "start" || r === "end") continue;
|
|
574
|
-
const n = e[r];
|
|
575
|
-
if (Array.isArray(n))
|
|
576
|
-
for (const i of n)
|
|
577
|
-
i && typeof i.type == "string" && $(i, t);
|
|
578
|
-
else n && typeof n == "object" && typeof n.type == "string" && $(n, t);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
function J(e, t) {
|
|
583
|
-
if (qe.has(e))
|
|
584
|
-
throw new Error(`client assigner "${t}" uses blocked runtime globals`);
|
|
585
|
-
if (Be.has(e))
|
|
586
|
-
throw new Error(`client assigner "${t}" uses blocked object metaprogramming features`);
|
|
587
|
-
if (e === "Date")
|
|
588
|
-
throw new Error(`client assigner "${t}" must not use time-dependent APIs`);
|
|
589
|
-
}
|
|
590
|
-
function He(e, t) {
|
|
591
|
-
let r;
|
|
592
|
-
try {
|
|
593
|
-
r = Ae(e, {
|
|
594
|
-
ecmaVersion: 2022,
|
|
595
|
-
sourceType: "script"
|
|
596
|
-
});
|
|
597
|
-
} catch {
|
|
598
|
-
throw new Error(`client assigner "${t}" contains invalid JavaScript syntax`);
|
|
599
|
-
}
|
|
600
|
-
let n = 0, i = !1;
|
|
601
|
-
if ($(r, (s) => {
|
|
602
|
-
const c = Ie[s.type];
|
|
603
|
-
if (c)
|
|
604
|
-
throw new Error(`client assigner "${t}" ${c}`);
|
|
605
|
-
if (s.type === "FunctionDeclaration" || s.type === "FunctionExpression") {
|
|
606
|
-
if (n++, s.async)
|
|
607
|
-
throw new Error(`client assigner "${t}" contains unsupported control-flow or module syntax`);
|
|
608
|
-
if (s.generator)
|
|
609
|
-
throw new Error(`client assigner "${t}" contains unsupported control-flow or module syntax`);
|
|
610
|
-
}
|
|
611
|
-
if (s.type === "ReturnStatement" && (i = !0), s.type === "ThisExpression")
|
|
612
|
-
throw new Error(`client assigner "${t}" uses blocked object metaprogramming features`);
|
|
613
|
-
if (s.type === "Identifier" && J(s.name, t), s.type === "MemberExpression" && s.computed && s.property?.type === "Literal" && typeof s.property.value == "string" && J(s.property.value, t), s.type === "MemberExpression" && !s.computed && s.object?.type === "Identifier" && s.object.name === "Math" && s.property?.type === "Identifier" && s.property.name === "random")
|
|
614
|
-
throw new Error(`client assigner "${t}" must not use randomness`);
|
|
615
|
-
}), n !== 1)
|
|
616
|
-
throw new Error(`client assigner "${t}" must contain exactly one function definition`);
|
|
617
|
-
if (!i)
|
|
618
|
-
throw new Error(`client assigner "${t}" must return an object containing assigned field values`);
|
|
619
|
-
}
|
|
620
|
-
function We(e, t) {
|
|
621
|
-
if ((e.match(/\bfunction\b/g) ?? []).length !== 1)
|
|
622
|
-
throw new Error(`client assigner "${t}" must contain exactly one function definition`);
|
|
623
|
-
for (const { pattern: n, message: i } of Pe)
|
|
624
|
-
if (n.test(e))
|
|
625
|
-
throw new Error(`client assigner "${t}" ${i}`);
|
|
626
|
-
if (!/\breturn\b/.test(e))
|
|
627
|
-
throw new Error(`client assigner "${t}" must return an object containing assigned field values`);
|
|
628
|
-
He(e, t);
|
|
629
|
-
}
|
|
630
629
|
const G = /* @__PURE__ */ new Map(), Xe = Object.freeze({
|
|
631
630
|
abs: Math.abs,
|
|
632
631
|
ceil: Math.ceil,
|
|
@@ -678,12 +677,12 @@ function Ue(e) {
|
|
|
678
677
|
}
|
|
679
678
|
}
|
|
680
679
|
function Ke(e, t) {
|
|
681
|
-
return t ?
|
|
680
|
+
return t ? ae(t.type) && Ue(e) === void 0 ? !1 : ce(e, t.type, t.kwargs) === null : !0;
|
|
682
681
|
}
|
|
683
|
-
function
|
|
682
|
+
function Ze(e, t, r) {
|
|
684
683
|
return te(t) && Ke(t, r?.[e]);
|
|
685
684
|
}
|
|
686
|
-
function
|
|
685
|
+
function Qe(e, t) {
|
|
687
686
|
const r = /* @__PURE__ */ new Set();
|
|
688
687
|
for (const n of e.dependent_fields) {
|
|
689
688
|
const i = t.get(n);
|
|
@@ -700,7 +699,7 @@ function et(e) {
|
|
|
700
699
|
function s(c) {
|
|
701
700
|
if (!n.has(c.id)) {
|
|
702
701
|
n.add(c.id);
|
|
703
|
-
for (const f of
|
|
702
|
+
for (const f of Qe(c, r)) {
|
|
704
703
|
const d = t.get(f);
|
|
705
704
|
d && s(d);
|
|
706
705
|
}
|
|
@@ -715,13 +714,13 @@ function tt(e, t) {
|
|
|
715
714
|
return e.assigned_fields.every((r) => !te(t[r]));
|
|
716
715
|
}
|
|
717
716
|
function rt(e, t, r) {
|
|
718
|
-
return e.dependent_fields.every((n) =>
|
|
717
|
+
return e.dependent_fields.every((n) => Ze(n, t[n], r?.fieldDefinitions));
|
|
719
718
|
}
|
|
720
719
|
function nt(e) {
|
|
721
720
|
const t = G.get(e.function_source);
|
|
722
721
|
if (t)
|
|
723
722
|
return t;
|
|
724
|
-
|
|
723
|
+
Ne(e.function_source, e.id);
|
|
725
724
|
const n = new Function(
|
|
726
725
|
"__math__",
|
|
727
726
|
"__object__",
|
|
@@ -779,15 +778,15 @@ function it(e, t, r) {
|
|
|
779
778
|
if (!rt(s, t, r) || !n.has(s.id) && (s.mode === "manual" || s.mode === "auto_first" && !tt(s, t)))
|
|
780
779
|
continue;
|
|
781
780
|
const f = ot(s, t);
|
|
782
|
-
for (const [d,
|
|
783
|
-
P(t[d],
|
|
781
|
+
for (const [d, g] of Object.entries(f))
|
|
782
|
+
P(t[d], g) || (t[d] = g, i.add(d));
|
|
784
783
|
}
|
|
785
784
|
return {
|
|
786
785
|
changed: i.size > 0,
|
|
787
786
|
changedFields: Array.from(i)
|
|
788
787
|
};
|
|
789
788
|
}
|
|
790
|
-
function
|
|
789
|
+
function St(e) {
|
|
791
790
|
const {
|
|
792
791
|
readonly: t,
|
|
793
792
|
clientAssigners: r,
|
|
@@ -810,7 +809,7 @@ function Ot(e) {
|
|
|
810
809
|
return s(`Client assigner error: ${S}`), !1;
|
|
811
810
|
}
|
|
812
811
|
}
|
|
813
|
-
function
|
|
812
|
+
function g() {
|
|
814
813
|
return d();
|
|
815
814
|
}
|
|
816
815
|
function h(E) {
|
|
@@ -826,7 +825,7 @@ function Ot(e) {
|
|
|
826
825
|
}
|
|
827
826
|
return {
|
|
828
827
|
runClientAssigners: d,
|
|
829
|
-
applyCurrentClientAssigners:
|
|
828
|
+
applyCurrentClientAssigners: g,
|
|
830
829
|
triggerClientAssigner: h,
|
|
831
830
|
triggerManualClientAssigners: T
|
|
832
831
|
};
|
|
@@ -846,9 +845,9 @@ function st(e, t, r, n, i, s) {
|
|
|
846
845
|
fieldState: s.fieldState
|
|
847
846
|
};
|
|
848
847
|
}
|
|
849
|
-
function
|
|
850
|
-
const c = st(e, t, r, n, i, s), f = s.fieldAdapters?.[e],
|
|
851
|
-
return s.wrapField ? s.wrapField(t, e,
|
|
848
|
+
function Ot(e, t, r, n, i, s) {
|
|
849
|
+
const c = st(e, t, r, n, i, s), f = s.fieldAdapters?.[e], g = (f ? f(c) : void 0) ?? i;
|
|
850
|
+
return s.wrapField ? s.wrapField(t, e, g) : g;
|
|
852
851
|
}
|
|
853
852
|
const U = /* @__PURE__ */ new WeakMap();
|
|
854
853
|
let K = 0;
|
|
@@ -859,12 +858,12 @@ function at(e) {
|
|
|
859
858
|
const r = `vt-row-${K}`;
|
|
860
859
|
return K += 1, U.set(e, r), r;
|
|
861
860
|
}
|
|
862
|
-
function
|
|
861
|
+
function vt(e) {
|
|
863
862
|
if (Array.isArray(e.columns) && e.columns.length > 0) return e.columns;
|
|
864
863
|
const t = e.definition?.subvars;
|
|
865
864
|
return t && typeof t == "object" ? Object.keys(t) : [];
|
|
866
865
|
}
|
|
867
|
-
function
|
|
866
|
+
function xt(e) {
|
|
868
867
|
const {
|
|
869
868
|
readonly: t,
|
|
870
869
|
localRecord: r,
|
|
@@ -873,13 +872,13 @@ function Ft(e) {
|
|
|
873
872
|
emitTableAddRow: s,
|
|
874
873
|
emitTableRemoveRow: c
|
|
875
874
|
} = e;
|
|
876
|
-
let f = null, d = null,
|
|
875
|
+
let f = null, d = null, g = null, h = null, T = null, E = null, _ = null;
|
|
877
876
|
function S(y, b) {
|
|
878
|
-
const w =
|
|
877
|
+
const w = ue(r.var[y], b);
|
|
879
878
|
return r.var[y] = w, w;
|
|
880
879
|
}
|
|
881
880
|
function v(y, b) {
|
|
882
|
-
S(y, b).push(
|
|
881
|
+
S(y, b).push(le(b)), n({ rebuild: !0, runClientAssigners: !0 }), s({ tableName: y, columns: b });
|
|
883
882
|
}
|
|
884
883
|
function F(y, b, w, j) {
|
|
885
884
|
const V = S(y, j);
|
|
@@ -895,14 +894,14 @@ function Ft(e) {
|
|
|
895
894
|
j.length <= 1 || (j.splice(b, 1), n({ rebuild: !0, runClientAssigners: !0 }), c({ tableName: y, rowIndex: b, columns: w }));
|
|
896
895
|
}
|
|
897
896
|
function o() {
|
|
898
|
-
d && (d.classList.remove("aimd-rec-inline-table__row--drag-over"), d = null),
|
|
897
|
+
d && (d.classList.remove("aimd-rec-inline-table__row--drag-over"), d = null), g && (g.classList.remove("aimd-rec-inline-table__drag-handle--dragging"), g = null), h && (h.classList.remove("aimd-rec-inline-table__row--dragging-source"), h = null), T && (T.classList.remove("aimd-rec-inline-table__table--dragging"), T = null);
|
|
899
898
|
}
|
|
900
899
|
function a(y) {
|
|
901
900
|
const b = y instanceof HTMLTableRowElement ? y : null;
|
|
902
901
|
d !== b && (d && d.classList.remove("aimd-rec-inline-table__row--drag-over"), d = b, d?.classList.add("aimd-rec-inline-table__row--drag-over"));
|
|
903
902
|
}
|
|
904
903
|
function u(y, b, w) {
|
|
905
|
-
t() || (f = { tableName: y, rowIndex: b },
|
|
904
|
+
t() || (f = { tableName: y, rowIndex: b }, g = w.currentTarget instanceof HTMLElement ? w.currentTarget : null, h = g?.closest("tr"), T = g?.closest("table"), g?.classList.add("aimd-rec-inline-table__drag-handle--dragging"), h?.classList.add("aimd-rec-inline-table__row--dragging-source"), T?.classList.add("aimd-rec-inline-table__table--dragging"), w.dataTransfer && (w.dataTransfer.effectAllowed = "move", w.dataTransfer.setData("text/plain", `${y}:${b}`)));
|
|
906
905
|
}
|
|
907
906
|
function m(y, b, w) {
|
|
908
907
|
if (!(!f || f.tableName !== y)) {
|
|
@@ -913,7 +912,7 @@ function Ft(e) {
|
|
|
913
912
|
a(w.currentTarget);
|
|
914
913
|
}
|
|
915
914
|
}
|
|
916
|
-
function
|
|
915
|
+
function p(y, b, w, j) {
|
|
917
916
|
if (!f || f.tableName !== y) {
|
|
918
917
|
o(), f = null;
|
|
919
918
|
return;
|
|
@@ -935,7 +934,7 @@ function Ft(e) {
|
|
|
935
934
|
removeVarTableRow: l,
|
|
936
935
|
startVarTableRowDrag: u,
|
|
937
936
|
handleVarTableRowDragOver: m,
|
|
938
|
-
handleVarTableRowDrop:
|
|
937
|
+
handleVarTableRowDrop: p,
|
|
939
938
|
endVarTableRowDrag: O,
|
|
940
939
|
getSettlingVarTableRowKey: C
|
|
941
940
|
};
|
|
@@ -950,8 +949,8 @@ function ct(e) {
|
|
|
950
949
|
function lt(e) {
|
|
951
950
|
return e === "auto_force" || e === "auto_readonly" || e === "manual_readonly";
|
|
952
951
|
}
|
|
953
|
-
function
|
|
954
|
-
const t =
|
|
952
|
+
function Ft(e) {
|
|
953
|
+
const t = $({});
|
|
955
954
|
function r(l, o, a) {
|
|
956
955
|
const u = e.wrapField();
|
|
957
956
|
return u ? u(l, o, a) : a;
|
|
@@ -975,7 +974,7 @@ function jt(e) {
|
|
|
975
974
|
return /* @__PURE__ */ new Date();
|
|
976
975
|
}
|
|
977
976
|
function c(l, o) {
|
|
978
|
-
return
|
|
977
|
+
return Ae(o, e.typePlugins());
|
|
979
978
|
}
|
|
980
979
|
function f(l, o, a) {
|
|
981
980
|
return {
|
|
@@ -995,7 +994,7 @@ function jt(e) {
|
|
|
995
994
|
inputKind: m
|
|
996
995
|
};
|
|
997
996
|
}
|
|
998
|
-
function
|
|
997
|
+
function g(l, o, a) {
|
|
999
998
|
const u = l.definition?.defaultRaw?.trim();
|
|
1000
999
|
if (!u)
|
|
1001
1000
|
return null;
|
|
@@ -1011,16 +1010,16 @@ function jt(e) {
|
|
|
1011
1010
|
expectedValue: l.definition.default
|
|
1012
1011
|
};
|
|
1013
1012
|
}
|
|
1014
|
-
function h(l, o, a, u, m,
|
|
1015
|
-
const O = t[l], C =
|
|
1013
|
+
function h(l, o, a, u, m, p) {
|
|
1014
|
+
const O = t[l], C = be(u), y = c(p, a);
|
|
1016
1015
|
if (O) {
|
|
1017
1016
|
if (m === "number" && Object.is(C, O.expectedValue))
|
|
1018
1017
|
return O.display;
|
|
1019
1018
|
delete t[l];
|
|
1020
1019
|
}
|
|
1021
1020
|
return y?.getDisplayValue ? y.getDisplayValue(
|
|
1022
|
-
d(o, a,
|
|
1023
|
-
) :
|
|
1021
|
+
d(o, a, p, u, m)
|
|
1022
|
+
) : he(u, m, { type: a, typePlugin: y });
|
|
1024
1023
|
}
|
|
1025
1024
|
function T(l) {
|
|
1026
1025
|
l in t && delete t[l];
|
|
@@ -1035,34 +1034,34 @@ function jt(e) {
|
|
|
1035
1034
|
const m = D(o);
|
|
1036
1035
|
if (l.definition && Object.prototype.hasOwnProperty.call(l.definition, "default"))
|
|
1037
1036
|
return m === "dnasequence" ? L(l.definition.default) : l.definition.default;
|
|
1038
|
-
const
|
|
1037
|
+
const p = H(o, {
|
|
1039
1038
|
inputType: e.fieldMeta()?.[a]?.inputType,
|
|
1040
1039
|
codeLanguage: e.fieldMeta()?.[a]?.codeLanguage,
|
|
1041
1040
|
kwargs: l.definition?.kwargs,
|
|
1042
1041
|
fieldMeta: e.fieldMeta()?.[a],
|
|
1043
1042
|
typePlugin: u
|
|
1044
1043
|
});
|
|
1045
|
-
return
|
|
1044
|
+
return p === "boolean-select" || B(o) && p !== "scalar-list" && p !== "checkbox" ? null : p === "multi-select" ? [] : p === "checkbox" ? !1 : p === "scalar-list" ? [] : p === "dna" ? L(void 0) : m === "currenttime" ? we(s()) : m === "username" && typeof e.currentUserName() == "string" ? e.currentUserName() : "";
|
|
1046
1045
|
}
|
|
1047
1046
|
function S(l, o, a, u, m) {
|
|
1048
|
-
const
|
|
1049
|
-
if (
|
|
1050
|
-
return
|
|
1047
|
+
const p = c(a, o);
|
|
1048
|
+
if (p?.normalizeValue)
|
|
1049
|
+
return p.normalizeValue(
|
|
1051
1050
|
d(l, o, a, u, m)
|
|
1052
1051
|
);
|
|
1053
1052
|
const O = D(o);
|
|
1054
|
-
return m === "dna" || O === "dnasequence" ? L(u) : m === "scalar-list" ?
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
) : m === "boolean-select" ? u === null || typeof u > "u" || u === "" ? null :
|
|
1053
|
+
return m === "dna" || O === "dnasequence" ? L(u) : m === "scalar-list" ? me(
|
|
1054
|
+
ge(u),
|
|
1055
|
+
pe(o) ?? "string"
|
|
1056
|
+
) : m === "boolean-select" ? u === null || typeof u > "u" || u === "" ? null : ye(u) : B(o) && m !== "checkbox" && (u === null || typeof u > "u" || u === "") ? null : u;
|
|
1058
1057
|
}
|
|
1059
1058
|
function v(l, o) {
|
|
1060
1059
|
const a = l.definition?.kwargs?.placeholder;
|
|
1061
1060
|
if (typeof a == "string" && a.trim())
|
|
1062
1061
|
return a.trim();
|
|
1063
|
-
const u = ct(o), [m] = u.length > 0 ? u :
|
|
1062
|
+
const u = ct(o), [m] = u.length > 0 ? u : fe(l.definition);
|
|
1064
1063
|
if (m != null && typeof m != "object")
|
|
1065
|
-
return
|
|
1064
|
+
return de(m);
|
|
1066
1065
|
}
|
|
1067
1066
|
function F(l) {
|
|
1068
1067
|
if (typeof l == "string" && l.trim())
|
|
@@ -1079,7 +1078,7 @@ function jt(e) {
|
|
|
1079
1078
|
isFieldDisabled: i,
|
|
1080
1079
|
resolveNowDate: s,
|
|
1081
1080
|
getTypePlugin: c,
|
|
1082
|
-
getVarInitialDisplayOverride:
|
|
1081
|
+
getVarInitialDisplayOverride: g,
|
|
1083
1082
|
getVarDisplayValue: h,
|
|
1084
1083
|
clearVarInputDisplayOverride: T,
|
|
1085
1084
|
setVarInputDisplayOverride: E,
|
|
@@ -1090,31 +1089,31 @@ function jt(e) {
|
|
|
1090
1089
|
};
|
|
1091
1090
|
}
|
|
1092
1091
|
export {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1092
|
+
ht as A,
|
|
1093
|
+
At as a,
|
|
1094
|
+
wt as b,
|
|
1096
1095
|
st as c,
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1096
|
+
Tt as d,
|
|
1097
|
+
bt as e,
|
|
1098
|
+
Ie as f,
|
|
1100
1099
|
ee as g,
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1100
|
+
Pe as h,
|
|
1101
|
+
ze as i,
|
|
1102
|
+
_t as j,
|
|
1104
1103
|
Ee as k,
|
|
1105
1104
|
je as l,
|
|
1106
|
-
|
|
1105
|
+
vt as m,
|
|
1107
1106
|
at as n,
|
|
1108
|
-
|
|
1109
|
-
|
|
1107
|
+
gt as o,
|
|
1108
|
+
qe as p,
|
|
1110
1109
|
k as q,
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1110
|
+
pt as r,
|
|
1111
|
+
dt as s,
|
|
1112
|
+
yt as t,
|
|
1113
|
+
Ot as u,
|
|
1114
|
+
Et as v,
|
|
1115
|
+
St as w,
|
|
1116
|
+
mt as x,
|
|
1117
|
+
Ft as y,
|
|
1118
|
+
xt as z
|
|
1120
1119
|
};
|