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/General-78bdc36d.js

import{r as g,T as A,h as N,f as U,o as u,a as e,g as j,t as l,k as C,e as d,u as s,n as m,c as p,w as T,v as O,b as D}from"./app-43851608.js";import F from"./Layout-5f40bc5f.js";import{_ as h}from"./FormInput-4a309017.js";import{_}from"./FormSelect-2d73589a.js";import"./index-99011d5f.js";/* empty css              */import{_ as H}from"./FormToggleSwitch-1780efa4.js";import"./index-17cd980e.js";import"./App-26099fac.js";import"./Sidebar-13bbdf6e.js";import"./Menu-7a7609fd.js";import"./Modal-22a49fae.js";import"./ProfileModal-628e5b7c.js";import"./LangToggle-8d05b0dc.js";import"./MobileSidebar-64958b6d.js";import"./use-text-value-242aa4d7.js";import"./ChevronUpDownIcon-8859f144.js";const P={class:"md:h-[90vh]"},E={class:"flex justify-center items-center mb-8"},J={class:"bg-white border border-slate-200 rounded-lg py-2 text-sm mb-4 pb-2"},G={class:"flex px-4 pt-2 pb-4"},q={class:"text-[17px]"},I={class:"flex items-center mt-1"},K=e("svg",{class:"mr-2",xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",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),L={class:"flex space-x-10 border-b w-full px-4 py-6"},Q={class:"w-[40%]"},R={class:"text-slate-600"},W={class:"text-xs text-slate-700 flex items-center"},X=e("svg",{class:"mr-1",xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",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),Y={class:"w-[60%]"},ee={class:"flex space-x-10 w-full px-4 py-6"},te={class:"w-[40%]"},se={class:"text-slate-600"},oe={class:"text-xs text-slate-700 flex items-center"},ne=e("svg",{class:"mr-1",xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",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),ie={class:"w-[60%] grid grid-cols-4 gap-x-4 gap-y-4"},le={class:"bg-white border border-slate-200 rounded-lg py-2 text-sm mb-4"},ae={class:"flex items-center px-4 pt-2 pb-4"},re={class:"w-[60%]"},de={class:"text-[17px]"},me={class:"flex items-center mt-1"},ue={class:"w-[40%] ml-auto"},pe={class:"bg-white border border-slate-200 rounded-lg py-2 text-sm pb-4 mb-4"},ce={class:"px-4 pt-2 pb-4"},he={class:"text-[17px]"},ve={class:"flex items-center mt-1"},we=e("svg",{class:"mr-2",xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",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),ge={class:"w-[40%]"},_e={class:"text-slate-600"},fe={class:"text-xs text-slate-700 flex items-center"},xe=e("svg",{class:"mr-1",xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",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),ye={class:"w-[60%]"},be={key:0,class:"flex space-x-10 w-full px-4 py-6"},ke={class:"w-[60%]"},Ve={class:"text-slate-600"},$e={class:"text-xs text-slate-700 flex items-center"},ze=e("svg",{class:"mr-1",xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",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),Ce={class:"w-[40%] grid grid-cols-4 items-center gap-x-4 gap-y-4"},Ze={class:"col-span-4 flex gap-x-2"},Me=e("g",{fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M3.5 13.857v-3.714a2 2 0 0 1 2-2h2.9a1 1 0 0 0 .55-.165l6-3.956a1 1 0 0 1 1.55.835v14.286a1 1 0 0 1-1.55.835l-6-3.956a1 1 0 0 0-.55-.165H5.5a2 2 0 0 1-2-2Z"}),e("path",{"stroke-linecap":"round",d:"M20.5 15V9"})],-1),Be=[Me],Se=e("g",{fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18 14l2-2m2-2l-2 2m0 0l-2-2m2 2l2 2"}),e("path",{d:"M2 13.857v-3.714a2 2 0 0 1 2-2h2.9a1 1 0 0 0 .55-.165l6-3.956a1 1 0 0 1 1.55.835v14.286a1 1 0 0 1-1.55.835l-6-3.956a1 1 0 0 0-.55-.165H4a2 2 0 0 1-2-2Z"})],-1),Ae=[Se],Ne=e("g",{fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M1 13.857v-3.714a2 2 0 0 1 2-2h2.9a1 1 0 0 0 .55-.165l6-3.956a1 1 0 0 1 1.55.835v14.286a1 1 0 0 1-1.55.835l-6-3.956a1 1 0 0 0-.55-.165H3a2 2 0 0 1-2-2Z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.5 7.5S19 9 19 11.5s-1.5 4-1.5 4m3-11S23 7 23 11.5s-2.5 7-2.5 7"})],-1),Ue=[Ne],je={class:"bg-white border border-slate-200 rounded-lg py-2 text-sm pb-4 mb-20"},Te={class:"flex px-4 pt-1 pb-2"},Oe={class:"ml-auto"},De=["disabled"],Fe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},He=e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),Pe=e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1),Ee=[He,Pe],Je={key:1},at={__name:"General",props:{settings:Object,timezones:Array,organization:Array,countries:Array,sounds:Array},setup(Z){var y,b,k,V,$,z;const r=Z;g(!1);const f=g(r.settings.metadata),a=g(f.value?JSON.parse(f.value):null),v=g(null),x=()=>{t.volume>0&&(t.volume=Math.max(0,parseFloat(t.volume)-.1),w(t.tone))},M=()=>{t.volume<1&&(t.volume=Math.min(1,parseFloat(t.volume)+.1),w(t.tone))},B=i=>{w(i)},w=i=>{v.value.src=i,v.value.volume=t.volume,v.value.play()},c=(i,o)=>{if(i){const n=JSON.parse(i);return(n==null?void 0:n[o])??null}else return null},t=A({organization_name:(y=r.settings)==null?void 0:y.name,address:c((b=r.settings)==null?void 0:b.address,"street"),city:c((k=r.settings)==null?void 0:k.address,"city"),state:c((V=r.settings)==null?void 0:V.address,"state"),zip:c(($=r.settings)==null?void 0:$.address,"zip"),country:c((z=r.settings)==null?void 0:z.address,"country"),timezone:a.value&&a.value.timezone?a.value.timezone:"UTC",enable_sound_notification:a.value&&a.value.notifications?a.value.notifications.enable_sound:!1,volume:a.value&&a.value.notifications?a.value.notifications.volume:1,tone:a.value&&a.value.notifications?a.value.notifications.tone:null}),S=()=>{t.put("./profile/organization",{preserveScroll:!0})};return(i,o)=>(u(),N(F,null,{default:U(()=>[e("div",P,[e("div",E,[e("form",{onSubmit:o[14]||(o[14]=j(n=>S(),["prevent"])),class:"md:w-[60em]"},[e("div",J,[e("div",G,[e("div",null,[e("h2",q,l(i.$t("Organization details")),1),e("span",I,[K,C(" "+l(i.$t("Update your organization settings")),1)])])]),e("div",L,[e("div",Q,[e("span",R,l(i.$t("Organization name")),1),e("div",W,[X,e("span",null,l(i.$t("Specify the name of your business/organization")),1)])]),e("div",Y,[d(h,{modelValue:s(t).organization_name,"onUpdate:modelValue":o[0]||(o[0]=n=>s(t).organization_name=n),error:s(t).errors.organization_name,name:"",type:"text",class:m("col-span-4")},null,8,["modelValue","error"])])]),e("div",ee,[e("div",te,[e("span",se,l(i.$t("Address details")),1),e("div",oe,[ne,e("span",null,l(i.$t("Specify your physical business address")),1)])]),e("div",ie,[d(h,{modelValue:s(t).address,"onUpdate:modelValue":o[1]||(o[1]=n=>s(t).address=n),error:s(t).errors.address,name:i.$t("Physical address"),type:"text",class:m("col-span-4")},null,8,["modelValue","error","name"]),d(h,{modelValue:s(t).city,"onUpdate:modelValue":o[2]||(o[2]=n=>s(t).city=n),error:s(t).errors.city,name:i.$t("City"),type:"text",class:m("col-span-2")},null,8,["modelValue","error","name"]),d(h,{modelValue:s(t).state,"onUpdate:modelValue":o[3]||(o[3]=n=>s(t).state=n),error:s(t).errors.state,name:i.$t("State"),type:"text",class:m("col-span-2")},null,8,["modelValue","error","name"]),d(h,{modelValue:s(t).zip,"onUpdate:modelValue":o[4]||(o[4]=n=>s(t).zip=n),error:s(t).errors.zip,name:i.$t("Zip code"),type:"text",class:m("col-span-2")},null,8,["modelValue","error","name"]),d(_,{modelValue:s(t).country,"onUpdate:modelValue":o[5]||(o[5]=n=>s(t).country=n),name:i.$t("Country"),type:"text",optionClassName:"h-40",options:r.countries,error:s(t).errors.country,class:m("col-span-2")},null,8,["modelValue","name","options","error"])])])]),e("div",le,[e("div",ae,[e("div",re,[e("h2",de,l(i.$t("Timezone")),1),e("span",me,l(i.$t("All your data will be processed according to this timezone")),1)]),e("div",ue,[d(_,{modelValue:s(t).timezone,"onUpdate:modelValue":o[6]||(o[6]=n=>s(t).timezone=n),name:"",type:"text",options:r.timezones,error:s(t).errors.timezone,class:m("col-span-2")},null,8,["modelValue","options","error"])])])]),e("div",pe,[e("div",ce,[e("h2",he,l(i.$t("Notifications")),1),e("span",ve,[we,C(" "+l(i.$t("Configure notification settings for new message alerts")),1)])]),e("div",{class:m(["flex space-x-10 w-full px-4 py-6",s(t).enable_sound_notification===!1?"":"border-b"])},[e("div",ge,[e("span",_e,l(i.$t("Enable notification sound")),1),e("div",fe,[xe,e("span",null,l(i.$t("Specify the name of your business/organization")),1)])]),e("div",ye,[d(H,{modelValue:s(t).enable_sound_notification,"onUpdate:modelValue":o[7]||(o[7]=n=>s(t).enable_sound_notification=n)},null,8,["modelValue"])])],2),s(t).enable_sound_notification===!0?(u(),p("div",be,[e("div",ke,[e("span",Ve,l(i.$t("New chat sound")),1),e("div",$e,[ze,e("span",null,l(i.$t("Notification sound for every new message")),1)])]),e("div",Ce,[d(_,{modelValue:s(t).tone,"onUpdate:modelValue":[o[8]||(o[8]=n=>s(t).tone=n),B],name:"",type:"text",optionClassName:"h-32",options:r.sounds,error:s(t).errors.tone,class:m("col-span-4")},null,8,["modelValue","options","error"]),e("div",Ze,[s(t).volume>0?(u(),p("svg",{key:0,onClick:o[9]||(o[9]=n=>x()),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Be)):(u(),p("svg",{key:1,onClick:o[10]||(o[10]=n=>x()),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Ae)),T(e("input",{type:"range",class:"w-full","onUpdate:modelValue":o[11]||(o[11]=n=>s(t).volume=n),onChange:o[12]||(o[12]=n=>w(s(t).tone)),id:"volume-slider",min:"0",max:"1",step:"0.01"},null,544),[[O,s(t).volume]]),(u(),p("svg",{onClick:o[13]||(o[13]=n=>M()),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Ue))]),e("audio",{ref_key:"audioPlayer",ref:v},null,512)])])):D("",!0)]),e("div",je,[e("div",Te,[e("div",Oe,[e("button",{type:"submit",class:"float-right rounded-md bg-primary px-3 py-2 text-sm text-white shadow-sm hover:shadow-md hover:bg-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",disabled:s(t).processing},[s(t).processing?(u(),p("svg",Fe,Ee)):(u(),p("span",Je,l(i.$t("Save")),1))],8,De)])])])],32)])])]),_:1}))}};export{at as default};