1import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as A,f as B,r as I}from"./createLucideIcon-CiWnlb16.js";import{d as R,c as _}from"./addLoader-p8WLB-bt.js";import{e as c,ow as q,ox as z,oy as V,oz as G,fN as a,oA as H,oB as h,oC as l,oD as J,oE as K,L as M,oF as O,oG as v,oH as Q,oI as T,oJ as U,oK as W}from"./loginCallback-DUlVA6A0.js";import{B as j}from"./index-CQOuJFSK.js";/* empty css */import{u as X}from"./notistack.esm-h7EINNRQ.js";import{N}from"./NumberRounding-D2cPCpEN.js";import{F as y}from"./FormatNumber-CRRkVCz6.js";import{E as w}from"./ErrorMessage-BzkwuuEb.js";import{C as Y,f as Z,l as f,i as S}from"./creditor-info-readonly-C7ZbYE8m.js";import"./config.release-CKeoGYk7.js";import"./creditorTypes-B9YPhGF4.js";import"./Person-CoHVHeCH.js";const p={anchorOrigin:{vertical:"top",horizontal:"right"}};function fe(){const g=A(),{idPercentage:i,idSatisfaction:n}=B(),m=n==="create",t=c(q),o=c(z),P=c(V),E=c(G),{enqueueSnackbar:d}=X(),s=r=>O(E,r),x=r=>{s(r)&&a(Q(r))};I.useEffect(()=>{C()},[]);const C=()=>{a(H()),a(h({})),a(l(!0));const r=[a(J({idPercentage:i}))];m||r.push(a(K({idPercentage:i,idSatisfaction:n}))),Promise.all(r).finally(()=>a(l(!1)))},b=o?.sum??0,D=(o?.requirementsPercentageSatisfaction??[]).filter(r=>m||String(r.id)!==n).reduce((r,u)=>r+(u.sum??0),0),F=b-D,k=o?.currency?.curAbbreviation??"",L=async()=>{const{ok:r,errors:u}=T(t);if(a(h(u)),!r){d("ÐаполниÑе обÑзаÑелÑнÑе полÑ",{variant:"warning",...p});return}a(l(!0));try{m?await a(U({idPercentage:i,body:t})).unwrap():await a(W({idPercentage:i,id:n,body:t})).unwrap(),d("СоÑ
Ñанено ÑÑпеÑно",{variant:"success",...p}),g(-1)}catch{a(l(!1)),d("ÐÑибка ÑоÑ
ÑанениÑ",{variant:"error",...p})}};return P?e.jsx(M,{}):e.jsxs(R,{type:"section",className:"h-full grid grid-cols-1 xl:grid-cols-[20%_80%]",children:[e.jsx(_,{type:"div",toggle:null,className:"hidden xl:block h-full bg-white border-r border-[#e0e9f1] !z-20",children:e.jsx(j,{className:"page-filters-button",type:"button",value:"Ðазад",onClick:()=>g(-1)})}),e.jsx("div",{className:"min-h-screen flex justify-center py-5 px-10 text-[#334e68] overflow-y-auto",children:e.jsxs("div",{className:"w-full bg-white rounded-xl shadow-[0_4px_20px_rgba(0,0,0,0.04)] border border-[#e0e9f1] p-10",children:[e.jsx("div",{className:"flex justify-between items-center border-b-2 border-[#f7fafd] mb-8",children:e.jsx("h2",{className:"text-[22px] font-bold uppercase text-[color:var(--page-content-title)] tracking-wide m-0",children:"УдовлеÑвоÑение пÑоÑенÑов"})}),e.jsxs("form",{onSubmit:r=>r.preventDefault(),className:"flex flex-col gap-2",children:[o?.creditor&&e.jsxs(e.Fragment,{children:[e.jsx(Y,{creditor:o.creditor}),e.jsx("div",{className:Z.dividerClasses})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 items-start",children:[e.jsxs("div",{children:[e.jsx("label",{className:f(),children:"ТÑÐµÐ±Ð¾Ð²Ð°Ð½Ð¸Ñ / ÐÑÑалоÑÑ"}),e.jsxs("div",{className:"w-full px-4 py-3 rounded-lg border border-[#c0d1e3] bg-[#f8fbfd] text-sm font-semibold text-[#2aa3d0]",children:[y(N(b))," / ",y(N(F))," ",k]})]}),e.jsxs("div",{id:"field-container-sum",children:[e.jsx("label",{className:f(s("sum")),children:"ÐбÑÐ°Ñ ÑÑмма ÑдовлеÑвоÑÑннÑÑ
пÑоÑенÑов"}),e.jsx("input",{type:"number",className:S(s("sum")),value:t.sum??"",placeholder:"0.00",onChange:r=>{x("sum"),a(v({sum:r.target.value===""?null:Number(r.target.value)}))}}),e.jsx(w,{message:s("sum")})]})]}),e.jsxs("div",{id:"field-container-confirmationDocument",children:[e.jsx("label",{className:f(s("confirmationDocument")),children:"ÐодÑвеÑждаÑÑий докÑменÑ"}),e.jsx("textarea",{rows:4,className:S(s("confirmationDocument")),value:t.confirmationDocument??"",placeholder:"ÐаннÑе докÑменÑа, подÑвеÑждаÑÑего ÑдовлеÑвоÑение...",onChange:r=>{x("confirmationDocument"),a(v({confirmationDocument:r.target.value}))}}),e.jsx(w,{message:s("confirmationDocument")})]}),e.jsx("div",{className:"mt-8 flex justify-end",children:e.jsx(j,{type:"button",className:"cr-button cr-button--form",value:"СоÑ
ÑаниÑÑ",onClick:L})})]})]})})]})}export{fe 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.