| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Index-95353645.js |
import O from"./App-ad5f7ecb.js";import{T as I,r as g,O as L,o as b,c as k,a as l,w as H,v as U,u as $,b as S,e,f as t,k as r,t as s,F as B,d as Z,h as R,n as z,i as E,j as P,x as q}from"./app-43851608.js";import{d as G}from"./debounce-729b203d.js";import{_ as J}from"./AlertModal-1a288ce3.js";import{u as K}from"./useAlertModal-27d09708.js";import{_ as Q}from"./Table-69702a89.js";import{T as W,a as X,_ as w}from"./TableHeaderRowItem-459897e8.js";import{T as Y,a as ee,_ as h}from"./TableBodyRowItem-110be769.js";import{_ as te}from"./Dropdown-6e7c10b4.js";import{_ as ae,a as F}from"./DropdownItem-48d91d39.js";import{_ as le}from"./FormModalModified-5e65e3b9.js";import{t as p}from"./index-17cd980e.js";import"./Sidebar-7bb6d772.js";import"./Menu-4221d61f.js";import"./ProfileModal-628e5b7c.js";import"./FormInput-4a309017.js";import"./LangToggle-8d05b0dc.js";import"./MobileSidebar-b73cd192.js";import"./index-99011d5f.js";/* empty css */import"./_baseGetTag-2e10a2d1.js";import"./Pagination-8172d90a.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./use-text-value-242aa4d7.js";import"./use-tree-walker-7c9f6f67.js";import"./Modal-22a49fae.js";import"./FormImage-5b2df4ab.js";import"./FormSelect-2d73589a.js";import"./ChevronUpDownIcon-8859f144.js";import"./FormTextArea-a182534a.js";const oe={class:"md:bg-white flex items-center border border-primary md:border-none md:shadow-sm h-12 md:h-10 w-full md:w-80 rounded-[0.5rem] mb-6 text-xl md:text-sm"},se=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),ie=["placeholder"],ne=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),re=[ne],ue={key:1,class:"pr-2"},me=P('<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),de=[me],ce=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),pe={__name:"TestimonialTable",props:{rows:{type:Array,required:!0},filters:{type:Object}},emits:["edit","delete"],setup(_,{emit:x}){const d=_,{isOpenAlert:f,openAlert:v,confirmAlert:y}=K(),m=x,T=I({test:null});function C(a){m("edit",a)}const N=a=>{T.delete("/admin/testimonials/"+a)},n=a=>a===d.rows.data.length-1,o=g({search:d.filters.search}),u=g(!1),D=()=>{o.value.search=null,M()},V=G(()=>{u.value=!0,M()},1e3),M=()=>{const a=window.location.pathname;L.visit(a,{method:"get",data:o.value})};return(a,c)=>(b(),k(B,null,[l("div",oe,[se,H(l("input",{onInput:c[0]||(c[0]=(...i)=>$(V)&&$(V)(...i)),"onUpdate:modelValue":c[1]||(c[1]=i=>o.value.search=i),type:"text",class:"outline-none px-4 w-full",placeholder:a.$t("Search reviews")},null,40,ie),[[U,o.value.search]]),u.value===!1&&o.value.search?(b(),k("button",{key:0,onClick:D,type:"button",class:"pr-2"},re)):S("",!0),u.value?(b(),k("span",ue,de)):S("",!0)]),e(Q,{rows:_.rows},{default:t(()=>[e(W,null,{default:t(()=>[e(X,null,{default:t(()=>[e(w,{position:"first"},{default:t(()=>[r(s(a.$t("Name")),1)]),_:1}),e(w,null,{default:t(()=>[r(s(a.$t("Position")),1)]),_:1}),e(w,null,{default:t(()=>[r(s(a.$t("Rating")),1)]),_:1}),e(w,null,{default:t(()=>[r(s(a.$t("Status")),1)]),_:1}),e(w,null,{default:t(()=>[r(s(a.$t("Last updated")),1)]),_:1}),e(w,{position:"last"})]),_:1})]),_:1}),e(Y,null,{default:t(()=>[(b(!0),k(B,null,Z(_.rows.data,(i,A)=>(b(),R(ee,{key:A,class:z(n(A)?"":"border-b")},{default:t(()=>[e(h,{position:"first"},{default:t(()=>[r(s(i.name),1)]),_:2},1024),e(h,null,{default:t(()=>[r(s(i.position),1)]),_:2},1024),e(h,null,{default:t(()=>[r(s(i.rating)+" "+s(a.$t("Stars")),1)]),_:2},1024),e(h,{class:"hidden sm:table-cell"},{default:t(()=>[r(s(i.status===1?a.$t("Displayed"):a.$t("Hidden")),1)]),_:2},1024),e(h,{class:"hidden sm:table-cell"},{default:t(()=>[r(s(i.updated_at),1)]),_:2},1024),e(h,{position:"last"},{default:t(()=>[e(te,{align:"right",class:"mt-2"},{items:t(()=>[e(ae,null,{default:t(()=>[e(F,{as:"button",onClick:j=>C(i.id)},{default:t(()=>[r(s(a.$t("View/edit")),1)]),_:2},1032,["onClick"]),e(F,{as:"button",onClick:j=>$(v)(i.id)},{default:t(()=>[r(s(a.$t("Delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),default:t(()=>[ce]),_:2},1024)]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:1})]),_:1},8,["rows"]),e(J,{modelValue:$(f),"onUpdate:modelValue":c[2]||(c[2]=i=>E(f)?f.value=i:null),onConfirm:c[3]||(c[3]=()=>$(y)(N)),label:a.$t("Delete row"),description:a.$t("Are you sure you want to delete this row? This action can not be undone")},null,8,["modelValue","label","description"])],64))}},fe={class:"bg-white md:bg-inherit pt-10 px-4 md:pt-8 md:p-8 rounded-[5px] text-[#000] h-full md:overflow-y-auto"},ve={class:"flex justify-between"},we={class:"text-xl mb-1"},he={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},be=l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[l("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),ge={class:"ml-1 mt-1"},Qe={__name:"Index",props:{title:String,rows:Object,filters:Object},setup(_){const x=_,d=g(!1),f=g(p("Add review")),v=g("/admin/testimonials"),y=g("post"),m={name:null,position:null,rating:null,status:null,review:null},T=(n,o={})=>{f.value=p("Add review"),v.value="/admin/testimonials",y.value="post",n!=null?(f.value=p("Edit review"),v.value="/admin/testimonials/"+n,y.value="put",C()):(m.name=null,m.position=null,m.review=null,m.rating=null,m.status=null,d.value=!0)};function C(){q.get(v.value).then(n=>{const{data:o}=n;for(const u in o.item)m.hasOwnProperty(u)&&(m[u]=o.item[u]);d.value=!0}).catch(n=>{})}const N=[{inputType:"FormInput",name:"name",label:p("name"),type:"text",className:"sm:col-span-6"},{inputType:"FormInput",name:"position",label:p("Position"),type:"text",className:"sm:col-span-6"},{inputType:"FormSelect",name:"rating",label:p("Rating"),options:[{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}],className:"sm:col-span-3"},{inputType:"FormSelect",name:"status",label:p("status"),options:[{value:0,label:"Hide"},{value:1,label:"Display"}],className:"sm:col-span-3"},{inputType:"FormTextArea",name:"review",label:p("Review"),type:"text",className:"sm:col-span-6",textAreaRows:4}];return(n,o)=>(b(),R(O,null,{default:t(()=>[l("div",fe,[l("div",ve,[l("div",null,[l("h1",we,s(n.$t("Reviews")),1),l("p",he,[be,l("span",ge,s(n.$t("View, add, edit or delete reviews")),1)])]),l("div",null,[l("button",{onClick:o[0]||(o[0]=u=>T()),type:"button",class:"rounded-md bg-indigo-600 px-3 py-2 text-sm text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},s(n.$t("Add review")),1)])]),e(pe,{rows:x.rows,filters:x.filters,onEdit:T,onDelete:n.openAlert},null,8,["rows","filters","onDelete"]),e(le,{modelValue:d.value,"onUpdate:modelValue":o[1]||(o[1]=u=>d.value=u),label:f.value,url:v.value,form:m,formInputs:N,formMethod:y.value,onCloseModal:o[2]||(o[2]=u=>d.value=!1)},null,8,["modelValue","label","url","formMethod"])])]),_:1}))}};export{Qe as default};