@sudobility/components-rn 1.0.19 → 1.0.21
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.cjs.js +2898 -77
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2900 -79
- package/dist/index.esm.js.map +1 -1
- package/dist/ui/Banner/Banner.d.ts +97 -0
- package/dist/ui/Banner/Banner.d.ts.map +1 -0
- package/dist/ui/Banner/index.d.ts +2 -0
- package/dist/ui/Banner/index.d.ts.map +1 -0
- package/dist/ui/Button/Button.d.ts +2 -2
- package/package.json +5 -3
- package/src/index.ts +1 -0
- package/src/ui/Banner/Banner.tsx +315 -0
- package/src/ui/Banner/index.ts +7 -0
package/dist/index.cjs.js
CHANGED
|
@@ -953,6 +953,2825 @@ function requireJsxRuntime() {
|
|
|
953
953
|
return jsxRuntime.exports;
|
|
954
954
|
}
|
|
955
955
|
var jsxRuntimeExports = requireJsxRuntime();
|
|
956
|
+
var dist = {};
|
|
957
|
+
var enums = {};
|
|
958
|
+
var hasRequiredEnums;
|
|
959
|
+
function requireEnums() {
|
|
960
|
+
if (hasRequiredEnums) return enums;
|
|
961
|
+
hasRequiredEnums = 1;
|
|
962
|
+
Object.defineProperty(enums, "__esModule", { value: true });
|
|
963
|
+
enums.Currency = enums.ErrorType = enums.FeatureFlag = enums.EmailValidationState = enums.PlatformType = enums.ConnectionState = enums.ConnectionType = enums.EmailSortCriteria = enums.SortOrder = enums.EmailAddressType = enums.InfoType = enums.NotificationType = enums.RequestStatus = enums.SubscriptionAction = enums.EmailAction = enums.MediumView = enums.MobileView = enums.EmailComposeType = enums.FontSize = enums.Theme = enums.Chain = enums.ChainType = enums.AuthStatus = void 0;
|
|
964
|
+
var AuthStatus;
|
|
965
|
+
(function(AuthStatus2) {
|
|
966
|
+
AuthStatus2["CONNECTED"] = "connected";
|
|
967
|
+
AuthStatus2["DISCONNECTED"] = "disconnected";
|
|
968
|
+
AuthStatus2["VERIFIED"] = "verified";
|
|
969
|
+
})(AuthStatus || (enums.AuthStatus = AuthStatus = {}));
|
|
970
|
+
var ChainType;
|
|
971
|
+
(function(ChainType2) {
|
|
972
|
+
ChainType2["EVM"] = "evm";
|
|
973
|
+
ChainType2["SOLANA"] = "solana";
|
|
974
|
+
})(ChainType || (enums.ChainType = ChainType = {}));
|
|
975
|
+
var Chain;
|
|
976
|
+
(function(Chain2) {
|
|
977
|
+
Chain2["ETH_MAINNET"] = "eth-mainnet";
|
|
978
|
+
Chain2["ETH_SEPOLIA"] = "eth-sepolia";
|
|
979
|
+
Chain2["ETH_GOERLI"] = "eth-goerli";
|
|
980
|
+
Chain2["POLYGON_MAINNET"] = "polygon-mainnet";
|
|
981
|
+
Chain2["POLYGON_MUMBAI"] = "polygon-mumbai";
|
|
982
|
+
Chain2["POLYGON_AMOY"] = "polygon-amoy";
|
|
983
|
+
Chain2["OPTIMISM_MAINNET"] = "optimism-mainnet";
|
|
984
|
+
Chain2["OPTIMISM_SEPOLIA"] = "optimism-sepolia";
|
|
985
|
+
Chain2["OPTIMISM_GOERLI"] = "optimism-goerli";
|
|
986
|
+
Chain2["ARBITRUM_MAINNET"] = "arbitrum-mainnet";
|
|
987
|
+
Chain2["ARBITRUM_SEPOLIA"] = "arbitrum-sepolia";
|
|
988
|
+
Chain2["ARBITRUM_GOERLI"] = "arbitrum-goerli";
|
|
989
|
+
Chain2["BASE_MAINNET"] = "base-mainnet";
|
|
990
|
+
Chain2["BASE_SEPOLIA"] = "base-sepolia";
|
|
991
|
+
Chain2["BASE_GOERLI"] = "base-goerli";
|
|
992
|
+
Chain2["AVALANCHE_MAINNET"] = "avalanche-mainnet";
|
|
993
|
+
Chain2["AVALANCHE_FUJI"] = "avalanche-fuji";
|
|
994
|
+
Chain2["BNB_MAINNET"] = "bnb-mainnet";
|
|
995
|
+
Chain2["BNB_TESTNET"] = "bnb-testnet";
|
|
996
|
+
Chain2["GNOSIS_MAINNET"] = "gnosis-mainnet";
|
|
997
|
+
Chain2["GNOSIS_CHIADO"] = "gnosis-chiado";
|
|
998
|
+
Chain2["CELO_MAINNET"] = "celo-mainnet";
|
|
999
|
+
Chain2["CELO_ALFAJORES"] = "celo-alfajores";
|
|
1000
|
+
Chain2["ZKSYNC_MAINNET"] = "zksync-mainnet";
|
|
1001
|
+
Chain2["ZKSYNC_SEPOLIA"] = "zksync-sepolia";
|
|
1002
|
+
Chain2["LINEA_MAINNET"] = "linea-mainnet";
|
|
1003
|
+
Chain2["LINEA_SEPOLIA"] = "linea-sepolia";
|
|
1004
|
+
Chain2["SCROLL_MAINNET"] = "scroll-mainnet";
|
|
1005
|
+
Chain2["SCROLL_SEPOLIA"] = "scroll-sepolia";
|
|
1006
|
+
Chain2["MONAD_MAINNET"] = "monad-mainnet";
|
|
1007
|
+
Chain2["MONAD_TESTNET"] = "monad-testnet";
|
|
1008
|
+
Chain2["STORY_MAINNET"] = "story-mainnet";
|
|
1009
|
+
Chain2["STORY_TESTNET"] = "story-testnet";
|
|
1010
|
+
Chain2["PLUME_MAINNET"] = "plume-mainnet";
|
|
1011
|
+
Chain2["PLUME_TESTNET"] = "plume-testnet";
|
|
1012
|
+
Chain2["NEXUS_MAINNET"] = "nexus-mainnet";
|
|
1013
|
+
Chain2["NEXUS_TESTNET"] = "nexus-testnet";
|
|
1014
|
+
Chain2["HYPEREVM_MAINNET"] = "hyperevm-mainnet";
|
|
1015
|
+
Chain2["HYPEREVM_TESTNET"] = "hyperevm-testnet";
|
|
1016
|
+
Chain2["SONIC_MAINNET"] = "sonic-mainnet";
|
|
1017
|
+
Chain2["SONIC_TESTNET"] = "sonic-testnet";
|
|
1018
|
+
Chain2["SONIC_BLAZE"] = "sonic-blaze";
|
|
1019
|
+
Chain2["UNICHAIN_MAINNET"] = "unichain-mainnet";
|
|
1020
|
+
Chain2["UNICHAIN_SEPOLIA"] = "unichain-sepolia";
|
|
1021
|
+
Chain2["WORLD_MAINNET"] = "world-mainnet";
|
|
1022
|
+
Chain2["XDC_MAINNET"] = "xdc-mainnet";
|
|
1023
|
+
Chain2["INK_TESTNET"] = "ink-testnet";
|
|
1024
|
+
Chain2["FETCH_MAINNET"] = "fetch-mainnet";
|
|
1025
|
+
Chain2["FETCH_TESTNET"] = "fetch-testnet";
|
|
1026
|
+
Chain2["GENSYN_MAINNET"] = "gensyn-mainnet";
|
|
1027
|
+
Chain2["GENSYN_TESTNET"] = "gensyn-testnet";
|
|
1028
|
+
Chain2["RITUAL_MAINNET"] = "ritual-mainnet";
|
|
1029
|
+
Chain2["RITUAL_TESTNET"] = "ritual-testnet";
|
|
1030
|
+
Chain2["SOLANA_MAINNET"] = "solana-mainnet";
|
|
1031
|
+
Chain2["SOLANA_DEVNET"] = "solana-devnet";
|
|
1032
|
+
Chain2["SOLANA_TESTNET"] = "solana-testnet";
|
|
1033
|
+
Chain2["EVM_LOCAL"] = "evm-local";
|
|
1034
|
+
Chain2["SOLANA_LOCAL"] = "solana-local";
|
|
1035
|
+
})(Chain || (enums.Chain = Chain = {}));
|
|
1036
|
+
var Theme;
|
|
1037
|
+
(function(Theme2) {
|
|
1038
|
+
Theme2["LIGHT"] = "light";
|
|
1039
|
+
Theme2["DARK"] = "dark";
|
|
1040
|
+
Theme2["SYSTEM"] = "system";
|
|
1041
|
+
})(Theme || (enums.Theme = Theme = {}));
|
|
1042
|
+
var FontSize;
|
|
1043
|
+
(function(FontSize2) {
|
|
1044
|
+
FontSize2["SMALL"] = "small";
|
|
1045
|
+
FontSize2["MEDIUM"] = "medium";
|
|
1046
|
+
FontSize2["LARGE"] = "large";
|
|
1047
|
+
})(FontSize || (enums.FontSize = FontSize = {}));
|
|
1048
|
+
var EmailComposeType;
|
|
1049
|
+
(function(EmailComposeType2) {
|
|
1050
|
+
EmailComposeType2["NEW"] = "new";
|
|
1051
|
+
EmailComposeType2["REPLY"] = "reply";
|
|
1052
|
+
EmailComposeType2["REPLY_ALL"] = "replyAll";
|
|
1053
|
+
EmailComposeType2["FORWARD"] = "forward";
|
|
1054
|
+
})(EmailComposeType || (enums.EmailComposeType = EmailComposeType = {}));
|
|
1055
|
+
var MobileView;
|
|
1056
|
+
(function(MobileView2) {
|
|
1057
|
+
MobileView2["EMAIL_ADDRESSES"] = "emailAddresses";
|
|
1058
|
+
MobileView2["FOLDERS"] = "folders";
|
|
1059
|
+
MobileView2["EMAILS"] = "emails";
|
|
1060
|
+
MobileView2["EMAIL_BODY"] = "emailBody";
|
|
1061
|
+
})(MobileView || (enums.MobileView = MobileView = {}));
|
|
1062
|
+
var MediumView;
|
|
1063
|
+
(function(MediumView2) {
|
|
1064
|
+
MediumView2["LEFT"] = "left";
|
|
1065
|
+
MediumView2["RIGHT"] = "right";
|
|
1066
|
+
})(MediumView || (enums.MediumView = MediumView = {}));
|
|
1067
|
+
var EmailAction;
|
|
1068
|
+
(function(EmailAction2) {
|
|
1069
|
+
EmailAction2["OPEN"] = "open";
|
|
1070
|
+
EmailAction2["REPLY"] = "reply";
|
|
1071
|
+
EmailAction2["FORWARD"] = "forward";
|
|
1072
|
+
EmailAction2["DELETE"] = "delete";
|
|
1073
|
+
EmailAction2["STAR"] = "star";
|
|
1074
|
+
EmailAction2["UNSTAR"] = "unstar";
|
|
1075
|
+
EmailAction2["MARK_READ"] = "mark_read";
|
|
1076
|
+
EmailAction2["MARK_UNREAD"] = "mark_unread";
|
|
1077
|
+
})(EmailAction || (enums.EmailAction = EmailAction = {}));
|
|
1078
|
+
var SubscriptionAction;
|
|
1079
|
+
(function(SubscriptionAction2) {
|
|
1080
|
+
SubscriptionAction2["VIEW"] = "view";
|
|
1081
|
+
SubscriptionAction2["PURCHASE"] = "purchase";
|
|
1082
|
+
SubscriptionAction2["CANCEL"] = "cancel";
|
|
1083
|
+
SubscriptionAction2["RESTORE"] = "restore";
|
|
1084
|
+
})(SubscriptionAction || (enums.SubscriptionAction = SubscriptionAction = {}));
|
|
1085
|
+
var RequestStatus;
|
|
1086
|
+
(function(RequestStatus2) {
|
|
1087
|
+
RequestStatus2["IDLE"] = "idle";
|
|
1088
|
+
RequestStatus2["LOADING"] = "loading";
|
|
1089
|
+
RequestStatus2["SUCCESS"] = "success";
|
|
1090
|
+
RequestStatus2["ERROR"] = "error";
|
|
1091
|
+
})(RequestStatus || (enums.RequestStatus = RequestStatus = {}));
|
|
1092
|
+
var NotificationType;
|
|
1093
|
+
(function(NotificationType2) {
|
|
1094
|
+
NotificationType2["INFO"] = "info";
|
|
1095
|
+
NotificationType2["SUCCESS"] = "success";
|
|
1096
|
+
NotificationType2["WARNING"] = "warning";
|
|
1097
|
+
NotificationType2["ERROR"] = "error";
|
|
1098
|
+
})(NotificationType || (enums.NotificationType = NotificationType = {}));
|
|
1099
|
+
var InfoType;
|
|
1100
|
+
(function(InfoType2) {
|
|
1101
|
+
InfoType2["INFO"] = "info";
|
|
1102
|
+
InfoType2["SUCCESS"] = "success";
|
|
1103
|
+
InfoType2["WARNING"] = "warning";
|
|
1104
|
+
InfoType2["ERROR"] = "error";
|
|
1105
|
+
})(InfoType || (enums.InfoType = InfoType = {}));
|
|
1106
|
+
var EmailAddressType;
|
|
1107
|
+
(function(EmailAddressType2) {
|
|
1108
|
+
EmailAddressType2["DIRECT"] = "direct";
|
|
1109
|
+
EmailAddressType2["ENS"] = "ens";
|
|
1110
|
+
EmailAddressType2["SNS"] = "sns";
|
|
1111
|
+
EmailAddressType2["CUSTOM"] = "custom";
|
|
1112
|
+
})(EmailAddressType || (enums.EmailAddressType = EmailAddressType = {}));
|
|
1113
|
+
var SortOrder;
|
|
1114
|
+
(function(SortOrder2) {
|
|
1115
|
+
SortOrder2["ASC"] = "asc";
|
|
1116
|
+
SortOrder2["DESC"] = "desc";
|
|
1117
|
+
})(SortOrder || (enums.SortOrder = SortOrder = {}));
|
|
1118
|
+
var EmailSortCriteria;
|
|
1119
|
+
(function(EmailSortCriteria2) {
|
|
1120
|
+
EmailSortCriteria2["DATE"] = "date";
|
|
1121
|
+
EmailSortCriteria2["SUBJECT"] = "subject";
|
|
1122
|
+
EmailSortCriteria2["FROM"] = "from";
|
|
1123
|
+
EmailSortCriteria2["SIZE"] = "size";
|
|
1124
|
+
})(EmailSortCriteria || (enums.EmailSortCriteria = EmailSortCriteria = {}));
|
|
1125
|
+
var ConnectionType;
|
|
1126
|
+
(function(ConnectionType2) {
|
|
1127
|
+
ConnectionType2["UNKNOWN"] = "unknown";
|
|
1128
|
+
ConnectionType2["NONE"] = "none";
|
|
1129
|
+
ConnectionType2["WIFI"] = "wifi";
|
|
1130
|
+
ConnectionType2["CELLULAR_2G"] = "2g";
|
|
1131
|
+
ConnectionType2["CELLULAR_3G"] = "3g";
|
|
1132
|
+
ConnectionType2["CELLULAR_4G"] = "4g";
|
|
1133
|
+
ConnectionType2["CELLULAR_5G"] = "5g";
|
|
1134
|
+
ConnectionType2["ETHERNET"] = "ethernet";
|
|
1135
|
+
})(ConnectionType || (enums.ConnectionType = ConnectionType = {}));
|
|
1136
|
+
var ConnectionState;
|
|
1137
|
+
(function(ConnectionState2) {
|
|
1138
|
+
ConnectionState2["UNKNOWN"] = "unknown";
|
|
1139
|
+
ConnectionState2["DISCONNECTED"] = "disconnected";
|
|
1140
|
+
ConnectionState2["CONNECTING"] = "connecting";
|
|
1141
|
+
ConnectionState2["CONNECTED"] = "connected";
|
|
1142
|
+
ConnectionState2["RECONNECTING"] = "reconnecting";
|
|
1143
|
+
ConnectionState2["VERIFIED"] = "verified";
|
|
1144
|
+
ConnectionState2["LIMITED"] = "limited";
|
|
1145
|
+
ConnectionState2["ERROR"] = "error";
|
|
1146
|
+
})(ConnectionState || (enums.ConnectionState = ConnectionState = {}));
|
|
1147
|
+
var PlatformType;
|
|
1148
|
+
(function(PlatformType2) {
|
|
1149
|
+
PlatformType2["WEB"] = "web";
|
|
1150
|
+
PlatformType2["REACT_NATIVE"] = "react_native";
|
|
1151
|
+
PlatformType2["DESKTOP"] = "desktop";
|
|
1152
|
+
})(PlatformType || (enums.PlatformType = PlatformType = {}));
|
|
1153
|
+
var EmailValidationState;
|
|
1154
|
+
(function(EmailValidationState2) {
|
|
1155
|
+
EmailValidationState2["VALID"] = "valid";
|
|
1156
|
+
EmailValidationState2["INVALID"] = "invalid";
|
|
1157
|
+
EmailValidationState2["PENDING"] = "pending";
|
|
1158
|
+
EmailValidationState2["UNKNOWN"] = "unknown";
|
|
1159
|
+
})(EmailValidationState || (enums.EmailValidationState = EmailValidationState = {}));
|
|
1160
|
+
var FeatureFlag;
|
|
1161
|
+
(function(FeatureFlag2) {
|
|
1162
|
+
FeatureFlag2["AI_SEARCH"] = "ai_search";
|
|
1163
|
+
FeatureFlag2["SMART_COMPOSE"] = "smart_compose";
|
|
1164
|
+
FeatureFlag2["ADVANCED_FILTERS"] = "advanced_filters";
|
|
1165
|
+
FeatureFlag2["DARK_MODE"] = "dark_mode";
|
|
1166
|
+
FeatureFlag2["NOTIFICATIONS"] = "notifications";
|
|
1167
|
+
FeatureFlag2["ANALYTICS"] = "analytics";
|
|
1168
|
+
})(FeatureFlag || (enums.FeatureFlag = FeatureFlag = {}));
|
|
1169
|
+
var ErrorType;
|
|
1170
|
+
(function(ErrorType2) {
|
|
1171
|
+
ErrorType2["NETWORK"] = "network";
|
|
1172
|
+
ErrorType2["AUTH"] = "auth";
|
|
1173
|
+
ErrorType2["VALIDATION"] = "validation";
|
|
1174
|
+
ErrorType2["PERMISSION"] = "permission";
|
|
1175
|
+
ErrorType2["UNKNOWN"] = "unknown";
|
|
1176
|
+
})(ErrorType || (enums.ErrorType = ErrorType = {}));
|
|
1177
|
+
var Currency;
|
|
1178
|
+
(function(Currency2) {
|
|
1179
|
+
Currency2["USD"] = "USD";
|
|
1180
|
+
Currency2["EUR"] = "EUR";
|
|
1181
|
+
Currency2["GBP"] = "GBP";
|
|
1182
|
+
Currency2["CAD"] = "CAD";
|
|
1183
|
+
Currency2["AUD"] = "AUD";
|
|
1184
|
+
})(Currency || (enums.Currency = Currency = {}));
|
|
1185
|
+
return enums;
|
|
1186
|
+
}
|
|
1187
|
+
var walletStatus = {};
|
|
1188
|
+
var hasRequiredWalletStatus;
|
|
1189
|
+
function requireWalletStatus() {
|
|
1190
|
+
if (hasRequiredWalletStatus) return walletStatus;
|
|
1191
|
+
hasRequiredWalletStatus = 1;
|
|
1192
|
+
(function(exports$1) {
|
|
1193
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
1194
|
+
exports$1.getWalletConnectionState = exports$1.isWalletVerified = exports$1.isWalletConnected = void 0;
|
|
1195
|
+
const enums_1 = requireEnums();
|
|
1196
|
+
const isWalletConnected = (status) => {
|
|
1197
|
+
return status !== void 0 && status !== null && Boolean(status.walletAddress);
|
|
1198
|
+
};
|
|
1199
|
+
exports$1.isWalletConnected = isWalletConnected;
|
|
1200
|
+
const isWalletVerified = (status) => {
|
|
1201
|
+
return (0, exports$1.isWalletConnected)(status) && Boolean(status.message) && Boolean(status.signature);
|
|
1202
|
+
};
|
|
1203
|
+
exports$1.isWalletVerified = isWalletVerified;
|
|
1204
|
+
const getWalletConnectionState = (status) => {
|
|
1205
|
+
if (!(0, exports$1.isWalletConnected)(status)) {
|
|
1206
|
+
return enums_1.ConnectionState.DISCONNECTED;
|
|
1207
|
+
}
|
|
1208
|
+
if ((0, exports$1.isWalletVerified)(status)) {
|
|
1209
|
+
return enums_1.ConnectionState.VERIFIED;
|
|
1210
|
+
}
|
|
1211
|
+
return enums_1.ConnectionState.CONNECTED;
|
|
1212
|
+
};
|
|
1213
|
+
exports$1.getWalletConnectionState = getWalletConnectionState;
|
|
1214
|
+
})(walletStatus);
|
|
1215
|
+
return walletStatus;
|
|
1216
|
+
}
|
|
1217
|
+
var common = {};
|
|
1218
|
+
var hasRequiredCommon;
|
|
1219
|
+
function requireCommon() {
|
|
1220
|
+
if (hasRequiredCommon) return common;
|
|
1221
|
+
hasRequiredCommon = 1;
|
|
1222
|
+
Object.defineProperty(common, "__esModule", { value: true });
|
|
1223
|
+
common.PROTOCOL_CONSTANTS = common.TransactionStatus = common.MessageType = void 0;
|
|
1224
|
+
common.isSolanaAddress = isSolanaAddress;
|
|
1225
|
+
common.isEvmAddress = isEvmAddress;
|
|
1226
|
+
common.isSolanaRecipient = isSolanaRecipient;
|
|
1227
|
+
common.isEvmRecipient = isEvmRecipient;
|
|
1228
|
+
var MessageType;
|
|
1229
|
+
(function(MessageType2) {
|
|
1230
|
+
MessageType2["STANDARD"] = "standard";
|
|
1231
|
+
MessageType2["PRIORITY"] = "priority";
|
|
1232
|
+
MessageType2["PREPARED_STANDARD"] = "prepared_standard";
|
|
1233
|
+
MessageType2["PREPARED_PRIORITY"] = "prepared_priority";
|
|
1234
|
+
})(MessageType || (common.MessageType = MessageType = {}));
|
|
1235
|
+
var TransactionStatus;
|
|
1236
|
+
(function(TransactionStatus2) {
|
|
1237
|
+
TransactionStatus2["SUCCESS"] = "success";
|
|
1238
|
+
TransactionStatus2["FAILED"] = "failed";
|
|
1239
|
+
TransactionStatus2["PENDING"] = "pending";
|
|
1240
|
+
})(TransactionStatus || (common.TransactionStatus = TransactionStatus = {}));
|
|
1241
|
+
function isSolanaAddress(address2) {
|
|
1242
|
+
try {
|
|
1243
|
+
if (address2.length < 32 || address2.length > 44) {
|
|
1244
|
+
return false;
|
|
1245
|
+
}
|
|
1246
|
+
const base58Regex = /^[1-9A-HJ-NP-Za-km-z]+$/;
|
|
1247
|
+
if (!base58Regex.test(address2)) {
|
|
1248
|
+
return false;
|
|
1249
|
+
}
|
|
1250
|
+
try {
|
|
1251
|
+
const bs58 = require("bs58");
|
|
1252
|
+
const decoded = bs58.decode(address2);
|
|
1253
|
+
return decoded.length === 32;
|
|
1254
|
+
} catch {
|
|
1255
|
+
return true;
|
|
1256
|
+
}
|
|
1257
|
+
} catch {
|
|
1258
|
+
return false;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
function isEvmAddress(address2) {
|
|
1262
|
+
return /^0x[a-fA-F0-9]{40}$/.test(address2);
|
|
1263
|
+
}
|
|
1264
|
+
function isSolanaRecipient(recipient) {
|
|
1265
|
+
return isSolanaAddress(recipient);
|
|
1266
|
+
}
|
|
1267
|
+
function isEvmRecipient(recipient) {
|
|
1268
|
+
return isEvmAddress(recipient);
|
|
1269
|
+
}
|
|
1270
|
+
common.PROTOCOL_CONSTANTS = {
|
|
1271
|
+
/** Base send fee: 0.1 USDC (100,000 with 6 decimals) */
|
|
1272
|
+
SEND_FEE: 100000n,
|
|
1273
|
+
/** Claim period: 60 days in seconds */
|
|
1274
|
+
CLAIM_PERIOD: 60 * 24 * 60 * 60,
|
|
1275
|
+
/** Revenue share percentages */
|
|
1276
|
+
REVENUE_SHARES: {
|
|
1277
|
+
SENDER: 90,
|
|
1278
|
+
OWNER: 10
|
|
1279
|
+
},
|
|
1280
|
+
/** USDC token decimals */
|
|
1281
|
+
USDC_DECIMALS: 6,
|
|
1282
|
+
/** Maximum message lengths */
|
|
1283
|
+
MAX_LENGTHS: {
|
|
1284
|
+
SUBJECT: 200,
|
|
1285
|
+
BODY: 2e3,
|
|
1286
|
+
MAIL_ID: 100
|
|
1287
|
+
}
|
|
1288
|
+
};
|
|
1289
|
+
return common;
|
|
1290
|
+
}
|
|
1291
|
+
var validation = {};
|
|
1292
|
+
var address = {};
|
|
1293
|
+
var hasRequiredAddress;
|
|
1294
|
+
function requireAddress() {
|
|
1295
|
+
if (hasRequiredAddress) return address;
|
|
1296
|
+
hasRequiredAddress = 1;
|
|
1297
|
+
Object.defineProperty(address, "__esModule", { value: true });
|
|
1298
|
+
address.AddressType = void 0;
|
|
1299
|
+
address.isENSName = isENSName;
|
|
1300
|
+
address.isSNSName = isSNSName;
|
|
1301
|
+
address.getAddressType = getAddressType;
|
|
1302
|
+
address.isValidWalletAddress = isValidWalletAddress;
|
|
1303
|
+
address.isValidSignature = isValidSignature;
|
|
1304
|
+
address.parseEmailAddress = parseEmailAddress;
|
|
1305
|
+
address.formatWalletAddress = formatWalletAddress;
|
|
1306
|
+
address.getChainDisplayName = getChainDisplayName;
|
|
1307
|
+
const enums_1 = requireEnums();
|
|
1308
|
+
const common_1 = requireCommon();
|
|
1309
|
+
var AddressType;
|
|
1310
|
+
(function(AddressType2) {
|
|
1311
|
+
AddressType2["EVMAddress"] = "EVMAddress";
|
|
1312
|
+
AddressType2["SolanaAddress"] = "SolanaAddress";
|
|
1313
|
+
AddressType2["ENSName"] = "ENSName";
|
|
1314
|
+
AddressType2["SNSName"] = "SNSName";
|
|
1315
|
+
})(AddressType || (address.AddressType = AddressType = {}));
|
|
1316
|
+
function isENSName(address2) {
|
|
1317
|
+
const lowerAddress = address2.toLowerCase();
|
|
1318
|
+
if (!lowerAddress.endsWith(".eth") && !lowerAddress.endsWith(".box")) {
|
|
1319
|
+
return false;
|
|
1320
|
+
}
|
|
1321
|
+
const nameWithoutTLD = lowerAddress.endsWith(".eth") ? lowerAddress.slice(0, -4) : lowerAddress.slice(0, -4);
|
|
1322
|
+
if (nameWithoutTLD.length === 0) {
|
|
1323
|
+
return false;
|
|
1324
|
+
}
|
|
1325
|
+
const labels = nameWithoutTLD.split(".");
|
|
1326
|
+
const validLabelRegex = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
|
|
1327
|
+
for (const label of labels) {
|
|
1328
|
+
if (label.length === 0 || !validLabelRegex.test(label)) {
|
|
1329
|
+
return false;
|
|
1330
|
+
}
|
|
1331
|
+
if (label.includes("--")) {
|
|
1332
|
+
return false;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
return true;
|
|
1336
|
+
}
|
|
1337
|
+
function isSNSName(address2) {
|
|
1338
|
+
const lowerAddress = address2.toLowerCase();
|
|
1339
|
+
const snsExtensions = [
|
|
1340
|
+
".sol",
|
|
1341
|
+
".abc",
|
|
1342
|
+
".bonk",
|
|
1343
|
+
".poor",
|
|
1344
|
+
".gm",
|
|
1345
|
+
".dao",
|
|
1346
|
+
".defi",
|
|
1347
|
+
".web3"
|
|
1348
|
+
];
|
|
1349
|
+
const matchingExtension = snsExtensions.find((ext) => lowerAddress.endsWith(ext));
|
|
1350
|
+
if (!matchingExtension) {
|
|
1351
|
+
return false;
|
|
1352
|
+
}
|
|
1353
|
+
const nameWithoutTLD = lowerAddress.slice(0, -matchingExtension.length);
|
|
1354
|
+
if (nameWithoutTLD.length === 0) {
|
|
1355
|
+
return false;
|
|
1356
|
+
}
|
|
1357
|
+
const labels = nameWithoutTLD.split(".");
|
|
1358
|
+
const validLabelRegex = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
|
|
1359
|
+
for (const label of labels) {
|
|
1360
|
+
if (label.length === 0 || !validLabelRegex.test(label)) {
|
|
1361
|
+
return false;
|
|
1362
|
+
}
|
|
1363
|
+
if (label.includes("--")) {
|
|
1364
|
+
return false;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
return true;
|
|
1368
|
+
}
|
|
1369
|
+
function getAddressType(address2, parentAddressType = void 0) {
|
|
1370
|
+
if ((0, common_1.isEvmAddress)(address2)) {
|
|
1371
|
+
return AddressType.EVMAddress;
|
|
1372
|
+
}
|
|
1373
|
+
if ((0, common_1.isSolanaAddress)(address2)) {
|
|
1374
|
+
return AddressType.SolanaAddress;
|
|
1375
|
+
}
|
|
1376
|
+
if (parentAddressType && address2.includes(".")) {
|
|
1377
|
+
if (parentAddressType === AddressType.EVMAddress) {
|
|
1378
|
+
return AddressType.ENSName;
|
|
1379
|
+
}
|
|
1380
|
+
if (parentAddressType === AddressType.SolanaAddress) {
|
|
1381
|
+
return AddressType.SNSName;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
return void 0;
|
|
1385
|
+
}
|
|
1386
|
+
function isValidWalletAddress(address2, chainType) {
|
|
1387
|
+
if (!address2 || typeof address2 !== "string") {
|
|
1388
|
+
return false;
|
|
1389
|
+
}
|
|
1390
|
+
const addressType = getAddressType(address2);
|
|
1391
|
+
switch (chainType) {
|
|
1392
|
+
case enums_1.ChainType.EVM:
|
|
1393
|
+
return addressType === AddressType.EVMAddress || addressType === AddressType.ENSName;
|
|
1394
|
+
case enums_1.ChainType.SOLANA:
|
|
1395
|
+
return addressType === AddressType.SolanaAddress || addressType === AddressType.SNSName;
|
|
1396
|
+
default:
|
|
1397
|
+
return !!addressType;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
function isValidSignature(signature, chainType) {
|
|
1401
|
+
if (!signature || typeof signature !== "string") {
|
|
1402
|
+
return false;
|
|
1403
|
+
}
|
|
1404
|
+
switch (chainType) {
|
|
1405
|
+
case enums_1.ChainType.EVM:
|
|
1406
|
+
return /^0x[a-fA-F0-9]{130}$/.test(signature);
|
|
1407
|
+
case enums_1.ChainType.SOLANA:
|
|
1408
|
+
return /^[1-9A-HJ-NP-Za-km-z]{87,88}$/.test(signature);
|
|
1409
|
+
default:
|
|
1410
|
+
return signature.length > 50;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
function parseEmailAddress(email) {
|
|
1414
|
+
if (!email || typeof email !== "string") {
|
|
1415
|
+
return void 0;
|
|
1416
|
+
}
|
|
1417
|
+
const parts = email.split("@");
|
|
1418
|
+
if (parts.length !== 2) {
|
|
1419
|
+
return void 0;
|
|
1420
|
+
}
|
|
1421
|
+
const [address2, domain] = parts;
|
|
1422
|
+
if (!address2 || !domain) {
|
|
1423
|
+
return void 0;
|
|
1424
|
+
}
|
|
1425
|
+
const type = getAddressType(address2);
|
|
1426
|
+
return {
|
|
1427
|
+
address: address2,
|
|
1428
|
+
domain,
|
|
1429
|
+
type
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
function formatWalletAddress(address2) {
|
|
1433
|
+
if (!address2 || address2.length < 10) {
|
|
1434
|
+
return address2;
|
|
1435
|
+
}
|
|
1436
|
+
const addressType = getAddressType(address2);
|
|
1437
|
+
if ((addressType === AddressType.ENSName || addressType === AddressType.SNSName) && address2.length <= 20) {
|
|
1438
|
+
return address2;
|
|
1439
|
+
}
|
|
1440
|
+
return `${address2.slice(0, 6)}...${address2.slice(-4)}`;
|
|
1441
|
+
}
|
|
1442
|
+
function getChainDisplayName(chainType) {
|
|
1443
|
+
if (!chainType) {
|
|
1444
|
+
return "Unknown Chain";
|
|
1445
|
+
}
|
|
1446
|
+
switch (chainType) {
|
|
1447
|
+
case enums_1.ChainType.EVM:
|
|
1448
|
+
return "EVM Chain";
|
|
1449
|
+
case enums_1.ChainType.SOLANA:
|
|
1450
|
+
return "Solana";
|
|
1451
|
+
default:
|
|
1452
|
+
return "Blockchain";
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
return address;
|
|
1456
|
+
}
|
|
1457
|
+
var hasRequiredValidation;
|
|
1458
|
+
function requireValidation() {
|
|
1459
|
+
if (hasRequiredValidation) return validation;
|
|
1460
|
+
hasRequiredValidation = 1;
|
|
1461
|
+
Object.defineProperty(validation, "__esModule", { value: true });
|
|
1462
|
+
validation.validateDomain = validateDomain;
|
|
1463
|
+
validation.validateMessage = validateMessage;
|
|
1464
|
+
validation.validateAddress = validateAddress;
|
|
1465
|
+
validation.validateAmount = validateAmount;
|
|
1466
|
+
const address_1 = requireAddress();
|
|
1467
|
+
function validateDomain(domain) {
|
|
1468
|
+
if (!domain || domain.length === 0) {
|
|
1469
|
+
throw new Error("Domain cannot be empty");
|
|
1470
|
+
}
|
|
1471
|
+
if (domain.length > 100) {
|
|
1472
|
+
throw new Error("Domain cannot exceed 100 characters");
|
|
1473
|
+
}
|
|
1474
|
+
const domainRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
1475
|
+
if (!domainRegex.test(domain)) {
|
|
1476
|
+
throw new Error("Invalid domain format");
|
|
1477
|
+
}
|
|
1478
|
+
return true;
|
|
1479
|
+
}
|
|
1480
|
+
function validateMessage(subject, body) {
|
|
1481
|
+
if (!subject || subject.length === 0) {
|
|
1482
|
+
throw new Error("Message subject cannot be empty");
|
|
1483
|
+
}
|
|
1484
|
+
if (subject.length > 200) {
|
|
1485
|
+
throw new Error("Message subject cannot exceed 200 characters");
|
|
1486
|
+
}
|
|
1487
|
+
if (!body || body.length === 0) {
|
|
1488
|
+
throw new Error("Message body cannot be empty");
|
|
1489
|
+
}
|
|
1490
|
+
if (body.length > 1e4) {
|
|
1491
|
+
throw new Error("Message body cannot exceed 10000 characters");
|
|
1492
|
+
}
|
|
1493
|
+
return true;
|
|
1494
|
+
}
|
|
1495
|
+
function validateAddress(address2, chainType) {
|
|
1496
|
+
if (!address2 || address2.length === 0) {
|
|
1497
|
+
throw new Error("Address cannot be empty");
|
|
1498
|
+
}
|
|
1499
|
+
if (!(0, address_1.isValidWalletAddress)(address2, chainType)) {
|
|
1500
|
+
throw new Error(`Invalid ${chainType} address format`);
|
|
1501
|
+
}
|
|
1502
|
+
return true;
|
|
1503
|
+
}
|
|
1504
|
+
function validateAmount(amount) {
|
|
1505
|
+
if (amount === null || amount === void 0 || amount === "" || typeof amount === "string" && amount.trim() === "") {
|
|
1506
|
+
throw new Error("Invalid amount format");
|
|
1507
|
+
}
|
|
1508
|
+
let amountBigInt;
|
|
1509
|
+
try {
|
|
1510
|
+
if (typeof amount === "string") {
|
|
1511
|
+
if (!/^-?\d+$/.test(amount.trim())) {
|
|
1512
|
+
throw new Error("Invalid amount format");
|
|
1513
|
+
}
|
|
1514
|
+
amountBigInt = BigInt(amount);
|
|
1515
|
+
} else if (typeof amount === "number") {
|
|
1516
|
+
if (!Number.isFinite(amount)) {
|
|
1517
|
+
throw new Error("Invalid amount format");
|
|
1518
|
+
}
|
|
1519
|
+
amountBigInt = BigInt(Math.floor(amount));
|
|
1520
|
+
} else if (typeof amount === "bigint") {
|
|
1521
|
+
amountBigInt = amount;
|
|
1522
|
+
} else {
|
|
1523
|
+
throw new Error("Invalid amount format");
|
|
1524
|
+
}
|
|
1525
|
+
} catch {
|
|
1526
|
+
throw new Error("Invalid amount format");
|
|
1527
|
+
}
|
|
1528
|
+
if (amountBigInt < 0n) {
|
|
1529
|
+
throw new Error("Amount cannot be negative");
|
|
1530
|
+
}
|
|
1531
|
+
return amountBigInt;
|
|
1532
|
+
}
|
|
1533
|
+
return validation;
|
|
1534
|
+
}
|
|
1535
|
+
var environment = {};
|
|
1536
|
+
var hasRequiredEnvironment;
|
|
1537
|
+
function requireEnvironment() {
|
|
1538
|
+
if (hasRequiredEnvironment) return environment;
|
|
1539
|
+
hasRequiredEnvironment = 1;
|
|
1540
|
+
Object.defineProperty(environment, "__esModule", { value: true });
|
|
1541
|
+
environment.StorageType = void 0;
|
|
1542
|
+
var StorageType;
|
|
1543
|
+
(function(StorageType2) {
|
|
1544
|
+
StorageType2["LOCAL_STORAGE"] = "localStorage";
|
|
1545
|
+
StorageType2["SESSION_STORAGE"] = "sessionStorage";
|
|
1546
|
+
StorageType2["ASYNC_STORAGE"] = "asyncStorage";
|
|
1547
|
+
StorageType2["MEMORY"] = "memory";
|
|
1548
|
+
})(StorageType || (environment.StorageType = StorageType = {}));
|
|
1549
|
+
return environment;
|
|
1550
|
+
}
|
|
1551
|
+
var analytics = {};
|
|
1552
|
+
var hasRequiredAnalytics;
|
|
1553
|
+
function requireAnalytics() {
|
|
1554
|
+
if (hasRequiredAnalytics) return analytics;
|
|
1555
|
+
hasRequiredAnalytics = 1;
|
|
1556
|
+
Object.defineProperty(analytics, "__esModule", { value: true });
|
|
1557
|
+
analytics.AnalyticsEventBuilder = analytics.AnalyticsEvent = void 0;
|
|
1558
|
+
var AnalyticsEvent;
|
|
1559
|
+
(function(AnalyticsEvent2) {
|
|
1560
|
+
AnalyticsEvent2["USER_LOGIN"] = "user_login";
|
|
1561
|
+
AnalyticsEvent2["USER_LOGOUT"] = "user_logout";
|
|
1562
|
+
AnalyticsEvent2["USER_SIGNUP"] = "user_signup";
|
|
1563
|
+
AnalyticsEvent2["EMAIL_SENT"] = "email_sent";
|
|
1564
|
+
AnalyticsEvent2["EMAIL_RECEIVED"] = "email_received";
|
|
1565
|
+
AnalyticsEvent2["EMAIL_OPENED"] = "email_opened";
|
|
1566
|
+
AnalyticsEvent2["EMAIL_REPLY"] = "email_reply";
|
|
1567
|
+
AnalyticsEvent2["EMAIL_FORWARD"] = "email_forward";
|
|
1568
|
+
AnalyticsEvent2["EMAIL_DELETE"] = "email_delete";
|
|
1569
|
+
AnalyticsEvent2["EMAIL_STAR"] = "email_star";
|
|
1570
|
+
AnalyticsEvent2["EMAIL_COMPOSE"] = "email_compose";
|
|
1571
|
+
AnalyticsEvent2["EMAIL_CLICKED"] = "email_clicked";
|
|
1572
|
+
AnalyticsEvent2["PAGE_VIEW"] = "page_view";
|
|
1573
|
+
AnalyticsEvent2["SCREEN_VIEW"] = "screen_view";
|
|
1574
|
+
AnalyticsEvent2["FOLDER_SWITCH"] = "folder_switch";
|
|
1575
|
+
AnalyticsEvent2["SUBSCRIPTION_VIEW"] = "subscription_view";
|
|
1576
|
+
AnalyticsEvent2["SUBSCRIPTION_PURCHASE"] = "subscription_purchase";
|
|
1577
|
+
AnalyticsEvent2["SUBSCRIPTION_CANCEL"] = "subscription_cancel";
|
|
1578
|
+
AnalyticsEvent2["SEARCH_PERFORMED"] = "search_performed";
|
|
1579
|
+
AnalyticsEvent2["SETTINGS_CHANGED"] = "settings_changed";
|
|
1580
|
+
AnalyticsEvent2["ERROR_OCCURRED"] = "error_occurred";
|
|
1581
|
+
AnalyticsEvent2["AB_TEST_VIEWED"] = "ab_test_viewed";
|
|
1582
|
+
AnalyticsEvent2["AB_TEST_CONVERTED"] = "ab_test_converted";
|
|
1583
|
+
AnalyticsEvent2["CUSTOM_EVENT"] = "custom_event";
|
|
1584
|
+
})(AnalyticsEvent || (analytics.AnalyticsEvent = AnalyticsEvent = {}));
|
|
1585
|
+
class AnalyticsEventBuilder {
|
|
1586
|
+
/**
|
|
1587
|
+
* Build properties for email action events.
|
|
1588
|
+
*
|
|
1589
|
+
* @param action Email action performed (read, sent, archived, etc.)
|
|
1590
|
+
* @param emailId Unique identifier for the email
|
|
1591
|
+
* @param folder Email folder context (inbox, sent, trash, etc.)
|
|
1592
|
+
* @returns Standardized event properties object
|
|
1593
|
+
*
|
|
1594
|
+
* @ai-builder Email action properties
|
|
1595
|
+
* @ai-standardization Consistent email event tracking
|
|
1596
|
+
*/
|
|
1597
|
+
static emailAction(action, emailId, folder) {
|
|
1598
|
+
return {
|
|
1599
|
+
action,
|
|
1600
|
+
email_id: emailId,
|
|
1601
|
+
folder,
|
|
1602
|
+
timestamp: Date.now()
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Build properties for page/screen view events.
|
|
1607
|
+
*
|
|
1608
|
+
* @param pageName Human-readable page name
|
|
1609
|
+
* @param pagePath URL path or screen identifier
|
|
1610
|
+
* @returns Standardized page view properties
|
|
1611
|
+
*
|
|
1612
|
+
* @ai-builder Navigation tracking properties
|
|
1613
|
+
* @ai-cross-platform Works for web pages and mobile screens
|
|
1614
|
+
*/
|
|
1615
|
+
static pageView(pageName, pagePath) {
|
|
1616
|
+
return {
|
|
1617
|
+
page_name: pageName,
|
|
1618
|
+
page_path: pagePath,
|
|
1619
|
+
timestamp: Date.now()
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Build properties for error tracking events.
|
|
1624
|
+
*
|
|
1625
|
+
* @param errorType Category of error (network, validation, runtime, etc.)
|
|
1626
|
+
* @param errorMessage Error message or description
|
|
1627
|
+
* @param pageName Page/screen where error occurred
|
|
1628
|
+
* @returns Standardized error event properties
|
|
1629
|
+
*
|
|
1630
|
+
* @ai-builder Error tracking properties
|
|
1631
|
+
* @ai-debugging Consistent error event structure
|
|
1632
|
+
*/
|
|
1633
|
+
static error(errorType, errorMessage, pageName) {
|
|
1634
|
+
return {
|
|
1635
|
+
error_type: errorType,
|
|
1636
|
+
error_message: errorMessage,
|
|
1637
|
+
page_name: pageName,
|
|
1638
|
+
timestamp: Date.now()
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* Build properties for subscription/revenue events.
|
|
1643
|
+
*
|
|
1644
|
+
* @param action Subscription action (subscribe, upgrade, cancel, etc.)
|
|
1645
|
+
* @param planType Subscription plan type (free, premium, pro, etc.)
|
|
1646
|
+
* @param amount Monetary amount (for revenue tracking)
|
|
1647
|
+
* @param currency Currency code (USD, EUR, etc.)
|
|
1648
|
+
* @returns Standardized subscription event properties
|
|
1649
|
+
*
|
|
1650
|
+
* @ai-builder Revenue tracking properties
|
|
1651
|
+
* @ai-business-metrics Subscription and revenue analytics
|
|
1652
|
+
*/
|
|
1653
|
+
static subscription(action, planType, amount, currency2) {
|
|
1654
|
+
return {
|
|
1655
|
+
action,
|
|
1656
|
+
plan_type: planType,
|
|
1657
|
+
amount,
|
|
1658
|
+
currency: currency2,
|
|
1659
|
+
timestamp: Date.now()
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Build properties for user engagement events.
|
|
1664
|
+
*
|
|
1665
|
+
* @param feature Feature name or component identifier
|
|
1666
|
+
* @param interaction Type of interaction (click, scroll, hover, etc.)
|
|
1667
|
+
* @param duration Time spent on interaction (milliseconds)
|
|
1668
|
+
* @returns Standardized engagement event properties
|
|
1669
|
+
*
|
|
1670
|
+
* @ai-builder User engagement properties
|
|
1671
|
+
* @ai-ux-analytics User experience and interaction tracking
|
|
1672
|
+
*/
|
|
1673
|
+
static engagement(feature, interaction, duration) {
|
|
1674
|
+
return {
|
|
1675
|
+
feature,
|
|
1676
|
+
interaction,
|
|
1677
|
+
duration,
|
|
1678
|
+
timestamp: Date.now()
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Build properties for performance monitoring events.
|
|
1683
|
+
*
|
|
1684
|
+
* @param metric Performance metric name (load_time, api_response, etc.)
|
|
1685
|
+
* @param value Metric value (usually in milliseconds)
|
|
1686
|
+
* @param context Additional context about the performance event
|
|
1687
|
+
* @returns Standardized performance event properties
|
|
1688
|
+
*
|
|
1689
|
+
* @ai-builder Performance monitoring properties
|
|
1690
|
+
* @ai-performance Application performance tracking
|
|
1691
|
+
*/
|
|
1692
|
+
static performance(metric, value, context) {
|
|
1693
|
+
return {
|
|
1694
|
+
metric,
|
|
1695
|
+
value,
|
|
1696
|
+
context,
|
|
1697
|
+
timestamp: Date.now()
|
|
1698
|
+
};
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
analytics.AnalyticsEventBuilder = AnalyticsEventBuilder;
|
|
1702
|
+
return analytics;
|
|
1703
|
+
}
|
|
1704
|
+
var api = {};
|
|
1705
|
+
var hasRequiredApi;
|
|
1706
|
+
function requireApi() {
|
|
1707
|
+
if (hasRequiredApi) return api;
|
|
1708
|
+
hasRequiredApi = 1;
|
|
1709
|
+
(function(exports$1) {
|
|
1710
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
1711
|
+
exports$1.ProcessedEventName = exports$1.ContractType = exports$1.ChainType = void 0;
|
|
1712
|
+
var enums_1 = requireEnums();
|
|
1713
|
+
Object.defineProperty(exports$1, "ChainType", { enumerable: true, get: function() {
|
|
1714
|
+
return enums_1.ChainType;
|
|
1715
|
+
} });
|
|
1716
|
+
var ContractType;
|
|
1717
|
+
(function(ContractType2) {
|
|
1718
|
+
ContractType2["Mailer"] = "Mailer";
|
|
1719
|
+
ContractType2["MailService"] = "MailService";
|
|
1720
|
+
})(ContractType || (exports$1.ContractType = ContractType = {}));
|
|
1721
|
+
var ProcessedEventName;
|
|
1722
|
+
(function(ProcessedEventName2) {
|
|
1723
|
+
ProcessedEventName2["MailSent"] = "MailSent";
|
|
1724
|
+
ProcessedEventName2["PreparedMailSent"] = "PreparedMailSent";
|
|
1725
|
+
ProcessedEventName2["DelegationSet"] = "DelegationSet";
|
|
1726
|
+
ProcessedEventName2["DelegationCleared"] = "DelegationCleared";
|
|
1727
|
+
ProcessedEventName2["DomainRegistered"] = "DomainRegistered";
|
|
1728
|
+
ProcessedEventName2["DomainExtended"] = "DomainExtended";
|
|
1729
|
+
ProcessedEventName2["DomainReleased"] = "DomainReleased";
|
|
1730
|
+
ProcessedEventName2["FeeUpdated"] = "FeeUpdated";
|
|
1731
|
+
ProcessedEventName2["SharesRecorded"] = "SharesRecorded";
|
|
1732
|
+
ProcessedEventName2["RecipientClaimed"] = "RecipientClaimed";
|
|
1733
|
+
ProcessedEventName2["OwnerClaimed"] = "OwnerClaimed";
|
|
1734
|
+
ProcessedEventName2["ExpiredSharesClaimed"] = "ExpiredSharesClaimed";
|
|
1735
|
+
})(ProcessedEventName || (exports$1.ProcessedEventName = ProcessedEventName = {}));
|
|
1736
|
+
})(api);
|
|
1737
|
+
return api;
|
|
1738
|
+
}
|
|
1739
|
+
var network = {};
|
|
1740
|
+
var hasRequiredNetwork;
|
|
1741
|
+
function requireNetwork() {
|
|
1742
|
+
if (hasRequiredNetwork) return network;
|
|
1743
|
+
hasRequiredNetwork = 1;
|
|
1744
|
+
Object.defineProperty(network, "__esModule", { value: true });
|
|
1745
|
+
network.NetworkError = void 0;
|
|
1746
|
+
class NetworkError extends Error {
|
|
1747
|
+
constructor(message, status, statusText, response) {
|
|
1748
|
+
super(message);
|
|
1749
|
+
this.name = "NetworkError";
|
|
1750
|
+
this.status = status;
|
|
1751
|
+
this.statusText = statusText;
|
|
1752
|
+
this.response = response;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
network.NetworkError = NetworkError;
|
|
1756
|
+
return network;
|
|
1757
|
+
}
|
|
1758
|
+
var wallet = {};
|
|
1759
|
+
var hasRequiredWallet;
|
|
1760
|
+
function requireWallet() {
|
|
1761
|
+
if (hasRequiredWallet) return wallet;
|
|
1762
|
+
hasRequiredWallet = 1;
|
|
1763
|
+
Object.defineProperty(wallet, "__esModule", { value: true });
|
|
1764
|
+
wallet.WalletType = void 0;
|
|
1765
|
+
var WalletType;
|
|
1766
|
+
(function(WalletType2) {
|
|
1767
|
+
WalletType2["METAMASK"] = "metamask";
|
|
1768
|
+
WalletType2["PHANTOM"] = "phantom";
|
|
1769
|
+
WalletType2["COINBASE"] = "coinbase";
|
|
1770
|
+
WalletType2["WALLETCONNECT"] = "walletconnect";
|
|
1771
|
+
WalletType2["INJECTED"] = "injected";
|
|
1772
|
+
})(WalletType || (wallet.WalletType = WalletType = {}));
|
|
1773
|
+
return wallet;
|
|
1774
|
+
}
|
|
1775
|
+
var rateLimits = {};
|
|
1776
|
+
var hasRequiredRateLimits;
|
|
1777
|
+
function requireRateLimits() {
|
|
1778
|
+
if (hasRequiredRateLimits) return rateLimits;
|
|
1779
|
+
hasRequiredRateLimits = 1;
|
|
1780
|
+
Object.defineProperty(rateLimits, "__esModule", { value: true });
|
|
1781
|
+
rateLimits.RateLimitPeriodType = void 0;
|
|
1782
|
+
var RateLimitPeriodType;
|
|
1783
|
+
(function(RateLimitPeriodType2) {
|
|
1784
|
+
RateLimitPeriodType2["HOUR"] = "hour";
|
|
1785
|
+
RateLimitPeriodType2["DAY"] = "day";
|
|
1786
|
+
RateLimitPeriodType2["MONTH"] = "month";
|
|
1787
|
+
})(RateLimitPeriodType || (rateLimits.RateLimitPeriodType = RateLimitPeriodType = {}));
|
|
1788
|
+
return rateLimits;
|
|
1789
|
+
}
|
|
1790
|
+
var period = {};
|
|
1791
|
+
var hasRequiredPeriod;
|
|
1792
|
+
function requirePeriod() {
|
|
1793
|
+
if (hasRequiredPeriod) return period;
|
|
1794
|
+
hasRequiredPeriod = 1;
|
|
1795
|
+
Object.defineProperty(period, "__esModule", { value: true });
|
|
1796
|
+
period.ALL_PERIODS = period.PERIOD_RANKS = void 0;
|
|
1797
|
+
period.PERIOD_RANKS = {
|
|
1798
|
+
weekly: 1,
|
|
1799
|
+
monthly: 2,
|
|
1800
|
+
quarterly: 3,
|
|
1801
|
+
yearly: 4,
|
|
1802
|
+
lifetime: 5
|
|
1803
|
+
};
|
|
1804
|
+
period.ALL_PERIODS = [
|
|
1805
|
+
"weekly",
|
|
1806
|
+
"monthly",
|
|
1807
|
+
"quarterly",
|
|
1808
|
+
"yearly",
|
|
1809
|
+
"lifetime"
|
|
1810
|
+
];
|
|
1811
|
+
return period;
|
|
1812
|
+
}
|
|
1813
|
+
var entitlements = {};
|
|
1814
|
+
var hasRequiredEntitlements;
|
|
1815
|
+
function requireEntitlements() {
|
|
1816
|
+
if (hasRequiredEntitlements) return entitlements;
|
|
1817
|
+
hasRequiredEntitlements = 1;
|
|
1818
|
+
Object.defineProperty(entitlements, "__esModule", { value: true });
|
|
1819
|
+
entitlements.NONE_ENTITLEMENT = void 0;
|
|
1820
|
+
entitlements.NONE_ENTITLEMENT = "none";
|
|
1821
|
+
return entitlements;
|
|
1822
|
+
}
|
|
1823
|
+
var entity = {};
|
|
1824
|
+
var hasRequiredEntity;
|
|
1825
|
+
function requireEntity() {
|
|
1826
|
+
if (hasRequiredEntity) return entity;
|
|
1827
|
+
hasRequiredEntity = 1;
|
|
1828
|
+
Object.defineProperty(entity, "__esModule", { value: true });
|
|
1829
|
+
entity.InvitationStatus = entity.EntityRole = entity.EntityType = void 0;
|
|
1830
|
+
var EntityType;
|
|
1831
|
+
(function(EntityType2) {
|
|
1832
|
+
EntityType2["PERSONAL"] = "personal";
|
|
1833
|
+
EntityType2["ORGANIZATION"] = "organization";
|
|
1834
|
+
})(EntityType || (entity.EntityType = EntityType = {}));
|
|
1835
|
+
var EntityRole;
|
|
1836
|
+
(function(EntityRole2) {
|
|
1837
|
+
EntityRole2["OWNER"] = "owner";
|
|
1838
|
+
EntityRole2["MANAGER"] = "manager";
|
|
1839
|
+
EntityRole2["MEMBER"] = "member";
|
|
1840
|
+
})(EntityRole || (entity.EntityRole = EntityRole = {}));
|
|
1841
|
+
var InvitationStatus;
|
|
1842
|
+
(function(InvitationStatus2) {
|
|
1843
|
+
InvitationStatus2["PENDING"] = "pending";
|
|
1844
|
+
InvitationStatus2["ACCEPTED"] = "accepted";
|
|
1845
|
+
InvitationStatus2["DECLINED"] = "declined";
|
|
1846
|
+
InvitationStatus2["EXPIRED"] = "expired";
|
|
1847
|
+
})(InvitationStatus || (entity.InvitationStatus = InvitationStatus = {}));
|
|
1848
|
+
return entity;
|
|
1849
|
+
}
|
|
1850
|
+
var permissions = {};
|
|
1851
|
+
var hasRequiredPermissions;
|
|
1852
|
+
function requirePermissions() {
|
|
1853
|
+
if (hasRequiredPermissions) return permissions;
|
|
1854
|
+
hasRequiredPermissions = 1;
|
|
1855
|
+
(function(exports$1) {
|
|
1856
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
1857
|
+
exports$1.ROLE_PERMISSIONS = exports$1.MEMBER_PERMISSIONS = exports$1.MANAGER_PERMISSIONS = exports$1.OWNER_PERMISSIONS = void 0;
|
|
1858
|
+
exports$1.getPermissionsForRole = getPermissionsForRole;
|
|
1859
|
+
exports$1.hasPermission = hasPermission;
|
|
1860
|
+
const entity_1 = requireEntity();
|
|
1861
|
+
exports$1.OWNER_PERMISSIONS = {
|
|
1862
|
+
canViewEntity: true,
|
|
1863
|
+
canEditEntity: true,
|
|
1864
|
+
canDeleteEntity: true,
|
|
1865
|
+
canManageMembers: true,
|
|
1866
|
+
canInviteMembers: true,
|
|
1867
|
+
canManageProjects: true,
|
|
1868
|
+
canCreateProjects: true,
|
|
1869
|
+
canViewProjects: true,
|
|
1870
|
+
canManageApiKeys: true,
|
|
1871
|
+
canViewApiKeys: true
|
|
1872
|
+
};
|
|
1873
|
+
exports$1.MANAGER_PERMISSIONS = {
|
|
1874
|
+
canViewEntity: true,
|
|
1875
|
+
canEditEntity: true,
|
|
1876
|
+
canDeleteEntity: false,
|
|
1877
|
+
canManageMembers: false,
|
|
1878
|
+
canInviteMembers: false,
|
|
1879
|
+
canManageProjects: true,
|
|
1880
|
+
canCreateProjects: true,
|
|
1881
|
+
canViewProjects: true,
|
|
1882
|
+
canManageApiKeys: true,
|
|
1883
|
+
canViewApiKeys: true
|
|
1884
|
+
};
|
|
1885
|
+
exports$1.MEMBER_PERMISSIONS = {
|
|
1886
|
+
canViewEntity: true,
|
|
1887
|
+
canEditEntity: false,
|
|
1888
|
+
canDeleteEntity: false,
|
|
1889
|
+
canManageMembers: false,
|
|
1890
|
+
canInviteMembers: false,
|
|
1891
|
+
canManageProjects: false,
|
|
1892
|
+
canCreateProjects: false,
|
|
1893
|
+
canViewProjects: true,
|
|
1894
|
+
canManageApiKeys: false,
|
|
1895
|
+
canViewApiKeys: true
|
|
1896
|
+
};
|
|
1897
|
+
exports$1.ROLE_PERMISSIONS = {
|
|
1898
|
+
[entity_1.EntityRole.OWNER]: exports$1.OWNER_PERMISSIONS,
|
|
1899
|
+
[entity_1.EntityRole.MANAGER]: exports$1.MANAGER_PERMISSIONS,
|
|
1900
|
+
[entity_1.EntityRole.MEMBER]: exports$1.MEMBER_PERMISSIONS
|
|
1901
|
+
};
|
|
1902
|
+
function getPermissionsForRole(role) {
|
|
1903
|
+
return exports$1.ROLE_PERMISSIONS[role];
|
|
1904
|
+
}
|
|
1905
|
+
function hasPermission(role, permission) {
|
|
1906
|
+
return exports$1.ROLE_PERMISSIONS[role][permission];
|
|
1907
|
+
}
|
|
1908
|
+
})(permissions);
|
|
1909
|
+
return permissions;
|
|
1910
|
+
}
|
|
1911
|
+
var web3UsernameValidator = {};
|
|
1912
|
+
var hasRequiredWeb3UsernameValidator;
|
|
1913
|
+
function requireWeb3UsernameValidator() {
|
|
1914
|
+
if (hasRequiredWeb3UsernameValidator) return web3UsernameValidator;
|
|
1915
|
+
hasRequiredWeb3UsernameValidator = 1;
|
|
1916
|
+
Object.defineProperty(web3UsernameValidator, "__esModule", { value: true });
|
|
1917
|
+
web3UsernameValidator.Web3UsernameValidator = void 0;
|
|
1918
|
+
const enums_1 = requireEnums();
|
|
1919
|
+
class Web3UsernameValidator {
|
|
1920
|
+
/**
|
|
1921
|
+
* Comprehensive address validation for API endpoint
|
|
1922
|
+
* Returns AddressValidationResult for valid addresses, undefined for invalid ones
|
|
1923
|
+
*/
|
|
1924
|
+
static validate(address2) {
|
|
1925
|
+
if (!address2) {
|
|
1926
|
+
return void 0;
|
|
1927
|
+
}
|
|
1928
|
+
if (this.EVM_REGEX.test(address2)) {
|
|
1929
|
+
return {
|
|
1930
|
+
name: null,
|
|
1931
|
+
address: address2.toLowerCase(),
|
|
1932
|
+
chainType: enums_1.ChainType.EVM
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
if (!address2.startsWith("0x") && address2.length >= 32 && address2.length <= 44 && this.BASE58_REGEX.test(address2)) {
|
|
1936
|
+
return {
|
|
1937
|
+
name: null,
|
|
1938
|
+
address: address2,
|
|
1939
|
+
// Keep case for Solana
|
|
1940
|
+
chainType: enums_1.ChainType.SOLANA
|
|
1941
|
+
};
|
|
1942
|
+
}
|
|
1943
|
+
if ((address2.toLowerCase().endsWith(".eth") || address2.toLowerCase().endsWith(".box")) && address2.length >= 5 && // minimum: "a.eth" = 5 chars
|
|
1944
|
+
this.ENS_REGEX.test(address2)) {
|
|
1945
|
+
return {
|
|
1946
|
+
name: address2.toLowerCase(),
|
|
1947
|
+
address: null,
|
|
1948
|
+
chainType: enums_1.ChainType.EVM
|
|
1949
|
+
// ENS resolves to EVM addresses
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
if (address2.toLowerCase().includes(".")) {
|
|
1953
|
+
const parts = address2.toLowerCase().split(".");
|
|
1954
|
+
if (parts.length === 2) {
|
|
1955
|
+
const [name, tld] = parts;
|
|
1956
|
+
if (this.VALID_SNS_TLDS.includes(tld) && this.SNS_NAME_REGEX.test(name) && name.length >= 1) {
|
|
1957
|
+
return {
|
|
1958
|
+
name: address2.toLowerCase(),
|
|
1959
|
+
address: null,
|
|
1960
|
+
chainType: enums_1.ChainType.SOLANA
|
|
1961
|
+
// SNS resolves to Solana addresses
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
return void 0;
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Quick EVM address validation
|
|
1970
|
+
*/
|
|
1971
|
+
static isValidEVMAddress(address2) {
|
|
1972
|
+
return this.EVM_REGEX.test(address2);
|
|
1973
|
+
}
|
|
1974
|
+
/**
|
|
1975
|
+
* Quick Solana address validation
|
|
1976
|
+
*/
|
|
1977
|
+
static isValidSolanaAddress(address2) {
|
|
1978
|
+
return !address2.startsWith("0x") && address2.length >= 32 && address2.length <= 44 && this.BASE58_REGEX.test(address2);
|
|
1979
|
+
}
|
|
1980
|
+
/**
|
|
1981
|
+
* Quick ENS name validation
|
|
1982
|
+
*/
|
|
1983
|
+
static isValidENSName(address2) {
|
|
1984
|
+
return (address2.toLowerCase().endsWith(".eth") || address2.toLowerCase().endsWith(".box")) && address2.length >= 5 && this.ENS_REGEX.test(address2);
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* Quick SNS name validation
|
|
1988
|
+
*/
|
|
1989
|
+
static isValidSNSName(address2) {
|
|
1990
|
+
if (!address2.toLowerCase().includes("."))
|
|
1991
|
+
return false;
|
|
1992
|
+
const parts = address2.toLowerCase().split(".");
|
|
1993
|
+
if (parts.length !== 2)
|
|
1994
|
+
return false;
|
|
1995
|
+
const [name, tld] = parts;
|
|
1996
|
+
return this.VALID_SNS_TLDS.includes(tld) && this.SNS_NAME_REGEX.test(name) && name.length >= 1;
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
web3UsernameValidator.Web3UsernameValidator = Web3UsernameValidator;
|
|
2000
|
+
Web3UsernameValidator.EVM_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
2001
|
+
Web3UsernameValidator.BASE58_REGEX = /^[1-9A-HJ-NP-Za-km-z]+$/;
|
|
2002
|
+
Web3UsernameValidator.ENS_REGEX = /^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*\.(eth|box)$/i;
|
|
2003
|
+
Web3UsernameValidator.SNS_NAME_REGEX = /^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*$/;
|
|
2004
|
+
Web3UsernameValidator.VALID_SNS_TLDS = [
|
|
2005
|
+
"sol",
|
|
2006
|
+
"abc",
|
|
2007
|
+
"backpack",
|
|
2008
|
+
"bonk",
|
|
2009
|
+
"coin",
|
|
2010
|
+
"dao",
|
|
2011
|
+
"defi",
|
|
2012
|
+
"gm",
|
|
2013
|
+
"poor",
|
|
2014
|
+
"pump",
|
|
2015
|
+
"shdw",
|
|
2016
|
+
"stepn",
|
|
2017
|
+
"web3"
|
|
2018
|
+
];
|
|
2019
|
+
return web3UsernameValidator;
|
|
2020
|
+
}
|
|
2021
|
+
var typeValidation = {};
|
|
2022
|
+
var hasRequiredTypeValidation;
|
|
2023
|
+
function requireTypeValidation() {
|
|
2024
|
+
if (hasRequiredTypeValidation) return typeValidation;
|
|
2025
|
+
hasRequiredTypeValidation = 1;
|
|
2026
|
+
(function(exports$1) {
|
|
2027
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
2028
|
+
exports$1.parseJson = exports$1.createAssertion = exports$1.isUrl = exports$1.isEmail = exports$1.isValidDate = exports$1.isErrorResponse = exports$1.isSuccessResponse = exports$1.isApiResponse = exports$1.optional = exports$1.validateArray = exports$1.hasRequiredProperties = exports$1.isNullish = exports$1.isArray = exports$1.isObject = exports$1.isBoolean = exports$1.isNumber = exports$1.isString = exports$1.createValidator = void 0;
|
|
2029
|
+
const createValidator = (validationFn, typeName) => {
|
|
2030
|
+
return (data) => {
|
|
2031
|
+
try {
|
|
2032
|
+
if (validationFn(data)) {
|
|
2033
|
+
return { isValid: true, data };
|
|
2034
|
+
}
|
|
2035
|
+
return { isValid: false, error: `Invalid ${typeName}`, data: null };
|
|
2036
|
+
} catch (error) {
|
|
2037
|
+
return {
|
|
2038
|
+
isValid: false,
|
|
2039
|
+
error: `Validation error for ${typeName}: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
2040
|
+
data: null
|
|
2041
|
+
};
|
|
2042
|
+
}
|
|
2043
|
+
};
|
|
2044
|
+
};
|
|
2045
|
+
exports$1.createValidator = createValidator;
|
|
2046
|
+
const isString = (value) => typeof value === "string";
|
|
2047
|
+
exports$1.isString = isString;
|
|
2048
|
+
const isNumber = (value) => typeof value === "number" && !isNaN(value);
|
|
2049
|
+
exports$1.isNumber = isNumber;
|
|
2050
|
+
const isBoolean = (value) => typeof value === "boolean";
|
|
2051
|
+
exports$1.isBoolean = isBoolean;
|
|
2052
|
+
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2053
|
+
exports$1.isObject = isObject;
|
|
2054
|
+
const isArray = (value) => Array.isArray(value);
|
|
2055
|
+
exports$1.isArray = isArray;
|
|
2056
|
+
const isNullish = (value) => value === null || value === void 0;
|
|
2057
|
+
exports$1.isNullish = isNullish;
|
|
2058
|
+
const hasRequiredProperties = (obj, requiredProps) => {
|
|
2059
|
+
if (!(0, exports$1.isObject)(obj))
|
|
2060
|
+
return false;
|
|
2061
|
+
return requiredProps.every((prop) => prop in obj);
|
|
2062
|
+
};
|
|
2063
|
+
exports$1.hasRequiredProperties = hasRequiredProperties;
|
|
2064
|
+
const validateArray = (data, itemValidator) => {
|
|
2065
|
+
if (!(0, exports$1.isArray)(data))
|
|
2066
|
+
return false;
|
|
2067
|
+
return data.every(itemValidator);
|
|
2068
|
+
};
|
|
2069
|
+
exports$1.validateArray = validateArray;
|
|
2070
|
+
const optional = (validator) => (value) => {
|
|
2071
|
+
return value === void 0 || validator(value);
|
|
2072
|
+
};
|
|
2073
|
+
exports$1.optional = optional;
|
|
2074
|
+
const isApiResponse = (data) => {
|
|
2075
|
+
return (0, exports$1.isObject)(data) && (0, exports$1.isBoolean)(data.success);
|
|
2076
|
+
};
|
|
2077
|
+
exports$1.isApiResponse = isApiResponse;
|
|
2078
|
+
const isSuccessResponse = (data, dataValidator) => {
|
|
2079
|
+
if (!(0, exports$1.isApiResponse)(data) || !data.success)
|
|
2080
|
+
return false;
|
|
2081
|
+
if (dataValidator && "data" in data) {
|
|
2082
|
+
return dataValidator(data.data);
|
|
2083
|
+
}
|
|
2084
|
+
return true;
|
|
2085
|
+
};
|
|
2086
|
+
exports$1.isSuccessResponse = isSuccessResponse;
|
|
2087
|
+
const isErrorResponse = (data) => {
|
|
2088
|
+
return (0, exports$1.isApiResponse)(data) && !data.success && "error" in data && (0, exports$1.isString)(data.error);
|
|
2089
|
+
};
|
|
2090
|
+
exports$1.isErrorResponse = isErrorResponse;
|
|
2091
|
+
const isValidDate = (value) => {
|
|
2092
|
+
if (!(0, exports$1.isString)(value))
|
|
2093
|
+
return false;
|
|
2094
|
+
const date2 = new Date(value);
|
|
2095
|
+
return !isNaN(date2.getTime());
|
|
2096
|
+
};
|
|
2097
|
+
exports$1.isValidDate = isValidDate;
|
|
2098
|
+
const isEmail = (value) => {
|
|
2099
|
+
if (!(0, exports$1.isString)(value))
|
|
2100
|
+
return false;
|
|
2101
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
2102
|
+
return emailRegex.test(value);
|
|
2103
|
+
};
|
|
2104
|
+
exports$1.isEmail = isEmail;
|
|
2105
|
+
const isUrl = (value) => {
|
|
2106
|
+
if (!(0, exports$1.isString)(value))
|
|
2107
|
+
return false;
|
|
2108
|
+
try {
|
|
2109
|
+
new URL(value);
|
|
2110
|
+
return true;
|
|
2111
|
+
} catch {
|
|
2112
|
+
return false;
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
exports$1.isUrl = isUrl;
|
|
2116
|
+
const createAssertion = (validator, typeName) => {
|
|
2117
|
+
return (data, context = typeName) => {
|
|
2118
|
+
if (!validator(data)) {
|
|
2119
|
+
throw new TypeError(`Invalid ${context}: expected ${typeName}`);
|
|
2120
|
+
}
|
|
2121
|
+
};
|
|
2122
|
+
};
|
|
2123
|
+
exports$1.createAssertion = createAssertion;
|
|
2124
|
+
const parseJson = (jsonString, validator) => {
|
|
2125
|
+
try {
|
|
2126
|
+
const parsed = JSON.parse(jsonString);
|
|
2127
|
+
if (validator) {
|
|
2128
|
+
if (validator(parsed)) {
|
|
2129
|
+
return { isValid: true, data: parsed };
|
|
2130
|
+
}
|
|
2131
|
+
return {
|
|
2132
|
+
isValid: false,
|
|
2133
|
+
error: "Parsed JSON does not match expected type",
|
|
2134
|
+
data: null
|
|
2135
|
+
};
|
|
2136
|
+
}
|
|
2137
|
+
return { isValid: true, data: parsed };
|
|
2138
|
+
} catch (error) {
|
|
2139
|
+
return {
|
|
2140
|
+
isValid: false,
|
|
2141
|
+
error: `JSON parse error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
2142
|
+
data: null
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2146
|
+
exports$1.parseJson = parseJson;
|
|
2147
|
+
})(typeValidation);
|
|
2148
|
+
return typeValidation;
|
|
2149
|
+
}
|
|
2150
|
+
var eventHelpers = {};
|
|
2151
|
+
var hasRequiredEventHelpers;
|
|
2152
|
+
function requireEventHelpers() {
|
|
2153
|
+
if (hasRequiredEventHelpers) return eventHelpers;
|
|
2154
|
+
hasRequiredEventHelpers = 1;
|
|
2155
|
+
Object.defineProperty(eventHelpers, "__esModule", { value: true });
|
|
2156
|
+
eventHelpers.createMultiChainId = createMultiChainId;
|
|
2157
|
+
eventHelpers.createUserMultiChainId = createUserMultiChainId;
|
|
2158
|
+
eventHelpers.createChainStatsId = createChainStatsId;
|
|
2159
|
+
eventHelpers.createDelegationId = createDelegationId;
|
|
2160
|
+
eventHelpers.normalizeAddress = normalizeAddress;
|
|
2161
|
+
eventHelpers.formatBigInt = formatBigInt;
|
|
2162
|
+
eventHelpers.isZeroAddress = isZeroAddress;
|
|
2163
|
+
eventHelpers.isTestNet = isTestNet;
|
|
2164
|
+
eventHelpers.validateEventArgs = validateEventArgs;
|
|
2165
|
+
function createMultiChainId(chainId, txHash, logIndex) {
|
|
2166
|
+
return `${chainId}-${txHash}-${logIndex}`;
|
|
2167
|
+
}
|
|
2168
|
+
function createUserMultiChainId(chainId, address2) {
|
|
2169
|
+
return `${chainId}-${address2.toLowerCase()}`;
|
|
2170
|
+
}
|
|
2171
|
+
function createChainStatsId(chainId) {
|
|
2172
|
+
return `${chainId}-global`;
|
|
2173
|
+
}
|
|
2174
|
+
function createDelegationId(delegatorAddress, isTestNet2) {
|
|
2175
|
+
return `${delegatorAddress.toLowerCase()}-${isTestNet2}`;
|
|
2176
|
+
}
|
|
2177
|
+
function normalizeAddress(address2) {
|
|
2178
|
+
return address2.toLowerCase();
|
|
2179
|
+
}
|
|
2180
|
+
function formatBigInt(value, decimals = 18) {
|
|
2181
|
+
const divisor = BigInt(10 ** decimals);
|
|
2182
|
+
const whole = value / divisor;
|
|
2183
|
+
const fraction = value % divisor;
|
|
2184
|
+
if (fraction === 0n) {
|
|
2185
|
+
return whole.toString();
|
|
2186
|
+
}
|
|
2187
|
+
return `${whole}.${fraction.toString().padStart(decimals, "0").replace(/0+$/, "")}`;
|
|
2188
|
+
}
|
|
2189
|
+
function isZeroAddress(address2) {
|
|
2190
|
+
return address2.toLowerCase() === "0x0000000000000000000000000000000000000000";
|
|
2191
|
+
}
|
|
2192
|
+
function isTestNet(chainId) {
|
|
2193
|
+
const evmTestnets = /* @__PURE__ */ new Set([
|
|
2194
|
+
31337,
|
|
2195
|
+
// Hardhat (local development)
|
|
2196
|
+
11155111,
|
|
2197
|
+
// Ethereum Sepolia
|
|
2198
|
+
80001,
|
|
2199
|
+
// Polygon Mumbai (if configured)
|
|
2200
|
+
80002,
|
|
2201
|
+
// Polygon Amoy (if configured)
|
|
2202
|
+
421614,
|
|
2203
|
+
// Arbitrum Sepolia (if configured)
|
|
2204
|
+
11155420,
|
|
2205
|
+
// OP Sepolia (if configured)
|
|
2206
|
+
84532,
|
|
2207
|
+
// Base Sepolia (if configured)
|
|
2208
|
+
43113
|
|
2209
|
+
// Avalanche Fuji (if configured)
|
|
2210
|
+
]);
|
|
2211
|
+
const solanaTestnets = /* @__PURE__ */ new Set([
|
|
2212
|
+
-102,
|
|
2213
|
+
// Solana Devnet
|
|
2214
|
+
-103,
|
|
2215
|
+
// Solana Testnet
|
|
2216
|
+
-104
|
|
2217
|
+
// Solana Localnet
|
|
2218
|
+
]);
|
|
2219
|
+
return evmTestnets.has(chainId) || solanaTestnets.has(chainId);
|
|
2220
|
+
}
|
|
2221
|
+
function validateEventArgs(args, requiredFields) {
|
|
2222
|
+
for (const field of requiredFields) {
|
|
2223
|
+
if (args[field] === void 0 || args[field] === null) {
|
|
2224
|
+
console.error(`❌ Missing required field: ${String(field)}`);
|
|
2225
|
+
return false;
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
return true;
|
|
2229
|
+
}
|
|
2230
|
+
return eventHelpers;
|
|
2231
|
+
}
|
|
2232
|
+
var auth = {};
|
|
2233
|
+
var hasRequiredAuth;
|
|
2234
|
+
function requireAuth() {
|
|
2235
|
+
if (hasRequiredAuth) return auth;
|
|
2236
|
+
hasRequiredAuth = 1;
|
|
2237
|
+
Object.defineProperty(auth, "__esModule", { value: true });
|
|
2238
|
+
auth.generateAuthMessage = generateAuthMessage;
|
|
2239
|
+
auth.isAuthExpired = isAuthExpired;
|
|
2240
|
+
auth.getAuthStatusText = getAuthStatusText;
|
|
2241
|
+
auth.canAccessProtectedFeatures = canAccessProtectedFeatures;
|
|
2242
|
+
auth.isAuthStatusConnected = isAuthStatusConnected;
|
|
2243
|
+
auth.generateNonce = generateNonce;
|
|
2244
|
+
auth.extractNonceFromMessage = extractNonceFromMessage;
|
|
2245
|
+
auth.isValidNonce = isValidNonce;
|
|
2246
|
+
const enums_1 = requireEnums();
|
|
2247
|
+
function generateAuthMessage(emailDomain, nonce) {
|
|
2248
|
+
const actualNonce = nonce || `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2249
|
+
return `Authenticate with ${emailDomain}
|
|
2250
|
+
Nonce: ${actualNonce}`;
|
|
2251
|
+
}
|
|
2252
|
+
function isAuthExpired(createdAt, expirationHours = 24) {
|
|
2253
|
+
const expirationTime = new Date(createdAt.getTime() + expirationHours * 60 * 60 * 1e3);
|
|
2254
|
+
return /* @__PURE__ */ new Date() > expirationTime;
|
|
2255
|
+
}
|
|
2256
|
+
function getAuthStatusText(status) {
|
|
2257
|
+
switch (status) {
|
|
2258
|
+
case enums_1.AuthStatus.DISCONNECTED:
|
|
2259
|
+
return "Not connected";
|
|
2260
|
+
case enums_1.AuthStatus.CONNECTED:
|
|
2261
|
+
return "Connected - Please verify";
|
|
2262
|
+
case enums_1.AuthStatus.VERIFIED:
|
|
2263
|
+
return "Authenticated";
|
|
2264
|
+
default:
|
|
2265
|
+
return "Unknown status";
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
function canAccessProtectedFeatures(status) {
|
|
2269
|
+
return status === enums_1.AuthStatus.VERIFIED;
|
|
2270
|
+
}
|
|
2271
|
+
function isAuthStatusConnected(status) {
|
|
2272
|
+
return status === enums_1.AuthStatus.CONNECTED || status === enums_1.AuthStatus.VERIFIED;
|
|
2273
|
+
}
|
|
2274
|
+
function generateNonce() {
|
|
2275
|
+
return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2276
|
+
}
|
|
2277
|
+
function extractNonceFromMessage(message) {
|
|
2278
|
+
const match = message.match(/Nonce:\s*(.+)$/m);
|
|
2279
|
+
return match ? match[1].trim() : void 0;
|
|
2280
|
+
}
|
|
2281
|
+
function isValidNonce(nonce) {
|
|
2282
|
+
if (!nonce || typeof nonce !== "string") {
|
|
2283
|
+
return false;
|
|
2284
|
+
}
|
|
2285
|
+
if (nonce.length < 10) {
|
|
2286
|
+
return false;
|
|
2287
|
+
}
|
|
2288
|
+
const parts = nonce.split("-");
|
|
2289
|
+
if (parts.length >= 2) {
|
|
2290
|
+
const timestamp = parseInt(parts[0], 10);
|
|
2291
|
+
if (!isNaN(timestamp)) {
|
|
2292
|
+
const oneDayAgo = Date.now() - 24 * 60 * 60 * 1e3;
|
|
2293
|
+
if (timestamp < oneDayAgo) {
|
|
2294
|
+
return false;
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
return true;
|
|
2299
|
+
}
|
|
2300
|
+
return auth;
|
|
2301
|
+
}
|
|
2302
|
+
var adminEmails = {};
|
|
2303
|
+
var hasRequiredAdminEmails;
|
|
2304
|
+
function requireAdminEmails() {
|
|
2305
|
+
if (hasRequiredAdminEmails) return adminEmails;
|
|
2306
|
+
hasRequiredAdminEmails = 1;
|
|
2307
|
+
Object.defineProperty(adminEmails, "__esModule", { value: true });
|
|
2308
|
+
adminEmails.parseAdminEmails = parseAdminEmails;
|
|
2309
|
+
adminEmails.isAdminEmail = isAdminEmail;
|
|
2310
|
+
adminEmails.createAdminChecker = createAdminChecker;
|
|
2311
|
+
function parseAdminEmails(input) {
|
|
2312
|
+
if (!input) {
|
|
2313
|
+
return [];
|
|
2314
|
+
}
|
|
2315
|
+
return input.split(",").map((email) => email.trim().toLowerCase()).filter((email) => email.length > 0 && email.includes("@"));
|
|
2316
|
+
}
|
|
2317
|
+
function isAdminEmail(email, adminEmails2) {
|
|
2318
|
+
if (!email) {
|
|
2319
|
+
return false;
|
|
2320
|
+
}
|
|
2321
|
+
return adminEmails2.includes(email.toLowerCase());
|
|
2322
|
+
}
|
|
2323
|
+
function createAdminChecker(input) {
|
|
2324
|
+
const adminEmails2 = parseAdminEmails(input);
|
|
2325
|
+
return (email) => {
|
|
2326
|
+
return isAdminEmail(email, adminEmails2);
|
|
2327
|
+
};
|
|
2328
|
+
}
|
|
2329
|
+
return adminEmails;
|
|
2330
|
+
}
|
|
2331
|
+
var currency = {};
|
|
2332
|
+
var hasRequiredCurrency;
|
|
2333
|
+
function requireCurrency() {
|
|
2334
|
+
if (hasRequiredCurrency) return currency;
|
|
2335
|
+
hasRequiredCurrency = 1;
|
|
2336
|
+
(function(exports$1) {
|
|
2337
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
2338
|
+
exports$1.CLAIM_PERIOD_DAYS = exports$1.USDC_DECIMALS = void 0;
|
|
2339
|
+
exports$1.formatUSDC = formatUSDC;
|
|
2340
|
+
exports$1.parseUSDC = parseUSDC;
|
|
2341
|
+
exports$1.USDC_DECIMALS = 6;
|
|
2342
|
+
exports$1.CLAIM_PERIOD_DAYS = 60;
|
|
2343
|
+
function formatUSDC(amount) {
|
|
2344
|
+
return (amount / Math.pow(10, exports$1.USDC_DECIMALS)).toFixed(2);
|
|
2345
|
+
}
|
|
2346
|
+
function parseUSDC(amount) {
|
|
2347
|
+
return Math.floor(parseFloat(amount) * Math.pow(10, exports$1.USDC_DECIMALS));
|
|
2348
|
+
}
|
|
2349
|
+
})(currency);
|
|
2350
|
+
return currency;
|
|
2351
|
+
}
|
|
2352
|
+
var date = {};
|
|
2353
|
+
var hasRequiredDate;
|
|
2354
|
+
function requireDate() {
|
|
2355
|
+
if (hasRequiredDate) return date;
|
|
2356
|
+
hasRequiredDate = 1;
|
|
2357
|
+
Object.defineProperty(date, "__esModule", { value: true });
|
|
2358
|
+
date.formatEmailDate = formatEmailDate;
|
|
2359
|
+
date.formatTimestamp = formatTimestamp;
|
|
2360
|
+
date.formatRelativeTime = formatRelativeTime;
|
|
2361
|
+
date.parseDate = parseDate;
|
|
2362
|
+
date.isDateInRange = isDateInRange;
|
|
2363
|
+
date.addDays = addDays;
|
|
2364
|
+
date.addHours = addHours;
|
|
2365
|
+
function formatEmailDate(date2) {
|
|
2366
|
+
const dateObj = typeof date2 === "string" ? new Date(date2) : date2;
|
|
2367
|
+
if (isNaN(dateObj.getTime())) {
|
|
2368
|
+
return "Invalid date";
|
|
2369
|
+
}
|
|
2370
|
+
const now = /* @__PURE__ */ new Date();
|
|
2371
|
+
const diffMs = now.getTime() - dateObj.getTime();
|
|
2372
|
+
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
2373
|
+
if (diffDays === 0) {
|
|
2374
|
+
return dateObj.toLocaleTimeString("en-US", {
|
|
2375
|
+
hour: "numeric",
|
|
2376
|
+
minute: "2-digit",
|
|
2377
|
+
hour12: true
|
|
2378
|
+
});
|
|
2379
|
+
}
|
|
2380
|
+
if (diffDays === 1) {
|
|
2381
|
+
return "Yesterday";
|
|
2382
|
+
}
|
|
2383
|
+
if (diffDays < 7) {
|
|
2384
|
+
return dateObj.toLocaleDateString("en-US", {
|
|
2385
|
+
weekday: "long"
|
|
2386
|
+
});
|
|
2387
|
+
}
|
|
2388
|
+
if (dateObj.getFullYear() === now.getFullYear()) {
|
|
2389
|
+
return dateObj.toLocaleDateString("en-US", {
|
|
2390
|
+
month: "short",
|
|
2391
|
+
day: "numeric"
|
|
2392
|
+
});
|
|
2393
|
+
}
|
|
2394
|
+
return dateObj.toLocaleDateString("en-US", {
|
|
2395
|
+
year: "numeric",
|
|
2396
|
+
month: "short",
|
|
2397
|
+
day: "numeric"
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
function formatTimestamp(timestamp) {
|
|
2401
|
+
return new Date(timestamp).toISOString();
|
|
2402
|
+
}
|
|
2403
|
+
function formatRelativeTime(date2) {
|
|
2404
|
+
const dateObj = typeof date2 === "string" || typeof date2 === "number" ? new Date(date2) : date2;
|
|
2405
|
+
if (isNaN(dateObj.getTime())) {
|
|
2406
|
+
return "Invalid date";
|
|
2407
|
+
}
|
|
2408
|
+
const now = /* @__PURE__ */ new Date();
|
|
2409
|
+
const diffMs = now.getTime() - dateObj.getTime();
|
|
2410
|
+
const diffSeconds = Math.floor(diffMs / 1e3);
|
|
2411
|
+
const diffMinutes = Math.floor(diffSeconds / 60);
|
|
2412
|
+
const diffHours = Math.floor(diffMinutes / 60);
|
|
2413
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
2414
|
+
const diffWeeks = Math.floor(diffDays / 7);
|
|
2415
|
+
const diffMonths = Math.floor(diffDays / 30);
|
|
2416
|
+
const diffYears = Math.floor(diffDays / 365);
|
|
2417
|
+
if (diffSeconds < 60) {
|
|
2418
|
+
return "just now";
|
|
2419
|
+
}
|
|
2420
|
+
if (diffMinutes < 60) {
|
|
2421
|
+
return diffMinutes === 1 ? "1 minute ago" : `${diffMinutes} minutes ago`;
|
|
2422
|
+
}
|
|
2423
|
+
if (diffHours < 24) {
|
|
2424
|
+
return diffHours === 1 ? "1 hour ago" : `${diffHours} hours ago`;
|
|
2425
|
+
}
|
|
2426
|
+
if (diffDays < 7) {
|
|
2427
|
+
return diffDays === 1 ? "1 day ago" : `${diffDays} days ago`;
|
|
2428
|
+
}
|
|
2429
|
+
if (diffWeeks < 4) {
|
|
2430
|
+
return diffWeeks === 1 ? "1 week ago" : `${diffWeeks} weeks ago`;
|
|
2431
|
+
}
|
|
2432
|
+
if (diffMonths < 12) {
|
|
2433
|
+
return diffMonths === 1 ? "1 month ago" : `${diffMonths} months ago`;
|
|
2434
|
+
}
|
|
2435
|
+
return diffYears === 1 ? "1 year ago" : `${diffYears} years ago`;
|
|
2436
|
+
}
|
|
2437
|
+
function parseDate(dateString) {
|
|
2438
|
+
try {
|
|
2439
|
+
const date2 = new Date(dateString);
|
|
2440
|
+
if (isNaN(date2.getTime())) {
|
|
2441
|
+
return null;
|
|
2442
|
+
}
|
|
2443
|
+
return date2;
|
|
2444
|
+
} catch {
|
|
2445
|
+
return null;
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
function isDateInRange(date2, startDate, endDate) {
|
|
2449
|
+
return date2 >= startDate && date2 <= endDate;
|
|
2450
|
+
}
|
|
2451
|
+
function addDays(date2, days) {
|
|
2452
|
+
const result = new Date(date2);
|
|
2453
|
+
result.setDate(result.getDate() + days);
|
|
2454
|
+
return result;
|
|
2455
|
+
}
|
|
2456
|
+
function addHours(date2, hours) {
|
|
2457
|
+
const result = new Date(date2);
|
|
2458
|
+
result.setHours(result.getHours() + hours);
|
|
2459
|
+
return result;
|
|
2460
|
+
}
|
|
2461
|
+
return date;
|
|
2462
|
+
}
|
|
2463
|
+
var string = {};
|
|
2464
|
+
var hasRequiredString;
|
|
2465
|
+
function requireString() {
|
|
2466
|
+
if (hasRequiredString) return string;
|
|
2467
|
+
hasRequiredString = 1;
|
|
2468
|
+
Object.defineProperty(string, "__esModule", { value: true });
|
|
2469
|
+
string.truncate = truncate;
|
|
2470
|
+
string.capitalize = capitalize;
|
|
2471
|
+
string.toTitleCase = toTitleCase;
|
|
2472
|
+
string.toKebabCase = toKebabCase;
|
|
2473
|
+
string.toCamelCase = toCamelCase;
|
|
2474
|
+
string.toSnakeCase = toSnakeCase;
|
|
2475
|
+
string.normalizeWhitespace = normalizeWhitespace;
|
|
2476
|
+
string.isBlank = isBlank;
|
|
2477
|
+
string.isNotBlank = isNotBlank;
|
|
2478
|
+
string.escapeHtml = escapeHtml;
|
|
2479
|
+
string.stripHtml = stripHtml;
|
|
2480
|
+
string.getInitials = getInitials;
|
|
2481
|
+
string.formatBytes = formatBytes;
|
|
2482
|
+
string.randomString = randomString;
|
|
2483
|
+
string.pluralize = pluralize;
|
|
2484
|
+
string.formatNumber = formatNumber;
|
|
2485
|
+
function truncate(str, maxLength, suffix = "...") {
|
|
2486
|
+
if (!str || str.length <= maxLength) {
|
|
2487
|
+
return str;
|
|
2488
|
+
}
|
|
2489
|
+
return str.slice(0, maxLength - suffix.length) + suffix;
|
|
2490
|
+
}
|
|
2491
|
+
function capitalize(str) {
|
|
2492
|
+
if (!str)
|
|
2493
|
+
return str;
|
|
2494
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
2495
|
+
}
|
|
2496
|
+
function toTitleCase(str) {
|
|
2497
|
+
if (!str)
|
|
2498
|
+
return str;
|
|
2499
|
+
return str.toLowerCase().split(" ").map((word) => capitalize(word)).join(" ");
|
|
2500
|
+
}
|
|
2501
|
+
function toKebabCase(str) {
|
|
2502
|
+
if (!str)
|
|
2503
|
+
return str;
|
|
2504
|
+
return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
2505
|
+
}
|
|
2506
|
+
function toCamelCase(str) {
|
|
2507
|
+
if (!str)
|
|
2508
|
+
return str;
|
|
2509
|
+
return str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "").replace(/^./, (char) => char.toLowerCase());
|
|
2510
|
+
}
|
|
2511
|
+
function toSnakeCase(str) {
|
|
2512
|
+
if (!str)
|
|
2513
|
+
return str;
|
|
2514
|
+
return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase();
|
|
2515
|
+
}
|
|
2516
|
+
function normalizeWhitespace(str) {
|
|
2517
|
+
if (!str)
|
|
2518
|
+
return str;
|
|
2519
|
+
return str.replace(/\s+/g, " ").trim();
|
|
2520
|
+
}
|
|
2521
|
+
function isBlank(str) {
|
|
2522
|
+
return !str || str.trim().length === 0;
|
|
2523
|
+
}
|
|
2524
|
+
function isNotBlank(str) {
|
|
2525
|
+
return !isBlank(str);
|
|
2526
|
+
}
|
|
2527
|
+
function escapeHtml(str) {
|
|
2528
|
+
if (!str)
|
|
2529
|
+
return str;
|
|
2530
|
+
const htmlEscapes = {
|
|
2531
|
+
"&": "&",
|
|
2532
|
+
"<": "<",
|
|
2533
|
+
">": ">",
|
|
2534
|
+
'"': """,
|
|
2535
|
+
"'": "'"
|
|
2536
|
+
};
|
|
2537
|
+
return str.replace(/[&<>"']/g, (char) => htmlEscapes[char]);
|
|
2538
|
+
}
|
|
2539
|
+
function stripHtml(str) {
|
|
2540
|
+
if (!str)
|
|
2541
|
+
return str;
|
|
2542
|
+
return str.replace(/<[^>]*>/g, "");
|
|
2543
|
+
}
|
|
2544
|
+
function getInitials(name, maxInitials = 2) {
|
|
2545
|
+
if (!name)
|
|
2546
|
+
return "";
|
|
2547
|
+
const words = name.trim().split(/\s+/);
|
|
2548
|
+
const initials = words.slice(0, maxInitials).map((word) => word.charAt(0).toUpperCase()).join("");
|
|
2549
|
+
return initials;
|
|
2550
|
+
}
|
|
2551
|
+
function formatBytes(bytes, decimals = 2) {
|
|
2552
|
+
if (bytes === 0)
|
|
2553
|
+
return "0 Bytes";
|
|
2554
|
+
const k = 1024;
|
|
2555
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
2556
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
|
|
2557
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2558
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
2559
|
+
}
|
|
2560
|
+
function randomString(length, charset = "alphanumeric") {
|
|
2561
|
+
let chars;
|
|
2562
|
+
switch (charset) {
|
|
2563
|
+
case "alpha":
|
|
2564
|
+
chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
2565
|
+
break;
|
|
2566
|
+
case "numeric":
|
|
2567
|
+
chars = "0123456789";
|
|
2568
|
+
break;
|
|
2569
|
+
case "alphanumeric":
|
|
2570
|
+
chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
2571
|
+
break;
|
|
2572
|
+
case "hex":
|
|
2573
|
+
chars = "0123456789abcdef";
|
|
2574
|
+
break;
|
|
2575
|
+
default:
|
|
2576
|
+
chars = charset;
|
|
2577
|
+
}
|
|
2578
|
+
let result = "";
|
|
2579
|
+
for (let i = 0; i < length; i++) {
|
|
2580
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
2581
|
+
}
|
|
2582
|
+
return result;
|
|
2583
|
+
}
|
|
2584
|
+
function pluralize(count, singular, plural) {
|
|
2585
|
+
if (count === 1) {
|
|
2586
|
+
return singular;
|
|
2587
|
+
}
|
|
2588
|
+
return plural || `${singular}s`;
|
|
2589
|
+
}
|
|
2590
|
+
function formatNumber(num) {
|
|
2591
|
+
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
2592
|
+
}
|
|
2593
|
+
return string;
|
|
2594
|
+
}
|
|
2595
|
+
var application = {};
|
|
2596
|
+
var hasRequiredApplication;
|
|
2597
|
+
function requireApplication() {
|
|
2598
|
+
if (hasRequiredApplication) return application;
|
|
2599
|
+
hasRequiredApplication = 1;
|
|
2600
|
+
Object.defineProperty(application, "__esModule", { value: true });
|
|
2601
|
+
application.Z_INDEX = application.ANIMATION = application.NETWORK_IDS = application.WALLET_NAMES = application.CONTACT_INFO = application.ROUTES = application.SUCCESS_MESSAGES = application.ERROR_MESSAGES = application.TIME_FORMAT = application.SUBSCRIPTION_TIERS = application.EMAIL_CONFIG = application.STORAGE_KEYS = application.CHAIN_TYPE = application.AUTH_STATUS = application.API_RETRY_DELAY = application.API_RETRY_ATTEMPTS = application.API_TIMEOUT = void 0;
|
|
2602
|
+
const API_TIMEOUT = 3e4;
|
|
2603
|
+
application.API_TIMEOUT = API_TIMEOUT;
|
|
2604
|
+
const API_RETRY_ATTEMPTS = 3;
|
|
2605
|
+
application.API_RETRY_ATTEMPTS = API_RETRY_ATTEMPTS;
|
|
2606
|
+
const API_RETRY_DELAY = 1e3;
|
|
2607
|
+
application.API_RETRY_DELAY = API_RETRY_DELAY;
|
|
2608
|
+
const AUTH_STATUS = {
|
|
2609
|
+
DISCONNECTED: "disconnected",
|
|
2610
|
+
CONNECTED: "connected",
|
|
2611
|
+
VERIFIED: "verified"
|
|
2612
|
+
};
|
|
2613
|
+
application.AUTH_STATUS = AUTH_STATUS;
|
|
2614
|
+
const CHAIN_TYPE = {
|
|
2615
|
+
EVM: "evm",
|
|
2616
|
+
SOLANA: "solana",
|
|
2617
|
+
UNKNOWN: "unknown"
|
|
2618
|
+
};
|
|
2619
|
+
application.CHAIN_TYPE = CHAIN_TYPE;
|
|
2620
|
+
const STORAGE_KEYS = {
|
|
2621
|
+
AUTH_TOKEN: "authToken",
|
|
2622
|
+
USER_DATA: "userData",
|
|
2623
|
+
THEME: "theme",
|
|
2624
|
+
EMAIL_CACHE: "emailCache",
|
|
2625
|
+
WALLET_ADDRESS: "walletAddress",
|
|
2626
|
+
CHAIN_TYPE: "chainType"
|
|
2627
|
+
};
|
|
2628
|
+
application.STORAGE_KEYS = STORAGE_KEYS;
|
|
2629
|
+
const EMAIL_CONFIG = {
|
|
2630
|
+
MAX_ATTACHMENT_SIZE: 25 * 1024 * 1024,
|
|
2631
|
+
// 25MB
|
|
2632
|
+
MAX_RECIPIENTS: 100,
|
|
2633
|
+
ITEMS_PER_PAGE: 50,
|
|
2634
|
+
REFRESH_INTERVAL: 6e4,
|
|
2635
|
+
// 1 minute
|
|
2636
|
+
NOTIFICATION_COOLDOWN: 3e5
|
|
2637
|
+
// 5 minutes
|
|
2638
|
+
};
|
|
2639
|
+
application.EMAIL_CONFIG = EMAIL_CONFIG;
|
|
2640
|
+
const SUBSCRIPTION_TIERS = {
|
|
2641
|
+
FREE: "free",
|
|
2642
|
+
BASIC: "basic",
|
|
2643
|
+
PRO: "pro",
|
|
2644
|
+
ENTERPRISE: "enterprise"
|
|
2645
|
+
};
|
|
2646
|
+
application.SUBSCRIPTION_TIERS = SUBSCRIPTION_TIERS;
|
|
2647
|
+
const TIME_FORMAT = {
|
|
2648
|
+
SHORT_DATE: "MMM d",
|
|
2649
|
+
FULL_DATE: "MMM d, yyyy",
|
|
2650
|
+
DATE_TIME: "MMM d, yyyy h:mm a",
|
|
2651
|
+
RELATIVE: "relative"
|
|
2652
|
+
};
|
|
2653
|
+
application.TIME_FORMAT = TIME_FORMAT;
|
|
2654
|
+
const ERROR_MESSAGES = {
|
|
2655
|
+
WALLET_NOT_CONNECTED: "Please connect your wallet first",
|
|
2656
|
+
INVALID_ADDRESS: "Please enter a valid address",
|
|
2657
|
+
NETWORK_ERROR: "Network error. Please try again.",
|
|
2658
|
+
AUTHENTICATION_FAILED: "Authentication failed. Please sign in again.",
|
|
2659
|
+
TRANSACTION_FAILED: "Transaction failed. Please try again.",
|
|
2660
|
+
INSUFFICIENT_FUNDS: "Insufficient funds for this operation",
|
|
2661
|
+
RATE_LIMITED: "Too many requests. Please wait a moment.",
|
|
2662
|
+
SESSION_EXPIRED: "Your session has expired. Please sign in again.",
|
|
2663
|
+
PERMISSION_DENIED: "You do not have permission to perform this action"
|
|
2664
|
+
};
|
|
2665
|
+
application.ERROR_MESSAGES = ERROR_MESSAGES;
|
|
2666
|
+
const SUCCESS_MESSAGES = {
|
|
2667
|
+
EMAIL_SENT: "Email sent successfully",
|
|
2668
|
+
EMAIL_DELETED: "Email deleted successfully",
|
|
2669
|
+
PREFERENCES_SAVED: "Preferences saved successfully",
|
|
2670
|
+
WALLET_CONNECTED: "Wallet connected successfully",
|
|
2671
|
+
AUTHENTICATION_SUCCESS: "Authentication successful",
|
|
2672
|
+
DELEGATION_SUCCESS: "Delegation successful",
|
|
2673
|
+
SUBSCRIPTION_ACTIVATED: "Subscription activated successfully"
|
|
2674
|
+
};
|
|
2675
|
+
application.SUCCESS_MESSAGES = SUCCESS_MESSAGES;
|
|
2676
|
+
const ROUTES = {
|
|
2677
|
+
HOME: "/",
|
|
2678
|
+
ABOUT: "/about",
|
|
2679
|
+
CONNECT: "/connect",
|
|
2680
|
+
MAIL: "/mail",
|
|
2681
|
+
COMPOSE: "/mail/compose",
|
|
2682
|
+
PREFERENCES: "/preferences",
|
|
2683
|
+
TERMS: "/terms",
|
|
2684
|
+
PRIVACY: "/privacy",
|
|
2685
|
+
DOCUMENTATION: "/document",
|
|
2686
|
+
WEB3_USERS: "/web3-users",
|
|
2687
|
+
WEB3_PROJECTS: "/web3-projects"
|
|
2688
|
+
};
|
|
2689
|
+
application.ROUTES = ROUTES;
|
|
2690
|
+
const CONTACT_INFO = {
|
|
2691
|
+
SUPPORT_EMAIL: "support@sudobility.com",
|
|
2692
|
+
CONTACT_EMAIL: "info@sudobility.com"
|
|
2693
|
+
};
|
|
2694
|
+
application.CONTACT_INFO = CONTACT_INFO;
|
|
2695
|
+
const WALLET_NAMES = {
|
|
2696
|
+
METAMASK: "MetaMask",
|
|
2697
|
+
WALLETCONNECT: "WalletConnect",
|
|
2698
|
+
COINBASE: "Coinbase Wallet",
|
|
2699
|
+
PHANTOM: "Phantom",
|
|
2700
|
+
SAFE: "Safe",
|
|
2701
|
+
ARGENT: "Argent",
|
|
2702
|
+
RAINBOW: "Rainbow",
|
|
2703
|
+
TRUST: "Trust Wallet",
|
|
2704
|
+
LEDGER: "Ledger",
|
|
2705
|
+
TREZOR: "Trezor"
|
|
2706
|
+
};
|
|
2707
|
+
application.WALLET_NAMES = WALLET_NAMES;
|
|
2708
|
+
const NETWORK_IDS = {
|
|
2709
|
+
ETHEREUM_MAINNET: 1,
|
|
2710
|
+
POLYGON: 137,
|
|
2711
|
+
ARBITRUM: 42161,
|
|
2712
|
+
OPTIMISM: 10,
|
|
2713
|
+
BASE: 8453,
|
|
2714
|
+
SOLANA_MAINNET: "mainnet-beta",
|
|
2715
|
+
SOLANA_DEVNET: "devnet"
|
|
2716
|
+
};
|
|
2717
|
+
application.NETWORK_IDS = NETWORK_IDS;
|
|
2718
|
+
const ANIMATION = {
|
|
2719
|
+
FAST: 150,
|
|
2720
|
+
NORMAL: 300,
|
|
2721
|
+
SLOW: 500,
|
|
2722
|
+
VERY_SLOW: 1e3
|
|
2723
|
+
};
|
|
2724
|
+
application.ANIMATION = ANIMATION;
|
|
2725
|
+
const Z_INDEX = {
|
|
2726
|
+
DROPDOWN: 10,
|
|
2727
|
+
OVERLAY: 20,
|
|
2728
|
+
MODAL: 30,
|
|
2729
|
+
POPOVER: 40,
|
|
2730
|
+
TOOLTIP: 50,
|
|
2731
|
+
TOAST: 60
|
|
2732
|
+
};
|
|
2733
|
+
application.Z_INDEX = Z_INDEX;
|
|
2734
|
+
return application;
|
|
2735
|
+
}
|
|
2736
|
+
var statusValues = {};
|
|
2737
|
+
var hasRequiredStatusValues;
|
|
2738
|
+
function requireStatusValues() {
|
|
2739
|
+
if (hasRequiredStatusValues) return statusValues;
|
|
2740
|
+
hasRequiredStatusValues = 1;
|
|
2741
|
+
Object.defineProperty(statusValues, "__esModule", { value: true });
|
|
2742
|
+
statusValues.STATUS_VALUES = void 0;
|
|
2743
|
+
statusValues.STATUS_VALUES = {
|
|
2744
|
+
SUCCESS: "success",
|
|
2745
|
+
PENDING: "pending",
|
|
2746
|
+
FAILED: "failed",
|
|
2747
|
+
ERROR: "error"
|
|
2748
|
+
};
|
|
2749
|
+
return statusValues;
|
|
2750
|
+
}
|
|
2751
|
+
var logger = {};
|
|
2752
|
+
var hasRequiredLogger;
|
|
2753
|
+
function requireLogger() {
|
|
2754
|
+
if (hasRequiredLogger) return logger;
|
|
2755
|
+
hasRequiredLogger = 1;
|
|
2756
|
+
Object.defineProperty(logger, "__esModule", { value: true });
|
|
2757
|
+
logger.storageLogger = logger.ensLogger = logger.contractLogger = logger.apiLogger = logger.authLogger = logger.logger = logger.LogLevel = void 0;
|
|
2758
|
+
var LogLevel;
|
|
2759
|
+
(function(LogLevel2) {
|
|
2760
|
+
LogLevel2["ERROR"] = "error";
|
|
2761
|
+
LogLevel2["WARN"] = "warn";
|
|
2762
|
+
LogLevel2["INFO"] = "info";
|
|
2763
|
+
LogLevel2["DEBUG"] = "debug";
|
|
2764
|
+
})(LogLevel || (logger.LogLevel = LogLevel = {}));
|
|
2765
|
+
class Logger {
|
|
2766
|
+
constructor() {
|
|
2767
|
+
this.isDevelopment = process.env.NODE_ENV === "development";
|
|
2768
|
+
}
|
|
2769
|
+
formatTimestamp() {
|
|
2770
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2771
|
+
}
|
|
2772
|
+
formatMessage(_level, message, context) {
|
|
2773
|
+
const timestamp = this.formatTimestamp();
|
|
2774
|
+
const contextStr = context ? ` [${context}]` : "";
|
|
2775
|
+
return `[${timestamp}]${contextStr} ${message}`;
|
|
2776
|
+
}
|
|
2777
|
+
shouldLog(level) {
|
|
2778
|
+
if (!this.isDevelopment) {
|
|
2779
|
+
return level === LogLevel.ERROR || level === LogLevel.WARN;
|
|
2780
|
+
}
|
|
2781
|
+
return true;
|
|
2782
|
+
}
|
|
2783
|
+
error(message, context, data) {
|
|
2784
|
+
if (this.shouldLog(LogLevel.ERROR)) {
|
|
2785
|
+
console.error(this.formatMessage(LogLevel.ERROR, message, context));
|
|
2786
|
+
if (data) {
|
|
2787
|
+
console.error(data);
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
warn(message, context, data) {
|
|
2792
|
+
if (this.shouldLog(LogLevel.WARN)) {
|
|
2793
|
+
console.warn(this.formatMessage(LogLevel.WARN, message, context));
|
|
2794
|
+
if (data) {
|
|
2795
|
+
console.warn(data);
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
info(message, context, data) {
|
|
2800
|
+
if (this.shouldLog(LogLevel.INFO)) {
|
|
2801
|
+
console.log(this.formatMessage(LogLevel.INFO, message, context));
|
|
2802
|
+
if (data) {
|
|
2803
|
+
console.log(data);
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
debug(message, context, data) {
|
|
2808
|
+
if (this.shouldLog(LogLevel.DEBUG)) {
|
|
2809
|
+
console.log(this.formatMessage(LogLevel.DEBUG, message, context));
|
|
2810
|
+
if (data) {
|
|
2811
|
+
console.log(data);
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
/**
|
|
2816
|
+
* Create a contextual logger that automatically includes context in all calls
|
|
2817
|
+
*/
|
|
2818
|
+
withContext(context) {
|
|
2819
|
+
return {
|
|
2820
|
+
error: (message, data) => this.error(message, context, data),
|
|
2821
|
+
warn: (message, data) => this.warn(message, context, data),
|
|
2822
|
+
info: (message, data) => this.info(message, context, data),
|
|
2823
|
+
debug: (message, data) => this.debug(message, context, data)
|
|
2824
|
+
};
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
const logger$1 = new Logger();
|
|
2828
|
+
logger.logger = logger$1;
|
|
2829
|
+
const authLogger = logger$1.withContext("AUTH");
|
|
2830
|
+
logger.authLogger = authLogger;
|
|
2831
|
+
const apiLogger = logger$1.withContext("API");
|
|
2832
|
+
logger.apiLogger = apiLogger;
|
|
2833
|
+
const contractLogger = logger$1.withContext("CONTRACT");
|
|
2834
|
+
logger.contractLogger = contractLogger;
|
|
2835
|
+
const ensLogger = logger$1.withContext("ENS");
|
|
2836
|
+
logger.ensLogger = ensLogger;
|
|
2837
|
+
const storageLogger = logger$1.withContext("STORAGE");
|
|
2838
|
+
logger.storageLogger = storageLogger;
|
|
2839
|
+
return logger;
|
|
2840
|
+
}
|
|
2841
|
+
var urlParams = {};
|
|
2842
|
+
var hasRequiredUrlParams;
|
|
2843
|
+
function requireUrlParams() {
|
|
2844
|
+
if (hasRequiredUrlParams) return urlParams;
|
|
2845
|
+
hasRequiredUrlParams = 1;
|
|
2846
|
+
Object.defineProperty(urlParams, "__esModule", { value: true });
|
|
2847
|
+
urlParams.createURLSearchParams = createURLSearchParams;
|
|
2848
|
+
urlParams.createSearchParams = createSearchParams;
|
|
2849
|
+
urlParams.searchParamsToString = searchParamsToString;
|
|
2850
|
+
urlParams.parseSearchParams = parseSearchParams;
|
|
2851
|
+
class SimpleURLSearchParams {
|
|
2852
|
+
constructor(init) {
|
|
2853
|
+
this.params = /* @__PURE__ */ new Map();
|
|
2854
|
+
if (init) {
|
|
2855
|
+
if (typeof init === "string") {
|
|
2856
|
+
this.parseString(init);
|
|
2857
|
+
} else if (Array.isArray(init)) {
|
|
2858
|
+
for (const [key, value] of init) {
|
|
2859
|
+
this.append(key, value);
|
|
2860
|
+
}
|
|
2861
|
+
} else {
|
|
2862
|
+
for (const [key, value] of Object.entries(init)) {
|
|
2863
|
+
if (value !== void 0) {
|
|
2864
|
+
this.append(key, value);
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
parseString(str) {
|
|
2871
|
+
const params = str.startsWith("?") ? str.slice(1) : str;
|
|
2872
|
+
if (!params)
|
|
2873
|
+
return;
|
|
2874
|
+
for (const pair of params.split("&")) {
|
|
2875
|
+
const [key, value = ""] = pair.split("=");
|
|
2876
|
+
if (key) {
|
|
2877
|
+
this.append(decodeURIComponent(key), decodeURIComponent(value));
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
append(name, value) {
|
|
2882
|
+
if (!this.params.has(name)) {
|
|
2883
|
+
this.params.set(name, []);
|
|
2884
|
+
}
|
|
2885
|
+
const existingValues = this.params.get(name);
|
|
2886
|
+
if (existingValues) {
|
|
2887
|
+
existingValues.push(value);
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
delete(name) {
|
|
2891
|
+
this.params.delete(name);
|
|
2892
|
+
}
|
|
2893
|
+
get(name) {
|
|
2894
|
+
const values = this.params.get(name);
|
|
2895
|
+
return values && values.length > 0 ? values[0] : null;
|
|
2896
|
+
}
|
|
2897
|
+
getAll(name) {
|
|
2898
|
+
return this.params.get(name) || [];
|
|
2899
|
+
}
|
|
2900
|
+
has(name) {
|
|
2901
|
+
return this.params.has(name);
|
|
2902
|
+
}
|
|
2903
|
+
set(name, value) {
|
|
2904
|
+
this.params.set(name, [value]);
|
|
2905
|
+
}
|
|
2906
|
+
toString() {
|
|
2907
|
+
const pairs = [];
|
|
2908
|
+
this.params.forEach((values, key) => {
|
|
2909
|
+
for (const value of values) {
|
|
2910
|
+
pairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
|
|
2911
|
+
}
|
|
2912
|
+
});
|
|
2913
|
+
return pairs.join("&");
|
|
2914
|
+
}
|
|
2915
|
+
forEach(callback) {
|
|
2916
|
+
this.params.forEach((values, key) => {
|
|
2917
|
+
for (const value of values) {
|
|
2918
|
+
callback(value, key);
|
|
2919
|
+
}
|
|
2920
|
+
});
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
function createURLSearchParams(init) {
|
|
2924
|
+
if (typeof URLSearchParams !== "undefined") {
|
|
2925
|
+
return new URLSearchParams(init);
|
|
2926
|
+
}
|
|
2927
|
+
return new SimpleURLSearchParams(init);
|
|
2928
|
+
}
|
|
2929
|
+
function createSearchParams(params) {
|
|
2930
|
+
const searchParams = createURLSearchParams(void 0);
|
|
2931
|
+
for (const [key, value] of Object.entries(params)) {
|
|
2932
|
+
if (value !== void 0 && value !== null) {
|
|
2933
|
+
searchParams.append(key, String(value));
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
return searchParams;
|
|
2937
|
+
}
|
|
2938
|
+
function searchParamsToString(params) {
|
|
2939
|
+
return params.toString();
|
|
2940
|
+
}
|
|
2941
|
+
function parseSearchParams(queryString) {
|
|
2942
|
+
const params = createURLSearchParams(queryString);
|
|
2943
|
+
const result = {};
|
|
2944
|
+
params.forEach((value, key) => {
|
|
2945
|
+
result[key] = value;
|
|
2946
|
+
});
|
|
2947
|
+
return result;
|
|
2948
|
+
}
|
|
2949
|
+
return urlParams;
|
|
2950
|
+
}
|
|
2951
|
+
var asyncHelpers = {};
|
|
2952
|
+
var hasRequiredAsyncHelpers;
|
|
2953
|
+
function requireAsyncHelpers() {
|
|
2954
|
+
if (hasRequiredAsyncHelpers) return asyncHelpers;
|
|
2955
|
+
hasRequiredAsyncHelpers = 1;
|
|
2956
|
+
Object.defineProperty(asyncHelpers, "__esModule", { value: true });
|
|
2957
|
+
asyncHelpers.debounceAsync = asyncHelpers.clearExpiredCache = asyncHelpers.withCache = asyncHelpers.withTimeout = asyncHelpers.safeParallel = asyncHelpers.withLoadingState = asyncHelpers.safeAsync = void 0;
|
|
2958
|
+
const logger_1 = requireLogger();
|
|
2959
|
+
const safeAsync = async (operation, context) => {
|
|
2960
|
+
try {
|
|
2961
|
+
const data = await operation();
|
|
2962
|
+
return { data, success: true };
|
|
2963
|
+
} catch (error) {
|
|
2964
|
+
const errorObj = error instanceof Error ? error : new Error(String(error));
|
|
2965
|
+
logger_1.logger.error(`Async operation failed: ${errorObj.message}`, context, error);
|
|
2966
|
+
return { error: errorObj, success: false };
|
|
2967
|
+
}
|
|
2968
|
+
};
|
|
2969
|
+
asyncHelpers.safeAsync = safeAsync;
|
|
2970
|
+
const withLoadingState = async (operation, setLoading, setError, context) => {
|
|
2971
|
+
setLoading(true);
|
|
2972
|
+
setError(null);
|
|
2973
|
+
try {
|
|
2974
|
+
const result = await operation();
|
|
2975
|
+
return result;
|
|
2976
|
+
} catch (error) {
|
|
2977
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
2978
|
+
setError(errorMessage);
|
|
2979
|
+
logger_1.logger.error(`Operation failed: ${errorMessage}`, context, error);
|
|
2980
|
+
return void 0;
|
|
2981
|
+
} finally {
|
|
2982
|
+
setLoading(false);
|
|
2983
|
+
}
|
|
2984
|
+
};
|
|
2985
|
+
asyncHelpers.withLoadingState = withLoadingState;
|
|
2986
|
+
const safeParallel = async (operations, context) => {
|
|
2987
|
+
try {
|
|
2988
|
+
const results = await Promise.all(operations.map((op) => op()));
|
|
2989
|
+
return { data: results, success: true };
|
|
2990
|
+
} catch (error) {
|
|
2991
|
+
const errorObj = error instanceof Error ? error : new Error(String(error));
|
|
2992
|
+
logger_1.logger.error(`Parallel operations failed: ${errorObj.message}`, context, error);
|
|
2993
|
+
return { error: errorObj, success: false };
|
|
2994
|
+
}
|
|
2995
|
+
};
|
|
2996
|
+
asyncHelpers.safeParallel = safeParallel;
|
|
2997
|
+
const withTimeout = async (operation, timeoutMs, context) => {
|
|
2998
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error(`Operation timed out after ${timeoutMs}ms`)), timeoutMs));
|
|
2999
|
+
try {
|
|
3000
|
+
return await Promise.race([operation(), timeoutPromise]);
|
|
3001
|
+
} catch (error) {
|
|
3002
|
+
logger_1.logger.error(`Timeout operation failed`, context, error);
|
|
3003
|
+
throw error;
|
|
3004
|
+
}
|
|
3005
|
+
};
|
|
3006
|
+
asyncHelpers.withTimeout = withTimeout;
|
|
3007
|
+
const cache = /* @__PURE__ */ new Map();
|
|
3008
|
+
const withCache = async (key, operation, ttlMs = 5 * 60 * 1e3) => {
|
|
3009
|
+
const cached = cache.get(key);
|
|
3010
|
+
const now = Date.now();
|
|
3011
|
+
if (cached && now - cached.timestamp < cached.ttl) {
|
|
3012
|
+
return cached.data;
|
|
3013
|
+
}
|
|
3014
|
+
const result = await operation();
|
|
3015
|
+
cache.set(key, { data: result, timestamp: now, ttl: ttlMs });
|
|
3016
|
+
return result;
|
|
3017
|
+
};
|
|
3018
|
+
asyncHelpers.withCache = withCache;
|
|
3019
|
+
const clearExpiredCache = () => {
|
|
3020
|
+
const now = Date.now();
|
|
3021
|
+
for (const [key, entry] of cache.entries()) {
|
|
3022
|
+
if (now - entry.timestamp >= entry.ttl) {
|
|
3023
|
+
cache.delete(key);
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
};
|
|
3027
|
+
asyncHelpers.clearExpiredCache = clearExpiredCache;
|
|
3028
|
+
const debounceMap = /* @__PURE__ */ new Map();
|
|
3029
|
+
const debounceAsync = (fn, delay, key) => {
|
|
3030
|
+
return (...args) => {
|
|
3031
|
+
return new Promise((resolve) => {
|
|
3032
|
+
const existingTimeout = debounceMap.get(key);
|
|
3033
|
+
if (existingTimeout) {
|
|
3034
|
+
clearTimeout(existingTimeout);
|
|
3035
|
+
}
|
|
3036
|
+
const timeout = setTimeout(async () => {
|
|
3037
|
+
debounceMap.delete(key);
|
|
3038
|
+
try {
|
|
3039
|
+
const result = await fn(...args);
|
|
3040
|
+
resolve(result);
|
|
3041
|
+
} catch (error) {
|
|
3042
|
+
logger_1.logger.error(`Debounced operation failed`, key, error);
|
|
3043
|
+
resolve(void 0);
|
|
3044
|
+
}
|
|
3045
|
+
}, delay);
|
|
3046
|
+
debounceMap.set(key, timeout);
|
|
3047
|
+
});
|
|
3048
|
+
};
|
|
3049
|
+
};
|
|
3050
|
+
asyncHelpers.debounceAsync = debounceAsync;
|
|
3051
|
+
return asyncHelpers;
|
|
3052
|
+
}
|
|
3053
|
+
var hasRequiredDist;
|
|
3054
|
+
function requireDist() {
|
|
3055
|
+
if (hasRequiredDist) return dist;
|
|
3056
|
+
hasRequiredDist = 1;
|
|
3057
|
+
(function(exports$1) {
|
|
3058
|
+
/**
|
|
3059
|
+
* @johnqh/types - Common TypeScript types for Web3 email projects
|
|
3060
|
+
*
|
|
3061
|
+
* This package contains all shared TypeScript definitions used across
|
|
3062
|
+
* Web3 email applications including business logic types, blockchain
|
|
3063
|
+
* types, configuration interfaces, infrastructure types, and utility functions.
|
|
3064
|
+
*
|
|
3065
|
+
* @version 1.0.0
|
|
3066
|
+
* @license MIT
|
|
3067
|
+
*/
|
|
3068
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
3069
|
+
exports$1.EntityRole = exports$1.EntityType = exports$1.NONE_ENTITLEMENT = exports$1.ALL_PERIODS = exports$1.PERIOD_RANKS = exports$1.RateLimitPeriodType = exports$1.WalletType = exports$1.NetworkError = exports$1.ProcessedEventName = exports$1.ContractType = exports$1.AnalyticsEventBuilder = exports$1.AnalyticsEvent = exports$1.StorageType = exports$1.validateMessage = exports$1.validateDomain = exports$1.validateAmount = exports$1.validateAddress = exports$1.isSolanaRecipient = exports$1.isSolanaAddress = exports$1.isEvmRecipient = exports$1.isEvmAddress = exports$1.TransactionStatus = exports$1.PROTOCOL_CONSTANTS = exports$1.MessageType = exports$1.isWalletVerified = exports$1.isWalletConnected = exports$1.getWalletConnectionState = exports$1.Theme = exports$1.SubscriptionAction = exports$1.SortOrder = exports$1.RequestStatus = exports$1.PlatformType = exports$1.NotificationType = exports$1.MobileView = exports$1.MediumView = exports$1.InfoType = exports$1.FontSize = exports$1.FeatureFlag = exports$1.ErrorType = exports$1.EmailValidationState = exports$1.EmailSortCriteria = exports$1.EmailComposeType = exports$1.EmailAddressType = exports$1.EmailAction = exports$1.Currency = exports$1.ConnectionType = exports$1.ConnectionState = exports$1.ChainType = exports$1.Chain = exports$1.AuthStatus = void 0;
|
|
3070
|
+
exports$1.isAuthStatusConnected = exports$1.isAuthExpired = exports$1.getAuthStatusText = exports$1.generateNonce = exports$1.generateAuthMessage = exports$1.extractNonceFromMessage = exports$1.canAccessProtectedFeatures = exports$1.validateEventArgs = exports$1.normalizeAddress = exports$1.isZeroAddress = exports$1.isTestNet = exports$1.formatBigInt = exports$1.createUserMultiChainId = exports$1.createMultiChainId = exports$1.createDelegationId = exports$1.createChainStatsId = exports$1.parseEmailAddress = exports$1.isValidWalletAddress = exports$1.isValidSignature = exports$1.isSNSName = exports$1.isENSName = exports$1.getChainDisplayName = exports$1.getAddressType = exports$1.formatWalletAddress = exports$1.AddressType = exports$1.validateArray = exports$1.parseJson = exports$1.optional = exports$1.isValidDate = exports$1.isUrl = exports$1.isSuccessResponse = exports$1.isString = exports$1.isObject = exports$1.isNumber = exports$1.isNullish = exports$1.isErrorResponse = exports$1.isEmail = exports$1.isBoolean = exports$1.isArray = exports$1.isApiResponse = exports$1.hasRequiredProperties = exports$1.createValidator = exports$1.createAssertion = exports$1.Web3UsernameValidator = exports$1.hasPermission = exports$1.getPermissionsForRole = exports$1.MEMBER_PERMISSIONS = exports$1.MANAGER_PERMISSIONS = exports$1.OWNER_PERMISSIONS = exports$1.InvitationStatus = void 0;
|
|
3071
|
+
exports$1.LogLevel = exports$1.STATUS_VALUES = exports$1.Z_INDEX = exports$1.ANIMATION = exports$1.NETWORK_IDS = exports$1.WALLET_NAMES = exports$1.CONTACT_INFO = exports$1.ROUTES = exports$1.SUCCESS_MESSAGES = exports$1.ERROR_MESSAGES = exports$1.TIME_FORMAT = exports$1.SUBSCRIPTION_TIERS = exports$1.EMAIL_CONFIG = exports$1.STORAGE_KEYS = exports$1.CHAIN_TYPE = exports$1.AUTH_STATUS = exports$1.API_RETRY_DELAY = exports$1.API_RETRY_ATTEMPTS = exports$1.API_TIMEOUT = exports$1.truncate = exports$1.toTitleCase = exports$1.toSnakeCase = exports$1.toKebabCase = exports$1.toCamelCase = exports$1.stripHtml = exports$1.randomString = exports$1.pluralize = exports$1.normalizeWhitespace = exports$1.isNotBlank = exports$1.isBlank = exports$1.getInitials = exports$1.formatNumber = exports$1.formatBytes = exports$1.escapeHtml = exports$1.capitalize = exports$1.parseDate = exports$1.isDateInRange = exports$1.formatTimestamp = exports$1.formatRelativeTime = exports$1.formatEmailDate = exports$1.addHours = exports$1.addDays = exports$1.parseUSDC = exports$1.formatUSDC = exports$1.USDC_DECIMALS = exports$1.CLAIM_PERIOD_DAYS = exports$1.createAdminChecker = exports$1.isAdminEmail = exports$1.parseAdminEmails = exports$1.isValidNonce = void 0;
|
|
3072
|
+
exports$1.debounceAsync = exports$1.clearExpiredCache = exports$1.withCache = exports$1.withTimeout = exports$1.safeParallel = exports$1.withLoadingState = exports$1.safeAsync = exports$1.parseSearchParams = exports$1.searchParamsToString = exports$1.createSearchParams = exports$1.createURLSearchParams = exports$1.storageLogger = exports$1.ensLogger = exports$1.contractLogger = exports$1.apiLogger = exports$1.authLogger = exports$1.logger = void 0;
|
|
3073
|
+
var enums_1 = requireEnums();
|
|
3074
|
+
Object.defineProperty(exports$1, "AuthStatus", { enumerable: true, get: function() {
|
|
3075
|
+
return enums_1.AuthStatus;
|
|
3076
|
+
} });
|
|
3077
|
+
Object.defineProperty(exports$1, "Chain", { enumerable: true, get: function() {
|
|
3078
|
+
return enums_1.Chain;
|
|
3079
|
+
} });
|
|
3080
|
+
Object.defineProperty(exports$1, "ChainType", { enumerable: true, get: function() {
|
|
3081
|
+
return enums_1.ChainType;
|
|
3082
|
+
} });
|
|
3083
|
+
Object.defineProperty(exports$1, "ConnectionState", { enumerable: true, get: function() {
|
|
3084
|
+
return enums_1.ConnectionState;
|
|
3085
|
+
} });
|
|
3086
|
+
Object.defineProperty(exports$1, "ConnectionType", { enumerable: true, get: function() {
|
|
3087
|
+
return enums_1.ConnectionType;
|
|
3088
|
+
} });
|
|
3089
|
+
Object.defineProperty(exports$1, "Currency", { enumerable: true, get: function() {
|
|
3090
|
+
return enums_1.Currency;
|
|
3091
|
+
} });
|
|
3092
|
+
Object.defineProperty(exports$1, "EmailAction", { enumerable: true, get: function() {
|
|
3093
|
+
return enums_1.EmailAction;
|
|
3094
|
+
} });
|
|
3095
|
+
Object.defineProperty(exports$1, "EmailAddressType", { enumerable: true, get: function() {
|
|
3096
|
+
return enums_1.EmailAddressType;
|
|
3097
|
+
} });
|
|
3098
|
+
Object.defineProperty(exports$1, "EmailComposeType", { enumerable: true, get: function() {
|
|
3099
|
+
return enums_1.EmailComposeType;
|
|
3100
|
+
} });
|
|
3101
|
+
Object.defineProperty(exports$1, "EmailSortCriteria", { enumerable: true, get: function() {
|
|
3102
|
+
return enums_1.EmailSortCriteria;
|
|
3103
|
+
} });
|
|
3104
|
+
Object.defineProperty(exports$1, "EmailValidationState", { enumerable: true, get: function() {
|
|
3105
|
+
return enums_1.EmailValidationState;
|
|
3106
|
+
} });
|
|
3107
|
+
Object.defineProperty(exports$1, "ErrorType", { enumerable: true, get: function() {
|
|
3108
|
+
return enums_1.ErrorType;
|
|
3109
|
+
} });
|
|
3110
|
+
Object.defineProperty(exports$1, "FeatureFlag", { enumerable: true, get: function() {
|
|
3111
|
+
return enums_1.FeatureFlag;
|
|
3112
|
+
} });
|
|
3113
|
+
Object.defineProperty(exports$1, "FontSize", { enumerable: true, get: function() {
|
|
3114
|
+
return enums_1.FontSize;
|
|
3115
|
+
} });
|
|
3116
|
+
Object.defineProperty(exports$1, "InfoType", { enumerable: true, get: function() {
|
|
3117
|
+
return enums_1.InfoType;
|
|
3118
|
+
} });
|
|
3119
|
+
Object.defineProperty(exports$1, "MediumView", { enumerable: true, get: function() {
|
|
3120
|
+
return enums_1.MediumView;
|
|
3121
|
+
} });
|
|
3122
|
+
Object.defineProperty(exports$1, "MobileView", { enumerable: true, get: function() {
|
|
3123
|
+
return enums_1.MobileView;
|
|
3124
|
+
} });
|
|
3125
|
+
Object.defineProperty(exports$1, "NotificationType", { enumerable: true, get: function() {
|
|
3126
|
+
return enums_1.NotificationType;
|
|
3127
|
+
} });
|
|
3128
|
+
Object.defineProperty(exports$1, "PlatformType", { enumerable: true, get: function() {
|
|
3129
|
+
return enums_1.PlatformType;
|
|
3130
|
+
} });
|
|
3131
|
+
Object.defineProperty(exports$1, "RequestStatus", { enumerable: true, get: function() {
|
|
3132
|
+
return enums_1.RequestStatus;
|
|
3133
|
+
} });
|
|
3134
|
+
Object.defineProperty(exports$1, "SortOrder", { enumerable: true, get: function() {
|
|
3135
|
+
return enums_1.SortOrder;
|
|
3136
|
+
} });
|
|
3137
|
+
Object.defineProperty(exports$1, "SubscriptionAction", { enumerable: true, get: function() {
|
|
3138
|
+
return enums_1.SubscriptionAction;
|
|
3139
|
+
} });
|
|
3140
|
+
Object.defineProperty(exports$1, "Theme", { enumerable: true, get: function() {
|
|
3141
|
+
return enums_1.Theme;
|
|
3142
|
+
} });
|
|
3143
|
+
var wallet_status_1 = requireWalletStatus();
|
|
3144
|
+
Object.defineProperty(exports$1, "getWalletConnectionState", { enumerable: true, get: function() {
|
|
3145
|
+
return wallet_status_1.getWalletConnectionState;
|
|
3146
|
+
} });
|
|
3147
|
+
Object.defineProperty(exports$1, "isWalletConnected", { enumerable: true, get: function() {
|
|
3148
|
+
return wallet_status_1.isWalletConnected;
|
|
3149
|
+
} });
|
|
3150
|
+
Object.defineProperty(exports$1, "isWalletVerified", { enumerable: true, get: function() {
|
|
3151
|
+
return wallet_status_1.isWalletVerified;
|
|
3152
|
+
} });
|
|
3153
|
+
var common_1 = requireCommon();
|
|
3154
|
+
Object.defineProperty(exports$1, "MessageType", { enumerable: true, get: function() {
|
|
3155
|
+
return common_1.MessageType;
|
|
3156
|
+
} });
|
|
3157
|
+
Object.defineProperty(exports$1, "PROTOCOL_CONSTANTS", { enumerable: true, get: function() {
|
|
3158
|
+
return common_1.PROTOCOL_CONSTANTS;
|
|
3159
|
+
} });
|
|
3160
|
+
Object.defineProperty(exports$1, "TransactionStatus", { enumerable: true, get: function() {
|
|
3161
|
+
return common_1.TransactionStatus;
|
|
3162
|
+
} });
|
|
3163
|
+
Object.defineProperty(exports$1, "isEvmAddress", { enumerable: true, get: function() {
|
|
3164
|
+
return common_1.isEvmAddress;
|
|
3165
|
+
} });
|
|
3166
|
+
Object.defineProperty(exports$1, "isEvmRecipient", { enumerable: true, get: function() {
|
|
3167
|
+
return common_1.isEvmRecipient;
|
|
3168
|
+
} });
|
|
3169
|
+
Object.defineProperty(exports$1, "isSolanaAddress", { enumerable: true, get: function() {
|
|
3170
|
+
return common_1.isSolanaAddress;
|
|
3171
|
+
} });
|
|
3172
|
+
Object.defineProperty(exports$1, "isSolanaRecipient", { enumerable: true, get: function() {
|
|
3173
|
+
return common_1.isSolanaRecipient;
|
|
3174
|
+
} });
|
|
3175
|
+
var validation_1 = requireValidation();
|
|
3176
|
+
Object.defineProperty(exports$1, "validateAddress", { enumerable: true, get: function() {
|
|
3177
|
+
return validation_1.validateAddress;
|
|
3178
|
+
} });
|
|
3179
|
+
Object.defineProperty(exports$1, "validateAmount", { enumerable: true, get: function() {
|
|
3180
|
+
return validation_1.validateAmount;
|
|
3181
|
+
} });
|
|
3182
|
+
Object.defineProperty(exports$1, "validateDomain", { enumerable: true, get: function() {
|
|
3183
|
+
return validation_1.validateDomain;
|
|
3184
|
+
} });
|
|
3185
|
+
Object.defineProperty(exports$1, "validateMessage", { enumerable: true, get: function() {
|
|
3186
|
+
return validation_1.validateMessage;
|
|
3187
|
+
} });
|
|
3188
|
+
var environment_1 = requireEnvironment();
|
|
3189
|
+
Object.defineProperty(exports$1, "StorageType", { enumerable: true, get: function() {
|
|
3190
|
+
return environment_1.StorageType;
|
|
3191
|
+
} });
|
|
3192
|
+
var analytics_1 = requireAnalytics();
|
|
3193
|
+
Object.defineProperty(exports$1, "AnalyticsEvent", { enumerable: true, get: function() {
|
|
3194
|
+
return analytics_1.AnalyticsEvent;
|
|
3195
|
+
} });
|
|
3196
|
+
Object.defineProperty(exports$1, "AnalyticsEventBuilder", { enumerable: true, get: function() {
|
|
3197
|
+
return analytics_1.AnalyticsEventBuilder;
|
|
3198
|
+
} });
|
|
3199
|
+
var api_1 = requireApi();
|
|
3200
|
+
Object.defineProperty(exports$1, "ContractType", { enumerable: true, get: function() {
|
|
3201
|
+
return api_1.ContractType;
|
|
3202
|
+
} });
|
|
3203
|
+
Object.defineProperty(exports$1, "ProcessedEventName", { enumerable: true, get: function() {
|
|
3204
|
+
return api_1.ProcessedEventName;
|
|
3205
|
+
} });
|
|
3206
|
+
var network_1 = requireNetwork();
|
|
3207
|
+
Object.defineProperty(exports$1, "NetworkError", { enumerable: true, get: function() {
|
|
3208
|
+
return network_1.NetworkError;
|
|
3209
|
+
} });
|
|
3210
|
+
var wallet_1 = requireWallet();
|
|
3211
|
+
Object.defineProperty(exports$1, "WalletType", { enumerable: true, get: function() {
|
|
3212
|
+
return wallet_1.WalletType;
|
|
3213
|
+
} });
|
|
3214
|
+
var rate_limits_1 = requireRateLimits();
|
|
3215
|
+
Object.defineProperty(exports$1, "RateLimitPeriodType", { enumerable: true, get: function() {
|
|
3216
|
+
return rate_limits_1.RateLimitPeriodType;
|
|
3217
|
+
} });
|
|
3218
|
+
var period_1 = requirePeriod();
|
|
3219
|
+
Object.defineProperty(exports$1, "PERIOD_RANKS", { enumerable: true, get: function() {
|
|
3220
|
+
return period_1.PERIOD_RANKS;
|
|
3221
|
+
} });
|
|
3222
|
+
Object.defineProperty(exports$1, "ALL_PERIODS", { enumerable: true, get: function() {
|
|
3223
|
+
return period_1.ALL_PERIODS;
|
|
3224
|
+
} });
|
|
3225
|
+
var entitlements_1 = requireEntitlements();
|
|
3226
|
+
Object.defineProperty(exports$1, "NONE_ENTITLEMENT", { enumerable: true, get: function() {
|
|
3227
|
+
return entitlements_1.NONE_ENTITLEMENT;
|
|
3228
|
+
} });
|
|
3229
|
+
var entity_1 = requireEntity();
|
|
3230
|
+
Object.defineProperty(exports$1, "EntityType", { enumerable: true, get: function() {
|
|
3231
|
+
return entity_1.EntityType;
|
|
3232
|
+
} });
|
|
3233
|
+
Object.defineProperty(exports$1, "EntityRole", { enumerable: true, get: function() {
|
|
3234
|
+
return entity_1.EntityRole;
|
|
3235
|
+
} });
|
|
3236
|
+
Object.defineProperty(exports$1, "InvitationStatus", { enumerable: true, get: function() {
|
|
3237
|
+
return entity_1.InvitationStatus;
|
|
3238
|
+
} });
|
|
3239
|
+
var permissions_1 = requirePermissions();
|
|
3240
|
+
Object.defineProperty(exports$1, "OWNER_PERMISSIONS", { enumerable: true, get: function() {
|
|
3241
|
+
return permissions_1.OWNER_PERMISSIONS;
|
|
3242
|
+
} });
|
|
3243
|
+
Object.defineProperty(exports$1, "MANAGER_PERMISSIONS", { enumerable: true, get: function() {
|
|
3244
|
+
return permissions_1.MANAGER_PERMISSIONS;
|
|
3245
|
+
} });
|
|
3246
|
+
Object.defineProperty(exports$1, "MEMBER_PERMISSIONS", { enumerable: true, get: function() {
|
|
3247
|
+
return permissions_1.MEMBER_PERMISSIONS;
|
|
3248
|
+
} });
|
|
3249
|
+
Object.defineProperty(exports$1, "getPermissionsForRole", { enumerable: true, get: function() {
|
|
3250
|
+
return permissions_1.getPermissionsForRole;
|
|
3251
|
+
} });
|
|
3252
|
+
Object.defineProperty(exports$1, "hasPermission", { enumerable: true, get: function() {
|
|
3253
|
+
return permissions_1.hasPermission;
|
|
3254
|
+
} });
|
|
3255
|
+
var web3_username_validator_1 = requireWeb3UsernameValidator();
|
|
3256
|
+
Object.defineProperty(exports$1, "Web3UsernameValidator", { enumerable: true, get: function() {
|
|
3257
|
+
return web3_username_validator_1.Web3UsernameValidator;
|
|
3258
|
+
} });
|
|
3259
|
+
var type_validation_1 = requireTypeValidation();
|
|
3260
|
+
Object.defineProperty(exports$1, "createAssertion", { enumerable: true, get: function() {
|
|
3261
|
+
return type_validation_1.createAssertion;
|
|
3262
|
+
} });
|
|
3263
|
+
Object.defineProperty(exports$1, "createValidator", { enumerable: true, get: function() {
|
|
3264
|
+
return type_validation_1.createValidator;
|
|
3265
|
+
} });
|
|
3266
|
+
Object.defineProperty(exports$1, "hasRequiredProperties", { enumerable: true, get: function() {
|
|
3267
|
+
return type_validation_1.hasRequiredProperties;
|
|
3268
|
+
} });
|
|
3269
|
+
Object.defineProperty(exports$1, "isApiResponse", { enumerable: true, get: function() {
|
|
3270
|
+
return type_validation_1.isApiResponse;
|
|
3271
|
+
} });
|
|
3272
|
+
Object.defineProperty(exports$1, "isArray", { enumerable: true, get: function() {
|
|
3273
|
+
return type_validation_1.isArray;
|
|
3274
|
+
} });
|
|
3275
|
+
Object.defineProperty(exports$1, "isBoolean", { enumerable: true, get: function() {
|
|
3276
|
+
return type_validation_1.isBoolean;
|
|
3277
|
+
} });
|
|
3278
|
+
Object.defineProperty(exports$1, "isEmail", { enumerable: true, get: function() {
|
|
3279
|
+
return type_validation_1.isEmail;
|
|
3280
|
+
} });
|
|
3281
|
+
Object.defineProperty(exports$1, "isErrorResponse", { enumerable: true, get: function() {
|
|
3282
|
+
return type_validation_1.isErrorResponse;
|
|
3283
|
+
} });
|
|
3284
|
+
Object.defineProperty(exports$1, "isNullish", { enumerable: true, get: function() {
|
|
3285
|
+
return type_validation_1.isNullish;
|
|
3286
|
+
} });
|
|
3287
|
+
Object.defineProperty(exports$1, "isNumber", { enumerable: true, get: function() {
|
|
3288
|
+
return type_validation_1.isNumber;
|
|
3289
|
+
} });
|
|
3290
|
+
Object.defineProperty(exports$1, "isObject", { enumerable: true, get: function() {
|
|
3291
|
+
return type_validation_1.isObject;
|
|
3292
|
+
} });
|
|
3293
|
+
Object.defineProperty(exports$1, "isString", { enumerable: true, get: function() {
|
|
3294
|
+
return type_validation_1.isString;
|
|
3295
|
+
} });
|
|
3296
|
+
Object.defineProperty(exports$1, "isSuccessResponse", { enumerable: true, get: function() {
|
|
3297
|
+
return type_validation_1.isSuccessResponse;
|
|
3298
|
+
} });
|
|
3299
|
+
Object.defineProperty(exports$1, "isUrl", { enumerable: true, get: function() {
|
|
3300
|
+
return type_validation_1.isUrl;
|
|
3301
|
+
} });
|
|
3302
|
+
Object.defineProperty(exports$1, "isValidDate", { enumerable: true, get: function() {
|
|
3303
|
+
return type_validation_1.isValidDate;
|
|
3304
|
+
} });
|
|
3305
|
+
Object.defineProperty(exports$1, "optional", { enumerable: true, get: function() {
|
|
3306
|
+
return type_validation_1.optional;
|
|
3307
|
+
} });
|
|
3308
|
+
Object.defineProperty(exports$1, "parseJson", { enumerable: true, get: function() {
|
|
3309
|
+
return type_validation_1.parseJson;
|
|
3310
|
+
} });
|
|
3311
|
+
Object.defineProperty(exports$1, "validateArray", { enumerable: true, get: function() {
|
|
3312
|
+
return type_validation_1.validateArray;
|
|
3313
|
+
} });
|
|
3314
|
+
var address_1 = requireAddress();
|
|
3315
|
+
Object.defineProperty(exports$1, "AddressType", { enumerable: true, get: function() {
|
|
3316
|
+
return address_1.AddressType;
|
|
3317
|
+
} });
|
|
3318
|
+
Object.defineProperty(exports$1, "formatWalletAddress", { enumerable: true, get: function() {
|
|
3319
|
+
return address_1.formatWalletAddress;
|
|
3320
|
+
} });
|
|
3321
|
+
Object.defineProperty(exports$1, "getAddressType", { enumerable: true, get: function() {
|
|
3322
|
+
return address_1.getAddressType;
|
|
3323
|
+
} });
|
|
3324
|
+
Object.defineProperty(exports$1, "getChainDisplayName", { enumerable: true, get: function() {
|
|
3325
|
+
return address_1.getChainDisplayName;
|
|
3326
|
+
} });
|
|
3327
|
+
Object.defineProperty(exports$1, "isENSName", { enumerable: true, get: function() {
|
|
3328
|
+
return address_1.isENSName;
|
|
3329
|
+
} });
|
|
3330
|
+
Object.defineProperty(exports$1, "isSNSName", { enumerable: true, get: function() {
|
|
3331
|
+
return address_1.isSNSName;
|
|
3332
|
+
} });
|
|
3333
|
+
Object.defineProperty(exports$1, "isValidSignature", { enumerable: true, get: function() {
|
|
3334
|
+
return address_1.isValidSignature;
|
|
3335
|
+
} });
|
|
3336
|
+
Object.defineProperty(exports$1, "isValidWalletAddress", { enumerable: true, get: function() {
|
|
3337
|
+
return address_1.isValidWalletAddress;
|
|
3338
|
+
} });
|
|
3339
|
+
Object.defineProperty(exports$1, "parseEmailAddress", { enumerable: true, get: function() {
|
|
3340
|
+
return address_1.parseEmailAddress;
|
|
3341
|
+
} });
|
|
3342
|
+
var event_helpers_1 = requireEventHelpers();
|
|
3343
|
+
Object.defineProperty(exports$1, "createChainStatsId", { enumerable: true, get: function() {
|
|
3344
|
+
return event_helpers_1.createChainStatsId;
|
|
3345
|
+
} });
|
|
3346
|
+
Object.defineProperty(exports$1, "createDelegationId", { enumerable: true, get: function() {
|
|
3347
|
+
return event_helpers_1.createDelegationId;
|
|
3348
|
+
} });
|
|
3349
|
+
Object.defineProperty(exports$1, "createMultiChainId", { enumerable: true, get: function() {
|
|
3350
|
+
return event_helpers_1.createMultiChainId;
|
|
3351
|
+
} });
|
|
3352
|
+
Object.defineProperty(exports$1, "createUserMultiChainId", { enumerable: true, get: function() {
|
|
3353
|
+
return event_helpers_1.createUserMultiChainId;
|
|
3354
|
+
} });
|
|
3355
|
+
Object.defineProperty(exports$1, "formatBigInt", { enumerable: true, get: function() {
|
|
3356
|
+
return event_helpers_1.formatBigInt;
|
|
3357
|
+
} });
|
|
3358
|
+
Object.defineProperty(exports$1, "isTestNet", { enumerable: true, get: function() {
|
|
3359
|
+
return event_helpers_1.isTestNet;
|
|
3360
|
+
} });
|
|
3361
|
+
Object.defineProperty(exports$1, "isZeroAddress", { enumerable: true, get: function() {
|
|
3362
|
+
return event_helpers_1.isZeroAddress;
|
|
3363
|
+
} });
|
|
3364
|
+
Object.defineProperty(exports$1, "normalizeAddress", { enumerable: true, get: function() {
|
|
3365
|
+
return event_helpers_1.normalizeAddress;
|
|
3366
|
+
} });
|
|
3367
|
+
Object.defineProperty(exports$1, "validateEventArgs", { enumerable: true, get: function() {
|
|
3368
|
+
return event_helpers_1.validateEventArgs;
|
|
3369
|
+
} });
|
|
3370
|
+
var auth_1 = requireAuth();
|
|
3371
|
+
Object.defineProperty(exports$1, "canAccessProtectedFeatures", { enumerable: true, get: function() {
|
|
3372
|
+
return auth_1.canAccessProtectedFeatures;
|
|
3373
|
+
} });
|
|
3374
|
+
Object.defineProperty(exports$1, "extractNonceFromMessage", { enumerable: true, get: function() {
|
|
3375
|
+
return auth_1.extractNonceFromMessage;
|
|
3376
|
+
} });
|
|
3377
|
+
Object.defineProperty(exports$1, "generateAuthMessage", { enumerable: true, get: function() {
|
|
3378
|
+
return auth_1.generateAuthMessage;
|
|
3379
|
+
} });
|
|
3380
|
+
Object.defineProperty(exports$1, "generateNonce", { enumerable: true, get: function() {
|
|
3381
|
+
return auth_1.generateNonce;
|
|
3382
|
+
} });
|
|
3383
|
+
Object.defineProperty(exports$1, "getAuthStatusText", { enumerable: true, get: function() {
|
|
3384
|
+
return auth_1.getAuthStatusText;
|
|
3385
|
+
} });
|
|
3386
|
+
Object.defineProperty(exports$1, "isAuthExpired", { enumerable: true, get: function() {
|
|
3387
|
+
return auth_1.isAuthExpired;
|
|
3388
|
+
} });
|
|
3389
|
+
Object.defineProperty(exports$1, "isAuthStatusConnected", { enumerable: true, get: function() {
|
|
3390
|
+
return auth_1.isAuthStatusConnected;
|
|
3391
|
+
} });
|
|
3392
|
+
Object.defineProperty(exports$1, "isValidNonce", { enumerable: true, get: function() {
|
|
3393
|
+
return auth_1.isValidNonce;
|
|
3394
|
+
} });
|
|
3395
|
+
var admin_emails_1 = requireAdminEmails();
|
|
3396
|
+
Object.defineProperty(exports$1, "parseAdminEmails", { enumerable: true, get: function() {
|
|
3397
|
+
return admin_emails_1.parseAdminEmails;
|
|
3398
|
+
} });
|
|
3399
|
+
Object.defineProperty(exports$1, "isAdminEmail", { enumerable: true, get: function() {
|
|
3400
|
+
return admin_emails_1.isAdminEmail;
|
|
3401
|
+
} });
|
|
3402
|
+
Object.defineProperty(exports$1, "createAdminChecker", { enumerable: true, get: function() {
|
|
3403
|
+
return admin_emails_1.createAdminChecker;
|
|
3404
|
+
} });
|
|
3405
|
+
var currency_1 = requireCurrency();
|
|
3406
|
+
Object.defineProperty(exports$1, "CLAIM_PERIOD_DAYS", { enumerable: true, get: function() {
|
|
3407
|
+
return currency_1.CLAIM_PERIOD_DAYS;
|
|
3408
|
+
} });
|
|
3409
|
+
Object.defineProperty(exports$1, "USDC_DECIMALS", { enumerable: true, get: function() {
|
|
3410
|
+
return currency_1.USDC_DECIMALS;
|
|
3411
|
+
} });
|
|
3412
|
+
Object.defineProperty(exports$1, "formatUSDC", { enumerable: true, get: function() {
|
|
3413
|
+
return currency_1.formatUSDC;
|
|
3414
|
+
} });
|
|
3415
|
+
Object.defineProperty(exports$1, "parseUSDC", { enumerable: true, get: function() {
|
|
3416
|
+
return currency_1.parseUSDC;
|
|
3417
|
+
} });
|
|
3418
|
+
var date_1 = requireDate();
|
|
3419
|
+
Object.defineProperty(exports$1, "addDays", { enumerable: true, get: function() {
|
|
3420
|
+
return date_1.addDays;
|
|
3421
|
+
} });
|
|
3422
|
+
Object.defineProperty(exports$1, "addHours", { enumerable: true, get: function() {
|
|
3423
|
+
return date_1.addHours;
|
|
3424
|
+
} });
|
|
3425
|
+
Object.defineProperty(exports$1, "formatEmailDate", { enumerable: true, get: function() {
|
|
3426
|
+
return date_1.formatEmailDate;
|
|
3427
|
+
} });
|
|
3428
|
+
Object.defineProperty(exports$1, "formatRelativeTime", { enumerable: true, get: function() {
|
|
3429
|
+
return date_1.formatRelativeTime;
|
|
3430
|
+
} });
|
|
3431
|
+
Object.defineProperty(exports$1, "formatTimestamp", { enumerable: true, get: function() {
|
|
3432
|
+
return date_1.formatTimestamp;
|
|
3433
|
+
} });
|
|
3434
|
+
Object.defineProperty(exports$1, "isDateInRange", { enumerable: true, get: function() {
|
|
3435
|
+
return date_1.isDateInRange;
|
|
3436
|
+
} });
|
|
3437
|
+
Object.defineProperty(exports$1, "parseDate", { enumerable: true, get: function() {
|
|
3438
|
+
return date_1.parseDate;
|
|
3439
|
+
} });
|
|
3440
|
+
var string_1 = requireString();
|
|
3441
|
+
Object.defineProperty(exports$1, "capitalize", { enumerable: true, get: function() {
|
|
3442
|
+
return string_1.capitalize;
|
|
3443
|
+
} });
|
|
3444
|
+
Object.defineProperty(exports$1, "escapeHtml", { enumerable: true, get: function() {
|
|
3445
|
+
return string_1.escapeHtml;
|
|
3446
|
+
} });
|
|
3447
|
+
Object.defineProperty(exports$1, "formatBytes", { enumerable: true, get: function() {
|
|
3448
|
+
return string_1.formatBytes;
|
|
3449
|
+
} });
|
|
3450
|
+
Object.defineProperty(exports$1, "formatNumber", { enumerable: true, get: function() {
|
|
3451
|
+
return string_1.formatNumber;
|
|
3452
|
+
} });
|
|
3453
|
+
Object.defineProperty(exports$1, "getInitials", { enumerable: true, get: function() {
|
|
3454
|
+
return string_1.getInitials;
|
|
3455
|
+
} });
|
|
3456
|
+
Object.defineProperty(exports$1, "isBlank", { enumerable: true, get: function() {
|
|
3457
|
+
return string_1.isBlank;
|
|
3458
|
+
} });
|
|
3459
|
+
Object.defineProperty(exports$1, "isNotBlank", { enumerable: true, get: function() {
|
|
3460
|
+
return string_1.isNotBlank;
|
|
3461
|
+
} });
|
|
3462
|
+
Object.defineProperty(exports$1, "normalizeWhitespace", { enumerable: true, get: function() {
|
|
3463
|
+
return string_1.normalizeWhitespace;
|
|
3464
|
+
} });
|
|
3465
|
+
Object.defineProperty(exports$1, "pluralize", { enumerable: true, get: function() {
|
|
3466
|
+
return string_1.pluralize;
|
|
3467
|
+
} });
|
|
3468
|
+
Object.defineProperty(exports$1, "randomString", { enumerable: true, get: function() {
|
|
3469
|
+
return string_1.randomString;
|
|
3470
|
+
} });
|
|
3471
|
+
Object.defineProperty(exports$1, "stripHtml", { enumerable: true, get: function() {
|
|
3472
|
+
return string_1.stripHtml;
|
|
3473
|
+
} });
|
|
3474
|
+
Object.defineProperty(exports$1, "toCamelCase", { enumerable: true, get: function() {
|
|
3475
|
+
return string_1.toCamelCase;
|
|
3476
|
+
} });
|
|
3477
|
+
Object.defineProperty(exports$1, "toKebabCase", { enumerable: true, get: function() {
|
|
3478
|
+
return string_1.toKebabCase;
|
|
3479
|
+
} });
|
|
3480
|
+
Object.defineProperty(exports$1, "toSnakeCase", { enumerable: true, get: function() {
|
|
3481
|
+
return string_1.toSnakeCase;
|
|
3482
|
+
} });
|
|
3483
|
+
Object.defineProperty(exports$1, "toTitleCase", { enumerable: true, get: function() {
|
|
3484
|
+
return string_1.toTitleCase;
|
|
3485
|
+
} });
|
|
3486
|
+
Object.defineProperty(exports$1, "truncate", { enumerable: true, get: function() {
|
|
3487
|
+
return string_1.truncate;
|
|
3488
|
+
} });
|
|
3489
|
+
var application_1 = requireApplication();
|
|
3490
|
+
Object.defineProperty(exports$1, "API_TIMEOUT", { enumerable: true, get: function() {
|
|
3491
|
+
return application_1.API_TIMEOUT;
|
|
3492
|
+
} });
|
|
3493
|
+
Object.defineProperty(exports$1, "API_RETRY_ATTEMPTS", { enumerable: true, get: function() {
|
|
3494
|
+
return application_1.API_RETRY_ATTEMPTS;
|
|
3495
|
+
} });
|
|
3496
|
+
Object.defineProperty(exports$1, "API_RETRY_DELAY", { enumerable: true, get: function() {
|
|
3497
|
+
return application_1.API_RETRY_DELAY;
|
|
3498
|
+
} });
|
|
3499
|
+
Object.defineProperty(exports$1, "AUTH_STATUS", { enumerable: true, get: function() {
|
|
3500
|
+
return application_1.AUTH_STATUS;
|
|
3501
|
+
} });
|
|
3502
|
+
Object.defineProperty(exports$1, "CHAIN_TYPE", { enumerable: true, get: function() {
|
|
3503
|
+
return application_1.CHAIN_TYPE;
|
|
3504
|
+
} });
|
|
3505
|
+
Object.defineProperty(exports$1, "STORAGE_KEYS", { enumerable: true, get: function() {
|
|
3506
|
+
return application_1.STORAGE_KEYS;
|
|
3507
|
+
} });
|
|
3508
|
+
Object.defineProperty(exports$1, "EMAIL_CONFIG", { enumerable: true, get: function() {
|
|
3509
|
+
return application_1.EMAIL_CONFIG;
|
|
3510
|
+
} });
|
|
3511
|
+
Object.defineProperty(exports$1, "SUBSCRIPTION_TIERS", { enumerable: true, get: function() {
|
|
3512
|
+
return application_1.SUBSCRIPTION_TIERS;
|
|
3513
|
+
} });
|
|
3514
|
+
Object.defineProperty(exports$1, "TIME_FORMAT", { enumerable: true, get: function() {
|
|
3515
|
+
return application_1.TIME_FORMAT;
|
|
3516
|
+
} });
|
|
3517
|
+
Object.defineProperty(exports$1, "ERROR_MESSAGES", { enumerable: true, get: function() {
|
|
3518
|
+
return application_1.ERROR_MESSAGES;
|
|
3519
|
+
} });
|
|
3520
|
+
Object.defineProperty(exports$1, "SUCCESS_MESSAGES", { enumerable: true, get: function() {
|
|
3521
|
+
return application_1.SUCCESS_MESSAGES;
|
|
3522
|
+
} });
|
|
3523
|
+
Object.defineProperty(exports$1, "ROUTES", { enumerable: true, get: function() {
|
|
3524
|
+
return application_1.ROUTES;
|
|
3525
|
+
} });
|
|
3526
|
+
Object.defineProperty(exports$1, "CONTACT_INFO", { enumerable: true, get: function() {
|
|
3527
|
+
return application_1.CONTACT_INFO;
|
|
3528
|
+
} });
|
|
3529
|
+
Object.defineProperty(exports$1, "WALLET_NAMES", { enumerable: true, get: function() {
|
|
3530
|
+
return application_1.WALLET_NAMES;
|
|
3531
|
+
} });
|
|
3532
|
+
Object.defineProperty(exports$1, "NETWORK_IDS", { enumerable: true, get: function() {
|
|
3533
|
+
return application_1.NETWORK_IDS;
|
|
3534
|
+
} });
|
|
3535
|
+
Object.defineProperty(exports$1, "ANIMATION", { enumerable: true, get: function() {
|
|
3536
|
+
return application_1.ANIMATION;
|
|
3537
|
+
} });
|
|
3538
|
+
Object.defineProperty(exports$1, "Z_INDEX", { enumerable: true, get: function() {
|
|
3539
|
+
return application_1.Z_INDEX;
|
|
3540
|
+
} });
|
|
3541
|
+
var status_values_1 = requireStatusValues();
|
|
3542
|
+
Object.defineProperty(exports$1, "STATUS_VALUES", { enumerable: true, get: function() {
|
|
3543
|
+
return status_values_1.STATUS_VALUES;
|
|
3544
|
+
} });
|
|
3545
|
+
var logger_1 = requireLogger();
|
|
3546
|
+
Object.defineProperty(exports$1, "LogLevel", { enumerable: true, get: function() {
|
|
3547
|
+
return logger_1.LogLevel;
|
|
3548
|
+
} });
|
|
3549
|
+
Object.defineProperty(exports$1, "logger", { enumerable: true, get: function() {
|
|
3550
|
+
return logger_1.logger;
|
|
3551
|
+
} });
|
|
3552
|
+
Object.defineProperty(exports$1, "authLogger", { enumerable: true, get: function() {
|
|
3553
|
+
return logger_1.authLogger;
|
|
3554
|
+
} });
|
|
3555
|
+
Object.defineProperty(exports$1, "apiLogger", { enumerable: true, get: function() {
|
|
3556
|
+
return logger_1.apiLogger;
|
|
3557
|
+
} });
|
|
3558
|
+
Object.defineProperty(exports$1, "contractLogger", { enumerable: true, get: function() {
|
|
3559
|
+
return logger_1.contractLogger;
|
|
3560
|
+
} });
|
|
3561
|
+
Object.defineProperty(exports$1, "ensLogger", { enumerable: true, get: function() {
|
|
3562
|
+
return logger_1.ensLogger;
|
|
3563
|
+
} });
|
|
3564
|
+
Object.defineProperty(exports$1, "storageLogger", { enumerable: true, get: function() {
|
|
3565
|
+
return logger_1.storageLogger;
|
|
3566
|
+
} });
|
|
3567
|
+
var url_params_1 = requireUrlParams();
|
|
3568
|
+
Object.defineProperty(exports$1, "createURLSearchParams", { enumerable: true, get: function() {
|
|
3569
|
+
return url_params_1.createURLSearchParams;
|
|
3570
|
+
} });
|
|
3571
|
+
Object.defineProperty(exports$1, "createSearchParams", { enumerable: true, get: function() {
|
|
3572
|
+
return url_params_1.createSearchParams;
|
|
3573
|
+
} });
|
|
3574
|
+
Object.defineProperty(exports$1, "searchParamsToString", { enumerable: true, get: function() {
|
|
3575
|
+
return url_params_1.searchParamsToString;
|
|
3576
|
+
} });
|
|
3577
|
+
Object.defineProperty(exports$1, "parseSearchParams", { enumerable: true, get: function() {
|
|
3578
|
+
return url_params_1.parseSearchParams;
|
|
3579
|
+
} });
|
|
3580
|
+
var async_helpers_1 = requireAsyncHelpers();
|
|
3581
|
+
Object.defineProperty(exports$1, "safeAsync", { enumerable: true, get: function() {
|
|
3582
|
+
return async_helpers_1.safeAsync;
|
|
3583
|
+
} });
|
|
3584
|
+
Object.defineProperty(exports$1, "withLoadingState", { enumerable: true, get: function() {
|
|
3585
|
+
return async_helpers_1.withLoadingState;
|
|
3586
|
+
} });
|
|
3587
|
+
Object.defineProperty(exports$1, "safeParallel", { enumerable: true, get: function() {
|
|
3588
|
+
return async_helpers_1.safeParallel;
|
|
3589
|
+
} });
|
|
3590
|
+
Object.defineProperty(exports$1, "withTimeout", { enumerable: true, get: function() {
|
|
3591
|
+
return async_helpers_1.withTimeout;
|
|
3592
|
+
} });
|
|
3593
|
+
Object.defineProperty(exports$1, "withCache", { enumerable: true, get: function() {
|
|
3594
|
+
return async_helpers_1.withCache;
|
|
3595
|
+
} });
|
|
3596
|
+
Object.defineProperty(exports$1, "clearExpiredCache", { enumerable: true, get: function() {
|
|
3597
|
+
return async_helpers_1.clearExpiredCache;
|
|
3598
|
+
} });
|
|
3599
|
+
Object.defineProperty(exports$1, "debounceAsync", { enumerable: true, get: function() {
|
|
3600
|
+
return async_helpers_1.debounceAsync;
|
|
3601
|
+
} });
|
|
3602
|
+
})(dist);
|
|
3603
|
+
return dist;
|
|
3604
|
+
}
|
|
3605
|
+
var distExports = requireDist();
|
|
3606
|
+
const variantConfig = {
|
|
3607
|
+
[distExports.InfoType.INFO]: {
|
|
3608
|
+
icon: "ℹ",
|
|
3609
|
+
container: "bg-blue-50 dark:bg-blue-950 border-blue-200 dark:border-blue-800",
|
|
3610
|
+
iconColor: "text-blue-600 dark:text-blue-400",
|
|
3611
|
+
titleColor: "text-blue-900 dark:text-blue-100",
|
|
3612
|
+
descriptionColor: "text-blue-700 dark:text-blue-300"
|
|
3613
|
+
},
|
|
3614
|
+
[distExports.InfoType.SUCCESS]: {
|
|
3615
|
+
icon: "✓",
|
|
3616
|
+
container: "bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800",
|
|
3617
|
+
iconColor: "text-green-600 dark:text-green-400",
|
|
3618
|
+
titleColor: "text-green-900 dark:text-green-100",
|
|
3619
|
+
descriptionColor: "text-green-700 dark:text-green-300"
|
|
3620
|
+
},
|
|
3621
|
+
[distExports.InfoType.WARNING]: {
|
|
3622
|
+
icon: "⚠",
|
|
3623
|
+
container: "bg-yellow-50 dark:bg-amber-950 border-yellow-200 dark:border-amber-800",
|
|
3624
|
+
iconColor: "text-yellow-600 dark:text-amber-400",
|
|
3625
|
+
titleColor: "text-yellow-900 dark:text-amber-100",
|
|
3626
|
+
descriptionColor: "text-yellow-700 dark:text-amber-300"
|
|
3627
|
+
},
|
|
3628
|
+
[distExports.InfoType.ERROR]: {
|
|
3629
|
+
icon: "✗",
|
|
3630
|
+
container: "bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800",
|
|
3631
|
+
iconColor: "text-red-600 dark:text-red-400",
|
|
3632
|
+
titleColor: "text-red-900 dark:text-red-100",
|
|
3633
|
+
descriptionColor: "text-red-700 dark:text-red-300"
|
|
3634
|
+
}
|
|
3635
|
+
};
|
|
3636
|
+
const Banner = ({
|
|
3637
|
+
isVisible,
|
|
3638
|
+
onDismiss,
|
|
3639
|
+
title,
|
|
3640
|
+
description,
|
|
3641
|
+
variant = distExports.InfoType.INFO,
|
|
3642
|
+
duration = 5e3,
|
|
3643
|
+
icon,
|
|
3644
|
+
className,
|
|
3645
|
+
closeAccessibilityLabel = "Dismiss banner"
|
|
3646
|
+
}) => {
|
|
3647
|
+
const [mounted, setMounted] = React.useState(false);
|
|
3648
|
+
const slideAnim = React.useRef(new reactNative.Animated.Value(-100)).current;
|
|
3649
|
+
const opacityAnim = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
3650
|
+
const dismissTimeoutRef = React.useRef(null);
|
|
3651
|
+
const config = variantConfig[variant];
|
|
3652
|
+
const clearDismissTimeout = React.useCallback(() => {
|
|
3653
|
+
if (dismissTimeoutRef.current) {
|
|
3654
|
+
clearTimeout(dismissTimeoutRef.current);
|
|
3655
|
+
dismissTimeoutRef.current = null;
|
|
3656
|
+
}
|
|
3657
|
+
}, []);
|
|
3658
|
+
const handleDismiss = React.useCallback(() => {
|
|
3659
|
+
clearDismissTimeout();
|
|
3660
|
+
reactNative.Animated.parallel([
|
|
3661
|
+
reactNative.Animated.timing(slideAnim, {
|
|
3662
|
+
toValue: -100,
|
|
3663
|
+
duration: 300,
|
|
3664
|
+
useNativeDriver: true
|
|
3665
|
+
}),
|
|
3666
|
+
reactNative.Animated.timing(opacityAnim, {
|
|
3667
|
+
toValue: 0,
|
|
3668
|
+
duration: 300,
|
|
3669
|
+
useNativeDriver: true
|
|
3670
|
+
})
|
|
3671
|
+
]).start(() => {
|
|
3672
|
+
setMounted(false);
|
|
3673
|
+
onDismiss();
|
|
3674
|
+
});
|
|
3675
|
+
}, [clearDismissTimeout, slideAnim, opacityAnim, onDismiss]);
|
|
3676
|
+
React.useEffect(() => {
|
|
3677
|
+
if (isVisible) {
|
|
3678
|
+
setMounted(true);
|
|
3679
|
+
slideAnim.setValue(-100);
|
|
3680
|
+
opacityAnim.setValue(0);
|
|
3681
|
+
reactNative.Animated.parallel([
|
|
3682
|
+
reactNative.Animated.spring(slideAnim, {
|
|
3683
|
+
toValue: 0,
|
|
3684
|
+
useNativeDriver: true,
|
|
3685
|
+
friction: 8
|
|
3686
|
+
}),
|
|
3687
|
+
reactNative.Animated.timing(opacityAnim, {
|
|
3688
|
+
toValue: 1,
|
|
3689
|
+
duration: 300,
|
|
3690
|
+
useNativeDriver: true
|
|
3691
|
+
})
|
|
3692
|
+
]).start(() => {
|
|
3693
|
+
if (duration > 0) {
|
|
3694
|
+
dismissTimeoutRef.current = setTimeout(() => {
|
|
3695
|
+
handleDismiss();
|
|
3696
|
+
}, duration);
|
|
3697
|
+
}
|
|
3698
|
+
});
|
|
3699
|
+
} else if (mounted) {
|
|
3700
|
+
handleDismiss();
|
|
3701
|
+
}
|
|
3702
|
+
return () => clearDismissTimeout();
|
|
3703
|
+
}, [isVisible]);
|
|
3704
|
+
React.useEffect(() => {
|
|
3705
|
+
return () => clearDismissTimeout();
|
|
3706
|
+
}, [clearDismissTimeout]);
|
|
3707
|
+
if (!mounted) {
|
|
3708
|
+
return null;
|
|
3709
|
+
}
|
|
3710
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3711
|
+
reactNative.Animated.View,
|
|
3712
|
+
{
|
|
3713
|
+
style: {
|
|
3714
|
+
transform: [{ translateY: slideAnim }],
|
|
3715
|
+
opacity: opacityAnim
|
|
3716
|
+
},
|
|
3717
|
+
className: cn("absolute top-0 left-0 right-0 z-50", className),
|
|
3718
|
+
accessibilityRole: "alert",
|
|
3719
|
+
accessibilityLiveRegion: "polite",
|
|
3720
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
3721
|
+
reactNative.View,
|
|
3722
|
+
{
|
|
3723
|
+
className: cn(
|
|
3724
|
+
"flex-row items-start gap-3 p-4 border-b",
|
|
3725
|
+
config.container
|
|
3726
|
+
),
|
|
3727
|
+
children: [
|
|
3728
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-shrink-0 mt-0.5", children: icon || /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn("text-lg", config.iconColor), children: config.icon }) }),
|
|
3729
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-1 min-w-0", children: [
|
|
3730
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn("font-semibold", config.titleColor), children: title }),
|
|
3731
|
+
description ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn("text-sm mt-1", config.descriptionColor), children: description }) : null
|
|
3732
|
+
] }),
|
|
3733
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3734
|
+
reactNative.Pressable,
|
|
3735
|
+
{
|
|
3736
|
+
onPress: handleDismiss,
|
|
3737
|
+
className: "flex-shrink-0 p-1 rounded-md",
|
|
3738
|
+
accessibilityRole: "button",
|
|
3739
|
+
accessibilityLabel: closeAccessibilityLabel,
|
|
3740
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn("text-lg", config.iconColor), children: "✗" })
|
|
3741
|
+
}
|
|
3742
|
+
)
|
|
3743
|
+
]
|
|
3744
|
+
}
|
|
3745
|
+
)
|
|
3746
|
+
}
|
|
3747
|
+
);
|
|
3748
|
+
};
|
|
3749
|
+
const useBanner = (options = {}) => {
|
|
3750
|
+
const { defaultDuration = 5e3 } = options;
|
|
3751
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
3752
|
+
const [bannerProps, setBannerProps] = React.useState(null);
|
|
3753
|
+
const showBanner = React.useCallback(
|
|
3754
|
+
({
|
|
3755
|
+
title,
|
|
3756
|
+
description,
|
|
3757
|
+
variant = distExports.InfoType.INFO,
|
|
3758
|
+
duration = defaultDuration
|
|
3759
|
+
}) => {
|
|
3760
|
+
setBannerProps({ title, description, variant, duration });
|
|
3761
|
+
setIsVisible(true);
|
|
3762
|
+
},
|
|
3763
|
+
[defaultDuration]
|
|
3764
|
+
);
|
|
3765
|
+
const hideBanner = React.useCallback(() => {
|
|
3766
|
+
setIsVisible(false);
|
|
3767
|
+
}, []);
|
|
3768
|
+
return {
|
|
3769
|
+
isVisible,
|
|
3770
|
+
bannerProps,
|
|
3771
|
+
showBanner,
|
|
3772
|
+
hideBanner
|
|
3773
|
+
};
|
|
3774
|
+
};
|
|
956
3775
|
const mapSizeToVariantKey = (size) => {
|
|
957
3776
|
if (!size) return "default";
|
|
958
3777
|
const sizeMap2 = {
|
|
@@ -2133,7 +4952,7 @@ const HelperText = ({
|
|
|
2133
4952
|
sm: "w-4 h-4",
|
|
2134
4953
|
base: "w-5 h-5"
|
|
2135
4954
|
};
|
|
2136
|
-
const
|
|
4955
|
+
const variantConfig2 = {
|
|
2137
4956
|
default: {
|
|
2138
4957
|
text: "text-gray-600 dark:text-gray-400",
|
|
2139
4958
|
icon: "ℹ"
|
|
@@ -2151,7 +4970,7 @@ const HelperText = ({
|
|
|
2151
4970
|
icon: "⚠"
|
|
2152
4971
|
}
|
|
2153
4972
|
};
|
|
2154
|
-
const config =
|
|
4973
|
+
const config = variantConfig2[variant];
|
|
2155
4974
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: cn("flex flex-row items-start gap-1.5", className), children: [
|
|
2156
4975
|
showIcon && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn(iconSize[size], config.text, "mt-0.5"), children: config.icon }),
|
|
2157
4976
|
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn(sizeClasses[size], config.text), ...textProps, children })
|
|
@@ -3293,7 +6112,7 @@ const IconText = ({
|
|
|
3293
6112
|
const FormattedNumber = ({
|
|
3294
6113
|
value,
|
|
3295
6114
|
style = "decimal",
|
|
3296
|
-
currency = "USD",
|
|
6115
|
+
currency: currency2 = "USD",
|
|
3297
6116
|
minimumFractionDigits,
|
|
3298
6117
|
maximumFractionDigits,
|
|
3299
6118
|
locale = "en-US",
|
|
@@ -3309,7 +6128,7 @@ const FormattedNumber = ({
|
|
|
3309
6128
|
maximumFractionDigits
|
|
3310
6129
|
};
|
|
3311
6130
|
if (style === "currency") {
|
|
3312
|
-
options.currency =
|
|
6131
|
+
options.currency = currency2;
|
|
3313
6132
|
}
|
|
3314
6133
|
return new Intl.NumberFormat(locale, options).format(value);
|
|
3315
6134
|
} catch (error) {
|
|
@@ -3365,23 +6184,23 @@ const InfoBox = ({
|
|
|
3365
6184
|
md: "p-4",
|
|
3366
6185
|
lg: "p-6"
|
|
3367
6186
|
};
|
|
3368
|
-
const
|
|
6187
|
+
const variantConfig2 = variantClasses[variant];
|
|
3369
6188
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
3370
6189
|
reactNative.View,
|
|
3371
6190
|
{
|
|
3372
6191
|
className: cn(
|
|
3373
6192
|
"rounded-lg",
|
|
3374
|
-
|
|
3375
|
-
bordered && `border ${
|
|
6193
|
+
variantConfig2.bg,
|
|
6194
|
+
bordered && `border ${variantConfig2.border}`,
|
|
3376
6195
|
sizeClasses[size],
|
|
3377
6196
|
className
|
|
3378
6197
|
),
|
|
3379
6198
|
children: [
|
|
3380
6199
|
(title || icon) && /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex flex-row items-start gap-3 mb-2", children: [
|
|
3381
6200
|
icon,
|
|
3382
|
-
title && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn("font-semibold",
|
|
6201
|
+
title && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn("font-semibold", variantConfig2.title), children: title })
|
|
3383
6202
|
] }),
|
|
3384
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: cn(!title && !icon &&
|
|
6203
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: cn(!title && !icon && variantConfig2.text), children })
|
|
3385
6204
|
]
|
|
3386
6205
|
}
|
|
3387
6206
|
);
|
|
@@ -5293,23 +8112,23 @@ const Calendar = ({
|
|
|
5293
8112
|
className
|
|
5294
8113
|
}) => {
|
|
5295
8114
|
const [currentMonth, setCurrentMonth] = React.useState(value || /* @__PURE__ */ new Date());
|
|
5296
|
-
const getDaysInMonth = (
|
|
5297
|
-
const year =
|
|
5298
|
-
const month =
|
|
8115
|
+
const getDaysInMonth = (date2) => {
|
|
8116
|
+
const year = date2.getFullYear();
|
|
8117
|
+
const month = date2.getMonth();
|
|
5299
8118
|
return new Date(year, month + 1, 0).getDate();
|
|
5300
8119
|
};
|
|
5301
|
-
const getFirstDayOfMonth = (
|
|
5302
|
-
const year =
|
|
5303
|
-
const month =
|
|
8120
|
+
const getFirstDayOfMonth = (date2) => {
|
|
8121
|
+
const year = date2.getFullYear();
|
|
8122
|
+
const month = date2.getMonth();
|
|
5304
8123
|
return new Date(year, month, 1).getDay();
|
|
5305
8124
|
};
|
|
5306
8125
|
const isSameDay = (date1, date2) => {
|
|
5307
8126
|
return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
|
|
5308
8127
|
};
|
|
5309
|
-
const isDateDisabled = (
|
|
5310
|
-
if (minDate &&
|
|
5311
|
-
if (maxDate &&
|
|
5312
|
-
return disabledDates.some((disabledDate) => isSameDay(
|
|
8128
|
+
const isDateDisabled = (date2) => {
|
|
8129
|
+
if (minDate && date2 < minDate) return true;
|
|
8130
|
+
if (maxDate && date2 > maxDate) return true;
|
|
8131
|
+
return disabledDates.some((disabledDate) => isSameDay(date2, disabledDate));
|
|
5313
8132
|
};
|
|
5314
8133
|
const goToPreviousMonth = () => {
|
|
5315
8134
|
setCurrentMonth(
|
|
@@ -5350,9 +8169,9 @@ const Calendar = ({
|
|
|
5350
8169
|
};
|
|
5351
8170
|
const calendarDays = generateCalendarDays();
|
|
5352
8171
|
const weekDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
5353
|
-
const handleDayPress = (
|
|
5354
|
-
if (!
|
|
5355
|
-
onChange(
|
|
8172
|
+
const handleDayPress = (date2) => {
|
|
8173
|
+
if (!date2 || isDateDisabled(date2)) return;
|
|
8174
|
+
onChange(date2);
|
|
5356
8175
|
};
|
|
5357
8176
|
const monthYear = currentMonth.toLocaleDateString("en-US", {
|
|
5358
8177
|
month: "long",
|
|
@@ -5387,8 +8206,8 @@ const Calendar = ({
|
|
|
5387
8206
|
)
|
|
5388
8207
|
] }),
|
|
5389
8208
|
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-row mb-2", children: weekDays.map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-1 items-center py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs font-medium text-gray-600 dark:text-gray-400", children: day }) }, day)) }),
|
|
5390
|
-
weeks.map((week, weekIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-row", children: week.map((
|
|
5391
|
-
if (!
|
|
8209
|
+
weeks.map((week, weekIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-row", children: week.map((date2, dayIndex) => {
|
|
8210
|
+
if (!date2) {
|
|
5392
8211
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5393
8212
|
reactNative.View,
|
|
5394
8213
|
{
|
|
@@ -5397,14 +8216,14 @@ const Calendar = ({
|
|
|
5397
8216
|
`empty-${dayIndex}`
|
|
5398
8217
|
);
|
|
5399
8218
|
}
|
|
5400
|
-
const isCurrentMonth =
|
|
5401
|
-
const isSelected = value && isSameDay(
|
|
5402
|
-
const isToday = isSameDay(
|
|
5403
|
-
const isDisabled = isDateDisabled(
|
|
8219
|
+
const isCurrentMonth = date2.getMonth() === currentMonth.getMonth();
|
|
8220
|
+
const isSelected = value && isSameDay(date2, value);
|
|
8221
|
+
const isToday = isSameDay(date2, /* @__PURE__ */ new Date());
|
|
8222
|
+
const isDisabled = isDateDisabled(date2);
|
|
5404
8223
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5405
8224
|
reactNative.Pressable,
|
|
5406
8225
|
{
|
|
5407
|
-
onPress: () => handleDayPress(
|
|
8226
|
+
onPress: () => handleDayPress(date2),
|
|
5408
8227
|
disabled: isDisabled,
|
|
5409
8228
|
className: cn(
|
|
5410
8229
|
"flex-1 aspect-square items-center justify-center rounded-md m-0.5",
|
|
@@ -5414,7 +8233,7 @@ const Calendar = ({
|
|
|
5414
8233
|
isToday && !isSelected && "border-2 border-blue-600 dark:border-blue-400"
|
|
5415
8234
|
),
|
|
5416
8235
|
accessibilityRole: "button",
|
|
5417
|
-
accessibilityLabel:
|
|
8236
|
+
accessibilityLabel: date2.toLocaleDateString(),
|
|
5418
8237
|
accessibilityState: {
|
|
5419
8238
|
selected: isSelected,
|
|
5420
8239
|
disabled: isDisabled
|
|
@@ -5427,11 +8246,11 @@ const Calendar = ({
|
|
|
5427
8246
|
isCurrentMonth ? "text-gray-900 dark:text-white" : "text-gray-400 dark:text-gray-600",
|
|
5428
8247
|
isSelected && "text-white font-semibold"
|
|
5429
8248
|
),
|
|
5430
|
-
children:
|
|
8249
|
+
children: date2.getDate()
|
|
5431
8250
|
}
|
|
5432
8251
|
)
|
|
5433
8252
|
},
|
|
5434
|
-
`${
|
|
8253
|
+
`${date2.getTime()}-${dayIndex}`
|
|
5435
8254
|
);
|
|
5436
8255
|
}) }, weekIndex))
|
|
5437
8256
|
] });
|
|
@@ -6127,7 +8946,7 @@ const TimePicker = ({
|
|
|
6127
8946
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
6128
8947
|
const [internalHour, setInternalHour] = React.useState("12");
|
|
6129
8948
|
const [internalMinute, setInternalMinute] = React.useState("00");
|
|
6130
|
-
const [
|
|
8949
|
+
const [period2, setPeriod] = React.useState("AM");
|
|
6131
8950
|
React.useEffect(() => {
|
|
6132
8951
|
if (value) {
|
|
6133
8952
|
const [hours, minutes] = value.split(":");
|
|
@@ -6221,7 +9040,7 @@ const TimePicker = ({
|
|
|
6221
9040
|
handleTimeChange(
|
|
6222
9041
|
hour,
|
|
6223
9042
|
internalMinute,
|
|
6224
|
-
use12Hour ?
|
|
9043
|
+
use12Hour ? period2 : void 0
|
|
6225
9044
|
);
|
|
6226
9045
|
},
|
|
6227
9046
|
className: cn(
|
|
@@ -6253,7 +9072,7 @@ const TimePicker = ({
|
|
|
6253
9072
|
handleTimeChange(
|
|
6254
9073
|
internalHour,
|
|
6255
9074
|
minute,
|
|
6256
|
-
use12Hour ?
|
|
9075
|
+
use12Hour ? period2 : void 0
|
|
6257
9076
|
);
|
|
6258
9077
|
},
|
|
6259
9078
|
className: cn(
|
|
@@ -6292,14 +9111,14 @@ const TimePicker = ({
|
|
|
6292
9111
|
className: cn(
|
|
6293
9112
|
"px-3 py-2 rounded",
|
|
6294
9113
|
"active:bg-gray-100 dark:active:bg-gray-800",
|
|
6295
|
-
|
|
9114
|
+
period2 === "AM" && "bg-blue-100 dark:bg-blue-900/30"
|
|
6296
9115
|
),
|
|
6297
9116
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6298
9117
|
reactNative.Text,
|
|
6299
9118
|
{
|
|
6300
9119
|
className: cn(
|
|
6301
9120
|
"text-sm text-center",
|
|
6302
|
-
|
|
9121
|
+
period2 === "AM" ? "text-blue-700 dark:text-blue-300 font-medium" : "text-gray-900 dark:text-white"
|
|
6303
9122
|
),
|
|
6304
9123
|
children: "AM"
|
|
6305
9124
|
}
|
|
@@ -6320,14 +9139,14 @@ const TimePicker = ({
|
|
|
6320
9139
|
className: cn(
|
|
6321
9140
|
"px-3 py-2 rounded",
|
|
6322
9141
|
"active:bg-gray-100 dark:active:bg-gray-800",
|
|
6323
|
-
|
|
9142
|
+
period2 === "PM" && "bg-blue-100 dark:bg-blue-900/30"
|
|
6324
9143
|
),
|
|
6325
9144
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6326
9145
|
reactNative.Text,
|
|
6327
9146
|
{
|
|
6328
9147
|
className: cn(
|
|
6329
9148
|
"text-sm text-center",
|
|
6330
|
-
|
|
9149
|
+
period2 === "PM" ? "text-blue-700 dark:text-blue-300 font-medium" : "text-gray-900 dark:text-white"
|
|
6331
9150
|
),
|
|
6332
9151
|
children: "PM"
|
|
6333
9152
|
}
|
|
@@ -6581,16 +9400,16 @@ const TreeView = ({
|
|
|
6581
9400
|
};
|
|
6582
9401
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: cn("w-full", className), children: data.map((node) => renderNode(node, 0)) });
|
|
6583
9402
|
};
|
|
6584
|
-
const getExplorerUrl = (
|
|
9403
|
+
const getExplorerUrl = (address2, chainId, explorerUrl) => {
|
|
6585
9404
|
if (explorerUrl) {
|
|
6586
|
-
return `${explorerUrl}/address/${
|
|
9405
|
+
return `${explorerUrl}/address/${address2}`;
|
|
6587
9406
|
}
|
|
6588
9407
|
if (!chainId) {
|
|
6589
9408
|
return null;
|
|
6590
9409
|
}
|
|
6591
9410
|
if (chainId < 0) {
|
|
6592
9411
|
const cluster = chainId === -101 ? "" : chainId === -102 ? "?cluster=devnet" : "?cluster=testnet";
|
|
6593
|
-
return `https://explorer.solana.com/address/${
|
|
9412
|
+
return `https://explorer.solana.com/address/${address2}${cluster}`;
|
|
6594
9413
|
}
|
|
6595
9414
|
const explorerMap = {
|
|
6596
9415
|
1: "https://etherscan.io",
|
|
@@ -6609,19 +9428,19 @@ const getExplorerUrl = (address, chainId, explorerUrl) => {
|
|
|
6609
9428
|
if (!baseUrl) {
|
|
6610
9429
|
return null;
|
|
6611
9430
|
}
|
|
6612
|
-
return `${baseUrl}/address/${
|
|
9431
|
+
return `${baseUrl}/address/${address2}`;
|
|
6613
9432
|
};
|
|
6614
|
-
const formatAddress = (
|
|
9433
|
+
const formatAddress = (address2, format) => {
|
|
6615
9434
|
if (format === "full") {
|
|
6616
|
-
return
|
|
9435
|
+
return address2;
|
|
6617
9436
|
}
|
|
6618
9437
|
if (format === "medium") {
|
|
6619
|
-
return `${
|
|
9438
|
+
return `${address2.substring(0, 10)}...${address2.substring(address2.length - 8)}`;
|
|
6620
9439
|
}
|
|
6621
|
-
return `${
|
|
9440
|
+
return `${address2.substring(0, 6)}...${address2.substring(address2.length - 4)}`;
|
|
6622
9441
|
};
|
|
6623
9442
|
const AddressLink = ({
|
|
6624
|
-
address,
|
|
9443
|
+
address: address2,
|
|
6625
9444
|
chainId,
|
|
6626
9445
|
explorerUrl,
|
|
6627
9446
|
label,
|
|
@@ -6632,17 +9451,17 @@ const AddressLink = ({
|
|
|
6632
9451
|
className
|
|
6633
9452
|
}) => {
|
|
6634
9453
|
const [copied, setCopied] = React.useState(false);
|
|
6635
|
-
const formattedAddress = formatAddress(
|
|
6636
|
-
const explorerLink = getExplorerUrl(
|
|
9454
|
+
const formattedAddress = formatAddress(address2, format);
|
|
9455
|
+
const explorerLink = getExplorerUrl(address2, chainId, explorerUrl);
|
|
6637
9456
|
const handleCopy = React.useCallback(async () => {
|
|
6638
9457
|
if (!onCopy) return;
|
|
6639
9458
|
try {
|
|
6640
|
-
await onCopy(
|
|
9459
|
+
await onCopy(address2);
|
|
6641
9460
|
setCopied(true);
|
|
6642
9461
|
setTimeout(() => setCopied(false), 2e3);
|
|
6643
9462
|
} catch {
|
|
6644
9463
|
}
|
|
6645
|
-
}, [
|
|
9464
|
+
}, [address2, onCopy]);
|
|
6646
9465
|
const handleOpenExplorer = React.useCallback(() => {
|
|
6647
9466
|
if (explorerLink) {
|
|
6648
9467
|
reactNative.Linking.openURL(explorerLink);
|
|
@@ -6796,19 +9615,19 @@ const DateInput = ({
|
|
|
6796
9615
|
lg: "py-3 px-4 text-lg"
|
|
6797
9616
|
};
|
|
6798
9617
|
const dateValue = value instanceof Date ? value : value ? new Date(value) : null;
|
|
6799
|
-
const formatDisplay = (
|
|
6800
|
-
if (!
|
|
6801
|
-
return
|
|
9618
|
+
const formatDisplay = (date2) => {
|
|
9619
|
+
if (!date2) return "";
|
|
9620
|
+
return date2.toLocaleDateString("en-US", {
|
|
6802
9621
|
month: "short",
|
|
6803
9622
|
day: "numeric",
|
|
6804
9623
|
year: "numeric"
|
|
6805
9624
|
});
|
|
6806
9625
|
};
|
|
6807
9626
|
const handleDateChange = React.useCallback(
|
|
6808
|
-
(
|
|
6809
|
-
const year =
|
|
6810
|
-
const month = String(
|
|
6811
|
-
const day = String(
|
|
9627
|
+
(date2) => {
|
|
9628
|
+
const year = date2.getFullYear();
|
|
9629
|
+
const month = String(date2.getMonth() + 1).padStart(2, "0");
|
|
9630
|
+
const day = String(date2.getDate()).padStart(2, "0");
|
|
6812
9631
|
onChange(`${year}-${month}-${day}`);
|
|
6813
9632
|
setIsOpen(false);
|
|
6814
9633
|
},
|
|
@@ -6894,24 +9713,24 @@ const DateTimePicker = ({
|
|
|
6894
9713
|
}) => {
|
|
6895
9714
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
6896
9715
|
const [selectedDate, setSelectedDate] = React.useState(value);
|
|
6897
|
-
const formatDisplay = (
|
|
6898
|
-
const dateStr =
|
|
9716
|
+
const formatDisplay = (date2) => {
|
|
9717
|
+
const dateStr = date2.toLocaleDateString("en-US", {
|
|
6899
9718
|
month: "short",
|
|
6900
9719
|
day: "numeric",
|
|
6901
9720
|
year: "numeric"
|
|
6902
9721
|
});
|
|
6903
|
-
const hours =
|
|
6904
|
-
const minutes =
|
|
9722
|
+
const hours = date2.getHours();
|
|
9723
|
+
const minutes = date2.getMinutes();
|
|
6905
9724
|
if (use12Hour) {
|
|
6906
9725
|
const hour12 = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
|
|
6907
|
-
const
|
|
6908
|
-
return `${dateStr}, ${hour12}:${minutes.toString().padStart(2, "0")} ${
|
|
9726
|
+
const period2 = hours >= 12 ? "PM" : "AM";
|
|
9727
|
+
return `${dateStr}, ${hour12}:${minutes.toString().padStart(2, "0")} ${period2}`;
|
|
6909
9728
|
}
|
|
6910
9729
|
return `${dateStr}, ${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
|
|
6911
9730
|
};
|
|
6912
9731
|
const handleDateChange = React.useCallback(
|
|
6913
|
-
(
|
|
6914
|
-
const newDateTime = new Date(
|
|
9732
|
+
(date2) => {
|
|
9733
|
+
const newDateTime = new Date(date2);
|
|
6915
9734
|
newDateTime.setHours(selectedDate.getHours());
|
|
6916
9735
|
newDateTime.setMinutes(selectedDate.getMinutes());
|
|
6917
9736
|
setSelectedDate(newDateTime);
|
|
@@ -6928,9 +9747,9 @@ const DateTimePicker = ({
|
|
|
6928
9747
|
},
|
|
6929
9748
|
[selectedDate]
|
|
6930
9749
|
);
|
|
6931
|
-
const getTimeString = (
|
|
6932
|
-
const hours =
|
|
6933
|
-
const minutes =
|
|
9750
|
+
const getTimeString = (date2) => {
|
|
9751
|
+
const hours = date2.getHours();
|
|
9752
|
+
const minutes = date2.getMinutes();
|
|
6934
9753
|
return `${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
|
|
6935
9754
|
};
|
|
6936
9755
|
const handleClose = React.useCallback(() => {
|
|
@@ -9505,7 +12324,7 @@ const StatDisplay = ({
|
|
|
9505
12324
|
center: "items-center",
|
|
9506
12325
|
right: "items-end"
|
|
9507
12326
|
};
|
|
9508
|
-
const
|
|
12327
|
+
const variantConfig2 = variantClasses[variant];
|
|
9509
12328
|
const sizeConfig2 = sizeClasses[size];
|
|
9510
12329
|
if (iconPosition === "left" && icon) {
|
|
9511
12330
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -9517,25 +12336,25 @@ const StatDisplay = ({
|
|
|
9517
12336
|
className
|
|
9518
12337
|
),
|
|
9519
12338
|
children: [
|
|
9520
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className:
|
|
12339
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: variantConfig2.value, children: icon }),
|
|
9521
12340
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { children: [
|
|
9522
12341
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9523
12342
|
reactNative.Text,
|
|
9524
12343
|
{
|
|
9525
|
-
className: cn("font-bold", sizeConfig2.value,
|
|
12344
|
+
className: cn("font-bold", sizeConfig2.value, variantConfig2.value),
|
|
9526
12345
|
children: value
|
|
9527
12346
|
}
|
|
9528
12347
|
),
|
|
9529
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn(sizeConfig2.label,
|
|
12348
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn(sizeConfig2.label, variantConfig2.label), children: label })
|
|
9530
12349
|
] })
|
|
9531
12350
|
]
|
|
9532
12351
|
}
|
|
9533
12352
|
);
|
|
9534
12353
|
}
|
|
9535
12354
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: cn(alignClasses[align], className), children: [
|
|
9536
|
-
icon && iconPosition === "top" && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: cn("mb-2",
|
|
9537
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn("font-bold", sizeConfig2.value,
|
|
9538
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn(sizeConfig2.label,
|
|
12355
|
+
icon && iconPosition === "top" && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: cn("mb-2", variantConfig2.value), children: icon }),
|
|
12356
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn("font-bold", sizeConfig2.value, variantConfig2.value), children: value }),
|
|
12357
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: cn(sizeConfig2.label, variantConfig2.label), children: label })
|
|
9539
12358
|
] });
|
|
9540
12359
|
};
|
|
9541
12360
|
const KeyValuePair = ({
|
|
@@ -10198,6 +13017,7 @@ exports.Avatar = Avatar;
|
|
|
10198
13017
|
exports.AvatarGroup = AvatarGroup;
|
|
10199
13018
|
exports.Backdrop = Backdrop;
|
|
10200
13019
|
exports.Badge = Badge;
|
|
13020
|
+
exports.Banner = Banner;
|
|
10201
13021
|
exports.Box = Box;
|
|
10202
13022
|
exports.Breadcrumb = Breadcrumb;
|
|
10203
13023
|
exports.BreadcrumbNav = BreadcrumbNav;
|
|
@@ -10331,6 +13151,7 @@ exports.cn = cn;
|
|
|
10331
13151
|
exports.createFeature = createFeature;
|
|
10332
13152
|
exports.getButtonVariantClass = getButtonVariantClass;
|
|
10333
13153
|
exports.mapSizeToVariantKey = mapSizeToVariantKey;
|
|
13154
|
+
exports.useBanner = useBanner;
|
|
10334
13155
|
exports.useButtonState = useButtonState;
|
|
10335
13156
|
exports.useScrollSpy = useScrollSpy;
|
|
10336
13157
|
exports.useToast = useToast;
|