@agentlang/lstudio 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/AwsJson1_1Protocol-DdIGyZVw.js +1 -0
- package/assets/{index-BUDkC9PO.js → fractl_coilot.gif} +0 -0
- package/assets/index-B3X6Xu-W.js +1 -0
- package/assets/index-BEhtjPxy-CBgP3wC4.js +1 -0
- package/assets/{index-DYmn2gQ6-CnjFa625.js → index-BdxSFemm-BKC3Ptjg.js} +1 -1
- package/assets/index-BjQNf7Nf.js +15 -0
- package/assets/index-Br2Hgz2q.js +1 -0
- package/assets/{index-D4z_hbl0-CwQgbRbr.js → index-CSAsH4Cj-CNgNYeys.js} +8 -8
- package/assets/{index-D8BKb7lj.js → index-CbTQ5dVq.js} +1 -1
- package/assets/index-ClUL-R5x.js +1 -0
- package/assets/{index-BFv-M3PX.js → index-CoCLR6CX.js} +5 -5
- package/assets/{index-BJBOx-Z---hbiLl7B.js → index-D3JO_TBD-DrqEk_TF.js} +3 -3
- package/assets/index-DB9kJcqZ.js +5166 -0
- package/assets/index-DSosZ5sh-_5CimrqR.js +1 -0
- package/assets/{index-BitrXVkV.js → index-DlfdnOJV.js} +1 -1
- package/assets/index-DzMfgnJU.css +1 -0
- package/assets/{index-ChvoNxcO.js → index-JiKw9JSs.js} +1 -1
- package/assets/{index-KGBiLwKE-Doz2tX9S.js → index-KGBiLwKE-Kc8k70rJ.js} +4 -4
- package/assets/index-ZTnKX8xy-BNOF_2FA.js +16952 -0
- package/assets/index-mwiGaNy1-DKNEoPya.js +17 -0
- package/assets/index-q0DdgLUs.js +1 -0
- package/assets/index.browser-ClkxIF_a.js +6 -0
- package/assets/inherits_browser-SFmLU6iN-Bpg6Btaw.js +6 -0
- package/assets/loadCognitoIdentity-D3DCDtA_.js +1 -0
- package/assets/loadSts-De9MppCU.js +1 -0
- package/assets/{normalizeProvider-CtDY37Q6.js → normalizeProvider-EC8cbfMc.js} +1 -1
- package/assets/replService-3_Zm3_kc.js +1 -0
- package/assets/util-COkob34j-BZ2TtJP8.js +10 -0
- package/assets/util-CsY--ROm-CHWqg22i.js +1 -0
- package/assets/winston-BSc_Rh2n-BqL-578K.js +46 -0
- package/assets/{winston-D4Q71yYt.js → winston-CPWYjGTE.js} +1 -1
- package/assets/winston-C_b7Zy4p.js +46 -0
- package/assets/winston-tM2NjUgP-Cgaf-Nmz.js +1 -0
- package/index.html +9 -11
- package/package.json +1 -1
- package/assets/_commonjs-dynamic-modules-DkOKMH7F.js +0 -1
- package/assets/_commonjsHelpers-B4e78b8K-W3E8ocG7.js +0 -1
- package/assets/index-69shuAsh-DF18H7zf.js +0 -1
- package/assets/index-BXMy9UIl.js +0 -1
- package/assets/index-Bg99gQMb.js +0 -1
- package/assets/index-Bto-kj6R-C0A_3Pwb.js +0 -1
- package/assets/index-DMSk22lf.js +0 -1
- package/assets/index-DSosZ5sh-Ceejs_jv.js +0 -1
- package/assets/index-DTNuphFO-Bf5Ad1xs.js +0 -17
- package/assets/index-DdJraFJK.css +0 -1
- package/assets/index-DsIu-45t-Bejjlpz4.js +0 -6
- package/assets/index-eSVhHUlz.js +0 -1
- package/assets/index.browser-IqzK7yLX.js +0 -6
- package/assets/inherits_browser-nmOknR35-Bp0mvRSL.js +0 -1
- package/assets/loadCognitoIdentity-DZYsZXkm.js +0 -1
- package/assets/loadSts-Uu1oEbAb.js +0 -1
- package/assets/replService-DYBg3SD8.js +0 -1
- package/assets/resolveDefaultsModeConfig-BgjUM3Xl.js +0 -15
- package/assets/util-CNqBjtt6-GUXK7Yxz.js +0 -10
- package/assets/util-D1toOuEo.js +0 -10
- package/assets/util-DZRIOW0Z-CproX86h.js +0 -1
- package/assets/winston-1qzyIKCb-D4XjUIEW.js +0 -37
- package/assets/winston-B4nPYpFF.js +0 -37
- package/assets/winston-CtxF18qc-BuhVd2xE.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as g,c as C,S as l,b as y,U as T,d as N,L as b,e as _,f as R,v as E,R as z,P as J,h as M,T as k}from"./index-BjQNf7Nf.js";import{t as j,a as D,p as I,b as O,c as A,d as S,e as B}from"./normalizeProvider-EC8cbfMc.js";function U(h,t,e){if(e?.source){const i=e.source;if(typeof t=="number"&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||i!==String(t)))return i.includes(".")?new g(i,"bigDecimal"):BigInt(i)}return t}const $=(h,t)=>C(h,t).then(e=>(t?.utf8Encoder??j)(e)),Q=(h,t)=>$(h,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(i){throw i?.name==="SyntaxError"&&Object.defineProperty(i,"$responseBodyText",{value:e}),i}return{}}),V=(h,t)=>{const e=(n,r)=>Object.keys(n).find(o=>o.toLowerCase()===r.toLowerCase()),i=n=>{let r=n;return typeof r=="number"&&(r=r.toString()),r.indexOf(",")>=0&&(r=r.split(",")[0]),r.indexOf(":")>=0&&(r=r.split(":")[0]),r.indexOf("#")>=0&&(r=r.split("#")[1]),r},s=e(h.headers,"x-amzn-errortype");if(s!==void 0)return i(h.headers[s]);if(t&&typeof t=="object"){const n=e(t,"code");if(n&&t[n]!==void 0)return i(t[n]);if(t.__type!==void 0)return i(t.__type)}};class L extends l{settings;constructor(t){super(),this.settings=t}async read(t,e){return this._read(t,typeof e=="string"?JSON.parse(e,U):await Q(e,this.serdeContext))}readObject(t,e){return this._read(t,e)}_read(t,e){const i=e!==null&&typeof e=="object",s=y.of(t);if(i){if(s.isStructSchema()){const r=e,o=s.isUnionSchema(),c={};let f;const{jsonName:a}=this.settings;a&&(f={});let u;o&&(u=new T(r,c));for(const[m,d]of N(s,r,a?"jsonName":!1)){let p=m;a&&(p=d.getMergedTraits().jsonName??p,f[p]=m),o&&u.mark(p),r[p]!=null&&(c[m]=this._read(d,r[p]))}if(o)u.writeUnknown();else if(typeof r.__type=="string")for(const[m,d]of Object.entries(r)){const p=a?f[m]??m:m;p in c||(c[p]=d)}return c}if(Array.isArray(e)&&s.isListSchema()){const r=s.getValueSchema(),o=[],c=!!s.getMergedTraits().sparse;for(const f of e)(c||f!=null)&&o.push(this._read(r,f));return o}if(s.isMapSchema()){const r=s.getValueSchema(),o={},c=!!s.getMergedTraits().sparse;for(const[f,a]of Object.entries(e))(c||a!=null)&&(o[f]=this._read(r,a));return o}}if(s.isBlobSchema()&&typeof e=="string")return D(e);const n=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof e=="string"&&n)return n==="application/json"||n.endsWith("+json")?b.from(e):e;if(s.isTimestampSchema()&&e!=null)switch(_(s,this.settings)){case 5:return A(e);case 6:return O(e);case 7:return I(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(s.isBigIntegerSchema()&&(typeof e=="number"||typeof e=="string"))return BigInt(e);if(s.isBigDecimalSchema()&&e!=null){if(e instanceof g)return e;const r=e;return r.type==="bigDecimal"&&"string"in r?new g(r.string,r.type):new g(String(e),"bigDecimal")}if(s.isNumericSchema()&&typeof e=="string"){switch(e){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return e}if(s.isDocumentSchema())if(i){const r=Array.isArray(e)?[]:{};for(const[o,c]of Object.entries(e))c instanceof g?r[o]=c:r[o]=this._read(s,c);return r}else return structuredClone(e);return e}}const w="Ν";class P{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(t,e)=>{if(e instanceof g){const i=`${w+"nv"+this.counter++}_`+e.string;return this.values.set(`"${i}"`,e.string),i}if(typeof e=="bigint"){const i=e.toString(),s=`${w+"b"+this.counter++}_`+i;return this.values.set(`"${s}"`,i),s}return e}}replaceInJson(t){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return t;for(const[e,i]of this.values)t=t.replace(e,i);return t}}class F extends l{settings;buffer;useReplacer=!1;rootSchema;constructor(t){super(),this.settings=t}write(t,e){this.rootSchema=y.of(t),this.buffer=this._write(this.rootSchema,e)}writeDiscriminatedDocument(t,e){this.write(t,e),typeof this.buffer=="object"&&(this.buffer.__type=y.of(t).getName(!0))}flush(){const{rootSchema:t,useReplacer:e}=this;if(this.rootSchema=void 0,this.useReplacer=!1,t?.isStructSchema()||t?.isDocumentSchema()){if(!e)return JSON.stringify(this.buffer);const i=new P;return i.replaceInJson(JSON.stringify(this.buffer,i.createReplacer(),0))}return this.buffer}_write(t,e,i){const s=e!==null&&typeof e=="object",n=y.of(t);if(s){if(n.isStructSchema()){const r=e,o={},{jsonName:c}=this.settings;let f;c&&(f={});for(const[a,u]of R(n,r)){const m=this._write(u,r[a],n);if(m!==void 0){let d=a;c&&(d=u.getMergedTraits().jsonName??a,f[a]=d),o[d]=m}}if(n.isUnionSchema()&&Object.keys(o).length===0){const{$unknown:a}=r;if(Array.isArray(a)){const[u,m]=a;o[u]=this._write(15,m)}}else if(typeof r.__type=="string")for(const[a,u]of Object.entries(r)){const m=c?f[a]??a:a;m in o||(o[m]=this._write(15,u))}return o}if(Array.isArray(e)&&n.isListSchema()){const r=n.getValueSchema(),o=[],c=!!n.getMergedTraits().sparse;for(const f of e)(c||f!=null)&&o.push(this._write(r,f));return o}if(n.isMapSchema()){const r=n.getValueSchema(),o={},c=!!n.getMergedTraits().sparse;for(const[f,a]of Object.entries(e))(c||a!=null)&&(o[f]=this._write(r,a));return o}if(e instanceof Uint8Array&&(n.isBlobSchema()||n.isDocumentSchema()))return n===this.rootSchema?e:(this.serdeContext?.base64Encoder??S)(e);if(e instanceof Date&&(n.isTimestampSchema()||n.isDocumentSchema()))switch(_(n,this.settings)){case 5:return e.toISOString().replace(".000Z","Z");case 6:return B(e);case 7:return e.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",e),e.getTime()/1e3}e instanceof g&&(this.useReplacer=!0)}if(!(e===null&&i?.isStructSchema())){if(n.isStringSchema()){if(typeof e>"u"&&n.isIdempotencyToken())return E();const r=n.getMergedTraits().mediaType;return e!=null&&r&&(r==="application/json"||r.endsWith("+json"))?b.from(e):e}if(typeof e=="number"&&n.isNumericSchema())return Math.abs(e)===1/0||isNaN(e)?String(e):e;if(typeof e=="string"&&n.isBlobSchema())return n===this.rootSchema?e:(this.serdeContext?.base64Encoder??S)(e);if(typeof e=="bigint"&&(this.useReplacer=!0),n.isDocumentSchema())if(s){const r=Array.isArray(e)?[]:{};for(const[o,c]of Object.entries(e))c instanceof g?(this.useReplacer=!0,r[o]=c):r[o]=this._write(n,c);return r}else return structuredClone(e);return e}}}class K extends l{settings;constructor(t){super(),this.settings=t}createSerializer(){const t=new F(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){const t=new L(this.settings);return t.setSerdeContext(this.serdeContext),t}}class q extends z{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:i,jsonCodec:s}){super({defaultNamespace:t}),this.serviceTarget=e,this.codec=s??new K({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!i,this.mixin=new J(this.awsQueryCompatible)}async serializeRequest(t,e,i){const s=await super.serializeRequest(t,e,i);return s.path.endsWith("/")||(s.path+="/"),Object.assign(s.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${t.name}`}),this.awsQueryCompatible&&(s.headers["x-amzn-query-mode"]="true"),(M(t.input)==="unit"||!s.body)&&(s.body="{}"),s}getPayloadCodec(){return this.codec}async handleError(t,e,i,s,n){this.awsQueryCompatible&&this.mixin.setQueryCompatError(s,i);const r=V(i,s)??"Unknown",{errorSchema:o,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(r,this.options.defaultNamespace,i,s,n,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),f=y.of(o),a=s.message??s.Message??"Unknown",u=k.for(o[1]).getErrorCtor(o)??Error,m=new u(a),d={};for(const[p,x]of f.structIterator())s[p]!=null&&(d[p]=this.codec.createDeserializer().readObject(x,s[p]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(s,d),this.mixin.decorateServiceException(Object.assign(m,c,{$fault:f.getMergedTraits().error,message:a},d),s)}}class Z extends q{constructor({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:i,jsonCodec:s}){super({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:i,jsonCodec:s})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}export{Z as A};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gt as k,l0 as M,jW as R,jZ as U,jM as N,l1 as S,kx as B,gv as q,l2 as D,l3 as L,k0 as E,l4 as _,kL as J,k$ as O,gs as T,l5 as H,kw as P,l6 as z,jY as G,l7 as W,jK as b,jJ as K,jN as Y,gu as Z,j_ as $,jU as Q,k2 as V,k8 as X,k7 as ee,jO as re,k6 as ae,k9 as te,kb as oe,j$ as ie,l8 as ne,jL as se}from"./index-ZTnKX8xy-BNOF_2FA.js";var w={},j;function he(){if(j)return w;j=1,w.byteLength=f,w.toByteArray=F,w.fromByteArray=x;for(var i=[],r=[],A=typeof Uint8Array<"u"?Uint8Array:Array,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,h=y.length;n<h;++n)i[n]=y[n],r[y.charCodeAt(n)]=n;r[45]=62,r[95]=63;function t(e){var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.indexOf("=");o===-1&&(o=a);var l=o===a?0:4-o%4;return[o,l]}function f(e){var a=t(e),o=a[0],l=a[1];return(o+l)*3/4-l}function g(e,a,o){return(a+o)*3/4-o}function F(e){var a,o=t(e),l=o[0],u=o[1],p=new A(g(e,l,u)),d=0,m=u>0?l-4:l,v;for(v=0;v<m;v+=4)a=r[e.charCodeAt(v)]<<18|r[e.charCodeAt(v+1)]<<12|r[e.charCodeAt(v+2)]<<6|r[e.charCodeAt(v+3)],p[d++]=a>>16&255,p[d++]=a>>8&255,p[d++]=a&255;return u===2&&(a=r[e.charCodeAt(v)]<<2|r[e.charCodeAt(v+1)]>>4,p[d++]=a&255),u===1&&(a=r[e.charCodeAt(v)]<<10|r[e.charCodeAt(v+1)]<<4|r[e.charCodeAt(v+2)]>>2,p[d++]=a>>8&255,p[d++]=a&255),p}function s(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[e&63]}function c(e,a,o){for(var l,u=[],p=a;p<o;p+=3)l=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),u.push(s(l));return u.join("")}function x(e){for(var a,o=e.length,l=o%3,u=[],p=16383,d=0,m=o-l;d<m;d+=p)u.push(c(e,d,d+p>m?m:d+p));return l===1?(a=e[o-1],u.push(i[a>>2]+i[a<<4&63]+"==")):l===2&&(a=(e[o-2]<<8)+e[o-1],u.push(i[a>>10]+i[a>>4&63]+i[a<<2&63]+"=")),u.join("")}return w}var C={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var I;function ce(){return I||(I=1,C.read=function(i,r,A,y,n){var h,t,f=n*8-y-1,g=(1<<f)-1,F=g>>1,s=-7,c=A?n-1:0,x=A?-1:1,e=i[r+c];for(c+=x,h=e&(1<<-s)-1,e>>=-s,s+=f;s>0;h=h*256+i[r+c],c+=x,s-=8);for(t=h&(1<<-s)-1,h>>=-s,s+=y;s>0;t=t*256+i[r+c],c+=x,s-=8);if(h===0)h=1-F;else{if(h===g)return t?NaN:(e?-1:1)*(1/0);t=t+Math.pow(2,y),h=h-F}return(e?-1:1)*t*Math.pow(2,h-y)},C.write=function(i,r,A,y,n,h){var t,f,g,F=h*8-n-1,s=(1<<F)-1,c=s>>1,x=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,e=y?0:h-1,a=y?1:-1,o=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,t=s):(t=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-t))<1&&(t--,g*=2),t+c>=1?r+=x/g:r+=x*Math.pow(2,1-c),r*g>=2&&(t++,g/=2),t+c>=s?(f=0,t=s):t+c>=1?(f=(r*g-1)*Math.pow(2,n),t=t+c):(f=r*Math.pow(2,c-1)*Math.pow(2,n),t=0));n>=8;i[A+e]=f&255,e+=a,f/=256,n-=8);for(t=t<<n|f,F+=n;F>0;i[A+e]=t&255,e+=a,t/=256,F-=8);i[A+e-a]|=o*128}),C}function le(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const fe=Object.freeze(Object.defineProperty({__proto__:null,EnvConfig:k,buildUISchemaSection:M,cloneDependencies:R,cloneRepository:U,commitChanges:N,createDefaultUISchema:S,createGitHubRepo:B,createGitUtils:q,createNavigation:D,fetchLatestChanges:L,findFilesWithExtension:E,forcePullChanges:_,getInputType:J,getNestedAttributeInfo:O,getURL:T,hasRemoteUpdates:H,initializeLocalRepository:P,invalidateEntitiesAndAgentsCache:z,loadUISchema:G,makeDirectory:W,openRepository:b,pathExists:K,pushChanges:Y,readRepoFile:Z,removeDirectory:$,repopulateUISchemaAfterAgentDeletion:Q,repopulateUISchemaAfterAttributeDeletion:V,repopulateUISchemaAfterEntityDeletion:X,repopulateUISchemaAfterRelationshipDeletion:ee,repopulateUISchemaForNewAgent:re,repopulateUISchemaForNewAttribute:ae,repopulateUISchemaForNewEntity:te,repopulateUISchemaForNewRelationship:oe,updateExistingRepository:ie,verifyClonedRepository:ne,writeRepoFile:se},Symbol.toStringTag,{value:"Module"}));export{ce as a,le as c,fe as i,he as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as q}from"./util-COkob34j-BZ2TtJP8.js";import"./index-ZTnKX8xy-BNOF_2FA.js";import"./preload-helper-BlTxHScW.js";import"./__vite-browser-external-DLjrMatA.js";import"./index-DSosZ5sh-_5CimrqR.js";import"./inherits_browser-SFmLU6iN-Bpg6Btaw.js";import"./index-D3JO_TBD-DrqEk_TF.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./index-JiKw9JSs.js";import"./_commonjsHelpers-D6-XlEtG.js";var p,d;function N(){if(d)return p;d=1;const c=q();class i{constructor(r,e){typeof r=="string"?this.#t(r):e!==void 0?this.#e(r,e):this.#r(r)}toPostgres(){const r=this.values,e=this.indices.map((s,n)=>c.format("%i:%f",s+1,r[n])).join(",");return c.format("{%s}/%d",e,this.dimensions)}toString(){return this.toPostgres()}toArray(){const r=Array(this.dimensions).fill(0);for(const[e,s]of this.indices.entries())r[s]=this.values[e];return r}#t(r){const e=r.split("/",2);this.dimensions=parseInt(e[1]),this.indices=[],this.values=[];const s=e[0].slice(1,-1).split(",");for(const n of s){const o=n.split(":",2);this.indices.push(parseInt(o[0])-1),this.values.push(parseFloat(o[1]))}}#r(r){this.dimensions=r.length,this.indices=[],this.values=[];for(const[e,s]of r.entries()){const n=Number(s);n!=0&&(this.indices.push(Number(e)),this.values.push(n))}}#e(r,e){this.dimensions=Number(e),this.indices=[],this.values=[];const s=r instanceof Map?r.entries():Object.entries(r);for(const[n,o]of s){const a=Number(o);a!=0&&(this.indices.push(Number(n)),this.values.push(a))}}}return p={SparseVector:i},p}var h,S;function A(){if(S)return h;S=1;const c=q(),{SparseVector:i}=N();function l(t){return t===null?null:t.substring(1,t.length-1).split(",").map(u=>parseFloat(u))}function r(t){return Array.isArray(t)?JSON.stringify(t.map(u=>Number(u))):t}const e=l,s=r;function n(t){return t===null?null:new i(t)}function o(t){return t instanceof i?t.toPostgres():t}function a(t){if(t===null)return null;if(t[0]=="[")return l(t);if(t[0]=="{")return n(t);throw new Error("invalid text representation")}function b(t){if(t===null)return null;if(Array.isArray(t))return r(t);if(t instanceof i)return o(t);throw new Error("expected array or sparse vector")}function f(t,u){if(u==null)return t;if(!Number.isInteger(u))throw new Error("expected integer");return c.format("%s(%d)",t,u)}function v(t){return f("vector",t)}function g(t){return f("halfvec",t)}function T(t){return f("bit",t)}function w(t){return f("sparsevec",t)}return h={fromSql:a,toSql:b,vectorFromSql:l,vectorToSql:r,halfvecFromSql:e,halfvecToSql:s,sparsevecFromSql:n,sparsevecToSql:o,sqlType:v,vectorType:v,halfvecType:g,bitType:T,sparsevecType:w,SparseVector:i},h}var m,y;function F(){if(y)return m;y=1;const{fromSql:c,toSql:i,SparseVector:l}=A();return m={fromSql:c,toSql:i,SparseVector:l},m}F();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as w,f as z}from"./index-
|
|
1
|
+
import{t as w,f as z}from"./index-mwiGaNy1-DKNEoPya.js";import"./preload-helper-BlTxHScW.js";import"./index-6mKfgpcs-DsgiI2lM.js";class E{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:i,serializer:n,deserializer:a,serdeContext:d,defaultContentType:u}){this.marshaller=i,this.serializer=n,this.deserializer=a,this.serdeContext=d,this.defaultContentType=u}async serializeEventStream({eventStream:i,requestSchema:n,initialRequest:a}){const d=this.marshaller,u=n.getEventStreamMember(),h=n.getMemberSchema(u),m=this.serializer,f=this.defaultContentType,p=Symbol("initialRequestMarker"),l={async*[Symbol.asyncIterator](){if(a){const t={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:f}};m.write(n,a);const e=m.flush();yield{[p]:!0,headers:t,body:e}}for await(const t of i)yield t}};return d.serialize(l,t=>{if(t[p])return{headers:t.headers,body:t.body};const e=Object.keys(t).find(r=>r!=="__type")??"",{additionalHeaders:s,body:o,eventType:c,explicitPayloadContentType:y}=this.writeEventBody(e,h,t);return{headers:{":event-type":{type:"string",value:c},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:y??f},...s},body:o}})}async deserializeEventStream({response:i,responseSchema:n,initialResponseContainer:a}){const d=this.marshaller,u=n.getEventStreamMember(),h=n.getMemberSchema(u).getMemberSchemas(),m=Symbol("initialResponseMarker"),f=d.deserialize(i.body,async t=>{const e=Object.keys(t).find(o=>o!=="__type")??"",s=t[e].body;if(e==="initial-response"){const o=await this.deserializer.read(n,s);return delete o[u],{[m]:!0,...o}}else if(e in h){const o=h[e];if(o.isStructSchema()){const c={};let y=!1;for(const[r,v]of o.structIterator()){const{eventHeader:b,eventPayload:g}=v.getMergedTraits();if(y=y||!!(b||g),g)v.isBlobSchema()?c[r]=s:v.isStringSchema()?c[r]=(this.serdeContext?.utf8Encoder??w)(s):v.isStructSchema()&&(c[r]=await this.deserializer.read(v,s));else if(b){const S=t[e].headers[r]?.value;S!=null&&(v.isNumericSchema()?S&&typeof S=="object"&&"bytes"in S?c[r]=BigInt(S.toString()):c[r]=Number(S):c[r]=S)}}if(y)return{[e]:c};if(s.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(o,s)}}else return{$unknown:t}}),p=f[Symbol.asyncIterator](),l=await p.next();if(l.done)return f;if(l.value?.[m]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[t,e]of Object.entries(l.value))a[t]=e}return{async*[Symbol.asyncIterator](){for(l?.value?.[m]||(yield l.value);;){const{done:t,value:e}=await p.next();if(t)break;yield e}}}}writeEventBody(i,n,a){const d=this.serializer;let u=i,h=null,m;const f=n.getSchema()[4].includes(i),p={};if(f){const t=n.getMemberSchema(i);if(t.isStructSchema()){for(const[e,s]of t.structIterator()){const{eventHeader:o,eventPayload:c}=s.getMergedTraits();if(c)h=e;else if(o){const y=a[i][e];let r="binary";s.isNumericSchema()?(-2)**31<=y&&y<=2**31-1?r="integer":r="long":s.isTimestampSchema()?r="timestamp":s.isStringSchema()?r="string":s.isBooleanSchema()&&(r="boolean"),y!=null&&(p[e]={type:r,value:y},delete a[i][e])}}if(h!==null){const e=t.getMemberSchema(h);e.isBlobSchema()?m="application/octet-stream":e.isStringSchema()&&(m="text/plain"),d.write(e,a[i][h])}else d.write(t,a[i])}else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[t,e]=a[i];u=t,d.write(15,e)}const l=d.flush();return{body:typeof l=="string"?(this.serdeContext?.utf8Decoder??z)(l):l,eventType:u,explicitPayloadContentType:m,additionalHeaders:p}}}export{E as EventStreamSerde};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DlfdnOJV.js","assets/normalizeProvider-EC8cbfMc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{f as J,a as It,d as _t,t as Ot,i as te,H as x,n as z,g as k,j as kt,k as X}from"./normalizeProvider-EC8cbfMc.js";import{_ as Mt}from"./preload-helper-BlTxHScW.js";const Pt=(t,e,r)=>{let s,n,i,a=!1;const u=async()=>{n||(n=t());try{s=await n,i=!0,a=!1}finally{n=void 0}return s};return async c=>((!i||c?.forceRefresh)&&(s=await u()),s)},Nn=t=>({setHttpHandler(e){t.httpHandler=e},httpHandler(){return t.httpHandler},updateHttpClientConfig(e,r){t.httpHandler?.updateHttpClientConfig(e,r)},httpHandlerConfigs(){return t.httpHandler.httpHandlerConfigs()}}),Dn=t=>({httpHandler:t.httpHandler()});var F;(function(t){t.HTTP="http",t.HTTPS="https"})(F||(F={}));var Z;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Z||(Z={}));const ge="__smithy_context",j=t=>typeof t=="string"?J(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),O=(t,e)=>{const r=[];if(t&&r.push(t),e)for(const s of e)r.push(s);return r},I=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,ee=()=>{let t=[],e=[],r=!1;const s=new Set,n=d=>d.sort((l,f)=>Ie[f.step]-Ie[l.step]||_e[f.priority||"normal"]-_e[l.priority||"normal"]),i=d=>{let l=!1;const f=m=>{const g=O(m.name,m.aliases);if(g.includes(d)){l=!0;for(const p of g)s.delete(p);return!1}return!0};return t=t.filter(f),e=e.filter(f),l},a=d=>{let l=!1;const f=m=>{if(m.middleware===d){l=!0;for(const g of O(m.name,m.aliases))s.delete(g);return!1}return!0};return t=t.filter(f),e=e.filter(f),l},u=d=>(t.forEach(l=>{d.add(l.middleware,{...l})}),e.forEach(l=>{d.addRelativeTo(l.middleware,{...l})}),d.identifyOnResolve?.(h.identifyOnResolve()),d),c=d=>{const l=[];return d.before.forEach(f=>{f.before.length===0&&f.after.length===0?l.push(f):l.push(...c(f))}),l.push(d),d.after.reverse().forEach(f=>{f.before.length===0&&f.after.length===0?l.push(f):l.push(...c(f))}),l},o=(d=!1)=>{const l=[],f=[],m={};return t.forEach(p=>{const y={...p,before:[],after:[]};for(const w of O(y.name,y.aliases))m[w]=y;l.push(y)}),e.forEach(p=>{const y={...p,before:[],after:[]};for(const w of O(y.name,y.aliases))m[w]=y;f.push(y)}),f.forEach(p=>{if(p.toMiddleware){const y=m[p.toMiddleware];if(y===void 0){if(d)return;throw new Error(`${p.toMiddleware} is not found when adding ${I(p.name,p.aliases)} middleware ${p.relation} ${p.toMiddleware}`)}p.relation==="after"&&y.after.push(p),p.relation==="before"&&y.before.push(p)}}),n(l).map(c).reduce((p,y)=>(p.push(...y),p),[])},h={add:(d,l={})=>{const{name:f,override:m,aliases:g}=l,p={step:"initialize",priority:"normal",middleware:d,...l},y=O(f,g);if(y.length>0){if(y.some(w=>s.has(w))){if(!m)throw new Error(`Duplicate middleware name '${I(f,g)}'`);for(const w of y){const T=t.findIndex(D=>D.name===w||D.aliases?.some(ne=>ne===w));if(T===-1)continue;const E=t[T];if(E.step!==p.step||p.priority!==E.priority)throw new Error(`"${I(E.name,E.aliases)}" middleware with ${E.priority} priority in ${E.step} step cannot be overridden by "${I(f,g)}" middleware with ${p.priority} priority in ${p.step} step.`);t.splice(T,1)}}for(const w of y)s.add(w)}t.push(p)},addRelativeTo:(d,l)=>{const{name:f,override:m,aliases:g}=l,p={middleware:d,...l},y=O(f,g);if(y.length>0){if(y.some(w=>s.has(w))){if(!m)throw new Error(`Duplicate middleware name '${I(f,g)}'`);for(const w of y){const T=e.findIndex(D=>D.name===w||D.aliases?.some(ne=>ne===w));if(T===-1)continue;const E=e[T];if(E.toMiddleware!==p.toMiddleware||E.relation!==p.relation)throw new Error(`"${I(E.name,E.aliases)}" middleware ${E.relation} "${E.toMiddleware}" middleware cannot be overridden by "${I(f,g)}" middleware ${p.relation} "${p.toMiddleware}" middleware.`);e.splice(T,1)}}for(const w of y)s.add(w)}e.push(p)},clone:()=>u(ee()),use:d=>{d.applyToStack(h)},remove:d=>typeof d=="string"?i(d):a(d),removeByTag:d=>{let l=!1;const f=m=>{const{tags:g,name:p,aliases:y}=m;if(g&&g.includes(d)){const w=O(p,y);for(const T of w)s.delete(T);return l=!0,!1}return!0};return t=t.filter(f),e=e.filter(f),l},concat:d=>{const l=u(ee());return l.use(d),l.identifyOnResolve(r||l.identifyOnResolve()||(d.identifyOnResolve?.()??!1)),l},applyToStack:u,identify:()=>o(!0).map(d=>{const l=d.step??d.relation+" "+d.toMiddleware;return I(d.name,d.aliases)+" - "+l}),identifyOnResolve(d){return typeof d=="boolean"&&(r=d),r},resolve:(d,l)=>{for(const f of o().map(m=>m.middleware).reverse())d=f(d,l);return r&&console.log(h.identify()),d}};return h},Ie={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},_e={high:3,normal:2,low:1};class Un{config;middlewareStack=ee();initConfig;handlers;constructor(e){this.config=e;const{protocol:r,protocolSettings:s}=e;s&&typeof r=="function"&&(e.protocol=new r(s))}send(e,r,s){const n=typeof r!="function"?r:void 0,i=typeof r=="function"?r:s,a=n===void 0&&this.config.cacheMiddleware===!0;let u;if(a){this.handlers||(this.handlers=new WeakMap);const c=this.handlers;c.has(e.constructor)?u=c.get(e.constructor):(u=e.resolveMiddleware(this.middlewareStack,this.config,n),c.set(e.constructor,u))}else delete this.handlers,u=e.resolveMiddleware(this.middlewareStack,this.config,n);if(i)u(e).then(c=>i(null,c.output),c=>i(c)).catch(()=>{});else return u(e).then(c=>c.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}class M extends Uint8Array{static fromString(e,r="utf-8"){if(typeof e=="string")return r==="base64"?M.mutate(It(e)):M.mutate(J(e));throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,M.prototype),e}transformToString(e="utf-8"){return e==="base64"?_t(this):Ot(this)}}const Oe=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return M.mutate(t);if(!t)return M.mutate(new Uint8Array);const r=e.streamCollector(t);return M.mutate(await r)},ie=t=>typeof t=="function"?t():t,G=t=>t[ge]||(t[ge]={}),P=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},et=(t,e,r,s,n)=>({name:e,namespace:t,traits:r,input:s,output:n}),$t=t=>(e,r)=>async s=>{const{response:n}=await e(s),{operationSchema:i}=G(r),[,a,u,c,o,h]=i??[];try{const d=await t.protocol.deserializeResponse(et(a,u,c,o,h),{...t,...r},n);return{response:n,output:d}}catch(d){if(Object.defineProperty(d,"$response",{value:n,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in d)){const l="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{d.message+=`
|
|
3
|
+
`+l}catch{!r.logger||r.logger?.constructor?.name==="NoOpLogger"?console.warn(l):r.logger?.warn?.(l)}typeof d.$responseBodyText<"u"&&d.$response&&(d.$response.body=d.$responseBodyText);try{if(te.isInstance(n)){const{headers:f={}}=n,m=Object.entries(f);d.$metadata={httpStatusCode:n.statusCode,requestId:ae(/^x-[\w-]+-request-?id$/,m),extendedRequestId:ae(/^x-[\w-]+-id-2$/,m),cfId:ae(/^x-[\w-]+-cf-id$/,m)}}}catch{}}throw d}},ae=(t,e)=>(e.find(([r])=>r.match(t))||[void 0,void 0])[1],Nt=t=>(e,r)=>async s=>{const{operationSchema:n}=G(r),[,i,a,u,c,o]=n??[],h=r.endpointV2?.url&&t.urlParser?async()=>t.urlParser(r.endpointV2.url):t.endpoint,d=await t.protocol.serializeRequest(et(i,a,u,c,o),s.input,{...t,...r,endpoint:h});return e({...s,request:d})},Dt={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Ut={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Ln(t){return{applyToStack:e=>{e.add(Nt(t),Ut),e.add($t(t),Dt),t.protocol.setSerdeContext(t)}}}function L(t){if(typeof t=="object")return t;t=t|0;const e={};let r=0;for(const s of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(t>>r++&1)===1&&(e[s]=1);return e}const ke={it:Symbol.for("@smithy/nor-struct-it")};class b{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=b.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,r){this.ref=e,this.memberName=r;const s=[];let n=e,i=e;for(this._isMemberSchema=!1;oe(n);)s.push(n[1]),n=n[0],i=ie(n),this._isMemberSchema=!0;if(s.length>0){this.memberTraits={};for(let a=s.length-1;a>=0;--a){const u=s[a];Object.assign(this.memberTraits,L(u))}}else this.memberTraits=0;if(i instanceof b){const a=this.memberTraits;Object.assign(this,i),this.memberTraits=Object.assign({},a,i.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??i.memberName;return}if(this.schema=ie(i),Lt(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(i),this.traits=0),this._isMemberSchema&&!r)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const r=this.prototype.isPrototypeOf(e);return!r&&typeof e=="object"&&e!==null?e.symbol===this.symbol:r}static of(e){const r=ie(e);if(r instanceof b)return r;if(oe(r)){const[s,n]=r;if(s instanceof b)return Object.assign(s.getMergedTraits(),L(n)),s;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}return new b(r)}getSchema(){const e=this.schema;return e[0]===0?e[4]:e}getName(e=!1){const{name:r}=this;return!e&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){const e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){const r=this.getSchema()[0];return r===3||r===-3||r===4}isUnionSchema(){return this.getSchema()[0]===4}isBlobSchema(){const e=this.getSchema();return e===21||e===42}isTimestampSchema(){const e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return L(this.memberTraits)}getOwnTraits(){return L(this.traits)}getKeySchema(){const[e,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!r)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const s=this.getSchema(),n=e?15:s[4]??0;return U([n,0],"key")}getValueSchema(){const e=this.getSchema(),[r,s,n]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],i=typeof e=="number"?63&e:e&&typeof e=="object"&&(s||n)?e[3+e[0]]:r?15:void 0;if(i!=null)return U([i,0],s?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const r=this.getSchema();if(this.isStructSchema()&&r[4].includes(e)){const s=r[4].indexOf(e),n=r[5][s];return U(oe(n)?n:[n,0],e)}if(this.isDocumentSchema())return U([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[r,s]of this.structIterator())e[r]=s}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema(),r=e[4].length;let s=e[ke.it];if(s&&r===s.length){yield*s;return}s=Array(r);for(let n=0;n<r;++n){const i=e[4][n],a=U([e[5][n],0],i);yield s[n]=[i,a]}e[ke.it]=s}}function U(t,e){if(t instanceof b)return Object.assign(t,{memberName:e,_isMemberSchema:!0});const r=b;return new r(t,e)}const oe=t=>Array.isArray(t)&&t.length===2,Lt=t=>Array.isArray(t)&&t.length>=5;class C{namespace;schemas;exceptions;static registries=new Map;constructor(e,r=new Map,s=new Map){this.namespace=e,this.schemas=r,this.exceptions=s}static for(e){return C.registries.has(e)||C.registries.set(e,new C(e)),C.registries.get(e)}register(e,r){const s=this.normalizeShapeId(e);C.for(s.split("#")[0]).schemas.set(s,r)}getSchema(e){const r=this.normalizeShapeId(e);if(!this.schemas.has(r))throw new Error(`@smithy/core/schema - schema not found for ${r}`);return this.schemas.get(r)}registerError(e,r){const s=e,n=C.for(s[1]);n.schemas.set(s[1]+"#"+s[2],s),n.exceptions.set(s,r)}getErrorCtor(e){const r=e;return C.for(r[1]).exceptions.get(r)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,r,s]=e,n=r+"#"+s;if(n.startsWith("smithy.ts.sdk.synthetic.")&&n.endsWith("ServiceException"))return e}}find(e){return[...this.schemas.values()].find(e)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}const Me=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),S=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0")),Ht=()=>{if(Me)return Me();const t=new Uint8Array(16);return crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128,S[t[0]]+S[t[1]]+S[t[2]]+S[t[3]]+"-"+S[t[4]]+S[t[5]]+"-"+S[t[6]]+S[t[7]]+"-"+S[t[8]]+S[t[9]]+"-"+S[t[10]]+S[t[11]]+S[t[12]]+S[t[13]]+S[t[14]]+S[t[15]]},$=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};$.from=t=>t&&typeof t=="object"&&(t instanceof $||"deserializeJSON"in t)?t:typeof t=="string"||Object.getPrototypeOf(t)===String.prototype?$(String(t)):$(JSON.stringify(t));$.fromObject=$.from;const Pe=/^-?\d*(\.\d+)?$/;class tt{string;type;constructor(e,r){if(this.string=e,this.type=r,!Pe.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const r=e;return tt.prototype.isPrototypeOf(e)||r.type==="bigDecimal"&&Pe.test(r.string)}}class zt{serdeContext;setSerdeContext(e){this.serdeContext=e}}class Bt extends zt{options;constructor(e){super(),this.options=e}getRequestType(){return x}getResponseType(){return te}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,r){if("url"in r){e.protocol=r.url.protocol,e.hostname=r.url.hostname,e.port=r.url.port?Number(r.url.port):void 0,e.path=r.url.pathname,e.fragment=r.url.hash||void 0,e.username=r.url.username||void 0,e.password=r.url.password||void 0,e.query||(e.query={});for(const[s,n]of r.url.searchParams.entries())e.query[s]=n;return e}else return e.protocol=r.protocol,e.hostname=r.hostname,e.port=r.port?Number(r.port):void 0,e.path=r.path,e.query={...r.query},e}setHostPrefix(e,r,s){if(this.serdeContext?.disableHostPrefix)return;const n=b.of(r.input),i=L(r.traits??{});if(i.endpoint){let a=i.endpoint?.[0];if(typeof a=="string"){const u=[...n.structIterator()].filter(([,c])=>c.getMergedTraits().hostLabel);for(const[c]of u){const o=s[c];if(typeof o!="string")throw new Error(`@smithy/core/schema - ${c} in input must be a string as hostLabel.`);a=a.replace(`{${c}}`,o)}e.hostname=a+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:r,initialRequest:s}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:r,initialRequest:s})}async deserializeEventStream({response:e,responseSchema:r,initialResponseContainer:s}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:r,initialResponseContainer:s})}async loadEventStreamCapability(){const{EventStreamSerde:e}=await Mt(async()=>{const{EventStreamSerde:r}=await import("./index-DlfdnOJV.js");return{EventStreamSerde:r}},__vite__mapDeps([0,1]));return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,r,s,n,i){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Hn extends Bt{async serializeRequest(e,r,s){const n=this.serializer,i={},a={},u=await s.endpoint(),c=b.of(e?.input),o=c.getSchema();let h;const d=new x({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:i,headers:a,body:void 0});u&&(this.updateServiceEndpoint(d,u),this.setHostPrefix(d,e,r));const l={...r};if(r){const f=c.getEventStreamMember();if(f){if(l[f]){const m={};for(const[g,p]of c.structIterator())g!==f&&l[g]&&(n.write(p,l[g]),m[g]=n.flush());h=await this.serializeEventStream({eventStream:l[f],requestSchema:c,initialRequest:m})}}else n.write(o,l),h=n.flush()}return d.headers=a,d.query=i,d.body=h,d.method="POST",d}async deserializeResponse(e,r,s){const n=this.deserializer,i=b.of(e.output),a={};if(s.statusCode>=300){const c=await Oe(s.body,r);throw c.byteLength>0&&Object.assign(a,await n.read(15,c)),await this.handleError(e,r,s,a,this.deserializeMetadata(s)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const c in s.headers){const o=s.headers[c];delete s.headers[c],s.headers[c.toLowerCase()]=o}const u=i.getEventStreamMember();if(u)a[u]=await this.deserializeEventStream({response:s,responseSchema:i,initialResponseContainer:a});else{const c=await Oe(s.body,r);c.byteLength>0&&Object.assign(a,await n.read(i,c))}return a.$metadata=this.deserializeMetadata(s),a}}function zn(t,e){if(e.timestampFormat.useTrait&&t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema();const{httpLabel:r,httpPrefixHeaders:s,httpHeader:n,httpQuery:i}=t.getMergedTraits();return(e.httpBindings?typeof s=="string"||n?6:i||r?5:void 0:void 0)??e.timestampFormat.default}const ce="***SensitiveInformation***";function ye(t,e){if(e==null)return e;const r=b.of(t);if(r.getMergedTraits().sensitive)return ce;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return ce}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return ce}else if(r.isStructSchema()&&typeof e=="object"){const s=e,n={};for(const[i,a]of r.structIterator())s[i]!=null&&(n[i]=ye(a,s[i]));return n}return e}class Ft{middlewareStack=ee();schema;static classBuilder(){return new jt}resolveMiddlewareWithContext(e,r,s,{middlewareFn:n,clientName:i,commandName:a,inputFilterSensitiveLog:u,outputFilterSensitiveLog:c,smithyContext:o,additionalContext:h,CommandCtor:d}){for(const p of n.bind(this)(d,e,r,s))this.middlewareStack.use(p);const l=e.concat(this.middlewareStack),{logger:f}=r,m={logger:f,clientName:i,commandName:a,inputFilterSensitiveLog:u,outputFilterSensitiveLog:c,[ge]:{commandInstance:this,...o},...h},{requestHandler:g}=r;return l.resolve(p=>g.handle(p.request,s||{}),m)}}class jt{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,r,s={}){return this._smithyContext={service:e,operation:r,...s},this}c(e={}){return this._additionalContext=e,this}n(e,r){return this._clientName=e,this._commandName=r,this}f(e=s=>s,r=s=>s){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=r,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let r;return r=class extends Ft{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[s]){super(),this.input=s??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(s,n,i){const a=e._operationSchema,u=a?.[4]??a?.input,c=a?.[5]??a?.output;return this.resolveMiddlewareWithContext(s,n,i,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(a?ye.bind(null,u):o=>o),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(a?ye.bind(null,c):o=>o),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class H extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const r=e;return H.prototype.isPrototypeOf(r)||!!r.$fault&&!!r.$metadata&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;const r=e;return this===H?H.isInstance(e):H.isInstance(e)?r.name&&this.name?this.prototype.isPrototypeOf(e)||r.name===this.name:this.prototype.isPrototypeOf(e):!1}}const $e=(t,e={})=>{Object.entries(e).filter(([,s])=>s!==void 0).forEach(([s,n])=>{(t[s]==null||t[s]==="")&&(t[s]=n)});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t},Bn=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},qt=t=>{const e=[];for(const r in Z){const s=Z[r];t[s]!==void 0&&e.push({algorithmId:()=>s,checksumConstructor:()=>t[s]})}return{addChecksumAlgorithm(r){e.push(r)},checksumAlgorithms(){return e}}},Vt=t=>{const e={};return t.checksumAlgorithms().forEach(r=>{e[r.algorithmId()]=r.checksumConstructor()}),e},Gt=t=>({setRetryStrategy(e){t.retryStrategy=e},retryStrategy(){return t.retryStrategy}}),Wt=t=>{const e={};return e.retryStrategy=t.retryStrategy(),e},Fn=t=>Object.assign(qt(t),Gt(t)),jn=t=>Object.assign(Vt(t),Wt(t));class Kt{trace(){}debug(){}info(){}warn(){}error(){}}const Xt=(t,e)=>{if(!e||e.length===0)return t;const r=[];for(const s of e)for(const n of t)n.schemeId.split("#")[1]===s&&r.push(n);for(const s of t)r.find(({schemeId:n})=>n===s.schemeId)||r.push(s);return r};function Qt(t){const e=new Map;for(const r of t)e.set(r.schemeId,r);return e}const Yt=(t,e)=>(r,s)=>async n=>{const i=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,s,n.input)),a=t.authSchemePreference?await t.authSchemePreference():[],u=Xt(i,a),c=Qt(t.httpAuthSchemes),o=G(s),h=[];for(const d of u){const l=c.get(d.schemeId);if(!l){h.push(`HttpAuthScheme \`${d.schemeId}\` was not enabled for this service.`);continue}const f=l.identityProvider(await e.identityProviderConfigProvider(t));if(!f){h.push(`HttpAuthScheme \`${d.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:m={},signingProperties:g={}}=d.propertiesExtractor?.(t,s)||{};d.identityProperties=Object.assign(d.identityProperties||{},m),d.signingProperties=Object.assign(d.signingProperties||{},g),o.selectedHttpAuthScheme={httpAuthOption:d,identity:await f(d.identityProperties),signer:l.signer};break}if(!o.selectedHttpAuthScheme)throw new Error(h.join(`
|
|
4
|
+
`));return r(n)},Jt={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},qn=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:s=>{s.addRelativeTo(Yt(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),Jt)}}),Zt={name:"serializerMiddleware"},er=t=>e=>{throw e},tr=(t,e)=>{},rr=t=>(e,r)=>async s=>{if(!x.isInstance(s.request))return e(s);const i=G(r).selectedHttpAuthScheme;if(!i)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:a={}},identity:u,signer:c}=i,o=await e({...s,request:await c.sign(s.request,u,a)}).catch((c.errorHandler||er)(a));return(c.successHandler||tr)(o.response,a),o},sr={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},Vn=t=>({applyToStack:e=>{e.addRelativeTo(rr(),sr)}});function nr(t,e,r){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=r}class Gn{authSchemes=new Map;constructor(e){for(const[r,s]of Object.entries(e))s!==void 0&&this.authSchemes.set(r,s)}getIdentityProvider(e){return this.authSchemes.get(e)}}class Wn{async sign(e,r,s){return e}}const ir=t=>function(r){return rt(r)&&r.expiration.getTime()-Date.now()<t},ar=3e5,or=ir(ar),rt=t=>t.expiration!==void 0,cr=(t,e,r)=>{if(t===void 0)return;const s=typeof t!="function"?async()=>Promise.resolve(t):t;let n,i,a,u=!1;const c=async o=>{i||(i=s(o));try{n=await i,a=!0,u=!1}finally{i=void 0}return n};return e===void 0?async o=>((!a||o?.forceRefresh)&&(n=await c(o)),n):async o=>((!a||o?.forceRefresh)&&(n=await c(o)),u?n:r(n)?(e(n)&&await c(o),n):(u=!0,n))};function Kn(t){return t}const ur=t=>e=>async r=>{if(!x.isInstance(r.request))return e(r);const{request:s}=r,{handlerProtocol:n=""}=t.requestHandler.metadata||{};if(n.indexOf("h2")>=0&&!s.headers[":authority"])delete s.headers.host,s.headers[":authority"]=s.hostname+(s.port?":"+s.port:"");else if(!s.headers.host){let i=s.hostname;s.port!=null&&(i+=`:${s.port}`),s.headers.host=i}return e(r)},dr={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Xn=t=>({applyToStack:e=>{e.add(ur(t),dr)}}),lr=()=>(t,e)=>async r=>{try{const s=await t(r),{clientName:n,commandName:i,logger:a,dynamoDbDocumentClientOptions:u={}}=e,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:o}=u,h=c??e.inputFilterSensitiveLog,d=o??e.outputFilterSensitiveLog,{$metadata:l,...f}=s.output;return a?.info?.({clientName:n,commandName:i,input:h(r.input),output:d(f),metadata:l}),s}catch(s){const{clientName:n,commandName:i,logger:a,dynamoDbDocumentClientOptions:u={}}=e,{overrideInputFilterSensitiveLog:c}=u,o=c??e.inputFilterSensitiveLog;throw a?.error?.({clientName:n,commandName:i,input:o(r.input),error:s,metadata:s.$metadata}),s}},fr={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Qn=t=>({applyToStack:e=>{e.add(lr(),fr)}}),hr={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},pr=()=>t=>async e=>t(e),Yn=t=>({applyToStack:e=>{e.add(pr(),hr)}}),mr=void 0;function gr(t){return t===void 0?!0:typeof t=="string"&&t.length<=50}function Jn(t){const e=z(t.userAgentAppId??mr),{customUserAgent:r}=t;return Object.assign(t,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{const s=await e();if(!gr(s)){const n=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?console:t.logger;typeof s!="string"?n?.warn("userAgentAppId must be a string or undefined."):s.length>50&&n?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return s}})}class Zn{capacity;data=new Map;parameters=[];constructor({size:e,params:r}){this.capacity=e??50,r&&(this.parameters=r)}get(e,r){const s=this.hash(e);if(s===!1)return r();if(!this.data.has(s)){if(this.data.size>this.capacity+10){const n=this.data.keys();let i=0;for(;;){const{value:a,done:u}=n.next();if(this.data.delete(a),u||++i>10)break}}this.data.set(s,r())}return this.data.get(s)}size(){return this.data.size}hash(e){let r="";const{parameters:s}=this;if(s.length===0)return!1;for(const n of s){const i=String(e[n]??"");if(i.includes("|;"))return!1;r+=i+"|;"}return r}}const yr=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),st=t=>yr.test(t)||t.startsWith("[")&&t.endsWith("]"),wr=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),re=(t,e=!1)=>{if(!e)return wr.test(t);const r=t.split(".");for(const s of r)if(!re(s))return!1;return!0},we={},q="endpoints";function _(t){return typeof t!="object"||t==null?t:"ref"in t?`$${_(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(_).join(", ")})`:JSON.stringify(t,null,2)}class R extends Error{constructor(e){super(e),this.name="EndpointError"}}const Sr=(t,e)=>t===e,br=t=>{const e=t.split("."),r=[];for(const s of e){const n=s.indexOf("[");if(n!==-1){if(s.indexOf("]")!==s.length-1)throw new R(`Path: '${t}' does not end with ']'`);const i=s.slice(n+1,-1);if(Number.isNaN(parseInt(i)))throw new R(`Invalid array index: '${i}' in path: '${t}'`);n!==0&&r.push(s.slice(0,n)),r.push(i)}else r.push(s)}return r},nt=(t,e)=>br(e).reduce((r,s)=>{if(typeof r!="object")throw new R(`Index '${s}' in '${e}' not found in '${JSON.stringify(t)}'`);return Array.isArray(r)?r[parseInt(s)]:r[s]},t),Er=t=>t!=null,Rr=t=>!t,ue={[F.HTTP]:80,[F.HTTPS]:443},vr=t=>{const e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){const{hostname:l,port:f,protocol:m="",path:g="",query:p={}}=t,y=new URL(`${m}//${l}${f?`:${f}`:""}${g}`);return y.search=Object.entries(p).map(([w,T])=>`${w}=${T}`).join("&"),y}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;const r=e.href,{host:s,hostname:n,pathname:i,protocol:a,search:u}=e;if(u)return null;const c=a.slice(0,-1);if(!Object.values(F).includes(c))return null;const o=st(n),h=r.includes(`${s}:${ue[c]}`)||typeof t=="string"&&t.includes(`${s}:${ue[c]}`),d=`${s}${h?`:${ue[c]}`:""}`;return{scheme:c,authority:d,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:o}},Tr=(t,e)=>t===e,Ar=(t,e,r,s)=>e>=r||t.length<r?null:s?t.substring(t.length-r,t.length-e):t.substring(e,r),Cr=t=>encodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),xr={booleanEquals:Sr,getAttr:nt,isSet:Er,isValidHostLabel:re,not:Rr,parseURL:vr,stringEquals:Tr,substring:Ar,uriEncode:Cr},it=(t,e)=>{const r=[],s={...e.endpointParams,...e.referenceRecord};let n=0;for(;n<t.length;){const i=t.indexOf("{",n);if(i===-1){r.push(t.slice(n));break}r.push(t.slice(n,i));const a=t.indexOf("}",i);if(a===-1){r.push(t.slice(i));break}t[i+1]==="{"&&t[a+1]==="}"&&(r.push(t.slice(i+1,a)),n=a+2);const u=t.substring(i+1,a);if(u.includes("#")){const[c,o]=u.split("#");r.push(nt(s[c],o))}else r.push(s[u]);n=a+1}return r.join("")},Ir=({ref:t},e)=>({...e.endpointParams,...e.referenceRecord})[t],se=(t,e,r)=>{if(typeof t=="string")return it(t,r);if(t.fn)return ot.callFunction(t,r);if(t.ref)return Ir(t,r);throw new R(`'${e}': ${String(t)} is not a string, function or reference.`)},at=({fn:t,argv:e},r)=>{const s=e.map(i=>["boolean","number"].includes(typeof i)?i:ot.evaluateExpression(i,"arg",r)),n=t.split(".");return n[0]in we&&n[1]!=null?we[n[0]][n[1]](...s):xr[t](...s)},ot={evaluateExpression:se,callFunction:at},_r=({assign:t,...e},r)=>{if(t&&t in r.referenceRecord)throw new R(`'${t}' is already defined in Reference Record.`);const s=at(e,r);return r.logger?.debug?.(`${q} evaluateCondition: ${_(e)} = ${_(s)}`),{result:s===""?!0:!!s,...t!=null&&{toAssign:{name:t,value:s}}}},Te=(t=[],e)=>{const r={};for(const s of t){const{result:n,toAssign:i}=_r(s,{...e,referenceRecord:{...e.referenceRecord,...r}});if(!n)return{result:n};i&&(r[i.name]=i.value,e.logger?.debug?.(`${q} assign: ${i.name} := ${_(i.value)}`))}return{result:!0,referenceRecord:r}},Or=(t,e)=>Object.entries(t).reduce((r,[s,n])=>({...r,[s]:n.map(i=>{const a=se(i,"Header value entry",e);if(typeof a!="string")throw new R(`Header '${s}' value '${a}' is not a string`);return a})}),{}),ct=(t,e)=>Object.entries(t).reduce((r,[s,n])=>({...r,[s]:dt.getEndpointProperty(n,e)}),{}),ut=(t,e)=>{if(Array.isArray(t))return t.map(r=>ut(r,e));switch(typeof t){case"string":return it(t,e);case"object":if(t===null)throw new R(`Unexpected endpoint property: ${t}`);return dt.getEndpointProperties(t,e);case"boolean":return t;default:throw new R(`Unexpected endpoint property type: ${typeof t}`)}},dt={getEndpointProperty:ut,getEndpointProperties:ct},kr=(t,e)=>{const r=se(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(s){throw console.error(`Failed to construct URL with ${r}`,s),s}throw new R(`Endpoint URL must be a string, got ${typeof r}`)},Mr=(t,e)=>{const{conditions:r,endpoint:s}=t,{result:n,referenceRecord:i}=Te(r,e);if(!n)return;const a={...e,referenceRecord:{...e.referenceRecord,...i}},{url:u,properties:c,headers:o}=s;return e.logger?.debug?.(`${q} Resolving endpoint from template: ${_(s)}`),{...o!=null&&{headers:Or(o,a)},...c!=null&&{properties:ct(c,a)},url:kr(u,a)}},Pr=(t,e)=>{const{conditions:r,error:s}=t,{result:n,referenceRecord:i}=Te(r,e);if(n)throw new R(se(s,"Error",{...e,referenceRecord:{...e.referenceRecord,...i}}))},lt=(t,e)=>{for(const r of t)if(r.type==="endpoint"){const s=Mr(r,e);if(s)return s}else if(r.type==="error")Pr(r,e);else if(r.type==="tree"){const s=ft.evaluateTreeRule(r,e);if(s)return s}else throw new R(`Unknown endpoint rule: ${r}`);throw new R("Rules evaluation failed")},$r=(t,e)=>{const{conditions:r,rules:s}=t,{result:n,referenceRecord:i}=Te(r,e);if(n)return ft.evaluateRules(s,{...e,referenceRecord:{...e.referenceRecord,...i}})},ft={evaluateRules:lt,evaluateTreeRule:$r},ei=(t,e)=>{const{endpointParams:r,logger:s}=e,{parameters:n,rules:i}=t;e.logger?.debug?.(`${q} Initial EndpointParams: ${_(r)}`);const a=Object.entries(n).filter(([,o])=>o.default!=null).map(([o,h])=>[o,h.default]);if(a.length>0)for(const[o,h]of a)r[o]=r[o]??h;const u=Object.entries(n).filter(([,o])=>o.required).map(([o])=>o);for(const o of u)if(r[o]==null)throw new R(`Missing required parameter: '${o}'`);const c=lt(i,{endpointParams:r,logger:s,referenceRecord:{}});return e.logger?.debug?.(`${q} Resolved endpoint: ${_(c)}`),c},ht=(t,e=!1)=>{if(e){for(const r of t.split("."))if(!ht(r))return!1;return!0}return!(!re(t)||t.length<3||t.length>63||t!==t.toLowerCase()||st(t))},Ne=":",Nr="/",Dr=t=>{const e=t.split(Ne);if(e.length<6)return null;const[r,s,n,i,a,...u]=e;if(r!=="arn"||s===""||n===""||u.join(Ne)==="")return null;const c=u.map(o=>o.split(Nr)).flat();return{partition:s,service:n,region:i,accountId:a,resourceId:c}},Ur=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],Lr={partitions:Ur};let Hr=Lr;const zr=t=>{const{partitions:e}=Hr;for(const s of e){const{regions:n,outputs:i}=s;for(const[a,u]of Object.entries(n))if(a===t)return{...i,...u}}for(const s of e){const{regionRegex:n,outputs:i}=s;if(new RegExp(n).test(t))return{...i}}const r=e.find(s=>s.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},Br={isVirtualHostableS3Bucket:ht,parseArn:Dr,partition:zr};we.aws=Br;function Fr(t){const e={};if(t=t.replace(/^\?/,""),t)for(const r of t.split("&")){let[s,n=null]=r.split("=");s=decodeURIComponent(s),n&&(n=decodeURIComponent(n)),s in e?Array.isArray(e[s])?e[s].push(n):e[s]=[e[s],n]:e[s]=n}return e}const Se=t=>{if(typeof t=="string")return Se(new URL(t));const{hostname:e,pathname:r,port:s,protocol:n,search:i}=t;let a;return i&&(a=Fr(i)),{hostname:e,port:s?parseInt(s):void 0,protocol:n,path:r,query:a}};function jr(t,e,r){return t.$source||(t.$source={}),t.$source[e]=r,t}function A(t,e,r){t.__aws_sdk_context?t.__aws_sdk_context.features||(t.__aws_sdk_context.features={}):t.__aws_sdk_context={features:{}},t.__aws_sdk_context.features[e]=r}const De=t=>te.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,pt=t=>new Date(Date.now()+t),qr=(t,e)=>Math.abs(pt(e).getTime()-t)>=3e5,Ue=(t,e)=>{const r=Date.parse(t);return qr(r,e)?r-Date.now():e},B=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},Vr=async t=>{const e=B("context",t.context),r=B("config",t.config),s=e.endpointV2?.properties?.authSchemes?.[0],i=await B("signer",r.signer)(s),a=t?.signingRegion,u=t?.signingRegionSet,c=t?.signingName;return{config:r,signer:i,signingRegion:a,signingRegionSet:u,signingName:c}};class ti{async sign(e,r,s){if(!x.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const n=await Vr(s),{config:i,signer:a}=n;let{signingRegion:u,signingName:c}=n;const o=s.context;if(o?.authSchemes?.length??!1){const[d,l]=o.authSchemes;d?.name==="sigv4a"&&l?.name==="sigv4"&&(u=l?.signingRegion??u,c=l?.signingName??c)}return await a.sign(e,{signingDate:pt(i.systemClockOffset),signingRegion:u,signingService:c})}errorHandler(e){return r=>{const s=r.ServerTime??De(r.$response);if(s){const n=B("config",e.config),i=n.systemClockOffset;n.systemClockOffset=Ue(s,n.systemClockOffset),n.systemClockOffset!==i&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(e,r){const s=De(e);if(s){const n=B("config",r.config);n.systemClockOffset=Ue(s,n.systemClockOffset)}}}const Gr="X-Amz-Algorithm",Wr="X-Amz-Credential",mt="X-Amz-Date",Kr="X-Amz-SignedHeaders",Xr="X-Amz-Expires",gt="X-Amz-Signature",yt="X-Amz-Security-Token",wt="authorization",St=mt.toLowerCase(),Qr="date",Yr=[wt,St,Qr],Jr=gt.toLowerCase(),be="x-amz-content-sha256",Zr=yt.toLowerCase(),es={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},ts=/^proxy-/,rs=/^sec-/,de="AWS4-HMAC-SHA256",ss="AWS4-HMAC-SHA256-PAYLOAD",ns="UNSIGNED-PAYLOAD",is=50,bt="aws4_request",as=3600*24*7,W={},le=[],fe=(t,e,r)=>`${t}/${e}/${r}/${bt}`,os=async(t,e,r,s,n)=>{const i=await Le(t,e.secretAccessKey,e.accessKeyId),a=`${r}:${s}:${n}:${k(i)}:${e.sessionToken}`;if(a in W)return W[a];for(le.push(a);le.length>is;)delete W[le.shift()];let u=`AWS4${e.secretAccessKey}`;for(const c of[r,s,n,bt])u=await Le(t,u,c);return W[a]=u},Le=(t,e,r)=>{const s=new t(e);return s.update(j(r)),s.digest()},He=({headers:t},e,r)=>{const s={};for(const n of Object.keys(t).sort()){if(t[n]==null)continue;const i=n.toLowerCase();(i in es||e?.has(i)||ts.test(i)||rs.test(i))&&(!r||r&&!r.has(i))||(s[i]=t[n].trim().replace(/\s+/g," "))}return s},cs=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",he=async({headers:t,body:e},r)=>{for(const s of Object.keys(t))if(s.toLowerCase()===be)return t[s];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||cs(e)){const s=new r;return s.update(j(e)),k(await s.digest())}return ns};class us{format(e){const r=[];for(const i of Object.keys(e)){const a=J(i);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(e[i]))}const s=new Uint8Array(r.reduce((i,a)=>i+a.byteLength,0));let n=0;for(const i of r)s.set(i,n),n+=i.byteLength;return s}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const s=new DataView(new ArrayBuffer(5));return s.setUint8(0,4),s.setInt32(1,e.value,!1),new Uint8Array(s.buffer);case"long":const n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const a=new Uint8Array(i.buffer);return a.set(e.value,3),a;case"string":const u=J(e.value),c=new DataView(new ArrayBuffer(3+u.byteLength));c.setUint8(0,7),c.setUint16(1,u.byteLength,!1);const o=new Uint8Array(c.buffer);return o.set(u,3),o;case"timestamp":const h=new Uint8Array(9);return h[0]=8,h.set(Ae.fromNumber(e.value.valueOf()).bytes,1),h;case"uuid":if(!ds.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(kt(e.value.replace(/\-/g,"")),1),d}}}var ze;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(ze||(ze={}));const ds=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class Ae{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let s=7,n=Math.abs(Math.round(e));s>-1&&n>0;s--,n/=256)r[s]=n;return e<0&&Be(r),new Ae(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&Be(e),parseInt(k(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Be(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}const ls=(t,e)=>{t=t.toLowerCase();for(const r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1},fs=(t,e={})=>{const{headers:r,query:s={}}=x.clone(t);for(const n of Object.keys(r)){const i=n.toLowerCase();(i.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(i)||e.hoistableHeaders?.has(i))&&(s[n]=r[n],delete r[n])}return{...t,headers:r,query:s}},Fe=t=>{t=x.clone(t);for(const e of Object.keys(t.headers))Yr.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t},hs=({query:t={}})=>{const e=[],r={};for(const s of Object.keys(t)){if(s.toLowerCase()===Jr)continue;const n=X(s);e.push(n);const i=t[s];typeof i=="string"?r[n]=`${n}=${X(i)}`:Array.isArray(i)&&(r[n]=i.slice(0).reduce((a,u)=>a.concat([`${n}=${X(u)}`]),[]).sort().join("&"))}return e.sort().map(s=>r[s]).filter(s=>s).join("&")},ps=t=>ms(t).toISOString().replace(/\.\d{3}Z$/,"Z"),ms=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;class gs{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:r,region:s,service:n,sha256:i,uriEscapePath:a=!0}){this.service=n,this.sha256=i,this.uriEscapePath=a,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=P(s),this.credentialProvider=P(r)}createCanonicalRequest(e,r,s){const n=Object.keys(r).sort();return`${e.method}
|
|
5
|
+
${this.getCanonicalPath(e)}
|
|
6
|
+
${hs(e)}
|
|
7
|
+
${n.map(i=>`${i}:${r[i]}`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
|
|
10
|
+
${n.join(";")}
|
|
11
|
+
${s}`}async createStringToSign(e,r,s,n){const i=new this.sha256;i.update(j(s));const a=await i.digest();return`${n}
|
|
12
|
+
${e}
|
|
13
|
+
${r}
|
|
14
|
+
${k(a)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const r=[];for(const i of e.split("/"))i?.length!==0&&i!=="."&&(i===".."?r.pop():r.push(i));const s=`${e?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&e?.endsWith("/")?"/":""}`;return X(s).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){const r=ps(e).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class je extends gs{headerFormatter=new us;constructor({applyChecksum:e,credentials:r,region:s,service:n,sha256:i,uriEscapePath:a=!0}){super({applyChecksum:e,credentials:r,region:s,service:n,sha256:i,uriEscapePath:a})}async presign(e,r={}){const{signingDate:s=new Date,expiresIn:n=3600,unsignableHeaders:i,unhoistableHeaders:a,signableHeaders:u,hoistableHeaders:c,signingRegion:o,signingService:h}=r,d=await this.credentialProvider();this.validateResolvedCredentials(d);const l=o??await this.regionProvider(),{longDate:f,shortDate:m}=this.formatDate(s);if(n>as)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const g=fe(m,l,h??this.service),p=fs(Fe(e),{unhoistableHeaders:a,hoistableHeaders:c});d.sessionToken&&(p.query[yt]=d.sessionToken),p.query[Gr]=de,p.query[Wr]=`${d.accessKeyId}/${g}`,p.query[mt]=f,p.query[Xr]=n.toString(10);const y=He(p,i,u);return p.query[Kr]=this.getCanonicalHeaderList(y),p.query[gt]=await this.getSignature(f,g,this.getSigningKey(d,l,m,h),this.createCanonicalRequest(p,y,await he(e,this.sha256))),p}async sign(e,r){return typeof e=="string"?this.signString(e,r):e.headers&&e.payload?this.signEvent(e,r):e.message?this.signMessage(e,r):this.signRequest(e,r)}async signEvent({headers:e,payload:r},{signingDate:s=new Date,priorSignature:n,signingRegion:i,signingService:a}){const u=i??await this.regionProvider(),{shortDate:c,longDate:o}=this.formatDate(s),h=fe(c,u,a??this.service),d=await he({headers:{},body:r},this.sha256),l=new this.sha256;l.update(e);const f=k(await l.digest()),m=[ss,o,h,n,f,d].join(`
|
|
15
|
+
`);return this.signString(m,{signingDate:s,signingRegion:u,signingService:a})}async signMessage(e,{signingDate:r=new Date,signingRegion:s,signingService:n}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:r,signingRegion:s,signingService:n,priorSignature:e.priorSignature}).then(a=>({message:e.message,signature:a}))}async signString(e,{signingDate:r=new Date,signingRegion:s,signingService:n}={}){const i=await this.credentialProvider();this.validateResolvedCredentials(i);const a=s??await this.regionProvider(),{shortDate:u}=this.formatDate(r),c=new this.sha256(await this.getSigningKey(i,a,u,n));return c.update(j(e)),k(await c.digest())}async signRequest(e,{signingDate:r=new Date,signableHeaders:s,unsignableHeaders:n,signingRegion:i,signingService:a}={}){const u=await this.credentialProvider();this.validateResolvedCredentials(u);const c=i??await this.regionProvider(),o=Fe(e),{longDate:h,shortDate:d}=this.formatDate(r),l=fe(d,c,a??this.service);o.headers[St]=h,u.sessionToken&&(o.headers[Zr]=u.sessionToken);const f=await he(o,this.sha256);!ls(be,o.headers)&&this.applyChecksum&&(o.headers[be]=f);const m=He(o,n,s),g=await this.getSignature(h,l,this.getSigningKey(u,c,d,a),this.createCanonicalRequest(o,m,f));return o.headers[wt]=`${de} Credential=${u.accessKeyId}/${l}, SignedHeaders=${this.getCanonicalHeaderList(m)}, Signature=${g}`,o}async getSignature(e,r,s,n){const i=await this.createStringToSign(e,r,n,de),a=new this.sha256(await s);return a.update(j(i)),k(await a.digest())}getSigningKey(e,r,s,n){return os(this.sha256,e,s,r,n||this.service)}}const ri=t=>{let e=t.credentials,r=!!t.credentials,s;Object.defineProperty(t,"credentials",{set(o){o&&o!==e&&o!==s&&(r=!0),e=o;const h=ys(t,{credentials:e,credentialDefaultProvider:t.credentialDefaultProvider}),d=ws(t,h);if(r&&!d.attributed){const l=typeof e=="object"&&e!==null;s=async f=>{const g=await d(f);return l&&(!g.$source||Object.keys(g.$source).length===0)?jr(g,"CREDENTIALS_CODE","e"):g},s.memoized=d.memoized,s.configBound=d.configBound,s.attributed=!0}else s=d},get(){return s},enumerable:!0,configurable:!0}),t.credentials=e;const{signingEscapePath:n=!0,systemClockOffset:i=t.systemClockOffset||0,sha256:a}=t;let u;return t.signer?u=z(t.signer):t.regionInfoProvider?u=()=>z(t.region)().then(async o=>[await t.regionInfoProvider(o,{useFipsEndpoint:await t.useFipsEndpoint(),useDualstackEndpoint:await t.useDualstackEndpoint()})||{},o]).then(([o,h])=>{const{signingRegion:d,signingService:l}=o;t.signingRegion=t.signingRegion||d||h,t.signingName=t.signingName||l||t.serviceId;const f={...t,credentials:t.credentials,region:t.signingRegion,service:t.signingName,sha256:a,uriEscapePath:n},m=t.signerConstructor||je;return new m(f)}):u=async o=>{o=Object.assign({},{name:"sigv4",signingName:t.signingName||t.defaultSigningName,signingRegion:await z(t.region)(),properties:{}},o);const h=o.signingRegion,d=o.signingName;t.signingRegion=t.signingRegion||h,t.signingName=t.signingName||d||t.serviceId;const l={...t,credentials:t.credentials,region:t.signingRegion,service:t.signingName,sha256:a,uriEscapePath:n},f=t.signerConstructor||je;return new f(l)},Object.assign(t,{systemClockOffset:i,signingEscapePath:n,signer:u})};function ys(t,{credentials:e,credentialDefaultProvider:r}){let s;return e?e?.memoized?s=e:s=cr(e,or,rt):r?s=z(r(Object.assign({},t,{parentClientConfig:t}))):s=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},s.memoized=!0,s}function ws(t,e){if(e.configBound)return e;const r=async s=>e({...s,callerClientConfig:t});return r.memoized=e.memoized,r.configBound=!0,r}const qe=typeof TextEncoder=="function"?new TextEncoder:null,si=t=>{if(typeof t=="string"){if(qe)return qe.encode(t).byteLength;let e=t.length;for(let r=e-1;r>=0;r--){const s=t.charCodeAt(r);s>127&&s<=2047?e++:s>2047&&s<=65535&&(e+=2),s>=56320&&s<=57343&&r--}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}throw new Error(`Body Length computation failed for ${t}`)};class ni{queryCompat;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,r){const s=r.getMemberSchemas(),n=Object.values(s).find(i=>!!i.getMergedTraits().httpPayload);if(n){const i=n.getMergedTraits().mediaType;return i||(n.isStringSchema()?"text/plain":n.isBlobSchema()?"application/octet-stream":e)}else if(!r.isUnitSchema()&&Object.values(s).find(a=>{const{httpQuery:u,httpQueryParams:c,httpHeader:o,httpLabel:h,httpPrefixHeaders:d}=a.getMergedTraits();return!u&&!c&&!o&&!h&&d===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,r,s,n,i,a){let u=r,c=e;e.includes("#")&&([u,c]=e.split("#"));const o={$metadata:i,$fault:s.statusCode<500?"client":"server"},h=C.for(u);try{return{errorSchema:a?.(h,c)??h.getSchema(e),errorMetadata:o}}catch{n.message=n.message??n.Message??"UnknownError";const l=C.for("smithy.ts.sdk.synthetic."+u),f=l.getBaseException();if(f){const m=l.getErrorCtor(f)??Error;throw this.decorateServiceException(Object.assign(new m({name:c}),o),n)}throw this.decorateServiceException(Object.assign(new Error(c),o),n)}}decorateServiceException(e,r={}){if(this.queryCompat){const s=e.Message??r.Message,n=$e(e,r);s&&(n.message=s),n.Error={...n.Error,Type:n.Error.Type,Code:n.Error.Code,Message:n.Error.message??n.Error.Message??s};const i=n.$metadata.requestId;return i&&(n.RequestId=i),n}return $e(e,r)}setQueryCompatError(e,r){const s=r.headers?.["x-amzn-query-error"];if(e!==void 0&&s!=null){const[n,i]=s.split(";"),a=Object.entries(e),u={Code:n,Type:i};Object.assign(e,u);for(const[c,o]of a)u[c==="message"?"Message":c]=o;delete u.__type,e.Error=u}}queryCompatOutput(e,r){e.Error&&(r.Error=e.Error),e.Type&&(r.Type=e.Type),e.Code&&(r.Code=e.Code)}findQueryCompatibleError(e,r){try{return e.getSchema(r)}catch{return e.find(n=>b.of(n).getMergedTraits().awsQueryError?.[0]===r)}}}class ii{serdeContext;setSerdeContext(e){this.serdeContext=e}}function*ai(t,e){if(t.isUnitSchema())return;const r=t.getSchema();for(let s=0;s<r[4].length;++s){const n=r[4][s],i=r[5][s],a=new b([i,0],n);!(n in e)&&!a.isIdempotencyToken()||(yield[n,a])}}function*oi(t,e,r){if(t.isUnitSchema())return;const s=t.getSchema();let n=Object.keys(e).filter(i=>i!=="__type").length;for(let i=0;i<s[4].length&&n!==0;++i){const a=s[4][i],u=s[5][i],c=new b([u,0],a);let o=a;r&&(o=c.getMergedTraits()[r]??a),o in e&&(yield[a,c],n-=1)}}class ci{from;to;keys;constructor(e,r){this.from=e,this.to=r,this.keys=new Set(Object.keys(this.from).filter(s=>s!=="__type"))}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,r=this.from[e];this.to.$unknown=[e,r]}}}const Ss=/\d{12}\.ddb/;async function bs(t,e,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&A(t,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const i=await e.retryStrategy();typeof i.acquireInitialRetryToken=="function"?i.constructor?.name?.includes("Adaptive")?A(t,"RETRY_MODE_ADAPTIVE","F"):A(t,"RETRY_MODE_STANDARD","E"):A(t,"RETRY_MODE_LEGACY","D")}if(typeof e.accountIdEndpointMode=="function"){const i=t.endpointV2;switch(String(i?.url?.hostname).match(Ss)&&A(t,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":A(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":A(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":A(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const n=t.__smithy_context?.selectedHttpAuthScheme?.identity;if(n?.$source){const i=n;i.accountId&&A(t,"RESOLVED_ACCOUNT_ID","T");for(const[a,u]of Object.entries(i.$source??{}))A(t,a,u)}}const Ve="user-agent",pe="x-amz-user-agent",Ge=" ",me="/",Es=/[^!$%&'*+\-.^_`|~\w]/g,Rs=/[^!$%&'*+\-.^_`|~\w#]/g,We="-",vs=1024;function Ts(t){let e="";for(const r in t){const s=t[r];if(e.length+s.length+1<=vs){e.length?e+=","+s:e+=s;continue}break}return e}const As=t=>(e,r)=>async s=>{const{request:n}=s;if(!x.isInstance(n))return e(s);const{headers:i}=n,a=r?.userAgent?.map(K)||[],u=(await t.defaultUserAgentProvider()).map(K);await bs(r,t,s);const c=r;u.push(`m/${Ts(Object.assign({},r.__smithy_context?.features,c.__aws_sdk_context?.features))}`);const o=t?.customUserAgent?.map(K)||[],h=await t.userAgentAppId();h&&u.push(K(["app",`${h}`]));const d=[].concat([...u,...a,...o]).join(Ge),l=[...u.filter(f=>f.startsWith("aws-sdk-")),...o].join(Ge);return t.runtime!=="browser"?(l&&(i[pe]=i[pe]?`${i[Ve]} ${l}`:l),i[Ve]=d):i[pe]=d,e({...s,request:n})},K=t=>{const e=t[0].split(me).map(a=>a.replace(Es,We)).join(me),r=t[1]?.replace(Rs,We),s=e.indexOf(me),n=e.substring(0,s);let i=e.substring(s+1);return n==="api"&&(i=i.toLowerCase()),[n,i,r].filter(a=>a&&a.length>0).reduce((a,u,c)=>{switch(c){case 0:return u;case 1:return`${a}/${u}`;default:return`${a}#${u}`}},"")},Cs={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},ui=t=>({applyToStack:e=>{e.add(As(t),Cs)}}),di=!1,li=!1,Ke=new Set,xs=(t,e=re)=>{if(!Ke.has(t)&&!e(t))if(t==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${t}" is not a valid hostname component.`);else Ke.add(t)},Et=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),Is=t=>Et(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,fi=t=>{const{region:e,useFipsEndpoint:r}=t;if(!e)throw new Error("Region is missing");return Object.assign(t,{region:async()=>{const s=typeof e=="function"?await e():e,n=Is(s);return xs(n),n},useFipsEndpoint:async()=>{const s=typeof e=="string"?e:await e();return Et(s)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},Xe="content-length";function _s(t){return e=>async r=>{const s=r.request;if(x.isInstance(s)){const{body:n,headers:i}=s;if(n&&Object.keys(i).map(a=>a.toLowerCase()).indexOf(Xe)===-1)try{const a=t(n);s.headers={...s.headers,[Xe]:String(a)}}catch{}}return e({...r,request:s})}}const Os={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},hi=t=>({applyToStack:e=>{e.add(_s(t.bodyLengthChecker),Os)}}),ks=async t=>{const e=t?.Bucket||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Ds(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Ns(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},Ms=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Ps=/(\d+\.){3}\d+/,$s=/\.\./,Ns=t=>Ms.test(t)&&!Ps.test(t)&&!$s.test(t),Ds=t=>{const[e,r,s,,,n]=t.split(":"),i=e==="arn"&&t.split(":").length>=6,a=!!(i&&r&&s&&n);if(i&&!a)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return a},Us=(t,e,r,s=!1)=>{const n=async()=>{let i;return s?i=r.clientContextParams?.[t]??r[t]??r[e]:i=r[t]??r[e],typeof i=="function"?i():i};return t==="credentialScope"||e==="CredentialScope"?async()=>{const i=typeof r.credentials=="function"?await r.credentials():r.credentials;return i?.credentialScope??i?.CredentialScope}:t==="accountId"||e==="AccountId"?async()=>{const i=typeof r.credentials=="function"?await r.credentials():r.credentials;return i?.accountId??i?.AccountId}:t==="endpoint"||e==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;const i=await n();if(i&&typeof i=="object"){if("url"in i)return i.url.href;if("hostname"in i){const{protocol:a,hostname:u,port:c,path:o}=i;return`${a}//${u}${c?":"+c:""}${o}`}}return i}:n},Rt=async t=>{},vt=t=>typeof t=="object"?"url"in t?Se(t.url):t:Se(t),Ls=async(t,e,r,s)=>{if(!r.isCustomEndpoint){let a;r.serviceConfiguredEndpoint?a=await r.serviceConfiguredEndpoint():a=await Rt(r.serviceId),a&&(r.endpoint=()=>Promise.resolve(vt(a)),r.isCustomEndpoint=!0)}const n=await Hs(t,e,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(n,s)},Hs=async(t,e,r)=>{const s={},n=e?.getEndpointParameterInstructions?.()||{};for(const[i,a]of Object.entries(n))switch(a.type){case"staticContextParams":s[i]=a.value;break;case"contextParams":s[i]=t[a.name];break;case"clientContextParams":case"builtInParams":s[i]=await Us(a.name,i,r,a.type!=="builtInParams")();break;case"operationContextParams":s[i]=a.get(t);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(n).length===0&&Object.assign(s,r),String(r.serviceId).toLowerCase()==="s3"&&await ks(s),s},zs=({config:t,instructions:e})=>(r,s)=>async n=>{t.isCustomEndpoint&&nr(s,"ENDPOINT_OVERRIDE","N");const i=await Ls(n.input,{getEndpointParameterInstructions(){return e}},{...t},s);s.endpointV2=i,s.authSchemes=i.properties?.authSchemes;const a=s.authSchemes?.[0];if(a){s.signing_region=a.signingRegion,s.signing_service=a.signingName;const c=G(s)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return r({...n})},Bs={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Zt.name},pi=(t,e)=>({applyToStack:r=>{r.addRelativeTo(zs({config:t,instructions:e}),Bs)}}),mi=t=>{const e=t.tls??!0,{endpoint:r,useDualstackEndpoint:s,useFipsEndpoint:n}=t,i=r!=null?async()=>vt(await P(r)()):void 0,u=Object.assign(t,{endpoint:i,tls:e,isCustomEndpoint:!!r,useDualstackEndpoint:P(s??!1),useFipsEndpoint:P(n??!1)});let c;return u.serviceConfiguredEndpoint=async()=>(t.serviceId&&!c&&(c=Rt(t.serviceId)),c),u};var N;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(N||(N={}));const Ee=3,gi=N.STANDARD,Fs=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],js=["TimeoutError","RequestTimeout","RequestTimeoutException"],qs=[500,502,503,504],Vs=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Gs=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],Ws=t=>t?.$retryable!==void 0,Ks=t=>t.$metadata?.clockSkewCorrected,Xs=t=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return t&&t instanceof TypeError?e.has(t.message):!1},Tt=t=>t.$metadata?.httpStatusCode===429||Fs.includes(t.name)||t.$retryable?.throttling==!0,Ce=(t,e=0)=>Ws(t)||Ks(t)||js.includes(t.name)||Vs.includes(t?.code||"")||Gs.includes(t?.code||"")||qs.includes(t.$metadata?.httpStatusCode||0)||Xs(t)||t.cause!==void 0&&e<=10&&Ce(t.cause,e+1),Qs=t=>{if(t.$metadata?.httpStatusCode!==void 0){const e=t.$metadata.httpStatusCode;return 500<=e&&e<=599&&!Ce(t)}return!1};class xe{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;currentCapacity=0;enabled=!1;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const r=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(s=>xe.setTimeoutFn(s,r))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const r=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=e}updateClientSendingRate(e){let r;if(this.updateMeasuredRate(),Tt(e)){const n=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=n,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(n),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const s=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(s)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const s=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(s*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}}const Re=100,At=20*1e3,Ys=500,Qe=500,Js=5,Zs=10,en=1,tn="amz-sdk-invocation-id",rn="amz-sdk-request",sn=()=>{let t=Re;return{computeNextBackoffDelay:s=>Math.floor(Math.min(At,Math.random()*2**s*t)),setDelayBase:s=>{t=s}}},Ye=({retryDelay:t,retryCount:e,retryCost:r})=>({getRetryCount:()=>e,getRetryDelay:()=>Math.min(At,t),getRetryCost:()=>r});class Ct{maxAttempts;mode=N.STANDARD;capacity=Qe;retryBackoffStrategy=sn();maxAttemptsProvider;constructor(e){this.maxAttempts=e,this.maxAttemptsProvider=typeof e=="function"?e:async()=>e}async acquireInitialRetryToken(e){return Ye({retryDelay:Re,retryCount:0})}async refreshRetryTokenForRetry(e,r){const s=await this.getMaxAttempts();if(this.shouldRetry(e,r,s)){const n=r.errorType;this.retryBackoffStrategy.setDelayBase(n==="THROTTLING"?Ys:Re);const i=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),a=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,i):i,u=this.getCapacityCost(n);return this.capacity-=u,Ye({retryDelay:a,retryCount:e.getRetryCount()+1,retryCost:u})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(Qe,this.capacity+(e.getRetryCost()??en))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Ee}`),Ee}}shouldRetry(e,r,s){return e.getRetryCount()+1<s&&this.capacity>=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(e){return e==="TRANSIENT"?Zs:Js}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class nn{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=N.ADAPTIVE;constructor(e,r){this.maxAttemptsProvider=e;const{rateLimiter:s}=r??{};this.rateLimiter=s??new xe,this.standardRetryStrategy=new Ct(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(e,r)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const an=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`),yi=t=>{const{retryStrategy:e,retryMode:r,maxAttempts:s}=t,n=P(s??Ee);return Object.assign(t,{maxAttempts:n,retryStrategy:async()=>e||(await P(r)()===N.ADAPTIVE?new nn(n):new Ct(n))})},on=t=>t?.body instanceof ReadableStream,cn=t=>(e,r)=>async s=>{let n=await t.retryStrategy();const i=await t.maxAttempts();if(un(n)){n=n;let a=await n.acquireInitialRetryToken(r.partition_id),u=new Error,c=0,o=0;const{request:h}=s,d=x.isInstance(h);for(d&&(h.headers[tn]=Ht());;)try{d&&(h.headers[rn]=`attempt=${c+1}; max=${i}`);const{response:l,output:f}=await e(s);return n.recordSuccess(a),f.$metadata.attempts=c+1,f.$metadata.totalRetryDelay=o,{response:l,output:f}}catch(l){const f=dn(l);if(u=an(l),d&&on(h))throw(r.logger instanceof Kt?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),u;try{a=await n.refreshRetryTokenForRetry(a,f)}catch{throw u.$metadata||(u.$metadata={}),u.$metadata.attempts=c+1,u.$metadata.totalRetryDelay=o,u}c=a.getRetryCount();const m=a.getRetryDelay();o+=m,await new Promise(g=>setTimeout(g,m))}}else return n=n,n?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",n.mode]]),n.retry(e,s)},un=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",dn=t=>{const e={error:t,errorType:ln(t)},r=hn(t.$response);return r&&(e.retryAfterHint=r),e},ln=t=>Tt(t)?"THROTTLING":Ce(t)?"TRANSIENT":Qs(t)?"SERVER_ERROR":"CLIENT_ERROR",fn={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},wi=t=>({applyToStack:e=>{e.add(cn(t),fn)}}),hn=t=>{if(!te.isInstance(t))return;const e=Object.keys(t.headers).find(i=>i.toLowerCase()==="retry-after");if(!e)return;const r=t.headers[e],s=Number(r);return Number.isNaN(s)?new Date(r):new Date(s*1e3)},pn=t=>new TextEncoder().encode(t);var mn=typeof Buffer<"u"&&Buffer.from?function(t){return Buffer.from(t,"utf8")}:pn;function V(t){return t instanceof Uint8Array?t:typeof t=="string"?mn(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function ve(t){return typeof t=="string"?t.length===0:t.byteLength===0}var xt={name:"SHA-256"},Je={name:"HMAC",hash:xt},gn=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const yn={};function Q(){return typeof window<"u"?window:typeof self<"u"?self:yn}var wn=(function(){function t(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return t.prototype.update=function(e){if(!ve(e)){var r=V(e),s=new Uint8Array(this.toHash.byteLength+r.byteLength);s.set(this.toHash,0),s.set(r,this.toHash.byteLength),this.toHash=s}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return Q().crypto.subtle.sign(Je,r,e.toHash).then(function(s){return new Uint8Array(s)})}):ve(this.toHash)?Promise.resolve(gn):Promise.resolve().then(function(){return Q().crypto.subtle.digest(xt,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,s){Q().crypto.subtle.importKey("raw",V(e.secret),Je,!1,["sign"]).then(r,s)}),this.key.catch(function(){}))},t})();function Sn(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function u(h){try{o(s.next(h))}catch(d){a(d)}}function c(h){try{o(s.throw(h))}catch(d){a(d)}}function o(h){h.done?i(h.value):n(h.value).then(u,c)}o((s=s.apply(t,e||[])).next())})}function bn(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,n,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(o){return function(h){return c([o,h])}}function c(o){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(r=0)),r;)try{if(s=1,n&&(i=o[0]&2?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,n=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1],i=o;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(o);break}i[2]&&r.ops.pop(),r.trys.pop();continue}o=e.call(t,r)}catch(h){o=[6,h],n=0}finally{s=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}var v=64,En=32,Rn=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),vn=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Tn=Math.pow(2,53)-1,Y=(function(){function t(){this.state=Int32Array.from(vn),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,s=e.byteLength;if(this.bytesHashed+=s,this.bytesHashed*8>Tn)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;s>0;)this.buffer[this.bufferLength++]=e[r++],s--,this.bufferLength===v&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),s=this.bufferLength;if(r.setUint8(this.bufferLength++,128),s%v>=v-8){for(var n=this.bufferLength;n<v;n++)r.setUint8(n,0);this.hashBuffer(),this.bufferLength=0}for(var n=this.bufferLength;n<v-8;n++)r.setUint8(n,0);r.setUint32(v-8,Math.floor(e/4294967296),!0),r.setUint32(v-4,e),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(En),n=0;n<8;n++)i[n*4]=this.state[n]>>>24&255,i[n*4+1]=this.state[n]>>>16&255,i[n*4+2]=this.state[n]>>>8&255,i[n*4+3]=this.state[n]>>>0&255;return i},t.prototype.hashBuffer=function(){for(var e=this,r=e.buffer,s=e.state,n=s[0],i=s[1],a=s[2],u=s[3],c=s[4],o=s[5],h=s[6],d=s[7],l=0;l<v;l++){if(l<16)this.temp[l]=(r[l*4]&255)<<24|(r[l*4+1]&255)<<16|(r[l*4+2]&255)<<8|r[l*4+3]&255;else{var f=this.temp[l-2],m=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10;f=this.temp[l-15];var g=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;this.temp[l]=(m+this.temp[l-7]|0)+(g+this.temp[l-16]|0)}var p=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&o^~c&h)|0)+(d+(Rn[l]+this.temp[l]|0)|0)|0,y=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&a^i&a)|0;d=h,h=o,o=c,c=u+p|0,u=a,a=i,i=n,n=p+y|0}s[0]+=n,s[1]+=i,s[2]+=a,s[3]+=u,s[4]+=c,s[5]+=o,s[6]+=h,s[7]+=d},t})(),An=(function(){function t(e){this.secret=e,this.hash=new Y,this.reset()}return t.prototype.update=function(e){if(!(ve(e)||this.error))try{this.hash.update(V(e))}catch(r){this.error=r}},t.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},t.prototype.digest=function(){return Sn(this,void 0,void 0,function(){return bn(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new Y,this.secret){this.outer=new Y;var e=Cn(this.secret),r=new Uint8Array(v);r.set(e);for(var s=0;s<v;s++)e[s]^=54,r[s]^=92;this.hash.update(e),this.outer.update(r);for(var s=0;s<e.byteLength;s++)e[s]=0}},t})();function Cn(t){var e=V(t);if(e.byteLength>v){var r=new Y;r.update(e),e=r.digest()}var s=new Uint8Array(v);return s.set(e),s}var xn=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function In(t){if(_n(t)&&typeof t.crypto.subtle=="object"){var e=t.crypto.subtle;return On(e)}return!1}function _n(t){if(typeof t=="object"&&typeof t.crypto=="object"){var e=t.crypto.getRandomValues;return typeof e=="function"}return!1}function On(t){return t&&xn.every(function(e){return typeof t[e]=="function"})}var Si=(function(){function t(e){In(Q())?this.hash=new wn(e):this.hash=new An(e)}return t.prototype.update=function(e,r){this.hash.update(V(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t})();const bi=({serviceId:t,clientVersion:e})=>async r=>{const s=typeof window<"u"?window.navigator:void 0,n=s?.userAgent??"",i=s?.userAgentData?.platform??Ze.os(n)??"other",a=void 0,u=s?.userAgentData?.brands??[],c=u[u.length-1],o=c?.brand??Ze.browser(n)??"unknown",h=c?.version??"unknown",d=[["aws-sdk-js",e],["ua","2.1"],[`os/${i}`,a],["lang/js"],["md/browser",`${o}_${h}`]];t&&d.push([`api/${t}`,e]);const l=await r?.userAgentAppId?.();return l&&d.push([`app/${l}`]),d},Ze={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux"},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari"}},Ei=t=>()=>Promise.reject(t),kn=["in-region","cross-region","mobile","standard","legacy"],Ri=({defaultsMode:t}={})=>Pt(async()=>{const e=typeof t=="function"?await t():t;switch(e?.toLowerCase()){case"auto":return Promise.resolve(Mn()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${kn.join(", ")}, got ${e}`)}}),Mn=()=>{const t=window?.navigator;if(t?.connection){const{effectiveType:e,rtt:r,downlink:s}=t?.connection;if(typeof e=="string"&&e!=="4g"||Number(r)>100||Number(s)<10)return!0}return t?.userAgentData?.mobile||typeof t?.maxTouchPoints=="number"&&t?.maxTouchPoints>1},vi=t=>({setRegion(e){t.region=e},region(){return t.region}}),Ti=t=>({region:t.region()});export{Xn as $,ti as A,di as B,Ft as C,gi as D,Zn as E,Bn as F,vi as G,Fn as H,Nn as I,Ti as J,jn as K,$ as L,Dn as M,tt as N,Jn as O,ni as P,yi as Q,Hn as R,ii as S,C as T,ci as U,fi as V,mi as W,Ln as X,ui as Y,wi as Z,hi as _,Un as a,Qn as a0,Yn as a1,qn as a2,Vn as a3,Kn as a4,Gn as a5,H as a6,zt as a7,b,Oe as c,oi as d,zn as e,ai as f,pi as g,ie as h,G as i,ei as j,Br as k,we as l,Kt as m,P as n,Wn as o,Se as p,Ri as q,ri as r,jr as s,Si as t,Ei as u,Ht as v,Ee as w,bi as x,si as y,li as z};
|