import{a2 as E,ag as P,g as k,Q as A,a4 as O,X as R,Z as D,C as B,ah as $,ai as G,S as H,aj as q,m as I,ak as J,n as F,al as Q,c as K,o as C,b as r,w as c,P as V,d as w,t as S,q as m,B as U,r as h,H as X,R as x,z as Z}from"./Czresmtb.js";import W from"./CCyh6GyX.js";import{C as Y}from"./B7xaTL2x.js";import{_ as ee}from"./Bjr-s0wd.js";import{_ as te}from"./DxTvTv-W.js";import{_ as ne}from"./Bbw6XuZN.js";import{_ as oe}from"./us3hyXeL.js";import{_ as se}from"./ByO-3iZ4.js";import{_ as ae}from"./D3k1Qa3g.js";const re=E("input-group-label",`
 position: relative;
 user-select: none;
 -webkit-user-select: none;
 box-sizing: border-box;
 padding: 0 12px;
 display: inline-block;
 border-radius: var(--n-border-radius);
 background-color: var(--n-group-label-color);
 color: var(--n-group-label-text-color);
 font-size: var(--n-font-size);
 line-height: var(--n-height);
 height: var(--n-height);
 flex-shrink: 0;
 white-space: nowrap;
 transition: 
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier);
`,[P("border",`
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 border-radius: inherit;
 border: var(--n-group-label-border);
 transition: border-color .3s var(--n-bezier);
 `)]),le=Object.assign(Object.assign({},R.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),ce=k({name:"InputGroupLabel",props:le,setup(t){const{mergedBorderedRef:l,mergedClsPrefixRef:e,inlineThemeDisabled:s}=O(t),u=R("Input","-input-group-label",re,D,t,e),a=B(()=>{const{size:n}=t,{common:{cubicBezierEaseInOut:p},self:{groupLabelColor:f,borderRadius:b,groupLabelTextColor:g,lineHeight:d,groupLabelBorder:i,[$("fontSize",n)]:v,[$("height",n)]:y}}=u.value;return{"--n-bezier":p,"--n-group-label-color":f,"--n-group-label-border":i,"--n-border-radius":b,"--n-group-label-text-color":g,"--n-font-size":v,"--n-line-height":d,"--n-height":y}}),o=s?G("input-group-label",B(()=>t.size[0]),a,t):void 0;return{mergedClsPrefix:e,mergedBordered:l,cssVars:s?void 0:a,themeClass:o==null?void 0:o.themeClass,onRender:o==null?void 0:o.onRender}},render(){var t,l,e;const{mergedClsPrefix:s}=this;return(t=this.onRender)===null||t===void 0||t.call(this),A("div",{class:[`${s}-input-group-label`,this.themeClass],style:this.cssVars},(e=(l=this.$slots).default)===null||e===void 0?void 0:e.call(l),this.mergedBordered?A("div",{class:`${s}-input-group-label__border`}):null)}}),Ce=()=>{const{$api:t}=H();return{listUserServiceAccounts:async(n={})=>await t.get("/list-service-accounts",{params:n}),createServiceAccount:async n=>await t.put("/add-service-accounts",n),deleteServiceAccount:async n=>await t.delete(`/delete-service-accounts?accessKey=${encodeURIComponent(n)}`,{}),createServiceAccountCreds:async n=>await t.post("/service-account-credentials",n),updateServiceAccount:async(n,p)=>await t.post(`/update-service-account?accessKey=${encodeURIComponent(n)}`,p),getServiceAccount:async n=>await t.get(`/info-service-account?accessKey=${encodeURIComponent(n)}`)}},ie={class:"h-full"},ue=k({__name:"copy-input",props:q({readonly:{type:Boolean,default:!1},copyIcon:{type:Boolean,default:!1},id:{type:String,required:!1,default:()=>`copy-input-${Math.random().toString(36).substring(2,15)}`}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const{t:l}=I(),e=t,s=J(t,"modelValue"),u=F(),a=new Y(e.copyIcon?"#"+e.id+"btn":"#"+e.id+"btn2");return a.on("success",function(o){u.success(l("Copy Success")),o.clearSelection()}),a.on("error",function(o){navigator.clipboard&&navigator.clipboard.writeText(s.value||""),u.success(l("Copy Success"))}),Q(()=>{a.destroy()}),(o,n)=>{const p=te,f=W,b=ce,g=U,d=ee;return C(),K("div",ie,[r(d,null,{default:c(()=>[r(p,{value:s.value,"onUpdate:value":n[0]||(n[0]=i=>s.value=i),readonly:e.readonly,id:e.id},null,8,["value","readonly","id"]),e.copyIcon?(C(),V(b,{key:0,class:"flex items-center",id:e.id+"btn","data-clipboard-target":`#${e.id}`},{default:c(()=>[r(f,{size:25,name:"ri:file-copy-line"})]),_:1},8,["id","data-clipboard-target"])):(C(),V(g,{key:1,type:"primary",id:e.id+"btn2","data-clipboard-target":`#${e.id}`},{default:c(()=>[w(S(m(l)("Copy")),1)]),_:1},8,["id","data-clipboard-target"]))]),_:1})])}}});function de(t,l){let e=document.createElement("a");e.setAttribute("href","data:text/plain;charset=utf-8,"+l),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}const xe=k({__name:"notice",emits:["search"],setup(t,{expose:l,emit:e}){const s=h(!1),{t:u}=I(),a=h(""),o=h(""),n=h("");function p(d){a.value=d.credentials.accessKey,o.value=d.credentials.secretKey,n.value=d.url,s.value=!0}const f=e;function b(){s.value=!1,a.value="",o.value="",f("search")}l({openDialog:p});function g(){de("credentials.json",JSON.stringify({url:n.value,accessKey:a.value,secretKey:o.value,api:"s3v4",path:"auto"}))}return(d,i)=>{const v=ue,y=se,N=oe,L=ne,M=Z,z=U,T=ae,j=X;return C(),K("div",null,[r(j,{show:m(s),"onUpdate:show":i[3]||(i[3]=_=>x(s)?s.value=_:null),"mask-closable":!1,preset:"card",title:m(u)("New user has been created"),class:"max-w-screen-md",segmented:{content:!0,action:!0}},{action:c(()=>[r(T,{justify:"center"},{default:c(()=>[r(z,{onClick:i[2]||(i[2]=_=>b())},{default:c(()=>[w(S(m(u)("Cancel")),1)]),_:1}),r(z,{type:"primary",onClick:g},{default:c(()=>[w(S(m(u)("Export")),1)]),_:1})]),_:1})]),default:c(()=>[r(M,null,{default:c(()=>[r(L,{"label-placement":"left","label-align":"right","label-width":130},{default:c(()=>[r(N,{cols:24,"x-gap":18},{default:c(()=>[r(y,{span:24,label:"Access Key"},{default:c(()=>[r(v,{class:"w-full",modelValue:m(a),"onUpdate:modelValue":i[0]||(i[0]=_=>x(a)?a.value=_:null),readonly:!0,"copy-icon":!0},null,8,["modelValue"])]),_:1}),r(y,{span:24,label:"secretkey"},{default:c(()=>[r(v,{class:"w-full",modelValue:m(o),"onUpdate:modelValue":i[1]||(i[1]=_=>x(o)?o.value=_:null),readonly:!0,"copy-icon":!0},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["show","title"])])}}});export{xe as _,Ce as u};
