@pollar/react 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { AUTH_ERROR_CODES, WalletType, PollarClient } from '@pollar/core';
3
- import { forwardRef, createContext, useState, useEffect, useRef, useCallback, useMemo, useContext, Component } from 'react';
3
+ import { forwardRef, createContext, useState, useCallback, useEffect, useRef, useMemo, useContext, Component } from 'react';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
 
6
6
  var __create = Object.create;
@@ -1028,7 +1028,7 @@ var PollarModalFooter = () => {
1028
1028
  /* @__PURE__ */ jsx("span", { className: "pollar-footer-name", children: "Pollar" }),
1029
1029
  /* @__PURE__ */ jsxs("span", { className: "pollar-footer-version", children: [
1030
1030
  "v",
1031
- "0.6.0"
1031
+ "0.7.1"
1032
1032
  ] })
1033
1033
  ] })
1034
1034
  ] });
@@ -1052,6 +1052,221 @@ function ModalStatusBanner({ message, status, onCancel, onRetry }) {
1052
1052
  status === "ERROR" && onRetry && /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-status-cancel", onClick: onRetry, children: "Retry" })
1053
1053
  ] });
1054
1054
  }
1055
+ var PERIOD_LABEL = {
1056
+ DAY: "every 24h",
1057
+ DAY_CALENDAR: "daily",
1058
+ WEEK: "every 7 days",
1059
+ MONTH: "every 30 days",
1060
+ MONTH_CALENDAR: "monthly",
1061
+ LIFETIME: "one-time"
1062
+ };
1063
+ var REASON_LABEL = {
1064
+ DISTRIBUTION_RULE_DISABLED: "Disabled",
1065
+ DISTRIBUTION_RULE_NOT_STARTED: "Not started yet",
1066
+ DISTRIBUTION_RULE_EXPIRED: "Expired",
1067
+ DISTRIBUTION_RULE_EXHAUSTED: "Fully claimed",
1068
+ DISTRIBUTION_RATE_LIMIT_EXCEEDED: "Already claimed"
1069
+ };
1070
+ function reasonLabel(reason) {
1071
+ if (!reason) return "Not available";
1072
+ return REASON_LABEL[reason] ?? "Not available";
1073
+ }
1074
+ function formatAmount(amount) {
1075
+ const n = parseFloat(amount);
1076
+ return isNaN(n) ? amount : n.toLocaleString(void 0, { maximumFractionDigits: 7 });
1077
+ }
1078
+ function formatValidity(rule) {
1079
+ const from = rule.validFrom ? new Date(rule.validFrom) : null;
1080
+ const until = rule.validUntil ? new Date(rule.validUntil) : null;
1081
+ if (!from && !until) return null;
1082
+ const fmt = (d) => d.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
1083
+ if (from && until) return `${fmt(from)} \u2192 ${fmt(until)}`;
1084
+ if (until) return `Until ${fmt(until)}`;
1085
+ if (from) return `From ${fmt(from)}`;
1086
+ return null;
1087
+ }
1088
+ function RuleCard({
1089
+ rule,
1090
+ isClaiming,
1091
+ isClaimed,
1092
+ errorMessage,
1093
+ onClaim
1094
+ }) {
1095
+ const validity = formatValidity(rule);
1096
+ const effectivelyClaimable = rule.claimable && !isClaimed;
1097
+ return /* @__PURE__ */ jsxs("div", { className: "pollar-dist-item", "data-claimable": effectivelyClaimable ? "true" : "false", children: [
1098
+ /* @__PURE__ */ jsxs("div", { className: "pollar-dist-item-row", children: [
1099
+ /* @__PURE__ */ jsx("span", { className: "pollar-dist-item-name", children: rule.name }),
1100
+ /* @__PURE__ */ jsxs("span", { className: "pollar-dist-item-amount", children: [
1101
+ formatAmount(rule.amount),
1102
+ " ",
1103
+ /* @__PURE__ */ jsx("span", { className: "pollar-dist-item-asset", children: rule.assetCode })
1104
+ ] })
1105
+ ] }),
1106
+ /* @__PURE__ */ jsxs("div", { className: "pollar-dist-item-meta", children: [
1107
+ /* @__PURE__ */ jsx("span", { children: PERIOD_LABEL[rule.period] }),
1108
+ validity && /* @__PURE__ */ jsxs("span", { children: [
1109
+ "\xB7 ",
1110
+ validity
1111
+ ] })
1112
+ ] }),
1113
+ /* @__PURE__ */ jsx("div", { className: "pollar-dist-item-action", children: isClaimed ? /* @__PURE__ */ jsx("span", { className: "pollar-dist-item-status", "data-kind": "claimed", children: "Claimed" }) : effectivelyClaimable ? /* @__PURE__ */ jsx(
1114
+ "button",
1115
+ {
1116
+ type: "button",
1117
+ className: "pollar-btn-primary pollar-dist-claim-btn",
1118
+ onClick: onClaim,
1119
+ disabled: isClaiming,
1120
+ children: isClaiming ? "Claiming\u2026" : "Claim"
1121
+ }
1122
+ ) : /* @__PURE__ */ jsx("span", { className: "pollar-dist-item-status", "data-kind": "unavailable", children: reasonLabel(rule.reason) }) }),
1123
+ errorMessage && /* @__PURE__ */ jsx("div", { className: "pollar-dist-item-error", children: errorMessage })
1124
+ ] });
1125
+ }
1126
+ function DistributionRulesModalTemplate({
1127
+ theme,
1128
+ accentColor,
1129
+ state,
1130
+ claimingId,
1131
+ claimErrors,
1132
+ claimedIds,
1133
+ onRefresh,
1134
+ onClaim,
1135
+ onClose
1136
+ }) {
1137
+ const isDark = theme === "dark";
1138
+ const cssVars = {
1139
+ "--pollar-accent": accentColor,
1140
+ "--pollar-bg": isDark ? "#1a1a1a" : "#ffffff",
1141
+ "--pollar-border": isDark ? "#374151" : "#e5e7eb",
1142
+ "--pollar-text": isDark ? "#ffffff" : "#111827",
1143
+ "--pollar-muted": isDark ? "#9ca3af" : "#6b7280",
1144
+ "--pollar-input-bg": isDark ? "#374151" : "#f9fafb",
1145
+ "--pollar-error-bg": isDark ? "#2a1515" : "#fef2f2",
1146
+ "--pollar-error-border": isDark ? "#7f1d1d" : "#fecaca",
1147
+ "--pollar-error-text": isDark ? "#f87171" : "#dc2626",
1148
+ "--pollar-success-text": isDark ? "#4ade80" : "#16a34a",
1149
+ "--pollar-buttons-border-radius": "6px",
1150
+ "--pollar-buttons-height": "44px",
1151
+ "--pollar-input-height": "44px",
1152
+ "--pollar-input-border-radius": "0.5rem",
1153
+ "--pollar-card-border-radius": "10px"
1154
+ };
1155
+ const isLoading = state.step === "loading";
1156
+ const rules = state.step === "loaded" ? state.rules : [];
1157
+ return /* @__PURE__ */ jsxs(
1158
+ "div",
1159
+ {
1160
+ className: "pollar-modal-card pollar-dist-modal",
1161
+ "data-theme": theme,
1162
+ style: cssVars,
1163
+ onClick: (e) => e.stopPropagation(),
1164
+ children: [
1165
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
1166
+ /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Distribution Rules" }),
1167
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
1168
+ /* @__PURE__ */ jsxs("button", { className: "pollar-modal-refresh-btn", onClick: onRefresh, disabled: isLoading, children: [
1169
+ /* @__PURE__ */ jsxs(
1170
+ "svg",
1171
+ {
1172
+ className: `pollar-modal-refresh-icon${isLoading ? " spinning" : ""}`,
1173
+ width: "13",
1174
+ height: "13",
1175
+ viewBox: "0 0 13 13",
1176
+ fill: "none",
1177
+ "aria-hidden": true,
1178
+ children: [
1179
+ /* @__PURE__ */ jsx("path", { d: "M11.5 6.5a5 5 0 11-1.5-3.536", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
1180
+ /* @__PURE__ */ jsx("path", { d: "M10 1v3h-3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
1181
+ ]
1182
+ }
1183
+ ),
1184
+ "Refresh"
1185
+ ] }),
1186
+ /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
1187
+ ] })
1188
+ ] }),
1189
+ /* @__PURE__ */ jsxs("div", { className: "pollar-dist-list", children: [
1190
+ isLoading && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
1191
+ state.step === "error" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: state.message }),
1192
+ state.step === "loaded" && rules.length === 0 && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "No distribution rules available." }),
1193
+ rules.map((rule) => /* @__PURE__ */ jsx(
1194
+ RuleCard,
1195
+ {
1196
+ rule,
1197
+ isClaiming: claimingId === rule.id,
1198
+ isClaimed: claimedIds.has(rule.id),
1199
+ ...claimErrors[rule.id] && { errorMessage: claimErrors[rule.id] },
1200
+ onClaim: () => onClaim(rule)
1201
+ },
1202
+ rule.id
1203
+ ))
1204
+ ] }),
1205
+ /* @__PURE__ */ jsx(PollarModalFooter, {})
1206
+ ]
1207
+ }
1208
+ );
1209
+ }
1210
+ function DistributionRulesModal({ onClose }) {
1211
+ const { getClient, styles } = usePollar();
1212
+ const { theme = "light", accentColor = "#005DB4" } = styles;
1213
+ const [state, setState] = useState({ step: "idle" });
1214
+ const [claimingId, setClaimingId] = useState(null);
1215
+ const [claimErrors, setClaimErrors] = useState({});
1216
+ const [claimedIds, setClaimedIds] = useState(() => /* @__PURE__ */ new Set());
1217
+ const load = useCallback(async () => {
1218
+ setState({ step: "loading" });
1219
+ try {
1220
+ const rules = await getClient().listDistributionRules();
1221
+ setState({ step: "loaded", rules });
1222
+ } catch (err) {
1223
+ const message = err instanceof Error ? err.message : "Failed to load distribution rules";
1224
+ setState({ step: "error", message });
1225
+ }
1226
+ }, [getClient]);
1227
+ useEffect(() => {
1228
+ void load();
1229
+ }, [load]);
1230
+ const handleClaim = useCallback(
1231
+ async (rule) => {
1232
+ setClaimingId(rule.id);
1233
+ setClaimErrors((prev) => {
1234
+ if (!prev[rule.id]) return prev;
1235
+ const next = { ...prev };
1236
+ delete next[rule.id];
1237
+ return next;
1238
+ });
1239
+ try {
1240
+ await getClient().claimDistributionRule({ ruleId: rule.id });
1241
+ setClaimedIds((prev) => {
1242
+ const next = new Set(prev);
1243
+ next.add(rule.id);
1244
+ return next;
1245
+ });
1246
+ } catch (err) {
1247
+ const message = err instanceof Error ? err.message : "Claim failed";
1248
+ setClaimErrors((prev) => ({ ...prev, [rule.id]: message }));
1249
+ } finally {
1250
+ setClaimingId(null);
1251
+ }
1252
+ },
1253
+ [getClient]
1254
+ );
1255
+ return /* @__PURE__ */ jsx("div", { className: "pollar-overlay", onClick: onClose, children: /* @__PURE__ */ jsx(
1256
+ DistributionRulesModalTemplate,
1257
+ {
1258
+ theme,
1259
+ accentColor,
1260
+ state,
1261
+ claimingId,
1262
+ claimErrors,
1263
+ claimedIds,
1264
+ onRefresh: () => void load(),
1265
+ onClaim: handleClaim,
1266
+ onClose
1267
+ }
1268
+ ) });
1269
+ }
1055
1270
  var STATUS_CONFIG = {
1056
1271
  none: { label: "Not started", color: "#6b7280", dot: false },
1057
1272
  pending: { label: "Pending review", color: "#f59e0b", dot: true },
@@ -1575,166 +1790,6 @@ function LoginModal({ onClose }) {
1575
1790
  }
1576
1791
  ) });
1577
1792
  }
1578
-
1579
- // src/lib/qr-code/index.tsx
1580
- var import_ErrorCorrectLevel = __toESM(require_ErrorCorrectLevel());
1581
- var import_QRCode = __toESM(require_QRCode());
1582
- var QRCodeSvg = forwardRef(function QRCodeSvg2({
1583
- bgColor,
1584
- bgD,
1585
- fgD,
1586
- fgColor,
1587
- size,
1588
- title,
1589
- viewBoxSize,
1590
- xmlns = "http://www.w3.org/2000/svg",
1591
- ...props
1592
- }, ref) {
1593
- return /* @__PURE__ */ jsxs("svg", { ...props, height: size, ref, viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, width: size, xmlns, children: [
1594
- title ? /* @__PURE__ */ jsx("title", { children: title }) : null,
1595
- /* @__PURE__ */ jsx("path", { d: bgD, fill: bgColor }),
1596
- /* @__PURE__ */ jsx("path", { d: fgD, fill: fgColor })
1597
- ] });
1598
- });
1599
- QRCodeSvg.displayName = "QRCodeSvg";
1600
- function bytesToBinaryString(bytes) {
1601
- return bytes.map((b) => String.fromCharCode(b & 255)).join("");
1602
- }
1603
- function encodeStringToUtf8Bytes(input) {
1604
- return Array.from(new TextEncoder().encode(input));
1605
- }
1606
- var QRCode = forwardRef(function QRCode2({ bgColor = "#FFFFFF", fgColor = "#000000", level = "L", size = 256, value, ...props }, ref) {
1607
- const qrcode = new import_QRCode.default(-1, import_ErrorCorrectLevel.default[level]);
1608
- const utf8Bytes = encodeStringToUtf8Bytes(value);
1609
- const binaryString = bytesToBinaryString(utf8Bytes);
1610
- qrcode.addData(binaryString, "Byte");
1611
- qrcode.make();
1612
- const cells = qrcode.modules;
1613
- return /* @__PURE__ */ jsx(
1614
- QRCodeSvg,
1615
- {
1616
- ...props,
1617
- bgColor,
1618
- bgD: cells.map((row, rowIndex) => row.map((cell, cellIndex) => !cell ? `M ${cellIndex} ${rowIndex} l 1 0 0 1 -1 0 Z` : "").join(" ")).join(" "),
1619
- fgColor,
1620
- fgD: cells.map((row, rowIndex) => row.map((cell, cellIndex) => cell ? `M ${cellIndex} ${rowIndex} l 1 0 0 1 -1 0 Z` : "").join(" ")).join(" "),
1621
- ref,
1622
- size,
1623
- viewBoxSize: cells.length
1624
- }
1625
- );
1626
- });
1627
- function ReceiveModalTemplate({
1628
- theme,
1629
- accentColor,
1630
- walletAddress,
1631
- copied,
1632
- onCopy,
1633
- onClose
1634
- }) {
1635
- const isDark = theme === "dark";
1636
- const cssVars = {
1637
- "--pollar-accent": accentColor,
1638
- "--pollar-bg": isDark ? "#1a1a1a" : "#ffffff",
1639
- "--pollar-border": isDark ? "#374151" : "#e5e7eb",
1640
- "--pollar-text": isDark ? "#ffffff" : "#111827",
1641
- "--pollar-muted": isDark ? "#9ca3af" : "#6b7280",
1642
- "--pollar-input-bg": isDark ? "#374151" : "#f9fafb",
1643
- "--pollar-error-bg": isDark ? "#2a1515" : "#fef2f2",
1644
- "--pollar-error-border": isDark ? "#7f1d1d" : "#fecaca",
1645
- "--pollar-error-text": isDark ? "#f87171" : "#dc2626",
1646
- "--pollar-success-text": isDark ? "#4ade80" : "#16a34a",
1647
- "--pollar-buttons-border-radius": "6px",
1648
- "--pollar-buttons-height": "44px",
1649
- "--pollar-input-height": "44px",
1650
- "--pollar-input-border-radius": "0.5rem",
1651
- "--pollar-card-border-radius": "10px"
1652
- };
1653
- return /* @__PURE__ */ jsxs(
1654
- "div",
1655
- {
1656
- className: "pollar-modal-card pollar-receive-modal",
1657
- "data-theme": theme,
1658
- style: cssVars,
1659
- onClick: (e) => e.stopPropagation(),
1660
- children: [
1661
- /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
1662
- /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Receive" }),
1663
- /* @__PURE__ */ jsx("div", { className: "pollar-modal-header-actions", children: /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) }) })
1664
- ] }),
1665
- walletAddress ? /* @__PURE__ */ jsxs(Fragment, { children: [
1666
- /* @__PURE__ */ jsx("div", { className: "pollar-receive-qr", children: /* @__PURE__ */ jsx(
1667
- QRCode,
1668
- {
1669
- value: walletAddress,
1670
- size: 180,
1671
- fgColor: isDark ? "#ffffff" : "#111827",
1672
- bgColor: "transparent"
1673
- }
1674
- ) }),
1675
- /* @__PURE__ */ jsx("p", { className: "pollar-receive-instructions", children: "Share your Stellar address to receive any asset. Only send Stellar assets to this address." }),
1676
- /* @__PURE__ */ jsxs("div", { className: "pollar-receive-address-row", children: [
1677
- /* @__PURE__ */ jsx("span", { className: "pollar-receive-address", children: walletAddress }),
1678
- /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-receive-copy-btn", onClick: onCopy, "aria-label": "Copy address", children: copied ? /* @__PURE__ */ jsxs(Fragment, { children: [
1679
- /* @__PURE__ */ jsxs("svg", { width: "13", height: "13", viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, children: [
1680
- /* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "7", fill: "currentColor" }),
1681
- /* @__PURE__ */ jsx(
1682
- "path",
1683
- {
1684
- d: "M3.5 7l2.5 2.5 4.5-5",
1685
- stroke: "white",
1686
- strokeWidth: "1.5",
1687
- strokeLinecap: "round",
1688
- strokeLinejoin: "round"
1689
- }
1690
- )
1691
- ] }),
1692
- "Copied!"
1693
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1694
- /* @__PURE__ */ jsxs("svg", { width: "13", height: "13", viewBox: "0 0 13 13", fill: "none", "aria-hidden": true, children: [
1695
- /* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "8", height: "8", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }),
1696
- /* @__PURE__ */ jsx(
1697
- "path",
1698
- {
1699
- d: "M3 9H2a1 1 0 01-1-1V2a1 1 0 011-1h6a1 1 0 011 1v1",
1700
- stroke: "currentColor",
1701
- strokeWidth: "1.5",
1702
- strokeLinecap: "round"
1703
- }
1704
- )
1705
- ] }),
1706
- "Copy address"
1707
- ] }) })
1708
- ] })
1709
- ] }) : /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "No wallet connected." }),
1710
- /* @__PURE__ */ jsx(PollarModalFooter, {})
1711
- ]
1712
- }
1713
- );
1714
- }
1715
- function ReceiveModal({ onClose }) {
1716
- const { walletAddress, styles } = usePollar();
1717
- const { theme = "light", accentColor = "#005DB4" } = styles;
1718
- const [copied, setCopied] = useState(false);
1719
- function handleCopy() {
1720
- if (!walletAddress) return;
1721
- navigator.clipboard.writeText(walletAddress).then(() => {
1722
- setCopied(true);
1723
- setTimeout(() => setCopied(false), 2e3);
1724
- });
1725
- }
1726
- return /* @__PURE__ */ jsx("div", { className: "pollar-overlay", onClick: onClose, children: /* @__PURE__ */ jsx(
1727
- ReceiveModalTemplate,
1728
- {
1729
- theme,
1730
- accentColor,
1731
- walletAddress,
1732
- copied,
1733
- onCopy: handleCopy,
1734
- onClose
1735
- }
1736
- ) });
1737
- }
1738
1793
  var RAIL_LABELS = {
1739
1794
  SPEI: "SPEI (Mexico)",
1740
1795
  PIX: "PIX (Brazil)",
@@ -2049,6 +2104,166 @@ function RampWidget({ onClose }) {
2049
2104
  }
2050
2105
  ) });
2051
2106
  }
2107
+
2108
+ // src/lib/qr-code/index.tsx
2109
+ var import_ErrorCorrectLevel = __toESM(require_ErrorCorrectLevel());
2110
+ var import_QRCode = __toESM(require_QRCode());
2111
+ var QRCodeSvg = forwardRef(function QRCodeSvg2({
2112
+ bgColor,
2113
+ bgD,
2114
+ fgD,
2115
+ fgColor,
2116
+ size,
2117
+ title,
2118
+ viewBoxSize,
2119
+ xmlns = "http://www.w3.org/2000/svg",
2120
+ ...props
2121
+ }, ref) {
2122
+ return /* @__PURE__ */ jsxs("svg", { ...props, height: size, ref, viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, width: size, xmlns, children: [
2123
+ title ? /* @__PURE__ */ jsx("title", { children: title }) : null,
2124
+ /* @__PURE__ */ jsx("path", { d: bgD, fill: bgColor }),
2125
+ /* @__PURE__ */ jsx("path", { d: fgD, fill: fgColor })
2126
+ ] });
2127
+ });
2128
+ QRCodeSvg.displayName = "QRCodeSvg";
2129
+ function bytesToBinaryString(bytes) {
2130
+ return bytes.map((b) => String.fromCharCode(b & 255)).join("");
2131
+ }
2132
+ function encodeStringToUtf8Bytes(input) {
2133
+ return Array.from(new TextEncoder().encode(input));
2134
+ }
2135
+ var QRCode = forwardRef(function QRCode2({ bgColor = "#FFFFFF", fgColor = "#000000", level = "L", size = 256, value, ...props }, ref) {
2136
+ const qrcode = new import_QRCode.default(-1, import_ErrorCorrectLevel.default[level]);
2137
+ const utf8Bytes = encodeStringToUtf8Bytes(value);
2138
+ const binaryString = bytesToBinaryString(utf8Bytes);
2139
+ qrcode.addData(binaryString, "Byte");
2140
+ qrcode.make();
2141
+ const cells = qrcode.modules;
2142
+ return /* @__PURE__ */ jsx(
2143
+ QRCodeSvg,
2144
+ {
2145
+ ...props,
2146
+ bgColor,
2147
+ bgD: cells.map((row, rowIndex) => row.map((cell, cellIndex) => !cell ? `M ${cellIndex} ${rowIndex} l 1 0 0 1 -1 0 Z` : "").join(" ")).join(" "),
2148
+ fgColor,
2149
+ fgD: cells.map((row, rowIndex) => row.map((cell, cellIndex) => cell ? `M ${cellIndex} ${rowIndex} l 1 0 0 1 -1 0 Z` : "").join(" ")).join(" "),
2150
+ ref,
2151
+ size,
2152
+ viewBoxSize: cells.length
2153
+ }
2154
+ );
2155
+ });
2156
+ function ReceiveModalTemplate({
2157
+ theme,
2158
+ accentColor,
2159
+ walletAddress,
2160
+ copied,
2161
+ onCopy,
2162
+ onClose
2163
+ }) {
2164
+ const isDark = theme === "dark";
2165
+ const cssVars = {
2166
+ "--pollar-accent": accentColor,
2167
+ "--pollar-bg": isDark ? "#1a1a1a" : "#ffffff",
2168
+ "--pollar-border": isDark ? "#374151" : "#e5e7eb",
2169
+ "--pollar-text": isDark ? "#ffffff" : "#111827",
2170
+ "--pollar-muted": isDark ? "#9ca3af" : "#6b7280",
2171
+ "--pollar-input-bg": isDark ? "#374151" : "#f9fafb",
2172
+ "--pollar-error-bg": isDark ? "#2a1515" : "#fef2f2",
2173
+ "--pollar-error-border": isDark ? "#7f1d1d" : "#fecaca",
2174
+ "--pollar-error-text": isDark ? "#f87171" : "#dc2626",
2175
+ "--pollar-success-text": isDark ? "#4ade80" : "#16a34a",
2176
+ "--pollar-buttons-border-radius": "6px",
2177
+ "--pollar-buttons-height": "44px",
2178
+ "--pollar-input-height": "44px",
2179
+ "--pollar-input-border-radius": "0.5rem",
2180
+ "--pollar-card-border-radius": "10px"
2181
+ };
2182
+ return /* @__PURE__ */ jsxs(
2183
+ "div",
2184
+ {
2185
+ className: "pollar-modal-card pollar-receive-modal",
2186
+ "data-theme": theme,
2187
+ style: cssVars,
2188
+ onClick: (e) => e.stopPropagation(),
2189
+ children: [
2190
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
2191
+ /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Receive" }),
2192
+ /* @__PURE__ */ jsx("div", { className: "pollar-modal-header-actions", children: /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) }) })
2193
+ ] }),
2194
+ walletAddress ? /* @__PURE__ */ jsxs(Fragment, { children: [
2195
+ /* @__PURE__ */ jsx("div", { className: "pollar-receive-qr", children: /* @__PURE__ */ jsx(
2196
+ QRCode,
2197
+ {
2198
+ value: walletAddress,
2199
+ size: 180,
2200
+ fgColor: isDark ? "#ffffff" : "#111827",
2201
+ bgColor: "transparent"
2202
+ }
2203
+ ) }),
2204
+ /* @__PURE__ */ jsx("p", { className: "pollar-receive-instructions", children: "Share your Stellar address to receive any asset. Only send Stellar assets to this address." }),
2205
+ /* @__PURE__ */ jsxs("div", { className: "pollar-receive-address-row", children: [
2206
+ /* @__PURE__ */ jsx("span", { className: "pollar-receive-address", children: walletAddress }),
2207
+ /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-receive-copy-btn", onClick: onCopy, "aria-label": "Copy address", children: copied ? /* @__PURE__ */ jsxs(Fragment, { children: [
2208
+ /* @__PURE__ */ jsxs("svg", { width: "13", height: "13", viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, children: [
2209
+ /* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "7", fill: "currentColor" }),
2210
+ /* @__PURE__ */ jsx(
2211
+ "path",
2212
+ {
2213
+ d: "M3.5 7l2.5 2.5 4.5-5",
2214
+ stroke: "white",
2215
+ strokeWidth: "1.5",
2216
+ strokeLinecap: "round",
2217
+ strokeLinejoin: "round"
2218
+ }
2219
+ )
2220
+ ] }),
2221
+ "Copied!"
2222
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2223
+ /* @__PURE__ */ jsxs("svg", { width: "13", height: "13", viewBox: "0 0 13 13", fill: "none", "aria-hidden": true, children: [
2224
+ /* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "8", height: "8", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }),
2225
+ /* @__PURE__ */ jsx(
2226
+ "path",
2227
+ {
2228
+ d: "M3 9H2a1 1 0 01-1-1V2a1 1 0 011-1h6a1 1 0 011 1v1",
2229
+ stroke: "currentColor",
2230
+ strokeWidth: "1.5",
2231
+ strokeLinecap: "round"
2232
+ }
2233
+ )
2234
+ ] }),
2235
+ "Copy address"
2236
+ ] }) })
2237
+ ] })
2238
+ ] }) : /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "No wallet connected." }),
2239
+ /* @__PURE__ */ jsx(PollarModalFooter, {})
2240
+ ]
2241
+ }
2242
+ );
2243
+ }
2244
+ function ReceiveModal({ onClose }) {
2245
+ const { walletAddress, styles } = usePollar();
2246
+ const { theme = "light", accentColor = "#005DB4" } = styles;
2247
+ const [copied, setCopied] = useState(false);
2248
+ function handleCopy() {
2249
+ if (!walletAddress) return;
2250
+ navigator.clipboard.writeText(walletAddress).then(() => {
2251
+ setCopied(true);
2252
+ setTimeout(() => setCopied(false), 2e3);
2253
+ });
2254
+ }
2255
+ return /* @__PURE__ */ jsx("div", { className: "pollar-overlay", onClick: onClose, children: /* @__PURE__ */ jsx(
2256
+ ReceiveModalTemplate,
2257
+ {
2258
+ theme,
2259
+ accentColor,
2260
+ walletAddress,
2261
+ copied,
2262
+ onCopy: handleCopy,
2263
+ onClose
2264
+ }
2265
+ ) });
2266
+ }
2052
2267
  var STATUS_MESSAGES = {
2053
2268
  idle: "",
2054
2269
  building: "Building transaction\u2026",
@@ -2499,6 +2714,254 @@ function SendModal({ onClose }) {
2499
2714
  }
2500
2715
  ) });
2501
2716
  }
2717
+ function describeDevice(s) {
2718
+ if (s.deviceLabel) return s.deviceLabel;
2719
+ if (!s.userAgent) return "Unknown device";
2720
+ return parseUserAgent(s.userAgent);
2721
+ }
2722
+ function detectBrowser(ua) {
2723
+ if (/Edg\//.test(ua)) return "Edge";
2724
+ if (/OPR\//.test(ua)) return "Opera";
2725
+ if (/(Chrome|CriOS)\//.test(ua)) return "Chrome";
2726
+ if (/(Firefox|FxiOS)\//.test(ua)) return "Firefox";
2727
+ if (/Safari\//.test(ua)) return "Safari";
2728
+ return null;
2729
+ }
2730
+ function detectOS(ua) {
2731
+ if (/iPhone|iPad|iPod/.test(ua)) return "iOS";
2732
+ if (/Android/.test(ua)) return "Android";
2733
+ if (/Mac OS X/.test(ua)) return "macOS";
2734
+ if (/Windows NT/.test(ua)) return "Windows";
2735
+ if (/Linux/.test(ua)) return "Linux";
2736
+ return null;
2737
+ }
2738
+ function parseUserAgent(ua) {
2739
+ const browser = detectBrowser(ua);
2740
+ const os = detectOS(ua);
2741
+ if (browser && os) return `${os} \u2014 ${browser}`;
2742
+ if (os) return os;
2743
+ if (browser) return browser;
2744
+ return ua.slice(0, 48);
2745
+ }
2746
+ function formatRelative(iso) {
2747
+ if (!iso) return "\u2014";
2748
+ const ts = new Date(iso).getTime();
2749
+ if (!Number.isFinite(ts)) return "\u2014";
2750
+ const diffSec = Math.round((Date.now() - ts) / 1e3);
2751
+ if (diffSec < 0) return "just now";
2752
+ if (diffSec < 60) return `${diffSec}s ago`;
2753
+ const diffMin = Math.round(diffSec / 60);
2754
+ if (diffMin < 60) return `${diffMin}m ago`;
2755
+ const diffHr = Math.round(diffMin / 60);
2756
+ if (diffHr < 24) return `${diffHr}h ago`;
2757
+ const diffDay = Math.round(diffHr / 24);
2758
+ if (diffDay < 30) return `${diffDay}d ago`;
2759
+ return new Date(iso).toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
2760
+ }
2761
+ function shortIp(hash) {
2762
+ if (!hash) return "";
2763
+ return hash.slice(0, 8);
2764
+ }
2765
+ function SessionsModalTemplate({
2766
+ theme,
2767
+ accentColor,
2768
+ state,
2769
+ revokingFamilyId,
2770
+ signingOutEverywhere,
2771
+ onRefresh,
2772
+ onRevoke,
2773
+ onLogoutEverywhere,
2774
+ onClose
2775
+ }) {
2776
+ const isDark = theme === "dark";
2777
+ const cssVars = {
2778
+ "--pollar-accent": accentColor,
2779
+ "--pollar-bg": isDark ? "#1a1a1a" : "#ffffff",
2780
+ "--pollar-border": isDark ? "#374151" : "#e5e7eb",
2781
+ "--pollar-text": isDark ? "#ffffff" : "#111827",
2782
+ "--pollar-muted": isDark ? "#9ca3af" : "#6b7280",
2783
+ "--pollar-input-bg": isDark ? "#374151" : "#f9fafb",
2784
+ "--pollar-error-bg": isDark ? "#2a1515" : "#fef2f2",
2785
+ "--pollar-error-border": isDark ? "#7f1d1d" : "#fecaca",
2786
+ "--pollar-error-text": isDark ? "#f87171" : "#dc2626",
2787
+ "--pollar-success-text": isDark ? "#4ade80" : "#16a34a",
2788
+ "--pollar-buttons-border-radius": "6px",
2789
+ "--pollar-buttons-height": "44px",
2790
+ "--pollar-input-height": "44px",
2791
+ "--pollar-input-border-radius": "0.5rem",
2792
+ "--pollar-card-border-radius": "10px"
2793
+ };
2794
+ const isLoading = state.step === "loading";
2795
+ const sessions = state.step === "loaded" ? state.sessions : [];
2796
+ const otherCount = sessions.filter((s) => !s.current).length;
2797
+ return /* @__PURE__ */ jsxs(
2798
+ "div",
2799
+ {
2800
+ className: "pollar-modal-card pollar-sessions-modal",
2801
+ "data-theme": theme,
2802
+ style: cssVars,
2803
+ onClick: (e) => e.stopPropagation(),
2804
+ children: [
2805
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
2806
+ /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Active sessions" }),
2807
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
2808
+ /* @__PURE__ */ jsxs("button", { className: "pollar-modal-refresh-btn", onClick: onRefresh, disabled: isLoading, children: [
2809
+ /* @__PURE__ */ jsxs(
2810
+ "svg",
2811
+ {
2812
+ className: `pollar-modal-refresh-icon${isLoading ? " spinning" : ""}`,
2813
+ width: "13",
2814
+ height: "13",
2815
+ viewBox: "0 0 13 13",
2816
+ fill: "none",
2817
+ "aria-hidden": true,
2818
+ children: [
2819
+ /* @__PURE__ */ jsx("path", { d: "M11.5 6.5a5 5 0 11-1.5-3.536", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
2820
+ /* @__PURE__ */ jsx(
2821
+ "path",
2822
+ {
2823
+ d: "M10 1v3h-3",
2824
+ stroke: "currentColor",
2825
+ strokeWidth: "1.5",
2826
+ strokeLinecap: "round",
2827
+ strokeLinejoin: "round"
2828
+ }
2829
+ )
2830
+ ]
2831
+ }
2832
+ ),
2833
+ "Refresh"
2834
+ ] }),
2835
+ /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
2836
+ ] })
2837
+ ] }),
2838
+ /* @__PURE__ */ jsxs("div", { className: "pollar-sessions-list", children: [
2839
+ state.step === "idle" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
2840
+ isLoading && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
2841
+ state.step === "error" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: state.message }),
2842
+ state.step === "loaded" && sessions.length === 0 && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "No active sessions." }),
2843
+ sessions.map((s) => {
2844
+ const isRevoking = revokingFamilyId === s.familyId;
2845
+ return /* @__PURE__ */ jsxs("div", { className: "pollar-sessions-item", "data-current": s.current || void 0, children: [
2846
+ /* @__PURE__ */ jsxs("div", { className: "pollar-sessions-item-main", children: [
2847
+ /* @__PURE__ */ jsx("span", { className: "pollar-sessions-item-device", children: describeDevice(s) }),
2848
+ s.current && /* @__PURE__ */ jsx("span", { className: "pollar-sessions-item-badge", children: "This device" })
2849
+ ] }),
2850
+ /* @__PURE__ */ jsxs("div", { className: "pollar-sessions-item-meta", children: [
2851
+ /* @__PURE__ */ jsxs("span", { children: [
2852
+ "Last used ",
2853
+ formatRelative(s.lastUsedAt ?? s.createdAt)
2854
+ ] }),
2855
+ s.ipHash && /* @__PURE__ */ jsxs(Fragment, { children: [
2856
+ /* @__PURE__ */ jsx("span", { children: "\xB7" }),
2857
+ /* @__PURE__ */ jsxs("span", { title: `ip-hash ${s.ipHash}`, children: [
2858
+ "ip ",
2859
+ shortIp(s.ipHash)
2860
+ ] })
2861
+ ] })
2862
+ ] }),
2863
+ !s.current && /* @__PURE__ */ jsx(
2864
+ "button",
2865
+ {
2866
+ className: "pollar-sessions-item-revoke",
2867
+ onClick: () => onRevoke(s.familyId),
2868
+ disabled: isRevoking || signingOutEverywhere,
2869
+ children: isRevoking ? "Revoking\u2026" : "Revoke"
2870
+ }
2871
+ )
2872
+ ] }, s.familyId);
2873
+ })
2874
+ ] }),
2875
+ state.step === "loaded" && sessions.length > 0 && /* @__PURE__ */ jsx("div", { className: "pollar-sessions-actions", children: /* @__PURE__ */ jsx(
2876
+ "button",
2877
+ {
2878
+ className: "pollar-sessions-logout-all",
2879
+ onClick: onLogoutEverywhere,
2880
+ disabled: signingOutEverywhere || otherCount === 0,
2881
+ title: otherCount === 0 ? "No other devices to sign out" : void 0,
2882
+ children: signingOutEverywhere ? "Signing out\u2026" : "Sign out everywhere"
2883
+ }
2884
+ ) }),
2885
+ /* @__PURE__ */ jsx(PollarModalFooter, {})
2886
+ ]
2887
+ }
2888
+ );
2889
+ }
2890
+ function SessionsModal({ onClose }) {
2891
+ const { getClient, styles } = usePollar();
2892
+ const { theme = "light", accentColor = "#005DB4" } = styles;
2893
+ const [state, setState] = useState({ step: "idle" });
2894
+ const [revokingFamilyId, setRevokingFamilyId] = useState(null);
2895
+ const [signingOutEverywhere, setSigningOutEverywhere] = useState(false);
2896
+ const mountedRef = useRef(true);
2897
+ useEffect(() => () => {
2898
+ mountedRef.current = false;
2899
+ }, []);
2900
+ const onCloseRef = useRef(onClose);
2901
+ onCloseRef.current = onClose;
2902
+ useEffect(() => {
2903
+ return getClient().onAuthStateChange((authState) => {
2904
+ if (authState.step === "idle") onCloseRef.current();
2905
+ });
2906
+ }, [getClient]);
2907
+ const load = useCallback(async () => {
2908
+ setState({ step: "loading" });
2909
+ try {
2910
+ const sessions = await getClient().listSessions();
2911
+ if (!mountedRef.current) return;
2912
+ setState({ step: "loaded", sessions });
2913
+ } catch (err) {
2914
+ if (!mountedRef.current) return;
2915
+ const message = err instanceof Error ? err.message : "Failed to load sessions";
2916
+ setState({ step: "error", message });
2917
+ }
2918
+ }, [getClient]);
2919
+ useEffect(() => {
2920
+ void load();
2921
+ }, [load]);
2922
+ const handleRevoke = useCallback(
2923
+ async (familyId) => {
2924
+ setRevokingFamilyId(familyId);
2925
+ try {
2926
+ await getClient().revokeSession(familyId);
2927
+ if (!mountedRef.current) return;
2928
+ await load();
2929
+ } catch {
2930
+ if (!mountedRef.current) return;
2931
+ setState(
2932
+ (prev) => prev.step === "loaded" ? { step: "error", message: "Failed to revoke session" } : prev
2933
+ );
2934
+ } finally {
2935
+ if (mountedRef.current) setRevokingFamilyId(null);
2936
+ }
2937
+ },
2938
+ [getClient, load]
2939
+ );
2940
+ const handleLogoutEverywhere = useCallback(async () => {
2941
+ setSigningOutEverywhere(true);
2942
+ try {
2943
+ await getClient().logoutEverywhere();
2944
+ onClose();
2945
+ } catch {
2946
+ if (!mountedRef.current) return;
2947
+ setSigningOutEverywhere(false);
2948
+ }
2949
+ }, [getClient, onClose]);
2950
+ return /* @__PURE__ */ jsx("div", { className: "pollar-overlay", onClick: onClose, children: /* @__PURE__ */ jsx(
2951
+ SessionsModalTemplate,
2952
+ {
2953
+ theme,
2954
+ accentColor,
2955
+ state,
2956
+ revokingFamilyId,
2957
+ signingOutEverywhere,
2958
+ onRefresh: () => void load(),
2959
+ onRevoke: (familyId) => void handleRevoke(familyId),
2960
+ onLogoutEverywhere: () => void handleLogoutEverywhere(),
2961
+ onClose
2962
+ }
2963
+ ) });
2964
+ }
2502
2965
  function TransactionModalTemplate({
2503
2966
  theme,
2504
2967
  accentColor,
@@ -2940,9 +3403,11 @@ function PollarProvider({ config, styles: propStyles, adapters, children }) {
2940
3403
  const [walletBalanceModalOpen, setWalletBalanceModalOpen] = useState(false);
2941
3404
  const [sendModalOpen, setSendModalOpen] = useState(false);
2942
3405
  const [receiveModalOpen, setReceiveModalOpen] = useState(false);
3406
+ const [sessionsModalOpen, setSessionsModalOpen] = useState(false);
3407
+ const [distributionRulesModalOpen, setDistributionRulesModalOpen] = useState(false);
2943
3408
  const adaptersRef = useRef(adapters);
2944
3409
  adaptersRef.current = adapters;
2945
- const walletAddress = sessionState?.data?.providers?.wallet?.address || sessionState?.wallet?.publicKey || "";
3410
+ const walletAddress = sessionState?.wallet?.publicKey || "";
2946
3411
  const getClient = useCallback(() => pollarClient, [pollarClient]);
2947
3412
  const refreshWalletBalance = useCallback(() => pollarClient.refreshBalance(walletAddress), [pollarClient, walletAddress]);
2948
3413
  const contextValue = useMemo(
@@ -2972,6 +3437,10 @@ function PollarProvider({ config, styles: propStyles, adapters, children }) {
2972
3437
  // send / receive
2973
3438
  openSendModal: () => setSendModalOpen(true),
2974
3439
  openReceiveModal: () => setReceiveModalOpen(true),
3440
+ // sessions
3441
+ openSessionsModal: () => setSessionsModalOpen(true),
3442
+ // distribution
3443
+ openDistributionRulesModal: () => setDistributionRulesModalOpen(true),
2975
3444
  // network
2976
3445
  network: networkState.step === "connected" ? networkState.network : "testnet",
2977
3446
  setNetwork: (network) => pollarClient.setNetwork(network),
@@ -2987,7 +3456,18 @@ function PollarProvider({ config, styles: propStyles, adapters, children }) {
2987
3456
  styles,
2988
3457
  adapters: adaptersRef.current
2989
3458
  }),
2990
- [walletAddress, pollarClient, getClient, transaction, txHistory, walletBalance, refreshWalletBalance, networkState, remoteConfig, styles]
3459
+ [
3460
+ walletAddress,
3461
+ pollarClient,
3462
+ getClient,
3463
+ transaction,
3464
+ txHistory,
3465
+ walletBalance,
3466
+ refreshWalletBalance,
3467
+ networkState,
3468
+ remoteConfig,
3469
+ styles
3470
+ ]
2991
3471
  );
2992
3472
  return /* @__PURE__ */ jsxs(PollarContext.Provider, { value: contextValue, children: [
2993
3473
  children,
@@ -3006,7 +3486,9 @@ function PollarProvider({ config, styles: propStyles, adapters, children }) {
3006
3486
  txHistoryModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setTxHistoryModalOpen(false), children: /* @__PURE__ */ jsx(TxHistoryModal, { onClose: () => setTxHistoryModalOpen(false) }) }),
3007
3487
  walletBalanceModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setWalletBalanceModalOpen(false), children: /* @__PURE__ */ jsx(WalletBalanceModal, { onClose: () => setWalletBalanceModalOpen(false) }) }),
3008
3488
  sendModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setSendModalOpen(false), children: /* @__PURE__ */ jsx(SendModal, { onClose: () => setSendModalOpen(false) }) }),
3009
- receiveModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setReceiveModalOpen(false), children: /* @__PURE__ */ jsx(ReceiveModal, { onClose: () => setReceiveModalOpen(false) }) })
3489
+ receiveModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setReceiveModalOpen(false), children: /* @__PURE__ */ jsx(ReceiveModal, { onClose: () => setReceiveModalOpen(false) }) }),
3490
+ sessionsModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setSessionsModalOpen(false), children: /* @__PURE__ */ jsx(SessionsModal, { onClose: () => setSessionsModalOpen(false) }) }),
3491
+ distributionRulesModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setDistributionRulesModalOpen(false), children: /* @__PURE__ */ jsx(DistributionRulesModal, { onClose: () => setDistributionRulesModalOpen(false) }) })
3010
3492
  ] });
3011
3493
  }
3012
3494
  function usePollar() {
@@ -3257,6 +3739,6 @@ function WalletButton() {
3257
3739
  );
3258
3740
  }
3259
3741
 
3260
- export { KycModal, KycModalTemplate, KycStatus, LoginModalTemplate, PollarProvider, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, RouteDisplay, SendModal, SendModalTemplate, TransactionModalTemplate, TxHistoryModalTemplate, TxStatusView, WalletBalanceModal, WalletBalanceModalTemplate, WalletButton, createPollarAdapterHook, usePollar };
3742
+ export { DistributionRulesModal, DistributionRulesModalTemplate, KycModal, KycModalTemplate, KycStatus, LoginModalTemplate, PollarProvider, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, RouteDisplay, SendModal, SendModalTemplate, SessionsModal, SessionsModalTemplate, TransactionModalTemplate, TxHistoryModalTemplate, TxStatusView, WalletBalanceModal, WalletBalanceModalTemplate, WalletButton, createPollarAdapterHook, usePollar };
3261
3743
  //# sourceMappingURL=index.mjs.map
3262
3744
  //# sourceMappingURL=index.mjs.map