1import{_ as C}from"./DwJ4LcSp.js";import{_ as I}from"./CFsPlVkh.js";import{_ as L}from"./Ctoq1wgv.js";import{_ as P}from"./B1tavSRN.js";import{_ as E,o as d,b as c,w as e,d as s,e as o,V as u,h as T,M as $,N as R,O as y,j as h,Q as n,R as r,be as b,aH as g,aF as V,K as k,E as N,aE as z,bp as S,b9 as B,f as D,bK as M,bL as O,bM as F,bt as j,bu as U,bP as A,av as q,dk as H,c as K,ay as Q,u as G}from"./DDDL0Jn_.js";import{V as W}from"./uC3_2SY7.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"8d1006f63956406f81992318d8812f4374ba5f92"};var a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="10cede71-7d15-4657-b4c7-4a9cdafce3fa",t._sentryDebugIdIdentifier="sentry-dbid-10cede71-7d15-4657-b4c7-4a9cdafce3fa")}catch{}})();const Y={name:"Appointments",props:{appointments:{type:Array,required:!0},showLoad:{type:Boolean,required:!0}},data(){return{dialog:!1,statusList:[{id:"attended",name:"Atendida",color:"success"},{id:"cancelled",name:"Cancelada",color:"error"},{id:"inProgress",name:"En proceso",color:"info"}],itemDelete:{}}},methods:{trackOpenDetail(t){this.$analytics?.track?.(N.appointment_list_open_detail,{appointment_status:t.status,route_type:t.saveParent?.config?.setOnlyAppointments?"standalone":"module"})},getRoute(t){let a="";return t.saveParent.config.setOnlyAppointments?a="/expediente/appointments/"+t.id+"?moduleId="+t.module+"&submoduleId="+t.submodule+"&procedureId="+t.slugRequest:a=`/expediente/module/${t.module}/${t.submodule}/${t.id_reference}?t=${t.saveParent.submoduleName}&procedureId=${t.slugRequest}`,a},formatDate(t){if(t!=null){const a=Date.parse(t);return isNaN(a)?k(new Date((t.seconds||t._seconds)*1e3),"dd/MM/yyyy"):(t=new Date(t),k(new Date(t),"dd/MM/yyyy"))}},formatHour(t){const a=t.split(":");return`${a[0]}:${a[1]}`}}},J={class:"d-inline-block"},X={class:"pt-1 d-inline-block text-title"},Z={class:"text-subtitle-2 text-lg-subtitle-1 font-weight-bold"},tt={class:"body-2"},et={class:"ml-1 font-weight-medium"},st={class:"body-2"},at={class:"ml-1 font-weight-medium"},lt={class:"d-flex align-center body-2"},it={class:"text-center py-5"};function nt(t,a,_,p,l,f){const w=L,x=P;return d(),c(u,{class:"px-1 mt-5"},{default:e(()=>[s(o,{cols:"12"},{default:e(()=>[_.appointments&&_.appointments.length>0?(d(),c(u,{key:0,align:"center",class:"d-flex flex-row justify-left"},{default:e(()=>[(d(!0),T($,null,R(_.appointments,(m,i)=>(d(),c(o,{key:`${i}-appointment`,cols:"12"},{default:e(()=>[s(y,{id:"appointment-card-"+i,"data-pw":"appt-card-"+i,class:"pa-4 rounded-lg"},{default:e(()=>[s(u,{class:"justify-left d-flex pt-2 pt-sm-5 pb-5",style:{"min-height":"60px"}},{default:e(()=>[s(o,{cols:"2",sm:"1",class:"d-flex justify-center"},{default:e(()=>[h("div",J,[s(w,{fill:"rgb(var(--v-theme-icon))",width:"40px",height:"40px"})])]),_:1}),s(o,{cols:"10",sm:"9",class:""},{default:e(()=>[h("div",X,[h("h4",Z,n(m.title),1)]),s(u,{class:"mt-1"},{default:e(()=>[s(o,{cols:"12",sm:"3",class:"py-1"},{default:e(()=>[h("div",tt,[r(n(t.$t("folio"))+": ",1),h("span",et,n(m.folio),1)])]),_:2},1024),s(o,{cols:"12",sm:"4",class:"py-1"},{default:e(()=>[h("div",st,[r(n(t.$t("appointments.dayOfAppointment"))+": ",1),h("span",at,n(f.formatDate(m.dateStart))+" "+n(f.formatHour(m.startTime)),1)])]),_:2},1024),s(o,{cols:"12",sm:"4",class:"py-1"},{default:e(()=>[h("div",lt,[r(n(t.$t("status"))+": ",1),m.status==="attended"?(d(),c(b,{key:0,id:"status-attended-chip-"+i,"data-pw":"appt-status-chip-"+i,class:"ml-1",color:"success",size:"x-small"},{default:e(()=>[r(n(t.$t("appointments.attended")),1)]),_:1},8,["id","data-pw"])):m.status==="rescheduled"?(d(),c(b,{key:1,id:"status-rescheduled-chip-"+i,"data-pw":"appt-status-chip-"+i,class:"ml-1",color:"warning",size:"x-small"},{default:e(()=>[r(n(t.$t("appointments.rescheduled")),1)]),_:1},8,["id","data-pw"])):m.status==="cancelled"?(d(),c(b,{key:2,id:"status-cancelled-chip-"+i,"data-pw":"appt-status-chip-"+i,class:"ml-1",color:"error",size:"x-small"},{default:e(()=>[r(n(t.$t("appointments.cancelled")),1)]),_:1}
1,8,["id","data-pw"])):m.status==="inProgress"?(d(),c(b,{key:3,id:"status-in-progress-chip-"+i,"data-pw":"appt-status-chip-"+i,class:"ml-1",color:"info",size:"x-small"},{default:e(()=>[r(n(t.$t("appointments.inProgress")),1)]),_:1},8,["id","data-pw"])):(d(),c(b,{key:4,id:"status-default-chip-"+i,"data-pw":"appt-status-chip-"+i,class:"ml-1",color:"info",size:"x-small"},{default:e(()=>[r(n(m.statusDocument),1)]),_:2},1032,["id","data-pw"]))])]),_:2},1024)]),_:2},1024)]),_:2},1024),s(o,{cols:"12",sm:"1",md:"1",class:"d-flex align-center mt-4 mt-md-0"},{default:e(()=>[s(u,null,{default:e(()=>[s(o,{cols:"12",class:"py-1"},{default:e(()=>[s(g,{id:"view-appointment-btn-"+i,"data-pw":"appt-view-btn-"+i,color:"btnPrimary",icon:"",variant:"text",to:f.getRoute(m),onClick:v=>f.trackOpenDetail(m)},{default:e(()=>[s(x,{fill:"rgb(var(--v-theme-btnPrimary))",width:"24px",height:"24px"})]),_:1},8,["id","data-pw","to","onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["id","data-pw"])]),_:2},1024))),128))]),_:1})):(d(),c(u,{key:1,id:"no-appointments-message","data-pw":"appt-empty-state",class:"py-4"},{default:e(()=>[s(o,{cols:"12",class:"text-center"},{default:e(()=>[s(y,null,{default:e(()=>[s(V,null,{default:e(()=>[r(n(t.$t("noData")),1)]),_:1})]),_:1})]),_:1})]),_:1})),h("div",it,[s(g,{id:"show-more-appointments-btn","data-pw":"appt-show-more-btn",class:"mt-5",variant:"outlined",color:"btnPrimary",disabled:_.showLoad===!1,onClick:a[0]||(a[0]=m=>t.$emit("load"))},{default:e(()=>[r(n(t.$t("showMore")),1)]),_:1},8,["disabled"])])]),_:1})]),_:1})}const ot=Object.assign(E(Y,[["render",nt],["__scopeId","data-v-7d4e441a"]]),{__name:"AppointmentsExpedienteApptStatusList"}),dt={name:"Portacitas",data(){return{tab:null,search:null,loading:!0,itemsAppointment:[],listNames:[],filtrar:!1,totalLoadItems:5,showTotal:!0,showLoad:!0,state:"init",lastVisible:null,firstVisible:null,items:[],listStatus:[{id:"attended",name:"Atendida",color:"#63C656"},{id:"cancelled",name:"Cancelada",color:"#EA5757"},{id:"inProgress",name:"En proceso",color:"#717171"},{id:"rescheduled",name:"Reprogramada",color:"#F2AC5B"}],dates:[],dateRangeText:null,filtering:!1,filters:{searchDates:null,searchDateStart:"",searchDateEnd:"",searchStatus:""}}},computed:{user(){return G().getUser},settings(){return Q().setting}},async mounted(){this.loading=!0,await this.initialize(),this.loading=!1},methods:{async initialize(){await this.getAppointments()},async getAppointments(){const t=this;this.loading=!0;
1const a=[{field:"user.uid",op:"==",value:t.user.uid}];q(this.search,"[appointments:app]")&&a.push({field:"title",op:"==",value:this.search}),this.filters.searchStatus&&this.filters.searchStatus.length>0&&a.push({field:"status",op:"in",value:this.filters.searchStatus}),this.filters.searchDateStart&&this.filters.searchDateStart!=null&&a.push({field:"createdAt",op:">=",value:this.filters.searchDateStart}),this.filters.searchDateEnd&&this.filters.searchDateEnd!=null&&a.push({field:"createdAt",op:"<=",value:this.filters.searchDateEnd});const _={orderByField:"createdAt",orderDirection:"desc",limitCount:this.totalLoadItems};this.state==="init"&&this.lastVisible?_.endBeforeDoc=this.lastVisible:this.state==="next"&&this.lastVisible&&(_.startAfterDoc=this.lastVisible);try{const p=await H("appointments",a,_);this.firstVisible=p.docs[0],this.lastVisible=p.docs[p.docs.length-1],p.docs.length<this.totalLoadItems||p.docs.length===0?this.showLoad=!1:this.showLoad=!0,p.forEach(function(l){t.itemsAppointment.push({...l.data(),id:l.id})}),t.loading=!1}catch(p){console.error("Error getting documents: ",p),K(p)}},load(){this.state="next",this.getAppointments()},async reset(){this.filtering&&this.$refs.form.reset(),this.showLoad=!0,this.search=null,this.lastVisible=null,this.firstVisible=null,this.state="init",this.itemsAppointment=[],this.filtrar=!1,this.dates=null,this.filters.searchDateEnd=null,this.filters.searchDateStart=null,this.loading=!0,await this.getAppointments(),this.loading=!1},async filter(){this.lastVisible=null,this.firstVisible=null,this.state="init",this.itemsAppointment=[],this.loading=!0,await this.getAppointments(),this.loading=!1},showFilters(){this.filtering=!this.filtering},getDate(){if(this.dateRangeText=null,this.filters.searchDateStart=null,this.filters.searchDateEnd=null,this.filters.searchDates=!1,Array.isArray(this.dates)&&this.dates.length>0){const t=[...this.dates].sort((l,f)=>new Date(l)-new Date(f)),a=l=>new Date(l).toISOString().split("T")[0];this.dateRangeText=t.map(a).join(" ~ ");const _=new Date(t[0]);_.setHours(0,0,0,0),this.filters.searchDateStart=A(_);const p=new Date(t[t.length-1]);p.setHours(23,59,59,999),this.filters.searchDateEnd=A(p)}}}},rt={class:"text-h5 text-md-h5 text-lg-h5 text-xl-h5 font-weight-bold text-title","data-pw":"appt-list-title"},ct={class:"d-flex"},ut={class:"d-flex justify-end pa-2"};function pt(t,a,_,p,l,f){const w=C,x=I,m=ot;return d(),c(u,{class:"pa-3 mb-5"},{default:e(()=>[s(y,{elevation:"3",class:"px-5 rounded-lg",width:"100%","min-height":"calc(100vh - 150px)"},{default:e(()=>[s(V,{class:"px-0"},{default:e(()=>[l.loading?(d(),c(u,{key:0,class:"pa-2 pa-md-5"},{default:e(()=>[s(w)]),_:1})):(d(),c(u,{key:1,class:"pa-2 pa-md-5"},{default:e(()=>[s(o,{cols:"12",class:"pb-3"},{default:e(()=>[h("h2",rt,n(t.$t("myAppointments")),1)]),_:1}),s(o,{cols:"12"},{default:e(()=>[s(z)]),_:1})]),_:1})),l.loading?D("",!0):(d(),c(u,{key:2,class:"px-1 px-3 px-sm-4 px-md-5 px-lg-8"},{default:e(()=>[s(y,{class:"elevation-0",style:{"box-shadow":"none !important"},"background-color":"transparent",width:"100%"},{default:e(()=>[l.tab!=="certificados"?(d(),c(u,{key:0,class:"px-1"},{default:e(()=>[s(o,{cols:"12",class:""},{default:e(()=>[s(u,{class:"pt-5 pb-3",align:"center"},{default:e(()=>[s(o,{cols:"9",sm:"11",md:"11",lg:"11",class:"pr-0"},{default:e(()=>[h("div",ct,[s(S,{modelValue:l.search,"onUpdate:modelValue":a[0]||(a[0]=i=>l.search=i),maxlength:"200","data-pw":"appt-list-search",variant:"outlined",density:"compact","hide-details":"",rounded:"s e-0",label:t.$t("searchName"),class:"flex-grow-1"},null,8,["modelValue","label"]),s(g,{"data-pw":"appt-list-search-btn",variant:"flat",height:"40",color:"btnPrimary",rounded:"s-0 e",onClick:a[1]||(a[1]=i=>{l.filtrar=!0,f.filter()})},{default:e(()=>[r(n(t.$t("search")),1)]),_:1})])]),_:1}),s(o,{cols:"3",sm:"1",md:"1",lg:"1",class:"text-left"},{default:e(()=>[s(g,{color:"btnSecondary",block:"",variant:"outlined",class:"px-2",size:"x-small",height:"40px",onClick:f.showFilters},{default:e(()=>[s(B,null,{default:e(()=>[...a[7]||(a[7]=[r("mdi-tune",-1)])]),_:1})]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})):D("",!0),l.filtering?(d(),c(u,{key:1,class:"mb-6 px-3 pt-0"},{default:e(()=>[s(o,{cols:"12",class:"py-0"},{default:e(()=>[s(u,null,{default:e(()=>[s(y,{elevation:"0",style:{"box-shadow":"none !important"},variant:"outlined",width:"100%"},{default:e(()=>[s(V,null,{default:e(()=>[s(M,{ref:"form",onSubmit:O(f.filter,["prevent"])},{default:e(()=>[s(u,{align:"end"},{default:e(()=>[s(o,{cols:"12",sm:"4",md:"3"},{default:e(()=>[h("label",null,n(t.$t("status")),1),s(F,{modelValue:l.filters.searchStatus,"onUpdate:modelValue":a[2]||(a[2]=i=>l.filters.searchStatus=i),"auto-select-first":"",clearable:"",density:"compact","hide-details":"",multiple:"",label:"",items:l.listStatus,"item-title":"name","
1item-value":"id"},null,8,["modelValue","items"])]),_:1}),s(o,{cols:"12",sm:"4",md:"3",class:"pl-sm-0"},{default:e(()=>[h("label",null,n(t.$t("datesTitle")),1),s(j,{modelValue:l.filters.searchDates,"onUpdate:modelValue":a[6]||(a[6]=i=>l.filters.searchDates=i),"close-on-content-click":!1,transition:"scale-transition","min-width":"auto"},{activator:e(({props:i})=>[s(S,U({modelValue:l.dateRangeText,"onUpdate:modelValue":a[3]||(a[3]=v=>l.dateRangeText=v),"hide-details":"",label:t.$t("dates"),readonly:""},i,{density:"compact"}),null,16,["modelValue","label"])]),default:e(()=>[s(W,{modelValue:l.dates,"onUpdate:modelValue":a[4]||(a[4]=i=>l.dates=i),multiple:"range","show-header":"false"},null,8,["modelValue"]),h("div",ut,[s(g,{variant:"text",color:"btnSecondary",onClick:a[5]||(a[5]=i=>l.filters.searchDates=!1)},{default:e(()=>[r(n(t.$t("cancel")),1)]),_:1}),s(g,{variant:"text",color:"btnPrimary",onClick:f.getDate},{default:e(()=>[r(n(t.$t("ok")),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue"])]),_:1}),s(o,{cols:"12",sm:"4",md:"3",style:{"border-radius":"4px 0px 0px 4px"},class:"text-left"},{default:e(()=>[s(g,{color:"btnPrimary",type:"submit",class:"px-2",style:{"border-radius":"4px 4px 4px 4px"},size:"x-small",height:"40px"},{default:e(()=>[r(n(t.$t("search")),1)]),_:1}),s(g,{color:"btnSecondary",variant:"outlined",class:"px-2",size:"x-small",height:"40px",onClick:f.reset},{default:e(()=>[s(x,{fill:"rgb(var(--v-theme-btnSecondary))",width:"22px",height:"22px"})]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["onSubmit"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):D("",!0),s(m,{appointments:l.itemsAppointment,"show-load":l.showLoad,onLoad:f.load},null,8,["appointments","show-load","onLoad"])]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})}const yt=E(dt,[["render",pt],["__scopeId","data-v-4318a98c"]]);export{yt as default};
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.