@thunderclient/cli 1.27.1 → 1.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/827.index.js +1 -1
- package/dist/905.index.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/.claude/settings.local.json +0 -8
package/dist/827.index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";exports.id=827,exports.ids=[827],exports.modules={852(t,e,n){n.d(e,{getDefaultRoleAssumer:()=>Ei,getDefaultRoleAssumerWithWebIdentity:()=>yi});var i=n(80),r=n(93),s=n(55);const o={silence:!1};var a=n(133),c=n(134);const u={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var l=n(116),d=n(119);class f extends d.T{constructor(t){super(t),Object.setPrototypeOf(this,f.prototype)}}class h extends f{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,h.prototype)}}class p extends f{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,p.prototype)}}class m extends f{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t}),Object.setPrototypeOf(this,m.prototype)}}class g extends f{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,g.prototype)}}class w extends f{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t}),Object.setPrototypeOf(this,w.prototype)}}class E extends f{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,E.prototype)}}class y extends f{name="IDPCommunicationErrorException";$fault="client";constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t}),Object.setPrototypeOf(this,y.prototype)}}const x="AssumedRoleUser",v="Credentials",b="DurationSeconds",S="Policy",I="PolicyArns",T="PackedPolicySize",A="RoleArn",$="RoleSessionName",P="SourceIdentity",N="awsQueryError",D="client",R="error",C="httpError",k="message",O="smithy.ts.sdk.synthetic.com.amazonaws.sts",F="com.amazonaws.sts",j=l.O.for(O);var M=[-3,O,"STSServiceException",0,[],[]];j.registerError(M,f);const _=l.O.for(F);var U=[-3,F,"ExpiredTokenException",{[N]:["ExpiredTokenException",400],[R]:D,[C]:400},[k],[0]];_.registerError(U,h);var L=[-3,F,"IDPCommunicationErrorException",{[N]:["IDPCommunicationError",400],[R]:D,[C]:400},[k],[0]];_.registerError(L,y);var z=[-3,F,"IDPRejectedClaimException",{[N]:["IDPRejectedClaim",403],[R]:D,[C]:403},[k],[0]];_.registerError(z,w);var W=[-3,F,"InvalidIdentityTokenException",{[N]:["InvalidIdentityToken",400],[R]:D,[C]:400},[k],[0]];_.registerError(W,E);var V=[-3,F,"MalformedPolicyDocumentException",{[N]:["MalformedPolicyDocument",400],[R]:D,[C]:400},[k],[0]];_.registerError(V,p);var q=[-3,F,"PackedPolicyTooLargeException",{[N]:["PackedPolicyTooLarge",400],[R]:D,[C]:400},[k],[0]];_.registerError(q,m);var K=[-3,F,"RegionDisabledException",{[N]:["RegionDisabledException",403],[R]:D,[C]:403},[k],[0]];_.registerError(K,g);const Y=[j,_];var B=[0,F,"accessKeySecretType",8,0],G=[0,F,"clientTokenType",8,0],Q=[3,F,x,0,["AssumedRoleId","Arn"],[0,0],2],X=[3,F,"AssumeRoleRequest",0,[A,$,I,S,b,"Tags","TransitiveTagKeys","ExternalId","SerialNumber","TokenCode",P,"ProvidedContexts"],[0,0,()=>rt,0,1,()=>ot,64,0,0,0,0,()=>st],2],H=[3,F,"AssumeRoleResponse",0,[v,x,T,P],[[()=>tt,0],()=>Q,1,0]],J=[3,F,"AssumeRoleWithWebIdentityRequest",0,[A,$,"WebIdentityToken","ProviderId",I,S,b],[0,0,[()=>G,0],0,()=>rt,0,1],3],Z=[3,F,"AssumeRoleWithWebIdentityResponse",0,[v,"SubjectFromWebIdentityToken",x,T,"Provider","Audience",P],[[()=>tt,0],0,()=>Q,1,0,0,0]],tt=[3,F,v,0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[0,[()=>B,0],0,4],4],et=[3,F,"PolicyDescriptorType",0,["arn"],[0]],nt=[3,F,"ProvidedContext",0,["ProviderArn","ContextAssertion"],[0,0]],it=[3,F,"Tag",0,["Key","Value"],[0,0],2],rt=[1,F,"policyDescriptorListType",0,()=>et],st=[1,F,"ProvidedContextsListType",0,()=>nt],ot=[1,F,"tagListType",0,()=>it],at=[9,F,"AssumeRole",0,()=>X,()=>H],ct=[9,F,"AssumeRoleWithWebIdentity",0,()=>J,()=>Z];class ut extends(c.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,a.r)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc(at).build()){}class lt extends(c.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,a.r)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(ct).build()){}const dt=t=>{if("string"==typeof t?.Arn){const e=t.Arn.split(":");if(e.length>4&&""!==e[4])return e[4]}},ft=async(t,e,n,i={})=>{const a="function"==typeof t?await t():t,c="function"==typeof e?await e():e;let u="";const l=a??c??(u=await function(t={}){return(0,s.Z)({...r.GG,default:async()=>(o.silence||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1")},{...r.zH,...t})}(i)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${a} (credential provider clientConfig)`,`${c} (contextual client)`,`${u} (STS default: AWS_REGION, profile region, or us-east-1)`),l},ht=(t,e)=>{let n,r;return async(s,o)=>{if(r=s,!n){const{logger:i=t?.parentClientConfig?.logger,profile:s=t?.parentClientConfig?.profile,region:o,requestHandler:a=t?.parentClientConfig?.requestHandler,credentialProviderLogger:c,userAgentAppId:u=t?.parentClientConfig?.userAgentAppId}=t,l=await ft(o,t?.parentClientConfig?.region,c,{logger:i,profile:s}),d=!mt(a);n=new e({...t,userAgentAppId:u,profile:s,credentialDefaultProvider:()=>async()=>r,region:l,requestHandler:d?a:void 0,logger:i})}const{Credentials:a,AssumedRoleUser:c}=await n.send(new ut(o));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);const u=dt(c),l={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...u&&{accountId:u}};return(0,i.g)(l,"CREDENTIALS_STS_ASSUME_ROLE","i"),l}},pt=(t,e)=>{let n;return async r=>{if(!n){const{logger:i=t?.parentClientConfig?.logger,profile:r=t?.parentClientConfig?.profile,region:s,requestHandler:o=t?.parentClientConfig?.requestHandler,credentialProviderLogger:a,userAgentAppId:c=t?.parentClientConfig?.userAgentAppId}=t,u=await ft(s,t?.parentClientConfig?.region,a,{logger:i,profile:r}),l=!mt(o);n=new e({...t,userAgentAppId:c,profile:r,region:u,requestHandler:l?o:void 0,logger:i})}const{Credentials:s,AssumedRoleUser:o}=await n.send(new lt(r));if(!s||!s.AccessKeyId||!s.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);const a=dt(o),c={accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.SessionToken,expiration:s.Expiration,...s.CredentialScope&&{credentialScope:s.CredentialScope},...a&&{accountId:a}};return a&&(0,i.g)(c,"RESOLVED_ACCOUNT_ID","T"),(0,i.g)(c,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),c}},mt=t=>"h2"===t?.metadata?.handlerProtocol;var gt=n(32),wt=n(34),Et=n(35),yt=n(36),xt=n(38),vt=n(43),bt=n(45),St=n(44),It=n(48),Tt=n(49),At=n(51),$t=n(52),Pt=n(70),Nt=n(74),Dt=n(77),Rt=n(79),Ct=n(46),kt=n(53);const Ot=async(t,e,n)=>({operation:(0,Ct.u)(e).operation,region:await(0,kt.t)(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const Ft=t=>{const e=[];if("AssumeRoleWithWebIdentity"===t.operation)e.push({schemeId:"smithy.api#noAuth"});else e.push(function(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}(t));return e},jt=t=>{const e=(n=t,Object.assign(n,{stsClientCtor:gi}));var n;const i=(0,Rt.h)(e);return Object.assign(i,{authSchemePreference:(0,kt.t)(t.authSchemePreference??[])})};var Mt=n(845),_t=n(87),Ut=n(88),Lt=n(106),zt=n(90),Wt=n(92),Vt=n(94),qt=n(97),Kt=n(850),Yt=n(98),Bt=n(99),Gt=n(100),Qt=n(102),Xt=n(101),Ht=n(103),Jt=n(105),Zt=n(71),te=n(107),ee=n(111),ne=n(109),ie=n(108),re=n(118);const se={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1};function oe(t){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,allowedTags:null,tagFilter:null}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:t.maxEntitySize??1e4,maxExpansionDepth:t.maxExpansionDepth??10,maxTotalExpansions:t.maxTotalExpansions??1e3,maxExpandedLength:t.maxExpandedLength??1e5,allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:oe(!0)}const ae=function(t){const e=Object.assign({},se,t);return e.processEntities=oe(e.processEntities),e},ce=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ue=new RegExp("^"+("["+ce+"]["+(ce+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*")+"$");function le(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n}const de=function(t){const e=ue.exec(t);return!(null==e)};let fe;fe="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class he{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][fe]={startIndex:e})}static getMetaDataSymbol(){return fe}}class pe{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,r=!1,s=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?r=!0:o+=t[e];else{if(r&&ge(t,"!ENTITY",e)){let i,r;if(e+=7,[i,r,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===r.indexOf("&")){const t=i.replace(/[.\-+*:]/g,"\\.");n[i]={regx:RegExp(`&${t};`,"g"),val:r}}}else if(r&&ge(t,"!ELEMENT",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(r&&ge(t,"!ATTLIST",e))e+=8;else if(r&&ge(t,"!NOTATION",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!ge(t,"!--",e))throw new Error("Invalid DOCTYPE");s=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}readEntityExp(t,e){e=me(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)n+=t[e],e++;if(we(n),e=me(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}let i="";if([e,i]=this.readIdentifierVal(t,e,"entity"),!1!==this.options.enabled&&this.options.maxEntitySize&&i.length>this.options.maxEntitySize)throw new Error(`Entity "${n}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[n,i,--e]}readNotationExp(t,e){e=me(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;!this.suppressValidationErr&&we(n),e=me(t,e);const i=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==i&&"PUBLIC"!==i)throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);e+=i.length,e=me(t,e);let r=null,s=null;if("PUBLIC"===i)[e,r]=this.readIdentifierVal(t,e,"publicIdentifier"),'"'!==t[e=me(t,e)]&&"'"!==t[e]||([e,s]=this.readIdentifierVal(t,e,"systemIdentifier"));else if("SYSTEM"===i&&([e,s]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!s))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:r,systemIdentifier:s,index:--e}}readIdentifierVal(t,e,n){let i="";const r=t[e];if('"'!==r&&"'"!==r)throw new Error(`Expected quoted string, found "${r}"`);for(e++;e<t.length&&t[e]!==r;)i+=t[e],e++;if(t[e]!==r)throw new Error(`Unterminated ${n} value`);return[++e,i]}readElementExp(t,e){e=me(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!this.suppressValidationErr&&!de(n))throw new Error(`Invalid element name: "${n}"`);let i="";if("E"===t[e=me(t,e)]&&ge(t,"MPTY",e))e+=4;else if("A"===t[e]&&ge(t,"NY",e))e+=2;else if("("===t[e]){for(e++;e<t.length&&")"!==t[e];)i+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:n,contentModel:i.trim(),index:e}}readAttlistExp(t,e){e=me(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;we(n),e=me(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;if(!we(i))throw new Error(`Invalid attribute name: "${i}"`);e=me(t,e);let r="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(r="NOTATION","("!==t[e=me(t,e+=8)])throw new Error(`Expected '(', found "${t[e]}"`);e++;let n=[];for(;e<t.length&&")"!==t[e];){let i="";for(;e<t.length&&"|"!==t[e]&&")"!==t[e];)i+=t[e],e++;if(i=i.trim(),!we(i))throw new Error(`Invalid notation name: "${i}"`);n.push(i),"|"===t[e]&&(e++,e=me(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,r+=" ("+n.join("|")+")"}else{for(;e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;const n=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!n.includes(r.toUpperCase()))throw new Error(`Invalid attribute type: "${r}"`)}e=me(t,e);let s="";return"#REQUIRED"===t.substring(e,e+8).toUpperCase()?(s="#REQUIRED",e+=8):"#IMPLIED"===t.substring(e,e+7).toUpperCase()?(s="#IMPLIED",e+=7):[e,s]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:n,attributeName:i,attributeType:r,defaultValue:s,index:e}}}const me=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function ge(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function we(t){if(de(t))return t;throw new Error(`Invalid entity name ${t}`)}const Ee=/^[-+]?0x[a-fA-F0-9]+$/,ye=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,xe={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function ve(t,e={}){if(e=Object.assign({},xe,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===t)return 0;if(e.hex&&Ee.test(n))return function(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n,16);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(be);if(i){let r=i[1]||"";const s=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=r?t[o.length+1]===s:t[o.length]===s;return o.length>1&&a?t:1!==o.length||!i[3].startsWith(`.${s}`)&&i[3][0]!==s?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const i=ye.exec(n);if(i){const r=i[1]||"",s=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),t;return t}(i[3]);const a=r?"."===t[s.length+1]:"."===t[s.length];if(!e.leadingZeros&&(s.length>1||1===s.length&&!a))return t;{const i=Number(n),a=String(i);if(0===i)return i;if(-1!==a.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===a||a===o||a===`${r}${o}`?i:t;let c=s?o:n;return s?c===a||r+c===a?i:t:c===a||c===r+a?i:t}}return t}}return function(t,e,n){const i=e===1/0;switch(n.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return t}}(t,Number(n),e)}const be=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;class Se{constructor(t){var e;if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>_e(e,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>_e(e,16,"&#x")}},this.addExternalEntities=Ie,this.parseXml=Ne,this.parseTextData=Te,this.resolveNameSpace=Ae,this.buildAttributesMap=Pe,this.isItStopNode=ke,this.replaceEntitiesValue=Re,this.readStopNodeData=je,this.saveTextToParentTag=Ce,this.addChild=De,this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e&&(e.startsWith("*.")?this.stopNodesWildcard.add(e.substring(2)):this.stopNodesExact.add(e))}}}}function Ie(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n],r=i.replace(/[.\-+*:]/g,"\\.");this.lastEntities[i]={regex:new RegExp("&"+r+";","g"),val:t[i]}}}function Te(t,e,n,i,r,s,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=this.options.tagValueProcessor(e,t,n,r,s);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return Me(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?Me(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function Ae(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const $e=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Pe(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const i=le(t,$e),r=i.length,s={};for(let t=0;t<r;t++){const r=this.resolveNameSpace(i[t][1]);if(this.ignoreAttributesFn(r,e))continue;let o=i[t][4],a=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(a=this.options.transformAttributeName(a)),"__proto__"===a&&(a="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o,n,e);const t=this.options.attributeValueProcessor(r,o,e);s[a]=null==t?o:typeof t!=typeof o||t!==o?t:Me(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[a]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=s,t}return s}}const Ne=function(t){t=t.replace(/\r\n?/g,"\n");const e=new he("!xml");let n=e,i="",r="";this.entityExpansionCount=0,this.currentExpandedLength=0;const s=new pe(this.options.processEntities);for(let o=0;o<t.length;o++){if("<"===t[o])if("/"===t[o+1]){const e=Oe(t,">",o,"Closing Tag is not closed.");let s=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=s.indexOf(":");-1!==t&&(s=s.substr(t+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(i=this.saveTextToParentTag(i,n,r));const a=r.substring(r.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let c=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(c=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=r.lastIndexOf("."),r=r.substring(0,c),n=this.tagsNodeStack.pop(),i="",o=e}else if("?"===t[o+1]){let e=Fe(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new he(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(n,t,r,o)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=Oe(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const s=t.substring(o+4,e-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}o=e}else if("!D"===t.substr(o+1,2)){const e=s.readDocType(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=Oe(t,"]]>",o,"CDATA is not closed.")-2,s=t.substring(o+9,e);i=this.saveTextToParentTag(i,n,r);let a=this.parseTextData(s,n.tagname,r,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]):n.add(this.options.textNodeName,a),o=e+2}else{let s=Fe(t,o,this.options.removeNSPrefix),a=s.tagName;const c=s.rawTagName;let u=s.tagExp,l=s.attrExpPresent,d=s.closeIndex;if(this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const f=n;f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a);const h=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,r,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),u=a):u=u.substr(0,u.length-1),o=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=s.closeIndex;else{const n=this.readStopNodeData(t,c,d+1);if(!n)throw new Error(`Unexpected end of ${c}`);o=n.i,e=n.tagContent}const i=new he(a);a!==u&&l&&(i[":@"]=this.buildAttributesMap(u,r,a)),e&&(e=this.parseTextData(e,a,r,!0,l,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,r,h)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){if("/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}const t=new he(a);a!==u&&l&&(t[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(n,t,r,h),r=r.substr(0,r.lastIndexOf("."))}else{const t=new he(a);this.tagsNodeStack.push(n),a!==u&&l&&(t[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(n,t,r,h),n=t}i="",o=d}}else i+=t[o]}return e.child};function De(t,e,n,i){this.options.captureMetaData||(i=void 0);const r=this.options.updateTag(e.tagname,n,e[":@"]);!1===r||("string"==typeof r?(e.tagname=r,t.addChild(e,i)):t.addChild(e,i))}const Re=function(t,e,n){if(-1===t.indexOf("&"))return t;const i=this.options.processEntities;if(!i.enabled)return t;if(i.allowedTags&&!i.allowedTags.includes(e))return t;if(i.tagFilter&&!i.tagFilter(e,n))return t;for(let e in this.docTypeEntities){const n=this.docTypeEntities[e],r=t.match(n.regx);if(r){if(this.entityExpansionCount+=r.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);const e=t.length;if(t=t.replace(n.regx,n.val),i.maxExpandedLength&&(this.currentExpandedLength+=t.length-e,this.currentExpandedLength>i.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${i.maxExpandedLength}`)}}if(-1===t.indexOf("&"))return t;for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(-1===t.indexOf("&"))return t;if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}return t=t.replace(this.ampEntity.regex,this.ampEntity.val)};function Ce(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function ke(t,e,n,i){return!(!e||!e.has(i))||!(!t||!t.has(n))}function Oe(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function Fe(t,e,n,i=">"){const r=function(t,e,n=">"){let i,r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,i);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let c=s,u=!0;-1!==a&&(c=s.substring(0,a),s=s.substring(a+1).trimStart());const l=c;if(n){const t=c.indexOf(":");-1!==t&&(c=c.substr(t+1),u=c!==r.data.substr(t+1))}return{tagName:c,tagExp:s,closeIndex:o,attrExpPresent:u,rawTagName:l}}function je(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const s=Oe(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:s};n=s}else if("?"===t[n+1]){n=Oe(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=Oe(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=Oe(t,"]]>",n,"StopNode is not closed.")-2}else{const i=Fe(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function Me(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&ve(t,n)}return function(t){return void 0!==t}(t)?t:""}function _e(t,e,n){const i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):n+t+";"}const Ue=he.getMetaDataSymbol();function Le(t,e){return ze(t,e)}function ze(t,e,n){let i;const r={};for(let s=0;s<t.length;s++){const o=t[s],a=We(o);let c="";if(c=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=ze(o[a],e,c);const n=qe(t,e);void 0!==o[Ue]&&(t[Ue]=o[Ue]),o[":@"]?Ve(t,o[":@"],c,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,c,n)?r[a]=[t]:r[a]=t}}}return"string"==typeof i?i.length>0&&(r[e.textNodeName]=i):void 0!==i&&(r[e.textNodeName]=i),r}function We(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Ve(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o];i.isArray(s,n+"."+s,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function qe(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}const Ke={allowBooleanAttributes:!1,unpairedTags:[]};function Ye(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function Be(t,e){const n=e;for(;e<t.length;e++)if("?"==t[e]||" "==t[e]){const i=t.substr(n,e-n);if(e>5&&"xml"===i)return Ze("InvalidXml","XML declaration allowed only at the start of the document.",nn(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function Ge(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function Qe(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if('"'===t[e]||"'"===t[e])""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const Xe=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function He(t,e){const n=le(t,Xe),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return Ze("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",rn(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return Ze("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",rn(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return Ze("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",rn(n[t]));const r=n[t][2];if(!tn(r))return Ze("InvalidAttr","Attribute '"+r+"' is an invalid name.",rn(n[t]));if(i.hasOwnProperty(r))return Ze("InvalidAttr","Attribute '"+r+"' is repeated.",rn(n[t]));i[r]=1}return!0}function Je(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function Ze(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function tn(t){return de(t)}function en(t){return de(t)}function nn(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function rn(t){return t.startIndex+t[1].length}const sn=new class{constructor(t){this.externalEntities={},this.options=ae(t)}parse(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});const n=function(t,e){e=Object.assign({},Ke,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let s=0;s<t.length;s++)if("<"===t[s]&&"?"===t[s+1]){if(s+=2,s=Be(t,s),s.err)return s}else{if("<"!==t[s]){if(Ye(t[s]))continue;return Ze("InvalidChar","char '"+t[s]+"' is not expected.",nn(t,s))}{let o=s;if(s++,"!"===t[s]){s=Ge(t,s);continue}{let a=!1;"/"===t[s]&&(a=!0,s++);let c="";for(;s<t.length&&">"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)c+=t[s];if(c=c.trim(),"/"===c[c.length-1]&&(c=c.substring(0,c.length-1),s--),!en(c)){let e;return e=0===c.trim().length?"Invalid space after '<'.":"Tag '"+c+"' is an invalid name.",Ze("InvalidTag",e,nn(t,s))}const u=Qe(t,s);if(!1===u)return Ze("InvalidAttr","Attributes for '"+c+"' have open quote.",nn(t,s));let l=u.value;if(s=u.index,"/"===l[l.length-1]){const n=s-l.length;l=l.substring(0,l.length-1);const r=He(l,e);if(!0!==r)return Ze(r.err.code,r.err.msg,nn(t,n+r.err.line));i=!0}else if(a){if(!u.tagClosed)return Ze("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",nn(t,s));if(l.trim().length>0)return Ze("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",nn(t,o));if(0===n.length)return Ze("InvalidTag","Closing tag '"+c+"' has not been opened.",nn(t,o));{const e=n.pop();if(c!==e.tagName){let n=nn(t,e.tagStartPos);return Ze("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+c+"'.",nn(t,o))}0==n.length&&(r=!0)}}else{const a=He(l,e);if(!0!==a)return Ze(a.err.code,a.err.msg,nn(t,s-l.length+a.err.line));if(!0===r)return Ze("InvalidXml","Multiple possible root nodes found.",nn(t,s));-1!==e.unpairedTags.indexOf(c)||n.push({tagName:c,tagStartPos:o}),i=!0}for(s++;s<t.length;s++)if("<"===t[s]){if("!"===t[s+1]){s++,s=Ge(t,s);continue}if("?"!==t[s+1])break;if(s=Be(t,++s),s.err)return s}else if("&"===t[s]){const e=Je(t,s);if(-1==e)return Ze("InvalidChar","char '&' is not expected.",nn(t,s));s=e}else if(!0===r&&!Ye(t[s]))return Ze("InvalidXml","Extra text at the end",nn(t,s));"<"===t[s]&&s--}}}return i?1==n.length?Ze("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",nn(t,n[0].tagStartPos)):!(n.length>0)||Ze("InvalidXml","Invalid '"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ze("InvalidXml","Start tag expected.",1)}(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Se(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:Le(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return he.getMetaDataSymbol()}}({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(t,e)=>""===e.trim()&&e.includes("\n")?"":void 0});sn.addEntity("#xD","\r"),sn.addEntity("#10","\n");var on=n(849);const an=t=>{const e="#text";for(const n in t)t.hasOwnProperty(n)&&void 0!==t[n][e]?t[n]=t[n][e]:"object"==typeof t[n]&&null!==t[n]&&(t[n]=an(t[n]));return t};var cn=n(114),un=n(121),ln=n(126);class dn extends un.B{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new on.k(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,e,n){const i=ie.l.of(t),r=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(r).find(t=>!!t.getMemberTraits().eventPayload)){const t={},n=Object.keys(r)[0];return r[n].isBlobSchema()?t[n]=e:t[n]=this.read(r[n],e),t}const s=(this.serdeContext?.utf8Encoder??cn.P)(e),o=this.parseXml(s);return this.readSchema(t,n?o[n]:o)}readSchema(t,e){const n=ie.l.of(t);if(n.isUnitSchema())return;const i=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(e))return this.readSchema(n,[e]);if(null==e)return e;if("object"==typeof e){const t=!!i.sparse,r=!!i.xmlFlattened;if(n.isListSchema()){const i=n.getValueSchema(),s=[],o=i.getMergedTraits().xmlName??"member",a=r?e:(e[0]??e)[o],c=Array.isArray(a)?a:[a];for(const e of c)(null!=e||t)&&s.push(this.readSchema(i,e));return s}const s={};if(n.isMapSchema()){const i=n.getKeySchema(),o=n.getValueSchema();let a;a=r?Array.isArray(e)?e:[e]:Array.isArray(e.entry)?e.entry:[e.entry];const c=i.getMergedTraits().xmlName??"key",u=o.getMergedTraits().xmlName??"value";for(const e of a){const n=e[c],i=e[u];(null!=i||t)&&(s[n]=this.readSchema(o,i))}return s}if(n.isStructSchema()){const t=n.isUnionSchema();let i;t&&(i=new ln.F(e,s));for(const[r,o]of n.structIterator()){const n=o.getMergedTraits(),a=n.httpPayload?n.xmlName??o.getName():o.getMemberTraits().xmlName??r;t&&i.mark(a),null!=e[a]&&(s[r]=this.readSchema(o,e[a]))}return t&&i.writeUnknown(),s}if(n.isDocumentSchema())return e;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,e)}parseXml(t){if(t.length){let n;try{e=t,n=sn.parse(e,!0)}catch(e){throw e&&"object"==typeof e&&Object.defineProperty(e,"$responseBodyText",{value:t}),e}const i="#text",r=Object.keys(n)[0],s=n[r];return s[i]&&(s[r]=s[i],delete s[i]),an(s)}var e;return{}}}var fn=n(122),hn=n(848),pn=n(76),mn=n(125),gn=n(123),wn=n(113);class En extends un.B{settings;buffer;constructor(t){super(),this.settings=t}write(t,e,n=""){void 0===this.buffer&&(this.buffer="");const i=ie.l.of(t);if(n&&!n.endsWith(".")&&(n+="."),i.isBlobSchema())("string"==typeof e||e instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??wn.n)(e)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())null!=e?(this.writeKey(n),this.writeValue(String(e))):i.isIdempotencyToken()&&(this.writeKey(n),this.writeValue((0,pn.v4)()));else if(i.isBigIntegerSchema())null!=e&&(this.writeKey(n),this.writeValue(String(e)));else if(i.isBigDecimalSchema())null!=e&&(this.writeKey(n),this.writeValue(e instanceof mn.D?e.string:String(e)));else if(i.isTimestampSchema()){if(e instanceof Date){this.writeKey(n);switch((0,fn.V)(i,this.settings)){case 5:this.writeValue(e.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue((0,gn.JV)(e));break;case 7:this.writeValue(String(e.getTime()/1e3))}}}else if(i.isDocumentSchema())Array.isArray(e)?this.write(79,e,n):e instanceof Date?this.write(4,e,n):e instanceof Uint8Array?this.write(21,e,n):e&&"object"==typeof e?this.write(143,e,n):(this.writeKey(n),this.writeValue(String(e)));else if(i.isListSchema()){if(Array.isArray(e))if(0===e.length)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(""));else{const t=i.getValueSchema(),r=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let s=1;for(const i of e){if(null==i)continue;const e=t.getMergedTraits(),o=this.getKey("member",e.xmlName,e.ec2QueryName),a=r?`${n}${s}`:`${n}${o}.${s}`;this.write(t,i,a),++s}}}else if(i.isMapSchema()){if(e&&"object"==typeof e){const t=i.getKeySchema(),r=i.getValueSchema(),s=i.getMergedTraits().xmlFlattened;let o=1;for(const[i,a]of Object.entries(e)){if(null==a)continue;const e=t.getMergedTraits(),c=this.getKey("key",e.xmlName,e.ec2QueryName),u=s?`${n}${o}.${c}`:`${n}entry.${o}.${c}`,l=r.getMergedTraits(),d=this.getKey("value",l.xmlName,l.ec2QueryName),f=s?`${n}${o}.${d}`:`${n}entry.${o}.${d}`;this.write(t,i,u),this.write(r,a,f),++o}}}else if(i.isStructSchema()){if(e&&"object"==typeof e){let t=!1;for(const[r,s]of i.structIterator()){if(null==e[r]&&!s.isIdempotencyToken())continue;const i=s.getMergedTraits(),o=`${n}${this.getKey(r,i.xmlName,i.ec2QueryName,"struct")}`;this.write(s,e[r],o),t=!0}if(!t&&i.isUnionSchema()){const{$unknown:t}=e;if(Array.isArray(t)){const[e,i]=t,r=`${n}${e}`;this.write(15,i,r)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(void 0===this.buffer)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const t=this.buffer;return delete this.buffer,t}getKey(t,e,n,i){const{ec2:r,capitalizeKeys:s}=this.settings;if(r&&n)return n;const o=e??t;return s&&"struct"===i?o[0].toUpperCase()+o.slice(1):o}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${(0,hn.$)(t)}=`}writeValue(t){this.buffer+=(0,hn.$)(t)}}class yn extends te.M{options;serializer;deserializer;mixin=new re.U;constructor(t){super({defaultNamespace:t.defaultNamespace}),this.options=t;const e={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new En(e),this.deserializer=new dn(e)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,e,n){const i=await super.serializeRequest(t,e,n);i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":"application/x-www-form-urlencoded"}),"unit"!==(0,ne.L)(t.input)&&i.body||(i.body="");const r=t.name.split("#")[1]??t.name;return i.body=`Action=${r}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(t,e,n){const i=this.deserializer,r=ie.l.of(t.output),s={};if(n.statusCode>=300){const r=await(0,ee.P)(n.body,e);r.byteLength>0&&Object.assign(s,await i.read(15,r)),await this.handleError(t,e,n,s,this.deserializeMetadata(n))}for(const t in n.headers){const e=n.headers[t];delete n.headers[t],n.headers[t.toLowerCase()]=e}const o=t.name.split("#")[1]??t.name,a=r.isStructSchema()&&this.useNestedResult()?o+"Result":void 0,c=await(0,ee.P)(n.body,e);c.byteLength>0&&Object.assign(s,await i.read(r,c,a));return{$metadata:this.deserializeMetadata(n),...s}}useNestedResult(){return!0}async handleError(t,e,n,i,r){const s=this.loadQueryErrorCode(n,i)??"Unknown",o=this.loadQueryError(i)??{},a=this.loadQueryErrorMessage(i);o.message=a,o.Error={Type:o.Type,Code:o.Code,Message:a};const{errorSchema:c,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,n,o,r,this.mixin.findQueryCompatibleError),d=ie.l.of(c),f=new(l.O.for(c[1]).getErrorCtor(c)??Error)(a),h={Type:o.Error.Type,Code:o.Error.Code,Error:o.Error};for(const[t,e]of d.structIterator()){const n=e.getMergedTraits().xmlName??t,r=o[n]??i[n];h[t]=this.deserializer.readSchema(e,r)}throw this.mixin.decorateServiceException(Object.assign(f,u,{$fault:d.getMergedTraits().error,message:a},h),i)}loadQueryErrorCode(t,e){const n=(e.Errors?.[0]?.Error??e.Errors?.Error??e.Error)?.Code;return void 0!==n?n:404==t.statusCode?"NotFound":void 0}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){const e=this.loadQueryError(t);return e?.message??e?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}var xn=n(75),vn=n(69),bn=n(112),Sn=n(83),In=n(39),Tn=n(128),An=n(129),$n=n(40);const Pn="required",Nn="type",Dn="fn",Rn="argv",Cn="ref",kn=!1,On=!0,Fn="booleanEquals",jn="stringEquals",Mn="sigv4",_n="us-east-1",Un="endpoint",Ln="https://sts.{Region}.{PartitionResult#dnsSuffix}",zn="tree",Wn="error",Vn="getAttr",qn={[Pn]:!1,[Nn]:"string"},Kn={[Pn]:!0,default:!1,[Nn]:"boolean"},Yn={[Cn]:"Endpoint"},Bn={[Dn]:"isSet",[Rn]:[{[Cn]:"Region"}]},Gn={[Cn]:"Region"},Qn={[Dn]:"aws.partition",[Rn]:[Gn],assign:"PartitionResult"},Xn={[Cn]:"UseFIPS"},Hn={[Cn]:"UseDualStack"},Jn={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Mn,signingName:"sts",signingRegion:_n}]},headers:{}},Zn={},ti={conditions:[{[Dn]:jn,[Rn]:[Gn,"aws-global"]}],[Un]:Jn,[Nn]:Un},ei={[Dn]:Fn,[Rn]:[Xn,!0]},ni={[Dn]:Fn,[Rn]:[Hn,!0]},ii={[Dn]:Vn,[Rn]:[{[Cn]:"PartitionResult"},"supportsFIPS"]},ri={[Cn]:"PartitionResult"},si={[Dn]:Fn,[Rn]:[!0,{[Dn]:Vn,[Rn]:[ri,"supportsDualStack"]}]},oi=[{[Dn]:"isSet",[Rn]:[Yn]}],ai=[ei],ci=[ni],ui={version:"1.0",parameters:{Region:qn,UseDualStack:Kn,UseFIPS:Kn,Endpoint:qn,UseGlobalEndpoint:Kn},rules:[{conditions:[{[Dn]:Fn,[Rn]:[{[Cn]:"UseGlobalEndpoint"},On]},{[Dn]:"not",[Rn]:oi},Bn,Qn,{[Dn]:Fn,[Rn]:[Xn,kn]},{[Dn]:Fn,[Rn]:[Hn,kn]}],rules:[{conditions:[{[Dn]:jn,[Rn]:[Gn,"ap-northeast-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"ap-south-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"ap-southeast-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"ap-southeast-2"]}],endpoint:Jn,[Nn]:Un},ti,{conditions:[{[Dn]:jn,[Rn]:[Gn,"ca-central-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-central-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-north-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-west-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-west-2"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-west-3"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"sa-east-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,_n]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"us-east-2"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"us-west-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"us-west-2"]}],endpoint:Jn,[Nn]:Un},{endpoint:{url:Ln,properties:{authSchemes:[{name:Mn,signingName:"sts",signingRegion:"{Region}"}]},headers:Zn},[Nn]:Un}],[Nn]:zn},{conditions:oi,rules:[{conditions:ai,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Nn]:Wn},{conditions:ci,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Nn]:Wn},{endpoint:{url:Yn,properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn},{conditions:[Bn],rules:[{conditions:[Qn],rules:[{conditions:[ei,ni],rules:[{conditions:[{[Dn]:Fn,[Rn]:[On,ii]},si],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Nn]:Wn}],[Nn]:zn},{conditions:ai,rules:[{conditions:[{[Dn]:Fn,[Rn]:[ii,On]}],rules:[{conditions:[{[Dn]:jn,[Rn]:[{[Dn]:Vn,[Rn]:[ri,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:Zn,headers:Zn},[Nn]:Un},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn},{error:"FIPS is enabled but this partition does not support FIPS",[Nn]:Wn}],[Nn]:zn},{conditions:ci,rules:[{conditions:[si],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn},{error:"DualStack is enabled but this partition does not support DualStack",[Nn]:Wn}],[Nn]:zn},ti,{endpoint:{url:Ln,properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn}],[Nn]:zn},{error:"Invalid Configuration: Missing Region",[Nn]:Wn}]},li=new Tn.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),di=(t,e={})=>li.get(t,()=>(0,An.s)(ui,{endpointParams:t,logger:e.logger}));$n.m.aws=In.UF;const fi=t=>{(0,Qt.I)(process.version);const e=(0,Jt.I)(t),n=()=>e().then(Xt.l),i=(t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??bn.E,base64Encoder:t?.base64Encoder??wn.n,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??di,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Ft,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new Lt.f2},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Kt.m}],logger:t?.logger??new xn.N,protocol:t?.protocol??yn,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:Y,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",urlParser:t?.urlParser??vn.D,utf8Decoder:t?.utf8Decoder??Sn.a,utf8Encoder:t?.utf8Encoder??cn.P}))(t);(0,_t.I)(process.version);const o={profile:t?.profile,logger:i.logger};return{...i,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??(0,s.Z)(Ut.$,o),bodyLengthChecker:t?.bodyLengthChecker??Ht.n,defaultUserAgentProvider:t?.defaultUserAgentProvider??(0,zt.pf)({serviceId:i.serviceId,clientVersion:Mt.rE}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4")||(async e=>await t.credentialDefaultProvider(e?.o||{})()),signer:new Lt.f2},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Kt.m}],maxAttempts:t?.maxAttempts??(0,s.Z)(Pt.qs,t),region:t?.region??(0,s.Z)(r.GG,{...r.zH,...o}),requestHandler:Bt.$.create(t?.requestHandler??n),retryMode:t?.retryMode??(0,s.Z)({...Pt.kN,default:async()=>(await n()).retryMode||Zt.L0},t),sha256:t?.sha256??Yt.V.bind(null,"sha256"),streamCollector:t?.streamCollector??Gt.k,useDualstackEndpoint:t?.useDualstackEndpoint??(0,s.Z)(Vt.e$,o),useFipsEndpoint:t?.useFipsEndpoint??(0,s.Z)(qt.Ko,o),userAgentAppId:t?.userAgentAppId??(0,s.Z)(Wt.hV,o)}};var hi=n(130),pi=n(131),mi=n(132);class gi extends Dt.K{config;constructor(...[t]){const e=fi(t||{});super(e),this.initConfig=e;const n=(i=e,Object.assign(i,{useDualstackEndpoint:i.useDualstackEndpoint??!1,useFipsEndpoint:i.useFipsEndpoint??!1,useGlobalEndpoint:i.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var i;const r=(0,yt.D)(n),s=(0,Pt.$z)(r),o=(0,vt.T)(s),a=(0,gt.OV)(o),c=(0,$t.C)(a),u=((t,e)=>{const n=Object.assign((0,hi.R)(t),(0,mi.xA)(t),(0,pi.e)(t),(t=>{const e=t.httpAuthSchemes;let n=t.httpAuthSchemeProvider,i=t.credentials;return{setHttpAuthScheme(t){const n=e.findIndex(e=>e.schemeId===t.schemeId);-1===n?e.push(t):e.splice(n,1,t)},httpAuthSchemes:()=>e,setHttpAuthSchemeProvider(t){n=t},httpAuthSchemeProvider:()=>n,setCredentials(t){i=t},credentials:()=>i}})(t));return e.forEach(t=>t.configure(n)),Object.assign(t,(0,hi.$)(n),(0,mi.uv)(n),(0,pi.j)(n),{httpAuthSchemes:(i=n).httpAuthSchemes(),httpAuthSchemeProvider:i.httpAuthSchemeProvider(),credentials:i.credentials()});var i})(jt(c),t?.extensions||[]);this.config=u,this.middlewareStack.use((0,Tt.wq)(this.config)),this.middlewareStack.use((0,xt.sM)(this.config)),this.middlewareStack.use((0,Nt.ey)(this.config)),this.middlewareStack.use((0,At.vK)(this.config)),this.middlewareStack.use((0,gt.TC)(this.config)),this.middlewareStack.use((0,wt.Y7)(this.config)),this.middlewareStack.use((0,Et.n)(this.config)),this.middlewareStack.use((0,bt.w)(this.config,{httpAuthSchemeParametersProvider:Ot,identityProviderConfigProvider:async t=>new St.h({"aws.auth#sigv4":t.credentials})})),this.middlewareStack.use((0,It.l)(this.config))}destroy(){super.destroy()}}const wi=(t,e)=>e?class extends t{constructor(t){super(t);for(const t of e)this.middlewareStack.use(t)}}:t,Ei=(t={},e)=>ht(t,wi(gi,e)),yi=(t={},e)=>pt(t,wi(gi,e))},848(t,e,n){function i(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}n.d(e,{$:()=>i})},849(t,e,n){n.d(e,{k:()=>b});var i=n(108),r=n(847);const s="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",o="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",u="(\\d{4})",l=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),d=new RegExp(`^${s}, ${c} ${o} ${u} ${a} GMT$`),f=new RegExp(`^${s}, ${c}-${o}-(\\d\\d) ${a} GMT$`),h=new RegExp(`^${s} ${o} ( [1-9]|\\d\\d) ${a} ${u}$`),p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(t,e,n){const i=Number(t);if(i<e||i>n)throw new Error(`Value ${i} out of range [${e}, ${n}]`)}var g=n(124),w=n(125),E=n(112),y=n(114),x=n(117),v=n(122);class b extends x.f{settings;constructor(t){super(),this.settings=t}read(t,e){const n=i.l.of(t);if(n.isListSchema())return(0,r.G)(e).map(t=>this.read(n.getValueSchema(),t));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??E.E)(e);if(n.isTimestampSchema()){switch((0,v.V)(n,this.settings)){case 5:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC3339 timestamps must be strings");const e=l.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);const[,n,i,r,s,o,a,,c,u]=e;m(i,1,12),m(r,1,31),m(s,0,23),m(o,0,59),m(a,0,60);const d=new Date(Date.UTC(Number(n),Number(i)-1,Number(r),Number(s),Number(o),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(d.setUTCFullYear(Number(n)),"Z"!=u.toUpperCase()){const[,t,e,n]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],i="-"===t?1:-1;d.setTime(d.getTime()+i*(60*Number(e)*60*1e3+60*Number(n)*1e3))}return d})(e);case 6:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC7231 timestamps must be strings.");let e,n,i,r,s,o,a,c;if((c=d.exec(t))?[,e,n,i,r,s,o,a]=c:(c=f.exec(t))?([,e,n,i,r,s,o,a]=c,i=(Number(i)+1900).toString()):(c=h.exec(t))&&([,n,e,r,s,o,a,i]=c),i&&o){const t=Date.UTC(Number(i),p.indexOf(n),Number(e),Number(r),Number(s),Number(o),a?Math.round(1e3*parseFloat(`0.${a}`)):0);m(e,1,31),m(r,0,23),m(s,0,59),m(o,0,60);const c=new Date(t);return c.setUTCFullYear(Number(i)),c}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)})(e);case 7:return(t=>{if(null==t)return;let e=NaN;if("number"==typeof t)e=t;else if("string"==typeof t){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else"object"==typeof t&&1===t.tag&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*e))})(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}}if(n.isStringSchema()){const t=n.getMergedTraits().mediaType;let i=e;if(t){n.getMergedTraits().httpHeader&&(i=this.base64ToUtf8(i));return("application/json"===t||t.endsWith("+json"))&&(i=g.A.from(i)),i}}return n.isNumericSchema()?Number(e):n.isBigIntegerSchema()?BigInt(e):n.isBigDecimalSchema()?new w.D(e,"bigDecimal"):n.isBooleanSchema()?"true"===String(e).toLowerCase():e}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??y.P)((this.serdeContext?.base64Decoder??E.E)(t))}}},847(t,e,n){n.d(e,{G:()=>i});const i=t=>{const e=t.length,n=[];let i,r=!1,s=0;for(let o=0;o<e;++o){const e=t[o];switch(e){case'"':"\\"!==i&&(r=!r);break;case",":r||(n.push(t.slice(s,o)),s=o+1)}i=e}return n.push(t.slice(s)),n.map(t=>{const e=(t=t.trim()).length;return e<2?t:('"'===t[0]&&'"'===t[e-1]&&(t=t.slice(1,e-1)),t.replace(/\\"/g,'"'))})}},850(t,e,n){n.d(e,{m:()=>i});class i{async sign(t,e,n){return t}}},845(t){t.exports={rE:"3.996.3"}}};
|
|
2
|
+
"use strict";exports.id=827,exports.ids=[827],exports.modules={852(t,e,n){n.d(e,{getDefaultRoleAssumer:()=>Ei,getDefaultRoleAssumerWithWebIdentity:()=>yi});var i=n(80),r=n(93),s=n(55);const o={silence:!1};var a=n(133),c=n(134);const u={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var l=n(116),d=n(119);class f extends d.T{constructor(t){super(t),Object.setPrototypeOf(this,f.prototype)}}class h extends f{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,h.prototype)}}class p extends f{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,p.prototype)}}class m extends f{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t}),Object.setPrototypeOf(this,m.prototype)}}class g extends f{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,g.prototype)}}class w extends f{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t}),Object.setPrototypeOf(this,w.prototype)}}class E extends f{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,E.prototype)}}class y extends f{name="IDPCommunicationErrorException";$fault="client";constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t}),Object.setPrototypeOf(this,y.prototype)}}const x="AssumedRoleUser",v="Credentials",b="DurationSeconds",S="Policy",I="PolicyArns",T="PackedPolicySize",A="RoleArn",$="RoleSessionName",P="SourceIdentity",N="awsQueryError",D="client",R="error",C="httpError",k="message",O="smithy.ts.sdk.synthetic.com.amazonaws.sts",F="com.amazonaws.sts",j=l.O.for(O);var M=[-3,O,"STSServiceException",0,[],[]];j.registerError(M,f);const _=l.O.for(F);var U=[-3,F,"ExpiredTokenException",{[N]:["ExpiredTokenException",400],[R]:D,[C]:400},[k],[0]];_.registerError(U,h);var L=[-3,F,"IDPCommunicationErrorException",{[N]:["IDPCommunicationError",400],[R]:D,[C]:400},[k],[0]];_.registerError(L,y);var z=[-3,F,"IDPRejectedClaimException",{[N]:["IDPRejectedClaim",403],[R]:D,[C]:403},[k],[0]];_.registerError(z,w);var W=[-3,F,"InvalidIdentityTokenException",{[N]:["InvalidIdentityToken",400],[R]:D,[C]:400},[k],[0]];_.registerError(W,E);var V=[-3,F,"MalformedPolicyDocumentException",{[N]:["MalformedPolicyDocument",400],[R]:D,[C]:400},[k],[0]];_.registerError(V,p);var q=[-3,F,"PackedPolicyTooLargeException",{[N]:["PackedPolicyTooLarge",400],[R]:D,[C]:400},[k],[0]];_.registerError(q,m);var K=[-3,F,"RegionDisabledException",{[N]:["RegionDisabledException",403],[R]:D,[C]:403},[k],[0]];_.registerError(K,g);const Y=[j,_];var B=[0,F,"accessKeySecretType",8,0],G=[0,F,"clientTokenType",8,0],Q=[3,F,x,0,["AssumedRoleId","Arn"],[0,0],2],X=[3,F,"AssumeRoleRequest",0,[A,$,I,S,b,"Tags","TransitiveTagKeys","ExternalId","SerialNumber","TokenCode",P,"ProvidedContexts"],[0,0,()=>rt,0,1,()=>ot,64,0,0,0,0,()=>st],2],H=[3,F,"AssumeRoleResponse",0,[v,x,T,P],[[()=>tt,0],()=>Q,1,0]],J=[3,F,"AssumeRoleWithWebIdentityRequest",0,[A,$,"WebIdentityToken","ProviderId",I,S,b],[0,0,[()=>G,0],0,()=>rt,0,1],3],Z=[3,F,"AssumeRoleWithWebIdentityResponse",0,[v,"SubjectFromWebIdentityToken",x,T,"Provider","Audience",P],[[()=>tt,0],0,()=>Q,1,0,0,0]],tt=[3,F,v,0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[0,[()=>B,0],0,4],4],et=[3,F,"PolicyDescriptorType",0,["arn"],[0]],nt=[3,F,"ProvidedContext",0,["ProviderArn","ContextAssertion"],[0,0]],it=[3,F,"Tag",0,["Key","Value"],[0,0],2],rt=[1,F,"policyDescriptorListType",0,()=>et],st=[1,F,"ProvidedContextsListType",0,()=>nt],ot=[1,F,"tagListType",0,()=>it],at=[9,F,"AssumeRole",0,()=>X,()=>H],ct=[9,F,"AssumeRoleWithWebIdentity",0,()=>J,()=>Z];class ut extends(c.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,a.r)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc(at).build()){}class lt extends(c.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,a.r)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(ct).build()){}const dt=t=>{if("string"==typeof t?.Arn){const e=t.Arn.split(":");if(e.length>4&&""!==e[4])return e[4]}},ft=async(t,e,n,i={})=>{const a="function"==typeof t?await t():t,c="function"==typeof e?await e():e;let u="";const l=a??c??(u=await function(t={}){return(0,s.Z)({...r.GG,default:async()=>(o.silence||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1")},{...r.zH,...t})}(i)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${a} (credential provider clientConfig)`,`${c} (contextual client)`,`${u} (STS default: AWS_REGION, profile region, or us-east-1)`),l},ht=(t,e)=>{let n,r;return async(s,o)=>{if(r=s,!n){const{logger:i=t?.parentClientConfig?.logger,profile:s=t?.parentClientConfig?.profile,region:o,requestHandler:a=t?.parentClientConfig?.requestHandler,credentialProviderLogger:c,userAgentAppId:u=t?.parentClientConfig?.userAgentAppId}=t,l=await ft(o,t?.parentClientConfig?.region,c,{logger:i,profile:s}),d=!mt(a);n=new e({...t,userAgentAppId:u,profile:s,credentialDefaultProvider:()=>async()=>r,region:l,requestHandler:d?a:void 0,logger:i})}const{Credentials:a,AssumedRoleUser:c}=await n.send(new ut(o));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);const u=dt(c),l={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...u&&{accountId:u}};return(0,i.g)(l,"CREDENTIALS_STS_ASSUME_ROLE","i"),l}},pt=(t,e)=>{let n;return async r=>{if(!n){const{logger:i=t?.parentClientConfig?.logger,profile:r=t?.parentClientConfig?.profile,region:s,requestHandler:o=t?.parentClientConfig?.requestHandler,credentialProviderLogger:a,userAgentAppId:c=t?.parentClientConfig?.userAgentAppId}=t,u=await ft(s,t?.parentClientConfig?.region,a,{logger:i,profile:r}),l=!mt(o);n=new e({...t,userAgentAppId:c,profile:r,region:u,requestHandler:l?o:void 0,logger:i})}const{Credentials:s,AssumedRoleUser:o}=await n.send(new lt(r));if(!s||!s.AccessKeyId||!s.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);const a=dt(o),c={accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.SessionToken,expiration:s.Expiration,...s.CredentialScope&&{credentialScope:s.CredentialScope},...a&&{accountId:a}};return a&&(0,i.g)(c,"RESOLVED_ACCOUNT_ID","T"),(0,i.g)(c,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),c}},mt=t=>"h2"===t?.metadata?.handlerProtocol;var gt=n(32),wt=n(34),Et=n(35),yt=n(36),xt=n(38),vt=n(43),bt=n(45),St=n(44),It=n(48),Tt=n(49),At=n(51),$t=n(52),Pt=n(70),Nt=n(74),Dt=n(77),Rt=n(79),Ct=n(46),kt=n(53);const Ot=async(t,e,n)=>({operation:(0,Ct.u)(e).operation,region:await(0,kt.t)(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const Ft=t=>{const e=[];if("AssumeRoleWithWebIdentity"===t.operation)e.push({schemeId:"smithy.api#noAuth"});else e.push(function(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}(t));return e},jt=t=>{const e=(n=t,Object.assign(n,{stsClientCtor:gi}));var n;const i=(0,Rt.h)(e);return Object.assign(i,{authSchemePreference:(0,kt.t)(t.authSchemePreference??[])})};var Mt=n(845),_t=n(87),Ut=n(88),Lt=n(106),zt=n(90),Wt=n(92),Vt=n(94),qt=n(97),Kt=n(850),Yt=n(98),Bt=n(99),Gt=n(100),Qt=n(102),Xt=n(101),Ht=n(103),Jt=n(105),Zt=n(71),te=n(107),ee=n(111),ne=n(109),ie=n(108),re=n(118);const se={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0};function oe(t){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,allowedTags:null,tagFilter:null}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:t.maxEntitySize??1e4,maxExpansionDepth:t.maxExpansionDepth??10,maxTotalExpansions:t.maxTotalExpansions??1e3,maxExpandedLength:t.maxExpandedLength??1e5,allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:oe(!0)}const ae=function(t){const e=Object.assign({},se,t);return e.processEntities=oe(e.processEntities),e},ce=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ue=new RegExp("^"+("["+ce+"]["+(ce+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*")+"$");function le(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n}const de=function(t){const e=ue.exec(t);return!(null==e)};let fe;fe="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class he{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][fe]={startIndex:e})}static getMetaDataSymbol(){return fe}}class pe{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){const n=Object.create(null);if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,r=!1,s=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?r=!0:o+=t[e];else{if(r&&ge(t,"!ENTITY",e)){let i,r;if(e+=7,[i,r,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===r.indexOf("&")){const t=i.replace(/[.\-+*:]/g,"\\.");n[i]={regx:RegExp(`&${t};`,"g"),val:r}}}else if(r&&ge(t,"!ELEMENT",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(r&&ge(t,"!ATTLIST",e))e+=8;else if(r&&ge(t,"!NOTATION",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!ge(t,"!--",e))throw new Error("Invalid DOCTYPE");s=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}readEntityExp(t,e){e=me(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)n+=t[e],e++;if(we(n),e=me(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}let i="";if([e,i]=this.readIdentifierVal(t,e,"entity"),!1!==this.options.enabled&&this.options.maxEntitySize&&i.length>this.options.maxEntitySize)throw new Error(`Entity "${n}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[n,i,--e]}readNotationExp(t,e){e=me(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;!this.suppressValidationErr&&we(n),e=me(t,e);const i=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==i&&"PUBLIC"!==i)throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);e+=i.length,e=me(t,e);let r=null,s=null;if("PUBLIC"===i)[e,r]=this.readIdentifierVal(t,e,"publicIdentifier"),'"'!==t[e=me(t,e)]&&"'"!==t[e]||([e,s]=this.readIdentifierVal(t,e,"systemIdentifier"));else if("SYSTEM"===i&&([e,s]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!s))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:r,systemIdentifier:s,index:--e}}readIdentifierVal(t,e,n){let i="";const r=t[e];if('"'!==r&&"'"!==r)throw new Error(`Expected quoted string, found "${r}"`);for(e++;e<t.length&&t[e]!==r;)i+=t[e],e++;if(t[e]!==r)throw new Error(`Unterminated ${n} value`);return[++e,i]}readElementExp(t,e){e=me(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!this.suppressValidationErr&&!de(n))throw new Error(`Invalid element name: "${n}"`);let i="";if("E"===t[e=me(t,e)]&&ge(t,"MPTY",e))e+=4;else if("A"===t[e]&&ge(t,"NY",e))e+=2;else if("("===t[e]){for(e++;e<t.length&&")"!==t[e];)i+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:n,contentModel:i.trim(),index:e}}readAttlistExp(t,e){e=me(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;we(n),e=me(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;if(!we(i))throw new Error(`Invalid attribute name: "${i}"`);e=me(t,e);let r="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(r="NOTATION","("!==t[e=me(t,e+=8)])throw new Error(`Expected '(', found "${t[e]}"`);e++;let n=[];for(;e<t.length&&")"!==t[e];){let i="";for(;e<t.length&&"|"!==t[e]&&")"!==t[e];)i+=t[e],e++;if(i=i.trim(),!we(i))throw new Error(`Invalid notation name: "${i}"`);n.push(i),"|"===t[e]&&(e++,e=me(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,r+=" ("+n.join("|")+")"}else{for(;e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;const n=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!n.includes(r.toUpperCase()))throw new Error(`Invalid attribute type: "${r}"`)}e=me(t,e);let s="";return"#REQUIRED"===t.substring(e,e+8).toUpperCase()?(s="#REQUIRED",e+=8):"#IMPLIED"===t.substring(e,e+7).toUpperCase()?(s="#IMPLIED",e+=7):[e,s]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:n,attributeName:i,attributeType:r,defaultValue:s,index:e}}}const me=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function ge(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function we(t){if(de(t))return t;throw new Error(`Invalid entity name ${t}`)}const Ee=/^[-+]?0x[a-fA-F0-9]+$/,ye=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,xe={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function ve(t,e={}){if(e=Object.assign({},xe,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===t)return 0;if(e.hex&&Ee.test(n))return function(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n,16);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(be);if(i){let r=i[1]||"";const s=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=r?t[o.length+1]===s:t[o.length]===s;return o.length>1&&a?t:1!==o.length||!i[3].startsWith(`.${s}`)&&i[3][0]!==s?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const i=ye.exec(n);if(i){const r=i[1]||"",s=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),t;return t}(i[3]);const a=r?"."===t[s.length+1]:"."===t[s.length];if(!e.leadingZeros&&(s.length>1||1===s.length&&!a))return t;{const i=Number(n),a=String(i);if(0===i)return i;if(-1!==a.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===a||a===o||a===`${r}${o}`?i:t;let c=s?o:n;return s?c===a||r+c===a?i:t:c===a||c===r+a?i:t}}return t}}return function(t,e,n){const i=e===1/0;switch(n.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return t}}(t,Number(n),e)}const be=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;class Se{constructor(t){var e;if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>_e(e,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>_e(e,16,"&#x")}},this.addExternalEntities=Ie,this.parseXml=Ne,this.parseTextData=Te,this.resolveNameSpace=Ae,this.buildAttributesMap=Pe,this.isItStopNode=ke,this.replaceEntitiesValue=Re,this.readStopNodeData=je,this.saveTextToParentTag=Ce,this.addChild=De,this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e&&(e.startsWith("*.")?this.stopNodesWildcard.add(e.substring(2)):this.stopNodesExact.add(e))}}}}function Ie(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n],r=i.replace(/[.\-+*:]/g,"\\.");this.lastEntities[i]={regex:new RegExp("&"+r+";","g"),val:t[i]}}}function Te(t,e,n,i,r,s,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=this.options.tagValueProcessor(e,t,n,r,s);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return Me(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?Me(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function Ae(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const $e=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Pe(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const i=le(t,$e),r=i.length,s={};for(let t=0;t<r;t++){const r=this.resolveNameSpace(i[t][1]);if(this.ignoreAttributesFn(r,e))continue;let o=i[t][4],a=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(a=this.options.transformAttributeName(a)),"__proto__"===a&&(a="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o,n,e);const t=this.options.attributeValueProcessor(r,o,e);s[a]=null==t?o:typeof t!=typeof o||t!==o?t:Me(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[a]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=s,t}return s}}const Ne=function(t){t=t.replace(/\r\n?/g,"\n");const e=new he("!xml");let n=e,i="",r="";this.entityExpansionCount=0,this.currentExpandedLength=0;const s=new pe(this.options.processEntities);for(let o=0;o<t.length;o++){if("<"===t[o])if("/"===t[o+1]){const e=Oe(t,">",o,"Closing Tag is not closed.");let s=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=s.indexOf(":");-1!==t&&(s=s.substr(t+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(i=this.saveTextToParentTag(i,n,r));const a=r.substring(r.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let c=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(c=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=r.lastIndexOf("."),r=r.substring(0,c),n=this.tagsNodeStack.pop(),i="",o=e}else if("?"===t[o+1]){let e=Fe(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new he(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(n,t,r,o)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=Oe(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const s=t.substring(o+4,e-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}o=e}else if("!D"===t.substr(o+1,2)){const e=s.readDocType(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=Oe(t,"]]>",o,"CDATA is not closed.")-2,s=t.substring(o+9,e);i=this.saveTextToParentTag(i,n,r);let a=this.parseTextData(s,n.tagname,r,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]):n.add(this.options.textNodeName,a),o=e+2}else{let s=Fe(t,o,this.options.removeNSPrefix),a=s.tagName;const c=s.rawTagName;let u=s.tagExp,l=s.attrExpPresent,d=s.closeIndex;if(this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}if(this.options.strictReservedNames&&(a===this.options.commentPropName||a===this.options.cdataPropName))throw new Error(`Invalid tag name: ${a}`);n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const f=n;f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a);const h=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,r,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),u=a):u=u.substr(0,u.length-1),o=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=s.closeIndex;else{const n=this.readStopNodeData(t,c,d+1);if(!n)throw new Error(`Unexpected end of ${c}`);o=n.i,e=n.tagContent}const i=new he(a);a!==u&&l&&(i[":@"]=this.buildAttributesMap(u,r,a)),e&&(e=this.parseTextData(e,a,r,!0,l,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,r,h)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){if("/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}const t=new he(a);a!==u&&l&&(t[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(n,t,r,h),r=r.substr(0,r.lastIndexOf("."))}else{if(-1!==this.options.unpairedTags.indexOf(a)){const t=new he(a);a!==u&&l&&(t[":@"]=this.buildAttributesMap(u,r)),this.addChild(n,t,r,h),r=r.substr(0,r.lastIndexOf(".")),o=s.closeIndex;continue}{const t=new he(a);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),a!==u&&l&&(t[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(n,t,r,h),n=t}}i="",o=d}}else i+=t[o]}return e.child};function De(t,e,n,i){this.options.captureMetaData||(i=void 0);const r=this.options.updateTag(e.tagname,n,e[":@"]);!1===r||("string"==typeof r?(e.tagname=r,t.addChild(e,i)):t.addChild(e,i))}const Re=function(t,e,n){if(-1===t.indexOf("&"))return t;const i=this.options.processEntities;if(!i.enabled)return t;if(i.allowedTags&&!i.allowedTags.includes(e))return t;if(i.tagFilter&&!i.tagFilter(e,n))return t;for(let e in this.docTypeEntities){const n=this.docTypeEntities[e],r=t.match(n.regx);if(r){if(this.entityExpansionCount+=r.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);const e=t.length;if(t=t.replace(n.regx,n.val),i.maxExpandedLength&&(this.currentExpandedLength+=t.length-e,this.currentExpandedLength>i.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${i.maxExpandedLength}`)}}if(-1===t.indexOf("&"))return t;for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(-1===t.indexOf("&"))return t;if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}return t=t.replace(this.ampEntity.regex,this.ampEntity.val)};function Ce(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function ke(t,e,n,i){return!(!e||!e.has(i))||!(!t||!t.has(n))}function Oe(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function Fe(t,e,n,i=">"){const r=function(t,e,n=">"){let i,r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,i);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let c=s,u=!0;-1!==a&&(c=s.substring(0,a),s=s.substring(a+1).trimStart());const l=c;if(n){const t=c.indexOf(":");-1!==t&&(c=c.substr(t+1),u=c!==r.data.substr(t+1))}return{tagName:c,tagExp:s,closeIndex:o,attrExpPresent:u,rawTagName:l}}function je(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const s=Oe(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:s};n=s}else if("?"===t[n+1]){n=Oe(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=Oe(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=Oe(t,"]]>",n,"StopNode is not closed.")-2}else{const i=Fe(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function Me(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&ve(t,n)}return function(t){return void 0!==t}(t)?t:""}function _e(t,e,n){const i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):n+t+";"}const Ue=he.getMetaDataSymbol();function Le(t,e){return ze(t,e)}function ze(t,e,n){let i;const r={};for(let s=0;s<t.length;s++){const o=t[s],a=We(o);let c="";if(c=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=ze(o[a],e,c);const n=qe(t,e);o[":@"]?Ve(t,o[":@"],c,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==o[Ue]&&"object"==typeof t&&null!==t&&(t[Ue]=o[Ue]),void 0!==r[a]&&Object.prototype.hasOwnProperty.call(r,a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,c,n)?r[a]=[t]:r[a]=t}}}return"string"==typeof i?i.length>0&&(r[e.textNodeName]=i):void 0!==i&&(r[e.textNodeName]=i),r}function We(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Ve(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o];i.isArray(s,n+"."+s,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function qe(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}const Ke={allowBooleanAttributes:!1,unpairedTags:[]};function Ye(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function Be(t,e){const n=e;for(;e<t.length;e++)if("?"==t[e]||" "==t[e]){const i=t.substr(n,e-n);if(e>5&&"xml"===i)return Ze("InvalidXml","XML declaration allowed only at the start of the document.",nn(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function Ge(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function Qe(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if('"'===t[e]||"'"===t[e])""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const Xe=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function He(t,e){const n=le(t,Xe),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return Ze("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",rn(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return Ze("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",rn(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return Ze("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",rn(n[t]));const r=n[t][2];if(!tn(r))return Ze("InvalidAttr","Attribute '"+r+"' is an invalid name.",rn(n[t]));if(Object.prototype.hasOwnProperty.call(i,r))return Ze("InvalidAttr","Attribute '"+r+"' is repeated.",rn(n[t]));i[r]=1}return!0}function Je(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function Ze(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function tn(t){return de(t)}function en(t){return de(t)}function nn(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function rn(t){return t.startIndex+t[1].length}const sn=new class{constructor(t){this.externalEntities={},this.options=ae(t)}parse(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});const n=function(t,e){e=Object.assign({},Ke,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let s=0;s<t.length;s++)if("<"===t[s]&&"?"===t[s+1]){if(s+=2,s=Be(t,s),s.err)return s}else{if("<"!==t[s]){if(Ye(t[s]))continue;return Ze("InvalidChar","char '"+t[s]+"' is not expected.",nn(t,s))}{let o=s;if(s++,"!"===t[s]){s=Ge(t,s);continue}{let a=!1;"/"===t[s]&&(a=!0,s++);let c="";for(;s<t.length&&">"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)c+=t[s];if(c=c.trim(),"/"===c[c.length-1]&&(c=c.substring(0,c.length-1),s--),!en(c)){let e;return e=0===c.trim().length?"Invalid space after '<'.":"Tag '"+c+"' is an invalid name.",Ze("InvalidTag",e,nn(t,s))}const u=Qe(t,s);if(!1===u)return Ze("InvalidAttr","Attributes for '"+c+"' have open quote.",nn(t,s));let l=u.value;if(s=u.index,"/"===l[l.length-1]){const n=s-l.length;l=l.substring(0,l.length-1);const r=He(l,e);if(!0!==r)return Ze(r.err.code,r.err.msg,nn(t,n+r.err.line));i=!0}else if(a){if(!u.tagClosed)return Ze("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",nn(t,s));if(l.trim().length>0)return Ze("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",nn(t,o));if(0===n.length)return Ze("InvalidTag","Closing tag '"+c+"' has not been opened.",nn(t,o));{const e=n.pop();if(c!==e.tagName){let n=nn(t,e.tagStartPos);return Ze("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+c+"'.",nn(t,o))}0==n.length&&(r=!0)}}else{const a=He(l,e);if(!0!==a)return Ze(a.err.code,a.err.msg,nn(t,s-l.length+a.err.line));if(!0===r)return Ze("InvalidXml","Multiple possible root nodes found.",nn(t,s));-1!==e.unpairedTags.indexOf(c)||n.push({tagName:c,tagStartPos:o}),i=!0}for(s++;s<t.length;s++)if("<"===t[s]){if("!"===t[s+1]){s++,s=Ge(t,s);continue}if("?"!==t[s+1])break;if(s=Be(t,++s),s.err)return s}else if("&"===t[s]){const e=Je(t,s);if(-1==e)return Ze("InvalidChar","char '&' is not expected.",nn(t,s));s=e}else if(!0===r&&!Ye(t[s]))return Ze("InvalidXml","Extra text at the end",nn(t,s));"<"===t[s]&&s--}}}return i?1==n.length?Ze("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",nn(t,n[0].tagStartPos)):!(n.length>0)||Ze("InvalidXml","Invalid '"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ze("InvalidXml","Start tag expected.",1)}(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Se(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:Le(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return he.getMetaDataSymbol()}}({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(t,e)=>""===e.trim()&&e.includes("\n")?"":void 0,maxNestedTags:1024});sn.addEntity("#xD","\r"),sn.addEntity("#10","\n");var on=n(849);const an=t=>{const e="#text";for(const n in t)t.hasOwnProperty(n)&&void 0!==t[n][e]?t[n]=t[n][e]:"object"==typeof t[n]&&null!==t[n]&&(t[n]=an(t[n]));return t};var cn=n(114),un=n(121),ln=n(126);class dn extends un.B{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new on.k(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,e,n){const i=ie.l.of(t),r=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(r).find(t=>!!t.getMemberTraits().eventPayload)){const t={},n=Object.keys(r)[0];return r[n].isBlobSchema()?t[n]=e:t[n]=this.read(r[n],e),t}const s=(this.serdeContext?.utf8Encoder??cn.P)(e),o=this.parseXml(s);return this.readSchema(t,n?o[n]:o)}readSchema(t,e){const n=ie.l.of(t);if(n.isUnitSchema())return;const i=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(e))return this.readSchema(n,[e]);if(null==e)return e;if("object"==typeof e){const t=!!i.xmlFlattened;if(n.isListSchema()){const i=n.getValueSchema(),r=[],s=i.getMergedTraits().xmlName??"member",o=t?e:(e[0]??e)[s];if(null==o)return r;const a=Array.isArray(o)?o:[o];for(const t of a)r.push(this.readSchema(i,t));return r}const r={};if(n.isMapSchema()){const i=n.getKeySchema(),s=n.getValueSchema();let o;o=t?Array.isArray(e)?e:[e]:Array.isArray(e.entry)?e.entry:[e.entry];const a=i.getMergedTraits().xmlName??"key",c=s.getMergedTraits().xmlName??"value";for(const t of o){const e=t[a],n=t[c];r[e]=this.readSchema(s,n)}return r}if(n.isStructSchema()){const t=n.isUnionSchema();let i;t&&(i=new ln.F(e,r));for(const[s,o]of n.structIterator()){const n=o.getMergedTraits(),a=n.httpPayload?n.xmlName??o.getName():o.getMemberTraits().xmlName??s;t&&i.mark(a),null!=e[a]&&(r[s]=this.readSchema(o,e[a]))}return t&&i.writeUnknown(),r}if(n.isDocumentSchema())return e;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,e)}parseXml(t){if(t.length){let n;try{e=t,n=sn.parse(e,!0)}catch(e){throw e&&"object"==typeof e&&Object.defineProperty(e,"$responseBodyText",{value:t}),e}const i="#text",r=Object.keys(n)[0],s=n[r];return s[i]&&(s[r]=s[i],delete s[i]),an(s)}var e;return{}}}var fn=n(122),hn=n(848),pn=n(76),mn=n(125),gn=n(123),wn=n(113);class En extends un.B{settings;buffer;constructor(t){super(),this.settings=t}write(t,e,n=""){void 0===this.buffer&&(this.buffer="");const i=ie.l.of(t);if(n&&!n.endsWith(".")&&(n+="."),i.isBlobSchema())("string"==typeof e||e instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??wn.n)(e)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())null!=e?(this.writeKey(n),this.writeValue(String(e))):i.isIdempotencyToken()&&(this.writeKey(n),this.writeValue((0,pn.v4)()));else if(i.isBigIntegerSchema())null!=e&&(this.writeKey(n),this.writeValue(String(e)));else if(i.isBigDecimalSchema())null!=e&&(this.writeKey(n),this.writeValue(e instanceof mn.D?e.string:String(e)));else if(i.isTimestampSchema()){if(e instanceof Date){this.writeKey(n);switch((0,fn.V)(i,this.settings)){case 5:this.writeValue(e.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue((0,gn.JV)(e));break;case 7:this.writeValue(String(e.getTime()/1e3))}}}else if(i.isDocumentSchema())Array.isArray(e)?this.write(79,e,n):e instanceof Date?this.write(4,e,n):e instanceof Uint8Array?this.write(21,e,n):e&&"object"==typeof e?this.write(143,e,n):(this.writeKey(n),this.writeValue(String(e)));else if(i.isListSchema()){if(Array.isArray(e))if(0===e.length)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(""));else{const t=i.getValueSchema(),r=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let s=1;for(const i of e){if(null==i)continue;const e=t.getMergedTraits(),o=this.getKey("member",e.xmlName,e.ec2QueryName),a=r?`${n}${s}`:`${n}${o}.${s}`;this.write(t,i,a),++s}}}else if(i.isMapSchema()){if(e&&"object"==typeof e){const t=i.getKeySchema(),r=i.getValueSchema(),s=i.getMergedTraits().xmlFlattened;let o=1;for(const[i,a]of Object.entries(e)){if(null==a)continue;const e=t.getMergedTraits(),c=this.getKey("key",e.xmlName,e.ec2QueryName),u=s?`${n}${o}.${c}`:`${n}entry.${o}.${c}`,l=r.getMergedTraits(),d=this.getKey("value",l.xmlName,l.ec2QueryName),f=s?`${n}${o}.${d}`:`${n}entry.${o}.${d}`;this.write(t,i,u),this.write(r,a,f),++o}}}else if(i.isStructSchema()){if(e&&"object"==typeof e){let t=!1;for(const[r,s]of i.structIterator()){if(null==e[r]&&!s.isIdempotencyToken())continue;const i=s.getMergedTraits(),o=`${n}${this.getKey(r,i.xmlName,i.ec2QueryName,"struct")}`;this.write(s,e[r],o),t=!0}if(!t&&i.isUnionSchema()){const{$unknown:t}=e;if(Array.isArray(t)){const[e,i]=t,r=`${n}${e}`;this.write(15,i,r)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(void 0===this.buffer)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const t=this.buffer;return delete this.buffer,t}getKey(t,e,n,i){const{ec2:r,capitalizeKeys:s}=this.settings;if(r&&n)return n;const o=e??t;return s&&"struct"===i?o[0].toUpperCase()+o.slice(1):o}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${(0,hn.$)(t)}=`}writeValue(t){this.buffer+=(0,hn.$)(t)}}class yn extends te.M{options;serializer;deserializer;mixin=new re.U;constructor(t){super({defaultNamespace:t.defaultNamespace}),this.options=t;const e={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new En(e),this.deserializer=new dn(e)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,e,n){const i=await super.serializeRequest(t,e,n);i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":"application/x-www-form-urlencoded"}),"unit"!==(0,ne.L)(t.input)&&i.body||(i.body="");const r=t.name.split("#")[1]??t.name;return i.body=`Action=${r}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(t,e,n){const i=this.deserializer,r=ie.l.of(t.output),s={};if(n.statusCode>=300){const r=await(0,ee.P)(n.body,e);r.byteLength>0&&Object.assign(s,await i.read(15,r)),await this.handleError(t,e,n,s,this.deserializeMetadata(n))}for(const t in n.headers){const e=n.headers[t];delete n.headers[t],n.headers[t.toLowerCase()]=e}const o=t.name.split("#")[1]??t.name,a=r.isStructSchema()&&this.useNestedResult()?o+"Result":void 0,c=await(0,ee.P)(n.body,e);c.byteLength>0&&Object.assign(s,await i.read(r,c,a));return{$metadata:this.deserializeMetadata(n),...s}}useNestedResult(){return!0}async handleError(t,e,n,i,r){const s=this.loadQueryErrorCode(n,i)??"Unknown",o=this.loadQueryError(i)??{},a=this.loadQueryErrorMessage(i);o.message=a,o.Error={Type:o.Type,Code:o.Code,Message:a};const{errorSchema:c,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,n,o,r,this.mixin.findQueryCompatibleError),d=ie.l.of(c),f=new(l.O.for(c[1]).getErrorCtor(c)??Error)(a),h={Type:o.Error.Type,Code:o.Error.Code,Error:o.Error};for(const[t,e]of d.structIterator()){const n=e.getMergedTraits().xmlName??t,r=o[n]??i[n];h[t]=this.deserializer.readSchema(e,r)}throw this.mixin.decorateServiceException(Object.assign(f,u,{$fault:d.getMergedTraits().error,message:a},h),i)}loadQueryErrorCode(t,e){const n=(e.Errors?.[0]?.Error??e.Errors?.Error??e.Error)?.Code;return void 0!==n?n:404==t.statusCode?"NotFound":void 0}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){const e=this.loadQueryError(t);return e?.message??e?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}var xn=n(75),vn=n(69),bn=n(112),Sn=n(83),In=n(39),Tn=n(128),An=n(129),$n=n(40);const Pn="required",Nn="type",Dn="fn",Rn="argv",Cn="ref",kn=!1,On=!0,Fn="booleanEquals",jn="stringEquals",Mn="sigv4",_n="us-east-1",Un="endpoint",Ln="https://sts.{Region}.{PartitionResult#dnsSuffix}",zn="tree",Wn="error",Vn="getAttr",qn={[Pn]:!1,[Nn]:"string"},Kn={[Pn]:!0,default:!1,[Nn]:"boolean"},Yn={[Cn]:"Endpoint"},Bn={[Dn]:"isSet",[Rn]:[{[Cn]:"Region"}]},Gn={[Cn]:"Region"},Qn={[Dn]:"aws.partition",[Rn]:[Gn],assign:"PartitionResult"},Xn={[Cn]:"UseFIPS"},Hn={[Cn]:"UseDualStack"},Jn={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Mn,signingName:"sts",signingRegion:_n}]},headers:{}},Zn={},ti={conditions:[{[Dn]:jn,[Rn]:[Gn,"aws-global"]}],[Un]:Jn,[Nn]:Un},ei={[Dn]:Fn,[Rn]:[Xn,!0]},ni={[Dn]:Fn,[Rn]:[Hn,!0]},ii={[Dn]:Vn,[Rn]:[{[Cn]:"PartitionResult"},"supportsFIPS"]},ri={[Cn]:"PartitionResult"},si={[Dn]:Fn,[Rn]:[!0,{[Dn]:Vn,[Rn]:[ri,"supportsDualStack"]}]},oi=[{[Dn]:"isSet",[Rn]:[Yn]}],ai=[ei],ci=[ni],ui={version:"1.0",parameters:{Region:qn,UseDualStack:Kn,UseFIPS:Kn,Endpoint:qn,UseGlobalEndpoint:Kn},rules:[{conditions:[{[Dn]:Fn,[Rn]:[{[Cn]:"UseGlobalEndpoint"},On]},{[Dn]:"not",[Rn]:oi},Bn,Qn,{[Dn]:Fn,[Rn]:[Xn,kn]},{[Dn]:Fn,[Rn]:[Hn,kn]}],rules:[{conditions:[{[Dn]:jn,[Rn]:[Gn,"ap-northeast-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"ap-south-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"ap-southeast-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"ap-southeast-2"]}],endpoint:Jn,[Nn]:Un},ti,{conditions:[{[Dn]:jn,[Rn]:[Gn,"ca-central-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-central-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-north-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-west-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-west-2"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"eu-west-3"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"sa-east-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,_n]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"us-east-2"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"us-west-1"]}],endpoint:Jn,[Nn]:Un},{conditions:[{[Dn]:jn,[Rn]:[Gn,"us-west-2"]}],endpoint:Jn,[Nn]:Un},{endpoint:{url:Ln,properties:{authSchemes:[{name:Mn,signingName:"sts",signingRegion:"{Region}"}]},headers:Zn},[Nn]:Un}],[Nn]:zn},{conditions:oi,rules:[{conditions:ai,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Nn]:Wn},{conditions:ci,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Nn]:Wn},{endpoint:{url:Yn,properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn},{conditions:[Bn],rules:[{conditions:[Qn],rules:[{conditions:[ei,ni],rules:[{conditions:[{[Dn]:Fn,[Rn]:[On,ii]},si],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Nn]:Wn}],[Nn]:zn},{conditions:ai,rules:[{conditions:[{[Dn]:Fn,[Rn]:[ii,On]}],rules:[{conditions:[{[Dn]:jn,[Rn]:[{[Dn]:Vn,[Rn]:[ri,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:Zn,headers:Zn},[Nn]:Un},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn},{error:"FIPS is enabled but this partition does not support FIPS",[Nn]:Wn}],[Nn]:zn},{conditions:ci,rules:[{conditions:[si],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn},{error:"DualStack is enabled but this partition does not support DualStack",[Nn]:Wn}],[Nn]:zn},ti,{endpoint:{url:Ln,properties:Zn,headers:Zn},[Nn]:Un}],[Nn]:zn}],[Nn]:zn},{error:"Invalid Configuration: Missing Region",[Nn]:Wn}]},li=new Tn.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),di=(t,e={})=>li.get(t,()=>(0,An.s)(ui,{endpointParams:t,logger:e.logger}));$n.m.aws=In.UF;const fi=t=>{(0,Qt.I)(process.version);const e=(0,Jt.I)(t),n=()=>e().then(Xt.l),i=(t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??bn.E,base64Encoder:t?.base64Encoder??wn.n,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??di,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Ft,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new Lt.f2},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Kt.m}],logger:t?.logger??new xn.N,protocol:t?.protocol??yn,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:Y,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",urlParser:t?.urlParser??vn.D,utf8Decoder:t?.utf8Decoder??Sn.a,utf8Encoder:t?.utf8Encoder??cn.P}))(t);(0,_t.I)(process.version);const o={profile:t?.profile,logger:i.logger};return{...i,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??(0,s.Z)(Ut.$,o),bodyLengthChecker:t?.bodyLengthChecker??Ht.n,defaultUserAgentProvider:t?.defaultUserAgentProvider??(0,zt.pf)({serviceId:i.serviceId,clientVersion:Mt.rE}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4")||(async e=>await t.credentialDefaultProvider(e?.o||{})()),signer:new Lt.f2},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Kt.m}],maxAttempts:t?.maxAttempts??(0,s.Z)(Pt.qs,t),region:t?.region??(0,s.Z)(r.GG,{...r.zH,...o}),requestHandler:Bt.$.create(t?.requestHandler??n),retryMode:t?.retryMode??(0,s.Z)({...Pt.kN,default:async()=>(await n()).retryMode||Zt.L0},t),sha256:t?.sha256??Yt.V.bind(null,"sha256"),streamCollector:t?.streamCollector??Gt.k,useDualstackEndpoint:t?.useDualstackEndpoint??(0,s.Z)(Vt.e$,o),useFipsEndpoint:t?.useFipsEndpoint??(0,s.Z)(qt.Ko,o),userAgentAppId:t?.userAgentAppId??(0,s.Z)(Wt.hV,o)}};var hi=n(130),pi=n(131),mi=n(132);class gi extends Dt.K{config;constructor(...[t]){const e=fi(t||{});super(e),this.initConfig=e;const n=(i=e,Object.assign(i,{useDualstackEndpoint:i.useDualstackEndpoint??!1,useFipsEndpoint:i.useFipsEndpoint??!1,useGlobalEndpoint:i.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var i;const r=(0,yt.D)(n),s=(0,Pt.$z)(r),o=(0,vt.T)(s),a=(0,gt.OV)(o),c=(0,$t.C)(a),u=((t,e)=>{const n=Object.assign((0,hi.R)(t),(0,mi.xA)(t),(0,pi.e)(t),(t=>{const e=t.httpAuthSchemes;let n=t.httpAuthSchemeProvider,i=t.credentials;return{setHttpAuthScheme(t){const n=e.findIndex(e=>e.schemeId===t.schemeId);-1===n?e.push(t):e.splice(n,1,t)},httpAuthSchemes:()=>e,setHttpAuthSchemeProvider(t){n=t},httpAuthSchemeProvider:()=>n,setCredentials(t){i=t},credentials:()=>i}})(t));return e.forEach(t=>t.configure(n)),Object.assign(t,(0,hi.$)(n),(0,mi.uv)(n),(0,pi.j)(n),{httpAuthSchemes:(i=n).httpAuthSchemes(),httpAuthSchemeProvider:i.httpAuthSchemeProvider(),credentials:i.credentials()});var i})(jt(c),t?.extensions||[]);this.config=u,this.middlewareStack.use((0,Tt.wq)(this.config)),this.middlewareStack.use((0,xt.sM)(this.config)),this.middlewareStack.use((0,Nt.ey)(this.config)),this.middlewareStack.use((0,At.vK)(this.config)),this.middlewareStack.use((0,gt.TC)(this.config)),this.middlewareStack.use((0,wt.Y7)(this.config)),this.middlewareStack.use((0,Et.n)(this.config)),this.middlewareStack.use((0,bt.w)(this.config,{httpAuthSchemeParametersProvider:Ot,identityProviderConfigProvider:async t=>new St.h({"aws.auth#sigv4":t.credentials})})),this.middlewareStack.use((0,It.l)(this.config))}destroy(){super.destroy()}}const wi=(t,e)=>e?class extends t{constructor(t){super(t);for(const t of e)this.middlewareStack.use(t)}}:t,Ei=(t={},e)=>ht(t,wi(gi,e)),yi=(t={},e)=>pt(t,wi(gi,e))},848(t,e,n){function i(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}n.d(e,{$:()=>i})},849(t,e,n){n.d(e,{k:()=>b});var i=n(108),r=n(847);const s="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",o="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",u="(\\d{4})",l=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),d=new RegExp(`^${s}, ${c} ${o} ${u} ${a} GMT$`),f=new RegExp(`^${s}, ${c}-${o}-(\\d\\d) ${a} GMT$`),h=new RegExp(`^${s} ${o} ( [1-9]|\\d\\d) ${a} ${u}$`),p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(t,e,n){const i=Number(t);if(i<e||i>n)throw new Error(`Value ${i} out of range [${e}, ${n}]`)}var g=n(124),w=n(125),E=n(112),y=n(114),x=n(117),v=n(122);class b extends x.f{settings;constructor(t){super(),this.settings=t}read(t,e){const n=i.l.of(t);if(n.isListSchema())return(0,r.G)(e).map(t=>this.read(n.getValueSchema(),t));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??E.E)(e);if(n.isTimestampSchema()){switch((0,v.V)(n,this.settings)){case 5:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC3339 timestamps must be strings");const e=l.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);const[,n,i,r,s,o,a,,c,u]=e;m(i,1,12),m(r,1,31),m(s,0,23),m(o,0,59),m(a,0,60);const d=new Date(Date.UTC(Number(n),Number(i)-1,Number(r),Number(s),Number(o),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(d.setUTCFullYear(Number(n)),"Z"!=u.toUpperCase()){const[,t,e,n]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],i="-"===t?1:-1;d.setTime(d.getTime()+i*(60*Number(e)*60*1e3+60*Number(n)*1e3))}return d})(e);case 6:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC7231 timestamps must be strings.");let e,n,i,r,s,o,a,c;if((c=d.exec(t))?[,e,n,i,r,s,o,a]=c:(c=f.exec(t))?([,e,n,i,r,s,o,a]=c,i=(Number(i)+1900).toString()):(c=h.exec(t))&&([,n,e,r,s,o,a,i]=c),i&&o){const t=Date.UTC(Number(i),p.indexOf(n),Number(e),Number(r),Number(s),Number(o),a?Math.round(1e3*parseFloat(`0.${a}`)):0);m(e,1,31),m(r,0,23),m(s,0,59),m(o,0,60);const c=new Date(t);return c.setUTCFullYear(Number(i)),c}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)})(e);case 7:return(t=>{if(null==t)return;let e=NaN;if("number"==typeof t)e=t;else if("string"==typeof t){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else"object"==typeof t&&1===t.tag&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*e))})(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}}if(n.isStringSchema()){const t=n.getMergedTraits().mediaType;let i=e;if(t){n.getMergedTraits().httpHeader&&(i=this.base64ToUtf8(i));return("application/json"===t||t.endsWith("+json"))&&(i=g.A.from(i)),i}}return n.isNumericSchema()?Number(e):n.isBigIntegerSchema()?BigInt(e):n.isBigDecimalSchema()?new w.D(e,"bigDecimal"):n.isBooleanSchema()?"true"===String(e).toLowerCase():e}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??y.P)((this.serdeContext?.base64Decoder??E.E)(t))}}},847(t,e,n){n.d(e,{G:()=>i});const i=t=>{const e=t.length,n=[];let i,r=!1,s=0;for(let o=0;o<e;++o){const e=t[o];switch(e){case'"':"\\"!==i&&(r=!r);break;case",":r||(n.push(t.slice(s,o)),s=o+1)}i=e}return n.push(t.slice(s)),n.map(t=>{const e=(t=t.trim()).length;return e<2?t:('"'===t[0]&&'"'===t[e-1]&&(t=t.slice(1,e-1)),t.replace(/\\"/g,'"'))})}},850(t,e,n){n.d(e,{m:()=>i});class i{async sign(t,e,n){return t}}},845(t){t.exports={rE:"3.996.6"}}};
|
|
3
3
|
//# sourceMappingURL=827.index.js.map
|
package/dist/905.index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";exports.id=905,exports.ids=[905],exports.modules={846(e,t,r){r.d(t,{Y:()=>B});var n=r(108),s=r(110);function o(e,t,r){if(r<=0||!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const n=e.split(t);if(1===r)return n;const s=[];let o="";for(let e=0;e<n.length;e++)""===o?o=n[e]:o+=t+n[e],(e+1)%r===0&&(s.push(o),o="");return""!==o&&s.push(o),s}var i=r(847),a=r(33),c=r(842),u=r(111),f=r(848),l=r(115);class h extends l.t{async serializeRequest(e,t,r){const o={...t??{}},i=this.serializer,c={},u={},l=await r.endpoint(),h=n.l.of(e?.input),d=[],w=[];let m,p=!1;const b=new a.K({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:c,headers:u,body:void 0});if(l){this.updateServiceEndpoint(b,l),this.setHostPrefix(b,e,o);const t=(0,s.c)(e.traits);if(t.http){b.method=t.http[0];const[e,r]=t.http[1].split("?");"/"==b.path?b.path=e:b.path+=e;const n=new URLSearchParams(r??"");Object.assign(c,Object.fromEntries(n))}}for(const[e,t]of h.structIterator()){const r=t.getMergedTraits()??{},n=o[e];if(null!=n||t.isIdempotencyToken())if(r.httpPayload){if(t.isStreaming()){t.isStructSchema()?o[e]&&(m=await this.serializeEventStream({eventStream:o[e],requestSchema:h})):m=n}else i.write(t,n),m=i.flush();delete o[e]}else if(r.httpLabel){i.write(t,n);const r=i.flush();b.path.includes(`{${e}+}`)?b.path=b.path.replace(`{${e}+}`,r.split("/").map(f.$).join("/")):b.path.includes(`{${e}}`)&&(b.path=b.path.replace(`{${e}}`,(0,f.$)(r))),delete o[e]}else if(r.httpHeader)i.write(t,n),u[r.httpHeader.toLowerCase()]=String(i.flush()),delete o[e];else if("string"==typeof r.httpPrefixHeaders){for(const[e,s]of Object.entries(n)){const n=r.httpPrefixHeaders+e;i.write([t.getValueSchema(),{httpHeader:n}],s),u[n.toLowerCase()]=i.flush()}delete o[e]}else r.httpQuery||r.httpQueryParams?(this.serializeQuery(t,n,c),delete o[e]):(p=!0,d.push(e),w.push(t));else if(r.httpLabel&&(b.path.includes(`{${e}+}`)||b.path.includes(`{${e}}`)))throw new Error(`No value provided for input HTTP label: ${e}.`)}if(p&&o){const[e,t]=(h.getName(!0)??"#Unknown").split("#"),r=h.getSchema()[6],n=[3,e,t,h.getMergedTraits(),d,w,void 0];r?n[6]=r:n.pop(),i.write(n,o),m=i.flush()}return b.headers=u,b.query=c,b.body=m,b}serializeQuery(e,t,r){const n=this.serializer,s=e.getMergedTraits();if(s.httpQueryParams){for(const[n,o]of Object.entries(t))if(!(n in r)){const t=e.getValueSchema();Object.assign(t.getMergedTraits(),{...s,httpQuery:n,httpQueryParams:void 0}),this.serializeQuery(t,o,r)}}else if(e.isListSchema()){const o=!!e.getMergedTraits().sparse,i=[];for(const r of t){n.write([e.getValueSchema(),s],r);const t=n.flush();(o||void 0!==t)&&i.push(t)}r[s.httpQuery]=i}else n.write([e,s],t),r[s.httpQuery]=n.flush()}async deserializeResponse(e,t,r){const s=this.deserializer,o=n.l.of(e.output),i={};if(r.statusCode>=300){const n=await(0,u.P)(r.body,t);throw n.byteLength>0&&Object.assign(i,await s.read(15,n)),await this.handleError(e,t,r,i,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const e in r.headers){const t=r.headers[e];delete r.headers[e],r.headers[e.toLowerCase()]=t}const a=await this.deserializeHttpMessage(o,t,r,i);if(a.length){const e=await(0,u.P)(r.body,t);if(e.byteLength>0){const t=await s.read(o,e);for(const e of a)null!=t[e]&&(i[e]=t[e])}}else a.discardResponseBody&&await(0,u.P)(r.body,t);return i.$metadata=this.deserializeMetadata(r),i}async deserializeHttpMessage(e,t,r,s,a){let f;f=s instanceof Set?a:s;let l=!0;const h=this.deserializer,d=n.l.of(e),w=[];for(const[e,n]of d.structIterator()){const s=n.getMemberTraits();if(s.httpPayload){l=!1;if(n.isStreaming()){const t=n.isStructSchema();f[e]=t?await this.deserializeEventStream({response:r,responseSchema:d}):(0,c.c)(r.body)}else if(r.body){const s=await(0,u.P)(r.body,t);s.byteLength>0&&(f[e]=await h.read(n,s))}}else if(s.httpHeader){const t=String(s.httpHeader).toLowerCase(),a=r.headers[t];if(null!=a)if(n.isListSchema()){const r=n.getValueSchema();let s;r.getMergedTraits().httpHeader=t,s=r.isTimestampSchema()&&4===r.getSchema()?o(a,",",2):(0,i.G)(a);const c=[];for(const e of s)c.push(await h.read(r,e.trim()));f[e]=c}else f[e]=await h.read(n,a)}else if(void 0!==s.httpPrefixHeaders){f[e]={};for(const[t,o]of Object.entries(r.headers))if(t.startsWith(s.httpPrefixHeaders)){const r=n.getValueSchema();r.getMergedTraits().httpHeader=t,f[e][t.slice(s.httpPrefixHeaders.length)]=await h.read(r,o)}}else s.httpResponseCode?f[e]=r.statusCode:w.push(e)}return w.discardResponseBody=l,w}}var d=r(123);function w(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}var m=r(124),p=r(76),b=r(113),y=r(117),g=r(122);class v extends y.f{settings;stringBuffer="";constructor(e){super(),this.settings=e}write(e,t){const r=n.l.of(e);switch(typeof t){case"object":if(null===t)return void(this.stringBuffer="null");if(r.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch((0,g.V)(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=(0,d.JV)(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in t)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??b.n)(t));if(r.isListSchema()&&Array.isArray(t)){let e="";for(const n of t){this.write([r.getValueSchema(),r.getMergedTraits()],n);const t=this.flush();""!==e&&(e+=", "),e+=r.getValueSchema().isTimestampSchema()?t:w(t)}return void(this.stringBuffer=e)}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":const e=r.getMergedTraits().mediaType;let n=t;if(e){if(("application/json"===e||e.endsWith("+json"))&&(n=m.A.from(n)),r.getMergedTraits().httpHeader)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??b.n)(n.toString()))}this.stringBuffer=t;break;default:r.isIdempotencyToken()?this.stringBuffer=(0,p.v4)():this.stringBuffer=String(t)}}flush(){const e=this.stringBuffer;return this.stringBuffer="",e}}class ${codecSerializer;stringSerializer;buffer;constructor(e,t,r=new v(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){const r=n.l.of(e),s=r.getMergedTraits();return s.httpHeader||s.httpLabel||s.httpQuery?(this.stringSerializer.write(r,t),void(this.buffer=this.stringSerializer.flush())):this.codecSerializer.write(r,t)}flush(){if(void 0!==this.buffer){const e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}var E=r(114),N=r(83),S=r(849);class T extends y.f{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new S.k(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){const r=n.l.of(e),s=r.getMergedTraits(),o=this.serdeContext?.utf8Encoder??E.P;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,o(t));if(s.httpPayload){if(r.isBlobSchema()){const e=this.serdeContext?.utf8Decoder??N.a;return"string"==typeof t?e(t):t}if(r.isStringSchema())return"byteLength"in t?o(t):t}return this.codecDeserializer.read(r,t)}}var x=r(116),R=r(118),D=r(120),j=r(127);class B extends h{serializer;deserializer;codec;mixin=new R.U;constructor({defaultNamespace:e}){super({defaultNamespace:e});const t={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new D.V(t),this.serializer=new $(this.codec.createSerializer(),t),this.deserializer=new T(this.codec.createDeserializer(),t)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,r){const s=await super.serializeRequest(e,t,r),o=n.l.of(e.input);if(!s.headers["content-type"]){const e=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);e&&(s.headers["content-type"]=e)}return null==s.body&&s.headers["content-type"]===this.getDefaultContentType()&&(s.body="{}"),s}async deserializeResponse(e,t,r){const s=await super.deserializeResponse(e,t,r),o=n.l.of(e.output);for(const[e,t]of o.structIterator())t.getMemberTraits().httpPayload&&!(e in s)&&(s[e]=null);return s}async handleError(e,t,r,s,o){const i=(0,j.cJ)(r,s)??"Unknown",{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,r,s,o),u=n.l.of(a),f=s.message??s.Message??"Unknown",l=new(x.O.for(a[1]).getErrorCtor(a)??Error)(f);await this.deserializeHttpMessage(a,t,r,s);const h={};for(const[e,t]of u.structIterator()){const r=t.getMergedTraits().jsonName??e;h[e]=this.codec.createDeserializer().readObject(t,s[r])}throw this.mixin.decorateServiceException(Object.assign(l,c,{$fault:u.getMergedTraits().error,message:f},h),s)}getDefaultContentType(){return"application/json"}}},848(e,t,r){function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>n})},849(e,t,r){r.d(t,{k:()=>E});var n=r(108),s=r(847);const o="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",i="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",u="(\\d{4})",f=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),l=new RegExp(`^${o}, ${c} ${i} ${u} ${a} GMT$`),h=new RegExp(`^${o}, ${c}-${i}-(\\d\\d) ${a} GMT$`),d=new RegExp(`^${o} ${i} ( [1-9]|\\d\\d) ${a} ${u}$`),w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(e,t,r){const n=Number(e);if(n<t||n>r)throw new Error(`Value ${n} out of range [${t}, ${r}]`)}var p=r(124),b=r(125),y=r(112),g=r(114),v=r(117),$=r(122);class E extends v.f{settings;constructor(e){super(),this.settings=e}read(e,t){const r=n.l.of(e);if(r.isListSchema())return(0,s.G)(t).map(e=>this.read(r.getValueSchema(),e));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??y.E)(t);if(r.isTimestampSchema()){switch((0,$.V)(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC3339 timestamps must be strings");const t=f.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,n,s,o,i,a,,c,u]=t;m(n,1,12),m(s,1,31),m(o,0,23),m(i,0,59),m(a,0,60);const l=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(o),Number(i),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(l.setUTCFullYear(Number(r)),"Z"!=u.toUpperCase()){const[,e,t,r]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],n="-"===e?1:-1;l.setTime(l.getTime()+n*(60*Number(t)*60*1e3+60*Number(r)*1e3))}return l})(t);case 6:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC7231 timestamps must be strings.");let t,r,n,s,o,i,a,c;if((c=l.exec(e))?[,t,r,n,s,o,i,a]=c:(c=h.exec(e))?([,t,r,n,s,o,i,a]=c,n=(Number(n)+1900).toString()):(c=d.exec(e))&&([,r,t,s,o,i,a,n]=c),n&&i){const e=Date.UTC(Number(n),w.indexOf(r),Number(t),Number(s),Number(o),Number(i),a?Math.round(1e3*parseFloat(`0.${a}`)):0);m(t,1,31),m(s,0,23),m(o,0,59),m(i,0,60);const c=new Date(e);return c.setUTCFullYear(Number(n)),c}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)})(t);case 7:return(e=>{if(null==e)return;let t=NaN;if("number"==typeof e)t=e;else if("string"==typeof e){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else"object"==typeof e&&1===e.tag&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*t))})(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}}if(r.isStringSchema()){const e=r.getMergedTraits().mediaType;let n=t;if(e){r.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n));return("application/json"===e||e.endsWith("+json"))&&(n=p.A.from(n)),n}}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new b.D(t,"bigDecimal"):r.isBooleanSchema()?"true"===String(t).toLowerCase():t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??g.P)((this.serdeContext?.base64Decoder??y.E)(e))}}},847(e,t,r){r.d(t,{G:()=>n});const n=e=>{const t=e.length,r=[];let n,s=!1,o=0;for(let i=0;i<t;++i){const t=e[i];switch(t){case'"':"\\"!==n&&(s=!s);break;case",":s||(r.push(e.slice(o,i)),o=i+1)}n=t}return r.push(e.slice(o)),r.map(e=>{const t=(e=e.trim()).length;return t<2?e:('"'===e[0]&&'"'===e[t-1]&&(e=e.slice(1,t-1)),e.replace(/\\"/g,'"'))})}},850(e,t,r){r.d(t,{m:()=>n});class n{async sign(e,t,r){return e}}},842(e,t,r){r.d(t,{c:()=>p});var n=r(100),s=r(84),o=r(8),i=r(112);const a=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(2!==n.readyState)return r(new Error("Reader aborted too early"));const e=n.result??"",s=e.indexOf(","),o=s>-1?s+1:e.length;t(e.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}(e),r=(0,i.E)(t);return new Uint8Array(r)}(e):async function(e){const t=[],r=e.getReader();let n=!1,s=0;for(;!n;){const{done:e,value:o}=await r.read();o&&(t.push(o),s+=o.length),n=e}const o=new Uint8Array(s);let i=0;for(const e of t)o.set(e,i),i+=e.length;return o}(e);var c=r(113),u=r(81),f=r(114);const l=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),h="The stream has already been transformed.",d=e=>{if(!w(e)&&!l(e)){throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(h);return t=!0,await a(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if("base64"===e)return(0,c.n)(t);if("hex"===e)return(0,u.n)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(0,f.P)(t);if("function"==typeof TextDecoder)return new TextDecoder(e).decode(t);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(h);if(t=!0,w(e))return(e=>{if("function"!=typeof e.stream)throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return e.stream()})(e);if(l(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},w=e=>"function"==typeof Blob&&e instanceof Blob,m="The stream has already been transformed.",p=e=>{if(!(e instanceof o.Readable))try{return d(e)}catch(t){throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(m);return t=!0,await(0,n.k)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if(void 0===e||Buffer.isEncoding(e))return(0,s.Q)(t.buffer,t.byteOffset,t.byteLength).toString(e);return new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw new Error(m);if(null!==e.readableFlowing)throw new Error("The stream has been consumed by other callbacks.");if("function"!=typeof o.Readable.toWeb)throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,o.Readable.toWeb(e)}})}},845(e){e.exports={rE:"3.996.3"}}};
|
|
2
|
+
"use strict";exports.id=905,exports.ids=[905],exports.modules={846(e,t,r){r.d(t,{Y:()=>B});var n=r(108),s=r(110);function o(e,t,r){if(r<=0||!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const n=e.split(t);if(1===r)return n;const s=[];let o="";for(let e=0;e<n.length;e++)""===o?o=n[e]:o+=t+n[e],(e+1)%r===0&&(s.push(o),o="");return""!==o&&s.push(o),s}var i=r(847),a=r(33),c=r(842),u=r(111),f=r(848),l=r(115);class h extends l.t{async serializeRequest(e,t,r){const o={...t??{}},i=this.serializer,c={},u={},l=await r.endpoint(),h=n.l.of(e?.input),d=[],w=[];let m,p=!1;const b=new a.K({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:c,headers:u,body:void 0});if(l){this.updateServiceEndpoint(b,l),this.setHostPrefix(b,e,o);const t=(0,s.c)(e.traits);if(t.http){b.method=t.http[0];const[e,r]=t.http[1].split("?");"/"==b.path?b.path=e:b.path+=e;const n=new URLSearchParams(r??"");Object.assign(c,Object.fromEntries(n))}}for(const[e,t]of h.structIterator()){const r=t.getMergedTraits()??{},n=o[e];if(null!=n||t.isIdempotencyToken())if(r.httpPayload){if(t.isStreaming()){t.isStructSchema()?o[e]&&(m=await this.serializeEventStream({eventStream:o[e],requestSchema:h})):m=n}else i.write(t,n),m=i.flush();delete o[e]}else if(r.httpLabel){i.write(t,n);const r=i.flush();b.path.includes(`{${e}+}`)?b.path=b.path.replace(`{${e}+}`,r.split("/").map(f.$).join("/")):b.path.includes(`{${e}}`)&&(b.path=b.path.replace(`{${e}}`,(0,f.$)(r))),delete o[e]}else if(r.httpHeader)i.write(t,n),u[r.httpHeader.toLowerCase()]=String(i.flush()),delete o[e];else if("string"==typeof r.httpPrefixHeaders){for(const[e,s]of Object.entries(n)){const n=r.httpPrefixHeaders+e;i.write([t.getValueSchema(),{httpHeader:n}],s),u[n.toLowerCase()]=i.flush()}delete o[e]}else r.httpQuery||r.httpQueryParams?(this.serializeQuery(t,n,c),delete o[e]):(p=!0,d.push(e),w.push(t));else if(r.httpLabel&&(b.path.includes(`{${e}+}`)||b.path.includes(`{${e}}`)))throw new Error(`No value provided for input HTTP label: ${e}.`)}if(p&&o){const[e,t]=(h.getName(!0)??"#Unknown").split("#"),r=h.getSchema()[6],n=[3,e,t,h.getMergedTraits(),d,w,void 0];r?n[6]=r:n.pop(),i.write(n,o),m=i.flush()}return b.headers=u,b.query=c,b.body=m,b}serializeQuery(e,t,r){const n=this.serializer,s=e.getMergedTraits();if(s.httpQueryParams){for(const[n,o]of Object.entries(t))if(!(n in r)){const t=e.getValueSchema();Object.assign(t.getMergedTraits(),{...s,httpQuery:n,httpQueryParams:void 0}),this.serializeQuery(t,o,r)}}else if(e.isListSchema()){const o=!!e.getMergedTraits().sparse,i=[];for(const r of t){n.write([e.getValueSchema(),s],r);const t=n.flush();(o||void 0!==t)&&i.push(t)}r[s.httpQuery]=i}else n.write([e,s],t),r[s.httpQuery]=n.flush()}async deserializeResponse(e,t,r){const s=this.deserializer,o=n.l.of(e.output),i={};if(r.statusCode>=300){const n=await(0,u.P)(r.body,t);throw n.byteLength>0&&Object.assign(i,await s.read(15,n)),await this.handleError(e,t,r,i,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const e in r.headers){const t=r.headers[e];delete r.headers[e],r.headers[e.toLowerCase()]=t}const a=await this.deserializeHttpMessage(o,t,r,i);if(a.length){const e=await(0,u.P)(r.body,t);if(e.byteLength>0){const t=await s.read(o,e);for(const e of a)null!=t[e]&&(i[e]=t[e])}}else a.discardResponseBody&&await(0,u.P)(r.body,t);return i.$metadata=this.deserializeMetadata(r),i}async deserializeHttpMessage(e,t,r,s,a){let f;f=s instanceof Set?a:s;let l=!0;const h=this.deserializer,d=n.l.of(e),w=[];for(const[e,n]of d.structIterator()){const s=n.getMemberTraits();if(s.httpPayload){l=!1;if(n.isStreaming()){const t=n.isStructSchema();f[e]=t?await this.deserializeEventStream({response:r,responseSchema:d}):(0,c.c)(r.body)}else if(r.body){const s=await(0,u.P)(r.body,t);s.byteLength>0&&(f[e]=await h.read(n,s))}}else if(s.httpHeader){const t=String(s.httpHeader).toLowerCase(),a=r.headers[t];if(null!=a)if(n.isListSchema()){const r=n.getValueSchema();let s;r.getMergedTraits().httpHeader=t,s=r.isTimestampSchema()&&4===r.getSchema()?o(a,",",2):(0,i.G)(a);const c=[];for(const e of s)c.push(await h.read(r,e.trim()));f[e]=c}else f[e]=await h.read(n,a)}else if(void 0!==s.httpPrefixHeaders){f[e]={};for(const[t,o]of Object.entries(r.headers))if(t.startsWith(s.httpPrefixHeaders)){const r=n.getValueSchema();r.getMergedTraits().httpHeader=t,f[e][t.slice(s.httpPrefixHeaders.length)]=await h.read(r,o)}}else s.httpResponseCode?f[e]=r.statusCode:w.push(e)}return w.discardResponseBody=l,w}}var d=r(123);function w(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}var m=r(124),p=r(76),b=r(113),y=r(117),g=r(122);class v extends y.f{settings;stringBuffer="";constructor(e){super(),this.settings=e}write(e,t){const r=n.l.of(e);switch(typeof t){case"object":if(null===t)return void(this.stringBuffer="null");if(r.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch((0,g.V)(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=(0,d.JV)(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in t)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??b.n)(t));if(r.isListSchema()&&Array.isArray(t)){let e="";for(const n of t){this.write([r.getValueSchema(),r.getMergedTraits()],n);const t=this.flush();""!==e&&(e+=", "),e+=r.getValueSchema().isTimestampSchema()?t:w(t)}return void(this.stringBuffer=e)}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":const e=r.getMergedTraits().mediaType;let n=t;if(e){if(("application/json"===e||e.endsWith("+json"))&&(n=m.A.from(n)),r.getMergedTraits().httpHeader)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??b.n)(n.toString()))}this.stringBuffer=t;break;default:r.isIdempotencyToken()?this.stringBuffer=(0,p.v4)():this.stringBuffer=String(t)}}flush(){const e=this.stringBuffer;return this.stringBuffer="",e}}class ${codecSerializer;stringSerializer;buffer;constructor(e,t,r=new v(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){const r=n.l.of(e),s=r.getMergedTraits();return s.httpHeader||s.httpLabel||s.httpQuery?(this.stringSerializer.write(r,t),void(this.buffer=this.stringSerializer.flush())):this.codecSerializer.write(r,t)}flush(){if(void 0!==this.buffer){const e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}var E=r(114),N=r(83),S=r(849);class T extends y.f{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new S.k(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){const r=n.l.of(e),s=r.getMergedTraits(),o=this.serdeContext?.utf8Encoder??E.P;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,o(t));if(s.httpPayload){if(r.isBlobSchema()){const e=this.serdeContext?.utf8Decoder??N.a;return"string"==typeof t?e(t):t}if(r.isStringSchema())return"byteLength"in t?o(t):t}return this.codecDeserializer.read(r,t)}}var x=r(116),R=r(118),D=r(120),j=r(127);class B extends h{serializer;deserializer;codec;mixin=new R.U;constructor({defaultNamespace:e}){super({defaultNamespace:e});const t={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new D.V(t),this.serializer=new $(this.codec.createSerializer(),t),this.deserializer=new T(this.codec.createDeserializer(),t)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,r){const s=await super.serializeRequest(e,t,r),o=n.l.of(e.input);if(!s.headers["content-type"]){const e=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);e&&(s.headers["content-type"]=e)}return null==s.body&&s.headers["content-type"]===this.getDefaultContentType()&&(s.body="{}"),s}async deserializeResponse(e,t,r){const s=await super.deserializeResponse(e,t,r),o=n.l.of(e.output);for(const[e,t]of o.structIterator())t.getMemberTraits().httpPayload&&!(e in s)&&(s[e]=null);return s}async handleError(e,t,r,s,o){const i=(0,j.cJ)(r,s)??"Unknown",{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,r,s,o),u=n.l.of(a),f=s.message??s.Message??"Unknown",l=new(x.O.for(a[1]).getErrorCtor(a)??Error)(f);await this.deserializeHttpMessage(a,t,r,s);const h={};for(const[e,t]of u.structIterator()){const r=t.getMergedTraits().jsonName??e;h[e]=this.codec.createDeserializer().readObject(t,s[r])}throw this.mixin.decorateServiceException(Object.assign(l,c,{$fault:u.getMergedTraits().error,message:f},h),s)}getDefaultContentType(){return"application/json"}}},848(e,t,r){function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>n})},849(e,t,r){r.d(t,{k:()=>E});var n=r(108),s=r(847);const o="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",i="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",u="(\\d{4})",f=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),l=new RegExp(`^${o}, ${c} ${i} ${u} ${a} GMT$`),h=new RegExp(`^${o}, ${c}-${i}-(\\d\\d) ${a} GMT$`),d=new RegExp(`^${o} ${i} ( [1-9]|\\d\\d) ${a} ${u}$`),w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(e,t,r){const n=Number(e);if(n<t||n>r)throw new Error(`Value ${n} out of range [${t}, ${r}]`)}var p=r(124),b=r(125),y=r(112),g=r(114),v=r(117),$=r(122);class E extends v.f{settings;constructor(e){super(),this.settings=e}read(e,t){const r=n.l.of(e);if(r.isListSchema())return(0,s.G)(t).map(e=>this.read(r.getValueSchema(),e));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??y.E)(t);if(r.isTimestampSchema()){switch((0,$.V)(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC3339 timestamps must be strings");const t=f.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,n,s,o,i,a,,c,u]=t;m(n,1,12),m(s,1,31),m(o,0,23),m(i,0,59),m(a,0,60);const l=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(o),Number(i),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(l.setUTCFullYear(Number(r)),"Z"!=u.toUpperCase()){const[,e,t,r]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],n="-"===e?1:-1;l.setTime(l.getTime()+n*(60*Number(t)*60*1e3+60*Number(r)*1e3))}return l})(t);case 6:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC7231 timestamps must be strings.");let t,r,n,s,o,i,a,c;if((c=l.exec(e))?[,t,r,n,s,o,i,a]=c:(c=h.exec(e))?([,t,r,n,s,o,i,a]=c,n=(Number(n)+1900).toString()):(c=d.exec(e))&&([,r,t,s,o,i,a,n]=c),n&&i){const e=Date.UTC(Number(n),w.indexOf(r),Number(t),Number(s),Number(o),Number(i),a?Math.round(1e3*parseFloat(`0.${a}`)):0);m(t,1,31),m(s,0,23),m(o,0,59),m(i,0,60);const c=new Date(e);return c.setUTCFullYear(Number(n)),c}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)})(t);case 7:return(e=>{if(null==e)return;let t=NaN;if("number"==typeof e)t=e;else if("string"==typeof e){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else"object"==typeof e&&1===e.tag&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*t))})(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}}if(r.isStringSchema()){const e=r.getMergedTraits().mediaType;let n=t;if(e){r.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n));return("application/json"===e||e.endsWith("+json"))&&(n=p.A.from(n)),n}}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new b.D(t,"bigDecimal"):r.isBooleanSchema()?"true"===String(t).toLowerCase():t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??g.P)((this.serdeContext?.base64Decoder??y.E)(e))}}},847(e,t,r){r.d(t,{G:()=>n});const n=e=>{const t=e.length,r=[];let n,s=!1,o=0;for(let i=0;i<t;++i){const t=e[i];switch(t){case'"':"\\"!==n&&(s=!s);break;case",":s||(r.push(e.slice(o,i)),o=i+1)}n=t}return r.push(e.slice(o)),r.map(e=>{const t=(e=e.trim()).length;return t<2?e:('"'===e[0]&&'"'===e[t-1]&&(e=e.slice(1,t-1)),e.replace(/\\"/g,'"'))})}},850(e,t,r){r.d(t,{m:()=>n});class n{async sign(e,t,r){return e}}},842(e,t,r){r.d(t,{c:()=>p});var n=r(100),s=r(84),o=r(8),i=r(112);const a=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(2!==n.readyState)return r(new Error("Reader aborted too early"));const e=n.result??"",s=e.indexOf(","),o=s>-1?s+1:e.length;t(e.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}(e),r=(0,i.E)(t);return new Uint8Array(r)}(e):async function(e){const t=[],r=e.getReader();let n=!1,s=0;for(;!n;){const{done:e,value:o}=await r.read();o&&(t.push(o),s+=o.length),n=e}const o=new Uint8Array(s);let i=0;for(const e of t)o.set(e,i),i+=e.length;return o}(e);var c=r(113),u=r(81),f=r(114);const l=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),h="The stream has already been transformed.",d=e=>{if(!w(e)&&!l(e)){throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(h);return t=!0,await a(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if("base64"===e)return(0,c.n)(t);if("hex"===e)return(0,u.n)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(0,f.P)(t);if("function"==typeof TextDecoder)return new TextDecoder(e).decode(t);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(h);if(t=!0,w(e))return(e=>{if("function"!=typeof e.stream)throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return e.stream()})(e);if(l(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},w=e=>"function"==typeof Blob&&e instanceof Blob,m="The stream has already been transformed.",p=e=>{if(!(e instanceof o.Readable))try{return d(e)}catch(t){throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(m);return t=!0,await(0,n.k)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if(void 0===e||Buffer.isEncoding(e))return(0,s.Q)(t.buffer,t.byteOffset,t.byteLength).toString(e);return new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw new Error(m);if(null!==e.readableFlowing)throw new Error("The stream has been consumed by other callbacks.");if("function"!=typeof o.Readable.toWeb)throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,o.Readable.toWeb(e)}})}},845(e){e.exports={rE:"3.996.6"}}};
|
|
3
3
|
//# sourceMappingURL=905.index.js.map
|