"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[447],{74602:function(e,t,a){a.d(t,{Z:function(){return k}});var l=a(85893),n=a(8889),r=a(54462),s=a(67218),i={src:"/_next/static/media/logo-icon.b8438aaa.png",height:62,width:70,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAMAAAACh/xsAAAAIVBMVEX///////////9MaXH///////////////////////////+I6eFzAAAAC3RSTlNnUUQAdFkMG40kMQXKY+4AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAySURBVHicJcsxDsAwDMQwnWXH6f8/XBTduBCLhJKMu6Zoz40CnpkjtOZ+oHzWKbr/9QIU8gCsUDXLVwAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:7},d=a(67320),o=a(75362),c=a(59820),u=a(35357),m=a(31009),x=a(9008),h=a.n(x),p=a(25675),f=a.n(p),g=a(41664),b=a.n(g),w=a(67294),j=a(72956),v=a(44531),N=a(73582),y=a(67814),A=a(39332),C=a(87249);let F=()=>{let{isCollaborator:e,isManager:t}=(0,u.k)(),a=(0,A.usePathname)(),n=[{href:"/dashboard/home",icon:N.ILF},...e?[]:[{href:"/dashboard/analytics",icon:N.mfE}],...e||t?[]:[{href:"/dashboard/positions",icon:N.Ps7},{href:"/dashboard/settings",icon:N.gr5}]];return(0,l.jsx)("nav",{className:"flex items-center gap-4 border-b border-[#D5D5D5] bg-white px-6 py-[14px] lg:min-h-[calc(100vh_-_71px)] lg:flex-col lg:border-b-0 lg:border-r",children:n.map(e=>{let{href:t,icon:n}=e;return(0,l.jsx)(C.z,{asChild:!0,className:(0,v.cn)("h-8 w-8 rounded p-0",a.includes(t)?"text-white":" border border-[#e7e7e7] bg-[#f5f6fa] text-[#5F6C72] hover:bg-[#ddd]"),children:(0,l.jsx)(b(),{href:t,children:(0,l.jsx)(y.G,{icon:n,className:"min-h-5"})})},t)})})};var E=a(54279);let R=e=>{var t,a;let{children:x}=e,[h,p]=(0,w.useState)(""),[g,N]=(0,w.useState)(!1),[y,A]=(0,w.useState)(n.jT),C=(0,E.a)("(max-width: 424px)"),{data:R,isManager:k,isAdmin:S,isSystem:M,mutate:_}=(0,u.k)(),{data:L,isLoading:P}=function(){var e;let{data:t,error:a,isLoading:l,mutate:n}=(0,c.ZP)("/user-companies");return{data:null!==(e=null==t?void 0:t.map(e=>{let{id:t,code:a}=e;return{id:t,name:"ALL"===a?"Todas":a,value:a}}))&&void 0!==e?e:[],error:a,isLoading:l,mutate:n}}(),{trigger:I}=function(){let{trigger:e,isMutating:t}=(0,o.Z)("/user-companies/",(e,t)=>{let{arg:a}=t;return d.h.patch(e+a)});return{trigger:e,isMutating:t}}();async function G(e){try{p(e),await I(e),await _()}catch(t){let e=(0,m.S)(t);A({...n.jT,text:e,lowOpacity:!0}),N(!0)}}return(0,w.useEffect)(()=>{(null==R?void 0:R.companyCode)&&p(R.companyCode)},[R]),(0,l.jsxs)("div",{children:[(0,l.jsx)(n.VF,{type:y.type,open:g,setOpen:N,title:y.title,text:y.text,cancelText:"Fechar",lowOpacity:!0}),(0,l.jsxs)("header",{className:"flex h-[71px] w-full items-center border-b-[3px] border-secondary bg-dark-dark px-6 text-white",children:[(0,l.jsx)(b(),{href:"/",className:"mr-6",children:(0,l.jsx)(f(),{alt:"Logo",src:C?i:s.Z,width:C?32:140,className:(0,v.cn)(C?"min-w-[32px]":"min-w-[140px]")})}),(0,l.jsx)("p",{className:(0,v.cn)("mr-auto h-6 border-l-2 border-secondary pl-4 align-baseline text-sm font-semibold leading-6 lg:pl-6",(k||S||M)&&"max-sm:hidden"),children:"Dashboard"}),(k||S||M)&&(0,l.jsxs)(r.Ph,{value:h,onValueChange:G,disabled:P,children:[(0,l.jsx)(r.i4,{className:"ml-auto mr-4 h-10 w-full max-w-20 rounded border border-gray-200 bg-white px-2 text-black file:disabled:opacity-50 sm:mr-10",children:(0,l.jsx)(r.ki,{placeholder:"Selecione uma op\xe7\xe3o"})}),(0,l.jsxs)(r.Bw,{className:"rounded border border-gray-200 bg-white text-black ",children:[(0,l.jsx)(r.Ql,{value:null!==(a=null==R?void 0:R.companyCode)&&void 0!==a?a:"empty",className:" text-black hover:text-white",children:P?"Carregando...":(null==R?void 0:R.companyCode)==="ALL"?"Todas":null==R?void 0:R.companyCode}),null===(t=L.filter(e=>e.value!==(null==R?void 0:R.companyCode)))||void 0===t?void 0:t.map(e=>(0,l.jsx)(r.Ql,{value:e.value,className:"text-black hover:text-white",children:e.name},e.id))]})]}),(0,l.jsx)(j.X,{})]}),(0,l.jsxs)("div",{className:"bg-[#F5F6FA] lg:flex ",children:[(0,l.jsx)(F,{}),(0,l.jsx)("main",{className:"min-h-[calc(100vh_-_71px_-_61px)] w-full px-6 py-4 lg:min-h-0",children:x})]})]})};function k(e,t){let a=t?"".concat(t," | Cometa Indica\xe7\xf5es"):"Cometa Indica\xe7\xf5es",n=t=>(0,l.jsx)(e,{...t});return n.getLayout=function(e){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h(),{children:(0,l.jsx)("title",{children:a})}),(0,l.jsx)(R,{children:e})]})},n}},87210:function(e,t,a){a.d(t,{K:function(){return f}});var l=a(85893),n=a(54636),r=a(54279),s=a(44531),i=a(68779),d=a(73582),o=a(67814),c=a(74094),u=a(27060),m=a(67294),x=a(40189),h=a(87249),p=a(35037);function f(e){var t,a;let{columns:f,data:g,isLoading:b,searchPlaceholder:w="Pesquisar...",emptyMessage:j="Sem resultados...",renderSubComponent:v,getRowCanExpand:N=!1,onlyTable:y,infiniteTable:A,setRowSelection:C,rowSelection:F,rowSelectCondition:E,footer:R,manualPagination:k,paginationData:S,pagination:M,sorting:_,setSearchValue:L,searchValue:P,setPagination:I,inputRef:G,title:D,actionButton:V,square:Z}=e,[z,U]=(0,n.G)("",400),T=(0,r.a)("(max-width: 1024px)"),B=(0,c.b7)({data:g,columns:f,state:{globalFilter:z,...A&&{pagination:M||{pageSize:g?g.length:10,pageIndex:0}},...F&&{rowSelection:F},..._&&{sorting:_}},onGlobalFilterChange:U,getFilteredRowModel:(0,u.vL)(),getCoreRowModel:(0,u.sC)(),getRowCanExpand:()=>N,getExpandedRowModel:(0,u.rV)(),getPaginationRowModel:(0,u.G_)(),getSortedRowModel:(0,u.tj)(),...k&&{manualPagination:k},...S&&{pageCount:S.total},...I&&{onPaginationChange:I},...C&&{onRowSelectionChange:C},...E&&{enableRowSelection:E}}),H=B.getRowModel().rows.length.toLocaleString(),Q=M?M.pageIndex:B.getState().pagination.pageIndex,O=10*Q+Number(H),X=S?S.total:B.getRowCount().toLocaleString(),J=Number(null==S?void 0:null===(t=S.previousPageUrl)||void 0===t?void 0:t.split("=")[1])||1,K=Number(null==S?void 0:null===(a=S.nextPageUrl)||void 0===a?void 0:a.split("=")[1])||1;function W(){var e;return(0,l.jsx)("div",{className:(0,s.cn)("vertical-scroll flex-1 overflow-x-auto bg-white"),children:(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:B.getHeaderGroups().map(e=>(0,l.jsx)("tr",{className:"bg-[#F4F2FF]",children:e.headers.map(e=>(0,l.jsx)("th",{className:"whitespace-nowrap px-5 py-4 text-left font-semibold text-[#6E6893] first-of-type:pl-5 last-of-type:pr-5",children:e.isPlaceholder?null:(0,c.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,l.jsx)("tbody",{children:(null===(e=B.getRowModel().rows)||void 0===e?void 0:e.length)?B.getRowModel().rows.map(e=>(0,l.jsxs)(m.Fragment,{children:[(0,l.jsx)("tr",{"data-state":e.getIsSelected()&&"selected",className:" even:bg-[#F4F2FF]",children:e.getVisibleCells().map(e=>(0,l.jsx)("td",{className:"whitespace-nowrap px-5 py-[22px] text-[#525259] first-of-type:pl-5 last-of-type:pr-5",children:(0,c.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&v&&v({row:e})]},e.id)):(0,l.jsx)("tr",{children:(0,l.jsxs)("td",{colSpan:f.length,className:"py-10 text-center",children:[j,"."]})})}),R&&R()]})})}return((0,m.useEffect)(()=>{B.firstPage()},[P]),y)?W():(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:(0,s.cn)("no-scrollbar relative overflow-hidden rounded-se-lg rounded-ss-lg border border-b-0 border-[#EDF2F6] bg-white pr-0 shadow",T&&"overflow-auto px-3 py-4",Z&&"rounded-none"),children:[(0,l.jsx)(x.f,{visible:b,color:"#A6E732"}),(0,l.jsxs)("div",{className:"flex flex-col lg:mb-4 lg:flex-row lg:items-center lg:px-5 lg:pt-4",children:[D&&"string"==typeof D?(0,l.jsx)("h2",{className:(0,s.cn)("mb-4 text-xs font-semibold lg:mb-0 lg:mr-auto lg:text-sm"),children:D}):D,(0,l.jsx)(p.I,{placeholder:w,className:"mb-4 w-full border-none bg-[#F4F2FF] !pl-12 text-sm text-[#6E6893] placeholder:text-[#6E6893] lg:m-0 lg:max-w-96",defaultValue:P||z,wrapperClassName:"w-full lg:max-w-96",iconClassName:"h-[48px]",ref:G,variant:"with-icon",icon:(0,l.jsx)(o.G,{icon:d.wn1,color:"#6E6893",className:"!h-5"}),onChange:e=>L?L(e.target.value):U(e.target.value)}),V&&V]}),T?function(){let e=B.getRowModel().rows;return(0,l.jsx)("div",{children:(0,l.jsx)("table",{className:"w-full",children:(null==e?void 0:e.length)?e.map((t,a)=>(0,l.jsxs)("tbody",{className:(0,s.cn)("flex w-full flex-col",a!==e.length-1&&"mb-4 border-b border-[#E7E7E7] pb-4"),children:[t.getVisibleCells().map(e=>{var a;let n=null===(a=B.getHeaderGroups()[0].headers.find(t=>t.id===e.column.id))||void 0===a?void 0:a.column.columnDef.header;return(0,l.jsxs)("tr",{"data-state":t.getIsSelected()&&"selected",className:"flex justify-between text-sm odd:bg-[#F4F2FF]",children:[(0,l.jsx)("th",{className:"p-3 text-left font-semibold text-[#6E6893]",children:n}),(0,l.jsx)("td",{className:"p-3 text-right text-[#525259]",children:(0,c.ie)(e.column.columnDef.cell,e.getContext())})]},e.id)}),t.getIsExpanded()&&v&&v({row:t})]},t.id)):(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"text-center",children:j})})})})}():W()]}),(0,l.jsxs)("div",{className:(0,s.cn)("flex flex-col items-center gap-6 rounded-ee-lg rounded-es-lg border border-t-0 border-[#EDF2F6] bg-[#F4F2FF] px-5 py-4 font-medium text-[#6E6893] shadow sm:flex-row sm:justify-end",Z&&"rounded-none"),children:[(0,l.jsxs)("div",{className:"flex flex-col items-center gap-6 text-xs sm:flex-row sm:items-start",children:[(0,l.jsxs)("p",{children:["Linhas por p\xe1gina: ",(null==M?void 0:M.pageSize)||10]}),(0,l.jsxs)("p",{children:[10*Q+1," - ",O," de ",X]})]}),(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsx)(h.z,{variant:"transparent",className:"h-6 w-6 p-0",onClick:()=>B.previousPage(),disabled:S?Q+1<=J:!B.getCanPreviousPage(),children:(0,l.jsx)(o.G,{icon:i.EyR,className:"!h-3"})}),(0,l.jsx)(h.z,{className:"h-6 w-6 p-0",variant:"transparent",onClick:()=>B.nextPage(),disabled:S?Q+1>=K:!B.getCanNextPage(),children:(0,l.jsx)(o.G,{icon:i.yOZ,className:"!h-3"})})]})]})]})}},54462:function(e,t,a){a.d(t,{Bw:function(){return w},Ph:function(){return h},Ql:function(){return j},i4:function(){return f},ki:function(){return p}});var l=a(85893),n=a(44531),r=a(5193),s=a.n(r),i=a(73582),d=a(67814),o=a(85872),c=a(84979),u=a(8971),m=a(13742),x=a(67294);let h=o.fC;o.ZA;let p=o.B4,f=x.forwardRef((e,t)=>{let{className:a,children:r,...c}=e;return(0,l.jsxs)(o.xz,{ref:t,className:(0,n.cn)(s().className,"bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-12 w-full items-center justify-between rounded border border-dark-light bg-dark p-4 text-sm focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:opacity-20 [&>span]:line-clamp-1",a),...c,children:[r,(0,l.jsx)(o.JO,{asChild:!0,children:(0,l.jsx)(d.G,{icon:i.ptq,className:"h-4 w-4"})})]})});f.displayName=o.xz.displayName;let g=x.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,l.jsx)(o.u_,{ref:t,className:(0,n.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,l.jsx)(c.Z,{className:"h-4 w-4"})})});g.displayName=o.u_.displayName;let b=x.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,l.jsx)(o.$G,{ref:t,className:(0,n.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,l.jsx)(u.Z,{className:"h-4 w-4"})})});b.displayName=o.$G.displayName;let w=x.forwardRef((e,t)=>{let{className:a,children:r,position:s="popper",...i}=e;return(0,l.jsx)(o.h_,{children:(0,l.jsxs)(o.VY,{ref:t,className:(0,n.cn)("bg-popover text-popover-foreground relative z-50 max-h-96 min-w-[6rem] overflow-hidden rounded bg-dark text-white shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:s,...i,children:[(0,l.jsx)(g,{}),(0,l.jsx)(o.l_,{className:(0,n.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,l.jsx)(b,{})]})})});w.displayName=o.VY.displayName,x.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,l.jsx)(o.__,{ref:t,className:(0,n.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...r})}).displayName=o.__.displayName;let j=x.forwardRef((e,t)=>{let{className:a,children:r,...i}=e;return(0,l.jsxs)(o.ck,{ref:t,className:(0,n.cn)(s().className,"focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-6 text-sm outline-none hover:bg-primary-light data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...i,children:[(0,l.jsx)(o.eT,{children:r}),(0,l.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,l.jsx)(o.wU,{children:(0,l.jsx)(m.Z,{className:"h-4 w-4"})})})]})});j.displayName=o.ck.displayName,x.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,l.jsx)(o.Z0,{ref:t,className:(0,n.cn)("bg-muted -mx-1 my-1 h-px",a),...r})}).displayName=o.Z0.displayName},54636:function(e,t,a){a.d(t,{G:function(){return n}});var l=a(67294);function n(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{leading:!1},[n,r]=(0,l.useState)(e),s=(0,l.useRef)(null),i=(0,l.useRef)(!0),d=()=>window.clearTimeout(s.current);return(0,l.useEffect)(()=>d,[]),[n,(0,l.useCallback)(e=>{d(),i.current&&a.leading?r(e):s.current=window.setTimeout(()=>{i.current=!0,r(e)},t),i.current=!1},[a.leading])]}},54279:function(e,t,a){a.d(t,{a:function(){return n}});var l=a(67294);function n(e,t){var a;let{getInitialValueInEffect:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{getInitialValueInEffect:!0},[r,s]=(0,l.useState)(n?t:"boolean"==typeof a?a:"matchMedia"in window&&window.matchMedia(e).matches),i=(0,l.useRef)();return(0,l.useEffect)(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),s(i.current.matches),function(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch(a){return e.addListener(t),()=>e.removeListener(t)}}(i.current,e=>s(e.matches))},[e]),r}}}]);