PageSourceSearch

https://www.cerusbank.net/financial-requests.module-YD3J2BVY.js

js cerusbank.net collected 2026-10-01 14:32:13 UTC 102,545 bytes, 1 lines download raw bytes

1import{a as Tt}from"./chunk-IDVEQ7KW.js";import"./chunk-Q23P5MNU.js";import{G as Le,V as Ae,Xb as ke,b as pt}from"./chunk-KAXNKA6Y.js";import"./chunk-7B5EAB4N.js";import"./chunk-P4AWLXSQ.js";import"./chunk-KRRZGW2D.js";import"./chunk-QLBE3UGC.js";import"./chunk-NKPQKUAK.js";import"./chunk-NEUHW5A3.js";import{a as Oe}from"./chunk-LEQJ4IIU.js";import{a as O}from"./chunk-TFLZ2IQR.js";import"./chunk-LYNHHBB7.js";import{b as ii}from"./chunk-NRR7AH3C.js";import{$ as mt,U as ut,V as dt,W as Re,aa as gi,b as ee,ba as zi,c as ui,d as di,g as Ee,ha as me,s as mi,t as pi,u as fi}from"./chunk-XV5UGDTZ.js";import{$ as Y,B as xe,Ba as ce,C as ve,D as I,E as U,Ha as ue,Oa as de,W as ci,Ya as at,Z as J,Za as rt,_ as Z,_a as lt,aa as X,ab as st,b as G,cb as ct,d as F,g as B,ga as ye,h as H,ha as se,jb as Te,kb as hi,l as li,m as re,mb as Ne,nb as Ci,ob as _i,p as K,s as W,sb as De,tb as Me,v as si,vb as Fe,w as le,wb as we,xa as ot,z as Q}from"./chunk-NQAP53SD.js";import{$a as z,$f as ai,Ab as et,Ba as R,Bb as s,C as _e,Cb as C,Db as V,Ga as M,Ha as Se,Hf as tt,Ib as Jt,If as it,J as v,Jb as Zt,Kb as Yt,Kc as ne,Kf as k,Lf as P,Ma as D,Nf as q,Pa as u,Qb as A,Ra as Xe,W as Vt,X as ze,Xf as nt,Ya as y,Z as jt,Za as Gt,Zf as ni,_ as E,_a as Bt,_f as oi,a as Ut,ab as S,ac as Xt,ag as ri,ba as _,bb as a,bg as $,ca as g,cb as o,cg as oe,db as m,dg as ae,hb as b,kb as h,l as Ce,la as $t,le as ti,mb as p,oe as Et,pb as Ht,r as w,rc as ei,ub as Kt,v as Ye,vb as Wt,wb as Qt,xa as r,yf as be}from"./chunk-DF25LJWB.js";import{a as Je,b as Ze,h as ge}from"./chunk-O7S4L63H.js";var x={AGUARDANDO_PAGAMENTO:"AGUARDANDO_PAGAMENTO",AGUARDANDO_MATRICULA:"AGUARDANDO_MATRICULA",AGUARDANDO_CERTIDAO_BUSCA:"AGUARDANDO_CERTIDAO_BUSCA",DEVOLVIDO:"DEVOLVIDO",CONCLUIDO:"CONCLUIDO",CANCELADO:"CANCELADO"},Nt=[x.AGUARDANDO_PAGAMENTO,x.AGUARDANDO_MATRICULA,x.AGUARDANDO_CERTIDAO_BUSCA,x.DEVOLVIDO],Si=x.CONCLUIDO,bi=[x.AGUARDANDO_PAGAMENTO],Dt=[x.CANCELADO],xi={[x.AGUARDANDO_PAGAMENTO]:"gold",[x.AGUARDANDO_MATRICULA]:"blue",[x.AGUARDANDO_CERTIDAO_BUSCA]:"cyan",[x.DEVOLVIDO]:"orange",[x.CONCLUIDO]:"green",[x.CANCELADO]:"red"},vi={[x.AGUARDANDO_PAGAMENTO]:"Aguardando pagamento",[x.AGUARDANDO_MATRICULA]:"Aguardando matr\xEDcula",[x.AGUARDANDO_CERTIDAO_BUSCA]:"Aguardando certid\xE3o de busca",[x.DEVOLVIDO]:"Devolvido",[x.CONCLUIDO]:"Conclu\xEDdo",[x.CANCELADO]:"Cancelado"};var pe=[{key:"AJUIZAMENTO",label:"Ajuizamento"},{key:"PRAZO",label:"Prazo"},{key:"CONSULTIVO",label:"Consultivo"}],Ji={AJUIZAMENTO:"Ajuizamento",PRAZO:"Prazo",CONSULTIVO:"Consultivo"};function Pe(n){return n?Ji[n]??n:"\u2014"}function fe(n){if(n==null)return[];if(typeof n=="string"&&n.trim())return[n.trim()];if(Array.isArray(n)){let c=[];for(let e of n)if(typeof e=="string"&&e.trim())c.push(e.trim());else if(e&&typeof e=="object"&&"message"in e){let t=e.message;typeof t=="string"&&t.trim()&&c.push(t.trim())}return c}return[]}function L(n,c,e){let t=e?.trim()||"Ocorreu um erro.";if(c&&typeof c=="object"&&c!==null){let i=c,l=fe(i.message).join(" ");if(l)return l;let d=fe(i.errors).join(" ");if(d)return d}if(n&&typeof n=="object"&&n!==null&&"error"in n){let i=n.error;if(typeof i=="string"&&i.trim())return i.trim();if(i&&typeof i=="object"){let l=i,d=fe(l.message).join(" ");if(d)return d;let f=fe(l.errors).join(" ");if(f)return f}}return t}function Zi(n,c){if(c&&typeof c=="object"&&c!==null)return c;if(n&&typeof n=="object"&&n!==null&&"error"in n){let e=n.error;if(e&&typeof e=="object")return e}return null}function ft(n,c){let e=Zi(n,c??null);if(!e||e.code!=="DUPLICATE_REQUEST")return null;let t=e.duplicates;return!Array.isArray(t)||!t.length?null:t}function ht(n,c,e){let t=[];if(c&&typeof c=="object"&&c!==null){let i=c;t.push(...fe(i.message)),t.length||t.push(...fe(i.errors))}if(!t.length&&n&&typeof n=="object"&&n!==null&&"error"in n){let i=n.error;if(typeof i=="string"&&i.trim())t.push(i.trim());else if(i&&typeof i=="object"){let l=i;t.push(...fe(l.message)),t.length||t.push(...fe(l.errors))}}if(!t.length){let i=e?.trim()||"Ocorreu um erro.";t.push(i)}return t}var te=(()=>{class n{constructor(e){this.api=e}getStatuses(){return this.api.get("/financial-requests/meta/statuses").pipe(w(e=>this.normalizeStatuses(e?.data)))}getRequestTypes(){return this.api.get("/financial-requests/meta/request-types").pipe(w(e=>this.normalizeRequestTypes(e?.data)))}getPlataformas(){return this.api.get("/financial-requests/meta/plataformas").pipe(w(e=>e?.data??[]))}getSolicitantes(){return this.api.get("/financial-requests/meta/solicitantes").pipe(w(e=>e?.data??[]))}getNotaryOffices(){return this.api.get("/financial-requests/meta/cartorios").pipe(w(e=>e?.data??[]))}createNotaryOffice(e){return this.api.post("/financial-requests/meta/cartorios",{nome:e}).pipe(w(t=>t?.data))}create(e){return this.api.post("/financial-requests",e)}checkDuplicates(e){return this.api.post("/financial-requests/check-duplicates",e).pipe(w(t=>t?.data??[]))}update(e,t){return this.api.patch(`/financial-requests/${encodeURIComponent(e)}`,t)}listSuppliers(e){return this.api.post("/suppliers/list",{ativo:e?.ativo??!0,busca:e?.busca??null}).pipe(w(t=>t?.data??[]))}buildApiListFilter(e){let t={},i=e.solicitacaoStatusCode??e.status;return typeof i=="string"&&i&&(t.solicitacaoStatusCode=i),e.plataforma&&(t.plataforma=e.plataforma),e.solicitanteUuid&&(t.solicitanteUuid=e.solicitanteUuid),e.protocolo?.trim()&&(t.protocolo=e.protocolo.trim()),e.tipo&&(t.tipo=e.tipo),e.condominioUuid&&(t.condominioUuid=e.condominioUuid),e.unidadeUuid&&
1(t.unidadeUuid=e.unidadeUuid),e.dataSolicitacaoFrom&&(t.dataSolicitacaoFrom=e.dataSolicitacaoFrom),e.dataSolicitacaoTo&&(t.dataSolicitacaoTo=e.dataSolicitacaoTo),e.uuids?.length&&(t.uuids=e.uuids),t}list(e){return this.api.post("/financial-requests/list",this.buildApiListFilter(e)).pipe(w(t=>this.extractListRows(t?.data)))}getByUuid(e){return this.api.get(`/financial-requests/${encodeURIComponent(e)}`).pipe(w(t=>this.normalizeRow(t?.data)))}getHistory(e){return this.api.get(`/financial-requests/${encodeURIComponent(e)}/history`).pipe(w(t=>this.normalizeHistoryItems(t?.data)))}patchStatus(e,t,i){return this.api.patch(`/financial-requests/${encodeURIComponent(e)}/status`,{newStatusCode:t,justificativa:i})}launchCost(e){return this.api.post(`/financial-requests/${encodeURIComponent(e)}/launch-cost`,{})}cancelCost(e){return this.api.post(`/financial-requests/${encodeURIComponent(e)}/cancel-cost`,{})}patchBudget(e,t){return this.api.patch(`/financial-requests/${encodeURIComponent(e)}/budget`,t)}allowsBudgetPatchStatus(e){return Nt.includes(e)}canLaunchCost(e){return e.status===Si&&!e.matriculaLancada}getMatriculaStatusLabel(e){return e.matriculaLancada?"Matr\xEDcula lan\xE7ada":"Matr\xEDcula pendente"}getMatriculaStatusColor(e){return e.matriculaLancada?"success":"warning"}isMatriculaPending(e){return!e.matriculaLancada}isRowLocked(e){return!!e.matriculaLancada}canCancelCost(e){return!!e.matriculaLancada}formatDateOnly(e){if(e==null||e==="")return"\u2014";if(e instanceof Date)return Number.isNaN(e.getTime())?"\u2014":e.toLocaleDateString("pt-BR");let t=String(e).trim().split("T")[0].split(" ")[0],i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(i){let d=Number(i[1]),f=Number(i[2]),T=Number(i[3]);return new Date(d,f-1,T).toLocaleDateString("pt-BR")}let l=new Date(e);return Number.isNaN(l.getTime())?"\u2014":l.toLocaleDateString("pt-BR",{timeZone:"UTC"})}isTransitionAllowed(e,t,i,l){if(t===i)return!0;if(t===x.CANCELADO)return!1;if(t===x.CONCLUIDO)return this.isRowLocked(l??{})?!1:Object.values(x).includes(i);if(t===x.DEVOLVIDO)return Object.values(x).includes(i);if(this.isPipelineFlexibleStatusChange(t,i))return!0;let f=e.find(T=>T.key===t)?.allowedNextStatuses;return Array.isArray(f)&&f.length>0?f.includes(i):!0}isPipelineFlexibleStatusChange(e,t){let i=new Set(Nt);return e===x.CANCELADO?!1:t===x.CONCLUIDO?i.has(e):i.has(e)&&i.has(t)}delete(e){return this.api.delete(`/financial-requests/${encodeURIComponent(e)}`)}exportExcel(e){return this.api.postBlobResponse("/financial-requests/export/excel",this.buildApiListFilter(e)).pipe(w(t=>t.body))}exportCsv(e){return this.api.postBlobResponse("/financial-requests/export/csv",this.buildApiListFilter(e)).pipe(w(t=>t.body))}reportSummary(e){return this.api.post("/financial-requests/reports/summary",this.buildApiListFilter(e)).pipe(w(t=>t?.data))}normalizeStatuses(e){return(Array.isArray(e)?e:[]).map(i=>this.normalizeStatusMeta(i)).filter(i=>i.key).sort((i,l)=>i.order-l.order)}normalizeStatusMeta(e){let t=String(e.key??e.value??e.code??e.id??""),i=String(e.label??e.name??e.title??t),l=Number(e.order??e.ordem??e.sort_order??0),d=!!(e.terminal??e.is_terminal??e.finalizador),f=e.allowed_next_statuses??e.allowedNextStatuses??e.allowed_transitions??e.allowedTransitions,T=Array.isArray(f)?f.map(N=>String(N)):void 0;return{key:t,label:i,order:l,terminal:d,allowedNextStatuses:T}}normalizeRequestTypes(e){return(Array.isArray(e)?e:[]).map(i=>{let l=i,d=String(l.uuid??l.key??l.value??l.codigo??l.code??l.id??""),f=String(l.label??l.nome??l.name??l.title??d);return{key:d,label:f}}).filter(i=>i.key)}extractListRows(e){if(Array.isArray(e))return e.map(t=>this.normalizeRow(t));if(e&&typeof e=="object"){let t=e,i=t.items??t.rows??t.list??t.data;if(Array.isArray(i))return i.map(l=>this.normalizeRow(l))}return[]}normalizeRow(e){let t=String(e.uuid??e.id??""),l=this.extractSolicitacaoStatusCode(e)||String(e.status??e.status_key??""),d=e.solicitacao_tipo,f=d&&typeof d=="object"?d:null,N=(f?String(f.uuid??f.codigo??f.code??f.id??""):"")||String(e.request_type??e.requestType??""),ie=f?.nome!=null?String(f.nome):void 0,Ge=f?.descricao!=null?String(f.descricao):void 0,Be=e.observacoes!=null&&String(e.observacoes).trim()?String(e.observacoes).trim():void 0,xt=e.title??e.titulo,Ii=xt
1!=null&&String(xt).trim()?String(xt).trim():"",Ui=ie?.trim()??"",kt=Ii||Ui||Be||"\u2014",vt=e.description!=null?String(e.description):e.descricao!=null?String(e.descricao):void 0;!vt&&Be&&Be!==kt&&(vt=Be);let He=this.toOptionalNumber(e.amount??e.valor??e.value);He!==void 0&&He<=0&&(He=void 0);let Ke=this.toOptionalNumber(e.valor_pago??e.paidAmount);Ke!==void 0&&Ke<=0&&(Ke=void 0);let Vi=e.created_at!=null?String(e.created_at):e.createdAt!=null?String(e.createdAt):void 0,ji=e.updated_at!=null?String(e.updated_at):e.updatedAt!=null?String(e.updatedAt):void 0,$i=e.data_vencimento!=null&&e.data_vencimento!==""?String(e.data_vencimento):e.dueDate!=null?String(e.dueDate):void 0,Gi=e.data_referencia!=null&&e.data_referencia!==""?String(e.data_referencia):void 0,Bi=e.protocolo!=null?String(e.protocolo):void 0,Hi=e.plataforma!=null?String(e.plataforma):void 0,Ki=e.tipo!=null?String(e.tipo):void 0,Wi=!!(e.matricula_lancada??e.matriculaLancada),Qi=!!(e.em_acordo??e.emAcordo),We=e.condominio,Qe=e.unidade,Pt=We&&typeof We=="object"?We:null,qt=Qe&&typeof Qe=="object"?Qe:null,yt=e.empresa_cobranca,It=yt&&typeof yt=="object"?yt:null;return{uuid:t,status:l,requestType:N,title:kt,description:vt,amount:He,paidAmount:Ke,createdAt:Vi,updatedAt:ji,dueDate:$i,referenceDate:Gi,protocol:Bi,platform:Hi,tipo:Ki,condominioUuid:Pt?.uuid!=null?String(Pt.uuid):void 0,unidadeUuid:qt?.uuid!=null?String(qt.uuid):void 0,condominioName:this.extractNestedNome(We),unidadeLabel:this.extractUnidadeLabel(Qe),fornecedorName:this.extractNestedNome(e.fornecedor),solicitanteName:this.extractNestedNome(e.solicitante),chargeCompanyName:It?.nome!=null?String(It.nome):void 0,notaryOfficeName:this.extractNestedNome(e.cartorio),requestTypeNome:ie,requestTypeDescription:Ge,matriculaLancada:Wi,emAcordo:Qi,raw:e}}extractSolicitacaoStatusCode(e){let t=e.solicitacao_status;if(!t||typeof t!="object")return"";let i=t;return String(i.code??i.key??i.value??"")}extractNestedNome(e){if(!e||typeof e!="object")return;let t=e.nome;return t!=null&&String(t).trim()?String(t):void 0}extractUnidadeLabel(e){if(!e||typeof e!="object")return;let t=e,i=t.codigo;if(i!=null&&String(i).trim())return String(i).trim();let l=t.nome;return l!=null&&String(l).trim()?String(l):void 0}toOptionalNumber(e){if(e==null||e==="")return;let t=Number(e);return Number.isFinite(t)?t:void 0}normalizeHistoryItems(e){return(Array.isArray(e)?e:[]).map(i=>this.normalizeHistoryItem(i))}normalizeHistoryItem(e){let t=String(e.acao??e.action??""),i=e.old_data&&typeof e.old_data=="object"?e.old_data:null,l=e.new_data&&typeof e.new_data=="object"?e.new_data:null,d=e.usuario&&typeof e.usuario=="object"?e.usuario:null;return{uuid:String(e.uuid??""),action:t,actionLabel:this.getHistoryActionLabel(t),justificativa:e.justificativa!=null&&String(e.justificativa).trim()?String(e.justificativa).trim():null,createdAt:String(e.created_at??e.createdAt??""),userName:d?.nome!=null?String(d.nome):null,userEmail:d?.email!=null?String(d.email):null,changes:this.buildHistoryChanges(i,l,t)}}getHistoryActionLabel(e){return{create:"Cria\xE7\xE3o",update:"Atualiza\xE7\xE3o",status_change:"Altera\xE7\xE3o de status",launch_cost:"Lan\xE7amento de custo",cancel_cost:"Cancelamento de lan\xE7amento de custo",delete:"Exclus\xE3o"}[e]??e}buildHistoryChanges(e,t,i=""){if(!e&&!t)return[];if(i==="cancel_cost"&&(e?.composicao_uuid!=null||t?.composicao_removida!=null))return[{field:"status_lancamento",label:"Status do lan\xE7amento",oldValue:"Lan\xE7ado",newValue:"Cancelado"}];let l=new Set([...Object.keys(e??{}),...Object.keys(t??{})]),d=[];for(let f of l){if(f==="composicao_uuid"||f==="composicao_removida")continue;let T=e?.[f],N=t?.[f],ie=this.formatHistoryFieldValue(f,T),Ge=this.formatHistoryFieldValue(f,N);ie!==Ge&&d.push({field:f,label:this.getHistoryFieldLabel(f,i),oldValue:ie,newValue:Ge})}return d}getHistoryFieldLabel(e,t=""){return e==="valor"&&t==="launch_cost"?"Valor pago":{protocolo:"Protocolo",plataforma:"Plataforma",tipo:"Tipo",valor:"Valor custo",valor_pago:"Valor pago",data_referencia:"Data refer\xEAncia",data_vencimento:"Data vencimento",condominio_uuid:"Condom\xEDnio",unidade_uuid:"Unidade",status:"Status",status_lancamento:"Status do lan\xE7amento"}[e]??e}formatHistoryFieldValue(e,t){if(t==null||t==="")return"N\xE3o informado";if(e==="valor"||e==="valor_pago"){let i=Number(t);
1if(Number.isFinite(i))return i.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}return e==="status_lancamento"?{lancado:"Lan\xE7ado",cancelado:"Cancelado"}[String(t)]??String(t):typeof t=="boolean"?t?"Sim":"N\xE3o":e==="tipo"?Pe(String(t)):e==="status"?vi[String(t)]??String(t):e==="data_referencia"||e==="data_vencimento"?this.formatDateOnly(String(t)):String(t)}static{this.\u0275fac=function(t){return new(t||n)(jt(ii))}}static{this.\u0275prov=Vt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var he=[{key:"ADM - 1",label:"ADM - 1"},{key:"ADM - 4",label:"ADM - 4"},{key:"SOLUTIONS",label:"SOLUTIONS"}];var Yi=(n,c)=>c.uuid;function Xi(n,c){if(n&1){let e=b();a(0,"tr")(1,"td"),s(2),o(),a(3,"td"),s(4),o(),a(5,"td"),s(6),o(),a(7,"td"),s(8),o(),a(9,"td")(10,"button",6),h("click",function(){let i=_(e).$implicit,l=p();return g(l.select(i.uuid))}),s(11,"Usar esta"),o()()()}if(n&2){let e=c.$implicit,t=p();r(2),C(e.protocolo||"\u2014"),r(2),C(e.status_name||e.status_code||"\u2014"),r(2),C(t.formatMoney(e.valor)),r(2),C(t.formatDate(e.data_referencia))}}var Ct=(()=>{class n{constructor(){this.modalData=E($),this.modalRef=E(oe),this.financialRequestsService=E(te),this.duplicates=this.modalData.duplicates??[]}cancel(){this.modalRef.close({action:"cancel"})}continueAnyway(){this.modalRef.close({action:"continue"})}select(e){this.modalRef.close({action:"select",uuid:e})}formatMoney(e){return e==null||!Number.isFinite(e)?"\u2014":e.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}formatDate(e){return this.financialRequestsService.formatDateOnly(e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=M({type:n,selectors:[["app-financial-request-duplicity-modal"]],standalone:!1,decls:24,vars:2,consts:[["nzSize","small",3,"nzData","nzFrontPagination"],["nzWidth","120px"],["nz-row","","nzJustify","end","nzGutter","8",2,"margin-top","16px"],["nz-col",""],["type","button","nz-button","",3,"click"],["type","button","nz-button","","nzType","primary",3,"click"],["type","button","nz-button","","nzType","link",3,"click"]],template:function(t,i){t&1&&(a(0,"p"),s(1," Foram encontradas solicita\xE7\xF5es com o mesmo condom\xEDnio, unidade, valor e datas. Selecione uma existente ou confirme para continuar com o cadastro. "),o(),a(2,"nz-table",0)(3,"thead")(4,"tr")(5,"th"),s(6,"Protocolo"),o(),a(7,"th"),s(8,"Status"),o(),a(9,"th"),s(10,"Valor"),o(),a(11,"th"),s(12,"Refer\xEAncia"),o(),m(13,"th",1),o()(),a(14,"tbody"),z(15,Xi,12,4,"tr",null,Yi),o()(),a(17,"div",2)(18,"div",3)(19,"button",4),h("click",function(){return i.cancel()}),s(20,"Cancelar"),o()(),a(21,"div",3)(22,"button",5),h("click",function(){return i.continueAnyway()}),s(23,"Continuar mesmo assim"),o()()()),t&2&&(r(2),u("nzData",i.duplicates)("nzFrontPagination",!1),r(13),S(i.duplicates))},dependencies:[q,k,P,U,I,Me,Te,Ne,we,De,Fe],encapsulation:2})}}return n})();var on=()=>({standalone:!0}),Mt=(n,c)=>c.key,an=(n,c)=>c.uuid,rn=(n,c)=>c.field;function ln(n,c){if(n&1&&m(0,"nz-alert",2),n&2){let e=c.$implicit;u("nzMessage",e)}}function sn(n,c){if(n&1&&z(0,ln,1,1,"nz-alert",2,Gt),n&2){let e=p();S(e.errorList)}}function cn(n,c){if(n&1&&m(0,"nz-option",18),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function un(n,c){if(n&1&&m(0,"nz-option",18),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function dn(n,c){if(n&1&&m(0,"nz-option",18),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function mn(n,c){if(n&1){let e=b();a(0,"button",43),h("click",function(){_(e);let i=p(2);return g(i.launchCost())}),s(1," Lan\xE7ar custo "),o()}if(n&2){let e=p(2);u("nzLoading",e.isLaunchingCost)}}function pn(n,c){if(n&1){let e=b();a(0,"button",44),h("click",function(){_(e);let i=p(2);return g(i.confirmCancelCost())}),s(1," Cancelar lan\xE7amento de custo "),o()}if(n&2){let e=p(2);u("nzLoading",e.isCancelingCost)}}function fn(n,c){if(n&1&&m(0,"nz-alert",2),n&2){let e=p(2);u("nzMessage",e.historyError)}}function hn(n,c){n&1&&m(0,"nz-empty",41)}function Cn(n,c){if(n&1&&(a(0,"span"),s(1),o()),n&2){let e=p().$implicit,t=p(3);r(),V(" \u2014 ",t.formatDateTime(e.createdAt),"")}}function _n(n,c){if(n&1&&(a(0,"span"),s(1),o()),n&2){let e=p().$implicit;r(),V(" \u2014 ",e.userName,"")}}function gn(n,c){if(n&1&&(a(0,"p",46)(1,"strong"),s(2,"Justificativa:"),o(),s(3),o()),n&2){let e=p().$implicit;r(3),V(" ",e.justificativa," ")}}function zn(n,c){if(n&1&&(a(0,"tr")(1,"td"),s(2),o(),a(3,"td"),s(4),o(),a(5,"td"),s(6),o()()),n&2){let e=c.$implicit;r(2),C(e.label),r(2),C(e.oldValue),r(2),C(e.newValue)}}function Sn(n,c){if(n&1&&(a(0,"nz-table",47)(1,"thead")(2,"tr")(3,"th"),s(4,"Campo"),o(),a(5,"th"),s(6,"Valor anterior"),o(),a(7,"th"),s(8,"Valor novo"),o()()(),a(9,"tbody"),z(10,zn,7,3,"tr",null,rn),o()()),n&2){let e=p().$implicit;u("nzData",e.changes)("nzFrontPagination",!1)("nzShowPagination",!1),r(10),S(e.changes)}}function bn(n,c){if(n&1&&(a(0,"nz-timeline-item")(1,"p",45)(2,"strong"),s(3),o(),D(4,Cn,2,1,"span")(5,_n,2,1,"span"),o(),D(6,gn,4,1,"p",46)(7,Sn,12,3,"nz-table",47),o()),n&2){let e=c.$implicit;r(3),C(e.actionLabel),r(),y(e.createdAt?4:-1),r(),y(e.userName?5:-1),r(),y(e.justificativa?6:-1),r(),y(e.changes.length?7:-1)}}function xn(n,c){if(n&1&&(a(0,"nz-timeline",42),z(1,bn,8,5,"nz-timeline-item",null,an),o()),n&2){let e=p(2);r(),S(e.historyItems)}}function vn(n,c){if(n&1){let e=b();a(0,"nz-tabset")(1,"nz-tab",3)(2,"nz-descriptions",4)(3,"nz-descriptions-item",5),s(4),o(),a(5,"nz-descriptions-item",6)(6,"div",7)(7,"span",8),s(8),o(),a(9,"nz-tag",9),s(10),o()()(),a(11,"nz-descriptions-item",10),s(12),o(),a(13,"nz-descriptions-item",11),s(14),o(),a(15,"nz-descriptions-item",12),s(16),o()(),m(1
17,"nz-divider",13),a(18,"div",14)(19,"div",15)(20,"div",16)(21,"nz-form-item")(22,"nz-form-label"),s(23,"Tipo"),o(),a(24,"nz-form-control")(25,"nz-select",17),z(26,cn,1,2,"nz-option",18,Mt),o()()()(),a(28,"div",16)(29,"nz-form-item")(30,"nz-form-label"),s(31,"Plataforma"),o(),a(32,"nz-form-control")(33,"nz-select",19),z(34,un,1,2,"nz-option",18,Mt),o()()()()(),a(36,"div",15)(37,"div",16)(38,"nz-form-item")(39,"nz-form-label"),s(40,"Protocolo"),o(),a(41,"nz-form-control"),m(42,"input",20),o()()(),a(43,"div",16)(44,"nz-form-item")(45,"nz-form-label"),s(46,"Data refer\xEAncia"),o(),a(47,"nz-form-control"),m(48,"nz-date-picker",21),o()()()(),a(49,"div",15)(50,"div",16)(51,"nz-form-item")(52,"nz-form-label"),s(53,"Valor custo"),o(),a(54,"nz-form-control"),m(55,"input",22),o()()(),a(56,"div",16)(57,"nz-form-item")(58,"nz-form-label"),s(59,"Valor pago"),o(),a(60,"nz-form-control"),m(61,"input",23),o()()()()(),m(62,"nz-divider",24),a(63,"div",25)(64,"div",26),s(65,"Status"),o(),a(66,"nz-select",27),Yt("ngModelChange",function(i){_(e);let l=p();return Zt(l.selectedStatus,i)||(l.selectedStatus=i),g(i)}),z(67,dn,1,2,"nz-option",18,Mt),o()(),a(69,"div",28)(70,"nz-form-item")(71,"nz-form-label",29),s(72,"Justificativa"),o(),a(73,"nz-form-control",30),m(74,"textarea",31),o()()(),a(75,"div",32)(76,"div",33)(77,"button",34),h("click",function(){_(e);let i=p();return g(i.confirmDelete())}),s(78," Cancelar solicita\xE7\xE3o "),o()(),a(79,"div",35),D(80,mn,2,1,"button",36)(81,pn,2,1,"button",37),a(82,"button",38),h("click",function(){_(e);let i=p();return g(i.close())}),s(83,"Fechar"),o(),a(84,"button",39),h("click",function(){_(e);let i=p();return g(i.saveAll())}),s(85," Salvar "),o()()()(),a(86,"nz-tab",40),h("nzSelect",function(){_(e);let i=p();return g(i.loadHistory())}),a(87,"nz-spin",1),D(88,fn,1,1,"nz-alert",2)(89,hn,1,0,"nz-empty",41)(90,xn,3,0,"nz-timeline",42),o()()()}if(n&2){let e=p();r(2),u("nzColumn",1),r(2),C(e.formatDate(e.row.createdAt)),r(4),C(e.row.condominioName||"\u2014"),r(),u("nzColor",e.matriculaStatusColor),r(),V(" ",e.matriculaStatusLabel," "),r(2),C(e.row.unidadeLabel||"\u2014"),r(2),C(e.row.chargeCompanyName||"\u2014"),r(2),C(e.row.solicitanteName||"\u2014"),r(2),u("formGroup",e.editForm),r(),u("nzGutter",12),r(),u("nzSpan",12),r(6),S(e.tipoOptions),r(2),u("nzSpan",12),r(6),S(e.plataformaOptions),r(2),u("nzGutter",12),r(),u("nzSpan",12),r(6),u("nzSpan",12),r(6),u("nzGutter",12),r(),u("nzSpan",12),r(5),u("options",e.currencyMaskOptions),r(),u("nzSpan",12),r(5),u("options",e.currencyMaskOptions),r(5),Jt("ngModel",e.selectedStatus),u("ngModelOptions",A(33,on))("nzDisabled",!e.canChangeStatusField),r(),S(e.statusOptions),r(2),u("formGroup",e.statusForm),r(8),u("disabled",!e.canDelete)("nzLoading",e.isDeleting),r(3),y(e.canLaunchCost?80:-1),r(),y(e.canCancelCost?81:-1),r(3),u("nzLoading",e.isSaving),r(3),u("nzSpinning",e.isLoadingHistory),r(),y(e.historyError?88:-1),r(),y(!e.isLoadingHistory&&!e.historyItems.length&&!e.historyError?89:-1),r(),y(e.historyItems.length?90:-1)}}var qe=(()=>{class n{constructor(){this.modalData=E($),this.modalRef=E(oe),this.financialRequestsService=E(te),this.nzModal=E(ae),this.fb=E(Q),this.message=E(ye),this.permissionService=E(Oe),this.uuid=this.modalData.uuid,this.statusMeta=this.modalData.statusMeta??[],this.onUpdated=this.modalData.onUpdated,this.row=null,this.selectedStatus=null,this.historyItems=[],this.historyLoaded=!1,this.isLoadingHistory=!1,this.historyError=null,this.tipoOptions=pe,this.plataformaOptions=he,this.currencyMaskOptions={prefix:"R$ ",thousands:".",decimal:",",align:"right",allowNegative:!1},this.isLoading=!1,this.isSaving=!1,this.isDeleting=!1,this.isLaunchingCost=!1,this.isCancelingCost=!1,this.errorList=[],this.canEdit=!1,this.canChangeStatus=!1,this.canDeletePermission=!1,this.editForm=this.fb.group({tipo:[null],protocolo:[""],plataforma:[null],valor:[null],valor_pago:[null],data_referencia:[null]}),this.statusForm=this.fb.group({justificativa:[null,[F.required,F.minLength(10)]]})}ngOnInit(){this.loadPermissions(),this.load()}loadPermissions(){this.permissionService.validateWithoutModal(O.FinancialRequestsEditar,()=>{this.canEdit=!0,this.applyEditLockState()}),this.permissionService.validateWithoutModal(O.FinancialRequestsAlterarStatus,()=>{this.canChangeStatus=!0,this.applyEditLockState()}),this.permissionService.validateWithoutModal(O.FinancialRequestsExcluir,()=>this.canDeletePermission=!0)}get statusOptions(){let e=this.row?.status??"";return this.statusMeta.filter(t=>t.key===e||this.financialRequestsService.isTransitionAllowed(this.statusMeta,e,t.key,this.row??void 0))}get canDelete(){if(!this.canDeletePermission||!this.row||this.statusMeta.find(i=>i.key===this.row.status)?.terminal)return!1;let t=this.row.raw.solicitacao_status;return t&&typeof t=="object"&&t!==null&&"permite_cancelamento"in t?!!t.permite_cancelamento:!0}
1get canLaunchCost(){return this.canChangeStatus&&this.row?this.financialRequestsService.canLaunchCost(this.row):!1}get canCancelCost(){return this.canChangeStatus&&this.row?this.financialRequestsService.canCancelCost(this.row):!1}get canEditFields(){return this.canEdit&&!this.isEditLocked}get canChangeStatusField(){return this.canChangeStatus&&!this.isEditLocked}get isEditLocked(){return this.row?this.financialRequestsService.isRowLocked(this.row):!1}get isMatriculaPending(){return this.row?this.financialRequestsService.isMatriculaPending(this.row):!1}get matriculaStatusLabel(){return this.row?this.financialRequestsService.getMatriculaStatusLabel(this.row):"\u2014"}get matriculaStatusColor(){return this.row?this.financialRequestsService.getMatriculaStatusColor(this.row):"default"}formatMoney(e){return e==null||!Number.isFinite(e)?"\u2014":e.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}formatDate(e){if(!e)return"\u2014";let t=new Date(e);return Number.isNaN(t.getTime())?"\u2014":t.toLocaleDateString("pt-BR")}formatDateTime(e){if(!e)return"\u2014";let t=new Date(e);return Number.isNaN(t.getTime())?"\u2014":t.toLocaleString("pt-BR")}loadHistory(){this.historyLoaded||this.isLoadingHistory||(this.isLoadingHistory=!0,this.historyError=null,this.financialRequestsService.getHistory(this.uuid).pipe(v(()=>this.isLoadingHistory=!1)).subscribe({next:e=>{this.historyItems=e,this.historyLoaded=!0},error:()=>{this.historyError="N\xE3o foi poss\xEDvel carregar o hist\xF3rico."}}))}load(){this.isLoading=!0,this.errorList=[],this.financialRequestsService.getByUuid(this.uuid).pipe(v(()=>this.isLoading=!1)).subscribe({next:e=>{this.row=e,this.selectedStatus=e.status,this.syncEditFormFromRow(e),this.applyEditLockState()},error:e=>this.pushError(e,"N\xE3o foi poss\xEDvel carregar a solicita\xE7\xE3o.")})}parseDate(e){if(!e)return null;let t=e.split("T")[0].split(" ")[0],[i,l,d]=t.split("-"),f=Number(i),T=Number(l),N=Number(d);return!Number.isFinite(f)||!Number.isFinite(T)||!Number.isFinite(N)?null:new Date(f,T-1,N)}toIsoDate(e){if(!e)return null;let t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${l}`}syncEditFormFromRow(e){this.editForm.reset({tipo:e.tipo??null,protocolo:e.protocol??"",plataforma:e.platform??null,valor:e.amount??null,valor_pago:e.paidAmount??null,data_referencia:this.parseDate(e.referenceDate??e.dueDate)},{emitEvent:!1}),this.editForm.markAsPristine()}applyEditLockState(){this.isEditLocked||!this.canEdit?this.editForm.disable({emitEvent:!1}):this.editForm.enable({emitEvent:!1}),this.canChangeStatus?this.isEditLocked||this.statusForm.enable({emitEvent:!1}):this.statusForm.disable({emitEvent:!1})}normalizeOptionalAmount(e){if(e==null||e==="")return null;let t=Number(e);return!Number.isFinite(t)||t<=0?null:t}buildUpdatePayload(e){let t=this.editForm.getRawValue();return{tipo:t.tipo??null,protocolo:String(t.protocolo??"").trim()||null,plataforma:t.plataforma!=null&&String(t.plataforma).trim()||null,valor:this.normalizeOptionalAmount(t.valor),valor_pago:this.normalizeOptionalAmount(t.valor_pago),data_referencia:this.toIsoDate(t.data_referencia),justificativa:e}}saveAll(){if(!this.row||!this.selectedStatus)return;this.errorList=[];let e=this.canEditFields&&this.editForm.dirty,t=this.canChangeStatusField&&this.selectedStatus!==this.row.status;if(!e&&!t){this.modalRef.close();return}if(this.statusForm.invalid){this.statusForm.markAllAsTouched(),this.errorList=["Informe a justificativa com no m\xEDnimo 10 caracteres."];return}let i=String(this.statusForm.value.justificativa).trim();if(this.isSaving=!0,e){this.submitUpdate(this.buildUpdatePayload(i),i,t);return}this.applyStatusChange(i)}submitUpdate(e,t,i){if(!this.row){this.isSaving=!1;return}this.financialRequestsService.update(this.row.uuid,e).subscribe({next:l=>{if(l?.success===!1){this.errorList=ht(null,l,"N\xE3o foi poss\xEDvel salvar a solicita\xE7\xE3o."),this.isSaving=!1;return}if(this.editForm.markAsPristine(),i){this.applyStatusChange(t);return}this.finishSave()},error:l=>{let d=ft(l,l?.error);if(d?.length){this.handleDuplicateUpdate(e,t,i,d);return}this.pushError(l,"N\xE3o foi poss\xEDvel salvar a solicita\xE7\xE3o."),this.isSaving=!1}})}handleDuplicateUpdate(e,t,i,l){return ge(this,null,function*(){let d=yield new Promise(f=>{this.nzModal.create({nzTitle:"Solicita\xE7\xE3o duplicada",nzContent:Ct,nzData:{duplicates:l},nzFooter:null,nzWidth:860}).afterClose.subscribe(N=>f(N??{action:"cancel"}))});if(!d||d.action==="cancel"){this.isSaving=!1;return}if(d.action==="select"){this.isSaving=!1,this.modalRef.close(!1),this.nzModal.create({nzTitle:"Detalhe da solicita\xE7\xE3o",nzContent:n,nzData:{uuid:d.uuid,statusMeta:this.statusMeta,onUpdated:this.onUpdated},nzFooter:null,nzWidth:960}
1);return}this.submitUpdate(Ze(Je({},e),{confirm_duplicity:!0}),t,i)})}applyStatusChange(e){if(!this.row||!this.selectedStatus){this.isSaving=!1;return}if(this.selectedStatus===this.row.status){this.finishSave();return}if(!this.financialRequestsService.isTransitionAllowed(this.statusMeta,this.row.status,this.selectedStatus,this.row)){this.errorList=["Transi\xE7\xE3o de status n\xE3o permitida."],this.isSaving=!1;return}this.financialRequestsService.patchStatus(this.row.uuid,this.selectedStatus,e).pipe(v(()=>this.isSaving=!1)).subscribe({next:t=>{if(t?.success===!1){this.errorList=ht(null,t,"N\xE3o foi poss\xEDvel atualizar o status.");return}this.finishSave()},error:t=>this.pushError(t,"N\xE3o foi poss\xEDvel atualizar o status.")})}finishSave(){this.message.success("Salvo."),this.onUpdated?.(),this.modalRef.close(!0)}launchCost(){if(!this.row||!this.canLaunchCost){this.message.warning("Lan\xE7amento de custo permitido somente com status Conclu\xEDdo");return}this.isLaunchingCost||(this.isLaunchingCost=!0,this.financialRequestsService.launchCost(this.row.uuid).pipe(v(()=>this.isLaunchingCost=!1)).subscribe({next:()=>{this.message.success("Matr\xEDcula lan\xE7ada com sucesso"),this.onUpdated?.(),this.load(),this.applyEditLockState()},error:e=>this.message.error(L(e,e?.error,"Erro ao lan\xE7ar matr\xEDcula"))}))}confirmDelete(){this.canDelete&&this.nzModal.confirm({nzTitle:"Cancelar solicita\xE7\xE3o?",nzC
1ontent:"A solicita\xE7\xE3o ser\xE1 movida para o status Cancelado.",nzOkDanger:!0,nzOnOk:()=>this.runDelete()})}runDelete(){return new Promise(e=>{if(!this.row?.uuid){e();return}this.isDeleting=!0,this.financialRequestsService.delete(this.row.uuid).pipe(v(()=>this.isDeleting=!1)).subscribe({next:t=>{if(t?.success===!1){this.pushError(null,"N\xE3o foi poss\xEDvel cancelar."),e();return}this.onUpdated?.(),this.modalRef.close("cancelled"),e()},error:t=>{this.pushError(t,"N\xE3o foi poss\xEDvel cancelar."),e()}})})}confirmCancelCost(){if(!(!this.row||!this.canCancelCost)){if(this.row.emAcordo){this.message.warning("Esta cobran\xE7a est\xE1 em um acordo");return}this.nzModal.confirm({nzTitle:"Cancelar lan\xE7amento de custo?",nzContent:"A composi\xE7\xE3o de cobran\xE7a vinculada ser\xE1 removida.",nzOkDanger:!0,nzOnOk:()=>this.runCancelCost()})}}runCancelCost(){return new Promise(e=>{if(!this.row?.uuid){e();return}this.isCancelingCost=!0,this.financialRequestsService.cancelCost(this.row.uuid).pipe(v(()=>this.isCancelingCost=!1)).subscribe({next:()=>{this.message.success("Lan\xE7amento de custo cancelado"),this.onUpdated?.(),this.load(),this.applyEditLockState(),e()},error:t=>this.message.error(L(t,t?.error,"Erro ao cancelar lan\xE7amento de custo"))})})}close(){this.modalRef.close()}pushError(e,t){this.errorList=ht(e,null,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=M({type:n,selectors:[["app-financial-request-detail-modal"]],standalone:!1,decls:4,vars:3,consts:[[1,"modal-body-inner"],[3,"nzSpinning"],["nzType","error","nzShowIcon","",1,"mb-md",3,"nzMessage"],["nzTitle","Detalhes"],["nzBordered","","nzSize","small",3,"nzColumn"],["nzTitle","Data inclus\xE3o"],["nzTitle","Condom\xEDnio"],[1,"fr-condominio-cell"],[1,"fr-condominio-name"],[1,"fr-matricula-tag",3,"nzColor"],["nzTitle","Unidade"],["nzTitle","Empresa de Cobran\xE7a"],["nzTitle","Solicitante"],["nzText","Dados edit\xE1veis"],["nz-form","","nzLayout","vertical",1,"edit-section",3,"formGroup"],["nz-row","",3,"nzGutter"],["nz-col","",3,"nzSpan"],["formControlName","tipo","nzPlaceHolder","Selecione","nzShowSearch",""],[3,"nzValue","nzLabel"],["formControlName","plataforma","nzPlaceHolder","Selecione","nzShowSearch","","nzAllowClear",""],["nz-input","","formControlName","protocolo","maxlength","255"],["formControlName","data_referencia","nzFormat","dd/MM/yyyy",2,"width","100%"],["nz-input","","type","text","formControlName","valor","placeholder","R$ 0,00","currencyMask","",1,"money-input",3,"options"],["nz-input","","type","text","formControlName","valor_pago","placeholder","R$ 0,00","currencyMask","",1,"money-input",3,"options"],["nzText","Status"],[1,"field-block"],[1,"field-label"],["nzPlaceHolder","Status",1,"status-select-full",3,"ngModelChange","ngModel","ngModelOptions","nzDisabled"],["nz-form","","nzLayout","vertical",1,"field-block",3,"formGroup"],["nzRequired",""],["nzErrorTip","M\xEDnimo 10 caracteres"],["nz-input","","formControlName","justificativa","rows","3","placeholder","Descreva o motivo da altera\xE7\xE3o"],["nz-row","","nzJustify","space-between","nzAlign","middle",1,"actions-row"],["nz-col",""],["type","button","nz-button","","nzDanger","","nzType","default",3,"click","disabled","nzLoading"],["nz-col","",1,"actions-row__right"],["type","button","nz-button","","nzType","default",3,"nzLoading"],["type","button","nz-button","","nzType","default","nzDanger","",3,"nzLoading"],["type","button","nz-button","",3,"click"],["type","button","nz-button","","nzType","primary",3,"click","nzLoading"],["nzTitle","Hist\xF3rico",3,"nzSelect"],["nzNotFoundContent","N\xE3o h\xE1 altera\xE7\xF5es registradas."],[1,"history-timeline"],["type","button","nz-button","","nzType","default",3,"click","nzLoading"],["type","button","nz-button","","nzType","default","nzDanger","",3,"click","nzLoading"],[1,"history-entry-title"],[1,"history-justification"],["nzSize","small","nzBordered","",1,"history-changes-table",3,"nzData","nzFrontPagination","nzShowPagination"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"nz-spin",1),D(2,sn,2,0)(3,vn,91,34,"nz-tabset"),o()()),t&2&&(r(),u("nzSpinning",i.isLoading),r(),y(i.errorList.length?2:-1),r(),y(i.row?3:-1))},dependencies:[G,B,H,le,li,K,W,Ee,q,k,P,de,pi,mi,fi,ot,U,I,Z,J,X,Y,ee,ce,ue,se,Me,Te,Ne,we,De,Fe,dt,ut,Re,gi,zi,pt],styles:[".mb-md[_ngcontent-%COMP%]{margin-bottom:12px}.modal-body-inner[_ngcontent-%COMP%]{padding-top:4px;min-height:120px}.actions-row[_ngcontent-%COMP%]{margin-top:20px}.actions-row__right[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:12px;justify-content:flex-end}.status-select-full[_ngcontent-%COMP%]{width:100%}.field-block[_ngcontent-%COMP%]{margin-bottom:8px}.field-label[_ngcontent-%COMP%]{font-size:12px;color:#00000073;margin-bottom:4px}.budget-section[_ngcontent-%COMP%], .edit-section[_ngcontent-%COMP%]{margin-bottom:8px}[_nghost-%COMP%]     .money-input.ant-input{text-align:right;font-variant-numeric:tabular-nums}.fr-condominio-cell[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
1.fr-condominio-name[_ngcontent-%COMP%]{line-height:1.4;word-break:break-word}.fr-matricula-tag[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:18px}.history-timeline[_ngcontent-%COMP%]{margin-top:8px}.history-entry-title[_ngcontent-%COMP%]{margin-bottom:4px}.history-justification[_ngcontent-%COMP%]{margin-bottom:8px;color:#000000a6}.history-changes-table[_ngcontent-%COMP%]{margin-bottom:16px;width:100%}[_nghost-%COMP%]     .history-changes-table .ant-table{width:100%}[_nghost-%COMP%]     .history-changes-table table{width:100%!important;table-layout:fixed}[_nghost-%COMP%]     .history-changes-table th, [_nghost-%COMP%]     .history-changes-table td{word-break:break-word;vertical-align:top}[_nghost-%COMP%]     .history-changes-table th:nth-child(1), [_nghost-%COMP%]     .history-changes-table td:nth-child(1){width:28%}[_nghost-%COMP%]     .history-changes-table th:nth-child(2), [_nghost-%COMP%]     .history-changes-table td:nth-child(2), [_nghost-%COMP%]     .history-changes-table th:nth-child(3), [_nghost-%COMP%]     .history-changes-table td:nth-child(3){width:36%}"]})}}return n})();var yn=["notaryOfficeSelect"],En=()=>["condominio"],Tn=()=>["unidade"],Di=(n,c)=>c.uuid,Ot=(n,c)=>c.key;function Nn(n,c){if(n&1){let e=b();a(0,"nz-col",3)(1,"nz-alert",30),h("nzOnClose",function(){let i=_(e).$implicit,l=p();return g(l.closeErrorAlert(i))}),o()()}if(n&2){let e=c.$implicit;r(),Ht("nzMessage",e)}}function Dn(n,c){if(n&1&&m(0,"nz-option",13),n&2){let e=c.$implicit;u("nzValue",e.uuid)("nzLabel",e.nome)}}function Mn(n,c){if(n&1&&m(0,"nz-option",13),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function Fn(n,c){if(n&1&&m(0,"nz-option",13),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function wn(n,c){if(n&1&&m(0,"nz-option",13),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function Rn(n,c){if(n&1&&m(0,"nz-option",13),n&2){let e=c.$implicit;u("nzValue",e.uuid)("nzLabel",e.nome)}}function On(n,c){if(n&1){let e=b();a(0,"button",31),h("mousedown",function(i){return _(e),g(i.preventDefault())})("click",function(){_(e);let i=p();return g(i.addNotaryOffice())}),m(1,"span",32),o()}if(n&2){let e=p();u("nzLoading",e.isAddingNotaryOffice)}}var St=(()=>{class n{constructor(){this.modalData=E($),this.modalRef=E(oe),this.modal=E(ae),this.fb=E(Q),this.financialRequestsService=E(te),this.subs=new Ut,this.requestTypes=this.modalData.requestTypes??[],this.tipoOptions=pe,this.plataformaOptions=he,this.currencyMaskOptions={prefix:"R$ ",thousands:".",decimal:",",align:"right",allowNegative:!1},this.onSuccess=this.modalData.onSuccess,this.errorList=[],this.isSaving=!1,this.suppliers=[],this.isLoadingSuppliers=!1,this.notaryOffices=[],this.isLoadingNotaryOffices=!1,this.isAddingNotaryOffice=!1,this.notaryOfficeSearchTerm="",this.form=this.fb.group({supplier_uuid:[null,[F.required]],solicitacao_tipo_uuid:[null,[F.required]],tipo:[null,[F.required]],title:[null,[F.required]],observacoes:[null],condominio_uuid:[null,[F.required]],unidade_uuid:[null,[F.required]],cartorio_uuid:[null,[F.required]],protocolo:[null,[F.required]],plataforma:[null,[F.required]],valor:[null],data_referencia:[null]})}ngOnInit(){this.loadSuppliers(),this.loadNotaryOffices();let e=this.form.get("condominio_uuid");e&&this.subs.add(e.valueChanges.subscribe(()=>{this.form.patchValue({unidade_uuid:null},{emitEvent:!1})}))}ngOnDestroy(){this.subs.unsubscribe()}closeErrorAlert(e){this.errorList=this.errorList.filter(t=>t!==e)}loadSuppliers(){this.isLoadingSuppliers=!0,this.subs.add(this.financialRequestsService.listSuppliers({ativo:!0}).pipe(v(()=>this.isLoadingSuppliers=!1)).subscribe({next:e=>{this.suppliers=e??[]},error:()=>{this.suppliers=[]}}))}loadNotaryOffices(){this.isLoadingNotaryOffices=!0,this.subs.add(this.financialRequestsService.getNotaryOffices().pipe(v(()=>this.isLoadingNotaryOffices=!1)).subscribe({next:e=>{this.notaryOffices=e??[]},error:()=>{this.notaryOffices=[]}}))}onNotaryOfficeSearch(e){let t=(e??"").trim();t&&(this.notaryOfficeSearchTerm=t)}resolveNotaryOfficeName(){let e=this.notaryOfficeSearchTerm.trim();return e||(this.notaryOfficeSelectRef?.nativeElement?.querySelector(".ant-select-selection-search-input")?.value?.trim()??"")}addNotaryOffice(){let e=this.resolveNotaryOfficeName();if(!e){this.errorList=["Informe o nome do cart\xF3rio para adicionar."];return}let t=this.notaryOffices.find(i=>i.nome.trim().toLowerCase()===e.toLowerCase());if(t){this.form.patchValue({cartorio_uuid:t.uuid}),this.notaryOfficeSearchTerm="";return}this.isAddingNotaryOffice=!0,this.errorList=[],this.subs.add(this.financialRequestsService.createNotaryOffice(e).pipe(v(()=>this.isAddingNotaryOffice=!1)).subscribe({next:i=>{if(!i?.uuid){this.errorList=["N\xE3o foi poss\xEDvel adicionar o cart\xF3rio."];return}this.notaryOffices.some(d=>d.uuid===i.uuid)||(this.notaryOffices=[...this.notaryOffices,i].sort((d,f)=>d.nome.localeCompare(f.nome))),this.form.patchValue({cartorio_uuid:i.uuid}),this.notaryOfficeSearchTerm=""},error:i=>{this.errorList=[L(i,i?.error,"N\xE3o foi poss\xEDvel adicionar o cart\xF3rio.")]}}))}toIsoDate(e){if(!e)return;let t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${l}`}
1handleSubmit(){if(this.form.invalid){Object.values(this.form.controls).forEach(T=>{T.markAsDirty(),T.updateValueAndValidity()});return}let e=this.form.value,t=e.condominio_uuid?.trim?.()??e.condominio_uuid;if(!t){this.errorList=["Selecione o condom\xEDnio."];return}let i=e.unidade_uuid?.trim?.()??e.unidade_uuid;if(!i){this.errorList=["Selecione a unidade."];return}let l={condominio_uuid:String(t),unidade_uuid:String(i),supplier_uuid:String(e.supplier_uuid),solicitacao_tipo_uuid:String(e.solicitacao_tipo_uuid),tipo:String(e.tipo),title:String(e.title??"").trim(),cartorio_uuid:String(e.cartorio_uuid),protocolo:String(e.protocolo??"").trim(),plataforma:String(e.plataforma??"").trim()},d=e.observacoes!=null?String(e.observacoes).trim():"";d&&(l.observacoes=d),e.valor!=null&&Number(e.valor)>0&&(l.valor=Number(e.valor));let f=this.toIsoDate(e.data_referencia);f&&(l.data_referencia=f),this.isSaving=!0,this.errorList=[],this.submitCreate(l)}submitCreate(e){this.financialRequestsService.create(e).pipe(v(()=>this.isSaving=!1)).subscribe({next:t=>{if(t?.success===!1){this.errorList=["N\xE3o foi poss\xEDvel criar a solicita\xE7\xE3o."];return}this.onSuccess?.(),this.modalRef.close(!0)},error:t=>{let i=ft(t,t?.error);if(i?.length){this.handleDuplicateConflict(e,i);return}this.errorList=[L(t,t?.error,"N\xE3o foi poss\xEDvel criar a solicita\xE7\xE3o.")]}})}handleDuplicateConflict(e,t){return ge(this,null,function*(){let i=yield new Promise(l=>{this.modal.create({nzTitle:"Solicita\xE7\xE3o duplicada",nzContent:Ct,nzData:{duplicates:t},nzFooter:null,nzWidth:860}).afterClose.subscribe(f=>l(f??{action:"cancel"}))});if(!(!i||i.action==="cancel")){if(i.action==="select"){this.modalRef.close(!1),this.financialRequestsService.getStatuses().subscribe({next:l=>{this.modal.create({nzTitle:"Detalhe da solicita\xE7\xE3o",nzContent:qe,nzData:{uuid:i.uuid,statusMeta:l,onUpdated:()=>this.onSuccess?.()},nzFooter:null,nzWidth:960})}});return}this.isSaving=!0,this.submitCreate(Ze(Je({},e),{confirm_duplicity:!0}))}})}cancel(){this.modalRef.close()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=M({type:n,selectors:[["app-financial-request-create-modal"]],viewQuery:function(t,i){if(t&1&&Kt(yn,5,$t),t&2){let l;Wt(l=Qt())&&(i.notaryOfficeSelectRef=l.first)}},standalone:!1,decls:103,vars:19,consts:[["notaryOfficeSelect",""],["addNotaryOfficeBtn",""],["nz-row","","nzGutter","16","nzAlign","top","nz-form","","nzLayout","vertical",3,"ngSubmit","formGroup"],["nzSpan","24"],["nz-col","","nzSpan","24"],[1,"form-subtitle"],["nz-col","","nzSpan","12"],["label","Condom\xEDnio","formControlName","condominio_uuid",3,"required","selectMode","tiposPessoas","allowClear","showAnnotations","storageValue"],["label","Unidade","formControlName","unidade_uuid",3,"required","condominium_uuid","tiposPessoas","allowClear"],["nz-col","","nzSpan","8"],["nzRequired",""],["nzErrorTip","Obrigat\xF3rio"],["formControlName","supplier_uuid","nzPlaceHolder","Selecione","nzShowSearch","","nzAllowClear","",3,"nzLoading"],[3,"nzValue","nzLabel"],["formControlName","solicitacao_tipo_uuid","nzPlaceHolder","Selecione","nzShowSearch","","nzAllowClear",""],["formControlName","tipo","nzPlaceHolder","Selecione","nzAllowClear",""],["nz-input","","formControlName","title","placeholder","Informe o t\xEDtulo da solicita\xE7\xE3o"],["nz-col","","nzSpan","6"],["nz-input","","formControlName","protocolo","maxlength","255","placeholder","Informe o protocolo"],["formControlName","plataforma","nzPlaceHolder","Selecione","nzShowSearch",""],["formControlName","data_referencia","nzFormat","dd/MM/yyyy","nzPlaceHolder","Selecione a data"],[2,"border","0","padding","0",3,"nzSuffix"],["formControlName","cartorio_uuid","nzPlaceHolder","Selecione ou digite","nzShowSearch","","nzAllowClear","",3,"nzOnSearch","nzLoading"],["nz-input","","type","text","formControlName","valor","placeholder","R$ 0,00","currencyMask","",3,"options"],["nz-input","","formControlName","observacoes","rows","3","placeholder","Informe observa\xE7\xF5es adicionais"],["nz-row","","nzJustify","end",2,"margin-top","20px"],["nz-col","",2,"margin-right","10px"],["type","button","nz-button","","nzType","default",3,"click"],["nz-col",""],["type","submit","nz-button","","nzType","primary",3,"nzLoading","disabled"],["nzShowIcon","","nzType","error","nzCloseable","",2,"margin-bottom","12px",3,"nzOnClose","nzMessage"],["type","button","nz-button","","nzType","link","title","Adicionar cart\xF3rio",3,"mousedown","click","nzLoading"],["nz-icon","","nzType","plus"]],template:function(t,i){if(t&1){let l=b();a(0,"form",2),h("ngSubmit",function(){return _(l),g(i.handleSubmit())}),z(1,Nn,2,1,"nz-col",3,Bt),a(3,"div",4)(4,"h2",5),s(5,"Informa\xE7\xF5es gerais"),o()(),a(6,"div",6),m(7,"app-filtro-pessoas",7),o(),a(8,"div",6),m(9,"app-filtro-unidades",8),o(),a(10,"div",9)(11,"nz-form-item")(12,"nz-form-label",10),s(13,"Fornecedor"),o(),a(14,"nz-form-control",11)(15,"nz-select",12),z(16,Dn,1,2,"nz-option",13,Di),o()()()(),a(18,"div",9)(19,"nz-form-item")(20,"nz-form-label",10),s(21,"Tipo de solicita\xE7\xE3o"),o(),a(22,"nz-form-control",11)(23,"nz-select",14),z(24,Mn,1,2,"nz-option",13,Ot),o()()()(),a(26,"div",9)(27,"nz-form-item")(28,"nz-form-label",10),s(29,"Tipo"),o(),a(30,"nz-form-control",11)(31,"nz-select",15),z(32,Fn,1,2,"nz-option",13,Ot),o()()()(),a(34,"div",4)(35,"nz-form-item")(36,"nz-form-label",10),s(37,"T\xEDtulo"),o(),a(38,"nz-form-control",11),m(39,"input",16),o()()(),a(40,"div",4)(41,"h2",5),s(42,"Dados do processo"),o()(),a(43,"div",17)(44,"nz-form-item")(45,"nz-form-label",10),s(46,"Protocolo"),o(),a(47,"nz-form-control",11),m(48,"input",18),o()()(),a(49,"div",17)(50,"nz-form-item")(51,"nz-form-label",10),s(52,"Plataforma"),o(),a(53,"nz-form-control",11)(54,"nz-select",19),z(55,wn,1,2,"nz-option",13,Ot),o()()()(),a(57,"div",17)(58,"nz-form-item")(59,"nz-form-label"),s(60,"Data refer\xEAncia"),o(),a(61,"nz-form-control"),m(62,"nz-date-picker",20),o()()(),a(63,"div",17)(64,"nz-form-item")(65,"nz-form-label",10),s(66,"Cart\xF3rio"),o(),a(67,"nz-form-control",11)(68,"nz-input-group",21)(69,"nz-select",22,0),h("nzOnSearch",function(f){return _(l),g(i.onNotaryOfficeSearch(f))}),z(71,Rn,1,2,"nz-option",13,Di),o()(),D(73,On,2,1,"ng-template",null,1,Xt),o()()(),a(75,"div",4)(76,"h2",5),s(77,"Valores"),o()(),a(78,"div",9)(79,"nz-form-item")(80,"nz-form-label"),s(81,"Valor custo (R$)"),o(),a(82,"nz-form-control"),m(83,"input",23),o()()(),a(84,"div",4)(85,"h2",5),s(86,"Complemento"),o()(),a(87,"div",4)(88,"nz-form-item")(89,"nz-form-label"),s(90,"Observa\xE7\xF5es"),o(),a(91,"nz-form-control"),m(92,"textarea",24),o()()(),a(93,"div",4)(94,"div",25)(95,"div",26)(96,"nz-form-item")(97,"button",27),h("click",function(){return _(l),g(i.cancel())}),s(98,"Cancelar"),o()()(),a(99,"div",28)(100,"nz-form-item")(101,"button",29),s(102," Salvar "),o()()()()()()}if(t&2){let l,d=et(74);u("formGroup",i.form),r(),S(i.errorList),r(6),u("required",!0)("selectMode","default")("tiposPessoas",A(17,En))("allowClear",!0)("showAnnotations",!1)("storageValue",!1),r(2),u("required",!0)("condominium_uuid",(l=i.form.get("condominio_uuid"))==null?null:l.value)("tiposPessoas",A(18,Tn))("allowClear",!0),r(6),u("nzLoading",i.isLoadingSuppliers),r(),S(i.suppliers),r(8),S(i.requestTypes),r(8),S(i.tipoOptions),r(23),S(i.plataformaOptions),r(13),u("nzSuffix",d),r(),u("nzLoading",i.isLoadingNotaryOffices),r(2),S(i.notaryOffices),r(12),u("options",i.currencyMaskOptions),r(18),u("nzLoading",i.isSaving)("disabled",i.form.invali
1d)}},dependencies:[re,G,B,H,si,le,K,W,Ee,q,k,P,de,U,I,Z,J,X,Y,be,ee,di,ui,ce,ue,Ae,pt,Le],styles:["[_nghost-%COMP%]     .ant-input[currencyMask]{text-align:right;font-variant-numeric:tabular-nums}"]})}}return n})();var Ie=(()=>{class n{constructor(e){this.router=e,this.view="table"}onViewChange(e){if(e===this.view)return;let t=e==="table"?"buscar":"kanban";this.router.navigate(["/app/solicitacoes-financeiras",t])}onTabIndexChange(e){this.onViewChange(e===0?"table":"kanban")}static{this.\u0275fac=function(t){return new(t||n)(R(ti))}}static{this.\u0275cmp=M({type:n,selectors:[["app-financial-requests-view-toggle"]],inputs:{view:"view"},decls:3,vars:1,consts:[[1,"fr-view-tabs",3,"nzSelectedIndexChange","nzSelectedIndex"],["nzTitle","Tabela"],["nzTitle","Kanban"]],template:function(t,i){t&1&&(a(0,"nz-tabset",0),h("nzSelectedIndexChange",function(d){return i.onTabIndexChange(d)}),m(1,"nz-tab",1)(2,"nz-tab",2),o()),t&2&&u("nzSelectedIndex",i.view==="table"?0:1)},dependencies:[ne,me,dt,ut],styles:[".fr-view-tabs[_ngcontent-%COMP%]{margin-top:8px;margin-bottom:16px}"]})}}return n})();var Vn=()=>["condominio"],jn=()=>["unidade"],$n=()=>({x:"1680px"}),Lt=(n,c)=>c.key,Ri=(n,c)=>c.uuid;function Gn(n,c){if(n&1){let e=b();a(0,"button",32),h("click",function(){_(e);let i=p();return g(i.exportExcel())}),m(1,"span",33),s(2," Exportar Excel "),o()}if(n&2){let e=p();u("nzLoading",e.isExportingExcel)}}function Bn(n,c){if(n&1){let e=b();a(0,"button",32),h("click",function(){_(e);let i=p();return g(i.exportCsv())}),m(1,"span",34),s(2," Exportar CSV "),o()}if(n&2){let e=p();u("nzLoading",e.isExportingCsv)}}function Hn(n,c){if(n&1){let e=b();a(0,"button",35),h("click",function(){_(e);let i=p();return g(i.openCreateModal())}),m(1,"span",36),s(2," Nova solicita\xE7\xE3o "),o()}if(n&2){let e=p();u("disabled",!e.canCreate)}}function Kn(n,c){if(n&1&&m(0,"nz-option",11),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function Wn(n,c){if(n&1&&m(0,"nz-option",11),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function Qn(n,c){if(n&1&&m(0,"nz-option",11),n&2){let e=c.$implicit;u("nzValue",e.uuid)("nzLabel",e.nome)}}function Jn(n,c){if(n&1&&m(0,"nz-option",11),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function Zn(n,c){if(n&1){let e=b();a(0,"a",51),h("click",function(){_(e);let i=p().$implicit,l=p();return g(l.launchCost(i))}),m(1,"span",52),o()}if(n&2){let e=p().$implicit,t=p();u("nzLoading",t.isLaunchingCost(e))}}function Yn(n,c){if(n&1){let e=b();a(0,"a",55),h("click",function(){_(e);let i=p(3);return g(i.warnCancelCostInAgreement())}),m(1,"span",56),o()}}function Xn(n,c){if(n&1){let e=b();a(0,"a",57),h("nzOnConfirm",function(){_(e);let i=p(2).$implicit,l=p();return g(l.cancelCost(i))}),m(1,"span",56),o()}if(n&2){let e=p(2).$implicit,t=p();u("nzLoading",t.isCancelingCost(e))}}function eo(n,c){if(n&1&&D(0,Yn,2,0,"a",53)(1,Xn,2,1,"a",54),n&2){let e=p().$implicit;y(e.emAcordo?0:1)}}function to(n,c){n&1&&(a(0,"span",49),m(1,"span",58),o())}function io(n,c){if(n&1){let e=b();a(0,"a",59),h("nzOnConfirm",function(){_(e);let i=p().$implicit,l=p();return g(l.deleteRow(i))}),m(1,"span",60),o()}if(n&2){let e=p().$implicit,t=p();u("nzLoading",t.isDeletingRow(e))}}function no(n,c){if(n&1){let e=b();a(0,"tr")(1,"td",37),h("nzCheckedChange",function(i){let l=_(e).$implicit,d=p();return g(d.onItemChecked(l.uuid,i))}),o(),a(2,"td"),s(3),o(),a(4,"td",26)(5,"nz-tag",38),s(6),o()(),a(7,"td",27),s(8),o(),a(9,"td"),s(10),o(),a(11,"td"),s(12),o(),a(13,"td",39)(14,"span",40),s(15),o()(),a(16,"td",41)(17,"div",42)(18,"span",43),s(19),o(),a(20,"nz-tag",44),s(21),o()()(),a(22,"td"),s(23),o(),a(24,"td"),s(25),o(),a(26,"td"),s(27),o(),a(28,"td"),s(29),o(),a(30,"td"),s(31),o(),a(32,"td",45)(33,"a",46),h("click",function(){let i=_(e).$implicit,l=p();return g(l.openEditModal(i))}),m(34,"span",47),o(),D(35,Zn,2,1,"a",48)(36,eo,2,1)(37,to,2,0,"span",49)(38,io,2,1,"a",50),o()()}if(n&2){let e=c.$implicit,t=p();Xe("fr-row--locked",t.isRowLocked(e))("fr-row--pending-matricula",t.canLaunchCost(e)),r(),u("nzChecked",t.setOfCheckedId.has(e.uuid)),r(2),C(t.formatDate(e.createdAt)),r(2),u("nzColor",t.statusColor(e.status)),r(),C(t.statusLabel(e.status)),r(2),C(t.tipoLabel(e.tipo)),r(2),C(e.platform||"\u2014"),r(2),C(e.protocol||"\u2014"),r(2),u("nzTooltipTitle",e.notaryOfficeName||""),r(),V(" ",e.notaryOfficeName||"\u2014"," "),r(3),u("nzTooltipTitle",e.condominioName||""),r(),V(" ",e.condominioName||"\u2014"," "),r(),u("nzColor",t.matriculaStatusColor(e)),r(),V(" ",t.matriculaStatusLabel(e)," "),r(2),C(e.unidadeLabel||"\u2014"),r(2),C(e.chargeCompanyName||"\u2014"),r(2),C(t.formatMoney(e.paidAmount)),r(2),C(t.formatReferenceDate(e)),r(2),C(e.solicitanteName||"\u2014"),r(4),y(t.canLaunchCostAction(e)?35:t.canCancelC
1ostAction(e)?36:t.isRowLocked(e)?37:-1),r(3),y(t.canDelete(e)?38:-1)}}var Oi=(()=>{class n{constructor(e,t,i,l,d){this.fb=e,this.financialRequestsService=t,this.modal=i,this.nzMessage=l,this.permissionService=d,this.rows=[],this.statusMeta=[],this.isLoading=!1,this.isExportingExcel=!1,this.isExportingCsv=!1,this.deletingUuid=null,this.cancelingCostUuid=null,this.launchingCostUuid=null,this.setOfCheckedId=new Set,this.checked=!1,this.indeterminate=!1,this.statusCodes=x,this.tipoOptions=pe,this.plataformaOptions=he,this.solicitanteOptions=[],this.canCreate=!1,this.canChangeStatus=!1,this.canDeletePermission=!1}ngOnInit(){this.loadPermissions(),this.form=this.fb.group({solicitacaoStatusCode:[null],solicitanteUuid:[null],protocolo:[""],plataforma:[null],tipo:[null],condominioUuid:[null],unidadeUuid:[null],dataInclusaoInicio:[null],dataInclusaoFim:[null]}),this.form.get("condominioUuid")?.valueChanges.subscribe(()=>{this.form.patchValue({unidadeUuid:null},{emitEvent:!1})}),this.loadSolicitantes(),this.loadAll()}loadSolicitantes(){this.financialRequestsService.getSolicitantes().subscribe({next:e=>{this.solicitanteOptions=e??[]}})}loadPermissions(){this.permissionService.validateWithoutModal(O.FinancialRequestsAlterarStatus,()=>this.canChangeStatus=!0),this.permissionService.validateWithoutModal(O.FinancialRequestsCadastrar,()=>this.canCreate=!0),this.permissionService.validateWithoutModal(O.FinancialRequestsExcluir,()=>this.canDeletePermission=!0)}canLaunchCostAction(e){return this.canChangeStatus&&this.canLaunchCost(e)}canDelete(e){if(!this.canDeletePermission||this.statusMeta.find(l=>l.key===e.status)?.terminal)return!1;let i=e.raw.solicitacao_status;return i&&typeof i=="object"&&i!==null&&"permite_cancelamento"in i?!!i.permite_cancelamento:!0}loadAll(){this.isLoading=!0;let e=this.buildListFilter();Ye({statuses:this.financialRequestsService.getStatuses().pipe(_e(()=>Ce([]))),rows:this.financialRequestsService.list(e).pipe(_e(()=>Ce([])))}).pipe(v(()=>this.isLoading=!1)).subscribe({next:({statuses:t,rows:i})=>{this.statusMeta=t,this.rows=i,this.refreshCheckedState()}})}toIsoDate(e){if(!e)return;let t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${l}`}buildListFilter(e=!1){let t=this.form.value,i={solicitacaoStatusCode:t.solicitacaoStatusCode||void 0,solicitanteUuid:t.solicitanteUuid||void 0,protocolo:t.protocolo?.trim()||void 0,plataforma:t.plataforma||void 0,tipo:t.tipo||void 0,condominioUuid:t.condominioUuid||void 0,unidadeUuid:t.unidadeUuid||void 0,dataSolicitacaoFrom:this.toIsoDate(t.dataInclusaoInicio),dataSolicitacaoTo:this.toIsoDate(t.dataInclusaoFim)};return e&&this.setOfCheckedId.size&&(i.uuids=Array.from(this.setOfCheckedId)),i}filtrar(){this.loadAll()}limparFiltros(){this.form.reset({solicitacaoStatusCode:null,solicitanteUuid:null,protocolo:"",plataforma:null,tipo:null,condominioUuid:null,unidadeUuid:null,dataInclusaoInicio:null,dataInclusaoFim:null}),this.loadAll()}openCreateModal(){if(!this.canCreate){this.nzMessage.warning("Sem permiss\xE3o para cadastrar solicita\xE7\xF5es financeiras");return}this.financialRequestsService.getRequestTypes().subscribe({next:e=>{this.modal.create({nzContent:St,nzTitle:"Nova solicita\xE7\xE3o financeira",nzData:{requestTypes:e,onSuccess:()=>this.loadAll()},nzFooter:null,nzWidth:960})}})}openEditModal(e){this.modal.create({nzContent:qe,nzTitle:"Detalhe da solicita\xE7\xE3o",nzData:{uuid:e.uuid,statusMeta:this.statusMeta,onUpdated:()=>this.loadAll()},nzFooter:null,nzWidth:960}).afterClose.subscribe(()=>this.loadAll())}onAllChecked(e){this.rows.forEach(t=>{e?this.setOfCheckedId.add(t.uuid):this.setOfCheckedId.delete(t.uuid)}),this.refreshCheckedState()}onItemChecked(e,t){t?this.setOfCheckedId.add(e):this.setOfCheckedId.delete(e),this.refreshCheckedState()}refreshCheckedState(){let e=this.rows;this.checked=e.length>0&&e.every(t=>this.setOfCheckedId.has(t.uuid)),this.indeterminate=e.some(t=>this.setOfCheckedId.has(t.uuid))&&!this.checked}statusLabel(e){return this.statusMeta.find(t=>t.key===e)?.label??e}statusColor(e){return xi[e]??"default"}matriculaStatusLabel(e){return this.financialRequestsService.getMatriculaStatusLabel(e)}matriculaStatusColor(e){return this.financialRequestsService.getMatriculaStatusColor(e)}isRowLocked(e){return this.financialRequestsService.isRowLocked(e)}formatReferenceDate(e){return this.financialRequestsService.formatDateOnly(e.referenceDate??e.dueDate)}tipoLabel(e){return Pe(e)}canLaunchCost(e){return this.financialRequestsService.canLaunchCost(e)}isDeletingRow(e){return this.deletingUuid===e.uuid}
1canCancelCostAction(e){return this.canChangeStatus&&this.financialRequestsService.canCancelCost(e)}warnCancelCostInAgreement(){this.nzMessage.warning("Esta cobran\xE7a est\xE1 em um acordo")}isCancelingCost(e){return this.cancelingCostUuid===e.uuid}isLaunchingCost(e){return this.launchingCostUuid===e.uuid}deleteRow(e){return new Promise(t=>{this.deletingUuid=e.uuid,this.financialRequestsService.delete(e.uuid).pipe(v(()=>this.deletingUuid=null)).subscribe({next:i=>{if(i?.success===!1){this.nzMessage.error("N\xE3o foi poss\xEDvel cancelar."),t();return}this.nzMessage.success("Solicita\xE7\xE3o cancelada"),this.setOfCheckedId.delete(e.uuid),this.loadAll(),t()},error:i=>{this.nzMessage.error(L(i,i?.error,"N\xE3o foi poss\xEDvel cancelar.")),t()}})})}cancelCost(e){if(this.canCancelCostAction(e)){if(e.emAcordo){this.warnCancelCostInAgreement();return}this.cancelingCostUuid=e.uuid,this.financialRequestsService.cancelCost(e.uuid).pipe(v(()=>this.cancelingCostUuid=null)).subscribe({next:()=>{this.nzMessage.success("Lan\xE7amento de custo cancelado"),this.loadAll()},error:t=>this.nzMessage.error(L(t,t?.error,"Erro ao cancelar lan\xE7amento de custo"))})}}formatMoney(e){return e==null||!Number.isFinite(e)?"\u2014":e.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}formatDate(e){if(!e)return"\u2014";let t=new Date(e);return Number.isNaN(t.getTime())?"\u2014":t.toLocaleDateString("pt-BR")}launchCost(e){if(!this.canLaunchCostAction(e)){this.nzMessage.warning("Lan\xE7amento de custo permitido somente com status Conclu\xEDdo");return}this.launchingCostUuid!==e.uuid&&(this.launchingCostUuid=e.uuid,this.financialRequestsService.launchCost(e.uuid).pipe(v(()=>this.launchingCostUuid=null)).subscribe({next:()=>{this.nzMessage.success("Matr\xEDcula lan\xE7ada com sucesso"),this.loadAll()},error:t=>this.nzMessage.error(L(t,t?.error,"Erro ao lan\xE7ar matr\xEDcula"))}))}exportExcel(){this.isExportingExcel=!0;let e=this.buildListFilter(!0);this.financialRequestsService.exportExcel(e).pipe(v(()=>this.isExportingExcel=!1)).subscribe({next:t=>this.downloadBlob(t,`SolicitacoesFinanceiras_${Date.now()}.xlsx`),error:()=>this.nzMessage.error("Erro ao exportar Excel")})}exportCsv(){this.isExportingCsv=!0;let e=this.buildListFilter(!0);this.financialRequestsService.exportCsv(e).pipe(v(()=>this.isExportingCsv=!1)).subscribe({next:t=>this.downloadBlob(t,`SolicitacoesFinanceiras_${Date.now()}.csv`),error:()=>this.nzMessage.error("Erro ao exportar CSV")})}downloadBlob(e,t){let i=window.URL.createObjectURL(e),l=document.createElement("a");l.href=i,l.download=t,l.click(),window.URL.revokeObjectURL(i)}static{this.\u0275fac=function(t){return new(t||n)(R(Q),R(te),R(ae),R(ye),R(Oe))}}static{this.\u0275cmp=M({type:n,selectors:[["app-financial-requests-list"]],standalone:!1,decls:109,vars:33,consts:[["table",""],[3,"nzGhost"],["nzSize","small",3,"nzWrap"],["nz-button","","nzType","default",3,"nzLoading","click",4,"nzSpaceItem"],["nz-button","","nzType","primary","nzGhost","",3,"disabled","click",4,"nzSpaceItem"],["nz-form","","nzLayout","vertical",3,"formGroup"],["nz-row","",3,"nzGutter"],["nz-col","",3,"nzSpan"],["formControlName","dataInclusaoInicio","nzFormat","dd/MM/yyyy",2,"width","100%"],["formControlName","dataInclusaoFim","nzFormat","dd/MM/yyyy",2,"width","100%"],["formControlName","solicitacaoStatusCode","nzPlaceHolder","Todos","nzAllowClear","","nzShowSearch","","nzDropdownClassName","fr-status-dropdown",1,"fr-status-filter-select",3,"nzDropdownMatchSelectWidth"],[3,"nzValue","nzLabel"],["formControlName","plataforma","nzPlaceHolder","Todas","nzAllowClear","","nzShowSearch","",1,"fr-filter-select"],["formControlName","solicitanteUuid","nzPlaceHolder","Todos","nzAllowClear","","nzShowSearch","",1,"fr-filter-select"],["formControlName","tipo","nzPlaceHolder","Todos","nzAllowClear","","nzShowSearch","",1,"fr-filter-select"],["nz-input","","formControlName","protocolo","maxlength","255","placeholder","Informe o protocolo"],["label","Condom\xEDnio","formControlName","condominioUuid",3,"selectMode","tiposPessoas","allowClear","showAnnotations","storageValue"],["label","Unidade","formControlName","unidadeUuid",3,"condominium_uuid","tiposPessoas","allowClear"],["nz-col","",1,"fr-filter-actions",3,"nzSpan"],["nz-button","","nzType","primary","type","button",3,"click"],["nz-icon","","nzType","search","nzTheme","outline"],["nz-button","","nzType","default","type","button",3,"click"],["view","table"],[3,"nzSpinning"],["nzSize","small",1,"fr-list-table",3,"nzData","nzFrontPagination","nzPageSize","nzScroll"],[3,"nzCheckedChange","nzChecked","nzIndeterminate"],[1,"fr-status-col"],[1,"fr-tipo-col"],["nzWidth","180px",1,"fr-cartorio-col"],["nzWidth","260px",1,"fr-condominio-col"],["nzAlign","center"],[3,"fr-row--locked","fr-row--pending-matricula"],["nz-button","","nzType","default",3,"click","nzLoading"],["nz-icon","","nzType","file-excel","nzTheme","outline"],["nz-icon","","nzType","download","nzTheme","outline"],["nz-button","","nzType","primary","nzGhost","",3,"click","disabled"],["nz-icon","","nzType","plus","nzTheme","outline"],[3,"nzCheckedChange","nzChecked"],[1,"fr-status-tag",3,"nzColor"],[1,"fr-cartorio-col"],["nz-tooltip","",1,"fr-cartorio-name",3,"nzTooltipTitle"],[1,"fr-condominio-col"],[1,"fr-condominio-cell"],["nz-tooltip","",1,"fr-condominio-name",3,"nzTooltipTitle"],[1,"fr-matricula-tag",3,"nzColor"],["nzAlign","center",1,"spaced-icons"],["nz-button","","nzType","link","nz-tooltip","","nzTooltipTitle","Clique para editar os dados",3,"click"],["nz-icon","","nzType","edit","nzTheme","outline"],["nz-button","","nzType","link","nz-tooltip","","nzTooltipTitle","Lan\xE7ar custo",3,"nzLoading"],["nz-tooltip","","nzTooltipTitle","Custo lan\xE7a
1do"],["nz-button","","nzType","text","nzDanger","","nz-tooltip","","nzTooltipTitle","Cancelar solicita\xE7\xE3o","nz-popconfirm","","nzPopconfirmTitle","Cancelar solicita\xE7\xE3o?","nzPopconfirmPlacement","top","nzOkText","Cancelar","nzOkDanger","",3,"nzLoading"],["nz-button","","nzType","link","nz-tooltip","","nzTooltipTitle","Lan\xE7ar custo",3,"click","nzLoading"],["nz-icon","","nzType","transaction","nzTheme","outline"],["nz-button","","nzType","link","nzDanger","","nz-tooltip","","nzTooltipTitle","Cancelar lan\xE7amento de custo"],["nz-button","","nzType","link","nzDanger","","nz-tooltip","","nzTooltipTitle","Cancelar lan\xE7amento de custo","nz-popconfirm","","nzPopconfirmTitle","Cancelar lan\xE7amento de custo?","nzPopconfirmPlacement","top","nzOkText","Cancelar lan\xE7amento","nzOkDanger","",3,"nzLoading"],["nz-button","","nzType","link","nzDanger","","nz-tooltip","","nzTooltipTitle","Cancelar lan\xE7amento de custo",3,"click"],["nz-icon","","nzType","close-circle","nzTheme","outline"],["nz-button","","nzType","link","nzDanger","","nz-tooltip","","nzTooltipTitle","Cancelar lan\xE7amento de custo","nz-popconfirm","","nzPopconfirmTitle","Cancelar lan\xE7amento de custo?","nzPopconfirmPlacement","top","nzOkText","Cancelar lan\xE7amento","nzOkDanger","",3,"nzOnConfirm","nzLoading"],["nz-icon","","nzType","check-circle","nzTheme","outline",1,"fr-action-done"],["nz-button","","nzType","text","nzDanger","","nz-tooltip","","nzTooltipTitle","Cancelar solicita\xE7\xE3o","nz-popconfirm","","nzPopconfirmTitle","Cancelar solicita\xE7\xE3o?","nzPopconfirmPlacement","top","nzOkText","Cancelar","nzOkDanger","",3,"nzOnConfirm","nzLoading"],["nz-icon","","nzType","delete","nzTheme","outline"]],template:function(t,i){if(t&1){let l=b();a(0,"nz-page-header",1)(1,"nz-page-header-title"),s(2,"Solicita\xE7\xF5es financeiras"),o(),a(3,"nz-page-header-subtitle"),s(4,"Matr\xEDcula e custas processuais"),o(),a(5,"nz-page-header-extra")(6,"nz-space",2),D(7,Gn,3,1,"button",3)(8,Bn,3,1,"button",3)(9,Hn,3,1,"button",4),o()(),a(10,"nz-page-header-content")(11,"form",5)(12,"div",6)(13,"div",7)(14,"nz-form-item")(15,"nz-form-label"),s(16,"Data inclus\xE3o (in\xEDcio)"),o(),a(17,"nz-form-control"),m(18,"nz-date-picker",8),o()()(),a(19,"div",7)(20,"nz-form-item")(21,"nz-form-label"),s(22,"Data inclus\xE3o (fim)"),o(),a(23,"nz-form-control"),m(24,"nz-date-picker",9),o()()(),a(25,"div",7)(26,"nz-form-item")(27,"nz-form-label"),s(28,"Status"),o(),a(29,"nz-form-control")(30,"nz-select",10),z(31,Kn,1,2,"nz-option",11,Lt),o()()()(),a(33,"div",7)(34,"nz-form-item")(35,"nz-form-label"),s(36,"Plataforma"),o(),a(37,"nz-form-control")(38,"nz-select",12),z(39,Wn,1,2,"nz-option",11,Lt),o()()()(),a(41,"div",7)(42,"nz-form-item")(43,"nz-form-label"),s(44,"Solicitante"),o(),a(45,"nz-form-control")(46,"nz-select",13),z(47,Qn,1,2,"nz-option",11,Ri),o()()()(),a(49,"div",7)(50,"nz-form-item")(51,"nz-form-label"),s(52,"Tipo"),o(),a(53,"nz-form-control")(54,"nz-select",14),z(55,Jn,1,2,"nz-option",11,Lt),o()()()(),a(57,"div",7)(58,"nz-form-item")(59,"nz-form-label"),s(60,"Protocolo"),o(),a(61,"nz-form-control"),m(62,"input",15),o()()(),a(63,"div",7),m(64,"app-filtro-pessoas",16),o(),a(65,"div",7),m(66,"app-filtro-unidades",17),o(),a(67,"div",18)(68,"button",19),h("click",function(){return _(l),g(i.filtrar())}),m(69,"span",20),s(70," Filtrar "),o(),a(71,"button",21),h("click",function(){return _(l),g(i.limparFiltros())}),s(72,"Limpar"),o()()()(),m(73,"app-financial-requests-view-toggle",22),a(74,"nz-spin",23)(75,"nz-table",24,0)(77,"thead")(78,"tr")(79,"th",25),h("nzCheckedChange",function(f){return _(l),g(i.onAllChecked(f))}),o(),a(80,"th"),s(81,"Data inclus\xE3o"),o(),a(82,"th",26),s(83,"Status"),o(),a(84,"th",27),s(85,"Tipo"),o(),a(86,"th"),s(87,"Plataforma"),o(),a(88,"th"),s(89,"Protocolo"),o(),a(90,"th",28),s(91,"Cart\xF3rio"),o(),a(92,"th",29),s(93,"Condom\xEDnio"),o(),a(94,"th"),s(95,"Unidade"),o(),a(96,"th"),s(97,"Empresa de Cobran\xE7a"),o(),a(98,"th"),s(99,"Valor Pago"),o(),a(100,"th"),s(101,"Data refer\xEAncia"),o(),a(102,"th"),s(103,"Solicitante"),o(),a(104,"th",30),s(105,"A\xE7\xF5es"),o()()(),a(106,"tbody"),z(107,no,39,24,"tr",3
11,Ri),o()()()()()}if(t&2){let l,d=et(76);u("nzGhost",!1),r(6),u("nzWrap",!0),r(5),u("formGroup",i.form),r(),u("nzGutter",12),r(),u("nzSpan",6),r(6),u("nzSpan",6),r(6),u("nzSpan",6),r(5),u("nzDropdownMatchSelectWidth",!1),r(),S(i.statusMeta),r(2),u("nzSpan",6),r(6),S(i.plataformaOptions),r(2),u("nzSpan",6),r(6),S(i.solicitanteOptions),r(2),u("nzSpan",6),r(6),S(i.tipoOptions),r(2),u("nzSpan",6),r(6),u("nzSpan",6),r(),u("selectMode","default")("tiposPessoas",A(30,Vn))("allowClear",!0)("showAnnotations",!1)("storageValue",!1),r(),u("nzSpan",6),r(),u("condominium_uuid",(l=i.form.get("condominioUuid"))==null?null:l.value)("tiposPessoas",A(31,jn))("allowClear",!0),r(),u("nzSpan",18),r(7),u("nzSpinning",i.isLoading),r(),u("nzData",i.rows)("nzFrontPagination",!0)("nzPageSize",20)("nzScroll",A(32,$n)),r(4),u("nzChecked",i.checked)("nzIndeterminate",i.indeterminate),r(28),S(d.data)}},dependencies:[re,G,B,H,le,K,W,q,k,P,de,U,I,Z,J,X,Y,be,ee,ct,at,rt,lt,st,ce,ue,it,tt,se,Me,Te,Ne,hi,we,De,Fe,_i,Ci,Re,ci,mt,Ae,Le,Ie],styles:[".fr-filter-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:8px;padding-bottom:24px}.fr-list-table[_ngcontent-%COMP%]{margin-top:16px}.fr-status-col[_ngcontent-%COMP%]{min-width:180px;width:180px;padding-top:6px!important;padding-bottom:6px!important;vertical-align:middle}.fr-tipo-col[_ngcontent-%COMP%]{min-width:120px;width:120px;vertical-align:middle}.fr-status-tag[_ngcontent-%COMP%]{margin:0;max-width:100%;white-space:normal;word-break:break-word;line-height:1.35}.fr-status-filter-select[_ngcontent-%COMP%], .fr-filter-select[_ngcontent-%COMP%]{width:100%}.fr-status-select[_ngcontent-%COMP%]{width:100%;min-width:240px}[_nghost-%COMP%]     .fr-status-select .ant-select-selector{height:auto!important;min-height:34px;padding:2px 11px!important;border-radius:0!important;align-items:center}[_nghost-%COMP%]     .fr-status-select.ant-select-focused .ant-select-selector, [_nghost-%COMP%]     .fr-status-select.ant-select-open .ant-select-selector{border-color:#4096ff!important;box-shadow:0 0 0 2px #0591ff1a!important}[_nghost-%COMP%]     .fr-status-select .ant-select-selection-item{white-space:normal;line-height:1.35;overflow:visible;text-overflow:unset}[_nghost-%COMP%]     .fr-status-dropdown{min-width:300px!important}[_nghost-%COMP%]     .fr-status-dropdown .ant-select-item-option-content{white-space:normal;line-height:1.4}.fr-row--pending-matricula[_ngcontent-%COMP%]{background:#fffbe6}.fr-row--locked[_ngcontent-%COMP%]{background:#f6ffed}.fr-row--locked.fr-row--pending-matricula[_ngcontent-%COMP%]{background:#fffbe6}.fr-input-col[_ngcontent-%COMP%]{min-width:128px;padding:6px 8px!important;vertical-align:middle}[_nghost-%COMP%]     .fr-table-input.ant-input{width:100%;min-width:112px;height:34px;padding:4px 11px;border-color:#d9d9d9;background:#fff;font-size:13px;line-height:1.5;border-radius:0;transition:border-color .2s,box-shadow .2s}[_nghost-%COMP%]     .fr-table-input.ant-input:hover{border-color:#4096ff}[_nghost-%COMP%]     .fr-table-input.ant-input:focus{border-color:#4096ff;box-shadow:0 0 0 2px #0591ff1a}[_nghost-%COMP%]     .fr-table-input--money.ant-input{text-align:right;font-variant-numeric:tabular-nums}[_nghost-%COMP%]     .fr-table-select{display:block;width:100%;min-width:112px}[_nghost-%COMP%]     .fr-table-select .ant-select-selector{height:34px!important;padding:0 11px!important;border-color:#d9d9d9;border-radius:0!important;align-items:center;transition:border-color .2s,box-shadow .2s}[_nghost-%COMP%]     .fr-table-select .ant-select-selector:hover{border-color:#4096ff}[_nghost-%COMP%]     .fr-table-select.ant-select-focused .ant-select-selector, [_nghost-%COMP%]     .fr-table-select.ant-select-open .ant-select-selector{border-color:#4096ff!important;box-shadow:0 0 0 2px #0591ff1a!important}[_nghost-%COMP%]     .fr-table-date-picker{display:block;width:100%;min-width:132px}[_nghost-%COMP%]     .fr-table-date-picker .ant-picker{width:100%;height:34px;padding:4px 11px;border-color:#d9d9d9;background:#fff;border-radius:0;transition:border-color .2s,box-shadow .2s}[_nghost-%COMP%]     .fr-table-date-picker .ant-picker:hover{border-color:#4096ff}[_nghost-%COMP%]     .fr-table-date-picker .ant-picker-focused{border-color:#4096ff;box-shadow:0 0 0 2px #0591ff1a}.fr-readonly-value[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:34px;padding:4px 11px;line-height:1.4;word-break:break-word;color:#000000bf;border:1px solid transparent;box-sizing:border-box}.fr-row--locked[_ngcontent-%COMP%]   .fr-readonly-value[_ngcontent-%COMP%]{background:#ffffffa6;border-color:#e8e8e8}.fr-readonly-value--money[_ngcontent-%COMP%]{justify-content:flex-end;font-variant-numeric:tabular-nums;white-space:nowrap}
1.fr-action-done[_ngcontent-%COMP%]{color:#52c41a;font-size:16px}.fr-condominio-col[_ngcontent-%COMP%]{min-width:260px;width:260px;padding-top:6px!important;padding-bottom:6px!important;vertical-align:middle}.fr-cartorio-col[_ngcontent-%COMP%]{min-width:180px;width:180px;vertical-align:middle}.fr-cartorio-name[_ngcontent-%COMP%]{display:-webkit-box;overflow:hidden;line-height:1.35;word-break:break-word;-webkit-box-orient:vertical;-webkit-line-clamp:2}.fr-condominio-cell[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0}.fr-condominio-name[_ngcontent-%COMP%]{display:-webkit-box;overflow:hidden;line-height:1.35;word-break:break-word;-webkit-box-orient:vertical;-webkit-line-clamp:2}.fr-matricula-tag[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:18px}"]})}}return n})();var Li=(()=>{class n{constructor(){this.modalData=E($),this.modalRef=E(oe),this.fb=E(Q),this.form=this.fb.group({justificativa:[null,[F.required,F.minLength(10)]]})}cancel(){this.modalRef.close(null)}confirm(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=String(this.form.value.justificativa).trim();this.modalData.onConfirm(e),this.modalRef.close(e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=M({type:n,selectors:[["app-financial-request-justification-modal"]],standalone:!1,decls:13,vars:2,consts:[["nz-form","","nzLayout","vertical",3,"formGroup"],["nzRequired",""],["nzErrorTip","Informe no m\xEDnimo 10 caracteres"],["nz-input","","formControlName","justificativa","rows","4","placeholder","Descreva o motivo da altera\xE7\xE3o"],["nz-row","","nzJustify","end","nzGutter","8"],["nz-col",""],["type","button","nz-button","",3,"click"],["type","button","nz-button","","nzType","primary",3,"click","disabled"]],template:function(t,i){t&1&&(a(0,"form",0)(1,"nz-form-item")(2,"nz-form-label",1),s(3,"Justificativa"),o(),a(4,"nz-form-control",2),m(5,"textarea",3),o()(),a(6,"div",4)(7,"div",5)(8,"button",6),h("click",function(){return i.cancel()}),s(9,"Cancelar"),o()(),a(10,"div",5)(11,"button",7),h("click",function(){return i.confirm()}),s(12," Confirmar "),o()()()()),t&2&&(u("formGroup",i.form),r(11),u("disabled",i.form.invalid))},dependencies:[re,G,B,H,K,W,q,k,P,U,I,Z,J,X,Y,ee],encapsulation:2})}}return n})();function oo(n,c){if(n&1&&m(0,"nz-alert",1),n&2){let e=p();u("nzMessage",e.error)}}function ao(n,c){if(n&1&&(a(0,"pre",2),s(1),o()),n&2){let e=p();r(),C(e.text)}}var Ai=(()=>{class n{constructor(){this.modalData=E($),this.loading=!0,this.error="",this.text=""}ngOnInit(){let e=this.modalData?.filter??{},t=this.modalData?.service;if(!t){this.loading=!1,this.error="Servi\xE7o indispon\xEDvel.";return}t.reportSummary(e).pipe(v(()=>this.loading=!1)).subscribe({next:i=>{try{this.text=JSON.stringify(i??{},null,2)}catch{this.text=String(i)}},error:()=>{this.error="N\xE3o foi poss\xEDvel gerar o resumo."}})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=M({type:n,selectors:[["app-summary-report-modal-content"]],standalone:!1,decls:3,vars:2,consts:[[3,"nzSpinning"],["nzType","error","nzShowIcon","",3,"nzMessage"],[1,"summary-pre"]],template:function(t,i){t&1&&(a(0,"nz-spin",0),D(1,oo,1,1,"nz-alert",1)(2,ao,2,1,"pre",2),o()),t&2&&(u("nzSpinning",i.loading),r(),y(i.error?1:2))},dependencies:[Ee,se],styles:[".summary-pre[_ngcontent-%COMP%]{max-height:420px;overflow:auto;font-size:12px;margin:0}"]})}}return n})();var ro=()=>["condominio"],lo=()=>["unidade"],At=(n,c)=>c.key,ki=(n,c)=>c.uuid,so=(n,c)=>c.statusKey;function co(n,c){if(n&1){let e=b();a(0,"button",27),h("click",function(){_(e);let i=p();return g(i.exportExcel())}),m(1,"span",28),s(2," Exportar Excel "),o()}if(n&2){let e=p();u("nzLoading",e.isExportingExcel)}}function uo(n,c){if(n&1){let e=b();a(0,"button",27),h("click",function(){_(e);let i=p();return g(i.exportCsv())}),m(1,"span",29),s(2," Exportar CSV "),o()}if(n&2){let e=p();u("nzLoading",e.isExportingCsv)}}function mo(n,c){if(n&1){let e=b();a(0,"button",30),h("click",function(){_(e);let i=p();return g(i.openCreateModal())}),m(1,"span",31),s(2," Nova solicita\xE7\xE3o "),o()}}function po(n,c){if(n&1&&m(0,"nz-option",10),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function fo(n,c){if(n&1&&m(0,"nz-option",10),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function ho(n,c){if(n&1&&m(0,"nz-option",10),n&2){let e=c.$implicit;u("nzValue",e.uuid)("nzLabel",e.nome)}}function Co(n,c){if(n&1&&m(0,"nz-option",10),n&2){let e=c.$implicit;u("nzValue",e.key)("nzLabel",e.label)}}function _o(n,c){n&1&&m(0,"nz-empty",24)}function go(n,c){n&1&&m(0,"span",35)}function zo(n,c){n&1&&m(0,"span",36)}function So(n,c){if(n&1){let e=b();a(0,"button",58),h("click",function(i){_(e);let l=p(4);return g(l.warnCancelCostInAgreement(i))}),s(1," Cancelar lan\xE7amento de custo "),o()}}function bo(n,c){if(n&1){let e=b();a(0,"button",59),h("nzOnConfirm",function(){_(e);let i=p(2).$implicit,l=p(2);return g(l.cancelCost(i))})("click",function(i){return _(e),g(i.stopPropagation())}),s(1," Cancelar lan\xE7amento de custo "),o()}}function xo(n,c){if(n&1&&(a(0,"div",54),D(1,So,2,0,"button",56)(2,bo,2,0,"button",57),o()),n&2){let e=p().$implicit;r(),y(e.emAcordo?1:2)}}function vo(n,c){n&1&&m(0,"div",60)}function yo(n,c){if(n&1){let e=b();a(0,"div",43),h("cdkDragStarted",function(){_(e);let i=p(2);return g(i.isDragging=!0)})("cdkDragEnded",function(){_(e);let i=p(2);return g(i.isDragging=!1)})("click",function(){let i=_(e).$implicit,l=p(2);return g(l.openDetail(i))}),a(1,"div",44)(2,"div",45),s(3),o(),a(4,"div",46)(5,"div",47)(6,"div",48),s(7,"Data inclus\xE3o"),o(),a(8,"div",49),s(9),o()(),a(10,"div",47)(11,"div",48),s(12,"Tipo"),o(),a(13,"div",49),s(14),o()(),a(15,"div",47)(16,"div",48),s(17,"Plataforma"),o(),a(18,"div",49),s(19),o()(),a(20,"div",47)(21,"div",48),s(22,"Protocolo"),o(),a(23,"div",49),s(24),o()(),a(25,"div",50)(26,"div",48),s(27,"Cart\xF3rio"),o(),a(28,"div",51),s(29),o()(),a(30,"div",50)(31,"div",48),s(32,"Condom\xEDnio"),o(),a(33,"div",51),s(34),o(),a(35,"nz-tag",52),s(36),o()(),a(37,"div",47)(38,"div",48),s(39,"Unidade"),o(),a(40,"div",49),s(41),o()(),a(42,"div",50)(43,"div",48),s(44,"Empresa de Cobran\xE7a"),o(),a(45,"div",51),s(46),o()(),a(47,"div",47)(48,"div",48),s(49,"Valor Pago"),o(),a(50,"div",53),s(51),o()(),a(52,"div",47)(53,"div",48),s(54,"Data refer\xEAncia"),o(),a(55,"div",49),s(56),o()(),a(57,"div",47)(58,"div",48),s(59,"Solicitante"),o(),a(60,"div",49),s(61),o()()(),D(62,xo,3,1,"div",54),o(),D(63,vo,1,0,"div",55),o()}if(n&2){let e=c.$implicit,t=p(2);u("cdkDragData",e),r(3),C(t.cardHeadline(e)),r(6),C(t.formatDate(e.createdAt)),r(5),C(t.tipoLabel(e)),r(5),C(e.platform||"\u2014"),r(5),C(e.protocol||"\u2014"),r(5),C(e.notaryOfficeName||"\u2014"),r(5),C(e.condominioName||"\u2014"),r(),u("nzColor",t.matriculaStatusColor(e)),r(),V(" ",t.matriculaStatusLabel(e)," "),r(5),C(e.unidadeLabel||"\u2014"),r(5),C(e.chargeCompanyName||"\u2014"),r(5),C(t.formatMoney(e.paidAmount)),r(5),C(t.formatReferenceDate(e)),r(5),C(e.s
1olicitanteName||"\u2014"),r(),y(t.canCancelCostAction(e)?62:-1)}}function Eo(n,c){n&1&&(a(0,"div",41),s(1,"Nenhuma solicita\xE7\xE3o"),o())}function To(n,c){if(n&1){let e=b();a(0,"button",61),h("click",function(){_(e);let i=p(2);return g(i.openCreateModal())}),m(1,"span",31),s(2," Criar Solicita\xE7\xE3o "),o()}}function No(n,c){if(n&1){let e=b();a(0,"div",32),h("cdkDropListDropped",function(i){_(e);let l=p();return g(l.onCardDropped(i))}),a(1,"div",33)(2,"span",34),D(3,go,1,0,"span",35)(4,zo,1,0,"span",36),a(5,"span",37),s(6),o()(),a(7,"span",38),s(8),o()(),a(9,"div",39),z(10,yo,64,16,"div",40,ki),D(12,Eo,2,0,"div",41)(13,To,3,0,"button",42),o()()}if(n&2){let e=c.$implicit,t=p();u("ngClass",t.columnStatusClass(e))("id",t.colId(e))("cdkDropListData",e)("cdkDropListConnectedTo",t.getConnectedListIdsForColumn(e))("cdkDropListEnterPredicate",t.dropEnterPredicate),r(3),y(t.isTerminalColumn(e)?3:-1),r(),y(t.isCancelledColumn(e)?4:-1),r(2),C(e.label),r(2),C(e.items.length),r(2),S(e.items),r(2),y(e.items.length?-1:12),r(),y(!t.isDragging&&t.showColumnCreateButton(e)?13:-1)}}var bt=(()=>{class n{constructor(e,t,i,l,d){this.fb=e,this.financialRequestsService=t,this.modal=i,this.nzMessage=l,this.permissionService=d,this.columns=[],this.statusMeta=[],this.requestTypes=[],this.isLoading=!1,this.isExportingExcel=!1,this.isExportingCsv=!1,this.savingDrop=!1,this.isDragging=!1,this.justDropped=!1,this.reloadTimer=null,this.tipoOptions=pe,this.plataformaOptions=he,this.solicitanteOptions=[],this.canChangeStatus=!1,this.canCreate=!1,this.dropEnterPredicate=(f,T)=>{if(!this.canChangeStatus)return!1;let N=f.data,ie=T.data.statusKey;return!N?.uuid||this.financialRequestsService.isRowLocked(N)||N.status===ie?!1:this.financialRequestsService.isTransitionAllowed(this.statusMeta,N.status,ie,N)}}ngOnInit(){this.loadPermissions(),this.form=this.fb.group({solicitacaoStatusCode:[null],solicitanteUuid:[null],protocolo:[""],plataforma:[null],tipo:[null],condominioUuid:[null],unidadeUuid:[null],dataInclusaoInicio:[null],dataInclusaoFim:[null]}),this.form.get("condominioUuid")?.valueChanges.subscribe(()=>{this.form.patchValue({unidadeUuid:null},{emitEvent:!1})}),this.loadSolicitantes(),this.loadAll()}loadSolicitantes(){this.financialRequestsService.getSolicitantes().subscribe({next:e=>{this.solicitanteOptions=e??[]}})}loadPermissions(){this.permissionService.validateWithoutModal(O.FinancialRequestsAlterarStatus,()=>this.canChangeStatus=!0),this.permissionService.validateWithoutModal(O.FinancialRequestsCadastrar,()=>this.canCreate=!0)}loadAll(){this.isLoading=!0;let e=this.buildListFilter();Ye({statuses:this.financialRequestsService.getStatuses().pipe(_e(()=>Ce([]))),types:this.financialRequestsService.getRequestTypes().pipe(_e(()=>Ce([]))),rows:this.financialRequestsService.list(e).pipe(_e(()=>Ce([])))}).pipe(v(()=>this.isLoading=!1)).subscribe({next:({statuses:t,types:i,rows:l})=>{this.statusMeta=t,this.requestTypes=i,this.columns=this.buildColumns(t,l)}})}toIsoDate(e){if(!e)return;let t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${l}`}buildListFilter(){let e=this.form.value;return{solicitacaoStatusCode:e.solicitacaoStatusCode||void 0,solicitanteUuid:e.solicitanteUuid||void 0,protocolo:e.protocolo?.trim()||void 0,plataforma:e.plataforma||void 0,tipo:e.tipo||void 0,condominioUuid:e.condominioUuid||void 0,unidadeUuid:e.unidadeUuid||void 0,dataSolicitacaoFrom:this.toIsoDate(e.dataInclusaoInicio),dataSolicitacaoTo:this.toIsoDate(e.dataInclusaoFim)}}filtrar(){this.loadAll()}limparFiltros(){this.form.reset({solicitacaoStatusCode:null,solicitanteUuid:null,protocolo:"",plataforma:null,tipo:null,condominioUuid:null,unidadeUuid:null,dataInclusaoInicio:null,dataInclusaoFim:null}),this.loadAll()}exportExcel(){this.isExportingExcel=!0,this.financialRequestsService.exportExcel(this.buildListFilter()).pipe(v(()=>this.isExportingExcel=!1)).subscribe({next:e=>this.downloadBlob(e,`SolicitacoesFinanceiras_${Date.now()}.xlsx`),error:()=>this.nzMessage.error("Erro ao exportar Excel")})}exportCsv(){this.isExportingCsv=!0,this.financialRequestsService.exportCsv(this.buildListFilter()).pipe(v(()=>this.isExportingCsv=!1)).subscribe({next:e=>this.downloadBlob(e,`SolicitacoesFinanceiras_${Date.now()}.csv`),error:()=>this.nzMessage.error("Erro ao exportar CSV")})}downloadBlob(e,t){let i=window.URL.createObjectURL(e),l=document.createElement("a");l.href=i,l.download=t,l.click(),window.URL.revokeObjectURL(i)}get connectedListIds(){return this.columns.map(e=>this.colId(e))}getConnectedListIdsForColumn(e){let t=this.colId(e);return this.connectedListIds.filter(i=>i!==t)}colId(e){return"fr-col-"+e.statusKey}columnStatusClass(e){return this.isCancelledColumn(e)?"column--status-red":this.isTerminalColumn(e)?"column--status-green":"column--status-default"}showColumnCreateButton(e){return bi.includes(e.statusKey)}isTerminalColumn(e){return e.terminal&&!this.isCancelledColumn(e)}isCancelledColumn(e){return Dt.includes(e.statusKey.toUpperCase())||Dt.includes(e.statusKey)}onCardDropped(e){if(e.previousContainer===e.container)return;let t=e.item.data,i=e.previousContainer.data,l=e.container.data;if(i.statusKey!==l.statusKey){if(this.financialRequestsService.isRowLocked(t)){this.nzMessage.warning("N\xE3o \xE9 poss\xEDvel alterar o status ap\xF3s o lan\xE7amento da matr\xEDcula.");return}if(!this.financialRequestsService.isTransitionAllowed(this.statusMeta,t.status,l.statusKey,t)){this.nzMessage.warning(`N\xE3o \xE9 poss\xEDvel alterar de ${this.statusLabel(t.status)} para ${this.statusLabel(l.statusKey)}.`);return}this.confirmDropStatusChange(t,i,l,e.previousIndex,e.currentIndex)}}statusLabel(e){return this.statusMeta.find(t=>t.key===e)?.label??e}openJustificationModal(e){return new Promise(t=>{this.modal.create({nzTitle:e,nzContent:Li,nzData:{title:e,onConfirm:l=>t(l)},nzFooter:null,nzWidth:520}).afterClose.subscribe(l=>t(typeof l=="string"?l:null))})}confirmDropStatusChange(e,t,i,l,d){return ge(this,null,function*(){let f=yield this.openJustificationModal("Justificativa da altera\xE7\xE3o de status");if(!f)return;nt(t.items,i.items,l,d);let T=e.status;e.status=i.statusKey,this.justDropped=!0,this.reloadTimer&&clearTimeout(this.reloadTimer),this.reloadTimer=setTimeout(()=>this.justDropped=!1,300),this.savingDrop=!0,this.financialRequestsService.patchStatus(e.uuid,i.statusKey,f).pipe(v(()=>this.savingDrop=!1)).subscribe({next:N=>{if(N?.success===!1){nt(i.items,t.items,d,l),e.status=T,this.nzMessage.error(L(null,N,"Erro ao alterar status"));return}this.loadAll()},error:N=>{nt(i.items,t.items,d,l),e.status=T,this.nzMessage.error(L(N,N?.error,"Erro ao alterar status"))}})})}openCreateModal(){if(!this.canCreate){this.nzMessage.warning("Sem permiss\xE3o para cadastrar solicita\xE7\xF5es financeiras");return}this.modal.create({nzContent:St,nzTitle:"Nova solicita\xE7\xE3o financeira",nzData:{requestTypes:this.requestTypes,onSuccess:()=>this.loadAll()},nzFooter:null,nzWidth:960}
1)}openDetail(e){if(this.justDropped)return;this.modal.create({nzContent:qe,nzTitle:"Solicita\xE7\xE3o",nzData:{uuid:e.uuid,statusMeta:this.statusMeta,onUpdated:()=>this.loadAll()},nzFooter:null,nzWidth:640}).afterClose.subscribe(()=>this.loadAll())}openSummaryReport(){this.modal.create({nzTitle:"Resumo",nzContent:Ai,nzData:{filter:this.buildListFilter(),service:this.financialRequestsService},nzFooter:null,nzWidth:720})}formatMoney(e){return e==null||!Number.isFinite(e)?"\u2014":e.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}formatDate(e){if(!e)return"\u2014";let t=new Date(e);return Number.isNaN(t.getTime())?"\u2014":t.toLocaleDateString("pt-BR")}formatReferenceDate(e){return this.financialRequestsService.formatDateOnly(e.referenceDate??e.dueDate)}tipoLabel(e){return Pe(e.tipo)}isMatriculaPending(e){return this.financialRequestsService.isMatriculaPending(e)}matriculaStatusLabel(e){return this.financialRequestsService.getMatriculaStatusLabel(e)}matriculaStatusColor(e){return this.financialRequestsService.getMatriculaStatusColor(e)}cardHeadline(e){if(e.protocol?.trim())return e.protocol.trim();let t=[e.condominioName,e.unidadeLabel].filter(i=>i?.trim());return t.length?t.join(" \xB7 "):e.title?.trim()||"\u2014"}canCancelCostAction(e){return this.canChangeStatus&&this.financialRequestsService.canCancelCost(e)}warnCancelCostInAgreement(e){e?.stopPropagation(),this.nzMessage.warning("Esta cobran\xE7a est\xE1 em um acordo")}cancelCost(e){if(this.canCancelCostAction(e)){if(e.emAcordo){this.warnCancelCostInAgreement();return}this.financialRequestsService.cancelCost(e.uuid).subscribe({next:()=>{this.nzMessage.success("Lan\xE7amento de custo cancelado"),this.loadAll()},error:t=>this.nzMessage.error(L(t,t?.error,"Erro ao cancelar lan\xE7amento de custo"))})}}buildColumns(e,t){let i=new Map;for(let d of t){let f=d.status||"_sem_status";i.has(f)||i.set(f,[]),i.get(f).push(d)}let l=e.map(d=>({statusKey:d.key,label:d.label,order:d.order,terminal:d.terminal,items:[...i.get(d.key)??[]]}));for(let[d,f]of i)e.some(T=>T.key===d)||l.push({statusKey:d,label:d==="_sem_status"?"Sem status":d,order:9999,terminal:!1,items:[...f]});return l.sort((d,f)=>d.order!==f.order?d.order-f.order:d.statusKey.localeCompare(f.statusKey))}static{this.\u0275fac=function(t){return new(t||n)(R(Q),R(te),R(ae),R(ye),R(Oe))}}static{this.\u0275cmp=M({type:n,selectors:[["app-financial-requests-kanban"]],decls:80,vars:29,consts:[[3,"nzGhost"],["nzSize","small",3,"nzWrap"],["nz-button","","nzType","default",3,"nzLoading","click",4,"nzSpaceItem"],["nz-button","","nzType","primary","nzGhost","",3,"click",4,"nzSpaceItem"],["nz-form","","nzLayout","vertical",3,"formGroup"],["nz-row","",3,"nzGutter"],["nz-col","",3,"nzSpan"],["formControlName","dataInclusaoInicio","nzFormat","dd/MM/yyyy",2,"width","100%"],["formControlName","dataInclusaoFim","nzFormat","dd/MM/yyyy",2,"width","100%"],["formControlName","solicitacaoStatusCode","nzPlaceHolder","Todos","nzAllowClear","","nzShowSearch","","nzDropdownClassName","fr-status-dropdown",1,"fr-status-filter-select",3,"nzDropdownMatchSelectWidth"],[3,"nzValue","nzLabel"],["formControlName","plataforma","nzPlaceHolder","Todas","nzAllowClear","","nzShowSearch","",1,"fr-filter-select"],["formControlName","solicitanteUuid","nzPlaceHolder","Todos","nzAllowClear","","nzShowSearch","",1,"fr-filter-select"],["formControlName","tipo","nzPlaceHolder","Todos","nzAllowClear","","nzShowSearch","",1,"fr-filter-select"],["nz-input","","formControlName","protocolo","maxlength","255","placeholder","Informe o protocolo"],["label","Condom\xEDnio","formControlName","condominioUuid",3,"selectMode","tiposPessoas","allowClear","showAnnotations","storageValue"],["label","Unidade","formControlName","unidadeUuid",3,"condominium_uuid","tiposPessoas","allowClear"],["nz-col","",1,"fr-filter-actions",3,"nzSpan"],["nz-button","","nzType","primary","type","button",3,"click"],["nz-icon","","nzType","search","nzTheme","outline"],["nz-button","","nzType","default","type","button",3,"click"],["view","kanban"],[3,"nzSpinning"],[1,"board-container"],["nzNotFoundContent","Nenhuma coluna de status retornada pela API."],[1,"board-columns"],["cdkDropList","",1,"column",3,"ngClass","id","cdkDropListData","cdkDropListConnectedTo","cdkDropListEnterPredicate"],["nz-button","","nzType","default",3,"click","nzLoading"],["nz-icon","","nzType","file-excel","nzTheme","outline"],["nz-icon","","nzType","download","nzTheme","outline"],["nz-button","","nzType","primary","nzGhost","",3,"click"],["nz-icon","","nzType","plus","nzTheme","outline"],["cdkDropList","",1,"column",3,"cdkDropListDropped","ngClass","id","cdkDropListData","cdkDropListConnectedTo","cdkDropListEnterPredicate"],[1,"column-header"],[1,"column-title"],["nz-icon","","nzType","check-circle","nzTheme","fill",1,"column-title-icon"],["nz-icon","","nzType","close-circle","nzTheme","fill",1,"column-title-icon"],[1,"column-title-text"],[1,"column-count"],[1,"column-cards"],["cdkDrag","",1,"card-drag-wrapper",3,"cdkDragData"],[1,"column-empty"],["type","button","nz-button","","nzType","dashed","nzBlock","",1,"column-add-card"],["cdkDrag","",1,"card-drag-wrapper",3,"cdkDragStarted","cdkDragEnded","click","cdkDragData"],[1,"card","card--clickable"],[1,"card-title"],[1,"card-fields"],[1,"card-field","card-field--inline"],[1,"card-field-label"],[1,"card-field-value"],[1,"card-field"],[1,"card-field-value","card-field-value--wrap"],[1,"card-matricula-tag",3,"nzColor"],[1,"card-field-value","card-field-value--money"],[1,"card-actions"],["class","card-placeholder",4,"cdkDragPlaceholder"],["type","button","nz-button","","nzType","default","nzDanger","","nzSize","small"],["type","button","nz-button","","nzType","default","nzDanger","","nzSize","small","nz-popconfirm","","nzPopconfirmTitle","Cancelar lan\xE7amento de custo?","nzOkText","Cancelar lan\xE7amento","nzOkDanger",""],["type","button","nz-button","","nzType","default","nzDanger","","nzSize","small",3,"click"],["type","button","nz-button","","nzType","default","nzDanger","","nzSize","small","nz-popconfirm","","nzPopconfirmTitle","Cancelar lan\xE7amento de custo?","nzOkText","Cancelar lan\xE7amento","nzOkDanger","",3,"nzOnConfirm","click"],[1,"card-placeholder"],["type","button","nz-button","","nzType","dashed","nzBlock","",1,"column-add-card",3,"click"]],template:function(t,i){if(t&1&&(a(0,"nz-page-header",0)(1,"nz-page-header-title"),s(2,"Solicita\xE7\xF5es financeiras"),o(),a(3,"nz-page-header-subtitle"),s(4,"Matr\xEDcula e custas processuais"),o(),a(5,"nz-page-header-extra")(6,"nz-space",1),D(7,co,3,1,"button",2)(8,uo,3,1,"button",2)(9,mo,3,0,"button",3),o()(),a(10,"nz-page-header-content")(11,"form",4)(12,"div",5)(13,"div",6)(14,"nz-form-item")(15,"nz-form-label"),s(16,"Data inclus\xE3o (in\xEDcio)"),o(),a(17,"nz-form-control"),m(18,"nz-date-picker",7),o()()(),a(19,"div",6)(20,"nz-form-item")(21,"nz-form-label"),s(22,"Data inclus\xE3o (fim)"),o(),a(23,"
1nz-form-control"),m(24,"nz-date-picker",8),o()()(),a(25,"div",6)(26,"nz-form-item")(27,"nz-form-label"),s(28,"Status"),o(),a(29,"nz-form-control")(30,"nz-select",9),z(31,po,1,2,"nz-option",10,At),o()()()(),a(33,"div",6)(34,"nz-form-item")(35,"nz-form-label"),s(36,"Plataforma"),o(),a(37,"nz-form-control")(38,"nz-select",11),z(39,fo,1,2,"nz-option",10,At),o()()()(),a(41,"div",6)(42,"nz-form-item")(43,"nz-form-label"),s(44,"Solicitante"),o(),a(45,"nz-form-control")(46,"nz-select",12),z(47,ho,1,2,"nz-option",10,ki),o()()()(),a(49,"div",6)(50,"nz-form-item")(51,"nz-form-label"),s(52,"Tipo"),o(),a(53,"nz-form-control")(54,"nz-select",13),z(55,Co,1,2,"nz-option",10,At),o()()()(),a(57,"div",6)(58,"nz-form-item")(59,"nz-form-label"),s(60,"Protocolo"),o(),a(61,"nz-form-control"),m(62,"input",14),o()()(),a(63,"div",6),m(64,"app-filtro-pessoas",15),o(),a(65,"div",6),m(66,"app-filtro-unidades",16),o(),a(67,"div",17)(68,"button",18),h("click",function(){return i.filtrar()}),m(69,"span",19),s(70," Filtrar "),o(),a(71,"button",20),h("click",function(){return i.limparFiltros()}),s(72,"Limpar"),o()()()(),m(73,"app-financial-requests-view-toggle",21),a(74,"nz-spin",22)(75,"div",23),D(76,_o,1,0,"nz-empty",24),a(77,"div",25),z(78,No,14,11,"div",26,so),o()()()()()),t&2){let l;u("nzGhost",!1),r(6),u("nzWrap",!0),r(5),u("formGroup",i.form),r(),u("nzGutter",12),r(),u("nzSpan",6),r(6),u("nzSpan",6),r(6),u("nzSpan",6),r(5),u("nzDropdownMatchSelectWidth",!1),r(),S(i.statusMeta),r(2),u("nzSpan",6),r(6),S(i.plataformaOptions),r(2),u("nzSpan",6),r(6),S(i.solicitanteOptions),r(2),u("nzSpan",6),r(6),S(i.tipoOptions),r(2),u("nzSpan",6),r(6),u("nzSpan",6),r(),u("selectMode","default")("tiposPessoas",A(27,ro))("allowClear",!0)("showAnnotations",!1)("storageValue",!1),r(),u("nzSpan",6),r(),u("condominium_uuid",(l=i.form.get("condominioUuid"))==null?null:l.value)("tiposPessoas",A(28,lo))("allowClear",!0),r(),u("nzSpan",18),r(7),u("nzSpinning",i.isLoading||i.savingDrop),r(2),y(!i.columns.length&&!i.isLoading?76:-1),r(),Xe("board-columns--hidden",!i.columns.length&&!i.isLoading),r(),S(i.columns)}},dependencies:[ne,ei,xe,re,G,B,H,le,ve,K,W,ri,oi,ni,ai,me,q,k,P,de,ot,U,I,Z,J,X,Y,be,ee,ct,at,rt,lt,st,ce,ue,it,tt,se,Re,mt,ke,Ae,Le,Ie],styles:[".fr-toolbar[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px;margin-bottom:16px;width:100%}.fr-filter-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:8px;padding-bottom:24px}.fr-toolbar__filters[_ngcontent-%COMP%]{flex:0 1 auto;margin:0;min-width:0}.fr-toolbar__filter-item[_ngcontent-%COMP%]{margin-bottom:0!important}.fr-toolbar__actions[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;margin-left:auto}.fr-filter-select[_ngcontent-%COMP%]{width:260px;max-width:100%}.fr-status-filter-select[_ngcontent-%COMP%], .fr-filter-select[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%]     .fr-status-dropdown{min-width:300px!important}[_nghost-%COMP%]     .fr-status-dropdown .ant-select-item-option-content{white-space:normal;line-height:1.4}.board-container[_ngcontent-%COMP%]{position:relative}.board-saving-overlay[_ngcontent-%COMP%]{position:absolute;top:8px;left:50%;transform:translate(-50%);z-index:10;background:#1890ff;color:#fff;padding:6px 16px;border-radius:4px;font-size:13px}.board-columns[_ngcontent-%COMP%]{display:flex;gap:16px;overflow-x:auto;overflow-y:visible;padding:8px 0 16px;align-items:stretch;scroll-behavior:smooth}.board-columns--hidden[_ngcontent-%COMP%]{display:none}.board-columns[_ngcontent-%COMP%]::-webkit-scrollbar{height:8px}.board-columns[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f0f0f0;border-radius:4px}.board-columns[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#bfbfbf;border-radius:4px}.column[_ngcontent-%COMP%]{width:288px;min-width:288px;min-height:520px;flex-shrink:0;background:#fafafa;border-radius:8px;border:1px solid #f0f0f0;display:flex;flex-direction:column}.column--status-green[_ngcontent-%COMP%]{background:#f6ffed;border-color:#b7eb8f}.column--status-green[_ngcontent-%COMP%]   .column-header[_ngcontent-%COMP%]{border-bottom-color:#b7eb8f}.column--status-green[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]{border-left-color:#52c41
1a}.column--status-green[_ngcontent-%COMP%]   .column-title-icon[_ngcontent-%COMP%]{color:#389e0d}.column--status-red[_ngcontent-%COMP%]{background:#fff1f0;border-color:#ffa39e}.column--status-red[_ngcontent-%COMP%]   .column-header[_ngcontent-%COMP%]{border-bottom-color:#ffa39e}.column--status-red[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]{border-left-color:#ff4d4f}.column--status-red[_ngcontent-%COMP%]   .column-title-icon[_ngcontent-%COMP%]{color:#cf1322}.column--status-default[_ngcontent-%COMP%]{background:#fafafa;border-color:#f0f0f0}.column--status-default[_ngcontent-%COMP%]   .column-header[_ngcontent-%COMP%]{border-bottom-color:#f0f0f0}.column--status-default[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]{border-left-color:#d9d9d9}.column-title-icon[_ngcontent-%COMP%]{margin-right:6px;vertical-align:-.2em}.column-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:12px 16px;border-bottom:1px solid #f0f0f0;font-weight:600;flex-shrink:0}.column-title[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:6px;flex:1;min-width:0;font-size:14px}.column-title-text[_ngcontent-%COMP%]{line-height:1.4;white-space:normal;word-break:break-word;overflow-wrap:anywhere}.column-count[_ngcontent-%COMP%]{flex-shrink:0;font-size:12px;font-weight:500;color:#00000073;line-height:20px}.column-cards[_ngcontent-%COMP%]{flex:1;padding:8px;display:flex;flex-direction:column;gap:8px;min-height:120px;overflow-y:auto;overflow-x:hidden}.column-empty[_ngcontent-%COMP%]{flex:1;padding:24px;text-align:center;color:#00000073;font-size:13px;min-height:120px;display:flex;align-items:center;justify-content:center}.card-drag-wrapper[_ngcontent-%COMP%]{cursor:grab;flex-shrink:0}.card-drag-wrapper[_ngcontent-%COMP%]:active{cursor:grabbing}.card-placeholder[_ngcontent-%COMP%]{min-height:320px;background:transparent;border:none;border-radius:6px;flex-shrink:0}.column-add-card[_ngcontent-%COMP%]{margin-top:auto;flex-shrink:0;padding-top:8px}.card[_ngcontent-%COMP%]{background:#fff;border:1px solid #f0f0f0;border-radius:6px;padding:10px 12px 12px;transition:box-shadow .2s;border-left-width:4px;border-left-style:solid;min-height:88px;box-sizing:border-box;min-width:0}.card--clickable[_ngcontent-%COMP%]{cursor:pointer}.card--clickable[_ngcontent-%COMP%]:hover{box-shadow:0 2px 8px #00000014}.card-matricula-tag[_ngcontent-%COMP%]{margin-top:6px;font-size:11px;line-height:18px}.card-title[_ngcontent-%COMP%]{font-weight:600;font-size:13px;margin-bottom:10px;line-height:1.35;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;word-break:break-word}.card-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;min-width:0}.card-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.card-field--inline[_ngcontent-%COMP%]{flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:6px 10px}.card-field--inline[_ngcontent-%COMP%]   .card-field-label[_ngcontent-%COMP%]{flex:0 0 auto;margin-bottom:0}.card-field--inline[_ngcontent-%COMP%]   .card-field-value[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;text-align:right}.card-field-label[_ngcontent-%COMP%]{font-size:10px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:#00000073;line-height:1.2}.card-field-value[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:#000000d9;line-height:1.35;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-field-value--money[_ngcontent-%COMP%]{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.card-field-value--wrap[_ngcontent-%COMP%]{white-space:normal;text-overflow:unset;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;word-break:break-word;overflow-wrap:anywhere;hyphens:auto}"]})}}return n})();var Do=[{path:"",pathMatch:"full",redirectTo:"buscar"},{path:"buscar",component:Oi,data:{role:O.FinancialRequestsListar},canActivate:[Tt]},{path:"kanban",component:bt,data:{role:O.FinancialRequestsListar},canActivate:[Tt]}],Pi=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=Se({type:n})}static{this.\u0275inj=ze({imports:[Et.forChild(Do),Et]})}}return n})();var qi=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=Se({type:n})}static{this.\u0275inj=ze({imports:[ne,xe,ve,me,ke]})}}return n})();var Pr=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=Se({type:n})}static{this.\u0275inj=ze({imports:[ne,Pi,qi,xe,ve,me,ke,Ie,bt]})}}return n})();export{Pr as FinancialRequestsModule};

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.