dynamic-mui 2.2.0 → 2.3.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 (166) hide show
  1. package/README.md +142 -5
  2. package/dist/accordion-DqBdGRim.mjs +23 -0
  3. package/dist/accordion-lvbD_BpX.js +1 -0
  4. package/dist/addressfield-CGX3UppE.mjs +152 -0
  5. package/dist/addressfield-DDG15fqJ.js +1 -0
  6. package/dist/asyncautocomplete-BAfBR9P7.mjs +89 -0
  7. package/dist/asyncautocomplete-w9q_1DWt.js +1 -0
  8. package/dist/bar-BzO7tvYJ.mjs +20 -0
  9. package/dist/bar-DEVxyUVS.js +1 -0
  10. package/dist/cascadeselect-C3QVfoig.mjs +64 -0
  11. package/dist/cascadeselect-DzbhK9en.js +1 -0
  12. package/dist/colorpicker-5qmEq7ZI.js +1 -0
  13. package/dist/colorpicker-DhNZulJY.mjs +98 -0
  14. package/dist/components/DynamicComponent.d.ts +2 -0
  15. package/dist/components/FormGenerator.d.ts +99 -10
  16. package/dist/components/controls/index.d.ts +45 -79
  17. package/dist/consentfield-B7Rm8d3U.js +1 -0
  18. package/dist/consentfield-CBQUR4J5.mjs +78 -0
  19. package/dist/datatable-BIQznwQe.mjs +20 -0
  20. package/dist/datatable-BWlcUP0M.js +1 -0
  21. package/dist/dynamic-mui.cjs +1 -0
  22. package/dist/dynamic-mui.mjs +32 -0
  23. package/dist/editabletable-DCoRmsEO.js +1 -0
  24. package/dist/editabletable-DRlBV8lk.mjs +126 -0
  25. package/dist/fileupload-ByBv1UjT.mjs +172 -0
  26. package/dist/fileupload-Cze3Oc_2.js +1 -0
  27. package/dist/formrepeater-BBkKGLFJ.mjs +71 -0
  28. package/dist/formrepeater-BxJzXoHx.js +1 -0
  29. package/dist/formwizard-BDZE1UDD.js +1 -0
  30. package/dist/formwizard-D2u1bMvK.mjs +83 -0
  31. package/dist/geofield-8WTeZk0Z.mjs +104 -0
  32. package/dist/geofield-Bw3p4NLJ.js +1 -0
  33. package/dist/group-B2mSylHd.mjs +23 -0
  34. package/dist/group-BlfO3ZZf.js +1 -0
  35. package/dist/imagelist-Bn9QhIv7.js +1 -0
  36. package/dist/imagelist-rqmJajHt.mjs +18 -0
  37. package/dist/index-CddjLTWF.mjs +12499 -0
  38. package/dist/index-D08GIfqF.js +43 -0
  39. package/dist/index.d.ts +9 -1
  40. package/dist/intlphone-B_Xn98pU.js +1 -0
  41. package/dist/intlphone-DtQZ12xk.mjs +140 -0
  42. package/dist/keyvaluefield-B_1NeGuP.mjs +125 -0
  43. package/dist/keyvaluefield-DyKCGd32.js +1 -0
  44. package/dist/line-B-DwR1hm.mjs +20 -0
  45. package/dist/line-BkymZu31.js +1 -0
  46. package/dist/lineitemlist-DGo8UOZC.js +1 -0
  47. package/dist/lineitemlist-vGKzJlQx.mjs +166 -0
  48. package/dist/list-7uNWrepS.mjs +20 -0
  49. package/dist/list-C0FgmtQw.js +1 -0
  50. package/dist/locationfield-CeUgxLkQ.mjs +119 -0
  51. package/dist/locationfield-Duyw1ZEz.js +1 -0
  52. package/dist/markdowneditor-B1y-hfny.mjs +90 -0
  53. package/dist/markdowneditor-Db0Un1_Z.js +2 -0
  54. package/dist/matrixfield-C7Sc-YpI.mjs +117 -0
  55. package/dist/matrixfield-CckODuPn.js +1 -0
  56. package/dist/mixChart-C3o184UT.js +1 -0
  57. package/dist/mixChart-ISf3Kbr-.mjs +75 -0
  58. package/dist/multitextbox-BYazIAeG.js +1 -0
  59. package/dist/multitextbox-ide2lvJ6.mjs +78 -0
  60. package/dist/npsscale-C2e88qk_.js +1 -0
  61. package/dist/npsscale-lndz7GEq.mjs +87 -0
  62. package/dist/numberstepper-DitbcvV9.mjs +128 -0
  63. package/dist/numberstepper-DyRjQM_K.js +1 -0
  64. package/dist/pie-CJSL8Sv5.js +1 -0
  65. package/dist/pie-CL29dlh5.mjs +20 -0
  66. package/dist/richtexteditor-CVg-MnKp.js +1 -0
  67. package/dist/richtexteditor-DsC1XC7h.mjs +141 -0
  68. package/dist/s3Upload-B0JeoLkS.js +1 -0
  69. package/dist/s3Upload-dpioZ2c8.mjs +51 -0
  70. package/dist/signature-14OrZriO.mjs +1225 -0
  71. package/dist/signature-D582X6tB.js +2 -0
  72. package/dist/stepper-B-FpcZvT.js +1 -0
  73. package/dist/stepper-CDfEy_C6.mjs +140 -0
  74. package/dist/summaryfield-B08ZmVHh.js +1 -0
  75. package/dist/summaryfield-CTpPlZBG.mjs +96 -0
  76. package/dist/tabs-BIliqFOs.js +1 -0
  77. package/dist/tabs-DDeJCFt8.mjs +39 -0
  78. package/dist/tagsinput-D-q6rRZS.mjs +58 -0
  79. package/dist/tagsinput-qh_lhdFb.js +1 -0
  80. package/dist/util/registry.d.ts +29 -0
  81. package/dist/util/resolvers.d.ts +45 -0
  82. package/dist/util/useFormEngine.d.ts +74 -0
  83. package/dist/util/validateSchema.d.ts +23 -0
  84. package/dist/v4-BysszJq8.mjs +30 -0
  85. package/dist/v4-CqdK_b8Y.js +1 -0
  86. package/package.json +36 -11
  87. package/dist/AxisSharedComponents-BbsKw1BT.js +0 -3
  88. package/dist/AxisSharedComponents-xLtpOLH_.mjs +0 -605
  89. package/dist/ChartsAxis-CANvBdY9.mjs +0 -47
  90. package/dist/ChartsAxis-EZ7m_KrU.js +0 -1
  91. package/dist/ChartsGrid-BCRTvNTr.js +0 -3
  92. package/dist/ChartsGrid-C_HT7qpL.mjs +0 -381
  93. package/dist/ChartsWrapper-CM7EDyAK.js +0 -5
  94. package/dist/ChartsWrapper-CO5_Z6BD.mjs +0 -1878
  95. package/dist/ChartsXAxis-CPmuCRhq.mjs +0 -487
  96. package/dist/ChartsXAxis-DFFY1sPg.js +0 -3
  97. package/dist/ChartsYAxis-DLUMr9vG.mjs +0 -392
  98. package/dist/ChartsYAxis-fpevi1sP.js +0 -1
  99. package/dist/XmlShapeDeserializer-3yQdm0b0.mjs +0 -237
  100. package/dist/XmlShapeDeserializer-XKJAoqLc.js +0 -1
  101. package/dist/clampAngle-BvZjnf53.mjs +0 -11
  102. package/dist/clampAngle-DpAsDoeT.js +0 -1
  103. package/dist/createSelector-B-9FwV16.mjs +0 -430
  104. package/dist/createSelector-f0oqn8Lr.js +0 -7
  105. package/dist/date-utils-CFUUt6NL.js +0 -4
  106. package/dist/date-utils-pGzaKb0p.mjs +0 -477
  107. package/dist/dynamic-mui.cjs.js +0 -1
  108. package/dist/dynamic-mui.es.js +0 -22
  109. package/dist/index--8Zky9Oh.js +0 -299
  110. package/dist/index-6WTs1Xy_.js +0 -1
  111. package/dist/index-B1R1akM2.js +0 -1
  112. package/dist/index-BW8_rRff.js +0 -7
  113. package/dist/index-BXFVK_GX.js +0 -1
  114. package/dist/index-B_KNUTjy.js +0 -1
  115. package/dist/index-BhaKvHkU.mjs +0 -62051
  116. package/dist/index-Bif92ima.js +0 -1
  117. package/dist/index-BnZOu8CL.js +0 -1
  118. package/dist/index-CDxpgRlR.mjs +0 -7
  119. package/dist/index-CThMfvtJ.mjs +0 -2555
  120. package/dist/index-CVqLvm8B.js +0 -1
  121. package/dist/index-CodJBIn6.mjs +0 -1665
  122. package/dist/index-Cr6Wp_S-.mjs +0 -3141
  123. package/dist/index-CslPwsrf.mjs +0 -4
  124. package/dist/index-CuV0MQzZ.mjs +0 -1173
  125. package/dist/index-DA0XouZs.mjs +0 -153
  126. package/dist/index-DKS5Sz9e.js +0 -14
  127. package/dist/index-DSkYYZuW.mjs +0 -4
  128. package/dist/index-DU78_FiA.js +0 -1
  129. package/dist/index-D_mYhgJ0.js +0 -10
  130. package/dist/index-DcWfyXJp.mjs +0 -92
  131. package/dist/index-Dlimbnxj.mjs +0 -2965
  132. package/dist/index-MllWgTJ5.mjs +0 -9372
  133. package/dist/index-in5z9hUb.js +0 -133
  134. package/dist/index-qUW7FnZ-.mjs +0 -20540
  135. package/dist/index.browser-BSu11T_q.mjs +0 -363
  136. package/dist/index.browser-By7-GABP.js +0 -4
  137. package/dist/isDeepEqual-BHfPvf9U.mjs +0 -393
  138. package/dist/isDeepEqual-CqxZGVRk.js +0 -1
  139. package/dist/loadCognitoIdentity-DtYTy-DW.js +0 -1
  140. package/dist/loadCognitoIdentity-DzdR91GB.mjs +0 -872
  141. package/dist/loadSts-Cic6UToN.mjs +0 -593
  142. package/dist/loadSts-csbFP6zX.js +0 -1
  143. package/dist/main.d.ts +0 -1
  144. package/dist/noAuth-B8ui2kBg.mjs +0 -71
  145. package/dist/noAuth-JPA2o4dt.js +0 -1
  146. package/dist/playground/AIContext.d.ts +0 -18
  147. package/dist/playground/AIPanel.d.ts +0 -10
  148. package/dist/playground/Builder.d.ts +0 -1
  149. package/dist/playground/Canvas.d.ts +0 -9
  150. package/dist/playground/DemoGallery.d.ts +0 -6
  151. package/dist/playground/PropertiesEditor.d.ts +0 -10
  152. package/dist/playground/Sidebar.d.ts +0 -9
  153. package/dist/playground/demoForms.d.ts +0 -3
  154. package/dist/playground/demoRecipes.d.ts +0 -15
  155. package/dist/playground/demoVariants.d.ts +0 -11
  156. package/dist/playground/documentation.d.ts +0 -6
  157. package/dist/playground/templates.d.ts +0 -7
  158. package/dist/playground/testData.d.ts +0 -2
  159. package/dist/test/setup.d.ts +0 -0
  160. package/dist/theme/theme.d.ts +0 -6
  161. package/dist/useAxis-DSbfEtO7.js +0 -3
  162. package/dist/useAxis-SiNBMMWq.mjs +0 -3010
  163. package/dist/useChartContainerProps-Bl3hO-r1.mjs +0 -5418
  164. package/dist/useChartContainerProps-C_C_PZoi.js +0 -12
  165. package/dist/useItemHighlightedGetter-9CIwqsGj.js +0 -1
  166. package/dist/useItemHighlightedGetter-CTISrNdV.mjs +0 -88
@@ -1,3141 +0,0 @@
1
- import { i as te, H as x, f as J, a as xt, e as It, t as Ot, j as k, k as _t, l as X, n as z } from "./date-utils-pGzaKb0p.mjs";
2
- const kn = (t) => ({
3
- setHttpHandler(e) {
4
- t.httpHandler = e;
5
- },
6
- httpHandler() {
7
- return t.httpHandler;
8
- },
9
- updateHttpClientConfig(e, r) {
10
- t.httpHandler?.updateHttpClientConfig(e, r);
11
- },
12
- httpHandlerConfigs() {
13
- return t.httpHandler.httpHandlerConfigs();
14
- }
15
- }), Mn = (t) => ({
16
- httpHandler: t.httpHandler()
17
- });
18
- var B;
19
- (function(t) {
20
- t.HTTP = "http", t.HTTPS = "https";
21
- })(B || (B = {}));
22
- var Z;
23
- (function(t) {
24
- t.MD5 = "md5", t.CRC32 = "crc32", t.CRC32C = "crc32c", t.SHA1 = "sha1", t.SHA256 = "sha256";
25
- })(Z || (Z = {}));
26
- const ge = "__smithy_context";
27
- function kt(t, e, r) {
28
- return t.$source || (t.$source = {}), t.$source[e] = r, t;
29
- }
30
- function C(t, e, r) {
31
- t.__aws_sdk_context ? t.__aws_sdk_context.features || (t.__aws_sdk_context.features = {}) : t.__aws_sdk_context = {
32
- features: {}
33
- }, t.__aws_sdk_context.features[e] = r;
34
- }
35
- const Ie = (t) => te.isInstance(t) ? t.headers?.date ?? t.headers?.Date : void 0, Ze = (t) => new Date(Date.now() + t), Mt = (t, e) => Math.abs(Ze(e).getTime() - t) >= 3e5, Oe = (t, e) => {
36
- const r = Date.parse(t);
37
- return Mt(r, e) ? r - Date.now() : e;
38
- }, F = (t, e) => {
39
- if (!e)
40
- throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);
41
- return e;
42
- }, Pt = async (t) => {
43
- const e = F("context", t.context), r = F("config", t.config), s = e.endpointV2?.properties?.authSchemes?.[0], i = await F("signer", r.signer)(s), a = t?.signingRegion, c = t?.signingRegionSet, u = t?.signingName;
44
- return {
45
- config: r,
46
- signer: i,
47
- signingRegion: a,
48
- signingRegionSet: c,
49
- signingName: u
50
- };
51
- };
52
- class Pn {
53
- async sign(e, r, s) {
54
- if (!x.isInstance(e))
55
- throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
56
- const n = await Pt(s), { config: i, signer: a } = n;
57
- let { signingRegion: c, signingName: u } = n;
58
- const o = s.context;
59
- if (o?.authSchemes?.length ?? !1) {
60
- const [d, l] = o.authSchemes;
61
- d?.name === "sigv4a" && l?.name === "sigv4" && (c = l?.signingRegion ?? c, u = l?.signingName ?? u);
62
- }
63
- return await a.sign(e, {
64
- signingDate: Ze(i.systemClockOffset),
65
- signingRegion: c,
66
- signingService: u
67
- });
68
- }
69
- errorHandler(e) {
70
- return (r) => {
71
- const s = r.ServerTime ?? Ie(r.$response);
72
- if (s) {
73
- const n = F("config", e.config), i = n.systemClockOffset;
74
- n.systemClockOffset = Oe(s, n.systemClockOffset), n.systemClockOffset !== i && r.$metadata && (r.$metadata.clockSkewCorrected = !0);
75
- }
76
- throw r;
77
- };
78
- }
79
- successHandler(e, r) {
80
- const s = Ie(e);
81
- if (s) {
82
- const n = F("config", r.config);
83
- n.systemClockOffset = Oe(s, n.systemClockOffset);
84
- }
85
- }
86
- }
87
- const V = (t) => t[ge] || (t[ge] = {}), M = (t) => {
88
- if (typeof t == "function")
89
- return t;
90
- const e = Promise.resolve(t);
91
- return () => e;
92
- }, $t = (t, e) => {
93
- if (!e || e.length === 0)
94
- return t;
95
- const r = [];
96
- for (const s of e)
97
- for (const n of t)
98
- n.schemeId.split("#")[1] === s && r.push(n);
99
- for (const s of t)
100
- r.find(({ schemeId: n }) => n === s.schemeId) || r.push(s);
101
- return r;
102
- };
103
- function Nt(t) {
104
- const e = /* @__PURE__ */ new Map();
105
- for (const r of t)
106
- e.set(r.schemeId, r);
107
- return e;
108
- }
109
- const Dt = (t, e) => (r, s) => async (n) => {
110
- const i = t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t, s, n.input)), a = t.authSchemePreference ? await t.authSchemePreference() : [], c = $t(i, a), u = Nt(t.httpAuthSchemes), o = V(s), h = [];
111
- for (const d of c) {
112
- const l = u.get(d.schemeId);
113
- if (!l) {
114
- h.push(`HttpAuthScheme \`${d.schemeId}\` was not enabled for this service.`);
115
- continue;
116
- }
117
- const f = l.identityProvider(await e.identityProviderConfigProvider(t));
118
- if (!f) {
119
- h.push(`HttpAuthScheme \`${d.schemeId}\` did not have an IdentityProvider configured.`);
120
- continue;
121
- }
122
- const { identityProperties: m = {}, signingProperties: g = {} } = d.propertiesExtractor?.(t, s) || {};
123
- d.identityProperties = Object.assign(d.identityProperties || {}, m), d.signingProperties = Object.assign(d.signingProperties || {}, g), o.selectedHttpAuthScheme = {
124
- httpAuthOption: d,
125
- identity: await f(d.identityProperties),
126
- signer: l.signer
127
- };
128
- break;
129
- }
130
- if (!o.selectedHttpAuthScheme)
131
- throw new Error(h.join(`
132
- `));
133
- return r(n);
134
- }, Ut = {
135
- step: "serialize",
136
- tags: ["HTTP_AUTH_SCHEME"],
137
- name: "httpAuthSchemeMiddleware",
138
- override: !0,
139
- relation: "before",
140
- toMiddleware: "endpointV2Middleware"
141
- }, $n = (t, { httpAuthSchemeParametersProvider: e, identityProviderConfigProvider: r }) => ({
142
- applyToStack: (s) => {
143
- s.addRelativeTo(Dt(t, {
144
- httpAuthSchemeParametersProvider: e,
145
- identityProviderConfigProvider: r
146
- }), Ut);
147
- }
148
- }), Lt = {
149
- name: "serializerMiddleware"
150
- }, Ht = (t) => (e) => {
151
- throw e;
152
- }, zt = (t, e) => {
153
- }, Ft = (t) => (e, r) => async (s) => {
154
- if (!x.isInstance(s.request))
155
- return e(s);
156
- const i = V(r).selectedHttpAuthScheme;
157
- if (!i)
158
- throw new Error("No HttpAuthScheme was selected: unable to sign request");
159
- const { httpAuthOption: { signingProperties: a = {} }, identity: c, signer: u } = i, o = await e({
160
- ...s,
161
- request: await u.sign(s.request, c, a)
162
- }).catch((u.errorHandler || Ht)(a));
163
- return (u.successHandler || zt)(o.response, a), o;
164
- }, Bt = {
165
- step: "finalizeRequest",
166
- tags: ["HTTP_SIGNING"],
167
- name: "httpSigningMiddleware",
168
- aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
169
- override: !0,
170
- relation: "after",
171
- toMiddleware: "retryMiddleware"
172
- }, Nn = (t) => ({
173
- applyToStack: (e) => {
174
- e.addRelativeTo(Ft(), Bt);
175
- }
176
- }), j = (t) => typeof t == "string" ? J(t) : ArrayBuffer.isView(t) ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength / Uint8Array.BYTES_PER_ELEMENT) : new Uint8Array(t);
177
- class P extends Uint8Array {
178
- static fromString(e, r = "utf-8") {
179
- if (typeof e == "string")
180
- return r === "base64" ? P.mutate(xt(e)) : P.mutate(J(e));
181
- throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`);
182
- }
183
- static mutate(e) {
184
- return Object.setPrototypeOf(e, P.prototype), e;
185
- }
186
- transformToString(e = "utf-8") {
187
- return e === "base64" ? It(this) : Ot(this);
188
- }
189
- }
190
- const Dn = async (t = new Uint8Array(), e) => {
191
- if (t instanceof Uint8Array)
192
- return P.mutate(t);
193
- if (!t)
194
- return P.mutate(new Uint8Array());
195
- const r = e.streamCollector(t);
196
- return P.mutate(await r);
197
- }, ie = (t) => typeof t == "function" ? t() : t, et = (t, e, r, s, n) => ({
198
- name: e,
199
- namespace: t,
200
- traits: r,
201
- input: s,
202
- output: n
203
- }), jt = (t) => (e, r) => async (s) => {
204
- const { response: n } = await e(s), { operationSchema: i } = V(r), [, a, c, u, o, h] = i ?? [];
205
- try {
206
- const d = await t.protocol.deserializeResponse(et(a, c, u, o, h), {
207
- ...t,
208
- ...r
209
- }, n);
210
- return {
211
- response: n,
212
- output: d
213
- };
214
- } catch (d) {
215
- if (Object.defineProperty(d, "$response", {
216
- value: n,
217
- enumerable: !1,
218
- writable: !1,
219
- configurable: !1
220
- }), !("$metadata" in d)) {
221
- const l = "Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";
222
- try {
223
- d.message += `
224
- ` + l;
225
- } catch {
226
- !r.logger || r.logger?.constructor?.name === "NoOpLogger" ? console.warn(l) : r.logger?.warn?.(l);
227
- }
228
- typeof d.$responseBodyText < "u" && d.$response && (d.$response.body = d.$responseBodyText);
229
- try {
230
- if (te.isInstance(n)) {
231
- const { headers: f = {} } = n, m = Object.entries(f);
232
- d.$metadata = {
233
- httpStatusCode: n.statusCode,
234
- requestId: ae(/^x-[\w-]+-request-?id$/, m),
235
- extendedRequestId: ae(/^x-[\w-]+-id-2$/, m),
236
- cfId: ae(/^x-[\w-]+-cf-id$/, m)
237
- };
238
- }
239
- } catch {
240
- }
241
- }
242
- throw d;
243
- }
244
- }, ae = (t, e) => (e.find(([r]) => r.match(t)) || [void 0, void 0])[1], qt = (t) => (e, r) => async (s) => {
245
- const { operationSchema: n } = V(r), [, i, a, c, u, o] = n ?? [], h = r.endpointV2?.url && t.urlParser ? async () => t.urlParser(r.endpointV2.url) : t.endpoint, d = await t.protocol.serializeRequest(et(i, a, c, u, o), s.input, {
246
- ...t,
247
- ...r,
248
- endpoint: h
249
- });
250
- return e({
251
- ...s,
252
- request: d
253
- });
254
- }, Gt = {
255
- name: "deserializerMiddleware",
256
- step: "deserialize",
257
- tags: ["DESERIALIZER"],
258
- override: !0
259
- }, Vt = {
260
- name: "serializerMiddleware",
261
- step: "serialize",
262
- tags: ["SERIALIZER"],
263
- override: !0
264
- };
265
- function Un(t) {
266
- return {
267
- applyToStack: (e) => {
268
- e.add(qt(t), Vt), e.add(jt(t), Gt), t.protocol.setSerdeContext(t);
269
- }
270
- };
271
- }
272
- function L(t) {
273
- if (typeof t == "object")
274
- return t;
275
- t = t | 0;
276
- const e = {};
277
- let r = 0;
278
- for (const s of [
279
- "httpLabel",
280
- "idempotent",
281
- "idempotencyToken",
282
- "sensitive",
283
- "httpPayload",
284
- "httpResponseCode",
285
- "httpQueryParams"
286
- ])
287
- (t >> r++ & 1) === 1 && (e[s] = 1);
288
- return e;
289
- }
290
- const _e = {
291
- it: /* @__PURE__ */ Symbol.for("@smithy/nor-struct-it")
292
- };
293
- class A {
294
- ref;
295
- memberName;
296
- static symbol = /* @__PURE__ */ Symbol.for("@smithy/nor");
297
- symbol = A.symbol;
298
- name;
299
- schema;
300
- _isMemberSchema;
301
- traits;
302
- memberTraits;
303
- normalizedTraits;
304
- constructor(e, r) {
305
- this.ref = e, this.memberName = r;
306
- const s = [];
307
- let n = e, i = e;
308
- for (this._isMemberSchema = !1; oe(n); )
309
- s.push(n[1]), n = n[0], i = ie(n), this._isMemberSchema = !0;
310
- if (s.length > 0) {
311
- this.memberTraits = {};
312
- for (let a = s.length - 1; a >= 0; --a) {
313
- const c = s[a];
314
- Object.assign(this.memberTraits, L(c));
315
- }
316
- } else
317
- this.memberTraits = 0;
318
- if (i instanceof A) {
319
- const a = this.memberTraits;
320
- Object.assign(this, i), this.memberTraits = Object.assign({}, a, i.getMemberTraits(), this.getMemberTraits()), this.normalizedTraits = void 0, this.memberName = r ?? i.memberName;
321
- return;
322
- }
323
- if (this.schema = ie(i), Wt(this.schema) ? (this.name = `${this.schema[1]}#${this.schema[2]}`, this.traits = this.schema[3]) : (this.name = this.memberName ?? String(i), this.traits = 0), this._isMemberSchema && !r)
324
- throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`);
325
- }
326
- static [Symbol.hasInstance](e) {
327
- const r = this.prototype.isPrototypeOf(e);
328
- return !r && typeof e == "object" && e !== null ? e.symbol === this.symbol : r;
329
- }
330
- static of(e) {
331
- const r = ie(e);
332
- if (r instanceof A)
333
- return r;
334
- if (oe(r)) {
335
- const [s, n] = r;
336
- if (s instanceof A)
337
- return Object.assign(s.getMergedTraits(), L(n)), s;
338
- throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e, null, 2)}.`);
339
- }
340
- return new A(r);
341
- }
342
- getSchema() {
343
- const e = this.schema;
344
- return Array.isArray(e) && e[0] === 0 ? e[4] : e;
345
- }
346
- getName(e = !1) {
347
- const { name: r } = this;
348
- return !e && r && r.includes("#") ? r.split("#")[1] : r || void 0;
349
- }
350
- getMemberName() {
351
- return this.memberName;
352
- }
353
- isMemberSchema() {
354
- return this._isMemberSchema;
355
- }
356
- isListSchema() {
357
- const e = this.getSchema();
358
- return typeof e == "number" ? e >= 64 && e < 128 : e[0] === 1;
359
- }
360
- isMapSchema() {
361
- const e = this.getSchema();
362
- return typeof e == "number" ? e >= 128 && e <= 255 : e[0] === 2;
363
- }
364
- isStructSchema() {
365
- const e = this.getSchema();
366
- if (typeof e != "object")
367
- return !1;
368
- const r = e[0];
369
- return r === 3 || r === -3 || r === 4;
370
- }
371
- isUnionSchema() {
372
- const e = this.getSchema();
373
- return typeof e != "object" ? !1 : e[0] === 4;
374
- }
375
- isBlobSchema() {
376
- const e = this.getSchema();
377
- return e === 21 || e === 42;
378
- }
379
- isTimestampSchema() {
380
- const e = this.getSchema();
381
- return typeof e == "number" && e >= 4 && e <= 7;
382
- }
383
- isUnitSchema() {
384
- return this.getSchema() === "unit";
385
- }
386
- isDocumentSchema() {
387
- return this.getSchema() === 15;
388
- }
389
- isStringSchema() {
390
- return this.getSchema() === 0;
391
- }
392
- isBooleanSchema() {
393
- return this.getSchema() === 2;
394
- }
395
- isNumericSchema() {
396
- return this.getSchema() === 1;
397
- }
398
- isBigIntegerSchema() {
399
- return this.getSchema() === 17;
400
- }
401
- isBigDecimalSchema() {
402
- return this.getSchema() === 19;
403
- }
404
- isStreaming() {
405
- const { streaming: e } = this.getMergedTraits();
406
- return !!e || this.getSchema() === 42;
407
- }
408
- isIdempotencyToken() {
409
- return !!this.getMergedTraits().idempotencyToken;
410
- }
411
- getMergedTraits() {
412
- return this.normalizedTraits ?? (this.normalizedTraits = {
413
- ...this.getOwnTraits(),
414
- ...this.getMemberTraits()
415
- });
416
- }
417
- getMemberTraits() {
418
- return L(this.memberTraits);
419
- }
420
- getOwnTraits() {
421
- return L(this.traits);
422
- }
423
- getKeySchema() {
424
- const [e, r] = [this.isDocumentSchema(), this.isMapSchema()];
425
- if (!e && !r)
426
- throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);
427
- const s = this.getSchema(), n = e ? 15 : s[4] ?? 0;
428
- return U([n, 0], "key");
429
- }
430
- getValueSchema() {
431
- const e = this.getSchema(), [r, s, n] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()], i = typeof e == "number" ? 63 & e : e && typeof e == "object" && (s || n) ? e[3 + e[0]] : r ? 15 : void 0;
432
- if (i != null)
433
- return U([i, 0], s ? "value" : "member");
434
- throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`);
435
- }
436
- getMemberSchema(e) {
437
- const r = this.getSchema();
438
- if (this.isStructSchema() && r[4].includes(e)) {
439
- const s = r[4].indexOf(e), n = r[5][s];
440
- return U(oe(n) ? n : [n, 0], e);
441
- }
442
- if (this.isDocumentSchema())
443
- return U([15, 0], e);
444
- throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no no member=${e}.`);
445
- }
446
- getMemberSchemas() {
447
- const e = {};
448
- try {
449
- for (const [r, s] of this.structIterator())
450
- e[r] = s;
451
- } catch {
452
- }
453
- return e;
454
- }
455
- getEventStreamMember() {
456
- if (this.isStructSchema()) {
457
- for (const [e, r] of this.structIterator())
458
- if (r.isStreaming() && r.isStructSchema())
459
- return e;
460
- }
461
- return "";
462
- }
463
- *structIterator() {
464
- if (this.isUnitSchema())
465
- return;
466
- if (!this.isStructSchema())
467
- throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
468
- const e = this.getSchema(), r = e[4].length;
469
- let s = e[_e.it];
470
- if (s && r === s.length) {
471
- yield* s;
472
- return;
473
- }
474
- s = Array(r);
475
- for (let n = 0; n < r; ++n) {
476
- const i = e[4][n], a = U([e[5][n], 0], i);
477
- yield s[n] = [i, a];
478
- }
479
- e[_e.it] = s;
480
- }
481
- }
482
- function U(t, e) {
483
- if (t instanceof A)
484
- return Object.assign(t, {
485
- memberName: e,
486
- _isMemberSchema: !0
487
- });
488
- const r = A;
489
- return new r(t, e);
490
- }
491
- const oe = (t) => Array.isArray(t) && t.length === 2, Wt = (t) => Array.isArray(t) && t.length >= 5;
492
- class T {
493
- namespace;
494
- schemas;
495
- exceptions;
496
- static registries = /* @__PURE__ */ new Map();
497
- constructor(e, r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map()) {
498
- this.namespace = e, this.schemas = r, this.exceptions = s;
499
- }
500
- static for(e) {
501
- return T.registries.has(e) || T.registries.set(e, new T(e)), T.registries.get(e);
502
- }
503
- copyFrom(e) {
504
- const { schemas: r, exceptions: s } = this;
505
- for (const [n, i] of e.schemas)
506
- r.has(n) || r.set(n, i);
507
- for (const [n, i] of e.exceptions)
508
- s.has(n) || s.set(n, i);
509
- }
510
- register(e, r) {
511
- const s = this.normalizeShapeId(e);
512
- for (const n of [this, T.for(s.split("#")[0])])
513
- n.schemas.set(s, r);
514
- }
515
- getSchema(e) {
516
- const r = this.normalizeShapeId(e);
517
- if (!this.schemas.has(r))
518
- throw new Error(`@smithy/core/schema - schema not found for ${r}`);
519
- return this.schemas.get(r);
520
- }
521
- registerError(e, r) {
522
- const s = e, n = s[1];
523
- for (const i of [this, T.for(n)])
524
- i.schemas.set(n + "#" + s[2], s), i.exceptions.set(s, r);
525
- }
526
- getErrorCtor(e) {
527
- const r = e;
528
- return this.exceptions.has(r) ? this.exceptions.get(r) : T.for(r[1]).exceptions.get(r);
529
- }
530
- getBaseException() {
531
- for (const e of this.exceptions.keys())
532
- if (Array.isArray(e)) {
533
- const [, r, s] = e, n = r + "#" + s;
534
- if (n.startsWith("smithy.ts.sdk.synthetic.") && n.endsWith("ServiceException"))
535
- return e;
536
- }
537
- }
538
- find(e) {
539
- return [...this.schemas.values()].find(e);
540
- }
541
- clear() {
542
- this.schemas.clear(), this.exceptions.clear();
543
- }
544
- normalizeShapeId(e) {
545
- return e.includes("#") ? e : this.namespace + "#" + e;
546
- }
547
- }
548
- const ke = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), S = Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0")), Kt = () => {
549
- if (ke)
550
- return ke();
551
- const t = new Uint8Array(16);
552
- return crypto.getRandomValues(t), t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, S[t[0]] + S[t[1]] + S[t[2]] + S[t[3]] + "-" + S[t[4]] + S[t[5]] + "-" + S[t[6]] + S[t[7]] + "-" + S[t[8]] + S[t[9]] + "-" + S[t[10]] + S[t[11]] + S[t[12]] + S[t[13]] + S[t[14]] + S[t[15]];
553
- }, $ = function(e) {
554
- return Object.assign(new String(e), {
555
- deserializeJSON() {
556
- return JSON.parse(String(e));
557
- },
558
- toString() {
559
- return String(e);
560
- },
561
- toJSON() {
562
- return String(e);
563
- }
564
- });
565
- };
566
- $.from = (t) => t && typeof t == "object" && (t instanceof $ || "deserializeJSON" in t) ? t : typeof t == "string" || Object.getPrototypeOf(t) === String.prototype ? $(String(t)) : $(JSON.stringify(t));
567
- $.fromObject = $.from;
568
- const Me = /^-?\d*(\.\d+)?$/;
569
- class tt {
570
- string;
571
- type;
572
- constructor(e, r) {
573
- if (this.string = e, this.type = r, !Me.test(e))
574
- throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".');
575
- }
576
- toString() {
577
- return this.string;
578
- }
579
- static [Symbol.hasInstance](e) {
580
- if (!e || typeof e != "object")
581
- return !1;
582
- const r = e;
583
- return tt.prototype.isPrototypeOf(e) || r.type === "bigDecimal" && Me.test(r.string);
584
- }
585
- }
586
- class Xt {
587
- serdeContext;
588
- setSerdeContext(e) {
589
- this.serdeContext = e;
590
- }
591
- }
592
- class Ln extends Xt {
593
- options;
594
- compositeErrorRegistry;
595
- constructor(e) {
596
- super(), this.options = e, this.compositeErrorRegistry = T.for(e.defaultNamespace);
597
- for (const r of e.errorTypeRegistries ?? [])
598
- this.compositeErrorRegistry.copyFrom(r);
599
- }
600
- getRequestType() {
601
- return x;
602
- }
603
- getResponseType() {
604
- return te;
605
- }
606
- setSerdeContext(e) {
607
- this.serdeContext = e, this.serializer.setSerdeContext(e), this.deserializer.setSerdeContext(e), this.getPayloadCodec() && this.getPayloadCodec().setSerdeContext(e);
608
- }
609
- updateServiceEndpoint(e, r) {
610
- if ("url" in r) {
611
- e.protocol = r.url.protocol, e.hostname = r.url.hostname, e.port = r.url.port ? Number(r.url.port) : void 0, e.path = r.url.pathname, e.fragment = r.url.hash || void 0, e.username = r.url.username || void 0, e.password = r.url.password || void 0, e.query || (e.query = {});
612
- for (const [s, n] of r.url.searchParams.entries())
613
- e.query[s] = n;
614
- return e;
615
- } else
616
- return e.protocol = r.protocol, e.hostname = r.hostname, e.port = r.port ? Number(r.port) : void 0, e.path = r.path, e.query = {
617
- ...r.query
618
- }, e;
619
- }
620
- setHostPrefix(e, r, s) {
621
- if (this.serdeContext?.disableHostPrefix)
622
- return;
623
- const n = A.of(r.input), i = L(r.traits ?? {});
624
- if (i.endpoint) {
625
- let a = i.endpoint?.[0];
626
- if (typeof a == "string") {
627
- const c = [...n.structIterator()].filter(([, u]) => u.getMergedTraits().hostLabel);
628
- for (const [u] of c) {
629
- const o = s[u];
630
- if (typeof o != "string")
631
- throw new Error(`@smithy/core/schema - ${u} in input must be a string as hostLabel.`);
632
- a = a.replace(`{${u}}`, o);
633
- }
634
- e.hostname = a + e.hostname;
635
- }
636
- }
637
- }
638
- deserializeMetadata(e) {
639
- return {
640
- httpStatusCode: e.statusCode,
641
- requestId: e.headers["x-amzn-requestid"] ?? e.headers["x-amzn-request-id"] ?? e.headers["x-amz-request-id"],
642
- extendedRequestId: e.headers["x-amz-id-2"],
643
- cfId: e.headers["x-amz-cf-id"]
644
- };
645
- }
646
- async serializeEventStream({ eventStream: e, requestSchema: r, initialRequest: s }) {
647
- return (await this.loadEventStreamCapability()).serializeEventStream({
648
- eventStream: e,
649
- requestSchema: r,
650
- initialRequest: s
651
- });
652
- }
653
- async deserializeEventStream({ response: e, responseSchema: r, initialResponseContainer: s }) {
654
- return (await this.loadEventStreamCapability()).deserializeEventStream({
655
- response: e,
656
- responseSchema: r,
657
- initialResponseContainer: s
658
- });
659
- }
660
- async loadEventStreamCapability() {
661
- const { EventStreamSerde: e } = await import("./index-DA0XouZs.mjs");
662
- return new e({
663
- marshaller: this.getEventStreamMarshaller(),
664
- serializer: this.serializer,
665
- deserializer: this.deserializer,
666
- serdeContext: this.serdeContext,
667
- defaultContentType: this.getDefaultContentType()
668
- });
669
- }
670
- getDefaultContentType() {
671
- throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
672
- }
673
- async deserializeHttpMessage(e, r, s, n, i) {
674
- return [];
675
- }
676
- getEventStreamMarshaller() {
677
- const e = this.serdeContext;
678
- if (!e.eventStreamMarshaller)
679
- throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
680
- return e.eventStreamMarshaller;
681
- }
682
- }
683
- function Hn(t, e) {
684
- if (e.timestampFormat.useTrait && t.isTimestampSchema() && (t.getSchema() === 5 || t.getSchema() === 6 || t.getSchema() === 7))
685
- return t.getSchema();
686
- const { httpLabel: r, httpPrefixHeaders: s, httpHeader: n, httpQuery: i } = t.getMergedTraits();
687
- return (e.httpBindings ? typeof s == "string" || n ? 6 : i || r ? 5 : void 0 : void 0) ?? e.timestampFormat.default;
688
- }
689
- function Qt(t, e, r) {
690
- t.__smithy_context ? t.__smithy_context.features || (t.__smithy_context.features = {}) : t.__smithy_context = {
691
- features: {}
692
- }, t.__smithy_context.features[e] = r;
693
- }
694
- class zn {
695
- authSchemes = /* @__PURE__ */ new Map();
696
- constructor(e) {
697
- for (const [r, s] of Object.entries(e))
698
- s !== void 0 && this.authSchemes.set(r, s);
699
- }
700
- getIdentityProvider(e) {
701
- return this.authSchemes.get(e);
702
- }
703
- }
704
- const Yt = (t) => function(r) {
705
- return rt(r) && r.expiration.getTime() - Date.now() < t;
706
- }, Jt = 3e5, Zt = Yt(Jt), rt = (t) => t.expiration !== void 0, er = (t, e, r) => {
707
- if (t === void 0)
708
- return;
709
- const s = typeof t != "function" ? async () => Promise.resolve(t) : t;
710
- let n, i, a, c = !1;
711
- const u = async (o) => {
712
- i || (i = s(o));
713
- try {
714
- n = await i, a = !0, c = !1;
715
- } finally {
716
- i = void 0;
717
- }
718
- return n;
719
- };
720
- return e === void 0 ? async (o) => ((!a || o?.forceRefresh) && (n = await u(o)), n) : async (o) => ((!a || o?.forceRefresh) && (n = await u(o)), c ? n : r(n) ? (e(n) && await u(o), n) : (c = !0, n));
721
- }, tr = (t, e, r) => {
722
- let s, n, i, a = !1;
723
- const c = async () => {
724
- n || (n = t());
725
- try {
726
- s = await n, i = !0, a = !1;
727
- } finally {
728
- n = void 0;
729
- }
730
- return s;
731
- };
732
- return async (u) => ((!i || u?.forceRefresh) && (s = await c()), s);
733
- }, rr = "X-Amz-Algorithm", sr = "X-Amz-Credential", st = "X-Amz-Date", nr = "X-Amz-SignedHeaders", ir = "X-Amz-Expires", nt = "X-Amz-Signature", it = "X-Amz-Security-Token", at = "authorization", ot = st.toLowerCase(), ar = "date", or = [at, ot, ar], cr = nt.toLowerCase(), ye = "x-amz-content-sha256", ur = it.toLowerCase(), dr = {
734
- authorization: !0,
735
- "cache-control": !0,
736
- connection: !0,
737
- expect: !0,
738
- from: !0,
739
- "keep-alive": !0,
740
- "max-forwards": !0,
741
- pragma: !0,
742
- referer: !0,
743
- te: !0,
744
- trailer: !0,
745
- "transfer-encoding": !0,
746
- upgrade: !0,
747
- "user-agent": !0,
748
- "x-amzn-trace-id": !0
749
- }, lr = /^proxy-/, fr = /^sec-/, ce = "AWS4-HMAC-SHA256", hr = "AWS4-HMAC-SHA256-PAYLOAD", pr = "UNSIGNED-PAYLOAD", mr = 50, ct = "aws4_request", gr = 3600 * 24 * 7, W = {}, ue = [], de = (t, e, r) => `${t}/${e}/${r}/${ct}`, yr = async (t, e, r, s, n) => {
750
- const i = await Pe(t, e.secretAccessKey, e.accessKeyId), a = `${r}:${s}:${n}:${k(i)}:${e.sessionToken}`;
751
- if (a in W)
752
- return W[a];
753
- for (ue.push(a); ue.length > mr; )
754
- delete W[ue.shift()];
755
- let c = `AWS4${e.secretAccessKey}`;
756
- for (const u of [r, s, n, ct])
757
- c = await Pe(t, c, u);
758
- return W[a] = c;
759
- }, Pe = (t, e, r) => {
760
- const s = new t(e);
761
- return s.update(j(r)), s.digest();
762
- }, $e = ({ headers: t }, e, r) => {
763
- const s = {};
764
- for (const n of Object.keys(t).sort()) {
765
- if (t[n] == null)
766
- continue;
767
- const i = n.toLowerCase();
768
- (i in dr || e?.has(i) || lr.test(i) || fr.test(i)) && (!r || r && !r.has(i)) || (s[i] = t[n].trim().replace(/\s+/g, " "));
769
- }
770
- return s;
771
- }, wr = (t) => typeof ArrayBuffer == "function" && t instanceof ArrayBuffer || Object.prototype.toString.call(t) === "[object ArrayBuffer]", le = async ({ headers: t, body: e }, r) => {
772
- for (const s of Object.keys(t))
773
- if (s.toLowerCase() === ye)
774
- return t[s];
775
- if (e == null)
776
- return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
777
- if (typeof e == "string" || ArrayBuffer.isView(e) || wr(e)) {
778
- const s = new r();
779
- return s.update(j(e)), k(await s.digest());
780
- }
781
- return pr;
782
- };
783
- class Sr {
784
- format(e) {
785
- const r = [];
786
- for (const i of Object.keys(e)) {
787
- const a = J(i);
788
- r.push(Uint8Array.from([a.byteLength]), a, this.formatHeaderValue(e[i]));
789
- }
790
- const s = new Uint8Array(r.reduce((i, a) => i + a.byteLength, 0));
791
- let n = 0;
792
- for (const i of r)
793
- s.set(i, n), n += i.byteLength;
794
- return s;
795
- }
796
- formatHeaderValue(e) {
797
- switch (e.type) {
798
- case "boolean":
799
- return Uint8Array.from([e.value ? 0 : 1]);
800
- case "byte":
801
- return Uint8Array.from([2, e.value]);
802
- case "short":
803
- const r = new DataView(new ArrayBuffer(3));
804
- return r.setUint8(0, 3), r.setInt16(1, e.value, !1), new Uint8Array(r.buffer);
805
- case "integer":
806
- const s = new DataView(new ArrayBuffer(5));
807
- return s.setUint8(0, 4), s.setInt32(1, e.value, !1), new Uint8Array(s.buffer);
808
- case "long":
809
- const n = new Uint8Array(9);
810
- return n[0] = 5, n.set(e.value.bytes, 1), n;
811
- case "binary":
812
- const i = new DataView(new ArrayBuffer(3 + e.value.byteLength));
813
- i.setUint8(0, 6), i.setUint16(1, e.value.byteLength, !1);
814
- const a = new Uint8Array(i.buffer);
815
- return a.set(e.value, 3), a;
816
- case "string":
817
- const c = J(e.value), u = new DataView(new ArrayBuffer(3 + c.byteLength));
818
- u.setUint8(0, 7), u.setUint16(1, c.byteLength, !1);
819
- const o = new Uint8Array(u.buffer);
820
- return o.set(c, 3), o;
821
- case "timestamp":
822
- const h = new Uint8Array(9);
823
- return h[0] = 8, h.set(Te.fromNumber(e.value.valueOf()).bytes, 1), h;
824
- case "uuid":
825
- if (!br.test(e.value))
826
- throw new Error(`Invalid UUID received: ${e.value}`);
827
- const d = new Uint8Array(17);
828
- return d[0] = 9, d.set(_t(e.value.replace(/\-/g, "")), 1), d;
829
- }
830
- }
831
- }
832
- var Ne;
833
- (function(t) {
834
- t[t.boolTrue = 0] = "boolTrue", t[t.boolFalse = 1] = "boolFalse", t[t.byte = 2] = "byte", t[t.short = 3] = "short", t[t.integer = 4] = "integer", t[t.long = 5] = "long", t[t.byteArray = 6] = "byteArray", t[t.string = 7] = "string", t[t.timestamp = 8] = "timestamp", t[t.uuid = 9] = "uuid";
835
- })(Ne || (Ne = {}));
836
- const br = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
837
- class Te {
838
- bytes;
839
- constructor(e) {
840
- if (this.bytes = e, e.byteLength !== 8)
841
- throw new Error("Int64 buffers must be exactly 8 bytes");
842
- }
843
- static fromNumber(e) {
844
- if (e > 9223372036854776e3 || e < -9223372036854776e3)
845
- throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);
846
- const r = new Uint8Array(8);
847
- for (let s = 7, n = Math.abs(Math.round(e)); s > -1 && n > 0; s--, n /= 256)
848
- r[s] = n;
849
- return e < 0 && De(r), new Te(r);
850
- }
851
- valueOf() {
852
- const e = this.bytes.slice(0), r = e[0] & 128;
853
- return r && De(e), parseInt(k(e), 16) * (r ? -1 : 1);
854
- }
855
- toString() {
856
- return String(this.valueOf());
857
- }
858
- }
859
- function De(t) {
860
- for (let e = 0; e < 8; e++)
861
- t[e] ^= 255;
862
- for (let e = 7; e > -1 && (t[e]++, t[e] === 0); e--)
863
- ;
864
- }
865
- const Er = (t, e) => {
866
- t = t.toLowerCase();
867
- for (const r of Object.keys(e))
868
- if (t === r.toLowerCase())
869
- return !0;
870
- return !1;
871
- }, Rr = (t, e = {}) => {
872
- const { headers: r, query: s = {} } = x.clone(t);
873
- for (const n of Object.keys(r)) {
874
- const i = n.toLowerCase();
875
- (i.slice(0, 6) === "x-amz-" && !e.unhoistableHeaders?.has(i) || e.hoistableHeaders?.has(i)) && (s[n] = r[n], delete r[n]);
876
- }
877
- return {
878
- ...t,
879
- headers: r,
880
- query: s
881
- };
882
- }, Ue = (t) => {
883
- t = x.clone(t);
884
- for (const e of Object.keys(t.headers))
885
- or.indexOf(e.toLowerCase()) > -1 && delete t.headers[e];
886
- return t;
887
- }, vr = ({ query: t = {} }) => {
888
- const e = [], r = {};
889
- for (const s of Object.keys(t)) {
890
- if (s.toLowerCase() === cr)
891
- continue;
892
- const n = X(s);
893
- e.push(n);
894
- const i = t[s];
895
- typeof i == "string" ? r[n] = `${n}=${X(i)}` : Array.isArray(i) && (r[n] = i.slice(0).reduce((a, c) => a.concat([`${n}=${X(c)}`]), []).sort().join("&"));
896
- }
897
- return e.sort().map((s) => r[s]).filter((s) => s).join("&");
898
- }, Tr = (t) => Ar(t).toISOString().replace(/\.\d{3}Z$/, "Z"), Ar = (t) => typeof t == "number" ? new Date(t * 1e3) : typeof t == "string" ? Number(t) ? new Date(Number(t) * 1e3) : new Date(t) : t;
899
- class Cr {
900
- service;
901
- regionProvider;
902
- credentialProvider;
903
- sha256;
904
- uriEscapePath;
905
- applyChecksum;
906
- constructor({ applyChecksum: e, credentials: r, region: s, service: n, sha256: i, uriEscapePath: a = !0 }) {
907
- this.service = n, this.sha256 = i, this.uriEscapePath = a, this.applyChecksum = typeof e == "boolean" ? e : !0, this.regionProvider = M(s), this.credentialProvider = M(r);
908
- }
909
- createCanonicalRequest(e, r, s) {
910
- const n = Object.keys(r).sort();
911
- return `${e.method}
912
- ${this.getCanonicalPath(e)}
913
- ${vr(e)}
914
- ${n.map((i) => `${i}:${r[i]}`).join(`
915
- `)}
916
-
917
- ${n.join(";")}
918
- ${s}`;
919
- }
920
- async createStringToSign(e, r, s, n) {
921
- const i = new this.sha256();
922
- i.update(j(s));
923
- const a = await i.digest();
924
- return `${n}
925
- ${e}
926
- ${r}
927
- ${k(a)}`;
928
- }
929
- getCanonicalPath({ path: e }) {
930
- if (this.uriEscapePath) {
931
- const r = [];
932
- for (const i of e.split("/"))
933
- i?.length !== 0 && i !== "." && (i === ".." ? r.pop() : r.push(i));
934
- const s = `${e?.startsWith("/") ? "/" : ""}${r.join("/")}${r.length > 0 && e?.endsWith("/") ? "/" : ""}`;
935
- return X(s).replace(/%2F/g, "/");
936
- }
937
- return e;
938
- }
939
- validateResolvedCredentials(e) {
940
- if (typeof e != "object" || typeof e.accessKeyId != "string" || typeof e.secretAccessKey != "string")
941
- throw new Error("Resolved credential object is not valid");
942
- }
943
- formatDate(e) {
944
- const r = Tr(e).replace(/[\-:]/g, "");
945
- return {
946
- longDate: r,
947
- shortDate: r.slice(0, 8)
948
- };
949
- }
950
- getCanonicalHeaderList(e) {
951
- return Object.keys(e).sort().join(";");
952
- }
953
- }
954
- class Le extends Cr {
955
- headerFormatter = new Sr();
956
- constructor({ applyChecksum: e, credentials: r, region: s, service: n, sha256: i, uriEscapePath: a = !0 }) {
957
- super({
958
- applyChecksum: e,
959
- credentials: r,
960
- region: s,
961
- service: n,
962
- sha256: i,
963
- uriEscapePath: a
964
- });
965
- }
966
- async presign(e, r = {}) {
967
- const { signingDate: s = /* @__PURE__ */ new Date(), expiresIn: n = 3600, unsignableHeaders: i, unhoistableHeaders: a, signableHeaders: c, hoistableHeaders: u, signingRegion: o, signingService: h } = r, d = await this.credentialProvider();
968
- this.validateResolvedCredentials(d);
969
- const l = o ?? await this.regionProvider(), { longDate: f, shortDate: m } = this.formatDate(s);
970
- if (n > gr)
971
- return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");
972
- const g = de(m, l, h ?? this.service), p = Rr(Ue(e), { unhoistableHeaders: a, hoistableHeaders: u });
973
- d.sessionToken && (p.query[it] = d.sessionToken), p.query[rr] = ce, p.query[sr] = `${d.accessKeyId}/${g}`, p.query[st] = f, p.query[ir] = n.toString(10);
974
- const y = $e(p, i, c);
975
- return p.query[nr] = this.getCanonicalHeaderList(y), p.query[nt] = await this.getSignature(f, g, this.getSigningKey(d, l, m, h), this.createCanonicalRequest(p, y, await le(e, this.sha256))), p;
976
- }
977
- async sign(e, r) {
978
- return typeof e == "string" ? this.signString(e, r) : e.headers && e.payload ? this.signEvent(e, r) : e.message ? this.signMessage(e, r) : this.signRequest(e, r);
979
- }
980
- async signEvent({ headers: e, payload: r }, { signingDate: s = /* @__PURE__ */ new Date(), priorSignature: n, signingRegion: i, signingService: a }) {
981
- const c = i ?? await this.regionProvider(), { shortDate: u, longDate: o } = this.formatDate(s), h = de(u, c, a ?? this.service), d = await le({ headers: {}, body: r }, this.sha256), l = new this.sha256();
982
- l.update(e);
983
- const f = k(await l.digest()), m = [
984
- hr,
985
- o,
986
- h,
987
- n,
988
- f,
989
- d
990
- ].join(`
991
- `);
992
- return this.signString(m, { signingDate: s, signingRegion: c, signingService: a });
993
- }
994
- async signMessage(e, { signingDate: r = /* @__PURE__ */ new Date(), signingRegion: s, signingService: n }) {
995
- return this.signEvent({
996
- headers: this.headerFormatter.format(e.message.headers),
997
- payload: e.message.body
998
- }, {
999
- signingDate: r,
1000
- signingRegion: s,
1001
- signingService: n,
1002
- priorSignature: e.priorSignature
1003
- }).then((a) => ({ message: e.message, signature: a }));
1004
- }
1005
- async signString(e, { signingDate: r = /* @__PURE__ */ new Date(), signingRegion: s, signingService: n } = {}) {
1006
- const i = await this.credentialProvider();
1007
- this.validateResolvedCredentials(i);
1008
- const a = s ?? await this.regionProvider(), { shortDate: c } = this.formatDate(r), u = new this.sha256(await this.getSigningKey(i, a, c, n));
1009
- return u.update(j(e)), k(await u.digest());
1010
- }
1011
- async signRequest(e, { signingDate: r = /* @__PURE__ */ new Date(), signableHeaders: s, unsignableHeaders: n, signingRegion: i, signingService: a } = {}) {
1012
- const c = await this.credentialProvider();
1013
- this.validateResolvedCredentials(c);
1014
- const u = i ?? await this.regionProvider(), o = Ue(e), { longDate: h, shortDate: d } = this.formatDate(r), l = de(d, u, a ?? this.service);
1015
- o.headers[ot] = h, c.sessionToken && (o.headers[ur] = c.sessionToken);
1016
- const f = await le(o, this.sha256);
1017
- !Er(ye, o.headers) && this.applyChecksum && (o.headers[ye] = f);
1018
- const m = $e(o, n, s), g = await this.getSignature(h, l, this.getSigningKey(c, u, d, a), this.createCanonicalRequest(o, m, f));
1019
- return o.headers[at] = `${ce} Credential=${c.accessKeyId}/${l}, SignedHeaders=${this.getCanonicalHeaderList(m)}, Signature=${g}`, o;
1020
- }
1021
- async getSignature(e, r, s, n) {
1022
- const i = await this.createStringToSign(e, r, n, ce), a = new this.sha256(await s);
1023
- return a.update(j(i)), k(await a.digest());
1024
- }
1025
- getSigningKey(e, r, s, n) {
1026
- return yr(this.sha256, e, s, r, n || this.service);
1027
- }
1028
- }
1029
- const Fn = (t) => {
1030
- let e = t.credentials, r = !!t.credentials, s;
1031
- Object.defineProperty(t, "credentials", {
1032
- set(o) {
1033
- o && o !== e && o !== s && (r = !0), e = o;
1034
- const h = xr(t, {
1035
- credentials: e,
1036
- credentialDefaultProvider: t.credentialDefaultProvider
1037
- }), d = Ir(t, h);
1038
- if (r && !d.attributed) {
1039
- const l = typeof e == "object" && e !== null;
1040
- s = async (f) => {
1041
- const g = await d(f);
1042
- return l && (!g.$source || Object.keys(g.$source).length === 0) ? kt(g, "CREDENTIALS_CODE", "e") : g;
1043
- }, s.memoized = d.memoized, s.configBound = d.configBound, s.attributed = !0;
1044
- } else
1045
- s = d;
1046
- },
1047
- get() {
1048
- return s;
1049
- },
1050
- enumerable: !0,
1051
- configurable: !0
1052
- }), t.credentials = e;
1053
- const { signingEscapePath: n = !0, systemClockOffset: i = t.systemClockOffset || 0, sha256: a } = t;
1054
- let c;
1055
- return t.signer ? c = z(t.signer) : t.regionInfoProvider ? c = () => z(t.region)().then(async (o) => [
1056
- await t.regionInfoProvider(o, {
1057
- useFipsEndpoint: await t.useFipsEndpoint(),
1058
- useDualstackEndpoint: await t.useDualstackEndpoint()
1059
- }) || {},
1060
- o
1061
- ]).then(([o, h]) => {
1062
- const { signingRegion: d, signingService: l } = o;
1063
- t.signingRegion = t.signingRegion || d || h, t.signingName = t.signingName || l || t.serviceId;
1064
- const f = {
1065
- ...t,
1066
- credentials: t.credentials,
1067
- region: t.signingRegion,
1068
- service: t.signingName,
1069
- sha256: a,
1070
- uriEscapePath: n
1071
- }, m = t.signerConstructor || Le;
1072
- return new m(f);
1073
- }) : c = async (o) => {
1074
- o = Object.assign({}, {
1075
- name: "sigv4",
1076
- signingName: t.signingName || t.defaultSigningName,
1077
- signingRegion: await z(t.region)(),
1078
- properties: {}
1079
- }, o);
1080
- const h = o.signingRegion, d = o.signingName;
1081
- t.signingRegion = t.signingRegion || h, t.signingName = t.signingName || d || t.serviceId;
1082
- const l = {
1083
- ...t,
1084
- credentials: t.credentials,
1085
- region: t.signingRegion,
1086
- service: t.signingName,
1087
- sha256: a,
1088
- uriEscapePath: n
1089
- }, f = t.signerConstructor || Le;
1090
- return new f(l);
1091
- }, Object.assign(t, {
1092
- systemClockOffset: i,
1093
- signingEscapePath: n,
1094
- signer: c
1095
- });
1096
- };
1097
- function xr(t, { credentials: e, credentialDefaultProvider: r }) {
1098
- let s;
1099
- return e ? e?.memoized ? s = e : s = er(e, Zt, rt) : r ? s = z(r(Object.assign({}, t, {
1100
- parentClientConfig: t
1101
- }))) : s = async () => {
1102
- throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.");
1103
- }, s.memoized = !0, s;
1104
- }
1105
- function Ir(t, e) {
1106
- if (e.configBound)
1107
- return e;
1108
- const r = async (s) => e({ ...s, callerClientConfig: t });
1109
- return r.memoized = e.memoized, r.configBound = !0, r;
1110
- }
1111
- const He = typeof TextEncoder == "function" ? new TextEncoder() : null, Bn = (t) => {
1112
- if (typeof t == "string") {
1113
- if (He)
1114
- return He.encode(t).byteLength;
1115
- let e = t.length;
1116
- for (let r = e - 1; r >= 0; r--) {
1117
- const s = t.charCodeAt(r);
1118
- s > 127 && s <= 2047 ? e++ : s > 2047 && s <= 65535 && (e += 2), s >= 56320 && s <= 57343 && r--;
1119
- }
1120
- return e;
1121
- } else {
1122
- if (typeof t.byteLength == "number")
1123
- return t.byteLength;
1124
- if (typeof t.size == "number")
1125
- return t.size;
1126
- }
1127
- throw new Error(`Body Length computation failed for ${t}`);
1128
- }, _ = (t, e) => {
1129
- const r = [];
1130
- if (t && r.push(t), e)
1131
- for (const s of e)
1132
- r.push(s);
1133
- return r;
1134
- }, I = (t, e) => `${t || "anonymous"}${e && e.length > 0 ? ` (a.k.a. ${e.join(",")})` : ""}`, ee = () => {
1135
- let t = [], e = [], r = !1;
1136
- const s = /* @__PURE__ */ new Set(), n = (d) => d.sort((l, f) => ze[f.step] - ze[l.step] || Fe[f.priority || "normal"] - Fe[l.priority || "normal"]), i = (d) => {
1137
- let l = !1;
1138
- const f = (m) => {
1139
- const g = _(m.name, m.aliases);
1140
- if (g.includes(d)) {
1141
- l = !0;
1142
- for (const p of g)
1143
- s.delete(p);
1144
- return !1;
1145
- }
1146
- return !0;
1147
- };
1148
- return t = t.filter(f), e = e.filter(f), l;
1149
- }, a = (d) => {
1150
- let l = !1;
1151
- const f = (m) => {
1152
- if (m.middleware === d) {
1153
- l = !0;
1154
- for (const g of _(m.name, m.aliases))
1155
- s.delete(g);
1156
- return !1;
1157
- }
1158
- return !0;
1159
- };
1160
- return t = t.filter(f), e = e.filter(f), l;
1161
- }, c = (d) => (t.forEach((l) => {
1162
- d.add(l.middleware, { ...l });
1163
- }), e.forEach((l) => {
1164
- d.addRelativeTo(l.middleware, { ...l });
1165
- }), d.identifyOnResolve?.(h.identifyOnResolve()), d), u = (d) => {
1166
- const l = [];
1167
- return d.before.forEach((f) => {
1168
- f.before.length === 0 && f.after.length === 0 ? l.push(f) : l.push(...u(f));
1169
- }), l.push(d), d.after.reverse().forEach((f) => {
1170
- f.before.length === 0 && f.after.length === 0 ? l.push(f) : l.push(...u(f));
1171
- }), l;
1172
- }, o = (d = !1) => {
1173
- const l = [], f = [], m = {};
1174
- return t.forEach((p) => {
1175
- const y = {
1176
- ...p,
1177
- before: [],
1178
- after: []
1179
- };
1180
- for (const w of _(y.name, y.aliases))
1181
- m[w] = y;
1182
- l.push(y);
1183
- }), e.forEach((p) => {
1184
- const y = {
1185
- ...p,
1186
- before: [],
1187
- after: []
1188
- };
1189
- for (const w of _(y.name, y.aliases))
1190
- m[w] = y;
1191
- f.push(y);
1192
- }), f.forEach((p) => {
1193
- if (p.toMiddleware) {
1194
- const y = m[p.toMiddleware];
1195
- if (y === void 0) {
1196
- if (d)
1197
- return;
1198
- throw new Error(`${p.toMiddleware} is not found when adding ${I(p.name, p.aliases)} middleware ${p.relation} ${p.toMiddleware}`);
1199
- }
1200
- p.relation === "after" && y.after.push(p), p.relation === "before" && y.before.push(p);
1201
- }
1202
- }), n(l).map(u).reduce((p, y) => (p.push(...y), p), []);
1203
- }, h = {
1204
- add: (d, l = {}) => {
1205
- const { name: f, override: m, aliases: g } = l, p = {
1206
- step: "initialize",
1207
- priority: "normal",
1208
- middleware: d,
1209
- ...l
1210
- }, y = _(f, g);
1211
- if (y.length > 0) {
1212
- if (y.some((w) => s.has(w))) {
1213
- if (!m)
1214
- throw new Error(`Duplicate middleware name '${I(f, g)}'`);
1215
- for (const w of y) {
1216
- const v = t.findIndex((D) => D.name === w || D.aliases?.some((ne) => ne === w));
1217
- if (v === -1)
1218
- continue;
1219
- const b = t[v];
1220
- if (b.step !== p.step || p.priority !== b.priority)
1221
- throw new Error(`"${I(b.name, b.aliases)}" middleware with ${b.priority} priority in ${b.step} step cannot be overridden by "${I(f, g)}" middleware with ${p.priority} priority in ${p.step} step.`);
1222
- t.splice(v, 1);
1223
- }
1224
- }
1225
- for (const w of y)
1226
- s.add(w);
1227
- }
1228
- t.push(p);
1229
- },
1230
- addRelativeTo: (d, l) => {
1231
- const { name: f, override: m, aliases: g } = l, p = {
1232
- middleware: d,
1233
- ...l
1234
- }, y = _(f, g);
1235
- if (y.length > 0) {
1236
- if (y.some((w) => s.has(w))) {
1237
- if (!m)
1238
- throw new Error(`Duplicate middleware name '${I(f, g)}'`);
1239
- for (const w of y) {
1240
- const v = e.findIndex((D) => D.name === w || D.aliases?.some((ne) => ne === w));
1241
- if (v === -1)
1242
- continue;
1243
- const b = e[v];
1244
- if (b.toMiddleware !== p.toMiddleware || b.relation !== p.relation)
1245
- throw new Error(`"${I(b.name, b.aliases)}" middleware ${b.relation} "${b.toMiddleware}" middleware cannot be overridden by "${I(f, g)}" middleware ${p.relation} "${p.toMiddleware}" middleware.`);
1246
- e.splice(v, 1);
1247
- }
1248
- }
1249
- for (const w of y)
1250
- s.add(w);
1251
- }
1252
- e.push(p);
1253
- },
1254
- clone: () => c(ee()),
1255
- use: (d) => {
1256
- d.applyToStack(h);
1257
- },
1258
- remove: (d) => typeof d == "string" ? i(d) : a(d),
1259
- removeByTag: (d) => {
1260
- let l = !1;
1261
- const f = (m) => {
1262
- const { tags: g, name: p, aliases: y } = m;
1263
- if (g && g.includes(d)) {
1264
- const w = _(p, y);
1265
- for (const v of w)
1266
- s.delete(v);
1267
- return l = !0, !1;
1268
- }
1269
- return !0;
1270
- };
1271
- return t = t.filter(f), e = e.filter(f), l;
1272
- },
1273
- concat: (d) => {
1274
- const l = c(ee());
1275
- return l.use(d), l.identifyOnResolve(r || l.identifyOnResolve() || (d.identifyOnResolve?.() ?? !1)), l;
1276
- },
1277
- applyToStack: c,
1278
- identify: () => o(!0).map((d) => {
1279
- const l = d.step ?? d.relation + " " + d.toMiddleware;
1280
- return I(d.name, d.aliases) + " - " + l;
1281
- }),
1282
- identifyOnResolve(d) {
1283
- return typeof d == "boolean" && (r = d), r;
1284
- },
1285
- resolve: (d, l) => {
1286
- for (const f of o().map((m) => m.middleware).reverse())
1287
- d = f(d, l);
1288
- return r && console.log(h.identify()), d;
1289
- }
1290
- };
1291
- return h;
1292
- }, ze = {
1293
- initialize: 5,
1294
- serialize: 4,
1295
- build: 3,
1296
- finalizeRequest: 2,
1297
- deserialize: 1
1298
- }, Fe = {
1299
- high: 3,
1300
- normal: 2,
1301
- low: 1
1302
- };
1303
- class jn {
1304
- config;
1305
- middlewareStack = ee();
1306
- initConfig;
1307
- handlers;
1308
- constructor(e) {
1309
- this.config = e;
1310
- const { protocol: r, protocolSettings: s } = e;
1311
- s && typeof r == "function" && (e.protocol = new r(s));
1312
- }
1313
- send(e, r, s) {
1314
- const n = typeof r != "function" ? r : void 0, i = typeof r == "function" ? r : s, a = n === void 0 && this.config.cacheMiddleware === !0;
1315
- let c;
1316
- if (a) {
1317
- this.handlers || (this.handlers = /* @__PURE__ */ new WeakMap());
1318
- const u = this.handlers;
1319
- u.has(e.constructor) ? c = u.get(e.constructor) : (c = e.resolveMiddleware(this.middlewareStack, this.config, n), u.set(e.constructor, c));
1320
- } else
1321
- delete this.handlers, c = e.resolveMiddleware(this.middlewareStack, this.config, n);
1322
- if (i)
1323
- c(e).then((u) => i(null, u.output), (u) => i(u)).catch(() => {
1324
- });
1325
- else
1326
- return c(e).then((u) => u.output);
1327
- }
1328
- destroy() {
1329
- this.config?.requestHandler?.destroy?.(), delete this.handlers;
1330
- }
1331
- }
1332
- const fe = "***SensitiveInformation***";
1333
- function we(t, e) {
1334
- if (e == null)
1335
- return e;
1336
- const r = A.of(t);
1337
- if (r.getMergedTraits().sensitive)
1338
- return fe;
1339
- if (r.isListSchema()) {
1340
- if (!!r.getValueSchema().getMergedTraits().sensitive)
1341
- return fe;
1342
- } else if (r.isMapSchema()) {
1343
- if (!!r.getKeySchema().getMergedTraits().sensitive || !!r.getValueSchema().getMergedTraits().sensitive)
1344
- return fe;
1345
- } else if (r.isStructSchema() && typeof e == "object") {
1346
- const s = e, n = {};
1347
- for (const [i, a] of r.structIterator())
1348
- s[i] != null && (n[i] = we(a, s[i]));
1349
- return n;
1350
- }
1351
- return e;
1352
- }
1353
- class Or {
1354
- middlewareStack = ee();
1355
- schema;
1356
- static classBuilder() {
1357
- return new _r();
1358
- }
1359
- resolveMiddlewareWithContext(e, r, s, { middlewareFn: n, clientName: i, commandName: a, inputFilterSensitiveLog: c, outputFilterSensitiveLog: u, smithyContext: o, additionalContext: h, CommandCtor: d }) {
1360
- for (const p of n.bind(this)(d, e, r, s))
1361
- this.middlewareStack.use(p);
1362
- const l = e.concat(this.middlewareStack), { logger: f } = r, m = {
1363
- logger: f,
1364
- clientName: i,
1365
- commandName: a,
1366
- inputFilterSensitiveLog: c,
1367
- outputFilterSensitiveLog: u,
1368
- [ge]: {
1369
- commandInstance: this,
1370
- ...o
1371
- },
1372
- ...h
1373
- }, { requestHandler: g } = r;
1374
- return l.resolve((p) => g.handle(p.request, s || {}), m);
1375
- }
1376
- }
1377
- class _r {
1378
- _init = () => {
1379
- };
1380
- _ep = {};
1381
- _middlewareFn = () => [];
1382
- _commandName = "";
1383
- _clientName = "";
1384
- _additionalContext = {};
1385
- _smithyContext = {};
1386
- _inputFilterSensitiveLog = void 0;
1387
- _outputFilterSensitiveLog = void 0;
1388
- _serializer = null;
1389
- _deserializer = null;
1390
- _operationSchema;
1391
- init(e) {
1392
- this._init = e;
1393
- }
1394
- ep(e) {
1395
- return this._ep = e, this;
1396
- }
1397
- m(e) {
1398
- return this._middlewareFn = e, this;
1399
- }
1400
- s(e, r, s = {}) {
1401
- return this._smithyContext = {
1402
- service: e,
1403
- operation: r,
1404
- ...s
1405
- }, this;
1406
- }
1407
- c(e = {}) {
1408
- return this._additionalContext = e, this;
1409
- }
1410
- n(e, r) {
1411
- return this._clientName = e, this._commandName = r, this;
1412
- }
1413
- f(e = (s) => s, r = (s) => s) {
1414
- return this._inputFilterSensitiveLog = e, this._outputFilterSensitiveLog = r, this;
1415
- }
1416
- ser(e) {
1417
- return this._serializer = e, this;
1418
- }
1419
- de(e) {
1420
- return this._deserializer = e, this;
1421
- }
1422
- sc(e) {
1423
- return this._operationSchema = e, this._smithyContext.operationSchema = e, this;
1424
- }
1425
- build() {
1426
- const e = this;
1427
- let r;
1428
- return r = class extends Or {
1429
- input;
1430
- static getEndpointParameterInstructions() {
1431
- return e._ep;
1432
- }
1433
- constructor(...[s]) {
1434
- super(), this.input = s ?? {}, e._init(this), this.schema = e._operationSchema;
1435
- }
1436
- resolveMiddleware(s, n, i) {
1437
- const a = e._operationSchema, c = a?.[4] ?? a?.input, u = a?.[5] ?? a?.output;
1438
- return this.resolveMiddlewareWithContext(s, n, i, {
1439
- CommandCtor: r,
1440
- middlewareFn: e._middlewareFn,
1441
- clientName: e._clientName,
1442
- commandName: e._commandName,
1443
- inputFilterSensitiveLog: e._inputFilterSensitiveLog ?? (a ? we.bind(null, c) : (o) => o),
1444
- outputFilterSensitiveLog: e._outputFilterSensitiveLog ?? (a ? we.bind(null, u) : (o) => o),
1445
- smithyContext: e._smithyContext,
1446
- additionalContext: e._additionalContext
1447
- });
1448
- }
1449
- serialize = e._serializer;
1450
- deserialize = e._deserializer;
1451
- };
1452
- }
1453
- }
1454
- class H extends Error {
1455
- $fault;
1456
- $response;
1457
- $retryable;
1458
- $metadata;
1459
- constructor(e) {
1460
- super(e.message), Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype), this.name = e.name, this.$fault = e.$fault, this.$metadata = e.$metadata;
1461
- }
1462
- static isInstance(e) {
1463
- if (!e)
1464
- return !1;
1465
- const r = e;
1466
- return H.prototype.isPrototypeOf(r) || !!r.$fault && !!r.$metadata && (r.$fault === "client" || r.$fault === "server");
1467
- }
1468
- static [Symbol.hasInstance](e) {
1469
- if (!e)
1470
- return !1;
1471
- const r = e;
1472
- return this === H ? H.isInstance(e) : H.isInstance(e) ? r.name && this.name ? this.prototype.isPrototypeOf(e) || r.name === this.name : this.prototype.isPrototypeOf(e) : !1;
1473
- }
1474
- }
1475
- const Be = (t, e = {}) => {
1476
- Object.entries(e).filter(([, s]) => s !== void 0).forEach(([s, n]) => {
1477
- (t[s] == null || t[s] === "") && (t[s] = n);
1478
- });
1479
- const r = t.message || t.Message || "UnknownError";
1480
- return t.message = r, delete t.Message, t;
1481
- }, qn = (t) => {
1482
- switch (t) {
1483
- case "standard":
1484
- return {
1485
- retryMode: "standard",
1486
- connectionTimeout: 3100
1487
- };
1488
- case "in-region":
1489
- return {
1490
- retryMode: "standard",
1491
- connectionTimeout: 1100
1492
- };
1493
- case "cross-region":
1494
- return {
1495
- retryMode: "standard",
1496
- connectionTimeout: 3100
1497
- };
1498
- case "mobile":
1499
- return {
1500
- retryMode: "standard",
1501
- connectionTimeout: 3e4
1502
- };
1503
- default:
1504
- return {};
1505
- }
1506
- }, kr = (t) => {
1507
- const e = [];
1508
- for (const r in Z) {
1509
- const s = Z[r];
1510
- t[s] !== void 0 && e.push({
1511
- algorithmId: () => s,
1512
- checksumConstructor: () => t[s]
1513
- });
1514
- }
1515
- return {
1516
- addChecksumAlgorithm(r) {
1517
- e.push(r);
1518
- },
1519
- checksumAlgorithms() {
1520
- return e;
1521
- }
1522
- };
1523
- }, Mr = (t) => {
1524
- const e = {};
1525
- return t.checksumAlgorithms().forEach((r) => {
1526
- e[r.algorithmId()] = r.checksumConstructor();
1527
- }), e;
1528
- }, Pr = (t) => ({
1529
- setRetryStrategy(e) {
1530
- t.retryStrategy = e;
1531
- },
1532
- retryStrategy() {
1533
- return t.retryStrategy;
1534
- }
1535
- }), $r = (t) => {
1536
- const e = {};
1537
- return e.retryStrategy = t.retryStrategy(), e;
1538
- }, Gn = (t) => Object.assign(kr(t), Pr(t)), Vn = (t) => Object.assign(Mr(t), $r(t));
1539
- class Nr {
1540
- trace() {
1541
- }
1542
- debug() {
1543
- }
1544
- info() {
1545
- }
1546
- warn() {
1547
- }
1548
- error() {
1549
- }
1550
- }
1551
- class Wn {
1552
- queryCompat;
1553
- constructor(e = !1) {
1554
- this.queryCompat = e;
1555
- }
1556
- resolveRestContentType(e, r) {
1557
- const s = r.getMemberSchemas(), n = Object.values(s).find((i) => !!i.getMergedTraits().httpPayload);
1558
- if (n) {
1559
- const i = n.getMergedTraits().mediaType;
1560
- return i || (n.isStringSchema() ? "text/plain" : n.isBlobSchema() ? "application/octet-stream" : e);
1561
- } else if (!r.isUnitSchema() && Object.values(s).find((a) => {
1562
- const { httpQuery: c, httpQueryParams: u, httpHeader: o, httpLabel: h, httpPrefixHeaders: d } = a.getMergedTraits();
1563
- return !c && !u && !o && !h && d === void 0;
1564
- }))
1565
- return e;
1566
- }
1567
- async getErrorSchemaOrThrowBaseException(e, r, s, n, i, a) {
1568
- let c = r, u = e;
1569
- e.includes("#") && ([c, u] = e.split("#"));
1570
- const o = {
1571
- $metadata: i,
1572
- $fault: s.statusCode < 500 ? "client" : "server"
1573
- }, h = T.for(c);
1574
- try {
1575
- return { errorSchema: a?.(h, u) ?? h.getSchema(e), errorMetadata: o };
1576
- } catch {
1577
- n.message = n.message ?? n.Message ?? "UnknownError";
1578
- const l = T.for("smithy.ts.sdk.synthetic." + c), f = l.getBaseException();
1579
- if (f) {
1580
- const m = l.getErrorCtor(f) ?? Error;
1581
- throw this.decorateServiceException(Object.assign(new m({ name: u }), o), n);
1582
- }
1583
- throw this.decorateServiceException(Object.assign(new Error(u), o), n);
1584
- }
1585
- }
1586
- decorateServiceException(e, r = {}) {
1587
- if (this.queryCompat) {
1588
- const s = e.Message ?? r.Message, n = Be(e, r);
1589
- s && (n.message = s), n.Error = {
1590
- ...n.Error,
1591
- Type: n.Error?.Type,
1592
- Code: n.Error?.Code,
1593
- Message: n.Error?.message ?? n.Error?.Message ?? s
1594
- };
1595
- const i = n.$metadata.requestId;
1596
- return i && (n.RequestId = i), n;
1597
- }
1598
- return Be(e, r);
1599
- }
1600
- setQueryCompatError(e, r) {
1601
- const s = r.headers?.["x-amzn-query-error"];
1602
- if (e !== void 0 && s != null) {
1603
- const [n, i] = s.split(";"), a = Object.entries(e), c = {
1604
- Code: n,
1605
- Type: i
1606
- };
1607
- Object.assign(e, c);
1608
- for (const [u, o] of a)
1609
- c[u === "message" ? "Message" : u] = o;
1610
- delete c.__type, e.Error = c;
1611
- }
1612
- }
1613
- queryCompatOutput(e, r) {
1614
- e.Error && (r.Error = e.Error), e.Type && (r.Type = e.Type), e.Code && (r.Code = e.Code);
1615
- }
1616
- findQueryCompatibleError(e, r) {
1617
- try {
1618
- return e.getSchema(r);
1619
- } catch {
1620
- return e.find((n) => A.of(n).getMergedTraits().awsQueryError?.[0] === r);
1621
- }
1622
- }
1623
- }
1624
- class Kn {
1625
- serdeContext;
1626
- setSerdeContext(e) {
1627
- this.serdeContext = e;
1628
- }
1629
- }
1630
- class Xn {
1631
- from;
1632
- to;
1633
- keys;
1634
- constructor(e, r) {
1635
- this.from = e, this.to = r, this.keys = new Set(Object.keys(this.from).filter((s) => s !== "__type"));
1636
- }
1637
- mark(e) {
1638
- this.keys.delete(e);
1639
- }
1640
- hasUnknown() {
1641
- return this.keys.size === 1 && Object.keys(this.to).length === 0;
1642
- }
1643
- writeUnknown() {
1644
- if (this.hasUnknown()) {
1645
- const e = this.keys.values().next().value, r = this.from[e];
1646
- this.to.$unknown = [e, r];
1647
- }
1648
- }
1649
- }
1650
- function Dr(t, e, r, s) {
1651
- function n(i) {
1652
- return i instanceof r ? i : new r(function(a) {
1653
- a(i);
1654
- });
1655
- }
1656
- return new (r || (r = Promise))(function(i, a) {
1657
- function c(h) {
1658
- try {
1659
- o(s.next(h));
1660
- } catch (d) {
1661
- a(d);
1662
- }
1663
- }
1664
- function u(h) {
1665
- try {
1666
- o(s.throw(h));
1667
- } catch (d) {
1668
- a(d);
1669
- }
1670
- }
1671
- function o(h) {
1672
- h.done ? i(h.value) : n(h.value).then(c, u);
1673
- }
1674
- o((s = s.apply(t, e || [])).next());
1675
- });
1676
- }
1677
- function Ur(t, e) {
1678
- var r = { label: 0, sent: function() {
1679
- if (i[0] & 1) throw i[1];
1680
- return i[1];
1681
- }, trys: [], ops: [] }, s, n, i, a = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
1682
- return a.next = c(0), a.throw = c(1), a.return = c(2), typeof Symbol == "function" && (a[Symbol.iterator] = function() {
1683
- return this;
1684
- }), a;
1685
- function c(o) {
1686
- return function(h) {
1687
- return u([o, h]);
1688
- };
1689
- }
1690
- function u(o) {
1691
- if (s) throw new TypeError("Generator is already executing.");
1692
- for (; a && (a = 0, o[0] && (r = 0)), r; ) try {
1693
- if (s = 1, n && (i = o[0] & 2 ? n.return : o[0] ? n.throw || ((i = n.return) && i.call(n), 0) : n.next) && !(i = i.call(n, o[1])).done) return i;
1694
- switch (n = 0, i && (o = [o[0] & 2, i.value]), o[0]) {
1695
- case 0:
1696
- case 1:
1697
- i = o;
1698
- break;
1699
- case 4:
1700
- return r.label++, { value: o[1], done: !1 };
1701
- case 5:
1702
- r.label++, n = o[1], o = [0];
1703
- continue;
1704
- case 7:
1705
- o = r.ops.pop(), r.trys.pop();
1706
- continue;
1707
- default:
1708
- if (i = r.trys, !(i = i.length > 0 && i[i.length - 1]) && (o[0] === 6 || o[0] === 2)) {
1709
- r = 0;
1710
- continue;
1711
- }
1712
- if (o[0] === 3 && (!i || o[1] > i[0] && o[1] < i[3])) {
1713
- r.label = o[1];
1714
- break;
1715
- }
1716
- if (o[0] === 6 && r.label < i[1]) {
1717
- r.label = i[1], i = o;
1718
- break;
1719
- }
1720
- if (i && r.label < i[2]) {
1721
- r.label = i[2], r.ops.push(o);
1722
- break;
1723
- }
1724
- i[2] && r.ops.pop(), r.trys.pop();
1725
- continue;
1726
- }
1727
- o = e.call(t, r);
1728
- } catch (h) {
1729
- o = [6, h], n = 0;
1730
- } finally {
1731
- s = i = 0;
1732
- }
1733
- if (o[0] & 5) throw o[1];
1734
- return { value: o[0] ? o[1] : void 0, done: !0 };
1735
- }
1736
- }
1737
- function Qn(t) {
1738
- var e = typeof Symbol == "function" && Symbol.iterator, r = e && t[e], s = 0;
1739
- if (r) return r.call(t);
1740
- if (t && typeof t.length == "number") return {
1741
- next: function() {
1742
- return t && s >= t.length && (t = void 0), { value: t && t[s++], done: !t };
1743
- }
1744
- };
1745
- throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
1746
- }
1747
- const Lr = (t) => new TextEncoder().encode(t);
1748
- var Hr = typeof Buffer < "u" && Buffer.from ? function(t) {
1749
- return Buffer.from(t, "utf8");
1750
- } : Lr;
1751
- function q(t) {
1752
- return t instanceof Uint8Array ? t : typeof t == "string" ? Hr(t) : ArrayBuffer.isView(t) ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength / Uint8Array.BYTES_PER_ELEMENT) : new Uint8Array(t);
1753
- }
1754
- function Se(t) {
1755
- return typeof t == "string" ? t.length === 0 : t.byteLength === 0;
1756
- }
1757
- function Yn(t) {
1758
- return t;
1759
- }
1760
- const zr = (t) => (e) => async (r) => {
1761
- if (!x.isInstance(r.request))
1762
- return e(r);
1763
- const { request: s } = r, { handlerProtocol: n = "" } = t.requestHandler.metadata || {};
1764
- if (n.indexOf("h2") >= 0 && !s.headers[":authority"])
1765
- delete s.headers.host, s.headers[":authority"] = s.hostname + (s.port ? ":" + s.port : "");
1766
- else if (!s.headers.host) {
1767
- let i = s.hostname;
1768
- s.port != null && (i += `:${s.port}`), s.headers.host = i;
1769
- }
1770
- return e(r);
1771
- }, Fr = {
1772
- name: "hostHeaderMiddleware",
1773
- step: "build",
1774
- priority: "low",
1775
- tags: ["HOST"],
1776
- override: !0
1777
- }, Jn = (t) => ({
1778
- applyToStack: (e) => {
1779
- e.add(zr(t), Fr);
1780
- }
1781
- }), Br = () => (t, e) => async (r) => {
1782
- try {
1783
- const s = await t(r), { clientName: n, commandName: i, logger: a, dynamoDbDocumentClientOptions: c = {} } = e, { overrideInputFilterSensitiveLog: u, overrideOutputFilterSensitiveLog: o } = c, h = u ?? e.inputFilterSensitiveLog, d = o ?? e.outputFilterSensitiveLog, { $metadata: l, ...f } = s.output;
1784
- return a?.info?.({
1785
- clientName: n,
1786
- commandName: i,
1787
- input: h(r.input),
1788
- output: d(f),
1789
- metadata: l
1790
- }), s;
1791
- } catch (s) {
1792
- const { clientName: n, commandName: i, logger: a, dynamoDbDocumentClientOptions: c = {} } = e, { overrideInputFilterSensitiveLog: u } = c, o = u ?? e.inputFilterSensitiveLog;
1793
- throw a?.error?.({
1794
- clientName: n,
1795
- commandName: i,
1796
- input: o(r.input),
1797
- error: s,
1798
- metadata: s.$metadata
1799
- }), s;
1800
- }
1801
- }, jr = {
1802
- name: "loggerMiddleware",
1803
- tags: ["LOGGER"],
1804
- step: "initialize",
1805
- override: !0
1806
- }, Zn = (t) => ({
1807
- applyToStack: (e) => {
1808
- e.add(Br(), jr);
1809
- }
1810
- }), qr = {
1811
- step: "build",
1812
- tags: ["RECURSION_DETECTION"],
1813
- name: "recursionDetectionMiddleware",
1814
- override: !0,
1815
- priority: "low"
1816
- }, Gr = () => (t) => async (e) => t(e), ei = (t) => ({
1817
- applyToStack: (e) => {
1818
- e.add(Gr(), qr);
1819
- }
1820
- }), Vr = void 0;
1821
- function Wr(t) {
1822
- return t === void 0 ? !0 : typeof t == "string" && t.length <= 50;
1823
- }
1824
- function ti(t) {
1825
- const e = z(t.userAgentAppId ?? Vr), { customUserAgent: r } = t;
1826
- return Object.assign(t, {
1827
- customUserAgent: typeof r == "string" ? [[r]] : r,
1828
- userAgentAppId: async () => {
1829
- const s = await e();
1830
- if (!Wr(s)) {
1831
- const n = t.logger?.constructor?.name === "NoOpLogger" || !t.logger ? console : t.logger;
1832
- typeof s != "string" ? n?.warn("userAgentAppId must be a string or undefined.") : s.length > 50 && n?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
1833
- }
1834
- return s;
1835
- }
1836
- });
1837
- }
1838
- class ri {
1839
- capacity;
1840
- data = /* @__PURE__ */ new Map();
1841
- parameters = [];
1842
- constructor({ size: e, params: r }) {
1843
- this.capacity = e ?? 50, r && (this.parameters = r);
1844
- }
1845
- get(e, r) {
1846
- const s = this.hash(e);
1847
- if (s === !1)
1848
- return r();
1849
- if (!this.data.has(s)) {
1850
- if (this.data.size > this.capacity + 10) {
1851
- const n = this.data.keys();
1852
- let i = 0;
1853
- for (; ; ) {
1854
- const { value: a, done: c } = n.next();
1855
- if (this.data.delete(a), c || ++i > 10)
1856
- break;
1857
- }
1858
- }
1859
- this.data.set(s, r());
1860
- }
1861
- return this.data.get(s);
1862
- }
1863
- size() {
1864
- return this.data.size;
1865
- }
1866
- hash(e) {
1867
- let r = "";
1868
- const { parameters: s } = this;
1869
- if (s.length === 0)
1870
- return !1;
1871
- for (const n of s) {
1872
- const i = String(e[n] ?? "");
1873
- if (i.includes("|;"))
1874
- return !1;
1875
- r += i + "|;";
1876
- }
1877
- return r;
1878
- }
1879
- }
1880
- const Kr = new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"), ut = (t) => Kr.test(t) || t.startsWith("[") && t.endsWith("]"), Xr = new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"), re = (t, e = !1) => {
1881
- if (!e)
1882
- return Xr.test(t);
1883
- const r = t.split(".");
1884
- for (const s of r)
1885
- if (!re(s))
1886
- return !1;
1887
- return !0;
1888
- }, be = {}, G = "endpoints";
1889
- function O(t) {
1890
- return typeof t != "object" || t == null ? t : "ref" in t ? `$${O(t.ref)}` : "fn" in t ? `${t.fn}(${(t.argv || []).map(O).join(", ")})` : JSON.stringify(t, null, 2);
1891
- }
1892
- class E extends Error {
1893
- constructor(e) {
1894
- super(e), this.name = "EndpointError";
1895
- }
1896
- }
1897
- const Qr = (t, e) => t === e, Yr = (t) => {
1898
- const e = t.split("."), r = [];
1899
- for (const s of e) {
1900
- const n = s.indexOf("[");
1901
- if (n !== -1) {
1902
- if (s.indexOf("]") !== s.length - 1)
1903
- throw new E(`Path: '${t}' does not end with ']'`);
1904
- const i = s.slice(n + 1, -1);
1905
- if (Number.isNaN(parseInt(i)))
1906
- throw new E(`Invalid array index: '${i}' in path: '${t}'`);
1907
- n !== 0 && r.push(s.slice(0, n)), r.push(i);
1908
- } else
1909
- r.push(s);
1910
- }
1911
- return r;
1912
- }, dt = (t, e) => Yr(e).reduce((r, s) => {
1913
- if (typeof r != "object")
1914
- throw new E(`Index '${s}' in '${e}' not found in '${JSON.stringify(t)}'`);
1915
- return Array.isArray(r) ? r[parseInt(s)] : r[s];
1916
- }, t), Jr = (t) => t != null, Zr = (t) => !t, he = {
1917
- [B.HTTP]: 80,
1918
- [B.HTTPS]: 443
1919
- }, es = (t) => {
1920
- const e = (() => {
1921
- try {
1922
- if (t instanceof URL)
1923
- return t;
1924
- if (typeof t == "object" && "hostname" in t) {
1925
- const { hostname: l, port: f, protocol: m = "", path: g = "", query: p = {} } = t, y = new URL(`${m}//${l}${f ? `:${f}` : ""}${g}`);
1926
- return y.search = Object.entries(p).map(([w, v]) => `${w}=${v}`).join("&"), y;
1927
- }
1928
- return new URL(t);
1929
- } catch {
1930
- return null;
1931
- }
1932
- })();
1933
- if (!e)
1934
- return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`), null;
1935
- const r = e.href, { host: s, hostname: n, pathname: i, protocol: a, search: c } = e;
1936
- if (c)
1937
- return null;
1938
- const u = a.slice(0, -1);
1939
- if (!Object.values(B).includes(u))
1940
- return null;
1941
- const o = ut(n), h = r.includes(`${s}:${he[u]}`) || typeof t == "string" && t.includes(`${s}:${he[u]}`), d = `${s}${h ? `:${he[u]}` : ""}`;
1942
- return {
1943
- scheme: u,
1944
- authority: d,
1945
- path: i,
1946
- normalizedPath: i.endsWith("/") ? i : `${i}/`,
1947
- isIp: o
1948
- };
1949
- }, ts = (t, e) => t === e, rs = (t, e, r, s) => e >= r || t.length < r ? null : s ? t.substring(t.length - r, t.length - e) : t.substring(e, r), ss = (t) => encodeURIComponent(t).replace(/[!*'()]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`), ns = {
1950
- booleanEquals: Qr,
1951
- getAttr: dt,
1952
- isSet: Jr,
1953
- isValidHostLabel: re,
1954
- not: Zr,
1955
- parseURL: es,
1956
- stringEquals: ts,
1957
- substring: rs,
1958
- uriEncode: ss
1959
- }, lt = (t, e) => {
1960
- const r = [], s = {
1961
- ...e.endpointParams,
1962
- ...e.referenceRecord
1963
- };
1964
- let n = 0;
1965
- for (; n < t.length; ) {
1966
- const i = t.indexOf("{", n);
1967
- if (i === -1) {
1968
- r.push(t.slice(n));
1969
- break;
1970
- }
1971
- r.push(t.slice(n, i));
1972
- const a = t.indexOf("}", i);
1973
- if (a === -1) {
1974
- r.push(t.slice(i));
1975
- break;
1976
- }
1977
- t[i + 1] === "{" && t[a + 1] === "}" && (r.push(t.slice(i + 1, a)), n = a + 2);
1978
- const c = t.substring(i + 1, a);
1979
- if (c.includes("#")) {
1980
- const [u, o] = c.split("#");
1981
- r.push(dt(s[u], o));
1982
- } else
1983
- r.push(s[c]);
1984
- n = a + 1;
1985
- }
1986
- return r.join("");
1987
- }, is = ({ ref: t }, e) => ({
1988
- ...e.endpointParams,
1989
- ...e.referenceRecord
1990
- })[t], se = (t, e, r) => {
1991
- if (typeof t == "string")
1992
- return lt(t, r);
1993
- if (t.fn)
1994
- return ht.callFunction(t, r);
1995
- if (t.ref)
1996
- return is(t, r);
1997
- throw new E(`'${e}': ${String(t)} is not a string, function or reference.`);
1998
- }, ft = ({ fn: t, argv: e }, r) => {
1999
- const s = e.map((i) => ["boolean", "number"].includes(typeof i) ? i : ht.evaluateExpression(i, "arg", r)), n = t.split(".");
2000
- return n[0] in be && n[1] != null ? be[n[0]][n[1]](...s) : ns[t](...s);
2001
- }, ht = {
2002
- evaluateExpression: se,
2003
- callFunction: ft
2004
- }, as = ({ assign: t, ...e }, r) => {
2005
- if (t && t in r.referenceRecord)
2006
- throw new E(`'${t}' is already defined in Reference Record.`);
2007
- const s = ft(e, r);
2008
- return r.logger?.debug?.(`${G} evaluateCondition: ${O(e)} = ${O(s)}`), {
2009
- result: s === "" ? !0 : !!s,
2010
- ...t != null && { toAssign: { name: t, value: s } }
2011
- };
2012
- }, Ae = (t = [], e) => {
2013
- const r = {};
2014
- for (const s of t) {
2015
- const { result: n, toAssign: i } = as(s, {
2016
- ...e,
2017
- referenceRecord: {
2018
- ...e.referenceRecord,
2019
- ...r
2020
- }
2021
- });
2022
- if (!n)
2023
- return { result: n };
2024
- i && (r[i.name] = i.value, e.logger?.debug?.(`${G} assign: ${i.name} := ${O(i.value)}`));
2025
- }
2026
- return { result: !0, referenceRecord: r };
2027
- }, os = (t, e) => Object.entries(t).reduce((r, [s, n]) => ({
2028
- ...r,
2029
- [s]: n.map((i) => {
2030
- const a = se(i, "Header value entry", e);
2031
- if (typeof a != "string")
2032
- throw new E(`Header '${s}' value '${a}' is not a string`);
2033
- return a;
2034
- })
2035
- }), {}), pt = (t, e) => Object.entries(t).reduce((r, [s, n]) => ({
2036
- ...r,
2037
- [s]: gt.getEndpointProperty(n, e)
2038
- }), {}), mt = (t, e) => {
2039
- if (Array.isArray(t))
2040
- return t.map((r) => mt(r, e));
2041
- switch (typeof t) {
2042
- case "string":
2043
- return lt(t, e);
2044
- case "object":
2045
- if (t === null)
2046
- throw new E(`Unexpected endpoint property: ${t}`);
2047
- return gt.getEndpointProperties(t, e);
2048
- case "boolean":
2049
- return t;
2050
- default:
2051
- throw new E(`Unexpected endpoint property type: ${typeof t}`);
2052
- }
2053
- }, gt = {
2054
- getEndpointProperty: mt,
2055
- getEndpointProperties: pt
2056
- }, cs = (t, e) => {
2057
- const r = se(t, "Endpoint URL", e);
2058
- if (typeof r == "string")
2059
- try {
2060
- return new URL(r);
2061
- } catch (s) {
2062
- throw console.error(`Failed to construct URL with ${r}`, s), s;
2063
- }
2064
- throw new E(`Endpoint URL must be a string, got ${typeof r}`);
2065
- }, us = (t, e) => {
2066
- const { conditions: r, endpoint: s } = t, { result: n, referenceRecord: i } = Ae(r, e);
2067
- if (!n)
2068
- return;
2069
- const a = {
2070
- ...e,
2071
- referenceRecord: { ...e.referenceRecord, ...i }
2072
- }, { url: c, properties: u, headers: o } = s;
2073
- return e.logger?.debug?.(`${G} Resolving endpoint from template: ${O(s)}`), {
2074
- ...o != null && {
2075
- headers: os(o, a)
2076
- },
2077
- ...u != null && {
2078
- properties: pt(u, a)
2079
- },
2080
- url: cs(c, a)
2081
- };
2082
- }, ds = (t, e) => {
2083
- const { conditions: r, error: s } = t, { result: n, referenceRecord: i } = Ae(r, e);
2084
- if (n)
2085
- throw new E(se(s, "Error", {
2086
- ...e,
2087
- referenceRecord: { ...e.referenceRecord, ...i }
2088
- }));
2089
- }, yt = (t, e) => {
2090
- for (const r of t)
2091
- if (r.type === "endpoint") {
2092
- const s = us(r, e);
2093
- if (s)
2094
- return s;
2095
- } else if (r.type === "error")
2096
- ds(r, e);
2097
- else if (r.type === "tree") {
2098
- const s = wt.evaluateTreeRule(r, e);
2099
- if (s)
2100
- return s;
2101
- } else
2102
- throw new E(`Unknown endpoint rule: ${r}`);
2103
- throw new E("Rules evaluation failed");
2104
- }, ls = (t, e) => {
2105
- const { conditions: r, rules: s } = t, { result: n, referenceRecord: i } = Ae(r, e);
2106
- if (n)
2107
- return wt.evaluateRules(s, {
2108
- ...e,
2109
- referenceRecord: { ...e.referenceRecord, ...i }
2110
- });
2111
- }, wt = {
2112
- evaluateRules: yt,
2113
- evaluateTreeRule: ls
2114
- }, si = (t, e) => {
2115
- const { endpointParams: r, logger: s } = e, { parameters: n, rules: i } = t;
2116
- e.logger?.debug?.(`${G} Initial EndpointParams: ${O(r)}`);
2117
- const a = Object.entries(n).filter(([, o]) => o.default != null).map(([o, h]) => [o, h.default]);
2118
- if (a.length > 0)
2119
- for (const [o, h] of a)
2120
- r[o] = r[o] ?? h;
2121
- const c = Object.entries(n).filter(([, o]) => o.required).map(([o]) => o);
2122
- for (const o of c)
2123
- if (r[o] == null)
2124
- throw new E(`Missing required parameter: '${o}'`);
2125
- const u = yt(i, { endpointParams: r, logger: s, referenceRecord: {} });
2126
- return e.logger?.debug?.(`${G} Resolved endpoint: ${O(u)}`), u;
2127
- }, St = (t, e = !1) => {
2128
- if (e) {
2129
- for (const r of t.split("."))
2130
- if (!St(r))
2131
- return !1;
2132
- return !0;
2133
- }
2134
- return !(!re(t) || t.length < 3 || t.length > 63 || t !== t.toLowerCase() || ut(t));
2135
- }, je = ":", fs = "/", hs = (t) => {
2136
- const e = t.split(je);
2137
- if (e.length < 6)
2138
- return null;
2139
- const [r, s, n, i, a, ...c] = e;
2140
- if (r !== "arn" || s === "" || n === "" || c.join(je) === "")
2141
- return null;
2142
- const u = c.map((o) => o.split(fs)).flat();
2143
- return {
2144
- partition: s,
2145
- service: n,
2146
- region: i,
2147
- accountId: a,
2148
- resourceId: u
2149
- };
2150
- }, ps = [{ id: "aws", outputs: { dnsSuffix: "amazonaws.com", dualStackDnsSuffix: "api.aws", implicitGlobalRegion: "us-east-1", name: "aws", supportsDualStack: !0, supportsFIPS: !0 }, regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", regions: { "af-south-1": { description: "Africa (Cape Town)" }, "ap-east-1": { description: "Asia Pacific (Hong Kong)" }, "ap-east-2": { description: "Asia Pacific (Taipei)" }, "ap-northeast-1": { description: "Asia Pacific (Tokyo)" }, "ap-northeast-2": { description: "Asia Pacific (Seoul)" }, "ap-northeast-3": { description: "Asia Pacific (Osaka)" }, "ap-south-1": { description: "Asia Pacific (Mumbai)" }, "ap-south-2": { description: "Asia Pacific (Hyderabad)" }, "ap-southeast-1": { description: "Asia Pacific (Singapore)" }, "ap-southeast-2": { description: "Asia Pacific (Sydney)" }, "ap-southeast-3": { description: "Asia Pacific (Jakarta)" }, "ap-southeast-4": { description: "Asia Pacific (Melbourne)" }, "ap-southeast-5": { description: "Asia Pacific (Malaysia)" }, "ap-southeast-6": { description: "Asia Pacific (New Zealand)" }, "ap-southeast-7": { description: "Asia Pacific (Thailand)" }, "aws-global": { description: "aws global region" }, "ca-central-1": { description: "Canada (Central)" }, "ca-west-1": { description: "Canada West (Calgary)" }, "eu-central-1": { description: "Europe (Frankfurt)" }, "eu-central-2": { description: "Europe (Zurich)" }, "eu-north-1": { description: "Europe (Stockholm)" }, "eu-south-1": { description: "Europe (Milan)" }, "eu-south-2": { description: "Europe (Spain)" }, "eu-west-1": { description: "Europe (Ireland)" }, "eu-west-2": { description: "Europe (London)" }, "eu-west-3": { description: "Europe (Paris)" }, "il-central-1": { description: "Israel (Tel Aviv)" }, "me-central-1": { description: "Middle East (UAE)" }, "me-south-1": { description: "Middle East (Bahrain)" }, "mx-central-1": { description: "Mexico (Central)" }, "sa-east-1": { description: "South America (Sao Paulo)" }, "us-east-1": { description: "US East (N. Virginia)" }, "us-east-2": { description: "US East (Ohio)" }, "us-west-1": { description: "US West (N. California)" }, "us-west-2": { description: "US West (Oregon)" } } }, { id: "aws-cn", outputs: { dnsSuffix: "amazonaws.com.cn", dualStackDnsSuffix: "api.amazonwebservices.com.cn", implicitGlobalRegion: "cn-northwest-1", name: "aws-cn", supportsDualStack: !0, supportsFIPS: !0 }, regionRegex: "^cn\\-\\w+\\-\\d+$", regions: { "aws-cn-global": { description: "aws-cn global region" }, "cn-north-1": { description: "China (Beijing)" }, "cn-northwest-1": { description: "China (Ningxia)" } } }, { id: "aws-eusc", outputs: { dnsSuffix: "amazonaws.eu", dualStackDnsSuffix: "api.amazonwebservices.eu", implicitGlobalRegion: "eusc-de-east-1", name: "aws-eusc", supportsDualStack: !0, supportsFIPS: !0 }, regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", regions: { "eusc-de-east-1": { description: "AWS European Sovereign Cloud (Germany)" } } }, { id: "aws-iso", outputs: { dnsSuffix: "c2s.ic.gov", dualStackDnsSuffix: "api.aws.ic.gov", implicitGlobalRegion: "us-iso-east-1", name: "aws-iso", supportsDualStack: !0, supportsFIPS: !0 }, regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", regions: { "aws-iso-global": { description: "aws-iso global region" }, "us-iso-east-1": { description: "US ISO East" }, "us-iso-west-1": { description: "US ISO WEST" } } }, { id: "aws-iso-b", outputs: { dnsSuffix: "sc2s.sgov.gov", dualStackDnsSuffix: "api.aws.scloud", implicitGlobalRegion: "us-isob-east-1", name: "aws-iso-b", supportsDualStack: !0, supportsFIPS: !0 }, regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", regions: { "aws-iso-b-global": { description: "aws-iso-b global region" }, "us-isob-east-1": { description: "US ISOB East (Ohio)" }, "us-isob-west-1": { description: "US ISOB West" } } }, { id: "aws-iso-e", outputs: { dnsSuffix: "cloud.adc-e.uk", dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", implicitGlobalRegion: "eu-isoe-west-1", name: "aws-iso-e", supportsDualStack: !0, supportsFIPS: !0 }, regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", regions: { "aws-iso-e-global": { description: "aws-iso-e global region" }, "eu-isoe-west-1": { description: "EU ISOE West" } } }, { id: "aws-iso-f", outputs: { dnsSuffix: "csp.hci.ic.gov", dualStackDnsSuffix: "api.aws.hci.ic.gov", implicitGlobalRegion: "us-isof-south-1", name: "aws-iso-f", supportsDualStack: !0, supportsFIPS: !0 }, regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", regions: { "aws-iso-f-global": { description: "aws-iso-f global region" }, "us-isof-east-1": { description: "US ISOF EAST" }, "us-isof-south-1": { description: "US ISOF SOUTH" } } }, { id: "aws-us-gov", outputs: { dnsSuffix: "amazonaws.com", dualStackDnsSuffix: "api.aws", implicitGlobalRegion: "us-gov-west-1", name: "aws-us-gov", supportsDualStack: !0, supportsFIPS: !0 }, regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", regions: { "aws-us-gov-global": { description: "aws-us-gov global region" }, "us-gov-east-1": { description: "AWS GovCloud (US-East)" }, "us-gov-west-1": { description: "AWS GovCloud (US-West)" } } }], ms = {
2151
- partitions: ps
2152
- };
2153
- let gs = ms;
2154
- const ys = (t) => {
2155
- const { partitions: e } = gs;
2156
- for (const s of e) {
2157
- const { regions: n, outputs: i } = s;
2158
- for (const [a, c] of Object.entries(n))
2159
- if (a === t)
2160
- return {
2161
- ...i,
2162
- ...c
2163
- };
2164
- }
2165
- for (const s of e) {
2166
- const { regionRegex: n, outputs: i } = s;
2167
- if (new RegExp(n).test(t))
2168
- return {
2169
- ...i
2170
- };
2171
- }
2172
- const r = e.find((s) => s.id === "aws");
2173
- if (!r)
2174
- throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");
2175
- return {
2176
- ...r.outputs
2177
- };
2178
- }, ws = {
2179
- isVirtualHostableS3Bucket: St,
2180
- parseArn: hs,
2181
- partition: ys
2182
- };
2183
- be.aws = ws;
2184
- function Ss(t) {
2185
- const e = {};
2186
- if (t = t.replace(/^\?/, ""), t)
2187
- for (const r of t.split("&")) {
2188
- let [s, n = null] = r.split("=");
2189
- s = decodeURIComponent(s), n && (n = decodeURIComponent(n)), s in e ? Array.isArray(e[s]) ? e[s].push(n) : e[s] = [e[s], n] : e[s] = n;
2190
- }
2191
- return e;
2192
- }
2193
- const Ee = (t) => {
2194
- if (typeof t == "string")
2195
- return Ee(new URL(t));
2196
- const { hostname: e, pathname: r, port: s, protocol: n, search: i } = t;
2197
- let a;
2198
- return i && (a = Ss(i)), {
2199
- hostname: e,
2200
- port: s ? parseInt(s) : void 0,
2201
- protocol: n,
2202
- path: r,
2203
- query: a
2204
- };
2205
- }, bs = /\d{12}\.ddb/;
2206
- async function Es(t, e, r) {
2207
- if (r.request?.headers?.["smithy-protocol"] === "rpc-v2-cbor" && C(t, "PROTOCOL_RPC_V2_CBOR", "M"), typeof e.retryStrategy == "function") {
2208
- const i = await e.retryStrategy();
2209
- typeof i.acquireInitialRetryToken == "function" ? i.constructor?.name?.includes("Adaptive") ? C(t, "RETRY_MODE_ADAPTIVE", "F") : C(t, "RETRY_MODE_STANDARD", "E") : C(t, "RETRY_MODE_LEGACY", "D");
2210
- }
2211
- if (typeof e.accountIdEndpointMode == "function") {
2212
- const i = t.endpointV2;
2213
- switch (String(i?.url?.hostname).match(bs) && C(t, "ACCOUNT_ID_ENDPOINT", "O"), await e.accountIdEndpointMode?.()) {
2214
- case "disabled":
2215
- C(t, "ACCOUNT_ID_MODE_DISABLED", "Q");
2216
- break;
2217
- case "preferred":
2218
- C(t, "ACCOUNT_ID_MODE_PREFERRED", "P");
2219
- break;
2220
- case "required":
2221
- C(t, "ACCOUNT_ID_MODE_REQUIRED", "R");
2222
- break;
2223
- }
2224
- }
2225
- const n = t.__smithy_context?.selectedHttpAuthScheme?.identity;
2226
- if (n?.$source) {
2227
- const i = n;
2228
- i.accountId && C(t, "RESOLVED_ACCOUNT_ID", "T");
2229
- for (const [a, c] of Object.entries(i.$source ?? {}))
2230
- C(t, a, c);
2231
- }
2232
- }
2233
- const qe = "user-agent", pe = "x-amz-user-agent", Ge = " ", me = "/", Rs = /[^!$%&'*+\-.^_`|~\w]/g, vs = /[^!$%&'*+\-.^_`|~\w#]/g, Ve = "-", Ts = 1024;
2234
- function As(t) {
2235
- let e = "";
2236
- for (const r in t) {
2237
- const s = t[r];
2238
- if (e.length + s.length + 1 <= Ts) {
2239
- e.length ? e += "," + s : e += s;
2240
- continue;
2241
- }
2242
- break;
2243
- }
2244
- return e;
2245
- }
2246
- const Cs = (t) => (e, r) => async (s) => {
2247
- const { request: n } = s;
2248
- if (!x.isInstance(n))
2249
- return e(s);
2250
- const { headers: i } = n, a = r?.userAgent?.map(K) || [], c = (await t.defaultUserAgentProvider()).map(K);
2251
- await Es(r, t, s);
2252
- const u = r;
2253
- c.push(`m/${As(Object.assign({}, r.__smithy_context?.features, u.__aws_sdk_context?.features))}`);
2254
- const o = t?.customUserAgent?.map(K) || [], h = await t.userAgentAppId();
2255
- h && c.push(K(["app", `${h}`]));
2256
- const d = [].concat([...c, ...a, ...o]).join(Ge), l = [
2257
- ...c.filter((f) => f.startsWith("aws-sdk-")),
2258
- ...o
2259
- ].join(Ge);
2260
- return t.runtime !== "browser" ? (l && (i[pe] = i[pe] ? `${i[qe]} ${l}` : l), i[qe] = d) : i[pe] = d, e({
2261
- ...s,
2262
- request: n
2263
- });
2264
- }, K = (t) => {
2265
- const e = t[0].split(me).map((a) => a.replace(Rs, Ve)).join(me), r = t[1]?.replace(vs, Ve), s = e.indexOf(me), n = e.substring(0, s);
2266
- let i = e.substring(s + 1);
2267
- return n === "api" && (i = i.toLowerCase()), [n, i, r].filter((a) => a && a.length > 0).reduce((a, c, u) => {
2268
- switch (u) {
2269
- case 0:
2270
- return c;
2271
- case 1:
2272
- return `${a}/${c}`;
2273
- default:
2274
- return `${a}#${c}`;
2275
- }
2276
- }, "");
2277
- }, xs = {
2278
- name: "getUserAgentMiddleware",
2279
- step: "build",
2280
- priority: "low",
2281
- tags: ["SET_USER_AGENT", "USER_AGENT"],
2282
- override: !0
2283
- }, ni = (t) => ({
2284
- applyToStack: (e) => {
2285
- e.add(Cs(t), xs);
2286
- }
2287
- }), ii = !1, ai = !1, We = /* @__PURE__ */ new Set(), Is = (t, e = re) => {
2288
- if (!We.has(t) && !e(t))
2289
- if (t === "*")
2290
- console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');
2291
- else
2292
- throw new Error(`Region not accepted: region="${t}" is not a valid hostname component.`);
2293
- else
2294
- We.add(t);
2295
- }, bt = (t) => typeof t == "string" && (t.startsWith("fips-") || t.endsWith("-fips")), Os = (t) => bt(t) ? ["fips-aws-global", "aws-fips"].includes(t) ? "us-east-1" : t.replace(/fips-(dkr-|prod-)?|-fips/, "") : t, oi = (t) => {
2296
- const { region: e, useFipsEndpoint: r } = t;
2297
- if (!e)
2298
- throw new Error("Region is missing");
2299
- return Object.assign(t, {
2300
- region: async () => {
2301
- const s = typeof e == "function" ? await e() : e, n = Os(s);
2302
- return Is(n), n;
2303
- },
2304
- useFipsEndpoint: async () => {
2305
- const s = typeof e == "string" ? e : await e();
2306
- return bt(s) ? !0 : typeof r != "function" ? Promise.resolve(!!r) : r();
2307
- }
2308
- });
2309
- }, Ke = "content-length";
2310
- function _s(t) {
2311
- return (e) => async (r) => {
2312
- const s = r.request;
2313
- if (x.isInstance(s)) {
2314
- const { body: n, headers: i } = s;
2315
- if (n && Object.keys(i).map((a) => a.toLowerCase()).indexOf(Ke) === -1)
2316
- try {
2317
- const a = t(n);
2318
- s.headers = {
2319
- ...s.headers,
2320
- [Ke]: String(a)
2321
- };
2322
- } catch {
2323
- }
2324
- }
2325
- return e({
2326
- ...r,
2327
- request: s
2328
- });
2329
- };
2330
- }
2331
- const ks = {
2332
- step: "build",
2333
- tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
2334
- name: "contentLengthMiddleware",
2335
- override: !0
2336
- }, ci = (t) => ({
2337
- applyToStack: (e) => {
2338
- e.add(_s(t.bodyLengthChecker), ks);
2339
- }
2340
- }), Ms = async (t) => {
2341
- const e = t?.Bucket || "";
2342
- if (typeof t.Bucket == "string" && (t.Bucket = e.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"))), Us(e)) {
2343
- if (t.ForcePathStyle === !0)
2344
- throw new Error("Path-style addressing cannot be used with ARN buckets");
2345
- } else (!Ds(e) || e.indexOf(".") !== -1 && !String(t.Endpoint).startsWith("http:") || e.toLowerCase() !== e || e.length < 3) && (t.ForcePathStyle = !0);
2346
- return t.DisableMultiRegionAccessPoints && (t.disableMultiRegionAccessPoints = !0, t.DisableMRAP = !0), t;
2347
- }, Ps = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/, $s = /(\d+\.){3}\d+/, Ns = /\.\./, Ds = (t) => Ps.test(t) && !$s.test(t) && !Ns.test(t), Us = (t) => {
2348
- const [e, r, s, , , n] = t.split(":"), i = e === "arn" && t.split(":").length >= 6, a = !!(i && r && s && n);
2349
- if (i && !a)
2350
- throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);
2351
- return a;
2352
- }, Ls = (t, e, r, s = !1) => {
2353
- const n = async () => {
2354
- let i;
2355
- return s ? i = r.clientContextParams?.[t] ?? r[t] ?? r[e] : i = r[t] ?? r[e], typeof i == "function" ? i() : i;
2356
- };
2357
- return t === "credentialScope" || e === "CredentialScope" ? async () => {
2358
- const i = typeof r.credentials == "function" ? await r.credentials() : r.credentials;
2359
- return i?.credentialScope ?? i?.CredentialScope;
2360
- } : t === "accountId" || e === "AccountId" ? async () => {
2361
- const i = typeof r.credentials == "function" ? await r.credentials() : r.credentials;
2362
- return i?.accountId ?? i?.AccountId;
2363
- } : t === "endpoint" || e === "endpoint" ? async () => {
2364
- if (r.isCustomEndpoint === !1)
2365
- return;
2366
- const i = await n();
2367
- if (i && typeof i == "object") {
2368
- if ("url" in i)
2369
- return i.url.href;
2370
- if ("hostname" in i) {
2371
- const { protocol: a, hostname: c, port: u, path: o } = i;
2372
- return `${a}//${c}${u ? ":" + u : ""}${o}`;
2373
- }
2374
- }
2375
- return i;
2376
- } : n;
2377
- }, Et = async (t) => {
2378
- }, Rt = (t) => typeof t == "object" ? "url" in t ? Ee(t.url) : t : Ee(t), Hs = async (t, e, r, s) => {
2379
- if (!r.isCustomEndpoint) {
2380
- let a;
2381
- r.serviceConfiguredEndpoint ? a = await r.serviceConfiguredEndpoint() : a = await Et(r.serviceId), a && (r.endpoint = () => Promise.resolve(Rt(a)), r.isCustomEndpoint = !0);
2382
- }
2383
- const n = await zs(t, e, r);
2384
- if (typeof r.endpointProvider != "function")
2385
- throw new Error("config.endpointProvider is not set.");
2386
- return r.endpointProvider(n, s);
2387
- }, zs = async (t, e, r) => {
2388
- const s = {}, n = e?.getEndpointParameterInstructions?.() || {};
2389
- for (const [i, a] of Object.entries(n))
2390
- switch (a.type) {
2391
- case "staticContextParams":
2392
- s[i] = a.value;
2393
- break;
2394
- case "contextParams":
2395
- s[i] = t[a.name];
2396
- break;
2397
- case "clientContextParams":
2398
- case "builtInParams":
2399
- s[i] = await Ls(a.name, i, r, a.type !== "builtInParams")();
2400
- break;
2401
- case "operationContextParams":
2402
- s[i] = a.get(t);
2403
- break;
2404
- default:
2405
- throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(a));
2406
- }
2407
- return Object.keys(n).length === 0 && Object.assign(s, r), String(r.serviceId).toLowerCase() === "s3" && await Ms(s), s;
2408
- }, Fs = ({ config: t, instructions: e }) => (r, s) => async (n) => {
2409
- t.isCustomEndpoint && Qt(s, "ENDPOINT_OVERRIDE", "N");
2410
- const i = await Hs(n.input, {
2411
- getEndpointParameterInstructions() {
2412
- return e;
2413
- }
2414
- }, { ...t }, s);
2415
- s.endpointV2 = i, s.authSchemes = i.properties?.authSchemes;
2416
- const a = s.authSchemes?.[0];
2417
- if (a) {
2418
- s.signing_region = a.signingRegion, s.signing_service = a.signingName;
2419
- const u = V(s)?.selectedHttpAuthScheme?.httpAuthOption;
2420
- u && (u.signingProperties = Object.assign(u.signingProperties || {}, {
2421
- signing_region: a.signingRegion,
2422
- signingRegion: a.signingRegion,
2423
- signing_service: a.signingName,
2424
- signingName: a.signingName,
2425
- signingRegionSet: a.signingRegionSet
2426
- }, a.properties));
2427
- }
2428
- return r({
2429
- ...n
2430
- });
2431
- }, Bs = {
2432
- step: "serialize",
2433
- tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
2434
- name: "endpointV2Middleware",
2435
- override: !0,
2436
- relation: "before",
2437
- toMiddleware: Lt.name
2438
- }, ui = (t, e) => ({
2439
- applyToStack: (r) => {
2440
- r.addRelativeTo(Fs({
2441
- config: t,
2442
- instructions: e
2443
- }), Bs);
2444
- }
2445
- }), di = (t) => {
2446
- const e = t.tls ?? !0, { endpoint: r, useDualstackEndpoint: s, useFipsEndpoint: n } = t, i = r != null ? async () => Rt(await M(r)()) : void 0, c = Object.assign(t, {
2447
- endpoint: i,
2448
- tls: e,
2449
- isCustomEndpoint: !!r,
2450
- useDualstackEndpoint: M(s ?? !1),
2451
- useFipsEndpoint: M(n ?? !1)
2452
- });
2453
- let u;
2454
- return c.serviceConfiguredEndpoint = async () => (t.serviceId && !u && (u = Et(t.serviceId)), u), c;
2455
- };
2456
- var N;
2457
- (function(t) {
2458
- t.STANDARD = "standard", t.ADAPTIVE = "adaptive";
2459
- })(N || (N = {}));
2460
- const Re = 3, li = N.STANDARD, js = [
2461
- "BandwidthLimitExceeded",
2462
- "EC2ThrottledException",
2463
- "LimitExceededException",
2464
- "PriorRequestNotComplete",
2465
- "ProvisionedThroughputExceededException",
2466
- "RequestLimitExceeded",
2467
- "RequestThrottled",
2468
- "RequestThrottledException",
2469
- "SlowDown",
2470
- "ThrottledException",
2471
- "Throttling",
2472
- "ThrottlingException",
2473
- "TooManyRequestsException",
2474
- "TransactionInProgressException"
2475
- ], qs = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"], Gs = [500, 502, 503, 504], Vs = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"], Ws = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"], Ks = (t) => t?.$retryable !== void 0, Xs = (t) => t.$metadata?.clockSkewCorrected, Qs = (t) => {
2476
- const e = /* @__PURE__ */ new Set([
2477
- "Failed to fetch",
2478
- "NetworkError when attempting to fetch resource",
2479
- "The Internet connection appears to be offline",
2480
- "Load failed",
2481
- "Network request failed"
2482
- ]);
2483
- return t && t instanceof TypeError ? e.has(t.message) : !1;
2484
- }, vt = (t) => t.$metadata?.httpStatusCode === 429 || js.includes(t.name) || t.$retryable?.throttling == !0, Ce = (t, e = 0) => Ks(t) || Xs(t) || qs.includes(t.name) || Vs.includes(t?.code || "") || Ws.includes(t?.code || "") || Gs.includes(t.$metadata?.httpStatusCode || 0) || Qs(t) || t.cause !== void 0 && e <= 10 && Ce(t.cause, e + 1), Ys = (t) => {
2485
- if (t.$metadata?.httpStatusCode !== void 0) {
2486
- const e = t.$metadata.httpStatusCode;
2487
- return 500 <= e && e <= 599 && !Ce(t);
2488
- }
2489
- return !1;
2490
- };
2491
- class xe {
2492
- static setTimeoutFn = setTimeout;
2493
- beta;
2494
- minCapacity;
2495
- minFillRate;
2496
- scaleConstant;
2497
- smooth;
2498
- currentCapacity = 0;
2499
- enabled = !1;
2500
- lastMaxRate = 0;
2501
- measuredTxRate = 0;
2502
- requestCount = 0;
2503
- fillRate;
2504
- lastThrottleTime;
2505
- lastTimestamp = 0;
2506
- lastTxRateBucket;
2507
- maxCapacity;
2508
- timeWindow = 0;
2509
- constructor(e) {
2510
- this.beta = e?.beta ?? 0.7, this.minCapacity = e?.minCapacity ?? 1, this.minFillRate = e?.minFillRate ?? 0.5, this.scaleConstant = e?.scaleConstant ?? 0.4, this.smooth = e?.smooth ?? 0.8;
2511
- const r = this.getCurrentTimeInSeconds();
2512
- this.lastThrottleTime = r, this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()), this.fillRate = this.minFillRate, this.maxCapacity = this.minCapacity;
2513
- }
2514
- getCurrentTimeInSeconds() {
2515
- return Date.now() / 1e3;
2516
- }
2517
- async getSendToken() {
2518
- return this.acquireTokenBucket(1);
2519
- }
2520
- async acquireTokenBucket(e) {
2521
- if (this.enabled) {
2522
- if (this.refillTokenBucket(), e > this.currentCapacity) {
2523
- const r = (e - this.currentCapacity) / this.fillRate * 1e3;
2524
- await new Promise((s) => xe.setTimeoutFn(s, r));
2525
- }
2526
- this.currentCapacity = this.currentCapacity - e;
2527
- }
2528
- }
2529
- refillTokenBucket() {
2530
- const e = this.getCurrentTimeInSeconds();
2531
- if (!this.lastTimestamp) {
2532
- this.lastTimestamp = e;
2533
- return;
2534
- }
2535
- const r = (e - this.lastTimestamp) * this.fillRate;
2536
- this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + r), this.lastTimestamp = e;
2537
- }
2538
- updateClientSendingRate(e) {
2539
- let r;
2540
- if (this.updateMeasuredRate(), vt(e)) {
2541
- const n = this.enabled ? Math.min(this.measuredTxRate, this.fillRate) : this.measuredTxRate;
2542
- this.lastMaxRate = n, this.calculateTimeWindow(), this.lastThrottleTime = this.getCurrentTimeInSeconds(), r = this.cubicThrottle(n), this.enableTokenBucket();
2543
- } else
2544
- this.calculateTimeWindow(), r = this.cubicSuccess(this.getCurrentTimeInSeconds());
2545
- const s = Math.min(r, 2 * this.measuredTxRate);
2546
- this.updateTokenBucketRate(s);
2547
- }
2548
- calculateTimeWindow() {
2549
- this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
2550
- }
2551
- cubicThrottle(e) {
2552
- return this.getPrecise(e * this.beta);
2553
- }
2554
- cubicSuccess(e) {
2555
- return this.getPrecise(this.scaleConstant * Math.pow(e - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
2556
- }
2557
- enableTokenBucket() {
2558
- this.enabled = !0;
2559
- }
2560
- updateTokenBucketRate(e) {
2561
- this.refillTokenBucket(), this.fillRate = Math.max(e, this.minFillRate), this.maxCapacity = Math.max(e, this.minCapacity), this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
2562
- }
2563
- updateMeasuredRate() {
2564
- const e = this.getCurrentTimeInSeconds(), r = Math.floor(e * 2) / 2;
2565
- if (this.requestCount++, r > this.lastTxRateBucket) {
2566
- const s = this.requestCount / (r - this.lastTxRateBucket);
2567
- this.measuredTxRate = this.getPrecise(s * this.smooth + this.measuredTxRate * (1 - this.smooth)), this.requestCount = 0, this.lastTxRateBucket = r;
2568
- }
2569
- }
2570
- getPrecise(e) {
2571
- return parseFloat(e.toFixed(8));
2572
- }
2573
- }
2574
- const ve = 100, Tt = 20 * 1e3, Js = 500, Xe = 500, Zs = 5, en = 10, tn = 1, rn = "amz-sdk-invocation-id", sn = "amz-sdk-request", nn = () => {
2575
- let t = ve;
2576
- return {
2577
- computeNextBackoffDelay: (s) => Math.floor(Math.min(Tt, Math.random() * 2 ** s * t)),
2578
- setDelayBase: (s) => {
2579
- t = s;
2580
- }
2581
- };
2582
- }, Qe = ({ retryDelay: t, retryCount: e, retryCost: r }) => ({
2583
- getRetryCount: () => e,
2584
- getRetryDelay: () => Math.min(Tt, t),
2585
- getRetryCost: () => r
2586
- });
2587
- class At {
2588
- maxAttempts;
2589
- mode = N.STANDARD;
2590
- capacity = Xe;
2591
- retryBackoffStrategy = nn();
2592
- maxAttemptsProvider;
2593
- constructor(e) {
2594
- this.maxAttempts = e, this.maxAttemptsProvider = typeof e == "function" ? e : async () => e;
2595
- }
2596
- async acquireInitialRetryToken(e) {
2597
- return Qe({
2598
- retryDelay: ve,
2599
- retryCount: 0
2600
- });
2601
- }
2602
- async refreshRetryTokenForRetry(e, r) {
2603
- const s = await this.getMaxAttempts();
2604
- if (this.shouldRetry(e, r, s)) {
2605
- const n = r.errorType;
2606
- this.retryBackoffStrategy.setDelayBase(n === "THROTTLING" ? Js : ve);
2607
- const i = this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()), a = r.retryAfterHint ? Math.max(r.retryAfterHint.getTime() - Date.now() || 0, i) : i, c = this.getCapacityCost(n);
2608
- return this.capacity -= c, Qe({
2609
- retryDelay: a,
2610
- retryCount: e.getRetryCount() + 1,
2611
- retryCost: c
2612
- });
2613
- }
2614
- throw new Error("No retry token available");
2615
- }
2616
- recordSuccess(e) {
2617
- this.capacity = Math.max(Xe, this.capacity + (e.getRetryCost() ?? tn));
2618
- }
2619
- getCapacity() {
2620
- return this.capacity;
2621
- }
2622
- async getMaxAttempts() {
2623
- try {
2624
- return await this.maxAttemptsProvider();
2625
- } catch {
2626
- return console.warn(`Max attempts provider could not resolve. Using default of ${Re}`), Re;
2627
- }
2628
- }
2629
- shouldRetry(e, r, s) {
2630
- return e.getRetryCount() + 1 < s && this.capacity >= this.getCapacityCost(r.errorType) && this.isRetryableError(r.errorType);
2631
- }
2632
- getCapacityCost(e) {
2633
- return e === "TRANSIENT" ? en : Zs;
2634
- }
2635
- isRetryableError(e) {
2636
- return e === "THROTTLING" || e === "TRANSIENT";
2637
- }
2638
- }
2639
- class an {
2640
- maxAttemptsProvider;
2641
- rateLimiter;
2642
- standardRetryStrategy;
2643
- mode = N.ADAPTIVE;
2644
- constructor(e, r) {
2645
- this.maxAttemptsProvider = e;
2646
- const { rateLimiter: s } = r ?? {};
2647
- this.rateLimiter = s ?? new xe(), this.standardRetryStrategy = new At(e);
2648
- }
2649
- async acquireInitialRetryToken(e) {
2650
- return await this.rateLimiter.getSendToken(), this.standardRetryStrategy.acquireInitialRetryToken(e);
2651
- }
2652
- async refreshRetryTokenForRetry(e, r) {
2653
- return this.rateLimiter.updateClientSendingRate(r), this.standardRetryStrategy.refreshRetryTokenForRetry(e, r);
2654
- }
2655
- recordSuccess(e) {
2656
- this.rateLimiter.updateClientSendingRate({}), this.standardRetryStrategy.recordSuccess(e);
2657
- }
2658
- }
2659
- const on = (t) => t instanceof Error ? t : t instanceof Object ? Object.assign(new Error(), t) : typeof t == "string" ? new Error(t) : new Error(`AWS SDK error wrapper for ${t}`), fi = (t) => {
2660
- const { retryStrategy: e, retryMode: r, maxAttempts: s } = t, n = M(s ?? Re);
2661
- return Object.assign(t, {
2662
- maxAttempts: n,
2663
- retryStrategy: async () => e || (await M(r)() === N.ADAPTIVE ? new an(n) : new At(n))
2664
- });
2665
- }, cn = (t) => t?.body instanceof ReadableStream, un = (t) => (e, r) => async (s) => {
2666
- let n = await t.retryStrategy();
2667
- const i = await t.maxAttempts();
2668
- if (dn(n)) {
2669
- n = n;
2670
- let a = await n.acquireInitialRetryToken(r.partition_id), c = new Error(), u = 0, o = 0;
2671
- const { request: h } = s, d = x.isInstance(h);
2672
- for (d && (h.headers[rn] = Kt()); ; )
2673
- try {
2674
- d && (h.headers[sn] = `attempt=${u + 1}; max=${i}`);
2675
- const { response: l, output: f } = await e(s);
2676
- return n.recordSuccess(a), f.$metadata.attempts = u + 1, f.$metadata.totalRetryDelay = o, { response: l, output: f };
2677
- } catch (l) {
2678
- const f = ln(l);
2679
- if (c = on(l), d && cn(h))
2680
- throw (r.logger instanceof Nr ? console : r.logger)?.warn("An error was encountered in a non-retryable streaming request."), c;
2681
- try {
2682
- a = await n.refreshRetryTokenForRetry(a, f);
2683
- } catch {
2684
- throw c.$metadata || (c.$metadata = {}), c.$metadata.attempts = u + 1, c.$metadata.totalRetryDelay = o, c;
2685
- }
2686
- u = a.getRetryCount();
2687
- const m = a.getRetryDelay();
2688
- o += m, await new Promise((g) => setTimeout(g, m));
2689
- }
2690
- } else
2691
- return n = n, n?.mode && (r.userAgent = [...r.userAgent || [], ["cfg/retry-mode", n.mode]]), n.retry(e, s);
2692
- }, dn = (t) => typeof t.acquireInitialRetryToken < "u" && typeof t.refreshRetryTokenForRetry < "u" && typeof t.recordSuccess < "u", ln = (t) => {
2693
- const e = {
2694
- error: t,
2695
- errorType: fn(t)
2696
- }, r = pn(t.$response);
2697
- return r && (e.retryAfterHint = r), e;
2698
- }, fn = (t) => vt(t) ? "THROTTLING" : Ce(t) ? "TRANSIENT" : Ys(t) ? "SERVER_ERROR" : "CLIENT_ERROR", hn = {
2699
- name: "retryMiddleware",
2700
- tags: ["RETRY"],
2701
- step: "finalizeRequest",
2702
- priority: "high",
2703
- override: !0
2704
- }, hi = (t) => ({
2705
- applyToStack: (e) => {
2706
- e.add(un(t), hn);
2707
- }
2708
- }), pn = (t) => {
2709
- if (!te.isInstance(t))
2710
- return;
2711
- const e = Object.keys(t.headers).find((i) => i.toLowerCase() === "retry-after");
2712
- if (!e)
2713
- return;
2714
- const r = t.headers[e], s = Number(r);
2715
- return Number.isNaN(s) ? new Date(r) : new Date(s * 1e3);
2716
- }, mn = {};
2717
- function Q() {
2718
- return typeof window < "u" ? window : typeof self < "u" ? self : mn;
2719
- }
2720
- var gn = [
2721
- "decrypt",
2722
- "digest",
2723
- "encrypt",
2724
- "exportKey",
2725
- "generateKey",
2726
- "importKey",
2727
- "sign",
2728
- "verify"
2729
- ];
2730
- function yn(t) {
2731
- if (wn(t) && typeof t.crypto.subtle == "object") {
2732
- var e = t.crypto.subtle;
2733
- return Sn(e);
2734
- }
2735
- return !1;
2736
- }
2737
- function wn(t) {
2738
- if (typeof t == "object" && typeof t.crypto == "object") {
2739
- var e = t.crypto.getRandomValues;
2740
- return typeof e == "function";
2741
- }
2742
- return !1;
2743
- }
2744
- function Sn(t) {
2745
- return t && gn.every(function(e) {
2746
- return typeof t[e] == "function";
2747
- });
2748
- }
2749
- var Ct = { name: "SHA-256" }, Ye = {
2750
- name: "HMAC",
2751
- hash: Ct
2752
- }, bn = new Uint8Array([
2753
- 227,
2754
- 176,
2755
- 196,
2756
- 66,
2757
- 152,
2758
- 252,
2759
- 28,
2760
- 20,
2761
- 154,
2762
- 251,
2763
- 244,
2764
- 200,
2765
- 153,
2766
- 111,
2767
- 185,
2768
- 36,
2769
- 39,
2770
- 174,
2771
- 65,
2772
- 228,
2773
- 100,
2774
- 155,
2775
- 147,
2776
- 76,
2777
- 164,
2778
- 149,
2779
- 153,
2780
- 27,
2781
- 120,
2782
- 82,
2783
- 184,
2784
- 85
2785
- ]), En = (
2786
- /** @class */
2787
- (function() {
2788
- function t(e) {
2789
- this.toHash = new Uint8Array(0), this.secret = e, this.reset();
2790
- }
2791
- return t.prototype.update = function(e) {
2792
- if (!Se(e)) {
2793
- var r = q(e), s = new Uint8Array(this.toHash.byteLength + r.byteLength);
2794
- s.set(this.toHash, 0), s.set(r, this.toHash.byteLength), this.toHash = s;
2795
- }
2796
- }, t.prototype.digest = function() {
2797
- var e = this;
2798
- return this.key ? this.key.then(function(r) {
2799
- return Q().crypto.subtle.sign(Ye, r, e.toHash).then(function(s) {
2800
- return new Uint8Array(s);
2801
- });
2802
- }) : Se(this.toHash) ? Promise.resolve(bn) : Promise.resolve().then(function() {
2803
- return Q().crypto.subtle.digest(Ct, e.toHash);
2804
- }).then(function(r) {
2805
- return Promise.resolve(new Uint8Array(r));
2806
- });
2807
- }, t.prototype.reset = function() {
2808
- var e = this;
2809
- this.toHash = new Uint8Array(0), this.secret && this.secret !== void 0 && (this.key = new Promise(function(r, s) {
2810
- Q().crypto.subtle.importKey("raw", q(e.secret), Ye, !1, ["sign"]).then(r, s);
2811
- }), this.key.catch(function() {
2812
- }));
2813
- }, t;
2814
- })()
2815
- ), R = 64, Rn = 32, vn = new Uint32Array([
2816
- 1116352408,
2817
- 1899447441,
2818
- 3049323471,
2819
- 3921009573,
2820
- 961987163,
2821
- 1508970993,
2822
- 2453635748,
2823
- 2870763221,
2824
- 3624381080,
2825
- 310598401,
2826
- 607225278,
2827
- 1426881987,
2828
- 1925078388,
2829
- 2162078206,
2830
- 2614888103,
2831
- 3248222580,
2832
- 3835390401,
2833
- 4022224774,
2834
- 264347078,
2835
- 604807628,
2836
- 770255983,
2837
- 1249150122,
2838
- 1555081692,
2839
- 1996064986,
2840
- 2554220882,
2841
- 2821834349,
2842
- 2952996808,
2843
- 3210313671,
2844
- 3336571891,
2845
- 3584528711,
2846
- 113926993,
2847
- 338241895,
2848
- 666307205,
2849
- 773529912,
2850
- 1294757372,
2851
- 1396182291,
2852
- 1695183700,
2853
- 1986661051,
2854
- 2177026350,
2855
- 2456956037,
2856
- 2730485921,
2857
- 2820302411,
2858
- 3259730800,
2859
- 3345764771,
2860
- 3516065817,
2861
- 3600352804,
2862
- 4094571909,
2863
- 275423344,
2864
- 430227734,
2865
- 506948616,
2866
- 659060556,
2867
- 883997877,
2868
- 958139571,
2869
- 1322822218,
2870
- 1537002063,
2871
- 1747873779,
2872
- 1955562222,
2873
- 2024104815,
2874
- 2227730452,
2875
- 2361852424,
2876
- 2428436474,
2877
- 2756734187,
2878
- 3204031479,
2879
- 3329325298
2880
- ]), Tn = [
2881
- 1779033703,
2882
- 3144134277,
2883
- 1013904242,
2884
- 2773480762,
2885
- 1359893119,
2886
- 2600822924,
2887
- 528734635,
2888
- 1541459225
2889
- ], An = Math.pow(2, 53) - 1, Y = (
2890
- /** @class */
2891
- (function() {
2892
- function t() {
2893
- this.state = Int32Array.from(Tn), this.temp = new Int32Array(64), this.buffer = new Uint8Array(64), this.bufferLength = 0, this.bytesHashed = 0, this.finished = !1;
2894
- }
2895
- return t.prototype.update = function(e) {
2896
- if (this.finished)
2897
- throw new Error("Attempted to update an already finished hash.");
2898
- var r = 0, s = e.byteLength;
2899
- if (this.bytesHashed += s, this.bytesHashed * 8 > An)
2900
- throw new Error("Cannot hash more than 2^53 - 1 bits");
2901
- for (; s > 0; )
2902
- this.buffer[this.bufferLength++] = e[r++], s--, this.bufferLength === R && (this.hashBuffer(), this.bufferLength = 0);
2903
- }, t.prototype.digest = function() {
2904
- if (!this.finished) {
2905
- var e = this.bytesHashed * 8, r = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength), s = this.bufferLength;
2906
- if (r.setUint8(this.bufferLength++, 128), s % R >= R - 8) {
2907
- for (var n = this.bufferLength; n < R; n++)
2908
- r.setUint8(n, 0);
2909
- this.hashBuffer(), this.bufferLength = 0;
2910
- }
2911
- for (var n = this.bufferLength; n < R - 8; n++)
2912
- r.setUint8(n, 0);
2913
- r.setUint32(R - 8, Math.floor(e / 4294967296), !0), r.setUint32(R - 4, e), this.hashBuffer(), this.finished = !0;
2914
- }
2915
- for (var i = new Uint8Array(Rn), n = 0; n < 8; n++)
2916
- i[n * 4] = this.state[n] >>> 24 & 255, i[n * 4 + 1] = this.state[n] >>> 16 & 255, i[n * 4 + 2] = this.state[n] >>> 8 & 255, i[n * 4 + 3] = this.state[n] >>> 0 & 255;
2917
- return i;
2918
- }, t.prototype.hashBuffer = function() {
2919
- for (var e = this, r = e.buffer, s = e.state, n = s[0], i = s[1], a = s[2], c = s[3], u = s[4], o = s[5], h = s[6], d = s[7], l = 0; l < R; l++) {
2920
- if (l < 16)
2921
- this.temp[l] = (r[l * 4] & 255) << 24 | (r[l * 4 + 1] & 255) << 16 | (r[l * 4 + 2] & 255) << 8 | r[l * 4 + 3] & 255;
2922
- else {
2923
- var f = this.temp[l - 2], m = (f >>> 17 | f << 15) ^ (f >>> 19 | f << 13) ^ f >>> 10;
2924
- f = this.temp[l - 15];
2925
- var g = (f >>> 7 | f << 25) ^ (f >>> 18 | f << 14) ^ f >>> 3;
2926
- this.temp[l] = (m + this.temp[l - 7] | 0) + (g + this.temp[l - 16] | 0);
2927
- }
2928
- var p = (((u >>> 6 | u << 26) ^ (u >>> 11 | u << 21) ^ (u >>> 25 | u << 7)) + (u & o ^ ~u & h) | 0) + (d + (vn[l] + this.temp[l] | 0) | 0) | 0, y = ((n >>> 2 | n << 30) ^ (n >>> 13 | n << 19) ^ (n >>> 22 | n << 10)) + (n & i ^ n & a ^ i & a) | 0;
2929
- d = h, h = o, o = u, u = c + p | 0, c = a, a = i, i = n, n = p + y | 0;
2930
- }
2931
- s[0] += n, s[1] += i, s[2] += a, s[3] += c, s[4] += u, s[5] += o, s[6] += h, s[7] += d;
2932
- }, t;
2933
- })()
2934
- ), Cn = (
2935
- /** @class */
2936
- (function() {
2937
- function t(e) {
2938
- this.secret = e, this.hash = new Y(), this.reset();
2939
- }
2940
- return t.prototype.update = function(e) {
2941
- if (!(Se(e) || this.error))
2942
- try {
2943
- this.hash.update(q(e));
2944
- } catch (r) {
2945
- this.error = r;
2946
- }
2947
- }, t.prototype.digestSync = function() {
2948
- if (this.error)
2949
- throw this.error;
2950
- return this.outer ? (this.outer.finished || this.outer.update(this.hash.digest()), this.outer.digest()) : this.hash.digest();
2951
- }, t.prototype.digest = function() {
2952
- return Dr(this, void 0, void 0, function() {
2953
- return Ur(this, function(e) {
2954
- return [2, this.digestSync()];
2955
- });
2956
- });
2957
- }, t.prototype.reset = function() {
2958
- if (this.hash = new Y(), this.secret) {
2959
- this.outer = new Y();
2960
- var e = xn(this.secret), r = new Uint8Array(R);
2961
- r.set(e);
2962
- for (var s = 0; s < R; s++)
2963
- e[s] ^= 54, r[s] ^= 92;
2964
- this.hash.update(e), this.outer.update(r);
2965
- for (var s = 0; s < e.byteLength; s++)
2966
- e[s] = 0;
2967
- }
2968
- }, t;
2969
- })()
2970
- );
2971
- function xn(t) {
2972
- var e = q(t);
2973
- if (e.byteLength > R) {
2974
- var r = new Y();
2975
- r.update(e), e = r.digest();
2976
- }
2977
- var s = new Uint8Array(R);
2978
- return s.set(e), s;
2979
- }
2980
- var pi = (
2981
- /** @class */
2982
- (function() {
2983
- function t(e) {
2984
- yn(Q()) ? this.hash = new En(e) : this.hash = new Cn(e);
2985
- }
2986
- return t.prototype.update = function(e, r) {
2987
- this.hash.update(q(e));
2988
- }, t.prototype.digest = function() {
2989
- return this.hash.digest();
2990
- }, t.prototype.reset = function() {
2991
- this.hash.reset();
2992
- }, t;
2993
- })()
2994
- );
2995
- const mi = ({ serviceId: t, clientVersion: e }) => async (r) => {
2996
- const s = typeof window < "u" ? window.navigator : void 0, n = s?.userAgent ?? "", i = s?.userAgentData?.platform ?? Je.os(n) ?? "other", a = void 0, c = s?.userAgentData?.brands ?? [], u = c[c.length - 1], o = u?.brand ?? Je.browser(n) ?? "unknown", h = u?.version ?? "unknown", d = [
2997
- ["aws-sdk-js", e],
2998
- ["ua", "2.1"],
2999
- [`os/${i}`, a],
3000
- ["lang/js"],
3001
- ["md/browser", `${o}_${h}`]
3002
- ];
3003
- t && d.push([`api/${t}`, e]);
3004
- const l = await r?.userAgentAppId?.();
3005
- return l && d.push([`app/${l}`]), d;
3006
- }, Je = {
3007
- os(t) {
3008
- if (/iPhone|iPad|iPod/.test(t))
3009
- return "iOS";
3010
- if (/Macintosh|Mac OS X/.test(t))
3011
- return "macOS";
3012
- if (/Windows NT/.test(t))
3013
- return "Windows";
3014
- if (/Android/.test(t))
3015
- return "Android";
3016
- if (/Linux/.test(t))
3017
- return "Linux";
3018
- },
3019
- browser(t) {
3020
- if (/EdgiOS|EdgA|Edg\//.test(t))
3021
- return "Microsoft Edge";
3022
- if (/Firefox\//.test(t))
3023
- return "Firefox";
3024
- if (/Chrome\//.test(t))
3025
- return "Chrome";
3026
- if (/Safari\//.test(t))
3027
- return "Safari";
3028
- }
3029
- }, gi = (t) => () => Promise.reject(t), In = ["in-region", "cross-region", "mobile", "standard", "legacy"], yi = ({ defaultsMode: t } = {}) => tr(async () => {
3030
- const e = typeof t == "function" ? await t() : t;
3031
- switch (e?.toLowerCase()) {
3032
- case "auto":
3033
- return Promise.resolve(On() ? "mobile" : "standard");
3034
- case "mobile":
3035
- case "in-region":
3036
- case "cross-region":
3037
- case "standard":
3038
- case "legacy":
3039
- return Promise.resolve(e?.toLocaleLowerCase());
3040
- case void 0:
3041
- return Promise.resolve("legacy");
3042
- default:
3043
- throw new Error(`Invalid parameter for "defaultsMode", expect ${In.join(", ")}, got ${e}`);
3044
- }
3045
- }), On = () => {
3046
- const t = window?.navigator;
3047
- if (t?.connection) {
3048
- const { effectiveType: e, rtt: r, downlink: s } = t?.connection;
3049
- if (typeof e == "string" && e !== "4g" || Number(r) > 100 || Number(s) < 10)
3050
- return !0;
3051
- }
3052
- return t?.userAgentData?.mobile || typeof t?.maxTouchPoints == "number" && t?.maxTouchPoints > 1;
3053
- }, wi = (t) => ({
3054
- setRegion(e) {
3055
- t.region = e;
3056
- },
3057
- region() {
3058
- return t.region;
3059
- }
3060
- }), Si = (t) => ({
3061
- region: t.region()
3062
- });
3063
- export {
3064
- Zn as $,
3065
- Pn as A,
3066
- qn as B,
3067
- Or as C,
3068
- li as D,
3069
- ri as E,
3070
- wi as F,
3071
- Gn as G,
3072
- Ln as H,
3073
- kn as I,
3074
- Si as J,
3075
- Vn as K,
3076
- $ as L,
3077
- Mn as M,
3078
- A as N,
3079
- ti as O,
3080
- Wn as P,
3081
- fi as Q,
3082
- oi as R,
3083
- Xt as S,
3084
- T,
3085
- Xn as U,
3086
- di as V,
3087
- Un as W,
3088
- ni as X,
3089
- hi as Y,
3090
- ci as Z,
3091
- Jn as _,
3092
- jn as a,
3093
- ei as a0,
3094
- $n as a1,
3095
- zn as a2,
3096
- Nn as a3,
3097
- Yn as a4,
3098
- H as a5,
3099
- Pt as a6,
3100
- Ze as a7,
3101
- L as a8,
3102
- wr as a9,
3103
- Se as aa,
3104
- q as ab,
3105
- Dr as ac,
3106
- Ur as ad,
3107
- Qn as ae,
3108
- j as af,
3109
- C as ag,
3110
- Le as ah,
3111
- Bt as ai,
3112
- ws as aj,
3113
- zs as ak,
3114
- Q as al,
3115
- yn as am,
3116
- tt as b,
3117
- Dn as c,
3118
- Hn as d,
3119
- Kn as e,
3120
- ie as f,
3121
- ui as g,
3122
- V as h,
3123
- re as i,
3124
- ut as j,
3125
- be as k,
3126
- si as l,
3127
- Nr as m,
3128
- M as n,
3129
- yi as o,
3130
- Ee as p,
3131
- pi as q,
3132
- Fn as r,
3133
- kt as s,
3134
- Re as t,
3135
- Bn as u,
3136
- Kt as v,
3137
- ai as w,
3138
- ii as x,
3139
- gi as y,
3140
- mi as z
3141
- };