1import{a as me}from"./chunk-KAWTVCJQ.js";import{a as ie,b as oe,c as ne}from"./chunk-QJEUOZ7A.js";import{a as le}from"./chunk-B6AZXXFS.js";import{d as re,e as ae}from"./chunk-EFHYMUNN.js";import{a as F}from"./chunk-ULHMBN7F.js";import"./chunk-4IUFFSCL.js";import{a as se}from"./chunk-LQ4ZHZ7A.js";import"./chunk-X237VENP.js";import"./chunk-YMDVW5FD.js";import"./chunk-UB6QNVRM.js";import"./chunk-JHZD34BJ.js";import"./chunk-AG6YMAIH.js";import{a as ee}from"./chunk-FBI72GB3.js";import"./chunk-7NRWTOQJ.js";import"./chunk-LJHPGWLV.js";import"./chunk-CCHYZV24.js";import{a as te}from"./chunk-6Y7HRAOR.js";import"./chunk-OLLNPAQS.js";import{b as p}from"./chunk-65RTA2NZ.js";import{g as X,q as Z}from"./chunk-A3364LFD.js";import"./chunk-4O4ZC76I.js";import{e as h,h as $,i as B,l as s,n as z,q as W,t as H,u as J}from"./chunk-GF52ZLA4.js";import"./chunk-KCQQPDMT.js";import"./chunk-3TGTSPZJ.js";import{b as Q}from"./chunk-MNYHBXZY.js";import{a as Y}from"./chunk-7UKIXG2M.js";import"./chunk-XVV3EBMI.js";import{$b as q,Ab as T,Ea as S,Fa as V,Fb as l,Gb as m,Hb as x,Jc as k,La as w,Lb as M,Lc as A,Ob as O,Qb as u,Zc as K,ab as o,ac as _,bb as G,bc as R,cc as U,ea as D,jc as j,kb as E,mc as c,nc as d,rb as f,sa as y,vb as n,wa as I,x as N,xb as L}from"./chunk-Y7SJDQ4B.js";var v=class{constructor(e){this.firstName=new s(e?.firstName??""),this.lastName=new s(e?.lastName??""),this.defaultLanguage=new s(e?.defaultLanguage??""),this.prefix=new s(oe(e?.phoneNumber?.prefix??"")),this.number=new s(e?.phoneNumber?.number??"")}};var g=class extends ee{constructor(e){super(),this.setIssuerValidators(e)}setIssuerValidators(e){e.controls.firstName.setValidators([h.required,F(100)]),e.controls.lastName.setValidators([h.required,F(100)]),e.controls.defaultLanguage.setValidators([h.required]),e.controls.prefix.setValidators([ae()])}};var b=class{constructor(){this.personalData=null,this.internationalPhone=null}fillData(e){this.personalData={firstName:p(e?.firstName?.value),lastName:p(e?.lastName?.value),defaultLanguage:p(e?.defaultLanguage?.value)},e?.prefix?.value?.value&&e?.number?.value&&(this.internationalPhone={prefix:p(e?.prefix?.value?.value),number:e?.number?.value?.toString()})}};function pe(r,e){r&1&&(l(0,"app-field-error")(1,"p"),_(2),c(3,"transloco"),m()()),r&2&&(o(2),R(d(3,1,"error.invalid_phone_number")))}function fe(r,e){if(r&1){let a=M();l(0,"form",2,0)(2,"div",3),x(3,"app-issuer-input",4)(4,"app-issuer-input",4)(5,"app-issuer-phone-number-input",5),f(6,pe,4,3,"app-field-error",6),x(7,"app-issuer-select-input",7),m(),l(8,"div",8)(9,"button",9),O("click",function(){S(a);let i=u(2);return V(i.submitData())}),_(10),c(11,"transloco"),m()()()}if(r&2){let a=q(1),t=u(2);n("formGroup",t.editProfileForm),o(3),n("formGroupDirective",a)("control",t.editProfileForm.controls.firstName)("label","forms.first_name"),o(),n("formGroupDirective",a)("control",t.editProfileForm.controls.lastName)("label","forms.last_name"),o(),n("prefixControl",t.editProfileForm.controls.prefix)("phoneNumberControl",t.editProfileForm.controls.number)("searchObjects",t.internationalPrefixes)("formGroupDirective",a),o(),n("ngIf",t.invalidPhoneNumber()),o(),n("options",t.languageSelectorOptions)("label","forms.language")("formGroupDirective",a)("control",t.editProfileForm.controls.defaultLanguage),o(2),L("disabled",t.editProfileForm.invalid),n("disabled",t.editProfileForm.invalid),o(),U(" ",d(11,20,"shared.save")," ")}}function ue(r,e){if(r&1&&(l(0,"app-issuer-details"),f(1,fe,12,22,"form",1),m()),r&2){let a=u();o(),n("ngIf",a.editProfileForm)}}var Je=(()=>{let e=class e{constructor(t){this.facadeService=t,this.request=new b,this.prefixes=ne,this.personalData$=this.facadeService.personalData$,this.invalidPhoneNumber=E(!1),this.destroyRef=y(w),this.languageSelectorOptions=me,this.AuthorizedRouterTypes=Y,this.facadeService.getUserData(),this.personalData$.pipe(K(this.destroyRef)).subscribe(i=>{!i||!i.phoneNumber||(this.editProfileForm=new B(new v(i)),new g(this.editProfileForm),this.internationalPrefixes=this.editProfileForm.controls.prefix.valueChanges.pipe(D(""),N(P=>re(P,this.prefixes))))})}
1submitData(){if(!this.editProfileForm.invalid){if(this.isInvalidPhoneNumber()){this.invalidPhoneNumber.set(!0);return}this.invalidPhoneNumber.set(!1),this.request.fillData(this.editProfileForm.controls),this.facadeService.editProfile(this.request)}}isInvalidPhoneNumber(){return!this.editProfileForm.controls.prefix.value&&this.editProfileForm.controls.number.value||this.editProfileForm.controls.prefix.value&&!this.editProfileForm.controls.number.value}};e.\u0275fac=function(i){return new(i||e)(G(le))},e.\u0275cmp=I({type:e,selectors:[["app-user-profile-edit"]],standalone:!0,features:[j],decls:2,vars:3,consts:[["parentForm","ngForm"],["class","form mt-2",3,"formGroup",4,"ngIf"],[1,"form","mt-2",3,"formGroup"],[1,"data-box"],[3,"formGroupDirective","control","label"],[3,"prefixControl","phoneNumberControl","searchObjects","formGroupDirective"],[4,"ngIf"],[3,"options","label","formGroupDirective","control"],[1,"step-button"],[1,"btn","btn-primary",3,"click","disabled"]],template:function(i,P){if(i&1&&(f(0,ue,2,1,"app-issuer-details"),c(1,"async")),i&2){let C;T((C=d(1,1,P.personalData$))?0:-1,C)}},dependencies:[se,Z,H,z,$,J,W,Q,te,ie,X,k,A],styles:["p[_ngcontent-%COMP%]{margin:0}.step-button[_ngcontent-%COMP%]{margin-top:1rem}"],changeDetection:0});let r=e;return r})();export{Je as UserProfileEditComponent};
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.