(self.webpackChunkapp=self.webpackChunkapp||[]).push([[3929],{63929:(Z,D,o)=>{o.r(D),o.d(D,{CreateEventEventShareStepPageModule:()=>U});var j=o(61380),H=o(69270),C=o(15861),y=o(92340),L=o(47423),$=o(24889),N=o(64633),e=o(45449),k=o(89102),c=o(47898),z=o(27317),p=o(90603),G=o(14690),B=o(80698),X=o(99826);const w=[{path:"",component:(()=>{class l{constructor(t,i,a,M,T,S,E,h,f,P,g,_,O,u,v,A,x,b,I){var s=this;this.socialSharing=t,this.navigationService=i,this.createEventService=a,this.calendar=M,this.modalController=T,this.profileManagerService=S,this.momentService=E,this.clipboardService=h,this.notificatorService=f,this.permissionsAndroidService=P,this.modalPermissionService=g,this.platform=_,this.androidPermissions=O,this.logService=u,this.resumeCreateEventInterruptedService=v,this.translateConfigService=A,this.socialSharingService=x,this.sessionaddflowService=b,this.router=I,this.existPendings=!1,this.navigateToQRCode=()=>{this.navigationService.root(["/home"])},this.navigateToPendingLiberations=()=>{this.navigationService.forward(["/push-notifications"])},this.shareSuccessResponse=n=>{console.log("shareSuccessResponse"),console.log("response:",n)},this.shareErrorResponse=n=>{console.log("shareErrorResponse"),console.log("error:",n)},this.verifyIsAllGuestsHaveEmail=()=>{const n=this.createEventService.getGuests();n.find(d=>!d.email)?this.openUpdateUserEmailModal(n):this.addToCalendar()},this.openUpdateUserEmailModal=function(){var n=(0,C.Z)(function*(r){r=r.filter(m=>!m.email);const d=yield s.modalController.create({component:$.I1,componentProps:{guests:r}});d.onDidDismiss().then(s.onModalDismissCallback),yield d.present()});return function(r){return n.apply(this,arguments)}}(),this.onModalDismissCallback=n=>{console.log("onModalDismissCallback detail:",n),n&&n.data&&(this.updateGuestsData(n.data.guests),n.data.share&&this.addToCalendar())},this.updateGuestsData=n=>{let r=this.createEventService.getGuests();r=r.map(d=>n.find(V=>V.id===d.id)||d),this.createEventService.setGuests(r)},this.addToCalendar=(0,C.Z)(function*(){(yield s.haspermissionCalendar())?s.addToCalendarComponsed():s.modalPermissionService.openModal({permission:"CALENDAR"}).then(r=>{r?s.requestPermissionCalendarAndContact().then((0,C.Z)(function*(){yield s.haspermissionCalendar(),s.addToCalendarComponsed()})):s.logService.logError("permissionModal::addToCalendarPageSharedStep","","modal-permission-rejected")})}),this.addToCalendarSuccessResponse=n=>{console.log("addToCalendarSuccessResponse:",n)},this.addToCalendarErrorResponse=n=>{console.log("addToCalendarErrorResponse:",n)},this.doCopyLink=()=>{const n=y.N.wc_url,r=this.createEventService.getLocator();this.clipboardService.copy("https://"+n+"/?l="+r).then(()=>{const m={message:"",title:this.translateConfigService.translate("PG_CREATE_TOAST_COPY_LINK"),type:"success",timeout:3e3};this.notificatorService.notify(m)})},this.exit=()=>{this.createEventService.clearCreateEventData(),this.resumeCreateEventInterruptedService.clearProfileVoCreationInterrupte(),this.resumeCreateEventInterruptedService.clearResumeCreationInterrupte(),this.navigationService.root(["/home"])},this.sessionaddflowService.clearSessionId()}ngOnInit(){this.event=this.router.getCurrentNavigation().extras?.state?.event}ionViewDidEnter(){}ionViewDidLeave(){}doShare(){var t=this;return(0,C.Z)(function*(){const i=t.profileManagerService.getProfile(),a=t.profileManagerService.getProfile(),M=t.createEventService.getLocator(),T=t.createEventService.getCheckInStartAt(),S=y.N.wc_url,E=t.createEventService.getTitle(),h=a.company&&a.company.name?a.company.name:"",f="https://"+S+"/?l="+M,P=t.momentService.formatAsEventAt(t.createEventService.getStartDate()),g=i.company.address,u=(t.translateConfigService.translate("SHARE_EVENT_SUBJECT"),t.mensageShared(E,h,P,g,f,T,"OTHERS"),yield t.modalController.create({component:N.sq,componentProps:{event:t.event,page:"event-share-step"},cssClass:"modal-share"}));yield u.present(),yield u.onDidDismiss()})()}addToCalendarComponsed(){var t=this;return(0,C.Z)(function*(){const i=t.profileManagerService.getProfile(),h=(t.createEventService.getTitle(),new Date(t.createEventService.getStartDate()),new Date(t.createEventService.getEndDate()),"https://"+y.N.wc_url+"/?l="+t.createEventService.getLocator()),f=i.company.address,P=t.createEventService.getCheckInStartAt(),g=t.profileManagerService.getProfile(),_=t.createEventService.getTitle(),O=g.company&&g.company.name?g.company.name:"",u=t.momentService.formatAsEventAt(t.createEventService.getStartDate()),v=[];if(t.createEventService.getHosts().forEach(m=>{v.push(m.email)}),t.createEventService.getGuests().forEach(m=>{v.push(m.email)}),!t.mensageShared(_,O,u,f,h,P,"CALENDAR"))return;if("android"===L.dV.getPlatform())return void t.socialSharingService.shareEvent(t.event,"CALENDAR","event-share-step");const n=yield t.modalController.create({component:N.sq,componentProps:{event:t.event,page:"event-share-step",calendar:!0},cssClass:"modal-share"});yield n.present(),yield n.onDidDismiss()})()}haspermissionCalendar(){var t=this;return(0,C.Z)(function*(){const i=t.platform.is("cordova")?yield t.permissionsAndroidService.hasPermission("READ_CALENDAR"):{hasPermission:!0},a=t.platform.is("cordova")?yield t.permissionsAndroidService.hasPermission("WRITE_CALENDAR"):{hasPermission:!0};return!(!i.hasPermission||!a.hasPermission)})()}requestPermissionCalendarAndContact(){var t=this;return(0,C.Z)(function*(){const i=[t.androidPermissions.PERMISSION.READ_CALENDAR,t.androidPermissions.PERMISSION.WRITE_CALENDAR];return!!(yield t.permissionsAndroidService.multRequestPermissions(i)).hasPermission})()}mensageShared(t,i,a,M,T,S,E){const h=this.translateConfigService.translate("SHARE_TEXT_1"),f=this.translateConfigService.translate("SHARE_TEXT_2"),P=this.translateConfigService.translate("SHARE_TEXT_3"),g=this.translateConfigService.translate("SHARE_TEXT_4"),_=this.translateConfigService.translate("SHARE_TEXT_5"),O=this.translateConfigService.translate("SHARE_TEXT_6"),u=this.translateConfigService.translate("SHARE_TEXT_7"),v=this.translateConfigService.translate("SHARE_TEXT_8"),A=`${h} "${t}" ${f} ${i}`,I=`${_} ${T} ${O} ${S} ${u}`;let s="";return"OTHERS"===E?(s=`${A}, ${P} ${a}, ${g} ${M}.\n\n${I}\n\n${v}`,s):(s=`${A}, ${I}\n\n${v}`,s)}}return l.\u0275fac=function(t){return new(t||l)(e.\u0275\u0275directiveInject(k.e),e.\u0275\u0275directiveInject(c.f5),e.\u0275\u0275directiveInject(c.jc),e.\u0275\u0275directiveInject(z.f),e.\u0275\u0275directiveInject(p.ModalController),e.\u0275\u0275directiveInject(c.v4),e.\u0275\u0275directiveInject(c.EM),e.\u0275\u0275directiveInject(c.Yv),e.\u0275\u0275directiveInject(c.V6),e.\u0275\u0275directiveInject(c.YY),e.\u0275\u0275directiveInject(c.JQ),e.\u0275\u0275directiveInject(p.Platform),e.\u0275\u0275directiveInject(G.r),e.\u0275\u0275directiveInject(c.$V),e.\u0275\u0275directiveInject(c.NL),e.\u0275\u0275directiveInject(c.wK),e.\u0275\u0275directiveInject(c.iX),e.\u0275\u0275directiveInject(B.t),e.\u0275\u0275directiveInject(j.Router))},l.\u0275cmp=e.\u0275\u0275defineComponent({type:l,selectors:[["app-create-event-event-share-step"]],decls:31,vars:18,consts:[["mode","ios"],["slot","start","margin-start","1"],["src","../../assets/toolbar-logo.png"],[1,"centralized-content"],[1,"page-title"],["tabindex","1",1,"title"],[1,"sub-title",3,"innerHTML"],[1,"actions"],[1,"add-to-calendar-button-holder"],[3,"click"],[1,"share-button-holder"],[1,"exit-button-holder","button-holder"],[1,"back",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"ion-header",0)(1,"ion-toolbar",0)(2,"ion-buttons",1),e.\u0275\u0275element(3,"ion-img",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"ion-title"),e.\u0275\u0275text(5," KeyAccess "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(6,"ion-content")(7,"div",3)(8,"div",4)(9,"div",5),e.\u0275\u0275text(10),e.\u0275\u0275pipe(11,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(12,"div",6),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div",7)(15,"div",8)(16,"button",9),e.\u0275\u0275listener("click",function(){return i.verifyIsAllGuestsHaveEmail()}),e.\u0275\u0275text(17),e.\u0275\u0275pipe(18,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(19,"div",10)(20,"button",9),e.\u0275\u0275listener("click",function(){return i.doShare()}),e.\u0275\u0275text(21),e.\u0275\u0275pipe(22,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(23,"div",10)(24,"button",9),e.\u0275\u0275listener("click",function(){return i.doCopyLink()}),e.\u0275\u0275text(25),e.\u0275\u0275pipe(26,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(27,"div",11)(28,"button",12),e.\u0275\u0275listener("click",function(){return i.exit()}),e.\u0275\u0275text(29),e.\u0275\u0275pipe(30,"translate"),e.\u0275\u0275elementEnd()()()()()),2&t&&(e.\u0275\u0275advance(10),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(11,6,"PG_CREATE_SHARE_STEP_TEXT_TITLE")),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerHTML",e.\u0275\u0275pipeBind1(13,8,"PG_CREATE_SHARE_STEP_TEXT_SUBTITLE"),e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(18,10,"PG_CREATE_SHARE_STEP_BTN_CALENDAR")," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(22,12,"PG_CREATE_SHARE_STEP_BTN_SHARE_LINK")),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(26,14,"PG_CREATE_SHARE_STEP_BTN_COPY_LINK")," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(30,16,"PG_CREATE_SHARE_STEP_BTN_CLOSET")," "))},dependencies:[p.IonButtons,p.IonContent,p.IonHeader,p.IonImg,p.IonTitle,p.IonToolbar,X.X$],styles:["ion-toolbar[_ngcontent-%COMP%]{font-family:Nunito,sans-serif;--background: #fff;padding-inline:16px}ion-toolbar[_ngcontent-%COMP%] ion-img[_ngcontent-%COMP%]{height:25px;width:25px}ion-toolbar[_ngcontent-%COMP%] ion-title[_ngcontent-%COMP%]{letter-spacing:1px}ion-toolbar[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:24px;padding:0;width:24px;margin:0;font-size:19px;color:#656768}ion-toolbar[_ngcontent-%COMP%] ion-button.hover[_ngcontent-%COMP%]{background:#fff}.centralized-content[_ngcontent-%COMP%]{height:calc(100vh - 56px);display:flex;justify-content:center;align-items:center;flex-direction:column}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%]{margin-top:24px;margin-bottom:32px}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:initial!important;font-weight:700;text-align:center}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%] .sub-title[_ngcontent-%COMP%]{text-align:center;color:#656768;font-size:.9em;margin-top:4px;padding:0 8px}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;width:100%;flex-direction:column;align-items:center;justify-content:center}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-button-holder[_ngcontent-%COMP%]{text-align:center;margin-top:1em}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.75em 1.5em;border-radius:50px;background-color:#0ec254;color:#fff;font-size:1em;transition:background-color .1s ease-out}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active{background-color:#fff;color:#0ec254;transition:background-color .1s ease-out}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .share-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus{outline:none}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .add-to-calendar-button-holder[_ngcontent-%COMP%]{text-align:center;margin-top:3em}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .add-to-calendar-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.75em 1.5em;border-radius:50px;background-color:#0ec254;color:#fff;font-size:1em;transition:background-color .1s ease-out}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .add-to-calendar-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active{background-color:#fff;color:#0ec254;transition:background-color .1s ease-out}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .add-to-calendar-button-holder[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus{outline:none}.centralized-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] .button-holder[_ngcontent-%COMP%]{justify-content:center}.pulsate-fwd[_ngcontent-%COMP%]{animation:pulsate-fwd .5s ease-in-out infinite both;outline:none}@keyframes pulsate-fwd{0%{transform:scale(1)}50%{transform:scale(1.5)}to{transform:scale(1)}}"]}),l})()}];let U=(()=>{class l{}return l.\u0275fac=function(t){return new(t||l)},l.\u0275mod=e.\u0275\u0275defineNgModule({type:l}),l.\u0275inj=e.\u0275\u0275defineInjector({imports:[H.I,j.RouterModule.forChild(w)]}),l})()}}]);