1import{V as se}from"./C3IXPoP4.js";import{_ as te}from"./CEGjYqgz.js";import{u as z}from"./ZSn6LpYc.js";import{g as ae}from"./D1_MqowL.js";import{V as P}from"./DO78gdLo.js";import{d as O,r as g,w as M,c as h,a as S,o as k,f as _,e as m,u as d,y as x,g as A,j as B,V as T,k as J,n as w,_ as I,A as K,h as U,t as H,F as Q,i as W,b as G,B as oe}from"./CbhbEXF0.js";import{m as ne,b as j,d as le,c as ie,e as ue}from"./B_8VaAQe.js";import{u as q}from"./CPJw7_oI.js";import{V as re}from"./B3YsWmTL.js";import{P as ce}from"./BMRCgUL1.js";import{u as de}from"./C3hW8FnG.js";import"./DUMTsfPB.js";import"./DL-xrZ5r.js";import"./CJdVGRRK.js";import"./Ce0ZLrFR.js";import"./CfR38C_9.js";import"./wSbNHcIL.js";const ve={class:"profile-content flex-column w-100"},pe={class:"flex actions actions-buttons"},_e={class:"flex actions actions-links"},me=O({__name:"profileComponent",async setup(E){let i,v;const r=g(""),s=g(""),u=g(""),t=g(""),a=g([]),f=()=>{a.value=[]},V=z(),$=J(),y=q("token"),l=([i,v]=M(()=>ae()),i=await i,v(),i),e=([i,v]=M(async()=>$fetch("/user",{method:"GET",baseURL:$.public.apiBase,headers:{...l,Authorization:`Bearer ${V.value.access_token||y.value}`},async onResponseError(o){V.value={access_token:void 0,refresh_token:void 0},y.value=null,await w("/auth/login")}})),i=await i,v(),i);e.success?(r.value=e.user.EMAIL,s.value=e.user.PERSONAL_PHONE,u.value=e.user.NAME,t.value=e.user.LAST_NAME):(V.value={access_token:void 0,refresh_token:void 0},y.value=null,[i,v]=M(()=>w("/auth/sign-out",{replace:!0})),await i,v());const c=()=>{f(),s.value=ne(s.value)},C=h(()=>a.value.filter(o=>o.key==="login"&&!!o.value)),p=h(()=>a.value.filter(o=>o.key==="firstname"&&!!o.value)),L=h(()=>a.value.filter(o=>o.key==="lastname"&&!!o.value)),X=h(()=>a.value.filter(o=>o.key==="phone"&&!!o.value)),Y=()=>{r.value=e.user.EMAIL,s.value=e.user.PERSONAL_PHONE,u.value=e.user.NAME,t.value=e.user.LAST_NAME},R=h(()=>{var o,n,N,b;return r.value!==((o=e==null?void 0:e.user)==null?void 0:o.EMAIL)||s.value!==((n=e==null?void 0:e.user)==null?void 0:n.PERSONAL_PHONE)||u.value!==((N=e==null?void 0:e.user)==null?void 0:N.NAME)||t.value!==((b=e==null?void 0:e.user)==null?void 0:b.LAST_NAME)}),F=h(()=>a.value.some(o=>!!o.value)),Z=h(()=>!!(R.value&&r.value&&s.value&&u.value&&t.value&&!F.value)),ee=async()=>{if(a.value.push(j(u.value,"firstname",1)),a.value.push(j(t.value,"lastname",1)),a.value.push(le(s.value,"phone")),a.value.push(ie(r.value,"login")),F.value)return;(await $fetch("/user/update",{method:"POST",body:{email:r.value,phone:ue(s.value)},baseURL:$.public.apiBase,headers:{Authorization:`Bearer ${V.value.access_token||y.value}`}})).success&&await w("/auth/confirm")};return(o,n)=>{const N=te;return k(),S("div",ve,[_(P,{modelValue:d(u),"onUpdate:modelValue":[n[0]||(n[0]=b=>x(u)?u.value=b:null),f],class:"login__field","error-bag":d(p),label:"ÐмÑ",required:""},null,8,["modelValue","error-bag"]),_(P,{modelValue:d(t),"onUpdate:modelValue":[n[1]||(n[1]=b=>x(t)?t.value=b:null),f],"error-bag":d(L),class:"login__field",label:"ФамилиÑ",required:""},null,8,["modelValue","error-bag"]),_(P,{modelValue:d(r),"onUpdate:modelValue":[n[2]||(n[2]=b=>x(r)?r.value=b:null),f],"error-bag":d(C),class:"login__field",label:"E-mail",required:""},null,8,["modelValue","error-bag"]),_(P,{modelValue:d(s),"onUpdate:modelValue":[n[3]||(n[3]=b=>x(s)?s.value=b:null),c],"error-bag":d(X),class:"login__field",label:"ТелеÑон",required:""},null,8,["modelValue","error-bag"]),m("div",pe,[_(T,{class:"login__action",disabled:!d(Z),onClick:ee},{default:A(()=>n[4]||(n[4]=[B(" СоÑ
ÑаниÑÑ ")])),_:1},8,["disabled"]),_(T,{kind:"secondary",class:"login__action cancel-button",disabled:!d(R),onClick:Y},{default:A(()=>n[5]||(n[5]=[B(" ÐÑмена ")])),_:1},8,["disabled"])]),m("div",_e,[_(N,{to:"/auth/change-password"},{default:A(()=>n[6]||(n[6]=[B("СмениÑÑ Ð¿Ð°ÑолÑ")])),_:1}),_(N,{to:"/auth/sign-out"},{default:A(()=>n[7]||(n[7]=[B("ÐÑйÑи из аккаÑнÑа")])),_:1})])])}}}),fe=I(me,[["__scopeId","data-v-a4b371a2"]]),be={class:"subscribe__item"},ge={class:"subscribe__item-title"},he={class:"subscribe__item-description"},ke=O({__name:"subscribeItem",props:{title:{type:String,default:""},description:{type:String,default:""},originValue:{type:Boolean,default:!1}},emits:["update"],setup(E,{emit:i}){const v=E,r=i,s=g(!1);return K(()=>{s.value=!!v.originValue}),(u,t)=>(k(),U(re,{modelValue:d(s),"onUpdate:modelValue":[t[0]||(t[0]=a=>x(s)?s.value=a:null),t[1]||(t[1]=a=>r("update",a))],class:"subscribe__checkbox"},{default:A(()=>[m("div",be,[m("p",ge,H(E.title),1),m("p",he,H(E.description),1)])]),_:1},8,["modelValue"]))}}),Ve=I(ke,[["__scopeId","data-v-0825ae43"]]),Ee={class:"list-wrapper"},ye=O({__name:"subscribesComponent",setup(E){const i=z(),v=J(),r=q("token"),s=g([]),u=g(!0),t=g([]),a=async()=>{var e;const l=await $fetch("/subscriptions",{method:"GET",baseURL:v.public.apiBase,headers:{Authorization:`Bearer ${i.value.access_token||r.value}`}});l.success&&((e=l.items)!=null&&e.length)&&(s.value=l.items)};K(()=>{a()});const f=h(()=>
1{if(!s.value)return[];const l=s.value.filter(p=>!!p.subscribed),e=l.filter(p=>t.value.some(L=>L.id===p.id&&!L.subscribed)),c=t.value.filter(p=>!!p.subscribed);return[...l.filter(p=>e.every(L=>L.id!==p.id)),...c].map(p=>p.id)}),V=(l,e)=>{const c={...e};t.value=t.value.filter(C=>C.id!==e.id),c.subscribed=l,t.value.push(c)},$=h(()=>u.value&&t.value.some(l=>{const e=s.value.find(c=>c.id===l.id);return l.subscribed!==(e==null?void 0:e.subscribed)})),y=async()=>{var e;const l=await $fetch("/subscriptions/update",{method:"POST",body:{id:f.value},baseURL:v.public.apiBase,headers:{Authorization:`Bearer ${i.value.access_token||r.value}`}});l.success&&((e=l.items)!=null&&e.length)&&(s.value=l.items,t.value=[])};return(l,e)=>(k(),S("div",null,[m("div",Ee,[(k(!0),S(Q,null,W(d(s),c=>(k(),U(Ve,{key:c.id,title:c.name,description:c.description,"origin-value":c.subscribed,onUpdate:C=>V(C,c)},null,8,["title","description","origin-value","onUpdate"]))),128))]),_(ce,{"origin-value":"",onUpdate:e[0]||(e[0]=c=>u.value=c)}),_(T,{class:"accept__action",disabled:!d($),onClick:y},{default:A(()=>e[1]||(e[1]=[B(" СоÑ
ÑаниÑÑ ")])),_:1},8,["disabled"])]))}}),Ce=I(ye,[["__scopeId","data-v-345db4ca"]]),Le={class:"login"},Ae={class:"login__title"},$e={class:"login__container"},Ne={class:"flex tabs"},xe=["onClick"],D="ÐиÑнÑй кабинеÑ",Be=O({__name:"account",setup(E){const i=z();!q("token").value&&!i.value.access_token&&w("/auth/sign-out");const r=[{title:"ÐлавнаÑ",to:"/"},{title:D,to:""}],s=["ÐÑоÑилÑ","ÐодпиÑки"],u=g("ÐÑоÑилÑ");return de({title:`ÐолиÑеÑ
ниÑеÑкий мÑзей «${D}»`}),(t,a)=>(k(),S("section",Le,[m("div",Ae,[_(se,{breadcrumbs:r})]),m("div",$e,[a[0]||(a[0]=m("h1",{class:"login__h1"},"ÐиÑнÑй кабинеÑ",-1)),m("div",Ne,[(k(),S(Q,null,W(s,(f,V)=>m("h4",{key:V,class:oe({link:d(u)!==f}),onClick:$=>u.value=f},H(f),11,xe)),64))]),d(u)==="ÐÑоÑилÑ"?(k(),U(fe,{key:0})):G("",!0),d(u)==="ÐодпиÑки"?(k(),U(Ce,{key:1})):G("",!0)])]))}}),Ke=I(Be,[["__scopeId","data-v-13aff0f3"]]);export{Ke as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.