"use strict";(globalThis.webpackChunkmine_cloudvod=globalThis.webpackChunkmine_cloudvod||[]).push([[628],{1554:(e,s,n)=>{n.d(s,{getSignedUrl:()=>d});var t=n(2194),i=n(1047),r=n(7090),a=n(2020);class o{signer;constructor(e){const s={service:e.signingName||e.service||"s3",uriEscapePath:e.uriEscapePath||!1,applyChecksum:e.applyChecksum||!1,...e};this.signer=new a.W(s)}presign(e,{unsignableHeaders:s=new Set,hoistableHeaders:n=new Set,unhoistableHeaders:t=new Set,...i}={}){return this.prepareRequest(e,{unsignableHeaders:s,unhoistableHeaders:t,hoistableHeaders:n}),this.signer.presign(e,{expiresIn:900,unsignableHeaders:s,unhoistableHeaders:t,...i})}presignWithCredentials(e,s,{unsignableHeaders:n=new Set,hoistableHeaders:t=new Set,unhoistableHeaders:i=new Set,...r}={}){return this.prepareRequest(e,{unsignableHeaders:n,unhoistableHeaders:i,hoistableHeaders:t}),this.signer.presignWithCredentials(e,s,{expiresIn:900,unsignableHeaders:n,unhoistableHeaders:i,...r})}prepareRequest(e,{unsignableHeaders:s=new Set,unhoistableHeaders:n=new Set,hoistableHeaders:t=new Set}={}){s.add("content-type"),Object.keys(e.headers).map((e=>e.toLowerCase())).filter((e=>e.startsWith("x-amz-server-side-encryption"))).forEach((e=>{t.has(e)||n.add(e)})),e.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD";const i=e.headers.host,r=e.port,a=`${e.hostname}${null!=e.port?":"+r:""}`;(!i||i===e.hostname&&null!=e.port)&&(e.headers.host=a)}}const d=async(e,s,n={})=>{let a,d;if("function"==typeof e.config.endpointProvider){const n=await(0,i.rC)(s.input,s.constructor,e.config),t=n.properties?.authSchemes?.[0];d="sigv4a"===t?.name?t?.signingRegionSet?.join(","):t?.signingRegion,a=new o({...e.config,signingName:t?.signingName,region:async()=>d})}else a=new o(e.config);const l=e.middlewareStack.clone();l.addRelativeTo(((e,s)=>async e=>{const{request:t}=e;if(!r.K.isInstance(t))throw new Error("Request to be presigned is not an valid HTTP request.");let i;delete t.headers["amz-sdk-invocation-id"],delete t.headers["amz-sdk-request"],delete t.headers["x-amz-user-agent"];const o={...n,signingRegion:n.signingRegion??s.signing_region??d,signingService:n.signingService??s.signing_service};return i=s.s3ExpressIdentity?await a.presignWithCredentials(t,s.s3ExpressIdentity,o):await a.presign(t,o),{response:{},output:{$metadata:{httpStatusCode:200},presigned:i}}}),{name:"presignInterceptMiddleware",relation:"before",toMiddleware:"awsAuthMiddleware",override:!0});const g=s.resolveMiddleware(l,e.config,{}),{output:u}=await g({input:s.input}),{presigned:h}=u;return function(e){const{port:s,query:n}=e;let{protocol:i,path:r,hostname:a}=e;i&&":"!==i.slice(-1)&&(i+=":"),s&&(a+=`:${s}`),r&&"/"!==r.charAt(0)&&(r=`/${r}`);let o=n?(0,t.G)(n):"";o&&"?"!==o[0]&&(o=`?${o}`);let d="";null==e.username&&null==e.password||(d=`${e.username??""}:${e.password??""}@`);let l="";return e.fragment&&(l=`#${e.fragment}`),`${i}//${d}${a}${r}${o}${l}`}(h)}}}]);