dynamic-mui 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,153 +0,0 @@
1
- import { t as z, s as x } from "./index-C6FETa-1.mjs";
2
- class T {
3
- marshaller;
4
- serializer;
5
- deserializer;
6
- serdeContext;
7
- defaultContentType;
8
- constructor({ marshaller: i, serializer: n, deserializer: o, serdeContext: c, defaultContentType: y }) {
9
- this.marshaller = i, this.serializer = n, this.deserializer = o, this.serdeContext = c, this.defaultContentType = y;
10
- }
11
- async serializeEventStream({ eventStream: i, requestSchema: n, initialRequest: o }) {
12
- const c = this.marshaller, y = n.getEventStreamMember(), p = n.getMemberSchema(y), d = this.serializer, f = this.defaultContentType, h = /* @__PURE__ */ Symbol("initialRequestMarker"), S = {
13
- async *[Symbol.asyncIterator]() {
14
- if (o) {
15
- const r = {
16
- ":event-type": { type: "string", value: "initial-request" },
17
- ":message-type": { type: "string", value: "event" },
18
- ":content-type": { type: "string", value: f }
19
- };
20
- d.write(n, o);
21
- const t = d.flush();
22
- yield {
23
- [h]: !0,
24
- headers: r,
25
- body: t
26
- };
27
- }
28
- for await (const r of i)
29
- yield r;
30
- }
31
- };
32
- return c.serialize(S, (r) => {
33
- if (r[h])
34
- return {
35
- headers: r.headers,
36
- body: r.body
37
- };
38
- const t = Object.keys(r).find((s) => s !== "__type") ?? "", { additionalHeaders: e, body: a, eventType: l, explicitPayloadContentType: m } = this.writeEventBody(t, p, r);
39
- return {
40
- headers: {
41
- ":event-type": { type: "string", value: l },
42
- ":message-type": { type: "string", value: "event" },
43
- ":content-type": { type: "string", value: m ?? f },
44
- ...e
45
- },
46
- body: a
47
- };
48
- });
49
- }
50
- async deserializeEventStream({ response: i, responseSchema: n, initialResponseContainer: o }) {
51
- const c = this.marshaller, y = n.getEventStreamMember(), d = n.getMemberSchema(y).getMemberSchemas(), f = /* @__PURE__ */ Symbol("initialResponseMarker"), h = c.deserialize(i.body, async (t) => {
52
- const e = Object.keys(t).find((l) => l !== "__type") ?? "", a = t[e].body;
53
- if (e === "initial-response") {
54
- const l = await this.deserializer.read(n, a);
55
- return delete l[y], {
56
- [f]: !0,
57
- ...l
58
- };
59
- } else if (e in d) {
60
- const l = d[e];
61
- if (l.isStructSchema()) {
62
- const m = {};
63
- let u = !1;
64
- for (const [s, g] of l.structIterator()) {
65
- const { eventHeader: v, eventPayload: w } = g.getMergedTraits();
66
- if (u = u || !!(v || w), w)
67
- g.isBlobSchema() ? m[s] = a : g.isStringSchema() ? m[s] = (this.serdeContext?.utf8Encoder ?? z)(a) : g.isStructSchema() && (m[s] = await this.deserializer.read(g, a));
68
- else if (v) {
69
- const b = t[e].headers[s]?.value;
70
- b != null && (g.isNumericSchema() ? b && typeof b == "object" && "bytes" in b ? m[s] = BigInt(b.toString()) : m[s] = Number(b) : m[s] = b);
71
- }
72
- }
73
- if (u)
74
- return {
75
- [e]: m
76
- };
77
- if (a.byteLength === 0)
78
- return {
79
- [e]: {}
80
- };
81
- }
82
- return {
83
- [e]: await this.deserializer.read(l, a)
84
- };
85
- } else
86
- return {
87
- $unknown: t
88
- };
89
- }), S = h[Symbol.asyncIterator](), r = await S.next();
90
- if (r.done)
91
- return h;
92
- if (r.value?.[f]) {
93
- if (!n)
94
- throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
95
- for (const [t, e] of Object.entries(r.value))
96
- o[t] = e;
97
- }
98
- return {
99
- async *[Symbol.asyncIterator]() {
100
- for (r?.value?.[f] || (yield r.value); ; ) {
101
- const { done: t, value: e } = await S.next();
102
- if (t)
103
- break;
104
- yield e;
105
- }
106
- }
107
- };
108
- }
109
- writeEventBody(i, n, o) {
110
- const c = this.serializer;
111
- let y = i, p = null, d;
112
- const f = n.getSchema()[4].includes(i), h = {};
113
- if (f) {
114
- const t = n.getMemberSchema(i);
115
- if (t.isStructSchema()) {
116
- for (const [e, a] of t.structIterator()) {
117
- const { eventHeader: l, eventPayload: m } = a.getMergedTraits();
118
- if (m)
119
- p = e;
120
- else if (l) {
121
- const u = o[i][e];
122
- let s = "binary";
123
- a.isNumericSchema() ? (-2) ** 31 <= u && u <= 2 ** 31 - 1 ? s = "integer" : s = "long" : a.isTimestampSchema() ? s = "timestamp" : a.isStringSchema() ? s = "string" : a.isBooleanSchema() && (s = "boolean"), u != null && (h[e] = {
124
- type: s,
125
- value: u
126
- }, delete o[i][e]);
127
- }
128
- }
129
- if (p !== null) {
130
- const e = t.getMemberSchema(p);
131
- e.isBlobSchema() ? d = "application/octet-stream" : e.isStringSchema() && (d = "text/plain"), c.write(e, o[i][p]);
132
- } else
133
- c.write(t, o[i]);
134
- } else if (t.isUnitSchema())
135
- c.write(t, {});
136
- else
137
- throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");
138
- } else {
139
- const [t, e] = o[i];
140
- y = t, c.write(15, e);
141
- }
142
- const S = c.flush() ?? new Uint8Array();
143
- return {
144
- body: typeof S == "string" ? (this.serdeContext?.utf8Decoder ?? x)(S) : S,
145
- eventType: y,
146
- explicitPayloadContentType: d,
147
- additionalHeaders: h
148
- };
149
- }
150
- }
151
- export {
152
- T as EventStreamSerde
153
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-D2FS0pfd.js");class fe extends r.HttpProtocol{async serializeRequest(t,e,o){const s=this.serializer,a={},i={},d=await o.endpoint(),c=r.NormalizedSchema.of(t?.input),l=c.getSchema();let u;const h=e&&typeof e=="object"?e:{},p=new r.HttpRequest({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:i,body:void 0});if(d&&(this.updateServiceEndpoint(p,d),this.setHostPrefix(p,t,h)),h){const g=c.getEventStreamMember();if(g){if(h[g]){const y={};for(const[A,me]of c.structIterator())A!==g&&h[A]&&(s.write(me,h[A]),y[A]=s.flush());u=await this.serializeEventStream({eventStream:h[g],requestSchema:c,initialRequest:y})}}else s.write(l,h),u=s.flush()}return p.headers=Object.assign(p.headers,i),p.query=a,p.body=u,p.method="POST",p}async deserializeResponse(t,e,o){const s=this.deserializer,a=r.NormalizedSchema.of(t.output),i={};if(o.statusCode>=300){const c=await r.collectBody(o.body,e);throw c.byteLength>0&&Object.assign(i,await s.read(15,c)),await this.handleError(t,e,o,i,this.deserializeMetadata(o)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const c in o.headers){const l=o.headers[c];delete o.headers[c],o.headers[c.toLowerCase()]=l}const d=a.getEventStreamMember();if(d)i[d]=await this.deserializeEventStream({response:o,responseSchema:a,initialResponseContainer:i});else{const c=await r.collectBody(o.body,e);c.byteLength>0&&Object.assign(i,await s.read(a,c))}return i.$metadata=this.deserializeMetadata(o),i}}class ge{async sign(t,e,o){return t}}function ye(n,t,e){if(e?.source){const o=e.source;if(typeof t=="number"&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||o!==String(t)))return o.includes(".")?new r.NumericValue(o,"bigDecimal"):BigInt(o)}return t}const Se=(n,t)=>r.collectBody(n,t).then(e=>(t?.utf8Encoder??r.toUtf8)(e)),Ee=(n,t)=>Se(n,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(o){throw o?.name==="SyntaxError"&&Object.defineProperty(o,"$responseBodyText",{value:e}),o}return{}}),Ie=(n,t)=>{const e=(a,i)=>Object.keys(a).find(d=>d.toLowerCase()===i.toLowerCase()),o=a=>{let i=a;return typeof i=="number"&&(i=i.toString()),i.indexOf(",")>=0&&(i=i.split(",")[0]),i.indexOf(":")>=0&&(i=i.split(":")[0]),i.indexOf("#")>=0&&(i=i.split("#")[1]),i},s=e(n.headers,"x-amzn-errortype");if(s!==void 0)return o(n.headers[s]);if(t&&typeof t=="object"){const a=e(t,"code");if(a&&t[a]!==void 0)return o(t[a]);if(t.__type!==void 0)return o(t.__type)}};class Ce extends r.SerdeContextConfig{settings;constructor(t){super(),this.settings=t}async read(t,e){return this._read(t,typeof e=="string"?JSON.parse(e,ye):await Ee(e,this.serdeContext))}readObject(t,e){return this._read(t,e)}_read(t,e){const o=e!==null&&typeof e=="object",s=r.NormalizedSchema.of(t);if(o){if(s.isStructSchema()){const i=e,d=s.isUnionSchema(),c={};let l;const{jsonName:u}=this.settings;u&&(l={});let h;d&&(h=new r.UnionSerde(i,c));for(const[p,g]of s.structIterator()){let y=p;u&&(y=g.getMergedTraits().jsonName??y,l[y]=p),d&&h.mark(y),i[y]!=null&&(c[p]=this._read(g,i[y]))}if(d)h.writeUnknown();else if(typeof i.__type=="string")for(const[p,g]of Object.entries(i)){const y=u?l[p]??p:p;y in c||(c[y]=g)}return c}if(Array.isArray(e)&&s.isListSchema()){const i=s.getValueSchema(),d=[];for(const c of e)d.push(this._read(i,c));return d}if(s.isMapSchema()){const i=s.getValueSchema(),d={};for(const[c,l]of Object.entries(e))d[c]=this._read(i,l);return d}}if(s.isBlobSchema()&&typeof e=="string")return r.fromBase64(e);const a=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof e=="string"&&a)return a==="application/json"||a.endsWith("+json")?r.LazyJsonString.from(e):e;if(s.isTimestampSchema()&&e!=null)switch(r.determineTimestampFormat(s,this.settings)){case 5:return r.parseRfc3339DateTimeWithOffset(e);case 6:return r.parseRfc7231DateTime(e);case 7:return r.parseEpochTimestamp(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(s.isBigIntegerSchema()&&(typeof e=="number"||typeof e=="string"))return BigInt(e);if(s.isBigDecimalSchema()&&e!=null){if(e instanceof r.NumericValue)return e;const i=e;return i.type==="bigDecimal"&&"string"in i?new r.NumericValue(i.string,i.type):new r.NumericValue(String(e),"bigDecimal")}if(s.isNumericSchema()&&typeof e=="string"){switch(e){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return e}if(s.isDocumentSchema())if(o){const i=Array.isArray(e)?[]:{};for(const[d,c]of Object.entries(e))c instanceof r.NumericValue?i[d]=c:i[d]=this._read(s,c);return i}else return structuredClone(e);return e}}const B="Ν";class we{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(t,e)=>{if(e instanceof r.NumericValue){const o=`${B+"nv"+this.counter++}_`+e.string;return this.values.set(`"${o}"`,e.string),o}if(typeof e=="bigint"){const o=e.toString(),s=`${B+"b"+this.counter++}_`+o;return this.values.set(`"${s}"`,o),s}return e}}replaceInJson(t){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return t;for(const[e,o]of this.values)t=t.replace(e,o);return t}}class xe extends r.SerdeContextConfig{settings;buffer;useReplacer=!1;rootSchema;constructor(t){super(),this.settings=t}write(t,e){this.rootSchema=r.NormalizedSchema.of(t),this.buffer=this._write(this.rootSchema,e)}writeDiscriminatedDocument(t,e){this.write(t,e),typeof this.buffer=="object"&&(this.buffer.__type=r.NormalizedSchema.of(t).getName(!0))}flush(){const{rootSchema:t,useReplacer:e}=this;if(this.rootSchema=void 0,this.useReplacer=!1,t?.isStructSchema()||t?.isDocumentSchema()){if(!e)return JSON.stringify(this.buffer);const o=new we;return o.replaceInJson(JSON.stringify(this.buffer,o.createReplacer(),0))}return this.buffer}_write(t,e,o){const s=e!==null&&typeof e=="object",a=r.NormalizedSchema.of(t);if(s){if(a.isStructSchema()){const i=e,d={},{jsonName:c}=this.settings;let l;c&&(l={});for(const[u,h]of a.structIterator()){const p=this._write(h,i[u],a);if(p!==void 0){let g=u;c&&(g=h.getMergedTraits().jsonName??u,l[u]=g),d[g]=p}}if(a.isUnionSchema()&&Object.keys(d).length===0){const{$unknown:u}=i;if(Array.isArray(u)){const[h,p]=u;d[h]=this._write(15,p)}}else if(typeof i.__type=="string")for(const[u,h]of Object.entries(i)){const p=c?l[u]??u:u;p in d||(d[p]=this._write(15,h))}return d}if(Array.isArray(e)&&a.isListSchema()){const i=a.getValueSchema(),d=[],c=!!a.getMergedTraits().sparse;for(const l of e)(c||l!=null)&&d.push(this._write(i,l));return d}if(a.isMapSchema()){const i=a.getValueSchema(),d={},c=!!a.getMergedTraits().sparse;for(const[l,u]of Object.entries(e))(c||u!=null)&&(d[l]=this._write(i,u));return d}if(e instanceof Uint8Array&&(a.isBlobSchema()||a.isDocumentSchema()))return a===this.rootSchema?e:(this.serdeContext?.base64Encoder??r.toBase64)(e);if(e instanceof Date&&(a.isTimestampSchema()||a.isDocumentSchema()))switch(r.determineTimestampFormat(a,this.settings)){case 5:return e.toISOString().replace(".000Z","Z");case 6:return r.dateToUtcString(e);case 7:return e.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",e),e.getTime()/1e3}e instanceof r.NumericValue&&(this.useReplacer=!0)}if(!(e===null&&o?.isStructSchema())){if(a.isStringSchema()){if(typeof e>"u"&&a.isIdempotencyToken())return r.v4();const i=a.getMergedTraits().mediaType;return e!=null&&i&&(i==="application/json"||i.endsWith("+json"))?r.LazyJsonString.from(e):e}if(typeof e=="number"&&a.isNumericSchema())return Math.abs(e)===1/0||isNaN(e)?String(e):e;if(typeof e=="string"&&a.isBlobSchema())return a===this.rootSchema?e:(this.serdeContext?.base64Encoder??r.toBase64)(e);if(typeof e=="bigint"&&(this.useReplacer=!0),a.isDocumentSchema())if(s){const i=Array.isArray(e)?[]:{};for(const[d,c]of Object.entries(e))c instanceof r.NumericValue?(this.useReplacer=!0,i[d]=c):i[d]=this._write(a,c);return i}else return structuredClone(e);return e}}}class be extends r.SerdeContextConfig{settings;constructor(t){super(),this.settings=t}createSerializer(){const t=new xe(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){const t=new Ce(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Pe extends fe{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,errorTypeRegistries:e,serviceTarget:o,awsQueryCompatible:s,jsonCodec:a}){super({defaultNamespace:t,errorTypeRegistries:e}),this.serviceTarget=o,this.codec=a??new be({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!s,this.mixin=new r.ProtocolLib(this.awsQueryCompatible)}async serializeRequest(t,e,o){const s=await super.serializeRequest(t,e,o);return s.path.endsWith("/")||(s.path+="/"),Object.assign(s.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${t.name}`}),this.awsQueryCompatible&&(s.headers["x-amzn-query-mode"]="true"),(r.deref(t.input)==="unit"||!s.body)&&(s.body="{}"),s}getPayloadCodec(){return this.codec}async handleError(t,e,o,s,a){this.awsQueryCompatible&&this.mixin.setQueryCompatError(s,o);const i=Ie(o,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);const{errorSchema:d,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,o,s,a,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),l=r.NormalizedSchema.of(d),u=s.message??s.Message??"UnknownError",h=this.compositeErrorRegistry.getErrorCtor(d)??Error,p=new h(u),g={};for(const[y,A]of l.structIterator())s[y]!=null&&(g[y]=this.codec.createDeserializer().readObject(A,s[y]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(s,g),this.mixin.decorateServiceException(Object.assign(p,c,{$fault:l.getMergedTraits().error,message:u},g),s)}}class _e extends Pe{constructor({defaultNamespace:t,errorTypeRegistries:e,serviceTarget:o,awsQueryCompatible:s,jsonCodec:a}){super({defaultNamespace:t,errorTypeRegistries:e,serviceTarget:o,awsQueryCompatible:s,jsonCodec:a})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const Re=async(n,t,e)=>({operation:r.getSmithyContext(t).operation,region:await r.normalizeProvider(n.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ae(n){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:n.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}function V(n){return{schemeId:"smithy.api#noAuth"}}const ve=n=>{const t=[];switch(n.operation){case"GetCredentialsForIdentity":{t.push(V());break}case"GetId":{t.push(V());break}default:t.push(Ae(n))}return t},Ne=n=>{const t=r.resolveAwsSdkSigV4Config(n);return Object.assign(t,{authSchemePreference:r.normalizeProvider(n.authSchemePreference??[])})},ke=n=>Object.assign(n,{useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"}),ie={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Te="3.996.19",ze={version:Te},se="required",S="fn",E="argv",N="ref",K=!0,Q="isSet",z="booleanEquals",v="error",C="endpoint",x="tree",D="PartitionResult",O="getAttr",k="stringEquals",W={[se]:!1,type:"string"},X={[se]:!0,default:!1,type:"boolean"},Z={[N]:"Endpoint"},oe={[S]:z,[E]:[{[N]:"UseFIPS"},!0]},ae={[S]:z,[E]:[{[N]:"UseDualStack"},!0]},m={},T={[N]:"Region"},Y={[S]:O,[E]:[{[N]:D},"supportsFIPS"]},ce={[N]:D},ee={[S]:z,[E]:[!0,{[S]:O,[E]:[ce,"supportsDualStack"]}]},te=[oe],re=[ae],ne=[T],De={parameters:{Region:W,UseDualStack:X,UseFIPS:X,Endpoint:W},rules:[{conditions:[{[S]:Q,[E]:[Z]}],rules:[{conditions:te,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:v},{conditions:re,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:v},{endpoint:{url:Z,properties:m,headers:m},type:C}],type:x},{conditions:[{[S]:Q,[E]:ne}],rules:[{conditions:[{[S]:"aws.partition",[E]:ne,assign:D}],rules:[{conditions:[oe,ae],rules:[{conditions:[{[S]:z,[E]:[K,Y]},ee],rules:[{conditions:[{[S]:k,[E]:[T,"us-east-1"]}],endpoint:{url:"https://cognito-identity-fips.us-east-1.amazonaws.com",properties:m,headers:m},type:C},{conditions:[{[S]:k,[E]:[T,"us-east-2"]}],endpoint:{url:"https://cognito-identity-fips.us-east-2.amazonaws.com",properties:m,headers:m},type:C},{conditions:[{[S]:k,[E]:[T,"us-west-1"]}],endpoint:{url:"https://cognito-identity-fips.us-west-1.amazonaws.com",properties:m,headers:m},type:C},{conditions:[{[S]:k,[E]:[T,"us-west-2"]}],endpoint:{url:"https://cognito-identity-fips.us-west-2.amazonaws.com",properties:m,headers:m},type:C},{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:C}],type:x},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:v}],type:x},{conditions:te,rules:[{conditions:[{[S]:z,[E]:[Y,K]}],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:C}],type:x},{error:"FIPS is enabled but this partition does not support FIPS",type:v}],type:x},{conditions:re,rules:[{conditions:[ee],rules:[{conditions:[{[S]:k,[E]:["aws",{[S]:O,[E]:[ce,"name"]}]}],endpoint:{url:"https://cognito-identity.{Region}.amazonaws.com",properties:m,headers:m},type:C},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:C}],type:x},{error:"DualStack is enabled but this partition does not support DualStack",type:v}],type:x},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:C}],type:x}],type:x},{error:"Invalid Configuration: Missing Region",type:v}]},Oe=De,Fe=new r.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Me=(n,t={})=>Fe.get(n,()=>r.resolveEndpoint(Oe,{endpointParams:n,logger:t.logger}));r.customEndpointFunctions.aws=r.awsEndpointFunctions;class I extends r.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,I.prototype)}}class F extends I{name="ExternalServiceException";$fault="client";constructor(t){super({name:"ExternalServiceException",$fault:"client",...t}),Object.setPrototypeOf(this,F.prototype)}}class M extends I{name="InternalErrorException";$fault="server";constructor(t){super({name:"InternalErrorException",$fault:"server",...t}),Object.setPrototypeOf(this,M.prototype)}}class $ extends I{name="InvalidIdentityPoolConfigurationException";$fault="client";constructor(t){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,$.prototype)}}class j extends I{name="InvalidParameterException";$fault="client";constructor(t){super({name:"InvalidParameterException",$fault:"client",...t}),Object.setPrototypeOf(this,j.prototype)}}class U extends I{name="NotAuthorizedException";$fault="client";constructor(t){super({name:"NotAuthorizedException",$fault:"client",...t}),Object.setPrototypeOf(this,U.prototype)}}class L extends I{name="ResourceConflictException";$fault="client";constructor(t){super({name:"ResourceConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,L.prototype)}}class G extends I{name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,G.prototype)}}class H extends I{name="TooManyRequestsException";$fault="client";constructor(t){super({name:"TooManyRequestsException",$fault:"client",...t}),Object.setPrototypeOf(this,H.prototype)}}class J extends I{name="LimitExceededException";$fault="client";constructor(t){super({name:"LimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,J.prototype)}}const $e="AccountId",je="AccessKeyId",de="Credentials",Ue="CustomRoleArn",Le="Expiration",Ge="ExternalServiceException",He="GetCredentialsForIdentity",Je="GetCredentialsForIdentityInput",qe="GetCredentialsForIdentityResponse",Be="GetId",Ve="GetIdInput",Ke="GetIdResponse",Qe="InternalErrorException",q="IdentityId",We="InvalidIdentityPoolConfigurationException",Xe="InvalidParameterException",Ze="IdentityPoolId",Ye="IdentityProviderToken",ue="Logins",et="LimitExceededException",tt="LoginsMap",rt="NotAuthorizedException",nt="ResourceConflictException",it="ResourceNotFoundException",st="SecretKey",ot="SecretKeyString",at="SessionToken",ct="TooManyRequestsException",_="client",b="error",R="httpError",P="message",pe="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity",dt="server",f="com.amazonaws.cognitoidentity",le=r.TypeRegistry.for(pe);var ut=[-3,pe,"CognitoIdentityServiceException",0,[],[]];le.registerError(ut,I);const w=r.TypeRegistry.for(f);var pt=[-3,f,Ge,{[b]:_,[R]:400},[P],[0]];w.registerError(pt,F);var lt=[-3,f,Qe,{[b]:dt},[P],[0]];w.registerError(lt,M);var ht=[-3,f,We,{[b]:_,[R]:400},[P],[0]];w.registerError(ht,$);var mt=[-3,f,Xe,{[b]:_,[R]:400},[P],[0]];w.registerError(mt,j);var ft=[-3,f,et,{[b]:_,[R]:400},[P],[0]];w.registerError(ft,J);var gt=[-3,f,rt,{[b]:_,[R]:403},[P],[0]];w.registerError(gt,U);var yt=[-3,f,nt,{[b]:_,[R]:409},[P],[0]];w.registerError(yt,L);var St=[-3,f,it,{[b]:_,[R]:404},[P],[0]];w.registerError(St,G);var Et=[-3,f,ct,{[b]:_,[R]:429},[P],[0]];w.registerError(Et,H);const It=[le,w];var Ct=[0,f,Ye,8,0],wt=[0,f,ot,8,0],xt=[3,f,de,0,[je,st,at,Le],[0,[()=>wt,0],0,4]],bt=[3,f,Je,0,[q,ue,Ue],[0,[()=>he,0],0],1],Pt=[3,f,qe,0,[q,de],[0,[()=>xt,0]]],_t=[3,f,Ve,0,[Ze,$e,ue],[0,0,[()=>he,0]],1],Rt=[3,f,Ke,0,[q],[0]],he=[2,f,tt,0,[0,0],[()=>Ct,0]],At=[9,f,He,0,()=>bt,()=>Pt],vt=[9,f,Be,0,()=>_t,()=>Rt];const Nt=n=>({apiVersion:"2014-06-30",base64Decoder:n?.base64Decoder??r.fromBase64,base64Encoder:n?.base64Encoder??r.toBase64,disableHostPrefix:n?.disableHostPrefix??!1,endpointProvider:n?.endpointProvider??Me,extensions:n?.extensions??[],httpAuthSchemeProvider:n?.httpAuthSchemeProvider??ve,httpAuthSchemes:n?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new r.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ge}],logger:n?.logger??new r.NoOpLogger,protocol:n?.protocol??_e,protocolSettings:n?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentity",errorTypeRegistries:It,xmlNamespace:"http://cognito-identity.amazonaws.com/doc/2014-06-30/",version:"2014-06-30",serviceTarget:"AWSCognitoIdentityService"},serviceId:n?.serviceId??"Cognito Identity",urlParser:n?.urlParser??r.parseUrl,utf8Decoder:n?.utf8Decoder??r.fromUtf8,utf8Encoder:n?.utf8Encoder??r.toUtf8}),kt=n=>{const t=r.resolveDefaultsModeConfig(n),e=()=>t().then(r.loadConfigsForDefaultMode),o=Nt(n);return{...o,...n,runtime:"browser",defaultsMode:t,bodyLengthChecker:n?.bodyLengthChecker??r.calculateBodyLength,defaultUserAgentProvider:n?.defaultUserAgentProvider??r.createDefaultUserAgentProvider({serviceId:o.serviceId,clientVersion:ze.version}),maxAttempts:n?.maxAttempts??r.DEFAULT_MAX_ATTEMPTS,region:n?.region??r.invalidProvider("Region is missing"),requestHandler:r.FetchHttpHandler.create(n?.requestHandler??e),retryMode:n?.retryMode??(async()=>(await e()).retryMode||r.DEFAULT_RETRY_MODE),sha256:n?.sha256??r.Sha256,streamCollector:n?.streamCollector??r.streamCollector,useDualstackEndpoint:n?.useDualstackEndpoint??(()=>Promise.resolve(r.DEFAULT_USE_DUALSTACK_ENDPOINT)),useFipsEndpoint:n?.useFipsEndpoint??(()=>Promise.resolve(r.DEFAULT_USE_FIPS_ENDPOINT))}},Tt=n=>{const t=n.httpAuthSchemes;let e=n.httpAuthSchemeProvider,o=n.credentials;return{setHttpAuthScheme(s){const a=t.findIndex(i=>i.schemeId===s.schemeId);a===-1?t.push(s):t.splice(a,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){e=s},httpAuthSchemeProvider(){return e},setCredentials(s){o=s},credentials(){return o}}},zt=n=>({httpAuthSchemes:n.httpAuthSchemes(),httpAuthSchemeProvider:n.httpAuthSchemeProvider(),credentials:n.credentials()}),Dt=(n,t)=>{const e=Object.assign(r.getAwsRegionExtensionConfiguration(n),r.getDefaultExtensionConfiguration(n),r.getHttpHandlerExtensionConfiguration(n),Tt(n));return t.forEach(o=>o.configure(e)),Object.assign(n,r.resolveAwsRegionExtensionConfiguration(e),r.resolveDefaultRuntimeConfig(e),r.resolveHttpHandlerRuntimeConfig(e),zt(e))};class Ot extends r.Client{config;constructor(...[t]){const e=kt(t||{});super(e),this.initConfig=e;const o=ke(e),s=r.resolveUserAgentConfig(o),a=r.resolveRetryConfig(s),i=r.resolveRegionConfig(a),d=r.resolveHostHeaderConfig(i),c=r.resolveEndpointConfig(d),l=Ne(c),u=Dt(l,t?.extensions||[]);this.config=u,this.middlewareStack.use(r.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(r.getUserAgentPlugin(this.config)),this.middlewareStack.use(r.getRetryPlugin(this.config)),this.middlewareStack.use(r.getContentLengthPlugin(this.config)),this.middlewareStack.use(r.getHostHeaderPlugin(this.config)),this.middlewareStack.use(r.getLoggerPlugin(this.config)),this.middlewareStack.use(r.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(r.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Re,identityProviderConfigProvider:async h=>new r.DefaultIdentityProviderConfig({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(r.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class Ft extends r.Command.classBuilder().ep(ie).m(function(t,e,o,s){return[r.getEndpointPlugin(o,t.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").sc(At).build(){}class Mt extends r.Command.classBuilder().ep(ie).m(function(t,e,o,s){return[r.getEndpointPlugin(o,t.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").sc(vt).build(){}exports.CognitoIdentityClient=Ot;exports.GetCredentialsForIdentityCommand=Ft;exports.GetIdCommand=Mt;