Fernando Pirichowski Aguiar d898818a73 Atualizando o site
2025-09-11 10:14:17 -03:00

481 lines
16 KiB
JavaScript

"use client";
import {
require_react
} from "./chunk-A5RA4VRI.js";
import {
__toESM
} from "./chunk-7D4SUZUM.js";
// node_modules/react-hot-toast/dist/index.mjs
var import_react = __toESM(require_react(), 1);
var import_react2 = __toESM(require_react(), 1);
var y = __toESM(require_react(), 1);
// node_modules/goober/dist/goober.modern.js
var e = { data: "" };
var t = (t2) => "object" == typeof window ? ((t2 ? t2.querySelector("#_goober") : window._goober) || Object.assign((t2 || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : t2 || e;
var l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
var a = /\/\*[^]*?\*\/| +/g;
var n = /\n+/g;
var o = (e2, t2) => {
let r = "", l2 = "", a2 = "";
for (let n3 in e2) {
let c2 = e2[n3];
"@" == n3[0] ? "i" == n3[1] ? r = n3 + " " + c2 + ";" : l2 += "f" == n3[1] ? o(c2, n3) : n3 + "{" + o(c2, "k" == n3[1] ? "" : t2) + "}" : "object" == typeof c2 ? l2 += o(c2, t2 ? t2.replace(/([^,])+/g, (e3) => n3.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (t3) => /&/.test(t3) ? t3.replace(/&/g, e3) : e3 ? e3 + " " + t3 : t3)) : n3) : null != c2 && (n3 = /^--/.test(n3) ? n3 : n3.replace(/[A-Z]/g, "-$&").toLowerCase(), a2 += o.p ? o.p(n3, c2) : n3 + ":" + c2 + ";");
}
return r + (t2 && a2 ? t2 + "{" + a2 + "}" : a2) + l2;
};
var c = {};
var s = (e2) => {
if ("object" == typeof e2) {
let t2 = "";
for (let r in e2) t2 += r + s(e2[r]);
return t2;
}
return e2;
};
var i = (e2, t2, r, i2, p2) => {
let u2 = s(e2), d2 = c[u2] || (c[u2] = ((e3) => {
let t3 = 0, r2 = 11;
for (; t3 < e3.length; ) r2 = 101 * r2 + e3.charCodeAt(t3++) >>> 0;
return "go" + r2;
})(u2));
if (!c[d2]) {
let t3 = u2 !== e2 ? e2 : ((e3) => {
let t4, r2, o2 = [{}];
for (; t4 = l.exec(e3.replace(a, "")); ) t4[4] ? o2.shift() : t4[3] ? (r2 = t4[3].replace(n, " ").trim(), o2.unshift(o2[0][r2] = o2[0][r2] || {})) : o2[0][t4[1]] = t4[2].replace(n, " ").trim();
return o2[0];
})(e2);
c[d2] = o(p2 ? { ["@keyframes " + d2]: t3 } : t3, r ? "" : "." + d2);
}
let f3 = r && c.g ? c.g : null;
return r && (c.g = c[d2]), ((e3, t3, r2, l2) => {
l2 ? t3.data = t3.data.replace(l2, e3) : -1 === t3.data.indexOf(e3) && (t3.data = r2 ? e3 + t3.data : t3.data + e3);
})(c[d2], t2, i2, f3), d2;
};
var p = (e2, t2, r) => e2.reduce((e3, l2, a2) => {
let n3 = t2[a2];
if (n3 && n3.call) {
let e4 = n3(r), t3 = e4 && e4.props && e4.props.className || /^go/.test(e4) && e4;
n3 = t3 ? "." + t3 : e4 && "object" == typeof e4 ? e4.props ? "" : o(e4, "") : false === e4 ? "" : e4;
}
return e3 + l2 + (null == n3 ? "" : n3);
}, "");
function u(e2) {
let r = this || {}, l2 = e2.call ? e2(r.p) : e2;
return i(l2.unshift ? l2.raw ? p(l2, [].slice.call(arguments, 1), r.p) : l2.reduce((e3, t2) => Object.assign(e3, t2 && t2.call ? t2(r.p) : t2), {}) : l2, t(r.target), r.g, r.o, r.k);
}
var d;
var f;
var g;
var b = u.bind({ g: 1 });
var h = u.bind({ k: 1 });
function m(e2, t2, r, l2) {
o.p = t2, d = e2, f = r, g = l2;
}
function j(e2, t2) {
let r = this || {};
return function() {
let l2 = arguments;
function a2(n3, o2) {
let c2 = Object.assign({}, n3), s2 = c2.className || a2.className;
r.p = Object.assign({ theme: f && f() }, c2), r.o = / *go\d+/.test(s2), c2.className = u.apply(r, l2) + (s2 ? " " + s2 : ""), t2 && (c2.ref = o2);
let i2 = e2;
return e2[0] && (i2 = c2.as || e2, delete c2.as), g && i2[0] && g(c2), d(i2, c2);
}
return t2 ? t2(a2) : a2;
};
}
// node_modules/react-hot-toast/dist/index.mjs
var b2 = __toESM(require_react(), 1);
var x = __toESM(require_react(), 1);
var Z = (e2) => typeof e2 == "function";
var h2 = (e2, t2) => Z(e2) ? e2(t2) : e2;
var W = /* @__PURE__ */ (() => {
let e2 = 0;
return () => (++e2).toString();
})();
var E = /* @__PURE__ */ (() => {
let e2;
return () => {
if (e2 === void 0 && typeof window < "u") {
let t2 = matchMedia("(prefers-reduced-motion: reduce)");
e2 = !t2 || t2.matches;
}
return e2;
};
})();
var re = 20;
var k = "default";
var H = (e2, t2) => {
let { toastLimit: o2 } = e2.settings;
switch (t2.type) {
case 0:
return { ...e2, toasts: [t2.toast, ...e2.toasts].slice(0, o2) };
case 1:
return { ...e2, toasts: e2.toasts.map((r) => r.id === t2.toast.id ? { ...r, ...t2.toast } : r) };
case 2:
let { toast: s2 } = t2;
return H(e2, { type: e2.toasts.find((r) => r.id === s2.id) ? 1 : 0, toast: s2 });
case 3:
let { toastId: a2 } = t2;
return { ...e2, toasts: e2.toasts.map((r) => r.id === a2 || a2 === void 0 ? { ...r, dismissed: true, visible: false } : r) };
case 4:
return t2.toastId === void 0 ? { ...e2, toasts: [] } : { ...e2, toasts: e2.toasts.filter((r) => r.id !== t2.toastId) };
case 5:
return { ...e2, pausedAt: t2.time };
case 6:
let i2 = t2.time - (e2.pausedAt || 0);
return { ...e2, pausedAt: void 0, toasts: e2.toasts.map((r) => ({ ...r, pauseDuration: r.pauseDuration + i2 })) };
}
};
var v = [];
var j2 = { toasts: [], pausedAt: void 0, settings: { toastLimit: re } };
var f2 = {};
var Y = (e2, t2 = k) => {
f2[t2] = H(f2[t2] || j2, e2), v.forEach(([o2, s2]) => {
o2 === t2 && s2(f2[t2]);
});
};
var _ = (e2) => Object.keys(f2).forEach((t2) => Y(e2, t2));
var Q = (e2) => Object.keys(f2).find((t2) => f2[t2].toasts.some((o2) => o2.id === e2));
var S = (e2 = k) => (t2) => {
Y(t2, e2);
};
var se = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 };
var V = (e2 = {}, t2 = k) => {
let [o2, s2] = (0, import_react.useState)(f2[t2] || j2), a2 = (0, import_react.useRef)(f2[t2]);
(0, import_react.useEffect)(() => (a2.current !== f2[t2] && s2(f2[t2]), v.push([t2, s2]), () => {
let r = v.findIndex(([l2]) => l2 === t2);
r > -1 && v.splice(r, 1);
}), [t2]);
let i2 = o2.toasts.map((r) => {
var l2, g2, T;
return { ...e2, ...e2[r.type], ...r, removeDelay: r.removeDelay || ((l2 = e2[r.type]) == null ? void 0 : l2.removeDelay) || (e2 == null ? void 0 : e2.removeDelay), duration: r.duration || ((g2 = e2[r.type]) == null ? void 0 : g2.duration) || (e2 == null ? void 0 : e2.duration) || se[r.type], style: { ...e2.style, ...(T = e2[r.type]) == null ? void 0 : T.style, ...r.style } };
});
return { ...o2, toasts: i2 };
};
var ie = (e2, t2 = "blank", o2) => ({ createdAt: Date.now(), visible: true, dismissed: false, type: t2, ariaProps: { role: "status", "aria-live": "polite" }, message: e2, pauseDuration: 0, ...o2, id: (o2 == null ? void 0 : o2.id) || W() });
var P = (e2) => (t2, o2) => {
let s2 = ie(t2, e2, o2);
return S(s2.toasterId || Q(s2.id))({ type: 2, toast: s2 }), s2.id;
};
var n2 = (e2, t2) => P("blank")(e2, t2);
n2.error = P("error");
n2.success = P("success");
n2.loading = P("loading");
n2.custom = P("custom");
n2.dismiss = (e2, t2) => {
let o2 = { type: 3, toastId: e2 };
t2 ? S(t2)(o2) : _(o2);
};
n2.dismissAll = (e2) => n2.dismiss(void 0, e2);
n2.remove = (e2, t2) => {
let o2 = { type: 4, toastId: e2 };
t2 ? S(t2)(o2) : _(o2);
};
n2.removeAll = (e2) => n2.remove(void 0, e2);
n2.promise = (e2, t2, o2) => {
let s2 = n2.loading(t2.loading, { ...o2, ...o2 == null ? void 0 : o2.loading });
return typeof e2 == "function" && (e2 = e2()), e2.then((a2) => {
let i2 = t2.success ? h2(t2.success, a2) : void 0;
return i2 ? n2.success(i2, { id: s2, ...o2, ...o2 == null ? void 0 : o2.success }) : n2.dismiss(s2), a2;
}).catch((a2) => {
let i2 = t2.error ? h2(t2.error, a2) : void 0;
i2 ? n2.error(i2, { id: s2, ...o2, ...o2 == null ? void 0 : o2.error }) : n2.dismiss(s2);
}), e2;
};
var ce = 1e3;
var w = (e2, t2 = "default") => {
let { toasts: o2, pausedAt: s2 } = V(e2, t2), a2 = (0, import_react2.useRef)(/* @__PURE__ */ new Map()).current, i2 = (0, import_react2.useCallback)((c2, m2 = ce) => {
if (a2.has(c2)) return;
let p2 = setTimeout(() => {
a2.delete(c2), r({ type: 4, toastId: c2 });
}, m2);
a2.set(c2, p2);
}, []);
(0, import_react2.useEffect)(() => {
if (s2) return;
let c2 = Date.now(), m2 = o2.map((p2) => {
if (p2.duration === 1 / 0) return;
let R = (p2.duration || 0) + p2.pauseDuration - (c2 - p2.createdAt);
if (R < 0) {
p2.visible && n2.dismiss(p2.id);
return;
}
return setTimeout(() => n2.dismiss(p2.id, t2), R);
});
return () => {
m2.forEach((p2) => p2 && clearTimeout(p2));
};
}, [o2, s2, t2]);
let r = (0, import_react2.useCallback)(S(t2), [t2]), l2 = (0, import_react2.useCallback)(() => {
r({ type: 5, time: Date.now() });
}, [r]), g2 = (0, import_react2.useCallback)((c2, m2) => {
r({ type: 1, toast: { id: c2, height: m2 } });
}, [r]), T = (0, import_react2.useCallback)(() => {
s2 && r({ type: 6, time: Date.now() });
}, [s2, r]), d2 = (0, import_react2.useCallback)((c2, m2) => {
let { reverseOrder: p2 = false, gutter: R = 8, defaultPosition: z } = m2 || {}, O = o2.filter((u2) => (u2.position || z) === (c2.position || z) && u2.height), K = O.findIndex((u2) => u2.id === c2.id), B = O.filter((u2, I) => I < K && u2.visible).length;
return O.filter((u2) => u2.visible).slice(...p2 ? [B + 1] : [0, B]).reduce((u2, I) => u2 + (I.height || 0) + R, 0);
}, [o2]);
return (0, import_react2.useEffect)(() => {
o2.forEach((c2) => {
if (c2.dismissed) i2(c2.id, c2.removeDelay);
else {
let m2 = a2.get(c2.id);
m2 && (clearTimeout(m2), a2.delete(c2.id));
}
});
}, [o2, i2]), { toasts: o2, handlers: { updateHeight: g2, startPause: l2, endPause: T, calculateOffset: d2 } };
};
var de = h`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`;
var me = h`
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}`;
var le = h`
from {
transform: scale(0) rotate(90deg);
opacity: 0;
}
to {
transform: scale(1) rotate(90deg);
opacity: 1;
}`;
var C = j("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${(e2) => e2.primary || "#ff4b4b"};
position: relative;
transform: rotate(45deg);
animation: ${de} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after,
&:before {
content: '';
animation: ${me} 0.15s ease-out forwards;
animation-delay: 150ms;
position: absolute;
border-radius: 3px;
opacity: 0;
background: ${(e2) => e2.secondary || "#fff"};
bottom: 9px;
left: 4px;
height: 2px;
width: 12px;
}
&:before {
animation: ${le} 0.15s ease-out forwards;
animation-delay: 180ms;
transform: rotate(90deg);
}
`;
var Te = h`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`;
var F = j("div")`
width: 12px;
height: 12px;
box-sizing: border-box;
border: 2px solid;
border-radius: 100%;
border-color: ${(e2) => e2.secondary || "#e0e0e0"};
border-right-color: ${(e2) => e2.primary || "#616161"};
animation: ${Te} 1s linear infinite;
`;
var ge = h`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`;
var he = h`
0% {
height: 0;
width: 0;
opacity: 0;
}
40% {
height: 0;
width: 6px;
opacity: 1;
}
100% {
opacity: 1;
height: 10px;
}`;
var L = j("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${(e2) => e2.primary || "#61d345"};
position: relative;
transform: rotate(45deg);
animation: ${ge} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after {
content: '';
box-sizing: border-box;
animation: ${he} 0.2s ease-out forwards;
opacity: 0;
animation-delay: 200ms;
position: absolute;
border-right: 2px solid;
border-bottom: 2px solid;
border-color: ${(e2) => e2.secondary || "#fff"};
bottom: 6px;
left: 6px;
height: 10px;
width: 6px;
}
`;
var be = j("div")`
position: absolute;
`;
var Se = j("div")`
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
min-height: 20px;
`;
var Ae = h`
from {
transform: scale(0.6);
opacity: 0.4;
}
to {
transform: scale(1);
opacity: 1;
}`;
var Pe = j("div")`
position: relative;
transform: scale(0.6);
opacity: 0.4;
min-width: 20px;
animation: ${Ae} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
`;
var $ = ({ toast: e2 }) => {
let { icon: t2, type: o2, iconTheme: s2 } = e2;
return t2 !== void 0 ? typeof t2 == "string" ? b2.createElement(Pe, null, t2) : t2 : o2 === "blank" ? null : b2.createElement(Se, null, b2.createElement(F, { ...s2 }), o2 !== "loading" && b2.createElement(be, null, o2 === "error" ? b2.createElement(C, { ...s2 }) : b2.createElement(L, { ...s2 })));
};
var Re = (e2) => `
0% {transform: translate3d(0,${e2 * -200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`;
var Ee = (e2) => `
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e2 * -150}%,-1px) scale(.6); opacity:0;}
`;
var ve = "0%{opacity:0;} 100%{opacity:1;}";
var De = "0%{opacity:1;} 100%{opacity:0;}";
var Oe = j("div")`
display: flex;
align-items: center;
background: #fff;
color: #363636;
line-height: 1.3;
will-change: transform;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
max-width: 350px;
pointer-events: auto;
padding: 8px 10px;
border-radius: 8px;
`;
var Ie = j("div")`
display: flex;
justify-content: center;
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`;
var ke = (e2, t2) => {
let s2 = e2.includes("top") ? 1 : -1, [a2, i2] = E() ? [ve, De] : [Re(s2), Ee(s2)];
return { animation: t2 ? `${h(a2)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${h(i2)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
};
var N = y.memo(({ toast: e2, position: t2, style: o2, children: s2 }) => {
let a2 = e2.height ? ke(e2.position || t2 || "top-center", e2.visible) : { opacity: 0 }, i2 = y.createElement($, { toast: e2 }), r = y.createElement(Ie, { ...e2.ariaProps }, h2(e2.message, e2));
return y.createElement(Oe, { className: e2.className, style: { ...a2, ...o2, ...e2.style } }, typeof s2 == "function" ? s2({ icon: i2, message: r }) : y.createElement(y.Fragment, null, i2, r));
});
m(x.createElement);
var we = ({ id: e2, className: t2, style: o2, onHeightUpdate: s2, children: a2 }) => {
let i2 = x.useCallback((r) => {
if (r) {
let l2 = () => {
let g2 = r.getBoundingClientRect().height;
s2(e2, g2);
};
l2(), new MutationObserver(l2).observe(r, { subtree: true, childList: true, characterData: true });
}
}, [e2, s2]);
return x.createElement("div", { ref: i2, className: t2, style: o2 }, a2);
};
var Me = (e2, t2) => {
let o2 = e2.includes("top"), s2 = o2 ? { top: 0 } : { bottom: 0 }, a2 = e2.includes("center") ? { justifyContent: "center" } : e2.includes("right") ? { justifyContent: "flex-end" } : {};
return { left: 0, right: 0, display: "flex", position: "absolute", transition: E() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t2 * (o2 ? 1 : -1)}px)`, ...s2, ...a2 };
};
var Ce = u`
z-index: 9999;
> * {
pointer-events: auto;
}
`;
var D = 16;
var Fe = ({ reverseOrder: e2, position: t2 = "top-center", toastOptions: o2, gutter: s2, children: a2, toasterId: i2, containerStyle: r, containerClassName: l2 }) => {
let { toasts: g2, handlers: T } = w(o2, i2);
return x.createElement("div", { "data-rht-toaster": i2 || "", style: { position: "fixed", zIndex: 9999, top: D, left: D, right: D, bottom: D, pointerEvents: "none", ...r }, className: l2, onMouseEnter: T.startPause, onMouseLeave: T.endPause }, g2.map((d2) => {
let c2 = d2.position || t2, m2 = T.calculateOffset(d2, { reverseOrder: e2, gutter: s2, defaultPosition: t2 }), p2 = Me(c2, m2);
return x.createElement(we, { id: d2.id, key: d2.id, onHeightUpdate: T.updateHeight, className: d2.visible ? Ce : "", style: p2 }, d2.type === "custom" ? h2(d2.message, d2) : a2 ? a2(d2) : x.createElement(N, { toast: d2, position: c2 }));
}));
};
var zt = n2;
export {
L as CheckmarkIcon,
C as ErrorIcon,
F as LoaderIcon,
N as ToastBar,
$ as ToastIcon,
Fe as Toaster,
zt as default,
h2 as resolveValue,
n2 as toast,
w as useToaster,
V as useToasterStore
};
//# sourceMappingURL=react-hot-toast.js.map