import{ck as p,cl as a}from"./index-CDhXClg9.js";import{O as f,n as d}from"./index.browser-C68605kA.js";const m="https://dashboard.jetprintapp.com",g=p({id:"oss",state:()=>({}),actions:{async fileSts(e){return console.log("param:",e),await a.post(`${m}/shopapi/file/sts`,e)}}});var o=null;function b(){return o?o.expiration-180*1e3<new Date().getTime()?(o=null,null):o:null}async function h(e){var s=b();if(s)return s;const t=(await e()).data;var r=Date.parse(t.expiration);return s=new f({endpoint:t.ossEndpoint,accessKeyId:t.accessKeyId,accessKeySecret:t.accessKeySecret,bucket:t.bucket,stsToken:t.securityToken}),o={client:s,expiration:r,domain:t.domain,ossObjectNamePrefix:t.ossObjectNamePrefix,bucket:t.bucket},o}function y(e,s,i){const t=i.lastIndexOf("."),r=i.substr(t),l=i.substr(0,t),c=`${e}${d()}${r}`,u=s+"/"+c;return{objectName:c,fileName:l,objectUrl:u}}const F={oss:h,getRandomObjectName:y},n="https://dashboard.jetprintapp.com",O=p({id:"file",state:()=>({}),actions:{async submitOssFile(e){return await a.post(`${n}/shopapi/file/submitOssFile`,e)},async filePage(e){return await a.post(`${n}/shopapi/file/page`,e)},async delFile(e){return await a.post(`${n}/shopapi/file/delFile`,e)},async updateFileInfo(e){return await a.post(`${n}/shopapi/file/updateFileInfo`,e)},async removeFile(e){return await a.post(`${n}/shopapi/file/delFile`,e)},async tagList(e){return await a.post(`${n}/shopapi/file/tag/list`,e)},async tagRemove(e){return await a.post(`${n}/shopapi/file/tag/remove`,e)},async fileUpdateFileInfo(e){return await a.post(`${n}/shopapi/file/updateFileInfo2`,e)},async submitOssFile2(e){return await a.post(`${n}/shopapi/file/submitOssFile`,e)},async tagRename(e){return await a.post(`${n}/shopapi/file/tag/rename`,e)}}});export{F as a,O as f,g as o};