PageSourceSearch

https://bankrot.gov.by/assets/profile-CdnJrA7_.js

js bankrot.gov.by collected 2026-10-02 04:00:32 UTC 29,662 bytes, 12 lines download raw bytes

1import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as p,N as X}from"./createLucideIcon-CiWnlb16.js";import{d as me,c as ue,N as pe}from"./addLoader-p8WLB-bt.js";import{a as Y,hl as oe,ho as q,hm as k,i0 as G,hZ as O,d as Z,e as z,nT as ce,nU as he,nV as xe,nW as fe,nX as ge,nY as be,nZ as je,n_ as Ne,n$ as ye,o0 as ve,o1 as J,o2 as we,o3 as Ce,o4 as Ie,o5 as _e,o6 as K,m4 as Q,L as ke,o7 as Ae,o8 as Se,o9 as Pe}from"./loginCallback-DUlVA6A0.js";import{B as M}from"./index-CQOuJFSK.js";import{P as Be}from"./PageTitle-BqRYU3UK.js";import{b as ee}from"./Select-YNaQnfBW.js";import{D as se}from"./DeleteOutline-CMp1eq1T.js";import{F as T}from"./fancy-collapsible-B74-J3IN.js";import{A as Xe}from"./alert-notification-qU-wNqnD.js";import{A as te}from"./AccountBalanceWallet-D4X2ZEnK.js";import{P as De}from"./Person-CoHVHeCH.js";import"./config.release-CKeoGYk7.js";import"./createSimplePaletteValueFilter-CXCoacm9.js";import"./TransitionGroupContext-BqazGbpp.js";import"./useSlot-C7WZeYvg.js";import"./IconButton-BXAY2iRp.js";import"./useId-DUHkaswp.js";const Ee=Y(e.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),$e=Y(e.jsx("path",{d:"M19 9.3V4h-3v2.6L12 3 2 12h3v8h5v-6h4v6h5v-8h3zm-9 .7c0-1.1.9-2 2-2s2 .9 2 2z"}),"House"),Re=Y([e.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),e.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong"),ae=/^\+375 \(\d{2}\) \d{3}-\d{2}-\d{2}$/,ne=/^\d{6}$/,le=oe({postalCode:k().regex(ne,"Индекс должен содержать 6 цифр"),city:k().min(1,"Город обязателен"),street:k().optional(),building:k().optional(),apartment:k().optional(),isSameAddress:G().optional(),isPoBox:G().optional(),corrPostalIndex:k().regex(ne,"Индекс должен содержать 6 цифр").optional().or(O("")),corrCity:k().optional(),corrStreet:k().optional(),corrBuilding:k().optional(),corrApartment:k().optional(),mobilePhone:k().regex(ae,"Формат: +375 (XX) XXX-XX-XX"),homePhone:k().regex(ae,"Формат: +375 (XX) XXX-XX-XX").optional().or(O("")),email:k().email("Введите корректный email (например, [email protected])"),skype:k().min(2,"Skype должен содержать минимум 2 символа").optional().or(O("")),cityId:q().nullable().optional(),corrCityId:q().nullable().optional()}),Fe="contactFormData",V=()=>({postalCode:null,city:"",cityId:null,street:"",building:"",apartment:"",isSameAddress:!1,isPoBox:!1,corrPostalIndex:"",corrCity:"",corrCityId:null,corrStreet:"",corrBuilding:"",corrApartment:"",mobilePhone:"",homePhone:"",email:"",skype:""}),ze=p.forwardRef(({onStatusChange:m,initialData:c,disabled:r=!1},b)=>{const P=Z(),x=z(ce),C=z(a=>a.auth.managerId),A=x?.managerId??C,[t,_]=p.useState(()=>c?{...V(),...c}:V()),[h,f]=p.useState({});p.useEffect(()=>{localStorage.setItem(Fe,JSON.stringify(t))},[t]);const d=a=>{if(r)return;const{name:i,value:j,type:N,checked:I}=a.target;_(s=>({...s,[i]:N==="checkbox"?I:j})),f(s=>({...s,[i]:""}))},v=(a,i)=>{const N=le.pick({[a]:!0}).safeParse({[a]:i});if(N.success)return f(I=>({...I,[a]:""})),!0;{const I=N.error.issues[0]?.message||"Ошибка";return f(s=>({...s,[a]:I})),!1}},S=a=>{if(r)return;const{name:i,value:j}=a.target;v(i,j)},E=async(a,i,j)=>{const N=await P(he(a.trim())).unwrap();return{options:N.map(I=>({value:I.id,label:I.name})),count:N.length}},D=a=>{if(r)return;const i=a?.value!=null?Number(a.value):null,j=a?.label??"";_(N=>({...N,cityId:i,city:j})),v("city",j)},$=a=>{if(r)return;const i=a?.value!=null?Number(a.value):null,j=a?.label??"";_(N=>({...N,corrCityId:i,corrCity:j}))},R=t.cityId?{value:t.cityId,label:t.city}:null,F=t.corrCityId?{value:t.corrCityId,label:t.corrCity}:null,W=()=>{const a=x?.id;if(!A||!a)throw new Error("Не найден ID менеджера или персоны");const i={birthDay:x?.birthDate||null,birthPlace:x?.birthPlace||"",lastName:x?.fullName?.split(" ")[0]||"",firstName:x?.fullName?.split(" ")[1]||"",patronymic:x?.fullName?.split(" ")[2]||"",citizenship:x?.citizenship||"",policeAnswer:x?.policeAnswer||null,gender:x?.gender??0,homePhone:t.homePhone,mobilePhone:t.mobilePhone,email:t.email,skype:t.skype},j={postalCode:Number(t.postalCode),cityId:t.cityId,street:t.street,building:t.building,apartment:t.apartment};let N;return t.isSameAddress?N={type:1,postalCode:t.postalCode?Number(t.postalCode):null,cityId:t.cityId??null,street:t.street||"",building:t.building||"",objectNumber:t.apartment||""}:N={type:1,postalCode:t.corrPostalIndex?Number(t.corrPostalIndex):null,cityId:t.corrCityId??null,street:t.corrStreet||"",building:t.corrBuilding||"",objectNumber:t.corrApartment||""},{personData:i,registrationData:j,correspondenceAddress:N,personId:a,managerId:A}},L=()=>{try{return le.parse(t),!0}catch(a){if(a.issues){const i=a.issues[0],j=i.path[0],N=i.message;f(I=>({...I,[j]:N}))}return!1}};p.useImperativeHandle(b,()=>({getData:W,validate:L})),p.useEffect(()=>{c&&_(a=>({...V(),...c}))},[c]);const l=a=>({control:(i,j)=>({...i,borderColor:a?"#ef4444":"#e2e8f0",borderRadius:"0.25rem",padding:"0.1rem 0.7rem",display:"flex",alignItems:"center",height:"42px",boxShadow:j.isFocused?"0 0 0 1px #06b6d4":"none","&:hover":{borderColor:a?"#ef4444":"#06b6d4"},backgroundColor:r?"#f8fafc":"#ffffff",pointerEvents:r?"none":"auto"}),placeholder:i=>({...i,color:"#94a3b8",fontSize:"0.875rem"}),input:i=>({...i,fontSize:"0.875rem",color:r?"#94a3b8":"#1e293b"}),singleValue:i=>({...i,color:r?"#94a3b8":"#1e293b",fontSize:"0.875rem"}),indicatorSeparator:i=>({...i,display:"none"}),dropdownIndicator:i=>({...i,padding:"0 4px",color:"#94a3b8"})}),g=a=>{const i="w-full !px-4 !py-2.5 text-sm bg-white border rounded text-slate-800 placeholder-slate-400 focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-colors disabled:bg-slate-50 disabled:text-slate-400";return h[a]?`${i} border-red-500`:`${i} border-slate-200`},o="block text-xs font-medium text-slate-500 !mb-1.5";return e.jsx("div",{className:"max-w-full bg-white rounded-lg shadow-sm border border-slate-100 overflow-hidden font-sans",children:e.jsxs("form",{className:"!p-4 grid grid-cols-1 md:grid-cols-2 !gap-x-6 !gap-y-6",onSubmit:a=>a.preventDefault(),children:[e.jsxs("div",{className:"!p-4 space-y-4",children:[e.jsx("div",{className:"text-base font-bold text-slate-800 mb-4 tracking-wide",children:"Адрес места жительства"}),e.jsxs("div",{className:"grid grid-cols-3 !gap-3",children:[e.jsxs("div",{className:"col-span-1",children:[e.jsxs("label",{className:o,children:["Индекс ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",name:"postalCode",placeholder:"225154",value:t.postalCode??"",onChange:d,onBlur:S,disabled:r,className:g("postalCode")}),h.postalCode&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:h.postalCode})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsxs("label",{className:o,children:["Город ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(ee,{value:R,placeholder:"Введите город",isClearable:!0,isSearchable:!0,debounceTimeout:300,onChange:D,fetchOptions:E,styles:l(!!h.city),isDisabled:r}),h.city&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:h.city})]})]}),e.jsx("div",{className:"grid grid-cols-3 !gap-3",children:e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:o,children:"Улица / Переулок"}),e.jsx("input",{type:"text",name:"street",placeholder:"Внесите улицу",value:t.street,onChange:d,disabled:r,className:g("street")})]})}),e.jsxs("div",{className:"grid grid-cols-3 !gap-3",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:o,children:"Дом"}),e.jsx("input",{type:"text",name:"building",placeholder:"Введите дом",value:t.building,onChange:d,disabled:r,className:g("building")})]}),e.jsxs("div",{className:"col-span-1",children:[e.jsx("label",{className:o,children:"Корпус/квартира"}),e.jsx("input",{type:"text",name:"apartment",placeholder:"кв. 114",value:t.apartment,onChange:d,disabled:r,className:g("apartment")})]})]}
1),e.jsx("div",{className:"!pt-2 !space-y-2.5 border-t border-slate-100",children:e.jsxs("label",{className:"flex items-center !space-x-3 text-xs text-slate-600 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",name:"isSameAddress",checked:t.isSameAddress,onChange:d,disabled:r,className:"h-4 w-4 rounded border-slate-300 accent-cyan-700"}),e.jsxs("span",{children:["Адрес для корреспонденции ",e.jsx("strong",{className:"text-emerald-600 font-medium",children:"совпадает с почтовым"})]})]})}),!t.isSameAddress&&e.jsxs("div",{className:"!space-y-4 !pt-2 animate-fadeIn",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider",children:"Адрес для корреспонденции"}),e.jsxs("div",{className:"grid grid-cols-3 !gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:o,children:"Индекс"}),e.jsx("input",{type:"text",name:"corrPostalIndex",placeholder:"225154",value:t.corrPostalIndex,onChange:d,onBlur:S,disabled:r,className:g("corrPostalIndex")}),h.corrPostalIndex&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:h.corrPostalIndex})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:o,children:"Город"}),e.jsx(ee,{value:F,placeholder:"Введите город",isClearable:!0,isSearchable:!0,debounceTimeout:300,onChange:$,fetchOptions:E,styles:l(!!h.city),isDisabled:r})]})]}),e.jsx("div",{className:"grid grid-cols-3 !gap-3",children:e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:o,children:"Улица / Переулок"}),e.jsx("input",{type:"text",name:"corrStreet",placeholder:"Внесите улицу",value:t.corrStreet,onChange:d,disabled:r,className:g("corrStreet")})]})}),e.jsxs("div",{className:"grid grid-cols-3 !gap-3",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:o,children:"Дом"}),e.jsx("input",{type:"text",name:"corrBuilding",placeholder:"Введите дом",value:t.corrBuilding,onChange:d,disabled:r,className:g("corrBuilding")})]}),e.jsxs("div",{className:"col-span-1",children:[e.jsx("label",{className:o,children:"Корпус/квартира"}),e.jsx("input",{type:"text",name:"corrApartment",placeholder:"кв. 114",value:t.corrApartment,onChange:d,disabled:r,className:g("corrApartment")})]})]})]})]}),e.jsx("div",{className:"!space-y-4 flex flex-col justify-between",children:e.jsxs("div",{className:"!p-4 space-y-4",children:[e.jsx("div",{className:"text-base font-bold text-slate-800 mb-4 tracking-wide",children:"Телефоны и интернет-контакты"}),e.jsxs("div",{className:"grid grid-cols-2 !gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:o,children:["Мобильный телефон ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",name:"mobilePhone",placeholder:"+375 (XX) XXX-XX-XX",value:t.mobilePhone,onChange:d,onBlur:S,disabled:r,className:g("mobilePhone")}),h.mobilePhone&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:h.mobilePhone})]}),e.jsxs("div",{children:[e.jsx("label",{className:o,children:"Домашний телефон"}),e.jsx("input",{type:"text",name:"homePhone",placeholder:"+375 (XX) XXX-XX-XX",value:t.homePhone,onChange:d,onBlur:S,disabled:r,className:g("homePhone")}),h.homePhone&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:h.homePhone})]})]}),e.jsxs("div",{className:"grid grid-cols-2 !gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:o,children:"Skype"}),e.jsx("input",{type:"text",name:"skype",placeholder:"Логин Skype",value:t.skype,onChange:d,onBlur:S,disabled:r,className:g("skype")}),h.skype&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:h.skype})]}),e.jsxs("div",{children:[e.jsxs("label",{className:o,children:["E-mail ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"email",name:"email",placeholder:"Введите E-mail",value:t.email,onChange:d,onBlur:S,disabled:r,className:g("email")}),h.email&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:h.email})]})]})]})})]})})}),We=oe({paymentAccount:k().transform(m=>m.replace(/\s/g,"").toUpperCase()).refine(m=>/^[A-Z0-9]{28}$/.test(m),{message:"Укажите валидный 28-значный расчетный счет, например, BY88 BELB 3
1012 0027 8700 2022 6000 (можно без пробелов)"})}),Le="_profile_buttons_6ml67_1",He="_profile_button_6ml67_1",Me="_profile_button_save_6ml67_23",Oe="_profile_button_small_6ml67_35",Te="_icon_button_6ml67_41",Ve="_publish_6ml67_49",Ue="_danger_6ml67_54",B={profile_buttons:Le,profile_button:He,profile_button_save:Me,profile_button_small:Oe,icon_button:Te,publish:Ve,danger:Ue};let Ye=1;const ie=()=>`local-${Ye++}`,Ze=()=>({id:0,paymentAccount:"",bankName:"",bankBic:"",_localId:ie()}),qe=()=>({id:0,issuerName:"",walletCredentials:"",_localId:ie()});function U(m){return(m?.paymentAccount??"").trim()!==""&&(m?.bankName??"").trim()!==""&&(m?.bankBic??"").trim()!==""}function re(m){return(m?.issuerName??"").trim()!==""&&(m?.walletCredentials??"").trim()!==""}const Ge=m=>m.map(c=>({...c,id:Number(c.id)})),Je=m=>m.map(c=>({...c,id:Number(c.id)})),Ke=p.forwardRef(({accounts:m=[],wallets:c=[],onStatusChange:r,disabled:b=!1},P)=>{const x=Z(),[C,A]=p.useState([]),[t,_]=p.useState([]),[h,f]=p.useState(""),[d,v]=p.useState({}),S=p.useRef(!1);p.useEffect(()=>{!S.current&&(m.length>0||c.length>0)&&(A(Ge(m)),_(Je(c)),S.current=!0)},[m,c]);const E=s=>{const n=We.shape.paymentAccount.safeParse(s);return n.success?null:n.error.issues[0]?.message||"Неверный формат"},D=(s,n,u)=>{if(b)return;A(w=>w.map((H,de)=>de===s?{...H,[n]:u}:H));const y=C[s]?._localId;y&&n==="paymentAccount"&&v(w=>({...w,[y]:""}))},$=(s,n,u)=>{b||_(y=>y.map((w,H)=>H===s?{...w,[n]:u}:w))},R=s=>{if(b)return;const n=C[s];if(!n)return;const u=E(n.paymentAccount);v(u?y=>({...y,[n._localId||""]:u}):y=>({...y,[n._localId||""]:""}))},F=s=>{},W=()=>{b||A(s=>[...s,Ze()])},L=()=>{b||_(s=>[...s,qe()])},l=async s=>{if(b)return;const n=C[s];if(n){if(n.id>0)try{await x(je(n.id)).unwrap()}catch{f("Ошибка при удалении банковского счета");return}A(u=>u.filter((y,w)=>w!==s)),n._localId&&v(u=>{const y={...u};return delete y[n._localId],y})}},g=async s=>{if(b)return;const n=t[s];if(n){if(n.id>0)try{await x(Ne(n.id)).unwrap()}catch{f("Ошибка при удалении онлайн-кошелька");return}_(u=>u.filter((y,w)=>w!==s))}},o=async()=>{f("");for(const s of C)if(U(s)){const n=E(s.paymentAccount);if(n)throw v(u=>({...u,[s._localId||""]:n})),new Error("Исправьте ошибки в номерах счетов")}for(const s of C)if(U(s))if(s.id>0)await x(xe({id:s.id,data:{paymentAccount:s.paymentAccount,bankName:s.bankName,bankBic:s.bankBic}})).unwrap();else{const n={paymentAccount:s.paymentAccount,bankName:s.bankName,bankBic:s.bankBic},u=await x(fe(n)).unwrap();A(y=>y.map(w=>w._localId===s._localId?{...u,_localId:w._localId,id:Number(u.id)}:w))}for(const s of t)if(re(s))if(s.id>0)await x(ge({id:s.id,data:{issuerName:s.issuerName,walletCredentials:s.walletCredentials}})).unwrap();else{const n={issuerName:s.issuerName,walletCredentials:s.walletCredentials},u=await x(be(n)).unwrap();_(y=>y.map(w=>w._localId===s._localId?{...u,_localId:w._localId,id:Number(u.id)}:w))}};p.useImperativeHandle(P,()=>({saveAll:o}));const a=C.every(U),i=t.every(re),j=a&&i;p.useEffect(()=>{r?.(j)},[j,r]);const N=s=>`w-full !px-4 !py-2.5 text-sm bg-white border rounded text-slate-800 placeholder-slate-400 focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-colors disabled:bg-slate-50 disabled:text-slate-400 ${s?"border-red-500":"border-slate-200"}`,I="block text-xs font-medium text-slate-500 !mb-1.5";return e.jsx("div",{className:"max-w-full bg-white rounded-lg shadow-sm border border-slate-100 overflow-hidden font-sans",children:e.jsxs("div",{className:"!p-8 space-y-4",children:[h&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-600 text-sm rounded-lg px-4 py-3",children:h}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-bold text-slate-800 mb-4 tracking-wide",children:"Банковские счета"}),e.jsxs("div",{className:"space-y-4",children:[C.map((s,n)=>{const u=!!d[s._localId||""];return e.jsxs("div",{className:"grid grid-cols-[2fr_2fr_1fr_auto] gap-3 items-end",children:[e.jsxs("div",{children:[e.jsx("label",{className:I,children:"Номер счета"}),e.jsx("input",{name:"paymentAccount",placeholder:"Введите номер счета",value:s.paymentAccount,onChange:y=>D(n,"paymentAccount",y.target.value),onBlur:()=>R(n),disabled:b,className:N(u)}),u&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:d[s._localId||""]})]}),e.jsxs("div",{children:[e.jsx("label",{className:I,children:"Наименование банка"}),e.jsx("input",{name:"bankName",placeholder:"Введите наименование банка",value:s.bankName,onChange:y=>D(n,"bankName",y.target.value),onBlur:()=>R(n),disabled:b,className:N(!1)})]}),e.jsxs("div",{children:[e.jsx("label",{className:I,children:"БИК"}),e.jsx("input",{name:"bankBic",placeholder:"Введите БИК",value:s.bankBic,onChange:y=>D(n,"bankBic",y.target.value),onBlur:()=>R(n),disabled:b,className:N(!1)})]}),e.jsx("button",{type:"button",title:"Удалить","aria-label":"Удалить",onClick:()=>l(n),disabled:b,className:`button ${B.icon_button} ${B.danger}`,children:e.jsx(se,{fontSize:"small"})})]},s._localId?`a-${s._localId}`:`a-${s.id}`)}
1),e.jsx("div",{children:e.jsx(M,{type:"button",value:"Добавить",onClick:W,disabled:b,className:`${B.profile_button_small} ${B.publish}`})})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-bold text-slate-800 mb-4 tracking-wide",children:"Эмитенты"}),e.jsxs("div",{className:"space-y-4",children:[t.map((s,n)=>e.jsxs("div",{className:"grid grid-cols-[2fr_2fr_auto] gap-3 items-end",children:[e.jsxs("div",{children:[e.jsx("label",{className:I,children:"Эмитент"}),e.jsx("input",{name:"issuerName",placeholder:"Введите эмитент",value:s.issuerName,onChange:u=>$(n,"issuerName",u.target.value),onBlur:()=>F(),disabled:b,className:N(!1)})]}),e.jsxs("div",{children:[e.jsx("label",{className:I,children:"Реквизиты"}),e.jsx("input",{name:"walletCredentials",placeholder:"Введите реквизиты",value:s.walletCredentials,onChange:u=>$(n,"walletCredentials",u.target.value),onBlur:()=>F(),disabled:b,className:N(!1)})]}),e.jsx("button",{type:"button",title:"Удалить","aria-label":"Удалить",onClick:()=>g(n),disabled:b,className:`button ${B.icon_button} ${B.danger}`,children:e.jsx(se,{fontSize:"small"})})]},s._localId?`w-${s._localId}`:`w-${s.id}`)),e.jsx("div",{children:e.jsx(M,{type:"button",value:"Добавить",onClick:L,disabled:b,className:`${B.profile_button_small} ${B.publish}`})})]})]})]})})}),Qe=p.forwardRef(({onStatusChange:m,initialData:c,disabled:r=!1},b)=>{const[P,x]=p.useState(()=>c||{status:"notReady",regions:[]});p.useEffect(()=>{r&&c&&x(c)},[r,c]);const C=["Минск","Брестская область","Витебская область","Гомельская область","Гродненская область","Минская область","Могилевская область"],A=f=>{r||x(d=>({...d,status:f}))},t=f=>{r||x(d=>({...d,regions:d.regions.includes(f)?d.regions.filter(v=>v!==f):[...d.regions,f]}))},_=()=>{if(P.status==="notReady")return null;const f={Минск:1,"Минская область":2,"Гомельская область":4,"Брестская область":8,"Витебская область":16,"Гродненская область":32,"Могилевская область":64};let d=0;for(const v of P.regions)d+=f[v]||0;return d>0?d:null},h=()=>P;return p.useImperativeHandle(b,()=>({getAvailable:_,getData:h})),e.jsx("div",{className:"max-w-full bg-white rounded-lg shadow-sm border border-slate-100 overflow-hidden font-sans",children:e.jsxs("div",{className:"!p-4 space-y-4",children:[e.jsx("div",{className:"text-base font-bold text-slate-800 tracking-wide mb-4",children:"Статус готовности"}),e.jsxs("label",{className:`flex items-center gap-3 cursor-pointer rounded-lg border border-slate-200 p-4 transition ${r?"opacity-60 cursor-not-allowed":"hover:border-blue-200"}`,children:[e.jsx("input",{type:"radio",checked:P.status==="ready",onChange:()=>A("ready"),disabled:r,className:"h-5 w-5 accent-cyan-700"}),e.jsx("div",{className:"font-medium text-slate-700",children:"Готов"})]}),P.status==="ready"&&e.jsxs("div",{className:"ml-8 rounded-lg bg-slate-50 border border-slate-200 p-5 animate-fadeIn",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-4",children:"Выберите регионы"}),e.jsx("div",{className:"grid  gap-x-1 gap-y-0 w-fit",children:C.map(f=>e.jsxs("label",{className:`flex items-center gap-2 cursor-pointer rounded-md py-1 transition ${r?"opacity-60 cursor-not-allowed":"hover:bg-white"}`,children:[e.jsx("input",{type:"checkbox",checked:P.regions.includes(f),onChange:()=>t(f),disabled:r,className:"h-4 w-4 rounded border-slate-300 accent-cyan-700"}),e.jsx("div",{className:"text-sm text-slate-700 whitespace-nowrap",children:f})]},f))})]}),e.jsxs("label",{className:`flex items-center gap-3 cursor-pointer rounded-lg border border-slate-200 p-4 transition ${r?"opacity-60 cursor-not-allowed":"hover:border-blue-200"}`,children:[e.jsx("input",{type:"radio",checked:P.status==="notReady",onChange:()=>A("notReady"),disabled:r,className:"h-5 w-5 accent-cyan-700"}),e.jsx("div",{className:"font-medium text-slate-700",children:"Не готов"})]})]})})});
1function bs(){const m=Z(),c=z(ce),r=z(ye),b=z(ve),P=z(l=>l.auth.managerId),x=c?.managerId??P,[C,A]=p.useState(!1),[t,_]=p.useState(!1),[h,f]=p.useState(!1),[d,v]=p.useState(null),S=p.useRef(null),E=p.useRef(null),D=p.useRef(null);p.useEffect(()=>{m(J())},[m]);const $=()=>{A(l=>!l)},R=()=>{_(!0)},F=l=>{if(l.status==="notReady")return null;const g={Минск:1,"Минская область":2,"Гомельская область":4,"Брестская область":8,"Витебская область":16,"Гродненская область":32,"Могилевская область":64};let o=0;for(const a of l.regions)o+=g[a]||0;return o>0?o:null},W=(l,g)=>{const o=l.address,a={birthDay:l.birthDate||null,birthPlace:l.birthPlace||"",lastName:l.fullName?.split(" ")[0]||"",firstName:l.fullName?.split(" ")[1]||"",patronymic:l.fullName?.split(" ")[2]||"",citizenship:l.citizenship||"",policeAnswer:l.policeAnswer||null,gender:l.gender??0,homePhone:l.homePhone||"",mobilePhone:l.mobilePhone||"",email:l.email||"",skype:l.skype||""},i={postalCode:Number(o?.postalCode)||0,cityId:o?.cityId??null,street:o?.street||"",building:o?.building||"",apartment:o?.apartment||""};let j;return o?.isSameAddress?j={type:1,postalCode:Number(o.postalCode)||0,cityId:o.cityId??null,street:o.street||"",building:o.building||"",objectNumber:o.apartment||""}:j={type:1,postalCode:Number(o?.corrPostalIndex)||0,cityId:o?.corrCityId??null,street:o?.corrStreet||"",building:o?.corrBuilding||"",objectNumber:o?.corrApartment||""},{personData:a,registrationData:i,correspondenceAddress:j,personId:l.id,managerId:g}},L=async()=>{f(!0);try{if(!x)throw new Error("Не найден ID менеджера");let l;if(S.current){if(!S.current.validate())throw new Error("Проверьте правильность заполнения контактной информации");l=S.current.getData()}else{if(!c)throw new Error("Данные профиля отсутствуют");l=W(c,x)}let g=null;D.current?g=D.current.getAvailable():c?.readiness&&(g=F(c.readiness));const o={type:1,number:0,available:g??0,correspondenceAddress:l.correspondenceAddress,comment:"",active:!0,phone:l.personData.mobilePhone,email:l.personData.email,fax:"",webSite:"",personId:l.personId,organizationId:null,monitored:!0};await Promise.all([m(Ae({personId:l.personId,data:l.personData})).unwrap(),m(Se({personId:l.personId,data:l.registrationData})).unwrap(),m(Pe({id:l.managerId,data:o})).unwrap()]),await E.current?.saveAll(),await m(J()).unwrap(),v({state:"success",text:"Данные успешно сохранены"}),setTimeout(()=>v(null),5e3),_(!1)}catch(l){const g=l?.message||"Ошибка сохранения данных";v({state:"error",text:g}),setTimeout(()=>v(null),5e3)}finally{f(!1)}};return e.jsxs(me,{type:"section",children:[e.jsx("style",{children:`
2        .profile-page-nav .page-show-filters span {
3          font-size: 0;
4        }
5        .profile-page-nav .page-show-filters span::before {
6          content: "Скрыть меню";
7          font-size: 19px;
8        }
9        .profile-page-nav.menu-open .page-show-filters span::before {
10          content: "Показать меню";
11        }
12      `}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(ue,{type:"div",className:"page-panel-filters",toggle:C,handleShowFilters:$,children:e.jsxs("div",{className:"-ml-4",children:[e.jsxs(X,{to:"/hub/declarant",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(we,{}),"Свободные дела"]}),e.jsxs(X,{to:"/hub/fund-balance-reports",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(Ce,{}),"Отчеты баланс"]}),e.jsxs(X,{to:"/hub/publications",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(Ie,{}),"Объявления"]}),e.jsxs(X,{to:"/hub/user-bills",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(_e,{}),"Счета"]}),e.jsxs(X,{to:"/hub/creditor-requirements",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(K,{}),"Реестр требований кредиторов"]}),e.jsxs(X,{to:"/hub/certificate-of-completion",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(Re,{}),"Выписать акт"]}),e.jsxs(X,{to:"/hub/debtors-create",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(te,{}),"Добавление должника"]}),e.jsxs(X,{to:"/hub/reports",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(Q,{}),"Отчеты"]}),e.jsxs(X,{to:"/hub/property-reports",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx($e,{}),"Отчеты имущество"]}),e.jsxs(X,{to:"/hub/monitoring",className:"menu-dropdown-item flex items-center gap-2",children:[e.jsx(Q,{}),"Мониторинг сроков"]})]})}),e.jsxs("div",{className:`flex-1 max-w-full space-y-4 ${C?"ml-5":"ml-0"}`,children:[e.jsx("div",{className:`-ml-4 profile-page-nav ${C?"menu-open":""}`,children:e.jsx(pe,{toggle:C,setToggle:A,handleShowFilters:$})}),e.jsxs("div",{className:"flex-1 max-w-full space-y-4 ml-1 mr-5",children:[e.jsx("div",{className:"flex-1 pr-5 mb-[1.25rem] -mt-4",children:e.jsx(Be,{title:"Мой профиль"})}),b?e.jsx("div",{className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:"Не удалось загрузить данные профиля."}):null,r?e.jsx(ke,{text:"Загрузка..."}):e.jsxs(e.Fragment,{children:[c?e.jsx("div",{className:"rounded-lg border border-slate-200 bg-white p-8 shadow-sm",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsx("div",{children:e.jsx("div",{className:"text-lg font-semibold text-slate-800",children:c.fullName||"—"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"h-4 w-4 text-cyan-700"}),c.birthDate?new Date(c.birthDate).toLocaleDateString("ru-RU"):"Дата рождения: —"]})]})}):null,e.jsx(T,{title:"Контактная информация",icon:e.jsx(De,{className:"w=5 h=5 text-cyan-700"}),expanded:!0,children:e.jsx(ze,{ref:S,initialData:c?.address,disabled:!t})}),e.jsx(T,{title:"Банковские счета",icon:e.jsx(te,{className:"w=5 h=5 text-cyan-700"}),children:e.jsx(Ke,{ref:E,accounts:c?.bankAccounts||[],wallets:c?.onlineWallets||[],disabled:!t})}),e.jsx(T,{title:"Готовность к принятию дела",icon:e.jsx(K,{className:"w=5 h=5 text-cyan-700"}),children:e.jsx(Qe,{ref:D,initialData:c?.readiness,disabled:!t})}),e.jsxs("div",{className:"mt-5 pt-5 border-t border-slate-200 flex flex-col items-end gap-3 font-sans",children:[e.jsxs("div",{className:"block text-xs font-medium text-slate-500 !mb-1.5",children:["Поля, отмеченные ",e.jsx("span",{className:"text-red-500 font-semibold",children:"*"}),", обязательны для заполнения"]}),e.jsx("div",{className:B.profile_buttons,children:t?e.jsx(M,{t
12ype:"button",value:h?"Сохранение...":"Сохранить",disabled:h,onClick:L,className:`${B.profile_button_save} ${B.publish}`}):e.jsx(M,{type:"button",value:"Редактировать",disabled:!c,onClick:R,className:`${B.profile_button} ${B.publish}`})})]})]})]})]})]}),d&&e.jsx(Xe,{state:d.state,notification:d.text,onClose:()=>v(null)})]})}export{bs 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.