import{a as e,_ as t}from"./public.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{bU as r,o as l}from"./page_layout.js?v=1763625242172";import{s,d as i}from"./index38.js?v=1763625242172";import{k as n,P as o,r as u,R as c,S as p,X as d,a3 as m,U as _,V as f,aj as v,a4 as x,F as j,u as g}from"./vue.js?v=1763625242172";import{dV as b,dP as S}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./index.js?v=1763625242172";import"./index132.js?v=1763625242172";import"./index99.js?v=1763625242172";import"./index104.js?v=1763625242172";const h={class:"p-20px"},k={class:"w-460px"};const y=n({__name:"index",props:{url:{default:""},mirrors:{default:()=>({})}},emits:["refresh"],setup(n,{expose:y,emit:w}){const D=n,$=w,{t:C}=o(),P=r(),O=u(null),U=u([]),V=({option:e})=>d(j,null,[e.title?"".concat(e.value,"(").concat(e.title,")"):e.label]),B=e=>{O.value=e},F=async()=>{await $("refresh",(e=>{H(e)}))},H=e=>{U.value=Object.entries(e).map((([e,t])=>({label:()=>{let a;return d("div",{class:"flex items-center justify-between w-full"},[d("span",{class:"mr-16px"},["".concat(e,"(").concat(t,")")]),d(l,{type:"error",onClick:t=>{t.stopPropagation(),(async e=>{await i({registry_mirrors_address:e}),await F()})(e)}},(r=a=C("Public.Btn.Del"),"function"==typeof r||"[object Object]"===Object.prototype.toString.call(r)&&!g(r)?a:{default:()=>[a]}))]);var r},title:t,value:e}))),U.value.push({label:C("Docker.Setting.url.index_5"),value:""})};(()=>{const{url:e,mirrors:t}=D;e&&(O.value=e),H(t)})();return y({onConfirm:({hide:t})=>(e({title:C("Docker.Setting.url.confirmTitle"),content:C("Docker.Setting.url.confirmContent"),onConfirm:async({hide:e})=>{await s({registry_mirrors_address:O.value?O.value:""}),P.getSetting(),$("refresh"),e(),t()}}),!1)}),(e,r)=>{const l=b,s=S,i=a,n=t;return c(),p("div",h,[d(i,null,{default:m((()=>[d(s,{label:e.$t("Docker.Setting.index_7"),"show-feedback":!1},{default:m((()=>[_("div",k,[d(l,{value:f(O),"onUpdate:value":r[0]||(r[0]=e=>v(O)?O.value=e:null),filterable:!0,options:f(U),"consistent-menu-width":!1,"render-tag":V,placeholder:e.$t("Docker.Setting.url.index_1"),onSearch:B},null,8,["value","options","placeholder"])])])),_:1},8,["label"])])),_:1}),d(n,{class:"mt-24px"},{default:m((()=>[_("li",null,x(e.$t("Docker.Setting.url.index_2")),1),_("li",null,x(e.$t("Docker.Setting.url.index_3")),1),_("li",null,x(e.$t("Docker.Setting.url.index_4")),1)])),_:1})])}}});export{y as default};
