gemi 0.4.49 → 0.4.51

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.
@@ -0,0 +1,3 @@
1
+ import{y as D,z as re} from"./chunk-7ce930fe69575c87.js";import{ib as X} from"./chunk-09dd89e1046786a5.js";var V=re((ve,at)=>{var{defineProperty:R,getOwnPropertyDescriptor:ne,getOwnPropertyNames:oe}=Object,se=Object.prototype.hasOwnProperty,b=(t,e)=>R(t,"name",{value:e,configurable:!0}),ie=(t,e)=>{for(var r in e)R(t,r,{get:e[r],enumerable:!0})},ce=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of oe(e))if(!se.call(t,o)&&o!==r)R(t,o,{get:()=>e[o],enumerable:!(n=ne(e,o))||n.enumerable})}return t},fe=(t)=>ce(R({},"__esModule",{value:!0}),t),ht={};ie(ht,{constructStack:()=>W});at.exports=fe(ht);var $=b((t,e)=>{const r=[];if(t)r.push(t);if(e)for(let n of e)r.push(n);return r},"getAllAliases"),E=b((t,e)=>{return`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`},"getMiddlewareNameWithAliases"),W=b(()=>{let t=[],e=[],r=!1;const n=new Set,o=b((f)=>f.sort((d,u)=>ft[u.step]-ft[d.step]||ut[u.priority||"normal"]-ut[d.priority||"normal"]),"sort"),s=b((f)=>{let d=!1;const u=b((y)=>{const g=$(y.name,y.aliases);if(g.includes(f)){d=!0;for(let m of g)n.delete(m);return!1}return!0},"filterCb");return t=t.filter(u),e=e.filter(u),d},"removeByName"),c=b((f)=>{let d=!1;const u=b((y)=>{if(y.middleware===f){d=!0;for(let g of $(y.name,y.aliases))n.delete(g);return!1}return!0},"filterCb");return t=t.filter(u),e=e.filter(u),d},"removeByReference"),i=b((f)=>{var d;return t.forEach((u)=>{f.add(u.middleware,{...u})}),e.forEach((u)=>{f.addRelativeTo(u.middleware,{...u})}),(d=f.identifyOnResolve)==null||d.call(f,x.identifyOnResolve()),f},"cloneTo"),a=b((f)=>{const d=[];return f.before.forEach((u)=>{if(u.before.length===0&&u.after.length===0)d.push(u);else d.push(...a(u))}),d.push(f),f.after.reverse().forEach((u)=>{if(u.before.length===0&&u.after.length===0)d.push(u);else d.push(...a(u))}),d},"expandRelativeMiddlewareList"),p=b((f=!1)=>{const d=[],u=[],y={};return t.forEach((m)=>{const h={...m,before:[],after:[]};for(let l of $(h.name,h.aliases))y[l]=h;d.push(h)}),e.forEach((m)=>{const h={...m,before:[],after:[]};for(let l of $(h.name,h.aliases))y[l]=h;u.push(h)}),u.forEach((m)=>{if(m.toMiddleware){const h=y[m.toMiddleware];if(h===void 0){if(f)return;throw new Error(`${m.toMiddleware} is not found when adding ${E(m.name,m.aliases)} middleware ${m.relation} ${m.toMiddleware}`)}if(m.relation==="after")h.after.push(m);if(m.relation==="before")h.before.push(m)}}),o(d).map(a).reduce((m,h)=>{return m.push(...h),m},[])},"getMiddlewareList"),x={add:(f,d={})=>{const{name:u,override:y,aliases:g}=d,m={step:"initialize",priority:"normal",middleware:f,...d},h=$(u,g);if(h.length>0){if(h.some((l)=>n.has(l))){if(!y)throw new Error(`Duplicate middleware name '${E(u,g)}'`);for(let l of h){const S=t.findIndex((k)=>{var N;return k.name===l||((N=k.aliases)==null?void 0:N.some((z)=>z===l))});if(S===-1)continue;const w=t[S];if(w.step!==m.step||m.priority!==w.priority)throw new Error(`"${E(w.name,w.aliases)}" middleware with ${w.priority} priority in ${w.step} step cannot be overridden by "${E(u,g)}" middleware with ${m.priority} priority in ${m.step} step.`);t.splice(S,1)}}for(let l of h)n.add(l)}t.push(m)},addRelativeTo:(f,d)=>{const{name:u,override:y,aliases:g}=d,m={middleware:f,...d},h=$(u,g);if(h.length>0){if(h.some((l)=>n.has(l))){if(!y)throw new Error(`Duplicate middleware name '${E(u,g)}'`);for(let l of h){const S=e.findIndex((k)=>{var N;return k.name===l||((N=k.aliases)==null?void 0:N.some((z)=>z===l))});if(S===-1)continue;const w=e[S];if(w.toMiddleware!==m.toMiddleware||w.relation!==m.relation)throw new Error(`"${E(w.name,w.aliases)}" middleware ${w.relation} "${w.toMiddleware}" middleware cannot be overridden by "${E(u,g)}" middleware ${m.relation} "${m.toMiddleware}" middleware.`);e.splice(S,1)}}for(let l of h)n.add(l)}e.push(m)},clone:()=>i(W()),use:(f)=>{f.applyToStack(x)},remove:(f)=>{if(typeof f==="string")return s(f);else return c(f)},removeByTag:(f)=>{let d=!1;const u=b((y)=>{const{tags:g,name:m,aliases:h}=y;if(g&&g.includes(f)){const l=$(m,h);for(let S of l)n.delete(S);return d=!0,!1}return!0},"filterCb");return t=t.filter(u),e=e.filter(u),d},concat:(f)=>{var d;const u=i(W());return u.use(f),u.identifyOnResolve(r||u.identifyOnResolve()||(((d=f.identifyOnResolve)==null?void 0:d.call(f))??!1)),u},applyToStack:i,identify:()=>{return p(!0).map((f)=>{const d=f.step??f.relation+" "+f.toMiddleware;return E(f.name,f.aliases)+" - "+d})},identifyOnResolve(f){if(typeof f==="boolean")r=f;return r},resolve:(f,d)=>{for(let u of p().map((y)=>y.middleware).reverse())f=u(f,d);if(r)console.log(x.identify());return f}};return x},"constructStack"),ft={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},ut={high:3,normal:2,low:1}});var dt=D(V(),1);class ue{constructor(t){this.middlewareStack=dt.constructStack(),this.config=t}send(t,e,r){const n=typeof e!=="function"?e:void 0,o=typeof e==="function"?e:r,s=t.resolveMiddleware(this.middlewareStack,this.config,n);if(o)s(t).then((c)=>o(null,c.output),(c)=>o(c)).catch(()=>{});else return s(t).then((c)=>c.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}}var pt=D(V(),1),mt=D(X(),1);class lt{constructor(){this.middlewareStack=pt.constructStack()}static classBuilder(){return new gt}resolveMiddlewareWithContext(t,e,r,{middlewareFn:n,clientName:o,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,smithyContext:a,additionalContext:p,CommandCtor:x}){for(let g of n.bind(this)(x,t,e,r))this.middlewareStack.use(g);const f=t.concat(this.middlewareStack),{logger:d}=e,u={logger:d,clientName:o,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,[mt.SMITHY_CONTEXT_KEY]:{commandInstance:this,...a},...p},{requestHandler:y}=e;return f.resolve((g)=>y.handle(g.request,r||{}),u)}}class gt{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(t)=>t,this._outputFilterSensitiveLog=(t)=>t,this._serializer=null,this._deserializer=null}init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,e,r={}){return this._smithyContext={service:t,operation:e,...r},this}c(t={}){return this._additionalContext=t,this}n(t,e){return this._clientName=t,this._commandName=e,this}f(t=(r)=>r,e=(r)=>r){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=e,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){const t=this;let e;return e=class extends lt{static getEndpointParameterInstructions(){return t._ep}constructor(...[r]){super();this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=r??{},t._init(this)}resolveMiddleware(r,n,o){return this.resolveMiddlewareWithContext(r,n,o,{CommandCtor:e,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}var nr=(t)=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},or=(t)=>{return{httpHandler:t.httpHandler()}};var he=D(X(),1);var ae=function(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})};class Z{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const e=new Z({...t,headers:{...t.headers}});if(e.query)e.query=ae(e.query);return e}static isInstance(t){if(!t)return!1;const e=t;return"method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&typeof e.query==="object"&&typeof e.headers==="object"}clone(){return Z.clone(this)}}class H{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const e=t;return typeof e.statusCode==="number"&&typeof e.headers==="object"}}var L=(t)=>encodeURIComponent(t).replace(/[!'()*]/g,de),de=(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function O(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=L(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)e.push(`${r}=${L(n[o])}`);else{let o=r;if(n||typeof n==="string")o+=`=${L(n)}`;e.push(o)}}return e.join("&")}import{Agent as St,request as le} from"http";import{Agent as Ct,request as ge} from"https";var yt=["ECONNRESET","EPIPE","ETIMEDOUT"];var Q=(t)=>{const e={};for(let r of Object.keys(t)){const n=t[r];e[r]=Array.isArray(n)?n.join(","):n}return e};var xt=(t,e,r=0)=>{if(!r)return;const n=setTimeout(()=>{t.destroy(),e(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r);t.on("socket",(o)=>{if(o.connecting)o.on("connect",()=>{clearTimeout(n)});else clearTimeout(n)})};var wt=(t,{keepAlive:e,keepAliveMsecs:r})=>{if(e!==!0)return;t.on("socket",(n)=>{n.setKeepAlive(e,r||0)})};var bt=(t,e,r=0)=>{t.setTimeout(r,()=>{t.destroy(),e(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))})};import{Readable as pe} from"stream";async function G(t,e,r=Tt){const n=e.headers??{},o=n.Expect||n.expect;let s=-1,c=!1;if(o==="100-continue")await Promise.race([new Promise((i)=>{s=Number(setTimeout(i,Math.max(Tt,r)))}),new Promise((i)=>{t.on("continue",()=>{clearTimeout(s),i()}),t.on("error",()=>{c=!0,clearTimeout(s),i()})})]);if(!c)me(t,e.body)}var me=function(t,e){if(e instanceof pe){e.pipe(t);return}if(e){if(Buffer.isBuffer(e)||typeof e==="string"){t.end(e);return}const r=e;if(typeof r==="object"&&r.buffer&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number"){t.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}t.end(Buffer.from(e));return}t.end()},Tt=1000;class K{static create(t){if(typeof t?.handle==="function")return t;return new K(t)}static checkSocketUsage(t,e,r=console){const{sockets:n,requests:o,maxSockets:s}=t;if(typeof s!=="number"||s===Infinity)return e;const c=15000;if(Date.now()-c<e)return e;if(n&&o)for(let i in n){const a=n[i]?.length??0,p=o[i]?.length??0;if(a>=s&&p>=2*s)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${a} and ${p} additional requests are enqueued.
2
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return e}constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((e,r)=>{if(typeof t==="function")t().then((n)=>{e(this.resolveDefaultConfig(n))}).catch(r);else e(this.resolveDefaultConfig(t))})}resolveDefaultConfig(t){const{requestTimeout:e,connectionTimeout:r,socketTimeout:n,httpAgent:o,httpsAgent:s}=t||{};return{connectionTimeout:r,requestTimeout:e??n,httpAgent:(()=>{if(o instanceof St||typeof o?.destroy==="function")return o;return new St({keepAlive:!0,maxSockets:50,...o})})(),httpsAgent:(()=>{if(s instanceof Ct||typeof s?.destroy==="function")return s;return new Ct({keepAlive:!0,maxSockets:50,...s})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:e}={}){if(!this.config)this.config=await this.configProvider;let r;return new Promise((n,o)=>{let s=void 0;const c=async(h)=>{await s,clearTimeout(r),n(h)},i=async(h)=>{await s,clearTimeout(r),o(h)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(e?.aborted){const h=new Error("Request aborted");h.name="AbortError",i(h);return}const a=t.protocol==="https:",p=a?this.config.httpsAgent:this.config.httpAgent;r=setTimeout(()=>{this.socketWarningTimestamp=K.checkSocketUsage(p,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const x=O(t.query||{});let f=void 0;if(t.username!=null||t.password!=null){const h=t.username??"",l=t.password??"";f=`${h}:${l}`}let d=t.path;if(x)d+=`?${x}`;if(t.fragment)d+=`#${t.fragment}`;const u={headers:t.headers,host:t.hostname,method:t.method,path:d,port:t.port,agent:p,auth:f},g=(a?ge:le)(u,(h)=>{const l=new H({statusCode:h.statusCode||-1,reason:h.statusMessage,headers:Q(h.headers),body:h});c({response:l})});if(g.on("error",(h)=>{if(yt.includes(h.code))i(Object.assign(h,{name:"TimeoutError"}));else i(h)}),xt(g,i,this.config.connectionTimeout),bt(g,i,this.config.requestTimeout),e){const h=()=>{g.destroy();const l=new Error("Request aborted");l.name="AbortError",i(l)};if(typeof e.addEventListener==="function"){const l=e;l.addEventListener("abort",h,{once:!0}),g.once("close",()=>l.removeEventListener("abort",h))}else e.onabort=h}const m=u.agent;if(typeof m==="object"&&"keepAlive"in m)wt(g,{keepAlive:m.keepAlive,keepAliveMsecs:m.keepAliveMsecs});s=G(g,t,this.config.requestTimeout).catch((h)=>{return clearTimeout(r),o(h)})})}updateHttpClientConfig(t,e){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[t]:e}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as ye} from"stream";class _ extends ye{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,e,r){this.bufferedBytes.push(t),r()}}async function we(t){const e=[],r=t.getReader();let n=!1,o=0;while(!n){const{done:i,value:a}=await r.read();if(a)e.push(a),o+=a.length;n=i}const s=new Uint8Array(o);let c=0;for(let i of e)s.set(i,c),c+=i.length;return s}var Et=(t)=>{if(xe(t))return we(t);return new Promise((e,r)=>{const n=new _;t.pipe(n),t.on("error",(o)=>{n.end(),r(o)}),n.on("error",r),n.on("finish",function(){const o=new Uint8Array(Buffer.concat(this.bufferedBytes));e(o)})})},xe=(t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream;var mn="***SensitiveInformation***";var gn=(t,e)=>{for(let r of Object.keys(t)){const n=t[r],o=async function(c,i,a){const p=new n(c);if(typeof i==="function")this.send(p,i);else if(typeof a==="function"){if(typeof i!=="object")throw new Error(`Expected http options but got ${typeof i}`);this.send(p,i||{},a)}else return this.send(p,i)},s=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");e.prototype[s]=o}};class $t extends Error{constructor(t){super(t.message);Object.setPrototypeOf(this,$t.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}var At=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,o])=>{if(t[n]==null||t[n]==="")t[n]=o});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t};class be{trace(){}debug(){}info(){}warn(){}error(){}}var Ut=(t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]";import{Buffer as v} from"buffer";var U=(t,e=0,r=t.byteLength-e)=>{if(!Ut(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return v.from(t,e,r)},q=(t,e)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?v.from(t,e):v.from(t)};var Te=/^[A-Za-z0-9+/]*={0,2}$/,j=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Te.exec(t))throw new TypeError("Invalid base64 string.");const e=q(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};var I=(t)=>{const e=q(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var Pn=(t)=>{if(typeof t==="string")return I(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)};var Y=(t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return U(t.buffer,t.byteOffset,t.byteLength).toString("utf8")};var J=(t)=>{let e;if(typeof t==="string")e=I(t);else e=t;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return U(e.buffer,e.byteOffset,e.byteLength).toString("base64")};function It(t,e="utf-8"){if(e==="base64")return J(t);return Y(t)}function Pt(t,e){if(e==="base64")return C.mutate(j(t));return C.mutate(I(t))}class C extends Uint8Array{static fromString(t,e="utf-8"){switch(typeof t){case"string":return Pt(t,e);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,C.prototype),t}transformToString(t="utf-8"){return It(this,t)}}import{Readable as Se} from"stream";var Gn=(t,e)=>{const{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:o,checksumLocationName:s,streamHasher:c}=e,i=r!==void 0&&o!==void 0&&s!==void 0&&c!==void 0,a=i?c(o,t):void 0,p=new Se({read:()=>{}});return t.on("data",(x)=>{const f=n(x)||0;p.push(`${f.toString(16)}\r\n`),p.push(x),p.push("\r\n")}),t.on("end",async()=>{if(p.push("0\r\n"),i){const x=r(await a);p.push(`${s}:${x}\r\n`),p.push("\r\n")}p.push(null)}),p};import{Readable as et} from"stream";import{TextDecoder as Ae} from"util";async function Ce(t){const e=await $e(t),r=j(e);return new Uint8Array(r)}async function Ee(t){const e=[],r=t.getReader();let n=!1,o=0;while(!n){const{done:i,value:a}=await r.read();if(a)e.push(a),o+=a.length;n=i}const s=new Uint8Array(o);let c=0;for(let i of e)s.set(i,c),c+=i.length;return s}var $e=function(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const o=n.result??"",s=o.indexOf(","),c=s>-1?s+1:o.length;e(o.substring(c))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})},Ft=(t)=>{if(typeof Blob==="function"&&t instanceof Blob)return Ce(t);return Ee(t)};function uo(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2){const n=t.slice(r,r+2).toLowerCase();if(n in tt)e[r/2]=tt[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function Nt(t){let e="";for(let r=0;r<t.byteLength;r++)e+=kt[t[r]];return e}var kt={},tt={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();if(e.length===1)e=`0${e}`;kt[t]=e,tt[e]=t}var A=(t)=>typeof ReadableStream==="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream);var Dt="The stream has already been transformed.",Lt=(t)=>{if(!Ht(t)&&!A(t)){const o=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let e=!1;const r=async()=>{if(e)throw new Error(Dt);return e=!0,await Ft(t)},n=(o)=>{if(typeof o.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return o.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async(o)=>{const s=await r();if(o==="base64")return J(s);else if(o==="hex")return Nt(s);else if(o===void 0||o==="utf8"||o==="utf-8")return Y(s);else if(typeof TextDecoder==="function")return new TextDecoder(o).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(Dt);if(e=!0,Ht(t))return n(t);else if(A(t))return t;else throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},Ht=(t)=>typeof Blob==="function"&&t instanceof Blob;var Bt="The stream has already been transformed.",Eo=(t)=>{if(!(t instanceof et))try{return Lt(t)}catch(n){const o=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let e=!1;const r=async()=>{if(e)throw new Error(Bt);return e=!0,await Et(t)};return Object.assign(t,{transformToByteArray:r,transformToString:async(n)=>{const o=await r();if(n===void 0||Buffer.isEncoding(n))return U(o.buffer,o.byteOffset,o.byteLength).toString(n);else return new Ae(n).decode(o)},transformToWebStream:()=>{if(e)throw new Error(Bt);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof et.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return e=!0,et.toWeb(t)}})};import{PassThrough as Rt} from"stream";async function Mt(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}async function Fo(t){if(A(t))return Mt(t);const e=new Rt,r=new Rt;return t.pipe(e),t.pipe(r),[e,r]}import{Writable as Ue} from"stream";async function Ot(t,e){let r=0;const n=[],o=t.getReader();let s=!1;while(!s){const{done:a,value:p}=await o.read();if(p)n.push(p),r+=p?.byteLength??0;if(r>=e)break;s=a}o.releaseLock();const c=new Uint8Array(Math.min(e,r));let i=0;for(let a of n){if(a.byteLength>c.byteLength-i){c.set(a.subarray(0,c.byteLength-i),i);break}else c.set(a,i);i+=a.length}return c}var Bo=(t,e)=>{if(A(t))return Ot(t,e);return new Promise((r,n)=>{const o=new qt;o.limit=e,t.pipe(o),t.on("error",(s)=>{o.end(),n(s)}),o.on("error",n),o.on("finish",function(){const s=new Uint8Array(Buffer.concat(this.buffers));r(s)})})};class qt extends Ue{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write(t,e,r){if(this.buffers.push(t),this.bytesBuffered+=t.byteLength??0,this.bytesBuffered>=this.limit){const n=this.bytesBuffered-this.limit,o=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=o.subarray(0,o.byteLength-n),this.emit("finish")}r()}}var Vo=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return C.mutate(t);if(!t)return C.mutate(new Uint8Array);const r=e.streamCollector(t);return C.mutate(await r)};var Zo=(t)=>{switch(t){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${t}"`)}};var Ie=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){const e=parseFloat(t);if(!Number.isNaN(e)){if(String(e)!==String(t))Zt.warn(Xt(`Expected number but observed string: ${t}`));return e}}if(typeof t==="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)},Pe=Math.ceil(340282346638528860000000000000000000000),jt=(t)=>{const e=Ie(t);if(e!==void 0&&!Number.isNaN(e)&&e!==Infinity&&e!==(-Infinity)){if(Math.abs(e)>Pe)throw new TypeError(`Expected 32-bit float, got ${t}`)}return e},rt=(t)=>{if(t===null||t===void 0)return;if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)};var Yt=(t)=>nt(t,32),Jt=(t)=>nt(t,16),zt=(t)=>nt(t,8),nt=(t,e)=>{const r=rt(t);if(r!==void 0&&Fe(r,e)!==r)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return r},Fe=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},Qo=(t,e)=>{if(t===null||t===void 0){if(e)throw new TypeError(`Expected a non-null value for ${e}`);throw new TypeError("Expected a non-null value")}return t},Go=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;const e=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${e}: ${t}`)},Ko=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return Zt.warn(Xt(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)};var Wt=(t)=>{if(typeof t=="string")return jt(B(t));return jt(t)},ke=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,B=(t)=>{const e=t.match(ke);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var _o=(t)=>{if(typeof t==="string")return rt(B(t));return rt(t)};var vo=(t)=>{if(typeof t==="string")return Yt(B(t));return Yt(t)},P=(t)=>{if(typeof t==="string")return Jt(B(t));return Jt(t)},Vt=(t)=>{if(typeof t==="string")return zt(B(t));return zt(t)},Xt=(t)=>{return String(new TypeError(t).stack||t).split("\n").slice(0,5).filter((e)=>!e.includes("stackTraceWarning")).join("\n")},Zt={warn:console.warn};function ns(t){const e=t.getUTCFullYear(),r=t.getUTCMonth(),n=t.getUTCDay(),o=t.getUTCDate(),s=t.getUTCHours(),c=t.getUTCMinutes(),i=t.getUTCSeconds(),a=o<10?`0${o}`:`${o}`,p=s<10?`0${s}`:`${s}`,x=c<10?`0${c}`:`${c}`,f=i<10?`0${i}`:`${i}`;return`${Ne[n]}, ${a} ${st[r]} ${e} ${p}:${x}:${f} GMT`}var Ne=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],De=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),os=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=De.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,i,a,p]=e,x=P(F(n)),f=T(o,"month",1,12),d=T(s,"day",1,31);return M(x,f,d,{hours:c,minutes:i,seconds:a,fractionalMilliseconds:p})},He=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),ss=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=He.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,i,a,p,x]=e,f=P(F(n)),d=T(o,"month",1,12),u=T(s,"day",1,31),y=M(f,d,u,{hours:c,minutes:i,seconds:a,fractionalMilliseconds:p});if(x.toUpperCase()!="Z")y.setTime(y.getTime()-We(x));return y},Le=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Be=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Me=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),is=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=Le.exec(t);if(e){const[r,n,o,s,c,i,a,p]=e;return M(P(F(s)),ot(o),T(n,"day",1,31),{hours:c,minutes:i,seconds:a,fractionalMilliseconds:p})}if(e=Be.exec(t),e){const[r,n,o,s,c,i,a,p]=e;return qe(M(Re(s),ot(o),T(n,"day",1,31),{hours:c,minutes:i,seconds:a,fractionalMilliseconds:p}))}if(e=Me.exec(t),e){const[r,n,o,s,c,i,a,p]=e;return M(P(F(p)),ot(n),T(o.trimLeft(),"day",1,31),{hours:s,minutes:c,seconds:i,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")};var M=(t,e,r,n)=>{const o=e-1;return Ye(t,o,r),new Date(Date.UTC(t,o,r,T(n.hours,"hour",0,23),T(n.minutes,"minute",0,59),T(n.seconds,"seconds",0,60),ze(n.fractionalMilliseconds)))},Re=(t)=>{const e=(new Date()).getUTCFullYear(),r=Math.floor(e/100)*100+P(F(t));if(r<e)return r+100;return r},Oe=1576800000000,qe=(t)=>{if(t.getTime()-(new Date()).getTime()>Oe)return new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()));return t},ot=(t)=>{const e=st.indexOf(t);if(e<0)throw new TypeError(`Invalid month: ${t}`);return e+1},je=[31,28,31,30,31,30,31,31,30,31,30,31],Ye=(t,e,r)=>{let n=je[e];if(e===1&&Je(t))n=29;if(r>n)throw new TypeError(`Invalid day for ${st[e]} in ${t}: ${r}`)},Je=(t)=>{return t%4===0&&(t%100!==0||t%400===0)},T=(t,e,r,n)=>{const o=Vt(F(t));if(o<r||o>n)throw new TypeError(`${e} must be between ${r} and ${n}, inclusive`);return o},ze=(t)=>{if(t===null||t===void 0)return 0;return Wt("0."+t)*1000},We=(t)=>{const e=t[0];let r=1;if(e=="+")r=1;else if(e=="-")r=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(t.substring(1,3)),o=Number(t.substring(4,6));return r*(n*60+o)*60*1000},F=(t)=>{let e=0;while(e<t.length-1&&t.charAt(e)==="0")e++;if(e===0)return t;return t.slice(e)};var Ve=({output:t,parsedBody:e,exceptionCtor:r,errorCode:n})=>{const o=Xe(t),s=o.httpStatusCode?o.httpStatusCode+"":void 0,c=new r({name:e?.code||e?.Code||n||s||"UnknownError",$fault:"client",$metadata:o});throw At(c,e)},us=(t)=>{return({output:e,parsedBody:r,errorCode:n})=>{Ve({output:e,parsedBody:r,exceptionCtor:t,errorCode:n})}},Xe=(t)=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]});var as=(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:30000};default:return{}}};var Qt=!1,ps=(t)=>{if(t&&!Qt&&parseInt(t.substring(1,t.indexOf(".")))<16)Qt=!0};var it=D(X(),1);var Gt=(t)=>{const e=[];for(let r in it.AlgorithmId){const n=it.AlgorithmId[r];if(t[n]===void 0)continue;e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},Kt=(t)=>{const e={};return t.checksumAlgorithms().forEach((r)=>{e[r.algorithmId()]=r.checksumConstructor()}),e};var _t=(t)=>{let e=t.retryStrategy;return{setRetryStrategy(r){e=r},retryStrategy(){return e}}},vt=(t)=>{const e={};return e.retryStrategy=t.retryStrategy(),e};var ws=(t)=>{return{...Gt(t),..._t(t)}};var bs=(t)=>{return{...Kt(t),...vt(t)}};function Ze(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}var ct=function(){const t=Object.getPrototypeOf(this).constructor,r=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(r,t.prototype),r};ct.prototype=Object.create(String.prototype,{constructor:{value:ct,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(ct,String);function Qe(t,e,r){let n,o,s;if(typeof e==="undefined"&&typeof r==="undefined")n={},s=t;else if(n=t,typeof e==="function")return o=e,s=r,Ge(n,o,s);else s=e;for(let c of Object.keys(s)){if(!Array.isArray(s[c])){n[c]=s[c];continue}te(n,null,s,c)}return n}var Is=(t,e)=>{const r={};for(let n in e)te(r,t,e,n);return r},Ge=(t,e,r)=>{return Qe(t,Object.entries(r).reduce((n,[o,s])=>{if(Array.isArray(s))n[o]=s;else if(typeof s==="function")n[o]=[e,s()];else n[o]=[e,s];return n},{}))},te=(t,e,r,n)=>{if(e!==null){let c=r[n];if(typeof c==="function")c=[,c];const[i=Ke,a=_e,p=n]=c;if(typeof i==="function"&&i(e[p])||typeof i!=="function"&&!!i)t[n]=a(e[p]);return}let[o,s]=r[n];if(typeof s==="function"){let c;const i=o===void 0&&(c=s())!=null,a=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(i)t[n]=c;else if(a)t[n]=s()}else{const c=o===void 0&&s!=null,i=typeof o==="function"&&!!o(s)||typeof o!=="function"&&!!o;if(c||i)t[n]=s}},Ke=(t)=>t!=null,_e=(t)=>t;var Ns=(t)=>t.toISOString().replace(".000Z","Z");var ee=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((e)=>e!=null).map(ee);if(typeof t==="object"){const e={};for(let r of Object.keys(t)){if(t[r]==null)continue;e[r]=ee(t[r])}return e}return t};export{nr as A,or as B,Z as C,H as D,be as E,V as F,ue as G,Ut as H,U as I,q as J,j as K,I as L,Pn as M,Y as N,J as O,Gn as P,L as Q,K as R,Et as S,uo as T,Nt as U,Eo as V,Fo as W,Bo as X,Vo as Y,lt as Z,mn as _,gn as $,Zo as aa,rt as ba,Yt as ca,Qo as da,Go as ea,Ko as fa,_o as ga,vo as ha,ns as ia,os as ja,ss as ka,is as la,$t as ma,At as na,us as oa,as as pa,ps as qa,ws as ra,bs as sa,Ze as ta,Qe as ua,Is as va,Ns as wa,ee as xa};