Files
doneit-web/.angular/cache/14.2.12/babel-webpack/18a239dd2745fa7d4d0a06853c0b2a79.json
T
Eudes Inácio 53b71ea16f its working
2023-06-30 09:54:21 +01:00

1 line
33 KiB
JSON

{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./profile.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./profile.page.scss?ngResource\";\nimport { Component, NgZone } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { AnimationController, ModalController, Platform } from '@ionic/angular';\nimport { EditProfilePage } from './edit-profile/edit-profile.page';\nimport { StorageService } from '../../services/storage.service';\nimport { NotificationsService } from '../../services/notifications.service';\nimport { SessionStore } from 'src/app/store/session.service';\nimport { EventTrigger } from '../../services/eventTrigger.service';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { environment } from 'src/environments/environment';\nlet ProfilePage = class ProfilePage {\n constructor(modalController, animationController, router, storageservice, zone, platform, eventTriger, ThemeService, notificationService) {\n this.modalController = modalController;\n this.animationController = animationController;\n this.router = router;\n this.storageservice = storageservice;\n this.zone = zone;\n this.platform = platform;\n this.eventTriger = eventTriger;\n this.ThemeService = ThemeService;\n this.notificationService = notificationService;\n this.userLoginPreference = '';\n this.notificationdata = [];\n this.DataArray = [];\n this.isProfileOpen = false;\n this.hideImage = false;\n this.logoutOut = false;\n this.notificationStatus = '';\n this.environment = environment;\n this.SessionStore = SessionStore;\n this.notificatinsRoutes = (index, Service, Object, IdObject, FolderId) => {\n if (Service === \"agenda\" && IdObject.length > 10) {\n this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda']));\n } else if (Service === \"gabinete-digital\" && Object === \"expediente\") {\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', IdObject, 'gabinete-digital']));\n } else if (Service === \"agenda\" && Object === \"event-list\") {\n //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda']));\n this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', IdObject, 'agenda']));\n } else if (Service === \"gabinete-digital\" && Object === \"despachos\") {\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', IdObject, 'gabinete-digital'], {\n replaceUrl: true\n }));\n } else if (Service === \"gabinete-digital\" && Object === \"parecer\") {\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', IdObject, 'gabinete-digital']));\n } else if (Service === \"gabinete-digital\" && Object === \"deferimento\") {\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', IdObject, 'gabinete-digital']));\n } else if (Service === \"gabinete-digital\" && Object === \"despachos-pr\") {\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', IdObject, 'gabinete-digital']));\n } else if (Service === \"accoes\" && Object === \"accao\") {\n this.zone.run(() => this.router.navigate(['/home/publications', IdObject]));\n } else if (Service === \"accoes\" && Object === \"publicacao\") {\n this.zone.run(() => this.router.navigate(['/home/publications/view-publications', FolderId, IdObject]));\n } else if (Service === \"gabinete-digital\" && Object === \"diplomas\") {\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', IdObject, 'gabinete-digital']));\n } else if (Service === \"gabinete-digital\" && Object === \"diplomas-assinar\") {\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', IdObject, 'gabinete-digital']));\n } else if (Service === \"gabinete-digital\" && Object === \"expedientes-pr\") {\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', IdObject, 'gabinete-digital']));\n } else if (Service === \"chat\") {\n let navigationExtras = {\n queryParams: {\n \"roomId\": IdObject\n }\n };\n this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras));\n }\n // this.notificationservice.tempClearArray();\n this.deleteNotification(index);\n };\n router.events.subscribe(val => {\n this.isProfileOpen = false;\n this.logoutOut = true;\n });\n this.eventTriger.getObservable().subscribe(event => {\n if (event.notification == \"recive\") {\n this.getNotificationData();\n } else if (event.notification == \"deleted\") {\n console.log('header', event.notification);\n this.getNotificationData();\n }\n });\n this.notificationService.notificationReceived.subscribe(() => {\n this.getNotificationData();\n });\n setTimeout(() => {\n this.hideImage = true;\n }, 2000);\n }\n ngOnInit() {\n this.getNotificationData();\n }\n close() {\n this.modalController.dismiss();\n }\n notImplemented() {}\n asyncNotification() {}\n getNotificationData() {\n var _this = this;\n return _asyncToGenerator(function* () {\n //const keyExist = await this.storageservice.keyExist(\"Notifications\")\n //if(keyExist) {\n yield _this.storageservice.get(\"Notifications\").then(value => {\n _this.DataArray = [];\n value.forEach((element, i) => {\n let notificationObject;\n if (element.notification) {\n notificationObject = {\n index: i,\n title: element.notification.title,\n Service: element.data.Service,\n Object: element.data.Object,\n IdObject: element.data.IdObject,\n FolderId: element.data.FolderId,\n body: element.notification.body,\n dateInit: _this.getFormatedTime(element.data.dateInit),\n dateEnd: _this.getFormatedTime(element.data.dateEnd),\n Location: element.data.Location,\n TypeAgenda: element.data.TypeAgenda,\n Role: element.data.Role,\n Status: element.data.Status\n };\n } else if (element.data) {\n notificationObject = {\n index: i,\n title: element.title,\n Service: element.data.Service,\n Object: element.data.Object,\n IdObject: element.data.IdObject,\n FolderId: element.data.FolderId,\n body: element.body,\n dateInit: _this.getFormatedTime(element.data.dateInit),\n dateEnd: _this.getFormatedTime(element.data.dateEnd),\n Location: element.data.Location,\n TypeAgenda: element.data.TypeAgenda,\n Role: element.data.Role,\n Status: element.data.Status\n };\n } else {\n {\n notificationObject = {\n FolderId: element.FolderId,\n IdObject: element.IdObject,\n Location: element.Location,\n Object: element.Object,\n Role: element.Role,\n Service: element.Service,\n Status: element.Status,\n TypeAgenda: element.TypeAgenda,\n body: element.body,\n dateEnd: element.dateEnd,\n dateInit: element.dateInit,\n index: element.index,\n title: element.title\n };\n }\n }\n _this.DataArray.push(notificationObject);\n });\n _this.notificationdata = _this.DataArray;\n }).catch(error => {\n console.error('storage getnotification: ', error);\n });\n // }\n })();\n }\n\n getFormatedTime(dateString) {\n var date = new Date(dateString);\n var hours = date.getHours() /* > 12 ? date.getHours() - 12 : date.getHours() */;\n var am_pm = date.getHours() >= 12 ? \"pm\" : \"am\";\n var minutes = date.getMinutes() < 10 ? \"0\" + date.getMinutes() : date.getMinutes();\n let time = hours + \":\" + minutes /* + \" \" + am_pm */;\n return time;\n }\n deleteNotification(index) {\n this.notificationdata = this.notificationdata.filter(item => item.index != index);\n this.storageservice.store(\"Notifications\", this.notificationdata).then(store => {\n this.storageservice.get(\"Notifications\").then(value => {\n this.eventTriger.publishSomeData({\n notification: \"deleted\"\n });\n }).catch(error => {\n console.error('storage delete notification: ', error);\n });\n });\n }\n logout() {\n SessionStore.setInativity(false);\n SessionStore.setUrlBeforeInactivity(this.router.url);\n this.logoutOut == false;\n if (environment.production) {\n window.location.pathname = '/auth';\n } else {\n const pathBeforeGoOut = window.location.pathname;\n this.router.navigateByUrl('/auth', {\n replaceUrl: true\n });\n setTimeout(() => {\n if (this.logoutOut == false || pathBeforeGoOut == window.location.pathname) {\n window.location.pathname = '/auth';\n } else {}\n }, 500);\n }\n }\n editProfile() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n const enterAnimation = baseEl => {\n const backdropAnimation = _this2.animationController.create().addElement(baseEl.querySelector('ion-backdrop')).fromTo('opacity', '0.01', 'var(--backdrop-opacity)');\n const wrapperAnimation = _this2.animationController.create().addElement(baseEl.querySelector('.modal-wrapper')).keyframes([{\n offset: 0,\n opacity: '1',\n right: '-100%'\n }, {\n offset: 1,\n opacity: '1',\n right: '0px'\n }]);\n return _this2.animationController.create().addElement(baseEl).easing('ease-out').duration(500).addAnimation([backdropAnimation, wrapperAnimation]);\n };\n const leaveAnimation = baseEl => {\n return enterAnimation(baseEl).direction('reverse');\n };\n if (_this2.isProfileOpen == false) {\n _this2.isProfileOpen = true;\n const modal = yield _this2.modalController.create({\n component: EditProfilePage,\n cssClass: 'model profile-modal search-submodal',\n componentProps: {}\n });\n yield modal.present();\n modal.onDidDismiss().then(() => {\n _this2.isProfileOpen = false;\n });\n }\n })();\n }\n};\nProfilePage.ctorParameters = () => [{\n type: ModalController\n}, {\n type: AnimationController\n}, {\n type: Router\n}, {\n type: StorageService\n}, {\n type: NgZone\n}, {\n type: Platform\n}, {\n type: EventTrigger\n}, {\n type: ThemeService\n}, {\n type: NotificationsService\n}];\nProfilePage = __decorate([Component({\n selector: 'app-profile',\n template: __NG_CLI_RESOURCE__0,\n styles: [__NG_CLI_RESOURCE__1]\n})], ProfilePage);\nexport { ProfilePage };","map":{"version":3,"mappings":";;;;AAAA,SAASA,SAAS,EAAUC,MAAM,QAAQ,eAAe;AACzD,SAA2BC,MAAM,QAAQ,iBAAiB;AAC1D,SAASC,mBAAmB,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,gBAAgB;AAG/E,SAASC,eAAe,QAAQ,kCAAkC;AAClE,SAASC,cAAc,QAAQ,gCAAgC;AAC/D,SAASC,oBAAoB,QAAQ,sCAAsC;AAC3E,SAASC,YAAY,QAAQ,+BAA+B;AAC5D,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,WAAW,QAAQ,8BAA8B;AAOnD,IAAMC,WAAW,GAAjB,MAAMA,WAAW;EAoBtBC,YACUC,eAAgC,EAChCC,mBAAwC,EACxCC,MAAc,EACdC,cAA8B,EAC9BC,IAAY,EACZC,QAAkB,EAClBC,WAAyB,EAC1BV,YAA0B,EACzBW,mBAAyC;IARzC,oBAAe,GAAfP,eAAe;IACf,wBAAmB,GAAnBC,mBAAmB;IACnB,WAAM,GAANC,MAAM;IACN,mBAAc,GAAdC,cAAc;IACd,SAAI,GAAJC,IAAI;IACJ,aAAQ,GAARC,QAAQ;IACR,gBAAW,GAAXC,WAAW;IACZ,iBAAY,GAAZV,YAAY;IACX,wBAAmB,GAAnBW,mBAAmB;IA3B7B,wBAA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,CAACpE,IAAI,CAAC,MAAK;UAC7BgD,MAAI,CAAClE,aAAa,GAAG,KAAK;QAC5B,CAAC,CAAC;;IAEH;EACH;;;;;;;;;;;;;;;;;;;;;AAvSWzB,WAAW,eALvBb,SAAS,CAAC;EACT6H,QAAQ,EAAE,aAAa;EACvBC,8BAAkC;;CAEnC,CAAC,GACWjH,WAAW;SAAXA,WAAW","names":["Component","NgZone","Router","AnimationController","ModalController","Platform","EditProfilePage","StorageService","NotificationsService","SessionStore","EventTrigger","ThemeService","environment","ProfilePage","constructor","modalController","animationController","router","storageservice","zone","platform","eventTriger","notificationService","index","Service","Object","IdObject","FolderId","length","run","navigate","replaceUrl","navigationExtras","queryParams","deleteNotification","events","subscribe","val","isProfileOpen","logoutOut","getObservable","event","notification","getNotificationData","console","log","notificationReceived","setTimeout","hideImage","ngOnInit","close","dismiss","notImplemented","asyncNotification","_this","get","then","value","DataArray","forEach","element","i","notificationObject","title","data","body","dateInit","getFormatedTime","dateEnd","Location","TypeAgenda","Role","Status","push","notificationdata","catch","error","dateString","date","Date","hours","getHours","am_pm","minutes","getMinutes","time","filter","item","store","publishSomeData","logout","setInativity","setUrlBeforeInactivity","url","production","window","location","pathname","pathBeforeGoOut","navigateByUrl","editProfile","enterAnimation","baseEl","backdropAnimation","_this2","create","addElement","querySelector","fromTo","wrapperAnimation","keyframes","offset","opacity","right","easing","duration","addAnimation","leaveAnimation","direction","modal","component","cssClass","componentProps","present","onDidDismiss","selector","template"],"sourceRoot":"","sources":["C:\\Users\\eudes.inacio\\GabineteDigital\\gabinete-digital-fo\\src\\app\\modals\\profile\\profile.page.ts"],"sourcesContent":["import { Component, OnInit, NgZone } from '@angular/core';\r\nimport { NavigationExtras, Router } from '@angular/router';\r\nimport { AnimationController, ModalController, Platform } from '@ionic/angular';\r\nimport { LoginUserRespose } from 'src/app/models/user.model';\r\nimport { AuthService } from 'src/app/services/auth.service';\r\nimport { EditProfilePage } from './edit-profile/edit-profile.page';\r\nimport { StorageService } from '../../services/storage.service';\r\nimport { NotificationsService } from '../../services/notifications.service';\r\nimport { SessionStore } from 'src/app/store/session.service';\r\nimport { EventTrigger } from '../../services/eventTrigger.service';\r\nimport { ThemeService } from 'src/app/services/theme.service'\r\nimport { environment } from 'src/environments/environment';\r\n\r\n@Component({\r\n selector: 'app-profile',\r\n templateUrl: './profile.page.html',\r\n styleUrls: ['./profile.page.scss'],\r\n})\r\nexport class ProfilePage implements OnInit {\r\n\r\n userLoginPreference = ''\r\n notificationdata: any[] = [];\r\n DataArray: Array<Object> = [];\r\n\r\n service: \"agenda\";\r\n typeagenda: \"official\";\r\n typeagenda2: \"pessoal\";\r\n pr: \"100000014\";\r\n md: \"100000011\";\r\n date: \"60:20\";\r\n location: \"Gabinete\";\r\n isProfileOpen = false\r\n hideImage = false\r\n logoutOut = false\r\n notificationStatus = '';\r\n environment = environment\r\n\r\n SessionStore = SessionStore;\r\n constructor(\r\n private modalController: ModalController,\r\n private animationController: AnimationController,\r\n private router: Router,\r\n private storageservice: StorageService,\r\n private zone: NgZone,\r\n private platform: Platform,\r\n private eventTriger: EventTrigger,\r\n public ThemeService: ThemeService,\r\n private notificationService: NotificationsService\r\n ) {\r\n\r\n\r\n router.events.subscribe((val) => {\r\n this.isProfileOpen = false\r\n this.logoutOut = true\r\n });\r\n\r\n this.eventTriger.getObservable().subscribe((event) => {\r\n if (event.notification == \"recive\") {\r\n this.getNotificationData();\r\n } else if(event.notification == \"deleted\") {\r\n console.log('header', event.notification)\r\n this.getNotificationData();\r\n }\r\n });\r\n\r\n this.notificationService.notificationReceived.subscribe(() => {\r\n this.getNotificationData();\r\n });\r\n\r\n setTimeout(() => {\r\n this.hideImage = true\r\n }, 2000)\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this.getNotificationData();\r\n\r\n }\r\n\r\n\r\n close() {\r\n this.modalController.dismiss();\r\n }\r\n\r\n notImplemented() { }\r\n\r\n asyncNotification() { }\r\n\r\n async getNotificationData() {\r\n\r\n //const keyExist = await this.storageservice.keyExist(\"Notifications\")\r\n\r\n //if(keyExist) {\r\n await this.storageservice.get(\"Notifications\").then((value) => {\r\n\r\n this.DataArray = []\r\n value.forEach((element, i) => {\r\n let notificationObject;\r\n if (element.notification) {\r\n\r\n notificationObject = {\r\n index: i,\r\n title: element.notification.title,\r\n Service: element.data.Service,\r\n Object: element.data.Object,\r\n IdObject: element.data.IdObject,\r\n FolderId: element.data.FolderId,\r\n body: element.notification.body,\r\n dateInit: this.getFormatedTime(element.data.dateInit),\r\n dateEnd: this.getFormatedTime(element.data.dateEnd),\r\n Location: element.data.Location,\r\n TypeAgenda: element.data.TypeAgenda,\r\n Role: element.data.Role,\r\n Status: element.data.Status\r\n }\r\n\r\n } else if (element.data) {\r\n notificationObject = {\r\n index: i,\r\n title: element.title,\r\n Service: element.data.Service,\r\n Object: element.data.Object,\r\n IdObject: element.data.IdObject,\r\n FolderId: element.data.FolderId,\r\n body: element.body,\r\n dateInit: this.getFormatedTime(element.data.dateInit),\r\n dateEnd: this.getFormatedTime(element.data.dateEnd),\r\n Location: element.data.Location,\r\n TypeAgenda: element.data.TypeAgenda,\r\n Role: element.data.Role,\r\n Status: element.data.Status\r\n }\r\n\r\n } else {\r\n {\r\n notificationObject = {\r\n FolderId: element.FolderId,\r\n IdObject: element.IdObject,\r\n Location: element.Location,\r\n Object: element.Object,\r\n Role: element.Role,\r\n Service: element.Service,\r\n Status: element.Status,\r\n TypeAgenda: element.TypeAgenda,\r\n body: element.body,\r\n dateEnd: element.dateEnd,\r\n dateInit: element.dateInit,\r\n index: element.index,\r\n title: element.title\r\n }\r\n }\r\n }\r\n\r\n this.DataArray.push(notificationObject)\r\n });\r\n this.notificationdata = this.DataArray\r\n }).catch((error) => {\r\n console.error('storage getnotification: ', error)\r\n })\r\n // }\r\n\r\n\r\n }\r\n\r\n\r\n getFormatedTime(dateString) {\r\n var date = new Date(dateString);\r\n var hours = date.getHours() /* > 12 ? date.getHours() - 12 : date.getHours() */;\r\n var am_pm = date.getHours() >= 12 ? \"pm\" : \"am\";\r\n var minutes = date.getMinutes() < 10 ? \"0\" + date.getMinutes() : date.getMinutes();\r\n let time = hours + \":\" + minutes /* + \" \" + am_pm */;\r\n return time;\r\n }\r\n\r\n notificatinsRoutes = (index, Service, Object, IdObject, FolderId) => {\r\n\r\n\r\n if (Service === \"agenda\" && IdObject.length > 10) {\r\n this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda']));\r\n }\r\n else if (Service === \"gabinete-digital\" && Object === \"expediente\") {\r\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', IdObject, 'gabinete-digital']));\r\n }\r\n else if (Service === \"agenda\" && Object === \"event-list\") {\r\n //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda']));\r\n this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', IdObject, 'agenda']));\r\n\r\n } else if (Service === \"gabinete-digital\" && Object === \"despachos\") {\r\n\r\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', IdObject, 'gabinete-digital'], { replaceUrl: true }));\r\n }\r\n else if (Service === \"gabinete-digital\" && Object === \"parecer\") {\r\n\r\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', IdObject, 'gabinete-digital']));\r\n }\r\n else if (Service === \"gabinete-digital\" && Object === \"deferimento\") {\r\n\r\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', IdObject, 'gabinete-digital']));\r\n }\r\n else if (Service === \"gabinete-digital\" && Object === \"despachos-pr\") {\r\n\r\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', IdObject, 'gabinete-digital']));\r\n }\r\n else if (Service === \"accoes\" && Object === \"accao\") {\r\n this.zone.run(() => this.router.navigate(['/home/publications', IdObject]));\r\n }\r\n else if (Service === \"accoes\" && Object === \"publicacao\") {\r\n this.zone.run(() => this.router.navigate(['/home/publications/view-publications', FolderId, IdObject]));\r\n }\r\n else if (Service === \"gabinete-digital\" && Object === \"diplomas\") {\r\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', IdObject, 'gabinete-digital']));\r\n }\r\n else if (Service === \"gabinete-digital\" && Object === \"diplomas-assinar\") {\r\n\r\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', IdObject, 'gabinete-digital']));\r\n }\r\n else if (Service === \"gabinete-digital\" && Object === \"expedientes-pr\") {\r\n this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', IdObject, 'gabinete-digital']));\r\n } else if (Service === \"chat\") {\r\n let navigationExtras: NavigationExtras = { queryParams: { \"roomId\": IdObject, } };\r\n this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras));\r\n }\r\n\r\n // this.notificationservice.tempClearArray();\r\n this.deleteNotification(index);\r\n\r\n\r\n\r\n }\r\n\r\n deleteNotification(index) {\r\n this.notificationdata = this.notificationdata.filter(item => item.index != index);\r\n\r\n this.storageservice.store(\"Notifications\", this.notificationdata).then((store) => {\r\n\r\n this.storageservice.get(\"Notifications\").then((value) => {\r\n\r\n this.eventTriger.publishSomeData({\r\n notification: \"deleted\"\r\n })\r\n\r\n }).catch((error) => {\r\n console.error('storage delete notification: ', error)\r\n })\r\n });\r\n\r\n }\r\n\r\n logout() {\r\n SessionStore.setInativity(false)\r\n SessionStore.setUrlBeforeInactivity(this.router.url);\r\n this.logoutOut == false\r\n\r\n if (environment.production) {\r\n window.location.pathname = '/auth'\r\n } else {\r\n const pathBeforeGoOut = window.location.pathname\r\n this.router.navigateByUrl('/auth', { replaceUrl: true });\r\n\r\n setTimeout(() => {\r\n if (this.logoutOut == false || pathBeforeGoOut == window.location.pathname) {\r\n window.location.pathname = '/auth'\r\n } else {\r\n\r\n }\r\n }, 500)\r\n }\r\n\r\n }\r\n\r\n async editProfile() {\r\n\r\n const enterAnimation = (baseEl: any) => {\r\n const backdropAnimation = this.animationController.create()\r\n .addElement(baseEl.querySelector('ion-backdrop')!)\r\n .fromTo('opacity', '0.01', 'var(--backdrop-opacity)');\r\n\r\n const wrapperAnimation = this.animationController.create()\r\n .addElement(baseEl.querySelector('.modal-wrapper')!)\r\n .keyframes([\r\n { offset: 0, opacity: '1', right: '-100%' },\r\n { offset: 1, opacity: '1', right: '0px' }\r\n ]);\r\n\r\n return this.animationController.create()\r\n .addElement(baseEl)\r\n .easing('ease-out')\r\n .duration(500)\r\n .addAnimation([backdropAnimation, wrapperAnimation]);\r\n }\r\n\r\n const leaveAnimation = (baseEl: any) => {\r\n return enterAnimation(baseEl).direction('reverse');\r\n }\r\n\r\n\r\n if (this.isProfileOpen == false) {\r\n this.isProfileOpen = true;\r\n\r\n const modal = await this.modalController.create({\r\n component: EditProfilePage,\r\n cssClass: 'model profile-modal search-submodal',\r\n componentProps: {\r\n }\r\n });\r\n await modal.present();\r\n\r\n modal.onDidDismiss().then(() => {\r\n this.isProfileOpen = false;\r\n })\r\n\r\n }\r\n }\r\n\r\n}\r\n"]},"metadata":{},"sourceType":"module"}