vobi_lib 1.5.7 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -27,6 +27,35 @@ type Encode = {
27
27
  hashToken: string;
28
28
  uudi?: string;
29
29
  };
30
+ interface FileObject {
31
+ file: File;
32
+ fileName?: string;
33
+ }
34
+ interface FileMetaData {
35
+ name: string;
36
+ size: number;
37
+ type: string;
38
+ }
39
+ interface SignUrls {
40
+ [key: string]: string;
41
+ }
42
+ interface UploadPart {
43
+ ETag: string | null;
44
+ PartNumber: number;
45
+ }
46
+ interface UploadInitData {
47
+ signUrls: SignUrls;
48
+ uploadId: string;
49
+ }
50
+ interface UploadParams {
51
+ baseUrl: string;
52
+ fileObject: FileObject;
53
+ idCompany?: string;
54
+ suffix?: string;
55
+ }
56
+ interface UploadCompleteData {
57
+ location?: string;
58
+ }
30
59
 
31
60
  declare const IsJsonString: (str: string) => any;
32
61
 
@@ -224,6 +253,8 @@ declare const getDateOpenFinance: () => {
224
253
  yesterday: string;
225
254
  };
226
255
 
256
+ declare const upload: ({ baseUrl, fileObject, idCompany, suffix }: UploadParams) => Promise<string | undefined>;
257
+
227
258
  interface ConfigType {
228
259
  [key: string]: any;
229
260
  sources: any[];
@@ -232,4 +263,4 @@ declare const configure: (options?: Record<string, any>) => void;
232
263
  declare const getConfig: () => ConfigType;
233
264
  declare const get: <T>(key: string, defaultValue?: T) => T;
234
265
 
235
- export { type ArrayItem, BAD_GATEWAY, BAD_REQUEST, type Encode, FORBIDDEN, type FormatCurrencyProps, type ICustomErrorParams, INTERNAL_SERVER_ERROR, IsJsonString, METHOD_NOT_ALLOWED, NOT_ALLOWED, NOT_FOUND, SERVICE_UNAVAILABLE, UNAUTHORIZED, asArray, asBrazilianDate, asDate, asyncForEach, brazilianDateTime, brazilianDateToDate, capitalize, checkApprovalAuthority, checkCnpj, checkCpf, checkEmail, configure, containsEncodedComponents, currentDay, curry, dateIsValid, decodeToken, decrypt, diffObject, dynamici18nString, elasticTransformOr, encrypt, enumHelper, error, eventBus, extractMonthInfo, extractValueFromWhere, filterAttributes, filterEmpty, findValue, firstMonthDay, flatMapData, flattenChildren, formatCurrency, formatDate, formatDocument, formatNumber, formatNumberAnyFormat, get, getConfig, getDateOpenFinance, getExtension, getMonthNumber, getNameWithoutExtension, getNextDay, getNextWeekday, getPreviewsWeekday, getToday, getToken, getTomorrow, getYesterday, imgSrcRegex, isAfter, isDateValid, isNumber, isOfAge, isValidUrl, lastMonthDay, makeRefurbishFileUrl, maxDateToList, minDateToList, monthsBetween, normalizeString, nullIfEmpty, padLeft, parseArrayAsObject, parseRouteToModel, prepareDoc, prepareSession, promiseAny, promiseEach, removeProperty, removeSpecialChar, replaceNumberOrPercentage, slugify, splitList, sum, sumByFunction, validateAccess, validateMobilePhoneNumber, valueReplacer };
266
+ export { type ArrayItem, BAD_GATEWAY, BAD_REQUEST, type Encode, FORBIDDEN, type FileMetaData, type FileObject, type FormatCurrencyProps, type ICustomErrorParams, INTERNAL_SERVER_ERROR, IsJsonString, METHOD_NOT_ALLOWED, NOT_ALLOWED, NOT_FOUND, SERVICE_UNAVAILABLE, type SignUrls, UNAUTHORIZED, type UploadCompleteData, type UploadInitData, type UploadParams, type UploadPart, asArray, asBrazilianDate, asDate, asyncForEach, brazilianDateTime, brazilianDateToDate, capitalize, checkApprovalAuthority, checkCnpj, checkCpf, checkEmail, configure, containsEncodedComponents, currentDay, curry, dateIsValid, decodeToken, decrypt, diffObject, dynamici18nString, elasticTransformOr, encrypt, enumHelper, error, eventBus, extractMonthInfo, extractValueFromWhere, filterAttributes, filterEmpty, findValue, firstMonthDay, flatMapData, flattenChildren, formatCurrency, formatDate, formatDocument, formatNumber, formatNumberAnyFormat, get, getConfig, getDateOpenFinance, getExtension, getMonthNumber, getNameWithoutExtension, getNextDay, getNextWeekday, getPreviewsWeekday, getToday, getToken, getTomorrow, getYesterday, imgSrcRegex, isAfter, isDateValid, isNumber, isOfAge, isValidUrl, lastMonthDay, makeRefurbishFileUrl, maxDateToList, minDateToList, monthsBetween, normalizeString, nullIfEmpty, padLeft, parseArrayAsObject, parseRouteToModel, prepareDoc, prepareSession, promiseAny, promiseEach, removeProperty, removeSpecialChar, replaceNumberOrPercentage, slugify, splitList, sum, sumByFunction, upload, validateAccess, validateMobilePhoneNumber, valueReplacer };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var ae=Object.create;var v=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var ie=(e,t)=>{for(var a in t)v(e,a,{get:t[a],enumerable:!0})},Y=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ne(t))!se.call(e,r)&&r!==a&&v(e,r,{get:()=>t[r],enumerable:!(o=oe(t,r))||o.enumerable});return e};var x=(e,t,a)=>(a=e!=null?ae(re(e)):{},Y(t||!e||!e.__esModule?v(a,"default",{value:e,enumerable:!0}):a,e)),le=e=>Y(v({},"__esModule",{value:!0}),e);var Rt={};ie(Rt,{BAD_GATEWAY:()=>pe,BAD_REQUEST:()=>c,FORBIDDEN:()=>ce,INTERNAL_SERVER_ERROR:()=>T,IsJsonString:()=>fe,METHOD_NOT_ALLOWED:()=>ue,NOT_ALLOWED:()=>B,NOT_FOUND:()=>P,SERVICE_UNAVAILABLE:()=>me,UNAUTHORIZED:()=>A,asArray:()=>L,asBrazilianDate:()=>k,asDate:()=>N,asyncForEach:()=>ye,brazilianDateTime:()=>Z,brazilianDateToDate:()=>ke,capitalize:()=>w,checkApprovalAuthority:()=>Ct,checkCnpj:()=>be,checkCpf:()=>Ee,checkEmail:()=>Ce,configure:()=>he,containsEncodedComponents:()=>ve,currentDay:()=>M,curry:()=>Ae,dateIsValid:()=>Ye,decodeToken:()=>at,decrypt:()=>Re,diffObject:()=>Ne,dynamici18nString:()=>Ie,elasticTransformOr:()=>Be,encrypt:()=>Pe,enumHelper:()=>n,error:()=>y,eventBus:()=>Te,extractMonthInfo:()=>Et,extractValueFromWhere:()=>Le,filterAttributes:()=>we,filterEmpty:()=>Oe,findValue:()=>O,firstMonthDay:()=>U,flatMapData:()=>Dt,flattenChildren:()=>j,formatCurrency:()=>F,formatDate:()=>K,formatDocument:()=>vt,formatNumber:()=>He,formatNumberAnyFormat:()=>Je,get:()=>S,getConfig:()=>xe,getDateOpenFinance:()=>At,getExtension:()=>Ze,getMonthNumber:()=>Ge,getNameWithoutExtension:()=>Se,getNextDay:()=>Fe,getNextWeekday:()=>Q,getPreviewsWeekday:()=>X,getToday:()=>Me,getToken:()=>tt,getTomorrow:()=>Ve,getYesterday:()=>je,imgSrcRegex:()=>Ke,isAfter:()=>_e,isDateValid:()=>Qe,isNumber:()=>Xe,isOfAge:()=>qe,isValidUrl:()=>et,lastMonthDay:()=>_,makeRefurbishFileUrl:()=>ot,maxDateToList:()=>ze,minDateToList:()=>$e,monthsBetween:()=>Ue,normalizeString:()=>xt,nullIfEmpty:()=>nt,padLeft:()=>rt,parseArrayAsObject:()=>st,parseRouteToModel:()=>it,prepareDoc:()=>lt,prepareSession:()=>dt,promiseAny:()=>ct,promiseEach:()=>ge,removeProperty:()=>ut,removeSpecialChar:()=>pt,replaceNumberOrPercentage:()=>bt,slugify:()=>mt,splitList:()=>ft,sum:()=>gt,sumByFunction:()=>yt,validateAccess:()=>De,validateMobilePhoneNumber:()=>ht,valueReplacer:()=>I});module.exports=le(Rt);var W={userNotFound:"Usu\xE1rio n\xE3o foi encontrado.",pageNotFound:"Desculpe. P\xE1gina n\xE3o encontrada.",notAuthorized:"N\xE3o autorizado.",tokenExpired:"Sess\xE3o expirada.",invalidToken:"Token inv\xE1lido.",notUpdated:"Nenhum registro foi alterado.",cantDelete:"Esse registro est\xE1 sendo usado, por isso n\xE3o \xE9 poss\xEDvel apaga-lo.",general:"Ocorreu um erro.",sentError:"Erro ao enviar proposta",noUser:"Usu\xE1rio n\xE3o encontrado.",noEmail:"E-mail n\xE3o foi informado",noPassword:"Senha n\xE3o foi informada.",invalidEmail:"O e-mail informado \xE9 inv\xE1lido.",uniqueEmail:"O e-mail informado j\xE1 est\xE1 cadastrado.",invalidCPF:"O CPF informado \xE9 inv\xE1lido.",invalidCNPJ:"O CNPJ informado \xE9 inv\xE1lido.",uniqueName:"Nome informado j\xE1 cadastrado.",noName:"Nome n\xE3o foi informado.",noData:"Dados n\xE3o informados.",noDate:"Data n\xE3o informada.",noModel:"Ocorreu um erro com a entidade",invalidId:"Id inv\xE1lido",invalidCredentials:"Usu\xE1rio e/ou senha inv\xE1lidos.",noPhone:"Telefone n\xE3o foi informado.",noCPF:"CPF n\xE3o foi informado.",noRG:"RG n\xE3o foi informado.",noZipcode:"CEP n\xE3o foi informado.",noStreet:"Endere\xE7o n\xE3o foi informado.",noNumber:"N\xFAmero n\xE3o foi informado.",noState:"Estado n\xE3o foi informado.",noCity:"Cidade n\xE3o foi informada.",noNeighborhood:"Bairro n\xE3o foi informado.",noCNPJ:"CNPJ n\xE3o foi informado.",noCompanyName:"Raz\xE3o social n\xE3o foi informada.",noTrademarkName:"Nome fantasia n\xE3o foi informado.",noCompanyZipcode:"CEP da empresa n\xE3o foi informado.",noCompanyStreet:"Endere\xE7o da empresa n\xE3o foi informado.",noCompanyNumber:"N\xFAmero da empresa n\xE3o foi informado.",noCompanyState:"Estado da empresa n\xE3o foi informado.",noCompanyCity:"Cidade da empresa n\xE3o foi informado.",noCompanyNeighborhood:"Bairro da empresa n\xE3o foi informado.",noBirthdate:"Data de nascimento n\xE3o foi informada.",noCompany:"Empresa n\xE3o informada.",invalidURL:"URL inv\xE1lida.",noPermissions:"Permiss\xF5es n\xE3o encontradas.",fileLimit50:"Os arquivos n\xE3o pode ter mais de 50 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo.",fileLimit10:"Os arquivos n\xE3o pode ter mais de 10 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo no corpo da mensagem.",maxLength:"O nome deve ter no m\xE1ximo 255 caracteres.",invalidData:"Dados inv\xE1lidos.",invalidDate:"Data inv\xE1lida.",invalidDates:"Data de in\xEDcio n\xE3o pode ser maior que data de fim.",invalidUUID:"A URL informada n\xE3o foi encontrada, verifique se est\xE1 correto o link desejado.",invalidValue:"Valor informado inv\xE1lido.",invalidDoc:"O documento informado (CNPJ/CPF) est\xE1 incorreto.",docAlreadyExists:"Documento j\xE1 cadastrado.",tokenPasswordError:"Link de recupera\xE7\xE3o de senha inv\xE1lido.",errPassword:"Senha est\xE1 inv\xE1lida.",noParameters:"Par\xE2metros n\xE3o informado.",uniqueCode:"C\xF3digo j\xE1 cadastrado."};var y={},H={en:W,"pt-br":"PT_BR_LOCALE"},i=H.en||H.en,c=400,B=405,A=401,ce=403,P=404,ue=405,T=500,pe=502,me=503;y.NOT_FOUND={userNotFound:{statusCode:P,code:"NF-00001",message:i.userNotFound},pageNotFound:{statusCode:P,code:"NF-00002",message:i.pageNotFound}};y.UNAUTHORIZED={notAuthorized:{statusCode:A,code:"UA-00001",message:i.notAuthorized},tokenExpired:{statusCode:A,code:"UA-00002",message:i.tokenExpired},invalidToken:{statusCode:A,code:"UA-00003",message:i.invalidToken}};y.NOT_ALLOWED={notUpdated:{statusCode:B,code:"NA-00001",message:i.notUpdated},cantDelete:{statusCode:B,code:"NA-00002",message:i.cantDelete}};y.INTERNAL_SERVER_ERROR={general:{statusCode:T,code:"ISE-00001",message:i.general},sentError:{statusCode:T,code:"ISE-00002",message:i.sentError}};y.BAD_REQUEST={noUser:{statusCode:c,code:"LIB-B-00001",message:i.noUser},noEmail:{statusCode:c,code:"LIB-B-00002",message:i.noEmail},noPassword:{statusCode:c,code:"LIB-B-00003",message:i.noPassword},invalidEmail:{statusCode:c,code:"LIB-B-00004",message:i.invalidEmail},uniqueEmail:{statusCode:c,code:"LIB-B-00005",message:i.uniqueEmail},invalidCPF:{statusCode:c,code:"LIB-B-00006",message:i.invalidCPF},invalidCNPJ:{statusCode:c,code:"LIB-B-00007",message:i.invalidCNPJ},uniqueName:{statusCode:c,code:"LIB-B-00008",message:i.uniqueName},noName:{statusCode:c,code:"LIB-B-00009",message:i.noName},noData:{statusCode:c,code:"LIB-B-00010",message:i.noData},invalidCredentials:{statusCode:c,code:"LIB-B-00011",message:i.invalidCredentials},tokenPasswordError:{statusCode:c,code:"LIB-B-00012",message:i.tokenPasswordError},errPassword:{statusCode:c,code:"LIB-B-00013",message:i.errPassword},noPhone:{statusCode:c,code:"LIB-B-00014",message:i.noPhone},noCPF:{statusCode:c,code:"LIB-B-00015",message:i.noCPF},noRG:{statusCode:c,code:"LIB-B-00016",message:i.noRG},noZipcode:{statusCode:c,code:"LIB-B-00017",message:i.noZipcode},noStreet:{statusCode:c,code:"LIB-B-00018",message:i.noStreet},noNumber:{statusCode:c,code:"LIB-B-00019",message:i.noNumber},noState:{statusCode:c,code:"LIB-B-00020",message:i.noState},noCity:{statusCode:c,code:"LIB-B-00021",message:i.noCity},noNeighborhood:{statusCode:c,code:"LIB-B-00022",message:i.noNeighborhood},noCNPJ:{statusCode:c,code:"LIB-B-00023",message:i.noCNPJ},noCompanyName:{statusCode:c,code:"LIB-B-00024",message:i.noCompanyName},noTrademarkName:{statusCode:c,code:"LIB-B-00025",message:i.noTrademarkName},noCompanyZipcode:{statusCode:c,code:"LIB-B-00026",message:i.noCompanyZipcode},noCompanyStreet:{statusCode:c,code:"LIB-B-00027",message:i.noCompanyStreet},noCompanyNumber:{statusCode:c,code:"LIB-B-00028",message:i.noCompanyNumber},noCompanyState:{statusCode:c,code:"LIB-B-00029",message:i.noCompanyState},noCompanyCity:{statusCode:c,code:"LIB-B-00030",message:i.noCompanyCity},noCompanyNeighborhood:{statusCode:c,code:"PRO-00031",message:i.noCompanyNeighborhood},noBirthdate:{statusCode:c,code:"LIB-B-00032",message:i.noBirthdate},noCompany:{statusCode:c,code:"LIB-B-00033",message:i.noCompany},noParameters:{statusCode:c,code:"LIB-B-00034",message:i.noParameters},invalidDoc:{statusCode:c,code:"LIB-B-00035",message:i.invalidDoc},docAlreadyExists:{statusCode:c,code:"LIB-B-00036",message:i.docAlreadyExists},invalidURL:{statusCode:c,code:"LIB-B-00037",message:i.invalidURL},noPermissions:{statusCode:c,code:"LIB-B-00038",message:i.noPermissions},fileLimit50:{statusCode:c,code:"LIB-B-00039",message:i.fileLimit50},fileLimit10:{statusCode:c,code:"LIB-B-00040",message:i.fileLimit10},invalidDates:{statusCode:c,code:"LIB-B-00041",message:i.invalidDates},maxLength:{statusCode:c,code:"LIB-B-00042",message:i.maxLength},uniqueCode:{statusCode:c,code:"LIB-B-00043",message:i.uniqueCode},invalidValue:{statusCode:c,code:"LIB-B-00044",message:i.invalidValue},invalidData:{statusCode:c,code:"LIB-B-00045",message:i.invalidData},invalidUUID:{statusCode:c,code:"LIB-B-00046",message:i.invalidUUID},noDate:{statusCode:c,code:"LIB-B-00047",message:i.noDate},invalidDate:{statusCode:c,code:"LIB-B-00048",message:i.invalidDate},invalidId:{statusCode:c,code:"LIB-B-00049",message:i.invalidId},noModel:{statusCode:c,code:"LIB-B-00050",message:i.noModel},sequelizeValidation:{statusCode:c,code:"LIB-B-00999"}};var fe=e=>{try{JSON.parse(e)}catch{return!1}return JSON.parse(e)};var ge=async(e,t)=>{for(let a of e)await t(a,e.indexOf(a))};var L=e=>e==null?[]:Array.isArray(e)?e:[e];var ye=async(e,t)=>{await Promise.all(e.map((a,o)=>t(a,o,e)))};var n={};n.fileType={receipt:"receipt",paymentVoucher:"paymentVoucher",quote:"quote",others:"others",project:"project",proposal:"proposal",bankBillet:"bankBillet",refund:"refund"};n.refurbishItemStatus={approved:{label:"Aprovado",value:"approved"},rejected:{label:"N\xE3o aprovado",value:"rejected"},pending:{label:"Para aprovar",value:"pending"},activeStatus:["approved","pending"]};n.companyStatus={created:{id:1,name:"Cadastro iniciado"},onBoarding:{id:2,name:"Aguardando libera\xE7\xE3o"},active:{id:3,name:"Ativo"},blocked:{id:4,name:"Bloqueado"},cancelled:{id:5,name:"Cancelada"}};n.companyType={architect:{id:1,name:"Arquitetura e design de interiores",roles:["architect"]},service:{id:2,name:"Execu\xE7\xE3o de obra"},store:{id:3,name:"Loja de produtos e materiais"},factory:{id:4,name:"Fabricante"},other:{id:10,name:"Outros"}};n.refurbishStatus={new:{id:1,name:"Novo"},contact:{id:2,name:"Em contato"},proposalSent:{id:3,name:"Proposta enviada"},archived:{id:4,name:"Arquivada"},winner:{id:5,name:"Ganha",winner:!0},execution:{id:5,name:"Em andamento"},finished:{id:6,name:"Finalizado"},cancelled:{id:7,name:"Cancelado"},activeOpportunity:[1,2,3],opportunity:[1,2,3,4],project:[5,6,7],end:[4,5,6,7]};n.refurbishStage={1:{id:1,name:"Oportunidade"},2:{id:2,name:"Projeto"}};n.roles={admin:{id:"admin",name:"Administrador"},sales:{id:"sales",name:"Venda"},arch:{id:"architect",name:"Arquitetura"},plan:{id:"plan",name:"Planejamento"},work:{id:"work",name:"Obra"},quality:{id:"quality",name:"Qualidade"},supply:{id:"supply",name:"Suprimentos"},contractor:{id:"contractor",name:"Empreiteiro"},beta:{id:"beta",name:"Beta user"}};n.userType={guest:{name:"Visitante",value:"guest",type:"visitante"},operator:{name:"Operador",value:"operator",type:"operador"},customer:{name:"Cliente",value:"customer",type:"cliente"},provider:{name:"Profissional",value:"provider",type:"profissional"},system:{name:"Sistema",value:"system",type:"sistema"},anonymous:{name:"An\xF4nimo",value:"anonymous"},realTypes:["guest","operator","customer","provider"],skipPermission:["operator","customer"],all:["system","provider","customer","operator"]};n.paymentStatus={waitingOrder:1,analyzing:2,waitingRelease:3,released:4,transferred:5,markAsPaid:6,allowTransfer:[3,4],allowChange:[1,6],sendEmail:[4,5]};n.personTypes={pf:"pf",pj:"pj"};n.asaasPersonTypes={pf:"FISICA",pj:"JURIDICA"};n.stepAccount={personal:0,address:1,documents:2};n.statusVobiPay={PENDING:{color:"#FF8E1B",label:"Em an\xE1lise"}};n.refurbishItemType={product:1,labor:2,parent:3,composition:4,notParent:[1,2,4],productLabor:[1,2]};n.notificationChannel={system:"system",email:"email",whatsApp:"whatsApp"};n.planType={free:{value:"free",label:"freemium"},paid:{value:"paid",label:"Pago"}};n.installmentStatuses={pendingPayment:1,paid:2,confirm:3,paidManually:4,inAnalysis:5,refunded:6,refundRequested:7,onGoingRefund:8,chargebackRequested:9,onGoingChargeback:10,waitingChargeback:11,cancelled:12,all:[1,2,3,4,5,6,7,8,9,10],paidVobiPay:[2,3,7,8,9,10,11],bankStatement:[2,4,6,7,8,9,10,11],allPaid:[2,3,4,7,8,9,10,11],allPaidBalance:[2,4,7,8,9,10,11],allPending:[1,5]};n.paymentStatuses={draft:1,open:2,paid:3,cancelled:4,realValues:[2,3],allStatus:[1,2,3,4]};n.billType={income:"receita",expense:"despesa",transfer:"transferencia",balance:"saldo inicial"};n.paymentTypeValues={expense:{value:"expense",label:"despesa"},income:{value:"income",label:"receita"},transfer:{value:"transfer",label:"transfer\xEAncia"},payment:{value:"payment",label:"pagamento"},balance:{value:"balance",label:"saldo inicial"}};n.financialCategories={serviceSelling:1,productsSelling:2,fee:3,investimentIncome:4,others:5,advanceFutureCapital:6,capitalIncrease:7,bankLoan:8,institutionLoan:9,partnerLoan:10,paymentShareCapital:11};n.getEnumValue=(e,t,a=["id","name"])=>{let o=null;return!e||!t||Object.keys(e).some(r=>e[r][a[0]]===t?(o=e[r][a[1]],!0):!1),o};n.asaasPixType={CPF:"CPF",CNPJ:"CNPJ",EMAIL:"E-mail",PHONE:"Celular",EVP:"Aleat\xF3ria"};n.paymentTypes={pix:1,bankSlip:2,creditCard:3,debitCard:4,transfer:5,money:6,other:7};n.paymentTypesDesc={1:"Pix",2:"Boleto",3:"Cart\xE3o de cr\xE9dito",4:"Cart\xE3o de d\xE9bito",5:"Transfer\xEAncia",6:"Dinheiro",7:"Outro"};n.vobiPayPaymentType={pix:1,bankSlip:2,creditCard:3,all:[1,2,3],1:"pix",2:"bankSlip",3:"creditCard"};n.asaasPaymentStatus={PENDING:{label:"PENDING",value:n.installmentStatuses.pendingPayment},RECEIVED:{label:"RECEIVED",value:n.installmentStatuses.paid},CONFIRMED:{label:"CONFIRMED",value:n.installmentStatuses.confirm},OVERDUE:{label:"OVERDUE",value:null},REFUNDED:{label:"REFUNDED",value:n.installmentStatuses.refunded},RECEIVED_IN_CASH:{label:"RECEIVED_IN_CASH",value:n.installmentStatuses.paidManually},REFUND_REQUESTED:{label:"REFUND_REQUESTED",value:n.installmentStatuses.refundRequested},REFUND_IN_PROGRESS:{label:"REFUND_IN_PROGRESS",value:n.installmentStatuses.onGoingRefund},CHARGEBACK_REQUESTED:{label:"CHARGEBACK_REQUESTED",value:n.installmentStatuses.chargebackRequested},CHARGEBACK_DISPUTE:{label:"CHARGEBACK_DISPUTE",value:n.installmentStatuses.onGoingChargeback},AWAITING_CHARGEBACK_REVERSAL:{label:"AWAITING_CHARGEBACK_REVERSAL",value:n.installmentStatuses.waitingChargeback},DUNNING_REQUESTED:{label:"DUNNING_REQUESTED",value:null},DUNNING_RECEIVED:{label:"DUNNING_RECEIVED",value:null},AWAITING_RISK_ANALYSIS:{label:"AWAITING_RISK_ANALYSIS",value:n.installmentStatuses.inAnalysis}};n.maxLimitPayment={credit:{value:2e4,label:"20.000,00"},installment:{value:15e4,label:"150.000,00"},minimumInstallmentValue:{value:10,label:"10,00"},maximumInstallments:{value:12}};n.asaasWithdrawStatus={PENDING:"PENDING",PROCESSING:"PROCESSING",DONE:"DONE",FAILED:"FAILED",CANCELLED:"CANCELLED",BLOCKED:"BLOCKED"};n.withdrawStatuses={DONE:"Efetuada",PENDING:"Pendente",BANK_PROCESSING:"Processando",CANCELLED:"Cancelada",FAILED:"Falhou",BLOCKED:"Bloqueado",group:{done:["DONE"],open:["PENDING","BANK_PROCESSING"],error:["CANCELLED","FAILED","BLOCKED"]}};n.vobiPayBankAccountType={corrente:"CONTA_CORRENTE",poupanca:"CONTA_POUPANCA",salario:"CONTA_SALARIO",pagamento:"CONTA_DE_PAGAMENTO"};n.withdrawSteps={list:1,fillData:2,confirmData:3};n.billingManagerStatus={pending:1,send:2,error:3,discarded:4,notSent:5,sending:6};n.billingManagerStatusDesc={1:"Aguardando",2:"Enviado",3:"Erro",4:"Descartado",5:"N\xE3o enviado",6:"Enviando"};n.billingManagerChannels={allChannels:["email","sms","whatsapp"],email:{value:"email",label:"E-mail"},sms:{value:"sms",label:"SMS"},whatsapp:{value:"whatsapp",label:"WhatsApp"}};n.billingManagerType={allTypes:["DC","D-3","D0","D+1","D+3","D+6"],billingRulerType:["D-3","D0","D+1","D+3","D+6"],DC:{label:"Cria\xE7\xE3o da cobran\xE7a",value:"DC",tooltip:"Ao criar a cobran\xE7a",message:"de cobran\xE7a criada para {customerName} {value}"},"D-3":{label:"3 dias antes do vencimento",value:"D-3",tooltip:"3 dias antes do vencimento das parcelas",message:"de aviso de vencimento em 3 dias para {customerName} {value}"},D0:{label:"Dia do vencimento",value:"D0",tooltip:"No dia do vencimento da parcela",message:"de aviso de cobran\xE7a vencendo hoje para {customerName} {value}"},"D+1":{label:"1 dia ap\xF3s o vencimento",value:"D+1",tooltip:"1 dia ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 1 dia para {customerName} {value}"},"D+3":{label:"3 dias ap\xF3s o vencimento",value:"D+3",tooltip:"3 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 3 dias para {customerName} {value}"},"D+6":{label:"6 dias ap\xF3s o vencimento",value:"D+6",tooltip:"6 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 6 dias para {customerName} {value}"}};n.paymentCreditPermission={allowed:2e4,blocked:0};n.withdrawLimit={pj:{daytime:2e4,nightly:5e3},pf:{daytime:2e4,nightly:5e3}};n.optionsRefurbishReport={financialPhysical:"financialPhysics",budgeted:"budgeted",financial:"financial",physic:"physic",financialPhysicBudgeted:{value:"financialPhysics.budgeted"},physicBudgeted:{value:"physic.budgeted"},physicAccomplished:{value:"physic.accomplished"},financialBudgeted:{value:"financial.budgeted"},financialAccomplished:{value:"financial.accomplished"},financialBudAcp:{value:"financial.budgetedAccomplished"},physicBudAcp:{value:"physic.budgetedAccomplished"}};n.refurbishReportType={budgeted:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value],accomplished:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value],budgetedAccomplished:[n.optionsRefurbishReport.financialBudAcp.value,n.optionsRefurbishReport.physicBudAcp.value],common:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudgeted.value,n.optionsRefurbishReport.financialBudAcp.value],measurement:[n.optionsRefurbishReport.physicAccomplished.value],financial:[n.optionsRefurbishReport.financialAccomplished.value],customColumns:[n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudAcp.value],simpleExport:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value]};n.reportTypeActions={consolidatedByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howFinancialReportByProjectStatusPaid",tableTitle:"Resultado de projetos",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"consolidatedByProject"},foreseenByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"dueDate",howDoesItsWorksId:"howFinancialReportByProjectAllStatus",tableTitle:"Previs\xE3o de resultado dos projetos",tableTitleTooltip:"S\xE3o contabilizadas todas as receitas e despesas, que j\xE1 foram pagas ou ainda em aberto.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"foreseenByProject"},resultsByInstallment:{model:"installments",clickRow:!0,groupBy:"months",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howResultsWork",tableTitle:"Transa\xE7\xF5es realizadas",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial",exportEntity:"resultsByInstallment"},"cashFlow-monthly":{model:"cashFlow",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howCashFlowWork",tableTitle:"Fluxo de caixa",tableTitleTooltip:"",withResultChart:!1,filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!0},showLegend:!1,exportCsvModel:"financial/cashFlow",exportEntity:"cashFlow"},dre:{model:"dre",howDoesItsWorksId:"howDREWorks",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!1},showLegend:!1,exportCsvModel:"financial/dre",exportEntity:"dre"},"cashFlow-daily":{model:"cashFlow",howDoesItsWorksId:"howDailyCashFlowWorks",tableTitleTooltip:"",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,monthPicker:!0,columns:!1,paymentBankAccount:!0},showLegend:!1,exportCsvModel:"financial/dailyCashFlow",exportEntity:"dailyCashFlow"}};n.extraValuesPayment={taxes:"taxes",discount:"discount",shipping:"shipping",dueDateDiscount:"dueDateDiscount",dueDateDiscountType:"dueDateDiscountType",dueDateLimitDays:"dueDateLimitDays",fine:"fine",fineType:"fineType",interest:"interest"};n.extraValuesPaymentType={simple:[n.extraValuesPayment.taxes,n.extraValuesPayment.discount,n.extraValuesPayment.shipping],asaas:[n.extraValuesPayment.dueDateDiscount,n.extraValuesPayment.dueDateDiscountType,n.extraValuesPayment.dueDateLimitDays,n.extraValuesPayment.fine,n.extraValuesPayment.fineType,n.extraValuesPayment.interest]};n.fineInterestDiscountType={percentage:{value:"PERCENTAGE",label:"Percentual"},fixed:{value:"FIXED",label:"Valor fixo"}};n.paymentPermissions={financialResume:"financialResume",financialSupplier:"financialSupplier",financialOwnBusiness:"financialOwnBusiness",financialIncome:"financialIncome",financialExpense:"financialExpense",financialTransfer:"financialTransfer",financialResults:"financialResults",financialBankStatement:"financialBankStatement",financialReport:"financialReport",projectResume:"projectResume",projectSupplier:"projectSupplier",projectOwnBusiness:"projectOwnBusiness",projectIncome:"projectIncome",projectExpense:"projectExpense",projectResults:"projectResults",projectBudgetedAccomplished:"projectBudgetedAccomplished"};n.colors={primary50:"#EBF0FF",primary100:"#D6E2FF",primary400:"#4F8EFA",primary500:"#2F74DE",teal500:"#00a296",teal600:"#009389",green500:"#46a22e",green600:"#40932A",yellow400:"#e0a819",yellow500:"#BA8A12",orange500:"#de7400",orange600:"#CA6A00",red50:"#fdeceb",red100:"#fac4c0",red500:"#ef4134",red600:"#D93B2F",pink500:"#e547a6",pink600:"#D04197",violet500:"#a145de",violet600:"#933FCA",neutral500:"#6F778B",neutral600:"#565E71"};n.maxInstallmentLength=60;n.purchaseSolicitationStatus={draft:1,open:2,quote:3,buy:4,closed:5,canceled:6,approved:19,rejected:20,editable:[1,2,20],ongoing:[2,3,4,19,20]};n.purchaseOrderStatus={draft:7,open:8,sent:9,accepted:10,refused:11,closed:12,approved:21,rejected:22,requestableRefund:[10,12],chargeableAdministrationFee:[10,12],editable:[7,8,22],ongoing:[8,9],finished:[10,12],allRejected:[11,22]};n.purchaseQuoteStatus={draft:13,open:14,pendingResponse:15,quoted:16,buy:17,finished:18,editable:[13,14,15],ongoing:[14,15,16,17]};n.groupPermission={admin:1,member:2};var b=n;var D={sources:[]},he=(e={})=>{Object.keys(e).forEach(t=>{typeof e[t]=="object"&&e[t]!==null&&!Array.isArray(e[t])?D[t]={...D[t],...e[t]}:D[t]=e[t]})},xe=()=>D,S=(e,t=null)=>e in D?D[e]:t;var De=({data:e,allowAudience:t=[...b.userType.all],permissions:a})=>{var o,r;try{let l=S("sources",[]),{user:d,isPublic:m,isAnonymous:p,source:u=""}=e;if(m||d!=null&&d.isCustomerView)return null;let f=[...t,b.userType.system.value];return!(d!=null&&d.id)||d.isActive===!1||p||!f.includes(d.userType||"")?y.UNAUTHORIZED.notAuthorized:(d==null?void 0:d.userType)===b.userType.system.value&&!(d!=null&&d.idCompany)?l!=null&&l.includes(u)?null:y.UNAUTHORIZED.notAuthorized:(o=b.userType.skipPermission)!=null&&o.includes((d==null?void 0:d.userType)||"")||!(a!=null&&a.length)?null:!((r=d.permissions)!=null&&r.find(E=>a==null?void 0:a.includes(E)))?y.UNAUTHORIZED.notAuthorized:null}catch{return y.UNAUTHORIZED.notAuthorized}};var w=e=>{if(typeof e!="string")return"";let t=e.trim();return t.charAt(0).toUpperCase()+t.slice(1)};var be=e=>{let t,a,o,r,l,d,m=!0;if(e.length<14)return!1;for(let p=1;p<e.length;p++)if(e.charAt(p-1)!==e.charAt(p)){m=!1;break}if(!m){d=e.length-2,t=e.substring(0,d),a=e.substring(d),o=0,l=d-7;for(let p=0;p<d;p++)o+=parseInt(t.charAt(p))*l--,l<2&&(l=9);if(r=o%11<2?0:11-o%11,r!==parseInt(a.charAt(0)))return!1;d+=1,t=e.substring(0,d),o=0,l=d-7;for(let p=0;p<d;p++)o+=parseInt(t.charAt(p))*l--,l<2&&(l=9);return r=o%11<2?0:11-o%11,r===parseInt(a.charAt(1))}return!1};var Ee=(e,t=!1)=>{let a,o;return a=0,e.length<11||!t&&e.split("").every(r=>r===e[0])||(Array.from({length:9}).forEach((r,l)=>{a+=parseInt(e.substring(l,l+1),10)*(11-(l+1))}),o=a*10%11,(o===10||o===11)&&(o=0),o!==parseInt(e.substring(9,10),10))?!1:(a=0,Array.from({length:10}).forEach((r,l)=>{a+=parseInt(e.substring(l,l+1),10)*(12-(l+1))}),o=a*10%11,(o===10||o===11)&&(o=0),o===parseInt(e.substring(10,11),10))};var Ce=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);var ve=e=>decodeURI(e)!==decodeURIComponent(e);var Ae=e=>(...t)=>e.length>t.length?e.bind(null,...t):e(...t);var R=x(require("crypto-js")),Re=(e,t)=>R.AES.decrypt(e,t).toString(R.enc.Utf8);var Ne=(e,t)=>Object.keys(t).reduce((a,o)=>{if(e[o]===t[o]||o==="lastModifiedBy"||o==="createdAt")return a;let{oldData:r,newData:l}=a;return{oldData:{...r,[o]:e[o]},newData:{...l,[o]:t[o]}}},{});var Ie=(e,t)=>e&&typeof e=="string"?e.search(/[a-z]\.[a-z]/i)>=0?t.__(e):e:"";var Be=e=>{let t={};return e==null||e.forEach(a=>{Object.keys(a).forEach(r=>{typeof a[r]=="string"&&(a[r].toLowerCase()==="true"||a[r].toLowerCase()==="false")?t[r]=a[r].toLowerCase()==="true":t[r]=a[r]})}),t};var J=x(require("crypto-js")),Pe=(e,t)=>(typeof e=="object"&&(e=JSON.stringify(e)),J.AES.encrypt(e,t).toString());var Te={on(e,t){document.addEventListener(e,t)},dispatch(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))},remove(e,t){document.removeEventListener(e,t)}};var O=(e,t)=>{if(Array.isArray(e)===!1)return null;let a=null;return e.some(o=>(a=t(o),!!a)),a};var Le=(e,t)=>e?e[t]?e[t]:O(e.or,a=>a[t]):null;var Se=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.substring(0,t)};var we=(e,t)=>e&&e.length&&t&&t.length?e.map(a=>Object.entries(a).filter(([o])=>t.includes(o)).reduce((o,[r,l])=>Object.assign(o,{[r]:l}),{})):[];var Oe=e=>e.filter(t=>L(t).length>0&&t);var F=(e,t={})=>{let a={decimalCount:2,decimal:",",thousands:".",...t},{decimal:o,thousands:r,currencySymbol:l}=a,{decimalCount:d}=a;try{d=Math.abs(d),d=isNaN(d)?2:d;let m=e<0?"-":"",p=parseInt(e=Math.abs(Number(e)||0).toFixed(d),10).toString(),u=p.length>3?p.length%3:0;return(l?`${m}${l}`:m)+(u?p.substr(0,u)+r:"")+p.substr(u).replace(/(\d{3})(?=\d)/g,`$1${r}`)+(d?o+Math.abs(e-parseInt(p,10)).toFixed(d).slice(2):"")}catch(m){return console.log(m),""}};var g=x(require("moment-timezone")),Z=e=>{let t=e?new Date(e):new Date,a={timeZone:"America/Sao_Paulo"},o=t.toLocaleString("en-US",a);return new Date(o)},K=(e,t,a,o,r)=>{if(!e)return null;if(r)return(0,g.default)(e,t);let l=g.default.utc(e);return o||l.local(),a&&l.locale(a),l.format(t)},Fe=(e,t="YYYY-MM-DD")=>{let a=(0,g.default)(e,t).add(1,"days");return typeof e=="string"?a.format(t):a.toDate()},Q=(e=new Date,t=1)=>{let a=new Date(e.setDate(e.getDate()+t));return a.getDay()%6?a:Q(a)},X=(e=new Date,t=1)=>{let a=new Date(e.setDate(e.getDate()-t));return a.getDay()%6?a:X(a)},N=e=>e?g.default.utc(e).local():null,k=e=>e&&g.default.tz(new Date(e),"America/Sao_Paulo"),ke=(e,t)=>{let a=k(e);return a&&a.format(t||"YYYY-MM-DDTHH:mm:ssZ")},Ue=(e,t)=>{if(!e||!t)return null;let a=N(e),o=N(t);return!a||!o?null:o.diff(a,"months")},_e=(e,t)=>{var a;return!e||!t?null:(a=N(e))==null?void 0:a.isAfter(t)},Me=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo");return e?t.startOf("day").toDate():t.toDate()},je=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo").subtract(1,"day");return e?t.startOf("day").toDate():t.toDate()},Ve=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo").add(1,"day");return e?t.startOf("day").toDate():t.toDate()},Ge=e=>{let t=Z(e);return`${t.getFullYear()}${t.getMonth().toString().padStart(2,"0")}`},qe=(e,t)=>{let a=new Date(e),o=new Date;return new Date(o.getFullYear()-t,o.getMonth(),o.getDate()).getTime()>a.getTime()},ze=e=>g.default.max(e),$e=e=>g.default.min(e),Ye=e=>(0,g.default)(e).isValid(),U=(e,t)=>new Date(e,t-1,1).toISOString().split("T")[0],_=(e,t)=>new Date(e,t,0).toISOString().split("T")[0],M=()=>{let e=new Date(k(new Date));return K(e,"YYYY-MM-DD")};var We=x(require("dayjs"));var I=e=>e.length===2?[e[0].replace(/\./g,""),e[1].replace(/\./g,"")]:e;var ee=e=>{let t=I(e.toString().replace("%","").replace("R$","").replace(/\s/g,"").trim().split(","));if(t.length===2)return t.join(".");let a=I(t[0].split("."));return a.length===2?a.join("."):t[0].replace(/\./g,"")},He=e=>{if(e==null)return e;if(!ee(e))return null;let t=Number(ee(e));return t>=Number.MAX_SAFE_INTEGER||Number.isNaN(t)?null:t},Je=e=>{var a,o;if(!e)return null;let t=e.toString();return t.indexOf("/")>=0?null:(t=t.replace(/[^0-9.,-]/g,""),t.includes(",")&&t.includes(".")?(t.lastIndexOf(",")>t.lastIndexOf(".")?t=t.replace(/\./g,"").replace(",","."):t=t.replace(/,/g,""),Number(t)):t.includes(",")&&((a=t.split(",")[1])==null?void 0:a.length)>0?Number(t.replace(",",".")):t.includes(".")&&((o=t.split(".")[1])==null?void 0:o.length)>0?Number(t):Number(t.replace(/[.,]/g,"")))};var Ze=e=>{let t=e.indexOf("."),a=e.length;return t&&a?e.substr(t,a):""};var Ke=new RegExp('<img[^>]+src="(https://vobi-storage[^">]+)"',"gm");var Qe=e=>{if(!e)return!1;let t=new Date(e);return!isNaN(t.getTime())};var Xe=e=>!isNaN(parseFloat(e))&&!isNaN(e-0);var et=e=>{try{return!!new URL(e)}catch{return!1}};var te=x(require("jwt-decode")),tt=e=>{var r;let{authorization:t,Authorization:a}=e,o=(r=t||a)==null?void 0:r.split(" ");return(o==null?void 0:o[0])==="Bearer"?o[1]:null},at=e=>{let{user:t,isCustomerView:a,accessedBy:o,exp:r,iss:l}=e?(0,te.default)(e):{};return{...t,isCustomerView:a,accessedBy:o,exp:r,currentDevice:l}};var ot=(e,t,a,o)=>{let r=e.idStatus>=5?"projetos":"oportunidades",l=t==="customer"?"cliente":"profissional",d=`/${l}/${r}/perfil/${e.id}`,m=`/${l}`;return`${{operator:d,provider:d,customer:m}}/arquivos?arquivo=${a.id}${o?"&visualizar":""}`};var nt=e=>(e==null?void 0:e.length)===0?null:e;var rt=(e,t="0000")=>(t+e).slice(t.length*-1);var st=(e,t=!1)=>{let a={};for(let o=0;o<e.length;o++){let r=e[o];a[r.value]=t?{...r}:r.label}return a};var it=e=>e.replace(/ /g,"").split("-").reduce((t,a)=>t+w(a),"");var lt=e=>e==null?void 0:e.replace(/[,-./]/g,"");var dt=({id:e,name:t,email:a,idCompany:o,userType:r,type:l,isOwner:d,MGMCode:m,groupPermission:p,isActive:u,limitAccess:f,company:h})=>({id:e,name:t,email:a,idCompany:o,userType:r,type:l,isOwner:d,MGMCode:m,groupPermission:p,isActive:u,limitAccess:f,idPlan:h==null?void 0:h.idPlan});var ct=e=>{let t=new Array(e.length),a=0;return new Promise((o,r)=>{e.forEach((l,d)=>{Promise.resolve(l).then(o).catch(m=>{t[d]=m,a+=1,a===e.length&&r(t)})})})};var ut=(e,t)=>Object.keys(t).filter(a=>a!==e).reduce((a,o)=>({...a,[o]:t[o]}),{});var pt=(e,t,a=!0)=>{if(!e)return e;let o=e.toLowerCase();return a&&(o=o.replace(new RegExp("\\s","g"),"")),o=o.replace(new RegExp("[\xE0\xE1\xE2\xE3\xE4\xE5]","g"),"a"),o=o.replace(new RegExp("\xE6","g"),"ae"),o=o.replace(new RegExp("\xE7","g"),"c"),o=o.replace(new RegExp("[\xE8\xE9\xEA\xEB]","g"),"e"),o=o.replace(new RegExp("[\xEC\xED\xEE\xEF]","g"),"i"),o=o.replace(new RegExp("\xF1","g"),"n"),o=o.replace(new RegExp("[\xF2\xF3\xF4\xF5\xF6]","g"),"o"),o=o.replace(new RegExp("\u0153","g"),"oe"),o=o.replace(new RegExp("[\xF9\xFA\xFB\xFC]","g"),"u"),o=o.replace(new RegExp("[\xFD\xFF]","g"),"y"),o=o.replace("'",""),o=o.replace("\xB4",""),o=o.replace("`",""),t&&(o=o.replace(new RegExp("\\W","g"),"")),o};var mt=e=>e==null?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9-/\s]/g,"").replace(/\//g,"").replace(/\s+/g,"-").toLowerCase();var ft=(e,t)=>e.reduce((a,o,r)=>{let l=Math.floor(r/t),d=[...a];return a[l]||(d[l]=[]),d[l].push(o),d},[]);var gt=(e,t,a)=>{let o=a||t;return(e==null?void 0:e.map(r=>o?r[a]||r[t]:r).reduce((r,l)=>r+(Number(l||0)||0),0))||0};var yt=(e,t)=>(e==null?void 0:e.map(a=>t(a)).reduce((a,o)=>a+(Number(o||0)||0),0))||0;var ht=e=>{let t=e.replace(/\D/g,"");return/^(?:\+?55 ?)?(?:0?[1-9]{2})?9\d{8}$/.test(t)};var xt=e=>typeof e!="string"||!e?"":e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim();var j=(e,t="")=>!e||e.length<=0?[]:e.flatMap((a,o)=>{let r=t?`${t}.${o+1}`:`${o+1}`,{children:l,...d}=a;return[{...d,index:r},...j(l||[],r)]}),Dt=e=>j(e).reduce((a,o)=>o.id?{...a,[o.id]:o}:a,{});var bt=(e,t)=>{var o;let a=e?(o=Number(e).toFixed(2))==null?void 0:o.replace(".",","):0;return t?`${F(e*100)}%`:a};var Et=e=>{if(!e)return{};let[t,a]=e.split("-").map(Number),o=M(),r=U(t,a),l=_(t,a);return{startDate:r,endDate:l,actualDate:o}};var Ct=({oldStatus:e,newStatus:t,total:a,user:o,moveStatus:r})=>{var h,E,G,q,z;let{userApprovalAuthorities:l,isOwner:d,groupPermission:m,company:p}=o||{},u=r==null?void 0:r[e];if(!((h=u==null?void 0:u[t])!=null&&h.isAllowed))return null;if(d||m===n.groupPermission.admin||!((E=u==null?void 0:u[t])!=null&&E.authorityLevel))return u==null?void 0:u[t];let f=l==null?void 0:l.find(C=>{var $;return(C==null?void 0:C.idApprovalAuthority)===(($=u==null?void 0:u[t])==null?void 0:$.authorityLevel)});return!f&&((q=p==null?void 0:p.approvalAuthority)!=null&&q[(G=u==null?void 0:u[t])==null?void 0:G.authorityLevel])?!1:(z=u==null?void 0:u[t])!=null&&z.maxAmount?!Number((f==null?void 0:f.maxAmount)||0)&&(f==null?void 0:f.maxAmount)!==0||Number(a||0)<=Number(f==null?void 0:f.maxAmount)?u==null?void 0:u[t]:!1:u==null?void 0:u[t]};var vt=e=>{if(!e)return null;let t=e==null?void 0:e.replace(/\D/g,"");return(t==null?void 0:t.length)===11?t==null?void 0:t.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4"):(t==null?void 0:t.length)===14?t==null?void 0:t.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5"):t};var V=x(require("dayjs")),At=()=>{let e=(0,V.default)().format("YYYY-MM-DD"),t=(0,V.default)().subtract(1,"day").format("YYYY-MM-DD");return{today:e,yesterday:t}};0&&(module.exports={BAD_GATEWAY,BAD_REQUEST,FORBIDDEN,INTERNAL_SERVER_ERROR,IsJsonString,METHOD_NOT_ALLOWED,NOT_ALLOWED,NOT_FOUND,SERVICE_UNAVAILABLE,UNAUTHORIZED,asArray,asBrazilianDate,asDate,asyncForEach,brazilianDateTime,brazilianDateToDate,capitalize,checkApprovalAuthority,checkCnpj,checkCpf,checkEmail,configure,containsEncodedComponents,currentDay,curry,dateIsValid,decodeToken,decrypt,diffObject,dynamici18nString,elasticTransformOr,encrypt,enumHelper,error,eventBus,extractMonthInfo,extractValueFromWhere,filterAttributes,filterEmpty,findValue,firstMonthDay,flatMapData,flattenChildren,formatCurrency,formatDate,formatDocument,formatNumber,formatNumberAnyFormat,get,getConfig,getDateOpenFinance,getExtension,getMonthNumber,getNameWithoutExtension,getNextDay,getNextWeekday,getPreviewsWeekday,getToday,getToken,getTomorrow,getYesterday,imgSrcRegex,isAfter,isDateValid,isNumber,isOfAge,isValidUrl,lastMonthDay,makeRefurbishFileUrl,maxDateToList,minDateToList,monthsBetween,normalizeString,nullIfEmpty,padLeft,parseArrayAsObject,parseRouteToModel,prepareDoc,prepareSession,promiseAny,promiseEach,removeProperty,removeSpecialChar,replaceNumberOrPercentage,slugify,splitList,sum,sumByFunction,validateAccess,validateMobilePhoneNumber,valueReplacer});
1
+ "use strict";var oe=Object.create;var v=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var le=(e,t)=>{for(var o in t)v(e,o,{get:t[o],enumerable:!0})},Y=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of re(t))!ie.call(e,r)&&r!==o&&v(e,r,{get:()=>t[r],enumerable:!(a=ne(t,r))||a.enumerable});return e};var D=(e,t,o)=>(o=e!=null?oe(se(e)):{},Y(t||!e||!e.__esModule?v(o,"default",{value:e,enumerable:!0}):o,e)),de=e=>Y(v({},"__esModule",{value:!0}),e);var Pt={};le(Pt,{BAD_GATEWAY:()=>me,BAD_REQUEST:()=>c,FORBIDDEN:()=>ue,INTERNAL_SERVER_ERROR:()=>T,IsJsonString:()=>ge,METHOD_NOT_ALLOWED:()=>pe,NOT_ALLOWED:()=>B,NOT_FOUND:()=>P,SERVICE_UNAVAILABLE:()=>fe,UNAUTHORIZED:()=>N,asArray:()=>S,asBrazilianDate:()=>U,asDate:()=>A,asyncForEach:()=>he,brazilianDateTime:()=>Z,brazilianDateToDate:()=>ke,capitalize:()=>w,checkApprovalAuthority:()=>vt,checkCnpj:()=>Ee,checkCpf:()=>Ce,checkEmail:()=>ve,configure:()=>xe,containsEncodedComponents:()=>Ne,currentDay:()=>j,curry:()=>Ie,dateIsValid:()=>We,decodeToken:()=>ot,decrypt:()=>Ae,diffObject:()=>Re,dynamici18nString:()=>Be,elasticTransformOr:()=>Pe,encrypt:()=>Te,enumHelper:()=>n,error:()=>h,eventBus:()=>Se,extractMonthInfo:()=>Ct,extractValueFromWhere:()=>Le,filterAttributes:()=>Oe,filterEmpty:()=>Fe,findValue:()=>O,firstMonthDay:()=>k,flatMapData:()=>bt,flattenChildren:()=>M,formatCurrency:()=>F,formatDate:()=>K,formatDocument:()=>Nt,formatNumber:()=>Je,formatNumberAnyFormat:()=>Ze,get:()=>L,getConfig:()=>De,getDateOpenFinance:()=>It,getExtension:()=>Ke,getMonthNumber:()=>$e,getNameWithoutExtension:()=>we,getNextDay:()=>Ue,getNextWeekday:()=>Q,getPreviewsWeekday:()=>X,getToday:()=>Me,getToken:()=>at,getTomorrow:()=>Ge,getYesterday:()=>Ve,imgSrcRegex:()=>Qe,isAfter:()=>je,isDateValid:()=>Xe,isNumber:()=>et,isOfAge:()=>ze,isValidUrl:()=>tt,lastMonthDay:()=>_,makeRefurbishFileUrl:()=>nt,maxDateToList:()=>qe,minDateToList:()=>Ye,monthsBetween:()=>_e,normalizeString:()=>Dt,nullIfEmpty:()=>rt,padLeft:()=>st,parseArrayAsObject:()=>it,parseRouteToModel:()=>lt,prepareDoc:()=>dt,prepareSession:()=>ct,promiseAny:()=>ut,promiseEach:()=>ye,removeProperty:()=>pt,removeSpecialChar:()=>mt,replaceNumberOrPercentage:()=>Et,slugify:()=>ft,splitList:()=>gt,sum:()=>yt,sumByFunction:()=>ht,upload:()=>Bt,validateAccess:()=>be,validateMobilePhoneNumber:()=>xt,valueReplacer:()=>R});module.exports=de(Pt);var W={userNotFound:"Usu\xE1rio n\xE3o foi encontrado.",pageNotFound:"Desculpe. P\xE1gina n\xE3o encontrada.",notAuthorized:"N\xE3o autorizado.",tokenExpired:"Sess\xE3o expirada.",invalidToken:"Token inv\xE1lido.",notUpdated:"Nenhum registro foi alterado.",cantDelete:"Esse registro est\xE1 sendo usado, por isso n\xE3o \xE9 poss\xEDvel apaga-lo.",general:"Ocorreu um erro.",sentError:"Erro ao enviar proposta",noUser:"Usu\xE1rio n\xE3o encontrado.",noEmail:"E-mail n\xE3o foi informado",noPassword:"Senha n\xE3o foi informada.",invalidEmail:"O e-mail informado \xE9 inv\xE1lido.",uniqueEmail:"O e-mail informado j\xE1 est\xE1 cadastrado.",invalidCPF:"O CPF informado \xE9 inv\xE1lido.",invalidCNPJ:"O CNPJ informado \xE9 inv\xE1lido.",uniqueName:"Nome informado j\xE1 cadastrado.",noName:"Nome n\xE3o foi informado.",noData:"Dados n\xE3o informados.",noDate:"Data n\xE3o informada.",noModel:"Ocorreu um erro com a entidade",invalidId:"Id inv\xE1lido",invalidCredentials:"Usu\xE1rio e/ou senha inv\xE1lidos.",noPhone:"Telefone n\xE3o foi informado.",noCPF:"CPF n\xE3o foi informado.",noRG:"RG n\xE3o foi informado.",noZipcode:"CEP n\xE3o foi informado.",noStreet:"Endere\xE7o n\xE3o foi informado.",noNumber:"N\xFAmero n\xE3o foi informado.",noState:"Estado n\xE3o foi informado.",noCity:"Cidade n\xE3o foi informada.",noNeighborhood:"Bairro n\xE3o foi informado.",noCNPJ:"CNPJ n\xE3o foi informado.",noCompanyName:"Raz\xE3o social n\xE3o foi informada.",noTrademarkName:"Nome fantasia n\xE3o foi informado.",noCompanyZipcode:"CEP da empresa n\xE3o foi informado.",noCompanyStreet:"Endere\xE7o da empresa n\xE3o foi informado.",noCompanyNumber:"N\xFAmero da empresa n\xE3o foi informado.",noCompanyState:"Estado da empresa n\xE3o foi informado.",noCompanyCity:"Cidade da empresa n\xE3o foi informado.",noCompanyNeighborhood:"Bairro da empresa n\xE3o foi informado.",noBirthdate:"Data de nascimento n\xE3o foi informada.",noCompany:"Empresa n\xE3o informada.",invalidURL:"URL inv\xE1lida.",noPermissions:"Permiss\xF5es n\xE3o encontradas.",fileLimit50:"Os arquivos n\xE3o pode ter mais de 50 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo.",fileLimit10:"Os arquivos n\xE3o pode ter mais de 10 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo no corpo da mensagem.",maxLength:"O nome deve ter no m\xE1ximo 255 caracteres.",invalidData:"Dados inv\xE1lidos.",invalidDate:"Data inv\xE1lida.",invalidDates:"Data de in\xEDcio n\xE3o pode ser maior que data de fim.",invalidUUID:"A URL informada n\xE3o foi encontrada, verifique se est\xE1 correto o link desejado.",invalidValue:"Valor informado inv\xE1lido.",invalidDoc:"O documento informado (CNPJ/CPF) est\xE1 incorreto.",docAlreadyExists:"Documento j\xE1 cadastrado.",tokenPasswordError:"Link de recupera\xE7\xE3o de senha inv\xE1lido.",errPassword:"Senha est\xE1 inv\xE1lida.",noParameters:"Par\xE2metros n\xE3o informado.",uniqueCode:"C\xF3digo j\xE1 cadastrado."};var h={},H={en:W,"pt-br":"PT_BR_LOCALE"},l=H.en||H.en,c=400,B=405,N=401,ue=403,P=404,pe=405,T=500,me=502,fe=503;h.NOT_FOUND={userNotFound:{statusCode:P,code:"NF-00001",message:l.userNotFound},pageNotFound:{statusCode:P,code:"NF-00002",message:l.pageNotFound}};h.UNAUTHORIZED={notAuthorized:{statusCode:N,code:"UA-00001",message:l.notAuthorized},tokenExpired:{statusCode:N,code:"UA-00002",message:l.tokenExpired},invalidToken:{statusCode:N,code:"UA-00003",message:l.invalidToken}};h.NOT_ALLOWED={notUpdated:{statusCode:B,code:"NA-00001",message:l.notUpdated},cantDelete:{statusCode:B,code:"NA-00002",message:l.cantDelete}};h.INTERNAL_SERVER_ERROR={general:{statusCode:T,code:"ISE-00001",message:l.general},sentError:{statusCode:T,code:"ISE-00002",message:l.sentError}};h.BAD_REQUEST={noUser:{statusCode:c,code:"LIB-B-00001",message:l.noUser},noEmail:{statusCode:c,code:"LIB-B-00002",message:l.noEmail},noPassword:{statusCode:c,code:"LIB-B-00003",message:l.noPassword},invalidEmail:{statusCode:c,code:"LIB-B-00004",message:l.invalidEmail},uniqueEmail:{statusCode:c,code:"LIB-B-00005",message:l.uniqueEmail},invalidCPF:{statusCode:c,code:"LIB-B-00006",message:l.invalidCPF},invalidCNPJ:{statusCode:c,code:"LIB-B-00007",message:l.invalidCNPJ},uniqueName:{statusCode:c,code:"LIB-B-00008",message:l.uniqueName},noName:{statusCode:c,code:"LIB-B-00009",message:l.noName},noData:{statusCode:c,code:"LIB-B-00010",message:l.noData},invalidCredentials:{statusCode:c,code:"LIB-B-00011",message:l.invalidCredentials},tokenPasswordError:{statusCode:c,code:"LIB-B-00012",message:l.tokenPasswordError},errPassword:{statusCode:c,code:"LIB-B-00013",message:l.errPassword},noPhone:{statusCode:c,code:"LIB-B-00014",message:l.noPhone},noCPF:{statusCode:c,code:"LIB-B-00015",message:l.noCPF},noRG:{statusCode:c,code:"LIB-B-00016",message:l.noRG},noZipcode:{statusCode:c,code:"LIB-B-00017",message:l.noZipcode},noStreet:{statusCode:c,code:"LIB-B-00018",message:l.noStreet},noNumber:{statusCode:c,code:"LIB-B-00019",message:l.noNumber},noState:{statusCode:c,code:"LIB-B-00020",message:l.noState},noCity:{statusCode:c,code:"LIB-B-00021",message:l.noCity},noNeighborhood:{statusCode:c,code:"LIB-B-00022",message:l.noNeighborhood},noCNPJ:{statusCode:c,code:"LIB-B-00023",message:l.noCNPJ},noCompanyName:{statusCode:c,code:"LIB-B-00024",message:l.noCompanyName},noTrademarkName:{statusCode:c,code:"LIB-B-00025",message:l.noTrademarkName},noCompanyZipcode:{statusCode:c,code:"LIB-B-00026",message:l.noCompanyZipcode},noCompanyStreet:{statusCode:c,code:"LIB-B-00027",message:l.noCompanyStreet},noCompanyNumber:{statusCode:c,code:"LIB-B-00028",message:l.noCompanyNumber},noCompanyState:{statusCode:c,code:"LIB-B-00029",message:l.noCompanyState},noCompanyCity:{statusCode:c,code:"LIB-B-00030",message:l.noCompanyCity},noCompanyNeighborhood:{statusCode:c,code:"PRO-00031",message:l.noCompanyNeighborhood},noBirthdate:{statusCode:c,code:"LIB-B-00032",message:l.noBirthdate},noCompany:{statusCode:c,code:"LIB-B-00033",message:l.noCompany},noParameters:{statusCode:c,code:"LIB-B-00034",message:l.noParameters},invalidDoc:{statusCode:c,code:"LIB-B-00035",message:l.invalidDoc},docAlreadyExists:{statusCode:c,code:"LIB-B-00036",message:l.docAlreadyExists},invalidURL:{statusCode:c,code:"LIB-B-00037",message:l.invalidURL},noPermissions:{statusCode:c,code:"LIB-B-00038",message:l.noPermissions},fileLimit50:{statusCode:c,code:"LIB-B-00039",message:l.fileLimit50},fileLimit10:{statusCode:c,code:"LIB-B-00040",message:l.fileLimit10},invalidDates:{statusCode:c,code:"LIB-B-00041",message:l.invalidDates},maxLength:{statusCode:c,code:"LIB-B-00042",message:l.maxLength},uniqueCode:{statusCode:c,code:"LIB-B-00043",message:l.uniqueCode},invalidValue:{statusCode:c,code:"LIB-B-00044",message:l.invalidValue},invalidData:{statusCode:c,code:"LIB-B-00045",message:l.invalidData},invalidUUID:{statusCode:c,code:"LIB-B-00046",message:l.invalidUUID},noDate:{statusCode:c,code:"LIB-B-00047",message:l.noDate},invalidDate:{statusCode:c,code:"LIB-B-00048",message:l.invalidDate},invalidId:{statusCode:c,code:"LIB-B-00049",message:l.invalidId},noModel:{statusCode:c,code:"LIB-B-00050",message:l.noModel},sequelizeValidation:{statusCode:c,code:"LIB-B-00999"}};var ge=e=>{try{JSON.parse(e)}catch{return!1}return JSON.parse(e)};var ye=async(e,t)=>{for(let o of e)await t(o,e.indexOf(o))};var S=e=>e==null?[]:Array.isArray(e)?e:[e];var he=async(e,t)=>{await Promise.all(e.map((o,a)=>t(o,a,e)))};var n={};n.fileType={receipt:"receipt",paymentVoucher:"paymentVoucher",quote:"quote",others:"others",project:"project",proposal:"proposal",bankBillet:"bankBillet",refund:"refund"};n.refurbishItemStatus={approved:{label:"Aprovado",value:"approved"},rejected:{label:"N\xE3o aprovado",value:"rejected"},pending:{label:"Para aprovar",value:"pending"},activeStatus:["approved","pending"]};n.companyStatus={created:{id:1,name:"Cadastro iniciado"},onBoarding:{id:2,name:"Aguardando libera\xE7\xE3o"},active:{id:3,name:"Ativo"},blocked:{id:4,name:"Bloqueado"},cancelled:{id:5,name:"Cancelada"}};n.companyType={architect:{id:1,name:"Arquitetura e design de interiores",roles:["architect"]},service:{id:2,name:"Execu\xE7\xE3o de obra"},store:{id:3,name:"Loja de produtos e materiais"},factory:{id:4,name:"Fabricante"},other:{id:10,name:"Outros"}};n.refurbishStatus={new:{id:1,name:"Novo"},contact:{id:2,name:"Em contato"},proposalSent:{id:3,name:"Proposta enviada"},archived:{id:4,name:"Arquivada"},winner:{id:5,name:"Ganha",winner:!0},execution:{id:5,name:"Em andamento"},finished:{id:6,name:"Finalizado"},cancelled:{id:7,name:"Cancelado"},activeOpportunity:[1,2,3],opportunity:[1,2,3,4],project:[5,6,7],end:[4,5,6,7]};n.refurbishStage={1:{id:1,name:"Oportunidade"},2:{id:2,name:"Projeto"}};n.roles={admin:{id:"admin",name:"Administrador"},sales:{id:"sales",name:"Venda"},arch:{id:"architect",name:"Arquitetura"},plan:{id:"plan",name:"Planejamento"},work:{id:"work",name:"Obra"},quality:{id:"quality",name:"Qualidade"},supply:{id:"supply",name:"Suprimentos"},contractor:{id:"contractor",name:"Empreiteiro"},beta:{id:"beta",name:"Beta user"}};n.userType={guest:{name:"Visitante",value:"guest",type:"visitante"},operator:{name:"Operador",value:"operator",type:"operador"},customer:{name:"Cliente",value:"customer",type:"cliente"},provider:{name:"Profissional",value:"provider",type:"profissional"},system:{name:"Sistema",value:"system",type:"sistema"},anonymous:{name:"An\xF4nimo",value:"anonymous"},realTypes:["guest","operator","customer","provider"],skipPermission:["operator","customer"],all:["system","provider","customer","operator"]};n.paymentStatus={waitingOrder:1,analyzing:2,waitingRelease:3,released:4,transferred:5,markAsPaid:6,allowTransfer:[3,4],allowChange:[1,6],sendEmail:[4,5]};n.personTypes={pf:"pf",pj:"pj"};n.asaasPersonTypes={pf:"FISICA",pj:"JURIDICA"};n.stepAccount={personal:0,address:1,documents:2};n.statusVobiPay={PENDING:{color:"#FF8E1B",label:"Em an\xE1lise"}};n.refurbishItemType={product:1,labor:2,parent:3,composition:4,notParent:[1,2,4],productLabor:[1,2]};n.notificationChannel={system:"system",email:"email",whatsApp:"whatsApp"};n.planType={free:{value:"free",label:"freemium"},paid:{value:"paid",label:"Pago"}};n.installmentStatuses={pendingPayment:1,paid:2,confirm:3,paidManually:4,inAnalysis:5,refunded:6,refundRequested:7,onGoingRefund:8,chargebackRequested:9,onGoingChargeback:10,waitingChargeback:11,cancelled:12,all:[1,2,3,4,5,6,7,8,9,10],paidVobiPay:[2,3,7,8,9,10,11],bankStatement:[2,4,6,7,8,9,10,11],allPaid:[2,3,4,7,8,9,10,11],allPaidBalance:[2,4,7,8,9,10,11],allPending:[1,5]};n.paymentStatuses={draft:1,open:2,paid:3,cancelled:4,realValues:[2,3],allStatus:[1,2,3,4]};n.billType={income:"receita",expense:"despesa",transfer:"transferencia",balance:"saldo inicial"};n.paymentTypeValues={expense:{value:"expense",label:"despesa"},income:{value:"income",label:"receita"},transfer:{value:"transfer",label:"transfer\xEAncia"},payment:{value:"payment",label:"pagamento"},balance:{value:"balance",label:"saldo inicial"}};n.financialCategories={serviceSelling:1,productsSelling:2,fee:3,investimentIncome:4,others:5,advanceFutureCapital:6,capitalIncrease:7,bankLoan:8,institutionLoan:9,partnerLoan:10,paymentShareCapital:11};n.getEnumValue=(e,t,o=["id","name"])=>{let a=null;return!e||!t||Object.keys(e).some(r=>e[r][o[0]]===t?(a=e[r][o[1]],!0):!1),a};n.asaasPixType={CPF:"CPF",CNPJ:"CNPJ",EMAIL:"E-mail",PHONE:"Celular",EVP:"Aleat\xF3ria"};n.paymentTypes={pix:1,bankSlip:2,creditCard:3,debitCard:4,transfer:5,money:6,other:7};n.paymentTypesDesc={1:"Pix",2:"Boleto",3:"Cart\xE3o de cr\xE9dito",4:"Cart\xE3o de d\xE9bito",5:"Transfer\xEAncia",6:"Dinheiro",7:"Outro"};n.vobiPayPaymentType={pix:1,bankSlip:2,creditCard:3,all:[1,2,3],1:"pix",2:"bankSlip",3:"creditCard"};n.asaasPaymentStatus={PENDING:{label:"PENDING",value:n.installmentStatuses.pendingPayment},RECEIVED:{label:"RECEIVED",value:n.installmentStatuses.paid},CONFIRMED:{label:"CONFIRMED",value:n.installmentStatuses.confirm},OVERDUE:{label:"OVERDUE",value:null},REFUNDED:{label:"REFUNDED",value:n.installmentStatuses.refunded},RECEIVED_IN_CASH:{label:"RECEIVED_IN_CASH",value:n.installmentStatuses.paidManually},REFUND_REQUESTED:{label:"REFUND_REQUESTED",value:n.installmentStatuses.refundRequested},REFUND_IN_PROGRESS:{label:"REFUND_IN_PROGRESS",value:n.installmentStatuses.onGoingRefund},CHARGEBACK_REQUESTED:{label:"CHARGEBACK_REQUESTED",value:n.installmentStatuses.chargebackRequested},CHARGEBACK_DISPUTE:{label:"CHARGEBACK_DISPUTE",value:n.installmentStatuses.onGoingChargeback},AWAITING_CHARGEBACK_REVERSAL:{label:"AWAITING_CHARGEBACK_REVERSAL",value:n.installmentStatuses.waitingChargeback},DUNNING_REQUESTED:{label:"DUNNING_REQUESTED",value:null},DUNNING_RECEIVED:{label:"DUNNING_RECEIVED",value:null},AWAITING_RISK_ANALYSIS:{label:"AWAITING_RISK_ANALYSIS",value:n.installmentStatuses.inAnalysis}};n.maxLimitPayment={credit:{value:2e4,label:"20.000,00"},installment:{value:15e4,label:"150.000,00"},minimumInstallmentValue:{value:10,label:"10,00"},maximumInstallments:{value:12}};n.asaasWithdrawStatus={PENDING:"PENDING",PROCESSING:"PROCESSING",DONE:"DONE",FAILED:"FAILED",CANCELLED:"CANCELLED",BLOCKED:"BLOCKED"};n.withdrawStatuses={DONE:"Efetuada",PENDING:"Pendente",BANK_PROCESSING:"Processando",CANCELLED:"Cancelada",FAILED:"Falhou",BLOCKED:"Bloqueado",group:{done:["DONE"],open:["PENDING","BANK_PROCESSING"],error:["CANCELLED","FAILED","BLOCKED"]}};n.vobiPayBankAccountType={corrente:"CONTA_CORRENTE",poupanca:"CONTA_POUPANCA",salario:"CONTA_SALARIO",pagamento:"CONTA_DE_PAGAMENTO"};n.withdrawSteps={list:1,fillData:2,confirmData:3};n.billingManagerStatus={pending:1,send:2,error:3,discarded:4,notSent:5,sending:6};n.billingManagerStatusDesc={1:"Aguardando",2:"Enviado",3:"Erro",4:"Descartado",5:"N\xE3o enviado",6:"Enviando"};n.billingManagerChannels={allChannels:["email","sms","whatsapp"],email:{value:"email",label:"E-mail"},sms:{value:"sms",label:"SMS"},whatsapp:{value:"whatsapp",label:"WhatsApp"}};n.billingManagerType={allTypes:["DC","D-3","D0","D+1","D+3","D+6"],billingRulerType:["D-3","D0","D+1","D+3","D+6"],DC:{label:"Cria\xE7\xE3o da cobran\xE7a",value:"DC",tooltip:"Ao criar a cobran\xE7a",message:"de cobran\xE7a criada para {customerName} {value}"},"D-3":{label:"3 dias antes do vencimento",value:"D-3",tooltip:"3 dias antes do vencimento das parcelas",message:"de aviso de vencimento em 3 dias para {customerName} {value}"},D0:{label:"Dia do vencimento",value:"D0",tooltip:"No dia do vencimento da parcela",message:"de aviso de cobran\xE7a vencendo hoje para {customerName} {value}"},"D+1":{label:"1 dia ap\xF3s o vencimento",value:"D+1",tooltip:"1 dia ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 1 dia para {customerName} {value}"},"D+3":{label:"3 dias ap\xF3s o vencimento",value:"D+3",tooltip:"3 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 3 dias para {customerName} {value}"},"D+6":{label:"6 dias ap\xF3s o vencimento",value:"D+6",tooltip:"6 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 6 dias para {customerName} {value}"}};n.paymentCreditPermission={allowed:2e4,blocked:0};n.withdrawLimit={pj:{daytime:2e4,nightly:5e3},pf:{daytime:2e4,nightly:5e3}};n.optionsRefurbishReport={financialPhysical:"financialPhysics",budgeted:"budgeted",financial:"financial",physic:"physic",financialPhysicBudgeted:{value:"financialPhysics.budgeted"},physicBudgeted:{value:"physic.budgeted"},physicAccomplished:{value:"physic.accomplished"},financialBudgeted:{value:"financial.budgeted"},financialAccomplished:{value:"financial.accomplished"},financialBudAcp:{value:"financial.budgetedAccomplished"},physicBudAcp:{value:"physic.budgetedAccomplished"}};n.refurbishReportType={budgeted:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value],accomplished:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value],budgetedAccomplished:[n.optionsRefurbishReport.financialBudAcp.value,n.optionsRefurbishReport.physicBudAcp.value],common:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudgeted.value,n.optionsRefurbishReport.financialBudAcp.value],measurement:[n.optionsRefurbishReport.physicAccomplished.value],financial:[n.optionsRefurbishReport.financialAccomplished.value],customColumns:[n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudAcp.value],simpleExport:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value]};n.reportTypeActions={consolidatedByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howFinancialReportByProjectStatusPaid",tableTitle:"Resultado de projetos",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"consolidatedByProject"},foreseenByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"dueDate",howDoesItsWorksId:"howFinancialReportByProjectAllStatus",tableTitle:"Previs\xE3o de resultado dos projetos",tableTitleTooltip:"S\xE3o contabilizadas todas as receitas e despesas, que j\xE1 foram pagas ou ainda em aberto.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"foreseenByProject"},resultsByInstallment:{model:"installments",clickRow:!0,groupBy:"months",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howResultsWork",tableTitle:"Transa\xE7\xF5es realizadas",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial",exportEntity:"resultsByInstallment"},"cashFlow-monthly":{model:"cashFlow",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howCashFlowWork",tableTitle:"Fluxo de caixa",tableTitleTooltip:"",withResultChart:!1,filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!0},showLegend:!1,exportCsvModel:"financial/cashFlow",exportEntity:"cashFlow"},dre:{model:"dre",howDoesItsWorksId:"howDREWorks",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!1},showLegend:!1,exportCsvModel:"financial/dre",exportEntity:"dre"},"cashFlow-daily":{model:"cashFlow",howDoesItsWorksId:"howDailyCashFlowWorks",tableTitleTooltip:"",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,monthPicker:!0,columns:!1,paymentBankAccount:!0},showLegend:!1,exportCsvModel:"financial/dailyCashFlow",exportEntity:"dailyCashFlow"}};n.extraValuesPayment={taxes:"taxes",discount:"discount",shipping:"shipping",dueDateDiscount:"dueDateDiscount",dueDateDiscountType:"dueDateDiscountType",dueDateLimitDays:"dueDateLimitDays",fine:"fine",fineType:"fineType",interest:"interest"};n.extraValuesPaymentType={simple:[n.extraValuesPayment.taxes,n.extraValuesPayment.discount,n.extraValuesPayment.shipping],asaas:[n.extraValuesPayment.dueDateDiscount,n.extraValuesPayment.dueDateDiscountType,n.extraValuesPayment.dueDateLimitDays,n.extraValuesPayment.fine,n.extraValuesPayment.fineType,n.extraValuesPayment.interest]};n.fineInterestDiscountType={percentage:{value:"PERCENTAGE",label:"Percentual"},fixed:{value:"FIXED",label:"Valor fixo"}};n.paymentPermissions={financialResume:"financialResume",financialSupplier:"financialSupplier",financialOwnBusiness:"financialOwnBusiness",financialIncome:"financialIncome",financialExpense:"financialExpense",financialTransfer:"financialTransfer",financialResults:"financialResults",financialBankStatement:"financialBankStatement",financialReport:"financialReport",projectResume:"projectResume",projectSupplier:"projectSupplier",projectOwnBusiness:"projectOwnBusiness",projectIncome:"projectIncome",projectExpense:"projectExpense",projectResults:"projectResults",projectBudgetedAccomplished:"projectBudgetedAccomplished"};n.colors={primary50:"#EBF0FF",primary100:"#D6E2FF",primary400:"#4F8EFA",primary500:"#2F74DE",teal500:"#00a296",teal600:"#009389",green500:"#46a22e",green600:"#40932A",yellow400:"#e0a819",yellow500:"#BA8A12",orange500:"#de7400",orange600:"#CA6A00",red50:"#fdeceb",red100:"#fac4c0",red500:"#ef4134",red600:"#D93B2F",pink500:"#e547a6",pink600:"#D04197",violet500:"#a145de",violet600:"#933FCA",neutral500:"#6F778B",neutral600:"#565E71"};n.maxInstallmentLength=60;n.purchaseSolicitationStatus={draft:1,open:2,quote:3,buy:4,closed:5,canceled:6,approved:19,rejected:20,editable:[1,2,20],ongoing:[2,3,4,19,20]};n.purchaseOrderStatus={draft:7,open:8,sent:9,accepted:10,refused:11,closed:12,approved:21,rejected:22,requestableRefund:[10,12],chargeableAdministrationFee:[10,12],editable:[7,8,22],ongoing:[8,9],finished:[10,12],allRejected:[11,22]};n.purchaseQuoteStatus={draft:13,open:14,pendingResponse:15,quoted:16,buy:17,finished:18,editable:[13,14,15],ongoing:[14,15,16,17]};n.groupPermission={admin:1,member:2};var E=n;var b={sources:[]},xe=(e={})=>{Object.keys(e).forEach(t=>{typeof e[t]=="object"&&e[t]!==null&&!Array.isArray(e[t])?b[t]={...b[t],...e[t]}:b[t]=e[t]})},De=()=>b,L=(e,t=null)=>e in b?b[e]:t;var be=({data:e,allowAudience:t=[...E.userType.all],permissions:o})=>{var a,r;try{let s=L("sources",[]),{user:d,isPublic:m,isAnonymous:p,source:u=""}=e;if(m||d!=null&&d.isCustomerView)return null;let f=[...t,E.userType.system.value];return!(d!=null&&d.id)||d.isActive===!1||p||!f.includes(d.userType||"")?h.UNAUTHORIZED.notAuthorized:(d==null?void 0:d.userType)===E.userType.system.value&&!(d!=null&&d.idCompany)?s!=null&&s.includes(u)?null:h.UNAUTHORIZED.notAuthorized:(a=E.userType.skipPermission)!=null&&a.includes((d==null?void 0:d.userType)||"")||!(o!=null&&o.length)?null:!((r=d.permissions)!=null&&r.find(x=>o==null?void 0:o.includes(x)))?h.UNAUTHORIZED.notAuthorized:null}catch{return h.UNAUTHORIZED.notAuthorized}};var w=e=>{if(typeof e!="string")return"";let t=e.trim();return t.charAt(0).toUpperCase()+t.slice(1)};var Ee=e=>{let t,o,a,r,s,d,m=!0;if(e.length<14)return!1;for(let p=1;p<e.length;p++)if(e.charAt(p-1)!==e.charAt(p)){m=!1;break}if(!m){d=e.length-2,t=e.substring(0,d),o=e.substring(d),a=0,s=d-7;for(let p=0;p<d;p++)a+=parseInt(t.charAt(p))*s--,s<2&&(s=9);if(r=a%11<2?0:11-a%11,r!==parseInt(o.charAt(0)))return!1;d+=1,t=e.substring(0,d),a=0,s=d-7;for(let p=0;p<d;p++)a+=parseInt(t.charAt(p))*s--,s<2&&(s=9);return r=a%11<2?0:11-a%11,r===parseInt(o.charAt(1))}return!1};var Ce=(e,t=!1)=>{let o,a;return o=0,e.length<11||!t&&e.split("").every(r=>r===e[0])||(Array.from({length:9}).forEach((r,s)=>{o+=parseInt(e.substring(s,s+1),10)*(11-(s+1))}),a=o*10%11,(a===10||a===11)&&(a=0),a!==parseInt(e.substring(9,10),10))?!1:(o=0,Array.from({length:10}).forEach((r,s)=>{o+=parseInt(e.substring(s,s+1),10)*(12-(s+1))}),a=o*10%11,(a===10||a===11)&&(a=0),a===parseInt(e.substring(10,11),10))};var ve=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);var Ne=e=>decodeURI(e)!==decodeURIComponent(e);var Ie=e=>(...t)=>e.length>t.length?e.bind(null,...t):e(...t);var I=D(require("crypto-js")),Ae=(e,t)=>I.AES.decrypt(e,t).toString(I.enc.Utf8);var Re=(e,t)=>Object.keys(t).reduce((o,a)=>{if(e[a]===t[a]||a==="lastModifiedBy"||a==="createdAt")return o;let{oldData:r,newData:s}=o;return{oldData:{...r,[a]:e[a]},newData:{...s,[a]:t[a]}}},{});var Be=(e,t)=>e&&typeof e=="string"?e.search(/[a-z]\.[a-z]/i)>=0?t.__(e):e:"";var Pe=e=>{let t={};return e==null||e.forEach(o=>{Object.keys(o).forEach(r=>{typeof o[r]=="string"&&(o[r].toLowerCase()==="true"||o[r].toLowerCase()==="false")?t[r]=o[r].toLowerCase()==="true":t[r]=o[r]})}),t};var J=D(require("crypto-js")),Te=(e,t)=>(typeof e=="object"&&(e=JSON.stringify(e)),J.AES.encrypt(e,t).toString());var Se={on(e,t){document.addEventListener(e,t)},dispatch(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))},remove(e,t){document.removeEventListener(e,t)}};var O=(e,t)=>{if(Array.isArray(e)===!1)return null;let o=null;return e.some(a=>(o=t(a),!!o)),o};var Le=(e,t)=>e?e[t]?e[t]:O(e.or,o=>o[t]):null;var we=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.substring(0,t)};var Oe=(e,t)=>e&&e.length&&t&&t.length?e.map(o=>Object.entries(o).filter(([a])=>t.includes(a)).reduce((a,[r,s])=>Object.assign(a,{[r]:s}),{})):[];var Fe=e=>e.filter(t=>S(t).length>0&&t);var F=(e,t={})=>{let o={decimalCount:2,decimal:",",thousands:".",...t},{decimal:a,thousands:r,currencySymbol:s}=o,{decimalCount:d}=o;try{d=Math.abs(d),d=isNaN(d)?2:d;let m=e<0?"-":"",p=parseInt(e=Math.abs(Number(e)||0).toFixed(d),10).toString(),u=p.length>3?p.length%3:0;return(s?`${m}${s}`:m)+(u?p.substr(0,u)+r:"")+p.substr(u).replace(/(\d{3})(?=\d)/g,`$1${r}`)+(d?a+Math.abs(e-parseInt(p,10)).toFixed(d).slice(2):"")}catch(m){return console.log(m),""}};var g=D(require("moment-timezone")),Z=e=>{let t=e?new Date(e):new Date,o={timeZone:"America/Sao_Paulo"},a=t.toLocaleString("en-US",o);return new Date(a)},K=(e,t,o,a,r)=>{if(!e)return null;if(r)return(0,g.default)(e,t);let s=g.default.utc(e);return a||s.local(),o&&s.locale(o),s.format(t)},Ue=(e,t="YYYY-MM-DD")=>{let o=(0,g.default)(e,t).add(1,"days");return typeof e=="string"?o.format(t):o.toDate()},Q=(e=new Date,t=1)=>{let o=new Date(e.setDate(e.getDate()+t));return o.getDay()%6?o:Q(o)},X=(e=new Date,t=1)=>{let o=new Date(e.setDate(e.getDate()-t));return o.getDay()%6?o:X(o)},A=e=>e?g.default.utc(e).local():null,U=e=>e&&g.default.tz(new Date(e),"America/Sao_Paulo"),ke=(e,t)=>{let o=U(e);return o&&o.format(t||"YYYY-MM-DDTHH:mm:ssZ")},_e=(e,t)=>{if(!e||!t)return null;let o=A(e),a=A(t);return!o||!a?null:a.diff(o,"months")},je=(e,t)=>{var o;return!e||!t?null:(o=A(e))==null?void 0:o.isAfter(t)},Me=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo");return e?t.startOf("day").toDate():t.toDate()},Ve=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo").subtract(1,"day");return e?t.startOf("day").toDate():t.toDate()},Ge=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo").add(1,"day");return e?t.startOf("day").toDate():t.toDate()},$e=e=>{let t=Z(e);return`${t.getFullYear()}${t.getMonth().toString().padStart(2,"0")}`},ze=(e,t)=>{let o=new Date(e),a=new Date;return new Date(a.getFullYear()-t,a.getMonth(),a.getDate()).getTime()>o.getTime()},qe=e=>g.default.max(e),Ye=e=>g.default.min(e),We=e=>(0,g.default)(e).isValid(),k=(e,t)=>new Date(e,t-1,1).toISOString().split("T")[0],_=(e,t)=>new Date(e,t,0).toISOString().split("T")[0],j=()=>{let e=new Date(U(new Date));return K(e,"YYYY-MM-DD")};var He=D(require("dayjs"));var R=e=>e.length===2?[e[0].replace(/\./g,""),e[1].replace(/\./g,"")]:e;var ee=e=>{let t=R(e.toString().replace("%","").replace("R$","").replace(/\s/g,"").trim().split(","));if(t.length===2)return t.join(".");let o=R(t[0].split("."));return o.length===2?o.join("."):t[0].replace(/\./g,"")},Je=e=>{if(e==null)return e;if(!ee(e))return null;let t=Number(ee(e));return t>=Number.MAX_SAFE_INTEGER||Number.isNaN(t)?null:t},Ze=e=>{var o,a;if(!e)return null;let t=e.toString();return t.indexOf("/")>=0?null:(t=t.replace(/[^0-9.,-]/g,""),t.includes(",")&&t.includes(".")?(t.lastIndexOf(",")>t.lastIndexOf(".")?t=t.replace(/\./g,"").replace(",","."):t=t.replace(/,/g,""),Number(t)):t.includes(",")&&((o=t.split(",")[1])==null?void 0:o.length)>0?Number(t.replace(",",".")):t.includes(".")&&((a=t.split(".")[1])==null?void 0:a.length)>0?Number(t):Number(t.replace(/[.,]/g,"")))};var Ke=e=>{let t=e.indexOf("."),o=e.length;return t&&o?e.substr(t,o):""};var Qe=new RegExp('<img[^>]+src="(https://vobi-storage[^">]+)"',"gm");var Xe=e=>{if(!e)return!1;let t=new Date(e);return!isNaN(t.getTime())};var et=e=>!isNaN(parseFloat(e))&&!isNaN(e-0);var tt=e=>{try{return!!new URL(e)}catch{return!1}};var te=D(require("jwt-decode")),at=e=>{var r;let{authorization:t,Authorization:o}=e,a=(r=t||o)==null?void 0:r.split(" ");return(a==null?void 0:a[0])==="Bearer"?a[1]:null},ot=e=>{let{user:t,isCustomerView:o,accessedBy:a,exp:r,iss:s}=e?(0,te.default)(e):{};return{...t,isCustomerView:o,accessedBy:a,exp:r,currentDevice:s}};var nt=(e,t,o,a)=>{let r=e.idStatus>=5?"projetos":"oportunidades",s=t==="customer"?"cliente":"profissional",d=`/${s}/${r}/perfil/${e.id}`,m=`/${s}`;return`${{operator:d,provider:d,customer:m}}/arquivos?arquivo=${o.id}${a?"&visualizar":""}`};var rt=e=>(e==null?void 0:e.length)===0?null:e;var st=(e,t="0000")=>(t+e).slice(t.length*-1);var it=(e,t=!1)=>{let o={};for(let a=0;a<e.length;a++){let r=e[a];o[r.value]=t?{...r}:r.label}return o};var lt=e=>e.replace(/ /g,"").split("-").reduce((t,o)=>t+w(o),"");var dt=e=>e==null?void 0:e.replace(/[,-./]/g,"");var ct=({id:e,name:t,email:o,idCompany:a,userType:r,type:s,isOwner:d,MGMCode:m,groupPermission:p,isActive:u,limitAccess:f,company:y})=>({id:e,name:t,email:o,idCompany:a,userType:r,type:s,isOwner:d,MGMCode:m,groupPermission:p,isActive:u,limitAccess:f,idPlan:y==null?void 0:y.idPlan});var ut=e=>{let t=new Array(e.length),o=0;return new Promise((a,r)=>{e.forEach((s,d)=>{Promise.resolve(s).then(a).catch(m=>{t[d]=m,o+=1,o===e.length&&r(t)})})})};var pt=(e,t)=>Object.keys(t).filter(o=>o!==e).reduce((o,a)=>({...o,[a]:t[a]}),{});var mt=(e,t,o=!0)=>{if(!e)return e;let a=e.toLowerCase();return o&&(a=a.replace(new RegExp("\\s","g"),"")),a=a.replace(new RegExp("[\xE0\xE1\xE2\xE3\xE4\xE5]","g"),"a"),a=a.replace(new RegExp("\xE6","g"),"ae"),a=a.replace(new RegExp("\xE7","g"),"c"),a=a.replace(new RegExp("[\xE8\xE9\xEA\xEB]","g"),"e"),a=a.replace(new RegExp("[\xEC\xED\xEE\xEF]","g"),"i"),a=a.replace(new RegExp("\xF1","g"),"n"),a=a.replace(new RegExp("[\xF2\xF3\xF4\xF5\xF6]","g"),"o"),a=a.replace(new RegExp("\u0153","g"),"oe"),a=a.replace(new RegExp("[\xF9\xFA\xFB\xFC]","g"),"u"),a=a.replace(new RegExp("[\xFD\xFF]","g"),"y"),a=a.replace("'",""),a=a.replace("\xB4",""),a=a.replace("`",""),t&&(a=a.replace(new RegExp("\\W","g"),"")),a};var ft=e=>e==null?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9-/\s]/g,"").replace(/\//g,"").replace(/\s+/g,"-").toLowerCase();var gt=(e,t)=>e.reduce((o,a,r)=>{let s=Math.floor(r/t),d=[...o];return o[s]||(d[s]=[]),d[s].push(a),d},[]);var yt=(e,t,o)=>{let a=o||t;return(e==null?void 0:e.map(r=>a?r[o]||r[t]:r).reduce((r,s)=>r+(Number(s||0)||0),0))||0};var ht=(e,t)=>(e==null?void 0:e.map(o=>t(o)).reduce((o,a)=>o+(Number(a||0)||0),0))||0;var xt=e=>{let t=e.replace(/\D/g,"");return/^(?:\+?55 ?)?(?:0?[1-9]{2})?9\d{8}$/.test(t)};var Dt=e=>typeof e!="string"||!e?"":e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim();var M=(e,t="")=>!e||e.length<=0?[]:e.flatMap((o,a)=>{let r=t?`${t}.${a+1}`:`${a+1}`,{children:s,...d}=o;return[{...d,index:r},...M(s||[],r)]}),bt=e=>M(e).reduce((o,a)=>a.id?{...o,[a.id]:a}:o,{});var Et=(e,t)=>{var a;let o=e?(a=Number(e).toFixed(2))==null?void 0:a.replace(".",","):0;return t?`${F(e*100)}%`:o};var Ct=e=>{if(!e)return{};let[t,o]=e.split("-").map(Number),a=j(),r=k(t,o),s=_(t,o);return{startDate:r,endDate:s,actualDate:a}};var vt=({oldStatus:e,newStatus:t,total:o,user:a,moveStatus:r})=>{var y,x,G,$,z;let{userApprovalAuthorities:s,isOwner:d,groupPermission:m,company:p}=a||{},u=r==null?void 0:r[e];if(!((y=u==null?void 0:u[t])!=null&&y.isAllowed))return null;if(d||m===n.groupPermission.admin||!((x=u==null?void 0:u[t])!=null&&x.authorityLevel))return u==null?void 0:u[t];let f=s==null?void 0:s.find(C=>{var q;return(C==null?void 0:C.idApprovalAuthority)===((q=u==null?void 0:u[t])==null?void 0:q.authorityLevel)});return!f&&(($=p==null?void 0:p.approvalAuthority)!=null&&$[(G=u==null?void 0:u[t])==null?void 0:G.authorityLevel])?!1:(z=u==null?void 0:u[t])!=null&&z.maxAmount?!Number((f==null?void 0:f.maxAmount)||0)&&(f==null?void 0:f.maxAmount)!==0||Number(o||0)<=Number(f==null?void 0:f.maxAmount)?u==null?void 0:u[t]:!1:u==null?void 0:u[t]};var Nt=e=>{if(!e)return null;let t=e==null?void 0:e.replace(/\D/g,"");return(t==null?void 0:t.length)===11?t==null?void 0:t.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4"):(t==null?void 0:t.length)===14?t==null?void 0:t.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5"):t};var V=D(require("dayjs")),It=()=>{let e=(0,V.default)().format("YYYY-MM-DD"),t=(0,V.default)().subtract(1,"day").format("YYYY-MM-DD");return{today:e,yesterday:t}};var ae=10*1024*1024,At=(e,t="",o="")=>{var p;let{file:a,fileName:r}=e,s=Date.now().toString(),d=((p=a==null?void 0:a.type)==null?void 0:p.split("/")[1])||"unknown",m=`${t}${s}_${o}.${d}`;return{name:r||m,size:(a==null?void 0:a.size)||0,type:(a==null?void 0:a.type)||"image/jpeg"}},Rt=async(e,t)=>{let o=Object.keys(t);return await Promise.all(o.map(async a=>{let r=Number(a),s=r*ae,d=(r+1)*ae,m=e.slice(s,d),p=await fetch(t[a],{method:"PUT",body:m,headers:{"Content-Type":e.type},credentials:"omit"});if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return{ETag:p.headers.get("etag"),PartNumber:r+1}}))},Bt=async({baseUrl:e,fileObject:t,idCompany:o="",suffix:a=""})=>{if(!t||!t.file)throw new Error("Nenhum arquivo fornecido");try{let r=At(t,"document_",a),s=await fetch(`${e}/media/start/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:o,file:r})});if(!s.ok){let x=await s.json().catch(()=>({}));throw new Error(`Failed to start upload. Status: ${s.status}, Data: ${JSON.stringify(x)}`)}let d=await s.json(),{signUrls:m,uploadId:p}=d,u=await Rt(t.file,m),f=await fetch(`${e}/media/complete/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:o,file:r,uploadId:p,parts:u})});if(!f.ok){let x=await f.json().catch(()=>({}));throw new Error(`Failed to complete upload. Status: ${f.status}, Data: ${JSON.stringify(x)}`)}let y=await f.json();return y==null?void 0:y.location}catch(r){throw r}};0&&(module.exports={BAD_GATEWAY,BAD_REQUEST,FORBIDDEN,INTERNAL_SERVER_ERROR,IsJsonString,METHOD_NOT_ALLOWED,NOT_ALLOWED,NOT_FOUND,SERVICE_UNAVAILABLE,UNAUTHORIZED,asArray,asBrazilianDate,asDate,asyncForEach,brazilianDateTime,brazilianDateToDate,capitalize,checkApprovalAuthority,checkCnpj,checkCpf,checkEmail,configure,containsEncodedComponents,currentDay,curry,dateIsValid,decodeToken,decrypt,diffObject,dynamici18nString,elasticTransformOr,encrypt,enumHelper,error,eventBus,extractMonthInfo,extractValueFromWhere,filterAttributes,filterEmpty,findValue,firstMonthDay,flatMapData,flattenChildren,formatCurrency,formatDate,formatDocument,formatNumber,formatNumberAnyFormat,get,getConfig,getDateOpenFinance,getExtension,getMonthNumber,getNameWithoutExtension,getNextDay,getNextWeekday,getPreviewsWeekday,getToday,getToken,getTomorrow,getYesterday,imgSrcRegex,isAfter,isDateValid,isNumber,isOfAge,isValidUrl,lastMonthDay,makeRefurbishFileUrl,maxDateToList,minDateToList,monthsBetween,normalizeString,nullIfEmpty,padLeft,parseArrayAsObject,parseRouteToModel,prepareDoc,prepareSession,promiseAny,promiseEach,removeProperty,removeSpecialChar,replaceNumberOrPercentage,slugify,splitList,sum,sumByFunction,upload,validateAccess,validateMobilePhoneNumber,valueReplacer});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vobi_lib",
3
- "version": "1.5.7",
3
+ "version": "1.6.0",
4
4
  "description": "Vobi Library",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",