PageSourceSearch

https://megatix.in.th/_nuxt/BDMC57IO.js

js megatix.in.th collected 2026-10-03 20:25:44 UTC 12,659 bytes, 1 lines download raw bytes

1import{_ as Q}from"./C8tnaNk1.js";import{_ as X}from"./CpsSYeG7.js";import{_ as z,u as W}from"./CQEeuAAr.js";import{_ as G,a as U,o as b,b as a,l as V,r as Z,t as E,d as Y,i as r,H as ee,f as S,u as o,A as H,c as te,g as h,e as N,E as $,w as F,U as J,I as ae,q as oe}from"./B9gSLCn8.js";import{_ as O}from"./qLP1_lRV.js";import{_ as K}from"./D0U-KR8Z.js";import{_ as ne}from"./zMHuWdac.js";import{_ as se}from"./BPqfVcdw.js";import"./DpJQ9SCY.js";const re={name:"MegatixCheckbox",props:{value:Boolean,name:String,label:String,autocomplete:String,required:{type:Boolean,default:!1},form:String,disabled:Boolean,tabIndex:{type:Number,default:1},errorText:String}},le={class:"group flex flex-col"},ie={class:"flex flex-row items-center"},de=["name","id","value","form","disabled","tabindex","checked"],ue=["for"],ce={class:"text-error"};function me(P,k,e,i,v,c){return b(),U("div",le,[a("div",ie,[a("input",{type:"checkbox",name:e.name,id:`${e.name}-input`,class:"checkbox m-1 mr-3 group-focus-within:border-sky",onChange:k[0]||(k[0]=d=>P.$emit("update:value",d.target.checked)),value:e.value,form:e.form,disabled:e.disabled,tabindex:e.disabled?void 0:e.tabIndex,checked:e.value},null,40,de),a("label",{for:`${e.name}-input`,class:"transition-all hover:cursor-pointer hover:text-sky group-focus-within:text-sky"},[V(E(e.label)+" ",1),Z(P.$slots,"default")],8,ue)]),a("p",ce,E(e.errorText),1)])}const pe=G(re,[["render",me]]),fe={class:"rounded-xl border border-neutral-200 bg-white p-5 shadow-sm"},ve={key:0,class:"mt-4"},_e=["value","disabled"],xe={class:"mt-3 text-sm"},he=["disabled"],ge={key:1,class:"mt-4"},ye=["value","disabled"],be={class:"mt-3 text-sm"},we=["disabled"],ke={key:2,class:"mt-3 rounded-lg border border-danger-surface bg-danger-surface p-3 text-sm text-danger"},Ce=Y({__name:"MfaInlineChallenge",props:{code:{},recoveryCode:{},errorText:{},disabled:{type:Boolean}},emits:["update:code","update:recoveryCode","clearError"],setup(P,{emit:k}){const e=P,i=k,v=r("authenticator");function c(p){i("update:code",p),i("clearError")}function d(p){i("update:recoveryCode",p),i("clearError")}function m(p){v.value=p,i(p==="authenticator"?"update:recoveryCode":"update:code",""),i("clearError")}return(p,n)=>(b(),U("div",fe,[n[8]||(n[8]=ee('<div class="flex items-start gap-3" data-v-e58445d0><div class="mt-0.5 text-brand" data-v-e58445d0><svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-e58445d0><path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 10-8 0v4h8z" data-v-e58445d0></path></svg></div><div data-v-e58445d0><h3 class="text-base font-semibold text-ink" data-v-e58445d0>Two-factor authentication required</h3><p class="mt-1 text-sm text-neutral-600" data-v-e58445d0> For your security, please confirm with your authenticator app before we continue. </p></div></div>',1)),o(v)==="authenticator"?(b(),U("div",ve,[n[4]||(n[4]=a("label",{for:"mfa-step-up-totp",class:"mb-1 block text-sm font-medium text-ink"}," 6-digit code ",-1)),n[5]||(n[5]=a("p",{id:"mfa-step-up-totp-hint",class:"mb-1 text-xs text-neutral-500"}," Codes refresh every 30 seconds. If a code fails, wait for the next one. ",-1)),a("input",{id:"mfa-step-up-totp","aria-describedby":"mfa-step-up-totp-hint",value:e.code,type:"text",name:"mfa_code",class:"mfa-input",inputmode:"numeric",autocomplete:"one-time-code",placeholder:"123456",disabled:e.disabled,onInput:n[0]||(n[0]=g=>c(g.target.value))},null,40,_e),a("p",xe,[a("button",{type:"button",class:"font-medium text-brand underline hover:no-underline",disabled:e.disabled,onClick:n[1]||(n[1]=g=>m("recovery"))}," Use a recovery code instead ",8,he)])])):(b(),U("div",ge,[n[6]||(n[6]=a("label",{for:"mfa-step-up-recovery",class:"mb-1 block text-sm font-medium text-ink"}," Recovery code ",-1)),n[7]||(n[7]=a("p",{id:"mfa-step-up-recovery-hint",class:"mb-1 text-xs text-neutral-500"}," Each recovery code can only be used once. ",-1)),a("input",{id:"mfa-step-up-recovery","aria-describedby":"mfa-step-up-recovery-hint",value:e.recoveryCode,type:"text",name:"mfa_recovery_code",class:"mfa-input font-mono uppercase",autocomplete:"one-time-code",placeholder:"ABCDE-FGHIJ",disabled:e.disabled,onInput:n[2]||(n[2]=g=>d(g.target.value))},null,40,ye),a("p",be,[a("button",{type:"button",class:"font-medium text-brand underline hover:no-underline",disabled:e.disabled,onClick:n[3]||(n[3]=g=>m("authenticator"))}," Use authenticator app instead ",8,we)])])),e.errorText?(b(),U("div",ke,E(e.errorText),1)):S("",!0)]))}}),Te=G(Ce,[["__scopeId","data-v-e58445d0"]]),$e={class:"flex-1"},Ee={class:"space-y-6"},Pe={class:"mt-6 flex flex-col items-center justify-center py-2 sm:col-span-2"},Ie=Y({__name:"ChangePassword",props:{setLoading:{type:Function}},setup(P){const k=P,e=H(),i=r(!1),v=te(()=>{var t;return!!((t=e.user)!=null&&t.has_mfa_enabled)||i.value}
1),c=r(""),d=r(""),m=r(""),p=r(""),n=r(""),g=r(""),T=r(""),y=r(""),w=r(""),I=r("");async function L(){D(),I.value="";const t=R();if(!t){I.value="Please check the highlighted fields and try again.";return}if(v.value){const u=T.value.trim(),f=y.value.trim();if(!u&&!f){w.value="Please enter your authenticator code to confirm this change.";return}const C=t;u&&(C.mfa_code=u.replace(/\s+/g,"")),f&&(C.mfa_recovery_code=f.replace(/\s+/g,"").toUpperCase())}await W().profile.changePassword(t).then(()=>{J("You have successfully updated your password.",{type:"success"}),j(),k.setLoading(!1)}).catch(u=>{var f,C,M,_,q,A;if((f=u.data)!=null&&f.mfa_required)i.value=!0,w.value=((_=(M=(C=u.data)==null?void 0:C.errors)==null?void 0:M.mfa_code)==null?void 0:_[0])??((q=u.data)==null?void 0:q.message)??"That code did not work. Please try again.";else if((A=u.data)!=null&&A.errors){const x=u.data.errors;n.value=l(x.password),x.current_password&&(p.value="Current password was incorrect.")}else I.value="Unable to update password. Please try again later or contact support.";k.setLoading(!1)})}function R(){const t={};let s=!1;return c.value.trim().length?t.current_password=c.value:(p.value="You must include your current password",s=!0),d.value&&(d.value===m.value?t.password=d.value:(g.value="Passwords do not match.",s=!0)),!s||Object.keys(t).length===2?t:null}function j(){d.value="",c.value="",m.value="",T.value="",y.value=""}function D(){n.value="",p.value="",g.value="",w.value=""}function B(){w.value=""}function l(t){return t?Array.isArray(t)?t[0]:t:""}return(t,s)=>{const u=z,f=Te,C=O,M=K;return b(),U("div",$e,[s[5]||(s[5]=a("hr",{class:"mb-8 mt-10 lg:hidden"},null,-1)),a("div",Ee,[a("form",null,[h(u,{class:"sm:col-span-2",label:"username",name:"username",autoComplete:"username",hidden:!0}),h(u,{class:"sm:col-span-2",label:"Current Password",type:"password",name:"currentPassword",autoComplete:"current-password",value:o(c),"onUpdate:value":s[0]||(s[0]=_=>$(c)?c.value=_:null),errorText:o(p)},null,8,["value","errorText"]),h(u,{label:"Change Password",type:"password",name:"newPassword",autoComplete:"new-password",value:o(d),"onUpdate:value":s[1]||(s[1]=_=>$(d)?d.value=_:null),errorText:o(n)},null,8,["value","errorText"]),h(u,{label:"Confirm New Password",type:"password",name:"confirmPassword",autoComplete:"new-password",value:o(m),"onUpdate:value":s[2]||(s[2]=_=>$(m)?m.value=_:null),errorText:o(g)},null,8,["value","errorText"]),o(v)?(b(),N(f,{key:0,class:"mt-6",code:o(T),recoveryCode:o(y),errorText:o(w),"onUpdate:code":s[3]||(s[3]=_=>T.value=_),"onUpdate:recoveryCode":s[4]||(s[4]=_=>y.value=_),onClearError:B},null,8,["code","recoveryCode","errorText"])):S("",!0)])]),a("div",Pe,[o(I)?(b(),N(C,{key:0,message:o(I),class:"mb-4 w-full"},null,8,["message"])):S("",!0),h(M,{classes:"w-full h-12",onClick:L,tabIndex:1},{default:F(()=>[V(E(t.$t("profile_change_password_button")),1)]),_:1})])])}}}),Ue={class:"relative flex w-full flex-grow flex-col px-2 md:px-6"},Be={class:"mx-auto flex w-full flex-col items-center"},Me={class:"flex max-w-6xl items-center"},Ne={key:0,class:"relative flex w-full flex-1 flex-col justify-between py-4 lg:flex-row"},Se={class:"flex-1 space-y-4"},qe={class:"h4 mb-2 text-center font-medium text-neutral-700 lg:text-left"},Ae={class:"rounded-xl bg-white p-6 shadow-mt2"},Fe={class:"mt-4 flex flex-row text-xs"},Ve={class:"flex flex-col justify-between space-y-4 pt-4 md:flex-row md:space-x-4 md:space-y-0"},Le={class:"flex-1 space-y-4"},Re={class:"h4 mb-2 text-center font-medium text-neutral-700 lg:text-left"},je={class:"rounded-xl bg-white p-6 shadow-mt2"},De={class:"mx-auto mt-4 w-full max-w-6xl"},Xe=Y({__name:"edit",setup(P){const k=H(),{user:e}=k,i=r((e==null?void 0:e.first_name)??""),v=r((e==null?void 0:e.last_name)??""),c=r((e==null?void 0:e.email)??""),d=r((e==null?void 0:e.phone)??""),m=r((e==null?void 0:e.optin)??!0),p=r(""),n=r(""),g=r(""),T=r(""),y=r(null),w=r(!1);ae([i,v,c,d,m],()=>{y.value=null});async function I(){if(j(),y.value=null,!L()){y.value={text:"No changes to save.",variant:"info"};return}w.value=!0;const l={first_name:i.value,last_name:v.value,email:c.value,phone:d.value,optin:m.value?1:0};await W().profile.updateProfile(l).then(s=>{J("You have successfully updated your details.",{type:"success"}),H().setUser(s.data),R(),w.value=!1}
1).catch(s=>{var f;const u=(f=s.data)==null?void 0:f.errors;u?(D(u),y.value={text:"Please check the highlighted fields and try again.",variant:"error"}):y.value={text:"We could not update your details. Please try again or contact support.",variant:"error"},w.value=!1})}function L(){return i.value!==(e==null?void 0:e.first_name)||v.value!==(e==null?void 0:e.last_name)||d.value!==(e==null?void 0:e.phone)||c.value!==(e==null?void 0:e.email)||m.value!==(e==null?void 0:e.optin)}function R(){i.value=(e==null?void 0:e.first_name)??"",v.value=(e==null?void 0:e.last_name)??"",d.value=(e==null?void 0:e.phone)??"",c.value=(e==null?void 0:e.email)??"",m.value=(e==null?void 0:e.optin)??!1}function j(){p.value="",n.value="",g.value="",T.value=""}function D(l){p.value=B(l.first_name)??"",n.value=B(l.last_name)??"",g.value=B(l.phone)??"",T.value=B(l.email)??""}function B(l){return l?Array.isArray(l)?l[0]:l:null}return(l,t)=>{const s=Q,u=X,f=z,C=pe,M=O,_=K,q=ne,A=se;return o(e)?(b(),N(A,{key:1},{default:F(()=>[a("section",Ue,[t[8]||(t[8]=a("div",{class:"h-4 md:h-20"},null,-1)),h(u,{loading:o(w)},null,8,["loading"]),a("div",Be,[a("div",Me,[o(e)?(b(),U("div",Ne,[a("div",Se,[a("h2",qe,E(l.$t("profile_edit_profile")),1),a("div",Ae,[a("form",null,[h(f,{label:"First Name",name:"first-name",value:o(i),"onUpdate:value":t[0]||(t[0]=x=>$(i)?i.value=x:null),errorText:o(p),autocomplete:"given-name",required:""},null,8,["value","errorText"]),h(f,{label:"Last Name",name:"last-name",value:o(v),"onUpdate:value":t[1]||(t[1]=x=>$(v)?v.value=x:null),errorText:o(n),autocomplete:"family-name",required:""},null,8,["value","errorText"]),h(f,{label:"Email",type:"email",name:"email",value:o(c),"onUpdate:value":t[2]||(t[2]=x=>$(c)?c.value=x:null),errorText:o(T),autocomplete:"email",required:""},null,8,["value","errorText"]),h(f,{label:"Phone",type:"tel",name:"phone",value:o(d),"onUpdate:value":t[3]||(t[3]=x=>$(d)?d.value=x:null),errorText:o(g),autocomplete:"phone",required:""},null,8,["value","errorText"]),a("div",Fe,[h(C,{name:"optIn",value:o(m),"onUpdate:value":t[4]||(t[4]=x=>$(m)?m.value=x:null)},{default:F(()=>t[6]||(t[6]=[V(" Stay up to date with information on upcoming shows, event information and news from the artist, promoter, venue and/or other associated parties. ")])),_:1},8,["value"])])]),o(y)?(b(),N(M,{key:0,message:o(y).text,variant:o(y).variant},null,8,["message","variant"])):S("",!0),a("div",Ve,[h(_,{class:"mt-btn min-h-12 flex-1",onClick:I},{default:F(()=>[V(E(l.$t("profile_update_details_button")),1)]),_:1}),a("div",{class:"mt-btn btn-dark-outline min-h-12 cursor-pointer px-10",onClick:t[5]||(t[5]=async()=>await o(k).logout()&&("navigateTo"in l?l.navigateTo:o(oe))("/"))},E(l.$t("profile_logout")),1)])])]),t[7]||(t[7]=a("div",{class:"my-6 min-h-[1px] min-w-[1px] border-t border-t-neutral-200 lg:mx-6 lg:my-0 lg:border-l lg:border-t-0 lg:border-l-neutral-200"},null,-1)),a("div",Le,[a("h2",Re,E(l.$t("profile_change_password")),1),a("div",je,[h(Ie,{"set-loading":x=>w.value=x},null,8,["set-loading"])])])])):S("",!0)])]),a("div",De,[h(q,{title:l.$t("support_contact_support_title"),linkTo:"/support",linkText:l.$t("support_contact_support_cta")},null,8,["title","linkText"])]),t[9]||(t[9]=a("div",{class:"h-20"},null,-1))])]),_:1})):(b(),N(s,{key:0,title:"Profile",subtitle:"Please log in to update your profile"}))}}});export{Xe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.