1"use strict";(globalThis.webpackChunkreactsaluta=globalThis.webpackChunkreactsaluta||[]).push([[7803],{17803(e,t,s){s.r(t),s.d(t,{default:()=>d});var l=s(72555),r=s(9950),a=s(73878),c=s(53140),i=s(44414);const d=()=>{const{db:e}=(0,a.d4)(e=>e.company.companyInstance,(e,t)=>e===t),{bg_screen:t,screen_text_color:s,alert_color:d,alert_text_color:o}=(0,a.d4)(e=>e.config.colors),[n,x]=(0,r.useState)([]),[m,h]=(0,r.useState)(1),[p,u]=(0,r.useState)(""),[j,g]=(0,r.useState)([]),[b,N]=(0,r.useState)(!1),[f,y]=(0,r.useState)(!1),v=10;let w=!1,D=!1;const C=Math.ceil(n.length/v),k=[];for(let l=1;l<=C;l++)l===m||l<2||l>C-1||l===m-1||l===m+1?k.push({id:l,ellipsis:!1}):l>1&&l<m&&!w?(k.push({id:l,ellipsis:!0}),w=!0):l<C&&l>m&&!D&&(k.push({id:l,ellipsis:!0}),D=!0);(0,r.useEffect)(()=>{F()},[]);const P=()=>{N(!1)},A=()=>{N(!0)},S=()=>{y(!1)},_=()=>{y(!0)},F=()=>{e.collection("forms_peritaje").orderBy("createDate","asc").onSnapshot(e=>{const t=[];e.forEach(e=>{t.push({id:e.id,...e.data(),nameDoctor:e.data().nameDoctor.toUpperCase(),namePatient:e.data().namePatient.toUpperCase()})}),x(t)})},$=(e,t)=>{e.preventDefault();t<=Math.ceil(n.filter(e=>e.rutPatient.includes(p)||e.rutDoctor.includes(p)||e.namePatient.includes(p)||e.nameDoctor.includes(p)).length/v)&&h(t)},I=e=>{try{let t=1e3*e.seconds,s=new Date(t);return"Invalid Date"===s.toLocaleString()?new Date(e).toLocaleString():s.toLocaleString()}catch(t){console.error(t)}};return(0,i.jsxs)("div",{className:"flex justify-center min-h-screen text-center md:items-center bg-gradient-to-r from-saluta-s to-saluta-c",children:[(0,i.jsx)("div",{style:{background:`${t}`,color:`${s}`},className:"w-11/12 h-auto p-3 m-2 rounded-3xl lg:w-10/12 lg:p-10 lg:m-6 md:h-3/4",children:0===n?(0,i.jsx)(l.Fc,{style:{background:`${d}`,color:`${o}`},children:"No hay registros de Usuarios"}):(0,i.jsxs)("div",{className:"w-full overflow-x-auto",children:[(0,i.jsx)("h2",{className:"mb-4 text-5xl text-center text-saluta-p",children:"Listado de Formularios de Peritaje"}),(0,i.jsx)("div",{className:"flex flex-col justify-between mb-4 sm:flex-row",children:(0,i.jsx)("div",{children:(0,i.jsx)("div",{className:"flex items-center bg-white border-2 border-blue-500 rounded-full shadow-xl",children:(0,i.jsx)("input",{className:"w-full px-6 py-2 leading-tight text-gray-700 rounded-l-full rounded-r-full focus:outline-none",id:"search",type:"text",placeholder:"Buscador",value:p,onChange:e=>(e=>{h(1),u(e.target.value.toUpperCase())})(e)})})})}),(0,i.jsxs)("table",{className:"w-full",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{className:"font-semibold tracking-wide text-center text-gray-900 uppercase bg-gray-100 border-b border-gray-600 text-md",children:[(0,i.jsx)("th",{className:"px-4 py-3",children:"Fecha Creaci\xf3n"}),(0,i.jsx)("th",{className:"px-4 py-3",children:"Rut del Doctor"}),(0,i.jsx)("th",{className:"px-4 py-3",children:"Nombres del Doctor"}),(0,i.jsx)("th",{className:"px-4 py-3",children:"Rut del Paciente"}),(0,i.jsx)("th",{className:"px-4 py-3",children:"Nombres del Paciente"}),(0,i.jsx)("th",{className:"px-4 py-3",children:"Aprobado por Doctor"}),(0,i.jsx)("th",{className:"px-4 py-3",children:"Ver/Editar"})]})}),(0,i.jsx)("tbody",{style:{background:`${t}`,color:`${s}`},className:"text-center",children:(()=>{if(0===p.length)return n.slice((m-1)*v,m*v);return n.filter(e=>e.rutPatient.includes(p)||e.rutDoctor.includes(p)||e.namePatient.includes(p)||e.nameDoctor.includes(p)).slice((m-1)*v,m*v)})().map((e,t)=>(0,i.jsxs)("tr",{className:"text-gray-700",children:[(0,i.jsx)("td",{className:"px-4 py-3 text-sm border md:text-lg",children:I(e.createDate.seconds)}),(0,i.jsx)("td",{className:"px-4 py-3 text-sm font-semibold border md:text-lg",children:e.rutDoctor}),(0,i.jsx)("td",{className:"px-4 py-3 border",children:(0,i.jsx)("div",{className:"flex items-center text-sm",children:(0,i.jsx)("div",{children:(0,i.jsx)("p",{className:"text-sm font-semibold text-black md:text-lg",children:e.nameDoctor})})})}),(0,i.jsx)("td",{className:"px-4 py-3 text-sm border md:text-lg",children:e.rutPatient}),(0,i.jsx)("td",{className:"px-4 py-3 text-sm border md:text-lg",children:e.namePatient}),(0,i.jsx)("td",{className:"px-4 py-3 text-sm border md:text-lg",children:e.approved?(0,i.jsx)("span",{className:"font-bold text-green-500",children:"Aprobado por el Doctor"}):(0,i.jsx)("span",{className:"font-bold text-red-500",children:"No ha sido Aprobado/Revisado"})}),(0,i.jsx)("td",{className:"px-4 py-3 border",children:e.approved?(0,i.jsx)("span",{className:"text-blue-300 cursor-pointer hover:text-blue-600",children:(0,i.jsx)("i",{className:"self-center text-sm cursor-pointer right-3 top-1 material-icons-outlined md:text-2xl",onClick:()=>{return(t=e).gradeCompromiseAdditional||(t.gradeCompromiseAdditional=""),g(t),void A();var t},children:"visibility"})}):(0,i.jsx)("span",{className:"text-blue-300 cursor-pointer hover:text-blue-600",children:(0,i.jsx)("i",{className:"self-center text-sm cursor-pointer right-3 top-1 material-icons-outlined md:text-2xl",onClick:()=>{return(t=e).gradeCompromiseAdditional||(t.gradeCompromiseAdditional=""),g(t),void _();var t},children:"edit"})})})]},t))})]}),(0,i.jsx)("div",{className:"py-2",children:(0,i.jsx)("nav",{className:"block",children:(0,i.jsx)("ul",{className:"flex flex-wrap justify-center pl-0 list-none rounded",children:k.map(e=>e.ellipsis?(0,i.jsx)("li",{children:(0,i.jsx)("span",{children:"\u2026"})},e.id):m===e.id?(0,i.jsx)("li",{children:(0,i.jsx)("a",{href:"/#",className:"selected_page",onClick:t=>$(t,e.id),children:e.id})},e.id):(0,i.jsx)("li",{children:(0,i.jsx)("a",{href:"/#",className:"un_selected_page",onClick:t=>$(t,e.id),children:e.id})},e.id))})})})]})}),b&&(0,i.jsxs)(l.aF,{size:"lg",active:b,toggler:A,children:[(0,i.jsx)(l.rQ,{toggler:P,children:"Vista Formulario Per
1itaje"}),(0,i.jsx)(l.cw,{children:(0,i.jsx)(c.A,{closeModal:P,data:j,disabledInput:!0})})]}),f&&(0,i.jsxs)(l.aF,{size:"lg",active:f,toggler:_,children:[(0,i.jsx)(l.rQ,{toggler:S,children:"Aprobar Formulario Peritaje"}),(0,i.jsx)(l.cw,{children:(0,i.jsx)(c.A,{closeModal:S,data:j,disabledInput:!1})})]})]})}}}]);
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.