import{_ as A}from"./ButtonDefault-BIBStZbJ.js";import{_ as E}from"./BasicInput-KlObNzdO.js";import{_ as T}from"./BlockSelectContract-uyQ-oMQe.js";import{Q as B,x as M,r as i,f as r,H as O,s as w,c as d,o as _,a,b as m,h as $,F as U,i as j,t as v}from"./index-CmCGXBst.js";import{_ as x}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./component-0WedTVCo.js";import"./contracts-P7YPBhEI.js";import"./multiselect-DhoC9bwZ.js";const F={class:"modal__body"},L={class:"modal__domain-select"},H={class:"modal__info"},R={class:"modal__lower-block"},W={class:"modal__domain-list"},Y={key:0,class:"domain__grid"},Z={class:"domain__info-wrapper"},K={class:"domain__info-wrapper-vertical"},P={class:"domain__info-wrapper"},Q={class:"domain__info-title"},q={class:"domain__package-name"},z={class:"domain__info-wrapper"},G={class:"domain__price"},J={__name:"ModalWindowDomainTransfer",props:["data"],emits:["modalClose"],setup(X,{emit:I}){const N=I,u=B(),S=M("emitter"),t=i(""),l=i(""),c=i(""),p=i(!1),s=r(()=>u?.domainSchemes),b=r(()=>Object.keys(s.value).map(e=>s.value[e]).find(e=>e.Name===t.value?.split(".")?.[1])?.ID),C=r(()=>Object.keys(s.value).map(e=>s.value[e]).find(e=>e.Name===t.value?.split(".")?.[1])?.DaysAfterTransfer),g=r(()=>Object.keys(s.value).map(e=>s.value[e]).find(e=>e.Name===t.value?.split(".")?.[1])?.DaysBeforeTransfer);function f(){N("modalClose")}function D(){p.value=!0,u.CheckDomainTransfer({ContractID:l.value||null,DomainName:t.value||null,StepID:1}).then(({result:e})=>{e==="SUCCESS"?u.DomainTransfer({ContractID:l.value||null,DomainName:t.value.split(".")[0]||null,AuthInfo:c.value||"",DomainSchemeID:b.value||null,DomainZone:t.value.split(".")[1],DaysBeforeTransfer:g.value||null,DaysAfterTransfer:C.value||null}).then(()=>{S.emit("updateDomainsList"),f()}):p.value=!1})}const y=e=>{e.key==="Enter"&&D()};return O(()=>{document.addEventListener("keyup",y)}),w(()=>{document.removeEventListener("keyup",y)}),(e,o)=>{const h=T,k=E,V=A;return _(),d("div",F,[a("div",L,[o[5]||(o[5]=a("div",{class:"list-item__title"},"Перенос домена",-1)),o[6]||(o[6]=a("div",{class:"list-item__secondary-title"}," Домены в зонах ru/su/рф переносятся без дополнительных условий, во всех остальных зонах переносятся с оплатой продления на год. Ниже приведены цены на продление Вашего доменного имени. ",-1)),a("div",H,[m(h,{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),onButtonClicked:o[1]||(o[1]=n=>f())},null,8,["modelValue"]),m(k,{label:"Доменное имя",placeholder:"yourDomain.ru",necessarily:!0,modelValue:t.value,"onUpdate:modelValue":o[2]||(o[2]=n=>t.value=n)},null,8,["modelValue"]),m(k,{label:"Ключ переноса домена (AuthInfo)",placeholder:"",modelValue:c.value,"onUpdate:modelValue":o[3]||(o[3]=n=>c.value=n)},null,8,["modelValue"])])]),a("div",R,[a("div",W,[s.value?(_(),d("div",Y,[(_(!0),d(U,null,j(s.value,n=>(_(),d("div",{class:"domain__item domain__item_inactive",key:n.ID},[a("div",Z,[a("div",K,[a("div",P,[a("div",Q,"."+v(n?.Name),1)]),a("div",q,v(n?.PackageID),1)])]),a("div",z,[a("div",G,v(n?.CostTransfer)+" ₽",1)])]))),128))])):$("",!0)])]),m(V,{class:"domain__transfer-item",label:"Перенести","is-loading":p.value,disabled:t.value?.length<=0,onClick:o[4]||(o[4]=n=>D())},null,8,["is-loading","disabled"])])}}},re=x(J,[["__scopeId","data-v-9fc160aa"]]);export{re as default};
