PageSourceSearch

https://portal.cardapioweb.com/assets/index-BBktC3m1.js

js cardapioweb.com collected 2026-09-24 11:58:56 UTC 4,694 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8a48d2bb-a890-5f95-9824-4827f93eb2b6")}catch(e){}}();
3import{bN as E,ac as y,R as e,aD as x,aU as C,W as _,aj as N,bJ as A,bY as h,bi as r,bk as F,bs as O}from"./index-Cs-In7Vx.js";import{u as m,a as f,b as D,d as w,g as T,A as k}from"./AccountsDialog-DZ8H1Ku4.js";import{A as I}from"./index-Dpr9l0yn.js";import{f as p}from"./utils-X2dEsrfc.js";import"./CreationAndUpdateInfo-CcB-rkli.js";import"./SearchTextInput-Gprlx1Wp.js";const u=E(l=>({filters:{q:{}},updateFilter:(n,o)=>l(t=>({...t,filters:{...t.filters,[n]:o}}))})),q=[{field:"account_type",label:"Tipo de conta",type:"list_in_required",valueOptions:[{id:"checking",label:"Conta corrente"},{id:"savings",label:"Conta poupança"},{id:"investment",label:"Conta de investimento"},{id:"cash",label:"Dinheiro"},{id:"other",label:"Outro"}],valueOptionKey:"id",valueOptionLabel:"label"},{field:"active",label:"Status",type:"list_eq_required",valueOptions:[{id:"true",label:"Ativa"},{id:"false",label:"Inativa"}],valueOptionKey:"id",valueOptionLabel:"label"},{field:"is_default",label:"Conta padrão",type:"list_eq_required",valueOptions:[{id:"true",label:"Sim"},{id:"false",label:"Não"}],valueOptionKey:"id",valueOptionLabel:"label"}],H=[{field:"name_or_fin_bank_name",label:"Nome da conta",operation:"i_cont",type:"string",valueInputProps:{placeholder:"Pesquise pelo nome ou banco"}}];function R(){const l=u(t=>t.updateFilter),n=m(t=>t.openDialogOnCreate),{hasUserPermissions:o}=y();return e.createElement(I,{fields:q,fixedFields:H,onFilterChange:t=>l("q",t),wrapperClassName:null,actions:o(x.FINANCIAL_CREATE_ACCOUNT)&&e.createElement("button",{className:"my-6 inline-flex cursor-pointer items-center space-x-12 whitespace-nowrap rounded-6 border border-solid border-gray-200 bg-gray-50 py-8 pl-12 pr-16 text-16 font-bold text-gray-600 hover:bg-gray-100",onClick:()=>n()},e.createElement(C,null)," ",e.createElement("span",null,"Nova conta"))})}const L={active:e.createElement(r,{color:"green"},"Ativa"),inactive:e.createElement(r,{color:"red"},"Inativa")};function S(){const l=_(),n=N(),{mutate:o}=A(),t=m(a=>a.openDialogOnEdit),i=u(a=>a.filters),{data:c,isLoading:s,isError:d}=f(i),b=a=>async()=>{try{await n({title:"Confirmar exclusão da conta?",cancellationText:"Voltar ",confirmationText:"Excluir"});try{await w(a),await o(T()),l.success("Conta excluída com sucesso!")}catch(g){const v=g.response?.data?.message;l.error(v||"Não foi possível excluir a conta")}}catch{}};return e.createElement(h,{data:c,stickyHeader:!0,onRowClick:a=>t(a),loadingRowsQuantity:5,loading:s,showError:d,defaultOrder:"active",defaultOrderBy:"desc",columns:[{Header:"Conta",accessor:"name",sortable:!1,Cell:({row:a})=>e.createElement("div",{className:"inline-flex items-center gap-8 truncate"},e.createElement("span",{className:"font-bold"},a.name),a.is_default&&e.createElement(r,{color:"blue"},"Padrão"))},{Header:"Banco",accessor:"bank_display_name",sortable:!1,className:"max-w-288 truncate",formatDataFunction:a=>a||e.createElement(r,{color:"grey"},"Não informado")},{Header:"Tipo",accessor:"account_type",sortable:!1,formatDataFunction:a=>D[a]?.tag||e.createElement(r,{color:"grey"},"Desconhecida")},{Header:"Status",accessor:"active",sortable:!1,formatDataFunction:a=>L[a?"active":"inactive"]},{Header:"Saldo",accessor:"balance",align:"right",sortable:!1,formatDataFunction:a=>p(a)},{Header:"",sortable:!1,align:"right",Cell:({row:a})=>a.is_editable&&e.createElement("div",{className:"flex w-full justify-end space-x-12"},e.createElement(F,{tooltip:a.is_default?"Conta padrão não pode ser excluída":"Excluir",onClick:b(a.id),disabled:a.is_default},e.createElement(O,{color:"inherit"})))}]})}function B(){const l=u(s=>s.filters),{data:n,isLoading:o,isError:t}=f(l),i=n?.reduce((s,d)=>s+d.balance,0),c=o?e.createElement("span",{className:"h-24 w-128 animate-pulse rounded-4 bg-gray-200"}):t?e.createElement("span",{className:"font-bold text-red-dark"},"Indisponível"):p(i);return e.createElement("div",{className:"flex justify-end space-x-20 px-20 text-18"},e.createElement("strong",{className:"text-gray-500"},"Saldo total:")," ",c)}function J(){return e.createElement("div",{className:"flex w-full flex-1 flex-col space-y-12 overflow-auto sm:space-y-16"},e.createElement(R,null),e.createElement("div",{className:"sm:flex-1 sm:overflow-auto"},e.createElement(S,null)),e.createElement(B,null),e.createElement(k,null))}export{J as default};
4
5//# debugId=8a48d2bb-a890-5f95-9824-4827f93eb2b6

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.