import{_ as N}from"./EmptyStateBlock-Dt7jmbAi.js";import{f as O,e as V}from"./common-U_VzDrmL.js";import{_ as b}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{d as j,o as r,c as n,a as s,t as u,i as I,B as L,F as m,h as f,b as h,w as A,f as E,n as k,J as M,C as z,r as F,x as p,g as U,K as J,L as K,m as y}from"./index-Bb2UEb_P.js";import{_ as P}from"./ClausesKeeper-CyJ_9bTp.js";import{_ as R}from"./BlockBalanceAgreement-396E9Da8.js";import{u as T}from"./server-KemHlIfj.js";import"./HtmlContent-DrkJBX3e.js";import"./IconCloseCircle-ctElXVvc.js";import"./clauses-Bhz_DuFa.js";import"./index-Dax_IkAt.js";import"./ButtonDefault-CzWpVlv6.js";const q={class:"server-item__wrapper"},H={class:"server-item__header"},Q={class:"tw-flex tw-justify-between tw-items-center"},W={class:"tw-font-bold"},X=["src","title"],Y={class:"tw-text-2xl tw-mt-2"},Z={class:"tw-p-4 tw-space-y-4"},ee={class:"tw-text-gray-500 tw-text-xs"},te={class:"tw-gray-800 tw-text-sm"},se={key:0,class:"server-item__row"},re={class:"server-item__note"},oe={__name:"ServerItem",props:{data:{type:Object,default:()=>({})},specifications:{type:Array,default:()=>[]},image:{type:String,default:""}},setup(o){return(d,c)=>{const i=j("router-link");return r(),n("div",{class:k(["server-item",{"server-item--special":o.data.special}])},[s("div",q,[s("div",H,[s("div",Q,[s("div",W,u(o.data.Name),1),o.image?(r(),n("img",{key:0,src:o.image,title:o.data.OS,alt:"OS Image",class:"tw-size-12"},null,8,X)):I("",!0)]),s("div",Y,u(L(O)(o.data.CostMonth))+" в месяц",1)]),s("div",Z,[(r(!0),n(m,null,f(o.specifications,_=>(r(),n("div",{key:_.label},[s("div",ee,u(_.label),1),s("div",te,u(_.text),1)]))),128)),o.data.UserNotice?(r(),n("div",se,[s("div",re,u(o.data.UserNotice),1)])):I("",!0),h(i,{class:"btn btn--wide btn--border btn--wide",to:`/DSSchemes/${o.data.ID}`},{default:A(()=>c[0]||(c[0]=[E(" Заказать ",-1)])),_:1,__:[0]},8,["to"])])])],2)}}},ae=b(oe,[["__scopeId","data-v-82dd5b92"]]),ne={class:"section"},ce={class:"container"},ie={class:"section-header"},le={class:"section-nav"},de=["title","onClick"],ue={key:0,class:"list"},_e={__name:"DSSchemes",async setup(o){let d,c;const i=M(),_=z(),D=T(),v=F(0);[d,c]=p(()=>i.fetchDSOrders()),await d,c(),[d,c]=p(()=>i.fetchDSSchemes()),await d,c(),[d,c]=p(()=>_.fetchVPSSchemes()),await d,c(),v.value=S()?.[0]?.ServersGroupID;const w=U(()=>Object.keys(i.DSSchemes).filter(e=>i.DSSchemes[e].IsActive).map(e=>i.DSSchemes[e]).sort((e,t)=>e.CostMonth-t.CostMonth));function x(e){v.value=e}function g(e){return D?.serverGroupsList?.ServersGroups?.[e]}function S(){let e={};return Object.values(D?.serverGroupsList?.Servers).forEach(t=>{if(t.ServiceID==="40000"){const l=t.ServersGroupID;e[l]||(e[l]={SortID:t.SortID,ServersGroupID:l,servers:[]}),e[l].servers.push(t)}}),Object.values(e).sort((t,l)=>t.SortID-l.SortID)}function G(e){const t=i.DSSchemes?.[e];return t?V(t):[]}return(e,t)=>{const l=R,C=P,$=ae,B=N;return r(),n(m,null,[h(l),s("section",ne,[s("div",ce,[s("div",ie,[t[0]||(t[0]=s("h1",{class:"section-title"},"Заказ выделенного сервера",-1)),t[1]||(t[1]=s("div",{class:"section-text"}," При покупке этой услуги у вас появляется полностью укомплектованный, настроенный выделенный сервер, с операционной системой на ваш выбор, размещённый в дата-центре в Москве, по самым низким ценам. ",-1)),h(C),J(s("div",le,[(r(!0),n(m,null,f(S(),(a,me)=>(r(),n("div",{class:k(["section-nav__item",{active:String(v.value)===String(a?.ServersGroupID)}]),key:a.ServersGroupID,title:g(a?.ServersGroupID)?.Comment,onClick:ve=>x(a?.ServersGroupID)},u(g(a?.ServersGroupID)?.Name),11,de))),128))],512),[[K,S().length>1]])]),w.value.length?(r(),n("div",ue,[(r(!0),n(m,null,f(w.value,a=>(r(),y($,{key:a.ID,data:a,specifications:G(a.ID),image:a.Image},null,8,["data","specifications","image"]))),128))])):(r(),y(B,{key:1,label:"Нет доступных серверов"}))])])],64)}}},Ge=b(_e,[["__scopeId","data-v-7179441d"]]);export{Ge as default};
