| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/FlowsTable-b5be3e36.js |
import{T as M,r as _,O as A,c as f,a as l,w as F,v as j,u,b as C,d as z,f as e,g as t,j as L,F as T,o as d,k as i,t as r,e as O,i as R,n as D}from"./app-f1493ab2.js";import{d as E}from"./debounce-7f7c0d78.js";import{_ as H}from"./AlertModal-2bf70f0d.js";import{u as U}from"./useAlertModal-3aa166da.js";/* empty css */import{T as Z,a as q,_ as m}from"./TableHeaderRowItem-6e9202af.js";import{T as I,_ as c,a as G}from"./TableBodyRowItem-551209f9.js";import{_ as J}from"./Dropdown-c843374c.js";import{_ as K,a as k}from"./DropdownItem-5a13c2ff.js";import"./_baseGetTag-f7f93ac1.js";import"./transition-f32a8133.js";import"./hidden-f79cef22.js";import"./use-outside-click-92c6377f.js";import"./micro-task-89dcd6af.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./use-text-value-ecd8c541.js";import"./use-tree-walker-d52d0c0b.js";const P={class:"bg-slate-100 md:bg-slate-50 flex items-center border border-primary md:border-none md:shadow-sm h-10 w-full md:w-80 rounded-[0.5rem] mb-6 text-sm"},Q=["placeholder"],W={key:1,class:"pr-2"},X={class:"bg-slate-100 md:bg-slate-50 rounded-[0.5rem]"},Y={class:"w-full"},ee={class:"py-1 px-2 bg-gray-50 rounded-[5px] border border-dashed w-[fit-content] text-xs capitalize"},ye={__name:"FlowsTable",props:{rows:{type:Object,required:!0},filters:{type:Object}},emits:["delete"],setup(w,{emit:te}){const g=w,{isOpenAlert:p,openAlert:$,confirmAlert:x}=U(),N=M({test:null}),B=s=>{N.delete("/automation/flows/"+s)},V=s=>s===g.rows.data.length-1,n=_({search:g.filters.search}),b=_(!1),S=()=>{n.value.search=null,v()},h=E(()=>{b.value=!0,v()},1e3),v=()=>{A.visit("/automation/flows",{method:"get",data:n.value})};return(s,a)=>(d(),f(T,null,[l("div",P,[a[6]||(a[6]=l("span",{class:"pl-3"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 15l6 6m-11-4a7 7 0 1 1 0-14a7 7 0 0 1 0 14Z"})])],-1)),F(l("input",{onInput:a[0]||(a[0]=(...o)=>u(h)&&u(h)(...o)),"onUpdate:modelValue":a[1]||(a[1]=o=>n.value.search=o),type:"text",class:"outline-none px-4 w-full bg-slate-100 md:bg-slate-50",placeholder:s.$t("Search by name")},null,40,Q),[[j,n.value.search]]),b.value===!1&&n.value.search?(d(),f("button",{key:0,onClick:S,type:"button",class:"pr-2"},a[4]||(a[4]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10s10-4.5 10-10S17.5 2 12 2zm3.7 12.3c.4.4.4 1 0 1.4c-.4.4-1 .4-1.4 0L12 13.4l-2.3 2.3c-.4.4-1 .4-1.4 0c-.4-.4-.4-1 0-1.4l2.3-2.3l-2.3-2.3c-.4-.4-.4-1 0-1.4c.4-.4 1-.4 1.4 0l2.3 2.3l2.3-2.3c.4-.4 1-.4 1.4 0c.4.4.4 1 0 1.4L13.4 12l2.3 2.3z"})],-1)]))):C("",!0),b.value?(d(),f("span",W,a[5]||(a[5]=[z('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="0 12 12;90 12 12;180 12 12;270 12 12"></animateTransform><animate attributeName="opacity" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" begin="0.2s" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="30 12 12;120 12 12;210 12 12;300 12 12"></animateTransform><animate attributeName="opacity" begin="0.2s" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" begin="0.4s" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="60 12 12;150 12 12;240 12 12;330 12 12"></animateTransform><animate attributeName="opacity" begin="0.4s" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle></svg>',1)]))):C("",!0)]),l("div",X,[l("table",Y,[e(Z,null,{default:t(()=>[e(q,null,{default:t(()=>[e(m,{position:"first"},{default:t(()=>[i(r(s.$t("Name")),1)]),_:1}),e(m,null,{default:t(()=>[i(r(s.$t("Runs")),1)]),_:1}),e(m,null,{default:t(()=>[i(r(s.$t("Status")),1)]),_:1}),e(m,null,{default:t(()=>[i(r(s.$t("Last updated")),1)]),_:1}),e(m,{position:"last"})]),_:1})]),_:1}),e(I,null,{default:t(()=>[(d(!0),f(T,null,O(w.rows.data,(o,y)=>(d(),R(G,{key:y,class:D(V(y)?"":"border-b")},{default:t(()=>[e(c,{position:"first",class:"capitalize"},{default:t(()=>[i(r(o.name),1)]),_:2},1024),e(c,{class:"hidden sm:table-cell"},{default:t(()=>[l("div",ee,r(o.flow_logs_count),1)]),_:2},1024),e(c,{class:"hidden sm:table-cell"},{default:t(()=>[i(r(s.$t(o.status)),1)]),_:2},1024),e(c,{class:"hidden sm:table-cell"},{default:t(()=>[i(r(o.updated_at),1)]),_:2},1024),e(c,{position:"last"},{default:t(()=>[e(J,{align:"right",class:"mt-2"},{items:t(()=>[e(K,null,{default:t(()=>[e(k,{href:"/automation/flows/"+o.uuid},{default:t(()=>[i(r(s.$t("Edit")),1)]),_:2},1032,["href"]),e(k,{as:"button",onClick:ae=>u($)(o.uuid)},{default:t(()=>[i(r(s.$t("Delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),default:t(()=>[a[7]||(a[7]=l("button",{class:"inline-flex w-full justify-center rounded-md text-sm font-medium text-black hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"},[l("span",{class:"hover:bg-[#F6F7F9] hover:rounded-full w-[fit-content] p-2"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M12 16a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2Z"})])])],-1))]),_:2},1024)]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:1})])]),e(H,{modelValue:u(p),"onUpdate:modelValue":a[2]||(a[2]=o=>L(p)?p.value=o:null),onConfirm:a[3]||(a[3]=()=>u(x)(B)),label:s.$t("Delete row"),description:s.$t("Are you sure you want to delete this row? This action can not be undone")},null,8,["modelValue","label","description"])],64))}};export{ye as default};