System.register(["./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./index-legacy-CHm18dY8.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./useLoading-legacy-IiShPpjk.js?v=1773287522785","./task-view.vue_vue_type_script_setup_true_lang-legacy-Crm0OYtm.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785","./index-legacy-DWPn48Vb.js?v=1773287522785"],(function(e,a){"use strict";var t,l,s,i,d,u,r,c,n,o,_,b,p,g,v,y,f,h,m,w,x,k,j,S,C,P,U,N,q,F;return{setters:[e=>{t=e._},e=>{l=e.Y,s=e.Z,i=e._},e=>{d=e.n,u=e.c},e=>{r=e.u},e=>{c=e._},e=>{n=e.k,o=e.r,_=e.e,b=e.c,p=e.w,g=e.$,v=e.a8,y=e.a9,f=e.a0,h=e.S,m=e._,w=e.Z,x=e.F,k=e.P,j=e.ak},e=>{S=e.a9,C=e.a1,P=e.a6,U=e.aW,N=e.k,q=e.al,F=e.ad},null,null],execute:function(){var a=document.createElement("style");a.textContent=".data-box[data-v-8eccfa2c]{max-height:200px;width:100%;display:flex;flex-direction:column;gap:10px;overflow-y:auto;border-radius:10px;padding:10px;border:1px solid #c7c7c7}\n/*$vite$:1*/",document.head.appendChild(a);const $={class:"data-box"};e("default",u(n({__name:"index",props:{done:{type:Function}},setup(e,{expose:a}){const u=e,n=o(null),T=o([]),Z=o([]),D=_({site_id:null,target_id:null,all:!1,source_site:["file"],db_table:[],create_recovery_point:!1}),L=b((()=>D.db_table.length>0&&D.db_table.length<Z.value.length)),A={site_id:{required:!0,type:"number",trigger:"change",message:"Source site cannot be empty"},target_id:{required:!0,type:"number",trigger:"change",message:"Target site cannot be empty"},source_site:{required:!0,type:"array",trigger:"change",message:"Please select type"},db_table:{required:!0,type:"array",trigger:"change",message:"Please select database table"}};p((()=>D.db_table),(e=>{e.length===Z.value.length?D.all=!0:e.length||(D.all=!1)})),p((()=>D.all),(e=>{e?(D.db_table=Z.value,n.value?.validate()):D.db_table=[]}));const B=async()=>{const{message:e}=await s({set_id:Number(D.site_id)});d(e)&&(Z.value=e,D.db_table=[])},{loading:E,setLoading:I}=r();return(async()=>{try{I(!0);const{message:e}=await i();d(e)&&(T.value=e.map((e=>({label:e.name,value:e.id}))),T.value.length&&(D.site_id=T.value[0].value,B()))}finally{I(!1)}})(),a({onConfirm:async()=>{await(n.value?.validate()),await l({cp_files:!!D.source_site.includes("file"),cp_data_tables:!!D.source_site.includes("db"),is_backup:D.create_recovery_point,data_tables:JSON.stringify(D.source_site.includes("db")?D.db_table:[]),source_id:Number(D.site_id),target_id:Number(D.target_id)}),u.done()}}),(e,a)=>{const l=P,s=C,i=q,d=N,u=U,r=F,o=t,_=S;return g(),v(c,{title:"Copy Progress",params:"wp_copy"},{default:y((()=>[f(_,{show:h(E),class:"p-16px"},{default:y((()=>[f(o,{ref_key:"formRef",ref:n,model:h(D),rules:A},{default:y((()=>[f(s,{label:"Source Site",path:"site_id"},{default:y((()=>[f(l,{class:"w-300px",value:h(D).site_id,"onUpdate:value":[a[0]||(a[0]=e=>h(D).site_id=e),B],options:h(T),filterable:""},null,8,["value","options"])])),_:1}),f(s,{label:"Target site",path:"target_id"},{default:y((()=>[f(l,{class:"w-300px",value:h(D).target_id,"onUpdate:value":a[1]||(a[1]=e=>h(D).target_id=e),options:h(T),filterable:"",placeholder:"Please select target site"},null,8,["value","options"])])),_:1}),f(s,{label:"Copy Type",path:"source_site","show-feedback":!h(D).source_site.length},{default:y((()=>[f(u,{value:h(D).source_site,"onUpdate:value":a[2]||(a[2]=e=>h(D).source_site=e)},{default:y((()=>[f(d,null,{default:y((()=>[f(i,{value:"file",label:"File"}),f(i,{value:"db",label:"Database"})])),_:1})])),_:1},8,["value"])])),_:1},8,["show-feedback"]),f(s,{label:" "},{default:y((()=>[f(r,{"show-icon":!1},{default:y((()=>a[6]||(a[6]=[m("div",null,"Files: Copy the newly added theme and plug-in files from the source wp website to the target wp website. ",-1),m("div",null,"Database: Select the data table in the source wp website and copy it to the target wp website. Note: the existing table will be overwritten!",-1)]))),_:1,__:[6]})])),_:1}),h(D).source_site.includes("db")?(g(),v(s,{key:0,label:" ",path:"db_table"},{default:y((()=>[m("div",$,[f(i,{checked:h(D).all,"onUpdate:checked":a[3]||(a[3]=e=>h(D).all=e),label:e.$t("Public.SelectAll"),indeterminate:h(L)},null,8,["checked","label","indeterminate"]),f(u,{value:h(D).db_table,"onUpdate:value":a[4]||(a[4]=e=>h(D).db_table=e)},{default:y((()=>[f(d,{class:"flex-col!"},{default:y((()=>[(g(!0),w(x,null,k(h(Z),(e=>(g(),v(i,{value:e,label:e,key:e},null,8,["value","label"])))),128))])),_:1})])),_:1},8,["value"])])])),_:1})):j("",!0),f(s,{label:"Backup"},{default:y((()=>[f(i,{checked:h(D).create_recovery_point,"onUpdate:checked":a[5]||(a[5]=e=>h(D).create_recovery_point=e),label:"Create a backup of your target website"},null,8,["checked"])])),_:1})])),_:1},8,["model"])])),_:1},8,["show"])])),_:1})}}}),[["__scopeId","data-v-8eccfa2c"]]))}}}));
