| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Show-b6453073.js |
import{r as w,T,O as V,o as i,c,a as e,w as L,v as O,u as y,b as _,d as j,t as n,F as M,e as Z,n as S,i as B,g as C,f as $,k as N,l as F,h as D,y as X}from"./app-f1493ab2.js";import K from"./App-bc062293.js";import{d as q}from"./debounce-7f7c0d78.js";import{u as A}from"./useAlertModal-3aa166da.js";import{_ as E}from"./FormTextArea-95511fff.js";import{_ as R}from"./Modal-a0814fa2.js";import"./App-6e8cb8a8.js";import"./Sidebar-b962a0c1.js";import"./Menu-45912eaa.js";import"./ProfileModal-09ae28bb.js";import"./FormInput-b3450213.js";import"./tabs-80627b62.js";import"./hidden-f79cef22.js";import"./micro-task-89dcd6af.js";import"./transition-f32a8133.js";import"./use-outside-click-92c6377f.js";import"./LangToggle-d2b58a25.js";import"./MobileSidebar-5b51f786.js";import"./index-114bea05.js";/* empty css */import"./Sidebar-10203eb5.js";import"./_baseGetTag-f7f93ac1.js";const I={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"},z=["placeholder"],H={key:1,class:"pr-2"},U={class:"grid grid-cols-2 bg-gray-50 px-2 md:border-b-0 border-[#d1d5db] text-sm rounded-tr-[8px] rounded-tl-[8px]"},P={class:"px-2 py-3 max-w-[25em] truncate"},G={class:"px-2 py-3 truncate"},J={class:"grid grid-cols-2 bg-white px-2 hover:bg-slate-50 md:border-b-0 md:border-t border-[#d1d5db] text-sm border-b cursor-pointer"},Q={class:"p-2 flex items-center"},W={class:"max-w-[24em] truncate"},Y={class:"p-2 truncate flex items-center w-full"},ee=["onClick"],te=["onClick"],se={__name:"LangTranslationsTable",props:{rows:{type:Array,required:!0},filters:{type:Object},language:{type:Object}},emits:["edit","delete"],setup(k,{emit:f}){const u=k;A();const p=w(null);T({test:null});const v=w({search:u.filters.search}),x=w(!1),o=()=>{v.value.search=null,l()},s=q(()=>{x.value=!0,l()},1e3),l=()=>{const m=window.location.pathname;V.visit(m,{method:"get",data:v.value})};w(null);const d=T({translation:null}),g=(m,t)=>{p.value=m,d.translation=t},r=async()=>{d.post("/admin/translations/"+u.language.code+"/"+p.value,{preserveScroll:!0,onFinish:()=>{p.value=null}})};return(m,t)=>(i(),c(M,null,[e("div",I,[t[6]||(t[6]=e("span",{class:"pl-3"},[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)),L(e("input",{onInput:t[0]||(t[0]=(...a)=>y(s)&&y(s)(...a)),"onUpdate:modelValue":t[1]||(t[1]=a=>v.value.search=a),type:"text",class:"outline-none px-4 w-full",placeholder:m.$t("Search translation string")},null,40,z),[[O,v.value.search]]),x.value===!1&&v.value.search?(i(),c("button",{key:0,onClick:o,type:"button",class:"pr-2"},t[4]||(t[4]=[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)]))):_("",!0),x.value?(i(),c("span",H,t[5]||(t[5]=[j('<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)]))):_("",!0)]),e("div",U,[e("div",P,n(m.$t("Key")),1),e("div",G,n(m.$t("Translation")),1)]),(i(!0),c(M,null,Z(u.rows,(a,b)=>(i(),c("div",{key:b},[e("div",J,[e("div",Q,[e("div",W,n(a.Key),1)]),e("div",Y,[e("div",{class:S(["float-left truncate",p.value!=a.Key?"max-w-[25em]":"w-full"])},[p.value===a.Key?(i(),B(E,{key:0,modelValue:y(d).translation,"onUpdate:modelValue":t[2]||(t[2]=h=>y(d).translation=h),name:"",showLabel:!1,class:S("w-full")},null,8,["modelValue"])):(i(),c("span",{key:1,onClick:h=>g(a.Key,a.Translation)},n(a.Translation),9,ee))],2),p.value===a.Key?(i(),c("div",{key:0,class:"ml-auto hover:bg-gray-200 p-2 rounded-full",onClick:t[3]||(t[3]=h=>r())},t[7]||(t[7]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",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)]))):(i(),c("div",{key:1,class:"ml-auto hover:bg-gray-200 p-2 rounded-full",onClick:h=>g(a.Key,a.Translation)},t[8]||(t[8]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[e("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[e("path",{d:"M9.533 11.15A1.823 1.823 0 0 0 9 12.438V15h2.578c.483 0 .947-.192 1.289-.534l7.6-7.604a1.822 1.822 0 0 0 0-2.577l-.751-.751a1.822 1.822 0 0 0-2.578 0z"}),e("path",{d:"M21 12c0 4.243 0 6.364-1.318 7.682C18.364 21 16.242 21 12 21c-4.243 0-6.364 0-7.682-1.318C3 18.364 3 16.242 3 12c0-4.243 0-6.364 1.318-7.682C5.636 3 7.758 3 12 3"})])],-1)]),8,te))])])]))),128))],64))}},oe={class:"flex justify-between"},le={class:"text-xl mb-1"},ne={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},ae={class:"ml-1 mt-1"},ie={class:"flex items-center space-x-2"},re={class:"list-decimal ml-4 mt-2 space-y-0 text-sm"},de={class:"mb-0"},ce={class:"text-sm text-slate-600"},ue={class:"text-sm text-slate-600 underline"},me=["href"],pe={class:"text-sm text-slate-600 mt-4 mb-0"},fe={class:"text-sm text-slate-600 mt-4 mb-0"},ge={class:"max-w-md w-full space-y-8"},he={class:"mt-8 space-y-6"},ve={class:"text-center"},we={class:"flex text-sm text-gray-600"},xe={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"},ye={class:"text-xs text-gray-500"},_e={key:0,class:"mt-4"},ke={class:"mt-2 rounded-md bg-[#F5F7FB] px-6"},Ce={class:"flex-1 min-w-0"},$e={class:"text-sm font-medium text-indigo-600 truncate"},Te={class:"mt-1 flex items-center text-sm text-gray-500"},Me={key:0},Se={key:1},Ze={class:"ml-4 flex-shrink-0"},Be={key:0,class:"relative w-48"},Ve={class:"overflow-hidden h-2 text-xs flex rounded bg-indigo-200"},Le={class:"mt-5 grid grid-cols-1 gap-x-6 gap-y-4"},Oe={class:"mt-2 w-full"},st={__name:"Show",props:{language:Object,rows:Object,filters:String},setup(k){const f=k,u=w([]),p=w(!1);T({_method:"put"});const v=o=>{const s=o.target.files;for(let l=0;l<s.length;l++){const d=s[l];if(!["text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(d.type)){alert(trans("please select a CSV or XLSX file"));return}const g=new FormData;g.append("file",d);const r=new XMLHttpRequest,m=document.querySelector('meta[name="csrf-token"]').getAttribute("content");r.upload.addEventListener("progress",t=>{if(t.lengthComputable){const a=Math.round(t.loaded/t.total*100),b=u.value.findIndex(h=>h.name===d.name);u.value[b].progress=a}}),r.open("POST","/admin/languages/"+f.language.code+"/import"),r.setRequestHeader("X-CSRF-TOKEN",m),r.onload=()=>{r.status},r.send(g),u.value.push({name:d.name,progress:0})}},x=o=>{o.preventDefault();const s=o.dataTransfer.files;for(let l=0;l<s.length;l++){const d=s[l];if(!["text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(d.type)){alert(trans("please select a CSV or XLSX file"));return}const g=new FormData;g.append("file",d);const r=new XMLHttpRequest,m=document.querySelector('meta[name="csrf-token"]').getAttribute("content");r.upload.addEventListener("progress",t=>{if(t.lengthComputable){const a=Math.round(t.loaded/t.total*100),b=u.value.findIndex(h=>h.name===d.name);u.value[b].progress=a}}),r.open("POST","/admin/languages/"+f.language.code+"/import"),r.setRequestHeader("X-CSRF-TOKEN",m),r.onload=()=>{r.status},r.send(g),u.value.push({name:d.name,progress:0})}};return(o,s)=>(i(),B(K,null,{default:C(()=>[e("div",oe,[e("div",null,[e("h2",le,n(o.$t("Language translations:"))+" "+n(f.language.name),1),e("p",ne,[s[4]||(s[4]=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[e("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)),e("span",ae,n(o.$t("Translate your language")),1)])]),e("div",ie,[e("button",{onClick:s[0]||(s[0]=l=>p.value=!0),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"},n(o.$t("Bulk edit translations")),1),$(y(F),{href:"/admin/languages",class:"rounded-md bg-black px-3 py-2 text-sm text-white shadow-sm hover:bg-black focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},{default:C(()=>[N(n(o.$t("Back")),1)]),_:1})])]),$(se,{rows:f.rows,filters:f.filters,language:f.language},null,8,["rows","filters","language"]),$(R,{label:o.$t("Bulk Edit"),isOpen:p.value},{default:C(()=>[e("ol",re,[e("li",de,[e("span",ce,n(o.$t("Download .xlsx file with all translation strings.")),1),s[5]||(s[5]=e("br",null,null,-1)),e("span",ue,[e("a",{href:"/admin/languages/"+f.language.code+"/export"},n(o.$t("Click here to download")),9,me)])]),e("li",null,[e("div",pe,n(o.$t("Edit the xlsx file with your own translations")),1)]),e("li",null,[e("div",fe,n(o.$t("Reupload the edited xlsx file below")),1)])]),e("div",ge,[e("div",he,[e("div",{onDragover:s[2]||(s[2]=D(()=>{},["prevent"])),onDrop:x,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:".xslx",ref:"fileInput",id:"file-upload",onChange:s[1]||(s[1]=l=>v(l))},null,544),e("div",ve,[e("div",null,[s[6]||(s[6]=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)),e("div",we,[e("label",xe,[e("span",null,n(o.$t("Click to upload a file")),1)]),e("p",be,n(o.$t("Or drag and drop")),1)]),e("p",ye,n(o.$t("XLSX files only")),1)])])],32),u.value.length?(i(),c("div",_e,[e("ul",ke,[(i(!0),c(M,null,Z(u.value,l=>(i(),c("li",{key:l.name,class:"py-2 flex justify-between items-center"},[e("div",Ce,[e("p",$e,n(l.name),1),e("div",Te,[l.progress!==100?(i(),c("span",Me,n(l.progress)+"% - ",1)):(i(),c("span",Se,n(o.$t("Complete")),1))])]),e("div",Ze,[l.progress!==100?(i(),c("div",Be,[e("div",Ve,[e("div",{style:X({width:`${l.progress}%`}),class:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-indigo-500"},null,4)])])):_("",!0)])]))),128))])])):_("",!0)])]),e("div",Le,[e("div",Oe,[e("button",{type:"button",onClick:s[3]||(s[3]=l=>p.value=!1),class:"inline-flex float-right justify-center rounded-md border border-transparent bg-slate-50 px-4 py-2 text-sm text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"},n(o.$t("Close")),1)])])]),_:1},8,["label","isOpen"])]),_:1}))}};export{st as default};