@camunda/copilot-chat 0.5.12-alpha.4 → 0.5.12-alpha.6

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.
@@ -1,28 +1,28 @@
1
- const Le = Object.prototype.toString, un = Object.prototype.hasOwnProperty;
1
+ const Le = Object.prototype.toString, dn = Object.prototype.hasOwnProperty;
2
2
  function Je(e) {
3
3
  return e === void 0;
4
4
  }
5
- function dn(e) {
5
+ function mn(e) {
6
6
  return e !== void 0;
7
7
  }
8
- function St(e) {
8
+ function Ot(e) {
9
9
  return e == null;
10
10
  }
11
- function Ot(e) {
11
+ function Ft(e) {
12
12
  return Le.call(e) === "[object Array]";
13
13
  }
14
- function mn(e) {
14
+ function fn(e) {
15
15
  return Le.call(e) === "[object Object]";
16
16
  }
17
- function Ft(e) {
17
+ function kt(e) {
18
18
  const t = Le.call(e);
19
19
  return t === "[object Function]" || t === "[object AsyncFunction]" || t === "[object GeneratorFunction]" || t === "[object AsyncGeneratorFunction]" || t === "[object Proxy]";
20
20
  }
21
21
  function be(e) {
22
22
  return Le.call(e) === "[object String]";
23
23
  }
24
- function kt(e, t) {
25
- return !St(e) && un.call(e, t);
24
+ function $t(e, t) {
25
+ return !Ot(e) && dn.call(e, t);
26
26
  }
27
27
  function Nt(e, t) {
28
28
  const r = lt(t);
@@ -32,9 +32,9 @@ function Nt(e, t) {
32
32
  return n = i, !1;
33
33
  }), n;
34
34
  }
35
- function fn(e, t) {
35
+ function yn(e, t) {
36
36
  const r = lt(t);
37
- let n = Ot(e) ? -1 : void 0;
37
+ let n = Ft(e) ? -1 : void 0;
38
38
  return R(e, function(i, a) {
39
39
  if (r(i, a))
40
40
  return n = a, !1;
@@ -51,33 +51,33 @@ function R(e, t) {
51
51
  let r, n;
52
52
  if (Je(e))
53
53
  return;
54
- const i = Ot(e) ? hn : gn;
54
+ const i = Ft(e) ? bn : hn;
55
55
  for (let a in e)
56
- if (kt(e, a) && (r = e[a], n = t(r, i(a)), n === !1))
56
+ if ($t(e, a) && (r = e[a], n = t(r, i(a)), n === !1))
57
57
  return r;
58
58
  }
59
- function yn(e, t) {
59
+ function gn(e, t) {
60
60
  let r = [];
61
61
  return R(e, function(n, i) {
62
62
  r.push(t(n, i));
63
63
  }), r;
64
64
  }
65
65
  function lt(e) {
66
- return Ft(e) ? e : (t) => t === e;
66
+ return kt(e) ? e : (t) => t === e;
67
67
  }
68
- function gn(e) {
68
+ function hn(e) {
69
69
  return e;
70
70
  }
71
- function hn(e) {
71
+ function bn(e) {
72
72
  return Number(e);
73
73
  }
74
- function xe(e, t) {
74
+ function Ne(e, t) {
75
75
  return e.bind(t);
76
76
  }
77
77
  function F(e, ...t) {
78
78
  return Object.assign(e, ...t);
79
79
  }
80
- function bn(e, t, r) {
80
+ function En(e, t, r) {
81
81
  let n = e;
82
82
  return R(t, function(i, a) {
83
83
  if (typeof i != "number" && typeof i != "string")
@@ -87,10 +87,10 @@ function bn(e, t, r) {
87
87
  if (i === "__proto__")
88
88
  throw new Error("illegal key: __proto__");
89
89
  let o = t[a + 1], s = n[i];
90
- dn(o) && St(s) && (s = n[i] = isNaN(+o) ? {} : []), Je(o) ? Je(r) ? delete n[i] : n[i] = r : n = s;
90
+ mn(o) && Ot(s) && (s = n[i] = isNaN(+o) ? {} : []), Je(o) ? Je(r) ? delete n[i] : n[i] = r : n = s;
91
91
  }), e;
92
92
  }
93
- function $t(e, t) {
93
+ function qt(e, t) {
94
94
  let r = {}, n = Object(e);
95
95
  return R(t, function(i) {
96
96
  i in n && (r[i] = e[i]);
@@ -104,29 +104,29 @@ ct.prototype.get = function(e) {
104
104
  ct.prototype.set = function(e, t) {
105
105
  this.$model.properties.set(this, e, t);
106
106
  };
107
- function qt(e, t) {
107
+ function Lt(e, t) {
108
108
  this.model = e, this.properties = t;
109
109
  }
110
- qt.prototype.createType = function(e) {
110
+ Lt.prototype.createType = function(e) {
111
111
  var t = this.model, r = this.properties, n = Object.create(ct.prototype);
112
112
  R(e.properties, function(o) {
113
113
  !o.isMany && o.default !== void 0 && (n[o.name] = o.default);
114
114
  }), r.defineModel(n, t), r.defineDescriptor(n, e);
115
115
  var i = e.ns.name;
116
116
  function a(o) {
117
- r.define(this, "$type", { value: i, enumerable: !0 }), r.define(this, "$attrs", { value: {} }), r.define(this, "$parent", { writable: !0 }), R(o, xe(function(s, p) {
117
+ r.define(this, "$type", { value: i, enumerable: !0 }), r.define(this, "$attrs", { value: {} }), r.define(this, "$parent", { writable: !0 }), R(o, Ne(function(s, p) {
118
118
  this.set(p, s);
119
119
  }, this));
120
120
  }
121
121
  return a.prototype = n, a.hasType = n.$instanceOf = this.model.hasType, r.defineModel(a, t), r.defineDescriptor(a, e), a;
122
122
  };
123
- var En = {
123
+ var wn = {
124
124
  String: !0,
125
125
  Boolean: !0,
126
126
  Integer: !0,
127
127
  Real: !0,
128
128
  Element: !0
129
- }, Lt = {
129
+ }, jt = {
130
130
  String: function(e) {
131
131
  return e;
132
132
  },
@@ -141,16 +141,16 @@ var En = {
141
141
  }
142
142
  };
143
143
  function ut(e, t) {
144
- var r = Lt[e];
144
+ var r = jt[e];
145
145
  return r ? r(t) : t;
146
146
  }
147
147
  function Ye(e) {
148
- return !!En[e];
148
+ return !!wn[e];
149
149
  }
150
150
  function Gt(e) {
151
- return !!Lt[e];
151
+ return !!jt[e];
152
152
  }
153
- function j(e, t) {
153
+ function G(e, t) {
154
154
  var r = e.split(/:/), n, i;
155
155
  if (r.length === 1)
156
156
  n = e, i = t;
@@ -168,7 +168,7 @@ function H(e) {
168
168
  this.ns = e, this.name = e.name, this.allTypes = [], this.allTypesByName = {}, this.properties = [], this.propertiesByName = {};
169
169
  }
170
170
  H.prototype.build = function() {
171
- return $t(this, [
171
+ return qt(this, [
172
172
  "ns",
173
173
  "name",
174
174
  "allTypes",
@@ -206,7 +206,7 @@ H.prototype.replaceProperty = function(e, t, r) {
206
206
  i.splice(s, 1), this.addProperty(t, r ? void 0 : s, o), a[n.name] = a[n.localName] = t;
207
207
  };
208
208
  H.prototype.redefineProperty = function(e, t, r) {
209
- var n = e.ns.prefix, i = t.split("#"), a = j(i[0], n), o = j(i[1], a.prefix).name, s = this.propertiesByName[o];
209
+ var n = e.ns.prefix, i = t.split("#"), a = G(i[0], n), o = G(i[1], a.prefix).name, s = this.propertiesByName[o];
210
210
  if (s)
211
211
  this.replaceProperty(s, e, r);
212
212
  else
@@ -254,7 +254,7 @@ H.prototype.hasProperty = function(e) {
254
254
  H.prototype.addTrait = function(e, t) {
255
255
  t && this.assertNotTrait(e);
256
256
  var r = this.allTypesByName, n = this.allTypes, i = e.name;
257
- i in r || (R(e.properties, xe(function(a) {
257
+ i in r || (R(e.properties, Ne(function(a) {
258
258
  a = F({}, a, {
259
259
  name: a.ns.localName,
260
260
  inherited: t
@@ -266,7 +266,7 @@ H.prototype.addTrait = function(e, t) {
266
266
  }, this)), n.push(e), r[i] = e);
267
267
  };
268
268
  function ce(e, t) {
269
- this.packageMap = {}, this.typeMap = {}, this.packages = [], this.properties = t, R(e, xe(this.registerPackage, this));
269
+ this.packageMap = {}, this.typeMap = {}, this.packages = [], this.properties = t, R(e, Ne(this.registerPackage, this));
270
270
  }
271
271
  ce.prototype.getPackage = function(e) {
272
272
  return this.packageMap[e];
@@ -277,7 +277,7 @@ ce.prototype.getPackages = function() {
277
277
  ce.prototype.registerPackage = function(e) {
278
278
  e = F({}, e);
279
279
  var t = this.packageMap;
280
- xt(t, e, "prefix"), xt(t, e, "uri"), R(e.types, xe(function(r) {
280
+ Rt(t, e, "prefix"), Rt(t, e, "uri"), R(e.types, Ne(function(r) {
281
281
  this.registerType(r, e);
282
282
  }, this)), t[e.uri] = t[e.prefix] = e, this.packages.push(e);
283
283
  };
@@ -288,10 +288,10 @@ ce.prototype.registerType = function(e, t) {
288
288
  properties: (e.properties || []).slice(),
289
289
  meta: F(e.meta || {})
290
290
  });
291
- var r = j(e.name, t.prefix), n = r.name, i = {};
292
- R(e.properties, xe(function(a) {
293
- var o = j(a.name, r.prefix), s = o.name;
294
- Ye(a.type) || (a.type = j(a.type, o.prefix).name), F(a, {
291
+ var r = G(e.name, t.prefix), n = r.name, i = {};
292
+ R(e.properties, Ne(function(a) {
293
+ var o = G(a.name, r.prefix), s = o.name;
294
+ Ye(a.type) || (a.type = G(a.type, o.prefix).name), F(a, {
295
295
  ns: o,
296
296
  name: s
297
297
  }), i[s] = a;
@@ -299,15 +299,15 @@ ce.prototype.registerType = function(e, t) {
299
299
  ns: r,
300
300
  name: n,
301
301
  propertiesByName: i
302
- }), R(e.extends, xe(function(a) {
303
- var o = j(a, r.prefix), s = this.typeMap[o.name];
302
+ }), R(e.extends, Ne(function(a) {
303
+ var o = G(a, r.prefix), s = this.typeMap[o.name];
304
304
  s.traits = s.traits || [], s.traits.push(n);
305
305
  }, this)), this.definePackage(e, t), this.typeMap[n] = e;
306
306
  };
307
307
  ce.prototype.mapTypes = function(e, t, r) {
308
308
  var n = Ye(e.name) ? { name: e.name } : this.typeMap[e.name], i = this;
309
309
  function a(p, l) {
310
- var c = j(p, Ye(p) ? "" : e.prefix);
310
+ var c = G(p, Ye(p) ? "" : e.prefix);
311
311
  i.mapTypes(c, t, l);
312
312
  }
313
313
  function o(p) {
@@ -321,7 +321,7 @@ ce.prototype.mapTypes = function(e, t, r) {
321
321
  R(n.superClass, r ? o : s), t(n, !r), R(n.traits, o);
322
322
  };
323
323
  ce.prototype.getEffectiveDescriptor = function(e) {
324
- var t = j(e), r = new H(t);
324
+ var t = G(e), r = new H(t);
325
325
  this.mapTypes(t, function(i, a) {
326
326
  r.addTrait(i, a);
327
327
  });
@@ -331,7 +331,7 @@ ce.prototype.getEffectiveDescriptor = function(e) {
331
331
  ce.prototype.definePackage = function(e, t) {
332
332
  this.properties.define(e, "$pkg", { value: t });
333
333
  };
334
- function xt(e, t, r) {
334
+ function Rt(e, t, r) {
335
335
  var n = t[r];
336
336
  if (n in e)
337
337
  throw new Error("package with " + r + " <" + n + "> already defined");
@@ -343,14 +343,14 @@ Ee.prototype.set = function(e, t, r) {
343
343
  if (!be(t) || !t.length)
344
344
  throw new TypeError("property name must be a non-empty string");
345
345
  var n = this.getProperty(e, t), i = n && n.name;
346
- wn(r) ? n ? delete e[i] : delete e.$attrs[Qe(t)] : n ? i in e ? e[i] = r : jt(e, n, r) : e.$attrs[Qe(t)] = r;
346
+ vn(r) ? n ? delete e[i] : delete e.$attrs[Qe(t)] : n ? i in e ? e[i] = r : Ut(e, n, r) : e.$attrs[Qe(t)] = r;
347
347
  };
348
348
  Ee.prototype.get = function(e, t) {
349
349
  var r = this.getProperty(e, t);
350
350
  if (!r)
351
351
  return e.$attrs[Qe(t)];
352
352
  var n = r.name;
353
- return !e[n] && r.isMany && jt(e, r, []), e[n];
353
+ return !e[n] && r.isMany && Ut(e, r, []), e[n];
354
354
  };
355
355
  Ee.prototype.define = function(e, t, r) {
356
356
  if (!r.writable) {
@@ -384,10 +384,10 @@ Ee.prototype.getProperty = function(e, t) {
384
384
  }
385
385
  return null;
386
386
  };
387
- function wn(e) {
387
+ function vn(e) {
388
388
  return typeof e > "u";
389
389
  }
390
- function jt(e, t, r) {
390
+ function Ut(e, t, r) {
391
391
  Object.defineProperty(e, t.name, {
392
392
  enumerable: !t.isReference,
393
393
  writable: !0,
@@ -399,7 +399,7 @@ function Qe(e) {
399
399
  return e.replace(/^:/, "");
400
400
  }
401
401
  function K(e, t = {}) {
402
- this.properties = new Ee(this), this.factory = new qt(this, this.properties), this.registry = new ce(e, this.properties), this.typeCache = {}, this.config = t;
402
+ this.properties = new Ee(this), this.factory = new Lt(this, this.properties), this.registry = new ce(e, this.properties), this.typeCache = {}, this.config = t;
403
403
  }
404
404
  K.prototype.create = function(e, t) {
405
405
  var r = this.getType(e);
@@ -412,7 +412,7 @@ K.prototype.getType = function(e) {
412
412
  return n || (e = this.registry.getEffectiveDescriptor(r), n = t[r] = this.factory.createType(e)), n;
413
413
  };
414
414
  K.prototype.createAny = function(e, t, r) {
415
- var n = j(e), i = {
415
+ var n = G(e), i = {
416
416
  $type: e,
417
417
  $instanceOf: function(o) {
418
418
  return o === this.$type;
@@ -421,7 +421,7 @@ K.prototype.createAny = function(e, t, r) {
421
421
  return this[o];
422
422
  },
423
423
  set: function(o, s) {
424
- bn(this, [o], s);
424
+ En(this, [o], s);
425
425
  }
426
426
  }, a = {
427
427
  name: e,
@@ -433,7 +433,7 @@ K.prototype.createAny = function(e, t, r) {
433
433
  }
434
434
  };
435
435
  return this.properties.defineDescriptor(i, a), this.properties.defineModel(i, this), this.properties.define(i, "get", { enumerable: !1, writable: !0 }), this.properties.define(i, "set", { enumerable: !1, writable: !0 }), this.properties.define(i, "$parent", { enumerable: !1, writable: !0 }), this.properties.define(i, "$instanceOf", { enumerable: !1, writable: !0 }), R(r, function(o, s) {
436
- mn(o) && o.value !== void 0 ? i[o.name] = o.value : i[s] = o;
436
+ fn(o) && o.value !== void 0 ? i[o.name] = o.value : i[s] = o;
437
437
  }), i;
438
438
  };
439
439
  K.prototype.getPackage = function(e) {
@@ -456,7 +456,7 @@ K.prototype.getPropertyDescriptor = function(e, t) {
456
456
  K.prototype.getTypeDescriptor = function(e) {
457
457
  return this.registry.typeMap[e];
458
458
  };
459
- var Rt = String.fromCharCode, vn = Object.prototype.hasOwnProperty, In = /&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig, _e = {
459
+ var At = String.fromCharCode, In = Object.prototype.hasOwnProperty, Tn = /&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig, _e = {
460
460
  amp: "&",
461
461
  apos: "'",
462
462
  gt: ">",
@@ -466,17 +466,17 @@ var Rt = String.fromCharCode, vn = Object.prototype.hasOwnProperty, In = /&#(\d+
466
466
  Object.keys(_e).forEach(function(e) {
467
467
  _e[e.toUpperCase()] = _e[e];
468
468
  });
469
- function Tn(e, t, r, n) {
470
- return n ? vn.call(_e, n) ? _e[n] : "&" + n + ";" : Rt(t || parseInt(r, 16));
469
+ function xn(e, t, r, n) {
470
+ return n ? In.call(_e, n) ? _e[n] : "&" + n + ";" : At(t || parseInt(r, 16));
471
471
  }
472
472
  function ye(e) {
473
- return e.length > 3 && e.indexOf("&") !== -1 ? e.replace(In, Tn) : e;
473
+ return e.length > 3 && e.indexOf("&") !== -1 ? e.replace(Tn, xn) : e;
474
474
  }
475
- var At = "non-whitespace outside of root node";
476
- function Ne(e) {
475
+ var Mt = "non-whitespace outside of root node";
476
+ function xe(e) {
477
477
  return new Error(e);
478
478
  }
479
- function Mt(e) {
479
+ function Ct(e) {
480
480
  return "missing namespace for prefix <" + e + ">";
481
481
  }
482
482
  function ke(e) {
@@ -494,31 +494,31 @@ function Nn(e) {
494
494
  function Ze(e) {
495
495
  return e + "$uri";
496
496
  }
497
- function xn(e) {
497
+ function Rn(e) {
498
498
  var t = {}, r, n;
499
499
  for (r in e)
500
500
  n = e[r], t[n] = n, t[Ze(n)] = r;
501
501
  return t;
502
502
  }
503
- function Ct() {
503
+ function Dt() {
504
504
  return { line: 0, column: 0 };
505
505
  }
506
- function Rn(e) {
506
+ function An(e) {
507
507
  throw e;
508
508
  }
509
- function Ut(e) {
509
+ function Xt(e) {
510
510
  if (!this)
511
- return new Ut(e);
512
- var t = e && e.proxy, r, n, i, a, o = Rn, s, p, l, c, u = Ct, d = !1, f = !1, P = null, D = !1, J;
511
+ return new Xt(e);
512
+ var t = e && e.proxy, r, n, i, a, o = An, s, p, l, c, u = Dt, d = !1, f = !1, M = null, P = !1, J;
513
513
  function E(m) {
514
- m instanceof Error || (m = Ne(m)), P = m, o(m, u);
514
+ m instanceof Error || (m = xe(m)), M = m, o(m, u);
515
515
  }
516
- function N(m) {
517
- s && (m instanceof Error || (m = Ne(m)), s(m, u));
516
+ function x(m) {
517
+ s && (m instanceof Error || (m = xe(m)), s(m, u));
518
518
  }
519
519
  this.on = function(m, y) {
520
520
  if (typeof y != "function")
521
- throw Ne("required args <name, cb>");
521
+ throw xe("required args <name, cb>");
522
522
  switch (m) {
523
523
  case "openTag":
524
524
  n = y;
@@ -550,60 +550,60 @@ function Ut(e) {
550
550
  p = y;
551
551
  break;
552
552
  default:
553
- throw Ne("unsupported event: " + m);
553
+ throw xe("unsupported event: " + m);
554
554
  }
555
555
  return this;
556
556
  }, this.ns = function(m) {
557
557
  if (typeof m > "u" && (m = {}), typeof m != "object")
558
- throw Ne("required args <nsMap={}>");
558
+ throw xe("required args <nsMap={}>");
559
559
  var y = {}, g;
560
560
  for (g in m)
561
561
  y[g] = m[g];
562
562
  return f = !0, J = y, this;
563
563
  }, this.parse = function(m) {
564
564
  if (typeof m != "string")
565
- throw Ne("required args <xml=string>");
566
- return P = null, W(m), u = Ct, D = !1, P;
565
+ throw xe("required args <xml=string>");
566
+ return M = null, W(m), u = Dt, P = !1, M;
567
567
  }, this.stop = function() {
568
- D = !0;
568
+ P = !0;
569
569
  };
570
570
  function W(m) {
571
- var y = f ? [] : null, g = f ? xn(J) : null, x, M = [], z = 0, q = !1, _ = !1, w = 0, b = 0, S, vt, O, I, De, Pe, X, Xe, Ve, ze = "", He = 0, Ie;
571
+ var y = f ? [] : null, g = f ? Rn(J) : null, N, C = [], z = 0, q = !1, _ = !1, w = 0, b = 0, S, It, O, I, De, Pe, X, Xe, Ve, ze = "", He = 0, Ie;
572
572
  function We() {
573
573
  if (Ie !== null)
574
574
  return Ie;
575
- var oe, de, Q, me = f && g.xmlns, te = f && d ? [] : null, B = He, L = ze, fe = L.length, It, pe, ne, Z, A, Te = {}, Tt = {}, Y, h, T;
575
+ var oe, de, Q, me = f && g.xmlns, te = f && d ? [] : null, B = He, L = ze, fe = L.length, Tt, pe, ne, Z, A, Te = {}, xt = {}, Y, h, T;
576
576
  e:
577
577
  for (; B < fe; B++)
578
578
  if (Y = !1, h = L.charCodeAt(B), !(h === 32 || h < 14 && h > 8)) {
579
- for ((h < 65 || h > 122 || h > 90 && h < 97) && h !== 95 && h !== 58 && (N("illegal first char attribute name"), Y = !0), T = B + 1; T < fe; T++)
579
+ for ((h < 65 || h > 122 || h > 90 && h < 97) && h !== 95 && h !== 58 && (x("illegal first char attribute name"), Y = !0), T = B + 1; T < fe; T++)
580
580
  if (h = L.charCodeAt(T), !(h > 96 && h < 123 || h > 64 && h < 91 || h > 47 && h < 59 || h === 46 || // '.'
581
581
  h === 45 || // '-'
582
582
  h === 95)) {
583
583
  if (h === 32 || h < 14 && h > 8) {
584
- N("missing attribute value"), B = T;
584
+ x("missing attribute value"), B = T;
585
585
  continue e;
586
586
  }
587
587
  if (h === 61)
588
588
  break;
589
- N("illegal attribute name char"), Y = !0;
589
+ x("illegal attribute name char"), Y = !0;
590
590
  }
591
- if (A = L.substring(B, T), A === "xmlns:xmlns" && (N("illegal declaration of xmlns"), Y = !0), h = L.charCodeAt(T + 1), h === 34)
592
- T = L.indexOf('"', B = T + 2), T === -1 && (T = L.indexOf("'", B), T !== -1 && (N("attribute value quote missmatch"), Y = !0));
591
+ if (A = L.substring(B, T), A === "xmlns:xmlns" && (x("illegal declaration of xmlns"), Y = !0), h = L.charCodeAt(T + 1), h === 34)
592
+ T = L.indexOf('"', B = T + 2), T === -1 && (T = L.indexOf("'", B), T !== -1 && (x("attribute value quote missmatch"), Y = !0));
593
593
  else if (h === 39)
594
- T = L.indexOf("'", B = T + 2), T === -1 && (T = L.indexOf('"', B), T !== -1 && (N("attribute value quote missmatch"), Y = !0));
594
+ T = L.indexOf("'", B = T + 2), T === -1 && (T = L.indexOf('"', B), T !== -1 && (x("attribute value quote missmatch"), Y = !0));
595
595
  else
596
- for (N("missing attribute value quotes"), Y = !0, T = T + 1; T < fe && (h = L.charCodeAt(T + 1), !(h === 32 || h < 14 && h > 8)); T++)
596
+ for (x("missing attribute value quotes"), Y = !0, T = T + 1; T < fe && (h = L.charCodeAt(T + 1), !(h === 32 || h < 14 && h > 8)); T++)
597
597
  ;
598
- for (T === -1 && (N("missing closing quotes"), T = fe, Y = !0), Y || (ne = L.substring(B, T)), B = T; T + 1 < fe && (h = L.charCodeAt(T + 1), !(h === 32 || h < 14 && h > 8)); T++)
599
- B === T && (N("illegal character after attribute end"), Y = !0);
598
+ for (T === -1 && (x("missing closing quotes"), T = fe, Y = !0), Y || (ne = L.substring(B, T)), B = T; T + 1 < fe && (h = L.charCodeAt(T + 1), !(h === 32 || h < 14 && h > 8)); T++)
599
+ B === T && (x("illegal character after attribute end"), Y = !0);
600
600
  if (B = T + 1, Y)
601
601
  continue e;
602
- if (A in Tt) {
603
- N("attribute <" + A + "> already defined");
602
+ if (A in xt) {
603
+ x("attribute <" + A + "> already defined");
604
604
  continue;
605
605
  }
606
- if (Tt[A] = !0, !f) {
606
+ if (xt[A] = !0, !f) {
607
607
  Te[A] = ne;
608
608
  continue;
609
609
  }
@@ -618,7 +618,7 @@ function Ut(e) {
618
618
  Z = pe;
619
619
  J[oe] = Z;
620
620
  }
621
- g[pe] !== Z && (It || (g = Nn(g), It = !0), g[pe] = Z, pe === "xmlns" && (g[Ze(Z)] = oe, me = Z), g[de] = oe), Te[A] = ne;
621
+ g[pe] !== Z && (Tt || (g = Nn(g), Tt = !0), g[pe] = Z, pe === "xmlns" && (g[Ze(Z)] = oe, me = Z), g[de] = oe), Te[A] = ne;
622
622
  continue;
623
623
  }
624
624
  te.push(A, ne);
@@ -629,7 +629,7 @@ function Ut(e) {
629
629
  continue;
630
630
  }
631
631
  if (!(Q = g[A.substring(0, h)])) {
632
- N(Mt(A.substring(0, h)));
632
+ x(Ct(A.substring(0, h)));
633
633
  continue;
634
634
  }
635
635
  A = me === Q ? A.substr(h + 1) : Q + A.substr(h), Te[A] = ne;
@@ -638,7 +638,7 @@ function Ut(e) {
638
638
  for (B = 0, fe = te.length; B < fe; B++) {
639
639
  if (A = te[B++], ne = te[B], h = A.indexOf(":"), h !== -1) {
640
640
  if (!(Q = g[A.substring(0, h)])) {
641
- N(Mt(A.substring(0, h)));
641
+ x(Ct(A.substring(0, h)));
642
642
  continue;
643
643
  }
644
644
  A = me === Q ? A.substr(h + 1) : Q + A.substr(h);
@@ -647,7 +647,7 @@ function Ut(e) {
647
647
  }
648
648
  return Ie = Te;
649
649
  }
650
- function cn() {
650
+ function un() {
651
651
  for (var oe = /(\r\n|\r|\n)/g, de = 0, Q = 0, me = 0, te = b, B, L; w >= me && (B = oe.exec(m), !(!B || (te = B[0].length + B.index, te > w))); )
652
652
  de += 1, me = te;
653
653
  return w == -1 ? (Q = te, L = m.substring(b)) : b === 0 ? L = m.substring(b, w) : (Q = w - me, L = b == -1 ? m.substring(w) : m.substring(w, b + 1)), {
@@ -656,7 +656,7 @@ function Ut(e) {
656
656
  column: Q
657
657
  };
658
658
  }
659
- for (u = cn, t && (Ve = Object.create({}, {
659
+ for (u = un, t && (Ve = Object.create({}, {
660
660
  name: ke(function() {
661
661
  return X;
662
662
  }),
@@ -669,25 +669,25 @@ function Ut(e) {
669
669
  })
670
670
  })); b !== -1; ) {
671
671
  if (m.charCodeAt(b) === 60 ? w = b : w = m.indexOf("<", b), w === -1) {
672
- if (M.length)
672
+ if (C.length)
673
673
  return E("unexpected end of file");
674
674
  if (b === 0)
675
675
  return E("missing start tag");
676
- b < m.length && m.substring(b).trim() && N(At);
676
+ b < m.length && m.substring(b).trim() && x(Mt);
677
677
  return;
678
678
  }
679
679
  if (b !== w) {
680
- if (M.length) {
681
- if (r && (r(m.substring(b, w), ye, u), D))
680
+ if (C.length) {
681
+ if (r && (r(m.substring(b, w), ye, u), P))
682
682
  return;
683
- } else if (m.substring(b, w).trim() && (N(At), D))
683
+ } else if (m.substring(b, w).trim() && (x(Mt), P))
684
684
  return;
685
685
  }
686
686
  if (I = m.charCodeAt(w + 1), I === 33) {
687
687
  if (O = m.charCodeAt(w + 2), O === 91 && m.substr(w + 3, 6) === "CDATA[") {
688
688
  if (b = m.indexOf("]]>", w), b === -1)
689
689
  return E("unclosed cdata");
690
- if (a && (a(m.substring(w + 9, b), u), D))
690
+ if (a && (a(m.substring(w + 9, b), u), P))
691
691
  return;
692
692
  b += 3;
693
693
  continue;
@@ -695,7 +695,7 @@ function Ut(e) {
695
695
  if (O === 45 && m.charCodeAt(w + 3) === 45) {
696
696
  if (b = m.indexOf("-->", w), b === -1)
697
697
  return E("unclosed comment");
698
- if (p && (p(m.substring(w + 4, b), ye, u), D))
698
+ if (p && (p(m.substring(w + 4, b), ye, u), P))
699
699
  return;
700
700
  b += 3;
701
701
  continue;
@@ -704,7 +704,7 @@ function Ut(e) {
704
704
  if (I === 63) {
705
705
  if (b = m.indexOf("?>", w), b === -1)
706
706
  return E("unclosed question");
707
- if (l && (l(m.substring(w, b + 2), u), D))
707
+ if (l && (l(m.substring(w, b + 2), u), P))
708
708
  return;
709
709
  b += 2;
710
710
  continue;
@@ -722,15 +722,15 @@ function Ut(e) {
722
722
  }
723
723
  }
724
724
  if (I === 33) {
725
- if (c && (c(m.substring(w, b + 1), ye, u), D))
725
+ if (c && (c(m.substring(w, b + 1), ye, u), P))
726
726
  return;
727
727
  b += 1;
728
728
  continue;
729
729
  }
730
730
  if (Ie = {}, I === 47) {
731
- if (q = !1, _ = !0, !M.length)
731
+ if (q = !1, _ = !0, !C.length)
732
732
  return E("missing open tag");
733
- if (S = X = M.pop(), O = w + 2 + S.length, m.substring(w + 2, O) !== S)
733
+ if (S = X = C.pop(), O = w + 2 + S.length, m.substring(w + 2, O) !== S)
734
734
  return E("closing tag mismatch");
735
735
  for (; O < b; O++)
736
736
  if (I = m.charCodeAt(O), !(I === 32 || I > 8 && I < 14))
@@ -738,7 +738,7 @@ function Ut(e) {
738
738
  } else {
739
739
  if (m.charCodeAt(b - 1) === 47 ? (S = X = m.substring(w + 1, b - 1), q = !0, _ = !0) : (S = X = m.substring(w + 1, b), q = !0, _ = !1), !(I > 96 && I < 123 || I > 64 && I < 91 || I === 95 || I === 58))
740
740
  return E("illegal first char nodeName");
741
- for (O = 1, vt = S.length; O < vt; O++)
741
+ for (O = 1, It = S.length; O < It; O++)
742
742
  if (I = S.charCodeAt(O), !(I > 96 && I < 123 || I > 64 && I < 91 || I > 47 && I < 59 || I === 45 || I === 95 || I == 46)) {
743
743
  if (I === 32 || I < 14 && I > 8) {
744
744
  X = S.substring(0, O), Ie = null;
@@ -746,10 +746,10 @@ function Ut(e) {
746
746
  }
747
747
  return E("invalid nodeName");
748
748
  }
749
- _ || M.push(X);
749
+ _ || C.push(X);
750
750
  }
751
751
  if (f) {
752
- if (x = g, q && (_ || y.push(x), Ie === null && (d = S.indexOf("xmlns", O) !== -1) && (He = O, ze = S, We(), d = !1)), Xe = X, I = X.indexOf(":"), I !== -1) {
752
+ if (N = g, q && (_ || y.push(N), Ie === null && (d = S.indexOf("xmlns", O) !== -1) && (He = O, ze = S, We(), d = !1)), Xe = X, I = X.indexOf(":"), I !== -1) {
753
753
  if (Pe = g[X.substring(0, I)], !Pe)
754
754
  return E("missing namespace on <" + Xe + ">");
755
755
  X = X.substr(I + 1);
@@ -757,45 +757,45 @@ function Ut(e) {
757
757
  Pe = g.xmlns;
758
758
  Pe && (X = Pe + ":" + X);
759
759
  }
760
- if (q && (He = O, ze = S, n && (t ? n(Ve, ye, _, u) : n(X, We, ye, _, u), D)))
760
+ if (q && (He = O, ze = S, n && (t ? n(Ve, ye, _, u) : n(X, We, ye, _, u), P)))
761
761
  return;
762
762
  if (_) {
763
- if (i && (i(t ? Ve : X, ye, q, u), D))
763
+ if (i && (i(t ? Ve : X, ye, q, u), P))
764
764
  return;
765
- f && (q ? g = x : g = y.pop());
765
+ f && (q ? g = N : g = y.pop());
766
766
  }
767
767
  b += 1;
768
768
  }
769
769
  }
770
770
  }
771
- function Xt(e) {
771
+ function Vt(e) {
772
772
  return e.xml && e.xml.tagAlias === "lowerCase";
773
773
  }
774
774
  var et = {
775
775
  xsi: "http://www.w3.org/2001/XMLSchema-instance",
776
776
  xml: "http://www.w3.org/XML/1998/namespace"
777
- }, Vt = "property";
778
- function zt(e) {
777
+ }, zt = "property";
778
+ function Ht(e) {
779
779
  return e.xml && e.xml.serialize;
780
780
  }
781
- function An(e) {
782
- const t = zt(e);
783
- return t !== Vt && (t || null);
784
- }
785
781
  function Mn(e) {
782
+ const t = Ht(e);
783
+ return t !== zt && (t || null);
784
+ }
785
+ function Cn(e) {
786
786
  return e.charAt(0).toUpperCase() + e.slice(1);
787
787
  }
788
- function Ht(e, t) {
789
- return Xt(t) ? e.prefix + ":" + Mn(e.localName) : e.name;
788
+ function Wt(e, t) {
789
+ return Vt(t) ? e.prefix + ":" + Cn(e.localName) : e.name;
790
790
  }
791
- function Cn(e, t) {
791
+ function Dn(e, t) {
792
792
  var r = e.name, n = e.localName, i = t && t.xml && t.xml.typePrefix;
793
793
  return i && n.indexOf(i) === 0 ? e.prefix + ":" + n.slice(i.length) : r;
794
794
  }
795
- function Dn(e, t, r) {
796
- const n = j(e, t.xmlns), i = `${t[n.prefix] || n.prefix}:${n.localName}`, a = j(i);
795
+ function Pn(e, t, r) {
796
+ const n = G(e, t.xmlns), i = `${t[n.prefix] || n.prefix}:${n.localName}`, a = G(i);
797
797
  var o = r.getPackage(a.prefix);
798
- return Cn(a, o);
798
+ return Dn(a, o);
799
799
  }
800
800
  function le(e) {
801
801
  return new Error(e);
@@ -803,7 +803,7 @@ function le(e) {
803
803
  function re(e) {
804
804
  return e.$descriptor;
805
805
  }
806
- function Pn(e) {
806
+ function _n(e) {
807
807
  F(this, e), this.elementsById = {}, this.references = [], this.warnings = [], this.addReference = function(t) {
808
808
  this.references.push(t);
809
809
  }, this.addElement = function(t) {
@@ -867,17 +867,17 @@ mt.prototype.handleEnd = function() {
867
867
  var e = this.body || "", t = this.element, r = this.propertyDesc;
868
868
  e = ut(r.type, e), r.isMany ? t.get(r.name).push(e) : t.set(r.name, e);
869
869
  };
870
- function Ge() {
870
+ function je() {
871
871
  }
872
- Ge.prototype = Object.create(Me.prototype);
873
- Ge.prototype.handleNode = function(e) {
872
+ je.prototype = Object.create(Me.prototype);
873
+ je.prototype.handleNode = function(e) {
874
874
  var t = this, r = this.element;
875
875
  return r ? t = this.handleChild(e) : (r = this.element = this.createElement(e), this.context.addElement(r)), t;
876
876
  };
877
877
  function U(e, t, r) {
878
878
  this.model = e, this.type = e.getType(t), this.context = r;
879
879
  }
880
- U.prototype = Object.create(Ge.prototype);
880
+ U.prototype = Object.create(je.prototype);
881
881
  U.prototype.addReference = function(e) {
882
882
  this.context.addReference(e);
883
883
  };
@@ -905,7 +905,7 @@ U.prototype.createElement = function(e) {
905
905
  element: a,
906
906
  property: c.ns.name,
907
907
  id: p
908
- }) : (c ? p = ut(c.type, p) : l === "xmlns" ? l = ":" + l : (s = j(l, n.ns.prefix), o.getPackage(s.prefix) && i.addWarning({
908
+ }) : (c ? p = ut(c.type, p) : l === "xmlns" ? l = ":" + l : (s = G(l, n.ns.prefix), o.getPackage(s.prefix) && i.addWarning({
909
909
  message: "unknown attribute <" + l + ">",
910
910
  element: a,
911
911
  property: l,
@@ -914,13 +914,13 @@ U.prototype.createElement = function(e) {
914
914
  }), a;
915
915
  };
916
916
  U.prototype.getPropertyForNode = function(e) {
917
- var t = e.name, r = j(t), n = this.type, i = this.model, a = re(n), o = r.name, s = a.propertiesByName[o];
917
+ var t = e.name, r = G(t), n = this.type, i = this.model, a = re(n), o = r.name, s = a.propertiesByName[o];
918
918
  if (s && !s.isAttr) {
919
- const l = An(s);
919
+ const l = Mn(s);
920
920
  if (l) {
921
921
  const c = e.attributes[l];
922
922
  if (c) {
923
- const u = Dn(c, e.ns, i), d = i.getType(u);
923
+ const u = Pn(c, e.ns, i), d = i.getType(u);
924
924
  return F({}, s, {
925
925
  effectiveType: re(d).name
926
926
  });
@@ -930,7 +930,7 @@ U.prototype.getPropertyForNode = function(e) {
930
930
  }
931
931
  var p = i.getPackage(r.prefix);
932
932
  if (p) {
933
- const l = Ht(r, p), c = i.getType(l);
933
+ const l = Wt(r, p), c = i.getType(l);
934
934
  if (s = Nt(a.properties, function(u) {
935
935
  return !u.isVirtual && !u.isReference && !u.isAttribute && c.hasType(u.type);
936
936
  }), s)
@@ -970,7 +970,7 @@ function ft(e, t, r) {
970
970
  }
971
971
  ft.prototype = Object.create(U.prototype);
972
972
  ft.prototype.createElement = function(e) {
973
- var t = e.name, r = j(t), n = this.model, i = this.type, a = n.getPackage(r.prefix), o = a && Ht(r, a) || t;
973
+ var t = e.name, r = G(t), n = this.model, i = this.type, a = n.getPackage(r.prefix), o = a && Wt(r, a) || t;
974
974
  if (!i.hasType(o))
975
975
  throw le("unexpected element <" + e.originalName + ">");
976
976
  return U.prototype.createElement.call(this, e);
@@ -978,9 +978,9 @@ ft.prototype.createElement = function(e) {
978
978
  function Re(e, t, r) {
979
979
  this.model = e, this.context = r;
980
980
  }
981
- Re.prototype = Object.create(Ge.prototype);
981
+ Re.prototype = Object.create(je.prototype);
982
982
  Re.prototype.createElement = function(e) {
983
- var t = e.name, r = j(t), n = r.prefix, i = e.ns[n + "$uri"], a = e.attributes;
983
+ var t = e.name, r = G(t), n = r.prefix, i = e.ns[n + "$uri"], a = e.attributes;
984
984
  return this.model.createAny(t, i, a);
985
985
  };
986
986
  Re.prototype.handleChild = function(e) {
@@ -998,16 +998,16 @@ function yt(e) {
998
998
  yt.prototype.fromXML = function(e, t, r) {
999
999
  var n = t.rootHandler;
1000
1000
  t instanceof U ? (n = t, t = {}) : typeof t == "string" ? (n = this.handler(t), t = {}) : typeof n == "string" && (n = this.handler(n));
1001
- var i = this.model, a = this.lax, o = new Pn(F({}, t, { rootHandler: n })), s = new Ut({ proxy: !0 }), p = _n();
1001
+ var i = this.model, a = this.lax, o = new _n(F({}, t, { rootHandler: n })), s = new Xt({ proxy: !0 }), p = Bn();
1002
1002
  n.context = o, p.push(n);
1003
- function l(y, g, x) {
1004
- var M = g(), z = M.line, q = M.column, _ = M.data;
1003
+ function l(y, g, N) {
1004
+ var C = g(), z = C.line, q = C.column, _ = C.data;
1005
1005
  _.charAt(0) === "<" && _.indexOf(" ") !== -1 && (_ = _.slice(0, _.indexOf(" ")) + ">");
1006
1006
  var w = "unparsable content " + (_ ? _ + " " : "") + `detected
1007
1007
  line: ` + z + `
1008
1008
  column: ` + q + `
1009
1009
  nested error: ` + y.message;
1010
- if (x)
1010
+ if (N)
1011
1011
  return o.addWarning({
1012
1012
  message: w,
1013
1013
  error: y
@@ -1018,16 +1018,16 @@ yt.prototype.fromXML = function(e, t, r) {
1018
1018
  return l(y, g, !0);
1019
1019
  }
1020
1020
  function u() {
1021
- var y = o.elementsById, g = o.references, x, M;
1022
- for (x = 0; M = g[x]; x++) {
1023
- var z = M.element, q = y[M.id], _ = re(z).propertiesByName[M.property];
1021
+ var y = o.elementsById, g = o.references, N, C;
1022
+ for (N = 0; C = g[N]; N++) {
1023
+ var z = C.element, q = y[C.id], _ = re(z).propertiesByName[C.property];
1024
1024
  if (q || o.addWarning({
1025
- message: "unresolved reference <" + M.id + ">",
1026
- element: M.element,
1027
- property: M.property,
1028
- value: M.id
1025
+ message: "unresolved reference <" + C.id + ">",
1026
+ element: C.element,
1027
+ property: C.property,
1028
+ value: C.id
1029
1029
  }), _.isMany) {
1030
- var w = z.get(_.name), b = w.indexOf(M);
1030
+ var w = z.get(_.name), b = w.indexOf(C);
1031
1031
  b === -1 && (b = w.length), q ? w[b] = q : w.splice(b, 1);
1032
1032
  } else
1033
1033
  z.set(_.name, q);
@@ -1036,39 +1036,39 @@ yt.prototype.fromXML = function(e, t, r) {
1036
1036
  function d() {
1037
1037
  p.pop().handleEnd();
1038
1038
  }
1039
- var f = /^<\?xml /i, P = / encoding="([^"]+)"/i, D = /^utf-8$/i;
1039
+ var f = /^<\?xml /i, M = / encoding="([^"]+)"/i, P = /^utf-8$/i;
1040
1040
  function J(y) {
1041
1041
  if (f.test(y)) {
1042
- var g = P.exec(y), x = g && g[1];
1043
- !x || D.test(x) || o.addWarning({
1044
- message: "unsupported document encoding <" + x + ">, falling back to UTF-8"
1042
+ var g = M.exec(y), N = g && g[1];
1043
+ !N || P.test(N) || o.addWarning({
1044
+ message: "unsupported document encoding <" + N + ">, falling back to UTF-8"
1045
1045
  });
1046
1046
  }
1047
1047
  }
1048
1048
  function E(y, g) {
1049
- var x = p.peek();
1049
+ var N = p.peek();
1050
1050
  try {
1051
- p.push(x.handleNode(y));
1052
- } catch (M) {
1053
- l(M, g, a) && p.push(new dt());
1051
+ p.push(N.handleNode(y));
1052
+ } catch (C) {
1053
+ l(C, g, a) && p.push(new dt());
1054
1054
  }
1055
1055
  }
1056
- function N(y, g) {
1056
+ function x(y, g) {
1057
1057
  try {
1058
1058
  p.peek().handleText(y);
1059
- } catch (x) {
1060
- c(x, g);
1059
+ } catch (N) {
1060
+ c(N, g);
1061
1061
  }
1062
1062
  }
1063
1063
  function W(y, g) {
1064
- y.trim() && N(y, g);
1064
+ y.trim() && x(y, g);
1065
1065
  }
1066
1066
  var m = i.getPackages().reduce(function(y, g) {
1067
1067
  return y[g.uri] = g.prefix, y;
1068
- }, Object.entries(et).reduce(function(y, [g, x]) {
1069
- return y[x] = g, y;
1068
+ }, Object.entries(et).reduce(function(y, [g, N]) {
1069
+ return y[N] = g, y;
1070
1070
  }, i.config && i.config.nsMap || {}));
1071
- return s.ns(m).on("openTag", function(y, g, x, M) {
1071
+ return s.ns(m).on("openTag", function(y, g, N, C) {
1072
1072
  var z = y.attrs || {}, q = Object.keys(z).reduce(function(w, b) {
1073
1073
  var S = g(z[b]);
1074
1074
  return w[b] = S, w;
@@ -1078,21 +1078,21 @@ yt.prototype.fromXML = function(e, t, r) {
1078
1078
  attributes: q,
1079
1079
  ns: y.ns
1080
1080
  };
1081
- E(_, M);
1082
- }).on("question", J).on("closeTag", d).on("cdata", N).on("text", function(y, g, x) {
1083
- W(g(y), x);
1081
+ E(_, C);
1082
+ }).on("question", J).on("closeTag", d).on("cdata", x).on("text", function(y, g, N) {
1083
+ W(g(y), N);
1084
1084
  }).on("error", l).on("warn", c), new Promise(function(y, g) {
1085
- var x;
1085
+ var N;
1086
1086
  try {
1087
1087
  s.parse(e), u();
1088
1088
  } catch (w) {
1089
- x = w;
1089
+ N = w;
1090
1090
  }
1091
- var M = n.element;
1092
- !x && !M && (x = le("failed to parse document as <" + n.type.$descriptor.name + ">"));
1091
+ var C = n.element;
1092
+ !N && !C && (N = le("failed to parse document as <" + n.type.$descriptor.name + ">"));
1093
1093
  var z = o.warnings, q = o.references, _ = o.elementsById;
1094
- return x ? (x.warnings = z, g(x)) : y({
1095
- rootElement: M,
1094
+ return N ? (N.warnings = z, g(N)) : y({
1095
+ rootElement: C,
1096
1096
  elementsById: _,
1097
1097
  references: q,
1098
1098
  warnings: z
@@ -1102,7 +1102,7 @@ yt.prototype.fromXML = function(e, t, r) {
1102
1102
  yt.prototype.handler = function(e) {
1103
1103
  return new ft(this.model, e);
1104
1104
  };
1105
- function _n() {
1105
+ function Bn() {
1106
1106
  var e = [];
1107
1107
  return Object.defineProperty(e, "peek", {
1108
1108
  value: function() {
@@ -1110,8 +1110,8 @@ function _n() {
1110
1110
  }
1111
1111
  }), e;
1112
1112
  }
1113
- var Bn = `<?xml version="1.0" encoding="UTF-8"?>
1114
- `, Sn = /<|>|'|"|&|\n\r|\n/g, Wt = /<|>|&/g;
1113
+ var Sn = `<?xml version="1.0" encoding="UTF-8"?>
1114
+ `, On = /<|>|'|"|&|\n\r|\n/g, Kt = /<|>|&/g;
1115
1115
  function ee(e) {
1116
1116
  this.prefixMap = {}, this.uriMap = {}, this.used = {}, this.wellknown = [], this.custom = [], this.parent = e, this.defaultPrefixMap = e && e.defaultPrefixMap || {};
1117
1117
  }
@@ -1147,13 +1147,13 @@ ee.prototype.getUsed = function(e) {
1147
1147
  return this.used[n];
1148
1148
  });
1149
1149
  };
1150
- function On(e) {
1150
+ function Fn(e) {
1151
1151
  return e.charAt(0).toLowerCase() + e.slice(1);
1152
1152
  }
1153
- function Fn(e, t) {
1154
- return Xt(t) ? On(e) : e;
1153
+ function kn(e, t) {
1154
+ return Vt(t) ? Fn(e) : e;
1155
1155
  }
1156
- function Kt(e, t) {
1156
+ function Jt(e, t) {
1157
1157
  e.super_ = t, e.prototype = Object.create(t.prototype, {
1158
1158
  constructor: {
1159
1159
  value: e,
@@ -1163,10 +1163,10 @@ function Kt(e, t) {
1163
1163
  }
1164
1164
  });
1165
1165
  }
1166
- function Jt(e) {
1166
+ function Yt(e) {
1167
1167
  return be(e) ? e : (e.prefix ? e.prefix + ":" : "") + e.localName;
1168
1168
  }
1169
- function kn(e) {
1169
+ function $n(e) {
1170
1170
  return e.getUsed().filter(function(t) {
1171
1171
  return t.prefix !== "xml";
1172
1172
  }).map(function(t) {
@@ -1174,17 +1174,17 @@ function kn(e) {
1174
1174
  return { name: r, value: t.uri };
1175
1175
  });
1176
1176
  }
1177
- function $n(e, t) {
1178
- return t.isGeneric ? F({ localName: t.ns.localName }, e) : F({ localName: Fn(t.ns.localName, t.$pkg) }, e);
1179
- }
1180
1177
  function qn(e, t) {
1178
+ return t.isGeneric ? F({ localName: t.ns.localName }, e) : F({ localName: kn(t.ns.localName, t.$pkg) }, e);
1179
+ }
1180
+ function Ln(e, t) {
1181
1181
  return F({ localName: t.ns.localName }, e);
1182
1182
  }
1183
- function Ln(e) {
1183
+ function jn(e) {
1184
1184
  var t = e.$descriptor;
1185
1185
  return pt(t.properties, function(r) {
1186
1186
  var n = r.name;
1187
- if (r.isVirtual || !kt(e, n))
1187
+ if (r.isVirtual || !$t(e, n))
1188
1188
  return !1;
1189
1189
  var i = e[n];
1190
1190
  return i === r.default || i === null ? !1 : r.isMany ? i.length : !0;
@@ -1198,28 +1198,28 @@ var Gn = {
1198
1198
  "<": "#60",
1199
1199
  ">": "#62",
1200
1200
  "&": "#38"
1201
- }, jn = {
1201
+ }, Un = {
1202
1202
  "<": "lt",
1203
1203
  ">": "gt",
1204
1204
  "&": "amp"
1205
1205
  };
1206
- function Yt(e, t, r) {
1206
+ function Qt(e, t, r) {
1207
1207
  return e = be(e) ? e : "" + e, e.replace(t, function(n) {
1208
1208
  return "&" + r[n] + ";";
1209
1209
  });
1210
1210
  }
1211
- function Un(e) {
1212
- return Yt(e, Sn, Gn);
1213
- }
1214
1211
  function Xn(e) {
1215
- return Yt(e, Wt, jn);
1212
+ return Qt(e, On, Gn);
1216
1213
  }
1217
1214
  function Vn(e) {
1215
+ return Qt(e, Kt, Un);
1216
+ }
1217
+ function zn(e) {
1218
1218
  return pt(e, function(t) {
1219
1219
  return t.isAttr;
1220
1220
  });
1221
1221
  }
1222
- function zn(e) {
1222
+ function Hn(e) {
1223
1223
  return pt(e, function(t) {
1224
1224
  return !t.isAttr;
1225
1225
  });
@@ -1237,62 +1237,62 @@ function ge() {
1237
1237
  }
1238
1238
  ge.prototype.serializeValue = ge.prototype.serializeTo = function(e) {
1239
1239
  e.append(
1240
- this.escape ? Xn(this.value) : this.value
1240
+ this.escape ? Vn(this.value) : this.value
1241
1241
  );
1242
1242
  };
1243
1243
  ge.prototype.build = function(e, t) {
1244
- return this.value = t, e.type === "String" && t.search(Wt) !== -1 && (this.escape = !0), this;
1244
+ return this.value = t, e.type === "String" && t.search(Kt) !== -1 && (this.escape = !0), this;
1245
1245
  };
1246
1246
  function ht(e) {
1247
1247
  this.tagName = e;
1248
1248
  }
1249
- Kt(ht, ge);
1249
+ Jt(ht, ge);
1250
1250
  ht.prototype.serializeTo = function(e) {
1251
1251
  e.appendIndent().append("<" + this.tagName + ">"), this.serializeValue(e), e.append("</" + this.tagName + ">").appendNewLine();
1252
1252
  };
1253
- function C(e, t) {
1253
+ function D(e, t) {
1254
1254
  this.body = [], this.attrs = [], this.parent = e, this.propertyDescriptor = t;
1255
1255
  }
1256
- C.prototype.build = function(e) {
1256
+ D.prototype.build = function(e) {
1257
1257
  this.element = e;
1258
1258
  var t = e.$descriptor, r = this.propertyDescriptor, n, i, a = t.isGeneric;
1259
- return a ? n = this.parseGenericNsAttributes(e) : n = this.parseNsAttributes(e), r ? this.ns = this.nsPropertyTagName(r) : this.ns = this.nsTagName(t), this.tagName = this.addTagName(this.ns), a ? this.parseGenericContainments(e) : (i = Ln(e), this.parseAttributes(Vn(i)), this.parseContainments(zn(i))), this.parseGenericAttributes(e, n), this;
1259
+ return a ? n = this.parseGenericNsAttributes(e) : n = this.parseNsAttributes(e), r ? this.ns = this.nsPropertyTagName(r) : this.ns = this.nsTagName(t), this.tagName = this.addTagName(this.ns), a ? this.parseGenericContainments(e) : (i = jn(e), this.parseAttributes(zn(i)), this.parseContainments(Hn(i))), this.parseGenericAttributes(e, n), this;
1260
1260
  };
1261
- C.prototype.nsTagName = function(e) {
1261
+ D.prototype.nsTagName = function(e) {
1262
1262
  var t = this.logNamespaceUsed(e.ns);
1263
- return $n(t, e);
1263
+ return qn(t, e);
1264
1264
  };
1265
- C.prototype.nsPropertyTagName = function(e) {
1265
+ D.prototype.nsPropertyTagName = function(e) {
1266
1266
  var t = this.logNamespaceUsed(e.ns);
1267
- return qn(t, e);
1267
+ return Ln(t, e);
1268
1268
  };
1269
- C.prototype.isLocalNs = function(e) {
1269
+ D.prototype.isLocalNs = function(e) {
1270
1270
  return e.uri === this.ns.uri;
1271
1271
  };
1272
- C.prototype.nsAttributeName = function(e) {
1272
+ D.prototype.nsAttributeName = function(e) {
1273
1273
  var t;
1274
- if (be(e) ? t = j(e) : t = e.ns, e.inherited)
1274
+ if (be(e) ? t = G(e) : t = e.ns, e.inherited)
1275
1275
  return { localName: t.localName };
1276
1276
  var r = this.logNamespaceUsed(t);
1277
1277
  return this.getNamespaces().logUsed(r), this.isLocalNs(r) ? { localName: t.localName } : F({ localName: t.localName }, r);
1278
1278
  };
1279
- C.prototype.parseGenericNsAttributes = function(e) {
1279
+ D.prototype.parseGenericNsAttributes = function(e) {
1280
1280
  return Object.entries(e).filter(
1281
1281
  ([t, r]) => !t.startsWith("$") && this.parseNsAttribute(e, t, r)
1282
1282
  ).map(
1283
1283
  ([t, r]) => ({ name: t, value: r })
1284
1284
  );
1285
1285
  };
1286
- C.prototype.parseGenericContainments = function(e) {
1286
+ D.prototype.parseGenericContainments = function(e) {
1287
1287
  var t = e.$body;
1288
1288
  t && this.body.push(new ge().build({ type: "String" }, t));
1289
1289
  var r = e.$children;
1290
1290
  r && R(r, (n) => {
1291
- this.body.push(new C(this).build(n));
1291
+ this.body.push(new D(this).build(n));
1292
1292
  });
1293
1293
  };
1294
- C.prototype.parseNsAttribute = function(e, t, r) {
1295
- var n = e.$model, i = j(t), a;
1294
+ D.prototype.parseNsAttribute = function(e, t, r) {
1295
+ var n = e.$model, i = G(t), a;
1296
1296
  if (i.prefix === "xmlns" && (a = { prefix: i.localName, uri: r }), !i.prefix && i.localName === "xmlns" && (a = { uri: r }), !a)
1297
1297
  return {
1298
1298
  name: t,
@@ -1305,14 +1305,14 @@ C.prototype.parseNsAttribute = function(e, t, r) {
1305
1305
  this.getNamespaces().logUsed(o);
1306
1306
  }
1307
1307
  };
1308
- C.prototype.parseNsAttributes = function(e) {
1308
+ D.prototype.parseNsAttributes = function(e) {
1309
1309
  var t = this, r = e.$attrs, n = [];
1310
1310
  return R(r, function(i, a) {
1311
1311
  var o = t.parseNsAttribute(e, a, i);
1312
1312
  o && n.push(o);
1313
1313
  }), n;
1314
1314
  };
1315
- C.prototype.parseGenericAttributes = function(e, t) {
1315
+ D.prototype.parseGenericAttributes = function(e, t) {
1316
1316
  var r = this;
1317
1317
  R(t, function(n) {
1318
1318
  try {
@@ -1326,7 +1326,7 @@ C.prototype.parseGenericAttributes = function(e, t) {
1326
1326
  }
1327
1327
  });
1328
1328
  };
1329
- C.prototype.parseContainments = function(e) {
1329
+ D.prototype.parseContainments = function(e) {
1330
1330
  var t = this, r = this.body, n = this.element;
1331
1331
  R(e, function(i) {
1332
1332
  var a = n.get(i.name), o = i.isReference, s = i.isMany;
@@ -1341,23 +1341,23 @@ C.prototype.parseContainments = function(e) {
1341
1341
  r.push(new gt(t.addTagName(t.nsPropertyTagName(i))).build(l));
1342
1342
  });
1343
1343
  else {
1344
- var p = zt(i);
1344
+ var p = Ht(i);
1345
1345
  R(a, function(l) {
1346
1346
  var c;
1347
- p ? p === Vt ? c = new C(t, i) : c = new je(t, i, p) : c = new C(t), r.push(c.build(l));
1347
+ p ? p === zt ? c = new D(t, i) : c = new Ge(t, i, p) : c = new D(t), r.push(c.build(l));
1348
1348
  });
1349
1349
  }
1350
1350
  });
1351
1351
  };
1352
- C.prototype.getNamespaces = function(e) {
1352
+ D.prototype.getNamespaces = function(e) {
1353
1353
  var t = this.namespaces, r = this.parent, n;
1354
1354
  return t || (n = r && r.getNamespaces(), e || !n ? this.namespaces = t = new ee(n) : t = n), t;
1355
1355
  };
1356
- C.prototype.logNamespace = function(e, t, r) {
1356
+ D.prototype.logNamespace = function(e, t, r) {
1357
1357
  var n = this.getNamespaces(r), i = e.uri, a = e.prefix, o = n.byUri(i);
1358
1358
  return (!o || r) && n.add(e, t), n.mapPrefix(a, i), e;
1359
1359
  };
1360
- C.prototype.logNamespaceUsed = function(e, t) {
1360
+ D.prototype.logNamespaceUsed = function(e, t) {
1361
1361
  var r = this.getNamespaces(t), n = e.prefix, i = e.uri, a, o, s;
1362
1362
  if (!n && !i)
1363
1363
  return { localName: e.localName };
@@ -1370,7 +1370,7 @@ C.prototype.logNamespaceUsed = function(e, t) {
1370
1370
  }
1371
1371
  return n && r.mapPrefix(n, i), e;
1372
1372
  };
1373
- C.prototype.parseAttributes = function(e) {
1373
+ D.prototype.parseAttributes = function(e) {
1374
1374
  var t = this, r = this.element;
1375
1375
  R(e, function(n) {
1376
1376
  var i = r.get(n.name);
@@ -1386,36 +1386,36 @@ C.prototype.parseAttributes = function(e) {
1386
1386
  t.addAttribute(t.nsAttributeName(n), i);
1387
1387
  });
1388
1388
  };
1389
- C.prototype.addTagName = function(e) {
1389
+ D.prototype.addTagName = function(e) {
1390
1390
  var t = this.logNamespaceUsed(e);
1391
- return this.getNamespaces().logUsed(t), Jt(e);
1391
+ return this.getNamespaces().logUsed(t), Yt(e);
1392
1392
  };
1393
- C.prototype.addAttribute = function(e, t) {
1393
+ D.prototype.addAttribute = function(e, t) {
1394
1394
  var r = this.attrs;
1395
- be(t) && (t = Un(t));
1396
- var n = fn(r, function(a) {
1395
+ be(t) && (t = Xn(t));
1396
+ var n = yn(r, function(a) {
1397
1397
  return a.name.localName === e.localName && a.name.uri === e.uri && a.name.prefix === e.prefix;
1398
1398
  }), i = { name: e, value: t };
1399
1399
  n !== -1 ? r.splice(n, 1, i) : r.push(i);
1400
1400
  };
1401
- C.prototype.serializeAttributes = function(e) {
1401
+ D.prototype.serializeAttributes = function(e) {
1402
1402
  var t = this.attrs, r = this.namespaces;
1403
- r && (t = kn(r).concat(t)), R(t, function(n) {
1404
- e.append(" ").append(Jt(n.name)).append('="').append(n.value).append('"');
1403
+ r && (t = $n(r).concat(t)), R(t, function(n) {
1404
+ e.append(" ").append(Yt(n.name)).append('="').append(n.value).append('"');
1405
1405
  });
1406
1406
  };
1407
- C.prototype.serializeTo = function(e) {
1407
+ D.prototype.serializeTo = function(e) {
1408
1408
  var t = this.body[0], r = t && t.constructor !== ge;
1409
1409
  e.appendIndent().append("<" + this.tagName), this.serializeAttributes(e), e.append(t ? ">" : " />"), t && (r && e.appendNewLine().indent(), R(this.body, function(n) {
1410
1410
  n.serializeTo(e);
1411
1411
  }), r && e.unindent().appendIndent(), e.append("</" + this.tagName + ">")), e.appendNewLine();
1412
1412
  };
1413
- function je(e, t, r) {
1414
- C.call(this, e, t), this.serialization = r;
1413
+ function Ge(e, t, r) {
1414
+ D.call(this, e, t), this.serialization = r;
1415
1415
  }
1416
- Kt(je, C);
1417
- je.prototype.parseNsAttributes = function(e) {
1418
- var t = C.prototype.parseNsAttributes.call(this, e).filter(
1416
+ Jt(Ge, D);
1417
+ Ge.prototype.parseNsAttributes = function(e) {
1418
+ var t = D.prototype.parseNsAttributes.call(this, e).filter(
1419
1419
  (o) => o.name !== this.serialization
1420
1420
  ), r = e.$descriptor;
1421
1421
  if (r.name === this.propertyDescriptor.type)
@@ -1428,15 +1428,15 @@ je.prototype.parseNsAttributes = function(e) {
1428
1428
  (n.prefix ? n.prefix + ":" : "") + a + r.ns.localName
1429
1429
  ), t;
1430
1430
  };
1431
- je.prototype.isLocalNs = function(e) {
1431
+ Ge.prototype.isLocalNs = function(e) {
1432
1432
  return e.uri === (this.typeNs || this.ns).uri;
1433
1433
  };
1434
- function Hn() {
1434
+ function Wn() {
1435
1435
  this.value = "", this.write = function(e) {
1436
1436
  this.value += e;
1437
1437
  };
1438
1438
  }
1439
- function Wn(e, t) {
1439
+ function Kn(e, t) {
1440
1440
  var r = [""];
1441
1441
  this.append = function(n) {
1442
1442
  return e.write(n), this;
@@ -1451,20 +1451,20 @@ function Wn(e, t) {
1451
1451
  return r.pop(), this;
1452
1452
  };
1453
1453
  }
1454
- function Kn(e) {
1454
+ function Jn(e) {
1455
1455
  e = F({ format: !1, preamble: !0 }, e || {});
1456
1456
  function t(r, n) {
1457
- var i = n || new Hn(), a = new Wn(i, e.format);
1458
- e.preamble && a.append(Bn);
1459
- var o = new C(), s = r.$model;
1460
- if (o.getNamespaces().mapDefaultPrefixes(Jn(s)), o.build(r).serializeTo(a), !n)
1457
+ var i = n || new Wn(), a = new Kn(i, e.format);
1458
+ e.preamble && a.append(Sn);
1459
+ var o = new D(), s = r.$model;
1460
+ if (o.getNamespaces().mapDefaultPrefixes(Yn(s)), o.build(r).serializeTo(a), !n)
1461
1461
  return i.value;
1462
1462
  }
1463
1463
  return {
1464
1464
  toXML: t
1465
1465
  };
1466
1466
  }
1467
- function Jn(e) {
1467
+ function Yn(e) {
1468
1468
  const t = e.config && e.config.nsMap || {}, r = {};
1469
1469
  for (const n in et)
1470
1470
  r[n] = et[n];
@@ -1486,7 +1486,7 @@ Ue.prototype.fromXML = function(e, t, r) {
1486
1486
  return n.fromXML(e, i);
1487
1487
  };
1488
1488
  Ue.prototype.toXML = function(e, t) {
1489
- var r = new Kn(t);
1489
+ var r = new Jn(t);
1490
1490
  return new Promise(function(n, i) {
1491
1491
  try {
1492
1492
  var a = r.toXML(e);
@@ -1498,7 +1498,7 @@ Ue.prototype.toXML = function(e, t) {
1498
1498
  }
1499
1499
  });
1500
1500
  };
1501
- var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpmn", er = [], tr = [
1501
+ var Qn = "BPMN20", Zn = "http://www.omg.org/spec/BPMN/20100524/MODEL", er = "bpmn", tr = [], nr = [
1502
1502
  {
1503
1503
  name: "Interface",
1504
1504
  superClass: [
@@ -4313,7 +4313,7 @@ var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpm
4313
4313
  }
4314
4314
  ]
4315
4315
  }
4316
- ], nr = [
4316
+ ], rr = [
4317
4317
  {
4318
4318
  name: "ProcessType",
4319
4319
  literalValues: [
@@ -4443,18 +4443,18 @@ var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpm
4443
4443
  }
4444
4444
  ]
4445
4445
  }
4446
- ], rr = {
4446
+ ], ir = {
4447
4447
  tagAlias: "lowerCase",
4448
4448
  typePrefix: "t"
4449
- }, ir = {
4450
- name: Yn,
4451
- uri: Qn,
4452
- prefix: Zn,
4453
- associations: er,
4454
- types: tr,
4455
- enumerations: nr,
4456
- xml: rr
4457
- }, ar = "BPMNDI", sr = "http://www.omg.org/spec/BPMN/20100524/DI", or = "bpmndi", pr = [
4449
+ }, ar = {
4450
+ name: Qn,
4451
+ uri: Zn,
4452
+ prefix: er,
4453
+ associations: tr,
4454
+ types: nr,
4455
+ enumerations: rr,
4456
+ xml: ir
4457
+ }, sr = "BPMNDI", or = "http://www.omg.org/spec/BPMN/20100524/DI", pr = "bpmndi", lr = [
4458
4458
  {
4459
4459
  name: "BPMNDiagram",
4460
4460
  properties: [
@@ -4604,7 +4604,7 @@ var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpm
4604
4604
  "di:Style"
4605
4605
  ]
4606
4606
  }
4607
- ], lr = [
4607
+ ], cr = [
4608
4608
  {
4609
4609
  name: "ParticipantBandKind",
4610
4610
  literalValues: [
@@ -4639,14 +4639,14 @@ var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpm
4639
4639
  }
4640
4640
  ]
4641
4641
  }
4642
- ], cr = [], ur = {
4643
- name: ar,
4644
- uri: sr,
4645
- prefix: or,
4646
- types: pr,
4647
- enumerations: lr,
4648
- associations: cr
4649
- }, dr = "DC", mr = "http://www.omg.org/spec/DD/20100524/DC", fr = "dc", yr = [
4642
+ ], ur = [], dr = {
4643
+ name: sr,
4644
+ uri: or,
4645
+ prefix: pr,
4646
+ types: lr,
4647
+ enumerations: cr,
4648
+ associations: ur
4649
+ }, mr = "DC", fr = "http://www.omg.org/spec/DD/20100524/DC", yr = "dc", gr = [
4650
4650
  {
4651
4651
  name: "Boolean"
4652
4652
  },
@@ -4738,13 +4738,13 @@ var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpm
4738
4738
  }
4739
4739
  ]
4740
4740
  }
4741
- ], gr = [], hr = {
4742
- name: dr,
4743
- uri: mr,
4744
- prefix: fr,
4745
- types: yr,
4746
- associations: gr
4747
- }, br = "DI", Er = "http://www.omg.org/spec/DD/20100524/DI", wr = "di", vr = [
4741
+ ], hr = [], br = {
4742
+ name: mr,
4743
+ uri: fr,
4744
+ prefix: yr,
4745
+ types: gr,
4746
+ associations: hr
4747
+ }, Er = "DI", wr = "http://www.omg.org/spec/DD/20100524/DI", vr = "di", Ir = [
4748
4748
  {
4749
4749
  name: "DiagramElement",
4750
4750
  isAbstract: !0,
@@ -4972,16 +4972,16 @@ var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpm
4972
4972
  }
4973
4973
  ]
4974
4974
  }
4975
- ], Ir = [], Tr = {
4975
+ ], Tr = [], xr = {
4976
4976
  tagAlias: "lowerCase"
4977
4977
  }, Nr = {
4978
- name: br,
4979
- uri: Er,
4980
- prefix: wr,
4981
- types: vr,
4982
- associations: Ir,
4983
- xml: Tr
4984
- }, xr = "bpmn.io colors for BPMN", Rr = "http://bpmn.io/schema/bpmn/biocolor/1.0", Ar = "bioc", Mr = [
4978
+ name: Er,
4979
+ uri: wr,
4980
+ prefix: vr,
4981
+ types: Ir,
4982
+ associations: Tr,
4983
+ xml: xr
4984
+ }, Rr = "bpmn.io colors for BPMN", Ar = "http://bpmn.io/schema/bpmn/biocolor/1.0", Mr = "bioc", Cr = [
4985
4985
  {
4986
4986
  name: "ColoredShape",
4987
4987
  extends: [
@@ -5018,14 +5018,14 @@ var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpm
5018
5018
  }
5019
5019
  ]
5020
5020
  }
5021
- ], Cr = [], Dr = [], Pr = {
5022
- name: xr,
5023
- uri: Rr,
5024
- prefix: Ar,
5025
- types: Mr,
5026
- enumerations: Cr,
5027
- associations: Dr
5028
- }, _r = "BPMN in Color", Br = "http://www.omg.org/spec/BPMN/non-normative/color/1.0", Sr = "color", Or = [
5021
+ ], Dr = [], Pr = [], _r = {
5022
+ name: Rr,
5023
+ uri: Ar,
5024
+ prefix: Mr,
5025
+ types: Cr,
5026
+ enumerations: Dr,
5027
+ associations: Pr
5028
+ }, Br = "BPMN in Color", Sr = "http://www.omg.org/spec/BPMN/non-normative/color/1.0", Or = "color", Fr = [
5029
5029
  {
5030
5030
  name: "ColoredLabel",
5031
5031
  extends: [
@@ -5070,24 +5070,24 @@ var Yn = "BPMN20", Qn = "http://www.omg.org/spec/BPMN/20100524/MODEL", Zn = "bpm
5070
5070
  }
5071
5071
  ]
5072
5072
  }
5073
- ], Fr = [], kr = [], $r = {
5074
- name: _r,
5075
- uri: Br,
5076
- prefix: Sr,
5077
- types: Or,
5078
- enumerations: Fr,
5079
- associations: kr
5073
+ ], kr = [], $r = [], qr = {
5074
+ name: Br,
5075
+ uri: Sr,
5076
+ prefix: Or,
5077
+ types: Fr,
5078
+ enumerations: kr,
5079
+ associations: $r
5080
5080
  };
5081
- const qr = {
5082
- bpmn: ir,
5083
- bpmndi: ur,
5084
- dc: hr,
5081
+ const Lr = {
5082
+ bpmn: ar,
5083
+ bpmndi: dr,
5084
+ dc: br,
5085
5085
  di: Nr,
5086
- bioc: Pr,
5087
- color: $r
5086
+ bioc: _r,
5087
+ color: qr
5088
5088
  };
5089
- function Lr(e, t) {
5090
- const r = F({}, qr, e);
5089
+ function jr(e, t) {
5090
+ const r = F({}, Lr, e);
5091
5091
  return new Ue(r, t);
5092
5092
  }
5093
5093
  function Gr(e) {
@@ -5096,19 +5096,19 @@ function Gr(e) {
5096
5096
  function tt(e) {
5097
5097
  return !!e.attachedToRef;
5098
5098
  }
5099
- function Qt(e, t, r = /* @__PURE__ */ new Set()) {
5099
+ function Zt(e, t, r = /* @__PURE__ */ new Set()) {
5100
5100
  if (e === t) return !0;
5101
5101
  if (r.has(e) || (r.add(e), !e.outgoing || e.outgoing.length === 0)) return !1;
5102
5102
  for (let n of e.outgoing.map((i) => i.targetRef))
5103
- if (Qt(n, t, r))
5103
+ if (Zt(n, t, r))
5104
5104
  return !0;
5105
5105
  return !1;
5106
5106
  }
5107
5107
  const Be = 80, $e = 100;
5108
- function Zt(e) {
5109
- return G(e, "bpmn:SubProcess") ? { width: $e, height: Be } : G(e, "bpmn:Task") ? { width: $e, height: Be } : G(e, "bpmn:Gateway") ? { width: 50, height: 50 } : G(e, "bpmn:Event") ? { width: 36, height: 36 } : G(e, "bpmn:Participant") ? { width: 400, height: 100 } : G(e, "bpmn:Lane") ? { width: 400, height: 100 } : G(e, "bpmn:DataObjectReference") ? { width: 36, height: 50 } : G(e, "bpmn:DataStoreReference") ? { width: 50, height: 50 } : G(e, "bpmn:TextAnnotation") ? { width: $e, height: 30 } : { width: $e, height: Be };
5108
+ function en(e) {
5109
+ return j(e, "bpmn:SubProcess") ? { width: $e, height: Be } : j(e, "bpmn:Task") ? { width: $e, height: Be } : j(e, "bpmn:Gateway") ? { width: 50, height: 50 } : j(e, "bpmn:Event") ? { width: 36, height: 36 } : j(e, "bpmn:Participant") ? { width: 400, height: 100 } : j(e, "bpmn:Lane") ? { width: 400, height: 100 } : j(e, "bpmn:DataObjectReference") ? { width: 36, height: 50 } : j(e, "bpmn:DataStoreReference") ? { width: 50, height: 50 } : j(e, "bpmn:TextAnnotation") ? { width: $e, height: 30 } : { width: $e, height: Be };
5110
5110
  }
5111
- function G(e, t) {
5111
+ function j(e, t) {
5112
5112
  return e.$instanceOf(t);
5113
5113
  }
5114
5114
  const $ = 150, v = 140;
@@ -5129,22 +5129,22 @@ function k(e, t, r = "r", n = "top-left") {
5129
5129
  return { original: e, x: t.x, y: e.y };
5130
5130
  throw new Error("unexpected dockingDirection: <" + r + ">");
5131
5131
  }
5132
- function en(e, t, r) {
5133
- const n = e.di, i = t.di, a = n.get("bounds"), o = i.get("bounds"), s = nt(a), p = nt(o), l = t.gridPosition.col - e.gridPosition.col, c = t.gridPosition.row - e.gridPosition.row, u = `${c > 0 ? "bottom" : "top"}-${l > 0 ? "right" : "left"}`, d = `${c > 0 ? "top" : "bottom"}-${l > 0 ? "left" : "right"}`, f = e.grid || e.attachedToRef?.grid, P = t.grid;
5132
+ function tn(e, t, r) {
5133
+ const n = e.di, i = t.di, a = n.get("bounds"), o = i.get("bounds"), s = nt(a), p = nt(o), l = t.gridPosition.col - e.gridPosition.col, c = t.gridPosition.row - e.gridPosition.row, u = `${c > 0 ? "bottom" : "top"}-${l > 0 ? "right" : "left"}`, d = `${c > 0 ? "top" : "bottom"}-${l > 0 ? "left" : "right"}`, f = e.grid || e.attachedToRef?.grid, M = t.grid;
5134
5134
  if (l === 0 && c === 0) {
5135
- const { x: E, y: N } = Ke(e.gridPosition.row, e.gridPosition.col);
5135
+ const { x: E, y: x } = Ke(e.gridPosition.row, e.gridPosition.col);
5136
5136
  return [
5137
5137
  k(s, a, "r", u),
5138
5138
  { x: f ? E + (f.getGridDimensions()[1] + 1) * $ : E + $, y: s.y },
5139
- { x: f ? E + (f.getGridDimensions()[1] + 1) * $ : E + $, y: N },
5140
- { x: p.x, y: N },
5139
+ { x: f ? E + (f.getGridDimensions()[1] + 1) * $ : E + $, y: x },
5140
+ { x: p.x, y: x },
5141
5141
  k(p, o, "t", d)
5142
5142
  ];
5143
5143
  }
5144
5144
  if (l < 0) {
5145
- const { y: E } = Ke(e.gridPosition.row, e.gridPosition.col), N = v / 2;
5145
+ const { y: E } = Ke(e.gridPosition.row, e.gridPosition.col), x = v / 2;
5146
5146
  if (s.y >= p.y) {
5147
- const W = Ur(e, t, r);
5147
+ const W = Xr(e, t, r);
5148
5148
  return W ? [
5149
5149
  k(s, a, "b"),
5150
5150
  { x: s.x, y: f ? E + (f.getGridDimensions()[0] + 1) * v : E + v + W * v },
@@ -5157,7 +5157,7 @@ function en(e, t, r) {
5157
5157
  k(p, o, "b")
5158
5158
  ];
5159
5159
  } else {
5160
- const W = s.y - N;
5160
+ const W = s.y - x;
5161
5161
  return [
5162
5162
  k(s, a, "t"),
5163
5163
  { x: s.x, y: W },
@@ -5167,7 +5167,7 @@ function en(e, t, r) {
5167
5167
  }
5168
5168
  }
5169
5169
  if (c === 0)
5170
- if (Dt(e, t, r)) {
5170
+ if (Pt(e, t, r)) {
5171
5171
  const { y: E } = Ke(e.gridPosition.row, e.gridPosition.col);
5172
5172
  return [
5173
5173
  k(s, a, "b"),
@@ -5176,14 +5176,14 @@ function en(e, t, r) {
5176
5176
  k(p, o, "b")
5177
5177
  ];
5178
5178
  } else {
5179
- const E = k(s, a, "h", u), N = k(p, o, "h", d);
5180
- return f && (E.y = a.y + Be / 2), P && (N.y = o.y + Be / 2), [
5179
+ const E = k(s, a, "h", u), x = k(p, o, "h", d);
5180
+ return f && (E.y = a.y + Be / 2), M && (x.y = o.y + Be / 2), [
5181
5181
  E,
5182
- N
5182
+ x
5183
5183
  ];
5184
5184
  }
5185
5185
  if (l === 0)
5186
- if (Dt(e, t, r)) {
5186
+ if (Pt(e, t, r)) {
5187
5187
  const E = -Math.sign(c) * v / 2;
5188
5188
  return [
5189
5189
  k(s, a, "r"),
@@ -5198,13 +5198,13 @@ function en(e, t, r) {
5198
5198
  k(s, a, "v", u),
5199
5199
  k(p, o, "v", d)
5200
5200
  ];
5201
- const D = jr(e, t, r);
5202
- if (D) {
5203
- const E = k(s, a, D[0], u), N = k(p, o, D[1], d), W = D[0] === "h" ? { x: N.x, y: E.y } : { x: E.x, y: N.y };
5201
+ const P = Ur(e, t, r);
5202
+ if (P) {
5203
+ const E = k(s, a, P[0], u), x = k(p, o, P[1], d), W = P[0] === "h" ? { x: x.x, y: E.y } : { x: E.x, y: x.y };
5204
5204
  return [
5205
5205
  E,
5206
5206
  W,
5207
- N
5207
+ x
5208
5208
  ];
5209
5209
  }
5210
5210
  const J = -Math.sign(c) * v / 2;
@@ -5230,7 +5230,7 @@ function Ke(e, t) {
5230
5230
  };
5231
5231
  }
5232
5232
  function rt(e, t, r, n, i) {
5233
- let { width: a, height: o } = Zt(e);
5233
+ let { width: a, height: o } = en(e);
5234
5234
  const { x: s, y: p } = n;
5235
5235
  if (!i)
5236
5236
  return {
@@ -5247,12 +5247,12 @@ function rt(e, t, r, n, i) {
5247
5247
  y: Math.round(l.y + l.height - o / 2)
5248
5248
  };
5249
5249
  }
5250
- function Dt(e, t, r) {
5250
+ function Pt(e, t, r) {
5251
5251
  const { row: n, col: i } = e.gridPosition, { row: a, col: o } = t.gridPosition, s = o - i, p = a - n;
5252
5252
  let l = 0;
5253
5253
  return s && (l += r.getElementsInRange({ row: n, col: i }, { row: n, col: o }).length), p && (l += r.getElementsInRange({ row: n, col: o }, { row: a, col: o }).length), l > 2;
5254
5254
  }
5255
- function jr(e, t, r) {
5255
+ function Ur(e, t, r) {
5256
5256
  const { row: n, col: i } = e.gridPosition, { row: a, col: o } = t.gridPosition, s = o - i, p = a - n;
5257
5257
  if (s > 0 && p !== 0)
5258
5258
  if (p > 0) {
@@ -5265,13 +5265,13 @@ function jr(e, t, r) {
5265
5265
  return l += r.getElementsInRange({ row: n, col: i }, c).length, l += r.getElementsInRange(c, { row: a, col: o }).length, l > 2 ? !1 : ["h", "v"];
5266
5266
  }
5267
5267
  }
5268
- function Ur(e, t, r) {
5268
+ function Xr(e, t, r) {
5269
5269
  const n = e.attachedToRef ? e.attachedToRef : e, i = t.attachedToRef ? t.attachedToRef : t, [a, o] = r.find(n), [, s] = r.find(i), p = o < s ? o : s, l = o < s ? s : o;
5270
5270
  return r.getAllElements().filter((u) => u.gridPosition.row === a && u.gridPosition.col > p && u.gridPosition.col < l).reduce((u, d) => {
5271
5271
  if (d.grid?.getGridDimensions()[0] > u) return d.grid?.getGridDimensions()[0];
5272
5272
  }, 0);
5273
5273
  }
5274
- class Xr {
5274
+ class Vr {
5275
5275
  constructor() {
5276
5276
  this.grid = [];
5277
5277
  }
@@ -5388,7 +5388,7 @@ class Xr {
5388
5388
  !r && !Number.isInteger(r) ? a.splice(a.length, 0, ...i) : a.splice(r + 1, 0, ...i);
5389
5389
  }
5390
5390
  }
5391
- class Vr {
5391
+ class zr {
5392
5392
  constructor(t) {
5393
5393
  this.moddle = t;
5394
5394
  }
@@ -5411,12 +5411,12 @@ class Vr {
5411
5411
  }
5412
5412
  createDiWaypoints(t) {
5413
5413
  var r = this;
5414
- return yn(t, function(n) {
5414
+ return gn(t, function(n) {
5415
5415
  return r.createDiWaypoint(n);
5416
5416
  });
5417
5417
  }
5418
5418
  createDiWaypoint(t) {
5419
- return this.create("dc:Point", $t(t, ["x", "y"]));
5419
+ return this.create("dc:Point", qt(t, ["x", "y"]));
5420
5420
  }
5421
5421
  createDiEdge(t, r, n) {
5422
5422
  return this.create("bpmndi:BPMNEdge", F({
@@ -5431,11 +5431,11 @@ class Vr {
5431
5431
  return this.create("bpmndi:BPMNDiagram", t);
5432
5432
  }
5433
5433
  }
5434
- var zr = {
5434
+ var Hr = {
5435
5435
  addToGrid: ({ element: e, grid: t, visited: r }) => {
5436
5436
  const n = [];
5437
5437
  return (e.attachers || []).map((a) => (a.outgoing || []).reverse()).flat().map((a) => a.targetRef).forEach((a, o, s) => {
5438
- r.has(a) || (Hr(a, e, t), n.push(a), r.add(a));
5438
+ r.has(a) || (Wr(a, e, t), n.push(a), r.add(a));
5439
5439
  }), n;
5440
5440
  },
5441
5441
  createElementDi: ({ element: e, row: t, col: r, diFactory: n, shift: i }) => {
@@ -5451,17 +5451,17 @@ var zr = {
5451
5451
  }), o;
5452
5452
  },
5453
5453
  createConnectionDi: ({ element: e, row: t, col: r, layoutGrid: n, diFactory: i, shift: a }) => (e.attachers || []).flatMap((s) => (s.outgoing || []).map((l) => {
5454
- const c = l.targetRef, u = en(s, c, n);
5455
- return Wr(s, u, [t, r]), i.createDiEdge(l, u, {
5454
+ const c = l.targetRef, u = tn(s, c, n);
5455
+ return Kr(s, u, [t, r]), i.createDiEdge(l, u, {
5456
5456
  id: l.id + "_di"
5457
5457
  });
5458
5458
  }))
5459
5459
  };
5460
- function Hr(e, t, r) {
5460
+ function Wr(e, t, r) {
5461
5461
  const [n, i] = r.find(t);
5462
5462
  (r.get(n + 1, i) || r.get(n + 1, i + 1)) && r.createRow(n), r.add(e, [n + 1, i + 1]);
5463
5463
  }
5464
- function Wr(e, t, [r, n]) {
5464
+ function Kr(e, t, [r, n]) {
5465
5465
  const a = e.di.get("bounds"), o = nt(a), s = k(o, a, "b");
5466
5466
  if (t[0].x === s.x && t[0].y === s.y)
5467
5467
  return;
@@ -5483,41 +5483,41 @@ function Wr(e, t, [r, n]) {
5483
5483
  ];
5484
5484
  t.splice(0, 1, ...l);
5485
5485
  }
5486
- var Kr = {
5486
+ var Jr = {
5487
5487
  createElementDi: ({ element: e, row: t, col: r, diFactory: n, shift: i }) => {
5488
5488
  const a = rt(e, t, r, i), o = {
5489
5489
  id: e.id + "_di"
5490
5490
  };
5491
- G(e, "bpmn:ExclusiveGateway") && (o.isMarkerVisible = !0), e.isExpanded && (o.isExpanded = !0);
5491
+ j(e, "bpmn:ExclusiveGateway") && (o.isMarkerVisible = !0), e.isExpanded && (o.isExpanded = !0);
5492
5492
  const s = n.createDiShape(e, a, o);
5493
5493
  return e.di = s, e.gridPosition = { row: t, col: r }, s;
5494
5494
  }
5495
- }, Jr = {
5495
+ }, Yr = {
5496
5496
  addToGrid: ({ element: e, grid: t, visited: r, stack: n }) => {
5497
5497
  let i = [];
5498
5498
  const a = (e.outgoing || []).map((s) => s.targetRef).filter((s) => s);
5499
5499
  let o = null;
5500
- return a.length > 1 && ei(a) && t.adjustGridPosition(e), a.forEach((s, p, l) => {
5501
- r.has(s) || (o || n.length > 0) && Zr(s, r) && !Qr(s, r) || (o ? G(e, "bpmn:ExclusiveGateway") && G(s, "bpmn:ExclusiveGateway") ? t.addAfter(o, s) : t.addBelow(l[p - 1], s) : t.addAfter(e, s), s !== e && (o = s), i.unshift(s), r.add(s));
5502
- }), i = Yr(i, "bpmn:ExclusiveGateway"), i;
5500
+ return a.length > 1 && ti(a) && t.adjustGridPosition(e), a.forEach((s, p, l) => {
5501
+ r.has(s) || (o || n.length > 0) && ei(s, r) && !Zr(s, r) || (o ? j(e, "bpmn:ExclusiveGateway") && j(s, "bpmn:ExclusiveGateway") ? t.addAfter(o, s) : t.addBelow(l[p - 1], s) : t.addAfter(e, s), s !== e && (o = s), i.unshift(s), r.add(s));
5502
+ }), i = Qr(i, "bpmn:ExclusiveGateway"), i;
5503
5503
  },
5504
5504
  createConnectionDi: ({ element: e, row: t, col: r, layoutGrid: n, diFactory: i }) => (e.outgoing || []).map((o) => {
5505
- const s = o.targetRef, p = en(e, s, n);
5505
+ const s = o.targetRef, p = tn(e, s, n);
5506
5506
  return i.createDiEdge(o, p, {
5507
5507
  id: o.id + "_di"
5508
5508
  });
5509
5509
  })
5510
5510
  };
5511
- function Yr(e, t) {
5512
- const r = e.filter((i) => !G(i, t));
5513
- return [...e.filter((i) => G(i, t)), ...r];
5514
- }
5515
5511
  function Qr(e, t) {
5512
+ const r = e.filter((i) => !j(i, t));
5513
+ return [...e.filter((i) => j(i, t)), ...r];
5514
+ }
5515
+ function Zr(e, t) {
5516
5516
  for (const r of e.incoming)
5517
5517
  if (!t.has(r.sourceRef))
5518
- return Qt(e, r.sourceRef);
5518
+ return Zt(e, r.sourceRef);
5519
5519
  }
5520
- function Zr(e, t) {
5520
+ function ei(e, t) {
5521
5521
  if (e.incoming.length > 1) {
5522
5522
  for (const r of e.incoming)
5523
5523
  if (!t.has(r.sourceRef))
@@ -5525,22 +5525,22 @@ function Zr(e, t) {
5525
5525
  }
5526
5526
  return !1;
5527
5527
  }
5528
- function ei(e) {
5529
- return e.every((t) => G(t, "bpmn:Task"));
5528
+ function ti(e) {
5529
+ return e.every((t) => j(t, "bpmn:Task"));
5530
5530
  }
5531
- var ti = {
5531
+ var ni = {
5532
5532
  addToGrid: ({ element: e, grid: t, visited: r }) => {
5533
5533
  const n = [], i = (e.incoming || []).map((a) => a.sourceRef).filter((a) => a);
5534
5534
  return i.length > 1 && (t.adjustColumnForMultipleIncoming(i, e), t.adjustRowForMultipleIncoming(i, e)), n;
5535
5535
  }
5536
5536
  };
5537
- const ni = [Kr, ti, Jr, zr];
5538
- class ri {
5537
+ const ri = [Jr, ni, Yr, Hr];
5538
+ class ii {
5539
5539
  constructor() {
5540
- this.moddle = new Lr(), this.diFactory = new Vr(this.moddle), this._handlers = ni;
5540
+ this.moddle = new jr(), this.diFactory = new zr(this.moddle), this._handlers = ri;
5541
5541
  }
5542
5542
  handle(t, r) {
5543
- return this._handlers.filter((n) => Ft(n[t])).map((n) => n[t](r));
5543
+ return this._handlers.filter((n) => kt(n[t])).map((n) => n[t](r));
5544
5544
  }
5545
5545
  async layoutProcess(t) {
5546
5546
  const r = await this.moddle.fromXML(t), { rootElement: n } = r;
@@ -5551,7 +5551,7 @@ class ri {
5551
5551
  createGridsForProcesses() {
5552
5552
  const t = this.layoutedProcesses.sort((r, n) => n.level - r.level);
5553
5553
  for (const r of t)
5554
- if (r.grid = this.createGridLayout(r), ai(r.grid), si(r.grid), r.isExpanded) {
5554
+ if (r.grid = this.createGridLayout(r), si(r.grid), oi(r.grid), r.isExpanded) {
5555
5555
  const [n, i] = r.grid.getGridDimensions();
5556
5556
  n === 0 && r.grid.createRow(), i === 0 && r.grid.createCol();
5557
5557
  }
@@ -5568,7 +5568,7 @@ class ri {
5568
5568
  for (; r.length > 0; ) {
5569
5569
  const n = r.pop();
5570
5570
  this.layoutedProcesses.push(n), n.level = n.$parent === this.diagram ? 0 : n.$parent.level + 1;
5571
- const i = n.get("flowElements").filter((a) => G(a, "bpmn:SubProcess"));
5571
+ const i = n.get("flowElements").filter((a) => j(a, "bpmn:SubProcess"));
5572
5572
  r.splice(r.length, 0, ...i);
5573
5573
  }
5574
5574
  }
@@ -5576,13 +5576,13 @@ class ri {
5576
5576
  this.diagram.diagrams = [];
5577
5577
  }
5578
5578
  createGridLayout(t) {
5579
- const r = new Xr(), n = t.flowElements || [], i = n.filter((o) => !G(o, "bpmn:SequenceFlow"));
5579
+ const r = new Vr(), n = t.flowElements || [], i = n.filter((o) => !j(o, "bpmn:SequenceFlow"));
5580
5580
  if (!n)
5581
5581
  return r;
5582
- ii(n);
5582
+ ai(n);
5583
5583
  const a = /* @__PURE__ */ new Set();
5584
5584
  for (; a.size < i.filter((o) => !o.attachedToRef).length; ) {
5585
- const o = n.filter((p) => !Gr(p) && !tt(p) && (!p.incoming || !oi(p)) && !a.has(p)), s = [...o];
5585
+ const o = n.filter((p) => !Gr(p) && !tt(p) && (!p.incoming || !pi(p)) && !a.has(p)), s = [...o];
5586
5586
  if (o.forEach((p) => {
5587
5587
  r.add(p), a.add(p);
5588
5588
  }), this.handleGrid(r, a, s), r.getElementsTotal() !== i.length) {
@@ -5636,7 +5636,7 @@ class ri {
5636
5636
  if (r.isExpanded) {
5637
5637
  const i = this.getElementDi(r), a = this.getProcDi(i);
5638
5638
  let { x: o, y: s } = i.bounds;
5639
- const { width: p, height: l } = Zt(r);
5639
+ const { width: p, height: l } = en(r);
5640
5640
  o += $ / 2 - p / 4, s += v - l - l / 4, this.generateDi(r.grid, { x: o, y: s }, a);
5641
5641
  continue;
5642
5642
  }
@@ -5651,13 +5651,13 @@ class ri {
5651
5651
  return this.diagram.diagrams.find((r) => r.plane.planeElement.includes(t));
5652
5652
  }
5653
5653
  }
5654
- function ii(e) {
5654
+ function ai(e) {
5655
5655
  e.filter((r) => tt(r)).forEach((r) => {
5656
5656
  const n = r.attachedToRef, i = n.attachers || [];
5657
5657
  i.push(r), n.attachers = i;
5658
5658
  });
5659
5659
  }
5660
- function ai(e) {
5660
+ function si(e) {
5661
5661
  const [t, r] = e.getGridDimensions();
5662
5662
  for (let n = r - 1; n >= 0; n--) {
5663
5663
  const i = [];
@@ -5673,7 +5673,7 @@ function ai(e) {
5673
5673
  e.createCol(n, o);
5674
5674
  }
5675
5675
  }
5676
- function si(e) {
5676
+ function oi(e) {
5677
5677
  const [t, r] = e.getGridDimensions();
5678
5678
  for (let n = t - 1; n >= 0; n--) {
5679
5679
  const i = [];
@@ -5690,14 +5690,14 @@ function si(e) {
5690
5690
  e.createRow(n);
5691
5691
  }
5692
5692
  }
5693
- function oi(e) {
5693
+ function pi(e) {
5694
5694
  const t = e.incoming?.filter((n) => n.sourceRef !== e && n.sourceRef.attachedToRef === void 0) || [], r = e.incoming?.filter((n) => n.sourceRef !== e && n.sourceRef.attachedToRef !== e);
5695
5695
  return t?.length > 0 || r?.length > 0;
5696
5696
  }
5697
- function tn(e) {
5698
- return new ri().layoutProcess(e);
5697
+ function nn(e) {
5698
+ return new ii().layoutProcess(e);
5699
5699
  }
5700
- const pi = (e) => ({
5700
+ const li = (e) => ({
5701
5701
  name: "get_selected_element",
5702
5702
  description: "Gets the currently selected BPMN element on the canvas. Returns the element ID, type, and name, or null if nothing is selected. Use this to understand which element the user is referring to.",
5703
5703
  parameters: {},
@@ -5723,7 +5723,7 @@ const pi = (e) => ({
5723
5723
  throw r("get_selected_element", n), n;
5724
5724
  }
5725
5725
  }
5726
- }), li = (e) => e.includes(":") ? e : `bpmn:${e[0].toUpperCase()}${e.slice(1)}`, ci = (e) => ({
5726
+ }), ci = (e) => e.includes(":") ? e : `bpmn:${e[0].toUpperCase()}${e.slice(1)}`, ui = (e) => ({
5727
5727
  name: "find_elements_by_type",
5728
5728
  description: "Finds all BPMN elements of a specific type in the current diagram. Returns a compact list with id, type, and name for each match. Supported types: userTask, serviceTask, startEvent, endEvent, exclusiveGateway, parallelGateway, subProcess, sequenceFlow, etc.",
5729
5729
  parameters: {
@@ -5743,7 +5743,7 @@ const pi = (e) => ({
5743
5743
  descriptionFormatter: () => "Searching elements",
5744
5744
  handler: async (t, r) => {
5745
5745
  try {
5746
- const n = li(t.bpmnType);
5746
+ const n = ci(t.bpmnType);
5747
5747
  return e.modeler.getElementRegistry().filter((i) => e.modeler.is(i, n)).map((i) => ({
5748
5748
  id: i.id,
5749
5749
  type: i.type,
@@ -5753,7 +5753,7 @@ const pi = (e) => ({
5753
5753
  throw r("find_elements_by_type", n), n;
5754
5754
  }
5755
5755
  }
5756
- }), ui = (e, t) => {
5756
+ }), di = (e, t) => {
5757
5757
  const r = t(e);
5758
5758
  return {
5759
5759
  id: e.id,
@@ -5762,7 +5762,7 @@ const pi = (e) => ({
5762
5762
  incoming: (e.incoming ?? []).map((n) => n.id),
5763
5763
  outgoing: (e.outgoing ?? []).map((n) => n.id)
5764
5764
  };
5765
- }, di = (e) => ({
5765
+ }, mi = (e) => ({
5766
5766
  name: "get_process_summary",
5767
5767
  description: "Gets a comprehensive summary of the current BPMN process including process ID, name, whether it is executable, counts of flow nodes/tasks/sequence flows, and a list of all flow nodes with their ID, type, name, and connections. Use this to understand the overall structure of the process.",
5768
5768
  parameters: {},
@@ -5781,19 +5781,19 @@ const pi = (e) => ({
5781
5781
  flowNodeCount: l.length,
5782
5782
  taskCount: c.length,
5783
5783
  flowCount: u.length,
5784
- flowNodes: l.map((d) => ui(d, i))
5784
+ flowNodes: l.map((d) => di(d, i))
5785
5785
  };
5786
5786
  } catch (n) {
5787
5787
  throw r("get_process_summary", n), n;
5788
5788
  }
5789
5789
  }
5790
- }), Pt = (e, t) => {
5790
+ }), _t = (e, t) => {
5791
5791
  const r = t(e).conditionExpression;
5792
5792
  return {
5793
5793
  flowId: e.id,
5794
5794
  condition: r ? r.body ?? r.text ?? "" : null
5795
5795
  };
5796
- }, mi = (e) => ({
5796
+ }, fi = (e) => ({
5797
5797
  name: "get_element_connections",
5798
5798
  description: "Gets all incoming and outgoing sequence flow connections for a specific BPMN element. Returns flow IDs, connected element IDs/names, and condition expressions if present.",
5799
5799
  parameters: {
@@ -5814,11 +5814,11 @@ const pi = (e) => ({
5814
5814
  handler: async (t, r) => {
5815
5815
  try {
5816
5816
  const { is: n, getBusinessObject: i, getElementById: a } = e.modeler, o = a(t.elementId), s = (o.incoming ?? []).filter((l) => n(l, "bpmn:SequenceFlow")).map((l) => ({
5817
- ...Pt(l, i),
5817
+ ..._t(l, i),
5818
5818
  sourceId: l.source?.id ?? null,
5819
5819
  sourceName: l.source?.businessObject?.name ?? ""
5820
5820
  })), p = (o.outgoing ?? []).filter((l) => n(l, "bpmn:SequenceFlow")).map((l) => ({
5821
- ...Pt(l, i),
5821
+ ..._t(l, i),
5822
5822
  targetId: l.target?.id ?? null,
5823
5823
  targetName: l.target?.businessObject?.name ?? ""
5824
5824
  }));
@@ -5848,7 +5848,7 @@ const pi = (e) => ({
5848
5848
  return;
5849
5849
  }
5850
5850
  o.updateModdleProperties(e, c, r);
5851
- }, fi = (e, t) => {
5851
+ }, yi = (e, t) => {
5852
5852
  const r = ue(e, "zeebe:IoMapping", t);
5853
5853
  if (!r)
5854
5854
  return { inputs: [], outputs: [] };
@@ -5860,26 +5860,26 @@ const pi = (e) => ({
5860
5860
  inputs: (r.inputParameters ?? []).map(n),
5861
5861
  outputs: (r.outputParameters ?? []).map(n)
5862
5862
  };
5863
- }, yi = (e, t) => {
5863
+ }, gi = (e, t) => {
5864
5864
  const r = ue(e, "zeebe:TaskDefinition", t);
5865
5865
  return r ? {
5866
5866
  type: r.type ?? "",
5867
5867
  retries: r.retries ?? ""
5868
5868
  } : null;
5869
- }, gi = (e, t) => {
5869
+ }, hi = (e, t) => {
5870
5870
  const r = ue(e, "zeebe:FormDefinition", t);
5871
5871
  return r ? {
5872
5872
  formId: r.formId ?? null,
5873
5873
  formKey: r.formKey ?? null,
5874
5874
  bindingType: r.bindingType ?? "latest"
5875
5875
  } : null;
5876
- }, hi = (e, t) => {
5876
+ }, bi = (e, t) => {
5877
5877
  const r = ue(e, "zeebe:Properties", t);
5878
5878
  return r ? (r.properties ?? []).reduce((n, i) => {
5879
5879
  const a = i;
5880
5880
  return { ...n, [a.name]: a.value };
5881
5881
  }, {}) : {};
5882
- }, bi = (e) => e.documentation?.[0]?.text ?? "", Ei = (e) => ({
5882
+ }, Ei = (e) => e.documentation?.[0]?.text ?? "", wi = (e) => ({
5883
5883
  name: "get_element_details",
5884
5884
  description: "Gets detailed information about a specific BPMN element including ID, type, name, description, I/O mappings, Zeebe properties, task definition, and form binding. Use this to inspect a specific element in the process.",
5885
5885
  parameters: {
@@ -5904,13 +5904,13 @@ const pi = (e) => ({
5904
5904
  id: o.id,
5905
5905
  type: o.type,
5906
5906
  name: s.name ?? "",
5907
- description: bi(s),
5907
+ description: Ei(s),
5908
5908
  ...n(o, "bpmn:Activity") ? {
5909
- ioMappings: fi(s, n),
5910
- zeebeProperties: hi(s, n),
5911
- taskDefinition: yi(s, n)
5909
+ ioMappings: yi(s, n),
5910
+ zeebeProperties: bi(s, n),
5911
+ taskDefinition: gi(s, n)
5912
5912
  } : {},
5913
- ...n(o, "bpmn:UserTask") ? { formBinding: gi(s, n) } : {},
5913
+ ...n(o, "bpmn:UserTask") ? { formBinding: hi(s, n) } : {},
5914
5914
  ...n(o, "bpmn:SequenceFlow") ? {
5915
5915
  sourceId: s.sourceRef?.id ?? null,
5916
5916
  targetId: s.targetRef?.id ?? null,
@@ -5921,7 +5921,7 @@ const pi = (e) => ({
5921
5921
  throw r("get_element_details", n), n;
5922
5922
  }
5923
5923
  }
5924
- }), wi = (e, t, r, n) => {
5924
+ }), vi = (e, t, r, n) => {
5925
5925
  const i = /* @__PURE__ */ new Set(), a = [[e]];
5926
5926
  for (; a.length > 0; ) {
5927
5927
  const o = a.shift();
@@ -5937,7 +5937,7 @@ const pi = (e) => ({
5937
5937
  p && (p.outgoing ?? []).filter((l) => n(l, "bpmn:SequenceFlow")).map((l) => l.target?.id).filter((l) => l !== void 0 && !i.has(l)).forEach((l) => a.push([...o, l]));
5938
5938
  }
5939
5939
  return [];
5940
- }, vi = (e) => ({
5940
+ }, Ii = (e) => ({
5941
5941
  name: "get_path_between_elements",
5942
5942
  description: "Finds the shortest path between two BPMN elements following sequence flows. Returns an ordered list of elements on the path with their IDs, types, and names. Returns an empty path if no route exists.",
5943
5943
  parameters: {
@@ -5963,7 +5963,7 @@ const pi = (e) => ({
5963
5963
  try {
5964
5964
  const { is: n, getElementById: i, getElementRegistry: a } = e.modeler;
5965
5965
  i(t.sourceId), i(t.targetId);
5966
- const o = a(), s = wi(t.sourceId, t.targetId, o, n);
5966
+ const o = a(), s = vi(t.sourceId, t.targetId, o, n);
5967
5967
  return {
5968
5968
  path: s.map((p) => {
5969
5969
  const l = o.get(p);
@@ -6014,14 +6014,14 @@ const pi = (e) => ({
6014
6014
  conditional: "bpmn:ConditionalEventDefinition",
6015
6015
  link: "bpmn:LinkEventDefinition",
6016
6016
  terminate: "bpmn:TerminateEventDefinition"
6017
- }, nn = (e) => {
6017
+ }, rn = (e) => {
6018
6018
  if (e.includes(":"))
6019
6019
  return e;
6020
6020
  const t = it[e];
6021
6021
  if (!t)
6022
6022
  throw new Error(`Unsupported element type: ${e}. Supported types: ${Object.keys(it).join(", ")}`);
6023
6023
  return t;
6024
- }, Ii = 100, Ti = {
6024
+ }, Ti = 100, xi = {
6025
6025
  task: "Generic task activity.",
6026
6026
  userTask: "Human interaction task.",
6027
6027
  serviceTask: "Automated service work.",
@@ -6056,13 +6056,13 @@ const pi = (e) => ({
6056
6056
  conditional: "Conditional event definition.",
6057
6057
  link: "Link event definition.",
6058
6058
  terminate: "Terminate event definition."
6059
- }, xi = (e) => {
6059
+ }, Ri = (e) => {
6060
6060
  const t = e.reduce((r, n) => {
6061
6061
  const i = r.get(n.id);
6062
6062
  return !i || (n.version ?? 0) > (i.version ?? 0) ? new Map(r).set(n.id, n) : r;
6063
6063
  }, /* @__PURE__ */ new Map());
6064
6064
  return Array.from(t.values());
6065
- }, Ri = (e) => ({
6065
+ }, Ai = (e) => ({
6066
6066
  name: "list_available_bpmn_elements",
6067
6067
  displayName: "Listing available BPMN elements",
6068
6068
  description: "Lists standard BPMN element types, event definitions, and available connector/element templates including custom organization templates.",
@@ -6079,14 +6079,14 @@ const pi = (e) => ({
6079
6079
  const n = e.templates.getOotbConnectors(), i = e.templates.getCustom(), a = [
6080
6080
  ...n.map((p) => ({ ...p, _source: "ootb" })),
6081
6081
  ...i.map((p) => ({ ...p, _source: "custom" }))
6082
- ], o = [...xi(a)].sort(
6082
+ ], o = [...Ri(a)].sort(
6083
6083
  (p, l) => (p.name || p.id || "").localeCompare(l.name || l.id || "")
6084
- ), s = o.slice(0, Ii);
6084
+ ), s = o.slice(0, Ti);
6085
6085
  return {
6086
6086
  standardElements: Object.entries(it).map(([p, l]) => ({
6087
6087
  type: p,
6088
6088
  bpmnType: l,
6089
- description: Ti[p] ?? "Standard BPMN element."
6089
+ description: xi[p] ?? "Standard BPMN element."
6090
6090
  })),
6091
6091
  eventDefinitions: Object.entries(he).map(([p, l]) => ({
6092
6092
  type: p,
@@ -6108,7 +6108,7 @@ const pi = (e) => ({
6108
6108
  throw r("list_available_bpmn_elements", n), new Error(`Failed to list available BPMN elements: ${n.message}`);
6109
6109
  }
6110
6110
  }
6111
- }), Ai = {
6111
+ }), Mi = {
6112
6112
  userTask: "user task",
6113
6113
  serviceTask: "service task",
6114
6114
  sendTask: "send task",
@@ -6133,14 +6133,14 @@ const pi = (e) => ({
6133
6133
  dataObjectReference: "data object",
6134
6134
  dataStoreReference: "data store",
6135
6135
  participant: "pool"
6136
- }, Mi = (e) => Ai[e] ?? e?.replace(/([A-Z])/g, " $1").toLowerCase().trim() ?? "element", ie = (e) => typeof e == "string" ? e : "", Ci = (e, t) => {
6136
+ }, Ci = (e) => Mi[e] ?? e?.replace(/([A-Z])/g, " $1").toLowerCase().trim() ?? "element", ie = (e) => typeof e == "string" ? e : "", Di = (e, t) => {
6137
6137
  if (!e)
6138
6138
  return t.modeler.getCanvas().getRootElement();
6139
6139
  const r = t.modeler.getElementById(e);
6140
6140
  if (!(t.modeler.is(r, "bpmn:SubProcess") || t.modeler.is(r, "bpmn:AdHocSubProcess") || t.modeler.is(r, "bpmn:Process") || t.modeler.is(r, "bpmn:Participant")))
6141
6141
  throw new Error(`Parent element ${e} must be a SubProcess, AdHocSubProcess, Process, or Participant`);
6142
6142
  return r;
6143
- }, Di = (e, t, r) => {
6143
+ }, Pi = (e, t, r) => {
6144
6144
  const n = (a) => a;
6145
6145
  if (t) {
6146
6146
  const a = n(t);
@@ -6152,7 +6152,7 @@ const pi = (e) => ({
6152
6152
  }
6153
6153
  const i = n(e);
6154
6154
  return { x: (i.x ?? 0) + 200, y: (i.y ?? 0) + 100 };
6155
- }, Pi = (e, t, r) => ({
6155
+ }, _i = (e, t, r) => ({
6156
6156
  type: t,
6157
6157
  ...e.eventDefinition && he[e.eventDefinition] ? { eventDefinitionType: he[e.eventDefinition] } : {},
6158
6158
  ...t === "bpmn:BoundaryEvent" && e.attachedToRef ? {
@@ -6161,9 +6161,9 @@ const pi = (e) => ({
6161
6161
  } : {},
6162
6162
  ...t === "bpmn:SubProcess" && e.triggeredByEvent ? { triggeredByEvent: !0, isExpanded: !0 } : {},
6163
6163
  ...t === "bpmn:AdHocSubProcess" ? { isExpanded: !0 } : {}
6164
- }), _i = (e) => ({
6164
+ }), Bi = (e) => ({
6165
6165
  name: "add_bpmn_element",
6166
- description: "Adds a new BPMN element to the diagram. Optionally connects it to existing elements using afterElementId (incoming flow) and/or beforeElementId (outgoing flow). IMPORTANT: To insert a step between two elements that are ALREADY connected by a sequence flow, use 'insert_bpmn_element_between' instead - it splits the existing flow atomically. This tool does NOT remove any pre-existing flow between afterElementId and beforeElementId, so using both arguments when that flow already exists would create a branching diagram. Returns validation errors after applying the change. Supported types: userTask, serviceTask, sendTask, receiveTask, businessRuleTask, manualTask, scriptTask, startEvent, endEvent, intermediateThrowEvent, intermediateCatchEvent, boundaryEvent, exclusiveGateway, inclusiveGateway, parallelGateway, eventBasedGateway, subProcess, adHocSubProcess, callActivity, textAnnotation.",
6166
+ description: "Adds a new BPMN element to the diagram. Optionally connects it to existing elements using afterElementId (incoming flow) and/or beforeElementId (outgoing flow). IMPORTANT: To insert a step between two elements that are ALREADY connected by a sequence flow, use 'insert_bpmn_element_between' instead - it splits the existing flow atomically. When both afterElementId and beforeElementId are provided and a direct sequence flow already exists between them, the existing flow is automatically removed to prevent duplicates. Returns validation errors after applying the change. Supported types: userTask, serviceTask, sendTask, receiveTask, businessRuleTask, manualTask, scriptTask, startEvent, endEvent, intermediateThrowEvent, intermediateCatchEvent, boundaryEvent, exclusiveGateway, inclusiveGateway, parallelGateway, eventBasedGateway, subProcess, adHocSubProcess, callActivity, textAnnotation.",
6167
6167
  parameters: {
6168
6168
  type: "object",
6169
6169
  properties: {
@@ -6211,31 +6211,38 @@ const pi = (e) => ({
6211
6211
  const r = ie(t.label) || ie(t.name);
6212
6212
  if (r) return `Adding ${r}`;
6213
6213
  const n = ie(t.type);
6214
- return n ? `Adding ${Mi(n)}` : "Adding element";
6214
+ return n ? `Adding ${Ci(n)}` : "Adding element";
6215
6215
  },
6216
6216
  handler: async (t, r) => {
6217
6217
  try {
6218
- const n = e.modeler.getModeling(), i = e.modeler.getElementFactory(), a = nn(t.type), o = Ci(t.parentElementId, e), s = t.afterElementId ? e.modeler.getElementById(t.afterElementId) : null, p = t.beforeElementId ? e.modeler.getElementById(t.beforeElementId) : null, l = Di(o, s, p), c = Pi(t, a, e), u = i.createShape(c), d = n.createShape(u, l, o);
6218
+ const n = e.modeler.getModeling(), i = e.modeler.getElementFactory(), a = rn(t.type), o = Di(t.parentElementId, e), s = t.afterElementId ? e.modeler.getElementById(t.afterElementId) : null, p = t.beforeElementId ? e.modeler.getElementById(t.beforeElementId) : null, l = Pi(o, s, p), c = _i(t, a, e), u = i.createShape(c), d = n.createShape(u, l, o);
6219
+ if (s && p) {
6220
+ const f = (s.outgoing ?? []).find(
6221
+ (M) => e.modeler.is(M, "bpmn:SequenceFlow") && M.target?.id === p.id
6222
+ );
6223
+ f && n.removeElements([f]);
6224
+ }
6219
6225
  return s && e.modeler.is(s, "bpmn:FlowNode") && n.connect(s, d), t.label && n.updateProperties(d, { name: t.label }), p && e.modeler.is(p, "bpmn:FlowNode") && n.connect(d, p), {
6220
6226
  elementId: d.id,
6221
6227
  type: d.type,
6222
- label: t.label ?? ""
6228
+ label: t.label ?? "",
6229
+ ...a === "bpmn:BoundaryEvent" ? { skipAutoLayout: !0 } : {}
6223
6230
  };
6224
6231
  } catch (n) {
6225
6232
  throw r("add_bpmn_element", n), new Error(`Failed to add BPMN element: ${n.message}`);
6226
6233
  }
6227
6234
  }
6228
- }), Bi = async (e, t, r) => {
6235
+ }), Si = async (e, t, r) => {
6229
6236
  const { xml: n } = await e.saveXML({ format: !0 }), i = await r(n), { error: a } = await t.importContent(i);
6230
6237
  if (a)
6231
6238
  throw new Error(`Auto-layout failed: ${a instanceof Error ? a.message : String(a)}`);
6232
6239
  t.ensureExecutionPlatform();
6233
- }, Si = (e, t) => async (r) => {
6240
+ }, Oi = (e, t) => async (r) => {
6234
6241
  const n = e.modeler.getModeler(), i = await r(n);
6235
- await Bi(n, e.diagram, t), await e.diagram.saveContent();
6242
+ await Si(n, e.diagram, t), await e.diagram.saveContent();
6236
6243
  const a = await e.diagram.getLintErrors();
6237
6244
  return { ...i, validationErrors: a };
6238
- }, Oi = (e, t) => {
6245
+ }, Fi = (e, t) => {
6239
6246
  if (e.sequenceFlowId) {
6240
6247
  const a = t.modeler.getElementById(e.sequenceFlowId);
6241
6248
  if (!t.modeler.is(a, "bpmn:SequenceFlow"))
@@ -6252,7 +6259,7 @@ const pi = (e) => ({
6252
6259
  `No sequence flow exists from ${e.sourceElementId} to ${e.targetElementId}. Use add_bpmn_element to create a new element with connections, or verify the element IDs.`
6253
6260
  );
6254
6261
  return i;
6255
- }, Fi = (e) => {
6262
+ }, ki = (e) => {
6256
6263
  const t = e.waypoints ?? [];
6257
6264
  if (t.length === 0) {
6258
6265
  const i = e.source, a = e.target;
@@ -6268,11 +6275,11 @@ const pi = (e) => ({
6268
6275
  x: (r.x + n.x) / 2,
6269
6276
  y: (r.y + n.y) / 2
6270
6277
  };
6271
- }, ki = (e, t) => ({
6278
+ }, $i = (e, t) => ({
6272
6279
  type: t,
6273
6280
  ...e.eventDefinition && he[e.eventDefinition] ? { eventDefinitionType: he[e.eventDefinition] } : {}
6274
- }), $i = (e, t) => {
6275
- const r = Si(e, t);
6281
+ }), qi = (e, t) => {
6282
+ const r = Oi(e, t);
6276
6283
  return {
6277
6284
  name: "insert_bpmn_element_between",
6278
6285
  description: "Inserts a new BPMN element on an existing sequence flow, splitting it in place. Prefer this tool over deleting + recreating flows when the intent is to add a step between two elements that are already connected. Specify the target flow either by sequenceFlowId, or by giving sourceElementId + targetElementId (the tool finds the flow between them). The original flow is reconnected as source -> newElement and a new flow newElement -> target is created; any condition expression on the original flow is preserved on the source -> newElement segment. Returns validation errors after applying the change. Supported types (flow nodes only): userTask, serviceTask, sendTask, receiveTask, businessRuleTask, manualTask, scriptTask, intermediateThrowEvent, intermediateCatchEvent, exclusiveGateway, inclusiveGateway, parallelGateway, eventBasedGateway, subProcess, adHocSubProcess, callActivity. startEvent, endEvent, and boundaryEvent cannot be inserted on a flow.",
@@ -6313,20 +6320,20 @@ const pi = (e) => ({
6313
6320
  handler: async (n, i) => {
6314
6321
  try {
6315
6322
  return await r((a) => {
6316
- const o = e.modeler.getModeling(), s = e.modeler.getElementFactory(), p = a.get("bpmnRules"), l = nn(n.type), c = Oi(n, e), u = ki(n, l), d = s.createShape(u), f = Fi(c);
6323
+ const o = e.modeler.getModeling(), s = e.modeler.getElementFactory(), p = a.get("bpmnRules"), l = rn(n.type), c = Fi(n, e), u = $i(n, l), d = s.createShape(u), f = ki(c);
6317
6324
  if (!p.canInsert(d, c, f))
6318
6325
  throw new Error(
6319
6326
  `Cannot insert '${n.type}' on flow ${c.id}. Only flow nodes (tasks, gateways, intermediate events, subprocesses) can be inserted on a sequence flow.`
6320
6327
  );
6321
- const P = o.createShape(d, f, c);
6322
- n.label && o.updateProperties(P, { name: n.label });
6323
- const D = c.source?.id, J = c.target?.id;
6328
+ const M = o.createShape(d, f, c);
6329
+ n.label && o.updateProperties(M, { name: n.label });
6330
+ const P = c.source?.id, J = c.target?.id;
6324
6331
  return {
6325
- elementId: P.id,
6326
- type: P.type,
6332
+ elementId: M.id,
6333
+ type: M.type,
6327
6334
  label: n.label ?? "",
6328
6335
  splitSequenceFlowId: c.id,
6329
- sourceElementId: D,
6336
+ sourceElementId: P,
6330
6337
  targetElementId: J
6331
6338
  };
6332
6339
  });
@@ -6335,14 +6342,14 @@ const pi = (e) => ({
6335
6342
  }
6336
6343
  }
6337
6344
  };
6338
- }, qi = Object.keys(he), Li = (e, t, r, n) => {
6345
+ }, Li = Object.keys(he), ji = (e, t, r, n) => {
6339
6346
  if (!n.modeler.is(e, "bpmn:Event"))
6340
6347
  throw new Error(`eventDefinition is only valid on bpmn:Event elements, got ${e.type}`);
6341
6348
  const i = r.get("moddle"), a = r.get("modeling"), o = n.modeler.getBusinessObject(e), s = t === null || t === "" ? [] : (() => {
6342
6349
  const p = he[t];
6343
6350
  if (!p)
6344
6351
  throw new Error(
6345
- `Unsupported eventDefinition: '${t}'. Expected one of: ${qi.join(
6352
+ `Unsupported eventDefinition: '${t}'. Expected one of: ${Li.join(
6346
6353
  ", "
6347
6354
  )} (or null to clear).`
6348
6355
  );
@@ -6355,7 +6362,7 @@ const pi = (e) => ({
6355
6362
  return;
6356
6363
  const i = (n.modeler.getBusinessObject(e).get("eventDefinitions") ?? []).find((a) => n.modeler.is(a, "bpmn:LinkEventDefinition"));
6357
6364
  i && r.get("modeling").updateModdleProperties(e, i, { name: t });
6358
- }, ji = (e) => ({
6365
+ }, Ui = (e) => ({
6359
6366
  name: "update_bpmn_element",
6360
6367
  description: "Updates properties of an existing BPMN element: name (display label) and/or eventDefinition (for bpmn:Event elements only — replaces any existing event definitions with a single new one, or pass null to strip them). For link events, setting name also cascades into the LinkEventDefinition name so the `link-event` bpmnlint rule can resolve a throw/catch pair via name matching. For Zeebe extension properties (task definition, I/O mappings, headers, timer time-definitions, conditional-event condition), use set_element_properties. Returns validation errors after applying the change.",
6361
6368
  parameters: {
@@ -6387,7 +6394,7 @@ const pi = (e) => ({
6387
6394
  handler: async (t, r) => {
6388
6395
  try {
6389
6396
  const n = e.modeler.getModeler(), i = n.get("modeling"), a = e.modeler.getElementById(t.elementId);
6390
- t.name !== void 0 && (i.updateProperties(a, { name: t.name }), Gi(a, t.name, n, e)), t.eventDefinition !== void 0 && Li(a, t.eventDefinition, n, e);
6397
+ t.name !== void 0 && (i.updateProperties(a, { name: t.name }), Gi(a, t.name, n, e)), t.eventDefinition !== void 0 && ji(a, t.eventDefinition, n, e);
6391
6398
  const o = e.modeler.getBusinessObject(a), s = {};
6392
6399
  if (t.name !== void 0 && (s.name = o.get("name")), t.eventDefinition !== void 0) {
6393
6400
  const p = o.get("eventDefinitions") ?? [];
@@ -6398,7 +6405,7 @@ const pi = (e) => ({
6398
6405
  throw r("update_bpmn_element", n), new Error(`Failed to update BPMN element: ${n.message}`);
6399
6406
  }
6400
6407
  }
6401
- }), Ui = (e, t) => {
6408
+ }), Xi = (e, t) => {
6402
6409
  const r = t.modeler.getElementRegistry(), n = e.id;
6403
6410
  return r.filter((i) => {
6404
6411
  if (!t.modeler.is(i, "bpmn:BoundaryEvent"))
@@ -6409,7 +6416,7 @@ const pi = (e) => ({
6409
6416
  const o = t.modeler.getBusinessObject(i);
6410
6417
  return (typeof o.get == "function" ? o.get("attachedToRef") : o.attachedToRef)?.id === n;
6411
6418
  });
6412
- }, Xi = (e) => ({
6419
+ }, Vi = (e) => ({
6413
6420
  name: "delete_bpmn_element",
6414
6421
  description: "Deletes a BPMN element from the diagram. If the element has exactly one incoming and one outgoing sequence flow, the surrounding elements are automatically reconnected. If the element has boundary events attached to it, those boundary events are deleted first so the XML never contains boundary events pointing at a removed host (the deleted IDs are returned in `cascadedBoundaryEventIds`). Returns validation errors after applying the change.",
6415
6422
  parameters: {
@@ -6429,9 +6436,9 @@ const pi = (e) => ({
6429
6436
  descriptionFormatter: () => "Removing element",
6430
6437
  handler: async (t, r) => {
6431
6438
  try {
6432
- const n = e.modeler.getModeling(), i = e.modeler.getElementById(t.elementId), a = i.id, o = Ui(i, e), s = o.map((P) => P.id);
6439
+ const n = e.modeler.getModeling(), i = e.modeler.getElementById(t.elementId), a = i.id, o = Xi(i, e), s = o.map((M) => M.id);
6433
6440
  o.length > 0 && n.removeElements(o);
6434
- const p = (i.incoming ?? []).filter((P) => e.modeler.is(P, "bpmn:SequenceFlow")), l = (i.outgoing ?? []).filter((P) => e.modeler.is(P, "bpmn:SequenceFlow")), c = p.length === 1 && l.length === 1, u = c ? p[0].source : void 0, d = c ? l[0].target : void 0;
6441
+ const p = (i.incoming ?? []).filter((M) => e.modeler.is(M, "bpmn:SequenceFlow")), l = (i.outgoing ?? []).filter((M) => e.modeler.is(M, "bpmn:SequenceFlow")), c = p.length === 1 && l.length === 1, u = c ? p[0].source : void 0, d = c ? l[0].target : void 0;
6435
6442
  n.removeElements([i]);
6436
6443
  const f = !!(c && u && d);
6437
6444
  return f && n.connect(u, d), { elementId: a, reconnected: f, cascadedBoundaryEventIds: s };
@@ -6439,7 +6446,7 @@ const pi = (e) => ({
6439
6446
  throw r("delete_bpmn_element", n), new Error(`Failed to delete BPMN element: ${n.message}`);
6440
6447
  }
6441
6448
  }
6442
- }), Vi = (e) => ({
6449
+ }), zi = (e) => ({
6443
6450
  name: "move_bpmn_element",
6444
6451
  description: "Moves a BPMN element to a new position in the process flow by reconnecting sequence flows. The element is disconnected from its current neighbors (which are reconnected to each other) and connected at the new position. At least one of afterElementId or beforeElementId is required. Returns validation errors after applying the change.",
6445
6452
  parameters: {
@@ -6490,7 +6497,7 @@ const pi = (e) => ({
6490
6497
  throw r("move_bpmn_element", n), new Error(`Failed to move BPMN element: ${n.message}`);
6491
6498
  }
6492
6499
  }
6493
- }), zi = (e) => ({
6500
+ }), Hi = (e) => ({
6494
6501
  name: "add_sequence_flow",
6495
6502
  description: "Creates a new sequence flow connection between two BPMN elements. Optionally sets a label and/or condition expression. Returns validation errors after applying the change.",
6496
6503
  parameters: {
@@ -6522,15 +6529,22 @@ const pi = (e) => ({
6522
6529
  descriptionFormatter: () => "Connecting elements",
6523
6530
  handler: async (t, r) => {
6524
6531
  try {
6525
- const n = e.modeler.getModeling(), i = e.modeler.getModdle(), a = e.modeler.getElementById(t.sourceId), o = e.modeler.getElementById(t.targetId), s = n.connect(a, o);
6526
- if (t.label && n.updateProperties(s, { name: t.label }), t.conditionExpression) {
6527
- const p = i.create("bpmn:FormalExpression", {
6532
+ const n = e.modeler.getModeling(), i = e.modeler.getModdle(), a = e.modeler.getElementById(t.sourceId), o = e.modeler.getElementById(t.targetId), s = (a.outgoing ?? []).find(
6533
+ (l) => e.modeler.is(l, "bpmn:SequenceFlow") && l.target?.id === o.id
6534
+ );
6535
+ if (s)
6536
+ throw new Error(
6537
+ `A sequence flow already exists from ${t.sourceId} to ${t.targetId} (${s.id}). Use set_element_properties to update its label or condition instead of creating a duplicate.`
6538
+ );
6539
+ const p = n.connect(a, o);
6540
+ if (t.label && n.updateProperties(p, { name: t.label }), t.conditionExpression) {
6541
+ const l = i.create("bpmn:FormalExpression", {
6528
6542
  body: t.conditionExpression
6529
6543
  });
6530
- n.updateProperties(s, { conditionExpression: p });
6544
+ n.updateProperties(p, { conditionExpression: l });
6531
6545
  }
6532
6546
  return {
6533
- flowId: s.id,
6547
+ flowId: p.id,
6534
6548
  sourceId: t.sourceId,
6535
6549
  targetId: t.targetId
6536
6550
  };
@@ -6538,61 +6552,72 @@ const pi = (e) => ({
6538
6552
  throw r("add_sequence_flow", n), new Error(`Failed to add sequence flow: ${n.message}`);
6539
6553
  }
6540
6554
  }
6541
- }), Hi = (e) => ({
6542
- name: "update_sequence_flow",
6543
- description: "Updates properties of an existing sequence flow (label and/or condition expression). Returns validation errors after applying the change.",
6544
- parameters: {
6545
- type: "object",
6546
- properties: {
6547
- flowId: {
6548
- type: "string",
6549
- description: "The ID of the sequence flow to update"
6550
- },
6551
- label: {
6552
- type: "string",
6553
- description: "New label for the sequence flow"
6555
+ }), bt = (e) => async (t) => {
6556
+ const r = e.modeler.getModeler(), n = await t(r);
6557
+ await e.diagram.saveContent();
6558
+ const i = await e.diagram.getLintErrors();
6559
+ return { ...n, validationErrors: i };
6560
+ }, Wi = (e) => {
6561
+ const t = bt(e);
6562
+ return {
6563
+ name: "update_sequence_flow",
6564
+ description: "Updates properties of an existing sequence flow (label and/or condition expression). Returns validation errors after applying the change.",
6565
+ parameters: {
6566
+ type: "object",
6567
+ properties: {
6568
+ flowId: {
6569
+ type: "string",
6570
+ description: "The ID of the sequence flow to update"
6571
+ },
6572
+ label: {
6573
+ type: "string",
6574
+ description: "New label for the sequence flow"
6575
+ },
6576
+ conditionExpression: {
6577
+ type: "string",
6578
+ description: "New FEEL condition expression (set to empty string to remove condition)"
6579
+ }
6554
6580
  },
6555
- conditionExpression: {
6556
- type: "string",
6557
- description: "New FEEL condition expression (set to empty string to remove condition)"
6558
- }
6581
+ required: ["flowId"]
6559
6582
  },
6560
- required: ["flowId"]
6561
- },
6562
- type: "frontend",
6563
- contentType: "TEXT",
6564
- category: "BPMN_MODIFICATION",
6565
- requiredCapabilities: ["BPMN_EDITING"],
6566
- descriptionFormatter: (t) => {
6567
- if (t.conditionExpression) return "Setting flow condition";
6568
- const r = ie(t.label);
6569
- return r ? `Labeling "${r}"` : "Updating connection";
6570
- },
6571
- handler: async (t, r) => {
6572
- try {
6573
- const n = e.modeler.getElementById(t.flowId);
6574
- if (!e.modeler.is(n, "bpmn:SequenceFlow"))
6575
- throw new Error(`Element ${t.flowId} is not a sequence flow`);
6576
- const i = e.modeler.getModeling(), a = e.modeler.getModdle(), o = {
6577
- ...t.label !== void 0 ? { name: t.label } : {},
6578
- ...t.conditionExpression !== void 0 ? {
6579
- conditionExpression: t.conditionExpression ? a.create("bpmn:FormalExpression", {
6580
- body: t.conditionExpression
6581
- }) : void 0
6582
- } : {}
6583
- };
6584
- return Object.keys(o).length > 0 && i.updateProperties(n, o), {
6585
- flowId: n.id,
6586
- updated: {
6587
- label: t.label,
6588
- conditionExpression: t.conditionExpression
6589
- }
6590
- };
6591
- } catch (n) {
6592
- throw r("update_sequence_flow", n), new Error(`Failed to update sequence flow: ${n.message}`);
6583
+ type: "frontend",
6584
+ contentType: "TEXT",
6585
+ category: "BPMN_MODIFICATION",
6586
+ requiredCapabilities: ["BPMN_EDITING"],
6587
+ descriptionFormatter: (r) => {
6588
+ if (r.conditionExpression)
6589
+ return "Setting flow condition";
6590
+ const n = ie(r.label);
6591
+ return n ? `Labeling "${n}"` : "Updating connection";
6592
+ },
6593
+ handler: async (r, n) => {
6594
+ try {
6595
+ return await t(() => {
6596
+ const i = e.modeler.getElementById(r.flowId);
6597
+ if (!e.modeler.is(i, "bpmn:SequenceFlow"))
6598
+ throw new Error(`Element ${r.flowId} is not a sequence flow`);
6599
+ const a = e.modeler.getModeling(), o = e.modeler.getModdle(), s = {
6600
+ ...r.label !== void 0 ? { name: r.label } : {},
6601
+ ...r.conditionExpression !== void 0 ? {
6602
+ conditionExpression: r.conditionExpression ? o.create("bpmn:FormalExpression", {
6603
+ body: r.conditionExpression
6604
+ }) : void 0
6605
+ } : {}
6606
+ };
6607
+ return Object.keys(s).length > 0 && a.updateProperties(i, s), {
6608
+ flowId: i.id,
6609
+ updated: {
6610
+ label: r.label,
6611
+ conditionExpression: r.conditionExpression
6612
+ }
6613
+ };
6614
+ });
6615
+ } catch (i) {
6616
+ throw n("update_sequence_flow", i), new Error(`Failed to update sequence flow: ${i.message}`);
6617
+ }
6593
6618
  }
6594
- }
6595
- }), Wi = (e) => ({
6619
+ };
6620
+ }, Ki = (e) => ({
6596
6621
  name: "delete_sequence_flow",
6597
6622
  description: "Deletes a sequence flow connection from the diagram. Returns validation errors after applying the change.",
6598
6623
  parameters: {
@@ -6621,7 +6646,7 @@ const pi = (e) => ({
6621
6646
  throw r("delete_sequence_flow", n), new Error(`Failed to delete sequence flow: ${n.message}`);
6622
6647
  }
6623
6648
  }
6624
- }), Ki = (e) => ({
6649
+ }), Ji = (e) => ({
6625
6650
  name: "bind_form_to_task",
6626
6651
  description: "Binds a Camunda form to a user task using the zeebe:formDefinition extension. Provide formId (the form schema ID from the formSchemaId field of the create_file_in_project result, NOT the file UUID) or formKey (for external/embedded forms). Returns validation errors after applying the change.",
6627
6652
  parameters: {
@@ -6680,19 +6705,19 @@ const pi = (e) => ({
6680
6705
  throw r("bind_form_to_task", n), new Error(`Failed to bind form to task: ${n.message}`);
6681
6706
  }
6682
6707
  }
6683
- }), Ji = {
6684
- timeDuration: "bpmn:TimeDuration",
6685
- timeCycle: "bpmn:TimeCycle",
6686
- timeDate: "bpmn:TimeDate"
6708
+ }), Yi = {
6709
+ timeDuration: "bpmn:FormalExpression",
6710
+ timeCycle: "bpmn:FormalExpression",
6711
+ timeDate: "bpmn:FormalExpression"
6687
6712
  }, ae = (e, t) => {
6688
6713
  const r = e;
6689
6714
  return typeof r.get == "function" ? r.get(t) : r[t];
6690
- }, Yi = (e, t, r, n) => {
6715
+ }, Qi = (e, t, r, n) => {
6691
6716
  if (!n.modeler.is(e, "bpmn:Event"))
6692
6717
  throw new Error(
6693
6718
  `timerDefinition is only valid on bpmn:Event elements (start, intermediate, boundary), got ${e.type}`
6694
6719
  );
6695
- const { type: i, expression: a } = t, o = Ji[i];
6720
+ const { type: i, expression: a } = t, o = Yi[i];
6696
6721
  if (!o)
6697
6722
  throw new Error(`Unsupported timerDefinition.type: '${i}'. Expected one of: timeDuration, timeCycle, timeDate.`);
6698
6723
  if (a == null || a === "")
@@ -6710,31 +6735,31 @@ const pi = (e) => ({
6710
6735
  timeCycle: i === "timeCycle" ? d : void 0,
6711
6736
  timeDate: i === "timeDate" ? d : void 0
6712
6737
  });
6713
- }, _t = (e, t, r, n) => {
6738
+ }, Bt = (e, t, r, n) => {
6714
6739
  const i = /* @__PURE__ */ new Map();
6715
6740
  return e.forEach((a) => {
6716
6741
  i.set(ae(a, "target"), a);
6717
6742
  }), t.forEach((a) => {
6718
6743
  i.set(a.target, r.create(n, { source: a.source, target: a.target }));
6719
6744
  }), Array.from(i.values());
6720
- }, Qi = (e, t, r) => {
6745
+ }, Zi = (e, t, r) => {
6721
6746
  const n = /* @__PURE__ */ new Map();
6722
6747
  return e.forEach((i) => {
6723
6748
  n.set(ae(i, "key"), i);
6724
6749
  }), Object.entries(t).forEach(([i, a]) => {
6725
6750
  n.set(i, r.create("zeebe:Header", { key: i, value: a }));
6726
6751
  }), Array.from(n.values());
6727
- }, Zi = (e, t, r) => {
6752
+ }, ea = (e, t, r) => {
6728
6753
  const n = /* @__PURE__ */ new Map();
6729
6754
  return e.forEach((i) => {
6730
6755
  n.set(ae(i, "name"), i);
6731
6756
  }), Object.entries(t).forEach(([i, a]) => {
6732
6757
  n.set(i, r.create("zeebe:Property", { name: i, value: a }));
6733
6758
  }), Array.from(n.values());
6734
- }, ea = (e, t, r, n, i) => {
6759
+ }, ta = (e, t, r, n, i) => {
6735
6760
  const a = n.get("moddle"), o = i.modeler.getBusinessObject(e), s = r ? null : ue(o, "zeebe:IoMapping", i.modeler.is), p = (s && ae(s, "inputParameters")) ?? [], l = (s && ae(s, "outputParameters")) ?? [], c = {
6736
- ...t.inputs ? { inputParameters: _t(p, t.inputs, a, "zeebe:Input") } : {},
6737
- ...t.outputs ? { outputParameters: _t(l, t.outputs, a, "zeebe:Output") } : {}
6761
+ ...t.inputs ? { inputParameters: Bt(p, t.inputs, a, "zeebe:Input") } : {},
6762
+ ...t.outputs ? { outputParameters: Bt(l, t.outputs, a, "zeebe:Output") } : {}
6738
6763
  };
6739
6764
  Fe(
6740
6765
  e,
@@ -6744,8 +6769,8 @@ const pi = (e) => ({
6744
6769
  i.modeler.getBusinessObject,
6745
6770
  i.modeler.is
6746
6771
  );
6747
- }, ta = (e, t, r, n, i) => {
6748
- const a = n.get("moddle"), o = i.modeler.getBusinessObject(e), s = r ? null : ue(o, "zeebe:TaskHeaders", i.modeler.is), p = (s && ae(s, "values")) ?? [], l = Qi(p, t, a);
6772
+ }, na = (e, t, r, n, i) => {
6773
+ const a = n.get("moddle"), o = i.modeler.getBusinessObject(e), s = r ? null : ue(o, "zeebe:TaskHeaders", i.modeler.is), p = (s && ae(s, "values")) ?? [], l = Zi(p, t, a);
6749
6774
  Fe(
6750
6775
  e,
6751
6776
  "zeebe:TaskHeaders",
@@ -6754,8 +6779,8 @@ const pi = (e) => ({
6754
6779
  i.modeler.getBusinessObject,
6755
6780
  i.modeler.is
6756
6781
  );
6757
- }, na = (e, t, r, n, i) => {
6758
- const a = n.get("moddle"), o = i.modeler.getBusinessObject(e), s = r ? null : ue(o, "zeebe:Properties", i.modeler.is), p = (s && ae(s, "properties")) ?? [], l = Zi(p, t, a);
6782
+ }, ra = (e, t, r, n, i) => {
6783
+ const a = n.get("moddle"), o = i.modeler.getBusinessObject(e), s = r ? null : ue(o, "zeebe:Properties", i.modeler.is), p = (s && ae(s, "properties")) ?? [], l = ea(p, t, a);
6759
6784
  Fe(
6760
6785
  e,
6761
6786
  "zeebe:Properties",
@@ -6764,7 +6789,7 @@ const pi = (e) => ({
6764
6789
  i.modeler.getBusinessObject,
6765
6790
  i.modeler.is
6766
6791
  );
6767
- }, ra = (e, t, r, n) => {
6792
+ }, ia = (e, t, r, n) => {
6768
6793
  if (!n.modeler.is(e, "bpmn:Event"))
6769
6794
  throw new Error(
6770
6795
  `conditionExpression on set_element_properties targets bpmn:ConditionalEventDefinition on events; got ${e.type}. For sequence flows, use update_sequence_flow(flowId, conditionExpression).`
@@ -6779,7 +6804,7 @@ const pi = (e) => ({
6779
6804
  return l.$parent = s, l;
6780
6805
  })();
6781
6806
  a.updateModdleProperties(e, s, { condition: p });
6782
- }, ia = (e) => ({
6807
+ }, aa = (e) => ({
6783
6808
  name: "set_element_properties",
6784
6809
  description: "Sets Zeebe extension properties and BPMN structural properties on a BPMN element: task definition (type/retries), I/O mappings (inputs/outputs), task headers, custom Zeebe properties, timer event definitions, and conditional-event conditions. I/O mappings, task headers, and Zeebe properties are MERGED by key by default (target for I/O, key for headers, name for properties) — pass replaceIoMappings / replaceTaskHeaders / replaceZeebeProperties = true to clobber instead. For sequence-flow conditions, use update_sequence_flow; this tool targets events and activities. Returns validation errors after applying the change.",
6785
6810
  parameters: {
@@ -6884,30 +6909,25 @@ const pi = (e) => ({
6884
6909
  n,
6885
6910
  e.modeler.getBusinessObject,
6886
6911
  e.modeler.is
6887
- ), t.ioMappings && ea(i, t.ioMappings, t.replaceIoMappings === !0, n, e), t.taskHeaders && ta(
6912
+ ), t.ioMappings && ta(i, t.ioMappings, t.replaceIoMappings === !0, n, e), t.taskHeaders && na(
6888
6913
  i,
6889
6914
  t.taskHeaders,
6890
6915
  t.replaceTaskHeaders === !0,
6891
6916
  n,
6892
6917
  e
6893
- ), t.zeebeProperties && na(
6918
+ ), t.zeebeProperties && ra(
6894
6919
  i,
6895
6920
  t.zeebeProperties,
6896
6921
  t.replaceZeebeProperties === !0,
6897
6922
  n,
6898
6923
  e
6899
- ), t.timerDefinition && Yi(i, t.timerDefinition, n, e), t.conditionExpression !== void 0 && ra(i, t.conditionExpression, n, e), { elementId: i.id };
6924
+ ), t.timerDefinition && Qi(i, t.timerDefinition, n, e), t.conditionExpression !== void 0 && ia(i, t.conditionExpression, n, e), { elementId: i.id };
6900
6925
  } catch (n) {
6901
6926
  throw r("set_element_properties", n), new Error(`Failed to set element properties: ${n.message}`);
6902
6927
  }
6903
6928
  }
6904
- }), rn = (e) => async (t) => {
6905
- const r = e.modeler.getModeler(), n = await t(r);
6906
- await e.diagram.saveContent();
6907
- const i = await e.diagram.getLintErrors();
6908
- return { ...n, validationErrors: i };
6909
- }, aa = (e) => {
6910
- const t = rn(e);
6929
+ }), sa = (e) => {
6930
+ const t = bt(e);
6911
6931
  return {
6912
6932
  name: "undo",
6913
6933
  description: "Undoes the last change made to the BPMN diagram. Returns validation errors after applying the change.",
@@ -6928,8 +6948,8 @@ const pi = (e) => ({
6928
6948
  }
6929
6949
  }
6930
6950
  };
6931
- }, sa = (e) => {
6932
- const t = rn(e);
6951
+ }, oa = (e) => {
6952
+ const t = bt(e);
6933
6953
  return {
6934
6954
  name: "redo",
6935
6955
  description: "Redoes the last undone change to the BPMN diagram. Returns validation errors after applying the change.",
@@ -6950,7 +6970,7 @@ const pi = (e) => ({
6950
6970
  }
6951
6971
  }
6952
6972
  };
6953
- }, oa = (e) => ({
6973
+ }, pa = (e) => ({
6954
6974
  name: "read_artifact",
6955
6975
  description: "Reads the current artifact content. Returns form JSON if a form editor is active, BPMN XML if a BPMN diagram is open, or DMN XML if a DMN diagram is open.",
6956
6976
  parameters: {},
@@ -6971,20 +6991,25 @@ const pi = (e) => ({
6971
6991
  throw r("read_artifact", n), n;
6972
6992
  }
6973
6993
  }
6974
- }), pa = async (e, t) => {
6994
+ }), an = (e) => {
6995
+ if (!e.diagram.canEdit())
6996
+ throw new Error("Cannot edit: the current diagram is read-only.");
6997
+ }, la = async (e, t) => {
6998
+ an(e);
6975
6999
  const { error: r } = await e.diagram.importContent(t);
6976
7000
  if (r)
6977
7001
  throw new Error(`Failed to import BPMN: ${r instanceof Error ? r.message : String(r)}`);
6978
7002
  return await e.diagram.saveContent(), { validationErrors: await e.diagram.getLintErrors() };
6979
- }, la = async (e, t) => {
7003
+ }, ca = async (e, t) => {
6980
7004
  const r = e.form.getParsedContent(t);
6981
7005
  return e.form.importSchema(r), await e.form.update(), { validationErrors: await e.form.getLintErrors() };
6982
- }, ca = async (e, t) => {
7006
+ }, ua = async (e, t) => {
7007
+ an(e);
6983
7008
  const { error: r } = await e.diagram.importContent(t);
6984
7009
  if (r)
6985
7010
  throw new Error(`Failed to import DMN: ${r instanceof Error ? r.message : String(r)}`);
6986
7011
  return await e.diagram.saveContent(), {};
6987
- }, ua = (e) => ({
7012
+ }, da = (e) => ({
6988
7013
  name: "write_artifact",
6989
7014
  description: "Writes content to the current artifact. Accepts bpmnXml, formJson, or dmnXml. Validates the content after writing and returns any validation errors.",
6990
7015
  parameters: {
@@ -6998,24 +7023,21 @@ const pi = (e) => ({
6998
7023
  type: "frontend",
6999
7024
  contentType: "TEXT",
7000
7025
  category: "FILE_OPERATION",
7001
- requiredCapabilities: ["BPMN_EDITING"],
7002
7026
  descriptionFormatter: () => "Writing changes",
7003
7027
  handler: async (t, r) => {
7004
7028
  try {
7005
- if (!e.diagram.canEdit())
7006
- throw new Error("Cannot edit: the current diagram is read-only.");
7007
7029
  if (t.bpmnXml)
7008
- return await pa(e, t.bpmnXml);
7030
+ return await la(e, t.bpmnXml);
7009
7031
  if (t.formJson)
7010
- return await la(e, t.formJson);
7032
+ return await ca(e, t.formJson);
7011
7033
  if (t.dmnXml)
7012
- return await ca(e, t.dmnXml);
7034
+ return await ua(e, t.dmnXml);
7013
7035
  throw new Error("No content provided. Pass bpmnXml, formJson, or dmnXml.");
7014
7036
  } catch (n) {
7015
7037
  throw r("write_artifact", n), n;
7016
7038
  }
7017
7039
  }
7018
- }), da = (e) => ({
7040
+ }), ma = (e) => ({
7019
7041
  name: "sync_artifact_state_ui",
7020
7042
  description: "Saves the current diagram state to persist any pending changes in the UI.",
7021
7043
  parameters: {},
@@ -7031,7 +7053,7 @@ const pi = (e) => ({
7031
7053
  throw r("sync_artifact_state_ui", n), n;
7032
7054
  }
7033
7055
  }
7034
- }), ma = (e) => ({
7056
+ }), fa = (e) => ({
7035
7057
  name: "create_file_in_project",
7036
7058
  description: "Creates a new file in the current project. Supports BPMN, DMN, Form, and Connector Template file types.",
7037
7059
  parameters: {
@@ -7072,7 +7094,7 @@ const pi = (e) => ({
7072
7094
  throw r("create_file_in_project", n), n;
7073
7095
  }
7074
7096
  }
7075
- }), fa = (e) => ({
7097
+ }), ya = (e) => ({
7076
7098
  name: "get_file_content_from_file_id",
7077
7099
  description: "Retrieves the content of a file by its ID from the project.",
7078
7100
  parameters: {
@@ -7094,7 +7116,7 @@ const pi = (e) => ({
7094
7116
  throw r("get_file_content_from_file_id", n), n;
7095
7117
  }
7096
7118
  }
7097
- }), ya = 8e3, ga = (e, t, r) => new Promise((n, i) => {
7119
+ }), ga = 8e3, ha = (e, t, r) => new Promise((n, i) => {
7098
7120
  const a = setTimeout(() => {
7099
7121
  i(new Error(r));
7100
7122
  }, t);
@@ -7103,7 +7125,7 @@ const pi = (e) => ({
7103
7125
  }).catch((o) => {
7104
7126
  clearTimeout(a), i(o);
7105
7127
  });
7106
- }), ha = (e) => ({
7128
+ }), ba = (e) => ({
7107
7129
  name: "list_files_in_project",
7108
7130
  description: "Lists all files in the current project.",
7109
7131
  parameters: {},
@@ -7114,9 +7136,9 @@ const pi = (e) => ({
7114
7136
  descriptionFormatter: () => "Listing project files",
7115
7137
  handler: async (t, r) => {
7116
7138
  try {
7117
- const { id: n } = e.project.resolve(), i = await ga(
7139
+ const { id: n } = e.project.resolve(), i = await ha(
7118
7140
  e.files.list(n),
7119
- ya,
7141
+ ga,
7120
7142
  "Timed out while listing project files"
7121
7143
  );
7122
7144
  return { files: i, totalCount: i.length };
@@ -7124,15 +7146,15 @@ const pi = (e) => ({
7124
7146
  throw r("list_files_in_project", n), n;
7125
7147
  }
7126
7148
  }
7127
- }), Bt = (e, t) => e.map((r) => ({ ...r, source: t })), ba = (e) => Array.from(
7149
+ }), St = (e, t) => e.map((r) => ({ ...r, source: t })), Ea = (e) => Array.from(
7128
7150
  e.reduce((t, r) => {
7129
7151
  const n = t.get(r.id);
7130
7152
  return n && n.version >= r.version ? t : new Map([...t, [r.id, r]]);
7131
7153
  }, /* @__PURE__ */ new Map()).values()
7132
- ), Ea = (e, t) => {
7154
+ ), wa = (e, t) => {
7133
7155
  const r = t.toLowerCase(), n = (e.name ?? "").toLowerCase(), i = (e.description ?? "").toLowerCase();
7134
7156
  return n.includes(r) || i.includes(r);
7135
- }, wa = (e, t) => !t || e.appliesTo.some((r) => r.toLowerCase().includes(t.toLowerCase())), va = (e) => ({
7157
+ }, va = (e, t) => !t || e.appliesTo.some((r) => r.toLowerCase().includes(t.toLowerCase())), Ia = (e) => ({
7136
7158
  name: "search_element_templates",
7137
7159
  description: "Searches available element templates (connectors and custom templates) by name or description. Returns matching templates with their metadata. Use this to discover available integrations and connector types that can be applied to BPMN elements.",
7138
7160
  parameters: {
@@ -7156,7 +7178,7 @@ const pi = (e) => ({
7156
7178
  descriptionFormatter: (t) => ie(t.searchTerm) ? `Searching templates for "${ie(t.searchTerm)}"` : "Browsing templates",
7157
7179
  handler: async (t, r) => {
7158
7180
  try {
7159
- const n = Bt(e.templates.getOotbConnectors(), "ootb"), i = Bt(e.templates.getCustom(), "custom"), a = [...n, ...i], o = ba(a).filter((s) => Ea(s, t.searchTerm)).filter((s) => wa(s, t.elementType)).map((s) => ({
7181
+ const n = St(e.templates.getOotbConnectors(), "ootb"), i = St(e.templates.getCustom(), "custom"), a = [...n, ...i], o = Ea(a).filter((s) => wa(s, t.searchTerm)).filter((s) => va(s, t.elementType)).map((s) => ({
7160
7182
  id: s.id,
7161
7183
  name: s.name,
7162
7184
  description: s.description ?? "",
@@ -7170,10 +7192,10 @@ const pi = (e) => ({
7170
7192
  throw r("search_element_templates", n), new Error(`Failed to search element templates: ${n.message}`);
7171
7193
  }
7172
7194
  }
7173
- }), Ia = (e) => e.reduce(
7195
+ }), Ta = (e) => e.reduce(
7174
7196
  (t, r) => !t || r.version > t.version ? r : t,
7175
7197
  void 0
7176
- ), Ta = (e, t) => e.find((r) => r.version === t), Na = (e) => ({
7198
+ ), xa = (e, t) => e.find((r) => r.version === t), Na = (e) => ({
7177
7199
  name: "get_element_template_details",
7178
7200
  description: "Gets detailed information about a specific element template, including its properties, groups, and configuration. Use this after searching templates to understand what a template configures before applying it.",
7179
7201
  parameters: {
@@ -7200,7 +7222,7 @@ const pi = (e) => ({
7200
7222
  const n = [...e.templates.getOotbConnectors(), ...e.templates.getCustom()].filter((a) => a.id === t.templateId);
7201
7223
  if (n.length === 0)
7202
7224
  throw new Error(`Template with ID "${t.templateId}" not found`);
7203
- const i = t.version !== void 0 ? Ta(n, t.version) : Ia(n);
7225
+ const i = t.version !== void 0 ? xa(n, t.version) : Ta(n);
7204
7226
  if (!i)
7205
7227
  throw new Error(`Template "${t.templateId}" version ${t.version} not found`);
7206
7228
  return {
@@ -7217,7 +7239,7 @@ const pi = (e) => ({
7217
7239
  throw r("get_element_template_details", n), new Error(`Failed to get template details: ${n.message}`);
7218
7240
  }
7219
7241
  }
7220
- }), xa = (e) => ({
7242
+ }), Ra = (e) => ({
7221
7243
  name: "apply_element_template",
7222
7244
  description: "Applies an element template (connector or custom template) to a BPMN element. The element must exist in the diagram and the template must be available. Use search_element_templates first to find the template ID.",
7223
7245
  parameters: {
@@ -7256,7 +7278,7 @@ const pi = (e) => ({
7256
7278
  throw r("apply_element_template", n), new Error(`Failed to apply element template: ${n.message}`);
7257
7279
  }
7258
7280
  }
7259
- }), Ra = (e) => ({
7281
+ }), Aa = (e) => ({
7260
7282
  name: "get_diagram_errors",
7261
7283
  description: "Gets all validation errors for the current BPMN diagram, including lint errors and deployment errors. Use this to check if the diagram is valid and identify issues that need to be fixed.",
7262
7284
  parameters: {},
@@ -7277,7 +7299,7 @@ const pi = (e) => ({
7277
7299
  throw r("get_diagram_errors", n), new Error(`Failed to get diagram errors: ${n.message}`);
7278
7300
  }
7279
7301
  }
7280
- }), Aa = (e) => ({
7302
+ }), Ma = (e) => ({
7281
7303
  name: "get_form_errors",
7282
7304
  description: "Gets all validation errors for the current form. Returns lint errors that indicate issues with form field configuration. Only available when a form is open.",
7283
7305
  parameters: {},
@@ -7299,7 +7321,7 @@ const pi = (e) => ({
7299
7321
  throw r("get_form_errors", n), new Error(`Failed to get form errors: ${n.message}`);
7300
7322
  }
7301
7323
  }
7302
- }), Ma = (e) => ({
7324
+ }), Ca = (e) => ({
7303
7325
  name: "layout_bpmn_xml",
7304
7326
  description: "Auto-layouts the current BPMN diagram to improve visual clarity and readability.",
7305
7327
  parameters: {},
@@ -7313,7 +7335,7 @@ const pi = (e) => ({
7313
7335
  try {
7314
7336
  if (!e.diagram.canEdit())
7315
7337
  throw new Error("Cannot layout: the current diagram is read-only.");
7316
- const n = await e.diagram.exportXml(), i = await tn(n), { error: a } = await e.diagram.importContent(i);
7338
+ const n = await e.diagram.exportXml(), i = await nn(n), { error: a } = await e.diagram.importContent(i);
7317
7339
  if (a)
7318
7340
  throw new Error(`Auto-layout import failed: ${a instanceof Error ? a.message : String(a)}`);
7319
7341
  return e.diagram.ensureExecutionPlatform(), await e.diagram.saveContent(), { bpmnXml: i };
@@ -7326,7 +7348,7 @@ const pi = (e) => ({
7326
7348
  return !0;
7327
7349
  const n = e[r];
7328
7350
  return Array.isArray(n) ? n.every((i) => at(i) ? st(i, t) : !0) : at(n) ? st(n, t) : !0;
7329
- }), an = (e, t) => {
7351
+ }), sn = (e, t) => {
7330
7352
  at(e) && st(e, t);
7331
7353
  }, Ae = (e) => `${e}_${Math.random().toString(36).slice(2, 10)}`, se = async (e, t) => {
7332
7354
  const { rootElement: r } = await e.fromXML(t);
@@ -7344,7 +7366,7 @@ const pi = (e) => ({
7344
7366
  if (!t || t.$type !== "dmn:DecisionTable")
7345
7367
  throw new Error(`Decision ${e.id} does not have a decision table`);
7346
7368
  return t;
7347
- }, Ca = (e, t, r, n) => {
7369
+ }, Da = (e, t, r, n) => {
7348
7370
  const i = e.name ?? null;
7349
7371
  if (e.$type === "dmn:Decision") {
7350
7372
  const a = e.decisionLogic;
@@ -7360,11 +7382,11 @@ const pi = (e) => ({
7360
7382
  return;
7361
7383
  }
7362
7384
  e.$type === "dmn:BusinessKnowledgeModel" && n.push({ id: e.id, name: i });
7363
- }, Da = (e) => {
7385
+ }, Pa = (e) => {
7364
7386
  const t = [], r = [], n = [];
7365
- return an(
7387
+ return sn(
7366
7388
  e,
7367
- (i) => Ca(i, t, r, n)
7389
+ (i) => Da(i, t, r, n)
7368
7390
  ), {
7369
7391
  definitionsId: e.id ?? null,
7370
7392
  decisionsCount: t.length,
@@ -7374,7 +7396,7 @@ const pi = (e) => ({
7374
7396
  inputData: r,
7375
7397
  businessKnowledgeModels: n
7376
7398
  };
7377
- }, Pa = (e) => ({
7399
+ }, _a = (e) => ({
7378
7400
  name: "get_dmn_summary",
7379
7401
  displayName: "Reading DMN summary",
7380
7402
  description: "Returns an overview of the current DMN model including decisions, input data, and business knowledge models.",
@@ -7386,12 +7408,12 @@ const pi = (e) => ({
7386
7408
  handler: async (t, r) => {
7387
7409
  try {
7388
7410
  const n = await e.diagram.exportXml(), i = e.dmn.createModdle(), { definitions: a } = await se(i, n);
7389
- return Da(a);
7411
+ return Pa(a);
7390
7412
  } catch (n) {
7391
7413
  throw r("get_dmn_summary", n), new Error(`Failed to get DMN summary: ${n.message}`);
7392
7414
  }
7393
7415
  }
7394
- }), _a = (e) => ({
7416
+ }), Ba = (e) => ({
7395
7417
  name: "get_dmn_element_details",
7396
7418
  displayName: "Reading DMN element",
7397
7419
  description: "Returns metadata for a DMN element by id.",
@@ -7412,7 +7434,7 @@ const pi = (e) => ({
7412
7434
  handler: async (t, r) => {
7413
7435
  try {
7414
7436
  const { elementId: n } = t, i = await e.diagram.exportXml(), a = e.dmn.createModdle(), { definitions: o } = await se(a, i), s = [];
7415
- an(o, (l) => {
7437
+ sn(o, (l) => {
7416
7438
  if (l.id === n)
7417
7439
  return s.push(l), !1;
7418
7440
  });
@@ -7429,7 +7451,7 @@ const pi = (e) => ({
7429
7451
  throw r("get_dmn_element_details", n), new Error(`Failed to get DMN element details: ${n.message}`);
7430
7452
  }
7431
7453
  }
7432
- }), Ba = (e) => e.map((t) => {
7454
+ }), Sa = (e) => e.map((t) => {
7433
7455
  const r = t.inputExpression;
7434
7456
  return {
7435
7457
  id: t.id,
@@ -7437,12 +7459,12 @@ const pi = (e) => ({
7437
7459
  expression: r?.text ?? "",
7438
7460
  typeRef: r?.typeRef ?? null
7439
7461
  };
7440
- }), Sa = (e) => e.map((t) => ({
7462
+ }), Oa = (e) => e.map((t) => ({
7441
7463
  id: t.id,
7442
7464
  label: t.label ?? null,
7443
7465
  name: t.name ?? null,
7444
7466
  typeRef: t.typeRef ?? null
7445
- })), Oa = (e) => e.map((t) => ({
7467
+ })), Fa = (e) => e.map((t) => ({
7446
7468
  id: t.id,
7447
7469
  inputEntries: (t.inputEntry ?? []).map(
7448
7470
  (r) => r.text ?? ""
@@ -7450,7 +7472,7 @@ const pi = (e) => ({
7450
7472
  outputEntries: (t.outputEntry ?? []).map(
7451
7473
  (r) => r.text ?? ""
7452
7474
  )
7453
- })), Fa = (e) => ({
7475
+ })), ka = (e) => ({
7454
7476
  name: "get_decision_table",
7455
7477
  displayName: "Reading decision table",
7456
7478
  description: "Returns the full decision table structure for a decision, including inputs, outputs, hit policy, and rules.",
@@ -7475,15 +7497,15 @@ const pi = (e) => ({
7475
7497
  decisionName: s.name ?? null,
7476
7498
  tableId: p.id,
7477
7499
  hitPolicy: p.hitPolicy ?? "UNIQUE",
7478
- inputs: Ba(l),
7479
- outputs: Sa(c),
7480
- rules: Oa(u)
7500
+ inputs: Sa(l),
7501
+ outputs: Oa(c),
7502
+ rules: Fa(u)
7481
7503
  };
7482
7504
  } catch (n) {
7483
7505
  throw r("get_decision_table", n), new Error(`Failed to get decision table: ${n.message}`);
7484
7506
  }
7485
7507
  }
7486
- }), ka = /* @__PURE__ */ new Set(["UNIQUE", "FIRST", "PRIORITY", "ANY", "COLLECT", "RULE ORDER", "OUTPUT ORDER"]), $a = (e) => ({
7508
+ }), $a = /* @__PURE__ */ new Set(["UNIQUE", "FIRST", "PRIORITY", "ANY", "COLLECT", "RULE ORDER", "OUTPUT ORDER"]), qa = (e) => ({
7487
7509
  name: "set_hit_policy",
7488
7510
  displayName: "Setting hit policy",
7489
7511
  description: "Sets the hit policy of a DMN decision table.",
@@ -7508,7 +7530,7 @@ const pi = (e) => ({
7508
7530
  handler: async (t, r) => {
7509
7531
  try {
7510
7532
  const { decisionId: n, hitPolicy: i } = t;
7511
- if (!ka.has(i))
7533
+ if (!$a.has(i))
7512
7534
  throw new Error(`Unsupported hit policy: ${i}`);
7513
7535
  const a = await e.diagram.exportXml(), o = e.dmn.createModdle(), { definitions: s } = await se(o, a), p = we(s, n), l = ve(p);
7514
7536
  l.hitPolicy = i;
@@ -7524,7 +7546,7 @@ const pi = (e) => ({
7524
7546
  throw r("set_hit_policy", n), new Error(`Failed to set hit policy: ${n.message}`);
7525
7547
  }
7526
7548
  }
7527
- }), qa = (e) => ({
7549
+ }), La = (e) => ({
7528
7550
  name: "update_dmn_xml",
7529
7551
  displayName: "Updating DMN XML",
7530
7552
  description: "Imports and saves full DMN XML content for advanced edits.",
@@ -7558,7 +7580,7 @@ const pi = (e) => ({
7558
7580
  throw r("update_dmn_xml", n), new Error(`Failed to update DMN XML: ${n.message}`);
7559
7581
  }
7560
7582
  }
7561
- }), La = (e, { label: t, expression: r, typeRef: n }) => e.create("dmn:Input", {
7583
+ }), ja = (e, { label: t, expression: r, typeRef: n }) => e.create("dmn:Input", {
7562
7584
  id: Ae("Input"),
7563
7585
  label: t ?? null,
7564
7586
  inputExpression: e.create("dmn:LiteralExpression", {
@@ -7571,9 +7593,9 @@ const pi = (e) => ({
7571
7593
  label: t ?? null,
7572
7594
  name: r ?? null,
7573
7595
  typeRef: n ?? "string"
7574
- }), ja = (e, t, r) => {
7596
+ }), Ua = (e, t, r) => {
7575
7597
  if (r.type === "input") {
7576
- const n = La(e, r), i = t.input ?? [];
7598
+ const n = ja(e, r), i = t.input ?? [];
7577
7599
  return t.input = [...i, n], n;
7578
7600
  }
7579
7601
  if (r.type === "output") {
@@ -7581,23 +7603,23 @@ const pi = (e) => ({
7581
7603
  return t.output = [...i, n], n;
7582
7604
  }
7583
7605
  throw new Error("Column type must be either 'input' or 'output'");
7584
- }, Ua = (e, { label: t, expression: r, typeRef: n }) => {
7606
+ }, Xa = (e, { label: t, expression: r, typeRef: n }) => {
7585
7607
  const i = e;
7586
7608
  t !== void 0 && (i.label = t);
7587
7609
  const a = e.inputExpression;
7588
7610
  r !== void 0 && a && (a.text = r), n !== void 0 && a && (a.typeRef = n);
7589
- }, Xa = (e, { label: t, expression: r, typeRef: n }) => {
7611
+ }, Va = (e, { label: t, expression: r, typeRef: n }) => {
7590
7612
  const i = e;
7591
7613
  t !== void 0 && (i.label = t), r !== void 0 && (i.name = r), n !== void 0 && (i.typeRef = n);
7592
- }, Va = (e, t) => {
7614
+ }, za = (e, t) => {
7593
7615
  const r = (e.input ?? []).find((i) => i.id === t.columnId);
7594
7616
  if (r)
7595
- return Ua(r, t), { type: "input", column: r };
7617
+ return Xa(r, t), { type: "input", column: r };
7596
7618
  const n = (e.output ?? []).find((i) => i.id === t.columnId);
7597
7619
  if (n)
7598
- return Xa(n, t), { type: "output", column: n };
7620
+ return Va(n, t), { type: "output", column: n };
7599
7621
  throw new Error(`Column not found: ${t.columnId}`);
7600
- }, za = (e) => ({
7622
+ }, Ha = (e) => ({
7601
7623
  name: "add_decision_table_column",
7602
7624
  displayName: "Adding decision table column",
7603
7625
  description: "Adds an input or output column to a DMN decision table.",
@@ -7633,9 +7655,9 @@ const pi = (e) => ({
7633
7655
  requiredCapabilities: ["DMN_EDITING"],
7634
7656
  handler: async (t, r) => {
7635
7657
  try {
7636
- const { decisionId: n, type: i, label: a, expression: o, typeRef: s } = t, p = await e.diagram.exportXml(), l = e.dmn.createModdle(), { definitions: c } = await se(l, p), u = we(c, n), d = ve(u), f = ja(l, d, { type: i, label: a, expression: o, typeRef: s }), P = await Ce(c), { error: D } = await e.diagram.importContent(P);
7637
- if (D)
7638
- throw new Error(`Failed to import DMN: ${String(D)}`);
7658
+ const { decisionId: n, type: i, label: a, expression: o, typeRef: s } = t, p = await e.diagram.exportXml(), l = e.dmn.createModdle(), { definitions: c } = await se(l, p), u = we(c, n), d = ve(u), f = Ua(l, d, { type: i, label: a, expression: o, typeRef: s }), M = await Ce(c), { error: P } = await e.diagram.importContent(M);
7659
+ if (P)
7660
+ throw new Error(`Failed to import DMN: ${String(P)}`);
7639
7661
  return await e.diagram.saveContent(), {
7640
7662
  decisionId: u.id,
7641
7663
  tableId: d.id,
@@ -7646,30 +7668,30 @@ const pi = (e) => ({
7646
7668
  throw r("add_decision_table_column", n), new Error(`Failed to add decision table column: ${n.message}`);
7647
7669
  }
7648
7670
  }
7649
- }), sn = (e, t) => e.create("dmn:UnaryTests", {
7671
+ }), on = (e, t) => e.create("dmn:UnaryTests", {
7650
7672
  id: Ae("InputEntry"),
7651
7673
  text: t
7652
- }), on = (e, t) => e.create("dmn:LiteralExpression", {
7674
+ }), pn = (e, t) => e.create("dmn:LiteralExpression", {
7653
7675
  id: Ae("OutputEntry"),
7654
7676
  text: t
7655
- }), Ha = (e, t, r = [], n = []) => {
7677
+ }), Wa = (e, t, r = [], n = []) => {
7656
7678
  const i = e.create("dmn:DecisionRule", {
7657
7679
  id: Ae("Rule"),
7658
- inputEntry: r.map((o) => sn(e, o ?? "")),
7659
- outputEntry: n.map((o) => on(e, o ?? ""))
7680
+ inputEntry: r.map((o) => on(e, o ?? "")),
7681
+ outputEntry: n.map((o) => pn(e, o ?? ""))
7660
7682
  }), a = t.rule ?? [];
7661
7683
  return t.rule = [...a, i], i;
7662
- }, Wa = (e, t, r, n = [], i = []) => {
7684
+ }, Ka = (e, t, r, n = [], i = []) => {
7663
7685
  const a = (t.rule ?? []).find((o) => o.id === r);
7664
7686
  if (!a)
7665
7687
  throw new Error(`Rule not found: ${r}`);
7666
- return n.length > 0 && (a.inputEntry = n.map((o) => sn(e, o ?? ""))), i.length > 0 && (a.outputEntry = i.map((o) => on(e, o ?? ""))), a;
7667
- }, Ka = (e, t) => {
7688
+ return n.length > 0 && (a.inputEntry = n.map((o) => on(e, o ?? ""))), i.length > 0 && (a.outputEntry = i.map((o) => pn(e, o ?? ""))), a;
7689
+ }, Ja = (e, t) => {
7668
7690
  const r = e.rule ?? [], n = r.filter((i) => i.id !== t);
7669
7691
  if (n.length === r.length)
7670
7692
  throw new Error(`Rule not found: ${t}`);
7671
7693
  e.rule = n;
7672
- }, Ja = (e) => ({
7694
+ }, Ya = (e) => ({
7673
7695
  name: "add_decision_table_rule",
7674
7696
  displayName: "Adding decision table rule",
7675
7697
  description: "Adds a rule to a DMN decision table.",
@@ -7702,7 +7724,7 @@ const pi = (e) => ({
7702
7724
  decisionId: n,
7703
7725
  inputEntries: i = [],
7704
7726
  outputEntries: a = []
7705
- } = t, o = await e.diagram.exportXml(), s = e.dmn.createModdle(), { definitions: p } = await se(s, o), l = we(p, n), c = ve(l), u = Ha(s, c, i, a), d = await Ce(p), { error: f } = await e.diagram.importContent(d);
7727
+ } = t, o = await e.diagram.exportXml(), s = e.dmn.createModdle(), { definitions: p } = await se(s, o), l = we(p, n), c = ve(l), u = Wa(s, c, i, a), d = await Ce(p), { error: f } = await e.diagram.importContent(d);
7706
7728
  if (f)
7707
7729
  throw new Error(`Failed to import DMN: ${String(f)}`);
7708
7730
  return await e.diagram.saveContent(), {
@@ -7714,7 +7736,7 @@ const pi = (e) => ({
7714
7736
  throw r("add_decision_table_rule", n), new Error(`Failed to add decision table rule: ${n.message}`);
7715
7737
  }
7716
7738
  }
7717
- }), Ya = (e) => ({
7739
+ }), Qa = (e) => ({
7718
7740
  name: "delete_decision_table_rule",
7719
7741
  displayName: "Deleting decision table rule",
7720
7742
  description: "Deletes a rule from a DMN decision table.",
@@ -7739,7 +7761,7 @@ const pi = (e) => ({
7739
7761
  handler: async (t, r) => {
7740
7762
  try {
7741
7763
  const { decisionId: n, ruleId: i } = t, a = await e.diagram.exportXml(), o = e.dmn.createModdle(), { definitions: s } = await se(o, a), p = we(s, n), l = ve(p);
7742
- Ka(l, i);
7764
+ Ja(l, i);
7743
7765
  const c = await Ce(s), { error: u } = await e.diagram.importContent(c);
7744
7766
  if (u)
7745
7767
  throw new Error(`Failed to import DMN: ${String(u)}`);
@@ -7752,7 +7774,7 @@ const pi = (e) => ({
7752
7774
  throw r("delete_decision_table_rule", n), new Error(`Failed to delete decision table rule: ${n.message}`);
7753
7775
  }
7754
7776
  }
7755
- }), Qa = (e) => ({
7777
+ }), Za = (e) => ({
7756
7778
  name: "update_decision_table_column",
7757
7779
  displayName: "Updating decision table column",
7758
7780
  description: "Updates an input or output column in a DMN decision table.",
@@ -7788,9 +7810,9 @@ const pi = (e) => ({
7788
7810
  requiredCapabilities: ["DMN_EDITING"],
7789
7811
  handler: async (t, r) => {
7790
7812
  try {
7791
- const { decisionId: n, columnId: i, label: a, expression: o, typeRef: s } = t, p = await e.diagram.exportXml(), l = e.dmn.createModdle(), { definitions: c } = await se(l, p), u = we(c, n), d = ve(u), { type: f } = Va(d, { columnId: i, label: a, expression: o, typeRef: s }), P = await Ce(c), { error: D } = await e.diagram.importContent(P);
7792
- if (D)
7793
- throw new Error(`Failed to import DMN: ${String(D)}`);
7813
+ const { decisionId: n, columnId: i, label: a, expression: o, typeRef: s } = t, p = await e.diagram.exportXml(), l = e.dmn.createModdle(), { definitions: c } = await se(l, p), u = we(c, n), d = ve(u), { type: f } = za(d, { columnId: i, label: a, expression: o, typeRef: s }), M = await Ce(c), { error: P } = await e.diagram.importContent(M);
7814
+ if (P)
7815
+ throw new Error(`Failed to import DMN: ${String(P)}`);
7794
7816
  return await e.diagram.saveContent(), {
7795
7817
  decisionId: u.id,
7796
7818
  tableId: d.id,
@@ -7801,7 +7823,7 @@ const pi = (e) => ({
7801
7823
  throw r("update_decision_table_column", n), new Error(`Failed to update decision table column: ${n.message}`);
7802
7824
  }
7803
7825
  }
7804
- }), Za = (e) => ({
7826
+ }), es = (e) => ({
7805
7827
  name: "update_decision_table_rule",
7806
7828
  displayName: "Updating decision table rule",
7807
7829
  description: "Updates an existing DMN decision table rule.",
@@ -7840,9 +7862,9 @@ const pi = (e) => ({
7840
7862
  ruleId: i,
7841
7863
  inputEntries: a = [],
7842
7864
  outputEntries: o = []
7843
- } = t, s = await e.diagram.exportXml(), p = e.dmn.createModdle(), { definitions: l } = await se(p, s), c = we(l, n), u = ve(c), d = Wa(p, u, i, a, o), f = await Ce(l), { error: P } = await e.diagram.importContent(f);
7844
- if (P)
7845
- throw new Error(`Failed to import DMN: ${String(P)}`);
7865
+ } = t, s = await e.diagram.exportXml(), p = e.dmn.createModdle(), { definitions: l } = await se(p, s), c = we(l, n), u = ve(c), d = Ka(p, u, i, a, o), f = await Ce(l), { error: M } = await e.diagram.importContent(f);
7866
+ if (M)
7867
+ throw new Error(`Failed to import DMN: ${String(M)}`);
7846
7868
  return await e.diagram.saveContent(), {
7847
7869
  decisionId: c.id,
7848
7870
  tableId: u.id,
@@ -7852,7 +7874,7 @@ const pi = (e) => ({
7852
7874
  throw r("update_decision_table_rule", n), new Error(`Failed to update decision table rule: ${n.message}`);
7853
7875
  }
7854
7876
  }
7855
- }), es = (e) => ({
7877
+ }), ts = (e) => ({
7856
7878
  name: "get_form_schema",
7857
7879
  displayName: "Reading form schema",
7858
7880
  description: "Returns the current form schema from the active form editor session.",
@@ -7868,7 +7890,7 @@ const pi = (e) => ({
7868
7890
  throw r("get_form_schema", n), new Error(`Failed to read form schema: ${n.message}`);
7869
7891
  }
7870
7892
  }
7871
- }), ts = (e) => ({
7893
+ }), ns = (e) => ({
7872
7894
  name: "get_form_binding_from_task",
7873
7895
  displayName: "Reading form binding",
7874
7896
  description: "Gets the form binding configuration from a BPMN user task, including formId/formKey and binding details.",
@@ -7908,7 +7930,7 @@ const pi = (e) => ({
7908
7930
  throw r("get_form_binding_from_task", n), new Error(`Failed to get form binding from task: ${n.message}`);
7909
7931
  }
7910
7932
  }
7911
- }), ns = (e) => {
7933
+ }), rs = (e) => {
7912
7934
  if (!e)
7913
7935
  return null;
7914
7936
  const t = Array.isArray(e) ? e[0] : e;
@@ -7921,7 +7943,7 @@ const pi = (e) => ({
7921
7943
  type: typeof r.type == "string" ? r.type : null,
7922
7944
  label: typeof r.label == "string" ? r.label : null
7923
7945
  };
7924
- }, rs = (e) => ({
7946
+ }, is = (e) => ({
7925
7947
  name: "get_selected_form_field",
7926
7948
  displayName: "Reading selected form field",
7927
7949
  description: "Returns details of the currently selected field in the form editor.",
@@ -7932,7 +7954,7 @@ const pi = (e) => ({
7932
7954
  requiredCapabilities: ["FORM_VIEWING"],
7933
7955
  handler: async (t, r) => {
7934
7956
  try {
7935
- const n = e.form.getSelection(), i = ns(n);
7957
+ const n = e.form.getSelection(), i = rs(n);
7936
7958
  return {
7937
7959
  selected: i,
7938
7960
  found: !!i
@@ -7941,7 +7963,7 @@ const pi = (e) => ({
7941
7963
  throw r("get_selected_form_field", n), new Error(`Failed to get selected form field: ${n.message}`);
7942
7964
  }
7943
7965
  }
7944
- }), is = /* @__PURE__ */ new Set([
7966
+ }), as = /* @__PURE__ */ new Set([
7945
7967
  "textfield",
7946
7968
  "textarea",
7947
7969
  "number",
@@ -7958,10 +7980,10 @@ const pi = (e) => ({
7958
7980
  "group",
7959
7981
  "button",
7960
7982
  "default"
7961
- ]), ot = /* @__PURE__ */ new Set(["text", "image", "spacer", "separator", "group", "button", "default"]), V = (e) => e !== null && typeof e == "object" && !Array.isArray(e), bt = (e, t) => !V(e) || !V(t) ? t : Object.entries(t).reduce(
7962
- (r, [n, i]) => V(i) && V(r[n]) ? { ...r, [n]: bt(r[n], i) } : { ...r, [n]: i },
7983
+ ]), ot = /* @__PURE__ */ new Set(["text", "image", "spacer", "separator", "group", "button", "default"]), V = (e) => e !== null && typeof e == "object" && !Array.isArray(e), Et = (e, t) => !V(e) || !V(t) ? t : Object.entries(t).reduce(
7984
+ (r, [n, i]) => V(i) && V(r[n]) ? { ...r, [n]: Et(r[n], i) } : { ...r, [n]: i },
7963
7985
  { ...e }
7964
- ), pn = (e, t) => {
7986
+ ), ln = (e, t) => {
7965
7987
  if (e == null || e === "")
7966
7988
  return null;
7967
7989
  if (typeof e == "string")
@@ -7976,18 +7998,18 @@ const pi = (e) => ({
7976
7998
  if (!V(e))
7977
7999
  throw new Error(`${t} must be a JSON object`);
7978
8000
  return e;
7979
- }, as = (e) => {
8001
+ }, ss = (e) => {
7980
8002
  const t = e.id;
7981
8003
  if (typeof t == "string")
7982
8004
  return t;
7983
8005
  const r = e.key;
7984
8006
  return typeof r == "string" ? r : null;
7985
- }, Et = (e, t) => Array.isArray(e) ? e.map((r) => {
8007
+ }, wt = (e, t) => Array.isArray(e) ? e.map((r) => {
7986
8008
  if (!V(r))
7987
8009
  return r;
7988
- const n = Array.isArray(r.components) ? { ...r, components: Et(r.components, t) } : { ...r };
8010
+ const n = Array.isArray(r.components) ? { ...r, components: wt(r.components, t) } : { ...r };
7989
8011
  return t(n);
7990
- }).filter((r) => r != null) : [], ss = (e, t) => {
8012
+ }).filter((r) => r != null) : [], os = (e, t) => {
7991
8013
  if (!Array.isArray(t) || t.length === 0)
7992
8014
  return e;
7993
8015
  const r = new Set(
@@ -7995,30 +8017,30 @@ const pi = (e) => ({
7995
8017
  ), n = new Set(
7996
8018
  t.map((i) => V(i) ? i.key : void 0).filter((i) => typeof i == "string")
7997
8019
  );
7998
- return Et(e, (i) => {
8020
+ return wt(e, (i) => {
7999
8021
  const a = i.id, o = i.key;
8000
8022
  return typeof a == "string" && r.has(a) || typeof o == "string" && n.has(o) ? null : i;
8001
8023
  });
8002
- }, os = (e, t) => !Array.isArray(t) || t.length === 0 ? e : Et(e, (r) => {
8024
+ }, ps = (e, t) => !Array.isArray(t) || t.length === 0 ? e : wt(e, (r) => {
8003
8025
  const n = t.find((i) => V(i) ? i.id !== void 0 && i.id === r.id || i.key !== void 0 && i.key === r.key : !1);
8004
- return n ? bt(r, n) : r;
8005
- }), wt = (e) => {
8006
- const t = pn(e, "formJson");
8026
+ return n ? Et(r, n) : r;
8027
+ }), vt = (e) => {
8028
+ const t = ln(e, "formJson");
8007
8029
  if (!t)
8008
8030
  throw new Error("formJson must not be empty");
8009
8031
  return t;
8010
- }, ps = (e, t) => {
8011
- const r = pn(t, "changes");
8032
+ }, ls = (e, t) => {
8033
+ const r = ln(t, "changes");
8012
8034
  if (!r)
8013
8035
  throw new Error("changes must not be empty");
8014
- const { addComponents: n = [], removeComponents: i = [], components: a = [], ...o } = r, s = bt({ ...e }, o), p = Array.isArray(s.components) ? [...s.components] : [], l = ss(p, i), c = os(l, a), u = Array.isArray(n) && n.length > 0 ? [...c, ...n] : c;
8036
+ const { addComponents: n = [], removeComponents: i = [], components: a = [], ...o } = r, s = Et({ ...e }, o), p = Array.isArray(s.components) ? [...s.components] : [], l = os(p, i), c = ps(l, a), u = Array.isArray(n) && n.length > 0 ? [...c, ...n] : c;
8015
8037
  return { ...s, components: u };
8016
- }, ls = (e) => {
8038
+ }, cs = (e) => {
8017
8039
  const t = {}, r = [], n = { totalFields: 0, requiredFields: 0, optionalFields: 0 }, i = (a) => {
8018
8040
  Array.isArray(a) && a.forEach((o) => {
8019
8041
  if (!V(o))
8020
8042
  return;
8021
- const s = typeof o.type == "string" ? o.type : "default", p = as(o), l = typeof o.key == "string" ? o.key : p, c = o.validate, u = !!(V(c) && c.required || o.required);
8043
+ const s = typeof o.type == "string" ? o.type : "default", p = ss(o), l = typeof o.key == "string" ? o.key : p, c = o.validate, u = !!(V(c) && c.required || o.required);
8022
8044
  ot.has(s) || (n.totalFields += 1, u ? n.requiredFields += 1 : n.optionalFields += 1, t[s] = (t[s] ?? 0) + 1, r.push({
8023
8045
  key: l,
8024
8046
  type: s,
@@ -8036,7 +8058,7 @@ const pi = (e) => ({
8036
8058
  fieldsByType: t,
8037
8059
  fields: r
8038
8060
  };
8039
- }, ln = (e) => {
8061
+ }, cn = (e) => {
8040
8062
  const t = [], r = [], n = /* @__PURE__ */ new Set();
8041
8063
  if (!V(e))
8042
8064
  return { isValid: !1, errors: ["Form schema must be a JSON object"], warnings: r };
@@ -8053,7 +8075,7 @@ const pi = (e) => ({
8053
8075
  return;
8054
8076
  }
8055
8077
  const p = typeof s.type == "string" ? s.type : "default", l = s.id;
8056
- typeof l == "string" && (n.has(l) ? t.push(`Duplicate component id: ${l}`) : n.add(l)), is.has(p) || t.push(`Invalid field type "${p}"`);
8078
+ typeof l == "string" && (n.has(l) ? t.push(`Duplicate component id: ${l}`) : n.add(l)), as.has(p) || t.push(`Invalid field type "${p}"`);
8057
8079
  const c = s.key;
8058
8080
  if (!ot.has(p) && !c && t.push(`Input component of type "${p}" requires a "key" field`), !ot.has(p) && !s.label) {
8059
8081
  const u = typeof c == "string" && c || typeof l == "string" && l || p;
@@ -8068,7 +8090,7 @@ const pi = (e) => ({
8068
8090
  errors: t,
8069
8091
  warnings: r
8070
8092
  };
8071
- }, cs = (e) => ({
8093
+ }, us = (e) => ({
8072
8094
  name: "summarize_form_json",
8073
8095
  displayName: "Summarizing form schema",
8074
8096
  description: "Summarizes a Camunda Form JSON definition with field counts, required field distribution, and field details.",
@@ -8087,13 +8109,13 @@ const pi = (e) => ({
8087
8109
  requiredCapabilities: ["FORM_VIEWING"],
8088
8110
  handler: async (t, r) => {
8089
8111
  try {
8090
- const { formJson: n } = t ?? {}, i = n ? wt(n) : e.form.getSchema();
8091
- return ls(i);
8112
+ const { formJson: n } = t ?? {}, i = n ? vt(n) : e.form.getSchema();
8113
+ return cs(i);
8092
8114
  } catch (n) {
8093
8115
  throw r("summarize_form_json", n), new Error(`Failed to summarize form JSON: ${n.message}`);
8094
8116
  }
8095
8117
  }
8096
- }), us = (e) => ({
8118
+ }), ds = (e) => ({
8097
8119
  name: "update_form_json",
8098
8120
  displayName: "Updating form schema",
8099
8121
  description: "Updates a Camunda Form JSON definition with structured changes such as add, update, and remove operations.",
@@ -8117,7 +8139,7 @@ const pi = (e) => ({
8117
8139
  requiredCapabilities: ["FORM_EDITING"],
8118
8140
  handler: async (t, r) => {
8119
8141
  try {
8120
- const { formJson: n, changes: i } = t, a = n ? wt(n) : e.form.getSchema(), o = ps(a, i), s = ln(o);
8142
+ const { formJson: n, changes: i } = t, a = n ? vt(n) : e.form.getSchema(), o = ls(a, i), s = cn(o);
8121
8143
  return e.form.importSchema(o), await e.form.update(), {
8122
8144
  success: !0,
8123
8145
  message: "Form JSON updated successfully",
@@ -8130,7 +8152,7 @@ const pi = (e) => ({
8130
8152
  throw r("update_form_json", n), new Error(`Failed to update form JSON: ${n.message}`);
8131
8153
  }
8132
8154
  }
8133
- }), ds = (e) => ({
8155
+ }), ms = (e) => ({
8134
8156
  name: "validate_form_json",
8135
8157
  displayName: "Validating form schema",
8136
8158
  description: "Validates a Camunda Form JSON definition for structural correctness, required fields, and duplicate IDs.",
@@ -8149,18 +8171,18 @@ const pi = (e) => ({
8149
8171
  requiredCapabilities: ["VALIDATION", "FORM_VIEWING"],
8150
8172
  handler: async (t, r) => {
8151
8173
  try {
8152
- const { formJson: n } = t ?? {}, i = n ? wt(n) : e.form.getSchema();
8153
- return ln(i);
8174
+ const { formJson: n } = t ?? {}, i = n ? vt(n) : e.form.getSchema();
8175
+ return cn(i);
8154
8176
  } catch (n) {
8155
8177
  throw r("validate_form_json", n), new Error(`Failed to validate form JSON: ${n.message}`);
8156
8178
  }
8157
8179
  }
8158
- }), ms = (e) => {
8180
+ }), fs = (e) => {
8159
8181
  if (typeof e != "string")
8160
8182
  return "";
8161
8183
  const t = e.trim();
8162
8184
  return t.startsWith("=") ? t.slice(1).trim() : t;
8163
- }, fs = (e) => ({
8185
+ }, ys = (e) => ({
8164
8186
  name: "validate_feel_expression",
8165
8187
  displayName: "Validating FEEL expression",
8166
8188
  description: "Validates a FEEL expression for syntax correctness. Use this before applying FEEL expressions to BPMN or DMN elements.",
@@ -8180,7 +8202,7 @@ const pi = (e) => ({
8180
8202
  requiredCapabilities: ["VALIDATION"],
8181
8203
  handler: async (t, r) => {
8182
8204
  try {
8183
- const { feelExpression: n } = t, i = ms(n);
8205
+ const { feelExpression: n } = t, i = fs(n);
8184
8206
  if (!i)
8185
8207
  return {
8186
8208
  isValid: !1,
@@ -8204,59 +8226,59 @@ const pi = (e) => ({
8204
8226
  throw r("validate_feel_expression", n), new Error(`Failed to validate FEEL expression: ${n.message}`);
8205
8227
  }
8206
8228
  }
8207
- }), ys = (e) => [
8208
- pi(e),
8209
- ci(e),
8210
- di(e),
8229
+ }), gs = (e) => [
8230
+ li(e),
8231
+ ui(e),
8211
8232
  mi(e),
8212
- Ei(e),
8213
- vi(e),
8214
- Ri(e),
8215
- _i(e),
8216
- $i(e, tn),
8217
- ji(e),
8218
- Xi(e),
8233
+ fi(e),
8234
+ wi(e),
8235
+ Ii(e),
8236
+ Ai(e),
8237
+ Bi(e),
8238
+ qi(e, nn),
8239
+ Ui(e),
8219
8240
  Vi(e),
8220
8241
  zi(e),
8221
8242
  Hi(e),
8222
8243
  Wi(e),
8223
8244
  Ki(e),
8224
- ia(e),
8245
+ Ji(e),
8225
8246
  aa(e),
8226
8247
  sa(e),
8227
8248
  oa(e),
8228
- ua(e),
8249
+ pa(e),
8229
8250
  da(e),
8230
8251
  ma(e),
8231
8252
  fa(e),
8232
- ha(e),
8233
- va(e),
8253
+ ya(e),
8254
+ ba(e),
8255
+ Ia(e),
8234
8256
  Na(e),
8235
- xa(e),
8236
8257
  Ra(e),
8237
8258
  Aa(e),
8238
8259
  Ma(e),
8239
- Pa(e),
8260
+ Ca(e),
8240
8261
  _a(e),
8241
- Fa(e),
8242
- $a(e),
8262
+ Ba(e),
8263
+ ka(e),
8243
8264
  qa(e),
8244
- za(e),
8245
- Ja(e),
8265
+ La(e),
8266
+ Ha(e),
8246
8267
  Ya(e),
8247
8268
  Qa(e),
8248
8269
  Za(e),
8249
8270
  es(e),
8250
8271
  ts(e),
8251
- rs(e),
8252
- cs(e),
8272
+ ns(e),
8273
+ is(e),
8253
8274
  us(e),
8254
8275
  ds(e),
8255
- fs(e)
8256
- ], bs = (e, t) => {
8257
- for (const r of ys(e))
8276
+ ms(e),
8277
+ ys(e)
8278
+ ], Es = (e, t) => {
8279
+ for (const r of gs(e))
8258
8280
  t.registerTool(r);
8259
- }, Es = ({ getModeler: e, is: t, getBusinessObject: r }) => ({
8281
+ }, ws = ({ getModeler: e, is: t, getBusinessObject: r }) => ({
8260
8282
  getModeler: e,
8261
8283
  getCanvas: () => e().get("canvas"),
8262
8284
  getElementRegistry: () => e().get("elementRegistry"),
@@ -8274,7 +8296,7 @@ const pi = (e) => ({
8274
8296
  is: t,
8275
8297
  getBusinessObject: r,
8276
8298
  getBpmnRules: () => e().get("bpmnRules")
8277
- }), gs = /* @__PURE__ */ new Set(["external-resources/validate"]), hs = /* @__PURE__ */ new Set([
8299
+ }), hs = /* @__PURE__ */ new Set(["external-resources/validate"]), bs = /* @__PURE__ */ new Set([
8278
8300
  "superfluous-gateway",
8279
8301
  "fake-join",
8280
8302
  "no-implicit-split",
@@ -8285,21 +8307,21 @@ const pi = (e) => ({
8285
8307
  "no-gateway-join-fork",
8286
8308
  "end-event-required",
8287
8309
  "start-event-required"
8288
- ]), ws = (e) => e.filter((t) => !gs.has(t.rule)).map((t) => ({
8310
+ ]), vs = (e) => e.filter((t) => !hs.has(t.rule)).map((t) => ({
8289
8311
  elementId: t.id,
8290
8312
  elementName: t.name ?? "",
8291
8313
  message: t.message,
8292
- category: hs.has(t.rule) ? "error" : t.category,
8314
+ category: bs.has(t.rule) ? "error" : t.category,
8293
8315
  rule: t.rule,
8294
8316
  documentationUrl: t.meta?.documentation?.url
8295
8317
  }));
8296
8318
  export {
8297
- Si as E,
8298
- rn as L,
8299
- an as X,
8319
+ sn as G,
8320
+ bt as R,
8300
8321
  ws as a,
8301
- ys as e,
8302
- tn as l,
8303
- bs as o,
8304
- Es as s
8322
+ vs as d,
8323
+ nn as l,
8324
+ Es as s,
8325
+ gs as t,
8326
+ Oi as w
8305
8327
  };