diff --git a/packages/ecommerce/dist-lib/pm-ecommerce.es.js b/packages/ecommerce/dist-lib/pm-ecommerce.es.js index 977af3be..312ddfb2 100644 --- a/packages/ecommerce/dist-lib/pm-ecommerce.es.js +++ b/packages/ecommerce/dist-lib/pm-ecommerce.es.js @@ -1,46 +1,46 @@ -import { jsx as a, jsxs as c, Fragment as Ur } from "react/jsx-runtime"; -import { Minus as Yr, Plus as zr, Trash2 as br, ShoppingCart as Ge, Loader2 as Vr, ShoppingBag as Br, MapPin as Xe, Save as Jr, CreditCard as Ke, Bitcoin as Hr, Truck as Gr, Clock as ze, Globe as Xr, DollarSign as Kr, RotateCcw as Qr, CheckCircle as Fe, XCircle as qe, RefreshCw as De, Package as Qe, ArrowLeft as Zr, Store as et, ExternalLink as rt, Receipt as tt, FileText as nt } from "lucide-react"; +import { jsx as a, jsxs as c, Fragment as zr } from "react/jsx-runtime"; +import { Minus as Vr, Plus as Br, Trash2 as Nr, ShoppingCart as Xe, Loader2 as Jr, ShoppingBag as Hr, MapPin as Ke, Save as Gr, CreditCard as Qe, Bitcoin as Xr, Truck as Kr, Clock as Ve, Globe as Qr, DollarSign as Zr, RotateCcw as et, CheckCircle as Fe, XCircle as qe, RefreshCw as De, Package as Ze, ArrowLeft as rt, Store as tt, ExternalLink as nt, Receipt as at, FileText as ot } from "lucide-react"; import * as L from "react"; import q, { useState as ae, useEffect as Pe } from "react"; -import { twMerge as at } from "tailwind-merge"; -import { create as ot } from "zustand"; -import { persist as it } from "zustand/middleware"; +import { twMerge as it } from "tailwind-merge"; +import { create as st } from "zustand"; +import { persist as ct } from "zustand/middleware"; import "react-dom"; -import { useLocation as st, matchPath as fe } from "react-router-dom"; -function Ze(e, r) { +import { useLocation as lt, matchPath as fe } from "react-router-dom"; +function er(e, r) { if (typeof e == "function") return e(r); e != null && (e.current = r); } -function ct(...e) { +function ut(...e) { return (r) => { let t = !1; const n = e.map((o) => { - const i = Ze(o, r); + const i = er(o, r); return !t && typeof i == "function" && (t = !0), i; }); if (t) return () => { for (let o = 0; o < n.length; o++) { const i = n[o]; - typeof i == "function" ? i() : Ze(e[o], null); + typeof i == "function" ? i() : er(e[o], null); } }; }; } -var lt = Symbol.for("react.lazy"), ke = L[" use ".trim().toString()]; -function ut(e) { +var dt = Symbol.for("react.lazy"), Oe = L[" use ".trim().toString()]; +function ft(e) { return typeof e == "object" && e !== null && "then" in e; } -function xr(e) { - return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === lt && "_payload" in e && ut(e._payload); +function Sr(e) { + return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === dt && "_payload" in e && ft(e._payload); } // @__NO_SIDE_EFFECTS__ -function Ve(e) { - const r = /* @__PURE__ */ ft(e), t = L.forwardRef((n, o) => { +function Be(e) { + const r = /* @__PURE__ */ pt(e), t = L.forwardRef((n, o) => { let { children: i, ...d } = n; - xr(i) && typeof ke == "function" && (i = ke(i._payload)); - const l = L.Children.toArray(i), s = l.find(pt); + Sr(i) && typeof Oe == "function" && (i = Oe(i._payload)); + const l = L.Children.toArray(i), s = l.find(yt); if (s) { const p = s.props.children, v = l.map((m) => m === s ? L.Children.count(p) > 1 ? L.Children.only(null) : L.isValidElement(p) ? p.props.children : null : m); return /* @__PURE__ */ a(r, { ...d, ref: o, children: L.isValidElement(p) ? L.cloneElement(p, void 0, v) : null }); @@ -49,24 +49,24 @@ function Ve(e) { }); return t.displayName = `${e}.Slot`, t; } -var dt = /* @__PURE__ */ Ve("Slot"); +var mt = /* @__PURE__ */ Be("Slot"); // @__NO_SIDE_EFFECTS__ -function ft(e) { +function pt(e) { const r = L.forwardRef((t, n) => { let { children: o, ...i } = t; - if (xr(o) && typeof ke == "function" && (o = ke(o._payload)), L.isValidElement(o)) { - const d = yt(o), l = ht(i, o.props); - return o.type !== L.Fragment && (l.ref = n ? ct(n, d) : d), L.cloneElement(o, l); + if (Sr(o) && typeof Oe == "function" && (o = Oe(o._payload)), L.isValidElement(o)) { + const d = gt(o), l = vt(i, o.props); + return o.type !== L.Fragment && (l.ref = n ? ut(n, d) : d), L.cloneElement(o, l); } return L.Children.count(o) > 1 ? L.Children.only(null) : null; }); return r.displayName = `${e}.SlotClone`, r; } -var mt = Symbol("radix.slottable"); -function pt(e) { - return L.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === mt; +var ht = Symbol("radix.slottable"); +function yt(e) { + return L.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ht; } -function ht(e, r) { +function vt(e, r) { const t = { ...r }; for (const n in r) { const o = e[n], i = r[n]; @@ -77,31 +77,31 @@ function ht(e, r) { } return { ...e, ...t }; } -function yt(e) { +function gt(e) { var n, o; let r = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, t = r && "isReactWarning" in r && r.isReactWarning; return t ? e.ref : (r = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref); } -function wr(e) { +function Cr(e) { var r, t, n = ""; if (typeof e == "string" || typeof e == "number") n += e; else if (typeof e == "object") if (Array.isArray(e)) { var o = e.length; - for (r = 0; r < o; r++) e[r] && (t = wr(e[r])) && (n && (n += " "), n += t); + for (r = 0; r < o; r++) e[r] && (t = Cr(e[r])) && (n && (n += " "), n += t); } else for (t in e) e[t] && (n && (n += " "), n += t); return n; } -function Nr() { - for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = wr(e)) && (n && (n += " "), n += r); +function Er() { + for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = Cr(e)) && (n && (n += " "), n += r); return n; } -const er = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, rr = Nr, Be = (e, r) => (t) => { +const rr = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, tr = Er, Je = (e, r) => (t) => { var n; - if ((r == null ? void 0 : r.variants) == null) return rr(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className); + if ((r == null ? void 0 : r.variants) == null) return tr(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className); const { variants: o, defaultVariants: i } = r, d = Object.keys(o).map((p) => { const v = t == null ? void 0 : t[p], m = i == null ? void 0 : i[p]; if (v === null) return null; - const g = er(v) || er(m); + const g = rr(v) || rr(m); return o[p][g]; }), l = t && Object.entries(t).reduce((p, v) => { let [m, g] = v; @@ -109,26 +109,26 @@ const er = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, rr = Nr, B }, {}), s = r == null || (n = r.compoundVariants) === null || n === void 0 ? void 0 : n.reduce((p, v) => { let { class: m, className: g, ...w } = v; return Object.entries(w).every((A) => { - let [C, j] = A; + let [S, j] = A; return Array.isArray(j) ? j.includes({ ...i, ...l - }[C]) : { + }[S]) : { ...i, ...l - }[C] === j; + }[S] === j; }) ? [ ...p, m, g ] : p; }, []); - return rr(e, d, s, t == null ? void 0 : t.class, t == null ? void 0 : t.className); + return tr(e, d, s, t == null ? void 0 : t.class, t == null ? void 0 : t.className); }; function U(...e) { - return at(Nr(e)); + return it(Er(e)); } -const vt = Be( +const bt = Je( "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", { variants: { @@ -153,7 +153,7 @@ const vt = Be( } } ), te = L.forwardRef( - ({ className: e, variant: r, size: t, asChild: n = !1, ...o }, i) => /* @__PURE__ */ a(n ? dt : "button", { className: U(vt({ variant: r, size: t, className: e })), ref: i, ...o }) + ({ className: e, variant: r, size: t, asChild: n = !1, ...o }, i) => /* @__PURE__ */ a(n ? mt : "button", { className: U(bt({ variant: r, size: t, className: e })), ref: i, ...o }) ); te.displayName = "Button"; function Ne(e) { @@ -162,8 +162,8 @@ function Ne(e) { itemCount: e.reduce((r, t) => r + t.quantity, 0) }; } -const se = ot()( - it( +const se = st()( + ct( (e) => ({ items: [], subtotal: 0, @@ -196,7 +196,7 @@ const se = ot()( } ) ); -function gt({ item: e, className: r }) { +function xt({ item: e, className: r }) { const t = se((i) => i.updateQuantity), n = se((i) => i.removeItem), o = e.price * e.quantity; return /* @__PURE__ */ c( "div", @@ -243,7 +243,7 @@ function gt({ item: e, className: r }) { className: "h-8 w-8", onClick: () => t(e.id, e.quantity - 1), "aria-label": "Decrease quantity", - children: /* @__PURE__ */ a(Yr, { className: "h-3 w-3" }) + children: /* @__PURE__ */ a(Vr, { className: "h-3 w-3" }) } ), /* @__PURE__ */ a("span", { className: "w-8 text-center text-sm font-medium tabular-nums", children: e.quantity }), @@ -255,7 +255,7 @@ function gt({ item: e, className: r }) { className: "h-8 w-8", onClick: () => t(e.id, e.quantity + 1), "aria-label": "Increase quantity", - children: /* @__PURE__ */ a(zr, { className: "h-3 w-3" }) + children: /* @__PURE__ */ a(Br, { className: "h-3 w-3" }) } ) ] }), @@ -271,7 +271,7 @@ function gt({ item: e, className: r }) { className: "h-8 w-8 text-destructive hover:text-destructive", onClick: () => n(e.id), "aria-label": `Remove ${e.title}`, - children: /* @__PURE__ */ a(br, { className: "h-4 w-4" }) + children: /* @__PURE__ */ a(Nr, { className: "h-4 w-4" }) } ) ] @@ -288,19 +288,19 @@ const he = L.forwardRef( ({ className: e, ...r }, t) => /* @__PURE__ */ a("h3", { ref: t, className: U("text-2xl font-semibold leading-none tracking-tight", e), ...r }) ); he.displayName = "CardTitle"; -const bt = L.forwardRef( +const wt = L.forwardRef( ({ className: e, ...r }, t) => /* @__PURE__ */ a("p", { ref: t, className: U("text-sm text-muted-foreground", e), ...r }) ); -bt.displayName = "CardDescription"; +wt.displayName = "CardDescription"; const de = L.forwardRef( ({ className: e, ...r }, t) => /* @__PURE__ */ a("div", { ref: t, className: U("p-6 pt-0", e), ...r }) ); de.displayName = "CardContent"; -const Cr = L.forwardRef( +const Pr = L.forwardRef( ({ className: e, ...r }, t) => /* @__PURE__ */ a("div", { ref: t, className: U("flex items-center p-6 pt-0", e), ...r }) ); -Cr.displayName = "CardFooter"; -var xt = [ +Pr.displayName = "CardFooter"; +var Nt = [ "a", "button", "div", @@ -318,16 +318,16 @@ var xt = [ "span", "svg", "ul" -], wt = xt.reduce((e, r) => { - const t = /* @__PURE__ */ Ve(`Primitive.${r}`), n = L.forwardRef((o, i) => { +], St = Nt.reduce((e, r) => { + const t = /* @__PURE__ */ Be(`Primitive.${r}`), n = L.forwardRef((o, i) => { const { asChild: d, ...l } = o, s = d ? t : r; return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(s, { ...l, ref: i }); }); return n.displayName = `Primitive.${r}`, { ...e, [r]: n }; -}, {}), Nt = "Separator", tr = "horizontal", Ct = ["horizontal", "vertical"], Sr = L.forwardRef((e, r) => { - const { decorative: t, orientation: n = tr, ...o } = e, i = St(n) ? n : tr, l = t ? { role: "none" } : { "aria-orientation": i === "vertical" ? i : void 0, role: "separator" }; +}, {}), Ct = "Separator", nr = "horizontal", Et = ["horizontal", "vertical"], Tr = L.forwardRef((e, r) => { + const { decorative: t, orientation: n = nr, ...o } = e, i = Pt(n) ? n : nr, l = t ? { role: "none" } : { "aria-orientation": i === "vertical" ? i : void 0, role: "separator" }; return /* @__PURE__ */ a( - wt.div, + St.div, { "data-orientation": i, ...l, @@ -336,13 +336,13 @@ var xt = [ } ); }); -Sr.displayName = Nt; -function St(e) { - return Ct.includes(e); +Tr.displayName = Ct; +function Pt(e) { + return Et.includes(e); } -var Er = Sr; +var Rr = Tr; const ye = L.forwardRef(({ className: e, orientation: r = "horizontal", decorative: t = !0, ...n }, o) => /* @__PURE__ */ a( - Er, + Rr, { ref: o, decorative: t, @@ -351,23 +351,23 @@ const ye = L.forwardRef(({ className: e, orientation: r = "horizontal", decorati ...n } )); -ye.displayName = Er.displayName; -const Et = [ +ye.displayName = Rr.displayName; +const Tt = [ { label: "Returns & Refunds", href: "/returns" }, { label: "Shipping", href: "/shipping" }, { label: "Privacy Policy", href: "/privacy" }, { label: "Terms of Service", href: "/terms" } ]; -function Pr({ links: e = Et, className: r }) { +function Or({ links: e = Tt, className: r }) { return /* @__PURE__ */ a("nav", { className: U("flex flex-wrap items-center justify-center gap-y-2 text-xs text-muted-foreground", r), children: e.map((t, n) => /* @__PURE__ */ c(q.Fragment, { children: [ n > 0 && /* @__PURE__ */ a("span", { className: "mx-2 select-none", "aria-hidden": !0, children: "·" }), /* @__PURE__ */ a("a", { href: t.href, className: "hover:text-foreground hover:underline transition-colors", children: t.label }) ] }, t.href)) }); } -function Pt({ onCheckout: e, className: r }) { +function Rt({ onCheckout: e, className: r }) { const t = se((d) => d.items), n = se((d) => d.subtotal), o = se((d) => d.itemCount), i = se((d) => d.clearCart); return t.length === 0 ? /* @__PURE__ */ c("div", { className: U("flex flex-col items-center justify-center gap-6 py-24", r), children: [ - /* @__PURE__ */ a("div", { className: "flex h-24 w-24 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ a(Ge, { className: "h-10 w-10 text-muted-foreground" }) }), + /* @__PURE__ */ a("div", { className: "flex h-24 w-24 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ a(Xe, { className: "h-10 w-10 text-muted-foreground" }) }), /* @__PURE__ */ c("div", { className: "text-center", children: [ /* @__PURE__ */ a("h2", { className: "text-xl font-semibold", children: "Your cart is empty" }), /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-muted-foreground", children: "Add some products to get started." }) @@ -376,7 +376,7 @@ function Pt({ onCheckout: e, className: r }) { /* @__PURE__ */ c(ue, { children: [ /* @__PURE__ */ c(pe, { className: "flex-row items-center justify-between space-y-0", children: [ /* @__PURE__ */ c(he, { className: "flex items-center gap-2 text-xl", children: [ - /* @__PURE__ */ a(Ge, { className: "h-5 w-5" }), + /* @__PURE__ */ a(Xe, { className: "h-5 w-5" }), "Cart", /* @__PURE__ */ c("span", { className: "text-sm font-normal text-muted-foreground", children: [ "(", @@ -387,13 +387,13 @@ function Pt({ onCheckout: e, className: r }) { ] }) ] }), /* @__PURE__ */ c(te, { variant: "ghost", size: "sm", className: "text-destructive", onClick: i, children: [ - /* @__PURE__ */ a(br, { className: "mr-1 h-4 w-4" }), + /* @__PURE__ */ a(Nr, { className: "mr-1 h-4 w-4" }), "Clear" ] }) ] }), - /* @__PURE__ */ a(de, { className: "space-y-3", children: t.map((d) => /* @__PURE__ */ a(gt, { item: d }, d.id)) }), + /* @__PURE__ */ a(de, { className: "space-y-3", children: t.map((d) => /* @__PURE__ */ a(xt, { item: d }, d.id)) }), /* @__PURE__ */ a(ye, {}), - /* @__PURE__ */ c(Cr, { className: "flex-col items-stretch gap-4 pt-6", children: [ + /* @__PURE__ */ c(Pr, { className: "flex-col items-stretch gap-4 pt-6", children: [ /* @__PURE__ */ c("div", { className: "flex items-center justify-between text-lg font-semibold", children: [ /* @__PURE__ */ a("span", { children: "Subtotal" }), /* @__PURE__ */ c("span", { className: "tabular-nums", children: [ @@ -405,10 +405,10 @@ function Pt({ onCheckout: e, className: r }) { /* @__PURE__ */ a(te, { size: "lg", className: "w-full", onClick: e, children: "Proceed to Checkout" }) ] }) ] }), - /* @__PURE__ */ a(Pr, { className: "pt-2" }) + /* @__PURE__ */ a(Or, { className: "pt-2" }) ] }); } -function Tt({ tax: e, shipping: r, className: t }) { +function Ot({ tax: e, shipping: r, className: t }) { const n = se((s) => s.items), o = se((s) => s.subtotal), i = e ?? 0, d = r ?? 0, l = o + i + d; return /* @__PURE__ */ c(ue, { className: U("", t), children: [ /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a(he, { className: "text-lg", children: "Order Summary" }) }), @@ -472,7 +472,7 @@ const me = L.forwardRef( ) ); me.displayName = "Input"; -var Rt = [ +var kt = [ "a", "button", "div", @@ -490,14 +490,14 @@ var Rt = [ "span", "svg", "ul" -], kt = Rt.reduce((e, r) => { - const t = /* @__PURE__ */ Ve(`Primitive.${r}`), n = L.forwardRef((o, i) => { +], _t = kt.reduce((e, r) => { + const t = /* @__PURE__ */ Be(`Primitive.${r}`), n = L.forwardRef((o, i) => { const { asChild: d, ...l } = o, s = d ? t : r; return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(s, { ...l, ref: i }); }); return n.displayName = `Primitive.${r}`, { ...e, [r]: n }; -}, {}), Ot = "Label", Tr = L.forwardRef((e, r) => /* @__PURE__ */ a( - kt.label, +}, {}), jt = "Label", kr = L.forwardRef((e, r) => /* @__PURE__ */ a( + _t.label, { ...e, ref: r, @@ -507,16 +507,16 @@ var Rt = [ } } )); -Tr.displayName = Ot; -var Rr = Tr; -const _t = Be( +kr.displayName = jt; +var _r = kr; +const At = Je( "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" -), le = L.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ a(Rr, { ref: t, className: U(_t(), e), ...r })); -le.displayName = Rr.displayName; -function jt(e) { +), le = L.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ a(_r, { ref: t, className: U(At(), e), ...r })); +le.displayName = _r.displayName; +function It(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var We = { exports: {} }, Ce = { exports: {} }, I = {}; +var We = { exports: {} }, Se = { exports: {} }, I = {}; /** @license React v16.13.1 * react-is.production.min.js * @@ -525,12 +525,12 @@ var We = { exports: {} }, Ce = { exports: {} }, I = {}; * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var nr; -function At() { - if (nr) return I; - nr = 1; - var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, d = e ? Symbol.for("react.provider") : 60109, l = e ? Symbol.for("react.context") : 60110, s = e ? Symbol.for("react.async_mode") : 60111, p = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, g = e ? Symbol.for("react.suspense_list") : 60120, w = e ? Symbol.for("react.memo") : 60115, A = e ? Symbol.for("react.lazy") : 60116, C = e ? Symbol.for("react.block") : 60121, j = e ? Symbol.for("react.fundamental") : 60117, N = e ? Symbol.for("react.responder") : 60118, ne = e ? Symbol.for("react.scope") : 60119; - function k(f) { +var ar; +function $t() { + if (ar) return I; + ar = 1; + var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, d = e ? Symbol.for("react.provider") : 60109, l = e ? Symbol.for("react.context") : 60110, s = e ? Symbol.for("react.async_mode") : 60111, p = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, g = e ? Symbol.for("react.suspense_list") : 60120, w = e ? Symbol.for("react.memo") : 60115, A = e ? Symbol.for("react.lazy") : 60116, S = e ? Symbol.for("react.block") : 60121, j = e ? Symbol.for("react.fundamental") : 60117, N = e ? Symbol.for("react.responder") : 60118, ne = e ? Symbol.for("react.scope") : 60119; + function O(f) { if (typeof f == "object" && f !== null) { var Z = f.$$typeof; switch (Z) { @@ -561,35 +561,35 @@ function At() { } } function W(f) { - return k(f) === p; + return O(f) === p; } return I.AsyncMode = s, I.ConcurrentMode = p, I.ContextConsumer = l, I.ContextProvider = d, I.Element = r, I.ForwardRef = v, I.Fragment = n, I.Lazy = A, I.Memo = w, I.Portal = t, I.Profiler = i, I.StrictMode = o, I.Suspense = m, I.isAsyncMode = function(f) { - return W(f) || k(f) === s; + return W(f) || O(f) === s; }, I.isConcurrentMode = W, I.isContextConsumer = function(f) { - return k(f) === l; + return O(f) === l; }, I.isContextProvider = function(f) { - return k(f) === d; + return O(f) === d; }, I.isElement = function(f) { return typeof f == "object" && f !== null && f.$$typeof === r; }, I.isForwardRef = function(f) { - return k(f) === v; + return O(f) === v; }, I.isFragment = function(f) { - return k(f) === n; + return O(f) === n; }, I.isLazy = function(f) { - return k(f) === A; + return O(f) === A; }, I.isMemo = function(f) { - return k(f) === w; + return O(f) === w; }, I.isPortal = function(f) { - return k(f) === t; + return O(f) === t; }, I.isProfiler = function(f) { - return k(f) === i; + return O(f) === i; }, I.isStrictMode = function(f) { - return k(f) === o; + return O(f) === o; }, I.isSuspense = function(f) { - return k(f) === m; + return O(f) === m; }, I.isValidElementType = function(f) { - return typeof f == "string" || typeof f == "function" || f === n || f === p || f === i || f === o || f === m || f === g || typeof f == "object" && f !== null && (f.$$typeof === A || f.$$typeof === w || f.$$typeof === d || f.$$typeof === l || f.$$typeof === v || f.$$typeof === j || f.$$typeof === N || f.$$typeof === ne || f.$$typeof === C); - }, I.typeOf = k, I; + return typeof f == "string" || typeof f == "function" || f === n || f === p || f === i || f === o || f === m || f === g || typeof f == "object" && f !== null && (f.$$typeof === A || f.$$typeof === w || f.$$typeof === d || f.$$typeof === l || f.$$typeof === v || f.$$typeof === j || f.$$typeof === N || f.$$typeof === ne || f.$$typeof === S); + }, I.typeOf = O, I; } var $ = {}; /** @license React v16.13.1 @@ -600,13 +600,13 @@ var $ = {}; * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var ar; -function It() { - return ar || (ar = 1, process.env.NODE_ENV !== "production" && function() { - var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, d = e ? Symbol.for("react.provider") : 60109, l = e ? Symbol.for("react.context") : 60110, s = e ? Symbol.for("react.async_mode") : 60111, p = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, g = e ? Symbol.for("react.suspense_list") : 60120, w = e ? Symbol.for("react.memo") : 60115, A = e ? Symbol.for("react.lazy") : 60116, C = e ? Symbol.for("react.block") : 60121, j = e ? Symbol.for("react.fundamental") : 60117, N = e ? Symbol.for("react.responder") : 60118, ne = e ? Symbol.for("react.scope") : 60119; - function k(h) { +var or; +function Mt() { + return or || (or = 1, process.env.NODE_ENV !== "production" && function() { + var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, d = e ? Symbol.for("react.provider") : 60109, l = e ? Symbol.for("react.context") : 60110, s = e ? Symbol.for("react.async_mode") : 60111, p = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, g = e ? Symbol.for("react.suspense_list") : 60120, w = e ? Symbol.for("react.memo") : 60115, A = e ? Symbol.for("react.lazy") : 60116, S = e ? Symbol.for("react.block") : 60121, j = e ? Symbol.for("react.fundamental") : 60117, N = e ? Symbol.for("react.responder") : 60118, ne = e ? Symbol.for("react.scope") : 60119; + function O(h) { return typeof h == "string" || typeof h == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - h === n || h === p || h === i || h === o || h === m || h === g || typeof h == "object" && h !== null && (h.$$typeof === A || h.$$typeof === w || h.$$typeof === d || h.$$typeof === l || h.$$typeof === v || h.$$typeof === j || h.$$typeof === N || h.$$typeof === ne || h.$$typeof === C); + h === n || h === p || h === i || h === o || h === m || h === g || typeof h == "object" && h !== null && (h.$$typeof === A || h.$$typeof === w || h.$$typeof === d || h.$$typeof === l || h.$$typeof === v || h.$$typeof === j || h.$$typeof === N || h.$$typeof === ne || h.$$typeof === S); } function W(h) { if (typeof h == "object" && h !== null) { @@ -623,14 +623,14 @@ function It() { case m: return we; default: - var He = we && we.$$typeof; - switch (He) { + var Ge = we && we.$$typeof; + switch (Ge) { case l: case v: case A: case w: case d: - return He; + return Ge; default: return ie; } @@ -662,13 +662,13 @@ function It() { function R(h) { return W(h) === n; } - function S(h) { + function C(h) { return W(h) === A; } function T(h) { return W(h) === w; } - function O(h) { + function k(h) { return W(h) === t; } function M(h) { @@ -680,22 +680,22 @@ function It() { function G(h) { return W(h) === m; } - $.AsyncMode = f, $.ConcurrentMode = Z, $.ContextConsumer = ce, $.ContextProvider = Q, $.Element = D, $.ForwardRef = b, $.Fragment = Y, $.Lazy = z, $.Memo = ee, $.Portal = B, $.Profiler = H, $.StrictMode = re, $.Suspense = oe, $.isAsyncMode = ge, $.isConcurrentMode = u, $.isContextConsumer = y, $.isContextProvider = E, $.isElement = P, $.isForwardRef = x, $.isFragment = R, $.isLazy = S, $.isMemo = T, $.isPortal = O, $.isProfiler = M, $.isStrictMode = _, $.isSuspense = G, $.isValidElementType = k, $.typeOf = W; + $.AsyncMode = f, $.ConcurrentMode = Z, $.ContextConsumer = ce, $.ContextProvider = Q, $.Element = D, $.ForwardRef = b, $.Fragment = Y, $.Lazy = z, $.Memo = ee, $.Portal = B, $.Profiler = H, $.StrictMode = re, $.Suspense = oe, $.isAsyncMode = ge, $.isConcurrentMode = u, $.isContextConsumer = y, $.isContextProvider = E, $.isElement = P, $.isForwardRef = x, $.isFragment = R, $.isLazy = C, $.isMemo = T, $.isPortal = k, $.isProfiler = M, $.isStrictMode = _, $.isSuspense = G, $.isValidElementType = O, $.typeOf = W; }()), $; } -var or; -function kr() { - return or || (or = 1, process.env.NODE_ENV === "production" ? Ce.exports = At() : Ce.exports = It()), Ce.exports; +var ir; +function jr() { + return ir || (ir = 1, process.env.NODE_ENV === "production" ? Se.exports = $t() : Se.exports = Mt()), Se.exports; } /* object-assign (c) Sindre Sorhus @license MIT */ -var je, ir; -function $t() { - if (ir) return je; - ir = 1; +var je, sr; +function Lt() { + if (sr) return je; + sr = 1; var e = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable; function n(i) { if (i == null) @@ -738,25 +738,25 @@ function $t() { return s; }, je; } -var Ae, sr; -function Je() { - if (sr) return Ae; - sr = 1; +var Ae, cr; +function He() { + if (cr) return Ae; + cr = 1; var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; return Ae = e, Ae; } -var Ie, cr; -function Or() { - return cr || (cr = 1, Ie = Function.call.bind(Object.prototype.hasOwnProperty)), Ie; +var Ie, lr; +function Ar() { + return lr || (lr = 1, Ie = Function.call.bind(Object.prototype.hasOwnProperty)), Ie; } -var $e, lr; -function Mt() { - if (lr) return $e; - lr = 1; +var $e, ur; +function Ft() { + if (ur) return $e; + ur = 1; var e = function() { }; if (process.env.NODE_ENV !== "production") { - var r = Je(), t = {}, n = Or(); + var r = He(), t = {}, n = Ar(); e = function(i) { var d = "Warning: " + i; typeof console < "u" && console.error(d); @@ -798,11 +798,11 @@ function Mt() { process.env.NODE_ENV !== "production" && (t = {}); }, $e = o, $e; } -var Me, ur; -function Lt() { - if (ur) return Me; - ur = 1; - var e = kr(), r = $t(), t = Je(), n = Or(), o = Mt(), i = function() { +var Me, dr; +function qt() { + if (dr) return Me; + dr = 1; + var e = jr(), r = Lt(), t = He(), n = Ar(), o = Ft(), i = function() { }; process.env.NODE_ENV !== "production" && (i = function(l) { var s = "Warning: " + l; @@ -832,7 +832,7 @@ function Lt() { string: N("string"), symbol: N("symbol"), any: ne(), - arrayOf: k, + arrayOf: O, element: W(), elementType: f(), instanceOf: Z, @@ -846,40 +846,40 @@ function Lt() { function A(u, y) { return u === y ? u !== 0 || 1 / u === 1 / y : u !== u && y !== y; } - function C(u, y) { + function S(u, y) { this.message = u, this.data = y && typeof y == "object" ? y : {}, this.stack = ""; } - C.prototype = Error.prototype; + S.prototype = Error.prototype; function j(u) { if (process.env.NODE_ENV !== "production") var y = {}, E = 0; - function P(R, S, T, O, M, _, G) { - if (O = O || g, _ = _ || T, G !== t) { + function P(R, C, T, k, M, _, G) { + if (k = k || g, _ = _ || T, G !== t) { if (s) { var h = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" ); throw h.name = "Invariant Violation", h; } else if (process.env.NODE_ENV !== "production" && typeof console < "u") { - var ie = O + ":" + T; + var ie = k + ":" + T; !y[ie] && // Avoid spamming the console because they are often not actionable except for lib authors E < 3 && (i( - "You are manually calling a React.PropTypes validation function for the `" + _ + "` prop on `" + O + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." + "You are manually calling a React.PropTypes validation function for the `" + _ + "` prop on `" + k + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." ), y[ie] = !0, E++); } } - return S[T] == null ? R ? S[T] === null ? new C("The " + M + " `" + _ + "` is marked as required " + ("in `" + O + "`, but its value is `null`.")) : new C("The " + M + " `" + _ + "` is marked as required in " + ("`" + O + "`, but its value is `undefined`.")) : null : u(S, T, O, M, _); + return C[T] == null ? R ? C[T] === null ? new S("The " + M + " `" + _ + "` is marked as required " + ("in `" + k + "`, but its value is `null`.")) : new S("The " + M + " `" + _ + "` is marked as required in " + ("`" + k + "`, but its value is `undefined`.")) : null : u(C, T, k, M, _); } var x = P.bind(null, !1); return x.isRequired = P.bind(null, !0), x; } function N(u) { - function y(E, P, x, R, S, T) { - var O = E[P], M = re(O); + function y(E, P, x, R, C, T) { + var k = E[P], M = re(k); if (M !== u) { - var _ = oe(O); - return new C( - "Invalid " + R + " `" + S + "` of type " + ("`" + _ + "` supplied to `" + x + "`, expected ") + ("`" + u + "`."), + var _ = oe(k); + return new S( + "Invalid " + R + " `" + C + "` of type " + ("`" + _ + "` supplied to `" + x + "`, expected ") + ("`" + u + "`."), { expectedType: u } ); } @@ -890,17 +890,17 @@ function Lt() { function ne() { return j(d); } - function k(u) { - function y(E, P, x, R, S) { + function O(u) { + function y(E, P, x, R, C) { if (typeof u != "function") - return new C("Property `" + S + "` of component `" + x + "` has invalid PropType notation inside arrayOf."); + return new S("Property `" + C + "` of component `" + x + "` has invalid PropType notation inside arrayOf."); var T = E[P]; if (!Array.isArray(T)) { - var O = re(T); - return new C("Invalid " + R + " `" + S + "` of type " + ("`" + O + "` supplied to `" + x + "`, expected an array.")); + var k = re(T); + return new S("Invalid " + R + " `" + C + "` of type " + ("`" + k + "` supplied to `" + x + "`, expected an array.")); } for (var M = 0; M < T.length; M++) { - var _ = u(T, M, x, R, S + "[" + M + "]", t); + var _ = u(T, M, x, R, C + "[" + M + "]", t); if (_ instanceof Error) return _; } @@ -910,10 +910,10 @@ function Lt() { } function W() { function u(y, E, P, x, R) { - var S = y[E]; - if (!l(S)) { - var T = re(S); - return new C("Invalid " + x + " `" + R + "` of type " + ("`" + T + "` supplied to `" + P + "`, expected a single ReactElement.")); + var C = y[E]; + if (!l(C)) { + var T = re(C); + return new S("Invalid " + x + " `" + R + "` of type " + ("`" + T + "` supplied to `" + P + "`, expected a single ReactElement.")); } return null; } @@ -921,20 +921,20 @@ function Lt() { } function f() { function u(y, E, P, x, R) { - var S = y[E]; - if (!e.isValidElementType(S)) { - var T = re(S); - return new C("Invalid " + x + " `" + R + "` of type " + ("`" + T + "` supplied to `" + P + "`, expected a single ReactElement type.")); + var C = y[E]; + if (!e.isValidElementType(C)) { + var T = re(C); + return new S("Invalid " + x + " `" + R + "` of type " + ("`" + T + "` supplied to `" + P + "`, expected a single ReactElement type.")); } return null; } return j(u); } function Z(u) { - function y(E, P, x, R, S) { + function y(E, P, x, R, C) { if (!(E[P] instanceof u)) { - var T = u.name || g, O = ge(E[P]); - return new C("Invalid " + R + " `" + S + "` of type " + ("`" + O + "` supplied to `" + x + "`, expected ") + ("instance of `" + T + "`.")); + var T = u.name || g, k = ge(E[P]); + return new S("Invalid " + R + " `" + C + "` of type " + ("`" + k + "` supplied to `" + x + "`, expected ") + ("instance of `" + T + "`.")); } return null; } @@ -945,28 +945,28 @@ function Lt() { return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i( "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." ) : i("Invalid argument supplied to oneOf, expected an array.")), d; - function y(E, P, x, R, S) { - for (var T = E[P], O = 0; O < u.length; O++) - if (A(T, u[O])) + function y(E, P, x, R, C) { + for (var T = E[P], k = 0; k < u.length; k++) + if (A(T, u[k])) return null; var M = JSON.stringify(u, function(G, h) { var ie = oe(h); return ie === "symbol" ? String(h) : h; }); - return new C("Invalid " + R + " `" + S + "` of value `" + String(T) + "` " + ("supplied to `" + x + "`, expected one of " + M + ".")); + return new S("Invalid " + R + " `" + C + "` of value `" + String(T) + "` " + ("supplied to `" + x + "`, expected one of " + M + ".")); } return j(y); } function Q(u) { - function y(E, P, x, R, S) { + function y(E, P, x, R, C) { if (typeof u != "function") - return new C("Property `" + S + "` of component `" + x + "` has invalid PropType notation inside objectOf."); - var T = E[P], O = re(T); - if (O !== "object") - return new C("Invalid " + R + " `" + S + "` of type " + ("`" + O + "` supplied to `" + x + "`, expected an object.")); + return new S("Property `" + C + "` of component `" + x + "` has invalid PropType notation inside objectOf."); + var T = E[P], k = re(T); + if (k !== "object") + return new S("Invalid " + R + " `" + C + "` of type " + ("`" + k + "` supplied to `" + x + "`, expected an object.")); for (var M in T) if (n(T, M)) { - var _ = u(T, M, x, R, S + "." + M, t); + var _ = u(T, M, x, R, C + "." + M, t); if (_ instanceof Error) return _; } @@ -984,39 +984,39 @@ function Lt() { "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + V(E) + " at index " + y + "." ), d; } - function P(x, R, S, T, O) { + function P(x, R, C, T, k) { for (var M = [], _ = 0; _ < u.length; _++) { - var G = u[_], h = G(x, R, S, T, O, t); + var G = u[_], h = G(x, R, C, T, k, t); if (h == null) return null; h.data && n(h.data, "expectedType") && M.push(h.data.expectedType); } var ie = M.length > 0 ? ", expected one of type [" + M.join(", ") + "]" : ""; - return new C("Invalid " + T + " `" + O + "` supplied to " + ("`" + S + "`" + ie + ".")); + return new S("Invalid " + T + " `" + k + "` supplied to " + ("`" + C + "`" + ie + ".")); } return j(P); } function b() { function u(y, E, P, x, R) { - return B(y[E]) ? null : new C("Invalid " + x + " `" + R + "` supplied to " + ("`" + P + "`, expected a ReactNode.")); + return B(y[E]) ? null : new S("Invalid " + x + " `" + R + "` supplied to " + ("`" + P + "`, expected a ReactNode.")); } return j(u); } function Y(u, y, E, P, x) { - return new C( + return new S( (u || "React class") + ": " + y + " type `" + E + "." + P + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + x + "`." ); } function z(u) { - function y(E, P, x, R, S) { - var T = E[P], O = re(T); - if (O !== "object") - return new C("Invalid " + R + " `" + S + "` of type `" + O + "` " + ("supplied to `" + x + "`, expected `object`.")); + function y(E, P, x, R, C) { + var T = E[P], k = re(T); + if (k !== "object") + return new S("Invalid " + R + " `" + C + "` of type `" + k + "` " + ("supplied to `" + x + "`, expected `object`.")); for (var M in u) { var _ = u[M]; if (typeof _ != "function") - return Y(x, R, S, M, oe(_)); - var G = _(T, M, x, R, S + "." + M, t); + return Y(x, R, C, M, oe(_)); + var G = _(T, M, x, R, C + "." + M, t); if (G) return G; } @@ -1025,21 +1025,21 @@ function Lt() { return j(y); } function ee(u) { - function y(E, P, x, R, S) { - var T = E[P], O = re(T); - if (O !== "object") - return new C("Invalid " + R + " `" + S + "` of type `" + O + "` " + ("supplied to `" + x + "`, expected `object`.")); + function y(E, P, x, R, C) { + var T = E[P], k = re(T); + if (k !== "object") + return new S("Invalid " + R + " `" + C + "` of type `" + k + "` " + ("supplied to `" + x + "`, expected `object`.")); var M = r({}, E[P], u); for (var _ in M) { var G = u[_]; if (n(u, _) && typeof G != "function") - return Y(x, R, S, _, oe(G)); + return Y(x, R, C, _, oe(G)); if (!G) - return new C( - "Invalid " + R + " `" + S + "` key `" + _ + "` supplied to `" + x + "`.\nBad object: " + JSON.stringify(E[P], null, " ") + ` + return new S( + "Invalid " + R + " `" + C + "` key `" + _ + "` supplied to `" + x + "`.\nBad object: " + JSON.stringify(E[P], null, " ") + ` Valid keys: ` + JSON.stringify(Object.keys(u), null, " ") ); - var h = G(T, _, x, R, S + "." + _, t); + var h = G(T, _, x, R, C + "." + _, t); if (h) return h; } @@ -1119,11 +1119,11 @@ Valid keys: ` + JSON.stringify(Object.keys(u), null, " ") return w.checkPropTypes = o, w.resetWarningCache = o.resetWarningCache, w.PropTypes = w, w; }, Me; } -var Le, dr; -function Ft() { - if (dr) return Le; - dr = 1; - var e = Je(); +var Le, fr; +function Dt() { + if (fr) return Le; + fr = 1; + var e = He(); function r() { } function t() { @@ -1168,13 +1168,13 @@ function Ft() { }, Le; } if (process.env.NODE_ENV !== "production") { - var qt = kr(), Dt = !0; - We.exports = Lt()(qt.isElement, Dt); + var Wt = jr(), Ut = !0; + We.exports = qt()(Wt.isElement, Ut); } else - We.exports = Ft()(); -var Wt = We.exports; -const F = /* @__PURE__ */ jt(Wt); -function fr(e, r) { + We.exports = Dt()(); +var Yt = We.exports; +const F = /* @__PURE__ */ It(Yt); +function mr(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); @@ -1184,12 +1184,12 @@ function fr(e, r) { } return t; } -function mr(e) { +function pr(e) { for (var r = 1; r < arguments.length; r++) { var t = arguments[r] != null ? arguments[r] : {}; - r % 2 ? fr(Object(t), !0).forEach(function(n) { - _r(e, n, t[n]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : fr(Object(t)).forEach(function(n) { + r % 2 ? mr(Object(t), !0).forEach(function(n) { + Ir(e, n, t[n]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : mr(Object(t)).forEach(function(n) { Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n)); }); } @@ -1203,7 +1203,7 @@ function Te(e) { return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r; }, Te(e); } -function _r(e, r, t) { +function Ir(e, r, t) { return r in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, @@ -1211,16 +1211,16 @@ function _r(e, r, t) { writable: !0 }) : e[r] = t, e; } -function Ut(e, r) { +function zt(e, r) { if (e == null) return {}; var t = {}, n = Object.keys(e), o, i; for (i = 0; i < n.length; i++) o = n[i], !(r.indexOf(o) >= 0) && (t[o] = e[o]); return t; } -function Yt(e, r) { +function Vt(e, r) { if (e == null) return {}; - var t = Ut(e, r), n, o; + var t = zt(e, r), n, o; if (Object.getOwnPropertySymbols) { var i = Object.getOwnPropertySymbols(e); for (o = 0; o < i.length; o++) @@ -1228,13 +1228,13 @@ function Yt(e, r) { } return t; } -function jr(e, r) { - return zt(e) || Vt(e, r) || Bt(e, r) || Jt(); +function $r(e, r) { + return Bt(e) || Jt(e, r) || Ht(e, r) || Gt(); } -function zt(e) { +function Bt(e) { if (Array.isArray(e)) return e; } -function Vt(e, r) { +function Jt(e, r) { var t = e && (typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]); if (t != null) { var n = [], o = !0, i = !1, d, l; @@ -1253,20 +1253,20 @@ function Vt(e, r) { return n; } } -function Bt(e, r) { +function Ht(e, r) { if (e) { - if (typeof e == "string") return pr(e, r); + if (typeof e == "string") return hr(e, r); var t = Object.prototype.toString.call(e).slice(8, -1); if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set") return Array.from(e); - if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return pr(e, r); + if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return hr(e, r); } } -function pr(e, r) { +function hr(e, r) { (r == null || r > e.length) && (r = e.length); for (var t = 0, n = new Array(r); t < r; t++) n[t] = e[t]; return n; } -function Jt() { +function Gt() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } @@ -1292,16 +1292,16 @@ var J = function(r, t, n) { }, [r]), t.current; }, ve = function(r) { return r !== null && Te(r) === "object"; -}, Ht = function(r) { +}, Xt = function(r) { return ve(r) && typeof r.then == "function"; -}, Gt = function(r) { +}, Kt = function(r) { return ve(r) && typeof r.elements == "function" && typeof r.createToken == "function" && typeof r.createPaymentMethod == "function" && typeof r.confirmCardPayment == "function"; -}, hr = "[object Object]", Xt = function e(r, t) { +}, yr = "[object Object]", Qt = function e(r, t) { if (!ve(r) || !ve(t)) return r === t; var n = Array.isArray(r), o = Array.isArray(t); if (n !== o) return !1; - var i = Object.prototype.toString.call(r) === hr, d = Object.prototype.toString.call(t) === hr; + var i = Object.prototype.toString.call(r) === yr, d = Object.prototype.toString.call(t) === yr; if (i !== d) return !1; if (!i && !n) return r === t; var l = Object.keys(r), s = Object.keys(t); @@ -1313,37 +1313,37 @@ var J = function(r, t, n) { var g = Object.keys(p); if (g.length !== l.length) return !1; - var w = r, A = t, C = function(N) { + var w = r, A = t, S = function(N) { return e(w[N], A[N]); }; - return g.every(C); -}, Ar = function(r, t, n) { + return g.every(S); +}, Mr = function(r, t, n) { return ve(r) ? Object.keys(r).reduce(function(o, i) { - var d = !ve(t) || !Xt(r[i], t[i]); - return n.includes(i) ? (d && console.warn("Unsupported prop change: options.".concat(i, " is not a mutable property.")), o) : d ? mr(mr({}, o || {}), {}, _r({}, i, r[i])) : o; + var d = !ve(t) || !Qt(r[i], t[i]); + return n.includes(i) ? (d && console.warn("Unsupported prop change: options.".concat(i, " is not a mutable property.")), o) : d ? pr(pr({}, o || {}), {}, Ir({}, i, r[i])) : o; }, null) : null; -}, Ir = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", yr = function(r) { - var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ir; - if (r === null || Gt(r)) +}, Lr = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", vr = function(r) { + var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Lr; + if (r === null || Kt(r)) return r; throw new Error(t); -}, Kt = function(r) { - var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ir; - if (Ht(r)) +}, Zt = function(r) { + var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Lr; + if (Xt(r)) return { tag: "async", stripePromise: Promise.resolve(r).then(function(o) { - return yr(o, t); + return vr(o, t); }) }; - var n = yr(r, t); + var n = vr(r, t); return n === null ? { tag: "empty" } : { tag: "sync", stripe: n }; -}, Qt = function(r) { +}, en = function(r) { !r || !r._registerWrapper || !r.registerAppInfo || (r._registerWrapper({ name: "react-stripe-js", version: "5.6.0" @@ -1352,27 +1352,27 @@ var J = function(r, t, n) { version: "5.6.0", url: "https://stripe.com/docs/stripe-js/react" })); -}, Oe = /* @__PURE__ */ q.createContext(null); -Oe.displayName = "ElementsContext"; -var $r = function(r, t) { +}, ke = /* @__PURE__ */ q.createContext(null); +ke.displayName = "ElementsContext"; +var Fr = function(r, t) { if (!r) throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t, " in an provider.")); return r; -}, Mr = function(r) { +}, qr = function(r) { var t = r.stripe, n = r.options, o = r.children, i = q.useMemo(function() { - return Kt(t); + return Zt(t); }, [t]), d = q.useState(function() { return { stripe: i.tag === "sync" ? i.stripe : null, elements: i.tag === "sync" ? i.stripe.elements(n) : null }; - }), l = jr(d, 2), s = l[0], p = l[1]; + }), l = $r(d, 2), s = l[0], p = l[1]; q.useEffect(function() { - var g = !0, w = function(C) { + var g = !0, w = function(S) { p(function(j) { return j.stripe ? j : { - stripe: C, - elements: C.elements(n) + stripe: S, + elements: S.elements(n) }; }); }; @@ -1389,50 +1389,50 @@ var $r = function(r, t) { var m = Ue(n); return q.useEffect(function() { if (s.elements) { - var g = Ar(n, m, ["clientSecret", "fonts"]); + var g = Mr(n, m, ["clientSecret", "fonts"]); g && s.elements.update(g); } }, [n, m, s.elements]), q.useEffect(function() { - Qt(s.stripe); - }, [s.stripe]), /* @__PURE__ */ q.createElement(Oe.Provider, { + en(s.stripe); + }, [s.stripe]), /* @__PURE__ */ q.createElement(ke.Provider, { value: s }, o); }; -Mr.propTypes = { +qr.propTypes = { stripe: F.any, options: F.object }; -var Zt = function(r) { - var t = q.useContext(Oe); - return $r(t, r); -}, en = function() { - var r = Zt("calls useElements()"), t = r.elements; +var rn = function(r) { + var t = q.useContext(ke); + return Fr(t, r); +}, tn = function() { + var r = rn("calls useElements()"), t = r.elements; return t; }; F.func.isRequired; -var Lr = /* @__PURE__ */ q.createContext(null); -Lr.displayName = "CheckoutContext"; +var Dr = /* @__PURE__ */ q.createContext(null); +Dr.displayName = "CheckoutContext"; F.any, F.shape({ clientSecret: F.oneOfType([F.string, F.instanceOf(Promise)]).isRequired, elementsOptions: F.object }).isRequired; var Ye = function(r) { - var t = q.useContext(Lr), n = q.useContext(Oe); + var t = q.useContext(Dr), n = q.useContext(ke); if (t) { if (n) throw new Error("You cannot wrap the part of your app that ".concat(r, " in both and providers.")); return t; } else - return $r(n, r); -}, rn = ["mode"], tn = function(r) { + return Fr(n, r); +}, nn = ["mode"], an = function(r) { return r.charAt(0).toUpperCase() + r.slice(1); }, X = function(r, t) { - var n = "".concat(tn(r), "Element"), o = function(s) { - var p = s.id, v = s.className, m = s.options, g = m === void 0 ? {} : m, w = s.onBlur, A = s.onFocus, C = s.onReady, j = s.onChange, N = s.onEscape, ne = s.onClick, k = s.onLoadError, W = s.onLoaderStart, f = s.onNetworksChange, Z = s.onConfirm, ce = s.onCancel, Q = s.onShippingAddressChange, D = s.onShippingRateChange, b = s.onSavedPaymentMethodRemove, Y = s.onSavedPaymentMethodUpdate, z = Ye("mounts <".concat(n, ">")), ee = "elements" in z ? z.elements : null, B = "checkoutState" in z ? z.checkoutState : null, H = (B == null ? void 0 : B.type) === "success" || (B == null ? void 0 : B.type) === "loading" ? B.sdk : null, re = q.useState(null), oe = jr(re, 2), V = oe[0], ge = oe[1], u = q.useRef(null), y = q.useRef(null); - J(V, "blur", w), J(V, "focus", A), J(V, "escape", N), J(V, "click", ne), J(V, "loaderror", k), J(V, "loaderstart", W), J(V, "networkschange", f), J(V, "confirm", Z), J(V, "cancel", ce), J(V, "shippingaddresschange", Q), J(V, "shippingratechange", D), J(V, "savedpaymentmethodremove", b), J(V, "savedpaymentmethodupdate", Y), J(V, "change", j); + var n = "".concat(an(r), "Element"), o = function(s) { + var p = s.id, v = s.className, m = s.options, g = m === void 0 ? {} : m, w = s.onBlur, A = s.onFocus, S = s.onReady, j = s.onChange, N = s.onEscape, ne = s.onClick, O = s.onLoadError, W = s.onLoaderStart, f = s.onNetworksChange, Z = s.onConfirm, ce = s.onCancel, Q = s.onShippingAddressChange, D = s.onShippingRateChange, b = s.onSavedPaymentMethodRemove, Y = s.onSavedPaymentMethodUpdate, z = Ye("mounts <".concat(n, ">")), ee = "elements" in z ? z.elements : null, B = "checkoutState" in z ? z.checkoutState : null, H = (B == null ? void 0 : B.type) === "success" || (B == null ? void 0 : B.type) === "loading" ? B.sdk : null, re = q.useState(null), oe = $r(re, 2), V = oe[0], ge = oe[1], u = q.useRef(null), y = q.useRef(null); + J(V, "blur", w), J(V, "focus", A), J(V, "escape", N), J(V, "click", ne), J(V, "loaderror", O), J(V, "loaderstart", W), J(V, "networkschange", f), J(V, "confirm", Z), J(V, "cancel", ce), J(V, "shippingaddresschange", Q), J(V, "shippingratechange", D), J(V, "savedpaymentmethodremove", b), J(V, "savedpaymentmethodupdate", Y), J(V, "change", j); var E; - C && (r === "expressCheckout" ? E = C : E = function() { - C(V); + S && (r === "expressCheckout" ? E = S : E = function() { + S(V); }), J(V, "ready", E), q.useLayoutEffect(function() { if (u.current === null && y.current !== null && (ee || H)) { var x = null; @@ -1446,11 +1446,11 @@ var Ye = function(r) { break; case "address": if ("mode" in g) { - var R = g.mode, S = Yt(g, rn); + var R = g.mode, C = Vt(g, nn); if (R === "shipping") - x = H.createShippingAddressElement(S); + x = H.createShippingAddressElement(C); else if (R === "billing") - x = H.createBillingAddressElement(S); + x = H.createBillingAddressElement(C); else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'."); } else @@ -1475,7 +1475,7 @@ var Ye = function(r) { var P = Ue(g); return q.useEffect(function() { if (u.current) { - var x = Ar(g, P, ["paymentRequest"]); + var x = Mr(g, P, ["paymentRequest"]); x && "update" in u.current && u.current.update(x); } }, [g, P]), q.useLayoutEffect(function() { @@ -1519,9 +1519,9 @@ var Ye = function(r) { onSavedPaymentMethodUpdate: F.func, options: F.object }, d.displayName = n, d.__elementType = r, d; -}, K = typeof window > "u", nn = /* @__PURE__ */ q.createContext(null); -nn.displayName = "EmbeddedCheckoutProviderContext"; -var an = function() { +}, K = typeof window > "u", on = /* @__PURE__ */ q.createContext(null); +on.displayName = "EmbeddedCheckoutProviderContext"; +var sn = function() { var r = Ye("calls useStripe()"), t = r.stripe; return t; }; @@ -1531,31 +1531,31 @@ X("cardNumber", K); X("cardExpiry", K); X("cardCvc", K); X("iban", K); -var on = X("payment", K); +var cn = X("payment", K); X("expressCheckout", K); X("paymentRequestButton", K); -var sn = X("linkAuthentication", K); +var ln = X("linkAuthentication", K); X("address", K); X("shippingAddress", K); X("paymentMethodMessaging", K); X("taxId", K); -function cn({ +function un({ onPaymentSuccess: e, returnUrl: r, defaultEmail: t, defaultName: n }) { - const o = an(), i = en(), [d, l] = ae(null), [s, p] = ae(!1); + const o = sn(), i = tn(), [d, l] = ae(null), [s, p] = ae(!1); return /* @__PURE__ */ c("div", { className: "space-y-4", children: [ /* @__PURE__ */ a( - sn, + ln, { id: "link-authentication-element", options: t ? { defaultValues: { email: t } } : void 0 } ), /* @__PURE__ */ a( - on, + cn, { id: "payment-element", options: { @@ -1591,8 +1591,8 @@ function cn({ disabled: s || !o || !i, className: "w-full", size: "lg", - children: s ? /* @__PURE__ */ c(Ur, { children: [ - /* @__PURE__ */ a(Vr, { className: "mr-2 h-4 w-4 animate-spin" }), + children: s ? /* @__PURE__ */ c(zr, { children: [ + /* @__PURE__ */ a(Jr, { className: "mr-2 h-4 w-4 animate-spin" }), "Processing…" ] }) : "Pay now" } @@ -1600,7 +1600,7 @@ function cn({ d && /* @__PURE__ */ a("p", { className: "text-sm text-destructive text-center", children: d }) ] }); } -function ln({ +function dn({ onPlaceOrder: e, onSaveAddress: r, onBackToCart: t, @@ -1614,14 +1614,14 @@ function ln({ stripeReturnUrl: v, className: m }) { - const g = se((b) => b.itemCount), [w, A] = ae("shopify"), [C, j] = ae(!1), N = (o == null ? void 0 : o.find((b) => b.isDefault)) ?? (o == null ? void 0 : o[0]), ne = () => ({ + const g = se((b) => b.itemCount), [w, A] = ae("shopify"), [S, j] = ae(!1), N = (o == null ? void 0 : o.find((b) => b.isDefault)) ?? (o == null ? void 0 : o[0]), ne = () => ({ fullName: (N == null ? void 0 : N.fullName) ?? (n == null ? void 0 : n.fullName) ?? "", email: (N == null ? void 0 : N.email) ?? (n == null ? void 0 : n.email) ?? "", address: (N == null ? void 0 : N.address) ?? (n == null ? void 0 : n.address) ?? "", city: (N == null ? void 0 : N.city) ?? (n == null ? void 0 : n.city) ?? "", zip: (N == null ? void 0 : N.zip) ?? (n == null ? void 0 : n.zip) ?? "", country: (N == null ? void 0 : N.country) ?? (n == null ? void 0 : n.country) ?? "" - }), [k, W] = ae(ne), [f, Z] = ae( + }), [O, W] = ae(ne), [f, Z] = ae( (N == null ? void 0 : N.id) ?? "custom" ), ce = (b) => { if (Z(b), b === "custom") return; @@ -1635,10 +1635,10 @@ function ln({ country: Y.country }); }, Q = (b, Y) => W((z) => ({ ...z, [b]: Y })), D = (b) => { - b.preventDefault(), C && f === "custom" && r && r(k), e == null || e({ shipping: k, paymentMethod: w }); + b.preventDefault(), S && f === "custom" && r && r(O), e == null || e({ shipping: O, paymentMethod: w }); }; return g === 0 ? /* @__PURE__ */ c("div", { className: U("flex flex-col items-center justify-center gap-6 py-24", m), children: [ - /* @__PURE__ */ a(Br, { className: "h-12 w-12 text-muted-foreground" }), + /* @__PURE__ */ a(Hr, { className: "h-12 w-12 text-muted-foreground" }), /* @__PURE__ */ a("p", { className: "text-muted-foreground", children: "Your cart is empty — nothing to check out." }), t && /* @__PURE__ */ a(te, { variant: "outline", onClick: t, children: "Back to Cart" }) ] }) : /* @__PURE__ */ a("div", { className: U("w-full mx-auto max-w-5xl px-4 py-8 overflow-x-hidden", m), children: /* @__PURE__ */ c( @@ -1653,7 +1653,7 @@ function ln({ /* @__PURE__ */ c(de, { className: "space-y-4", children: [ o && o.length > 0 && /* @__PURE__ */ c("div", { className: "space-y-2", children: [ /* @__PURE__ */ c(le, { className: "text-sm font-medium flex items-center gap-1.5", children: [ - /* @__PURE__ */ a(Xe, { className: "h-4 w-4" }), + /* @__PURE__ */ a(Ke, { className: "h-4 w-4" }), "Saved Addresses" ] }), /* @__PURE__ */ c("div", { className: "space-y-2", children: [ @@ -1667,7 +1667,7 @@ function ln({ f === b.id ? "border-primary bg-primary/5" : "border-border hover:bg-accent/5" ), children: [ - /* @__PURE__ */ a(Xe, { className: "h-4 w-4 mt-0.5 shrink-0" }), + /* @__PURE__ */ a(Ke, { className: "h-4 w-4 mt-0.5 shrink-0" }), /* @__PURE__ */ c("div", { className: "min-w-0", children: [ /* @__PURE__ */ c("p", { className: "font-medium", children: [ b.label || b.fullName, @@ -1711,7 +1711,7 @@ function ln({ id: "ck-name", required: !0, placeholder: "Jane Doe", - value: k.fullName, + value: O.fullName, onChange: (b) => Q("fullName", b.target.value) } ) @@ -1725,7 +1725,7 @@ function ln({ type: "email", required: !0, placeholder: "jane@example.com", - value: k.email, + value: O.email, onChange: (b) => Q("email", b.target.value) } ) @@ -1738,7 +1738,7 @@ function ln({ id: "ck-address", required: !0, placeholder: "123 Main St", - value: k.address, + value: O.address, onChange: (b) => Q("address", b.target.value) } ) @@ -1751,7 +1751,7 @@ function ln({ id: "ck-city", required: !0, placeholder: "New York", - value: k.city, + value: O.city, onChange: (b) => Q("city", b.target.value) } ) @@ -1764,7 +1764,7 @@ function ln({ id: "ck-zip", required: !0, placeholder: "10001", - value: k.zip, + value: O.zip, onChange: (b) => Q("zip", b.target.value) } ) @@ -1777,7 +1777,7 @@ function ln({ id: "ck-country", required: !0, placeholder: "United States", - value: k.country, + value: O.country, onChange: (b) => Q("country", b.target.value) } ) @@ -1788,13 +1788,13 @@ function ln({ { type: "checkbox", id: "ck-save-address", - checked: C, + checked: S, onChange: (b) => j(b.target.checked), className: "h-4 w-4 rounded border-gray-300 accent-primary" } ), /* @__PURE__ */ c(le, { htmlFor: "ck-save-address", className: "text-sm font-normal cursor-pointer flex items-center gap-1.5", children: [ - /* @__PURE__ */ a(Jr, { className: "h-3.5 w-3.5" }), + /* @__PURE__ */ a(Gr, { className: "h-3.5 w-3.5" }), "Save this address for future orders" ] }) ] }) @@ -1814,7 +1814,7 @@ function ln({ w === "shopify" ? "border-primary bg-primary/5" : "border-border hover:bg-accent/5" ), children: [ - /* @__PURE__ */ a(Ke, { className: "h-5 w-5 shrink-0" }), + /* @__PURE__ */ a(Qe, { className: "h-5 w-5 shrink-0" }), /* @__PURE__ */ c("div", { children: [ /* @__PURE__ */ a("p", { className: "font-medium", children: "Shopify Checkout" }), /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground", children: "Credit / debit card via Shopify" }) @@ -1832,7 +1832,7 @@ function ln({ w === "crypto" ? "border-primary bg-primary/5" : "border-border hover:bg-accent/5" ), children: [ - /* @__PURE__ */ a(Hr, { className: "h-5 w-5 shrink-0" }), + /* @__PURE__ */ a(Xr, { className: "h-5 w-5 shrink-0" }), /* @__PURE__ */ c("div", { children: [ /* @__PURE__ */ a("p", { className: "font-medium", children: "Crypto Payment" }), /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground", children: "Bitcoin, Ethereum, and more" }) @@ -1850,7 +1850,7 @@ function ln({ w === "stripe" ? "border-primary bg-primary/5" : "border-border hover:bg-accent/5" ), children: [ - /* @__PURE__ */ a(Ke, { className: "h-5 w-5 shrink-0" }), + /* @__PURE__ */ a(Qe, { className: "h-5 w-5 shrink-0" }), /* @__PURE__ */ c("div", { children: [ /* @__PURE__ */ a("p", { className: "font-medium", children: "Stripe" }), /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground", children: "Credit / debit card, Apple Pay, Google Pay" }) @@ -1858,26 +1858,26 @@ function ln({ ] } ), - w === "stripe" && l && s && /* @__PURE__ */ a("div", { className: "pt-2", style: { minHeight: 350, contain: "content", overflow: "hidden", maxWidth: "100%" }, children: /* @__PURE__ */ a(Mr, { stripe: l, options: { clientSecret: s }, children: /* @__PURE__ */ a( - cn, + w === "stripe" && l && s && /* @__PURE__ */ a("div", { className: "pt-2", style: { minHeight: 350, contain: "content", overflow: "hidden", maxWidth: "100%" }, children: /* @__PURE__ */ a(qr, { stripe: l, options: { clientSecret: s }, children: /* @__PURE__ */ a( + un, { onPaymentSuccess: (b) => { - C && f === "custom" && r && r(k), p == null || p({ - shipping: k, + S && f === "custom" && r && r(O), p == null || p({ + shipping: O, paymentMethod: "stripe", paymentIntent: b }); }, returnUrl: v, - defaultEmail: k.email, - defaultName: k.fullName + defaultEmail: O.email, + defaultName: O.fullName } ) }) }) ] }) ] }) ] }), /* @__PURE__ */ c("div", { className: "space-y-4", children: [ - /* @__PURE__ */ a(Tt, { tax: i, shipping: d }), + /* @__PURE__ */ a(Ot, { tax: i, shipping: d }), /* @__PURE__ */ a(ye, {}), w !== "stripe" && /* @__PURE__ */ a(te, { type: "submit", size: "lg", className: "w-full", children: "Place Order" }), t && /* @__PURE__ */ a( @@ -1890,7 +1890,7 @@ function ln({ children: "← Back to Cart" } ), - /* @__PURE__ */ a(Pr, { className: "pt-4" }) + /* @__PURE__ */ a(Or, { className: "pt-4" }) ] }) ] } @@ -1903,19 +1903,19 @@ function _e({ title: e, children: r, className: t }) { /* @__PURE__ */ a(de, { className: "prose prose-sm dark:prose-invert max-w-none pt-6", children: r }) ] }) }); } -const un = [ +const fn = [ { region: "Domestic", method: "Standard", estimate: "5–7 business days", price: "$4.99" }, { region: "Domestic", method: "Express", estimate: "2–3 business days", price: "$12.99" }, { region: "International", method: "Standard", estimate: "10–20 business days", price: "$14.99" }, { region: "International", method: "Express", estimate: "5–8 business days", price: "$29.99" } ]; -function dn({ rates: e = un, className: r }) { +function mn({ rates: e = fn, className: r }) { return /* @__PURE__ */ c(_e, { title: "Shipping Information", className: r, children: [ /* @__PURE__ */ a("div", { className: "not-prose mb-8 grid gap-4 sm:grid-cols-2", children: [ - { icon: Gr, label: "Free shipping on orders over $75" }, - { icon: ze, label: "Same-day dispatch on orders before 2 PM" }, - { icon: Xr, label: "We ship worldwide" }, - { icon: Kr, label: "No hidden fees at checkout" } + { icon: Kr, label: "Free shipping on orders over $75" }, + { icon: Ve, label: "Same-day dispatch on orders before 2 PM" }, + { icon: Qr, label: "We ship worldwide" }, + { icon: Zr, label: "No hidden fees at checkout" } ].map(({ icon: t, label: n }) => /* @__PURE__ */ c( "div", { @@ -1948,11 +1948,11 @@ function dn({ rates: e = un, className: r }) { /* @__PURE__ */ a("p", { children: "Once your order ships, you will receive a confirmation email with a tracking number. You can use this number to track your package on the carrier's website." }) ] }); } -function fn({ returnWindowDays: e = 30, className: r }) { +function pn({ returnWindowDays: e = 30, className: r }) { return /* @__PURE__ */ c(_e, { title: "Returns & Refund Policy", className: r, children: [ /* @__PURE__ */ a("div", { className: "not-prose mb-8 grid gap-4 sm:grid-cols-2", children: [ - { icon: ze, label: `${e}-day return window` }, - { icon: Qr, label: "Free returns on defective items" }, + { icon: Ve, label: `${e}-day return window` }, + { icon: et, label: "Free returns on defective items" }, { icon: Fe, label: "Full refund to original payment" }, { icon: qe, label: "No restocking fees" } ].map(({ icon: t, label: n }) => /* @__PURE__ */ c( @@ -1987,7 +1987,7 @@ function fn({ returnWindowDays: e = 30, className: r }) { /* @__PURE__ */ a("p", { children: "The following items are not eligible for return: gift cards, downloadable products, and items marked as final sale. Perishable goods cannot be returned unless they arrive damaged or defective." }) ] }); } -function mn({ +function hn({ siteName: e = "Our Store", contactEmail: r = "privacy@example.com", className: t @@ -2040,7 +2040,7 @@ function mn({ ] }) ] }); } -function pn({ +function yn({ siteName: e = "Our Store", contactEmail: r = "legal@example.com", className: t @@ -2080,70 +2080,69 @@ function pn({ ] }) ] }); } -function Re(e) { +function xe(e) { "@babel/helpers - typeof"; - return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Re = function(r) { + return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? xe = function(r) { return typeof r; - } : Re = function(r) { + } : xe = function(r) { return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r; - }, Re(e); + }, xe(e); } -var Fr = "clover", hn = function(r) { +var Wr = "clover", vn = function(r) { return r === 3 ? "v3" : r; -}, qr = "https://js.stripe.com", yn = "".concat(qr, "/").concat(Fr, "/stripe.js"), vn = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, gn = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/; -var bn = function(r) { - return vn.test(r) || gn.test(r); -}, xn = function() { - for (var r = document.querySelectorAll('script[src^="'.concat(qr, '"]')), t = 0; t < r.length; t++) { +}, Ur = "https://js.stripe.com", gn = "".concat(Ur, "/").concat(Wr, "/stripe.js"), bn = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, xn = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, gr = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", wn = function(r) { + return bn.test(r) || xn.test(r); +}, Nn = function() { + for (var r = document.querySelectorAll('script[src^="'.concat(Ur, '"]')), t = 0; t < r.length; t++) { var n = r[t]; - if (bn(n.src)) + if (wn(n.src)) return n; } return null; -}, vr = function(r) { - var t = "", n = document.createElement("script"); - n.src = "".concat(yn).concat(t); +}, br = function(r) { + var t = r && !r.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script"); + n.src = "".concat(gn).concat(t); var o = document.head || document.body; if (!o) throw new Error("Expected document.body not to be null. Stripe.js requires a element."); return o.appendChild(n), n; -}, wn = function(r, t) { +}, Sn = function(r, t) { !r || !r._registerWrapper || r._registerWrapper({ name: "stripe-js", version: "8.8.0", startTime: t }); -}, be = null, Se = null, Ee = null, Nn = function(r) { +}, be = null, Ce = null, Ee = null, Cn = function(r) { return function(t) { r(new Error("Failed to load Stripe.js", { cause: t })); }; -}, Cn = function(r, t) { +}, En = function(r, t) { return function() { window.Stripe ? r(window.Stripe) : t(new Error("Stripe.js not available")); }; -}, Sn = function(r) { +}, Pn = function(r) { return be !== null ? be : (be = new Promise(function(t, n) { if (typeof window > "u" || typeof document > "u") { t(null); return; } - if (window.Stripe) { + if (window.Stripe && r && console.warn(gr), window.Stripe) { t(window.Stripe); return; } try { - var o = xn(); - if (!(o && r)) { - if (!o) - o = vr(r); - else if (o && Ee !== null && Se !== null) { - var i; - o.removeEventListener("load", Ee), o.removeEventListener("error", Se), (i = o.parentNode) === null || i === void 0 || i.removeChild(o), o = vr(r); - } + var o = Nn(); + if (o && r) + console.warn(gr); + else if (!o) + o = br(r); + else if (o && Ee !== null && Ce !== null) { + var i; + o.removeEventListener("load", Ee), o.removeEventListener("error", Ce), (i = o.parentNode) === null || i === void 0 || i.removeChild(o), o = br(r); } - Ee = Cn(t, n), Se = Nn(n), o.addEventListener("load", Ee), o.addEventListener("error", Se); + Ee = En(t, n), Ce = Cn(n), o.addEventListener("load", Ee), o.addEventListener("error", Ce); } catch (d) { n(d); return; @@ -2151,36 +2150,53 @@ var bn = function(r) { }), be.catch(function(t) { return be = null, Promise.reject(t); })); -}, En = function(r, t, n) { +}, Tn = function(r, t, n) { if (r === null) return null; var o = t[0]; if (typeof o != "string") - throw new Error("Expected publishable key to be of type string, got type ".concat(Re(o), " instead.")); - var i = o.match(/^pk_test/), d = hn(r.version), l = Fr; + throw new Error("Expected publishable key to be of type string, got type ".concat(xe(o), " instead.")); + var i = o.match(/^pk_test/), d = vn(r.version), l = Wr; i && d !== l && console.warn("Stripe.js@".concat(d, " was loaded on the page, but @stripe/stripe-js@").concat("8.8.0", " expected Stripe.js@").concat(l, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning")); var s = r.apply(void 0, t); - return wn(s, n), s; -}, xe, Dr = !1, Wr = function() { - return xe || (xe = Sn(null).catch(function(r) { - return xe = null, Promise.reject(r); - }), xe); -}; -Promise.resolve().then(function() { - return Wr(); -}).catch(function(e) { - Dr || console.warn(e); -}); -var Pn = function() { + return Sn(s, n), s; +}, xr = function(r) { + var t = `invalid load parameters; expected object of shape + + {advancedFraudSignals: boolean} + +but received + + `.concat(JSON.stringify(r), ` +`); + if (r === null || xe(r) !== "object") + throw new Error(t); + if (Object.keys(r).length === 1 && typeof r.advancedFraudSignals == "boolean") + return r; + throw new Error(t); +}, Re, ze = !1, Yr = function() { for (var r = arguments.length, t = new Array(r), n = 0; n < r; n++) t[n] = arguments[n]; - Dr = !0; + ze = !0; var o = Date.now(); - return Wr().then(function(i) { - return En(i, t, o); + return Pn(Re).then(function(i) { + return Tn(i, t, o); }); }; -function Tn({ +Yr.setLoadParameters = function(e) { + if (ze && Re) { + var r = xr(e), t = Object.keys(r), n = t.reduce(function(o, i) { + var d; + return o && e[i] === ((d = Re) === null || d === void 0 ? void 0 : d[i]); + }, !0); + if (n) + return; + } + if (ze) + throw new Error("You cannot change load parameters after calling loadStripe"); + Re = xr(e); +}; +function Rn({ userId: e, userDisplayName: r, userEmail: t, @@ -2197,7 +2213,7 @@ function Tn({ getAuthToken: w, locale: A }) { - const [C, j] = ae([]), [N, ne] = ae(null), [k, W] = ae(null), f = se((D) => D.subtotal); + const [S, j] = ae([]), [N, ne] = ae(null), [O, W] = ae(null), f = se((D) => D.subtotal); return Pe(() => { if (!e) return; let D = !0; @@ -2207,7 +2223,7 @@ function Tn({ D = !1; }; }, [e, n]), Pe(() => { - p && ne(Pn(p, { locale: A || "auto" })); + p && ne(Yr(p, { locale: A || "auto" })); }, [p, A]), Pe(() => { if (!p || f <= 0) return; let D = !0; @@ -2229,7 +2245,7 @@ function Tn({ D = !1; }; }, [p, v, f]), /* @__PURE__ */ a( - ln, + dn, { onPlaceOrder: async (D) => { try { @@ -2257,13 +2273,13 @@ function Tn({ } }, onBackToCart: d, - savedAddresses: C, + savedAddresses: S, initialShipping: { fullName: r ?? "", email: t ?? "" }, stripePromise: N, - stripeClientSecret: k, + stripeClientSecret: O, onStripePaymentSuccess: async (D) => { try { await i({ @@ -2284,7 +2300,7 @@ function Tn({ } ); } -const Rn = Be( +const On = Je( "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", { variants: { @@ -2301,10 +2317,10 @@ const Rn = Be( } ); function kn({ className: e, variant: r, ...t }) { - return /* @__PURE__ */ a("div", { className: U(Rn({ variant: r }), e), ...t }); + return /* @__PURE__ */ a("div", { className: U(On({ variant: r }), e), ...t }); } -const gr = { - pending: { label: "Pending", variant: "secondary", icon: /* @__PURE__ */ a(ze, { className: "h-3.5 w-3.5" }) }, +const wr = { + pending: { label: "Pending", variant: "secondary", icon: /* @__PURE__ */ a(Ve, { className: "h-3.5 w-3.5" }) }, processing: { label: "Processing", variant: "default", icon: /* @__PURE__ */ a(De, { className: "h-3.5 w-3.5" }) }, paid: { label: "Paid", variant: "default", icon: /* @__PURE__ */ a(Fe, { className: "h-3.5 w-3.5" }) }, completed: { label: "Completed", variant: "default", icon: /* @__PURE__ */ a(Fe, { className: "h-3.5 w-3.5" }) }, @@ -2312,7 +2328,7 @@ const gr = { refunded: { label: "Refunded", variant: "outline", icon: /* @__PURE__ */ a(De, { className: "h-3.5 w-3.5" }) }, cancelled: { label: "Cancelled", variant: "destructive", icon: /* @__PURE__ */ a(qe, { className: "h-3.5 w-3.5" }) } }; -function On({ onFetchTransactions: e, onNavigate: r, toast: t }) { +function _n({ onFetchTransactions: e, onNavigate: r, toast: t }) { const [n, o] = ae([]), [i, d] = ae(!0); return Pe(() => { let l = !0; @@ -2328,20 +2344,20 @@ function On({ onFetchTransactions: e, onNavigate: r, toast: t }) { }, [e]), i ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-24", children: /* @__PURE__ */ a(De, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ c("div", { className: "mx-auto max-w-4xl px-4 py-8 space-y-6", children: [ /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [ /* @__PURE__ */ c("div", { className: "flex items-center gap-3", children: [ - /* @__PURE__ */ a(Qe, { className: "h-6 w-6" }), + /* @__PURE__ */ a(Ze, { className: "h-6 w-6" }), /* @__PURE__ */ a("h1", { className: "text-2xl font-bold", children: "My Purchases" }) ] }), /* @__PURE__ */ c(te, { variant: "outline", size: "sm", onClick: () => r("/"), children: [ - /* @__PURE__ */ a(Zr, { className: "h-4 w-4 mr-1" }), + /* @__PURE__ */ a(rt, { className: "h-4 w-4 mr-1" }), "Back" ] }) ] }), n.length === 0 ? /* @__PURE__ */ a(ue, { children: /* @__PURE__ */ c(de, { className: "flex flex-col items-center justify-center py-16 gap-4", children: [ - /* @__PURE__ */ a(Qe, { className: "h-12 w-12 text-muted-foreground" }), + /* @__PURE__ */ a(Ze, { className: "h-12 w-12 text-muted-foreground" }), /* @__PURE__ */ a("p", { className: "text-muted-foreground", children: "No purchases yet." }), /* @__PURE__ */ a(te, { variant: "outline", onClick: () => r("/"), children: "Browse Products" }) ] }) }) : /* @__PURE__ */ a("div", { className: "space-y-4", children: n.map((l) => { - const s = Array.isArray(l.product_info) ? l.product_info : [], p = gr[l.status] || gr.pending, v = new Date(l.created_at).toLocaleDateString(void 0, { + const s = Array.isArray(l.product_info) ? l.product_info : [], p = wr[l.status] || wr.pending, v = new Date(l.created_at).toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric", @@ -2403,7 +2419,7 @@ function On({ onFetchTransactions: e, onNavigate: r, toast: t }) { }, className: "text-xs text-primary hover:underline flex items-center gap-1 mt-0.5 cursor-pointer", children: [ - /* @__PURE__ */ a(et, { className: "h-3 w-3" }), + /* @__PURE__ */ a(tt, { className: "h-3 w-3" }), m.vendorSlug ] } @@ -2419,7 +2435,7 @@ function On({ onFetchTransactions: e, onNavigate: r, toast: t }) { className: "text-primary hover:underline text-xs flex items-center gap-1 shrink-0 cursor-pointer", children: [ "View", - /* @__PURE__ */ a(rt, { className: "h-3 w-3" }) + /* @__PURE__ */ a(nt, { className: "h-3 w-3" }) ] } ) @@ -2444,7 +2460,7 @@ function On({ onFetchTransactions: e, onNavigate: r, toast: t }) { rel: "noopener noreferrer", className: "text-xs text-primary hover:underline flex items-center gap-1", children: [ - /* @__PURE__ */ a(tt, { className: "h-3.5 w-3.5" }), + /* @__PURE__ */ a(at, { className: "h-3.5 w-3.5" }), "View Receipt" ] } @@ -2457,7 +2473,7 @@ function On({ onFetchTransactions: e, onNavigate: r, toast: t }) { rel: "noopener noreferrer", className: "text-xs text-primary hover:underline flex items-center gap-1", children: [ - /* @__PURE__ */ a(nt, { className: "h-3.5 w-3.5" }), + /* @__PURE__ */ a(ot, { className: "h-3.5 w-3.5" }), "View Invoice" ] } @@ -2468,11 +2484,11 @@ function On({ onFetchTransactions: e, onNavigate: r, toast: t }) { }) }) ] }); } -const qn = (e) => { +const Dn = (e) => { var t, n, o, i; - const { pathname: r } = st(); - return fe("/cart/*", r) ? /* @__PURE__ */ a(Pt, { onCheckout: () => e.onNavigate("/checkout") }) : fe("/checkout/*", r) ? /* @__PURE__ */ a( - Tn, + const { pathname: r } = lt(); + return fe("/cart/*", r) ? /* @__PURE__ */ a(Rt, { onCheckout: () => e.onNavigate("/checkout") }) : fe("/checkout/*", r) ? /* @__PURE__ */ a( + Rn, { userId: (t = e.user) == null ? void 0 : t.id, userDisplayName: (o = (n = e.user) == null ? void 0 : n.user_metadata) == null ? void 0 : o.display_name, @@ -2491,28 +2507,28 @@ const qn = (e) => { locale: e.locale } ) : fe("/purchases/*", r) ? /* @__PURE__ */ a( - On, + _n, { onFetchTransactions: e.onFetchTransactions, onNavigate: e.onNavigate, toast: e.toast } - ) : fe("/shipping/*", r) ? /* @__PURE__ */ a(dn, {}) : fe("/returns/*", r) ? /* @__PURE__ */ a(fn, {}) : fe("/privacy/*", r) ? /* @__PURE__ */ a(mn, { siteName: e.siteName || "PolyMech", contactEmail: e.contactEmail || "privacy@polymech.org" }) : fe("/terms/*", r) ? /* @__PURE__ */ a(pn, { siteName: e.siteName || "PolyMech", contactEmail: e.contactEmail || "legal@polymech.org" }) : null; + ) : fe("/shipping/*", r) ? /* @__PURE__ */ a(mn, {}) : fe("/returns/*", r) ? /* @__PURE__ */ a(pn, {}) : fe("/privacy/*", r) ? /* @__PURE__ */ a(hn, { siteName: e.siteName || "PolyMech", contactEmail: e.contactEmail || "privacy@polymech.org" }) : fe("/terms/*", r) ? /* @__PURE__ */ a(yn, { siteName: e.siteName || "PolyMech", contactEmail: e.contactEmail || "legal@polymech.org" }) : null; }; export { - gt as CartItemRow, - Pt as CartPage, - Tn as CheckoutFlow, - ln as CheckoutPage, - qn as EcommerceBundle, - Tt as OrderSummary, - Pr as PolicyLinks, + xt as CartItemRow, + Rt as CartPage, + Rn as CheckoutFlow, + dn as CheckoutPage, + Dn as EcommerceBundle, + Ot as OrderSummary, + Or as PolicyLinks, _e as PolicyPage, - mn as PrivacyPolicyPage, - On as PurchasesList, - fn as ReturnsPage, - dn as ShippingPage, - pn as TermsPage, + hn as PrivacyPolicyPage, + _n as PurchasesList, + pn as ReturnsPage, + mn as ShippingPage, + yn as TermsPage, se as useCartStore }; //# sourceMappingURL=pm-ecommerce.es.js.map diff --git a/packages/ecommerce/dist-lib/pm-ecommerce.es.js.map b/packages/ecommerce/dist-lib/pm-ecommerce.es.js.map index a21cf5c0..814b6cd3 100644 --- a/packages/ecommerce/dist-lib/pm-ecommerce.es.js.map +++ b/packages/ecommerce/dist-lib/pm-ecommerce.es.js.map @@ -1 +1 @@ -{"version":3,"file":"pm-ecommerce.es.js","sources":["../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/clsx/dist/clsx.mjs","../node_modules/class-variance-authority/dist/index.mjs","../src/lib/utils.ts","../src/components/ui/button.tsx","../src/cart/useCartStore.ts","../src/cart/CartItem.tsx","../src/components/ui/card.tsx","../node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.mjs","../node_modules/@radix-ui/react-separator/dist/index.mjs","../src/components/ui/separator.tsx","../src/policies/PolicyLinks.tsx","../src/cart/CartPage.tsx","../src/checkout/OrderSummary.tsx","../src/components/ui/input.tsx","../node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.mjs","../node_modules/@radix-ui/react-label/dist/index.mjs","../src/components/ui/label.tsx","../node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js","../node_modules/prop-types/node_modules/react-is/index.js","../node_modules/object-assign/index.js","../node_modules/prop-types/lib/ReactPropTypesSecret.js","../node_modules/prop-types/lib/has.js","../node_modules/prop-types/checkPropTypes.js","../node_modules/prop-types/factoryWithTypeCheckers.js","../node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/prop-types/index.js","../node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs","../src/checkout/StripePaymentForm.tsx","../src/checkout/CheckoutPage.tsx","../src/policies/PolicyPage.tsx","../src/policies/ShippingPage.tsx","../src/policies/ReturnsPage.tsx","../src/policies/PrivacyPolicyPage.tsx","../src/policies/TermsPage.tsx","../node_modules/@stripe/stripe-js/dist/index.mjs","../src/checkout/CheckoutFlow.tsx","../src/components/ui/badge.tsx","../src/purchases/PurchasesList.tsx","../src/EcommerceBundle.tsx"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","import * as React from \"react\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst buttonVariants = cva(\r\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\r\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\r\n link: \"text-primary underline-offset-4 hover:underline\",\r\n },\r\n size: {\r\n default: \"h-10 px-4 py-2\",\r\n sm: \"h-9 rounded-md px-2\",\r\n lg: \"h-11 rounded-md px-4\",\r\n icon: \"h-10 w-10\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n size: \"default\",\r\n },\r\n },\r\n);\r\n\r\nexport interface ButtonProps\r\n extends React.ButtonHTMLAttributes,\r\n VariantProps {\r\n asChild?: boolean;\r\n}\r\n\r\nconst Button = React.forwardRef(\r\n ({ className, variant, size, asChild = false, ...props }, ref) => {\r\n const Comp = asChild ? Slot : \"button\";\r\n return ;\r\n },\r\n);\r\nButton.displayName = \"Button\";\r\n\r\nexport { Button, buttonVariants };\r\n","import { create } from \"zustand\";\r\nimport { persist } from \"zustand/middleware\";\r\nimport type { CartItem, CartState } from \"./types\";\r\n\r\n/** Recompute derived totals from items array. */\r\nfunction computeTotals(items: CartItem[]) {\r\n return {\r\n subtotal: items.reduce((sum, i) => sum + i.price * i.quantity, 0),\r\n itemCount: items.reduce((sum, i) => sum + i.quantity, 0),\r\n };\r\n}\r\n\r\n/**\r\n * Global cart store — persisted to localStorage.\r\n *\r\n * Usage:\r\n * ```tsx\r\n * const { items, addItem, subtotal } = useCartStore();\r\n * ```\r\n */\r\nexport const useCartStore = create()(\r\n persist(\r\n (set) => ({\r\n items: [],\r\n subtotal: 0,\r\n itemCount: 0,\r\n\r\n addItem: (incoming) =>\r\n set((state) => {\r\n const existing = state.items.find((i) => i.id === incoming.id);\r\n let items: CartItem[];\r\n if (existing) {\r\n items = state.items.map((i) =>\r\n i.id === incoming.id\r\n ? { ...i, quantity: i.quantity + (incoming.quantity ?? 1) }\r\n : i,\r\n );\r\n } else {\r\n items = [...state.items, { ...incoming, quantity: incoming.quantity ?? 1 }];\r\n }\r\n return { items, ...computeTotals(items) };\r\n }),\r\n\r\n removeItem: (id) =>\r\n set((state) => {\r\n const items = state.items.filter((i) => i.id !== id);\r\n return { items, ...computeTotals(items) };\r\n }),\r\n\r\n updateQuantity: (id, quantity) =>\r\n set((state) => {\r\n if (quantity <= 0) {\r\n const items = state.items.filter((i) => i.id !== id);\r\n return { items, ...computeTotals(items) };\r\n }\r\n const items = state.items.map((i) =>\r\n i.id === id ? { ...i, quantity } : i,\r\n );\r\n return { items, ...computeTotals(items) };\r\n }),\r\n\r\n clearCart: () => set({ items: [], subtotal: 0, itemCount: 0 }),\r\n }),\r\n {\r\n name: \"pm-ecommerce-cart\",\r\n },\r\n ),\r\n);\r\n","import React from \"react\";\r\nimport { Minus, Plus, Trash2 } from \"lucide-react\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { useCartStore } from \"./useCartStore\";\r\nimport type { CartItem as CartItemType } from \"./types\";\r\n\r\nexport interface CartItemProps {\r\n item: CartItemType;\r\n /** Optional extra class names for the root element. */\r\n className?: string;\r\n}\r\n\r\n/** A single cart row — thumbnail, title, quantity stepper, line total, remove. */\r\nexport function CartItemRow({ item, className }: CartItemProps) {\r\n const updateQuantity = useCartStore((s) => s.updateQuantity);\r\n const removeItem = useCartStore((s) => s.removeItem);\r\n\r\n const lineTotal = item.price * item.quantity;\r\n\r\n return (\r\n \r\n {/* Thumbnail */}\r\n {item.image ? (\r\n \r\n ) : (\r\n
\r\n No img\r\n
\r\n )}\r\n\r\n {/* Info */}\r\n
\r\n {item.title}\r\n {item.variant && (\r\n {item.variant}\r\n )}\r\n \r\n ${item.price.toFixed(2)} each\r\n \r\n {item.vendorSlug && (\r\n \r\n Sold by {item.vendorSlug}\r\n \r\n )}\r\n
\r\n\r\n {/* Quantity stepper */}\r\n
\r\n updateQuantity(item.id, item.quantity - 1)}\r\n aria-label=\"Decrease quantity\"\r\n >\r\n \r\n \r\n \r\n {item.quantity}\r\n \r\n updateQuantity(item.id, item.quantity + 1)}\r\n aria-label=\"Increase quantity\"\r\n >\r\n \r\n \r\n
\r\n\r\n {/* Line total */}\r\n \r\n ${lineTotal.toFixed(2)}\r\n \r\n\r\n {/* Remove */}\r\n removeItem(item.id)}\r\n aria-label={`Remove ${item.title}`}\r\n >\r\n \r\n \r\n \r\n );\r\n}\r\n","import * as React from \"react\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst Card = React.forwardRef>(({ className, ...props }, ref) => (\r\n
\r\n));\r\nCard.displayName = \"Card\";\r\n\r\nconst CardHeader = React.forwardRef>(\r\n ({ className, ...props }, ref) => (\r\n
\r\n ),\r\n);\r\nCardHeader.displayName = \"CardHeader\";\r\n\r\nconst CardTitle = React.forwardRef>(\r\n ({ className, ...props }, ref) => (\r\n

\r\n ),\r\n);\r\nCardTitle.displayName = \"CardTitle\";\r\n\r\nconst CardDescription = React.forwardRef>(\r\n ({ className, ...props }, ref) => (\r\n

\r\n ),\r\n);\r\nCardDescription.displayName = \"CardDescription\";\r\n\r\nconst CardContent = React.forwardRef>(\r\n ({ className, ...props }, ref) =>

,\r\n);\r\nCardContent.displayName = \"CardContent\";\r\n\r\nconst CardFooter = React.forwardRef>(\r\n ({ className, ...props }, ref) => (\r\n
\r\n ),\r\n);\r\nCardFooter.displayName = \"CardFooter\";\r\n\r\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\r\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","// src/separator.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Separator\";\nvar DEFAULT_ORIENTATION = \"horizontal\";\nvar ORIENTATIONS = [\"horizontal\", \"vertical\"];\nvar Separator = React.forwardRef((props, forwardedRef) => {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n const ariaOrientation = orientation === \"vertical\" ? orientation : void 0;\n const semanticProps = decorative ? { role: \"none\" } : { \"aria-orientation\": ariaOrientation, role: \"separator\" };\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-orientation\": orientation,\n ...semanticProps,\n ...domProps,\n ref: forwardedRef\n }\n );\n});\nSeparator.displayName = NAME;\nfunction isValidOrientation(orientation) {\n return ORIENTATIONS.includes(orientation);\n}\nvar Root = Separator;\nexport {\n Root,\n Separator\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\r\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\r\n \r\n));\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\r\n\r\nexport { Separator };\r\n","import React from \"react\";\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nexport interface PolicyLink {\r\n label: string;\r\n href: string;\r\n}\r\n\r\nconst defaultLinks: PolicyLink[] = [\r\n { label: \"Returns & Refunds\", href: \"/returns\" },\r\n { label: \"Shipping\", href: \"/shipping\" },\r\n { label: \"Privacy Policy\", href: \"/privacy\" },\r\n { label: \"Terms of Service\", href: \"/terms\" },\r\n];\r\n\r\nexport interface PolicyLinksProps {\r\n links?: PolicyLink[];\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Small footer row of policy links for cart / checkout pages.\r\n */\r\nexport function PolicyLinks({ links = defaultLinks, className }: PolicyLinksProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { ShoppingCart, Trash2 } from \"lucide-react\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Card, CardContent, CardFooter, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { useCartStore } from \"./useCartStore\";\r\nimport { CartItemRow } from \"./CartItem\";\r\nimport { PolicyLinks } from \"@/policies/PolicyLinks\";\r\n\r\nexport interface CartPageProps {\r\n /** Called when user clicks \"Proceed to Checkout\". */\r\n onCheckout?: () => void;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Full cart page — shows items, subtotal, and a checkout CTA.\r\n * Renders an empty-state when the cart has no items.\r\n */\r\nexport function CartPage({ onCheckout, className }: CartPageProps) {\r\n const items = useCartStore((s) => s.items);\r\n const subtotal = useCartStore((s) => s.subtotal);\r\n const itemCount = useCartStore((s) => s.itemCount);\r\n const clearCart = useCartStore((s) => s.clearCart);\r\n\r\n /* ---------- Empty state ---------- */\r\n if (items.length === 0) {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n

Your cart is empty

\r\n

\r\n Add some products to get started.\r\n

\r\n
\r\n
\r\n );\r\n }\r\n\r\n /* ---------- Cart with items ---------- */\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n Cart\r\n \r\n ({itemCount} {itemCount === 1 ? \"item\" : \"items\"})\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n {items.map((item) => (\r\n \r\n ))}\r\n \r\n\r\n \r\n\r\n \r\n
\r\n Subtotal\r\n ${subtotal.toFixed(2)}\r\n
\r\n

\r\n Shipping and taxes calculated at checkout.\r\n

\r\n \r\n
\r\n
\r\n\r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { useCartStore } from \"@/cart/useCartStore\";\r\n\r\nexport interface OrderSummaryProps {\r\n /** Tax amount (pass 0 or leave undefined to show \"Calculated at next step\"). */\r\n tax?: number;\r\n /** Shipping cost (pass 0 or leave undefined to show \"Free\" / \"TBD\"). */\r\n shipping?: number;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Read-only order breakdown: line items, subtotal, tax, shipping, total.\r\n */\r\nexport function OrderSummary({ tax, shipping, className }: OrderSummaryProps) {\r\n const items = useCartStore((s) => s.items);\r\n const subtotal = useCartStore((s) => s.subtotal);\r\n\r\n const taxAmount = tax ?? 0;\r\n const shippingAmount = shipping ?? 0;\r\n const total = subtotal + taxAmount + shippingAmount;\r\n\r\n return (\r\n \r\n \r\n Order Summary\r\n \r\n\r\n \r\n {/* Line items */}\r\n
    \r\n {items.map((item) => (\r\n
  • \r\n
    \r\n \r\n {item.title} × {item.quantity}\r\n \r\n {item.vendorSlug && (\r\n \r\n via {item.vendorSlug}\r\n \r\n )}\r\n
    \r\n \r\n ${(item.price * item.quantity).toFixed(2)}\r\n \r\n
  • \r\n ))}\r\n
\r\n\r\n \r\n\r\n {/* Subtotal */}\r\n
\r\n Subtotal\r\n ${subtotal.toFixed(2)}\r\n
\r\n\r\n {/* Tax */}\r\n
\r\n Tax\r\n \r\n {tax !== undefined ? `$${taxAmount.toFixed(2)}` : \"Calculated at next step\"}\r\n \r\n
\r\n\r\n {/* Shipping */}\r\n
\r\n Shipping\r\n \r\n {shipping !== undefined\r\n ? shippingAmount === 0\r\n ? \"Free\"\r\n : `$${shippingAmount.toFixed(2)}`\r\n : \"TBD\"}\r\n \r\n
\r\n\r\n \r\n\r\n {/* Total */}\r\n
\r\n Total\r\n ${total.toFixed(2)}\r\n
\r\n
\r\n
\r\n );\r\n}\r\n","import * as React from \"react\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst Input = React.forwardRef>(\r\n ({ className, type, ...props }, ref) => {\r\n return (\r\n \r\n );\r\n },\r\n);\r\nInput.displayName = \"Input\";\r\n\r\nexport { Input };\r\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/label.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Label\";\nvar Label = React.forwardRef((props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.label,\n {\n ...props,\n ref: forwardedRef,\n onMouseDown: (event) => {\n const target = event.target;\n if (target.closest(\"button, input, select, textarea\")) return;\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }\n }\n );\n});\nLabel.displayName = NAME;\nvar Root = Label;\nexport {\n Label,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\r\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst labelVariants = cva(\r\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\r\n);\r\n\r\nconst Label = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef & VariantProps\r\n>(({ className, ...props }, ref) => (\r\n \r\n));\r\nLabel.displayName = LabelPrimitive.Root.displayName;\r\n\r\nexport { Label };\r\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","module.exports = Function.call.bind(Object.prototype.hasOwnProperty);\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactIs = require('react-is');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar has = require('./lib/has');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bigint: createPrimitiveTypeChecker('bigint'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message, data) {\n this.message = message;\n this.data = data && typeof data === 'object' ? data: {};\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),\n {expectedType: expectedType}\n );\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (process.env.NODE_ENV !== 'production') {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var expectedTypes = [];\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);\n if (checkerResult == null) {\n return null;\n }\n if (checkerResult.data && has(checkerResult.data, 'expectedType')) {\n expectedTypes.push(checkerResult.data.expectedType);\n }\n }\n var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function invalidValidatorError(componentName, location, propFullName, key, type) {\n return new PropTypeError(\n (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'\n );\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (has(shapeTypes, key) && typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]);\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar useAttachEvent = function useAttachEvent(element, event, cb) {\n var cbDefined = !!cb;\n var cbRef = React.useRef(cb); // In many integrations the callback prop changes on each render.\n // Using a ref saves us from calling element.on/.off every render.\n\n React.useEffect(function () {\n cbRef.current = cb;\n }, [cb]);\n React.useEffect(function () {\n if (!cbDefined || !element) {\n return function () {};\n }\n\n var decoratedCb = function decoratedCb() {\n if (cbRef.current) {\n cbRef.current.apply(cbRef, arguments);\n }\n };\n\n element.on(event, decoratedCb);\n return function () {\n element.off(event, decoratedCb);\n };\n }, [cbDefined, event, element, cbRef]);\n};\n\nvar usePrevious = function usePrevious(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n};\n\nvar isUnknownObject = function isUnknownObject(raw) {\n return raw !== null && _typeof(raw) === 'object';\n};\nvar isPromise = function isPromise(raw) {\n return isUnknownObject(raw) && typeof raw.then === 'function';\n}; // We are using types to enforce the `stripe` prop in this lib,\n// but in an untyped integration `stripe` could be anything, so we need\n// to do some sanity validation to prevent type errors.\n\nvar isStripe = function isStripe(raw) {\n return isUnknownObject(raw) && typeof raw.elements === 'function' && typeof raw.createToken === 'function' && typeof raw.createPaymentMethod === 'function' && typeof raw.confirmCardPayment === 'function';\n};\n\nvar PLAIN_OBJECT_STR = '[object Object]';\nvar isEqual = function isEqual(left, right) {\n if (!isUnknownObject(left) || !isUnknownObject(right)) {\n return left === right;\n }\n\n var leftArray = Array.isArray(left);\n var rightArray = Array.isArray(right);\n if (leftArray !== rightArray) return false;\n var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;\n var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;\n if (leftPlainObject !== rightPlainObject) return false; // not sure what sort of special object this is (regexp is one option), so\n // fallback to reference check.\n\n if (!leftPlainObject && !leftArray) return left === right;\n var leftKeys = Object.keys(left);\n var rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) return false;\n var keySet = {};\n\n for (var i = 0; i < leftKeys.length; i += 1) {\n keySet[leftKeys[i]] = true;\n }\n\n for (var _i = 0; _i < rightKeys.length; _i += 1) {\n keySet[rightKeys[_i]] = true;\n }\n\n var allKeys = Object.keys(keySet);\n\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n\n var l = left;\n var r = right;\n\n var pred = function pred(key) {\n return isEqual(l[key], r[key]);\n };\n\n return allKeys.every(pred);\n};\n\nvar extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates(options, prevOptions, immutableKeys) {\n if (!isUnknownObject(options)) {\n return null;\n }\n\n return Object.keys(options).reduce(function (newOptions, key) {\n var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);\n\n if (immutableKeys.includes(key)) {\n if (isUpdated) {\n console.warn(\"Unsupported prop change: options.\".concat(key, \" is not a mutable property.\"));\n }\n\n return newOptions;\n }\n\n if (!isUpdated) {\n return newOptions;\n }\n\n return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));\n }, null);\n};\n\nvar INVALID_STRIPE_ERROR$1 = 'Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.'; // We are using types to enforce the `stripe` prop in this lib, but in a real\n// integration `stripe` could be anything, so we need to do some sanity\n// validation to prevent type errors.\n\nvar validateStripe = function validateStripe(maybeStripe) {\n var errorMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INVALID_STRIPE_ERROR$1;\n\n if (maybeStripe === null || isStripe(maybeStripe)) {\n return maybeStripe;\n }\n\n throw new Error(errorMsg);\n};\n\nvar parseStripeProp = function parseStripeProp(raw) {\n var errorMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INVALID_STRIPE_ERROR$1;\n\n if (isPromise(raw)) {\n return {\n tag: 'async',\n stripePromise: Promise.resolve(raw).then(function (result) {\n return validateStripe(result, errorMsg);\n })\n };\n }\n\n var stripe = validateStripe(raw, errorMsg);\n\n if (stripe === null) {\n return {\n tag: 'empty'\n };\n }\n\n return {\n tag: 'sync',\n stripe: stripe\n };\n};\n\nvar registerWithStripeJs = function registerWithStripeJs(stripe) {\n if (!stripe || !stripe._registerWrapper || !stripe.registerAppInfo) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'react-stripe-js',\n version: \"5.6.0\"\n });\n\n stripe.registerAppInfo({\n name: 'react-stripe-js',\n version: \"5.6.0\",\n url: 'https://stripe.com/docs/stripe-js/react'\n });\n};\n\nvar ElementsContext = /*#__PURE__*/React.createContext(null);\nElementsContext.displayName = 'ElementsContext';\nvar parseElementsContext = function parseElementsContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an provider.\"));\n }\n\n return ctx;\n};\n/**\n * The `Elements` provider allows you to use [Element components](https://stripe.com/docs/stripe-js/react#element-components) and access the [Stripe object](https://stripe.com/docs/js/initializing) in any nested component.\n * Render an `Elements` provider at the root of your React app so that it is available everywhere you need it.\n *\n * To use the `Elements` provider, call `loadStripe` from `@stripe/stripe-js` with your publishable key.\n * The `loadStripe` function will asynchronously load the Stripe.js script and initialize a `Stripe` object.\n * Pass the returned `Promise` to `Elements`.\n *\n * @docs https://docs.stripe.com/sdks/stripejs-react?ui=elements#elements-provider\n */\n\nvar Elements = function Elements(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]); // For a sync stripe instance, initialize into context\n\n var _React$useState = React.useState(function () {\n return {\n stripe: parsed.tag === 'sync' ? parsed.stripe : null,\n elements: parsed.tag === 'sync' ? parsed.stripe.elements(options) : null\n };\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ctx = _React$useState2[0],\n setContext = _React$useState2[1];\n\n React.useEffect(function () {\n var isMounted = true;\n\n var safeSetContext = function safeSetContext(stripe) {\n setContext(function (ctx) {\n // no-op if we already have a stripe instance (https://github.com/stripe/react-stripe-js/issues/296)\n if (ctx.stripe) return ctx;\n return {\n stripe: stripe,\n elements: stripe.elements(options)\n };\n });\n }; // For an async stripePromise, store it in context once resolved\n\n\n if (parsed.tag === 'async' && !ctx.stripe) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe && isMounted) {\n // Only update Elements context if the component is still mounted\n // and stripe is not null. We allow stripe to be null to make\n // handling SSR easier.\n safeSetContext(stripe);\n }\n });\n } else if (parsed.tag === 'sync' && !ctx.stripe) {\n // Or, handle a sync stripe instance going from null -> populated\n safeSetContext(parsed.stripe);\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed, ctx, options]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!ctx.elements) {\n return;\n }\n\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['clientSecret', 'fonts']);\n\n if (updates) {\n ctx.elements.update(updates);\n }\n }, [options, prevOptions, ctx.elements]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(ctx.stripe);\n }, [ctx.stripe]);\n return /*#__PURE__*/React.createElement(ElementsContext.Provider, {\n value: ctx\n }, children);\n};\nElements.propTypes = {\n stripe: PropTypes.any,\n options: PropTypes.object\n};\nvar useElementsContextWithUseCase = function useElementsContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(ElementsContext);\n return parseElementsContext(ctx, useCaseMessage);\n};\n/**\n * @docs https://stripe.com/docs/stripe-js/react#useelements-hook\n */\n\nvar useElements = function useElements() {\n var _useElementsContextWi = useElementsContextWithUseCase('calls useElements()'),\n elements = _useElementsContextWi.elements;\n\n return elements;\n};\n/**\n * @docs https://stripe.com/docs/stripe-js/react#elements-consumer\n */\n\nvar ElementsConsumer = function ElementsConsumer(_ref2) {\n var children = _ref2.children;\n var ctx = useElementsContextWithUseCase('mounts '); // Assert to satisfy the busted React.FC return type (it should be ReactNode)\n\n return children(ctx);\n};\nElementsConsumer.propTypes = {\n children: PropTypes.func.isRequired\n};\n\nvar CheckoutContext = /*#__PURE__*/React.createContext(null);\nCheckoutContext.displayName = 'CheckoutContext';\n({\n stripe: PropTypes.any,\n options: PropTypes.shape({\n clientSecret: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Promise)]).isRequired,\n elementsOptions: PropTypes.object\n }).isRequired\n});\nvar useElementsOrCheckoutContextWithUseCase = function useElementsOrCheckoutContextWithUseCase(useCaseString) {\n var checkout = React.useContext(CheckoutContext);\n var elements = React.useContext(ElementsContext);\n\n if (checkout) {\n if (elements) {\n throw new Error(\"You cannot wrap the part of your app that \".concat(useCaseString, \" in both and providers.\"));\n } else {\n return checkout;\n }\n } else {\n return parseElementsContext(elements, useCaseString);\n }\n};\n\nvar _excluded = [\"mode\"];\n\nvar capitalized = function capitalized(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\nvar createElementComponent = function createElementComponent(type, isServer) {\n var displayName = \"\".concat(capitalized(type), \"Element\");\n\n var ClientElement = function ClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n onBlur = _ref.onBlur,\n onFocus = _ref.onFocus,\n onReady = _ref.onReady,\n onChange = _ref.onChange,\n onEscape = _ref.onEscape,\n onClick = _ref.onClick,\n onLoadError = _ref.onLoadError,\n onLoaderStart = _ref.onLoaderStart,\n onNetworksChange = _ref.onNetworksChange,\n onConfirm = _ref.onConfirm,\n onCancel = _ref.onCancel,\n onShippingAddressChange = _ref.onShippingAddressChange,\n onShippingRateChange = _ref.onShippingRateChange,\n onSavedPaymentMethodRemove = _ref.onSavedPaymentMethodRemove,\n onSavedPaymentMethodUpdate = _ref.onSavedPaymentMethodUpdate;\n var ctx = useElementsOrCheckoutContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var elements = 'elements' in ctx ? ctx.elements : null;\n var checkoutState = 'checkoutState' in ctx ? ctx.checkoutState : null;\n var checkoutSdk = (checkoutState === null || checkoutState === void 0 ? void 0 : checkoutState.type) === 'success' || (checkoutState === null || checkoutState === void 0 ? void 0 : checkoutState.type) === 'loading' ? checkoutState.sdk : null;\n\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n element = _React$useState2[0],\n setElement = _React$useState2[1];\n\n var elementRef = React.useRef(null);\n var domNode = React.useRef(null); // For every event where the merchant provides a callback, call element.on\n // with that callback. If the merchant ever changes the callback, removes\n // the old callback with element.off and then call element.on with the new one.\n\n useAttachEvent(element, 'blur', onBlur);\n useAttachEvent(element, 'focus', onFocus);\n useAttachEvent(element, 'escape', onEscape);\n useAttachEvent(element, 'click', onClick);\n useAttachEvent(element, 'loaderror', onLoadError);\n useAttachEvent(element, 'loaderstart', onLoaderStart);\n useAttachEvent(element, 'networkschange', onNetworksChange);\n useAttachEvent(element, 'confirm', onConfirm);\n useAttachEvent(element, 'cancel', onCancel);\n useAttachEvent(element, 'shippingaddresschange', onShippingAddressChange);\n useAttachEvent(element, 'shippingratechange', onShippingRateChange);\n useAttachEvent(element, 'savedpaymentmethodremove', onSavedPaymentMethodRemove);\n useAttachEvent(element, 'savedpaymentmethodupdate', onSavedPaymentMethodUpdate);\n useAttachEvent(element, 'change', onChange);\n var readyCallback;\n\n if (onReady) {\n if (type === 'expressCheckout') {\n // Passes through the event, which includes visible PM types\n readyCallback = onReady;\n } else {\n // For other Elements, pass through the Element itself.\n readyCallback = function readyCallback() {\n onReady(element);\n };\n }\n }\n\n useAttachEvent(element, 'ready', readyCallback);\n React.useLayoutEffect(function () {\n if (elementRef.current === null && domNode.current !== null && (elements || checkoutSdk)) {\n var newElement = null;\n\n if (checkoutSdk) {\n switch (type) {\n case 'paymentForm':\n newElement = checkoutSdk.createPaymentFormElement(options);\n break;\n\n case 'payment':\n newElement = checkoutSdk.createPaymentElement(options);\n break;\n\n case 'address':\n if ('mode' in options) {\n var mode = options.mode,\n restOptions = _objectWithoutProperties(options, _excluded);\n\n if (mode === 'shipping') {\n newElement = checkoutSdk.createShippingAddressElement(restOptions);\n } else if (mode === 'billing') {\n newElement = checkoutSdk.createBillingAddressElement(restOptions);\n } else {\n throw new Error(\"Invalid options.mode. mode must be 'billing' or 'shipping'.\");\n }\n } else {\n throw new Error(\"You must supply options.mode. mode must be 'billing' or 'shipping'.\");\n }\n\n break;\n\n case 'expressCheckout':\n newElement = checkoutSdk.createExpressCheckoutElement(options);\n break;\n\n case 'currencySelector':\n newElement = checkoutSdk.createCurrencySelectorElement();\n break;\n\n case 'taxId':\n newElement = checkoutSdk.createTaxIdElement(options);\n break;\n\n default:\n throw new Error(\"Invalid Element type \".concat(displayName, \". You must use either the , , , or .\"));\n }\n } else if (elements) {\n newElement = elements.create(type, options);\n } // Store element in a ref to ensure it's _immediately_ available in cleanup hooks in StrictMode\n\n\n elementRef.current = newElement; // Store element in state to facilitate event listener attachment\n\n setElement(newElement);\n\n if (newElement) {\n newElement.mount(domNode.current);\n }\n }\n }, [elements, checkoutSdk, options]);\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!elementRef.current) {\n return;\n }\n\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['paymentRequest']);\n\n if (updates && 'update' in elementRef.current) {\n elementRef.current.update(updates);\n }\n }, [options, prevOptions]);\n React.useLayoutEffect(function () {\n return function () {\n if (elementRef.current && typeof elementRef.current.destroy === 'function') {\n try {\n elementRef.current.destroy();\n elementRef.current = null;\n } catch (error) {// Do nothing\n }\n }\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className,\n ref: domNode\n });\n }; // Only render the Element wrapper in a server environment.\n\n\n var ServerElement = function ServerElement(props) {\n useElementsOrCheckoutContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var id = props.id,\n className = props.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n };\n\n var Element = isServer ? ServerElement : ClientElement;\n Element.propTypes = {\n id: PropTypes.string,\n className: PropTypes.string,\n onChange: PropTypes.func,\n onBlur: PropTypes.func,\n onFocus: PropTypes.func,\n onReady: PropTypes.func,\n onEscape: PropTypes.func,\n onClick: PropTypes.func,\n onLoadError: PropTypes.func,\n onLoaderStart: PropTypes.func,\n onNetworksChange: PropTypes.func,\n onConfirm: PropTypes.func,\n onCancel: PropTypes.func,\n onShippingAddressChange: PropTypes.func,\n onShippingRateChange: PropTypes.func,\n onSavedPaymentMethodRemove: PropTypes.func,\n onSavedPaymentMethodUpdate: PropTypes.func,\n options: PropTypes.object\n };\n Element.displayName = displayName;\n Element.__elementType = type;\n return Element;\n};\n\nvar isServer = typeof window === 'undefined';\n\nvar EmbeddedCheckoutContext = /*#__PURE__*/React.createContext(null);\nEmbeddedCheckoutContext.displayName = 'EmbeddedCheckoutProviderContext';\nvar useEmbeddedCheckoutContext = function useEmbeddedCheckoutContext() {\n var ctx = React.useContext(EmbeddedCheckoutContext);\n\n if (!ctx) {\n throw new Error(' must be used within ');\n }\n\n return ctx;\n};\nvar INVALID_STRIPE_ERROR = 'Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.';\nvar EmbeddedCheckoutProvider = function EmbeddedCheckoutProvider(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp, INVALID_STRIPE_ERROR);\n }, [rawStripeProp]);\n var embeddedCheckoutPromise = React.useRef(null);\n var loadedStripe = React.useRef(null);\n\n var _React$useState = React.useState({\n embeddedCheckout: null\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ctx = _React$useState2[0],\n setContext = _React$useState2[1];\n\n React.useEffect(function () {\n // Don't support any ctx updates once embeddedCheckout or stripe is set.\n if (loadedStripe.current || embeddedCheckoutPromise.current) {\n return;\n }\n\n var setStripeAndInitEmbeddedCheckout = function setStripeAndInitEmbeddedCheckout(stripe) {\n if (loadedStripe.current || embeddedCheckoutPromise.current) return;\n loadedStripe.current = stripe;\n embeddedCheckoutPromise.current = loadedStripe.current.initEmbeddedCheckout(options).then(function (embeddedCheckout) {\n setContext({\n embeddedCheckout: embeddedCheckout\n });\n });\n }; // For an async stripePromise, store it once resolved\n\n\n if (parsed.tag === 'async' && !loadedStripe.current && (options.clientSecret || options.fetchClientSecret)) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe) {\n setStripeAndInitEmbeddedCheckout(stripe);\n }\n });\n } else if (parsed.tag === 'sync' && !loadedStripe.current && (options.clientSecret || options.fetchClientSecret)) {\n // Or, handle a sync stripe instance going from null -> populated\n setStripeAndInitEmbeddedCheckout(parsed.stripe);\n }\n }, [parsed, options, ctx, loadedStripe]);\n React.useEffect(function () {\n // cleanup on unmount\n return function () {\n // If embedded checkout is fully initialized, destroy it.\n if (ctx.embeddedCheckout) {\n embeddedCheckoutPromise.current = null;\n ctx.embeddedCheckout.destroy();\n } else if (embeddedCheckoutPromise.current) {\n // If embedded checkout is still initializing, destroy it once\n // it's done. This could be caused by unmounting very quickly\n // after mounting.\n embeddedCheckoutPromise.current.then(function () {\n embeddedCheckoutPromise.current = null;\n\n if (ctx.embeddedCheckout) {\n ctx.embeddedCheckout.destroy();\n }\n });\n }\n };\n }, [ctx.embeddedCheckout]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(loadedStripe);\n }, [loadedStripe]); // Warn on changes to stripe prop.\n // The stripe prop value can only go from null to non-null once and\n // can't be changed after that.\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Warn on changes to options.\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (prevOptions == null) {\n return;\n }\n\n if (options == null) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.');\n return;\n }\n\n if (options.clientSecret === undefined && options.fetchClientSecret === undefined) {\n console.warn('Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`.');\n }\n\n if (prevOptions.clientSecret != null && options.clientSecret !== prevOptions.clientSecret) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead.');\n }\n\n if (prevOptions.fetchClientSecret != null && options.fetchClientSecret !== prevOptions.fetchClientSecret) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead.');\n }\n\n if (prevOptions.onComplete != null && options.onComplete !== prevOptions.onComplete) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it.');\n }\n\n if (prevOptions.onShippingDetailsChange != null && options.onShippingDetailsChange !== prevOptions.onShippingDetailsChange) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it.');\n }\n\n if (prevOptions.onLineItemsChange != null && options.onLineItemsChange !== prevOptions.onLineItemsChange) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.');\n }\n }, [prevOptions, options]);\n return /*#__PURE__*/React.createElement(EmbeddedCheckoutContext.Provider, {\n value: ctx\n }, children);\n};\n\nvar EmbeddedCheckoutClientElement = function EmbeddedCheckoutClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className;\n\n var _useEmbeddedCheckoutC = useEmbeddedCheckoutContext(),\n embeddedCheckout = _useEmbeddedCheckoutC.embeddedCheckout;\n\n var isMounted = React.useRef(false);\n var domNode = React.useRef(null);\n React.useLayoutEffect(function () {\n if (!isMounted.current && embeddedCheckout && domNode.current !== null) {\n embeddedCheckout.mount(domNode.current);\n isMounted.current = true;\n } // Clean up on unmount\n\n\n return function () {\n if (isMounted.current && embeddedCheckout) {\n try {\n embeddedCheckout.unmount();\n isMounted.current = false;\n } catch (e) {// Do nothing.\n // Parent effects are destroyed before child effects, so\n // in cases where both the EmbeddedCheckoutProvider and\n // the EmbeddedCheckout component are removed at the same\n // time, the embeddedCheckout instance will be destroyed,\n // which causes an error when calling unmount.\n }\n }\n };\n }, [embeddedCheckout]);\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: domNode,\n id: id,\n className: className\n });\n}; // Only render the wrapper in a server environment.\n\n\nvar EmbeddedCheckoutServerElement = function EmbeddedCheckoutServerElement(_ref2) {\n var id = _ref2.id,\n className = _ref2.className;\n // Validate that we are in the right context by calling useEmbeddedCheckoutContext.\n useEmbeddedCheckoutContext();\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n};\n\nvar EmbeddedCheckout = isServer ? EmbeddedCheckoutServerElement : EmbeddedCheckoutClientElement;\n\nvar FinancialAccountDisclosure = function FinancialAccountDisclosure(_ref) {\n var rawStripeProp = _ref.stripe,\n onLoad = _ref.onLoad,\n onError = _ref.onError,\n options = _ref.options;\n var businessName = options === null || options === void 0 ? void 0 : options.businessName;\n var learnMoreLink = options === null || options === void 0 ? void 0 : options.learnMoreLink;\n var containerRef = React.useRef(null);\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]);\n\n var _React$useState = React.useState(parsed.tag === 'sync' ? parsed.stripe : null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n stripeState = _React$useState2[0],\n setStripeState = _React$useState2[1];\n\n React.useEffect(function () {\n var isMounted = true;\n\n if (parsed.tag === 'async') {\n parsed.stripePromise.then(function (stripePromise) {\n if (stripePromise && isMounted) {\n setStripeState(stripePromise);\n }\n });\n } else if (parsed.tag === 'sync') {\n setStripeState(parsed.stripe);\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on FinancialAccountDisclosure: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(stripeState);\n }, [stripeState]);\n React.useEffect(function () {\n var createDisclosure = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _yield$stripeState$cr, disclosureContent, error, container;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(!stripeState || !containerRef.current)) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 2:\n _context.next = 4;\n return stripeState.createFinancialAccountDisclosure({\n businessName: businessName,\n learnMoreLink: learnMoreLink\n });\n\n case 4:\n _yield$stripeState$cr = _context.sent;\n disclosureContent = _yield$stripeState$cr.htmlElement;\n error = _yield$stripeState$cr.error;\n\n if (error && onError) {\n onError(error);\n } else if (disclosureContent) {\n container = containerRef.current;\n container.innerHTML = '';\n container.appendChild(disclosureContent);\n\n if (onLoad) {\n onLoad();\n }\n }\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function createDisclosure() {\n return _ref2.apply(this, arguments);\n };\n }();\n\n createDisclosure();\n }, [stripeState, businessName, learnMoreLink, onLoad, onError]);\n return /*#__PURE__*/React.createElement('div', {\n ref: containerRef\n });\n};\n\nvar IssuingDisclosure = function IssuingDisclosure(_ref) {\n var rawStripeProp = _ref.stripe,\n onLoad = _ref.onLoad,\n onError = _ref.onError,\n options = _ref.options;\n var issuingProgramID = options === null || options === void 0 ? void 0 : options.issuingProgramID;\n var publicCardProgramName = options === null || options === void 0 ? void 0 : options.publicCardProgramName;\n var learnMoreLink = options === null || options === void 0 ? void 0 : options.learnMoreLink;\n var containerRef = React.useRef(null);\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]);\n\n var _React$useState = React.useState(parsed.tag === 'sync' ? parsed.stripe : null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n stripeState = _React$useState2[0],\n setStripeState = _React$useState2[1];\n\n React.useEffect(function () {\n var isMounted = true;\n\n if (parsed.tag === 'async') {\n parsed.stripePromise.then(function (stripePromise) {\n if (stripePromise && isMounted) {\n setStripeState(stripePromise);\n }\n });\n } else if (parsed.tag === 'sync') {\n setStripeState(parsed.stripe);\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on IssuingDisclosure: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(stripeState);\n }, [stripeState]);\n React.useEffect(function () {\n var createDisclosure = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _yield$stripeState$cr, disclosureContent, error, container;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(!stripeState || !containerRef.current)) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 2:\n _context.next = 4;\n return stripeState.createIssuingDisclosure({\n issuingProgramID: issuingProgramID,\n publicCardProgramName: publicCardProgramName,\n learnMoreLink: learnMoreLink\n });\n\n case 4:\n _yield$stripeState$cr = _context.sent;\n disclosureContent = _yield$stripeState$cr.htmlElement;\n error = _yield$stripeState$cr.error;\n\n if (error && onError) {\n onError(error);\n } else if (disclosureContent) {\n container = containerRef.current;\n container.innerHTML = '';\n container.appendChild(disclosureContent);\n\n if (onLoad) {\n onLoad();\n }\n }\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function createDisclosure() {\n return _ref2.apply(this, arguments);\n };\n }();\n\n createDisclosure();\n }, [stripeState, issuingProgramID, publicCardProgramName, learnMoreLink, onLoad, onError]);\n return /*#__PURE__*/React.createElement('div', {\n ref: containerRef\n });\n};\n\n/**\n * @docs https://stripe.com/docs/stripe-js/react#usestripe-hook\n */\n\nvar useStripe = function useStripe() {\n var _useElementsOrCheckou = useElementsOrCheckoutContextWithUseCase('calls useStripe()'),\n stripe = _useElementsOrCheckou.stripe;\n\n return stripe;\n};\n\n/**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar AuBankAccountElement = createElementComponent('auBankAccount', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardElement = createElementComponent('card', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardNumberElement = createElementComponent('cardNumber', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardExpiryElement = createElementComponent('cardExpiry', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardCvcElement = createElementComponent('cardCvc', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar IbanElement = createElementComponent('iban', isServer);\nvar PaymentElement = createElementComponent('payment', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar ExpressCheckoutElement = createElementComponent('expressCheckout', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar LinkAuthenticationElement = createElementComponent('linkAuthentication', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar AddressElement = createElementComponent('address', isServer);\n/**\n * @deprecated\n * Use `AddressElement` instead.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar ShippingAddressElement = createElementComponent('shippingAddress', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar PaymentMethodMessagingElement = createElementComponent('paymentMethodMessaging', isServer);\n/**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n */\n\nvar TaxIdElement = createElementComponent('taxId', isServer);\n\nexport { AddressElement, AuBankAccountElement, CardCvcElement, CardElement, CardExpiryElement, CardNumberElement, Elements, ElementsConsumer, EmbeddedCheckout, EmbeddedCheckoutProvider, ExpressCheckoutElement, FinancialAccountDisclosure, IbanElement, IssuingDisclosure, LinkAuthenticationElement, PaymentElement, PaymentMethodMessagingElement, PaymentRequestButtonElement, ShippingAddressElement, TaxIdElement, useElements, useStripe };\n","import React, { useState } from \"react\";\r\nimport {\r\n PaymentElement,\r\n LinkAuthenticationElement,\r\n AddressElement,\r\n useStripe,\r\n useElements,\r\n} from \"@stripe/react-stripe-js\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Loader2 } from \"lucide-react\";\r\n\r\nexport interface StripePaymentFormProps {\r\n /** Called after Stripe confirms payment — receives the PaymentIntent data. */\r\n onPaymentSuccess?: (paymentIntent: { id: string; status: string;[key: string]: any }) => void;\r\n /** Return URL after redirect-based payment methods (iDEAL, etc.). */\r\n returnUrl?: string;\r\n /** Pre-fill the email field. */\r\n defaultEmail?: string;\r\n /** Pre-fill the name field in billing details. */\r\n defaultName?: string;\r\n}\r\n\r\n/*\r\n\r\n*/\r\n\r\n/**\r\n * Embedded Stripe payment form using PaymentElement.\r\n * Must be rendered inside a Stripe `` provider.\r\n */\r\nexport function StripePaymentForm({\r\n onPaymentSuccess,\r\n returnUrl,\r\n defaultEmail,\r\n defaultName,\r\n}: StripePaymentFormProps) {\r\n const stripe = useStripe();\r\n const elements = useElements();\r\n const [message, setMessage] = useState(null);\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n const handleSubmit = async () => {\r\n if (!stripe || !elements) return;\r\n\r\n setIsLoading(true);\r\n setMessage(null);\r\n\r\n const { error, paymentIntent } = await stripe.confirmPayment({\r\n elements,\r\n confirmParams: {\r\n return_url: returnUrl ?? `${window.location.origin}/completion`,\r\n },\r\n redirect: \"if_required\",\r\n });\r\n\r\n if (error) {\r\n if (error.type === \"card_error\" || error.type === \"validation_error\") {\r\n setMessage(error.message ?? \"Payment failed.\");\r\n } else {\r\n setMessage(\"An unexpected error occurred.\");\r\n }\r\n } else if (paymentIntent) {\r\n // Payment succeeded without redirect\r\n onPaymentSuccess?.({\r\n id: paymentIntent.id,\r\n status: paymentIntent.status,\r\n });\r\n }\r\n\r\n setIsLoading(false);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n\r\n \r\n {isLoading ? (\r\n <>\r\n \r\n Processing…\r\n \r\n ) : (\r\n \"Pay now\"\r\n )}\r\n \r\n\r\n {message && (\r\n

{message}

\r\n )}\r\n
\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport { CreditCard, Bitcoin, ShoppingBag, MapPin, Save } from \"lucide-react\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Input } from \"@/components/ui/input\";\r\nimport { Label } from \"@/components/ui/label\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { useCartStore } from \"@/cart/useCartStore\";\r\nimport { OrderSummary } from \"./OrderSummary\";\r\nimport { PolicyLinks } from \"@/policies/PolicyLinks\";\r\nimport { StripePaymentForm } from \"./StripePaymentForm\";\r\nimport { Elements } from \"@stripe/react-stripe-js\";\r\nimport type { Stripe as StripeJS } from \"@stripe/stripe-js\";\r\n\r\n/** Shipping address fields collected at checkout. */\r\nexport interface ShippingAddress {\r\n fullName: string;\r\n email: string;\r\n address: string;\r\n city: string;\r\n zip: string;\r\n country: string;\r\n}\r\n\r\n/** A saved address with extra metadata (matches pm-pics SavedShippingAddress). */\r\nexport interface SavedAddress extends ShippingAddress {\r\n id: string;\r\n label?: string;\r\n isDefault?: boolean;\r\n phone?: string;\r\n note?: string;\r\n}\r\n\r\nexport type PaymentMethod = \"shopify\" | \"crypto\" | \"stripe\";\r\n\r\nexport interface CheckoutPageProps {\r\n /** Called when user submits the checkout form. */\r\n onPlaceOrder?: (data: {\r\n shipping: ShippingAddress;\r\n paymentMethod: PaymentMethod;\r\n }) => void;\r\n /** Called when user wants to save the entered address to their profile. */\r\n onSaveAddress?: (address: ShippingAddress) => void;\r\n /** Called when user clicks \"Back to Cart\". */\r\n onBackToCart?: () => void;\r\n /** Pre-fill shipping form fields (e.g. from user profile). */\r\n initialShipping?: Partial;\r\n /** Saved shipping addresses — enables address selector. */\r\n savedAddresses?: SavedAddress[];\r\n /** Pre-filled tax amount, if known. */\r\n tax?: number;\r\n /** Pre-filled shipping cost. */\r\n shipping?: number;\r\n /** Stripe.js promise (from loadStripe). */\r\n stripePromise?: Promise | null;\r\n /** Stripe PaymentIntent client secret. */\r\n stripeClientSecret?: string | null;\r\n /** Called after Stripe payment succeeds — includes shipping data and PaymentIntent. */\r\n onStripePaymentSuccess?: (data: {\r\n shipping: ShippingAddress;\r\n paymentMethod: PaymentMethod;\r\n paymentIntent: { id: string; status: string;[key: string]: any };\r\n }) => void;\r\n /** Stripe return URL for redirect-based payment methods. */\r\n stripeReturnUrl?: string;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Checkout page — two-column layout with shipping form + payment selector on\r\n * the left and an OrderSummary on the right.\r\n */\r\nexport function CheckoutPage({\r\n onPlaceOrder,\r\n onSaveAddress,\r\n onBackToCart,\r\n initialShipping,\r\n savedAddresses,\r\n tax,\r\n shipping,\r\n stripePromise,\r\n stripeClientSecret,\r\n onStripePaymentSuccess,\r\n stripeReturnUrl,\r\n className,\r\n}: CheckoutPageProps) {\r\n const itemCount = useCartStore((s) => s.itemCount);\r\n\r\n const [paymentMethod, setPaymentMethod] = useState(\"shopify\");\r\n const [saveAddress, setSaveAddress] = useState(false);\r\n\r\n // Find default address or first address from savedAddresses\r\n const defaultAddress = savedAddresses?.find((a) => a.isDefault) ?? savedAddresses?.[0];\r\n\r\n // Determine initial form values: saved default > initialShipping > empty\r\n const resolveInitial = (): ShippingAddress => ({\r\n fullName: defaultAddress?.fullName ?? initialShipping?.fullName ?? \"\",\r\n email: defaultAddress?.email ?? initialShipping?.email ?? \"\",\r\n address: defaultAddress?.address ?? initialShipping?.address ?? \"\",\r\n city: defaultAddress?.city ?? initialShipping?.city ?? \"\",\r\n zip: defaultAddress?.zip ?? initialShipping?.zip ?? \"\",\r\n country: defaultAddress?.country ?? initialShipping?.country ?? \"\",\r\n });\r\n\r\n const [form, setForm] = useState(resolveInitial);\r\n const [selectedAddressId, setSelectedAddressId] = useState(\r\n defaultAddress?.id ?? \"custom\"\r\n );\r\n\r\n // Sync form when a saved address is selected\r\n const selectAddress = (id: string) => {\r\n setSelectedAddressId(id);\r\n if (id === \"custom\") return;\r\n const addr = savedAddresses?.find((a) => a.id === id);\r\n if (addr) {\r\n setForm({\r\n fullName: addr.fullName,\r\n email: addr.email,\r\n address: addr.address,\r\n city: addr.city,\r\n zip: addr.zip,\r\n country: addr.country,\r\n });\r\n }\r\n };\r\n\r\n const field = (key: keyof ShippingAddress, value: string) =>\r\n setForm((prev) => ({ ...prev, [key]: value }));\r\n\r\n const handleSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n if (saveAddress && selectedAddressId === \"custom\" && onSaveAddress) {\r\n onSaveAddress(form);\r\n }\r\n onPlaceOrder?.({ shipping: form, paymentMethod });\r\n };\r\n\r\n /* ---- Empty cart guard ---- */\r\n if (itemCount === 0) {\r\n return (\r\n
\r\n \r\n

Your cart is empty — nothing to check out.

\r\n {onBackToCart && (\r\n \r\n )}\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n \r\n {/* ---- Left: Shipping + Payment ---- */}\r\n
\r\n {/* Shipping */}\r\n \r\n \r\n Shipping Information\r\n \r\n \r\n {/* Saved Address Selector */}\r\n {savedAddresses && savedAddresses.length > 0 && (\r\n
\r\n \r\n
\r\n {savedAddresses.map((addr) => (\r\n selectAddress(addr.id)}\r\n className={cn(\r\n \"flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors text-sm\",\r\n selectedAddressId === addr.id\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n \r\n
\r\n

\r\n {addr.label || addr.fullName}\r\n {addr.isDefault && (\r\n (Default)\r\n )}\r\n

\r\n

\r\n {addr.address}, {addr.city}, {addr.country}\r\n

\r\n
\r\n \r\n ))}\r\n selectAddress(\"custom\")}\r\n className={cn(\r\n \"flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors text-sm\",\r\n selectedAddressId === \"custom\"\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n ✏️\r\n Enter a new address\r\n \r\n
\r\n
\r\n )}\r\n\r\n {/* Form Fields */}\r\n
\r\n
\r\n \r\n field(\"fullName\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"email\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"address\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"city\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"zip\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"country\", e.target.value)}\r\n />\r\n
\r\n\r\n {selectedAddressId === \"custom\" && onSaveAddress && (\r\n
\r\n setSaveAddress(e.target.checked)}\r\n className=\"h-4 w-4 rounded border-gray-300 accent-primary\"\r\n />\r\n \r\n
\r\n )}\r\n
\r\n
\r\n
\r\n\r\n {/* Payment Method */}\r\n \r\n \r\n Payment Method\r\n \r\n \r\n setPaymentMethod(\"shopify\")}\r\n className={cn(\r\n \"flex w-full items-center gap-3 rounded-lg border p-4 text-left transition-colors\",\r\n paymentMethod === \"shopify\"\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n \r\n
\r\n

Shopify Checkout

\r\n

\r\n Credit / debit card via Shopify\r\n

\r\n
\r\n \r\n\r\n setPaymentMethod(\"crypto\")}\r\n className={cn(\r\n \"flex w-full items-center gap-3 rounded-lg border p-4 text-left transition-colors\",\r\n paymentMethod === \"crypto\"\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n \r\n
\r\n

Crypto Payment

\r\n

\r\n Bitcoin, Ethereum, and more\r\n

\r\n
\r\n \r\n\r\n setPaymentMethod(\"stripe\")}\r\n className={cn(\r\n \"flex w-full items-center gap-3 rounded-lg border p-4 text-left transition-colors\",\r\n paymentMethod === \"stripe\"\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n \r\n
\r\n

Stripe

\r\n

\r\n Credit / debit card, Apple Pay, Google Pay\r\n

\r\n
\r\n \r\n\r\n {/* Inline Stripe Payment Form */}\r\n {paymentMethod === \"stripe\" && stripePromise && stripeClientSecret && (\r\n
\r\n \r\n {\r\n if (saveAddress && selectedAddressId === \"custom\" && onSaveAddress) {\r\n onSaveAddress(form);\r\n }\r\n onStripePaymentSuccess?.({\r\n shipping: form,\r\n paymentMethod: \"stripe\",\r\n paymentIntent,\r\n });\r\n }}\r\n returnUrl={stripeReturnUrl}\r\n defaultEmail={form.email}\r\n defaultName={form.fullName}\r\n />\r\n \r\n
\r\n )}\r\n
\r\n
\r\n
\r\n\r\n {/* ---- Right: Summary + CTA ---- */}\r\n
\r\n \r\n\r\n \r\n\r\n {paymentMethod !== \"stripe\" && (\r\n \r\n )}\r\n\r\n {onBackToCart && (\r\n \r\n ← Back to Cart\r\n \r\n )}\r\n\r\n \r\n
\r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nexport interface PolicyPageProps {\r\n /** Page title override. */\r\n title?: string;\r\n /** Rich content to render inside the page body (JSX). */\r\n children?: React.ReactNode;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Generic policy/info page shell — centered card with title + prose body.\r\n * Used by ShippingPage, ReturnsPage, PrivacyPolicyPage, TermsPage.\r\n */\r\nexport function PolicyPage({ title, children, className }: PolicyPageProps) {\r\n return (\r\n
\r\n \r\n \r\n {title}\r\n \r\n \r\n \r\n {children}\r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { Truck, Clock, Globe, DollarSign } from \"lucide-react\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { PolicyPage } from \"./PolicyPage\";\r\n\r\nexport interface ShippingRate {\r\n region: string;\r\n method: string;\r\n estimate: string;\r\n price: string;\r\n}\r\n\r\nexport interface ShippingPageProps {\r\n /** Custom shipping rates to display. Falls back to placeholder content. */\r\n rates?: ShippingRate[];\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\nconst defaultRates: ShippingRate[] = [\r\n { region: \"Domestic\", method: \"Standard\", estimate: \"5–7 business days\", price: \"$4.99\" },\r\n { region: \"Domestic\", method: \"Express\", estimate: \"2–3 business days\", price: \"$12.99\" },\r\n { region: \"International\", method: \"Standard\", estimate: \"10–20 business days\", price: \"$14.99\" },\r\n { region: \"International\", method: \"Express\", estimate: \"5–8 business days\", price: \"$29.99\" },\r\n];\r\n\r\n/** Public page with shipping info and rates. */\r\nexport function ShippingPage({ rates = defaultRates, className }: ShippingPageProps) {\r\n return (\r\n \r\n {/* Highlights */}\r\n
\r\n {[\r\n { icon: Truck, label: \"Free shipping on orders over $75\" },\r\n { icon: Clock, label: \"Same-day dispatch on orders before 2 PM\" },\r\n { icon: Globe, label: \"We ship worldwide\" },\r\n { icon: DollarSign, label: \"No hidden fees at checkout\" },\r\n ].map(({ icon: Icon, label }) => (\r\n \r\n \r\n {label}\r\n
\r\n ))}\r\n
\r\n\r\n {/* Rates table */}\r\n

Shipping Rates

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {rates.map((r, i) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n ))}\r\n \r\n
RegionMethodEstimatePrice
{r.region}{r.method}{r.estimate}{r.price}
\r\n
\r\n\r\n

Processing Time

\r\n

\r\n Orders placed before 2:00 PM (local time) on business days are typically processed and\r\n shipped the same day. Orders placed after this cut-off or on weekends/holidays will be\r\n processed the next business day.\r\n

\r\n\r\n

Tracking

\r\n

\r\n Once your order ships, you will receive a confirmation email with a tracking number.\r\n You can use this number to track your package on the carrier's website.\r\n

\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { RotateCcw, CheckCircle, XCircle, Clock } from \"lucide-react\";\r\nimport { PolicyPage } from \"./PolicyPage\";\r\n\r\nexport interface ReturnsPageProps {\r\n /** Number of days for return window. */\r\n returnWindowDays?: number;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/** Public page with refund / return policy. */\r\nexport function ReturnsPage({ returnWindowDays = 30, className }: ReturnsPageProps) {\r\n return (\r\n \r\n {/* Quick summary */}\r\n
\r\n {[\r\n { icon: Clock, label: `${returnWindowDays}-day return window` },\r\n { icon: RotateCcw, label: \"Free returns on defective items\" },\r\n { icon: CheckCircle, label: \"Full refund to original payment\" },\r\n { icon: XCircle, label: \"No restocking fees\" },\r\n ].map(({ icon: Icon, label }) => (\r\n \r\n \r\n {label}\r\n
\r\n ))}\r\n
\r\n\r\n

Eligibility

\r\n

\r\n Items must be returned within {returnWindowDays} days of delivery in their\r\n original, unused condition with all tags and packaging intact.\r\n

\r\n\r\n

How to Initiate a Return

\r\n
    \r\n
  1. Contact our support team with your order number.
  2. \r\n
  3. Receive a prepaid return label (for defective items) or return instructions.
  4. \r\n
  5. Ship the item back using the provided label or your preferred carrier.
  6. \r\n
\r\n\r\n

Refund Processing

\r\n

\r\n Once we receive and inspect the returned item, your refund will be processed within\r\n 5–10 business days to your original payment method. You will receive an email\r\n confirmation when the refund has been issued.\r\n

\r\n\r\n

Exceptions

\r\n

\r\n The following items are not eligible for return: gift cards, downloadable products,\r\n and items marked as final sale. Perishable goods cannot be returned unless they arrive\r\n damaged or defective.\r\n

\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { PolicyPage } from \"./PolicyPage\";\r\n\r\nexport interface PrivacyPolicyPageProps {\r\n /** Business / site name used in the policy text. */\r\n siteName?: string;\r\n /** Contact email for privacy inquiries. */\r\n contactEmail?: string;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/** Public page with privacy / cookie information. */\r\nexport function PrivacyPolicyPage({\r\n siteName = \"Our Store\",\r\n contactEmail = \"privacy@example.com\",\r\n className,\r\n}: PrivacyPolicyPageProps) {\r\n return (\r\n \r\n

\r\n At {siteName}, we are committed to protecting your personal information\r\n and your right to privacy. This policy explains what information we collect, how we use\r\n it, and what rights you have in relation to it.\r\n

\r\n\r\n

Information We Collect

\r\n
    \r\n
  • \r\n Personal information: name, email, shipping address, and payment\r\n details provided during checkout.\r\n
  • \r\n
  • \r\n Usage data: pages visited, time spent, browser type, and device\r\n information collected automatically.\r\n
  • \r\n
  • \r\n Cookies: small data files stored on your device to improve your\r\n browsing experience and remember your preferences.\r\n
  • \r\n
\r\n\r\n

How We Use Your Information

\r\n
    \r\n
  • To process and fulfill your orders.
  • \r\n
  • To communicate with you about orders, updates, and promotions.
  • \r\n
  • To improve our website and services.
  • \r\n
  • To comply with legal obligations.
  • \r\n
\r\n\r\n

Data Sharing

\r\n

\r\n We do not sell your personal data. We share information only with service providers\r\n necessary to fulfill your order (e.g., payment processors, shipping carriers) and as\r\n required by law.\r\n

\r\n\r\n

Cookies

\r\n

\r\n We use essential cookies for site functionality and optional analytics cookies to\r\n understand usage patterns. You can manage cookie preferences through your browser\r\n settings.\r\n

\r\n\r\n

Your Rights

\r\n

\r\n You may request access to, correction of, or deletion of your personal data at any\r\n time by contacting us at{\" \"}\r\n \r\n {contactEmail}\r\n \r\n .\r\n

\r\n\r\n

Contact Us

\r\n

\r\n If you have questions about this privacy policy, please contact us at{\" \"}\r\n \r\n {contactEmail}\r\n \r\n .\r\n

\r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { PolicyPage } from \"./PolicyPage\";\r\n\r\nexport interface TermsPageProps {\r\n /** Business / site name. */\r\n siteName?: string;\r\n /** Contact email for legal inquiries. */\r\n contactEmail?: string;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/** Optional terms of service page. */\r\nexport function TermsPage({\r\n siteName = \"Our Store\",\r\n contactEmail = \"legal@example.com\",\r\n className,\r\n}: TermsPageProps) {\r\n return (\r\n \r\n

\r\n By accessing and using {siteName}, you agree to be bound by these\r\n Terms of Service.\r\n

\r\n\r\n

Use of the Site

\r\n

\r\n You agree to use this site only for lawful purposes and in a manner that does not\r\n infringe on the rights of others or restrict their use and enjoyment of the site.\r\n

\r\n\r\n

Products & Pricing

\r\n

\r\n All product descriptions and prices are subject to change without notice. We reserve\r\n the right to modify or discontinue any product at any time. Prices are displayed in\r\n the store's base currency and may exclude taxes and shipping costs, which are\r\n calculated at checkout.\r\n

\r\n\r\n

Orders & Payment

\r\n

\r\n By placing an order, you make an offer to purchase the selected products. We reserve\r\n the right to refuse or cancel any order for any reason, including pricing errors or\r\n suspected fraud.\r\n

\r\n\r\n

Intellectual Property

\r\n

\r\n All content on this site — including text, images, logos, and software — is the\r\n property of {siteName} or its licensors and is protected by applicable intellectual\r\n property laws.\r\n

\r\n\r\n

Limitation of Liability

\r\n

\r\n To the fullest extent permitted by law, {siteName} shall not be liable for any\r\n indirect, incidental, or consequential damages arising from your use of the site or\r\n purchase of products.\r\n

\r\n\r\n

Changes to These Terms

\r\n

\r\n We may update these Terms of Service from time to time. Continued use of the site\r\n after changes constitutes acceptance of the revised terms.\r\n

\r\n\r\n

Contact

\r\n

\r\n For questions about these terms, contact us at{\" \"}\r\n \r\n {contactEmail}\r\n \r\n .\r\n

\r\n
\r\n );\r\n}\r\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nvar RELEASE_TRAIN = 'clover';\n\nvar runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {\n return version === 3 ? 'v3' : version;\n};\n\nvar ORIGIN = 'https://js.stripe.com';\nvar STRIPE_JS_URL = \"\".concat(ORIGIN, \"/\").concat(RELEASE_TRAIN, \"/stripe.js\");\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar STRIPE_JS_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/(v3|[a-z]+)\\/stripe\\.js(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\n\nvar isStripeJSURL = function isStripeJSURL(url) {\n return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);\n};\n\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(ORIGIN, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!isStripeJSURL(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(STRIPE_JS_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"8.8.0\",\n startTime: startTime\n });\n};\n\nvar stripePromise$1 = null;\nvar onErrorListener = null;\nvar onLoadListener = null;\n\nvar onError = function onError(reject) {\n return function (cause) {\n reject(new Error('Failed to load Stripe.js', {\n cause: cause\n }));\n };\n};\n\nvar onLoad = function onLoad(resolve, reject) {\n return function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n };\n};\n\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise$1 !== null) {\n return stripePromise$1;\n }\n\n stripePromise$1 = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n } else if (script && onLoadListener !== null && onErrorListener !== null) {\n var _script$parentNode;\n\n // remove event listeners\n script.removeEventListener('load', onLoadListener);\n script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,\n // reload script to trigger 'load' event\n\n (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);\n script = injectScript(params);\n }\n\n onLoadListener = onLoad(resolve, reject);\n onErrorListener = onError(reject);\n script.addEventListener('load', onLoadListener);\n script.addEventListener('error', onErrorListener);\n } catch (error) {\n reject(error);\n return;\n }\n }); // Resets stripePromise on error\n\n return stripePromise$1[\"catch\"](function (error) {\n stripePromise$1 = null;\n return Promise.reject(error);\n });\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var pk = args[0];\n\n if (typeof pk !== 'string') {\n throw new Error(\"Expected publishable key to be of type string, got type \".concat(_typeof(pk), \" instead.\"));\n }\n\n var isTestKey = pk.match(/^pk_test/); // @ts-expect-error this is not publicly typed\n\n var version = runtimeVersionToUrlVersion(maybeStripe.version);\n var expectedVersion = RELEASE_TRAIN;\n\n if (isTestKey && version !== expectedVersion) {\n console.warn(\"Stripe.js@\".concat(version, \" was loaded on the page, but @stripe/stripe-js@\").concat(\"8.8.0\", \" expected Stripe.js@\").concat(expectedVersion, \". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning\"));\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nvar stripePromise;\nvar loadCalled = false;\n\nvar getStripePromise = function getStripePromise() {\n if (stripePromise) {\n return stripePromise;\n }\n\n stripePromise = loadScript(null)[\"catch\"](function (error) {\n // clear cache on error\n stripePromise = null;\n return Promise.reject(error);\n });\n return stripePromise;\n}; // Execute our own script injection after a tick to give users time to do their\n// own script injection.\n\n\nPromise.resolve().then(function () {\n return getStripePromise();\n})[\"catch\"](function (error) {\n if (!loadCalled) {\n console.warn(error);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now(); // if previous attempts are unsuccessful, will re-load script\n\n return getStripePromise().then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n","import React, { useState, useEffect } from \"react\";\r\nimport { CheckoutPage, CheckoutPageProps, SavedAddress } from \"./CheckoutPage\";\r\nimport { useCartStore } from \"@/cart/useCartStore\";\r\nimport { loadStripe, type Stripe as StripeJS } from \"@stripe/stripe-js\";\r\n\r\nexport interface CheckoutFlowProps {\r\n /** The authenticated user's ID. */\r\n userId?: string;\r\n /** The authenticated user's display name. */\r\n userDisplayName?: string;\r\n /** The authenticated user's email. */\r\n userEmail?: string;\r\n /** Async function to fetch saved addresses for the user. */\r\n onFetchAddresses: (userId: string) => Promise;\r\n /** Async function to save a new address (or update list). */\r\n onSaveAddress: (userId: string, addresses: SavedAddress[]) => Promise;\r\n /** Async function to place the order (create transaction). */\r\n onPlaceOrder: (data: any) => Promise;\r\n /** Navigation callback to go back to cart. */\r\n onBackToCart: () => void;\r\n /** Callback after successful order placement (e.g. navigate to purchases). */\r\n onOrderSuccess: () => void;\r\n /** Toast notification handler. */\r\n toast?: {\r\n success: (msg: string) => void;\r\n error: (msg: string) => void;\r\n };\r\n /**\r\n * Stripe publishable key (pk_test_... or pk_live_...).\r\n * If omitted the Stripe payment option will still render but remain\r\n * in a \"loading\" state until the key is provided.\r\n */\r\n stripePublishableKey?: string;\r\n /**\r\n * Base URL for the API server (e.g. \"http://localhost:3333\").\r\n * Used to call `/api/stripe/create-payment-intent`.\r\n */\r\n apiBaseUrl?: string;\r\n /** Stripe return URL for redirect-based payment methods. */\r\n stripeReturnUrl?: string;\r\n /** Currency code for Stripe payments (default: \"eur\"). */\r\n currency?: string;\r\n /** Returns the current auth token for authenticated API calls. */\r\n getAuthToken?: () => Promise;\r\n /** Locale for Stripe Elements (e.g. \"en\", \"de\", \"fr\"). */\r\n locale?: string;\r\n}\r\n\r\nexport function CheckoutFlow({\r\n userId,\r\n userDisplayName,\r\n userEmail,\r\n onFetchAddresses,\r\n onSaveAddress,\r\n onPlaceOrder,\r\n onBackToCart,\r\n onOrderSuccess,\r\n toast,\r\n stripePublishableKey,\r\n apiBaseUrl = \"\",\r\n stripeReturnUrl,\r\n currency = \"eur\",\r\n getAuthToken,\r\n locale,\r\n}: CheckoutFlowProps) {\r\n const [savedAddresses, setSavedAddresses] = useState([]);\r\n const [stripePromise, setStripePromise] = useState | null>(null);\r\n const [clientSecret, setClientSecret] = useState(null);\r\n const subtotal = useCartStore((s) => s.subtotal);\r\n\r\n // 1. Fetch addresses on mount if user exists\r\n useEffect(() => {\r\n if (!userId) return;\r\n let mounted = true;\r\n onFetchAddresses(userId)\r\n .then((addrs) => {\r\n if (mounted) setSavedAddresses(addrs);\r\n })\r\n .catch((err) => console.error(\"Failed to fetch addresses:\", err));\r\n return () => { mounted = false; };\r\n }, [userId, onFetchAddresses]);\r\n\r\n // 2. Load Stripe.js once we have a publishable key\r\n useEffect(() => {\r\n if (!stripePublishableKey) return;\r\n setStripePromise(loadStripe(stripePublishableKey, { locale: (locale as any) || 'auto' }));\r\n }, [stripePublishableKey, locale]);\r\n\r\n // 3. Create a PaymentIntent when the flow mounts (so the form is ready)\r\n useEffect(() => {\r\n if (!stripePublishableKey || subtotal <= 0) return;\r\n let mounted = true;\r\n\r\n // Stripe expects amount in smallest currency unit (cents for USD)\r\n const amountInCents = Math.round(subtotal * 100);\r\n\r\n // Get auth token for the API call (needed for Stripe Customer creation)\r\n const makeRequest = async () => {\r\n const headers: Record = { \"Content-Type\": \"application/json\" };\r\n if (getAuthToken) {\r\n const token = await getAuthToken();\r\n if (token) headers[\"Authorization\"] = `Bearer ${token}`;\r\n }\r\n const r = await fetch(`${apiBaseUrl}/api/stripe/create-payment-intent`, {\r\n method: \"POST\",\r\n headers,\r\n body: JSON.stringify({ amount: amountInCents, currency }),\r\n });\r\n return r.json();\r\n };\r\n\r\n makeRequest()\r\n .then((data) => {\r\n if (mounted && data.clientSecret) {\r\n setClientSecret(data.clientSecret);\r\n }\r\n })\r\n .catch((err) => console.error(\"Failed to create PaymentIntent:\", err));\r\n\r\n return () => { mounted = false; };\r\n }, [stripePublishableKey, apiBaseUrl, subtotal]);\r\n\r\n // 4. Handle saving a new address\r\n const handleSaveAddress = async (address: any) => {\r\n if (!userId) return;\r\n try {\r\n // Re-fetch latest to be safe (or use local state if we trust it completely)\r\n const existing = await onFetchAddresses(userId);\r\n\r\n const newAddr: SavedAddress = {\r\n ...address,\r\n id: crypto.randomUUID(),\r\n label: address.address?.split(',')[0] || 'Checkout address',\r\n phone: '',\r\n note: '',\r\n // If it's the first address, make it default\r\n isDefault: existing.length === 0,\r\n };\r\n\r\n const updated = [...existing, newAddr];\r\n await onSaveAddress(userId, updated);\r\n setSavedAddresses(updated);\r\n toast?.success(\"Address saved to your profile\");\r\n } catch (err) {\r\n console.error(\"Failed to save address:\", err);\r\n toast?.error(\"Failed to save address\");\r\n }\r\n };\r\n\r\n // 5. Handle order placement (for non-Stripe methods)\r\n const handlePlaceOrder = async (data: any) => {\r\n try {\r\n await onPlaceOrder(data);\r\n toast?.success(\"Order placed successfully!\");\r\n onOrderSuccess();\r\n } catch (err) {\r\n console.error(\"Failed to place order:\", err);\r\n toast?.error(\"Failed to place order. Please try again.\");\r\n }\r\n };\r\n\r\n // 6. Handle Stripe payment success (inline, no redirect)\r\n const handleStripePaymentSuccess = async (data: {\r\n shipping: any;\r\n paymentMethod: string;\r\n paymentIntent: { id: string; status: string;[key: string]: any };\r\n }) => {\r\n try {\r\n await onPlaceOrder({\r\n shipping: data.shipping,\r\n paymentMethod: data.paymentMethod,\r\n // Store Stripe PaymentIntent ID for refunds/reconciliation\r\n external_order_id: data.paymentIntent.id,\r\n metadata: {\r\n stripe_payment_intent_id: data.paymentIntent.id,\r\n stripe_status: data.paymentIntent.status,\r\n },\r\n });\r\n toast?.success(\"Payment successful!\");\r\n // Brief delay to let the Stripe webhook update the transaction\r\n // with receipt URL and status before navigating\r\n await new Promise((r) => setTimeout(r, 2000));\r\n onOrderSuccess();\r\n } catch (err) {\r\n console.error(\"Failed to record Stripe transaction:\", err);\r\n toast?.error(\"Payment succeeded but failed to record transaction. Contact support.\");\r\n }\r\n };\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from \"react\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst badgeVariants = cva(\r\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\r\n secondary: \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n destructive: \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\r\n outline: \"text-foreground\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n },\r\n },\r\n);\r\n\r\nexport interface BadgeProps extends React.HTMLAttributes, VariantProps { }\r\n\r\nfunction Badge({ className, variant, ...props }: BadgeProps) {\r\n return
;\r\n}\r\n\r\nexport { Badge, badgeVariants };\r\n","import React, { useState, useEffect } from \"react\";\r\nimport { Package, Clock, CheckCircle, XCircle, ArrowLeft, ExternalLink, RefreshCw, Store, Receipt, FileText } from \"lucide-react\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Badge } from \"@/components/ui/badge\";\r\n\r\n// We need to define or import Transaction type and statusConfig locally or from a shared type file\r\n// Since client-ecommerce.ts is outside, let's redefine minimal types here or ask for them to be passed in.\r\n// Ideally, `client-ecommerce.ts` types should be imported from @polymech/ecommerce if possible, \r\n// OR @polymech/ecommerce should define the types and client-ecommerce uses them.\r\n// For now, let's define the props generically.\r\n\r\nexport interface Transaction {\r\n id: string;\r\n created_at: string;\r\n status: string;\r\n total_amount: number;\r\n currency: string;\r\n product_info: any[];\r\n shipping_info: any;\r\n payment_provider?: string;\r\n external_order_id?: string;\r\n metadata?: Record;\r\n}\r\n\r\nexport interface PurchasesListProps {\r\n /** Async function to fetch user transactions. */\r\n onFetchTransactions: () => Promise;\r\n /** Navigation callback. */\r\n onNavigate: (path: string) => void;\r\n /** Toast notification handler. */\r\n toast?: {\r\n error: (msg: string) => void;\r\n };\r\n}\r\n\r\nconst statusConfig: Record = {\r\n pending: { label: \"Pending\", variant: \"secondary\", icon: },\r\n processing: { label: \"Processing\", variant: \"default\", icon: },\r\n paid: { label: \"Paid\", variant: \"default\", icon: },\r\n completed: { label: \"Completed\", variant: \"default\", icon: },\r\n failed: { label: \"Failed\", variant: \"destructive\", icon: },\r\n refunded: { label: \"Refunded\", variant: \"outline\", icon: },\r\n cancelled: { label: \"Cancelled\", variant: \"destructive\", icon: },\r\n};\r\n\r\nexport function PurchasesList({ onFetchTransactions, onNavigate, toast }: PurchasesListProps) {\r\n const [transactions, setTransactions] = useState([]);\r\n const [loading, setLoading] = useState(true);\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n setLoading(true);\r\n onFetchTransactions()\r\n .then((data) => {\r\n if (mounted) setTransactions(data);\r\n })\r\n .catch((err) => {\r\n console.error(\"Failed to load transactions:\", err);\r\n toast?.error(\"Failed to load purchases\");\r\n })\r\n .finally(() => {\r\n if (mounted) setLoading(false);\r\n });\r\n return () => { mounted = false; };\r\n }, [onFetchTransactions]);\r\n\r\n if (loading) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n
\r\n
\r\n \r\n

My Purchases

\r\n
\r\n \r\n
\r\n\r\n {transactions.length === 0 ? (\r\n \r\n \r\n \r\n

No purchases yet.

\r\n \r\n
\r\n
\r\n ) : (\r\n
\r\n {transactions.map((tx) => {\r\n const products = Array.isArray(tx.product_info) ? tx.product_info : [];\r\n const sc = statusConfig[tx.status] || statusConfig.pending;\r\n const date = new Date(tx.created_at).toLocaleDateString(undefined, {\r\n year: \"numeric\",\r\n month: \"short\",\r\n day: \"numeric\",\r\n hour: \"2-digit\",\r\n minute: \"2-digit\",\r\n });\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n \r\n Order #{tx.id.slice(0, 8)}\r\n \r\n

{date}

\r\n
\r\n
\r\n \r\n {sc.icon}\r\n {sc.label}\r\n \r\n \r\n {tx.currency} {Number(tx.total_amount).toFixed(2)}\r\n \r\n
\r\n
\r\n
\r\n \r\n {/* Product list */}\r\n
\r\n {products.map((item: any, idx: number) => (\r\n \r\n {item.image && (\r\n \r\n )}\r\n
\r\n

\r\n {item.title || \"Product\"}\r\n

\r\n

\r\n Qty: {item.quantity || 1}\r\n {item.variant && ` · ${item.variant}`}\r\n {\" · \"}\r\n {tx.currency} {Number(item.price || 0).toFixed(2)}\r\n

\r\n {item.vendorSlug && (\r\n { e.preventDefault(); onNavigate(`/user/${item.vendorSlug}`); }}\r\n className=\"text-xs text-primary hover:underline flex items-center gap-1 mt-0.5 cursor-pointer\"\r\n >\r\n \r\n {item.vendorSlug}\r\n \r\n )}\r\n
\r\n {item.vendorSlug && item.pageSlug && (\r\n { e.preventDefault(); onNavigate(`/user/${item.vendorSlug}/pages/${item.pageSlug}`); }}\r\n className=\"text-primary hover:underline text-xs flex items-center gap-1 shrink-0 cursor-pointer\"\r\n >\r\n View\r\n \r\n \r\n )}\r\n
\r\n ))}\r\n
\r\n\r\n {/* Shipping summary */}\r\n {tx.shipping_info && Object.keys(tx.shipping_info).length > 0 && (\r\n
\r\n Ships to: {(tx.shipping_info as any).fullName}, {(tx.shipping_info as any).city}, {(tx.shipping_info as any).country}\r\n
\r\n )}\r\n\r\n {/* Receipt / Invoice links */}\r\n {tx.metadata && (tx.metadata.stripe_receipt_url || tx.metadata.stripe_invoice_url) && (\r\n
\r\n {tx.metadata.stripe_receipt_url && (\r\n \r\n \r\n View Receipt\r\n \r\n )}\r\n {tx.metadata.stripe_invoice_url && (\r\n \r\n \r\n View Invoice\r\n \r\n )}\r\n
\r\n )}\r\n \r\n \r\n );\r\n })}\r\n
\r\n )}\r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { useLocation, matchPath, Navigate } from \"react-router-dom\";\r\nimport { CartPage } from \"./cart/CartPage\";\r\nimport { CheckoutFlow } from \"./checkout/CheckoutFlow\";\r\nimport { PurchasesList } from \"./purchases/PurchasesList\";\r\nimport { ShippingPage } from \"./policies/ShippingPage\";\r\nimport { ReturnsPage } from \"./policies/ReturnsPage\";\r\nimport { PrivacyPolicyPage } from \"./policies/PrivacyPolicyPage\";\r\nimport { TermsPage } from \"./policies/TermsPage\";\r\n\r\nexport interface EcommerceBundleDependencies {\r\n user: {\r\n id?: string;\r\n email?: string;\r\n user_metadata?: {\r\n display_name?: string;\r\n };\r\n } | null;\r\n toast: {\r\n success: (message: string) => void;\r\n error: (message: string) => void;\r\n };\r\n onFetchAddresses: (userId: string) => Promise;\r\n onSaveAddress: (userId: string, addresses: any[]) => Promise;\r\n onPlaceOrder: (data: any) => Promise;\r\n onFetchTransactions: () => Promise;\r\n onNavigate: (path: string) => void;\r\n // Optional config\r\n siteName?: string;\r\n contactEmail?: string;\r\n /** Stripe publishable key — enables Stripe payment option. */\r\n stripePublishableKey?: string;\r\n /** API base URL for Stripe endpoints (e.g. \"http://localhost:3333\"). */\r\n apiBaseUrl?: string;\r\n /** Stripe return URL for redirect-based payment methods. */\r\n stripeReturnUrl?: string;\r\n /** Currency code for Stripe (default: \"eur\"). */\r\n currency?: string;\r\n /** Returns the current auth token for authenticated API calls. */\r\n getAuthToken?: () => Promise;\r\n /** Locale for Stripe Elements (e.g. \"en\", \"de\"). */\r\n locale?: string;\r\n}\r\n\r\nexport const EcommerceBundle: React.FC = (props) => {\r\n const { pathname } = useLocation();\r\n\r\n if (matchPath(\"/cart/*\", pathname)) {\r\n return props.onNavigate('/checkout')} />;\r\n }\r\n\r\n if (matchPath(\"/checkout/*\", pathname)) {\r\n return (\r\n props.onNavigate('/cart')}\r\n onOrderSuccess={() => props.onNavigate('/purchases')}\r\n toast={props.toast}\r\n stripePublishableKey={props.stripePublishableKey}\r\n apiBaseUrl={props.apiBaseUrl}\r\n stripeReturnUrl={props.stripeReturnUrl}\r\n currency={props.currency}\r\n getAuthToken={props.getAuthToken}\r\n locale={props.locale}\r\n />\r\n );\r\n }\r\n\r\n if (matchPath(\"/purchases/*\", pathname)) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n if (matchPath(\"/shipping/*\", pathname)) return ;\r\n if (matchPath(\"/returns/*\", pathname)) return ;\r\n if (matchPath(\"/privacy/*\", pathname)) return ;\r\n if (matchPath(\"/terms/*\", pathname)) return ;\r\n\r\n return null; // Return null if no route matches (let App.tsx handle 404 if needed, though this component is usually mounted on specific routes)\r\n};\r\n"],"names":["setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","REACT_LAZY_TYPE","use","React","isPromiseLike","isLazyComponent","element","createSlot","ownerName","SlotClone","createSlotClone","Slot2","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","Slot","childrenRef","getElementRef","props2","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","getter","_a","mayWarn","_b","r","t","f","clsx","falsyToString","cx","cva","base","config","_config_compoundVariants","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","param","key","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","cn","inputs","twMerge","buttonVariants","Button","className","size","asChild","computeTotals","items","sum","useCartStore","create","persist","set","incoming","state","existing","id","quantity","CartItemRow","item","updateQuantity","s","removeItem","lineTotal","jsxs","Minus","Plus","Trash2","Card","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","NODES","Primitive","primitive","Node","primitiveProps","Comp","NAME","DEFAULT_ORIENTATION","ORIENTATIONS","Separator","decorative","orientationProp","domProps","orientation","isValidOrientation","semanticProps","Root","SeparatorPrimitive.Root","defaultLinks","PolicyLinks","links","l","CartPage","onCheckout","subtotal","itemCount","clearCart","ShoppingCart","OrderSummary","tax","shipping","taxAmount","shippingAmount","total","Input","type","Label","event","labelVariants","LabelPrimitive.Root","b","c","d","e","g","h","k","m","n","p","q","v","w","x","y","z","a","u","A","reactIs_production_min","hasSymbol","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_ASYNC_MODE_TYPE","REACT_CONCURRENT_MODE_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_BLOCK_TYPE","REACT_FUNDAMENTAL_TYPE","REACT_RESPONDER_TYPE","REACT_SCOPE_TYPE","isValidElementType","typeOf","object","$$typeof","$$typeofType","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","ForwardRef","Fragment","Lazy","Memo","Portal","Profiler","StrictMode","Suspense","hasWarnedAboutDeprecatedIsAsyncMode","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","reactIs_development","reactIsModule","require$$0","require$$1","getOwnPropertySymbols","hasOwnProperty","propIsEnumerable","toObject","val","shouldUseNative","test1","test2","order2","test3","letter","objectAssign","target","source","from","to","symbols","ReactPropTypesSecret","ReactPropTypesSecret_1","has","printWarning","loggedTypeFailures","text","message","checkPropTypes","typeSpecs","values","location","componentName","getStack","typeSpecName","error","err","ex","stack","checkPropTypes_1","ReactIs","assign","require$$2","require$$3","require$$4","emptyFunctionThatReturnsNull","factoryWithTypeCheckers","isValidElement","throwOnDirectAccess","ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","iteratorFn","ANONYMOUS","ReactPropTypes","createPrimitiveTypeChecker","createAnyTypeChecker","createArrayOfTypeChecker","createElementTypeChecker","createElementTypeTypeChecker","createInstanceTypeChecker","createNodeChecker","createObjectOfTypeChecker","createEnumTypeChecker","createUnionTypeChecker","createShapeTypeChecker","createStrictShapeTypeChecker","is","PropTypeError","data","createChainableTypeChecker","validate","manualPropTypeCallCache","manualPropTypeWarningCount","checkType","isRequired","propFullName","secret","cacheKey","chainedCheckType","expectedType","propValue","propType","getPropType","preciseType","getPreciseType","typeChecker","expectedClass","expectedClassName","actualClassName","getClassName","expectedValues","valuesString","arrayOfTypeCheckers","checker","getPostfixForTypeWarning","expectedTypes","checkerResult","expectedTypesMessage","isNode","invalidValidatorError","shapeTypes","allKeys","iterator","step","entry","isSymbol","emptyFunction","emptyFunctionWithReset","factoryWithThrowingShims","shim","getShim","propTypesModule","ownKeys","enumerableOnly","keys","sym","_objectSpread2","_defineProperty","_typeof","obj","_objectWithoutPropertiesLoose","excluded","sourceKeys","_objectWithoutProperties","sourceSymbolKeys","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_i","_arr","_n","_d","_s","_e","o","minLen","_arrayLikeToArray","len","arr2","useAttachEvent","cb","cbDefined","cbRef","decoratedCb","usePrevious","isUnknownObject","raw","isPromise","isStripe","PLAIN_OBJECT_STR","isEqual","left","right","leftArray","rightArray","leftPlainObject","rightPlainObject","leftKeys","rightKeys","keySet","pred","extractAllowedOptionsUpdates","options","prevOptions","immutableKeys","newOptions","isUpdated","INVALID_STRIPE_ERROR$1","validateStripe","maybeStripe","errorMsg","parseStripeProp","stripe","registerWithStripeJs","ElementsContext","parseElementsContext","ctx","useCase","Elements","_ref","rawStripeProp","parsed","_React$useState","_React$useState2","setContext","isMounted","safeSetContext","prevStripe","updates","PropTypes","useElementsContextWithUseCase","useCaseMessage","useElements","_useElementsContextWi","elements","CheckoutContext","useElementsOrCheckoutContextWithUseCase","useCaseString","checkout","_excluded","capitalized","str","createElementComponent","isServer","displayName","ClientElement","_ref$options","onBlur","onFocus","onReady","onChange","onEscape","onClick","onLoadError","onLoaderStart","onNetworksChange","onConfirm","onCancel","onShippingAddressChange","onShippingRateChange","onSavedPaymentMethodRemove","onSavedPaymentMethodUpdate","checkoutState","checkoutSdk","setElement","elementRef","domNode","readyCallback","mode","restOptions","ServerElement","EmbeddedCheckoutContext","useStripe","_useElementsOrCheckou","PaymentElement","LinkAuthenticationElement","StripePaymentForm","onPaymentSuccess","returnUrl","defaultEmail","defaultName","setMessage","useState","isLoading","setIsLoading","paymentIntent","Loader2","CheckoutPage","onPlaceOrder","onSaveAddress","onBackToCart","initialShipping","savedAddresses","stripePromise","stripeClientSecret","onStripePaymentSuccess","stripeReturnUrl","paymentMethod","setPaymentMethod","saveAddress","setSaveAddress","defaultAddress","resolveInitial","form","setForm","selectedAddressId","setSelectedAddressId","selectAddress","addr","field","prev","handleSubmit","ShoppingBag","MapPin","Save","CreditCard","Bitcoin","PolicyPage","title","defaultRates","ShippingPage","rates","Truck","Clock","Globe","DollarSign","Icon","label","ReturnsPage","returnWindowDays","RotateCcw","CheckCircle","XCircle","PrivacyPolicyPage","siteName","contactEmail","TermsPage","RELEASE_TRAIN","runtimeVersionToUrlVersion","version","ORIGIN","STRIPE_JS_URL","V3_URL_REGEX","STRIPE_JS_URL_REGEX","isStripeJSURL","url","findScript","scripts","script","injectScript","params","queryString","headOrBody","registerWrapper","startTime","stripePromise$1","onErrorListener","onLoadListener","onError","reject","cause","onLoad","resolve","loadScript","_script$parentNode","initStripe","pk","isTestKey","expectedVersion","loadCalled","getStripePromise","loadStripe","_len","_key","CheckoutFlow","userId","userDisplayName","userEmail","onFetchAddresses","onOrderSuccess","toast","stripePublishableKey","apiBaseUrl","currency","getAuthToken","locale","setSavedAddresses","setStripePromise","clientSecret","setClientSecret","useEffect","mounted","addrs","amountInCents","headers","token","address","newAddr","updated","badgeVariants","Badge","statusConfig","RefreshCw","PurchasesList","onFetchTransactions","onNavigate","transactions","setTransactions","loading","setLoading","Package","ArrowLeft","tx","products","sc","date","idx","Store","ExternalLink","Receipt","FileText","EcommerceBundle","pathname","useLocation","matchPath","_c"],"mappings":";;;;;;;;;AAEA,SAASA,GAAOC,GAAKC,GAAO;AAC1B,MAAI,OAAOD,KAAQ;AACjB,WAAOA,EAAIC,CAAK;AACX,EAAID,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,MAAeC,GAAM;AAC5B,SAAO,CAACC,MAAS;AACf,QAAIC,IAAa;AACjB,UAAMC,IAAWH,EAAK,IAAI,CAACH,MAAQ;AACjC,YAAMO,IAAUR,GAAOC,GAAKI,CAAI;AAChC,aAAI,CAACC,KAAc,OAAOE,KAAW,eACnCF,IAAa,KAERE;AAAA,IACT,CAAC;AACD,QAAIF;AACF,aAAO,MAAM;AACX,iBAASG,IAAI,GAAGA,IAAIF,EAAS,QAAQE,KAAK;AACxC,gBAAMD,IAAUD,EAASE,CAAC;AAC1B,UAAI,OAAOD,KAAW,aACpBA,EAAO,IAEPR,GAAOI,EAAKK,CAAC,GAAG,IAAI;AAAA,QAExB;AAAA,MACF;AAAA,EAEJ;AACF;AC5BA,IAAIC,KAAkB,OAAO,IAAI,YAAY,GACzCC,KAAM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EAAY,kBAAZ,gBAAAkjB,EAA2B;AAAA,MAC5C,YAAW9P,IAAA/U,EAAM,SAAN,gBAAA+U,EAAY;AAAA,MACvB,kBAAkB/U,EAAM;AAAA,MACxB,eAAeA,EAAM;AAAA,MACrB,cAAcA,EAAM;AAAA,MACpB,cAAc,MAAMA,EAAM,WAAW,OAAO;AAAA,MAC5C,gBAAgB,MAAMA,EAAM,WAAW,YAAY;AAAA,MACnD,OAAOA,EAAM;AAAA,MACb,sBAAsBA,EAAM;AAAA,MAC5B,YAAYA,EAAM;AAAA,MAClB,iBAAiBA,EAAM;AAAA,MACvB,UAAUA,EAAM;AAAA,MAChB,cAAcA,EAAM;AAAA,MACpB,QAAQA,EAAM;AAAA,IAAA;AAAA,EAAA,IAKtB4kB,GAAU,gBAAgBF,CAAQ,IAE9B,gBAAAhkB;AAAA,IAAC6iB;AAAA,IAAA;AAAA,MACG,qBAAqBvjB,EAAM;AAAA,MAC3B,YAAYA,EAAM;AAAA,MAClB,OAAOA,EAAM;AAAA,IAAA;AAAA,EAAA,IAKrB4kB,GAAU,eAAeF,CAAQ,sBAAWtG,IAAA,EAAa,IACzDwG,GAAU,cAAcF,CAAQ,sBAAW9F,IAAA,EAAY,IACvDgG,GAAU,cAAcF,CAAQ,IAAU,gBAAAhkB,EAACue,IAAA,EAAkB,UAAUjf,EAAM,YAAY,YAAY,cAAcA,EAAM,gBAAgB,wBAAwB,IACjK4kB,GAAU,YAAYF,CAAQ,IAAU,gBAAAhkB,EAAC0e,IAAA,EAAU,UAAUpf,EAAM,YAAY,YAAY,cAAcA,EAAM,gBAAgB,sBAAsB,IAElJ;AACX;","x_google_ignoreList":[0,1,2,3,9,10,16,17,19,20,21,22,23,24,25,26,27,28,29,37]} \ No newline at end of file +{"version":3,"file":"pm-ecommerce.es.js","sources":["../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/clsx/dist/clsx.mjs","../node_modules/class-variance-authority/dist/index.mjs","../src/lib/utils.ts","../src/components/ui/button.tsx","../src/cart/useCartStore.ts","../src/cart/CartItem.tsx","../src/components/ui/card.tsx","../node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.mjs","../node_modules/@radix-ui/react-separator/dist/index.mjs","../src/components/ui/separator.tsx","../src/policies/PolicyLinks.tsx","../src/cart/CartPage.tsx","../src/checkout/OrderSummary.tsx","../src/components/ui/input.tsx","../node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.mjs","../node_modules/@radix-ui/react-label/dist/index.mjs","../src/components/ui/label.tsx","../node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js","../node_modules/prop-types/node_modules/react-is/index.js","../node_modules/object-assign/index.js","../node_modules/prop-types/lib/ReactPropTypesSecret.js","../node_modules/prop-types/lib/has.js","../node_modules/prop-types/checkPropTypes.js","../node_modules/prop-types/factoryWithTypeCheckers.js","../node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/prop-types/index.js","../node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs","../src/checkout/StripePaymentForm.tsx","../src/checkout/CheckoutPage.tsx","../src/policies/PolicyPage.tsx","../src/policies/ShippingPage.tsx","../src/policies/ReturnsPage.tsx","../src/policies/PrivacyPolicyPage.tsx","../src/policies/TermsPage.tsx","../node_modules/@stripe/stripe-js/dist/pure.mjs","../src/checkout/CheckoutFlow.tsx","../src/components/ui/badge.tsx","../src/purchases/PurchasesList.tsx","../src/EcommerceBundle.tsx"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","import * as React from \"react\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst buttonVariants = cva(\r\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\r\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\r\n link: \"text-primary underline-offset-4 hover:underline\",\r\n },\r\n size: {\r\n default: \"h-10 px-4 py-2\",\r\n sm: \"h-9 rounded-md px-2\",\r\n lg: \"h-11 rounded-md px-4\",\r\n icon: \"h-10 w-10\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n size: \"default\",\r\n },\r\n },\r\n);\r\n\r\nexport interface ButtonProps\r\n extends React.ButtonHTMLAttributes,\r\n VariantProps {\r\n asChild?: boolean;\r\n}\r\n\r\nconst Button = React.forwardRef(\r\n ({ className, variant, size, asChild = false, ...props }, ref) => {\r\n const Comp = asChild ? Slot : \"button\";\r\n return ;\r\n },\r\n);\r\nButton.displayName = \"Button\";\r\n\r\nexport { Button, buttonVariants };\r\n","import { create } from \"zustand\";\r\nimport { persist } from \"zustand/middleware\";\r\nimport type { CartItem, CartState } from \"./types\";\r\n\r\n/** Recompute derived totals from items array. */\r\nfunction computeTotals(items: CartItem[]) {\r\n return {\r\n subtotal: items.reduce((sum, i) => sum + i.price * i.quantity, 0),\r\n itemCount: items.reduce((sum, i) => sum + i.quantity, 0),\r\n };\r\n}\r\n\r\n/**\r\n * Global cart store — persisted to localStorage.\r\n *\r\n * Usage:\r\n * ```tsx\r\n * const { items, addItem, subtotal } = useCartStore();\r\n * ```\r\n */\r\nexport const useCartStore = create()(\r\n persist(\r\n (set) => ({\r\n items: [],\r\n subtotal: 0,\r\n itemCount: 0,\r\n\r\n addItem: (incoming) =>\r\n set((state) => {\r\n const existing = state.items.find((i) => i.id === incoming.id);\r\n let items: CartItem[];\r\n if (existing) {\r\n items = state.items.map((i) =>\r\n i.id === incoming.id\r\n ? { ...i, quantity: i.quantity + (incoming.quantity ?? 1) }\r\n : i,\r\n );\r\n } else {\r\n items = [...state.items, { ...incoming, quantity: incoming.quantity ?? 1 }];\r\n }\r\n return { items, ...computeTotals(items) };\r\n }),\r\n\r\n removeItem: (id) =>\r\n set((state) => {\r\n const items = state.items.filter((i) => i.id !== id);\r\n return { items, ...computeTotals(items) };\r\n }),\r\n\r\n updateQuantity: (id, quantity) =>\r\n set((state) => {\r\n if (quantity <= 0) {\r\n const items = state.items.filter((i) => i.id !== id);\r\n return { items, ...computeTotals(items) };\r\n }\r\n const items = state.items.map((i) =>\r\n i.id === id ? { ...i, quantity } : i,\r\n );\r\n return { items, ...computeTotals(items) };\r\n }),\r\n\r\n clearCart: () => set({ items: [], subtotal: 0, itemCount: 0 }),\r\n }),\r\n {\r\n name: \"pm-ecommerce-cart\",\r\n },\r\n ),\r\n);\r\n","import React from \"react\";\r\nimport { Minus, Plus, Trash2 } from \"lucide-react\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { useCartStore } from \"./useCartStore\";\r\nimport type { CartItem as CartItemType } from \"./types\";\r\n\r\nexport interface CartItemProps {\r\n item: CartItemType;\r\n /** Optional extra class names for the root element. */\r\n className?: string;\r\n}\r\n\r\n/** A single cart row — thumbnail, title, quantity stepper, line total, remove. */\r\nexport function CartItemRow({ item, className }: CartItemProps) {\r\n const updateQuantity = useCartStore((s) => s.updateQuantity);\r\n const removeItem = useCartStore((s) => s.removeItem);\r\n\r\n const lineTotal = item.price * item.quantity;\r\n\r\n return (\r\n \r\n {/* Thumbnail */}\r\n {item.image ? (\r\n \r\n ) : (\r\n
\r\n No img\r\n
\r\n )}\r\n\r\n {/* Info */}\r\n
\r\n {item.title}\r\n {item.variant && (\r\n {item.variant}\r\n )}\r\n \r\n ${item.price.toFixed(2)} each\r\n \r\n {item.vendorSlug && (\r\n \r\n Sold by {item.vendorSlug}\r\n \r\n )}\r\n
\r\n\r\n {/* Quantity stepper */}\r\n
\r\n updateQuantity(item.id, item.quantity - 1)}\r\n aria-label=\"Decrease quantity\"\r\n >\r\n \r\n \r\n \r\n {item.quantity}\r\n \r\n updateQuantity(item.id, item.quantity + 1)}\r\n aria-label=\"Increase quantity\"\r\n >\r\n \r\n \r\n
\r\n\r\n {/* Line total */}\r\n \r\n ${lineTotal.toFixed(2)}\r\n \r\n\r\n {/* Remove */}\r\n removeItem(item.id)}\r\n aria-label={`Remove ${item.title}`}\r\n >\r\n \r\n \r\n

\r\n );\r\n}\r\n","import * as React from \"react\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst Card = React.forwardRef>(({ className, ...props }, ref) => (\r\n
\r\n));\r\nCard.displayName = \"Card\";\r\n\r\nconst CardHeader = React.forwardRef>(\r\n ({ className, ...props }, ref) => (\r\n
\r\n ),\r\n);\r\nCardHeader.displayName = \"CardHeader\";\r\n\r\nconst CardTitle = React.forwardRef>(\r\n ({ className, ...props }, ref) => (\r\n

\r\n ),\r\n);\r\nCardTitle.displayName = \"CardTitle\";\r\n\r\nconst CardDescription = React.forwardRef>(\r\n ({ className, ...props }, ref) => (\r\n

\r\n ),\r\n);\r\nCardDescription.displayName = \"CardDescription\";\r\n\r\nconst CardContent = React.forwardRef>(\r\n ({ className, ...props }, ref) =>

,\r\n);\r\nCardContent.displayName = \"CardContent\";\r\n\r\nconst CardFooter = React.forwardRef>(\r\n ({ className, ...props }, ref) => (\r\n
\r\n ),\r\n);\r\nCardFooter.displayName = \"CardFooter\";\r\n\r\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\r\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","// src/separator.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Separator\";\nvar DEFAULT_ORIENTATION = \"horizontal\";\nvar ORIENTATIONS = [\"horizontal\", \"vertical\"];\nvar Separator = React.forwardRef((props, forwardedRef) => {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n const ariaOrientation = orientation === \"vertical\" ? orientation : void 0;\n const semanticProps = decorative ? { role: \"none\" } : { \"aria-orientation\": ariaOrientation, role: \"separator\" };\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-orientation\": orientation,\n ...semanticProps,\n ...domProps,\n ref: forwardedRef\n }\n );\n});\nSeparator.displayName = NAME;\nfunction isValidOrientation(orientation) {\n return ORIENTATIONS.includes(orientation);\n}\nvar Root = Separator;\nexport {\n Root,\n Separator\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\r\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\r\n \r\n));\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\r\n\r\nexport { Separator };\r\n","import React from \"react\";\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nexport interface PolicyLink {\r\n label: string;\r\n href: string;\r\n}\r\n\r\nconst defaultLinks: PolicyLink[] = [\r\n { label: \"Returns & Refunds\", href: \"/returns\" },\r\n { label: \"Shipping\", href: \"/shipping\" },\r\n { label: \"Privacy Policy\", href: \"/privacy\" },\r\n { label: \"Terms of Service\", href: \"/terms\" },\r\n];\r\n\r\nexport interface PolicyLinksProps {\r\n links?: PolicyLink[];\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Small footer row of policy links for cart / checkout pages.\r\n */\r\nexport function PolicyLinks({ links = defaultLinks, className }: PolicyLinksProps) {\r\n return (\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { ShoppingCart, Trash2 } from \"lucide-react\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Card, CardContent, CardFooter, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { useCartStore } from \"./useCartStore\";\r\nimport { CartItemRow } from \"./CartItem\";\r\nimport { PolicyLinks } from \"@/policies/PolicyLinks\";\r\n\r\nexport interface CartPageProps {\r\n /** Called when user clicks \"Proceed to Checkout\". */\r\n onCheckout?: () => void;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Full cart page — shows items, subtotal, and a checkout CTA.\r\n * Renders an empty-state when the cart has no items.\r\n */\r\nexport function CartPage({ onCheckout, className }: CartPageProps) {\r\n const items = useCartStore((s) => s.items);\r\n const subtotal = useCartStore((s) => s.subtotal);\r\n const itemCount = useCartStore((s) => s.itemCount);\r\n const clearCart = useCartStore((s) => s.clearCart);\r\n\r\n /* ---------- Empty state ---------- */\r\n if (items.length === 0) {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n

Your cart is empty

\r\n

\r\n Add some products to get started.\r\n

\r\n
\r\n
\r\n );\r\n }\r\n\r\n /* ---------- Cart with items ---------- */\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n Cart\r\n \r\n ({itemCount} {itemCount === 1 ? \"item\" : \"items\"})\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n {items.map((item) => (\r\n \r\n ))}\r\n \r\n\r\n \r\n\r\n \r\n
\r\n Subtotal\r\n ${subtotal.toFixed(2)}\r\n
\r\n

\r\n Shipping and taxes calculated at checkout.\r\n

\r\n \r\n
\r\n
\r\n\r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { useCartStore } from \"@/cart/useCartStore\";\r\n\r\nexport interface OrderSummaryProps {\r\n /** Tax amount (pass 0 or leave undefined to show \"Calculated at next step\"). */\r\n tax?: number;\r\n /** Shipping cost (pass 0 or leave undefined to show \"Free\" / \"TBD\"). */\r\n shipping?: number;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Read-only order breakdown: line items, subtotal, tax, shipping, total.\r\n */\r\nexport function OrderSummary({ tax, shipping, className }: OrderSummaryProps) {\r\n const items = useCartStore((s) => s.items);\r\n const subtotal = useCartStore((s) => s.subtotal);\r\n\r\n const taxAmount = tax ?? 0;\r\n const shippingAmount = shipping ?? 0;\r\n const total = subtotal + taxAmount + shippingAmount;\r\n\r\n return (\r\n \r\n \r\n Order Summary\r\n \r\n\r\n \r\n {/* Line items */}\r\n
    \r\n {items.map((item) => (\r\n
  • \r\n
    \r\n \r\n {item.title} × {item.quantity}\r\n \r\n {item.vendorSlug && (\r\n \r\n via {item.vendorSlug}\r\n \r\n )}\r\n
    \r\n \r\n ${(item.price * item.quantity).toFixed(2)}\r\n \r\n
  • \r\n ))}\r\n
\r\n\r\n \r\n\r\n {/* Subtotal */}\r\n
\r\n Subtotal\r\n ${subtotal.toFixed(2)}\r\n
\r\n\r\n {/* Tax */}\r\n
\r\n Tax\r\n \r\n {tax !== undefined ? `$${taxAmount.toFixed(2)}` : \"Calculated at next step\"}\r\n \r\n
\r\n\r\n {/* Shipping */}\r\n
\r\n Shipping\r\n \r\n {shipping !== undefined\r\n ? shippingAmount === 0\r\n ? \"Free\"\r\n : `$${shippingAmount.toFixed(2)}`\r\n : \"TBD\"}\r\n \r\n
\r\n\r\n \r\n\r\n {/* Total */}\r\n
\r\n Total\r\n ${total.toFixed(2)}\r\n
\r\n
\r\n
\r\n );\r\n}\r\n","import * as React from \"react\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst Input = React.forwardRef>(\r\n ({ className, type, ...props }, ref) => {\r\n return (\r\n \r\n );\r\n },\r\n);\r\nInput.displayName = \"Input\";\r\n\r\nexport { Input };\r\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/label.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Label\";\nvar Label = React.forwardRef((props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.label,\n {\n ...props,\n ref: forwardedRef,\n onMouseDown: (event) => {\n const target = event.target;\n if (target.closest(\"button, input, select, textarea\")) return;\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }\n }\n );\n});\nLabel.displayName = NAME;\nvar Root = Label;\nexport {\n Label,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\r\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst labelVariants = cva(\r\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\r\n);\r\n\r\nconst Label = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef & VariantProps\r\n>(({ className, ...props }, ref) => (\r\n \r\n));\r\nLabel.displayName = LabelPrimitive.Root.displayName;\r\n\r\nexport { Label };\r\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","module.exports = Function.call.bind(Object.prototype.hasOwnProperty);\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactIs = require('react-is');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar has = require('./lib/has');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bigint: createPrimitiveTypeChecker('bigint'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message, data) {\n this.message = message;\n this.data = data && typeof data === 'object' ? data: {};\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),\n {expectedType: expectedType}\n );\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (process.env.NODE_ENV !== 'production') {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var expectedTypes = [];\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);\n if (checkerResult == null) {\n return null;\n }\n if (checkerResult.data && has(checkerResult.data, 'expectedType')) {\n expectedTypes.push(checkerResult.data.expectedType);\n }\n }\n var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function invalidValidatorError(componentName, location, propFullName, key, type) {\n return new PropTypeError(\n (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'\n );\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (has(shapeTypes, key) && typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]);\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar useAttachEvent = function useAttachEvent(element, event, cb) {\n var cbDefined = !!cb;\n var cbRef = React.useRef(cb); // In many integrations the callback prop changes on each render.\n // Using a ref saves us from calling element.on/.off every render.\n\n React.useEffect(function () {\n cbRef.current = cb;\n }, [cb]);\n React.useEffect(function () {\n if (!cbDefined || !element) {\n return function () {};\n }\n\n var decoratedCb = function decoratedCb() {\n if (cbRef.current) {\n cbRef.current.apply(cbRef, arguments);\n }\n };\n\n element.on(event, decoratedCb);\n return function () {\n element.off(event, decoratedCb);\n };\n }, [cbDefined, event, element, cbRef]);\n};\n\nvar usePrevious = function usePrevious(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n};\n\nvar isUnknownObject = function isUnknownObject(raw) {\n return raw !== null && _typeof(raw) === 'object';\n};\nvar isPromise = function isPromise(raw) {\n return isUnknownObject(raw) && typeof raw.then === 'function';\n}; // We are using types to enforce the `stripe` prop in this lib,\n// but in an untyped integration `stripe` could be anything, so we need\n// to do some sanity validation to prevent type errors.\n\nvar isStripe = function isStripe(raw) {\n return isUnknownObject(raw) && typeof raw.elements === 'function' && typeof raw.createToken === 'function' && typeof raw.createPaymentMethod === 'function' && typeof raw.confirmCardPayment === 'function';\n};\n\nvar PLAIN_OBJECT_STR = '[object Object]';\nvar isEqual = function isEqual(left, right) {\n if (!isUnknownObject(left) || !isUnknownObject(right)) {\n return left === right;\n }\n\n var leftArray = Array.isArray(left);\n var rightArray = Array.isArray(right);\n if (leftArray !== rightArray) return false;\n var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;\n var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;\n if (leftPlainObject !== rightPlainObject) return false; // not sure what sort of special object this is (regexp is one option), so\n // fallback to reference check.\n\n if (!leftPlainObject && !leftArray) return left === right;\n var leftKeys = Object.keys(left);\n var rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) return false;\n var keySet = {};\n\n for (var i = 0; i < leftKeys.length; i += 1) {\n keySet[leftKeys[i]] = true;\n }\n\n for (var _i = 0; _i < rightKeys.length; _i += 1) {\n keySet[rightKeys[_i]] = true;\n }\n\n var allKeys = Object.keys(keySet);\n\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n\n var l = left;\n var r = right;\n\n var pred = function pred(key) {\n return isEqual(l[key], r[key]);\n };\n\n return allKeys.every(pred);\n};\n\nvar extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates(options, prevOptions, immutableKeys) {\n if (!isUnknownObject(options)) {\n return null;\n }\n\n return Object.keys(options).reduce(function (newOptions, key) {\n var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);\n\n if (immutableKeys.includes(key)) {\n if (isUpdated) {\n console.warn(\"Unsupported prop change: options.\".concat(key, \" is not a mutable property.\"));\n }\n\n return newOptions;\n }\n\n if (!isUpdated) {\n return newOptions;\n }\n\n return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));\n }, null);\n};\n\nvar INVALID_STRIPE_ERROR$1 = 'Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.'; // We are using types to enforce the `stripe` prop in this lib, but in a real\n// integration `stripe` could be anything, so we need to do some sanity\n// validation to prevent type errors.\n\nvar validateStripe = function validateStripe(maybeStripe) {\n var errorMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INVALID_STRIPE_ERROR$1;\n\n if (maybeStripe === null || isStripe(maybeStripe)) {\n return maybeStripe;\n }\n\n throw new Error(errorMsg);\n};\n\nvar parseStripeProp = function parseStripeProp(raw) {\n var errorMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INVALID_STRIPE_ERROR$1;\n\n if (isPromise(raw)) {\n return {\n tag: 'async',\n stripePromise: Promise.resolve(raw).then(function (result) {\n return validateStripe(result, errorMsg);\n })\n };\n }\n\n var stripe = validateStripe(raw, errorMsg);\n\n if (stripe === null) {\n return {\n tag: 'empty'\n };\n }\n\n return {\n tag: 'sync',\n stripe: stripe\n };\n};\n\nvar registerWithStripeJs = function registerWithStripeJs(stripe) {\n if (!stripe || !stripe._registerWrapper || !stripe.registerAppInfo) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'react-stripe-js',\n version: \"5.6.0\"\n });\n\n stripe.registerAppInfo({\n name: 'react-stripe-js',\n version: \"5.6.0\",\n url: 'https://stripe.com/docs/stripe-js/react'\n });\n};\n\nvar ElementsContext = /*#__PURE__*/React.createContext(null);\nElementsContext.displayName = 'ElementsContext';\nvar parseElementsContext = function parseElementsContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an provider.\"));\n }\n\n return ctx;\n};\n/**\n * The `Elements` provider allows you to use [Element components](https://stripe.com/docs/stripe-js/react#element-components) and access the [Stripe object](https://stripe.com/docs/js/initializing) in any nested component.\n * Render an `Elements` provider at the root of your React app so that it is available everywhere you need it.\n *\n * To use the `Elements` provider, call `loadStripe` from `@stripe/stripe-js` with your publishable key.\n * The `loadStripe` function will asynchronously load the Stripe.js script and initialize a `Stripe` object.\n * Pass the returned `Promise` to `Elements`.\n *\n * @docs https://docs.stripe.com/sdks/stripejs-react?ui=elements#elements-provider\n */\n\nvar Elements = function Elements(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]); // For a sync stripe instance, initialize into context\n\n var _React$useState = React.useState(function () {\n return {\n stripe: parsed.tag === 'sync' ? parsed.stripe : null,\n elements: parsed.tag === 'sync' ? parsed.stripe.elements(options) : null\n };\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ctx = _React$useState2[0],\n setContext = _React$useState2[1];\n\n React.useEffect(function () {\n var isMounted = true;\n\n var safeSetContext = function safeSetContext(stripe) {\n setContext(function (ctx) {\n // no-op if we already have a stripe instance (https://github.com/stripe/react-stripe-js/issues/296)\n if (ctx.stripe) return ctx;\n return {\n stripe: stripe,\n elements: stripe.elements(options)\n };\n });\n }; // For an async stripePromise, store it in context once resolved\n\n\n if (parsed.tag === 'async' && !ctx.stripe) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe && isMounted) {\n // Only update Elements context if the component is still mounted\n // and stripe is not null. We allow stripe to be null to make\n // handling SSR easier.\n safeSetContext(stripe);\n }\n });\n } else if (parsed.tag === 'sync' && !ctx.stripe) {\n // Or, handle a sync stripe instance going from null -> populated\n safeSetContext(parsed.stripe);\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed, ctx, options]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!ctx.elements) {\n return;\n }\n\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['clientSecret', 'fonts']);\n\n if (updates) {\n ctx.elements.update(updates);\n }\n }, [options, prevOptions, ctx.elements]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(ctx.stripe);\n }, [ctx.stripe]);\n return /*#__PURE__*/React.createElement(ElementsContext.Provider, {\n value: ctx\n }, children);\n};\nElements.propTypes = {\n stripe: PropTypes.any,\n options: PropTypes.object\n};\nvar useElementsContextWithUseCase = function useElementsContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(ElementsContext);\n return parseElementsContext(ctx, useCaseMessage);\n};\n/**\n * @docs https://stripe.com/docs/stripe-js/react#useelements-hook\n */\n\nvar useElements = function useElements() {\n var _useElementsContextWi = useElementsContextWithUseCase('calls useElements()'),\n elements = _useElementsContextWi.elements;\n\n return elements;\n};\n/**\n * @docs https://stripe.com/docs/stripe-js/react#elements-consumer\n */\n\nvar ElementsConsumer = function ElementsConsumer(_ref2) {\n var children = _ref2.children;\n var ctx = useElementsContextWithUseCase('mounts '); // Assert to satisfy the busted React.FC return type (it should be ReactNode)\n\n return children(ctx);\n};\nElementsConsumer.propTypes = {\n children: PropTypes.func.isRequired\n};\n\nvar CheckoutContext = /*#__PURE__*/React.createContext(null);\nCheckoutContext.displayName = 'CheckoutContext';\n({\n stripe: PropTypes.any,\n options: PropTypes.shape({\n clientSecret: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Promise)]).isRequired,\n elementsOptions: PropTypes.object\n }).isRequired\n});\nvar useElementsOrCheckoutContextWithUseCase = function useElementsOrCheckoutContextWithUseCase(useCaseString) {\n var checkout = React.useContext(CheckoutContext);\n var elements = React.useContext(ElementsContext);\n\n if (checkout) {\n if (elements) {\n throw new Error(\"You cannot wrap the part of your app that \".concat(useCaseString, \" in both and providers.\"));\n } else {\n return checkout;\n }\n } else {\n return parseElementsContext(elements, useCaseString);\n }\n};\n\nvar _excluded = [\"mode\"];\n\nvar capitalized = function capitalized(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\nvar createElementComponent = function createElementComponent(type, isServer) {\n var displayName = \"\".concat(capitalized(type), \"Element\");\n\n var ClientElement = function ClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n onBlur = _ref.onBlur,\n onFocus = _ref.onFocus,\n onReady = _ref.onReady,\n onChange = _ref.onChange,\n onEscape = _ref.onEscape,\n onClick = _ref.onClick,\n onLoadError = _ref.onLoadError,\n onLoaderStart = _ref.onLoaderStart,\n onNetworksChange = _ref.onNetworksChange,\n onConfirm = _ref.onConfirm,\n onCancel = _ref.onCancel,\n onShippingAddressChange = _ref.onShippingAddressChange,\n onShippingRateChange = _ref.onShippingRateChange,\n onSavedPaymentMethodRemove = _ref.onSavedPaymentMethodRemove,\n onSavedPaymentMethodUpdate = _ref.onSavedPaymentMethodUpdate;\n var ctx = useElementsOrCheckoutContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var elements = 'elements' in ctx ? ctx.elements : null;\n var checkoutState = 'checkoutState' in ctx ? ctx.checkoutState : null;\n var checkoutSdk = (checkoutState === null || checkoutState === void 0 ? void 0 : checkoutState.type) === 'success' || (checkoutState === null || checkoutState === void 0 ? void 0 : checkoutState.type) === 'loading' ? checkoutState.sdk : null;\n\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n element = _React$useState2[0],\n setElement = _React$useState2[1];\n\n var elementRef = React.useRef(null);\n var domNode = React.useRef(null); // For every event where the merchant provides a callback, call element.on\n // with that callback. If the merchant ever changes the callback, removes\n // the old callback with element.off and then call element.on with the new one.\n\n useAttachEvent(element, 'blur', onBlur);\n useAttachEvent(element, 'focus', onFocus);\n useAttachEvent(element, 'escape', onEscape);\n useAttachEvent(element, 'click', onClick);\n useAttachEvent(element, 'loaderror', onLoadError);\n useAttachEvent(element, 'loaderstart', onLoaderStart);\n useAttachEvent(element, 'networkschange', onNetworksChange);\n useAttachEvent(element, 'confirm', onConfirm);\n useAttachEvent(element, 'cancel', onCancel);\n useAttachEvent(element, 'shippingaddresschange', onShippingAddressChange);\n useAttachEvent(element, 'shippingratechange', onShippingRateChange);\n useAttachEvent(element, 'savedpaymentmethodremove', onSavedPaymentMethodRemove);\n useAttachEvent(element, 'savedpaymentmethodupdate', onSavedPaymentMethodUpdate);\n useAttachEvent(element, 'change', onChange);\n var readyCallback;\n\n if (onReady) {\n if (type === 'expressCheckout') {\n // Passes through the event, which includes visible PM types\n readyCallback = onReady;\n } else {\n // For other Elements, pass through the Element itself.\n readyCallback = function readyCallback() {\n onReady(element);\n };\n }\n }\n\n useAttachEvent(element, 'ready', readyCallback);\n React.useLayoutEffect(function () {\n if (elementRef.current === null && domNode.current !== null && (elements || checkoutSdk)) {\n var newElement = null;\n\n if (checkoutSdk) {\n switch (type) {\n case 'paymentForm':\n newElement = checkoutSdk.createPaymentFormElement(options);\n break;\n\n case 'payment':\n newElement = checkoutSdk.createPaymentElement(options);\n break;\n\n case 'address':\n if ('mode' in options) {\n var mode = options.mode,\n restOptions = _objectWithoutProperties(options, _excluded);\n\n if (mode === 'shipping') {\n newElement = checkoutSdk.createShippingAddressElement(restOptions);\n } else if (mode === 'billing') {\n newElement = checkoutSdk.createBillingAddressElement(restOptions);\n } else {\n throw new Error(\"Invalid options.mode. mode must be 'billing' or 'shipping'.\");\n }\n } else {\n throw new Error(\"You must supply options.mode. mode must be 'billing' or 'shipping'.\");\n }\n\n break;\n\n case 'expressCheckout':\n newElement = checkoutSdk.createExpressCheckoutElement(options);\n break;\n\n case 'currencySelector':\n newElement = checkoutSdk.createCurrencySelectorElement();\n break;\n\n case 'taxId':\n newElement = checkoutSdk.createTaxIdElement(options);\n break;\n\n default:\n throw new Error(\"Invalid Element type \".concat(displayName, \". You must use either the , , , or .\"));\n }\n } else if (elements) {\n newElement = elements.create(type, options);\n } // Store element in a ref to ensure it's _immediately_ available in cleanup hooks in StrictMode\n\n\n elementRef.current = newElement; // Store element in state to facilitate event listener attachment\n\n setElement(newElement);\n\n if (newElement) {\n newElement.mount(domNode.current);\n }\n }\n }, [elements, checkoutSdk, options]);\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!elementRef.current) {\n return;\n }\n\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['paymentRequest']);\n\n if (updates && 'update' in elementRef.current) {\n elementRef.current.update(updates);\n }\n }, [options, prevOptions]);\n React.useLayoutEffect(function () {\n return function () {\n if (elementRef.current && typeof elementRef.current.destroy === 'function') {\n try {\n elementRef.current.destroy();\n elementRef.current = null;\n } catch (error) {// Do nothing\n }\n }\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className,\n ref: domNode\n });\n }; // Only render the Element wrapper in a server environment.\n\n\n var ServerElement = function ServerElement(props) {\n useElementsOrCheckoutContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var id = props.id,\n className = props.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n };\n\n var Element = isServer ? ServerElement : ClientElement;\n Element.propTypes = {\n id: PropTypes.string,\n className: PropTypes.string,\n onChange: PropTypes.func,\n onBlur: PropTypes.func,\n onFocus: PropTypes.func,\n onReady: PropTypes.func,\n onEscape: PropTypes.func,\n onClick: PropTypes.func,\n onLoadError: PropTypes.func,\n onLoaderStart: PropTypes.func,\n onNetworksChange: PropTypes.func,\n onConfirm: PropTypes.func,\n onCancel: PropTypes.func,\n onShippingAddressChange: PropTypes.func,\n onShippingRateChange: PropTypes.func,\n onSavedPaymentMethodRemove: PropTypes.func,\n onSavedPaymentMethodUpdate: PropTypes.func,\n options: PropTypes.object\n };\n Element.displayName = displayName;\n Element.__elementType = type;\n return Element;\n};\n\nvar isServer = typeof window === 'undefined';\n\nvar EmbeddedCheckoutContext = /*#__PURE__*/React.createContext(null);\nEmbeddedCheckoutContext.displayName = 'EmbeddedCheckoutProviderContext';\nvar useEmbeddedCheckoutContext = function useEmbeddedCheckoutContext() {\n var ctx = React.useContext(EmbeddedCheckoutContext);\n\n if (!ctx) {\n throw new Error(' must be used within ');\n }\n\n return ctx;\n};\nvar INVALID_STRIPE_ERROR = 'Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.';\nvar EmbeddedCheckoutProvider = function EmbeddedCheckoutProvider(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp, INVALID_STRIPE_ERROR);\n }, [rawStripeProp]);\n var embeddedCheckoutPromise = React.useRef(null);\n var loadedStripe = React.useRef(null);\n\n var _React$useState = React.useState({\n embeddedCheckout: null\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ctx = _React$useState2[0],\n setContext = _React$useState2[1];\n\n React.useEffect(function () {\n // Don't support any ctx updates once embeddedCheckout or stripe is set.\n if (loadedStripe.current || embeddedCheckoutPromise.current) {\n return;\n }\n\n var setStripeAndInitEmbeddedCheckout = function setStripeAndInitEmbeddedCheckout(stripe) {\n if (loadedStripe.current || embeddedCheckoutPromise.current) return;\n loadedStripe.current = stripe;\n embeddedCheckoutPromise.current = loadedStripe.current.initEmbeddedCheckout(options).then(function (embeddedCheckout) {\n setContext({\n embeddedCheckout: embeddedCheckout\n });\n });\n }; // For an async stripePromise, store it once resolved\n\n\n if (parsed.tag === 'async' && !loadedStripe.current && (options.clientSecret || options.fetchClientSecret)) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe) {\n setStripeAndInitEmbeddedCheckout(stripe);\n }\n });\n } else if (parsed.tag === 'sync' && !loadedStripe.current && (options.clientSecret || options.fetchClientSecret)) {\n // Or, handle a sync stripe instance going from null -> populated\n setStripeAndInitEmbeddedCheckout(parsed.stripe);\n }\n }, [parsed, options, ctx, loadedStripe]);\n React.useEffect(function () {\n // cleanup on unmount\n return function () {\n // If embedded checkout is fully initialized, destroy it.\n if (ctx.embeddedCheckout) {\n embeddedCheckoutPromise.current = null;\n ctx.embeddedCheckout.destroy();\n } else if (embeddedCheckoutPromise.current) {\n // If embedded checkout is still initializing, destroy it once\n // it's done. This could be caused by unmounting very quickly\n // after mounting.\n embeddedCheckoutPromise.current.then(function () {\n embeddedCheckoutPromise.current = null;\n\n if (ctx.embeddedCheckout) {\n ctx.embeddedCheckout.destroy();\n }\n });\n }\n };\n }, [ctx.embeddedCheckout]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(loadedStripe);\n }, [loadedStripe]); // Warn on changes to stripe prop.\n // The stripe prop value can only go from null to non-null once and\n // can't be changed after that.\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Warn on changes to options.\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (prevOptions == null) {\n return;\n }\n\n if (options == null) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.');\n return;\n }\n\n if (options.clientSecret === undefined && options.fetchClientSecret === undefined) {\n console.warn('Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`.');\n }\n\n if (prevOptions.clientSecret != null && options.clientSecret !== prevOptions.clientSecret) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead.');\n }\n\n if (prevOptions.fetchClientSecret != null && options.fetchClientSecret !== prevOptions.fetchClientSecret) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead.');\n }\n\n if (prevOptions.onComplete != null && options.onComplete !== prevOptions.onComplete) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it.');\n }\n\n if (prevOptions.onShippingDetailsChange != null && options.onShippingDetailsChange !== prevOptions.onShippingDetailsChange) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it.');\n }\n\n if (prevOptions.onLineItemsChange != null && options.onLineItemsChange !== prevOptions.onLineItemsChange) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.');\n }\n }, [prevOptions, options]);\n return /*#__PURE__*/React.createElement(EmbeddedCheckoutContext.Provider, {\n value: ctx\n }, children);\n};\n\nvar EmbeddedCheckoutClientElement = function EmbeddedCheckoutClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className;\n\n var _useEmbeddedCheckoutC = useEmbeddedCheckoutContext(),\n embeddedCheckout = _useEmbeddedCheckoutC.embeddedCheckout;\n\n var isMounted = React.useRef(false);\n var domNode = React.useRef(null);\n React.useLayoutEffect(function () {\n if (!isMounted.current && embeddedCheckout && domNode.current !== null) {\n embeddedCheckout.mount(domNode.current);\n isMounted.current = true;\n } // Clean up on unmount\n\n\n return function () {\n if (isMounted.current && embeddedCheckout) {\n try {\n embeddedCheckout.unmount();\n isMounted.current = false;\n } catch (e) {// Do nothing.\n // Parent effects are destroyed before child effects, so\n // in cases where both the EmbeddedCheckoutProvider and\n // the EmbeddedCheckout component are removed at the same\n // time, the embeddedCheckout instance will be destroyed,\n // which causes an error when calling unmount.\n }\n }\n };\n }, [embeddedCheckout]);\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: domNode,\n id: id,\n className: className\n });\n}; // Only render the wrapper in a server environment.\n\n\nvar EmbeddedCheckoutServerElement = function EmbeddedCheckoutServerElement(_ref2) {\n var id = _ref2.id,\n className = _ref2.className;\n // Validate that we are in the right context by calling useEmbeddedCheckoutContext.\n useEmbeddedCheckoutContext();\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n};\n\nvar EmbeddedCheckout = isServer ? EmbeddedCheckoutServerElement : EmbeddedCheckoutClientElement;\n\nvar FinancialAccountDisclosure = function FinancialAccountDisclosure(_ref) {\n var rawStripeProp = _ref.stripe,\n onLoad = _ref.onLoad,\n onError = _ref.onError,\n options = _ref.options;\n var businessName = options === null || options === void 0 ? void 0 : options.businessName;\n var learnMoreLink = options === null || options === void 0 ? void 0 : options.learnMoreLink;\n var containerRef = React.useRef(null);\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]);\n\n var _React$useState = React.useState(parsed.tag === 'sync' ? parsed.stripe : null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n stripeState = _React$useState2[0],\n setStripeState = _React$useState2[1];\n\n React.useEffect(function () {\n var isMounted = true;\n\n if (parsed.tag === 'async') {\n parsed.stripePromise.then(function (stripePromise) {\n if (stripePromise && isMounted) {\n setStripeState(stripePromise);\n }\n });\n } else if (parsed.tag === 'sync') {\n setStripeState(parsed.stripe);\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on FinancialAccountDisclosure: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(stripeState);\n }, [stripeState]);\n React.useEffect(function () {\n var createDisclosure = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _yield$stripeState$cr, disclosureContent, error, container;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(!stripeState || !containerRef.current)) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 2:\n _context.next = 4;\n return stripeState.createFinancialAccountDisclosure({\n businessName: businessName,\n learnMoreLink: learnMoreLink\n });\n\n case 4:\n _yield$stripeState$cr = _context.sent;\n disclosureContent = _yield$stripeState$cr.htmlElement;\n error = _yield$stripeState$cr.error;\n\n if (error && onError) {\n onError(error);\n } else if (disclosureContent) {\n container = containerRef.current;\n container.innerHTML = '';\n container.appendChild(disclosureContent);\n\n if (onLoad) {\n onLoad();\n }\n }\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function createDisclosure() {\n return _ref2.apply(this, arguments);\n };\n }();\n\n createDisclosure();\n }, [stripeState, businessName, learnMoreLink, onLoad, onError]);\n return /*#__PURE__*/React.createElement('div', {\n ref: containerRef\n });\n};\n\nvar IssuingDisclosure = function IssuingDisclosure(_ref) {\n var rawStripeProp = _ref.stripe,\n onLoad = _ref.onLoad,\n onError = _ref.onError,\n options = _ref.options;\n var issuingProgramID = options === null || options === void 0 ? void 0 : options.issuingProgramID;\n var publicCardProgramName = options === null || options === void 0 ? void 0 : options.publicCardProgramName;\n var learnMoreLink = options === null || options === void 0 ? void 0 : options.learnMoreLink;\n var containerRef = React.useRef(null);\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]);\n\n var _React$useState = React.useState(parsed.tag === 'sync' ? parsed.stripe : null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n stripeState = _React$useState2[0],\n setStripeState = _React$useState2[1];\n\n React.useEffect(function () {\n var isMounted = true;\n\n if (parsed.tag === 'async') {\n parsed.stripePromise.then(function (stripePromise) {\n if (stripePromise && isMounted) {\n setStripeState(stripePromise);\n }\n });\n } else if (parsed.tag === 'sync') {\n setStripeState(parsed.stripe);\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on IssuingDisclosure: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(stripeState);\n }, [stripeState]);\n React.useEffect(function () {\n var createDisclosure = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _yield$stripeState$cr, disclosureContent, error, container;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(!stripeState || !containerRef.current)) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 2:\n _context.next = 4;\n return stripeState.createIssuingDisclosure({\n issuingProgramID: issuingProgramID,\n publicCardProgramName: publicCardProgramName,\n learnMoreLink: learnMoreLink\n });\n\n case 4:\n _yield$stripeState$cr = _context.sent;\n disclosureContent = _yield$stripeState$cr.htmlElement;\n error = _yield$stripeState$cr.error;\n\n if (error && onError) {\n onError(error);\n } else if (disclosureContent) {\n container = containerRef.current;\n container.innerHTML = '';\n container.appendChild(disclosureContent);\n\n if (onLoad) {\n onLoad();\n }\n }\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function createDisclosure() {\n return _ref2.apply(this, arguments);\n };\n }();\n\n createDisclosure();\n }, [stripeState, issuingProgramID, publicCardProgramName, learnMoreLink, onLoad, onError]);\n return /*#__PURE__*/React.createElement('div', {\n ref: containerRef\n });\n};\n\n/**\n * @docs https://stripe.com/docs/stripe-js/react#usestripe-hook\n */\n\nvar useStripe = function useStripe() {\n var _useElementsOrCheckou = useElementsOrCheckoutContextWithUseCase('calls useStripe()'),\n stripe = _useElementsOrCheckou.stripe;\n\n return stripe;\n};\n\n/**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar AuBankAccountElement = createElementComponent('auBankAccount', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardElement = createElementComponent('card', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardNumberElement = createElementComponent('cardNumber', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardExpiryElement = createElementComponent('cardExpiry', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardCvcElement = createElementComponent('cardCvc', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar IbanElement = createElementComponent('iban', isServer);\nvar PaymentElement = createElementComponent('payment', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar ExpressCheckoutElement = createElementComponent('expressCheckout', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar LinkAuthenticationElement = createElementComponent('linkAuthentication', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar AddressElement = createElementComponent('address', isServer);\n/**\n * @deprecated\n * Use `AddressElement` instead.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar ShippingAddressElement = createElementComponent('shippingAddress', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar PaymentMethodMessagingElement = createElementComponent('paymentMethodMessaging', isServer);\n/**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n */\n\nvar TaxIdElement = createElementComponent('taxId', isServer);\n\nexport { AddressElement, AuBankAccountElement, CardCvcElement, CardElement, CardExpiryElement, CardNumberElement, Elements, ElementsConsumer, EmbeddedCheckout, EmbeddedCheckoutProvider, ExpressCheckoutElement, FinancialAccountDisclosure, IbanElement, IssuingDisclosure, LinkAuthenticationElement, PaymentElement, PaymentMethodMessagingElement, PaymentRequestButtonElement, ShippingAddressElement, TaxIdElement, useElements, useStripe };\n","import React, { useState } from \"react\";\r\nimport {\r\n PaymentElement,\r\n LinkAuthenticationElement,\r\n AddressElement,\r\n useStripe,\r\n useElements,\r\n} from \"@stripe/react-stripe-js\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Loader2 } from \"lucide-react\";\r\n\r\nexport interface StripePaymentFormProps {\r\n /** Called after Stripe confirms payment — receives the PaymentIntent data. */\r\n onPaymentSuccess?: (paymentIntent: { id: string; status: string;[key: string]: any }) => void;\r\n /** Return URL after redirect-based payment methods (iDEAL, etc.). */\r\n returnUrl?: string;\r\n /** Pre-fill the email field. */\r\n defaultEmail?: string;\r\n /** Pre-fill the name field in billing details. */\r\n defaultName?: string;\r\n}\r\n\r\n/*\r\n\r\n*/\r\n\r\n/**\r\n * Embedded Stripe payment form using PaymentElement.\r\n * Must be rendered inside a Stripe `` provider.\r\n */\r\nexport function StripePaymentForm({\r\n onPaymentSuccess,\r\n returnUrl,\r\n defaultEmail,\r\n defaultName,\r\n}: StripePaymentFormProps) {\r\n const stripe = useStripe();\r\n const elements = useElements();\r\n const [message, setMessage] = useState(null);\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n const handleSubmit = async () => {\r\n if (!stripe || !elements) return;\r\n\r\n setIsLoading(true);\r\n setMessage(null);\r\n\r\n const { error, paymentIntent } = await stripe.confirmPayment({\r\n elements,\r\n confirmParams: {\r\n return_url: returnUrl ?? `${window.location.origin}/completion`,\r\n },\r\n redirect: \"if_required\",\r\n });\r\n\r\n if (error) {\r\n if (error.type === \"card_error\" || error.type === \"validation_error\") {\r\n setMessage(error.message ?? \"Payment failed.\");\r\n } else {\r\n setMessage(\"An unexpected error occurred.\");\r\n }\r\n } else if (paymentIntent) {\r\n // Payment succeeded without redirect\r\n onPaymentSuccess?.({\r\n id: paymentIntent.id,\r\n status: paymentIntent.status,\r\n });\r\n }\r\n\r\n setIsLoading(false);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n\r\n \r\n {isLoading ? (\r\n <>\r\n \r\n Processing…\r\n \r\n ) : (\r\n \"Pay now\"\r\n )}\r\n \r\n\r\n {message && (\r\n

{message}

\r\n )}\r\n
\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport { CreditCard, Bitcoin, ShoppingBag, MapPin, Save } from \"lucide-react\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Input } from \"@/components/ui/input\";\r\nimport { Label } from \"@/components/ui/label\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { useCartStore } from \"@/cart/useCartStore\";\r\nimport { OrderSummary } from \"./OrderSummary\";\r\nimport { PolicyLinks } from \"@/policies/PolicyLinks\";\r\nimport { StripePaymentForm } from \"./StripePaymentForm\";\r\nimport { Elements } from \"@stripe/react-stripe-js\";\r\nimport type { Stripe as StripeJS } from \"@stripe/stripe-js\";\r\n\r\n/** Shipping address fields collected at checkout. */\r\nexport interface ShippingAddress {\r\n fullName: string;\r\n email: string;\r\n address: string;\r\n city: string;\r\n zip: string;\r\n country: string;\r\n}\r\n\r\n/** A saved address with extra metadata (matches pm-pics SavedShippingAddress). */\r\nexport interface SavedAddress extends ShippingAddress {\r\n id: string;\r\n label?: string;\r\n isDefault?: boolean;\r\n phone?: string;\r\n note?: string;\r\n}\r\n\r\nexport type PaymentMethod = \"shopify\" | \"crypto\" | \"stripe\";\r\n\r\nexport interface CheckoutPageProps {\r\n /** Called when user submits the checkout form. */\r\n onPlaceOrder?: (data: {\r\n shipping: ShippingAddress;\r\n paymentMethod: PaymentMethod;\r\n }) => void;\r\n /** Called when user wants to save the entered address to their profile. */\r\n onSaveAddress?: (address: ShippingAddress) => void;\r\n /** Called when user clicks \"Back to Cart\". */\r\n onBackToCart?: () => void;\r\n /** Pre-fill shipping form fields (e.g. from user profile). */\r\n initialShipping?: Partial;\r\n /** Saved shipping addresses — enables address selector. */\r\n savedAddresses?: SavedAddress[];\r\n /** Pre-filled tax amount, if known. */\r\n tax?: number;\r\n /** Pre-filled shipping cost. */\r\n shipping?: number;\r\n /** Stripe.js promise (from loadStripe). */\r\n stripePromise?: Promise | null;\r\n /** Stripe PaymentIntent client secret. */\r\n stripeClientSecret?: string | null;\r\n /** Called after Stripe payment succeeds — includes shipping data and PaymentIntent. */\r\n onStripePaymentSuccess?: (data: {\r\n shipping: ShippingAddress;\r\n paymentMethod: PaymentMethod;\r\n paymentIntent: { id: string; status: string;[key: string]: any };\r\n }) => void;\r\n /** Stripe return URL for redirect-based payment methods. */\r\n stripeReturnUrl?: string;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Checkout page — two-column layout with shipping form + payment selector on\r\n * the left and an OrderSummary on the right.\r\n */\r\nexport function CheckoutPage({\r\n onPlaceOrder,\r\n onSaveAddress,\r\n onBackToCart,\r\n initialShipping,\r\n savedAddresses,\r\n tax,\r\n shipping,\r\n stripePromise,\r\n stripeClientSecret,\r\n onStripePaymentSuccess,\r\n stripeReturnUrl,\r\n className,\r\n}: CheckoutPageProps) {\r\n const itemCount = useCartStore((s) => s.itemCount);\r\n\r\n const [paymentMethod, setPaymentMethod] = useState(\"shopify\");\r\n const [saveAddress, setSaveAddress] = useState(false);\r\n\r\n // Find default address or first address from savedAddresses\r\n const defaultAddress = savedAddresses?.find((a) => a.isDefault) ?? savedAddresses?.[0];\r\n\r\n // Determine initial form values: saved default > initialShipping > empty\r\n const resolveInitial = (): ShippingAddress => ({\r\n fullName: defaultAddress?.fullName ?? initialShipping?.fullName ?? \"\",\r\n email: defaultAddress?.email ?? initialShipping?.email ?? \"\",\r\n address: defaultAddress?.address ?? initialShipping?.address ?? \"\",\r\n city: defaultAddress?.city ?? initialShipping?.city ?? \"\",\r\n zip: defaultAddress?.zip ?? initialShipping?.zip ?? \"\",\r\n country: defaultAddress?.country ?? initialShipping?.country ?? \"\",\r\n });\r\n\r\n const [form, setForm] = useState(resolveInitial);\r\n const [selectedAddressId, setSelectedAddressId] = useState(\r\n defaultAddress?.id ?? \"custom\"\r\n );\r\n\r\n // Sync form when a saved address is selected\r\n const selectAddress = (id: string) => {\r\n setSelectedAddressId(id);\r\n if (id === \"custom\") return;\r\n const addr = savedAddresses?.find((a) => a.id === id);\r\n if (addr) {\r\n setForm({\r\n fullName: addr.fullName,\r\n email: addr.email,\r\n address: addr.address,\r\n city: addr.city,\r\n zip: addr.zip,\r\n country: addr.country,\r\n });\r\n }\r\n };\r\n\r\n const field = (key: keyof ShippingAddress, value: string) =>\r\n setForm((prev) => ({ ...prev, [key]: value }));\r\n\r\n const handleSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n if (saveAddress && selectedAddressId === \"custom\" && onSaveAddress) {\r\n onSaveAddress(form);\r\n }\r\n onPlaceOrder?.({ shipping: form, paymentMethod });\r\n };\r\n\r\n /* ---- Empty cart guard ---- */\r\n if (itemCount === 0) {\r\n return (\r\n
\r\n \r\n

Your cart is empty — nothing to check out.

\r\n {onBackToCart && (\r\n \r\n )}\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n \r\n {/* ---- Left: Shipping + Payment ---- */}\r\n
\r\n {/* Shipping */}\r\n \r\n \r\n Shipping Information\r\n \r\n \r\n {/* Saved Address Selector */}\r\n {savedAddresses && savedAddresses.length > 0 && (\r\n
\r\n \r\n
\r\n {savedAddresses.map((addr) => (\r\n selectAddress(addr.id)}\r\n className={cn(\r\n \"flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors text-sm\",\r\n selectedAddressId === addr.id\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n \r\n
\r\n

\r\n {addr.label || addr.fullName}\r\n {addr.isDefault && (\r\n (Default)\r\n )}\r\n

\r\n

\r\n {addr.address}, {addr.city}, {addr.country}\r\n

\r\n
\r\n \r\n ))}\r\n selectAddress(\"custom\")}\r\n className={cn(\r\n \"flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors text-sm\",\r\n selectedAddressId === \"custom\"\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n ✏️\r\n Enter a new address\r\n \r\n
\r\n
\r\n )}\r\n\r\n {/* Form Fields */}\r\n
\r\n
\r\n \r\n field(\"fullName\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"email\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"address\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"city\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"zip\", e.target.value)}\r\n />\r\n
\r\n\r\n
\r\n \r\n field(\"country\", e.target.value)}\r\n />\r\n
\r\n\r\n {selectedAddressId === \"custom\" && onSaveAddress && (\r\n
\r\n setSaveAddress(e.target.checked)}\r\n className=\"h-4 w-4 rounded border-gray-300 accent-primary\"\r\n />\r\n \r\n
\r\n )}\r\n
\r\n
\r\n
\r\n\r\n {/* Payment Method */}\r\n \r\n \r\n Payment Method\r\n \r\n \r\n setPaymentMethod(\"shopify\")}\r\n className={cn(\r\n \"flex w-full items-center gap-3 rounded-lg border p-4 text-left transition-colors\",\r\n paymentMethod === \"shopify\"\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n \r\n
\r\n

Shopify Checkout

\r\n

\r\n Credit / debit card via Shopify\r\n

\r\n
\r\n \r\n\r\n setPaymentMethod(\"crypto\")}\r\n className={cn(\r\n \"flex w-full items-center gap-3 rounded-lg border p-4 text-left transition-colors\",\r\n paymentMethod === \"crypto\"\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n \r\n
\r\n

Crypto Payment

\r\n

\r\n Bitcoin, Ethereum, and more\r\n

\r\n
\r\n \r\n\r\n setPaymentMethod(\"stripe\")}\r\n className={cn(\r\n \"flex w-full items-center gap-3 rounded-lg border p-4 text-left transition-colors\",\r\n paymentMethod === \"stripe\"\r\n ? \"border-primary bg-primary/5\"\r\n : \"border-border hover:bg-accent/5\",\r\n )}\r\n >\r\n \r\n
\r\n

Stripe

\r\n

\r\n Credit / debit card, Apple Pay, Google Pay\r\n

\r\n
\r\n \r\n\r\n {/* Inline Stripe Payment Form */}\r\n {paymentMethod === \"stripe\" && stripePromise && stripeClientSecret && (\r\n
\r\n \r\n {\r\n if (saveAddress && selectedAddressId === \"custom\" && onSaveAddress) {\r\n onSaveAddress(form);\r\n }\r\n onStripePaymentSuccess?.({\r\n shipping: form,\r\n paymentMethod: \"stripe\",\r\n paymentIntent,\r\n });\r\n }}\r\n returnUrl={stripeReturnUrl}\r\n defaultEmail={form.email}\r\n defaultName={form.fullName}\r\n />\r\n \r\n
\r\n )}\r\n
\r\n
\r\n
\r\n\r\n {/* ---- Right: Summary + CTA ---- */}\r\n
\r\n \r\n\r\n \r\n\r\n {paymentMethod !== \"stripe\" && (\r\n \r\n )}\r\n\r\n {onBackToCart && (\r\n \r\n ← Back to Cart\r\n \r\n )}\r\n\r\n \r\n
\r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Separator } from \"@/components/ui/separator\";\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nexport interface PolicyPageProps {\r\n /** Page title override. */\r\n title?: string;\r\n /** Rich content to render inside the page body (JSX). */\r\n children?: React.ReactNode;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Generic policy/info page shell — centered card with title + prose body.\r\n * Used by ShippingPage, ReturnsPage, PrivacyPolicyPage, TermsPage.\r\n */\r\nexport function PolicyPage({ title, children, className }: PolicyPageProps) {\r\n return (\r\n
\r\n \r\n \r\n {title}\r\n \r\n \r\n \r\n {children}\r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { Truck, Clock, Globe, DollarSign } from \"lucide-react\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport { PolicyPage } from \"./PolicyPage\";\r\n\r\nexport interface ShippingRate {\r\n region: string;\r\n method: string;\r\n estimate: string;\r\n price: string;\r\n}\r\n\r\nexport interface ShippingPageProps {\r\n /** Custom shipping rates to display. Falls back to placeholder content. */\r\n rates?: ShippingRate[];\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\nconst defaultRates: ShippingRate[] = [\r\n { region: \"Domestic\", method: \"Standard\", estimate: \"5–7 business days\", price: \"$4.99\" },\r\n { region: \"Domestic\", method: \"Express\", estimate: \"2–3 business days\", price: \"$12.99\" },\r\n { region: \"International\", method: \"Standard\", estimate: \"10–20 business days\", price: \"$14.99\" },\r\n { region: \"International\", method: \"Express\", estimate: \"5–8 business days\", price: \"$29.99\" },\r\n];\r\n\r\n/** Public page with shipping info and rates. */\r\nexport function ShippingPage({ rates = defaultRates, className }: ShippingPageProps) {\r\n return (\r\n \r\n {/* Highlights */}\r\n
\r\n {[\r\n { icon: Truck, label: \"Free shipping on orders over $75\" },\r\n { icon: Clock, label: \"Same-day dispatch on orders before 2 PM\" },\r\n { icon: Globe, label: \"We ship worldwide\" },\r\n { icon: DollarSign, label: \"No hidden fees at checkout\" },\r\n ].map(({ icon: Icon, label }) => (\r\n \r\n \r\n {label}\r\n
\r\n ))}\r\n
\r\n\r\n {/* Rates table */}\r\n

Shipping Rates

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {rates.map((r, i) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n ))}\r\n \r\n
RegionMethodEstimatePrice
{r.region}{r.method}{r.estimate}{r.price}
\r\n
\r\n\r\n

Processing Time

\r\n

\r\n Orders placed before 2:00 PM (local time) on business days are typically processed and\r\n shipped the same day. Orders placed after this cut-off or on weekends/holidays will be\r\n processed the next business day.\r\n

\r\n\r\n

Tracking

\r\n

\r\n Once your order ships, you will receive a confirmation email with a tracking number.\r\n You can use this number to track your package on the carrier's website.\r\n

\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { RotateCcw, CheckCircle, XCircle, Clock } from \"lucide-react\";\r\nimport { PolicyPage } from \"./PolicyPage\";\r\n\r\nexport interface ReturnsPageProps {\r\n /** Number of days for return window. */\r\n returnWindowDays?: number;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/** Public page with refund / return policy. */\r\nexport function ReturnsPage({ returnWindowDays = 30, className }: ReturnsPageProps) {\r\n return (\r\n \r\n {/* Quick summary */}\r\n
\r\n {[\r\n { icon: Clock, label: `${returnWindowDays}-day return window` },\r\n { icon: RotateCcw, label: \"Free returns on defective items\" },\r\n { icon: CheckCircle, label: \"Full refund to original payment\" },\r\n { icon: XCircle, label: \"No restocking fees\" },\r\n ].map(({ icon: Icon, label }) => (\r\n \r\n \r\n {label}\r\n
\r\n ))}\r\n
\r\n\r\n

Eligibility

\r\n

\r\n Items must be returned within {returnWindowDays} days of delivery in their\r\n original, unused condition with all tags and packaging intact.\r\n

\r\n\r\n

How to Initiate a Return

\r\n
    \r\n
  1. Contact our support team with your order number.
  2. \r\n
  3. Receive a prepaid return label (for defective items) or return instructions.
  4. \r\n
  5. Ship the item back using the provided label or your preferred carrier.
  6. \r\n
\r\n\r\n

Refund Processing

\r\n

\r\n Once we receive and inspect the returned item, your refund will be processed within\r\n 5–10 business days to your original payment method. You will receive an email\r\n confirmation when the refund has been issued.\r\n

\r\n\r\n

Exceptions

\r\n

\r\n The following items are not eligible for return: gift cards, downloadable products,\r\n and items marked as final sale. Perishable goods cannot be returned unless they arrive\r\n damaged or defective.\r\n

\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { PolicyPage } from \"./PolicyPage\";\r\n\r\nexport interface PrivacyPolicyPageProps {\r\n /** Business / site name used in the policy text. */\r\n siteName?: string;\r\n /** Contact email for privacy inquiries. */\r\n contactEmail?: string;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/** Public page with privacy / cookie information. */\r\nexport function PrivacyPolicyPage({\r\n siteName = \"Our Store\",\r\n contactEmail = \"privacy@example.com\",\r\n className,\r\n}: PrivacyPolicyPageProps) {\r\n return (\r\n \r\n

\r\n At {siteName}, we are committed to protecting your personal information\r\n and your right to privacy. This policy explains what information we collect, how we use\r\n it, and what rights you have in relation to it.\r\n

\r\n\r\n

Information We Collect

\r\n
    \r\n
  • \r\n Personal information: name, email, shipping address, and payment\r\n details provided during checkout.\r\n
  • \r\n
  • \r\n Usage data: pages visited, time spent, browser type, and device\r\n information collected automatically.\r\n
  • \r\n
  • \r\n Cookies: small data files stored on your device to improve your\r\n browsing experience and remember your preferences.\r\n
  • \r\n
\r\n\r\n

How We Use Your Information

\r\n
    \r\n
  • To process and fulfill your orders.
  • \r\n
  • To communicate with you about orders, updates, and promotions.
  • \r\n
  • To improve our website and services.
  • \r\n
  • To comply with legal obligations.
  • \r\n
\r\n\r\n

Data Sharing

\r\n

\r\n We do not sell your personal data. We share information only with service providers\r\n necessary to fulfill your order (e.g., payment processors, shipping carriers) and as\r\n required by law.\r\n

\r\n\r\n

Cookies

\r\n

\r\n We use essential cookies for site functionality and optional analytics cookies to\r\n understand usage patterns. You can manage cookie preferences through your browser\r\n settings.\r\n

\r\n\r\n

Your Rights

\r\n

\r\n You may request access to, correction of, or deletion of your personal data at any\r\n time by contacting us at{\" \"}\r\n \r\n {contactEmail}\r\n \r\n .\r\n

\r\n\r\n

Contact Us

\r\n

\r\n If you have questions about this privacy policy, please contact us at{\" \"}\r\n \r\n {contactEmail}\r\n \r\n .\r\n

\r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { PolicyPage } from \"./PolicyPage\";\r\n\r\nexport interface TermsPageProps {\r\n /** Business / site name. */\r\n siteName?: string;\r\n /** Contact email for legal inquiries. */\r\n contactEmail?: string;\r\n /** Optional extra class names. */\r\n className?: string;\r\n}\r\n\r\n/** Optional terms of service page. */\r\nexport function TermsPage({\r\n siteName = \"Our Store\",\r\n contactEmail = \"legal@example.com\",\r\n className,\r\n}: TermsPageProps) {\r\n return (\r\n \r\n

\r\n By accessing and using {siteName}, you agree to be bound by these\r\n Terms of Service.\r\n

\r\n\r\n

Use of the Site

\r\n

\r\n You agree to use this site only for lawful purposes and in a manner that does not\r\n infringe on the rights of others or restrict their use and enjoyment of the site.\r\n

\r\n\r\n

Products & Pricing

\r\n

\r\n All product descriptions and prices are subject to change without notice. We reserve\r\n the right to modify or discontinue any product at any time. Prices are displayed in\r\n the store's base currency and may exclude taxes and shipping costs, which are\r\n calculated at checkout.\r\n

\r\n\r\n

Orders & Payment

\r\n

\r\n By placing an order, you make an offer to purchase the selected products. We reserve\r\n the right to refuse or cancel any order for any reason, including pricing errors or\r\n suspected fraud.\r\n

\r\n\r\n

Intellectual Property

\r\n

\r\n All content on this site — including text, images, logos, and software — is the\r\n property of {siteName} or its licensors and is protected by applicable intellectual\r\n property laws.\r\n

\r\n\r\n

Limitation of Liability

\r\n

\r\n To the fullest extent permitted by law, {siteName} shall not be liable for any\r\n indirect, incidental, or consequential damages arising from your use of the site or\r\n purchase of products.\r\n

\r\n\r\n

Changes to These Terms

\r\n

\r\n We may update these Terms of Service from time to time. Continued use of the site\r\n after changes constitutes acceptance of the revised terms.\r\n

\r\n\r\n

Contact

\r\n

\r\n For questions about these terms, contact us at{\" \"}\r\n \r\n {contactEmail}\r\n \r\n .\r\n

\r\n
\r\n );\r\n}\r\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nvar RELEASE_TRAIN = 'clover';\n\nvar runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {\n return version === 3 ? 'v3' : version;\n};\n\nvar ORIGIN = 'https://js.stripe.com';\nvar STRIPE_JS_URL = \"\".concat(ORIGIN, \"/\").concat(RELEASE_TRAIN, \"/stripe.js\");\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar STRIPE_JS_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/(v3|[a-z]+)\\/stripe\\.js(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\n\nvar isStripeJSURL = function isStripeJSURL(url) {\n return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);\n};\n\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(ORIGIN, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!isStripeJSURL(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(STRIPE_JS_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"8.8.0\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar onErrorListener = null;\nvar onLoadListener = null;\n\nvar onError = function onError(reject) {\n return function (cause) {\n reject(new Error('Failed to load Stripe.js', {\n cause: cause\n }));\n };\n};\n\nvar onLoad = function onLoad(resolve, reject) {\n return function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n };\n};\n\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n } else if (script && onLoadListener !== null && onErrorListener !== null) {\n var _script$parentNode;\n\n // remove event listeners\n script.removeEventListener('load', onLoadListener);\n script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,\n // reload script to trigger 'load' event\n\n (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);\n script = injectScript(params);\n }\n\n onLoadListener = onLoad(resolve, reject);\n onErrorListener = onError(reject);\n script.addEventListener('load', onLoadListener);\n script.addEventListener('error', onErrorListener);\n } catch (error) {\n reject(error);\n return;\n }\n }); // Resets stripePromise on error\n\n return stripePromise[\"catch\"](function (error) {\n stripePromise = null;\n return Promise.reject(error);\n });\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var pk = args[0];\n\n if (typeof pk !== 'string') {\n throw new Error(\"Expected publishable key to be of type string, got type \".concat(_typeof(pk), \" instead.\"));\n }\n\n var isTestKey = pk.match(/^pk_test/); // @ts-expect-error this is not publicly typed\n\n var version = runtimeVersionToUrlVersion(maybeStripe.version);\n var expectedVersion = RELEASE_TRAIN;\n\n if (isTestKey && version !== expectedVersion) {\n console.warn(\"Stripe.js@\".concat(version, \" was loaded on the page, but @stripe/stripe-js@\").concat(\"8.8.0\", \" expected Stripe.js@\").concat(expectedVersion, \". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning\"));\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nvar validateLoadParams = function validateLoadParams(params) {\n var errorMessage = \"invalid load parameters; expected object of shape\\n\\n {advancedFraudSignals: boolean}\\n\\nbut received\\n\\n \".concat(JSON.stringify(params), \"\\n\");\n\n if (params === null || _typeof(params) !== 'object') {\n throw new Error(errorMessage);\n }\n\n if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') {\n return params;\n }\n\n throw new Error(errorMessage);\n};\n\nvar loadParams;\nvar loadStripeCalled = false;\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadStripeCalled = true;\n var startTime = Date.now();\n return loadScript(loadParams).then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nloadStripe.setLoadParameters = function (params) {\n // we won't throw an error if setLoadParameters is called with the same values as before\n if (loadStripeCalled && loadParams) {\n var validatedParams = validateLoadParams(params);\n var parameterKeys = Object.keys(validatedParams);\n var sameParameters = parameterKeys.reduce(function (previousValue, currentValue) {\n var _loadParams;\n\n return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]);\n }, true);\n\n if (sameParameters) {\n return;\n }\n }\n\n if (loadStripeCalled) {\n throw new Error('You cannot change load parameters after calling loadStripe');\n }\n\n loadParams = validateLoadParams(params);\n};\n\nexport { loadStripe };\n","import React, { useState, useEffect } from \"react\";\r\nimport { CheckoutPage, CheckoutPageProps, SavedAddress } from \"./CheckoutPage\";\r\nimport { useCartStore } from \"@/cart/useCartStore\";\r\nimport { loadStripe } from \"@stripe/stripe-js/pure\";\r\nimport type { Stripe as StripeJS } from \"@stripe/stripe-js\";\r\n\r\nexport interface CheckoutFlowProps {\r\n /** The authenticated user's ID. */\r\n userId?: string;\r\n /** The authenticated user's display name. */\r\n userDisplayName?: string;\r\n /** The authenticated user's email. */\r\n userEmail?: string;\r\n /** Async function to fetch saved addresses for the user. */\r\n onFetchAddresses: (userId: string) => Promise;\r\n /** Async function to save a new address (or update list). */\r\n onSaveAddress: (userId: string, addresses: SavedAddress[]) => Promise;\r\n /** Async function to place the order (create transaction). */\r\n onPlaceOrder: (data: any) => Promise;\r\n /** Navigation callback to go back to cart. */\r\n onBackToCart: () => void;\r\n /** Callback after successful order placement (e.g. navigate to purchases). */\r\n onOrderSuccess: () => void;\r\n /** Toast notification handler. */\r\n toast?: {\r\n success: (msg: string) => void;\r\n error: (msg: string) => void;\r\n };\r\n /**\r\n * Stripe publishable key (pk_test_... or pk_live_...).\r\n * If omitted the Stripe payment option will still render but remain\r\n * in a \"loading\" state until the key is provided.\r\n */\r\n stripePublishableKey?: string;\r\n /**\r\n * Base URL for the API server (e.g. \"http://localhost:3333\").\r\n * Used to call `/api/stripe/create-payment-intent`.\r\n */\r\n apiBaseUrl?: string;\r\n /** Stripe return URL for redirect-based payment methods. */\r\n stripeReturnUrl?: string;\r\n /** Currency code for Stripe payments (default: \"eur\"). */\r\n currency?: string;\r\n /** Returns the current auth token for authenticated API calls. */\r\n getAuthToken?: () => Promise;\r\n /** Locale for Stripe Elements (e.g. \"en\", \"de\", \"fr\"). */\r\n locale?: string;\r\n}\r\n\r\nexport function CheckoutFlow({\r\n userId,\r\n userDisplayName,\r\n userEmail,\r\n onFetchAddresses,\r\n onSaveAddress,\r\n onPlaceOrder,\r\n onBackToCart,\r\n onOrderSuccess,\r\n toast,\r\n stripePublishableKey,\r\n apiBaseUrl = \"\",\r\n stripeReturnUrl,\r\n currency = \"eur\",\r\n getAuthToken,\r\n locale,\r\n}: CheckoutFlowProps) {\r\n const [savedAddresses, setSavedAddresses] = useState([]);\r\n const [stripePromise, setStripePromise] = useState | null>(null);\r\n const [clientSecret, setClientSecret] = useState(null);\r\n const subtotal = useCartStore((s) => s.subtotal);\r\n\r\n // 1. Fetch addresses on mount if user exists\r\n useEffect(() => {\r\n if (!userId) return;\r\n let mounted = true;\r\n onFetchAddresses(userId)\r\n .then((addrs) => {\r\n if (mounted) setSavedAddresses(addrs);\r\n })\r\n .catch((err) => console.error(\"Failed to fetch addresses:\", err));\r\n return () => { mounted = false; };\r\n }, [userId, onFetchAddresses]);\r\n\r\n // 2. Load Stripe.js once we have a publishable key\r\n useEffect(() => {\r\n if (!stripePublishableKey) return;\r\n setStripePromise(loadStripe(stripePublishableKey, { locale: (locale as any) || 'auto' }));\r\n }, [stripePublishableKey, locale]);\r\n\r\n // 3. Create a PaymentIntent when the flow mounts (so the form is ready)\r\n useEffect(() => {\r\n if (!stripePublishableKey || subtotal <= 0) return;\r\n let mounted = true;\r\n\r\n // Stripe expects amount in smallest currency unit (cents for USD)\r\n const amountInCents = Math.round(subtotal * 100);\r\n\r\n // Get auth token for the API call (needed for Stripe Customer creation)\r\n const makeRequest = async () => {\r\n const headers: Record = { \"Content-Type\": \"application/json\" };\r\n if (getAuthToken) {\r\n const token = await getAuthToken();\r\n if (token) headers[\"Authorization\"] = `Bearer ${token}`;\r\n }\r\n const r = await fetch(`${apiBaseUrl}/api/stripe/create-payment-intent`, {\r\n method: \"POST\",\r\n headers,\r\n body: JSON.stringify({ amount: amountInCents, currency }),\r\n });\r\n return r.json();\r\n };\r\n\r\n makeRequest()\r\n .then((data) => {\r\n if (mounted && data.clientSecret) {\r\n setClientSecret(data.clientSecret);\r\n }\r\n })\r\n .catch((err) => console.error(\"Failed to create PaymentIntent:\", err));\r\n\r\n return () => { mounted = false; };\r\n }, [stripePublishableKey, apiBaseUrl, subtotal]);\r\n\r\n // 4. Handle saving a new address\r\n const handleSaveAddress = async (address: any) => {\r\n if (!userId) return;\r\n try {\r\n // Re-fetch latest to be safe (or use local state if we trust it completely)\r\n const existing = await onFetchAddresses(userId);\r\n\r\n const newAddr: SavedAddress = {\r\n ...address,\r\n id: crypto.randomUUID(),\r\n label: address.address?.split(',')[0] || 'Checkout address',\r\n phone: '',\r\n note: '',\r\n // If it's the first address, make it default\r\n isDefault: existing.length === 0,\r\n };\r\n\r\n const updated = [...existing, newAddr];\r\n await onSaveAddress(userId, updated);\r\n setSavedAddresses(updated);\r\n toast?.success(\"Address saved to your profile\");\r\n } catch (err) {\r\n console.error(\"Failed to save address:\", err);\r\n toast?.error(\"Failed to save address\");\r\n }\r\n };\r\n\r\n // 5. Handle order placement (for non-Stripe methods)\r\n const handlePlaceOrder = async (data: any) => {\r\n try {\r\n await onPlaceOrder(data);\r\n toast?.success(\"Order placed successfully!\");\r\n onOrderSuccess();\r\n } catch (err) {\r\n console.error(\"Failed to place order:\", err);\r\n toast?.error(\"Failed to place order. Please try again.\");\r\n }\r\n };\r\n\r\n // 6. Handle Stripe payment success (inline, no redirect)\r\n const handleStripePaymentSuccess = async (data: {\r\n shipping: any;\r\n paymentMethod: string;\r\n paymentIntent: { id: string; status: string;[key: string]: any };\r\n }) => {\r\n try {\r\n await onPlaceOrder({\r\n shipping: data.shipping,\r\n paymentMethod: data.paymentMethod,\r\n // Store Stripe PaymentIntent ID for refunds/reconciliation\r\n external_order_id: data.paymentIntent.id,\r\n metadata: {\r\n stripe_payment_intent_id: data.paymentIntent.id,\r\n stripe_status: data.paymentIntent.status,\r\n },\r\n });\r\n toast?.success(\"Payment successful!\");\r\n // Brief delay to let the Stripe webhook update the transaction\r\n // with receipt URL and status before navigating\r\n await new Promise((r) => setTimeout(r, 2000));\r\n onOrderSuccess();\r\n } catch (err) {\r\n console.error(\"Failed to record Stripe transaction:\", err);\r\n toast?.error(\"Payment succeeded but failed to record transaction. Contact support.\");\r\n }\r\n };\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import * as React from \"react\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst badgeVariants = cva(\r\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\r\n secondary: \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n destructive: \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\r\n outline: \"text-foreground\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n },\r\n },\r\n);\r\n\r\nexport interface BadgeProps extends React.HTMLAttributes, VariantProps { }\r\n\r\nfunction Badge({ className, variant, ...props }: BadgeProps) {\r\n return
;\r\n}\r\n\r\nexport { Badge, badgeVariants };\r\n","import React, { useState, useEffect } from \"react\";\r\nimport { Package, Clock, CheckCircle, XCircle, ArrowLeft, ExternalLink, RefreshCw, Store, Receipt, FileText } from \"lucide-react\";\r\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport { Badge } from \"@/components/ui/badge\";\r\n\r\n// We need to define or import Transaction type and statusConfig locally or from a shared type file\r\n// Since client-ecommerce.ts is outside, let's redefine minimal types here or ask for them to be passed in.\r\n// Ideally, `client-ecommerce.ts` types should be imported from @polymech/ecommerce if possible, \r\n// OR @polymech/ecommerce should define the types and client-ecommerce uses them.\r\n// For now, let's define the props generically.\r\n\r\nexport interface Transaction {\r\n id: string;\r\n created_at: string;\r\n status: string;\r\n total_amount: number;\r\n currency: string;\r\n product_info: any[];\r\n shipping_info: any;\r\n payment_provider?: string;\r\n external_order_id?: string;\r\n metadata?: Record;\r\n}\r\n\r\nexport interface PurchasesListProps {\r\n /** Async function to fetch user transactions. */\r\n onFetchTransactions: () => Promise;\r\n /** Navigation callback. */\r\n onNavigate: (path: string) => void;\r\n /** Toast notification handler. */\r\n toast?: {\r\n error: (msg: string) => void;\r\n };\r\n}\r\n\r\nconst statusConfig: Record = {\r\n pending: { label: \"Pending\", variant: \"secondary\", icon: },\r\n processing: { label: \"Processing\", variant: \"default\", icon: },\r\n paid: { label: \"Paid\", variant: \"default\", icon: },\r\n completed: { label: \"Completed\", variant: \"default\", icon: },\r\n failed: { label: \"Failed\", variant: \"destructive\", icon: },\r\n refunded: { label: \"Refunded\", variant: \"outline\", icon: },\r\n cancelled: { label: \"Cancelled\", variant: \"destructive\", icon: },\r\n};\r\n\r\nexport function PurchasesList({ onFetchTransactions, onNavigate, toast }: PurchasesListProps) {\r\n const [transactions, setTransactions] = useState([]);\r\n const [loading, setLoading] = useState(true);\r\n\r\n useEffect(() => {\r\n let mounted = true;\r\n setLoading(true);\r\n onFetchTransactions()\r\n .then((data) => {\r\n if (mounted) setTransactions(data);\r\n })\r\n .catch((err) => {\r\n console.error(\"Failed to load transactions:\", err);\r\n toast?.error(\"Failed to load purchases\");\r\n })\r\n .finally(() => {\r\n if (mounted) setLoading(false);\r\n });\r\n return () => { mounted = false; };\r\n }, [onFetchTransactions]);\r\n\r\n if (loading) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n
\r\n
\r\n \r\n

My Purchases

\r\n
\r\n \r\n
\r\n\r\n {transactions.length === 0 ? (\r\n \r\n \r\n \r\n

No purchases yet.

\r\n \r\n
\r\n
\r\n ) : (\r\n
\r\n {transactions.map((tx) => {\r\n const products = Array.isArray(tx.product_info) ? tx.product_info : [];\r\n const sc = statusConfig[tx.status] || statusConfig.pending;\r\n const date = new Date(tx.created_at).toLocaleDateString(undefined, {\r\n year: \"numeric\",\r\n month: \"short\",\r\n day: \"numeric\",\r\n hour: \"2-digit\",\r\n minute: \"2-digit\",\r\n });\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n \r\n Order #{tx.id.slice(0, 8)}\r\n \r\n

{date}

\r\n
\r\n
\r\n \r\n {sc.icon}\r\n {sc.label}\r\n \r\n \r\n {tx.currency} {Number(tx.total_amount).toFixed(2)}\r\n \r\n
\r\n
\r\n
\r\n \r\n {/* Product list */}\r\n
\r\n {products.map((item: any, idx: number) => (\r\n \r\n {item.image && (\r\n \r\n )}\r\n
\r\n

\r\n {item.title || \"Product\"}\r\n

\r\n

\r\n Qty: {item.quantity || 1}\r\n {item.variant && ` · ${item.variant}`}\r\n {\" · \"}\r\n {tx.currency} {Number(item.price || 0).toFixed(2)}\r\n

\r\n {item.vendorSlug && (\r\n { e.preventDefault(); onNavigate(`/user/${item.vendorSlug}`); }}\r\n className=\"text-xs text-primary hover:underline flex items-center gap-1 mt-0.5 cursor-pointer\"\r\n >\r\n \r\n {item.vendorSlug}\r\n \r\n )}\r\n
\r\n {item.vendorSlug && item.pageSlug && (\r\n { e.preventDefault(); onNavigate(`/user/${item.vendorSlug}/pages/${item.pageSlug}`); }}\r\n className=\"text-primary hover:underline text-xs flex items-center gap-1 shrink-0 cursor-pointer\"\r\n >\r\n View\r\n \r\n \r\n )}\r\n
\r\n ))}\r\n
\r\n\r\n {/* Shipping summary */}\r\n {tx.shipping_info && Object.keys(tx.shipping_info).length > 0 && (\r\n
\r\n Ships to: {(tx.shipping_info as any).fullName}, {(tx.shipping_info as any).city}, {(tx.shipping_info as any).country}\r\n
\r\n )}\r\n\r\n {/* Receipt / Invoice links */}\r\n {tx.metadata && (tx.metadata.stripe_receipt_url || tx.metadata.stripe_invoice_url) && (\r\n
\r\n {tx.metadata.stripe_receipt_url && (\r\n \r\n \r\n View Receipt\r\n \r\n )}\r\n {tx.metadata.stripe_invoice_url && (\r\n \r\n \r\n View Invoice\r\n \r\n )}\r\n
\r\n )}\r\n \r\n \r\n );\r\n })}\r\n
\r\n )}\r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { useLocation, matchPath, Navigate } from \"react-router-dom\";\r\nimport { CartPage } from \"./cart/CartPage\";\r\nimport { CheckoutFlow } from \"./checkout/CheckoutFlow\";\r\nimport { PurchasesList } from \"./purchases/PurchasesList\";\r\nimport { ShippingPage } from \"./policies/ShippingPage\";\r\nimport { ReturnsPage } from \"./policies/ReturnsPage\";\r\nimport { PrivacyPolicyPage } from \"./policies/PrivacyPolicyPage\";\r\nimport { TermsPage } from \"./policies/TermsPage\";\r\n\r\nexport interface EcommerceBundleDependencies {\r\n user: {\r\n id?: string;\r\n email?: string;\r\n user_metadata?: {\r\n display_name?: string;\r\n };\r\n } | null;\r\n toast: {\r\n success: (message: string) => void;\r\n error: (message: string) => void;\r\n };\r\n onFetchAddresses: (userId: string) => Promise;\r\n onSaveAddress: (userId: string, addresses: any[]) => Promise;\r\n onPlaceOrder: (data: any) => Promise;\r\n onFetchTransactions: () => Promise;\r\n onNavigate: (path: string) => void;\r\n // Optional config\r\n siteName?: string;\r\n contactEmail?: string;\r\n /** Stripe publishable key — enables Stripe payment option. */\r\n stripePublishableKey?: string;\r\n /** API base URL for Stripe endpoints (e.g. \"http://localhost:3333\"). */\r\n apiBaseUrl?: string;\r\n /** Stripe return URL for redirect-based payment methods. */\r\n stripeReturnUrl?: string;\r\n /** Currency code for Stripe (default: \"eur\"). */\r\n currency?: string;\r\n /** Returns the current auth token for authenticated API calls. */\r\n getAuthToken?: () => Promise;\r\n /** Locale for Stripe Elements (e.g. \"en\", \"de\"). */\r\n locale?: string;\r\n}\r\n\r\nexport const EcommerceBundle: React.FC = (props) => {\r\n const { pathname } = useLocation();\r\n\r\n if (matchPath(\"/cart/*\", pathname)) {\r\n return props.onNavigate('/checkout')} />;\r\n }\r\n\r\n if (matchPath(\"/checkout/*\", pathname)) {\r\n return (\r\n props.onNavigate('/cart')}\r\n onOrderSuccess={() => props.onNavigate('/purchases')}\r\n toast={props.toast}\r\n stripePublishableKey={props.stripePublishableKey}\r\n apiBaseUrl={props.apiBaseUrl}\r\n stripeReturnUrl={props.stripeReturnUrl}\r\n currency={props.currency}\r\n getAuthToken={props.getAuthToken}\r\n locale={props.locale}\r\n />\r\n );\r\n }\r\n\r\n if (matchPath(\"/purchases/*\", pathname)) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n if (matchPath(\"/shipping/*\", pathname)) return ;\r\n if (matchPath(\"/returns/*\", pathname)) return ;\r\n if (matchPath(\"/privacy/*\", pathname)) return ;\r\n if (matchPath(\"/terms/*\", pathname)) return ;\r\n\r\n return null; // Return null if no route matches (let App.tsx handle 404 if needed, though this component is usually mounted on specific routes)\r\n};\r\n"],"names":["setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","REACT_LAZY_TYPE","use","React","isPromiseLike","isLazyComponent","element","createSlot","ownerName","SlotClone","createSlotClone","Slot2","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","Slot","childrenRef","getElementRef","props2","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","getter","_a","mayWarn","_b","r","t","f","clsx","falsyToString","cx","cva","base","config","_config_compoundVariants","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","param","key","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","cn","inputs","twMerge","buttonVariants","Button","className","size","asChild","computeTotals","items","sum","useCartStore","create","persist","set","incoming","state","existing","id","quantity","CartItemRow","item","updateQuantity","s","removeItem","lineTotal","jsxs","Minus","Plus","Trash2","Card","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","NODES","Primitive","primitive","Node","primitiveProps","Comp","NAME","DEFAULT_ORIENTATION","ORIENTATIONS","Separator","decorative","orientationProp","domProps","orientation","isValidOrientation","semanticProps","Root","SeparatorPrimitive.Root","defaultLinks","PolicyLinks","links","l","CartPage","onCheckout","subtotal","itemCount","clearCart","ShoppingCart","OrderSummary","tax","shipping","taxAmount","shippingAmount","total","Input","type","Label","event","labelVariants","LabelPrimitive.Root","b","c","d","e","g","h","k","m","n","p","q","v","w","x","y","z","a","u","A","reactIs_production_min","hasSymbol","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_ASYNC_MODE_TYPE","REACT_CONCURRENT_MODE_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_BLOCK_TYPE","REACT_FUNDAMENTAL_TYPE","REACT_RESPONDER_TYPE","REACT_SCOPE_TYPE","isValidElementType","typeOf","object","$$typeof","$$typeofType","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","ForwardRef","Fragment","Lazy","Memo","Portal","Profiler","StrictMode","Suspense","hasWarnedAboutDeprecatedIsAsyncMode","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","reactIs_development","reactIsModule","require$$0","require$$1","getOwnPropertySymbols","hasOwnProperty","propIsEnumerable","toObject","val","shouldUseNative","test1","test2","order2","test3","letter","objectAssign","target","source","from","to","symbols","ReactPropTypesSecret","ReactPropTypesSecret_1","has","printWarning","loggedTypeFailures","text","message","checkPropTypes","typeSpecs","values","location","componentName","getStack","typeSpecName","error","err","ex","stack","checkPropTypes_1","ReactIs","assign","require$$2","require$$3","require$$4","emptyFunctionThatReturnsNull","factoryWithTypeCheckers","isValidElement","throwOnDirectAccess","ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","iteratorFn","ANONYMOUS","ReactPropTypes","createPrimitiveTypeChecker","createAnyTypeChecker","createArrayOfTypeChecker","createElementTypeChecker","createElementTypeTypeChecker","createInstanceTypeChecker","createNodeChecker","createObjectOfTypeChecker","createEnumTypeChecker","createUnionTypeChecker","createShapeTypeChecker","createStrictShapeTypeChecker","is","PropTypeError","data","createChainableTypeChecker","validate","manualPropTypeCallCache","manualPropTypeWarningCount","checkType","isRequired","propFullName","secret","cacheKey","chainedCheckType","expectedType","propValue","propType","getPropType","preciseType","getPreciseType","typeChecker","expectedClass","expectedClassName","actualClassName","getClassName","expectedValues","valuesString","arrayOfTypeCheckers","checker","getPostfixForTypeWarning","expectedTypes","checkerResult","expectedTypesMessage","isNode","invalidValidatorError","shapeTypes","allKeys","iterator","step","entry","isSymbol","emptyFunction","emptyFunctionWithReset","factoryWithThrowingShims","shim","getShim","propTypesModule","ownKeys","enumerableOnly","keys","sym","_objectSpread2","_defineProperty","_typeof","obj","_objectWithoutPropertiesLoose","excluded","sourceKeys","_objectWithoutProperties","sourceSymbolKeys","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_i","_arr","_n","_d","_s","_e","o","minLen","_arrayLikeToArray","len","arr2","useAttachEvent","cb","cbDefined","cbRef","decoratedCb","usePrevious","isUnknownObject","raw","isPromise","isStripe","PLAIN_OBJECT_STR","isEqual","left","right","leftArray","rightArray","leftPlainObject","rightPlainObject","leftKeys","rightKeys","keySet","pred","extractAllowedOptionsUpdates","options","prevOptions","immutableKeys","newOptions","isUpdated","INVALID_STRIPE_ERROR$1","validateStripe","maybeStripe","errorMsg","parseStripeProp","stripe","registerWithStripeJs","ElementsContext","parseElementsContext","ctx","useCase","Elements","_ref","rawStripeProp","parsed","_React$useState","_React$useState2","setContext","isMounted","safeSetContext","prevStripe","updates","PropTypes","useElementsContextWithUseCase","useCaseMessage","useElements","_useElementsContextWi","elements","CheckoutContext","useElementsOrCheckoutContextWithUseCase","useCaseString","checkout","_excluded","capitalized","str","createElementComponent","isServer","displayName","ClientElement","_ref$options","onBlur","onFocus","onReady","onChange","onEscape","onClick","onLoadError","onLoaderStart","onNetworksChange","onConfirm","onCancel","onShippingAddressChange","onShippingRateChange","onSavedPaymentMethodRemove","onSavedPaymentMethodUpdate","checkoutState","checkoutSdk","setElement","elementRef","domNode","readyCallback","mode","restOptions","ServerElement","EmbeddedCheckoutContext","useStripe","_useElementsOrCheckou","PaymentElement","LinkAuthenticationElement","StripePaymentForm","onPaymentSuccess","returnUrl","defaultEmail","defaultName","setMessage","useState","isLoading","setIsLoading","paymentIntent","Loader2","CheckoutPage","onPlaceOrder","onSaveAddress","onBackToCart","initialShipping","savedAddresses","stripePromise","stripeClientSecret","onStripePaymentSuccess","stripeReturnUrl","paymentMethod","setPaymentMethod","saveAddress","setSaveAddress","defaultAddress","resolveInitial","form","setForm","selectedAddressId","setSelectedAddressId","selectAddress","addr","field","prev","handleSubmit","ShoppingBag","MapPin","Save","CreditCard","Bitcoin","PolicyPage","title","defaultRates","ShippingPage","rates","Truck","Clock","Globe","DollarSign","Icon","label","ReturnsPage","returnWindowDays","RotateCcw","CheckCircle","XCircle","PrivacyPolicyPage","siteName","contactEmail","TermsPage","RELEASE_TRAIN","runtimeVersionToUrlVersion","version","ORIGIN","STRIPE_JS_URL","V3_URL_REGEX","STRIPE_JS_URL_REGEX","EXISTING_SCRIPT_MESSAGE","isStripeJSURL","url","findScript","scripts","script","injectScript","params","queryString","headOrBody","registerWrapper","startTime","onErrorListener","onLoadListener","onError","reject","cause","onLoad","resolve","loadScript","_script$parentNode","initStripe","pk","isTestKey","expectedVersion","validateLoadParams","errorMessage","loadParams","loadStripeCalled","loadStripe","_len","_key","validatedParams","parameterKeys","sameParameters","previousValue","currentValue","_loadParams","CheckoutFlow","userId","userDisplayName","userEmail","onFetchAddresses","onOrderSuccess","toast","stripePublishableKey","apiBaseUrl","currency","getAuthToken","locale","setSavedAddresses","setStripePromise","clientSecret","setClientSecret","useEffect","mounted","addrs","amountInCents","headers","token","address","newAddr","updated","badgeVariants","Badge","statusConfig","RefreshCw","PurchasesList","onFetchTransactions","onNavigate","transactions","setTransactions","loading","setLoading","Package","ArrowLeft","tx","products","sc","date","idx","Store","ExternalLink","Receipt","FileText","EcommerceBundle","pathname","useLocation","matchPath","_c"],"mappings":";;;;;;;;;AAEA,SAASA,GAAOC,GAAKC,GAAO;AAC1B,MAAI,OAAOD,KAAQ;AACjB,WAAOA,EAAIC,CAAK;AACX,EAAID,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,MAAeC,GAAM;AAC5B,SAAO,CAACC,MAAS;AACf,QAAIC,IAAa;AACjB,UAAMC,IAAWH,EAAK,IAAI,CAACH,MAAQ;AACjC,YAAMO,IAAUR,GAAOC,GAAKI,CAAI;AAChC,aAAI,CAACC,KAAc,OAAOE,KAAW,eACnCF,IAAa,KAERE;AAAA,IACT,CAAC;AACD,QAAIF;AACF,aAAO,MAAM;AACX,iBAASG,IAAI,GAAGA,IAAIF,EAAS,QAAQE,KAAK;AACxC,gBAAMD,IAAUD,EAASE,CAAC;AAC1B,UAAI,OAAOD,KAAW,aACpBA,EAAO,IAEPR,GAAOI,EAAKK,CAAC,GAAG,IAAI;AAAA,QAExB;AAAA,MACF;AAAA,EAEJ;AACF;AC5BA,IAAIC,KAAkB,O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AAA,MAClB,OAAOA,EAAM;AAAA,IAAA;AAAA,EAAA,IAKrBolB,GAAU,eAAeF,CAAQ,sBAAW9G,IAAA,EAAa,IACzDgH,GAAU,cAAcF,CAAQ,sBAAWtG,IAAA,EAAY,IACvDwG,GAAU,cAAcF,CAAQ,IAAU,gBAAAxkB,EAACue,IAAA,EAAkB,UAAUjf,EAAM,YAAY,YAAY,cAAcA,EAAM,gBAAgB,wBAAwB,IACjKolB,GAAU,YAAYF,CAAQ,IAAU,gBAAAxkB,EAAC0e,IAAA,EAAU,UAAUpf,EAAM,YAAY,YAAY,cAAcA,EAAM,gBAAgB,sBAAsB,IAElJ;AACX;","x_google_ignoreList":[0,1,2,3,9,10,16,17,19,20,21,22,23,24,25,26,27,28,29,37]} \ No newline at end of file diff --git a/packages/ecommerce/src/checkout/CheckoutFlow.tsx b/packages/ecommerce/src/checkout/CheckoutFlow.tsx index f659fc3b..29ad01a8 100644 --- a/packages/ecommerce/src/checkout/CheckoutFlow.tsx +++ b/packages/ecommerce/src/checkout/CheckoutFlow.tsx @@ -1,7 +1,8 @@ import React, { useState, useEffect } from "react"; import { CheckoutPage, CheckoutPageProps, SavedAddress } from "./CheckoutPage"; import { useCartStore } from "@/cart/useCartStore"; -import { loadStripe, type Stripe as StripeJS } from "@stripe/stripe-js"; +import { loadStripe } from "@stripe/stripe-js/pure"; +import type { Stripe as StripeJS } from "@stripe/stripe-js"; export interface CheckoutFlowProps { /** The authenticated user's ID. */