akpm-datapoint-front 5.0.12 → 5.0.21

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 (2) hide show
  1. package/CDN/dp-component.js +40 -36
  2. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /* Version: 5.0.12 */
1
+ /* Version: 5.0.21 */
2
2
  var Ib = Object.defineProperty;
3
3
  var gc = (i) => {
4
4
  throw TypeError(i);
@@ -2360,6 +2360,8 @@ const a0 = (i) => {
2360
2360
  return "finanza";
2361
2361
  case "aks_stp":
2362
2362
  return "smartechpa";
2363
+ case "aks_aca":
2364
+ return "academy";
2363
2365
  default:
2364
2366
  return "development";
2365
2367
  }
@@ -4261,6 +4263,8 @@ const Df = (i) => {
4261
4263
  return "finanza";
4262
4264
  case "aks_stp":
4263
4265
  return "smartechpa";
4266
+ case "aks_aca":
4267
+ return "academy";
4264
4268
  default:
4265
4269
  return "development";
4266
4270
  }
@@ -4589,56 +4593,56 @@ class $l {
4589
4593
  };
4590
4594
  }
4591
4595
  }
4592
- async function d0(i, a, r, l = !1) {
4596
+ async function d0(i, a, r = !1) {
4593
4597
  try {
4594
- const u = Aa.getInstance(), h = {
4595
- ownerSite: i == null ? void 0 : i.toLowerCase(),
4598
+ const l = Aa.getInstance(), u = {
4599
+ suiteId: i == null ? void 0 : i.suiteId,
4600
+ ragioneSociale: i == null ? void 0 : i.ragioneSociale,
4596
4601
  headQuarter: "all",
4597
4602
  type: "acqua",
4598
- periodStart: new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 1).toISOString().split("T")[0],
4599
- periodEnd: new Date((/* @__PURE__ */ new Date()).getFullYear(), 11, 31).toISOString().split("T")[0]
4603
+ year: a
4600
4604
  };
4601
- let t;
4602
- l ? t = await u.refreshData("invoices", h) : t = await u.getData("invoices", h);
4603
- const s = Yf(t, a, r);
4605
+ let h;
4606
+ r ? h = await l.refreshData("invoices", u) : h = await l.getData("invoices", u);
4607
+ const t = Yf(h, a, a);
4604
4608
  return {
4605
- consumo: Tl(s, 2),
4609
+ consumo: Tl(t, 2),
4606
4610
  success: !0
4607
4611
  };
4608
- } catch (u) {
4609
- return console.error("Errore durante l'estrazione del consumo idrico:", u), {
4612
+ } catch (l) {
4613
+ return console.error("Errore durante l'estrazione del consumo idrico:", l), {
4610
4614
  consumo: 0,
4611
4615
  success: !1,
4612
- error: u instanceof Error ? u.message : "Errore sconosciuto"
4616
+ error: l instanceof Error ? l.message : "Errore sconosciuto"
4613
4617
  };
4614
4618
  }
4615
4619
  }
4616
- async function n0(i, a, r, l = !1) {
4620
+ async function n0(i, a, r = !1) {
4617
4621
  try {
4618
- const u = Aa.getInstance(), h = {
4619
- ownerSite: i == null ? void 0 : i.toLowerCase(),
4622
+ const l = Aa.getInstance(), u = {
4623
+ suiteId: i == null ? void 0 : i.suiteId,
4624
+ ragioneSociale: i == null ? void 0 : i.ragioneSociale,
4620
4625
  headQuarter: "all",
4621
4626
  type: "luce",
4622
- periodStart: new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 1).toISOString().split("T")[0],
4623
- periodEnd: new Date((/* @__PURE__ */ new Date()).getFullYear(), 11, 31).toISOString().split("T")[0]
4627
+ year: a
4624
4628
  };
4625
- let t;
4626
- l ? t = await u.refreshData("invoices", h) : t = await u.getData("invoices", h);
4627
- const s = Wf(t, a, r);
4629
+ let h;
4630
+ r ? h = await l.refreshData("invoices", u) : h = await l.getData("invoices", u);
4631
+ const t = Wf(h, a, a);
4628
4632
  return {
4629
- electricityConsumption: Tl(s.totalConsumption, 2),
4630
- electricityRenewableSources: Tl(s.renewableSources, 2),
4631
- electricityNonRenewableSources: Tl(s.nonRenewableSources, 2),
4632
- uom: s.uom,
4633
+ electricityConsumption: Tl(t.totalConsumption, 2),
4634
+ electricityRenewableSources: Tl(t.renewableSources, 2),
4635
+ electricityNonRenewableSources: Tl(t.nonRenewableSources, 2),
4636
+ uom: t.uom,
4633
4637
  success: !0
4634
4638
  };
4635
- } catch (u) {
4636
- return console.error("Errore durante l'estrazione del consumo elettrico:", u), {
4639
+ } catch (l) {
4640
+ return console.error("Errore durante l'estrazione del consumo elettrico:", l), {
4637
4641
  electricityConsumption: 0,
4638
4642
  electricityRenewableSources: 0,
4639
4643
  electricityNonRenewableSources: 0,
4640
4644
  success: !1,
4641
- error: u instanceof Error ? u.message : "Errore sconosciuto"
4645
+ error: l instanceof Error ? l.message : "Errore sconosciuto"
4642
4646
  };
4643
4647
  }
4644
4648
  }
@@ -4733,7 +4737,7 @@ const $f = {
4733
4737
  };
4734
4738
  function en(i, a) {
4735
4739
  Je(a, !0), et(i, $f);
4736
- let r = x(a, "id", 7), l = x(a, "datapoint_id", 7), u = x(a, "position", 7), h = x(a, "year", 15), t = x(a, "table", 15), s = x(a, "data", 15), d = x(a, "dataValue", 15), m = oe(!0), o = oe(0), g = oe("");
4740
+ let r = x(a, "id", 7), l = x(a, "datapoint_id", 7), u = x(a, "position", 7), h = x(a, "year", 15), t = x(a, "table", 15), s = x(a, "data", 15), d = x(a, "dataValue", 15), m = oe(!0), o = oe(0), g = oe(null);
4737
4741
  const q = Aa.getInstance();
4738
4742
  Ze(() => {
4739
4743
  d({ consumo: e(o) });
@@ -4748,7 +4752,7 @@ function en(i, a) {
4748
4752
  }, G = async (_ = !1) => {
4749
4753
  try {
4750
4754
  S(m, !0), await B();
4751
- const p = await d0(e(g), h(), h(), _);
4755
+ const p = await d0(e(g), h(), _);
4752
4756
  p.success ? S(o, L(p.consumo)) : console.error("Errore nell'estrazione dei dati:", p.error);
4753
4757
  } catch (p) {
4754
4758
  console.error("Errore durante l'aggiornamento:", p);
@@ -10410,7 +10414,7 @@ function tl(i, a) {
10410
10414
  autoprodotte: { campo1: "" }
10411
10415
  }));
10412
10416
  };
10413
- let n = oe(!0), z = oe("");
10417
+ let n = oe(!0), z = oe(null);
10414
10418
  const D = [
10415
10419
  { label: "Carbone", key: "carbone" },
10416
10420
  { label: "Petrolio", key: "petrolio" },
@@ -10497,7 +10501,7 @@ function tl(i, a) {
10497
10501
  }, M = async (Y = !1) => {
10498
10502
  try {
10499
10503
  S(n, !0), await j();
10500
- const H = await n0(e(z), h(), h(), Y);
10504
+ const H = await n0(e(z), h(), Y);
10501
10505
  H.success ? (S(_, Math.round(H.electricityRenewableSources / 1e3 * 100) / 100), S(p, Math.round(H.electricityNonRenewableSources / 1e3 * 100) / 100)) : (console.error("Errore nell'estrazione dei dati:", H.error), S(_, 0), S(p, 0));
10502
10506
  } catch (H) {
10503
10507
  console.error("Errore durante l'aggiornamento:", H), S(_, 0), S(p, 0);
@@ -28549,7 +28553,7 @@ function En(i, a) {
28549
28553
  Ze(() => {
28550
28554
  d(e(D));
28551
28555
  });
28552
- let V = oe(""), w = oe(!0), _ = oe("");
28556
+ let V = oe(""), w = oe(!0), _ = oe(null);
28553
28557
  const p = Aa.getInstance(), k = async () => {
28554
28558
  try {
28555
28559
  const U = await p.getData("owner");
@@ -28560,7 +28564,7 @@ function En(i, a) {
28560
28564
  }, I = async (U = !1) => {
28561
28565
  try {
28562
28566
  S(w, !0), await k();
28563
- const X = await n0(e(_), h(), h(), U);
28567
+ const X = await n0(e(_), h(), U);
28564
28568
  X.success ? (S(m, X.electricityConsumption / 1e3), S(o, X.electricityRenewableSources / 1e3), S(g, X.electricityNonRenewableSources / 1e3), X.uom && S(V, L(X.uom)), S(q, 0), S(B, 0), S(G, 0), S(O, 0), S(n, 0), S(z, 0)) : (console.error("Errore nell'estrazione dei dati:", X.error), S(m, 0), S(o, 0), S(g, 0), S(q, 0), S(B, 0), S(G, 0), S(O, 0), S(n, 0), S(z, 0));
28565
28569
  } catch (X) {
28566
28570
  console.error("Errore durante l'aggiornamento:", X), S(m, 0), S(o, 0), S(g, 0), S(O, 0), S(n, 0), S(z, 0);
@@ -32759,7 +32763,7 @@ function ko(i, a) {
32759
32763
  "Acqua prodotta",
32760
32764
  "Risorse idriche di terze parti"
32761
32765
  ];
32762
- let B = oe("");
32766
+ let B = oe(null);
32763
32767
  const G = Aa.getInstance(), O = async () => {
32764
32768
  try {
32765
32769
  const k = await G.getData("owner");
@@ -32774,7 +32778,7 @@ function ko(i, a) {
32774
32778
  }, z = async (k = !1) => {
32775
32779
  try {
32776
32780
  S(m, !0), await O();
32777
- const I = await d0(e(B), h(), h(), k);
32781
+ const I = await d0(e(B), h(), k);
32778
32782
  I.success ? e(o)["Risorse idriche di terze parti"] = {
32779
32783
  campo1: I.consumo / 1e3,
32780
32784
  campo2: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akpm-datapoint-front",
3
- "version": "5.0.12",
3
+ "version": "5.0.21",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",