import{x as l,L as N,o as v,E as m,w as b,k as e,h as s,l as w,Z as J,g as k,W as A,X as F,t as L,J as O,Q as $,A as q,a4 as G,j as M,s as Q,ad as U,ae as W,af as X}from"../assets/post-2433f428.js";import{v as Z}from"../assets/loading-128c1aab.js";import{E as H,a as K,b as Y}from"../assets/table-column-20765d73.js";import{u as P,s as D}from"../assets/formvibes-4c4994e4.js";import"../assets/select-b70937af.js";import"../assets/checkbox-84ab24fd.js";import{_ as ee}from"../assets/header-7033ae65.js";import{V as te}from"../assets/vue-resizable.umd.min-e42f227d.js";/* empty css                      */import"../assets/focus-trap-9b255300.js";const ae={class:"resizable-content"},se={class:"fv-expand-content-wrapper"},ne={class:"fv-expand-content"},oe={__name:"log-expand-data",props:["row","closeExpand"],setup(x){const z=P(),E=l(["lb","l","lt"]),{generalStates:_,size:i}=N(z),r=c=>{const n=c.width,a=c.height;Number(n)<=400?D("fv-sidebar",{width:400,height:n}):D("fv-sidebar",{width:n,height:a}),_.value.size={width:n,height:a}};return(c,n)=>{const a=O;return v(),m(w(te),{class:"fv-side-panel",width:w(i).width,active:E.value,height:"100%",style:{position:"fixed",left:"unset",right:"0","z-index":"99999",cursor:"unset"},"onResize:end":r},{default:b(()=>[e("div",ae,[e("div",se,[s(a,{class:"fv-cursor",size:"20",onClick:x.closeExpand},{default:b(()=>[s(w(J))]),_:1},8,["onClick"]),e("div",ne,[e("dl",null,[(v(!0),k(A,null,F(x.row,(g,C,S)=>(v(),k("div",{class:"fv-expand-row",key:S},[e("dt",null,L(C),1),e("dd",null,[e("span",null,L(g),1)])]))),128))])])])])]),_:1},8,["width","active"])}}},le={class:"fv-content-wrapper"},ie=e("div",{class:"fv-page-title"},[e("h3",null,"Event Log")],-1),re={class:"fv-event-log-wrapper"},ce={class:"fv-table-pagination"},pe={__name:"event-log",setup(x){const z=P(),{pageSizes:E}=N(z),_=l(!1),i=l(10),r=l(1),c=l([]),n=l(0),a=l(""),g=l(!1),C=t=>{i.value=parseInt(t)},S=window.fvGlobalVar?.i18n,I=t=>{r.value=parseInt(t)};$([i,r],()=>{y()}),q(()=>{y()});const R=t=>{try{return typeof JSON.parse(t)=="object"}catch{return!1}},y=async()=>{_.value=!0;const{data:{count:t,data:p}}=await T();n.value=parseInt(t);const o=p.map(d=>{let{description:f,event:h}=d;if(R(d.description)&&h==="edit-data"){const u=JSON.parse(d.description);f=`Entry ID: ${u.entry_id},${S?.field_name}: ${u.field_name}
                ${u.value.prev_value} => ${u.value.next_value}`}return{...d,description:f,event:h}});c.value=o,_.value=!1},T=async()=>{const t=r.value,p=i.value;return await G({action:"fv_event_logs",queryParams:{page:t,pageSize:p}})},j=t=>{a.value=t},B=()=>{a.value=""};return $(a,()=>{a.value?g.value=!0:g.value=!1}),(t,p)=>{const o=H,d=K,f=Y,h=U,u=Z;return v(),m(h,null,{default:b(()=>[e("div",null,[s(ee),e("div",le,[ie,e("div",re,[M((v(),m(d,{data:c.value,onRowClick:j},{default:b(()=>[s(o,{prop:"serial_number",label:"S/N",width:"80"}),s(o,{prop:"user",label:"User",width:"180"}),s(o,{prop:"event",label:"Event",width:"180"}),s(o,{prop:"description",label:"Description"}),s(o,{prop:"export_time_gmt",label:"Time",width:"200"})]),_:1},8,["data"])),[[u,_.value]]),e("div",ce,[s(f,{class:"fv-pagination",layout:"total, sizes, prev, pager, next",total:n.value,"current-page":r.value,"page-sizes":w(E),"page-size":i.value,onSizeChange:C,onCurrentChange:I,background:""},null,8,["total","current-page","page-sizes","page-size"])])])]),g.value?(v(),m(oe,{key:0,row:a.value,closeExpand:B},null,8,["row"])):Q("",!0)])]),_:1})}}};const de=W(),V=X(pe);V.use(de);V.mount("#fv-event-log-wrapper");
//# sourceMappingURL=eventLog.js.map
