@0xsequence/marketplace-sdk 0.4.1 → 0.4.2
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/{chunk-RZSZNVEH.js → chunk-2OJB35FS.js} +7 -7
- package/dist/{chunk-RZSZNVEH.js.map → chunk-2OJB35FS.js.map} +1 -1
- package/dist/{chunk-QMO2CUNM.js → chunk-4RKM3VUV.js} +2 -2
- package/dist/{chunk-7NJETFMF.js → chunk-FI723DGL.js} +3 -3
- package/dist/{chunk-7NJETFMF.js.map → chunk-FI723DGL.js.map} +1 -1
- package/dist/{chunk-UPLTM63S.js → chunk-MQ5WSFDH.js} +7 -7
- package/dist/{chunk-UPLTM63S.js.map → chunk-MQ5WSFDH.js.map} +1 -1
- package/dist/{chunk-IOTKCWOB.js → chunk-MTFS5SED.js} +1089 -1088
- package/dist/chunk-MTFS5SED.js.map +1 -0
- package/dist/{chunk-4ESPWOBV.js → chunk-NC4KGXXE.js} +3 -3
- package/dist/{chunk-4ESPWOBV.js.map → chunk-NC4KGXXE.js.map} +1 -1
- package/dist/{chunk-EVRILXOH.js → chunk-OPMDGQFB.js} +37 -35
- package/dist/{chunk-EVRILXOH.js.map → chunk-OPMDGQFB.js.map} +1 -1
- package/dist/{chunk-5GDO4ZBC.js → chunk-S5IPE7TH.js} +2 -2
- package/dist/{chunk-O642NH7U.js → chunk-TDTORZHC.js} +3 -3
- package/dist/{chunk-O642NH7U.js.map → chunk-TDTORZHC.js.map} +1 -1
- package/dist/{chunk-MIYMMP2K.js → chunk-WBJKZOQ7.js} +214 -134
- package/dist/chunk-WBJKZOQ7.js.map +1 -0
- package/dist/{chunk-KNX2LER4.js → chunk-ZWIRTV7A.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/react/_internal/api/index.js +2 -2
- package/dist/react/_internal/index.js +3 -3
- package/dist/react/_internal/wagmi/index.js +2 -2
- package/dist/react/hooks/index.d.ts +5 -7
- package/dist/react/hooks/index.js +6 -6
- package/dist/react/index.js +10 -10
- package/dist/react/ui/components/index.js +10 -10
- package/dist/react/ui/index.d.ts +15 -8
- package/dist/react/ui/index.js +10 -10
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +6 -6
- package/dist/react/ui/styles/index.js +1 -1
- package/dist/styles/index.js +4 -4
- package/dist/types/index.js +3 -3
- package/dist/utils/index.js +2 -2
- package/package.json +8 -8
- package/src/react/_internal/transaction-machine/execute-transaction.ts +70 -113
- package/src/react/_internal/transaction-machine/useTransactionMachine.ts +13 -32
- package/src/react/_internal/transaction-machine/utils.ts +50 -0
- package/src/react/_internal/transaction-machine/wallet.ts +180 -0
- package/src/react/hooks/useBuyCollectable.tsx +14 -5
- package/src/react/hooks/useCancelOrder.tsx +0 -3
- package/src/react/hooks/useCreateListing.tsx +0 -3
- package/src/react/hooks/useGenerateListingTransaction.tsx +1 -3
- package/src/react/hooks/useGenerateOfferTransaction.tsx +1 -3
- package/src/react/hooks/useMakeOffer.tsx +0 -3
- package/src/react/hooks/useSell.tsx +0 -3
- package/src/react/ui/modals/BuyModal/index.tsx +21 -5
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +252 -0
- package/src/react/ui/modals/CreateListingModal/index.tsx +6 -284
- package/src/react/ui/modals/CreateListingModal/store.ts +76 -0
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +254 -0
- package/src/react/ui/modals/MakeOfferModal/index.tsx +8 -262
- package/src/react/ui/modals/MakeOfferModal/{_store.ts → store.ts} +24 -14
- package/src/react/ui/modals/SellModal/Modal.tsx +218 -0
- package/src/react/ui/modals/SellModal/index.tsx +8 -238
- package/src/react/ui/modals/SellModal/{_store.ts → store.ts} +13 -9
- package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +3 -2
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +2 -1
- package/src/react/ui/modals/modal-provider.tsx +3 -3
- package/src/utils/date.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-IOTKCWOB.js.map +0 -1
- package/dist/chunk-MIYMMP2K.js.map +0 -1
- package/src/react/ui/modals/CreateListingModal/_store.ts +0 -55
- /package/dist/{chunk-QMO2CUNM.js.map → chunk-4RKM3VUV.js.map} +0 -0
- /package/dist/{chunk-5GDO4ZBC.js.map → chunk-S5IPE7TH.js.map} +0 -0
- /package/dist/{chunk-KNX2LER4.js.map → chunk-ZWIRTV7A.js.map} +0 -0
|
@@ -36,6 +36,24 @@ var ChainSwitchError = class extends TransactionError {
|
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
+
var TransactionExecutionError = class extends TransactionError {
|
|
40
|
+
name = "TransactionExecutionError";
|
|
41
|
+
constructor(stepId, cause) {
|
|
42
|
+
super(`Failed to execute transaction step: ${stepId}`, {
|
|
43
|
+
details: cause?.message || "The transaction may have been rejected or failed during execution.",
|
|
44
|
+
cause
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var TransactionSignatureError = class extends TransactionError {
|
|
49
|
+
name = "TransactionSignatureError";
|
|
50
|
+
constructor(stepId, cause) {
|
|
51
|
+
super(`Failed to sign transaction step: ${stepId}`, {
|
|
52
|
+
details: cause?.message || "The signature request may have been rejected by the user.",
|
|
53
|
+
cause
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
39
57
|
var NoWalletConnectedError = class extends TransactionError {
|
|
40
58
|
name = "NoWalletConnectedError";
|
|
41
59
|
constructor() {
|
|
@@ -52,12 +70,11 @@ var NoMarketplaceConfigError = class extends TransactionError {
|
|
|
52
70
|
});
|
|
53
71
|
}
|
|
54
72
|
};
|
|
55
|
-
var
|
|
56
|
-
name = "
|
|
57
|
-
constructor(
|
|
58
|
-
super(
|
|
59
|
-
details:
|
|
60
|
-
cause
|
|
73
|
+
var UserRejectedRequestError = class extends TransactionError {
|
|
74
|
+
name = "UserRejectedRequestError";
|
|
75
|
+
constructor() {
|
|
76
|
+
super("User rejected the request", {
|
|
77
|
+
details: "The user cancelled or rejected the transaction request."
|
|
61
78
|
});
|
|
62
79
|
}
|
|
63
80
|
};
|
|
@@ -96,6 +113,15 @@ var InvalidStepError = class extends TransactionError {
|
|
|
96
113
|
});
|
|
97
114
|
}
|
|
98
115
|
};
|
|
116
|
+
var TransactionConfirmationError = class extends TransactionError {
|
|
117
|
+
name = "TransactionConfirmationError";
|
|
118
|
+
constructor(hash, cause) {
|
|
119
|
+
super(`Failed to confirm transaction ${hash}`, {
|
|
120
|
+
details: cause?.message || "The transaction could not be confirmed on the network.",
|
|
121
|
+
cause
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
99
125
|
var OrderNotFoundError = class extends TransactionError {
|
|
100
126
|
name = "OrderNotFoundError";
|
|
101
127
|
constructor(orderId) {
|
|
@@ -120,22 +146,6 @@ var MissingSignatureDataError = class extends TransactionError {
|
|
|
120
146
|
});
|
|
121
147
|
}
|
|
122
148
|
};
|
|
123
|
-
var InvalidSignatureStepError = class extends TransactionError {
|
|
124
|
-
name = "InvalidSignatureStepError";
|
|
125
|
-
constructor(stepId) {
|
|
126
|
-
super(`Invalid signature step type: ${stepId}`, {
|
|
127
|
-
details: "The signature step type is not supported."
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
var MissingPostStepError = class extends TransactionError {
|
|
132
|
-
name = "MissingPostStepError";
|
|
133
|
-
constructor() {
|
|
134
|
-
super("Missing post step configuration", {
|
|
135
|
-
details: "The signature step is missing required post-step configuration."
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
149
|
var UnexpectedStepsError = class extends TransactionError {
|
|
140
150
|
name = "UnexpectedStepsError";
|
|
141
151
|
constructor() {
|
|
@@ -208,14 +218,6 @@ var MissingConfigError = class extends TransactionError {
|
|
|
208
218
|
});
|
|
209
219
|
}
|
|
210
220
|
};
|
|
211
|
-
var ChainIdUnavailableError = class extends TransactionError {
|
|
212
|
-
name = "ChainIdUnavailableError";
|
|
213
|
-
constructor() {
|
|
214
|
-
super("Chain ID is not available", {
|
|
215
|
-
details: "Could not determine the current chain ID from the wallet."
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
221
|
var TransactionReceiptError = class extends TransactionError {
|
|
220
222
|
name = "TransactionReceiptError";
|
|
221
223
|
constructor(hash, cause) {
|
|
@@ -257,18 +259,19 @@ export {
|
|
|
257
259
|
BaseError,
|
|
258
260
|
TransactionError,
|
|
259
261
|
ChainSwitchError,
|
|
262
|
+
TransactionExecutionError,
|
|
263
|
+
TransactionSignatureError,
|
|
260
264
|
NoWalletConnectedError,
|
|
261
265
|
NoMarketplaceConfigError,
|
|
262
|
-
|
|
266
|
+
UserRejectedRequestError,
|
|
263
267
|
StepExecutionError,
|
|
264
268
|
StepGenerationError,
|
|
265
269
|
PaymentModalError,
|
|
266
270
|
InvalidStepError,
|
|
271
|
+
TransactionConfirmationError,
|
|
267
272
|
OrderNotFoundError,
|
|
268
273
|
MissingStepDataError,
|
|
269
274
|
MissingSignatureDataError,
|
|
270
|
-
InvalidSignatureStepError,
|
|
271
|
-
MissingPostStepError,
|
|
272
275
|
UnexpectedStepsError,
|
|
273
276
|
NoExecutionStepError,
|
|
274
277
|
NoStepsFoundError,
|
|
@@ -278,10 +281,9 @@ export {
|
|
|
278
281
|
ProjectNotFoundError,
|
|
279
282
|
MarketplaceConfigFetchError,
|
|
280
283
|
MissingConfigError,
|
|
281
|
-
ChainIdUnavailableError,
|
|
282
284
|
TransactionReceiptError,
|
|
283
285
|
PaymentModalTransactionError,
|
|
284
286
|
CheckoutOptionsError,
|
|
285
287
|
OrdersFetchError
|
|
286
288
|
};
|
|
287
|
-
//# sourceMappingURL=chunk-
|
|
289
|
+
//# sourceMappingURL=chunk-OPMDGQFB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/_internal/error/base.ts","../src/utils/_internal/error/transaction.ts"],"sourcesContent":["export type ErrorType<name extends string = 'Error'> = Error & { name: name };\n\nexport type Compute<type> = { [key in keyof type]: type[key] } & unknown;\n\ntype BaseErrorOptions = Compute<\n\t{ details?: string | undefined } | { cause: BaseError | Error }\n>;\n\nexport class BaseError extends Error {\n\tdetails: string;\n\tshortMessage: string;\n\n\tname = 'MarketplaceSdkBaseError';\n\n\tconstructor(shortMessage: string, options: BaseErrorOptions = {}) {\n\t\tsuper();\n\n\t\tconst details = 'details' in options ? options.details : '';\n\t\tthis.message = [\n\t\t\tshortMessage || 'An error occurred.',\n\t\t\t'',\n\t\t\t...(details ? [`Details: ${details}`] : []),\n\t\t].join('\\n');\n\n\t\tif ('cause' in options && options.cause) {\n\t\t\tthis.cause = options.cause;\n\t\t}\n\n\t\tthis.details = details || '';\n\t\tthis.shortMessage = shortMessage;\n\t}\n}\n","import type { Address } from 'viem';\nimport { BaseError } from './base';\n\nexport type TransactionErrorType<name extends string = 'TransactionError'> =\n\tBaseError & { name: name };\n\nexport class TransactionError extends BaseError {\n\toverride name = 'TransactionError';\n}\n\nexport class ChainSwitchError extends TransactionError {\n\toverride name = 'ChainSwitchError';\n\tconstructor(currentChainId: number, targetChainId: number) {\n\t\tsuper(\n\t\t\t`Failed to switch network from ${currentChainId} to ${targetChainId}`,\n\t\t\t{\n\t\t\t\tdetails:\n\t\t\t\t\t'The user may have rejected the network switch or there might be a network connectivity issue.',\n\t\t\t},\n\t\t);\n\t}\n}\n\nexport class TransactionExecutionError extends TransactionError {\n\toverride name = 'TransactionExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction may have been rejected or failed during execution.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class TransactionSignatureError extends TransactionError {\n\toverride name = 'TransactionSignatureError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to sign transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The signature request may have been rejected by the user.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class NoWalletConnectedError extends TransactionError {\n\toverride name = 'NoWalletConnectedError';\n\tconstructor() {\n\t\tsuper('No wallet connected', {\n\t\t\tdetails: 'Please connect your wallet before attempting this transaction.',\n\t\t});\n\t}\n}\n\nexport class NoMarketplaceConfigError extends TransactionError {\n\toverride name = 'NoMarketplaceConfigError';\n\tconstructor() {\n\t\tsuper('Marketplace configuration not found', {\n\t\t\tdetails:\n\t\t\t\t'The marketplace configuration is missing or invalid. This could be due to an initialization error.',\n\t\t});\n\t}\n}\n\nexport class UserRejectedRequestError extends TransactionError {\n\toverride name = 'UserRejectedRequestError';\n\tconstructor() {\n\t\tsuper('User rejected the request', {\n\t\t\tdetails: 'The user cancelled or rejected the transaction request.',\n\t\t});\n\t}\n}\n\nexport class InsufficientFundsError extends TransactionError {\n\toverride name = 'InsufficientFundsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Insufficient funds for transaction', {\n\t\t\tdetails:\n\t\t\t\t'The wallet does not have enough funds to complete this transaction.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class SignatureExecutionError extends TransactionError {\n\toverride name = 'SignatureExecutionError';\n\tconstructor(signature: string, cause?: Error) {\n\t\tsuper(`Failed to execute signature: ${signature}`, {\n\t\t\tdetails: cause?.message || 'The execution of the signature failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepExecutionError extends TransactionError {\n\toverride name = 'StepExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute step ${stepId})`, {\n\t\t\tdetails: cause?.message || 'The step execution failed unexpectedly.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepGenerationError extends TransactionError {\n\toverride name = 'StepGenerationError';\n\tconstructor(transactionType: string, cause?: Error) {\n\t\tsuper(`Failed to generate steps for ${transactionType}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'Could not generate the required transaction steps.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalError extends TransactionError {\n\toverride name = 'PaymentModalError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Payment modal operation failed', {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'The payment modal operation was unsuccessful.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class InvalidStepError extends TransactionError {\n\toverride name = 'InvalidStepError';\n\tconstructor(stepId: string, reason: string) {\n\t\tsuper(`Invalid step configuration for ${stepId}`, {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class TransactionConfirmationError extends TransactionError {\n\toverride name = 'TransactionConfirmationError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to confirm transaction ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction could not be confirmed on the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrderNotFoundError extends TransactionError {\n\toverride name = 'OrderNotFoundError';\n\tconstructor(orderId: string) {\n\t\tsuper(`Order ${orderId} not found`, {\n\t\t\tdetails: 'The requested order could not be found in the marketplace.',\n\t\t});\n\t}\n}\n\nexport class MissingStepDataError extends TransactionError {\n\toverride name = 'MissingStepDataError';\n\tconstructor() {\n\t\tsuper('Step is missing required data', {\n\t\t\tdetails:\n\t\t\t\t'The transaction step is missing required \"to\" or \"signature\" data.',\n\t\t});\n\t}\n}\n\nexport class MissingSignatureDataError extends TransactionError {\n\toverride name = 'MissingSignatureDataError';\n\tconstructor() {\n\t\tsuper('Step is missing signature data', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required signature data configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidSignatureStepError extends TransactionError {\n\toverride name = 'InvalidSignatureStepError';\n\tconstructor(stepId: string) {\n\t\tsuper(`Invalid signature step type: ${stepId}`, {\n\t\t\tdetails: 'The signature step type is not supported.',\n\t\t});\n\t}\n}\n\nexport class MissingPostStepError extends TransactionError {\n\toverride name = 'MissingPostStepError';\n\tconstructor() {\n\t\tsuper('Missing post step configuration', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required post-step configuration.',\n\t\t});\n\t}\n}\n\nexport class UnexpectedStepsError extends TransactionError {\n\toverride name = 'UnexpectedStepsError';\n\tconstructor() {\n\t\tsuper('Unexpected steps found', {\n\t\t\tdetails: 'The transaction contains more steps than expected.',\n\t\t});\n\t}\n}\n\nexport class NoExecutionStepError extends TransactionError {\n\toverride name = 'NoExecutionStepError';\n\tconstructor() {\n\t\tsuper('No execution step found', {\n\t\t\tdetails: 'The transaction is missing the required execution step.',\n\t\t});\n\t}\n}\n\nexport class NoStepsFoundError extends TransactionError {\n\toverride name = 'NoStepsFoundError';\n\tconstructor() {\n\t\tsuper('No steps found', {\n\t\t\tdetails: 'The transaction contains no steps to execute.',\n\t\t});\n\t}\n}\n\nexport class UnknownTransactionTypeError extends TransactionError {\n\toverride name = 'UnknownTransactionTypeError';\n\tconstructor(type: string) {\n\t\tsuper(`Unknown transaction type: ${type}`, {\n\t\t\tdetails: 'The specified transaction type is not supported.',\n\t\t});\n\t}\n}\n\nexport class InvalidContractTypeError extends TransactionError {\n\toverride name = 'InvalidContractTypeError';\n\tconstructor(contractType: string | undefined) {\n\t\tsuper(`Invalid contract type: ${contractType}`, {\n\t\t\tdetails: 'The contract type must be either ERC721 or ERC1155.',\n\t\t});\n\t}\n}\n\nexport class CollectionNotFoundError extends TransactionError {\n\toverride name = 'CollectionNotFoundError';\n\tconstructor(collectionAddress: string) {\n\t\tsuper(`Collection not found: ${collectionAddress}`, {\n\t\t\tdetails:\n\t\t\t\t'The specified collection address could not be found in the marketplace configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidCurrencyOptionsError extends TransactionError {\n\toverride name = 'InvalidCurrencyOptionsError';\n\tconstructor(currencyOptions: Address[]) {\n\t\tsuper(`Invalid currency options: ${currencyOptions}`, {\n\t\t\tdetails:\n\t\t\t\t'The currency options must be an array of valid currency contract addresses.',\n\t\t});\n\t}\n}\n\nexport class ProjectNotFoundError extends TransactionError {\n\toverride name = 'ProjectNotFoundError';\n\tconstructor(projectId: string, url: string) {\n\t\tsuper('Project not found', {\n\t\t\tdetails: `Project id: ${projectId} not found at ${url}`,\n\t\t});\n\t}\n}\n\nexport class MarketplaceConfigFetchError extends TransactionError {\n\toverride name = 'MarketplaceConfigFetchError';\n\tconstructor(message: string) {\n\t\tsuper('Failed to fetch marketplace config', {\n\t\t\tdetails: message,\n\t\t});\n\t}\n}\n\nexport class MissingConfigError extends TransactionError {\n\toverride name = 'MissingConfigError';\n\tconstructor(configName: string) {\n\t\tsuper(`Missing required config: ${configName}`, {\n\t\t\tdetails: 'A required configuration parameter is missing.',\n\t\t});\n\t}\n}\n\nexport class TransactionValidationError extends TransactionError {\n\toverride name = 'TransactionValidationError';\n\tconstructor(reason: string) {\n\t\tsuper('Transaction validation failed', {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class ChainIdUnavailableError extends TransactionError {\n\toverride name = 'ChainIdUnavailableError';\n\tconstructor() {\n\t\tsuper('Chain ID is not available', {\n\t\t\tdetails: 'Could not determine the current chain ID from the wallet.',\n\t\t});\n\t}\n}\n\nexport class TransactionReceiptError extends TransactionError {\n\toverride name = 'TransactionReceiptError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to get transaction receipt for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the transaction receipt from the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalTransactionError extends TransactionError {\n\toverride name = 'PaymentModalTransactionError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Payment modal transaction failed for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction initiated from the payment modal failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class CheckoutOptionsError extends TransactionError {\n\toverride name = 'CheckoutOptionsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Failed to get checkout options', {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the checkout options from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrdersFetchError extends TransactionError {\n\toverride name = 'OrdersFetchError';\n\tconstructor(orderId: string, cause?: Error) {\n\t\tsuper(`Failed to fetch order ${orderId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the order details from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport type TransactionErrorTypes =\n\t| ChainIdUnavailableError\n\t| TransactionReceiptError\n\t| PaymentModalTransactionError\n\t| CheckoutOptionsError\n\t| OrdersFetchError\n\t| TransactionConfirmationError\n\t| TransactionValidationError\n\t| MissingConfigError\n\t| MarketplaceConfigFetchError\n\t| ProjectNotFoundError\n\t| CollectionNotFoundError\n\t| InvalidCurrencyOptionsError\n\t| InvalidContractTypeError\n\t| UnknownTransactionTypeError\n\t| NoStepsFoundError\n\t| NoExecutionStepError\n\t| UnexpectedStepsError\n\t| MissingPostStepError\n\t| InvalidSignatureStepError\n\t| MissingSignatureDataError\n\t| MissingStepDataError\n\t| OrderNotFoundError\n\t| TransactionConfirmationError\n\t| InvalidStepError\n\t| PaymentModalError\n\t| StepGenerationError\n\t| StepExecutionError\n\t| UserRejectedRequestError\n\t| NoMarketplaceConfigError\n\t| InsufficientFundsError\n\t| ChainSwitchError\n\t| TransactionSignatureError\n\t| TransactionExecutionError\n\t| NoWalletConnectedError\n\t| TransactionError;\n"],"mappings":";;;AAQO,IAAM,YAAN,cAAwB,MAAM;AAAA,EACpC;AAAA,EACA;AAAA,EAEA,OAAO;AAAA,EAEP,YAAY,cAAsB,UAA4B,CAAC,GAAG;AACjE,UAAM;AAEN,UAAM,UAAU,aAAa,UAAU,QAAQ,UAAU;AACzD,SAAK,UAAU;AAAA,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AAA,EACF;AACD;AAEO,IAAM,qBAAN,cAAiC,iBAAiB;AAAA,EAC/C,OAAO;AAAA,EAChB,YAAY,YAAoB;AAC/B,UAAM,4BAA4B,UAAU,IAAI;AAAA,MAC/C,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAWO,IAAM,0BAAN,cAAsC,iBAAiB;AAAA,EACpD,OAAO;AAAA,EAChB,cAAc;AACb,UAAM,6BAA6B;AAAA,MAClC,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAEO,IAAM,0BAAN,cAAsC,iBAAiB;AAAA,EACpD,OAAO;AAAA,EAChB,YAAY,MAAc,OAAe;AACxC,UAAM,yCAAyC,IAAI,IAAI;AAAA,MACtD,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEO,IAAM,+BAAN,cAA2C,iBAAiB;AAAA,EACzD,OAAO;AAAA,EAChB,YAAY,MAAc,OAAe;AACxC,UAAM,wCAAwC,IAAI,IAAI;AAAA,MACrD,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEO,IAAM,uBAAN,cAAmC,iBAAiB;AAAA,EACjD,OAAO;AAAA,EAChB,YAAY,OAAe;AAC1B,UAAM,kCAAkC;AAAA,MACvC,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEO,IAAM,mBAAN,cAA+B,iBAAiB;AAAA,EAC7C,OAAO;AAAA,EAChB,YAAY,SAAiB,OAAe;AAC3C,UAAM,yBAAyB,OAAO,IAAI;AAAA,MACzC,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/_internal/error/base.ts","../src/utils/_internal/error/transaction.ts"],"sourcesContent":["export type ErrorType<name extends string = 'Error'> = Error & { name: name };\n\nexport type Compute<type> = { [key in keyof type]: type[key] } & unknown;\n\ntype BaseErrorOptions = Compute<\n\t{ details?: string | undefined } | { cause: BaseError | Error }\n>;\n\nexport class BaseError extends Error {\n\tdetails: string;\n\tshortMessage: string;\n\n\tname = 'MarketplaceSdkBaseError';\n\n\tconstructor(shortMessage: string, options: BaseErrorOptions = {}) {\n\t\tsuper();\n\n\t\tconst details = 'details' in options ? options.details : '';\n\t\tthis.message = [\n\t\t\tshortMessage || 'An error occurred.',\n\t\t\t'',\n\t\t\t...(details ? [`Details: ${details}`] : []),\n\t\t].join('\\n');\n\n\t\tif ('cause' in options && options.cause) {\n\t\t\tthis.cause = options.cause;\n\t\t}\n\n\t\tthis.details = details || '';\n\t\tthis.shortMessage = shortMessage;\n\t}\n}\n","import type { Address } from 'viem';\nimport { BaseError } from './base';\n\nexport type TransactionErrorType<name extends string = 'TransactionError'> =\n\tBaseError & { name: name };\n\nexport class TransactionError extends BaseError {\n\toverride name = 'TransactionError';\n}\n\nexport class ChainSwitchError extends TransactionError {\n\toverride name = 'ChainSwitchError';\n\tconstructor(currentChainId: number, targetChainId: number) {\n\t\tsuper(\n\t\t\t`Failed to switch network from ${currentChainId} to ${targetChainId}`,\n\t\t\t{\n\t\t\t\tdetails:\n\t\t\t\t\t'The user may have rejected the network switch or there might be a network connectivity issue.',\n\t\t\t},\n\t\t);\n\t}\n}\n\nexport class TransactionExecutionError extends TransactionError {\n\toverride name = 'TransactionExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction may have been rejected or failed during execution.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class TransactionSignatureError extends TransactionError {\n\toverride name = 'TransactionSignatureError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to sign transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The signature request may have been rejected by the user.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class NoWalletConnectedError extends TransactionError {\n\toverride name = 'NoWalletConnectedError';\n\tconstructor() {\n\t\tsuper('No wallet connected', {\n\t\t\tdetails: 'Please connect your wallet before attempting this transaction.',\n\t\t});\n\t}\n}\n\nexport class NoMarketplaceConfigError extends TransactionError {\n\toverride name = 'NoMarketplaceConfigError';\n\tconstructor() {\n\t\tsuper('Marketplace configuration not found', {\n\t\t\tdetails:\n\t\t\t\t'The marketplace configuration is missing or invalid. This could be due to an initialization error.',\n\t\t});\n\t}\n}\n\nexport class UserRejectedRequestError extends TransactionError {\n\toverride name = 'UserRejectedRequestError';\n\tconstructor() {\n\t\tsuper('User rejected the request', {\n\t\t\tdetails: 'The user cancelled or rejected the transaction request.',\n\t\t});\n\t}\n}\n\nexport class InsufficientFundsError extends TransactionError {\n\toverride name = 'InsufficientFundsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Insufficient funds for transaction', {\n\t\t\tdetails:\n\t\t\t\t'The wallet does not have enough funds to complete this transaction.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class SignatureExecutionError extends TransactionError {\n\toverride name = 'SignatureExecutionError';\n\tconstructor(signature: string, cause?: Error) {\n\t\tsuper(`Failed to execute signature: ${signature}`, {\n\t\t\tdetails: cause?.message || 'The execution of the signature failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepExecutionError extends TransactionError {\n\toverride name = 'StepExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute step ${stepId})`, {\n\t\t\tdetails: cause?.message || 'The step execution failed unexpectedly.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepGenerationError extends TransactionError {\n\toverride name = 'StepGenerationError';\n\tconstructor(transactionType: string, cause?: Error) {\n\t\tsuper(`Failed to generate steps for ${transactionType}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'Could not generate the required transaction steps.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalError extends TransactionError {\n\toverride name = 'PaymentModalError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Payment modal operation failed', {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'The payment modal operation was unsuccessful.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class InvalidStepError extends TransactionError {\n\toverride name = 'InvalidStepError';\n\tconstructor(stepId: string, reason: string) {\n\t\tsuper(`Invalid step configuration for ${stepId}`, {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class TransactionConfirmationError extends TransactionError {\n\toverride name = 'TransactionConfirmationError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to confirm transaction ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction could not be confirmed on the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrderNotFoundError extends TransactionError {\n\toverride name = 'OrderNotFoundError';\n\tconstructor(orderId: string) {\n\t\tsuper(`Order ${orderId} not found`, {\n\t\t\tdetails: 'The requested order could not be found in the marketplace.',\n\t\t});\n\t}\n}\n\nexport class MissingStepDataError extends TransactionError {\n\toverride name = 'MissingStepDataError';\n\tconstructor() {\n\t\tsuper('Step is missing required data', {\n\t\t\tdetails:\n\t\t\t\t'The transaction step is missing required \"to\" or \"signature\" data.',\n\t\t});\n\t}\n}\n\nexport class MissingSignatureDataError extends TransactionError {\n\toverride name = 'MissingSignatureDataError';\n\tconstructor() {\n\t\tsuper('Step is missing signature data', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required signature data configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidSignatureStepError extends TransactionError {\n\toverride name = 'InvalidSignatureStepError';\n\tconstructor(stepId: string) {\n\t\tsuper(`Invalid signature step type: ${stepId}`, {\n\t\t\tdetails: 'The signature step type is not supported.',\n\t\t});\n\t}\n}\n\nexport class MissingPostStepError extends TransactionError {\n\toverride name = 'MissingPostStepError';\n\tconstructor() {\n\t\tsuper('Missing post step configuration', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required post-step configuration.',\n\t\t});\n\t}\n}\n\nexport class UnexpectedStepsError extends TransactionError {\n\toverride name = 'UnexpectedStepsError';\n\tconstructor() {\n\t\tsuper('Unexpected steps found', {\n\t\t\tdetails: 'The transaction contains more steps than expected.',\n\t\t});\n\t}\n}\n\nexport class NoExecutionStepError extends TransactionError {\n\toverride name = 'NoExecutionStepError';\n\tconstructor() {\n\t\tsuper('No execution step found', {\n\t\t\tdetails: 'The transaction is missing the required execution step.',\n\t\t});\n\t}\n}\n\nexport class NoStepsFoundError extends TransactionError {\n\toverride name = 'NoStepsFoundError';\n\tconstructor() {\n\t\tsuper('No steps found', {\n\t\t\tdetails: 'The transaction contains no steps to execute.',\n\t\t});\n\t}\n}\n\nexport class UnknownTransactionTypeError extends TransactionError {\n\toverride name = 'UnknownTransactionTypeError';\n\tconstructor(type: string) {\n\t\tsuper(`Unknown transaction type: ${type}`, {\n\t\t\tdetails: 'The specified transaction type is not supported.',\n\t\t});\n\t}\n}\n\nexport class InvalidContractTypeError extends TransactionError {\n\toverride name = 'InvalidContractTypeError';\n\tconstructor(contractType: string | undefined) {\n\t\tsuper(`Invalid contract type: ${contractType}`, {\n\t\t\tdetails: 'The contract type must be either ERC721 or ERC1155.',\n\t\t});\n\t}\n}\n\nexport class CollectionNotFoundError extends TransactionError {\n\toverride name = 'CollectionNotFoundError';\n\tconstructor(collectionAddress: string) {\n\t\tsuper(`Collection not found: ${collectionAddress}`, {\n\t\t\tdetails:\n\t\t\t\t'The specified collection address could not be found in the marketplace configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidCurrencyOptionsError extends TransactionError {\n\toverride name = 'InvalidCurrencyOptionsError';\n\tconstructor(currencyOptions: Address[]) {\n\t\tsuper(`Invalid currency options: ${currencyOptions}`, {\n\t\t\tdetails:\n\t\t\t\t'The currency options must be an array of valid currency contract addresses.',\n\t\t});\n\t}\n}\n\nexport class ProjectNotFoundError extends TransactionError {\n\toverride name = 'ProjectNotFoundError';\n\tconstructor(projectId: string, url: string) {\n\t\tsuper('Project not found', {\n\t\t\tdetails: `Project id: ${projectId} not found at ${url}`,\n\t\t});\n\t}\n}\n\nexport class MarketplaceConfigFetchError extends TransactionError {\n\toverride name = 'MarketplaceConfigFetchError';\n\tconstructor(message: string) {\n\t\tsuper('Failed to fetch marketplace config', {\n\t\t\tdetails: message,\n\t\t});\n\t}\n}\n\nexport class MissingConfigError extends TransactionError {\n\toverride name = 'MissingConfigError';\n\tconstructor(configName: string) {\n\t\tsuper(`Missing required config: ${configName}`, {\n\t\t\tdetails: 'A required configuration parameter is missing.',\n\t\t});\n\t}\n}\n\nexport class TransactionValidationError extends TransactionError {\n\toverride name = 'TransactionValidationError';\n\tconstructor(reason: string) {\n\t\tsuper('Transaction validation failed', {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class ChainIdUnavailableError extends TransactionError {\n\toverride name = 'ChainIdUnavailableError';\n\tconstructor() {\n\t\tsuper('Chain ID is not available', {\n\t\t\tdetails: 'Could not determine the current chain ID from the wallet.',\n\t\t});\n\t}\n}\n\nexport class TransactionReceiptError extends TransactionError {\n\toverride name = 'TransactionReceiptError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to get transaction receipt for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the transaction receipt from the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalTransactionError extends TransactionError {\n\toverride name = 'PaymentModalTransactionError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Payment modal transaction failed for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction initiated from the payment modal failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class CheckoutOptionsError extends TransactionError {\n\toverride name = 'CheckoutOptionsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Failed to get checkout options', {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the checkout options from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrdersFetchError extends TransactionError {\n\toverride name = 'OrdersFetchError';\n\tconstructor(orderId: string, cause?: Error) {\n\t\tsuper(`Failed to fetch order ${orderId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the order details from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport type TransactionErrorTypes =\n\t| ChainIdUnavailableError\n\t| TransactionReceiptError\n\t| PaymentModalTransactionError\n\t| CheckoutOptionsError\n\t| OrdersFetchError\n\t| TransactionConfirmationError\n\t| TransactionValidationError\n\t| MissingConfigError\n\t| MarketplaceConfigFetchError\n\t| ProjectNotFoundError\n\t| CollectionNotFoundError\n\t| InvalidCurrencyOptionsError\n\t| InvalidContractTypeError\n\t| UnknownTransactionTypeError\n\t| NoStepsFoundError\n\t| NoExecutionStepError\n\t| UnexpectedStepsError\n\t| MissingPostStepError\n\t| InvalidSignatureStepError\n\t| MissingSignatureDataError\n\t| MissingStepDataError\n\t| OrderNotFoundError\n\t| TransactionConfirmationError\n\t| InvalidStepError\n\t| PaymentModalError\n\t| StepGenerationError\n\t| StepExecutionError\n\t| UserRejectedRequestError\n\t| NoMarketplaceConfigError\n\t| InsufficientFundsError\n\t| ChainSwitchError\n\t| TransactionSignatureError\n\t| TransactionExecutionError\n\t| NoWalletConnectedError\n\t| TransactionError;\n"],"mappings":";;;AAQO,IAAM,YAAN,cAAwB,MAAM;AAAA,EACpC;AAAA,EACA;AAAA,EAEA,OAAO;AAAA,EAEP,YAAY,cAAsB,UAA4B,CAAC,GAAG;AACjE,UAAM;AAEN,UAAM,UAAU,aAAa,UAAU,QAAQ,UAAU;AACzD,SAAK,UAAU;AAAA,MACd,gBAAgB;AAAA,MAChB;AAAA,MACA,GAAI,UAAU,CAAC,YAAY,OAAO,EAAE,IAA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O,IAAM,8BAAN,cAA0C,iBAAiB;AAAA,EACxD,OAAO;AAAA,EAChB,YAAY,SAAiB;AAC5B,UAAM,sCAAsC;AAAA,MAC3C,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAEO,IAAM,qBAAN,cAAiC,iBAAiB;AAAA,EAC/C,OAAO;AAAA,EAChB,YAAY,YAAoB;AAC/B,UAAM,4BAA4B,UAAU,IAAI;AAAA,MAC/C,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAoBO,IAAM,0BAAN,cAAsC,iBAAiB;AAAA,EACpD,OAAO;AAAA,EAChB,YAAY,MAAc,OAAe;AACxC,UAAM,yCAAyC,IAAI,IAAI;AAAA,MACtD,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEO,IAAM,+BAAN,cAA2C,iBAAiB;AAAA,EACzD,OAAO;AAAA,EAChB,YAAY,MAAc,OAAe;AACxC,UAAM,wCAAwC,IAAI,IAAI;AAAA,MACrD,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEO,IAAM,uBAAN,cAAmC,iBAAiB;AAAA,EACjD,OAAO;AAAA,EAChB,YAAY,OAAe;AAC1B,UAAM,kCAAkC;AAAA,MACvC,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEO,IAAM,mBAAN,cAA+B,iBAAiB;AAAA,EAC7C,OAAO;AAAA,EAChB,YAAY,SAAiB,OAAe;AAC3C,UAAM,yBAAyB,OAAO,IAAI;AAAA,MACzC,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
MissingConfigError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OPMDGQFB.js";
|
|
5
5
|
|
|
6
6
|
// src/react/_internal/api/get-query-client.ts
|
|
7
7
|
import {
|
|
@@ -1350,4 +1350,4 @@ export {
|
|
|
1350
1350
|
getIndexerClient,
|
|
1351
1351
|
getMarketplaceClient
|
|
1352
1352
|
};
|
|
1353
|
-
//# sourceMappingURL=chunk-
|
|
1353
|
+
//# sourceMappingURL=chunk-S5IPE7TH.js.map
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// src/react/ui/modals/_internal/components/actionModal/styles.css.ts
|
|
4
4
|
var closeButton = "fyvr11lw fyvr1tc fyvr1mo";
|
|
5
5
|
var cta = "styles_cta__1rop7tw0";
|
|
6
|
-
var dialogContent = { narrow: "modal_dialogContent_narrow__1ypl6nt2 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8
|
|
7
|
-
var dialogOverlay = "fyvr1m0 fyvr1o8 fyvr1qg fyvr1so
|
|
6
|
+
var dialogContent = { narrow: "modal_dialogContent_narrow__1ypl6nt2 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11ul fyvr11m0 fyvr11rs", wide: "modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11ul fyvr11m0 fyvr11rs" };
|
|
7
|
+
var dialogOverlay = "fyvr1m0 fyvr1o8 fyvr1qg fyvr1so fyvr11vl fyvr11m0 fyvr11rs";
|
|
8
8
|
|
|
9
9
|
export {
|
|
10
10
|
closeButton,
|
|
@@ -12,4 +12,4 @@ export {
|
|
|
12
12
|
dialogContent,
|
|
13
13
|
dialogOverlay
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-TDTORZHC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/ui/modals/_internal/components/actionModal/styles.css.ts"],"sourcesContent":["import 'src/react/ui/styles/modal.css.ts.vanilla.css?source=Lm1vZGFsX2RpYWxvZ0NvbnRlbnRCYXNlX18xeXBsNm50MSB7CiAgdG9wOiA1MCU7CiAgbGVmdDogNTAlOwogIHRyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIC01MCUpOwogIHBhZGRpbmc6IDI0cHg7Cn0KLm1vZGFsX2RpYWxvZ0NvbnRlbnRfbmFycm93X18xeXBsNm50MiB7CiAgd2lkdGg6IDM2MHB4Owp9Ci5tb2RhbF9kaWFsb2dDb250ZW50X3dpZGVfXzF5cGw2bnQzIHsKICB3aWR0aDogNTQwcHg7Cn0KQG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDogMzYwcHgpIHsKICAubW9kYWxfZGlhbG9nQ29udGVudF9uYXJyb3dfXzF5cGw2bnQyIHsKICAgIHdpZHRoOiAxMDAlOwogICAgYm90dG9tOiAwOwogICAgdHJhbnNmb3JtOiB1bnNldDsKICAgIHRvcDogdW5zZXQ7CiAgICBsZWZ0OiB1bnNldDsKICAgIGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICAgIGJvcmRlci1ib3R0b20tcmlnaHQtcmFkaXVzOiAwICFpbXBvcnRhbnQ7CiAgfQp9CkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDU0MHB4KSB7CiAgLm1vZGFsX2RpYWxvZ0NvbnRlbnRfd2lkZV9fMXlwbDZudDMgewogICAgd2lkdGg6IDEwMCU7CiAgICBib3R0b206IDA7CiAgICB0cmFuc2Zvcm06IHVuc2V0OwogICAgdG9wOiB1bnNldDsKICAgIGxlZnQ6IHVuc2V0OwogICAgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czogMCAhaW1wb3J0YW50OwogICAgYm9yZGVyLWJvdHRvbS1yaWdodC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICB9Cn0=';\nimport 'src/react/ui/modals/_internal/components/actionModal/styles.css.ts.vanilla.css?source=LnN0eWxlc19jdGFfXzFyb3A3dHcwIHsKICBib3JkZXItcmFkaXVzOiAxMnB4ICFpbXBvcnRhbnQ7Cn0KLnN0eWxlc19jdGFfXzFyb3A3dHcwID4gZGl2IHsKICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlciAhaW1wb3J0YW50Owp9';\nexport var closeButton = 'fyvr11lw fyvr1tc fyvr1mo';\nexport var cta = 'styles_cta__1rop7tw0';\nexport var dialogContent = {narrow:'modal_dialogContent_narrow__1ypl6nt2 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8
|
|
1
|
+
{"version":3,"sources":["../src/react/ui/modals/_internal/components/actionModal/styles.css.ts"],"sourcesContent":["import 'src/react/ui/styles/modal.css.ts.vanilla.css?source=Lm1vZGFsX2RpYWxvZ0NvbnRlbnRCYXNlX18xeXBsNm50MSB7CiAgdG9wOiA1MCU7CiAgbGVmdDogNTAlOwogIHRyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIC01MCUpOwogIHBhZGRpbmc6IDI0cHg7Cn0KLm1vZGFsX2RpYWxvZ0NvbnRlbnRfbmFycm93X18xeXBsNm50MiB7CiAgd2lkdGg6IDM2MHB4Owp9Ci5tb2RhbF9kaWFsb2dDb250ZW50X3dpZGVfXzF5cGw2bnQzIHsKICB3aWR0aDogNTQwcHg7Cn0KQG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDogMzYwcHgpIHsKICAubW9kYWxfZGlhbG9nQ29udGVudF9uYXJyb3dfXzF5cGw2bnQyIHsKICAgIHdpZHRoOiAxMDAlOwogICAgYm90dG9tOiAwOwogICAgdHJhbnNmb3JtOiB1bnNldDsKICAgIHRvcDogdW5zZXQ7CiAgICBsZWZ0OiB1bnNldDsKICAgIGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICAgIGJvcmRlci1ib3R0b20tcmlnaHQtcmFkaXVzOiAwICFpbXBvcnRhbnQ7CiAgfQp9CkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDU0MHB4KSB7CiAgLm1vZGFsX2RpYWxvZ0NvbnRlbnRfd2lkZV9fMXlwbDZudDMgewogICAgd2lkdGg6IDEwMCU7CiAgICBib3R0b206IDA7CiAgICB0cmFuc2Zvcm06IHVuc2V0OwogICAgdG9wOiB1bnNldDsKICAgIGxlZnQ6IHVuc2V0OwogICAgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czogMCAhaW1wb3J0YW50OwogICAgYm9yZGVyLWJvdHRvbS1yaWdodC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICB9Cn0=';\nimport 'src/react/ui/modals/_internal/components/actionModal/styles.css.ts.vanilla.css?source=LnN0eWxlc19jdGFfXzFyb3A3dHcwIHsKICBib3JkZXItcmFkaXVzOiAxMnB4ICFpbXBvcnRhbnQ7Cn0KLnN0eWxlc19jdGFfXzFyb3A3dHcwID4gZGl2IHsKICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlciAhaW1wb3J0YW50Owp9';\nexport var closeButton = 'fyvr11lw fyvr1tc fyvr1mo';\nexport var cta = 'styles_cta__1rop7tw0';\nexport var dialogContent = {narrow:'modal_dialogContent_narrow__1ypl6nt2 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11ul fyvr11m0 fyvr11rs',wide:'modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11ul fyvr11m0 fyvr11rs'};\nexport var dialogOverlay = 'fyvr1m0 fyvr1o8 fyvr1qg fyvr1so fyvr11vl fyvr11m0 fyvr11rs';"],"mappings":";;;AAEO,IAAI,cAAc;AAClB,IAAI,MAAM;AACV,IAAI,gBAAgB,EAAC,QAAO,kJAAiJ,MAAK,+IAA8I;AAChU,IAAI,gBAAgB;","names":[]}
|