1import{u as I,x as E,p as P,r as i,j as e,B as p,M as O,aC as _,N as h,aD as B,aY as $,ba as L,a8 as G,D as K,V as M,az as F,z as V,a7 as Y}from"./index-DFDoyO67.js";import{d as z}from"./index-DfFJl2mp.js";import{C as H}from"./ContractPdfPreview-DWvywzce.js";import{E as q}from"./eye-BUSqmQJ7.js";import{D as y}from"./download-BE-6ru0j.js";import{U as W}from"./user-BVRapZkx.js";import{P as Q}from"./phone-D9gpSu1Y.js";import{M as J}from"./mail-ugpNGoja.js";import{C as X}from"./circle-check-BGs2Ifd7.js";import{C}from"./clock-BLUhVdj7.js";import"./TextLayer-DKbQ8VJs.js";import"./tiny-invariant-CopsF_GD.js";import"./index-D_tFRsPf.js";import"./index-oCDO3JrU.js";import"./chevron-left-DbDQEHc-.js";import"./chevron-right-Cv6IPUup.js";import"./refresh-cw-Cp9Vzf5J.js";import"./file-search-CuAxD3YE.js";const Z="verpass-contract",T="/verifypass/open-share/verpass/registry/contracts",ee=s=>I({queryKey:[Z,"public",s],queryFn:async()=>{const{data:r}=await E.get(`${T}/${s}`);return r},enabled:!!s}),S=async(s,r="signed-file")=>{const{data:t}=await E.get(`${T}/${s}/${r}`,{responseType:"blob"});return t},A=({label:s,description:r,fileName:t,fetchBlob:c,disabled:o=!1,icon:d=e.jsx(h,{className:"w-6 h-6 text-blue-500"})})=>{const{t:a}=P(["PublicContract","Common"]),[u,m]=i.useState(!1),[l,R]=i.useState(null),[k,f]=i.useState(!1),[j,g]=i.useState(!1),[w,x]=i.useState(null);i.useEffect(()=>()=>{l&&URL.revokeObjectURL(l)},[l]);const D=async()=>{if(l)return l;const b=await c(),v=URL.createObjectURL(b);return R(v),v},U=async()=>{x(null),f(!0);try{await D(),m(!0)}catch{x(a("viewer.previewError","Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ Ð´Ð¾ÐºÑÐ¼ÐµÐ½Ñ Ð´Ð»Ñ Ð¿ÑедпÑоÑмоÑÑа."))}finally{f(!1)}},N=async()=>{x(null),g(!0);try{const b=await c();z(b,t)}catch{x(a("viewer.downloadError","Ðе ÑдалоÑÑ ÑкаÑаÑÑ Ð´Ð¾ÐºÑменÑ."))}finally{g(!1)}};return e.jsxs("div",{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4 p-4 rounded-xl border transition-all ${o?"bg-slate-50 border-slate-100 opacity-60 grayscale":"bg-white border-slate-200 hover:border-blue-300 hover:shadow-md hover:shadow-blue-50/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`p-2.5 rounded-lg ${o?"bg-slate-200":"bg-blue-50"}`,children:d}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-slate-900 m-0",children:s}),r&&e.jsx("p",{className:"text-xs text-slate-500 mt-0.5 m-0",children:r}),w&&e.jsx("p",{className:"text-xs text-red-500 mt-1 m-0",children:w})]})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(p,{className:"flex-1 sm:flex-none",icon:e.jsx(q,{className:"w-4 h-4"}),onClick:U,loading:k,disabled:o,children:a("viewer.preview","ÐÑоÑмоÑÑ")}),e.jsx(p,{type:"primary",className:"flex-1 sm:flex-none bg-[#2448D7]",icon:e.jsx(y,{className:"w-4 h-4"}),onClick:N,loading:j,disabled:o,children:a("viewer.download","СкаÑаÑÑ")})]}),e.jsx(O,{open:u,onCancel:()=>m(!1),footer:e.jsx(p,{type:"primary",className:"bg-[#2448D7]",icon:e.jsx(y,{className:"w-4 h-4"}),onClick:N,loading:j,children:a("viewer.downloadOriginal","СкаÑаÑÑ Ð¾Ñигинал")}),title:e.jsx("span",{className:"font-semibold text-slate-800",children:s}),width:1e3,destroyOnHidden:!0,centered:!0,children:e.jsx("div",{className:"bg-slate-50 p-4 rounded-lg border border-slate-200 mt-4 overflow-hidden",children:l?e.jsx(H,{fileUrl:l}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(_,{size:"large"})})})})]})},se={AWAITING_CARRIER_SIGNATURE:{i18nKey:"status.awaitingCarrierSignature",fallback:"ÐÐ¶Ð¸Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿Ð¸Ñи пеÑевозÑика",color:"bg-amber-100 text-amber-700 border-amber-200",icon:e.jsx(C,{className:"w-3.5 h-3.5 mr-1"})},AWAITING_MODERATOR_SIGNATURE:{i18nKey:"status.awaitingModeratorSignature",fallback:"ÐÐ¶Ð¸Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿Ð¸Ñи компании",color:"bg-amber-100 text-amber-700 border-amber-200",icon:e.jsx(C,{className:"w-3.5 h-3.5 mr-1"})},SIGNED_BY_BOTH_PARTIES:{i18nKey:"status.signedByBothParties",fallback:"ÐодпиÑан обеими ÑÑоÑонами",color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:e.jsx(X,{className:"w-3.5 h-3.5 mr-1"})}},n=({label:s,value:r,icon:t})=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg hover:bg-slate-50 transition-colors",children:[t&&e.jsx(t,{className:"w-5 h-5 text-slate-400 mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-slate-500 mb-0.5",children:s}),e.jsx("div",{className:"text-sm font-semibold text-slate-900",children:r||"â"})]})]}),we=()=>{const{t:s}=P("PublicContract"),{id:r}=B(),{data:t,isLoading:c,isError:o}=ee(r);if(c)return e.jsx($,{});if(o||!t)return e.jsx(L,{type:404,title:s("notFound","ÐÐ¾Ð³Ð¾Ð²Ð¾Ñ Ð½Ðµ найден или ÑÑÑлка недейÑÑвиÑелÑна.")});const d=t.contractStatus==="SIGNED_BY_BOTH_PARTIES",a=se[t.contractStatus],u=a?s(a.i18nKey,a.fallback):t.contractStatus,m=(a==null?void 0:a.color)??"bg-slate-100 text-slate-600 border-slate-200",l=(a==null?void 0:a.icon)??e.jsx(G,{className:"w-3.5 h-3.5 mr-1"});return e.jsxs("div",{className:"max-w-4xl mx-auto pt-24 pb-10 px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 mb-8",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:e.jsx(K,{className:"w-5 h-5 text-[#2448D7]","aria-hidden":"true"})}),e.jsx("h1",{className:"text-2xl font-bold text-slate-900 m-0 tracking-tight",children:s(`title.${t.type}`,"ÐоговоÑ")})]}),e.jsx("p",{className:"text-slate-500 text-sm m-0",children:s("subtitle",{defaultValue:"«ÐеÑиÑиÑиÑованнÑй ÐÑоÑ
од» ⢠ÐокÑÐ¼ÐµÐ½Ñ â{{number}}",number:t.contractNumber})})]}),e.jsxs("div",{className:`w-fit inline-flex items-center px-3 py-1.5 rounded-full border text-sm font-medium ${m}`,children:[l,u]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100 bg-slate-50/50",children:e.jsx("h3",{className:"text-base font-bold text-slate-800 m-0",children:s("counterparty.sectionTitle","ÐнÑоÑмаÑÐ¸Ñ Ð¾ конÑÑагенÑе")})}),e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(n,{icon:M,label:s("counterparty.companyName","Ðазвание компании"),value:t.companyName}),e.jsx(n,{icon:h,label:s("counterparty.identifier","ÐденÑиÑикаÑÐ¾Ñ (ÐÐÐ/ÐÐÐ)"),value:t.identifier}),e.jsx(n,{icon:W,label:s("counterparty.fio","ФÐРзаÑвиÑелÑ"),value:t.fio}),e.jsx(n,{icon:Q,label:s("counterparty.phone","ТелеÑон"),value:t.phone}),e.jsx(n,{icon:J,label:s("counterparty.email","Email"),value:t.email}),t.vehicleCount&&e.jsx(n,{icon:F,label:s("counterparty.vehicleCount","ÐолиÑеÑÑво авÑомобилей"),value:t.vehicleCount}),t.address&&e.jsx("div",{className:"md:col-span-2",children:e.jsx(n,{icon:V,label:s("counterparty.address","ÐдÑÐµÑ ÑегиÑÑÑаÑии"),value:t.address})})]})})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-slate-100 bg-slate-50/50 flex justify-between items-center",children:[e.jsx("h3",{className:"text-base font-bold text-slate-800 m-0",children:s("documents.sectionTitle","ÐокÑменÑÑ")}),!d&&e.jsx("span",{className:"text-xs font-medium text-amber-600 bg-amber-50 px-2 py-1 rounded-md border border-amber-100",children:s("documents.awaitingSignature","ÐÐ¶Ð¸Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿Ð¸ÑаниÑ")})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsx(A,{label:s("documents.printable.label","ÐеÑÑÐ¸Ñ Ð´Ð»Ñ Ð¿ÐµÑаÑи"),description:s("documents.printable.createdAt",{defaultValue:"Создано: {{date}}
1",date:new Date(t.applicationCreatedAt).toLocaleString("ru-RU")}),fileName:`contract-${t.contractNumber}-print.pdf`,icon:e.jsx(h,{className:"w-6 h-6 text-slate-400"}),fetchBlob:()=>S(r,"printable")}),e.jsx(A,{label:s("documents.signed.label","ÐодпиÑаннÑй оÑигинал (Ñ ÐЦÐ)"),description:t.companySignedAt?s("documents.signed.signedAt",{defaultValue:"ÐодпиÑан: {{date}}",date:new Date(t.companySignedAt).toLocaleString("ru-RU")}):s("documents.signed.notSignedYet","Ðока не подпиÑан"),fileName:`contract-${t.contractNumber}-signed.pdf`,icon:e.jsx(Y,{className:`w-6 h-6 ${d?"text-emerald-500":"text-slate-300"}`}),fetchBlob:()=>S(r)})]})]})]})]})};export{we 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.