@kheopskit/core 5.0.1 → 5.1.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 (58) hide show
  1. package/dist/{chunk-7QSGAJ4A.mjs → chunk-3Y5N4N3Q.mjs} +119 -62
  2. package/dist/chunk-3Y5N4N3Q.mjs.map +1 -0
  3. package/dist/chunk-DF7EKK4G.mjs +106 -0
  4. package/dist/chunk-DF7EKK4G.mjs.map +1 -0
  5. package/dist/chunk-EH73P476.js +106 -0
  6. package/dist/chunk-EH73P476.js.map +1 -0
  7. package/dist/chunk-JVSCMJY5.mjs +147 -0
  8. package/dist/chunk-JVSCMJY5.mjs.map +1 -0
  9. package/dist/chunk-P7BPHHVV.js +76 -0
  10. package/dist/chunk-P7BPHHVV.js.map +1 -0
  11. package/dist/{chunk-4ENHC7G4.js → chunk-SO64R7Z6.js} +114 -57
  12. package/dist/chunk-SO64R7Z6.js.map +1 -0
  13. package/dist/chunk-WOPCW2OX.mjs +76 -0
  14. package/dist/chunk-WOPCW2OX.mjs.map +1 -0
  15. package/dist/chunk-XOGQMEV2.js +147 -0
  16. package/dist/chunk-XOGQMEV2.js.map +1 -0
  17. package/dist/ethereum.d.mts +2 -2
  18. package/dist/ethereum.d.ts +2 -2
  19. package/dist/ethereum.js +55 -115
  20. package/dist/ethereum.js.map +1 -1
  21. package/dist/ethereum.mjs +55 -115
  22. package/dist/ethereum.mjs.map +1 -1
  23. package/dist/index.d.mts +59 -3
  24. package/dist/index.d.ts +59 -3
  25. package/dist/index.js +442 -61
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +429 -48
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/internal.d.mts +2 -39
  30. package/dist/internal.d.ts +2 -39
  31. package/dist/internal.js +3 -15
  32. package/dist/internal.js.map +1 -1
  33. package/dist/internal.mjs +6 -18
  34. package/dist/polkadot.d.mts +2 -2
  35. package/dist/polkadot.d.ts +2 -2
  36. package/dist/polkadot.js +75 -148
  37. package/dist/polkadot.js.map +1 -1
  38. package/dist/polkadot.mjs +76 -149
  39. package/dist/polkadot.mjs.map +1 -1
  40. package/dist/solana.d.mts +2 -2
  41. package/dist/solana.d.ts +2 -2
  42. package/dist/solana.js +90 -158
  43. package/dist/solana.js.map +1 -1
  44. package/dist/solana.mjs +86 -154
  45. package/dist/solana.mjs.map +1 -1
  46. package/dist/{types-C7V7DGlg.d.ts → types-0iDBydsK.d.mts} +24 -46
  47. package/dist/{types-C7V7DGlg.d.mts → types-0iDBydsK.d.ts} +24 -46
  48. package/package.json +1 -1
  49. package/dist/chunk-4ENHC7G4.js.map +0 -1
  50. package/dist/chunk-6XAZANB5.mjs +0 -450
  51. package/dist/chunk-6XAZANB5.mjs.map +0 -1
  52. package/dist/chunk-7QSGAJ4A.mjs.map +0 -1
  53. package/dist/chunk-B4L6GAYD.js +0 -179
  54. package/dist/chunk-B4L6GAYD.js.map +0 -1
  55. package/dist/chunk-XQWJM3KC.js +0 -450
  56. package/dist/chunk-XQWJM3KC.js.map +0 -1
  57. package/dist/chunk-YDLCHYHH.mjs +0 -179
  58. package/dist/chunk-YDLCHYHH.mjs.map +0 -1
@@ -1,179 +0,0 @@
1
- import {
2
- POLKADOT_EXTENSIONS
3
- } from "./chunk-BWUUHUDK.mjs";
4
- import {
5
- isWalletConnectWallet,
6
- parseWalletId,
7
- safeLocalStorage
8
- } from "./chunk-7QSGAJ4A.mjs";
9
-
10
- // src/utils/hydrateState.ts
11
- var lookupWalletIcon = (platform, identifier) => {
12
- if (platform === "polkadot") {
13
- return POLKADOT_EXTENSIONS[identifier]?.icon ?? "";
14
- }
15
- return "";
16
- };
17
- var PendingWalletError = class extends Error {
18
- constructor(walletId) {
19
- super(
20
- `Wallet ${walletId} is still loading. Wait for isHydrating to be false before calling connect/disconnect.`
21
- );
22
- this.name = "PendingWalletError";
23
- }
24
- };
25
- var hydrateWallet = (cached) => {
26
- const throwPending = () => {
27
- throw new PendingWalletError(cached.id);
28
- };
29
- if (cached.type === "walletconnect") {
30
- return {
31
- id: cached.id,
32
- type: "walletconnect",
33
- platforms: [],
34
- name: cached.name,
35
- icon: "",
36
- isConnected: cached.isConnected,
37
- connect: throwPending,
38
- disconnect: throwPending
39
- };
40
- }
41
- const { platform, identifier } = parseWalletId(cached.id);
42
- return {
43
- id: cached.id,
44
- platform: cached.platform,
45
- type: cached.type,
46
- name: cached.name,
47
- icon: lookupWalletIcon(platform, identifier),
48
- isConnected: cached.isConnected,
49
- connect: throwPending,
50
- disconnect: throwPending
51
- };
52
- };
53
- var hydrateAccount = (cached) => ({
54
- id: cached.id,
55
- platform: cached.platform,
56
- address: cached.address,
57
- name: cached.name,
58
- walletId: cached.walletId,
59
- walletName: cached.walletName,
60
- // Spread (not direct keys) so the extra platform fields don't trip the
61
- // excess-property check against BaseWalletAccount; they're read back via the
62
- // platform-specific account types once narrowed by `platform`.
63
- ...cached.platform === "ethereum" && { chainId: cached.chainId },
64
- ...cached.platform === "polkadot" && {
65
- type: cached.polkadotAccountType
66
- }
67
- });
68
- var serializeWallet = (wallet) => ({
69
- id: wallet.id,
70
- // The WalletConnect connector has no platform.
71
- platform: isWalletConnectWallet(wallet) ? void 0 : wallet.platform,
72
- type: wallet.type,
73
- name: wallet.name,
74
- // Note: icon is NOT stored to save cookie space
75
- isConnected: wallet.isConnected
76
- });
77
- var serializeAccount = (account) => ({
78
- id: account.id,
79
- platform: account.platform,
80
- address: account.address,
81
- name: account.name,
82
- chainId: account.platform === "ethereum" ? account.chainId : void 0,
83
- polkadotAccountType: account.platform === "polkadot" ? account.type : void 0,
84
- walletId: account.walletId,
85
- walletName: account.walletName
86
- });
87
-
88
- // src/utils/iconCache.ts
89
- var ICON_CACHE_KEY = "kheopskit-icons";
90
- var memoryCache = null;
91
- var loadCache = () => {
92
- if (memoryCache !== null) return memoryCache;
93
- try {
94
- const stored = safeLocalStorage.getItem(ICON_CACHE_KEY);
95
- memoryCache = stored ? JSON.parse(stored) : {};
96
- } catch {
97
- memoryCache = {};
98
- }
99
- return memoryCache;
100
- };
101
- var saveCache = (cache) => {
102
- try {
103
- safeLocalStorage.setItem(ICON_CACHE_KEY, JSON.stringify(cache));
104
- memoryCache = cache;
105
- } catch {
106
- }
107
- };
108
- var getCachedIcon = (walletId) => {
109
- const cache = loadCache();
110
- return cache[walletId] || void 0;
111
- };
112
- var setCachedIcons = (icons) => {
113
- const cache = loadCache();
114
- let changed = false;
115
- for (const [walletId, icon] of Object.entries(icons)) {
116
- if (icon && cache[walletId] !== icon) {
117
- cache[walletId] = icon;
118
- changed = true;
119
- }
120
- }
121
- if (changed) {
122
- saveCache(cache);
123
- }
124
- };
125
-
126
- // src/utils/sortAccounts.ts
127
- var PLATFORM_ORDER = {
128
- polkadot: 0,
129
- ethereum: 1,
130
- solana: 2
131
- };
132
- var byWalletName = (a1, a2) => {
133
- if (a1.walletName.toLowerCase() === "talisman") return -1;
134
- if (a2.walletName.toLowerCase() === "talisman") return 1;
135
- return a1.walletName.localeCompare(a2.walletName);
136
- };
137
- var sortAccounts = (a1, a2) => {
138
- if (a1.platform !== a2.platform)
139
- return PLATFORM_ORDER[a1.platform] - PLATFORM_ORDER[a2.platform];
140
- if (a1.walletName !== a2.walletName) return byWalletName(a1, a2);
141
- if (a1.platform === "polkadot" && a2.platform === "polkadot")
142
- return a1.name !== a2.name ? (a1.name ?? "").localeCompare(a2.name ?? "") : a1.address.localeCompare(a2.address);
143
- return a1.id.localeCompare(a2.id);
144
- };
145
-
146
- // src/utils/sortWallets.ts
147
- var PLATFORM_ORDER2 = {
148
- polkadot: 0,
149
- ethereum: 1,
150
- solana: 2
151
- };
152
- var orderOf = (wallet) => isWalletConnectWallet(wallet) ? 3 : PLATFORM_ORDER2[wallet.platform];
153
- var sortWallets = (w1, w2) => {
154
- const o1 = orderOf(w1);
155
- const o2 = orderOf(w2);
156
- if (o1 !== o2) return o1 - o2;
157
- if (w1.name.toLowerCase() === "talisman") return -1;
158
- if (w2.name.toLowerCase() === "talisman") return 1;
159
- return w1.name.localeCompare(w2.name);
160
- };
161
-
162
- // src/api/platform.ts
163
- var acceptsCachedAccount = (cached, platforms) => {
164
- const plugin = platforms.find((p) => p.platform === cached.platform);
165
- return plugin?.acceptsCachedAccount?.(cached) ?? true;
166
- };
167
-
168
- export {
169
- hydrateWallet,
170
- hydrateAccount,
171
- serializeWallet,
172
- serializeAccount,
173
- getCachedIcon,
174
- setCachedIcons,
175
- sortAccounts,
176
- sortWallets,
177
- acceptsCachedAccount
178
- };
179
- //# sourceMappingURL=chunk-YDLCHYHH.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/hydrateState.ts","../src/utils/iconCache.ts","../src/utils/sortAccounts.ts","../src/utils/sortWallets.ts","../src/api/platform.ts"],"sourcesContent":["import {\n\ttype BaseWallet,\n\ttype BaseWalletAccount,\n\ttype CachedAccount,\n\ttype CachedWallet,\n\tisWalletConnectWallet,\n\ttype PolkadotAccountType,\n\ttype WalletConnectWallet,\n} from \"../api/types\";\nimport { POLKADOT_EXTENSIONS } from \"./polkadotExtensions\";\nimport type { WalletAccountId } from \"./WalletAccountId\";\nimport { parseWalletId, type WalletId } from \"./WalletId\";\n\n/**\n * Looks up the icon for a wallet from known Polkadot extensions only.\n * Ethereum icons will be populated from the localStorage icon cache via the merge function.\n *\n * Note: We DON'T use localStorage icon cache here because hydrateWallet is called\n * during SSR (server) and client hydration. localStorage isn't available on server,\n * so using it would cause a hydration mismatch. Icons for Ethereum wallets will be\n * populated when the hydration buffer merges cached wallets with live wallets.\n */\nconst lookupWalletIcon = (platform: string, identifier: string): string => {\n\t// Only Polkadot extensions have hardcoded icons that are safe for SSR\n\tif (platform === \"polkadot\") {\n\t\treturn POLKADOT_EXTENSIONS[identifier]?.icon ?? \"\";\n\t}\n\t// Ethereum icons come from localStorage or live wallets - not here\n\treturn \"\";\n};\n\n/**\n * Error thrown when trying to use a placeholder wallet that hasn't fully loaded yet.\n */\nclass PendingWalletError extends Error {\n\tconstructor(walletId: string) {\n\t\tsuper(\n\t\t\t`Wallet ${walletId} is still loading. Wait for isHydrating to be false before calling connect/disconnect.`,\n\t\t);\n\t\tthis.name = \"PendingWalletError\";\n\t}\n}\n\n/**\n * Converts a CachedWallet to a placeholder wallet for SSR hydration display.\n *\n * The placeholder carries only the SDK-free {@link BaseWallet} fields; the real\n * wallet (with its injected provider/extension/standard-wallet handle) replaces\n * it once it loads. connect/disconnect throw until then.\n */\nexport const hydrateWallet = (\n\tcached: CachedWallet,\n): BaseWallet | WalletConnectWallet => {\n\tconst throwPending = () => {\n\t\tthrow new PendingWalletError(cached.id);\n\t};\n\n\t// The platform-less WalletConnect connector. `appKit`/`platforms` are SDK\n\t// state absent until the live connector loads (cast like other placeholder\n\t// SDK handles); icon is filled from the localStorage cache by the caller.\n\tif (cached.type === \"walletconnect\") {\n\t\treturn {\n\t\t\tid: cached.id,\n\t\t\ttype: \"walletconnect\",\n\t\t\tplatforms: [],\n\t\t\tname: cached.name,\n\t\t\ticon: \"\",\n\t\t\tisConnected: cached.isConnected,\n\t\t\tconnect: throwPending,\n\t\t\tdisconnect: throwPending,\n\t\t} as unknown as WalletConnectWallet;\n\t}\n\n\tconst { platform, identifier } = parseWalletId(cached.id);\n\n\treturn {\n\t\tid: cached.id,\n\t\tplatform: cached.platform as BaseWallet[\"platform\"],\n\t\ttype: cached.type,\n\t\tname: cached.name,\n\t\ticon: lookupWalletIcon(platform, identifier),\n\t\tisConnected: cached.isConnected,\n\t\tconnect: throwPending,\n\t\tdisconnect: throwPending,\n\t};\n};\n\n/**\n * Converts a CachedAccount to a placeholder account for SSR hydration display.\n *\n * The placeholder carries the SDK-free {@link BaseWalletAccount} fields plus the\n * plain, serializable platform data that lives in the cache — Ethereum `chainId`\n * and the Polkadot key `type`. Those render immediately on reload (no blank →\n * value flicker) and match what the live account will report. Only the SDK\n * handles (`client`/`signer`/`polkadotSigner`) are absent until the real account\n * replaces this placeholder; signing stays gated on `isHydrating` until then.\n */\nexport const hydrateAccount = (cached: CachedAccount): BaseWalletAccount => ({\n\tid: cached.id as WalletAccountId,\n\tplatform: cached.platform,\n\taddress: cached.address,\n\tname: cached.name,\n\twalletId: cached.walletId,\n\twalletName: cached.walletName,\n\t// Spread (not direct keys) so the extra platform fields don't trip the\n\t// excess-property check against BaseWalletAccount; they're read back via the\n\t// platform-specific account types once narrowed by `platform`.\n\t...(cached.platform === \"ethereum\" && { chainId: cached.chainId }),\n\t...(cached.platform === \"polkadot\" && {\n\t\ttype: cached.polkadotAccountType,\n\t}),\n});\n\n/**\n * Converts a wallet to a CachedWallet for storage.\n * Only extracts the serializable properties needed for hydration.\n */\nexport const serializeWallet = (\n\twallet: BaseWallet | WalletConnectWallet,\n): CachedWallet => ({\n\tid: wallet.id,\n\t// The WalletConnect connector has no platform.\n\tplatform: isWalletConnectWallet(wallet) ? undefined : wallet.platform,\n\ttype: wallet.type,\n\tname: wallet.name,\n\t// Note: icon is NOT stored to save cookie space\n\tisConnected: wallet.isConnected,\n});\n\n/**\n * Converts an account to a CachedAccount for storage.\n * Only extracts the serializable properties needed for hydration. Platform-only\n * fields (Ethereum chainId, Polkadot key type) are read defensively so this\n * stays SDK-free.\n */\nexport const serializeAccount = (\n\taccount: BaseWalletAccount,\n): CachedAccount => ({\n\tid: account.id,\n\tplatform: account.platform,\n\taddress: account.address,\n\tname: account.name,\n\tchainId:\n\t\taccount.platform === \"ethereum\"\n\t\t\t? (account as { chainId?: number }).chainId\n\t\t\t: undefined,\n\tpolkadotAccountType:\n\t\taccount.platform === \"polkadot\"\n\t\t\t? (account as { type?: PolkadotAccountType }).type\n\t\t\t: undefined,\n\twalletId: account.walletId as WalletId,\n\twalletName: account.walletName,\n});\n","import { safeLocalStorage } from \"./storage\";\n\n/**\n * Storage key for the icon cache in localStorage.\n */\nconst ICON_CACHE_KEY = \"kheopskit-icons\";\n\n/**\n * Icon cache type: a map of wallet ID to icon data URI or URL.\n */\ntype IconCache = Record<string, string>;\n\n/**\n * In-memory cache to avoid repeated localStorage reads.\n */\nlet memoryCache: IconCache | null = null;\n\n/**\n * Loads the icon cache from localStorage.\n */\nconst loadCache = (): IconCache => {\n\tif (memoryCache !== null) return memoryCache;\n\n\ttry {\n\t\tconst stored = safeLocalStorage.getItem(ICON_CACHE_KEY);\n\t\tmemoryCache = stored ? (JSON.parse(stored) as IconCache) : {};\n\t} catch {\n\t\tmemoryCache = {};\n\t}\n\treturn memoryCache;\n};\n\n/**\n * Saves the icon cache to localStorage.\n */\nconst saveCache = (cache: IconCache): void => {\n\ttry {\n\t\tsafeLocalStorage.setItem(ICON_CACHE_KEY, JSON.stringify(cache));\n\t\tmemoryCache = cache;\n\t} catch {\n\t\t// localStorage may be full or unavailable\n\t}\n};\n\n/**\n * Gets a cached icon for a wallet.\n * @param walletId - The wallet ID (e.g., \"ethereum:io.talisman\")\n * @returns The cached icon data URI, or undefined if not cached\n */\nexport const getCachedIcon = (walletId: string): string | undefined => {\n\tconst cache = loadCache();\n\treturn cache[walletId] || undefined;\n};\n\n/**\n * Sets multiple cached icons at once.\n * More efficient than calling setCachedIcon multiple times.\n * @param icons - Map of wallet ID to icon\n */\nexport const setCachedIcons = (icons: Record<string, string>): void => {\n\tconst cache = loadCache();\n\tlet changed = false;\n\n\tfor (const [walletId, icon] of Object.entries(icons)) {\n\t\tif (icon && cache[walletId] !== icon) {\n\t\t\tcache[walletId] = icon;\n\t\t\tchanged = true;\n\t\t}\n\t}\n\n\tif (changed) {\n\t\tsaveCache(cache);\n\t}\n};\n","import type { BaseWalletAccount, WalletPlatform } from \"../api/types\";\n\nconst PLATFORM_ORDER: Record<WalletPlatform, number> = {\n\tpolkadot: 0,\n\tethereum: 1,\n\tsolana: 2,\n};\n\n// Group accounts by wallet, surfacing Talisman first (case-insensitive).\nconst byWalletName = (a1: BaseWalletAccount, a2: BaseWalletAccount) => {\n\tif (a1.walletName.toLowerCase() === \"talisman\") return -1;\n\tif (a2.walletName.toLowerCase() === \"talisman\") return 1;\n\treturn a1.walletName.localeCompare(a2.walletName);\n};\n\nexport const sortAccounts = (a1: BaseWalletAccount, a2: BaseWalletAccount) => {\n\t// Sort by platform first: polkadot, then ethereum, then solana\n\tif (a1.platform !== a2.platform)\n\t\treturn PLATFORM_ORDER[a1.platform] - PLATFORM_ORDER[a2.platform];\n\n\t// Then group by wallet name\n\tif (a1.walletName !== a2.walletName) return byWalletName(a1, a2);\n\n\t// Polkadot accounts expose a friendly name; fall back to address\n\tif (a1.platform === \"polkadot\" && a2.platform === \"polkadot\")\n\t\treturn a1.name !== a2.name\n\t\t\t? (a1.name ?? \"\").localeCompare(a2.name ?? \"\")\n\t\t\t: a1.address.localeCompare(a2.address);\n\n\t// Ethereum and Solana accounts disambiguate by id\n\treturn a1.id.localeCompare(a2.id);\n};\n","import {\n\ttype BaseWallet,\n\tisWalletConnectWallet,\n\ttype WalletConnectWallet,\n\ttype WalletPlatform,\n} from \"../api/types\";\n\nconst PLATFORM_ORDER: Record<WalletPlatform, number> = {\n\tpolkadot: 0,\n\tethereum: 1,\n\tsolana: 2,\n};\n\n// The platform-less WalletConnect connector sorts after all platform wallets.\nconst orderOf = (wallet: BaseWallet | WalletConnectWallet) =>\n\tisWalletConnectWallet(wallet) ? 3 : PLATFORM_ORDER[wallet.platform];\n\nexport const sortWallets = (\n\tw1: BaseWallet | WalletConnectWallet,\n\tw2: BaseWallet | WalletConnectWallet,\n) => {\n\t// Sort by platform first: polkadot, then ethereum, then solana, then WC\n\tconst o1 = orderOf(w1);\n\tconst o2 = orderOf(w2);\n\tif (o1 !== o2) return o1 - o2;\n\n\t// Sort by name, but Talisman first\n\tif (w1.name.toLowerCase() === \"talisman\") return -1;\n\tif (w2.name.toLowerCase() === \"talisman\") return 1;\n\n\treturn w1.name.localeCompare(w2.name);\n};\n","import type { CachedAccount, KheopskitPlatform } from \"./types\";\n\n/**\n * Whether a cached account should survive SSR hydration, per its platform\n * plugin's `acceptsCachedAccount` hook. Plugins without the hook (and platforms\n * with no enabled plugin) accept all — matching the pre-plugin behavior where\n * only Polkadot accounts were filtered (by key type).\n */\nexport const acceptsCachedAccount = (\n\tcached: CachedAccount,\n\tplatforms: readonly KheopskitPlatform[],\n): boolean => {\n\tconst plugin = platforms.find((p) => p.platform === cached.platform);\n\treturn plugin?.acceptsCachedAccount?.(cached) ?? true;\n};\n"],"mappings":";;;;;;;;;;AAsBA,IAAM,mBAAmB,CAAC,UAAkB,eAA+B;AAE1E,MAAI,aAAa,YAAY;AAC5B,WAAO,oBAAoB,UAAU,GAAG,QAAQ;AAAA,EACjD;AAEA,SAAO;AACR;AAKA,IAAM,qBAAN,cAAiC,MAAM;AAAA,EACtC,YAAY,UAAkB;AAC7B;AAAA,MACC,UAAU,QAAQ;AAAA,IACnB;AACA,SAAK,OAAO;AAAA,EACb;AACD;AASO,IAAM,gBAAgB,CAC5B,WACsC;AACtC,QAAM,eAAe,MAAM;AAC1B,UAAM,IAAI,mBAAmB,OAAO,EAAE;AAAA,EACvC;AAKA,MAAI,OAAO,SAAS,iBAAiB;AACpC,WAAO;AAAA,MACN,IAAI,OAAO;AAAA,MACX,MAAM;AAAA,MACN,WAAW,CAAC;AAAA,MACZ,MAAM,OAAO;AAAA,MACb,MAAM;AAAA,MACN,aAAa,OAAO;AAAA,MACpB,SAAS;AAAA,MACT,YAAY;AAAA,IACb;AAAA,EACD;AAEA,QAAM,EAAE,UAAU,WAAW,IAAI,cAAc,OAAO,EAAE;AAExD,SAAO;AAAA,IACN,IAAI,OAAO;AAAA,IACX,UAAU,OAAO;AAAA,IACjB,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,IACb,MAAM,iBAAiB,UAAU,UAAU;AAAA,IAC3C,aAAa,OAAO;AAAA,IACpB,SAAS;AAAA,IACT,YAAY;AAAA,EACb;AACD;AAYO,IAAM,iBAAiB,CAAC,YAA8C;AAAA,EAC5E,IAAI,OAAO;AAAA,EACX,UAAU,OAAO;AAAA,EACjB,SAAS,OAAO;AAAA,EAChB,MAAM,OAAO;AAAA,EACb,UAAU,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