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/ContactTable-e7b460b8.js

import{m as Q,r as x,G as Y,o as a,h as q,f as w,c as n,t as l,a as e,g as T,k as _,b as u,u as j,K as ee,O as A,q as te,a4 as se,S as oe,w as le,v as ae,n as b,e as y,l as R,F as D,d as W,j as ne}from"./app-43851608.js";import{d as ie}from"./debounce-729b203d.js";import{_ as re}from"./Modal-22a49fae.js";import{t as L}from"./index-17cd980e.js";import{_ as ce}from"./Dropdown-6e7c10b4.js";import{_ as de,a as N}from"./DropdownItem-48d91d39.js";import{P as ue}from"./Pagination-8172d90a.js";const he={key:0,class:"text-sm text-slate-600"},me={key:1,class:"text-sm text-slate-600"},pe={class:"text-sm text-slate-600 underline flex mt-4 mb-6"},fe=["href"],ve={class:"max-w-md w-full gap-y-8"},ge={class:"space-y-6"},we={class:"text-center"},xe=e("svg",{class:"mx-auto h-12 w-12 text-gray-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("g",{fill:"none"},[e("path",{fill:"currentColor",d:"m15.393 4.054l-.502.557l.502-.557Zm3.959 3.563l-.502.557l.502-.557Zm2.302 2.537l-.685.305l.685-.305ZM3.172 20.828l.53-.53l-.53.53Zm17.656 0l-.53-.53l.53.53ZM14 21.25h-4v1.5h4v-1.5ZM2.75 14v-4h-1.5v4h2.5Zm18.5-.437V14h2.5v-.437h-1.5ZM14.891 4.61l3.959 3.563l1.003-1.115l-3.958-3.563l-1.004 1.115Zm7.859 8.952c0-1.689.015-2.758-.41-3.714l-1.371.61c.266.598.281 1.283.281 3.104h2.5Zm-3.9-5.389c1.353 1.218 1.853 1.688 2.119 2.285l1.37-.61c-.426-.957-1.23-1.66-2.486-2.79L18.85 8.174ZM10.03 2.75c1.582 0 2.179.012 2.71.216l.538-1.4c-.852-.328-1.78-.316-3.248-.316v1.5Zm5.865.746c-1.086-.977-1.765-1.604-2.617-1.93l-.537 1.4c.532.204.98.592 2.15 1.645l1.004-1.115ZM10 21.25c-1.907 0-3.261-.002-4.29-.14c-1.005-.135-1.585-.389-2.008-.812l-1.06 1.06c.748.75 1.697 1.081 2.869 1.239c1.15.155 2.625.153 4.489.153v-1.5ZM1.25 14c0 1.864-.002 3.338.153 4.489c.158 1.172.49 2.121 1.238 2.87l1.06-1.06c-.422-.424-.676-1.004-.811-2.01c-.138-1.027-.14-2.382-.14-4.289h-1.5ZM14 22.75c1.864 0 3.338.002 4.489-.153c1.172-.158 2.121-.49 2.87-1.238l-1.06-1.06c-.424.422-1.004.676-2.01.811c-1.027.138-2.382.14-4.289.14v1.5ZM21.25 14c0 1.907-.002 3.262-.14 4.29c-.135 1.005-.389 1.585-.812 2.008l1.06 1.06c.75-.748 1.081-1.697 1.239-2.869c.155-1.15.153-2.625.153-4.489h-1.5Zm-18.5-4c0-1.907.002-3.261.14-4.29c.135-1.005.389-1.585.812-2.008l-1.06-1.06c-.75.748-1.081 1.697-1.239 2.869C1.248 6.661 1.25 8.136 1.25 10h2.5Zm7.28-8.75c-1.875 0-3.356-.002-4.511.153c-1.177.158-2.129.49-2.878 1.238l1.06 1.06c.424-.422 1.005-.676 2.017-.811c1.033-.138 2.395-.14 4.312-.14v-1.5Z"}),e("path",{stroke:"currentColor","stroke-width":"1.5",d:"M13 2.5V5c0 2.357 0 3.536.732 4.268C14.464 10 15.643 10 18 10h4"})])],-1),ye={class:"flex text-sm text-gray-600"},_e={for:"file-upload",class:"relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500"},be={class:"pl-1"},ke={class:"text-xs text-gray-500"},Ce={key:1,class:"flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md"},$e=e("svg",{class:"mx-auto h-12 w-12 text-gray-400",xmlns:"http://www.w3.org/2000/svg",width:"50",height:"50",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"black","stroke-dasharray":"15","stroke-dashoffset":"15","stroke-linecap":"round","stroke-width":"2",d:"M12 3C16.9706 3 21 7.02944 21 12"},[e("animate",{fill:"freeze",attributeName:"stroke-dashoffset",dur:"0.3s",values:"15;0"}),e("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})])],-1),Me=e("div",{class:"text-center mb-2 text-sm text-gray-500"},"Upload In Progress",-1),Se={class:"rounded-md p-1 bg-slate-50 text-center text-sm"},je={class:"mt-4"},Ie={key:0,class:"mt-2"},Ne={key:0,class:"bg-green-50 px-2 py-2 flex rounded-md justify-between items-center mb-1"},Ze={class:"mt-1 text-sm"},Be={class:"text-green-800 flex items-center gap-x-2"},Ve=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 16 16"},[e("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[e("path",{d:"M14.25 8.75c-.5 2.5-2.385 4.854-5.03 5.38A6.25 6.25 0 0 1 3.373 3.798C5.187 1.8 8.25 1.25 10.75 2.25"}),e("path",{d:"m5.75 7.75l2.5 2.5l6-6.5"})])],-1),Oe={key:1,class:"bg-red-50 px-2 py-2 flex rounded-md justify-between items-center mb-1"},De={class:"mt-1 text-sm"},Le={class:"text-red-600 flex items-center gap-x-2"},Te=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M15.71 8.29a1 1 0 0 0-1.42 0L12 10.59l-2.29-2.3a1 1 0 0 0-1.42 1.42l2.3 2.29l-2.3 2.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l2.29-2.3l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L13.41 12l2.3-2.29a1 1 0 0 0 0-1.42m3.36-3.36A10 10 0 1 0 4.93 19.07A10 10 0 1 0 19.07 4.93m-1.41 12.73A8 8 0 1 1 20 12a7.95 7.95 0 0 1-2.34 5.66"})],-1),Ae={key:2,class:"bg-red-50 px-2 py-2 flex rounded-md justify-between items-center mb-1"},Fe={class:"mt-1 text-sm"},Ee={class:"text-red-600 flex items-center gap-x-2"},ze=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M15.71 8.29a1 1 0 0 0-1.42 0L12 10.59l-2.29-2.3a1 1 0 0 0-1.42 1.42l2.3 2.29l-2.3 2.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l2.29-2.3l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L13.41 12l2.3-2.29a1 1 0 0 0 0-1.42m3.36-3.36A10 10 0 1 0 4.93 19.07A10 10 0 1 0 19.07 4.93m-1.41 12.73A8 8 0 1 1 20 12a7.95 7.95 0 0 1-2.34 5.66"})],-1),Ge={key:3,class:"bg-red-50 px-2 py-2 flex rounded-md justify-between items-center mb-1"},Pe={class:"mt-1 text-sm"},Ue={class:"text-red-600 flex items-center gap-x-2"},Je=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M15.71 8.29a1 1 0 0 0-1.42 0L12 10.59l-2.29-2.3a1 1 0 0 0-1.42 1.42l2.3 2.29l-2.3 2.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l2.29-2.3l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L13.41 12l2.3-2.29a1 1 0 0 0 0-1.42m3.36-3.36A10 10 0 1 0 4.93 19.07A10 10 0 1 0 19.07 4.93m-1.41 12.73A8 8 0 1 1 20 12a7.95 7.95 0 0 1-2.34 5.66"})],-1),Xe={key:2,class:"mt-5"},Re={class:"flex justify-center mt-2 w-full"},We={__name:"ContactImportModal",props:["type","modelValue"],emits:["update:modelValue"],setup(h,{emit:Z}){const i=h,p=Z,m=Q(()=>ee().props.flash.status),C=i.type==="contact"?L("Import contacts"):L("Import contact groups"),$=x(i.modelValue),g=x(null),c=x(null);Y(()=>i.modelValue,r=>{$.value=r});const f=r=>{r.preventDefault();const d=r.target.files[0];M(d)},v=r=>{r.preventDefault();const d=r.dataTransfer.files[0];M(d)};function M(r){if(!["text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(r.type)){alert(L("please select a CSV or XLSX file"));return}g.value=r.name;const d=new FormData;d.append("file",r),A.post(i.type==="contact"?"/contacts/import":"/contact-groups/import",d,{forceFormData:!0,onProgress:k=>{c.value="pending"},onSuccess:()=>{c.value="complete"},onError:k=>{c.value=null}})}function B(){$.value=!1,p("update:modelValue",!1),setTimeout(()=>{c.value=null},500)}return(r,d)=>(a(),q(re,{label:j(C),isOpen:$.value},{default:w(()=>[h.type==="contact"?(a(),n("div",he,l(r.$t("Upload a csv/xlsx to import your contact data. For the phone field ensure that you start with the contact's country code.")),1)):(a(),n("div",me,l(r.$t("Upload a csv/xlsx to import your contact groups data.")),1)),e("div",pe,[e("a",{href:h.type==="contact"?"/contacts.xlsx":"/contact-groups.xlsx"},l(r.$t("Click here to download sample template")),9,fe)]),e("div",ve,[e("div",ge,[c.value==null||c.value=="complete"?(a(),n("div",{key:0,onDragover:d[1]||(d[1]=T(()=>{},["prevent"])),onDrop:v,class:"flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md"},[e("input",{type:"file",class:"sr-only",accept:".csv,.xlsx",ref:"fileInput",id:"file-upload",onChange:d[0]||(d[0]=k=>f(k))},null,544),e("div",we,[e("div",null,[xe,e("div",ye,[e("label",_e,[e("span",null,l(r.$t("Click to upload a file")),1)]),e("p",be,l(r.$t("Or drag and drop")),1)]),e("p",ke,l(r.$t("CSV/XLSX files only")),1)])])],32)):(a(),n("div",Ce,[e("div",null,[$e,Me,e("div",Se,l(g.value),1)])])),e("div",je,[c.value=="complete"?(a(),n("div",Ie,[m.value.successfulImports?(a(),n("div",Ne,[e("div",Ze,[e("div",Be,[Ve,_(" "+l(m.value.successfulImports+"/"+m.value.totalImports)+" "+l(r.$t("rows added successfully!")),1)])])])):u("",!0),m.value.failedNames?(a(),n("div",Oe,[e("div",De,[e("div",Le,[Te,_(" "+l(m.value.failedNames)+" rows without first name ",1)])])])):u("",!0),m.value.failedDuplicates?(a(),n("div",Ae,[e("div",Fe,[e("div",Ee,[ze,_(" "+l(m.value.failedDuplicates)+" duplicates found ",1)])])])):u("",!0),m.value.failedFormats?(a(),n("div",Ge,[e("div",Pe,[e("div",Ue,[Je,_(" "+l(m.value.failedFormats)+" formatting issues found ",1)])])])):u("",!0)])):u("",!0)])])]),c.value==null||c.value=="complete"?(a(),n("div",Xe,[e("div",Re,[e("button",{type:"button",onClick:d[2]||(d[2]=k=>B()),class:"w-full inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white hover:text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"},l(r.$t("Close")),1)])])):u("",!0)]),_:1},8,["label","isOpen"]))}},qe={class:"px-4 pb-2"},Ke={class:"border border-[#f0f2f5] rounded-md mt-6 flex items-center py-[2px] md:py-[2px]"},He=e("span",{class:"pl-3 py-2"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[e("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),Qe=["placeholder"],Ye=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("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),et=[Ye],tt={key:1,class:"pr-2"},st=ne('<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),ot=[st],lt={class:"flex justify-between px-4 border-b"},at={class:"flex items-center space-x-2"},nt={key:0,class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},it=e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),rt=[it],ct={key:0},dt={key:1},ut={class:"float-right"},ht=e("button",{class:"inline-flex w-full justify-center rounded-md text-sm font-medium text-black hbg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"},[e("span",{class:"hover:shadow-md bg-slate-50 rounded-full w-[fit-content] p-2"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},[e("path",{fill:"black",d:"M8 2.5a1.22 1.22 0 0 1 1.25 1.17A1.21 1.21 0 0 1 8 4.84a1.21 1.21 0 0 1-1.25-1.17A1.22 1.22 0 0 1 8 2.5m0 8.66a1.17 1.17 0 1 1-1.25 1.17A1.21 1.21 0 0 1 8 11.16m0-4.33a1.17 1.17 0 1 1 0 2.34a1.17 1.17 0 1 1 0-2.34"})])])],-1),mt=["href"],pt={class:"h-[5vh]"},ft={class:"flex justify-between text-sm border-b"},vt={class:"flex-grow overflow-y-auto h-[65vh]",ref:"scrollContainer"},gt=["onClick"],wt=["onClick"],xt={key:0,class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},yt=e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),_t=[yt],bt={class:"w-[15%]"},kt=["src"],Ct={key:1,class:"rounded-full bg-secondary/10 text-secondary flex justify-center items-center h-12 w-12"},$t={class:"w-[75%]"},Mt={class:"text-slate-500 text-xs truncate"},St={class:"w-[10%]"},jt={key:0,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},It=e("path",{fill:"#FFD700",d:"M9.153 5.408C10.42 3.136 11.053 2 12 2c.947 0 1.58 1.136 2.847 3.408l.328.588c.36.646.54.969.82 1.182c.28.213.63.292 1.33.45l.636.144c2.46.557 3.689.835 3.982 1.776c.292.94-.546 1.921-2.223 3.882l-.434.507c-.476.557-.715.836-.822 1.18c-.107.345-.071.717.001 1.46l.066.677c.253 2.617.38 3.925-.386 4.506c-.766.582-1.918.051-4.22-1.009l-.597-.274c-.654-.302-.981-.452-1.328-.452c-.347 0-.674.15-1.328.452l-.596.274c-2.303 1.06-3.455 1.59-4.22 1.01c-.767-.582-.64-1.89-.387-4.507l.066-.676c.072-.744.108-1.116 0-1.46c-.106-.345-.345-.624-.821-1.18l-.434-.508c-1.677-1.96-2.515-2.941-2.223-3.882c.293-.941 1.523-1.22 3.983-1.776l.636-.144c.699-.158 1.048-.237 1.329-.45c.28-.213.46-.536.82-1.182z"},null,-1),Nt=[It],Zt=["onClick"],Bt=["onClick"],Vt={key:0,class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Ot=e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),Dt=[Ot],Lt={class:"w-[15%]"},Tt={class:"rounded-full bg-secondary/10 text-secondary flex justify-center items-center h-12 w-12 capitalize"},At={class:"w-[85%] flex items-center"},Ft={class:"px-4 pb-4"},Rt={__name:"ContactTable",props:["rows","filters","type"],emits:["callback"],setup(h,{emit:Z}){var U,J,X;const i=h,p=x({id:(U=i.filters)==null?void 0:U.id,search:(J=i.filters)==null?void 0:J.search,page:(X=i.filters)==null?void 0:X.page}),m=x(!1),C=x(!1),$=Z,g=x(!1),c=x(0),f=x([]),v=x([]);function M(s){p.value.id=s;const o=Object.fromEntries(Object.entries(p.value).filter(([t,S])=>S!==null));$("callback",o)}const B=()=>{p.value.search=null,d()},r=ie(()=>{p.value.page=null,C.value=!0,d()},1e3),d=()=>{const s=Object.fromEntries(Object.entries(p.value).filter(([o,t])=>t!==null));A.visit(i.type==="contact"?"/contacts":"/contact-groups",{method:"get",data:s})};function k(){i.type==="contact"?localStorage.setItem("checkedContacts",JSON.stringify(f.value)):localStorage.setItem("checkedGroups",JSON.stringify(v.value))}function K(){if(i.type==="contact"){const s=localStorage.getItem("checkedContacts");f.value=s?JSON.parse(s):[]}else{const s=localStorage.getItem("checkedGroups");v.value=s?JSON.parse(s):[]}}function F(s,o){if(i.type==="contact"){const t=f.value.indexOf(s);o&&t===-1?f.value.push(s):!o&&t!==-1&&f.value.splice(t,1)}else{const t=v.value.indexOf(s);o&&t===-1?v.value.push(s):!o&&t!==-1&&v.value.splice(t,1)}k()}function E(s){const o=i.rows.data.find(t=>t.uuid===s);o.isChecked=!o.isChecked,F(s,o.isChecked),G(),O()}function z(){g.value=!g.value,i.rows.data.forEach(s=>{s.isChecked=g.value,F(s.uuid,g.value)}),O()}function V(){i.rows.data.forEach(s=>{s.isChecked=i.type==="contact"?f.value.includes(s.uuid):v.value.includes(s.uuid)}),G(),O()}function G(){g.value=i.rows.data.length>0&&i.rows.data.every(s=>s.isChecked)}function O(){c.value=i.type==="contact"?f.value.length:v.value.length}function P(s){const o=i.type==="contact"?f.value:v.value;A.visit(i.type==="contact"?"/contacts":"/contact-groups",{method:"delete",data:{uuids:s==="all"?[]:o},preserveState:!0,onSuccess:()=>{localStorage.removeItem(i.type==="contact"?"checkedContacts":"checkedGroups"),i.type==="contact"?f.value=[]:v.value=[]}})}return te(()=>{K(),V()}),se(()=>{V()}),oe(()=>{var s;p.value.page=(s=i.filters)==null?void 0:s.page,V()}),(s,o)=>(a(),n(D,null,[e("div",qe,[e("div",Ke,[He,le(e("input",{onInput:o[0]||(o[0]=(...t)=>j(r)&&j(r)(...t)),"onUpdate:modelValue":o[1]||(o[1]=t=>p.value.search=t),type:"text",class:"w-full outline-none rounded-xl py-2 pl-2 mr-2 text-sm",placeholder:h.type==="contact"?s.$t("Search name or phone or email"):s.$t("Search name")},null,40,Qe),[[ae,p.value.search]]),C.value===!1&&p.value.search?(a(),n("button",{key:0,onClick:B,type:"button",class:"pr-2"},et)):u("",!0),C.value?(a(),n("span",tt,ot)):u("",!0)])]),e("div",lt,[e("div",at,[e("label",{onClick:o[2]||(o[2]=t=>z()),for:"myCheckbox",class:"cursor-pointer"},[e("div",{class:b(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center",{"bg-secondary":g.value}])},[g.value?(a(),n("svg",nt,rt)):u("",!0)],2)]),e("label",{onClick:o[3]||(o[3]=t=>z()),class:"cursor-pointer text-sm"},[c.value==0?(a(),n("span",ct,l(s.$t("Select all"))+" ("+l(c.value)+")",1)):c.value>0?(a(),n("span",dt,l(c.value)+" "+l(s.$t("selected")),1)):u("",!0)])]),e("div",null,[e("div",ut,[y(ce,{align:"right",class:"mt-2"},{items:w(()=>[y(de,null,{default:w(()=>[y(N,{as:"button",onClick:o[4]||(o[4]=t=>m.value=!0)},{default:w(()=>[_(l(s.$t("Import rows")),1)]),_:1}),y(N,{as:"button"},{default:w(()=>[e("a",{href:h.type==="contact"?"/contacts/export":"/contact-groups/export",class:"w-full h-full"},l(s.$t("Export to xlsx")),9,mt)]),_:1}),c.value>0?(a(),q(N,{key:0,as:"button",onClick:o[5]||(o[5]=t=>P())},{default:w(()=>[_(l(s.$t("Delete selected")),1)]),_:1})):u("",!0),y(N,{as:"button",onClick:o[6]||(o[6]=t=>P("all"))},{default:w(()=>[_(l(s.$t("Delete all")),1)]),_:1})]),_:1})]),default:w(()=>[ht]),_:1})])])]),e("div",pt,[e("div",ft,[y(j(R),{href:"/contacts",class:b(["pt-3 w-1/2 text-center pb-1 hover:bg-slate-50",{"bg-gray-50 border-b-2 border-slate-700":s.$page.url.startsWith("/contacts")}])},{default:w(()=>[_(l(s.$t("All contacts")),1)]),_:1},8,["class"]),y(j(R),{href:"/contact-groups",class:b(["pt-3 w-1/2 text-center pb-1 hover:bg-slate-50",{"bg-gray-50 border-b-2 border-slate-700":s.$page.url.startsWith("/contact-groups")}])},{default:w(()=>[_(l(s.$t("Groups")),1)]),_:1},8,["class"])])]),e("div",vt,[h.type==="contact"?(a(!0),n(D,{key:0},W(h.rows.data,(t,S)=>{var I;return a(),n("div",{onClick:H=>M(t.uuid),class:b(["flex space-x-2 hover:bg-gray-50 cursor-pointer px-4 py-3 border-b",t.isChecked?"bg-gray-50":""]),key:S},[e("div",null,[e("label",{onClick:T(H=>E(t.uuid),["stop"]),for:"myCheckbox",class:"cursor-pointer"},[e("div",{class:b(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center mt-1",{"bg-secondary":t.isChecked}])},[t.isChecked?(a(),n("svg",xt,_t)):u("",!0)],2)],8,wt)]),e("div",bt,[t.avatar?(a(),n("img",{key:0,class:"rounded-full h-12 w-12",src:t.avatar},null,8,kt)):(a(),n("div",Ct,l((I=t.first_name)==null?void 0:I.substring(0,1)),1))]),e("div",$t,[e("h3",null,l(t==null?void 0:t.full_name),1),e("p",Mt,l(t.formatted_phone_number),1)]),e("div",St,[t.is_favorite?(a(),n("svg",jt,Nt)):u("",!0)])],10,gt)}),128)):h.type==="group"?(a(!0),n(D,{key:1},W(h.rows.data,(t,S)=>(a(),n("div",{onClick:I=>M(t.uuid),class:b(["flex space-x-2 hover:bg-gray-50 cursor-pointer px-4 py-3 border-b",t.isChecked?"bg-gray-50":""]),key:S},[e("div",null,[e("label",{onClick:T(I=>E(t.uuid),["stop"]),for:"myCheckbox",class:"cursor-pointer"},[e("div",{class:b(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center mt-1",{"bg-secondary":t.isChecked}])},[t.isChecked?(a(),n("svg",Vt,Dt)):u("",!0)],2)],8,Bt)]),e("div",Lt,[e("div",Tt,l(t.name.substring(0,1)),1)]),e("div",At,[e("h3",null,l(t.name),1)])],10,Zt))),128)):u("",!0)],512),e("div",Ft,[y(ue,{class:"mt-3",pagination:h.rows.meta},null,8,["pagination"])]),y(We,{type:h.type,modelValue:m.value,"onUpdate:modelValue":o[7]||(o[7]=t=>m.value=t)},null,8,["type","modelValue"])],64))}};export{We as _,Rt as a};