;
! function() {
    try {
        var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {},
            n = (new e.Error).stack;
        n && ((e._debugIds || (e._debugIds = {}))[n] = "b729886f-d5cd-d314-a469-ad01938545b0")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 831089, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(197994);
    e.s(["IconCircleXmarkFill18", 0, ({ ...e
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...e
    }, t.default.createElement("path", {
        d: "M9,1C4.589,1,1,4.589,1,9s3.589,8,8,8,8-3.589,8-8S13.411,1,9,1Zm3.28,10.22c.293,.293,.293,.768,0,1.061-.146,.146-.338,.22-.53,.22s-.384-.073-.53-.22l-2.22-2.22-2.22,2.22c-.146,.146-.338,.22-.53,.22s-.384-.073-.53-.22c-.293-.293-.293-.768,0-1.061l2.22-2.22-2.22-2.22c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l2.22,2.22,2.22-2.22c.293-.293,.768-.293,1.061,0s.293,.768,0,1.061l-2.22,2.22,2.22,2.22Z",
        fill: "currentColor"
    }))])
}, 16674, e => {
    "use strict";
    var t, r, n = e.i(416340),
        s = Object.defineProperty,
        a = new Map,
        i = new WeakMap,
        o = 0;
    n.Component, null != (null != (r = "useInsertionEffect" in n ? n.useInsertionEffect : void 0) ? r : n.useLayoutEffect) || n.useEffect, e.s(["useInView", 0, function({
        threshold: e,
        delay: r,
        trackVisibility: s,
        rootMargin: l,
        root: d,
        triggerOnce: c,
        skip: u,
        initialInView: p,
        fallbackInView: m,
        onChange: y
    } = {}) {
        var x;
        let [h, f] = n.useState(null), w = n.useRef(y), b = n.useRef(p), [g, v] = n.useState({
            inView: !!p,
            entry: void 0
        });
        w.current = y, n.useEffect(() => {
            let n;
            if (void 0 === b.current && (b.current = p), !u && h) return n = function(e, r, n = {}, s = t) {
                if (void 0 === window.IntersectionObserver && void 0 !== s) {
                    let t = e.getBoundingClientRect();
                    return r(s, {
                        isIntersecting: s,
                        target: e,
                        intersectionRatio: "number" == typeof n.threshold ? n.threshold : 0,
                        time: 0,
                        boundingClientRect: t,
                        intersectionRect: t,
                        rootBounds: t
                    }), () => {}
                }
                let {
                    id: l,
                    observer: d,
                    elements: c
                } = function(e) {
                    let t = Object.keys(e).sort().filter(t => void 0 !== e[t]).map(t => {
                            var r;
                            return `${t}_${"root"===t?!(r=e.root)?"0":(i.has(r)||(o+=1,i.set(r,o.toString())),i.get(r)):e[t]}`
                        }).toString(),
                        r = a.get(t);
                    if (!r) {
                        let n, s = new Map,
                            i = new IntersectionObserver(t => {
                                t.forEach(t => {
                                    var r;
                                    let a = t.isIntersecting && n.some(e => t.intersectionRatio >= e);
                                    e.trackVisibility && void 0 === t.isVisible && (t.isVisible = a), [...null != (r = s.get(t.target)) ? r : []].forEach(e => {
                                        e(a, t)
                                    })
                                })
                            }, e);
                        n = i.thresholds || (Array.isArray(e.threshold) ? e.threshold : [e.threshold || 0]), r = {
                            id: t,
                            observer: i,
                            elements: s
                        }, a.set(t, r)
                    }
                    return r
                }(n), u = c.get(e) || [];
                return c.has(e) || c.set(e, u), u.push(r), d.observe(e),
                    function() {
                        u.splice(u.indexOf(r), 1), 0 === u.length && (c.delete(e), d.unobserve(e)), 0 === c.size && (d.disconnect(), a.delete(l))
                    }
            }(h, (e, t) => {
                let r = b.current;
                b.current = e, (void 0 !== r || e) && (v({
                    inView: e,
                    entry: t
                }), w.current && w.current(e, t), t.isIntersecting && c && n && (n(), n = void 0))
            }, {
                root: d,
                rootMargin: l,
                threshold: e,
                trackVisibility: s,
                delay: r
            }, m), () => {
                n && n()
            }
        }, [Array.isArray(e) ? e.toString() : e, h, d, l, c, u, s, m, r]);
        let k = null == (x = g.entry) ? void 0 : x.target,
            S = n.useRef(void 0);
        h || !k || c || u || S.current === k || (S.current = k, v({
            inView: !!p,
            entry: void 0
        }), b.current = p);
        let T = [f, g.inView, g.entry];
        return T.ref = T[0], T.inView = T[1], T.entry = T[2], T
    }])
}, 678274, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(416340),
        n = e.i(86831);
    e.s(["Bookmark", 0, ({
        active: e,
        small: s = !1
    }) => {
        let a = (0, r.useRef)(!0),
            i = (0, r.useRef)(e),
            o = (0, r.useCallback)(() => a.current ? e ? "active" : "" : e && !i.current ? "unrolled" : !e && i.current ? "rolled" : e ? "active" : "", [e]);
        return (0, r.useEffect)(() => {
            a.current && (a.current = !1), i.current = e
        }, [e, i, a]), (0, t.jsx)("div", {
            className: (0, n.cn)("bookmarkButton", o(), s && "small")
        })
    }], 678274)
}, 500110, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconPlusOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("line", {
        x1: "9",
        y1: "3.25",
        x2: "9",
        y2: "14.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), t.default.createElement("line", {
        x1: "3.25",
        y1: "9",
        x2: "14.75",
        y2: "9",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))])
}, 528392, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconLockOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("path", {
        d: "M5.75,8.25v-3.25c0-1.795,1.455-3.25,3.25-3.25h0c1.795,0,3.25,1.455,3.25,3.25v3.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), t.default.createElement("line", {
        x1: "9",
        y1: "11.75",
        x2: "9",
        y2: "12.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), t.default.createElement("rect", {
        x: "3.25",
        y: "8.25",
        width: "11.5",
        height: "8",
        rx: "2",
        ry: "2",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))])
}, 90783, e => {
    "use strict";
    var t = e.i(192842);
    e.s(["isBefore", 0, function(e, r) {
        return +(0, t.toDate)(e) < +(0, t.toDate)(r)
    }])
}, 912398, e => {
    "use strict";
    var t = e.i(841252),
        r = e.i(94609);
    e.s(["isSameDay", 0, function(e, n, s) {
        let [a, i] = (0, t.normalizeDates)(s ? .in, e, n);
        return +(0, r.startOfDay)(a) == +(0, r.startOfDay)(i)
    }])
}, 468462, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(467458);
    e.i(416340);
    var n = e.i(423708),
        s = e.i(784521),
        a = e.i(400819),
        i = e.i(631222);
    e.s(["useL2Headers", 0, () => {
        let e, o, l, d, c, u = (0, t.c)(13);
        u[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress"], u[0] = e) : e = u[0];
        let {
            proxyAddress: p
        } = (0, s.useAccountContext)(e), {
            getApiCredential: m,
            generateApiCreds: y
        } = (0, a.useClobCredentialContext)();
        u[1] === Symbol.for("react.memo_cache_sentinel") ? (o = {
            chainId: i.MATIC_CONFIG.chainId
        }, u[1] = o) : o = u[1];
        let {
            data: x
        } = (0, n.useWalletClient)(o);
        e: {
            let e;
            if (!p) {
                l = void 0;
                break e
            }
            u[2] !== m || u[3] !== p ? (e = m(p), u[2] = m, u[3] = p, u[4] = e) : e = u[4],
            l = e
        }
        let h = l;
        u[5] !== h || u[6] !== x ? (d = async e => {
            if (x && h && e) return await (0, r.createL2Headers)(x, h, e)
        }, u[5] = h, u[6] = x, u[7] = d) : d = u[7];
        let f = d;
        return u[8] !== h || u[9] !== y || u[10] !== f || u[11] !== x ? (c = {
            signer: x,
            apiCredential: h,
            generateL2Headers: f,
            generateApiCreds: y
        }, u[8] = h, u[9] = y, u[10] = f, u[11] = x, u[12] = c) : c = u[12], c
    }])
}, 655239, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(86831);
    e.s(["default", 0, e => {
        let s, a, i = (0, r.c)(4),
            {
                className: o
            } = e;
        return i[0] !== o ? (s = (0, n.cn)("w-4 h-4 border-2 border-text-secondary/20 border-t-text-secondary/80 rounded-full animate-spin", o), i[0] = o, i[1] = s) : s = i[1], i[2] !== s ? (a = (0, t.jsx)("div", {
            className: s
        }), i[2] = s, i[3] = a) : a = i[3], a
    }])
}, 779690, e => {
    "use strict";
    var t, r, n = ((t = {}).Changes = "changes", t.Competitive = "competitiveness", t.Earnings = "earnings", t.Expand = "expand", t.Favorite = "favorite", t.Market = "market", t.MaxSpread = "max_spread", t.MinSize = "min_size", t.Percent = "earning_percentage", t.Price = "price", t.Question = "question", t.RatePerDay = "rate_per_day", t.Spread = "spread", t),
        s = ((r = {}).Asc = "ASC", r.Desc = "DESC", r);
    e.s(["REWARDS_REQUEST_PATH", 0, "/rewards/user/markets", "RewardProperty", () => n, "RewardsPosition", () => s, "TOTAL_EARNINGS_REQUEST_PATH", 0, "/rewards/user/total"])
}, 204062, e => {
    "use strict";
    e.i(914640), e.i(779690);
    var t = e.i(655740),
        r = e.i(660006),
        n = e.i(53950),
        s = e.i(631222);
    let a = async e => {
            try {
                let [r, n, a] = e.queryKey, i = `${s.CLOB_API_URL}/rewards/markets/${a}?sponsored=true`;
                return await t.axios.get(i).then(({
                    data: e
                }) => e)
            } catch (e) {
                return (0, r.handleError)(e, "getSingleRewardFetcher"), {
                    data: [],
                    limit: 200,
                    count: 0,
                    next_cursor: "LTE=",
                    total_count: 0
                }
            }
        },
        i = async (e, n, s) => {
            try {
                let [r, a, i, o, l, d, c, u, p, m, y, x, h, f, w, b, g] = e.queryKey;
                return await t.axios.get("/api/rewards/markets", {
                    params: {
                        l2Headers: n ? JSON.stringify(n) : void 0,
                        orderBy: i,
                        position: o,
                        date: l,
                        query: d,
                        showFavorites: c,
                        tagSlug: u,
                        makerAddress: m,
                        walletMode: y,
                        nextCursor: p,
                        requestPath: s,
                        onlyMergeable: h,
                        noCompetition: f,
                        onlyOpenOrders: w,
                        onlyPositions: b,
                        sponsored: g
                    }
                }).then(({
                    data: e
                }) => e)
            } catch (e) {
                return (0, r.handleError)(e, "getCurrentRewardsFetcher"), {
                    data: [],
                    limit: 200,
                    count: 0,
                    next_cursor: "LTE=",
                    total_count: 0
                }
            }
        },
        o = async (e, r, n) => {
            let [s, a, i, o, l, d] = e.queryKey;
            try {
                return await t.axios.get("/api/rewards/totalEarnings", {
                    params: {
                        walletMode: l,
                        date: i,
                        proxy: o,
                        l2Headers: r ? JSON.stringify(r) : void 0,
                        requestPath: n,
                        ...d ? {
                            sponsored: "true"
                        } : {}
                    }
                }).then(({
                    data: e
                }) => e)
            } catch {
                return []
            }
        },
        l = async e => {
            if (!e.length) return [];
            try {
                return (await t.axios.post("/api/rewards/logs", {
                    condition_ids: e
                })).data
            } catch (e) {
                return (0, r.handleError)(e, "getRewardLogsBatch"), []
            }
        },
        d = async (e, s, a, i) => {
            if (!s || !a) return {
                sponsorships: [],
                next_cursor: ""
            };
            let [o, l, d, c] = e.queryKey;
            try {
                let e = await t.axios.get("/api/rewards/sponsorships", {
                    params: {
                        walletMode: c,
                        l2Headers: s ? JSON.stringify(s) : void 0,
                        requestPath: a,
                        ...i ? {
                            cursor: i
                        } : {}
                    }
                }).then(({
                    data: e
                }) => e);
                if (!e || "object" != typeof e) return n.logger.error("getUserSponsorshipsFetcher: response is not an object", {
                    type: typeof e
                }), {
                    sponsorships: [],
                    next_cursor: ""
                };
                if (!Array.isArray(e.sponsorships)) return n.logger.error("getUserSponsorshipsFetcher: sponsorships is not an array", {
                    type: typeof e.sponsorships
                }), {
                    sponsorships: [],
                    next_cursor: "string" == typeof e.next_cursor ? e.next_cursor : ""
                };
                return {
                    sponsorships: e.sponsorships,
                    next_cursor: "string" == typeof e.next_cursor ? e.next_cursor : ""
                }
            } catch (e) {
                return (0, r.handleError)(e, "getUserSponsorshipsFetcher"), {
                    sponsorships: [],
                    next_cursor: ""
                }
            }
        };
    e.s(["getCurrentRewardsFetcher", 0, i, "getRewardLogsBatch", 0, l, "getSingleRewardFetcher", 0, a, "getTotalUserEarningsFetcher", 0, o, "getUserSponsorshipsFetcher", 0, d])
}, 911472, e => {
    "use strict";
    var t = e.i(93257),
        r = e.i(779690),
        n = e.i(196593),
        s = e.i(631222);
    let a = () => {
            let e = new Date().setUTCHours(0, 0, 0, 0),
                t = new Date().setUTCHours(23, 59, 59, 999),
                r = new Date(e),
                n = new Date(t),
                s = n.toISOString().split("T")[0];
            return {
                startTs: e,
                endTs: t,
                startDate: r,
                endDate: n,
                todayString: s
            }
        },
        i = {
            id: "2",
            coingeckoID: "usd-coin",
            name: "USDC",
            symbol: "usdc"
        },
        o = {
            id: "1",
            coingeckoID: "uma",
            name: "UMA",
            symbol: "uma"
        },
        l = {
            "0x3066818837c5e6ed6601bd5a91b0762877a6b731": o,
            "0x7d8610e9567d2a6c9fbf66a5a13e9ba8bb120d43": o,
            "0x2e8dcfe708d44ae2e406a1c02dfe2fa13012f961": i,
            [s.USDC_ADDRESS.toLowerCase()]: i
        },
        d = [{
            id: r.RewardProperty.Market,
            desc: !0
        }],
        c = e => {
            try {
                if ("number" != typeof e) return "-";
                let t = e;
                if ("string" == typeof e && (t = parseFloat(e)), e > 0) return `${(0,n.formatNumbers)(t)}%`;
                return "-"
            } catch {
                return "-"
            }
        };
    e.s(["MAX_TABLE_WIDTH", 0, 1300, "NUM_MARKETS_PER_PAGE", 0, 100, "computeRewardChangeStatusMap", 0, e => {
        if (!Array.isArray(e) || 0 === e.length) return {};
        let t = {};
        for (let r of e) t[r.condition_id] || (t[r.condition_id] = []), t[r.condition_id].push(r);
        let r = {},
            n = new Date(new Date().getTime() - 864e5);
        for (let [e, s] of Object.entries(t)) {
            let t, a = [...s].sort((e, t) => new Date(t.action_timestamp).getTime() - new Date(e.action_timestamp).getTime()),
                i = a[0],
                o = i ? .rate_per_day,
                l = a.filter(e => new Date(e.action_timestamp).getTime() <= n.getTime());
            l.length > 0 ? t = l[0] ? .rate_per_day : a.length > 1 && (t = a[1] ? .rate_per_day), "number" != typeof o || "number" != typeof t || void 0 === t ? r[e] = "unknown" : o > t ? r[e] = "increase" : o < t ? r[e] = "decrease" : r[e] = "no_change"
        }
        return r
    }, "formatClobTokenSupply", 0, e => {
        if (!e) return 0;
        try {
            let t = parseFloat(e ? ? "0");
            if (t < 1) return parseFloat(t.toFixed(2));
            return Math.floor(t)
        } catch {
            return 0
        }
    }, "formatEarnings", 0, e => "number" != typeof e ? "0" : e > 0 && e < .01 ? "<$0.01" : `$${(0,n.formatNumbers)(e)}`, "fromPageToCursor", 0, (e = 1) => {
        try {
            let r = "string" == typeof e ? parseFloat(e) : e;
            if (Number.isNaN(r)) return t.Buffer.from("0").toString("base64");
            return t.Buffer.from(((r > 0 ? r - 1 : 0) * 100).toString()).toString("base64")
        } catch {
            return t.Buffer.from("0").toString("base64")
        }
    }, "fromV4toRewardMarkets", 0, e => Array.isArray(e) ? e.map(e => {
        var t;
        let r = (!Array.isArray(t = e.rewards_config) ? [] : t.reduce((e, t) => {
                let r = e.find(e => e.asset_address === t.asset_address);
                if (!r) return e.push(t), e;
                let n = r.rate_per_day + t.rate_per_day,
                    s = r.total_rewards + t.total_rewards;
                return [{ ...r,
                    rate_per_day: n,
                    total_rewards: s
                }, ...e.filter(e => e.asset_address !== t.asset_address)]
            }, [])).map(t => {
                var r;
                let n = Array.isArray(e.earnings) ? e.earnings.reduce((e, t) => (e[t.asset_address] || (e[t.asset_address] = t.earnings * t.asset_rate), e), {}) : {};
                return {
                    clobTokenSupply: t.rate_per_day.toString(),
                    rewardToken: l[(r = t.asset_address).toLowerCase()] ? l[r.toLowerCase()] : i,
                    endDate: t.end_date,
                    startDate: t.start_date,
                    score: n[t.asset_address] ? ? 0,
                    assetAddress: t.asset_address
                }
            }),
            n = {
                clobTokenIds: e.tokens.map(e => e.token_id),
                conditionId: e.condition_id,
                eventSlug: e.event_slug,
                marketId: e.market_id,
                image: e.image,
                outcomePrices: e.tokens.map(e => e.price.toString()),
                outcomes: e.tokens.map(e => e.outcome),
                question: e.question,
                slug: e.market_slug
            },
            {
                startDate: s,
                endDate: o
            } = a();
        return {
            createdAt: s.toISOString(),
            market: n,
            maxSpread: e.rewards_max_spread,
            competitiveness: e.market_competitiveness,
            minSize: e.rewards_min_size,
            percent: e.earning_percentage,
            publishedAt: s.toISOString(),
            rewardEndDate: o.toISOString(),
            rewardTokenLiquidities: r,
            spread: e.spread,
            tokens: [...e.tokens]
        }
    }) : [], "generatePagination", 0, function(e, t) {
        let r, n = Math.max(Math.max(4 - (t - e), 1), Math.max(4 - (e - 1), 1)),
            s = e - n,
            a = e + n + 1,
            i = [],
            o = [];
        for (let e = 1; e <= t; e++)(1 === e || e === t || e >= s && e < a) && i.push(e);
        for (let e = 0; e < i.length; e++) {
            let t = i[e];
            r && (t - r == 2 ? o.push(r + 1) : t - r != 1 && o.push(null)), o.push(t), r = t
        }
        return o
    }, "getConditionIdsWithRemovedRewards", 0, e => {
        if (!Array.isArray(e) || 0 === e.length) return new Set;
        let t = new Set,
            r = {};
        for (let t of e) r[t.condition_id] || (r[t.condition_id] = []), r[t.condition_id].push(t);
        for (let [e, n] of Object.entries(r)) {
            let r = [...n].sort((e, t) => new Date(t.action_timestamp).getTime() - new Date(e.action_timestamp).getTime());
            r[0] ? .action === "delete" && t.add(e)
        }
        return t
    }, "getNextSortingState", 0, (e, t) => {
        if (!Array.isArray(e) || !Array.isArray(t)) return d;
        let {
            desc: r
        } = e[0], {
            id: n,
            desc: s
        } = t[0];
        return !1 === s && !1 === r ? [{
            id: n,
            desc: !0
        }] : t
    }, "getNextTagState", 0, (e, t) => {
        if (!e || !t || "all" === e || t === e) return "all";
        let r = t.split(",").filter(e => "" !== e);
        if (!Array.isArray(r) || 0 === r.length) return "all";
        let n = r.filter(e => "all" !== e);
        return n.includes(e) ? n.filter(t => t !== e).join(",") : n.concat(e).join(",")
    }, "getQueryStateFromSearch", 0, e => {
        let t = e ? .q ? ? "";
        return t || e.id !== r.RewardProperty.Market ? e.id !== r.RewardProperty.Market && e.id ? { ...e,
            q: t
        } : { ...e,
            id: r.RewardProperty.Market,
            desc: !1,
            q: t
        } : { ...e,
            desc: !0
        }
    }, "getSortingState", 0, e => {
        if (!e) return d;
        let {
            id: t,
            desc: r
        } = e;
        return "string" != typeof t || "string" != typeof r ? d : "string" == typeof t && "string" == typeof r ? [{
            id: t,
            desc: "true" === r
        }] : d
    }, "getUtcDayStartAndEnd", 0, a, "hasPercent", 0, e => "-" !== c(e), "hasRewardsConfig", 0, e => Array.isArray(e ? .clobRewards) && e.clobRewards.length > 0 && "number" == typeof e.rewardsMaxSpread && e.rewardsMaxSpread > 0 && "number" == typeof e.rewardsMinSize && e.rewardsMinSize > 0, "parsePercent", 0, c, "sumTotalDailyRewards", 0, e => Array.isArray(e) ? e.reduce((e, t) => (Number.isFinite(t.asset_rate) && Number.isFinite(t.earnings) && (e += t.asset_rate * t.earnings), e), 0) : 0])
}, 780641, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(784521),
        n = e.i(684686),
        s = e.i(799471),
        a = e.i(210308);

    function i(e) {
        return e.permissions
    }
    e.s(["usePermissions", 0, () => {
        let e, o, l, d = (0, t.c)(6),
            c = (0, n.useGeoStore)(i);
        d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress", "closedDynamic"], d[0] = e) : e = d[0];
        let {
            proxyAddress: u,
            closedDynamic: p
        } = (0, r.useAccountContext)(e);
        return d[1] !== p || d[2] !== c || d[3] !== u ? (o = () => (0, s.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(u, c, p), l = [c, u, p], d[1] = p, d[2] = c, d[3] = u, d[4] = o, d[5] = l) : (o = d[4], l = d[5]), (0, a.useDeepCompareMemo)(o, l)
    }])
}, 420473, 150035, e => {
    "use strict";
    var t, r, n, s, a, i, o, l = e.i(999061),
        d = e.i(416340),
        c = ((t = {}).Value = "Current value", t.Investment = "Traded", t.PercentageGain = "Profit & Loss %", t.DollarGain = "Profit & Loss $", t.Quantity = "Shares", t.Market = "Alphabetically", t.Resolution = "Ending soon", t.ToWin = "Payout", t.LatestPrice = "Latest Price", t.AverageCostPerShare = "Average cost per share", t),
        u = ((r = {}).Asc = "asc", r.Desc = "desc", r),
        p = ((n = {}).Market = "Market", n.FilledQty = "Filled Quantity", n.TotalQty = "Total Quantity", n.OrderDate = "Order Date", n.Resolution = "Resolving Soonest", n),
        m = ((s = {}).Newest = "Newest", s.Oldest = "Oldest", s.ValueDesc = "Value", s.ShareQtyDesc = "Shares", s),
        y = ((a = {}).StartDate = "Start date", a.EndDate = "End date", a.CurrentValue = "Current value", a.DailyRate = "Daily rate", a.Alphabetically = "Alphabetically", a),
        x = ((i = {}).All = "All", i.AllTrades = "Trades", i.Buy = "Buy", i.Merge = "Merge", i.Redeem = "Redeem", i.Reward = "Liquidity Rewards", i.ReferralReward = "Referral Rewards", i.Yield = "Holding Rewards", i.Sell = "Sell", i.Split = "Split", i.Convert = "Convert", i.Lost = "Lost", i.Deposit = "Deposit", i.Withdraw = "Withdraw", i.MakerRebate = "Maker Rebate", i);
    e.s(["ActionTypeFilterTransactionHistoryVariables", () => x, "SortPortfolioHistoryVariables", () => m, "SortPortfolioMarketDirectionVariables", () => u, "SortPortfolioMarketVariables", () => c, "SortPortfolioOpenOrderVariables", () => p, "SortPortfolioSponsorshipsVariables", () => y, "default", 0, () => {
        let e, t = (0, l.c)(7),
            [r, n] = (0, d.useState)("Current value"),
            [s, a] = (0, d.useState)("desc"),
            [i, o] = (0, d.useState)("Market"),
            [c, u] = (0, d.useState)("Newest"),
            [p, m] = (0, d.useState)("Start date"),
            [y, x] = (0, d.useState)("desc");
        return t[0] !== c || t[1] !== r || t[2] !== s || t[3] !== i || t[4] !== p || t[5] !== y ? (e = {
            sortPortfolioMarketsBy: r,
            setSortPortfolioMarketsBy: n,
            sortPortfolioOpenOrdersBy: i,
            setSortPortfolioOpenOrdersBy: o,
            sortPortfolioHistoryBy: c,
            setSortPortfolioHistoryBy: u,
            sortPortfolioMarketsDirection: s,
            setSortPortfolioMarketsDirection: a,
            sortPortfolioSponsorshipsBy: p,
            setSortPortfolioSponsorshipsBy: m,
            sortPortfolioSponsorshipsDirection: y,
            setSortPortfolioSponsorshipsDirection: x
        }, t[0] = c, t[1] = r, t[2] = s, t[3] = i, t[4] = p, t[5] = y, t[6] = e) : e = t[6], e
    }], 150035);
    var h = ((o = {}).Positions = "positions", o.Orders = "Open orders", o.CancelledOrders = "cancelled-orders", o.History = "history", o.MarketRewards = "market-rewards", o);
    e.s(["PortfolioTab", () => h], 420473)
}, 720155, e => {
    "use strict";
    e.s(["RewardsAbi", 0, [{
        type: "constructor",
        inputs: [{
            name: "owner_",
            type: "address",
            internalType: "address"
        }, {
            name: "keeper_",
            type: "address",
            internalType: "address"
        }, {
            name: "rewardToken_",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "REWARD_TOKEN",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "batchWithdraw",
        inputs: [{
            name: "marketIds",
            type: "bytes32[]",
            internalType: "bytes32[]"
        }, {
            name: "sponsorAddrs",
            type: "address[]",
            internalType: "address[]"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "claimed",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        outputs: [{
            name: "",
            type: "uint256",
            internalType: "uint256"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "closeMarket",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "oracleClosedAt",
            type: "uint32",
            internalType: "uint32"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "createMarket",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "startTime",
            type: "uint32",
            internalType: "uint32"
        }, {
            name: "minSponsorDuration",
            type: "uint32",
            internalType: "uint32"
        }, {
            name: "minSponsorAmount",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "marketData",
            type: "bytes",
            internalType: "bytes"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "distributeRewards",
        inputs: [{
            name: "recipients",
            type: "address[]",
            internalType: "address[]"
        }, {
            name: "amounts",
            type: "uint256[]",
            internalType: "uint256[]"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "getConsumedAndUnspent",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "sponsorAddr",
            type: "address",
            internalType: "address"
        }],
        outputs: [{
            name: "",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "",
            type: "uint256",
            internalType: "uint256"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "isKeeper",
        inputs: [{
            name: "_keeper",
            type: "address",
            internalType: "address"
        }],
        outputs: [{
            name: "",
            type: "bool",
            internalType: "bool"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "markets",
        inputs: [{
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }],
        outputs: [{
            name: "marketId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "startTime",
            type: "uint32",
            internalType: "uint32"
        }, {
            name: "endTime",
            type: "uint32",
            internalType: "uint32"
        }, {
            name: "minSponsorDuration",
            type: "uint32",
            internalType: "uint32"
        }, {
            name: "minSponsorAmount",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "marketData",
            type: "bytes",
            internalType: "bytes"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "merkleRoot",
        inputs: [],
        outputs: [{
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "owner",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "refundSponsors",
        inputs: [{
            name: "sponsorAddrs",
            type: "address[]",
            internalType: "address[]"
        }, {
            name: "amounts",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "marketIds",
            type: "bytes32[]",
            internalType: "bytes32[]"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "registerKeeper",
        inputs: [{
            name: "newKeeper",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "setPausedStatus",
        inputs: [{
            name: "newPaused",
            type: "bool",
            internalType: "bool"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "sponsor",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "amount",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "startTime",
            type: "uint32",
            internalType: "uint32"
        }, {
            name: "endTime",
            type: "uint32",
            internalType: "uint32"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "sponsorInfo",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }],
        outputs: [{
            name: "deposited",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "ratePerMinute",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "startTime",
            type: "uint32",
            internalType: "uint32"
        }, {
            name: "endTime",
            type: "uint32",
            internalType: "uint32"
        }, {
            name: "isActive",
            type: "bool",
            internalType: "bool"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "sweep",
        inputs: [{
            name: "token",
            type: "address",
            internalType: "address"
        }, {
            name: "recipient",
            type: "address",
            internalType: "address"
        }, {
            name: "amount",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "transferOwnership",
        inputs: [{
            name: "newOwner",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "unregisterKeeper",
        inputs: [{
            name: "_keeper",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "withdraw",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "sponsorAddr",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "event",
        name: "DistributedRewards",
        inputs: [{
            name: "user",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "amount",
            type: "uint256",
            indexed: !1,
            internalType: "uint256"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "KeeperRegistered",
        inputs: [{
            name: "newKeeper",
            type: "address",
            indexed: !0,
            internalType: "address"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "KeeperUnregistered",
        inputs: [{
            name: "keeper",
            type: "address",
            indexed: !0,
            internalType: "address"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "MarketClosed",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            indexed: !0,
            internalType: "bytes32"
        }, {
            name: "closedAt",
            type: "uint32",
            indexed: !1,
            internalType: "uint32"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "MarketCreated",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            indexed: !0,
            internalType: "bytes32"
        }, {
            name: "startTime",
            type: "uint32",
            indexed: !1,
            internalType: "uint32"
        }, {
            name: "minSponsorDuration",
            type: "uint32",
            indexed: !1,
            internalType: "uint32"
        }, {
            name: "minSponsorAmount",
            type: "uint256",
            indexed: !1,
            internalType: "uint256"
        }, {
            name: "marketData",
            type: "bytes",
            indexed: !1,
            internalType: "bytes"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "OwnershipTransferred",
        inputs: [{
            name: "previousOwner",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "newOwner",
            type: "address",
            indexed: !0,
            internalType: "address"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "PausedStatusChanged",
        inputs: [{
            name: "newPaused",
            type: "bool",
            indexed: !1,
            internalType: "bool"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "SponsorRefunded",
        inputs: [{
            name: "sponsor",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "amount",
            type: "uint256",
            indexed: !1,
            internalType: "uint256"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "Sponsored",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            indexed: !0,
            internalType: "bytes32"
        }, {
            name: "sponsor",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "amount",
            type: "uint256",
            indexed: !1,
            internalType: "uint256"
        }, {
            name: "startTime",
            type: "uint32",
            indexed: !1,
            internalType: "uint32"
        }, {
            name: "endTime",
            type: "uint32",
            indexed: !1,
            internalType: "uint32"
        }, {
            name: "ratePerMinute",
            type: "uint256",
            indexed: !1,
            internalType: "uint256"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "Swept",
        inputs: [{
            name: "token",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "recipient",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "amount",
            type: "uint256",
            indexed: !1,
            internalType: "uint256"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "Withdrawn",
        inputs: [{
            name: "marketId",
            type: "bytes32",
            indexed: !0,
            internalType: "bytes32"
        }, {
            name: "sponsor",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "recipient",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "returnedAmount",
            type: "uint256",
            indexed: !1,
            internalType: "uint256"
        }, {
            name: "consumedAmount",
            type: "uint256",
            indexed: !1,
            internalType: "uint256"
        }, {
            name: "isEarlyWithdraw",
            type: "bool",
            indexed: !1,
            internalType: "bool"
        }],
        anonymous: !1
    }, {
        type: "error",
        name: "ErrAfterEndTime",
        inputs: []
    }, {
        type: "error",
        name: "ErrAmountTooHigh",
        inputs: []
    }, {
        type: "error",
        name: "ErrAmountTooLow",
        inputs: []
    }, {
        type: "error",
        name: "ErrBeforeStartTime",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidClosureTimestamp",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidMarketId",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidMinAmount",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidMinDuration",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidProof",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidRate",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidSponsorDuration",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidStartTime",
        inputs: []
    }, {
        type: "error",
        name: "ErrInvalidTimeConfig",
        inputs: []
    }, {
        type: "error",
        name: "ErrLengthMismatch",
        inputs: []
    }, {
        type: "error",
        name: "ErrMarketAlreadyExists",
        inputs: []
    }, {
        type: "error",
        name: "ErrMarketClosed",
        inputs: []
    }, {
        type: "error",
        name: "ErrMarketDoesNotExist",
        inputs: []
    }, {
        type: "error",
        name: "ErrMerkleRootUnset",
        inputs: []
    }, {
        type: "error",
        name: "ErrNoNewAmount",
        inputs: []
    }, {
        type: "error",
        name: "ErrSponsorActive",
        inputs: []
    }, {
        type: "error",
        name: "ErrSponsorInactive",
        inputs: []
    }, {
        type: "error",
        name: "ErrUnauthorized",
        inputs: []
    }, {
        type: "error",
        name: "ErrZeroAddress",
        inputs: []
    }, {
        type: "error",
        name: "OwnableInvalidKeeper",
        inputs: [{
            name: "owner",
            type: "address",
            internalType: "address"
        }]
    }, {
        type: "error",
        name: "OwnableInvalidOwner",
        inputs: [{
            name: "owner",
            type: "address",
            internalType: "address"
        }]
    }, {
        type: "error",
        name: "OwnableUnauthorizedAccount",
        inputs: [{
            name: "account",
            type: "address",
            internalType: "address"
        }]
    }, {
        type: "error",
        name: "PausedStatusMismatch",
        inputs: [{
            name: "expectedPauseStatus",
            type: "bool",
            internalType: "bool"
        }]
    }, {
        type: "error",
        name: "ReentrancyGuardReentrantCall",
        inputs: []
    }, {
        type: "error",
        name: "SafeCastOverflowedUintDowncast",
        inputs: [{
            name: "bits",
            type: "uint8",
            internalType: "uint8"
        }, {
            name: "value",
            type: "uint256",
            internalType: "uint256"
        }]
    }, {
        type: "error",
        name: "SafeERC20FailedOperation",
        inputs: [{
            name: "token",
            type: "address",
            internalType: "address"
        }]
    }]])
}, 14849, 651958, e => {
    "use strict";
    e.s(["ACTIVE_SPONSORSHIP_REQUEST_PATH", 0, "/rewards/user/activesponsorship", "USER_SPONSORSHIPS_REQUEST_PATH", 0, "/rewards/user/sponsorships"], 14849);
    var t = e.i(461327),
        r = e.i(165974);
    let n = (0, e.i(575339).createWithEqualityFn)()((0, t.persist)((0, r.immer)(e => ({
        pendingSponsorships: [],
        addPendingSponsorship: t => {
            e(e => {
                e.pendingSponsorships = e.pendingSponsorships.filter(e => e.conditionId !== t.conditionId || e.proxyAddress.toLowerCase() !== t.proxyAddress.toLowerCase()), e.pendingSponsorships.push(t)
            })
        },
        removePendingSponsorship: t => {
            e(e => {
                e.pendingSponsorships = e.pendingSponsorships.filter(e => e.conditionId !== t)
            })
        },
        clearExpired: () => {
            e(e => {
                let t = Date.now();
                e.pendingSponsorships = e.pendingSponsorships.filter(e => t - e.createdAt < 9e5)
            })
        }
    })), {
        name: "polymarket.store.pending-sponsorships",
        version: 1
    }));
    e.s(["usePendingSponsorshipsStore", 0, n], 651958)
}, 513757, 962316, 249611, e => {
    "use strict";
    var t = e.i(720155),
        r = e.i(200036),
        n = e.i(631222),
        s = e.i(392566);
    let a = {
        contractAddress: n.REWARDS_CONTRACT_ADDRESS,
        isOldContract: !1
    };

    function i(e) {
        if (!e || !Array.isArray(e)) return !1;
        let t = e[1];
        return ("number" == typeof t || "bigint" == typeof t) && Number(t) > 0
    }
    async function o(e) {
        let o = (0, s.startCtfV2Timer)(),
            l = (0, r.createChainAwarePublicClient)({
                chainId: n.MATIC_CONFIG.chainId
            }),
            d = e.startsWith("0x") ? e : `0x${e}`,
            [c, u] = await Promise.all([l.readContract({
                address: n.REWARDS_CONTRACT_ADDRESS,
                abi: t.RewardsAbi,
                functionName: "markets",
                args: [d]
            }).then(e => ({
                ok: !0,
                result: e,
                error: void 0
            })).catch(e => ({
                ok: !1,
                result: null,
                error: e
            })), l.readContract({
                address: n.OLD_REWARDS_CONTRACT_ADDRESS,
                abi: t.RewardsAbi,
                functionName: "markets",
                args: [d]
            }).then(e => ({
                ok: !0,
                result: e,
                error: void 0
            })).catch(e => ({
                ok: !1,
                result: null,
                error: e
            }))]);
        return i(c.result) ? ((0, s.ctfV2Info)("rewards_contract_resolved", {
            selectedContract: "new",
            newReadOk: c.ok,
            oldReadOk: u.ok,
            durationMs: (0, s.durationSince)(o)
        }), {
            contractAddress: n.REWARDS_CONTRACT_ADDRESS,
            isOldContract: !1
        }) : i(u.result) ? ((0, s.ctfV2Info)("rewards_contract_resolved", {
            selectedContract: "old",
            newReadOk: c.ok,
            oldReadOk: u.ok,
            durationMs: (0, s.durationSince)(o)
        }), {
            contractAddress: n.OLD_REWARDS_CONTRACT_ADDRESS,
            isOldContract: !0
        }) : (c.ok && u.ok ? (0, s.ctfV2Info)("rewards_contract_resolved", {
            selectedContract: "default_new",
            newReadOk: c.ok,
            oldReadOk: u.ok,
            durationMs: (0, s.durationSince)(o)
        }) : (0, s.ctfV2Warn)("rewards_contract_resolution_degraded", {
            selectedContract: "default_new",
            newReadOk: c.ok,
            oldReadOk: u.ok,
            durationMs: (0, s.durationSince)(o),
            newReadError: c.error ? (0, s.getErrorTelemetry)(c.error).errorMessage : void 0,
            oldReadError: u.error ? (0, s.getErrorTelemetry)(u.error).errorMessage : void 0
        }), a)
    }
    e.s(["resolveRewardsContract", 0, o], 513757), e.s(["MAX_DURATION_DAYS", 0, 90, "MIN_AMOUNT", 0, 2], 962316);
    let l = e => 2 * Math.max(e, 1);
    e.s(["calculateDailyRate", 0, (e, t) => e <= 0 || t <= 0 ? 0 : e / t, "getMinAmountForDuration", 0, l, "getSponsorButtonConfig", 0, function({
        isRestricted: e,
        isPending: t,
        isUserSponsor: r,
        needsEnableTrading: n,
        t: s
    }) {
        return n ? {
            text: s ? .("auth.enableTrading") ? ? "Enable Trading",
            className: "bg-[#0c4fe4] hover:bg-[#0a3fc7] dark:bg-[#2C9CDB] dark:hover:bg-[#2590c4] text-white"
        } : e ? {
            text: s ? .("rewards.sponsor.unavailable") ? ? "Unavailable",
            className: "bg-gray-400 text-white cursor-not-allowed"
        } : t ? {
            text: s ? .("rewards.sponsor.trackOrder") ? ? "Track order",
            className: "bg-green-500 hover:bg-green-600 text-white"
        } : r ? {
            text: s ? .("rewards.sponsor.marketSponsored") ? ? "Market Sponsored",
            className: "bg-green-500 hover:bg-green-600 text-white"
        } : {
            text: s ? .("rewards.addRewards") ? ? "Add Rewards",
            className: "bg-[#0c4fe4] hover:bg-[#0a3fc7] dark:bg-[#2C9CDB] dark:hover:bg-[#2590c4] text-white"
        }
    }, "isAmountViableForDuration", 0, (e, t) => e >= l(t), "parseAmount", 0, e => {
        let t = parseFloat(e);
        return Number.isNaN(t) ? 0 : t
    }, "truncateQuestion", 0, (e, t = 25) => {
        if (e.length <= t) return e;
        let r = " ... ",
            n = t - r.length,
            s = Math.ceil(.6 * n),
            a = n - s;
        return `${e.slice(0,s)}${r}${e.slice(-a)}`
    }], 249611)
}, 137320, 198841, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconMinusOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("line", {
        x1: "3.25",
        y1: "9",
        x2: "14.75",
        y2: "9",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))], 137320), e.s(["IconCircleWarningOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("path", {
        d: "M9 16.25C13.0041 16.25 16.25 13.004 16.25 9C16.25 4.996 13.0041 1.75 9 1.75C4.9959 1.75 1.75 4.996 1.75 9C1.75 13.004 4.9959 16.25 9 16.25Z",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M9 5.431V9.5",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M9 13.417C8.448 13.417 8 12.968 8 12.417C8 11.866 8.448 11.417 9 11.417C9.552 11.417 10 11.866 10 12.417C10 12.968 9.552 13.417 9 13.417Z",
        fill: "currentColor",
        "data-color": "color-2",
        "data-stroke": "none"
    }))], 198841)
}, 529812, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconRefreshOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("path", {
        d: "M5.25 9.5L3 7.25L0.75 9.5",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M13.495 13.345C12.3587 14.5226 10.7641 15.25 9 15.25C5.548 15.25 2.75 12.45 2.75 9C2.75 8.4 2.834 7.83003 2.99 7.28003",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M12.75 8.5L15 10.75L17.25 8.5",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M4.50629 4.65564C5.64249 3.48544 7.23658 2.75 8.99998 2.75C12.452 2.75 15.25 5.55 15.25 9C15.25 9.58 15.171 10.14 15.024 10.67",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }))])
}, 313305, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(964974),
        s = e.i(416340),
        a = e.i(204062),
        i = e.i(510954),
        o = e.i(57096),
        l = e.i(399336),
        d = e.i(911472);
    let c = (0, s.createContext)(void 0),
        u = (0, s.createContext)(void 0),
        p = (0, s.createContext)(!1),
        m = (0, s.createContext)(() => {}),
        y = (0, s.createContext)(void 0),
        x = (0, s.createContext)(void 0),
        h = () => (0, s.useContext)(c),
        f = () => (0, s.useContext)(u),
        w = () => (0, s.useContext)(m),
        b = () => (0, s.useContext)(y),
        g = () => (0, s.useContext)(x);

    function v() {}
    e.s(["MarketRewardContextProvider", 0, e => {
        let h, f, w, b, g, v, k, S, T, C = (0, r.c)(22),
            {
                children: j
            } = e;
        C[0] === Symbol.for("react.memo_cache_sentinel") ? (h = ["activeMarket"], C[0] = h) : h = C[0];
        let {
            activeMarket: R
        } = (0, l.useEventActiveMarketContext)(h), [_, A] = (0, s.useState)(!1), [D, M] = (0, s.useState)(null);
        C[1] !== R.conditionId ? (f = i.queryKeys[o.QueryKey.Rewards].rewardMarket(R.conditionId), C[1] = R.conditionId, C[2] = f) : f = C[2];
        let N = !!R ? .conditionId;
        C[3] !== f.queryKey || C[4] !== N ? (w = {
            queryKey: f.queryKey,
            queryFn: a.getSingleRewardFetcher,
            enabled: N,
            staleTime: 3e4,
            gcTime: 6e4,
            refetchInterval: 6e4,
            retry: 2,
            retryDelay: 5e3
        }, C[3] = f.queryKey, C[4] = N, C[5] = w) : w = C[5];
        let {
            data: P
        } = (0, n.useQuery)(w);
        P ? .data;
        let I = P ? .data;
        C[6] !== I ? (b = (0, d.fromV4toRewardMarkets)(I), C[6] = I, C[7] = b) : b = C[7];
        let E = b,
            O = Array.isArray(E) ? E[0] : void 0;
        return C[8] !== j ? (g = (0, t.jsx)(m.Provider, {
            value: A,
            children: j
        }), C[8] = j, C[9] = g) : g = C[9], C[10] !== _ || C[11] !== g ? (v = (0, t.jsx)(x.Provider, {
            value: M,
            children: (0, t.jsx)(p.Provider, {
                value: _,
                children: g
            })
        }), C[10] = _, C[11] = g, C[12] = v) : v = C[12], C[13] !== D || C[14] !== v ? (k = (0, t.jsx)(y.Provider, {
            value: D,
            children: v
        }), C[13] = D, C[14] = v, C[15] = k) : k = C[15], C[16] !== R || C[17] !== k ? (S = (0, t.jsx)(u.Provider, {
            value: R,
            children: k
        }), C[16] = R, C[17] = k, C[18] = S) : S = C[18], C[19] !== O || C[20] !== S ? (T = (0, t.jsx)(c.Provider, {
            value: O,
            children: S
        }), C[19] = O, C[20] = S, C[21] = T) : T = C[21], T
    }, "useMarketRewardContext", 0, function() {
        let e, t = (0, r.c)(7),
            n = h(),
            a = f(),
            i = (0, s.useContext)(p),
            o = w(),
            l = b() ? ? null,
            d = g() ? ? v;
        return t[0] !== a || t[1] !== l || t[2] !== n || t[3] !== d || t[4] !== o || t[5] !== i ? (e = {
            rewardMarket: n,
            activeMarket: a,
            setShouldShowRewardOverlay: o,
            shouldShowRewardOverlay: i,
            openRewardsTooltipId: l,
            setOpenRewardsTooltipId: d
        }, t[0] = a, t[1] = l, t[2] = n, t[3] = d, t[4] = o, t[5] = i, t[6] = e) : e = t[6], e
    }, "useRewardActiveMarketContext", 0, f, "useRewardMarketContext", 0, h, "useRewardOpenTooltipIdContext", 0, b, "useRewardOpenTooltipIdSetterContext", 0, g, "useRewardOverlaySetterContext", 0, w])
}, 650367, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061);
    e.i(416340);
    let n = e => {
            let n, s, a, i, o, l = (0, r.c)(7);
            return l[0] !== e ? ({ ...n
            } = e, l[0] = e, l[1] = n) : n = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("circle", {
                cx: "250",
                cy: "250",
                r: "250",
                fill: "#FF4A4A"
            }), l[2] = s) : s = l[2], l[3] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsxs)("g", {
                clipPath: "url(#clip0_2961_1052)",
                children: [(0, t.jsx)("path", {
                    fillRule: "evenodd",
                    clipRule: "evenodd",
                    d: "M306.591 299.978H289.54C286.337 299.978 283.741 297.388 283.741 294.197V249.263L253.81 267.977C251.299 269.548 248.106 269.548 245.595 267.977L215.665 249.261V294.197C215.665 297.388 213.067 299.978 209.866 299.978H192.815C189.61 299.978 187.016 297.388 187.016 294.197V207.592C187.016 201.391 193.986 197.728 199.116 201.233L246.426 233.548C248.4 234.899 251.006 234.899 252.981 233.548L300.287 201.233C305.42 197.726 312.39 201.389 312.39 207.59V294.197C312.39 297.388 309.794 299.978 306.591 299.978Z",
                    fill: "white"
                }), (0, t.jsx)("path", {
                    fillRule: "evenodd",
                    clipRule: "evenodd",
                    d: "M161.337 299.208L55.7068 299.206C51.4572 299.206 48.0117 295.769 48.0117 291.529V204.757C48.0117 201.577 50.5953 199 53.783 199H70.7525C73.9382 199 76.5238 201.577 76.5238 204.757V270.762L140.52 270.764V204.757C140.52 201.577 143.101 199 146.291 199H163.26C166.446 199 169.032 201.577 169.032 204.757V291.531C169.032 295.77 165.586 299.208 161.337 299.208Z",
                    fill: "white"
                }), (0, t.jsx)("path", {
                    fillRule: "evenodd",
                    clipRule: "evenodd",
                    d: "M337.832 199L443.462 199.002C447.711 199.002 451.157 202.439 451.157 206.678V293.45C451.157 296.63 448.571 299.208 445.385 299.208H428.416C425.228 299.208 422.645 296.63 422.645 293.45V231.284C422.645 229.165 420.921 227.445 418.797 227.445L362.496 227.443C360.372 227.443 358.649 229.161 358.649 231.282V293.45C358.649 296.63 356.065 299.208 352.877 299.208H335.908C332.72 299.208 330.137 296.63 330.137 293.45V206.677C330.137 202.437 333.582 199 337.832 199Z",
                    fill: "white"
                }), (0, t.jsx)("path", {
                    fillRule: "evenodd",
                    clipRule: "evenodd",
                    d: "M376.383 251.74V268.823C376.383 271.982 378.969 274.542 382.159 274.542H399.127C402.318 274.542 404.903 271.982 404.903 268.823V251.74C404.903 248.582 402.318 246.021 399.127 246.021H382.159C378.969 246.021 376.383 248.582 376.383 251.74Z",
                    fill: "white"
                })]
            }), l[3] = a) : a = l[3], l[4] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("defs", {
                children: (0, t.jsx)("clipPath", {
                    id: "clip0_2961_1052",
                    children: (0, t.jsx)("rect", {
                        width: "403.143",
                        height: "102.993",
                        fill: "white",
                        transform: "translate(48 199)"
                    })
                })
            }), l[4] = i) : i = l[4], l[5] !== n ? (o = (0, t.jsxs)("svg", {
                width: "500",
                height: "500",
                viewBox: "0 0 500 500",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...n,
                children: [s, a, i]
            }), l[5] = n, l[6] = o) : o = l[6], o
        },
        s = e => {
            let n, s, a, i, o, l = (0, r.c)(7);
            return l[0] !== e ? ({ ...n
            } = e, l[0] = e, l[1] = n) : n = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("path", {
                d: "M1000 2000c554.17 0 1000-445.83 1000-1000S1554.17 0 1000 0 0 445.83 0 1000s445.83 1000 1000 1000z",
                fill: "#2775ca"
            }), a = (0, t.jsx)("path", {
                d: "M1275 1158.33c0-145.83-87.5-195.83-262.5-216.66-125-16.67-150-50-150-108.34s41.67-95.83 125-95.83c75 0 116.67 25 137.5 87.5 4.17 12.5 16.67 20.83 29.17 20.83h66.66c16.67 0 29.17-12.5 29.17-29.16v-4.17c-16.67-91.67-91.67-162.5-187.5-170.83v-100c0-16.67-12.5-29.17-33.33-33.34h-62.5c-16.67 0-29.17 12.5-33.34 33.34v95.83c-125 16.67-204.16 100-204.16 204.17 0 137.5 83.33 191.66 258.33 212.5 116.67 20.83 154.17 45.83 154.17 112.5s-58.34 112.5-137.5 112.5c-108.34 0-145.84-45.84-158.34-108.34-4.16-16.66-16.66-25-29.16-25h-70.84c-16.66 0-29.16 12.5-29.16 29.17v4.17c16.66 104.16 83.33 179.16 220.83 200v100c0 16.66 12.5 29.16 33.33 33.33h62.5c16.67 0 29.17-12.5 33.34-33.33v-100c125-20.84 208.33-108.34 208.33-220.84z",
                fill: "#fff"
            }), i = (0, t.jsx)("path", {
                d: "M787.5 1595.83c-325-116.66-491.67-479.16-370.83-800 62.5-175 200-308.33 370.83-370.83 16.67-8.33 25-20.83 25-41.67V325c0-16.67-8.33-29.17-25-33.33-4.17 0-12.5 0-16.67 4.16-395.83 125-612.5 545.84-487.5 941.67 75 233.33 254.17 412.5 487.5 487.5 16.67 8.33 33.34 0 37.5-16.67 4.17-4.16 4.17-8.33 4.17-16.66v-58.34c0-12.5-12.5-29.16-25-37.5zM1229.17 295.83c-16.67-8.33-33.34 0-37.5 16.67-4.17 4.17-4.17 8.33-4.17 16.67v58.33c0 16.67 12.5 33.33 25 41.67 325 116.66 491.67 479.16 370.83 800-62.5 175-200 308.33-370.83 370.83-16.67 8.33-25 20.83-25 41.67V1700c0 16.67 8.33 29.17 25 33.33 4.17 0 12.5 0 16.67-4.16 395.83-125 612.5-545.84 487.5-941.67-75-237.5-258.34-416.67-487.5-491.67z",
                fill: "#fff"
            }), l[2] = s, l[3] = a, l[4] = i) : (s = l[2], a = l[3], i = l[4]), l[5] !== n ? (o = (0, t.jsxs)("svg", {
                "data-name": "86977684-12db-4850-8f30-233a7c267d11",
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 2000 2000",
                ...n,
                children: [s, a, i]
            }), l[5] = n, l[6] = o) : o = l[6], o
        },
        a = (e, r = 20) => "uma" === e.symbol ? (0, t.jsx)(n, {
            height: `${r}px`,
            width: `${r}px`
        }) : (0, t.jsx)(s, {
            height: `${r}px`,
            width: `${r}px`
        });
    e.s(["IconWithAmount", 0, e => {
        let n, s, i, o = (0, r.c)(8),
            {
                rewardToken: l,
                amount: d,
                isNotLast: c
            } = e,
            u = `flex items-center ${c?"mb-1":"mb-0"}`;
        return o[0] !== l ? (n = a(l, 16), o[0] = l, o[1] = n) : n = o[1], o[2] !== d ? (s = (0, t.jsx)("p", {
            className: "ml-1 text-sm font-normal",
            children: d
        }), o[2] = d, o[3] = s) : s = o[3], o[4] !== u || o[5] !== n || o[6] !== s ? (i = (0, t.jsxs)("div", {
            className: u,
            children: [n, s]
        }), o[4] = u, o[5] = n, o[6] = s, o[7] = i) : i = o[7], i
    }, "renderTokenIcon", 0, a], 650367)
}, 693076, 806326, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(964974);
    e.i(416340);
    var n = e.i(16674),
        s = e.i(873054),
        a = e.i(720155),
        i = e.i(468462),
        o = e.i(14849),
        l = e.i(651958),
        d = e.i(784521),
        c = e.i(631222),
        u = e.i(491636),
        p = e.i(991092);
    async function m(e, t, r) {
        let n = new URLSearchParams({
                walletMode: t,
                conditionId: e,
                l2Headers: JSON.stringify(r),
                requestPath: o.ACTIVE_SPONSORSHIP_REQUEST_PATH
            }),
            s = await fetch(`/api/rewards/activesponsorship?${n}`, {
                cache: "no-store"
            });
        if (!s.ok) throw Error(`Failed to fetch active sponsorship: ${s.status}`);
        return s.json()
    }

    function y(e) {
        return e.pendingSponsorships
    }
    e.s(["fetchActiveSponsorship", 0, m, "toExistingSponsorship", 0, function(e) {
        let t = new Date(e.start_time),
            r = new Date(e.end_time);
        if (!(0, p.isValid)(t) || !(0, p.isValid)(r)) return {
            dailyRate: 0,
            endDate: "--",
            endTime: "--",
            amount: 0,
            daysRemaining: 0,
            refundAmount: 0
        };
        let n = e.market_end_time ? new Date(Math.min(r.getTime(), new Date(e.market_end_time).getTime())) : r,
            s = Math.max(0, (n.getTime() - t.getTime()) / 1e3);
        return {
            dailyRate: 86400 * e.rate_per_second,
            endDate: (0, u.format)(n, "MMM d, yyyy"),
            endTime: (0, u.format)(n, "h:mm a"),
            amount: e.rate_per_second * s,
            daysRemaining: Math.max(0, Math.ceil((n.getTime() - Date.now()) / 864e5)),
            refundAmount: e.refund_amount ? Math.max(0, e.refund_amount) : 0
        }
    }], 806326), e.s(["useMarketSponsorshipStatus", 0, function(e) {
        let u, p, x, h, f, w, b, g, v, k, S, T, C, j = (0, t.c)(46),
            {
                conditionId: R,
                enabled: _,
                isSponsorableOverride: A
            } = e,
            D = void 0 === _ || _;
        j[0] === Symbol.for("react.memo_cache_sentinel") ? (u = ["proxyAddress", "walletMode", "authenticated"], j[0] = u) : u = j[0];
        let {
            proxyAddress: M,
            walletMode: N,
            authenticated: P
        } = (0, d.useAccountContext)(u), {
            generateL2Headers: I,
            apiCredential: E,
            signer: O
        } = (0, i.useL2Headers)(), L = !!M && !!E ? .key && !!O;
        j[1] === Symbol.for("react.memo_cache_sentinel") ? (p = {
            threshold: 0,
            triggerOnce: !0
        }, j[1] = p) : p = j[1];
        let {
            ref: F,
            inView: $
        } = (0, n.useInView)(p), B = void 0 !== A, q = D && !!R && !B;
        j[2] !== q ? (x = {
            enabled: q,
            gcTime: 3e5,
            staleTime: 6e4
        }, j[2] = q, j[3] = x) : x = j[3];
        let W = x;
        j[4] !== R ? (h = [R], j[4] = R, j[5] = h) : h = j[5], j[6] !== W || j[7] !== h ? (f = {
            address: c.REWARDS_CONTRACT_ADDRESS,
            abi: a.RewardsAbi,
            functionName: "markets",
            args: h,
            chainId: c.MATIC_CONFIG.chainId,
            query: W
        }, j[6] = W, j[7] = h, j[8] = f) : f = j[8];
        let {
            data: V,
            isLoading: H
        } = (0, s.useReadContract)(f);
        j[9] !== R ? (w = [R], j[9] = R, j[10] = w) : w = j[10], j[11] !== W || j[12] !== w ? (b = {
            address: c.OLD_REWARDS_CONTRACT_ADDRESS,
            abi: a.RewardsAbi,
            functionName: "markets",
            args: w,
            chainId: c.MATIC_CONFIG.chainId,
            query: W
        }, j[11] = W, j[12] = w, j[13] = b) : b = j[13];
        let {
            data: U,
            isLoading: z
        } = (0, s.useReadContract)(b);
        e: {
            if (B) {
                g = A;
                break e
            }
            let e = V ? .[1] ? ? 0,
                t = U ? .[1] ? ? 0;g = e > 0 || t > 0
        }
        let K = g;
        j[14] !== R || j[15] !== M || j[16] !== N ? (v = ["activeSponsorship", R, M, N], j[14] = R, j[15] = M, j[16] = N, j[17] = v) : v = j[17], j[18] !== R || j[19] !== I || j[20] !== N ? (k = async () => {
            let e = await I({
                method: "GET",
                requestPath: o.ACTIVE_SPONSORSHIP_REQUEST_PATH
            });
            if (!e) throw Error("Failed to generate auth headers");
            return m(R, N, e)
        }, j[18] = R, j[19] = I, j[20] = N, j[21] = k) : k = j[21];
        let Q = D && !!R && !!M && L && P && $ && K;
        j[22] !== v || j[23] !== k || j[24] !== Q ? (S = {
            queryKey: v,
            queryFn: k,
            enabled: Q,
            staleTime: 6e4,
            retry: 1
        }, j[22] = v, j[23] = k, j[24] = Q, j[25] = S) : S = j[25];
        let {
            data: G,
            isLoading: Z
        } = (0, r.useQuery)(S), Y = G ? .active_sponsorship ? ? null, X = null !== Y, J = G ? .has_past_sponsorship ? ? !1, ee = (0, l.usePendingSponsorshipsStore)(y);
        t: {
            let e, t;
            if (!R || !M) {
                let e;
                j[26] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    isPending: !1,
                    pendingRatePerDay: 0
                }, j[26] = e) : e = j[26], T = e;
                break t
            }
            if (j[27] !== R || j[28] !== ee || j[29] !== M) {
                let t;
                j[31] !== R || j[32] !== M ? (t = e => e.conditionId === R && e.proxyAddress.toLowerCase() === M.toLowerCase(), j[31] = R, j[32] = M, j[33] = t) : t = j[33], e = ee.find(t), j[27] = R, j[28] = ee, j[29] = M, j[30] = e
            } else e = j[30];
            let r = e,
                n = !!r,
                s = r ? 86400 * r.ratePerSecond : 0;j[34] !== n || j[35] !== s ? (t = {
                isPending: n,
                pendingRatePerDay: s
            }, j[34] = n, j[35] = s, j[36] = t) : t = j[36],
            T = t
        }
        let {
            isPending: et
        } = T, er = D && (B || void 0 !== V && void 0 !== U) && (!K || !Z), en = !B && (H || z) || K && Z;
        return j[37] !== J || j[38] !== er || j[39] !== et || j[40] !== K || j[41] !== X || j[42] !== F || j[43] !== en || j[44] !== Y ? (C = {
            ref: F,
            isLoading: en,
            isUserSponsor: X,
            isPending: et,
            hasPastSponsorship: J,
            userSponsorship: Y,
            isSponsorable: K,
            isInitialLoadComplete: er
        }, j[37] = J, j[38] = er, j[39] = et, j[40] = K, j[41] = X, j[42] = F, j[43] = en, j[44] = Y, j[45] = C) : C = j[45], C
    }], 693076)
}, 853037, 155442, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(964974),
        s = e.i(23128),
        a = e.i(655239),
        i = e.i(169010),
        o = e.i(208956),
        l = e.i(336896),
        d = e.i(515264),
        c = e.i(500110),
        u = e.i(416340),
        p = e.i(827681),
        m = e.i(628684),
        y = e.i(863828),
        x = e.i(101008),
        h = e.i(204062),
        f = e.i(780641),
        w = e.i(631503),
        b = e.i(420473),
        g = e.i(510954),
        v = e.i(57096),
        k = e.i(922445),
        S = e.i(604777),
        T = e.i(784521),
        C = e.i(400819),
        j = e.i(730474),
        R = e.i(631222),
        _ = e.i(911472),
        A = e.i(650367),
        D = e.i(313305),
        M = e.i(693076),
        N = e.i(806326),
        P = e.i(525962),
        I = e.i(249792),
        E = e.i(606572),
        O = e.i(864006),
        L = e.i(651958),
        F = e.i(318594),
        $ = e.i(468462),
        B = e.i(14849);

    function q(e) {
        return Array.isArray(e.queryKey) && "/api/rewards" === e.queryKey[0] && "userSponsorships" === e.queryKey[1]
    }

    function W(e) {
        return e.clearExpired
    }

    function V(e) {
        return e.removePendingSponsorship
    }

    function H(e) {
        return e.pendingSponsorships
    }
    let U = ["agreement", "input", "review", "success"];
    e.i(369761);
    var z = e.i(885370),
        K = e.i(56339),
        Q = e.i(866674),
        G = e.i(63238),
        Z = e.i(720155),
        Y = e.i(635103),
        X = e.i(306941),
        J = e.i(53950),
        ee = e.i(423582),
        et = e.i(513757),
        er = e.i(499055),
        en = e.i(528392),
        es = e.i(529812);
    let ea = e => {
            let n, a, i, o, l, d, c, u, p, m, y, x, h, f, w, b = (0, r.c)(41),
                {
                    onAccept: g
                } = e,
                v = (0, O.useMessages)().rewards.sponsorshipModal;
            return b[0] !== v.sponsorRewards ? (n = (0, t.jsx)(P.ModalHeader, {
                children: (0, t.jsx)(P.ModalTitle, {
                    children: v.sponsorRewards
                })
            }), b[0] = v.sponsorRewards, b[1] = n) : n = b[1], b[2] !== v.sponsorDescriptionBold ? (a = (0, t.jsx)("strong", {
                className: "font-bold text-black dark:text-text-brand",
                children: v.sponsorDescriptionBold
            }), b[2] = v.sponsorDescriptionBold, b[3] = a) : a = b[3], b[4] !== v.sponsorDescriptionPost || b[5] !== v.sponsorDescriptionPre || b[6] !== a ? (i = (0, t.jsxs)(P.ModalDescription, {
                children: [v.sponsorDescriptionPre, a, v.sponsorDescriptionPost]
            }), b[4] = v.sponsorDescriptionPost, b[5] = v.sponsorDescriptionPre, b[6] = a, b[7] = i) : i = b[7], b[8] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)(en.IconLockOutline18, {
                size: 18,
                className: "shrink-0 text-text-secondary mt-px"
            }), b[8] = o) : o = b[8], b[9] !== v.rule1Bold ? (l = (0, t.jsx)("strong", {
                children: v.rule1Bold
            }), b[9] = v.rule1Bold, b[10] = l) : l = b[10], b[11] !== v.rule1Post || b[12] !== v.rule1Pre || b[13] !== l ? (d = (0, t.jsxs)("div", {
                className: "flex items-start gap-3",
                children: [o, (0, t.jsxs)("p", {
                    className: "text-sm text-text",
                    children: [v.rule1Pre, l, v.rule1Post]
                })]
            }), b[11] = v.rule1Post, b[12] = v.rule1Pre, b[13] = l, b[14] = d) : d = b[14], b[15] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, t.jsx)(er.IconClockOutline18, {
                size: 18,
                className: "shrink-0 text-text-secondary mt-px"
            }), b[15] = c) : c = b[15], b[16] !== v.rule2Bold ? (u = (0, t.jsx)("strong", {
                children: v.rule2Bold
            }), b[16] = v.rule2Bold, b[17] = u) : u = b[17], b[18] !== v.rule2Post || b[19] !== v.rule2Pre || b[20] !== u ? (p = (0, t.jsxs)("div", {
                className: "flex items-start gap-3",
                children: [c, (0, t.jsxs)("p", {
                    className: "text-sm text-text",
                    children: [v.rule2Pre, u, v.rule2Post]
                })]
            }), b[18] = v.rule2Post, b[19] = v.rule2Pre, b[20] = u, b[21] = p) : p = b[21], b[22] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, t.jsx)(es.IconRefreshOutline18, {
                size: 18,
                className: "shrink-0 text-text-secondary mt-px"
            }), b[22] = m) : m = b[22], b[23] !== v.rule3Bold ? (y = (0, t.jsx)("strong", {
                children: v.rule3Bold
            }), b[23] = v.rule3Bold, b[24] = y) : y = b[24], b[25] !== v.rule3Post || b[26] !== v.rule3Pre || b[27] !== y ? (x = (0, t.jsxs)("div", {
                className: "flex items-start gap-3",
                children: [m, (0, t.jsxs)("p", {
                    className: "text-sm text-text",
                    children: [v.rule3Pre, y, v.rule3Post]
                })]
            }), b[25] = v.rule3Post, b[26] = v.rule3Pre, b[27] = y, b[28] = x) : x = b[28], b[29] !== x || b[30] !== d || b[31] !== p ? (h = (0, t.jsxs)("div", {
                className: "flex flex-col gap-4",
                children: [d, p, x]
            }), b[29] = x, b[30] = d, b[31] = p, b[32] = h) : h = b[32], b[33] !== g || b[34] !== v.acceptAndContinue ? (f = (0, t.jsx)(P.ModalFooter, {
                children: (0, t.jsx)(s.Button, {
                    onClick: g,
                    children: v.acceptAndContinue
                })
            }), b[33] = g, b[34] = v.acceptAndContinue, b[35] = f) : f = b[35], b[36] !== n || b[37] !== h || b[38] !== f || b[39] !== i ? (w = (0, t.jsxs)(t.Fragment, {
                children: [n, i, h, f]
            }), b[36] = n, b[37] = h, b[38] = f, b[39] = i, b[40] = w) : w = b[40], w
        },
        ei = e => {
            let n, s, a, i, l, d, c, u, p, m, y, x, h, f, w, g, v = (0, r.c)(44),
                {
                    market: k
                } = e,
                T = (0, S.useTranslations)(),
                C = (0, O.useMessages)().rewards.sponsorshipModal,
                {
                    existingSponsorship: j
                } = k;
            if (!j) return null;
            let {
                dailyRate: R,
                endDate: _,
                endTime: A
            } = j, D = C.dailyRewardRate;
            v[0] !== R ? (n = R.toFixed(2), v[0] = R, v[1] = n) : n = v[1], v[2] !== T ? (s = T("rewards.sponsor.perDay"), v[2] = T, v[3] = s) : s = v[3];
            let M = `$${n}${s}`;
            v[4] !== C.dailyRewardRate || v[5] !== M ? (a = {
                label: D,
                value: M
            }, v[4] = C.dailyRewardRate, v[5] = M, v[6] = a) : a = v[6];
            let N = `${_} ${A}`;
            v[7] !== C.commitmentEnds || v[8] !== N ? (i = {
                label: C.commitmentEnds,
                value: N
            }, v[7] = C.commitmentEnds, v[8] = N, v[9] = i) : i = v[9], v[10] !== C.view ? (l = (0, t.jsx)(o.default, {
                href: `/portfolio?tab=${b.PortfolioTab.MarketRewards}`,
                className: "text-text-brand hover:underline",
                children: C.view
            }), v[10] = C.view, v[11] = l) : l = v[11], v[12] !== C.trackSponsorshipProgress || v[13] !== l ? (d = {
                label: C.trackSponsorshipProgress,
                value: l
            }, v[12] = C.trackSponsorshipProgress, v[13] = l, v[14] = d) : d = v[14], v[15] !== a || v[16] !== i || v[17] !== d ? (c = [a, i, d], v[15] = a, v[16] = i, v[17] = d, v[18] = c) : c = v[18];
            let I = c;
            return v[19] !== C.sponsorRewards ? (u = (0, t.jsx)(P.ModalHeader, {
                children: (0, t.jsx)(P.ModalTitle, {
                    children: C.sponsorRewards
                })
            }), v[19] = C.sponsorRewards, v[20] = u) : u = v[20], v[21] !== C.sponsorDescriptionBold ? (p = (0, t.jsx)("strong", {
                className: "font-bold text-black dark:text-text-brand",
                children: C.sponsorDescriptionBold
            }), v[21] = C.sponsorDescriptionBold, v[22] = p) : p = v[22], v[23] !== C.sponsorDescriptionPost || v[24] !== C.sponsorDescriptionPre || v[25] !== p ? (m = (0, t.jsxs)(P.ModalDescription, {
                children: [C.sponsorDescriptionPre, p, C.sponsorDescriptionPost]
            }), v[23] = C.sponsorDescriptionPost, v[24] = C.sponsorDescriptionPre, v[25] = p, v[26] = m) : m = v[26], v[27] !== C.sponsorshipActive ? (y = (0, t.jsx)("p", {
                className: "text-base font-bold text-text",
                children: C.sponsorshipActive
            }), v[27] = C.sponsorshipActive, v[28] = y) : y = v[28], v[29] !== C.portfolioSponsorships ? (x = (0, t.jsx)(o.default, {
                href: `/portfolio?tab=${b.PortfolioTab.MarketRewards}`,
                className: "text-text-brand hover:underline",
                children: C.portfolioSponsorships
            }), v[29] = C.portfolioSponsorships, v[30] = x) : x = v[30], v[31] !== C.reviewOrCancel || v[32] !== x ? (h = (0, t.jsxs)("p", {
                className: "text-xs font-medium text-text text-center",
                children: [C.reviewOrCancel, " ", x, "."]
            }), v[31] = C.reviewOrCancel, v[32] = x, v[33] = h) : h = v[33], v[34] !== y || v[35] !== h ? (f = (0, t.jsxs)("div", {
                className: "flex flex-col items-center gap-2",
                children: [y, h]
            }), v[34] = y, v[35] = h, v[36] = f) : f = v[36], v[37] !== I ? (w = (0, t.jsx)("div", {
                className: "rounded-lg border border-border",
                children: I.map(eo)
            }), v[37] = I, v[38] = w) : w = v[38], v[39] !== u || v[40] !== m || v[41] !== f || v[42] !== w ? (g = (0, t.jsxs)(t.Fragment, {
                children: [u, m, f, w]
            }), v[39] = u, v[40] = m, v[41] = f, v[42] = w, v[43] = g) : g = v[43], g
        };

    function eo(e, r) {
        return (0, t.jsxs)("div", {
            children: [r > 0 && (0, t.jsx)("div", {
                className: "h-px bg-border"
            }), (0, t.jsxs)("div", {
                className: "flex items-center justify-between p-3",
                children: [(0, t.jsx)("span", {
                    className: "text-[13px] font-medium text-text-secondary",
                    children: e.label
                }), (0, t.jsx)("span", {
                    className: "text-[13px] font-medium text-text text-right",
                    children: e.value
                })]
            })]
        }, e.label)
    }
    var el = e.i(913182),
        ed = e.i(491636),
        ec = e.i(390960),
        eu = e.i(253264),
        ep = e.i(137320),
        em = e.i(405891),
        ey = e.i(5146),
        ex = e.i(668122),
        eh = e.i(79075),
        ef = e.i(305457),
        ew = e.i(767074),
        eb = e.i(962316),
        eg = e.i(249611);
    let ev = function({
        market: e,
        sponsorshipData: r,
        onUpdateData: n,
        onCancel: a,
        onContinue: o
    }) {
        let l = (0, ef.useAmplitudeAnalytics)(),
            d = (0, S.useTranslations)(),
            m = (0, O.useLocale)(),
            x = (0, O.useMessages)().rewards.sponsorshipModal,
            {
                authenticated: h
            } = (0, T.useAccountContext)(["authenticated"]),
            {
                setOpen: f,
                setConnectorRoute: w
            } = (0, y.useSiwx)(),
            {
                onBeginCheckout: b
            } = (0, ew.useFunkitContext)(),
            {
                proxyUsdcBalanceMetadata: g,
                trackedProxyUsdcBalance: v
            } = (0, ey.default)(),
            k = (0, eg.parseAmount)(r.amount),
            C = (0, eg.calculateDailyRate)(k, r.durationDays),
            j = (0, el.addDays)(new Date, r.durationDays),
            R = (0, u.useCallback)(e => {
                n({
                    amount: (k + e).toString()
                })
            }, [k, n]),
            _ = (0, u.useCallback)(() => {
                r.durationDays > 1 && n({
                    durationDays: r.durationDays - 1
                })
            }, [r.durationDays, n]),
            A = (0, u.useCallback)(() => {
                r.durationDays < eb.MAX_DURATION_DAYS && n({
                    durationDays: r.durationDays + 1
                })
            }, [r.durationDays, n]),
            D = (0, eg.isAmountViableForDuration)(k, r.durationDays),
            M = (0, eg.getMinAmountForDuration)(r.durationDays),
            N = k > v.current,
            I = k > 0 && !D,
            E = D && !N,
            L = 0 === v.current,
            [F, $] = (0, u.useState)(!1),
            B = (0, u.useCallback)(() => {
                let e = Date.now();
                a(), (0, eh.markSignupPromptOpened)("rewards", {
                    now: e,
                    route: "login"
                }), l.trackEvent(ex.Events.SignupPromptOpened, (0, eh.getSignupPromptOpenedEventProperties)({
                    source: "rewards",
                    route: "login"
                })), w(p.ConnectorRoute.LOGIN), f(!0)
            }, [l, a, w, f]),
            q = (0, u.useCallback)(() => {
                a(), b()
            }, [a, b]),
            W = (0, u.useMemo)(() => h ? L ? {
                label: x.deposit,
                onClick: q,
                disabled: !1
            } : {
                label: x.continue,
                onClick: o,
                disabled: !E
            } : {
                label: x.logInToContinue,
                onClick: B,
                disabled: !1
            }, [h, L, E, B, q, o, x]),
            V = 1 === r.durationDays ? x.day : x.days;
        return (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(P.ModalHeader, {
                children: (0, t.jsx)(P.ModalTitle, {
                    children: x.sponsorRewards
                })
            }), (0, t.jsxs)(P.ModalDescription, {
                children: [x.sponsorDescriptionPre, (0, t.jsx)("strong", {
                    className: "font-bold text-black dark:text-text-brand",
                    children: x.sponsorDescriptionBold
                }), x.sponsorDescriptionPost]
            }), (0, t.jsxs)("div", {
                className: "flex items-center gap-3",
                children: [(0, t.jsx)(em.default, {
                    src: e.market.image,
                    alt: e.market.question,
                    width: 48,
                    height: 48,
                    className: "rounded object-cover bg-neutral-200 shrink-0",
                    style: {
                        width: 48,
                        height: 48
                    }
                }), (0, t.jsx)("p", {
                    className: "text-base font-semibold text-text leading-tight",
                    children: e.market.question
                })]
            }), (0, t.jsx)("div", {
                className: "flex flex-col gap-4",
                children: (0, t.jsxs)("div", {
                    className: "flex items-start justify-between",
                    children: [(0, t.jsxs)("div", {
                        className: "flex flex-col",
                        children: [(0, t.jsx)("span", {
                            className: "text-base font-medium text-text",
                            children: x.amount
                        }), (0, t.jsxs)("span", {
                            className: "text-xs text-text-secondary",
                            children: [x.balance, " ", g.currentBalance]
                        })]
                    }), (0, t.jsxs)("div", {
                        className: "flex flex-col items-end gap-4",
                        children: [(0, t.jsx)("input", {
                            type: "text",
                            inputMode: "decimal",
                            value: r.amount ? `$${r.amount}` : "",
                            onChange: e => {
                                let t = e.target.value.replace(/^\$/, "");
                                ("" === t || /^\d*\.?\d*$/.test(t)) && n({
                                    amount: t
                                })
                            },
                            placeholder: "$0",
                            className: "text-[56px] font-bold leading-none text-text bg-transparent border-none outline-none text-right placeholder:text-text/30 w-full max-w-[220px]"
                        }), (0, t.jsx)("div", {
                            className: "flex items-center gap-1",
                            children: [10, 50, 100].map(e => (0, t.jsxs)(s.Button, {
                                variant: "secondary",
                                size: "sm",
                                onClick: () => R(e),
                                children: ["+$", e]
                            }, e))
                        }), (0, t.jsx)("p", {
                            className: `text-xs font-medium ${I?"text-red-600 dark:text-red-400":"text-text-tertiary"}`,
                            children: I ? x.minimumRequired.replace("{amount}", M.toFixed(2)).replace("{days}", String(r.durationDays)).replace("{daysLabel}", V) : x.minimumSponsorship.replace("{amount}", String(eb.MIN_AMOUNT))
                        })]
                    })]
                })
            }), (0, t.jsx)("div", {
                className: "h-px bg-border -mx-6"
            }), (0, t.jsxs)("div", {
                className: "flex items-center justify-between",
                children: [(0, t.jsxs)("div", {
                    className: "flex flex-col",
                    children: [(0, t.jsx)("span", {
                        className: "text-base font-medium text-text",
                        children: x.duration
                    }), (0, t.jsxs)("span", {
                        className: "text-xs text-text-secondary",
                        children: [r.durationDays, " ", x.daysUnit]
                    })]
                }), (0, t.jsxs)("div", {
                    className: "flex items-center gap-2",
                    children: [(0, t.jsx)(s.Button, {
                        variant: "outline",
                        size: "iconSm",
                        onClick: _,
                        disabled: r.durationDays <= 1,
                        "aria-label": d("rewards.aria.decreaseDuration"),
                        children: (0, t.jsx)(ep.IconMinusOutline18, {
                            size: 18
                        })
                    }), (0, t.jsx)("span", {
                        className: "w-10 text-center text-base font-bold text-text",
                        children: r.durationDays
                    }), (0, t.jsx)(s.Button, {
                        variant: "outline",
                        size: "iconSm",
                        onClick: A,
                        disabled: r.durationDays >= eb.MAX_DURATION_DAYS,
                        "aria-label": d("rewards.aria.increaseDuration"),
                        children: (0, t.jsx)(c.IconPlusOutline18, {
                            size: 18
                        })
                    })]
                })]
            }), (0, t.jsxs)("div", {
                className: "flex flex-col gap-2",
                children: [(0, t.jsxs)("div", {
                    className: "rounded-lg border border-border",
                    children: [(0, t.jsxs)("div", {
                        className: "flex items-center justify-between p-3",
                        children: [(0, t.jsx)("span", {
                            className: "text-[13px] font-medium text-text-secondary",
                            children: x.dailyRewardRate
                        }), (0, t.jsxs)("span", {
                            className: "text-[13px] font-medium text-text",
                            children: ["$", C.toFixed(2), d("rewards.sponsor.perDay")]
                        })]
                    }), (0, t.jsx)("div", {
                        className: "h-px bg-border"
                    }), (0, t.jsxs)("div", {
                        className: "flex items-center justify-between p-3",
                        children: [(0, t.jsx)("span", {
                            className: "text-[13px] font-medium text-text-secondary",
                            children: x.commitmentEnds
                        }), (0, t.jsx)("span", {
                            className: "text-[13px] font-medium text-text",
                            children: (0, ed.format)(j, "MMM d, yyyy", {
                                locale: (0, ec.getDateFnsLocale)(m)
                            })
                        })]
                    })]
                }), (0, t.jsxs)("div", {
                    className: "flex items-center justify-center gap-1 py-1",
                    children: [(0, t.jsx)(eu.IconCircleInfoFill18, {
                        size: 16,
                        className: "text-text-secondary shrink-0"
                    }), (0, t.jsx)("span", {
                        className: "text-xs font-medium text-text-secondary",
                        children: x.unusedFundsReturn
                    })]
                })]
            }), (0, t.jsx)(P.ModalFooter, {
                children: (0, t.jsx)(i.Tooltip, {
                    content: I ? x.sponsorshipMinPerDay.replace("{amount}", String(eb.MIN_AMOUNT)) : x.insufficientBalance,
                    className: "text-xs font-medium z-[260]",
                    showArrow: !1,
                    sideOffset: 4,
                    open: (N || I) && W.disabled && F,
                    onOpenChange: $,
                    children: (0, t.jsx)("span", {
                        className: "block w-full",
                        onMouseEnter: () => $(!0),
                        onMouseLeave: () => $(!1),
                        children: (0, t.jsx)(s.Button, {
                            onClick: W.onClick,
                            disabled: W.disabled,
                            className: `w-full ${W.disabled?"pointer-events-none":""}`,
                            children: W.label
                        })
                    })
                })
            })]
        })
    };
    var ek = e.i(138567),
        eS = e.i(198841),
        eT = e.i(598440);

    function eC(e, r) {
        return (0, t.jsxs)("div", {
            children: [r > 0 && (0, t.jsx)("div", {
                className: "h-px bg-border"
            }), (0, t.jsxs)("div", {
                className: "flex items-center justify-between p-3",
                children: [(0, t.jsx)("span", {
                    className: "text-[13px] font-medium text-text-secondary",
                    children: e.label
                }), (0, t.jsx)("span", {
                    className: "text-[13px] font-medium text-text text-right",
                    children: e.value
                })]
            })]
        }, e.label)
    }
    let ej = function(e) {
        let n, o, l, d, c, p, m, y, x, h, f, w, b, g, v, k, T, C, j, _, A, D, M = (0, r.c)(113),
            {
                market: N,
                sponsorshipData: I,
                onBack: E,
                onConfirm: L,
                isLoading: F
            } = e,
            $ = (0, S.useTranslations)(),
            B = (0, O.useLocale)(),
            q = (0, O.useMessages)().rewards.sponsorshipModal,
            [W, V] = (0, u.useState)(!1);
        if (M[0] !== W || M[1] !== B || M[2] !== N.market.conditionId || M[3] !== N.market.question || M[4] !== q.dailyRate || M[5] !== q.day || M[6] !== q.days || M[7] !== q.duration || M[8] !== q.endDate || M[9] !== q.market || M[10] !== q.marketId || M[11] !== q.startDate || M[12] !== q.totalAmount || M[13] !== I.amount || M[14] !== I.durationDays || M[15] !== $) {
            let e, r, s, a, u, x, h, f, w, b, g, v = (0, eg.parseAmount)(I.amount),
                k = (0, eg.calculateDailyRate)(v, I.durationDays),
                S = new Date,
                T = (0, el.addDays)(S, I.durationDays),
                C = N.market.question,
                j = N.market.conditionId;
            M[24] !== j ? (e = async () => {
                try {
                    await navigator.clipboard.writeText(j), V(!0), setTimeout(() => V(!1), 2e3)
                } catch (e) {
                    console.error("Failed to copy market ID:", e)
                }
            }, M[24] = j, M[25] = e) : e = M[25];
            let R = e,
                _ = 1 === I.durationDays ? q.day : q.days;
            M[26] !== C ? (r = (0, t.jsx)("span", {
                className: "truncate min-w-0 max-w-[200px] inline-block text-right",
                children: C
            }), M[26] = C, M[27] = r) : r = M[27], M[28] !== C || M[29] !== r ? (s = (0, t.jsx)(i.Tooltip, {
                content: C,
                className: "z-[300]",
                children: r
            }), M[28] = C, M[29] = r, M[30] = s) : s = M[30], M[31] !== q.market || M[32] !== s ? (l = {
                label: q.market,
                value: s
            }, M[31] = q.market, M[32] = s, M[33] = l) : l = M[33];
            let A = q.marketId;
            M[34] !== j ? (a = j.slice(0, 6), M[34] = j, M[35] = a) : a = M[35], M[36] !== j ? (u = j.slice(-4), M[36] = j, M[37] = u) : u = M[37];
            let D = `${a}...${u}`;
            M[38] !== D ? (x = (0, t.jsx)("span", {
                className: "font-mono",
                children: D
            }), M[38] = D, M[39] = x) : x = M[39], M[40] !== $ ? (h = $("rewards.aria.copyMarketId"), M[40] = $, M[41] = h) : h = M[41], M[42] !== W ? (f = W ? (0, t.jsx)(ek.IconCheckOutline18, {
                size: 14,
                className: "text-green-500"
            }) : (0, t.jsx)(eT.IconCopyOutline18, {
                size: 14
            }), M[42] = W, M[43] = f) : f = M[43], M[44] !== R || M[45] !== h || M[46] !== f ? (w = (0, t.jsx)("button", {
                type: "button",
                onClick: R,
                "aria-label": h,
                className: "p-1 text-text-secondary hover:text-text rounded transition-colors cursor-pointer",
                children: f
            }), M[44] = R, M[45] = h, M[46] = f, M[47] = w) : w = M[47], M[48] !== x || M[49] !== w ? (b = (0, t.jsxs)("div", {
                className: "flex items-center gap-1.5",
                children: [x, w]
            }), M[48] = x, M[49] = w, M[50] = b) : b = M[50], M[51] !== q.marketId || M[52] !== b ? (d = {
                label: A,
                value: b
            }, M[51] = q.marketId, M[52] = b, M[53] = d) : d = M[53];
            let P = `$${v}`;
            M[54] !== q.totalAmount || M[55] !== P ? (c = {
                label: q.totalAmount,
                value: P
            }, M[54] = q.totalAmount, M[55] = P, M[56] = c) : c = M[56];
            let E = `${I.durationDays} ${_}`;
            M[57] !== q.duration || M[58] !== E ? (p = {
                label: q.duration,
                value: E
            }, M[57] = q.duration, M[58] = E, M[59] = p) : p = M[59];
            let O = q.dailyRate,
                L = k.toFixed(2);
            M[60] !== $ ? (g = $("rewards.sponsor.perDay"), M[60] = $, M[61] = g) : g = M[61];
            let F = `$${L}${g}`;
            M[62] !== q.dailyRate || M[63] !== F ? (m = {
                label: O,
                value: F
            }, M[62] = q.dailyRate, M[63] = F, M[64] = m) : m = M[64], y = {
                label: q.startDate,
                value: (0, ed.format)(S, "MMM d, yyyy", {
                    locale: (0, ec.getDateFnsLocale)(B)
                })
            }, n = q.endDate, o = (0, ed.format)(T, "MMM d, yyyy", {
                locale: (0, ec.getDateFnsLocale)(B)
            }), M[0] = W, M[1] = B, M[2] = N.market.conditionId, M[3] = N.market.question, M[4] = q.dailyRate, M[5] = q.day, M[6] = q.days, M[7] = q.duration, M[8] = q.endDate, M[9] = q.market, M[10] = q.marketId, M[11] = q.startDate, M[12] = q.totalAmount, M[13] = I.amount, M[14] = I.durationDays, M[15] = $, M[16] = n, M[17] = o, M[18] = l, M[19] = d, M[20] = c, M[21] = p, M[22] = m, M[23] = y
        } else n = M[16], o = M[17], l = M[18], d = M[19], c = M[20], p = M[21], m = M[22], y = M[23];
        M[65] !== n || M[66] !== o ? (x = {
            label: n,
            value: o
        }, M[65] = n, M[66] = o, M[67] = x) : x = M[67], M[68] !== l || M[69] !== d || M[70] !== c || M[71] !== p || M[72] !== m || M[73] !== y || M[74] !== x ? (h = [l, d, c, p, m, y, x], M[68] = l, M[69] = d, M[70] = c, M[71] = p, M[72] = m, M[73] = y, M[74] = x, M[75] = h) : h = M[75];
        let H = h;
        return M[76] !== q.reviewTitle ? (f = (0, t.jsx)(P.ModalHeader, {
            children: (0, t.jsx)(P.ModalTitle, {
                children: q.reviewTitle
            })
        }), M[76] = q.reviewTitle, M[77] = f) : f = M[77], M[78] !== q.reviewDescription ? (w = (0, t.jsx)(P.ModalDescription, {
            children: q.reviewDescription
        }), M[78] = q.reviewDescription, M[79] = w) : w = M[79], M[80] !== H ? (b = (0, t.jsx)("div", {
            className: "rounded-lg border border-border",
            children: H.map(eC)
        }), M[80] = H, M[81] = b) : b = M[81], M[82] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, t.jsx)(eS.IconCircleWarningOutline18, {
            size: 20,
            className: "text-yellow-700 dark:text-yellow-400 shrink-0 mt-0.5"
        }), M[82] = g) : g = M[82], M[83] !== q.reviewWarningBold ? (v = (0, t.jsx)("strong", {
            children: q.reviewWarningBold
        }), M[83] = q.reviewWarningBold, M[84] = v) : v = M[84], M[85] !== q.learnMore ? (k = (0, t.jsx)("a", {
            href: `${R.POLYMARKET_HELP_CENTER_LINK}/en/articles/13755867-sponsor-market-rewards`,
            target: "_blank",
            rel: "noopener noreferrer",
            className: "text-yellow-900 dark:text-yellow-100 underline",
            children: q.learnMore
        }), M[85] = q.learnMore, M[86] = k) : k = M[86], M[87] !== q.reviewWarningPost || M[88] !== q.reviewWarningPre || M[89] !== v || M[90] !== k ? (T = (0, t.jsxs)("div", {
            className: "flex items-start gap-2.5 p-4 bg-yellow-50 dark:bg-yellow-950/30 rounded-xl",
            children: [g, (0, t.jsxs)("p", {
                className: "text-sm font-medium text-yellow-800 dark:text-yellow-200 leading-normal",
                children: [q.reviewWarningPre, v, q.reviewWarningPost, k]
            })]
        }), M[87] = q.reviewWarningPost, M[88] = q.reviewWarningPre, M[89] = v, M[90] = k, M[91] = T) : T = M[91], M[92] !== F || M[93] !== E || M[94] !== q.editOrder ? (C = (0, t.jsx)(s.Button, {
            variant: "outline",
            onClick: E,
            disabled: F,
            children: q.editOrder
        }), M[92] = F, M[93] = E, M[94] = q.editOrder, M[95] = C) : C = M[95], M[96] !== F || M[97] !== q.confirmOrder || M[98] !== q.confirming ? (j = F ? (0, t.jsxs)("span", {
            className: "flex items-center justify-center gap-2",
            children: [(0, t.jsx)(a.default, {
                className: "w-4 h-4 border-white/20 border-t-white/80"
            }), q.confirming]
        }) : q.confirmOrder, M[96] = F, M[97] = q.confirmOrder, M[98] = q.confirming, M[99] = j) : j = M[99], M[100] !== F || M[101] !== L || M[102] !== j ? (_ = (0, t.jsx)(s.Button, {
            onClick: L,
            disabled: F,
            children: j
        }), M[100] = F, M[101] = L, M[102] = j, M[103] = _) : _ = M[103], M[104] !== C || M[105] !== _ ? (A = (0, t.jsxs)(P.ModalFooter, {
            children: [C, _]
        }), M[104] = C, M[105] = _, M[106] = A) : A = M[106], M[107] !== f || M[108] !== w || M[109] !== b || M[110] !== T || M[111] !== A ? (D = (0, t.jsxs)(t.Fragment, {
            children: [f, w, b, T, A]
        }), M[107] = f, M[108] = w, M[109] = b, M[110] = T, M[111] = A, M[112] = D) : D = M[112], D
    };
    e.i(304697);
    var eR = e.i(179645);

    function e_(e, r) {
        return (0, t.jsxs)("div", {
            children: [r > 0 && (0, t.jsx)("div", {
                className: "h-px bg-border"
            }), (0, t.jsxs)("div", {
                className: "flex items-center justify-between p-3",
                children: [(0, t.jsx)("span", {
                    className: "text-[13px] font-medium text-text-secondary",
                    children: e.label
                }), (0, t.jsx)("span", {
                    className: "text-[13px] font-medium text-text text-right",
                    children: e.value
                })]
            })]
        }, e.label)
    }
    let eA = function(e) {
        let n, a, i, o, d, c, u, p, m, y, x, h, f, w, g, v, k = (0, r.c)(79),
            {
                market: T,
                sponsorshipData: C,
                onClose: j,
                onTrackProgress: R
            } = e,
            _ = (0, S.useTranslations)(),
            A = (0, O.useLocale)(),
            D = (0, O.useMessages)().rewards.sponsorshipModal,
            M = (0, l.useRouter)();
        k[0] !== R || k[1] !== M ? (n = () => {
            R(), M.push(`/portfolio?tab=${b.PortfolioTab.MarketRewards}`)
        }, k[0] = R, k[1] = M, k[2] = n) : n = k[2];
        let N = n;
        if (k[3] !== A || k[4] !== T.market.question || k[5] !== D.contributionSuccess || k[6] !== D.dailyRate || k[7] !== D.day || k[8] !== D.days || k[9] !== D.duration || k[10] !== D.firstDistribution || k[11] !== D.market || k[12] !== D.sponsorship || k[13] !== D.sponsorshipLive || k[14] !== C.amount || k[15] !== C.durationDays || k[16] !== _) {
            let e, r, n, s, l, m, y, x, h = (0, eg.parseAmount)(C.amount),
                f = (0, eg.calculateDailyRate)(h, C.durationDays);
            k[24] !== T.market.question ? (e = (0, eg.truncateQuestion)(T.market.question), k[24] = T.market.question, k[25] = e) : e = k[25];
            let w = e,
                b = (0, el.addDays)(new Date, 1);
            b.setUTCHours(0, 0, 0, 0);
            let g = 1 === C.durationDays ? D.day : D.days;
            k[26] !== D.market || k[27] !== w ? (r = {
                label: D.market,
                value: w
            }, k[26] = D.market, k[27] = w, k[28] = r) : r = k[28];
            let v = D.dailyRate,
                S = f.toFixed(2);
            k[29] !== _ ? (n = _("rewards.sponsor.perDay"), k[29] = _, k[30] = n) : n = k[30];
            let j = `$${S}${n}`;
            k[31] !== D.dailyRate || k[32] !== j ? (s = {
                label: v,
                value: j
            }, k[31] = D.dailyRate, k[32] = j, k[33] = s) : s = k[33];
            let R = `${C.durationDays} ${g}`;
            k[34] !== D.duration || k[35] !== R ? (l = {
                label: D.duration,
                value: R
            }, k[34] = D.duration, k[35] = R, k[36] = l) : l = k[36];
            let M = D.firstDistribution,
                N = (0, ed.format)(new eR.TZDate(b, "UTC"), "MMM d, yyyy HH:mm", {
                    locale: (0, ec.getDateFnsLocale)(A)
                });
            k[37] !== _ ? (m = _("rewards.sponsor.utcSuffix"), k[37] = _, k[38] = m) : m = k[38];
            let I = `${N} ${m}`;
            k[39] !== D.firstDistribution || k[40] !== I ? (y = {
                label: M,
                value: I
            }, k[39] = D.firstDistribution, k[40] = I, k[41] = y) : y = k[41], k[42] !== s || k[43] !== l || k[44] !== y || k[45] !== r ? (x = [r, s, l, y], k[42] = s, k[43] = l, k[44] = y, k[45] = r, k[46] = x) : x = k[46], a = x, k[47] !== D.sponsorship ? (p = (0, t.jsx)(P.ModalHeader, {
                children: (0, t.jsx)(P.ModalTitle, {
                    children: D.sponsorship
                })
            }), k[47] = D.sponsorship, k[48] = p) : p = k[48], d = "flex flex-col items-center", k[49] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, t.jsx)("div", {
                className: "flex items-center justify-center w-[30px] h-[30px] rounded-full bg-green-500 mb-3",
                children: (0, t.jsx)(ek.IconCheckOutline18, {
                    size: 16,
                    className: "text-white",
                    strokeWidth: 3
                })
            }), k[49] = c) : c = k[49], k[50] !== D.sponsorshipLive ? (u = (0, t.jsx)("h3", {
                className: "text-base font-semibold text-text",
                children: D.sponsorshipLive
            }), k[50] = D.sponsorshipLive, k[51] = u) : u = k[51], i = "text-xs font-medium text-text-secondary max-w-[256px] text-center mt-1", o = D.contributionSuccess.replace("{amount}", h.toFixed(2)), k[3] = A, k[4] = T.market.question, k[5] = D.contributionSuccess, k[6] = D.dailyRate, k[7] = D.day, k[8] = D.days, k[9] = D.duration, k[10] = D.firstDistribution, k[11] = D.market, k[12] = D.sponsorship, k[13] = D.sponsorshipLive, k[14] = C.amount, k[15] = C.durationDays, k[16] = _, k[17] = a, k[18] = i, k[19] = o, k[20] = d, k[21] = c, k[22] = u, k[23] = p
        } else a = k[17], i = k[18], o = k[19], d = k[20], c = k[21], u = k[22], p = k[23];
        return k[52] !== i || k[53] !== o ? (m = (0, t.jsx)("p", {
            className: i,
            children: o
        }), k[52] = i, k[53] = o, k[54] = m) : m = k[54], k[55] !== d || k[56] !== c || k[57] !== u || k[58] !== m ? (y = (0, t.jsxs)("div", {
            className: d,
            children: [c, u, m]
        }), k[55] = d, k[56] = c, k[57] = u, k[58] = m, k[59] = y) : y = k[59], k[60] !== a ? (x = (0, t.jsx)("div", {
            className: "rounded-lg border border-border",
            children: a.map(e_)
        }), k[60] = a, k[61] = x) : x = k[61], k[62] !== D.earlyResolveNote ? (h = (0, t.jsx)("p", {
            className: "text-xs font-medium text-text-secondary text-center",
            children: D.earlyResolveNote
        }), k[62] = D.earlyResolveNote, k[63] = h) : h = k[63], k[64] !== j || k[65] !== D.returnToMarket ? (f = (0, t.jsx)(s.Button, {
            variant: "outline",
            onClick: j,
            children: D.returnToMarket
        }), k[64] = j, k[65] = D.returnToMarket, k[66] = f) : f = k[66], k[67] !== N || k[68] !== D.trackProgress ? (w = (0, t.jsx)(s.Button, {
            onClick: N,
            children: D.trackProgress
        }), k[67] = N, k[68] = D.trackProgress, k[69] = w) : w = k[69], k[70] !== f || k[71] !== w ? (g = (0, t.jsxs)(P.ModalFooter, {
            children: [f, w]
        }), k[70] = f, k[71] = w, k[72] = g) : g = k[72], k[73] !== x || k[74] !== h || k[75] !== g || k[76] !== p || k[77] !== y ? (v = (0, t.jsxs)(t.Fragment, {
            children: [p, y, x, h, g]
        }), k[73] = x, k[74] = h, k[75] = g, k[76] = p, k[77] = y, k[78] = v) : v = k[78], v
    };

    function eD(e) {
        return e.addPendingSponsorship
    }
    let eM = function(e) {
        let n, s, a, i, o, l, d = (0, r.c)(30),
            {
                open: c,
                onOpenChange: p,
                market: m
            } = e,
            y = (0, O.useMessages)().rewards.sponsorshipModal,
            x = (0, I.useToast)();
        d[0] === Symbol.for("react.memo_cache_sentinel") ? (n = ["proxyAddress"], d[0] = n) : n = d[0];
        let {
            proxyAddress: h
        } = (0, T.useAccountContext)(n), f = (0, L.usePendingSponsorshipsStore)(eD), {
            currentStep: b,
            sponsorshipData: g,
            goNext: v,
            goBack: k,
            reset: C,
            updateSponsorshipData: j
        } = function() {
            let e, t, n, s, a, i, o, l = (0, r.c)(17);
            void 0 !== l[0] ? (e = {}, l[0] = void 0, l[1] = e) : e = l[1];
            let {
                initialStep: d,
                onComplete: c
            } = e, p = void 0 === d ? "agreement" : d, [m, y] = (0, u.useState)(p);
            l[2] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                amount: "",
                durationDays: 5
            }, l[2] = t) : t = l[2];
            let [x, h] = (0, u.useState)(t), f = U.indexOf(m);
            l[3] !== f || l[4] !== c ? (n = () => {
                if (f === U.length - 1) return void c ? .();
                let e = f + 1;
                e < U.length && y(U[e])
            }, l[3] = f, l[4] = c, l[5] = n) : n = l[5];
            let w = n;
            l[6] !== f ? (s = () => {
                let e = f - 1;
                e >= 0 && y(U[e])
            }, l[6] = f, l[7] = s) : s = l[7];
            let b = s;
            l[8] !== p ? (a = () => {
                y(p), h({
                    amount: "",
                    durationDays: 5
                })
            }, l[8] = p, l[9] = a) : a = l[9];
            let g = a;
            l[10] === Symbol.for("react.memo_cache_sentinel") ? (i = e => {
                h(t => ({ ...t,
                    ...e
                }))
            }, l[10] = i) : i = l[10];
            let v = i;
            return l[11] !== m || l[12] !== b || l[13] !== w || l[14] !== g || l[15] !== x ? (o = {
                currentStep: m,
                sponsorshipData: x,
                goNext: w,
                goBack: b,
                reset: g,
                updateSponsorshipData: v
            }, l[11] = m, l[12] = b, l[13] = w, l[14] = g, l[15] = x, l[16] = o) : o = l[16], o
        }(), {
            sponsor: _,
            reset: A,
            isLoading: D
        } = (() => {
            let [e, t] = (0, u.useState)(!1), r = (0, S.useTranslations)(), {
                proxyAddress: n,
                walletMode: s
            } = (0, T.useAccountContext)(["proxyAddress", "walletMode"]), {
                sendTransaction: a
            } = (0, w.default)(), {
                nonce: i,
                incrementNonce: o,
                refreshNonce: l
            } = (0, Y.useDepositWallet)(), {
                chainId: d
            } = R.MATIC_CONFIG;
            return {
                sponsor: (0, u.useCallback)(async e => {
                    let {
                        marketId: c,
                        amount: u,
                        durationDays: p,
                        hasPastSponsorship: m
                    } = e;
                    if (!n) return {
                        success: !1,
                        error: r("rewards.sponsor.noProxyAddress")
                    };
                    if (!c || !u || p <= 0) return {
                        success: !1,
                        error: r("rewards.sponsor.invalidParameters")
                    };
                    try {
                        t(!0);
                        let e = R.chainConfig[d] ? .collateral;
                        if (!e) throw Error(`No collateral address found for chainId ${d}`);
                        let {
                            adjustedAmountBigInt: l,
                            startTime: y,
                            endTime: x,
                            rawAmountBigInt: h
                        } = function(e, t) {
                            let r = (0, G.parseUnits)(e, R.USDC_DECIMALS),
                                n = 60 * Math.ceil((Math.floor(Date.now() / 1e3) + 60) / 60),
                                s = BigInt(24 * t * 60),
                                a = n + 60 * Number(s),
                                i = r / s;
                            if (0 n === i) throw Error(`Amount too low for duration: ${e} USDC over ${t} days results in zero rate per minute`);
                            return {
                                adjustedAmountBigInt: i * s,
                                startTime: n,
                                endTime: a,
                                rawAmountBigInt: r
                            }
                        }(u, p), f = c.startsWith("0x") ? c : `0x${c}`, b = {
                            to: e,
                            data: (0, K.encodeFunctionData)({
                                abi: Q.erc20Abi,
                                functionName: "approve",
                                args: [R.REWARDS_CONTRACT_ADDRESS, h]
                            }),
                            value: "0",
                            typeCode: z.CallType.Call
                        }, g = {
                            to: R.REWARDS_CONTRACT_ADDRESS,
                            data: (0, K.encodeFunctionData)({
                                abi: Z.RewardsAbi,
                                functionName: "sponsor",
                                args: [f, l, y, x]
                            }),
                            value: "0",
                            typeCode: z.CallType.Call
                        }, v = [];
                        if (m) {
                            let e = await (0, et.resolveRewardsContract)(c);
                            v.push({
                                to: e.contractAddress,
                                data: (0, K.encodeFunctionData)({
                                    abi: Z.RewardsAbi,
                                    functionName: "batchWithdraw",
                                    args: [
                                        [f],
                                        [n]
                                    ]
                                }),
                                value: "0",
                                typeCode: z.CallType.Call
                            })
                        }
                        v.push(b, g);
                        let k = (0, w.getTransactionType)(s),
                            S = await a(k, v, 0, R.Network.Matic, 0, void 0, k === w.TransactionType.DepositWallet ? i : void 0, "sponsor rewards", k === w.TransactionType.DepositWallet ? n : void 0);
                        if (k === w.TransactionType.DepositWallet && await o(), !await Promise.race([(0, ee.waitTillMined)(S), new Promise((e, t) => setTimeout(() => t(Error(r("rewards.sponsor.txTimeout"))), 12e4))])) throw Error(r("rewards.sponsor.txFailed"));
                        let T = await S.getTransaction(),
                            C = T[0] ? .transactionHash || S.transactionHash,
                            j = x - y,
                            _ = Number(l) / 10 ** R.USDC_DECIMALS;
                        return t(!1), {
                            success: !0,
                            txHash: C,
                            adjustedAmount: _,
                            ratePerSecond: j > 0 ? _ / j : 0,
                            startTime: y,
                            endTime: x
                        }
                    } catch (a) {
                        if (t(!1), (0, w.getTransactionType)(s) === w.TransactionType.DepositWallet && l(), (0, X.isUserRejection)(a)) return J.logger.warn("[useSponsorRewardsCall] User rejected", {
                            proxyAddress: n
                        }), {
                            success: !1,
                            error: r("rewards.sponsor.signatureRejected")
                        };
                        let e = a ? .message ? ? r("rewards.sponsor.unknownError");
                        return J.logger.error("[useSponsorRewardsCall] Error", {
                            error: e,
                            proxyAddress: n
                        }), {
                            success: !1,
                            error: e
                        }
                    }
                }, [n, d, s, a, i, o, l, r]),
                reset: (0, u.useCallback)(() => {
                    t(!1)
                }, []),
                isLoading: e
            }
        })();
        ! function() {
            let e, t, n, s, a = (0, r.c)(13),
                i = (0, F.useQueryClient)();
            a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress", "walletMode"], a[0] = e) : e = a[0];
            let {
                proxyAddress: o,
                walletMode: l
            } = (0, T.useAccountContext)(e), {
                generateL2Headers: d
            } = (0, $.useL2Headers)(), c = (0, u.useRef)(null), p = (0, L.usePendingSponsorshipsStore)(H), m = (0, L.usePendingSponsorshipsStore)(V), y = (0, L.usePendingSponsorshipsStore)(W);
            a[1] !== p || a[2] !== o ? (t = o ? p.filter(e => e.proxyAddress.toLowerCase() === o.toLowerCase()) : [], a[1] = p, a[2] = o, a[3] = t) : t = a[3];
            let x = t.length > 0;
            a[4] !== y || a[5] !== d || a[6] !== x || a[7] !== o || a[8] !== i || a[9] !== m || a[10] !== l ? (n = () => {
                if (!x || !o || !l) {
                    c.current && (clearTimeout(c.current), c.current = null);
                    return
                }
                let e = !1,
                    t = async () => {
                        y();
                        let e = await d({
                            method: "GET",
                            requestPath: B.ACTIVE_SPONSORSHIP_REQUEST_PATH
                        });
                        if (e)
                            for (let t of L.usePendingSponsorshipsStore.getState().pendingSponsorships.filter(e => e.proxyAddress.toLowerCase() === o.toLowerCase())) try {
                                let r = await (0, N.fetchActiveSponsorship)(t.conditionId, l, e);
                                null !== r.active_sponsorship && (m(t.conditionId), i.setQueryData(["activeSponsorship", t.conditionId, o, l], r), i.invalidateQueries({
                                    queryKey: ["marketSponsorship", t.conditionId]
                                }), i.invalidateQueries({
                                    predicate: q
                                }))
                            } catch {}
                    },
                    r = () => {
                        e || (c.current = setTimeout(async () => {
                            await t(), r()
                        }, 5e3))
                    };
                return t().then(r), () => {
                    e = !0, c.current && (clearTimeout(c.current), c.current = null)
                }
            }, s = [x, o, l, y, m, i, d], a[4] = y, a[5] = d, a[6] = x, a[7] = o, a[8] = i, a[9] = m, a[10] = l, a[11] = n, a[12] = s) : (n = a[11], s = a[12]), (0, u.useEffect)(n, s)
        }(), d[1] !== p || d[2] !== C || d[3] !== A ? (s = e => {
            e || (C(), A()), p(e)
        }, d[1] = p, d[2] = C, d[3] = A, d[4] = s) : s = d[4];
        let M = s;
        d[5] !== M ? (a = () => {
            M(!1)
        }, d[5] = M, d[6] = a) : a = d[6];
        let er = a;
        d[7] !== f || d[8] !== v || d[9] !== m || d[10] !== h || d[11] !== y || d[12] !== _ || d[13] !== g || d[14] !== x ? (i = async () => {
            if (!m ? .market ? .conditionId) return void x.error(new E.ToastBuilder().title(y.configError).description(y.noConditionId));
            let e = await _({
                marketId: m.market.conditionId,
                amount: g.amount,
                durationDays: g.durationDays,
                hasPastSponsorship: m.hasPastSponsorship
            });
            e.success ? (f({
                conditionId: m.market.conditionId,
                proxyAddress: h || "",
                question: m.market.question,
                marketSlug: m.market.slug,
                image: m.market.image,
                amount: e.adjustedAmount ? ? parseFloat(g.amount),
                durationDays: g.durationDays,
                startTime: e.startTime ? ? 0,
                endTime: e.endTime ? ? 0,
                ratePerSecond: e.ratePerSecond ? ? 0,
                txHash: e.txHash || "",
                createdAt: Date.now()
            }), v()) : x.error(new E.ToastBuilder().title(y.sponsorshipFailed).description(e.error || y.unexpectedError))
        }, d[7] = f, d[8] = v, d[9] = m, d[10] = h, d[11] = y, d[12] = _, d[13] = g, d[14] = x, d[15] = i) : i = d[15];
        let en = i;
        return m ? (d[16] !== b || d[17] !== k || d[18] !== v || d[19] !== er || d[20] !== en || d[21] !== D || d[22] !== m || d[23] !== g || d[24] !== j ? (o = (0, t.jsx)(P.ModalContent, {
            children: m.isAlreadySponsored ? (0, t.jsx)(ei, {
                market: m
            }) : (0, t.jsxs)(t.Fragment, {
                children: ["agreement" === b && (0, t.jsx)(ea, {
                    onAccept: v
                }), "input" === b && (0, t.jsx)(ev, {
                    market: m,
                    sponsorshipData: g,
                    onUpdateData: j,
                    onCancel: er,
                    onContinue: v
                }), "review" === b && (0, t.jsx)(ej, {
                    market: m,
                    sponsorshipData: g,
                    onBack: k,
                    onConfirm: en,
                    isLoading: D
                }), "success" === b && (0, t.jsx)(eA, {
                    market: m,
                    sponsorshipData: g,
                    onClose: er,
                    onTrackProgress: er
                })]
            })
        }), d[16] = b, d[17] = k, d[18] = v, d[19] = er, d[20] = en, d[21] = D, d[22] = m, d[23] = g, d[24] = j, d[25] = o) : o = d[25], d[26] !== M || d[27] !== c || d[28] !== o ? (l = (0, t.jsx)(P.Modal, {
            open: c,
            onOpenChange: M,
            children: o
        }), d[26] = M, d[27] = c, d[28] = o, d[29] = l) : l = d[29], l) : null
    };

    function eN(e) {
        let n, i, d, c, u, p, m = (0, r.c)(35),
            {
                onSponsorClick: y,
                isUserSponsor: x,
                isPending: h,
                isLoading: f,
                showLoadingState: w,
                isRestricted: g,
                needsEnableTrading: v,
                onEnableTrading: k,
                isSponsorable: T,
                rewardMarketOverride: C,
                containerRef: j
            } = e,
            _ = (0, S.useTranslations)(),
            A = (0, D.useRewardMarketContext)(),
            M = void 0 !== C ? C : A,
            N = (0, l.useRouter)();
        m[0] !== h || m[1] !== g || m[2] !== x || m[3] !== v || m[4] !== _ ? (n = (0, eg.getSponsorButtonConfig)({
            isRestricted: g,
            isPending: h,
            isUserSponsor: x,
            needsEnableTrading: v,
            t: _
        }), m[0] = h, m[1] = g, m[2] = x, m[3] = v, m[4] = _, m[5] = n) : n = m[5];
        let {
            text: P
        } = n, I = !!M, E = w && !M && !T;
        m[6] !== h || m[7] !== g || m[8] !== v || m[9] !== k || m[10] !== y || m[11] !== N ? (i = () => {
            v ? k() : g || (h ? N.push(`/portfolio?tab=${b.PortfolioTab.MarketRewards}`) : y())
        }, m[6] = h, m[7] = g, m[8] = v, m[9] = k, m[10] = y, m[11] = N, m[12] = i) : i = m[12];
        let O = i;
        return m[13] !== I || m[14] !== M || m[15] !== _ ? (d = I ? (0, t.jsxs)("div", {
            className: "p-4 pb-3",
            children: [(0, t.jsxs)("p", {
                className: "font-medium text-xs mb-2",
                children: [_("rewards.earnRewardsByPlacingLimitOrders"), " ", (0, t.jsx)(o.default, {
                    href: `${R.POLYMARKET_HELP_CENTER_LINK}/en/articles/13364466-liquidity-rewards`,
                    className: "text-text-brand inline-block",
                    children: _("rewards.learnMore")
                })]
            }), (0, t.jsxs)("div", {
                className: "flex justify-between items-center h-5",
                children: [(0, t.jsx)("p", {
                    className: "font-medium text-text-secondary text-xs",
                    children: _("rewards.rewards")
                }), (0, t.jsx)("div", {
                    className: "flex items-center",
                    children: Array.isArray(M ? .rewardTokenLiquidities) ? M.rewardTokenLiquidities.map(eP) : null
                })]
            }), (0, t.jsxs)("div", {
                className: "flex justify-between items-center h-5",
                children: [(0, t.jsx)("p", {
                    className: "font-medium text-text-secondary text-xs",
                    children: _("rewards.maxSpread")
                }), (0, t.jsx)("p", {
                    className: "font-medium text-text-secondary text-xs",
                    children: `\xb1${Math.floor(M?.maxSpread??0)}\xa2`
                })]
            }), (0, t.jsxs)("div", {
                className: "flex justify-between items-center h-5",
                children: [(0, t.jsx)("p", {
                    className: "font-medium text-text-secondary text-xs",
                    children: _("rewards.minShares")
                }), (0, t.jsx)("p", {
                    className: "font-medium text-text-secondary text-xs",
                    children: M.minSize
                })]
            })]
        }) : null, m[13] = I, m[14] = M, m[15] = _, m[16] = d) : d = m[16], m[17] !== E || m[18] !== _ ? (c = E ? (0, t.jsxs)("div", {
            className: "flex items-center gap-2 p-4",
            children: [(0, t.jsx)(a.default, {
                className: "w-3 h-3 border-black/10 border-t-black/60 dark:border-white/20 dark:border-t-white/80"
            }), (0, t.jsx)("p", {
                className: "text-body-xs font-medium text-text-secondary",
                children: _("rewards.sponsor.loading")
            })]
        }) : null, m[17] = E, m[18] = _, m[19] = c) : c = m[19], m[20] !== P || m[21] !== O || m[22] !== f || m[23] !== h || m[24] !== g || m[25] !== T || m[26] !== v || m[27] !== M || m[28] !== _ ? (u = T && (0, t.jsxs)(t.Fragment, {
            children: [M && (0, t.jsx)("div", {
                className: "h-px bg-[#e7e8ea] dark:bg-[#2a3441]"
            }), (0, t.jsxs)("div", {
                className: "flex flex-col gap-3 p-4",
                children: [(0, t.jsxs)("p", {
                    className: "font-medium text-xs",
                    children: [_("rewards.sponsor.attractLiquidity"), " ", (0, t.jsx)("a", {
                        href: `${R.POLYMARKET_HELP_CENTER_LINK}/en/articles/13755867-sponsor-market-rewards`,
                        target: "_blank",
                        rel: "noopener noreferrer",
                        className: "text-text-brand inline-block",
                        children: _("rewards.sponsor.learnMore")
                    })]
                }), (0, t.jsx)(s.Button, {
                    size: "sm",
                    onClick: O,
                    disabled: !v && (f || g),
                    className: "w-full",
                    children: f ? (0, t.jsxs)("span", {
                        className: "flex items-center justify-center gap-1.5",
                        children: [(0, t.jsx)(a.default, {
                            className: "w-3 h-3 border-white/20 border-t-white/80"
                        }), (0, t.jsx)("span", {
                            children: _("rewards.sponsor.loading")
                        })]
                    }) : h ? (0, t.jsxs)("span", {
                        className: "flex items-center justify-center gap-1.5",
                        children: [(0, t.jsx)(a.default, {
                            className: "w-3 h-3 border-white/20 border-t-white/80"
                        }), (0, t.jsx)("span", {
                            children: _("rewards.sponsor.trackOrder")
                        })]
                    }) : P
                }), g && (0, t.jsxs)("p", {
                    className: "text-[11px] text-text-secondary",
                    children: [_("rewards.sponsor.notAvailableInRegion"), " ", (0, t.jsx)(o.default, {
                        href: R.POLYMARKET_TOS_LINK,
                        className: "text-text-brand hover:underline",
                        target: "_blank",
                        rel: "noopener noreferrer",
                        children: _("rewards.sponsor.seeTerms")
                    })]
                })]
            })]
        }), m[20] = P, m[21] = O, m[22] = f, m[23] = h, m[24] = g, m[25] = T, m[26] = v, m[27] = M, m[28] = _, m[29] = u) : u = m[29], m[30] !== j || m[31] !== d || m[32] !== c || m[33] !== u ? (p = (0, t.jsxs)("div", {
            ref: j,
            className: "w-[250px] rounded-lg",
            children: [d, c, u]
        }), m[30] = j, m[31] = d, m[32] = c, m[33] = u, m[34] = p) : p = m[34], p
    }

    function eP(e) {
        let {
            symbol: r
        } = e.rewardToken, n = parseFloat(e ? .clobTokenSupply ? ? "0");
        return (0, t.jsxs)("div", {
            className: "ml-2 flex items-center justify-center",
            children: [(0, A.renderTokenIcon)({
                symbol: r
            }, 12), (0, t.jsx)("p", {
                className: "ml-0.5 text-xs text-text-secondary",
                children: (0, _.formatClobTokenSupply)(n.toString())
            })]
        }, `${e.clobTokenSupply}-${r}`)
    }
    e.s(["default", 0, eM], 155442);
    let eI = (0, u.forwardRef)(function(e, n) {
        let a, i, o, l, u, p, m, y, x, h = (0, r.c)(27);
        h[0] !== e ? ({
            asIcon: a,
            compact: o,
            className: i,
            ...l
        } = e, h[0] = e, h[1] = a, h[2] = i, h[3] = o, h[4] = l) : (a = h[1], i = h[2], o = h[3], l = h[4]);
        let f = (0, S.useTranslations)();
        if (a) {
            let e, r, a;
            h[5] !== f ? (e = f("rewards.rewards"), h[5] = f, h[6] = e) : e = h[6];
            let o = `text-text-secondary w-7 h-7 hover:bg-black/5 dark:hover:bg-white/5${i?` ${i}`:""}`;
            return h[7] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)(d.IconGiftOutline18, {
                size: 16
            }), h[7] = r) : r = h[7], h[8] !== n || h[9] !== e || h[10] !== o || h[11] !== l ? (a = (0, t.jsx)(s.Button, {
                ref: n,
                "aria-label": e,
                variant: "ghost",
                size: "iconSm",
                className: o,
                ...l,
                children: r
            }), h[8] = n, h[9] = e, h[10] = o, h[11] = l, h[12] = a) : a = h[12], a
        }
        let w = `${o?"relative overflow-hidden flex items-center gap-0.5 rounded-md px-1.5 h-6 cursor-pointer hover:bg-surface transition-colors":"relative overflow-hidden flex items-center gap-1 rounded-md px-2 h-7 cursor-pointer hover:bg-surface transition-colors"}${i?` ${i}`:""}`,
            b = o ? 12 : 14;
        h[13] !== b ? (u = (0, t.jsx)(c.IconPlusOutline18, {
            size: b,
            className: "text-[#1652F0] dark:text-[#6AA4FF]"
        }), h[13] = b, h[14] = u) : u = h[14];
        let g = `${o?"text-xs":"text-sm"} font-semibold select-none cursor-pointer bg-gradient-to-r from-[#1652F0] to-[#9B51E0] dark:from-[#6AA4FF] dark:to-[#C08BFF] bg-clip-text text-transparent`;
        return h[15] !== f ? (p = f("rewards.rewards"), h[15] = f, h[16] = p) : p = h[16], h[17] !== g || h[18] !== p ? (m = (0, t.jsx)("span", {
            className: g,
            children: p
        }), h[17] = g, h[18] = p, h[19] = m) : m = h[19], h[20] === Symbol.for("react.memo_cache_sentinel") ? (y = (0, t.jsx)("span", {
            className: "pointer-events-none absolute inset-0 bg-gradient-to-r from-transparent via-white/60 dark:via-white/10 to-transparent",
            style: {
                animation: "rewards-shimmer 2.5s ease-in-out infinite"
            }
        }), h[20] = y) : y = h[20], h[21] !== n || h[22] !== w || h[23] !== u || h[24] !== m || h[25] !== l ? (x = (0, t.jsxs)("button", {
            ref: n,
            type: "button",
            className: w,
            ...l,
            children: [u, m, y]
        }), h[21] = n, h[22] = w, h[23] = u, h[24] = m, h[25] = l, h[26] = x) : x = h[26], x
    });

    function eE(e) {
        let t, s, a, i, o, l, d, c, u, b, k = (0, r.c)(50),
            {
                activeMarket: S,
                contextRewardMarket: R,
                rewardMarketProp: A
            } = e,
            D = S ? .conditionId;
        k[0] !== D ? (t = g.queryKeys[v.QueryKey.Rewards].rewardMarket(D ? ? ""), k[0] = D, k[1] = t) : t = k[1];
        let P = !A && !!D;
        k[2] !== t.queryKey || k[3] !== P ? (s = {
            queryKey: t.queryKey,
            queryFn: h.getSingleRewardFetcher,
            enabled: P,
            staleTime: 3e4,
            retry: 2,
            retryDelay: 5e3
        }, k[2] = t.queryKey, k[3] = P, k[4] = s) : s = k[4];
        let {
            data: I
        } = (0, n.useQuery)(s);
        I ? .data;
        e: {
            let e;
            if (void 0 !== A) {
                a = A;
                break e
            }
            k[5] !== R || k[6] !== I ? .data ? (e = (0, _.fromV4toRewardMarkets)(I ? .data) ? .[0] ? ? R, k[5] = R, k[6] = I ? .data, k[7] = e) : e = k[7],
            a = e
        }
        let E = a,
            O = (0, f.usePermissions)();
        k[8] === Symbol.for("react.memo_cache_sentinel") ? (i = ["authenticated", "authenticationType", "walletMode"], k[8] = i) : i = k[8];
        let {
            authenticated: L,
            authenticationType: F,
            walletMode: $
        } = (0, T.useAccountContext)(i), B = L && !O.canBuy, {
            isSafeDeployed: q
        } = (0, m.useSafe)(), {
            setOnboardingRoute: W,
            setOpen: V,
            setRoute: H
        } = (0, y.useSiwx)(), U = (0, C.useClob)(), {
            setShowApprovalModal: z
        } = (0, j.useModalStore)();
        k[9] !== L || k[10] !== F || k[11] !== q || k[12] !== $ ? (o = L && "magic" !== F && (0, w.requiresWalletDeployment)($) && !q, k[9] = L, k[10] = F, k[11] = q, k[12] = $, k[13] = o) : o = k[13];
        let K = o;
        k[14] !== L || k[15] !== F || k[16] !== U || k[17] !== $ ? (l = L && "magic" !== F && (0, x.mustGenerateApiKeys)(U, $), k[14] = L, k[15] = F, k[16] = U, k[17] = $, k[18] = l) : l = k[18];
        let Q = l,
            G = K || Q;
        k[19] !== K || k[20] !== W || k[21] !== z || k[22] !== V || k[23] !== H ? (d = () => {
            K ? (H(p.AuthRoute.ONBOARDING), W(p.OnboardingRoute.ENABLEEOATRADING), V(!0)) : z(!0)
        }, k[19] = K, k[20] = W, k[21] = z, k[22] = V, k[23] = H, k[24] = d) : d = k[24];
        let Z = d;
        k[25] !== D ? (c = {
            conditionId: D
        }, k[25] = D, k[26] = c) : c = k[26];
        let {
            ref: Y,
            isLoading: X,
            isUserSponsor: J,
            isPending: ee,
            hasPastSponsorship: et,
            userSponsorship: er,
            isSponsorable: en,
            isInitialLoadComplete: es
        } = (0, M.useMarketSponsorshipStatus)(c);
        t: {
            let e, t;
            if (!S) {
                u = null;
                break t
            }
            if (k[27] !== S) e = {
                market: {
                    conditionId: S.conditionId,
                    question: S.question,
                    image: S.image,
                    slug: S.slug
                }
            },
            k[27] = S,
            k[28] = e;
            else e = k[28];
            let r = e;
            if (J && er) {
                let e, t;
                k[29] !== er ? (e = (0, N.toExistingSponsorship)(er), k[29] = er, k[30] = e) : e = k[30], k[31] !== r || k[32] !== et || k[33] !== e ? (t = { ...r,
                    isAlreadySponsored: !0,
                    hasPastSponsorship: et,
                    existingSponsorship: e
                }, k[31] = r, k[32] = et, k[33] = e, k[34] = t) : t = k[34], u = t;
                break t
            }
            k[35] !== r || k[36] !== et ? (t = { ...r,
                hasPastSponsorship: et
            }, k[35] = r, k[36] = et, k[37] = t) : t = k[37],
            u = t
        }
        let ea = u,
            ei = (void 0 !== A || !D || void 0 !== I) && es;
        return k[38] !== en || k[39] !== Z || k[40] !== ei || k[41] !== X || k[42] !== ee || k[43] !== B || k[44] !== J || k[45] !== G || k[46] !== Y || k[47] !== E || k[48] !== ea ? (b = {
            ref: Y,
            rewardMarket: E,
            isLoading: X,
            isUserSponsor: J,
            isPending: ee,
            isRestricted: B,
            needsEnableTrading: G,
            handleEnableTrading: Z,
            canSponsorMarket: en,
            sponsorableMarket: ea,
            isDataReady: ei
        }, k[38] = en, k[39] = Z, k[40] = ei, k[41] = X, k[42] = ee, k[43] = B, k[44] = J, k[45] = G, k[46] = Y, k[47] = E, k[48] = ea, k[49] = b) : b = k[49], b
    }

    function eO(e) {
        let n, s, a, o, d, c, p, m, y, x, h = (0, r.c)(40),
            {
                asIcon: f,
                compact: w,
                rewardMarketProp: g,
                activeMarketProp: v,
                contextRewardMarket: S,
                contextActiveMarket: T,
                setShouldShowRewardOverlay: C
            } = e,
            j = void 0 !== f && f,
            R = void 0 !== w && w,
            [_, A] = (0, u.useState)(!1),
            D = v ? ? T;
        h[0] !== D || h[1] !== S || h[2] !== g ? (n = {
            activeMarket: D,
            contextRewardMarket: S,
            rewardMarketProp: g
        }, h[0] = D, h[1] = S, h[2] = g, h[3] = n) : n = h[3];
        let {
            ref: M,
            rewardMarket: N,
            isLoading: P,
            isUserSponsor: I,
            isPending: E,
            isRestricted: O,
            needsEnableTrading: L,
            handleEnableTrading: F,
            canSponsorMarket: $,
            sponsorableMarket: B
        } = eE(n), q = (0, l.useRouter)();
        h[4] !== $ || h[5] !== F || h[6] !== E || h[7] !== O || h[8] !== L || h[9] !== q ? (s = () => {
            (0, k.isNarrowViewport)() || !$ || (L ? F() : O || (E ? q.push(`/portfolio?tab=${b.PortfolioTab.MarketRewards}`) : A(!0)))
        }, h[4] = $, h[5] = F, h[6] = E, h[7] = O, h[8] = L, h[9] = q, h[10] = s) : s = h[10];
        let W = s;
        h[11] !== C ? (a = e => {
            C(e)
        }, h[11] = C, h[12] = a) : a = h[12];
        let V = a,
            H = !!N || $;
        return D && H ? (h[13] === Symbol.for("react.memo_cache_sentinel") ? (o = () => A(!0), h[13] = o) : o = h[13], h[14] !== $ || h[15] !== F || h[16] !== P || h[17] !== E || h[18] !== O || h[19] !== I || h[20] !== L || h[21] !== N ? (d = (0, t.jsx)(eN, {
            onSponsorClick: o,
            isUserSponsor: I,
            isPending: E,
            isLoading: P,
            showLoadingState: !1,
            isRestricted: O,
            needsEnableTrading: L,
            onEnableTrading: F,
            isSponsorable: $,
            rewardMarketOverride: N
        }), h[14] = $, h[15] = F, h[16] = P, h[17] = E, h[18] = O, h[19] = I, h[20] = L, h[21] = N, h[22] = d) : d = h[22], h[23] !== j || h[24] !== R || h[25] !== W ? (c = (0, t.jsx)(eI, {
            asIcon: j,
            compact: R,
            onClick: W
        }), h[23] = j, h[24] = R, h[25] = W, h[26] = c) : c = h[26], h[27] !== V || h[28] !== d || h[29] !== c ? (p = (0, t.jsx)(i.Tooltip, {
            onOpenChange: V,
            mobileSupport: !0,
            className: "p-0 !border-[rgb(46,92,255)] !z-[225]",
            showArrow: !1,
            content: d,
            children: c
        }), h[27] = V, h[28] = d, h[29] = c, h[30] = p) : p = h[30], h[31] !== M || h[32] !== p ? (m = (0, t.jsx)("div", {
            ref: M,
            children: p
        }), h[31] = M, h[32] = p, h[33] = m) : m = h[33], h[34] !== _ || h[35] !== B ? (y = (0, t.jsx)(eM, {
            open: _,
            onOpenChange: A,
            market: B
        }), h[34] = _, h[35] = B, h[36] = y) : y = h[36], h[37] !== m || h[38] !== y ? (x = (0, t.jsxs)(t.Fragment, {
            children: [m, y]
        }), h[37] = m, h[38] = y, h[39] = x) : x = h[39], x) : null
    }

    function eL(e) {
        let n, s, a, i = (0, r.c)(19),
            {
                activeMarket: o,
                contextRewardMarket: l,
                rewardMarketProp: d,
                onSponsorClick: c
            } = e;
        i[0] !== o || i[1] !== l || i[2] !== d ? (n = {
            activeMarket: o,
            contextRewardMarket: l,
            rewardMarketProp: d
        }, i[0] = o, i[1] = l, i[2] = d, i[3] = n) : n = i[3];
        let {
            ref: u,
            rewardMarket: p,
            isLoading: m,
            isUserSponsor: y,
            isPending: x,
            isRestricted: h,
            needsEnableTrading: f,
            handleEnableTrading: w,
            canSponsorMarket: b,
            sponsorableMarket: g,
            isDataReady: v
        } = eE(n);
        i[4] !== c || i[5] !== g ? (s = () => {
            c(g)
        }, i[4] = c, i[5] = g, i[6] = s) : s = i[6];
        let k = s,
            S = !v;
        return i[7] !== b || i[8] !== w || i[9] !== k || i[10] !== m || i[11] !== x || i[12] !== h || i[13] !== y || i[14] !== f || i[15] !== u || i[16] !== p || i[17] !== S ? (a = (0, t.jsx)(eN, {
            containerRef: u,
            onSponsorClick: k,
            isUserSponsor: y,
            isPending: x,
            isLoading: m,
            showLoadingState: S,
            isRestricted: h,
            needsEnableTrading: f,
            onEnableTrading: w,
            isSponsorable: b,
            rewardMarketOverride: p
        }), i[7] = b, i[8] = w, i[9] = k, i[10] = m, i[11] = x, i[12] = h, i[13] = y, i[14] = f, i[15] = u, i[16] = p, i[17] = S, i[18] = a) : a = i[18], a
    }

    function eF(e) {
        let n, s, a, o, l, d, c, p, m = (0, r.c)(26),
            {
                asIcon: y,
                compact: x,
                rewardMarketProp: h,
                activeMarketProp: f,
                contextRewardMarket: w,
                contextActiveMarket: b,
                openRewardsTooltipId: g,
                setOpenRewardsTooltipId: v,
                setShouldShowRewardOverlay: k
            } = e,
            S = void 0 !== y && y,
            T = void 0 !== x && x,
            C = f ? ? b,
            j = C ? .conditionId ? ? C ? .slug ? ? null,
            R = !!j && null !== g && g === j,
            [_, A] = (0, u.useState)(!1),
            [D, M] = (0, u.useState)(null);
        m[0] !== g || m[1] !== v || m[2] !== k || m[3] !== j ? (n = e => {
            e ? j && v(j) : j && g === j && v(null), k(e)
        }, m[0] = g, m[1] = v, m[2] = k, m[3] = j, m[4] = n) : n = m[4];
        let N = n;
        m[5] === Symbol.for("react.memo_cache_sentinel") ? (s = e => {
            M(e), A(!0)
        }, m[5] = s) : s = m[5];
        let P = s;
        m[6] === Symbol.for("react.memo_cache_sentinel") ? (a = e => {
            A(e), e || M(null)
        }, m[6] = a) : a = m[6];
        let I = a;
        return C ? (m[7] !== C || m[8] !== w || m[9] !== R || m[10] !== h ? (o = R ? (0, t.jsx)(eL, {
            activeMarket: C,
            contextRewardMarket: w,
            rewardMarketProp: h,
            onSponsorClick: P
        }) : null, m[7] = C, m[8] = w, m[9] = R, m[10] = h, m[11] = o) : o = m[11], m[12] !== S || m[13] !== T ? (l = (0, t.jsx)(eI, {
            asIcon: S,
            compact: T
        }), m[12] = S, m[13] = T, m[14] = l) : l = m[14], m[15] !== N || m[16] !== R || m[17] !== o || m[18] !== l ? (d = (0, t.jsx)(i.Tooltip, {
            open: R,
            delayDuration: 0,
            onOpenChange: N,
            mobileSupport: !0,
            className: "p-0 !border-[rgb(46,92,255)] !z-[225]",
            showArrow: !1,
            content: o,
            children: l
        }), m[15] = N, m[16] = R, m[17] = o, m[18] = l, m[19] = d) : d = m[19], m[20] !== _ || m[21] !== D ? (c = (0, t.jsx)(eM, {
            open: _,
            onOpenChange: I,
            market: D
        }), m[20] = _, m[21] = D, m[22] = c) : c = m[22], m[23] !== d || m[24] !== c ? (p = (0, t.jsxs)(t.Fragment, {
            children: [d, c]
        }), m[23] = d, m[24] = c, m[25] = p) : p = m[25], p) : null
    }

    function e$(e) {
        let n, s = (0, r.c)(4);
        if (e.lazyLoad) {
            let r;
            return s[0] !== e ? (r = (0, t.jsx)(eF, { ...e
            }), s[0] = e, s[1] = r) : r = s[1], r
        }
        return s[2] !== e ? (n = (0, t.jsx)(eO, { ...e
        }), s[2] = e, s[3] = n) : n = s[3], n
    }

    function eB(e) {
        let n, s = (0, r.c)(7),
            a = (0, D.useRewardMarketContext)(),
            i = (0, D.useRewardActiveMarketContext)(),
            o = (0, D.useRewardOpenTooltipIdContext)() ? ? null,
            l = (0, D.useRewardOpenTooltipIdSetterContext)() ? ? eq,
            d = (0, D.useRewardOverlaySetterContext)(),
            c = a ? ? null;
        return s[0] !== i || s[1] !== o || s[2] !== e || s[3] !== l || s[4] !== d || s[5] !== c ? (n = (0, t.jsx)(e$, { ...e,
            contextRewardMarket: c,
            contextActiveMarket: i,
            openRewardsTooltipId: o,
            setOpenRewardsTooltipId: l,
            setShouldShowRewardOverlay: d
        }), s[0] = i, s[1] = o, s[2] = e, s[3] = l, s[4] = d, s[5] = c, s[6] = n) : n = s[6], n
    }

    function eq() {}

    function eW(e) {
        let n, s = (0, r.c)(5),
            a = (0, D.useRewardOpenTooltipIdContext)(),
            i = (0, D.useRewardOpenTooltipIdSetterContext)(),
            [o, l] = (0, u.useState)(null),
            d = (0, D.useRewardOverlaySetterContext)(),
            c = a ? ? o,
            p = i ? ? l;
        return s[0] !== c || s[1] !== e || s[2] !== p || s[3] !== d ? (n = (0, t.jsx)(e$, { ...e,
            openRewardsTooltipId: c,
            setOpenRewardsTooltipId: p,
            setShouldShowRewardOverlay: d
        }), s[0] = c, s[1] = e, s[2] = p, s[3] = d, s[4] = n) : n = s[4], n
    }
    let eV = (0, u.memo)(function(e) {
        let n, s = (0, r.c)(4);
        if (void 0 !== e.activeMarketProp || void 0 !== e.rewardMarketProp) {
            let r;
            return s[0] !== e ? (r = (0, t.jsx)(eW, { ...e
            }), s[0] = e, s[1] = r) : r = s[1], r
        }
        return s[2] !== e ? (n = (0, t.jsx)(eB, { ...e
        }), s[2] = e, s[3] = n) : n = s[3], n
    });
    e.s(["default", 0, eV], 853037)
}]);

//# debugId=b729886f-d5cd-d314-a469-ad01938545b0