UNPKG

@nftearth/reservoir-kit-ui

Version:

ReservoirKit is the official frontend kit to get you started building dApps with the ReservoirProtocol.

1,208 lines (1,161 loc) 469 kB
import $TBcmg$react, {createContext as $TBcmg$createContext, useState as $TBcmg$useState, useRef as $TBcmg$useRef, useCallback as $TBcmg$useCallback, useEffect as $TBcmg$useEffect, useContext as $TBcmg$useContext, useSyncExternalStore as $TBcmg$useSyncExternalStore, useMemo as $TBcmg$useMemo, forwardRef as $TBcmg$forwardRef} from "react"; import $TBcmg$swr, {SWRConfig as $TBcmg$SWRConfig, useSWRConfig as $TBcmg$useSWRConfig} from "swr"; import {indigo as $TBcmg$indigo, indigoA as $TBcmg$indigoA, red as $TBcmg$red, gray as $TBcmg$gray, blackA as $TBcmg$blackA, whiteA as $TBcmg$whiteA, green as $TBcmg$green, redDark as $TBcmg$redDark, indigoDark as $TBcmg$indigoDark, indigoDarkA as $TBcmg$indigoDarkA, slateDark as $TBcmg$slateDark} from "@radix-ui/colors"; import {createClient as $TBcmg$createClient, setParams as $TBcmg$setParams, isOpenSeaBanned as $TBcmg$isOpenSeaBanned, getClient as $TBcmg$getClient, getNativeOrderbook as $TBcmg$getNativeOrderbook, getNativeOrderkind as $TBcmg$getNativeOrderkind} from "@nftearth/reservoir-sdk"; import {createStitches as $TBcmg$createStitches} from "@stitches/react"; import $TBcmg$swrinfinite from "swr/infinite"; import {useAccount as $TBcmg$useAccount, useNetwork as $TBcmg$useNetwork, useSwitchNetwork as $TBcmg$useSwitchNetwork, mainnet as $TBcmg$mainnet, goerli as $TBcmg$goerli, useSigner as $TBcmg$useSigner, useBalance as $TBcmg$useBalance, useContractRead as $TBcmg$useContractRead} from "wagmi"; import {constants as $TBcmg$constants, utils as $TBcmg$utils} from "ethers"; import {formatUnits as $TBcmg$formatUnits, parseUnits as $TBcmg$parseUnits, parseEther as $TBcmg$parseEther, formatEther as $TBcmg$formatEther} from "ethers/lib/utils.js"; import {getNetwork as $TBcmg$getNetwork, fetchSigner as $TBcmg$fetchSigner} from "wagmi/actions"; import {optimism as $TBcmg$optimism, arbitrum as $TBcmg$arbitrum} from "@wagmi/core/chains"; import $TBcmg$dayjs from "dayjs"; import $TBcmg$dayjspluginrelativeTimejs from "dayjs/plugin/relativeTime.js"; import $TBcmg$swrimmutable from "swr/immutable"; import {faCircleExclamation as $TBcmg$faCircleExclamation, faCheckCircle as $TBcmg$faCheckCircle, faExchange as $TBcmg$faExchange, faCopy as $TBcmg$faCopy, faSpinner as $TBcmg$faSpinner, faChevronDown as $TBcmg$faChevronDown, faCube as $TBcmg$faCube, faWallet as $TBcmg$faWallet, faChevronLeft as $TBcmg$faChevronLeft, faClose as $TBcmg$faClose, faInfoCircle as $TBcmg$faInfoCircle, faCalendar as $TBcmg$faCalendar, faMagnifyingGlass as $TBcmg$faMagnifyingGlass, faPause as $TBcmg$faPause, faPlay as $TBcmg$faPlay, faShoppingCart as $TBcmg$faShoppingCart, faRefresh as $TBcmg$faRefresh, faArrowUp as $TBcmg$faArrowUp, faArrowDown as $TBcmg$faArrowDown, faCircleCheck as $TBcmg$faCircleCheck, faTriangleExclamation as $TBcmg$faTriangleExclamation, faCircleInfo as $TBcmg$faCircleInfo} from "@fortawesome/free-solid-svg-icons"; import {FontAwesomeIcon as $TBcmg$FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import {motion as $TBcmg$motion, AnimatePresence as $TBcmg$AnimatePresence} from "framer-motion"; import {Root as $TBcmg$Root, Thumb as $TBcmg$Thumb} from "@radix-ui/react-switch"; import {Trigger as $TBcmg$Trigger, Content as $TBcmg$Content, ItemText as $TBcmg$ItemText, Value as $TBcmg$Value, Icon as $TBcmg$Icon, Root as $TBcmg$Root1, Portal as $TBcmg$Portal, ScrollUpButton as $TBcmg$ScrollUpButton, Viewport as $TBcmg$Viewport, ScrollDownButton as $TBcmg$ScrollDownButton, Item as $TBcmg$Item} from "@radix-ui/react-select"; import {Arrow as $TBcmg$Arrow, Content as $TBcmg$Content1, Root as $TBcmg$Root2, Trigger as $TBcmg$Trigger1, Portal as $TBcmg$Portal1} from "@radix-ui/react-popover"; import $TBcmg$reactflatpickr from "react-flatpickr"; import {Title as $TBcmg$Title, Close as $TBcmg$Close, Overlay as $TBcmg$Overlay, Content as $TBcmg$Content2, Root as $TBcmg$Root3, DialogTrigger as $TBcmg$DialogTrigger, DialogPortal as $TBcmg$DialogPortal} from "@radix-ui/react-dialog"; import {Root as $TBcmg$Root4, Viewport as $TBcmg$Viewport1, Scrollbar as $TBcmg$Scrollbar, Thumb as $TBcmg$Thumb1, Corner as $TBcmg$Corner} from "@radix-ui/react-scroll-area"; import {useMeasure as $TBcmg$useMeasure} from "@react-hookz/web"; import * as $TBcmg$wagmichains from "wagmi/chains"; const $7e16985c42c068dc$export$8e8f484d816a71e3 = (overrides)=>{ return { radii: { borderRadius: (overrides === null || overrides === void 0 ? void 0 : overrides.borderRadius) || "4px" }, fonts: { body: (overrides === null || overrides === void 0 ? void 0 : overrides.font) || "sans-serif", button: (overrides === null || overrides === void 0 ? void 0 : overrides.buttonFont) || (overrides === null || overrides === void 0 ? void 0 : overrides.font) || "sans-serif", headline: (overrides === null || overrides === void 0 ? void 0 : overrides.headlineFont) || (overrides === null || overrides === void 0 ? void 0 : overrides.font) || "sans-serif" } }; }; function $e235ec7f4c2cf2ae$export$2e2bcd8739ae039(overrides) { let sharedTheme = (0, $7e16985c42c068dc$export$8e8f484d816a71e3)(overrides); return { colors: { ...(0, $TBcmg$indigo), ...(0, $TBcmg$indigoA), ...(0, $TBcmg$red), ...(0, $TBcmg$gray), ...(0, $TBcmg$blackA), ...(0, $TBcmg$whiteA), ...(0, $TBcmg$green), // accent colors accentBase: "$indigo1", accentBgSubtle: "$indigo2", accentBg: "$indigo3", accentBgHover: "$indigo4", accentBgActive: "$indigo5", accentLine: "$indigo6", accentBorder: "$indigo7", accentBorderHover: (overrides === null || overrides === void 0 ? void 0 : overrides.primaryColor) || "$indigo8", accentSolid: (overrides === null || overrides === void 0 ? void 0 : overrides.primaryColor) || "$indigo9", accentSolidHover: (overrides === null || overrides === void 0 ? void 0 : overrides.primaryHoverColor) || (overrides === null || overrides === void 0 ? void 0 : overrides.primaryColor) || "$indigo10", accentText: "$indigo11", accentTextContrast: "$indigo12", // neutral colors neutralBase: "$gray1", neutralBgSubtle: "white", neutralBg: "$gray3", neutralBgHover: "$gray2", neutralBgActive: "$gray5", neutalLine: "$gray6", neutralBorder: "$gray7", neutralBorderHover: "$gray8", neutralSolid: "$gray9", neutralSolidHover: "$gray10", neutralText: "$gray11", neutralTextContrast: "$gray12", // secondary colors secondaryBase: "$indigoA1", secondaryBgSubtle: "$indigoA2", secondaryBg: "$indigoA3", secondaryBgHover: "$indigoA4", secondaryBgActive: "$indigoA5", secondaryLine: "$indigoA6", secondaryBorder: "$indigoA7", secondaryBorderHover: "$indigoA8", secondarySolid: "$indigoA9", secondarySolidHover: "$indigoA10", secondaryText: "$indigoA11", secondaryTextContrast: "$indigoA12", // general colors borderColor: (overrides === null || overrides === void 0 ? void 0 : overrides.borderColor) || "$neutralBorder", textColor: (overrides === null || overrides === void 0 ? void 0 : overrides.textColor) || "$neutralTextContrast", focusColor: "$neutralTextContrast", errorText: "$red12", errorAccent: "$red10", successAccent: "$green10", // component colors reservoirLogoColor: "#11181C", buttonTextColor: (overrides === null || overrides === void 0 ? void 0 : overrides.buttonTextColor) || "white", buttonTextHoverColor: (overrides === null || overrides === void 0 ? void 0 : overrides.buttonTextHoverColor) || "white", inputBackground: "$neutralBgHover", overlayBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.overlayBackground) || "$blackA10", headerBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.headerBackground) || "$neutralBgHover", footerBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.footerBackground) || "$neutralBgHover", contentBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.contentBackground) || "$neutralBgSubtle", wellBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.wellBackground) || "$gray3", popoverBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.popoverBackground) || "$neutralBase" }, assets: { ethIcon: (overrides === null || overrides === void 0 ? void 0 : overrides.ethIcon) || "gray" }, ...sharedTheme }; } function $1fa63d73b4d6b2f8$export$2e2bcd8739ae039(overrides) { let sharedTheme = (0, $7e16985c42c068dc$export$8e8f484d816a71e3)(overrides); return { colors: { ...(0, $TBcmg$redDark), ...(0, $TBcmg$indigoDark), ...(0, $TBcmg$indigoDarkA), ...(0, $TBcmg$slateDark), ...(0, $TBcmg$blackA), ...(0, $TBcmg$green), // accent colors accentBase: "$indigo1", accentBgSubtle: "$indigo2", accentBg: "$indigo3", accentBgHover: "$indigo4", accentBgActive: "$indigo5", accentLine: "$indigo6", accentBorder: "$indigo7", accentBorderHover: (overrides === null || overrides === void 0 ? void 0 : overrides.primaryColor) || "$indigo8", accentSolid: (overrides === null || overrides === void 0 ? void 0 : overrides.primaryColor) || "$indigo9", accentSolidHover: (overrides === null || overrides === void 0 ? void 0 : overrides.primaryHoverColor) || (overrides === null || overrides === void 0 ? void 0 : overrides.primaryColor) || "$indigo10", accentText: "$indigo11", accentTextContrast: "$indigo12", // neutral colors neutralBase: "$slate1", neutralBgSubtle: "$slate2", neutralBg: "$slate3", neutralBgHover: "$slate4", neutralBgActive: "$slate5", neutalLine: "$slate6", neutralBorder: "$slate7", neutralBorderHover: "$slate8", neutralSolid: "$slate9", neutralSolidHover: "$slate10", neutralText: "$slate11", neutralTextContrast: "$slate12", // secondary colors secondaryBase: "$indigoA1", secondaryBgSubtle: "$indigoA2", secondaryBg: "$indigoA3", secondaryBgHover: "$indigoA4", secondaryBgActive: "$indigoA5", secondaryLine: "$indigoA6", secondaryBorder: "$indigoA7", secondaryBorderHover: "$indigoA8", secondarySolid: "$indigoA9", secondarySolidHover: "$indigoA10", secondaryText: "$indigoA11", secondaryTextContrast: "$indigoA12", // general colors borderColor: (overrides === null || overrides === void 0 ? void 0 : overrides.borderColor) || "$neutralBorder", textColor: (overrides === null || overrides === void 0 ? void 0 : overrides.textColor) || "$neutralTextContrast", focusColor: "$neutralTextContrast", errorText: "$red12", errorAccent: "$red10", successAccent: "$green10", // component colors reservoirLogoColor: "#ECEDEE", inputBackground: "$neutralBgHover", buttonTextColor: (overrides === null || overrides === void 0 ? void 0 : overrides.buttonTextColor) || "white", buttonTextHoverColor: (overrides === null || overrides === void 0 ? void 0 : overrides.buttonTextHoverColor) || "white", overlayBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.overlayBackground) || "$blackA10", headerBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.headerBackground) || "$neutralBgHover", footerBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.footerBackground) || "$neutralBg", contentBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.contentBackground) || "$neutralBgSubtle", wellBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.wellBackground) || "$neutralBase", popoverBackground: (overrides === null || overrides === void 0 ? void 0 : overrides.popoverBackground) || "$neutralBgActive" }, assets: { ethIcon: (overrides === null || overrides === void 0 ? void 0 : overrides.ethIcon) || "purple" }, ...sharedTheme }; } var $fe6ce5c2ceb86f27$exports = {}; $fe6ce5c2ceb86f27$exports = JSON.parse('{"name":"@nftearth/reservoir-kit-ui","description":"ReservoirKit is the official frontend kit to get you started building dApps with the ReservoirProtocol.","version":"0.10.5","author":"Reservoir Protocol","license":"MIT","source":"src/index.ts","exports":"./dist/index.module.js","module":"dist/index.module.js","types":"dist/index.d.ts","type":"module","files":["dist"],"keywords":["nft","reservoir","reservoirkit","protocol","sdk"],"sideEffects":false,"scripts":{"clean":"rm -rf dist","version":"yarn version","version:package":"sh ../../scripts/package-version.sh","version:update":"yarn version ${0}; PACKAGE_VERSION=$(yarn version:package); git add -A; git commit -m \\"\uD83C\uDF89 Release ui package v$PACKAGE_VERSION\\"; git push","version:prerelease":"yarn version prerelease; RC_VERSION=$(yarn version:package); git add -A; git commit -m \\"\u2728 Prerelease ui package v$RC_VERSION\\"; git push;","changelog":"node ../../scripts/generate-changelog.js package=ui"},"dependencies":{"@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@fortawesome/react-fontawesome":"^0.2.0","@nftearth/reservoir-sdk":"workspace:*","@radix-ui/colors":"^0.1.8","@radix-ui/react-dialog":"1.0.1-rc.2","@radix-ui/react-popover":"1.0.1-rc.2","@radix-ui/react-scroll-area":"1.0.1-rc.2","@radix-ui/react-select":"1.0.1-rc.2","@radix-ui/react-switch":"1.0.0","@radix-ui/react-toggle-group":"^1.0.0","@react-hookz/web":"^19.2.0","@stitches/react":"^1.2.8","@wagmi/core":"^0.9.5","dayjs":"^1.11.4","flatpickr":"^4.6.13","framer-motion":"^6.4.2","react-flatpickr":"^3.10.13","swr":"2.0.1"},"peerDependencies":{"ethers":"^5.6.1","react":"^18.0","react-dom":"^18.0","wagmi":"^0.10.11"},"repository":{"type":"git","url":"https://github.com/reservoirprotocol/reservoir-kit"}}'); const $2deec6552e3d4fa0$export$61eba4f5b935df88 = /*#__PURE__*/ (0, $TBcmg$createContext)(null); const $2deec6552e3d4fa0$export$9d733ffc7f61c45c = function({ children: children , options: options }) { const [clientContext] = (0, $TBcmg$useState)((0, $TBcmg$createClient)({ ...options, uiVersion: (0, $fe6ce5c2ceb86f27$exports.version) })); return /*#__PURE__*/ (0, $TBcmg$react).createElement($2deec6552e3d4fa0$export$61eba4f5b935df88.Provider, { value: clientContext }, children); }; const { createTheme: $4a58f4053e821189$export$25d302a5b900a763 , keyframes: $4a58f4053e821189$export$d25ddfdf17c3ad3e , styled: $4a58f4053e821189$export$3817b7a54a07cec7 , globalCss: $4a58f4053e821189$export$db53682eef82cc11 , getCssText: $4a58f4053e821189$export$681e449128971c74 , theme: $4a58f4053e821189$export$bca14c5b3b88a9c9 , config: $4a58f4053e821189$export$e506a1d27d1eaa20 , } = (0, $TBcmg$createStitches)({ theme: { space: { 1: "4px", 2: "8px", 3: "12px", 4: "16px", 5: "32px", 6: "64px" }, fontSizes: {}, fontWeights: {}, fonts: { body: "sans-serif", button: "$body" }, lineHeights: {}, letterSpacings: {}, sizes: {}, radii: { borderRadius: 0 }, shadows: {}, transitions: {} }, utils: { // MARGIN m: (value)=>({ margin: value }), mx: (value)=>({ marginLeft: value, marginRight: value }), my: (value)=>({ marginTop: value, marginBottom: value }), mt: (value)=>({ marginTop: value }), mb: (value)=>({ marginBottom: value }), ml: (value)=>({ marginLeft: value }), mr: (value)=>({ marginRight: value }), // PADDING p: (value)=>({ padding: value }), px: (value)=>({ paddingLeft: value, paddingRight: value }), py: (value)=>({ paddingTop: value, paddingBottom: value }), pt: (value)=>({ paddingTop: value }), pb: (value)=>({ paddingBottom: value }), pl: (value)=>({ paddingLeft: value }), pr: (value)=>({ paddingRight: value }), // DIMENSIONS w: (value)=>({ width: value }), h: (value)=>({ height: value }), size: (value)=>({ width: value, height: value }) }, media: { bp1: "(min-width: 600px)", bp2: "(min-width: 905px)", bp3: "(min-width: 1240px)", bp4: "(min-width: 1440px)", motion: "(prefers-reduced-motion)", hover: "(any-hover: hover)", dark: "(prefers-color-scheme: dark)", light: "(prefers-color-scheme: light)" }, prefix: "rk" }); const $36299c87cce4672d$export$a6f1ecf08e412113 = (apiKey, clientVersion)=>{ const headers = { "x-rkui-version": (0, $fe6ce5c2ceb86f27$exports.version) }; if (apiKey) headers["x-api-key"] = apiKey; if (clientVersion) headers["x-rkc-version"] = clientVersion; return headers; }; const $36299c87cce4672d$export$77754e0ac9f8aba3 = (params)=>{ let resource; let apiKey; let clientVersion; if (Array.isArray(params)) { resource = params[0]; apiKey = params[1]; clientVersion = params[2]; } else resource = params; const headers = $36299c87cce4672d$export$a6f1ecf08e412113(apiKey, clientVersion); return fetch(resource, { headers: headers }).then((res)=>res.json()).catch((e)=>{ throw e; }); }; const $36299c87cce4672d$export$6f9d915eee0c027b = { fetcher: $36299c87cce4672d$export$77754e0ac9f8aba3, revalidateOnFocus: false }; const $dc47145da9e25ac7$var$fpFadeInDown = (0, $4a58f4053e821189$export$d25ddfdf17c3ad3e)({ "0%": { opacity: 0, transform: "translate3d(0, -20px, 0)" }, "100%": { opacity: 1, transform: "translate3d(0, 0, 0)" } }); const $dc47145da9e25ac7$var$calendarCss = (0, $4a58f4053e821189$export$db53682eef82cc11)({ ".flatpickr-calendar": { opacity: 0, display: "none", textAlign: "center", visibility: "hidden", padding: 20, animation: "none", direction: "ltr", fontSize: 14, lineHeight: "24px", borderRadius: 5, position: "absolute", width: 307.875, boxSizing: "border-box", touchAction: "manipulation", backgroundColor: "$contentBackground", boxShadow: "1px 0 0 #20222c, -1px 0 0 #20222c, 0 1px 0 #20222c, 0 -1px 0 #20222c, 0 3px 13px rgba(0,0,0,0.08)", border: "1px solid $borderColor", fontFamily: "$body" }, ".flatpickr-calendar.open": { opacity: 1, maxHeight: 640, visibility: "visible", display: "inline-block", zIndex: 99999, pointerEvents: "all" }, ".flatpickr-calendar.inline": { opacity: 1, maxHeight: 640, visibility: "visible", display: "block", position: "relative", top: 2 }, ".flatpickr-calendar.animate.open": { animation: `${$dc47145da9e25ac7$var$fpFadeInDown} 300ms cubic-bezier(0.23, 1, 0.32, 1)` }, ".flatpickr-calendar.static": { position: "absolute", top: "calc(100% + 2px)" }, ".flatpickr-calendar.static.open": { zIndex: 999, display: "block" }, ".flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7)": { boxShadow: "none !important" }, ".flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1)": { boxShadow: "-2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6" }, ".flatpickr-calendar .hasWeeks .dayContainer": { borderBottom: 0, borderBottomRightRadius: 0, borderBottomLeftRadius: 0, borderLeft: 0 }, ".flatpickr-calendar .hasTime .dayContainer": { borderBottom: 0, borderBottomRightRadius: 0, borderBottomLeftRadius: 0 }, ".flatpickr-calendar.hasTime .flatpickr-time": { height: 40 }, ".flatpickr-calendar.noCalendar.hasTime .flatpickr-time": { height: "auto" }, ".flatpickr-calendar:before": { position: "absolute", display: "block", pointerEvents: "none", border: "solid transparent", content: "", height: 0, width: 0, left: 22, borderWidth: 5, margin: "0 -5px" }, ".flatpickr-calendar:after": { position: "absolute", display: "block", pointerEvents: "none", border: "solid transparent", content: "", height: 0, width: 0, left: 22, borderWidth: 4, margin: "0 -4px" }, ".flatpickr-calendar.rightMost:before, .flatpickr-calendar.arrowRight:before, .flatpickr-calendar.rightMost:after, .flatpickr-calendar.arrowRight:after": { left: "auto", right: 22 }, ".flatpickr-calendar.arrowCenter:before, .flatpickr-calendar.arrowCenter:after": { left: "50%", right: "50%" }, ".flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after": { bottom: "100%" }, ".flatpickr-calendar.arrowTop:before": { display: "none" }, ".flatpickr-calendar.arrowTop:after": { display: "none" }, ".flatpickr-calendar.arrowBottom:before, .flatpickr-calendar.arrowBottom:after": { top: "100%" }, ".flatpickr-calendar.arrowBottom:before": { display: "none" }, ".flatpickr-calendar.arrowBottom:after": { display: "none" }, ".flatpickr-calendar:focus": { outline: 0 }, ".flatpickr-wrapper": { position: "relative", display: "inline-block" }, ".flatpickr-months": { display: "flex" }, ".flatpickr-months .flatpickr-month": { backgroundColor: "$contentBackground", color: "$neutralTextContrast", fill: "$neutralTextContrast", height: 34, lineHeight: "1px", textAlign: "center", position: "relative", userSelect: "none", overflow: "hidden", flex: 1, marginBottom: 8 }, ".flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month": { userSelect: "none", textDecoration: "none", cursor: "pointer", position: "absolute", top: 20, height: 34, padding: 10, zIndex: 3, color: "$neutralText", fill: "$neutralText" }, ".flatpickr-months .flatpickr-prev-month.flatpickr-disabled, .flatpickr-months .flatpickr-next-month.flatpickr-disabled": { display: "none" }, ".flatpickr-months .flatpickr-prev-month i, .flatpickr-months .flatpickr-next-month i": { position: "relative" }, ".flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, .flatpickr-months .flatpickr-next-month.flatpickr-prev-month": { left: 0 }, ".flatpickr-months .flatpickr-prev-month.flatpickr-next-month, .flatpickr-months .flatpickr-next-month.flatpickr-next-month": { right: 0 }, ".flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover": { color: "$neutralText" }, ".flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg": { fill: "$neutralTextContrast" }, ".flatpickr-months .flatpickr-prev-month svg, .flatpickr-months .flatpickr-next-month svg": { width: 14, height: 14 }, ".flatpickr-months .flatpickr-prev-month svg path, .flatpickr-months .flatpickr-next-month svg path": { transition: "fill 0.1s", fill: "inherit" }, ".numInputWrapper": { position: "relative", height: "auto" }, ".numInputWrapper input, .numInputWrapper span": { display: "inline-block" }, ".numInputWrapper input": { width: "100%" }, ".numInputWrapper input::-ms-clear": { display: "none" }, ".numInputWrapper input::-webkit-outer-spin-button, .numInputWrapper input::-webkit-inner-spin-button": { margin: 0, "-webkit-appearance": "none" }, ".numInputWrapper span": { position: "absolute", right: 0, width: 14, padding: "0 4px 0 2px", height: "50%", lineHeight: "50%", opacity: 0, cursor: "pointer", boxSizing: "border-box" }, ".numInputWrapper span:hover": { background: "$neutralBgHover" }, ".numInputWrapper span:active": { background: "$neutralBgActive" }, ".numInputWrapper span:after": { display: "block", content: "", position: "absolute" }, ".numInputWrapper span.arrowUp": { top: 0, borderBottom: 0 }, ".numInputWrapper span.arrowUp:after": { borderLeft: "4px solid transparent", borderRight: "4px solid transparent", borderBottom: "4px solid $neutralText", top: "26%" }, ".numInputWrapper span.arrowDown": { top: "50%" }, ".numInputWrapper span.arrowDown:after": { borderLeft: "4px solid transparent", borderRight: "4px solid transparent", borderTop: "4px solid $neutralText", top: "40%" }, ".numInputWrapper span svg": { width: "inherit", height: "auto" }, ".numInputWrapper span svg path": { fill: "$neutralBgHover" }, ".numInputWrapper:hover": { background: "$neutralBgHover" }, ".numInputWrapper:hover span": { opacity: 1 }, ".flatpickr-current-month": { fontSize: "135%", fontWeight: 300, color: "$neutralText", position: "absolute", width: "83%", left: "12.5%", lineHeight: "1px", height: 34, display: "flex", alignItems: "center", gap: 12, textAlign: "center", transform: "translate3d(0px, 0px, 0px)" }, ".flatpickr-current-month span.cur-month": { fontFamily: "inherit", fontWeight: 700, color: "$neutralText", display: "inline-block", marginLeft: "0.5ch", padding: 0 }, ".flatpickr-current-month span.cur-month:hover": { background: "rgba(192,187,167,0.05)" }, ".flatpickr-current-month .numInputWrapper": { width: "7ch\0", display: "inline-block" }, ".flatpickr-current-month .numInputWrapper span.arrowUp:after": { borderBottomColor: "$neutralText" }, ".flatpickr-current-month .numInputWrapper span.arrowDown:after": { borderTopColor: "$neutralText" }, ".flatpickr-current-month input.cur-year": { backgroundColor: "transparent", boxSizing: "border-box", color: "$neutralText", cursor: "text", margin: 0, display: "inline-block", fontSize: "inherit", fontFamily: "inherit", lineHeight: "inherit", height: "auto", border: 0, borderRadius: 0, verticalAlign: "initial", appearance: "textfield", padding: "4px 0px" }, ".flatpickr-current-month input.cur-year:focus": { outline: 0 }, ".flatpickr-current-month input.cur-year[disabled], .flatpickr-current-month input.cur-year[disabled]:hover": { fontSize: "100%", color: "$neutralText", background: "transparent", pointerEvents: "none" }, ".flatpickr-current-month .flatpickr-monthDropdown-months": { appearance: "menulist", backgroundColor: "transparent", border: "none", borderRadius: 0, boxSizing: "border-box", color: "$neutralText", cursor: "pointer", fontSize: "inherit", fontFamily: "inherit", height: "auto", lineHeight: "inherit", outline: "none", position: "relative", verticalAlign: "initial", width: "auto", padding: "4px 8px" }, ".flatpickr-current-month .flatpickr-monthDropdown-months:focus, .flatpickr-current-month .flatpickr-monthDropdown-months:active": { outline: "none" }, ".flatpickr-current-month .flatpickr-monthDropdown-months:hover": { backgroundColor: "$neutralBgHover" }, ".flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month": { backgroundColor: "$neutralBg", outline: "none", padding: 0 }, ".flatpickr-weekdays": { backgroundColor: "transparent", color: "$neutralText", textAlign: "center", overflow: "hidden", width: "100%", display: "flex", alignItems: "center", height: 28, border: "transparent", marginBottom: 8 }, ".flatpickr-weekdays .flatpickr-weekdaycontainer": { display: "flex", flex: 1 }, "span.flatpickr-weekday": { cursor: "default", fontSize: "90%", background: "transparent", color: "$neutralText", lineHeight: "1px", margin: 0, textAlign: "center", display: "block", flex: 1, fontWeight: "bolder" }, ".dayContainer, .flatpickr-weeks": { padding: "1px 0 0 0" }, ".flatpickr-days": { position: "relative", overflow: "hidden", display: "flex", alignItems: "flex-start", width: 307.875, marginBottom: 12 }, ".flatpickr-days:focus": { outline: 0 }, ".dayContainer": { padding: 0, outline: 0, textAlign: "left", width: 307.875, minWidth: 307.875, maxWidth: 307.875, boxSizing: "border-box", display: "flex", flexWrap: "wrap", "-ms-flex-pack": "justify", justifyContent: "space-around", transform: "translate3d(0px, 0px, 0px)", opacity: 1 }, ".dayContainer + .dayContainer": { boxShadow: "-1px 0 0 #20222c" }, ".flatpickr-day": { background: "none", border: "1px solid transparent", borderRadius: 150, boxSizing: "border-box", color: "$neutralText", cursor: "pointer", fontWeight: 400, width: "14.2857143%", flexBasis: "14.2857143%", maxWidth: 39, height: 39, lineHeight: "39px", margin: 0, display: "inline-block", position: "relative", "-webkit-box-pack": "center", "-ms-flex-pack": "center", justifyContent: "center", textAlign: "center" }, ".flatpickr-day.inRange, .flatpickr-day.prevMonthDay.inRange, .flatpickr-day.nextMonthDay.inRange, .flatpickr-day.today.inRange, .flatpickr-day.prevMonthDay.today.inRange, .flatpickr-day.nextMonthDay.today.inRange, .flatpickr-day:hover, .flatpickr-day.prevMonthDay:hover, .flatpickr-day.nextMonthDay:hover, .flatpickr-day:focus, .flatpickr-day.prevMonthDay:focus, .flatpickr-day.nextMonthDay:focus": { cursor: "pointer", outline: 0, backgroundColor: "$accentBg", borderColor: "$neutralBorder" }, ".flatpickr-day.today": { borderColor: "$neutralBorder" }, ".flatpickr-day.today:hover, .flatpickr-day.today:focus": { borderColor: "$neutralBorder", backgroundColor: "$neutralBg", color: "$buttonTextColor" }, ".flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay": { backgroundColor: "$accentBg", boxShadow: "none", color: "$neutralTextContrast", borderColor: "$borderColor" }, ".flatpickr-day.selected.startRange, .flatpickr-day.startRange.startRange, .flatpickr-day.endRange.startRange": { borderRadius: "50px 0 0 50px" }, ".flatpickr-day.selected.endRange, .flatpickr-day.startRange.endRange, .flatpickr-day.endRange.endRange": { borderRadius: "0 50px 50px 0" }, ".flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1))": { boxShadow: "-10px 0 0 #80cbc4" }, ".flatpickr-day.selected.startRange.endRange, .flatpickr-day.startRange.startRange.endRange, .flatpickr-day.endRange.startRange.endRange": { borderRadius: 50 }, ".flatpickr-day.inRange": { borderRadius: 0, boxShadow: "-5px 0 0 #646c8c, 5px 0 0 #646c8c" }, ".flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay, .flatpickr-day.notAllowed, .flatpickr-day.notAllowed.prevMonthDay, .flatpickr-day.notAllowed.nextMonthDay": { color: "$neutralText", background: "transparent", borderColor: "transparent", cursor: "default" }, ".flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover": { cursor: "not-allowed", color: "$neutralText", opacity: 0.5 }, ".flatpickr-day.week.selected": { borderRadius: 0, boxShadow: "-5px 0 0 #80cbc4, 5px 0 0 #80cbc4" }, ".flatpickr-day.hidden": { visibility: "hidden" }, ".rangeMode .flatpickr-day": { marginTop: 1 }, ".flatpickr-weekwrapper": { float: "left" }, ".flatpickr-weekwrapper .flatpickr-weeks": { padding: "0 12px", boxShadow: "1px 0 0 #20222c" }, ".flatpickr-weekwrapper .flatpickr-weekday": { float: "none", width: "100%", lineHeight: "28px" }, ".flatpickr-weekwrapper span.flatpickr-day, .flatpickr-weekwrapper span.flatpickr-day:hover": { display: "block", width: "100%", maxWidth: "none", color: "$neutralText", background: "transparent", cursor: "default", border: "none" }, ".flatpickr-innerContainer": { display: "flex", boxSizing: "border-box", overflow: "hidden" }, ".flatpickr-rContainer": { display: "inline-block", padding: 0, boxSizing: "border-box" }, ".flatpickr-time": { textAlign: "center", outline: 0, height: 0, lineHeight: "40px", maxHeight: 40, boxSizing: "border-box", overflow: "hidden", display: "flex" }, ".flatpickr-time:after": { content: "", display: "table", clear: "both" }, ".flatpickr-time .numInputWrapper": { flex: 1, width: "40%", height: 40, float: "left" }, ".flatpickr-time .numInputWrapper span.arrowUp:after": { borderBottomColor: "$neutralText" }, ".flatpickr-time .numInputWrapper span.arrowDown:after": { borderTopColor: "$neutralText" }, ".flatpickr-time.hasSeconds .numInputWrapper": { width: "26%" }, ".flatpickr-time.time24hr .numInputWrapper": { width: "49%" }, ".flatpickr-time input": { background: "transparent", boxShadow: "none", border: 0, borderRadius: 0, textAlign: "center", margin: 0, padding: 0, height: "inherit", lineHeight: "inherit", color: "$neutralText", fontSize: 14, position: "relative", boxSizing: "border-box", appearance: "textfield" }, ".flatpickr-time input.flatpickr-hour": {}, ".flatpickr-time input.flatpickr-minute, .flatpickr-time input.flatpickr-second": { fontWeight: 400 }, ".flatpickr-time input:focus": { outline: 0, border: 0 }, ".flatpickr-time .flatpickr-time-separator, .flatpickr-time .flatpickr-am-pm": { height: "inherit", float: "left", lineHeight: "inherit", color: "$neutralText", fontWeight: "bold", width: "2%", userSelect: "none", "-ms-flex-item-align": "center", alignSelf: "center" }, ".flatpickr-time .flatpickr-am-pm": { outline: 0, width: "18%", cursor: "pointer", textAlign: "center", fontWeight: 400 }, ".flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover, .flatpickr-time input:focus, .flatpickr-time .flatpickr-am-pm:focus": { background: "$neutralBgHover" }, ".flatpickr-input[readonly]": { cursor: "pointer" }, ".flatpickr-input.flatpickr-mobile": { "&::-webkit-inner-spin-button": { display: "none", "-webkit-appearance": "none" }, "&::-webkit-calendar-picker-indicator": { position: "absolute", left: 0, top: 0, width: "100%", height: "100%", backgroundImage: "none" }, "&::-webkit-datetime-edit": { display: "none", "-webkit-appearance": "none" }, "&::-webkit-date-and-time-value": { display: "none", "-webkit-appearance": "none" } }, "@-moz-document url-prefix()": { "@media only screen and (max-width: 600px)": { '.flatpickr-input[type="text"]': { color: "transparent" } } } }); var $dc47145da9e25ac7$export$2e2bcd8739ae039 = $dc47145da9e25ac7$var$calendarCss; const $3fd7a7c58aadc6ae$var$useMutationObservable = (callback, el, options)=>{ const [observer, setObserver] = (0, $TBcmg$useState)(null); (0, $TBcmg$useEffect)(()=>{ if (observer) observer.disconnect(); if (!el || typeof window === "undefined" || !("MutationObserver" in window)) return; const obs = new MutationObserver(callback); obs.observe(el, options); setObserver(obs); return ()=>{ obs.disconnect(); }; }, [ el, callback, options ]); return observer; }; var $3fd7a7c58aadc6ae$export$2e2bcd8739ae039 = $3fd7a7c58aadc6ae$var$useMutationObservable; const $f4609ce2cb6b416b$export$2c657da244d00bd6 = /*#__PURE__*/ (0, $TBcmg$createContext)(undefined); const $f4609ce2cb6b416b$export$f66a1c3c9465af21 = /*#__PURE__*/ (0, $TBcmg$createContext)({}); const $f4609ce2cb6b416b$var$defaultOptions = { chains: [ { baseApiUrl: "https://indexer.nftearth.exchange", id: 10, default: true } ] }; const $f4609ce2cb6b416b$var$classNameObserverOptions = { attributeFilter: [ "class" ] }; const $f4609ce2cb6b416b$export$14ec072536e53e19 = function({ children: children , options: options = $f4609ce2cb6b416b$var$defaultOptions , theme: theme , swrOptions: swrOptions = {} , }) { const [globalTheme, setGlobalTheme] = (0, $TBcmg$useState)(); const [providerOptions, setProviderOptions] = (0, $TBcmg$useState)({}); const currentTheme = (0, $TBcmg$useRef)(null); const classNameCallback = (0, $TBcmg$useCallback)((mutationList)=>{ mutationList.forEach((mutation)=>{ const body = mutation.target; if (mutation.attributeName === "class" && body && !body.className.includes(currentTheme.current)) document.body.classList.add(currentTheme.current); }); }, [ currentTheme ]); (0, $3fd7a7c58aadc6ae$export$2e2bcd8739ae039)(classNameCallback, typeof window !== "undefined" ? document.body : null, $f4609ce2cb6b416b$var$classNameObserverOptions); (0, $dc47145da9e25ac7$export$2e2bcd8739ae039)(); (0, $TBcmg$useEffect)(()=>{ let newTheme = (0, $4a58f4053e821189$export$25d302a5b900a763)(theme ? theme : (0, $1fa63d73b4d6b2f8$export$2e2bcd8739ae039)()); let oldTheme = currentTheme.current; currentTheme.current = newTheme; document.body.classList.add(newTheme); if (oldTheme) document.body.classList.remove(oldTheme); setGlobalTheme(newTheme); }, [ JSON.stringify(theme) ]); (0, $TBcmg$useEffect)(()=>{ setProviderOptions(options); }, [ options ]); return /*#__PURE__*/ (0, $TBcmg$react).createElement($f4609ce2cb6b416b$export$2c657da244d00bd6.Provider, { value: globalTheme }, /*#__PURE__*/ (0, $TBcmg$react).createElement($f4609ce2cb6b416b$export$f66a1c3c9465af21.Provider, { value: providerOptions }, /*#__PURE__*/ (0, $TBcmg$react).createElement((0, $2deec6552e3d4fa0$export$9d733ffc7f61c45c), { options: options }, /*#__PURE__*/ (0, $TBcmg$react).createElement((0, $TBcmg$SWRConfig), { value: { ...(0, $36299c87cce4672d$export$6f9d915eee0c027b), ...swrOptions } }, children)))); }; function $afd6276a623787c2$export$2e2bcd8739ae039(options, swrOptions = {}, chainId) { var _a, _b; const client = (0, $3663d60eaf20fbf3$export$2e2bcd8739ae039)(); const chain1 = chainId !== undefined ? client === null || client === void 0 ? void 0 : client.chains.find((chain)=>chain.id === chainId) : client === null || client === void 0 ? void 0 : client.currentChain(); const response = (0, $5e2a1f52f4fac2ad$export$2e2bcd8739ae039)((pageIndex, previousPageData)=>{ if (!options) return null; const url = new URL(`${chain1 === null || chain1 === void 0 ? void 0 : chain1.baseApiUrl}/collections/v5`); let query = { ...options }; if (previousPageData && !previousPageData.continuation) return null; else if (previousPageData && pageIndex > 0) query.continuation = previousPageData.continuation; if (query.normalizeRoyalties === undefined && (client === null || client === void 0 ? void 0 : client.normalizeRoyalties) !== undefined) query.normalizeRoyalties = client.normalizeRoyalties; (0, $TBcmg$setParams)(url, query); return [ url.href, chain1 === null || chain1 === void 0 ? void 0 : chain1.apiKey, client === null || client === void 0 ? void 0 : client.version ]; }, { revalidateOnMount: true, revalidateFirstPage: false, ...swrOptions }); const collections = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.flatMap((page)=>(page === null || page === void 0 ? void 0 : page.collections) || [])) !== null && _b !== void 0 ? _b : []; return { ...response, data: collections }; } function $3ec5bd98aa11a4af$export$2e2bcd8739ae039(options, swrOptions = {}, chainId) { var _a, _b; const client = (0, $3663d60eaf20fbf3$export$2e2bcd8739ae039)(); const chain1 = chainId !== undefined ? client === null || client === void 0 ? void 0 : client.chains.find((chain)=>chain.id === chainId) : client === null || client === void 0 ? void 0 : client.currentChain(); const response = (0, $5e2a1f52f4fac2ad$export$2e2bcd8739ae039)((pageIndex, previousPageData)=>{ if (!options || !options.collection && !options.collectionsSetId && !options.community) return null; const url = new URL(`${chain1 === null || chain1 === void 0 ? void 0 : chain1.baseApiUrl}/collections/activity/v5`); let query = { ...options }; if (previousPageData && !previousPageData.continuation) return null; else if (previousPageData && pageIndex > 0) query.continuation = previousPageData.continuation; (0, $TBcmg$setParams)(url, query); return [ url.href, chain1 === null || chain1 === void 0 ? void 0 : chain1.apiKey, client === null || client === void 0 ? void 0 : client.version ]; }, { revalidateOnMount: true, revalidateFirstPage: false, ...swrOptions }); const activities = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.flatMap((page)=>page.activities || [])) !== null && _b !== void 0 ? _b : []; return { ...response, data: activities }; } function $df89d2f0bf3a2e94$export$2e2bcd8739ae039(users, options, swrOptions = {}, chainId) { var _a, _b; const client = (0, $3663d60eaf20fbf3$export$2e2bcd8739ae039)(); const chain1 = chainId !== undefined ? client === null || client === void 0 ? void 0 : client.chains.find((chain)=>chain.id === chainId) : client === null || client === void 0 ? void 0 : client.currentChain(); const response = (0, $5e2a1f52f4fac2ad$export$2e2bcd8739ae039)((pageIndex, previousPageData)=>{ if (!users) return null; const url = new URL(`${chain1 === null || chain1 === void 0 ? void 0 : chain1.baseApiUrl}/users/activity/v5`); let query = { ...options, users: users }; if (previousPageData && !previousPageData.continuation) return null; else if (previousPageData && pageIndex > 0) query.continuation = previousPageData.continuation; (0, $TBcmg$setParams)(url, query); return [ url.href, chain1 === null || chain1 === void 0 ? void 0 : chain1.apiKey, client === null || client === void 0 ? void 0 : client.version ]; }, { revalidateOnMount: true, revalidateFirstPage: false, ...swrOptions }); const activities = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.flatMap((page)=>page.activities || [])) !== null && _b !== void 0 ? _b : []; return { ...response, data: activities }; } function $074b4666df4341a7$export$2e2bcd8739ae039(options, swrOptions = {}, chainId) { var _a, _b; const client = (0, $3663d60eaf20fbf3$export$2e2bcd8739ae039)(); const chain1 = chainId !== undefined ? client === null || client === void 0 ? void 0 : client.chains.find((chain)=>chain.id === chainId) : client === null || client === void 0 ? void 0 : client.currentChain(); const response = (0, $5e2a1f52f4fac2ad$export$2e2bcd8739ae039)((pageIndex, previousPageData)=>{ if (!options) return null; const url = new URL(`${chain1 === null || chain1 === void 0 ? void 0 : chain1.baseApiUrl}/tokens/v5`); let query = { ...options }; if (previousPageData && !previousPageData.continuation) return null; else if (previousPageData && pageIndex > 0) query.continuation = previousPageData.continuation; if (query.normalizeRoyalties === undefined && (client === null || client === void 0 ? void 0 : client.normalizeRoyalties) !== undefined) query.normalizeRoyalties = client.normalizeRoyalties; (0, $TBcmg$setParams)(url, query); return [ url.href, chain1 === null || chain1 === void 0 ? void 0 : chain1.apiKey, client === null || client === void 0 ? void 0 : client.version ]; }, { revalidateOnMount: true, revalidateFirstPage: false, ...swrOptions }); const tokens = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.flatMap((page)=>page.tokens || [])) !== null && _b !== void 0 ? _b : []; return { ...response, data: tokens }; } function $a6a22af2ea7cc64d$export$2e2bcd8739ae039(token, options, swrOptions = {}, chainId) { var _a, _b; const client = (0, $3663d60eaf20fbf3$export$2e2bcd8739ae039)(); const chain1 = chainId !== undefined ? client === null || client === void 0 ? void 0 : client.chains.find((chain)=>chain.id === chainId) : client === null || client === void 0 ? void 0 : client.currentChain(); const response = (0, $5e2a1f52f4fac2ad$export$2e2bcd8739ae039)((pageIndex, previousPageData)=>{ if (!options) retur