1import{a as je,b as Le}from"./chunk-HERVHQD4.js";import{a as $e,b as Ge}from"./chunk-FK3AYKEM.js";import{r as Re,s as Me}from"./chunk-QFPXHDSI.js";import"./chunk-PXYMM34B.js";import"./chunk-DLJJL426.js";import{c as Pe}from"./chunk-RUHGDOSU.js";import"./chunk-MS4AQ6UA.js";import{a as qe,l as Oe,n as ze}from"./chunk-REWHUV3E.js";import"./chunk-T6C34YYY.js";import"./chunk-NX27Y33N.js";import"./chunk-HWPGI4JY.js";import"./chunk-HOJ36SEL.js";import"./chunk-XSS4FIQP.js";import"./chunk-I4LNEYGG.js";import"./chunk-KUQBXGWM.js";import"./chunk-M4XPG5ND.js";import{a as Ve,c as Be,d as Ae}from"./chunk-NMD7BNDY.js";import"./chunk-IER535FF.js";import"./chunk-RNV27XOH.js";import{E as He}from"./chunk-ZCDK4TE2.js";import"./chunk-CWI4HD4C.js";import"./chunk-VYSZY2RF.js";import"./chunk-FRAOFR6K.js";import"./chunk-O2HTKXBS.js";import"./chunk-KIPGNHHL.js";import{a as De}from"./chunk-FVQU7U56.js";import"./chunk-62CDGUSA.js";import"./chunk-VIJF72ZQ.js";import{a as Te,b as Ne,c as we}from"./chunk-MIJ4BSDV.js";import"./chunk-LU67H3NU.js";import"./chunk-SLO7444R.js";import"./chunk-J3UGQKB5.js";import"./chunk-3XORJJA4.js";import"./chunk-5GIAIL6D.js";import"./chunk-2RNO6VAM.js";import"./chunk-EBOM3FLD.js";import"./chunk-WVJHT65Q.js";import"./chunk-HRXSP2SL.js";import"./chunk-IVR6OPIX.js";import"./chunk-SUTBK5PK.js";import"./chunk-23UOLJGU.js";import"./chunk-C3M5GFWG.js";import"./chunk-XG3ZOYLF.js";import"./chunk-LJRNXR4Z.js";import"./chunk-T4MK7QAN.js";import"./chunk-N5H33MAT.js";import"./chunk-DCR4YP2M.js";import"./chunk-SWDGNTZF.js";import"./chunk-F5X5MWHG.js";import"./chunk-57JUTFV6.js";import"./chunk-SGYCFQGT.js";import"./chunk-GWZHENGH.js";import{a as te,c as ke}from"./chunk-PYVFHOBF.js";import"./chunk-4ZZX3EUT.js";import{e as ee}from"./chunk-FHNA7NOX.js";import"./chunk-UKOH47LE.js";import{c as Fe}from"./chunk-YYOXQINR.js";import"./chunk-W4J2SMRF.js";import"./chunk-ICLKOHZ2.js";import{g as Ee}from"./chunk-E4JDWYYD.js";import"./chunk-STYHDWK5.js";import"./chunk-3RK6DDJD.js";import{b as Ce,h as X,k as be,l as Se}from"./chunk-PX3ZDZPI.js";import"./chunk-EWTLMG7H.js";import"./chunk-XFQOOWRA.js";import"./chunk-HVXXTVPX.js";import"./chunk-YOQYUK2P.js";import"./chunk-OM52GCBP.js";import"./chunk-6RGPRWVV.js";import"./chunk-U44HLD2S.js";import"./chunk-R4DV5QZ2.js";import"./chunk-VNN7MPNT.js";import{e as fe,g as he}from"./chunk-KLYQFF2A.js";import{C as ye,G as H,I as Ie,b as ve,c as ge,e as F,h as Q,i as A,n as z,s as P,t as _e,u as xe,v as Z}from"./chunk-H2ADB6ED.js";import{a as ue}from"./chunk-UNBDIFOL.js";import{$d as pe,Bb as p,Ca as M,Cd as se,Da as q,Dc as le,Lc as f,Mc as h,Qb as l,Rb as s,Sb as b,Tb as V,Ub as R,Wb as U,Zd as me,_b as B,_d as J,a as w,aa as L,ac as x,b as ne,cb as G,ce as de,dc as k,ec as W,ee as ce,g as Ze,gb as n,ie as oe,mb as S,nd as Y,oc as d,od as O,pc as I,qc as g,rb as D,sa as $,sb as K,xb as v}from"./chunk-POIHHM7P.js";var Ke=new Ve({type:"phone",key:"phone",label:"Phone",placeholder:null,required:!1,disabled:!1,order:null,hidden:!1,displayMode:null,colSize:null,cssClass:null,renderType:null,icon:null,iconUrl:null,dataUrl:"/Scripts/lbapp/assets/json/countryCodes.json",routeTemplate:null,routeParameters:null,routeQueryParameters:null,selectedValueFieldName:null,valueFieldName:"name",keyFieldName:"code",dataLookupKey:null,dataDependentFields:null,validators:{required:{errorMessage:"The Phone field is required"}}});var re=Ze(He());function Xe(t,a){if(t&1&&(l(0,"div",1)(1,"form",2),b(2,"ni-dynamic-form",3),s()()),t&2){let i=x();n(),p("formGroup",i.customForm),n(),p("formModel",i.formFields)("data",i.volunteerInfo.customFields)("form",i.customForm)}}var Ye=(()=>{let a=class a{constructor(){}ngOnInit(){}};a.\u0275fac=function(r){return new(r||a)},a.\u0275cmp=D({type:a,selectors:[["app-custom-fields"]],inputs:{volunteerInfo:"volunteerInfo",customForm:"customForm",formFields:"formFields"},standalone:!1,decls:1,vars:1,consts:[["class","custom-form-cover cc-admin-dynamic-form",4,"ngIf"],[1,"custom-form-cover","cc-admin-dynamic-form"],[3,"formGroup"],[3,"formModel","data","form"]],template:function(r,c){r&1&&v(0,Xe,3,4,"div",0),r&2&&p("ngIf",c.customForm)},dependencies:[O,z,A,P,Oe],encapsulation:2});let t=a;return t})();function rt(t,a){t&1&&(l(0,"span",12),d(1,"*"),s())}
1function at(t,a){if(t&1&&(l(0,"mat-option",13),d(1),s()),t&2){let i=a.$implicit;p("value",i.key),n(),I(i.value)}}function lt(t,a){if(t&1&&(l(0,"mat-option",13),d(1),s()),t&2){let i=a.$implicit;p("value",i),n(),I(i)}}function st(t,a){if(t&1&&(l(0,"mat-option",13),d(1),s()),t&2){let i=a.$implicit;p("value",i),n(),I(i)}}function mt(t,a){if(t&1){let i=U();l(0,"form",1)(1,"div",2)(2,"div",3)(3,"label"),d(4),f(5,"translate"),v(6,rt,2,0,"span",4),s(),l(7,"mat-form-field",5)(8,"mat-select",6),f(9,"translate"),B("selectionChange",function(){M(i);let r=x();return q(r.form.valid&&r.setDate())}),v(10,at,2,2,"mat-option",7),s()()(),l(11,"div",3)(12,"mat-form-field",8)(13,"mat-select",9),f(14,"translate"),B("selectionChange",function(){M(i);let r=x();return q(r.form.valid&&r.setDate())}),v(15,lt,2,2,"mat-option",7),s()()(),l(16,"div",3)(17,"mat-form-field",10)(18,"mat-select",11),f(19,"translate"),B("selectionChange",function(){M(i);let r=x();return q(r.form.valid&&r.setDate())}),v(20,st,2,2,"mat-option",7),s()()()()()}if(t&2){let i=x();p("formGroup",i.form),n(4),g("",h(5,9,"EditProfileModule.BirthFieldComponent.Date of birth")," "),n(2),p("ngIf",i.required),n(2),k("placeholder",h(9,11,"VolunteerFormComponent.Select month")),n(2),p("ngForOf",i.monthes),n(3),k("placeholder",h(14,13,"VolunteerFormComponent.Select day")),n(2),p("ngForOf",i.days),n(3),k("placeholder",h(19,15,"VolunteerFormComponent.Select year")),n(2),p("ngForOf",i.years)}}var Je=(()=>{let a=class a{constructor(e){this.fb=e,this.required=!1,this.monthes=[{key:1,value:"January"},{key:2,value:"February"},{key:3,value:"March"},{key:4,value:"April"},{key:5,value:"May"},{key:6,value:"June"},{key:7,value:"July"},{key:8,value:"August"},{key:9,value:"September"},{key:10,value:"October"},{key:11,value:"November"},{key:12,value:"December"}],this.days=[],this.years=[]}ngOnInit(){let e=this.parentForm.value[this.fieldKey];this.generateYears(),e&&([this.year,this.month,this.day]=e.split("T")[0].split("-"),this.generateDays()),this.initForm()}generateYears(){let e=new Date().getFullYear(),r=e-99,c=e-5;this.years=this.range(r,c).reverse()}generateDays(){this.days=this.range(1,this.daysInMonth(this.year,this.month)+1)}range(e,r,c=1){return!e||!r?[]:Array(Math.ceil((r-e)/c)).fill(e).map((o,m)=>o+m*c)}daysInMonth(e,r){return new Date(e,r,0).getDate()}initForm(){this.form=this.fb.group({year:[+this.year||null,this.required?F.required:null],month:[+this.month||null,this.required?F.required:null],day:[+this.day||null,this.required?F.required:null]}),this.form.valueChanges.subscribe(e=>{(e.year||e.month)&&(this.days=this.range(1,this.daysInMonth(e.year,e.month)+1),e.day>this.days[this.days.length-1]&&this.form.get("day").setValue(1))})}makeBirthDateRequired(){["year","month","day"].forEach(e=>{this.form.controls[e].setValidators(F.required)})}setDate(){let e=this.form,r=e.get("year").value,c=e.get("month").value,o=e.get("day").value,m="".concat(r,"-").concat(c,"-").concat(o,"T00:00:00");this.parentForm.get(this.fieldKey).setValue(m),this.parentForm.markAsDirty(),this.parentForm.markAsTouched()}};a.\u0275fac=function(r){return new(r||a)(S(H))},a.\u0275cmp=D({type:a,selectors:[["app-birth-field-custom"]],inputs:{fieldKey:"fieldKey",parentForm:"parentForm",required:"required"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"d-flex","align-items-end","w-100"],[1,"form-group"],["class","text-danger",4,"ngIf"],["appearance","fill",2,"width","200px","margin-right","6px"],["formControlName","month","required","",3,"selectionChange","placeholder"],[3,"value",4,"ngFor","ngForOf"],["appearance","fill",2,"width","155px","margin-right","6px"],["formControlName","day","required","",3,"selectionChange","placeholder"],["appearance","fill",2,"width","155px"],["formControlName","year","required","",3,"selectionChange","placeholder"],[1,"text-danger"],[3,"value"]],template:function(r,c){r&1&&v(0,mt,21,17,"form",0),r&2&&p("ngIf",c.form)},dependencies:[Y,O,z,Q,A,ye,P,Z,X,te,ee,J],styles:[".mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%);top:50%!important;position:absolute!important;right:0}"]});let t=a;return t})();var dt=()=>({});function ct(t,a){t&1&&(l(0,"mat-error",32),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field is required")," "))}function ut(t,a){t&1&&(l(0,"mat-error",32),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field is required")," "))}function ft(t,a){t&1&&(l(0,"span",33),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field is required")," "))}
vendor: 1,107 bytes, line 1
1function ht(t,a){if(t&1&&(V(0),b(1,"app-birth-field-custom",34),R()),t&2){let i=x(2);n(),p("fieldKey","birthDate")("parentForm",i.form)("required",!1)}}function vt(t,a){t&1&&(l(0,"mat-error",32),d(1),f(2,"translate"),s()),t&2&&(n(),g(" ",h(2,1,"VolunteerFormComponent.Field is required")," "))}function gt(t,a){t&1&&(l(0,"mat-error",32),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field value must be less than or equal 200")," "))}function _t(t,a){t&1&&(l(0,"mat-error",32),d(1),f(2,"translate"),s()),t&2&&(n(),g(" ",h(2,1,"VolunteerFormComponent.Wrong email format")," "))}function xt(t,a){if(t&1&&(l(0,"mat-option",38),d(1),s()),t&2){let i=a.$implicit;p("value",i.key),n(),I(i.value)}}function yt(t,a){if(t&1&&(V(0),l(1,"div",8)(2,"label",9),d(3),f(4,"translate"),s(),l(5,"mat-form-field",35)(6,"mat-select",36),v(7,xt,2,2,"mat-option",37),s()()(),R()),t&2){let i=x(2);n(3),g("",h(4,2,"VolunteerFormComponent.T-shirt Size")," "),n(4),p("ngForOf",i.shirtSizeArr)}}function It(t,a){if(t&1&&(l(0,"mat-option",38),d(1),s()),t&2){let i=a.$implicit;p("value",i.key),n(),I(i.value)}}
1function Ft(t,a){if(t&1&&(V(0),l(1,"div",8)(2,"label",9),d(3),f(4,"translate"),s(),l(5,"mat-form-field",35)(6,"mat-select",39),v(7,It,2,2,"mat-option",37),s()()(),R()),t&2){let i=x(2);n(3),g("",h(4,2,"VolunteerFormComponent.Shoe Size")," "),n(4),p("ngForOf",i.shoeSizeArr)}}function Ct(t,a){if(t&1&&(l(0,"mat-option",38),d(1),s()),t&2){let i=a.$implicit;p("value",i.key),n(),I(i.value)}}function bt(t,a){if(t&1&&(V(0),l(1,"div",8)(2,"label",9),d(3),f(4,"translate"),s(),l(5,"mat-form-field",35)(6,"mat-select",40),v(7,Ct,2,2,"mat-option",37),s()()(),R()),t&2){let i=x(2);n(3),I(h(4,2,"VolunteerFormComponent.Short Size")),n(4),p("ngForOf",i.shortSizeArr)}}function St(t,a){t&1&&(l(0,"span",41),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field is required")," "))}function Et(t,a){t&1&&(l(0,"mat-error",32),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field is required")," "))}function kt(t,a){if(t&1&&(l(0,"div",8)(1,"label",9),d(2,"Instagram"),s(),l(3,"mat-form-field",11),b(4,"input",42),v(5,Et,3,3,"mat-error",13),s()()),t&2){let i=x(2);n(5),p("ngIf",i.form.get("instagram").hasError("required"))}}function Vt(t,a){t&1&&(l(0,"mat-error",32),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field is required")," "))}function Rt(t,a){if(t&1&&(l(0,"div",8)(1,"label",9),d(2,"WhatsApp"),s(),l(3,"mat-form-field",11),b(4,"input",43),v(5,Vt,3,3,"mat-error",13),s()()),t&2){let i=x(2);n(5),p("ngIf",i.form.get("whatsapp").hasError("required"))}}function Tt(t,a){if(t&1&&(l(0,"mat-option",52),d(1),s()),t&2){let i=a.$implicit,e=x(2).index,r=x(3);p("disabled",i.disabled||r.isOptionDisabled(i.id,e))("value",i.id),n(),g(" ",i.name," ")}}function Nt(t,a){if(t&1&&(V(0),l(1,"div",54),d(2),s(),R()),t&2){let i=a.$implicit;n(2),g(" ",i," ")}}function wt(t,a){if(t&1&&(l(0,"div"),v(1,Nt,3,1,"ng-container",53),s()),t&2){let i=x(2).index,e=x(3);n(),p("ngForOf",e.getSelectedRoleDescriptions(i))}}function Mt(t,a){if(t&1&&(V(0),l(1,"p",49),d(2),s(),l(3,"div")(4,"mat-form-field",35)(5,"mat-select",50)(6,"mat-option",38),d(7),f(8,"translate"),s(),v(9,Tt,2,3,"mat-option",51),s()(),v(10,wt,2,1,"div",20),s(),R()),t&2){let i,e=x(),r=e.$implicit,c=e.index,o=x(3);n(2),I(r.get("preferenceTitle").value),n(3),k("formControlName",o.volunteerInfo.allowMoreThan1Role?"roleIds":"roleId"),p("multiple",!1),n(),p("value",""),n(),g("",h(8,7,"VolunteerFormComponent.Please select")," "),n(2),p("ngForOf",o.volunteerInfo.rolesData),n(),p("ngIf",(i=o.getSelectedRoleDescriptions(c))==null?null:i.length)}}function qt(t,a){if(t&1&&(l(0,"div",48),v(1,Mt,11,9,"ng-container",20),s()),t&2){let i=a.$implicit,e=a.index,r=x(3);p("formGroupName",e),n(),p("ngIf",(!(r.volunteerInfo!=null&&r.volunteerInfo.allowMoreThan1Role)&&e===0||(r.volunteerInfo==null?null:r.volunteerInfo.allowMoreThan1Role))&&r.hasAvailableOptions(i,e)&&(r.volunteerInfo.rolesData==null?null:r.volunteerInfo.rolesData.length)>e)}}function Dt(t,a){t&1&&(l(0,"span",55),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field is required")," "))}function Bt(t,a){if(t&1&&(l(0,"div",8)(1,"label",44),d(2),f(3,"translate"),l(4,"span",10),d(5,"*"),s()(),l(6,"div",45),v(7,qt,2,2,"div",46),s(),v(8,Dt,3,3,"span",47),s()),t&2){let i=x(2);n(2),g(" ",h(3,3,"VolunteerFormComponent.Volunteer Role(s)")," "),n(5),p("ngForOf",i.preferencesArray.controls),n(),p("ngIf",i.form.get("preferencedRoles").hasError("required"))}}function Ot(t,a){if(t&1&&(l(0,"div",59),b(1,"input",60),l(2,"span",61),d(3),s()()),t&2){let i=x(),e=i.$implicit,r=i.index;p("formGroupName",r),n(3),I(e.get("name").value)}}function At(t,a){if(t&1&&(V(0),v(1,Ot,4,2,"div",58),R()),t&2){let i=a.$implicit,e=x(3);n(),p("ngIf",e.hideShiftItem(i))}}function zt(t,a){t&1&&(l(0,"span",55),d(1),f(2,"translate"),s()),t&2&&(n(),g("",h(2,1,"VolunteerFormComponent.Field is required")," "))}function Pt(t,a){if(t&1&&(l(0,"div",56)(1,"label",44),d(2),f(3,"translate"),l(4,"span",10),d(5,"*"),s()(),l(6,"div",57),v(7,At,2,1,"ng-container",53),s(),v(8,zt,3,3,"span",47),s()),t&2){let i=x(2);n(2),g("",h(3,3,"VolunteerFormComponent.Shifts")," "),n(5),p("ngForOf",i.eventShifts.controls),n(),p("ngIf",i.form.get("eventShifts").hasError("required"))}}function jt(t,a){if(t&1&&(V(0),b(1,"app-custom-fields",62),R()),t&2){let i=x(2);n(),p("volunteerInfo",i.volunteerInfo)("formFields",i.formFields)("customForm",i.customForm)}}function Lt(t,a){if(t&1){let i=U();l(0,"form",7),B("ngSubmit",function(){M(i);let r=x();return q(r.onFormSubmit())}),l(1,"fieldset")(2,"div",8)(3,"label",9),d(4),f(5,"translate"),l(6,"span",10),d(7,"*"),s()(),l(8,"mat-form-field",11),b(9,"input",12),f(10,"translate"),v(11,ct,3,3,"mat-error",13),s()(),l(12,"div",8)(13,"label",9),d(14),f(15,"translate"),l(16,"span",10),d(17,"*"),s()(),l(18,"mat-form-field",11),b(19,"input",14),f(20,"translate"),v(21,ut,3,3,"mat-error",13),s()(),l(22,"div",15)(23,"label",9),d(24),f(25,"translate"),l(26,"span",10),d(27,"*"),s()(),l(28,"mat-radio-group",16)(29,"mat-radio-button",17),d(30),f(31,"translate"),s(),l(32,"mat-radio-button",18),d(33),f(34,"translate"),s()(),v(35,ft,3,3,"span",19),s(),v(36,ht,2,3,"ng-container",20),l(37,"div",8)(38,"label",9),d(39),f(40,"translate"),l(41,"span",10),d(42,"*"),s()(),l(43,"mat-form-field",11),b(44,"input",21),f(45,"translate"),v(46,vt,3,3,"mat-error",13)(47,gt,3,3,"mat-error",13)(48,_t,3,3,"mat-error",13),s()(),v(49,yt,8,4,"ng-container",20)(50,Ft,8,4,"ng-container",20)(51,bt,8,4,"ng-container",20),l(52,"div",22),b(53,"app-phone",23),v(54,St,3,3,"span",24),s(),l(55,"div",8)(56,"label",9),d(57),f(58,"translate"),s(),l(59,"mat-form-field",11)(60,"textarea",25),f(61,"translate"),d(62," "),s()()(),v(63,kt,6,1,"div",26)(64,Rt,6,1,"div",26)(65,Bt,9,5,"div",26)(66,Pt,9,5,"div",27)(67,jt,2,3,"ng-container",20),l(68,"div",28)(69,"div",29)(70,"a",30),d(71),f(72,"translate"),s(),l(73,"button",31),d(74),f(75,"translate"),s()()()()()}if(t&2){let i=x();p("formGroup",i.form),n(4),g("",h(5,38,"VolunteerFormComponent.First Name")," "),n(5),k("placeholder",h(10,40,"VolunteerFormComponent.First Name")),n(2),p("ngIf",i.form.get("firstName").hasError("required")),n(3),g("",h(15,42,"VolunteerFormComponent.Last Name")," "),n(5),k("placeholder",h(20,44,"VolunteerFormComponent.Last Name (surname)")),n(2),p("ngIf",i.form.get("lastName").hasError("required")),n(3),g("",h(25,46,"VolunteerFormComponent.Gender")," "),n(5),p("value","male"),n(),g(" ",h(31,48,"VolunteerFormComponent.Male")," "),n(2),p("value","female"),n(),g(" ",h(34,50,"VolunteerFormComponent.Female")," "),n(2),p("ngIf",i.form.get("gender").touched&&i.form.get("gender").hasError("required")),n(),p("ngIf",i.volunteerInfo==null?null:i.volunteerInfo.showBirthDate),n(3),g("",h(40,52,"VolunteerFormComponent.Email")," "),n(5),k("placeholder",h(45,54,"VolunteerFormComponent.Email")),n(2),p("ngIf",i.form.get("email").hasError("required")),n(),p("ngIf",i.form.get("email").hasError("maxLength")),n(),p("ngIf",i.form.get("email").hasError("pattern")),n(),p("ngIf",i.volunteerInfo==null?null:i.volunteerInfo.isTshirtProvided),n(),p("ngIf",i.volunteerInfo==null?null:i.volunteerInfo.isShoeSizeProvided),n(),p("ngIf",i.volunteerInfo==null?null:i.volunteerInfo.isShortSizeProvided),n(2),p("form",i.form)("data",le(64,dt))("field",i.phoneField),n(),p("ngIf",i.form.get("phone").touched&&i.form.get("phone").hasError("required")),n(3),g("",h(58,56,"VolunteerFormComponent.Note")," "),n(3),k("placeholder",h(61,58,"VolunteerFormComponent.We greatly appreciate your help! To help us assign a spot for you, give us some details on how you'd like to help and any past experience you may have.")),n(3),p("ngIf",i.volunteerInfo==null?null:i.volunteerInfo.showInstagram),n(),p("ngIf",i.volunteerInfo==null?null:i.volunteerInfo.showWhatsapp),n(),p("ngIf",i.volunteerInfo.rolesEnabled),n(),p("ngIf",i.volunteerInfo.shiftsEnabled),n(),p("ngIf",(i.volunteerInfo.customFields==null?null:i.volunteerInfo.customFields.length)&&i.formFields&&i.customForm),n(3),W("href","/admin.aspx/Event/",i.eventId,"/VolunteersList",G),n(),g(" ",h(72,60,"Actions.Cancel")," "),n(2),p("disabled",i.disabledRegisterBtn),n(),g(" ",h(75,62,i.isEditForm?"Actions.Save":"VolunteerFormComponent.Register")," ")}}var ae=(()=>{let a=class a{get preferencesArray(){return this.form.get("preferencedRoles")}get shifts(){return this.form.get("shifts")}get eventShifts(){return this.form.get("eventShifts")}constructor(e,r,c,o,m,u,_,y,N){this.http=e,this.preloaderService=r,this.service=c,this.utils=o,this.route=m,this.niFormService=u,this.router=_,this.translate=y,this.fb=N,this.shirtSizeArr=[],this.shoeSizeArr=[],this.shortSizeArr=[],this.phoneField=Ke,this.eventId=+this.service.event_id,this.volunteerId=+this.route.
1snapshot.params.volunteerId,this.isEditForm=!!this.volunteerId}ngOnInit(){this.preloaderService.preloaderSubject.next({show:!0,spinnerColor:"dark"}),this.isEditForm?this.loadVolunteerInfo():this.loadFormData()}loadVolunteerInfo(){this.http.getReq({url:"/api2/v1/events/".concat(this.eventId,"/event-volunteers/").concat(this.volunteerId)}).pipe(L(()=>this.preloaderService.preloaderSubject.next(!1))).subscribe(e=>{var r;this.volunteerInfo=e.body,((r=this.volunteerInfo.customFields)==null?void 0:r.length)>0&&(this.customFieldsAll=(0,re.default)(e.body.customFields),this.addCustomFields(this.customFieldsAll,this.volunteerInfo.customFieldVolunteerAnswers)),this.processVolunteerInfo()})}loadFormData(){this.http.getReq({url:"/api2/v1/events/".concat(this.eventId,"/event-volunteers/form-data")}).pipe(L(()=>this.preloaderService.preloaderSubject.next(!1))).subscribe(e=>{var r;this.volunteerInfo=e.body,((r=this.volunteerInfo.customFields)==null?void 0:r.length)>0&&(this.customFieldsAll=(0,re.default)(e.body.customFields),this.addCustomFields(this.customFieldsAll,this.volunteerInfo.customFieldVolunteerAnswers)),this.processVolunteerInfo()})}processVolunteerInfo(){this.volunteerInfo.isTshirtProvided&&this.volunteerInfo.shirtSizes&&(this.shirtSizeArr=Object.keys(this.volunteerInfo.shirtSizes).map((r,c)=>({value:Object.values(this.volunteerInfo.shirtSizes)[c],key:Object.keys(this.volunteerInfo.shirtSizes)[c]}))),this.getClothesLookups(this.volunteerInfo.gender);let e=this.isEditForm?this.volunteerInfo:{eventShifts:this.volunteerInfo.eventShifts,rolesData:this.volunteerInfo.rolesData,preferencedRoles:this.volunteerInfo.preferencedRoles};this.buildForm(e)}isOptionDisabled(e,r){return this.preferencesArray.controls.map((o,m)=>{var u;if(m!==r){let _=this.volunteerInfo.allowMoreThan1Role?"roleIds":"roleId";return((u=o.get(_))==null?void 0:u.value)||null}return this.volunteerInfo.allowMoreThan1Role||null}).reduce((o,m)=>o.concat(m),[]).includes(e)}getSelectedRoleDescriptions(e){var o,m;let r=this.preferencesArray.at(e),c=this.volunteerInfo.rolesData;if(this.volunteerInfo.allowMoreThan1Role){let u=(o=r.get("roleIds"))==null?void 0:o.value;if(!u||!c)return[];let _=c.find(y=>y.id===u);return _?[_.description]:[]}else{let u=(m=r.get("roleId"))==null?void 0:m.value;if(!u||!c)return[];let _=c.find(y=>y.id===u);return _?[_.description]:[]}}hasAvailableOptions(e,r){var m,u;let c=(m=this.volunteerInfo)!=null&&m.allowMoreThan1Role?"roleIds":"roleId",o=(u=e.get(c))==null?void 0:u.value;return Array.isArray(o)&&o.length>0?!0:this.volunteerInfo.rolesData.some(_=>!this.isOptionDisabled(_.id,r)&&!_.disabled)}addCustomFields(e,r){let c=[],o=e.map(m=>{m.customFieldFilterOptionValues&&(m.customFieldFilterOptionValues=Object.keys(m.customFieldFilterOptionValues).map((_,y)=>({value:Object.values(m.customFieldFilterOptionValues)[y],key:Object.keys(m.customFieldFilterOptionValues)[y]})));let u=w(w({type:m.type,placeholder:m.placeholder,required:m.required,key:String(m.id),label:m.label,description:m.description,tooltip:m.tooltip,colSize:12},(m==null?void 0:m.value)&&{defaultValue:m.type==="multiselect"?Le(m.value):m.value}),m.required&&{validators:{required:{errorMessage:"Field is required"}}});switch(m.type){case"textarea":case"date":case"checkbox":break;case"text":u.type="input";break;case"time":u.type="input",u.mask=m.customField.variety,u.notDropSpecialCharacters=!0;let _=Pe.find(y=>y.mask===m.customField.variety).value;u.placeholder=_;break;case"select":case"multiselect":case"radio":u.options=(m==null?void 0:m.customFieldFilterOptionValues)||[],u.valueFieldName="value",u.keyFieldName="key";break;case"number":u.validators||(u.validators={}),u.validators.regExp={pattern:"^[0-9]+$",errorMessage:this.translate.instant("ParticipantRegistrationModule.RegisterComponent.Value must be positive integer")};break;case"decimal":u.type="number",u.validators||(u.validators={}),u.validators.regExp={pattern:"^[0-9.]+$",errorMessage:"Value must be positive number"};break}if(c.push(u),m!=null&&m.description){let _={type:"legend",key:String(m.id)+"description",label:"",placeholder:"",defaultValue:m==null?void 0:m.description,required:null,disabled:!0,order:null,hidden:null,isDynamicArray:null,displayMode:null,colSize:12,cssClass:"col-xs-12 description-fields",renderType:null,icon:null,iconUrl:null,dataUrl:null,routeTemplate:null,routeParameters:null,routeQueryParameters:null,
1selectedValueFieldName:null,valueFieldName:null,keyFieldName:null,dataLookupKey:null,dataDependentFields:null};c.push(_)}return u});this.formFields=this.niFormService.mapFields(c,this.customFieldsAll),this.customForm=this.buildCustomForm(this.formFields),c.map(m=>{let u=r!=null&&r.length?r.find(_=>_.fieldId.toString()===m.key):null;return u&&(this.customForm.get(m.key).setValue(u.value),m.value=u.value),m})}atLeastOneCheckedInPreferencedRolesValidator(){return e=>e.controls.some(c=>this.volunteerInfo.allowMoreThan1Role?c.get("roleIds").value:c.get("roleId").value)?null:{required:!0}}hideShiftItem(e){var m,u;let r=this.form.get("rolesData").value,c=this.form.get("preferencedRoles").value,o=[];for(let _ of r){let y=Number(e.get("id").value),N=(m=_.shiftIds)==null?void 0:m.some(T=>Number(T)===y);if((u=_.shiftIds)!=null&&u.length){let T;this.volunteerInfo.allowMoreThan1Role?T=c.some(C=>Number(C.roleIds)===Number(_.id)):T=c.some(C=>Number(C.roleId)===Number(_.id)),N&&T?o.push(!0):N&&o.push(!1)}}return o.length>0?o.some(_=>_):!0}atLeastOneCheckedValidator(){return e=>e.controls.some(c=>c.get("checked").value)?null:{required:!0}}buildCustomForm(e){return this.niFormService.buildForm(e)}onFormSubmit(){var o,m,u,_,y,N,T;(o=this.volunteerInfo)!=null&&o.rolesEnabled&&(this.form.get("preferencedRoles").setValidators(this.atLeastOneCheckedInPreferencedRolesValidator()),this.form.get("preferencedRoles").updateValueAndValidity());let e=[],r=[];if(this.customForm&&((m=this.customForm)!=null&&m.getRawValue())){let C=this.customForm.getRawValue();r=Object.keys(C).filter(E=>!E.includes("description")).map(E=>({fieldId:E,value:je(C[E])}))}if((u=this.volunteerInfo)!=null&&u.shiftsEnabled&&(this.form.get("eventShifts").setValidators(this.atLeastOneCheckedValidator()),this.form.get("eventShifts").updateValueAndValidity(),e=this.form.get("eventShifts").value.filter(E=>E.checked).map(E=>E.id)),this.form.valid&&((y=(_=this.volunteerInfo)==null?void 0:_.customFields)!=null&&y.length?this.customForm.valid:!0)){let C=ne(w(w({},this.volunteerInfo),this.form.getRawValue()),{shiftIds:e,customFieldVolunteerAnswers:r});if((N=this.volunteerInfo)!=null&&N.allowMoreThan1Role){let E=C.preferencedRoles.map(j=>(j.roleIds=j.roleIds?[j.roleIds]:[],j));C=ne(w({},C),{preferencedRoles:E})}this.preloaderService.preloaderSubject.next({show:!0,spinnerColor:"dark"}),this.disabledRegisterBtn=!0,this.isEditForm?this.submitForm("/api2/v1/events/".concat(this.eventId,"/event-volunteers/").concat(this.volunteerId),C,"put"):this.submitForm("/api2/v1/events/".concat(this.eventId,"/event-volunteers"),C,"post")}else{if(this.volunteerInfo.rolesEnabled&&this.volunteerInfo.allowMoreThan1Role&&(this.form.get("rolesData").setValidators(F.required),this.form.get("rolesData").updateValueAndValidity()),this.form.invalid){this.utils.validateForm({form:this.form});return}(T=this.volunteerInfo.customFields)!=null&&T.length&&this.customForm.invali
1d&&this.utils.validateForm({form:this.customForm})}}submitForm(e,r,c){(c==="put"?this.http.putReq({url:e,body:r}):this.http.postReq({url:e,body:r})).pipe(L(()=>{this.preloaderService.preloaderSubject.next(!1),this.disabledRegisterBtn=!1})).subscribe(()=>{this.isEditForm?this.router.navigate(["../../"],{relativeTo:this.route}):this.router.navigate(["../"],{relativeTo:this.route})})}getClothesLookups(e){this.http.getReq({url:"/api/v1/lookups/shoe-sizes?gender=".concat(e)}).subscribe(r=>{this.shoeSizeArr=r.body}),this.http.getReq({url:"/api/v1/lookups/short-sizes?gender=".concat(e)}).subscribe(r=>{this.shortSizeArr=r.body})}buildForm(e){let r=(e==null?void 0:e.shiftIds)||[],c=this.fb.array([]);((e==null?void 0:e.eventShifts)||[]).forEach(o=>{let m=r.includes(o.id),u=this.fb.group({name:[(o==null?void 0:o.name)||""],id:[o==null?void 0:o.id],eventId:[o==null?void 0:o.eventId],createAccountId:[o==null?void 0:o.createAccountId],checked:[m]});c.push(u)}),this.form=this.fb.group({firstName:[(e==null?void 0:e.firstName)||"",F.required],lastName:[(e==null?void 0:e.lastName)||"",F.required],gender:[(e==null?void 0:e.gender)||"",F.required],birthDate:[(e==null?void 0:e.birthDate)||""],email:[(e==null?void 0:e.email)||"",[F.required,F.pattern($e),F.pattern(Ge),F.maxLength(200)]],age:[(e==null?void 0:e.age)||null],clientSubmitTimeTicks:[(e==null?void 0:e.clientSubmitTimeTicks)||null],waiverRequired:[(e==null?void 0:e.waiverRequired)||!1],waiver:[(e==null?void 0:e.waiver)||null],clientTimeZoneName:[(e==null?void 0:e.clientTimeZoneName)||null],waiverSignatureImgBase64:[(e==null?void 0:e.waiverSignatureImgBase64)||null],shiftIds:[(e==null?void 0:e.shiftIds)||[]],eventShifts:c,preferencedRoles:this.fb.array((e.preferencedRoles||[]).map(o=>{var m;return this.fb.group({preferenceId:[o==null?void 0:o.preferenceId],preferenceTitle:[o==null?void 0:o.preferenceTitle],roleId:[o==null?void 0:o.roleId],roleIds:[(m=o==null?void 0:o.roleIds)!=null&&m.length?o==null?void 0:o.roleIds[0]:null]})})),rolesData:this.fb.array((e.rolesData||[]).map(o=>this.fb.group({id:[o==null?void 0:o.id],eventId:[o==null?void 0:o.eventId],name:[(o==null?void 0:o.name)||""],description:[(o==null?void 0:o.description)||""],position:[(o==null?void 0:o.position)||0],createAccountId:[o==null?void 0:o.createAccountId],roleCount:[(o==null?void 0:o.roleCount)||0],disabled:[(o==null?void 0:o.disabled)||!1],shiftIds:[o==null?void 0:o.shiftIds],registrationLimit:[o==null?void 0:o.registrationLimit]}))),instagram:[(e==null?void 0:e.instagram)||null],note:[(e==null?void 0:e.note)||null],agreed:[(e==null?void 0:e.agreed)||!1],whatsapp:[(e==null?void 0:e.whatsapp)||null],shirtSize:[(e==null?void 0:e.shirtSize)||null],phone:[(e==null?void 0:e.phone)||null],shortSize:[(e==null?void 0:e.shortSize)||null],shoeSize:[(e==null?void 0:e.shoeSize)||null]}),this.form.get("gender").valueChanges.subscribe(o=>{this.form.get("shortSize").setValue(null),this.form.get("shoeSize").setValue(null),this.getClothesLookups(o)})}};a.\u0275fac=function(r){return new(r||a)(S(he),S(fe),S(ue),S(Fe),S(de),S(qe),S(ce),S(me),S(H))},a.\u0275cmp=D({type:a,selectors:[["app-registration-form"]],standalone:!1,decls:21,vars:14,consts:[[1,"breadcrumbs","fixed_header"],[1,"d-flex"],[3,"href"],[1,"material-icons"],[1,""],[1,"mat-components-container"],["class","form-container m-0",3,"formGroup","ngSubmit",4,"ngIf"],[1,"form-container","m-0",3,"ngSubmit","formGroup"],[1,"form-group"],[1,"cc-admin-input-label","cc-admin-mb--8px"],[1,"text-danger"],["appearance","fill",1,"cc-admin-material-input-wrapper"],["type","text","formControlName","firstName","name","firstName","matInput","",1,"cc-admin-text-input","cc-admin-text-primary-color--black",3,"placeholder"],["class","cc-admin-input-error cc-admin-mt--8px",4,"ngIf"],["type","text","formControlName","lastName","name","lastName","matInput","",1,"cc-admin-text-input","cc-admin-text-primary-color--black",3,"placeholder"],[1,"form-group","d-flex","flex-column","mat-components-container"],["formControlName","gender",1,"cc-admin-gap--24px","cc-admin-mr--0px","cc-admin-pb--0px"],["color","primary",1,"cc-admin-material-radio-wrapper","mr-3","cc-admin-mr--0px","mat-primary",3,"value"],["color","primary",1,"cc-admin-material-radio-wrapper","cc-admin-mr--0px","mat-primary",3,"value"],["style","color: #f44336;font-size: 12px;padding-left: 11px;",4,"ngIf"],[4,"ngIf"],["type","text","formControlName","email","name","email","matInput","",1,"cc-admin-text-input","cc-admin-text-primary-color--black",3,"placeholder"],[1,"form-group","phone-field","mb-2"],[3,"form","data","field"],["style","color: #f44336;font-size: 10px;padding-left: 11px;position: absolute;bottom: 11px;",4,"ngIf"],["type","text","formControlName","note","name","note","matInput","",1,"cc-admin-textarea",2,"box-sizing","inherit",3,"placeholder"],["class","form-group",4,"ngIf"],["class","form-group mb-5",4,"ngIf"],[1,"fieldset--action-row","fieldset"],[1,"d-flex","justify-content-between",2,"width","530px"],["type","button",1,"cc-admin-btn-text","cc-admin-button--small","cc-admin-button--bordered","cc-admin-text-primary-color--black","cc-admin-bg-transparent",3,"href"],["type","submit",1,"cc-admin-btn-text","cc-admin-button--small","cc-admin-text-primary-color--white","cc-admin-bg-primary-color--green",3,"disabled"],[1,"cc-admin-input-error","cc-admin-mt--8px"],[2,"color","#f44336","font-size","12px","padding-left","11px"],[3,"fieldKey","parentForm","required"],["appearance","fill",1,"cc-admin-ng-select-wrapper"],["placeholder","Please Select","formControlName","shirt
1Size",1,""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["placeholder","Please Select","formControlName","shoeSize"],["placeholder","Please Select","formControlName","shortSize"],[2,"color","#f44336","font-size","10px","padding-left","11px","position","absolute","bottom","11px"],["type","text","formControlName","instagram","matInput","","name","instagram","placeholder","@username",1,"cc-admin-text-input","cc-admin-text-primary-color--black"],["type","text","formControlName","whatsapp","matInput","","name","whatsapp","placeholder","Whatsapp #",1,"cc-admin-text-input","cc-admin-text-primary-color--black"],[1,"cc-admin-input-label","cc-admin-mb--8px",2,"font-size","16px"],["formArrayName","preferencedRoles"],[3,"formGroupName",4,"ngFor","ngForOf"],["class","required-text",4,"ngIf"],[3,"formGroupName"],[1,"mt-3","cc-admin-input-sup-message-large","cc-admin-mb--8px",2,"color","#616161"],["placeholder","Please Select",3,"multiple","formControlName"],[3,"disabled","value",4,"ngFor","ngForOf"],[3,"disabled","value"],[4,"ngFor","ngForOf"],[1,"p-2","selectDescription"],[1,"required-text"],[1,"form-group","mb-5"],["formArrayName","eventShifts"],["class","d-flex align-items-center mb-2",3,"formGroupName",4,"ngIf"],[1,"d-flex","align-items-center","mb-2",3,"formGroupName"],["type","checkbox","formControlName","checked",1,"checkbox"],[2,"color","black","margin-left","25px"],[3,"volunteerInfo","formFields","customForm"]],template:function(r,c){r&1&&(l(0,"div",0)(1,"div",1)(2,"a",2)(3,"h4"),d(4),f(5,"translate"),s()(),l(6,"em",3),d(7,"keyboard_arrow_right"),s(),l(8,"a",2)(9,"h4"),d(10),f(11,"translate"),s()(),l(12,"em",3),d(13,"keyboard_arrow_right"),s(),l(14,"h4"),d(15),f(16,"translate"),s()(),b(17,"app-event-timer"),s(),l(18,"div",4)(19,"div",5),v(20,Lt,76,65,"form",6),s()()),r&2&&(n(2),W("href","/admin.aspx/Event/",c.eventId,"/VolunteerSettings",G),n(2),I(h(5,8,"VolunteersListComponent.Volunteers")),n(4),W("href","/admin.aspx/Event/",c.eventId,"/VolunteersList",G),n(2),I(h(11,10,"VolunteersListComponent.Volunteers List")),n(5),I(h(16,12,"VolunteersListComponent.Volunteer Profile")),n(5),p("ngIf",c.form))},dependencies:[Y,O,z,ge,ve,Q,A,P,Z,_e,xe,be,X,Ce,Te,Ne,te,ee,Be,Re,Ye,Je,J],styles:["fieldset{max-width:530px!important} .mat-components-container .mat-mdc-form-field .mat-mdc-form-field-infix{padding:0!important} .mat-select-arrow-wrapper{height:4px!important} .mat-mdc-form-field{width:100%!important} .mat-mdc-form-field .mat-mdc-text-field-wrapper{background-color:#fff!important} .description-fields{margin-bottom:0!important;position:relative;top:-13px} .mat-components-container .mat-radio-group{margin-top:0!important} .mat-components-container .form-group label, .mat-components-container .form-group>labe{margin-top:0!important} .mat-radio-label{display:flex!important} .mat-mdc-form-field{width:100%} .mdc-line-ripple{display:none!important} .fieldset.fieldset--action-row{padding:8px 0 0 80px!important} form .form-group{margin-bottom:32px!important} .mat-form-field-wrapper{padding-bottom:0!important} input[type=checkbox]{position:absolute;left:0!important} .mat-primary .mat-pseudo-checkbox-checked{background:#00f!important} .mat-primary .mat-option.mat-selected:not(.mat-option-disabled){color:#00f!important} .mat-pseudo-checkbox-checked:after{width:10px!important;height:5px!important} .tel-number-field .mat-mdc-form-field{width:100%!important} .mat-form-field-appearance-fill .mat-mdc-form-field-flex{background-color:#fff!important;color:#000!important} body{padding-left:0!important;background-color:#f5f5f5!important}.checkbox[_ngcontent-%COMP%]{width:17px;cursor:pointer;height:17px;margin-top:0}.required-text[_ngcontent-%COMP%]{color:#f44336;font-size:12px;padding-left:11px}.selectDescription[_ngcontent-%COMP%]{background-color:#fafafa;border:1px solid #e0e0e0;position:relative;top:4px}mat-checkbox[_ngcontent-%COMP%]{color:#212121;font-size:16px;font-weight:500;letter-spacing:.15px;line-height:28px}mat-checkbox[_ngcontent-%COMP%] .mat-mdc-checkbox__layout{white-space:unset}mat-checkbox[_ngcontent-%COMP%] .mat-mdc-checkbox__background{margin-top:6px;margin-right:16px}mat-checkbox[_ngcontent-%COMP%] .mat-mdc-checkbox__label{color:#212121;font-size:16px;font-weight:500;letter-spacing:.15px;line-height:27px}"]});let t=a;return t})();var $t=[{path:"",component:ae},{path:":volunteerId",component:ae}],Qe=(()=>{let a=class a{};a.\u0275fac=function(r){return new(r||a)},a.\u0275mod=K({type:a}),a.\u0275inj=$({imports:[oe.forChild($t),oe]});let t=a;return t})();var Di=(()=>{let a=class a{};a.\u0275fac=function(r){return new(r||a)},a.\u0275mod=K({type:a}),a.\u0275inj=$({providers:[De()],imports:[se,Qe,Ie,Se,we,pe,ke,Ae,Ee,Me,ze]});let t=a;return t})();export{Di as VolunteerRegistrationFormModule};
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.