1import{a as oe}from"./chunk-AZFK2ZWP.js";import{a as ie}from"./chunk-DDYF5IDX.js";import"./chunk-7BYDICKO.js";import"./chunk-A3LO4JNH.js";import"./chunk-E7A5YJCQ.js";import"./chunk-HUTCKQES.js";import"./chunk-IKMX3G35.js";import"./chunk-DUITMMC2.js";import"./chunk-5VF46T4M.js";import"./chunk-QIUJKDLX.js";import"./chunk-LLHQ2LV4.js";import{a as H,b as ne}from"./chunk-3MB6GTOG.js";import"./chunk-Y4RJ3W2W.js";import"./chunk-EXE4GFHJ.js";import"./chunk-2OV7VZWS.js";import"./chunk-67HI2W2E.js";import"./chunk-GWGWIYPE.js";import{a as X}from"./chunk-CUYSRBB2.js";import"./chunk-S3ITVV5P.js";import"./chunk-S7LI4S5I.js";import"./chunk-4ISIR6YF.js";import"./chunk-F4PYSTWD.js";import{a as K}from"./chunk-QBKKJWK2.js";import{a as ee}from"./chunk-Z43USFWD.js";import"./chunk-JXAQAEQ4.js";import"./chunk-VYZXNYGM.js";import{a as Q}from"./chunk-NGG2IGAE.js";import"./chunk-Q6CC4I5A.js";import"./chunk-F45JKYPN.js";import"./chunk-EA646BWZ.js";import{c as Z}from"./chunk-IHUJ7NQP.js";import{a as J}from"./chunk-6QNSK322.js";import"./chunk-Z6N6PKIH.js";import{a as x}from"./chunk-VQZDN4LH.js";import"./chunk-7JDJGOL2.js";import"./chunk-FFQATRUK.js";import{b as $}from"./chunk-R2NCGBP5.js";import"./chunk-HA4B4C67.js";import"./chunk-LU75LC6H.js";import{a as te}from"./chunk-XR23TXQD.js";import{E as U}from"./chunk-4HHBMAFL.js";import{Aa as Y,Ma as j,Na as z,f as R,i as L,m as W,pa as V,va as q,za as G}from"./chunk-MWBS76GH.js";import{$b as I,Da as S,Db as k,Ec as y,Ic as g,Jc as v,Kb as B,Kc as b,Q as E,R as P,Wc as C,Xb as u,Zb as _,ac as M,bc as T,bd as p,cc as a,cd as s,dc as m,dd as O,ec as r,fc as l,fd as N,lc as h,ma as f,mb as n,nc as F,ra as w,sa as A,sc as D,uc as c}from"./chunk-BHDTOJOG.js";var ae=()=>["paymentDueDays","paymentMethod"],me=()=>({count:5}),le=()=>["address","description"],pe=()=>({count:3}),de=()=>["user","address"],ce=()=>({count:2}),se=()=>["sellerName","sellerAddress","sellerNIP","sellerREGON"],ge=()=>({count:7});function ue(e,i){e&1&&l(0,"mat-icon",17)}function _e(e,i){e&1&&l(0,"mat-icon",18)}function Ce(e,i){if(e&1){let t=F();m(0,"button",16),D("click",function(){w(t);let o=c();return A(o.downloadPdf())})("keydown.enter",function(){w(t);let o=c();return A(o.downloadPdf())}),u(1,ue,1,0,"mat-icon",17)(2,_e,1,0,"mat-icon",18),g(3),p(4,"i18n"),r()}if(e&2){let t=c();n(),_(t.pdfDownloadLoading()?2:1),n(2),b(" ",s(4,2,"agreements.downloadPdf")," ")}}function fe(e,i){if(e&1&&(m(0,"div",19)(1,"span",20),g(2),p(3,"i18n"),r(),m(4,"span"),g(5),p(6,"date"),r()(),m(7,"div",19)(8,"span",20),g(9),p(10,"i18n"),r(),m(11,"span"),g(12),p(13,"date"),r()(),m(14,"div",19)(15,"span",20),g(16),p(17,"i18n"),r(),m(18,"span"),g(19),p(20,"date"),r()(),l(21,"app-entries-view",12)),e&2){let t=c(),d="dd.MM.yyyy";n(2),b("",s(3,8,"agreements.createdAt"),":"),n(3),v(O(6,10,t.agreement.attributes.createdAt,d)),n(4),b("",s(10,13,"agreements.validFrom"),":"),n(3),v(O(13,15,t.agreement.attributes.validFrom,d)),n(4),b("",s(17,18,"agreements.validTo"),":"),n(3),v(O(20,20,t.agreement.attributes.validTo,d)),n(2),a("entries",t.agreement.attributes)("chosenFields",C(23,ae))}}function be(e,i){if(e&1&&h(0,9),e&2){c();let t=y(36);a("ngTemplateOutlet",t)("ngTemplateOutletContext",C(2,me))}}function xe(e,i){if(e&1&&(m(0,"li"),l(1,"app-entries-view",22),r()),e&2){let t=i.$implicit;n(),a("entries",t)("chosenFields",C(2,le))}}function he(e,i){if(e&1&&(m(0,"ul"),M(1,xe,2,3,"li",null,I),r()),e&2){let t=c(2);n(),T(t.agreement.attributes.buildings)}}function ye(e,i){e&1&&(l(0,"app-alert",21),p(1,"i18n")),e&2&&a("text",s(1,1,"agreements.emptyBuildings"))}function ve(e,i){if(e&1&&u(0,he,3,0,"ul")(1,ye,2,3,"app-alert",21),e&2){let t=c();_(t.agreement.attributes.buildings.length?0:1)}}function Ie(e,i){if(e&1&&h(0,9),e&2){c();let t=y(36);a("ngTemplateOutlet",t)("ngTemplateOutletContext",C(2,pe))}}function Me(e,i){if(e&1&&l(0,"app-entries-view",12),e&2){let t=c();a("entries",t.agreement.attributes)("chosenFields",C(2,de))}}function Te(e,i){if(e&1&&h(0,9),e&2){c();let t=y(36);a("ngTemplateOutlet",t)("ngTemplateOutletContext",C(2,ce))}}function Oe(e,i){if(e&1&&l(0,"app-entries-view",12),e&2){let t=c();a("entries",t.agreement.attributes)("chosenFields",C(2,se))}}function Pe(e,i){if(e&1&&h(0,9),e&2){c();let t=y(36);a("ngTemplateOutlet",t)("ngTemplateOutletContext",C(2,ge))}}function we(e,i){if(e&1&&(m(0,"div",19)(1,"span",20),g(2),r(),m(3,"span"),g(4),r()()),e&2){let t=i.$implicit;n(2),b("",t.label,":"),n(2),v(t.value)}}function Ae(e,i){if(e&1&&M(0,we,5,2,"div",19,I),e&2){let t=c();T(t.agreement.attributes.additional)}}function Ee(e,i){e&1&&(l(0,"app-alert",15),p(1,"i18n")),e&2&&a("text",s(1,1,"global.noData"))}function Se(e,i){e&1&&l(0,"app-skeleton-item",23)}function ke(e,i){if(e&1&&M(0,Se,1,0,"app-skeleton-item",23,I),e&2){let t=i.count,d=c();
1T(d.getSequenceArray(t))}}var rt=(()=>{class e{constructor(){this.service=f(oe),this.i18n=f(j),this.route=f(q),this.router=f(G),this.toast=f(V),this.downloader=f(X),this.itemTitleSvc=f(H),this._=ne(),this.getSequenceArray=J,this.PathEnum=x,this.id=this.route.snapshot.paramMap.get("id")??"",this.number=this.route.snapshot.queryParamMap.get("number")??"",this.returnUrl=this.route.snapshot.queryParamMap.get("return")??`/${x.AGREEMENTS}`,this.agreement=null,this.pdfDownloadLoading=S(!1),this.breadcrumbs=[{id:"0",type:"Breadcrumb",attributes:{title:this.i18n.trans("breadcrumbs.agreements"),url:x.AGREEMENTS}},{id:"0",type:"Breadcrumb",attributes:{title:this.number,url:this.id}}]}ngOnInit(){this.service.getAgreement(this.id).pipe(P()).subscribe({next:t=>{this.agreement=t.data,t.data.attributes.agreementNumber&&this.itemTitleSvc.setItemTitle(t.data.attributes.agreementNumber)},error:()=>{this.toast.open("error",this.i18n.trans("agreements.notFound")),this.router.navigate([x.AGREEMENTS])}})}downloadPdf(){let t=this.agreement?.attributes.pdfId,d=this.agreement?.id;!t||!d||(this.pdfDownloadLoading.set(!0),this.service.getPdf(d,t).pipe(P(),E(()=>this.pdfDownloadLoading.set(!1))).subscribe({next:o=>{if(o.body){let re=o.headers.get("Message")??this.agreement?.id+".pdf";this.downloader.downloadResource(o.body,re,[o.body.type])}},error:()=>{this.toast.open("error",this.i18n.trans("agreements.notFound"))}}))}static{this.\u0275fac=function(d){return new(d||e)}}static{this.\u0275cmp=k({type:e,selectors:[["app-agreements-item"]],decls:37,vars:27,consts:[["loading",""],[1,"d-block","mb-3","mt-2",3,"fullWidth","breadcrumbs"],[1,"buttons"],["matButton","outlined",1,"back",3,"routerLink"],["fontIcon","ti-arrow-narrow-left"],["matButton","filled","type","button"],[1,"grid","mb-5"],[1,"d-block","mb-5"],["icon","ti ti-file-invoice",3,"title"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["icon","ti ti-building",3,"title"],["icon","ti ti-user",3,"title"],["i18nContext","agreements",3,"entries","chosenFields"],["icon","ti ti-user-dollar",3,"title"],["icon","ti ti-file-dots",3,"title"],["type","secondary",3,"text"],["matButton","filled","type","button",3,"click","keydown.enter"],["fontIcon","ti-file-type-pdf"],["fontIcon","ti-loader-2",1,"spinner"],[1,"entry"],[1,"title"],["type","primary","icon","ti ti-info-circle-filled",3,"text"],["i18nContext","agreements.building",3,"entries","chosenFields"],["type","text"]],template:function(d,o){d&1&&(l(0,"app-breadcrumbs",1),m(1,"div",2)(2,"a",3),l(3,"mat-icon",4),g(4),p(5,"i18n"),r(),u(6,Ce,5,4,"button",5),r(),m(7,"div",6)(8,"div")(9,"app-card",7),l(10,"app-card-widget-header",8),p(11,"i18n"),u(12,fe,22,24)(13,be,1,3,"ng-container",9),r(),m(14,"app-card"),l(15,"app-card-widget-header",10),p(16,"i18n"),u(17,ve,2,1)(18,Ie,1,3,"ng-container",9),r()(),m(19,"div")(20,"app-card",7),l(21,"app-card-widget-header",11),p(22,"i18n"),u(23,Me,1,3,"app-entries-view",12)(24,Te,1,3,"ng-container",9),r(),m(25,"app-card",7),l(26,"app-card-widget-header",13),p(27,"i18n"),u(28,Oe,1,3,"app-entries-view",12)(29,Pe,1,3,"ng-container",9),r(),m(30,"app-card"),l(31,"app-card-widget-header",14),p(32,"i18n"),u(33,Ae,2,0)(34,Ee,2,3,"app-alert",15),r()()(),B(35,ke,2,0,"ng-template",null,0,N)),d&2&&(a("fullWidth",!0)("breadcrumbs",o.breadcrumbs),n(2),a("routerLink",o.returnUrl),n(2),b(" ",s(5,15,"global.back")," "),n(2),_(!(o.agreement==null||o.agreement.attributes==null)&&o.agreement.attributes.pdfId?6:-1),n(4),a("title",s(11,17,"agreements.data")+" "+o.number),n(2),_(o.agreement?12:13),n(3),a("title",s(16,19,"agreements.buildings")),n(2),_(o.agreement?17:18),n(4),a("title",s(22,21,"agreements.client")),n(2),_(o.agreement?23:24),n(3),a("title",s(27,23,"agreements.seller")),n(2),_(o.agreement?28:29),n(3),a("title",s(32,25,"agreements.additionalData")),n(2),_(o.agreement&&o.agreement.attributes.additional.length?33:34))},dependencies:[Z,W,R,te,K,Y,ee,ie,Q,U,$,L,z],styles:[".grid[_ngcontent-%COMP%]{margin-top:2rem;display:grid;grid-template-columns:1fr 1fr;grid-row-gap:3rem;grid-column-gap:3rem}@media(max-width:1000px){.grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}app-skeleton-item[_ngcontent-%COMP%]{display:block;margin-top:10px}.entry[_ngcontent-%COMP%]{color:var(--primary-color);margin-bottom:5px}.entry[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:700;margin-right:8px}
1ul[_ngcontent-%COMP%]{margin:0;padding:0}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{list-style:none;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid rgb(222,226,230)}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-of-type{border-bottom:none;margin:0;padding:0}.buttons[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:calc(3rem - 10px);display:flex;align-items:center;gap:10px}",".contrast-blackYellow[_nghost-%COMP%] .entry[_ngcontent-%COMP%], .contrast-blackYellow [_nghost-%COMP%] .entry[_ngcontent-%COMP%]{color:#ff0!important}.contrast-blackYellow[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .contrast-blackYellow [_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{border-bottom-color:#ff0!important}.contrast-blackWhite[_nghost-%COMP%] .entry[_ngcontent-%COMP%], .contrast-blackWhite [_nghost-%COMP%] .entry[_ngcontent-%COMP%]{color:#000!important}.contrast-blackWhite[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .contrast-blackWhite [_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{border-bottom-color:#000!important}"]})}}return e})();export{rt as AgreementsItemComponent};
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.