-
Notifications
You must be signed in to change notification settings - Fork 0
/
12-es5.24dcaabb809e1a711a58.js
1 lines (1 loc) · 8.15 KB
/
12-es5.24dcaabb809e1a711a58.js
1
!function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{kJmD:function(n,o,r){"use strict";r.r(o),r.d(o,"BookingEventPageModule",(function(){return E}));var i,a,s,c=r("UKGz"),u=r("pMoy"),l=r("SVse"),b=r("s7LF"),d=r("sZkV"),v=r("iInd"),m=r("mrSG"),h=r("LRne"),p=r("aDUK"),f=r("jp9Y"),g=r("mEpY"),k=r("8Y7J"),y=r("t0hA"),P=r("Y+pZ"),C=r("f2/v"),w=[{path:"",component:(i=function(){function n(t,o,r,i,a,s){var c=this;e(this,n),this.formBuilder=t,this.modalController=o,this.activatedRoute=r,this.router=i,this.toastController=a,this.bookingService=s,this.selectedEventUUID="",this.selectedEventName="",this.selectedEventCapacity=40,this.currentPersonBookingCount=Object(h.a)(0),r.queryParams.subscribe((function(e){var t=i.getCurrentNavigation();if(null!==t&&void 0!==t.extras.state){var n=t.extras.state,o=n.randomUUID,r=n.eventName,a=n.eventCapacity;c.selectedEventUUID=o,c.selectedEventName=r,c.selectedEventCapacity=a,c.currentPersonBookingCount=c.getLatestPersonAttendeeCountForSelectedEvent(o,s)}else i.navigate(["/"]).then((function(e){})).catch((function(e){}))}))}var o,r,i;return o=n,(r=[{key:"getCreatedNewResetForm",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.formBuilder;return e.group(f.a.createPersonForm())}},{key:"ngOnInit",value:function(){var e=this.getCreatedNewResetForm(this.formBuilder);this.personForm=e,this.personForm.valueChanges.subscribe((function(e){}))}},{key:"clickPrefill",value:function(e){this.prefillFormWithLastPerson(this.personForm)}},{key:"prefillFormWithLastPerson",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.personForm,t=Object(p.d)(),n=t.personFormAutofillLast;e.patchValue(n)}},{key:"getLatestPersonAttendeeCountForSelectedEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectedEventUUID,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bookingService;return t.getLatestPersonCountForEventUUID(e)}},{key:"onSubmitForm",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.selectedEventUUID,r=(arguments.length>3&&void 0!==arguments[3]||this.modalController,arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.personForm),i=(arguments.length>5&&void 0!==arguments[5]||this.bookingService,r.value);e.control.setErrors({invalid:"Saving form..."});var a=this.presentModal();a.then((function(e){return Object(m.a)(n,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a);case 1:case"end":return e.stop()}}),e)})))})).then((function(e){return Object(m.a)(n,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.onDidDismiss());case 1:case"end":return t.stop()}}),t)})))})).then((function(e){e.data.isDeclarationChecked&&n.submitSaveBookSeat(o,i)})).catch((function(e){}))}},{key:"submitSaveBookSeat",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.bookingService;o.bookPersonByEventUUID(e,t).subscribe((function(o){var r,i=o.errors,a=o.data;if(void 0!==i||(null==i?void 0:i.length)>0||void 0===(null===(r=a.insert_Person_one)||void 0===r?void 0:r.personFirstName))return console.error("Failed to save"),void n.presentToast("Unable to book. \ud83d\udea7").then((function(){})).catch((function(){}));var s=a.insert_Person_one,c=Object.assign({selectedEventUUID:e},t),u=JSON.stringify(s),l=JSON.stringify(c);console.log("BookingEventPage:: -> ngOnInit -> returnedPersonSuccessLocalStorageText personFormSubmissionLocalStorageText",u,l),localStorage.setItem(p.a,u),localStorage.setItem(p.b,l),n.presentToast("\ud83d\udd16\ud83d\udcd1Booking successful \ud83d\udcbe\ud83e\uddfe\ud83d\udcdd\ud83d\udcda\ud83d\udcd7\ud83d\udcd6").then((function(){})).catch((function(){})),n.personForm=n.getCreatedNewResetForm()}))}},{key:"presentToast",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Loading... \ud83d\udd03",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.toastController;return Object(m.a)(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.create({message:e,duration:4e3,animated:!0,translucent:!0});case 2:return n.abrupt("return",n.sent.present().then((function(){})));case 3:case"end":return n.stop()}}),n)})))}},{key:"presentModal",value:function(){return Object(m.a)(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.modalController.create({component:g.a,cssClass:"modal-custom-class",componentProps:{isDeclarationChecked:!1},swipeToClose:!0,animated:!0,backdropDismiss:!0});case 2:return t=e.sent,e.abrupt("return",t.present().then((function(){return t})));case 4:case"end":return e.stop()}}),e,this)})))}}])&&t(o.prototype,r),i&&t(o,i),n}(),i.\u0275fac=function(e){return new(e||i)(k.Jb(b.c),k.Jb(d.J),k.Jb(v.a),k.Jb(v.g),k.Jb(d.M),k.Jb(y.a))},i.\u0275cmp=k.Db({type:i,selectors:[["app-booking-event"]],decls:34,vars:8,consts:[[3,"translucent"],["pageTitle","Book seat"],[3,"formGroup","ngSubmit"],["f","ngForm"],["isEventElseVenue","true",3,"formGroup","selectedEventName","currentPersonBookingCount","selectedEventCapacity"],[2,"font-weight","bold"],["size","large","name","log-in-outline","aria-label","log in outline",2,"margin-left","-0.15em","vertical-align","middle"],["type","submit","color","cobaltblue",3,"disabled"],["name","person-add-outline"],["type","submit","mat-button","","color","primary","hidden","",3,"disabled"],["name","document-text"],["horizontal","start","vertical","bottom","slot","fixed","size","large"],["color","cobaltbluemonochrome",3,"click"],["name","arrow-redo-circle-outline","size","large"]],template:function(e,t){if(1&e){var n=k.Qb();k.Pb(0,"ion-header",0),k.Kb(1,"app-custom-header",1),k.Ob(),k.Pb(2,"ion-content"),k.Pb(3,"form",2,3),k.Xb("ngSubmit",(function(e){k.mc(n);var o=k.lc(4);return t.onSubmitForm(o,e)})),k.Kb(5,"app-person-booking-form",4),k.Pb(6,"ion-row"),k.Pb(7,"ion-col"),k.Pb(8,"div",5),k.rc(9," This confirms your booking. "),k.Kb(10,"br"),k.rc(11," \u8fd9\u786e\u8ba4\u60a8\u7684\u9884\u8ba2\u3002 "),k.Kb(12,"br"),k.rc(13," Please remember to check in when you arrive on the day. "),k.Kb(14,"br"),k.rc(15," \u5f53\u5929\u62b5\u8fbe\u65f6\u8bf7\u8bb0\u5f97\u529e\u7406\u7b7e\u5230\u624b\u7eed\u3002 "),k.Kb(16,"br"),k.rc(17," Scan the door QR code or click the green button to open the check-in page "),k.Kb(18,"ion-icon",6),k.Kb(19,"br"),k.rc(20," \u626b\u63cf\u95e8\u7684QR\u7801\u6216\u70b9\u51fb\u7eff\u8272\u6309\u94ae\u4ee5\u6253\u5f00\u7b7e\u5230\u9875\u9762 "),k.Kb(21,"ion-icon",6),k.Ob(),k.Ob(),k.Ob(),k.Pb(22,"ion-row"),k.Pb(23,"ion-col"),k.Pb(24,"div"),k.Pb(25,"ion-button",7),k.Kb(26,"ion-icon",8),k.rc(27," Book seat \ud83d\udcba\ud83d\udcdc "),k.Ob(),k.Pb(28,"button",9),k.Kb(29,"ion-icon",10),k.rc(30," \ud83d\udcba (enter) "),k.Ob(),k.Ob(),k.Ob(),k.Ob(),k.Ob(),k.Ob(),k.Pb(31,"ion-fab",11),k.Pb(32,"ion-fab-button",12),k.Xb("click",(function(e){return t.clickPrefill(e)})),k.Kb(33,"ion-icon",13),k.Ob(),k.Ob()}2&e&&(k.hc("translucent",!0),k.zb(3),k.hc("formGroup",t.personForm),k.zb(2),k.hc("formGroup",t.personForm)("selectedEventName",t.selectedEventName)("currentPersonBookingCount",t.currentPersonBookingCount)("selectedEventCapacity",t.selectedEventCapacity),k.zb(20),k.hc("disabled",t.personForm.invalid),k.zb(3),k.hc("disabled",t.personForm.invalid))},directives:[d.o,P.a,d.k,b.p,b.l,b.f,C.a,d.B,d.j,d.p,d.e,d.l,d.m],styles:[""]}),i)}],F=((s=function t(){e(this,t)}).\u0275mod=k.Hb({type:s}),s.\u0275inj=k.Gb({factory:function(e){return new(e||s)},imports:[[v.i.forChild(w)],v.i]}),s),E=((a=function t(){e(this,t)}).\u0275mod=k.Hb({type:a}),a.\u0275inj=k.Gb({factory:function(e){return new(e||a)},imports:[[l.c,b.g,b.m,d.H,c.a,u.b,F]]}),a)}}])}();