@monorise/react 7.1.0 → 7.1.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.
Files changed (70) hide show
  1. package/dist/actions/core.action.d.ts.map +1 -1
  2. package/dist/helpers/transactional.d.ts +40 -0
  3. package/dist/helpers/transactional.d.ts.map +1 -0
  4. package/dist/index.d.ts +4 -17
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +187 -8703
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib/utils.d.ts +7 -0
  9. package/dist/lib/utils.d.ts.map +1 -1
  10. package/dist/services/core.service.d.ts +2 -8
  11. package/dist/services/core.service.d.ts.map +1 -1
  12. package/package.json +1 -1
  13. package/dist/chunk-5XIRNUBL.js +0 -43
  14. package/dist/chunk-5XIRNUBL.js.map +0 -1
  15. package/dist/chunk-7JDOKZGQ.js +0 -172
  16. package/dist/chunk-7JDOKZGQ.js.map +0 -1
  17. package/dist/chunk-A5TI2FW3.js +0 -13
  18. package/dist/chunk-A5TI2FW3.js.map +0 -1
  19. package/dist/chunk-AYQDOLYF.js +0 -628
  20. package/dist/chunk-AYQDOLYF.js.map +0 -1
  21. package/dist/chunk-BUTF5RJU.js +0 -29
  22. package/dist/chunk-BUTF5RJU.js.map +0 -1
  23. package/dist/chunk-EYG2DL3D.js +0 -893
  24. package/dist/chunk-EYG2DL3D.js.map +0 -1
  25. package/dist/chunk-GEN4TSCQ.js +0 -5179
  26. package/dist/chunk-GEN4TSCQ.js.map +0 -1
  27. package/dist/chunk-GFVCNWVT.js +0 -54
  28. package/dist/chunk-GFVCNWVT.js.map +0 -1
  29. package/dist/chunk-KJX5LOMN.js +0 -43
  30. package/dist/chunk-KJX5LOMN.js.map +0 -1
  31. package/dist/chunk-KLXK4V6G.js +0 -65
  32. package/dist/chunk-KLXK4V6G.js.map +0 -1
  33. package/dist/chunk-L6MAS3AX.js +0 -482
  34. package/dist/chunk-L6MAS3AX.js.map +0 -1
  35. package/dist/chunk-LPXR5V4J.js +0 -582
  36. package/dist/chunk-LPXR5V4J.js.map +0 -1
  37. package/dist/chunk-MIXAYX55.js +0 -147
  38. package/dist/chunk-MIXAYX55.js.map +0 -1
  39. package/dist/chunk-OEHQ546W.js +0 -182
  40. package/dist/chunk-OEHQ546W.js.map +0 -1
  41. package/dist/chunk-RPNCWADG.js +0 -248
  42. package/dist/chunk-RPNCWADG.js.map +0 -1
  43. package/dist/chunk-S6RDMHHH.js +0 -47
  44. package/dist/chunk-S6RDMHHH.js.map +0 -1
  45. package/dist/chunk-VVCM7N22.js +0 -101
  46. package/dist/chunk-VVCM7N22.js.map +0 -1
  47. package/dist/dist-es-5WYA7CWK.js +0 -379
  48. package/dist/dist-es-5WYA7CWK.js.map +0 -1
  49. package/dist/dist-es-DLWQXBOR.js +0 -333
  50. package/dist/dist-es-DLWQXBOR.js.map +0 -1
  51. package/dist/dist-es-EMJCB37T.js +0 -71
  52. package/dist/dist-es-EMJCB37T.js.map +0 -1
  53. package/dist/dist-es-Q7IAXWRB.js +0 -494
  54. package/dist/dist-es-Q7IAXWRB.js.map +0 -1
  55. package/dist/dist-es-QF65HH5Y.js +0 -169
  56. package/dist/dist-es-QF65HH5Y.js.map +0 -1
  57. package/dist/dist-es-R4TRTT45.js +0 -22
  58. package/dist/dist-es-R4TRTT45.js.map +0 -1
  59. package/dist/dist-es-XNAC47MK.js +0 -90
  60. package/dist/dist-es-XNAC47MK.js.map +0 -1
  61. package/dist/event-streams-6APKUBMC.js +0 -270
  62. package/dist/event-streams-6APKUBMC.js.map +0 -1
  63. package/dist/loadSso-WMS367NT.js +0 -595
  64. package/dist/loadSso-WMS367NT.js.map +0 -1
  65. package/dist/signin-2I7AG6XI.js +0 -707
  66. package/dist/signin-2I7AG6XI.js.map +0 -1
  67. package/dist/sso-oidc-OAJ7SALL.js +0 -825
  68. package/dist/sso-oidc-OAJ7SALL.js.map +0 -1
  69. package/dist/sts-LKM23TRV.js +0 -3866
  70. package/dist/sts-LKM23TRV.js.map +0 -1
@@ -1,333 +0,0 @@
1
- import {
2
- getProfileName,
3
- getSSOTokenFilepath,
4
- getSSOTokenFromFile,
5
- loadSsoSessionData,
6
- parseKnownFiles
7
- } from "./chunk-RPNCWADG.js";
8
- import {
9
- setCredentialFeature
10
- } from "./chunk-A5TI2FW3.js";
11
- import {
12
- CredentialsProviderError,
13
- ProviderError
14
- } from "./chunk-5XIRNUBL.js";
15
- import {
16
- __publicField,
17
- __spreadProps,
18
- __spreadValues
19
- } from "./chunk-MIXAYX55.js";
20
-
21
- // ../../node_modules/@smithy/property-provider/dist-es/TokenProviderError.js
22
- var TokenProviderError = class _TokenProviderError extends ProviderError {
23
- constructor(message, options = true) {
24
- super(message, options);
25
- __publicField(this, "name", "TokenProviderError");
26
- Object.setPrototypeOf(this, _TokenProviderError.prototype);
27
- }
28
- };
29
-
30
- // ../../node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
31
- var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
32
-
33
- // ../../node_modules/@aws-sdk/token-providers/dist-es/constants.js
34
- var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
35
- var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
36
-
37
- // ../../node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
38
- var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
39
- var _a, _b;
40
- const { SSOOIDCClient } = await import("./sso-oidc-OAJ7SALL.js");
41
- const coalesce = (prop) => {
42
- var _a2, _b2, _c, _d;
43
- return (_d = (_c = (_a2 = init.clientConfig) == null ? void 0 : _a2[prop]) != null ? _c : (_b2 = init.parentClientConfig) == null ? void 0 : _b2[prop]) != null ? _d : callerClientConfig == null ? void 0 : callerClientConfig[prop];
44
- };
45
- const ssoOidcClient = new SSOOIDCClient(Object.assign({}, (_a = init.clientConfig) != null ? _a : {}, {
46
- region: ssoRegion != null ? ssoRegion : (_b = init.clientConfig) == null ? void 0 : _b.region,
47
- logger: coalesce("logger"),
48
- userAgentAppId: coalesce("userAgentAppId")
49
- }));
50
- return ssoOidcClient;
51
- };
52
-
53
- // ../../node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
54
- var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
55
- const { CreateTokenCommand } = await import("./sso-oidc-OAJ7SALL.js");
56
- const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
57
- return ssoOidcClient.send(new CreateTokenCommand({
58
- clientId: ssoToken.clientId,
59
- clientSecret: ssoToken.clientSecret,
60
- refreshToken: ssoToken.refreshToken,
61
- grantType: "refresh_token"
62
- }));
63
- };
64
-
65
- // ../../node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
66
- var validateTokenExpiry = (token) => {
67
- if (token.expiration && token.expiration.getTime() < Date.now()) {
68
- throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
69
- }
70
- };
71
-
72
- // ../../node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
73
- var validateTokenKey = (key, value, forRefresh = false) => {
74
- if (typeof value === "undefined") {
75
- throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
76
- }
77
- };
78
-
79
- // ../../node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
80
- import { promises as fsPromises } from "fs";
81
- var { writeFile } = fsPromises;
82
- var writeSSOTokenToFile = (id, ssoToken) => {
83
- const tokenFilepath = getSSOTokenFilepath(id);
84
- const tokenString = JSON.stringify(ssoToken, null, 2);
85
- return writeFile(tokenFilepath, tokenString);
86
- };
87
-
88
- // ../../node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
89
- var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
90
- var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
91
- var _a, _b;
92
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers - fromSso");
93
- const profiles = await parseKnownFiles(init);
94
- const profileName = getProfileName({
95
- profile: (_b = init.profile) != null ? _b : callerClientConfig == null ? void 0 : callerClientConfig.profile
96
- });
97
- const profile = profiles[profileName];
98
- if (!profile) {
99
- throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
100
- } else if (!profile["sso_session"]) {
101
- throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
102
- }
103
- const ssoSessionName = profile["sso_session"];
104
- const ssoSessions = await loadSsoSessionData(init);
105
- const ssoSession = ssoSessions[ssoSessionName];
106
- if (!ssoSession) {
107
- throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
108
- }
109
- for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
110
- if (!ssoSession[ssoSessionRequiredKey]) {
111
- throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
112
- }
113
- }
114
- const ssoStartUrl = ssoSession["sso_start_url"];
115
- const ssoRegion = ssoSession["sso_region"];
116
- let ssoToken;
117
- try {
118
- ssoToken = await getSSOTokenFromFile(ssoSessionName);
119
- } catch (e) {
120
- throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
121
- }
122
- validateTokenKey("accessToken", ssoToken.accessToken);
123
- validateTokenKey("expiresAt", ssoToken.expiresAt);
124
- const { accessToken, expiresAt } = ssoToken;
125
- const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
126
- if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
127
- return existingToken;
128
- }
129
- if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
130
- validateTokenExpiry(existingToken);
131
- return existingToken;
132
- }
133
- validateTokenKey("clientId", ssoToken.clientId, true);
134
- validateTokenKey("clientSecret", ssoToken.clientSecret, true);
135
- validateTokenKey("refreshToken", ssoToken.refreshToken, true);
136
- try {
137
- lastRefreshAttemptTime.setTime(Date.now());
138
- const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig);
139
- validateTokenKey("accessToken", newSsoOidcToken.accessToken);
140
- validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
141
- const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
142
- try {
143
- await writeSSOTokenToFile(ssoSessionName, __spreadProps(__spreadValues({}, ssoToken), {
144
- accessToken: newSsoOidcToken.accessToken,
145
- expiresAt: newTokenExpiration.toISOString(),
146
- refreshToken: newSsoOidcToken.refreshToken
147
- }));
148
- } catch (error) {
149
- }
150
- return {
151
- token: newSsoOidcToken.accessToken,
152
- expiration: newTokenExpiration
153
- };
154
- } catch (error) {
155
- validateTokenExpiry(existingToken);
156
- return existingToken;
157
- }
158
- };
159
-
160
- // ../../node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
161
- var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
162
- var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger }) => {
163
- var _a, _b, _c, _d, _e;
164
- let token;
165
- const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
166
- if (ssoSession) {
167
- try {
168
- const _token = await fromSso({
169
- profile,
170
- filepath,
171
- configFilepath,
172
- ignoreCache
173
- })();
174
- token = {
175
- accessToken: _token.token,
176
- expiresAt: new Date(_token.expiration).toISOString()
177
- };
178
- } catch (e) {
179
- throw new CredentialsProviderError(e.message, {
180
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
181
- logger
182
- });
183
- }
184
- } else {
185
- try {
186
- token = await getSSOTokenFromFile(ssoStartUrl);
187
- } catch (e) {
188
- throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
189
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
190
- logger
191
- });
192
- }
193
- }
194
- if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
195
- throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
196
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
197
- logger
198
- });
199
- }
200
- const { accessToken } = token;
201
- const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-WMS367NT.js");
202
- const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig != null ? clientConfig : {}, {
203
- logger: (_b = (_a = clientConfig == null ? void 0 : clientConfig.logger) != null ? _a : callerClientConfig == null ? void 0 : callerClientConfig.logger) != null ? _b : parentClientConfig == null ? void 0 : parentClientConfig.logger,
204
- region: (_c = clientConfig == null ? void 0 : clientConfig.region) != null ? _c : ssoRegion,
205
- userAgentAppId: (_e = (_d = clientConfig == null ? void 0 : clientConfig.userAgentAppId) != null ? _d : callerClientConfig == null ? void 0 : callerClientConfig.userAgentAppId) != null ? _e : parentClientConfig == null ? void 0 : parentClientConfig.userAgentAppId
206
- }));
207
- let ssoResp;
208
- try {
209
- ssoResp = await sso.send(new GetRoleCredentialsCommand({
210
- accountId: ssoAccountId,
211
- roleName: ssoRoleName,
212
- accessToken
213
- }));
214
- } catch (e) {
215
- throw new CredentialsProviderError(e, {
216
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
217
- logger
218
- });
219
- }
220
- const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
221
- if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
222
- throw new CredentialsProviderError("SSO returns an invalid temporary credential.", {
223
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
224
- logger
225
- });
226
- }
227
- const credentials = __spreadValues(__spreadValues({
228
- accessKeyId,
229
- secretAccessKey,
230
- sessionToken,
231
- expiration: new Date(expiration)
232
- }, credentialScope && { credentialScope }), accountId && { accountId });
233
- if (ssoSession) {
234
- setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
235
- } else {
236
- setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
237
- }
238
- return credentials;
239
- };
240
-
241
- // ../../node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
242
- var validateSsoProfile = (profile, logger) => {
243
- const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
244
- if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
245
- throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}
246
- Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });
247
- }
248
- return profile;
249
- };
250
-
251
- // ../../node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
252
- var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
253
- var _a, _b;
254
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-sso - fromSSO");
255
- const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
256
- const { ssoClient } = init;
257
- const profileName = getProfileName({
258
- profile: (_b = init.profile) != null ? _b : callerClientConfig == null ? void 0 : callerClientConfig.profile
259
- });
260
- if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
261
- const profiles = await parseKnownFiles(init);
262
- const profile = profiles[profileName];
263
- if (!profile) {
264
- throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
265
- }
266
- if (!isSsoProfile(profile)) {
267
- throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
268
- logger: init.logger
269
- });
270
- }
271
- if (profile == null ? void 0 : profile.sso_session) {
272
- const ssoSessions = await loadSsoSessionData(init);
273
- const session = ssoSessions[profile.sso_session];
274
- const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
275
- if (ssoRegion && ssoRegion !== session.sso_region) {
276
- throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
277
- tryNextLink: false,
278
- logger: init.logger
279
- });
280
- }
281
- if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
282
- throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
283
- tryNextLink: false,
284
- logger: init.logger
285
- });
286
- }
287
- profile.sso_region = session.sso_region;
288
- profile.sso_start_url = session.sso_start_url;
289
- }
290
- const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);
291
- return resolveSSOCredentials({
292
- ssoStartUrl: sso_start_url,
293
- ssoSession: sso_session,
294
- ssoAccountId: sso_account_id,
295
- ssoRegion: sso_region,
296
- ssoRoleName: sso_role_name,
297
- ssoClient,
298
- clientConfig: init.clientConfig,
299
- parentClientConfig: init.parentClientConfig,
300
- callerClientConfig: init.callerClientConfig,
301
- profile: profileName,
302
- filepath: init.filepath,
303
- configFilepath: init.configFilepath,
304
- ignoreCache: init.ignoreCache,
305
- logger: init.logger
306
- });
307
- } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
308
- throw new CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger });
309
- } else {
310
- return resolveSSOCredentials({
311
- ssoStartUrl,
312
- ssoSession,
313
- ssoAccountId,
314
- ssoRegion,
315
- ssoRoleName,
316
- ssoClient,
317
- clientConfig: init.clientConfig,
318
- parentClientConfig: init.parentClientConfig,
319
- callerClientConfig: init.callerClientConfig,
320
- profile: profileName,
321
- filepath: init.filepath,
322
- configFilepath: init.configFilepath,
323
- ignoreCache: init.ignoreCache,
324
- logger: init.logger
325
- });
326
- }
327
- };
328
- export {
329
- fromSSO,
330
- isSsoProfile,
331
- validateSsoProfile
332
- };
333
- //# sourceMappingURL=dist-es-DLWQXBOR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/@smithy/property-provider/dist-es/TokenProviderError.js","../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js","../../../node_modules/@aws-sdk/token-providers/dist-es/constants.js","../../../node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js","../../../node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js","../../../node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js","../../../node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js","../../../node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js","../../../node_modules/@aws-sdk/token-providers/dist-es/fromSso.js","../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js","../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js","../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js"],"sourcesContent":["import { ProviderError } from \"./ProviderError\";\nexport class TokenProviderError extends ProviderError {\n name = \"TokenProviderError\";\n constructor(message, options = true) {\n super(message, options);\n Object.setPrototypeOf(this, TokenProviderError.prototype);\n }\n}\n","export const isSsoProfile = (arg) => arg &&\n (typeof arg.sso_start_url === \"string\" ||\n typeof arg.sso_account_id === \"string\" ||\n typeof arg.sso_session === \"string\" ||\n typeof arg.sso_region === \"string\" ||\n typeof arg.sso_role_name === \"string\");\n","export const EXPIRE_WINDOW_MS = 5 * 60 * 1000;\nexport const REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;\n","export const getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {\n const { SSOOIDCClient } = await import(\"@aws-sdk/nested-clients/sso-oidc\");\n const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];\n const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {\n region: ssoRegion ?? init.clientConfig?.region,\n logger: coalesce(\"logger\"),\n userAgentAppId: coalesce(\"userAgentAppId\"),\n }));\n return ssoOidcClient;\n};\n","import { getSsoOidcClient } from \"./getSsoOidcClient\";\nexport const getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {\n const { CreateTokenCommand } = await import(\"@aws-sdk/nested-clients/sso-oidc\");\n const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);\n return ssoOidcClient.send(new CreateTokenCommand({\n clientId: ssoToken.clientId,\n clientSecret: ssoToken.clientSecret,\n refreshToken: ssoToken.refreshToken,\n grantType: \"refresh_token\",\n }));\n};\n","import { TokenProviderError } from \"@smithy/property-provider\";\nimport { REFRESH_MESSAGE } from \"./constants\";\nexport const validateTokenExpiry = (token) => {\n if (token.expiration && token.expiration.getTime() < Date.now()) {\n throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);\n }\n};\n","import { TokenProviderError } from \"@smithy/property-provider\";\nimport { REFRESH_MESSAGE } from \"./constants\";\nexport const validateTokenKey = (key, value, forRefresh = false) => {\n if (typeof value === \"undefined\") {\n throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? \". Cannot refresh\" : \"\"}. ${REFRESH_MESSAGE}`, false);\n }\n};\n","import { getSSOTokenFilepath } from \"@smithy/shared-ini-file-loader\";\nimport { promises as fsPromises } from \"node:fs\";\nconst { writeFile } = fsPromises;\nexport const writeSSOTokenToFile = (id, ssoToken) => {\n const tokenFilepath = getSSOTokenFilepath(id);\n const tokenString = JSON.stringify(ssoToken, null, 2);\n return writeFile(tokenFilepath, tokenString);\n};\n","import { TokenProviderError } from \"@smithy/property-provider\";\nimport { getProfileName, getSSOTokenFromFile, loadSsoSessionData, parseKnownFiles, } from \"@smithy/shared-ini-file-loader\";\nimport { EXPIRE_WINDOW_MS, REFRESH_MESSAGE } from \"./constants\";\nimport { getNewSsoOidcToken } from \"./getNewSsoOidcToken\";\nimport { validateTokenExpiry } from \"./validateTokenExpiry\";\nimport { validateTokenKey } from \"./validateTokenKey\";\nimport { writeSSOTokenToFile } from \"./writeSSOTokenToFile\";\nconst lastRefreshAttemptTime = new Date(0);\nexport const fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/token-providers - fromSso\");\n const profiles = await parseKnownFiles(init);\n const profileName = getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n });\n const profile = profiles[profileName];\n if (!profile) {\n throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);\n }\n else if (!profile[\"sso_session\"]) {\n throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);\n }\n const ssoSessionName = profile[\"sso_session\"];\n const ssoSessions = await loadSsoSessionData(init);\n const ssoSession = ssoSessions[ssoSessionName];\n if (!ssoSession) {\n throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);\n }\n for (const ssoSessionRequiredKey of [\"sso_start_url\", \"sso_region\"]) {\n if (!ssoSession[ssoSessionRequiredKey]) {\n throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);\n }\n }\n const ssoStartUrl = ssoSession[\"sso_start_url\"];\n const ssoRegion = ssoSession[\"sso_region\"];\n let ssoToken;\n try {\n ssoToken = await getSSOTokenFromFile(ssoSessionName);\n }\n catch (e) {\n throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);\n }\n validateTokenKey(\"accessToken\", ssoToken.accessToken);\n validateTokenKey(\"expiresAt\", ssoToken.expiresAt);\n const { accessToken, expiresAt } = ssoToken;\n const existingToken = { token: accessToken, expiration: new Date(expiresAt) };\n if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {\n return existingToken;\n }\n if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {\n validateTokenExpiry(existingToken);\n return existingToken;\n }\n validateTokenKey(\"clientId\", ssoToken.clientId, true);\n validateTokenKey(\"clientSecret\", ssoToken.clientSecret, true);\n validateTokenKey(\"refreshToken\", ssoToken.refreshToken, true);\n try {\n lastRefreshAttemptTime.setTime(Date.now());\n const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig);\n validateTokenKey(\"accessToken\", newSsoOidcToken.accessToken);\n validateTokenKey(\"expiresIn\", newSsoOidcToken.expiresIn);\n const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);\n try {\n await writeSSOTokenToFile(ssoSessionName, {\n ...ssoToken,\n accessToken: newSsoOidcToken.accessToken,\n expiresAt: newTokenExpiration.toISOString(),\n refreshToken: newSsoOidcToken.refreshToken,\n });\n }\n catch (error) {\n }\n return {\n token: newSsoOidcToken.accessToken,\n expiration: newTokenExpiration,\n };\n }\n catch (error) {\n validateTokenExpiry(existingToken);\n return existingToken;\n }\n};\n","import { setCredentialFeature } from \"@aws-sdk/core/client\";\nimport { fromSso as getSsoTokenProvider } from \"@aws-sdk/token-providers\";\nimport { CredentialsProviderError } from \"@smithy/property-provider\";\nimport { getSSOTokenFromFile } from \"@smithy/shared-ini-file-loader\";\nconst SHOULD_FAIL_CREDENTIAL_CHAIN = false;\nexport const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger, }) => {\n let token;\n const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;\n if (ssoSession) {\n try {\n const _token = await getSsoTokenProvider({\n profile,\n filepath,\n configFilepath,\n ignoreCache,\n })();\n token = {\n accessToken: _token.token,\n expiresAt: new Date(_token.expiration).toISOString(),\n };\n }\n catch (e) {\n throw new CredentialsProviderError(e.message, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n }\n else {\n try {\n token = await getSSOTokenFromFile(ssoStartUrl);\n }\n catch (e) {\n throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n }\n if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {\n throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const { accessToken } = token;\n const { SSOClient, GetRoleCredentialsCommand } = await import(\"./loadSso\");\n const sso = ssoClient ||\n new SSOClient(Object.assign({}, clientConfig ?? {}, {\n logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,\n region: clientConfig?.region ?? ssoRegion,\n userAgentAppId: clientConfig?.userAgentAppId ?? callerClientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId,\n }));\n let ssoResp;\n try {\n ssoResp = await sso.send(new GetRoleCredentialsCommand({\n accountId: ssoAccountId,\n roleName: ssoRoleName,\n accessToken,\n }));\n }\n catch (e) {\n throw new CredentialsProviderError(e, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}, } = ssoResp;\n if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {\n throw new CredentialsProviderError(\"SSO returns an invalid temporary credential.\", {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const credentials = {\n accessKeyId,\n secretAccessKey,\n sessionToken,\n expiration: new Date(expiration),\n ...(credentialScope && { credentialScope }),\n ...(accountId && { accountId }),\n };\n if (ssoSession) {\n setCredentialFeature(credentials, \"CREDENTIALS_SSO\", \"s\");\n }\n else {\n setCredentialFeature(credentials, \"CREDENTIALS_SSO_LEGACY\", \"u\");\n }\n return credentials;\n};\n","import { CredentialsProviderError } from \"@smithy/property-provider\";\nexport const validateSsoProfile = (profile, logger) => {\n const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;\n if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {\n throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", ` +\n `\"sso_region\", \"sso_role_name\", \"sso_start_url\". Got ${Object.keys(profile).join(\", \")}\\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });\n }\n return profile;\n};\n","import { CredentialsProviderError } from \"@smithy/property-provider\";\nimport { getProfileName, loadSsoSessionData, parseKnownFiles } from \"@smithy/shared-ini-file-loader\";\nimport { isSsoProfile } from \"./isSsoProfile\";\nimport { resolveSSOCredentials } from \"./resolveSSOCredentials\";\nimport { validateSsoProfile } from \"./validateSsoProfile\";\nexport const fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-sso - fromSSO\");\n const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;\n const { ssoClient } = init;\n const profileName = getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n });\n if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {\n const profiles = await parseKnownFiles(init);\n const profile = profiles[profileName];\n if (!profile) {\n throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });\n }\n if (!isSsoProfile(profile)) {\n throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {\n logger: init.logger,\n });\n }\n if (profile?.sso_session) {\n const ssoSessions = await loadSsoSessionData(init);\n const session = ssoSessions[profile.sso_session];\n const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;\n if (ssoRegion && ssoRegion !== session.sso_region) {\n throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {\n tryNextLink: false,\n logger: init.logger,\n });\n }\n if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {\n throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {\n tryNextLink: false,\n logger: init.logger,\n });\n }\n profile.sso_region = session.sso_region;\n profile.sso_start_url = session.sso_start_url;\n }\n const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);\n return resolveSSOCredentials({\n ssoStartUrl: sso_start_url,\n ssoSession: sso_session,\n ssoAccountId: sso_account_id,\n ssoRegion: sso_region,\n ssoRoleName: sso_role_name,\n ssoClient: ssoClient,\n clientConfig: init.clientConfig,\n parentClientConfig: init.parentClientConfig,\n callerClientConfig: init.callerClientConfig,\n profile: profileName,\n filepath: init.filepath,\n configFilepath: init.configFilepath,\n ignoreCache: init.ignoreCache,\n logger: init.logger,\n });\n }\n else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {\n throw new CredentialsProviderError(\"Incomplete configuration. The fromSSO() argument hash must include \" +\n '\"ssoStartUrl\", \"ssoAccountId\", \"ssoRegion\", \"ssoRoleName\"', { tryNextLink: false, logger: init.logger });\n }\n else {\n return resolveSSOCredentials({\n ssoStartUrl,\n ssoSession,\n ssoAccountId,\n ssoRegion,\n ssoRoleName,\n ssoClient,\n clientConfig: init.clientConfig,\n parentClientConfig: init.parentClientConfig,\n callerClientConfig: init.callerClientConfig,\n profile: profileName,\n filepath: init.filepath,\n configFilepath: init.configFilepath,\n ignoreCache: init.ignoreCache,\n logger: init.logger,\n });\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACO,IAAM,qBAAN,MAAM,4BAA2B,cAAc;AAAA,EAElD,YAAY,SAAS,UAAU,MAAM;AACjC,UAAM,SAAS,OAAO;AAF1B,gCAAO;AAGH,WAAO,eAAe,MAAM,oBAAmB,SAAS;AAAA,EAC5D;AACJ;;;ACPO,IAAM,eAAe,CAAC,QAAQ,QAChC,OA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Q,gBAAgB,QAAQ;AAAA,IACpC;AACA,UAAM,EAAE,eAAe,gBAAgB,YAAY,eAAe,YAAY,IAAI,mBAAmB,SAAS,KAAK,MAAM;AACzH,WAAO,sBAAsB;AAAA,MACzB,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,WAAW;AAAA,MACX,aAAa;AAAA,MACb;AAAA,MACA,cAAc,KAAK;AAAA,MACnB,oBAAoB,KAAK;AAAA,MACzB,oBAAoB,KAAK;AAAA,MACzB,SAAS;AAAA,MACT,UAAU,KAAK;AAAA,MACf,gBAAgB,KAAK;AAAA,MACrB,aAAa,KAAK;AAAA,MAClB,QAAQ,KAAK;AAAA,IACjB,CAAC;AAAA,EACL,WACS,CAAC,eAAe,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAa;AAClE,UAAM,IAAI,yBAAyB,gIAC8B,EAAE,aAAa,OAAO,QAAQ,KAAK,OAAO,CAAC;AAAA,EAChH,OACK;AACD,WAAO,sBAAsB;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAc,KAAK;AAAA,MACnB,oBAAoB,KAAK;AAAA,MACzB,oBAAoB,KAAK;AAAA,MACzB,SAAS;AAAA,MACT,UAAU,KAAK;AAAA,MACf,gBAAgB,KAAK;AAAA,MACrB,aAAa,KAAK;AAAA,MAClB,QAAQ,KAAK;AAAA,IACjB,CAAC;AAAA,EACL;AACJ;","names":["_a","_b"]}
@@ -1,71 +0,0 @@
1
- import {
2
- externalDataInterceptor
3
- } from "./chunk-RPNCWADG.js";
4
- import {
5
- setCredentialFeature
6
- } from "./chunk-A5TI2FW3.js";
7
- import {
8
- CredentialsProviderError
9
- } from "./chunk-5XIRNUBL.js";
10
- import {
11
- __spreadProps,
12
- __spreadValues
13
- } from "./chunk-MIXAYX55.js";
14
-
15
- // ../../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
16
- import { readFileSync } from "fs";
17
-
18
- // ../../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js
19
- var fromWebToken = (init) => async (awsIdentityProperties) => {
20
- var _a;
21
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
22
- const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
23
- let { roleAssumerWithWebIdentity } = init;
24
- if (!roleAssumerWithWebIdentity) {
25
- const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-LKM23TRV.js");
26
- roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity(__spreadProps(__spreadValues({}, init.clientConfig), {
27
- credentialProviderLogger: init.logger,
28
- parentClientConfig: __spreadValues(__spreadValues({}, awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig), init.parentClientConfig)
29
- }), init.clientPlugins);
30
- }
31
- return roleAssumerWithWebIdentity({
32
- RoleArn: roleArn,
33
- RoleSessionName: roleSessionName != null ? roleSessionName : `aws-sdk-js-session-${Date.now()}`,
34
- WebIdentityToken: webIdentityToken,
35
- ProviderId: providerId,
36
- PolicyArns: policyArns,
37
- Policy: policy,
38
- DurationSeconds: durationSeconds
39
- });
40
- };
41
-
42
- // ../../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
43
- var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
44
- var ENV_ROLE_ARN = "AWS_ROLE_ARN";
45
- var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
46
- var fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
47
- var _a, _b, _c, _d, _e, _f, _g;
48
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
49
- const webIdentityTokenFile = (_b = init == null ? void 0 : init.webIdentityTokenFile) != null ? _b : process.env[ENV_TOKEN_FILE];
50
- const roleArn = (_c = init == null ? void 0 : init.roleArn) != null ? _c : process.env[ENV_ROLE_ARN];
51
- const roleSessionName = (_d = init == null ? void 0 : init.roleSessionName) != null ? _d : process.env[ENV_ROLE_SESSION_NAME];
52
- if (!webIdentityTokenFile || !roleArn) {
53
- throw new CredentialsProviderError("Web identity configuration not specified", {
54
- logger: init.logger
55
- });
56
- }
57
- const credentials = await fromWebToken(__spreadProps(__spreadValues({}, init), {
58
- webIdentityToken: (_g = (_f = (_e = externalDataInterceptor) == null ? void 0 : _e.getTokenRecord) == null ? void 0 : _f.call(_e)[webIdentityTokenFile]) != null ? _g : readFileSync(webIdentityTokenFile, { encoding: "ascii" }),
59
- roleArn,
60
- roleSessionName
61
- }))(awsIdentityProperties);
62
- if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
63
- setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
64
- }
65
- return credentials;
66
- };
67
- export {
68
- fromTokenFile,
69
- fromWebToken
70
- };
71
- //# sourceMappingURL=dist-es-EMJCB37T.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js","../../../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js"],"sourcesContent":["import { setCredentialFeature } from \"@aws-sdk/core/client\";\nimport { CredentialsProviderError } from \"@smithy/property-provider\";\nimport { externalDataInterceptor } from \"@smithy/shared-ini-file-loader\";\nimport { readFileSync } from \"node:fs\";\nimport { fromWebToken } from \"./fromWebToken\";\nconst ENV_TOKEN_FILE = \"AWS_WEB_IDENTITY_TOKEN_FILE\";\nconst ENV_ROLE_ARN = \"AWS_ROLE_ARN\";\nconst ENV_ROLE_SESSION_NAME = \"AWS_ROLE_SESSION_NAME\";\nexport const fromTokenFile = (init = {}) => async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-web-identity - fromTokenFile\");\n const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];\n const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];\n const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];\n if (!webIdentityTokenFile || !roleArn) {\n throw new CredentialsProviderError(\"Web identity configuration not specified\", {\n logger: init.logger,\n });\n }\n const credentials = await fromWebToken({\n ...init,\n webIdentityToken: externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ??\n readFileSync(webIdentityTokenFile, { encoding: \"ascii\" }),\n roleArn,\n roleSessionName,\n })(awsIdentityProperties);\n if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {\n setCredentialFeature(credentials, \"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN\", \"h\");\n }\n return credentials;\n};\n","export const fromWebToken = (init) => async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-web-identity - fromWebToken\");\n const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;\n let { roleAssumerWithWebIdentity } = init;\n if (!roleAssumerWithWebIdentity) {\n const { getDefaultRoleAssumerWithWebIdentity } = await import(\"@aws-sdk/nested-clients/sts\");\n roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({\n ...init.clientConfig,\n credentialProviderLogger: init.logger,\n parentClientConfig: {\n ...awsIdentityProperties?.callerClientConfig,\n ...init.parentClientConfig,\n },\n }, init.clientPlugins);\n }\n return roleAssumerWithWebIdentity({\n RoleArn: roleArn,\n RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,\n WebIdentityToken: webIdentityToken,\n ProviderId: providerId,\n PolicyArns: policyArns,\n Policy: policy,\n DurationSeconds: durationSeconds,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AAGA,SAAS,oBAAoB;;;ACHtB,IAAM,eAAe,CAAC,SAAS,OAAO,0BAA0B;AAAvE;AACI,aAAK,WAAL,mBAAa,MAAM;AACnB,QAAM,EAAE,SAAS,iBAAiB,kBAAkB,YAAY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