File: /var/www/html/public/static/js/hookLocationConfig-legacy-3b794912.js
System.register(["./po-legacy-323aad91.js","./vue-router-legacy-a12307c3.js","./message-legacy-10af7c73.js","./index-legacy-42c17c53.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-1c13cd42.js","./preload-helper-legacy-f8638e03.js","./vue-i18n.runtime.esm-bundler-legacy-720876b1.js","./index-legacy-c9e20962.js","./_commonjsHelpers-legacy-5498c249.js","./utils-legacy-c0023c33.js","./focus-trap-legacy-631b7396.js","./error-legacy-e98f9e58.js"],(function(e,t){"use strict";var a,n,o,i,s,c,r,l,m,d,u,p,g,y,h,f,_;return{setters:[e=>{a=e.getCompanyListWeb,n=e.addCompanyWeb,o=e.getInvoiceConfigWeb,i=e.updateInvoiceConfigWeb,s=e.updateEmailConfigWeb,c=e.sendEmailTestWeb,r=e.getUserInfoWeb,l=e.CreateCompanyUserWeb,m=e.deleteCompanyWeb,d=e.setCompanyDefault},e=>{u=e.d,p=e.u},e=>{g=e.b7},e=>{y=e.o},e=>{h=e.A,f=e.r,_=e.o},null,null,null,null,null,null,null,null],execute:function(){e("useEqu",(function(){const{query:e,params:t}=u(),b=p(),v=h({step:"",invoceGuide:5});u();const k=f(!1),w=f(!0),C=f(null);f({start:0,end:0});const E=f(!1),S=f(!1),j=f(!1),x=f(!1),A=f(""),I=f(""),L=f(""),T=f(""),D=f(""),P=f("");f("");const W=f([]),O=f([]),B=h({}),N=h({}),R=h({tableIndex:0,note:"",during:""}),U=f([{id:1,value:"day",text:"Day",is_Selected:0},{id:2,value:"week",text:"Week",is_Selected:0},{id:3,value:"month",text:"Month",is_Selected:0},{id:4,value:"year",text:"Year",is_Selected:0}]),Y=h({company_name:"",first_name:"",last_name:"",phone:"",email:"",address:"",state:"Ontraio",city:"",hst:"",r_ac:"",rmt_register:"",country:"Canada",postal:"L3S 0E2",company_id:"",number_companyname:"",limit_times:"",time_frequen:""}),q=h({smtp_serverv:"",smtp_port:"",from_email:"",email_password:"",comment:"Attached is the invoice for your therapy session at {Your company name}. Thank you for choosing us for your treatment. If you have any concerns or discomfort, feel free to contact us anytime.",comment1:"Attached is the invoice for your therapy session at {Your company name}. Thank you for choosing us for your treatment. If you have any concerns or discomfort, feel free to contact us anytime.",text:"Please write variables in the position where you need to add a name. company name: {{ company_name }} , company phone number: {{ company_phone }}",checked:!1,is_public:"N",flag:!0,msgCorrect:"",msgError:"",cursorStart:-1,selectionStart:"",selectionEnd:"",booking_desc:"Thanks for booking on {{service_date}}, at{{begin_time}} with therapist {{therapist_name}}. Please complete your health history at the following link before your appointment. Ignore if already done.",booking_desc3:"Thanks for booking on {{service_date}}, at{{begin_time}} with therapist {{therapist_name}}. Please complete your health history at the following link before your appointment. Ignore if already done.",booking_desc1:"Thanks for booking on {{service_date}}, at{{begin_time}} with therapist {{therapist_name}}. Please complete your health history at the following link before your appointment. Ignore if already done.",service_date:"",therapist_name:""});h({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const z=h({}),G=h({}),H=h({}),K=h({}),$=h({}),J=h({}),M=h({}),F=h({qo_item_str:"",name:"",address:"",way:"",shipping:[],itemsDetail:[],trackingNo:"",courier:"",comment:""}),V=h({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),Q=f([{name:"Practice Location",id:1},{name:"Setup",id:2},{name:"Email Config",id:3}]),X=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"Company",prop:"company_name",minWidth:100,hide:({checkList:e})=>!e.includes("Company")},{label:"HST#",prop:"hst",minWidth:100,hide:({checkList:e})=>!e.includes("HST#")},{label:"Name",prop:"first_name",minWidth:100,hide:({checkList:e})=>!e.includes("Name")},{label:"Postal",prop:"postal",minWidth:100,hide:({checkList:e})=>!e.includes("Postal")},{label:"Phone",prop:"phone",minWidth:150,slot:"slotAction",hide:({checkList:e})=>!e.includes("Phone")},{label:"Email",prop:"email",minWidth:120,hide:({checkList:e})=>!e.includes("Email")},{label:"Address",prop:"address",minWidth:120,hide:({checkList:e})=>!e.includes("Address")},{label:"City",prop:"city",minWidth:120,hide:({checkList:e})=>!e.includes("City")},{label:"Province",prop:"state",minWidth:120,hide:({checkList:e})=>!e.includes("Province")},{label:"Available times",prop:"city",minWidth:120,slot:"Availablenumber",hide:({checkList:e})=>!e.includes("Available times")},{label:"User Info",prop:"city",minWidth:190,slot:"UserInfo",hide:({checkList:e})=>!e.includes("User Info")},{label:"Default",prop:"city",minWidth:60,fixed:"right",slot:"Default",hide:({checkList:e})=>!e.includes("Default")},{label:"Action",fixed:"right",width:200,slot:"operation",hide:({checkList:e})=>!e.includes("Action")||6==I.value}],Z=h({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:""});async function ee(){k.value=!0;const{data:e}=await a(Object.assign(B,{searchKey:Z.searchKey,Therapist_id:A.value}));W.value=e.data,k.value=!1}async function te(e){const{data:t}=await m(Object.assign(G,{company_id:e.id}));1==t.code?(ee(),g({type:"success",message:t.msg})):g({type:"error",message:t.msg})}function ae(e){var t=q.comment;t=(t=t.replace(new RegExp("{{company_phone}}","g"),D.value)).replace(new RegExp("{{company_name}}","g"),P.value),q.comment1=t}function ne(e){var t=q.booking_desc;t=(t=(t=t.replace(new RegExp("{{service_date}}","g"),q.service_date)).replace(new RegExp("{{begin_time}}","g"),"14:00")).replace(new RegExp("{{therapist_name}}","g"),q.therapist_name),q.booking_desc1=t}async function oe(e){k.value=!0;const{data:t}=await s(Object.assign(N,{smtp_serverv:q.smtp_serverv,smtp_port:q.smtp_port,from_email:q.from_email,email_password:q.email_password,is_public:q.is_public,message:q.comment,booking_message:q.booking_desc}));1==t.code&&2==e&&g({type:"success",message:t.msg})}async function ie(e){const{data:t}=await d(Object.assign(G,{company_id:e.id}));1==t.code?(ee(),g({type:"success",message:t.msg})):g({type:"error",message:t.msg})}return _((()=>{I.value=localStorage.getItem("type"),ee(),async function(e){const{data:t}=await o(Object.assign(H,{}));1==t.code?(T.value=t.data,O.value=t.data.during_price,q.smtp_serverv=t.data.emailconfig.smtp_serverv,q.smtp_port=t.data.emailconfig.smtp_port,q.from_email=t.data.emailconfig.from_email,q.email_password=t.data.emailconfig.email_password,q.is_public=t.data.emailconfig.is_public,P.value=t.data.companyInfo[0].company_name,D.value=t.data.companyInfo[0].phone,"Y"==t.data.emailconfig.is_public?q.checked=!0:q.checked=!1,t.data.emailconfig.message?(q.comment=t.data.emailconfig.message,ae()):q.comment="Attached is the invoice for your therapy session at  {{company_name}} . Thank you for choosing us for your treatment. If you have any concerns or discomfort, feel free to contact us anytime.",t.data.emailconfig.booking_message?(q.booking_desc=t.data.emailconfig.booking_message,ne()):q.booking_desc=q.booking_desc3):g({type:"error",message:t.msg})}(),3==e.invoceGuide&&(v.step=3),function(){const e=new Date,t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),o=`${t}-${a}-${n}`;q.service_date=o,setTimeout((()=>{ne(q.booking_desc)}),500)}(),async function(){const{data:e}=await r(Object.assign(J,{}));0==e.code?q.therapist_name=e.data.firstName+e.data.lastName:g({type:"error",message:e.msg})}()})),{searchDetail:Z,btnSearchPart:function(){ee()},loading:k,small:x,selectList:["勾选列","Company","HST#","Name","Postal","Phone","Email","Address","City","Province","Available times","User Info","Default","Action"],columns:X,pagination:V,handleSizeChange:function(e){V.pageSize=e,ee()},handleCurrentChange:function(e){V.currentPage=e,ee()},PartList:W,order_date:L,deliverDialog:E,deliverDataArr:F,btnDeliverConfirm:async function(){const{data:e}=await n(Object.assign(z,{data_row:Y}));1==e.code?(ee(),j.value=!1,g({type:"success",message:e.msg})):g({type:"error",message:e.msg})},locationData:Q,itemArr:R,onSituationArr:function(e){R.tableIndex=e},addLocationDialog:j,btnAdd:function(){Object.keys(Y).map((e=>{Y[e]=""})),j.value=!0},locationArr:Y,EditLocation:function(e){Object.keys(e).map((t=>{Y[t]=e[t]})),j.value=!0},btnDellocation:e=>{y.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{te(e)})).catch((()=>{g({type:"info",message:"Canceled"})}))},during_price:O,onUpdate:async function(e){const{data:t}=await i(Object.assign(K,{date_row:T,action:"config",during_price:O}));1==t.code?g({type:"success",message:t.msg}):g({type:"error",message:t.msg})},configData:T,addDuring:function(){S.value=!0},addDuringDialog:S,addDuringConfirm:function(){if(""==R.during)return void g({type:"info",message:"Please Enter During Value"});let e={during:R.during,price:0};O.value.push(e),S.value=!1},EmailConfig:q,onCheckbox:function(e){q.is_public=e?"Y":"N"},onEmailConfig:oe,showEye:function(){if("N"==q.is_public){var e=document.getElementById("ps");w.value?(e.type="text",w.value=!1):(e.type="password",w.value=!0)}},flag:w,onEmailTest:async function(){q.msgCorrect="",q.msgError="",k.value=!0;const{data:e}=await c(Object.assign($,{smtp_serverv:q.smtp_serverv,smtp_port:q.smtp_port,from_email:q.from_email,email_password:q.email_password}));1==e.code?(q.msgCorrect=e.result,q.msgError="",oe(1)):(q.msgError=e.error,q.msgCorrect="")},onRestore1:function(){q.comment="Attached is the invoice for your therapy session at  {{company_name}} . Thank you for choosing us for your treatment. If you have any concerns or discomfort, feel free to contact us anytime.",ae(q.comment)},giveName:function(e){const t=document.getElementById("inputRefId"),a=t.selectionStart,n=t.selectionEnd;setTimeout((()=>{const t=e,o=q.comment.substring(0,a)+t+q.comment.substring(n);q.comment=o,ae()}),500)},onBlur:function(e){},inputRef:C,company_phone:D,company_name:P,displayBraces:function(e){},getComment1:ae,onRestoreBooking:function(){q.booking_desc=q.booking_desc3,ne(q.booking_desc)},giveNameB:function(e){const t=document.getElementById("bookingId"),a=t.selectionStart,n=t.selectionEnd;setTimeout((()=>{const t=e,o=q.booking_desc.substring(0,a)+t+q.booking_desc.substring(n);q.booking_desc=o,ne()}),500)},getCommentB:ne,defaultAdress:e=>{y.confirm("Are you sure you want to set this address as the default value",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{ie(e)})).catch((()=>{g({type:"info",message:"Canceled"})}))},processArr:v,onCancel:function(){v.step=""},onNext:function(){localStorage.setItem("invoceGuide",""),b.push({path:"/crm/yuyue/invoiceConfig",query:{invoceGuide:4}})},LimitTimes:U,btnCreateUser:async function(e){const{data:t}=await l(Object.assign(M,{company_id:e.id}));1==t.code?(ee(),g({type:"success",message:t.msg})):g({type:"error",message:t.msg})},btnCopy:async function(e){let t="Join Key : "+e.join_key+"\nUserId : "+e.sub_user_id+"\nPassword : "+e.sub_user_password;try{await navigator.clipboard.writeText(t),g({type:"success",message:"The text has been copied to the clipboard!"})}catch(a){console.error("copy failed : ",a),g({type:"error",message:"Copy failed, please manually copy"})}},btnPassword:function(e){return CryptoJS.AES.encrypt(e).toString()}}}))}}}));