1import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{e as h,pT as k,d as g,pU as N,pV as B,pW as S,L as I,pX as L,pS as z}from"./loginCallback-DUlVA6A0.js";import{f as v,r as n,u as T,N as u}from"./createLucideIcon-CiWnlb16.js";import{d as E,c as M,E as F}from"./addLoader-p8WLB-bt.js";import{B as $}from"./index-CQOuJFSK.js";import{c as D}from"./convertMessageType-C9ssz3PF.js";import{g as O}from"./generateMessageLink-B1dUCrM3.js";import{M as P}from"./modal-B_oAvykg.js";import{C as A,a as R,T as U,E as W}from"./trash-2-Fs8SSpS2.js";import{C as _}from"./circle-check-DaFJ8kFe.js";import{C as y}from"./circle-alert-BcQG5ICW.js";import{F as X}from"./file-text-D6tQ8mrq.js";import{W as f}from"./wallet-DssIGNoz.js";import{R as V}from"./refresh-cw-BDvND17u.js";import{C as Y}from"./check-Di4ZmmuT.js";import"./config.release-CKeoGYk7.js";const j={1:{label:"Ðе оплаÑен",color:"bg-orange-100 text-orange-400",icon:R,border:"border-orange-300"},2:{label:"ÐÑовеÑка оплаÑÑ",color:"bg-blue-100 text-blue-400",icon:y,border:"border-blue-300"},3:{label:"ÐодÑвеÑжден",color:"bg-emerald-50 text-green-400",icon:_,border:"border-emerald-300"},4:{label:"ÐÑклонен",color:"bg-red-100 text-red-400",icon:A,border:"border-red-300"}};function de(){const s=h(k),a=j[s?.status]||j[1],c=a.icon,l=g(),{billId:d}=v();n.useEffect(()=>{l(N(Number(d)))},[]);const[i,x]=n.useState(!1),m=()=>{x(!i)},o=T(),r=h(B),p=h(S),[w,b]=n.useState(!1),C=async()=>{try{await l(L(Number(s?.idBill))).unwrap(),o("/hub/operator-ic-bills")}catch(t){console.error("ÐÑибка пÑи Ñдалении:",t)}};return e.jsxs(E,{type:"section",children:[e.jsxs("div",{className:"page-wrapper max-lg:grid-cols-1!",children:[e.jsx(M,{type:"div",className:"page-panel-filters no-print max-lg:hidden",toggle:i,handleShowFilters:m,children:e.jsx($,{value:"Ðазад к ÑÑеÑам",onClick:()=>o("/hub/operator-ic-bills"),className:"border-0! mt-2"})}),r?e.jsx(F,{...r}):e.jsx(e.Fragment,{children:p?e.jsx(I,{text:"ÐагÑÑзка..."}):e.jsx("div",{className:"min-h-screen p-8 text-slate-800 font-sans print-only",children:e.jsxs("div",{className:"max-w-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-8 max-sm:mb-6",children:[e.jsx("div",{children:e.jsxs("h1",{className:"text-3xl font-extrabold text-slate-900 tracking-tight",children:["СÑÐµÑ ",e.jsx("span",{className:"text-slate-400",children:"#"}),s?.idBill]})}),e.jsx("div",{className:"flex gap-2 w-full sm:w-auto",children:s?.status===3?null:e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsx(q,{}),e.jsxs("button",{className:"flex-1 sm:flex-none flex items-center cursor-pointer justify-center gap-2 px-5 py-2.5 bg-white border-2 border-red-300 text-red-500 rounded-xl hover:bg-red-50 transition-all active:scale-95 font-medium no-print",onClick:()=>b(!0),children:[e.jsx(U,{size:18}),"УдалиÑÑ"]})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"xl:col-span-2 space-y-6",children:[e.jsx("div",{className:`grid grid-cols-1 lg:grid-cols-[240px_1fr] max-[1024px]:grid-cols-1 items-stretch gap-0 rounded-2xl border-2 ${a.border} ${a.color.split(" ")[0]} bg-opacity-40 backdrop-blur-sm overflow-hidden`,children:e.jsxs("div",{className:"flex items-center gap-4 p-6 shrink-0",children:[e.jsx("div",{className:"p-3 rounded-full bg-white shadow-sm shrink-0",children:e.jsx(c,{size:24,className:`${a.color.split(" ")[1]}`})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase font-bold tracking-widest opacity-60 mb-0.5",children:"СÑаÑÑÑ ÑÑеÑа"}),e.jsx("p",{className:"text-lg font-black leading-tight",children:a.label})]})]})}),e.jsxs("div",{className:"bg-white rounded-3xl shadow-sm border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"p-6 border-b border-slate-50 flex justify-between items-center",children:e.jsxs("h3",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(X,{size:20,className:"text-blue-500"}),"ÐбÑÑÐ²Ð»ÐµÐ½Ð¸Ñ (",s?.countMessages,")"]})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50/50",children:[e.jsx("th",{className:"px-6 py-4 text-[11px] uppercase tracking-widest font-bold text-slate-400",children:"â / Тип"}),e.jsx("th",{className:"px-6 py-4 text-[11px] uppercase tracking-widest font-bold text-slate-400",children:"Ðолжник"}),e.jsx("th",{className:"px-6 py-4 text-[11px] uppercase tracking-widest font-bold text-slate-400 text-right",children:"ÐаÑа"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-50",children:s?.messages.map(t=>e.jsxs("tr",{className:"hover:bg-slate-50/80 transition-colors group",children:[e.jsx("td",{className:"px-6 py-5",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-blue-600 font-bold group-hover:underline cursor-pointer flex items-center gap-1",children:e.jsxs(u,{to:`${O(t.type,t.id)}`,className:"flex justify-center items-center gap-1",children:[t.id," ",e.jsx(W,{size:12})]})}),e.jsx("span",{className:"text-xs text-slate-500 mt-1",children:D(t.type)})]})}),e.jsx("td",{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-2 group-hover:underline cursor-pointer",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-50 flex items-center justify-center text-[10px] font-bold text-blue-600",children:e.jsx(f,{size:20})}),e.jsx(u,{to:`/debtors/debtor/${t.debtor.id}`,children:e.jsx("span",{className:"font-semibold text-slate-700 uppercase tracking-tight",children:t.debtor.organization.short
1Name})})]})}),e.jsx("td",{className:"px-6 py-5 text-right",children:e.jsx("span",{className:"text-sm font-medium text-slate-500",children:new Date(t.published).toLocaleDateString("ru-RU")})})]},t.id))})]})})]})]}),e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"bg-emerald-50 border-2 border-emerald-300 rounded-3xl p-8 text-slate-400 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-10",children:e.jsx(f,{size:120,className:"text-emerald-500"})}),e.jsx("p",{className:"font-medium mb-2! text-emerald-600 text-[22px]",children:"СÑмма к оплаÑе"}),e.jsxs("div",{className:"flex items-baseline gap-2 mb-8",children:[e.jsx("span",{className:"text-5xl font-black text-emerald-600",children:s?.sum.toFixed(2)}),e.jsx("span",{className:"text-xl text-emerald-600 font-medium",children:"BYN"})]}),e.jsxs("div",{className:"space-y-4 relative z-10",children:[e.jsxs("div",{className:"flex justify-between text-sm py-2 border-b border-slate-200/90",children:[e.jsx("span",{className:"text-slate-800",children:"ÐаÑа ÑозданиÑ"}),e.jsx("span",{className:"font-medium text-slate-600",children:s?.datetimeCreate?new Date(s?.datetimeCreate).toLocaleDateString():"â"})]}),e.jsxs("div",{className:"flex justify-between text-sm py-2 border-b border-slate-200/90",children:[e.jsx("span",{className:"text-slate-800",children:"УпÑавлÑÑÑий"}),e.jsx("span",{className:"font-medium text-slate-600 truncate ml-4",children:s?.manager?.name})]})]})]})})]})]})})})]}),w?e.jsx(P,{title:`ÐÑ Ð´ÐµÐ¹ÑÑвиÑелÑно Ñ
оÑиÑе ÑдалиÑÑ ÑÑÐµÑ â${s?.idBill}?`,hidePopup:()=>b(!1),confirm:C,confirmButtonText:"ÐодÑвеÑдиÑÑ",children:"ÐÑи подÑвеÑждении вÑе даннÑе бÑдÑÑ Ð±ÐµÐ·Ð²Ð¾Ð·Ð²ÑаÑно ÑдаленÑ"}):null]})}const q=()=>{const s=g(),{billId:a}=v(),[c,l]=n.useState(!1),[d,i]=n.useState(null),x=async o=>{o.preventDefault(),o.stopPropagation(),l(!0),i(null);try{a&&(await s(z(+a)).unwrap(),s(N(Number(a))))}catch(r){const p=typeof r=="string"?r:r?.message||"Ðе ÑдалоÑÑ Ð¿Ð¾Ð´ÑвеÑдиÑÑ ÑÑеÑ";i(p)}finally{l(!1)}},m="flex-1 sm:flex-none flex items-center justify-center gap-2 px-5 py-2.5 border-2 border-emerald-300 hover:bg-emerald-50 active:scale-95 text-emerald-500 font-medium rounded-xl transition-all cursor-pointer";return d?e.jsxs("button",{type:"button",className:`${m} border-rose-300 text-rose-600 hover:bg-rose-50 active:scale-95`,onClick:x,title:d,children:[e.jsx(y,{size:14}),e.jsx("span",{children:"ÐÑибка. ÐовÑоÑиÑÑ?"})]}):e.jsx("button",{type:"button",className:`${m} border-emerald-300 hover:bg-emerald-50 active:scale-95 disabled:opacity-60 disabled:cursor-not-allowed disabled:active:scale-100`,onClick:x,disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:14,className:"animate-spin"}),e.jsx("span",{children:"ÐодÑвеÑждение..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{size:14}),e.jsx("span",{children:"ÐодÑвеÑдиÑÑ"})]})})};export{q as ConfirmBillButton,de 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.