eatopia-ds 0.0.950 → 0.0.952

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index18.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { j as a } from "./index24.js";
2
- import { useMemo as L, useCallback as P, useRef as et, useState as J, useEffect as xt } from "react";
3
- import { createPortal as De } from "react-dom";
4
- const Me = {
2
+ import { useMemo as R, useCallback as L, useRef as ot, useState as Z, useEffect as yt } from "react";
3
+ import { createPortal as Fe } from "react-dom";
4
+ const Ce = {
5
5
  light: {
6
6
  stockSafe: "#00E676",
7
7
  stockPast: "#c4ccd0",
@@ -50,7 +50,7 @@ const Me = {
50
50
  selectedQtyBar: "#42A5F5"
51
51
  // Azul mais claro para tema escuro
52
52
  }
53
- }, Fe = {
53
+ }, Ee = {
54
54
  sm: {
55
55
  height: 170,
56
56
  segmentRatio: 0.2,
@@ -96,60 +96,60 @@ const Me = {
96
96
  pillPaddingY: 4,
97
97
  pillFontSize: 11
98
98
  }
99
- }, Ce = (i) => {
100
- i.roundRect || (i.roundRect = function(b, v, S, E, c) {
101
- S < 2 * c && (c = S / 2), E < 2 * c && (c = E / 2), this.beginPath(), this.moveTo(b + c, v), this.arcTo(b + S, v, b + S, v + E, c), this.arcTo(b + S, v + E, b, v + E, c), this.arcTo(b, v + E, b, v, c), this.arcTo(b, v, b + S, v, c), this.closePath();
99
+ }, Ae = (i) => {
100
+ i.roundRect || (i.roundRect = function(x, v, S, C, M) {
101
+ S < 2 * M && (M = S / 2), C < 2 * M && (M = C / 2), this.beginPath(), this.moveTo(x + M, v), this.arcTo(x + S, v, x + S, v + C, M), this.arcTo(x + S, v + C, x, v + C, M), this.arcTo(x, v + C, x, v, M), this.arcTo(x, v, x + S, v, M), this.closePath();
102
102
  });
103
- }, bt = (i, b) => {
104
- const v = parseInt(i.replace("#", ""), 16), S = Math.round(2.55 * b), E = (v >> 16) + S, c = (v >> 8 & 255) + S, w = (v & 255) + S;
105
- return "#" + (16777216 + (E < 255 ? E < 1 ? 0 : E : 255) * 65536 + (c < 255 ? c < 1 ? 0 : c : 255) * 256 + (w < 255 ? w < 1 ? 0 : w : 255)).toString(16).slice(1);
103
+ }, vt = (i, x) => {
104
+ const v = parseInt(i.replace("#", ""), 16), S = Math.round(2.55 * x), C = (v >> 16) + S, M = (v >> 8 & 255) + S, d = (v & 255) + S;
105
+ return "#" + (16777216 + (C < 255 ? C < 1 ? 0 : C : 255) * 65536 + (M < 255 ? M < 1 ? 0 : M : 255) * 256 + (d < 255 ? d < 1 ? 0 : d : 255)).toString(16).slice(1);
106
106
  };
107
- function se(i) {
108
- const b = i.split("-").map(Number);
109
- return b.length !== 3 || b.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(b[0], b[1] - 1, b[2]);
107
+ function ae(i) {
108
+ const x = i.split("-").map(Number);
109
+ return x.length !== 3 || x.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(x[0], x[1] - 1, x[2]);
110
110
  }
111
- function K(i) {
112
- const b = i.split("T")[0], v = i.includes("T") ? i.split("T")[1] : null, S = se(b);
111
+ function tt(i) {
112
+ const x = i.split("T")[0], v = i.includes("T") ? i.split("T")[1] : null, S = ae(x);
113
113
  if (isNaN(S.getTime())) return S;
114
114
  if (v) {
115
- const [E, c, w] = v.split(":"), m = parseInt(E ?? "0", 10), nt = parseInt(c ?? "0", 10), Ft = w !== void 0 && parseInt(w.slice(0, 2), 10) || 0, s = w != null && w.includes(".") && parseInt(w.split(".")[1].slice(0, 3), 10) || 0;
116
- Number.isNaN(m) || S.setHours(m, nt, Ft, s);
115
+ const [C, M, d] = v.split(":"), W = parseInt(C ?? "0", 10), b = parseInt(M ?? "0", 10), it = d !== void 0 && parseInt(d.slice(0, 2), 10) || 0, Et = d != null && d.includes(".") && parseInt(d.split(".")[1].slice(0, 3), 10) || 0;
116
+ Number.isNaN(W) || S.setHours(W, b, it, Et);
117
117
  }
118
118
  return S;
119
119
  }
120
- function Bt(i) {
121
- return i.includes("T") ? K(i) : yt(se(i));
120
+ function Lt(i) {
121
+ return i.includes("T") ? tt(i) : St(ae(i));
122
122
  }
123
- function yt(i) {
124
- const b = new Date(i);
125
- return b.setHours(23, 59, 59, 999), b;
123
+ function St(i) {
124
+ const x = new Date(i);
125
+ return x.setHours(23, 59, 59, 999), x;
126
126
  }
127
- const Ee = (i) => {
128
- const b = K(i.todayDate).getTime(), v = Bt(i.stockEndDate).getTime(), S = K(i.deliveryDate).getTime(), E = K(
127
+ const Xe = (i) => {
128
+ const x = tt(i.todayDate).getTime(), v = Lt(i.stockEndDate).getTime(), S = tt(i.deliveryDate).getTime(), C = tt(
129
129
  i.restockSuggestionStart
130
- ).getTime(), c = Bt(
130
+ ).getTime(), M = Lt(
131
131
  i.restockSuggestionEnd
132
132
  ).getTime();
133
133
  if (S >= v) {
134
- const m = Math.ceil((S - v) / 864e5);
134
+ const W = Math.ceil((S - v) / 864e5);
135
135
  return {
136
136
  status: "critical",
137
137
  title: "Risco de Ruptura",
138
- message: m > 0 ? `A entrega chegará ${m} dia(s) após o estoque acabar.` : "A entrega está prevista para o mesmo dia do fim do estoque."
138
+ message: W > 0 ? `A entrega chegará ${W} dia(s) após o estoque acabar.` : "A entrega está prevista para o mesmo dia do fim do estoque."
139
139
  };
140
140
  }
141
- if (b >= v)
141
+ if (x >= v)
142
142
  return {
143
143
  status: "critical",
144
144
  title: "Estoque Esgotado",
145
145
  message: "Seu estoque previsto chegou ao fim."
146
146
  };
147
- const w = Math.floor((v - S) / (1e3 * 60 * 60 * 24));
148
- return w <= 2 ? {
147
+ const d = Math.floor((v - S) / (1e3 * 60 * 60 * 24));
148
+ return d <= 2 ? {
149
149
  status: "urgent",
150
150
  title: "Atenção ao Prazo",
151
- message: `Margem de segurança baixa: entrega prevista para ${w} dia(s) antes do fim do estoque.`
152
- } : b >= E && b <= c ? {
151
+ message: `Margem de segurança baixa: entrega prevista para ${d} dia(s) antes do fim do estoque.`
152
+ } : x >= C && x <= M ? {
153
153
  status: "warning",
154
154
  title: "Sugestão de Compra",
155
155
  message: "Momento ideal para realizar o pedido de reposição."
@@ -159,25 +159,26 @@ const Ee = (i) => {
159
159
  message: "Nível de estoque adequado. Nenhuma ação necessária."
160
160
  };
161
161
  };
162
- function Be({
162
+ function Le({
163
163
  data: i,
164
- className: b,
164
+ className: x,
165
165
  style: v,
166
166
  controls: S = !1,
167
- showLegend: E = !0,
168
- size: c = "md",
169
- selectedQty: w,
170
- selectedQtyDays: m,
171
- showSuggestionBar: nt = !0,
172
- unitLabel: Ft = "kg"
167
+ controlsZoomOnly: C = !1,
168
+ showLegend: M = !0,
169
+ size: d = "md",
170
+ selectedQty: W,
171
+ selectedQtyDays: b,
172
+ showSuggestionBar: it = !0,
173
+ unitLabel: Et = "kg"
173
174
  }) {
174
- const s = L(() => Fe[c], [c]), p = L(
175
- () => Me[i.config.theme || "light"],
175
+ const s = R(() => Ee[d], [d]), m = R(
176
+ () => Ce[i.config.theme || "light"],
176
177
  [i.config.theme]
177
- ), H = L(
178
- () => Ee(i.timeline),
178
+ ), Y = R(
179
+ () => Xe(i.timeline),
179
180
  [i.timeline]
180
- ), re = ["DOM", "SEG", "TER", "QUA", "QUI", "SEX", "SAB"], ae = P(
181
+ ), le = ["DOM", "SEG", "TER", "QUA", "QUI", "SEX", "SAB"], ce = L(
181
182
  (e) => {
182
183
  if (!i.timeline.dailyConsumptionAverage) return null;
183
184
  const g = [
@@ -192,97 +193,100 @@ function Be({
192
193
  return i.timeline.dailyConsumptionAverage[g] ?? null;
193
194
  },
194
195
  [i]
195
- ), ot = et(null), jt = et(null), [T, Nt] = J({
196
+ ), st = ot(null), Pt = ot(null), [T, Gt] = Z({
196
197
  isHovering: !1,
197
198
  hoveredSection: null,
198
199
  mouseX: 0,
199
200
  mouseY: 0,
200
201
  dateAtCursor: null
201
- }), [qt, le] = J({ x: 0, y: 0 }), Lt = L(() => [0.6, 0.9, 1, 1.4, 1.8], []), [Gt, Ut] = J(3), [q, it] = J(0), [vt, ce] = J(!1), [de, zt] = J(
202
- nt
203
- ), Y = S ? de : nt;
204
- xt(() => {
205
- zt(nt);
206
- }, [nt]);
207
- const M = L(
208
- () => K(i.timeline.lastRestockDate),
202
+ }), [Ut, de] = Z({ x: 0, y: 0 }), It = R(() => [0.6, 0.9, 1, 1.4, 1.8], []), [zt, Vt] = Z(3), [G, rt] = Z(0), [Tt, ge] = Z(!1), [ue, _t] = Z(
203
+ it
204
+ ), N = S ? ue : it;
205
+ yt(() => {
206
+ _t(it);
207
+ }, [it]);
208
+ const z = R(
209
+ () => tt(i.timeline.lastRestockDate),
209
210
  [i.timeline.lastRestockDate]
210
- ), st = L(
211
- () => K(i.timeline.todayDate),
211
+ ), P = R(() => {
212
+ const e = new Date(z);
213
+ return e.setDate(e.getDate() - 4), e;
214
+ }, [z]), at = R(
215
+ () => tt(i.timeline.todayDate),
212
216
  [i.timeline.todayDate]
213
- ), C = L(
214
- () => Bt(i.timeline.stockEndDate),
217
+ ), F = R(
218
+ () => Lt(i.timeline.stockEndDate),
215
219
  [i.timeline.stockEndDate]
216
- ), Vt = L(
217
- () => K(i.timeline.restockSuggestionStart),
220
+ ), Qt = R(
221
+ () => tt(i.timeline.restockSuggestionStart),
218
222
  [i.timeline.restockSuggestionStart]
219
- ), U = L(
220
- () => Bt(i.timeline.restockSuggestionEnd),
223
+ ), V = R(
224
+ () => Lt(i.timeline.restockSuggestionEnd),
221
225
  [i.timeline.restockSuggestionEnd]
222
- ), I = L(
223
- () => K(i.timeline.deliveryDate),
226
+ ), I = R(
227
+ () => tt(i.timeline.deliveryDate),
224
228
  [i.timeline.deliveryDate]
225
- ), A = 1e3 * 60 * 60 * 24, X = L(
226
- () => i.config.pixelsPerDay * Lt[Gt],
227
- [i.config.pixelsPerDay, Gt, Lt]
228
- ), y = P(
229
+ ), E = 1e3 * 60 * 60 * 24, A = R(
230
+ () => i.config.pixelsPerDay * It[zt],
231
+ [i.config.pixelsPerDay, zt, It]
232
+ ), y = L(
229
233
  (e) => {
230
- const t = (e.getTime() - M.getTime()) / A;
231
- return s.padding.left + t * X - q;
234
+ const t = (e.getTime() - P.getTime()) / E;
235
+ return s.padding.left + t * A - G;
232
236
  },
233
237
  [
234
- M,
235
- X,
238
+ P,
239
+ A,
236
240
  s.padding.left,
237
- q,
238
- A
241
+ G,
242
+ E
239
243
  ]
240
- ), _t = P(
244
+ ), Jt = L(
241
245
  (e) => {
242
- const t = (e - s.padding.left + q) / X, g = new Date(M);
246
+ const t = (e - s.padding.left + G) / A, g = new Date(P);
243
247
  return g.setDate(g.getDate() + Math.floor(t)), g;
244
248
  },
245
- [M, X, s.padding.left, q]
246
- ), ge = (e) => `${e.getDate().toString().padStart(2, "0")}/${(e.getMonth() + 1).toString().padStart(2, "0")}`, St = (e) => {
249
+ [P, A, s.padding.left, G]
250
+ ), he = (e) => `${e.getDate().toString().padStart(2, "0")}/${(e.getMonth() + 1).toString().padStart(2, "0")}`, wt = (e) => {
247
251
  const t = e.getDate().toString().padStart(2, "0"), g = (e.getMonth() + 1).toString().padStart(2, "0");
248
252
  if (e.getHours() === 0 && e.getMinutes() === 0) return `${t}/${g}`;
249
- const F = e.getHours().toString().padStart(2, "0"), d = e.getMinutes().toString().padStart(2, "0");
250
- return `${t}/${g} ${F}:${d}`;
251
- }, Tt = P(() => {
252
- const e = ot.current;
253
+ const D = e.getHours().toString().padStart(2, "0"), c = e.getMinutes().toString().padStart(2, "0");
254
+ return `${t}/${g} ${D}:${c}`;
255
+ }, kt = L(() => {
256
+ const e = st.current;
253
257
  if (!e) return;
254
258
  const t = e.getContext("2d");
255
259
  if (!t) return;
256
- Ce(t);
257
- const g = window.devicePixelRatio || 1, d = e.getBoundingClientRect().width, u = s.height;
258
- if (e.width = d * g, e.height = u * g, t.scale(g, g), t.clearRect(0, 0, d, u), t.fillStyle = p.background, t.roundRect(0, 0, d, u, 12), t.fill(), T.isHovering && T.dateAtCursor) {
260
+ Ae(t);
261
+ const g = window.devicePixelRatio || 1, c = e.getBoundingClientRect().width, u = s.height;
262
+ if (e.width = c * g, e.height = u * g, t.scale(g, g), t.clearRect(0, 0, c, u), t.fillStyle = m.background, t.roundRect(0, 0, c, u, 12), t.fill(), T.isHovering && T.dateAtCursor) {
259
263
  const n = y(T.dateAtCursor), o = i.config.theme === "dark";
260
264
  t.fillStyle = o ? "rgba(255, 255, 255, 0.05)" : "rgba(0, 0, 0, 0.05)";
261
265
  const r = s.padding.top, l = u - s.padding.bottom - s.padding.top;
262
- t.fillRect(n, r, X, l);
266
+ t.fillRect(n, r, A, l);
263
267
  }
264
- const W = y(M), B = y(st), j = y(C), O = y(I);
265
- y(Vt);
266
- const z = y(U), V = s.padding.top, R = (u - s.padding.top - s.padding.bottom) * s.segmentRatio, N = V + 5, _ = N + R + 2;
267
- t.strokeStyle = p.textSecondary, t.lineWidth = 1, t.setLineDash([]);
268
- let wt = Math.max(
269
- U.getTime(),
268
+ const O = y(z), B = y(at), j = y(F), $ = y(I);
269
+ y(Qt);
270
+ const _ = y(V), Q = s.padding.top, X = (u - s.padding.top - s.padding.bottom) * s.segmentRatio, q = Q + 5, J = q + X + 2;
271
+ t.strokeStyle = m.textSecondary, t.lineWidth = 1, t.setLineDash([]);
272
+ let Dt = Math.max(
273
+ V.getTime(),
270
274
  I.getTime(),
271
- C.getTime()
275
+ F.getTime()
272
276
  );
273
- if (typeof m == "number" && m > 0) {
277
+ if (typeof b == "number" && b > 0) {
274
278
  const n = new Date(
275
- Math.max(I.getTime(), C.getTime())
279
+ Math.max(I.getTime(), F.getTime())
276
280
  ), o = new Date(
277
- n.getTime() + (m - 1) * A
278
- ), r = yt(o);
279
- wt = Math.max(wt, r.getTime());
281
+ n.getTime() + (b - 1) * E
282
+ ), r = St(o);
283
+ Dt = Math.max(Dt, r.getTime());
280
284
  }
281
- const gt = new Date(wt);
282
- gt.setDate(gt.getDate() + 2);
283
- const $ = Math.ceil(
284
- (gt.getTime() - M.getTime()) / (1e3 * 60 * 60 * 24)
285
- ), ut = [
285
+ const ht = new Date(Dt);
286
+ ht.setDate(ht.getDate() + 2);
287
+ const H = Math.ceil(
288
+ (ht.getTime() - P.getTime()) / (1e3 * 60 * 60 * 24)
289
+ ), mt = [
286
290
  "JAN",
287
291
  "FEV",
288
292
  "MAR",
@@ -295,50 +299,50 @@ function Be({
295
299
  "OUT",
296
300
  "NOV",
297
301
  "DEZ"
298
- ], kt = (n) => {
302
+ ], Mt = (n) => {
299
303
  const o = n % 2 === 0;
300
304
  return i.config.theme === "dark" ? o ? "rgba(71, 85, 105, 0.25)" : "rgba(51, 65, 85, 0.4)" : o ? "rgba(241, 245, 249, 0.6)" : "rgba(203, 213, 225, 0.5)";
301
- }, Dt = (n, o) => {
305
+ }, Ft = (n, o) => {
302
306
  const r = n % 2 === 0;
303
307
  return i.config.theme === "dark" ? r ? "rgba(148, 163, 184, 1)" : "rgba(226, 232, 240, 1)" : r ? "rgba(100, 116, 139, 1)" : "rgba(51, 65, 85, 1)";
304
- }, Mt = [];
305
- let ht = -1, Xt = -1, Wt = s.padding.left;
306
- for (let n = 0; n <= $; n++) {
307
- const o = new Date(M);
308
+ }, Ct = [];
309
+ let pt = -1, Bt = -1, $t = s.padding.left;
310
+ for (let n = 0; n <= H; n++) {
311
+ const o = new Date(P);
308
312
  o.setDate(o.getDate() + n);
309
- const r = y(o), l = o.getMonth(), f = o.getFullYear();
310
- (l !== ht || f !== Xt) && (ht !== -1 && Mt.push({
311
- month: ht,
312
- year: Xt,
313
- startX: Wt,
313
+ const r = y(o), l = o.getMonth(), p = o.getFullYear();
314
+ (l !== pt || p !== Bt) && (pt !== -1 && Ct.push({
315
+ month: pt,
316
+ year: Bt,
317
+ startX: $t,
314
318
  endX: r
315
- }), ht = l, Xt = f, Wt = r);
319
+ }), pt = l, Bt = p, $t = r);
316
320
  }
317
- if (ht !== -1) {
318
- const n = new Date(M);
319
- n.setDate(n.getDate() + $), Mt.push({
320
- month: ht,
321
- year: Xt,
322
- startX: Wt,
323
- endX: y(n) + X
321
+ if (pt !== -1) {
322
+ const n = new Date(P);
323
+ n.setDate(n.getDate() + H), Ct.push({
324
+ month: pt,
325
+ year: Bt,
326
+ startX: $t,
327
+ endX: y(n) + A
324
328
  });
325
329
  }
326
- const te = V, ee = u - s.padding.bottom - V;
327
- for (const n of Mt) {
328
- const o = Math.max(n.startX, s.padding.left), l = Math.min(n.endX, d - s.padding.right) - o;
330
+ const ne = Q, oe = u - s.padding.bottom - Q;
331
+ for (const n of Ct) {
332
+ const o = Math.max(n.startX, s.padding.left), l = Math.min(n.endX, c - s.padding.right) - o;
329
333
  if (l > 0) {
330
- t.fillStyle = kt(n.month), t.fillRect(o, te, l, ee);
331
- const f = te + ee - 15;
334
+ t.fillStyle = Mt(n.month), t.fillRect(o, ne, l, oe);
335
+ const p = ne + oe - 15;
332
336
  t.fillStyle = i.config.theme === "dark" ? "rgba(148, 163, 184, 0.35)" : "rgba(100, 116, 139, 0.25)";
333
- const h = `bold ${(s.fontSize + 4) * 2}px system-ui, -apple-system, sans-serif`, x = new Date(n.year, n.month, 2), D = y(x), tt = D >= s.padding.left && D <= d - s.padding.right, pt = new Date(n.year, n.month + 1, 2), ft = y(pt);
334
- ft >= s.padding.left && ft <= d - s.padding.right && (t.save(), t.font = h, t.textAlign = "right", t.textBaseline = "bottom", t.fillText(
335
- ut[n.month],
336
- ft - 4,
337
- f
338
- ), t.restore()), tt && (t.save(), t.font = h, t.textAlign = "left", t.textBaseline = "bottom", t.fillText(ut[n.month], D + 4, f), t.restore());
337
+ const h = `bold ${(s.fontSize + 4) * 2}px system-ui, -apple-system, sans-serif`, f = new Date(n.year, n.month, 2), k = y(f), nt = k >= s.padding.left && k <= c - s.padding.right, xt = new Date(n.year, n.month + 1, 2), bt = y(xt);
338
+ bt >= s.padding.left && bt <= c - s.padding.right && (t.save(), t.font = h, t.textAlign = "right", t.textBaseline = "bottom", t.fillText(
339
+ mt[n.month],
340
+ bt - 4,
341
+ p
342
+ ), t.restore()), nt && (t.save(), t.font = h, t.textAlign = "left", t.textBaseline = "bottom", t.fillText(mt[n.month], k + 4, p), t.restore());
339
343
  }
340
344
  }
341
- const Te = ["DOM", "SEG", "TER", "QUA", "QUI", "SEX", "SAB"], ne = (n) => {
345
+ const ke = ["DOM", "SEG", "TER", "QUA", "QUI", "SEX", "SAB"], ie = (n) => {
342
346
  if (!i.timeline.dailyConsumptionAverage) return null;
343
347
  const r = [
344
348
  "0-domingo",
@@ -351,148 +355,148 @@ function Be({
351
355
  ][n];
352
356
  return i.timeline.dailyConsumptionAverage[r] ?? null;
353
357
  };
354
- for (let n = 0; n <= $; n++) {
358
+ for (let n = 0; n <= H; n++) {
355
359
  const o = new Date(
356
- M.getFullYear(),
357
- M.getMonth(),
358
- M.getDate() + n
360
+ P.getFullYear(),
361
+ P.getMonth(),
362
+ P.getDate() + n
359
363
  ), r = y(o);
360
- if (r >= s.padding.left && r <= d - s.padding.right) {
361
- const l = o.getDay(), f = l === 0 || l === 6, h = o.getMonth();
362
- o.getDate() === 1 && (t.save(), t.strokeStyle = i.config.theme === "dark" ? "rgba(148, 163, 184, 0.8)" : "rgba(71, 85, 105, 0.6)", t.lineWidth = 2, t.beginPath(), t.moveTo(r, V), t.lineTo(r, u - s.padding.bottom + 20), t.stroke(), t.restore()), t.strokeStyle = p.textSecondary, t.lineWidth = 1, t.beginPath(), t.moveTo(r, V), t.lineTo(r, u - s.padding.bottom), t.stroke();
363
- const D = r + X / 2, tt = u - s.padding.bottom + 8;
364
- t.fillStyle = Dt(h), t.font = `${s.fontSize}px system-ui, -apple-system, sans-serif`, t.textAlign = "center", t.textBaseline = "top", t.fillText(o.getDate().toString().padStart(2, "0"), D, tt);
365
- const pt = ne(l), ft = pt !== null ? pt : 0;
364
+ if (r >= s.padding.left && r <= c - s.padding.right) {
365
+ const l = o.getDay(), p = l === 0 || l === 6, h = o.getMonth();
366
+ o.getDate() === 1 && (t.save(), t.strokeStyle = i.config.theme === "dark" ? "rgba(148, 163, 184, 0.8)" : "rgba(71, 85, 105, 0.6)", t.lineWidth = 2, t.beginPath(), t.moveTo(r, Q), t.lineTo(r, u - s.padding.bottom + 20), t.stroke(), t.restore()), t.strokeStyle = m.textSecondary, t.lineWidth = 1, t.beginPath(), t.moveTo(r, Q), t.lineTo(r, u - s.padding.bottom), t.stroke();
367
+ const k = r + A / 2, nt = u - s.padding.bottom + 8;
368
+ t.fillStyle = Ft(h), t.font = `${s.fontSize}px system-ui, -apple-system, sans-serif`, t.textAlign = "center", t.textBaseline = "top", t.fillText(o.getDate().toString().padStart(2, "0"), k, nt);
369
+ const xt = ie(l), bt = xt !== null ? xt : 0;
366
370
  t.fillStyle = i.config.theme === "dark" ? "rgba(148, 163, 184, 0.7)" : "rgba(100, 116, 139, 0.7)", t.font = `${s.fontSize - 3}px system-ui, -apple-system, sans-serif`, t.textAlign = "center", t.textBaseline = "bottom";
367
- const Rt = u - s.padding.bottom - 18;
368
- t.fillText(ft.toFixed(2), D, Rt);
369
- const Yt = Te[l];
370
- t.fillStyle = Dt(h), t.font = `${f ? "bold " : ""}${s.fontSize - 2}px system-ui, -apple-system, sans-serif`;
371
- const ke = u - s.padding.bottom - 4;
372
- t.textBaseline = "bottom", t.fillText(Yt, D, ke);
371
+ const jt = u - s.padding.bottom - 18;
372
+ t.fillText(bt.toFixed(2), k, jt);
373
+ const qt = ke[l];
374
+ t.fillStyle = Ft(h), t.font = `${p ? "bold " : ""}${s.fontSize - 2}px system-ui, -apple-system, sans-serif`;
375
+ const Me = u - s.padding.bottom - 4;
376
+ t.textBaseline = "bottom", t.fillText(qt, k, Me);
373
377
  }
374
378
  }
375
- if (vt && i.timeline.dailyConsumptionAverage) {
379
+ if (Tt && i.timeline.dailyConsumptionAverage) {
376
380
  const n = Object.values(
377
381
  i.timeline.dailyConsumptionAverage
378
- ).filter((x) => typeof x == "number"), o = n.length > 0 ? Math.max(...n, 1) : 1, r = s.padding.bottom * 0.5, l = u - s.padding.bottom, f = r, h = [];
379
- for (let x = 0; x <= $; x++) {
380
- const D = new Date(M);
381
- D.setDate(D.getDate() + x);
382
- const tt = y(D);
383
- if (tt >= s.padding.left && tt <= d - s.padding.right) {
384
- const pt = D.getDay(), Rt = (ne(pt) ?? 0) / o, Yt = l - Rt * f;
385
- h.push({ x: tt + X / 2, y: Yt });
382
+ ).filter((f) => typeof f == "number"), o = n.length > 0 ? Math.max(...n, 1) : 1, r = s.padding.bottom * 0.5, l = u - s.padding.bottom, p = r, h = [];
383
+ for (let f = 0; f <= H; f++) {
384
+ const k = new Date(P);
385
+ k.setDate(k.getDate() + f);
386
+ const nt = y(k);
387
+ if (nt >= s.padding.left && nt <= c - s.padding.right) {
388
+ const xt = k.getDay(), jt = (ie(xt) ?? 0) / o, qt = l - jt * p;
389
+ h.push({ x: nt + A / 2, y: qt });
386
390
  }
387
391
  }
388
392
  if (h.length > 1) {
389
393
  t.save(), t.strokeStyle = "rgba(0, 0, 0, 0.25)", t.lineWidth = 2, t.lineCap = "round", t.lineJoin = "round", t.miterLimit = 2, t.beginPath(), t.moveTo(h[0].x, h[0].y);
390
- for (let x = 1; x < h.length; x++)
391
- t.lineTo(h[x].x, h[x].y);
394
+ for (let f = 1; f < h.length; f++)
395
+ t.lineTo(h[f].x, h[f].y);
392
396
  t.stroke(), t.restore();
393
397
  }
394
398
  }
395
- const mt = Math.max(W, s.padding.left), we = (n, o, r) => {
399
+ const ft = Math.max(O, s.padding.left), De = (n, o, r) => {
396
400
  const l = t.createLinearGradient(0, o, 0, o + r);
397
- return l.addColorStop(0, n), l.addColorStop(1, bt(n, -15)), l;
398
- }, Ot = (n, o, r) => {
401
+ return l.addColorStop(0, n), l.addColorStop(1, vt(n, -15)), l;
402
+ }, Ht = (n, o, r) => {
399
403
  const l = t.createLinearGradient(o, 0, o + r, 0);
400
- return l.addColorStop(0, n), l.addColorStop(1, bt(n, -10)), l;
401
- }, $t = (n, o, r, l, f) => {
402
- if (!f) return;
403
- const h = (n + o) / 2, x = r + l / 2;
404
- t.textAlign = "center", t.font = `${s.fontSize - 1}px system-ui, -apple-system, sans-serif`, t.fillStyle = "#FFFFFF", t.textBaseline = "middle", t.shadowColor = "rgba(0, 0, 0, 0.35)", t.shadowBlur = 3, t.shadowOffsetY = 1, t.fillText(f, h, x), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0;
404
+ return l.addColorStop(0, n), l.addColorStop(1, vt(n, -10)), l;
405
+ }, Yt = (n, o, r, l, p) => {
406
+ if (!p) return;
407
+ const h = (n + o) / 2, f = r + l / 2;
408
+ t.textAlign = "center", t.font = `${s.fontSize - 1}px system-ui, -apple-system, sans-serif`, t.fillStyle = "#FFFFFF", t.textBaseline = "middle", t.shadowColor = "rgba(0, 0, 0, 0.35)", t.shadowBlur = 3, t.shadowOffsetY = 1, t.fillText(p, h, f), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0;
405
409
  };
406
410
  t.lineWidth = 1, t.lineJoin = "round";
407
- const oe = new Date(
408
- Math.min(st.getTime(), C.getTime())
409
- ), Ht = y(oe);
410
- if (Ht > mt) {
411
- const n = Ht - mt;
412
- t.beginPath(), t.globalAlpha = 1, t.fillStyle = we(p.stockPast, N, R), t.strokeStyle = bt(p.stockPast, -20), t.lineWidth = 1.5;
413
- const o = mt, r = N, l = n, f = R, h = 6;
414
- t.moveTo(o + h, r), t.lineTo(o + l, r), t.lineTo(o + l, r + f), t.lineTo(o + h, r + f), t.quadraticCurveTo(o, r + f, o, r + f - h), t.lineTo(o, r + h), t.quadraticCurveTo(o, r, o + h, r), t.fill(), t.stroke(), t.closePath();
415
- const x = Math.max(
411
+ const se = new Date(
412
+ Math.min(at.getTime(), F.getTime())
413
+ ), Nt = y(se);
414
+ if (Nt > ft) {
415
+ const n = Nt - ft;
416
+ t.beginPath(), t.globalAlpha = 1, t.fillStyle = De(m.stockPast, q, X), t.strokeStyle = vt(m.stockPast, -20), t.lineWidth = 1.5;
417
+ const o = ft, r = q, l = n, p = X, h = 6;
418
+ t.moveTo(o + h, r), t.lineTo(o + l, r), t.lineTo(o + l, r + p), t.lineTo(o + h, r + p), t.quadraticCurveTo(o, r + p, o, r + p - h), t.lineTo(o, r + h), t.quadraticCurveTo(o, r, o + h, r), t.fill(), t.stroke(), t.closePath();
419
+ const f = Math.max(
416
420
  0,
417
421
  Math.round(
418
- (oe.getTime() - M.getTime()) / A
422
+ (se.getTime() - z.getTime()) / E
419
423
  )
420
- ), D = `${x} dia${x === 1 ? "" : "s"} consumido${x === 1 ? "" : "s"}`;
421
- $t(
422
- mt,
423
- Ht,
424
- N,
425
- R,
426
- D
424
+ ), k = `${f} dia${f === 1 ? "" : "s"} consumido${f === 1 ? "" : "s"}`;
425
+ Yt(
426
+ ft,
427
+ Nt,
428
+ q,
429
+ X,
430
+ k
427
431
  );
428
432
  }
429
433
  if (j > B) {
430
434
  const n = j - B;
431
- t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ot(
432
- p.stockFuture,
435
+ t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ht(
436
+ m.stockFuture,
433
437
  B,
434
438
  n
435
- ), t.strokeStyle = bt(p.stockFuture, -20), t.lineWidth = 1.5;
436
- const o = B, r = N, l = n, f = R, h = 6;
437
- t.moveTo(o, r), t.lineTo(o + l - h, r), t.quadraticCurveTo(o + l, r, o + l, r + h), t.lineTo(o + l, r + f - h), t.quadraticCurveTo(o + l, r + f, o + l - h, r + f), t.lineTo(o, r + f), t.lineTo(o, r), t.fill(), t.stroke(), t.closePath();
438
- const x = Math.max(
439
+ ), t.strokeStyle = vt(m.stockFuture, -20), t.lineWidth = 1.5;
440
+ const o = B, r = q, l = n, p = X, h = 6;
441
+ t.moveTo(o, r), t.lineTo(o + l - h, r), t.quadraticCurveTo(o + l, r, o + l, r + h), t.lineTo(o + l, r + p - h), t.quadraticCurveTo(o + l, r + p, o + l - h, r + p), t.lineTo(o, r + p), t.lineTo(o, r), t.fill(), t.stroke(), t.closePath();
442
+ const f = Math.max(
439
443
  0,
440
- Math.round((C.getTime() - st.getTime()) / A)
441
- ), D = `${x} dia${x === 1 ? "" : "s"} restante${x === 1 ? "" : "s"}`;
442
- $t(
444
+ Math.round((F.getTime() - at.getTime()) / E)
445
+ ), k = `${f} dia${f === 1 ? "" : "s"} restante${f === 1 ? "" : "s"}`;
446
+ Yt(
443
447
  B,
444
448
  j,
445
- N,
446
- R,
447
- D
449
+ q,
450
+ X,
451
+ k
448
452
  );
449
453
  }
450
- const Q = Math.max(O, j);
451
- if (Y && z > Q && Q >= s.padding.left) {
452
- const n = z - Q;
453
- t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ot(
454
- p.alert,
455
- Q,
454
+ const K = Math.max($, j);
455
+ if (N && _ > K && K >= s.padding.left) {
456
+ const n = _ - K;
457
+ t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ht(
458
+ m.alert,
459
+ K,
456
460
  n
457
- ), t.strokeStyle = bt(p.alert, -20), t.lineWidth = 1.5, t.roundRect(
458
- Q,
459
- _,
461
+ ), t.strokeStyle = vt(m.alert, -20), t.lineWidth = 1.5, t.roundRect(
462
+ K,
463
+ J,
460
464
  n,
461
- R,
465
+ X,
462
466
  6
463
467
  ), t.fill(), t.stroke(), t.closePath();
464
468
  const o = Math.max(
465
469
  0,
466
- Math.round(n / X)
470
+ Math.round(n / A)
467
471
  ), r = `${o} dia${o === 1 ? "" : "s"}`;
468
- $t(
469
- Q,
470
- z,
472
+ Yt(
473
+ K,
471
474
  _,
472
- R,
475
+ J,
476
+ X,
473
477
  r
474
478
  );
475
479
  }
476
- if (typeof m == "number" && m > 0 && typeof w == "number") {
480
+ if (typeof b == "number" && b > 0 && typeof W == "number") {
477
481
  const n = new Date(
478
- Math.max(I.getTime(), C.getTime())
479
- ), o = Math.max(O, j), r = new Date(
480
- n.getTime() + (m - 1) * A
481
- ), l = yt(r), h = y(l) - o;
482
+ Math.max(I.getTime(), F.getTime())
483
+ ), o = Math.max($, j), r = new Date(
484
+ n.getTime() + (b - 1) * E
485
+ ), l = St(r), h = y(l) - o;
482
486
  if (h > 0) {
483
- const x = R * 0.5, D = _ + R + 4;
484
- t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ot(
485
- p.selectedQtyBar,
487
+ const f = X * 0.5, k = J + X + 4;
488
+ t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ht(
489
+ m.selectedQtyBar,
486
490
  o,
487
491
  h
488
- ), t.strokeStyle = bt(
489
- p.selectedQtyBar,
492
+ ), t.strokeStyle = vt(
493
+ m.selectedQtyBar,
490
494
  -20
491
495
  ), t.lineWidth = 1.5, t.roundRect(
492
496
  o,
493
- D,
497
+ k,
494
498
  h,
495
- x,
499
+ f,
496
500
  4
497
501
  ), t.fill(), t.stroke(), t.closePath();
498
502
  }
@@ -500,69 +504,69 @@ function Be({
500
504
  if (T.isHovering && T.hoveredSection) {
501
505
  if (t.save(), t.globalAlpha = 0.18, t.fillStyle = i.config.theme === "dark" ? "#FFFFFF" : "#000000", T.hoveredSection === "stock")
502
506
  t.fillRect(
503
- mt,
504
- N,
505
- j - mt,
506
- R
507
+ ft,
508
+ q,
509
+ j - ft,
510
+ X
507
511
  );
508
- else if (T.hoveredSection === "suggestion" && Y)
512
+ else if (T.hoveredSection === "suggestion" && N)
509
513
  t.fillRect(
510
- Q,
511
- _,
512
- z - Q,
513
- R
514
+ K,
515
+ J,
516
+ _ - K,
517
+ X
514
518
  );
515
- else if (T.hoveredSection === "selectedQty" && typeof m == "number" && m > 0) {
516
- const n = Math.max(O, j), o = new Date(
517
- Math.max(I.getTime(), C.getTime())
519
+ else if (T.hoveredSection === "selectedQty" && typeof b == "number" && b > 0) {
520
+ const n = Math.max($, j), o = new Date(
521
+ Math.max(I.getTime(), F.getTime())
518
522
  ), r = new Date(
519
- o.getTime() + (m - 1) * A
520
- ), l = yt(r), f = y(l), h = R * 0.5, x = _ + R + 4;
523
+ o.getTime() + (b - 1) * E
524
+ ), l = St(r), p = y(l), h = X * 0.5, f = J + X + 4;
521
525
  t.fillRect(
522
526
  n,
523
- x,
524
- f - n,
527
+ f,
528
+ p - n,
525
529
  h
526
530
  );
527
531
  }
528
532
  t.restore();
529
533
  }
530
- const ie = (n, o, r, l) => {
534
+ const re = (n, o, r, l) => {
531
535
  t.font = `bold ${s.pillFontSize}px system-ui, -apple-system, sans-serif`;
532
- const f = t.measureText(r.toUpperCase()), h = s.pillPaddingX;
536
+ const p = t.measureText(r.toUpperCase()), h = s.pillPaddingX;
533
537
  s.pillPaddingY;
534
- const x = s.pillHeight, D = f.width + h * 2;
538
+ const f = s.pillHeight, k = p.width + h * 2;
535
539
  t.shadowColor = "rgba(0, 0, 0, 0.1)", t.shadowBlur = 4, t.shadowOffsetY = 2, t.fillStyle = l, t.beginPath(), t.roundRect(
536
- n - D / 2,
540
+ n - k / 2,
537
541
  o,
538
- D,
539
- x,
540
- x / 2
541
- ), t.fill(), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0, t.fillStyle = "#FFFFFF", t.textAlign = "center", t.textBaseline = "middle", t.fillText(r.toUpperCase(), n, o + x / 2 + 1);
542
+ k,
543
+ f,
544
+ f / 2
545
+ ), t.fill(), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0, t.fillStyle = "#FFFFFF", t.textAlign = "center", t.textBaseline = "middle", t.fillText(r.toUpperCase(), n, o + f / 2 + 1);
542
546
  };
543
- if (B >= s.padding.left && B <= d - s.padding.right) {
544
- const n = B, o = X, r = V, l = u - s.padding.bottom;
545
- t.globalAlpha = 0.12, t.fillStyle = p.todayIndicator, t.fillRect(
547
+ if (B >= s.padding.left && B <= c - s.padding.right) {
548
+ const n = B, o = A, r = Q, l = u - s.padding.bottom;
549
+ t.globalAlpha = 0.12, t.fillStyle = m.todayIndicator, t.fillRect(
546
550
  n,
547
551
  r,
548
552
  o,
549
553
  l - r
550
- ), t.globalAlpha = 1, t.strokeStyle = p.todayIndicator, t.lineWidth = 1.5, t.beginPath(), t.moveTo(n, r), t.lineTo(n, l), t.stroke();
551
- const f = n + o / 2;
552
- ie(
553
- f,
554
+ ), t.globalAlpha = 1, t.strokeStyle = m.todayIndicator, t.lineWidth = 1.5, t.beginPath(), t.moveTo(n, r), t.lineTo(n, l), t.stroke();
555
+ const p = n + o / 2;
556
+ re(
557
+ p,
554
558
  u - s.padding.bottom + 20,
555
559
  "Hoje",
556
- p.todayIndicator
560
+ m.todayIndicator
557
561
  );
558
562
  }
559
- if (O >= s.padding.left && O <= d - s.padding.right && (t.globalAlpha = 1, t.strokeStyle = p.deliveryBar, t.lineWidth = 1.5, t.setLineDash([3, 3]), t.beginPath(), t.moveTo(O, 0), t.lineTo(O, u - s.padding.bottom), t.stroke(), t.setLineDash([]), ie(
560
- O,
563
+ if ($ >= s.padding.left && $ <= c - s.padding.right && (t.globalAlpha = 1, t.strokeStyle = m.deliveryBar, t.lineWidth = 1.5, t.setLineDash([3, 3]), t.beginPath(), t.moveTo($, 0), t.lineTo($, u - s.padding.bottom), t.stroke(), t.setLineDash([]), re(
564
+ $,
561
565
  u - s.padding.bottom + 20,
562
566
  "Entrega",
563
- p.deliveryBar
564
- )), Y) {
565
- const n = s.fontSize + 6, o = Q + X / 2 - n / 2, r = _ - n - 4, l = H.status === "critical" ? p.alertCritical : H.status === "urgent" ? p.alertUrgent : H.status === "warning" ? p.alertWarning : H.status === "success" ? p.alertSuccess : p.alertInfo;
567
+ m.deliveryBar
568
+ )), N) {
569
+ const n = s.fontSize + 6, o = K + A / 2 - n / 2, r = J - n - 4, l = Y.status === "critical" ? m.alertCritical : Y.status === "urgent" ? m.alertUrgent : Y.status === "warning" ? m.alertWarning : Y.status === "success" ? m.alertSuccess : m.alertInfo;
566
570
  t.beginPath(), t.arc(
567
571
  o + n / 2,
568
572
  r + n / 2,
@@ -570,9 +574,9 @@ function Be({
570
574
  0,
571
575
  Math.PI * 2
572
576
  ), t.fillStyle = l, t.fill(), t.shadowColor = "rgba(0, 0, 0, 0.2)", t.shadowBlur = 4, t.shadowOffsetY = 2, t.fillStyle = "#FFFFFF", t.font = `bold ${n * 0.6}px system-ui, -apple-system, sans-serif`, t.textAlign = "center", t.textBaseline = "middle";
573
- const f = H.status === "critical" || H.status === "urgent" || H.status === "warning" ? "!" : H.status === "success" ? "✓" : "i";
577
+ const p = Y.status === "critical" || Y.status === "urgent" || Y.status === "warning" ? "!" : Y.status === "success" ? "✓" : "i";
574
578
  t.fillText(
575
- f,
579
+ p,
576
580
  o + n / 2,
577
581
  r + n / 2
578
582
  ), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0;
@@ -581,215 +585,216 @@ function Be({
581
585
  }, [
582
586
  i,
583
587
  y,
584
- M,
585
- st,
586
- C,
587
- Vt,
588
- U,
588
+ z,
589
+ P,
590
+ at,
591
+ F,
592
+ Qt,
593
+ V,
589
594
  I,
590
- p,
595
+ m,
591
596
  s,
592
597
  T,
598
+ E,
593
599
  A,
594
- X,
595
- w,
596
- m,
597
- H,
598
- vt,
599
- Y
600
- ]), Qt = P(
600
+ W,
601
+ b,
602
+ Y,
603
+ Tt,
604
+ N
605
+ ]), Kt = L(
601
606
  (e, t) => {
602
- const g = ot.current;
607
+ const g = st.current;
603
608
  if (!g) return null;
604
- const F = g.getBoundingClientRect(), d = e - F.left, u = t - F.top, W = s.padding.top, B = s.height - s.padding.top - s.padding.bottom, j = B * s.segmentRatio, O = W + 5, z = O + j + 2, V = z + j + 4, It = j * 0.5, R = y(M);
605
- y(st);
606
- const N = y(C), _ = y(I), wt = y(U), gt = Math.max(_, N);
607
- if (Y) {
608
- const $ = s.fontSize + 6, ut = gt + X / 2 - $ / 2, kt = z - $ - 4;
609
+ const D = g.getBoundingClientRect(), c = e - D.left, u = t - D.top, O = s.padding.top, B = s.height - s.padding.top - s.padding.bottom, j = B * s.segmentRatio, $ = O + 5, _ = $ + j + 2, Q = _ + j + 4, Ot = j * 0.5, X = y(z);
610
+ y(at);
611
+ const q = y(F), J = y(I), Dt = y(V), ht = Math.max(J, q);
612
+ if (N) {
613
+ const H = s.fontSize + 6, mt = ht + A / 2 - H / 2, Mt = _ - H - 4;
609
614
  if (Math.sqrt(
610
- Math.pow(d - (ut + $ / 2), 2) + Math.pow(u - (kt + $ / 2), 2)
611
- ) <= $ / 2 + 4)
615
+ Math.pow(c - (mt + H / 2), 2) + Math.pow(u - (Mt + H / 2), 2)
616
+ ) <= H / 2 + 4)
612
617
  return "alertIcon";
613
618
  }
614
- if (u < W || u > W + B + It + 10)
619
+ if (u < O || u > O + B + Ot + 10)
615
620
  return null;
616
- if (typeof m == "number" && m > 0 && typeof w == "number") {
617
- const $ = Math.max(_, N), ut = new Date(
618
- Math.max(I.getTime(), C.getTime())
619
- ), kt = new Date(
620
- ut.getTime() + (m - 1) * A
621
- ), Dt = yt(kt), Mt = y(Dt);
622
- if (u >= V && u <= V + It && d >= $ && d <= Mt)
621
+ if (typeof b == "number" && b > 0 && typeof W == "number") {
622
+ const H = Math.max(J, q), mt = new Date(
623
+ Math.max(I.getTime(), F.getTime())
624
+ ), Mt = new Date(
625
+ mt.getTime() + (b - 1) * E
626
+ ), Ft = St(Mt), Ct = y(Ft);
627
+ if (u >= Q && u <= Q + Ot && c >= H && c <= Ct)
623
628
  return "selectedQty";
624
629
  }
625
- return u >= O && u <= O + j && d >= R && d <= N ? "stock" : Y && u >= z && u <= z + j && d >= gt && d <= wt ? "suggestion" : null;
630
+ return u >= $ && u <= $ + j && c >= X && c <= q ? "stock" : N && u >= _ && u <= _ + j && c >= ht && c <= Dt ? "suggestion" : null;
626
631
  },
627
632
  [
628
633
  y,
629
- st,
630
- C,
631
- U,
632
- M,
634
+ at,
635
+ F,
636
+ V,
637
+ z,
633
638
  I,
634
639
  s,
635
- w,
636
- m,
637
- X,
640
+ W,
641
+ b,
638
642
  A,
639
- Y
643
+ E,
644
+ N
640
645
  ]
641
- ), Jt = L(() => {
646
+ ), Zt = R(() => {
642
647
  let e = Math.max(
643
- U.getTime(),
648
+ V.getTime(),
644
649
  I.getTime(),
645
- C.getTime()
650
+ F.getTime()
646
651
  );
647
- if (typeof m == "number" && m > 0) {
652
+ if (typeof b == "number" && b > 0) {
648
653
  const g = new Date(
649
- Math.max(I.getTime(), C.getTime())
650
- ), F = new Date(
651
- g.getTime() + (m - 1) * A
652
- ), d = yt(F);
653
- e = Math.max(e, d.getTime());
654
+ Math.max(I.getTime(), F.getTime())
655
+ ), D = new Date(
656
+ g.getTime() + (b - 1) * E
657
+ ), c = St(D);
658
+ e = Math.max(e, c.getTime());
654
659
  }
655
660
  const t = new Date(e);
656
661
  return t.setDate(t.getDate() + 2), t;
657
- }, [U, I, C, m, A]), Kt = L(() => Math.ceil(
658
- (Jt.getTime() - M.getTime()) / A
659
- ), [Jt, M, A]), rt = L(() => s.padding.left + Kt * X + s.padding.right, [
660
- Kt,
661
- X,
662
+ }, [V, I, F, b, E]), te = R(() => Math.ceil(
663
+ (Zt.getTime() - P.getTime()) / E
664
+ ), [Zt, P, E]), lt = R(() => s.padding.left + te * A + s.padding.right, [
665
+ te,
666
+ A,
662
667
  s.padding.left,
663
668
  s.padding.right
664
- ]), [Z, ue] = J(0);
665
- xt(() => {
669
+ ]), [et, me] = Z(0);
670
+ yt(() => {
666
671
  const e = () => {
667
- ot.current && ue(ot.current.getBoundingClientRect().width);
672
+ st.current && me(st.current.getBoundingClientRect().width);
668
673
  };
669
674
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
670
675
  }, []);
671
- const k = L(() => Z === 0 ? 0 : Math.max(0, rt - Z), [rt, Z]), Zt = et(null), [Ct, at] = J(!1), G = et(!1), lt = et(0), ct = et(0), [Et, At] = J(!1), dt = et(!1), he = P(
676
+ const w = R(() => et === 0 ? 0 : Math.max(0, lt - et), [lt, et]), ee = ot(null), [At, ct] = Z(!1), U = ot(!1), dt = ot(0), gt = ot(0), [Xt, Rt] = Z(!1), ut = ot(!1), pe = L(
672
677
  (e) => {
673
- e.preventDefault(), G.current = !0, at(!0), lt.current = e.clientX, ct.current = q;
678
+ e.preventDefault(), U.current = !0, ct(!0), dt.current = e.clientX, gt.current = G;
674
679
  },
675
- [q]
676
- ), me = P(
680
+ [G]
681
+ ), fe = L(
677
682
  (e) => {
678
- e.touches.length === 1 && (e.preventDefault(), G.current = !0, at(!0), lt.current = e.touches[0].clientX, ct.current = q);
683
+ e.touches.length === 1 && (e.preventDefault(), U.current = !0, ct(!0), dt.current = e.touches[0].clientX, gt.current = G);
679
684
  },
680
- [q]
681
- ), pe = P(
685
+ [G]
686
+ ), xe = L(
682
687
  (e) => {
683
- const t = ot.current;
688
+ const t = st.current;
684
689
  if (!t) return;
685
- if (G.current && k > 0) {
686
- const W = lt.current - e.clientX, B = ct.current + W;
687
- it(Math.max(0, Math.min(k, B)));
690
+ if (U.current && w > 0) {
691
+ const O = dt.current - e.clientX, B = gt.current + O;
692
+ rt(Math.max(0, Math.min(w, B)));
688
693
  return;
689
694
  }
690
- const g = t.getBoundingClientRect(), F = e.clientX - g.left, d = Qt(e.clientX, e.clientY), u = _t(F);
691
- Nt({
695
+ const g = t.getBoundingClientRect(), D = e.clientX - g.left, c = Kt(e.clientX, e.clientY), u = Jt(D);
696
+ Gt({
692
697
  isHovering: !0,
693
- hoveredSection: d,
698
+ hoveredSection: c,
694
699
  mouseX: e.clientX,
695
700
  mouseY: e.clientY,
696
701
  dateAtCursor: u
697
- }), le({ x: e.clientX, y: e.clientY });
702
+ }), de({ x: e.clientX, y: e.clientY });
698
703
  },
699
- [Qt, _t, k]
700
- ), fe = P(() => {
701
- Nt({
704
+ [Kt, Jt, w]
705
+ ), be = L(() => {
706
+ Gt({
702
707
  isHovering: !1,
703
708
  hoveredSection: null,
704
709
  mouseX: 0,
705
710
  mouseY: 0,
706
711
  dateAtCursor: null
707
712
  });
708
- }, []), xe = P(() => {
709
- G.current = !1, at(!1);
710
- }, []), be = P(
713
+ }, []), ye = L(() => {
714
+ U.current = !1, ct(!1);
715
+ }, []), ve = L(
711
716
  (e) => {
712
- if (e.touches.length === 1 && G.current && k > 0) {
717
+ if (e.touches.length === 1 && U.current && w > 0) {
713
718
  e.preventDefault();
714
- const t = lt.current - e.touches[0].clientX, g = ct.current + t;
715
- it(Math.max(0, Math.min(k, g)));
719
+ const t = dt.current - e.touches[0].clientX, g = gt.current + t;
720
+ rt(Math.max(0, Math.min(w, g)));
716
721
  }
717
722
  },
718
- [k]
719
- ), ye = P(() => {
720
- G.current = !1, at(!1);
723
+ [w]
724
+ ), Se = L(() => {
725
+ U.current = !1, ct(!1);
721
726
  }, []);
722
- xt(() => {
723
- const e = (d) => {
724
- if (G.current && k > 0) {
725
- const u = lt.current - d.clientX, W = ct.current + u;
726
- it(Math.max(0, Math.min(k, W)));
727
+ yt(() => {
728
+ const e = (c) => {
729
+ if (U.current && w > 0) {
730
+ const u = dt.current - c.clientX, O = gt.current + u;
731
+ rt(Math.max(0, Math.min(w, O)));
727
732
  }
728
733
  }, t = () => {
729
- G.current = !1, at(!1);
730
- }, g = (d) => {
731
- if (d.touches.length === 1 && G.current && k > 0) {
732
- d.preventDefault();
733
- const u = lt.current - d.touches[0].clientX, W = ct.current + u;
734
- it(Math.max(0, Math.min(k, W)));
734
+ U.current = !1, ct(!1);
735
+ }, g = (c) => {
736
+ if (c.touches.length === 1 && U.current && w > 0) {
737
+ c.preventDefault();
738
+ const u = dt.current - c.touches[0].clientX, O = gt.current + u;
739
+ rt(Math.max(0, Math.min(w, O)));
735
740
  }
736
- }, F = () => {
737
- G.current = !1, at(!1);
741
+ }, D = () => {
742
+ U.current = !1, ct(!1);
738
743
  };
739
- return Ct && (window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), window.addEventListener("touchmove", g, {
744
+ return At && (window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), window.addEventListener("touchmove", g, {
740
745
  passive: !1
741
- }), window.addEventListener("touchend", F)), () => {
742
- window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", F);
746
+ }), window.addEventListener("touchend", D)), () => {
747
+ window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", D);
743
748
  };
744
- }, [Ct, k]);
745
- const Pt = P(
749
+ }, [At, w]);
750
+ const Wt = L(
746
751
  (e) => {
747
- const t = Zt.current;
748
- if (!t || k <= 0) return;
749
- const g = t.getBoundingClientRect(), F = g.width, d = Z / rt * F, u = F - d;
752
+ const t = ee.current;
753
+ if (!t || w <= 0) return;
754
+ const g = t.getBoundingClientRect(), D = g.width, c = et / lt * D, u = D - c;
750
755
  if (u <= 0) return;
751
- const B = e - g.left - d / 2, j = Math.max(0, Math.min(1, B / u));
752
- it(j * k);
756
+ const B = e - g.left - c / 2, j = Math.max(0, Math.min(1, B / u));
757
+ rt(j * w);
753
758
  },
754
- [k, Z, rt]
755
- ), ve = P((e) => {
756
- e.preventDefault(), e.stopPropagation(), dt.current = !0, At(!0);
757
- }, []), Se = P((e) => {
758
- e.stopPropagation(), e.touches.length === 1 && (dt.current = !0, At(!0));
759
+ [w, et, lt]
760
+ ), Te = L((e) => {
761
+ e.preventDefault(), e.stopPropagation(), ut.current = !0, Rt(!0);
762
+ }, []), we = L((e) => {
763
+ e.stopPropagation(), e.touches.length === 1 && (ut.current = !0, Rt(!0));
759
764
  }, []);
760
- return xt(() => {
761
- const e = (d) => {
762
- dt.current && Pt(d.clientX);
765
+ return yt(() => {
766
+ const e = (c) => {
767
+ ut.current && Wt(c.clientX);
763
768
  }, t = () => {
764
- dt.current = !1, At(!1);
765
- }, g = (d) => {
766
- d.touches.length === 1 && dt.current && (d.preventDefault(), Pt(d.touches[0].clientX));
767
- }, F = () => {
768
- dt.current = !1, At(!1);
769
+ ut.current = !1, Rt(!1);
770
+ }, g = (c) => {
771
+ c.touches.length === 1 && ut.current && (c.preventDefault(), Wt(c.touches[0].clientX));
772
+ }, D = () => {
773
+ ut.current = !1, Rt(!1);
769
774
  };
770
- return Et && (window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), window.addEventListener("touchmove", g, {
775
+ return Xt && (window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), window.addEventListener("touchmove", g, {
771
776
  passive: !1
772
- }), window.addEventListener("touchend", F)), () => {
773
- window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", F);
777
+ }), window.addEventListener("touchend", D)), () => {
778
+ window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", D);
774
779
  };
775
- }, [Et, Pt]), xt(() => {
776
- Tt();
777
- }, [Tt]), xt(() => {
780
+ }, [Xt, Wt]), yt(() => {
781
+ kt();
782
+ }, [kt]), yt(() => {
778
783
  const e = () => {
779
- Tt();
784
+ kt();
780
785
  };
781
786
  window.addEventListener("resize", e);
782
787
  const t = new ResizeObserver(() => {
783
- Tt();
788
+ kt();
784
789
  });
785
- return jt.current && t.observe(jt.current), () => {
790
+ return Pt.current && t.observe(Pt.current), () => {
786
791
  window.removeEventListener("resize", e), t.disconnect();
787
792
  };
788
- }, [Tt]), /* @__PURE__ */ a.jsxs(
793
+ }, [kt]), /* @__PURE__ */ a.jsxs(
789
794
  "div",
790
795
  {
791
- ref: jt,
792
- className: b,
796
+ ref: Pt,
797
+ className: x,
793
798
  style: {
794
799
  position: "relative",
795
800
  width: "100%",
@@ -806,7 +811,7 @@ function Be({
806
811
  style: {
807
812
  display: "flex",
808
813
  justifyContent: "flex-end",
809
- gap: c === "sm" ? 6 : 8,
814
+ gap: d === "sm" ? 6 : 8,
810
815
  paddingBottom: 8,
811
816
  paddingRight: s.padding.right
812
817
  },
@@ -815,19 +820,19 @@ function Be({
815
820
  "button",
816
821
  {
817
822
  type: "button",
818
- onClick: () => Ut((e) => Math.max(0, e - 1)),
823
+ onClick: () => Vt((e) => Math.max(0, e - 1)),
819
824
  style: {
820
- width: c === "sm" ? 36 : 44,
821
- height: c === "sm" ? 36 : 44,
822
- minWidth: c === "sm" ? 36 : 44,
823
- minHeight: c === "sm" ? 36 : 44,
825
+ width: d === "sm" ? 36 : 44,
826
+ height: d === "sm" ? 36 : 44,
827
+ minWidth: d === "sm" ? 36 : 44,
828
+ minHeight: d === "sm" ? 36 : 44,
824
829
  borderRadius: 999,
825
830
  border: "1px solid rgba(0,0,0,0.16)",
826
831
  background: i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)",
827
832
  display: "flex",
828
833
  alignItems: "center",
829
834
  justifyContent: "center",
830
- fontSize: c === "sm" ? 16 : 18,
835
+ fontSize: d === "sm" ? 16 : 18,
831
836
  cursor: "pointer",
832
837
  boxShadow: "0 1px 2px rgba(0,0,0,0.25)",
833
838
  touchAction: "manipulation",
@@ -840,21 +845,21 @@ function Be({
840
845
  "button",
841
846
  {
842
847
  type: "button",
843
- onClick: () => Ut(
844
- (e) => Math.min(Lt.length - 1, e + 1)
848
+ onClick: () => Vt(
849
+ (e) => Math.min(It.length - 1, e + 1)
845
850
  ),
846
851
  style: {
847
- width: c === "sm" ? 36 : 44,
848
- height: c === "sm" ? 36 : 44,
849
- minWidth: c === "sm" ? 36 : 44,
850
- minHeight: c === "sm" ? 36 : 44,
852
+ width: d === "sm" ? 36 : 44,
853
+ height: d === "sm" ? 36 : 44,
854
+ minWidth: d === "sm" ? 36 : 44,
855
+ minHeight: d === "sm" ? 36 : 44,
851
856
  borderRadius: 999,
852
857
  border: "1px solid rgba(0,0,0,0.16)",
853
858
  background: i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)",
854
859
  display: "flex",
855
860
  alignItems: "center",
856
861
  justifyContent: "center",
857
- fontSize: c === "sm" ? 16 : 18,
862
+ fontSize: d === "sm" ? 16 : 18,
858
863
  cursor: "pointer",
859
864
  boxShadow: "0 1px 2px rgba(0,0,0,0.25)",
860
865
  touchAction: "manipulation",
@@ -863,59 +868,59 @@ function Be({
863
868
  children: "+"
864
869
  }
865
870
  ),
866
- /* @__PURE__ */ a.jsx(
871
+ !C && /* @__PURE__ */ a.jsx(
867
872
  "button",
868
873
  {
869
874
  type: "button",
870
- onClick: () => zt((e) => !e),
875
+ onClick: () => _t((e) => !e),
871
876
  style: {
872
- width: c === "sm" ? 36 : 44,
873
- height: c === "sm" ? 36 : 44,
874
- minWidth: c === "sm" ? 36 : 44,
875
- minHeight: c === "sm" ? 36 : 44,
877
+ width: d === "sm" ? 36 : 44,
878
+ height: d === "sm" ? 36 : 44,
879
+ minWidth: d === "sm" ? 36 : 44,
880
+ minHeight: d === "sm" ? 36 : 44,
876
881
  borderRadius: 999,
877
882
  border: "1px solid rgba(0,0,0,0.16)",
878
- background: Y ? i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)" : i.config.theme === "dark" ? "rgba(0,0,0,0.7)" : "rgba(0,0,0,0.5)",
883
+ background: N ? i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)" : i.config.theme === "dark" ? "rgba(0,0,0,0.7)" : "rgba(0,0,0,0.5)",
879
884
  display: "flex",
880
885
  alignItems: "center",
881
886
  justifyContent: "center",
882
- fontSize: c === "sm" ? 14 : 16,
887
+ fontSize: d === "sm" ? 14 : 16,
883
888
  cursor: "pointer",
884
889
  boxShadow: "0 1px 2px rgba(0,0,0,0.25)",
885
- color: Y ? i.config.theme === "dark" ? "#ECEFF1" : "#263238" : "#FFFFFF",
890
+ color: N ? i.config.theme === "dark" ? "#ECEFF1" : "#263238" : "#FFFFFF",
886
891
  fontWeight: "bold",
887
892
  touchAction: "manipulation",
888
893
  WebkitTapHighlightColor: "transparent"
889
894
  },
890
- title: Y ? "Ocultar barra de sugestão de compra" : "Mostrar barra de sugestão de compra",
895
+ title: N ? "Ocultar barra de sugestão de compra" : "Mostrar barra de sugestão de compra",
891
896
  children: "S"
892
897
  }
893
898
  ),
894
- i.timeline.dailyConsumptionAverage && /* @__PURE__ */ a.jsx(
899
+ !C && i.timeline.dailyConsumptionAverage && /* @__PURE__ */ a.jsx(
895
900
  "button",
896
901
  {
897
902
  type: "button",
898
- onClick: () => ce((e) => !e),
903
+ onClick: () => ge((e) => !e),
899
904
  style: {
900
- width: c === "sm" ? 36 : 44,
901
- height: c === "sm" ? 36 : 44,
902
- minWidth: c === "sm" ? 36 : 44,
903
- minHeight: c === "sm" ? 36 : 44,
905
+ width: d === "sm" ? 36 : 44,
906
+ height: d === "sm" ? 36 : 44,
907
+ minWidth: d === "sm" ? 36 : 44,
908
+ minHeight: d === "sm" ? 36 : 44,
904
909
  borderRadius: 999,
905
910
  border: "1px solid rgba(0,0,0,0.16)",
906
- background: vt ? i.config.theme === "dark" ? "rgba(0,0,0,0.7)" : "rgba(0,0,0,0.5)" : i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)",
911
+ background: Tt ? i.config.theme === "dark" ? "rgba(0,0,0,0.7)" : "rgba(0,0,0,0.5)" : i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)",
907
912
  display: "flex",
908
913
  alignItems: "center",
909
914
  justifyContent: "center",
910
- fontSize: c === "sm" ? 14 : 16,
915
+ fontSize: d === "sm" ? 14 : 16,
911
916
  cursor: "pointer",
912
917
  boxShadow: "0 1px 2px rgba(0,0,0,0.25)",
913
- color: vt ? "#FFFFFF" : i.config.theme === "dark" ? "#ECEFF1" : "#263238",
918
+ color: Tt ? "#FFFFFF" : i.config.theme === "dark" ? "#ECEFF1" : "#263238",
914
919
  fontWeight: "bold",
915
920
  touchAction: "manipulation",
916
921
  WebkitTapHighlightColor: "transparent"
917
922
  },
918
- title: vt ? "Ocultar linha de consumo" : "Mostrar linha de consumo",
923
+ title: Tt ? "Ocultar linha de consumo" : "Mostrar linha de consumo",
919
924
  children: "C"
920
925
  }
921
926
  )
@@ -928,33 +933,33 @@ function Be({
928
933
  style: {
929
934
  position: "relative",
930
935
  width: "100%",
931
- minHeight: k > 0 ? s.height + 8 + 15 : s.height
936
+ minHeight: w > 0 ? s.height + 8 + 15 : s.height
932
937
  },
933
938
  children: [
934
939
  /* @__PURE__ */ a.jsx(
935
940
  "canvas",
936
941
  {
937
- ref: ot,
938
- onMouseMove: pe,
939
- onMouseLeave: fe,
940
- onMouseDown: he,
941
- onMouseUp: xe,
942
- onTouchStart: me,
943
- onTouchMove: be,
944
- onTouchEnd: ye,
942
+ ref: st,
943
+ onMouseMove: xe,
944
+ onMouseLeave: be,
945
+ onMouseDown: pe,
946
+ onMouseUp: ye,
947
+ onTouchStart: fe,
948
+ onTouchMove: ve,
949
+ onTouchEnd: Se,
945
950
  style: {
946
951
  width: "100%",
947
952
  height: `${s.height}px`,
948
953
  display: "block",
949
- cursor: k > 0 ? Ct ? "grabbing" : "grab" : "pointer",
954
+ cursor: w > 0 ? At ? "grabbing" : "grab" : "pointer",
950
955
  touchAction: "pan-x"
951
956
  }
952
957
  }
953
958
  ),
954
- k > 0 && /* @__PURE__ */ a.jsx(
959
+ w > 0 && /* @__PURE__ */ a.jsx(
955
960
  "div",
956
961
  {
957
- ref: Zt,
962
+ ref: ee,
958
963
  style: {
959
964
  position: "absolute",
960
965
  top: s.height + 8,
@@ -969,30 +974,30 @@ function Be({
969
974
  },
970
975
  onClick: (e) => {
971
976
  if (e.target !== e.currentTarget) return;
972
- const t = e.currentTarget.getBoundingClientRect(), F = (e.clientX - t.left) / t.width;
973
- it(F * k);
977
+ const t = e.currentTarget.getBoundingClientRect(), D = (e.clientX - t.left) / t.width;
978
+ rt(D * w);
974
979
  },
975
980
  children: /* @__PURE__ */ a.jsx(
976
981
  "div",
977
982
  {
978
983
  role: "slider",
979
- "aria-valuenow": q,
984
+ "aria-valuenow": G,
980
985
  "aria-valuemin": 0,
981
- "aria-valuemax": k,
982
- onMouseDown: ve,
983
- onTouchStart: Se,
986
+ "aria-valuemax": w,
987
+ onMouseDown: Te,
988
+ onTouchStart: we,
984
989
  style: {
985
990
  position: "absolute",
986
991
  top: "50%",
987
992
  transform: "translateY(-50%)",
988
- width: `${Math.max(10, Z / rt * 100)}%`,
989
- left: `${k > 0 ? q / k * (100 - Math.max(10, Z / rt * 100)) : 0}%`,
993
+ width: `${Math.max(10, et / lt * 100)}%`,
994
+ left: `${w > 0 ? G / w * (100 - Math.max(10, et / lt * 100)) : 0}%`,
990
995
  maxWidth: "100%",
991
996
  height: 9,
992
997
  backgroundColor: i.config.theme === "dark" ? "rgba(255,255,255,0.4)" : "rgba(0,0,0,0.3)",
993
998
  borderRadius: 4.5,
994
- cursor: Et ? "grabbing" : "grab",
995
- transition: Ct || Et ? "none" : "left 0.1s ease-out"
999
+ cursor: Xt ? "grabbing" : "grab",
1000
+ transition: At || Xt ? "none" : "left 0.1s ease-out"
996
1001
  }
997
1002
  }
998
1003
  )
@@ -1001,16 +1006,16 @@ function Be({
1001
1006
  ]
1002
1007
  }
1003
1008
  ),
1004
- T.isHovering && (T.dateAtCursor || T.hoveredSection === "alertIcon") && typeof document < "u" && De(
1009
+ T.isHovering && (T.dateAtCursor || T.hoveredSection === "alertIcon") && typeof document < "u" && Fe(
1005
1010
  /* @__PURE__ */ a.jsx(
1006
1011
  "div",
1007
1012
  {
1008
1013
  style: {
1009
1014
  position: "fixed",
1010
- left: `${qt.x}px`,
1011
- top: `${qt.y}px`,
1012
- backgroundColor: p.tooltipBackground,
1013
- color: p.tooltipText,
1015
+ left: `${Ut.x}px`,
1016
+ top: `${Ut.y}px`,
1017
+ backgroundColor: m.tooltipBackground,
1018
+ color: m.tooltipText,
1014
1019
  padding: "6px 10px",
1015
1020
  borderRadius: "6px",
1016
1021
  fontSize: "10px",
@@ -1021,40 +1026,40 @@ function Be({
1021
1026
  whiteSpace: "nowrap"
1022
1027
  },
1023
1028
  children: T.hoveredSection === "alertIcon" ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
1024
- /* @__PURE__ */ a.jsx("div", { style: { fontWeight: "bold", marginBottom: "4px" }, children: H.title }),
1025
- /* @__PURE__ */ a.jsx("div", { children: H.message })
1029
+ /* @__PURE__ */ a.jsx("div", { style: { fontWeight: "bold", marginBottom: "4px" }, children: Y.title }),
1030
+ /* @__PURE__ */ a.jsx("div", { children: Y.message })
1026
1031
  ] }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
1027
- /* @__PURE__ */ a.jsx("div", { style: { fontWeight: "bold", marginBottom: "4px" }, children: T.dateAtCursor && ge(T.dateAtCursor) }),
1032
+ /* @__PURE__ */ a.jsx("div", { style: { fontWeight: "bold", marginBottom: "4px" }, children: T.dateAtCursor && he(T.dateAtCursor) }),
1028
1033
  T.dateAtCursor && !T.hoveredSection && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
1029
- /* @__PURE__ */ a.jsx("div", { style: { marginBottom: 2 }, children: re[T.dateAtCursor.getDay()] }),
1034
+ /* @__PURE__ */ a.jsx("div", { style: { marginBottom: 2 }, children: le[T.dateAtCursor.getDay()] }),
1030
1035
  /* @__PURE__ */ a.jsxs("div", { children: [
1031
1036
  "Consumo médio:",
1032
1037
  " ",
1033
1038
  (() => {
1034
- const e = T.dateAtCursor.getDay(), t = ae(e);
1039
+ const e = T.dateAtCursor.getDay(), t = ce(e);
1035
1040
  return t !== null ? `${t.toFixed(2)}` : "0.0";
1036
1041
  })()
1037
1042
  ] })
1038
1043
  ] }),
1039
1044
  T.hoveredSection === "stock" && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
1040
1045
  /* @__PURE__ */ a.jsxs("div", { style: { marginBottom: 2 }, children: [
1041
- St(M),
1046
+ wt(z),
1042
1047
  " —",
1043
1048
  " ",
1044
- St(C)
1049
+ wt(F)
1045
1050
  ] }),
1046
1051
  /* @__PURE__ */ a.jsxs("div", { children: [
1047
1052
  "Estoque disponível até ",
1048
- St(C)
1053
+ wt(F)
1049
1054
  ] }),
1050
1055
  /* @__PURE__ */ a.jsx("div", { style: { marginTop: 2 }, children: (() => {
1051
1056
  const e = Math.max(
1052
1057
  0,
1053
1058
  Math.round(
1054
- (C.getTime() - M.getTime()) / A
1059
+ (F.getTime() - z.getTime()) / E
1055
1060
  )
1056
1061
  ), t = i.timeline.stockWeightKg ?? i.timeline.restockSuggestionWeight;
1057
- return `${e} dia(s) de estoque${t ? ` • ${t} ${Ft}` : ""}`;
1062
+ return `${e} dia(s) de estoque${t ? ` • ${t} ${Et}` : ""}`;
1058
1063
  })() })
1059
1064
  ] }),
1060
1065
  T.hoveredSection === "suggestion" && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
@@ -1062,43 +1067,43 @@ function Be({
1062
1067
  const e = new Date(
1063
1068
  Math.max(
1064
1069
  I.getTime(),
1065
- C.getTime()
1070
+ F.getTime()
1066
1071
  )
1067
1072
  );
1068
- return `${St(e)} — ${St(U)}`;
1073
+ return `${wt(e)} — ${wt(V)}`;
1069
1074
  })() }),
1070
1075
  /* @__PURE__ */ a.jsx("div", { children: "Período crítico para compra" }),
1071
1076
  /* @__PURE__ */ a.jsx("div", { style: { marginTop: 2 }, children: (() => {
1072
1077
  const e = new Date(
1073
1078
  Math.max(
1074
1079
  I.getTime(),
1075
- C.getTime()
1080
+ F.getTime()
1076
1081
  )
1077
1082
  ), t = Math.max(
1078
1083
  0,
1079
1084
  Math.round(
1080
- (U.getTime() - e.getTime()) / A
1085
+ (V.getTime() - e.getTime()) / E
1081
1086
  )
1082
1087
  ), g = i.timeline.restockSuggestionWeight;
1083
- return `${t} dia(s) de sugestão${g ? ` • ${g} ${Ft}` : ""}`;
1088
+ return `${t} dia(s) de sugestão${g ? ` • ${g} ${Et}` : ""}`;
1084
1089
  })() })
1085
1090
  ] }),
1086
- T.hoveredSection === "selectedQty" && typeof w == "number" && typeof m == "number" && /* @__PURE__ */ a.jsxs("div", { children: [
1091
+ T.hoveredSection === "selectedQty" && typeof W == "number" && typeof b == "number" && /* @__PURE__ */ a.jsxs("div", { children: [
1087
1092
  "O estoque selecionado de ",
1088
- w,
1093
+ W,
1089
1094
  " deve durar",
1090
1095
  " ",
1091
- m % 1 === 0 ? m : m.toFixed(1),
1096
+ b % 1 === 0 ? b : b.toFixed(1),
1092
1097
  " ",
1093
1098
  "dia",
1094
- m === 1 ? "" : "s"
1099
+ b === 1 ? "" : "s"
1095
1100
  ] })
1096
1101
  ] })
1097
1102
  }
1098
1103
  ),
1099
1104
  document.body
1100
1105
  ),
1101
- E && /* @__PURE__ */ a.jsxs(
1106
+ M && /* @__PURE__ */ a.jsxs(
1102
1107
  "div",
1103
1108
  {
1104
1109
  style: {
@@ -1107,12 +1112,12 @@ function Be({
1107
1112
  flexWrap: "wrap",
1108
1113
  justifyContent: "flex-end",
1109
1114
  gap: "8px",
1110
- backgroundColor: p.legendBackground,
1115
+ backgroundColor: m.legendBackground,
1111
1116
  padding: "8px 10px",
1112
1117
  marginTop: "8px",
1113
1118
  borderRadius: "4px",
1114
1119
  fontSize: "10px",
1115
- color: p.textPrimary
1120
+ color: m.textPrimary
1116
1121
  },
1117
1122
  children: [
1118
1123
  /* @__PURE__ */ a.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
@@ -1122,7 +1127,7 @@ function Be({
1122
1127
  style: {
1123
1128
  width: "10px",
1124
1129
  height: "10px",
1125
- backgroundColor: p.stockPast,
1130
+ backgroundColor: m.stockPast,
1126
1131
  borderRadius: "2px"
1127
1132
  }
1128
1133
  }
@@ -1136,21 +1141,21 @@ function Be({
1136
1141
  style: {
1137
1142
  width: "10px",
1138
1143
  height: "10px",
1139
- backgroundColor: p.stockFuture,
1144
+ backgroundColor: m.stockFuture,
1140
1145
  borderRadius: "2px"
1141
1146
  }
1142
1147
  }
1143
1148
  ),
1144
1149
  /* @__PURE__ */ a.jsx("span", { children: "Previsão Estoque" })
1145
1150
  ] }),
1146
- Y && /* @__PURE__ */ a.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
1151
+ N && /* @__PURE__ */ a.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
1147
1152
  /* @__PURE__ */ a.jsx(
1148
1153
  "div",
1149
1154
  {
1150
1155
  style: {
1151
1156
  width: "10px",
1152
1157
  height: "10px",
1153
- backgroundColor: p.alert,
1158
+ backgroundColor: m.alert,
1154
1159
  borderRadius: "2px"
1155
1160
  }
1156
1161
  }
@@ -1164,7 +1169,7 @@ function Be({
1164
1169
  style: {
1165
1170
  width: "2px",
1166
1171
  height: "10px",
1167
- borderLeft: `2px dashed ${p.deliveryBar}`,
1172
+ borderLeft: `2px dashed ${m.deliveryBar}`,
1168
1173
  marginLeft: "4px",
1169
1174
  marginRight: "4px"
1170
1175
  }
@@ -1172,7 +1177,7 @@ function Be({
1172
1177
  ),
1173
1178
  /* @__PURE__ */ a.jsx("span", { children: "Data Entrega" })
1174
1179
  ] }),
1175
- typeof m == "number" && m > 0 && typeof w == "number" && /* @__PURE__ */ a.jsxs(
1180
+ typeof b == "number" && b > 0 && typeof W == "number" && /* @__PURE__ */ a.jsxs(
1176
1181
  "div",
1177
1182
  {
1178
1183
  style: { display: "flex", alignItems: "center", gap: "6px" },
@@ -1183,7 +1188,7 @@ function Be({
1183
1188
  style: {
1184
1189
  width: "10px",
1185
1190
  height: "5px",
1186
- backgroundColor: p.selectedQtyBar,
1191
+ backgroundColor: m.selectedQtyBar,
1187
1192
  borderRadius: "2px"
1188
1193
  }
1189
1194
  }
@@ -1200,6 +1205,6 @@ function Be({
1200
1205
  );
1201
1206
  }
1202
1207
  export {
1203
- Be as StockLeadTime
1208
+ Le as StockLeadTime
1204
1209
  };
1205
1210
  //# sourceMappingURL=index18.js.map