"use strict";(this.webpackChunk_tsmesolutions_cubes_initiatives=this.webpackChunk_tsmesolutions_cubes_initiatives||[]).push([[1030],{31030:(e,t,a)=>{a.r(t),a.d(t,{default:()=>D});var n=a(24590);const l={id:String,isProgram:Boolean};var o=a(90726),i=a(91123),r=a(19244),s=a(66869),c=a(18799);function d(e,t,a,n,l,o,i){try{var r=e[o](i),s=r.value}catch(e){return void a(e)}r.done?t(s):Promise.resolve(s).then(n,l)}const u={class:"table border table-fixed"},m={class:"align-middle text-white bg-primary"},p={class:"align-middle text-white bg-primary"},g={class:"align-middle text-white bg-primary"},f={class:"align-middle text-white bg-primary"},v={class:"align-middle"},y={class:"align-middle"},k={key:1},h={class:"align-middle"},E={key:0},b={key:1},N={class:"align-middle text-truncate"},V=["title"],B=(0,n.defineComponent)({__name:"audit-log-card-table",props:l,setup(e,t){let{expose:a}=t;const l=e,B=o.IoC.DI().resolve(r.St.AppService.key),D=o.IoC.DI().resolve(r.St.AuditLogService.key),{tGlobal:w,"tAudit-log":C}=(0,n.toRefs)((0,i.useTranslation)(B,[c.N["audit-log"]])),I={uniqueId:"id",searchableKey:"name.en"},_=(0,n.toRef)(l,"id"),S=(0,n.toRef)(l,"isProgram"),x=(0,n.toRef)(!1),P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var t,a=(t=function*(t,a){try{e[S.value?"programId":"initiativeId"]=_.value,e.limit=o.MAX_INTEGER;const a=yield D[S.value?"listProgramCardsAsync":"listCardsAsync"](e),n=a.data,l=a.pagination;x.value=n.length>0,t({data:n,pagination:l})}catch(e){B.error(e?.info?.message?.title,e?.info?.message?.body,(0,o.uid)(),2e3),a(e)}},function(){var e=this,a=arguments;return new Promise(function(n,l){var o=t.apply(e,a);function i(e){d(o,n,l,i,r,"next",e)}function r(e){d(o,n,l,i,r,"throw",e)}i(void 0)})});return function(e,t){return a.apply(this,arguments)}}())};return a({audits:x}),(e,t)=>{const a=(0,n.resolveComponent)("v-date"),l=(0,n.resolveComponent)("app-cubes-user"),i=(0,n.resolveComponent)("app-data-view");return _.value?((0,n.openBlock)(),(0,n.createBlock)(i,{"fetch-options":P,"initial-offset":0,"key-mapper":I,paginated:"","pagination-type":"loadMore",key:_.value},{items:(0,n.withCtx)(e=>{let{items:t}=e;return[(0,n.createElementVNode)("table",u,[(0,n.createElementVNode)("thead",null,[(0,n.createElementVNode)("tr",null,[(0,n.createElementVNode)("th",m,(0,n.toDisplayString)((0,n.unref)(C).labels.action),1),(0,n.createElementVNode)("th",p,(0,n.toDisplayString)((0,n.unref)(C).labels.actionDate),1),(0,n.createElementVNode)("th",g,(0,n.toDisplayString)((0,n.unref)(C).labels.user),1),(0,n.createElementVNode)("th",f,(0,n.toDisplayString)((0,n.unref)(C).labels.remarks),1)])]),(0,n.createElementVNode)("tbody",null,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(t,e=>((0,n.openBlock)(),(0,n.createElementBlock)("tr",{key:e.id},[(0,n.createElementVNode)("td",v,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)((0,n.unref)(w).enums.OperationTypeEnum[e.operation]),1)]),(0,n.createElementVNode)("td",y,[e.actionDateUtc?((0,n.openBlock)(),(0,n.createBlock)(a,{key:0,date:e.actionDateUtc,format:"D"},null,8,["date"])):((0,n.openBlock)(),(0,n.createElementBlock)("span",k,"-"))]),(0,n.createElementVNode)("td",h,[e.userId!=(0,n.unref)(o.EMPTY_GUID)?((0,n.openBlock)(),(0,n.createElementBlock)("span",E,[(0,n.createVNode)(l,{id:e.userId,"show-title":"",formatter:(0,n.unref)(s.s),class:"text-truncate"},null,8,["id","formatter"])])):((0,n.openBlock)(),(0,n.createElementBlock)("span",b,"-"))]),(0,n.createElementVNode)("td",N,[(0,n.createElementVNode)("span",{title:e.auditMessage??"-"},(0,n.toDisplayString)(e.auditMessage??"-"),9,V)])]))),128))])])]}),_:1})):(0,n.createCommentVNode)("v-if",!0)}}}),D=B},66869:(e,t,a)=>{a.d(t,{s:()=>l});var n=a(90726);const l=e=>e?e.id!=n.EMPTY_GUID?`${e.name}`:"-":"..."}}]);
//# sourceMappingURL=473c0ced42d984e2a8f0.js.map