eatopia-ds 0.0.949 → 0.0.950

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/index10.js CHANGED
@@ -1,37 +1,37 @@
1
1
  import { j as n } from "./index24.js";
2
- import Me, { useState as v, useEffect as U, useMemo as M } from "react";
3
- import { StockLeadTime as Ee } from "./index18.js";
4
- import { calculateConsumptionForecast as pe, calculateTotalConsumptionForRange as Pe } from "./index21.js";
2
+ import Ee, { useState as j, useEffect as U, useMemo as E } from "react";
3
+ import { StockLeadTime as Me } from "./index18.js";
4
+ import { calculateConsumptionForecast as me, calculateTotalConsumptionForRange as Pe } from "./index21.js";
5
5
  import { AlertIcon as We } from "./index23.js";
6
- const be = [1, 2, 3, 7, 10, 15, 30, 60, 90], y = (o) => {
7
- const p = o.getFullYear(), j = String(o.getMonth() + 1).padStart(2, "0"), c = String(o.getDate()).padStart(2, "0");
8
- return `${p}-${j}-${c}`;
9
- }, F = (o) => {
10
- const p = o.split("-").map(Number);
11
- return p.length !== 3 || p.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(p[0], p[1] - 1, p[2]);
6
+ const be = [1, 2, 3, 7, 10, 15, 30, 60, 90], v = (o) => {
7
+ const m = o.getFullYear(), k = String(o.getMonth() + 1).padStart(2, "0"), d = String(o.getDate()).padStart(2, "0");
8
+ return `${m}-${k}-${d}`;
9
+ }, S = (o) => {
10
+ const m = o.split("-").map(Number);
11
+ return m.length !== 3 || m.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(m[0], m[1] - 1, m[2]);
12
12
  }, Re = () => {
13
13
  const o = /* @__PURE__ */ new Date();
14
- return o.setDate(o.getDate() + 1), o.setHours(0, 0, 0, 0), y(o);
14
+ return o.setDate(o.getDate() + 1), o.setHours(0, 0, 0, 0), v(o);
15
15
  }, _ = () => {
16
16
  const o = /* @__PURE__ */ new Date();
17
17
  return o.setDate(o.getDate() + 1), o.setHours(0, 0, 0, 0), o;
18
18
  }, xe = (o) => o <= 0 ? 7 : be.reduce(
19
- (p, j) => Math.abs(j - o) < Math.abs(p - o) ? j : p
19
+ (m, k) => Math.abs(k - o) < Math.abs(m - o) ? k : m
20
20
  );
21
21
  function Oe({
22
22
  data: o,
23
- onSubmit: p,
24
- onCancel: j,
25
- timelineData: c,
26
- fornecedoresOptions: Le,
27
- marcasOptions: ze,
23
+ onSubmit: m,
24
+ onCancel: k,
25
+ timelineData: d,
26
+ fornecedoresOptions: ze,
27
+ marcasOptions: Le,
28
28
  embalagensOptions: He,
29
29
  dailyConsumptionAverages: x,
30
30
  showSuggestionBar: ye = !0,
31
31
  showLegendTimeline: he = !1
32
32
  }) {
33
- var J, X, Z, ee, te, ne, oe, re, se, ie, ae, le, de, ce, ue, fe;
34
- Me.useEffect(() => {
33
+ var J, X, Z, ee, te, ne, oe, re, se, ie, ae, le, ce, de, ue, fe;
34
+ Ee.useEffect(() => {
35
35
  const e = document.createElement("style");
36
36
  return e.textContent = `
37
37
  .order-form-quantity-input::-webkit-outer-spin-button,
@@ -46,7 +46,7 @@ function Oe({
46
46
  document.head.removeChild(e);
47
47
  };
48
48
  }, []);
49
- const [I, ve] = v(!1);
49
+ const [q, ve] = j(!1);
50
50
  U(() => {
51
51
  const e = () => {
52
52
  ve(window.innerWidth <= 768);
@@ -54,24 +54,24 @@ function Oe({
54
54
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
55
55
  }, []);
56
56
  const V = () => {
57
- if (!(c != null && c.timeline)) return 0;
58
- const { restockSuggestionStart: e, restockSuggestionEnd: s } = c.timeline;
57
+ if (!(d != null && d.timeline)) return 0;
58
+ const { restockSuggestionStart: e, restockSuggestionEnd: s } = d.timeline;
59
59
  if (!e || !s) return 0;
60
- const r = new Date(e), l = new Date(s).getTime() - r.getTime(), d = Math.ceil(l / (1e3 * 60 * 60 * 24));
61
- return d > 0 ? d : 0;
60
+ const r = new Date(e), l = new Date(s).getTime() - r.getTime(), c = Math.ceil(l / (1e3 * 60 * 60 * 24));
61
+ return c > 0 ? c : 0;
62
62
  }, je = () => {
63
63
  var i;
64
- const e = _(), s = (i = c == null ? void 0 : c.timeline) == null ? void 0 : i.stockEndDate;
65
- if (!s) return y(e);
66
- const r = F(s);
67
- return isNaN(r.getTime()) || r < e ? y(e) : y(r);
64
+ const e = _(), s = (i = d == null ? void 0 : d.timeline) == null ? void 0 : i.stockEndDate;
65
+ if (!s) return v(e);
66
+ const r = S(s);
67
+ return isNaN(r.getTime()) || r < e ? v(e) : v(r);
68
68
  }, ke = () => xe(V()), g = (() => {
69
- var i, l, d;
69
+ var i, l, c;
70
70
  const e = (i = o == null ? void 0 : o.fornecedores) == null ? void 0 : i[0];
71
71
  if (!e) return null;
72
72
  const s = V();
73
73
  if (!x || s <= 0) {
74
- const u = (l = e.marcas) == null ? void 0 : l[0], f = (d = u == null ? void 0 : u.embalagens) == null ? void 0 : d[0];
74
+ const u = (l = e.marcas) == null ? void 0 : l[0], f = (c = u == null ? void 0 : u.embalagens) == null ? void 0 : c[0];
75
75
  return u && f ? {
76
76
  marca: u.nome,
77
77
  embalagem: f.label,
@@ -82,23 +82,23 @@ function Oe({
82
82
  let r = null;
83
83
  for (const u of e.marcas || [])
84
84
  for (const f of u.embalagens || []) {
85
- const m = f.quantidade_fornecedor;
86
- if (!(m <= 0))
87
- for (let b = 1; b <= 100; b++) {
88
- const ge = b * m, H = pe({
85
+ const p = f.quantidade_fornecedor;
86
+ if (!(p <= 0))
87
+ for (let h = 1; h <= 100; h++) {
88
+ const ge = h * p, H = me({
89
89
  dailyAverages: x,
90
90
  startDate: /* @__PURE__ */ new Date(),
91
91
  totalQuantity: ge
92
92
  });
93
93
  if (H.totalDays >= s) {
94
- const me = b * f.valor_unitario * m, N = H.totalDays - s;
95
- (!r || N < r.daysDifference || N === r.daysDifference && me < r.totalValue) && (r = {
94
+ const pe = h * f.valor_unitario * p, N = H.totalDays - s;
95
+ (!r || N < r.daysDifference || N === r.daysDifference && pe < r.totalValue) && (r = {
96
96
  marca: u.nome,
97
97
  embalagem: f.label,
98
- quantidade: b,
98
+ quantidade: h,
99
99
  valorUnitario: f.valor_unitario,
100
100
  totalKg: ge,
101
- totalValue: me,
101
+ totalValue: pe,
102
102
  days: H.totalDays,
103
103
  daysDifference: N
104
104
  });
@@ -112,45 +112,45 @@ function Oe({
112
112
  valorUnitario: r.valorUnitario
113
113
  } : null;
114
114
  })(), qe = () => {
115
- var i, l, d;
115
+ var i, l, c;
116
116
  if (g)
117
117
  return g.valorUnitario;
118
118
  const e = (i = o == null ? void 0 : o.fornecedores) == null ? void 0 : i[0];
119
119
  if (!e) return 0;
120
120
  const s = (l = e.marcas) == null ? void 0 : l[0];
121
121
  if (!s) return 0;
122
- const r = (d = s.embalagens) == null ? void 0 : d[0];
122
+ const r = (c = s.embalagens) == null ? void 0 : c[0];
123
123
  return (r == null ? void 0 : r.valor_unitario) ?? 0;
124
- }, E = o.unidade_medida ?? "kg", Ce = ((J = o.ultima_compra) == null ? void 0 : J.unidade) ?? o.unidade_medida ?? "kg", [a, Q] = v({
124
+ }, M = o.unidade_medida ?? "kg", Ce = ((J = o.ultima_compra) == null ? void 0 : J.unidade) ?? o.unidade_medida ?? "kg", [a, Q] = j({
125
125
  ...o,
126
126
  qtdPedido: (g == null ? void 0 : g.quantidade) ?? (o == null ? void 0 : o.qtdPedido) ?? 0,
127
127
  valorTotal: (o == null ? void 0 : o.valorTotal) ?? ((g == null ? void 0 : g.quantidade) ?? (o == null ? void 0 : o.qtdPedido) ?? 0) * qe()
128
- }), [we, Y] = v(
128
+ }), [we, Y] = j(
129
129
  ((Z = (X = o == null ? void 0 : o.fornecedores) == null ? void 0 : X[0]) == null ? void 0 : Z.nome) ?? ""
130
- ), [k, S] = v(
130
+ ), [C, I] = j(
131
131
  (g == null ? void 0 : g.marca) ?? ((oe = (ne = (te = (ee = o == null ? void 0 : o.fornecedores) == null ? void 0 : ee[0]) == null ? void 0 : te.marcas) == null ? void 0 : ne[0]) == null ? void 0 : oe.nome) ?? ""
132
- ), [w, B] = v(
133
- (g == null ? void 0 : g.embalagem) ?? ((de = (le = (ae = (ie = (se = (re = o == null ? void 0 : o.fornecedores) == null ? void 0 : re[0]) == null ? void 0 : se.marcas) == null ? void 0 : ie[0]) == null ? void 0 : ae.embalagens) == null ? void 0 : le[0]) == null ? void 0 : de.label) ?? ""
134
- ), [P, O] = v(
132
+ ), [F, B] = j(
133
+ (g == null ? void 0 : g.embalagem) ?? ((ce = (le = (ae = (ie = (se = (re = o == null ? void 0 : o.fornecedores) == null ? void 0 : re[0]) == null ? void 0 : se.marcas) == null ? void 0 : ie[0]) == null ? void 0 : ae.embalagens) == null ? void 0 : le[0]) == null ? void 0 : ce.label) ?? ""
134
+ ), [P, O] = j(
135
135
  je
136
- ), [W, A] = v(ke);
136
+ ), [W, A] = j(ke);
137
137
  U(() => {
138
- var d, u, f;
139
- const e = _(), s = (d = c == null ? void 0 : c.timeline) == null ? void 0 : d.stockEndDate;
138
+ var c, u, f;
139
+ const e = _(), s = (c = d == null ? void 0 : d.timeline) == null ? void 0 : c.stockEndDate;
140
140
  let r;
141
141
  if (s) {
142
- const m = F(s);
143
- r = isNaN(m.getTime()) || m < e ? y(e) : y(m);
142
+ const p = S(s);
143
+ r = isNaN(p.getTime()) || p < e ? v(e) : v(p);
144
144
  } else
145
- r = y(e);
145
+ r = v(e);
146
146
  let i = 0;
147
- if ((u = c == null ? void 0 : c.timeline) != null && u.restockSuggestionStart && ((f = c == null ? void 0 : c.timeline) != null && f.restockSuggestionEnd)) {
148
- const m = F(c.timeline.restockSuggestionStart), b = F(c.timeline.restockSuggestionEnd);
149
- !isNaN(m.getTime()) && !isNaN(b.getTime()) && (i = Math.ceil((b.getTime() - m.getTime()) / (1e3 * 60 * 60 * 24)) || 0);
147
+ if ((u = d == null ? void 0 : d.timeline) != null && u.restockSuggestionStart && ((f = d == null ? void 0 : d.timeline) != null && f.restockSuggestionEnd)) {
148
+ const p = S(d.timeline.restockSuggestionStart), h = S(d.timeline.restockSuggestionEnd);
149
+ !isNaN(p.getTime()) && !isNaN(h.getTime()) && (i = Math.ceil((h.getTime() - p.getTime()) / (1e3 * 60 * 60 * 24)) || 0);
150
150
  }
151
151
  const l = xe(i);
152
152
  O(r), A(l);
153
- }, [c, o]), U(() => {
153
+ }, [d, o]), U(() => {
154
154
  var s, r, i;
155
155
  if (g) return;
156
156
  const e = (s = o == null ? void 0 : o.fornecedores) == null ? void 0 : s[0];
@@ -158,34 +158,34 @@ function Oe({
158
158
  Y(e.nome);
159
159
  const l = (r = e.marcas) == null ? void 0 : r[0];
160
160
  if (l) {
161
- S(l.nome);
162
- const d = (i = l.embalagens) == null ? void 0 : i[0];
163
- d && B(d.label);
161
+ I(l.nome);
162
+ const c = (i = l.embalagens) == null ? void 0 : i[0];
163
+ c && B(c.label);
164
164
  }
165
165
  }
166
166
  }, [o, g]);
167
- const D = M(() => {
168
- var l, d, u;
167
+ const D = E(() => {
168
+ var l, c, u;
169
169
  const e = (l = a.fornecedores) == null ? void 0 : l[0];
170
170
  if (!e) return 0;
171
- const s = (d = e.marcas) == null ? void 0 : d.find((f) => f.nome === k);
171
+ const s = (c = e.marcas) == null ? void 0 : c.find((f) => f.nome === C);
172
172
  if (!s) return 0;
173
173
  const r = (u = s.embalagens) == null ? void 0 : u.find(
174
- (f) => f.label === w
174
+ (f) => f.label === F
175
175
  ), i = (r == null ? void 0 : r.quantidade_fornecedor) ?? 0;
176
176
  return a.qtdPedido * i;
177
177
  }, [
178
178
  a.qtdPedido,
179
179
  a.fornecedores,
180
- k,
181
- w
182
- ]), R = M(() => !x || D <= 0 ? null : pe({
180
+ C,
181
+ F
182
+ ]), R = E(() => !x || D <= 0 ? null : me({
183
183
  dailyAverages: x,
184
184
  startDate: /* @__PURE__ */ new Date(),
185
185
  totalQuantity: D
186
- }), [x, D]), q = (R == null ? void 0 : R.totalDays) ?? 0, h = M(() => {
186
+ }), [x, D]), w = (R == null ? void 0 : R.totalDays) ?? 0, b = E(() => {
187
187
  if (!x) return 0;
188
- const e = _(), s = F(P);
188
+ const e = _(), s = S(P);
189
189
  if (isNaN(s.getTime())) return 0;
190
190
  const r = s < e ? e : s;
191
191
  return Pe(
@@ -193,25 +193,25 @@ function Oe({
193
193
  r,
194
194
  W
195
195
  );
196
- }, [x, P, W]), $ = M(() => {
197
- if (c)
196
+ }, [x, P, W]), $ = E(() => {
197
+ if (d)
198
198
  return {
199
- ...c,
199
+ ...d,
200
200
  timeline: {
201
- ...c.timeline,
201
+ ...d.timeline,
202
202
  dailyConsumptionAverage: x
203
203
  }
204
204
  };
205
- }, [c, x]);
205
+ }, [d, x]);
206
206
  if (!o)
207
207
  return null;
208
208
  const G = () => {
209
209
  var r, i, l;
210
210
  const e = (r = a.fornecedores) == null ? void 0 : r[0];
211
211
  if (!e) return null;
212
- const s = (i = e.marcas) == null ? void 0 : i.find((d) => d.nome === k);
213
- return s ? ((l = s.embalagens) == null ? void 0 : l.find((d) => d.label === w)) ?? null : null;
214
- }, L = () => {
212
+ const s = (i = e.marcas) == null ? void 0 : i.find((c) => c.nome === C);
213
+ return s ? ((l = s.embalagens) == null ? void 0 : l.find((c) => c.label === F)) ?? null : null;
214
+ }, z = () => {
215
215
  var e;
216
216
  return ((e = G()) == null ? void 0 : e.valor_unitario) ?? 0;
217
217
  }, K = (e) => {
@@ -220,70 +220,70 @@ function Oe({
220
220
  /\B(?=(\d{3})+(?!\d))/g,
221
221
  "."
222
222
  )},${i}`;
223
- }, C = () => {
223
+ }, y = () => {
224
224
  var e;
225
225
  return ((e = G()) == null ? void 0 : e.quantidade_fornecedor) ?? 0;
226
226
  }, T = (e) => {
227
- const s = L(), r = e * s;
227
+ const s = z(), r = e * s;
228
228
  Q((i) => ({
229
229
  ...i,
230
230
  qtdPedido: e,
231
231
  valorTotal: r
232
232
  }));
233
- }, z = (e) => {
234
- var d, u, f;
233
+ }, L = (e) => {
234
+ var c, u, f;
235
235
  B(e);
236
- const s = (d = a.fornecedores) == null ? void 0 : d[0];
236
+ const s = (c = a.fornecedores) == null ? void 0 : c[0];
237
237
  if (!s) return;
238
- const r = (u = s.marcas) == null ? void 0 : u.find((m) => m.nome === k);
238
+ const r = (u = s.marcas) == null ? void 0 : u.find((p) => p.nome === C);
239
239
  if (!r) return;
240
- const i = (f = r.embalagens) == null ? void 0 : f.find((m) => m.label === e);
240
+ const i = (f = r.embalagens) == null ? void 0 : f.find((p) => p.label === e);
241
241
  if (!i) return;
242
242
  const l = a.qtdPedido * (i.valor_unitario ?? 0);
243
- Q((m) => ({
244
- ...m,
243
+ Q((p) => ({
244
+ ...p,
245
245
  valorTotal: l
246
246
  }));
247
- }, Te = () => {
247
+ }, Fe = () => {
248
248
  var s;
249
249
  const e = (s = a.fornecedores) == null ? void 0 : s[0];
250
250
  return e ? e.marcas || [] : [];
251
- }, Fe = () => {
251
+ }, Te = () => {
252
252
  var r, i;
253
253
  const e = (r = a.fornecedores) == null ? void 0 : r[0];
254
254
  if (!e) return [];
255
- const s = (i = e.marcas) == null ? void 0 : i.find((l) => l.nome === k);
255
+ const s = (i = e.marcas) == null ? void 0 : i.find((l) => l.nome === C);
256
256
  return s ? s.embalagens || [] : [];
257
- }, Ie = (e) => {
258
- var l, d;
259
- S(e);
257
+ }, Se = (e) => {
258
+ var l, c;
259
+ I(e);
260
260
  const s = (l = a.fornecedores) == null ? void 0 : l[0];
261
261
  if (!s) return;
262
- const r = (d = s.marcas) == null ? void 0 : d.find((u) => u.nome === e);
262
+ const r = (c = s.marcas) == null ? void 0 : c.find((u) => u.nome === e);
263
263
  if (!r || !r.embalagens || r.embalagens.length === 0) return;
264
264
  const i = r.embalagens[0];
265
- z(i.label);
266
- }, Se = (e) => {
267
- var l, d, u;
265
+ L(i.label);
266
+ }, Ie = (e) => {
267
+ var l, c, u;
268
268
  Y(e);
269
269
  const s = (l = a.fornecedores) == null ? void 0 : l.find(
270
270
  (f) => f.nome === e
271
271
  );
272
272
  if (!s) return;
273
- const r = (d = s.marcas) == null ? void 0 : d[0];
273
+ const r = (c = s.marcas) == null ? void 0 : c[0];
274
274
  if (!r) {
275
- S(""), B("");
275
+ I(""), B("");
276
276
  return;
277
277
  }
278
- S(r.nome);
278
+ I(r.nome);
279
279
  const i = (u = r.embalagens) == null ? void 0 : u[0];
280
- i ? z(i.label) : B("");
280
+ i ? L(i.label) : B("");
281
281
  }, Be = (e) => {
282
- e.preventDefault(), p(a);
282
+ e.preventDefault(), m(a);
283
283
  }, De = () => {
284
- const e = C();
285
- if (e <= 0 || h <= 0) return;
286
- const s = Math.ceil(h / e);
284
+ const e = y();
285
+ if (e <= 0 || b <= 0) return;
286
+ const s = Math.ceil(b / e);
287
287
  T(s);
288
288
  }, t = {
289
289
  container: {
@@ -361,62 +361,36 @@ function Oe({
361
361
  fontFamily: "Inter, sans-serif"
362
362
  },
363
363
  select: {
364
- height: "36px",
365
- padding: "6px 10px",
366
- border: "1px solid #d1d5db",
367
- borderRadius: "6px",
364
+ height: "42px",
365
+ padding: "0 14px",
366
+ border: "1.5px solid #e2e8f0",
367
+ borderRadius: "10px",
368
368
  fontSize: "14px",
369
- backgroundColor: "white",
370
- color: "#374151",
369
+ fontWeight: "500",
370
+ backgroundColor: "#f8fafc",
371
+ color: "#0f172a",
371
372
  cursor: "pointer",
372
373
  outline: "none",
373
374
  fontFamily: "Inter, sans-serif",
374
375
  boxSizing: "border-box",
375
- lineHeight: "1"
376
+ lineHeight: "1",
377
+ transition: "border-color 0.15s, box-shadow 0.15s"
376
378
  },
377
379
  dateInput: {
378
- height: "36px",
379
- padding: "6px 10px",
380
- border: "1px solid #d1d5db",
381
- borderRadius: "6px",
380
+ height: "42px",
381
+ padding: "0 14px",
382
+ border: "1.5px solid #e2e8f0",
383
+ borderRadius: "10px",
382
384
  fontSize: "14px",
383
- backgroundColor: "white",
384
- color: "#374151",
385
+ fontWeight: "500",
386
+ backgroundColor: "#f8fafc",
387
+ color: "#0f172a",
385
388
  outline: "none",
386
389
  fontFamily: "Inter, sans-serif",
387
390
  boxSizing: "border-box",
388
- lineHeight: "1"
389
- },
390
- rangeTotal: {
391
- fontSize: "20px",
392
- fontWeight: "700",
393
- color: "#111827",
394
- fontFamily: "Inter, sans-serif",
395
- display: "flex",
396
- alignItems: "center"
397
- },
398
- addConsumoButton: {
399
- display: "flex",
400
- alignItems: "center",
401
- justifyContent: "center",
402
- width: "28px",
403
- height: "28px",
404
- minWidth: "28px",
405
- borderRadius: "6px",
406
- border: "1px solid #9ca3af",
407
- backgroundColor: "#e5e7eb",
408
- color: "#374151",
409
- fontSize: "16px",
410
- fontWeight: "600",
411
- cursor: "pointer",
412
- transition: "all 0.2s",
413
- fontFamily: "Inter, sans-serif"
414
- },
415
- addConsumoButtonDisabled: {
416
- opacity: 0.5,
417
- cursor: "not-allowed",
418
- backgroundColor: "#d1d5db",
419
- borderColor: "#9ca3af"
391
+ lineHeight: "1",
392
+ transition: "border-color 0.15s, box-shadow 0.15s",
393
+ width: "100%"
420
394
  },
421
395
  // Estilos da seção de pedido (estilo calculadora)
422
396
  orderSectionContainer: {
@@ -566,7 +540,7 @@ function Oe({
566
540
  backgroundColor: "#FF4E00",
567
541
  fontWeight: "600"
568
542
  },
569
- children: K(L())
543
+ children: K(z())
570
544
  }
571
545
  ) })
572
546
  ] }),
@@ -584,7 +558,7 @@ function Oe({
584
558
  /* @__PURE__ */ n.jsxs("div", { style: t.infoText, children: [
585
559
  /* @__PURE__ */ n.jsx(We, { width: 20, height: 20 }),
586
560
  "Última compra ",
587
- (ce = a.ultima_compra) == null ? void 0 : ce.data
561
+ (de = a.ultima_compra) == null ? void 0 : de.data
588
562
  ] }),
589
563
  /* @__PURE__ */ n.jsxs("div", { style: t.infoValue, children: [
590
564
  Number(((ue = a.ultima_compra) == null ? void 0 : ue.quantidade) ?? 0).toFixed(2),
@@ -599,7 +573,7 @@ function Oe({
599
573
  "select",
600
574
  {
601
575
  value: we,
602
- onChange: (e) => Se(e.target.value),
576
+ onChange: (e) => Ie(e.target.value),
603
577
  style: t.select,
604
578
  children: (fe = a.fornecedores) == null ? void 0 : fe.map((e) => /* @__PURE__ */ n.jsx("option", { value: e.nome, children: e.nome }, e.nome))
605
579
  }
@@ -610,10 +584,10 @@ function Oe({
610
584
  /* @__PURE__ */ n.jsx(
611
585
  "select",
612
586
  {
613
- value: k,
614
- onChange: (e) => Ie(e.target.value),
587
+ value: C,
588
+ onChange: (e) => Se(e.target.value),
615
589
  style: t.select,
616
- children: Te().map((e) => /* @__PURE__ */ n.jsx("option", { value: e.nome, children: e.nome }, e.nome))
590
+ children: Fe().map((e) => /* @__PURE__ */ n.jsx("option", { value: e.nome, children: e.nome }, e.nome))
617
591
  }
618
592
  )
619
593
  ] }),
@@ -622,33 +596,35 @@ function Oe({
622
596
  /* @__PURE__ */ n.jsx(
623
597
  "select",
624
598
  {
625
- value: w,
626
- onChange: (e) => z(e.target.value),
599
+ value: F,
600
+ onChange: (e) => L(e.target.value),
627
601
  style: t.select,
628
- children: Fe().map((e) => /* @__PURE__ */ n.jsx("option", { value: e.label, children: e.label }, e.label))
602
+ children: Te().map((e) => /* @__PURE__ */ n.jsx("option", { value: e.label, children: e.label }, e.label))
629
603
  }
630
604
  )
631
605
  ] })
632
606
  ] }),
633
607
  $ && /* @__PURE__ */ n.jsx("div", { style: { marginTop: "8px", marginBottom: "8px" }, children: /* @__PURE__ */ n.jsx(
634
- Ee,
608
+ Me,
635
609
  {
636
610
  data: $,
637
611
  controls: !0,
638
612
  showLegend: he,
639
613
  size: "sm",
640
614
  showSuggestionBar: ye,
641
- unitLabel: E,
615
+ unitLabel: M,
642
616
  onAddSuggestedWeight: (e) => T(e),
643
617
  selectedQty: D,
644
- selectedQtyDays: q
618
+ selectedQtyDays: w
645
619
  }
646
620
  ) }),
647
621
  /* @__PURE__ */ n.jsxs(
648
622
  "div",
649
623
  {
650
624
  style: {
651
- ...t.formGrid,
625
+ display: "grid",
626
+ gridTemplateColumns: q ? "1fr 1fr" : "1fr 1fr 1fr",
627
+ gap: "16px",
652
628
  marginTop: "8px",
653
629
  alignItems: "flex-start"
654
630
  },
@@ -680,46 +656,95 @@ function Oe({
680
656
  }
681
657
  )
682
658
  ] }),
683
- /* @__PURE__ */ n.jsxs("div", { style: t.formField, children: [
684
- /* @__PURE__ */ n.jsx("label", { style: t.label, children: "Consumo previsto" }),
685
- /* @__PURE__ */ n.jsxs(
686
- "div",
687
- {
688
- style: {
689
- display: "flex",
690
- alignItems: "center",
691
- gap: "8px"
692
- },
693
- children: [
694
- /* @__PURE__ */ n.jsxs("div", { style: t.rangeTotal, children: [
695
- h.toFixed(2),
696
- " ",
697
- E
698
- ] }),
699
- /* @__PURE__ */ n.jsx(
700
- "button",
701
- {
702
- type: "button",
703
- onClick: De,
704
- disabled: h <= 0 || C() <= 0,
705
- style: {
706
- ...t.addConsumoButton,
707
- ...h <= 0 || C() <= 0 ? t.addConsumoButtonDisabled : {}
708
- },
709
- onMouseEnter: (e) => {
710
- h > 0 && C() > 0 && (e.currentTarget.style.backgroundColor = "#d1d5db");
711
- },
712
- onMouseLeave: (e) => {
713
- h > 0 && C() > 0 && (e.currentTarget.style.backgroundColor = "#e5e7eb");
714
- },
715
- "aria-label": "Definir quantidade pelo consumo previsto",
716
- children: "↻"
717
- }
718
- )
719
- ]
720
- }
721
- )
722
- ] })
659
+ /* @__PURE__ */ n.jsxs(
660
+ "div",
661
+ {
662
+ style: {
663
+ ...t.formField,
664
+ ...q ? { gridColumn: "1 / -1" } : {}
665
+ },
666
+ children: [
667
+ /* @__PURE__ */ n.jsx("label", { style: t.label, children: "Consumo previsto" }),
668
+ /* @__PURE__ */ n.jsxs(
669
+ "div",
670
+ {
671
+ style: {
672
+ display: "flex",
673
+ alignItems: "center",
674
+ justifyContent: "space-between",
675
+ padding: "8px 14px",
676
+ backgroundColor: "#f8fafc",
677
+ border: "1.5px solid #e2e8f0",
678
+ borderRadius: "10px",
679
+ height: "42px"
680
+ },
681
+ children: [
682
+ /* @__PURE__ */ n.jsxs(
683
+ "span",
684
+ {
685
+ style: {
686
+ fontSize: "18px",
687
+ fontWeight: "700",
688
+ color: "#0f172a",
689
+ fontFamily: "Inter, sans-serif",
690
+ letterSpacing: "-0.3px"
691
+ },
692
+ children: [
693
+ b.toFixed(2),
694
+ " ",
695
+ /* @__PURE__ */ n.jsx(
696
+ "span",
697
+ {
698
+ style: {
699
+ fontSize: "13px",
700
+ fontWeight: "500",
701
+ color: "#64748b"
702
+ },
703
+ children: M
704
+ }
705
+ )
706
+ ]
707
+ }
708
+ ),
709
+ /* @__PURE__ */ n.jsx(
710
+ "button",
711
+ {
712
+ type: "button",
713
+ onClick: De,
714
+ disabled: b <= 0 || y() <= 0,
715
+ style: {
716
+ display: "flex",
717
+ alignItems: "center",
718
+ justifyContent: "center",
719
+ width: "30px",
720
+ height: "30px",
721
+ minWidth: "30px",
722
+ borderRadius: "8px",
723
+ border: "none",
724
+ backgroundColor: b > 0 && y() > 0 ? "#FF4E00" : "#e5e7eb",
725
+ color: b > 0 && y() > 0 ? "white" : "#9ca3af",
726
+ fontSize: "16px",
727
+ cursor: b > 0 && y() > 0 ? "pointer" : "not-allowed",
728
+ opacity: b <= 0 || y() <= 0 ? 0.5 : 1,
729
+ transition: "all 0.2s",
730
+ fontFamily: "Inter, sans-serif"
731
+ },
732
+ onMouseEnter: (e) => {
733
+ b > 0 && y() > 0 && (e.currentTarget.style.backgroundColor = "#e04400");
734
+ },
735
+ onMouseLeave: (e) => {
736
+ b > 0 && y() > 0 && (e.currentTarget.style.backgroundColor = "#FF4E00");
737
+ },
738
+ "aria-label": "Definir quantidade pelo consumo previsto",
739
+ children: "↻"
740
+ }
741
+ )
742
+ ]
743
+ }
744
+ )
745
+ ]
746
+ }
747
+ )
723
748
  ]
724
749
  }
725
750
  ),
@@ -783,7 +808,7 @@ function Oe({
783
808
  "aria-label": "Quantidade"
784
809
  }
785
810
  ),
786
- /* @__PURE__ */ n.jsx("span", { style: t.quantityLabel, children: w || "unidades" })
811
+ /* @__PURE__ */ n.jsx("span", { style: t.quantityLabel, children: F || "unidades" })
787
812
  ] }),
788
813
  /* @__PURE__ */ n.jsx(
789
814
  "button",
@@ -830,7 +855,7 @@ function Oe({
830
855
  {
831
856
  style: {
832
857
  ...t.totalsRow,
833
- ...I ? {
858
+ ...q ? {
834
859
  flexDirection: "column",
835
860
  gap: "12px",
836
861
  alignItems: "stretch"
@@ -842,14 +867,14 @@ function Oe({
842
867
  {
843
868
  style: {
844
869
  ...t.totalItem,
845
- ...I ? { justifyContent: "space-between", width: "100%" } : {}
870
+ ...q ? { justifyContent: "space-between", width: "100%" } : {}
846
871
  },
847
872
  children: [
848
873
  /* @__PURE__ */ n.jsx("span", { style: t.totalLabel, children: "Total:" }),
849
874
  /* @__PURE__ */ n.jsxs("span", { style: t.totalValue, children: [
850
- (a.qtdPedido * C()).toFixed(2),
875
+ (a.qtdPedido * y()).toFixed(2),
851
876
  " ",
852
- E
877
+ M
853
878
  ] })
854
879
  ]
855
880
  }
@@ -859,27 +884,27 @@ function Oe({
859
884
  {
860
885
  style: {
861
886
  ...t.totalItem,
862
- ...I ? { justifyContent: "space-between", width: "100%" } : {}
887
+ ...q ? { justifyContent: "space-between", width: "100%" } : {}
863
888
  },
864
889
  children: [
865
890
  /* @__PURE__ */ n.jsx("span", { style: t.totalLabel, children: "Valor:" }),
866
- /* @__PURE__ */ n.jsx("span", { style: t.totalValueHighlight, children: K(a.qtdPedido * L()) })
891
+ /* @__PURE__ */ n.jsx("span", { style: t.totalValueHighlight, children: K(a.qtdPedido * z()) })
867
892
  ]
868
893
  }
869
894
  ),
870
- q > 0 && /* @__PURE__ */ n.jsxs(
895
+ w > 0 && /* @__PURE__ */ n.jsxs(
871
896
  "div",
872
897
  {
873
898
  style: {
874
899
  ...t.totalItem,
875
- ...I ? { justifyContent: "space-between", width: "100%" } : {}
900
+ ...q ? { justifyContent: "space-between", width: "100%" } : {}
876
901
  },
877
902
  children: [
878
903
  /* @__PURE__ */ n.jsx("span", { style: t.totalLabel, children: "Duração:" }),
879
904
  /* @__PURE__ */ n.jsxs("span", { style: t.totalValue, children: [
880
- q % 1 === 0 ? q.toString() : q.toFixed(1),
905
+ w % 1 === 0 ? w.toString() : w.toFixed(1),
881
906
  " ",
882
- q === 1 ? "dia" : "dias"
907
+ w === 1 ? "dia" : "dias"
883
908
  ] })
884
909
  ]
885
910
  }
@@ -913,7 +938,7 @@ function Oe({
913
938
  {
914
939
  type: "button",
915
940
  style: { ...t.button, ...t.cancelButton },
916
- onClick: j,
941
+ onClick: k,
917
942
  onMouseEnter: (e) => {
918
943
  e.currentTarget.style.backgroundColor = t.cancelButtonHover.backgroundColor;
919
944
  },