@dynamic-labs/wallet-book 0.0.0-exp20240808.0

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.
Files changed (117) hide show
  1. package/CHANGELOG.md +3746 -0
  2. package/LICENSE +21 -0
  3. package/README.md +142 -0
  4. package/_virtual/_tslib.cjs +49 -0
  5. package/_virtual/_tslib.js +44 -0
  6. package/package.json +38 -0
  7. package/src/build/index.d.ts +76 -0
  8. package/src/build/sources/firstParty/index.d.ts +2 -0
  9. package/src/build/sources/index.d.ts +4 -0
  10. package/src/build/sources/walletConnect/index.d.ts +128 -0
  11. package/src/build/sources/walletConnect/preprocessors.d.ts +14 -0
  12. package/src/build/sources/walletConnectOverrides/index.d.ts +197 -0
  13. package/src/build/sources/walletGroups/index.d.ts +2 -0
  14. package/src/components/BrandIcon.cjs +27 -0
  15. package/src/components/BrandIcon.d.ts +8 -0
  16. package/src/components/BrandIcon.js +23 -0
  17. package/src/components/WalletBookContext.cjs +14 -0
  18. package/src/components/WalletBookContext.d.ts +9 -0
  19. package/src/components/WalletBookContext.js +9 -0
  20. package/src/components/WalletIcon.cjs +34 -0
  21. package/src/components/WalletIcon.d.ts +8 -0
  22. package/src/components/WalletIcon.js +30 -0
  23. package/src/components/index.d.ts +3 -0
  24. package/src/helpers/findWalletBookWallet.cjs +18 -0
  25. package/src/helpers/findWalletBookWallet.d.ts +70 -0
  26. package/src/helpers/findWalletBookWallet.js +14 -0
  27. package/src/helpers/findWalletGroup.cjs +19 -0
  28. package/src/helpers/findWalletGroup.d.ts +18 -0
  29. package/src/helpers/findWalletGroup.js +15 -0
  30. package/src/helpers/findWalletGroupOverride.cjs +14 -0
  31. package/src/helpers/findWalletGroupOverride.d.ts +3 -0
  32. package/src/helpers/findWalletGroupOverride.js +10 -0
  33. package/src/helpers/getBrandIconUrl.cjs +15 -0
  34. package/src/helpers/getBrandIconUrl.d.ts +2 -0
  35. package/src/helpers/getBrandIconUrl.js +11 -0
  36. package/src/helpers/getWalletBookCdnUrl.cjs +14 -0
  37. package/src/helpers/getWalletBookCdnUrl.d.ts +1 -0
  38. package/src/helpers/getWalletBookCdnUrl.js +10 -0
  39. package/src/helpers/getWalletBookWallet.cjs +17 -0
  40. package/src/helpers/getWalletBookWallet.d.ts +2 -0
  41. package/src/helpers/getWalletBookWallet.js +13 -0
  42. package/src/helpers/getWalletGroup.cjs +13 -0
  43. package/src/helpers/getWalletGroup.d.ts +3 -0
  44. package/src/helpers/getWalletGroup.js +9 -0
  45. package/src/helpers/getWalletIconUrl.cjs +34 -0
  46. package/src/helpers/getWalletIconUrl.d.ts +3 -0
  47. package/src/helpers/getWalletIconUrl.js +29 -0
  48. package/src/helpers/getWalletLinks.cjs +34 -0
  49. package/src/helpers/getWalletLinks.d.ts +10 -0
  50. package/src/helpers/getWalletLinks.js +30 -0
  51. package/src/helpers/getWalletPrimaryColor.cjs +14 -0
  52. package/src/helpers/getWalletPrimaryColor.d.ts +2 -0
  53. package/src/helpers/getWalletPrimaryColor.js +10 -0
  54. package/src/helpers/index.d.ts +14 -0
  55. package/src/helpers/isWalletEventSupported.cjs +8 -0
  56. package/src/helpers/isWalletEventSupported.d.ts +2 -0
  57. package/src/helpers/isWalletEventSupported.js +4 -0
  58. package/src/helpers/isWalletMethodSupported.cjs +8 -0
  59. package/src/helpers/isWalletMethodSupported.d.ts +2 -0
  60. package/src/helpers/isWalletMethodSupported.js +4 -0
  61. package/src/helpers/logger.cjs +10 -0
  62. package/src/helpers/logger.d.ts +2 -0
  63. package/src/helpers/logger.js +6 -0
  64. package/src/helpers/renderTemplate.cjs +23 -0
  65. package/src/helpers/renderTemplate.d.ts +12 -0
  66. package/src/helpers/renderTemplate.js +19 -0
  67. package/src/hooks/index.d.ts +2 -0
  68. package/src/hooks/useWalletBookCdn.cjs +51 -0
  69. package/src/hooks/useWalletBookCdn.d.ts +88 -0
  70. package/src/hooks/useWalletBookCdn.js +47 -0
  71. package/src/hooks/useWalletBookContext.cjs +24 -0
  72. package/src/hooks/useWalletBookContext.d.ts +1 -0
  73. package/src/hooks/useWalletBookContext.js +20 -0
  74. package/src/index.cjs +44 -0
  75. package/src/index.d.ts +18 -0
  76. package/src/index.js +20 -0
  77. package/src/schemas/index.d.ts +3 -0
  78. package/src/schemas/utils/filterEmptyObject.cjs +13 -0
  79. package/src/schemas/utils/filterEmptyObject.d.ts +6 -0
  80. package/src/schemas/utils/filterEmptyObject.js +9 -0
  81. package/src/schemas/utils/nonEmptyString.cjs +13 -0
  82. package/src/schemas/utils/nonEmptyString.d.ts +5 -0
  83. package/src/schemas/utils/nonEmptyString.js +9 -0
  84. package/src/schemas/utils/nonEmptyStringArray.cjs +13 -0
  85. package/src/schemas/utils/nonEmptyStringArray.d.ts +5 -0
  86. package/src/schemas/utils/nonEmptyStringArray.js +9 -0
  87. package/src/schemas/utils/processWalletConnectNativeUrl.d.ts +1 -0
  88. package/src/schemas/utils/sortKeys.d.ts +5 -0
  89. package/src/schemas/utils/transformAndroidId.cjs +24 -0
  90. package/src/schemas/utils/transformAndroidId.d.ts +1 -0
  91. package/src/schemas/utils/transformAndroidId.js +20 -0
  92. package/src/schemas/utils/transformChromeExtensionId.cjs +21 -0
  93. package/src/schemas/utils/transformChromeExtensionId.d.ts +1 -0
  94. package/src/schemas/utils/transformChromeExtensionId.js +17 -0
  95. package/src/schemas/utils/transformEdgeExtensionId.cjs +21 -0
  96. package/src/schemas/utils/transformEdgeExtensionId.d.ts +1 -0
  97. package/src/schemas/utils/transformEdgeExtensionId.js +17 -0
  98. package/src/schemas/utils/transformFirefoxExtensionId.cjs +21 -0
  99. package/src/schemas/utils/transformFirefoxExtensionId.d.ts +1 -0
  100. package/src/schemas/utils/transformFirefoxExtensionId.js +17 -0
  101. package/src/schemas/utils/transformIosId.cjs +28 -0
  102. package/src/schemas/utils/transformIosId.d.ts +1 -0
  103. package/src/schemas/utils/transformIosId.js +24 -0
  104. package/src/schemas/walletBookSchema.cjs +17 -0
  105. package/src/schemas/walletBookSchema.d.ts +1369 -0
  106. package/src/schemas/walletBookSchema.js +13 -0
  107. package/src/schemas/walletConnectSourceSchema.cjs +78 -0
  108. package/src/schemas/walletConnectSourceSchema.d.ts +516 -0
  109. package/src/schemas/walletConnectSourceSchema.js +74 -0
  110. package/src/schemas/walletGroup.cjs +27 -0
  111. package/src/schemas/walletGroup.d.ts +113 -0
  112. package/src/schemas/walletGroup.js +23 -0
  113. package/src/schemas/walletSchema.cjs +141 -0
  114. package/src/schemas/walletSchema.d.ts +614 -0
  115. package/src/schemas/walletSchema.js +136 -0
  116. package/wallet-book-fallbacks.cjs +1082 -0
  117. package/wallet-book-fallbacks.js +1076 -0
package/src/index.cjs ADDED
@@ -0,0 +1,44 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var getWalletIconUrl = require('./helpers/getWalletIconUrl.cjs');
7
+ var getWalletBookWallet = require('./helpers/getWalletBookWallet.cjs');
8
+ var getWalletLinks = require('./helpers/getWalletLinks.cjs');
9
+ var getWalletPrimaryColor = require('./helpers/getWalletPrimaryColor.cjs');
10
+ require('./helpers/renderTemplate.cjs');
11
+ var findWalletBookWallet = require('./helpers/findWalletBookWallet.cjs');
12
+ require('./helpers/logger.cjs');
13
+ var getWalletGroup = require('./helpers/getWalletGroup.cjs');
14
+ var findWalletGroup = require('./helpers/findWalletGroup.cjs');
15
+ var getWalletBookCdnUrl = require('./helpers/getWalletBookCdnUrl.cjs');
16
+ var getBrandIconUrl = require('./helpers/getBrandIconUrl.cjs');
17
+ var findWalletGroupOverride = require('./helpers/findWalletGroupOverride.cjs');
18
+ var isWalletMethodSupported = require('./helpers/isWalletMethodSupported.cjs');
19
+ var isWalletEventSupported = require('./helpers/isWalletEventSupported.cjs');
20
+ var useWalletBookCdn = require('./hooks/useWalletBookCdn.cjs');
21
+ var useWalletBookContext = require('./hooks/useWalletBookContext.cjs');
22
+ var WalletIcon = require('./components/WalletIcon.cjs');
23
+ var WalletBookContext = require('./components/WalletBookContext.cjs');
24
+ var BrandIcon = require('./components/BrandIcon.cjs');
25
+
26
+
27
+
28
+ exports.getWalletIconUrl = getWalletIconUrl.getWalletIconUrl;
29
+ exports.getWalletBookWallet = getWalletBookWallet.getWalletBookWallet;
30
+ exports.getWalletLinks = getWalletLinks.getWalletLinks;
31
+ exports.getWalletPrimaryColor = getWalletPrimaryColor.getWalletPrimaryColor;
32
+ exports.findWalletBookWallet = findWalletBookWallet.findWalletBookWallet;
33
+ exports.getWalletGroup = getWalletGroup.getWalletGroup;
34
+ exports.findWalletGroup = findWalletGroup.findWalletGroup;
35
+ exports.getWalletBookCdnUrl = getWalletBookCdnUrl.getWalletBookCdnUrl;
36
+ exports.getBrandIconUrl = getBrandIconUrl.getBrandIconUrl;
37
+ exports.findWalletGroupOverride = findWalletGroupOverride.findWalletGroupOverride;
38
+ exports.isWalletMethodSupported = isWalletMethodSupported.isWalletMethodSupported;
39
+ exports.isWalletEventSupported = isWalletEventSupported.isWalletEventSupported;
40
+ exports.useWalletBookCdn = useWalletBookCdn.useWalletBookCdn;
41
+ exports.useWalletBookContext = useWalletBookContext.useWalletBookContext;
42
+ exports.WalletIcon = WalletIcon.WalletIcon;
43
+ exports.WalletBookContextProvider = WalletBookContext.WalletBookContextProvider;
44
+ exports.BrandIcon = BrandIcon.BrandIcon;
package/src/index.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * TYPES
3
+ */
4
+ export type { WalletBookSchema, WalletRecordsSchema, } from './schemas/walletBookSchema';
5
+ export type { WalletSchema } from './schemas/walletSchema';
6
+ export type { WalletLinks } from './helpers';
7
+ /**
8
+ * HELPERS
9
+ */
10
+ export { getWalletBookWallet, getWalletIconUrl, getWalletLinks, getWalletPrimaryColor, getWalletGroup, getWalletBookCdnUrl, findWalletBookWallet, findWalletGroup, getBrandIconUrl, findWalletGroupOverride, isWalletMethodSupported, isWalletEventSupported, } from './helpers';
11
+ /**
12
+ * HOOKS
13
+ */
14
+ export { useWalletBookCdn, useWalletBookContext } from './hooks';
15
+ /**
16
+ * COMPONENTS
17
+ */
18
+ export { WalletIcon, WalletBookContextProvider, BrandIcon } from './components';
package/src/index.js ADDED
@@ -0,0 +1,20 @@
1
+ 'use client'
2
+ export { getWalletIconUrl } from './helpers/getWalletIconUrl.js';
3
+ export { getWalletBookWallet } from './helpers/getWalletBookWallet.js';
4
+ export { getWalletLinks } from './helpers/getWalletLinks.js';
5
+ export { getWalletPrimaryColor } from './helpers/getWalletPrimaryColor.js';
6
+ import './helpers/renderTemplate.js';
7
+ export { findWalletBookWallet } from './helpers/findWalletBookWallet.js';
8
+ import './helpers/logger.js';
9
+ export { getWalletGroup } from './helpers/getWalletGroup.js';
10
+ export { findWalletGroup } from './helpers/findWalletGroup.js';
11
+ export { getWalletBookCdnUrl } from './helpers/getWalletBookCdnUrl.js';
12
+ export { getBrandIconUrl } from './helpers/getBrandIconUrl.js';
13
+ export { findWalletGroupOverride } from './helpers/findWalletGroupOverride.js';
14
+ export { isWalletMethodSupported } from './helpers/isWalletMethodSupported.js';
15
+ export { isWalletEventSupported } from './helpers/isWalletEventSupported.js';
16
+ export { useWalletBookCdn } from './hooks/useWalletBookCdn.js';
17
+ export { useWalletBookContext } from './hooks/useWalletBookContext.js';
18
+ export { WalletIcon } from './components/WalletIcon.js';
19
+ export { WalletBookContextProvider } from './components/WalletBookContext.js';
20
+ export { BrandIcon } from './components/BrandIcon.js';
@@ -0,0 +1,3 @@
1
+ export * from './walletConnectSourceSchema';
2
+ export * from './walletBookSchema';
3
+ export * from './walletSchema';
@@ -0,0 +1,13 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ /**
7
+ * Returns undefined if an object values are all nullish
8
+ * @param val object
9
+ * @returns
10
+ */
11
+ const filterEmptyObject = (val) => val && Object.values(val).some((x) => Boolean(x)) ? val : undefined;
12
+
13
+ exports.filterEmptyObject = filterEmptyObject;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns undefined if an object values are all nullish
3
+ * @param val object
4
+ * @returns
5
+ */
6
+ export declare const filterEmptyObject: <T>(val: T) => T | undefined;
@@ -0,0 +1,9 @@
1
+ 'use client'
2
+ /**
3
+ * Returns undefined if an object values are all nullish
4
+ * @param val object
5
+ * @returns
6
+ */
7
+ const filterEmptyObject = (val) => val && Object.values(val).some((x) => Boolean(x)) ? val : undefined;
8
+
9
+ export { filterEmptyObject };
@@ -0,0 +1,13 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var zod = require('zod');
7
+
8
+ /**
9
+ * A zod type to ensure a string is not empty
10
+ */
11
+ const nonEmptyString = zod.z.preprocess((val) => (val ? val : undefined), zod.z.string().optional());
12
+
13
+ exports.nonEmptyString = nonEmptyString;
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A zod type to ensure a string is not empty
4
+ */
5
+ export declare const nonEmptyString: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
@@ -0,0 +1,9 @@
1
+ 'use client'
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * A zod type to ensure a string is not empty
6
+ */
7
+ const nonEmptyString = z.preprocess((val) => (val ? val : undefined), z.string().optional());
8
+
9
+ export { nonEmptyString };
@@ -0,0 +1,13 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var zod = require('zod');
7
+
8
+ /**
9
+ * A zod type to ensure an array is not empty
10
+ */
11
+ const nonEmptyStringArray = zod.z.preprocess((val) => (Array.isArray(val) && val.length > 0 ? val : undefined), zod.z.array(zod.z.string()).optional());
12
+
13
+ exports.nonEmptyStringArray = nonEmptyStringArray;
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A zod type to ensure an array is not empty
4
+ */
5
+ export declare const nonEmptyStringArray: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodString, "many">>, string[] | undefined, unknown>;
@@ -0,0 +1,9 @@
1
+ 'use client'
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * A zod type to ensure an array is not empty
6
+ */
7
+ const nonEmptyStringArray = z.preprocess((val) => (Array.isArray(val) && val.length > 0 ? val : undefined), z.array(z.string()).optional());
8
+
9
+ export { nonEmptyStringArray };
@@ -0,0 +1 @@
1
+ export declare const processWalletConnectNativeUrl: (url: string) => string | undefined;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Sorts an object by key
3
+ * @param val object
4
+ */
5
+ export declare const sortKeys: (val: Record<string, unknown>) => Record<string, unknown>;
@@ -0,0 +1,24 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const transformAndroidId = (url) => {
7
+ if (!(url === null || url === void 0 ? void 0 : url.match(/^https?:\/\//)))
8
+ return url;
9
+ if (!url)
10
+ return;
11
+ try {
12
+ const urlObject = new URL(url);
13
+ const id = urlObject.searchParams.get('id');
14
+ if (id) {
15
+ return id;
16
+ }
17
+ }
18
+ catch (_a) {
19
+ // ignore
20
+ }
21
+ return;
22
+ };
23
+
24
+ exports.transformAndroidId = transformAndroidId;
@@ -0,0 +1 @@
1
+ export declare const transformAndroidId: (url: string | undefined) => string | undefined;
@@ -0,0 +1,20 @@
1
+ 'use client'
2
+ const transformAndroidId = (url) => {
3
+ if (!(url === null || url === void 0 ? void 0 : url.match(/^https?:\/\//)))
4
+ return url;
5
+ if (!url)
6
+ return;
7
+ try {
8
+ const urlObject = new URL(url);
9
+ const id = urlObject.searchParams.get('id');
10
+ if (id) {
11
+ return id;
12
+ }
13
+ }
14
+ catch (_a) {
15
+ // ignore
16
+ }
17
+ return;
18
+ };
19
+
20
+ export { transformAndroidId };
@@ -0,0 +1,21 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const transformChromeExtensionId = (url) => {
7
+ if (url === null || url === void 0 ? void 0 : url.match(/^[a-z]{32}$/))
8
+ return url;
9
+ if (url === null || url === void 0 ? void 0 : url.includes('chrome.google.com/webstore/detail/')) {
10
+ try {
11
+ const urlObject = new URL(url);
12
+ return urlObject.pathname.split('/').at(-1);
13
+ }
14
+ catch (_a) {
15
+ // ignore
16
+ }
17
+ }
18
+ return;
19
+ };
20
+
21
+ exports.transformChromeExtensionId = transformChromeExtensionId;
@@ -0,0 +1 @@
1
+ export declare const transformChromeExtensionId: (url: string | undefined) => string | undefined;
@@ -0,0 +1,17 @@
1
+ 'use client'
2
+ const transformChromeExtensionId = (url) => {
3
+ if (url === null || url === void 0 ? void 0 : url.match(/^[a-z]{32}$/))
4
+ return url;
5
+ if (url === null || url === void 0 ? void 0 : url.includes('chrome.google.com/webstore/detail/')) {
6
+ try {
7
+ const urlObject = new URL(url);
8
+ return urlObject.pathname.split('/').at(-1);
9
+ }
10
+ catch (_a) {
11
+ // ignore
12
+ }
13
+ }
14
+ return;
15
+ };
16
+
17
+ export { transformChromeExtensionId };
@@ -0,0 +1,21 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const transformEdgeExtensionId = (url) => {
7
+ if (url === null || url === void 0 ? void 0 : url.match(/^[a-z]{32}$/))
8
+ return url;
9
+ if (url === null || url === void 0 ? void 0 : url.includes('microsoftedge.microsoft.com/addons/detail/')) {
10
+ try {
11
+ const urlObject = new URL(url);
12
+ return urlObject.pathname.split('/').at(-1);
13
+ }
14
+ catch (_a) {
15
+ // ignore
16
+ }
17
+ }
18
+ return;
19
+ };
20
+
21
+ exports.transformEdgeExtensionId = transformEdgeExtensionId;
@@ -0,0 +1 @@
1
+ export declare const transformEdgeExtensionId: (url: string | undefined) => string | undefined;
@@ -0,0 +1,17 @@
1
+ 'use client'
2
+ const transformEdgeExtensionId = (url) => {
3
+ if (url === null || url === void 0 ? void 0 : url.match(/^[a-z]{32}$/))
4
+ return url;
5
+ if (url === null || url === void 0 ? void 0 : url.includes('microsoftedge.microsoft.com/addons/detail/')) {
6
+ try {
7
+ const urlObject = new URL(url);
8
+ return urlObject.pathname.split('/').at(-1);
9
+ }
10
+ catch (_a) {
11
+ // ignore
12
+ }
13
+ }
14
+ return;
15
+ };
16
+
17
+ export { transformEdgeExtensionId };
@@ -0,0 +1,21 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const transformFirefoxExtensionId = (url) => {
7
+ if (!(url === null || url === void 0 ? void 0 : url.match(/^https?:\/\//)))
8
+ return url;
9
+ if (url === null || url === void 0 ? void 0 : url.includes('addons.mozilla.org')) {
10
+ try {
11
+ const urlObject = new URL(url);
12
+ return urlObject.pathname.replace(/\/$/, '').split('/').at(-1);
13
+ }
14
+ catch (_a) {
15
+ // ignore
16
+ }
17
+ }
18
+ return;
19
+ };
20
+
21
+ exports.transformFirefoxExtensionId = transformFirefoxExtensionId;
@@ -0,0 +1 @@
1
+ export declare const transformFirefoxExtensionId: (url: string | undefined) => string | undefined;
@@ -0,0 +1,17 @@
1
+ 'use client'
2
+ const transformFirefoxExtensionId = (url) => {
3
+ if (!(url === null || url === void 0 ? void 0 : url.match(/^https?:\/\//)))
4
+ return url;
5
+ if (url === null || url === void 0 ? void 0 : url.includes('addons.mozilla.org')) {
6
+ try {
7
+ const urlObject = new URL(url);
8
+ return urlObject.pathname.replace(/\/$/, '').split('/').at(-1);
9
+ }
10
+ catch (_a) {
11
+ // ignore
12
+ }
13
+ }
14
+ return;
15
+ };
16
+
17
+ export { transformFirefoxExtensionId };
@@ -0,0 +1,28 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const idRegex = /^id[0-9]{1,36}$/;
7
+ const transformIosId = (url) => {
8
+ if (url === null || url === void 0 ? void 0 : url.match(idRegex))
9
+ return url;
10
+ if (url === null || url === void 0 ? void 0 : url.match(/^https:\/\/[a-zA-Z0-9-]+\.apple\.com/)) {
11
+ try {
12
+ const urlObject = new URL(url);
13
+ const expectedId = urlObject.pathname
14
+ .replace(/\/$/, '')
15
+ .split('/')
16
+ .at(-1);
17
+ if (expectedId === null || expectedId === void 0 ? void 0 : expectedId.match(idRegex)) {
18
+ return expectedId;
19
+ }
20
+ }
21
+ catch (_a) {
22
+ // ignore
23
+ }
24
+ }
25
+ return;
26
+ };
27
+
28
+ exports.transformIosId = transformIosId;
@@ -0,0 +1 @@
1
+ export declare const transformIosId: (url: string | undefined) => string | undefined;
@@ -0,0 +1,24 @@
1
+ 'use client'
2
+ const idRegex = /^id[0-9]{1,36}$/;
3
+ const transformIosId = (url) => {
4
+ if (url === null || url === void 0 ? void 0 : url.match(idRegex))
5
+ return url;
6
+ if (url === null || url === void 0 ? void 0 : url.match(/^https:\/\/[a-zA-Z0-9-]+\.apple\.com/)) {
7
+ try {
8
+ const urlObject = new URL(url);
9
+ const expectedId = urlObject.pathname
10
+ .replace(/\/$/, '')
11
+ .split('/')
12
+ .at(-1);
13
+ if (expectedId === null || expectedId === void 0 ? void 0 : expectedId.match(idRegex)) {
14
+ return expectedId;
15
+ }
16
+ }
17
+ catch (_a) {
18
+ // ignore
19
+ }
20
+ }
21
+ return;
22
+ };
23
+
24
+ export { transformIosId };
@@ -0,0 +1,17 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var zod = require('zod');
7
+ var walletSchema = require('./walletSchema.cjs');
8
+ var walletGroup = require('./walletGroup.cjs');
9
+
10
+ zod.z.record(zod.z.string(), walletSchema.walletSchema);
11
+ const walletBookSchema = zod.z.preprocess((val) => val, zod.z.object({
12
+ groups: zod.z.record(zod.z.string(), walletGroup.walletGroupSchema),
13
+ wallets: zod.z.record(zod.z.string(), walletSchema.walletSchema),
14
+ }));
15
+ zod.z.record(zod.z.string(), walletGroup.walletGroupSchema);
16
+
17
+ exports.walletBookSchema = walletBookSchema;