"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@aplus-frontend/oss"),p=1e4;let n,i;function O(t,s){n=t,i=s}const f={"zh-cn":"zh_CN",en:"en_US"};function m(){return f[i.value]??"zh_CN"}const c=new Map;async function T(t,s){if(!t)throw new Error(`${n("ap.apUpload.pleasePass")}getOssAccess`);const a=s||"ap_image_default_bucket";let e=c.get(a);return e?.createDate&&e.createDate<Date.now()+p&&e?.oss||(e={oss:new Promise((l,u)=>{const o=g.createOssInstance();o.initOssClient({getOssAccess:t,locale:m(),onFailure:r=>{u(typeof r?.message=="string"?r.message:n("ap.apUpload.FailedToObtainOssTemporaryPermissions"))}}).then(()=>{l(o)})}),createDate:Date.now()},c.set(a,e)),e.oss}function U({oss:t,fileName:s}){return t.getSignatureUrl(s)}exports.getOssInstance=T;exports.getSignatureUrl=U;exports.injectLocaleToOss=O;
