@uxland/primary-shell 8.2.4 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/{component-DGPt9i3-.js → component-B2qHBVpK.js} +2 -2
  2. package/dist/{component-DGPt9i3-.js.map → component-B2qHBVpK.js.map} +1 -1
  3. package/dist/{index-C8RN2NKs.js → index-DVT-GJFF.js} +208 -265
  4. package/dist/index-DVT-GJFF.js.map +1 -0
  5. package/dist/index.js +18 -22
  6. package/dist/{plugin-MLG7cNJN.js → plugin-lcKeYuXk.js} +2 -2
  7. package/dist/{plugin-MLG7cNJN.js.map → plugin-lcKeYuXk.js.map} +1 -1
  8. package/dist/primary/shell/src/api/api.d.ts +15 -1
  9. package/dist/primary/shell/src/api/api.test.d.ts +1 -0
  10. package/dist/primary/shell/src/api/broker/factory.d.ts +11 -1
  11. package/dist/primary/shell/src/api/broker/primaria-broker.d.ts +0 -2
  12. package/dist/primary/shell/src/api/global-state/global-state.d.ts +0 -7
  13. package/dist/primary/shell/src/api/interaction-service/interaction-service-impl.d.ts +4 -0
  14. package/dist/primary/shell/src/api/interaction-service/interaction-service.d.ts +0 -1
  15. package/dist/primary/shell/src/api/quick-action-busy-manager/quick-action-busy-manager.d.ts +0 -2
  16. package/dist/primary/shell/src/api/region-manager/region-manager.d.ts +17 -2
  17. package/dist/primary/shell/src/api/token-manager/token-manager.d.ts +4 -12
  18. package/dist/primary/shell/src/bootstrapper.d.ts +12 -0
  19. package/dist/primary/shell/src/features/bootstrapper.d.ts +1 -1
  20. package/dist/primary/shell/src/handle-plugins.d.ts +7 -5
  21. package/dist/primary/shell/src/index.d.ts +4 -4
  22. package/package.json +1 -1
  23. package/src/UI/components/bootstrapper.ts +1 -4
  24. package/src/api/api.test.ts +37 -0
  25. package/src/api/api.ts +37 -6
  26. package/src/api/broker/factory.test.ts +12 -7
  27. package/src/api/broker/factory.ts +23 -12
  28. package/src/api/broker/primaria-broker.ts +0 -2
  29. package/src/api/ecap-event-manager/ecap-event-manager.test.ts +0 -1
  30. package/src/api/global-state/global-state.test.ts +0 -8
  31. package/src/api/global-state/global-state.ts +1 -12
  32. package/src/api/http-client/http-client.test.ts +1 -1
  33. package/src/api/interaction-service/interaction-service-impl.tsx +4 -0
  34. package/src/api/interaction-service/interaction-service.ts +0 -1
  35. package/src/api/quick-action-busy-manager/quick-action-busy-manager.test.ts +0 -8
  36. package/src/api/quick-action-busy-manager/quick-action-busy-manager.ts +0 -5
  37. package/src/api/region-manager/region-manager.test.ts +8 -8
  38. package/src/api/region-manager/region-manager.ts +24 -28
  39. package/src/api/region-manager/remove-view-idempotency.test.ts +1 -1
  40. package/src/api/token-manager/token-manager.ts +4 -13
  41. package/src/bootstrapper.ts +23 -2
  42. package/src/disposer.ts +5 -3
  43. package/src/features/bootstrapper.ts +4 -4
  44. package/src/features/exit/handler.test.ts +11 -7
  45. package/src/features/exit/handler.ts +2 -2
  46. package/src/handle-plugins.ts +16 -6
  47. package/src/index.ts +15 -6
  48. package/dist/index-C8RN2NKs.js.map +0 -1
  49. package/dist/primary/shell/src/UI/components/poc-events-ecap/poc-events-ecap.d.ts +0 -8
  50. package/src/UI/components/poc-events-ecap/poc-events-ecap.ts +0 -71
@@ -1937,13 +1937,13 @@ const U$3 = (X, W) => {
1937
1937
  }
1938
1938
  return [N$1(X, ne + (X[J] || "<?>") + (W === 2 ? "</svg>" : W === 3 ? "</math>" : "")), re];
1939
1939
  };
1940
- let B$3 = class _s {
1940
+ let B$3 = class ys {
1941
1941
  constructor({ strings: W, _$litType$: J }, re) {
1942
1942
  let te;
1943
1943
  this.parts = [];
1944
1944
  let ne = 0, oe = 0;
1945
1945
  const ce = W.length - 1, ue = this.parts, [he, de] = U$3(W, J);
1946
- if (this.el = _s.createElement(he, re), I$4.currentNode = this.el.content, J === 2 || J === 3) {
1946
+ if (this.el = ys.createElement(he, re), I$4.currentNode = this.el.content, J === 2 || J === 3) {
1947
1947
  const fe = this.el.content.firstChild;
1948
1948
  fe.replaceWith(...fe.childNodes);
1949
1949
  }
@@ -2007,7 +2007,7 @@ let F$4 = class {
2007
2007
  let J = 0;
2008
2008
  for (const re of this._$AV) re !== void 0 && (re.strings !== void 0 ? (re._$AI(W, re, J), J += re.strings.length - 2) : re._$AI(W[J])), J++;
2009
2009
  }
2010
- }, et$1 = class $s {
2010
+ }, et$1 = class _s {
2011
2011
  get _$AU() {
2012
2012
  return this._$AM?._$AU ?? this.v;
2013
2013
  }
@@ -2053,7 +2053,7 @@ let F$4 = class {
2053
2053
  g$u(this._$AH) || (this._$AH = [], this._$AR());
2054
2054
  const J = this._$AH;
2055
2055
  let re, te = 0;
2056
- for (const ne of W) te === J.length ? J.push(re = new $s(this.O(lt$1()), this.O(lt$1()), this, this.options)) : re = J[te], re._$AI(ne), te++;
2056
+ for (const ne of W) te === J.length ? J.push(re = new _s(this.O(lt$1()), this.O(lt$1()), this, this.options)) : re = J[te], re._$AI(ne), te++;
2057
2057
  te < J.length && (this._$AR(re && re._$AB.nextSibling, te), J.length = te);
2058
2058
  }
2059
2059
  _$AR(W = this._$AA.nextSibling, J) {
@@ -2252,7 +2252,7 @@ let R$4 = class {
2252
2252
  }
2253
2253
  };
2254
2254
  const r$V = new R$4();
2255
- let g$t = class ws {
2255
+ let g$t = class $s {
2256
2256
  constructor() {
2257
2257
  this._regions = {};
2258
2258
  }
@@ -2280,7 +2280,7 @@ let g$t = class ws {
2280
2280
  return Object.keys(this._regions).forEach((W) => this.remove(W, !0)), this._regions = {}, this;
2281
2281
  }
2282
2282
  createRegionManager() {
2283
- return new ws();
2283
+ return new $s();
2284
2284
  }
2285
2285
  }, w$7 = class extends g$t {
2286
2286
  clear() {
@@ -2476,7 +2476,7 @@ let c$s = class {
2476
2476
  clear() {
2477
2477
  this.viewsByRegion = {};
2478
2478
  }
2479
- }, g$s = class xs {
2479
+ }, g$s = class ws {
2480
2480
  constructor(W) {
2481
2481
  this._viewRegistry = W, this._regions = {};
2482
2482
  }
@@ -2543,7 +2543,7 @@ let c$s = class {
2543
2543
  return await this.clear(), Object.values(this._viewRegistry.regions).forEach((W) => this.remove(W[0])), this._regions = {}, this;
2544
2544
  }
2545
2545
  createRegionManager() {
2546
- return new xs(this._viewRegistry);
2546
+ return new ws(this._viewRegistry);
2547
2547
  }
2548
2548
  }, w$5 = class extends g$s {
2549
2549
  constructor(W) {
@@ -4564,8 +4564,8 @@ const REQUEST_DIAGNOSTICS_SELECTOR = "request_diagnostics_selector", CIPDS_SELEC
4564
4564
  ...PLUGIN_BROKER_REQUESTS
4565
4565
  };
4566
4566
  class Broker {
4567
- constructor() {
4568
- this.events = BROKER_EVENTS, this.requests = BROKER_REQUESTS, this.requestHandlers = /* @__PURE__ */ new Map(), this.eventSubscribers = /* @__PURE__ */ new Map();
4567
+ constructor(W, J) {
4568
+ this.requestHandlers = W, this.eventSubscribers = J, this.events = BROKER_EVENTS, this.requests = BROKER_REQUESTS;
4569
4569
  }
4570
4570
  async send(W, J) {
4571
4571
  const re = typeof W == "string" ? W : W.constructor, te = this.requestHandlers.get(re);
@@ -4610,16 +4610,16 @@ class Broker {
4610
4610
  }
4611
4611
  };
4612
4612
  }
4613
- // ---- Lifecycle ------------------------------------------------------------
4614
- /**
4615
- * Removes every registration. Used on shell teardown so a re-initialization
4616
- * starts from a clean registry (the broker is a module-level singleton).
4617
- */
4618
- _clear() {
4619
- this.requestHandlers.clear(), this.eventSubscribers.clear();
4620
- }
4621
4613
  }
4622
- const createBroker = () => new Broker(), EVENTS_WITH_DIAGNOSTICS = [
4614
+ const createBroker = () => {
4615
+ const X = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map();
4616
+ return {
4617
+ broker: new Broker(X, W),
4618
+ clear: () => {
4619
+ X.clear(), W.clear();
4620
+ }
4621
+ };
4622
+ }, EVENTS_WITH_DIAGNOSTICS = [
4623
4623
  "PROVES_ORDRES_CLINIQUES_CONSULTAR",
4624
4624
  "RESULT_OC",
4625
4625
  "LABORATORI_SEROTECA_PETICIO_CONSULTA",
@@ -4697,14 +4697,6 @@ class PrimariaGlobalStateManagerImpl {
4697
4697
  getData(W) {
4698
4698
  return this.state[W];
4699
4699
  }
4700
- /**
4701
- * Clears all data stored in the state object.
4702
- *
4703
- * @return {void} This function does not return anything.
4704
- */
4705
- clearData() {
4706
- this.state = {};
4707
- }
4708
4700
  }
4709
4701
  const createGlobalStateManager = (X) => new PrimariaGlobalStateManagerImpl(X), ACTIVITY_EVENTS = ["keydown", "click", "scroll"];
4710
4702
  class ActivityMonitorImpl {
@@ -6277,7 +6269,7 @@ utils$1.forEach(["post", "put", "patch"], function(W) {
6277
6269
  }
6278
6270
  Axios$1.prototype[W] = J(), Axios$1.prototype[W + "Form"] = J(!0);
6279
6271
  });
6280
- let CancelToken$1 = class ks {
6272
+ let CancelToken$1 = class xs {
6281
6273
  constructor(W) {
6282
6274
  if (typeof W != "function")
6283
6275
  throw new TypeError("executor must be a function.");
@@ -6343,7 +6335,7 @@ let CancelToken$1 = class ks {
6343
6335
  static source() {
6344
6336
  let W;
6345
6337
  return {
6346
- token: new ks(function(te) {
6338
+ token: new xs(function(te) {
6347
6339
  W = te;
6348
6340
  }),
6349
6341
  cancel: W
@@ -6857,6 +6849,10 @@ class PrimariaInteractionServiceImpl extends PrimariaInteractionService {
6857
6849
  confirmMessage(W, J) {
6858
6850
  return this.confirm(W, { component: ConfirmationMessage }, J);
6859
6851
  }
6852
+ /**
6853
+ * Tanca tots els diàlegs oberts, siguin del plugin que siguin. Host-only: no és al tipus
6854
+ * `PrimariaInteractionService`, i els plugins reben una vista que no el porta.
6855
+ */
6860
6856
  dispose() {
6861
6857
  for (const W of [...this.openDialogCancellers])
6862
6858
  W();
@@ -7125,7 +7121,7 @@ var __extends$1 = /* @__PURE__ */ (function() {
7125
7121
  );
7126
7122
  function peg$parse(X, W) {
7127
7123
  W = W !== void 0 ? W : {};
7128
- var J = {}, re = { start: ns }, te = ns, ne = function(Ce) {
7124
+ var J = {}, re = { start: rs }, te = rs, ne = function(Ce) {
7129
7125
  return Ce.join("");
7130
7126
  }, oe = function(Ce) {
7131
7127
  return __assign$2({ type: TYPE.literal, value: Ce }, _i());
@@ -7133,7 +7129,7 @@ function peg$parse(X, W) {
7133
7129
  return __assign$2({ type: TYPE.pound }, _i());
7134
7130
  }, de = mi("argumentElement"), fe = "{", pe = ci("{", !1), ge = "}", me = ci("}", !1), be = function(Ce) {
7135
7131
  return __assign$2({ type: TYPE.argument, value: Ce }, _i());
7136
- }, ye = mi("numberSkeletonId"), ve = /^['\/{}]/, we = wi(["'", "/", "{", "}"], !1, !1), Ae = Ls(), _e = mi("numberSkeletonTokenOption"), Se = "/", Fe = ci("/", !1), Le = function(Ce) {
7132
+ }, ye = mi("numberSkeletonId"), ve = /^['\/{}]/, we = wi(["'", "/", "{", "}"], !1, !1), Ae = qs(), _e = mi("numberSkeletonTokenOption"), Se = "/", Fe = ci("/", !1), Le = function(Ce) {
7137
7133
  return Ce;
7138
7134
  }, Pe = mi("numberSkeletonToken"), Ve = function(Ce, je) {
7139
7135
  return { stem: Ce, options: je };
@@ -7154,7 +7150,7 @@ function peg$parse(X, W) {
7154
7150
  }, At = "date", It = ci("date", !1), Ft = "time", Vt = ci("time", !1), Ht = "plural", di = ci("plural", !1), ei = "selectordinal", bt = ci("selectordinal", !1), vt = "offset:", St = ci("offset:", !1), Et = function(Ce, je, Qe, mt) {
7155
7151
  return __assign$2({ type: TYPE.plural, pluralType: je === "plural" ? "cardinal" : "ordinal", value: Ce, offset: Qe ? Qe[2] : 0, options: mt.reduce(function(xt, Mt) {
7156
7152
  var ti = Mt.id, Bt = Mt.value, gi = Mt.location;
7157
- return ti in xt && ss('Duplicate option "' + ti + '" in plural element: "' + is() + '"', Li()), xt[ti] = {
7153
+ return ti in xt && is('Duplicate option "' + ti + '" in plural element: "' + ts() + '"', Li()), xt[ti] = {
7158
7154
  value: Bt,
7159
7155
  location: gi
7160
7156
  }, xt;
@@ -7162,7 +7158,7 @@ function peg$parse(X, W) {
7162
7158
  }, wt = "select", Pt = ci("select", !1), Nt = function(Ce, je) {
7163
7159
  return __assign$2({ type: TYPE.select, value: Ce, options: je.reduce(function(Qe, mt) {
7164
7160
  var xt = mt.id, Mt = mt.value, ti = mt.location;
7165
- return xt in Qe && ss('Duplicate option "' + xt + '" in select element: "' + is() + '"', Li()), Qe[xt] = {
7161
+ return xt in Qe && is('Duplicate option "' + xt + '" in select element: "' + ts() + '"', Li()), Qe[xt] = {
7166
7162
  value: Mt,
7167
7163
  location: ti
7168
7164
  }, Qe;
@@ -7188,29 +7184,29 @@ function peg$parse(X, W) {
7188
7184
  }, oi = function(Ce, je) {
7189
7185
  return Ce + je.replace("''", "'");
7190
7186
  }, fi = function(Ce) {
7191
- return Ce !== "{" && !(ys() && Ce === "#") && !(Js() && Ce === "}");
7187
+ return Ce !== "{" && !(vs() && Ce === "#") && !(Xs() && Ce === "}");
7192
7188
  }, Ci = `
7193
7189
  `, Di = ci(`
7194
7190
  `, !1), Ri = function(Ce) {
7195
- return Ce === "{" || Ce === "}" || ys() && Ce === "#";
7196
- }, As = mi("argNameOrNumber"), Ss = mi("argNumber"), Cs = "0", Es = ci("0", !1), Ts = function() {
7191
+ return Ce === "{" || Ce === "}" || vs() && Ce === "#";
7192
+ }, ks = mi("argNameOrNumber"), As = mi("argNumber"), Ss = "0", Cs = ci("0", !1), Es = function() {
7197
7193
  return 0;
7198
- }, Os = /^[1-9]/, Ds = wi([["1", "9"]], !1, !1), es = /^[0-9]/, ts = wi([["0", "9"]], !1, !1), Rs = function(Ce) {
7194
+ }, Ts = /^[1-9]/, Os = wi([["1", "9"]], !1, !1), Qi = /^[0-9]/, es = wi([["0", "9"]], !1, !1), Ds = function(Ce) {
7199
7195
  return parseInt(Ce.join(""), 10);
7200
- }, qs = mi("argName"), Ne = 0, Gt = 0, Ei = [{ line: 1, column: 1 }], vi = 0, qi = [], _t = 0, Ti;
7196
+ }, Rs = mi("argName"), Ne = 0, Gt = 0, Ei = [{ line: 1, column: 1 }], vi = 0, qi = [], _t = 0, Ti;
7201
7197
  if (W.startRule !== void 0) {
7202
7198
  if (!(W.startRule in re))
7203
7199
  throw new Error(`Can't start parsing from rule "` + W.startRule + '".');
7204
7200
  te = re[W.startRule];
7205
7201
  }
7206
- function is() {
7202
+ function ts() {
7207
7203
  return X.substring(Gt, Ne);
7208
7204
  }
7209
7205
  function Li() {
7210
7206
  return Oi(Gt, Ne);
7211
7207
  }
7212
- function ss(Ce, je) {
7213
- throw je = je !== void 0 ? je : Oi(Gt, Ne), Fs(Ce, je);
7208
+ function is(Ce, je) {
7209
+ throw je = je !== void 0 ? je : Oi(Gt, Ne), Is(Ce, je);
7214
7210
  }
7215
7211
  function ci(Ce, je) {
7216
7212
  return { type: "literal", text: Ce, ignoreCase: je };
@@ -7218,16 +7214,16 @@ function peg$parse(X, W) {
7218
7214
  function wi(Ce, je, Qe) {
7219
7215
  return { type: "class", parts: Ce, inverted: je, ignoreCase: Qe };
7220
7216
  }
7221
- function Ls() {
7217
+ function qs() {
7222
7218
  return { type: "any" };
7223
7219
  }
7224
- function Is() {
7220
+ function Ls() {
7225
7221
  return { type: "end" };
7226
7222
  }
7227
7223
  function mi(Ce) {
7228
7224
  return { type: "other", description: Ce };
7229
7225
  }
7230
- function rs(Ce) {
7226
+ function ss(Ce) {
7231
7227
  var je = Ei[Ce], Qe;
7232
7228
  if (je)
7233
7229
  return je;
@@ -7241,7 +7237,7 @@ function peg$parse(X, W) {
7241
7237
  return Ei[Ce] = je, je;
7242
7238
  }
7243
7239
  function Oi(Ce, je) {
7244
- var Qe = rs(Ce), mt = rs(je);
7240
+ var Qe = ss(Ce), mt = ss(je);
7245
7241
  return {
7246
7242
  start: {
7247
7243
  offset: Ce,
@@ -7258,48 +7254,48 @@ function peg$parse(X, W) {
7258
7254
  function Ct(Ce) {
7259
7255
  Ne < vi || (Ne > vi && (vi = Ne, qi = []), qi.push(Ce));
7260
7256
  }
7261
- function Fs(Ce, je) {
7257
+ function Is(Ce, je) {
7262
7258
  return new SyntaxError(Ce, [], "", je);
7263
7259
  }
7264
- function Ms(Ce, je, Qe) {
7260
+ function Fs(Ce, je, Qe) {
7265
7261
  return new SyntaxError(SyntaxError.buildMessage(Ce, je), Ce, je, Qe);
7266
7262
  }
7267
- function ns() {
7263
+ function rs() {
7268
7264
  var Ce;
7269
7265
  return Ce = Ii(), Ce;
7270
7266
  }
7271
7267
  function Ii() {
7272
7268
  var Ce, je;
7273
- for (Ce = [], je = os(); je !== J; )
7274
- Ce.push(je), je = os();
7269
+ for (Ce = [], je = ns(); je !== J; )
7270
+ Ce.push(je), je = ns();
7275
7271
  return Ce;
7276
7272
  }
7277
- function os() {
7273
+ function ns() {
7278
7274
  var Ce;
7279
- return Ce = Ps(), Ce === J && (Ce = zs(), Ce === J && (Ce = Ks(), Ce === J && (Ce = Gs(), Ce === J && (Ce = Zs(), Ce === J && (Ce = Ns()))))), Ce;
7275
+ return Ce = Ms(), Ce === J && (Ce = Ns(), Ce === J && (Ce = Ws(), Ce === J && (Ce = Ks(), Ce === J && (Ce = Gs(), Ce === J && (Ce = Ps()))))), Ce;
7280
7276
  }
7281
7277
  function Fi() {
7282
7278
  var Ce, je, Qe;
7283
- if (Ce = Ne, je = [], Qe = ki(), Qe === J && (Qe = ms(), Qe === J && (Qe = bs())), Qe !== J)
7279
+ if (Ce = Ne, je = [], Qe = ki(), Qe === J && (Qe = gs(), Qe === J && (Qe = ms())), Qe !== J)
7284
7280
  for (; Qe !== J; )
7285
- je.push(Qe), Qe = ki(), Qe === J && (Qe = ms(), Qe === J && (Qe = bs()));
7281
+ je.push(Qe), Qe = ki(), Qe === J && (Qe = gs(), Qe === J && (Qe = ms()));
7286
7282
  else
7287
7283
  je = J;
7288
7284
  return je !== J && (Gt = Ce, je = ne(je)), Ce = je, Ce;
7289
7285
  }
7290
- function Ps() {
7286
+ function Ms() {
7291
7287
  var Ce, je;
7292
7288
  return Ce = Ne, je = Fi(), je !== J && (Gt = Ce, je = oe(je)), Ce = je, Ce;
7293
7289
  }
7294
- function Ns() {
7290
+ function Ps() {
7295
7291
  var Ce, je;
7296
7292
  return Ce = Ne, X.charCodeAt(Ne) === 35 ? (je = ce, Ne++) : (je = J, _t === 0 && Ct(ue)), je !== J && (Gt = Ce, je = he()), Ce = je, Ce;
7297
7293
  }
7298
- function zs() {
7294
+ function Ns() {
7299
7295
  var Ce, je, Qe, mt, xt, Mt;
7300
7296
  return _t++, Ce = Ne, X.charCodeAt(Ne) === 123 ? (je = fe, Ne++) : (je = J, _t === 0 && Ct(pe)), je !== J ? (Qe = Wt(), Qe !== J ? (mt = Si(), mt !== J ? (xt = Wt(), xt !== J ? (X.charCodeAt(Ne) === 125 ? (Mt = ge, Ne++) : (Mt = J, _t === 0 && Ct(me)), Mt !== J ? (Gt = Ce, je = be(mt), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), _t--, Ce === J && (je = J, _t === 0 && Ct(de)), Ce;
7301
7297
  }
7302
- function as() {
7298
+ function os() {
7303
7299
  var Ce, je, Qe, mt, xt;
7304
7300
  if (_t++, Ce = Ne, je = [], Qe = Ne, mt = Ne, _t++, xt = xi(), xt === J && (ve.test(X.charAt(Ne)) ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(we))), _t--, xt === J ? mt = void 0 : (Ne = mt, mt = J), mt !== J ? (X.length > Ne ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(Ae)), xt !== J ? (mt = [mt, xt], Qe = mt) : (Ne = Qe, Qe = J)) : (Ne = Qe, Qe = J), Qe !== J)
7305
7301
  for (; Qe !== J; )
@@ -7308,16 +7304,16 @@ function peg$parse(X, W) {
7308
7304
  je = J;
7309
7305
  return je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, _t--, Ce === J && (je = J, _t === 0 && Ct(ye)), Ce;
7310
7306
  }
7311
- function ls() {
7307
+ function as() {
7312
7308
  var Ce, je, Qe;
7313
- return _t++, Ce = Ne, X.charCodeAt(Ne) === 47 ? (je = Se, Ne++) : (je = J, _t === 0 && Ct(Fe)), je !== J ? (Qe = as(), Qe !== J ? (Gt = Ce, je = Le(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), _t--, Ce === J && (je = J, _t === 0 && Ct(_e)), Ce;
7309
+ return _t++, Ce = Ne, X.charCodeAt(Ne) === 47 ? (je = Se, Ne++) : (je = J, _t === 0 && Ct(Fe)), je !== J ? (Qe = os(), Qe !== J ? (Gt = Ce, je = Le(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), _t--, Ce === J && (je = J, _t === 0 && Ct(_e)), Ce;
7314
7310
  }
7315
- function ds() {
7311
+ function ls() {
7316
7312
  var Ce, je, Qe, mt, xt;
7317
7313
  if (_t++, Ce = Ne, je = Wt(), je !== J)
7318
- if (Qe = as(), Qe !== J) {
7319
- for (mt = [], xt = ls(); xt !== J; )
7320
- mt.push(xt), xt = ls();
7314
+ if (Qe = os(), Qe !== J) {
7315
+ for (mt = [], xt = as(); xt !== J; )
7316
+ mt.push(xt), xt = as();
7321
7317
  mt !== J ? (Gt = Ce, je = Ve(Qe, mt), Ce = je) : (Ne = Ce, Ce = J);
7322
7318
  } else
7323
7319
  Ne = Ce, Ce = J;
@@ -7325,24 +7321,24 @@ function peg$parse(X, W) {
7325
7321
  Ne = Ce, Ce = J;
7326
7322
  return _t--, Ce === J && (je = J, _t === 0 && Ct(Pe)), Ce;
7327
7323
  }
7328
- function Vs() {
7324
+ function zs() {
7329
7325
  var Ce, je, Qe;
7330
- if (Ce = Ne, je = [], Qe = ds(), Qe !== J)
7326
+ if (Ce = Ne, je = [], Qe = ls(), Qe !== J)
7331
7327
  for (; Qe !== J; )
7332
- je.push(Qe), Qe = ds();
7328
+ je.push(Qe), Qe = ls();
7333
7329
  else
7334
7330
  je = J;
7335
7331
  return je !== J && (Gt = Ce, je = qe(je)), Ce = je, Ce;
7336
7332
  }
7337
- function Us() {
7333
+ function Vs() {
7338
7334
  var Ce, je, Qe;
7339
- return Ce = Ne, X.substr(Ne, 2) === Oe ? (je = Oe, Ne += 2) : (je = J, _t === 0 && Ct(De)), je !== J ? (Qe = Vs(), Qe !== J ? (Gt = Ce, je = Ie(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce === J && (Ce = Ne, Gt = Ne, je = ze(), je ? je = void 0 : je = J, je !== J ? (Qe = Fi(), Qe !== J ? (Gt = Ce, je = We(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)), Ce;
7335
+ return Ce = Ne, X.substr(Ne, 2) === Oe ? (je = Oe, Ne += 2) : (je = J, _t === 0 && Ct(De)), je !== J ? (Qe = zs(), Qe !== J ? (Gt = Ce, je = Ie(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce === J && (Ce = Ne, Gt = Ne, je = ze(), je ? je = void 0 : je = J, je !== J ? (Qe = Fi(), Qe !== J ? (Gt = Ce, je = We(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)), Ce;
7340
7336
  }
7341
- function js() {
7337
+ function Us() {
7342
7338
  var Ce, je, Qe, mt, xt, Mt, ti, Bt, gi, Kt, ai, Zt, ri;
7343
- return Ce = Ne, X.charCodeAt(Ne) === 123 ? (je = fe, Ne++) : (je = J, _t === 0 && Ct(pe)), je !== J ? (Qe = Wt(), Qe !== J ? (mt = Si(), mt !== J ? (xt = Wt(), xt !== J ? (X.charCodeAt(Ne) === 44 ? (Mt = Ke, Ne++) : (Mt = J, _t === 0 && Ct(Ze)), Mt !== J ? (ti = Wt(), ti !== J ? (X.substr(Ne, 6) === nt ? (Bt = nt, Ne += 6) : (Bt = J, _t === 0 && Ct(Xe)), Bt !== J ? (gi = Wt(), gi !== J ? (Kt = Ne, X.charCodeAt(Ne) === 44 ? (ai = Ke, Ne++) : (ai = J, _t === 0 && Ct(Ze)), ai !== J ? (Zt = Wt(), Zt !== J ? (ri = Us(), ri !== J ? (ai = [ai, Zt, ri], Kt = ai) : (Ne = Kt, Kt = J)) : (Ne = Kt, Kt = J)) : (Ne = Kt, Kt = J), Kt === J && (Kt = null), Kt !== J ? (ai = Wt(), ai !== J ? (X.charCodeAt(Ne) === 125 ? (Zt = ge, Ne++) : (Zt = J, _t === 0 && Ct(me)), Zt !== J ? (Gt = Ce, je = Ge(mt, Bt, Kt), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce;
7339
+ return Ce = Ne, X.charCodeAt(Ne) === 123 ? (je = fe, Ne++) : (je = J, _t === 0 && Ct(pe)), je !== J ? (Qe = Wt(), Qe !== J ? (mt = Si(), mt !== J ? (xt = Wt(), xt !== J ? (X.charCodeAt(Ne) === 44 ? (Mt = Ke, Ne++) : (Mt = J, _t === 0 && Ct(Ze)), Mt !== J ? (ti = Wt(), ti !== J ? (X.substr(Ne, 6) === nt ? (Bt = nt, Ne += 6) : (Bt = J, _t === 0 && Ct(Xe)), Bt !== J ? (gi = Wt(), gi !== J ? (Kt = Ne, X.charCodeAt(Ne) === 44 ? (ai = Ke, Ne++) : (ai = J, _t === 0 && Ct(Ze)), ai !== J ? (Zt = Wt(), Zt !== J ? (ri = Vs(), ri !== J ? (ai = [ai, Zt, ri], Kt = ai) : (Ne = Kt, Kt = J)) : (Ne = Kt, Kt = J)) : (Ne = Kt, Kt = J), Kt === J && (Kt = null), Kt !== J ? (ai = Wt(), ai !== J ? (X.charCodeAt(Ne) === 125 ? (Zt = ge, Ne++) : (Zt = J, _t === 0 && Ct(me)), Zt !== J ? (Gt = Ce, je = Ge(mt, Bt, Kt), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce;
7344
7340
  }
7345
- function cs() {
7341
+ function ds() {
7346
7342
  var Ce, je, Qe, mt;
7347
7343
  if (Ce = Ne, X.charCodeAt(Ne) === 39 ? (je = Me, Ne++) : (je = J, _t === 0 && Ct(Be)), je !== J) {
7348
7344
  if (Qe = [], mt = ki(), mt === J && (Ue.test(X.charAt(Ne)) ? (mt = X.charAt(Ne), Ne++) : (mt = J, _t === 0 && Ct(Je))), mt !== J)
@@ -7361,7 +7357,7 @@ function peg$parse(X, W) {
7361
7357
  Ce = J;
7362
7358
  return Ce;
7363
7359
  }
7364
- function us() {
7360
+ function cs() {
7365
7361
  var Ce, je;
7366
7362
  if (Ce = [], Ye.test(X.charAt(Ne)) ? (je = X.charAt(Ne), Ne++) : (je = J, _t === 0 && Ct(ot)), je !== J)
7367
7363
  for (; je !== J; )
@@ -7370,28 +7366,28 @@ function peg$parse(X, W) {
7370
7366
  Ce = J;
7371
7367
  return Ce;
7372
7368
  }
7373
- function Hs() {
7369
+ function js() {
7374
7370
  var Ce, je, Qe, mt;
7375
- if (Ce = Ne, je = Ne, Qe = [], mt = cs(), mt === J && (mt = us()), mt !== J)
7371
+ if (Ce = Ne, je = Ne, Qe = [], mt = ds(), mt === J && (mt = cs()), mt !== J)
7376
7372
  for (; mt !== J; )
7377
- Qe.push(mt), mt = cs(), mt === J && (mt = us());
7373
+ Qe.push(mt), mt = ds(), mt === J && (mt = cs());
7378
7374
  else
7379
7375
  Qe = J;
7380
7376
  return Qe !== J ? je = X.substring(je, Ne) : je = Qe, je !== J && (Gt = Ce, je = ft(je)), Ce = je, Ce;
7381
7377
  }
7382
- function Bs() {
7378
+ function Hs() {
7383
7379
  var Ce, je, Qe;
7384
- return Ce = Ne, X.substr(Ne, 2) === Oe ? (je = Oe, Ne += 2) : (je = J, _t === 0 && Ct(De)), je !== J ? (Qe = Hs(), Qe !== J ? (Gt = Ce, je = Ie(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce === J && (Ce = Ne, Gt = Ne, je = $t(), je ? je = void 0 : je = J, je !== J ? (Qe = Fi(), Qe !== J ? (Gt = Ce, je = We(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)), Ce;
7380
+ return Ce = Ne, X.substr(Ne, 2) === Oe ? (je = Oe, Ne += 2) : (je = J, _t === 0 && Ct(De)), je !== J ? (Qe = js(), Qe !== J ? (Gt = Ce, je = Ie(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce === J && (Ce = Ne, Gt = Ne, je = $t(), je ? je = void 0 : je = J, je !== J ? (Qe = Fi(), Qe !== J ? (Gt = Ce, je = We(Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)), Ce;
7385
7381
  }
7386
- function Ws() {
7382
+ function Bs() {
7387
7383
  var Ce, je, Qe, mt, xt, Mt, ti, Bt, gi, Kt, ai, Zt, ri;
7388
- return Ce = Ne, X.charCodeAt(Ne) === 123 ? (je = fe, Ne++) : (je = J, _t === 0 && Ct(pe)), je !== J ? (Qe = Wt(), Qe !== J ? (mt = Si(), mt !== J ? (xt = Wt(), xt !== J ? (X.charCodeAt(Ne) === 44 ? (Mt = Ke, Ne++) : (Mt = J, _t === 0 && Ct(Ze)), Mt !== J ? (ti = Wt(), ti !== J ? (X.substr(Ne, 4) === At ? (Bt = At, Ne += 4) : (Bt = J, _t === 0 && Ct(It)), Bt === J && (X.substr(Ne, 4) === Ft ? (Bt = Ft, Ne += 4) : (Bt = J, _t === 0 && Ct(Vt))), Bt !== J ? (gi = Wt(), gi !== J ? (Kt = Ne, X.charCodeAt(Ne) === 44 ? (ai = Ke, Ne++) : (ai = J, _t === 0 && Ct(Ze)), ai !== J ? (Zt = Wt(), Zt !== J ? (ri = Bs(), ri !== J ? (ai = [ai, Zt, ri], Kt = ai) : (Ne = Kt, Kt = J)) : (Ne = Kt, Kt = J)) : (Ne = Kt, Kt = J), Kt === J && (Kt = null), Kt !== J ? (ai = Wt(), ai !== J ? (X.charCodeAt(Ne) === 125 ? (Zt = ge, Ne++) : (Zt = J, _t === 0 && Ct(me)), Zt !== J ? (Gt = Ce, je = Ge(mt, Bt, Kt), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce;
7384
+ return Ce = Ne, X.charCodeAt(Ne) === 123 ? (je = fe, Ne++) : (je = J, _t === 0 && Ct(pe)), je !== J ? (Qe = Wt(), Qe !== J ? (mt = Si(), mt !== J ? (xt = Wt(), xt !== J ? (X.charCodeAt(Ne) === 44 ? (Mt = Ke, Ne++) : (Mt = J, _t === 0 && Ct(Ze)), Mt !== J ? (ti = Wt(), ti !== J ? (X.substr(Ne, 4) === At ? (Bt = At, Ne += 4) : (Bt = J, _t === 0 && Ct(It)), Bt === J && (X.substr(Ne, 4) === Ft ? (Bt = Ft, Ne += 4) : (Bt = J, _t === 0 && Ct(Vt))), Bt !== J ? (gi = Wt(), gi !== J ? (Kt = Ne, X.charCodeAt(Ne) === 44 ? (ai = Ke, Ne++) : (ai = J, _t === 0 && Ct(Ze)), ai !== J ? (Zt = Wt(), Zt !== J ? (ri = Hs(), ri !== J ? (ai = [ai, Zt, ri], Kt = ai) : (Ne = Kt, Kt = J)) : (Ne = Kt, Kt = J)) : (Ne = Kt, Kt = J), Kt === J && (Kt = null), Kt !== J ? (ai = Wt(), ai !== J ? (X.charCodeAt(Ne) === 125 ? (Zt = ge, Ne++) : (Zt = J, _t === 0 && Ct(me)), Zt !== J ? (Gt = Ce, je = Ge(mt, Bt, Kt), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce;
7389
7385
  }
7390
- function Ks() {
7386
+ function Ws() {
7391
7387
  var Ce;
7392
- return Ce = js(), Ce === J && (Ce = Ws()), Ce;
7388
+ return Ce = Us(), Ce === J && (Ce = Bs()), Ce;
7393
7389
  }
7394
- function Gs() {
7390
+ function Ks() {
7395
7391
  var Ce, je, Qe, mt, xt, Mt, ti, Bt, gi, Kt, ai, Zt, ri, bi, $i, Pi;
7396
7392
  if (Ce = Ne, X.charCodeAt(Ne) === 123 ? (je = fe, Ne++) : (je = J, _t === 0 && Ct(pe)), je !== J)
7397
7393
  if (Qe = Wt(), Qe !== J)
@@ -7403,11 +7399,11 @@ function peg$parse(X, W) {
7403
7399
  if (gi = Wt(), gi !== J)
7404
7400
  if (X.charCodeAt(Ne) === 44 ? (Kt = Ke, Ne++) : (Kt = J, _t === 0 && Ct(Ze)), Kt !== J)
7405
7401
  if (ai = Wt(), ai !== J)
7406
- if (Zt = Ne, X.substr(Ne, 7) === vt ? (ri = vt, Ne += 7) : (ri = J, _t === 0 && Ct(St)), ri !== J ? (bi = Wt(), bi !== J ? ($i = gs(), $i !== J ? (ri = [ri, bi, $i], Zt = ri) : (Ne = Zt, Zt = J)) : (Ne = Zt, Zt = J)) : (Ne = Zt, Zt = J), Zt === J && (Zt = null), Zt !== J)
7402
+ if (Zt = Ne, X.substr(Ne, 7) === vt ? (ri = vt, Ne += 7) : (ri = J, _t === 0 && Ct(St)), ri !== J ? (bi = Wt(), bi !== J ? ($i = fs(), $i !== J ? (ri = [ri, bi, $i], Zt = ri) : (Ne = Zt, Zt = J)) : (Ne = Zt, Zt = J)) : (Ne = Zt, Zt = J), Zt === J && (Zt = null), Zt !== J)
7407
7403
  if (ri = Wt(), ri !== J) {
7408
- if (bi = [], $i = ps(), $i !== J)
7404
+ if (bi = [], $i = hs(), $i !== J)
7409
7405
  for (; $i !== J; )
7410
- bi.push($i), $i = ps();
7406
+ bi.push($i), $i = hs();
7411
7407
  else
7412
7408
  bi = J;
7413
7409
  bi !== J ? ($i = Wt(), $i !== J ? (X.charCodeAt(Ne) === 125 ? (Pi = ge, Ne++) : (Pi = J, _t === 0 && Ct(me)), Pi !== J ? (Gt = Ce, je = Et(mt, Bt, Zt, bi), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J);
@@ -7437,7 +7433,7 @@ function peg$parse(X, W) {
7437
7433
  Ne = Ce, Ce = J;
7438
7434
  return Ce;
7439
7435
  }
7440
- function Zs() {
7436
+ function Gs() {
7441
7437
  var Ce, je, Qe, mt, xt, Mt, ti, Bt, gi, Kt, ai, Zt, ri, bi;
7442
7438
  if (Ce = Ne, X.charCodeAt(Ne) === 123 ? (je = fe, Ne++) : (je = J, _t === 0 && Ct(pe)), je !== J)
7443
7439
  if (Qe = Wt(), Qe !== J)
@@ -7449,9 +7445,9 @@ function peg$parse(X, W) {
7449
7445
  if (gi = Wt(), gi !== J)
7450
7446
  if (X.charCodeAt(Ne) === 44 ? (Kt = Ke, Ne++) : (Kt = J, _t === 0 && Ct(Ze)), Kt !== J)
7451
7447
  if (ai = Wt(), ai !== J) {
7452
- if (Zt = [], ri = hs(), ri !== J)
7448
+ if (Zt = [], ri = us(), ri !== J)
7453
7449
  for (; ri !== J; )
7454
- Zt.push(ri), ri = hs();
7450
+ Zt.push(ri), ri = us();
7455
7451
  else
7456
7452
  Zt = J;
7457
7453
  Zt !== J ? (ri = Wt(), ri !== J ? (X.charCodeAt(Ne) === 125 ? (bi = ge, Ne++) : (bi = J, _t === 0 && Ct(me)), bi !== J ? (Gt = Ce, je = Nt(mt, Zt), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J);
@@ -7477,23 +7473,23 @@ function peg$parse(X, W) {
7477
7473
  Ne = Ce, Ce = J;
7478
7474
  return Ce;
7479
7475
  }
7480
- function Ys() {
7476
+ function Zs() {
7481
7477
  var Ce, je, Qe, mt;
7482
- return Ce = Ne, je = Ne, X.charCodeAt(Ne) === 61 ? (Qe = zt, Ne++) : (Qe = J, _t === 0 && Ct(hi)), Qe !== J ? (mt = gs(), mt !== J ? (Qe = [Qe, mt], je = Qe) : (Ne = je, je = J)) : (Ne = je, je = J), je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, Ce === J && (Ce = Mi()), Ce;
7478
+ return Ce = Ne, je = Ne, X.charCodeAt(Ne) === 61 ? (Qe = zt, Ne++) : (Qe = J, _t === 0 && Ct(hi)), Qe !== J ? (mt = fs(), mt !== J ? (Qe = [Qe, mt], je = Qe) : (Ne = je, je = J)) : (Ne = je, je = J), je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, Ce === J && (Ce = Mi()), Ce;
7483
7479
  }
7484
- function hs() {
7480
+ function us() {
7485
7481
  var Ce, je, Qe, mt, xt, Mt, ti, Bt;
7486
7482
  return Ce = Ne, je = Wt(), je !== J ? (Qe = Mi(), Qe !== J ? (mt = Wt(), mt !== J ? (X.charCodeAt(Ne) === 123 ? (xt = fe, Ne++) : (xt = J, _t === 0 && Ct(pe)), xt !== J ? (Gt = Ne, Mt = ui(), Mt ? Mt = void 0 : Mt = J, Mt !== J ? (ti = Ii(), ti !== J ? (X.charCodeAt(Ne) === 125 ? (Bt = ge, Ne++) : (Bt = J, _t === 0 && Ct(me)), Bt !== J ? (Gt = Ce, je = Yt(Qe, ti), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce;
7487
7483
  }
7488
- function ps() {
7484
+ function hs() {
7489
7485
  var Ce, je, Qe, mt, xt, Mt, ti, Bt;
7490
- return Ce = Ne, je = Wt(), je !== J ? (Qe = Ys(), Qe !== J ? (mt = Wt(), mt !== J ? (X.charCodeAt(Ne) === 123 ? (xt = fe, Ne++) : (xt = J, _t === 0 && Ct(pe)), xt !== J ? (Gt = Ne, Mt = Ai(), Mt ? Mt = void 0 : Mt = J, Mt !== J ? (ti = Ii(), ti !== J ? (X.charCodeAt(Ne) === 125 ? (Bt = ge, Ne++) : (Bt = J, _t === 0 && Ct(me)), Bt !== J ? (Gt = Ce, je = ii(Qe, ti), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce;
7486
+ return Ce = Ne, je = Wt(), je !== J ? (Qe = Zs(), Qe !== J ? (mt = Wt(), mt !== J ? (X.charCodeAt(Ne) === 123 ? (xt = fe, Ne++) : (xt = J, _t === 0 && Ct(pe)), xt !== J ? (Gt = Ne, Mt = Ai(), Mt ? Mt = void 0 : Mt = J, Mt !== J ? (ti = Ii(), ti !== J ? (X.charCodeAt(Ne) === 125 ? (Bt = ge, Ne++) : (Bt = J, _t === 0 && Ct(me)), Bt !== J ? (Gt = Ce, je = ii(Qe, ti), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), Ce;
7491
7487
  }
7492
7488
  function xi() {
7493
7489
  var Ce;
7494
7490
  return _t++, it.test(X.charAt(Ne)) ? (Ce = X.charAt(Ne), Ne++) : (Ce = J, _t === 0 && Ct(gt)), _t--, Ce === J && _t === 0 && Ct(pi), Ce;
7495
7491
  }
7496
- function fs() {
7492
+ function ps() {
7497
7493
  var Ce;
7498
7494
  return _t++, kt.test(X.charAt(Ne)) ? (Ce = X.charAt(Ne), Ne++) : (Ce = J, _t === 0 && Ct(Lt)), _t--, Ce === J && _t === 0 && Ct(yt), Ce;
7499
7495
  }
@@ -7503,18 +7499,18 @@ function peg$parse(X, W) {
7503
7499
  je.push(Qe), Qe = xi();
7504
7500
  return je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, _t--, Ce === J && (je = J, _t === 0 && Ct(ni)), Ce;
7505
7501
  }
7506
- function gs() {
7502
+ function fs() {
7507
7503
  var Ce, je, Qe;
7508
- return _t++, Ce = Ne, X.charCodeAt(Ne) === 45 ? (je = jt, Ne++) : (je = J, _t === 0 && Ct(Tt)), je === J && (je = null), je !== J ? (Qe = vs(), Qe !== J ? (Gt = Ce, je = Ot(je, Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), _t--, Ce === J && (je = J, _t === 0 && Ct(li)), Ce;
7504
+ return _t++, Ce = Ne, X.charCodeAt(Ne) === 45 ? (je = jt, Ne++) : (je = J, _t === 0 && Ct(Tt)), je === J && (je = null), je !== J ? (Qe = bs(), Qe !== J ? (Gt = Ce, je = Ot(je, Qe), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J), _t--, Ce === J && (je = J, _t === 0 && Ct(li)), Ce;
7509
7505
  }
7510
7506
  function ki() {
7511
7507
  var Ce, je;
7512
7508
  return _t++, Ce = Ne, X.substr(Ne, 2) === Dt ? (je = Dt, Ne += 2) : (je = J, _t === 0 && Ct(Ut)), je !== J && (Gt = Ce, je = Xt()), Ce = je, _t--, Ce === J && (je = J, _t === 0 && Ct(qt)), Ce;
7513
7509
  }
7514
- function ms() {
7510
+ function gs() {
7515
7511
  var Ce, je, Qe, mt, xt, Mt;
7516
7512
  if (Ce = Ne, X.charCodeAt(Ne) === 39 ? (je = Me, Ne++) : (je = J, _t === 0 && Ct(Be)), je !== J)
7517
- if (Qe = Xs(), Qe !== J) {
7513
+ if (Qe = Ys(), Qe !== J) {
7518
7514
  for (mt = Ne, xt = [], X.substr(Ne, 2) === Dt ? (Mt = Dt, Ne += 2) : (Mt = J, _t === 0 && Ct(Ut)), Mt === J && (Ue.test(X.charAt(Ne)) ? (Mt = X.charAt(Ne), Ne++) : (Mt = J, _t === 0 && Ct(Je))); Mt !== J; )
7519
7515
  xt.push(Mt), X.substr(Ne, 2) === Dt ? (Mt = Dt, Ne += 2) : (Mt = J, _t === 0 && Ct(Ut)), Mt === J && (Ue.test(X.charAt(Ne)) ? (Mt = X.charAt(Ne), Ne++) : (Mt = J, _t === 0 && Ct(Je)));
7520
7516
  xt !== J ? mt = X.substring(mt, Ne) : mt = xt, mt !== J ? (X.charCodeAt(Ne) === 39 ? (xt = Me, Ne++) : (xt = J, _t === 0 && Ct(Be)), xt === J && (xt = null), xt !== J ? (Gt = Ce, je = oi(Qe, mt), Ce = je) : (Ne = Ce, Ce = J)) : (Ne = Ce, Ce = J);
@@ -7524,45 +7520,45 @@ function peg$parse(X, W) {
7524
7520
  Ne = Ce, Ce = J;
7525
7521
  return Ce;
7526
7522
  }
7527
- function bs() {
7523
+ function ms() {
7528
7524
  var Ce, je, Qe, mt;
7529
7525
  return Ce = Ne, je = Ne, X.length > Ne ? (Qe = X.charAt(Ne), Ne++) : (Qe = J, _t === 0 && Ct(Ae)), Qe !== J ? (Gt = Ne, mt = fi(Qe), mt ? mt = void 0 : mt = J, mt !== J ? (Qe = [Qe, mt], je = Qe) : (Ne = je, je = J)) : (Ne = je, je = J), je === J && (X.charCodeAt(Ne) === 10 ? (je = Ci, Ne++) : (je = J, _t === 0 && Ct(Di))), je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, Ce;
7530
7526
  }
7531
- function Xs() {
7527
+ function Ys() {
7532
7528
  var Ce, je, Qe, mt;
7533
7529
  return Ce = Ne, je = Ne, X.length > Ne ? (Qe = X.charAt(Ne), Ne++) : (Qe = J, _t === 0 && Ct(Ae)), Qe !== J ? (Gt = Ne, mt = Ri(Qe), mt ? mt = void 0 : mt = J, mt !== J ? (Qe = [Qe, mt], je = Qe) : (Ne = je, je = J)) : (Ne = je, je = J), je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, Ce;
7534
7530
  }
7535
7531
  function Si() {
7536
7532
  var Ce, je;
7537
- return _t++, Ce = Ne, je = vs(), je === J && (je = Mi()), je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, _t--, Ce === J && (je = J, _t === 0 && Ct(As)), Ce;
7533
+ return _t++, Ce = Ne, je = bs(), je === J && (je = Mi()), je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, _t--, Ce === J && (je = J, _t === 0 && Ct(ks)), Ce;
7538
7534
  }
7539
- function vs() {
7535
+ function bs() {
7540
7536
  var Ce, je, Qe, mt, xt;
7541
- if (_t++, Ce = Ne, X.charCodeAt(Ne) === 48 ? (je = Cs, Ne++) : (je = J, _t === 0 && Ct(Es)), je !== J && (Gt = Ce, je = Ts()), Ce = je, Ce === J) {
7542
- if (Ce = Ne, je = Ne, Os.test(X.charAt(Ne)) ? (Qe = X.charAt(Ne), Ne++) : (Qe = J, _t === 0 && Ct(Ds)), Qe !== J) {
7543
- for (mt = [], es.test(X.charAt(Ne)) ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(ts)); xt !== J; )
7544
- mt.push(xt), es.test(X.charAt(Ne)) ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(ts));
7537
+ if (_t++, Ce = Ne, X.charCodeAt(Ne) === 48 ? (je = Ss, Ne++) : (je = J, _t === 0 && Ct(Cs)), je !== J && (Gt = Ce, je = Es()), Ce = je, Ce === J) {
7538
+ if (Ce = Ne, je = Ne, Ts.test(X.charAt(Ne)) ? (Qe = X.charAt(Ne), Ne++) : (Qe = J, _t === 0 && Ct(Os)), Qe !== J) {
7539
+ for (mt = [], Qi.test(X.charAt(Ne)) ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(es)); xt !== J; )
7540
+ mt.push(xt), Qi.test(X.charAt(Ne)) ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(es));
7545
7541
  mt !== J ? (Qe = [Qe, mt], je = Qe) : (Ne = je, je = J);
7546
7542
  } else
7547
7543
  Ne = je, je = J;
7548
- je !== J && (Gt = Ce, je = Rs(je)), Ce = je;
7544
+ je !== J && (Gt = Ce, je = Ds(je)), Ce = je;
7549
7545
  }
7550
- return _t--, Ce === J && (je = J, _t === 0 && Ct(Ss)), Ce;
7546
+ return _t--, Ce === J && (je = J, _t === 0 && Ct(As)), Ce;
7551
7547
  }
7552
7548
  function Mi() {
7553
7549
  var Ce, je, Qe, mt, xt;
7554
- if (_t++, Ce = Ne, je = [], Qe = Ne, mt = Ne, _t++, xt = xi(), xt === J && (xt = fs()), _t--, xt === J ? mt = void 0 : (Ne = mt, mt = J), mt !== J ? (X.length > Ne ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(Ae)), xt !== J ? (mt = [mt, xt], Qe = mt) : (Ne = Qe, Qe = J)) : (Ne = Qe, Qe = J), Qe !== J)
7550
+ if (_t++, Ce = Ne, je = [], Qe = Ne, mt = Ne, _t++, xt = xi(), xt === J && (xt = ps()), _t--, xt === J ? mt = void 0 : (Ne = mt, mt = J), mt !== J ? (X.length > Ne ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(Ae)), xt !== J ? (mt = [mt, xt], Qe = mt) : (Ne = Qe, Qe = J)) : (Ne = Qe, Qe = J), Qe !== J)
7555
7551
  for (; Qe !== J; )
7556
- je.push(Qe), Qe = Ne, mt = Ne, _t++, xt = xi(), xt === J && (xt = fs()), _t--, xt === J ? mt = void 0 : (Ne = mt, mt = J), mt !== J ? (X.length > Ne ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(Ae)), xt !== J ? (mt = [mt, xt], Qe = mt) : (Ne = Qe, Qe = J)) : (Ne = Qe, Qe = J);
7552
+ je.push(Qe), Qe = Ne, mt = Ne, _t++, xt = xi(), xt === J && (xt = ps()), _t--, xt === J ? mt = void 0 : (Ne = mt, mt = J), mt !== J ? (X.length > Ne ? (xt = X.charAt(Ne), Ne++) : (xt = J, _t === 0 && Ct(Ae)), xt !== J ? (mt = [mt, xt], Qe = mt) : (Ne = Qe, Qe = J)) : (Ne = Qe, Qe = J);
7557
7553
  else
7558
7554
  je = J;
7559
- return je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, _t--, Ce === J && (je = J, _t === 0 && Ct(qs)), Ce;
7555
+ return je !== J ? Ce = X.substring(Ce, Ne) : Ce = je, _t--, Ce === J && (je = J, _t === 0 && Ct(Rs)), Ce;
7560
7556
  }
7561
7557
  var yi = ["root"];
7562
- function Js() {
7558
+ function Xs() {
7563
7559
  return yi.length > 1;
7564
7560
  }
7565
- function ys() {
7561
+ function vs() {
7566
7562
  return yi[yi.length - 1] === "plural";
7567
7563
  }
7568
7564
  function _i() {
@@ -7572,7 +7568,7 @@ function peg$parse(X, W) {
7572
7568
  }
7573
7569
  if (Ti = te(), Ti !== J && Ne === X.length)
7574
7570
  return Ti;
7575
- throw Ti !== J && Ne < X.length && Ct(Is()), Ms(qi, vi < X.length ? X.charAt(vi) : null, vi < X.length ? Oi(vi, vi + 1) : Oi(vi, vi));
7571
+ throw Ti !== J && Ne < X.length && Ct(Ls()), Fs(qi, vi < X.length ? X.charAt(vi) : null, vi < X.length ? Oi(vi, vi + 1) : Oi(vi, vi));
7576
7572
  }
7577
7573
  var pegParse = peg$parse, __spreadArrays$2 = function() {
7578
7574
  for (var X = 0, W = 0, J = arguments.length; W < J; W++) X += arguments[W].length;
@@ -8705,9 +8701,6 @@ class QuickActionBusyManagerImpl {
8705
8701
  isBusy() {
8706
8702
  return this.tasks.length > 0;
8707
8703
  }
8708
- clearAll() {
8709
- this.tasks = [];
8710
- }
8711
8704
  emitBusyChanged() {
8712
8705
  const W = this.isBusy();
8713
8706
  this.broker.publish(BROKER_EVENTS.shell.quickActionBusyChanged, { busy: W });
@@ -8901,32 +8894,14 @@ class RegionManagerProxy {
8901
8894
  _notifyMainViewChanged(W) {
8902
8895
  this.broker.publish(BROKER_EVENTS.shell.mainViewChanged, { viewId: W });
8903
8896
  }
8904
- /**
8905
- * Desmunta totes les vistes de totes les regions, i espera que acabin.
8906
- *
8907
- * Es crida en tancar, ABANS de fer el `dispose` dels plugins: els cleanups dels `useEffect` que
8908
- * s'executen en desmuntar-se poden enviar comandes pel broker, i han de trobar el handler encara
8909
- * registrat. Cada plugin ja ho fa pel seu compte al `dispose`, però això només cobreix els
8910
- * plugins d'aquest repositori; els de tercers (econsulta, allergies…) no els controlem.
8911
- *
8912
- * Fa servir `unregisterViewFromRegion` i no `destroy()`/`clear()` del regionManager perquè
8913
- * aquests fan `forEach` amb crides asíncrones sense esperar-les, així que retornen abans que les
8914
- * vistes s'hagin desmuntat de debò.
8915
- *
8916
- * És idempotent: desregistrar una vista que ja no hi és no fa res.
8917
- */
8918
- async _removeAllViews() {
8919
- for (const W of ALL_REGION_NAMES) {
8920
- const J = this.regionManager.getRegisteredViews(W) ?? [];
8921
- for (const { key: re } of [...J])
8922
- await this.regionManager.unregisterViewFromRegion(W, re);
8923
- }
8924
- }
8925
- async _destroy() {
8926
- await this.regionManager.destroy();
8927
- }
8928
8897
  }
8929
- const createRegionManagerProxy = (X, W, J) => new RegionManagerProxy(X, W, J);
8898
+ const removeAllViews = async (X) => {
8899
+ for (const W of ALL_REGION_NAMES) {
8900
+ const J = X.getRegisteredViews(W) ?? [];
8901
+ for (const { key: re } of [...J])
8902
+ await X.unregisterViewFromRegion(W, re);
8903
+ }
8904
+ }, createRegionManagerProxy = (X, W, J) => new RegionManagerProxy(X, W, J);
8930
8905
  let token, refreshToken, tokenInitialized = !1;
8931
8906
  class TokenManagerImpl {
8932
8907
  constructor(W) {
@@ -8985,7 +8960,7 @@ class ImportDataManagerImpl {
8985
8960
  async import(W, J) {
8986
8961
  this.currentImporterId = W, this.currentImportParams = J, this.selectedItems = {}, this.pluginTexts = {};
8987
8962
  try {
8988
- const { ImportDataManagerModal: re } = await import("./component-DGPt9i3-.js"), { confirmed: te } = await this.interactionService.confirm(
8963
+ const { ImportDataManagerModal: re } = await import("./component-B2qHBVpK.js"), { confirmed: te } = await this.interactionService.confirm(
8989
8964
  void 0,
8990
8965
  { component: re },
8991
8966
  {
@@ -9069,7 +9044,24 @@ class PrimariaContextManagerImpl {
9069
9044
  }
9070
9045
  }
9071
9046
  let contextManager$1;
9072
- const createContextManager = () => contextManager$1 || (contextManager$1 = new PrimariaContextManagerImpl(), contextManager$1), broker = createBroker(), regionManager = v$f("primaria"), PrimariaRegionHost = f$o(regionManager), tokenManager = createTokenManager(broker), userManager = createUserManager(tokenManager), activityMonitor = createActivityMonitor(), sessionRefreshTimer = createSessionRefreshTimer(tokenManager, activityMonitor), globalStateManager = createGlobalStateManager(broker), contextManager = createContextManager(), exitGuardManager = new ExitGuardManagerImpl(), quickActionBusyManager = new QuickActionBusyManagerImpl(broker), interactionService = new PrimariaInteractionServiceImpl(), notificationService = new PrimariaNotificationServiceImpl(), ecapEventManager = createEcapEventManager(globalStateManager), pdfViewerManager = createPdfViewerManager(broker, notificationService), importDataManager = new ImportDataManagerImpl(interactionService), primariaApiFactory = (X) => {
9047
+ const createContextManager = () => contextManager$1 || (contextManager$1 = new PrimariaContextManagerImpl(), contextManager$1), { broker, clear: clearBroker } = createBroker(), regionManager = v$f("primaria"), PrimariaRegionHost = f$o(regionManager), tokenManager = createTokenManager(broker), userManager = createUserManager(tokenManager), activityMonitor = createActivityMonitor(), sessionRefreshTimer = createSessionRefreshTimer(tokenManager, activityMonitor), globalStateManager = createGlobalStateManager(broker), contextManager = createContextManager(), exitGuardManager = new ExitGuardManagerImpl(), quickActionBusyManager = new QuickActionBusyManagerImpl(broker), interactionService = new PrimariaInteractionServiceImpl(), notificationService = new PrimariaNotificationServiceImpl(), ecapEventManager = createEcapEventManager(globalStateManager), pdfViewerManager = createPdfViewerManager(broker, notificationService), importDataManager = new ImportDataManagerImpl(interactionService), publicTokenManager = {
9048
+ getToken: () => tokenManager.getToken(),
9049
+ refreshToken: () => tokenManager.refreshToken()
9050
+ }, publicContextManager = {
9051
+ getContext: () => contextManager.getContext()
9052
+ }, publicInteractionService = {
9053
+ confirm: (X, W, J) => interactionService.confirm(X, W, J),
9054
+ confirmMessage: (X, W) => interactionService.confirmMessage(X, W)
9055
+ }, shellInternals = {
9056
+ /** Fixa els tokens inicials. Només funciona una vegada (`Token already initialized`). */
9057
+ setInitialTokens: (X, W) => tokenManager.setInitialTokens(X, W),
9058
+ initializeContext: (X) => contextManager.initializeContext(X),
9059
+ /** Desmunta totes les vistes de totes les regions i espera que acabin. */
9060
+ removeAllViews: () => removeAllViews(regionManager),
9061
+ destroyRegions: () => regionManager.destroy(),
9062
+ clearBroker,
9063
+ closeAllDialogs: () => interactionService.dispose()
9064
+ }, primariaApiFactory = (X) => {
9073
9065
  const W = createRegionManagerProxy(X, regionManager, broker);
9074
9066
  return {
9075
9067
  pluginInfo: X,
@@ -9078,13 +9070,13 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
9078
9070
  broker,
9079
9071
  createLocaleManager: createLocaleManager(X.pluginId),
9080
9072
  globalStateManager,
9081
- contextManager,
9082
- tokenManager,
9073
+ contextManager: publicContextManager,
9074
+ tokenManager: publicTokenManager,
9083
9075
  userManager,
9084
9076
  ecapEventManager,
9085
9077
  exitGuardManager,
9086
9078
  quickActionBusyManager,
9087
- interactionService,
9079
+ interactionService: publicInteractionService,
9088
9080
  notificationService,
9089
9081
  pdfViewerManager,
9090
9082
  importDataManager
@@ -9095,7 +9087,8 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
9095
9087
  activityMonitor,
9096
9088
  primariaApiFactory,
9097
9089
  sessionRefreshTimer,
9098
- shellApi
9090
+ shellApi,
9091
+ shellInternals
9099
9092
  }, Symbol.toStringTag, { value: "Module" })), registerRequest = (X, W) => (J, re) => {
9100
9093
  W.bind(re).to(re).inTransientScope(), injectable()(re);
9101
9094
  const te = X.broker.registerRequest(J, (ne) => W.get(re).handle(ne));
@@ -9108,12 +9101,13 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
9108
9101
  let bootstrappedPlugins = [];
9109
9102
  const CORE_FIRST_ID = "activity-history", bundledActivityHistory = {
9110
9103
  pluginId: CORE_FIRST_ID,
9111
- importer: () => import("./plugin-MLG7cNJN.js")
9112
- }, bootstrapPlugins = async (X, W) => {
9113
- const J = X ?? [], re = J.filter((ue) => ue.pluginId === CORE_FIRST_ID), te = J.filter((ue) => ue.pluginId !== CORE_FIRST_ID), ne = re.length ? re : [bundledActivityHistory], oe = await p$k(
9114
- ne,
9115
- primariaApiFactory
9116
- ), ce = te.length ? await p$k(te, primariaApiFactory) : [];
9104
+ importer: () => import("./plugin-lcKeYuXk.js")
9105
+ };
9106
+ let pluginsBootstrapped = !1;
9107
+ const bootstrapPlugins = async (X, W) => {
9108
+ if (pluginsBootstrapped) throw new Error("Plugins already bootstrapped");
9109
+ pluginsBootstrapped = !0;
9110
+ const J = X ?? [], re = J.filter((ue) => ue.pluginId === CORE_FIRST_ID), te = J.filter((ue) => ue.pluginId !== CORE_FIRST_ID), ne = re.length ? re : [bundledActivityHistory], oe = await p$k(ne, primariaApiFactory), ce = te.length ? await p$k(te, primariaApiFactory) : [];
9117
9111
  bootstrappedPlugins = [...oe, ...ce], handleStartupPlugin(bootstrappedPlugins, W);
9118
9112
  }, handleStartupPlugin = (X, W) => {
9119
9113
  if (X && X.length > 0 && W?.pluginId) {
@@ -9122,7 +9116,10 @@ const CORE_FIRST_ID = "activity-history", bundledActivityHistory = {
9122
9116
  );
9123
9117
  J?.importedPlugin?.startup && J?.importedPlugin?.startup?.(J.apiInstance, W.params);
9124
9118
  }
9125
- }, disposePlugins = async () => Promise.all(bootstrappedPlugins.map((X) => X?.dispose()));
9119
+ }, disposePlugins = async () => {
9120
+ const X = await Promise.all(bootstrappedPlugins.map((W) => W?.dispose()));
9121
+ return bootstrappedPlugins = [], pluginsBootstrapped = !1, X;
9122
+ };
9126
9123
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$j = (X, W, J, re) => {
9127
9124
  for (var te = re > 1 ? void 0 : re ? __getOwnPropDesc$4(W, J) : W, ne = X.length - 1, oe; ne >= 0; ne--)
9128
9125
  (oe = X[ne]) && (te = oe(te) || te);
@@ -9158,7 +9155,7 @@ let ExitShellHandler = class {
9158
9155
  * no canvia.
9159
9156
  */
9160
9157
  async unmountViewsAndDisposePlugins() {
9161
- await this.api.regionManager._removeAllViews(), await disposePlugins();
9158
+ await shellInternals.removeAllViews(), await disposePlugins();
9162
9159
  }
9163
9160
  timeout(X) {
9164
9161
  return new Promise((W) => setTimeout(W, X));
@@ -9249,10 +9246,10 @@ const useGetUserInfo = (X) => {
9249
9246
  request?.dispose(), unregisterDep(GetUserInfoBackendAdapter);
9250
9247
  }, useFeatures = (X) => {
9251
9248
  container.bind(TYPES.primaryApi).toConstantValue(X), useGetUserInfo(X), useExitShell(X), X.broker.send(new GetUserInfo());
9252
- }, disposeFeatures = async (X) => {
9253
- disposeGetUserInfo(), disposeExitShell(), container.unbindAll(), await X.regionManager._destroy(), X.broker._clear();
9249
+ }, disposeFeatures = async () => {
9250
+ disposeGetUserInfo(), disposeExitShell(), container.unbindAll(), await shellInternals.destroyRegions(), shellInternals.clearBroker();
9254
9251
  }, disposeShell = async () => {
9255
- await disposeFeatures(shellApi), shellApi.interactionService.dispose(), sessionRefreshTimer.stop(), activityMonitor.stop();
9252
+ await disposeFeatures(), shellInternals.closeAllDialogs(), sessionRefreshTimer.stop(), activityMonitor.stop(), resetShellInitialization();
9256
9253
  }, raiseCloseEvent = () => {
9257
9254
  shellApi.ecapEventManager.publish("CLOSE_FORM", "", {});
9258
9255
  }, raiseCustomCloseEvent = (X) => {
@@ -35192,67 +35189,12 @@ __decorateClass$d([
35192
35189
  __decorateClass$d([
35193
35190
  r$T()
35194
35191
  ], PrimariaShellHeader.prototype, "menuOpened");
35195
- const Hi = class Hi extends h$u {
35196
- render() {
35197
- return ke$1`<div>
35198
- <h1>POC ECAP Test </h1>
35199
- <hr>
35200
- <p>Emplenar valors de url i accio per navegar a ECAP</p>
35201
- <form>
35202
- <label for="eventType">Tipus d'event (TipusEvent)</label>
35203
- <input type="text" id="eventType" name="eventType" placeholder="IA_DEV">
35204
- <label for="Accio">Acció a executar (Accio)</label>
35205
- <input type="text" id="accio" name="accio" placeholder="NO_TANCAR">
35206
- <label for="parameterName">Nom del parametre</label>
35207
- <input type="text" id="parameterName" name="parameterName" placeholder="CIP">
35208
- <label for="parameterValue">Valor del parametre</label>
35209
- <input type="text" id="parameterValue" name="parameterValue" placeholder="12345678">
35210
-
35211
- </form>
35212
- <button @click=${(W) => this.goToLinkOnEcap()}>LLennçar event ecap</button>
35213
- </div>
35214
-
35215
- <form>
35216
- <label for="pdfId">PDF ID</label>
35217
- <input type="text" id="pdfId" name="pdfId" placeholder="unique-id">
35218
- <label for="pdfName">PDF Name</label>
35219
- <input type="text" id="pdfName" name="pdfName" placeholder="pdfName">
35220
- <label for="pdfDate">PDF Date</label>
35221
- <input type="text" id="pdfDate" name="pdfDate" placeholder="2024-01-15">
35222
- <label for="url">URL</label>
35223
- <input type="text" id="url" name="url" placeholder="url">
35224
-
35225
-
35226
- </form>
35227
- <button @click=${(W) => this.sendPdfToViewer()}>Add PDF</button>
35228
-
35229
-
35230
- <button @click=${(W) => this.getPDFS()}>GET PDFs</button>
35231
- `;
35232
- }
35233
- sendPdfToViewer() {
35234
- const W = this.shadowRoot?.getElementById("pdfId")?.value, J = this.shadowRoot?.getElementById("pdfName")?.value, re = this.shadowRoot?.getElementById("pdfDate")?.value, te = this.shadowRoot?.getElementById("url")?.value;
35235
- shellApi.pdfViewerManager.add({ id: W, name: J, date: re, url: te });
35236
- }
35237
- getPDFS() {
35238
- return shellApi.pdfViewerManager.getPdfs();
35239
- }
35240
- goToLinkOnEcap() {
35241
- const W = this.shadowRoot?.getElementById("eventType")?.value, J = this.shadowRoot?.getElementById("accio")?.value, re = this.shadowRoot?.getElementById("parameterName")?.value, te = this.shadowRoot?.getElementById("parameterValue")?.value;
35242
- shellApi.ecapEventManager.publish(W, J, {
35243
- [re]: te
35244
- });
35245
- }
35246
- };
35247
- Hi.styles = i$13`
35248
- `;
35249
- let PocEventsEcap = Hi;
35250
35192
  var __defProp$c = Object.defineProperty, __decorateClass$c = (X, W, J, re) => {
35251
35193
  for (var te = void 0, ne = X.length - 1, oe; ne >= 0; ne--)
35252
35194
  (oe = X[ne]) && (te = oe(W, J, te) || te);
35253
35195
  return te && __defProp$c(W, J, te), te;
35254
35196
  };
35255
- const Bi = class Bi extends h$u {
35197
+ const Hi = class Hi extends h$u {
35256
35198
  toggle() {
35257
35199
  this.isOpen = !this.isOpen;
35258
35200
  }
@@ -35268,7 +35210,7 @@ const Bi = class Bi extends h$u {
35268
35210
  `;
35269
35211
  }
35270
35212
  };
35271
- Bi.styles = i$13`
35213
+ Hi.styles = i$13`
35272
35214
  :host {
35273
35215
  display: block;
35274
35216
  }
@@ -35290,7 +35232,7 @@ Bi.styles = i$13`
35290
35232
  align-items: center;
35291
35233
  }
35292
35234
  `;
35293
- let PrimariaAccordion = Bi;
35235
+ let PrimariaAccordion = Hi;
35294
35236
  __decorateClass$c([
35295
35237
  n$A({ type: Boolean })
35296
35238
  ], PrimariaAccordion.prototype, "isOpen");
@@ -35314,7 +35256,7 @@ var __defProp$b = Object.defineProperty, __decorateClass$b = (X, W, J, re) => {
35314
35256
  (oe = X[ne]) && (te = oe(W, J, te) || te);
35315
35257
  return te && __defProp$b(W, J, te), te;
35316
35258
  };
35317
- const regionContainerId = (X) => `${X}-container`, Wi = class Wi extends PrimariaRegionHost(h$u) {
35259
+ const regionContainerId = (X) => `${X}-container`, Bi = class Bi extends PrimariaRegionHost(h$u) {
35318
35260
  constructor(W, J, re) {
35319
35261
  super(), this.showText = !1, this.icon = "", this.label = "", this.regionName = "", this.icon = W, this.label = J, this.regionName = re;
35320
35262
  }
@@ -35338,10 +35280,10 @@ const regionContainerId = (X) => `${X}-container`, Wi = class Wi extends Primari
35338
35280
  return ke$1`${template$6(this)}`;
35339
35281
  }
35340
35282
  };
35341
- Wi.styles = i$13`
35283
+ Bi.styles = i$13`
35342
35284
  ${r$X(styles$6)}
35343
35285
  `;
35344
- let SidenavActionMenu = Wi;
35286
+ let SidenavActionMenu = Bi;
35345
35287
  __decorateClass$b([
35346
35288
  r$T()
35347
35289
  ], SidenavActionMenu.prototype, "showText");
@@ -35395,17 +35337,17 @@ __decorateClass$8([
35395
35337
  ], PetitionerActionMenu.prototype, "sidenavRegion");
35396
35338
  const styles$5 = ".header-container{width:1px;height:40px;background-color:var(--color-neutral-100)}", template$5 = (X) => ke$1`
35397
35339
  <div class="header-container"></div>
35398
- `, Ki = class Ki extends h$u {
35340
+ `, Wi = class Wi extends h$u {
35399
35341
  render() {
35400
35342
  return ke$1`${template$5()}`;
35401
35343
  }
35402
35344
  };
35403
- Ki.styles = i$13`
35345
+ Wi.styles = i$13`
35404
35346
  ${r$X(styles$5)}
35405
35347
  `;
35406
- let HeaderDivider = Ki;
35348
+ let HeaderDivider = Wi;
35407
35349
  const useComponents = () => {
35408
- t$P("primaria-shell")(PrimariaShell), t$P("primaria-shell-header")(PrimariaShellHeader), t$P("primaria-error-view")(PrimariaErrorView), t$P("header-divider")(HeaderDivider), t$P("communication-action-menu")(CommunicationActionMenu), t$P("clinical-pathways-action-menu")(ClinicalPathwaysActionMenu), t$P("petitioner-action-menu")(PetitionerActionMenu), t$P("poc-events-ecap")(PocEventsEcap), t$P("primaria-accordion")(PrimariaAccordion);
35350
+ t$P("primaria-shell")(PrimariaShell), t$P("primaria-shell-header")(PrimariaShellHeader), t$P("primaria-error-view")(PrimariaErrorView), t$P("header-divider")(HeaderDivider), t$P("communication-action-menu")(CommunicationActionMenu), t$P("clinical-pathways-action-menu")(ClinicalPathwaysActionMenu), t$P("petitioner-action-menu")(PetitionerActionMenu), t$P("primaria-accordion")(PrimariaAccordion);
35409
35351
  };
35410
35352
  var __defProp$7 = Object.defineProperty, __decorateClass$7 = (X, W, J, re) => {
35411
35353
  for (var te = void 0, ne = X.length - 1, oe; ne >= 0; ne--)
@@ -35414,7 +35356,7 @@ var __defProp$7 = Object.defineProperty, __decorateClass$7 = (X, W, J, re) => {
35414
35356
  };
35415
35357
  const isSelected = (X, W, J) => X[W] === J || Array.from(X.attributes).some(
35416
35358
  (re) => re.name === W && re.value === J
35417
- ), Gi = class Gi extends h$u {
35359
+ ), Ki = class Ki extends h$u {
35418
35360
  constructor() {
35419
35361
  super(...arguments), this.animation = "fade";
35420
35362
  }
@@ -35458,7 +35400,7 @@ const isSelected = (X, W, J) => X[W] === J || Array.from(X.attributes).some(
35458
35400
  }
35459
35401
  }
35460
35402
  };
35461
- Gi.styles = i$13`
35403
+ Ki.styles = i$13`
35462
35404
  :host {
35463
35405
  display: flex;
35464
35406
  flex: 1;
@@ -35467,7 +35409,7 @@ Gi.styles = i$13`
35467
35409
  display: none !important;
35468
35410
  }
35469
35411
  `;
35470
- let PrimariaContentSwitcher = Gi;
35412
+ let PrimariaContentSwitcher = Ki;
35471
35413
  __decorateClass$7([
35472
35414
  n$A()
35473
35415
  ], PrimariaContentSwitcher.prototype, "selected");
@@ -35499,7 +35441,7 @@ var __defProp$6 = Object.defineProperty, __decorateClass$6 = (X, W, J, re) => {
35499
35441
  (oe = X[ne]) && (te = oe(W, J, te) || te);
35500
35442
  return te && __defProp$6(W, J, te), te;
35501
35443
  };
35502
- const Zi = class Zi extends k$d(h$u) {
35444
+ const Gi = class Gi extends k$d(h$u) {
35503
35445
  constructor(W) {
35504
35446
  super(), this.subscriptions = [], this.containerWidth = 0, this.showText = !1, this.isActive = !1, this.config = W;
35505
35447
  }
@@ -35534,10 +35476,10 @@ const Zi = class Zi extends k$d(h$u) {
35534
35476
  return ke$1`${template$4(this)}`;
35535
35477
  }
35536
35478
  };
35537
- Zi.styles = i$13`
35479
+ Gi.styles = i$13`
35538
35480
  ${r$X(styles$4)}
35539
35481
  `;
35540
- let PrimariaNavItem = Zi;
35482
+ let PrimariaNavItem = Gi;
35541
35483
  __decorateClass$6([
35542
35484
  n$A({ type: Number })
35543
35485
  ], PrimariaNavItem.prototype, "containerWidth");
@@ -35595,7 +35537,7 @@ var __defProp$5 = Object.defineProperty, __decorateClass$5 = (X, W, J, re) => {
35595
35537
  (oe = X[ne]) && (te = oe(W, J, te) || te);
35596
35538
  return te && __defProp$5(W, J, te), te;
35597
35539
  };
35598
- const Yi = class Yi extends h$u {
35540
+ const Zi = class Zi extends h$u {
35599
35541
  constructor(W) {
35600
35542
  super(), this.showActionMenu = !1, this.handleItemClick = () => {
35601
35543
  this.showActionMenu = !0;
@@ -35615,10 +35557,10 @@ const Yi = class Yi extends h$u {
35615
35557
  return ke$1`${template$3(this)}`;
35616
35558
  }
35617
35559
  };
35618
- Yi.styles = i$13`
35560
+ Zi.styles = i$13`
35619
35561
  ${r$X(styles$3)}
35620
35562
  `;
35621
- let PrimariaNavTreeMenu = Yi;
35563
+ let PrimariaNavTreeMenu = Zi;
35622
35564
  __decorateClass$5([
35623
35565
  n$A({ type: Object })
35624
35566
  ], PrimariaNavTreeMenu.prototype, "config");
@@ -43140,7 +43082,7 @@ const TOOLBAR_OPTION_ALIASES = {
43140
43082
  background: { background: [] },
43141
43083
  font: { font: [] },
43142
43084
  align: { align: [] }
43143
- }, Xi = class Xi extends h$u {
43085
+ }, Yi = class Yi extends h$u {
43144
43086
  constructor() {
43145
43087
  super(...arguments), this.textChangeTimeout = null, this.availableOptions = [
43146
43088
  "bold",
@@ -43292,10 +43234,10 @@ const TOOLBAR_OPTION_ALIASES = {
43292
43234
  return this.quill.getSelection();
43293
43235
  }
43294
43236
  };
43295
- Xi.styles = i$13`
43237
+ Yi.styles = i$13`
43296
43238
  ${r$X(styles$2)}
43297
43239
  `;
43298
- let PrimariaRichTextEditor = Xi;
43240
+ let PrimariaRichTextEditor = Yi;
43299
43241
  __decorateClass$4([
43300
43242
  n$A()
43301
43243
  ], PrimariaRichTextEditor.prototype, "quill");
@@ -43320,7 +43262,7 @@ var __defProp$3 = Object.defineProperty, __decorateClass$3 = (X, W, J, re) => {
43320
43262
  (oe = X[ne]) && (te = oe(W, J, te) || te);
43321
43263
  return te && __defProp$3(W, J, te), te;
43322
43264
  };
43323
- const Ji = class Ji extends h$u {
43265
+ const Xi = class Xi extends h$u {
43324
43266
  constructor() {
43325
43267
  super(...arguments), this.characterCount = 0, this.characterLimit = 0, this.label = "";
43326
43268
  }
@@ -43335,10 +43277,10 @@ const Ji = class Ji extends h$u {
43335
43277
  ` : D$3;
43336
43278
  }
43337
43279
  };
43338
- Ji.styles = i$13`
43280
+ Xi.styles = i$13`
43339
43281
  ${r$X(styles$1)}
43340
43282
  `;
43341
- let PrimariaCharacterLimitBadge = Ji;
43283
+ let PrimariaCharacterLimitBadge = Xi;
43342
43284
  __decorateClass$3([
43343
43285
  n$A({ type: Number })
43344
43286
  ], PrimariaCharacterLimitBadge.prototype, "characterCount");
@@ -43527,7 +43469,7 @@ var __defProp = Object.defineProperty, __decorateClass = (X, W, J, re) => {
43527
43469
  (oe = X[ne]) && (te = oe(W, J, te) || te);
43528
43470
  return te && __defProp(W, J, te), te;
43529
43471
  };
43530
- const Qi = class Qi extends k$d(h$u) {
43472
+ const Ji = class Ji extends k$d(h$u) {
43531
43473
  constructor() {
43532
43474
  super(...arguments), this.expanded = !1;
43533
43475
  }
@@ -43550,10 +43492,10 @@ const Qi = class Qi extends k$d(h$u) {
43550
43492
  }).observe(W);
43551
43493
  }
43552
43494
  };
43553
- Qi.styles = i$13`
43495
+ Ji.styles = i$13`
43554
43496
  ${r$X(styles)}
43555
43497
  `;
43556
- let NavDivider = Qi;
43498
+ let NavDivider = Ji;
43557
43499
  __decorateClass([
43558
43500
  r$T()
43559
43501
  ], NavDivider.prototype, "expanded");
@@ -44187,11 +44129,16 @@ const commonNavMenuItems = [
44187
44129
  "primaria-content-switcher",
44188
44130
  d$x
44189
44131
  ), useSharedUI(), useComponents(), useInternalViews();
44190
- }, initializeShell = (X, W) => {
44191
- W && shellApi.contextManager.initializeContext(W), activityMonitor.start(), sessionRefreshTimer.start(), useLocalization(shellApi), useUI(), useFeatures(shellApi);
44132
+ };
44133
+ let shellInitialized = !1;
44134
+ const initializeShell = (X, W) => {
44135
+ if (shellInitialized) throw new Error("Shell already initialized");
44136
+ shellInitialized = !0, W && shellInternals.initializeContext(W), activityMonitor.start(), sessionRefreshTimer.start(), useLocalization(shellApi), useUI(), useFeatures(shellApi);
44192
44137
  const J = new PrimariaShell();
44193
44138
  X.appendChild(J);
44194
- };
44139
+ }, resetShellInitialization = () => {
44140
+ shellInitialized = !1;
44141
+ }, setInitialTokens = (X, W) => shellInternals.setInitialTokens(X, W);
44195
44142
  class i extends HTMLElement {
44196
44143
  constructor(W, J, re = {}, te) {
44197
44144
  super(), this.jsx = W, this.styles = J, this.root = this.attachShadow({ mode: "open" }), this.reactRoot = null, this.fullHeight = te?.fullHeight ?? !1, re && (this.props = re);
@@ -44217,27 +44164,23 @@ if (typeof document < "u") {
44217
44164
  ${dssCSS}`, document.head.appendChild(X);
44218
44165
  }
44219
44166
  export {
44220
- ExitShell as A,
44221
- CIPDS_SELECTION_REQUEST as B,
44167
+ QuickActionItem as A,
44168
+ PrimariaRegion as B,
44222
44169
  Container as C,
44223
44170
  D$3 as D,
44224
44171
  EcapEventManager as E,
44225
- CLINICAL_COURSE_DRAFT_APPEND_REQUESTED as F,
44226
- initializeShell as G,
44227
- HELP_REQUESTED as H,
44228
- disposeShell as I,
44229
- raiseCloseEvent as J,
44230
- raiseCustomCloseEvent as K,
44172
+ createEcapEventManager as F,
44173
+ ExitShell as G,
44174
+ CIPDS_SELECTION_REQUEST as H,
44175
+ CLINICAL_COURSE_DRAFT_APPEND_REQUESTED as I,
44176
+ HELP_REQUESTED as J,
44177
+ PrimariaContentSwitcher as K,
44231
44178
  LAST_WORKED_DIAGNOSTICS_KEY as L,
44232
- bootstrapPlugins as M,
44233
- handleStartupPlugin as N,
44234
- disposePlugins as O,
44179
+ l as M,
44180
+ PrimariaInteractionService as N,
44235
44181
  PrimariaRegionHost as P,
44236
44182
  Qt as Q,
44237
44183
  REQUEST_DIAGNOSTICS_SELECTOR as R,
44238
- PrimariaContentSwitcher as S,
44239
- l as T,
44240
- PrimariaInteractionService as U,
44241
44184
  inject as a,
44242
44185
  i$13 as b,
44243
44186
  nn as c,
@@ -44260,9 +44203,9 @@ export {
44260
44203
  t$P as t,
44261
44204
  translate as u,
44262
44205
  shellApi as v,
44263
- PrimariaNavItem as w,
44264
- QuickActionItem as x,
44265
- PrimariaRegion as y,
44266
- createEcapEventManager as z
44206
+ initializeShell as w,
44207
+ setInitialTokens as x,
44208
+ bootstrapPlugins as y,
44209
+ PrimariaNavItem as z
44267
44210
  };
44268
- //# sourceMappingURL=index-C8RN2NKs.js.map
44211
+ //# sourceMappingURL=index-DVT-GJFF.js.map