| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/General-b21e92fb.js |
import{r as g,T as N,i as U,g as j,o as u,a as e,h as A,t as l,k as C,f as d,u as o,n as m,c as p,w as T,v as O,b as D}from"./app-f1493ab2.js";import F from"./Layout-fcdad30a.js";import{_ as c}from"./FormInput-b3450213.js";import{_ as f}from"./FormSelect-3a6ffebd.js";import"./index-114bea05.js";/* empty css */import{_ as H}from"./FormToggleSwitch-9b3ff72b.js";import"./index-764662c4.js";import"./App-45dbd9fa.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"./tabs-80627b62.js";import"./LangToggle-d2b58a25.js";import"./MobileSidebar-e6661e49.js";import"./pusher-a82d1614.js";import"./use-text-value-ecd8c541.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={class:"flex space-x-10 border-b w-full px-4 py-6"},L={class:"w-[40%]"},Q={class:"text-slate-600"},R={class:"text-xs text-slate-700 flex items-center"},W={class:"w-[60%]"},X={class:"flex space-x-10 w-full px-4 py-6"},Y={class:"w-[40%]"},ee={class:"text-slate-600"},te={class:"text-xs text-slate-700 flex items-center"},se={class:"w-[60%] grid grid-cols-4 gap-x-4 gap-y-4"},oe={class:"bg-white border border-slate-200 rounded-lg py-2 text-sm mb-4"},ne={class:"flex items-center px-4 pt-2 pb-4"},ie={class:"w-[60%]"},le={class:"text-[17px]"},re={class:"flex items-center mt-1"},ae={class:"w-[40%] ml-auto"},de={class:"bg-white border border-slate-200 rounded-lg py-2 text-sm pb-4 mb-4"},me={class:"px-4 pt-2 pb-4"},ue={class:"text-[17px]"},pe={class:"flex items-center mt-1"},ve={class:"w-[40%]"},ce={class:"text-slate-600"},he={class:"text-xs text-slate-700 flex items-center"},we={class:"w-[60%]"},ge={key:0,class:"flex space-x-10 w-full px-4 py-6"},fe={class:"w-[60%]"},xe={class:"text-slate-600"},ye={class:"text-xs text-slate-700 flex items-center"},be={class:"w-[40%] grid grid-cols-4 items-center gap-x-4 gap-y-4"},ke={class:"col-span-4 flex gap-x-2"},_e={class:"bg-white border border-slate-200 rounded-lg py-2 text-sm pb-4 mb-20"},Ve={class:"flex px-4 pt-1 pb-2"},$e={class:"ml-auto"},ze=["disabled"],Ce={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},Ze={key:1},We={__name:"General",props:["settings","timezones","modules","organization","countries","sounds"],setup(Z){var b,k,_,V,$,z;const a=Z;g(!1);const x=g(a.settings.metadata),r=g(x.value?JSON.parse(x.value):null),h=g(null),y=()=>{s.volume>0&&(s.volume=Math.max(0,parseFloat(s.volume)-.1),w(s.tone))},M=()=>{s.volume<1&&(s.volume=Math.min(1,parseFloat(s.volume)+.1),w(s.tone))},B=i=>{w(i)},w=i=>{h.value.src=i,h.value.volume=s.volume,h.value.play()},v=(i,t)=>{if(i){const n=JSON.parse(i);return(n==null?void 0:n[t])??null}else return null},s=N({organization_name:(b=a.settings)==null?void 0:b.name,address:v((k=a.settings)==null?void 0:k.address,"street"),city:v((_=a.settings)==null?void 0:_.address,"city"),state:v((V=a.settings)==null?void 0:V.address,"state"),zip:v(($=a.settings)==null?void 0:$.address,"zip"),country:v((z=a.settings)==null?void 0:z.address,"country"),timezone:r.value&&r.value.timezone?r.value.timezone:"UTC",enable_sound_notification:r.value&&r.value.notifications?r.value.notifications.enable_sound:!1,volume:r.value&&r.value.notifications?r.value.notifications.volume:1,tone:r.value&&r.value.notifications?r.value.notifications.tone:null}),S=()=>{s.put("./profile/organization",{preserveScroll:!0})};return(i,t)=>(u(),U(F,{modules:a.modules},{default:j(()=>[e("div",P,[e("div",E,[e("form",{onSubmit:t[14]||(t[14]=A(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,[t[15]||(t[15]=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)),C(" "+l(i.$t("Update your organization settings")),1)])])]),e("div",K,[e("div",L,[e("span",Q,l(i.$t("Organization name")),1),e("div",R,[t[16]||(t[16]=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)),e("span",null,l(i.$t("Specify the name of your business/organization")),1)])]),e("div",W,[d(c,{modelValue:o(s).organization_name,"onUpdate:modelValue":t[0]||(t[0]=n=>o(s).organization_name=n),error:o(s).errors.organization_name,name:"",type:"text",class:m("col-span-4")},null,8,["modelValue","error"])])]),e("div",X,[e("div",Y,[e("span",ee,l(i.$t("Address details")),1),e("div",te,[t[17]||(t[17]=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)),e("span",null,l(i.$t("Specify your physical business address")),1)])]),e("div",se,[d(c,{modelValue:o(s).address,"onUpdate:modelValue":t[1]||(t[1]=n=>o(s).address=n),error:o(s).errors.address,name:i.$t("Physical address"),type:"text",class:m("col-span-4")},null,8,["modelValue","error","name"]),d(c,{modelValue:o(s).city,"onUpdate:modelValue":t[2]||(t[2]=n=>o(s).city=n),error:o(s).errors.city,name:i.$t("City"),type:"text",class:m("col-span-2")},null,8,["modelValue","error","name"]),d(c,{modelValue:o(s).state,"onUpdate:modelValue":t[3]||(t[3]=n=>o(s).state=n),error:o(s).errors.state,name:i.$t("State"),type:"text",class:m("col-span-2")},null,8,["modelValue","error","name"]),d(c,{modelValue:o(s).zip,"onUpdate:modelValue":t[4]||(t[4]=n=>o(s).zip=n),error:o(s).errors.zip,name:i.$t("Zip code"),type:"text",class:m("col-span-2")},null,8,["modelValue","error","name"]),d(f,{modelValue:o(s).country,"onUpdate:modelValue":t[5]||(t[5]=n=>o(s).country=n),name:i.$t("Country"),type:"text",optionClassName:"h-40",options:a.countries,error:o(s).errors.country,class:m("col-span-2")},null,8,["modelValue","name","options","error"])])])]),e("div",oe,[e("div",ne,[e("div",ie,[e("h2",le,l(i.$t("Timezone")),1),e("span",re,l(i.$t("All your data will be processed according to this timezone")),1)]),e("div",ae,[d(f,{modelValue:o(s).timezone,"onUpdate:modelValue":t[6]||(t[6]=n=>o(s).timezone=n),name:"",type:"text",options:a.timezones,error:o(s).errors.timezone,class:m("col-span-2")},null,8,["modelValue","options","error"])])])]),e("div",de,[e("div",me,[e("h2",ue,l(i.$t("Notifications")),1),e("span",pe,[t[18]||(t[18]=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)),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",o(s).enable_sound_notification===!1?"":"border-b"])},[e("div",ve,[e("span",ce,l(i.$t("Enable notification sound")),1),e("div",he,[t[19]||(t[19]=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)),e("span",null,l(i.$t("Specify the name of your business/organization")),1)])]),e("div",we,[d(H,{modelValue:o(s).enable_sound_notification,"onUpdate:modelValue":t[7]||(t[7]=n=>o(s).enable_sound_notification=n)},null,8,["modelValue"])])],2),o(s).enable_sound_notification===!0?(u(),p("div",ge,[e("div",fe,[e("span",xe,l(i.$t("New chat sound")),1),e("div",ye,[t[20]||(t[20]=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)),e("span",null,l(i.$t("Notification sound for every new message")),1)])]),e("div",be,[d(f,{modelValue:o(s).tone,"onUpdate:modelValue":[t[8]||(t[8]=n=>o(s).tone=n),B],name:"",type:"text",optionClassName:"h-32",options:a.sounds,error:o(s).errors.tone,class:m("col-span-4")},null,8,["modelValue","options","error"]),e("div",ke,[o(s).volume>0?(u(),p("svg",{key:0,onClick:t[9]||(t[9]=n=>y()),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},t[21]||(t[21]=[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)]))):(u(),p("svg",{key:1,onClick:t[10]||(t[10]=n=>y()),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},t[22]||(t[22]=[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)]))),T(e("input",{type:"range",class:"w-full","onUpdate:modelValue":t[11]||(t[11]=n=>o(s).volume=n),onChange:t[12]||(t[12]=n=>w(o(s).tone)),id:"volume-slider",min:"0",max:"1",step:"0.01"},null,544),[[O,o(s).volume]]),(u(),p("svg",{onClick:t[13]||(t[13]=n=>M()),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},t[23]||(t[23]=[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)])))]),e("audio",{ref_key:"audioPlayer",ref:h},null,512)])])):D("",!0)]),e("div",_e,[e("div",Ve,[e("div",$e,[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:o(s).processing},[o(s).processing?(u(),p("svg",Ce,t[24]||(t[24]=[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),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)]))):(u(),p("span",Ze,l(i.$t("Save")),1))],8,ze)])])])],32)])])]),_:1},8,["modules"]))}};export{We as default};