Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Index-31980ddb.js

import{_ as R}from"./App-45dbd9fa.js";import{T as z,r as T,O as D,o as n,c as u,a,w as H,v as O,u as d,b as v,d as Z,f as t,g as s,k as r,t as i,F as V,e as I,i as B,n as U,l as c,j as q}from"./app-f1493ab2.js";import{d as E}from"./debounce-7f7c0d78.js";import{_ as P}from"./AlertModal-2bf70f0d.js";import{u as Y}from"./useAlertModal-3aa166da.js";import{_ as G}from"./Table-700fbce6.js";import{T as J,a as K,_ as h}from"./TableHeaderRowItem-6e9202af.js";import{T as Q,a as W,_ as g}from"./TableBodyRowItem-551209f9.js";import{_ as X}from"./Dropdown-c843374c.js";import{_ as ee,a as N}from"./DropdownItem-5a13c2ff.js";import"./Sidebar-f2ddcf5a.js";import"./Menu-73c1148a.js";import"./Modal-a0814fa2.js";import"./transition-f32a8133.js";import"./hidden-f79cef22.js";import"./use-outside-click-92c6377f.js";import"./micro-task-89dcd6af.js";import"./ProfileModal-09ae28bb.js";import"./FormInput-b3450213.js";import"./tabs-80627b62.js";import"./LangToggle-d2b58a25.js";import"./index-114bea05.js";import"./MobileSidebar-e6661e49.js";/* empty css              */import"./pusher-a82d1614.js";import"./_baseGetTag-f7f93ac1.js";import"./Pagination-6973c28d.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./use-text-value-ecd8c541.js";import"./use-tree-walker-d52d0c0b.js";const te={class:"bg-[#f0f2f5] md:bg-white flex items-center md:border md:border-primary md:border-none md:shadow-sm h-12 md:h-10 w-full md:w-80 rounded-xl mb-6 text-sm mt-6"},se=["placeholder"],ae={key:1,class:"pr-2"},oe={key:0},le={key:1},ie={class:"bg-slate-200 px-1 py-1 rounded-lg mr-1 hidden md:inline-block"},re={key:0},ne={key:1},de={class:"bg-slate-200 px-1 py-1 rounded-lg mr-1 hidden md:inline-block"},ue={key:0,class:"bg-white rounded-xl"},ce={class:"p-4 py-8"},me={class:"text-center text-lg font-medium mb-4"},fe={class:"flex justify-center"},pe={key:0},he={__name:"CampaignTable",props:{rows:{type:Object,required:!0},filters:{type:Object}},emits:["delete"],setup(m,{emit:b}){const f=m,{isOpenAlert:p,openAlert:M,confirmAlert:j}=Y(),A=z({test:null}),L=o=>{A.delete("/campaigns/"+o)},w=T({search:f.filters.search}),S=o=>o===f.rows.data.length-1,_=T(!1),y=(o,l,e)=>l>0?(o/l*100).toFixed(2)+"%":(o/e*100).toFixed(2)+"%",k=(o,l,e)=>l>0?o+"/"+l:o+"/"+e,F=()=>{w.value.search=null,$()},x=E(()=>{_.value=!0,$()},1e3),$=()=>{D.visit("/campaigns",{method:"get",data:w.value})};return(o,l)=>(n(),u(V,null,[a("div",te,[l[6]||(l[6]=a("span",{class:"pl-3"},[a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[a("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)),H(a("input",{onInput:l[0]||(l[0]=(...e)=>d(x)&&d(x)(...e)),"onUpdate:modelValue":l[1]||(l[1]=e=>w.value.search=e),type:"text",class:"outline-none px-4 w-full bg-inherit",placeholder:o.$t("Search campaigns")},null,40,se),[[O,w.value.search]]),_.value===!1&&w.value.search?(n(),u("button",{key:0,onClick:F,type:"button",class:"pr-2"},l[4]||(l[4]=[a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[a("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)]))):v("",!0),_.value?(n(),u("span",ae,l[5]||(l[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)]))):v("",!0)]),t(G,{rows:m.rows},{default:s(()=>[t(J,null,{default:s(()=>[t(K,null,{default:s(()=>[t(h,{position:"first"},{default:s(()=>[r(i(o.$t("Campaign name")),1)]),_:1}),t(h,{class:"hidden md:table-cell"},{default:s(()=>[r(i(o.$t("Template")),1)]),_:1}),t(h,null,{default:s(()=>[r(i(o.$t("Delivery rate")),1)]),_:1}),t(h,null,{default:s(()=>[r(i(o.$t("Read rate")),1)]),_:1}),t(h,null,{default:s(()=>[r(i(o.$t("Status")),1)]),_:1}),t(h,{position:"last"})]),_:1})]),_:1}),t(Q,null,{default:s(()=>[(n(!0),u(V,null,I(m.rows.data,(e,C)=>(n(),B(W,{key:C,class:U(S(C)?"":"border-b")},{default:s(()=>[t(g,{position:"first"},{default:s(()=>[t(d(c),{href:"/campaigns/"+e.uuid,class:"block w-full"},{default:s(()=>[r(i(e.name),1)]),_:2},1032,["href"])]),_:2},1024),t(g,{class:"hidden md:table-cell"},{default:s(()=>[t(d(c),{href:"/campaigns/"+e.uuid,class:"block w-full"},{default:s(()=>[r(i(e.template.name),1)]),_:2},1032,["href"])]),_:2},1024),t(g,{class:"hidden sm:table-cell"},{default:s(()=>[t(d(c),{href:"/campaigns/"+e.uuid,class:"block w-full"},{default:s(()=>[e.status=="scheduled"?(n(),u("div",oe,i(o.$t("N/A")),1)):(n(),u("div",le,[a("span",ie,i(y(e.delivery_count,e.contacts_count,e.contact_group_count)),1),r(" "+i(k(e.delivery_count,e.contacts_count,e.contact_group_count)),1)]))]),_:2},1032,["href"])]),_:2},1024),t(g,{class:"hidden sm:table-cell"},{default:s(()=>[t(d(c),{href:"/campaigns/"+e.uuid,class:"block w-full"},{default:s(()=>[e.status=="scheduled"?(n(),u("div",re,i(o.$t("N/A")),1)):(n(),u("div",ne,[a("span",de,i(y(e.read_count,e.contacts_count,e.contact_group_count)),1),r(" "+i(k(e.read_count,e.contacts_count,e.contact_group_count)),1)]))]),_:2},1032,["href"])]),_:2},1024),t(g,null,{default:s(()=>[t(d(c),{href:"/campaigns/"+e.uuid,class:"flex items-center w-full capitalize"},{default:s(()=>[r(i(e.status),1)]),_:2},1032,["href"])]),_:2},1024),t(g,{position:"last"},{default:s(()=>[t(X,{align:"right",class:"mt-2"},{items:s(()=>[t(ee,null,{default:s(()=>[t(N,{href:"/campaigns/"+e.uuid},{default:s(()=>[r(i(o.$t("View")),1)]),_:2},1032,["href"]),t(N,{as:"button",onClick:ye=>d(M)(e.uuid)},{default:s(()=>[r(i(o.$t("Delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),default:s(()=>[l[7]||(l[7]=a("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"},[a("span",{class:"hover:bg-[#F6F7F9] hover:rounded-full w-[fit-content] p-2"},[a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[a("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})]),_:1},8,["rows"]),m.rows.data.length==0?(n(),u("div",ue,[a("div",ce,[l[8]||(l[8]=a("div",{class:"flex justify-center mb-4"},[a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"72",height:"72",viewBox:"0 0 256 256"},[a("path",{fill:"currentColor",d:"M216 80h-32V48a16 16 0 0 0-16-16H40a16 16 0 0 0-16 16v128a8 8 0 0 0 13 6.22L72 154v30a16 16 0 0 0 16 16h93.59L219 230.22a8 8 0 0 0 5 1.78a8 8 0 0 0 8-8V96a16 16 0 0 0-16-16M66.55 137.78L40 159.25V48h128v88H71.58a8 8 0 0 0-5.03 1.78M216 207.25l-26.55-21.47a8 8 0 0 0-5-1.78H88v-32h80a16 16 0 0 0 16-16V96h32Z"})])],-1)),a("h3",me,i(o.$t("You don't have any campaigns")),1),a("div",fe,[t(d(c),{href:"/campaigns/create",class:"rounded-md px-3 py-2 text-sm hover:shadow-md text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 bg-primary",disabled:o.isLoading},{default:s(()=>[o.isLoading?v("",!0):(n(),u("span",pe,i(o.$t("Create campaign")),1))]),_:1},8,["disabled"])])])])):v("",!0),t(P,{modelValue:d(p),"onUpdate:modelValue":l[2]||(l[2]=e=>q(p)?p.value=e:null),onConfirm:l[3]||(l[3]=()=>d(j)(L)),label:o.$t("Delete row"),description:o.$t("Are you sure you want to delete this campaign? This action will only delete the campaign; sent messages will not be deleted from the chat history.")},null,8,["modelValue","label","description"])],64))}},ge={class:"bg-white md:bg-inherit pt-0 px-4 md:pt-8 md:p-8 rounded-[5px] text-[#000] overflow-y-scroll capitalize"},we={class:"md:flex justify-between mt-8 md:mt-0 hidden"},ve={class:"text-xl mb-1"},be={class:"mb-6 md:flex items-center text-sm leading-6 text-gray-600 hidden"},_e={class:"ml-1 mt-1"},We={__name:"Index",props:["rows","filters"],setup(m){const b=m;return(f,p)=>(n(),B(R,null,{default:s(()=>[a("div",ge,[a("div",we,[a("div",null,[a("h2",ve,i(f.$t("Campaigns")),1),a("p",be,[p[0]||(p[0]=a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[a("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1)),a("span",_e,i(f.$t("Add campaigns")),1)])]),a("div",null,[t(d(c),{href:"/campaigns/create",class:"rounded-md bg-primary px-3 py-2 text-sm text-white shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 md:block hidden"},{default:s(()=>[r(i(f.$t("Create campaign")),1)]),_:1})])]),t(he,{rows:b.rows,filters:b.filters},null,8,["rows","filters"])])]),_:1}))}};export{We as default};