PageSourceSearch

https://app.planitprima.com/dist/profile.edit.7f95150461ab07a8.bundle.js

js planitprima.com collected 2026-10-07 00:57:37 UTC 13,105 bytes, 1 lines download raw bytes

1"use strict";(globalThis["webpackChunkfrontend"]=globalThis["webpackChunkfrontend"]||[]).push([[3116],{10836:(e,t,a)=>{a.r(t),a.d(t,{default:()=>$});var o=a(20641),r=a(90033),l=a(53751),s=a(18955),n=a(54036),i=a(29654),c=a(86108),u=a(36490);const d={class:"pa-4"},m={class:"font-weight-medium"},h={class:"px-4"},b={class:"d-flex align-center"},p={class:"d-flex align-center ml-2"},v={class:"text-success pa-4 d-flex align-center",style:{"text-transform":"uppercase","font-weight":"500"}},f={key:0},w={class:"d-flex justify-end"},_={key:2,class:"pt-4"},g={class:"d-flex justify-end"};function F(e,t,a,F,k,y){const S=(0,o.g2)("PlanitInput"),T=(0,o.g2)("TooltipIcon"),C=(0,o.g2)("PlanitButton"),P=(0,o.g2)("PlanitIcon"),x=(0,o.g2)("PlanitTextField"),$=(0,o.g2)("BaseCard");return(0,o.uX)(),(0,o.CE)("div",null,[(0,o.Lk)("div",d,[(0,o.Lk)("h1",m,(0,r.v_)(e.$t("profile.edit_profile")),1)]),(0,o.bF)(u.K,{modelValue:k.savedSnackbar,"onUpdate:modelValue":t[0]||(t[0]=e=>k.savedSnackbar=e),timeout:4e3,color:"success",location:"right"},{default:(0,o.k6)(()=>[(0,o.eW)((0,r.v_)(e.$t("generic.saved")),1)]),_:1},8,["modelValue"]),(0,o.bF)(u.K,{modelValue:k.errorSnackbar,"onUpdate:modelValue":t[1]||(t[1]=e=>k.errorSnackbar=e),timeout:4e3,color:"error",location:"right"},{default:(0,o.k6)(()=>[(0,o.eW)((0,r.v_)(k.errorSnackbarText),1)]),_:1},8,["modelValue"]),(0,o.Lk)("div",h,[(0,o.bF)($,null,{default:(0,o.k6)(()=>[(0,o.Lk)("form",null,[(0,o.bF)(S,{model:a.user,attr:"email",label:e.$t("generic.email"),highlight:"",placeholder:e.$t("generic.email"),required:!0,class:"mb-4"},null,8,["model","label","placeholder"]),(0,o.bF)(i.L,null,{default:(0,o.k6)(()=>[(0,o.bF)(c.B,null,{default:(0,o.k6)(()=>[(0,o.bF)(S,{model:a.user,attr:"title",label:e.$t("generic.title"),highlight:"",class:"mb-4"},null,8,["model","label"]),(0,o.bF)(S,{model:a.user,attr:"first_name",label:e.$t("generic.first_name"),highlight:"",class:"mb-4"},null,8,["model","label"]),(0,o.bF)(S,{model:a.user,attr:"last_name",label:e.$t("generic.last_name"),highlight:"",class:"mb-4"},null,8,["model","label"]),(0,o.Lk)("div",b,[(0,o.bF)(S,{model:a.user,attr:"company_name",label:e.$t("generic.company_name"),highlight:"",class:"flex-grow-1"},null,8,["model","label"]),(0,o.Lk)("div",p,[(0,o.bF)(T,{small:"",icon:"fal fa-question-circle",tooltip:e.$t("generic.company_name_tooltip")},null,8,["tooltip"])])])]),_:1}),(0,o.bF)(c.B,null,{default:(0,o.k6)(()=>[(0,o.bF)(S,{model:a.user,attr:"enable_autosave",label:e.$t("generic.enable_autosave"),highlight:"",type:"checkbox",class:"mb-4","after-save":y.afterSaveEnableAutosave},null,8,["model","label","after-save"]),(0,o.bF)(S,{model:a.user,attr:"show_support_btn",label:e.$t("generic.show_support_btn"),highlight:"",type:"checkbox",class:"mb-4","after-save":y.afterSaveEnableAutosave},null,8,["model","label","after-save"]),(0,o.bF)(S,{model:a.user,attr:"show_changelog_notification",label:e.$t("generic.show_changelog_notification"),highlight:"",type:"checkbox",class:"mb-4","after-save":y.afterSaveEnableAutosave},null,8,["model","label","after-save"])]),_:1})]),_:1}),(0,o.bF)(n.G,{class:"my-4"}),(0,o.bF)(S,{model:a.user,attr:"password","input-type":"password",label:e.$t("login.password"),autocomplete:"new-password","error-message":k.passwordError,highlight:"",class:"mb-2",width:"320px","dont-autosave":"","local-attr":""},null,8,["model","label","error-message"]),(0,o.bF)(S,{model:k.passwordConfirm,attr:"password","error-message":y.passwordConfirmError,"input-type":"password",label:e.$t("login.confirm_password"),autocomplete:"new-password",highlight:"",class:"mb-2",width:"320px","dont-autosave":"","local-attr":""},null,8,["model","error-message","label"]),(0,o.bF)(C,{variant:"text",color:"error",loading:k.isSavingPassword,disabled:!y.canSavePassword,onClick:y.savePassword},{default:(0,o.k6)(()=>[(0,o.eW)((0,r.v_)(e.$t("admin.users.save_password")),1)]),_:1},8,["loading","disabled","onClick"]),(0,o.bF)(n.G,{class:"my-4"}),a.user.otp_enabled?((0,o.uX)(),(0,o.Wv)(i.L,{key:0,"no-gutters":""},{default:(0,o.k6)(()=>[(0,o.bF)(c.B,null,{default:(0,o.k6)(()=>[(0,o.Lk)("div",v,[(0,o.bF)(P,{size:"small",class:"text-success mr-2",icon:"fal fa-check"}
1),(0,o.Lk)("span",null,(0,r.v_)(e.$t("profile.edit.two_factor_auth_enabled")),1)]),(0,o.bF)(C,{variant:"text",color:"default",class:"mb-4",onClick:t[2]||(t[2]=e=>k.showTowFactorDisableForm=!0)},{default:(0,o.k6)(()=>[(0,o.bF)(P,{size:"small",class:"mr-1",icon:"fal fa-times"}),(0,o.eW)(" "+(0,r.v_)(e.$t("profile.edit.disable_two_factor_auth")),1)]),_:1})]),_:1}),(0,o.bF)(c.B,null,{default:(0,o.k6)(()=>[k.showTowFactorDisableForm?((0,o.uX)(),(0,o.CE)("div",f,[(0,o.Lk)("form",{onSubmit:t[4]||(t[4]=(0,l.D$)((...e)=>y.disableTwoFactorAuth&&y.disableTwoFactorAuth(...e),["prevent"]))},[(0,o.bF)(x,{modelValue:k.twoFactorCode,"onUpdate:modelValue":t[3]||(t[3]=e=>k.twoFactorCode=e),label:e.$t("generic.two_factor_code"),variant:"outlined",density:"compact","hide-details":!k.disableTwoFactorAuthError,"error-messages":k.disableTwoFactorAuthError,class:"mb-2"},null,8,["modelValue","label","hide-details","error-messages"]),(0,o.Lk)("div",w,[(0,o.bF)(C,{color:"primary",type:"submit"},{default:(0,o.k6)(()=>[(0,o.eW)((0,r.v_)(e.$t("generic.confirm")),1)]),_:1})])],32)])):(0,o.Q3)("",!0)]),_:1})]),_:1})):(0,o.Q3)("",!0),a.user.otp_enabled||k.showTwoFactorInfo?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.Wv)(C,{key:1,color:"primary",onClick:y.enableTwoFactorAuth},{default:(0,o.k6)(()=>[(0,o.eW)((0,r.v_)(e.$t("profile.edit.enable_two_factor_auth")),1)]),_:1},8,["onClick"])),k.showTwoFactorInfo?((0,o.uX)(),(0,o.CE)("div",_,[(0,o.bF)(i.L,null,{default:(0,o.k6)(()=>[(0,o.bF)(c.B,null,{default:(0,o.k6)(()=>t[7]||(t[7]=[(0,o.Lk)("canvas",{id:"twoFactorQRCode"},null,-1)])),_:1,__:[7]}),(0,o.bF)(c.B,null,{default:(0,o.k6)(()=>[(0,o.bF)(C,{variant:"text",color:"primary",href:e.otpProvisioningURI,class:"mb-4"},{default:(0,o.k6)(()=>[(0,o.bF)(P,{class:"mr-2",icon:"fas fa-plus"}),(0,o.Lk)("span",null,(0,r.v_)(e.$t("profile.edit.add_to_auth_app")),1)]),_:1},8,["href"]),(0,o.bF)(s.l,{color:"grey-lighten-5",class:"text-left"},{default:(0,o.k6)(()=>[(0,o.eW)((0,r.v_)(k.otpSecret)+" ("+(0,r.v_)(e.$t("profile.edit.time_based"))+") ",1)]),_:1})]),_:1})]),_:1}),(0,o.bF)(i.L,null,{default:(0,o.k6)(()=>[(0,o.bF)(c.B,{cols:"6"},{default:(0,o.k6)(()=>[(0,o.Lk)("form",{onSubmit:t[6]||(t[6]=(0,l.D$)((...e)=>y.confirmTwoFactorAuth&&y.confirmTwoFactorAuth(...e),["prevent"]))},[(0,o.bF)(x,{modelValue:k.twoFactorCode,"onUpdate:modelValue":t[5]||(t[5]=e=>k.twoFactorCode=e),label:e.$t("generic.two_factor_code"),variant:"outlined",density:"compact","error-messages":k.confirmTwoFactorAuthError,class:"mb-2"},null,8,["modelValue","label","error-messages"]),(0,o.Lk)("div",g,[(0,o.bF)(C,{color:"primary",type:"submit"},{default:(0,o.k6)(()=>[(0,o.eW)((0,r.v_)(e.$t("generic.confirm")),1)]),_:1})])],32)]),_:1})]),_:1})])):(0,o.Q3)("",!0)])]),_:1})])])}var k=a(7555),y=a(84344),S=a(45673),T=a(97919);const C={page(){return{title:this.user.name,meta:[{name:"description",content:`The user profile for ${this.user.name}.`}]}},components:{PlanitInput:k.A,BaseCard:y.A,TooltipIcon:S.A},props:{user:{type:Object,required:!0}},data(){return{savedSnackbar:!1,errorSnackbar:!1,errorSnackbarText:"",passwordConfirm:{password:""},isSavingPassword:!1,passwordError:null,twoFactorCode:null,showTwoFactorInfo:!1,showTowFactorDisableForm:!1,otpSecret:null,confirmTwoFactorAuthError:null,disableTwoFactorAuthError:null,qr:null}},computed:{currentPasswordValue(){return String(this.user.password||"")},confirmPasswordValue(){return String(this.passwordConfirm.password||"")},userPasswordFilled(){return this.currentPasswordValue.length>0},confirmPasswordFilled(){return this.confirmPasswordValue.length>0},passwordsMatch(){return!(!this.userPasswordFilled||!this.confirmPasswordFilled)&&this.currentPasswordValue===this.confirmPasswordValue},passwordMismatch(){return this.userPasswordFilled&&this.confirmPasswordFilled&&!this.passwordsMatch},passwordConfirmError(){return this.passwordMismatch?this.$t("forgotPassword.passwords_dont_match"):null},canSavePassword(){return this.passwordsMatch&&!this.isSavingPassword}},created(){},methods:{async savePassword(){if(this.canSavePassword){this.isSavingPassword=!0,this.passwordError=null;try{await this.user.sync("password"),this.user.updateAttr({password:null}),this.passwordConfirm.password="",this.savedSnackbar=!0}catch(t){var e;const a=null===t||void 0===t||null===(e=t.response)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.password;null!==a&&void 0!==a&&a.length?this.passwordError=a[0]:(this.errorSnackbarText=this.$t("generic.default_error"),this.errorSnackbar=!0)}finally{this.isSavingPassword=!1}}},enableTwoFactorAuth(){this.user.enableTwoFactorAuth().then(async e=>{a.e(680).then(a.t.bind(a,40680,23)).then(t=>{const a=t.default;this.otpProvisioningURI=e.data.otp_provisioning_uri,this.otpSecret=e.data.otp_secret,this.showTwoFactorInfo=!0,this.$nextTick(()=>{const t=document.getElementById("twoFactorQRCode");this.qr=new a({element:t,value:e.data.otp_provisioning_uri,size:400,padding:25})})})})},confirmTwoFactorAuth(){this.user.sync(null,{otp_enabled:!0,two_factor_code:this.twoFactorCode}).then(()=>{this.showTwoFactorInfo=!1,this.twoFactorCode=null}).catch(e=>
1{this.confirmTwoFactorAuthError=this.$t("profile.edit.two_factor_code_wrong_error")})},disableTwoFactorAuth(){this.user.sync(null,{otp_enabled:!1,two_factor_code:this.twoFactorCode}).then(()=>{this.showTowFactorDisableForm=!1,this.twoFactorCode=null}).catch(e=>{this.disableTwoFactorAuthError=this.$t("profile.edit.two_factor_code_wrong_error")})},afterSaveEnableAutosave(){T.A.dispatch("auth/validate")}}};var P=a(66262);const x=(0,P.A)(C,[["render",F]]),$=x},36490:(e,t,a)=>{a.d(t,{K:()=>S});var o=a(20641),r=a(29340),l=a(78181),s=a(76601),n=a(39965),i=a(72332),c=a(93648),u=a(88612),d=a(85389),m=a(41278),h=a(26478),b=a(51122),p=a(94467),v=a(87126),f=a(50953),w=a(22995),_=a(70798),g=a(17885),F=a(8064);function k(e){const t=(0,f.IJ)(e());let a=-1;function r(){clearInterval(a)}function l(){r(),(0,o.dY)(()=>t.value=e())}function s(o){const l=o?getComputedStyle(o):{transitionDuration:.2},s=1e3*parseFloat(l.transitionDuration)||200;if(r(),t.value<=0)return;const n=performance.now();a=window.setInterval(()=>{const a=performance.now()-n+s;t.value=Math.max(e()-a,0),t.value<=0&&r()},s)}return(0,f.jr)(r),{clear:r,time:t,start:s,reset:l}}const y=(0,w.j)({multiLine:Boolean,text:String,timer:[Boolean,String],timeout:{type:[Number,String],default:5e3},vertical:Boolean,...(0,c.M)({location:"bottom"}),...(0,u.S)(),...(0,m.S)(),...(0,v.gI)(),...(0,b.yx)(),...(0,_.cJ)((0,l.D)({transition:"v-snackbar-transition"}),["persistent","noClickAnimation","scrim","scrollStrategy"])},"VSnackbar"),S=(0,g.RW)()({name:"VSnackbar",props:y(),emits:{"update:modelValue":e=>!0},setup(e,t){let{slots:a}=t;const c=(0,d.q)(e,"modelValue"),{positionClasses:w}=(0,u.J)(e),{scopeId:g}=(0,h.b)(),{themeClasses:y}=(0,b.NX)(e),{colorClasses:S,colorStyles:T,variantClasses:C}
1=(0,v.rn)(e),{roundedClasses:P}=(0,m.v)(e),x=k(()=>Number(e.timeout)),$=(0,f.KR)(),A=(0,f.KR)(),V=(0,f.IJ)(!1),L=(0,f.IJ)(0),E=(0,f.KR)(),I=(0,o.WQ)(n.aF,void 0);(0,p.Y)(()=>!!I,()=>{const e=(0,n.gK)();(0,o.nT)(()=>{E.value=e.mainStyles.value})}),(0,o.wB)(c,W),(0,o.wB)(()=>e.timeout,W),(0,o.sV)(()=>{c.value&&W()});let B=-1;function W(){x.reset(),window.clearTimeout(B);const t=Number(e.timeout);if(!c.value||-1===t)return;const a=(0,_._p)(A.value);x.start(a),B=window.setTimeout(()=>{c.value=!1},t)}function D(){x.reset(),window.clearTimeout(B)}function K(){V.value=!0,D()}function M(){V.value=!1,W()}function R(e){L.value=e.touches[0].clientY}function Q(e){Math.abs(L.value-e.changedTouches[0].clientY)>50&&(c.value=!1)}function U(){V.value&&M()}const q=(0,o.EW)(()=>e.location.split(" ").reduce((e,t)=>(e[`v-snackbar--${t}`]=!0,e),{}));return(0,F.C)(()=>{const t=l.L.filterProps(e),n=!!(a.default||a.text||e.text);return(0,o.bF)(l.L,(0,o.v6)({ref:$,class:["v-snackbar",{"v-snackbar--active":c.value,"v-snackbar--multi-line":e.multiLine&&!e.vertical,"v-snackbar--timer":!!e.timer,"v-snackbar--vertical":e.vertical},q.value,w.value,e.class],style:[E.value,e.style]},t,{modelValue:c.value,"onUpdate:modelValue":e=>c.value=e,contentProps:(0,o.v6)({class:["v-snackbar__wrapper",y.value,S.value,P.value,C.value],style:[T.value],onPointerenter:K,onPointerleave:M},t.contentProps),persistent:!0,noClickAnimation:!0,scrim:!1,scrollStrategy:"none",_disableGlobalStack:!0,onTouchstartPassive:R,onTouchend:Q,onAfterLeave:U},g),{default:()=>[(0,v.wN)(!1,"v-snackbar"),e.timer&&!V.value&&(0,o.Lk)("div",{key:"timer",class:"v-snackbar__timer"},[(0,o.bF)(s.Z,{ref:A,color:"string"===typeof e.timer?e.timer:"info",max:e.timeout,modelValue:x.time.value},null)]),n&&(0,o.Lk)("div",{key:"content",class:"v-snackbar__content",role:"status","aria-live":"polite"},[a.text?.()??e.text,a.default?.()]),a.actions&&(0,o.bF)(r.K,{defaults:{VBtn:{variant:"text",ripple:!1,slim:!0}}},{default:()=>[(0,o.Lk)("div",{class:"v-snackbar__actions"},[a.actions({isActive:c})])]})],activator:a.activator})}),(0,i.O)({},$)}})}}]);

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.