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IAAIzU,EAAuBwb,GAGlD/iD,KAAKg8C,gBAAkB+G,EANvB/iD,KAAKg8C,gBAAkB,IAAIzU,EAQxBvnC,IACV,CAKDsqB,QAGI,MAAMu4B,EAAwB7iD,KAAK6iD,uBAAyB,GAO5D,QALqCnb,IAAjCmb,EAAsB1X,SAEtB0X,EAAsB1X,OAASnrC,KAAKmrC,SAGnCnrC,KAAKgtB,IACN,MAAM,IAAI+a,MAAM,4FAEpB,MAAM+T,EAAa,IAAIvH,GAAev0C,KAAKgtB,IAAK61B,GAChD,OAAOhH,UAAqBC,EAAY97C,KAAKmrC,QAAU7B,WAAqBtpC,KAAK+7C,UAAY,IAAI2F,GAAmB1hD,KAAKg8C,gBAC5H,EAIJ,kBCzGM,IAAIvQ,EACAA,sBAeRA,IAAaA,EAAW,KAbdA,EAASuX,MAAW,GAAK,QAElCvX,EAASA,EAASwX,MAAW,GAAK,QAElCxX,EAASA,EAASyX,YAAiB,GAAK,cAExCzX,EAASA,EAAS0X,QAAa,GAAK,UAEpC1X,EAASA,EAAS1D,MAAW,GAAK,QAElC0D,EAASA,EAAS2X,SAAc,GAAK,WAErC3X,EAASA,EAAS4X,KAAU,GAAK,MAdrC,kBCJO,IAAI1N,EACAA,EAWA5D,4BAXA4D,EASRA,IAAsBA,EAAoB,KAPvBA,EAAkB0N,KAAU,GAAK,OAEnD1N,EAAkBA,EAAkB2N,WAAgB,GAAK,aAEzD3N,EAAkBA,EAAkB4N,iBAAsB,GAAK,mBAE/D5N,EAAkBA,EAAkB6N,YAAiB,GAAK,cAI9D,SAAWzR,GAEPA,EAAeA,EAAe0R,KAAU,GAAK,OAE7C1R,EAAeA,EAAe2R,OAAY,GAAK,QAClD,CALD,CAKG3R,IAAmBA,EAAiB,IALvC","names":["closeMenus","_ngrx_store__WEBPACK_IMPORTED_MODULE_0__","loadBoardList","loadBoardListSuccess","loadBoardListFailed","updateTemplateUsage","updateTemplateUsageSuccess","updateTemplateUsageFailed","getTemplatesUsage","getTemplatesUsageSuccess","getTemplatesUsageFailed","loadBoardSummaryStats","loadBoardSummaryStatsSuccess","loadBoardSummaryStatsFailed","loadBoardSummaryDetails","loadBoardSummaryDetailsSuccess","loadBoardSummaryDetailsFailed","boardsFeatureKey","reducer","_ngrx_store__WEBPACK_IMPORTED_MODULE_1__","boardsLoading","boards","updateTemplateUsageStatus","templatesUsage","boardSummaryStats","boardSummaryDetails","boardSummaryLoading","boardSummaryError","initialState","_main_application_boards_store_boards_actions__WEBPACK_IMPORTED_MODULE_0__","state","action","templatesUsageLoading","templatesUsageError","error","stats","details","loadCalendarInspections","loadCalendarInspectionsSuccess","loadCalendarInspectionsFailed","updateCalendarInspection","calendarFeatureKey","visibleInspections","visibleInspectionsLoading","_main_application_calendar_store_calendar_actions__WEBPACK_IMPORTED_MODULE_0__","inspections","updatedInspections","map","inspection","id","loadDelinquencyList","loadDelinquencyListSucceded","loadDelinquencyListFailed","loadDelinquencyById","loadDelinquencyByIdSucceded","loadDelinquencyByIdFailed","updateDelinquencyDetailsById","getDelinquencyChangesHistory","updateDelinquencyDetailsByIdSucceded","updateDelinquencyDetailsByIdFailed","getDelinquencyChangesHistorySuccess","getDelinquencyChangesHistoryFailure","delinquencyFeatureKey","delinquenciesList","delinquenciesListLoading","delinquencyDetailsLoading","auditModelList","auditModelListLoading","_delinquency_actions__WEBPACK_IMPORTED_MODULE_0__","delinquencyList","delinquencyDetails","loadRenewalsList","loadRenewalsListSucceded","loadRenewalsListFailure","loadRenewalDetails","loadRenewalDetailsSucceded","loadRenewalDetailsFailure","loadRenewalStrategyForUnit","loadRenewalStrategyForUnitSucceded","loadRenewalStrategyForUnitFailed","saveRenewalDetails","saveRenewalDetailsFailure","saveRenewalDetailsSucceded","getRenewalChangesHistory","getRenewalChangesHistorySuccess","getRenewalChangesHistoryFailure","renewalsFeatureKey","renewalsList","renewalsListLoading","renewalDetailsLoading","renewalDetails","renewalStrategyForUnit","renewalStrategyForUnitLoading","_renewals_actions__WEBPACK_IMPORTED_MODULE_0__","unitTypeRentTarget","rocReportTransientFeatureKey","setRocFilter","setInitialDateDataSuccess","setInitialDateData","filter","beginDate","endDate","selectRocReportState","selectRocFilter","selectRocFilterSet","loadRocReport","loadRocReportSuccess","loadRocReportError","setRocSorting","setDisplayedRocSections","updateMarketRent","updateMarketRentSuccess","updateConstructionCost","updateConstructionCostSuccess","updateNewRent","updateNewRentSuccess","updateOldRent","updateOldRentSuccess","rocFeatureKey","_main_application_store_reducers_hydration_meta_reducer__WEBPACK_IMPORTED_MODULE_4__","dataCorrected","reportLoading","report","propertySorting","displayedSections","_environments_environment__WEBPACK_IMPORTED_MODULE_2__","_environments_environment_config__WEBPACK_IMPORTED_MODULE_3__","Date","moment__WEBPACK_IMPORTED_MODULE_0__","add","startOf","toDate","endOf","metaRocReducers","_ngrx_store__WEBPACK_IMPORTED_MODULE_5__","_main_application_dashboard_reports_roc_report_store_roc_actions__WEBPACK_IMPORTED_MODULE_1__","propertyId","sorting","setDashboardFilter","dashboardFilterTransientFeatureKey","selectDashboardsStateTransient","selectTurnoversFilters","dashboardsState","turnoversFilters","setTurnoversFilters","updateTurnoversFilters","resetTurnoversFilters","auditMode","_shared_enums_turnover_audit_mode__WEBPACK_IMPORTED_MODULE_0__","dashboardFilterFeatureKey","_main_application_store_reducers_hydration_meta_reducer__WEBPACK_IMPORTED_MODULE_1__","assignee","metaDashboardFilterReducers","_ngrx_store__WEBPACK_IMPORTED_MODULE_2__","_dashboards_store_actions_dashboard_filter_actions__WEBPACK_IMPORTED_MODULE_0__","dynamicTableFilterPredicate","element","filterItem","JSON","parse","compareParams","unitOrAssignee","compareWith","toLowerCase","push","currentValue","lodash__WEBPACK_IMPORTED_MODULE_0__","propertyName","assigneeUser","displayName","step","notify","due","inspectionType","some","x","includes","expectValue","propertyIds","length","portfolioId","assigneeId","entityDetails","actualAssigneeId","templateIds","inspectionTemplateId","_shared_functions_params_compare_function__WEBPACK_IMPORTED_MODULE_3__","getTableFilterPredicate","inspectionTemplates","comparedParams","compareElementWithFilterParams","template","find","unit","name","unitType","status","hasLateStatus","_main_application_inspections_models_rest_inspections_model_interface__WEBPACK_IMPORTED_MODULE_2__","nonCompletedStatus","moment__WEBPACK_IMPORTED_MODULE_1__","dueDate","isBefore","recurrencePeriod","getFilterDateRange","today","formattedString","timeFrame","timeframe","formatDate","date","format","startDate","year","month","day","_components_inspections_list_constants__WEBPACK_IMPORTED_MODULE_4__","subtract","DynamicInspectionService","constructor","restApiService","static","data","timezone","forEach","e","_main_application_management_pages_system_configuration_components_timezone_entity_helper__WEBPACK_IMPORTED_MODULE_0__","getById","inspectionId","this","getData","list","fixTimezoneForRestInspectionsModelList","create","update","delete","_angular_core__WEBPACK_IMPORTED_MODULE_2__","factory","ContractorsService","getUnassignedContractorsList","core","CompaniesEffects","actions$","snackbarService","cacheService","userService","adminService","companiesService","contractorsService","store","ngrx_effects","pipe","companies_actions","exhaustMap","getCompanyList","companyList","catchError","snackbar_message_enum","of","switchMap","getCompany","companyId","companyModel","mergeMap","addNewCompany","tap","success","resetCacheByKey","err","inviteUser","user","userId","roleId","usersToGeneralRoleList","userToPropertyRoleList","selectedProperty","contactPersonId","company","addEmployeeToCompany","userIds","delay","dispatch","administration_actions","isUserExistError","existedUserEmail","email","phoneNumberAddedAsIdentity","phoneNumber","updateCompany","deleteCompany","updateEmployeeItem","deleteEmployeeFromCompany","contractors","addAddressToCompany","postCompanyAddressModel","updateAddressInCompany","restAddressModel","CompaniesStoreModule","common","ngrx_store","companies_reducer","RenewalsService","getRenewalDetails","renewalId","updateRenewalDetails","renewalModel","getRenewalList","renewalTargetList","renewalTargetForUnitId","unitId","updateRenewalTarget","renewalTargetModels","TimerService","reloadTimer","associate","DashboardEffects","turnoversService","renewalsService","timerService","dashboard_actions","getPropertyTurnovers","taskList","tasks","getPortfolioTurnovers","combineLatest","getAllTasks","myTasks","withLatestFrom","select","dashboards_selectors","dashboardEnumValue","routePath","kpi","unitSummary","result","activeTurnoversSummary","activeTurnoversDetails","delinquencyFilterType","delinquencySummary","delinquencyByUnit","renewalsSummary","dashboardViewType","unitDetails","unitDetailsByType","renewalDetailsCombined","myProperties","unitList","updatedUnit","post","doNotAutoCreateTurns","isUnitDown","isUnitDownReason","KpiEffects","kpiService","kpi_actions","fetch","kpiTypes","kpis","dateOffset","trend","trendDays","user_roles_UserRoles","DeleteRoleSummaryDialogComponent","dialogRef","close","dialog","selectors","ctx","Unassigned","isUserExisting","D","AdministrationEffects","router","restapiService","adminPanelService","administration_selectors","filterKey","get_filter_key","cachedData","cachedUsers","needRefresh","activeUsers","lodash","isActive","inactiveUsers","getUserList","getPortfolioUserList","cacheKey","getCachedInfo","getPropertyUserList","userTypes","addPermissionsMap","getTime","activePropertyUsers","inactivePropertyUsers","permissionLevels","generalRoleToPermissionMapping","propertiesRoles","userToGeneralRole","generalRoles","userToPropertyMapping","allUsers","allUserToGeneralRoleMapping","usersWithGeneralRoles","usersCombinedWithRoles","combineUsersWithGeneralRoles","entry","item","roleName","transform","associatedRole","propertiesStructure","setUserToGeneralRole","setUserToPropertyRole","removeUserFromPropertyRole","deleteUserToPropertyMappings","generalRole","oldGeneralRoles","newGeneralRoles","oldRole","allGeneralRoles","feedback","message","Message","split","parsedFeedback","parseGeneralRoleFeedback","usersWithRolesList","acc","open","autoFocus","width","navigate","app_routes_const","then","user_selectors","currentUserGeneralRole","expireCashedUserData","user_actions","param","errorMessage","setUserData","inviteResidentUser","setResidentUserData","removeUser","info","firstName","reactivateUser","reduce","keyValuePair","key","value","parseInt","BoardsEffects","boardService","boards_actions","getList","usage","getBoardSummaryStats","getBoardSummaryDetails","BoardsStoreModule","boards_reducer","CalendarEffects","inspectionService","calendar_actions","property_selector_selectors","moment","inspections_list_component","CalendarStoreModule","calendar_reducer","DelinquencyEffects","auditService","delinquency_actions","delinquencyId","objectId","getChangesHistory","auditable_entity_type","RenewalsEffects","renewals_actions","RocService","fetchReport","turnovers_service","turnoverId","marketRentOverride","cost","newRent","oldRent","RocEffects","rocService","timezoneService","roc_actions","roc_report_store","f","first","_action","corrected","addTimezoneForEntity","_tz","environment","environment_config","getCurrentDate","RocReportStoreModule","roc_reducer","metaReducers","InspectionsEffects","dynamicInspectionService","inspections_actions","returnStandardAndResidentBoth","includeArchived","listItems","getResidentInspections","inReviewList","isResident","inReviewListItems","repeating","stepName","toUpperCase","createTicket","ticket","updateTicket","service_constants","inspections_selectors","inspection_mappers","summaryStats","payload","getSummaryStats","InspectionStoreModule","inspections_reducer","SystemConfigurationEffects","systemConfigService","system_configuration_actions","getSystemConfig","config","systemConfig","deleteSystemConfig","pmsCredential","updateSystemConfig","addSystemConfig","getTimerReport","timerReport","getChatHooksChannels","channels","setPropertyChatChannel","channelIds","TurnoverConfigurationStepAssigneesEffects","propertiesService","responsiblePartiesService","turnover_configuration_step_assignees_actions","getResponsiblePartiesOverrideByPortfolioId","responsibleParties","createResponsibleParties","updateResponsibleParties","deleteResponsibleParties","workflowStepEnumType","getDefaultAssigneesForPortfolio","updateDefaultAssigneesForPortfolio","deleteDefaultAssigneesForPortfolio","workflowStepType","updatePropertyManagers","deletePropertyManagers","TurnoverConfigurationStepStoreModule","turnover_configuration_step_assignees_reducer","TurnoverConfigurationEffects","turnoverConfigService","turnover_configuration_actions","getTurnoverConfigList","turnoverConfig","getTurnoverConfigListByWorkflowType","workflowStep","updateTurnoverFieldConfiguration","getElapsedDaysThresholds","thresholdsConfiguration","updateElapsedDaysThresholds","getFinishTypes","finishTypes","addFinishType","finish","enumerations_actions","updateFinishType","deleteFinishType","TurnoverConfigurationStoreModule","reducers","ManagementEffects","management_actions","thresholdSections","thresholdProperty","thresholdTask","threshold","NotificationRestService","getNotifications","markAllAsRead","customPatchData","markAsRead","baseNotificationBody","notificationIds","NotificationsEffects","notificationRestService","notifications_actions","sortedList","timestamp","valueOf","lastNotificationList","notifications_selectors","take","notifications","readNotifications","wasRead","additionalData","turnoverIds","notification","notificationId","ServiceEffects","ticketsService","service_actions","getServiceSummaryStats","getServiceSummaryDetails","ServiceStoreModule","service_reducer","EnumerationEffects","enumerations","FileUploadEffects","fileUploadsService","file_upload_actions","uploadFile","file","uploadedFile","uploadedFileItem","attachmentSection","removeFile","fileId","UserEffects","tenantService","getCashedUserData","userData","getCachedTenant","tenantData","getUserById","updateTenantSettings","settings","TicketsEffects","tickets_actions","getTicketsByAssigneeId","ticketList","getTicketsByPropertyId","turnoverTicket","updatedTicket","TurnoverListEffects","turnover_list_actions","turnover_list_selectors","debounceTime","manually","collapsed","position","BidsService","bidList","bid","reject","getBid","bidId","setAttachment","attachmentToEntity","getTurnoverBids","getCompanyBids","getAllBids","deleteBidAttachment","attachmentId","getBidAttachments","createBulkScope","bulkScope","getBulkScopeList","getBulkScope","bulkScopeId","updateBulkScope","addUnitsToBulk","addBulkTurnoversAttachment","body","BulkBidsEffects","bidsService","bulk_and_scope_actions","bulkList","attachment","PunchService","loadPunchById","punchId","loadPunchesByTurnoverId","createPunch","punch","updatePunch","PunchEffects","punchService","punch_actions","iif","TurnoverBidsEffects","turnoverBidsService","turnover_bids_actions","bids","accept","reason","upload","uploadInvoice","categoryList","categories","addCategory","categoryId","approve","approved","denyReason","UpdateWorkflowStepAssigneeModelFunction","workflow","workflowStepAssignmentModel","responsiblePartyId","responsiblePartyType","responsiblePartyGroupType","userType","user_type","AppliancesService","getAppliance","applianceId","WorkflowStepCommentsService","comment","commentId","getWorkflowStepComments","addReaction","reactionId","encodeURIComponent","deleteReaction","TurnoversEffects","workflowActionsService","appliancesService","workflowStepCommentsService","turnovers_actions","postTurnoverModel","turnoverData","activeWorkflowStepType","getWorkflowAssignmentsByStepId","restWorkflowStepAssignmentModel","workflow_step_enum","getTurnover","moveToNextStep","workflowAction","nextWorkflowStep","getResponsiblePartiesByPropertyId","defaultTurnoversAssignees","property","addedAttachment","preventReloadList","setAttachments","attachmentType","attachments","updateAttachment","getTicketsByTurnover","turnoverTicketList","newTurnoverTicket","ErrorCode","editedTicket","getTicket","ticketId","turnovers_selectors","addedTicketAttachment","ticketType","ticket_type","restTicketModel","getTicketAttachment","ticketAttachments","newBidList","updatedBid","addedBidAttachment","appliance","workflowStepCommentList","commentItem","emoji","turnoverDataId","deleteTurnover","disableAutoTurnCreation","unitName","deleteTurnoverAttachment","fileUploadId","getTurnoversAttachments","allAttachments","allPropertyIds","toggleAllSections","active","activePropertyIds","toggleSingleSection","selectInactiveFilteredPropertyIds","inactiveFilteredPropertyIds","dashboard_roles_store","getTurnoversTimers","timers","updateTurnoversTimers","setWorkflowStepAssignee","rememberIt","transitWorkflowStepAssignee","source","getTurnoverSummaryStats","getTurnoverSummaryDetails","newBulkScopeInProgress","newBulkScopeInStatus","newBulkScopeInId","bulkScopeLoading","bulkScopeListLoading","bulkScopeList","updateBulkScopeInProgress","updateBulkScopeInStatus","allBidList","allBidListLoading","addUnitsInProgress","update_status","PortfolioEffects","unitsService","portfolioService","portfolio_actions","portfolioItems","portfolioDetails","propertyDetails","getAllUserProperties","properties","getAllUserUnassignedProperties","unassignedProperties","portfolio_selectors","updatedPortfolioDetails","doNotRefetchPortfolios","autoAddNewProperties","preleaseFilterMode","getPropertyManagers","propertyManagers","getPropertyManagersForProperty","managerList","portfolioName","removePropertyManagers","propertyManagerModels","setPropertyManagers","replacePropertyManagers","oldManager","newManager","getPropertyUnits","propertyUnits","getUnitAttachments","unitAttachments","attachment_type","deleteUnitAttachment","targetAttachmentType","items","collectionItems","res","collection","errorMsg","collectionName","collectionId","PortfolioStoreModule","portfolio_reducer","TemplateEffects","surveyService","template_actions","unitTypes","templateDetails","areaId","queryParamsHandling","inspectionTemplateAreas","s","TemplateStoreModule","template_reducer","SharedStoreModule","system_configuration_reducer","dashboards_reducer","kpi_reducer","dashboard_filter_reducer","administration_reducer","turnovers_reducer","punch_reducer","turnover_bids_reducer","delinquency_reducer","renewals_reducer","service_configuration_reducer","management_reducer","notifications_reducer","tickets_reducer","turnover_list_reducer","turnovers_overview_reducer","store_reducers","property_selector_reducer","SingletonServicesModule","angular_auth_oidc_client","modals_service","board_service","inspection_service","dynamic_inspection_service","snackbar_service","units_service","screen_wiper_service","getDashboardMode","dashboard_mode","NotificationsService","auth","connect","hubConnection","HubConnectionBuilder","configureLogging","ILogger","withUrl","transport","ITransport","skipNegotiation","accessTokenFactory","firstValueFrom","getAccessToken","withAutomaticReconnect","build","on","distributeNotifications","start","catch","stop","MainApplicationComponent","pu_subscribe","cdr","authService","notificationsService","appVersionService","activatedRoute","super","ngOnInit","tokenRevoke","window_resize_actions","windowWidth","window","innerWidth","version_timestamp","version_number","getBuiltInVersionInfo","currentVersionTimeStamp","currentVersion","events","ngneat_until_destroy","event","subscribe","checkSlackResponse","checkBuildiumResponse","detectChanges","untilDestroyed","isAuthenticated","distinctUntilChanged","dashboardMode","tenantId","href","hostname","location","tenantUrl","setTimeout","url","URL","searchParams","append","toString","property_selector_actions","evt","pairwise","previousEvent","_event","route_state_action","previousRoute","urlAfterRedirects","pull","slackAdded","snapshot","queryParams","removeQueryParam","buildium","paramName","n","ngOnDestroy","onClick","onResize","target","has","clearStorage","__decorate","routes","path","component","children","route_path_enum","canActivate","auth_guard","loadChildren","Promise","m","ResidentModule","resident_guard","ApplicationMenuModule","route_data","dashboard_view_type","loadComponent","__webpack_require__","NoPermissionComponent","NoPackageComponent","MainApplicationRoutingModule","playerFactory","lottie_default","tooltipDefaults","showDelay","hideDelay","touchendHideDelay","MainApplicationModule","yesEmpty_pipe","valueIfPositive_pipe","valueIfNonZero_pipe","provide","tooltip","useValue","imports","ngx_lottie","player","notifications_module","ngrx_store_devtools","maxAge","logOnly","modals_module","scrolling","fesm2020_forms","snack_bar","customized_snackbar_module","getServiceConfig","getServiceConfigSuccess","getServiceConfigError","setServiceSectionExpanded","serviceConfigurationFeatureKey","expandedSections","Statuses","Resident","Triggers","_service_configuration_actions__WEBPACK_IMPORTED_MODULE_0__","serviceConfigLoading","serviceConfig","section","getSystemConfigSuccess","getSystemConfigError","updateSystemConfigSuccess","updateSystemConfigError","getTimerReportSuccess","getTimerReportError","getChatChannels","getChatChannelsSuccess","getChatChannelsError","setPropertyChatChannels","setPropertyChatChannelsSuccess","setPropertyChatChannelsError","setSystemSectionExpanded","systemConfigurationFeatureKey","systemConfigLoading","timerReportLoading","updateSystemStatus","updateSystemInProgress","chatHooksChannels","API","Hooks","DateTime","TimerReport","_system_configuration_actions__WEBPACK_IMPORTED_MODULE_1__","_shared_enums_update_status__WEBPACK_IMPORTED_MODULE_0__","loadResponsibleParties","loadResponsiblePartiesSuccess","loadResponsiblePartiesFailure","setAllStepAssigneeList","createResponsiblePartiesSuccess","createResponsiblePartiesFailure","updateResponsiblePartiesSuccess","updateResponsiblePartiesFailure","resetAssigneesUpdateStatus","deleteResponsiblePartiesSuccess","deleteResponsiblePartiesFailure","resetAssigneesUpdateModel","setEditedCell","resetEditedCell","setUserRadioList","resetAllUserList","updatePropertyUser","resetPropertyUser","loadDefaultPortfolioResponsibleParties","loadDefaultPortfolioResponsiblePartiesSuccess","loadDefaultPortfolioResponsiblePartiesFailed","updatePortfolioResponsibleParties","updatePortfolioResponsiblePartiesSuccess","updatePortfolioResponsiblePartiesFailure","deletePortfolioResponsibleParties","deletePortfolioResponsiblePartiesSuccess","deletePortfolioResponsiblePartiesFailure","updatePropertyProjectManager","updatePropertyProjectManagerSuccess","updatePropertyProjectManagerFailed","deletePropertyProjectManager","reponsiblePartiesFeatureKey","responsiblePartiesLoading","portfolioResponsibleParties","createResponsiblePartiesOngoing","createResponsiblePartiesStatus","updateResponsiblePartiesOngoing","updateResponsiblePartiesStatus","updatedResponsibleParties","editedCellUUId","propertyUsers","allStepAssigneeList","_actions_turnover_configuration_step_assignees_actions__WEBPACK_IMPORTED_MODULE_1__","uuid","loadAllThresholds","loadAllThresholdsSuccess","loadAllThresholdsFailed","loadThresholdsProperty","loadThresholdsPropertySuccess","loadThresholdsPropertyFailed","loadThresholdsTask","loadThresholdsTaskSuccess","loadThresholdsTaskFailed","setThresholdsConfig","setThresholdsConfigSuccess","setThresholdsConfigFailed","getRenewalTargetList","getRenewalTargetListSuccess","getRenewalTargetListFailure","updateRenewalTargetSuccess","updateRenewalTargetFailure","managementFeatureKey","thresholdSectionLoading","thresholdSectionPropertyLoading","thresholdSectionProperty","thresholdSectionTaskLoading","thresholdSectionTask","thresholdUpdateLoading","renewalTargetListLoading","updateRenewalTargetModelLoading","_management_actions__WEBPACK_IMPORTED_MODULE_0__","NotificationsModule","_angular_common__WEBPACK_IMPORTED_MODULE_2__","_ui_components_components_icon_icon_component__WEBPACK_IMPORTED_MODULE_0__","clearNotificationsStore","addLatestNotification","addLatestAnyNotification","markAnyNotificationsAsRead","clearAnyNotifications","updateAnyNotifications","getLastNotificationList","getLastNotificationListSuccess","getLastNotificationListFailed","markAllAsReadSuccess","markAllAsReadFailed","markAsReadSuccess","markAsReadFailed","deleteNotification","deleteNotificationSuccess","deleteNotificationFailed","notificationsFeatureKey","bidNotification","ticketNotification","turnoverNotification","lastAnyNotificationList","lastNotificationListLoading","markAllAsReadInProgress","markAllAsReadStatus","markAsReadInProgress","markAsReadStatus","markAsReadId","deleteNotificationInProgress","_ngrx_store__WEBPACK_IMPORTED_MODULE_3__","_main_application_notifications_store_actions_notifications_actions__WEBPACK_IMPORTED_MODULE_1__","_shared_enums_update_status__WEBPACK_IMPORTED_MODULE_2__","selectNotificationsState","_main_application_notifications_store_reducers_notifications_reducer__WEBPACK_IMPORTED_MODULE_0__","selectLastNotificationList","notificationsState","selectLastAnyNotificationList","selectDeleteNotificationInProgress","TicketListConstants","TimeFrame","Week","label","Month","Month_3","Month_6","Year","AllTime","Custom","labelConfig","_app_services_tickets_service__WEBPACK_IMPORTED_MODULE_1__","groupValue","getTicketId","pmsWorkOrderNumber","pmsWorkOrderId","getServerPartFilter","summaryFilters","currentDate","selectedPropertyIds","filterData","includeCompleted","isCompleted","_shared_enums_ticket_status_type__WEBPACK_IMPORTED_MODULE_2__","_template_utils_filter__WEBPACK_IMPORTED_MODULE_3__","Object","keys","collectionIds","boardId","unitTypeId","ticketCategoryId","topicId","ticketTopicId","ticketTypeId","ticketSummaryType","customStartDate","customEndDate","filterPanelNotEmpty","filterPanels","values","Array","isArray","applyFilterToQueryParams","entries","hasOwnProperty","loadServiceSummaryStats","loadServiceSummaryStatsSuccess","loadServiceSummaryStatsFailed","loadServiceSummaryDetails","loadServiceSummaryDetailsSuccess","loadServiceSummaryDetailsFailed","serviceFeatureKey","serviceSummaryStats","serviceSummaryDetails","serviceSummaryLoading","serviceSummaryError","_service_actions__WEBPACK_IMPORTED_MODULE_0__","getTicketList","getTicketListSuccess","getTicketListFailed","getPropertyTicketList","getPropertyTicketListSuccess","getPropertyTicketListFailed","markTicketAsDone","markTicketAsDoneSuccess","markTicketAsDoneFailed","setTicketListFilter","clearTicketStore","ticketsFeatureKey","ticketListLoading","ticketListFilter","updatedTicketLoading","_main_application_tickets_store_actions_tickets_actions__WEBPACK_IMPORTED_MODULE_0__","setTurnoverListSorting","toggleTurnoverListAssignees","toggleTurnoverListSteps","setWidgetsCollapseState","setListScrollState","turnoverListFeatureKey","stepAssignees","showSteps","widgetsState","metaTurnoverListReducers","_main_application_turnovers_components_turnover_list_store_actions_turnover_list_actions__WEBPACK_IMPORTED_MODULE_0__","selectTurnoverListState","_reducers_turnover_list_reducer__WEBPACK_IMPORTED_MODULE_0__","selectTurnoverListSorting","selectTurnoverListStepState","selectTurnoverListAssigneeState","selectTurnoverWidgetsCollapseState","getBulkScopeListSuccess","getBulkScopeListFailed","getBulkScopeSuccess","getBulkScopeFailed","updateBulkScopeSuccess","updateBulkScopeFailed","resetUpdateBulkScopeStatus","createNewBulkScope","createNewBulkScopeSuccess","createNewBulkScopeFailed","resetNewBulkScopeID","addUnitsToBulkSuccess","addUnitsToBulkFailed","addBulkTurnoversAttachmentSuccess","addBulkTurnoversAttachmentFailed","setTurnoverOverviewSectionCounters","clearTurnoverOverviewCounters","turnoverOverviewFeatureKey","turnoverOverviewReducer","sectionCounters","DashboardMode","SUPER_USER","AuthGuard","guardService","rxjs__WEBPACK_IMPORTED_MODULE_5__","_main_application_store_selectors_user_selectors__WEBPACK_IMPORTED_MODULE_0__","rxjs_operators__WEBPACK_IMPORTED_MODULE_6__","rxjs_operators__WEBPACK_IMPORTED_MODULE_7__","isAuthorized","loginUrlTree","parseUrl","_shared_constants_app_routes_const__WEBPACK_IMPORTED_MODULE_1__","returnUrl","rxjs__WEBPACK_IMPORTED_MODULE_8__","handleGuardError","_angular_core__WEBPACK_IMPORTED_MODULE_9__","ResidentGuard","rxjs_operators__WEBPACK_IMPORTED_MODULE_4__","rxjs_operators__WEBPACK_IMPORTED_MODULE_5__","_shared_enums_user_type__WEBPACK_IMPORTED_MODULE_1__","createUrlTree","_shared_constants_app_routes_const__WEBPACK_IMPORTED_MODULE_0__","rxjs__WEBPACK_IMPORTED_MODULE_6__","_angular_core__WEBPACK_IMPORTED_MODULE_7__","CustomizedSnackbarModule","_angular_common__WEBPACK_IMPORTED_MODULE_5__","_angular_material_button__WEBPACK_IMPORTED_MODULE_6__","_icon_icon_component__WEBPACK_IMPORTED_MODULE_2__","_angular_material_icon__WEBPACK_IMPORTED_MODULE_7__","_shared_pipes_pipes_module__WEBPACK_IMPORTED_MODULE_0__","_component_customized_snackbar_component__WEBPACK_IMPORTED_MODULE_1__","AdminPanelService","rxjs__WEBPACK_IMPORTED_MODULE_1__","billingReport","toISOString","runImporterNow","testUrl","editWorkflowStepTemplate","stepEnumType","updatePmsConfiguration","AuditService","objectType","_angular_core__WEBPACK_IMPORTED_MODULE_1__","CompaniesService","GuardService","oidcStorageService","clear","rxjs__WEBPACK_IMPORTED_MODULE_2__","targetUri","code","appUrl","rxjs__WEBPACK_IMPORTED_MODULE_3__","_angular_core__WEBPACK_IMPORTED_MODULE_4__","PortfolioService","portfolioIdSource","asObservable","switchMessageSource","setPortfolioId","next","setPortfolioSwitchMessage","reportName","prevPortfolioId","newPortfolioId","PropertiesService","setPropertyPreleaseFilter","addPropertyToPortfolio","getTurnsWithoutAssignees","getTurnsWithoutPortfolioAssignees","updateProperty","ScreenWiperService","screenWipeState","screenClasses","globalWiperVisible","globalWiper","runWiper","setClasses","wipeDuration","SystemConfigService","buildiumTokenExchange","jwtToken","TurnoverBidsService","model","TurnoverConfigService","getTenantSettings","getTenantBrandingPreview","rxjs_operators__WEBPACK_IMPORTED_MODULE_2__","token","saveTenantSettings","tenantSettings","_angular_core__WEBPACK_IMPORTED_MODULE_3__","DEFAULT_RETRY_DELAYS_IN_MILLISECONDS","DefaultReconnectPolicy","retryDelays","_retryDelays","undefined","nextRetryDelayInMilliseconds","retryContext","previousRetryCount","HttpError","Error","statusCode","trueProto","prototype","__proto__","TimeoutError","AbortError","UnsupportedTransportError","errorType","DisabledTransportError","FailedToStartTransportError","FailedToNegotiateWithServerError","AggregateErrors","innerErrors","HttpResponse","statusText","content","HttpClient","get","options","send","method","getCookieString","NullLogger","log","_logLevel","_message","instance","Arg","val","match","Platform","isBrowser","document","isWebWorker","self","isReactNative","isNode","getDataDetail","includeContent","detail","isArrayBuffer","byteLength","formatArrayBuffer","view","Uint8Array","str","num","substr","ArrayBuffer","sendMessage","_x","logger","transportName","httpClient","headers","Authorization","getUserAgentHeader","LogLevel","logMessageContent","responseType","response","timeout","withCredentials","SubjectSubscription","subject","observer","_subject","_observer","dispose","index","observers","indexOf","splice","cancelCallback","_","ConsoleLogger","minimumLogLevel","_minLevel","out","console","logLevel","msg","warn","userAgentHeaderName","constructUserAgent","getOsName","getRuntimeVersion","version","os","runtime","runtimeVersion","userAgent","majorAndMinor","process","platform","versions","node","getErrorString","stack","FetchHttpClient","_logger","requireFunc","__non_webpack_require__","_jar","CookieJar","_fetchType","bind","getGlobalThis","globalThis","global","AbortController","_abortControllerType","request","abortSignal","aborted","abortController","_this","onabort","abort","timeoutId","msTimeout","cache","credentials","mode","redirect","signal","clearTimeout","ok","deserializeContent","cookies","getCookies","c","join","arrayBuffer","text","XhrHttpClient","resolve","xhr","XMLHttpRequest","setRequestHeader","header","onload","responseText","onerror","ontimeout","DefaultHttpClient","_httpClient","HeaderNames","Cookie","_isAborted","LongPollingTransport","_accessTokenFactory","_pollAbort","_options","_running","onreceive","onclose","pollAborted","transferFormat","TransferFormat","_url","P","pollOptions","_getAccessToken","_updateHeaderToken","pollUrl","now","_closeError","_receiving","_poll","_this2","_this3","_raiseOnClose","_this4","_this5","deleteOptions","logMessage","ServerSentEventsTransport","eventSource","opened","EventSource","onmessage","_close","onopen","_eventSource","WebSocketTransport","webSocketConstructor","_logMessageContent","_webSocketConstructor","_headers","webSocket","replace","binaryType","_webSocket","ErrorEvent","readyState","OPEN","_isCloseEvent","wasClean","HttpConnection","_stopPromiseResolver","features","_negotiateVersion","createLogger","baseUrl","_resolveUrl","webSocketModule","eventSourceModule","WebSocket","_connectionState","_connectionStarted","_startInternalPromise","_startInternal","_stopPromise","_sendQueue","TransportSendQueue","_stopInternal","_stopError","_stopConnection","HttpTransportType","_constructTransport","_startTransport","negotiateResponse","redirects","_getNegotiationResponse","ProtocolVersion","accessToken","_createTransport","inherentKeepAlive","negotiateUrl","_resolveNegotiateUrl","negotiateVersion","connectionToken","connectionId","_createConnectUrl","requestedTransport","requestedTransferFormat","connectUrl","_this6","_isITransport","transportExceptions","transports","availableTransports","negotiate","endpoint","transportOrError","_resolveTransportOrError","ex","transportMatches","actualTransport","transferFormats","lastIndexOf","aTag","createElement","substring","_transport","_buffer","_executing","_sendBufferedData","PromiseSource","_transportResult","_sendLoopPromise","_sendLoop","_bufferData","promise","_this7","transportResult","_concatBuffers","arrayBuffers","totalLength","b","a","offset","set","buffer","_resolver","_rejecter","TextMessageFormat","output","RecordSeparator","input","messages","pop","RecordSeparatorCode","String","fromCharCode","HandshakeProtocol","writeHandshakeRequest","handshakeRequest","stringify","parseHandshakeResponse","messageData","remainingData","binaryData","separatorIndex","responseLength","apply","slice","call","textData","type","MessageType","Invocation","StreamItem","Completion","StreamInvocation","CancelInvocation","Ping","Close","Subject","complete","HubConnectionState","Disconnected","Connecting","Connected","Disconnecting","Reconnecting","HubConnection","connection","protocol","reconnectPolicy","_nextKeepAlive","_freezeEventListener","serverTimeoutInMilliseconds","keepAliveIntervalInMilliseconds","_protocol","_reconnectPolicy","_handshakeProtocol","_processIncomingData","_connectionClosed","_callbacks","_methods","_closedCallbacks","_reconnectingCallbacks","_reconnectedCallbacks","_invocationId","_receivedHandshakeResponse","_cachedPingMessage","writeMessage","_startPromise","_startWithStateTransitions","addEventListener","_stopDuringStartError","handshakePromise","_handshakeResolver","_handshakeRejecter","_sendMessage","_cleanupTimeout","_resetTimeoutPeriod","_resetKeepAliveInterval","_cleanupPingTimer","startPromise","_reconnectDelayHandle","_completeClose","stream","methodName","args","streams","streamIds","_replaceStreamingParams","invocationDescriptor","_createStreamInvocation","promiseQueue","cancelInvocation","_createCancelInvocation","invocationId","_sendWithProtocol","invocationEvent","_launchStreams","sendPromise","_createInvocation","invoke","newMethod","off","handlers","removeIdx","callback","onreconnecting","onreconnected","_processHandshakeResponse","parseMessages","_invokeClientMethod","allowReconnect","responseMessage","_timeoutHandle","serverTimeout","_pingServerHandle","nextPing","invocationMessage","methods","arguments","_cancelCallbacksWithError","_reconnect","removeEventListener","reconnectStartTime","previousReconnectAttempts","retryError","nextRetryDelay","_getNextRetryDelay","elapsedMilliseconds","retryReason","callbacks","nonblocking","streamId","_createCompletionMessage","_createStreamItemMessage","i","argument","_isObservable","arg","JsonHubProtocol","hubMessages","parsedMessage","_isInvocationMessage","_isStreamItemMessage","_isCompletionMessage","_assertNotEmptyString","LogLevelNameMapping","trace","debug","information","warning","critical","none","logging","isLogger","parseLogLevel","mapping","transportTypeOrOptions","httpConnectionOptions","withHubProtocol","retryDelaysOrReconnectPolicy","Trace","Debug","Information","Warning","Critical","None","WebSockets","ServerSentEvents","LongPolling","Text","Binary"],"sourceRoot":"webpack:///","sources":["./src/app/modules/main-application/boards/store/boards.actions.ts","./src/app/modules/main-application/boards/store/boards.reducer.ts","./src/app/modules/main-application/calendar/store/calendar.actions.ts","./src/app/modules/main-application/calendar/store/calendar.reducer.ts","./src/app/modules/main-application/dashboard-reports/delinquencies/store/delinquency.actions.ts","./src/app/modules/main-application/dashboard-reports/delinquencies/store/delinquency.reducer.ts","./src/app/modules/main-application/dashboard-reports/renewals/store/renewals.actions.ts","./src/app/modules/main-application/dashboard-reports/renewals/store/renewals.reducer.ts","./src/app/modules/main-application/dashboard-reports/roc-report/store/index.ts","./src/app/modules/main-application/dashboard-reports/roc-report/store/roc.actions.ts","./src/app/modules/main-application/dashboard-reports/roc-report/store/roc.reducer.ts","./src/app/modules/main-application/dashboard-roles/store/actions/dashboard-filter.actions.ts","./src/app/modules/main-application/dashboard-roles/store/index.ts","./src/app/modules/main-application/dashboard-roles/store/reducers/dashboard-filter.reducer.ts","./src/app/modules/main-application/inspections/pages/template/utils/filter.ts","./src/app/modules/main-application/inspections/services/dynamic-inspection.service.ts","./src/app/services/contractors.service.ts","./src/app/modules/main-application/management/pages/companies/store/companies.effects.ts","./src/app/modules/main-application/management/pages/companies/store/companies-store.module.ts","./src/app/services/renewals.service.ts","./src/app/services/timer.service.ts","./src/app/modules/main-application/dashboard-roles/store/effects/dashboard.effects.ts","./src/app/modules/main-application/dashboard-roles/store/effects/kpi.effects.ts","./src/app/modules/shared/enums/user-roles.ts","./src/app/modules/main-application/administration/components/delete-role-summary-dialog/delete-role-summary-dialog.component.html","./src/app/modules/main-application/administration/components/delete-role-summary-dialog/delete-role-summary-dialog.component.ts","./src/app/modules/main-application/administration/functions/combineUsersWithRoles.ts","./src/app/modules/main-application/administration/store/effects/administration.effects.ts","./src/app/modules/main-application/boards/store/boards.effects.ts","./src/app/modules/main-application/boards/store/boards-store.module.ts","./src/app/modules/main-application/calendar/store/calendar.effects.ts","./src/app/modules/main-application/calendar/store/calendar-store.module.ts","./src/app/modules/main-application/dashboard-reports/delinquencies/store/delinquency.effects.ts","./src/app/modules/main-application/dashboard-reports/renewals/store/renewals.effects.ts","./src/app/services/roc.service.ts","./src/app/modules/main-application/dashboard-reports/roc-report/store/roc.effects.ts","./src/app/modules/main-application/dashboard-reports/roc-report/store/roc-store.module.ts","./src/app/modules/main-application/inspections/store/inspections.effects.ts","./src/app/modules/main-application/inspections/store/inspections-store.module.ts","./src/app/modules/main-application/management/pages/system-configuration/store/system-configuration.effects.ts","./src/app/modules/main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/store/effects/turnover-configuration-step-assignees.effects.ts","./src/app/modules/main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/store/turnover-configuration-step-store.module.ts","./src/app/modules/main-application/management/pages/turnover-configuration/store/effects/turnover-configuration.effects.ts","./src/app/modules/main-application/management/pages/turnover-configuration/store/turnover-configuration-store.module.ts","./src/app/modules/main-application/management/store/management.effects.ts","./src/app/services/notification-rest.service.ts","./src/app/modules/main-application/notifications/store/effects/notifications.effects.ts","./src/app/modules/main-application/service/store/service.effects.ts","./src/app/modules/main-application/service/store/service-store.module.ts","./src/app/modules/main-application/store/effects/enumeration.effects.ts","./src/app/modules/main-application/store/effects/file-upload.effects.ts","./src/app/modules/main-application/store/effects/user.effects.ts","./src/app/modules/main-application/tickets/store/effects/tickets.effects.ts","./src/app/modules/main-application/turnovers/components/turnover-list/store/effects/turnover-list.effects.ts","./src/app/services/bids.service.ts","./src/app/modules/main-application/turnovers/store/effects/bulk-bids.effects.ts","./src/app/services/punch.service.ts","./src/app/modules/main-application/turnovers/store/effects/punch.effects.ts","./src/app/modules/main-application/turnovers/store/effects/turnover-bids.effects.ts","./src/app/modules/shared/functions/update-workflow-step-responsible-party-model.function.ts","./src/app/services/appliances.service.ts","./src/app/services/workflow-step-comments.service.ts","./src/app/modules/main-application/turnovers/store/effects/turnovers.effects.ts","./src/app/modules/main-application/turnovers/store/reducers/bulk-bids.reducer.ts","./src/app/modules/main-application/management/pages/portfolio/store/portfolio.effects.ts","./src/app/modules/main-application/management/pages/portfolio/store/portfolio-store.module.ts","./src/app/modules/main-application/inspections/pages/template/store/template.effects.ts","./src/app/modules/main-application/inspections/pages/template/store/template-store.module.ts","./src/app/modules/main-application/store/shared-store.module.ts","./src/app/modules/shared/singleton-service.module.ts","./src/app/modules/shared/functions/get-dashboard-mode.function.ts","./src/app/modules/main-application/notifications/services/notifications.service.ts","./src/app/modules/main-application/main-application.component.ts","./src/app/modules/main-application/main-application.component.html","./src/app/modules/main-application/main-application.routing.module.ts","./src/app/modules/main-application/main-application.module.ts","./src/app/modules/main-application/management/pages/service-configuration/store/service-configuration.actions.ts","./src/app/modules/main-application/management/pages/service-configuration/store/service-configuration.reducer.ts","./src/app/modules/main-application/management/pages/system-configuration/store/system-configuration.actions.ts","./src/app/modules/main-application/management/pages/system-configuration/store/system-configuration.reducer.ts","./src/app/modules/main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/store/actions/turnover-configuration-step-assignees.actions.ts","./src/app/modules/main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/store/reducers/turnover-configuration-step-assignees.reducer.ts","./src/app/modules/main-application/management/store/management.actions.ts","./src/app/modules/main-application/management/store/management.reducer.ts","./src/app/modules/main-application/notifications/notifications.module.ts","./src/app/modules/main-application/notifications/store/actions/notifications.actions.ts","./src/app/modules/main-application/notifications/store/reducers/notifications.reducer.ts","./src/app/modules/main-application/notifications/store/selectors/notifications.selectors.ts","./src/app/modules/main-application/service/service.constants.ts","./src/app/modules/main-application/service/store/service.actions.ts","./src/app/modules/main-application/service/store/service.reducer.ts","./src/app/modules/main-application/tickets/store/actions/tickets.actions.ts","./src/app/modules/main-application/tickets/store/reducers/tickets.reducer.ts","./src/app/modules/main-application/turnovers/components/turnover-list/store/actions/turnover-list.actions.ts","./src/app/modules/main-application/turnovers/components/turnover-list/store/reducers/turnover-list.reducer.ts","./src/app/modules/main-application/turnovers/components/turnover-list/store/selectors/turnover-list.selectors.ts","./src/app/modules/main-application/turnovers/store/actions/bulk-and-scope.actions.ts","./src/app/modules/main-application/turnovers/store/reducers/turnovers-overview.reducer.ts","./src/app/modules/shared/enums/dashboard-mode.ts","./src/app/modules/shared/guards/auth.guard.ts","./src/app/modules/shared/guards/resident.guard.ts","./src/app/modules/ui-components/components/customized-snackbar/customized-snackbar.module.ts","./src/app/services/admin-panel.service.ts","./src/app/services/audit.service.ts","./src/app/services/companies.service.ts","./src/app/services/guard.service.ts","./src/app/services/portfolio.service.ts","./src/app/services/properties.service.ts","./src/app/services/screen-wiper.service.ts","./src/app/services/system-config.service.ts","./src/app/services/turnover-bids.service.ts","./src/app/services/turnover-config.service.ts","./node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js","./node_modules/@microsoft/signalr/dist/esm/Errors.js","./node_modules/@microsoft/signalr/dist/esm/HttpClient.js","./node_modules/@microsoft/signalr/dist/esm/Loggers.js","./node_modules/@microsoft/signalr/dist/esm/Utils.js","./node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js","./node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js","./node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js","./node_modules/@microsoft/signalr/dist/esm/HeaderNames.js","./node_modules/@microsoft/signalr/dist/esm/AbortController.js","./node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js","./node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js","./node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js","./node_modules/@microsoft/signalr/dist/esm/HttpConnection.js","./node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js","./node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js","./node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js","./node_modules/@microsoft/signalr/dist/esm/Subject.js","./node_modules/@microsoft/signalr/dist/esm/HubConnection.js","./node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js","./node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js","./node_modules/@microsoft/signalr/dist/esm/ILogger.js","./node_modules/@microsoft/signalr/dist/esm/ITransport.js"],"sourcesContent":["import { createAction, props } from '@ngrx/store';\n\nimport { BoardLayoutInspectionTemplatesUsage, RestBoardModel } from '@main-application/boards/interfaces/board';\nimport {\n BoardsSummaryStatsDetails,\n SummaryFilters,\n SummaryStatsGroup,\n} from '@ui-components/components/summary-expandable-table/summary-expandable-table.model';\n\nexport const closeMenus = createAction('[Boards] close menus');\n\nexport const loadBoardList = createAction('[Boards] loadBoardList');\nexport const loadBoardListSuccess = createAction(\n '[Boards] loadBoardListSuccess',\n props<{ boards: RestBoardModel[] }>()\n);\nexport const loadBoardListFailed = createAction('[Boards] loadBoardListFailed');\n\nexport const updateTemplateUsage = createAction(\n '[Boards] updateTemplateUsage',\n props<{ usage: BoardLayoutInspectionTemplatesUsage }>()\n);\n\nexport const updateTemplateUsageSuccess = createAction('[Boards] updateTemplateUsageSuccess');\nexport const updateTemplateUsageFailed = createAction('[Boards] updateTemplateUsageFailed');\n\nexport const getTemplatesUsage = createAction('[Boards] getTemplatesUsage', props<{ id: number }>());\n\nexport const getTemplatesUsageSuccess = createAction(\n '[Boards] getTemplatesUsageSuccess',\n props<{ templatesUsage: BoardLayoutInspectionTemplatesUsage[] }>()\n);\n\nexport const getTemplatesUsageFailed = createAction('[Boards] getTemplatesUsageFailed', props<{ error: any }>());\n\nexport const loadBoardSummaryStats = createAction(\n '[Boards] Load Board Summary Stats',\n props<{ filter: SummaryFilters }>()\n);\n\nexport const loadBoardSummaryStatsSuccess = createAction(\n '[Boards] Load Board Summary Stats Success',\n props<{ stats: SummaryStatsGroup[] }>()\n);\n\nexport const loadBoardSummaryStatsFailed = createAction(\n '[Boards] Load Board Summary Stats Failed',\n props<{ error: any }>()\n);\n\nexport const loadBoardSummaryDetails = createAction(\n '[Boards] Load Board Summary Details',\n props<{ filter: SummaryFilters }>()\n);\n\nexport const loadBoardSummaryDetailsSuccess = createAction(\n '[Boards] Load Board Summary Details Success',\n props<{ details: BoardsSummaryStatsDetails }>()\n);\n\nexport const loadBoardSummaryDetailsFailed = createAction(\n '[Boards] Load Board Summary Details Failed',\n props<{ error: any }>()\n);\n","import { createReducer, on } from '@ngrx/store';\n\nimport { BoardLayoutInspectionTemplatesUsage, RestBoardModel } from '@main-application/boards/interfaces/board';\nimport {\n getTemplatesUsage,\n getTemplatesUsageFailed,\n getTemplatesUsageSuccess,\n loadBoardList,\n loadBoardListFailed,\n loadBoardListSuccess,\n loadBoardSummaryDetails,\n loadBoardSummaryDetailsFailed,\n loadBoardSummaryDetailsSuccess,\n loadBoardSummaryStats,\n loadBoardSummaryStatsFailed,\n loadBoardSummaryStatsSuccess,\n updateTemplateUsage,\n updateTemplateUsageFailed,\n updateTemplateUsageSuccess,\n} from '@main-application/boards/store/boards.actions';\nimport {\n BoardsSummaryStatsDetails,\n SummaryStatsGroup,\n} from '@ui-components/components/summary-expandable-table/summary-expandable-table.model';\n\nexport const boardsFeatureKey = 'boardsState';\n\nexport interface State {\n updateTemplateUsageStatus: any;\n boardsLoading: boolean;\n boards: RestBoardModel[];\n templatesUsage: BoardLayoutInspectionTemplatesUsage[];\n boardSummaryStats: SummaryStatsGroup[] | null;\n boardSummaryDetails: BoardsSummaryStatsDetails | null;\n boardSummaryLoading: boolean;\n boardSummaryError: any;\n}\n\nexport const initialState: State = {\n boardsLoading: false,\n boards: [],\n updateTemplateUsageStatus: 'idle',\n templatesUsage: [],\n boardSummaryStats: null,\n boardSummaryDetails: null,\n boardSummaryLoading: false,\n boardSummaryError: null,\n};\n\nexport const reducer = createReducer(\n initialState,\n on(loadBoardList, (state, action) => ({ ...state, boardsLoading: true })),\n on(loadBoardListSuccess, (state, action) => ({ ...state, boards: action.boards, boardsLoading: false })),\n on(loadBoardListFailed, (state, action) => ({ ...state, boardsLoading: false })),\n on(updateTemplateUsage, state => ({ ...state, updateTemplateUsageStatus: 'loading' })),\n on(updateTemplateUsageSuccess, state => ({ ...state, updateTemplateUsageStatus: 'success' })),\n on(updateTemplateUsageFailed, state => ({ ...state, updateTemplateUsageStatus: 'failure' })),\n on(getTemplatesUsage, state => ({ ...state, templatesUsageLoading: true, templatesUsageError: null })),\n on(getTemplatesUsageSuccess, (state, { templatesUsage }) => ({\n ...state,\n templatesUsageLoading: false,\n templatesUsage,\n })),\n on(getTemplatesUsageFailed, (state, { error }) => ({\n ...state,\n templatesUsageLoading: false,\n templatesUsageError: error,\n })),\n on(loadBoardSummaryStats, state => ({ ...state, boardSummaryLoading: true, boardSummaryError: null })),\n on(loadBoardSummaryStatsSuccess, (state, { stats }) => ({\n ...state,\n boardSummaryStats: stats,\n boardSummaryLoading: false,\n })),\n on(loadBoardSummaryStatsFailed, (state, { error }) => ({\n ...state,\n boardSummaryLoading: false,\n boardSummaryError: error,\n })),\n on(loadBoardSummaryDetails, state => ({ ...state, boardSummaryLoading: true, boardSummaryError: null })),\n on(loadBoardSummaryDetailsSuccess, (state, { details }) => ({\n ...state,\n boardSummaryDetails: details,\n boardSummaryLoading: false,\n })),\n on(loadBoardSummaryDetailsFailed, (state, { error }) => ({\n ...state,\n boardSummaryLoading: false,\n boardSummaryError: error,\n }))\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { RestInspectionsModel } from '@main-application/inspections/models/rest-inspections-model.interface';\n\nexport const loadCalendarInspections = createAction(\n '[Calendar] loadCalendarInspections',\n props<{\n startDate?: Date;\n endDate?: Date;\n secondStartDate?: Date;\n secondEndDate?: Date;\n }>()\n);\nexport const loadCalendarInspectionsSuccess = createAction(\n '[Boards] loadCalendarInspectionsSuccess',\n props<{ inspections: RestInspectionsModel[] }>()\n);\nexport const loadCalendarInspectionsFailed = createAction('[Boards] loadBoardListFailed');\n\nexport const updateCalendarInspection = createAction(\n '[Calendar] Update Calendar Inspection',\n props<{ inspection: RestInspectionsModel }>()\n);\n","import { createReducer, on } from '@ngrx/store';\n\nimport {\n loadCalendarInspections,\n loadCalendarInspectionsFailed,\n loadCalendarInspectionsSuccess,\n updateCalendarInspection,\n} from '@main-application/calendar/store/calendar.actions';\nimport { RestInspectionsModel } from '@main-application/inspections/models/rest-inspections-model.interface';\n\nexport const calendarFeatureKey = 'calendarState';\n\nexport interface State {\n visibleInspections: RestInspectionsModel[];\n visibleInspectionsLoading: boolean;\n}\n\nexport const initialState: State = {\n visibleInspections: null,\n visibleInspectionsLoading: true,\n};\n\nexport const reducer = createReducer(\n initialState,\n on(loadCalendarInspections, (state, action) => ({ ...state, visibleInspectionsLoading: true })),\n on(loadCalendarInspectionsSuccess, (state, action) => ({\n ...state,\n visibleInspections: action.inspections,\n visibleInspectionsLoading: false,\n })),\n on(loadCalendarInspectionsFailed, (state, action) => ({ ...state, visibleInspectionsLoading: false })),\n on(updateCalendarInspection, (state, action) => {\n // console.log('Updating inspection:', action.inspection);\n const updatedInspections = state.visibleInspections\n ? state.visibleInspections.map(inspection =>\n inspection.id === action.inspection.id ? { ...inspection, ...action.inspection } : inspection\n )\n : null;\n /* console.log(\n 'Updated inspection:',\n updatedInspections.find(e => e.id === action.inspection.id)\n ); */\n return {\n ...state,\n visibleInspections: updatedInspections,\n };\n })\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { RestAuditModel } from '@shared/interfaces/audit.interface';\n\nexport const loadDelinquencyList = createAction('[Delinquency] load delinquency list', props<{ id: any }>());\nexport const loadDelinquencyListSucceded = createAction(\n '[Delinquency] load delinquency list succeeded',\n props<{ delinquencyList }>()\n);\nexport const loadDelinquencyListFailed = createAction('[Delinquency] load delinquency list failed');\n\nexport const loadDelinquencyById = createAction(\n '[Delinquency] load delinquency by id',\n props<{ delinquencyId: number }>()\n);\nexport const loadDelinquencyByIdSucceded = createAction(\n '[Delinquency] load delinquency by id succeeded',\n props<{ delinquencyDetails }>()\n);\nexport const loadDelinquencyByIdFailed = createAction('[Delinquency] load delinquency by id failed');\n\nexport const updateDelinquencyDetailsById = createAction(\n '[Delinquency] update delinquency by id',\n props<{ delinquencyDetails: any }>()\n);\nexport const updateDelinquencyDetailsByIdSucceded = createAction(\n '[Delinquency] update delinquency by id succeeded',\n props<{ delinquencyDetails }>()\n);\nexport const updateDelinquencyDetailsByIdFailed = createAction('[Delinquency] update delinquency by id failed');\n\n/* get changes history */\nexport const getDelinquencyChangesHistory = createAction(\n '[Delinquency] get changes history',\n props<{ objectId: number }>()\n);\nexport const getDelinquencyChangesHistorySuccess = createAction(\n '[Delinquency] get changes history success',\n props<{ auditModelList: RestAuditModel[] }>()\n);\nexport const getDelinquencyChangesHistoryFailure = createAction('[Delinquency] get changes history failure');\n","import { createReducer, on } from '@ngrx/store';\n\nimport { RestAuditModel } from '@shared/interfaces/audit.interface';\nimport { RestDelinquencyModel } from '@shared/interfaces/delinquency.interface';\n\nimport {\n getDelinquencyChangesHistory,\n getDelinquencyChangesHistoryFailure,\n getDelinquencyChangesHistorySuccess,\n loadDelinquencyById,\n loadDelinquencyByIdFailed,\n loadDelinquencyByIdSucceded,\n loadDelinquencyList,\n loadDelinquencyListFailed,\n loadDelinquencyListSucceded,\n} from './delinquency.actions';\n\nexport const delinquencyFeatureKey = 'delinquency';\n\nexport interface DelinquencyState {\n delinquenciesList: RestDelinquencyModel[];\n delinquenciesListLoading: boolean;\n\n delinquencyDetails?: RestDelinquencyModel;\n delinquencyDetailsLoading: boolean;\n\n auditModelList?: RestAuditModel[];\n auditModelListLoading?: boolean;\n}\n\nexport const initialState: DelinquencyState = {\n delinquenciesList: [],\n delinquenciesListLoading: false,\n\n delinquencyDetailsLoading: false,\n auditModelList: [],\n auditModelListLoading: false,\n};\n\nexport const reducer = createReducer(\n initialState,\n on(loadDelinquencyList, (state, action) => ({ ...state, delinquenciesListLoading: true })),\n on(loadDelinquencyListFailed, (state, action) => ({ ...state, delinquenciesListLoading: false })),\n on(loadDelinquencyListSucceded, (state, action) => ({\n ...state,\n delinquenciesListLoading: false,\n delinquenciesList: action.delinquencyList,\n })),\n\n on(loadDelinquencyById, (state, action) => ({ ...state, delinquencyDetailsLoading: true })),\n on(loadDelinquencyByIdFailed, (state, action) => ({ ...state, delinquencyDetailsLoading: false })),\n on(loadDelinquencyByIdSucceded, (state, action) => ({\n ...state,\n delinquencyDetailsLoading: false,\n delinquencyDetails: action.delinquencyDetails,\n })),\n\n /* get changes history */\n on(getDelinquencyChangesHistory, (state, action) => ({ ...state, auditModelListLoading: true })),\n on(getDelinquencyChangesHistorySuccess, (state, action) => ({\n ...state,\n auditModelList: action.auditModelList,\n auditModelListLoading: false,\n })),\n on(getDelinquencyChangesHistoryFailure, (state, action) => ({\n ...state,\n auditModelList: [],\n auditModelListLoading: false,\n }))\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { RestAuditModel } from '@shared/interfaces/audit.interface';\nimport { RestRenewalModel, RestUnitRenewalTargetModel } from '@shared/interfaces/renevals.interface';\n\n/* Load Renewals list */\nexport const loadRenewalsList = createAction('[Renewals] load renewals list', props<{ propertyId: number }>());\nexport const loadRenewalsListSucceded = createAction(\n '[Renewals] load renewals list succeded',\n props<{ renewalsList: RestRenewalModel[] }>()\n);\nexport const loadRenewalsListFailure = createAction('[Renewals] load renewals list failure');\n\n/* Load Renewal details */\nexport const loadRenewalDetails = createAction('[Renewals] load renewal details', props<{ renewalId: number }>());\nexport const loadRenewalDetailsSucceded = createAction(\n '[Renewals] load renewal details succeded',\n props<{ renewalDetails: RestRenewalModel }>()\n);\nexport const loadRenewalDetailsFailure = createAction('[Renewals] load renewal details failure');\n\n/* Load RenewalStrategyForUnit */\nexport const loadRenewalStrategyForUnit = createAction(\n '[Renewals] load renewal strategy for unit',\n props<{ unitId: number }>()\n);\nexport const loadRenewalStrategyForUnitSucceded = createAction(\n '[Renewals] load renewal strategy for unit succeeded',\n props<{ unitTypeRentTarget: RestUnitRenewalTargetModel }>()\n);\nexport const loadRenewalStrategyForUnitFailed = createAction('[Renewals] load renewal strategy for unit failed');\n\n/* Save Renewal details */\nexport const saveRenewalDetails = createAction(\n '[Renewals] save renewal details',\n props<{ renewalModel: RestRenewalModel }>()\n);\nexport const saveRenewalDetailsSucceded = createAction('[Renewals] save renewal details succeded');\nexport const saveRenewalDetailsFailure = createAction('[Renewals] save renewal details failure');\n\n/* get changes history */\nexport const getRenewalChangesHistory = createAction('[Renewals] get changes history', props<{ objectId: number }>());\nexport const getRenewalChangesHistorySuccess = createAction(\n '[Renewals] get changes history success',\n props<{ auditModelList: RestAuditModel[] }>()\n);\nexport const getRenewalChangesHistoryFailure = createAction('[Renewals] get changes history failure');\n","import { createReducer, on } from '@ngrx/store';\n\nimport { RestAuditModel } from '@shared/interfaces/audit.interface';\nimport { RestRenewalModel, RestUnitRenewalTargetModel } from '@shared/interfaces/renevals.interface';\n\nimport {\n getRenewalChangesHistory,\n getRenewalChangesHistoryFailure,\n getRenewalChangesHistorySuccess,\n loadRenewalDetails,\n loadRenewalDetailsFailure,\n loadRenewalDetailsSucceded,\n loadRenewalStrategyForUnit,\n loadRenewalStrategyForUnitFailed,\n loadRenewalStrategyForUnitSucceded,\n loadRenewalsList,\n loadRenewalsListFailure,\n loadRenewalsListSucceded,\n} from './renewals.actions';\n\nexport const renewalsFeatureKey = 'renewals';\n\nexport interface RenewalsState {\n renewalsList: RestRenewalModel[];\n renewalsListLoading: boolean;\n\n renewalDetailsLoading: boolean;\n renewalDetails: RestRenewalModel;\n\n renewalStrategyForUnit: RestUnitRenewalTargetModel;\n renewalStrategyForUnitLoading: boolean;\n auditModelList?: RestAuditModel[];\n auditModelListLoading?: boolean;\n}\n\nexport const initialState: RenewalsState = {\n renewalsList: [],\n renewalsListLoading: false,\n\n renewalDetailsLoading: false,\n renewalDetails: null,\n\n renewalStrategyForUnit: null,\n renewalStrategyForUnitLoading: false,\n\n auditModelList: [],\n auditModelListLoading: false,\n};\n\nexport const reducer = createReducer(\n initialState,\n\n /* Renewals List */\n on(loadRenewalsList, (state, action) => ({ ...state, renewalsListLoading: true })),\n on(loadRenewalsListSucceded, (state, action) => ({\n ...state,\n renewalsListLoading: false,\n renewalsList: action.renewalsList,\n })),\n on(loadRenewalsListFailure, (state, action) => ({ ...state, renewalsListLoading: false, renewalsList: [] })),\n\n /* Renewal Details */\n on(loadRenewalDetails, (state, action) => ({ ...state, renewalDetailsLoading: true })),\n on(loadRenewalDetailsSucceded, (state, action) => ({\n ...state,\n renewalDetails: action.renewalDetails,\n renewalDetailsLoading: false,\n })),\n on(loadRenewalDetailsFailure, (state, action) => ({ ...state, renewalDetails: null, renewalDetailsLoading: false })),\n\n /* Renewal Strategy For Unit */\n on(loadRenewalStrategyForUnit, (state, action) => ({ ...state, renewalStrategyForUnitLoading: true })),\n on(loadRenewalStrategyForUnitSucceded, (state, action) => ({\n ...state,\n renewalStrategyForUnit: action.unitTypeRentTarget,\n renewalStrategyForUnitLoading: false,\n })),\n on(loadRenewalStrategyForUnitFailed, (state, action) => ({\n ...state,\n renewalStrategyForUnit: null,\n renewalStrategyForUnitLoading: false,\n })),\n\n /* get changes history */\n on(getRenewalChangesHistory, (state, action) => ({ ...state, auditModelListLoading: true })),\n on(getRenewalChangesHistorySuccess, (state, action) => ({\n ...state,\n auditModelList: action.auditModelList,\n auditModelListLoading: false,\n })),\n on(getRenewalChangesHistoryFailure, (state, action) => ({\n ...state,\n auditModelList: [],\n auditModelListLoading: false,\n }))\n);\n","import { createAction, createFeatureSelector, createReducer, createSelector, on, props } from '@ngrx/store';\n\nimport { RocFilter } from '../interfaces/roc-list-item';\n\nexport const rocReportTransientFeatureKey = 'roc-report-transient';\n\nexport interface RocReportStateTransient {\n filter: RocFilter;\n}\n\nexport const initialState: RocReportStateTransient = {\n filter: {\n //Real initial state is setting in '\\roc.effects.ts' with next affect `setInitialDateData`\n beginDate: null,\n endDate: null,\n },\n};\n\nexport const setRocFilter = createAction('[Roc] setRocFilter', props<{ filter: RocFilter }>());\nexport const setInitialDateDataSuccess = createAction(\n '[Roc] setInitialDateDataSuccess',\n props<{ filter: RocFilter }>()\n);\nexport const setInitialDateData = createAction('[Roc] set initial date state success');\n\nexport const reducer = createReducer(\n initialState,\n on(setRocFilter, (state, action) => ({\n ...state,\n ...{ filter: action.filter },\n })),\n on(setInitialDateDataSuccess, (state, action) => ({\n ...state,\n filter: action.filter,\n }))\n);\n\nexport const selectRocReportState = createFeatureSelector(rocReportTransientFeatureKey);\nexport const selectRocFilter = createSelector(selectRocReportState, state => state.filter);\nexport const selectRocFilterSet = createSelector(\n selectRocReportState,\n state => !!state.filter.beginDate && !!state.filter.endDate\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { RocSection } from '@main-application/dashboard-reports/roc-report/interfaces/roc-list-item';\nimport { SortItem } from '@shared/interfaces/sort-item';\nimport { RestTurnoverTaskModel } from '@shared/interfaces/turnover.interface';\n\nexport const loadRocReport = createAction('[Roc] Load Roc report', props<{ portfolioId: number }>());\nexport const loadRocReportSuccess = createAction('[Roc] Set Roc report', props<{ report: RestTurnoverTaskModel[] }>());\nexport const loadRocReportError = createAction('[Roc] Error Roc report');\nexport const setRocSorting = createAction('[Roc] set Roc sorting', props<{ propertyId: number; sorting: SortItem }>());\n\nexport const setDisplayedRocSections = createAction(\n '[Roc] setDisplayedRocItems',\n props<{ displayedSections: RocSection[] }>()\n);\n\nexport const updateMarketRent = createAction(\n '[Roc] updateMarketRent',\n props<{ portfolioId: number; propertyId: number; turnoverId: number; value: number }>()\n);\n\nexport const updateMarketRentSuccess = createAction(\n '[Roc] updateMarketRentSuccess',\n props<{ turnoverId: number; value: number }>()\n);\n\nexport const updateConstructionCost = createAction(\n '[Roc] updateConstructionCost',\n props<{ portfolioId: number; propertyId: number; turnoverId: number; value: number }>()\n);\n\nexport const updateConstructionCostSuccess = createAction(\n '[Roc] updateConstructionCostSuccess',\n props<{ turnoverId: number; value: number }>()\n);\n\nexport const updateNewRent = createAction(\n '[Roc] updateNewRent',\n props<{ portfolioId: number; propertyId: number; turnoverId: number; value: number }>()\n);\n\nexport const updateNewRentSuccess = createAction(\n '[Roc] updateNewRentSuccess',\n props<{ turnoverId: number; value: number }>()\n);\n\nexport const updateOldRent = createAction(\n '[Roc] updateOldRent',\n props<{ portfolioId: number; propertyId: number; turnoverId: number; value: number }>()\n);\n\nexport const updateOldRentSuccess = createAction(\n '[Roc] updateOldRentSuccess',\n props<{ turnoverId: number; value: number }>()\n);\n","import { MetaReducer, createReducer, on } from '@ngrx/store';\nimport * as moment from 'moment';\n\nimport { RocFilter, RocSection } from '@main-application/dashboard-reports/roc-report/interfaces/roc-list-item';\nimport {\n loadRocReport,\n loadRocReportError,\n loadRocReportSuccess,\n setDisplayedRocSections,\n setRocSorting,\n} from '@main-application/dashboard-reports/roc-report/store/roc.actions';\nimport { hydrationMetaReducer, patchInitialValue } from '@main-application/store/reducers/hydration-meta.reducer';\nimport { SortItem } from '@shared/interfaces/sort-item';\nimport { RestTurnoverTaskModel } from '@shared/interfaces/turnover.interface';\n\nimport { environment } from '../../../../../../environments/environment';\nimport { EnvironmentType } from '../../../../../../environments/environment-config';\n\nexport const rocFeatureKey = 'roc-report';\n\nexport interface RocReportState {\n dataCorrected: boolean;\n reportLoading: boolean;\n report: RestTurnoverTaskModel[];\n propertySorting: { [key: number]: SortItem };\n displayedSections: RocSection[];\n filter: RocFilter;\n}\n\nexport const initialState: RocReportState = patchInitialValue(\n {\n dataCorrected: false,\n reportLoading: false,\n report: [],\n propertySorting: {},\n displayedSections: [],\n filter: {\n beginDate:\n environment.type === EnvironmentType.Demo\n ? new Date('12/1/2022')\n : moment().add(-3, 'month').startOf('day').toDate(),\n endDate: moment().endOf('day').toDate(),\n },\n },\n rocFeatureKey\n);\n\nexport const metaRocReducers: Array> = [hydrationMetaReducer(rocFeatureKey)];\n\nexport const reducer = createReducer(\n initialState,\n on(loadRocReport, state => ({\n ...state,\n reportLoading: true,\n })),\n on(loadRocReportSuccess, (state, action) => ({\n ...state,\n ...action,\n reportLoading: false,\n })),\n on(loadRocReportError, state => ({\n ...state,\n report: [],\n reportLoading: false,\n })),\n on(setRocSorting, (state, action) => ({\n ...state,\n ...{ propertySorting: { ...state.propertySorting, ...{ [action.propertyId]: action.sorting } } },\n })),\n on(setDisplayedRocSections, (state, action) => ({\n ...state,\n ...action,\n }))\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { DashboardFilter } from '@dashboards/models/dashboard-filter';\n\nexport const setDashboardFilter = createAction('[DashboardFilter] Load DashboardFilters', props());\n","import { createAction, createFeatureSelector, createReducer, createSelector, on, props } from '@ngrx/store';\n\nimport { TurnoverAuditMode } from '@shared/enums/turnover-audit-mode';\nimport { TurnoversFilters } from '@shared/interfaces/turnovers-filters.interface';\n\nexport const dashboardFilterTransientFeatureKey = 'dashboardFilterTransient';\n\nexport const selectDashboardsStateTransient = createFeatureSelector(\n dashboardFilterTransientFeatureKey\n);\n\n/**\n * dashboards filters\n */\nexport const selectTurnoversFilters = createSelector(\n selectDashboardsStateTransient,\n dashboardsState => dashboardsState.turnoversFilters\n);\n\nexport interface DashboardsStateTransient {\n turnoversFilters: TurnoversFilters;\n}\n\n/**\n * set turnovers filters\n */\nexport const setTurnoversFilters = createAction(\n '[Dashboard] set turnovers filters',\n props<{ turnoversFilters: TurnoversFilters }>()\n);\n\nexport const updateTurnoversFilters = createAction(\n '[Dashboard] update turnovers filters',\n props<{ turnoversFilters: Partial }>()\n);\n\nexport const resetTurnoversFilters = createAction('[Dashboard] reset turnovers filters');\n\nexport const initialState: DashboardsStateTransient = {\n turnoversFilters: {\n auditMode: TurnoverAuditMode.ELAPSED_DAYS,\n },\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * turnovers filters\n */\n on(setTurnoversFilters, (state, action) => ({\n ...state,\n turnoversFilters: action.turnoversFilters,\n })),\n on(updateTurnoversFilters, (state, action) => ({\n ...state,\n turnoversFilters: { ...state.turnoversFilters, ...action.turnoversFilters },\n })),\n on(resetTurnoversFilters, (state, action) => ({\n ...state,\n turnoversFilters: initialState.turnoversFilters,\n }))\n);\n","import { MetaReducer, createReducer, on } from '@ngrx/store';\n\nimport { setDashboardFilter } from '@dashboards/store/actions/dashboard-filter.actions';\nimport { hydrationMetaReducer, patchInitialValue } from '@main-application/store/reducers/hydration-meta.reducer';\n\nexport const dashboardFilterFeatureKey = 'dashboardFilter';\n\nexport interface DashboardFilterState {\n assignee?: number;\n}\n\nexport const initialState: DashboardFilterState = patchInitialValue(\n {\n assignee: null,\n },\n dashboardFilterFeatureKey\n);\n\nexport const metaDashboardFilterReducers: Array> = [\n hydrationMetaReducer(dashboardFilterFeatureKey),\n];\n\nexport const reducer = createReducer(\n initialState,\n on(setDashboardFilter, (state, action) => ({ ...state, ...action }))\n);\n","import { compact } from 'lodash';\nimport * as moment from 'moment';\n\nimport { InspectionStatus } from '@main-application/inspections/models/rest-inspections-model.interface';\nimport { paramsCompare } from '@shared/functions/params-compare.function';\nimport { ParamsCompareFunc, ParamsCompareItem } from '@shared/interfaces/params-compare-item';\nimport { RestTemplateModel } from '@template/models/rest-template-model.interface';\n\nimport { InspectionsListConstants } from '../../../components/inspections-list/constants';\nimport { DynamicInspectionModel } from '../../../models/dynamic-inspection.model';\nimport { InspectionModel } from '../../../models/inspection.model';\nimport { IInspectionFilter } from '../interfaces/filter.interface';\n\nexport function compareElementWithFilterParams(\n filterItem: IInspectionFilter,\n element: InspectionModel,\n inspectionTemplates: RestTemplateModel[]\n): (ParamsCompareItem | ParamsCompareFunc)[] {\n const compareParams: (ParamsCompareItem | ParamsCompareFunc)[] = [];\n\n if (filterItem?.unitOrAssignee) {\n const template = inspectionTemplates.find(x => x.id === element?.entityDetails?.inspectionTemplateId);\n const compareWith = filterItem?.unitOrAssignee?.toLowerCase();\n compareWith &&\n compareParams.push({\n currentValue: compact([\n element.entityDetails?.unit?.name ?? '',\n element.entityDetails?.unit?.propertyName ?? '',\n element.entityDetails?.assigneeUser?.displayName ?? 'unassigned',\n element.entityDetails?.unit?.unitType ?? '',\n template?.name ?? '',\n ]).some(x => x.toLowerCase().includes(compareWith)),\n expectValue: true,\n });\n }\n\n if (filterItem?.propertyId != null) {\n compareParams.push({\n currentValue: element.propertyId,\n expectValue: filterItem?.propertyId,\n });\n }\n\n if (filterItem?.status?.length) {\n const hasLateStatus = filterItem.status.includes(InspectionStatus.Late);\n const nonCompletedStatus = [InspectionStatus.NotStarted, InspectionStatus.InProgress];\n compareParams.push({\n currentValue:\n (hasLateStatus &&\n nonCompletedStatus.includes(element.entityDetails.status) &&\n moment(element.entityDetails.dueDate).isBefore(moment(), 'day')) ||\n filterItem.status.includes(element.entityDetails.status) ||\n element.recurrencePeriod > 0,\n expectValue: true,\n });\n }\n\n if (filterItem?.assigneeId?.length) {\n compareParams.push({\n currentValue: filterItem.assigneeId.includes(element.entityDetails.assignee || -1),\n expectValue: true,\n });\n }\n\n if (filterItem?.templateIds?.length) {\n compareParams.push({\n currentValue: filterItem.templateIds.includes(element.entityDetails.inspectionTemplateId),\n expectValue: true,\n });\n }\n\n if (filterItem?.recurrencePeriod?.length) {\n compareParams.push({\n currentValue: filterItem.recurrencePeriod.includes(element.recurrencePeriod),\n expectValue: true,\n });\n }\n\n // if (isExist(filterItem?.isBulk)) {\n // compareParams.push({\n // currentValue: element.entityDetails.isBulk,\n // expectValue: filterItem.isBulk,\n // });\n // }\n\n return compareParams;\n}\n\nexport function dynamicTableFilterPredicate(\n element: DynamicInspectionModel,\n filter: string | null | undefined\n): boolean {\n if (filter == null) {\n return true;\n }\n\n const filterItem: IInspectionFilter = JSON.parse(filter);\n const compareParams: (ParamsCompareItem | ParamsCompareFunc)[] = [];\n\n if (filterItem?.unitOrAssignee) {\n const compareWith = filterItem.unitOrAssignee.toLowerCase();\n compareParams.push({\n currentValue: compact([\n element.propertyName,\n element?.assigneeUser?.displayName ?? 'unassigned',\n element.step,\n element.notify,\n element.due,\n element.inspectionType,\n ]).some(x => x.toLowerCase().includes(compareWith)),\n expectValue: true,\n });\n }\n\n if (filterItem?.propertyIds?.length) {\n compareParams.push({\n currentValue: element.propertyId === -1 || filterItem.propertyIds.includes(element.propertyId),\n expectValue: true,\n });\n }\n\n if (filterItem?.portfolioId != null) {\n compareParams.push({\n currentValue: element.portfolioId,\n expectValue: filterItem?.portfolioId,\n });\n }\n\n if (filterItem?.assigneeId?.length) {\n compareParams.push({\n currentValue: filterItem.assigneeId.includes(element.entityDetails.actualAssigneeId),\n expectValue: true,\n });\n }\n\n if (filterItem?.templateIds?.length) {\n compareParams.push({\n currentValue: filterItem.templateIds.includes(element.entityDetails.inspectionTemplateId),\n expectValue: true,\n });\n }\n\n return paramsCompare(compareParams);\n}\n\nexport function getTableFilterPredicate(inspectionTemplates: RestTemplateModel[]) {\n return function (element: InspectionModel, filter: string | null | undefined): boolean {\n if (filter == null) {\n return true;\n }\n\n const filterItem: IInspectionFilter = JSON.parse(filter);\n\n const comparedParams = compareElementWithFilterParams(filterItem, element, inspectionTemplates);\n\n return paramsCompare(comparedParams);\n };\n}\n\nexport function getFilterDateRange(\n today: Date,\n //timeFrame?: InspectionsListConstants.TimeFrame,\n filter: { [key: string]: any },\n formattedString = false\n): { startDate: Date | string; endDate?: Date | string } {\n const timeFrame = filter.timeframe;\n const formatDate = (date: moment.Moment) => (formattedString ? date.format('YYYY-MM-DD') : date.toDate());\n\n if (!timeFrame) {\n return { startDate: formatDate(moment({ year: 2022, month: 0, day: 1 })) };\n } else {\n switch (timeFrame) {\n case InspectionsListConstants.TimeFrame.Week:\n return { startDate: formatDate(moment(today).subtract(1, 'week')) };\n case InspectionsListConstants.TimeFrame.Month:\n return { startDate: formatDate(moment(today).subtract(1, 'month')) };\n case InspectionsListConstants.TimeFrame.Month_3:\n return { startDate: formatDate(moment(today).subtract(3, 'months')) };\n case InspectionsListConstants.TimeFrame.Month_6:\n return { startDate: formatDate(moment(today).subtract(6, 'months')) };\n case InspectionsListConstants.TimeFrame.Year:\n return { startDate: formatDate(moment(today).subtract(1, 'year')) };\n case InspectionsListConstants.TimeFrame.AllTime:\n return { startDate: formatDate(moment({ year: 2022, month: 0, day: 1 })) };\n case InspectionsListConstants.TimeFrame.Custom:\n return {\n startDate: formattedString ? moment(filter.startDate).format('YYYY-MM-DD') : filter.startDate,\n endDate: formattedString ? moment(filter.endDate).format('YYYY-MM-DD') : filter.endDate,\n };\n case InspectionsListConstants.TimeFrame.ThisWeek:\n return {\n startDate: formatDate(moment(today).startOf('week')),\n endDate: formatDate(moment(today).endOf('week')),\n };\n case InspectionsListConstants.TimeFrame.NextTwoWeeks:\n return {\n startDate: formatDate(moment(today)),\n endDate: formatDate(moment(today).add(2, 'weeks')),\n };\n case InspectionsListConstants.TimeFrame.ThisMonth:\n return {\n startDate: formatDate(moment(today).startOf('month')),\n endDate: formatDate(moment(today).endOf('month')),\n };\n case InspectionsListConstants.TimeFrame.ThisQuarter:\n return {\n startDate: formatDate(moment(today).startOf('quarter')),\n endDate: formatDate(moment(today).endOf('quarter')),\n };\n case InspectionsListConstants.TimeFrame.ThisYear:\n return {\n startDate: formatDate(moment(today).startOf('year')),\n endDate: formatDate(moment(today).endOf('year')),\n };\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RestTimezone } from '@main-application/management/pages/system-configuration/components/date-time-configuration/model/timezone';\nimport { TimezoneEntityHelper } from '@main-application/management/pages/system-configuration/components/timezone-entity.helper';\n\nimport {\n RestDynamicInspectionModel,\n RestDynamicInspectionUpdateModel,\n} from '../models/rest-inspections-model.interface';\n\n@Injectable()\nexport class DynamicInspectionService {\n constructor(private restApiService: RestapiService) {}\n\n private static fixTimezoneForRestInspectionsModelList(data: RestDynamicInspectionModel[], timezone: RestTimezone) {\n data.forEach(e => TimezoneEntityHelper.fixTimezoneForRestDynamicInspectionsModelToClient(e, timezone));\n return data;\n }\n\n getById(inspectionId: number): Observable {\n return this.restApiService.getData(`dynamicInspections/${inspectionId}`);\n }\n\n list(portfolioId: number) {\n return this.restApiService.getData(\n `dynamicInspections?portfolioId=${portfolioId}`,\n DynamicInspectionService.fixTimezoneForRestInspectionsModelList\n );\n }\n\n create(inspection: RestDynamicInspectionUpdateModel): Observable {\n return this.restApiService.create(`dynamicInspections`, inspection);\n }\n\n update(inspection: RestDynamicInspectionUpdateModel): Observable {\n return this.restApiService.update(`dynamicInspections`, inspection);\n }\n\n delete(inspectionId: number) {\n return this.restApiService.delete(`dynamicInspections/${inspectionId}`);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RestContractorModel } from '@shared/interfaces/contractors.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ContractorsService {\n constructor(private restApiService: RestapiService) {}\n\n getUnassignedContractorsList(): Observable {\n return this.restApiService.getData(`Contractors/unassigned`);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { of } from 'rxjs';\nimport { catchError, delay, exhaustMap, map, mergeMap, switchMap, tap } from 'rxjs/operators';\n\nimport { AdminPanelService } from '@app/services/admin-panel.service';\nimport { CacheService } from '@app/services/cache.service';\nimport { CompaniesService } from '@app/services/companies.service';\nimport { ContractorsService } from '@app/services/contractors.service';\nimport { UserService } from '@app/services/user.service';\nimport {\n assignUserToProperty,\n saveUserToGeneralRole,\n} from '@main-application/administration/store/actions/administration.actions';\nimport { UserToGeneralRoleModel } from '@shared/interfaces/user-to-general-role-model';\nimport { UserToPropertyMapping } from '@shared/interfaces/user-to-property-mapping';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n addAddressToCompany,\n addAddressToCompanyFailed,\n addAddressToCompanySuccess,\n addCompany,\n addCompanyFailed,\n addCompanySuccess,\n addCompanyWithOwner,\n addCompanyWithOwnerFailure,\n addCompanyWithOwnerFailureUserExist,\n addCompanyWithOwnerSuccess,\n addEmployeeToCompany,\n addEmployeeToCompanyFailed,\n addEmployeeToCompanySuccess,\n deleteCompany,\n deleteCompanyFailed,\n deleteCompanySuccess,\n deleteEmployeeFromCompany,\n deleteEmployeeFromCompanyFailed,\n deleteEmployeeFromCompanySuccess,\n getCompaniesList,\n getCompaniesListFailed,\n getCompaniesListSuccess,\n getCompany,\n getCompanyFailed,\n getCompanySuccess,\n getContractorList,\n getContractorListFailed,\n getContractorListSuccess,\n updateAddressInCompany,\n updateAddressInCompanyFailed,\n updateAddressInCompanySuccess,\n updateCompany,\n updateCompanyFailed,\n updateCompanySuccess,\n} from './companies.actions';\n\n@Injectable()\nexport class CompaniesEffects {\n constructor(\n private actions$: Actions,\n private snackbarService: SnackbarService,\n private cacheService: CacheService,\n private userService: UserService,\n private adminService: AdminPanelService,\n private companiesService: CompaniesService,\n private contractorsService: ContractorsService,\n private store: Store<{}>\n ) {}\n\n getCompaniesList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getCompaniesList),\n exhaustMap(action =>\n this.companiesService.getCompanyList().pipe(\n map(list => getCompaniesListSuccess({ companyList: list || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingCompanyList);\n return of(getCompaniesListFailed());\n })\n )\n )\n )\n );\n\n getCompany$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getCompany),\n switchMap(action =>\n this.companiesService.getCompany(action.companyId).pipe(\n map(companyModel => getCompanySuccess({ companyModel })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingCompanyData);\n return of(getCompanyFailed());\n })\n )\n )\n )\n );\n\n addCompany$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addCompany),\n mergeMap(action =>\n this.companiesService.addNewCompany(action.companyModel).pipe(\n tap(companyModel => {\n this.snackbarService.success(companyModel.displayName + ' added');\n this.cacheService.resetCacheByKey('companiesList');\n }),\n mergeMap(companyModel => [getCompaniesList(), addCompanySuccess({ companyModel })]),\n catchError(err => {\n this.snackbarService.error(err?.error || SnackbarErrorMessage.AddingNewVendor);\n return of(addCompanyFailed());\n })\n )\n )\n )\n );\n\n addCompanyWithOwner$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addCompanyWithOwner),\n switchMap(action =>\n this.userService.inviteUser(action.user).pipe(\n map(user => {\n const userId = user.id;\n const roleId = action.roleId;\n const usersToGeneralRoleList: UserToGeneralRoleModel[] = [{ roleId, userId }];\n const userToPropertyRoleList: UserToPropertyMapping[] = action.selectedProperty.map(\n propertyId => {\n return {\n propertyId,\n userId,\n roleId,\n id: 0,\n };\n }\n );\n return { user, usersToGeneralRoleList, userToPropertyRoleList };\n }),\n mergeMap(({ user, usersToGeneralRoleList, userToPropertyRoleList }) => {\n return this.companiesService.addNewCompany({ ...action.companyModel, contactPersonId: user.id }).pipe(\n mergeMap(company =>\n this.companiesService.addEmployeeToCompany({ companyId: company.id, userIds: [user.id] }).pipe(\n delay(800),\n map(() => {\n this.store.dispatch(saveUserToGeneralRole({ usersToGeneralRoleList: usersToGeneralRoleList }));\n this.store.dispatch(assignUserToProperty({ userToPropertyRoleList: userToPropertyRoleList }));\n return company;\n })\n )\n )\n );\n }),\n map(company => addCompanyWithOwnerSuccess({ company })),\n tap(() => this.cacheService.resetCacheByKey('companiesList')),\n catchError(error => {\n const isUserExistError = error.error === 'User exists in Azure Active Directory';\n\n if (!isUserExistError) this.snackbarService.error(error?.error || SnackbarErrorMessage.AddingNewVendor);\n return of(\n addCompanyWithOwnerFailure(),\n isUserExistError\n ? addCompanyWithOwnerFailureUserExist({\n existedUserEmail: action.user.email,\n phoneNumberAddedAsIdentity: action.user?.phoneNumberAddedAsIdentity,\n phoneNumber: action.user?.phoneNumber,\n })\n : null\n );\n })\n )\n ),\n catchError(err => {\n this.snackbarService.error(err?.error || SnackbarErrorMessage.AddingNewVendor);\n return of(addCompanyWithOwnerFailure());\n })\n )\n );\n\n updateCompany$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateCompany),\n mergeMap(action =>\n this.companiesService.updateCompany(action.companyModel).pipe(\n mergeMap(companyModel => [updateCompanySuccess({ companyModel })]),\n tap(() => this.cacheService.resetCacheByKey('companiesList')),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingVendor);\n return of(updateCompanyFailed());\n })\n )\n )\n )\n );\n\n deleteCompany$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteCompany),\n mergeMap(action =>\n this.companiesService.deleteCompany(action.company.id).pipe(\n tap(() => {\n this.snackbarService.success(action.company.displayName + ' deleted');\n this.cacheService.resetCacheByKey('companiesList');\n }),\n mergeMap(() => [deleteCompanySuccess(), getCompaniesList()]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingVendor);\n return of(deleteCompanyFailed());\n })\n )\n )\n )\n );\n\n addEmployeeToCompany$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addEmployeeToCompany),\n mergeMap(action =>\n this.companiesService.addEmployeeToCompany(action.updateEmployeeItem).pipe(\n mergeMap(companyList => [\n addEmployeeToCompanySuccess(),\n getCompany({ companyId: action.updateEmployeeItem.companyId }),\n getContractorList(),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AddingEmployee);\n return of(addEmployeeToCompanyFailed());\n })\n )\n )\n )\n );\n\n deleteEmployeeFromCompany$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteEmployeeFromCompany),\n mergeMap(action =>\n this.companiesService.deleteEmployeeFromCompany(action.updateEmployeeItem).pipe(\n mergeMap(companyList => [\n deleteEmployeeFromCompanySuccess(),\n getCompany({ companyId: action.updateEmployeeItem.companyId }),\n getContractorList(),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingEmployee);\n return of(deleteEmployeeFromCompanyFailed());\n })\n )\n )\n )\n );\n\n getContractorList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getContractorList),\n exhaustMap(() => {\n return this.contractorsService.getUnassignedContractorsList().pipe(\n map(contractors => getContractorListSuccess({ contractors })),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingVendors);\n return of(getContractorListFailed());\n })\n );\n })\n )\n );\n\n addAddressToCompany$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addAddressToCompany),\n mergeMap(action => {\n return this.companiesService.addAddressToCompany(action.postCompanyAddressModel).pipe(\n mergeMap(contractors => [\n addAddressToCompanySuccess(),\n getCompany({ companyId: action.postCompanyAddressModel.companyId }),\n ]),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.AddingAddress);\n return of(addAddressToCompanyFailed());\n })\n );\n })\n )\n );\n\n updateAddressInCompany$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateAddressInCompany),\n mergeMap(action => {\n return this.companiesService.updateAddressInCompany(action.restAddressModel, action.companyId).pipe(\n mergeMap(contractors => [updateAddressInCompanySuccess(), getCompany({ companyId: action.companyId })]),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingAddress);\n return of(updateAddressInCompanyFailed());\n })\n );\n })\n )\n );\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { CompaniesEffects } from './companies.effects';\nimport * as fromCompanies from './companies.reducer';\n\n@NgModule({\n imports: [\n CommonModule,\n StoreModule.forFeature(fromCompanies.companiesFeatureKey, fromCompanies.reducer),\n EffectsModule.forFeature([CompaniesEffects]),\n ],\n})\nexport class CompaniesStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RestRenewalModel, RestUnitRenewalTargetModel } from '@shared/interfaces/renevals.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class RenewalsService {\n constructor(private restApiService: RestapiService) {}\n\n getRenewalDetails(renewalId: number): Observable {\n return this.restApiService.getData(`Renewals/${renewalId}`);\n }\n\n updateRenewalDetails(renewalModel: RestRenewalModel): Observable {\n return this.restApiService.update(`Renewals/${renewalModel.id}`, renewalModel);\n }\n\n getRenewalList(propertyId: number): Observable {\n return this.restApiService.getData(`Renewals/property/${propertyId}`);\n }\n\n renewalTargetList(propertyId: number): Observable {\n return this.restApiService.getData(`Renewals/RenewalTargets/property/${propertyId}`);\n }\n\n renewalTargetForUnitId(unitId: number): Observable {\n return this.restApiService.getData(`Renewals/RenewalTargetForUnitId/${unitId}`);\n }\n\n updateRenewalTarget(renewalTargetModels: RestUnitRenewalTargetModel[]): Observable {\n return this.restApiService.update(`Renewals/RenewalTargets`, renewalTargetModels);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TimerService {\n constructor(private restApiService: RestapiService) {}\n\n reloadTimer(): Observable {\n return this.restApiService.associate(`Timer/refresh`, null);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { combineLatest, of } from 'rxjs';\nimport { catchError, map, mergeMap, switchMap, withLatestFrom } from 'rxjs/operators';\n\nimport { RenewalsService } from '@app/services/renewals.service';\nimport { RestapiService } from '@app/services/restapi.service';\nimport { TimerService } from '@app/services/timer.service';\nimport { TurnoversService } from '@app/services/turnovers.service';\nimport { ActiveTurnoversDetailsCombined } from '@shared/interfaces/active-turnover-details';\nimport { DelinquencyDetailsCombined } from '@shared/interfaces/delinquency.interface';\nimport { PropertyKpi } from '@shared/interfaces/kpi';\nimport { MyProperties } from '@shared/interfaces/my-properties.interface';\nimport { RenewalDetailsCombined } from '@shared/interfaces/renewal.interface';\nimport { RestUnitSummaryModel } from '@shared/interfaces/rest-unit-summary-model.interface';\nimport { UnitDetailsByType } from '@shared/interfaces/unit-details-by-type';\nimport { UnitDetails } from '@shared/interfaces/unit-details.interface';\nimport { RestUnitModel } from '@shared/interfaces/unit.interface';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport { ActiveTurnoversSummary } from '../../models/active-turnover-summary';\nimport { DelinquencySummary } from '../../models/delinquency-summary';\nimport { RenewalsSummary } from '../../models/renewals-summary';\nimport { UnitsSummary } from '../../models/units-summary';\nimport {\n getRenewalStrategyForUnit,\n getRenewalStrategyForUnitFailed,\n getRenewalStrategyForUnitSuccess,\n loadActiveTurnoversDetails,\n loadActiveTurnoversDetailsFailed,\n loadActiveTurnoversDetailsSucceded,\n loadActiveTurnoversSummary,\n loadActiveTurnoversSummaryFailed,\n loadActiveTurnoversSummarySucceded,\n loadDelinquencyByUnit,\n loadDelinquencyByUnitFailed,\n loadDelinquencyByUnitSucceded,\n loadDelinquencySummary,\n loadDelinquencySummaryFailed,\n loadDelinquencySummarySucceded,\n loadMyProperties,\n loadMyPropertiesFailed,\n loadMyPropertiesSuccess,\n loadMyTasks,\n loadMyTasksError,\n loadMyTasksSuccess,\n loadPropertyKpi,\n loadPropertyKpiFailed,\n loadPropertyKpiSucceded,\n loadRenewalsDetails,\n loadRenewalsDetailsFailed,\n loadRenewalsDetailsSuccess,\n loadRenewalsSummary,\n loadRenewalsSummaryFailed,\n loadRenewalsSummarySucceded,\n loadTurnoverKanbanPortfolio,\n loadTurnoverKanbanPortfolioError,\n loadTurnoverKanbanPortfolioSuccess,\n loadTurnoverKanbanProperty,\n loadTurnoverKanbanPropertyError,\n loadTurnoverKanbanPropertySuccess,\n loadUnit,\n loadUnitDetails,\n loadUnitDetailsByType,\n loadUnitDetailsByTypeFailed,\n loadUnitDetailsByTypeSuccess,\n loadUnitDetailsFailed,\n loadUnitDetailsSuccess,\n loadUnitFailed,\n loadUnitList,\n loadUnitListFailed,\n loadUnitListSuccess,\n loadUnitSuccess,\n loadUnitSummaryByProperty,\n loadUnitSummaryByPropertySucceded,\n loadUnitsWithActiveTurnovers,\n loadUnitsWithActiveTurnoversFailed,\n loadUnitsWithActiveTurnoversSuccess,\n updateUnit,\n updateUnitDoNotAutoCreateTurns,\n updateUnitDoNotAutoCreateTurnsFailed,\n updateUnitDoNotAutoCreateTurnsSuccess,\n updateUnitDownStatus,\n updateUnitDownStatusFailed,\n updateUnitDownStatusSuccess,\n updateUnitFailed,\n updateUnitSuccess,\n} from '../actions/dashboard.actions';\nimport { selectCurrentDashboardViewTypeSimpleText } from '../selectors/dashboards.selectors';\n\n@Injectable()\nexport class DashboardEffects {\n readonly routePath = 'properties/dashboards/';\n\n loadTurnoverKanbanProperty$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadTurnoverKanbanProperty),\n switchMap(action =>\n this.turnoversService.getPropertyTurnovers(action.propertyId).pipe(\n map(taskList => loadTurnoverKanbanPropertySuccess({ tasks: taskList || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.T01RetrievingTasks);\n return of(loadTurnoverKanbanPropertyError());\n })\n )\n )\n )\n );\n\n loadTurnoverKanbanPortfolio$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadTurnoverKanbanPortfolio),\n switchMap(action =>\n this.timerService.reloadTimer().pipe(\n switchMap(() =>\n this.turnoversService.getPortfolioTurnovers(action.portfolioId).pipe(\n map(tasks => loadTurnoverKanbanPortfolioSuccess({ tasks: tasks || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.T02RetrievingTasks);\n return of(loadTurnoverKanbanPortfolioError());\n })\n )\n )\n )\n )\n )\n );\n\n loadMyTasks$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadMyTasks),\n switchMap(action =>\n combineLatest([this.timerService.reloadTimer(), this.turnoversService.getAllTasks(action.portfolioId)]).pipe(\n map(([, tasks]) => loadMyTasksSuccess({ myTasks: tasks || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingMyTasks);\n return of(loadMyTasksError());\n })\n )\n )\n )\n );\n\n loadPropertyKpi$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPropertyKpi),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(`${this.routePath}PropertyKPI/${action.propertyId}/${dashboardEnumValue}`)\n .pipe(\n map(kpi => loadPropertyKpiSucceded({ kpi })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.T03RetrievingTasks);\n return of(loadPropertyKpiFailed());\n })\n )\n )\n )\n );\n\n loadUnitSummaryByProperty$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadUnitSummaryByProperty),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(`${this.routePath}UnitSummaryByProperty/${action.propertyId}/${dashboardEnumValue}`)\n .pipe(\n map(unitSummary => loadUnitSummaryByPropertySucceded({ unitSummary })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.T04RetrievingTasks);\n\n return of(loadDelinquencySummaryFailed());\n })\n )\n )\n )\n );\n\n loadActiveTurnoversSummary$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadActiveTurnoversSummary),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(\n `${this.routePath}ActiveTurnoversSummary/${action.propertyId}/${dashboardEnumValue}`\n )\n .pipe(\n map(result => loadActiveTurnoversSummarySucceded({ activeTurnoversSummary: result })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingTurnoverSummary);\n return of(loadActiveTurnoversSummaryFailed());\n })\n )\n )\n )\n );\n\n loadActiveTurnoversDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadActiveTurnoversDetails),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(\n `${this.routePath}ActiveTurnoversDetails/${action.propertyId}/${dashboardEnumValue}`\n )\n .pipe(\n map(result => loadActiveTurnoversDetailsSucceded({ activeTurnoversDetails: result })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingTurnoverDetails);\n return of(loadActiveTurnoversDetailsFailed());\n })\n )\n )\n )\n );\n\n loadDelinquencySummary$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadDelinquencySummary),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(\n `${this.routePath}DelinquencySummary/${action.propertyId}/${dashboardEnumValue}/${action.delinquencyFilterType}`\n )\n .pipe(\n map(result => loadDelinquencySummarySucceded({ delinquencySummary: result })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingDelinquencySummary);\n return of(loadDelinquencySummaryFailed());\n })\n )\n )\n )\n );\n\n loadDelinquencyByUnit$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadDelinquencyByUnit),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(\n `${this.routePath}DelinquencyDetails/${action.propertyId}/${dashboardEnumValue}/MoreThanTwentyFive`\n ) // TODO verify this option - MoreThanTwentyFive\n .pipe(\n map(result => loadDelinquencyByUnitSucceded({ delinquencyByUnit: result })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingDelinquencyDetails);\n return of(loadDelinquencyByUnitFailed());\n })\n )\n )\n )\n );\n\n loadRenewalsSummary$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadRenewalsSummary),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(`${this.routePath}RenewalsSummary/${action.propertyId}/${dashboardEnumValue}`)\n .pipe(\n map(renewalsSummary => loadRenewalsSummarySucceded({ renewalsSummary })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingRenewalsSummary);\n return of(loadRenewalsSummaryFailed());\n })\n )\n )\n )\n );\n\n loadUnitDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadUnitDetails),\n switchMap(action =>\n this.restApiService\n .getData(`${this.routePath}UnitDetails/${action.propertyId}/${action.dashboardViewType}`)\n .pipe(\n map(result => loadUnitDetailsSuccess({ unitDetails: result })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingUnitDetails);\n return of(loadUnitDetailsFailed());\n })\n )\n )\n )\n );\n\n loadUnitDetailsByType$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadUnitDetailsByType),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(`${this.routePath}UnitDetailsByType/${action.propertyId}/${dashboardEnumValue}`)\n .pipe(\n map(result => loadUnitDetailsByTypeSuccess({ unitDetailsByType: result })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingUnitDetailsByProperty);\n return of(loadUnitDetailsByTypeFailed());\n })\n )\n )\n )\n );\n\n loadRenewalsDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadRenewalsDetails),\n withLatestFrom(this.store.select(selectCurrentDashboardViewTypeSimpleText)),\n switchMap(([action, dashboardEnumValue]) =>\n this.restApiService\n .getData(\n `${this.routePath}RenewalsDetails/${action.propertyId}/${dashboardEnumValue}`\n )\n .pipe(\n map(renewalDetailsCombined => loadRenewalsDetailsSuccess({ renewalDetailsCombined })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingRenewalDetails);\n return of(loadRenewalsDetailsFailed());\n })\n )\n )\n )\n );\n\n loadMyProperties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadMyProperties),\n switchMap(action =>\n this.restApiService.getData(`${this.routePath}MyProperties/${action.portfolioId}`).pipe(\n map(result => loadMyPropertiesSuccess({ myProperties: result })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingProperties);\n return of(loadMyPropertiesFailed());\n })\n )\n )\n )\n );\n\n loadUnitsWithActiveTurnovers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadUnitsWithActiveTurnovers),\n switchMap(action =>\n this.restApiService\n .getData(`Units/property/${action.propertyId}/WithActiveTurnovers`)\n .pipe(\n map(unitList => loadUnitsWithActiveTurnoversSuccess({ unitList })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UL01LoadingUnitList);\n return of(loadUnitsWithActiveTurnoversFailed());\n })\n )\n )\n )\n );\n\n loadUnitList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadUnitList),\n switchMap(action =>\n this.restApiService.getData(`Units/property/${action.propertyId}`).pipe(\n map(unitList => loadUnitListSuccess({ unitList })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UL02LoadingUnitList);\n return of(loadUnitListFailed());\n })\n )\n )\n )\n );\n\n loadUnit$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadUnit),\n switchMap(action =>\n this.restApiService.getData(`Units/${action.unitId}`).pipe(\n map(unit => loadUnitSuccess({ unit })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingUnit);\n return of(loadUnitFailed());\n })\n )\n )\n )\n );\n\n updateUnit$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateUnit),\n mergeMap(action =>\n this.restApiService.update(`Units/${action.unit.id}`, action.unit).pipe(\n map(updatedUnit => updateUnitSuccess({ updatedUnit })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingUnit);\n return of(updateUnitFailed());\n })\n )\n )\n )\n );\n\n updateUnitDoNotAutoCreateTurns$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateUnitDoNotAutoCreateTurns),\n mergeMap(action =>\n this.restApiService\n .post(`Units/${action.unitId}/SetDoNotAutoCreateTurns`, {\n doNotAutoCreateTurns: action.doNotAutoCreateTurns,\n })\n .pipe(\n map(() => updateUnitDoNotAutoCreateTurnsSuccess({ doNotAutoCreateTurns: action.doNotAutoCreateTurns })),\n catchError(error => {\n if (error.status === 403) {\n this.snackbarService.error(\"You don't have permission\");\n } else {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingUnit);\n }\n return of(updateUnitDoNotAutoCreateTurnsFailed());\n })\n )\n )\n )\n );\n\n updateUnitDownStatus$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateUnitDownStatus),\n mergeMap(action =>\n this.restApiService\n .update(`Units/${action.unitId}`, {\n isUnitDown: action.isUnitDown,\n isUnitDownReason: action.isUnitDown ? action.isUnitDownReason : null,\n })\n .pipe(\n map(updatedUnit => updateUnitDownStatusSuccess({ updatedUnit })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingUnit);\n return of(updateUnitDownStatusFailed());\n })\n )\n )\n )\n );\n\n getRenewalStrategyForUnit$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getRenewalStrategyForUnit),\n switchMap(action =>\n this.renewalsService.renewalTargetForUnitId(action.unitId).pipe(\n map(unitTypeRentTarget => getRenewalStrategyForUnitSuccess({ unitTypeRentTarget })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingRenealStrategy);\n return of(getRenewalStrategyForUnitFailed());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private restApiService: RestapiService,\n private store: Store<{}>,\n private snackbarService: SnackbarService,\n private turnoversService: TurnoversService,\n private renewalsService: RenewalsService,\n private timerService: TimerService\n ) {}\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { of } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\n\nimport { KpiService } from '@app/services/kpi.service';\nimport {\n loadPortfolioKpiTrendLines,\n loadPortfolioKpiWorkflowSteps,\n loadPortfolioKpis,\n loadPortfolioKpisFailed,\n loadPortfolioKpisTrend,\n loadPortfolioKpisTrendFailed,\n loadPortfolioKpisWorkflowStepsFailed,\n setPortfolioKpiTrendLines,\n setPortfolioKpiWorkflowSteps,\n setPortfolioKpis,\n setPortfolioKpisTrend,\n} from '@dashboards/store/actions/kpi.actions';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n@Injectable()\nexport class KpiEffects {\n loadPortfolioKpi$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPortfolioKpis),\n switchMap(action =>\n this.kpiService.fetch(action.portfolioId, 0, action.kpiTypes).pipe(\n map(kpis => {\n return setPortfolioKpis({ kpis: kpis || [] });\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorPortfolioKpi);\n return of(loadPortfolioKpisFailed());\n })\n )\n )\n )\n );\n\n loadPortfolioKpisTrend$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPortfolioKpisTrend),\n switchMap(action =>\n this.kpiService.fetch(action.portfolioId, -action.dateOffset, action.kpiTypes).pipe(\n map(kpis => {\n return setPortfolioKpisTrend({ kpis: kpis || [] });\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorPortfolioKpi);\n return of(loadPortfolioKpisTrendFailed());\n })\n )\n )\n )\n );\n\n loadPortfolioKpiTrendLines$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPortfolioKpiTrendLines),\n switchMap(action =>\n this.kpiService.trend(action.portfolioId, action.kpiTypes, action.trendDays).pipe(\n map(kpis => {\n return setPortfolioKpiTrendLines({ kpis: kpis || [] });\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorPortfolioKpi);\n return of(loadPortfolioKpisTrendFailed());\n })\n )\n )\n )\n );\n\n loadPortfolioKpiWorkflowSteps$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPortfolioKpiWorkflowSteps),\n switchMap(action =>\n this.kpiService.trend(action.portfolioId, action.kpiTypes, action.trendDays).pipe(\n map(kpis => {\n return setPortfolioKpiWorkflowSteps({ kpis: kpis || [] });\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorPortfolioKpi);\n return of(loadPortfolioKpisWorkflowStepsFailed());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private store: Store<{}>,\n private snackbarService: SnackbarService,\n private kpiService: KpiService\n ) {}\n}\n","export enum UserRoles {\n Unassigned = 'unassigned',\n}\n","

Delete general role summary

\n\n
\n \n error\n Delete general role operation failed.\n \n
\n General role\n  {{ data[0]?.generalRole?.roleName }} \n is in use by following users:\n \n
  • \n \n {{ item?.user?.firstName }} {{ item?.user?.lastName }}\n \n {{ item?.user?.email }}\n
  • \n
    \n
    \n\n\n \n\n","import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'app-delete-role-summary-dialog',\n templateUrl: './delete-role-summary-dialog.component.html',\n styleUrls: ['./delete-role-summary-dialog.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DeleteRoleSummaryDialogComponent {\n constructor(\n public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public data: any\n ) {}\n\n close() {\n this.dialogRef.close();\n }\n}\n","import { first } from 'lodash';\n\nimport { UserRoles } from '@shared/enums/user-roles';\nimport { UserToGeneralRoleMapping } from '@shared/interfaces/user-to-general-role-mapping';\nimport { UserWithGeneralRole } from '@shared/interfaces/user-with-general-role';\nimport { RestUserModel } from '@shared/interfaces/user.interface';\nimport { IsUserExistingPipe } from '@shared/pipes/is-user-existing.pipe';\n\nconst isUserExisting = new IsUserExistingPipe();\n\nexport function combineUsersWithGeneralRoles(\n allUsers: RestUserModel[],\n allUserToGeneralRoleMapping: UserToGeneralRoleMapping[]\n): UserWithGeneralRole[] {\n return allUsers.map(user => {\n const entry = first((allUserToGeneralRoleMapping || []).filter(item => item.userId === user.id));\n const roleId = entry?.roleId || null;\n const roleName = isUserExisting.transform(user) ? entry?.associatedRole.roleName || null : UserRoles.Unassigned;\n return {\n ...user,\n roleId,\n roleName,\n };\n });\n}\n\nfunction userWithoutRole(newUser) {\n if (isUserExisting.transform(newUser)) {\n return newUser;\n }\n\n newUser.roleName = UserRoles.Unassigned;\n return newUser;\n}\n\nfunction userWithGeneralRole(newUser, userRole) {\n newUser.roleName = isUserExisting.transform(newUser) ? userRole.roleName : UserRoles.Unassigned;\n\n return newUser;\n}\n","import { Injectable } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { Router } from '@angular/router';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { filter, find, lowerFirst, transform } from 'lodash';\nimport { of } from 'rxjs';\nimport { catchError, exhaustMap, map, mergeMap, switchMap, tap, withLatestFrom } from 'rxjs/operators';\n\nimport { AdminPanelService } from '@app/services/admin-panel.service';\nimport { CacheService } from '@app/services/cache.service';\nimport { RestapiService } from '@app/services/restapi.service';\nimport { UserService } from '@app/services/user.service';\nimport getFilterKey from '@main-application/administration/functions/get-filter-key';\nimport { loadUserData } from '@main-application/store/actions/user.actions';\nimport { selectUserGeneralRole } from '@main-application/store/selectors/user.selectors';\nimport { AppRoutes } from '@shared/constants/app-routes.const';\nimport { GeneralRole } from '@shared/interfaces/general-role';\nimport { GeneralRoleToPermissionLevel } from '@shared/interfaces/general-role-to-permission-level';\nimport { PropertyBasicInfo } from '@shared/interfaces/propertyBasicInfo';\nimport { UserToGeneralRoleMapping } from '@shared/interfaces/user-to-general-role-mapping';\nimport { UserToGeneralRoleModel } from '@shared/interfaces/user-to-general-role-model';\nimport { UserToPropertyMapping } from '@shared/interfaces/user-to-property-mapping';\nimport { RestUserModel } from '@shared/interfaces/user.interface';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport { DeleteRoleSummaryDialogComponent } from '../../components/delete-role-summary-dialog/delete-role-summary-dialog.component';\nimport { combineUsersWithGeneralRoles } from '../../functions/combineUsersWithRoles';\nimport * as AdministrationActions from '../actions/administration.actions';\nimport {\n addingNewUserFailed,\n addingNewUserSucceeded,\n assignUserToProperty,\n assignUserToPropertyError,\n assignUserToPropertySuccess,\n clearAllUsers,\n deleteGeneralRoleFailed,\n deleteGeneralRoleSucceeded,\n inviteNewResidentUser,\n inviteNewResidentUserError,\n inviteNewResidentUserSuccess,\n inviteNewUser,\n inviteNewUserError,\n inviteNewUserSuccess,\n loadAllGeneralRolesSucceeded,\n loadAllGeneralRolesToPermissionMappingSucceeded,\n loadAllPermissionLevelsSucceeded,\n loadAllPropertiesRolesSucceeded,\n loadAllUserToProperyMappingsSucceeded,\n loadAllUsers,\n loadAllUsersSucceeded,\n loadPortfolioUsersSucceeded,\n loadPropertiesStructure,\n loadPropertiesStructureSucceeded,\n loadPropertyUsersFailed,\n loadPropertyUsersSucceeded,\n loadUserToRoleMappingSucceeded,\n reactivateUser,\n reactivateUserSucceeded,\n removeUser,\n removeUserFailed,\n removeUserSucceeded,\n removingPropertyAssignedUser,\n removingPropertyAssignedUserError,\n removingPropertyAssignedUserSuccess,\n requestFailure,\n saveUserToGeneralRole,\n saveUserToGeneralRoleError,\n saveUserToGeneralRoleSuccess,\n savingGeneralRoleFailed,\n savingGeneralRoleSucceeded,\n setAllUsersCombinedWithGeneralRoles,\n startAddNewUser,\n startDeleteGeneralRole,\n startSavingGeneralRole,\n startUpdatingGeneralRole,\n updateResidentUserData,\n updateResidentUserDataError,\n updateResidentUserDataSuccess,\n updateUserData,\n updateUserDataSuccess,\n updatingGeneralRoleFailed,\n updatingGeneralRoleSucceeded,\n} from '../actions/administration.actions';\nimport {\n selectActiveUsers,\n selectAdministrationState,\n selectAllGeneralRoles,\n selectAllUserToGeneralRoleMapping,\n selectAllUsers,\n} from '../selectors/administration.selectors';\n\n@Injectable()\nexport class AdministrationEffects {\n loadAllUsers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadAllUsers),\n withLatestFrom(this.store.select(selectAdministrationState)),\n mergeMap(([action, state]) => {\n const filterKey = getFilterKey(action.filter);\n const cachedData = state.cachedUsers[filterKey];\n\n if (!action.needRefresh && cachedData) {\n return of(\n loadAllUsersSucceeded({\n activeUsers: filter(cachedData, { isActive: true }),\n inactiveUsers: filter(cachedData, { isActive: false }),\n filter: action.filter,\n })\n );\n }\n\n return this.userService.getUserList(action.filter).pipe(\n map(list =>\n loadAllUsersSucceeded({\n activeUsers: filter(list, { isActive: true }),\n inactiveUsers: filter(list, { isActive: false }),\n filter: action.filter,\n })\n ),\n catchError(error => {\n return of(requestFailure(error));\n })\n );\n })\n )\n );\n\n loadPortfolioUsers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadPortfolioUsers),\n mergeMap(action => {\n return this.userService.getPortfolioUserList(action.portfolioId).pipe(\n map(list =>\n loadPortfolioUsersSucceeded({\n activeUsers: filter(list, { isActive: true }),\n inactiveUsers: filter(list, { isActive: false }),\n })\n ),\n catchError(error => {\n return of(requestFailure(error));\n })\n );\n })\n )\n );\n\n loadPropertyUsers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadPropertyUsers),\n switchMap(action => {\n const cacheKey = `propertyUsers_${action.propertyId}`;\n return this.cacheService\n .getCachedInfo(\n cacheKey,\n action.propertyId,\n id => this.userService.getPropertyUserList(id, action?.userTypes, action?.addPermissionsMap),\n undefined,\n undefined,\n new Date(new Date().getTime() + 5 * 60 * 1000) // expired at 5 min\n )\n .pipe(\n map(list =>\n loadPropertyUsersSucceeded({\n activePropertyUsers: filter(list, { isActive: true }),\n inactivePropertyUsers: filter(list, { isActive: false }),\n })\n ),\n catchError(() => of(loadPropertyUsersFailed()))\n );\n })\n )\n );\n\n loadAllPermissionLevels$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadAllPermissionLevels),\n exhaustMap(() =>\n this.restapiService.getData(`AdminPanel/PermissionLevels`).pipe(\n map(permissionLevels => loadAllPermissionLevelsSucceeded({ result: permissionLevels })),\n catchError(error => of(requestFailure(error)))\n )\n )\n )\n );\n\n loadAllGeneralRolesToPermissionMapping$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadAllGeneralRolesToPermissionMapping),\n exhaustMap(() =>\n this.restapiService.getData(`AdminPanel/RolesToPermissions`).pipe(\n map(generalRoleToPermissionMapping =>\n loadAllGeneralRolesToPermissionMappingSucceeded({ result: generalRoleToPermissionMapping })\n ),\n catchError(error => of(requestFailure(error)))\n )\n )\n )\n );\n\n loadAllPropertyRoles$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadAllPropertyRoles),\n exhaustMap(() =>\n this.restapiService.getData(`AdminPanel/PropertyRoles`).pipe(\n map(propertiesRoles => loadAllPropertiesRolesSucceeded({ result: propertiesRoles })),\n catchError(error => of(requestFailure(error)))\n )\n )\n )\n );\n\n loadUserToRoleMapping$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadUserToRoleMapping),\n exhaustMap(() =>\n this.restapiService.getData(`AdminPanel/UserToGeneralRole/`).pipe(\n map(userToGeneralRole => loadUserToRoleMappingSucceeded({ userToGeneralRole })),\n catchError(error => of(requestFailure(error)))\n )\n )\n )\n );\n\n loadAllGeneralRoles$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadAllGeneralRoles),\n exhaustMap(() =>\n this.restapiService.getData(`AdminPanel/GeneralRoles/`).pipe(\n map(generalRoles => loadAllGeneralRolesSucceeded({ generalRoles })),\n catchError(error => of(requestFailure(error)))\n )\n )\n )\n );\n\n loadAllUserToPropertyMappings$ = createEffect(() =>\n this.actions$.pipe(\n ofType(AdministrationActions.loadAllUserToPropertyMappings),\n exhaustMap(() =>\n this.restapiService.getData(`AdminPanel/UserToPropertyRole/`).pipe(\n map(userToPropertyMapping => loadAllUserToProperyMappingsSucceeded({ userToPropertyMapping })),\n catchError(error => of(requestFailure(error)))\n )\n )\n )\n );\n\n combineUsersWithGeneralRoles$ = createEffect(() =>\n this.actions$.pipe(\n ofType(clearAllUsers, loadAllUsersSucceeded, loadUserToRoleMappingSucceeded),\n withLatestFrom(this.store.select(selectAllUsers), this.store.select(selectAllUserToGeneralRoleMapping)),\n map(([, allUsers, allUserToGeneralRoleMapping]) => {\n if (!allUsers || !allUserToGeneralRoleMapping) {\n return setAllUsersCombinedWithGeneralRoles({ usersWithGeneralRoles: null });\n }\n\n const usersCombinedWithRoles = combineUsersWithGeneralRoles(allUsers, allUserToGeneralRoleMapping);\n\n return setAllUsersCombinedWithGeneralRoles({ usersWithGeneralRoles: usersCombinedWithRoles });\n }),\n catchError(error => of(requestFailure(error)))\n )\n );\n\n loadPropertiesStructure$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPropertiesStructure),\n exhaustMap(() => {\n return this.restapiService.getData(`AdminPanel/PropertiesStructure`).pipe(\n map(propertiesStructure => {\n return loadPropertiesStructureSucceeded({ propertiesStructure });\n }),\n catchError(error => of(requestFailure(error)))\n );\n })\n )\n );\n\n startAddingNewUser$ = createEffect(() =>\n this.actions$.pipe(\n ofType(startAddNewUser),\n mergeMap(action => {\n return this.restapiService.create(`Users`, action.user).pipe(\n map(user => addingNewUserSucceeded({ user })),\n catchError(error => {\n return of(requestFailure(error), addingNewUserFailed());\n })\n );\n })\n )\n );\n\n saveUserToGeneralRole$ = createEffect(() =>\n this.actions$.pipe(\n ofType(saveUserToGeneralRole),\n switchMap(action =>\n this.adminPanelService.setUserToGeneralRole(action.usersToGeneralRoleList).pipe(\n map(user => saveUserToGeneralRoleSuccess()),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorAssigningUserToRole);\n return of(saveUserToGeneralRoleError());\n })\n )\n )\n )\n );\n\n saveUserToPropertyRole$ = createEffect(() =>\n this.actions$.pipe(\n ofType(assignUserToProperty),\n switchMap(action =>\n this.adminPanelService.setUserToPropertyRole(action.userToPropertyRoleList).pipe(\n map(user => assignUserToPropertySuccess()),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorAssigningUserToProperty);\n return of(assignUserToPropertyError());\n })\n )\n )\n )\n );\n\n deleteUserToPropertyRole$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removingPropertyAssignedUser),\n switchMap(action =>\n this.adminPanelService.removeUserFromPropertyRole(action.deleteUserToPropertyMappings).pipe(\n map(user => removingPropertyAssignedUserSuccess()),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorRemovingPropertyAssignedUser);\n return of(removingPropertyAssignedUserError());\n })\n )\n )\n )\n );\n\n deleteGeneralRole$ = createEffect(() =>\n this.actions$.pipe(\n ofType(startDeleteGeneralRole),\n mergeMap(generalRole =>\n this.restapiService.create(`AdminPanel/GeneralRoles/remove`, [generalRole.id]).pipe(\n withLatestFrom(this.store.select(selectAllGeneralRoles)),\n mergeMap(([, oldGeneralRoles]) => {\n const newGeneralRoles = oldGeneralRoles.filter(oldRole => oldRole.id !== generalRole.id);\n return [\n loadAllGeneralRolesSucceeded({ generalRoles: newGeneralRoles }),\n deleteGeneralRoleSucceeded(generalRole),\n ];\n }),\n catchError(error => of(deleteGeneralRoleFailed(error)))\n )\n )\n )\n );\n\n deleteGeneralRoleFailed$ = createEffect(\n () =>\n this.actions$.pipe(\n ofType(deleteGeneralRoleFailed),\n withLatestFrom(this.store.select(selectActiveUsers), this.store.select(selectAllGeneralRoles)),\n tap(([result, allUsers, allGeneralRoles]) => {\n const feedback = (result.error?.message || result.error?.['Message']).split('Roles in use error: ')[1];\n const parsedFeedback = this.parseGeneralRoleFeedback(feedback);\n const usersWithRolesList = transform(\n parsedFeedback,\n (acc, entry) => {\n const user = find(allUsers, { id: entry.userId });\n const generalRole = find(allGeneralRoles, { id: entry.roleId });\n acc.push({ user, generalRole });\n },\n []\n );\n this.dialog.open(DeleteRoleSummaryDialogComponent, {\n autoFocus: false,\n data: usersWithRolesList,\n width: '620px',\n });\n })\n ),\n { dispatch: false }\n );\n\n startSavingGeneralRole$ = createEffect(() =>\n this.actions$.pipe(\n ofType(startSavingGeneralRole),\n mergeMap(({ generalRole }) =>\n this.restapiService.create(`AdminPanel/GeneralRoles`, [generalRole]).pipe(\n tap(() => {\n this.router.navigate([AppRoutes.SETTINGS_ROLES]).then();\n }),\n map(() => savingGeneralRoleSucceeded()),\n catchError(error => of(savingGeneralRoleFailed(), requestFailure(error)))\n )\n )\n )\n );\n\n startUpdatingGeneralRole$ = createEffect(() =>\n this.actions$.pipe(\n ofType(startUpdatingGeneralRole),\n withLatestFrom(this.store.select(selectUserGeneralRole)),\n mergeMap(([{ generalRole }, currentUserGeneralRole]) =>\n this.restapiService.update(`AdminPanel/GeneralRoles`, [generalRole]).pipe(\n mergeMap(() => {\n if (generalRole.roleName === currentUserGeneralRole) {\n this.userService.expireCashedUserData();\n return [updatingGeneralRoleSucceeded(), loadUserData()];\n }\n\n return [updatingGeneralRoleSucceeded()];\n }),\n catchError(error => of(updatingGeneralRoleFailed(), requestFailure(error)))\n )\n )\n )\n );\n\n requestFailure$ = createEffect(\n () =>\n this.actions$.pipe(\n ofType(requestFailure),\n tap(error => {\n this.snackbarService.error(error.message);\n })\n ),\n { dispatch: false }\n );\n\n inviteNewUser$ = createEffect(() =>\n this.actions$.pipe(\n ofType(inviteNewUser),\n switchMap(action =>\n this.userService.inviteUser(action.user).pipe(\n map(user => {\n const userId = user.id;\n const roleId = action.roleId;\n const usersToGeneralRoleList: UserToGeneralRoleModel[] = [{ roleId, userId }];\n const userToPropertyRoleList: UserToPropertyMapping[] = action.selectedProperty.map(\n propertyId => {\n return {\n propertyId,\n userId,\n roleId,\n id: 0,\n };\n }\n );\n\n return { user, usersToGeneralRoleList, userToPropertyRoleList };\n }),\n mergeMap(param => [\n inviteNewUserSuccess({ user: param.user }),\n saveUserToGeneralRole({ usersToGeneralRoleList: param.usersToGeneralRoleList }),\n assignUserToProperty({ userToPropertyRoleList: param.userToPropertyRoleList }),\n ]),\n tap(() => this.cacheService.resetCacheByKey('propertyUsers')),\n catchError(error => {\n const errorMessage = error?.error ?? '';\n const message = errorMessage.includes('User exists in Azure Active Directory')\n ? SnackbarErrorMessage.ErrorUserAlreadyExist.replace(\n '{0}',\n action.user?.email || action.user?.phoneNumber || ''\n )\n : errorMessage.includes('One or more properties contains invalid values')\n ? SnackbarErrorMessage.ErrorWrongEmail\n : SnackbarErrorMessage.ErrorInvitingUser;\n this.snackbarService.error(message);\n return of(inviteNewUserError());\n })\n )\n )\n )\n );\n\n updateUserData$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateUserData),\n switchMap(action =>\n this.userService.setUserData(action.user).pipe(\n map(user => {\n const userId = user.id;\n const roleId = action.roleId;\n const usersToGeneralRoleList: UserToGeneralRoleModel[] = [{ roleId, userId }];\n return usersToGeneralRoleList;\n }),\n mergeMap(usersToGeneralRoleList => [\n updateUserDataSuccess(),\n saveUserToGeneralRole({ usersToGeneralRoleList }),\n assignUserToProperty({ userToPropertyRoleList: action.userToPropertyRoleList }),\n removingPropertyAssignedUser({ deleteUserToPropertyMappings: action.deleteUserToPropertyMappings }),\n ]),\n tap(() => this.cacheService.resetCacheByKey('propertyUsers')),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorUpdatingUser);\n return of(savingGeneralRoleFailed());\n })\n )\n )\n )\n );\n\n inviteNewResidentUser$ = createEffect(() =>\n this.actions$.pipe(\n ofType(inviteNewResidentUser),\n switchMap(action =>\n this.userService.inviteResidentUser(action.user).pipe(\n map(user => {\n const userId = user.id;\n const roleId = action.roleId;\n const usersToGeneralRoleList: UserToGeneralRoleModel[] = [{ roleId, userId }];\n\n return { user, usersToGeneralRoleList };\n }),\n mergeMap(param => [\n inviteNewResidentUserSuccess({ user: param.user }),\n saveUserToGeneralRole({ usersToGeneralRoleList: param.usersToGeneralRoleList }),\n ]),\n tap(() => this.cacheService.resetCacheByKey('propertyUsers')),\n catchError(error => {\n const errorMessage = error?.error ?? '';\n const message = errorMessage.includes('User exists in Azure Active Directory')\n ? SnackbarErrorMessage.ErrorUserAlreadyExist.replace(\n '{0}',\n action.user?.email ?? action.user?.phoneNumber ?? ''\n )\n : errorMessage.includes('One or more properties contains invalid values')\n ? SnackbarErrorMessage.ErrorWrongEmail\n : SnackbarErrorMessage.ErrorInvitingUser;\n this.snackbarService.error(message);\n return of(inviteNewResidentUserError());\n })\n )\n )\n )\n );\n\n updateResidentUserData$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateResidentUserData),\n switchMap(action =>\n this.userService.setResidentUserData(action.user).pipe(\n map(user => {\n const userId = user.id;\n const roleId = action.roleId;\n const usersToGeneralRoleList: UserToGeneralRoleModel[] = [{ roleId, userId }];\n return usersToGeneralRoleList;\n }),\n mergeMap(usersToGeneralRoleList => [\n updateResidentUserDataSuccess(),\n saveUserToGeneralRole({ usersToGeneralRoleList }),\n ]),\n tap(() => this.cacheService.resetCacheByKey('propertyUsers')),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorUpdatingUser);\n return of(updateResidentUserDataError());\n })\n )\n )\n )\n );\n\n removeUser$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removeUser),\n mergeMap(action =>\n this.userService.removeUser(action.user).pipe(\n mergeMap(() => [removeUserSucceeded(), loadAllUsers({})]),\n tap(() => {\n this.snackbarService.info(\n `${action.user.firstName}'s turns/tickets have been reassigned to the PM` as SnackbarErrorMessage\n );\n }),\n tap(() => this.cacheService.resetCacheByKey('propertyUsers')),\n catchError(() => of(removeUserFailed()))\n )\n )\n )\n );\n\n reactivateUser$ = createEffect(() =>\n this.actions$.pipe(\n ofType(reactivateUser),\n mergeMap(action =>\n this.userService.reactivateUser(action.user).pipe(\n mergeMap(() => [reactivateUserSucceeded(), loadAllUsers({})]),\n catchError(() => of(removeUserFailed()))\n )\n )\n )\n );\n\n constructor(\n private router: Router,\n private dialog: MatDialog,\n private actions$: Actions,\n private store: Store<{}>,\n private restapiService: RestapiService,\n private snackbarService: SnackbarService,\n private userService: UserService,\n private adminPanelService: AdminPanelService,\n private cacheService: CacheService\n ) {}\n\n parseGeneralRoleFeedback(feedback: string): UserToGeneralRoleModel[] {\n const feedbackArray = feedback.split(';');\n return feedbackArray.map(entry => {\n return entry.split(',').reduce((acc, keyValuePair) => {\n const [key, value] = keyValuePair.split(':');\n acc[lowerFirst(key)] = parseInt(value, 10);\n return acc;\n }, {} as UserToGeneralRoleModel);\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, map, mergeMap } from 'rxjs/operators';\n\nimport { BoardService } from '@main-application/boards/services/board.service';\nimport {\n getTemplatesUsage,\n getTemplatesUsageFailed,\n getTemplatesUsageSuccess,\n loadBoardList,\n loadBoardListFailed,\n loadBoardListSuccess,\n loadBoardSummaryDetails,\n loadBoardSummaryDetailsFailed,\n loadBoardSummaryDetailsSuccess,\n loadBoardSummaryStats,\n loadBoardSummaryStatsFailed,\n loadBoardSummaryStatsSuccess,\n updateTemplateUsage,\n updateTemplateUsageFailed,\n updateTemplateUsageSuccess,\n} from '@main-application/boards/store/boards.actions';\n\n@Injectable()\nexport class BoardsEffects {\n loadBoardList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadBoardList),\n mergeMap(() =>\n this.boardService.getList().pipe(\n map(boards => loadBoardListSuccess({ boards })),\n catchError(err => {\n return of(loadBoardListFailed());\n })\n )\n )\n )\n );\n\n updateTemplateUsage$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateTemplateUsage),\n mergeMap(action =>\n this.boardService.updateTemplateUsage(action.usage).pipe(\n map(() => updateTemplateUsageSuccess()),\n catchError(() => of(updateTemplateUsageFailed()))\n )\n )\n )\n );\n\n getTemplatesUsage$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTemplatesUsage),\n mergeMap(action =>\n this.boardService.getTemplatesUsage(action.id).pipe(\n map(templatesUsage => {\n return getTemplatesUsageSuccess({ templatesUsage });\n }),\n catchError(error => {\n return of(getTemplatesUsageFailed({ error }));\n })\n )\n )\n )\n );\n\n loadBoardSummaryStats$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadBoardSummaryStats),\n mergeMap(action =>\n this.boardService.getBoardSummaryStats(action.filter).pipe(\n map(stats => loadBoardSummaryStatsSuccess({ stats })),\n catchError(error => of(loadBoardSummaryStatsFailed({ error })))\n )\n )\n )\n );\n\n loadBoardSummaryDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadBoardSummaryDetails),\n mergeMap(action =>\n this.boardService.getBoardSummaryDetails(action.filter).pipe(\n map(details => loadBoardSummaryDetailsSuccess({ details })),\n catchError(error => of(loadBoardSummaryDetailsFailed({ error })))\n )\n )\n )\n );\n\n constructor(private actions$: Actions, private boardService: BoardService) {}\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { BoardsEffects } from '@main-application/boards/store/boards.effects';\n\nimport * as fromBoards from './boards.reducer';\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n StoreModule.forFeature(fromBoards.boardsFeatureKey, fromBoards.reducer),\n EffectsModule.forFeature([BoardsEffects]),\n ],\n})\nexport class BoardsStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport * as moment from 'moment';\nimport { of } from 'rxjs';\nimport { catchError, map, mergeMap, withLatestFrom } from 'rxjs/operators';\n\nimport { CacheService } from '@app/services/cache.service';\nimport { selectSelectedPortfolioId } from '@dashboards/store/selectors/property-selector.selectors';\nimport {\n loadCalendarInspections,\n loadCalendarInspectionsFailed,\n loadCalendarInspectionsSuccess,\n} from '@main-application/calendar/store/calendar.actions';\nimport { InspectionsType } from '@main-application/inspections/components/inspections-list/inspections-list.component';\nimport { InspectionService } from '@main-application/inspections/services/inspection.service';\n\n@Injectable()\nexport class CalendarEffects {\n loadCalendarInspections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadCalendarInspections),\n withLatestFrom(this.store.select(selectSelectedPortfolioId)),\n mergeMap(([action, portfolioId]) =>\n this.cacheService\n .getCachedInfo(\n `calendarInspections-${portfolioId}-${moment(action.startDate).format('yyyy-MM-DD')}-${moment(\n action.endDate\n ).format('yyyy-MM-DD')}`,\n 0,\n () => this.inspectionService.list(portfolioId, action.startDate, action.endDate, InspectionsType.User, true)\n )\n .pipe(\n map(inspections => loadCalendarInspectionsSuccess({ inspections })),\n catchError(err => {\n return of(loadCalendarInspectionsFailed());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private store: Store<{}>,\n private inspectionService: InspectionService,\n private cacheService: CacheService\n ) {}\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { CalendarEffects } from './calendar.effects';\nimport * as fromBoards from './calendar.reducer';\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n StoreModule.forFeature(fromBoards.calendarFeatureKey, fromBoards.reducer),\n EffectsModule.forFeature([CalendarEffects]),\n ],\n})\nexport class CalendarStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, map, mergeMap, switchMap } from 'rxjs/operators';\n\nimport { AuditService } from '@app/services/audit.service';\nimport { RestapiService } from '@app/services/restapi.service';\nimport { AuditableEntityType } from '@shared/enums/auditable-entity-type';\nimport { RestDelinquencyModel } from '@shared/interfaces/delinquency.interface';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n getDelinquencyChangesHistory,\n getDelinquencyChangesHistoryFailure,\n getDelinquencyChangesHistorySuccess,\n loadDelinquencyById,\n loadDelinquencyByIdFailed,\n loadDelinquencyByIdSucceded,\n loadDelinquencyList,\n loadDelinquencyListFailed,\n loadDelinquencyListSucceded,\n updateDelinquencyDetailsById,\n} from './delinquency.actions';\n\n@Injectable()\nexport class DelinquencyEffects {\n loadDelinquencyList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadDelinquencyList),\n switchMap(action =>\n this.restApiService.getData(`Delinquencies/property/${action.id}`).pipe(\n map(delinquencyList => loadDelinquencyListSucceded({ delinquencyList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DL01RetrievingDelinquencyList);\n return of(loadDelinquencyListFailed());\n })\n )\n )\n )\n );\n\n loadDelinquencyById$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadDelinquencyById),\n switchMap(action =>\n this.restApiService.getData(`Delinquencies/${action.delinquencyId}`).pipe(\n map(delinquencyDetails => loadDelinquencyByIdSucceded({ delinquencyDetails })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DL02RetrievingDelinquencyList);\n return of(loadDelinquencyByIdFailed());\n })\n )\n )\n )\n );\n\n updateDelinquencyById$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateDelinquencyDetailsById),\n mergeMap(action =>\n this.restApiService\n .update(`Delinquencies/${action.delinquencyDetails.id}`, action.delinquencyDetails)\n .pipe(\n mergeMap(delinquencyDetails => [\n loadDelinquencyByIdSucceded({ delinquencyDetails }),\n getDelinquencyChangesHistory({ objectId: delinquencyDetails.id }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingDelinquency);\n return of(loadDelinquencyByIdFailed());\n })\n )\n )\n )\n );\n\n getChangesHistory$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getDelinquencyChangesHistory),\n switchMap(action =>\n this.auditService.getChangesHistory(action.objectId, AuditableEntityType.Delinquency).pipe(\n map(auditModelList => getDelinquencyChangesHistorySuccess({ auditModelList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingDelinquencyHistory);\n return of(getDelinquencyChangesHistoryFailure());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private restApiService: RestapiService,\n private snackbarService: SnackbarService,\n private auditService: AuditService\n ) {}\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, map, mergeMap, switchMap } from 'rxjs/operators';\n\nimport { AuditService } from '@app/services/audit.service';\nimport { RenewalsService } from '@app/services/renewals.service';\nimport { RestapiService } from '@app/services/restapi.service';\nimport { AuditableEntityType } from '@shared/enums/auditable-entity-type';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n getRenewalChangesHistory,\n getRenewalChangesHistoryFailure,\n getRenewalChangesHistorySuccess,\n loadRenewalDetails,\n loadRenewalDetailsSucceded,\n loadRenewalStrategyForUnit,\n loadRenewalStrategyForUnitFailed,\n loadRenewalStrategyForUnitSucceded,\n loadRenewalsList,\n loadRenewalsListFailure,\n loadRenewalsListSucceded,\n saveRenewalDetails,\n saveRenewalDetailsFailure,\n} from './renewals.actions';\n\n@Injectable()\nexport class RenewalsEffects {\n loadRenewalsList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadRenewalsList),\n switchMap(action =>\n this.renewalsService.getRenewalList(action.propertyId).pipe(\n map(renewalsList => loadRenewalsListSucceded({ renewalsList: renewalsList || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingRenewalsList);\n return of(loadRenewalsListFailure());\n })\n )\n )\n )\n );\n\n loadRenewalDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadRenewalDetails),\n switchMap(action =>\n this.renewalsService.getRenewalDetails(action.renewalId).pipe(\n map(renewalDetails => loadRenewalDetailsSucceded({ renewalDetails })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingRenewalData);\n return of(loadRenewalsListFailure());\n })\n )\n )\n )\n );\n\n loadRenewalStrategyForUnit$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadRenewalStrategyForUnit),\n switchMap(action =>\n this.renewalsService.renewalTargetForUnitId(action.unitId).pipe(\n map(unitTypeRentTarget => loadRenewalStrategyForUnitSucceded({ unitTypeRentTarget })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingRenewalStrategy);\n return of(loadRenewalStrategyForUnitFailed());\n })\n )\n )\n )\n );\n\n updateRenewalDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(saveRenewalDetails),\n mergeMap(action =>\n this.renewalsService.updateRenewalDetails(action.renewalModel).pipe(\n mergeMap(renewalDetails => [\n loadRenewalDetailsSucceded({ renewalDetails }),\n getRenewalChangesHistory({ objectId: action.renewalModel.id }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingRenewal);\n return of(saveRenewalDetailsFailure());\n })\n )\n )\n )\n );\n\n getChangesHistory$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getRenewalChangesHistory),\n switchMap(action =>\n this.auditService.getChangesHistory(action.objectId, AuditableEntityType.Renewal).pipe(\n map(auditModelList => getRenewalChangesHistorySuccess({ auditModelList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingRenewalChangesHistory);\n return of(getRenewalChangesHistoryFailure());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private snackbarService: SnackbarService,\n private restApiService: RestapiService,\n private renewalsService: RenewalsService,\n private auditService: AuditService\n ) {}\n}\n","import { Injectable } from '@angular/core';\nimport * as moment from 'moment';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RocFilter } from '@main-application/dashboard-reports/roc-report/interfaces/roc-list-item';\nimport { RestTurnoverTaskModel } from '@shared/interfaces/turnover.interface';\n\nimport { TurnoversService } from './turnovers.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class RocService {\n constructor(private restApiService: RestapiService) {}\n\n fetchReport(portfolioId: number, filter: RocFilter): Observable {\n return this.restApiService.getData(\n `turnovers/portfolio/${portfolioId}/underconstruction?begin=${moment(filter.beginDate).format(\n 'YYYY-MM-DD'\n )}&end=${moment(filter.endDate).format('YYYY-MM-DD')}`,\n TurnoversService.fixTimezoneForTurnoverTaskModel\n );\n }\n\n updateMarketRent(turnoverId: number, marketRentOverride: number) {\n return this.restApiService.update(`turnovers/${turnoverId}/UpdateMarketRentOverride`, marketRentOverride);\n }\n\n updateConstructionCost(turnoverId: number, cost: number) {\n return this.restApiService.update(`turnovers/${turnoverId}/UpdateConstructionCost`, cost);\n }\n\n updateNewRent(turnoverId: number, newRent: number) {\n return this.restApiService.update(`turnovers/${turnoverId}/UpdateNewRentOverride`, newRent);\n }\n\n updateOldRent(turnoverId: number, oldRent: number) {\n return this.restApiService.update(`turnovers/${turnoverId}/UpdateOldRentOverride`, oldRent);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport * as moment from 'moment';\nimport { of } from 'rxjs';\nimport { catchError, filter, first, map, switchMap, withLatestFrom } from 'rxjs/operators';\n\nimport { RocService } from '@app/services/roc.service';\nimport {\n loadRocReport,\n loadRocReportError,\n loadRocReportSuccess,\n updateConstructionCost,\n updateConstructionCostSuccess,\n updateMarketRent,\n updateMarketRentSuccess,\n updateNewRent,\n updateNewRentSuccess,\n updateOldRent,\n updateOldRentSuccess,\n} from '@main-application/dashboard-reports/roc-report/store/roc.actions';\nimport { TimezoneService } from '@main-application/management/pages/system-configuration/components/date-time-configuration/timezone.service';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport { environment } from '../../../../../../environments/environment';\nimport { EnvironmentType } from '../../../../../../environments/environment-config';\n\nimport { selectRocFilter, selectRocFilterSet, setInitialDateData, setInitialDateDataSuccess } from '.';\n\n@Injectable()\nexport class RocEffects {\n loadRocReport$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadRocReport),\n switchMap(action =>\n this.store.select(selectRocFilter).pipe(\n filter(f => !!f.beginDate && !!f.endDate),\n first(),\n map(filter => ({\n action,\n filter,\n }))\n )\n ),\n switchMap(({ action, filter }) =>\n this.rocService.fetchReport(action.portfolioId, filter).pipe(\n map(taskList => loadRocReportSuccess({ report: taskList || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.T01RetrievingTasks);\n return of(loadRocReportError());\n })\n )\n )\n )\n );\n\n updateMarketRent$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateMarketRent),\n switchMap(action =>\n this.rocService.updateMarketRent(action.turnoverId, action.value).pipe(\n map(() => updateMarketRentSuccess({ ...action })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.T01RetrievingTasks);\n return of(loadRocReport({ portfolioId: action.portfolioId }));\n })\n )\n )\n )\n );\n\n updateConstructionCost$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateConstructionCost),\n switchMap(action =>\n this.rocService.updateConstructionCost(action.turnoverId, action.value).pipe(\n map(() => updateConstructionCostSuccess({ ...action })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.T01RetrievingTasks);\n return of(loadRocReport({ portfolioId: action.portfolioId }));\n })\n )\n )\n )\n );\n\n updateNewRent$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateNewRent),\n switchMap(action =>\n this.rocService.updateNewRent(action.turnoverId, action.value).pipe(\n map(() => updateNewRentSuccess({ ...action })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.T01RetrievingTasks);\n return of(loadRocReport({ portfolioId: action.portfolioId }));\n })\n )\n )\n )\n );\n\n updateOldRent$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateOldRent),\n switchMap(action =>\n this.rocService.updateOldRent(action.turnoverId, action.value).pipe(\n map(() => updateOldRentSuccess({ ...action })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.T01RetrievingTasks);\n return of(loadRocReport({ portfolioId: action.portfolioId }));\n })\n )\n )\n )\n );\n\n setInitialDateData$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setInitialDateData),\n withLatestFrom(this.store.select(selectRocFilterSet)),\n filter(([_action, corrected]) => !corrected),\n switchMap(() =>\n this.store.select(selectRocFilter).pipe(\n first(),\n this.timezoneService.addTimezoneForEntity((filter, _tz) => ({\n ...filter,\n beginDate:\n environment.type === EnvironmentType.Demo\n ? new Date('12/1/2022')\n : moment(this.timezoneService.getCurrentDate()).add(-3, 'month').startOf('day').toDate(),\n endDate: moment(this.timezoneService.getCurrentDate()).endOf('day').toDate(),\n })),\n map(filter => setInitialDateDataSuccess({ filter }))\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private rocService: RocService,\n private store: Store<{}>,\n private snackbarService: SnackbarService,\n private timezoneService: TimezoneService\n ) {}\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport * as fromRocReportTransient from '@main-application/dashboard-reports/roc-report/store/index';\nimport { RocEffects } from '@main-application/dashboard-reports/roc-report/store/roc.effects';\nimport * as fromRocReportReducer from '@main-application/dashboard-reports/roc-report/store/roc.reducer';\nimport { metaRocReducers } from '@main-application/dashboard-reports/roc-report/store/roc.reducer';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([RocEffects]),\n StoreModule.forFeature(fromRocReportReducer.rocFeatureKey, fromRocReportReducer.reducer, {\n metaReducers: metaRocReducers,\n }),\n StoreModule.forFeature(fromRocReportTransient.rocReportTransientFeatureKey, fromRocReportTransient.reducer),\n ],\n})\nexport class RocReportStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { mergeMap, of, withLatestFrom } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\n\nimport { DynamicInspectionService } from '@main-application/inspections/services/dynamic-inspection.service';\nimport { selectInspectionState } from '@main-application/inspections/store/inspections.selectors';\nimport getInspectionsSummaryFiltersKey from '@main-application/inspections/utils/inspection-mappers';\nimport { getTicketId } from '@main-application/service/service.constants';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n addInspectionTicket,\n addInspectionTicketFailed,\n addInspectionTicketSuccess,\n deleteDynamicInspection,\n deleteDynamicInspectionFailed,\n deleteDynamicInspectionSuccess,\n loadAllInspections,\n loadAllInspectionsFailed,\n loadAllInspectionsSuccess,\n loadDynamicInspections,\n loadDynamicInspectionsFailed,\n loadDynamicInspectionsSuccess,\n loadInReviewInspections,\n loadInReviewInspectionsFailed,\n loadInReviewInspectionsSuccess,\n loadInspectionSummaryReport,\n loadInspectionSummaryReportFailed,\n loadInspectionSummaryReportSucceeded,\n loadRepeatingInspections,\n loadRepeatingInspectionsFailed,\n loadRepeatingInspectionsSuccess,\n loadResidentInspections,\n loadResidentInspectionsFailed,\n loadResidentInspectionsSuccess,\n updateInspectionTicket,\n updateInspectionTicketFailed,\n updateInspectionTicketSuccess,\n} from './inspections.actions';\nimport { InspectionService } from '../services/inspection.service';\n\n@Injectable()\nexport class InspectionsEffects {\n loadAllInspections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadAllInspections),\n switchMap(action =>\n this.inspectionService\n .list(\n action.portfolioId,\n action.startDate,\n action.endDate,\n action.inspectionType,\n action.returnStandardAndResidentBoth,\n action.includeArchived\n )\n .pipe(\n map(result => loadAllInspectionsSuccess({ listItems: result || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingInspectionsList);\n return of(loadAllInspectionsFailed());\n })\n )\n )\n )\n );\n\n loadResidentInspections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadResidentInspections),\n switchMap(action =>\n this.inspectionService.getResidentInspections().pipe(\n map(result => loadResidentInspectionsSuccess({ listItems: result || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingInspectionsList);\n return of(loadResidentInspectionsFailed());\n })\n )\n )\n )\n );\n\n loadInReviewInspections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadInReviewInspections),\n switchMap(action =>\n this.inspectionService\n .inReviewList(\n action.portfolioId,\n action.isResident,\n action.returnStandardAndResidentBoth,\n action.includeArchived\n )\n .pipe(\n map(result => loadInReviewInspectionsSuccess({ inReviewListItems: result || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingInspectionsList);\n return of(loadInReviewInspectionsFailed());\n })\n )\n )\n )\n );\n\n loadDynamicInspections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadDynamicInspections),\n switchMap(action =>\n this.dynamicInspectionService.list(action.portfolioId).pipe(\n map(result => loadDynamicInspectionsSuccess({ listItems: result || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingInspectionsList);\n return of(loadDynamicInspectionsFailed());\n })\n )\n )\n )\n );\n\n loadRepeatingInspections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadRepeatingInspections),\n switchMap(action =>\n this.inspectionService.repeating().pipe(\n map(result => loadRepeatingInspectionsSuccess({ listItems: result || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingInspectionsList);\n return of(loadRepeatingInspectionsFailed());\n })\n )\n )\n )\n );\n\n deleteDynamicInspection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteDynamicInspection),\n switchMap(action =>\n this.dynamicInspectionService.delete(action.inspectionId).pipe(\n mergeMap(() => {\n this.snackbarService.success(`Dynamic ${action.stepName?.toUpperCase() || 'inspection'} deleted`);\n return [loadDynamicInspections({ portfolioId: action.portfolioId }), deleteDynamicInspectionSuccess()];\n }),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.RemovingInspection);\n return of(deleteDynamicInspectionFailed());\n })\n )\n )\n )\n );\n\n addInspectionTicket$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addInspectionTicket),\n switchMap(action =>\n this.inspectionService.createTicket(action.ticket).pipe(\n mergeMap(() => {\n this.snackbarService.success(`Ticket created`);\n return [addInspectionTicketSuccess()];\n }),\n catchError(err => {\n return of(addInspectionTicketFailed());\n })\n )\n )\n )\n );\n\n updateInspectionTicket$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateInspectionTicket),\n switchMap(action =>\n this.inspectionService.updateTicket(action.ticket).pipe(\n mergeMap(result => {\n this.snackbarService.success(`Ticket #${getTicketId(action?.ticket)} updated`);\n return [updateInspectionTicketSuccess()];\n }),\n catchError(err => {\n return of(updateInspectionTicketFailed());\n })\n )\n )\n )\n );\n\n loadInspectionsSummaryReport$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadInspectionSummaryReport),\n withLatestFrom(this.store.select(selectInspectionState)),\n switchMap(([action, state]) => {\n const filterKey = getInspectionsSummaryFiltersKey(action.filter);\n const cachedData = state.summaryStats[filterKey];\n\n if (cachedData) {\n return of(loadInspectionSummaryReportSucceeded({ payload: cachedData, filter: action.filter }));\n }\n\n return this.inspectionService.getSummaryStats(action.filter).pipe(\n map(result => loadInspectionSummaryReportSucceeded({ payload: result, filter: action.filter })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingInspectionsSummaryReport);\n return of(loadInspectionSummaryReportFailed());\n })\n );\n })\n )\n );\n\n constructor(\n private store: Store<{}>,\n private actions$: Actions,\n private snackbarService: SnackbarService,\n private inspectionService: InspectionService,\n private dynamicInspectionService: DynamicInspectionService\n ) {}\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { InspectionsEffects } from './inspections.effects';\nimport * as fromInspectionsReducer from './inspections.reducer';\n\n@NgModule({\n declarations: [],\n imports: [\n EffectsModule.forFeature([InspectionsEffects]),\n StoreModule.forFeature(fromInspectionsReducer.inspectionsFeatureKey, fromInspectionsReducer.reducer),\n ],\n})\nexport class InspectionStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { mergeMap, of, switchMap } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\n\nimport { SystemConfigService } from '@app/services/system-config.service';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n deleteSystemConfig,\n getChatChannels,\n getChatChannelsError,\n getChatChannelsSuccess,\n getSystemConfig,\n getSystemConfigError,\n getSystemConfigSuccess,\n getTimerReport,\n getTimerReportError,\n getTimerReportSuccess,\n setPropertyChatChannels,\n setPropertyChatChannelsError,\n setPropertyChatChannelsSuccess,\n updateSystemConfig,\n updateSystemConfigError,\n updateSystemConfigSuccess,\n} from './system-configuration.actions';\n\n@Injectable()\nexport class SystemConfigurationEffects {\n getSystemConfig$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getSystemConfig),\n switchMap(() =>\n this.systemConfigService.getSystemConfig().pipe(\n map(config => getSystemConfigSuccess({ systemConfig: config })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorRetrievingSystemConfig);\n return of(getSystemConfigError());\n })\n )\n )\n )\n );\n\n deleteSystemConfig$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteSystemConfig),\n switchMap(action =>\n this.systemConfigService.deleteSystemConfig(action.id).pipe(\n mergeMap(config => [getSystemConfig()]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorUpdatingSystemConfig);\n return of(updateSystemConfigError());\n })\n )\n )\n )\n );\n\n updateSystemConfig$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateSystemConfig),\n switchMap(action =>\n (action.pmsCredential.id > 0\n ? this.systemConfigService.updateSystemConfig(action.pmsCredential)\n : this.systemConfigService.addSystemConfig(action.pmsCredential)\n ).pipe(\n mergeMap(config => [updateSystemConfigSuccess(), getSystemConfig()]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorUpdatingSystemConfig);\n return of(updateSystemConfigError());\n })\n )\n )\n )\n );\n\n getTimerReport$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTimerReport),\n switchMap(() =>\n this.systemConfigService.getTimerReport().pipe(\n map(timerReport => getTimerReportSuccess({ timerReport })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorRetrievingTimerReport);\n return of(getTimerReportError());\n })\n )\n )\n )\n );\n\n getChatChannels$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getChatChannels),\n switchMap(() =>\n this.systemConfigService.getChatHooksChannels().pipe(\n map(channels => getChatChannelsSuccess({ channels })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorRetrievingSlackChannels);\n return of(getChatChannelsError());\n })\n )\n )\n )\n );\n\n setPropertyChatChannels$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setPropertyChatChannels),\n switchMap(action =>\n this.systemConfigService.setPropertyChatChannel(action.propertyId, action.channelIds).pipe(\n map(channels => {\n return setPropertyChatChannelsSuccess();\n }),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorUpdatingSlackChannel);\n return of(setPropertyChatChannelsError());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private systemConfigService: SystemConfigService,\n private snackbarService: SnackbarService\n ) {}\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { of } from 'rxjs';\nimport { catchError, first, map, mergeMap, switchMap } from 'rxjs/operators';\n\nimport { PropertiesService } from '@app/services/properties.service';\nimport { selectSelectedPortfolioId } from '@dashboards/store/selectors/property-selector.selectors';\nimport { loadAllUserProperties } from '@main-application/store/actions/user.actions';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport { TurnoverConfigurationStepAssigneesService } from '../../services/turnover-configuration-step-assignees.service';\nimport {\n createResponsibleParties,\n createResponsiblePartiesFailure,\n createResponsiblePartiesSuccess,\n deletePortfolioResponsibleParties,\n deletePortfolioResponsiblePartiesFailure,\n deletePortfolioResponsiblePartiesSuccess,\n deletePropertyProjectManager,\n deleteResponsibleParties,\n loadDefaultPortfolioResponsibleParties,\n loadDefaultPortfolioResponsiblePartiesFailed,\n loadDefaultPortfolioResponsiblePartiesSuccess,\n loadResponsibleParties,\n loadResponsiblePartiesFailure,\n loadResponsiblePartiesSuccess,\n updatePortfolioResponsibleParties,\n updatePortfolioResponsiblePartiesFailure,\n updatePortfolioResponsiblePartiesSuccess,\n updatePropertyProjectManager,\n updatePropertyProjectManagerFailed,\n updatePropertyProjectManagerSuccess,\n updateResponsibleParties,\n updateResponsiblePartiesFailure,\n updateResponsiblePartiesSuccess,\n} from '../actions/turnover-configuration-step-assignees.actions';\n\n@Injectable()\nexport class TurnoverConfigurationStepAssigneesEffects {\n loadResponsibleParties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadResponsibleParties),\n switchMap(action =>\n this.responsiblePartiesService.getResponsiblePartiesOverrideByPortfolioId(action.portfolioId).pipe(\n map(responsibleParties => loadResponsiblePartiesSuccess({ responsibleParties: responsibleParties || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileLoadingResponsibleParties);\n return of(loadResponsiblePartiesFailure());\n })\n )\n )\n )\n );\n\n createResponsibleParties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(createResponsibleParties),\n mergeMap(action =>\n this.responsiblePartiesService.createResponsibleParties(action.responsibleParties).pipe(\n map(createResponsibleParties => createResponsiblePartiesSuccess({ createResponsibleParties })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileCreatingAssignee);\n return this.store.select(selectSelectedPortfolioId).pipe(\n first(),\n mergeMap(portfolioId => of(createResponsiblePartiesFailure(), loadResponsibleParties({ portfolioId })))\n );\n })\n )\n )\n )\n );\n\n updateResponsibleParties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateResponsibleParties),\n mergeMap(action =>\n this.responsiblePartiesService.updateResponsibleParties(action.responsibleParties).pipe(\n map(updateResponsibleParties => updateResponsiblePartiesSuccess({ updateResponsibleParties })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileUpdatingAssignee);\n return of(updateResponsiblePartiesFailure());\n })\n )\n )\n )\n );\n\n deleteResponsibleParties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteResponsibleParties),\n mergeMap(action =>\n this.responsiblePartiesService.deleteResponsibleParties(action.propertyId, action.workflowStepEnumType).pipe(\n map(updateResponsibleParties => {\n if (action.propertyName) {\n this.snackbarService.success(`${action.propertyName} deleted`);\n }\n return deletePortfolioResponsiblePartiesSuccess();\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileUpdatingAssignee);\n return of(deletePortfolioResponsiblePartiesFailure());\n })\n )\n )\n )\n );\n\n loadDefaultPortfolioResponsibleParties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadDefaultPortfolioResponsibleParties),\n switchMap(action =>\n this.responsiblePartiesService.getDefaultAssigneesForPortfolio(action.portfolioId).pipe(\n map(responsibleParties =>\n loadDefaultPortfolioResponsiblePartiesSuccess({ responsibleParties: responsibleParties || [] })\n ),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileLoadingResponsibleParties);\n return of(loadDefaultPortfolioResponsiblePartiesFailed());\n })\n )\n )\n )\n );\n\n updatePortfolioResponsibleParties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updatePortfolioResponsibleParties),\n mergeMap(action =>\n this.responsiblePartiesService\n .updateDefaultAssigneesForPortfolio(action.portfolioId, action.responsibleParties)\n .pipe(\n mergeMap(() => [\n loadDefaultPortfolioResponsibleParties({ portfolioId: action.portfolioId }),\n updatePortfolioResponsiblePartiesSuccess(),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileUpdatingAssignee);\n return of(updatePortfolioResponsiblePartiesFailure());\n })\n )\n )\n )\n );\n\n deletePortfolioResponsibleParties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deletePortfolioResponsibleParties),\n mergeMap(action =>\n this.responsiblePartiesService\n .deleteDefaultAssigneesForPortfolio(action.portfolioId, action.workflowStepType)\n .pipe(\n mergeMap(() => [\n loadDefaultPortfolioResponsibleParties({ portfolioId: action.portfolioId }),\n deletePortfolioResponsiblePartiesSuccess(),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileUpdatingAssignee);\n return of(deletePortfolioResponsiblePartiesFailure());\n })\n )\n )\n )\n );\n\n updatePropertyProjectManager$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updatePropertyProjectManager),\n mergeMap(action =>\n this.propertiesService.updatePropertyManagers([{ ...action }]).pipe(\n mergeMap(() => [updatePropertyProjectManagerSuccess()]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileUpdatingAssignee);\n return of(updatePropertyProjectManagerFailed());\n })\n )\n )\n )\n );\n\n deletePropertyProjectManager$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deletePropertyProjectManager),\n mergeMap(action =>\n this.propertiesService.deletePropertyManagers([{ ...action }]).pipe(\n mergeMap(() => [updatePropertyProjectManagerSuccess(), loadAllUserProperties()]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.WhileUpdatingAssignee);\n return of(updatePropertyProjectManagerFailed());\n })\n )\n )\n )\n );\n\n constructor(\n private store: Store,\n private actions$: Actions,\n private snackbarService: SnackbarService,\n private propertiesService: PropertiesService,\n private responsiblePartiesService: TurnoverConfigurationStepAssigneesService\n ) {}\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { TurnoverConfigurationStepAssigneesEffects } from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/store/effects/turnover-configuration-step-assignees.effects';\nimport * as fromResponsibleParties from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/store/reducers/turnover-configuration-step-assignees.reducer';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([TurnoverConfigurationStepAssigneesEffects]),\n StoreModule.forFeature(fromResponsibleParties.reponsiblePartiesFeatureKey, fromResponsibleParties.reducer),\n ],\n})\nexport class TurnoverConfigurationStepStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { catchError, exhaustMap, map, mergeMap, of, switchMap } from 'rxjs';\n\nimport { TurnoverConfigService } from '@app/services/turnover-config.service';\nimport { loadEnumerations } from '@main-application/store/actions/enumerations.actions';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n addFinish,\n addFinishFailure,\n addFinishSuccess,\n deleteFinish,\n deleteFinishFailure,\n deleteFinishSuccess,\n getElapsedDaysThresholds,\n getElapsedDaysThresholdsFailure,\n getElapsedDaysThresholdsSuccess,\n getTurnoverConfigurationByWorkflowStep,\n getTurnoverConfigurationByWorkflowStepFailure,\n getTurnoverConfigurationByWorkflowStepSuccess,\n getTurnoverConfigurationList,\n getTurnoverConfigurationListFailure,\n getTurnoverConfigurationListSuccess,\n loadFinish,\n loadFinishFailed,\n loadFinishSucceded,\n updateElapsedDaysThresholds,\n updateElapsedDaysThresholdsFailure,\n updateElapsedDaysThresholdsSuccess,\n updateFinish,\n updateFinishFailure,\n updateFinishSuccess,\n updateTurnoverFieldConfiguration,\n updateTurnoverFieldConfigurationFailure,\n updateTurnoverFieldConfigurationSuccess,\n} from '../actions/turnover-configuration.actions';\n\n@Injectable()\nexport class TurnoverConfigurationEffects {\n getTurnoverConfigurationList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTurnoverConfigurationList),\n exhaustMap(action =>\n this.turnoverConfigService.getTurnoverConfigList().pipe(\n map(turnoverConfig => getTurnoverConfigurationListSuccess({ turnoverConfig })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTurnoverConfigurationList);\n return of(getTurnoverConfigurationListFailure());\n })\n )\n )\n )\n );\n\n getTurnoverConfigListByWorkflowStep$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTurnoverConfigurationByWorkflowStep),\n switchMap(action =>\n this.turnoverConfigService.getTurnoverConfigListByWorkflowType(action.workflowStep).pipe(\n map(turnoverConfig => getTurnoverConfigurationByWorkflowStepSuccess({ turnoverConfig })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTurnoverConfigurationElement);\n return of(getTurnoverConfigurationByWorkflowStepFailure());\n })\n )\n )\n )\n );\n\n updateTurnoverFieldConfiguration$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateTurnoverFieldConfiguration),\n mergeMap(action =>\n this.turnoverConfigService.updateTurnoverFieldConfiguration(action.turnoverConfig).pipe(\n map(() => updateTurnoverFieldConfigurationSuccess()),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingTurnoverFieldConfiguration);\n return of(updateTurnoverFieldConfigurationFailure());\n })\n )\n )\n )\n );\n\n getElapsedDaysThresholds$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getElapsedDaysThresholds),\n switchMap(action =>\n this.turnoverConfigService.getElapsedDaysThresholds().pipe(\n map(thresholdsConfiguration => getElapsedDaysThresholdsSuccess({ thresholdsConfiguration })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorRetrievingElapsedDaysThresholds);\n return of(getElapsedDaysThresholdsFailure());\n })\n )\n )\n )\n );\n\n updateElapsedDaysThresholds$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateElapsedDaysThresholds),\n mergeMap(action =>\n this.turnoverConfigService.updateElapsedDaysThresholds(action.thresholdsConfiguration).pipe(\n map(() => updateElapsedDaysThresholdsSuccess()),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorUpdatingElapsedDaysThresholds);\n return of(updateElapsedDaysThresholdsFailure());\n })\n )\n )\n )\n );\n\n loadFinish$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadFinish),\n mergeMap(action => {\n return this.turnoverConfigService.getFinishTypes().pipe(\n map(finishTypes => loadFinishSucceded({ finishTypes })),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorLoadingFinish);\n return of(loadFinishFailed());\n })\n );\n })\n )\n );\n\n addFinish$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addFinish),\n mergeMap(action => {\n return this.turnoverConfigService.addFinishType({ name: action.finish }).pipe(\n mergeMap(finishTypes => [addFinishSuccess(), loadFinish(), loadEnumerations()]),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorAddingFinish);\n return of(addFinishFailure());\n })\n );\n })\n )\n );\n\n updateFinish$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateFinish),\n mergeMap(action => {\n return this.turnoverConfigService.updateFinishType({ id: action.id, name: action.name }).pipe(\n mergeMap(finishTypes => [updateFinishSuccess(), loadFinish(), loadEnumerations()]),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorUpdatingFinish);\n return of(updateFinishFailure());\n })\n );\n })\n )\n );\n\n deleteFinish$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteFinish),\n mergeMap(action => {\n return this.turnoverConfigService.deleteFinishType(action.id).pipe(\n mergeMap(finishTypes => [deleteFinishSuccess(), loadFinish(), loadEnumerations()]),\n catchError(error => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorDeletingFinish);\n return of(deleteFinishFailure());\n })\n );\n })\n )\n );\n\n constructor(\n private actions$: Actions,\n private turnoverConfigService: TurnoverConfigService,\n private snackbarService: SnackbarService\n ) {}\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { TurnoverConfigurationEffects } from '@main-application/management/pages/turnover-configuration/store/effects/turnover-configuration.effects';\n\nimport * as fromTurnoverConfiguration from './reducers';\n\n@NgModule({\n declarations: [],\n imports: [\n StoreModule.forFeature(\n fromTurnoverConfiguration.turnoverConfigurationFeatureKey,\n fromTurnoverConfiguration.reducer\n ),\n EffectsModule.forFeature([TurnoverConfigurationEffects]),\n ],\n})\nexport class TurnoverConfigurationStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { of } from 'rxjs';\nimport { catchError, exhaustMap, map, mergeMap, switchMap, withLatestFrom } from 'rxjs/operators';\n\nimport { RenewalsService } from '@app/services/renewals.service';\nimport { RestapiService } from '@app/services/restapi.service';\nimport { selectSelectedPortfolioId } from '@dashboards/store/selectors/property-selector.selectors';\nimport { RestThresholdSection } from '@shared/interfaces/rest-threshold-section';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n getRenewalTargetList,\n getRenewalTargetListFailure,\n getRenewalTargetListSuccess,\n loadAllThresholds,\n loadAllThresholdsFailed,\n loadAllThresholdsSuccess,\n loadThresholdsProperty,\n loadThresholdsPropertyFailed,\n loadThresholdsPropertySuccess,\n loadThresholdsTask,\n loadThresholdsTaskFailed,\n loadThresholdsTaskSuccess,\n setThresholdsConfig,\n setThresholdsConfigFailed,\n setThresholdsConfigSuccess,\n updateRenewalTarget,\n updateRenewalTargetFailure,\n updateRenewalTargetSuccess,\n} from './management.actions';\n\n@Injectable()\nexport class ManagementEffects {\n constructor(\n private actions$: Actions,\n private restApiService: RestapiService,\n private store: Store<{}>,\n private snackbarService: SnackbarService,\n private renewalsService: RenewalsService\n ) {}\n\n loadAllThresholds$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadAllThresholds),\n exhaustMap(() =>\n this.restApiService.getData(`Thresholds`).pipe(\n map(thresholdSections => loadAllThresholdsSuccess({ thresholdSections })),\n catchError(err => of(loadAllThresholdsFailed()))\n )\n )\n )\n );\n\n loadThresholdsProperty$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadThresholdsProperty),\n switchMap(action =>\n this.restApiService.getData(`Thresholds/portfolio/${action.portfolioId}`).pipe(\n map(thresholdProperty => loadThresholdsPropertySuccess({ thresholdProperty })),\n catchError(err => of(loadThresholdsPropertyFailed()))\n )\n )\n )\n );\n\n loadThresholdsTask$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadThresholdsTask),\n exhaustMap(() =>\n this.restApiService.getData(`Thresholds/tasks`).pipe(\n map(thresholdTask => loadThresholdsTaskSuccess({ thresholdTask })),\n catchError(err => of(loadThresholdsTaskFailed()))\n )\n )\n )\n );\n\n setThresholdsConfig$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setThresholdsConfig),\n switchMap(action =>\n this.restApiService.create(`Thresholds`, action.threshold).pipe(\n withLatestFrom(this.store.select(selectSelectedPortfolioId)),\n mergeMap(([success, portfolioId]) => [\n loadThresholdsProperty({ portfolioId }),\n loadThresholdsTask(),\n setThresholdsConfigSuccess(),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ExecutingUpdate);\n return of(setThresholdsConfigFailed());\n })\n )\n )\n )\n );\n\n getRenewalTargetList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getRenewalTargetList),\n switchMap(action =>\n this.renewalsService.renewalTargetList(action.propertyId).pipe(\n map(list => getRenewalTargetListSuccess({ renewalTargetList: list || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingRenewalStrategies);\n return of(getRenewalTargetListFailure());\n })\n )\n )\n )\n );\n\n updateRenewalTarget$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateRenewalTarget),\n mergeMap(action =>\n this.renewalsService.updateRenewalTarget(action.renewalTargetModels).pipe(\n map(renewalsList => updateRenewalTargetSuccess()),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingRenewalStrategy);\n return of(updateRenewalTargetFailure());\n })\n )\n )\n )\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { ConnectionConfig } from '@shared/interfaces/connection-config.interface';\nimport { BaseNotificationBody, WebNotification } from '@shared/interfaces/notification.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationRestService {\n constructor(private restApiService: RestapiService) {}\n\n getNotifications(): Observable {\n return this.restApiService.getData(`notification`);\n }\n\n markAllAsRead(): Observable {\n return this.restApiService.customPatchData(`notification/markallasread`, null);\n }\n\n markAsRead(baseNotificationBody: BaseNotificationBody): Observable {\n return this.restApiService.customPatchData(`notification/markasread`, baseNotificationBody);\n }\n\n delete(baseNotificationBody: BaseNotificationBody): Observable {\n return this.restApiService.delete(\n `notification?NotificationIds=${baseNotificationBody.notificationIds}`\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { first, orderBy } from 'lodash';\nimport * as moment from 'moment';\nimport { of } from 'rxjs';\nimport { catchError, map, mergeMap, switchMap, take, withLatestFrom } from 'rxjs/operators';\n\nimport { NotificationRestService } from '@app/services/notification-rest.service';\nimport {\n deleteNotification,\n deleteNotificationFailed,\n deleteNotificationSuccess,\n getLastNotificationList,\n getLastNotificationListFailed,\n getLastNotificationListSuccess,\n markAllAsRead,\n markAllAsReadFailed,\n markAllAsReadSuccess,\n markAnyNotificationsAsRead,\n markAsRead,\n markAsReadFailed,\n markAsReadSuccess,\n updateAnyNotifications,\n} from '@main-application/notifications/store/actions/notifications.actions';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport { selectLastAnyNotificationList, selectLastNotificationList } from '../selectors/notifications.selectors';\n\n@Injectable()\nexport class NotificationsEffects {\n /**\n * get last notification list\n */\n getLastNotificationList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getLastNotificationList),\n switchMap(action =>\n this.notificationRestService.getNotifications().pipe(\n map(list => {\n const sortedList = orderBy(list || [], item => moment(item.timestamp).valueOf(), 'desc');\n return getLastNotificationListSuccess({ lastNotificationList: sortedList });\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingNotificationList);\n return of(getLastNotificationListFailed());\n })\n )\n )\n )\n );\n\n /**\n * mark last notification of any user any event\n */\n setAnyNotificationAsRead$ = createEffect(() =>\n this.actions$.pipe(\n ofType(markAnyNotificationsAsRead),\n mergeMap(action =>\n this.store.select(selectLastAnyNotificationList).pipe(\n take(1),\n mergeMap(notifications => {\n const readNotifications = notifications.map(e => ({\n ...e,\n wasRead: e.wasRead || e.additionalData.turnoverIds.includes(action.turnoverId),\n }));\n return [updateAnyNotifications({ list: readNotifications })];\n })\n )\n )\n )\n );\n\n /**\n * set all as read\n */\n setAllAsRead$ = createEffect(() =>\n this.actions$.pipe(\n ofType(markAllAsRead),\n mergeMap(action =>\n this.notificationRestService.markAllAsRead().pipe(\n withLatestFrom(this.store.select(selectLastNotificationList)),\n mergeMap(([, notifications]) => {\n const lastNotificationList = notifications.map(notification => ({ ...notification, wasRead: true }));\n return [markAllAsReadSuccess(), getLastNotificationListSuccess({ lastNotificationList })];\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.MarkingAllNotificationsAsRead);\n return of(markAllAsReadFailed());\n })\n )\n )\n )\n );\n\n /**\n * mark selected as read\n */\n markAsRead$ = createEffect(() =>\n this.actions$.pipe(\n ofType(markAsRead),\n mergeMap(action =>\n this.notificationRestService.markAsRead(action.baseNotificationBody).pipe(\n withLatestFrom(this.store.select(selectLastNotificationList)),\n mergeMap(([, notifications]) => {\n const lastNotificationList = notifications.map(item =>\n item.notificationId === first(action.baseNotificationBody.notificationIds)\n ? { ...item, wasRead: true }\n : item\n );\n return [markAsReadSuccess(), getLastNotificationListSuccess({ lastNotificationList })];\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.MarkingNotificationAsRead);\n return of(markAsReadFailed());\n })\n )\n )\n )\n );\n /**\n * delete notification\n */\n deleteNotification$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteNotification),\n mergeMap(action =>\n this.notificationRestService.delete(action.baseNotificationBody).pipe(\n withLatestFrom(this.store.select(selectLastNotificationList)),\n mergeMap(([, notifications]) => {\n const lastNotificationList = notifications.filter(\n item => item.notificationId !== first(action.baseNotificationBody.notificationIds)\n );\n\n return [deleteNotificationSuccess(), getLastNotificationListSuccess({ lastNotificationList })];\n }),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingNotification);\n return of(deleteNotificationFailed());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private snackbarService: SnackbarService,\n private store: Store<{}>,\n private notificationRestService: NotificationRestService\n ) {}\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { catchError, map, mergeMap, of } from 'rxjs';\n\nimport { TicketsService } from '@app/services/tickets.service';\n\nimport {\n loadServiceSummaryDetails,\n loadServiceSummaryDetailsFailed,\n loadServiceSummaryDetailsSuccess,\n loadServiceSummaryStats,\n loadServiceSummaryStatsFailed,\n loadServiceSummaryStatsSuccess,\n} from './service.actions';\n\n@Injectable()\nexport class ServiceEffects {\n constructor(private actions$: Actions, private ticketsService: TicketsService) {}\n\n loadServiceSummaryStats$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadServiceSummaryStats),\n mergeMap(action =>\n this.ticketsService.getServiceSummaryStats(action.filter).pipe(\n map(stats => loadServiceSummaryStatsSuccess({ stats })),\n catchError(error => of(loadServiceSummaryStatsFailed({ error })))\n )\n )\n )\n );\n\n loadServiceSummaryDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadServiceSummaryDetails),\n mergeMap(action =>\n this.ticketsService.getServiceSummaryDetails(action.filter).pipe(\n map(details => loadServiceSummaryDetailsSuccess({ details })),\n catchError(error => of(loadServiceSummaryDetailsFailed({ error })))\n )\n )\n )\n );\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { ServiceEffects } from './service.effects';\nimport * as fromServiceReducer from './service.reducer';\n\n@NgModule({\n declarations: [],\n imports: [\n StoreModule.forFeature(fromServiceReducer.serviceFeatureKey, fromServiceReducer.reducer),\n EffectsModule.forFeature([ServiceEffects]),\n ],\n})\nexport class ServiceStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, exhaustMap, map } from 'rxjs/operators';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { EnumerationConfig } from '@shared/interfaces/enumeration-config';\n\nimport { loadEnumerations, loadEnumerationsFailed, loadEnumerationsSuccess } from '../actions/enumerations.actions';\n\n@Injectable()\nexport class EnumerationEffects {\n loadEnumerations$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadEnumerations),\n exhaustMap(() =>\n this.restApiService.getData(`Enumerations`).pipe(\n map(result => loadEnumerationsSuccess({ enumerations: result })),\n catchError(err => of(loadEnumerationsFailed()))\n )\n )\n )\n );\n\n constructor(private actions$: Actions, private restApiService: RestapiService) {}\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, map, mergeMap } from 'rxjs/operators';\n\nimport { FileUploadsService } from '@app/services/file-uploads.service';\nimport {\n deleteFile,\n deleteFileFailed,\n deleteFileSuccess,\n uploadFile,\n uploadFileFail,\n uploadFileSuccess,\n} from '@main-application/store/actions/file-upload.actions';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\n@Injectable()\nexport class FileUploadEffects {\n constructor(\n private actions$: Actions,\n private snackbarService: SnackbarService,\n private fileUploadsService: FileUploadsService\n ) {}\n\n uploadFile$ = createEffect(() =>\n this.actions$.pipe(\n ofType(uploadFile),\n mergeMap(action =>\n this.fileUploadsService.uploadFile(action.file).pipe(\n map(uploadedFile =>\n uploadFileSuccess({\n uploadedFileItem: {\n uploadedFile,\n attachmentSection: action.attachmentSection,\n },\n })\n ),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UploadingFile);\n return of(uploadFileFail());\n })\n )\n )\n )\n );\n\n deleteFile$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteFile),\n mergeMap(action =>\n this.fileUploadsService.removeFile(action.fileId).pipe(\n map(uploadedFile => deleteFileSuccess()),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingFile);\n return of(deleteFileFailed());\n })\n )\n )\n )\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, exhaustMap, map } from 'rxjs/operators';\n\nimport { TenantService } from '@app/services/tenant.service';\nimport { UserService } from '@app/services/user.service';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n loadTenantData,\n loadUserById,\n loadUserByIdFailed,\n loadUserByIdSucceded,\n loadUserData,\n loadUserDataFailed,\n loadUserDataSucceded,\n loadUserTenantFailed,\n loadUserTenantSucceeded,\n updateTenantSettings,\n updateTenantSettingsFailed,\n updateTenantSettingsSucceeded,\n} from '../actions/user.actions';\n\n@Injectable()\nexport class UserEffects {\n loadUserData$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadUserData),\n exhaustMap(action =>\n this.userService.getCashedUserData().pipe(\n map(userData => loadUserDataSucceded(userData)),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingUserData);\n return of(loadUserDataFailed());\n })\n )\n )\n )\n );\n\n loadTenantData$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadTenantData),\n exhaustMap(action =>\n this.tenantService.getCachedTenant().pipe(\n map(tenantData => loadUserTenantSucceeded(tenantData)),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTenantData);\n return of(loadUserTenantFailed());\n })\n )\n )\n )\n );\n\n loadUserDataById$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadUserById),\n exhaustMap(action =>\n this.userService.getUserById(action.userId).pipe(\n map(userData => loadUserByIdSucceded(userData)),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingUser);\n return of(loadUserByIdFailed());\n })\n )\n )\n )\n );\n\n updateTenantSettings$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateTenantSettings),\n exhaustMap(action =>\n this.tenantService.updateTenantSettings(action.settings).pipe(\n map(settings => updateTenantSettingsSucceeded({ settings })),\n catchError(error => {\n return of(updateTenantSettingsFailed({ error }));\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private userService: UserService,\n private snackbarService: SnackbarService,\n private tenantService: TenantService\n ) {}\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, map, mergeMap, switchMap } from 'rxjs/operators';\n\nimport { TicketsService } from '@app/services/tickets.service';\nimport {\n getPropertyTicketList,\n getPropertyTicketListFailed,\n getPropertyTicketListSuccess,\n getTicketList,\n getTicketListFailed,\n getTicketListSuccess,\n markTicketAsDone,\n markTicketAsDoneFailed,\n markTicketAsDoneSuccess,\n} from '@main-application/tickets/store/actions/tickets.actions';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\n@Injectable()\nexport class TicketsEffects {\n constructor(\n private actions$: Actions,\n private ticketsService: TicketsService,\n private snackbarService: SnackbarService\n ) {}\n\n getTicketList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTicketList),\n switchMap(action =>\n this.ticketsService.getTicketsByAssigneeId(action.assigneeId).pipe(\n map(ticketList => getTicketListSuccess({ ticketList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTicketList);\n return of(getTicketListFailed());\n })\n )\n )\n )\n );\n\n getPropertyTicketList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getPropertyTicketList),\n switchMap(action =>\n this.ticketsService.getTicketsByPropertyId(action.propertyId).pipe(\n map(list => getPropertyTicketListSuccess({ ticketList: list || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTicketList);\n return of(getPropertyTicketListFailed());\n })\n )\n )\n )\n );\n\n markTicketAsDone$ = createEffect(() =>\n this.actions$.pipe(\n ofType(markTicketAsDone),\n mergeMap(action =>\n this.ticketsService.update(action.turnoverTicket).pipe(\n map(updatedTicket => markTicketAsDoneSuccess({ updatedTicket })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingTicket);\n return of(markTicketAsDoneFailed());\n })\n )\n )\n )\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { of, withLatestFrom } from 'rxjs';\nimport { debounceTime, mergeMap } from 'rxjs/operators';\n\nimport {\n setListScrollState,\n setWidgetsCollapseState,\n} from '@main-application/turnovers/components/turnover-list/store/actions/turnover-list.actions';\nimport { selectTurnoverWidgetsCollapseState } from '@main-application/turnovers/components/turnover-list/store/selectors/turnover-list.selectors';\n\n@Injectable()\nexport class TurnoverListEffects {\n setListScrollState$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setListScrollState),\n withLatestFrom(this.store.select(selectTurnoverWidgetsCollapseState)),\n debounceTime(100),\n mergeMap(([action, state]) => {\n if (!state.manually || !state.collapsed) {\n if (action.position > 200) {\n return of(setWidgetsCollapseState({ collapsed: true, manually: false }));\n }\n if (action.position < 100) {\n return of(setWidgetsCollapseState({ collapsed: false, manually: false }));\n }\n }\n return of(setWidgetsCollapseState(state));\n })\n )\n );\n\n constructor(private actions$: Actions, private store: Store<{}>) {}\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RestBidModel, RestTypedBidAttachment } from '@shared/interfaces/bid.interface';\nimport { RestBulkScopeAndBidModel } from '@shared/interfaces/rest-bulk-scope-and-bid-model';\nimport { UpdateTypedAttachmentToEntityModel } from '@shared/interfaces/turnover.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class BidsService {\n constructor(private restApiService: RestapiService) {}\n\n create(bidList: RestBidModel[]): Observable {\n return this.restApiService.create(`Bids`, bidList);\n }\n\n update(bid: RestBidModel): Observable {\n return this.restApiService.update(`Bids/${bid.id}`, bid);\n }\n\n reject(id: number): Observable {\n return this.restApiService.create(`Bids/reject/${id}`, {});\n }\n\n getBid(bidId: number): Observable {\n return this.restApiService.getData(`Bids/${bidId}`);\n }\n\n setAttachment(attachmentToEntity: UpdateTypedAttachmentToEntityModel): Observable {\n return this.restApiService.create(\n `Bids/${attachmentToEntity.bidId}/Attachments`,\n attachmentToEntity\n );\n }\n\n getTurnoverBids(turnoverId: number): Observable {\n return this.restApiService.getData(`Bids/turnover/${turnoverId}`);\n }\n\n getCompanyBids(companyId: number): Observable {\n return this.restApiService.getData(`Bids/company/${companyId}`);\n }\n\n getAllBids(): Observable {\n return this.restApiService.getData(`Bids`);\n }\n\n deleteBidAttachment(bidId: number, attachmentId: number): Observable {\n return this.restApiService.delete(`Bids/${bidId}/Attachments/${attachmentId}`);\n }\n\n getBidAttachments(bidId: number): Observable {\n return this.restApiService.getData(`Bids/${bidId}/Attachments`);\n }\n\n createBulkScope(bulkScope: RestBulkScopeAndBidModel): Observable {\n return this.restApiService.create(`Bids/bulk-scope-and-bid`, bulkScope);\n }\n\n getBulkScopeList(propertyId: number): Observable {\n return this.restApiService.getData(`Bids/bulk-scope-and-bid/property/${propertyId}`);\n }\n\n getBulkScope(bulkScopeId: number): Observable {\n return this.restApiService.getData(`Bids/bulk-scope-and-bid/${bulkScopeId}`);\n }\n\n updateBulkScope(bulkScope: RestBulkScopeAndBidModel): Observable {\n return this.restApiService.update(`Bids/bulk-scope-and-bid`, bulkScope);\n }\n\n addUnitsToBulk(bulkScope: RestBulkScopeAndBidModel): Observable {\n return this.restApiService.update(`Bids/bulk-scope-and-bid/add-or-update`, bulkScope);\n }\n\n addBulkTurnoversAttachment(body: UpdateTypedAttachmentToEntityModel): Observable {\n return this.restApiService.create('Turnovers/bulk/Attachments', body);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { catchError, map, mergeMap, of, switchMap } from 'rxjs';\n\nimport { BidsService } from '@app/services/bids.service';\nimport { RestBulkScopeAndBidModel } from '@shared/interfaces/rest-bulk-scope-and-bid-model';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n addBulkTurnoversAttachment,\n addBulkTurnoversAttachmentFailed,\n addBulkTurnoversAttachmentSuccess,\n addUnitsToBulk,\n addUnitsToBulkFailed,\n addUnitsToBulkSuccess,\n createNewBulkScope,\n createNewBulkScopeFailed,\n createNewBulkScopeSuccess,\n getBulkScope,\n getBulkScopeFailed,\n getBulkScopeList,\n getBulkScopeListSuccess,\n getBulkScopeSuccess,\n updateBulkScope,\n updateBulkScopeFailed,\n updateBulkScopeSuccess,\n} from '../actions/bulk-and-scope.actions';\n\n@Injectable()\nexport class BulkBidsEffects {\n createNewBulkScope$ = createEffect(() =>\n this.actions$.pipe(\n ofType(createNewBulkScope),\n switchMap(action =>\n this.bidsService.createBulkScope(action.bulkScope).pipe(\n mergeMap((bulkScopeId: RestBulkScopeAndBidModel) => [\n createNewBulkScopeSuccess({ bulkScopeId: bulkScopeId.id }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.CreatingBulkScope);\n return of(createNewBulkScopeFailed());\n })\n )\n )\n )\n );\n\n getBulkScope$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getBulkScope),\n switchMap(action =>\n this.bidsService.getBulkScope(action.bulkScopeId).pipe(\n map(bulkScope => getBulkScopeSuccess({ bulkScope })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingBulkScope);\n return of(getBulkScopeFailed());\n })\n )\n )\n )\n );\n\n updateBulkScope$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateBulkScope),\n mergeMap(action =>\n this.bidsService.updateBulkScope(action.bulkScope).pipe(\n map(() => updateBulkScopeSuccess()),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingBulkScope);\n return of(updateBulkScopeFailed());\n })\n )\n )\n )\n );\n\n getBulkScopeList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getBulkScopeList),\n switchMap(action =>\n this.bidsService.getBulkScopeList(action.propertyId).pipe(\n map(list => getBulkScopeListSuccess({ bulkList: list || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingBulkScopeList);\n return of(getBulkScopeFailed());\n })\n )\n )\n )\n );\n\n addBulkTurnoversAttachment = createEffect(() =>\n this.actions$.pipe(\n ofType(addBulkTurnoversAttachment),\n mergeMap(action =>\n this.bidsService.addBulkTurnoversAttachment(action.attachment).pipe(\n map(() => addBulkTurnoversAttachmentSuccess()),\n catchError(() => of(addBulkTurnoversAttachmentFailed()))\n )\n )\n )\n );\n\n addUnitsToBulk$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addUnitsToBulk),\n mergeMap(action =>\n this.bidsService.addUnitsToBulk(action.bulkScope).pipe(\n map(() => addUnitsToBulkSuccess()),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingBulkScopeList);\n return of(addUnitsToBulkFailed());\n })\n )\n )\n )\n );\n\n constructor(private actions$: Actions, private bidsService: BidsService, private snackbarService: SnackbarService) {}\n}\n","import { Injectable } from '@angular/core';\n\nimport { RestTicketModel } from '@shared/interfaces/turnover.interface';\n\nimport { RestapiService } from './restapi.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PunchService {\n constructor(private restApiService: RestapiService) {}\n\n loadPunchById(punchId: number) {\n return this.restApiService.getData(`PunchTickets/${punchId}`);\n }\n\n loadPunchesByTurnoverId(turnoverId: string) {\n return this.restApiService.getData(`PunchTickets/ByTurnoverId/${turnoverId}`);\n }\n\n createPunch(punch: RestTicketModel) {\n return this.restApiService.create(`PunchTickets`, punch);\n }\n\n updatePunch(punch: RestTicketModel) {\n return this.restApiService.update(`PunchTickets/${punch.id}`, punch);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { iif, of } from 'rxjs';\nimport { catchError, map, mergeMap } from 'rxjs/operators';\n\nimport { PunchService } from '@app/services/punch.service';\n\nimport {\n loadPunchById,\n loadPunchByIdFailed,\n loadPunchByIdFinished,\n loadPunchesByTurnoverId,\n loadPunchesByTurnoverIdFailed,\n loadPunchesByTurnoverIdFinished,\n sendPunch,\n sendPunchFailed,\n sendPunchFinished,\n} from '../actions/punch.actions';\n\n@Injectable()\nexport class PunchEffects {\n loadPunchById$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPunchById),\n mergeMap(action => {\n return this.punchService.loadPunchById(action.punchId).pipe(\n map(punch => loadPunchByIdFinished({ punch })),\n catchError(error => of(loadPunchByIdFailed()))\n );\n })\n )\n );\n\n sendPunch$ = createEffect(() =>\n this.actions$.pipe(\n ofType(sendPunch),\n mergeMap(action => {\n return iif(\n () => !!action.punch.id,\n this.punchService.updatePunch(action.punch),\n this.punchService.createPunch(action.punch)\n ).pipe(\n map(punch => sendPunchFinished({ punch })),\n catchError(error => of(sendPunchFailed()))\n );\n })\n )\n );\n\n loadPunchesByTurnoverId$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPunchesByTurnoverId),\n mergeMap(action => {\n return this.punchService.loadPunchesByTurnoverId(action.turnoverId as any).pipe(\n map(result => loadPunchesByTurnoverIdFinished({ result })),\n catchError(error => of(loadPunchesByTurnoverIdFailed()))\n );\n })\n )\n );\n\n constructor(private actions$: Actions, private punchService: PunchService) {}\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, map, mergeMap } from 'rxjs/operators';\n\nimport { FileUploadsService } from '@app/services/file-uploads.service';\nimport { TurnoverBidsService } from '@app/services/turnover-bids.service';\nimport { RestTurnoverBidCategory } from '@shared/interfaces/turnover-bids.interface';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n acceptTurnoverBid,\n acceptTurnoverBidFailed,\n acceptTurnoverBidSuccess,\n addTurnoverBidCategory,\n addTurnoverBidCategoryFailed,\n addTurnoverBidCategorySuccess,\n approveTurnoverBid,\n approveTurnoverBidFailed,\n approveTurnoverBidSuccess,\n createTurnoverBid,\n createTurnoverBidFailed,\n createTurnoverBidSuccess,\n loadTurnoverBidCategories,\n loadTurnoverBidCategoriesFailed,\n loadTurnoverBidCategoriesSuccess,\n loadTurnoverBids,\n loadTurnoverBidsFailed,\n loadTurnoverBidsSuccess,\n rejectTurnoverBid,\n rejectTurnoverBidFailed,\n rejectTurnoverBidSuccess,\n removeTurnoverBid,\n removeTurnoverBidFailed,\n removeTurnoverBidSuccess,\n updateTurnoverBid,\n updateTurnoverBidFailed,\n updateTurnoverBidSuccess,\n uploadTurnoverBidInvoice,\n uploadTurnoverBidInvoiceFailed,\n uploadTurnoverBidInvoiceSuccess,\n} from '../actions/turnover-bids.actions';\n\n@Injectable()\nexport class TurnoverBidsEffects {\n loadTurnoverBids$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadTurnoverBids),\n mergeMap(action => {\n return this.turnoverBidsService.list(action.turnoverId).pipe(\n map(bids => loadTurnoverBidsSuccess({ bids })),\n catchError(() => of(loadTurnoverBidsFailed()))\n );\n })\n )\n );\n\n createTurnoverBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(createTurnoverBid),\n mergeMap(action => {\n return this.turnoverBidsService.add(action.bid).pipe(\n map(bidId => createTurnoverBidSuccess({ bidId, turnoverId: action.bid.turnoverId })),\n catchError(() => of(createTurnoverBidFailed()))\n );\n })\n )\n );\n\n createTurnoverBidSuccess$ = createEffect(() =>\n this.actions$.pipe(\n ofType(createTurnoverBidSuccess),\n mergeMap(action => {\n return of(loadTurnoverBids({ turnoverId: action.turnoverId }));\n })\n )\n );\n\n acceptTurnoverBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(acceptTurnoverBid),\n mergeMap(action => {\n return this.turnoverBidsService.accept(action.bidId).pipe(\n map(() => {\n this.snackbarService.success('Bid accepted');\n return acceptTurnoverBidSuccess();\n }),\n catchError(() => of(acceptTurnoverBidFailed()))\n );\n })\n )\n );\n\n rejectTurnoverBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(rejectTurnoverBid),\n mergeMap(action => {\n return this.turnoverBidsService.reject(action.bidId, action.reason).pipe(\n map(() => {\n this.snackbarService.success('Bid rejected');\n return rejectTurnoverBidSuccess();\n }),\n catchError(() => of(rejectTurnoverBidFailed()))\n );\n })\n )\n );\n\n uploadTurnoverBidInvoice$ = createEffect(() =>\n this.actions$.pipe(\n ofType(uploadTurnoverBidInvoice),\n mergeMap(action => {\n return this.fileUploadsService.uploadFile(action.file).pipe(\n map(upload => ({\n upload,\n bid: action.bid,\n }))\n );\n }),\n mergeMap(action => {\n return this.turnoverBidsService.uploadInvoice(action.bid.id, action.upload.id).pipe(\n mergeMap(() => [loadTurnoverBids({ turnoverId: action.bid.turnoverId }), uploadTurnoverBidInvoiceSuccess()]),\n catchError(() => of(uploadTurnoverBidInvoiceFailed()))\n );\n })\n )\n );\n\n updateTurnoverBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateTurnoverBid),\n mergeMap(action => {\n return this.turnoverBidsService.update(action.bid).pipe(\n map(() => updateTurnoverBidSuccess({ bid: action.bid })),\n catchError(() => of(updateTurnoverBidFailed()))\n );\n })\n )\n );\n\n removeTurnoverBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removeTurnoverBid),\n mergeMap(action => {\n return this.turnoverBidsService.delete(action.bidId).pipe(\n map(() => removeTurnoverBidSuccess()),\n catchError(() => of(removeTurnoverBidFailed()))\n );\n })\n )\n );\n\n loadTurnoverBidCategories$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadTurnoverBidCategories),\n mergeMap(() => {\n return this.turnoverBidsService.categoryList().pipe(\n map((categories: RestTurnoverBidCategory[]) => loadTurnoverBidCategoriesSuccess({ categories })),\n catchError(() => of(loadTurnoverBidCategoriesFailed()))\n );\n })\n )\n );\n\n addTurnoverBidCategory$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addTurnoverBidCategory),\n mergeMap(action => {\n return this.turnoverBidsService.addCategory(action.name).pipe(\n mergeMap((categoryId: number) => [\n loadTurnoverBidCategories(),\n addTurnoverBidCategorySuccess({ categoryId }),\n ]),\n catchError(() => of(addTurnoverBidCategoryFailed()))\n );\n })\n )\n );\n\n approveTurnoverBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(approveTurnoverBid),\n mergeMap(action => {\n return this.turnoverBidsService.approve(action.bidId, action.approved, action.denyReason).pipe(\n map(() => {\n if (action.approved) {\n this.snackbarService.success('Bid approved');\n } else {\n this.snackbarService.success('Bid denied');\n }\n return approveTurnoverBidSuccess();\n }),\n catchError(() => of(approveTurnoverBidFailed()))\n );\n })\n )\n );\n\n constructor(\n private actions$: Actions,\n private turnoverBidsService: TurnoverBidsService,\n private fileUploadsService: FileUploadsService,\n private snackbarService: SnackbarService\n ) {}\n}\n","import { UserType } from '@shared/enums/user-type';\nimport { WorkflowStepEnumType } from '@shared/enums/workflow-step.enum';\nimport { RestWorkflowStepAssignmentModel } from '@shared/interfaces/rest-workflow-step-assignment-model.interface';\nimport { RestWorkflowInstanceModel } from '@shared/interfaces/turnover.interface';\nimport { UserData } from '@shared/interfaces/user-data';\n\nexport function UpdateWorkflowStepAssigneeModelFunction(\n workflow: RestWorkflowInstanceModel[],\n workflowStep: WorkflowStepEnumType,\n workflowStepAssignmentModel: RestWorkflowStepAssignmentModel,\n userData?: UserData\n): RestWorkflowInstanceModel[] {\n return workflow.map(item => {\n if (item.workflowStepEnumType === workflowStep) {\n return {\n ...item,\n responsiblePartyId: workflowStepAssignmentModel?.responsiblePartyId || userData?.id || 0,\n responsiblePartyType:\n workflowStepAssignmentModel?.responsiblePartyGroupType || userData?.userType || UserType.None,\n };\n } else {\n return item;\n }\n });\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RestApplianceModel } from '@shared/interfaces/appliance.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AppliancesService {\n constructor(private restApiService: RestapiService) {}\n\n getAppliance(applianceId: number): Observable {\n return this.restApiService.getData(`Appliances/${applianceId}`);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RestWorkflowStepCommentModel } from '@shared/interfaces/comments.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WorkflowStepCommentsService {\n constructor(private restApiService: RestapiService) {}\n\n create(comment: RestWorkflowStepCommentModel): Observable {\n return this.restApiService.create(`WorkflowStepComments`, comment);\n }\n\n update(comment: RestWorkflowStepCommentModel): Observable {\n return this.restApiService.update(`WorkflowStepComments/${comment.id}`, comment);\n }\n\n delete(commentId: number): Observable {\n return this.restApiService.delete(`WorkflowStepComments/${commentId}`);\n }\n\n getWorkflowStepComments(turnoverId: number): Observable {\n return this.restApiService.getData(`WorkflowStepComments/turnover/${turnoverId}`);\n }\n\n addReaction(commentId: number, reactionId: string): Observable {\n return this.restApiService.post(\n `WorkflowStepComments/${commentId}/AddReaction?reactionId=${encodeURIComponent(reactionId)}`,\n {}\n );\n }\n\n deleteReaction(commentId: number, reactionId: string): Observable {\n return this.restApiService.post(\n `WorkflowStepComments/${commentId}/DeleteReaction?reactionId=${encodeURIComponent(reactionId)}`,\n {}\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { first } from 'lodash';\nimport { iif, of } from 'rxjs';\nimport { catchError, filter, map, mergeMap, switchMap, tap, withLatestFrom } from 'rxjs/operators';\n\nimport { AppliancesService } from '@app/services/appliances.service';\nimport { BidsService } from '@app/services/bids.service';\nimport { CacheService } from '@app/services/cache.service';\nimport { CompaniesService } from '@app/services/companies.service';\nimport { FileUploadsService } from '@app/services/file-uploads.service';\nimport { TicketsService } from '@app/services/tickets.service';\nimport { TurnoversService } from '@app/services/turnovers.service';\nimport { WorkflowActionsService } from '@app/services/workflow-actions.service';\nimport { WorkflowStepCommentsService } from '@app/services/workflow-step-comments.service';\nimport { resetTurnoversFilters, setTurnoversFilters } from '@dashboards/store';\nimport { TurnoverConfigurationStepAssigneesService } from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/services/turnover-configuration-step-assignees.service';\nimport { getTicketId } from '@main-application/service/service.constants';\nimport { selectUserData } from '@main-application/store/selectors/user.selectors';\nimport { TicketType } from '@shared/enums/ticket-type';\nimport { WorkflowStepEnumType } from '@shared/enums/workflow-step.enum';\nimport { UpdateWorkflowStepAssigneeModelFunction } from '@shared/functions/update-workflow-step-responsible-party-model.function';\nimport { RestGenericTypedAttachment } from '@shared/interfaces/attachment.interface';\nimport { RestTypedBidAttachment } from '@shared/interfaces/bid.interface';\nimport { RestWorkflowStepAssignmentModel } from '@shared/interfaces/rest-workflow-step-assignment-model.interface';\nimport {\n RestTicketModel,\n RestTurnoverDataModel,\n RestTypedTicketAttachment,\n} from '@shared/interfaces/turnover.interface';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport { loadPunchById } from '../actions/punch.actions';\nimport {\n addNewBid,\n addNewBidFail,\n addNewBidSuccess,\n addNewTurnoverTicket,\n addNewTurnoverTicketFailed,\n addNewTurnoverTicketSuccess,\n addWorkflowStepComment,\n addWorkflowStepCommentFailed,\n addWorkflowStepCommentReaction,\n addWorkflowStepCommentReactionSuccess,\n addWorkflowStepCommentSuccess,\n assignDefaultWorkflowStepAssignee,\n assignDefaultWorkflowStepAssigneeFailed,\n createNewTurnover,\n createNewTurnoverFailed,\n createNewTurnoverSuccess,\n deleteBidAttachment,\n deleteBidAttachmentFailed,\n deleteBidAttachmentSuccess,\n deleteFileFromRepository,\n deleteFileFromRepositoryFailed,\n deleteFileFromRepositorySuccess,\n deleteTurnover,\n deleteTurnoverAttachment,\n deleteTurnoverAttachmentSuccess,\n deleteTurnoverFailed,\n deleteTurnoverSuccess,\n deleteTurnoverTicket,\n deleteTurnoverTicketAttachment,\n deleteTurnoverTicketAttachmentFailed,\n deleteTurnoverTicketAttachmentSuccess,\n deleteTurnoverTicketFailed,\n deleteTurnoverTicketSuccess,\n deleteWorkflowStepComment,\n deleteWorkflowStepCommentFailed,\n deleteWorkflowStepCommentSuccess,\n emptyAction,\n getAllBidList,\n getAllBidListFail,\n getAllBidListSuccess,\n getAppliance,\n getApplianceFailed,\n getApplianceSuccess,\n getBid,\n getBidAttachmentList,\n getBidAttachmentListFailed,\n getBidAttachmentListSuccess,\n getBidCompanyList,\n getBidCompanyListFail,\n getBidCompanyListSuccess,\n getBidFail,\n getBidSuccess,\n getBidTurnoverList,\n getBidTurnoverListFail,\n getBidTurnoverListSuccess,\n getCompanyList,\n getCompanyListFail,\n getCompanyListSuccess,\n getDefaultTurnoversAssignees,\n getDefaultTurnoversAssigneesFailed,\n getDefaultTurnoversAssigneesSuccess,\n getSelectedTicket,\n getSelectedTicketFailed,\n getSelectedTicketSuccess,\n getTicket,\n getTicketAttachments,\n getTicketAttachmentsFailed,\n getTicketAttachmentsSuccess,\n getTicketFailed,\n getTicketSuccess,\n getTurnoverAttachments,\n getTurnoverAttachmentsFailed,\n getTurnoverAttachmentsSuccess,\n getTurnoverData,\n getTurnoverDataFailed,\n getTurnoverDataSuccess,\n getTurnoverTickets,\n getTurnoverTicketsFailed,\n getTurnoverTicketsSuccess,\n getWorkflowStepCommentList,\n getWorkflowStepCommentListFailed,\n getWorkflowStepCommentListSuccess,\n loadTurnoverSummaryDetails,\n loadTurnoverSummaryDetailsFailed,\n loadTurnoverSummaryDetailsSuccess,\n loadTurnoverSummaryStats,\n loadTurnoverSummaryStatsFailed,\n loadTurnoverSummaryStatsSuccess,\n loadTurnoverTimers,\n rejectBid,\n rejectBidFail,\n rejectBidSuccess,\n removeWorkflowStepCommentReaction,\n removeWorkflowStepCommentReactionSuccess,\n setActiveSections,\n setAttachmentToTurnover,\n setAttachmentToTurnoverFailed,\n setAttachmentToTurnoverSuccess,\n setAttachmentsToTurnover,\n setBidAttachment,\n setBidAttachmentFail,\n setBidAttachmentSuccess,\n setEmptyWorkflowStepAssignee,\n setInactiveFilteredSections,\n setStepAssignee,\n setStepAssigneeFailed,\n setStepAssigneeSuccess,\n setTicketAttachment,\n setTicketAttachmentFail,\n setTicketAttachmentSuccess,\n setTurnoverData,\n setTurnoverDataFailed,\n setTurnoverTimers,\n setTurnoverTimersFailed,\n setTurnoverTimersSuccess,\n setWorkflowStepAssignee,\n setWorkflowStepAssigneeFailed,\n setWorkflowStepAssigneeSuccess,\n setWorkflowStepSuccess,\n toggleAllSections,\n toggleInactiveFilteredSingleSection,\n toggleSingleSection,\n transitEmptyWorkflowStepAssignee,\n turnoverTimersLoaded,\n updateBid,\n updateBidComment,\n updateBidCommentFail,\n updateBidCommentSuccess,\n updateBidFail,\n updateBidSuccess,\n updateTicketPreview,\n updateTicketPreviewFailed,\n updateTicketPreviewSuccess,\n updateTurnoverAttachment,\n updateTurnoverAttachmentFailed,\n updateTurnoverAttachmentSuccess,\n updateTurnoverTicket,\n updateTurnoverTicketFailed,\n updateTurnoverTicketSuccess,\n updateWorkflowStepComment,\n updateWorkflowStepCommentFailed,\n updateWorkflowStepCommentSuccess,\n} from '../actions/turnovers.actions';\nimport {\n selectActivePropertyIds,\n selectAllPropertyIds,\n selectInactiveFilteredPropertyIds,\n selectTurnoverData,\n} from '../selectors/turnovers.selectors';\n\n@Injectable()\nexport class TurnoversEffects {\n constructor(\n private actions$: Actions,\n private store: Store<{}>,\n private cacheService: CacheService,\n private snackbarService: SnackbarService,\n private turnoversService: TurnoversService,\n private workflowActionsService: WorkflowActionsService,\n private ticketsService: TicketsService,\n private companiesService: CompaniesService,\n private bidsService: BidsService,\n private appliancesService: AppliancesService,\n private workflowStepCommentsService: WorkflowStepCommentsService,\n private responsiblePartiesService: TurnoverConfigurationStepAssigneesService,\n private fileUploadsService: FileUploadsService\n ) {}\n\n createTurnover$ = createEffect(() =>\n this.actions$.pipe(\n ofType(createNewTurnover),\n switchMap(action =>\n this.turnoversService.create(action.postTurnoverModel).pipe(\n mergeMap(turnoverData => [\n createNewTurnoverSuccess({ turnoverData }),\n assignDefaultWorkflowStepAssignee({\n turnoverData,\n workflowStep: turnoverData.activeWorkflowStepType,\n propertyId: action.postTurnoverModel?.propertyId,\n }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.CreatingTurnover);\n return of(createNewTurnoverFailed());\n })\n )\n )\n )\n );\n\n assignDefaultWorkflowStepAssignee$ = createEffect(() =>\n this.actions$.pipe(\n ofType(assignDefaultWorkflowStepAssignee),\n withLatestFrom(this.store.select(selectUserData)),\n filter(([action]) => {\n return !first(\n (action.turnoverData.workflow || []).filter(item => item.workflowStepEnumType === action.workflowStep)\n )?.responsiblePartyId;\n }),\n switchMap(([action, userData]) =>\n this.responsiblePartiesService.getWorkflowAssignmentsByStepId(action.propertyId, action.workflowStep).pipe(\n filter(\n (restWorkflowStepAssignmentModel: RestWorkflowStepAssignmentModel) =>\n !!restWorkflowStepAssignmentModel || (action.workflowStep === WorkflowStepEnumType.MoveOut && !!userData)\n ),\n map(workflowStepAssignmentModel => {\n return {\n ...action.turnoverData,\n workflow: UpdateWorkflowStepAssigneeModelFunction(\n action.turnoverData.workflow,\n action.workflowStep,\n workflowStepAssignmentModel,\n userData\n ),\n };\n }),\n switchMap((turnoverData: RestTurnoverDataModel) => {\n return this.turnoversService.update(turnoverData).pipe(\n mergeMap(turnoverData => [getTurnoverData({ turnoverId: turnoverData.id })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AssigningAssignee);\n return of(assignDefaultWorkflowStepAssigneeFailed());\n })\n );\n })\n )\n )\n )\n );\n\n getTurnoverData$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTurnoverData),\n switchMap(action =>\n this.turnoversService.getTurnover(action.turnoverId).pipe(\n map(turnoverData => getTurnoverDataSuccess({ turnoverData })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTurnoverData);\n return of(getTurnoverDataFailed());\n })\n )\n )\n )\n );\n\n setTurnoverData$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setTurnoverData),\n switchMap(action => {\n return this.turnoversService.update(action.turnoverData).pipe(\n map(turnoverData => getTurnoverDataSuccess({ turnoverData })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingTurnoverData);\n return of(setTurnoverDataFailed());\n })\n );\n })\n )\n );\n\n setStepAssignee$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setStepAssignee),\n switchMap(action => {\n return this.workflowActionsService\n .moveToNextStep(\n action.workflowAction.turnoverId,\n action.workflowAction.nextWorkflowStep,\n action.workflowAction.assigneeId\n )\n .pipe(\n map(() => setStepAssigneeSuccess()),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorUpdatingTurnoverStepAssignee);\n return of(setStepAssigneeFailed());\n })\n );\n })\n )\n );\n\n getDefaultTurnoversAssignees$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getDefaultTurnoversAssignees),\n switchMap(action => {\n return this.responsiblePartiesService.getResponsiblePartiesByPropertyId(action.propertyId).pipe(\n map(list => getDefaultTurnoversAssigneesSuccess({ defaultTurnoversAssignees: list || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorRetrievingDefaultTurnoverAssignees);\n return of(getDefaultTurnoversAssigneesFailed());\n })\n );\n })\n )\n );\n\n updateDefaultAssigneeOnWorkflowStepChange$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setWorkflowStepSuccess),\n switchMap(action =>\n this.turnoversService.getTurnover(action.turnoverId).pipe(\n map(turnoverData =>\n assignDefaultWorkflowStepAssignee({\n turnoverData,\n workflowStep: action.nextWorkflowStep,\n propertyId: turnoverData.property?.id,\n })\n )\n )\n )\n )\n );\n\n setAttachmentToTurnover$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setAttachmentToTurnover),\n mergeMap(action =>\n this.turnoversService.setAttachment(action.attachmentToEntity).pipe(\n mergeMap(addedAttachment => [\n setAttachmentToTurnoverSuccess({ addedAttachment }),\n !action?.preventReloadList\n ? getTurnoverAttachments({ turnoverId: first(action.attachmentToEntity.turnoverIds) })\n : emptyAction(),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AssigningAttachmentToEntity);\n return of(setAttachmentToTurnoverFailed());\n })\n )\n )\n )\n );\n\n setAttachmentsToTurnover$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setAttachmentsToTurnover),\n mergeMap(action =>\n this.turnoversService.setAttachments(action.turnoverId, action.attachmentType, action.attachments).pipe(\n mergeMap(() => [getTurnoverAttachments({ turnoverId: action.turnoverId })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AssigningAttachmentToEntity);\n return of(setAttachmentToTurnoverFailed());\n })\n )\n )\n )\n );\n\n updateTurnoverAttachment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateTurnoverAttachment),\n mergeMap(action =>\n this.turnoversService.updateAttachment(action.attachmentToEntity).pipe(\n mergeMap(() => [\n updateTurnoverAttachmentSuccess(),\n getTurnoverAttachments({ turnoverId: first(action.attachmentToEntity.turnoverIds) }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingAttachment);\n return of(updateTurnoverAttachmentFailed());\n })\n )\n )\n )\n );\n\n getTurnoverTickets$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTurnoverTickets),\n switchMap(action =>\n this.ticketsService.getTicketsByTurnover(action.turnoverId).pipe(\n map(list => getTurnoverTicketsSuccess({ turnoverTicketList: list || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTurnoverTickets);\n return of(getTurnoverTicketsFailed());\n })\n )\n )\n )\n );\n\n addNewTurnoverTicket$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addNewTurnoverTicket),\n mergeMap(action => {\n return this.ticketsService.create(action.turnoverTicket as RestTicketModel).pipe(\n mergeMap(newTurnoverTicket => [addNewTurnoverTicketSuccess({ newTurnoverTicket })]),\n tap(() => {\n this.snackbarService.success(SnackbarErrorMessage.TicketCreated);\n }),\n catchError(err => {\n if (err?.status === 400 && err?.error?.ErrorCode) {\n this.snackbarService.error(err.error.ErrorCode);\n } else {\n this.snackbarService.error(SnackbarErrorMessage.CreatingTicket);\n }\n\n return of(addNewTurnoverTicketFailed());\n })\n );\n })\n )\n );\n\n updateTurnoverTicket$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateTurnoverTicket),\n mergeMap(action =>\n this.ticketsService.update(action.turnoverTicket).pipe(\n tap((editedTicket: RestTicketModel) => {\n this.snackbarService.success(`Ticket #${editedTicket.id} updated`);\n }),\n mergeMap((editedTicket: RestTicketModel) => [\n updateTurnoverTicketSuccess({ editedTicket }),\n getTurnoverTickets({ turnoverId: editedTicket.turnoverId }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingTurnoverTicket);\n return of(updateTurnoverTicketFailed());\n })\n )\n )\n )\n );\n\n updateTurnoverTicketPreview$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateTicketPreview),\n mergeMap(action =>\n this.ticketsService.update(action.turnoverTicket).pipe(\n mergeMap(editedTicket => [updateTicketPreviewSuccess({ editedTicket })]),\n tap(() => {\n this.snackbarService.success(`Ticket #${getTicketId(action?.turnoverTicket)} updated`);\n }),\n catchError(({ error }) => {\n this.snackbarService.error(error?.ErrorCode ?? SnackbarErrorMessage.UpdatingTicket);\n return of(updateTicketPreviewFailed());\n })\n )\n )\n )\n );\n\n getTurnoverTicket$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getSelectedTicket),\n switchMap(action =>\n this.ticketsService.getTicket(action.ticketId).pipe(\n map(ticket => getSelectedTicketSuccess({ ticket })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTurnoverTicket);\n return of(getSelectedTicketFailed());\n })\n )\n )\n )\n );\n\n deleteTurnoverTicket$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteTurnoverTicket),\n withLatestFrom(this.store.select(selectTurnoverData)),\n mergeMap(([action, turnoverData]) =>\n this.ticketsService.delete(action.ticketId).pipe(\n mergeMap(() => [deleteTurnoverTicketSuccess(), getTurnoverTickets({ turnoverId: turnoverData.id })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingTicket);\n return of(deleteTurnoverTicketFailed());\n })\n )\n )\n )\n );\n\n setTicketAttachment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setTicketAttachment),\n mergeMap(action =>\n this.ticketsService.setAttachment(action.attachmentToEntity).pipe(\n mergeMap(addedTicketAttachment => [\n setTicketAttachmentSuccess({ addedTicketAttachment }),\n action.ticketType === TicketType.Turn\n ? getSelectedTicket({ ticketId: action.attachmentToEntity.ticketId })\n : loadPunchById({ punchId: action.attachmentToEntity.ticketId }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AssigningAttachmentToTicket);\n return of(setTicketAttachmentFail());\n })\n )\n )\n )\n );\n\n getTicket$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTicket),\n switchMap(action =>\n this.ticketsService.getTicket(action.ticketId).pipe(\n map((restTicketModel: RestTicketModel) => getTicketSuccess({ restTicketModel })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTicket);\n return of(getTicketFailed());\n })\n )\n )\n )\n );\n\n getTicketAttachments$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTicketAttachments),\n switchMap(action =>\n this.ticketsService.getTicketAttachment(action.ticketId).pipe(\n map((attachments: RestTypedTicketAttachment[]) =>\n getTicketAttachmentsSuccess({ ticketAttachments: attachments || [] })\n ),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTicketAttachment);\n return of(getTicketAttachmentsFailed());\n })\n )\n )\n )\n );\n\n getCompanyList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getCompanyList),\n switchMap(() => {\n return this.cacheService\n .getCachedInfo(`companiesList`, 0, () => this.companiesService.getCompanyList())\n .pipe(\n map(companyList => getCompanyListSuccess({ companyList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingCompaniesList);\n return of(getCompanyListFail());\n })\n );\n })\n )\n );\n\n getBidTurnoverList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getBidTurnoverList),\n switchMap(action =>\n this.bidsService.getTurnoverBids(action.turnoverId).pipe(\n map(bidList => getBidTurnoverListSuccess({ bidList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingBidList);\n return of(getBidTurnoverListFail());\n })\n )\n )\n )\n );\n\n getBidCompanyList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getBidCompanyList),\n switchMap(action =>\n this.bidsService.getCompanyBids(action.companyId).pipe(\n map(bidList => getBidCompanyListSuccess({ bidList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingVendorsList);\n return of(getBidCompanyListFail());\n })\n )\n )\n )\n );\n\n getAllBidList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getAllBidList),\n switchMap(() =>\n this.bidsService.getAllBids().pipe(\n map(list => getAllBidListSuccess({ bidList: list || [] })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingBidList);\n return of(getAllBidListFail());\n })\n )\n )\n )\n );\n\n getBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getBid),\n switchMap(action =>\n this.bidsService.getBid(action.bidId).pipe(\n map(bid => getBidSuccess({ bid })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingBid);\n return of(getBidFail());\n })\n )\n )\n )\n );\n\n addNewBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addNewBid),\n mergeMap(action =>\n this.bidsService.create(action.bidList).pipe(\n map(newBidList => addNewBidSuccess({ newBidList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AddingBid);\n return of(addNewBidFail());\n })\n )\n )\n )\n );\n\n rejectBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(rejectBid),\n mergeMap(action =>\n this.bidsService.reject(action.id).pipe(\n mergeMap(updatedBid => [\n rejectBidSuccess({ updatedBid }),\n getBidTurnoverList({ turnoverId: first(updatedBid.turnoverIds) }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingBid);\n return of(rejectBidFail());\n })\n )\n )\n )\n );\n\n updateBid$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateBid),\n mergeMap(action =>\n this.bidsService.update(action.bid).pipe(\n mergeMap(updatedBid => [updateBidSuccess({ updatedBid })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingBid);\n return of(updateBidFail());\n })\n )\n )\n )\n );\n\n updateBidComment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateBidComment),\n mergeMap(action =>\n this.bidsService.update(action.bid).pipe(\n map(updatedBid => updateBidCommentSuccess({ updatedBid })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingBid);\n return of(updateBidCommentFail());\n })\n )\n )\n )\n );\n\n setBidAttachment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setBidAttachment),\n mergeMap(action =>\n this.bidsService.setAttachment(action.attachmentToEntity).pipe(\n mergeMap((addedBidAttachment: RestTypedBidAttachment) => [\n setBidAttachmentSuccess({ addedBidAttachment }),\n getBidAttachmentList({ bidId: action.attachmentToEntity.bidId }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AssigningAttachmentToBid);\n return of(setBidAttachmentFail());\n })\n )\n )\n )\n );\n\n getAppliance$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getAppliance),\n switchMap(action =>\n this.appliancesService.getAppliance(action.applianceId).pipe(\n map(appliance => getApplianceSuccess({ appliance })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingApplianceData);\n return of(getApplianceFailed());\n })\n )\n )\n )\n );\n\n getWorkflowStepCommentList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getWorkflowStepCommentList),\n switchMap(action =>\n this.workflowStepCommentsService.getWorkflowStepComments(action.turnoverId).pipe(\n map(workflowStepCommentList => getWorkflowStepCommentListSuccess({ workflowStepCommentList })),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.ReceivingTurnoverComments);\n return of(getWorkflowStepCommentListFailed());\n })\n )\n )\n )\n );\n\n addWorkflowStepComment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addWorkflowStepComment),\n mergeMap(action =>\n this.workflowStepCommentsService.create(action.commentItem).pipe(\n mergeMap(commentItem => [addWorkflowStepCommentSuccess({ commentItem })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AddingComment);\n return of(addWorkflowStepCommentFailed());\n })\n )\n )\n )\n );\n\n addWorkflowStepCommentReaction$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addWorkflowStepCommentReaction),\n mergeMap(action =>\n this.workflowStepCommentsService.addReaction(action.commentItem.id, action.emoji).pipe(\n mergeMap(commentItem => [addWorkflowStepCommentReactionSuccess({ commentItem })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AddingComment);\n return of(addWorkflowStepCommentFailed());\n })\n )\n )\n )\n );\n\n removeWorkflowStepCommentReaction$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removeWorkflowStepCommentReaction),\n mergeMap(action =>\n this.workflowStepCommentsService.deleteReaction(action.commentItem.id, action.emoji).pipe(\n mergeMap(commentItem => [removeWorkflowStepCommentReactionSuccess({ commentItem })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.AddingComment);\n return of(addWorkflowStepCommentFailed());\n })\n )\n )\n )\n );\n\n updateWorkflowStepComment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateWorkflowStepComment),\n mergeMap(action =>\n this.workflowStepCommentsService.update(action.commentItem).pipe(\n mergeMap(commentItem => [\n updateWorkflowStepCommentSuccess({ commentItem }),\n getWorkflowStepCommentList({ turnoverId: commentItem.turnoverDataId }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingComment);\n return of(updateWorkflowStepCommentFailed());\n })\n )\n )\n )\n );\n\n deleteWorkflowStepComment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteWorkflowStepComment),\n mergeMap(action =>\n this.workflowStepCommentsService.delete(action.commentItem.id).pipe(\n mergeMap(() => [\n deleteWorkflowStepCommentSuccess(),\n getWorkflowStepCommentList({ turnoverId: action.commentItem.turnoverDataId }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.Deletingcomment);\n return of(deleteWorkflowStepCommentFailed());\n })\n )\n )\n )\n );\n\n deleteTurnover$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteTurnover),\n mergeMap(action =>\n this.turnoversService.deleteTurnover(action.turnoverId, action.disableAutoTurnCreation).pipe(\n map(() => {\n this.snackbarService.success(SnackbarErrorMessage.TurnoverDeleted, [action.unitName]);\n return deleteTurnoverSuccess();\n }),\n catchError(error => {\n if (error.status === 403) {\n this.snackbarService.error(\"You don't have permission\");\n } else {\n this.snackbarService.error(SnackbarErrorMessage.DeletingTurnover);\n }\n return of(deleteTurnoverFailed());\n })\n )\n )\n )\n );\n\n deleteTurnoverAttachment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteTurnoverAttachment),\n withLatestFrom(this.store.select(selectTurnoverData)),\n mergeMap(([action, turnoverData]) =>\n this.turnoversService.deleteTurnoverAttachment(turnoverData.id, action.attachment.id).pipe(\n switchMap(() =>\n iif(\n () => !!action.attachment?.fileUploadId,\n of(action.attachment?.fileUploadId).pipe(\n map(() => deleteFileFromRepository({ fileId: action.attachment?.fileUploadId }))\n ),\n of(turnoverData.id).pipe(map(() => deleteFileFromRepositorySuccess()))\n )\n ),\n mergeMap(() => [deleteTurnoverAttachmentSuccess(), getTurnoverAttachments({ turnoverId: turnoverData.id })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingAttachment);\n return of(deleteFileFromRepositoryFailed());\n })\n )\n )\n )\n );\n\n deleteTurnoverTicketAttachment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteTurnoverTicketAttachment),\n mergeMap(action =>\n this.ticketsService.deleteTurnoverAttachment(action.ticketId, action.attachment.id).pipe(\n switchMap(() =>\n iif(\n () => !!action.attachment?.fileUploadId,\n of(action.attachment?.fileUploadId).pipe(map((fileId: number) => deleteFileFromRepository({ fileId }))),\n of(null)\n )\n ),\n mergeMap(() => [\n deleteTurnoverTicketAttachmentSuccess(),\n action.ticketType === TicketType.Turn\n ? getTicket({ ticketId: action.ticketId })\n : loadPunchById({ punchId: action.ticketId }),\n ]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingAttachment);\n return of(deleteTurnoverTicketAttachmentFailed());\n })\n )\n )\n )\n );\n\n deleteFileFromRepository$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteFileFromRepository),\n mergeMap(action =>\n this.fileUploadsService.removeFile(action.fileId).pipe(\n map(() => deleteFileFromRepositorySuccess()),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingFileFromRepository);\n return of(deleteFileFromRepositoryFailed());\n })\n )\n )\n )\n );\n\n getTurnoverAttachments$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getTurnoverAttachments),\n mergeMap(action =>\n this.turnoversService.getTurnoversAttachments(action.turnoverId).pipe(\n map((attachments: RestGenericTypedAttachment[]) =>\n getTurnoverAttachmentsSuccess({ allAttachments: attachments || [] })\n ),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingTurnoverAttachmentList);\n return of(getTurnoverAttachmentsFailed());\n })\n )\n )\n )\n );\n\n getBidAttachmentList$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getBidAttachmentList),\n mergeMap(action =>\n this.bidsService.getBidAttachments(action.bidId).pipe(\n map((attachments: RestGenericTypedAttachment[]) =>\n getBidAttachmentListSuccess({ allAttachments: attachments || [] })\n ),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingBidAttachmentList);\n return of(getBidAttachmentListFailed());\n })\n )\n )\n )\n );\n\n deleteBidAttachment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteBidAttachment),\n mergeMap(action =>\n this.bidsService.deleteBidAttachment(action.bidId, action.attachment.id).pipe(\n switchMap(() =>\n iif(\n () => !!action.attachment?.fileUploadId,\n of(action.attachment?.fileUploadId).pipe(map((fileId: number) => deleteFileFromRepository({ fileId }))),\n of(null)\n )\n ),\n mergeMap(() => [deleteBidAttachmentSuccess(), getBidAttachmentList({ bidId: action.bidId })]),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingAttachment);\n return of(deleteBidAttachmentFailed());\n })\n )\n )\n )\n );\n\n toggleAllSections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(toggleAllSections),\n withLatestFrom(this.store.select(selectAllPropertyIds)),\n mergeMap(([action, allPropertyIds]) =>\n this.turnoversService\n .toggleAllSections(allPropertyIds, action.active)\n .pipe(map(activePropertyIds => setActiveSections({ activePropertyIds })))\n )\n )\n );\n\n toggleSingleSection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(toggleSingleSection),\n withLatestFrom(this.store.select(selectActivePropertyIds)),\n mergeMap(([action, activePropertyIds]) =>\n this.turnoversService\n .toggleSingleSection(activePropertyIds, action.propertyId, action.active)\n .pipe(map(activePropertyIds => setActiveSections({ activePropertyIds })))\n )\n )\n );\n\n toggleInactiveFilteredSingleSection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(toggleInactiveFilteredSingleSection),\n withLatestFrom(this.store.select(selectInactiveFilteredPropertyIds)),\n mergeMap(([action, selectInactiveFilteredPropertyIds]) =>\n this.turnoversService\n .toggleSingleSection(selectInactiveFilteredPropertyIds, action.propertyId, action.active)\n .pipe(map(inactiveFilteredPropertyIds => setInactiveFilteredSections({ inactiveFilteredPropertyIds })))\n )\n )\n );\n\n resetInactiveFilteredSections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setTurnoversFilters, resetTurnoversFilters),\n map(() => setInactiveFilteredSections({ inactiveFilteredPropertyIds: [] }))\n )\n );\n\n loadTurnoverTimers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadTurnoverTimers),\n mergeMap(action =>\n this.turnoversService.getTurnoversTimers(action.turnoverId).pipe(\n map(timers => turnoverTimersLoaded({ turnoverId: action.turnoverId, timers })),\n catchError(() => {\n return of(setTurnoverTimersFailed());\n })\n )\n )\n )\n );\n\n setTurnoverTimers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setTurnoverTimers),\n mergeMap(action =>\n this.turnoversService.updateTurnoversTimers(action.turnoverId, action.timers).pipe(\n map(() => setTurnoverTimersSuccess()),\n catchError(() => {\n this.snackbarService.error('Timer update failed');\n return of(setTurnoverTimersFailed());\n })\n )\n )\n )\n );\n\n setWorkflowStepAssignee$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setWorkflowStepAssignee),\n mergeMap(action =>\n this.workflowActionsService.setWorkflowStepAssignee(action.turnoverId, action.step, action.assigneeId).pipe(\n mergeMap(() => [\n setWorkflowStepAssigneeSuccess(),\n getWorkflowStepCommentList({ turnoverId: action.turnoverId }),\n ]),\n catchError(() => {\n return of(setWorkflowStepAssigneeFailed());\n })\n )\n )\n )\n );\n\n setEmptyWorkflowStepAssignee$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setEmptyWorkflowStepAssignee),\n mergeMap(action =>\n this.workflowActionsService\n .setWorkflowStepAssignee(action.turnoverId, action.step, action.assigneeId, action.rememberIt)\n .pipe(\n mergeMap(() => [getTurnoverData({ ...action })]),\n catchError(() => {\n return of(setWorkflowStepAssigneeFailed());\n })\n )\n )\n )\n );\n\n transitEmptyWorkflowStepAssignee$ = createEffect(() =>\n this.actions$.pipe(\n ofType(transitEmptyWorkflowStepAssignee),\n mergeMap(action =>\n this.workflowActionsService\n .transitWorkflowStepAssignee(action.turnoverId, action.step, action.assigneeId, action.source)\n .pipe(\n mergeMap(() => [getTurnoverData({ ...action })]),\n catchError(() => {\n return of(setWorkflowStepAssigneeFailed());\n })\n )\n )\n )\n );\n\n loadTurnoverSummaryStats$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadTurnoverSummaryStats),\n mergeMap(action =>\n this.turnoversService.getTurnoverSummaryStats(action.filter).pipe(\n map(stats => loadTurnoverSummaryStatsSuccess({ stats })),\n catchError(error => of(loadTurnoverSummaryStatsFailed({ error })))\n )\n )\n )\n );\n\n loadTurnoverSummaryDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadTurnoverSummaryDetails),\n mergeMap(action =>\n this.turnoversService.getTurnoverSummaryDetails(action.filter).pipe(\n map(details => loadTurnoverSummaryDetailsSuccess({ details })),\n catchError(error => of(loadTurnoverSummaryDetailsFailed({ error })))\n )\n )\n )\n );\n}\n","import { createReducer, on } from '@ngrx/store';\n\nimport { UpdateStatus } from '@shared/enums/update-status';\nimport { RestBidModel } from '@shared/interfaces/bid.interface';\nimport { RestBulkScopeAndBidModel } from '@shared/interfaces/rest-bulk-scope-and-bid-model';\n\nimport {\n addUnitsToBulk,\n addUnitsToBulkSuccess,\n createNewBulkScope,\n createNewBulkScopeFailed,\n createNewBulkScopeSuccess,\n getBulkScope,\n getBulkScopeFailed,\n getBulkScopeList,\n getBulkScopeListFailed,\n getBulkScopeListSuccess,\n getBulkScopeSuccess,\n resetNewBulkScopeID,\n resetUpdateBulkScopeStatus,\n updateBulkScope,\n updateBulkScopeFailed,\n updateBulkScopeSuccess,\n} from '../actions/bulk-and-scope.actions';\n\nexport const bulkBidsFeatureKey = 'bulk-bids';\n\nexport interface State {\n newBulkScopeInProgress: boolean;\n newBulkScopeInStatus: UpdateStatus;\n newBulkScopeInId: number;\n\n bulkScopeLoading: boolean;\n bulkScope: RestBulkScopeAndBidModel;\n\n bulkScopeListLoading: boolean;\n bulkScopeList: RestBulkScopeAndBidModel[];\n\n updateBulkScopeInProgress: boolean;\n updateBulkScopeInStatus: UpdateStatus;\n\n allBidList: RestBidModel[];\n allBidListLoading: boolean;\n\n addUnitsInProgress: boolean;\n}\n\nexport const initialState: State = {\n newBulkScopeInProgress: false,\n newBulkScopeInStatus: null,\n newBulkScopeInId: null,\n\n bulkScopeLoading: false,\n bulkScope: null,\n\n bulkScopeListLoading: false,\n bulkScopeList: [],\n\n updateBulkScopeInProgress: false,\n updateBulkScopeInStatus: null,\n\n allBidList: [],\n allBidListLoading: false,\n addUnitsInProgress: false,\n};\n\nexport const reducer = createReducer(\n initialState,\n\n /**\n * Create new bulk scope\n */\n on(createNewBulkScope, (state, action) => ({\n ...state,\n newBulkScopeInProgress: true,\n newBulkScopeInStatus: UpdateStatus.UPDATE,\n newBulkScopeInId: null,\n })),\n on(createNewBulkScopeSuccess, (state, action) => ({\n ...state,\n newBulkScopeInProgress: false,\n newBulkScopeInStatus: UpdateStatus.OK,\n newBulkScopeInId: action.bulkScopeId,\n })),\n on(createNewBulkScopeFailed, (state, action) => ({\n ...state,\n newBulkScopeInProgress: false,\n newBulkScopeInStatus: UpdateStatus.ERROR,\n newBulkScopeInId: null,\n })),\n on(resetNewBulkScopeID, (state, action) => ({\n ...state,\n newBulkScopeInId: null,\n })),\n\n /**\n * get bulk scope\n */\n on(getBulkScope, (state, action) => ({\n ...state,\n bulkScopeLoading: true,\n })),\n on(getBulkScopeSuccess, (state, action) => ({\n ...state,\n bulkScope: action.bulkScope,\n bulkScopeLoading: false,\n })),\n on(getBulkScopeFailed, (state, action) => ({\n ...state,\n bulkScope: null,\n bulkScopeLoading: false,\n })),\n /**\n * get bulk scope list\n */\n on(getBulkScopeList, (state, action) => ({\n ...state,\n bulkScopeListLoading: true,\n })),\n on(getBulkScopeListSuccess, (state, action) => ({\n ...state,\n bulkScopeList: action.bulkList,\n bulkScopeListLoading: false,\n })),\n on(getBulkScopeListFailed, (state, action) => ({\n ...state,\n bulkScopeList: [],\n bulkScopeListLoading: false,\n })),\n\n /**\n * update bulk scope\n */\n on(updateBulkScope, (state, action) => ({\n ...state,\n updateBulkScopeInStatus: UpdateStatus.UPDATE,\n updateBulkScopeInProgress: true,\n })),\n on(updateBulkScopeSuccess, (state, action) => ({\n ...state,\n updateBulkScopeInStatus: UpdateStatus.OK,\n updateBulkScopeInProgress: false,\n })),\n on(updateBulkScopeFailed, (state, action) => ({\n ...state,\n updateBulkScopeInStatus: UpdateStatus.ERROR,\n updateBulkScopeInProgress: false,\n })),\n on(resetUpdateBulkScopeStatus, (state, action) => ({\n ...state,\n updateBulkScopeInStatus: null,\n })),\n\n /**\n * add units to bulk\n */\n on(addUnitsToBulk, (state, action) => ({\n ...state,\n addUnitsInProgress: true,\n })),\n on(addUnitsToBulkSuccess, updateBulkScopeFailed, (state, action) => ({\n ...state,\n addUnitsInProgress: false,\n }))\n);\n","import { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { iif, of } from 'rxjs';\nimport { catchError, exhaustMap, map, mergeMap, switchMap, tap, withLatestFrom } from 'rxjs/operators';\n\nimport { FileUploadsService } from '@app/services/file-uploads.service';\nimport { PortfolioService } from '@app/services/portfolio.service';\nimport { PropertiesService } from '@app/services/properties.service';\nimport { RestapiService } from '@app/services/restapi.service';\nimport { UnitsService } from '@app/services/units.service';\nimport {\n loadAllUserProperties,\n loadAllUserPropertiesFailed,\n loadAllUserPropertiesSucceeded,\n} from '@main-application/store/actions/user.actions';\nimport { AppRoutes } from '@shared/constants/app-routes.const';\nimport { UnitAttachmentType } from '@shared/enums/attachment-type';\nimport {\n CreatePropertyCollectionReqI,\n RestPortfolioModel,\n RestPropertyCollectionModel,\n RestPropertyModel,\n UpdatePropertyCollectionReqI,\n} from '@shared/interfaces/rest-portfolio-model.interface';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport {\n addPropertiesToCollection,\n addPropertiesToCollectionError,\n addPropertiesToCollectionSuccess,\n addPropertyCollection,\n addPropertyCollectionError,\n addPropertyCollectionSuccess,\n addPropertyToPortfolio,\n addUsersToCollection,\n addUsersToCollectionError,\n addUsersToCollectionSuccess,\n changePropertyManagers,\n createNewPortfolio,\n deleteFileFromRepository,\n deleteFileFromRepositoryFailed,\n deleteFileFromRepositorySuccess,\n deletePortfolio,\n deletePropertyCollection,\n deletePropertyCollectionError,\n deletePropertyCollectionSuccess,\n deleteUnitAttachment,\n deleteUnitAttachmentFailed,\n deleteUnitAttachmentSuccess,\n getPropertyUnits,\n getPropertyUnitsFailed,\n getPropertyUnitsSuccess,\n getUnitAttachments,\n getUnitAttachmentsSuccess,\n loadAllUserCollections,\n loadAllUserCollectionsFailed,\n loadAllUserCollectionsSuccess,\n loadAllUserPortfolios,\n loadAllUserPortfoliosFailed,\n loadAllUserPortfoliosSuccess,\n loadAllUserUnassignedProperties,\n loadAllUserUnassignedPropertiesFailed,\n loadAllUserUnassignedPropertiesSucceeded,\n loadPortfolioDetails,\n loadPortfolioDetailsFailed,\n loadPortfolioDetailsSuccess,\n loadPropertyCollections,\n loadPropertyCollectionsFailed,\n loadPropertyCollectionsSuccess,\n loadPropertyDetails,\n loadPropertyDetailsFailed,\n loadPropertyDetailsSuccess,\n loadPropertyManagers,\n loadPropertyManagersFailed,\n loadPropertyManagersForProperty,\n loadPropertyManagersForPropertyFailed,\n loadPropertyManagersForPropertySuccess,\n loadPropertyManagersSucceeded,\n removePropertiesFromCollection,\n removePropertiesFromCollectionError,\n removePropertiesFromCollectionSuccess,\n removePropertyFromPortfolio,\n removePropertyManagers,\n removePropertyManagersFailed,\n removePropertyManagersSuccess,\n removeUsersFromCollection,\n removeUsersFromCollectionError,\n removeUsersFromCollectionSuccess,\n savePropertyCollection,\n savePropertyCollectionError,\n savePropertyCollectionSuccess,\n setPropertyManagers,\n setPropertyManagersFailed,\n setPropertyManagersSuccess,\n setUnitAttachment,\n setUnitAttachmentFail,\n setUnitAttachmentSuccess,\n updatePortfolioAutoAdd,\n updatePortfolioDetails,\n updatePortfolioDetailsFailed,\n updatePortfolioDetailsSuccess,\n updatePortfolioName,\n updateProperty,\n updatePropertyFailed,\n} from './portfolio.actions';\nimport { selectPortfolioDetails, selectPropertyDetails } from './portfolio.selectors';\n\n@Injectable()\nexport class PortfolioEffects {\n loadAllPortfolio$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadAllUserPortfolios),\n exhaustMap(() =>\n this.restApiService.getData(`portfolio`).pipe(\n map(result => loadAllUserPortfoliosSuccess({ portfolioItems: result || [] })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingPortfoliosList);\n return of(loadAllUserPortfoliosFailed());\n })\n )\n )\n )\n );\n\n loadPortfolioDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPortfolioDetails),\n switchMap(action =>\n this.restApiService.getData(`portfolio/${action.portfolioId}`).pipe(\n map(result => loadPortfolioDetailsSuccess({ portfolioDetails: result })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingPortfolio);\n return of(loadPortfolioDetailsFailed());\n })\n )\n )\n )\n );\n\n loadPropertyDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPropertyDetails),\n switchMap(action =>\n this.restApiService.getData(`properties/${action.propertyId}`).pipe(\n map(result => loadPropertyDetailsSuccess({ propertyDetails: result || [] })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingPropertyDetails);\n return of(loadPropertyDetailsFailed());\n })\n )\n )\n )\n );\n\n loadAllUserProperties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadAllUserProperties),\n switchMap(() =>\n this.propertiesService.getAllUserProperties().pipe(\n map(properties => loadAllUserPropertiesSucceeded({ properties })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingAllUserProperties);\n return of(loadAllUserPropertiesFailed());\n })\n )\n )\n )\n );\n\n loadAllUserUnassignedProperties$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadAllUserUnassignedProperties),\n switchMap(() =>\n this.propertiesService.getAllUserUnassignedProperties().pipe(\n map(unassignedProperties => loadAllUserUnassignedPropertiesSucceeded({ unassignedProperties })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingUnassignedUserProperties);\n return of(loadAllUserUnassignedPropertiesFailed());\n })\n )\n )\n )\n );\n\n updatePortfolioName$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updatePortfolioName),\n mergeMap(action =>\n this.portfolioService.update(action.portfolioDetails).pipe(\n withLatestFrom(this.store.select(selectPortfolioDetails)),\n mergeMap(([updatedPortfolioDetails, portfolioDetails]) => [\n loadPortfolioDetailsSuccess({\n portfolioDetails: {\n ...portfolioDetails,\n name: updatedPortfolioDetails.name,\n },\n }),\n loadAllUserPortfolios(),\n ]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UpadtingPortfolio);\n return of(updatePortfolioDetailsFailed());\n })\n )\n )\n )\n );\n\n updatePortfolioDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updatePortfolioDetails),\n mergeMap(action =>\n this.portfolioService.update(action.portfolioDetails).pipe(\n mergeMap(portfolioDetails =>\n iif(\n () => action.doNotRefetchPortfolios,\n [updatePortfolioDetailsSuccess({ portfolioDetails })],\n [updatePortfolioDetailsSuccess({ portfolioDetails }), loadAllUserPortfolios()]\n )\n ),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UpadtingPortfolio);\n return of(updatePortfolioDetailsFailed());\n })\n )\n )\n )\n );\n\n updatePortfolioAutoAdd$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updatePortfolioAutoAdd),\n mergeMap(action =>\n this.restApiService\n .update(`portfolio/${action.portfolioDetails.id}`, action.portfolioDetails)\n .pipe(\n withLatestFrom(this.store.select(selectPortfolioDetails)),\n mergeMap(([updatedPortfolioDetails, portfolioDetails]) => [\n loadPortfolioDetailsSuccess({\n portfolioDetails: {\n ...portfolioDetails,\n autoAddNewProperties: updatedPortfolioDetails.autoAddNewProperties,\n preleaseFilterMode: updatedPortfolioDetails.preleaseFilterMode,\n },\n }),\n ]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UpadtingPortfolio);\n return of(updatePortfolioDetailsFailed());\n })\n )\n )\n )\n );\n\n addPropertyToPortfolio$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addPropertyToPortfolio),\n mergeMap(action =>\n this.restApiService\n .update(`Portfolio/${action.portfolioId}/AddProperties`, action.propertyIds)\n .pipe(\n mergeMap(portfolioDetails => {\n return [\n loadPortfolioDetails({\n portfolioId: action.portfolioId,\n }),\n loadAllUserUnassignedProperties(),\n loadAllUserProperties(),\n ];\n }),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.WhileAddingNewPropertyToPortfolio);\n return of(updatePortfolioDetailsFailed());\n })\n )\n )\n )\n );\n\n removePropertyFromPortfolio$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removePropertyFromPortfolio),\n mergeMap(action =>\n this.restApiService\n .update(`Portfolio/${action.portfolioId}/RemoveProperties`, [action.propertyId])\n .pipe(\n mergeMap(() => {\n return [\n loadPortfolioDetails({\n portfolioId: action.portfolioId,\n }),\n loadAllUserUnassignedProperties(),\n loadAllUserProperties(),\n ];\n }),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.WhileDeletingPropertyFromPortfolio);\n return of(updatePortfolioDetailsFailed());\n })\n )\n )\n )\n );\n\n createNewPortfolio$ = createEffect(() =>\n this.actions$.pipe(\n ofType(createNewPortfolio),\n mergeMap(action =>\n this.restApiService.create(`Portfolio`, action.portfolioDetails).pipe(\n tap(portfolioDetails => {\n this.router.navigate([AppRoutes.SETTINGS_PORTFOLIO, portfolioDetails.id]).then();\n }),\n mergeMap(portfolioDetails => [\n loadPortfolioDetailsSuccess({\n portfolioDetails,\n }),\n loadAllUserPortfolios(),\n ]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.WhileCreatingNewPortfolio);\n return of(updatePortfolioDetailsFailed());\n })\n )\n )\n )\n );\n\n loadPropertyManagers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPropertyManagers),\n exhaustMap(action =>\n this.propertiesService.getPropertyManagers().pipe(\n map(propertyManagers => loadPropertyManagersSucceeded({ propertyManagers })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingPropertyManagers);\n return of(loadPropertyManagersFailed());\n })\n )\n )\n )\n );\n\n loadPropertyManagersForProperty$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPropertyManagersForProperty),\n switchMap(action =>\n this.propertiesService.getPropertyManagersForProperty(action.propertyId).pipe(\n map(managerList => loadPropertyManagersForPropertySuccess({ propertyManagers: managerList || [] })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingPropertyManagersForProperty);\n return of(loadPropertyManagersForPropertyFailed());\n })\n )\n )\n )\n );\n\n updateProperty$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateProperty),\n mergeMap(action =>\n this.propertiesService.update(action.propertyDetails).pipe(\n map(propertyDetails => loadPropertyDetailsSuccess({ propertyDetails })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingPropertyDetails);\n return of(updatePropertyFailed());\n })\n )\n )\n )\n );\n\n deletePortfolio$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deletePortfolio),\n mergeMap(action =>\n this.restApiService.delete(`Portfolio/${action.portfolioId}`).pipe(\n map(() => {\n this.snackbarService.success(`${action.portfolioName} deleted`);\n return loadAllUserPortfolios();\n }),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.RemovingPortfolio);\n return of(updatePortfolioDetailsFailed());\n })\n )\n )\n )\n );\n\n removePropertyManagers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removePropertyManagers),\n mergeMap(action =>\n this.propertiesService.removePropertyManagers(action.propertyManagerModels).pipe(\n map(() => removePropertyManagersSuccess()),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.RemovingManagerFromProperty);\n return of(removePropertyManagersFailed());\n })\n )\n )\n )\n );\n\n setPropertyManagers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setPropertyManagers),\n withLatestFrom(this.store.select(selectPropertyDetails)),\n mergeMap(([action, property]) =>\n this.propertiesService.setPropertyManagers(action.propertyManagerModels).pipe(\n mergeMap(() => [setPropertyManagersSuccess(), loadPropertyDetails({ propertyId: property.id })]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.AssigningManagerToProperty);\n return of(setPropertyManagersFailed());\n })\n )\n )\n )\n );\n\n changePropertyManagers$ = createEffect(() =>\n this.actions$.pipe(\n ofType(changePropertyManagers),\n withLatestFrom(this.store.select(selectPropertyDetails)),\n mergeMap(([action, property]) =>\n this.propertiesService\n .removePropertyManagers(action.replacePropertyManagers.oldManager)\n .pipe(map(() => setPropertyManagers({ propertyManagerModels: action.replacePropertyManagers.newManager })))\n )\n )\n );\n\n getPropertyUnits$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getPropertyUnits),\n switchMap(action =>\n this.unitsService.getPropertyUnits(action.propertyId).pipe(\n map(propertyUnits => getPropertyUnitsSuccess({ propertyUnits })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingPropertyUnits);\n return of(getPropertyUnitsFailed());\n })\n )\n )\n )\n );\n\n getUnitAttachments$ = createEffect(() =>\n this.actions$.pipe(\n ofType(getUnitAttachments),\n switchMap(action =>\n this.unitsService.getUnitAttachments(action.unitId).pipe(\n map(attachments => getUnitAttachmentsSuccess({ unitAttachments: attachments || [] })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.RetrievingUnitsAttachments);\n return of(getPropertyUnitsFailed());\n })\n )\n )\n )\n );\n\n setUnitAttachment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(setUnitAttachment),\n mergeMap(action =>\n this.unitsService.setAttachment(action.attachmentToEntity).pipe(\n mergeMap(() => [\n setUnitAttachmentSuccess(),\n getUnitAttachments({ unitId: action.attachmentToEntity.unitId }),\n ]),\n tap(() => {\n const attachmentType = action.attachmentToEntity?.attachmentType as UnitAttachmentType;\n let message = 'Attachment(s) uploaded';\n switch (attachmentType) {\n case UnitAttachmentType.Photo:\n {\n message = 'Photo(s) uploaded';\n }\n break;\n case UnitAttachmentType.FloorPlan:\n {\n message = 'Floorplan uploaded';\n }\n break;\n }\n }),\n catchError(err => {\n const attachmentType = action.attachmentToEntity?.attachmentType as UnitAttachmentType;\n let message = SnackbarErrorMessage.AddingAttachment;\n switch (attachmentType) {\n case UnitAttachmentType.Photo:\n {\n message = SnackbarErrorMessage.AddingPhoto;\n }\n break;\n case UnitAttachmentType.FloorPlan:\n {\n message = SnackbarErrorMessage.AddingFloorplan;\n }\n break;\n }\n\n this.snackbarService.error(message);\n return of(setUnitAttachmentFail());\n })\n )\n )\n )\n );\n\n deleteUnitAttachment$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteUnitAttachment),\n mergeMap(action =>\n this.unitsService.deleteUnitAttachment(action.unitId, action.attachment.id).pipe(\n switchMap(() =>\n iif(\n () => !!action.attachment?.fileUploadId,\n of(action.attachment?.fileUploadId).pipe(map((fileId: number) => deleteFileFromRepository({ fileId }))),\n of(null)\n )\n ),\n mergeMap(() => [deleteUnitAttachmentSuccess(), getUnitAttachments({ unitId: action.unitId })]),\n tap(() => {\n const attachmentType = action.attachment?.targetAttachmentType as UnitAttachmentType;\n let message = 'Attachment removed';\n switch (attachmentType) {\n case UnitAttachmentType.Photo:\n {\n message = 'Photo deleted';\n }\n break;\n case UnitAttachmentType.FloorPlan:\n {\n message = 'Floorplan deleted';\n }\n break;\n }\n }),\n catchError(() => {\n const attachmentType = action.attachment?.targetAttachmentType as UnitAttachmentType;\n let message = SnackbarErrorMessage.DeletingAttachment;\n switch (attachmentType) {\n case UnitAttachmentType.Photo:\n {\n message = SnackbarErrorMessage.DeletingPhoto;\n }\n break;\n case UnitAttachmentType.FloorPlan:\n {\n message = SnackbarErrorMessage.DeletingFloorplan;\n }\n break;\n }\n\n this.snackbarService.error(message);\n return of(deleteUnitAttachmentFailed());\n })\n )\n )\n )\n );\n\n deleteFileFromRepository$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteFileFromRepository),\n mergeMap(action =>\n this.fileUploadsService.removeFile(action.fileId).pipe(\n map(() => deleteFileFromRepositorySuccess()),\n catchError(() => {\n this.snackbarService.error(SnackbarErrorMessage.DeletingFile);\n return of(deleteFileFromRepositoryFailed());\n })\n )\n )\n )\n );\n\n loadPropertyCollections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadPropertyCollections),\n switchMap(() =>\n this.restApiService.getData(`PropertyCollections/all`).pipe(\n map(result => loadPropertyCollectionsSuccess({ items: result || [] })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorLoadingPropertyCollections);\n return of(loadPropertyCollectionsFailed());\n })\n )\n )\n )\n );\n\n loadAllUserCollections$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadAllUserCollections),\n switchMap(action =>\n this.restApiService.getData(`PropertyCollections/all`).pipe(\n map(result => loadAllUserCollectionsSuccess({ collectionItems: result || [] })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorLoadingPropertyCollections);\n return of(loadAllUserCollectionsFailed());\n })\n )\n )\n )\n );\n\n addPropertyCollection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addPropertyCollection),\n switchMap(({ data }) =>\n this.restApiService.create(`PropertyCollections`, data).pipe(\n tap(res => {\n this.router.navigate([AppRoutes.SETTINGS_COLLECTION, res.id]).then();\n }),\n mergeMap(res => [addPropertyCollectionSuccess({ collection: res }), loadAllUserCollections()]),\n catchError(err => {\n const errorMsg = err?.error?.ErrorCode\n ? err.error.ErrorCode\n : SnackbarErrorMessage.ErrorAddingPropertyCollections;\n this.snackbarService.error(errorMsg);\n return of(addPropertyCollectionError());\n })\n )\n )\n )\n );\n\n savePropertyCollection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(savePropertyCollection),\n switchMap(action =>\n this.restApiService\n .update(`PropertyCollections/${action.id}`, {\n name: action.name,\n })\n .pipe(\n tap(() => {\n this.snackbarService.success(`Collection name changed!`);\n }),\n mergeMap(res => [savePropertyCollectionSuccess({ collection: res }), loadAllUserCollections()]),\n catchError(err => {\n const errorMsg = err?.error?.ErrorCode\n ? err.error.ErrorCode\n : SnackbarErrorMessage.ErrorUpdatingPropertyCollections;\n this.snackbarService.error(errorMsg);\n return of(savePropertyCollectionError());\n })\n )\n )\n )\n );\n\n deletePropertyCollection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deletePropertyCollection),\n mergeMap(action =>\n this.restApiService.delete(`PropertyCollections/${action.id}`).pipe(\n tap(() => {\n this.snackbarService.success(`${action.collectionName} deleted`);\n }),\n mergeMap(() => [deletePropertyCollectionSuccess({ id: action.id }), loadAllUserCollections()]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.ErrorRemovingPropertyCollections);\n return of(deletePropertyCollectionError());\n })\n )\n )\n )\n );\n\n addPropertiesToCollection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addPropertiesToCollection),\n switchMap(({ data }) =>\n this.restApiService\n .create(`PropertyCollections/${data.collectionId}/properties`, {\n propertyIds: data.propertyIds,\n })\n .pipe(\n map(res => addPropertiesToCollectionSuccess({ collection: res })),\n catchError(err => {\n const errorMsg = err?.error?.ErrorCode\n ? err.error.ErrorCode\n : SnackbarErrorMessage.ErrorAddingPropertyToCollections;\n this.snackbarService.error(errorMsg);\n return of(addPropertiesToCollectionError());\n })\n )\n )\n )\n );\n\n removePropertiesFromCollection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removePropertiesFromCollection),\n switchMap(({ data }) =>\n this.restApiService\n .delete(`PropertyCollections/${data.collectionId}/properties`, {\n propertyIds: data.propertyIds,\n })\n .pipe(\n map(res => removePropertiesFromCollectionSuccess({ collection: res })),\n catchError(err => {\n const errorMsg = err?.error?.ErrorCode\n ? err.error.ErrorCode\n : SnackbarErrorMessage.ErrorRemovingPropertyFromCollection;\n this.snackbarService.error(errorMsg);\n return of(removePropertiesFromCollectionError());\n })\n )\n )\n )\n );\n\n addUsersToCollection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(addUsersToCollection),\n switchMap(({ data }) =>\n this.restApiService\n .create(`PropertyCollections/${data.collectionId}/users`, {\n userIds: data.userIds,\n })\n .pipe(\n map(res => addUsersToCollectionSuccess({ collection: res })),\n catchError(err => {\n const errorMsg = err?.error?.ErrorCode\n ? err.error.ErrorCode\n : SnackbarErrorMessage.ErrorAddingUserToCollections;\n this.snackbarService.error(errorMsg);\n return of(addUsersToCollectionError());\n })\n )\n )\n )\n );\n\n removeUsersFromCollection$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removeUsersFromCollection),\n switchMap(({ data }) =>\n this.restApiService\n .delete(`PropertyCollections/${data.collectionId}/users`, {\n userIds: data.userIds,\n })\n .pipe(\n map(res => removeUsersFromCollectionSuccess({ collection: res })),\n catchError(err => {\n const errorMsg = err?.error?.ErrorCode\n ? err.error.ErrorCode\n : SnackbarErrorMessage.ErrorRemovingUsersFromCollection;\n this.snackbarService.error(errorMsg);\n return of(removeUsersFromCollectionError());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private restApiService: RestapiService,\n private snackbarService: SnackbarService,\n private propertiesService: PropertiesService,\n private store: Store<{}>,\n private router: Router,\n private unitsService: UnitsService,\n private fileUploadsService: FileUploadsService,\n private portfolioService: PortfolioService\n ) {}\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { PortfolioEffects } from './portfolio.effects';\nimport * as fromPortfolioReducer from './portfolio.reducer';\n\n@NgModule({\n declarations: [],\n imports: [\n EffectsModule.forFeature([PortfolioEffects]),\n StoreModule.forFeature(fromPortfolioReducer.portfolioFeatureKey, fromPortfolioReducer.reducer),\n ],\n})\nexport class PortfolioStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport { catchError, exhaustMap, map, mergeMap, tap } from 'rxjs/operators';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { SurveysService } from '@app/services/surveys.service';\nimport { AppRoutes } from '@shared/constants/app-routes.const';\nimport { RestTemplateModel } from '@template/models/rest-template-model.interface';\nimport {\n createTemplateDetails,\n deleteTemplate,\n loadAllUnitTypes,\n loadAllUnitTypesFailed,\n loadAllUnitTypesSuccess,\n loadAllUserTemplates,\n loadAllUserTemplatesFailed,\n loadAllUserTemplatesSuccess,\n removeAreaFromTemplate,\n updateTemplateDetails,\n updateTemplateDetailsFailed,\n} from '@template/store/template.actions';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\n// TODO remove ALL direct API calls from this effect. Put it in ApiTemplateService\n\n@Injectable()\nexport class TemplateEffects {\n loadAllUserTemplates$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadAllUserTemplates),\n mergeMap(() =>\n this.restApiService\n .getData(\n `inspections/template/list?filterUnavailableTemplates=true&doNotReturnContent=true`\n )\n .pipe(\n map(result => loadAllUserTemplatesSuccess({ listItems: result || [] })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingTemplatesList);\n return of(loadAllUserTemplatesFailed());\n })\n )\n )\n )\n );\n\n loadAllUnitTypes$ = createEffect(() =>\n this.actions$.pipe(\n ofType(loadAllUnitTypes),\n exhaustMap(action =>\n this.restApiService.getData(`properties/${action.propertyId}/unitTypes`).pipe(\n map(result => loadAllUnitTypesSuccess({ unitTypes: result || [] })),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.LoadingUnitTypes);\n return of(loadAllUnitTypesFailed());\n })\n )\n )\n )\n );\n\n updateTemplateDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(updateTemplateDetails),\n mergeMap(action =>\n this.restApiService.post(`inspections/template/edit`, action.entityDetails).pipe(\n mergeMap(templateDetails => [loadAllUserTemplates()]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.UpdatingTemplate);\n return of(updateTemplateDetailsFailed());\n })\n )\n )\n )\n );\n\n removeAreaFromTemplate$ = createEffect(() =>\n this.actions$.pipe(\n ofType(removeAreaFromTemplate),\n mergeMap(action =>\n this.surveyService.delete(action.areaId).pipe(\n mergeMap(() => [loadAllUserTemplates()]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.WhileDeletingPropertyFromTemplate);\n return of(updateTemplateDetailsFailed());\n })\n )\n )\n )\n );\n\n createTemplateDetails$ = createEffect(() =>\n this.actions$.pipe(\n ofType(createTemplateDetails),\n mergeMap(action =>\n this.restApiService.create(`inspections/template/add`, action.entityDetails).pipe(\n tap(id =>\n this.router.navigate([AppRoutes.SETTINGS_TEMPLATE, id], { queryParamsHandling: 'preserve' }).then()\n ),\n mergeMap(() =>\n action.entityDetails.inspectionTemplateAreas\n ? action.entityDetails.inspectionTemplateAreas.map(s => this.surveyService.add({ ...s, id: 0 }))\n : of(undefined)\n ),\n mergeMap(() => [loadAllUserTemplates()]),\n catchError(err => {\n this.snackbarService.error(SnackbarErrorMessage.WhileCreatingNewTemplate);\n return of(updateTemplateDetailsFailed());\n })\n )\n )\n )\n );\n\n deleteTemplate$ = createEffect(() =>\n this.actions$.pipe(\n ofType(deleteTemplate),\n mergeMap(action =>\n this.restApiService.post('inspections/template/delete', action.id).pipe(\n map(() => loadAllUserTemplates()),\n catchError(err => {\n if (err?.error?.['ErrorCode'] === 'inspection_template_delete_unavailable') {\n this.snackbarService.error(SnackbarErrorMessage.RemovingTemplateInUse);\n } else {\n this.snackbarService.error(SnackbarErrorMessage.RemovingTemplate);\n }\n\n return of(updateTemplateDetailsFailed(), loadAllUserTemplates());\n })\n )\n )\n )\n );\n\n constructor(\n private actions$: Actions,\n private restApiService: RestapiService,\n private surveyService: SurveysService,\n private snackbarService: SnackbarService,\n private router: Router\n ) {}\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { TemplateEffects } from './template.effects';\nimport * as fromTemplateReducer from './template.reducer';\n\n@NgModule({\n declarations: [],\n imports: [\n EffectsModule.forFeature([TemplateEffects]),\n StoreModule.forFeature(fromTemplateReducer.templateFeatureKey, fromTemplateReducer.reducer),\n ],\n})\nexport class TemplateStoreModule {}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { CompaniesStoreModule } from '@companies/store/companies-store.module';\nimport * as fromDashboardFilterTransient from '@dashboards/store';\nimport { DashboardEffects } from '@dashboards/store/effects/dashboard.effects';\nimport { KpiEffects } from '@dashboards/store/effects/kpi.effects';\nimport * as fromDashboardFilterReducer from '@dashboards/store/reducers/dashboard-filter.reducer';\nimport { metaDashboardFilterReducers } from '@dashboards/store/reducers/dashboard-filter.reducer';\nimport * as fromDashboardsReducer from '@dashboards/store/reducers/dashboards.reducer';\nimport { metaDashboardReducers } from '@dashboards/store/reducers/dashboards.reducer';\nimport * as fromDashboardKpiReducer from '@dashboards/store/reducers/kpi.reducer';\nimport { metaDashboardKpiReducers } from '@dashboards/store/reducers/kpi.reducer';\nimport {\n metaPropertySelectorReducers,\n propertySelectorFeatureKey,\n propertySelectorReducer,\n} from '@dashboards/store/reducers/property-selector.reducer';\nimport { AdministrationEffects } from '@main-application/administration/store/effects/administration.effects';\nimport * as fromAdministration from '@main-application/administration/store/reducers/administration.reducer';\nimport { BoardsStoreModule } from '@main-application/boards/store/boards-store.module';\nimport { CalendarStoreModule } from '@main-application/calendar/store/calendar-store.module';\nimport { DelinquencyEffects } from '@main-application/dashboard-reports/delinquencies/store/delinquency.effects';\nimport * as fromDelinquencyReducer from '@main-application/dashboard-reports/delinquencies/store/delinquency.reducer';\nimport { RenewalsEffects } from '@main-application/dashboard-reports/renewals/store/renewals.effects';\nimport * as fromRenewalsReducer from '@main-application/dashboard-reports/renewals/store/renewals.reducer';\nimport { RocReportStoreModule } from '@main-application/dashboard-reports/roc-report/store/roc-store.module';\nimport { InspectionStoreModule } from '@main-application/inspections/store/inspections-store.module';\nimport * as fromStoreReducer from '@main-application/management/pages/service-configuration/store/service-configuration.reducer';\nimport { SystemConfigurationEffects } from '@main-application/management/pages/system-configuration/store/system-configuration.effects';\nimport * as fromSystemConfiguration from '@main-application/management/pages/system-configuration/store/system-configuration.reducer';\nimport { TurnoverConfigurationStepStoreModule } from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/store/turnover-configuration-step-store.module';\nimport { TurnoverConfigurationStoreModule } from '@main-application/management/pages/turnover-configuration/store/turnover-configuration-store.module';\nimport { ManagementEffects } from '@main-application/management/store/management.effects';\nimport * as fromManagement from '@main-application/management/store/management.reducer';\nimport { NotificationsEffects } from '@main-application/notifications/store/effects/notifications.effects';\nimport * as fromNotifications from '@main-application/notifications/store/reducers/notifications.reducer';\nimport { ServiceStoreModule } from '@main-application/service/store/service-store.module';\nimport { EnumerationEffects } from '@main-application/store/effects/enumeration.effects';\nimport { FileUploadEffects } from '@main-application/store/effects/file-upload.effects';\nimport { UserEffects } from '@main-application/store/effects/user.effects';\nimport { CORE_FEATURE_KEY, reducers } from '@main-application/store/reducers';\nimport { TicketsEffects } from '@main-application/tickets/store/effects/tickets.effects';\nimport * as fromTickets from '@main-application/tickets/store/reducers/tickets.reducer';\nimport { TurnoverListEffects } from '@main-application/turnovers/components/turnover-list/store/effects/turnover-list.effects';\nimport * as fromTurnoverListReducer from '@main-application/turnovers/components/turnover-list/store/reducers/turnover-list.reducer';\nimport { metaTurnoverListReducers } from '@main-application/turnovers/components/turnover-list/store/reducers/turnover-list.reducer';\nimport { BulkBidsEffects } from '@main-application/turnovers/store/effects/bulk-bids.effects';\nimport { PunchEffects } from '@main-application/turnovers/store/effects/punch.effects';\nimport { TurnoverBidsEffects } from '@main-application/turnovers/store/effects/turnover-bids.effects';\nimport { TurnoversEffects } from '@main-application/turnovers/store/effects/turnovers.effects';\nimport * as fromBulkBids from '@main-application/turnovers/store/reducers/bulk-bids.reducer';\nimport * as fromPunch from '@main-application/turnovers/store/reducers/punch.reducer';\nimport {\n turnoverBidsFeatureKey,\n turnoverBidsReducer,\n} from '@main-application/turnovers/store/reducers/turnover-bids.reducer';\nimport {\n turnoverOverviewFeatureKey,\n turnoverOverviewReducer,\n} from '@main-application/turnovers/store/reducers/turnovers-overview.reducer';\nimport * as fromTurnovers from '@main-application/turnovers/store/reducers/turnovers.reducer';\nimport { PortfolioStoreModule } from '@portfolio/store/portfolio-store.module';\nimport { TemplateStoreModule } from '@template/store/template-store.module';\n\n@NgModule({\n exports: [],\n imports: [\n BoardsStoreModule,\n CalendarStoreModule,\n PortfolioStoreModule,\n RocReportStoreModule,\n TurnoverConfigurationStoreModule,\n TurnoverConfigurationStepStoreModule,\n InspectionStoreModule,\n TemplateStoreModule,\n CompaniesStoreModule,\n ServiceStoreModule,\n EffectsModule.forFeature([\n DashboardEffects,\n KpiEffects,\n AdministrationEffects,\n TurnoversEffects,\n BulkBidsEffects,\n PunchEffects,\n SystemConfigurationEffects,\n TurnoverBidsEffects,\n DelinquencyEffects,\n RenewalsEffects,\n ManagementEffects,\n NotificationsEffects,\n TicketsEffects,\n TurnoverListEffects,\n UserEffects,\n EnumerationEffects,\n FileUploadEffects,\n ]),\n StoreModule.forFeature(fromSystemConfiguration.systemConfigurationFeatureKey, fromSystemConfiguration.reducer),\n StoreModule.forFeature(fromDashboardsReducer.dashboardsFeatureKey, fromDashboardsReducer.reducer, {\n metaReducers: metaDashboardReducers,\n }),\n StoreModule.forFeature(fromDashboardKpiReducer.kpiFeatureKey, fromDashboardKpiReducer.reducer, {\n metaReducers: metaDashboardKpiReducers,\n }),\n StoreModule.forFeature(fromDashboardFilterReducer.dashboardFilterFeatureKey, fromDashboardFilterReducer.reducer, {\n metaReducers: metaDashboardFilterReducers,\n }),\n StoreModule.forFeature(fromAdministration.administrationFeatureKey, fromAdministration.reducer),\n StoreModule.forFeature(fromTurnovers.turnoversFeatureKey, fromTurnovers.reducer),\n StoreModule.forFeature(fromBulkBids.bulkBidsFeatureKey, fromBulkBids.reducer),\n StoreModule.forFeature(fromPunch.punchFeatureKey, fromPunch.reducer),\n StoreModule.forFeature(\n fromDashboardFilterTransient.dashboardFilterTransientFeatureKey,\n fromDashboardFilterTransient.reducer\n ),\n StoreModule.forFeature(turnoverBidsFeatureKey, turnoverBidsReducer),\n StoreModule.forFeature(fromDelinquencyReducer.delinquencyFeatureKey, fromDelinquencyReducer.reducer),\n StoreModule.forFeature(fromRenewalsReducer.renewalsFeatureKey, fromRenewalsReducer.reducer),\n StoreModule.forFeature(fromStoreReducer.serviceConfigurationFeatureKey, fromStoreReducer.reducer),\n StoreModule.forFeature(fromManagement.managementFeatureKey, fromManagement.reducer),\n StoreModule.forFeature(fromNotifications.notificationsFeatureKey, fromNotifications.reducer),\n StoreModule.forFeature(fromTickets.ticketsFeatureKey, fromTickets.reducer),\n StoreModule.forFeature(fromTurnoverListReducer.turnoverListFeatureKey, fromTurnoverListReducer.reducer, {\n metaReducers: metaTurnoverListReducers,\n }),\n StoreModule.forFeature(turnoverOverviewFeatureKey, turnoverOverviewReducer),\n StoreModule.forFeature(CORE_FEATURE_KEY, reducers),\n StoreModule.forFeature(propertySelectorFeatureKey, propertySelectorReducer, {\n metaReducers: metaPropertySelectorReducers,\n }),\n ],\n declarations: [],\n})\nexport class SharedStoreModule {}\n","import { NgModule } from '@angular/core';\nimport { OidcSecurityService } from 'angular-auth-oidc-client';\n\nimport { ScreenWiperService } from '@app/services/screen-wiper.service';\nimport { UnitsService } from '@app/services/units.service';\nimport { BoardService } from '@main-application/boards/services/board.service';\nimport { DynamicInspectionService } from '@main-application/inspections/services/dynamic-inspection.service';\nimport { InspectionService } from '@main-application/inspections/services/inspection.service';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\nimport { ModalsService } from '@ui-components/modals/modals.service';\n\n@NgModule({\n declarations: [],\n providers: [\n OidcSecurityService,\n ModalsService,\n BoardService,\n InspectionService,\n DynamicInspectionService,\n SnackbarService,\n UnitsService,\n ScreenWiperService,\n ],\n})\nexport class SingletonServicesModule {}\n","import { DashboardMode } from '@shared/enums/dashboard-mode';\nimport { UserData } from '@shared/interfaces/user-data';\n\nexport function getDashboardMode(userData: UserData): DashboardMode {\n // TODO Add Administrator general roles handling when available\n if (userData.generalRole === 'Asset Manager') {\n return DashboardMode.ASSET_MANAGER;\n }\n if (userData.generalRole === 'SuperUser') {\n // return DashboardMode.SUPER_USER;\n return DashboardMode.ASSET_MANAGER;\n }\n\n return DashboardMode.PROPERTY_MANAGER;\n}\n","import { Injectable } from '@angular/core';\nimport * as signalR from '@microsoft/signalr';\nimport { HubConnection } from '@microsoft/signalr';\nimport { Store } from '@ngrx/store';\nimport { firstValueFrom } from 'rxjs';\n\nimport { addLatestNotification } from '@main-application/notifications/store/actions/notifications.actions';\nimport { WebNotification } from '@shared/interfaces/notification.interface';\nimport { AuthService } from '@shared/services/auth.service';\n\nimport { environment } from '../../../../../environments/environment';\nimport { EnvironmentType } from '../../../../../environments/environment-config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationsService {\n hubConnection: HubConnection;\n\n constructor(private auth: AuthService, private store: Store<{}>) {}\n\n connect(): Promise {\n if (!this.hubConnection) {\n this.hubConnection = new signalR.HubConnectionBuilder()\n .configureLogging(\n environment.type === EnvironmentType.Prod ? signalR.LogLevel.Critical : signalR.LogLevel.Information\n )\n\n .withUrl(environment.notificationsAllUrl, {\n transport: signalR.HttpTransportType.WebSockets,\n skipNegotiation: true,\n accessTokenFactory: () => firstValueFrom(this.auth.getAccessToken()),\n })\n .withAutomaticReconnect()\n .build();\n\n this.hubConnection.on('Notify', (notification: WebNotification) => {\n this.distributeNotifications(notification);\n });\n }\n\n return this.hubConnection.start().catch(err => {\n return err;\n });\n }\n\n close() {\n if (this.hubConnection) {\n this.hubConnection.stop().then();\n }\n }\n\n private distributeNotifications(notification: WebNotification) {\n this.store.dispatch(addLatestNotification({ notification }));\n }\n}\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostListener, OnDestroy, OnInit } from '@angular/core';\nimport { ActivatedRoute, NavigationEnd, Router, RoutesRecognized } from '@angular/router';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\nimport { Store } from '@ngrx/store';\nimport { combineLatest, take } from 'rxjs';\nimport { distinctUntilChanged, filter, map, pairwise, tap } from 'rxjs/operators';\n\nimport { AppVersionService } from '@app/services/app-version.service';\nimport { PuSubscribable } from '@app/utils/pu-subscribe';\nimport { selectedDashboardMode } from '@dashboards/store/actions/dashboard.actions';\nimport { initPropertySelector } from '@dashboards/store/actions/property-selector.actions';\nimport { NotificationsService } from '@main-application/notifications/services/notifications.service';\nimport { loadEnumerations } from '@main-application/store/actions/enumerations.actions';\nimport { setPreviousRoute } from '@main-application/store/actions/route-state.action';\nimport { loadTenantData, loadUserData, setAuthenticated } from '@main-application/store/actions/user.actions';\nimport { setWindowWidth } from '@main-application/store/actions/window-resize.actions';\nimport { selectTenantData, selectUserData } from '@main-application/store/selectors/user.selectors';\nimport { getDashboardMode } from '@shared/functions/get-dashboard-mode.function';\nimport { TenantData } from '@shared/interfaces/tenant-data';\nimport { UserData } from '@shared/interfaces/user-data';\nimport { AuthService } from '@shared/services/auth.service';\nimport { SnackbarErrorMessage } from '@ui-components/components/customized-snackbar/snackbar-message.enum';\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\nimport { closeMenus } from './boards/store/boards.actions';\nimport { environment } from '../../../environments/environment';\n\n@UntilDestroy()\n@Component({\n selector: 'app-main-application',\n templateUrl: './main-application.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MainApplicationComponent extends PuSubscribable implements OnInit, OnDestroy {\n environment = environment;\n currentVersion = '';\n currentVersionTimeStamp = 0;\n\n constructor(\n protected cdr: ChangeDetectorRef,\n private router: Router,\n private authService: AuthService,\n private store: Store<{}>,\n private notificationsService: NotificationsService,\n private snackbarService: SnackbarService,\n private appVersionService: AppVersionService,\n private activatedRoute: ActivatedRoute\n ) {\n super();\n }\n\n ngOnInit() {\n this.tokenRevoke();\n this.store.dispatch(setWindowWidth({ windowWidth: window.innerWidth }));\n\n const { version_timestamp, version_number } = this.appVersionService.getBuiltInVersionInfo();\n this.currentVersionTimeStamp = version_timestamp;\n this.currentVersion = version_number;\n\n this.router.events\n .pipe(\n untilDestroyed(this),\n filter(event => event instanceof NavigationEnd)\n )\n .subscribe(() => {\n this.checkSlackResponse();\n this.checkBuildiumResponse();\n this.cdr.detectChanges();\n })\n .untilDestroyed(this);\n\n this.authService\n .isAuthenticated()\n .pipe(untilDestroyed(this), distinctUntilChanged())\n .subscribe(isAuthenticated => {\n this.store.dispatch(setAuthenticated({ isAuthenticated }));\n\n if (!isAuthenticated) {\n this.notificationsService.close();\n return;\n }\n\n this.store.dispatch(loadTenantData());\n this.store.dispatch(loadUserData());\n this.store.dispatch(loadEnumerations());\n this.notificationsService.connect();\n })\n .untilDestroyed(this);\n\n this.store\n .select(selectUserData)\n .pipe(\n untilDestroyed(this),\n filter((userData: UserData) => !!userData)\n )\n .subscribe((userData: UserData) =>\n this.store.dispatch(selectedDashboardMode({ dashboardMode: getDashboardMode(userData) }))\n )\n .untilDestroyed(this);\n\n this.store\n .select(selectTenantData)\n .pipe(\n untilDestroyed(this),\n filter((tenantData: TenantData) => !!tenantData?.tenantId)\n )\n .subscribe((tenantData: TenantData) => {\n const { href, hostname } = window.location;\n if (hostname !== 'localhost' && !href.includes(tenantData.tenantUrl)) {\n setTimeout(() => {\n const url = new URL(tenantData.tenantUrl);\n url.searchParams.append('revoke-token', '1');\n window.location.href = url.toString();\n }, 0);\n }\n })\n .untilDestroyed(this);\n\n combineLatest([this.store.select(selectTenantData), this.store.select(selectUserData)])\n .pipe(\n untilDestroyed(this),\n filter(([tenantData, userData]) => !!userData.id && !!tenantData?.tenantId),\n take(1),\n tap(([tenantData, userData]) => {\n this.store.dispatch(initPropertySelector({ tenantId: tenantData.tenantId, userId: userData.id }));\n })\n )\n .subscribe()\n .untilDestroyed(this);\n\n this.router.events\n .pipe(\n untilDestroyed(this),\n filter(evt => evt instanceof RoutesRecognized),\n map(evt => evt as RoutesRecognized),\n pairwise()\n )\n .subscribe(([previousEvent, _event]) => {\n if (previousEvent?.state) {\n this.store.dispatch(setPreviousRoute({ previousRoute: previousEvent.urlAfterRedirects }));\n }\n })\n .untilDestroyed(this);\n\n this.appVersionService.pull();\n }\n\n checkSlackResponse() {\n const { slackAdded } = this.activatedRoute.snapshot.queryParams;\n if (slackAdded === 'true') {\n this.removeQueryParam('slackAdded');\n setTimeout(() => {\n this.snackbarService.success(SnackbarErrorMessage.SlackAdded);\n }, 1000);\n }\n }\n\n checkBuildiumResponse() {\n const { buildium } = this.activatedRoute.snapshot.queryParams;\n if (buildium === 'true') {\n this.removeQueryParam('buildium');\n setTimeout(() => {\n this.snackbarService.success(SnackbarErrorMessage.BuildiumSetupCompleted);\n }, 1000);\n }\n if (buildium === 'false') {\n this.removeQueryParam('buildium');\n setTimeout(() => {\n this.snackbarService.error(SnackbarErrorMessage.BuildiumSetupIncompleted);\n }, 1000);\n }\n }\n\n private removeQueryParam(paramName: string) {\n this.router.navigate([], {\n queryParams: {\n [paramName]: null,\n },\n queryParamsHandling: 'merge',\n });\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n this.notificationsService.close();\n }\n\n @HostListener('window:click', ['$event'])\n @HostListener('window:contextmenu', ['$event'])\n onClick(event) {\n this.store.dispatch(closeMenus());\n }\n\n @HostListener('window:resize', ['$event'])\n onResize(event) {\n this.store.dispatch(setWindowWidth({ windowWidth: event.target.innerWidth }));\n }\n\n tokenRevoke() {\n const url = new URL(window.location.href);\n if (url.searchParams.has('revoke-token')) {\n this.authService.clearStorage();\n const url = new URL(window.location.href);\n url.searchParams.delete('revoke-token');\n window.location.href = url.toString();\n }\n }\n}\n","\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\n\nimport { DashboardViewType } from '@shared/enums/dashboard-view-type';\nimport { RouteData } from '@shared/enums/route-data';\nimport { RoutePath } from '@shared/enums/route-path.enum';\nimport { AuthGuard } from '@shared/guards/auth.guard';\nimport { ResidentGuard } from '@shared/guards/resident.guard';\n\nimport { MainApplicationComponent } from './main-application.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: MainApplicationComponent,\n children: [\n {\n path: RoutePath.RESIDENT,\n canActivate: [AuthGuard],\n loadChildren: () => import('@main-application/resident/resident.module').then(m => m.ResidentModule),\n },\n {\n path: '',\n canActivate: [AuthGuard, ResidentGuard],\n loadChildren: () =>\n import('@main-application/application-menu/application-menu.module').then(m => m.ApplicationMenuModule),\n },\n {\n path: RoutePath.NO_PERMISSION,\n canActivate: [AuthGuard],\n data: {\n [RouteData.BREADCRUMB]: 'No permission',\n [RouteData.DASHBOARD_VIEW_TYPE]: DashboardViewType.NONE,\n },\n loadComponent: () =>\n import('@main-application/no-permission/no-permission.component').then(m => m.NoPermissionComponent),\n },\n {\n path: RoutePath.NO_PACKAGE,\n canActivate: [AuthGuard],\n data: {\n [RouteData.BREADCRUMB]: 'No package',\n [RouteData.DASHBOARD_VIEW_TYPE]: DashboardViewType.NONE,\n },\n loadComponent: () =>\n import('@main-application/no-package/no-package.component').then(m => m.NoPackageComponent),\n },\n ],\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class MainApplicationRoutingModule {}\n","import { ScrollingModule } from '@angular/cdk/scrolling';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MAT_TOOLTIP_DEFAULT_OPTIONS, MatTooltipDefaultOptions } from '@angular/material/tooltip';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreDevtoolsModule } from '@ngrx/store-devtools';\nimport player from 'lottie-web';\nimport { LottieCacheModule, LottieModule } from 'ngx-lottie';\n\nimport { NotificationsModule } from '@main-application/notifications/notifications.module';\nimport { SharedStoreModule } from '@main-application/store/shared-store.module';\nimport { ValueIfNonZeroPipe } from '@shared/pipes/valueIfNonZero.pipe';\nimport { ValueIfPositivePipe } from '@shared/pipes/valueIfPositive.pipe';\nimport { YesEmptyPipe } from '@shared/pipes/yesEmpty.pipe';\nimport { SingletonServicesModule } from '@shared/singleton-service.module';\nimport { CustomizedSnackbarModule } from '@ui-components/components/customized-snackbar/customized-snackbar.module';\nimport { ModalsModule } from '@ui-components/modals/modals.module';\n\nimport { MainApplicationComponent } from './main-application.component';\nimport { MainApplicationRoutingModule } from './main-application.routing.module';\nimport { environment } from '../../../environments/environment';\nimport { EnvironmentType } from '../../../environments/environment-config';\n\nexport function playerFactory() {\n return player;\n}\n\nexport const tooltipDefaults: MatTooltipDefaultOptions = {\n showDelay: 250,\n hideDelay: 0,\n touchendHideDelay: 1500,\n};\n\n@NgModule({\n declarations: [MainApplicationComponent],\n imports: [\n LottieModule.forRoot({ player: playerFactory }),\n LottieCacheModule.forRoot(),\n CommonModule,\n NotificationsModule, //ToDo: check what is it and where it should be registered\n EffectsModule.forRoot([]),\n StoreDevtoolsModule.instrument({ maxAge: 25, logOnly: environment.type === EnvironmentType.Prod }),\n SharedStoreModule,\n SingletonServicesModule,\n ModalsModule,\n ScrollingModule,\n FormsModule,\n ReactiveFormsModule,\n MatDialogModule,\n MatSnackBarModule,\n CustomizedSnackbarModule,\n MainApplicationRoutingModule,\n ],\n providers: [\n YesEmptyPipe,\n ValueIfPositivePipe,\n ValueIfNonZeroPipe,\n { provide: MAT_TOOLTIP_DEFAULT_OPTIONS, useValue: tooltipDefaults },\n ],\n})\nexport class MainApplicationModule {}\n","import { createAction, props } from '@ngrx/store';\n\nimport { PmsCredentialModel } from '@shared/interfaces/pms-credential-model.interface';\n\n/**\n * get System Config\n */\nexport const getServiceConfig = createAction('[System Config] get System Config');\nexport const getServiceConfigSuccess = createAction(\n '[System Config] get System Config success',\n props<{ serviceConfig: PmsCredentialModel[] }>()\n);\nexport const getServiceConfigError = createAction('[System Config] get System Config error');\n\nexport const setServiceSectionExpanded = createAction(\n '[System Config] setSystemSectionExpanded',\n props<{ section: 'Statuses' | 'Resident' | 'Triggers'; state: boolean }>()\n);\n","import { createReducer, on } from '@ngrx/store';\n\nimport {\n getServiceConfig,\n getServiceConfigError,\n getServiceConfigSuccess,\n setServiceSectionExpanded,\n} from './service-configuration.actions';\n\nexport const serviceConfigurationFeatureKey = 'serviceConfiguration';\n\nexport interface State {\n expandedSections: {\n Statuses: boolean;\n Resident: boolean;\n Triggers: boolean;\n };\n}\n\nexport const initialState: State = {\n expandedSections: {\n Statuses: true,\n Resident: false,\n Triggers: false,\n },\n};\n\nexport const reducer = createReducer(\n initialState,\n on(getServiceConfig, (state, action) => ({ ...state, serviceConfigLoading: false })),\n on(getServiceConfigSuccess, (state, action) => ({\n ...state,\n serviceConfigLoading: false,\n serviceConfig: action.serviceConfig,\n })),\n on(getServiceConfigError, (state, action) => ({\n ...state,\n serviceConfigLoading: false,\n serviceConfig: null,\n })),\n on(setServiceSectionExpanded, (state, action) => ({\n ...state,\n expandedSections: {\n ...state.expandedSections,\n [action.section]: action.state,\n },\n }))\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { PmsCredentialModel } from '@shared/interfaces/pms-credential-model.interface';\nimport { RestChatHooksChannel } from '@shared/interfaces/rest-chat-hooks-channel';\nimport { RestTimerReport } from '@shared/interfaces/rest-timer-report';\n\n/**\n * get System Config\n */\nexport const getSystemConfig = createAction('[System Config] get System Config');\nexport const getSystemConfigSuccess = createAction(\n '[System Config] get System Config success',\n props<{ systemConfig: PmsCredentialModel[] }>()\n);\nexport const getSystemConfigError = createAction('[System Config] get System Config error');\n\n/**\n * update System Config\n */\nexport const updateSystemConfig = createAction(\n '[System Config] update System Config',\n props<{ pmsCredential: PmsCredentialModel }>()\n);\nexport const deleteSystemConfig = createAction('[System Config] delete System Config', props<{ id: number }>());\nexport const updateSystemConfigSuccess = createAction('[System Config] update System Config success');\nexport const updateSystemConfigError = createAction('[System Config] update System Config error');\n\n/**\n * Timer Report\n */\n\nexport const getTimerReport = createAction('[System Config] getTimerReport');\nexport const getTimerReportSuccess = createAction(\n '[System Config] getTimerReportSuccess',\n props<{ timerReport: RestTimerReport[] }>()\n);\nexport const getTimerReportError = createAction('[System Config] getTimerReportError');\n\n/**\n * chat hooks\n */\n\nexport const getChatChannels = createAction('[System Config] getChatChannels');\nexport const getChatChannelsSuccess = createAction(\n '[System Config] getChatChannelsSuccess',\n props<{ channels: RestChatHooksChannel[] }>()\n);\nexport const getChatChannelsError = createAction('[System Config] getChatChannelsError');\n\nexport const setPropertyChatChannels = createAction(\n '[System Config] setPropertyChatChannels',\n props<{ channelIds: string[]; propertyId: number }>()\n);\nexport const setPropertyChatChannelsSuccess = createAction('[System Config] setPropertyChatChannelsSuccess');\nexport const setPropertyChatChannelsError = createAction('[System Config] setPropertyChatChannelsError');\n\nexport const setSystemSectionExpanded = createAction(\n '[System Config] setSystemSectionExpanded',\n props<{ section: 'API' | 'Hooks' | 'DateTime' | 'TimerReport'; state: boolean }>()\n);\n","import { createReducer, on } from '@ngrx/store';\n\nimport { UpdateStatus } from '@shared/enums/update-status';\nimport { PmsCredentialModel } from '@shared/interfaces/pms-credential-model.interface';\nimport { RestChatHooksChannel } from '@shared/interfaces/rest-chat-hooks-channel';\nimport { RestTimerReport } from '@shared/interfaces/rest-timer-report';\n\nimport {\n getChatChannelsSuccess,\n getSystemConfig,\n getSystemConfigError,\n getSystemConfigSuccess,\n getTimerReport,\n getTimerReportError,\n getTimerReportSuccess,\n setSystemSectionExpanded,\n updateSystemConfig,\n updateSystemConfigError,\n updateSystemConfigSuccess,\n} from './system-configuration.actions';\n\nexport const systemConfigurationFeatureKey = 'systemConfiguration';\n\nexport interface State {\n systemConfig: PmsCredentialModel[];\n systemConfigLoading: boolean;\n timerReportLoading: boolean;\n timerReport: RestTimerReport[];\n updateSystemStatus: UpdateStatus;\n updateSystemInProgress: boolean;\n chatHooksChannels: RestChatHooksChannel[];\n expandedSections: {\n API: boolean;\n Hooks: boolean;\n DateTime: boolean;\n TimerReport: boolean;\n };\n}\n\nexport const initialState: State = {\n systemConfig: null,\n systemConfigLoading: false,\n timerReportLoading: false,\n timerReport: null,\n updateSystemStatus: null,\n updateSystemInProgress: false,\n chatHooksChannels: [],\n expandedSections: {\n API: true,\n Hooks: false,\n DateTime: false,\n TimerReport: false,\n },\n};\n\nexport const reducer = createReducer(\n initialState,\n on(getSystemConfig, (state, action) => ({ ...state, systemConfigLoading: true })),\n on(getSystemConfigSuccess, (state, action) => ({\n ...state,\n systemConfigLoading: false,\n systemConfig: action.systemConfig,\n })),\n on(getSystemConfigError, (state, action) => ({\n ...state,\n systemConfigLoading: false,\n systemConfig: null,\n })),\n on(getTimerReport, (state, action) => ({ ...state, timerReportLoading: false })),\n on(getTimerReportSuccess, (state, action) => ({\n ...state,\n timerReportLoading: false,\n timerReport: action.timerReport,\n })),\n on(getTimerReportError, (state, action) => ({\n ...state,\n timerReportLoading: false,\n timerReport: null,\n })),\n\n on(updateSystemConfig, (state, action) => ({\n ...state,\n\n updateSystemStatus: UpdateStatus.IN_PROGRESS,\n updateSystemInProgress: true,\n })),\n on(updateSystemConfigSuccess, (state, action) => ({\n ...state,\n updateSystemStatus: UpdateStatus.UPDATED,\n updateSystemInProgress: false,\n })),\n on(updateSystemConfigError, (state, action) => ({\n ...state,\n updateSystemStatus: UpdateStatus.ERROR,\n updateSystemInProgress: false,\n })),\n on(getChatChannelsSuccess, (state, action) => ({\n ...state,\n chatHooksChannels: action.channels,\n })),\n on(setSystemSectionExpanded, (state, action) => ({\n ...state,\n expandedSections: {\n ...state.expandedSections,\n [action.section]: action.state,\n },\n }))\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { StepAssigneeTableItem } from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/config/interfaces/step-assignee-table-item.interface';\nimport { PropertyAssignees } from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/config/interfaces/step-assignees';\nimport { WorkflowStepEnumType } from '@shared/enums/workflow-step.enum';\nimport { IRadioButtonOption } from '@shared/interfaces/radio-button-option.interface';\nimport {\n RestPortfolioWorkflowStepAssignmentModel,\n RestWorkflowPortfolioStepAssignmentModel,\n RestWorkflowStepAssignmentModel,\n} from '@shared/interfaces/rest-workflow-step-assignment-model.interface';\n\n/* Load Responsible Parties */\nexport const loadResponsibleParties = createAction(\n '[StepAssignees] load responsible parties',\n props<{ portfolioId: number }>()\n);\n\nexport const loadResponsiblePartiesSuccess = createAction(\n '[StepAssignees] load responsible parties Success',\n props<{ responsibleParties: RestWorkflowStepAssignmentModel[] }>()\n);\nexport const loadResponsiblePartiesFailure = createAction('[StepAssignees] load responsible parties failure');\n\nexport const setAllStepAssigneeList = createAction(\n '[StepAssignees] setAllStepAssigneeList',\n props<{ allStepAssigneeList: StepAssigneeTableItem[] }>()\n);\n\n/* Create Responsible Parties */\nexport const createResponsibleParties = createAction(\n '[StepAssignees] create responsible parties',\n props<{ responsibleParties: RestWorkflowStepAssignmentModel[] }>()\n);\nexport const createResponsiblePartiesSuccess = createAction(\n '[StepAssignees] create responsible parties success',\n props<{ createResponsibleParties: RestWorkflowStepAssignmentModel[] }>()\n);\nexport const createResponsiblePartiesFailure = createAction('[StepAssignees] create responsible parties failure');\n\n/* Update Responsible Parties */\nexport const updateResponsibleParties = createAction(\n '[StepAssignees] update responsible parties',\n props<{ responsibleParties: RestWorkflowStepAssignmentModel[] }>()\n);\nexport const updateResponsiblePartiesSuccess = createAction(\n '[StepAssignees] update responsible parties success',\n\n props<{ updateResponsibleParties: RestWorkflowStepAssignmentModel[] }>()\n);\nexport const updateResponsiblePartiesFailure = createAction('[StepAssignees] update responsible parties failure');\n\nexport const deleteResponsibleParties = createAction(\n '[StepAssignees] deleteResponsibleParties',\n props<{ propertyId: number; propertyName?: string; workflowStepEnumType?: WorkflowStepEnumType }>()\n);\nexport const deleteResponsiblePartiesSuccess = createAction('[StepAssignees] deleteResponsiblePartiesSuccess');\nexport const deleteResponsiblePartiesFailure = createAction('[StepAssignees] deleteResponsiblePartiesFailure');\n\nexport const resetAssigneesUpdateStatus = createAction('[StepAssignees] reset Assignees Update Status');\nexport const resetAssigneesUpdateModel = createAction('[StepAssignees] reset Assignees Update model');\n\nexport const setEditedCell = createAction('[StepAssignees] set Edited Cell', props<{ uuid: string }>());\nexport const resetEditedCell = createAction('[StepAssignees] reset Edited Cell');\n\nexport const setUserRadioList = createAction(\n '[StepAssignees] set User Radio List',\n props<{ allUsers: IRadioButtonOption[] }>()\n);\nexport const resetAllUserList = createAction('[StepAssignees] reset All User List');\n\nexport const updatePropertyUser = createAction(\n '[StepAssignees] update Property User',\n props<{ propertyUsers: PropertyAssignees[] }>()\n);\nexport const resetPropertyUser = createAction('[StepAssignees] reset Property User');\n\nexport const loadDefaultPortfolioResponsibleParties = createAction(\n '[StepAssignees] loadDefaultPortfolioResponsibleParties',\n props<{ portfolioId: number }>()\n);\nexport const loadDefaultPortfolioResponsiblePartiesSuccess = createAction(\n '[StepAssignees] loadDefaultPortfolioResponsiblePartiesSuccess',\n props<{ responsibleParties: RestPortfolioWorkflowStepAssignmentModel[] }>()\n);\nexport const loadDefaultPortfolioResponsiblePartiesFailed = createAction(\n '[StepAssignees] loadDefaultPortfolioResponsiblePartiesFailed'\n);\n\n/* Update Responsible Parties */\nexport const updatePortfolioResponsibleParties = createAction(\n '[StepAssignees] updatePortfolioResponsibleParties',\n props<{ portfolioId: number; responsibleParties: RestWorkflowPortfolioStepAssignmentModel[] }>()\n);\nexport const updatePortfolioResponsiblePartiesSuccess = createAction(\n '[StepAssignees] updatePortfolioResponsiblePartiesSuccess'\n);\nexport const updatePortfolioResponsiblePartiesFailure = createAction(\n '[StepAssignees] updatePortfolioResponsiblePartiesFailure'\n);\n\nexport const deletePortfolioResponsibleParties = createAction(\n '[StepAssignees] deletePortfolioResponsibleParties',\n props<{ portfolioId: number; workflowStepType: WorkflowStepEnumType }>()\n);\nexport const deletePortfolioResponsiblePartiesSuccess = createAction(\n '[StepAssignees] deletePortfolioResponsiblePartiesSuccess'\n);\nexport const deletePortfolioResponsiblePartiesFailure = createAction(\n '[StepAssignees] deletePortfolioResponsiblePartiesFailure'\n);\n\nexport const updatePropertyProjectManager = createAction(\n '[StepAssignees] updatePropertyProjectManager',\n props<{ propertyId: number; userId: number }>()\n);\nexport const updatePropertyProjectManagerSuccess = createAction('[StepAssignees] updatePropertyProjectManagerSuccess');\nexport const updatePropertyProjectManagerFailed = createAction('[StepAssignees] updatePropertyProjectManagerFailed');\n\nexport const deletePropertyProjectManager = createAction(\n '[StepAssignees] deletePropertyProjectManager',\n props<{ propertyId: number; userId: number }>()\n);\n","import { createReducer, on } from '@ngrx/store';\n\nimport { StepAssigneeTableItem } from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/config/interfaces/step-assignee-table-item.interface';\nimport { PropertyAssignees } from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-step-assignees/config/interfaces/step-assignees';\nimport { UpdateStatus } from '@shared/enums/update-status';\nimport { IRadioButtonOption } from '@shared/interfaces/radio-button-option.interface';\nimport {\n RestPortfolioWorkflowStepAssignmentModel,\n RestWorkflowStepAssignmentModel,\n} from '@shared/interfaces/rest-workflow-step-assignment-model.interface';\n\nimport {\n createResponsibleParties,\n createResponsiblePartiesFailure,\n createResponsiblePartiesSuccess,\n loadDefaultPortfolioResponsiblePartiesFailed,\n loadDefaultPortfolioResponsiblePartiesSuccess,\n loadResponsibleParties,\n loadResponsiblePartiesFailure,\n loadResponsiblePartiesSuccess,\n resetAllUserList,\n resetAssigneesUpdateModel,\n resetAssigneesUpdateStatus,\n resetEditedCell,\n resetPropertyUser,\n setAllStepAssigneeList,\n setEditedCell,\n setUserRadioList,\n updatePropertyUser,\n updateResponsibleParties,\n updateResponsiblePartiesFailure,\n updateResponsiblePartiesSuccess,\n} from '../actions/turnover-configuration-step-assignees.actions';\n\nexport const reponsiblePartiesFeatureKey = 'reponsibleParties';\n\nexport interface State {\n responsiblePartiesLoading: boolean;\n responsibleParties: RestWorkflowStepAssignmentModel[];\n\n portfolioResponsibleParties: RestPortfolioWorkflowStepAssignmentModel[];\n\n createResponsiblePartiesOngoing: boolean;\n createResponsiblePartiesStatus: UpdateStatus;\n\n updateResponsiblePartiesOngoing: boolean;\n updateResponsiblePartiesStatus: UpdateStatus;\n\n updatedResponsibleParties: RestWorkflowStepAssignmentModel[];\n\n editedCellUUId: string;\n allUsers: IRadioButtonOption[];\n propertyUsers: PropertyAssignees[];\n allStepAssigneeList: StepAssigneeTableItem[];\n}\n\nexport const initialState: State = {\n responsiblePartiesLoading: false,\n responsibleParties: null,\n portfolioResponsibleParties: null,\n\n createResponsiblePartiesOngoing: false,\n createResponsiblePartiesStatus: null,\n\n updateResponsiblePartiesOngoing: false,\n updateResponsiblePartiesStatus: null,\n\n updatedResponsibleParties: [],\n\n editedCellUUId: null,\n allUsers: [],\n propertyUsers: [],\n allStepAssigneeList: [],\n};\n\nexport const reducer = createReducer(\n initialState,\n on(loadResponsibleParties, (state, action) => ({ ...state, responsiblePartiesLoading: true })),\n on(setAllStepAssigneeList, (state, action) => ({\n ...state,\n ...action,\n })),\n on(loadResponsiblePartiesSuccess, (state, action) => ({\n ...state,\n responsibleParties: action.responsibleParties,\n responsiblePartiesLoading: false,\n })),\n on(loadResponsiblePartiesFailure, (state, action) => ({\n ...state,\n responsibleParties: [],\n responsiblePartiesLoading: false,\n })),\n\n on(loadDefaultPortfolioResponsiblePartiesSuccess, (state, action) => ({\n ...state,\n portfolioResponsibleParties: action.responsibleParties,\n })),\n on(loadDefaultPortfolioResponsiblePartiesFailed, (state, action) => ({\n ...state,\n portfolioResponsibleParties: [],\n })),\n\n on(createResponsibleParties, (state, action) => ({\n ...state,\n createResponsiblePartiesOngoing: true,\n createResponsiblePartiesStatus: UpdateStatus.UPDATE,\n })),\n on(createResponsiblePartiesSuccess, (state, action) => ({\n ...state,\n createResponsiblePartiesOngoing: false,\n createResponsiblePartiesStatus: UpdateStatus.OK,\n updatedResponsibleParties: action.createResponsibleParties,\n })),\n on(createResponsiblePartiesFailure, (state, action) => ({\n ...state,\n createResponsiblePartiesOngoing: false,\n createResponsiblePartiesStatus: UpdateStatus.ERROR,\n updatedResponsibleParties: [],\n })),\n\n on(updateResponsibleParties, (state, action) => ({\n ...state,\n updateResponsiblePartiesOngoing: true,\n updateResponsiblePartiesStatus: UpdateStatus.UPDATE,\n })),\n on(updateResponsiblePartiesSuccess, (state, action) => ({\n ...state,\n updateResponsiblePartiesOngoing: false,\n updateResponsiblePartiesStatus: UpdateStatus.OK,\n updatedResponsibleParties: action.updateResponsibleParties,\n })),\n on(updateResponsiblePartiesFailure, (state, action) => ({\n ...state,\n updateResponsiblePartiesOngoing: false,\n updateResponsiblePartiesStatus: UpdateStatus.ERROR,\n updatedResponsibleParties: [],\n })),\n\n on(resetAssigneesUpdateStatus, (state, action) => ({\n ...state,\n createResponsiblePartiesStatus: null,\n updateResponsiblePartiesStatus: null,\n })),\n\n on(resetAssigneesUpdateModel, (state, action) => ({\n ...state,\n updatedResponsibleParties: [],\n })),\n\n on(setEditedCell, (state, action) => ({\n ...state,\n editedCellUUId: action.uuid,\n })),\n on(resetEditedCell, (state, action) => ({\n ...state,\n editedCellUUId: null,\n })),\n\n on(setUserRadioList, (state, action) => ({\n ...state,\n allUsers: action.allUsers,\n })),\n on(resetAllUserList, (state, action) => ({\n ...state,\n allUsers: null,\n })),\n on(updatePropertyUser, (state, action) => ({\n ...state,\n propertyUsers: action.propertyUsers,\n })),\n on(resetPropertyUser, (state, action) => ({\n ...state,\n propertyUsers: [],\n }))\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { RestUnitRenewalTargetModel } from '@shared/interfaces/renevals.interface';\nimport { RestThresholdSection } from '@shared/interfaces/rest-threshold-section';\n\n/**\n * Threshold sections\n */\nexport const loadAllThresholds = createAction('[Management] Load all thresholds');\nexport const loadAllThresholdsSuccess = createAction(\n '[Management] All thresholds loading success',\n props<{ thresholdSections: RestThresholdSection[] }>()\n);\nexport const loadAllThresholdsFailed = createAction('[Management] All thresholds loading failed');\n\n/**\n * Thresholds Property\n */\nexport const loadThresholdsProperty = createAction(\n '[Management] Load thresholds property',\n props<{ portfolioId: number }>()\n);\nexport const loadThresholdsPropertySuccess = createAction(\n '[Management] thresholds property loading success',\n props<{ thresholdProperty: RestThresholdSection[] }>()\n);\nexport const loadThresholdsPropertyFailed = createAction('[Management] thresholds property loading failed');\n\n/**\n * Thresholds task\n */\nexport const loadThresholdsTask = createAction('[Management] Load thresholds task');\nexport const loadThresholdsTaskSuccess = createAction(\n '[Management] thresholds task loading success',\n props<{ thresholdTask: RestThresholdSection[] }>()\n);\nexport const loadThresholdsTaskFailed = createAction('[Management] thresholds task loading failed');\nexport const setThresholdsConfig = createAction(\n '[Management] set thresholds config',\n props<{ threshold: RestThresholdSection }>()\n);\nexport const setThresholdsConfigSuccess = createAction('[Management] set thresholds config success');\nexport const setThresholdsConfigFailed = createAction('[Management] set thresholds config failed');\n\n/**\n * get renewal target list\n */\nexport const getRenewalTargetList = createAction(\n '[Management] get renewal target list',\n props<{ propertyId: number }>()\n);\nexport const getRenewalTargetListSuccess = createAction(\n '[Management] get renewal target list success',\n props<{ renewalTargetList: RestUnitRenewalTargetModel[] }>()\n);\nexport const getRenewalTargetListFailure = createAction('[Management] get renewal target list failure');\n\n/**\n * update renewal target\n */\nexport const updateRenewalTarget = createAction(\n '[Management] update renewal target ',\n props<{ renewalTargetModels: RestUnitRenewalTargetModel[] }>()\n);\nexport const updateRenewalTargetSuccess = createAction('[Management] update renewal target success');\nexport const updateRenewalTargetFailure = createAction('[Management] update renewal target failure');\n","import { createReducer, on } from '@ngrx/store';\n\nimport { RestUnitRenewalTargetModel } from '@shared/interfaces/renevals.interface';\nimport { RestThresholdSection } from '@shared/interfaces/rest-threshold-section';\n\nimport {\n getRenewalTargetList,\n getRenewalTargetListFailure,\n getRenewalTargetListSuccess,\n loadAllThresholds,\n loadAllThresholdsFailed,\n loadAllThresholdsSuccess,\n loadThresholdsProperty,\n loadThresholdsPropertyFailed,\n loadThresholdsPropertySuccess,\n loadThresholdsTask,\n loadThresholdsTaskFailed,\n loadThresholdsTaskSuccess,\n setThresholdsConfig,\n setThresholdsConfigFailed,\n setThresholdsConfigSuccess,\n updateRenewalTarget,\n updateRenewalTargetFailure,\n updateRenewalTargetSuccess,\n} from './management.actions';\n\nexport const managementFeatureKey = 'management';\n\nexport interface ManagementState {\n thresholdSectionLoading: boolean;\n thresholdSections: RestThresholdSection[];\n thresholdSectionPropertyLoading: boolean;\n thresholdSectionProperty: RestThresholdSection[];\n thresholdSectionTaskLoading: boolean;\n thresholdSectionTask: RestThresholdSection[];\n thresholdUpdateLoading: boolean;\n renewalTargetList: RestUnitRenewalTargetModel[];\n renewalTargetListLoading: boolean;\n updateRenewalTargetModelLoading: boolean;\n}\n\nexport const initialState: ManagementState = {\n thresholdSectionLoading: false,\n thresholdSections: [],\n thresholdSectionPropertyLoading: false,\n thresholdSectionProperty: [],\n thresholdSectionTaskLoading: false,\n thresholdSectionTask: [],\n thresholdUpdateLoading: false,\n renewalTargetList: [],\n renewalTargetListLoading: false,\n updateRenewalTargetModelLoading: false,\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * Threshold sections\n */\n on(loadAllThresholds, (state, action) => ({ ...state, thresholdSectionLoading: true })),\n on(loadAllThresholdsSuccess, (state, action) => ({\n ...state,\n thresholdSectionLoading: false,\n thresholdSections: action.thresholdSections,\n })),\n on(loadAllThresholdsFailed, (state, action) => ({ ...state, thresholdSectionLoading: false, thresholdSections: [] })),\n\n /**\n * Thresholds Property\n */\n on(loadThresholdsProperty, (state, action) => ({ ...state, thresholdSectionPropertyLoading: true })),\n on(loadThresholdsPropertySuccess, (state, action) => ({\n ...state,\n thresholdSectionPropertyLoading: false,\n thresholdSectionProperty: action.thresholdProperty,\n })),\n on(loadThresholdsPropertyFailed, (state, action) => ({\n ...state,\n thresholdSectionPropertyLoading: false,\n thresholdSectionProperty: null,\n })),\n\n /**\n * Thresholds task\n */\n on(loadThresholdsTask, (state, action) => ({ ...state, thresholdSectionTaskLoading: true })),\n on(loadThresholdsTaskSuccess, (state, action) => ({\n ...state,\n thresholdSectionTaskLoading: false,\n thresholdSectionTask: action.thresholdTask,\n })),\n on(loadThresholdsTaskFailed, (state, action) => ({\n ...state,\n thresholdSectionTaskLoading: false,\n thresholdSectionTask: [],\n })),\n\n /**\n * Threshold update\n */\n on(setThresholdsConfig, (state, action) => ({ ...state, thresholdUpdateLoading: true })),\n on(setThresholdsConfigSuccess, (state, action) => ({\n ...state,\n thresholdUpdateLoading: false,\n })),\n on(setThresholdsConfigFailed, (state, action) => ({\n ...state,\n thresholdUpdateLoading: false,\n })),\n\n /**\n * get renewal target list\n */\n on(getRenewalTargetList, (state, action) => ({ ...state, renewalTargetListLoading: true })),\n on(getRenewalTargetListSuccess, (state, action) => ({\n ...state,\n renewalTargetList: action.renewalTargetList,\n renewalTargetListLoading: false,\n })),\n on(getRenewalTargetListFailure, (state, action) => ({\n ...state,\n renewalTargetList: [],\n renewalTargetListLoading: false,\n })),\n\n /**\n * update renewal target\n */\n on(updateRenewalTarget, (state, action) => ({ ...state, updateRenewalTargetModelLoading: true })),\n on(updateRenewalTargetSuccess, (state, action) => ({\n ...state,\n updateRenewalTargetModelLoading: false,\n })),\n on(updateRenewalTargetFailure, (state, action) => ({\n ...state,\n updateRenewalTargetModelLoading: false,\n }))\n);\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { IconComponent } from '@ui-components/components/icon/icon.component';\n\n@NgModule({\n imports: [CommonModule, IconComponent],\n})\nexport class NotificationsModule {}\n","import { createAction, props } from '@ngrx/store';\n\nimport { BaseNotificationBody, WebNotification } from '@shared/interfaces/notification.interface';\n\n/**\n * Clear Notifications store\n */\nexport const clearNotificationsStore = createAction('[Notifications] Clear Notifications store');\n\n/**\n * add latest notification\n */\nexport const addLatestNotification = createAction(\n '[Notifications] add latest Notification',\n props<{ notification: WebNotification }>()\n);\n/**\n * add latest notification of any user any event\n */\nexport const addLatestAnyNotification = createAction(\n '[Notifications] add latest any Notification',\n props<{ notification: WebNotification }>()\n);\n/**\n * mark last notification of any user any event\n */\nexport const markAnyNotificationsAsRead = createAction(\n '[Notifications] mark all turnovers of any notifications as read',\n props<{ turnoverId: number }>()\n);\n/**\n * clear list of any notification\n */\nexport const clearAnyNotifications = createAction('[Notifications] clear list of any notifications');\n/**\n * clear list of any notification\n */\nexport const updateAnyNotifications = createAction(\n '[Notifications] update list of any notifications',\n props<{ list: WebNotification[] }>()\n);\n\n/**\n * get last notification list\n */\nexport const getLastNotificationList = createAction('[Notifications] get last notification list');\nexport const getLastNotificationListSuccess = createAction(\n '[Notifications] get last notification list success',\n props<{ lastNotificationList: WebNotification[] }>()\n);\nexport const getLastNotificationListFailed = createAction('[Notifications] get last notification list failed');\n\n/**\n * mark all as read\n */\nexport const markAllAsRead = createAction('[Notifications] set all as read');\nexport const markAllAsReadSuccess = createAction('[Notifications] set all as read success');\nexport const markAllAsReadFailed = createAction('[Notifications] set mark all as read failed');\n\n/**\n * mark selected as read\n */\nexport const markAsRead = createAction(\n '[Notifications] set mark all as read',\n props<{ baseNotificationBody: BaseNotificationBody }>()\n);\nexport const markAsReadSuccess = createAction('[Notifications] set mark all as read success');\nexport const markAsReadFailed = createAction('[Notifications] set mark all as read failed');\n\n/**\n * delete notification\n */\nexport const deleteNotification = createAction(\n '[Notifications] delete notification',\n props<{ baseNotificationBody: BaseNotificationBody }>()\n);\nexport const deleteNotificationSuccess = createAction('[Notifications] delete notification success');\nexport const deleteNotificationFailed = createAction('[Notifications] delete notification failed');\n","import { createReducer, on } from '@ngrx/store';\nimport { first } from 'lodash';\n\nimport {\n addLatestAnyNotification,\n addLatestNotification,\n clearAnyNotifications,\n clearNotificationsStore,\n deleteNotification,\n deleteNotificationFailed,\n deleteNotificationSuccess,\n getLastNotificationList,\n getLastNotificationListFailed,\n getLastNotificationListSuccess,\n markAllAsRead,\n markAllAsReadFailed,\n markAllAsReadSuccess,\n markAsRead,\n markAsReadFailed,\n markAsReadSuccess,\n updateAnyNotifications,\n} from '@main-application/notifications/store/actions/notifications.actions';\nimport { UpdateStatus } from '@shared/enums/update-status';\nimport { WebNotification } from '@shared/interfaces/notification.interface';\n\nexport const notificationsFeatureKey = 'notifications';\n\nexport interface State {\n bidNotification: WebNotification;\n ticketNotification: WebNotification;\n turnoverNotification: WebNotification;\n lastAnyNotificationList: WebNotification[];\n lastNotificationList: WebNotification[];\n lastNotificationListLoading: boolean;\n markAllAsReadInProgress: boolean;\n markAllAsReadStatus: UpdateStatus;\n markAsReadInProgress: boolean;\n markAsReadStatus: UpdateStatus;\n markAsReadId: string;\n deleteNotificationInProgress: boolean;\n}\n\nexport const initialState: State = {\n bidNotification: null,\n ticketNotification: null,\n turnoverNotification: null,\n lastAnyNotificationList: [],\n lastNotificationList: [],\n lastNotificationListLoading: false,\n markAllAsReadInProgress: false,\n markAllAsReadStatus: null,\n markAsReadInProgress: false,\n markAsReadStatus: null,\n markAsReadId: null,\n deleteNotificationInProgress: false,\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * Clear Notifications store\n */\n on(clearNotificationsStore, (state, action) => ({\n ...state,\n ...initialState,\n })),\n\n /**\n * get last notification list\n */\n on(getLastNotificationList, (state, action) => ({\n ...state,\n lastNotificationListLoading: true,\n })),\n on(getLastNotificationListSuccess, (state, action) => ({\n ...state,\n lastNotificationList: action.lastNotificationList,\n lastNotificationListLoading: false,\n })),\n on(getLastNotificationListFailed, (state, action) => ({\n ...state,\n lastNotificationList: [],\n lastNotificationListLoading: false,\n })),\n\n on(addLatestNotification, (state, action) => ({\n ...state,\n lastNotificationList: [action.notification, ...state.lastNotificationList],\n })),\n\n on(addLatestAnyNotification, (state, action) => ({\n ...state,\n lastAnyNotificationList: [action.notification, ...state.lastAnyNotificationList],\n })),\n\n on(clearAnyNotifications, (state, action) => ({\n ...state,\n lastAnyNotificationList: [],\n })),\n\n on(updateAnyNotifications, (state, action) => ({\n ...state,\n lastAnyNotificationList: [...action.list],\n })),\n\n /**\n * mark all as read\n */\n on(markAllAsRead, (state, action) => ({\n ...state,\n markAllAsReadInProgress: true,\n markAllAsReadStatus: null,\n })),\n on(markAllAsReadSuccess, (state, action) => ({\n ...state,\n markAllAsReadInProgress: false,\n markAllAsReadStatus: UpdateStatus.UPDATE,\n })),\n on(markAllAsReadFailed, (state, action) => ({\n ...state,\n markAllAsReadInProgress: false,\n markAllAsReadStatus: UpdateStatus.ERROR,\n })),\n\n /**\n * mark selected as read\n */\n on(markAsRead, (state, action) => ({\n ...state,\n markAsReadInProgress: true,\n markAsReadStatus: null,\n markAsReadId: first(action.baseNotificationBody?.notificationIds),\n })),\n on(markAsReadSuccess, (state, action) => ({\n ...state,\n markAsReadInProgress: false,\n markAsReadStatus: UpdateStatus.UPDATE,\n })),\n on(markAsReadFailed, (state, action) => ({\n ...state,\n markAsReadInProgress: false,\n markAsReadStatus: UpdateStatus.ERROR,\n })),\n\n /**\n * delete notification\n */\n on(deleteNotification, (state, action) => ({\n ...state,\n deleteNotificationInProgress: true,\n })),\n on(deleteNotificationSuccess, (state, action) => ({\n ...state,\n deleteNotificationInProgress: false,\n })),\n on(deleteNotificationFailed, (state, action) => ({\n ...state,\n deleteNotificationInProgress: false,\n }))\n);\n","import { createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromNotifications from '@main-application/notifications/store/reducers/notifications.reducer';\n\nexport const selectNotificationsState = createFeatureSelector(\n fromNotifications.notificationsFeatureKey\n);\n\n/**\n * get last notification list\n */\nexport const selectLastNotificationList = createSelector(\n selectNotificationsState,\n notificationsState => notificationsState.lastNotificationList\n);\n\n/**\n * get last any notification\n */\nexport const selectLastAnyNotificationList = createSelector(\n selectNotificationsState,\n notificationsState => notificationsState.lastAnyNotificationList\n);\n\n/**\n * delete notification\n */\nexport const selectDeleteNotificationInProgress = createSelector(\n selectNotificationsState,\n notificationsState => notificationsState.deleteNotificationInProgress\n);\n","import * as moment from 'moment';\n\nimport { ServiceSummaryTicketType, SummaryTicketFilters, TicketFilter } from '@app/services/tickets.service';\nimport { TicketCompletedStatusType } from '@shared/enums/ticket-status-type';\nimport { IRadioButtonOption } from '@shared/interfaces/radio-button-option.interface';\nimport { RestUpdateInspectionTicket } from '@shared/interfaces/ticket.interface';\nimport { RestTicketModel } from '@shared/interfaces/turnover.interface';\nimport { getFilterDateRange } from '@template/utils/filter';\n\nexport namespace TicketListConstants {\n export enum TimeFrame {\n Week = 1,\n Month,\n Month_3,\n Month_6,\n Year,\n AllTime,\n Custom,\n }\n\n export const timeFrames = [\n { value: TimeFrame.Week, label: 'past 7 days' },\n { value: TimeFrame.Month, label: 'past 30 days' },\n { value: TimeFrame.Month_3, label: 'past 3 months' },\n { value: TimeFrame.Month_6, label: 'past 6 months' },\n { value: TimeFrame.Year, label: 'past year' },\n { value: TimeFrame.AllTime, label: 'all time' },\n { value: TimeFrame.Custom, label: 'custom' },\n ];\n}\n\nexport const labelConfig: IRadioButtonOption[] = [\n {\n label: 'All Tickets',\n value: ServiceSummaryTicketType.AllTickets,\n groupValue: null,\n },\n {\n label: 'Service Tickets',\n value: ServiceSummaryTicketType.ServiceTickets,\n groupValue: 'ticketType',\n },\n {\n label: 'Resident Tickets',\n value: ServiceSummaryTicketType.ResidentTickets,\n groupValue: 'ticketType',\n },\n {\n label: 'Inspection Tickets',\n value: ServiceSummaryTicketType.InspectionTickets,\n groupValue: 'ticketType',\n },\n {\n label: 'Replacement Tickets',\n value: ServiceSummaryTicketType.ReplacementTickets,\n groupValue: 'ticketType',\n },\n];\n\nexport function getTicketId(ticket?: RestTicketModel | RestUpdateInspectionTicket | undefined): string {\n if (!ticket) return '';\n\n const pmsTicketText = ticket?.pmsWorkOrderNumber ?? ticket?.pmsWorkOrderId;\n\n return pmsTicketText ? pmsTicketText : `PU${ticket.id}`;\n}\n\nexport const getServerPartFilter = (\n filter: { [key: string]: any },\n summaryFilters: Partial,\n currentDate: Date,\n selectedPropertyIds: number[]\n): TicketFilter => {\n const filterData: Partial = {\n portfolioId: filter.portfolioId,\n includeCompleted: !filter.isCompleted ? null : filter.isCompleted !== TicketCompletedStatusType.IsCompleted,\n propertyIds: selectedPropertyIds?.length ? selectedPropertyIds : null,\n };\n if (filter.timeframe !== TicketListConstants.TimeFrame.Custom)\n filterData.startDate = (getFilterDateRange(currentDate, filter, true)?.startDate as string) || null;\n\n if (summaryFilters && Object.keys(summaryFilters)?.length) {\n if (filter.timeframe !== TicketListConstants.TimeFrame.Custom)\n filterData.startDate =\n (getFilterDateRange(currentDate, summaryFilters as any, true)?.startDate as string) || null;\n\n if (summaryFilters.propertyIds) filterData.propertyIds = [summaryFilters.propertyIds];\n\n if (summaryFilters.collectionId) filterData.collectionIds = summaryFilters.collectionId;\n\n if (summaryFilters.boardId) filterData.boardId = summaryFilters.boardId;\n\n if (summaryFilters.unitTypeId) filterData.unitType = summaryFilters.unitTypeId;\n\n if (summaryFilters.ticketCategoryId) filterData.ticketCategoryId = summaryFilters.ticketCategoryId;\n\n if (summaryFilters.topicId) filterData.ticketTopicId = summaryFilters.topicId;\n\n if (summaryFilters.ticketTypeId !== undefined) filterData.ticketSummaryType = summaryFilters.ticketTypeId;\n }\n\n if (filter.timeframe === TicketListConstants.TimeFrame.Custom) {\n if (filter.customStartDate) filterData.startDate = moment(filter.customStartDate).format('YYYY-MM-DD');\n if (filter.customEndDate) filterData.endDate = moment(filter.customEndDate).format('YYYY-MM-DD');\n }\n return filterData;\n};\n\nexport type ServiceFilterPanel = {\n field: string;\n text: string;\n value: string | number;\n color?: number;\n isArray: boolean;\n selector: string;\n};\n\nexport const filterPanelNotEmpty = (filterPanels: { [key: string]: any } | null): boolean => {\n if (!filterPanels) return false;\n\n return Object.values(filterPanels).some(value => {\n if (Array.isArray(value)) return value.length > 0;\n return value !== null && value !== undefined && value !== '';\n });\n};\n\nexport const applyFilterToQueryParams = (\n data: Record,\n queryParams: { [key: string]: any }\n): { [key: string]: any } => {\n Object.entries(data).forEach(([key, value]) => {\n if (queryParams.hasOwnProperty(key)) {\n queryParams[key] = Array.isArray(value) ? `[${value}]` : `${value}`;\n }\n });\n return queryParams;\n};\n","import { createAction, props } from '@ngrx/store';\n\nimport { SummaryFilters } from '@app/services/tickets.service';\nimport {\n ServiceSummaryStatsDetails,\n SummaryStatsGroup,\n} from '@ui-components/components/summary-expandable-table/summary-expandable-table.model';\n\nexport const loadServiceSummaryStats = createAction(\n '[Service] Load Summary Stats',\n props<{ filter: SummaryFilters }>()\n);\nexport const loadServiceSummaryStatsSuccess = createAction(\n '[Service] Load Summary Stats Success',\n props<{ stats: SummaryStatsGroup[] }>()\n);\nexport const loadServiceSummaryStatsFailed = createAction(\n '[Service] Load Summary Stats Failed',\n props<{ error: any }>()\n);\n\nexport const loadServiceSummaryDetails = createAction(\n '[Service] Load Summary Details',\n props<{ filter: SummaryFilters }>()\n);\nexport const loadServiceSummaryDetailsSuccess = createAction(\n '[Service] Load Summary Details Success',\n props<{ details: ServiceSummaryStatsDetails }>()\n);\nexport const loadServiceSummaryDetailsFailed = createAction(\n '[Service] Load Summary Details Failed',\n props<{ error: any }>()\n);\n","import { createReducer, on } from '@ngrx/store';\n\nimport {\n ServiceSummaryStatsDetails,\n SummaryStatsGroup,\n} from '@ui-components/components/summary-expandable-table/summary-expandable-table.model';\n\nimport {\n loadServiceSummaryDetails,\n loadServiceSummaryDetailsFailed,\n loadServiceSummaryDetailsSuccess,\n loadServiceSummaryStats,\n loadServiceSummaryStatsFailed,\n loadServiceSummaryStatsSuccess,\n} from './service.actions';\n\nexport const serviceFeatureKey = 'serviceState';\n\nexport interface State {\n serviceSummaryStats: SummaryStatsGroup[] | null;\n serviceSummaryDetails: ServiceSummaryStatsDetails | null;\n serviceSummaryLoading: boolean;\n serviceSummaryError: any;\n}\n\nexport const initialState: State = {\n serviceSummaryStats: null,\n serviceSummaryDetails: null,\n serviceSummaryLoading: false,\n serviceSummaryError: null,\n};\n\nexport const reducer = createReducer(\n initialState,\n on(loadServiceSummaryStats, state => ({ ...state, serviceSummaryLoading: true, serviceSummaryError: null })),\n on(loadServiceSummaryStatsSuccess, (state, { stats }) => ({\n ...state,\n serviceSummaryStats: stats,\n serviceSummaryLoading: false,\n })),\n on(loadServiceSummaryStatsFailed, (state, { error }) => ({\n ...state,\n serviceSummaryLoading: false,\n serviceSummaryError: error,\n })),\n on(loadServiceSummaryDetails, state => ({ ...state, serviceSummaryLoading: true, serviceSummaryError: null })),\n on(loadServiceSummaryDetailsSuccess, (state, { details }) => ({\n ...state,\n serviceSummaryDetails: details,\n serviceSummaryLoading: false,\n })),\n on(loadServiceSummaryDetailsFailed, (state, { error }) => ({\n ...state,\n serviceSummaryLoading: false,\n serviceSummaryError: error,\n }))\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { TicketListFilter } from '@main-application/tickets/config/interfaces/ticket-list-filter';\nimport { RestTicketModel } from '@shared/interfaces/turnover.interface';\n\n/**\n * get ticket list\n */\nexport const getTicketList = createAction('[Tickets] get ticket list', props<{ assigneeId: number }>());\nexport const getTicketListSuccess = createAction(\n '[Tickets] get ticket list success',\n props<{ ticketList: RestTicketModel[] }>()\n);\nexport const getTicketListFailed = createAction('[Tickets] get ticket list failed');\n\n/**\n * get property ticket list\n */\nexport const getPropertyTicketList = createAction(\n '[Tickets] get property ticket list',\n props<{ propertyId: number }>()\n);\nexport const getPropertyTicketListSuccess = createAction(\n '[Tickets] get property ticket list success',\n props<{ ticketList: RestTicketModel[] }>()\n);\nexport const getPropertyTicketListFailed = createAction('[Tickets] get property ticket list failed');\n\n/**\n * mark ticket as done\n */\nexport const markTicketAsDone = createAction(\n '[Tickets] mark ticket as done',\n props<{ turnoverTicket: RestTicketModel }>()\n);\nexport const markTicketAsDoneSuccess = createAction(\n '[Tickets] mark ticket as done success',\n props<{ updatedTicket: RestTicketModel }>()\n);\nexport const markTicketAsDoneFailed = createAction('[Tickets] mark ticket as done failed');\n\nexport const setTicketListFilter = createAction(\n '[Tickets] set ticket list filter',\n props<{ ticketListFilter: TicketListFilter }>()\n);\n\nexport const clearTicketStore = createAction('[Tickets] clear Ticket Store');\n","import { createReducer, on } from '@ngrx/store';\n\nimport { TicketListFilter } from '@main-application/tickets/config/interfaces/ticket-list-filter';\nimport {\n clearTicketStore,\n getPropertyTicketList,\n getPropertyTicketListFailed,\n getPropertyTicketListSuccess,\n getTicketList,\n getTicketListFailed,\n getTicketListSuccess,\n markTicketAsDone,\n markTicketAsDoneFailed,\n markTicketAsDoneSuccess,\n setTicketListFilter,\n} from '@main-application/tickets/store/actions/tickets.actions';\nimport { RestTicketModel } from '@shared/interfaces/turnover.interface';\n\nexport const ticketsFeatureKey = 'tickets';\n\nexport interface State {\n ticketList: RestTicketModel[];\n ticketListLoading: boolean;\n ticketListFilter: TicketListFilter;\n updatedTicket: RestTicketModel;\n updatedTicketLoading: boolean;\n}\n\nexport const initialState: State = {\n ticketList: [],\n ticketListLoading: false,\n ticketListFilter: {},\n updatedTicket: null,\n updatedTicketLoading: false,\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * Get ticket list\n */\n on(getTicketList, (state, action) => ({\n ...state,\n ticketListLoading: true,\n })),\n on(getTicketListSuccess, (state, action) => ({\n ...state,\n ticketListLoading: false,\n ticketList: action.ticketList,\n })),\n on(getTicketListFailed, (state, action) => ({\n ...state,\n ticketListLoading: false,\n ticketList: [],\n })),\n\n /**\n * get property ticket list\n */\n on(getPropertyTicketList, (state, action) => ({\n ...state,\n ticketListLoading: true,\n })),\n on(getPropertyTicketListSuccess, (state, action) => ({\n ...state,\n ticketListLoading: false,\n ticketList: action.ticketList,\n })),\n on(getPropertyTicketListFailed, (state, action) => ({\n ...state,\n ticketListLoading: false,\n ticketList: [],\n })),\n\n /**\n * mark ticket as done\n */\n on(markTicketAsDone, (state, action) => ({\n ...state,\n updatedTicketLoading: true,\n })),\n on(markTicketAsDoneSuccess, (state, action) => ({\n ...state,\n updatedTicketLoading: false,\n updatedTicket: action.updatedTicket,\n })),\n on(markTicketAsDoneFailed, (state, action) => ({\n ...state,\n updatedTicketLoading: false,\n updatedTicket: null,\n })),\n\n /**\n * set ticket list filter\n */\n on(setTicketListFilter, (state, action) => ({\n ...state,\n ticketListFilter: action.ticketListFilter,\n })),\n\n /**\n * clear Ticket Store\n */\n on(clearTicketStore, (state, action) => ({\n ...state,\n ...initialState,\n }))\n);\n","import { createAction, props } from '@ngrx/store';\n\nimport { SortItem } from '@shared/interfaces/sort-item';\n\nexport const setTurnoverListSorting = createAction(\n '[TurnoverList] set TurnoverList sorting',\n props<{ propertyId: number; sorting: SortItem }>()\n);\n\nexport const toggleTurnoverListAssignees = createAction(\n '[TurnoverList] toggle TurnoverList assignees',\n props<{ stepAssignees: boolean }>()\n);\n\nexport const toggleTurnoverListSteps = createAction(\n '[TurnoverList] toggle TurnoverList steps',\n props<{ showSteps: boolean }>()\n);\n\nexport const setWidgetsCollapseState = createAction(\n '[TurnoverList] setWidgetsCollapseState',\n props<{ collapsed: boolean; manually: boolean }>()\n);\n\nexport const setListScrollState = createAction('[TurnoverList] setListScrollState', props<{ position: number }>());\n","import { MetaReducer, createReducer, on } from '@ngrx/store';\n\nimport { hydrationMetaReducer, patchInitialValue } from '@main-application/store/reducers/hydration-meta.reducer';\nimport {\n setTurnoverListSorting,\n setWidgetsCollapseState,\n toggleTurnoverListAssignees,\n toggleTurnoverListSteps,\n} from '@main-application/turnovers/components/turnover-list/store/actions/turnover-list.actions';\nimport { SortItem } from '@shared/interfaces/sort-item';\n\nexport const turnoverListFeatureKey = 'turnovers-list';\n\nexport interface TurnoverListState {\n stepAssignees: boolean;\n showSteps: boolean;\n propertySorting: { [key: number]: SortItem };\n widgetsState: {\n collapsed: boolean;\n manually: boolean;\n };\n}\n\nexport const initialState: TurnoverListState = patchInitialValue(\n {\n propertySorting: {},\n stepAssignees: false,\n showSteps: false,\n widgetsState: {\n collapsed: false,\n manually: false,\n },\n },\n turnoverListFeatureKey\n);\n\nexport const metaTurnoverListReducers: Array> = [\n hydrationMetaReducer(turnoverListFeatureKey),\n];\n\nexport const reducer = createReducer(\n initialState,\n on(setTurnoverListSorting, (state, action) => ({\n ...state,\n ...{ propertySorting: { ...state.propertySorting, ...{ [action.propertyId]: action.sorting } } },\n })),\n on(toggleTurnoverListAssignees, (state, action) => ({\n ...state,\n ...action,\n })),\n on(toggleTurnoverListSteps, (state, action) => ({\n ...state,\n ...action,\n })),\n on(setWidgetsCollapseState, (state, action) => ({\n ...state,\n widgetsState: action,\n }))\n);\n","import { createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromTurnoverList from '../reducers/turnover-list.reducer';\n\nexport const selectTurnoverListState = createFeatureSelector(\n fromTurnoverList.turnoverListFeatureKey\n);\n\nexport const selectTurnoverListSorting = createSelector(selectTurnoverListState, state => state.propertySorting);\nexport const selectTurnoverListStepState = createSelector(selectTurnoverListState, state => state.showSteps);\nexport const selectTurnoverListAssigneeState = createSelector(selectTurnoverListState, state => state.stepAssignees);\nexport const selectTurnoverWidgetsCollapseState = createSelector(selectTurnoverListState, state => state.widgetsState);\n","import { createAction, props } from '@ngrx/store';\n\nimport { RestBulkScopeAndBidModel } from '@shared/interfaces/rest-bulk-scope-and-bid-model';\nimport { UpdateTypedAttachmentToEntityModel } from '@shared/interfaces/turnover.interface';\n\n/**\n * get bulk scope list\n */\nexport const getBulkScopeList = createAction('[Turnover] get bulk scope list', props<{ propertyId: number }>());\nexport const getBulkScopeListSuccess = createAction(\n '[Turnover] get bulk scope list success',\n props<{ bulkList: RestBulkScopeAndBidModel[] }>()\n);\nexport const getBulkScopeListFailed = createAction('[Turnover] get bulk scope list failed');\n\n/**\n * get bulk scope\n */\nexport const getBulkScope = createAction('[Turnover] get bulk scope', props<{ bulkScopeId: number }>());\nexport const getBulkScopeSuccess = createAction(\n '[Turnover] get bulk scope success',\n props<{ bulkScope: RestBulkScopeAndBidModel }>()\n);\nexport const getBulkScopeFailed = createAction('[Turnover] get bulk scope failed');\n\n/**\n * update bulk scope\n */\nexport const updateBulkScope = createAction(\n '[Turnover] update bulk scope',\n props<{ bulkScope: RestBulkScopeAndBidModel }>()\n);\nexport const updateBulkScopeSuccess = createAction('[Turnover] update bulk scope success');\nexport const updateBulkScopeFailed = createAction('[Turnover] update bulk scope failed');\nexport const resetUpdateBulkScopeStatus = createAction('[Turnover] reset Update Bulk Scope Status');\n\n/**\n * Create new bulk scope\n */\nexport const createNewBulkScope = createAction(\n '[Turnover] Create new bulk scope',\n props<{ bulkScope: RestBulkScopeAndBidModel }>()\n);\nexport const createNewBulkScopeSuccess = createAction(\n '[Turnover] Create new bulk scope success',\n props<{ bulkScopeId: number }>()\n);\nexport const createNewBulkScopeFailed = createAction('[Turnover] Create new bulk scope failed');\nexport const resetNewBulkScopeID = createAction('[Turnover] reset new bulk scope id');\n\n/**\n * Add units to bulk\n */\nexport const addUnitsToBulk = createAction(\n '[Turnover] add units to bulk',\n props<{ bulkScope: RestBulkScopeAndBidModel }>()\n);\nexport const addUnitsToBulkSuccess = createAction('[Turnover] add units to bulk success');\nexport const addUnitsToBulkFailed = createAction('[Turnover] add units to bulk failed');\n\n/**\n * Add bulk attachments\n */\nexport const addBulkTurnoversAttachment = createAction(\n '[Turnover] add bulk turnover attachment',\n props<{ attachment: UpdateTypedAttachmentToEntityModel }>()\n);\nexport const addBulkTurnoversAttachmentSuccess = createAction('[Turnover] add bulk turnover attachment success');\nexport const addBulkTurnoversAttachmentFailed = createAction('[Turnover] add bulk turnover attachment failed');\n","import { createAction, createReducer, on, props } from '@ngrx/store';\n\nimport { WorkflowStepEnumType } from '@shared/enums/workflow-step.enum';\n\nexport const setTurnoverOverviewSectionCounters = createAction(\n '[turnoverOverview] setTurnoverOverviewSectionCounters',\n props()\n);\n\nexport const clearTurnoverOverviewCounters = createAction('[turnoverOverview] clearTurnoverOverviewCounters');\n\nexport const turnoverOverviewFeatureKey = 'turnoverOverview';\n\nexport interface PropertyTurnsCounter {\n propertyId: number;\n counters: {\n [key in WorkflowStepEnumType]?: number;\n };\n}\n\nexport interface TurnoverOverviewReducerState {\n sectionCounters: {\n [key: number]: PropertyTurnsCounter;\n };\n}\n\nexport const initialState: TurnoverOverviewReducerState = {\n sectionCounters: {},\n};\n\nexport const turnoverOverviewReducer = createReducer(\n initialState,\n on(setTurnoverOverviewSectionCounters, (state, action) => ({\n ...state,\n sectionCounters: { ...state.sectionCounters, [action.propertyId]: action },\n })),\n on(clearTurnoverOverviewCounters, (state, action) => ({\n ...state,\n sectionCounters: {},\n }))\n);\n","export enum DashboardMode {\n SUPER_USER = 'SUPER_USER',\n PROPERTY_MANAGER = 'PROPERTY_MANAGER',\n ASSET_MANAGER = 'ASSET_MANAGER',\n CONSTRUCTION_MANAGER = 'CONSTRUCTION_MANAGER',\n ADMINISTRATOR_LEVEL_ONE = 'ADMINISTRATOR_LEVEL_ONE',\n ADMINISTRATOR_LEVEL_TWO = 'ADMINISTRATOR_LEVEL_TWO',\n}\n","import { Injectable } from '@angular/core';\nimport { CanActivate, Router, UrlTree } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport { Observable, catchError, combineLatest } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\nimport { GuardService } from '@app/services/guard.service';\nimport { UserService } from '@app/services/user.service';\nimport { selectTenantData } from '@main-application/store/selectors/user.selectors';\nimport { AppRoutes } from '@shared/constants/app-routes.const';\nimport { AuthService } from '@shared/services/auth.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthGuard implements CanActivate {\n constructor(\n private authService: AuthService,\n private router: Router,\n private store: Store<{}>,\n private userService: UserService,\n private guardService: GuardService\n ) {}\n\n canActivate(): boolean | Observable {\n return combineLatest(\n this.userService.getCashedUserData(),\n this.store.select(selectTenantData),\n this.authService.isAuthenticated()\n )\n .pipe(\n filter(([userData, tenantData]) => !!userData && !!tenantData),\n map(([, , isAuthorized]) => {\n if (!isAuthorized) {\n const loginUrlTree = this.router.parseUrl(AppRoutes.LOGIN);\n loginUrlTree.queryParams['returnUrl'] = window.location.href;\n return loginUrlTree;\n }\n\n return isAuthorized;\n })\n )\n .pipe(catchError(err => this.guardService.handleGuardError(err)));\n }\n}\n","import { Injectable } from '@angular/core';\nimport { CanActivate, Router, UrlTree } from '@angular/router';\nimport { Observable, catchError } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\nimport { GuardService } from '@app/services/guard.service';\nimport { UserService } from '@app/services/user.service';\nimport { AppRoutes } from '@shared/constants/app-routes.const';\nimport { UserType } from '@shared/enums/user-type';\nimport { UserData } from '@shared/interfaces/user-data';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ResidentGuard implements CanActivate {\n constructor(private userService: UserService, private router: Router, private guardService: GuardService) {}\n\n canActivate(): Observable {\n return this.userService\n .getCashedUserData()\n .pipe(\n filter((userData: UserData) => !!userData),\n map((userData: UserData) => {\n if (userData.userType !== UserType.Resident) {\n return true;\n }\n return this.router.createUrlTree([AppRoutes.RESIDENT]);\n })\n )\n .pipe(catchError(err => this.guardService.handleGuardError(err)));\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PipesModule } from '@shared/pipes/pipes.module';\n\nimport { CustomizedSnackbarComponent } from './component/customized-snackbar.component';\nimport { IconComponent } from '../icon/icon.component';\n\n@NgModule({\n declarations: [CustomizedSnackbarComponent],\n imports: [CommonModule, MatButtonModule, IconComponent, MatIconModule, PipesModule],\n exports: [],\n})\nexport class CustomizedSnackbarModule {}\n","import { Injectable } from '@angular/core';\nimport { Observable, of } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { WorkflowStepEnumType } from '@shared/enums/workflow-step.enum';\nimport { BillingReportFilter, BillingReportItem } from '@shared/interfaces/billing.interface';\nimport { PmsSyncConfigurationModel } from '@shared/interfaces/pms-credential-model.interface';\nimport { UserToGeneralRoleModel } from '@shared/interfaces/user-to-general-role-model';\nimport { UserToPropertyMapping } from '@shared/interfaces/user-to-property-mapping';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AdminPanelService {\n constructor(private restApiService: RestapiService) {}\n\n setUserToGeneralRole(usersToGeneralRoleList: UserToGeneralRoleModel[]): Observable {\n return this.restApiService.create(`AdminPanel/UserToGeneralRole`, usersToGeneralRoleList);\n }\n\n setUserToPropertyRole(userToPropertyRoleList: UserToPropertyMapping[]): Observable {\n if (!userToPropertyRoleList?.length) {\n return of(false);\n }\n\n return this.restApiService.create(`AdminPanel/UserToPropertyRole`, userToPropertyRoleList);\n }\n\n removeUserFromPropertyRole(propertyId: number[]): Observable {\n if (!propertyId?.length) {\n return of(false);\n }\n\n return this.restApiService.create(`AdminPanel/UserToPropertyRole/remove`, propertyId);\n }\n\n billingReport(filter: BillingReportFilter): Observable {\n return this.restApiService.getData(\n `AdminPanel/BillingReport?startDate=${filter.startDate.toISOString()}&endDate=${filter.endDate.toISOString()}`\n );\n }\n\n runImporterNow(): Observable {\n return this.restApiService.getData(`AdminPanel/runImporterNow`);\n }\n\n testUrl(url: string): Observable {\n return this.restApiService.getData(`AdminPanel/testApiUrl?url=${url}`);\n }\n\n editWorkflowStepTemplate(stepEnumType: WorkflowStepEnumType, stepName: string): Observable {\n return this.restApiService.create('AdminPanel/editWorkflowStepTemplate', {\n stepEnumType,\n stepName,\n });\n }\n\n updatePmsConfiguration(config: PmsSyncConfigurationModel): Observable {\n return this.restApiService.create('AdminPanel/pmsSyncConfiguration', config);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { AuditableEntityType } from '@shared/enums/auditable-entity-type';\nimport { RestAuditModel } from '@shared/interfaces/audit.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuditService {\n constructor(private restApiService: RestapiService) {}\n\n getChangesHistory(objectId: number, objectType: AuditableEntityType): Observable {\n return this.restApiService.getData(`Audit/${objectId}/${objectType}`);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RestAddressModel } from '@shared/interfaces/address.interface';\nimport { PostCompanyAddressModel, RestCompanyModel, UpdateEmployeeItem } from '@shared/interfaces/companies.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CompaniesService {\n constructor(private restApiService: RestapiService) {}\n\n getCompanyList(): Observable {\n return this.restApiService.getData(`Companies`);\n }\n\n getCompany(companyId: number): Observable {\n return this.restApiService.getData(`Companies/${companyId}`);\n }\n\n addNewCompany(companyModel: RestCompanyModel): Observable {\n return this.restApiService.create('Companies', companyModel);\n }\n\n updateCompany(companyModel: RestCompanyModel): Observable {\n return this.restApiService.update(`Companies/${companyModel.id}`, companyModel);\n }\n\n deleteCompany(companyId: number): Observable {\n return this.restApiService.delete(`Companies/${companyId}`);\n }\n\n addEmployeeToCompany(updateEmployeeItem: UpdateEmployeeItem): Observable {\n return this.restApiService.associate(\n `Companies/${updateEmployeeItem.companyId}/assignEmployees`,\n updateEmployeeItem.userIds\n );\n }\n\n deleteEmployeeFromCompany(updateEmployeeItem: UpdateEmployeeItem): Observable {\n return this.restApiService.associate(\n `Companies/${updateEmployeeItem.companyId}/removeEmployees`,\n updateEmployeeItem.userIds\n );\n }\n\n addAddressToCompany(postCompanyAddressModel: PostCompanyAddressModel): Observable {\n return this.restApiService.create(\n `Companies/${postCompanyAddressModel.companyId}/Addresses`,\n postCompanyAddressModel\n );\n }\n\n updateAddressInCompany(restAddressModel: RestAddressModel, companyId: number): Observable {\n return this.restApiService.update(`Companies/${companyId}/Addresses/${restAddressModel.id}`, restAddressModel);\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { of, throwError } from 'rxjs';\n\nimport { OidcStorageService } from '@app/services/oidc-storage.service';\nimport { AppRoutes } from '@shared/constants/app-routes.const';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GuardService {\n constructor(private router: Router, private oidcStorageService: OidcStorageService) {}\n\n handleGuardError(err: HttpErrorResponse) {\n const url = new URL(window.location.href);\n if (url.searchParams.has('revoke-token')) {\n this.oidcStorageService.clear();\n const url = new URL(window.location.href);\n url.searchParams.delete('revoke-token');\n return of(\n this.router.createUrlTree([AppRoutes.EXTERNAL], {\n queryParams: {\n targetUri: url.toString(),\n },\n })\n );\n } else {\n if (err.status === 400) {\n const { error } = err.error;\n if (error?.code === 69 && error?.appUrl) {\n const url = new URL(error.appUrl);\n url.searchParams.append('revoke-token', '1');\n return of(\n this.router.createUrlTree([AppRoutes.EXTERNAL], {\n queryParams: {\n targetUri: url.toString(),\n },\n })\n );\n }\n }\n }\n return throwError(() => err);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { RestPortfolioModel } from '@shared/interfaces/rest-portfolio-model.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PortfolioService {\n private portfolioIdSource = new BehaviorSubject(null);\n portfolioId$ = this.portfolioIdSource.asObservable();\n\n private switchMessageSource = new BehaviorSubject<{\n reportName: string;\n prevPortfolioId: number;\n newPortfolioId: number;\n } | null>(null);\n switchMessage$ = this.switchMessageSource.asObservable();\n\n constructor(private restApiService: RestapiService) {}\n\n update(portfolioDetails: RestPortfolioModel): Observable {\n return this.restApiService.update(`portfolio/${portfolioDetails.id}`, portfolioDetails);\n }\n\n setPortfolioId(portfolioId: number) {\n this.portfolioIdSource.next(portfolioId);\n this.portfolioIdSource.next(null);\n }\n\n setPortfolioSwitchMessage(reportName: string, prevPortfolioId: number, newPortfolioId: number) {\n const message = { reportName, prevPortfolioId, newPortfolioId };\n this.switchMessageSource.next(message);\n return message;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { WorkflowStepEnumType } from '@shared/enums/workflow-step.enum';\nimport {\n RestPropertyManagerAccessModel,\n RestPropertyModel,\n RestPropertyTurnsWithoutAssignees,\n UpdatePropertyManagerModel,\n} from '@shared/interfaces/rest-portfolio-model.interface';\nimport { PreleaseFilterMode } from '@shared/interfaces/turnover.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PropertiesService {\n constructor(private restApiService: RestapiService) {}\n\n update(propertyDetails: RestPropertyModel): Observable {\n return this.restApiService.update(`Properties/${propertyDetails.id}`, propertyDetails);\n }\n\n getAllUserProperties(): Observable {\n return this.restApiService.getData(`properties`);\n }\n\n getAllUserUnassignedProperties(): Observable {\n return this.restApiService.getData(`properties/unassigned`);\n }\n\n getPropertyManagers(): Observable {\n return this.restApiService.getData(`Properties/PropertyManagers`);\n }\n\n getPropertyManagersForProperty(propertyId: number): Observable {\n return this.restApiService.getData(`Properties/${propertyId}/PropertyManagers`);\n }\n\n removePropertyManagers(propertyManagerModels: UpdatePropertyManagerModel[]): Observable {\n return this.restApiService.update(`Properties/RemovePropertyManagers`, propertyManagerModels);\n }\n\n setPropertyManagers(propertyManagerModels: UpdatePropertyManagerModel[]): Observable {\n return this.restApiService.update(`Properties/SetPropertyManagers`, propertyManagerModels);\n }\n\n setPropertyPreleaseFilter(propertyId: number, preleaseFilterMode: PreleaseFilterMode): Observable {\n return this.restApiService.create(`Properties/${propertyId}/SetPreleaseMode`, preleaseFilterMode);\n }\n\n addPropertyToPortfolio(portfolioId: number, propertyName: string): Observable {\n return this.restApiService.create(`Properties`, {\n portfolioId,\n name: propertyName,\n });\n }\n\n getTurnsWithoutAssignees(\n propertyId: number,\n step: WorkflowStepEnumType\n ): Observable {\n return this.restApiService.getData(\n `Properties/turnsWithoutAssignee/${propertyId}/${step}`\n );\n }\n\n getTurnsWithoutPortfolioAssignees(\n portfolioId: number,\n step: WorkflowStepEnumType\n ): Observable {\n return this.restApiService.getData(\n `Portfolio/turnsWithoutAssignee/${portfolioId}/${step}`\n );\n }\n\n deletePropertyManagers(propertyManagers: { propertyId: number; userId: number }[]) {\n return this.restApiService.update(\n `Properties/RemovePropertyManagers`,\n propertyManagers\n );\n }\n\n updatePropertyManagers(propertyManagers: { propertyId: number; userId: number }[]) {\n return this.restApiService.update(\n `Properties/SetPropertyManagers`,\n propertyManagers\n );\n }\n\n updateProperty(property: RestPropertyModel): Observable {\n return this.restApiService.update(`Properties/${property.id}`, property);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { SnackbarService } from '@ui-components/components/customized-snackbar/snackbar.service';\n\ntype ScreenWiperStatuses = 'start' | 'end' | '';\n\n@Injectable()\nexport class ScreenWiperService {\n private screenWipeState = 0;\n private screenClasses = new BehaviorSubject(`screen-wiper state-${this.screenWipeState}`);\n public screenClasses$ = this.screenClasses.asObservable();\n\n private globalWiperVisible = new BehaviorSubject(false);\n public globalWiperVisible$ = this.globalWiperVisible.asObservable();\n\n public readonly wipeDuration = 5000;\n\n constructor(private snackbarService: SnackbarService) {}\n\n next(globalWiper = false) {\n this.globalWiperVisible.next(globalWiper);\n if (globalWiper) {\n setTimeout(() => this.runWiper(globalWiper), 100);\n } else {\n this.runWiper(globalWiper);\n }\n }\n\n private runWiper(globalWiper: boolean) {\n this.screenWipeState = (this.screenWipeState + 1) % 3;\n this.setClasses('start');\n setTimeout(() => {\n if (globalWiper) {\n this.snackbarService.info(\"Preventing monitor burn-in. You're welcome. 😰\", this.wipeDuration);\n }\n this.setClasses('end');\n setTimeout(() => {\n this.setClasses('');\n }, this.wipeDuration);\n }, 10);\n }\n\n private setClasses(status: ScreenWiperStatuses) {\n this.screenClasses.next(`screen-wiper state-${this.screenWipeState} ${status}`);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { PmsCredentialModel } from '@shared/interfaces/pms-credential-model.interface';\nimport { RestChatHooksChannel } from '@shared/interfaces/rest-chat-hooks-channel';\nimport { RestTimerReport } from '@shared/interfaces/rest-timer-report';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SystemConfigService {\n constructor(private restApiService: RestapiService) {}\n\n getSystemConfig(): Observable {\n return this.restApiService.getData('AdminPanel/ApiCredentials');\n }\n\n getChatHooksChannels(): Observable {\n return this.restApiService.getData('slack/channels');\n }\n\n getTimerReport(): Observable {\n return this.restApiService.getData('Turnovers/mismatchissues');\n }\n\n setPropertyChatChannel(propertyId: number, channelIds: string[]): Observable<{}> {\n return this.restApiService.update<{}>(`properties/${propertyId}/UpdateSlackChannelId`, {\n channelIds,\n });\n }\n\n addSystemConfig(pmsCredential: PmsCredentialModel): Observable {\n return this.restApiService.create('AdminPanel/ApiCredentials', pmsCredential);\n }\n\n deleteSystemConfig(id: number): Observable {\n return this.restApiService.delete('AdminPanel/ApiCredentials/' + id);\n }\n\n updateSystemConfig(pmsCredential: PmsCredentialModel): Observable {\n return this.restApiService.associate('AdminPanel/ApiCredentials', pmsCredential);\n }\n\n buildiumTokenExchange(jwtToken: string): Observable {\n return this.restApiService.associate('AdminPanel/buildiumTokenExchange', { jwtToken });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport {\n AddUpdateTurnoverBid,\n RestTurnoverBid,\n RestTurnoverBidCategory,\n} from '@shared/interfaces/turnover-bids.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TurnoverBidsService {\n constructor(private restApiService: RestapiService) {}\n\n list(turnoverId: number): Observable {\n return this.restApiService.getData(`turnover/${turnoverId}/bids`);\n }\n\n add(model: AddUpdateTurnoverBid): Observable {\n return this.restApiService.create(`turnover/${model.turnoverId}/bids`, model);\n }\n\n update(model: AddUpdateTurnoverBid): Observable<{}> {\n return this.restApiService.update(`turnover/${model.turnoverId}/bids`, model);\n }\n\n delete(bidId: number): Observable<{}> {\n return this.restApiService.delete(`turnover/bids/${bidId}`);\n }\n\n accept(bidId: number): Observable<{}> {\n return this.restApiService.create(`turnover/bids/${bidId}/accept`, {});\n }\n\n reject(bidId: number, reason: string): Observable<{}> {\n return this.restApiService.create(`turnover/bids/${bidId}/reject`, { reason });\n }\n\n approve(bidId: number, approved: boolean | null, denyReason?: string): Observable<{}> {\n return this.restApiService.create(`turnover/bids/${bidId}/approve`, { approved, denyReason });\n }\n\n uploadInvoice(bidId: number, fileUploadId: number): Observable<{}> {\n return this.restApiService.create(`turnover/bids/${bidId}/uploadInvoice`, {\n fileUploadId,\n });\n }\n\n categoryList(): Observable {\n return this.restApiService.getData(`expenseCategory`);\n }\n\n addCategory(name: string): Observable {\n return this.restApiService.create(`expenseCategory`, {\n name,\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\n\nimport { RestapiService } from '@app/services/restapi.service';\nimport { TenantSettingsModel } from '@main-application/management/pages/turnover-configuration/components/turnover-configuration-elapsed-days-section/models/config.models';\nimport { WorkflowStepEnumType } from '@shared/enums/workflow-step.enum';\nimport { RestThresholdsConfiguration } from '@shared/interfaces/thresholds-configuration.interface';\nimport { TurnoverConfigSection } from '@shared/interfaces/turnover-config.interface';\nimport { AuthService } from '@shared/services/auth.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TurnoverConfigService {\n constructor(private restApiService: RestapiService, private authService: AuthService) {}\n\n getTurnoverConfigList(): Observable {\n return this.restApiService.getData('AdminPanel/turnoverConfiguration');\n }\n\n getTurnoverConfigListByWorkflowType(id: WorkflowStepEnumType): Observable {\n return this.restApiService.getData(`AdminPanel/turnoverConfiguration/${id}`);\n }\n\n updateTurnoverFieldConfiguration(turnoverConfig: TurnoverConfigSection): Observable {\n return this.restApiService.update(`AdminPanel/turnoverConfiguration`, turnoverConfig);\n }\n\n getElapsedDaysThresholds(): Observable {\n return this.restApiService.getData('AdminPanel/ElapsedDaysThresholds');\n }\n\n getTenantSettings(): Observable {\n return this.restApiService.getData('adminPanel/tenantSettings');\n }\n\n getTenantBrandingPreview(): Observable {\n return this.authService.getAccessToken().pipe(\n switchMap(token => {\n return this.restApiService.getData(\n `inspections/printAutoScopeTemplate?access_token=${token}`,\n null,\n 'html'\n );\n })\n );\n }\n\n saveTenantSettings(\n tenantSettings: Partial<\n Pick<\n TenantSettingsModel,\n | 'disableAllEscalationNotices'\n | 'pmsImportNonRevenueUnits'\n | 'escalationEmailsEnabledForProperties'\n | 'autoMoveToMakeReady'\n | 'autoMoveToReadyStatusWhenPmsIsReady'\n | 'doNotEmailWhenAssigneeChanges'\n | 'doNotEmailWhenAssigneeChangesPortfolioIds'\n | 'writeMakeReadyStatus'\n | 'writeAvailableDate'\n | 'writeAvailableDatePropertyIds'\n | 'writeMakeReadyStatusPropertyIds'\n | 'autoScopeBranding'\n | 'syncInspectionWithPMS'\n | 'readAndWriteAvailableDateToPuFromPMS'\n | 'readAndWriteAvailableDateToPuFromPMSPropertyIds'\n >\n >\n ): Observable {\n return this.restApiService.post('adminPanel/tenantSettings', tenantSettings);\n }\n\n getFinishTypes(): Observable {\n return this.restApiService.getData('AdminPanel/FinishTypes');\n }\n\n addFinishType(body): Observable {\n return this.restApiService.create('AdminPanel/FinishTypes/Add', body);\n }\n\n updateFinishType(body: any): Observable {\n return this.restApiService.customPatchData('AdminPanel/FinishTypes/Update', body);\n }\n\n deleteFinishType(id: number): Observable {\n return this.restApiService.delete(`AdminPanel/FinishTypes/Delete/${id}`);\n }\n\n updateElapsedDaysThresholds(\n thresholdsConfiguration: RestThresholdsConfiguration\n ): Observable {\n return this.restApiService.associate('AdminPanel/ElapsedDaysThresholds', thresholdsConfiguration);\n }\n}\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n/** @private */\r\nexport class DefaultReconnectPolicy {\r\n constructor(retryDelays) {\r\n this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n nextRetryDelayInMilliseconds(retryContext) {\r\n return this._retryDelays[retryContext.previousRetryCount];\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n/** Error thrown when an HTTP request fails. */\r\nexport class HttpError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n * @param {number} statusCode The HTTP status code represented by this error.\r\n */\r\n constructor(errorMessage, statusCode) {\r\n const trueProto = new.target.prototype;\r\n super(`${errorMessage}: Status code '${statusCode}'`);\r\n this.statusCode = statusCode;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when a timeout elapses. */\r\nexport class TimeoutError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage = \"A timeout occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when an action is aborted. */\r\nexport class AbortError extends Error {\r\n /** Constructs a new instance of {@link AbortError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage = \"An abort occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when the selected transport is unsupported by the browser. */\r\n/** @private */\r\nexport class UnsupportedTransportError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on.\r\n */\r\n constructor(message, transport) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'UnsupportedTransportError';\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when the selected transport is disabled by the browser. */\r\n/** @private */\r\nexport class DisabledTransportError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on.\r\n */\r\n constructor(message, transport) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'DisabledTransportError';\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when the selected transport cannot be started. */\r\n/** @private */\r\nexport class FailedToStartTransportError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on.\r\n */\r\n constructor(message, transport) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'FailedToStartTransportError';\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when the negotiation with the server failed to complete. */\r\n/** @private */\r\nexport class FailedToNegotiateWithServerError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n */\r\n constructor(message) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.errorType = 'FailedToNegotiateWithServerError';\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when multiple errors have occured. */\r\n/** @private */\r\nexport class AggregateErrors extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {Error[]} innerErrors The collection of errors this error is aggregating.\r\n */\r\n constructor(message, innerErrors) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.innerErrors = innerErrors;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n/** Represents an HTTP response. */\r\nexport class HttpResponse {\r\n constructor(statusCode, statusText, content) {\r\n this.statusCode = statusCode;\r\n this.statusText = statusText;\r\n this.content = content;\r\n }\r\n}\r\n/** Abstraction over an HTTP client.\r\n *\r\n * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r\n */\r\nexport class HttpClient {\r\n get(url, options) {\r\n return this.send({\r\n ...options,\r\n method: \"GET\",\r\n url,\r\n });\r\n }\r\n post(url, options) {\r\n return this.send({\r\n ...options,\r\n method: \"POST\",\r\n url,\r\n });\r\n }\r\n delete(url, options) {\r\n return this.send({\r\n ...options,\r\n method: \"DELETE\",\r\n url,\r\n });\r\n }\r\n /** Gets all cookies that apply to the specified URL.\r\n *\r\n * @param url The URL that the cookies are valid for.\r\n * @returns {string} A string containing all the key-value cookie pairs for the specified URL.\r\n */\r\n // @ts-ignore\r\n getCookieString(url) {\r\n return \"\";\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n/** A logger that does nothing when log messages are sent to it. */\r\nexport class NullLogger {\r\n constructor() { }\r\n /** @inheritDoc */\r\n // eslint-disable-next-line\r\n log(_logLevel, _message) {\r\n }\r\n}\r\n/** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r\nNullLogger.instance = new NullLogger();\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { NullLogger } from \"./Loggers\";\r\n// Version token that will be replaced by the prepack command\r\n/** The version of the SignalR client. */\r\nexport const VERSION = \"6.0.11\";\r\n/** @private */\r\nexport class Arg {\r\n static isRequired(val, name) {\r\n if (val === null || val === undefined) {\r\n throw new Error(`The '${name}' argument is required.`);\r\n }\r\n }\r\n static isNotEmpty(val, name) {\r\n if (!val || val.match(/^\\s*$/)) {\r\n throw new Error(`The '${name}' argument should not be empty.`);\r\n }\r\n }\r\n static isIn(val, values, name) {\r\n // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.\r\n if (!(val in values)) {\r\n throw new Error(`Unknown ${name} value: ${val}.`);\r\n }\r\n }\r\n}\r\n/** @private */\r\nexport class Platform {\r\n // react-native has a window but no document so we should check both\r\n static get isBrowser() {\r\n return typeof window === \"object\" && typeof window.document === \"object\";\r\n }\r\n // WebWorkers don't have a window object so the isBrowser check would fail\r\n static get isWebWorker() {\r\n return typeof self === \"object\" && \"importScripts\" in self;\r\n }\r\n // react-native has a window but no document\r\n static get isReactNative() {\r\n return typeof window === \"object\" && typeof window.document === \"undefined\";\r\n }\r\n // Node apps shouldn't have a window object, but WebWorkers don't either\r\n // so we need to check for both WebWorker and window\r\n static get isNode() {\r\n return !this.isBrowser && !this.isWebWorker && !this.isReactNative;\r\n }\r\n}\r\n/** @private */\r\nexport function getDataDetail(data, includeContent) {\r\n let detail = \"\";\r\n if (isArrayBuffer(data)) {\r\n detail = `Binary data of length ${data.byteLength}`;\r\n if (includeContent) {\r\n detail += `. Content: '${formatArrayBuffer(data)}'`;\r\n }\r\n }\r\n else if (typeof data === \"string\") {\r\n detail = `String data of length ${data.length}`;\r\n if (includeContent) {\r\n detail += `. Content: '${data}'`;\r\n }\r\n }\r\n return detail;\r\n}\r\n/** @private */\r\nexport function formatArrayBuffer(data) {\r\n const view = new Uint8Array(data);\r\n // Uint8Array.map only supports returning another Uint8Array?\r\n let str = \"\";\r\n view.forEach((num) => {\r\n const pad = num < 16 ? \"0\" : \"\";\r\n str += `0x${pad}${num.toString(16)} `;\r\n });\r\n // Trim of trailing space.\r\n return str.substr(0, str.length - 1);\r\n}\r\n// Also in signalr-protocol-msgpack/Utils.ts\r\n/** @private */\r\nexport function isArrayBuffer(val) {\r\n return val && typeof ArrayBuffer !== \"undefined\" &&\r\n (val instanceof ArrayBuffer ||\r\n // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof\r\n (val.constructor && val.constructor.name === \"ArrayBuffer\"));\r\n}\r\n/** @private */\r\nexport async function sendMessage(logger, transportName, httpClient, url, accessTokenFactory, content, options) {\r\n let headers = {};\r\n if (accessTokenFactory) {\r\n const token = await accessTokenFactory();\r\n if (token) {\r\n headers = {\r\n [\"Authorization\"]: `Bearer ${token}`,\r\n };\r\n }\r\n }\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n logger.log(LogLevel.Trace, `(${transportName} transport) sending data. ${getDataDetail(content, options.logMessageContent)}.`);\r\n const responseType = isArrayBuffer(content) ? \"arraybuffer\" : \"text\";\r\n const response = await httpClient.post(url, {\r\n content,\r\n headers: { ...headers, ...options.headers },\r\n responseType,\r\n timeout: options.timeout,\r\n withCredentials: options.withCredentials,\r\n });\r\n logger.log(LogLevel.Trace, `(${transportName} transport) request complete. Response status: ${response.statusCode}.`);\r\n}\r\n/** @private */\r\nexport function createLogger(logger) {\r\n if (logger === undefined) {\r\n return new ConsoleLogger(LogLevel.Information);\r\n }\r\n if (logger === null) {\r\n return NullLogger.instance;\r\n }\r\n if (logger.log !== undefined) {\r\n return logger;\r\n }\r\n return new ConsoleLogger(logger);\r\n}\r\n/** @private */\r\nexport class SubjectSubscription {\r\n constructor(subject, observer) {\r\n this._subject = subject;\r\n this._observer = observer;\r\n }\r\n dispose() {\r\n const index = this._subject.observers.indexOf(this._observer);\r\n if (index > -1) {\r\n this._subject.observers.splice(index, 1);\r\n }\r\n if (this._subject.observers.length === 0 && this._subject.cancelCallback) {\r\n this._subject.cancelCallback().catch((_) => { });\r\n }\r\n }\r\n}\r\n/** @private */\r\nexport class ConsoleLogger {\r\n constructor(minimumLogLevel) {\r\n this._minLevel = minimumLogLevel;\r\n this.out = console;\r\n }\r\n log(logLevel, message) {\r\n if (logLevel >= this._minLevel) {\r\n const msg = `[${new Date().toISOString()}] ${LogLevel[logLevel]}: ${message}`;\r\n switch (logLevel) {\r\n case LogLevel.Critical:\r\n case LogLevel.Error:\r\n this.out.error(msg);\r\n break;\r\n case LogLevel.Warning:\r\n this.out.warn(msg);\r\n break;\r\n case LogLevel.Information:\r\n this.out.info(msg);\r\n break;\r\n default:\r\n // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug\r\n this.out.log(msg);\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/** @private */\r\nexport function getUserAgentHeader() {\r\n let userAgentHeaderName = \"X-SignalR-User-Agent\";\r\n if (Platform.isNode) {\r\n userAgentHeaderName = \"User-Agent\";\r\n }\r\n return [userAgentHeaderName, constructUserAgent(VERSION, getOsName(), getRuntime(), getRuntimeVersion())];\r\n}\r\n/** @private */\r\nexport function constructUserAgent(version, os, runtime, runtimeVersion) {\r\n // Microsoft SignalR/[Version] ([Detailed Version]; [Operating System]; [Runtime]; [Runtime Version])\r\n let userAgent = \"Microsoft SignalR/\";\r\n const majorAndMinor = version.split(\".\");\r\n userAgent += `${majorAndMinor[0]}.${majorAndMinor[1]}`;\r\n userAgent += ` (${version}; `;\r\n if (os && os !== \"\") {\r\n userAgent += `${os}; `;\r\n }\r\n else {\r\n userAgent += \"Unknown OS; \";\r\n }\r\n userAgent += `${runtime}`;\r\n if (runtimeVersion) {\r\n userAgent += `; ${runtimeVersion}`;\r\n }\r\n else {\r\n userAgent += \"; Unknown Runtime Version\";\r\n }\r\n userAgent += \")\";\r\n return userAgent;\r\n}\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getOsName() {\r\n if (Platform.isNode) {\r\n switch (process.platform) {\r\n case \"win32\":\r\n return \"Windows NT\";\r\n case \"darwin\":\r\n return \"macOS\";\r\n case \"linux\":\r\n return \"Linux\";\r\n default:\r\n return process.platform;\r\n }\r\n }\r\n else {\r\n return \"\";\r\n }\r\n}\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getRuntimeVersion() {\r\n if (Platform.isNode) {\r\n return process.versions.node;\r\n }\r\n return undefined;\r\n}\r\nfunction getRuntime() {\r\n if (Platform.isNode) {\r\n return \"NodeJS\";\r\n }\r\n else {\r\n return \"Browser\";\r\n }\r\n}\r\n/** @private */\r\nexport function getErrorString(e) {\r\n if (e.stack) {\r\n return e.stack;\r\n }\r\n else if (e.message) {\r\n return e.message;\r\n }\r\n return `${e}`;\r\n}\r\n/** @private */\r\nexport function getGlobalThis() {\r\n // globalThis is semi-new and not available in Node until v12\r\n if (typeof globalThis !== \"undefined\") {\r\n return globalThis;\r\n }\r\n if (typeof self !== \"undefined\") {\r\n return self;\r\n }\r\n if (typeof window !== \"undefined\") {\r\n return window;\r\n }\r\n if (typeof global !== \"undefined\") {\r\n return global;\r\n }\r\n throw new Error(\"could not find global\");\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpResponse } from \"./HttpClient\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { Platform, getGlobalThis } from \"./Utils\";\r\nexport class FetchHttpClient extends HttpClient {\r\n constructor(logger) {\r\n super();\r\n this._logger = logger;\r\n if (typeof fetch === \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests\r\n this._jar = new (requireFunc(\"tough-cookie\")).CookieJar();\r\n this._fetchType = requireFunc(\"node-fetch\");\r\n // node-fetch doesn't have a nice API for getting and setting cookies\r\n // fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one\r\n this._fetchType = requireFunc(\"fetch-cookie\")(this._fetchType, this._jar);\r\n }\r\n else {\r\n this._fetchType = fetch.bind(getGlobalThis());\r\n }\r\n if (typeof AbortController === \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide\r\n this._abortControllerType = requireFunc(\"abort-controller\");\r\n }\r\n else {\r\n this._abortControllerType = AbortController;\r\n }\r\n }\r\n /** @inheritDoc */\r\n async send(request) {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n throw new AbortError();\r\n }\r\n if (!request.method) {\r\n throw new Error(\"No method defined.\");\r\n }\r\n if (!request.url) {\r\n throw new Error(\"No url defined.\");\r\n }\r\n const abortController = new this._abortControllerType();\r\n let error;\r\n // Hook our abortSignal into the abort controller\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n abortController.abort();\r\n error = new AbortError();\r\n };\r\n }\r\n // If a timeout has been passed in, setup a timeout to call abort\r\n // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout\r\n let timeoutId = null;\r\n if (request.timeout) {\r\n const msTimeout = request.timeout;\r\n timeoutId = setTimeout(() => {\r\n abortController.abort();\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n error = new TimeoutError();\r\n }, msTimeout);\r\n }\r\n let response;\r\n try {\r\n response = await this._fetchType(request.url, {\r\n body: request.content,\r\n cache: \"no-cache\",\r\n credentials: request.withCredentials === true ? \"include\" : \"same-origin\",\r\n headers: {\r\n \"Content-Type\": \"text/plain;charset=UTF-8\",\r\n \"X-Requested-With\": \"XMLHttpRequest\",\r\n ...request.headers,\r\n },\r\n method: request.method,\r\n mode: \"cors\",\r\n redirect: \"follow\",\r\n signal: abortController.signal,\r\n });\r\n }\r\n catch (e) {\r\n if (error) {\r\n throw error;\r\n }\r\n this._logger.log(LogLevel.Warning, `Error from HTTP request. ${e}.`);\r\n throw e;\r\n }\r\n finally {\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n }\r\n if (!response.ok) {\r\n const errorMessage = await deserializeContent(response, \"text\");\r\n throw new HttpError(errorMessage || response.statusText, response.status);\r\n }\r\n const content = deserializeContent(response, request.responseType);\r\n const payload = await content;\r\n return new HttpResponse(response.status, response.statusText, payload);\r\n }\r\n getCookieString(url) {\r\n let cookies = \"\";\r\n if (Platform.isNode && this._jar) {\r\n // @ts-ignore: unused variable\r\n this._jar.getCookies(url, (e, c) => cookies = c.join(\"; \"));\r\n }\r\n return cookies;\r\n }\r\n}\r\nfunction deserializeContent(response, responseType) {\r\n let content;\r\n switch (responseType) {\r\n case \"arraybuffer\":\r\n content = response.arrayBuffer();\r\n break;\r\n case \"text\":\r\n content = response.text();\r\n break;\r\n case \"blob\":\r\n case \"document\":\r\n case \"json\":\r\n throw new Error(`${responseType} is not supported.`);\r\n default:\r\n content = response.text();\r\n break;\r\n }\r\n return content;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpResponse } from \"./HttpClient\";\r\nimport { LogLevel } from \"./ILogger\";\r\nexport class XhrHttpClient extends HttpClient {\r\n constructor(logger) {\r\n super();\r\n this._logger = logger;\r\n }\r\n /** @inheritDoc */\r\n send(request) {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(request.method, request.url, true);\r\n xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;\r\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n xhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\r\n const headers = request.headers;\r\n if (headers) {\r\n Object.keys(headers)\r\n .forEach((header) => {\r\n xhr.setRequestHeader(header, headers[header]);\r\n });\r\n }\r\n if (request.responseType) {\r\n xhr.responseType = request.responseType;\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n xhr.abort();\r\n reject(new AbortError());\r\n };\r\n }\r\n if (request.timeout) {\r\n xhr.timeout = request.timeout;\r\n }\r\n xhr.onload = () => {\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));\r\n }\r\n else {\r\n reject(new HttpError(xhr.response || xhr.responseText || xhr.statusText, xhr.status));\r\n }\r\n };\r\n xhr.onerror = () => {\r\n this._logger.log(LogLevel.Warning, `Error from HTTP request. ${xhr.status}: ${xhr.statusText}.`);\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n };\r\n xhr.ontimeout = () => {\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n reject(new TimeoutError());\r\n };\r\n xhr.send(request.content || \"\");\r\n });\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AbortError } from \"./Errors\";\r\nimport { FetchHttpClient } from \"./FetchHttpClient\";\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { Platform } from \"./Utils\";\r\nimport { XhrHttpClient } from \"./XhrHttpClient\";\r\n/** Default implementation of {@link @microsoft/signalr.HttpClient}. */\r\nexport class DefaultHttpClient extends HttpClient {\r\n /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */\r\n constructor(logger) {\r\n super();\r\n if (typeof fetch !== \"undefined\" || Platform.isNode) {\r\n this._httpClient = new FetchHttpClient(logger);\r\n }\r\n else if (typeof XMLHttpRequest !== \"undefined\") {\r\n this._httpClient = new XhrHttpClient(logger);\r\n }\r\n else {\r\n throw new Error(\"No usable HttpClient found.\");\r\n }\r\n }\r\n /** @inheritDoc */\r\n send(request) {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n return this._httpClient.send(request);\r\n }\r\n getCookieString(url) {\r\n return this._httpClient.getCookieString(url);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nexport class HeaderNames {\r\n}\r\nHeaderNames.Authorization = \"Authorization\";\r\nHeaderNames.Cookie = \"Cookie\";\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n// Not exported from index.\r\n/** @private */\r\nexport class AbortController {\r\n constructor() {\r\n this._isAborted = false;\r\n this.onabort = null;\r\n }\r\n abort() {\r\n if (!this._isAborted) {\r\n this._isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n }\r\n get signal() {\r\n return this;\r\n }\r\n get aborted() {\r\n return this._isAborted;\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AbortController } from \"./AbortController\";\r\nimport { HttpError, TimeoutError } from \"./Errors\";\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, sendMessage } from \"./Utils\";\r\n// Not exported from 'index', this type is internal.\r\n/** @private */\r\nexport class LongPollingTransport {\r\n constructor(httpClient, accessTokenFactory, logger, options) {\r\n this._httpClient = httpClient;\r\n this._accessTokenFactory = accessTokenFactory;\r\n this._logger = logger;\r\n this._pollAbort = new AbortController();\r\n this._options = options;\r\n this._running = false;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n // This is an internal type, not exported from 'index' so this is really just internal.\r\n get pollAborted() {\r\n return this._pollAbort.aborted;\r\n }\r\n async connect(url, transferFormat) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._url = url;\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Connecting.\");\r\n // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property)\r\n if (transferFormat === TransferFormat.Binary &&\r\n (typeof XMLHttpRequest !== \"undefined\" && typeof new XMLHttpRequest().responseType !== \"string\")) {\r\n throw new Error(\"Binary protocols over XmlHttpRequest not implementing advanced features are not supported.\");\r\n }\r\n const [name, value] = getUserAgentHeader();\r\n const headers = { [name]: value, ...this._options.headers };\r\n const pollOptions = {\r\n abortSignal: this._pollAbort.signal,\r\n headers,\r\n timeout: 100000,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n if (transferFormat === TransferFormat.Binary) {\r\n pollOptions.responseType = \"arraybuffer\";\r\n }\r\n const token = await this._getAccessToken();\r\n this._updateHeaderToken(pollOptions, token);\r\n // Make initial long polling request\r\n // Server uses first long polling request to finish initializing connection and it returns without data\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n // Mark running as false so that the poll immediately ends and runs the close logic\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n }\r\n else {\r\n this._running = true;\r\n }\r\n this._receiving = this._poll(this._url, pollOptions);\r\n }\r\n async _getAccessToken() {\r\n if (this._accessTokenFactory) {\r\n return await this._accessTokenFactory();\r\n }\r\n return null;\r\n }\r\n _updateHeaderToken(request, token) {\r\n if (!request.headers) {\r\n request.headers = {};\r\n }\r\n if (token) {\r\n request.headers[HeaderNames.Authorization] = `Bearer ${token}`;\r\n return;\r\n }\r\n if (request.headers[HeaderNames.Authorization]) {\r\n delete request.headers[HeaderNames.Authorization];\r\n }\r\n }\r\n async _poll(url, pollOptions) {\r\n try {\r\n while (this._running) {\r\n // We have to get the access token on each poll, in case it changes\r\n const token = await this._getAccessToken();\r\n this._updateHeaderToken(pollOptions, token);\r\n try {\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n if (response.statusCode === 204) {\r\n this._logger.log(LogLevel.Information, \"(LongPolling transport) Poll terminated by server.\");\r\n this._running = false;\r\n }\r\n else if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n // Unexpected status code\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n }\r\n else {\r\n // Process the response\r\n if (response.content) {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) data received. ${getDataDetail(response.content, this._options.logMessageContent)}.`);\r\n if (this.onreceive) {\r\n this.onreceive(response.content);\r\n }\r\n }\r\n else {\r\n // This is another way timeout manifest.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n }\r\n }\r\n catch (e) {\r\n if (!this._running) {\r\n // Log but disregard errors that occur after stopping\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Poll errored after shutdown: ${e.message}`);\r\n }\r\n else {\r\n if (e instanceof TimeoutError) {\r\n // Ignore timeouts and reissue the poll.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n else {\r\n // Close the connection with the error as the result.\r\n this._closeError = e;\r\n this._running = false;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Polling complete.\");\r\n // We will reach here with pollAborted==false when the server returned a response causing the transport to stop.\r\n // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent.\r\n if (!this.pollAborted) {\r\n this._raiseOnClose();\r\n }\r\n }\r\n }\r\n async send(data) {\r\n if (!this._running) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"LongPolling\", this._httpClient, this._url, this._accessTokenFactory, data, this._options);\r\n }\r\n async stop() {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stopping polling.\");\r\n // Tell receiving loop to stop, abort any current request, and then wait for it to finish\r\n this._running = false;\r\n this._pollAbort.abort();\r\n try {\r\n await this._receiving;\r\n // Send DELETE to clean up long polling on the server\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);\r\n const headers = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n const deleteOptions = {\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n const token = await this._getAccessToken();\r\n this._updateHeaderToken(deleteOptions, token);\r\n await this._httpClient.delete(this._url, deleteOptions);\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) DELETE request sent.\");\r\n }\r\n finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stop finished.\");\r\n // Raise close event here instead of in polling\r\n // It needs to happen after the DELETE request is sent\r\n this._raiseOnClose();\r\n }\r\n }\r\n _raiseOnClose() {\r\n if (this.onclose) {\r\n let logMessage = \"(LongPolling transport) Firing onclose event.\";\r\n if (this._closeError) {\r\n logMessage += \" Error: \" + this._closeError;\r\n }\r\n this._logger.log(LogLevel.Trace, logMessage);\r\n this.onclose(this._closeError);\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform, sendMessage } from \"./Utils\";\r\n/** @private */\r\nexport class ServerSentEventsTransport {\r\n constructor(httpClient, accessTokenFactory, logger, options) {\r\n this._httpClient = httpClient;\r\n this._accessTokenFactory = accessTokenFactory;\r\n this._logger = logger;\r\n this._options = options;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n async connect(url, transferFormat) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Trace, \"(SSE transport) Connecting.\");\r\n // set url before accessTokenFactory because this.url is only for send and we set the auth header instead of the query string for send\r\n this._url = url;\r\n if (this._accessTokenFactory) {\r\n const token = await this._accessTokenFactory();\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(token)}`;\r\n }\r\n }\r\n return new Promise((resolve, reject) => {\r\n let opened = false;\r\n if (transferFormat !== TransferFormat.Text) {\r\n reject(new Error(\"The Server-Sent Events transport only supports the 'Text' transfer format\"));\r\n return;\r\n }\r\n let eventSource;\r\n if (Platform.isBrowser || Platform.isWebWorker) {\r\n eventSource = new this._options.EventSource(url, { withCredentials: this._options.withCredentials });\r\n }\r\n else {\r\n // Non-browser passes cookies via the dictionary\r\n const cookies = this._httpClient.getCookieString(url);\r\n const headers = {};\r\n headers.Cookie = cookies;\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n eventSource = new this._options.EventSource(url, { withCredentials: this._options.withCredentials, headers: { ...headers, ...this._options.headers } });\r\n }\r\n try {\r\n eventSource.onmessage = (e) => {\r\n if (this.onreceive) {\r\n try {\r\n this._logger.log(LogLevel.Trace, `(SSE transport) data received. ${getDataDetail(e.data, this._options.logMessageContent)}.`);\r\n this.onreceive(e.data);\r\n }\r\n catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n // @ts-ignore: not using event on purpose\r\n eventSource.onerror = (e) => {\r\n // EventSource doesn't give any useful information about server side closes.\r\n if (opened) {\r\n this._close();\r\n }\r\n else {\r\n reject(new Error(\"EventSource failed to connect. The connection could not be found on the server,\"\r\n + \" either the connection ID is not present on the server, or a proxy is refusing/buffering the connection.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\"));\r\n }\r\n };\r\n eventSource.onopen = () => {\r\n this._logger.log(LogLevel.Information, `SSE connected to ${this._url}`);\r\n this._eventSource = eventSource;\r\n opened = true;\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(e);\r\n return;\r\n }\r\n });\r\n }\r\n async send(data) {\r\n if (!this._eventSource) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"SSE\", this._httpClient, this._url, this._accessTokenFactory, data, this._options);\r\n }\r\n stop() {\r\n this._close();\r\n return Promise.resolve();\r\n }\r\n _close(e) {\r\n if (this._eventSource) {\r\n this._eventSource.close();\r\n this._eventSource = undefined;\r\n if (this.onclose) {\r\n this.onclose(e);\r\n }\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform } from \"./Utils\";\r\n/** @private */\r\nexport class WebSocketTransport {\r\n constructor(httpClient, accessTokenFactory, logger, logMessageContent, webSocketConstructor, headers) {\r\n this._logger = logger;\r\n this._accessTokenFactory = accessTokenFactory;\r\n this._logMessageContent = logMessageContent;\r\n this._webSocketConstructor = webSocketConstructor;\r\n this._httpClient = httpClient;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n this._headers = headers;\r\n }\r\n async connect(url, transferFormat) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) Connecting.\");\r\n if (this._accessTokenFactory) {\r\n const token = await this._accessTokenFactory();\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(token)}`;\r\n }\r\n }\r\n return new Promise((resolve, reject) => {\r\n url = url.replace(/^http/, \"ws\");\r\n let webSocket;\r\n const cookies = this._httpClient.getCookieString(url);\r\n let opened = false;\r\n if (Platform.isNode) {\r\n const headers = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n if (cookies) {\r\n headers[HeaderNames.Cookie] = `${cookies}`;\r\n }\r\n // Only pass headers when in non-browser environments\r\n webSocket = new this._webSocketConstructor(url, undefined, {\r\n headers: { ...headers, ...this._headers },\r\n });\r\n }\r\n if (!webSocket) {\r\n // Chrome is not happy with passing 'undefined' as protocol\r\n webSocket = new this._webSocketConstructor(url);\r\n }\r\n if (transferFormat === TransferFormat.Binary) {\r\n webSocket.binaryType = \"arraybuffer\";\r\n }\r\n webSocket.onopen = (_event) => {\r\n this._logger.log(LogLevel.Information, `WebSocket connected to ${url}.`);\r\n this._webSocket = webSocket;\r\n opened = true;\r\n resolve();\r\n };\r\n webSocket.onerror = (event) => {\r\n let error = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n }\r\n else {\r\n error = \"There was an error with the transport\";\r\n }\r\n this._logger.log(LogLevel.Information, `(WebSockets transport) ${error}.`);\r\n };\r\n webSocket.onmessage = (message) => {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) data received. ${getDataDetail(message.data, this._logMessageContent)}.`);\r\n if (this.onreceive) {\r\n try {\r\n this.onreceive(message.data);\r\n }\r\n catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n webSocket.onclose = (event) => {\r\n // Don't call close handler if connection was never established\r\n // We'll reject the connect call instead\r\n if (opened) {\r\n this._close(event);\r\n }\r\n else {\r\n let error = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n }\r\n else {\r\n error = \"WebSocket failed to connect. The connection could not be found on the server,\"\r\n + \" either the endpoint may not be a SignalR endpoint,\"\r\n + \" the connection ID is not present on the server, or there is a proxy blocking WebSockets.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\";\r\n }\r\n reject(new Error(error));\r\n }\r\n };\r\n });\r\n }\r\n send(data) {\r\n if (this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN) {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) sending data. ${getDataDetail(data, this._logMessageContent)}.`);\r\n this._webSocket.send(data);\r\n return Promise.resolve();\r\n }\r\n return Promise.reject(\"WebSocket is not in the OPEN state\");\r\n }\r\n stop() {\r\n if (this._webSocket) {\r\n // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning\r\n // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects\r\n this._close(undefined);\r\n }\r\n return Promise.resolve();\r\n }\r\n _close(event) {\r\n // webSocket will be null if the transport did not start successfully\r\n if (this._webSocket) {\r\n // Clear websocket handlers because we are considering the socket closed now\r\n this._webSocket.onclose = () => { };\r\n this._webSocket.onmessage = () => { };\r\n this._webSocket.onerror = () => { };\r\n this._webSocket.close();\r\n this._webSocket = undefined;\r\n }\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) socket closed.\");\r\n if (this.onclose) {\r\n if (this._isCloseEvent(event) && (event.wasClean === false || event.code !== 1000)) {\r\n this.onclose(new Error(`WebSocket closed with status code: ${event.code} (${event.reason || \"no reason given\"}).`));\r\n }\r\n else if (event instanceof Error) {\r\n this.onclose(event);\r\n }\r\n else {\r\n this.onclose();\r\n }\r\n }\r\n }\r\n _isCloseEvent(event) {\r\n return event && typeof event.wasClean === \"boolean\" && typeof event.code === \"number\";\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { DefaultHttpClient } from \"./DefaultHttpClient\";\r\nimport { AggregateErrors, DisabledTransportError, FailedToNegotiateWithServerError, FailedToStartTransportError, HttpError, UnsupportedTransportError } from \"./Errors\";\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { HttpTransportType, TransferFormat } from \"./ITransport\";\r\nimport { LongPollingTransport } from \"./LongPollingTransport\";\r\nimport { ServerSentEventsTransport } from \"./ServerSentEventsTransport\";\r\nimport { Arg, createLogger, getUserAgentHeader, Platform } from \"./Utils\";\r\nimport { WebSocketTransport } from \"./WebSocketTransport\";\r\nconst MAX_REDIRECTS = 100;\r\n/** @private */\r\nexport class HttpConnection {\r\n constructor(url, options = {}) {\r\n this._stopPromiseResolver = () => { };\r\n this.features = {};\r\n this._negotiateVersion = 1;\r\n Arg.isRequired(url, \"url\");\r\n this._logger = createLogger(options.logger);\r\n this.baseUrl = this._resolveUrl(url);\r\n options = options || {};\r\n options.logMessageContent = options.logMessageContent === undefined ? false : options.logMessageContent;\r\n if (typeof options.withCredentials === \"boolean\" || options.withCredentials === undefined) {\r\n options.withCredentials = options.withCredentials === undefined ? true : options.withCredentials;\r\n }\r\n else {\r\n throw new Error(\"withCredentials option was not a 'boolean' or 'undefined' value\");\r\n }\r\n options.timeout = options.timeout === undefined ? 100 * 1000 : options.timeout;\r\n let webSocketModule = null;\r\n let eventSourceModule = null;\r\n if (Platform.isNode && typeof require !== \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n webSocketModule = requireFunc(\"ws\");\r\n eventSourceModule = requireFunc(\"eventsource\");\r\n }\r\n if (!Platform.isNode && typeof WebSocket !== \"undefined\" && !options.WebSocket) {\r\n options.WebSocket = WebSocket;\r\n }\r\n else if (Platform.isNode && !options.WebSocket) {\r\n if (webSocketModule) {\r\n options.WebSocket = webSocketModule;\r\n }\r\n }\r\n if (!Platform.isNode && typeof EventSource !== \"undefined\" && !options.EventSource) {\r\n options.EventSource = EventSource;\r\n }\r\n else if (Platform.isNode && !options.EventSource) {\r\n if (typeof eventSourceModule !== \"undefined\") {\r\n options.EventSource = eventSourceModule;\r\n }\r\n }\r\n this._httpClient = options.httpClient || new DefaultHttpClient(this._logger);\r\n this._connectionState = \"Disconnected\" /* Disconnected */;\r\n this._connectionStarted = false;\r\n this._options = options;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n async start(transferFormat) {\r\n transferFormat = transferFormat || TransferFormat.Binary;\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Debug, `Starting connection with transfer format '${TransferFormat[transferFormat]}'.`);\r\n if (this._connectionState !== \"Disconnected\" /* Disconnected */) {\r\n return Promise.reject(new Error(\"Cannot start an HttpConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n this._connectionState = \"Connecting\" /* Connecting */;\r\n this._startInternalPromise = this._startInternal(transferFormat);\r\n await this._startInternalPromise;\r\n // The TypeScript compiler thinks that connectionState must be Connecting here. The TypeScript compiler is wrong.\r\n if (this._connectionState === \"Disconnecting\" /* Disconnecting */) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"Failed to start the HttpConnection before stop() was called.\";\r\n this._logger.log(LogLevel.Error, message);\r\n // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.\r\n await this._stopPromise;\r\n return Promise.reject(new Error(message));\r\n }\r\n else if (this._connectionState !== \"Connected\" /* Connected */) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!\";\r\n this._logger.log(LogLevel.Error, message);\r\n return Promise.reject(new Error(message));\r\n }\r\n this._connectionStarted = true;\r\n }\r\n send(data) {\r\n if (this._connectionState !== \"Connected\" /* Connected */) {\r\n return Promise.reject(new Error(\"Cannot send data if the connection is not in the 'Connected' State.\"));\r\n }\r\n if (!this._sendQueue) {\r\n this._sendQueue = new TransportSendQueue(this.transport);\r\n }\r\n // Transport will not be null if state is connected\r\n return this._sendQueue.send(data);\r\n }\r\n async stop(error) {\r\n if (this._connectionState === \"Disconnected\" /* Disconnected */) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n if (this._connectionState === \"Disconnecting\" /* Disconnecting */) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise;\r\n }\r\n this._connectionState = \"Disconnecting\" /* Disconnecting */;\r\n this._stopPromise = new Promise((resolve) => {\r\n // Don't complete stop() until stopConnection() completes.\r\n this._stopPromiseResolver = resolve;\r\n });\r\n // stopInternal should never throw so just observe it.\r\n await this._stopInternal(error);\r\n await this._stopPromise;\r\n }\r\n async _stopInternal(error) {\r\n // Set error as soon as possible otherwise there is a race between\r\n // the transport closing and providing an error and the error from a close message\r\n // We would prefer the close message error.\r\n this._stopError = error;\r\n try {\r\n await this._startInternalPromise;\r\n }\r\n catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n // The transport's onclose will trigger stopConnection which will run our onclose event.\r\n // The transport should always be set if currently connected. If it wasn't set, it's likely because\r\n // stop was called during start() and start() failed.\r\n if (this.transport) {\r\n try {\r\n await this.transport.stop();\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.transport.stop() threw error '${e}'.`);\r\n this._stopConnection();\r\n }\r\n this.transport = undefined;\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, \"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.\");\r\n }\r\n }\r\n async _startInternal(transferFormat) {\r\n // Store the original base url and the access token factory since they may change\r\n // as part of negotiating\r\n let url = this.baseUrl;\r\n this._accessTokenFactory = this._options.accessTokenFactory;\r\n try {\r\n if (this._options.skipNegotiation) {\r\n if (this._options.transport === HttpTransportType.WebSockets) {\r\n // No need to add a connection ID in this case\r\n this.transport = this._constructTransport(HttpTransportType.WebSockets);\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n await this._startTransport(url, transferFormat);\r\n }\r\n else {\r\n throw new Error(\"Negotiation can only be skipped when using the WebSocket transport directly.\");\r\n }\r\n }\r\n else {\r\n let negotiateResponse = null;\r\n let redirects = 0;\r\n do {\r\n negotiateResponse = await this._getNegotiationResponse(url);\r\n // the user tries to stop the connection when it is being started\r\n if (this._connectionState === \"Disconnecting\" /* Disconnecting */ || this._connectionState === \"Disconnected\" /* Disconnected */) {\r\n throw new Error(\"The connection was stopped during negotiation.\");\r\n }\r\n if (negotiateResponse.error) {\r\n throw new Error(negotiateResponse.error);\r\n }\r\n if (negotiateResponse.ProtocolVersion) {\r\n throw new Error(\"Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.\");\r\n }\r\n if (negotiateResponse.url) {\r\n url = negotiateResponse.url;\r\n }\r\n if (negotiateResponse.accessToken) {\r\n // Replace the current access token factory with one that uses\r\n // the returned access token\r\n const accessToken = negotiateResponse.accessToken;\r\n this._accessTokenFactory = () => accessToken;\r\n }\r\n redirects++;\r\n } while (negotiateResponse.url && redirects < MAX_REDIRECTS);\r\n if (redirects === MAX_REDIRECTS && negotiateResponse.url) {\r\n throw new Error(\"Negotiate redirection limit exceeded.\");\r\n }\r\n await this._createTransport(url, this._options.transport, negotiateResponse, transferFormat);\r\n }\r\n if (this.transport instanceof LongPollingTransport) {\r\n this.features.inherentKeepAlive = true;\r\n }\r\n if (this._connectionState === \"Connecting\" /* Connecting */) {\r\n // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise.\r\n // start() will handle the case when stop was called and startInternal exits still in the disconnecting state.\r\n this._logger.log(LogLevel.Debug, \"The HttpConnection connected successfully.\");\r\n this._connectionState = \"Connected\" /* Connected */;\r\n }\r\n // stop() is waiting on us via this.startInternalPromise so keep this.transport around so it can clean up.\r\n // This is the only case startInternal can exit in neither the connected nor disconnected state because stopConnection()\r\n // will transition to the disconnected state. start() will wait for the transition using the stopPromise.\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, \"Failed to start the connection: \" + e);\r\n this._connectionState = \"Disconnected\" /* Disconnected */;\r\n this.transport = undefined;\r\n // if start fails, any active calls to stop assume that start will complete the stop promise\r\n this._stopPromiseResolver();\r\n return Promise.reject(e);\r\n }\r\n }\r\n async _getNegotiationResponse(url) {\r\n const headers = {};\r\n if (this._accessTokenFactory) {\r\n const token = await this._accessTokenFactory();\r\n if (token) {\r\n headers[HeaderNames.Authorization] = `Bearer ${token}`;\r\n }\r\n }\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n const negotiateUrl = this._resolveNegotiateUrl(url);\r\n this._logger.log(LogLevel.Debug, `Sending negotiation request: ${negotiateUrl}.`);\r\n try {\r\n const response = await this._httpClient.post(negotiateUrl, {\r\n content: \"\",\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n });\r\n if (response.statusCode !== 200) {\r\n return Promise.reject(new Error(`Unexpected status code returned from negotiate '${response.statusCode}'`));\r\n }\r\n const negotiateResponse = JSON.parse(response.content);\r\n if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) {\r\n // Negotiate version 0 doesn't use connectionToken\r\n // So we set it equal to connectionId so all our logic can use connectionToken without being aware of the negotiate version\r\n negotiateResponse.connectionToken = negotiateResponse.connectionId;\r\n }\r\n return negotiateResponse;\r\n }\r\n catch (e) {\r\n let errorMessage = \"Failed to complete negotiation with the server: \" + e;\r\n if (e instanceof HttpError) {\r\n if (e.statusCode === 404) {\r\n errorMessage = errorMessage + \" Either this is not a SignalR endpoint or there is a proxy blocking the connection.\";\r\n }\r\n }\r\n this._logger.log(LogLevel.Error, errorMessage);\r\n return Promise.reject(new FailedToNegotiateWithServerError(errorMessage));\r\n }\r\n }\r\n _createConnectUrl(url, connectionToken) {\r\n if (!connectionToken) {\r\n return url;\r\n }\r\n return url + (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + `id=${connectionToken}`;\r\n }\r\n async _createTransport(url, requestedTransport, negotiateResponse, requestedTransferFormat) {\r\n let connectUrl = this._createConnectUrl(url, negotiateResponse.connectionToken);\r\n if (this._isITransport(requestedTransport)) {\r\n this._logger.log(LogLevel.Debug, \"Connection was provided an instance of ITransport, using that directly.\");\r\n this.transport = requestedTransport;\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n this.connectionId = negotiateResponse.connectionId;\r\n return;\r\n }\r\n const transportExceptions = [];\r\n const transports = negotiateResponse.availableTransports || [];\r\n let negotiate = negotiateResponse;\r\n for (const endpoint of transports) {\r\n const transportOrError = this._resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat);\r\n if (transportOrError instanceof Error) {\r\n // Store the error and continue, we don't want to cause a re-negotiate in these cases\r\n transportExceptions.push(`${endpoint.transport} failed:`);\r\n transportExceptions.push(transportOrError);\r\n }\r\n else if (this._isITransport(transportOrError)) {\r\n this.transport = transportOrError;\r\n if (!negotiate) {\r\n try {\r\n negotiate = await this._getNegotiationResponse(url);\r\n }\r\n catch (ex) {\r\n return Promise.reject(ex);\r\n }\r\n connectUrl = this._createConnectUrl(url, negotiate.connectionToken);\r\n }\r\n try {\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n this.connectionId = negotiate.connectionId;\r\n return;\r\n }\r\n catch (ex) {\r\n this._logger.log(LogLevel.Error, `Failed to start the transport '${endpoint.transport}': ${ex}`);\r\n negotiate = undefined;\r\n transportExceptions.push(new FailedToStartTransportError(`${endpoint.transport} failed: ${ex}`, HttpTransportType[endpoint.transport]));\r\n if (this._connectionState !== \"Connecting\" /* Connecting */) {\r\n const message = \"Failed to select transport before stop() was called.\";\r\n this._logger.log(LogLevel.Debug, message);\r\n return Promise.reject(new Error(message));\r\n }\r\n }\r\n }\r\n }\r\n if (transportExceptions.length > 0) {\r\n return Promise.reject(new AggregateErrors(`Unable to connect to the server with any of the available transports. ${transportExceptions.join(\" \")}`, transportExceptions));\r\n }\r\n return Promise.reject(new Error(\"None of the transports supported by the client are supported by the server.\"));\r\n }\r\n _constructTransport(transport) {\r\n switch (transport) {\r\n case HttpTransportType.WebSockets:\r\n if (!this._options.WebSocket) {\r\n throw new Error(\"'WebSocket' is not supported in your environment.\");\r\n }\r\n return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent, this._options.WebSocket, this._options.headers || {});\r\n case HttpTransportType.ServerSentEvents:\r\n if (!this._options.EventSource) {\r\n throw new Error(\"'EventSource' is not supported in your environment.\");\r\n }\r\n return new ServerSentEventsTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options);\r\n case HttpTransportType.LongPolling:\r\n return new LongPollingTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options);\r\n default:\r\n throw new Error(`Unknown transport: ${transport}.`);\r\n }\r\n }\r\n _startTransport(url, transferFormat) {\r\n this.transport.onreceive = this.onreceive;\r\n this.transport.onclose = (e) => this._stopConnection(e);\r\n return this.transport.connect(url, transferFormat);\r\n }\r\n _resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat) {\r\n const transport = HttpTransportType[endpoint.transport];\r\n if (transport === null || transport === undefined) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n return new Error(`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n }\r\n else {\r\n if (transportMatches(requestedTransport, transport)) {\r\n const transferFormats = endpoint.transferFormats.map((s) => TransferFormat[s]);\r\n if (transferFormats.indexOf(requestedTransferFormat) >= 0) {\r\n if ((transport === HttpTransportType.WebSockets && !this._options.WebSocket) ||\r\n (transport === HttpTransportType.ServerSentEvents && !this._options.EventSource)) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it is not supported in your environment.'`);\r\n return new UnsupportedTransportError(`'${HttpTransportType[transport]}' is not supported in your environment.`, transport);\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, `Selecting transport '${HttpTransportType[transport]}'.`);\r\n try {\r\n return this._constructTransport(transport);\r\n }\r\n catch (ex) {\r\n return ex;\r\n }\r\n }\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it does not support the requested transfer format '${TransferFormat[requestedTransferFormat]}'.`);\r\n return new Error(`'${HttpTransportType[transport]}' does not support ${TransferFormat[requestedTransferFormat]}.`);\r\n }\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it was disabled by the client.`);\r\n return new DisabledTransportError(`'${HttpTransportType[transport]}' is disabled by the client.`, transport);\r\n }\r\n }\r\n }\r\n _isITransport(transport) {\r\n return transport && typeof (transport) === \"object\" && \"connect\" in transport;\r\n }\r\n _stopConnection(error) {\r\n this._logger.log(LogLevel.Debug, `HttpConnection.stopConnection(${error}) called while in state ${this._connectionState}.`);\r\n this.transport = undefined;\r\n // If we have a stopError, it takes precedence over the error from the transport\r\n error = this._stopError || error;\r\n this._stopError = undefined;\r\n if (this._connectionState === \"Disconnected\" /* Disconnected */) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is already in the disconnected state.`);\r\n return;\r\n }\r\n if (this._connectionState === \"Connecting\" /* Connecting */) {\r\n this._logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);\r\n throw new Error(`HttpConnection.stopConnection(${error}) was called while the connection is still in the connecting state.`);\r\n }\r\n if (this._connectionState === \"Disconnecting\" /* Disconnecting */) {\r\n // A call to stop() induced this call to stopConnection and needs to be completed.\r\n // Any stop() awaiters will be scheduled to continue after the onclose callback fires.\r\n this._stopPromiseResolver();\r\n }\r\n if (error) {\r\n this._logger.log(LogLevel.Error, `Connection disconnected with error '${error}'.`);\r\n }\r\n else {\r\n this._logger.log(LogLevel.Information, \"Connection disconnected.\");\r\n }\r\n if (this._sendQueue) {\r\n this._sendQueue.stop().catch((e) => {\r\n this._logger.log(LogLevel.Error, `TransportSendQueue.stop() threw error '${e}'.`);\r\n });\r\n this._sendQueue = undefined;\r\n }\r\n this.connectionId = undefined;\r\n this._connectionState = \"Disconnected\" /* Disconnected */;\r\n if (this._connectionStarted) {\r\n this._connectionStarted = false;\r\n try {\r\n if (this.onclose) {\r\n this.onclose(error);\r\n }\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.onclose(${error}) threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n _resolveUrl(url) {\r\n // startsWith is not supported in IE\r\n if (url.lastIndexOf(\"https://\", 0) === 0 || url.lastIndexOf(\"http://\", 0) === 0) {\r\n return url;\r\n }\r\n if (!Platform.isBrowser) {\r\n throw new Error(`Cannot resolve '${url}'.`);\r\n }\r\n // Setting the url to the href propery of an anchor tag handles normalization\r\n // for us. There are 3 main cases.\r\n // 1. Relative path normalization e.g \"b\" -> \"http://localhost:5000/a/b\"\r\n // 2. Absolute path normalization e.g \"/a/b\" -> \"http://localhost:5000/a/b\"\r\n // 3. Networkpath reference normalization e.g \"//localhost:5000/a/b\" -> \"http://localhost:5000/a/b\"\r\n const aTag = window.document.createElement(\"a\");\r\n aTag.href = url;\r\n this._logger.log(LogLevel.Information, `Normalizing '${url}' to '${aTag.href}'.`);\r\n return aTag.href;\r\n }\r\n _resolveNegotiateUrl(url) {\r\n const index = url.indexOf(\"?\");\r\n let negotiateUrl = url.substring(0, index === -1 ? url.length : index);\r\n if (negotiateUrl[negotiateUrl.length - 1] !== \"/\") {\r\n negotiateUrl += \"/\";\r\n }\r\n negotiateUrl += \"negotiate\";\r\n negotiateUrl += index === -1 ? \"\" : url.substring(index);\r\n if (negotiateUrl.indexOf(\"negotiateVersion\") === -1) {\r\n negotiateUrl += index === -1 ? \"?\" : \"&\";\r\n negotiateUrl += \"negotiateVersion=\" + this._negotiateVersion;\r\n }\r\n return negotiateUrl;\r\n }\r\n}\r\nfunction transportMatches(requestedTransport, actualTransport) {\r\n return !requestedTransport || ((actualTransport & requestedTransport) !== 0);\r\n}\r\n/** @private */\r\nexport class TransportSendQueue {\r\n constructor(_transport) {\r\n this._transport = _transport;\r\n this._buffer = [];\r\n this._executing = true;\r\n this._sendBufferedData = new PromiseSource();\r\n this._transportResult = new PromiseSource();\r\n this._sendLoopPromise = this._sendLoop();\r\n }\r\n send(data) {\r\n this._bufferData(data);\r\n if (!this._transportResult) {\r\n this._transportResult = new PromiseSource();\r\n }\r\n return this._transportResult.promise;\r\n }\r\n stop() {\r\n this._executing = false;\r\n this._sendBufferedData.resolve();\r\n return this._sendLoopPromise;\r\n }\r\n _bufferData(data) {\r\n if (this._buffer.length && typeof (this._buffer[0]) !== typeof (data)) {\r\n throw new Error(`Expected data to be of type ${typeof (this._buffer)} but was of type ${typeof (data)}`);\r\n }\r\n this._buffer.push(data);\r\n this._sendBufferedData.resolve();\r\n }\r\n async _sendLoop() {\r\n while (true) {\r\n await this._sendBufferedData.promise;\r\n if (!this._executing) {\r\n if (this._transportResult) {\r\n this._transportResult.reject(\"Connection stopped.\");\r\n }\r\n break;\r\n }\r\n this._sendBufferedData = new PromiseSource();\r\n const transportResult = this._transportResult;\r\n this._transportResult = undefined;\r\n const data = typeof (this._buffer[0]) === \"string\" ?\r\n this._buffer.join(\"\") :\r\n TransportSendQueue._concatBuffers(this._buffer);\r\n this._buffer.length = 0;\r\n try {\r\n await this._transport.send(data);\r\n transportResult.resolve();\r\n }\r\n catch (error) {\r\n transportResult.reject(error);\r\n }\r\n }\r\n }\r\n static _concatBuffers(arrayBuffers) {\r\n const totalLength = arrayBuffers.map((b) => b.byteLength).reduce((a, b) => a + b);\r\n const result = new Uint8Array(totalLength);\r\n let offset = 0;\r\n for (const item of arrayBuffers) {\r\n result.set(new Uint8Array(item), offset);\r\n offset += item.byteLength;\r\n }\r\n return result.buffer;\r\n }\r\n}\r\nclass PromiseSource {\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => [this._resolver, this._rejecter] = [resolve, reject]);\r\n }\r\n resolve() {\r\n this._resolver();\r\n }\r\n reject(reason) {\r\n this._rejecter(reason);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// Not exported from index\r\n/** @private */\r\nexport class TextMessageFormat {\r\n static write(output) {\r\n return `${output}${TextMessageFormat.RecordSeparator}`;\r\n }\r\n static parse(input) {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n const messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n }\r\n}\r\nTextMessageFormat.RecordSeparatorCode = 0x1e;\r\nTextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n/** @private */\r\nexport class HandshakeProtocol {\r\n // Handshake request is always JSON\r\n writeHandshakeRequest(handshakeRequest) {\r\n return TextMessageFormat.write(JSON.stringify(handshakeRequest));\r\n }\r\n parseHandshakeResponse(data) {\r\n let messageData;\r\n let remainingData;\r\n if (isArrayBuffer(data)) {\r\n // Format is binary but still need to read JSON text from handshake response\r\n const binaryData = new Uint8Array(data);\r\n const separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));\r\n remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;\r\n }\r\n else {\r\n const textData = data;\r\n const separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = textData.substring(0, responseLength);\r\n remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;\r\n }\r\n // At this point we should have just the single handshake message\r\n const messages = TextMessageFormat.parse(messageData);\r\n const response = JSON.parse(messages[0]);\r\n if (response.type) {\r\n throw new Error(\"Expected a handshake response from the server.\");\r\n }\r\n const responseMessage = response;\r\n // multiple messages could have arrived with handshake\r\n // return additional data to be parsed as usual, or null if all parsed\r\n return [remainingData, responseMessage];\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n/** Defines the type of a Hub Message. */\r\nexport var MessageType;\r\n(function (MessageType) {\r\n /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */\r\n MessageType[MessageType[\"Invocation\"] = 1] = \"Invocation\";\r\n /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */\r\n MessageType[MessageType[\"StreamItem\"] = 2] = \"StreamItem\";\r\n /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */\r\n MessageType[MessageType[\"Completion\"] = 3] = \"Completion\";\r\n /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */\r\n MessageType[MessageType[\"StreamInvocation\"] = 4] = \"StreamInvocation\";\r\n /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */\r\n MessageType[MessageType[\"CancelInvocation\"] = 5] = \"CancelInvocation\";\r\n /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */\r\n MessageType[MessageType[\"Ping\"] = 6] = \"Ping\";\r\n /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */\r\n MessageType[MessageType[\"Close\"] = 7] = \"Close\";\r\n})(MessageType || (MessageType = {}));\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { SubjectSubscription } from \"./Utils\";\r\n/** Stream implementation to stream items to the server. */\r\nexport class Subject {\r\n constructor() {\r\n this.observers = [];\r\n }\r\n next(item) {\r\n for (const observer of this.observers) {\r\n observer.next(item);\r\n }\r\n }\r\n error(err) {\r\n for (const observer of this.observers) {\r\n if (observer.error) {\r\n observer.error(err);\r\n }\r\n }\r\n }\r\n complete() {\r\n for (const observer of this.observers) {\r\n if (observer.complete) {\r\n observer.complete();\r\n }\r\n }\r\n }\r\n subscribe(observer) {\r\n this.observers.push(observer);\r\n return new SubjectSubscription(this, observer);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { HandshakeProtocol } from \"./HandshakeProtocol\";\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { Subject } from \"./Subject\";\r\nimport { Arg, getErrorString, Platform } from \"./Utils\";\r\nconst DEFAULT_TIMEOUT_IN_MS = 30 * 1000;\r\nconst DEFAULT_PING_INTERVAL_IN_MS = 15 * 1000;\r\n/** Describes the current state of the {@link HubConnection} to the server. */\r\nexport var HubConnectionState;\r\n(function (HubConnectionState) {\r\n /** The hub connection is disconnected. */\r\n HubConnectionState[\"Disconnected\"] = \"Disconnected\";\r\n /** The hub connection is connecting. */\r\n HubConnectionState[\"Connecting\"] = \"Connecting\";\r\n /** The hub connection is connected. */\r\n HubConnectionState[\"Connected\"] = \"Connected\";\r\n /** The hub connection is disconnecting. */\r\n HubConnectionState[\"Disconnecting\"] = \"Disconnecting\";\r\n /** The hub connection is reconnecting. */\r\n HubConnectionState[\"Reconnecting\"] = \"Reconnecting\";\r\n})(HubConnectionState || (HubConnectionState = {}));\r\n/** Represents a connection to a SignalR Hub. */\r\nexport class HubConnection {\r\n constructor(connection, logger, protocol, reconnectPolicy) {\r\n this._nextKeepAlive = 0;\r\n this._freezeEventListener = () => {\r\n this._logger.log(LogLevel.Warning, \"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep\");\r\n };\r\n Arg.isRequired(connection, \"connection\");\r\n Arg.isRequired(logger, \"logger\");\r\n Arg.isRequired(protocol, \"protocol\");\r\n this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS;\r\n this.keepAliveIntervalInMilliseconds = DEFAULT_PING_INTERVAL_IN_MS;\r\n this._logger = logger;\r\n this._protocol = protocol;\r\n this.connection = connection;\r\n this._reconnectPolicy = reconnectPolicy;\r\n this._handshakeProtocol = new HandshakeProtocol();\r\n this.connection.onreceive = (data) => this._processIncomingData(data);\r\n this.connection.onclose = (error) => this._connectionClosed(error);\r\n this._callbacks = {};\r\n this._methods = {};\r\n this._closedCallbacks = [];\r\n this._reconnectingCallbacks = [];\r\n this._reconnectedCallbacks = [];\r\n this._invocationId = 0;\r\n this._receivedHandshakeResponse = false;\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n this._cachedPingMessage = this._protocol.writeMessage({ type: MessageType.Ping });\r\n }\r\n /** @internal */\r\n // Using a public static factory method means we can have a private constructor and an _internal_\r\n // create method that can be used by HubConnectionBuilder. An \"internal\" constructor would just\r\n // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a\r\n // public parameter-less constructor.\r\n static create(connection, logger, protocol, reconnectPolicy) {\r\n return new HubConnection(connection, logger, protocol, reconnectPolicy);\r\n }\r\n /** Indicates the state of the {@link HubConnection} to the server. */\r\n get state() {\r\n return this._connectionState;\r\n }\r\n /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either\r\n * in the disconnected state or if the negotiation step was skipped.\r\n */\r\n get connectionId() {\r\n return this.connection ? (this.connection.connectionId || null) : null;\r\n }\r\n /** Indicates the url of the {@link HubConnection} to the server. */\r\n get baseUrl() {\r\n return this.connection.baseUrl || \"\";\r\n }\r\n /**\r\n * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or\r\n * Reconnecting states.\r\n * @param {string} url The url to connect to.\r\n */\r\n set baseUrl(url) {\r\n if (this._connectionState !== HubConnectionState.Disconnected && this._connectionState !== HubConnectionState.Reconnecting) {\r\n throw new Error(\"The HubConnection must be in the Disconnected or Reconnecting state to change the url.\");\r\n }\r\n if (!url) {\r\n throw new Error(\"The HubConnection url must be a valid url.\");\r\n }\r\n this.connection.baseUrl = url;\r\n }\r\n /** Starts the connection.\r\n *\r\n * @returns {Promise} A Promise that resolves when the connection has been successfully established, or rejects with an error.\r\n */\r\n start() {\r\n this._startPromise = this._startWithStateTransitions();\r\n return this._startPromise;\r\n }\r\n async _startWithStateTransitions() {\r\n if (this._connectionState !== HubConnectionState.Disconnected) {\r\n return Promise.reject(new Error(\"Cannot start a HubConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n this._connectionState = HubConnectionState.Connecting;\r\n this._logger.log(LogLevel.Debug, \"Starting HubConnection.\");\r\n try {\r\n await this._startInternal();\r\n if (Platform.isBrowser) {\r\n // Log when the browser freezes the tab so users know why their connection unexpectedly stopped working\r\n window.document.addEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n this._connectionState = HubConnectionState.Connected;\r\n this._connectionStarted = true;\r\n this._logger.log(LogLevel.Debug, \"HubConnection connected successfully.\");\r\n }\r\n catch (e) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._logger.log(LogLevel.Debug, `HubConnection failed to start successfully because of error '${e}'.`);\r\n return Promise.reject(e);\r\n }\r\n }\r\n async _startInternal() {\r\n this._stopDuringStartError = undefined;\r\n this._receivedHandshakeResponse = false;\r\n // Set up the promise before any connection is (re)started otherwise it could race with received messages\r\n const handshakePromise = new Promise((resolve, reject) => {\r\n this._handshakeResolver = resolve;\r\n this._handshakeRejecter = reject;\r\n });\r\n await this.connection.start(this._protocol.transferFormat);\r\n try {\r\n const handshakeRequest = {\r\n protocol: this._protocol.name,\r\n version: this._protocol.version,\r\n };\r\n this._logger.log(LogLevel.Debug, \"Sending handshake request.\");\r\n await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(handshakeRequest));\r\n this._logger.log(LogLevel.Information, `Using HubProtocol '${this._protocol.name}'.`);\r\n // defensively cleanup timeout in case we receive a message from the server before we finish start\r\n this._cleanupTimeout();\r\n this._resetTimeoutPeriod();\r\n this._resetKeepAliveInterval();\r\n await handshakePromise;\r\n // It's important to check the stopDuringStartError instead of just relying on the handshakePromise\r\n // being rejected on close, because this continuation can run after both the handshake completed successfully\r\n // and the connection was closed.\r\n if (this._stopDuringStartError) {\r\n // It's important to throw instead of returning a rejected promise, because we don't want to allow any state\r\n // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise\r\n // will cause the calling continuation to get scheduled to run later.\r\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\r\n throw this._stopDuringStartError;\r\n }\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Debug, `Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`);\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n // HttpConnection.stop() should not complete until after the onclose callback is invoked.\r\n // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.\r\n await this.connection.stop(e);\r\n throw e;\r\n }\r\n }\r\n /** Stops the connection.\r\n *\r\n * @returns {Promise} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.\r\n */\r\n async stop() {\r\n // Capture the start promise before the connection might be restarted in an onclose callback.\r\n const startPromise = this._startPromise;\r\n this._stopPromise = this._stopInternal();\r\n await this._stopPromise;\r\n try {\r\n // Awaiting undefined continues immediately\r\n await startPromise;\r\n }\r\n catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n }\r\n _stopInternal(error) {\r\n if (this._connectionState === HubConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HubConnection.stop(${error}) ignored because it is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise;\r\n }\r\n this._connectionState = HubConnectionState.Disconnecting;\r\n this._logger.log(LogLevel.Debug, \"Stopping HubConnection.\");\r\n if (this._reconnectDelayHandle) {\r\n // We're in a reconnect delay which means the underlying connection is currently already stopped.\r\n // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and\r\n // fire the onclose callbacks.\r\n this._logger.log(LogLevel.Debug, \"Connection stopped during reconnect delay. Done reconnecting.\");\r\n clearTimeout(this._reconnectDelayHandle);\r\n this._reconnectDelayHandle = undefined;\r\n this._completeClose();\r\n return Promise.resolve();\r\n }\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n this._stopDuringStartError = error || new Error(\"The connection was stopped before the hub handshake could complete.\");\r\n // HttpConnection.stop() should not complete until after either HttpConnection.start() fails\r\n // or the onclose callback is invoked. The onclose callback will transition the HubConnection\r\n // to the disconnected state if need be before HttpConnection.stop() completes.\r\n return this.connection.stop(error);\r\n }\r\n /** Invokes a streaming hub method on the server using the specified name and arguments.\r\n *\r\n * @typeparam T The type of the items returned by the server.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {IStreamResult} An object that yields results from the server as they are received.\r\n */\r\n stream(methodName, ...args) {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);\r\n // eslint-disable-next-line prefer-const\r\n let promiseQueue;\r\n const subject = new Subject();\r\n subject.cancelCallback = () => {\r\n const cancelInvocation = this._createCancelInvocation(invocationDescriptor.invocationId);\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n return promiseQueue.then(() => {\r\n return this._sendWithProtocol(cancelInvocation);\r\n });\r\n };\r\n this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {\r\n if (error) {\r\n subject.error(error);\r\n return;\r\n }\r\n else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n subject.error(new Error(invocationEvent.error));\r\n }\r\n else {\r\n subject.complete();\r\n }\r\n }\r\n else {\r\n subject.next((invocationEvent.item));\r\n }\r\n }\r\n };\r\n promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n subject.error(e);\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n });\r\n this._launchStreams(streams, promiseQueue);\r\n return subject;\r\n }\r\n _sendMessage(message) {\r\n this._resetKeepAliveInterval();\r\n return this.connection.send(message);\r\n }\r\n /**\r\n * Sends a js object to the server.\r\n * @param message The js object to serialize and send.\r\n */\r\n _sendWithProtocol(message) {\r\n return this._sendMessage(this._protocol.writeMessage(message));\r\n }\r\n /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.\r\n *\r\n * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still\r\n * be processing the invocation.\r\n *\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.\r\n */\r\n send(methodName, ...args) {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const sendPromise = this._sendWithProtocol(this._createInvocation(methodName, args, true, streamIds));\r\n this._launchStreams(streams, sendPromise);\r\n return sendPromise;\r\n }\r\n /** Invokes a hub method on the server using the specified name and arguments.\r\n *\r\n * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise\r\n * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of\r\n * resolving the Promise.\r\n *\r\n * @typeparam T The expected return type.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise} A Promise that resolves with the result of the server method (if any), or rejects with an error.\r\n */\r\n invoke(methodName, ...args) {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);\r\n const p = new Promise((resolve, reject) => {\r\n // invocationId will always have a value for a non-blocking invocation\r\n this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {\r\n if (error) {\r\n reject(error);\r\n return;\r\n }\r\n else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n reject(new Error(invocationEvent.error));\r\n }\r\n else {\r\n resolve(invocationEvent.result);\r\n }\r\n }\r\n else {\r\n reject(new Error(`Unexpected message type: ${invocationEvent.type}`));\r\n }\r\n }\r\n };\r\n const promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n reject(e);\r\n // invocationId will always have a value for a non-blocking invocation\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n });\r\n this._launchStreams(streams, promiseQueue);\r\n });\r\n return p;\r\n }\r\n /** Registers a handler that will be invoked when the hub method with the specified method name is invoked.\r\n *\r\n * @param {string} methodName The name of the hub method to define.\r\n * @param {Function} newMethod The handler that will be raised when the hub method is invoked.\r\n */\r\n on(methodName, newMethod) {\r\n if (!methodName || !newMethod) {\r\n return;\r\n }\r\n methodName = methodName.toLowerCase();\r\n if (!this._methods[methodName]) {\r\n this._methods[methodName] = [];\r\n }\r\n // Preventing adding the same handler multiple times.\r\n if (this._methods[methodName].indexOf(newMethod) !== -1) {\r\n return;\r\n }\r\n this._methods[methodName].push(newMethod);\r\n }\r\n off(methodName, method) {\r\n if (!methodName) {\r\n return;\r\n }\r\n methodName = methodName.toLowerCase();\r\n const handlers = this._methods[methodName];\r\n if (!handlers) {\r\n return;\r\n }\r\n if (method) {\r\n const removeIdx = handlers.indexOf(method);\r\n if (removeIdx !== -1) {\r\n handlers.splice(removeIdx, 1);\r\n if (handlers.length === 0) {\r\n delete this._methods[methodName];\r\n }\r\n }\r\n }\r\n else {\r\n delete this._methods[methodName];\r\n }\r\n }\r\n /** Registers a handler that will be invoked when the connection is closed.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).\r\n */\r\n onclose(callback) {\r\n if (callback) {\r\n this._closedCallbacks.push(callback);\r\n }\r\n }\r\n /** Registers a handler that will be invoked when the connection starts reconnecting.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).\r\n */\r\n onreconnecting(callback) {\r\n if (callback) {\r\n this._reconnectingCallbacks.push(callback);\r\n }\r\n }\r\n /** Registers a handler that will be invoked when the connection successfully reconnects.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection successfully reconnects.\r\n */\r\n onreconnected(callback) {\r\n if (callback) {\r\n this._reconnectedCallbacks.push(callback);\r\n }\r\n }\r\n _processIncomingData(data) {\r\n this._cleanupTimeout();\r\n if (!this._receivedHandshakeResponse) {\r\n data = this._processHandshakeResponse(data);\r\n this._receivedHandshakeResponse = true;\r\n }\r\n // Data may have all been read when processing handshake response\r\n if (data) {\r\n // Parse the messages\r\n const messages = this._protocol.parseMessages(data, this._logger);\r\n for (const message of messages) {\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n this._invokeClientMethod(message);\r\n break;\r\n case MessageType.StreamItem:\r\n case MessageType.Completion: {\r\n const callback = this._callbacks[message.invocationId];\r\n if (callback) {\r\n if (message.type === MessageType.Completion) {\r\n delete this._callbacks[message.invocationId];\r\n }\r\n try {\r\n callback(message);\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream callback threw error: ${getErrorString(e)}`);\r\n }\r\n }\r\n break;\r\n }\r\n case MessageType.Ping:\r\n // Don't care about pings\r\n break;\r\n case MessageType.Close: {\r\n this._logger.log(LogLevel.Information, \"Close message received from server.\");\r\n const error = message.error ? new Error(\"Server returned an error on close: \" + message.error) : undefined;\r\n if (message.allowReconnect === true) {\r\n // It feels wrong not to await connection.stop() here, but processIncomingData is called as part of an onreceive callback which is not async,\r\n // this is already the behavior for serverTimeout(), and HttpConnection.Stop() should catch and log all possible exceptions.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(error);\r\n }\r\n else {\r\n // We cannot await stopInternal() here, but subsequent calls to stop() will await this if stopInternal() is still ongoing.\r\n this._stopPromise = this._stopInternal(error);\r\n }\r\n break;\r\n }\r\n default:\r\n this._logger.log(LogLevel.Warning, `Invalid message type: ${message.type}.`);\r\n break;\r\n }\r\n }\r\n }\r\n this._resetTimeoutPeriod();\r\n }\r\n _processHandshakeResponse(data) {\r\n let responseMessage;\r\n let remainingData;\r\n try {\r\n [remainingData, responseMessage] = this._handshakeProtocol.parseHandshakeResponse(data);\r\n }\r\n catch (e) {\r\n const message = \"Error parsing handshake response: \" + e;\r\n this._logger.log(LogLevel.Error, message);\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n }\r\n if (responseMessage.error) {\r\n const message = \"Server returned handshake error: \" + responseMessage.error;\r\n this._logger.log(LogLevel.Error, message);\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, \"Server handshake complete.\");\r\n }\r\n this._handshakeResolver();\r\n return remainingData;\r\n }\r\n _resetKeepAliveInterval() {\r\n if (this.connection.features.inherentKeepAlive) {\r\n return;\r\n }\r\n // Set the time we want the next keep alive to be sent\r\n // Timer will be setup on next message receive\r\n this._nextKeepAlive = new Date().getTime() + this.keepAliveIntervalInMilliseconds;\r\n this._cleanupPingTimer();\r\n }\r\n _resetTimeoutPeriod() {\r\n if (!this.connection.features || !this.connection.features.inherentKeepAlive) {\r\n // Set the timeout timer\r\n this._timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds);\r\n // Set keepAlive timer if there isn't one\r\n if (this._pingServerHandle === undefined) {\r\n let nextPing = this._nextKeepAlive - new Date().getTime();\r\n if (nextPing < 0) {\r\n nextPing = 0;\r\n }\r\n // The timer needs to be set from a networking callback to avoid Chrome timer throttling from causing timers to run once a minute\r\n this._pingServerHandle = setTimeout(async () => {\r\n if (this._connectionState === HubConnectionState.Connected) {\r\n try {\r\n await this._sendMessage(this._cachedPingMessage);\r\n }\r\n catch {\r\n // We don't care about the error. It should be seen elsewhere in the client.\r\n // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering\r\n this._cleanupPingTimer();\r\n }\r\n }\r\n }, nextPing);\r\n }\r\n }\r\n }\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n serverTimeout() {\r\n // The server hasn't talked to us in a while. It doesn't like us anymore ... :(\r\n // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(new Error(\"Server timeout elapsed without receiving a message from the server.\"));\r\n }\r\n _invokeClientMethod(invocationMessage) {\r\n const methods = this._methods[invocationMessage.target.toLowerCase()];\r\n if (methods) {\r\n try {\r\n methods.forEach((m) => m.apply(this, invocationMessage.arguments));\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `A callback for the method ${invocationMessage.target.toLowerCase()} threw error '${e}'.`);\r\n }\r\n if (invocationMessage.invocationId) {\r\n // This is not supported in v1. So we return an error to avoid blocking the server waiting for the response.\r\n const message = \"Server requested a response, which is not supported in this version of the client.\";\r\n this._logger.log(LogLevel.Error, message);\r\n // We don't want to wait on the stop itself.\r\n this._stopPromise = this._stopInternal(new Error(message));\r\n }\r\n }\r\n else {\r\n this._logger.log(LogLevel.Warning, `No client method with the name '${invocationMessage.target}' found.`);\r\n }\r\n }\r\n _connectionClosed(error) {\r\n this._logger.log(LogLevel.Debug, `HubConnection.connectionClosed(${error}) called while in state ${this._connectionState}.`);\r\n // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet.\r\n this._stopDuringStartError = this._stopDuringStartError || error || new Error(\"The underlying connection was closed before the hub handshake could complete.\");\r\n // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it.\r\n // If it has already completed, this should just noop.\r\n if (this._handshakeResolver) {\r\n this._handshakeResolver();\r\n }\r\n this._cancelCallbacksWithError(error || new Error(\"Invocation canceled due to the underlying connection being closed.\"));\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._completeClose(error);\r\n }\r\n else if (this._connectionState === HubConnectionState.Connected && this._reconnectPolicy) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._reconnect(error);\r\n }\r\n else if (this._connectionState === HubConnectionState.Connected) {\r\n this._completeClose(error);\r\n }\r\n // If none of the above if conditions were true were called the HubConnection must be in either:\r\n // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it.\r\n // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt\r\n // and potentially continue the reconnect() loop.\r\n // 3. The Disconnected state in which case we're already done.\r\n }\r\n _completeClose(error) {\r\n if (this._connectionStarted) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n if (Platform.isBrowser) {\r\n window.document.removeEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n try {\r\n this._closedCallbacks.forEach((c) => c.apply(this, [error]));\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `An onclose callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n async _reconnect(error) {\r\n const reconnectStartTime = Date.now();\r\n let previousReconnectAttempts = 0;\r\n let retryError = error !== undefined ? error : new Error(\"Attempting to reconnect due to a unknown error.\");\r\n let nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, 0, retryError);\r\n if (nextRetryDelay === null) {\r\n this._logger.log(LogLevel.Debug, \"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.\");\r\n this._completeClose(error);\r\n return;\r\n }\r\n this._connectionState = HubConnectionState.Reconnecting;\r\n if (error) {\r\n this._logger.log(LogLevel.Information, `Connection reconnecting because of error '${error}'.`);\r\n }\r\n else {\r\n this._logger.log(LogLevel.Information, \"Connection reconnecting.\");\r\n }\r\n if (this._reconnectingCallbacks.length !== 0) {\r\n try {\r\n this._reconnectingCallbacks.forEach((c) => c.apply(this, [error]));\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnecting callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n // Exit early if an onreconnecting callback called connection.stop().\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.\");\r\n return;\r\n }\r\n }\r\n while (nextRetryDelay !== null) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt number ${previousReconnectAttempts} will start in ${nextRetryDelay} ms.`);\r\n await new Promise((resolve) => {\r\n this._reconnectDelayHandle = setTimeout(resolve, nextRetryDelay);\r\n });\r\n this._reconnectDelayHandle = undefined;\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state during reconnect delay. Done reconnecting.\");\r\n return;\r\n }\r\n try {\r\n await this._startInternal();\r\n this._connectionState = HubConnectionState.Connected;\r\n this._logger.log(LogLevel.Information, \"HubConnection reconnected successfully.\");\r\n if (this._reconnectedCallbacks.length !== 0) {\r\n try {\r\n this._reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`);\r\n }\r\n }\r\n return;\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt failed because of error '${e}'.`);\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, `Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`);\r\n // The TypeScript compiler thinks that connectionState must be Connected here. The TypeScript compiler is wrong.\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._completeClose();\r\n }\r\n return;\r\n }\r\n retryError = e instanceof Error ? e : new Error(e.toString());\r\n nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError);\r\n }\r\n }\r\n this._logger.log(LogLevel.Information, `Reconnect retries have been exhausted after ${Date.now() - reconnectStartTime} ms and ${previousReconnectAttempts} failed attempts. Connection disconnecting.`);\r\n this._completeClose();\r\n }\r\n _getNextRetryDelay(previousRetryCount, elapsedMilliseconds, retryReason) {\r\n try {\r\n return this._reconnectPolicy.nextRetryDelayInMilliseconds({\r\n elapsedMilliseconds,\r\n previousRetryCount,\r\n retryReason,\r\n });\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `IRetryPolicy.nextRetryDelayInMilliseconds(${previousRetryCount}, ${elapsedMilliseconds}) threw error '${e}'.`);\r\n return null;\r\n }\r\n }\r\n _cancelCallbacksWithError(error) {\r\n const callbacks = this._callbacks;\r\n this._callbacks = {};\r\n Object.keys(callbacks)\r\n .forEach((key) => {\r\n const callback = callbacks[key];\r\n try {\r\n callback(null, error);\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream 'error' callback called with '${error}' threw error: ${getErrorString(e)}`);\r\n }\r\n });\r\n }\r\n _cleanupPingTimer() {\r\n if (this._pingServerHandle) {\r\n clearTimeout(this._pingServerHandle);\r\n this._pingServerHandle = undefined;\r\n }\r\n }\r\n _cleanupTimeout() {\r\n if (this._timeoutHandle) {\r\n clearTimeout(this._timeoutHandle);\r\n }\r\n }\r\n _createInvocation(methodName, args, nonblocking, streamIds) {\r\n if (nonblocking) {\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n else {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n }\r\n _launchStreams(streams, promiseQueue) {\r\n if (streams.length === 0) {\r\n return;\r\n }\r\n // Synchronize stream data so they arrive in-order on the server\r\n if (!promiseQueue) {\r\n promiseQueue = Promise.resolve();\r\n }\r\n // We want to iterate over the keys, since the keys are the stream ids\r\n // eslint-disable-next-line guard-for-in\r\n for (const streamId in streams) {\r\n streams[streamId].subscribe({\r\n complete: () => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId)));\r\n },\r\n error: (err) => {\r\n let message;\r\n if (err instanceof Error) {\r\n message = err.message;\r\n }\r\n else if (err && err.toString) {\r\n message = err.toString();\r\n }\r\n else {\r\n message = \"Unknown error\";\r\n }\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId, message)));\r\n },\r\n next: (item) => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createStreamItemMessage(streamId, item)));\r\n },\r\n });\r\n }\r\n }\r\n _replaceStreamingParams(args) {\r\n const streams = [];\r\n const streamIds = [];\r\n for (let i = 0; i < args.length; i++) {\r\n const argument = args[i];\r\n if (this._isObservable(argument)) {\r\n const streamId = this._invocationId;\r\n this._invocationId++;\r\n // Store the stream for later use\r\n streams[streamId] = argument;\r\n streamIds.push(streamId.toString());\r\n // remove stream from args\r\n args.splice(i, 1);\r\n }\r\n }\r\n return [streams, streamIds];\r\n }\r\n _isObservable(arg) {\r\n // This allows other stream implementations to just work (like rxjs)\r\n return arg && arg.subscribe && typeof arg.subscribe === \"function\";\r\n }\r\n _createStreamInvocation(methodName, args, streamIds) {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n }\r\n _createCancelInvocation(id) {\r\n return {\r\n invocationId: id,\r\n type: MessageType.CancelInvocation,\r\n };\r\n }\r\n _createStreamItemMessage(id, item) {\r\n return {\r\n invocationId: id,\r\n item,\r\n type: MessageType.StreamItem,\r\n };\r\n }\r\n _createCompletionMessage(id, error, result) {\r\n if (error) {\r\n return {\r\n error,\r\n invocationId: id,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n return {\r\n invocationId: id,\r\n result,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nconst JSON_HUB_PROTOCOL_NAME = \"json\";\r\n/** Implements the JSON Hub Protocol. */\r\nexport class JsonHubProtocol {\r\n constructor() {\r\n /** @inheritDoc */\r\n this.name = JSON_HUB_PROTOCOL_NAME;\r\n /** @inheritDoc */\r\n this.version = 1;\r\n /** @inheritDoc */\r\n this.transferFormat = TransferFormat.Text;\r\n }\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * @param {string} input A string containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n parseMessages(input, logger) {\r\n // The interface does allow \"ArrayBuffer\" to be passed in, but this implementation does not. So let's throw a useful error.\r\n if (typeof input !== \"string\") {\r\n throw new Error(\"Invalid input for JSON hub protocol. Expected a string.\");\r\n }\r\n if (!input) {\r\n return [];\r\n }\r\n if (logger === null) {\r\n logger = NullLogger.instance;\r\n }\r\n // Parse the messages\r\n const messages = TextMessageFormat.parse(input);\r\n const hubMessages = [];\r\n for (const message of messages) {\r\n const parsedMessage = JSON.parse(message);\r\n if (typeof parsedMessage.type !== \"number\") {\r\n throw new Error(\"Invalid payload.\");\r\n }\r\n switch (parsedMessage.type) {\r\n case MessageType.Invocation:\r\n this._isInvocationMessage(parsedMessage);\r\n break;\r\n case MessageType.StreamItem:\r\n this._isStreamItemMessage(parsedMessage);\r\n break;\r\n case MessageType.Completion:\r\n this._isCompletionMessage(parsedMessage);\r\n break;\r\n case MessageType.Ping:\r\n // Single value, no need to validate\r\n break;\r\n case MessageType.Close:\r\n // All optional values, no need to validate\r\n break;\r\n default:\r\n // Future protocol changes can add message types, old clients can ignore them\r\n logger.log(LogLevel.Information, \"Unknown message type '\" + parsedMessage.type + \"' ignored.\");\r\n continue;\r\n }\r\n hubMessages.push(parsedMessage);\r\n }\r\n return hubMessages;\r\n }\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string} A string containing the serialized representation of the message.\r\n */\r\n writeMessage(message) {\r\n return TextMessageFormat.write(JSON.stringify(message));\r\n }\r\n _isInvocationMessage(message) {\r\n this._assertNotEmptyString(message.target, \"Invalid payload for Invocation message.\");\r\n if (message.invocationId !== undefined) {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Invocation message.\");\r\n }\r\n }\r\n _isStreamItemMessage(message) {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for StreamItem message.\");\r\n if (message.item === undefined) {\r\n throw new Error(\"Invalid payload for StreamItem message.\");\r\n }\r\n }\r\n _isCompletionMessage(message) {\r\n if (message.result && message.error) {\r\n throw new Error(\"Invalid payload for Completion message.\");\r\n }\r\n if (!message.result && message.error) {\r\n this._assertNotEmptyString(message.error, \"Invalid payload for Completion message.\");\r\n }\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Completion message.\");\r\n }\r\n _assertNotEmptyString(value, errorMessage) {\r\n if (typeof value !== \"string\" || value === \"\") {\r\n throw new Error(errorMessage);\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { DefaultReconnectPolicy } from \"./DefaultReconnectPolicy\";\r\nimport { HttpConnection } from \"./HttpConnection\";\r\nimport { HubConnection } from \"./HubConnection\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { Arg, ConsoleLogger } from \"./Utils\";\r\nconst LogLevelNameMapping = {\r\n trace: LogLevel.Trace,\r\n debug: LogLevel.Debug,\r\n info: LogLevel.Information,\r\n information: LogLevel.Information,\r\n warn: LogLevel.Warning,\r\n warning: LogLevel.Warning,\r\n error: LogLevel.Error,\r\n critical: LogLevel.Critical,\r\n none: LogLevel.None,\r\n};\r\nfunction parseLogLevel(name) {\r\n // Case-insensitive matching via lower-casing\r\n // Yes, I know case-folding is a complicated problem in Unicode, but we only support\r\n // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.\r\n const mapping = LogLevelNameMapping[name.toLowerCase()];\r\n if (typeof mapping !== \"undefined\") {\r\n return mapping;\r\n }\r\n else {\r\n throw new Error(`Unknown log level: ${name}`);\r\n }\r\n}\r\n/** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */\r\nexport class HubConnectionBuilder {\r\n configureLogging(logging) {\r\n Arg.isRequired(logging, \"logging\");\r\n if (isLogger(logging)) {\r\n this.logger = logging;\r\n }\r\n else if (typeof logging === \"string\") {\r\n const logLevel = parseLogLevel(logging);\r\n this.logger = new ConsoleLogger(logLevel);\r\n }\r\n else {\r\n this.logger = new ConsoleLogger(logging);\r\n }\r\n return this;\r\n }\r\n withUrl(url, transportTypeOrOptions) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isNotEmpty(url, \"url\");\r\n this.url = url;\r\n // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed\r\n // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.\r\n if (typeof transportTypeOrOptions === \"object\") {\r\n this.httpConnectionOptions = { ...this.httpConnectionOptions, ...transportTypeOrOptions };\r\n }\r\n else {\r\n this.httpConnectionOptions = {\r\n ...this.httpConnectionOptions,\r\n transport: transportTypeOrOptions,\r\n };\r\n }\r\n return this;\r\n }\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.\r\n *\r\n * @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.\r\n */\r\n withHubProtocol(protocol) {\r\n Arg.isRequired(protocol, \"protocol\");\r\n this.protocol = protocol;\r\n return this;\r\n }\r\n withAutomaticReconnect(retryDelaysOrReconnectPolicy) {\r\n if (this.reconnectPolicy) {\r\n throw new Error(\"A reconnectPolicy has already been set.\");\r\n }\r\n if (!retryDelaysOrReconnectPolicy) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy();\r\n }\r\n else if (Array.isArray(retryDelaysOrReconnectPolicy)) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);\r\n }\r\n else {\r\n this.reconnectPolicy = retryDelaysOrReconnectPolicy;\r\n }\r\n return this;\r\n }\r\n /** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.\r\n *\r\n * @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.\r\n */\r\n build() {\r\n // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one\r\n // provided to configureLogger\r\n const httpConnectionOptions = this.httpConnectionOptions || {};\r\n // If it's 'null', the user **explicitly** asked for null, don't mess with it.\r\n if (httpConnectionOptions.logger === undefined) {\r\n // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.\r\n httpConnectionOptions.logger = this.logger;\r\n }\r\n // Now create the connection\r\n if (!this.url) {\r\n throw new Error(\"The 'HubConnectionBuilder.withUrl' method must be called before building the connection.\");\r\n }\r\n const connection = new HttpConnection(this.url, httpConnectionOptions);\r\n return HubConnection.create(connection, this.logger || NullLogger.instance, this.protocol || new JsonHubProtocol(), this.reconnectPolicy);\r\n }\r\n}\r\nfunction isLogger(logger) {\r\n return logger.log !== undefined;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r\n/** Indicates the severity of a log message.\r\n *\r\n * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r\n */\r\nexport var LogLevel;\r\n(function (LogLevel) {\r\n /** Log level for very low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Trace\"] = 0] = \"Trace\";\r\n /** Log level for low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Debug\"] = 1] = \"Debug\";\r\n /** Log level for informational diagnostic messages. */\r\n LogLevel[LogLevel[\"Information\"] = 2] = \"Information\";\r\n /** Log level for diagnostic messages that indicate a non-fatal problem. */\r\n LogLevel[LogLevel[\"Warning\"] = 3] = \"Warning\";\r\n /** Log level for diagnostic messages that indicate a failure in the current operation. */\r\n LogLevel[LogLevel[\"Error\"] = 4] = \"Error\";\r\n /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r\n LogLevel[LogLevel[\"Critical\"] = 5] = \"Critical\";\r\n /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r\n LogLevel[LogLevel[\"None\"] = 6] = \"None\";\r\n})(LogLevel || (LogLevel = {}));\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// This will be treated as a bit flag in the future, so we keep it using power-of-two values.\r\n/** Specifies a specific HTTP transport type. */\r\nexport var HttpTransportType;\r\n(function (HttpTransportType) {\r\n /** Specifies no transport preference. */\r\n HttpTransportType[HttpTransportType[\"None\"] = 0] = \"None\";\r\n /** Specifies the WebSockets transport. */\r\n HttpTransportType[HttpTransportType[\"WebSockets\"] = 1] = \"WebSockets\";\r\n /** Specifies the Server-Sent Events transport. */\r\n HttpTransportType[HttpTransportType[\"ServerSentEvents\"] = 2] = \"ServerSentEvents\";\r\n /** Specifies the Long Polling transport. */\r\n HttpTransportType[HttpTransportType[\"LongPolling\"] = 4] = \"LongPolling\";\r\n})(HttpTransportType || (HttpTransportType = {}));\r\n/** Specifies the transfer format for a connection. */\r\nexport var TransferFormat;\r\n(function (TransferFormat) {\r\n /** Specifies that only text data will be transmitted over the connection. */\r\n TransferFormat[TransferFormat[\"Text\"] = 1] = \"Text\";\r\n /** Specifies that binary data will be transmitted over the connection. */\r\n TransferFormat[TransferFormat[\"Binary\"] = 2] = \"Binary\";\r\n})(TransferFormat || (TransferFormat = {}));\r\n"],"x_google_ignoreList":[112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134]}