{"version":3,"sources":["webpack/bootstrap","webpack:///./src/Authentication/src/styles.sass?5433","./src/Common/data/data-service.class.ts","./src/Common/bootstrap/bootstrap_data.service.ts","./src/Common/user/user_data.service.ts","./src/Common/common-base-entity.class/common-base-entity.class.ts","./src/Common/general_settings/general_settings.service.ts","./environments/environment.prod.ts","./src/Common/controls/textfield/textfield.tests.spec.ts","./src/Common/notification/notification.service.ts","./src/Common/locale/locale.service.ts","./dist/Content/conf.js","./src/Common/app/app.config.token.ts","./src/Common/common-base-service.class/common-base-service.class.ts","./src/Common/bootstrap/bootstrap.service.ts","./src/Common/utilities/performance-check-utils/performance-check-utils.ts","./src/Common/vendor/vendor.module.ts","./node_modules/moment/locale sync (en|fr|ru|pt)(-gb)","./src/Common/app_data/app_data.service.ts","./src/Common/locale/locale-http-loader.class.ts","./src/Common/locale/translation_compiler.service.ts","./src/Common/locale/locale.module.ts","./src/Common/interceptors/relative-requests-interceptor.service.ts","./src/Common/modules_placeholders/modules_placeholders.service.ts","./src/Common/interceptors/error-interceptor.service.ts","./src/Common/interceptors/request-count-interceptor.service.ts","./src/Common/pipes/escape_bracket_replace.filter.ts","./src/Common/context-menu/context-menu.service/common-context-menu.interfaces.ts","./src/Common/utilities/style-utils/common-animate-styles.ts","./src/Common/constants/common_animate_duration.constant.ts","./src/Common/utilities/point.ts","./src/Common/utilities/rect.ts","./src/Common/events/services/events.service.ts","./src/Common/content-wrapper/common-content-wrapper.service.ts","./src/Common/content-wrapper/common-content-wrapper.interfaces.ts","./src/Common/context-menu/context-menu.service/common-context-menu.service.ts","./src/Common/controls/control/throttler_milliseconds.constant.ts","./src/Common/context-menu/context-menu.service/common-context-menu.factory.ts","./src/Common/popup/popup-options.ts","./src/Common/popup/constants/popup-action-type.constant.ts","./src/Common/popup/popup.ts","./src/Common/controls/control/hot_keys.constant.ts","./src/Common/popup/constants/popup-class-names.constant.ts","./src/Common/popup/components/popup-header-wrapper/popup-header-wrapper.component.ts","./src/Common/popup/components/popup-header-wrapper/popup-header-wrapper.component.pug","./src/Common/controls/control/debug/debug.service.ts","./src/Common/controls/control/debug/debug.decorator.ts","./src/Common/utilities/core.service.ts","./src/Common/base_component/base.component.ts","./src/Common/context-menu/context-menu.service/components/common-context-menu-base-screen.component.ts","./src/Common/context-menu/actions-dropdown.component/common-actions-dropdown.interfaces.ts","./src/Common/context-menu/actions-dropdown.component/components/common-actions-dropdown-option/common-actions-dropdown-option.component.pug","./src/Common/context-menu/actions-dropdown.component/components/common-actions-dropdown-option/common-actions-dropdown-option.component.ts","./src/Common/context-menu/actions-dropdown.component/components/common-actions-dropdown-options-list/common-actions-dropdown-options-list.component.pug","./src/Common/context-menu/actions-dropdown.component/components/common-actions-dropdown-options-list/common-actions-dropdown-options-list.component.ts","./src/Common/utilities/html/get-closest.ts","./src/Common/utilities/html/string-to-html-elements.ts","./src/Common/constants/keyboard.constant.ts","./src/Common/base-focused-component/common-focused-base.component.ts","./src/Common/base-focused-button-component/common-focused-button-base.component.ts","./src/Common/blocks/dialog/common-dialog-button.component/common-dialog-button.component.ts","./src/Common/blocks/dialog/common-dialog-button.component/common-dialog-button.component.pug","./src/Common/loader/components/loader/loader.component.pug","./src/Common/loader/components/loader/loader.component.ts","./src/Common/loader/const/loader-default-delay-timeout.ts","./src/Common/blocks/dialog/common-dialog.component.pug","./src/Common/blocks/dialog/common-dialog.component.ts","./src/Common/blocks/dialog/common-dialog-context-menu-screen.component/common-dialog-context-menu-screen.component.ts","./src/Common/blocks/dialog/common-dialog-context-menu-screen.component/common-dialog-context-menu-screen.component.pug","./src/Common/debug/common-debug.service.ts","./src/Common/context-menu/actions-dropdown.component/common-actions-dropdown.component.ts","./src/Common/popup/components/popup-container/popup-container.component.pug","./src/Common/popup/components/popup-container/popup-container.component.ts","./src/Common/popup/constants/popup-data.constant.ts","./src/Common/popup/components/popup-overlay-background/popup-overlay-background.component.ts","./src/Common/popup/components/popup-loader/popup-loader.component.ts","./src/Common/popup/components/popup-loader/popup-loader.component.pug","./src/Common/popup/constants/popup-on-load-data.constant.ts","./src/Common/popup/services/popup.service.ts","./src/Common/permissions/constants/common-permissions-operator.enum.ts","./src/Common/permissions/services/permissions.service.ts","./src/Common/dialog-factory/services/dialog-popup.service.ts","./src/Common/hotkey/services/hotkey.service.ts","./src/Common/permissions/services/permissions-parsers.service.ts","./src/Common/permissions/permissions.module.ts","./src/Common/loader/loader.module.ts","./src/Common/blocks/dialog/common-dialog.module.ts","./src/Common/context-menu/actions-dropdown.component/common-actions-dropdown.module.ts","./src/Common/popup/popup.module.ts","./src/Common/hotkey/hotkey.module.ts","./src/Common/pipes/two_digits_number.pipe.ts","./src/Common/pipes/seconds_formatter.pipe.ts","./src/Common/pipes/safe-html.pipe.ts","./src/Common/pipes/common-title.pipe.ts","./src/Common/server_date/server_date.service.ts","./src/Common/utilities/string/replace-at.ts","./src/Common/pipes/common-na-format.pipe.ts","./src/Common/pipes/common-date.pipe.ts","./src/Common/constants/common-default-number.constants.ts","./src/Common/pipes/common-pretty-number.pipe.ts","./src/Common/pipes/common-remove-html-tags.pipe.ts","./src/Common/pipes/common-number-formatter.pipe.ts","./src/Common/pipes/common-number-with-currency-formatter.pipe.ts","./src/Common/utilities/number-to-fixed-decimals.ts","./src/Common/utilities/number-fixed-IEEE754-format.ts","./src/Common/pipes/common-list-formatter.pipe.ts","./src/Common/pipes/common-recipients-list-formatter.pipe.ts","./src/Common/pipes/common-line-to-br.pipe.ts","./src/Common/pipes/common-list-items-filter.pipe.ts","./src/Common/pipes/common-hotkey-info.pipe.ts","./src/Common/pipes/common-percent-formatter.pipe.ts","./src/Common/pipes/common-switch-sign-of-number-formatter.pipe.ts","./src/Common/pipes/safe-resorce-url.pipe.ts","./src/Common/pipes/capitalize.pipe.ts","./src/Common/pipes/pipes.module.ts","./src/Common/url_filters/filters_to_url.service.ts","./src/Common/url_filters/filters_from_url.service.ts","./src/Common/url_filters/common_url_filters.module.ts","./src/Common/logger/common-logger.service.ts","./src/Common/error-handler.service/error-handler.service.ts","./src/Common/page-title/page-title.service.ts","./src/Common/page-title/page-title.module.ts","./src/Common/content-wrapper/common-content-wrapper.module.ts","./src/Common/user/user-data-upgraded.service.ts","./src/Common/app/fonts/app-fonts.module.ts","./src/Common/app_data/app-data.module.ts","./src/Common/user/user-data.module.ts","./src/Common/interfaces/common-http-method-type.enum.ts","./src/Common/base-list-resource.service/common-base-list-resource-default-request-params.constant.ts","./src/Common/base-list-resource.service/common-base-list-resource.service.ts","./src/Common/general_settings/days-of-week/services/general-settings-days-of-week-resource.service.ts","./src/Common/controls/base-dictionary.service/common-base-dictionary.service.ts","./src/Common/general_settings/days-of-week/services/general-settings-days-of-week-dictionary.service.ts","./src/Common/general_settings/days-of-week/general-settings-days-of-week.module.ts","./src/Common/general_settings/general-settings.module.ts","./src/Common/server_date/server-date.module.ts","./src/Common/interceptors/shared-link-interceptor.service.ts","./src/Common/interceptors/headers-interceptor.service.ts","./src/Common/resource/resource.class.ts","./src/Common/resource/decorators/resource-action.decorator.ts","./src/Common/common-check-inactive/services/common-check-inactive-resource.service.ts","./src/Common/common-check-inactive/services/common-check-inactive.service.ts","./src/Common/common-check-inactive/common-check-inactive.module.ts","./src/Common/app/app.module.ts","./src/Authentication/src/authentication/services/authentication_error.service.ts","./src/Common/app-name/common-app-name.component.ts","./src/Common/app-name/common-app-name.component.pug","./src/Authentication/src/authentication/authentication.app_config.constant.ts","./src/Authentication/src/authentication/authentication.component.ts","./src/Authentication/src/authentication/authentication.component.pug","./src/Common/control_validators/minlength/minlength.module.ts","./src/Common/control_validators/maxlength/maxlength.module.ts","./src/Common/control_validators/common-validator.ts","./src/Common/control_validators/required/required.validator.ts","./src/Common/control_validators/required/required.module.ts","./src/Common/control_validators/pattern/pattern.module.ts","./src/Common/control_validators/data_validation.constant.ts","./src/Common/control_validators/email/email.validator.ts","./src/Common/control_validators/email/email.module.ts","./src/Common/control_validators/match/match.module.ts","./src/Common/control_validators/multiple-field-required/multiple-field-required.module.ts","./src/Common/control_validators/required-id.directive/common-required-id.validator.ts","./src/Common/control_validators/required-id.directive/required-id.module.ts","./src/Common/control_validators/min/min.module.ts","./src/Common/control_validators/max/max.module.ts","./src/Common/control_validators/back-end/back-end.validator.ts","./src/Common/control_validators/back-end/back-end.module.ts","./src/Common/controls/control/validation/validation.module.ts","./src/Common/controls/textfield/inputmasks_aliases_service.ts","./src/Common/dictionaries/common-count-zeros.dictionary.service.ts","./src/Common/controls/textfield/textfield.module.ts","./src/Common/control_validators/choose_true/choose_true.module.ts","./src/Common/controls/checkbox/checkbox.module.ts","./src/Common/directives/common_autofocus/common_autofocus.module.ts","./src/Common/app-name/common-app-name.module.ts","./src/Authentication/src/authentication/authentication.common.module.ts","./src/Authentication/src/user/user_authentication.service.ts","./src/Common/form/common-form-submitters.component/common-form-submitters.component.pug","./src/Common/form/common-form-submitters.component/common-form-submitters.component.ts","./src/Common/form/common-form.component/common-form.component.ts","./src/Common/controls/control/control.class.ts","./src/Common/controls/control/control_status.constant.ts","./src/Common/controls/control/validation/default_error_messages.constant.ts","./src/Common/controls/control/validation/validation.component.pug","./src/Common/controls/control/validation/validation.component.ts","./src/Common/control_validators/multiple-field-required/multiple-field-required.directive.ts","./src/Common/control_validators/common-required-group/common-required-group.validator.ts","./src/Common/files-uploading/file-uploading.validator/common-file-uploading.validator.ts","./src/Common/control_validators/mask/mask.validator.ts","./src/Common/controls/textfield/textfield.component.pug","./src/Common/controls/textfield/textfield.component.ts","./src/Common/controls/control/autocomplete_off_property.constant.ts","./src/Common/control_validators/email/email.directive.ts","./src/Common/control_validators/required/required.directive.ts","./src/Common/directives/common_autofocus/common_autofocus.directive.ts","./src/Authentication/src/login/login.component.pug","./src/Authentication/src/login/login.component.ts","./src/Common/control_validators/match/match.validator.ts","./src/Common/control_validators/match/match.directive.ts","./src/Authentication/src/reset_password/reset_password.component.ts","./src/Authentication/src/reset_password/reset_password.component.pug","./src/Authentication/src/registration_link/registration_link.component.pug","./src/Authentication/src/registration_link/registration_link.component.ts","./src/Authentication/src/routes/routes.constant.ts","./src/Authentication/src/routes/router.config.ts","./src/Authentication/src/registration_link/registration-link-error.hook.ts","./src/Common/app/app.main.init.ts","./src/Authentication/src/authentication/authentication.module.ts","./src/Authentication/src/main.ts","./src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/vendor/element.prototype.polyfills.js","./src/Common/browser/common-browser.service.ts","./src/Common/constants/common.constants.ts","./$_lazy_route_resource lazy namespace object"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","splice","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","data$","setData","this","next","getData","setDataByPath","getDataByPath","path","http","commonBootstrapService","commonGeneralSettingsService","appConfig","init","shouldLoadData","promise","bootstrapApiUrl","AppBootstrap","Promise","resolve","location","origin","toPromise","then","from","CommonBootstrapDataService","commonBootstrapDataService","isInitialized","requestOptions","withCredentials","headers","UserData","res","forkJoin","of","Result","post","login","environment","config","password","pipe","mergeMap","shareReplay","map","userData","userDataFromConf","subscribe","user","wait","getUserAvatarUrl","id","size","USER_AVATAR_SIZE","standart","multiplier","devicePixelRatio","downloadFilesAPIUrl","getUserForSuggest","Id","Name","DisplayName","CommonUserDataService","injector","commonLocaleService","instant","params","getSrcServiceAsDataSource","serviceType","options","srcService","CommonBaseEntityClassWithoutInjectable","CommonBaseEntityClass","init$","generalSettings","bootstrap","getBootstrap","setGeneralSettings","GeneralSettings","getGeneralSettings","hasMeridiem","timeFormat","PmDesignator","AmDesignator","CommonGeneralSettingsService","production","locale","language","DEV_SPECS","NOTIFICATION_HEIGHT","NOTIFICATION_TIMEOUT","notificationsQueue","_queue","add","noty","queued","remove","shownCache","animationStartEvents","$body","$","isIE","browser","defaultView","show","title","body","type","notificationId","shownItem","item","isClosing","restartClosingTimer","getMessage","setTimeout","createNotification","text","icon","iconType","buttons","handleResponseError","response","errorHeader","exceptionDetailUrl","ExceptionDetailUrl","notificationParams","errorText","Error","errorType","callback","open","toLowerCase","createNotificationLayout","$buttons","append","createNotificationButtons","$element","addClass","join","button","commonAttrs","$button","className","href","openInCurrentWindow","on","closeAfterClick","close","getMaxVisible","Math","floor","innerHeight","getContainer","$notificationsContainer","find","layout","showNext","startClosingTimer","timer","timeout","endClosingTimer","clearTimeout","onAnimationEnd","animationDuration","animateAll","children","each","elementIndex","element","bottom","cacheItem","cacheIndex","height","css","showNotification","shown","truncate","outerHeight","animation","removeClass","off","closeNotification","defaults","objValue","srcValue","concat","document","querySelector","bodyEl","CommonNotificationService","translateService","commonUserDataService","LocaleData","localeKey","translations","setTranslation","localeData","setDefaultLang","use","setFormats","dateFormat","longDateFormat","LT","Format","L","ShortFormat","LL","LLL","LLLL","LTS","meridiemParse","RegExp","isPM","input","meridiem","hours","week","doy","dow","IndexNumber","setTimeZone","userTimeZone","setDefault","IanaId","CommonLocaleService","COMMON_APP_CONFIG","destroy$","takeUntilDestroy","destroy","complete","CommonBaseServiceWithoutInjectable","CommonBaseService","CommonBootstrapService","isPerformanceCheckEnabled","win","AppData","IsPerformanceCheckEnabled","isAppPerformanceCreated","AppPerformance","measures","timings","sourcesInitialized","onBeforeStateLoading","onSuccessStateLoading","CommonVendorModule","webpackContext","req","webpackContextResolve","e","code","keys","commonAppDataServiceFactory","getTranslation","lang","localeUrl","compileTranslations","resolveReferences","matches","match","foundKey","console","error","CommonTranslationCompiler","initCommonLocaleService","CommonLocaleModule","provide","useFactory","multi","deps","forRoot","loader","useClass","CommonLocaleHttpLoader","compiler","commonAppDataService","appData","intercept","isAbsoluteUrl","url","handle","cloneReq","clone","appFullLocationUrl","indexOf","CommonRelativeRequestsInterceptor","modulesPlaceholdersList","registerOldInjector","$injector","registerPlaceholder","placeholderObject","getPlaceholder","invokePlaceholder","placeholder","providers","dependency","oldContext","CommonModulesPlaceholders","commonNotificationService","commonModulesPlaceholders","isIgnoreNotification","delete","warningText","Warning","warningHeader","WarningHeader","warningType","WarningType","warningTypeConfigs","warningTypes","catchError","status","throwError","CommonErrorInterceptor","requests","Observable","observer","subscription","event","decreaseCount","err","unsubscribe","CommonRequestCountInterceptor","transform","str","replace","CommonEscapedBracketReplace","COMMON_CONTEXT_MENU_EVENT_NAME","COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS","COMMON_CONTEXT_MENU_ATTACHMENTS","COMMON_CONTEXT_MENU_VERTICAL_ATTACHMENTS","commonAnimateStyles","savedComputedStyle","getComputedStyle","transitionStyleNames","entries","styles","styleName","start","end","postfix","style","transition","duration","requestAnimationFrame","ANIMATE_DURATION","x","y","max","point","min","sub","Point","lt","rb","args","elem","rawRect","getBoundingClientRect","left","top","right","mergeRects","filter","rect","forEach","getCenter","center","Rect","isHasCollision","eventsSubject","Subject","emit","payload","CommonEventsService","CommonContentWrapperService","COMMON_CONTENT_WRAPPER_EVENT","COMMON_CONTEXT_MENU_DATA","COMMON_CONTEXT_MENU_ENTITY","CONTEXT_MENU_SCREEN_ELEMENT_CLASS","COMMON_CONTEXT_MENU_OPENED_FLAG","BehaviorSubject","TARGET_EL_OPENED_CONTEXT_MENU_CLASS","CONTEXT_MENU_IN_ANIMATE_CLASS","ANIMATION_DIRECTIONS","LEFT_TO_RIGHT","oldElement","newElement","RIGHT_TO_LEFT","activeScreenName","activeScreenElem","activeScreenComponentPortal","activeScreenComponentRef","isOpen","isInAnimate","dismissClickIgnore","containersForPosition","cssClasses","cssAdditionalClasses","withOpenAnimate","withChangeScreenAnimate","attachment","LEFT","verticalAttachment","BOTTOM","containerXOffset","containerYOffset","targetXOffset","targetYOffset","preparedOptionsDismissClickIgnore","preparedOptionsContainersForPosition","contextMenuContainerEl","contextMenuEl","contextMenuBodyEl","hostPortal","renderer","domEventListeners","subscriptions","openUpDirection","eventSubjects","Map","defAnimates","reduce","directionRules","newScreenElm","oldScreenElm","heightControlling","offsetHeight","setStyle","parentNode","newWidth","offsetWidth","oldWidth","widthDifference","currentLeft","parseInt","CENTER","RIGHT","maxHeight","noScrollHeight","setHeightScrollElem","contextHeight","calcNoScrollHeight","appendChild","all","width","opacity","removeChild","assign","rendererFactory","createRenderer","bodyElement","selectRootElement","htmlElement","scrollContainer","Array","isArray","convertToHTMLElement","parentEl","appendToBody","targetEl","createElement","getContextMenuElAttachmentClass","shouldStopClickPropagation","addEventListener","stopPropagation","listener","dismissClickHandler","capture","screens","portalScreen","reposition","resize","listen","emitEvent","AFTER_CLICK","MOUSEENTER","MOUSELEAVE","commonContentWrapperService","merge","fromEvent","AFTER_RESIZE","debounceTime","emitEventAfterAnimationFrame","AFTER_OPEN","onEvent","eventName","getEventSubject","asObservable","emitCustomEvent","getActiveScreen","isActive","activeScreenOptions","isOpened","changeScreenToDefault","animationName","canChangeScreenTo","changeScreenTo","screenName","oldHostPortal","oldScreenElem","animate","detach","run","AFTER_CHANGE_SCREEN","reject","contextMenuRect","isRightAlign","coords","contextMenuBodyRect","contextMenuSizes","targetRect","calcTargetRect","containerRect","calcContainerRect","calcContextMenuRect","checkAndUpdateOpenUpDirection","applyDirection","applyContainerRestrictions","calcMaxHeight","getCoords","applyContainerOffset","styleValue","withReposition","activeScreenHeight","activeScreenHeightControlling","scrollElement","scrollElementScrollTop","scrollTop","BEFORE_CLOSE","AFTER_CLOSE","removeEventListener","events","delayTime","delay","animationFrame","observeOn","has","set","screen","findParentElement","target","nativeElement","node","compareWithNode","createInjector","screenData","injectorTokens","WeakMap","injectedTokens","injectedToken","token","findElementWithPosition","position","getPropertyValue","includes","offset","noScrollElements","querySelectorAll","el","rightAlign","leftAlign","openUp","doesNotFitDown","preferredUp","TOP","leftPointX","rightPointX","maxBottom","maxRight","minLeft","minTop","containersForPositionRect","containerSize","getContainerSize","bodyRect","useLeft","useRight","Infinity","useTop","useBottom","documentElement","clientWidth","clientHeight","targetElOffset","portalInjector","component","attach","instance","ngAfterViewInit$","openedContextMenus","Set","closeOtherContextMenu","closeContextMenuById","contextMenu","first","CommonContextMenuFactory","popupOverlayClasses","popupClasses","showExternalCloseIcon","showHeader","closeOnNext","closePrev","withControlOpenState","contextMenuItems","COMMON_POPUP_ACTION_TYPE","overlayRef","containerInstance","isHidden","defaultCloseData","onEventSubject","keydownEvents","keyCode","eventType","onAfterClose","onSuccessful","IsSuccess","hide","BEFORE_HIDE","tap","AFTER_HIDE","BEFORE_SHOW","show$","AFTER_SHOW","CUSTOM","emitClickAdditionTitle","CLICK_ADDITION_TITLE","popupResult","render","contentRef","attachComponentPortal","componentInstance","headerComponent","headerContentRef","attachHeaderComponentPortal","headerComponentInstance","runUpdate","isCloseOnNext","COMMON_POPUP_CLASS_NAMES","CommonPopupHeaderWrapperComponent","commonDebugComponentService","configs","components","parseField","state","newState","field","parseConfig","props","states","testsFile","rows","split","row","test","level","tests","saveConfig","CommonDebugComponentService","getConfig","getApiFields","getStateFields","getDefaultProps","defaultValue","registerComponent","getComponent","configName","CONFIG_VALUE_PATH_SYMBOL","CommonDebugComponent","constructor","cancelRequestPolyfill","asyncTimeout","hasValue","customConcat","getDataFromCurrentRoute","$uiRouter","globals","$current","getTextWidth","font","div","formattedText","textDiv","innerHTML","ceil","rxFinallyOldRequest","catch","closestElem","selector","parentElement","fixedIEEE754Format","val","round","parseFloat","toFixed","CommonUtilitiesCore","arr1","arr2","outputOptions","mergeItems","array1","array2","idIndexMap","index","foundIndex","GroupByKey","GroupItemsKey","arr2group","arr1group","arr1gr","request","$cancelRequest","sharedReject","time","commonUtilitiesCoreService","providedIn","factory","modifiers","getRef","changeDetector","zone","modifierSeparator","classesSeparator","needUnbind","func","createDestroySubject","$destroy","setInterval","clearInterval","finallyFunc","timeoutWithZone","ngOnInit","debugId","componentConfigValue","ngAfterViewInit","ngAfterViewChecked","ngAfterContentInit","ngOnChanges","changes","ngOnDestroy","defaultTrackBy","defaultTrackById","defaultTrackByIdOrTempId","TempId","destroyed","detectChanges","getBaseClasses","cssBaseClass","classes","modifierClasses","modifier","getBaseClassesAsString","intervalWithZone","willUnbind","withUnbind","f","markForCheck","runOutsideAngular","observable","generatorOrNext","subscribeWithRun","preventDefault","warn","takeUntil","CommonBaseComponent","AsyncSubject","CommonContextMenuBaseScreenComponent","COMMON_ACTIONS_DROPDOWN_LABEL_TYPE","COMMON_ACTIONS_DROPDOWN_CONTENT_TYPE","COMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE","for","elementRef","labelTypes","getOptionItemClasses","option","iconClasses","CommonActionsDropdownOptionComponent","commonContextMenu","actions","CURRENT_ACTION_CHANGED","CURRENT_ACTION_SELECTED_BY_KEYBOARD","emulateClickForKeyboardSelection","isOptionEnabled","dropdownComponentApi","isActionEnabled","onOptionClickHandler","onActionClickHandler","onOptionMouseEnterHandler","onActionMouseEnterHandler","onOptionMouseLeaveHandler","onActionMouseLeaveHandler","isActiveOption","getCurrentAction","targetElementSelector","targetElement","currentOption","optionComponents","optionElement","labelType","LINK","LABEL","click","CommonActionsDropdownOptionsListComponent","getClosest","hostElement","closest","selectedElements","current","nodeType","Node","ELEMENT_NODE","COMMON_KEYBOARD_KEY","ENTER","TAB","ARROW_DOWN","ie","ARROW_UP","ARROW_LEFT","ARROW_RIGHT","END","HOME","ESCAPE","SPACE","BACKSPACE","DELETE","DIGIT_ONE","DIGIT_ZERO","MINUS","UNDERSCORE","EQUAL","PLUS","COMMA","SEMICOLON","onFocus","onBlur","isFocused","onFocusHandler","onBlurHandler","CommonFocusedBaseComponent","formTabIndex","onClickOrEnterOrSpaceHandler","$event","onAction","onTabHandler","onTab","CommonFocusedButtonBaseComponent","action","isDisabled","CommonDialogButtonComponent","isLoading","hasDelay","hasMinDuration","label","loaderClasses","loaderTopAligned","loaderWithOverlay","isShow","isMinDurationOver","delayTimeout","durationTimeout","cancelDelayTimer","cancelDurationTimer","currentValue","startLoader","stopLoading","showLoader","CommonLoaderComponent","designLink","description","ctrlLoaderClasses","ctrlLoaderTopAligned","ctrlLoaderWithOverlay","isContentLoading","disableScroll","isDisabledAcceptBtn","isShowAcceptBtn","isShowDeclineButton","isWaitingResultEnabled","onKeydownEscape","backFunc","onBackClicked","closeFunc","onCloseClicked","textFunc","getSanitizedText","domSanitizer","bypassSecurityTrustHtml","onAcceptClicked","waitResult","acceptFunc","onDeclineClicked","declineFunc","isPromise","finally","isObservable","finalize","CommonDialogComponent","COMMON_DIALOG_CONTEXT_MENU_SCREEN_INTERNAL_INTERFACE","backToDefault","internalInterface","commonDialogOptions","getDialogOptions","entity","CommonDialogContextMenuScreenComponent","performance","createPerformanceMeasure","componentName","markAName","markBName","clearMarks","clearMeasures","isMeasured","mark","now","performanceEntries","measure","getEntriesByName","performanceEntry","endTime","sendPerformanceEntryToWindow","info","stop","debouncedStop","clear","isDebugToolsEnabled","IsDebugToolsEnabled","enableDebugTools","componentRef","measureName","performanceMeasureResult","CommonDebugService","DIRECTION","commonContextMenuFactory","commonDebugService","parentRowClass","currentAction","hoveredAction","tabIndex","isEnabled","some","onClick","closeContextMenu","openContextMenu","handleKeyboardEvent","stopEvent","changeCurrentActionByDirection","DOWN","UP","openPerformanceMeasure","checkIsActionsValid","parentRowToHighlight","getPreparedActions","contextMenuOptions","default","contextMenuOptionsEvent","classList","getCurrentActionData","isKeyboardEvent","setCurrentAction","direction","getEnabledActions","isDeleteDialog","contentType","DIALOG_DELETE","DIALOG","CommonActionsDropdownComponent","alert","isHovered","isPressed","container","hostClassName","popupHeaderStyle$","isOverlapped","isVisible","classNames","display","containerEl","getContainerElement","addOverlayClassName","portal","contentPortalOutlet","headerWrapper","headerWrapperOutlet","attachTemplatePortal","setDestroyFunc","destroyFunc","getPopupClasses","toggleAnimationForOverlappedPopup","animationDelay$","removeOverlayClassName","clickOnAdditionTitle","popupRef","externalIconClose","setContextMenuItems","setContextMenuEntity","contextMenuEntity","setContextMenuOptions","setPopupHeaderStyle","isStartUp","popupBackground","contains","CommonPopupContainerComponent","COMMON_POPUP_DATA","CommonPopupOverlayBackgroundComponent","loaderClassName","CommonPopupLoaderComponent","COMMON_POPUP_ON_LOAD_DATA","overlay","transitionService","oldPopupsIntegrationMode","popups$","openPopup$","closePopup$","openFirstPopup$","closeLastPopup$","popups","onBefore","to","closeAll","createBackgroundOverlay","previousPopup","createPopup","previousPopupClosePromise","onLoadData","hideLoader","openOverlap","closePopups","applyConfigDefaults","createOverlay","popupContainer","attachPopupContainer","attachPopupContent","popupRefBeforeClose$","beforeClosePopup","popupRefAfterClose$","afterClosePopup","overlayConfig","getOverlayConfig","hasBackdrop","CommonPopupOptions","containerPortal","containerRef","injectionTokens","originalPopups","deletedPopup","dispose","nextPopup","removeBackground","backgroundComponentRef","backgroundOverlayRef","reverse","popup","defaultOptions","backgroundComponentPortal","loaderComponentPortal","loaderOverlayRef","loaderComponentRef","undefined","hideOrClosePopup","defer","CommonPopupService","COMMON_PERMISSIONS_OPERATOR","permissionsHashByNumber","permissionsHashBySection","permissionsObjHashByNumber","permissionsObjHashBySection","getPermissionsSysNameArrayBySection","sectionSysName","_getPermissionsSysNameArrayBySection","getPermissionsSysNameObjBySection","getPermissionsSysNameArrayByNumber","permissions","_getPermissionsSysNameArrayByNumber","getPermissionsSysNameObjByNumber","permissionsTransformResponse","json","parsedResponse","JSON","parse","permissionsTransformForItem","setPermissionsBootstrap","SetPermissions","hasPermission","permission","allHavePermission","items","every","entityPermissionsObj","hasPermissions","operator","AND","permissionsValue","OR","sectionPermissionsArray","pArr","permissionName","param","exec","decodeURIComponent","getCtrlPermissionsData","sectionNames","sectionName","getPermissionsBySectionSysName","SectionSysName","Permissions","binaryNumberToPermissionArray","num","inputItem","CommonPermissionsService","CommonDialogPopupService","hotkeysService","commonPopupService","commonDialogPopupService","commonPermissionsService","defaultHotkeyConfig","inCondition","isOpenContextMenu","IsClient","hotkeysByLocaleConfigs","addHotkey","hotkey","hotkey$","addShortcut","isEventOnEditor","addSequenceHotkey","addSequenceShortcut","removeHotkey","removeShortcuts","addHotkeyByLocale","extendedConfig","removeHotkeyByLocale","getLocaleHotkeyKey","replaceHotkey","hotkeys","getHotkeys","previousHotkey","foundHtmlEditor","Boolean","CommonHotkeyService","CommonPermissionsParsersService","CommonPermissionsModule","CommonLoaderModule","CommonDialogModule","CommonActionsDropdownModule","CommonPopupModule","CommonHotkeyModule","CommonTwoDigitsNumberPipe","commonTwoDigitsNumberPipe","seconds","CommonSecondsFormatterPipe","sanitizer","sanitize","HTML","CommonSafeHtmlPipe","floatLabel","CommonTitlePipe","YEARS_SYMBOL","DEFAULT_SETTINGS","firstDay","daysSymbol","monthsSymbol","yearsSymbol","secondsInMinute","minutesInHour","hoursInDay","secondsInDay","HOURS_IN_DAY","millisecInSecond","daysInWeek","datetimeFormat","workingDays","nonWorkingDays","weekDayFormat","shortDateFormat","inputDateFormat","mediumDateFormat","displayTimeFormat","maskDelimiter","shortWithTime","mediumWithTime","timeWithMedium","dateTestRegex","inputDateTestRegex","inputDateMask","inputDatePlaceholder","inputTimeMask","inputTimePlaceholder","inputFormatWithFirstZero","amDesignator","pmDesignator","inputTimeRegex","isoDateTestRegex","yearMonthDayKey","monthDayYearKey","dayMonthYearKey","dateTestRegexByYear","inputDateTestRegexByYear","regexGroupIndexMap","TIME_KEYS_FOR_DST_FIX","combineLatest","extendDateFormatsFromGeneralSettings","setInputSettings","workingDayIndexes","day","nonWorkingDaysRules","createNonWorkingRules","getMoment","dateString","isUTC","format","isDateString","isISODateTimeString","moment","getMomentFromTime","timeString","isInputTimeString","getTimezoneOffset","isChangedDates","newValues","oldValues","isSame","getLastDaysDate","daysCount","isDayOff","date","isWorkingDayInWeek","rule","dayIndex","getDiffAsDays","startDate","endDate","unix","utcOffset","period","oldHour","newHour","diff","getCountDiffHours","isValidDateFromString","maskWithoutDelimiters","month","year","dayNumber","Number","monthNumber","yearNumber","isNaN","Date","getDate","getMomentWithFixDSTShiftFromISOString","getMomentWithFixDSTShift","setMomentTimeFromDateString","momentDate","minutes","mCurrent","hour","minute","second","millisecond","getMomentWithFixDSTShiftFromInputString","isInputDateString","dateMoment","momentMonth","momentYear","daysDiff","isISODateString","toISOString","toDateString","toDisplayDateString","toDisplayTimeString","isSameOrBefore","date1","date2","convertISODateToDateTime","replacement","substring","getMonths","minutesSymbol","hoursSymbol","mask","dateFormatSettings","timeFormatSettings","MediumFormat","LongFormat","afterOrEqual","firstYear","firstMonth","secondYear","secondMonth","secondDay","StartDate","startYear","startMonth","startDayInMonth","EndDate","testDate","dayInMonth","afterStart","beforeEnd","leftShift","rightShift","normalizeHour","CommonServerDateService","utilities","toBlank","ph","CommonNAFormatPipe","COMMON_DATE_PIPE_FORMAT_TYPE","commonNAFormatter","commonServerDateService","formats","SHORT","MEDIUM","LONG","TIME","SHORT_WITH_TIME","MEDIUM_WITH_TIME","TIME_WITH_MEDIUM","WEEK_DAY","formatType","useCommonNAToBlankFormatter","CommonDatePipe","COMMON_DEFAULT_NUMBER_CONSTANTS","DECIMAL_SEPARATOR","defaultNumberDecimalSeparator","GROUP_SEPARATOR","defaultNumberGroupSeparator","DIGITS_AFTER_DECIMAL","defaultNumberDigitsAfterDecimal","toString","fixAfterDecimal","digitsAfterDecimal","decimalSeparator","groupSeparator","multiplex","pow","results","tail","replacedMain","includeTrailingZeros","decimalIndex","CommonPrettyNumberPipe","String","CommonRemoveHtmlTagsPipe","naFormatter","prettyNumberFormatter","unit","opt","CommonNumberFormatterPipe","decimals","currency","currencySymbol","isNegativeNumber","isNegativeValuesWithParentheses","IsNegativeValuesWithParentheses","skipBracketsAndSwitch","formattedNumber","fixedNumber","abs","multiplyResultParseFunc","CommonNumberWithCurrencyFormatterPipe","list","fields","foundFieldContent","fieldName","joinedResult","CommonListFormatterPipe","commonListFormatter","CommonRecipientsListFormatterPipe","CommonLineToBrPipe","searchFieldName","searchFieldValue","CommonListItemsFilterPipe","commonHotkeyService","hotkeyConfigName","hotkeyCombo","comboPart","CommonHotkeyInfoPipe","numberFormatter","CommonPercentFormatterPipe","CommonSwitchSignOfNumberFormatterPipe","sanitized","bypassSecurityTrustResourceUrl","CommonSafeResorceUrlPipe","charAt","toUpperCase","substr","CommonCapitalizePipe","CommonPipesModule","stateService","setQueryParam","transitionTo","reload","inherit","newFilter","len1","isObject","nonEmptyValue","values","valueItem","encodeURI","stringify","parseFilters","subValue","subKey","CommonFiltersToUrlService","parentPath","arrI","arrLen","isNull","isDate","uiRouter","locationService","parseVal","filterNames","search","i2","len","j2","CommonFiltersFromUrlService","decodeURI","isBoolean","CommonUrlFiltersModule","forChild","logger","initialLogger","logEnabled","log","message","logErrorEvent","CommonLoggerService","commonLoggerService","handleError","CommonErrorHandlerService","pageTitle","breadcrumbs","pageInitialTitle","isSet","isStateWatching","staticBreadcrumbs","asyncBreadcrumbs","setTitle","translationParams","translatedTitle","getTitle","setAsyncBreadcrumbs","calculateBreadcrumbs","getBreadcrumbs","startWatchingState","getModule","setBreadcrumbs","onSuccess","toState","transitionModule","isPageTitleAsync","isBreadcrumbsAsync","breadcrumb","CommonPageTitleService","CommonPageTitleModule","CommonContentWrapperModule","UserDataUpgradedServiceProvider","setUserDataInfo","getUserDataInfo","initFonts","FONT_LOADING_TIMEOUT","weight","load","CommonAppFontsModule","initCommonAppDataService","CommonAppDataModule","initCommonUserDataService","shouldAuthorize","CommonUserDataModule","COMMON_HTTP_METHOD_TYPE","COMMON_LIST_RESOURCE_DEFAULT_REQUEST_PARAMS","Page","PageSize","httpClient","method","POST","cancellable","setConfig","defaultRequestParams","requestParams","passDataToRequestThoughBody","PUT","passDataToRequestThoughParams","GET","prepareRequestParams","previousRequest","responseType","fromObject","lodash","formatter","cancelObservableRequestPolyfill","_ignoreItemsToIds","ignoreIds","_ignoreItemsToIdsFieldPath","IgnoreIds","CommonBaseListResourceService","CommonGeneralSettingsDaysOfWeekResourceService","isTree","useCache","cacheFieldName","requestCacheMap","sysName","requestPromise","isClearRequest","requestData","formatFunctions","treeFormatter","checkCache","initSrcService","applyFormatters","getDictionaries","names","promises","cacheKey","formatters","serviceRequest","requestFromCache","cloneData","dataKeys","group","Items","Group","CommonBaseDictionaryService","CommonGeneralSettingsDaysOfWeekDictionaryService","CommonGeneralSettingsDaysOfWeekModule","CommonGeneralSettingsModule","initCommonServerDateService","CommonServerDateModule","LinkToken","CommonSharedLinkInterceptor","CommonHeadersInterceptor","MANUAL_REQUEST_REJECT_ERROR","requestsMap","$action","query","cancelPrevRequest","response$","passDataToRequestThroughBody","passDataToRequestThroughParams","createRequest","prevRequest$","switchAll","share","CommonResource","CommonResourceAction","propertyKey","actionMethod","queryFormatters","parsers","parser","CommonCheckInactiveResourceService","commonCheckInactiveResourceService","pingPeriod","PingPeriod","isWaitingCheckStatus","isActiveService","inactiveInstance","onAway","onBack","startTimer","stopTimer","timeoutForClear","startPing","checkSession","ping","TimeLeft","CommonCheckInactiveService","CommonCheckInactiveModule","app","ngDoBootstrap","appModuleRunSubscribe$","appModuleRun","subscriber","mainComponent","CommonAppModule","handleSuccessResponse","validationsErrorObject","control","Errors","IsUserError","showCustomError","custom","setErrors","CustomError","onChangeFieldHandler","resource","validationCustomErrors","AuthenticationErrorService","FIRST_DOT_REGEX","firstPart","lastPart","appName","CommonAppNameComponent","authenticationAppConfig","AuthenticationComponent","CommonMinLengthValidatorModule","CommonMaxLengthValidatorModule","getValidator","context","enabled","arrayRequiredEnabled","isValid","CommonRequireValidator","CommonValidator","CommonRequiredValidatorModule","CommonPatternValidatorModule","DATA_VALIDATION","CommonEmailValidator","CommonEmailValidatorModule","CommonMatchValidatorModule","CommonMultipleFieldRequiredValidatorModule","valueId","CommonRequiredIdValidator","CommonRequiredIdValidatorModule","CommonMinValidatorModule","CommonMaxValidatorModule","CommonBackEndValidator","CommonBackEndValidatorModule","CommonValidationModule","saveCharsRegExp","tagCharsRegExp","externalTagCharsRegExp","domainRegExp","scriptNameRegExp","onlyLettersRegExp","setAliases","numberFormat","numericParams","alias","radixPoint","autoGroup","unmaskAsNumber","digits","allowMinus","numericParamsMaxDigest","integerParams","integerPositiveParams","numericParamsNoMinus","repeat","greedy","autoUnmask","showMaskOnHover","showMaskOnFocus","isComplete","buffer","dataValidation","definitions","b","validator","chr","cardNumber","getCasemTimeMask","getCasemDateMask","getCasemCardExpireMask","getCasemCardExpireMonthMask","getCasemCardExpireYearhMask","getCasemParticipantIndividualInnMask","leapday","separator","yearrange","minyear","maxyear","hourFormat","ru","en","fr","pt","CommonTextfieldInputMaskAliasesService","initCommonTextfieldInputMaskAliasesService","commonTextfieldInputMaskAliasesService","CommonTextfieldModule","CommonChooseTrueValidatorModule","CommonCheckboxModule","CommonAutofocusModule","CommonAppNameModule","AuthenticationCommonModule","changePhone","confirmPhoneCode","checkLoginCode","resendPhoneCode","resendLoginCode","remindPassword","resetPassword","register","AuthenticationUserService","isReadonly","submitTitleEdit","submitTitleCreate","cancelTitleEdit","cancelTitleCreate","onSubmit","onCancel","submitTitle","cancelTitle","setBtnTitles","onSubmitActionHandler","onCancelClickOrEnterOrSpaceHandler","DEFAULT_CANCEL_TITLE_READONLY","DEFAULT_SUBMIT_TITLE_CREATE","DEFAULT_SUBMIT_TITLE_EDIT","DEFAULT_CANCEL_TITLE","isCreateForm","CommonFormSubmittersComponent","isValidChange","isInvalidChange","blurValidationEnabled","state$","isSaving","isChanged","isDirty","reactiveForm","scrollContainerSelector","controls","onSubmitForm","formGetter","valid","onValidSubmit","scrollToInvalidControl","submitForm","setState","getValue","getState","form","formGroup","isSubmitted","submitted","changes$","ngSubmit","statusChanges","isSubmitButtonDisabled$","distinctUntilChanged","submittersComponent","isDirtyAndInvalid","invalid","valueChanges","a","invalidControls","firstInvalidControl","controlRect","registerControl","onChange","removeControl","sendRequest","request$","onFinalize","hideLoaderOnlyOnError","onError","CommonFormComponent","modelChange","ctrlClasses","enabledValidationMessages","ignoreSubmittedForm","onEnter","onKeyDown","onKeyUp","focusState","onRegisterRef","isFocused$","isShowValidation","idKey","isBgTransitionEnabled$","isHighlighted$","HIGHLIGHT_IN_TIME","HIGHLIGHT_DELAY_TIME","HIGHLIGHT_OUT_TIME","writeValue","model","onModelChange","registerOnChange","fn","onChangeForValueAccessor","registerOnTouched","onTouchedForValueAccessor","recalcShowValidation","highlight","previousValue","startHighlight","initNgModelControl","registerControlInForm","ngModelControl","formGroupDirective","formDirective","onNgModelControlChange","oldModelCtrl","_ctrl_cache_$valid","$valid","_ctrl_cache_$submitted","$submitted","$$parentForm","clearBgTransitionTimer","clearHighlightTimer","highlightTimer","bgTransitionTimer","ngDoCheck","isOldContext","previousModel","isSubmittedForm","onMouseEnterHandler","onMouseLeaveHandler","onMouseDownHandler","onMouseUpHandler","formControlDirective","getIsValid","validValue","isPendingAsyncValidation","controlIsDisabled","getIsEmpty","emitOnChange","checkIsValid","isEmpty","CommonControlComponent","DEFAULT_ERROR_MESSAGES","minLength","maxLength","incorrectDate","email","isModelControlInit","computedErrorMessages","update","setMessage","formControl","errors","errorName","customErrors","CommonValidationComponent","inputMask","inputMaskParams","inputMaskUnmaskedValue","autocomplete","hideCount","hasClearIcon","hasDebounce","isUrl","hasLoaderDelay","isUseHint","titleValue","inputValue","hintValue","isHintOn","charsLeft","isInputMaskInitialized","isOnFocusEmitDisabled","CommonTextfieldComponent","formattedModel","setInputValue","getCharsLeft","isNeedEnableHint","onHint","updateModel","inputRef","inputMaskEventRemover","inputmask","initInputMask","titleExternal","setTitleValue","isWithRightIcon","withRightIcon","isWithCount","disableHint","cancelSetModel","parseValue","setModel","checkHint","enableHint","onKeyDownInput","which","onKeyUpInput","onChangeInput","onMouseUpInput","focus","onClickHandler","oldValue","setValue","debounceSetModel","selectAll","setSelectionRange","oldModel","newModel","unMaskValue","unmaskedvalue","newValue","blur","eventHandlers","eventHandler","pop","isFinite","trim","limitTo","formatterInput","maskset","limit","parseUrlFunc","parseUrl","clearModel","mouseDownPreventDefault","onClickClearButton","onUrlClickHandler","useExisting","commonEmailValidator","validate","CommonEmailValidatorDirective","updateValueAndValidity","CommonRequiredDirective","elementSelector","trigger","firstChange","triggerFocus","CommonAutofocusDirective","authenticationUserService","commonSecondsFormatterPipe","authenticationErrorService","codeFormModel","phoneFormModel","phone","authState","isLinkSent","domainName","authFlashMessage","isPhoneConfirmState","sendLogin","Succeeded","Is2FAActive","IsPhoneConfirmed","goToConfirmCode","isPhoneConfirm","Phone","nextResendTime","NextAttemptTime","signIn","ReturnUrl","sendPhone","Login","PendingPhone","sendCode","Code","resendCode","initResendTimer","remind","hasErrors","goToLogin","backFromConfirmCode","goToRemind","returnUrl","getReturnUrl","redirect","isLocalUrl","NextPhoneConfirmationAttemptTime","stopResendTimer","resendDelaySeconds","getResendDelaySeconds","setWaitResendText","waitResendText","AuthenticationLoginComponent","changeSubscription","matchControl","CommonMatchValidator","root","commonMatch","CommonMatchValidatorDirective","uIRouter","passwordsMatch","passwords","newPassword","confirmPassword","goToLoginPage","go","reset","AuthenticationResetPasswordComponent","authenticationRoutes","isError","isRegistrationByLinkEnabled","registrationErrorTitle","registrationErrorText","InviteKey","ConfirmPassword","Password","FirstName","LastName","Email","registrationTexts","terms","privacyPolicyLink","getPrivacyPolicyLink","termsOfServiceLink","getTermsOfServiceLink","errorTitle","getErrorTitle","getErrorText","Data","AuthenticationRegistrationLinkComponent","authenticationRouterConfigFn","router","platformBrowserDynamicPromise","layoutTranslations","commonAppConfig","AuthenticationModule","useValue","otherwise","useHash","getTimerText","Layout_Reconnect_StartMessage","Layout_Reconnect_Seconds","bootstrapModule","initialLoader","moduleRef","appComponent","disable","Layout_RunError","getTime","countdownTime","setLabel","Layout_Error","Layout_Error_Message","Layout_ServerResponse","countdown","countDownSecond","WorkerGlobalScope","importScripts","HTMLDocument","Function","Element","HTMLElement","vbody","frameDocument","contentWindow","cache","shiv","childNodes","childNode","deep","elements","getElementsByTagName","nativeCreateElement","loopLimit","propertyName","nonValue","getAttribute","interval","nodeName","supportsAccessors","ERR_ACCESSORS_NOT_SUPPORTED","ERR_VALUE_ACCESSORS","_mutation","nodes","isNode","createTextNode","fragment","head","generator","getElements","one","validNode","currentStyle","qsa","Document","getElementsByQuery","checked","cloneNode","nativeFunc","webkitMatchesSelector","prepend","CharacterData","Text","navigator","userAgent","replaceWith","descriptor","nativeDefineProperty","TypeError","propertyString","hasValueOrWritable","getterType","setterType","_DOMTokenList","dpSupport","defineGetter","configurable","__defineGetter__","that","tokens","tokenMap","addIndexGetter","preop","reindex","rSpace","SyntaxError","prop","idx","ignore","force","toggle","global","createElementNS","arguments","native","addProp","THIS","gibberishProperty","tokenList","mirror","reflections","_R","visage","DOMTokenList","DocumentType","writable","argArr","docFrag","argItem","commonBrowserService","ieVersion","html","browsers","chrome","safari","firefox","unknown","supportsTransitions","transitionsTest","scrollSizes","getScrollSizes","checkIEVersion","onHiddenTab","vendors","child","tester","setAttribute","self","defaultHiddenKey","mozHiddenKey","webkitHiddenKey","msHiddenKey","mozHidden","webkitHidden","msHidden","onfocusin","hiddenKey","onchange","evt","evtMap","focusin","pageshow","focusout","pagehide","isHiddenTab","onfocusout","onpageshow","onpagehide","onfocus","onblur","9","10","11","regExp","CommonBrowser","commonConstants","downloadFilesAsPDFUrl","wopiappUrl","small","profile","popoverOpenDelay","popoverCloseDelay","scrollDownMinScrollSpace","imageFormats","inn","intNum","cardExpire","cardExpireMonth","cardExpireYear","webpackEmptyAsyncContext"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,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WAFb,S,EADb,K,kCCZA,gCAGO,IAAMC,EAAkB,CAC9BrjE,oBAAqB,eACrBsjE,sBAAuB,6BACvBC,WAAY,mBACZ3jE,iBAAkB,CACjB4jE,MAAO,GACP3jE,SAAU,GACV4jE,QAAS,KAOV/8D,kBAAmB,IACnBg9D,iBAAkB,IAClBC,kBAAmB,IACnBC,yBAA0B,IAC1Bt0B,gCAAiC,EACjCJ,8BAA+B,IAC/BE,4BAA6B,IAC7BmU,eAAgB,CACf11C,IAAK,uGACLg2D,aAAc,sCACdC,IAAK,aACLC,OAAQ,WACRC,WAAY,2BACZC,gBAAiB,oBACjBC,eAAgB,kBAChBtgB,WAAY,QACZlB,OAAQ,W,mBCjCV,SAASyhB,EAAyBt4D,GAGjC,OAAOpO,QAAQC,UAAUI,KAAK,WAC7B,IAAIiO,EAAI,IAAIzH,MAAM,uBAAyBuH,EAAM,KAEjD,MADAE,EAAEC,KAAO,mBACHD,IAGRo4D,EAAyBl4D,KAAO,WAAa,MAAO,IACpDk4D,EAAyBzmE,QAAUymE,EACnCzpE,EAAOD,QAAU0pE,EACjBA,EAAyBzkE,GAAK","file":"main.5e39887ade8125e5f230.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/Content/Authentication/\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([2,4]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","// extracted by mini-css-extract-plugin\nexport {};","import { Observable, BehaviorSubject } from 'rxjs';\r\nimport { get, cloneDeep } from 'lodash';\r\n\r\ndeclare interface ICommonDataService {\r\n\tdata$: BehaviorSubject,\r\n\tinit? (): Observable,\r\n\tsetData (data: T): void,\r\n\tgetData (): T,\r\n\tsetDataByPath (data, key: string): void,\r\n\tgetDataByPath (path: string): any,\r\n}\r\n\r\nexport abstract class CommonDataServiceClass implements ICommonDataService {\r\n\tdata$ = new BehaviorSubject(null);\r\n\r\n\tprivate data: T;\r\n\r\n\tsetData (data: T): void {\r\n\t\tthis.data = cloneDeep(data);\r\n\t\tthis.data$.next(this.data);\r\n\t}\r\n\r\n\tgetData (): T {\r\n\t\treturn cloneDeep(this.data);\r\n\t}\r\n\r\n\tsetDataByPath (data, key: string): void {\r\n\t\tthis.data[key] = cloneDeep(data);\r\n\t}\r\n\r\n\tgetDataByPath (path: string): any {\r\n\t\treturn get(this.data, path);\r\n\t}\r\n}\r\n","import { Inject, Injectable } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { from, Observable } from 'rxjs';\r\n\r\nimport { CommonDataServiceClass } from '../data/data-service.class';\r\nimport { CommonBootstrapService } from './bootstrap.service';\r\nimport { CommonGeneralSettingsService } from '../general_settings/general_settings.service';\r\nimport {\r\n\tCOMMON_APP_CONFIG,\r\n\tICommonAppConfig,\r\n} from '../app/app.config.token';\r\n\r\nconst DEFAULT_BOOTSTRAP_API_URL = 'api/bootstrap/GetBootstrap';\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonBootstrapDataService extends CommonDataServiceClass {\r\n\tconstructor (\r\n\t\tprivate http: HttpClient,\r\n\t\tprivate commonBootstrapService: CommonBootstrapService,\r\n\t\tprivate commonGeneralSettingsService: CommonGeneralSettingsService,\r\n\t\t@Inject(COMMON_APP_CONFIG) protected appConfig: ICommonAppConfig,\r\n\t) {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tinit (shouldLoadData = false): Observable {\r\n\t\tconst { appConfig: { bootstrapApiUrl } } = this;\r\n\t\tlet promise: Promise;\r\n\r\n\t\tif (window.AppBootstrap || !shouldLoadData) {\r\n\t\t\tpromise = Promise.resolve(window.AppBootstrap || {});\r\n\r\n\t\t} else if (shouldLoadData) {\r\n\t\t\tpromise = this.http\r\n\t\t\t\t.get(`${window.location.origin}/${bootstrapApiUrl || DEFAULT_BOOTSTRAP_API_URL}`)\r\n\t\t\t\t.toPromise();\r\n\t\t}\r\n\r\n\t\tpromise.then((result) => {\r\n\t\t\twindow.AppBootstrap = result;\r\n\t\t\tthis.setData(result);\r\n\t\t\tthis.commonBootstrapService.init(result);\r\n\t\t\tthis.commonGeneralSettingsService.init();\r\n\t\t});\r\n\r\n\t\treturn from(promise);\r\n\t}\r\n}\r\n","// New version src/Common/user/user_data.service.ts CommonUserDataService\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/services/user_data_service_factory.js UserDataService\r\n\r\nimport { Injectable } from '@angular/core';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { of, Observable, forkJoin } from 'rxjs';\r\nimport { mergeMap, map, shareReplay } from 'rxjs/operators';\r\nimport { get, isNull, defaultsDeep } from 'lodash';\r\n\r\nimport { CommonDataServiceClass } from '../data/data-service.class';\r\nimport { CommonBootstrapDataService } from '../bootstrap/bootstrap_data.service';\r\nimport { commonConstants } from '../constants/common.constants';\r\nimport { ICommonModel, ICommonSysNameModel, UUID } from '../interfaces/core';\r\n\r\nimport { environment } from '../../../environments/environment';\r\nimport { ICommonEntityAttributesServiceEntity } from '../custom-block/services/common-entity-attributes.service/common-entity-attributes.service';\r\nimport { ITimeZone } from '../../App/src/profile/profile-page/app-profile-time-zone-dictionary.service';\r\nimport { ICommonPermissionsModel } from '@CaseOne/Common/permissions/interfaces/permissions.interfaces';\r\n\r\n\r\nexport enum COMMON_USER_TYPE {\r\n\tUSER = 'User',\r\n\tCLIENT = 'Client',\r\n}\r\n\r\nexport interface ICommonUserShort {\r\n\tId: UUID,\r\n\tDisplayName: string,\r\n\tEmail: string,\r\n\tInitials: string,\r\n\tFileAvatarId: UUID,\r\n\tPost: string,\r\n}\r\n\r\nexport interface ICommonUser extends ICommonEntityAttributesServiceEntity, ICommonPermissionsModel {\r\n\tEmail: string,\r\n\tDisplayName: string,\r\n\tFileAvatarId: UUID,\r\n\tIsAdmin: boolean,\r\n\tIsClient: boolean,\r\n\tPendingPhone: string,\r\n\tNextPhoneConfirmationAttemptTime: number,\r\n\tIsPhoneChanged: boolean\r\n\tIsPhoneConfirmationSmsSent: boolean\r\n\tIsPhoneConfirmed: boolean\r\n\tIsTwoFactorAuthByPhoneActive: boolean,\r\n\tBranch: ICommonModel,\r\n\tCompanyName: string,\r\n\tCompanyUrl: string,\r\n\tFirstName: string,\r\n\tLastName: string,\r\n\tMiddleName: string,\r\n\tInitials: string,\r\n\tLEDESTimekeeperClassification: ICommonModel,\r\n\tLEDESTimekeeperId: string,\r\n\tPhone: string,\r\n\tPhoneCode: string,\r\n\tPost: string,\r\n\tTimeZone: ITimeZone,\r\n\tUserType: ICommonSysNameModel,\r\n\tWorkingStatus: ICommonSysNameModel,\r\n\r\n\t// Change pass\r\n\tOld?: string,\r\n\tNew?: string,\r\n\tConfirm?: string,\r\n}\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonUserDataService extends CommonDataServiceClass {\r\n\tpublic isInitialized = false;\r\n\r\n\tprivate res: Observable;\r\n\r\n\tconstructor(\r\n\t\tprivate http: HttpClient,\r\n\t\tprivate commonBootstrapDataService: CommonBootstrapDataService,\r\n\t) {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tinit(shouldLoadData = false): Observable {\r\n\t\tconst requestOptions = {\r\n\t\t\twithCredentials: true,\r\n\t\t\theaders: new HttpHeaders({\r\n\t\t\t\t'Content-Type': 'application/json;charset=UTF-8',\r\n\t\t\t}),\r\n\t\t};\r\n\r\n\t\tif (window.UserData || !shouldLoadData) {\r\n\t\t\tthis.res = forkJoin([\r\n\t\t\t\tof({ Result: window.UserData || {}}),\r\n\t\t\t\tthis.commonBootstrapDataService.init(shouldLoadData),\r\n\t\t\t]);\r\n\r\n\t\t} else if (shouldLoadData) {\r\n\t\t\tthis.res = this.http\r\n\t\t\t\t.post(\r\n\t\t\t\t\t`${window.location.origin}/authentication/account/login`,\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlogin: environment.config.login,\r\n\t\t\t\t\t\tpassword: environment.config.password,\r\n\t\t\t\t\t},\r\n\t\t\t\t\trequestOptions,\r\n\t\t\t\t)\r\n\t\t\t\t.pipe(\r\n\t\t\t\t\t// get user profile and bootstrap only after authorization\r\n\t\t\t\t\tmergeMap(() => forkJoin([\r\n\t\t\t\t\t\tthis.http.get(`${window.location.origin}/api/UserProfiles/Get`, requestOptions),\r\n\t\t\t\t\t\tthis.commonBootstrapDataService.init(shouldLoadData),\r\n\t\t\t\t\t]),\r\n\t\t\t\t))\r\n\t\t\t\t.pipe(shareReplay(1));\r\n\t\t}\r\n\r\n\t\tthis.res = this.res\r\n\t\t\t.pipe(\r\n\t\t\t\tmap((result) => {\r\n\t\t\t\t\tconst userData = get(result, '[0].Result');\r\n\t\t\t\t\tconst userDataFromConf = environment.userData;\r\n\t\t\t\t\treturn defaultsDeep(userDataFromConf, userData);\r\n\t\t\t\t}),\r\n\t\t\t);\r\n\r\n\t\tthis.res.subscribe((user) => {\r\n\t\t\twindow.UserData = user;\r\n\t\t\tthis.setData(user);\r\n\t\t\tthis.isInitialized = true;\r\n\t\t});\r\n\r\n\t\treturn this.res;\r\n\t}\r\n\r\n\twait(): Observable {\r\n\t\treturn this.res;\r\n\t}\r\n\r\n\tgetUserAvatarUrl (id: string | null, mode: string): string {\r\n\t\tconst size = commonConstants.USER_AVATAR_SIZE[mode] || commonConstants.USER_AVATAR_SIZE.standart;\r\n\t\tconst multiplier = window.devicePixelRatio > 1 ? 2 : 1;\r\n\r\n\t\treturn isNull(id) ? '' : `${commonConstants.downloadFilesAPIUrl}?id=${id || this.getDataByPath('FileAvatarId')}&width=${size * multiplier}&height=${size * multiplier}`;\r\n\t}\r\n\r\n\tgetUserForSuggest (): ICommonModel {\r\n\t\tconst user = this.getData();\r\n\r\n\t\treturn {\r\n\t\t\tId: user.Id,\r\n\t\t\tName: user.DisplayName,\r\n\t\t};\r\n\t}\r\n}\r\n","import { Directive, Injector, Type } from '@angular/core';\r\nimport {CommonLocaleService} from '../locale/locale.service';\r\nimport {ICommonDataSourceServiceOptions} from '../controls/data-source.service/common-data-source.service';\r\nimport {ICommonListResourceService} from '../base-list-resource.service/common-base-list-resource.service';\r\nimport {CommonBaseDictionaryService} from '../controls/base-dictionary.service/common-base-dictionary.service';\r\n\r\n@Directive()\r\nexport class CommonBaseEntityClassWithoutInjectable {\r\n\tprotected commonLocaleService = this.injector.get(CommonLocaleService);\r\n\r\n\tconstructor(\r\n\t\tprotected injector: Injector,\r\n\t) {}\r\n\r\n\tprotected instant(key: string, params?: {}): string {\r\n\t\treturn this.commonLocaleService.instant(key, params);\r\n\t}\r\n\r\n\tprotected getSrcServiceAsDataSource (\r\n\t\tserviceType: Type,\r\n\t\toptions?: Partial,\r\n\t): ICommonDataSourceServiceOptions {\r\n\t\treturn {\r\n\t\t\tsrcService: this.injector.get(serviceType),\r\n\t\t\t...options,\r\n\t\t};\r\n\t}\r\n}\r\n\r\n// tslint:disable:max-classes-per-file\r\n@Directive()\r\nexport class CommonBaseEntityClass extends CommonBaseEntityClassWithoutInjectable {\r\n\tconstructor(\r\n\t\tprotected injector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport {\r\n\tassign,\r\n\tcloneDeep,\r\n\tget,\r\n} from 'lodash';\r\n\r\nimport { CommonBootstrapService } from '../bootstrap/bootstrap.service';\r\nimport { BehaviorSubject } from 'rxjs';\r\n\r\n@Injectable()\r\nexport class CommonGeneralSettingsService {\r\n\tprivate init$ = new BehaviorSubject(false);\r\n\tprivate generalSettings = {};\r\n\r\n\tconstructor (private commonBootstrapService: CommonBootstrapService) {}\r\n\r\n\tinit (): Promise {\r\n\t\treturn new Promise((resolve) => { // for APP_INITIALIZER\r\n\t\t\tconst bootstrap = this.commonBootstrapService.getBootstrap();\r\n\r\n\t\t\tif (bootstrap) {\r\n\t\t\t\tthis.setGeneralSettings(bootstrap.GeneralSettings);\r\n\t\t\t}\r\n\r\n\t\t\tthis.init$.next(true);\r\n\t\t\tresolve(true);\r\n\t\t});\r\n\t}\r\n\r\n\tsetGeneralSettings (data: {}): void {\r\n\t\tassign(this.generalSettings, data);\r\n\t}\r\n\r\n\tgetGeneralSettings (key?: string) {\r\n\t\treturn cloneDeep(key ? get(this.generalSettings, key) : this.generalSettings);\r\n\t}\r\n\r\n\thasMeridiem (): boolean {\r\n\t\tconst timeFormat = this.getGeneralSettings('TimeFormat');\r\n\r\n\t\treturn timeFormat ? !!(timeFormat.PmDesignator || timeFormat.AmDesignator) : false;\r\n\t}\r\n\r\n\twait(): BehaviorSubject {\r\n\t\treturn this.init$;\r\n\t}\r\n}\r\n","import * as conf from '../dist/Content/conf.js';\r\n\r\nexport const environment = {\r\n\tproduction: true,\r\n\tlocale: conf.buildConfig.language,\r\n\tconfig: conf.buildConfig,\r\n\tuserData: conf.userData,\r\n\tDEV_SPECS: false,\r\n};\r\n","module.exports = \"import { ComponentFixture } from '@angular/core/testing';\\r\\nimport { CommonTextfieldComponent } from './textfield.component';\\r\\nimport { TestStandForComponent } from '../../utilities/test-utils/test-runner';\\r\\n\\r\\ndescribe('Common > CommonTextfieldComponent >', () => {\\r\\n\\t// Not empty\\r\\n});\\r\\n\"","import '../../CaseDotStar.ServicePackages.Frontend.Common/scripts/common/vendor/element.prototype.polyfills.js';\r\n\r\nimport {\r\n\tfind,\r\n\tremove,\r\n\tmap,\r\n\tuniqueId,\r\n\tisFunction,\r\n\tforEach,\r\n\treduce,\r\n\tmergeWith,\r\n\tisArray,\r\n\tisObject,\r\n\thas,\r\n\tinvoke,\r\n\tget,\r\n\tincludes,\r\n\treverse,\r\n} from 'lodash';\r\n\r\nimport Dotdotdot from 'dotdotdot-js';\r\n\r\nimport { commonConstants } from '../constants/common.constants';\r\nimport { commonBrowserService } from '../browser/common-browser.service';\r\nimport { ICommonResponseError } from '../interfaces/response';\r\nimport { CommonBaseService } from '../common-base-service.class/common-base-service.class';\r\nimport { Injectable } from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\n\r\n\r\ninterface INoty {\r\n\tid: string\r\n\tshown: boolean,\r\n\tqueued: boolean,\r\n\ttimer: number,\r\n\tisClosing: boolean,\r\n\t$element: JQuery,\r\n\t$body: JQuery,\r\n\t$buttons: JQuery,\r\n\tshow: () => void,\r\n\tclose: () => void,\r\n\ttruncate: () => void,\r\n}\r\n\r\ninterface ICommonNotyOptionsAnimation {\r\n\topen: string,\r\n\tclose: string,\r\n}\r\n\r\ninterface ICommonNotyOptionsButton {\r\n\tcallback?: (noty: INoty) => void,\r\n\tclassName?: string,\r\n\ttitle: string,\r\n\thref?: string,\r\n\topenInCurrentWindow?: boolean,\r\n\tcloseAfterClick?: boolean,\r\n}\r\n\r\ninterface ICommonNotyOptions {\r\n\tanimation?: ICommonNotyOptionsAnimation,\r\n\tbuttons?: ICommonNotyOptionsButton[],\r\n\ticon?: string,\r\n\tlayout?: string,\r\n\ttext?: string,\r\n\ttimeout?: number,\r\n\ttype?: string,\r\n\tnotificationId?: string,\r\n}\r\n\r\nexport type TCommonNotificationType = 'success' | 'info'| 'error' | 'delete_success' | string;\r\nexport type TCommonNotificationIconType = 'alert';\r\n\r\nexport interface ICommonNotyParams {\r\n\tbuttons?: ICommonNotyOptionsButton[],\r\n\ticonType?: TCommonNotificationIconType,\r\n\tnotificationId?: string,\r\n}\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonNotificationService extends CommonBaseService {\r\n\tprivate\tNOTIFICATION_HEIGHT = 208;\r\n\tprivate\tNOTIFICATION_TIMEOUT = 10000;\r\n\r\n\tprivate\tnotificationsQueue = {\r\n\t\t_queue: [],\r\n\t\tadd: (noty: INoty) => {\r\n\t\t\tif (!find(this.notificationsQueue._queue, noty)) {\r\n\t\t\t\tthis.notificationsQueue._queue.push(noty);\r\n\t\t\t\tnoty.queued = true;\r\n\t\t\t}\r\n\t\t\treturn this.notificationsQueue;\r\n\t\t},\r\n\t\tremove: (noty: INoty) => {\r\n\t\t\tnoty.queued = false;\r\n\t\t\tremove(this.notificationsQueue._queue, noty);\r\n\t\t\treturn this.notificationsQueue;\r\n\t\t},\r\n\t\tnext: () => {\r\n\t\t\treturn this.notificationsQueue._queue[0];\r\n\t\t},\r\n\t};\r\n\tprivate shownCache: Array<{\r\n\t\tnoty: INoty,\r\n\t\theight: number,\r\n\t}> = [];\r\n\r\n\tprivate animationStartEvents = 'webkitAnimationStart animationstart';\r\n\tprivate $body = $('body');\r\n\tprivate isIE = commonBrowserService.browser.isIE;\r\n\tprivate window = this.injector.get(DOCUMENT).defaultView;\r\n\r\n\tshow (\r\n\t\ttitle: string,\r\n\t\tbody: string | {},\r\n\t\ttype: TCommonNotificationType,\r\n\t\tparams?: ICommonNotyParams,\r\n\t): void {\r\n\t\tconst notificationId = params?.notificationId || uniqueId('common_noty_bar_');\r\n\t\tconst shownItem = find(this.shownCache, (item) => {\r\n\t\t\treturn item.noty.id === notificationId && !item.noty.isClosing;\r\n\t\t});\r\n\r\n\t\tif (shownItem) {\r\n\t\t\tthis.restartClosingTimer(shownItem.noty);\r\n\t\t} else {\r\n\t\t\tconst\tinnerLayout = this.getMessage(title, body);\r\n\r\n\t\t\t// Without zonejs\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.createNotification({\r\n\t\t\t\t\ttext: innerLayout,\r\n\t\t\t\t\ttype: invoke(type, 'toLowerCase'),\r\n\t\t\t\t\ticon: params?.iconType ? 'icon_' + params.iconType : '',\r\n\t\t\t\t\tbuttons: params?.buttons,\r\n\t\t\t\t\tnotificationId,\r\n\t\t\t\t});\r\n\t\t\t}, 0);\r\n\t\t}\r\n\t}\r\n\r\n\thandleResponseError (response: ICommonResponseError): void {\r\n\t\tconst errorHeader = (get(response, 'data.ErrorHeader') || get(response, 'error.ErrorHeader')) || this.commonLocaleService.instant('common.noty.error.title');\r\n\t\tconst errorTypes = ['General', 'Subscription', 'ConditionFailed'];\r\n\t\tconst exceptionDetailUrl = get(response, 'data.ExceptionDetailUrl') || get(response, 'error.ExceptionDetailUrl') || response.ExceptionDetailUrl;\r\n\t\tconst notificationParams: ICommonNotyOptions = {};\r\n\t\tlet errorText = get(response, 'data.Error') || get(response, 'error.Error') || response.Error || '';\r\n\t\tlet errorType = get(response, 'data.ErrorType') || get(response, 'error.ErrorType');\r\n\r\n\t\tif (exceptionDetailUrl) {\r\n\t\t\terrorText += `\\n${this.commonLocaleService.instant('common.noty.error.download_log_text')}`;\r\n\t\t\tnotificationParams.buttons = [\r\n\t\t\t\t{\r\n\t\t\t\t\ttitle: this.commonLocaleService.instant('common.noty.error.download_log_btn_title'),\r\n\t\t\t\t\tcallback: () => {\r\n\t\t\t\t\t\tthis.window.open(exceptionDetailUrl, '_blank');\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\tif (!includes(errorTypes, errorType)) {\r\n\t\t\terrorType = 'error';\r\n\t\t}\r\n\r\n\t\terrorType = (errorType || '').toLowerCase();\r\n\t\tthis.show(errorHeader, errorText, errorType, notificationParams);\r\n\t}\r\n\r\n\tprivate createNotificationLayout (noty: INoty, options: ICommonNotyOptions): JQuery {\r\n\t\tnoty.$buttons.append(this.createNotificationButtons(noty, options.buttons));\r\n\t\tnoty.$body.append(options.text);\r\n\r\n\t\treturn noty.$element\r\n\t\t\t.addClass([\r\n\t\t\t\t'b-noty_bar',\r\n\t\t\t\t`b-noty_type__${options.type}`,\r\n\t\t\t\t`b-noty_theme__${options.icon}`,\r\n\t\t\t].join(' '))\r\n\t\t\t.append([noty.$body, noty.$buttons]);\r\n\t}\r\n\r\n\tprivate createNotificationButtons (noty: INoty, buttons: ICommonNotyOptionsButton[]): Array> {\r\n\t\treturn map(buttons, (button) => {\r\n\t\t\tlet commonAttrs;\r\n\t\t\tlet $button: JQuery;\r\n\r\n\t\t\tbutton.className = button.className || '';\r\n\t\t\tbutton.title = button.title || '';\r\n\t\t\tcommonAttrs = `id='${uniqueId('common_noty_button_')}' class='${button.className}'`;\r\n\r\n\t\t\tif (button.href) {\r\n\t\t\t\t$button = $(`${button.title}`);\r\n\t\t\t} else {\r\n\t\t\t\t$button = $(``);\r\n\t\t\t}\r\n\r\n\t\t\tif (isFunction(button.callback)) {\r\n\t\t\t\t// Click with zonejs\r\n\t\t\t\t$button.on('click', () => {\r\n\t\t\t\t\tbutton.callback(noty);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (button.closeAfterClick) {\r\n\t\t\t\t// Click with zonejs\r\n\t\t\t\t$button.on('click', () => {\r\n\t\t\t\t\tnoty.close();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn $button;\r\n\t\t});\r\n\t}\r\n\r\n\tprivate getMaxVisible (): number {\r\n\t\treturn Math.floor(window.innerHeight / this.NOTIFICATION_HEIGHT);\r\n\t}\r\n\r\n\tprivate getContainer (options: ICommonNotyOptions): JQuery {\r\n\t\tlet $notificationsContainer = this.$body.find('#common_noty_layout__' + options.layout);\r\n\r\n\t\tif ($notificationsContainer.length === 0) {\r\n\t\t\t$notificationsContainer = $(`
`);\r\n\t\t\tif (this.isIE) {\r\n\t\t\t\t$notificationsContainer.addClass('b-noty_no-animate');\r\n\t\t\t}\r\n\t\t\tthis.$body.append($notificationsContainer);\r\n\t\t}\r\n\r\n\t\treturn $notificationsContainer;\r\n\t}\r\n\r\n\tprivate showNext (): void {\r\n\t\tforEach(this.notificationsQueue._queue, (noty) => {\r\n\t\t\tinvoke(noty, 'show');\r\n\t\t});\r\n\t}\r\n\r\n\tprivate startClosingTimer (noty: INoty, options?: ICommonNotyOptions): void {\r\n\t\t// Without zonejs\r\n\t\tnoty.timer = window.setTimeout(noty.close, options?.timeout || this.NOTIFICATION_TIMEOUT);\r\n\t}\r\n\r\n\tprivate endClosingTimer (noty: INoty): void {\r\n\t\tif (noty.timer) {\r\n\t\t\tclearTimeout(noty.timer);\r\n\t\t\tnoty.timer = null;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate restartClosingTimer (noty: INoty) {\r\n\t\tthis.endClosingTimer(noty);\r\n\t\tthis.startClosingTimer(noty);\r\n\t}\r\n\r\n\tprivate onAnimationEnd (callback: () => void): () => void {\r\n\t\treturn () => {\r\n\t\t\t// Without zonejs\r\n\t\t\tsetTimeout(callback, commonConstants.animationDuration);\r\n\t\t};\r\n\t}\r\n\r\n\tprivate animateAll (options: ICommonNotyOptions): void {\r\n\t\tconst $notificationsContainer = this.getContainer(options);\r\n\r\n\t\t$notificationsContainer.children().each((elementIndex, element) => {\r\n\t\t\tconst $element = $(element);\r\n\t\t\tconst bottom = reduce(this.shownCache, (result, cacheItem, cacheIndex) => {\r\n\t\t\t\tif (cacheIndex > elementIndex) {\r\n\t\t\t\t\treturn result + cacheItem.height;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t}, 0);\r\n\r\n\t\t\t$element.css({\r\n\t\t\t\tbottom,\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tprivate showNotification (noty: INoty, options: ICommonNotyOptions): INoty {\r\n\t\tlet $notificationsContainer: JQuery;\r\n\r\n\t\tif (!noty.shown) {\r\n\t\t\tif (!noty.queued) {\r\n\t\t\t\tthis.showNext();\r\n\t\t\t\tthis.notificationsQueue.add(noty);\r\n\t\t\t}\r\n\r\n\t\t\t$notificationsContainer = this.getContainer(options);\r\n\r\n\t\t\tif ($notificationsContainer.children().length < this.getMaxVisible()) {\r\n\t\t\t\t$notificationsContainer.append(this.createNotificationLayout(noty, options));\r\n\r\n\t\t\t\tthis.notificationsQueue.remove(noty);\r\n\t\t\t\tnoty.truncate();\r\n\t\t\t\tthis.shownCache.push({\r\n\t\t\t\t\tnoty,\r\n\t\t\t\t\theight: noty.$element.outerHeight(true)\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.animateAll(options);\r\n\r\n\t\t\t\tnoty.shown = true;\r\n\r\n\t\t\t\tnoty.$element\r\n\t\t\t\t\t.addClass(options.animation.open)\r\n\t\t\t\t\t.on('mouseenter', () => {\r\n\t\t\t\t\t\tthis.endClosingTimer(noty);\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.on('mouseleave', () => {\r\n\t\t\t\t\t\tthis.startClosingTimer(noty, options);\r\n\t\t\t\t\t})\r\n\t\t\t\t\t// in IE animationend does not fire sometimes\r\n\t\t\t\t\t// emulated animationend from animationstart to ANIMATE_DURATION\r\n\t\t\t\t\t.on(this.animationStartEvents, this.onAnimationEnd(() => {\r\n\t\t\t\t\t\tthis.startClosingTimer(noty, options);\r\n\t\t\t\t\t\tnoty.$element.removeClass(options.animation.open);\r\n\t\t\t\t\t\tnoty.$element.off(this.animationStartEvents);\r\n\t\t\t\t\t}));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn noty;\r\n\t}\r\n\r\n\tprivate closeNotification (noty: INoty, options: ICommonNotyOptions): INoty {\r\n\t\tif (noty.shown) {\r\n\t\t\tthis.endClosingTimer(noty);\r\n\t\t\tnoty.isClosing = true;\r\n\r\n\t\t\tnoty.$element\r\n\t\t\t\t.removeClass(options.animation.open)\r\n\t\t\t\t.addClass(options.animation.close)\r\n\t\t\t\t// in IE animationend does not fire sometimes\r\n\t\t\t\t// emulated animationend from animationstart to ANIMATE_DURATION\r\n\t\t\t\t.on(this.animationStartEvents, this.onAnimationEnd(() => {\r\n\t\t\t\t\tnoty.shown = false;\r\n\t\t\t\t\tnoty.$element.remove();\r\n\t\t\t\t\tremove(this.shownCache, (item) => {\r\n\t\t\t\t\t\treturn item.noty.id === noty.id && item.noty.isClosing;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (this.notificationsQueue._queue.length === 0) {\r\n\t\t\t\t\t\tthis.animateAll(options);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.showNext();\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\t\t}\r\n\r\n\t\treturn noty;\r\n\t}\r\n\r\n\tprivate createNotification (options: ICommonNotyOptions): void {\r\n\t\tconst\tdefaults: ICommonNotyOptions = {\r\n\t\t\ttext: '',\r\n\t\t\ttype: 'success',\r\n\t\t\tlayout: 'bottomLeft',\r\n\t\t\ticon: '',\r\n\t\t\ttimeout: this.NOTIFICATION_TIMEOUT,\r\n\t\t\tanimation: {\r\n\t\t\t\topen: 'slideInUp',\r\n\t\t\t\tclose: 'slideOutLeftFade',\r\n\t\t\t},\r\n\t\t\tbuttons: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttitle: this.commonLocaleService.instant('common.dismiss'),\r\n\t\t\t\t\tclassName: 'b-noty_button_close',\r\n\t\t\t\t\tcallback: (button) => {\r\n\t\t\t\t\t\tbutton.close();\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t};\r\n\r\n\t\toptions = mergeWith({}, defaults, options, (objValue, srcValue) => {\r\n\t\t\tif (isArray(objValue) && isArray(srcValue)) {\r\n\t\t\t\treturn objValue.concat(srcValue);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (options.buttons) {\r\n\t\t\toptions.buttons = reverse(options.buttons); // correct buttons order with float: right\r\n\t\t}\r\n\r\n\t\tconst noty: INoty = {\r\n\t\t\tid: options.notificationId,\r\n\t\t\tshown: false,\r\n\t\t\tqueued: false,\r\n\t\t\ttimer: null,\r\n\t\t\tisClosing: false,\r\n\t\t\t$element: $(`
`),\r\n\t\t\t$body: $('
'),\r\n\t\t\t$buttons: $('
'),\r\n\t\t\tshow: () => {\r\n\t\t\t\treturn this.showNotification(noty, options);\r\n\t\t\t},\r\n\t\t\tclose: () => {\r\n\t\t\t\treturn this.closeNotification(noty, options);\r\n\t\t\t},\r\n\t\t\ttruncate: () => {\r\n\t\t\t\t// tslint:disable-next-line:no-unused-expression\r\n\t\t\t\tnew Dotdotdot(\r\n\t\t\t\t\tdocument.querySelector('.b-noty-text-body--ellipsis'),\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\theight: 160, // 10 text lines\r\n\t\t\t\t\t},\r\n\t\t\t\t);\r\n\t\t\t},\r\n\t\t};\r\n\r\n\t\tnoty.show();\r\n\t}\r\n\r\n\tprivate getMessage (title: string, body: string | {}): string {\r\n\t\t// CASEM-51657 span Need for IE 11\r\n\t\tlet bodyEl = `
${body || ''}
`;\r\n\r\n\t\tif (isObject(body) && has(body, 'template')) {\r\n\t\t\t// now use template as string instead of templateUrl\r\n\t\t\t// this using in administration\r\n\t\t\tbodyEl = `
${get(body, 'template')}
`;\r\n\t\t}\r\n\r\n\t\tconst template = `\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t
${title}
\r\n\t\t\t\t\t\t${bodyEl}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t`;\r\n\r\n\t\treturn template;\r\n\t}\r\n}\r\n","// New version src/Common/locale/locale.service.ts CommonLocaleService\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Locale/scripts/locale/locale_run.js LocaleRun\r\n\r\nimport { Injectable } from '@angular/core';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport {\r\n\tupdateLocale,\r\n\ttz,\r\n} from 'moment';\r\nimport 'moment-timezone';\r\n\r\nimport { CommonUserDataService } from '../user/user_data.service';\r\nimport { CommonGeneralSettingsService } from '../general_settings/general_settings.service';\r\nimport { BehaviorSubject } from 'rxjs';\r\n\r\nexport interface ICommonLocaleServiceData {\r\n\tlocaleKey: string,\r\n\tlocaleUrl?: string,\r\n\ttranslations?: {[key: string]: string},\r\n\tlayoutTranslations?: { // translations in layout for initial loader and bootstrap error\r\n\t\tLayout_Loading: string,\r\n\t\tLayout_Reconnect_StartMessage: string,\r\n\t\tLayout_Reconnect_Seconds: string,\r\n\t\tLayout_RunError: string,\r\n\t\tLayout_Error: string,\r\n\t\tLayout_Error_Message: string,\r\n\t\tLayout_ServerResponse: string,\r\n\t},\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class CommonLocaleService {\r\n\treadonly locale: string = window.LocaleData.localeKey;\r\n\tlocaleData: ICommonLocaleServiceData;\r\n\r\n\tprivate init$ = new BehaviorSubject(false);\r\n\r\n\tconstructor (\r\n\t\tprivate translateService: TranslateService,\r\n\t\tprivate commonUserDataService: CommonUserDataService,\r\n\t\tprivate commonGeneralSettingsService: CommonGeneralSettingsService,\r\n\t) {}\r\n\r\n\tinit (): Promise {\r\n\t\treturn new Promise((resolve) => { // for APP_INITIALIZER\r\n\t\t\t// For SandBox\r\n\t\t\tif (window.LocaleData && window.LocaleData.translations) {\r\n\t\t\t\tthis.translateService.setTranslation(this.locale, window.LocaleData.translations);\r\n\t\t\t}\r\n\r\n\t\t\tthis.localeData = window.LocaleData;\r\n\t\t\tthis.translateService.setDefaultLang(this.locale);\r\n\t\t\tconst observable = this.translateService.use(this.locale);\r\n\r\n\t\t\tobservable.subscribe(() => {\r\n\t\t\t\tthis.init$.next(true);\r\n\t\t\t\tresolve(true);\r\n\t\t\t});\r\n\r\n\t\t\tthis.commonGeneralSettingsService.wait().subscribe((result) => {\r\n\t\t\t\tif (result) {\r\n\t\t\t\t\tthis.setFormats();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tsetFormats (): void {\r\n\t\tconst timeFormat = this.commonGeneralSettingsService.getGeneralSettings('TimeFormat');\r\n\t\tconst dateFormat = this.commonGeneralSettingsService.getGeneralSettings('DateFormat');\r\n\t\tconst locale = this.locale === 'en' ? 'en-gb' : this.locale;\r\n\r\n\t\tif (timeFormat) {\r\n\t\t\tupdateLocale(locale, {\r\n\t\t\t\tlongDateFormat: {\r\n\t\t\t\t\tLT: timeFormat.Format,\r\n\t\t\t\t\tL: dateFormat.ShortFormat,\r\n\t\t\t\t\tLL: '',\r\n\t\t\t\t\tLLL: '',\r\n\t\t\t\t\tLLLL: '',\r\n\t\t\t\t\tLTS: '',\r\n\t\t\t\t},\r\n\t\t\t\tmeridiemParse: new RegExp(timeFormat.PmDesignator + '|' + timeFormat.AmDesignator, 'gi'),\r\n\t\t\t\tisPM: (input) => {\r\n\t\t\t\t\treturn input === timeFormat.PmDesignator;\r\n\t\t\t\t},\r\n\t\t\t\tmeridiem: (hours) => {\r\n\t\t\t\t\treturn hours > 11 ? timeFormat.PmDesignator : timeFormat.AmDesignator;\r\n\t\t\t\t},\r\n\t\t\t\tweek: {\r\n\t\t\t\t\tdoy: 1,\r\n\t\t\t\t\tdow: this.commonGeneralSettingsService.getGeneralSettings('DayOfWeek').IndexNumber + 1,\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setTimeZone();\r\n\t}\r\n\r\n\tsetTimeZone() {\r\n\t\tconst userTimeZone = this.commonUserDataService.getDataByPath('TimeZone');\r\n\r\n\t\tif (userTimeZone) {\r\n\t\t\ttz.setDefault(userTimeZone.IanaId);\r\n\t\t}\r\n\t}\r\n\r\n\tinstant (key: string, params?: {}): string {\r\n\t\treturn this.translateService.instant(key, params);\r\n\t}\r\n\r\n\twait(): BehaviorSubject {\r\n\t\treturn this.init$;\r\n\t}\r\n}\r\n","/* eslint-disable */\n\tmodule.exports = {\"sourcemaps\":false,\"devspecs\":false,\"parallelTests\":true,\"production\":false,\"reloadless\":false,\"buildConfig\":{\"language\":\"en\",\"locale\":\"en-US\",\"server\":\"\",\"login\":\"\",\"password\":\"\",\"host\":\"localhost\",\"port\":9000,\"https\":true,\"proxyTargets\":[\"/api\",\"/authentication\",\"/Outlook\",\"/account\"],\"proxyWSTargets\":[\"/installHub\",\"/objectHub\"]}}\n/* eslint-enable */\n","import { InjectionToken } from '@angular/core';\r\n\r\nexport interface ICommonAppConfig {\r\n\tname: string,\r\n\tshouldAuthorize: boolean,\r\n\tmainComponent?,\r\n\tbootstrapApiUrl?: string,\r\n}\r\n\r\nexport const COMMON_APP_CONFIG = new InjectionToken('appConfig');\r\n","import {\r\n\tCommonBaseEntityClassWithoutInjectable,\r\n} from '../common-base-entity.class/common-base-entity.class';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { Directive, Injector } from '@angular/core';\r\n\r\n@Directive()\r\nexport class CommonBaseServiceWithoutInjectable extends CommonBaseEntityClassWithoutInjectable {\r\n\tprotected destroy$ = new Subject();\r\n\r\n\ttakeUntilDestroy() {\r\n\t\treturn takeUntil(this.destroy$);\r\n\t}\r\n\r\n\tdestroy() {\r\n\t\tthis.destroy$.next();\r\n\t\tthis.destroy$.complete();\r\n\t}\r\n}\r\n\r\n\r\n// tslint:disable:max-classes-per-file\r\n@Directive()\r\nexport class CommonBaseService extends CommonBaseServiceWithoutInjectable {\r\n\tconstructor(\r\n\t\tprotected injector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\t}\r\n}\r\n","// New version src/Common/bootstrap/bootstrap.service.ts CommonBootstrapService\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/services/common_bootstrap_service.ts CommonBootstrapService\r\n\r\nimport {get} from 'lodash';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class CommonBootstrapService {\r\n\tprivate bootstrap;\r\n\r\n\tinit (data): void {\r\n\t\tif (data['CaseMap.Modules.Main']) {\r\n\t\t\tthis.bootstrap = data['CaseMap.Modules.Main'];\r\n\t\t} else {\r\n\t\t\tthis.bootstrap = data;\r\n\t\t}\r\n\t}\r\n\r\n\tgetBootstrap (path?: string): T {\r\n\t\treturn path ? get(this.bootstrap, path) : this.bootstrap;\r\n\t}\r\n}\r\n","export function isPerformanceCheckEnabled (win: Window): boolean {\r\n\treturn !!win.AppData?.IsPerformanceCheckEnabled;\r\n}\r\n\r\nexport function isAppPerformanceCreated (win: Window): void {\r\n\twin.AppPerformance = window.AppPerformance || {\r\n\t\tmeasures: {},\r\n\t\ttimings: {\r\n\t\t\tsourcesInitialized: null,\r\n\t\t\tonBeforeStateLoading: null,\r\n\t\t\tonSuccessStateLoading: null,\r\n\t\t}\r\n\t};\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport * as jQuery from 'jquery';\r\n\r\n@NgModule({\r\n})\r\nexport class CommonVendorModule {\r\n\tconstructor (\r\n\t) {\r\n\t\t// export jQuery as global variable for external libs\r\n\t\twindow.$ = window.jQuery = jQuery;\r\n\t}\r\n}\r\n","var map = {\n\t\"./en-gb\": \"Oaa7\",\n\t\"./fr\": \"nyYc\",\n\t\"./pt\": \"8mBD\",\n\t\"./ru\": \"lXzo\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"l4sE\";","import { of, Observable } from 'rxjs';\r\n\r\nimport { CommonDataServiceClass } from '../data/data-service.class';\r\n\r\nexport interface ICommonAppData {\r\n\tappName: string,\r\n\tappFullLocationUrl: string,\r\n\tdomainName: string,\r\n\tappStartNotificationText: string, // For test notifications 'Access denied' before redirect\r\n\tLogEnabled: boolean,\r\n\tIsWebSocketsEnabled: boolean,\r\n\tIsDebugToolsEnabled: boolean, // client-side debug tools\r\n\tIsPerformanceCheckEnabled: boolean, // client-side performance check tools\r\n\tLazyObjectCardInitDisabled: boolean, // Disable lazy init in Case Card\r\n}\r\n\r\nexport class CommonAppDataService extends CommonDataServiceClass {\r\n\tres: Observable;\r\n\r\n\tconstructor(\r\n\t) {\r\n\t\tsuper();\r\n\r\n\t\tthis.res = of(window.AppData);\r\n\t\tthis.res.subscribe((result) => this.setData(result));\r\n\t}\r\n\r\n\tinit(): Observable {\r\n\t\treturn this.res;\r\n\t}\r\n\r\n\twait(): Observable {\r\n\t\treturn this.res;\r\n\t}\r\n}\r\n\r\n\r\nexport const commonAppDataServiceFactory = () => {\r\n\treturn new CommonAppDataService();\r\n};\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { TranslateLoader } from '@ngx-translate/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nexport class CommonLocaleHttpLoader implements TranslateLoader {\r\n\tconstructor(private http: HttpClient) {}\r\n\r\n\tgetTranslation(lang: string): Observable {\r\n\t\tconst localeUrl = window.LocaleData.localeUrl;\r\n\r\n\t\treturn this.http\r\n\t\t\t.get(localeUrl);\r\n\t}\r\n}\r\n","import { isObject } from 'lodash';\r\nimport { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class CommonTranslationCompiler extends TranslateMessageFormatCompiler {\r\n\tcompileTranslations (translations, lang) {\r\n\t\tfor (const key in translations) {\r\n\t\t\tif (translations.hasOwnProperty(key)) {\r\n\t\t\t\t// For common_html_editor\r\n\t\t\t\tif (!isObject(translations[key])) {\r\n\t\t\t\t\ttranslations[key] = this.resolveReferences(translations[key], translations, key);\r\n\t\t\t\t}\r\n\t\t\t\t// else do nothing\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twindow.LocaleData.translations = translations;\r\n\r\n\t\treturn super.compileTranslations(translations, lang);\r\n\t}\r\n\r\n\tprivate resolveReferences (value: string, translations: any, key: string): string {\r\n\t\tconst matches = value.match(/@:(\\S+)/);\r\n\r\n\t\tif (matches) {\r\n\t\t\tconst [, foundKey] = matches;\r\n\r\n\t\t\tif (translations[foundKey]) {\r\n\t\t\t\treturn this.resolveReferences(translations[foundKey], translations, foundKey);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(`CommonTranslationCompiler#resolveReferences not found translate for key '${foundKey}' in key '${key}'`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n}\r\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport {\r\n\tTranslateModule,\r\n\tTranslateLoader,\r\n\tTranslateCompiler,\r\n} from '@ngx-translate/core';\r\nimport { registerLocaleData } from '@angular/common';\r\nimport localeRu from '@angular/common/locales/ru';\r\nimport localePt from '@angular/common/locales/pt';\r\nimport localeFr from '@angular/common/locales/fr';\r\n\r\nimport {\r\n\tCommonLocaleService,\r\n} from './locale.service';\r\nimport {\r\n\tCommonLocaleHttpLoader,\r\n} from './locale-http-loader.class';\r\nimport { CommonTranslationCompiler } from './translation_compiler.service';\r\n\r\ndeclare const COMPONENT_SPECS_MODE: boolean;\r\n\r\nregisterLocaleData(localeRu);\r\nregisterLocaleData(localePt);\r\nregisterLocaleData(localeFr);\r\n\r\nexport function initCommonLocaleService (\r\n\tcommonLocaleService: CommonLocaleService,\r\n) {\r\n\treturn () => {\r\n\t\tif (!COMPONENT_SPECS_MODE) { // until https://github.com/angular/angular/issues/24218 is fixed\r\n\t\t\treturn commonLocaleService.init();\r\n\t\t}\r\n\t};\r\n}\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tTranslateModule.forRoot({\r\n\t\t\tloader: {\r\n\t\t\t\tprovide: TranslateLoader,\r\n\t\t\t\tuseClass: CommonLocaleHttpLoader,\r\n\t\t\t\tdeps: [\r\n\t\t\t\t\tHttpClient,\r\n\t\t\t\t],\r\n\t\t\t},\r\n\t\t\tcompiler: {\r\n\t\t\t\tprovide: TranslateCompiler,\r\n\t\t\t\tuseClass: CommonTranslationCompiler,\r\n\t\t\t},\r\n\t\t}),\r\n\t],\r\n\texports: [\r\n\t\tTranslateModule,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonLocaleService,\r\n\t\t{\r\n\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\tuseFactory: initCommonLocaleService,\r\n\t\t\tmulti: true,\r\n\t\t\tdeps: [\r\n\t\t\t\tCommonLocaleService,\r\n\t\t\t],\r\n\t\t},\r\n\t],\r\n})\r\nexport class CommonLocaleModule {}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { CommonAppDataService } from '../app_data/app_data.service';\r\n\r\n@Injectable()\r\nexport class CommonRelativeRequestsInterceptor implements HttpInterceptor {\r\n\tprivate readonly appData = this.commonAppDataService.getData();\r\n\r\n\tconstructor(\r\n\t\tprivate commonAppDataService: CommonAppDataService,\r\n\t) {}\r\n\r\n\tintercept(req: HttpRequest, next: HttpHandler): Observable> {\r\n\t\tif (this.isAbsoluteUrl(req.url)) {\r\n\t\t\treturn next.handle(req);\r\n\t\t} else {\r\n\t\t\tconst cloneReq = req.clone({\r\n\t\t\t\turl: `${this.appData.appFullLocationUrl}${req.url}`, // fix the wrong url with base href (auth app, for example)\r\n\t\t\t});\r\n\r\n\t\t\treturn next.handle(cloneReq);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate isAbsoluteUrl(url) {\r\n\t\treturn (url.indexOf('://') > 0 || url.indexOf('//') === 0); // more efficient than regular expressions\r\n\t}\r\n}\r\n","// New version src/Common/modules_placeholders/modules_placeholders.service.ts CommonModulesPlaceholders\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/providers/modules_placeholders_provider.ts ModulesPlaceholders\r\n\r\n// Provider registration and storages info about module placeholder\r\nimport { map, isFunction, get } from 'lodash';\r\nimport { Injector, Provider, Injectable } from '@angular/core';\r\n\r\nexport interface ICommonModulesPlaceholdersProvider {\r\n\tregisterPlaceholder(placeholder: ICommonModulesPlaceholderType): ICommonModulesPlaceholdersProvider\r\n}\r\n\r\nexport interface ICommonModulesPlaceholderType {\r\n\tname: string;\r\n\tdeps?: [Provider];\r\n\toldContext?: boolean;\r\n\tplaceholder: T;\r\n}\r\n\r\ninterface IPlaceholdersList {\r\n\t[key: string]: Array>\r\n}\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonModulesPlaceholders {\r\n\tprotected modulesPlaceholdersList: IPlaceholdersList = {};\r\n\tprotected $injector;\r\n\r\n\tpublic registerOldInjector($injector) {\r\n\t\tthis.$injector = $injector;\r\n\t}\r\n\r\n\tpublic registerPlaceholder(placeholderObject: ICommonModulesPlaceholderType): ICommonModulesPlaceholdersProvider {\r\n\t\tthis.modulesPlaceholdersList[placeholderObject.name] = this.modulesPlaceholdersList[placeholderObject.name] || [];\r\n\t\tthis.modulesPlaceholdersList[placeholderObject.name].push(placeholderObject);\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\tpublic getPlaceholder(name: string): T[] {\r\n\t\treturn map(this.modulesPlaceholdersList[name], this.invokePlaceholder.bind(this));\r\n\t}\r\n\r\n\tprivate invokePlaceholder(placeholderObject: ICommonModulesPlaceholderType): T {\r\n\t\tlet placeholder = placeholderObject.placeholder;\r\n\r\n\t\tif (isFunction(placeholder)) {\r\n\t\t\tlet deps = [];\r\n\r\n\t\t\tif (get(placeholderObject, 'deps.length')) {\r\n\t\t\t\t// not in constructor for downgrading support\r\n\t\t\t\tconst injector = Injector.create({providers: []});\r\n\r\n\t\t\t\tdeps = map(placeholderObject.deps, (dependency) => {\r\n\t\t\t\t\tif (placeholderObject.oldContext) {\r\n\t\t\t\t\t\treturn this.$injector.get(dependency as any);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn injector.get(dependency as any);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tplaceholder = placeholder(...deps);\r\n\t\t}\r\n\r\n\t\treturn placeholder;\r\n\t}\r\n}\r\n","// New version src/Common/interceptors/error_interceptor.service.ts CommonErrorInterceptor\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/common_errors_interceptor_factory.js CommonErrorsInterceptor\r\n\r\nimport { Injectable } from '@angular/core';\r\nimport { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';\r\nimport { Observable, throwError } from 'rxjs';\r\nimport { map, catchError } from 'rxjs/operators';\r\nimport { get, includes, map as _map} from 'lodash';\r\n\r\nimport { CommonNotificationService } from '../notification/notification.service';\r\nimport { CommonModulesPlaceholders } from '../modules_placeholders/modules_placeholders.service';\r\nimport { CommonLocaleService } from '../locale/locale.service';\r\nimport { ICommonResponse, ICommonResponseError } from '../interfaces/response';\r\n\r\n\r\n@Injectable()\r\nexport class CommonErrorInterceptor implements HttpInterceptor {\r\n\tprivate warningTypeConfigs;\r\n\tprivate warningTypes;\r\n\r\n\tconstructor(\r\n\t\tprivate commonNotificationService: CommonNotificationService,\r\n\t\tprivate commonModulesPlaceholders: CommonModulesPlaceholders,\r\n\t\tprivate commonLocaleService: CommonLocaleService,\r\n\t) {}\r\n\r\n\tintercept (req: HttpRequest, next: HttpHandler): Observable> {\r\n\t\tconst isIgnoreNotification = req.headers.get('X-Ignore-Warnings');\r\n\t\tconst cloneReq: HttpRequest = req.clone({\r\n\t\t\theaders: req.headers.delete('X-Ignore-Warnings'),\r\n\t\t});\r\n\r\n\t\treturn next.handle(cloneReq).pipe(\r\n\t\t\tmap((response: ICommonResponse) => {\r\n\t\t\t\tconst warningText = get(response, 'body.Warning') || response.Warning;\r\n\t\t\t\tlet warningHeader = get(response, 'body.WarningHeader') || response.WarningHeader;\r\n\t\t\t\tlet warningType = get(response, 'body.WarningType') || response.WarningType;\r\n\r\n\t\t\t\tif (!isIgnoreNotification && (warningHeader || warningText || warningType)) {\r\n\t\t\t\t\tif (!this.warningTypeConfigs) {\r\n\t\t\t\t\t\tthis.warningTypeConfigs = this.commonModulesPlaceholders.getPlaceholder('common-warning-types');\r\n\t\t\t\t\t\tthis.warningTypes = _map(this.warningTypeConfigs, 'type');\r\n\t\t\t\t\t\tthis.warningTypes.push('Success');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (warningType === 'OperationIsFullСomplete') {\r\n\t\t\t\t\t\twarningType = 'Success';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (warningType === 'OperationIsNotFullСomplete') {\r\n\t\t\t\t\t\twarningType = 'warning';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!includes(this.warningTypes, warningType)) {\r\n\t\t\t\t\t\twarningType = 'warning';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// FIXME providers is undefined inside TrustAccountInsufficientFunds warningTypeConfig (AngularJS code)\r\n\t\t\t\t\t// warningConfig = (get(find(this.warningTypeConfigs, { type: 'TrustAccountInsufficientFunds'}), 'getConfig') || noop)();\r\n\r\n\t\t\t\t\twarningHeader = warningHeader || this.commonLocaleService.instant('common.noty.warning.title');\r\n\t\t\t\t\twarningType = (warningType || '').toLowerCase();\r\n\t\t\t\t\tthis.commonNotificationService.show(warningHeader, warningText, warningType);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn response;\r\n\t\t\t}),\r\n\t\t\tcatchError((response: ICommonResponseError) => {\r\n\r\n\t\t\t\t// TODO 404 used with custom error messages\r\n\t\t\t\tif (response.status !== -1 && response.status !== 404 && (response.status < 200 || response.status > 299)) {\r\n\t\t\t\t\tthis.commonNotificationService.handleResponseError(response);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn throwError(response);\r\n\t\t\t}),\r\n\t\t);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n\tHttpEvent,\r\n\tHttpHandler,\r\n\tHttpInterceptor,\r\n\tHttpRequest,\r\n\tHttpResponse,\r\n} from '@angular/common/http';\r\nimport {\r\n\tget,\r\n\tset,\r\n} from 'lodash';\r\nimport {\r\n\tObservable,\r\n\tObserver,\r\n} from 'rxjs';\r\n\r\n@Injectable()\r\nexport class CommonRequestCountInterceptor implements HttpInterceptor {\r\n\tprivate requests: Array> = [];\r\n\r\n\tintercept(req: HttpRequest, next: HttpHandler): Observable> {\r\n\t\tthis.requests.push(req);\r\n\t\tset(window, 'CO.pendingRequests', this.requests.length);\r\n\r\n\t\treturn new Observable((observer: Observer) => {\r\n\t\t\t// And subscribe to the original observable to ensure the HttpRequest is made\r\n\t\t\tconst subscription = next.handle(req)\r\n\t\t\t\t.subscribe(\r\n\t\t\t\t\t(event) => {\r\n\t\t\t\t\t\tif (event instanceof HttpResponse) {\r\n\t\t\t\t\t\t\tthis.decreaseCount(req);\r\n\t\t\t\t\t\t\tobserver.next(event);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\t(err) => { this.decreaseCount(req); observer.error(err); },\r\n\t\t\t\t\t() => { this.decreaseCount(req); observer.complete(); },\r\n\t\t\t\t);\r\n\r\n\t\t\treturn () => {\r\n\t\t\t\tthis.decreaseCount(req);\r\n\t\t\t\tsubscription.unsubscribe();\r\n\t\t\t};\r\n\t\t});\r\n\t}\r\n\r\n\tprivate decreaseCount(req: HttpRequest) {\r\n\t\tconst i = this.requests.indexOf(req);\r\n\r\n\t\tif (i >= 0) {\r\n\t\t\tthis.requests.splice(i, 1);\r\n\t\t\tset(window, 'CO.pendingRequests', this.requests.length);\r\n\t\t}\r\n\t}\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n\tname: 'commonEscapedBracketReplace',\r\n})\r\nexport class CommonEscapedBracketReplace implements PipeTransform {\r\n\ttransform (str: string) {\r\n\t\treturn str ? str.replace(/</g, '<').replace(/>/g, '>') : str;\r\n\t}\r\n}\r\n","import { ElementRef, InjectionToken } from '@angular/core';\r\n\r\nimport { ICommonAction } from '../../interfaces/core';\r\nimport { CommonContextMenuBaseScreenComponent } from './components/common-context-menu-base-screen.component';\r\nimport { ComponentType } from '@angular/cdk/overlay';\r\n\r\n\r\nexport enum COMMON_CONTEXT_MENU_EVENT_NAME {\r\n\tAFTER_OPEN = 'COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_OPEN',\r\n\tAFTER_CHANGE_SCREEN = 'COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CHANGE_SCREEN',\r\n\tAFTER_CLICK = 'COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CLICK',\r\n\tBEFORE_CLOSE = 'COMMON_CONTEXT_MENU_EVENT_NAME.BEFORE_CLOSE',\r\n\tAFTER_CLOSE = 'COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CLOSE',\r\n\tMOUSEENTER = 'COMMON_CONTEXT_MENU_EVENT_NAME.MOUSEENTER',\r\n\tMOUSELEAVE = 'COMMON_CONTEXT_MENU_EVENT_NAME.MOUSELEAVE',\r\n\tCUSTOM = 'COMMON_CONTEXT_MENU_EVENT_NAME.CUSTOM',\r\n}\r\n\r\nexport enum COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS {\r\n\tLEFT_TO_RIGHT = 'COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS.LEFT_TO_RIGHT',\r\n\tRIGHT_TO_LEFT = 'COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS.RIGHT_TO_LEFT',\r\n}\r\n\r\nexport enum COMMON_CONTEXT_MENU_ATTACHMENTS {\r\n\tRIGHT = 'COMMON_CONTEXT_MENU_ATTACHMENTS.RIGHT',\r\n\tLEFT = 'COMMON_CONTEXT_MENU_ATTACHMENTS.LEFT',\r\n\tCENTER = 'COMMON_CONTEXT_MENU_ATTACHMENTS.CENTER',\r\n}\r\n\r\nexport enum COMMON_CONTEXT_MENU_VERTICAL_ATTACHMENTS {\r\n\tTOP = 'COMMON_CONTEXT_MENU_VERTICAL_ATTACHMENTS.TOP',\r\n\tBOTTOM = 'COMMON_CONTEXT_MENU_VERTICAL_ATTACHMENTS.BOTTOM',\r\n}\r\n\r\nexport interface ICommonContextMenuScreen {\r\n\tname: string,\r\n\tisActive: boolean,\r\n\toptions: ICommonContextMenuOptionsScreen,\r\n}\r\n\r\nexport interface ICommonContextMenuAction extends ICommonAction {}\r\n\r\nexport type TCommonContextMenuElement = ElementRef | HTMLElement;\r\nexport type TCommonContextMenuElementOrSelector = string | TCommonContextMenuElement;\r\nexport type TCommonContextMenuScreenName = 'default' | string;\r\n\r\nexport interface ICommonContextMenuOptionsScreen {\r\n\tcomponent: ComponentType, // Component to display on this screen\r\n\tname?: TCommonContextMenuScreenName, // Screen selection key\r\n\theightControlling?: boolean, // Do you want this screen to adjust to the size of the browser Default - false\r\n\tdata?: any,\r\n}\r\n\r\nexport interface ICommonContextMenuOptionsContainerForPosition {\r\n\telement: TCommonContextMenuElementOrSelector, // The selector or element to be used as the border\r\n\tuseLeft?: boolean, // Default - true\r\n\tuseRight?: boolean, // Default - true\r\n\tuseTop?: boolean, // Default - true\r\n\tuseBottom?: boolean, // Default - true\r\n}\r\n\r\nexport interface ICommonContextMenuOptions {\r\n\tid?: string, // Close other context menus with same ids before open\r\n\ttargetEl?: TCommonContextMenuElement, // The purpose for which the context menu is positioned\r\n\tscreens?: Record, // Screens in menu\r\n\r\n\tdata?: DataType, // Data that will be available in components within the menu\r\n\tparentEl?: TCommonContextMenuElement, // The item to which the context menu will be added, Default - targetEl.parent()\r\n\tappendToBody?: boolean, // If true, set 'body' into parentEl\r\n\tcontainersForPosition?: ICommonContextMenuOptionsContainerForPosition[], // Elements restricting the positioning of the context menu\r\n\tscrollContainer?: TCommonContextMenuElementOrSelector, // targetEl.closest() - An element used to bind scroll events and move the context menu\r\n\tcssClasses?: string[], // Stylistic classes for the root menu item\r\n\tcssAdditionalClasses?: string[], // Stylistic classes additional for cssClasses for the root menu item\r\n\tdismissClickIgnore?: TCommonContextMenuElementOrSelector[], // What elements do not respond to closure\r\n\tcloseOtherContextMenu?: boolean, // Close other context menus? Default - true\r\n\twithChangeScreenAnimate?: boolean, // Whether to use animation to change screen, Default - false\r\n\twithOpenAnimate?: boolean, // Whether to use animation to open, Default - false\r\n\tattachment?: COMMON_CONTEXT_MENU_ATTACHMENTS, // Which side of the context menu to stick to the target\r\n\tverticalAttachment?: COMMON_CONTEXT_MENU_VERTICAL_ATTACHMENTS, // Which vertical side of the context menu to stick to the target\r\n\tcontainerXOffset?: number, // Default - 0\r\n\tcontainerYOffset?: number, // Default - 64\r\n\ttargetXOffset?: number, // Default - 0\r\n\ttargetYOffset?: number, // Default - 0\r\n\tevents?: Partial void>> // Automatic Binding and Event Capturing\r\n\tinjectedTokens?: Array<{\r\n\t\ttoken: InjectionToken,\r\n\t\tvalue: any,\r\n\t}>, // Tokens passed to created components inside the context menu\r\n\tshouldStopClickPropagation?: boolean,\r\n}\r\n\r\n// Interface for component with context menu for transfer options\r\nexport interface ICommonComponentWithContextMenu {\r\n\tcontextMenuOptions: Partial;\r\n\r\n\t// Open the context menu, will be used through Ref\r\n\topenContextMenu();\r\n\r\n\t// Closes the context menu, will be used through Ref\r\n\tcloseContextMenu();\r\n}\r\n","export interface ICommonAnimateStylesParams {\r\n\tduration: number;\r\n\telement: HTMLElement,\r\n\tstyles: {\r\n\t\t[style: string]: [number, number, string?],\r\n\t}\r\n}\r\n\r\nexport async function commonAnimateStyles (params: ICommonAnimateStylesParams): Promise {\r\n\tconst savedComputedStyle = window.getComputedStyle(params.element);\r\n\tconst transitionStyleNames = [];\r\n\r\n\tfor (const [styleName, [start, end, postfix]] of Object.entries(params.styles)) {\r\n\t\ttransitionStyleNames.push(styleName);\r\n\t\tparams.element.style[styleName] = (postfix) ? start + postfix : start;\r\n\t}\r\n\tparams.element.style.transition = transitionStyleNames\r\n\t\t.map((styleName) => styleName ? `${ styleName.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase() } ${ params.duration / 1000 }s linear` : '')\r\n\t\t.join(', ');\r\n\r\n\t// waiting for browser rendering new styles\r\n\tawait new Promise((res) => {\r\n\t\twindow.requestAnimationFrame(res);\r\n\t});\r\n\r\n\tfor (const [styleName, [start, end, postfix]] of Object.entries(params.styles)) {\r\n\t\tparams.element.style[styleName] = (postfix) ? end + postfix : end;\r\n\t}\r\n\r\n\t// waiting animation time over\r\n\tawait new Promise((res) => setTimeout(res, params.duration));\r\n\r\n\tparams.element.style.transition = savedComputedStyle.transition;\r\n}\r\n","export const ANIMATE_DURATION = 200; // ms\r\n","export class Point {\r\n\tpublic x: number;\r\n\tpublic y: number;\r\n\r\n\tconstructor(x: number = 0, y: number = 0) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}\r\n\r\n\tmax(point: Point): Point {\r\n\t\tthis.x = Math.max(this.x, point.x);\r\n\t\tthis.y = Math.max(this.y, point.y);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tmin(point: Point): Point {\r\n\t\tthis.x = Math.min(this.x, point.x);\r\n\t\tthis.y = Math.min(this.y, point.y);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tadd(point: Point): Point {\r\n\t\tthis.x = (this.x + point.x);\r\n\t\tthis.y = (this.y + point.y);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsub(point: Point): Point {\r\n\t\tthis.x = (this.x - point.x);\r\n\t\tthis.y = (this.y - point.y);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tclone(): Point {\r\n\t\treturn new Point(this.x, this.y);\r\n\t}\r\n}\r\n","import { Point } from './point';\r\n\r\nexport class Rect {\r\n\tpublic lt: Point;\r\n\tpublic rb: Point;\r\n\r\n\tconstructor(element: HTMLElement);\r\n\tconstructor(ltPoint: Point, rbPoint: Point);\r\n\tconstructor(ltX: number, ltY: number, rbX: number, rbY: number);\r\n\tconstructor(...args) {\r\n\t\tthis.lt = new Point();\r\n\t\tthis.rb = new Point();\r\n\r\n\t\tif (args.length === 1) {\r\n\t\t\tconst elem: HTMLElement = args[0];\r\n\t\t\tconst rawRect = elem.getBoundingClientRect();\r\n\r\n\t\t\tthis.lt = new Point(rawRect.left, rawRect.top);\r\n\t\t\tthis.rb = new Point(rawRect.right, rawRect.bottom);\r\n\t\t}\r\n\r\n\t\tif (args.length === 2) {\r\n\t\t\tthis.lt = args[0];\r\n\t\t\tthis.rb = args[1];\r\n\t\t}\r\n\r\n\t\tif (args.length === 4) {\r\n\t\t\tthis.lt = new Point(args[0], args[1]);\r\n\t\t\tthis.rb = new Point(args[2], args[3]);\r\n\t\t}\r\n\t}\r\n\r\n\tget height(): number {\r\n\t\treturn this.rb.y - this.lt.y;\r\n\t}\r\n\r\n\tget width(): number {\r\n\t\treturn this.rb.x - this.lt.x;\r\n\t}\r\n\r\n\tget center(): Point {\r\n\t\treturn new Point((this.rb.x + this.lt.x) / 2, (this.rb.y + this.lt.y) / 2);\r\n\t}\r\n\r\n\t// Leaves only the intersection of figures\r\n\tmergeRects(...args: Rect[]): this {\r\n\t\targs\r\n\t\t\t.filter((rect) => !!rect)\r\n\t\t\t.forEach((rect) => {\r\n\t\t\t\tthis.lt.max(rect.lt);\r\n\t\t\t\tthis.rb.min(rect.rb);\r\n\t\t\t});\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\tgetCenter(): Point {\r\n\t\treturn this.center;\r\n\t}\r\n\r\n\tclone(): Rect {\r\n\t\treturn new Rect(this.lt.clone(), this.rb.clone());\r\n\t}\r\n\r\n\tisHasCollision(rect: Rect): boolean {\r\n\t\tconst noOverlap = this.lt.x > rect.rb.x ||\r\n\t\t\trect.lt.x > this.rb.x ||\r\n\t\t\tthis.lt.y > rect.rb.y ||\r\n\t\t\trect.lt.y > this.rb.y;\r\n\r\n\t\treturn !noOverlap;\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\nimport { ICommonEventPayload } from '../interfaces/event-payload.interface';\r\nimport { filter, map } from 'rxjs/operators';\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonEventsService {\r\n\tprivate eventsSubject = new Subject>();\r\n\r\n\tpublic emit(event: ICommonEventPayload) {\r\n\t\tthis.eventsSubject.next(event);\r\n\t}\r\n\r\n\tpublic on(name: string): Observable {\r\n\t\treturn this.eventsSubject\r\n\t\t\t.pipe(\r\n\t\t\t\tfilter((event: ICommonEventPayload) => event.name === name),\r\n\t\t\t\tmap((event: ICommonEventPayload) => event.payload),\r\n\t\t\t);\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ICommonContentWrapperEvent } from './common-content-wrapper.interfaces';\r\nimport { CommonEventsService } from '../events/services/events.service';\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonContentWrapperService extends CommonEventsService {\r\n}\r\n","import { ICommonEventPayload } from '../events/interfaces/event-payload.interface';\r\n\r\nexport enum COMMON_CONTENT_WRAPPER_EVENT {\r\n\tRESIZE = 'COMMON_CONTENT_WRAPPER_EVENT.RESIZE',\r\n\tAFTER_RESIZE = 'COMMON_CONTENT_WRAPPER_EVENT.AFTER_RESIZE',\r\n}\r\n\r\nexport interface ICommonContentWrapperEvent extends ICommonEventPayload {\r\n\tname: COMMON_CONTENT_WRAPPER_EVENT,\r\n}\r\n","// Old version ContextMenuFactory src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/containers/context_menu_factory.js\r\n// New version CommonContextMenu src/Common/context-menu/context-menu.service/common-context-menu.service.ts\r\n\r\nimport {\r\n\tApplicationRef,\r\n\tComponentFactoryResolver,\r\n\tComponentRef,\r\n\tElementRef,\r\n\tInjectionToken,\r\n\tInjector,\r\n\tNgZone,\r\n\tRenderer2,\r\n\tRendererFactory2,\r\n} from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport { ComponentPortal, DomPortalOutlet, PortalInjector } from '@angular/cdk/portal';\r\nimport {\r\n\tanimationFrameScheduler,\r\n\tasyncScheduler,\r\n\tfromEvent,\r\n\tObservable,\r\n\tof,\r\n\tSubject,\r\n\tSubscription,\r\n\tmerge,\r\n\tBehaviorSubject,\r\n} from 'rxjs';\r\nimport { debounceTime, delay, observeOn } from 'rxjs/operators';\r\nimport { clone, forIn } from 'lodash';\r\n\r\nimport { commonAnimateStyles } from '../../utilities/style-utils/common-animate-styles';\r\nimport { ANIMATE_DURATION } from '../../constants/common_animate_duration.constant';\r\nimport { ICommonAction, TCallbackFunc } from '../../interfaces/core';\r\nimport {\r\n\tCOMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS,\r\n\tCOMMON_CONTEXT_MENU_ATTACHMENTS,\r\n\tCOMMON_CONTEXT_MENU_EVENT_NAME,\r\n\tCOMMON_CONTEXT_MENU_VERTICAL_ATTACHMENTS,\r\n\tICommonContextMenuAction,\r\n\tICommonContextMenuOptions,\r\n\tICommonContextMenuOptionsContainerForPosition,\r\n\tICommonContextMenuOptionsScreen,\r\n\tICommonContextMenuScreen,\r\n\tTCommonContextMenuElementOrSelector,\r\n\tTCommonContextMenuScreenName,\r\n} from './common-context-menu.interfaces';\r\nimport { CommonContextMenuBaseScreenComponent } from './components/common-context-menu-base-screen.component';\r\nimport { Point } from '../../utilities/point';\r\nimport { Rect } from '../../utilities/rect';\r\nimport { CommonContentWrapperService } from '../../content-wrapper/common-content-wrapper.service';\r\nimport { COMMON_THROTTLE_MILLISECONDS } from '../../controls/control/throttler_milliseconds.constant';\r\nimport { COMMON_CONTENT_WRAPPER_EVENT } from '../../content-wrapper/common-content-wrapper.interfaces';\r\n\r\nexport const COMMON_CONTEXT_MENU_DATA = new InjectionToken('COMMON_CONTEXT_MENU_DATA');\r\nexport const COMMON_CONTEXT_MENU_ENTITY = new InjectionToken>('COMMON_CONTEXT_MENU_ENTITY');\r\nexport const COMMON_CONTEXT_MENU_SCROLL_ELEMENT_CLASS = 'b-common_context_menu-scroll';\r\nexport const COMMON_CONTEXT_MENU_NO_SCROLL_ELEMENT_CLASS = 'j-context_menu-no_scroll';\r\nexport const CONTEXT_MENU_SCREEN_ELEMENT_CLASS = 'b-common_context_menu-screen';\r\nexport const COMMON_CONTEXT_MENU_OPENED_FLAG = new BehaviorSubject(false);\r\n\r\nconst MAX_CONTEXT_MENU_HEIGHT = 768;\r\nconst MIN_RECOMMENDED_CONTEXT_MENU_HEIGHT = 112;\r\nconst TARGET_EL_OPENED_CONTEXT_MENU_CLASS = 'context_menu_opened';\r\nconst CONTEXT_MENU_IN_ANIMATE_CLASS = 'b-common_context_menu-animate';\r\n\r\nconst ANIMATION_DIRECTIONS = {\r\n\t[COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS.LEFT_TO_RIGHT]: {\r\n\t\toldElement: {\r\n\t\t\tend: {\r\n\t\t\t\tleft: 100,\r\n\t\t\t},\r\n\t\t},\r\n\t\tnewElement: {\r\n\t\t\tstart: {\r\n\t\t\t\tleft: -100,\r\n\t\t\t},\r\n\t\t},\r\n\t},\r\n\t[COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS.RIGHT_TO_LEFT]: {\r\n\t\toldElement: {\r\n\t\t\tend: {\r\n\t\t\t\tleft: -100,\r\n\t\t\t},\r\n\t\t},\r\n\t\tnewElement: {\r\n\t\t\tstart: {\r\n\t\t\t\tleft: 100,\r\n\t\t\t},\r\n\t\t},\r\n\t},\r\n};\r\n\r\nexport class CommonContextMenu {\r\n\tpublic activeScreenName: TCommonContextMenuScreenName = 'default';\r\n\tpublic get activeScreenOptions(): ICommonContextMenuOptionsScreen {\r\n\t\treturn this.options && this.options.screens[this.activeScreenName] || null;\r\n\t}\r\n\tpublic activeScreenElem: HTMLElement = null;\r\n\tpublic activeScreenComponentPortal: ComponentPortal = null;\r\n\tpublic activeScreenComponentRef: ComponentRef = null;\r\n\tpublic id: string;\r\n\tpublic isOpen: boolean = false;\r\n\tpublic isInAnimate: boolean = false;\r\n\r\n\tprivate options: ICommonContextMenuOptions = {\r\n\t\tdismissClickIgnore: [],\r\n\t\tcontainersForPosition: [],\r\n\t\tcssClasses: [],\r\n\t\tcssAdditionalClasses: [],\r\n\t\twithOpenAnimate: false,\r\n\t\twithChangeScreenAnimate: false,\r\n\t\tattachment: COMMON_CONTEXT_MENU_ATTACHMENTS.LEFT,\r\n\t\tverticalAttachment: COMMON_CONTEXT_MENU_VERTICAL_ATTACHMENTS.BOTTOM,\r\n\t\tcontainerXOffset: 0,\r\n\t\tcontainerYOffset: 64,\r\n\t\ttargetXOffset: 0,\r\n\t\ttargetYOffset: 0,\r\n\t} as ICommonContextMenuOptions;\r\n\tprivate readonly preparedOptionsDismissClickIgnore: HTMLElement[] = [];\r\n\tprivate readonly preparedOptionsContainersForPosition: Array = [];\r\n\tprivate readonly contextMenuContainerEl: HTMLDivElement = null;\r\n\tprivate readonly contextMenuEl: HTMLDivElement = null;\r\n\tprivate readonly contextMenuBodyEl: HTMLDivElement = null;\r\n\tprivate hostPortal: DomPortalOutlet = null;\r\n\tprivate readonly renderer: Renderer2 = null;\r\n\tprivate readonly bodyElement: HTMLBodyElement;\r\n\tprivate readonly htmlElement: HTMLElement;\r\n\tprivate domEventListeners: TCallbackFunc[] = [];\r\n\tprivate subscriptions: Subscription[] = [];\r\n\tprivate openUpDirection = false;\r\n\tprivate maxHeight: number;\r\n\tprivate eventSubjects = new Map>();\r\n\r\n\tprivate defAnimates: {\r\n\t\t[name: string]: (...args) => Promise,\r\n\t} = Object.entries(ANIMATION_DIRECTIONS).reduce((defAnimates, [name, directionRules]) => {\r\n\t\tdefAnimates[name] = async (\r\n\t\t\tnewScreenElm: HTMLElement,\r\n\t\t\toldScreenElm: HTMLElement,\r\n\t\t\theightControlling?: boolean,\r\n\t\t) => {\r\n\t\t\tlet height: number = newScreenElm.offsetHeight;\r\n\t\t\tlet newWidth: number;\r\n\t\t\tlet oldWidth: number;\r\n\t\t\t{\r\n\t\t\t\t// we need to hide old element to calculate new element's width correctly\r\n\t\t\t\tthis.renderer.setStyle(oldScreenElm, 'display', 'none');\r\n\t\t\t\tthis.renderer.setStyle(this.renderer.parentNode(newScreenElm), 'width', 'auto');\r\n\t\t\t\tnewWidth = newScreenElm.offsetWidth;\r\n\t\t\t\tthis.renderer.setStyle(oldScreenElm, 'display', 'block');\r\n\t\t\t}\r\n\t\t\tlet widthDifference: number;\r\n\t\t\t{\r\n\t\t\t\t// we need to hide new element to calculate width difference between new and old elements correctly\r\n\t\t\t\tthis.renderer.setStyle(newScreenElm, 'display', 'none');\r\n\t\t\t\tthis.renderer.setStyle(this.renderer.parentNode(oldScreenElm), 'width', 'auto');\r\n\t\t\t\toldWidth = oldScreenElm.offsetWidth;\r\n\t\t\t\twidthDifference = newWidth - oldScreenElm.offsetWidth;\r\n\t\t\t\tthis.renderer.setStyle(newScreenElm, 'display', 'block');\r\n\t\t\t}\r\n\t\t\tconst currentLeft = parseInt(window.getComputedStyle(this.contextMenuContainerEl).left, 10);\r\n\t\t\tlet left: number;\r\n\t\t\t{\r\n\t\t\t\tswitch (this.options.attachment) {\r\n\t\t\t\t\tcase COMMON_CONTEXT_MENU_ATTACHMENTS.CENTER:\r\n\t\t\t\t\t\tleft = currentLeft - widthDifference / 2;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase COMMON_CONTEXT_MENU_ATTACHMENTS.RIGHT:\r\n\t\t\t\t\t\tleft = currentLeft - widthDifference;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase COMMON_CONTEXT_MENU_ATTACHMENTS.LEFT:\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tleft = currentLeft;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (heightControlling) {\r\n\t\t\t\theight = Math.min(height, this.maxHeight);\r\n\t\t\t}\r\n\r\n\t\t\tlet noScrollHeight: number = 0;\r\n\t\t\tthis.renderer.addClass(this.contextMenuEl, CONTEXT_MENU_IN_ANIMATE_CLASS);\r\n\r\n\t\t\tconst setHeightScrollElem = (contextHeight: number) => {\r\n\t\t\t\tthis.renderer.setStyle(\r\n\t\t\t\t\tthis.contextMenuBodyEl.querySelector(`.${COMMON_CONTEXT_MENU_SCROLL_ELEMENT_CLASS}`),\r\n\t\t\t\t\t'height',\r\n\t\t\t\t\t(contextHeight - noScrollHeight) + 'px',\r\n\t\t\t\t);\r\n\t\t\t};\r\n\r\n\t\t\tthis.renderer.addClass(newScreenElm, CONTEXT_MENU_SCREEN_ELEMENT_CLASS);\r\n\r\n\t\t\tif (heightControlling) {\r\n\t\t\t\tnoScrollHeight = this.calcNoScrollHeight();\r\n\t\t\t}\r\n\r\n\t\t\tthis.renderer.appendChild(this.contextMenuBodyEl, newScreenElm);\r\n\r\n\t\t\tif (heightControlling && this.openUpDirection) {\r\n\t\t\t\tsetHeightScrollElem(height);\r\n\t\t\t}\r\n\r\n\t\t\tthis.renderer.setStyle(oldScreenElm, 'position', 'absolute');\r\n\t\t\tthis.renderer.setStyle(newScreenElm, 'position', 'absolute');\r\n\r\n\t\t\tawait Promise.all([\r\n\t\t\t\tcommonAnimateStyles({\r\n\t\t\t\t\tduration: ANIMATE_DURATION,\r\n\t\t\t\t\telement: this.contextMenuBodyEl,\r\n\t\t\t\t\tstyles: {\r\n\t\t\t\t\t\theight: [this.contextMenuBodyEl.offsetHeight, height, 'px'],\r\n\t\t\t\t\t\twidth: [oldWidth, newWidth, 'px'],\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t\tcommonAnimateStyles({\r\n\t\t\t\t\tduration: ANIMATE_DURATION,\r\n\t\t\t\t\telement: newScreenElm,\r\n\t\t\t\t\tstyles: {\r\n\t\t\t\t\t\tleft: [directionRules.newElement.start.left, 0, '%'],\r\n\t\t\t\t\t\topacity: [0, 1],\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t\tcommonAnimateStyles({\r\n\t\t\t\t\tduration: ANIMATE_DURATION,\r\n\t\t\t\t\telement: oldScreenElm,\r\n\t\t\t\t\tstyles: {\r\n\t\t\t\t\t\tleft: [0, directionRules.oldElement.end.left, '%'],\r\n\t\t\t\t\t\topacity: [1, 0],\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t\tcommonAnimateStyles({\r\n\t\t\t\t\tduration: ANIMATE_DURATION,\r\n\t\t\t\t\telement: this.contextMenuContainerEl,\r\n\t\t\t\t\tstyles: {\r\n\t\t\t\t\t\tleft: [currentLeft, left, 'px'],\r\n\t\t\t\t\t},\r\n\t\t\t\t}),\r\n\t\t\t]);\r\n\r\n\t\t\tthis.renderer.removeChild(\r\n\t\t\t\tthis.renderer.parentNode(oldScreenElm),\r\n\t\t\t\toldScreenElm,\r\n\t\t\t);\r\n\t\t\tthis.renderer.setStyle(newScreenElm, 'position', 'relative');\r\n\t\t\tthis.renderer.setStyle(this.contextMenuBodyEl, 'height', height + 'px');\r\n\r\n\t\t\tif (heightControlling && !this.openUpDirection) {\r\n\t\t\t\tsetHeightScrollElem(height);\r\n\t\t\t}\r\n\t\t\tthis.renderer.removeClass(this.contextMenuEl, CONTEXT_MENU_IN_ANIMATE_CLASS);\r\n\t\t};\r\n\r\n\t\treturn defAnimates;\r\n\t}, {});\r\n\r\n\tconstructor(\r\n\t\toptions: ICommonContextMenuOptions,\r\n\t\tprivate injector: Injector,\r\n\t) {\r\n\t\tObject.assign(this.options, options);\r\n\r\n\t\tconst rendererFactory = this.injector.get(RendererFactory2);\r\n\r\n\t\tthis.id = this.options.id;\r\n\t\tthis.renderer = rendererFactory.createRenderer(null, null);\r\n\t\tthis.bodyElement = this.renderer.selectRootElement('body', true);\r\n\t\tthis.htmlElement = this.renderer.selectRootElement('html', true);\r\n\r\n\t\t// some options defaults\r\n\t\tif (typeof this.options.scrollContainer === 'string') {\r\n\t\t\tthis.options.scrollContainer = this.bodyElement.querySelector(this.options.scrollContainer) as HTMLElement;\r\n\t\t}\r\n\t\tif (Array.isArray(this.options.dismissClickIgnore)) {\r\n\t\t\tthis.preparedOptionsDismissClickIgnore = this.options.dismissClickIgnore\r\n\t\t\t\t.filter((element) => !!element)\r\n\t\t\t\t.map((element) => this.convertToHTMLElement(element));\r\n\t\t}\r\n\t\tif (Array.isArray(this.options.containersForPosition)) {\r\n\t\t\tthis.preparedOptionsContainersForPosition = this.options.containersForPosition\r\n\t\t\t\t.map((containersForPosition) => ({\r\n\t\t\t\t\t...containersForPosition,\r\n\t\t\t\t\telement: this.convertToHTMLElement(containersForPosition.element),\r\n\t\t\t\t}));\r\n\t\t}\r\n\r\n\t\t// generate context menu DOM container and put it into options.parentEl\r\n\t\tif (!this.options.parentEl) {\r\n\t\t\tif (this.options.appendToBody) {\r\n\t\t\t\tthis.options.parentEl = this.bodyElement;\r\n\t\t\t} else {\r\n\t\t\t\tthis.options.parentEl = this.renderer.parentNode(this.options.targetEl);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.contextMenuContainerEl = this.renderer.createElement('div');\r\n\t\t[\r\n\t\t\t'b-common_context_menu-container',\r\n\t\t\tthis.getContextMenuElAttachmentClass(),\r\n\t\t\t...this.options.cssClasses,\r\n\t\t\t...this.options.cssAdditionalClasses,\r\n\t\t].forEach((className) => this.renderer.addClass(this.contextMenuContainerEl, className));\r\n\t\tthis.renderer.appendChild(this.options.parentEl, this.contextMenuContainerEl);\r\n\r\n\t\tthis.contextMenuEl = this.renderer.createElement('div');\r\n\t\tthis.renderer.addClass(this.contextMenuEl, 'b-common_context_menu');\r\n\t\tthis.renderer.appendChild(this.contextMenuContainerEl, this.contextMenuEl);\r\n\r\n\t\tif (this.options.shouldStopClickPropagation) {\r\n\t\t\t// should subscribe separately because domEventListeners are removed before click occurs\r\n\t\t\t// unsubscribe after AFTER_CLOSE event\r\n\t\t\tthis.contextMenuEl.addEventListener('click', this.stopPropagation);\r\n\t\t}\r\n\t\tthis.contextMenuBodyEl = this.renderer.createElement('div');\r\n\t\tthis.renderer.addClass(this.contextMenuBodyEl, 'b-common_context_menu-content');\r\n\t\tthis.renderer.appendChild(this.contextMenuEl, this.contextMenuBodyEl);\r\n\r\n\t\t// add mousedown event listener on next event loop tick to ignore current mousedown event\r\n\t\t// capture: true is required, otherwise the event does not reach the listener, if the element that triggered the event is destroyed\r\n\t\tsetTimeout(() => {\r\n\t\t\tconst listener = this.addEventListener(\r\n\t\t\t\tthis.bodyElement,\r\n\t\t\t\t'mousedown',\r\n\t\t\t\t(event) => this.dismissClickHandler(event),\r\n\t\t\t\t{capture: true},\r\n\t\t\t);\r\n\t\t\tthis.domEventListeners.push(listener);\r\n\t\t});\r\n\r\n\t\tthis.open();\r\n\t}\r\n\r\n\tasync open() {\r\n\t\tCOMMON_CONTEXT_MENU_OPENED_FLAG.next(true);\r\n\r\n\t\tthis.renderer.setStyle(this.contextMenuContainerEl, 'display', 'none');\r\n\t\tthis.renderer.setStyle(this.contextMenuBodyEl, 'height', '');\r\n\r\n\t\tawait this.portalScreen(this.activeScreenName);\r\n\t\tthis.renderer.setStyle(this.activeScreenElem, 'display', 'block');\r\n\t\tthis.reposition();\r\n\t\tthis.resize();\r\n\r\n\t\tif (this.options.withOpenAnimate) {\r\n\t\t\tthis.renderer.addClass(this.contextMenuContainerEl, 'b-common_context_menu-container--with_open_animate');\r\n\t\t}\r\n\r\n\t\tthis.isOpen = true;\r\n\t\tthis.renderer.addClass(this.options.targetEl, TARGET_EL_OPENED_CONTEXT_MENU_CLASS);\r\n\r\n\t\tif (this.options.scrollContainer) {\r\n\t\t\tconst listener = this.renderer.listen(this.options.scrollContainer, 'scroll', () => {\r\n\t\t\t\tif (this.isOpen) {\r\n\t\t\t\t\tthis.reposition();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tthis.domEventListeners.push(listener);\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst listener = this.renderer.listen(this.contextMenuBodyEl, 'click', () => {\r\n\t\t\t\tthis.emitEvent({\r\n\t\t\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CLICK,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\tthis.domEventListeners.push(listener);\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst listener = this.renderer.listen(this.contextMenuBodyEl, 'mouseenter', () => {\r\n\t\t\t\tthis.emitEvent({\r\n\t\t\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.MOUSEENTER,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\tthis.domEventListeners.push(listener);\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst listener = this.renderer.listen(this.contextMenuBodyEl, 'mouseleave', () => {\r\n\t\t\t\tthis.emitEvent({\r\n\t\t\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.MOUSELEAVE,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\tthis.domEventListeners.push(listener);\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst commonContentWrapperService = this.injector.get(CommonContentWrapperService);\r\n\t\t\tconst subscription = merge(\r\n\t\t\t\tfromEvent(this.injector.get(DOCUMENT).defaultView, 'resize'),\r\n\t\t\t\tcommonContentWrapperService.on(COMMON_CONTENT_WRAPPER_EVENT.AFTER_RESIZE),\r\n\t\t\t)\r\n\t\t\t\t.pipe(debounceTime(COMMON_THROTTLE_MILLISECONDS))\r\n\t\t\t\t.subscribe(() => {\r\n\t\t\t\t\tif (this.isOpen) {\r\n\t\t\t\t\t\tthis.reposition();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\tthis.subscriptions.push(subscription);\r\n\t\t}\r\n\r\n\t\tawait this.emitEventAfterAnimationFrame(\r\n\t\t\t{\r\n\t\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_OPEN,\r\n\t\t\t},\r\n\t\t\tthis.options.withOpenAnimate ? 300 : 0, // 300ms is the .b-common_context_menu-container--with_open_animate 's animation transition time\r\n\t\t);\r\n\t}\r\n\r\n\t// Subscription for sending and receiving events in the context menu\r\n\tonEvent(eventName: COMMON_CONTEXT_MENU_EVENT_NAME): Observable {\r\n\t\treturn this.getEventSubject(eventName).asObservable();\r\n\t}\r\n\r\n\t// Create custom event in ContextMenu\r\n\temitCustomEvent(payload: ICommonAction): void {\r\n\t\tthis.emitEvent(payload);\r\n\t}\r\n\r\n\t// Gives current active screen\r\n\tgetActiveScreen(): ICommonContextMenuScreen {\r\n\t\treturn {\r\n\t\t\tisActive: !this.isInAnimate,\r\n\t\t\tname: this.activeScreenName,\r\n\t\t\toptions: this.activeScreenOptions,\r\n\t\t};\r\n\t}\r\n\r\n\t// Is the context menu open\r\n\tisOpened(): boolean {\r\n\t\treturn this.isOpen;\r\n\t}\r\n\r\n\t// Changes the screen to the default\r\n\tasync changeScreenToDefault(animationName?: COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS): Promise {\r\n\t\tif (!this.canChangeScreenTo('default')) return;\r\n\r\n\t\tawait this.changeScreenTo('default', animationName);\r\n\t\tthis.renderer.setStyle(this.activeScreenElem, 'display', 'block');\r\n\t\tthis.reposition();\r\n\t\tthis.resize();\r\n\t}\r\n\r\n\t// Changes the screen to a new one\r\n\tasync changeScreenTo(\r\n\t\tscreenName: TCommonContextMenuScreenName,\r\n\t\tanimationName?: COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS,\r\n\t): Promise {\r\n\t\tconst oldHostPortal = this.hostPortal;\r\n\t\tconst oldScreenElem = this.activeScreenElem;\r\n\t\tconst animate = this.options.withChangeScreenAnimate ? animationName : false;\r\n\r\n\t\tif (this.canChangeScreenTo(screenName)) {\r\n\t\t\tthis.isInAnimate = true;\r\n\t\t\tthis.activeScreenName = screenName;\r\n\r\n\t\t\tawait this.portalScreen(screenName);\r\n\r\n\t\t\tif (animate) {\r\n\t\t\t\tawait this.defAnimates[animate](this.activeScreenElem, oldScreenElem, this.activeScreenOptions.heightControlling);\r\n\r\n\t\t\t\toldHostPortal.detach();\r\n\t\t\t} else {\r\n\t\t\t\toldHostPortal.detach();\r\n\t\t\t\tif (screenName !== 'default') {\r\n\t\t\t\t\tthis.reposition();\r\n\t\t\t\t}\r\n\t\t\t\tthis.resize();\r\n\t\t\t}\r\n\t\t\tthis.isInAnimate = false;\r\n\r\n\t\t\t// run ngZone fake task for start component portal life cycle\r\n\t\t\t// otherwise rendering after the keyboard event will be with a mistake\r\n\t\t\tthis.injector.get(NgZone).run(() => null);\r\n\r\n\t\t\tawait this.emitEventAfterAnimationFrame({\r\n\t\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CHANGE_SCREEN,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\treturn Promise.reject(`Cannot to change screen (name: ${screenName})`);\r\n\t\t}\r\n\t}\r\n\r\n\t// Re-calculates the position for the context menu\r\n\treposition (): void {\r\n\t\tlet contextMenuRect: Rect;\r\n\t\tlet isRightAlign;\r\n\t\tlet coords: { left: string, top: string, right: string };\r\n\t\tconst targetEl = this.options.targetEl;\r\n\r\n\t\tthis.renderer.setStyle(this.contextMenuContainerEl, 'display', 'block');\r\n\t\tthis.renderer.setStyle(this.contextMenuContainerEl, 'top', '-9999px');\r\n\t\tthis.renderer.setStyle(this.contextMenuContainerEl, 'left', '-9999px');\r\n\t\tconst contextMenuBodyRect = this.contextMenuBodyEl.getBoundingClientRect();\r\n\t\tconst contextMenuSizes = new Point(contextMenuBodyRect.width, contextMenuBodyRect.height);\r\n\t\tconst targetRect = this.calcTargetRect(targetEl as HTMLElement);\r\n\t\tconst containerRect = this.calcContainerRect();\r\n\t\tcontextMenuRect = this.calcContextMenuRect(targetRect, contextMenuSizes);\r\n\t\tconst openUpDirection = this.checkAndUpdateOpenUpDirection(contextMenuRect, containerRect, targetRect);\r\n\t\tif (openUpDirection) {\r\n\t\t\tthis.renderer.addClass(this.contextMenuContainerEl, 'b-common_context_menu--down_oriented');\r\n\t\t}\r\n\r\n\t\tcontextMenuRect = this.applyDirection(contextMenuRect, targetRect, contextMenuSizes);\r\n\t\t[contextMenuRect, isRightAlign] = this.applyContainerRestrictions(contextMenuRect, containerRect, contextMenuSizes);\r\n\t\tif (isRightAlign) {\r\n\t\t\tthis.renderer.addClass(this.contextMenuContainerEl, 'b-common_context_menu--right_align');\r\n\t\t} else {\r\n\t\t\tthis.renderer.removeClass(this.contextMenuContainerEl, 'b-common_context_menu--right_align');\r\n\t\t}\r\n\r\n\t\tthis.maxHeight = this.calcMaxHeight(contextMenuRect, containerRect);\r\n\r\n\t\tcoords = this.getCoords(contextMenuRect, targetRect, isRightAlign);\r\n\r\n\t\tcoords = this.applyContainerOffset(coords, isRightAlign);\r\n\t\tforIn(coords, (styleValue, styleName) => {\r\n\t\t\tthis.renderer.setStyle(\r\n\t\t\t\tthis.contextMenuContainerEl,\r\n\t\t\t\tstyleName,\r\n\t\t\t\t(typeof styleValue === 'number') ? styleValue + 'px' : styleValue,\r\n\t\t\t);\r\n\t\t});\r\n\t}\r\n\r\n\t// Re-size context menu (with reposition or not)\r\n\tresize(withReposition?: boolean): void {\r\n\t\tconst scrollElement = this.contextMenuBodyEl.querySelector('.b-common_context_menu-scroll');\r\n\t\tconst scrollElementScrollTop: number = scrollElement && scrollElement.scrollTop;\r\n\r\n\t\tlet height: number;\r\n\t\tlet noScrollHeight: number;\r\n\t\tlet activeScreenHeight: number;\r\n\t\tlet activeScreenHeightControlling: boolean;\r\n\t\tlet activeScreenIsHigh: boolean;\r\n\r\n\t\tif (scrollElement) this.renderer.setStyle(scrollElement, 'height', '');\r\n\t\tthis.renderer.setStyle(this.contextMenuBodyEl, 'height', '');\r\n\t\tthis.renderer.setStyle(this.contextMenuContainerEl, 'width', (this.options.targetEl as HTMLElement).getBoundingClientRect().width + 'px');\r\n\r\n\t\tthis.renderer.addClass(this.activeScreenElem, CONTEXT_MENU_SCREEN_ELEMENT_CLASS);\r\n\r\n\t\tactiveScreenHeight = this.activeScreenElem.getBoundingClientRect().height;\r\n\t\tactiveScreenHeightControlling = this.activeScreenOptions.heightControlling;\r\n\t\tactiveScreenIsHigh = this.maxHeight < activeScreenHeight;\r\n\r\n\t\tif (withReposition && (!activeScreenHeightControlling || (activeScreenHeightControlling && activeScreenIsHigh))) {\r\n\t\t\tthis.reposition();\r\n\t\t\tthis.resize(false);\r\n\t\t} else {\r\n\t\t\tif (activeScreenHeightControlling) {\r\n\t\t\t\theight = Math.min(activeScreenHeight, this.maxHeight);\r\n\t\t\t} else {\r\n\t\t\t\theight = activeScreenHeight;\r\n\t\t\t}\r\n\r\n\t\t\tnoScrollHeight = this.calcNoScrollHeight();\r\n\r\n\r\n\t\t\tthis.renderer.setStyle(this.contextMenuBodyEl, 'height', height + 'px');\r\n\t\t\tif (scrollElement) this.renderer.setStyle(scrollElement, 'height', (height - noScrollHeight) + 'px');\r\n\t\t}\r\n\r\n\t\tif (scrollElement && scrollElementScrollTop) {\r\n\t\t\tscrollElement.scrollTop = scrollElementScrollTop;\r\n\t\t}\r\n\t}\r\n\r\n\t// Closes and destroys the context menu\r\n\tclose(): void {\r\n\t\tCOMMON_CONTEXT_MENU_OPENED_FLAG.next(false);\r\n\r\n\t\tthis.emitEvent({\r\n\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.BEFORE_CLOSE,\r\n\t\t});\r\n\t\t// remove rendered component\r\n\t\tthis.hostPortal.detach();\r\n\t\t// destroy DOM container\r\n\t\tthis.renderer.removeChild(\r\n\t\t\tthis.renderer.parentNode(this.contextMenuContainerEl),\r\n\t\t\tthis.contextMenuContainerEl,\r\n\t\t);\r\n\t\t// stop listening DOM events\r\n\t\tthis.domEventListeners.forEach((listener) => listener());\r\n\t\t// unsubscribe subscriptions\r\n\t\tthis.subscriptions.forEach((subscription) => subscription.unsubscribe());\r\n\r\n\t\tthis.renderer.removeClass(this.options.targetEl, TARGET_EL_OPENED_CONTEXT_MENU_CLASS);\r\n\t\tthis.renderer.destroy();\r\n\r\n\t\tthis.isOpen = false;\r\n\r\n\t\t// run ngZone fake task for start component portal life cycle\r\n\t\tthis.injector.get(NgZone).run(() => null);\r\n\r\n\t\tthis.emitEventAfterAnimationFrame({\r\n\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CLOSE,\r\n\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tthis.eventSubjects.forEach((eventSubjects) => eventSubjects.complete());\r\n\t\t\t\tif (this.options.shouldStopClickPropagation) {\r\n\t\t\t\t\tthis.contextMenuEl.removeEventListener('click', this.stopPropagation);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t}\r\n\r\n\tprivate emitEvent(payload: ICommonAction): void {\r\n\t\tif (this.options.events && this.options.events[payload.type]) {\r\n\t\t\tthis.options.events[payload.type](payload);\r\n\t\t}\r\n\t\tthis.getEventSubject(payload.type).next(payload);\r\n\t}\r\n\r\n\tprivate async emitEventAfterAnimationFrame(payload: ICommonAction, delayTime = 0): Promise {\r\n\t\tawait of(null)\r\n\t\t\t.pipe(\r\n\t\t\t\tdelay(\r\n\t\t\t\t\tdelayTime, // we need delay for waiting of animation\r\n\t\t\t\t\tanimationFrameScheduler, // waiting next animationFrame after delay\r\n\t\t\t\t),\r\n\t\t\t\tobserveOn(asyncScheduler), // put our code on next macroTasks queue (we need it because, our code will run before browser's rendering callbacks)\r\n\t\t\t)\r\n\t\t\t.toPromise();\r\n\r\n\t\tthis.emitEvent(payload);\r\n\t}\r\n\r\n\tprivate getEventSubject(eventName: COMMON_CONTEXT_MENU_EVENT_NAME): Subject {\r\n\t\tif (!this.eventSubjects.has(eventName)) this.eventSubjects.set(eventName, new Subject());\r\n\r\n\t\treturn this.eventSubjects.get(eventName);\r\n\t}\r\n\r\n\tprivate canChangeScreenTo(screen: TCommonContextMenuScreenName): boolean {\r\n\t\treturn screen && this.activeScreenName !== screen && this.options.screens[screen] && !this.isInAnimate;\r\n\t}\r\n\r\n\tprivate dismissClickHandler (event) {\r\n\t\tlet parentElmIsFind;\r\n\r\n\t\tif (this.isOpen) {\r\n\t\t\tparentElmIsFind = this.findParentElement(event.target, this.contextMenuContainerEl, this.preparedOptionsDismissClickIgnore);\r\n\r\n\t\t\tif (!parentElmIsFind) {\r\n\t\t\t\t// pass .close() method to next event loop tick for waiting complete current click event propagation\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.close();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprivate convertToHTMLElement(element: TCommonContextMenuElementOrSelector): HTMLElement {\r\n\t\tif (typeof element === 'string') {\r\n\t\t\treturn this.htmlElement.querySelector(element);\r\n\t\t} else if (element instanceof ElementRef) {\r\n\t\t\treturn element.nativeElement;\r\n\t\t}\r\n\r\n\t\treturn element;\r\n\t}\r\n\r\n\tprivate findParentElement (node: HTMLElement, element: HTMLElement, dismissClickIgnore: HTMLElement[]) {\r\n\t\tconst compareWithNode = (x) => x === node;\r\n\r\n\t\twhile (node !== this.htmlElement) {\r\n\t\t\tif (node && node !== element && !dismissClickIgnore.find(compareWithNode)) {\r\n\t\t\t\tnode = this.renderer.parentNode(node);\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tprivate createInjector(screenData?: any): PortalInjector {\r\n\t\tconst injectorTokens = new WeakMap();\r\n\r\n\t\tif (screenData) injectorTokens.set(COMMON_CONTEXT_MENU_DATA, screenData);\r\n\t\tinjectorTokens.set(COMMON_CONTEXT_MENU_ENTITY, this);\r\n\r\n\t\tif (Array.isArray(this.options.injectedTokens)) {\r\n\t\t\tfor (const injectedToken of this.options.injectedTokens) {\r\n\t\t\t\tinjectorTokens.set(injectedToken.token, injectedToken.value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn new PortalInjector(this.injector, injectorTokens);\r\n\t}\r\n\r\n\tprivate getContextMenuElAttachmentClass(): string {\r\n\t\tconst attachmentToClassName = {\r\n\t\t\t[COMMON_CONTEXT_MENU_ATTACHMENTS.CENTER]: 'center',\r\n\t\t\t[COMMON_CONTEXT_MENU_ATTACHMENTS.LEFT]: 'left',\r\n\t\t\t[COMMON_CONTEXT_MENU_ATTACHMENTS.RIGHT]: 'right',\r\n\t\t};\r\n\r\n\t\treturn 'b-common_context_menu--attachment_' + attachmentToClassName[this.options.attachment];\r\n\t}\r\n\r\n\tprivate findElementWithPosition (element: HTMLElement): HTMLElement {\r\n\t\tlet position;\r\n\r\n\t\tif (element) {\r\n\t\t\twhile (element && element !== this.htmlElement) {\r\n\t\t\t\tposition = window.getComputedStyle(element).getPropertyValue('position');\r\n\r\n\t\t\t\tif (['relative', 'absolute', 'fixed'].includes(position) || element === this.bodyElement ) {\r\n\t\t\t\t\treturn element;\r\n\t\t\t\t} else {\r\n\t\t\t\t\telement = this.renderer.parentNode(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tprivate applyContainerOffset(coords, isRightAlign) {\r\n\t\tconst element = this.findElementWithPosition(this.options.parentEl as HTMLElement);\r\n\t\tcoords = clone(coords);\r\n\r\n\t\tif (element) {\r\n\t\t\tconst offset = element.getBoundingClientRect();\r\n\t\t\tcoords.top -= offset.top;\r\n\r\n\t\t\tif (!isRightAlign) {\r\n\t\t\t\tcoords.left -= offset.left;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn coords;\r\n\t}\r\n\r\n\tprivate getCoords(contextMenuRect, targetRect, isRightAlign) {\r\n\t\tlet coordsTop;\r\n\t\tlet left;\r\n\t\tlet right;\r\n\r\n\t\tif (this.openUpDirection) {\r\n\t\t\tcoordsTop = targetRect.lt.y - this.options.targetYOffset;\r\n\t\t} else {\r\n\t\t\tcoordsTop = targetRect.rb.y + this.options.targetYOffset;\r\n\t\t}\r\n\r\n\t\tif (isRightAlign) {\r\n\t\t\tleft = 'auto';\r\n\t\t\tright = this.options.containerXOffset;\r\n\t\t} else {\r\n\t\t\tleft = contextMenuRect.lt.x + this.options.containerXOffset;\r\n\t\t\tright = 'auto';\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\ttop: coordsTop,\r\n\t\t\tleft,\r\n\t\t\tright,\r\n\t\t};\r\n\t}\r\n\r\n\tprivate calcNoScrollHeight(): number {\r\n\t\tconst noScrollElements: NodeListOf = this.contextMenuBodyEl.querySelectorAll(`.${COMMON_CONTEXT_MENU_NO_SCROLL_ELEMENT_CLASS}`);\r\n\t\tlet noScrollHeight = 0;\r\n\r\n\t\tif (noScrollElements && noScrollElements.length) {\r\n\t\t\tnoScrollElements.forEach( (el) => {\r\n\t\t\t\tnoScrollHeight += el.offsetHeight;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn noScrollHeight;\r\n\t}\r\n\r\n\tprivate calcMaxHeight(contextMenuRect, containerRect) {\r\n\t\tlet maxHeight;\r\n\r\n\t\tif (this.openUpDirection) {\r\n\t\t\tmaxHeight = contextMenuRect.rb.y - containerRect.lt.y - this.options.containerYOffset;\r\n\t\t} else {\r\n\t\t\tmaxHeight = containerRect.rb.y - contextMenuRect.lt.y - this.options.containerYOffset;\r\n\t\t}\r\n\r\n\t\treturn Math.min(maxHeight, MAX_CONTEXT_MENU_HEIGHT);\r\n\t}\r\n\r\n\tprivate applyContainerRestrictions(contextMenuRect, containerRect, contextMenuSizes) {\r\n\t\tconst rightAlign = contextMenuRect.rb.x > containerRect.rb.x;\r\n\t\tconst leftAlign = contextMenuRect.lt.x < containerRect.lt.x;\r\n\r\n\t\tif (rightAlign) {\r\n\t\t\tcontextMenuRect.lt.x = containerRect.rb.x - contextMenuSizes.x - this.options.containerXOffset * 2;\r\n\t\t\tcontextMenuRect.rb.x = containerRect.rb.x;\r\n\t\t} else if (leftAlign) {\r\n\t\t\tcontextMenuRect.lt.x = containerRect.lt.x;\r\n\t\t\tcontextMenuRect.rb.x = containerRect.lt.x + contextMenuSizes.x + this.options.containerXOffset * 2;\r\n\t\t}\r\n\r\n\t\treturn [contextMenuRect, rightAlign];\r\n\t}\r\n\r\n\tprivate applyDirection(contextMenuRect, targetRect, contextMenuSizes) {\r\n\t\tif (this.openUpDirection) {\r\n\t\t\tcontextMenuRect.lt.y = this.options.targetYOffset + targetRect.lt.y + contextMenuSizes.y;\r\n\t\t\tcontextMenuRect.rb.y = this.options.targetYOffset + targetRect.lt.y;\r\n\t\t}\r\n\r\n\t\treturn contextMenuRect;\r\n\t}\r\n\r\n\tprivate checkAndUpdateOpenUpDirection(contextMenuRect, containerRect, targetRect): boolean {\r\n\t\tif (this.openUpDirection) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst doesNotFitDown = contextMenuRect.rb.y > (containerRect.rb.y - this.options.containerYOffset);\r\n\t\tconst preferredUp = this.options.verticalAttachment === COMMON_CONTEXT_MENU_VERTICAL_ATTACHMENTS.TOP;\r\n\t\tlet openUp: boolean;\r\n\r\n\t\tif (this.activeScreenOptions.heightControlling) {\r\n\t\t\tconst noScrollHeight = this.calcNoScrollHeight();\r\n\t\t\tconst estimatedHeight = containerRect.rb.y - targetRect.rb.y;\r\n\t\t\tconst expectedHeight = MIN_RECOMMENDED_CONTEXT_MENU_HEIGHT + noScrollHeight + this.options.containerYOffset;\r\n\r\n\t\t\topenUp = (doesNotFitDown || preferredUp) && (estimatedHeight < expectedHeight);\r\n\t\t} else {\r\n\t\t\tconst canOpenUp = targetRect.lt.y > contextMenuRect.height + this.options.containerYOffset;\r\n\r\n\t\t\topenUp = (doesNotFitDown || preferredUp) && canOpenUp;\r\n\t\t}\r\n\r\n\t\t// if has once opened up - we save this situation that didn't jump up/down any more\r\n\t\tif (openUp) {\r\n\t\t\tthis.openUpDirection = true;\r\n\t\t}\r\n\r\n\t\treturn this.openUpDirection;\r\n\t}\r\n\r\n\tprivate calcContextMenuRect(targetRect, contextMenuSizes): Rect {\r\n\t\tconst options = this.options;\r\n\t\tlet leftPointX = 0;\r\n\t\tlet rightPointX = 0;\r\n\r\n\t\tif (options.attachment === COMMON_CONTEXT_MENU_ATTACHMENTS.LEFT) {\r\n\t\t\tleftPointX = targetRect.lt.x + options.targetXOffset;\r\n\t\t\trightPointX = targetRect.lt.x + contextMenuSizes.x + options.targetXOffset;\r\n\r\n\t\t} else if (options.attachment === COMMON_CONTEXT_MENU_ATTACHMENTS.CENTER) {\r\n\t\t\tleftPointX = targetRect.getCenter().x - contextMenuSizes.x / 2;\r\n\t\t\trightPointX = targetRect.getCenter().x + contextMenuSizes.x / 2;\r\n\r\n\t\t} else if (options.attachment === COMMON_CONTEXT_MENU_ATTACHMENTS.RIGHT) {\r\n\t\t\tleftPointX = targetRect.rb.x - contextMenuSizes.x - options.targetXOffset;\r\n\t\t\trightPointX = targetRect.rb.x - options.targetXOffset;\r\n\r\n\t\t} else {\r\n\t\t\tconsole.error('CommonContextMenu.calcContextMenuRect() not have case for attachment `' + options.attachment + '`', options);\r\n\t\t}\r\n\r\n\t\treturn new Rect(\r\n\t\t\tleftPointX - options.containerXOffset,\r\n\t\t\toptions.targetYOffset + targetRect.rb.y,\r\n\t\t\trightPointX + options.containerXOffset,\r\n\t\t\toptions.targetYOffset * 2 + targetRect.rb.y + contextMenuSizes.y,\r\n\t\t);\r\n\t}\r\n\r\n\tprivate calcContainerRect() {\r\n\t\tconst containerSize = this.getContainerSize();\r\n\t\tconst bodyRect = new Rect(\r\n\t\t\t0,\r\n\t\t\t0,\r\n\t\t\tcontainerSize.width,\r\n\t\t\tcontainerSize.height,\r\n\t\t);\r\n\t\tconst containersForPosition = this.preparedOptionsContainersForPosition;\r\n\t\tlet maxBottom;\r\n\t\tlet maxRight;\r\n\t\tlet minLeft;\r\n\t\tlet minTop;\r\n\t\tlet containersForPositionRect;\r\n\r\n\t\tif (containersForPosition.length) {\r\n\t\t\tminLeft = Math.max(...containersForPosition.map((x) => {\r\n\t\t\t\tif (x.useLeft !== false) {\r\n\t\t\t\t\treturn x.element.getBoundingClientRect().left;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn -Infinity;\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t\tmaxRight = Math.min(...containersForPosition.map((x) => {\r\n\t\t\t\tif (x.useRight !== false) {\r\n\t\t\t\t\treturn x.element.getBoundingClientRect().left + x.element.offsetWidth;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn Infinity;\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t\tminTop = Math.max(...containersForPosition.map((x) => {\r\n\t\t\t\tif (x.useTop !== false) {\r\n\t\t\t\t\treturn x.element.getBoundingClientRect().top;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn -Infinity;\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t\tmaxBottom = Math.min(...containersForPosition.map((x) => {\r\n\t\t\t\tif (x.useBottom !== false) {\r\n\t\t\t\t\treturn x.element.getBoundingClientRect().top + x.element.offsetHeight;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn Infinity;\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t\tcontainersForPositionRect = new Rect(minLeft, minTop, maxRight, maxBottom);\r\n\t\t}\r\n\r\n\t\treturn bodyRect\r\n\t\t\t.clone()\r\n\t\t\t.mergeRects(containersForPositionRect);\r\n\t}\r\n\r\n\tprivate getContainerSize() {\r\n\t\treturn {\r\n\t\t\twidth: document.documentElement.clientWidth,\r\n\t\t\theight: document.documentElement.clientHeight,\r\n\t\t};\r\n\t}\r\n\r\n\tprivate calcTargetRect(targetEl: HTMLElement) {\r\n\t\tconst targetElOffset = targetEl.getBoundingClientRect();\r\n\r\n\t\treturn new Rect(\r\n\t\t\ttargetElOffset.left,\r\n\t\t\ttargetElOffset.top,\r\n\t\t\ttargetElOffset.left + targetElOffset.width,\r\n\t\t\ttargetElOffset.top + targetElOffset.height,\r\n\t\t);\r\n\t}\r\n\r\n\tprivate async portalScreen(screenName: TCommonContextMenuScreenName): Promise {\r\n\t\tconst screen = this.options.screens[screenName];\r\n\t\tconst portalInjector = this.createInjector((screenName === 'default' && this.options.data) || screen.data);\r\n\t\tthis.hostPortal = new DomPortalOutlet(\r\n\t\t\tthis.contextMenuBodyEl,\r\n\t\t\tthis.injector.get(ComponentFactoryResolver),\r\n\t\t\tthis.injector.get(ApplicationRef),\r\n\t\t\tportalInjector,\r\n\t\t);\r\n\t\tthis.activeScreenComponentPortal = new ComponentPortal(this.options.screens[this.activeScreenName].component);\r\n\t\tthis.activeScreenComponentRef = this.hostPortal.attach(this.activeScreenComponentPortal);\r\n\t\tthis.activeScreenElem = this.activeScreenComponentRef.location.nativeElement;\r\n\t\tconst promise = this.activeScreenComponentRef.instance.ngAfterViewInit$.toPromise();\r\n\t\t// run ngZone fake task for start component portal life cycle\r\n\t\tthis.injector.get(NgZone).run(() => null);\r\n\r\n\r\n\t\t// hide new element and wait for new component and his children rendering complete\r\n\t\tthis.renderer.setStyle(this.activeScreenElem, 'display', 'none');\r\n\t\tawait promise;\r\n\t\tif (screenName !== 'default') {\r\n\t\t\tthis.renderer.setStyle(this.activeScreenElem, 'display', 'block');\r\n\t\t}\r\n\t}\r\n\r\n\tprivate stopPropagation (event: Event) {\r\n\t\tevent.stopPropagation();\r\n\t}\r\n\r\n\tprivate addEventListener (\r\n\t\ttarget: EventTarget,\r\n\t\tevent: string,\r\n\t\tcallback: EventListener,\r\n\t\toptions?: boolean | AddEventListenerOptions,\r\n\t): TCallbackFunc {\r\n\t\ttarget.addEventListener(event, callback, options);\r\n\r\n\t\treturn () => {\r\n\t\t\ttarget.removeEventListener(event, callback, options);\r\n\t\t};\r\n\t}\r\n}\r\n","export const COMMON_THROTTLE_MILLISECONDS: number = 200;\r\n","import { Injectable, Injector } from '@angular/core';\r\nimport { first } from 'rxjs/operators';\r\n\r\nimport { COMMON_CONTEXT_MENU_EVENT_NAME, ICommonContextMenuOptions } from './common-context-menu.interfaces';\r\nimport { CommonContextMenu } from './common-context-menu.service';\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonContextMenuFactory {\r\n\tpublic get isOpenContextMenu(): boolean {\r\n\t\treturn !!this.openedContextMenus.size;\r\n\t}\r\n\r\n\tprivate openedContextMenus: Set> = new Set();\r\n\r\n\tconstructor(\r\n\t\tprivate injector: Injector,\r\n\t) {\r\n\t}\r\n\r\n\topen (options: ICommonContextMenuOptions): CommonContextMenu {\r\n\t\tif (options.closeOtherContextMenu !== false) {\r\n\t\t\tthis.closeOtherContextMenu();\r\n\t\t}\r\n\r\n\t\tif (options.id) {\r\n\t\t\tthis.closeContextMenuById(options.id);\r\n\t\t}\r\n\r\n\t\tconst contextMenu = new CommonContextMenu(\r\n\t\t\toptions,\r\n\t\t\tthis.injector,\r\n\t\t);\r\n\r\n\t\tcontextMenu.onEvent(COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CLOSE)\r\n\t\t\t.pipe(first())\r\n\t\t\t.subscribe(() => {\r\n\t\t\t\tthis.openedContextMenus.delete(contextMenu);\r\n\t\t\t});\r\n\t\tthis.openedContextMenus.add(contextMenu);\r\n\r\n\t\treturn contextMenu;\r\n\t}\r\n\r\n\tcloseOtherContextMenu() {\r\n\t\tArray.from(this.openedContextMenus).forEach((contextMenu) => contextMenu.close());\r\n\t}\r\n\r\n\tcloseContextMenuById(id: string) {\r\n\t\tArray.from(this.openedContextMenus).forEach((contextMenu) => {\r\n\t\t\tif (contextMenu.id === id) {\r\n\t\t\t\tcontextMenu.close();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n","import { ComponentType } from '@angular/cdk/overlay';\r\n\r\nimport { ICommonPopupData } from './interfaces/popup-data.interface';\r\nimport { ICommonActionsDropdownComponentActions } from '../context-menu/actions-dropdown.component/common-actions-dropdown.interfaces';\r\nimport { CommonBaseComponent } from '@CaseOne/Common/base_component/base.component';\r\n\r\nexport class CommonPopupOptions {\r\n\tcomponent: ComponentType;\r\n\theaderComponent?: ComponentType;\r\n\tdata?: ICommonPopupData | null = null;\r\n\tpopupOverlayClasses?: string = '';\r\n\tpopupClasses?: string = '';\r\n\tonLoadData?: Promise;\r\n\tshowExternalCloseIcon?: boolean = false;\r\n\tshowHeader?: boolean = true;\r\n\tcloseOnNext?: boolean = false; // close current popup after opening next\r\n\tclosePrev?: boolean = false; // close previous popup in queue\r\n\tisOverlapped?: boolean;\r\n\twithControlOpenState?: boolean = true;\r\n\r\n\t/**\r\n\t * @deprecated `contextMenuItems`\r\n\t * Use `this.popup.containerInstance.setContextMenuItems` function in popup component\r\n\t */\r\n\tcontextMenuItems?: ICommonActionsDropdownComponentActions = [];\r\n}\r\n","export enum COMMON_POPUP_ACTION_TYPE {\r\n\tAFTER_OPEN = 'afterOpen',\r\n\tBEFORE_HIDE = 'beforeHide',\r\n\tAFTER_HIDE = 'afterHide',\r\n\tBEFORE_SHOW = 'beforeShow',\r\n\tAFTER_SHOW = 'afterShow',\r\n\tBEFORE_CLOSE = 'beforeClose',\r\n\tAFTER_CLOSE = 'afterClose',\r\n\tCUSTOM = 'custom',\r\n\tCLICK_ADDITION_TITLE = 'COMMON_POPUP_ACTION_TYPE.CLICK_ADDITION_TITLE',\r\n}\r\n","import {\r\n\tfilter,\r\n\tmergeMap,\r\n\ttap,\r\n} from 'rxjs/operators';\r\nimport {\r\n\tObservable,\r\n\tSubject,\r\n} from 'rxjs';\r\nimport { Injector } from '@angular/core';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { OverlayRef } from '@angular/cdk/overlay';\r\nimport { uniqueId } from 'lodash';\r\n\r\nimport { CommonPopupContainerComponent } from './components/popup-container/popup-container.component';\r\nimport { ICommonPopupAction } from './interfaces/popup-action.interface';\r\nimport { COMMON_POPUP_ACTION_TYPE } from './constants/popup-action-type.constant';\r\nimport { COMMON_HOT_KEYS } from '../controls/control/hot_keys.constant';\r\n\r\nexport class CommonPopup {\r\n\tpublic injector: Injector;\r\n\tpublic componentInstance;\r\n\tpublic headerComponentInstance;\r\n\tpublic isHidden: boolean = false;\r\n\tpublic isOpen: boolean = false;\r\n\tpublic defaultCloseData = null;\r\n\tpublic withControlOpenState = true;\r\n\r\n\tprivate readonly onEventSubject = new Subject();\r\n\r\n\tconstructor(\r\n\t\tpublic overlayRef: OverlayRef,\r\n\t\tpublic containerInstance: CommonPopupContainerComponent,\r\n\t) {\r\n\t\tcontainerInstance.id = uniqueId();\r\n\t\tthis.overlayRef.keydownEvents()\r\n\t\t\t.pipe(\r\n\t\t\t\tfilter((event: KeyboardEvent) => event.keyCode === COMMON_HOT_KEYS.ESC),\r\n\t\t\t)\r\n\t\t\t.subscribe(() => {\r\n\t\t\t\tthis.close();\r\n\t\t\t});\r\n\t}\r\n\r\n\tonEvent(eventType?: COMMON_POPUP_ACTION_TYPE): Observable {\r\n\t\treturn this.onEventSubject.asObservable()\r\n\t\t\t.pipe(filter((event) => !eventType || event.type === eventType));\r\n\t}\r\n\r\n\tonAfterClose(): Observable {\r\n\t\treturn this.onEvent()\r\n\t\t\t.pipe(\r\n\t\t\t\tfilter((event) => event.type === COMMON_POPUP_ACTION_TYPE.AFTER_CLOSE),\r\n\t\t\t);\r\n\t}\r\n\r\n\tonSuccessful(): Observable {\r\n\t\treturn this.onEvent()\r\n\t\t\t.pipe(\r\n\t\t\t\tfilter((event) => event.type === COMMON_POPUP_ACTION_TYPE.AFTER_CLOSE && event.payload && event.payload.IsSuccess),\r\n\t\t\t);\r\n\t}\r\n\r\n\thide(): Observable {\r\n\t\tthis.onEventSubject.next({\r\n\t\t\ttype: COMMON_POPUP_ACTION_TYPE.BEFORE_HIDE,\r\n\t\t});\r\n\r\n\t\treturn this.containerInstance.hide()\r\n\t\t\t.pipe(\r\n\t\t\t\ttap(() => {\r\n\t\t\t\t\tthis.isHidden = true;\r\n\t\t\t\t\tthis.onEventSubject.next({\r\n\t\t\t\t\t\ttype: COMMON_POPUP_ACTION_TYPE.AFTER_HIDE,\r\n\t\t\t\t\t});\r\n\t\t\t\t}),\r\n\t\t\t);\r\n\t}\r\n\r\n\tshow() {\r\n\t\tthis.onEventSubject.next({\r\n\t\t\ttype: COMMON_POPUP_ACTION_TYPE.BEFORE_SHOW,\r\n\t\t});\r\n\r\n\t\tconst show$ = this.containerInstance.show()\r\n\t\t\t.pipe(\r\n\t\t\t\ttap(() => {\r\n\t\t\t\t\tthis.isHidden = false;\r\n\t\t\t\t\tthis.onEventSubject.next({\r\n\t\t\t\t\t\ttype: COMMON_POPUP_ACTION_TYPE.AFTER_SHOW,\r\n\t\t\t\t\t});\r\n\t\t\t\t}),\r\n\t\t\t);\r\n\r\n\t\tshow$.subscribe();\r\n\r\n\t\treturn show$;\r\n\t}\r\n\r\n\temit(payload: any): void {\r\n\t\tthis.onEventSubject.next({\r\n\t\t\ttype: COMMON_POPUP_ACTION_TYPE.CUSTOM,\r\n\t\t\tpayload,\r\n\t\t});\r\n\t}\r\n\r\n\temitClickAdditionTitle(payload: any) {\r\n\t\tthis.onEventSubject.next({\r\n\t\t\ttype: COMMON_POPUP_ACTION_TYPE.CLICK_ADDITION_TITLE,\r\n\t\t\tpayload,\r\n\t\t});\r\n\t}\r\n\r\n\tclose(popupResult = this.defaultCloseData): Promise {\r\n\t\tthis.onEventSubject.next({\r\n\t\t\ttype: COMMON_POPUP_ACTION_TYPE.BEFORE_CLOSE,\r\n\t\t});\r\n\r\n\t\treturn this.containerInstance\r\n\t\t\t.hide()\r\n\t\t\t.pipe(\r\n\t\t\t\tmergeMap(() => {\r\n\t\t\t\t\treturn this.containerInstance.close();\r\n\t\t\t\t}),\r\n\t\t\t\ttap(() => {\r\n\t\t\t\t\tthis.isOpen = false;\r\n\t\t\t\t\tthis.onEventSubject.next({\r\n\t\t\t\t\t\ttype: COMMON_POPUP_ACTION_TYPE.AFTER_CLOSE,\r\n\t\t\t\t\t\tpayload: popupResult,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.onEventSubject.complete();\r\n\t\t\t\t}),\r\n\t\t\t)\r\n\t\t\t.toPromise();\r\n\t}\r\n\r\n\trender(): void {\r\n\t\tif (!this.isOpen) {\r\n\t\t\tconst contentRef = this.containerInstance.attachComponentPortal(\r\n\t\t\t\tnew ComponentPortal(this.containerInstance.options.component, null, this.injector),\r\n\t\t\t);\r\n\r\n\t\t\tthis.componentInstance = contentRef.instance;\r\n\r\n\t\t\tif (this.containerInstance.options.headerComponent) {\r\n\t\t\t\tconst headerContentRef = this.containerInstance.attachHeaderComponentPortal(\r\n\t\t\t\t\tnew ComponentPortal(this.containerInstance.options.headerComponent, null, this.injector),\r\n\t\t\t\t);\r\n\r\n\t\t\t\tthis.headerComponentInstance = headerContentRef.instance;\r\n\t\t\t\tthis.headerComponentInstance.runUpdate();\r\n\t\t\t}\r\n\r\n\t\t\tthis.isOpen = true;\r\n\t\t\tthis.onEventSubject.next({\r\n\t\t\t\ttype: COMMON_POPUP_ACTION_TYPE.AFTER_OPEN,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tisCloseOnNext(): boolean {\r\n\t\treturn this.containerInstance.options.closeOnNext;\r\n\t}\r\n}\r\n","export const COMMON_HOT_KEYS = {\r\n\tLEFT_MOUSE: 1,\r\n\tMIDDLE_MOUSE: 2,\r\n\tRIGHT_MOUSE: 3,\r\n\tARROW_UP: 38,\r\n\tARROW_DOWN: 40,\r\n\tARROW_RIGHT: 39,\r\n\tARROW_LEFT: 37,\r\n\tENTER: 13,\r\n\tESC: 27,\r\n\tTAB: 9,\r\n\tEND: 35,\r\n\tHOME: 36,\r\n\tBACKSPACE: 8,\r\n\tDELETE: 46,\r\n\tSPACE: 32,\r\n};\r\n\r\n","export const COMMON_POPUP_CLASS_NAMES = {\r\n\tPOPUP_HOST: 'b-popup-scroll_container',\r\n\tPOPUP_SHOW: 'b-popup--show',\r\n\tPOPUP_WITH_ANIMATION: 'b-popup--with_animation',\r\n\tPOPUP_SLIDE_IN: 'b-popup--slide_in',\r\n\tPOPUP_FADE_OUT: 'b-popup--fade_out',\r\n\tOVERLAY_HOST: 'b-popup-overlay',\r\n\tOVERLAY_HOST_SHOW: 'b-popup-overlay--show',\r\n\tBODY_HOST: 'b-popup-body',\r\n\tOVERLAY_BACKGROUND_HOST: 'b-popup-overlay-background',\r\n\tOVERLAY_LOADER: 'b-popup-loader_wrapper',\r\n};\r\n","import {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tViewChild,\r\n\tViewEncapsulation,\r\n} from '@angular/core';\r\nimport { CdkPortalOutlet } from '@angular/cdk/portal';\r\n\r\n@Component({\r\n\tselector: 'common-popup-header-wrapper',\r\n\ttemplateUrl: './popup-header-wrapper.component.pug',\r\n\tencapsulation: ViewEncapsulation.None,\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CommonPopupHeaderWrapperComponent {\r\n\t@ViewChild(CdkPortalOutlet, { static: true }) headerWrapperOutlet: CdkPortalOutlet;\r\n}\r\n","","import {\r\n\tisString,\r\n\tclone,\r\n\tforEach,\r\n} from 'lodash';\r\n\r\nexport type CommonDebugServiceFieldType = 'boolean' | 'string' | 'number' | 'function' | 'interface' | 'select';\r\n\r\nexport interface ICommonDebugComponentServiceStateConfig {\r\n\tname?: string,\r\n\ttype: CommonDebugServiceFieldType,\r\n\tfield?: string,\r\n\tdescription?: string,\r\n\tdefaultValue?: any,\r\n\tget?: (component: any) => any,\r\n\tset?: (component: any, value: any) => any,\r\n}\r\n\r\nexport interface ICommonDebugComponentServiceProps {\r\n\t[key: string]: ICommonDebugComponentServiceStateConfig,\r\n}\r\n\r\nexport interface ICommonDebugComponentServiceStates {\r\n\t[key: string]: ICommonDebugComponentServiceStateConfig,\r\n}\r\n\r\nexport interface ICommonDebugComponentServiceTest {\r\n\ttype: 'describe' | 'it',\r\n\tlevel: number,\r\n\ttext: string,\r\n}\r\n\r\nexport interface ICommonDebugComponentServiceConfig {\r\n\tname: string,\r\n\tdesignLink?: string,\r\n\tdescription: string,\r\n\ttestsFile?: string,\r\n\ttests?: ICommonDebugComponentServiceTest[],\r\n\tprops: ICommonDebugComponentServiceProps,\r\n\tstates: ICommonDebugComponentServiceStates,\r\n}\r\n\r\nexport class CommonDebugComponentService {\r\n\tstatic parseField (\r\n\t\tstate: ICommonDebugComponentServiceStateConfig | CommonDebugServiceFieldType,\r\n\t\tkey: string,\r\n\t): ICommonDebugComponentServiceStateConfig {\r\n\t\tlet newState: ICommonDebugComponentServiceStateConfig;\r\n\r\n\t\tif (isString(state)) {\r\n\t\t\tnewState = {\r\n\t\t\t\ttype: state,\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tnewState = clone(state);\r\n\t\t}\r\n\r\n\t\tif (!newState.name) {\r\n\t\t\tnewState.name = key;\r\n\t\t}\r\n\r\n\t\tif (!newState.field) {\r\n\t\t\tnewState.field = newState.name;\r\n\t\t}\r\n\r\n\t\tif (!newState.get) {\r\n\t\t\tnewState.get = (component) => {\r\n\t\t\t\treturn component[newState.field];\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (!newState.set) {\r\n\t\t\tnewState.set = (component: any, value: any) => {\r\n\t\t\t\treturn component[newState.field] = value;\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn newState;\r\n\t}\r\n\r\n\tstatic parseConfig (config: ICommonDebugComponentServiceConfig): ICommonDebugComponentServiceConfig {\r\n\t\tforEach(config.props, (state: ICommonDebugComponentServiceStateConfig, key: string) => {\r\n\t\t\tconfig.props[key] = this.parseField(state, key);\r\n\t\t});\r\n\r\n\t\tforEach(config.states, (state: ICommonDebugComponentServiceStateConfig | CommonDebugServiceFieldType, key: string) => {\r\n\t\t\tconfig.states[key] = this.parseField(state, key);\r\n\t\t});\r\n\r\n\t\tif (config.testsFile) {\r\n\t\t\tconst rows = config.testsFile.split('\\n');\r\n\t\t\tconst tests: ICommonDebugComponentServiceTest[] = [];\r\n\t\t\tconst describeReg = /^(\\s*)describe\\(['\"]([^'\"]+)['\"]/;\r\n\t\t\tconst itReg = /^(\\s*)it\\(['\"]([^'\"]+)['\"]/;\r\n\r\n\t\t\tforEach(rows, (row) => {\r\n\t\t\t\tif (describeReg.test(row)) {\r\n\t\t\t\t\tconst match = row.match(describeReg);\r\n\r\n\t\t\t\t\ttests.push({\r\n\t\t\t\t\t\ttype: 'describe',\r\n\t\t\t\t\t\tlevel: match[1].length,\r\n\t\t\t\t\t\ttext: match[2],\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (itReg.test(row)) {\r\n\t\t\t\t\tconst match = row.match(itReg);\r\n\r\n\t\t\t\t\ttests.push({\r\n\t\t\t\t\t\ttype: 'it',\r\n\t\t\t\t\t\tlevel: match[1].length,\r\n\t\t\t\t\t\ttext: match[2],\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tconfig.tests = tests;\r\n\r\n\t\t} else {\r\n\t\t\tconfig.tests = [];\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tprotected configs: {\r\n\t\t[key: string]: ICommonDebugComponentServiceConfig,\r\n\t} = {};\r\n\r\n\tprotected components: {\r\n\t\t[key: string]: {\r\n\t\t\t[key: string]: any,\r\n\t\t},\r\n\t} = {};\r\n\r\n\tsaveConfig (config: ICommonDebugComponentServiceConfig) {\r\n\t\tthis.configs[config.name] = CommonDebugComponentService.parseConfig(config);\r\n\t}\r\n\r\n\tgetConfig (name: string): ICommonDebugComponentServiceConfig {\r\n\t\treturn this.configs[name];\r\n\t}\r\n\r\n\tgetApiFields (name: string): ICommonDebugComponentServiceProps {\r\n\t\treturn this.configs[name].props;\r\n\t}\r\n\r\n\tgetStateFields (name: string): ICommonDebugComponentServiceStates {\r\n\t\treturn this.configs[name].states;\r\n\t}\r\n\r\n\tgetDefaultProps (name: string): { [key: string]: any } {\r\n\t\tconst result = {};\r\n\r\n\t\tforEach(this.configs[name].props, (state: ICommonDebugComponentServiceStateConfig, key: string) => {\r\n\t\t\tresult[key] = state.defaultValue;\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tregisterComponent (config: ICommonDebugComponentServiceConfig, id: string, component: any) {\r\n\t\tif (!this.components[config.name]) {\r\n\t\t\tthis.components[config.name] = {};\r\n\t\t}\r\n\r\n\t\tthis.components[config.name][id] = component;\r\n\t}\r\n\r\n\tgetComponent (configName: string, id: string): any {\r\n\t\treturn this.components[configName][id];\r\n\t}\r\n}\r\n\r\nexport const commonDebugComponentService = new CommonDebugComponentService();\r\n","declare const COMPONENT_SPECS_MODE: boolean;\r\ndeclare const WITH_COMPONENT_DEBUG: boolean;\r\n\r\nimport {\r\n\tcommonDebugComponentService,\r\n\tICommonDebugComponentServiceConfig,\r\n} from './debug.service';\r\n\r\nexport const CONFIG_VALUE_PATH_SYMBOL = Symbol('__CONFIG');\r\n\r\nexport function CommonDebugComponent (config: ICommonDebugComponentServiceConfig) {\r\n\tcommonDebugComponentService.saveConfig(config);\r\n\r\n\treturn function DebugComponentE (constructor: TContractor): TContractor {\r\n\t\tif (WITH_COMPONENT_DEBUG && !COMPONENT_SPECS_MODE) {\r\n\t\t\tconstructor[CONFIG_VALUE_PATH_SYMBOL] = config;\r\n\t\t}\r\n\r\n\t\treturn constructor;\r\n\t};\r\n}\r\n","// New version src/Common/utilities/core.service.ts CommonUtilitiesCore\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/services/utilities_service.js Utilities\r\n\r\nimport { InjectionToken, Injectable } from '@angular/core';\r\nimport {\r\n\tisNaN,\r\n\tforEach,\r\n\textend,\r\n\tisNil,\r\n\tisEmpty,\r\n\tfind,\r\n\tcompact,\r\n\tuniqueId,\r\n\tget, each,\r\n\tisString,\r\n} from 'lodash';\r\nimport {\r\n\tObservable,\r\n\tSubscription,\r\n\tfrom,\r\n} from 'rxjs';\r\nimport {\r\n\ttap,\r\n\tfilter,\r\n} from 'rxjs/operators';\r\nimport { ICommonModelWithTempId, UUID } from '@CaseOne/Common/interfaces/core';\r\nimport { ICommonResponse } from '@CaseOne/Common/interfaces/response';\r\n\r\nexport interface ICommonStateDate {\r\n\t[key: string]: any,\r\n}\r\n\r\nexport interface IPromiseWithCancel extends Promise {\r\n\t$cancelRequest: () => void,\r\n}\r\n\r\ninterface ICommonFixedParentIdInRequest {\r\n\tParentId?: UUID,\r\n\tParentTempId?: string,\r\n}\r\n\r\n@Injectable()\r\nexport class CommonUtilitiesCore {\r\n\tcancelRequestPolyfill = cancelRequestPolyfill;\r\n\tasyncTimeout = asyncTimeout;\r\n\thasValue = hasValue;\r\n\tcustomConcat = customConcat;\r\n\tprivate textDiv;\r\n\r\n\tgetDataFromCurrentRoute($uiRouter: any): ICommonStateDate {\r\n\t\tconst path = $uiRouter.globals.$current.path;\r\n\t\tlet data = {};\r\n\r\n\t\tforEach(path, (state) => {\r\n\t\t\tif (state.data) {\r\n\t\t\t\tdata = extend(data, state.data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetTextWidth (text, font) {\r\n\t\tlet div;\r\n\r\n\t\tif (!text) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tconst formattedText = text.replace(/\\s/g, ' ');\r\n\r\n\t\t// reuse div object for better performance\r\n\t\tif (this.textDiv) {\r\n\t\t\tdiv = this.textDiv;\r\n\t\t} else {\r\n\t\t\tdiv = this.textDiv = document.createElement('div');\r\n\t\t\tdiv.className = 'g-hidden-measure-text';\r\n\t\t\tdocument.body.appendChild(div);\r\n\t\t}\r\n\r\n\t\tdiv.style.font = font;\r\n\t\tdiv.innerHTML = formattedText;\r\n\r\n\t\treturn Math.ceil(div.getBoundingClientRect().width);\r\n\t}\r\n\r\n\trxFinallyOldRequest(promise, callback?: () => void) {\r\n\t\treturn from(\r\n\t\t\tpromise.catch((error: any) => {\r\n\t\t\t\tif (error && error.status === -1) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow error;\r\n\t\t\t\t}\r\n\t\t\t}),\r\n\t\t)\r\n\t\t\t.pipe(\r\n\t\t\t\ttap(callback),\r\n\t\t\t\t// Remove error from chanel\r\n\t\t\t\tfilter((error: any) => !error || error.status !== -1),\r\n\t\t\t);\r\n\t}\r\n\r\n\tclosestElem(target: HTMLElement, selector): HTMLElement | null {\r\n\t\twhile (target) {\r\n\t\t\tif (target.matches(selector)) return target;\r\n\t\t\telse target = target.parentElement;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfixedIEEE754Format(val: number): number {\r\n\t\treturn Math.round(parseFloat((val * 10e8).toFixed(2))) / 10e8;\r\n\t}\r\n}\r\n\r\nexport function\tcustomConcat (arr1: any[], arr2: any[], outputOptions) {\r\n\tconst mergeItems = (array1, array2) => {\r\n\t\tconst idIndexMap = {};\r\n\r\n\t\tforEach(array1, (item, index) => {\r\n\t\t\tif (item.Id) {\r\n\t\t\t\tidIndexMap[item.Id] = index;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tforEach(array2, (item) => {\r\n\t\t\tconst foundIndex = item.Id ? idIndexMap[item.Id] : null;\r\n\r\n\t\t\tif (!isNil(foundIndex)) {\r\n\t\t\t\tarray1[foundIndex] = item;\r\n\t\t\t} else {\r\n\t\t\t\tarray1.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tif (!isEmpty(arr1) && !isEmpty(arr2) && outputOptions) {\r\n\t\tconst groupByKey = outputOptions.GroupByKey;\r\n\t\tconst groupItemsKey = outputOptions.GroupItemsKey;\r\n\r\n\t\tforEach(arr2, (arr2group) => {\r\n\t\t\tconst arr1group = find(arr1, (arr1gr) => {\r\n\t\t\t\treturn arr1gr[groupByKey].Id === arr2group[groupByKey].Id;\r\n\t\t\t});\r\n\r\n\t\t\tif (arr1group) {\r\n\t\t\t\tmergeItems(arr1group[groupItemsKey], arr2group[groupItemsKey]);\r\n\t\t\t} else {\r\n\t\t\t\tarr1.push(arr2group);\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tmergeItems(arr1, compact(arr2));\r\n\t}\r\n\r\n\treturn arr1;\r\n}\r\n\r\nexport function ignoreCancellingInPromise> (promise: T): T {\r\n\treturn promise\r\n\t\t.catch((error) => {\r\n\t\t\tif (error?.status === -1) {\r\n\t\t\t\t// Ignore\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\t\t}) as T;\r\n}\r\n\r\nexport function cancelRequestPolyfill (request: Promise | IPromiseWithCancel): IPromiseWithCancel {\r\n\tif ((request as IPromiseWithCancel).$cancelRequest) {\r\n\t\treturn request as IPromiseWithCancel;\r\n\t}\r\n\r\n\tlet sharedReject;\r\n\r\n\tconst promise = new Promise((resolve, reject) => {\r\n\t\trequest.then((result) => resolve(result));\r\n\t\trequest.catch((error) => reject(error));\r\n\r\n\t\tsharedReject = reject;\r\n\t}) as IPromiseWithCancel;\r\n\r\n\tpromise.$cancelRequest = () => {\r\n\t\tsharedReject({\r\n\t\t\tstatus: -1,\r\n\t\t});\r\n\t};\r\n\r\n\tpromise.catch((error) => {\r\n\t\t/**\r\n\t\t * Empty catch to avoid console error of\r\n\t\t * Unhandled Promise Rejection: { status: -1 }\r\n\t\t * https://jira.parcsis.org/browse/CASEM-58335\r\n\t\t */\r\n\t\tif (error.status !== -1) {\r\n\t\t\tthrow error;\r\n\t\t}\r\n\t});\r\n\r\n\treturn promise;\r\n}\r\n\r\nexport function cancelObservableRequestPolyfill (request: Observable): IPromiseWithCancel {\r\n\tlet sharedReject;\r\n\tlet subscription: Subscription;\r\n\r\n\tconst promise = new Promise((resolve, reject) => {\r\n\t\tsubscription = request.subscribe(resolve, reject);\r\n\t\tsharedReject = reject;\r\n\t}) as IPromiseWithCancel;\r\n\r\n\tpromise.$cancelRequest = () => {\r\n\t\tsubscription.unsubscribe();\r\n\t\tsharedReject({\r\n\t\t\tstatus: -1,\r\n\t\t});\r\n\t};\r\n\r\n\treturn promise;\r\n}\r\n\r\nexport function hasValue (value: any): boolean {\r\n\treturn !isNil(value) && !isNaN(value) && value !== '';\r\n}\r\n\r\nexport function isNewId (id) {\r\n\treturn isNil(id) || isTempId(id);\r\n}\r\n\r\nexport function isTempId (id: string): boolean {\r\n\treturn /^temp_/.test(id);\r\n}\r\n\r\nexport function getTempId (): string {\r\n\treturn uniqueId('temp_') + '_' + Date.now();\r\n}\r\n\r\nexport function asyncTimeout (time: number = 0, result?: T): Promise {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t// Without zonejs\r\n\t\tsetTimeout(() => {\r\n\t\t\tresolve(result);\r\n\t\t}, time);\r\n\t});\r\n}\r\n\r\n// Custom sort method against usual .sort() used because Chrome sometime incorrectly sorts array with objects. https://jira.parcsis.org/browse/CASEM-35978\r\n// https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\r\nexport function insertionSortWithIgnoreCase (array: Array, field: string): Array {\r\n\tfor (let i = 0; i < array.length; i++) {\r\n\t\tconst temp = array[i];\r\n\t\tlet j = i - 1;\r\n\r\n\t\twhile (j >= 0 && get(array[j], field) && (get(array[j], field).toLowerCase() > get(temp, field).toLowerCase())) {\r\n\t\t\tarray[j + 1] = array[j];\r\n\t\t\tj--;\r\n\t\t}\r\n\t\tarray[j + 1] = temp;\r\n\t}\r\n\r\n\treturn array;\r\n}\r\n\r\nexport enum SETTLED_PROMISE_STATUSES {\r\n\tFULLFILLED = 'fulfilled',\r\n\tREJECTED = 'rejected',\r\n}\r\n\r\nexport type SettledPromiseResult = {\r\n\tstatus: SETTLED_PROMISE_STATUSES;\r\n\tvalue?: T;\r\n\treason?: never;\r\n};\r\n\r\nfunction getSettledPromise (promise: Promise): Promise> {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\tpromise.then((res: T) => {\r\n\t\t\tresolve({\r\n\t\t\t\tstatus: SETTLED_PROMISE_STATUSES.FULLFILLED,\r\n\t\t\t\tvalue: res,\r\n\t\t\t});\r\n\t\t}).catch((e) => {\r\n\t\t\treject({\r\n\t\t\t\tstatus: SETTLED_PROMISE_STATUSES.REJECTED,\r\n\t\t\t\treason: e,\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n}\r\n\r\nexport function settleAllPromises (promises: Promise[]): Promise[]> {\r\n\tif ('allSettled' in Promise) {\r\n\t\treturn (Promise as any).allSettled(promises);\r\n\t}\r\n\treturn Promise.all(promises.map((nextPomise: Promise) => getSettledPromise(nextPomise)));\r\n}\r\n\r\n// Replace empty ParentId with ParentTempId (useful for suggest-with-tree with temp data, for example)\r\nexport function fixParentIdInRequest (params: T): T {\r\n\tif (isNewId(params.ParentId)) {\r\n\t\tparams.ParentTempId = params.ParentId;\r\n\t\tdelete params.ParentId;\r\n\t}\r\n\r\n\treturn params;\r\n}\r\n\r\n// Replace empty Id with TempId (useful for suggest-with-tree with temp data, for example)\r\nexport function recursiveIdFixer (items: T[], childrenFieldName = 'Childrens'): T[] {\r\n\teach(items, (item) => {\r\n\t\tif (item.TempId && !item.Id) {\r\n\t\t\titem.Id = item.TempId as UUID;\r\n\t\t}\r\n\r\n\t\tif (item[childrenFieldName]) {\r\n\t\t\trecursiveIdFixer(item[childrenFieldName], childrenFieldName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn items;\r\n}\r\n\r\n/** @deprecated */\r\nexport const commonUtilitiesCoreService = new CommonUtilitiesCore();\r\n\r\nexport const COMMON_UTILITES_CORE = new InjectionToken(\r\n\t'common utilites core',\r\n\t{\r\n\t\tprovidedIn: 'root',\r\n \tfactory: () => commonUtilitiesCoreService,\r\n\t},\r\n);\r\n\r\nexport function replaceIndexInArray (array: T[], index: number, item: T): T[] {\r\n\tarray.splice(index, 1, item);\r\n\treturn array;\r\n}\r\n\r\nexport function getQueryStringKeyValue (key: string): string {\r\n\tconst reg = new RegExp('[?&]' + key + '=([^&#]*)', 'i');\r\n\tconst str = reg.exec(window.location.href);\r\n\r\n\treturn str ? decodeURIComponent(str[1]) : null;\r\n}\r\n\r\nexport function fromJson (json) {\r\n\treturn isString(json)\r\n\t\t? JSON.parse(json)\r\n\t\t: json;\r\n}\r\n","import {\r\n\tChangeDetectorRef,\r\n\tInput,\r\n\tNgZone,\r\n\tOnChanges,\r\n\tOnDestroy,\r\n\tOnInit,\r\n\tAfterViewInit,\r\n\tSimpleChanges,\r\n\tAfterContentInit,\r\n\tViewRef,\r\n\tDirective,\r\n\tAfterViewChecked,\r\n\tOutput,\r\n\tEventEmitter,\r\n} from '@angular/core';\r\nimport { ICommonModel, ICommonModelWithTempId, TCallbackFunc } from '../interfaces/core';\r\nimport {\r\n\tforEach,\r\n\tmap,\r\n\tremove,\r\n} from 'lodash';\r\nimport { Observable, Subscription, Subject } from 'rxjs';\r\nimport { commonUtilitiesCoreService } from '../utilities/core.service';\r\nimport { CommonLocaleService } from '../locale/locale.service';\r\nimport { takeUntil, tap } from 'rxjs/operators';\r\nimport { CommonBaseEntityClass } from '../common-base-entity.class/common-base-entity.class';\r\nimport { MonoTypeOperatorFunction } from 'rxjs/internal/types';\r\nimport { CONFIG_VALUE_PATH_SYMBOL } from '../controls/control/debug/debug.decorator';\r\nimport { commonDebugComponentService } from '../controls/control/debug/debug.service';\r\nimport { COMMON_LOADER_DEFAULT_DELAY_TIMEOUT } from '@CaseOne/Common/loader/const/loader-default-delay-timeout';\r\n\r\n\r\ndeclare const COMPONENT_SPECS_MODE: boolean;\r\n\r\n// TODO: Need rename file to common-base-component.class because 'component' is name part\r\n@Directive()\r\nexport class CommonBaseComponent extends CommonBaseEntityClass implements OnInit, AfterViewInit, AfterContentInit, AfterViewChecked, OnChanges, OnDestroy {\r\n\t/** @deprecated Use cssClasses from CommonBaseComponent */\r\n\t@Input() modifiers: string = '';\r\n\t@Input() cssClasses: string = ''; // Css classes for root element\r\n\t@Input() debugId: string; // DebugId use in CommonDebugComponent\r\n\r\n\t// Old Code integration\r\n\t@Output() getRef = new EventEmitter(); // TODO: Need remove after full migration to new Angular\r\n\r\n\tprotected commonLocaleService = this.injector.get(CommonLocaleService);\r\n\tprotected changeDetector = this.injector.get(ChangeDetectorRef);\r\n\tprotected zone = this.injector.get(NgZone);\r\n\r\n\t/** @deprecated */\r\n\tprotected modifierSeparator: string = '--';\r\n\t/** @deprecated */\r\n\tprotected classesSeparator: string = ' ';\r\n\tprotected needUnbind: TCallbackFunc[] = [];\r\n\r\n\tprivate $destroy: Subject;\r\n\r\n\tngOnInit () {\r\n\t\tif (this.debugId) {\r\n\t\t\tconst componentConfigValue = this.constructor[CONFIG_VALUE_PATH_SYMBOL];\r\n\r\n\t\t\tif (componentConfigValue) {\r\n\t\t\t\tcommonDebugComponentService.registerComponent(componentConfigValue, this.debugId, this);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.getRef.emit(this);\r\n\t}\r\n\r\n\tngAfterViewInit () {\r\n\t\t// Not Empty\r\n\t}\r\n\r\n\tngAfterViewChecked () {\r\n\t\t// Not Empty\r\n\t}\r\n\r\n\tngAfterContentInit () {\r\n\t\t// Not Empty\r\n\t}\r\n\r\n\tngOnChanges (changes: SimpleChanges) {\r\n\t\t// Empty\r\n\t}\r\n\r\n\tngOnDestroy () {\r\n\t\tforEach(this.needUnbind, (callback) => {\r\n\t\t\tcallback();\r\n\t\t});\r\n\r\n\t\tif (this.$destroy) {\r\n\t\t\tthis.$destroy.next();\r\n\t\t\tthis.$destroy.complete();\r\n\t\t}\r\n\t}\r\n\r\n\tdefaultTrackBy(index: number, item: any): any {\r\n\t\treturn index;\r\n\t}\r\n\r\n\tdefaultTrackById(index: number, item: ICommonModel): any {\r\n\t\treturn item.Id;\r\n\t}\r\n\r\n\tdefaultTrackByIdOrTempId(index: number, item: ICommonModelWithTempId): any {\r\n\t\treturn item.Id || item.TempId;\r\n\t}\r\n\r\n\trunUpdate () {\r\n\t\tif (!(this.changeDetector as ViewRef).destroyed) { // FIX \"Attempt to use a destroyed view: detectChanges\"\r\n\t\t\tthis.changeDetector.detectChanges();\r\n\t\t}\r\n\t}\r\n\r\n\t/** @deprecated */\r\n\tprotected getBaseClasses (cssBaseClass: string): string[] {\r\n\t\tconst classes = [cssBaseClass];\r\n\r\n\t\tif (this.modifiers.length) {\r\n\t\t\tconst modifiers = this.modifiers.split(this.classesSeparator);\r\n\t\t\tconst modifierClasses = map(modifiers, (modifier) => {\r\n\t\t\t\treturn cssBaseClass + this.modifierSeparator + modifier;\r\n\t\t\t});\r\n\r\n\t\t\treturn classes.concat(modifierClasses);\r\n\r\n\t\t} else {\r\n\t\t\treturn classes;\r\n\t\t}\r\n\t}\r\n\r\n\t/** @deprecated */\r\n\tprotected getBaseClassesAsString (cssBaseClass: string): string {\r\n\t\treturn this.getBaseClasses(cssBaseClass).join(this.classesSeparator);\r\n\t}\r\n\r\n\tprotected setTimeout = (func, time?: number): NodeJS.Timeout => {\r\n\t\tconst timer = setTimeout(func, time);\r\n\r\n\t\tthis.createDestroySubject();\r\n\r\n\t\tthis.$destroy\r\n\t\t\t.subscribe(() => {\r\n\t\t\t\tclearTimeout(timer);\r\n\t\t\t});\r\n\r\n\t\treturn timer;\r\n\t}\r\n\r\n\tprotected setInterval = (func, time?: number): NodeJS.Timeout => {\r\n\t\tconst timer = setInterval(func, time);\r\n\r\n\t\tthis.createDestroySubject();\r\n\r\n\t\tthis.$destroy\r\n\t\t\t.subscribe(() => {\r\n\t\t\t\tclearInterval(timer);\r\n\t\t\t});\r\n\r\n\t\treturn timer;\r\n\t}\r\n\r\n\t// Timeout with additional functional\r\n\t// The third argument it is possible to transfer function which of all is performed in case of completion of the timer\r\n\t// Returns canceling function\r\n\tprotected timeout = (\r\n\t\tfunc: TCallbackFunc = () => void (0),\r\n\t\ttime: number = 0,\r\n\t\tfinallyFunc: TCallbackFunc = () => void (0),\r\n\t): TCallbackFunc => {\r\n\t\tconst timer = this.timeoutWithZone(() => {\r\n\t\t\tfunc();\r\n\t\t\tfinallyFunc();\r\n\t\t}, time);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(timer);\r\n\t\t\tfinallyFunc();\r\n\t\t};\r\n\t}\r\n\r\n\tprotected timeoutWithZone = (\r\n\t\tcallback: TCallbackFunc = () => void (0),\r\n\t\ttime: number = 0,\r\n\t): any => {\r\n\t\treturn this.setTimeout(() => {\r\n\t\t\tthis.zone.run(callback);\r\n\t\t}, time);\r\n\t}\r\n\r\n\tprotected intervalWithZone(\r\n\t\tcallback: TCallbackFunc = () => void (0),\r\n\t\ttime: number = 0,\r\n\t): number {\r\n\t\treturn window.setInterval(() => {\r\n\t\t\tthis.zone.run(callback);\r\n\t\t}, time);\r\n\t}\r\n\r\n\tprotected asyncTimeout (...args): Promise {\r\n\t\treturn commonUtilitiesCoreService.asyncTimeout(...args);\r\n\t}\r\n\r\n\tprotected hasValue (value: any): boolean {\r\n\t\treturn commonUtilitiesCoreService.hasValue(value);\r\n\t}\r\n\r\n\tprotected willUnbind (callback: () => void): (withUnbind?: boolean) => void {\r\n\t\tthis.needUnbind.push(callback);\r\n\r\n\t\treturn (withUnbind: boolean = false): void => {\r\n\t\t\tremove(this.needUnbind, (f) => f === callback);\r\n\r\n\t\t\tif (withUnbind) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tprotected markForCheck () {\r\n\t\tthis.changeDetector.markForCheck();\r\n\t}\r\n\r\n\tprotected runOutsideAngular (func: (...args: any[]) => T): T {\r\n\t\treturn this.zone.runOutsideAngular(func);\r\n\t}\r\n\r\n\tprotected subscribe (observable: Observable | Subject, generatorOrNext?: (value: T) => void, catchError?: (value: any) => void): Subscription {\r\n\t\treturn observable\r\n\t\t\t.pipe(this.takeUntilDestroy())\r\n\t\t\t.subscribe(generatorOrNext, catchError);\r\n\t}\r\n\r\n\tprotected subscribeWithRun (observable: Observable | Subject, generatorOrNext?: any): Subscription {\r\n\t\treturn observable.pipe(\r\n\t\t\tthis.takeUntilDestroy(),\r\n\t\t\ttap(generatorOrNext),\r\n\t\t\ttap(() => this.runUpdate()),\r\n\t\t).subscribe();\r\n\t}\r\n\r\n\tprotected addEventListener(\r\n\t\ttarget: EventTarget,\r\n\t\tevent: string,\r\n\t\tcallback: EventListener,\r\n\t\toptions?: boolean | AddEventListenerOptions,\r\n\t): (withUnbind?: boolean) => void {\r\n\t\ttarget.addEventListener(event, callback, options);\r\n\r\n\t\treturn this.willUnbind(() => {\r\n\t\t\ttarget.removeEventListener(event, callback, options);\r\n\t\t});\r\n\t}\r\n\r\n\t// For tests\r\n\tprotected preventDefault(event) {\r\n\t\tif (event && event.preventDefault) {\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t}\r\n\r\n\tprotected warn (text: string) {\r\n\t\tif (!COMPONENT_SPECS_MODE && text) {\r\n\t\t\tconsole.warn(text);\r\n\t\t}\r\n\t}\r\n\r\n\tprotected takeUntilDestroy(): MonoTypeOperatorFunction {\r\n\t\tthis.createDestroySubject();\r\n\r\n\t\treturn takeUntil(this.$destroy);\r\n\t}\r\n\r\n\tprivate createDestroySubject() {\r\n\t\tif (!this.$destroy) {\r\n\t\t\tthis.$destroy = new Subject();\r\n\t\t}\r\n\t}\r\n}\r\n","import { AfterViewInit, Directive } from '@angular/core';\r\nimport { AsyncSubject } from 'rxjs';\r\n\r\nimport { CommonBaseComponent } from '../../../base_component/base.component';\r\n\r\n@Directive()\r\nexport class CommonContextMenuBaseScreenComponent extends CommonBaseComponent implements AfterViewInit {\r\n\tngAfterViewInit$ = new AsyncSubject();\r\n\r\n\tngAfterViewInit() {\r\n\t\tthis.ngAfterViewInit$.next();\r\n\t\tthis.ngAfterViewInit$.complete();\r\n\t}\r\n}\r\n","import {\r\n\tICommonContextMenuOptionsScreen,\r\n\tTCommonContextMenuScreenName,\r\n} from '../context-menu.service/common-context-menu.interfaces';\r\n\r\n\r\nexport enum COMMON_ACTIONS_DROPDOWN_LABEL_TYPE {\r\n\tDEFAULT = 'COMMON_ACTIONS_DROPDOWN_LABEL_TYPE.DEFAULT',\r\n\tLABEL = 'COMMON_ACTIONS_DROPDOWN_LABEL_TYPE.LABEL',\r\n\tLINK = 'COMMON_ACTIONS_DROPDOWN_LABEL_TYPE.LINK',\r\n}\r\n\r\nexport enum COMMON_ACTIONS_DROPDOWN_CONTENT_TYPE {\r\n\tDEFAULT = 'COMMON_ACTIONS_DROPDOWN_CONTENT_TYPE.DEFAULT',\r\n\tDIALOG = 'COMMON_ACTIONS_DROPDOWN_CONTENT_TYPE.DIALOG',\r\n\tDIALOG_DELETE = 'COMMON_ACTIONS_DROPDOWN_CONTENT_TYPE.DIALOG_DELETE',\r\n}\r\n\r\nexport enum COMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE {\r\n\tCURRENT_ACTION_CHANGED = 'COMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE.CURRENT_ACTION_CHANGED',\r\n\tCURRENT_ACTION_SELECTED_BY_KEYBOARD = 'COMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE.CURRENT_ACTION_SELECTED_BY_KEYBOARD',\r\n}\r\n\r\ninterface IActionScreen extends ICommonContextMenuOptionsScreen {\r\n\tname: TCommonContextMenuScreenName; // it is required for actions dropdown for contextMenuOptions.screens generation\r\n}\r\n\r\nexport type ICommonActionsDropdownComponentActions = Array>;\r\n\r\nexport interface ICommonActionsDropdownComponentAction {\r\n\tid: string, // The identifier for testers is added to the layout, they are also used as screen.name if it is not specified\r\n\tname: string | IActionsDropdownComponentActionName, // The text that will be displayed in the title of the menu item\r\n\taction?: (entity: EntityType) => void, // Action on clicking on a menu item\r\n\tscreen?: IActionScreen, // Settings for forming the context menu screen\r\n\tdata?: ICommonActionsDropdownComponentActionData,\r\n\tisEnabled?: (entity: EntityType) => boolean, // Is this menu item available? Default - return true\r\n\tlabelType?: COMMON_ACTIONS_DROPDOWN_LABEL_TYPE, // type of item (label, link or default)\r\n\tcontentType?: COMMON_ACTIONS_DROPDOWN_CONTENT_TYPE, // type of content (default or dialog)\r\n\thasDelimiter?: boolean, // item has delimeter on the top\r\n\tisMultiline?: boolean, // text-overflow option for label\r\n\ticonClasses?: string, // css icon classes for label\r\n}\r\n\r\nexport interface ICommonActionsDropdownComponentContextMenuData {\r\n\tactions: ICommonActionsDropdownComponentActions,\r\n\tdropdownComponentApi: {\r\n\t\tisActionEnabled(action: ICommonActionsDropdownComponentAction): boolean;\r\n\t\tonActionClickHandler(action: ICommonActionsDropdownComponentAction): void;\r\n\t\tonActionMouseEnterHandler(action: ICommonActionsDropdownComponentAction): void;\r\n\t\tonActionMouseLeaveHandler(action: ICommonActionsDropdownComponentAction): void;\r\n\t\tgetCurrentAction(): ICommonActionsDropdownComponentAction;\r\n\t}\r\n}\r\n\r\nexport type IActionsDropdownComponentActionName = (entity: EntityType) => string;\r\n\r\n// TODO use ICommonDialogOptions expect 'any' after CommonDialog will be declared in some ngModule\r\n// export interface IActionsDropdownComponentActionData extends Partial> {\r\nexport interface ICommonActionsDropdownComponentActionData extends Partial {\r\n\t[key: string]: any,\r\n}\r\n","{{ option.name }}
","import {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tElementRef,\r\n\tInput,\r\n\tViewEncapsulation,\r\n} from '@angular/core';\r\nimport {\r\n\tCOMMON_ACTIONS_DROPDOWN_LABEL_TYPE,\r\n\tICommonActionsDropdownComponentAction,\r\n} from '../../common-actions-dropdown.interfaces';\r\n\r\n@Component({\r\n\tselector: 'common-actions-dropdown-option',\r\n\ttemplateUrl: './common-actions-dropdown-option.component.pug',\r\n\tstyleUrls: ['./common-actions-dropdown-option.component.sass'],\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n\tencapsulation: ViewEncapsulation.None,\r\n})\r\nexport class CommonActionsDropdownOptionComponent {\r\n\t@Input() option: ICommonActionsDropdownComponentAction;\r\n\t@Input() isActive: boolean;\r\n\r\n\tlabelTypes = COMMON_ACTIONS_DROPDOWN_LABEL_TYPE;\r\n\r\n\tconstructor (\r\n\t\tpublic elementRef: ElementRef,\r\n\t) {}\r\n\r\n\tgetOptionItemClasses(): string {\r\n\t\tconst classes = [];\r\n\r\n\t\tif (this.option.iconClasses) {\r\n\t\t\tclasses.push('b-actions-dropdown-menu-list-item--with_icon');\r\n\t\t}\r\n\t\tif (this.option.screen) {\r\n\t\t\tclasses.push('b-actions-dropdown-menu-list-item--with_arrow');\r\n\t\t}\r\n\t\tif (this.isActive) {\r\n\t\t\tclasses.push('b-actions-dropdown-menu-list-item--active');\r\n\t\t}\r\n\r\n\t\treturn classes.join(' ');\r\n\t}\r\n}\r\n","
","import {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tInject,\r\n\tInjector,\r\n\tQueryList,\r\n\tViewChildren,\r\n\tViewEncapsulation,\r\n} from '@angular/core';\r\n\r\nimport { COMMON_CONTEXT_MENU_EVENT_NAME } from '../../../context-menu.service/common-context-menu.interfaces';\r\nimport {\r\n\tCOMMON_CONTEXT_MENU_DATA,\r\n\tCOMMON_CONTEXT_MENU_ENTITY,\r\n\tCommonContextMenu,\r\n} from '../../../context-menu.service/common-context-menu.service';\r\nimport { CommonContextMenuBaseScreenComponent } from '../../../context-menu.service/components/common-context-menu-base-screen.component';\r\nimport {\r\n\tCOMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE,\r\n\tICommonActionsDropdownComponentContextMenuData,\r\n\tICommonActionsDropdownComponentAction,\r\n\tICommonActionsDropdownComponentActions,\r\n} from '../../common-actions-dropdown.interfaces';\r\nimport { CommonActionsDropdownOptionComponent } from '../common-actions-dropdown-option/common-actions-dropdown-option.component';\r\n\r\n@Component({\r\n\tselector: 'common-actions-dropdown-options-list',\r\n\ttemplateUrl: './common-actions-dropdown-options-list.component.pug',\r\n\tstyleUrls: ['./common-actions-dropdown-options-list.component.sass'],\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n\tencapsulation: ViewEncapsulation.None,\r\n})\r\nexport class CommonActionsDropdownOptionsListComponent> extends CommonContextMenuBaseScreenComponent {\r\n\toptions: ICommonActionsDropdownComponentActions = [];\r\n\r\n\t@ViewChildren(CommonActionsDropdownOptionComponent)\r\n\tprivate optionComponents: QueryList>;\r\n\r\n\tconstructor(\r\n\t\t@Inject(COMMON_CONTEXT_MENU_DATA) public data: DataType,\r\n\t\t@Inject(COMMON_CONTEXT_MENU_ENTITY) public commonContextMenu: CommonContextMenu,\r\n\t\tinjector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\t\tthis.options = this.data.actions;\r\n\t\tthis.subscribe(\r\n\t\t\tthis.commonContextMenu.onEvent(COMMON_CONTEXT_MENU_EVENT_NAME.CUSTOM),\r\n\t\t\t(payload) => {\r\n\t\t\t\tif (payload.payload.type === COMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE.CURRENT_ACTION_CHANGED) {\r\n\t\t\t\t\tthis.changeDetector.detectChanges();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (payload.payload.type === COMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE.CURRENT_ACTION_SELECTED_BY_KEYBOARD) {\r\n\t\t\t\t\tthis.emulateClickForKeyboardSelection();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t);\r\n\t}\r\n\r\n\tisOptionEnabled(option: ICommonActionsDropdownComponentAction): boolean {\r\n\t\treturn this.data.dropdownComponentApi.isActionEnabled(option);\r\n\t}\r\n\r\n\tonOptionClickHandler(option: ICommonActionsDropdownComponentAction) {\r\n\t\tthis.data.dropdownComponentApi.onActionClickHandler(option);\r\n\t}\r\n\r\n\tonOptionMouseEnterHandler(option: ICommonActionsDropdownComponentAction) {\r\n\t\tthis.data.dropdownComponentApi.onActionMouseEnterHandler(option);\r\n\t}\r\n\r\n\tonOptionMouseLeaveHandler(option: ICommonActionsDropdownComponentAction) {\r\n\t\tthis.data.dropdownComponentApi.onActionMouseLeaveHandler(option);\r\n\t}\r\n\r\n\tisActiveOption(option: ICommonActionsDropdownComponentAction) {\r\n\t\treturn this.data.dropdownComponentApi.getCurrentAction() === option;\r\n\t}\r\n\r\n\tprivate emulateClickForKeyboardSelection() {\r\n\t\tconst currentOption = this.optionComponents.find((optionElement) => optionElement.isActive);\r\n\t\tlet targetElementSelector;\r\n\t\tlet targetElement;\r\n\r\n\t\tif (currentOption.option.labelType === currentOption.labelTypes.LINK) {\r\n\t\t\ttargetElementSelector = 'a';\r\n\t\t} else if (currentOption.option.labelType === currentOption.labelTypes.LABEL) {\r\n\t\t\ttargetElementSelector = 'label';\r\n\t\t}\r\n\r\n\t\tif (targetElementSelector) {\r\n\t\t\ttargetElement = currentOption.elementRef.nativeElement.querySelector(targetElementSelector);\r\n\t\t}\r\n\r\n\t\tif (targetElement) {\r\n\t\t\ttargetElement.click();\r\n\t\t}\r\n\t}\r\n}\r\n","import { isString } from 'lodash';\r\n\r\nexport function getClosest (hostElement: HTMLElement, target: HTMLElement | string): HTMLElement {\r\n\tconst selectedElements = isString(target) ?\r\n\t\tArray.from(document.querySelectorAll(target)) :\r\n\t\t[target];\r\n\r\n\tlet closest;\r\n\tlet current = hostElement;\r\n\r\n\twhile (!closest && current && current.nodeType === Node.ELEMENT_NODE) {\r\n\t\tclosest = selectedElements.find((element) => current === element);\r\n\t\tcurrent = (current.parentElement || current.parentNode) as HTMLElement;\r\n\t}\r\n\r\n\treturn closest;\r\n}\r\n","const div = document.createElement('div');\r\n\r\nexport function stringToHtmlElements (html: string): HTMLElement {\r\n\tdiv.innerHTML = html;\r\n\r\n\treturn div.firstChild as HTMLElement;\r\n}\r\n\r\n// https://s3.memeshappen.com/memes/im-not-saying-its-magic-but-its-magic.jpg\r\n// Replace html symbols () in string to real symbols\r\nexport function stringToHtmlString (html: string): string {\r\n\tdiv.innerHTML = html;\r\n\treturn div.innerHTML;\r\n}\r\n","import { commonBrowserService } from '../browser/common-browser.service';\r\n\r\nexport const COMMON_KEYBOARD_KEY = {\r\n\tENTER: 'Enter',\r\n\tTAB: 'Tab',\r\n\tARROW_DOWN: commonBrowserService.browser.ie ? 'Down' : 'ArrowDown',\r\n\tARROW_UP: commonBrowserService.browser.ie ? 'Up' : 'ArrowUp',\r\n\tARROW_LEFT: commonBrowserService.browser.ie ? 'Left' : 'ArrowLeft',\r\n\tARROW_RIGHT: commonBrowserService.browser.ie ? 'Right' : 'ArrowRight',\r\n\tEND: 'End',\r\n\tHOME: 'Home',\r\n\tESCAPE: commonBrowserService.browser.ie ? 'Esc' : 'Escape',\r\n\tSPACE: commonBrowserService.browser.ie ? 'Spacebar' : ' ',\r\n\tBACKSPACE: 'Backspace',\r\n\tDELETE: commonBrowserService.browser.ie ? 'Del' : 'Delete',\r\n\tDIGIT_ONE: '1',\r\n\tDIGIT_ZERO: '0',\r\n\tMINUS: '-',\r\n\tUNDERSCORE: '_',\r\n\tEQUAL: '=',\r\n\tPLUS: '+',\r\n\tCOMMA: ',',\r\n\tSEMICOLON: ';',\r\n};\r\n","import { CommonBaseComponent } from '../base_component/base.component';\r\nimport { EventEmitter, HostListener, Output, Directive } from '@angular/core';\r\n\r\n@Directive()\r\nexport class CommonFocusedBaseComponent extends CommonBaseComponent {\r\n\t@Output() onFocus = new EventEmitter();\r\n\t@Output() onBlur = new EventEmitter();\r\n\r\n\tisFocused: boolean = false;\r\n\r\n\t@HostListener('focus') onFocusHandler(event: Event): void {\r\n\t\tthis.isFocused = true;\r\n\t\tthis.onFocus.emit(event);\r\n\t}\r\n\r\n\t@HostListener('blur') onBlurHandler(event: Event): void {\r\n\t\tthis.isFocused = false;\r\n\t\tthis.onBlur.emit(event);\r\n\t}\r\n}\r\n","import { HostBinding, HostListener, Input, Directive } from '@angular/core';\r\nimport { get } from 'lodash';\r\n\r\nimport { COMMON_KEYBOARD_KEY } from '../constants/keyboard.constant';\r\nimport { CommonFocusedBaseComponent } from '../base-focused-component/common-focused-base.component';\r\n\r\n@Directive()\r\nexport class CommonFocusedButtonBaseComponent extends CommonFocusedBaseComponent {\r\n\t@HostBinding('attr.tabindex') @Input() formTabIndex = 0;\r\n\r\n\t@HostListener('click', ['$event'])\r\n\t@HostListener('keydown.enter', ['$event'])\r\n\t@HostListener('keydown.space', ['$event'])\r\n\t@HostListener('keydown.spacebar', ['$event'])\r\n\tonClickOrEnterOrSpaceHandler($event) {\r\n\t\tif (get($event, 'key') === COMMON_KEYBOARD_KEY.SPACE) {\r\n\t\t\t$event.preventDefault();\r\n\t\t}\r\n\r\n\t\tthis.onAction($event);\r\n\t}\r\n\r\n\t@HostListener('keydown.tab', ['$event'])\r\n\tonTabHandler($event) {\r\n\t\tthis.onTab($event);\r\n\t}\r\n\r\n\tonAction($event) {\r\n\t\t// empty\r\n\t}\r\n\r\n\tonTab($event) {\r\n\t\t// empty\r\n\t}\r\n}\r\n","import {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tEventEmitter, HostBinding, Input,\r\n\tOutput,\r\n} from '@angular/core';\r\n\r\nimport { CommonFocusedButtonBaseComponent } from '../../../base-focused-button-component/common-focused-button-base.component';\r\n\r\n@Component({\r\n\tselector: 'common-dialog-button',\r\n\ttemplateUrl: './common-dialog-button.component.pug',\r\n\tstyleUrls: ['./common-dialog-button.component.sass'],\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CommonDialogButtonComponent extends CommonFocusedButtonBaseComponent {\r\n\t@Input() isDisabled: boolean;\r\n\t@Output() action = new EventEmitter();\r\n\r\n\t@HostBinding('class') get hostClass(): string {\r\n\t\tconst classes = [];\r\n\r\n\t\tif (this.cssClasses) {\r\n\t\t\tclasses.push(...this.cssClasses.split(' '));\r\n\t\t}\r\n\t\tif (this.isDisabled) {\r\n\t\t\tclasses.push('is-disabled');\r\n\t\t}\r\n\r\n\t\treturn classes.join(' ');\r\n\t}\r\n\r\n\tonAction($event) {\r\n\t\tif (!this.isDisabled) {\r\n\t\t\tthis.action.emit($event);\r\n\t\t}\r\n\t}\r\n}\r\n","","
{{ label }}
","// New version src/Common/loader/loader.component.ts CommonLoaderComponent\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/controls/common_controls_loader_module/ctrl_loader_component_service.jsx CtrlLoaderComponent\r\n\r\nimport { ChangeDetectionStrategy, Component, Input, SimpleChanges, ViewEncapsulation } from '@angular/core';\r\n\r\nimport { TCallbackFunc } from '../../../interfaces/core';\r\nimport { CommonDebugComponent } from '../../../controls/control/debug/debug.decorator';\r\nimport { CommonBaseComponent } from '../../../base_component/base.component';\r\nimport { COMMON_LOADER_DEFAULT_DELAY_TIMEOUT } from '../../const/loader-default-delay-timeout';\r\n\r\n@CommonDebugComponent({\r\n\tname: 'common-loader',\r\n\tdesignLink: 'https://app.zeplin.io/project/591460ff7793c56928756817/screen/5a37719d5a61c59c7e44d8b7',\r\n\tdescription: 'Annimated loading image',\r\n\tprops: {\r\n\t\tisLoading: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Active or not',\r\n\t\t\tdefaultValue: true,\r\n\t\t},\r\n\t\thasDelay: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Delay before showing loader',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\thasMinDuration: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Minimum loader display time',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tlabel: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Loaders text',\r\n\t\t\tdefaultValue: 'Label',\r\n\t\t},\r\n\t\tmodifiers: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'CSS classes for control',\r\n\t\t\tdefaultValue: 'sand_box test',\r\n\t\t},\r\n\r\n\t\tctrlLoaderClasses: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'CSS classes for loader',\r\n\t\t\tdefaultValue: '',\r\n\t\t},\r\n\t\tclassName: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'CSS classes for container',\r\n\t\t\tdefaultValue: '',\r\n\t\t},\r\n\t\tctrlLoaderTopAligned: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Made align to top',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tctrlLoaderWithOverlay: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'With overlay',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t},\r\n\tstates: {\r\n\t\tisShow: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Is it displayed?',\r\n\t\t},\r\n\t\tdelayTimeout: {\r\n\t\t\ttype: 'number',\r\n\t\t\tdescription: 'Delay before displaying the loader',\r\n\t\t},\r\n\t\tdurationTimeout: {\r\n\t\t\ttype: 'number',\r\n\t\t\tdescription: 'Minimum loader display time',\r\n\t\t},\r\n\t\tcancelDelayTimer: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Is there now waiting for the loader to start',\r\n\t\t\tget: (component) => !!component.cancelDelayTimer,\r\n\t\t\tset: () => void(0),\r\n\t\t},\r\n\t\tcancelDurationTimer: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Is there now waiting for the completion of the minimum display time of the loader',\r\n\t\t\tget: (component) => !!component.cancelDurationTimer,\r\n\t\t\tset: () => void(0),\r\n\t\t},\r\n\t},\r\n})\r\n@Component({\r\n\tselector: 'common-loader',\r\n\ttemplateUrl: './loader.component.pug',\r\n\tstyleUrls: ['./loader.component.sass'],\r\n\tencapsulation: ViewEncapsulation.None,\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CommonLoaderComponent extends CommonBaseComponent {\r\n\t@Input() isLoading: boolean = false;\r\n\t@Input() hasDelay: boolean = false;\r\n\t@Input() hasMinDuration: boolean = false;\r\n\t@Input() label: string = '';\r\n\t@Input() loaderClasses: string = '';\r\n\t@Input() loaderTopAligned: boolean = false;\r\n\t@Input() loaderWithOverlay: boolean = false;\r\n\r\n\tisShow: boolean = false;\r\n\tisMinDurationOver: boolean = true;\r\n\r\n\tprotected delayTimeout: number = 0;\r\n\tprotected durationTimeout: number = 0;\r\n\tprotected cancelDelayTimer: TCallbackFunc;\r\n\tprotected cancelDurationTimer: TCallbackFunc;\r\n\r\n\tngOnInit(): void {\r\n\t\tsuper.ngOnInit();\r\n\r\n\t\tthis.willUnbind(() => this.cancelDelayTimer);\r\n\t\tthis.willUnbind(() => this.cancelDurationTimer);\r\n\t}\r\n\r\n\tngOnChanges(changes: SimpleChanges): void {\r\n\t\tsuper.ngOnChanges(changes);\r\n\r\n\t\tif (changes.hasDelay) {\r\n\t\t\tif (changes.hasDelay.currentValue) {\r\n\t\t\t\tthis.delayTimeout = COMMON_LOADER_DEFAULT_DELAY_TIMEOUT;\r\n\t\t\t} else {\r\n\t\t\t\tthis.delayTimeout = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (changes.hasMinDuration) {\r\n\t\t\tif (changes.hasMinDuration.currentValue) {\r\n\t\t\t\tthis.durationTimeout = COMMON_LOADER_DEFAULT_DELAY_TIMEOUT;\r\n\t\t\t} else {\r\n\t\t\t\tthis.durationTimeout = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (changes.isLoading) {\r\n\t\t\tif (changes.isLoading.currentValue) {\r\n\t\t\t\tif (this.hasDelay || this.hasMinDuration) {\r\n\t\t\t\t\tthis.startLoader();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.isShow = true;\r\n\t\t\t\t\tthis.runUpdate();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (this.hasDelay || this.hasMinDuration) {\r\n\t\t\t\t\tthis.stopLoading();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.isShow = false;\r\n\t\t\t\t\tthis.runUpdate();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected startLoader(): void {\r\n\t\tthis.cancelDelayTimer = this.timeout(\r\n\t\t\t() => this.showLoader(),\r\n\t\t\tthis.delayTimeout,\r\n\t\t\t() => this.cancelDelayTimer = null,\r\n\t\t);\r\n\t}\r\n\r\n\tprotected showLoader(): void {\r\n\t\tthis.isMinDurationOver = false;\r\n\t\tthis.isShow = true;\r\n\t\tthis.runUpdate();\r\n\r\n\t\tthis.cancelDurationTimer = this.timeout(\r\n\t\t\t() => {\r\n\t\t\t\tthis.isMinDurationOver = true;\r\n\t\t\t\tthis.runUpdate();\r\n\t\t\t},\r\n\t\t\tthis.durationTimeout,\r\n\t\t\t() => this.cancelDurationTimer = null,\r\n\t\t);\r\n\t}\r\n\r\n\tprotected stopLoading(): void {\r\n\t\tif (this.cancelDelayTimer) {\r\n\t\t\tthis.cancelDelayTimer();\r\n\t\t}\r\n\r\n\t\tthis.isShow = false;\r\n\t\tthis.runUpdate();\r\n\t}\r\n}\r\n","export const COMMON_LOADER_DEFAULT_DELAY_TIMEOUT = 300;\r\n","
{{header}}
{{ acceptText || ('common.apply' | translate) }}{{ declineText || ('common.decline' | translate) }}
","// Old version CommonDialogWidget src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/widgets/common_dialog_widget_directive.js\r\n// New version CommonDialogComponent src/Common/blocks/dialog/common-dialog.component.ts\r\n\r\nimport {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tHostListener,\r\n\tInput,\r\n\tSimpleChanges,\r\n\tViewEncapsulation,\r\n} from '@angular/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\n\r\nimport { CommonBaseComponent } from '../../base_component/base.component';\r\nimport { isObservable, Observable } from 'rxjs';\r\nimport { finalize } from 'rxjs/operators';\r\nimport { isPromise } from 'rxjs/internal-compatibility';\r\n\r\nexport const COMMON_DIALOG_DELETING_CLASS_MOD = 'b-dialog--deleting';\r\n\r\nexport interface ICommonDialogOptions {\r\n\tcssClasses?: string,\r\n\theader?: string,\r\n\ttext?: string,\r\n\ttextFunc?: (entity: EntityType) => string,\r\n\r\n\tacceptFunc?: (entity: EntityType, dialog: any) => void,\r\n\tacceptText?: string,\r\n\r\n\tdeclineFunc?: (entity: EntityType, dialog: any) => void,\r\n\tdeclineText?: string,\r\n\tisShowDeclineButton?: boolean,\r\n\r\n\tcloseText?: string,\r\n}\r\n\r\n@Component({\r\n\tselector: 'common-dialog',\r\n\ttemplateUrl: './common-dialog.component.pug',\r\n\tstyleUrls: ['./common-dialog.component.sass'],\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n\tencapsulation: ViewEncapsulation.None,\r\n})\r\nexport class CommonDialogComponent extends CommonBaseComponent {\r\n\t@Input() cssClasses: string; // css classes for dialog\r\n\t@Input() item: ItemType; // Item for dialog\r\n\t@Input() header: string; // Text for header in dialog\r\n\t@Input() text: string; // Main text in dialog\r\n\t@Input() textFunc: (item: ItemType) => string; // Generate main text from item\r\n\t@Input() isLoading: boolean = false; // Show full overlay dialog loader\r\n\t@Input() isContentLoading: boolean = false; // Show content loader\r\n\t@Input() disableScroll: boolean = true; // disable scroll inside dialog\r\n\r\n\t@Input() acceptFunc: (item: ItemType, dialog: CommonDialogComponent) => Promise | Observable | void; // Callback for accept button\r\n\t@Input() acceptText: string; // Text for accept button\r\n\t@Input() isDisabledAcceptBtn: boolean = false;\r\n\t@Input() isShowAcceptBtn: boolean = true; // Display accept button?\r\n\r\n\t@Input() declineFunc: (item: ItemType, dialog: CommonDialogComponent) => Promise | Observable | void; // Callback for decline button\r\n\t@Input() declineText: string; // Text for decline button\r\n\t@Input() isShowDeclineButton: boolean = true; // Display decline button?\r\n\r\n\t@Input() backFunc: (item: ItemType, dialog: CommonDialogComponent) => Promise | Observable | void; // Callback for back button\r\n\r\n\t@Input() closeFunc: (item: ItemType, dialog: CommonDialogComponent) => Promise | Observable | void; // Callback for close button\r\n\t@Input() closeText: string; // Text for close button\r\n\r\n\t@Input() readonly hideButtons: boolean; // to hide both accept and decline btns\r\n\r\n\tprivate isWaitingResultEnabled = false; // Fix for CASEM-59208 (mass click protection)\r\n\r\n\t@HostListener('document:keydown.escape') async onKeydownEscape() {\r\n\t\tif (this.backFunc) {\r\n\t\t\tthis.onBackClicked();\r\n\t\t} else if (this.closeFunc) {\r\n\t\t\tthis.onCloseClicked();\r\n\t\t}\r\n\t}\r\n\r\n\tngOnChanges(changes: SimpleChanges) {\r\n\t\tsuper.ngOnChanges(changes);\r\n\r\n\t\tif (this.text && this.textFunc) {\r\n\t\t\tthrow new Error('Cannot to @Input text and textFunc together');\r\n\t\t}\r\n\t}\r\n\r\n\tonCloseClicked(): void {\r\n\t\tthis.close();\r\n\t}\r\n\r\n\tclose(): void {\r\n\t\tthis.closeFunc(this.item, this);\r\n\t}\r\n\r\n\tgetSanitizedText(): SafeHtml {\r\n\t\tconst domSanitizer = this.injector.get(DomSanitizer);\r\n\r\n\t\tconst text: string = this.textFunc ? this.textFunc(this.item) : this.text;\r\n\r\n\t\treturn domSanitizer.bypassSecurityTrustHtml(text);\r\n\t}\r\n\r\n\tonAcceptClicked(): void {\r\n\t\tif (this.isWaitingResultEnabled || this.isDisabledAcceptBtn) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isWaitingResultEnabled = true;\r\n\t\tthis.waitResult(this.acceptFunc(this.item, this));\r\n\t}\r\n\r\n\tonDeclineClicked(): void {\r\n\t\tif (this.isWaitingResultEnabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isWaitingResultEnabled = true;\r\n\t\tthis.waitResult(this.declineFunc(this.item, this));\r\n\t}\r\n\r\n\tonBackClicked(): void {\r\n\t\tthis.backFunc(this.item, this);\r\n\t}\r\n\r\n\tprivate waitResult(res: Promise | Observable | void) {\r\n\t\tif (isPromise(res)) {\r\n\t\t\tres\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.isWaitingResultEnabled = false;\r\n\t\t\t\t});\r\n\t\t} else if (isObservable(res)) {\r\n\t\t\tthis.subscribeWithRun(\r\n\t\t\t\tres.pipe(\r\n\t\t\t\t\tfinalize(() => {\r\n\t\t\t\t\t\tthis.isWaitingResultEnabled = false;\r\n\t\t\t\t\t}),\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tthis.isWaitingResultEnabled = false;\r\n\t\t}\r\n\t}\r\n}\r\n","import { ChangeDetectionStrategy, Component, InjectionToken } from '@angular/core';\r\n\r\nimport { ICommonDialogOptions } from '../common-dialog.component';\r\nimport { CommonContextMenuBaseScreenComponent } from '../../../context-menu/context-menu.service/components/common-context-menu-base-screen.component';\r\n\r\nexport const COMMON_DIALOG_CONTEXT_MENU_SCREEN_INTERNAL_INTERFACE = new InjectionToken>('COMMON_DIALOG_CONTEXT_MENU_SCREEN_INTERNAL_INTERFACE');\r\n\r\nexport interface ICommonDialogContextMenuScreenInternalInterface {\r\n\tentity: EntityType,\r\n\tgetDialogOptions(): ICommonDialogOptions;\r\n\tbackToDefault?(): void; // Change screen in ContextMenu on list\r\n\tclose(): void; // Close ContextMenu\r\n}\r\n\r\n@Component({\r\n\tselector: 'common-actions-dropdown-dialog',\r\n\ttemplateUrl: './common-dialog-context-menu-screen.component.pug',\r\n\tstyleUrls: ['./common-dialog-context-menu-screen.component.sass'],\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CommonDialogContextMenuScreenComponent extends CommonContextMenuBaseScreenComponent {\r\n\tcommonDialogOptions: ICommonDialogOptions;\r\n\tinternalInterface: ICommonDialogContextMenuScreenInternalInterface;\r\n\tentity: EntityType;\r\n\r\n\tngOnInit() {\r\n\t\tsuper.ngOnInit();\r\n\r\n\t\tthis.internalInterface = this.injector.get(COMMON_DIALOG_CONTEXT_MENU_SCREEN_INTERNAL_INTERFACE, null);\r\n\t\tthis.backToDefault = this.internalInterface.backToDefault;\r\n\t\tthis.commonDialogOptions = this.internalInterface.getDialogOptions();\r\n\t\tthis.entity = this.internalInterface.entity;\r\n\r\n\t\tif (this.commonDialogOptions) {\r\n\t\t\tthis.commonDialogOptions.declineFunc = this.commonDialogOptions.declineFunc || this.close;\r\n\t\t}\r\n\t}\r\n\r\n\tbackToDefault = () => {\r\n\t\t// not empty\r\n\t}\r\n\r\n\tclose = () => {\r\n\t\tthis.internalInterface.close();\r\n\t}\r\n}\r\n","","import { ComponentRef, Inject, Injectable } from '@angular/core';\r\nimport { PERFORMANCE, WINDOW } from '@ng-web-apis/common';\r\nimport { enableDebugTools } from '@angular/platform-browser';\r\nimport { debounce, isNil } from 'lodash';\r\nimport { isAppPerformanceCreated } from '@CaseOne/Common/utilities/performance-check-utils/performance-check-utils';\r\n\r\n\r\nexport interface ICommonDebugPerformanceMeasure {\r\n\tisMeasured: boolean;\r\n\r\n\tstart: () => void;\r\n\tstop: () => ICommonDebugPerformanceMeasureResult;\r\n\tdebouncedStop: () => ICommonDebugPerformanceMeasureResult;\r\n\tclear: () => void;\r\n}\r\n\r\nexport interface ICommonDebugPerformanceMeasureResult {\r\n\tperformanceEntry: PerformanceEntry,\r\n\tendTime: number,\r\n}\r\n\r\nexport interface ICommonDebugPerformanceMeasureOptions {\r\n\ttimeout?: number,\r\n}\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonDebugService {\r\n\treadonly isDebugToolsEnabled: boolean;\r\n\treadonly isPerformanceCheckEnabled: boolean;\r\n\r\n\tconstructor(\r\n\t\t@Inject(PERFORMANCE) private performance: Performance,\r\n\t\t@Inject(WINDOW) private window: Window,\r\n\t) {\r\n\t\tthis.isDebugToolsEnabled = !!this.window.AppData?.IsDebugToolsEnabled; // without CommonAppDataService to minimize dependencies on initialization\r\n\t\tthis.isPerformanceCheckEnabled = !!this.window.AppData?.IsPerformanceCheckEnabled;\r\n\t}\r\n\r\n\tenableDebugTools(componentRef: ComponentRef) {\r\n\t\tif (this.isDebugToolsEnabled) {\r\n\t\t\tenableDebugTools(componentRef);\r\n\t\t}\r\n\t}\r\n\r\n\tcreatePerformanceMeasure = (\r\n\t\tcomponentName: string,\r\n\t\tmarkAName: string,\r\n\t\tmarkBName: string,\r\n\t\toptions: ICommonDebugPerformanceMeasureOptions = {}\r\n\t): ICommonDebugPerformanceMeasure => {\r\n\t\tif (this.isPerformanceCheckEnabled) {\r\n\t\t\tconst measureName = `${componentName} from ${markAName} to ${markBName}`;\r\n\t\t\tconst timeout = isNil(options?.timeout) ? 5000 : options?.timeout;\r\n\t\t\tlet lastPerformanceMarkCreated = false;\r\n\t\t\tlet lastPerformanceNow: number = 0;\r\n\t\t\tconst clear = () => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (this.isPerformanceCheckEnabled) {\r\n\t\t\t\t\t\tthis.performance.clearMarks(markAName);\r\n\t\t\t\t\t\tthis.performance.clearMarks(markBName);\r\n\t\t\t\t\t\tthis.performance.clearMeasures(measureName);\r\n\t\t\t\t\t\tlastPerformanceMarkCreated = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.error(e);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tconst start = () => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (this.isPerformanceCheckEnabled) {\r\n\t\t\t\t\t\tmeasure.isMeasured = false;\r\n\t\t\t\t\t\tclear();\r\n\t\t\t\t\t\tthis.performance.mark(markAName);\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.error(e);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tconst createLastPerformanceMark = () => {\r\n\t\t\t\tthis.performance.clearMarks(markBName);\r\n\t\t\t\tthis.performance.mark(markBName);\r\n\t\t\t\tlastPerformanceNow = this.performance.now();\r\n\t\t\t\tlastPerformanceMarkCreated = true;\r\n\t\t\t};\r\n\t\t\tconst stop = (): ICommonDebugPerformanceMeasureResult | null => {\r\n\t\t\t\tlet result: ICommonDebugPerformanceMeasureResult;\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (this.isPerformanceCheckEnabled && !measure.isMeasured) {\r\n\t\t\t\t\t\tlet performanceEntries: PerformanceEntry[];\r\n\r\n\t\t\t\t\t\tif (!lastPerformanceMarkCreated) {\r\n\t\t\t\t\t\t\tcreateLastPerformanceMark();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.performance.measure(measureName, markAName, markBName);\r\n\t\t\t\t\t\tperformanceEntries = this.performance.getEntriesByName(measureName);\r\n\t\t\t\t\t\tresult = performanceEntries?.length ? {\r\n\t\t\t\t\t\t\tperformanceEntry: performanceEntries[0],\r\n\t\t\t\t\t\t\tendTime: lastPerformanceNow,\r\n\t\t\t\t\t\t} : null;\r\n\t\t\t\t\t\tclear();\r\n\t\t\t\t\t\tmeasure.isMeasured = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.error(e);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.sendPerformanceEntryToWindow(measureName, result); // For AQA\r\n\t\t\t\t// tslint:disable:no-console\r\n\t\t\t\tconsole.info(`${measureName} duration: ${result?.performanceEntry?.duration}; result:`, result);\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t};\r\n\t\t\tconst internalDebouncedStop = debounce(stop, timeout);\r\n\t\t\tconst debouncedStop = (): ICommonDebugPerformanceMeasureResult | null => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (this.isPerformanceCheckEnabled) {\r\n\t\t\t\t\t\tcreateLastPerformanceMark();\r\n\t\t\t\t\t\treturn internalDebouncedStop();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.error(e);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tconst measure: ICommonDebugPerformanceMeasure = {\r\n\t\t\t\tisMeasured: false,\r\n\r\n\t\t\t\tstart,\r\n\t\t\t\tstop,\r\n\t\t\t\tdebouncedStop,\r\n\t\t\t\tclear,\r\n\t\t\t};\r\n\r\n\t\t\tstart();\r\n\r\n\t\t\treturn measure;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate sendPerformanceEntryToWindow(measureName: string, performanceMeasureResult: ICommonDebugPerformanceMeasureResult | null) {\r\n\t\tif (this.isPerformanceCheckEnabled) {\r\n\t\t\tisAppPerformanceCreated(this.window);\r\n\t\t\tthis.window.AppPerformance.measures[measureName] = performanceMeasureResult;\r\n\t\t}\r\n\t}\r\n}\r\n","// Old version commonActionsDropdown src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/widgets/common_actions_dropdown_directive.js\r\n// New version CommonActionsDropdownComponent src/Common/context-menu/actions-dropdown.component/common-actions-dropdown.component.ts\r\n\r\n// The dropdown menu component, according to the options, forms the dropdown menu in a specific place in layouts\r\n\r\nimport {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tElementRef,\r\n\tHostBinding,\r\n\tHostListener,\r\n\tInjector,\r\n\tInput,\r\n} from '@angular/core';\r\nimport {\r\n\textend,\r\n\tget,\r\n\tcloneDeep,\r\n} from 'lodash';\r\n\r\nimport { CommonDebugComponent } from '../../controls/control/debug/debug.decorator';\r\nimport { CommonContextMenuFactory } from '../context-menu.service/common-context-menu.factory';\r\nimport {\r\n\tCOMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS,\r\n\tCOMMON_CONTEXT_MENU_ATTACHMENTS,\r\n\tCOMMON_CONTEXT_MENU_EVENT_NAME,\r\n\tICommonComponentWithContextMenu,\r\n\tICommonContextMenuOptions,\r\n} from '../context-menu.service/common-context-menu.interfaces';\r\nimport { CommonActionsDropdownOptionsListComponent } from './components/common-actions-dropdown-options-list/common-actions-dropdown-options-list.component';\r\nimport { CommonContextMenu } from '../context-menu.service/common-context-menu.service';\r\nimport {\r\n\tCOMMON_ACTIONS_DROPDOWN_CONTENT_TYPE,\r\n\tCOMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE,\r\n\tCOMMON_ACTIONS_DROPDOWN_LABEL_TYPE,\r\n\tICommonActionsDropdownComponentAction,\r\n\tICommonActionsDropdownComponentActionData,\r\n\tICommonActionsDropdownComponentActions,\r\n\tICommonActionsDropdownComponentContextMenuData,\r\n} from './common-actions-dropdown.interfaces';\r\nimport { getClosest } from '../../utilities/html';\r\nimport { COMMON_KEYBOARD_KEY } from '../../constants/keyboard.constant';\r\nimport { CommonFocusedBaseComponent } from '../../base-focused-component/common-focused-base.component';\r\nimport {\r\n\tCOMMON_DIALOG_CONTEXT_MENU_SCREEN_INTERNAL_INTERFACE,\r\n\tCommonDialogContextMenuScreenComponent,\r\n\tICommonDialogContextMenuScreenInternalInterface,\r\n} from '../../blocks/dialog/common-dialog-context-menu-screen.component/common-dialog-context-menu-screen.component';\r\nimport { COMMON_DIALOG_DELETING_CLASS_MOD } from '../../blocks/dialog/common-dialog.component';\r\nimport { CommonDebugService, ICommonDebugPerformanceMeasure } from '@CaseOne/Common/debug/common-debug.service';\r\n\r\nenum DIRECTION {\r\n\tUP = 1,\r\n\tDOWN = -1,\r\n}\r\nconst DEFAULT_PARENT_ROW_CLASS = 'ui-table-row';\r\nconst DEFAULT_COMPONENT_CLASS = 'b-actions-dropdown';\r\nconst DISABLED_COMPONENT_CLASS = 'is-disabled';\r\n\r\n@CommonDebugComponent({\r\n\tname: 'common-actions-dropdown-component',\r\n\tdesignLink: 'https://app.zeplin.io/project/591460ff7793c56928756817/screen/594a79e9e437a177c9118b18',\r\n\tdescription: '',\r\n\tprops: {\r\n\t\tactions: {\r\n\t\t\ttype: 'interface',\r\n\t\t\tdescription: 'List of actions in context menu',\r\n\t\t\tdefaultValue: [{\r\n\t\t\t\tid: 'first_menu_item',\r\n\t\t\t\tname: 'First menu item',\r\n\t\t\t\taction: () => {\r\n\t\t\t\t\talert('CLicked First');\r\n\t\t\t\t},\r\n\t\t\t}, {\r\n\t\t\t\tid: 'link_menu_item',\r\n\t\t\t\tname: 'This is link to another page',\r\n\t\t\t\tlabelType: COMMON_ACTIONS_DROPDOWN_LABEL_TYPE.LINK,\r\n\t\t\t\tdata: {\r\n\t\t\t\t\thref: 'https://google.com',\r\n\t\t\t\t},\r\n\t\t\t}, {\r\n\t\t\t\tid: 'DisabledOption',\r\n\t\t\t\tname: 'This is disabled option',\r\n\t\t\t\tisEnabled: () => false,\r\n\t\t\t}],\r\n\t\t},\r\n\t\tentity: {\r\n\t\t\ttype: 'interface',\r\n\t\t\tdescription: 'Entity for actions',\r\n\t\t\tdefaultValue: {\r\n\t\t\t\tId: 'Id',\r\n\t\t\t\tName: 'Name',\r\n\t\t\t},\r\n\t\t},\r\n\t\tcssClasses: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'CSS classes for component',\r\n\t\t\tdefaultValue: '',\r\n\t\t},\r\n\t\tparentRowClass: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'CSS class for toggle parent row statu',\r\n\t\t\tdefaultValue: '',\r\n\t\t},\r\n\t\tcontextMenuOptions: {\r\n\t\t\ttype: 'interface',\r\n\t\t\tdescription: 'Options for context menu',\r\n\t\t\tdefaultValue: {},\r\n\t\t},\r\n\t},\r\n\tstates: {\r\n\t\tisFocused: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Control is focused',\r\n\t\t},\r\n\t\tisHovered: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Cursor is over control',\r\n\t\t},\r\n\t\tisPressed: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'User pressed control',\r\n\t\t},\r\n\t},\r\n})\r\n@Component({\r\n\tselector: 'common-actions-dropdown-component',\r\n\ttemplate: '',\r\n\tstyleUrls: ['./common-actions-dropdown.component.sass'],\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CommonActionsDropdownComponent extends CommonFocusedBaseComponent implements ICommonComponentWithContextMenu {\r\n\t@HostBinding('attr.tabindex') @Input() get formTabIndex(): number {\r\n\t\treturn this.isDisabled ? null : this.tabIndex;\r\n\t}\r\n\tset formTabIndex(tabIndex) {\r\n\t\tthis.tabIndex = tabIndex;\r\n\t}\r\n\t@HostBinding('attr.disabled') get isDisabled(): string {\r\n\t\treturn (\r\n\t\t\t!this.actions ||\r\n\t\t\t!this.actions.length ||\r\n\t\t\t!this.actions.some(this.isActionEnabled)\r\n\t\t)\r\n\t\t\t? 'disabled'\r\n\t\t\t: null;\r\n\t}\r\n\t@HostBinding('class') get hostClass(): string {\r\n\t\tconst classes = [DEFAULT_COMPONENT_CLASS];\r\n\r\n\t\tif (this.cssClasses) {\r\n\t\t\tclasses.push(...this.cssClasses.split(' '));\r\n\t\t}\r\n\t\tif (this.isDisabled) {\r\n\t\t\tclasses.push(DISABLED_COMPONENT_CLASS);\r\n\t\t}\r\n\r\n\t\treturn classes.join(' ');\r\n\t}\r\n\r\n\t@Input() actions: ICommonActionsDropdownComponentActions; // A set of menu items along with options\r\n\t@Input() entity: EntityType; // Instance entity with which this menu operates\r\n\t@Input() cssClasses: string; // Stylistic classes to be added to the main element of the menu button\r\n\t@Input() parentRowClass: string = DEFAULT_PARENT_ROW_CLASS; // css class for toggle parent row status, when context menu is opened\r\n\t@Input() contextMenuOptions: Partial; // Options for ContextMenu\r\n\r\n\tprivate contextMenu: CommonContextMenu>;\r\n\tprivate currentAction: ICommonActionsDropdownComponentAction = null;\r\n\tprivate hoveredAction: ICommonActionsDropdownComponentAction = null;\r\n\tprivate tabIndex: number = 0;\r\n\r\n\tprivate openPerformanceMeasure: ICommonDebugPerformanceMeasure;\r\n\r\n\tconstructor(\r\n\t\tprotected elementRef: ElementRef,\r\n\t\tprotected commonContextMenuFactory: CommonContextMenuFactory,\r\n\t\tprivate commonDebugService: CommonDebugService,\r\n\t\tinjector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\t}\r\n\r\n\t@HostListener('mousedown') onClick () {\r\n\t\tif (this.isDisabled) return;\r\n\r\n\t\tif (this.contextMenu) {\r\n\t\t\tthis.closeContextMenu();\r\n\t\t} else {\r\n\t\t\tthis.openContextMenu();\r\n\t\t}\r\n\t}\r\n\r\n\t@HostListener('document:keydown', ['$event']) handleKeyboardEvent (event: KeyboardEvent) {\r\n\t\tif (!this.contextMenu) {\r\n\t\t\tif (\r\n\t\t\t\tthis.isFocused &&\r\n\t\t\t\t[\r\n\t\t\t\t\tCOMMON_KEYBOARD_KEY.ENTER,\r\n\t\t\t\t\tCOMMON_KEYBOARD_KEY.ARROW_DOWN,\r\n\t\t\t\t\tCOMMON_KEYBOARD_KEY.SPACE,\r\n\t\t\t\t].includes(event.key)\r\n\t\t\t) {\r\n\t\t\t\tthis.openContextMenu();\r\n\t\t\t\tthis.stopEvent(event);\r\n\t\t\t}\r\n\t\t} else if (this.contextMenu.activeScreenName === 'default') {\r\n\t\t\tswitch (event.key) {\r\n\t\t\t\tcase COMMON_KEYBOARD_KEY.ARROW_RIGHT:\r\n\t\t\t\tcase COMMON_KEYBOARD_KEY.ENTER:\r\n\t\t\t\t\tif (this.currentAction) {\r\n\t\t\t\t\t\tthis.onActionClickHandler(this.currentAction, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.stopEvent(event);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase COMMON_KEYBOARD_KEY.ARROW_DOWN:\r\n\t\t\t\t\tthis.changeCurrentActionByDirection(DIRECTION.DOWN);\r\n\t\t\t\t\tthis.stopEvent(event);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase COMMON_KEYBOARD_KEY.ARROW_UP:\r\n\t\t\t\t\tthis.changeCurrentActionByDirection(DIRECTION.UP);\r\n\t\t\t\t\tthis.stopEvent(event);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase COMMON_KEYBOARD_KEY.ESCAPE:\r\n\t\t\t\t\tthis.closeContextMenu();\r\n\t\t\t\t\tthis.stopEvent(event);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase COMMON_KEYBOARD_KEY.TAB:\r\n\t\t\t\t\t// suppress focus change\r\n\t\t\t\t\tthis.stopEvent(event);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t// ignore event\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tngOnDestroy() {\r\n\t\tif (this.openPerformanceMeasure) {\r\n\t\t\tthis.openPerformanceMeasure.clear();\r\n\t\t\tthis.openPerformanceMeasure = null;\r\n\t\t}\r\n\r\n\t\tsuper.ngOnDestroy();\r\n\t}\r\n\r\n\t// Open the context menu, will be used through Ref\r\n\topenContextMenu() {\r\n\t\tthis.openPerformanceMeasure = this.commonDebugService.createPerformanceMeasure(\r\n\t\t\t'CommonActionsDropdownComponent',\r\n\t\t\t'beforeOpen',\r\n\t\t\t'afterOpen',\r\n\t\t);\r\n\t\tthis.checkIsActionsValid();\r\n\r\n\t\tconst parentRowToHighlight = getClosest(this.elementRef.nativeElement as HTMLElement, `.${ this.parentRowClass }`);\r\n\r\n\t\tthis.contextMenu = this.commonContextMenuFactory.open>({\r\n\t\t\t...{\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tactions: this.getPreparedActions(),\r\n\t\t\t\t\tdropdownComponentApi: {\r\n\t\t\t\t\t\tonActionClickHandler: (action) => this.onActionClickHandler(action),\r\n\t\t\t\t\t\tonActionMouseEnterHandler: (action) => this.onActionMouseEnterHandler(action),\r\n\t\t\t\t\t\tonActionMouseLeaveHandler: (action) => this.onActionMouseLeaveHandler(action),\r\n\t\t\t\t\t\tisActionEnabled: (action) => this.isActionEnabled(action),\r\n\t\t\t\t\t\tgetCurrentAction: () => this.currentAction,\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\ttargetEl: get(this.contextMenuOptions, 'targetEl', this.elementRef.nativeElement),\r\n\t\t\t\tattachment: get(this.contextMenuOptions, 'attachment', COMMON_CONTEXT_MENU_ATTACHMENTS.RIGHT),\r\n\t\t\t\tscreens: {\r\n\t\t\t\t\tdefault: {\r\n\t\t\t\t\t\tcomponent: CommonActionsDropdownOptionsListComponent,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t...this.actions.reduce((screens, action) => {\r\n\t\t\t\t\t\tif (action.screen) {\r\n\t\t\t\t\t\t\tscreens[action.screen.name] = action.screen;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn screens;\r\n\t\t\t\t\t}, {}),\r\n\t\t\t\t},\r\n\t\t\t\tevents: {\r\n\t\t\t\t\t...get(this.contextMenuOptions, 'events', {}),\r\n\t\t\t\t\t[COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CLOSE]: (event) => {\r\n\t\t\t\t\t\tconst contextMenuOptionsEvent = get(this.contextMenuOptions, `events['${COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_CLOSE}']`);\r\n\t\t\t\t\t\tif (contextMenuOptionsEvent) contextMenuOptionsEvent(event);\r\n\r\n\t\t\t\t\t\tif (parentRowToHighlight) {\r\n\t\t\t\t\t\t\tparentRowToHighlight.classList.remove(this.parentRowClass + '--menu-opened');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.contextMenu = null;\r\n\t\t\t\t\t\tthis.hoveredAction = null;\r\n\t\t\t\t\t\tthis.currentAction = null;\r\n\t\t\t\t\t\tthis.runUpdate();\r\n\t\t\t\t\t},\r\n\t\t\t\t\t[COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_OPEN]: (event) => {\r\n\t\t\t\t\t\tconst contextMenuOptionsEvent = get(this.contextMenuOptions, `events['${COMMON_CONTEXT_MENU_EVENT_NAME.AFTER_OPEN}']`);\r\n\t\t\t\t\t\tif (contextMenuOptionsEvent) contextMenuOptionsEvent(event);\r\n\r\n\t\t\t\t\t\tif (parentRowToHighlight) {\r\n\t\t\t\t\t\t\tparentRowToHighlight.classList.add(this.parentRowClass + '--menu-opened');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\tinjectedTokens: [{\r\n\t\t\t\t\ttoken: COMMON_DIALOG_CONTEXT_MENU_SCREEN_INTERNAL_INTERFACE,\r\n\t\t\t\t\tvalue: {\r\n\t\t\t\t\t\tentity: this.entity,\r\n\t\t\t\t\t\tgetDialogOptions: () => this.getCurrentActionData(),\r\n\t\t\t\t\t\tbackToDefault: () => this.backToDefault(),\r\n\t\t\t\t\t\tclose: () => this.closeContextMenu(),\r\n\t\t\t\t\t} as ICommonDialogContextMenuScreenInternalInterface,\r\n\t\t\t\t}],\r\n\t\t\t},\r\n\t\t\t...(this.contextMenuOptions || {}),\r\n\t\t});\r\n\r\n\t\tif (this.openPerformanceMeasure) {\r\n\t\t\tthis.openPerformanceMeasure.stop();\r\n\t\t\tthis.openPerformanceMeasure = null;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic getCurrentActionData(): ICommonActionsDropdownComponentActionData {\r\n\t\treturn cloneDeep(this.currentAction && this.currentAction.data || null);\r\n\t}\r\n\r\n\tpublic onActionClickHandler(action: ICommonActionsDropdownComponentAction, isKeyboardEvent = false): void {\r\n\t\tif (action.action) {\r\n\t\t\taction.action(this.entity);\r\n\t\t\tthis.contextMenu.close();\r\n\t\t} else if (action.labelType === COMMON_ACTIONS_DROPDOWN_LABEL_TYPE.LINK || action.labelType === COMMON_ACTIONS_DROPDOWN_LABEL_TYPE.LABEL) {\r\n\t\t\tif (isKeyboardEvent) {\r\n\t\t\t\tthis.contextMenu.emitCustomEvent({\r\n\t\t\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.CUSTOM,\r\n\t\t\t\t\tpayload: {\r\n\t\t\t\t\t\ttype: COMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE.CURRENT_ACTION_SELECTED_BY_KEYBOARD,\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tthis.contextMenu.close();\r\n\t\t} else if (action.screen) {\r\n\t\t\tthis.contextMenu\r\n\t\t\t\t.changeScreenTo(action.screen.name, COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS.RIGHT_TO_LEFT)\r\n\t\t\t\t.catch(console.error);\r\n\t\t} else {\r\n\t\t\tconsole.warn('No action or screen in action\\'s options');\r\n\t\t\tthis.contextMenu.close();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic onActionMouseEnterHandler(action: ICommonActionsDropdownComponentAction): void {\r\n\t\tthis.hoveredAction = action;\r\n\t\tthis.setCurrentAction(action);\r\n\t}\r\n\r\n\tpublic onActionMouseLeaveHandler(action: ICommonActionsDropdownComponentAction): void {\r\n\t\tif (action === this.hoveredAction) {\r\n\t\t\tthis.hoveredAction = null;\r\n\t\t\tthis.currentAction = null;\r\n\t\t}\r\n\t}\r\n\r\n\t// Closes the context menu, will be used through Ref\r\n\tpublic closeContextMenu() {\r\n\t\tif (this.contextMenu) {\r\n\t\t\tthis.contextMenu.close();\r\n\t\t}\r\n\t}\r\n\r\n\t// Return to the default state\r\n\tpublic backToDefault() {\r\n\t\tthis.contextMenu.changeScreenToDefault(COMMON_CONTEXT_MENU_ANIMATION_DIRECTIONS.LEFT_TO_RIGHT);\r\n\t}\r\n\r\n\tprivate changeCurrentActionByDirection(direction: DIRECTION): void {\r\n\t\tconst actions = this.getPreparedActions();\r\n\r\n\t\tif (!actions.length || (this.currentAction && actions.length === 1)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.hoveredAction = null;\r\n\r\n\t\tif (this.currentAction) {\r\n\t\t\tif (direction === DIRECTION.DOWN) {\r\n\t\t\t\tthis.setCurrentAction(actions[actions.indexOf(this.currentAction) + 1] || actions[0]);\r\n\t\t\t} else {\r\n\t\t\t\tthis.setCurrentAction(actions[actions.indexOf(this.currentAction) - 1] || actions[actions.length - 1]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst actionIndex = direction === DIRECTION.DOWN ? 0 : actions.length - 1;\r\n\t\t\tthis.setCurrentAction(actions[actionIndex]);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate setCurrentAction(action: ICommonActionsDropdownComponentAction): void {\r\n\t\tthis.currentAction = action;\r\n\r\n\t\tthis.contextMenu.emitCustomEvent({\r\n\t\t\ttype: COMMON_CONTEXT_MENU_EVENT_NAME.CUSTOM,\r\n\t\t\tpayload: {\r\n\t\t\t\ttype: COMMON_ACTIONS_DROPDOWN_CUSTOM_EVENT_TYPE.CURRENT_ACTION_CHANGED,\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate getEnabledActions(): ICommonActionsDropdownComponentActions {\r\n\t\treturn this.actions.filter(this.isActionEnabled);\r\n\t}\r\n\r\n\tprivate getPreparedActions(): ICommonActionsDropdownComponentActions {\r\n\t\treturn this.getEnabledActions()\r\n\t\t\t.map((action) => {\r\n\t\t\t\tconst isDialog = action.contentType === COMMON_ACTIONS_DROPDOWN_CONTENT_TYPE.DIALOG;\r\n\t\t\t\tconst isDeleteDialog = action.contentType === COMMON_ACTIONS_DROPDOWN_CONTENT_TYPE.DIALOG_DELETE;\r\n\r\n\t\t\t\tif ((isDialog || isDeleteDialog) && !action.screen) {\r\n\t\t\t\t\tif (isDeleteDialog) {\r\n\t\t\t\t\t\textend(action.data, { cssClasses: COMMON_DIALOG_DELETING_CLASS_MOD });\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\taction.screen = {\r\n\t\t\t\t\t\tname: 'commonActionsDropdownDialogComponent',\r\n\t\t\t\t\t\tcomponent: CommonDialogContextMenuScreenComponent,\r\n\t\t\t\t\t\tdata: action.data,\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn action;\r\n\t\t\t});\r\n\t}\r\n\r\n\tprivate isActionEnabled = (action: ICommonActionsDropdownComponentAction) => {\r\n\t\treturn typeof action.isEnabled === 'undefined' || action.isEnabled(this.entity);\r\n\t}\r\n\r\n\tprivate stopEvent(event: Event): void {\r\n\t\tevent.preventDefault();\r\n\t}\r\n\r\n\tprivate checkIsActionsValid(): void {\r\n\t\tif (this.actions.some((action) => !!action.action && !!action.screen)) {\r\n\t\t\tthrow new Error('Action cannot to contain .action and .screen properties together');\r\n\t\t}\r\n\t}\r\n}\r\n","
{{'common.close' | translate}}
{{ options.data?.title }}
{{ options.data.additionalTitle }}
","import {\r\n\tAfterViewInit,\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tComponentRef,\r\n\tElementRef,\r\n\tEmbeddedViewRef,\r\n\tHostBinding,\r\n\tNgZone,\r\n\tViewChild,\r\n\tViewEncapsulation,\r\n} from '@angular/core';\r\nimport {\r\n\tBasePortalOutlet,\r\n\tCdkPortalOutlet,\r\n\tComponentPortal,\r\n\tTemplatePortal,\r\n} from '@angular/cdk/portal';\r\nimport {\r\n\tBehaviorSubject,\r\n\tObservable,\r\n\ttimer,\r\n} from 'rxjs';\r\n\r\nimport { commonConstants } from '../../../constants/common.constants';\r\nimport { CommonPopupOptions } from '../../popup-options';\r\nimport { COMMON_POPUP_CLASS_NAMES } from '../../constants/popup-class-names.constant';\r\nimport { CommonPopupHeaderWrapperComponent } from '../popup-header-wrapper/popup-header-wrapper.component';\r\nimport { CommonPopup } from '../../popup';\r\nimport { OverlayContainer } from '@angular/cdk/overlay';\r\nimport { ICommonActionsDropdownComponentActions } from '../../../context-menu/actions-dropdown.component/common-actions-dropdown.interfaces';\r\nimport {\r\n\tICommonContextMenuOptions\r\n} from '@CaseOne/Common/context-menu/context-menu.service/common-context-menu.interfaces';\r\n\r\n@Component({\r\n selector: 'common-popup-container',\r\n templateUrl: './popup-container.component.pug',\r\n\tchangeDetection: ChangeDetectionStrategy.Default,\r\n\tencapsulation: ViewEncapsulation.None,\r\n})\r\nexport class CommonPopupContainerComponent extends BasePortalOutlet implements AfterViewInit {\r\n\t@HostBinding('class') hostClassName = COMMON_POPUP_CLASS_NAMES.POPUP_HOST;\r\n\r\n\t@ViewChild(CdkPortalOutlet, { static: true }) contentPortalOutlet: CdkPortalOutlet;\r\n\t@ViewChild(CommonPopupHeaderWrapperComponent, { static: true }) headerWrapper: CommonPopupHeaderWrapperComponent;\r\n\t@ViewChild('popupBackground', { static: false }) popupBackground: ElementRef;\r\n\r\n\tpublic id: string;\r\n\tpublic popupRef: CommonPopup;\r\n\tpublic contextMenuItems: ICommonActionsDropdownComponentActions;\r\n\tpublic popupHeaderStyle$ = new BehaviorSubject<{ [klass: string]: any; }>(null);\r\n\tpublic contextMenuEntity: any;\r\n\tpublic contextMenuOptions: Partial;\r\n\r\n\tisOverlapped: boolean = false;\r\n\r\n\tprivate containerEl: HTMLElement;\r\n\tprivate isVisible: boolean = false;\r\n\tprivate destroy: () => void;\r\n\tprivate classNames = new Set()\r\n\t\t.add(COMMON_POPUP_CLASS_NAMES.POPUP_WITH_ANIMATION)\r\n\t\t.add(COMMON_POPUP_CLASS_NAMES.POPUP_SHOW)\r\n\t\t.add(COMMON_POPUP_CLASS_NAMES.POPUP_FADE_OUT);\r\n\r\n\tconstructor(\r\n\t\tpublic options: CommonPopupOptions,\r\n\t\tpublic elementRef: ElementRef,\r\n\t\tprivate container: OverlayContainer,\r\n\t\tprivate zone: NgZone,\r\n\t) {\r\n\t\tsuper();\r\n\r\n\t\tthis.elementRef.nativeElement.style.display = 'none';\r\n\t\tthis.containerEl = this.container.getContainerElement();\r\n\t\tthis.contextMenuItems = this.options.contextMenuItems;\r\n\t\tthis.addOverlayClassName();\r\n\t}\r\n\r\n\tattachComponentPortal(portal: ComponentPortal): ComponentRef {\r\n\t\treturn this.contentPortalOutlet.attachComponentPortal(portal);\r\n\t}\r\n\r\n\tattachHeaderComponentPortal(portal: ComponentPortal): ComponentRef {\r\n \treturn this.headerWrapper.headerWrapperOutlet.attachComponentPortal(portal);\r\n\t}\r\n\r\n\t/**\r\n\t * We dont use templates as content for popup, but need to implement parent abstract method\r\n\t */\r\n\tattachTemplatePortal(portal: TemplatePortal): EmbeddedViewRef {\r\n\t\treturn;\r\n\t}\r\n\r\n\tsetDestroyFunc(\r\n\t\tdestroyFunc: () => void,\r\n\t) {\r\n \tthis.destroy = destroyFunc;\r\n\t}\r\n\r\n\tgetPopupClasses(): string {\r\n\t\tconst optionsClasses = this.options.popupClasses.split(' ');\r\n\t\tconst animationClasses = Array.from(this.classNames);\r\n\r\n\t\treturn [...optionsClasses, ...animationClasses].join(' ');\r\n\t}\r\n\r\n\thide(): Observable {\r\n\t\tif (!this.isVisible) {\r\n\t\t\treturn timer();\r\n\t\t} else {\r\n\t\t\tthis.toggleAnimationForOverlappedPopup(false);\r\n\t\t\tconst animationDelay$ = timer(commonConstants.animationDuration);\r\n\t\t\tthis.classNames.add(COMMON_POPUP_CLASS_NAMES.POPUP_FADE_OUT);\r\n\t\t\tthis.isVisible = false;\r\n\r\n\t\t\tanimationDelay$\r\n\t\t\t\t.subscribe(() => {\r\n\t\t\t\t\tthis.elementRef.nativeElement.style.display = 'none';\r\n\t\t\t\t\tthis.removeOverlayClassName();\r\n\t\t\t\t});\r\n\r\n\t\t\treturn animationDelay$;\r\n\t\t}\r\n\t}\r\n\r\n\tshow(): Observable {\r\n\t\t\t/*\r\n\t\t\t\thttps://jira.parcsis.org/browse/CASEM-60523\r\n\t\t\t\tthis code should be changed after the integration with the old service\r\n\t\t\t\tsrc\\CaseDotStar.ServicePackages.Frontend.Common\\scripts\\common\\services\\popup_queue_service_factory.js\r\n\t\t\t\tis removed\r\n\t\t\t*/\r\n\t\tif (this.isVisible) {\r\n\t\t\treturn timer();\r\n\t\t} else {\r\n\t\t\tconst animationDelay$ = timer(commonConstants.animationDuration);\r\n\t\t\tthis.classNames.delete(COMMON_POPUP_CLASS_NAMES.POPUP_WITH_ANIMATION);\r\n\t\t\tthis.elementRef.nativeElement.style.display = 'block';\r\n\t\t\tthis.classNames.delete(COMMON_POPUP_CLASS_NAMES.POPUP_SLIDE_IN);\r\n\t\t\tthis.addOverlayClassName();\r\n\t\t\tthis.isVisible = true;\r\n\t\t\t/**\r\n\t\t\t * 100ms timeout fix for animation bug: no animation on initial display.\r\n\t\t\t */\r\n\t\t\t// Now with zonejs\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.zone.run(() => {\r\n\t\t\t\t\tthis.classNames.add(COMMON_POPUP_CLASS_NAMES.POPUP_WITH_ANIMATION);\r\n\t\t\t\t\tthis.classNames.add(COMMON_POPUP_CLASS_NAMES.POPUP_SLIDE_IN);\r\n\t\t\t\t\tthis.classNames.delete(COMMON_POPUP_CLASS_NAMES.POPUP_FADE_OUT);\r\n\t\t\t\t});\r\n\t\t\t}, 100);\r\n\r\n\r\n\t\t\treturn animationDelay$;\r\n\t\t}\r\n\t}\r\n\r\n\tclickOnAdditionTitle () {\r\n\t\tthis.popupRef.emitClickAdditionTitle({});\r\n\t}\r\n\r\n\t// Click with zonejs\r\n\texternalIconClose(): void {\r\n\t\tthis.popupRef.close();\r\n\t}\r\n\r\n\tclose(): Promise {\r\n\t\tthis.destroy();\r\n\r\n\t\treturn timer().toPromise();\r\n\t}\r\n\r\n\tsetContextMenuItems(contextMenuItems: ICommonActionsDropdownComponentActions) {\r\n\t\tthis.contextMenuItems = contextMenuItems || [];\r\n\t}\r\n\tsetContextMenuEntity(entity: any) {\r\n\t\tthis.contextMenuEntity = entity;\r\n\t}\r\n\tsetContextMenuOptions(options: Partial) {\r\n\t\tthis.contextMenuOptions = options;\r\n\t}\r\n\r\n\tsetPopupHeaderStyle(style: { [klass: string]: any; }) {\r\n\t\tthis.popupHeaderStyle$.next(style);\r\n\t}\r\n\r\n\ttoggleAnimationForOverlappedPopup (isStartUp: boolean) {\r\n\t\tif (!this.containerEl || !this.isOverlapped) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (isStartUp) {\r\n\t\t\tthis.popupBackground.nativeElement.classList.add('b-popup-overlap-background--show');\r\n\t\t} else {\r\n\t\t\tthis.popupBackground.nativeElement.classList.add('b-popup-overlap-background--hide');\r\n\t\t}\r\n\t}\r\n\r\n\tngAfterViewInit () {\r\n\t\tthis.toggleAnimationForOverlappedPopup(true);\r\n\t}\r\n\r\n\tprivate addOverlayClassName() {\r\n\t\tif (this.options.popupOverlayClasses && !this.containerEl.classList.contains(this.options.popupOverlayClasses)) {\r\n\t\t\tthis.containerEl.classList.add(this.options.popupOverlayClasses);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate removeOverlayClassName() {\r\n\t\tif (this.options.popupOverlayClasses && this.containerEl.classList.contains(this.options.popupOverlayClasses)) {\r\n\t\t\tthis.containerEl.classList.remove(this.options.popupOverlayClasses);\r\n\t\t}\r\n\t}\r\n}\r\n","import { InjectionToken } from '@angular/core';\r\n\r\nexport const COMMON_POPUP_DATA = new InjectionToken('CommonPopupData');\r\n","import {\r\n\tAfterViewInit,\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tHostBinding,\r\n\tInject,\r\n\tOnDestroy,\r\n\tViewEncapsulation,\r\n} from '@angular/core';\r\nimport {OverlayContainer } from '@angular/cdk/overlay';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport {\r\n\tObservable,\r\n\ttimer,\r\n} from 'rxjs';\r\n\r\nimport { COMMON_POPUP_CLASS_NAMES } from '../../constants/popup-class-names.constant';\r\nimport { commonConstants } from '../../../constants/common.constants';\r\n\r\n@Component({\r\n\tselector: 'common-popup-overlay-background',\r\n\ttemplateUrl: './popup-overlay-background.component.pug',\r\n\tencapsulation: ViewEncapsulation.None,\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CommonPopupOverlayBackgroundComponent implements OnDestroy, AfterViewInit {\r\n\t@HostBinding('class') hostClassName = COMMON_POPUP_CLASS_NAMES.OVERLAY_BACKGROUND_HOST;\r\n\r\n\tprivate containerEl: HTMLElement;\r\n\r\n\tconstructor(\r\n\t\tprivate container: OverlayContainer,\r\n\t\t@Inject(DOCUMENT) private document: Document,\r\n\t) {\r\n\t\tthis.containerEl = this.container.getContainerElement();\r\n\t\tthis.document.body.classList.add(COMMON_POPUP_CLASS_NAMES.BODY_HOST);\r\n\t\tthis.containerEl.classList.add(COMMON_POPUP_CLASS_NAMES.OVERLAY_HOST);\r\n\t}\r\n\r\n\tngOnDestroy(): void {\r\n\t\tthis.document.body.classList.remove(COMMON_POPUP_CLASS_NAMES.BODY_HOST);\r\n\t\tthis.containerEl.classList.remove(COMMON_POPUP_CLASS_NAMES.OVERLAY_HOST);\r\n\t\t/**\r\n\t\t * Display block change need to reset CSS animation.\r\n\t\t * Fixes: second time open modal background blink bug. Also in ngAfterViewInit.\r\n\t\t */\r\n\t\tthis.containerEl.style.display = 'none';\r\n\t}\r\n\r\n\tngAfterViewInit(): void {\r\n\t\tthis.containerEl.style.display = 'block';\r\n\r\n\t\t// Without zonejs\r\n\t\tsetTimeout(() => {\r\n\t\t\tthis.containerEl.classList.add(COMMON_POPUP_CLASS_NAMES.OVERLAY_HOST_SHOW);\r\n\t\t});\r\n\t}\r\n\r\n\tclose(): Observable {\r\n\t\tthis.containerEl.classList.remove(COMMON_POPUP_CLASS_NAMES.OVERLAY_HOST_SHOW);\r\n\r\n\t\treturn timer(commonConstants.animationDuration);\r\n\t}\r\n}\r\n","import {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tViewEncapsulation,\r\n} from '@angular/core';\r\nimport { COMMON_POPUP_CLASS_NAMES } from '../../constants/popup-class-names.constant';\r\nimport { CommonBaseComponent } from '@CaseOne/Common/base_component/base.component';\r\n\r\n@Component({\r\n\tselector: 'common-popup-loader',\r\n\ttemplateUrl: './popup-loader.component.pug',\r\n\tencapsulation: ViewEncapsulation.None,\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CommonPopupLoaderComponent extends CommonBaseComponent {\r\n\tpublic loaderClassName = COMMON_POPUP_CLASS_NAMES.OVERLAY_LOADER;\r\n}\r\n","","import { InjectionToken } from '@angular/core';\r\n\r\nexport const COMMON_POPUP_ON_LOAD_DATA = new InjectionToken>('CommonPopupOnLoadData');\r\n","import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\r\nimport {\r\n\tComponentRef,\r\n\tInjectable,\r\n\tInjector,\r\n} from '@angular/core';\r\nimport {\r\n\tComponentPortal,\r\n\tPortalInjector,\r\n} from '@angular/cdk/portal';\r\nimport {\r\n\tdefer,\r\n\tforkJoin,\r\n\tObservable,\r\n\tSubject,\r\n\tBehaviorSubject,\r\n} from 'rxjs';\r\nimport { TransitionService } from '@uirouter/core';\r\n\r\nimport { CommonPopupOptions } from '../popup-options';\r\nimport { CommonPopup } from '../popup';\r\nimport { CommonPopupContainerComponent } from '../components/popup-container/popup-container.component';\r\nimport { COMMON_POPUP_DATA } from '../constants/popup-data.constant';\r\nimport { CommonPopupOverlayBackgroundComponent } from '../components/popup-overlay-background/popup-overlay-background.component';\r\nimport { CommonPopupLoaderComponent } from '../components/popup-loader/popup-loader.component';\r\nimport { COMMON_POPUP_ON_LOAD_DATA } from '../constants/popup-on-load-data.constant';\r\nimport { CommonNotificationService } from '../../notification/notification.service';\r\nimport { CommonLocaleService } from '../../locale/locale.service';\r\nimport { COMMON_POPUP_ACTION_TYPE } from '../constants/popup-action-type.constant';\r\n\r\n\r\ndeclare const COMPONENT_SPECS_MODE: boolean;\r\n\r\n@Injectable()\r\nexport class CommonPopupService {\r\n\t// TODO: [PopupFactory] Remove after replace of old PopupFactory usage\r\n\tpublic oldPopupsIntegrationMode = false;\r\n\tpublic popups$ = new BehaviorSubject([]);\r\n\tpublic openPopup$ = new Subject();\r\n\tpublic closePopup$ = new Subject();\r\n\tpublic openFirstPopup$ = new Subject();\r\n\tpublic closeLastPopup$ = new Subject();\r\n\t// TODO END\r\n\r\n\tprivate popups: CommonPopup[] = [];\r\n\tprivate backgroundOverlayRef: OverlayRef;\r\n\tprivate backgroundComponentRef: ComponentRef;\r\n\tprivate loaderOverlayRef: OverlayRef;\r\n\tprivate loaderComponentRef: ComponentRef | undefined;\r\n\tprivate isLoading: boolean = false;\r\n\tprivate commonNotificationService = this.injector.get(CommonNotificationService);\r\n\tprivate commonLocaleService = this.injector.get(CommonLocaleService);\r\n\r\n\tconstructor(\r\n\t\tprivate overlay: Overlay,\r\n\t\tprivate injector: Injector,\r\n\t\tprivate transitionService: TransitionService,\r\n\t) {\r\n\t\tthis.transitionService.onBefore({}, (transition) => {\r\n\t\t\tif (transition.from().name !== transition.to().name) {\r\n\t\t\t\tthis.closeAll();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// TODO: [PopupFactory] Remove after replace of old PopupFactory usage\r\n\t\t// Circular dependency\r\n\t\tsetTimeout(() => {\r\n\t\t\t// Force init old service\r\n\t\t\ttry {\r\n\t\t\t\tthis.injector.get('$injector').get('PopupQueueService');\r\n\t\t\t} catch (error) {\r\n\t\t\t\tif (!COMPONENT_SPECS_MODE) {\r\n\t\t\t\t\tconsole.warn(error);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t// TODO END\r\n\t}\r\n\r\n\topen(\r\n\t\toptions: CommonPopupOptions,\r\n\t): CommonPopup {\r\n\t\tif (options.contextMenuItems) {\r\n\t\t\tconsole.warn('CommonPopupOptions#contextMenuItems is deprecated, use `this.popup.containerInstance.setContextMenuItems` function in popup component');\r\n\t\t}\r\n\r\n\t\tthis.createBackgroundOverlay();\r\n\r\n\t\tconst previousPopup = this.popups[this.popups.length - 1];\r\n\t\tconst popupRef = this.createPopup(options);\r\n\r\n\t\t/**\r\n\t\t * If new popup have onLoadData, then first of all we need to close or hide previous open popup if it exists.\r\n\t\t * Then need to show loader, and after load of data - hide loader and show new popup.\r\n\t\t *\r\n\t\t * If there is no onLoadData - simply hide or close previous popup ( also with check ) and show new.\r\n\t\t */\r\n\t\tthis.previousPopupClosePromise(previousPopup, options)\r\n\t\t\t.then(() => {\r\n\t\t\t\tif (options.onLoadData) {\r\n\t\t\t\t\tthis.showLoader();\r\n\t\t\t\t\treturn options.onLoadData;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.finally(() => this.hideLoader())\r\n\t\t\t.then(() => {\r\n\t\t\t\tpopupRef.render();\r\n\r\n\t\t\t\tif (popupRef.withControlOpenState) {\r\n\t\t\t\t\tpopupRef.show();\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error) => {\r\n\t\t\t\tif (error && error.status === 404 && error.error.Error) {\r\n\t\t\t\t\tthis.commonNotificationService.show(this.commonLocaleService.instant('common.noty.error.title'), error.error.Error, 'error');\r\n\t\t\t\t}\r\n\t\t\t\tconsole.error(error);\r\n\r\n\t\t\t\tif (popupRef.withControlOpenState) {\r\n\t\t\t\t\treturn popupRef.close();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\treturn popupRef;\r\n\t}\r\n\r\n\topenOverlap (options: CommonPopupOptions): CommonPopup {\r\n\t\tif (options.contextMenuItems) {\r\n\t\t\tconsole.warn('CommonPopupOptions#contextMenuItems is deprecated, use `this.popup.containerInstance.setContextMenuItems` function in popup component');\r\n\t\t}\r\n\t\tthis.createBackgroundOverlay();\r\n\t\tconst popupRef = this.createPopup(options);\r\n\t\tpopupRef.render();\r\n\t\tpopupRef.show();\r\n\t\treturn popupRef;\r\n\t}\r\n\r\n\tcloseAll(): Promise {\r\n\t\treturn this.closePopups(this.popups);\r\n\t}\r\n\r\n\tisOpen(): boolean {\r\n\t\treturn !!this.popups.length;\r\n\t}\r\n\r\n\tprivate createPopup(\r\n\t\toptions: CommonPopupOptions,\r\n\t): CommonPopup {\r\n\t\toptions = this.applyConfigDefaults(options);\r\n\r\n\t\tconst overlayRef: OverlayRef = this.createOverlay();\r\n\t\tconst popupContainer = this.attachPopupContainer(overlayRef, options);\r\n\t\tconst popupRef = this.attachPopupContent(\r\n\t\t\tpopupContainer,\r\n\t\t\toverlayRef,\r\n\t\t\toptions,\r\n\t\t);\r\n\r\n\t\tthis.popups.push(popupRef);\r\n\r\n\t\t// TODO: [PopupFactory] Remove after replace of old PopupFactory usage\r\n\t\tif (this.oldPopupsIntegrationMode) {\r\n\t\t\tthis.popups$.next(this.popups);\r\n\r\n\t\t\tif (this.popups.length === 1) {\r\n\t\t\t\tthis.openFirstPopup$.next(options);\r\n\t\t\t}\r\n\r\n\t\t\tthis.openPopup$.next(popupRef);\r\n\t\t}\r\n\t\t// TODO END\r\n\r\n\t\tconst popupRefBeforeClose$ = popupRef\r\n\t\t\t.onEvent(COMMON_POPUP_ACTION_TYPE.BEFORE_CLOSE)\r\n\t\t\t.subscribe(() => {\r\n\t\t\t\tthis.beforeClosePopup(popupRef);\r\n\t\t\t\tpopupRefBeforeClose$.unsubscribe();\r\n\t\t\t});\r\n\r\n\t\tconst popupRefAfterClose$ = popupRef\r\n\t\t\t.onEvent(COMMON_POPUP_ACTION_TYPE.AFTER_CLOSE)\r\n\t\t\t.subscribe(() => {\r\n\t\t\t\tthis.afterClosePopup(popupRef);\r\n\t\t\t\tpopupRefAfterClose$.unsubscribe();\r\n\t\t\t});\r\n\r\n\t\treturn popupRef;\r\n\t}\r\n\r\n\tprivate createOverlay(): OverlayRef {\r\n\t\tconst overlayConfig: OverlayConfig = this.getOverlayConfig();\r\n\r\n\t\treturn this.overlay.create(overlayConfig);\r\n\t}\r\n\r\n\tprivate getOverlayConfig(): OverlayConfig {\r\n\t\treturn new OverlayConfig({\r\n\t\t\thasBackdrop: false,\r\n\t\t});\r\n\t}\r\n\r\n\tprivate attachPopupContainer(\r\n\t\toverlay: OverlayRef,\r\n\t\toptions: CommonPopupOptions,\r\n\t): CommonPopupContainerComponent {\r\n\t\tconst injector = new PortalInjector(this.injector, new WeakMap([\r\n\t\t\t[CommonPopupOptions, options],\r\n\t\t]));\r\n\t\tconst containerPortal = new ComponentPortal(CommonPopupContainerComponent, null, injector);\r\n\t\tconst containerRef = overlay.attach(containerPortal);\r\n\t\tcontainerRef.instance.isOverlapped = options.isOverlapped;\r\n\t\tcontainerRef.instance.setDestroyFunc(() => { containerRef.destroy(); });\r\n\r\n\t\treturn containerRef.instance;\r\n\t}\r\n\r\n\tprivate attachPopupContent(\r\n\t\tpopupContainer: CommonPopupContainerComponent,\r\n\t\toverlayRef: OverlayRef,\r\n\t\tconfig: CommonPopupOptions,\r\n\t): CommonPopup {\r\n\t\tconst popupRef = new CommonPopup(overlayRef, popupContainer);\r\n\t\tpopupRef.withControlOpenState = config.withControlOpenState;\r\n\t\tpopupRef.injector = this.createInjector(config, popupRef, popupContainer);\r\n\r\n\t\tpopupContainer.popupRef = popupRef;\r\n\r\n\t\treturn popupRef;\r\n\t}\r\n\r\n\tprivate createInjector(\r\n\t\toptions: CommonPopupOptions,\r\n\t\tpopupRef: CommonPopup,\r\n\t\tpopupContainer: CommonPopupContainerComponent,\r\n\t): PortalInjector {\r\n\t\tconst injectionTokens = new WeakMap([\r\n\t\t\t[CommonPopupContainerComponent, popupContainer],\r\n\t\t\t[COMMON_POPUP_DATA, options.data],\r\n\t\t\t[COMMON_POPUP_ON_LOAD_DATA, options.onLoadData],\r\n\t\t\t[CommonPopup, popupRef],\r\n\t\t]);\r\n\r\n\t\treturn new PortalInjector(this.injector, injectionTokens);\r\n\t}\r\n\r\n\tprivate beforeClosePopup(\r\n\t\tpopupRef: CommonPopup,\r\n\t) {\r\n\t\tconst index = this.popups.indexOf(popupRef);\r\n\t\tconst originalPopups = [...this.popups];\r\n\t\tconst deletedPopup = originalPopups[index];\r\n\r\n\t\toriginalPopups.splice(index, 1);\r\n\r\n\t\t// TODO: [PopupFactory] Remove after replace of old PopupFactory usage\r\n\t\tif (this.oldPopupsIntegrationMode) {\r\n\t\t\tif (originalPopups.length === 0) {\r\n\t\t\t\tthis.closeLastPopup$.next(deletedPopup);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// TODO END\r\n\t}\r\n\r\n\tprivate afterClosePopup(\r\n\t\tpopupRef: CommonPopup,\r\n\t) {\r\n\t\tconst index = this.popups.indexOf(popupRef);\r\n\t\tconst originalPopups = [...this.popups];\r\n\r\n\t\tif (index > -1) {\r\n\t\t\tconst deletedPopup = this.popups[index];\r\n\r\n\t\t\tthis.popups.splice(index, 1);\r\n\r\n\t\t\t// TODO: [PopupFactory] Remove after replace of old PopupFactory usage\r\n\t\t\tif (this.oldPopupsIntegrationMode) {\r\n\t\t\t\tthis.popups$.next(this.popups);\r\n\t\t\t\tthis.closePopup$.next(popupRef);\r\n\t\t\t}\r\n\t\t\t// TODO END\r\n\r\n\t\t\tdeletedPopup.overlayRef.dispose();\r\n\r\n\t\t\t/**\r\n\t\t\t * Check if closed popup last and there is some popups behind it. If so - show previous popup.\r\n\t\t\t */\r\n\t\t\tif (\r\n\t\t\t\tthis.popups.length &&\r\n\t\t\t\tindex + 1 === originalPopups.length\r\n\t\t\t) {\r\n\t\t\t\tconst nextPopup = this.popups[this.popups.length - 1];\r\n\r\n\t\t\t\tif (nextPopup.withControlOpenState) {\r\n\t\t\t\t\tnextPopup.show();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// TODO: [PopupFactory] Remove after replace of old PopupFactory usage\r\n\t\t\tif (!this.oldPopupsIntegrationMode) {\r\n\t\t\t// TODO END\r\n\r\n\t\t\t\tthis.removeBackground();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected removeBackground () {\r\n\t\t/**\r\n\t\t * If closed popup is last - destroy background overlay\r\n\t\t */\r\n\t\tif (!this.popups.length) {\r\n\t\t\tconst backgroundClose$ = this.backgroundComponentRef.instance.close()\r\n\t\t\t\t.subscribe(() => {\r\n\t\t\t\t\tthis.backgroundOverlayRef.dispose();\r\n\t\t\t\t\tbackgroundClose$.unsubscribe();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprivate closePopups(\r\n\t\tpopups: CommonPopup[],\r\n\t): Promise {\r\n\t\treturn forkJoin(\r\n\t\t\tpopups\r\n\t\t\t\t.slice(0)\r\n\t\t\t\t.reverse()\r\n\t\t\t\t.map(\r\n\t\t\t\t\t(popup) => popup.close(),\r\n\t\t\t\t),\r\n\t\t)\r\n\t\t\t.toPromise();\r\n\t}\r\n\r\n\tprivate applyConfigDefaults(\r\n\t\tconfig: CommonPopupOptions,\r\n\t): CommonPopupOptions {\r\n\t\tconst defaultOptions = new CommonPopupOptions();\r\n\r\n\t\treturn { ...defaultOptions, ...config };\r\n\t}\r\n\r\n\tprotected createBackgroundOverlay() {\r\n\t\tif (this.popups.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// TODO: [PopupFactory] Remove after replace of old PopupFactory usage\r\n\t\tif (!this.oldPopupsIntegrationMode) {\r\n\t\t// TODO END\r\n\r\n\t\t\tconst backgroundComponentPortal = new ComponentPortal(CommonPopupOverlayBackgroundComponent);\r\n\t\t\tthis.backgroundOverlayRef = this.overlay.create(new OverlayConfig({ hasBackdrop: false }));\r\n\t\t\tthis.backgroundComponentRef = this.backgroundOverlayRef.attach(backgroundComponentPortal);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate showLoader(): void {\r\n\t\tif (this.isLoading) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst loaderComponentPortal = new ComponentPortal(CommonPopupLoaderComponent);\r\n\r\n\t\tthis.isLoading = true;\r\n\t\tthis.loaderOverlayRef = this.overlay.create(new OverlayConfig({ hasBackdrop: false }));\r\n\t\tthis.loaderComponentRef = this.loaderOverlayRef.attach(loaderComponentPortal);\r\n\t\tthis.loaderComponentRef.instance.runUpdate();\r\n\t}\r\n\r\n\tprivate hideLoader(): void {\r\n\t\tif (!this.isLoading) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isLoading = false;\r\n\t\tthis.loaderComponentRef.destroy();\r\n\t\tthis.loaderOverlayRef.dispose();\r\n\t\tthis.loaderComponentRef = undefined;\r\n\t}\r\n\r\n\tprivate hideOrClosePopup(\r\n\t\tpopup: CommonPopup,\r\n\t\toptions: CommonPopupOptions,\r\n\t): Observable {\r\n\t\treturn defer(() => {\r\n\t\t\treturn options.closePrev || popup.isCloseOnNext() ? popup.close() : popup.hide();\r\n\t\t});\r\n\t}\r\n\r\n\tprivate previousPopupClosePromise(\r\n\t\tpopup: CommonPopup,\r\n\t\toptions: CommonPopupOptions,\r\n\t): Promise {\r\n\t\treturn popup ? this.hideOrClosePopup(popup, options).toPromise() : Promise.resolve();\r\n\t}\r\n}\r\n","export enum COMMON_PERMISSIONS_OPERATOR {\r\n\tAND = 'AND',\r\n\tOR = 'OR',\r\n}\r\n","import { Injectable, Injector } from '@angular/core';\r\nimport { CommonBaseService } from '@CaseOne/Common/common-base-service.class/common-base-service.class';\r\nimport { CommonBootstrapService } from '@CaseOne/Common/bootstrap/bootstrap.service';\r\nimport { cloneDeep, find, filter, forEach, indexOf, isArray, isEmpty, isFunction, isString, map } from 'lodash';\r\nimport { COMMON_PERMISSIONS_OPERATOR } from '@CaseOne/Common/permissions/constants/common-permissions-operator.enum';\r\nimport { getQueryStringKeyValue, fromJson } from '@CaseOne/Common/utilities/core.service';\r\nimport { COMMON_PERMISSIONS } from '@CaseOne/Common/permissions/constants/common-permissions.enum';\r\nimport {\r\n\tICommonPermissionsObject,\r\n\tICommonPermissionsBootstrapPermission,\r\n\tICommonPermissionsBootstrapSetPermission,\r\n\tICommonPermissionsModel,\r\n\tTCommonPermissionsHasPermissionsFnPermissions,\r\n\tTCommonPermissionsHasPermissionsFnPermissionsAsObject,\r\n\tICommonPermissionsBootstrapData\r\n} from '@CaseOne/Common/permissions/interfaces/permissions.interfaces';\r\n\r\n@Injectable()\r\nexport class CommonPermissionsService extends CommonBaseService {\r\n\tprivate commonBootstrapService = this.injector.get(CommonBootstrapService);\r\n\r\n\tprivate permissionsHashByNumber: Record = {};\r\n\tprivate permissionsHashBySection: Record = {};\r\n\tprivate permissionsObjHashByNumber: Record = {};\r\n\tprivate permissionsObjHashBySection: Record = {};\r\n\tprivate readonly setPermissionsBootstrap: ICommonPermissionsBootstrapSetPermission[];\r\n\r\n\tconstructor (\r\n\t\tinjector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\r\n\t\tconst bootstrap = this.commonBootstrapService.getBootstrap();\r\n\t\tif (bootstrap) {\r\n\t\t\tthis.setPermissionsBootstrap = cloneDeep(bootstrap.SetPermissions);\r\n\t\t}\r\n\t}\r\n\r\n\thasPermission (permission: COMMON_PERMISSIONS, target: number): boolean {\r\n\t\t// tslint:disable-next-line:no-bitwise\r\n\t\treturn !!(permission & target);\r\n\t}\r\n\r\n\tallHavePermission (items: ICommonPermissionsModel[], permission: string): boolean {\r\n\t\treturn items.every((item) => {\r\n\t\t\treturn item.entityPermissionsObj[permission];\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Check array or function permissions with operator (AND | OR)\r\n\t * Examples:\r\n\t * \thasPermissions(['TestSection:Read', 'TestSection2:Edit'])\r\n\t * \thasPermissions(['{Id}:Edit'], 'AND\", {Id: 1})\r\n\t * \thasPermissions([{ permissions: ['TestSection:Read', 'TestSection2:Edit'], operator: 'OR' }])\r\n\t * \thasPermissions(($injector) => {\r\n\t * \treturn $injector.get('UserDataProvider').$get().IsClient ? ['CaseBillingCodes:ReadAll'] : ['CaseBillingCodes:ReadOwn'];\r\n\t * \t}),\r\n\t */\r\n\thasPermissions (\r\n\t\tpermissions: TCommonPermissionsHasPermissionsFnPermissions,\r\n\t\toperator: COMMON_PERMISSIONS_OPERATOR = COMMON_PERMISSIONS_OPERATOR.AND,\r\n\t\tparams: { [key: string]: string } = {},\r\n\t): boolean {\r\n\t\tif (isEmpty(permissions) && !isFunction(permissions)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tlet result: boolean; // don't initialize\r\n\t\tconst permissionsValue = isFunction(permissions) ? permissions(this.injector) : permissions;\r\n\r\n\t\tforEach(permissionsValue, (p) => {\r\n\t\t\tif ((operator === COMMON_PERMISSIONS_OPERATOR.AND && result === false) || (operator === COMMON_PERMISSIONS_OPERATOR.OR && result === true)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (isString(p)) {\r\n\t\t\t\tconst pArr = p.split(':');\r\n\t\t\t\tconst permissionName = pArr[1];\r\n\r\n\t\t\t\tlet sectionSysName = pArr[0];\r\n\t\t\t\tlet sectionPermissionsArray;\r\n\r\n\t\t\t\t// get sectionSysName from url/state\r\n\t\t\t\tsectionSysName = sectionSysName.replace(/{(.+?)}/g, (m, param) => {\r\n\t\t\t\t\treturn params[param] || getQueryStringKeyValue(param) || '';\r\n\t\t\t\t});\r\n\t\t\t\tsectionPermissionsArray = this.getPermissionsSysNameArrayBySection(sectionSysName);\r\n\t\t\t\tresult = sectionPermissionsArray && indexOf(sectionPermissionsArray, permissionName) !== -1;\r\n\t\t\t} else {\r\n\t\t\t\tresult = this.hasPermissions(p.permissions, p.operator);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tgetCtrlPermissionsData(sectionName: string): ICommonPermissionsObject;\r\n\tgetCtrlPermissionsData(sectionName: string[]): Record;\r\n\tgetCtrlPermissionsData(sectionNames: string | string[]): ICommonPermissionsObject | Record {\r\n\t\tlet result = {};\r\n\r\n\t\tif (isArray(sectionNames)) {\r\n\t\t\tforEach(sectionNames, (sectionName) => {\r\n\t\t\t\tresult[sectionName] = this.getPermissionsSysNameObjBySection(sectionName);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tresult = this.getPermissionsSysNameObjBySection(sectionNames);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tgetPermissionsBySectionSysName (sectionSysName: string): number {\r\n\t\tconst item = find(this.setPermissionsBootstrap, (i) => {\r\n\t\t\treturn i.SectionSysName === sectionSysName;\r\n\t\t});\r\n\r\n\t\treturn item ? item.Permissions : null;\r\n\t}\r\n\r\n\tgetPermissionsSysNameArrayBySection = (sectionSysName: string): string[] => {\r\n\t\tif (!sectionSysName) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tif (!this.permissionsHashBySection[sectionSysName]) {\r\n\t\t\tthis.permissionsHashBySection[sectionSysName] = this._getPermissionsSysNameArrayBySection(sectionSysName) || [];\r\n\t\t}\r\n\r\n\t\treturn this.permissionsHashBySection[sectionSysName];\r\n\t}\r\n\r\n\tgetPermissionsSysNameObjBySection = (sectionSysName: string): ICommonPermissionsObject => {\r\n\t\tif (!sectionSysName) {\r\n\t\t\treturn {};\r\n\t\t}\r\n\r\n\t\tif (!this.permissionsObjHashBySection[sectionSysName]) {\r\n\t\t\tthis.permissionsObjHashBySection[sectionSysName] = {};\r\n\r\n\t\t\tforEach(this.getPermissionsSysNameArrayBySection(sectionSysName), (p) => {\r\n\t\t\t\tthis.permissionsObjHashBySection[sectionSysName]['is' + p] = true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn this.permissionsObjHashBySection[sectionSysName];\r\n\t}\r\n\r\n\tgetPermissionsSysNameArrayByNumber = (permissions: number): string[] => {\r\n\t\tif (!permissions) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tif (!this.permissionsHashByNumber[permissions]) {\r\n\t\t\tthis.permissionsHashByNumber[permissions] = this._getPermissionsSysNameArrayByNumber(permissions) || [];\r\n\t\t}\r\n\r\n\t\treturn this.permissionsHashByNumber[permissions];\r\n\t}\r\n\r\n\tgetPermissionsSysNameObjByNumber = (permissions: number): ICommonPermissionsObject => {\r\n\t\tif (!permissions) {\r\n\t\t\treturn {};\r\n\t\t}\r\n\r\n\t\tif (!this.permissionsObjHashByNumber[permissions]) {\r\n\t\t\tthis.permissionsObjHashByNumber[permissions] = {};\r\n\r\n\t\t\tforEach(this.getPermissionsSysNameArrayByNumber(permissions), (p) => {\r\n\t\t\t\tthis.permissionsObjHashByNumber[permissions]['is' + p] = true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn this.permissionsObjHashByNumber[permissions];\r\n\t}\r\n\r\n\tbinaryNumberToPermissionArray(num: number): ICommonPermissionsBootstrapPermission[] {\r\n\t\tconst permissions = this.commonBootstrapService.getBootstrap('Permissions');\r\n\r\n\t\treturn filter(cloneDeep(permissions), (p) => {\r\n\t\t\t// tslint:disable-next-line:no-bitwise\r\n\t\t\treturn (num & p.Id) !== 0;\r\n\t\t});\r\n\t}\r\n\r\n\tpermissionsTransformForItem(inputItem: T): T;\r\n\tpermissionsTransformForItem(inputItem: T[]): T[];\r\n\tpermissionsTransformForItem(inputItem: T | T[]): T | T[] {\r\n\t\tif (isArray(inputItem)) {\r\n\t\t\treturn map(inputItem, (item) => {\r\n\t\t\t\titem.entityPermissionsObj = this.getPermissionsSysNameObjByNumber(item.Permissions);\r\n\t\t\t\treturn item;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tinputItem.entityPermissionsObj = this.getPermissionsSysNameObjByNumber(inputItem.Permissions);\r\n\t\t\treturn inputItem;\r\n\t\t}\r\n\t}\r\n\r\n\tpermissionsTransformResponse = (response: T): T => {\r\n\t\tconst parsedResponse = fromJson(response);\r\n\r\n\t\tif (parsedResponse && parsedResponse.Result) {\r\n\t\t\tparsedResponse.Result = this.permissionsTransformForItem(parsedResponse.Result);\r\n\t\t}\r\n\r\n\t\treturn parsedResponse || [];\r\n\t}\r\n\r\n\tprivate _getPermissionsSysNameArrayBySection (sectionSysName): string[] {\r\n\t\treturn this._getPermissionsSysNameArrayByNumber(this.getPermissionsBySectionSysName(sectionSysName));\r\n\t}\r\n\r\n\tprivate _getPermissionsSysNameArrayByNumber (num: number): string[] {\r\n\t\treturn map(this.binaryNumberToPermissionArray(num), 'SysName');\r\n\t}\r\n\r\n}\r\n","import { CommonPopupService } from '@CaseOne/Common/popup/services/popup.service';\r\nimport { Injectable, Injector } from '@angular/core';\r\nimport { Overlay } from '@angular/cdk/overlay';\r\nimport { TransitionService } from '@uirouter/core';\r\nimport { CommonPopupOptions } from '@CaseOne/Common/popup/popup-options';\r\nimport { CommonPopup } from '@CaseOne/Common/popup/popup';\r\n\r\n\r\n// Only for CommonDialogFactoryService\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonDialogPopupService extends CommonPopupService {\r\n\tconstructor (\r\n\t\toverlay: Overlay,\r\n\t\tinjector: Injector,\r\n\t\ttransitionService: TransitionService,\r\n\t) {\r\n\t\tsuper(overlay, injector, transitionService);\r\n\r\n\t\tthis.oldPopupsIntegrationMode = false;\r\n\t}\r\n\r\n\topen (options: CommonPopupOptions): CommonPopup {\r\n\t\toptions.isOverlapped = true;\r\n\t\treturn super.open(options);\r\n\t}\r\n\r\n\tprotected createBackgroundOverlay() {\r\n\t\t// nothing\r\n\t}\r\n\r\n\tprotected removeBackground () {\r\n\t\t// nothing\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CommonBaseService } from '@CaseOne/Common/common-base-service.class/common-base-service.class';\r\nimport { Hotkey, HotkeysService } from '@ngneat/hotkeys';\r\n\r\nimport { Observable, of } from 'rxjs';\r\nimport { filter, tap } from 'rxjs/operators';\r\nimport { defaults, find, isEmpty, remove } from 'lodash';\r\n\r\nimport { CommonContextMenuFactory } from '@CaseOne/Common/context-menu/context-menu.service/common-context-menu.factory';\r\nimport { CommonPopupService } from '@CaseOne/Common/popup/services/popup.service';\r\nimport { CommonUserDataService } from '@CaseOne/Common/user/user_data.service';\r\nimport { TCommonPermissionsHasPermissionsFnPermissions } from '@CaseOne/Common/permissions/interfaces/permissions.interfaces';\r\nimport { CommonPermissionsService } from '@CaseOne/Common/permissions/services/permissions.service';\r\nimport { CommonNotificationService } from '@CaseOne/Common/notification/notification.service';\r\nimport { getClosest } from '@CaseOne/Common/utilities/html';\r\nimport { CommonDialogPopupService } from '@CaseOne/Common/dialog-factory/services/dialog-popup.service';\r\n\r\nexport interface ICommonHotkeyOptions extends Hotkey {\r\n\tcallback?: (event: KeyboardEvent | Hotkey) => any;\r\n}\r\n\r\nexport interface ICommonHotkeyByLocaleConfig {\r\n\tname: string;\r\n\tkeys: Record<'en' | 'fr' | 'pt' | 'ru', string>;\r\n\tpermissions?: TCommonPermissionsHasPermissionsFnPermissions;\r\n\tcallback: (event?: KeyboardEvent) => any;\r\n\tinCondition?: () => boolean;\r\n\tisEnabled?: () => boolean;\r\n}\r\n\r\n@Injectable()\r\nexport class CommonHotkeyService extends CommonBaseService {\r\n\tprivate hotkeysService = this.injector.get(HotkeysService);\r\n\tprivate commonContextMenuFactory = this.injector.get(CommonContextMenuFactory);\r\n\tprivate commonPopupService = this.injector.get(CommonPopupService);\r\n\tprivate commonDialogPopupService = this.injector.get(CommonDialogPopupService);\r\n\tprivate $injector = this.injector.get('$injector');\r\n\tprivate commonUserDataService = this.injector.get(CommonUserDataService);\r\n\tprivate commonPermissionsService = this.injector.get(CommonPermissionsService);\r\n\tprivate commonNotificationService = this.injector.get(CommonNotificationService);\r\n\r\n\tprivate readonly defaultHotkeyConfig: Partial = {\r\n\t\tinCondition: () => {\r\n\t\t\tconst popupQueueService = this.$injector.get('PopupQueueService');\r\n\r\n\t\t\treturn !popupQueueService.isOpen()\r\n\t\t\t\t&& !this.commonPopupService.isOpen()\r\n\t\t\t\t&& !this.commonDialogPopupService.isOpen()\r\n\t\t\t\t&& !this.commonContextMenuFactory.isOpenContextMenu;\r\n\t\t},\r\n\t\tisEnabled: () => {\r\n\t\t\treturn !this.commonUserDataService.getData().IsClient;\r\n\t\t}\r\n\t};\r\n\r\n\tprivate hotkeysByLocaleConfigs: ICommonHotkeyByLocaleConfig[] = [];\r\n\r\n\taddHotkey(hotkey: ICommonHotkeyOptions): Observable {\r\n\t\tconst hotkey$ = this.hotkeysService.addShortcut(hotkey);\r\n\r\n\t\thotkey$\r\n\t\t\t.pipe(\r\n\t\t\t\tfilter((event: KeyboardEvent) => !this.isEventOnEditor(event)),\r\n\t\t\t)\r\n\t\t\t.subscribe((event) => {\r\n\t\t\t\thotkey.callback?.(event);\r\n\t\t\t});\r\n\r\n\t\treturn hotkey$;\r\n\t}\r\n\r\n\taddSequenceHotkey(hotkey: ICommonHotkeyOptions): Observable {\r\n\t\tconst hotkey$ = this.hotkeysService.addSequenceShortcut(hotkey);\r\n\r\n\t\thotkey$.subscribe((event) => {\r\n\t\t\thotkey.callback?.(event);\r\n\t\t});\r\n\r\n\t\treturn hotkey$;\r\n\t}\r\n\r\n\tremoveHotkey(keys: string | string[]) {\r\n\t\tthis.hotkeysService.removeShortcuts(keys);\r\n\t}\r\n\r\n\taddHotkeyByLocale(config: ICommonHotkeyByLocaleConfig): Observable {\r\n\t\tthis.hotkeysByLocaleConfigs.push(config);\r\n\r\n\t\tconst extendedConfig: ICommonHotkeyByLocaleConfig = defaults(config, this.defaultHotkeyConfig);\r\n\t\tconst key = extendedConfig.keys[this.commonLocaleService.locale];\r\n\r\n\t\tlet hotkey$ = of(null);\r\n\r\n\t\tif (key && extendedConfig.isEnabled()) {\r\n\t\t\thotkey$ = this.hotkeysService.addShortcut({\r\n\t\t\t\tkeys: key,\r\n\t\t\t\tpreventDefault: false,\r\n\t\t\t}).pipe(\r\n\t\t\t\tfilter((event: KeyboardEvent) => extendedConfig.inCondition()),\r\n\t\t\t\tfilter((event: KeyboardEvent) => !this.isEventOnEditor(event)),\r\n\t\t\t\ttap((event: KeyboardEvent) => {\r\n\t\t\t\t\tconst noPermissionsCondition = extendedConfig.permissions && !this.commonPermissionsService.hasPermissions(extendedConfig.permissions)\r\n\t\t\t\t\t\t|| !this.commonPermissionsService.hasPermissions(['FullUserInterface:Read']);\r\n\r\n\t\t\t\t\tif (noPermissionsCondition) {\r\n\t\t\t\t\t\tthis.commonNotificationService.show(\r\n\t\t\t\t\t\t\tthis.instant('common.hotkeys.noty.no_grants.title'),\r\n\t\t\t\t\t\t\tthis.instant('common.hotkeys.noty.no_grants.text'),\r\n\t\t\t\t\t\t\t'error',\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\textendedConfig.callback?.(event);\r\n\t\t\t\t\t}\r\n\t\t\t\t}),\r\n\t\t\t);\r\n\r\n\t\t\thotkey$.subscribe();\r\n\t\t}\r\n\r\n\t\treturn hotkey$;\r\n\t}\r\n\r\n\tremoveHotkeyByLocale(config: ICommonHotkeyByLocaleConfig) {\r\n\t\tremove(this.hotkeysByLocaleConfigs, {name: config.name});\r\n\t\tthis.removeHotkey(config.keys[this.commonLocaleService.locale]);\r\n\t}\r\n\r\n\tgetLocaleHotkeyKey(configName: string): string {\r\n\t\tconst config = find(this.hotkeysByLocaleConfigs, {name: configName});\r\n\r\n\t\treturn config ? config.keys[this.commonLocaleService.locale] : null;\r\n\t}\r\n\r\n\treplaceHotkey (hotkey: ICommonHotkeyOptions): ICommonHotkeyOptions {\r\n\t\tif (!isEmpty(hotkey)) {\r\n\t\t\tconst hotkeys = this.hotkeysService.getHotkeys();\r\n\t\t\tconst previousHotkey = find(hotkeys, {keys: hotkey.keys});\r\n\t\t\tif (previousHotkey) {\r\n\t\t\t\tthis.removeHotkey(previousHotkey.keys);\r\n\t\t\t}\r\n\r\n\t\t\tthis.addHotkey(hotkey);\r\n\r\n\t\t\treturn previousHotkey || null;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tprivate isEventOnEditor(event: KeyboardEvent): boolean {\r\n\r\n\t\t// TODO:[angular] remove 'common-html-editor-component-for-angular-js' condition after upgrade to angular\r\n\t\tconst foundHtmlEditor = getClosest(event.target as HTMLElement, 'common-html-editor-component-for-angular-js')\r\n\t\t\t|| getClosest(event.target as HTMLElement, 'common-html-editor');\r\n\r\n\t\treturn Boolean(foundHtmlEditor);\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CommonPermissionsService } from './permissions.service';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class CommonPermissionsParsersService {\r\n\tconstructor(\r\n\t\tprivate commonPermissionsService: CommonPermissionsService,\r\n\t) {\r\n\t}\r\n\r\n\tpermissionsTransformResponse (observable: Observable): Observable {\r\n\t\treturn observable\r\n\t\t\t.pipe(map((response) => {\r\n\t\t\t\treturn this.commonPermissionsService.permissionsTransformResponse(response);\r\n\t\t\t}));\r\n\t}\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonPermissionsService } from './services/permissions.service';\r\nimport { CommonPermissionsParsersService } from './services/permissions-parsers.service';\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\tCommonPermissionsService,\r\n\t\tCommonPermissionsParsersService,\r\n\t],\r\n})\r\nexport class CommonPermissionsModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { CommonLoaderComponent } from './components/loader/loader.component';\r\nimport { CommonLoaderContainerComponent } from './components/loader-container/loader-container.component';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonLoaderComponent,\r\n\t\tCommonLoaderContainerComponent,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonLoaderComponent,\r\n\t\tCommonLoaderContainerComponent,\r\n\t],\r\n\tentryComponents: [\r\n\t\tCommonLoaderComponent,\r\n\t\tCommonLoaderContainerComponent,\r\n\t],\r\n})\r\nexport class CommonLoaderModule {}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { CommonDialogComponent } from './common-dialog.component';\r\nimport { CommonDialogButtonComponent } from './common-dialog-button.component/common-dialog-button.component';\r\nimport { CommonDialogContextMenuScreenComponent } from './common-dialog-context-menu-screen.component/common-dialog-context-menu-screen.component';\r\nimport { CommonDialogButtonsComponent } from './common-dialog-buttons.component/common-dialog-buttons.component';\r\nimport { CommonLoaderModule } from '@CaseOne/Common/loader/loader.module';\r\nimport { CommonLocaleModule } from '@CaseOne/Common/locale/locale.module';\r\n\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonModule,\r\n\t\tCommonLoaderModule,\r\n\t\tCommonLocaleModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonDialogComponent,\r\n\t\tCommonDialogButtonComponent,\r\n\t\tCommonDialogButtonsComponent,\r\n\t\tCommonDialogContextMenuScreenComponent,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonDialogComponent,\r\n\t\tCommonDialogButtonComponent,\r\n\t\tCommonDialogButtonsComponent,\r\n\t\tCommonDialogContextMenuScreenComponent,\r\n\t],\r\n\tentryComponents: [\r\n\t\tCommonDialogContextMenuScreenComponent,\r\n\t],\r\n})\r\nexport class CommonDialogModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { CommonActionsDropdownComponent } from './common-actions-dropdown.component';\r\nimport { CommonActionsDropdownOptionsListComponent } from './components/common-actions-dropdown-options-list/common-actions-dropdown-options-list.component';\r\nimport { CommonActionsDropdownOptionComponent } from './components/common-actions-dropdown-option/common-actions-dropdown-option.component';\r\nimport { CommonDialogModule } from '../../blocks/dialog/common-dialog.module';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonModule,\r\n\t\tCommonDialogModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonModule,\r\n\t\tCommonActionsDropdownComponent,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonActionsDropdownComponent,\r\n\t\tCommonActionsDropdownOptionsListComponent,\r\n\t\tCommonActionsDropdownOptionComponent,\r\n\t],\r\n\tentryComponents: [\r\n\t\tCommonActionsDropdownComponent,\r\n\t\tCommonActionsDropdownOptionsListComponent,\r\n\t],\r\n})\r\nexport class CommonActionsDropdownModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { OverlayModule } from '@angular/cdk/overlay';\r\nimport { PortalModule } from '@angular/cdk/portal';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { CommonPopupContainerComponent } from './components/popup-container/popup-container.component';\r\nimport { CommonPopupService } from './services/popup.service';\r\nimport { CommonPopupHeaderWrapperComponent } from './components/popup-header-wrapper/popup-header-wrapper.component';\r\nimport { CommonPopupOverlayBackgroundComponent } from './components/popup-overlay-background/popup-overlay-background.component';\r\nimport { CommonPopupLoaderComponent } from './components/popup-loader/popup-loader.component';\r\nimport { CommonLoaderModule } from '../loader/loader.module';\r\nimport { CommonActionsDropdownModule } from '../context-menu/actions-dropdown.component/common-actions-dropdown.module';\r\nimport { CommonLocaleModule } from '../locale/locale.module';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonModule,\r\n\t\tOverlayModule,\r\n\t\tPortalModule,\r\n\t\tCommonLocaleModule,\r\n\t\tCommonLoaderModule,\r\n\t\tCommonActionsDropdownModule,\r\n\t],\r\n\texports: [\r\n\t\tOverlayModule,\r\n\t\tPortalModule,\r\n\t\tCommonLocaleModule,\r\n\t\tCommonPopupContainerComponent,\r\n\t\tCommonLoaderModule,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonPopupService,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonPopupContainerComponent,\r\n\t\tCommonPopupHeaderWrapperComponent,\r\n\t\tCommonPopupOverlayBackgroundComponent,\r\n\t\tCommonPopupLoaderComponent,\r\n\t],\r\n\tentryComponents: [\r\n\t\tCommonPopupContainerComponent,\r\n\t\tCommonPopupOverlayBackgroundComponent,\r\n\t\tCommonPopupLoaderComponent,\r\n\t],\r\n})\r\nexport class CommonPopupModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { HotkeysModule } from '@ngneat/hotkeys';\r\n\r\nimport { CommonHotkeyService } from './services/hotkey.service';\r\nimport { CommonPermissionsModule } from '@CaseOne/Common/permissions/permissions.module';\r\nimport { CommonPopupModule } from '@CaseOne/Common/popup/popup.module';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tHotkeysModule,\r\n\t\tCommonPermissionsModule,\r\n\t\tCommonPopupModule,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonHotkeyService,\r\n\t],\r\n})\r\nexport class CommonHotkeyModule {}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n\tname: 'commonTwoDigitsNumber',\r\n})\r\nexport class CommonTwoDigitsNumberPipe implements PipeTransform {\r\n\ttransform (num: number, placeholder = '0') {\r\n\t\treturn (placeholder + num).slice(-2);\r\n\t}\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\nimport { CommonTwoDigitsNumberPipe } from './two_digits_number.pipe';\r\n\r\n@Pipe({\r\n\tname: 'commonSecondsFormatter',\r\n})\r\nexport class CommonSecondsFormatterPipe implements PipeTransform {\r\n\tconstructor(private commonTwoDigitsNumberPipe: CommonTwoDigitsNumberPipe) {}\r\n\r\n\ttransform (seconds: number) {\r\n\t\tconst m = Math.floor(seconds / 60);\r\n\t\tconst s = Math.floor(seconds % 60);\r\n\r\n\t\tif (!seconds) {\r\n\t\t\treturn seconds;\r\n\t\t}\r\n\r\n\t\treturn [this.commonTwoDigitsNumberPipe.transform(m), this.commonTwoDigitsNumberPipe.transform(s)].join(':');\r\n\t}\r\n}\r\n","import { Pipe, PipeTransform, SecurityContext } from '@angular/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\n\r\n@Pipe({\r\n name: 'commonSafeHtml',\r\n})\r\nexport class CommonSafeHtmlPipe implements PipeTransform {\r\n\r\n\tconstructor(\r\n\t\tprivate sanitizer: DomSanitizer,\r\n\t) {}\r\n\r\n\ttransform(value: string = ''): SafeHtml {\r\n\t\treturn this.sanitizer.bypassSecurityTrustHtml(this.sanitizer.sanitize(\r\n\t\t\tSecurityContext.HTML,\r\n\t\t\tvalue,\r\n\t\t));\r\n\t}\r\n\r\n}\r\n","// New version src/Common/pipes/common-title.filter.ts CommonTitleFilter\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common-title.filter.ts commonTitleFilter\r\n\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\n\r\ninterface ICommonTitleFilterOptions {\r\n\tfloatLabel?: string,\r\n\tplaceholder?: string,\r\n\thideValue?: boolean\r\n}\r\n\r\nexport const COMMON_TITLE_LINE_SEPARATOR = '\\n';\r\n\r\n@Pipe({\r\n\tname: 'commonTitleFilter',\r\n})\r\nexport class CommonTitlePipe implements PipeTransform {\r\n\ttransform (value: string, options: ICommonTitleFilterOptions = {}): string {\r\n\t\tconst { floatLabel, placeholder, hideValue } = options;\r\n\r\n\t\tif (value) {\r\n\t\t\tif (hideValue) {\r\n\t\t\t\treturn floatLabel ? floatLabel : '';\r\n\t\t\t}\r\n\r\n\t\t\tif (floatLabel) {\r\n\t\t\t\treturn floatLabel + COMMON_TITLE_LINE_SEPARATOR + value;\r\n\t\t\t} else {\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn placeholder || '';\r\n\t\t}\r\n\t}\r\n}\r\n","import { isNull, isArray, some, find, isString, map, isEmpty, extend, compact } from 'lodash';\r\nimport * as moment from 'moment/moment';\r\n\r\nimport { Int, UUID } from '../interfaces/core';\r\nimport { CommonLocaleService } from '../locale/locale.service';\r\nimport { CommonGeneralSettingsService } from '../general_settings/general_settings.service';\r\nimport { ICommonGeneralSettingsNonWorkingDay } from '../general_settings/interfaces/general-settings-non-working-day.interface';\r\nimport { combineLatest, BehaviorSubject } from 'rxjs';\r\nimport { Injectable } from '@angular/core';\r\nimport { replaceAt } from '@CaseOne/Common/utilities/string/replace-at';\r\n\r\n// Helper for generating Opaque types.\r\ntype Opaque = T & { __opaque__: K };\r\nexport type CommonDateFormatString = Opaque; // 'YYYY-MM-DD'\r\ntype NonWorkingRule = (day: moment.Moment) => boolean;\r\n\r\ntype MomentPeriod = (\r\n\t'year' | 'years' | 'y' |\r\n\t'month' | 'months' | 'M' |\r\n\t'week' | 'weeks' | 'w' |\r\n\t'day' | 'days' | 'd' |\r\n\t'hour' | 'hours' | 'h' |\r\n\t'minute' | 'minutes' | 'm' |\r\n\t'second' | 'seconds' | 's' |\r\n\t'millisecond' | 'milliseconds' | 'ms'\r\n);\r\n\r\ntype MomentPeriodQuarter = 'quarter' | 'quarters' | 'Q';\r\n\r\nexport interface ICommonWeekDay {\r\n\tId: UUID,\r\n\tName: string,\r\n\tOrder: Int,\r\n\tIndexNumber: Int,\r\n\tSysName: string,\r\n}\r\n\r\nexport const DAYS_SYMBOL = 'dd';\r\nexport const MONTHS_SYMBOL = 'mm';\r\nexport const YEARS_SYMBOL = 'yyyy';\r\nexport const DAYS_IN_WEEK = 7;\r\nexport const HOURS_IN_DAY = 24;\r\nexport const MINUTES_IN_HOUR = 60;\r\nexport const SECONDS_IN_MINUTE = 60;\r\nexport const MILLISEC_IN_SECOND = 1000;\r\nexport const DAY_AS_SECONDS = HOURS_IN_DAY * MINUTES_IN_HOUR * SECONDS_IN_MINUTE;\r\n\r\nconst DEFAULT_SETTINGS = {\r\n\tfirstDay: 1,\r\n};\r\n\r\n@Injectable()\r\nexport class CommonServerDateService {\r\n\treadonly daysSymbol: string = DAYS_SYMBOL;\r\n\treadonly monthsSymbol: string = MONTHS_SYMBOL;\r\n\treadonly yearsSymbol: string = YEARS_SYMBOL;\r\n\r\n\treadonly secondsInMinute: number = SECONDS_IN_MINUTE;\r\n\treadonly minutesInHour: number = MINUTES_IN_HOUR;\r\n\treadonly hoursInDay: number = HOURS_IN_DAY;\r\n\treadonly secondsInDay: number = DAY_AS_SECONDS;\r\n\treadonly millisecInSecond: number = MILLISEC_IN_SECOND;\r\n\treadonly daysInWeek: number = DAYS_IN_WEEK;\r\n\treadonly datetimeFormat: string = 'YYYY-MM-DD[T]HH:mm:ss.SSSZ';\r\n\treadonly dateFormat: string = 'YYYY-MM-DD';\r\n\tworkingDays: ICommonWeekDay[] = [];\r\n\tnonWorkingDays: ICommonGeneralSettingsNonWorkingDay[] = [];\r\n\r\n\t// input/display date and time formats\r\n\tweekDayFormat: string = 'ddd';\r\n\tshortDateFormat: string = 'DD.MM.Y';\r\n\tinputDateFormat: string = this.shortDateFormat;\r\n\tmediumDateFormat: string = 'D MMM Y';\r\n\tlongDateFormat: string = 'D MMMM Y';\r\n\tdisplayTimeFormat: string = 'HH:mm';\r\n\tmaskDelimiter: string = '.';\r\n\tshortWithTime: string = `${this.shortDateFormat}, ${this.displayTimeFormat}`;\r\n\tmediumWithTime: string = `${this.mediumDateFormat}, ${this.displayTimeFormat}`;\r\n\ttimeWithMedium: string = `${this.displayTimeFormat}, ${this.mediumDateFormat}`;\r\n\r\n\tdateTestRegex: RegExp = null;\r\n\tinputDateTestRegex: RegExp = null;\r\n\tinputDateMask: string = '';\r\n\tinputDatePlaceholder: string = '';\r\n\tinputTimeMask: string = '';\r\n\tinputTimePlaceholder: string = '';\r\n\r\n\tinputFormatWithFirstZero: boolean = -1 < this.inputDateFormat.indexOf('DD');\r\n\tamDesignator: string = '';\r\n\tpmDesignator: string = '';\r\n\tfirstDay: number = null;\r\n\r\n\tprivate readonly inputTimeRegex: RegExp = /\\d{2}:\\d{2}/;\r\n\tprivate readonly isoDateTestRegex: RegExp = /(\\d{4})\\-(\\d{2})\\-(\\d{2})/;\r\n\tprivate readonly yearMonthDayKey: string = 'yyyymmdd';\r\n\tprivate readonly monthDayYearKey: string = 'mmddyyyy';\r\n\tprivate readonly dayMonthYearKey: string = 'ddmmyyyy';\r\n\r\n\tprivate readonly dateTestRegexByYear = {\r\n\t\t[this.yearMonthDayKey]: /(\\d{4})[\\/\\-.](\\d{1,2})[\\/\\-.](\\d{1,2})/,\r\n\t\t[this.monthDayYearKey]: /(\\d{1,2})[\\/\\-.](\\d{1,2})[\\/\\-.](\\d{4})/,\r\n\t\t[this.dayMonthYearKey]: /(\\d{1,2})[\\/\\-.](\\d{1,2})[\\/\\-.](\\d{4})/,\r\n\t};\r\n\r\n\tprivate readonly inputDateTestRegexByYear = {\r\n\t\t[this.yearMonthDayKey]: /(\\d{4})[\\/\\-.](\\d{2})[\\/\\-.](\\d{2})/,\r\n\t\t[this.monthDayYearKey]: /(\\d{2})[\\/\\-.](\\d{2})[\\/\\-.](\\d{4})/,\r\n\t\t[this.dayMonthYearKey]: /(\\d{2})[\\/\\-.](\\d{2})[\\/\\-.](\\d{4})/,\r\n\t};\r\n\t// Index: 1 - Day, 2 - Month, 3 - Year\r\n\tprivate readonly regexGroupIndexMap = {\r\n\t\t[this.yearMonthDayKey]: [3, 2, 1],\r\n\t\t[this.monthDayYearKey]: [2, 1, 3],\r\n\t\t[this.dayMonthYearKey]: [1, 2, 3],\r\n\t};\r\n\tprivate maskWithoutDelimiters;\r\n\r\n\tprivate readonly TIME_KEYS_FOR_DST_FIX = ['days', 'day', 'weeks', 'week', 'months', 'month', 'quarters', 'quarter', 'years', 'year', 'd', 'w', 'M', 'Q', 'y'];\r\n\tprivate workingDayIndexes: Int[];\r\n\tprivate nonWorkingDaysRules: NonWorkingRule[];\r\n\r\n\tprivate init$ = new BehaviorSubject(false);\r\n\r\n\tconstructor (\r\n\t\tprivate commonLocaleService: CommonLocaleService,\r\n\t\tprivate commonGeneralSettingsService: CommonGeneralSettingsService,\r\n\t) {}\r\n\r\n\tinit (): Promise {\r\n\t\treturn new Promise((resolve) => { // for APP_INITIALIZER\r\n\t\t\tconst res = combineLatest([\r\n\t\t\t\tthis.commonGeneralSettingsService.wait(),\r\n\t\t\t\tthis.commonLocaleService.wait(),\r\n\t\t\t]);\r\n\r\n\t\t\tres.subscribe((result) => {\r\n\t\t\t\tif (result.length === compact(result).length) {\r\n\t\t\t\t\tthis.workingDays = this.commonGeneralSettingsService.getGeneralSettings('WorkingDays');\r\n\t\t\t\t\tthis.nonWorkingDays = this.commonGeneralSettingsService.getGeneralSettings('NonWorkingDays');\r\n\t\t\t\t\tthis.extendDateFormatsFromGeneralSettings();\r\n\r\n\t\t\t\t\tthis.setInputSettings();\r\n\r\n\t\t\t\t\tthis.workingDayIndexes = map(this.workingDays, (day) => {\r\n\t\t\t\t\t\tconst index = day.IndexNumber + 1;\r\n\r\n\t\t\t\t\t\tif (index === DAYS_IN_WEEK) {\r\n\t\t\t\t\t\t\treturn 0 as Int;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn index as Int;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.nonWorkingDaysRules = this.createNonWorkingRules(this.nonWorkingDays);\r\n\r\n\t\t\t\t\tthis.init$.next(true);\r\n\t\t\t\t\tresolve(true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tgetMoment (dateString = null, isUTC: boolean = false): moment.Moment {\r\n\t\tconst value = dateString === 'current' || isNull(dateString) ? undefined : dateString;\r\n\t\tconst format = this.isDateString(dateString) && !this.isISODateTimeString(dateString) ? this.shortDateFormat : null;\r\n\r\n\t\treturn isUTC ? moment.utc(value, format) : moment(value, format);\r\n\t}\r\n\r\n\tgetMomentFromTime (timeString: string, format = this.displayTimeFormat): moment.Moment {\r\n\t\treturn moment(timeString, format);\r\n\t}\r\n\r\n\tisInputTimeString (timeString: string): boolean {\r\n\t\treturn isString(timeString) && this.inputTimeRegex.test(timeString);\r\n\t}\r\n\r\n\tgetTimezoneOffset (): string {\r\n\t\treturn moment().format('Z');\r\n\t}\r\n\r\n\tisChangedDates (newValues: moment.Moment | string | [], oldValues: moment.Moment | string | []): boolean {\r\n\t\tlet isChanged;\r\n\r\n\t\tif (isArray(newValues)) {\r\n\t\t\tisChanged = some(newValues, (value, index) => {\r\n\t\t\t\treturn !this.getMoment(value).isSame(this.getMoment(oldValues[index]));\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tisChanged = !this.getMoment(newValues).isSame(this.getMoment(oldValues));\r\n\t\t}\r\n\r\n\t\treturn isChanged;\r\n\t}\r\n\r\n\tgetLastDaysDate (daysCount: number): moment.Moment {\r\n\t\treturn moment().add(-daysCount, 'days');\r\n\t}\r\n\r\n\tisDayOff (date: moment.Moment): boolean {\r\n\t\tif (this.isWorkingDayInWeek(date)) {\r\n\t\t\treturn !!find(this.nonWorkingDaysRules, (rule) => {\r\n\t\t\t\treturn rule(date);\r\n\t\t\t});\r\n\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\tisWorkingDayInWeek (date: moment.Moment): boolean {\r\n\t\tconst dayIndex = date.day() as Int;\r\n\t\treturn -1 < this.workingDayIndexes.indexOf(dayIndex);\r\n\t}\r\n\r\n\tgetDiffAsDays (startDate: moment.Moment, endDate: moment.Moment): number {\r\n\t\tconst minutesDiff = (endDate.unix() - startDate.unix()) / this.secondsInMinute;\r\n\t\tconst offsetDiff = endDate.utcOffset() - startDate.utcOffset();\r\n\r\n\t\treturn (minutesDiff + offsetDiff) / (this.minutesInHour * this.hoursInDay);\r\n\t}\r\n\r\n\tadd (date: moment.Moment, value: number, period: MomentPeriod | MomentPeriodQuarter): moment.Moment {\r\n\t\tconst isFixPeriod = -1 < this.TIME_KEYS_FOR_DST_FIX.indexOf(period);\r\n\r\n\t\tlet oldHour;\r\n\t\tlet newHour;\r\n\t\tlet diff;\r\n\r\n\t\tif (isFixPeriod) {\r\n\t\t\toldHour = date.hours();\r\n\t\t\tdate.add(value, period);\r\n\t\t\tnewHour = date.hours();\r\n\r\n\t\t\tif (oldHour !== newHour) {\r\n\t\t\t\tdiff = this.getCountDiffHours(newHour, oldHour);\r\n\r\n\t\t\t\tif (0 < diff) {\r\n\t\t\t\t\tdate.add(diff, 'hours');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t} else {\r\n\t\t\treturn date.add(value, period);\r\n\t\t}\r\n\t}\r\n\r\n\tisDateString (dateString: string): boolean {\r\n\t\treturn isString(dateString) && (this.dateTestRegex.test(dateString) ? this.isValidDateFromString(dateString) : this.isISODateTimeString(dateString));\r\n\t}\r\n\r\n\tisValidDateFromString (dateString: string): boolean {\r\n\t\tif (!isString(dateString)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst result = this.dateTestRegex.exec(dateString);\r\n\r\n\t\tif (!result) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst [day, month, year] = this.regexGroupIndexMap[this.maskWithoutDelimiters];\r\n\t\tconst dayNumber = Number(result[day]);\r\n\t\tconst monthNumber = Number(result[month]);\r\n\t\tconst yearNumber = Number(result[year]);\r\n\r\n\t\tif (Number.isNaN(dayNumber) || Number.isNaN(monthNumber) || Number.isNaN(yearNumber) || monthNumber > 12) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst daysInMonth = (new Date(yearNumber, monthNumber, 0)).getDate();\r\n\r\n\t\treturn dayNumber <= daysInMonth;\r\n\t}\r\n\r\n\t// CASEM-68399 bug with incorrect timezone\r\n\tgetMomentWithFixDSTShiftFromISOString(dateString: string): moment.Moment {\r\n\t\tif (!this.isISODateTimeString(dateString)) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst result = this.isoDateTestRegex.exec(dateString);\r\n\t\tconst [day, month, year] = [3, 2, 1];\r\n\t\tconst dayNumber = Number(result[day]);\r\n\t\tconst monthNumber = Number(result[month]);\r\n\t\tconst yearNumber = Number(result[year]);\r\n\r\n\t\treturn this.getMomentWithFixDSTShift(dateString, dayNumber, monthNumber, yearNumber);\r\n\t}\r\n\r\n\tsetMomentTimeFromDateString (momentDate: moment.Moment, dateString?: string): moment.Moment {\r\n\t\tlet hours = 0;\r\n\t\tlet minutes = 0;\r\n\r\n\t\t// if already set, save time value\r\n\t\tif (dateString) {\r\n\t\t\tconst mCurrent = this.getMoment(dateString);\r\n\r\n\t\t\thours = mCurrent.hours() || 0;\r\n\t\t\tminutes = mCurrent.minutes() || 0;\r\n\t\t}\r\n\r\n\t\tmomentDate.set({\r\n\t\t\thour: hours,\r\n\t\t\tminute: minutes,\r\n\t\t\tsecond: 0,\r\n\t\t\tmillisecond: 0,\r\n\t\t});\r\n\r\n\t\treturn momentDate;\r\n\t}\r\n\r\n\t// CASEM-68399 bug with incorrect timezone\r\n\tgetMomentWithFixDSTShiftFromInputString(dateString: string): moment.Moment {\r\n\t\tif (!this.isInputDateString(dateString)) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst result = this.inputDateTestRegex.exec(dateString);\r\n\t\tconst [day, month, year] = this.regexGroupIndexMap[this.maskWithoutDelimiters];\r\n\t\tconst dayNumber = Number(result[day]);\r\n\t\tconst monthNumber = Number(result[month]);\r\n\t\tconst yearNumber = Number(result[year]);\r\n\r\n\t\treturn this.getMomentWithFixDSTShift(dateString, dayNumber, monthNumber, yearNumber);\r\n\t}\r\n\r\n\t// CASEM-68399 bug with incorrect timezone\r\n\tprivate getMomentWithFixDSTShift(dateString: string, dayNumber: number, monthNumber: number, yearNumber: number): moment.Moment {\r\n\t\tconst dateMoment = this.getMoment(dateString);\r\n\t\tconst momentDate = dateMoment.date();\r\n\t\tconst momentMonth = dateMoment.month();\r\n\t\tconst momentYear = dateMoment.year();\r\n\r\n\t\tif (dayNumber !== momentDate) { // DST shift\r\n\t\t\tconst daysDiff = new Date(yearNumber, monthNumber - 1, dayNumber) > new Date(momentYear, momentMonth, momentDate) ? 1 : -1;\r\n\r\n\t\t\tdateMoment.add(daysDiff, 'days');\r\n\t\t}\r\n\r\n\t\treturn dateMoment;\r\n\t}\r\n\r\n\tisInputDateString (dateString: string): boolean {\r\n\t\treturn isString(dateString) && (this.inputDateTestRegex.test(dateString) || this.isISODateTimeString(dateString));\r\n\t}\r\n\r\n\tisISODateTimeString (dateString: string): boolean {\r\n\t\treturn isString(dateString) && this.isoDateTestRegex.test(dateString);\r\n\t}\r\n\r\n\tisISODateString (dateString: string): boolean {\r\n\t\treturn this.isISODateTimeString(dateString) && dateString.length === 10;\r\n\t}\r\n\r\n\t// convert date (or array of dates) to UTC ISO 8601 formatted string\r\n\ttoISOString (date: moment.Moment | string, isUTC?: boolean): string {\r\n\t\treturn date ? this.getMoment(date, isUTC).clone().toISOString() : '';\r\n\t}\r\n\r\n\ttoDateString (date: any, isUTC?: boolean): CommonDateFormatString | string {\r\n\t\treturn date ? this.getMoment(date, isUTC).clone().format(this.dateFormat) : '';\r\n\t}\r\n\r\n\ttoDisplayDateString (date: moment.Moment | string, isUTC?: boolean): string {\r\n\t\treturn date ? this.getMoment(date, isUTC).clone().format(this.shortDateFormat) : '';\r\n\t}\r\n\r\n\ttoDisplayTimeString (date: moment.Moment | string): string {\r\n\t\treturn date ? this.getMoment(date).clone().format(this.displayTimeFormat) : '';\r\n\t}\r\n\r\n\twait(): BehaviorSubject {\r\n\t\treturn this.init$;\r\n\t}\r\n\r\n\tisSameOrBefore(date1: moment.Moment | string, date2: moment.Moment | string): boolean {\r\n\t\treturn this.getMoment(date1).clone().isSameOrBefore(date2);\r\n\t}\r\n\r\n\t// convert ISO date string (YYYY-MM-DD) and time (HH:mm:ss.SSS or HH:mm) to ISO datetime (YYYY-MM-DD[T]HH:mm:ss.SSSZ)\r\n\t// CASEM-68399 bug with incorrect timezone\r\n\tconvertISODateToDateTime(date: string, time?: string): string {\r\n\r\n\t\tif (!date || !this.isISODateString(date)) {\r\n\t\t\treturn date;\r\n\t\t}\r\n\r\n\t\tconst emptyTime = '00:00:00.000';\r\n\t\tconst formattedTime = replaceAt(emptyTime, 0, time || '');\r\n\t\tconst datetime = `${date}T${formattedTime}Z`;\r\n\r\n\t\treturn datetime;\r\n\t}\r\n\r\n\tgetMonths(): string[] {\r\n\t\treturn moment.months();\r\n\t}\r\n\r\n\tprivate setInputSettings (): void {\r\n\t\tconst monthsSymbol = this.commonLocaleService.instant('common.symbols.months');\r\n\t\tconst yearsSymbol = this.commonLocaleService.instant('common.symbols.years');\r\n\t\tconst daysSymbol = this.commonLocaleService.instant('common.symbols.days');\r\n\t\tconst minutesSymbol = this.commonLocaleService.instant('common.symbols.minutes');\r\n\t\tconst hoursSymbol = this.commonLocaleService.instant('common.symbols.hours');\r\n\r\n\t\tconst mask = (this.inputDateFormat || '')\r\n\t\t\t.toLowerCase()\r\n\t\t\t.replace(/d{1,2}/i, DAYS_SYMBOL)\r\n\t\t\t.replace(/m{1,2}/i, MONTHS_SYMBOL)\r\n\t\t\t.replace(/y{1,4}/i, YEARS_SYMBOL);\r\n\r\n\t\tconst placeholder = mask\r\n\t\t\t.replace(/d/g, daysSymbol)\r\n\t\t\t.replace(/m/g, monthsSymbol)\r\n\t\t\t.replace(/y/g, yearsSymbol);\r\n\r\n\t\tthis.maskWithoutDelimiters = mask.replace(/\\W/g, '');\r\n\t\tthis.maskDelimiter = this.inputDateFormat.replace(/\\w/g, '')[0];\r\n\r\n\t\tthis.dateTestRegex = this.dateTestRegexByYear[this.maskWithoutDelimiters];\r\n\t\tthis.inputDateTestRegex = this.inputDateTestRegexByYear[this.maskWithoutDelimiters];\r\n\t\tthis.inputDateMask = mask;\r\n\t\tthis.inputDatePlaceholder = placeholder;\r\n\t\tthis.inputTimeMask = 'h:s';\r\n\t\tthis.inputTimePlaceholder = this.inputTimeMask.replace(/h/g, hoursSymbol + hoursSymbol).replace(/s/g, minutesSymbol + minutesSymbol);\r\n\t}\r\n\r\n\tprivate extendDateFormatsFromGeneralSettings (): void {\r\n\t\tconst dateFormatSettings = this.commonGeneralSettingsService.getGeneralSettings('DateFormat');\r\n\r\n\t\tif (!isEmpty(dateFormatSettings)) {\r\n\t\t\tconst timeFormatSettings = this.commonGeneralSettingsService.getGeneralSettings('TimeFormat');\r\n\r\n\t\t\tthis.displayTimeFormat = timeFormatSettings.Format;\r\n\t\t\tthis.shortDateFormat = dateFormatSettings.ShortFormat;\r\n\t\t\tthis.mediumDateFormat = dateFormatSettings.MediumFormat;\r\n\t\t\tthis.longDateFormat = dateFormatSettings.LongFormat;\r\n\t\t\tthis.inputDateFormat = this.shortDateFormat;\r\n\t\t\tthis.maskDelimiter = this.inputDateFormat.replace(/\\w/g, '')[0];\r\n\t\t\tthis.shortWithTime = `${this.shortDateFormat}, ${this.displayTimeFormat}`;\r\n\t\t\tthis.mediumWithTime = `${this.mediumDateFormat}, ${this.displayTimeFormat}`;\r\n\t\t\tthis.timeWithMedium = `${this.displayTimeFormat}, ${this.mediumDateFormat}`;\r\n\t\t\tthis.amDesignator = timeFormatSettings.AmDesignator;\r\n\t\t\tthis.pmDesignator = timeFormatSettings.PmDesignator;\r\n\t\t\tthis.firstDay = this.commonGeneralSettingsService.getGeneralSettings('DayOfWeek').IndexNumber + 1;\r\n\t\t\tthis.inputFormatWithFirstZero = -1 < this.inputDateFormat.indexOf('DD');\r\n\t\t} else {\r\n\t\t\textend(this, DEFAULT_SETTINGS);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate afterOrEqual (\r\n\t\tfirstYear: number,\r\n\t\tfirstMonth: number,\r\n\t\tfirstDay: number,\r\n\t\tsecondYear: number,\r\n\t\tsecondMonth: number,\r\n\t\tsecondDay: number,\r\n\t): boolean {\r\n\t\treturn firstYear < secondYear || (firstYear === secondYear && (\r\n\t\t\tfirstMonth < secondMonth || (firstMonth === secondMonth && (\r\n\t\t\t\tfirstDay < secondDay || firstDay === secondDay)\r\n\t\t\t))\r\n\t\t);\r\n\t}\r\n\r\n\tprivate createNonWorkingRules (nonWorkingDays: ICommonGeneralSettingsNonWorkingDay[]): NonWorkingRule[] {\r\n\t\treturn map(nonWorkingDays, (day) => {\r\n\t\t\tconst startDate = this.getMoment(day.StartDate);\r\n\t\t\tconst startYear = startDate.year();\r\n\t\t\tconst startMonth = startDate.month();\r\n\t\t\tconst startDayInMonth = startDate.date();\r\n\r\n\t\t\tif (day.EndDate) {\r\n\t\t\t\tconst endDate = this.getMoment(day.EndDate);\r\n\t\t\t\tconst endYear = endDate.year();\r\n\t\t\t\tconst endMonth = endDate.month();\r\n\t\t\t\tconst endDayInMonth = endDate.date();\r\n\r\n\t\t\t\treturn (testDate: moment.Moment): boolean => {\r\n\t\t\t\t\tconst year = testDate.year();\r\n\t\t\t\t\tconst month = testDate.month();\r\n\t\t\t\t\tconst dayInMonth = testDate.date();\r\n\t\t\t\t\tconst afterStart = this.afterOrEqual(startYear, startMonth, startDayInMonth, year, month, dayInMonth);\r\n\t\t\t\t\tconst beforeEnd = this.afterOrEqual(year, month, dayInMonth, endYear, endMonth, endDayInMonth);\r\n\r\n\t\t\t\t\treturn afterStart && beforeEnd;\r\n\t\t\t\t};\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn (testDate: moment.Moment): boolean => {\r\n\t\t\t\t\tconst year = testDate.year();\r\n\t\t\t\t\tconst month = testDate.month();\r\n\t\t\t\t\tconst dayInMonth = testDate.date();\r\n\r\n\t\t\t\t\treturn startYear === year && startMonth === month && startDayInMonth === dayInMonth;\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprivate getCountDiffHours (newHour: number, oldHour: number): number {\r\n\t\tconst newHourInRange = 0 <= newHour && newHour < this.hoursInDay;\r\n\t\tconst oldHourInRange = 0 <= oldHour && oldHour < this.hoursInDay;\r\n\r\n\t\tlet leftShift;\r\n\t\tlet rightShift;\r\n\r\n\t\tif (newHourInRange && oldHourInRange) {\r\n\t\t\tleftShift = 0;\r\n\t\t\trightShift = 0;\r\n\r\n\t\t\twhile (true) {\r\n\t\t\t\tif (this.normalizeHour(newHour + leftShift) === oldHour) {\r\n\t\t\t\t\treturn leftShift;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tleftShift -= 1;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.normalizeHour(newHour + rightShift) === oldHour) {\r\n\t\t\t\t\treturn rightShift;\r\n\t\t\t\t} else {\r\n\t\t\t\t\trightShift += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate normalizeHour (hour: number): number {\r\n\t\tif (this.hoursInDay <= hour) {\r\n\t\t\treturn this.normalizeHour(hour - this.hoursInDay);\r\n\t\t} else if (hour < 0) {\r\n\t\t\treturn this.normalizeHour(hour + this.hoursInDay);\r\n\t\t} else {\r\n\t\t\treturn hour;\r\n\t\t}\r\n\t}\r\n}\r\n","export function replaceAt (str: string, index: number, replacement: string): string {\r\n\treturn str.substring(0, index) + replacement + str.substring(index + replacement.length);\r\n}\r\n","// New version src/Common/pipes/common-na-format.pipe.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_na_formatter_filter.ts\r\n// src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_na_to_black_formatter_filter.js\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\nimport { CommonUtilitiesCore } from '../utilities/core.service';\r\n\r\n@Pipe({\r\n\tname: 'commonNAFormatter',\r\n})\r\nexport class CommonNAFormatPipe implements PipeTransform {\r\n\tconstructor (\r\n\t\tprivate utilities: CommonUtilitiesCore,\r\n\t) {}\r\n\r\n\ttransform(data, toBlank = false) {\r\n\t\tconst ph = toBlank ? '' : '—';\r\n\t\treturn !this.utilities.hasValue(data) ? ph : data;\r\n\t}\r\n}\r\n","import { Injector, Pipe, PipeTransform } from '@angular/core';\r\nimport { upperFirst } from 'lodash';\r\n\r\nimport { CommonUtilitiesCore } from '../utilities/core.service';\r\nimport { CommonServerDateService } from '../server_date/server_date.service';\r\nimport { CommonNAFormatPipe } from './common-na-format.pipe';\r\n\r\nexport enum COMMON_DATE_PIPE_FORMAT_TYPE {\r\n\tSHORT = 'Short',\r\n\tMEDIUM = 'Medium',\r\n\tLONG = 'Long',\r\n\tTIME = 'Time',\r\n\tSHORT_WITH_TIME = 'ShortWithTime',\r\n\tMEDIUM_WITH_TIME = 'MediumWithTime',\r\n\tTIME_WITH_MEDIUM = 'TimeWithMedium',\r\n\tWEEK_DAY = 'WeekDay'\r\n}\r\n\r\nexport interface ICommonDatePipeOptions {\r\n\tuseCommonNAToBlankFormatter?: boolean;\r\n\tformat?: string;\r\n\tformatType?: COMMON_DATE_PIPE_FORMAT_TYPE\r\n}\r\n\r\n@Pipe({\r\n\tname: 'commonDateFormatter',\r\n})\r\nexport class CommonDatePipe implements PipeTransform {\r\n\tprivate commonServerDateService: CommonServerDateService = this.injector.get(CommonServerDateService);\r\n\tprivate formats = {\r\n\t\t[COMMON_DATE_PIPE_FORMAT_TYPE.SHORT]: this.commonServerDateService.shortDateFormat,\r\n\t\t[COMMON_DATE_PIPE_FORMAT_TYPE.MEDIUM]: this.commonServerDateService.mediumDateFormat,\r\n\t\t[COMMON_DATE_PIPE_FORMAT_TYPE.LONG]: this.commonServerDateService.longDateFormat,\r\n\t\t[COMMON_DATE_PIPE_FORMAT_TYPE.TIME]: this.commonServerDateService.displayTimeFormat,\r\n\t\t[COMMON_DATE_PIPE_FORMAT_TYPE.SHORT_WITH_TIME]: this.commonServerDateService.shortWithTime,\r\n\t\t[COMMON_DATE_PIPE_FORMAT_TYPE.MEDIUM_WITH_TIME]: this.commonServerDateService.mediumWithTime,\r\n\t\t[COMMON_DATE_PIPE_FORMAT_TYPE.TIME_WITH_MEDIUM]: this.commonServerDateService.timeWithMedium,\r\n\t\t[COMMON_DATE_PIPE_FORMAT_TYPE.WEEK_DAY]: this.commonServerDateService.weekDayFormat,\r\n\t};\r\n\r\n\tconstructor(\r\n\t\tprivate injector: Injector,\r\n\t\tprivate utilities: CommonUtilitiesCore,\r\n\t\tprivate commonNAFormatter: CommonNAFormatPipe,\r\n\t) {\r\n\t}\r\n\r\n\ttransform(date: string | null, options: ICommonDatePipeOptions = {\r\n\t\tformatType: COMMON_DATE_PIPE_FORMAT_TYPE.MEDIUM,\r\n\t\tformat: '',\r\n\t\tuseCommonNAToBlankFormatter: false,\r\n\t}): string {\r\n\t\tif (!this.utilities.hasValue(date)) {\r\n\t\t\treturn this.commonNAFormatter.transform(date, options.useCommonNAToBlankFormatter);\r\n\t\t}\r\n\r\n\t\tconst format = options.format || this.formats[options.formatType];\r\n\r\n\t\treturn upperFirst(\r\n\t\t\tthis.commonServerDateService\r\n\t\t\t\t.getMoment(date)\r\n\t\t\t\t.format(format)\r\n\t\t);\r\n\t}\r\n}\r\n","import { commonConstants } from '@CaseOne/Common/constants/common.constants';\r\n\r\nexport const COMMON_DEFAULT_NUMBER_CONSTANTS = {\r\n\tDECIMAL_SEPARATOR: commonConstants.defaultNumberDecimalSeparator,\r\n\tGROUP_SEPARATOR: commonConstants.defaultNumberGroupSeparator,\r\n\tDIGITS_AFTER_DECIMAL: commonConstants.defaultNumberDigitsAfterDecimal,\r\n};\r\n","// New version src/Common/pipes/common-pretty-number.pipe.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/pretty_number_filter.js\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\nimport { CommonGeneralSettingsService } from '../general_settings/general_settings.service';\r\nimport { COMMON_DEFAULT_NUMBER_CONSTANTS } from '../constants/common-default-number.constants';\r\nimport { isNumber } from 'lodash';\r\n\r\n\r\nexport interface ICommonPrettyNumberOptions {\r\n\tdigitsAfterDecimal?: number,\r\n\tfixAfterDecimal?: boolean, // cut off to true by default is necessary numbers of signs after a comma\r\n\tincludeTrailingZeros?: boolean,\r\n}\r\n\r\n\r\n@Pipe({\r\n\tname: 'commonPrettyNumber',\r\n})\r\nexport class CommonPrettyNumberPipe implements PipeTransform {\r\n\tconstructor (\r\n\t\tprivate commonGeneralSettingsService: CommonGeneralSettingsService,\r\n\t) {}\r\n\r\n\ttransform(\r\n\t\tnum: number | string,\r\n\t\toptions?: ICommonPrettyNumberOptions,\r\n\t): string {\r\n\t\tif (!num) {\r\n\t\t\treturn num.toString();\r\n\t\t}\r\n\r\n\t\toptions = options || {};\r\n\t\toptions.fixAfterDecimal = options.fixAfterDecimal !== false;\r\n\t\toptions.digitsAfterDecimal = isNumber(options.digitsAfterDecimal) ? options.digitsAfterDecimal : COMMON_DEFAULT_NUMBER_CONSTANTS.DIGITS_AFTER_DECIMAL;\r\n\r\n\t\tconst decimalSeparator = this.commonGeneralSettingsService.getGeneralSettings('NumberFormat.DecimalSeparator') || COMMON_DEFAULT_NUMBER_CONSTANTS.DECIMAL_SEPARATOR;\r\n\t\tconst groupSeparator = this.commonGeneralSettingsService.getGeneralSettings('NumberFormat.GroupSeparator') || COMMON_DEFAULT_NUMBER_CONSTANTS.GROUP_SEPARATOR;\r\n\r\n\t\tif (options.fixAfterDecimal && isNumber(num)) {\r\n\t\t\tconst multiplex = Math.pow(10, options.digitsAfterDecimal);\r\n\t\t\tnum = Math.round(multiplex * num) / multiplex;\r\n\t\t}\r\n\r\n\t\tlet result = num.toString()\r\n\t\t\t.replace(/[' ']/g, '')\r\n\t\t\t.replace('.', decimalSeparator);\r\n\r\n\t\tconst results = result.split(decimalSeparator);\r\n\t\tconst main = results[0];\r\n\t\tlet tail = results[1] || '';\r\n\r\n\t\tconst replacedMain = main.replace(/\\B(?=(\\d{3})+(?!\\d))/g, groupSeparator);\r\n\r\n\t\tif (options.includeTrailingZeros) {\r\n\t\t\twhile (tail.length < options.digitsAfterDecimal) {\r\n\t\t\t\ttail += '0';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tresult = replacedMain + (tail ? decimalSeparator + tail : '');\r\n\r\n\t\tif (options.fixAfterDecimal) {\r\n\t\t\tconst decimalIndex = result.indexOf(decimalSeparator);\r\n\r\n\t\t\tif (decimalIndex !== -1) {\r\n\t\t\t\tresult = result.slice(0, decimalIndex + options.digitsAfterDecimal + 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport { isNil } from 'lodash';\r\n\r\n@Pipe({\r\n\tname: 'commonRemoveHtmlTagsPipe',\r\n})\r\nexport class CommonRemoveHtmlTagsPipe implements PipeTransform {\r\n\ttransform (str: string) {\r\n\t\treturn !isNil(str) ? String(str).replace(/<[^>]+>/gm, '') : '';\r\n\t}\r\n}\r\n","// New version src/Common/pipes/common-number-formatter.pipe.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_number_formatter_filter.js\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_number_with_units_formatter_filter.js\r\n\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\nimport { CommonUtilitiesCore } from '../utilities/core.service';\r\nimport { CommonNAFormatPipe } from './common-na-format.pipe';\r\nimport {\r\n\tCommonPrettyNumberPipe,\r\n\tICommonPrettyNumberOptions,\r\n} from './common-pretty-number.pipe';\r\n\r\n\r\n@Pipe({\r\n\tname: 'commonNumberFormatter',\r\n})\r\nexport class CommonNumberFormatterPipe implements PipeTransform {\r\n\tconstructor (\r\n\t\tprivate utilities: CommonUtilitiesCore,\r\n\t\tprivate naFormatter: CommonNAFormatPipe,\r\n\t\tprivate prettyNumberFormatter: CommonPrettyNumberPipe,\r\n\t) {}\r\n\r\n\ttransform(num: number, unit: string = '', opt?: ICommonPrettyNumberOptions) {\r\n\t\tif (!this.utilities.hasValue(num)) {\r\n\t\t\treturn this.naFormatter.transform(num);\r\n\t\t}\r\n\r\n\t\treturn this.prettyNumberFormatter.transform(num, opt) + unit;\r\n\t}\r\n}\r\n","// New version src/Common/pipes/common-number-with-currency-formatter.pipe.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_number_with_currency_formatter_filter.js\r\n\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\nimport { CommonUtilitiesCore } from '../utilities/core.service';\r\nimport { CommonNAFormatPipe } from './common-na-format.pipe';\r\nimport { CommonPrettyNumberPipe } from './common-pretty-number.pipe';\r\nimport { COMMON_DEFAULT_NUMBER_CONSTANTS } from '../constants/common-default-number.constants';\r\nimport { CommonGeneralSettingsService } from '../general_settings/general_settings.service';\r\nimport {\r\n\tget,\r\n} from 'lodash';\r\nimport { CommonAppDataService } from '../app_data/app_data.service';\r\nimport { numberToFixedDecimals } from '../utilities/number-to-fixed-decimals';\r\nimport { fixedIEEE754Format } from '../utilities/number-fixed-IEEE754-format';\r\nimport { ICommonCurrencyModel } from '../interfaces/core';\r\n\r\ninterface ICommonNumberWithCurrencyFormatterOptions {\r\n\tcurrency?: string | ICommonCurrencyModel,\r\n\tuseCommonNAToBlankFormatter?: boolean,\r\n\tformattedNumber?: string,\r\n\tskipBracketsAndSwitch?: boolean,\r\n}\r\n\r\n@Pipe({\r\n\tname: 'commonNumberWithCurrencyFormatter',\r\n})\r\nexport class CommonNumberWithCurrencyFormatterPipe implements PipeTransform {\r\n\tappData = this.commonAppDataService.getData();\r\n\r\n\tconstructor (\r\n\t\tprivate utilities: CommonUtilitiesCore,\r\n\t\tprivate naFormatter: CommonNAFormatPipe,\r\n\t\tprivate prettyNumberFormatter: CommonPrettyNumberPipe,\r\n\t\tprivate commonGeneralSettingsService: CommonGeneralSettingsService,\r\n\t\tprivate commonAppDataService: CommonAppDataService,\r\n\t) {}\r\n\r\n\ttransform(num: number, options: ICommonNumberWithCurrencyFormatterOptions = {}) {\r\n\t\tif (!this.utilities.hasValue(num)) {\r\n\t\t\treturn this.naFormatter.transform(num, options.useCommonNAToBlankFormatter);\r\n\t\t}\r\n\r\n\t\tconst currency = get(options, 'currency') || this.commonGeneralSettingsService.getGeneralSettings('Currency');\r\n\t\tconst currencySymbol = currency && currency.Symbol ? currency.Symbol : currency;\r\n\t\tconst isNegativeNumber = num < 0;\r\n\t\tconst isNegativeValuesWithParentheses = this.appData?.IsNegativeValuesWithParentheses && !options.skipBracketsAndSwitch;\r\n\t\tlet result;\r\n\r\n\t\tif (options.formattedNumber) {\r\n\t\t\tresult = options.formattedNumber;\r\n\t\t} else {\r\n\t\t\tconst fixedNumber = numberToFixedDecimals(Math.abs(num), COMMON_DEFAULT_NUMBER_CONSTANTS.DIGITS_AFTER_DECIMAL, fixedIEEE754Format);\r\n\r\n\t\t\tresult = this.prettyNumberFormatter.transform(fixedNumber);\r\n\t\t}\r\n\r\n\t\tif (isNegativeNumber && isNegativeValuesWithParentheses) {\r\n\t\t\tresult = `(${result})`;\r\n\t\t}\r\n\r\n\t\tif (currencySymbol) {\r\n\t\t\tresult = currencySymbol + result;\r\n\t\t}\r\n\r\n\t\tif (isNegativeNumber && !isNegativeValuesWithParentheses) {\r\n\t\t\tresult = '- ' + result;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n}\r\n","export function numberToFixedDecimals (value: number, decimals: number, multiplyResultParseFunc) {\r\n\treturn (Math.ceil(parseInt(multiplyResultParseFunc(value * Math.pow(10, decimals)))) / Math.pow(10, decimals)).toFixed(decimals);\r\n}\r\n","/**\r\n * It is Black Magic\r\n * Used after ALWAYS operation with IEEE754 numbers\r\n *\r\n * 1667.00000000002 -> 1667\r\n * 110.00000000001 -> 110\r\n * (1.51 - 0.4 = 1.1099999999999999) -> 1.11\r\n */\r\nexport function fixedIEEE754Format (num) {\r\n\treturn Math.round(parseFloat((num * 10e8).toFixed(2))) / 10e8;\r\n}\r\n","// New version src/Common/pipes/common-list-formatter.pipe.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_list_formatter_filter.ts\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\nimport {\r\n\tforEach,\r\n\tisString,\r\n\tisObject,\r\n} from 'lodash';\r\nimport { CommonNAFormatPipe } from './common-na-format.pipe';\r\nimport { hasValue } from '@CaseOne/Common/utilities/core.service';\r\n\r\nexport interface ICommonListFormatterPipeOptions {\r\n\tplaceholder?: string,\r\n\tfields?: string[],\r\n}\r\n\r\n@Pipe({\r\n\tname: 'commonListFormatter',\r\n})\r\nexport class CommonListFormatterPipe implements PipeTransform {\r\n\tconstructor (\r\n\t\tprivate commonNAFormatter: CommonNAFormatPipe,\r\n\t) {}\r\n\r\n\ttransform(list: any[], options?: ICommonListFormatterPipeOptions): string {\r\n\t\tconst result = [];\r\n\r\n\t\tforEach(list, (item) => {\r\n\t\t\tconst fields = options?.fields || ['Name'];\r\n\t\t\tlet foundFieldContent = null;\r\n\r\n\t\t\tif (isString(item)) {\r\n\t\t\t\tfoundFieldContent = item;\r\n\t\t\t} else if (isObject(item)) {\r\n\t\t\t\tforEach(fields, (fieldName) => {\r\n\t\t\t\t\tfoundFieldContent = item[fieldName];\r\n\t\t\t\t\treturn !foundFieldContent;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (hasValue(foundFieldContent)) {\r\n\t\t\t\tresult.push(foundFieldContent);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst joinedResult = result.join(', ');\r\n\r\n\t\treturn joinedResult || options?.placeholder || this.commonNAFormatter.transform(joinedResult);\r\n\t}\r\n}\r\n","// New version src/Common/pipes/common-recipients-list-formatter.pipe.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_recipients_list_formatter_filter.ts\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\nimport { CommonListFormatterPipe } from './common-list-formatter.pipe';\r\n\r\n@Pipe({\r\n\tname: 'commonRecipientsListFormatter',\r\n})\r\nexport class CommonRecipientsListFormatterPipe implements PipeTransform {\r\n\tconstructor (\r\n\t\tprivate commonListFormatter: CommonListFormatterPipe,\r\n\t) {}\r\n\r\n\ttransform(list: any[], placeholder: string = ''): string {\r\n\t\treturn this.commonListFormatter.transform(list, {\r\n\t\t\tplaceholder,\r\n\t\t\tfields: ['Name', 'Email'],\r\n\t\t});\r\n\t}\r\n}\r\n","// New version CommonLineToBrPipe src/Common/pipes/common-line-to-br.pipe.ts\r\n// Old version commonLineToBr src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_line_to_br_filter.js\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\n\r\n// Replace \\r\\n on
-tags\r\n@Pipe({\r\n\tname: 'commonLineToBr',\r\n})\r\nexport class CommonLineToBrPipe implements PipeTransform {\r\n\ttransform(data) {\r\n\t\treturn data ? data.replace(/(?:\\r\\n|\\r|\\n)/g, '
') : data;\r\n\t}\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n\tname: 'commonListItemsFilter',\r\n})\r\nexport class CommonListItemsFilterPipe implements PipeTransform {\r\n\ttransform(items: any[], searchFieldName: string, searchFieldValue: string): any[] {\r\n\t\tif (!searchFieldValue || !items || !items.length) {\r\n\t\t\treturn items;\r\n\t\t}\r\n\r\n\t\treturn items.filter((item) => {\r\n\t\t\treturn item[searchFieldName].toLowerCase().includes(searchFieldValue.toLowerCase());\r\n\t\t});\r\n\t}\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\nimport { capitalize } from 'lodash';\r\n\r\nimport { CommonHotkeyService } from '../hotkey/services/hotkey.service';\r\n\r\n@Pipe({\r\n\tname: 'commonHotkeyInfo',\r\n})\r\nexport class CommonHotkeyInfoPipe implements PipeTransform {\r\n\tconstructor(\r\n\t\tprivate commonHotkeyService: CommonHotkeyService,\r\n\t) {}\r\n\r\n\ttransform(text, hotkeyConfigName) {\r\n\t\tlet hotkeyCombo = this.commonHotkeyService.getLocaleHotkeyKey(hotkeyConfigName);\r\n\r\n\t\tif (!hotkeyCombo) {\r\n\t\t\treturn text;\r\n\t\t} else {\r\n\t\t\thotkeyCombo = hotkeyCombo.split('.').map((comboPart) => {\r\n\t\t\t\treturn capitalize(comboPart);\r\n\t\t\t}).join('.');\r\n\t\t}\r\n\r\n\t\treturn `${text} (${hotkeyCombo})`;\r\n\t}\r\n}\r\n","// New version src/Common/pipes/common-percent-formatter.pipe.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_percent_formatter_filter.js\r\n\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\nimport { CommonNumberFormatterPipe } from './common-number-formatter.pipe';\r\n\r\n@Pipe({\r\n\tname: 'commonPercentFormatter',\r\n})\r\nexport class CommonPercentFormatterPipe implements PipeTransform {\r\n\tconstructor (\r\n\t\tprivate numberFormatter: CommonNumberFormatterPipe,\r\n\t) {}\r\n\r\n\ttransform(num: number) {\r\n\t\treturn this.numberFormatter.transform(num, '%');\r\n\t}\r\n}\r\n","// New version src/Common/pipes/common-switch-sign-of-number-formatter.pipe.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/filters/common_switch_sign_of_number_filter.js\r\n\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\nimport { isNumber } from 'lodash';\r\n\r\n@Pipe({\r\n\tname: 'commonSwitchSignOfNumberFormatter',\r\n})\r\nexport class CommonSwitchSignOfNumberFormatterPipe implements PipeTransform {\r\n\ttransform(num: number) {\r\n\t\treturn isNumber(num) && num !== 0 ? num * -1 : num;\r\n\t}\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\r\n\r\n@Pipe({\r\n name: 'commonSafeResourceUrl',\r\n})\r\nexport class CommonSafeResorceUrlPipe implements PipeTransform {\r\n\r\n\tconstructor(\r\n\t\tprivate sanitized: DomSanitizer,\r\n\t) {}\r\n\r\n\ttransform(value: string = ''): SafeUrl {\r\n\t\treturn this.sanitized.bypassSecurityTrustResourceUrl(value);\r\n\t}\r\n\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n\tname: 'commonCapitalize',\r\n})\r\nexport class CommonCapitalizePipe implements PipeTransform {\r\n\ttransform(input: string) {\r\n\t\treturn (!!input && 0 < input.length) ? input.charAt(0).toUpperCase() + input.substr(1) : '';\r\n\t}\r\n}\r\n","import { CommonEscapedBracketReplace } from './escape_bracket_replace.filter';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { CommonHotkeyModule } from '../hotkey/hotkey.module';\r\n\r\nimport { CommonSecondsFormatterPipe } from './seconds_formatter.pipe';\r\nimport { CommonTwoDigitsNumberPipe } from './two_digits_number.pipe';\r\nimport { CommonSafeHtmlPipe } from './safe-html.pipe';\r\nimport { CommonSortByPipe } from './sort-by.pipe';\r\nimport { CommonTitlePipe } from './common-title.pipe';\r\nimport { CommonDatePipe } from './common-date.pipe';\r\nimport { CommonNAFormatPipe } from './common-na-format.pipe';\r\nimport { CommonUtilitiesCore } from '../utilities/core.service';\r\nimport { CommonPrettyNumberPipe } from './common-pretty-number.pipe';\r\nimport { CommonRemoveHtmlTagsPipe } from './common-remove-html-tags.pipe';\r\nimport { CommonNumberFormatterPipe } from './common-number-formatter.pipe';\r\nimport { CommonNumberWithCurrencyFormatterPipe } from './common-number-with-currency-formatter.pipe';\r\nimport { CommonListFormatterPipe } from './common-list-formatter.pipe';\r\nimport { CommonRecipientsListFormatterPipe } from './common-recipients-list-formatter.pipe';\r\nimport { CommonLineToBrPipe } from './common-line-to-br.pipe';\r\nimport { CommonListItemsFilterPipe } from './common-list-items-filter.pipe';\r\nimport { CommonHotkeyInfoPipe } from './common-hotkey-info.pipe';\r\nimport { CommonSafeUrlPipe } from '@CaseOne/Common/pipes/safe-url.pipe';\r\nimport { CommonPercentFormatterPipe } from './common-percent-formatter.pipe';\r\nimport { CommonSwitchSignOfNumberFormatterPipe } from './common-switch-sign-of-number-formatter.pipe';\r\nimport { CommonHtmlStripPipe } from './common-html-strip.pipe';\r\nimport { CommonRouteNamePipe } from './common-route-name.pipe';\r\nimport { CommonSafeResorceUrlPipe } from '@CaseOne/Common/pipes/safe-resorce-url.pipe';\r\nimport { CommonCapitalizePipe } from '@CaseOne/Common/pipes/capitalize.pipe';\r\n\r\n@NgModule({\r\n\tdeclarations: [\r\n\t\tCommonSecondsFormatterPipe,\r\n\t\tCommonTwoDigitsNumberPipe,\r\n\t\tCommonEscapedBracketReplace,\r\n\t\tCommonSafeHtmlPipe,\r\n\t\tCommonSafeUrlPipe,\r\n\t\tCommonSortByPipe,\r\n\t\tCommonTitlePipe,\r\n\t\tCommonDatePipe,\r\n\t\tCommonNAFormatPipe,\r\n\t\tCommonPrettyNumberPipe,\r\n\t\tCommonRemoveHtmlTagsPipe,\r\n\t\tCommonNumberFormatterPipe,\r\n\t\tCommonNumberWithCurrencyFormatterPipe,\r\n\t\tCommonListFormatterPipe,\r\n\t\tCommonRecipientsListFormatterPipe,\r\n\t\tCommonLineToBrPipe,\r\n\t\tCommonListItemsFilterPipe,\r\n\t\tCommonHotkeyInfoPipe,\r\n\t\tCommonPercentFormatterPipe,\r\n\t\tCommonSwitchSignOfNumberFormatterPipe,\r\n\t\tCommonHtmlStripPipe,\r\n\t\tCommonRouteNamePipe,\r\n\t\tCommonSafeResorceUrlPipe,\r\n\t\tCommonCapitalizePipe,\r\n\t],\r\n\texports: [\r\n\t\tCommonSecondsFormatterPipe,\r\n\t\tCommonTwoDigitsNumberPipe,\r\n\t\tCommonEscapedBracketReplace,\r\n\t\tCommonSafeHtmlPipe,\r\n\t\tCommonSafeUrlPipe,\r\n\t\tCommonSortByPipe,\r\n\t\tCommonTitlePipe,\r\n\t\tCommonDatePipe,\r\n\t\tCommonNAFormatPipe,\r\n\t\tCommonPrettyNumberPipe,\r\n\t\tCommonRemoveHtmlTagsPipe,\r\n\t\tCommonNumberFormatterPipe,\r\n\t\tCommonNumberWithCurrencyFormatterPipe,\r\n\t\tCommonListFormatterPipe,\r\n\t\tCommonRecipientsListFormatterPipe,\r\n\t\tCommonLineToBrPipe,\r\n\t\tCommonListItemsFilterPipe,\r\n\t\tCommonHotkeyInfoPipe,\r\n\t\tCommonPercentFormatterPipe,\r\n\t\tCommonSwitchSignOfNumberFormatterPipe,\r\n\t\tCommonHtmlStripPipe,\r\n\t\tCommonRouteNamePipe,\r\n\t\tCommonSafeResorceUrlPipe,\r\n\t\tCommonCapitalizePipe,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonSecondsFormatterPipe,\r\n\t\tCommonTwoDigitsNumberPipe,\r\n\t\tCommonEscapedBracketReplace,\r\n\t\tCommonDatePipe,\r\n\t\tCommonUtilitiesCore,\r\n\t\tCommonNAFormatPipe,\r\n\t\tCommonPrettyNumberPipe,\r\n\t\tCommonNumberFormatterPipe,\r\n\t\tCommonTitlePipe,\r\n\t\tCommonRemoveHtmlTagsPipe,\r\n\t\tCommonNumberWithCurrencyFormatterPipe,\r\n\t\tCommonListFormatterPipe,\r\n\t\tCommonRecipientsListFormatterPipe,\r\n\t\tCommonLineToBrPipe,\r\n\t\tCommonListItemsFilterPipe,\r\n\t\tCommonHotkeyInfoPipe,\r\n\t\tCommonPercentFormatterPipe,\r\n\t\tCommonSwitchSignOfNumberFormatterPipe,\r\n\t\tCommonSafeResorceUrlPipe,\r\n\t\tCommonCapitalizePipe,\r\n\t\tCommonSafeHtmlPipe,\r\n\t],\r\n\timports: [\r\n\t\tCommonHotkeyModule,\r\n\t],\r\n})\r\nexport class CommonPipesModule {}\r\n","// New version src/Common/url_filters/filters_to_url.service.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/services/filters_to_url_service.js\r\n\r\nimport {\r\n\tStateService,\r\n\tTransitionPromise,\r\n} from '@uirouter/core';\r\nimport { Injectable } from '@angular/core';\r\nimport {\r\n\tclone,\r\n\tisObject,\r\n\tisDate,\r\n\tisArray,\r\n\tforOwn,\r\n\tomitBy,\r\n} from 'lodash';\r\n\r\nimport { CommonServerDateService } from '../server_date/server_date.service';\r\n\r\n@Injectable()\r\nexport class CommonFiltersToUrlService {\r\n\tstatic setQueryParam(params, stateService: StateService): TransitionPromise {\r\n\t\treturn stateService.transitionTo(stateService.current, params, {\r\n\t\t\treload: false,\r\n\t\t\tinherit: true,\r\n\t\t});\r\n\t}\r\n\r\n\tconstructor(\r\n\t\tprivate commonServerDateService: CommonServerDateService,\r\n\t\tprivate stateService: StateService,\r\n\t) {}\r\n\r\n\tpublic set(filter, options): TransitionPromise {\r\n\t\tconst newFilter = {};\r\n\t\tfilter = omitBy(clone(filter), (item) => {\r\n\t\t\treturn item === '';\r\n\t\t});\r\n\r\n\t\tfor (let j = 0, len1 = options.length; j < len1; j++) {\r\n\t\t\tconst option = options[j];\r\n\r\n\t\t\tif (option.isObject && filter[option.key]) {\r\n\t\t\t\tconst nonEmptyValue = Object.values(filter[option.key]).find((valueItem) => !!valueItem);\r\n\r\n\t\t\t\tnewFilter[option.key] = nonEmptyValue ? encodeURI(JSON.stringify(filter[option.key])) : null;\r\n\t\t\t} else if (isObject(filter[option.key]) && !isDate(filter[option.key]) && !isArray(filter[option.key])) {\r\n\t\t\t\tforOwn(filter[option.key], (subValue, subKey) => {\r\n\t\t\t\t\tconst { key, value } = this.parseFilters(subKey, option, filter[option.key], option.key);\r\n\t\t\t\t\tnewFilter[key] = value;\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconst { key, value } = this.parseFilters(option.key, option, filter);\r\n\t\t\t\tnewFilter[key] = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn CommonFiltersToUrlService.setQueryParam(newFilter, this.stateService);\r\n\t}\r\n\r\n\tprivate parseFilters(key, option, filter, parentPath?) {\r\n\t\tlet value = clone(filter[key]);\r\n\r\n\t\tif (parentPath) {\r\n\t\t\tkey = parentPath + '.' + key;\r\n\t\t}\r\n\r\n\t\tif (option.isObject && value) {\r\n\t\t\tconst nonEmptyValue = value.find((valueItem) => !!valueItem);\r\n\r\n\t\t\tvalue = nonEmptyValue ? encodeURI(JSON.stringify(value)) : null;\r\n\t\t} else {\r\n\t\t\tif (isArray(value)) {\r\n\t\t\t\tvalue = clone(value);\r\n\r\n\t\t\t\tfor (let i = 0, arrI = 0, arrLen = value.length; arrI < arrLen; i = ++arrI) {\r\n\t\t\t\t\tconst item = value[i];\r\n\r\n\t\t\t\t\tif (item === true) {\r\n\t\t\t\t\t\tvalue[i] = 'true';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (option.isNull && value === null) {\r\n\t\t\t\tvalue = 'null';\r\n\t\t\t}\r\n\r\n\t\t\tif (option.isDate && this.commonServerDateService.isDateString(value)) {\r\n\t\t\t\tvalue = this.commonServerDateService.toDateString(value);\r\n\t\t\t}\r\n\r\n\t\t\treturn { key, value };\r\n\t\t}\r\n\t}\r\n}\r\n","// New version src/Common/url_filters/filters_from_url.service.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/services/filter_from_utl_service.js\r\n\r\nimport { Injectable } from '@angular/core';\r\nimport { UIRouter } from '@uirouter/angular';\r\nimport { LocationServices } from '@uirouter/core';\r\n\r\nimport {\r\n\tset,\r\n\tisArray,\r\n\tuniq,\r\n\tforOwn, isBoolean, isNull,\r\n} from 'lodash';\r\nimport { CommonServerDateService } from '../server_date/server_date.service';\r\n\r\n@Injectable()\r\nexport class CommonFiltersFromUrlService {\r\n\tstatic parseVal(item) {\r\n\t\tswitch (item) {\r\n\t\t\tcase 'true':\r\n\t\t\t\treturn true;\r\n\t\t\tcase 'false':\r\n\t\t\t\treturn false;\r\n\t\t\tcase 'null':\r\n\t\t\t\treturn null;\r\n\t\t\tdefault:\r\n\t\t\t\treturn item;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate locationService: LocationServices;\r\n\r\n\tconstructor(\r\n\t\tprivate commonServerDateService: CommonServerDateService,\r\n\t\tprivate uiRouter: UIRouter,\r\n\t) {\r\n\t\tthis.locationService = this.uiRouter.locationService;\r\n\t}\r\n\r\n\tpublic get(filterNames): any {\r\n\t\tif (filterNames) {\r\n\t\t\tconst result = {};\r\n\r\n\t\t\tforOwn(this.locationService.search(), (value, key) => {\r\n\t\t\t\tfor (let i2 = 0, len = filterNames.length; i2 < len; i2++) {\r\n\t\t\t\t\tconst filter = filterNames[i2];\r\n\r\n\t\t\t\t\tif (key.indexOf(filter.key) === 0) {\r\n\t\t\t\t\t\tif (filter.isArray && !isArray(value)) {\r\n\t\t\t\t\t\t\tvalue = [value];\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (isArray(value)) {\r\n\t\t\t\t\t\t\tfor (let i = 0, j2 = 0, len1 = value.length; j2 < len1; i = ++j2) {\r\n\t\t\t\t\t\t\t\tconst item = value[i];\r\n\r\n\t\t\t\t\t\t\t\tif (typeof item === 'string') {\r\n\t\t\t\t\t\t\t\t\tvalue[i] = CommonFiltersFromUrlService.parseVal(item);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvalue = uniq(value);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (filter.isObject) {\r\n\t\t\t\t\t\t\tvalue = JSON.parse(decodeURI(value));\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (filter.isDate) {\r\n\t\t\t\t\t\t\tif (!this.commonServerDateService.isDateString(value)) {\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (filter.isBoolean) {\r\n\t\t\t\t\t\t\tvalue = CommonFiltersFromUrlService.parseVal(value);\r\n\r\n\t\t\t\t\t\t\tif (!value) {\r\n\t\t\t\t\t\t\t\tvalue = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (typeof value === 'string') {\r\n\t\t\t\t\t\t\tvalue = CommonFiltersFromUrlService.parseVal(value);\r\n\r\n\t\t\t\t\t\t\tif (!isBoolean(value) && !isNull(value)) {\r\n\t\t\t\t\t\t\t\tvalue = decodeURIComponent(value);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tset(result, key, value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { UIRouterModule } from '@uirouter/angular';\r\n\r\nimport { CommonFiltersToUrlService } from './filters_to_url.service';\r\nimport { CommonFiltersFromUrlService } from './filters_from_url.service';\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\tCommonFiltersToUrlService,\r\n\t\tCommonFiltersFromUrlService,\r\n\t],\r\n\timports: [\r\n\t\tCommonModule,\r\n\t\tUIRouterModule.forChild(),\r\n\t],\r\n})\r\nexport class CommonUrlFiltersModule {\r\n}\r\n","import { Injectable, Injector } from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport { COMMON_LOGGER_LOG_LEVEL } from '@CaseOne/Common/logger/logger-log-level.enum';\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonLoggerService {\r\n\tprivate window = this.injector.get(DOCUMENT).defaultView;\r\n\tprivate logger = this.window.initialLogger;\r\n\tprivate logEnabled = !!this.logger;\r\n\r\n\tconstructor(\r\n\t\tprivate injector: Injector,\r\n\t) {}\r\n\r\n\tlog (\r\n\t\tmessage: string,\r\n\t\tlevel: COMMON_LOGGER_LOG_LEVEL,\r\n\t\te?: ErrorEvent,\r\n\t) {\r\n\t\tif (this.logEnabled) {\r\n\t\t\tthis.logger.log(message, level, e);\r\n\t\t}\r\n\t}\r\n\r\n\tlogErrorEvent(e: ErrorEvent) {\r\n\t\tif (this.logEnabled) {\r\n\t\t\tthis.logger.logErrorEvent(e);\r\n\t\t}\r\n\t}\r\n}\r\n","// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/common-exception-handler.ts\r\n// New version src/Common/error-handler.service/error-handler.service.ts\r\n\r\nimport { ErrorHandler, Injectable } from '@angular/core';\r\nimport { CommonLoggerService } from '@CaseOne/Common/logger/common-logger.service';\r\n\r\n@Injectable()\r\nexport class CommonErrorHandlerService implements ErrorHandler {\r\n\tconstructor(\r\n\t\tprivate commonLoggerService: CommonLoggerService,\r\n\t) {}\r\n\r\n\thandleError(error: ErrorEvent) {\r\n\t\t// Ignore cancel request error in promise\r\n\t\tif (!error || !error.message || error.message.indexOf('{\"status\":-1}') === -1) {\r\n\t\t\tconsole.error(error);\r\n\t\t}\r\n\r\n\t\tif (error && error.message && error.message.indexOf('Uncaught (in promise') > -1 && error.message.indexOf('{\"status\":-1}') > -1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.commonLoggerService.logErrorEvent(error);\r\n\t}\r\n}\r\n","import { Inject, Injectable } from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport {\r\n\tStateDeclaration,\r\n\tTransitionService,\r\n\tStateService,\r\n} from '@uirouter/core';\r\nimport { BehaviorSubject } from 'rxjs';\r\nimport {\r\n\tget,\r\n\tmap,\r\n} from 'lodash';\r\n\r\nimport { CommonLocaleService } from '../locale/locale.service';\r\nimport { ICommonBreadcrumb } from './interfaces/breadcrumb.interface';\r\n\r\n\r\nconst PAGE_INITIAL_TITLE_VALUE = '';\r\n\r\n@Injectable()\r\nexport class CommonPageTitleService {\r\n\tpageTitle = new BehaviorSubject(PAGE_INITIAL_TITLE_VALUE);\r\n\tbreadcrumbs = new BehaviorSubject([]);\r\n\r\n\tprivate pageInitialTitle = {\r\n\t\tisSet: false,\r\n\t\tvalue: PAGE_INITIAL_TITLE_VALUE,\r\n\t};\r\n\tprivate isStateWatching = false;\r\n\tprivate staticBreadcrumbs: ICommonBreadcrumb[] = [];\r\n\tprivate asyncBreadcrumbs: ICommonBreadcrumb[] = [];\r\n\r\n\tconstructor(\r\n\t\t@Inject(DOCUMENT) private document: Document,\r\n\t\tprivate commonLocaleService: CommonLocaleService,\r\n\t\tprivate transitionService: TransitionService,\r\n\t\tprivate stateService: StateService,\r\n\t) {}\r\n\r\n\tpublic setTitle (title: string, translationParams: { [key: string]: any } = {}) {\r\n\t\tif (!this.pageInitialTitle.isSet) {\r\n\t\t\tthis.pageInitialTitle.value = this.document.title;\r\n\t\t\tthis.pageInitialTitle.isSet = true;\r\n\t\t}\r\n\r\n\t\tconst translatedTitle = title && title.length ? this.commonLocaleService.instant(title, translationParams) : this.pageInitialTitle.value;\r\n\r\n\t\tdocument.title = translatedTitle;\r\n\t\tthis.pageTitle.next(translatedTitle);\r\n\t}\r\n\r\n\tpublic getTitle(): BehaviorSubject {\r\n\t\treturn this.pageTitle;\r\n\t}\r\n\r\n\tpublic setAsyncBreadcrumbs (breadcrumbs: ICommonBreadcrumb[] = []) {\r\n\t\tthis.asyncBreadcrumbs = breadcrumbs;\r\n\t\tthis.calculateBreadcrumbs();\r\n\t}\r\n\r\n\tpublic getBreadcrumbs(): BehaviorSubject {\r\n\t\treturn this.breadcrumbs;\r\n\t}\r\n\r\n\tpublic startWatchingState() {\r\n\t\tif (this.isStateWatching) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst module = this.getModule();\r\n\r\n\t\tthis.setTitle(module.pageTitle);\r\n\t\tthis.setBreadcrumbs(module.breadcrumbs);\r\n\t\tthis.transitionService.onSuccess({}, (transition) => {\r\n\t\t\tconst toState = transition.to();\r\n\t\t\tconst transitionModule = this.getModule(toState);\r\n\r\n\t\t\tif (!transitionModule.isPageTitleAsync) {\r\n\t\t\t\tthis.setTitle(transitionModule.pageTitle);\r\n\t\t\t}\r\n\r\n\t\t\tif (!transitionModule.isBreadcrumbsAsync) {\r\n\t\t\t\tthis.setAsyncBreadcrumbs([]);\r\n\t\t\t}\r\n\r\n\t\t\tthis.setBreadcrumbs(transitionModule.breadcrumbs);\r\n\t\t});\r\n\t\tthis.isStateWatching = true;\r\n\t}\r\n\r\n\tprivate getModule(state?: StateDeclaration) {\r\n\t\tif (!get(state, 'name')) {\r\n\t\t\tstate = this.stateService.current;\r\n\t\t}\r\n\r\n\t\treturn state.data || {};\r\n\t}\r\n\r\n\tprivate setBreadcrumbs(breadcrumbs: ICommonBreadcrumb[] = []) {\r\n\t\tthis.staticBreadcrumbs = map(breadcrumbs, (breadcrumb) => {\r\n\t\t\tif (get(breadcrumb, 'name.length')) {\r\n\t\t\t\tbreadcrumb.name = this.commonLocaleService.instant(breadcrumb.name);\r\n\t\t\t}\r\n\r\n\t\t\treturn breadcrumb;\r\n\t\t});\r\n\t\tthis.calculateBreadcrumbs();\r\n\t}\r\n\r\n\tprivate calculateBreadcrumbs() {\r\n\t\tthis.breadcrumbs.next(this.staticBreadcrumbs.concat(this.asyncBreadcrumbs));\r\n\t}\r\n}\r\n","import { NgModule } from '@angular/core';\r\n\r\nimport { CommonLocaleModule } from '../locale/locale.module';\r\nimport { CommonPageTitleService } from './page-title.service';\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\tCommonPageTitleService,\r\n\t],\r\n\timports: [\r\n\t\tCommonLocaleModule,\r\n\t],\r\n})\r\nexport class CommonPageTitleModule {}\r\n","import { NgModule } from '@angular/core';\r\n\r\nimport { CommonContentWrapperService } from './common-content-wrapper.service';\r\nimport { CommonContentWrapperComponent } from './common-content-wrapper.component/common-content-wrapper.component';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t],\r\n\tproviders: [\r\n\t\tCommonContentWrapperService,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonContentWrapperComponent,\r\n\t],\r\n\texports: [\r\n\t\tCommonContentWrapperComponent,\r\n\t],\r\n\tentryComponents: [\r\n\t\tCommonContentWrapperComponent,\r\n\t],\r\n})\r\nexport class CommonContentWrapperModule {}\r\n","import { ICommonUser } from './user_data.service';\r\n\r\nexport class UserDataUpgradedService {\r\n\tsetUserDataInfo(value, key?) {\r\n\t\t// Non-empty block\r\n\t}\r\n\r\n\tgetUserDataInfo(): ICommonUser;\r\n\tgetUserDataInfo(key?): any {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tgetUserAvatarUrl(id, mode?) {\r\n\t\t// Non-empty block\r\n\t}\r\n\r\n\tgetUserForSuggest() {\r\n\t\t// Non-empty block\r\n\t}\r\n}\r\n\r\nexport const UserDataUpgradedServiceProvider = {\r\n\tprovide: UserDataUpgradedService,\r\n\tuseFactory: ($injector) => $injector.get('UserDataService'),\r\n\tdeps: ['$injector'],\r\n};\r\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\r\nimport * as FontFaceObserver from 'fontfaceobserver';\r\n\r\ndeclare const COMPONENT_SPECS_MODE: boolean;\r\n\r\nexport function initFonts () {\r\n\treturn () => {\r\n\t\tif (!COMPONENT_SPECS_MODE) {\r\n\t\t\tconst FONT_LOADING_TIMEOUT = 60000;\r\n\r\n\t\t\treturn Promise.all([\r\n\t\t\t\tnew FontFaceObserver('Roboto', { weight: 400 }).load(null, FONT_LOADING_TIMEOUT),\r\n\t\t\t\tnew FontFaceObserver('Roboto', { weight: 500 }).load(null, FONT_LOADING_TIMEOUT),\r\n\t\t\t\tnew FontFaceObserver('Roboto', { weight: 700 }).load(null, FONT_LOADING_TIMEOUT),\r\n\t\t\t]);\r\n\t\t}\r\n\t};\r\n}\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\t{\r\n\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\tuseFactory: initFonts,\r\n\t\t\tmulti: true,\r\n\t\t\tdeps: [],\r\n\t\t},\r\n\t],\r\n})\r\nexport class CommonAppFontsModule {}\r\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\r\nimport { CommonAppDataService, commonAppDataServiceFactory } from './app_data.service';\r\n\r\nexport function initCommonAppDataService (\r\n\tcommonAppDataService: CommonAppDataService,\r\n) {\r\n\treturn () => {\r\n\t\treturn commonAppDataService.init().toPromise();\r\n\t};\r\n}\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\t{\r\n\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\tuseFactory: initCommonAppDataService,\r\n\t\t\tmulti: true,\r\n\t\t\tdeps: [\r\n\t\t\t\tCommonAppDataService,\r\n\t\t\t],\r\n\t\t},\r\n\t\t{\r\n\t\t\tprovide: CommonAppDataService,\r\n\t\t\tuseFactory: commonAppDataServiceFactory,\r\n\t\t},\r\n\t],\r\n})\r\nexport class CommonAppDataModule {}\r\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\r\nimport { CommonUserDataService } from './user_data.service';\r\nimport { COMMON_APP_CONFIG, ICommonAppConfig } from '../app/app.config.token';\r\n\r\nexport function initCommonUserDataService (\r\n\tcommonUserDataService: CommonUserDataService,\r\n\tappConfig: ICommonAppConfig,\r\n) {\r\n\treturn () => {\r\n\t\treturn commonUserDataService.init(appConfig.shouldAuthorize).toPromise();\r\n\t};\r\n}\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\t{\r\n\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\tuseFactory: initCommonUserDataService,\r\n\t\t\tmulti: true,\r\n\t\t\tdeps: [\r\n\t\t\t\tCommonUserDataService,\r\n\t\t\t\tCOMMON_APP_CONFIG,\r\n\t\t\t],\r\n\t\t},\r\n\t],\r\n})\r\nexport class CommonUserDataModule {}\r\n","export enum COMMON_HTTP_METHOD_TYPE {\r\n\tGET = 'GET',\r\n\tPOST = 'POST',\r\n\tPUT = 'PUT',\r\n\tDELETE = 'DELETE',\r\n}\r\n","import { ICommonListResourceServiceQueryData } from './common-base-list-resource.service';\r\n\r\nexport const COMMON_LIST_RESOURCE_DEFAULT_REQUEST_PARAMS: ICommonListResourceServiceQueryData = {\r\n\tPage: 1,\r\n\tPageSize: 20,\r\n};\r\n","// Old version AutocompleteService src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/services/autocomplete_service_factory.js\r\n// New version CommonBaseListResourceService src/Common/base-list-resource.service/common-base-list-resource.service.ts\r\n\r\nimport { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';\r\nimport { defaults, filter, isArray, isNil, isObject, isString, map as lodashMap, trim, unset } from 'lodash';\r\nimport { map as rxjsMap } from 'rxjs/operators';\r\n\r\nimport { ICommonResponse } from '../interfaces/response';\r\nimport {\r\n\tcancelObservableRequestPolyfill,\r\n\tIPromiseWithCancel,\r\n} from '../utilities/core.service';\r\nimport { COMMON_HTTP_METHOD_TYPE } from '../interfaces/common-http-method-type.enum';\r\n// Default params for request in all services\r\nimport { COMMON_LIST_RESOURCE_DEFAULT_REQUEST_PARAMS } from './common-base-list-resource-default-request-params.constant';\r\nimport { UUID } from '../interfaces/core';\r\nimport { Injectable } from '@angular/core';\r\n\r\nexport interface ICommonListResourceService {\r\n\tget: (data?: ICommonListResourceServiceQueryData) => IPromiseWithCancel>\r\n}\r\n\r\nexport interface ICommonListResourceServiceQueryData {\r\n\tName?: string,\r\n\tIds?: Array,\r\n\tIgnoreIds?: Array,\r\n\tIgnoreValues?: string[],\r\n\tPageSize?: number,\r\n\tPage?: number,\r\n\t[key: string]: any,\r\n}\r\n\r\nexport interface ICommonBaseListResourceServiceOptions {\r\n\turl?: string,\r\n\tmethod?: COMMON_HTTP_METHOD_TYPE,\r\n\theaders?: string | { // values for HttpHeaders\r\n\t\t[name: string]: string | string[];\r\n\t},\r\n\tcancellable?: boolean,\r\n\tdefaultRequestParams?: Partial,\r\n}\r\n\r\n// Base class for creating resource services for item list\r\n@Injectable()\r\nexport class CommonBaseListResourceService<\r\n\t\tItemType = any,\r\n\t\tQueryDataType extends ICommonListResourceServiceQueryData = ICommonListResourceServiceQueryData\r\n\t> implements ICommonListResourceService {\r\n\turl: string = ''; // Serve api url for request\r\n\tmethod: COMMON_HTTP_METHOD_TYPE = COMMON_HTTP_METHOD_TYPE.POST; // Request http method\r\n\theaders?: string | { // values for HttpHeaders\r\n\t\t[name: string]: string | string[];\r\n\t};\r\n\tcancellable: boolean = true; // cancel previous request\r\n\tdefaultRequestParams: Partial; // Default params for request in instance service\r\n\r\n\tprivate previousRequest: IPromiseWithCancel>;\r\n\r\n\tconstructor(\r\n\t\tprivate httpClient: HttpClient,\r\n\t) {}\r\n\r\n\tsetConfig(options: ICommonBaseListResourceServiceOptions) {\r\n\t\tthis.url = options.url || this.url;\r\n\t\tthis.method = options.method || this.method;\r\n\t\tthis.headers = options.headers || this.headers;\r\n\t\tthis.cancellable = options.cancellable !== undefined ? options.cancellable : this.cancellable;\r\n\t\tthis.defaultRequestParams = options.defaultRequestParams || this.defaultRequestParams;\r\n\t}\r\n\r\n\tget(requestParams?: QueryDataType): IPromiseWithCancel> {\r\n\t\tconst passDataToRequestThoughBody = [COMMON_HTTP_METHOD_TYPE.POST, COMMON_HTTP_METHOD_TYPE.PUT].includes(this.method);\r\n\t\tconst passDataToRequestThoughParams = [COMMON_HTTP_METHOD_TYPE.GET, COMMON_HTTP_METHOD_TYPE.DELETE].includes(this.method);\r\n\t\trequestParams = defaults(requestParams, this.defaultRequestParams, COMMON_LIST_RESOURCE_DEFAULT_REQUEST_PARAMS);\r\n\r\n\t\tthis.prepareRequestParams(requestParams);\r\n\r\n\t\tif (this.cancellable && this.previousRequest) {\r\n\t\t\tthis.previousRequest.$cancelRequest();\r\n\t\t}\r\n\r\n\t\tconst request = this.httpClient\r\n\t\t\t.request>(\r\n\t\t\t\tthis.method,\r\n\t\t\t\tthis.url,\r\n\t\t\t\t{\r\n\t\t\t\t\tresponseType: 'json',\r\n\t\t\t\t\theaders: this.headers ? new HttpHeaders(this.headers) : null,\r\n\t\t\t\t\tparams: passDataToRequestThoughParams\r\n\t\t\t\t\t\t? new HttpParams({\r\n\t\t\t\t\t\t\t\tfromObject: requestParams,\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t: null,\r\n\t\t\t\t\tbody: passDataToRequestThoughBody ? requestParams : null,\r\n\t\t\t\t},\r\n\t\t\t)\r\n\t\t\t.pipe(rxjsMap(\r\n\t\t\t\t(response) => {\r\n\t\t\t\t\tif (!isArray(response)) {\r\n\t\t\t\t\t\tresponse = response || {} as ICommonResponse;\r\n\t\t\t\t\t\tresponse.Result = response.Result || [];\r\n\t\t\t\t\t\tresponse.Result = lodashMap(response.Result, (item) => {\r\n\t\t\t\t\t\t\tif (isObject(item) && !isString((item as any).Name)) {\r\n\t\t\t\t\t\t\t\t(item as any).Name = '';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// else do nothing\r\n\r\n\t\t\t\t\t\t\treturn item;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn response;\r\n\t\t\t\t},\r\n\t\t\t))\r\n\t\t\t.pipe(rxjsMap(\r\n\t\t\t\t(response) => this.formatter(response),\r\n\t\t\t));\r\n\r\n\t\tthis.previousRequest = cancelObservableRequestPolyfill(request);\r\n\r\n\t\treturn this.previousRequest;\r\n\t}\r\n\r\n\t// Formatter for response\r\n\tformatter(response: any): ICommonResponse {\r\n\t\treturn response;\r\n\t}\r\n\r\n\t// moved form old logic\r\n\tprepareRequestParams(requestParams) {\r\n\t\tif (requestParams._ignoreItemsToIds) {\r\n\t\t\tconst ignoreIds = filter(lodashMap(requestParams._ignoreItemsToIds, requestParams._ignoreItemsToIdsFieldPath || 'Id'), (item) => {\r\n\t\t\t\treturn !isNil(item);\r\n\t\t\t});\r\n\t\t\tunset(requestParams, '_ignoreItemsToIds');\r\n\t\t\tunset(requestParams, '_ignoreItemsToIdsFieldPath');\r\n\r\n\t\t\tif (isArray(requestParams.IgnoreIds)) {\r\n\t\t\t\trequestParams.IgnoreIds = requestParams.IgnoreIds.concat(ignoreIds);\r\n\t\t\t} else {\r\n\t\t\t\trequestParams.IgnoreIds = ignoreIds;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// else do nothing\r\n\r\n\t\tif (requestParams.Name) {\r\n\t\t\trequestParams.Name = trim(requestParams.Name);\r\n\t\t}\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CommonBaseListResourceService } from '../../../base-list-resource.service/common-base-list-resource.service';\r\nimport { COMMON_HTTP_METHOD_TYPE } from '../../../interfaces/common-http-method-type.enum';\r\nimport { ICommonGeneralSettingsDaysOfWeekModel } from '../interfaces/general-settings-days-of-week-model.interface';\r\nimport { ICommonResponse } from '../../../interfaces/response';\r\n\r\n@Injectable()\r\nexport class CommonGeneralSettingsDaysOfWeekResourceService extends CommonBaseListResourceService {\r\n\turl = 'api/daysOfWeek/GetDaysOfWeek';\r\n\tmethod = COMMON_HTTP_METHOD_TYPE.GET;\r\n\r\n\t// Back-end returns in response only collection (without IsSuccess, Result etc..)\r\n\tformatter(response: ICommonGeneralSettingsDaysOfWeekModel[]): ICommonResponse {\r\n\t\treturn {\r\n\t\t\tIsSuccess: true,\r\n\t\t\tResult: response || [],\r\n\t\t} as ICommonResponse;\r\n\t}\r\n}\r\n","// Old version CommonDictionaryItemsAutocompleteServiceForDropdown src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/services/common_services_custom_dictionaries_module/common_dictionary_items_autocomplete_service_for_dropdown_service.js\r\n// New version CommonBaseDictionaryService src/Common/controls/base-dictionary.service/common-base-dictionary.service.ts\r\n\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { cloneDeep, each, defaults, keys, clone } from 'lodash';\r\n\r\nimport {\r\n\tCommonBaseListResourceService,\r\n\tICommonListResourceService,\r\n\tICommonListResourceServiceQueryData,\r\n} from '../../base-list-resource.service/common-base-list-resource.service';\r\nimport {\r\n\tICommonResponse,\r\n} from '../../interfaces/response';\r\nimport {\r\n\tcancelRequestPolyfill,\r\n\tIPromiseWithCancel,\r\n} from '../../utilities/core.service';\r\nimport { DateString, UUID } from '../../interfaces/core';\r\nimport { Injectable, Injector } from '@angular/core';\r\nimport { COMMON_HTTP_METHOD_TYPE } from '@CaseOne/Common/interfaces/common-http-method-type.enum';\r\n\r\nexport const COMMON_BASE_DICTIONARY_AUTOCOMPLETE_URL = 'api/dictionary/getdictionaryitems';\r\n\r\nexport interface ICommonBaseDictionaryItem {\r\n\tAuthorId: UUID,\r\n\tCreationDate: DateString,\r\n\tId: UUID,\r\n\tIsCustom: boolean,\r\n\tIsLeaf: boolean,\r\n\tItems: ICommonBaseDictionaryItem[],\r\n\tLastChangeDate: DateString,\r\n\tLastModifedByUserId: UUID, // TODO back-end mistake\r\n\tLevel: number,\r\n\tName: string,\r\n\tNextPageExists: boolean,\r\n\tOpened: boolean,\r\n\tPage: number,\r\n\tParentId: UUID,\r\n\tSysName: string,\r\n}\r\n\r\n// From the class CommonBaseDictionaryService should be inherited services singletons (inRoot), which will cache the values of directories\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonBaseDictionaryService implements ICommonListResourceService {\r\n\tname: string = ''; // Use as SysName in request through default service\r\n\tisTree: boolean = false; // If true, will use `treeFormatter`\r\n\tuseCache: boolean = true; // It true, service will getting items from cache\r\n\tsrcService: ICommonListResourceService; // Custom service for getting items\r\n\turl: string = COMMON_BASE_DICTIONARY_AUTOCOMPLETE_URL; // Url for ListResourceService\r\n\tmethod: COMMON_HTTP_METHOD_TYPE;\r\n\tcacheFieldName = 'SystemName';\r\n\r\n\tprivate requestCacheMap: Map>> = new Map();\r\n\r\n\tconstructor(\r\n\t\tprivate httpClient: HttpClient,\r\n\t\tpublic injector: Injector,\r\n\t) {\r\n\t\t//\r\n\t}\r\n\r\n\t// Method for getting items list from server/cache\r\n\tget(data: ICommonListResourceServiceQueryData = {}): IPromiseWithCancel> {\r\n\t\tconst sysName: string = data[this.cacheFieldName] || this.name;\r\n\r\n\t\tif (!sysName) {\r\n\t\t\tthrow new Error(`sysName is not defined, set it as ${this.cacheFieldName} in query data or define \"name\" property of service`);\r\n\t\t}\r\n\r\n\t\tconst isClearRequest = this.isClearRequest(data);\r\n\t\tconst requestData = defaults({}, data, {\r\n\t\t\t[this.cacheFieldName]: sysName,\r\n\t\t\tPage: 1,\r\n\t\t\tPageSize: 100500,\r\n\t\t});\r\n\t\tlet requestPromise: IPromiseWithCancel>;\r\n\t\tconst formatFunctions = [\r\n\t\t\tthis.formatter,\r\n\t\t];\r\n\r\n\t\tif (this.isTree) {\r\n\t\t\tformatFunctions.push(this.treeFormatter);\r\n\t\t}\r\n\r\n\t\tif (this.useCache && isClearRequest) {\r\n\t\t\trequestPromise = this.checkCache(sysName, requestData, formatFunctions);\r\n\t\t} else {\r\n\t\t\tthis.initSrcService();\r\n\t\t\trequestPromise = this.srcService.get(requestData);\r\n\t\t\trequestPromise = this.applyFormatters(requestPromise, formatFunctions);\r\n\t\t}\r\n\r\n\t\treturn requestPromise;\r\n\t}\r\n\r\n\tgetDictionaries (names: string[]): Promise>> {\r\n\t\tconst promises = names.map((sysName) => {\r\n\t\t\treturn this.get({\r\n\t\t\t\t[this.cacheFieldName]: sysName,\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\treturn Promise.all(promises);\r\n\t}\r\n\r\n\t// Formatter for response from service\r\n\tformatter(response: ICommonResponse): ICommonResponse {\r\n\t\treturn response;\r\n\t}\r\n\r\n\tcheckCache>(\r\n\t\tcacheKey: string,\r\n\t\tdata: ICommonListResourceServiceQueryData,\r\n\t\tformatters: Array<(response: T) => T>,\r\n\t): IPromiseWithCancel {\r\n\t\tlet requestFromCache = this.requestCacheMap.get(cacheKey);\r\n\t\tlet serviceRequest;\r\n\r\n\t\tif (!requestFromCache) {\r\n\t\t\tthis.initSrcService();\r\n\t\t\tserviceRequest = this.srcService.get(data);\r\n\t\t\trequestFromCache = cancelRequestPolyfill(\r\n\t\t\t\tthis.applyFormatters(serviceRequest, formatters)\r\n\t\t\t\t\t.catch((response) => {\r\n\t\t\t\t\t\tthis.requestCacheMap.delete(cacheKey);\r\n\t\t\t\t\t\treturn Promise.reject(response);\r\n\t\t\t\t\t}),\r\n\t\t\t);\r\n\r\n\t\t\tthis.requestCacheMap.set(cacheKey, requestFromCache);\r\n\t\t}\r\n\r\n\t\treturn cancelRequestPolyfill(\r\n\t\t\trequestFromCache\r\n\t\t\t\t.then((response: T) => {\r\n\t\t\t\t\treturn cloneDeep(response);\r\n\t\t\t\t}),\r\n\t\t);\r\n\t}\r\n\r\n\tprotected isClearRequest(data: ICommonListResourceServiceQueryData): boolean {\r\n\t\tconst cloneData = clone(data);\r\n\r\n\t\tdelete cloneData[this.cacheFieldName]; // it isnt important for caching\r\n\r\n\t\tif (cloneData.Name === '' || cloneData.Name === null) {\r\n\t\t\tdelete cloneData.Name;\r\n\t\t}\r\n\r\n\t\tconst dataKeys = keys(cloneData);\r\n\t\tconst dontHaveFields = dataKeys.length === 0;\r\n\t\tconst hasDefaultPaging = dataKeys.length === 2 && cloneData.Page === 1 && cloneData.PageSize === 100500;\r\n\r\n\t\treturn dontHaveFields || hasDefaultPaging;\r\n\t}\r\n\r\n\t// Unwraps tree\r\n\tprivate treeFormatter (response: T): T {\r\n\t\tconst items = [];\r\n\r\n\t\teach(response.Result, (group) => {\r\n\t\t\teach(group.Items, (item) => {\r\n\t\t\t\titem.Group = group;\r\n\t\t\t\titems.push(item);\r\n\t\t\t});\r\n\r\n\t\t\tdelete group.Items;\r\n\t\t});\r\n\t\tresponse.Result = items;\r\n\r\n\t\treturn response;\r\n\t}\r\n\r\n\tprivate applyFormatters>(\r\n\t\trequestPromise: IPromiseWithCancel,\r\n\t\tformatters: Array<(response: T) => T>,\r\n\t): IPromiseWithCancel {\r\n\t\teach(formatters, (formatter) => {\r\n\t\t\trequestPromise = cancelRequestPolyfill(requestPromise.then(formatter));\r\n\t\t});\r\n\r\n\t\treturn requestPromise;\r\n\t}\r\n\r\n\tprivate initSrcService() {\r\n\t\tif (!this.srcService) {\r\n\t\t\tthis.srcService = new CommonBaseListResourceService(this.httpClient);\r\n\t\t\t(this.srcService as CommonBaseListResourceService).setConfig({\r\n\t\t\t\turl: this.url,\r\n\t\t\t\tmethod: this.method,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CommonGeneralSettingsDaysOfWeekResourceService } from './general-settings-days-of-week-resource.service';\r\nimport { CommonBaseDictionaryService } from '../../../controls/base-dictionary.service/common-base-dictionary.service';\r\nimport { ICommonGeneralSettingsDaysOfWeekModel } from '../interfaces/general-settings-days-of-week-model.interface';\r\n\r\n@Injectable()\r\nexport class CommonGeneralSettingsDaysOfWeekDictionaryService extends CommonBaseDictionaryService {\r\n\tsrcService = this.injector.get(CommonGeneralSettingsDaysOfWeekResourceService);\r\n\tname = 'GeneralSettingsDaysOfWeek';\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonGeneralSettingsDaysOfWeekDictionaryService } from './services/general-settings-days-of-week-dictionary.service';\r\nimport { CommonGeneralSettingsDaysOfWeekResourceService } from './services/general-settings-days-of-week-resource.service';\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\tCommonGeneralSettingsDaysOfWeekDictionaryService,\r\n\t\tCommonGeneralSettingsDaysOfWeekResourceService,\r\n\t],\r\n})\r\nexport class CommonGeneralSettingsDaysOfWeekModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonGeneralSettingsService } from './general_settings.service';\r\nimport { CommonGeneralSettingsDaysOfWeekModule } from './days-of-week/general-settings-days-of-week.module';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonGeneralSettingsDaysOfWeekModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonGeneralSettingsDaysOfWeekModule,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonGeneralSettingsService,\r\n\t],\r\n})\r\nexport class CommonGeneralSettingsModule {}\r\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\r\nimport { CommonServerDateService } from './server_date.service';\r\n\r\ndeclare const COMPONENT_SPECS_MODE: boolean;\r\n\r\nexport function initCommonServerDateService (\r\n\tcommonServerDateService: CommonServerDateService,\r\n) {\r\n\treturn () => {\r\n\t\tif (!COMPONENT_SPECS_MODE) { // until https://github.com/angular/angular/issues/24218 is fixed\r\n\t\t\treturn commonServerDateService.init();\r\n\t\t}\r\n\t};\r\n}\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\tCommonServerDateService,\r\n\t\t{\r\n\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\tuseFactory: initCommonServerDateService,\r\n\t\t\tmulti: true,\r\n\t\t\tdeps: [\r\n\t\t\t\tCommonServerDateService,\r\n\t\t\t],\r\n\t\t},\r\n\t],\r\n})\r\nexport class CommonServerDateModule {}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { CommonAppDataService } from '../app_data/app_data.service';\r\n\r\n@Injectable()\r\nexport class CommonSharedLinkInterceptor implements HttpInterceptor {\r\n\tprivate readonly appData = this.commonAppDataService.getData();\r\n\r\n\tconstructor(\r\n\t\tprivate commonAppDataService: CommonAppDataService,\r\n\t) {}\r\n\r\n\tintercept(req: HttpRequest, next: HttpHandler): Observable> {\r\n\r\n\t\tif (this.appData.LinkToken) {\r\n\t\t\tconst cloneReq: HttpRequest = req.clone({\r\n\t\t\t\theaders: req.headers.set('X-LinkTo', this.appData.LinkToken)\r\n\t\t\t});\r\n\t\t\treturn next.handle(cloneReq);\r\n\t\t}\r\n\t\treturn next.handle(req);\r\n\t}\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\n\r\n@Injectable()\r\nexport class CommonHeadersInterceptor implements HttpInterceptor {\r\n\tintercept(req: HttpRequest, next: HttpHandler): Observable> {\r\n\t\tconst cloneReq: HttpRequest = req.clone({\r\n\t\t\theaders: req.headers.set('X-Request-Application', 'Front'), // used inside WF scripts CASEM-64104\r\n\t\t});\r\n\t\treturn next.handle(cloneReq);\r\n\t}\r\n}\r\n","import {\r\n\tdefaults,\r\n\tcloneDeep,\r\n} from 'lodash';\r\n\r\nimport { ICommonResourceAction } from './interfaces/resource-action.interface';\r\nimport { COMMON_HTTP_METHOD_TYPE } from '../interfaces/common-http-method-type.enum';\r\nimport { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';\r\nimport { Observable, of, throwError, BehaviorSubject } from 'rxjs';\r\nimport { catchError, filter, share, switchAll, tap } from 'rxjs/operators';\r\nimport { CommonBaseService } from '../common-base-service.class/common-base-service.class';\r\nimport { Injectable } from '@angular/core';\r\n\r\nconst MANUAL_REQUEST_REJECT_ERROR = 'MANUAL_REQUEST_REJECT_ERROR';\r\n\r\n// Base class for creating resource services\r\n@Injectable()\r\nexport class CommonResource extends CommonBaseService {\r\n\tprotected httpClient = this.injector.get(HttpClient);\r\n\tprivate requestsMap = new Map();\r\n\r\n\t$action (\r\n\t\tname: string,\r\n\t\tquery: Query,\r\n\t\toptions: ICommonResourceAction,\r\n\t): Observable {\r\n\t\toptions = defaults(cloneDeep(options), {\r\n\t\t\tmethod: COMMON_HTTP_METHOD_TYPE.GET,\r\n\t\t\tquery: {},\r\n\t\t\tcancelPrevRequest: false,\r\n\t\t});\r\n\r\n\t\tquery = defaults(cloneDeep(query), options.query);\r\n\r\n\t\tconst passDataToRequestThroughBody = options.passDataToRequestThroughBody ||\r\n\t\t\t([COMMON_HTTP_METHOD_TYPE.POST, COMMON_HTTP_METHOD_TYPE.PUT].includes(options.method) && !options.passDataToRequestThroughParams);\r\n\t\tconst passDataToRequestThroughParams = options.passDataToRequestThroughParams ||\r\n\t\t\t([COMMON_HTTP_METHOD_TYPE.GET, COMMON_HTTP_METHOD_TYPE.DELETE].includes(options.method) && !options.passDataToRequestThroughBody);\r\n\t\tconst createRequest = (): Observable => {\r\n\t\t\treturn this.httpClient\r\n\t\t\t\t.request(\r\n\t\t\t\t\toptions.method,\r\n\t\t\t\t\toptions.url,\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tresponseType: 'json',\r\n\t\t\t\t\t\theaders: options.headers ? new HttpHeaders(options.headers) : null,\r\n\t\t\t\t\t\tparams: passDataToRequestThroughParams\r\n\t\t\t\t\t\t\t? new HttpParams({\r\n\t\t\t\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\t\t\t\tfromObject: query,\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t: null,\r\n\t\t\t\t\t\tbody: passDataToRequestThroughBody ? query : null,\r\n\t\t\t\t\t},\r\n\t\t\t\t);\r\n\t\t};\r\n\r\n\t\tlet response$;\r\n\r\n\t\tif (options.cancelPrevRequest) {\r\n\t\t\tconst prevRequest$: BehaviorSubject> = this.requestsMap.get(name);\r\n\r\n\t\t\tif (prevRequest$) {\r\n\t\t\t\tprevRequest$.error(MANUAL_REQUEST_REJECT_ERROR);\r\n\t\t\t\tprevRequest$.complete();\r\n\t\t\t}\r\n\r\n\t\t\tconst newRequest: BehaviorSubject> = new BehaviorSubject>(null);\r\n\t\t\tresponse$ = newRequest.pipe(\r\n\t\t\t\tswitchAll(),\r\n\t\t\t\tcatchError((err) => {\r\n\t\t\t\t\treturn err === MANUAL_REQUEST_REJECT_ERROR ? of(null) : throwError(err);\r\n\t\t\t\t}),\r\n\t\t\t\tfilter((value) => !!value),\r\n\t\t\t\ttap(() => {\r\n\t\t\t\t\tnewRequest.complete();\r\n\t\t\t\t\tthis.requestsMap.delete(name);\r\n\t\t\t\t}),\r\n\t\t\t);\r\n\r\n\t\t\tthis.requestsMap.set(name, newRequest);\r\n\r\n\t\t\tnewRequest.next(createRequest());\r\n\t\t} else {\r\n\t\t\tresponse$ = createRequest();\r\n\t\t}\r\n\r\n\t\treturn response$.pipe(share());\r\n\t}\r\n}\r\n","import { ICommonResourceAction } from '../interfaces/resource-action.interface';\r\nimport { CommonResource } from '../resource.class';\r\nimport { ICommonResourceMethod } from '../interfaces/resource-method.interface';\r\nimport { each } from 'lodash';\r\n\r\nexport function CommonResourceAction (\r\n\toptions: ICommonResourceAction,\r\n) {\r\n\r\n\t// tslint:disable-next-line:only-arrow-functions\r\n\treturn function (\r\n\t\ttarget: CommonResource,\r\n\t\tpropertyKey: string,\r\n\t) {\r\n\t\tconst actionMethod = function (query) {\r\n\t\t\teach(options.queryFormatters, (formatter) => {\r\n\t\t\t\tquery = formatter.bind(this)(query);\r\n\t\t\t});\r\n\r\n\t\t\tlet response$ = this.$action(\r\n\t\t\t\tpropertyKey,\r\n\t\t\t\tquery,\r\n\t\t\t\toptions,\r\n\t\t\t);\r\n\r\n\t\t\teach(options.parsers, (parser) => {\r\n\t\t\t\tresponse$ = parser.bind(this)(response$);\r\n\t\t\t});\r\n\r\n\t\t\treturn response$;\r\n\t\t} as ICommonResourceMethod;\r\n\r\n\t\ttarget[propertyKey] = function (...args: any[]) {\r\n\t\t\treturn actionMethod.apply(this, args);\r\n\t\t};\r\n\t};\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CommonResource } from '@CaseOne/Common/resource/resource.class';\r\nimport { CommonResourceAction } from '@CaseOne/Common/resource/decorators/resource-action.decorator';\r\nimport { COMMON_HTTP_METHOD_TYPE } from '@CaseOne/Common/interfaces/common-http-method-type.enum';\r\nimport { ICommonResourceMethod } from '@CaseOne/Common/resource/interfaces/resource-method.interface';\r\nimport { ICommonResponse } from '@CaseOne/Common/interfaces/response';\r\nimport { ICommonCheckInactiveSessionResponse } from '@CaseOne/Common/common-check-inactive/types';\r\n\r\n@Injectable()\r\nexport class CommonCheckInactiveResourceService extends CommonResource {\r\n\t@CommonResourceAction({\r\n\t\turl: 'api/session/checkSession',\r\n\t\tmethod: COMMON_HTTP_METHOD_TYPE.GET,\r\n\t})\r\n\tcheckSession: ICommonResourceMethod>;\r\n\r\n\t@CommonResourceAction({\r\n\t\turl: 'api/session/ping',\r\n\t\tmethod: COMMON_HTTP_METHOD_TYPE.GET,\r\n\t})\r\n\tping: ICommonResourceMethod;\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport * as InactiveJS from 'inactivejs';\r\nimport { CommonBaseService } from '@CaseOne/Common/common-base-service.class/common-base-service.class';\r\nimport { CommonAppDataService } from '@CaseOne/Common/app_data/app_data.service';\r\nimport { CommonCheckInactiveResourceService } from '@CaseOne/Common/common-check-inactive/services/common-check-inactive-resource.service';\r\nimport { Observable, throwError } from 'rxjs';\r\nimport { catchError } from 'rxjs/operators';\r\n\r\n\r\n@Injectable()\r\nexport class CommonCheckInactiveService extends CommonBaseService {\r\n\tprivate commonAppDataService = this.injector.get(CommonAppDataService);\r\n\tprivate commonCheckInactiveResourceService = this.injector.get(CommonCheckInactiveResourceService);\r\n\r\n\tprivate pingPeriod: number = this.commonAppDataService.getData().PingPeriod;\r\n\tprivate timeoutForClear: NodeJS.Timeout;\r\n\tprivate isActive: boolean = true; // indicate that user is active in browser\r\n\tprivate isWaitingCheckStatus: boolean = false; // indicate that client is waiting next check status request\r\n\tprivate inactiveInstance: InactiveJS;\r\n\r\n\tstart () {\r\n\t\tif (this.isActiveService()) {\r\n\t\t\tthis.inactiveInstance = new InactiveJS({\r\n\t\t\t\ttimeout: this.pingPeriod,\r\n\t\t\t\tonAway: () => {\r\n\t\t\t\t\tthis.onAway();\r\n\t\t\t\t},\r\n\t\t\t\tonBack: () => {\r\n\t\t\t\t\tthis.onBack();\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t\tthis.startTimer(this.pingPeriod);\r\n\t\t}\r\n\t}\r\n\r\n\tstop() {\r\n\t\tthis.stopTimer();\r\n\r\n\t\tif (this.inactiveInstance) {\r\n\t\t\tthis.inactiveInstance.stop();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate startTimer(timeout: number) {\r\n\t\tthis.stopTimer();\r\n\t\tthis.timeoutForClear = setTimeout(() => {\r\n\t\t\tif (this.isActive) {\r\n\t\t\t\tthis.startPing();\r\n\t\t\t} else {\r\n\t\t\t\tthis.checkSession();\r\n\t\t\t}\r\n\t\t}, timeout);\r\n\t}\r\n\r\n\tprivate stopTimer() {\r\n\t\tif (this.timeoutForClear) {\r\n\t\t\tclearTimeout(this.timeoutForClear);\r\n\t\t\tthis.timeoutForClear = null;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate ping(): Observable {\r\n\t\tthis.isWaitingCheckStatus = false;\r\n\r\n\t\treturn this.commonCheckInactiveResourceService.ping()\r\n\t\t\t.pipe(\r\n\t\t\t\tcatchError((error) => {\r\n\t\t\t\t\tthis.stop();\r\n\t\t\t\t\treturn throwError(error);\r\n\t\t\t\t}),\r\n\t\t\t);\r\n\t}\r\n\r\n\tprivate startPing() {\r\n\t\tthis.ping()\r\n\t\t\t.subscribe(() => {\r\n\t\t\t\tthis.startTimer(this.pingPeriod);\r\n\t\t\t});\r\n\t}\r\n\r\n\tprivate checkSession() {\r\n\t\tthis.isWaitingCheckStatus = true;\r\n\r\n\t\tthis.commonCheckInactiveResourceService.checkSession()\r\n\t\t\t.pipe(\r\n\t\t\t\tcatchError((error) => {\r\n\t\t\t\t\tthis.stop();\r\n\t\t\t\t\treturn throwError(error);\r\n\t\t\t\t}),\r\n\t\t\t)\r\n\t\t\t.subscribe((response) => {\r\n\t\t\t\tthis.startTimer(response.Result.TimeLeft);\r\n\t\t\t});\r\n\t}\r\n\r\n\tprivate onAway() {\r\n\t\tthis.isActive = false;\r\n\t}\r\n\r\n\tprivate onBack() {\r\n\t\tthis.isActive = true;\r\n\r\n\t\tif (this.isWaitingCheckStatus) {\r\n\t\t\tthis.startPing();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate isActiveService(): boolean {\r\n\t\treturn this.commonAppDataService.getData()?.PingPeriod > 0;\r\n\t}\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonCheckInactiveService } from '@CaseOne/Common/common-check-inactive/services/common-check-inactive.service';\r\nimport { CommonCheckInactiveResourceService } from '@CaseOne/Common/common-check-inactive/services/common-check-inactive-resource.service';\r\n\r\n@NgModule({\r\n\tproviders: [\r\n\t\tCommonCheckInactiveService,\r\n\t\tCommonCheckInactiveResourceService,\r\n\t],\r\n})\r\nexport class CommonCheckInactiveModule {}\r\n","import {\r\n\tNgModule,\r\n\tApplicationRef,\r\n\tInject,\r\n\tDoBootstrap,\r\n\tInjector,\r\n\tErrorHandler,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\r\nimport { BrowserModule } from '@angular/platform-browser';\r\nimport {\r\n\tHttpClientModule,\r\n\tHTTP_INTERCEPTORS,\r\n} from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport {\r\n\tCommonAppDataService,\r\n} from '../app_data/app_data.service';\r\nimport {\r\n\tCOMMON_APP_CONFIG,\r\n\tICommonAppConfig,\r\n} from './app.config.token';\r\nimport { CommonLocaleModule } from '../locale/locale.module';\r\nimport { CommonRelativeRequestsInterceptor } from '../interceptors/relative-requests-interceptor.service';\r\nimport { CommonErrorInterceptor } from '../interceptors/error-interceptor.service';\r\nimport { CommonRequestCountInterceptor } from '../interceptors/request-count-interceptor.service';\r\nimport { CommonPipesModule } from '../pipes/pipes.module';\r\nimport { CommonBootstrapService } from '../bootstrap/bootstrap.service';\r\nimport { CommonVendorModule } from '../vendor/vendor.module';\r\nimport { CommonPopupModule } from '../popup/popup.module';\r\nimport { CommonUrlFiltersModule } from '../url_filters/common_url_filters.module';\r\nimport { CommonErrorHandlerService } from '../error-handler.service/error-handler.service';\r\nimport { CommonPageTitleModule } from '../page-title/page-title.module';\r\nimport { CommonContentWrapperModule } from '../content-wrapper/common-content-wrapper.module';\r\nimport { UserDataUpgradedServiceProvider } from '../user/user-data-upgraded.service';\r\nimport { CommonAppFontsModule } from './fonts/app-fonts.module';\r\nimport { CommonAppDataModule } from '../app_data/app-data.module';\r\nimport { CommonUserDataModule } from '../user/user-data.module';\r\nimport { CommonGeneralSettingsModule } from '../general_settings/general-settings.module';\r\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\r\nimport { CommonServerDateModule } from '../server_date/server-date.module';\r\nimport { CommonSharedLinkInterceptor } from '../interceptors/shared-link-interceptor.service';\r\nimport { CommonHeadersInterceptor } from '@CaseOne/Common/interceptors/headers-interceptor.service';\r\nimport { CommonCheckInactiveModule } from '@CaseOne/Common/common-check-inactive/common-check-inactive.module';\r\n\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\t// Import BrowserModule, BrowserAnimationsModule, HttpModule or HttpClientModule only once, preferably in your root module.\r\n\t\t// Error when lazy loading modules\r\n\t\t// https://stackoverflow.com/a/45979219\r\n\t\tBrowserModule,\r\n\t\tBrowserAnimationsModule,\r\n\t\tCommonModule,\r\n\r\n\t\tFormsModule,\r\n\t\tHttpClientModule,\r\n\t\tCommonVendorModule,\r\n\t\tCommonLocaleModule,\r\n\t\tCommonAppFontsModule,\r\n\t\tCommonPipesModule,\r\n\t\tCommonPopupModule,\r\n\t\tCommonUrlFiltersModule,\r\n\t\tCommonPageTitleModule,\r\n\t\tCommonContentWrapperModule,\r\n\t\tCommonServerDateModule,\r\n\t\tCommonCheckInactiveModule,\r\n\t],\r\n\texports: [\r\n\t\tBrowserModule,\r\n\t\tBrowserAnimationsModule,\r\n\t\tCommonModule,\r\n\t\tFormsModule,\r\n\t\tHttpClientModule,\r\n\t\tCommonLocaleModule,\r\n\t\tCommonGeneralSettingsModule,\r\n\t\tCommonAppDataModule,\r\n\t\tCommonUserDataModule,\r\n\t\tCommonPipesModule,\r\n\t\tCommonUrlFiltersModule,\r\n\t\tCommonPageTitleModule,\r\n\t\tCommonContentWrapperModule,\r\n\t\tCommonServerDateModule,\r\n\t\tCommonCheckInactiveModule,\r\n\t],\r\n\tproviders: [\r\n\t\t{\r\n\t\t\tprovide: HTTP_INTERCEPTORS,\r\n\t\t\tuseClass: CommonRelativeRequestsInterceptor,\r\n\t\t\tmulti: true,\r\n\t\t\tdeps: [CommonAppDataService],\r\n\t\t},\r\n\t\t{\r\n\t\t\tprovide: HTTP_INTERCEPTORS,\r\n\t\t\tuseClass: CommonErrorInterceptor,\r\n\t\t\tmulti: true,\r\n\t\t},\r\n\t\t{\r\n\t\t\tprovide: HTTP_INTERCEPTORS,\r\n\t\t\tuseClass: CommonRequestCountInterceptor,\r\n\t\t\tmulti: true,\r\n\t\t},\r\n\t\t{\r\n\t\t\tprovide: ErrorHandler,\r\n\t\t\tuseClass: CommonErrorHandlerService,\r\n\t\t},\r\n\t\t{\r\n\t\t\tprovide: HTTP_INTERCEPTORS,\r\n\t\t\tuseClass: CommonSharedLinkInterceptor,\r\n\t\t\tmulti: true,\r\n\t\t\tdeps: [CommonAppDataService],\r\n\t\t},\r\n\t\t{\r\n\t\t\tprovide: HTTP_INTERCEPTORS,\r\n\t\t\tuseClass: CommonHeadersInterceptor,\r\n\t\t\tmulti: true,\r\n\t\t},\r\n\t\tCommonBootstrapService,\r\n\t\tUserDataUpgradedServiceProvider,\r\n\t],\r\n})\r\nexport class CommonAppModule implements DoBootstrap {\r\n\tapp: ApplicationRef = this.injector.get(ApplicationRef);\r\n\r\n\tconstructor (\r\n\t\tprotected injector: Injector,\r\n\t\t@Inject(COMMON_APP_CONFIG) protected appConfig: ICommonAppConfig,\r\n\t) {}\r\n\r\n\tngDoBootstrap () {\r\n\t\tconst appModuleRunSubscribe$ = this.appModuleRun(this.app)\r\n\t\t\t.subscribe(() => {\r\n\t\t\t\tappModuleRunSubscribe$.unsubscribe();\r\n\t\t\t});\r\n\t}\r\n\r\n\tappModuleRun (\r\n\t\tapp: ApplicationRef,\r\n\t): Observable {\r\n\t\treturn new Observable((subscriber) => {\r\n\t\t\tif (this.appConfig.mainComponent) {\r\n\t\t\t\tapp.bootstrap(this.appConfig.mainComponent);\r\n\t\t\t}\r\n\r\n\t\t\t// wait subscribers\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tsubscriber.next();\r\n\t\t\t\tsubscriber.complete();\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n}\r\n","import { isEmpty, unset, get } from 'lodash';\r\nimport { FormControl } from '@angular/forms';\r\n\r\nimport { CommonNotificationService } from '../../../../Common/notification/notification.service';\r\nimport { ICommonResponseError } from '../../../../Common/interfaces/response';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class AuthenticationErrorService {\r\n\tconstructor (\r\n\t\tprivate commonNotificationService: CommonNotificationService,\r\n\t) {\r\n\t}\r\n\r\n\thandleSuccessResponse (response: ICommonResponseError, validationsErrorObject, control: FormControl): void {\r\n\t\tif (isEmpty(response.Errors)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (response.IsUserError) {\r\n\t\t\tthis.showCustomError(response, validationsErrorObject, control);\r\n\t\t} else {\r\n\t\t\tthis.commonNotificationService.handleResponseError(response);\r\n\t\t}\r\n\t}\r\n\r\n\tshowCustomError (response, validationsErrorObject, control: FormControl) {\r\n\t\tvalidationsErrorObject.custom = get(response, 'Errors[0]') || response.Error;\r\n\t\tcontrol.setErrors({CustomError: true});\r\n\t}\r\n\r\n\tonChangeFieldHandler (control: FormControl, resource) {\r\n\t\tif (resource.validationCustomErrors.custom) {\r\n\t\t\tcontrol.setErrors(null);\r\n\t\t\tunset(resource, 'validationCustomErrors.custom');\r\n\t\t}\r\n\t}\r\n}\r\n","import { Component, ChangeDetectionStrategy, Injector } from '@angular/core';\r\n\r\nimport { CommonBaseComponent } from '../base_component/base.component';\r\nimport { CommonAppDataService } from '../app_data/app_data.service';\r\n\r\nconst FIRST_DOT_REGEX = /^[^.]*\\./;\r\n\r\n@Component({\r\n\tselector: 'common-app-name-component',\r\n\ttemplateUrl: './common-app-name.component.pug',\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\n\r\nexport class CommonAppNameComponent extends CommonBaseComponent {\r\n\tfirstPart: string = '';\r\n\tlastPart: string = '';\r\n\r\n\tcommonAppDataService = this.injector.get(CommonAppDataService);\r\n\r\n\tconstructor(\r\n\t\tprotected injector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\r\n\t\tconst appData = this.commonAppDataService.getData();\r\n\r\n\t\tthis.firstPart = FIRST_DOT_REGEX.exec(appData.appName)[0];\r\n\t\tthis.lastPart = appData.appName.split(FIRST_DOT_REGEX)[1];\r\n\t}\r\n}\r\n","{{ firstPart }}{{ lastPart }}","import { ICommonAppConfig } from '../../../Common/app/app.config.token';\r\n\r\nimport { AuthenticationComponent } from './authentication.component';\r\n\r\nexport const authenticationAppConfig: ICommonAppConfig = {\r\n\tname: 'authentication',\r\n\tshouldAuthorize: false,\r\n\tmainComponent: AuthenticationComponent,\r\n};\r\n","import { Component, Injector } from '@angular/core';\r\n\r\nimport { CommonAppDataService } from '../../../Common/app_data/app_data.service';\r\nimport { CommonBaseComponent } from '../../../Common/base_component/base.component';\r\n\r\nimport { AuthenticationErrorService } from './services/authentication_error.service';\r\n\r\n@Component({\r\n\tselector: 'authentication-app',\r\n\ttemplateUrl: './authentication.component.pug',\r\n\tproviders: [\r\n\t\tAuthenticationErrorService,\r\n\t],\r\n})\r\n\r\nexport class AuthenticationComponent extends CommonBaseComponent {\r\n\tappData: any;\r\n\r\n\tconstructor (\r\n\t\tcommonAppDataService: CommonAppDataService,\r\n\t\tprotected injector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\r\n\t\tthis.appData = commonAppDataService.getData();\r\n\t}\r\n}\r\n","
","import {NgModule} from '@angular/core';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {CommonMinLengthValidatorDirective} from './minlength.directive';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonMinLengthValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonMinLengthValidatorDirective,\r\n\t],\r\n\tentryComponents: [],\r\n})\r\nexport class CommonMinLengthValidatorModule {}\r\n","import {NgModule} from '@angular/core';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {CommonMaxLengthValidatorDirective} from './maxlength.directive';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonMaxLengthValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonMaxLengthValidatorDirective,\r\n\t],\r\n\tentryComponents: [],\r\n})\r\nexport class CommonMaxLengthValidatorModule {}\r\n","import {ValidatorFn} from '@angular/forms';\r\n\r\nexport abstract class CommonValidator {\r\n\tgetValidator(context: any): ValidatorFn {\r\n\t\t// return validation function\r\n\t\tthrow new Error('CommonValidator#getValidator Method needs to be reloaded');\r\n\t\treturn null as ValidatorFn;\r\n\t}\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {hasValue} from '../../utilities/core.service';\r\nimport {AbstractControl, ValidationErrors} from '@angular/forms';\r\nimport {isArray} from 'lodash';\r\nimport {CommonValidator} from '../common-validator';\r\n\r\nexport const COMMON_REQUIRED_ERROR_KEY = 'CommonRequiredValidator';\r\n\r\nexport interface ICommonRequireValidatorContext {\r\n\tenabled?: boolean,\r\n\tarrayRequiredEnabled?: boolean,\r\n}\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonRequireValidator extends CommonValidator {\r\n\tgetValidator(context: ICommonRequireValidatorContext = {}) {\r\n\t\treturn (control: AbstractControl): ValidationErrors | null => {\r\n\t\t\tif (context.enabled !== false) {\r\n\t\t\t\tconst arrayRequiredEnabled = context.arrayRequiredEnabled !== false; // Default true\r\n\t\t\t\tlet isValid = hasValue(control.value);\r\n\r\n\t\t\t\tif (arrayRequiredEnabled && isArray(control.value)) {\r\n\t\t\t\t\tisValid = control.value.length > 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!isValid) {\r\n\t\t\t\t\treturn { [COMMON_REQUIRED_ERROR_KEY]: true };\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonRequiredDirective } from './required.directive';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CommonRequireValidator } from './required.validator';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonRequireValidator,\r\n\t],\r\n\texports: [\r\n\t\tCommonRequiredDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonRequiredDirective,\r\n\t],\r\n\tentryComponents: [],\r\n})\r\nexport class CommonRequiredValidatorModule {}\r\n","import {NgModule} from '@angular/core';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {CommonPatternValidatorDirective} from './pattern.directive';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonPatternValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonPatternValidatorDirective,\r\n\t],\r\n\tentryComponents: [],\r\n})\r\nexport class CommonPatternValidatorModule {}\r\n","// New version src/Common/control_validators/data_validation.constant.ts DATA_VALIDATION\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/infinite_scroll_module.js DATA_VALIDATION\r\n\r\nexport const DATA_VALIDATION = {\r\n\temail: /[\\wа-яА-ЯёЁ!#$%&'*+/=?^`{|}~\\-]+(\\.[\\wа-яА-ЯёЁ!#$%&'*+/=?^_`{|}~\\-]+)*@([a-zA-Zа-яА-ЯёЁ0-9]([a-zA-Zа-яА-ЯёЁ0-9\\-]*[a-zA-Zа-яА-ЯёЁ0-9])?)(\\.([a-zA-Zа-яА-ЯёЁ0-9]([a-zA-Zа-яА-ЯёЁ0-9\\-]*[a-zA-Zа-яА-ЯёЁ0-9])?))*$/,\r\n\timageFormats: [\r\n\t\t'.png',\r\n\t\t'.jpg',\r\n\t\t'.jpeg',\r\n\t\t'.gif',\r\n\t\t'.bmp',\r\n\t\t'.jpe',\r\n\t],\r\n\turl: /^(https?:\\/\\/)?([\\da-zа-яё\\.-]+)\\.([a-zа-яё\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/,\r\n\turlWithProtocol: /^((https?:)?\\/\\/)(\\S)*$/,\r\n\tcardExpire: /^(0[1-9]|1[0-2])\\/\\d{2}$/,\r\n\tcardExpireMonth: /^(0[1-9]|1[0-2])$/,\r\n\tcardExpireYear: /^(\\d{2}|\\d{4})$/,\r\n\tcardNumber: /^\\d+$/,\r\n};\r\n\r\n","import { Injectable } from '@angular/core';\r\nimport { AbstractControl, ValidationErrors } from '@angular/forms';\r\nimport { CommonValidator } from '../common-validator';\r\nimport { DATA_VALIDATION } from '@CaseOne/Common/control_validators/data_validation.constant';\r\n\r\n\r\nexport const COMMON_EMAIL_ERROR_KEY = 'email';\r\n\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonEmailValidator extends CommonValidator {\r\n\tgetValidator() {\r\n\t\treturn (control: AbstractControl): ValidationErrors | null => {\r\n\t\t\tif (!RegExp(DATA_VALIDATION.email).test(control.value) && control.value) {\r\n\t\t\t\treturn { [COMMON_EMAIL_ERROR_KEY]: true };\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonEmailValidatorDirective } from './email.directive';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CommonEmailValidator } from '@CaseOne/Common/control_validators/email/email.validator';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonEmailValidator,\r\n\t],\r\n\texports: [\r\n\t\tCommonEmailValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonEmailValidatorDirective,\r\n\t],\r\n})\r\nexport class CommonEmailValidatorModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonMatchValidatorDirective } from './match.directive';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonMatchValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonMatchValidatorDirective,\r\n\t],\r\n\tentryComponents: [],\r\n})\r\nexport class CommonMatchValidatorModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonMultipleFieldRequiredDirective } from './multiple-field-required.directive';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonMultipleFieldRequiredDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonMultipleFieldRequiredDirective,\r\n\t],\r\n\tentryComponents: [],\r\n})\r\nexport class CommonMultipleFieldRequiredValidatorModule {}\r\n","import {Injectable} from '@angular/core';\r\nimport {AbstractControl, ValidationErrors} from '@angular/forms';\r\nimport {isEmpty} from 'lodash';\r\nimport {CommonValidator} from '../common-validator';\r\n\r\nexport const COMMON_REQUIRED_ID_ERROR_KEY = 'commonRequiredId';\r\nexport interface ICommonRequiredIdValidatorContext {\r\n\tenabled?: boolean,\r\n}\r\n\r\n@Injectable()\r\nexport class CommonRequiredIdValidator extends CommonValidator {\r\n\tgetValidator(context: ICommonRequiredIdValidatorContext = {}) {\r\n\t\treturn (control: AbstractControl): ValidationErrors | null => {\r\n\t\t\tif (context.enabled === false || !control.value) {\r\n\t\t\t\treturn null;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tconst valueId = control.value.Id || control.value.id;\r\n\r\n\t\t\t\tif (isEmpty(valueId)) {\r\n\t\t\t\t\treturn { [COMMON_REQUIRED_ID_ERROR_KEY]: true };\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\n\r\nimport { CommonRequiredIdDirective } from './common-required-id.directive';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CommonRequiredIdValidator } from './common-required-id.validator';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonRequiredIdValidator,\r\n\t],\r\n\texports: [\r\n\t\tCommonRequiredIdDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonRequiredIdDirective,\r\n\t],\r\n})\r\nexport class CommonRequiredIdValidatorModule {}\r\n","import {NgModule} from '@angular/core';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {CommonMinValidatorDirective} from './min.directive';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonMinValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonMinValidatorDirective,\r\n\t],\r\n})\r\nexport class CommonMinValidatorModule {}\r\n","import {NgModule} from '@angular/core';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {CommonMaxValidatorDirective} from './max.directive';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonMaxValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonMaxValidatorDirective,\r\n\t],\r\n})\r\nexport class CommonMaxValidatorModule {}\r\n","import { Injectable } from '@angular/core';\r\nimport { AbstractControl, ValidationErrors } from '@angular/forms';\r\nimport { CommonValidator } from '../common-validator';\r\n\r\n\r\nexport const COMMON_BACK_END_ERROR_KEY = 'backEnd';\r\n\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonBackEndValidator extends CommonValidator {\r\n\tgetValidator() {\r\n\t\treturn (control: AbstractControl): ValidationErrors | null => {\r\n\t\t\treturn null;\r\n\t\t};\r\n\t}\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonBackEndValidatorDirective } from './back-end.directive';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CommonBackEndValidator } from '@CaseOne/Common/control_validators/back-end/back-end.validator';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonBackEndValidator,\r\n\t],\r\n\texports: [\r\n\t\tCommonBackEndValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonBackEndValidatorDirective,\r\n\t],\r\n})\r\nexport class CommonBackEndValidatorModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CommonValidationComponent } from './validation.component';\r\nimport { CommonMinLengthValidatorModule } from '../../../control_validators/minlength/minlength.module';\r\nimport { CommonMaxLengthValidatorModule } from '../../../control_validators/maxlength/maxlength.module';\r\nimport { CommonRequiredValidatorModule } from '../../../control_validators/required/required.module';\r\nimport { CommonPatternValidatorModule } from '../../../control_validators/pattern/pattern.module';\r\nimport { CommonEmailValidatorModule } from '../../../control_validators/email/email.module';\r\nimport { CommonMatchValidatorModule } from '../../../control_validators/match/match.module';\r\nimport { CommonMultipleFieldRequiredValidatorModule } from '../../../control_validators/multiple-field-required/multiple-field-required.module';\r\nimport { CommonRequiredIdValidatorModule } from '../../../control_validators/required-id.directive/required-id.module';\r\nimport { CommonMinValidatorModule } from '../../../control_validators/min/min.module';\r\nimport { CommonMaxValidatorModule } from '../../../control_validators/max/max.module';\r\nimport { CommonBackEndValidatorModule } from '@CaseOne/Common/control_validators/back-end/back-end.module';\r\n\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonModule,\r\n\t\tCommonMinLengthValidatorModule,\r\n\t\tCommonMaxLengthValidatorModule,\r\n\t\tCommonRequiredValidatorModule,\r\n\t\tCommonRequiredIdValidatorModule,\r\n\t\tCommonPatternValidatorModule,\r\n\t\tCommonEmailValidatorModule,\r\n\t\tCommonMatchValidatorModule,\r\n\t\tCommonMultipleFieldRequiredValidatorModule,\r\n\t\tCommonMinValidatorModule,\r\n\t\tCommonMaxValidatorModule,\r\n\t\tCommonBackEndValidatorModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonValidationComponent,\r\n\t\tCommonMinLengthValidatorModule,\r\n\t\tCommonMaxLengthValidatorModule,\r\n\t\tCommonRequiredValidatorModule,\r\n\t\tCommonRequiredIdValidatorModule,\r\n\t\tCommonPatternValidatorModule,\r\n\t\tCommonEmailValidatorModule,\r\n\t\tCommonMatchValidatorModule,\r\n\t\tCommonMultipleFieldRequiredValidatorModule,\r\n\t\tCommonMinValidatorModule,\r\n\t\tCommonMaxValidatorModule,\r\n\t\tCommonBackEndValidatorModule,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonValidationComponent,\r\n\t],\r\n\tentryComponents: [\r\n\t\tCommonValidationComponent,\r\n\t],\r\n})\r\nexport class CommonValidationModule {}\r\n","import { Injectable } from '@angular/core';\r\nimport { get, clone, merge, compact } from 'lodash';\r\n\r\nimport { commonConstants } from '../../constants/common.constants';\r\nimport { CommonLocaleService } from '../../locale/locale.service';\r\nimport { CommonServerDateService } from '../../server_date/server_date.service';\r\nimport { CommonGeneralSettingsService } from '../../general_settings/general_settings.service';\r\n\r\nimport * as Inputmask from 'inputmask';\r\nimport { combineLatest, BehaviorSubject } from 'rxjs';\r\nimport { COMMON_MAX_COUNT_ZEROS } from '@CaseOne/Common/dictionaries/common-count-zeros.dictionary.service';\r\n\r\n\r\ndeclare interface IMask {\r\n\tmask: string;\r\n\tplaceholder?: string;\r\n\tshowMaskOnHover?: boolean;\r\n\tshowMaskOnFocus?: boolean;\r\n\thourFormat?: string;\r\n\talias?: string;\r\n\tleapday?: string;\r\n\tseparator?: string;\r\n\tyearrange?: {}\r\n}\r\n\r\ninterface ICommonTextfieldInputMaskSettings {\r\n\talias: string;\r\n\tradixPoint: string;\r\n\tgroupSeparator: string;\r\n\tautoGroup: boolean;\r\n\trightAlign: boolean;\r\n\tunmaskAsNumber: boolean;\r\n\tdigits: number;\r\n\tallowMinus: boolean;\r\n}\r\n\r\nconst { defaultNumberDecimalSeparator, defaultNumberGroupSeparator, defaultNumberDigitsAfterDecimal } = commonConstants;\r\n\r\n@Injectable()\r\nexport class CommonTextfieldInputMaskAliasesService {\r\n\tpublic decimalSeparator: string;\r\n\tpublic groupSeparator: string;\r\n\r\n\tprivate saveCharsRegExp = new RegExp('[^\\\\\\\\:/*?\"<>|]');\r\n\tprivate tagCharsRegExp = new RegExp('^[0-9A-Za-z_]');\r\n\tprivate externalTagCharsRegExp = new RegExp('^[0-9A-Za-z_\\\\[\\\\]]');\r\n\tprivate domainRegExp = new RegExp('^[0-9a-zA-Z-]');\r\n\tprivate scriptNameRegExp = new RegExp('^[0-9a-zA-Z-_]');\r\n\tprivate onlyLettersRegExp = new RegExp(/(^$)|(^([^\\-!#\\$%&\\(\\)\\*,\\./:;\\?@\\[\\\\\\]_\\{\\|\\}¨ˇ“”€\\+<=>§°\\d\\s¤®™©'\"^±~`№])+$)/); // all letters\r\n\r\n\tprivate numericParams: ICommonTextfieldInputMaskSettings;\r\n\tprivate numericParamsMaxDigest: ICommonTextfieldInputMaskSettings;\r\n\tprivate integerParams: ICommonTextfieldInputMaskSettings;\r\n\tprivate integerPositiveParams: ICommonTextfieldInputMaskSettings;\r\n\tprivate numericParamsNoMinus: ICommonTextfieldInputMaskSettings;\r\n\r\n\tprivate init$ = new BehaviorSubject(false);\r\n\r\n\tconstructor(\r\n\t\tprivate commonGeneralSettingsService: CommonGeneralSettingsService,\r\n\t\tprivate commonServerDateService: CommonServerDateService,\r\n\t\tprivate commonLocaleService: CommonLocaleService,\r\n\t) {}\r\n\r\n\tinit (): Promise {\r\n\t\treturn new Promise((resolve) => { // for APP_INITIALIZER\r\n\t\t\tconst res = combineLatest([\r\n\t\t\t\tthis.commonGeneralSettingsService.wait(),\r\n\t\t\t\tthis.commonServerDateService.wait(),\r\n\t\t\t\tthis.commonLocaleService.wait(),\r\n\t\t\t]);\r\n\r\n\t\t\tres.subscribe((result) => {\r\n\t\t\t\tif (result.length === compact(result).length) {\r\n\t\t\t\t\tthis.setAliases();\r\n\t\t\t\t\tthis.init$.next(true);\r\n\t\t\t\t\tresolve(true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\twait(): BehaviorSubject {\r\n\t\treturn this.init$;\r\n\t}\r\n\r\n\tsetAliases (): void {\r\n\t\tconst numberFormat = this.commonGeneralSettingsService.getGeneralSettings('NumberFormat');\r\n\r\n\t\tthis.decimalSeparator = get(numberFormat, 'DecimalSeparator') || defaultNumberDecimalSeparator;\r\n\t\tthis.groupSeparator = get(numberFormat, 'GroupSeparator') || defaultNumberGroupSeparator;\r\n\t\tthis.numericParams = {\r\n\t\t\talias: 'numeric',\r\n\t\t\tradixPoint: this.decimalSeparator,\r\n\t\t\tgroupSeparator: this.groupSeparator,\r\n\t\t\tautoGroup: true,\r\n\t\t\trightAlign: false,\r\n\t\t\tunmaskAsNumber: true,\r\n\t\t\tdigits: defaultNumberDigitsAfterDecimal,\r\n\t\t\tallowMinus: true,\r\n\t\t};\r\n\r\n\t\tthis.numericParamsMaxDigest = clone(this.numericParams);\r\n\t\tthis.numericParamsMaxDigest.digits = COMMON_MAX_COUNT_ZEROS;\r\n\r\n\t\tthis.integerParams = clone(this.numericParams);\r\n\t\tthis.integerParams.alias = 'integer';\r\n\t\tthis.integerParams.digits = 0;\r\n\r\n\t\tthis.integerPositiveParams = clone(this.integerParams);\r\n\t\tthis.integerPositiveParams.allowMinus = false;\r\n\r\n\t\tthis.numericParamsNoMinus = clone(this.numericParams);\r\n\t\tthis.numericParamsNoMinus.allowMinus = false;\r\n\r\n\t\tInputmask\r\n\t\t\t.extendAliases({\r\n\t\t\t\t// text mask with only digits (\"00001\")\r\n\t\t\t\t'casem-text-digits': {\r\n\t\t\t\t\tmask: 'b',\r\n\t\t\t\t\trepeat: '*',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\tautoUnmask: true,\r\n\t\t\t\t\tshowMaskOnHover: false,\r\n\t\t\t\t\tshowMaskOnFocus: false,\r\n\t\t\t\t\tisComplete: (buffer: []): boolean => {\r\n\t\t\t\t\t\treturn commonConstants.dataValidation.digits.test(buffer.join(''));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdefinitions: {\r\n\t\t\t\t\t\tb: {\r\n\t\t\t\t\t\t\tvalidator: (chr): boolean => {\r\n\t\t\t\t\t\t\t\treturn commonConstants.dataValidation.digits.test(chr);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t'casem-phone': {\r\n\t\t\t\t\tmask: '(9{*})|(\\\\+9{*})',\r\n\t\t\t\t\tshowMaskOnHover: false,\r\n\t\t\t\t\tshowMaskOnFocus: true,\r\n\t\t\t\t},\r\n\t\t\t\t'casem-safe-characters': {\r\n\t\t\t\t\tmask: 'c',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\trepeat: '*', // http://git.io/vcguC - transmits value to model\r\n\t\t\t\t\tisComplete: (buffer: []): boolean => {\r\n\t\t\t\t\t\t// Logic broadcast 'isComplete' for model\r\n\t\t\t\t\t\treturn this.saveCharsRegExp.test(buffer.join(''));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdefinitions: {\r\n\t\t\t\t\t\tc: {\r\n\t\t\t\t\t\t\tvalidator: (chr: string): boolean => {\r\n\t\t\t\t\t\t\t\treturn this.saveCharsRegExp.test(chr);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t'casem-tag': {\r\n\t\t\t\t\tmask: 'd',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\trepeat: '*', // http://git.io/vcguC - transmits value to model\r\n\t\t\t\t\tisComplete: (buffer: []): boolean => {\r\n\t\t\t\t\t\t// Logic broadcast 'isComplete' for model\r\n\t\t\t\t\t\treturn this.tagCharsRegExp.test(buffer.join(''));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdefinitions: {\r\n\t\t\t\t\t\td: {\r\n\t\t\t\t\t\t\tvalidator: (chr: string): boolean => {\r\n\t\t\t\t\t\t\t\treturn this.tagCharsRegExp.test(chr);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t'casem-external-tag': {\r\n\t\t\t\t\tmask: 'e',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\trepeat: '+', // http://git.io/vcguC - transmits value to model\r\n\t\t\t\t\tisComplete: (buffer: []): boolean => {\r\n\t\t\t\t\t\t// Logic broadcast 'isComplete' for model\r\n\t\t\t\t\t\treturn this.externalTagCharsRegExp.test(buffer.join(''));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdefinitions: {\r\n\t\t\t\t\t\te: {\r\n\t\t\t\t\t\t\tvalidator: (chr: string): boolean => {\r\n\t\t\t\t\t\t\t\treturn this.externalTagCharsRegExp.test(chr);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t'casem-domain': {\r\n\t\t\t\t\tmask: 'f',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\trepeat: '*', // http://git.io/vcguC - transmits value to model\r\n\t\t\t\t\tisComplete: (buffer: []) => {\r\n\t\t\t\t\t\t// Logic broadcast 'isComplete' for model\r\n\t\t\t\t\t\treturn this.domainRegExp.test(buffer.join(''));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdefinitions: {\r\n\t\t\t\t\t\tf: {\r\n\t\t\t\t\t\t\tvalidator: (chr: string): boolean => {\r\n\t\t\t\t\t\t\t\treturn this.domainRegExp.test(chr);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t'casem-script-name': {\r\n\t\t\t\t\tmask: '*',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\trepeat: '*', // http://git.io/vcguC - transmits value to model\r\n\t\t\t\t\tisComplete: (buffer: []) => {\r\n\t\t\t\t\t\t// Logic broadcast 'isComplete' for model\r\n\t\t\t\t\t\treturn this.scriptNameRegExp.test(buffer.join(''));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdefinitions: {\r\n\t\t\t\t\t\t'*': {\r\n\t\t\t\t\t\t\tvalidator: (chr: string): boolean => {\r\n\t\t\t\t\t\t\t\treturn this.scriptNameRegExp.test(chr);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t'casem-numeric': this.numericParams,\r\n\t\t\t\t'casem-numeric-max_digits': this.numericParamsMaxDigest,\r\n\t\t\t\t'casem-numeric-no-minus': this.numericParamsNoMinus,\r\n\t\t\t\t'casem-integer': this.integerParams,\r\n\t\t\t\t'casem-integer-positive': this.integerPositiveParams,\r\n\t\t\t\t'casem-letters': {\r\n\t\t\t\t\tmask: '*',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\trepeat: '+',\r\n\t\t\t\t\tisComplete: (buffer: []) => {\r\n\t\t\t\t\t\treturn this.onlyLettersRegExp.test(buffer.join(''));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdefinitions: {\r\n\t\t\t\t\t\t'*': {\r\n\t\t\t\t\t\t\tvalidator: (chr: string): boolean => {\r\n\t\t\t\t\t\t\t\treturn this.onlyLettersRegExp.test(chr);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t'casem-cardnumber': {\r\n\t\t\t\t\tmask: 'i',\r\n\t\t\t\t\trepeat: '24',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\tautoUnmask: true,\r\n\t\t\t\t\tshowMaskOnHover: false,\r\n\t\t\t\t\tshowMaskOnFocus: false,\r\n\t\t\t\t\tisComplete: (buffer: []): boolean => {\r\n\t\t\t\t\t\treturn commonConstants.dataValidation.cardNumber.test(buffer.join(''));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdefinitions: {\r\n\t\t\t\t\t\ti: {\r\n\t\t\t\t\t\t\tvalidator: (chr: string): boolean => {\r\n\t\t\t\t\t\t\t\treturn commonConstants.dataValidation.cardNumber.test(chr);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t'casem-invoice-time-rounding-minutes': {\r\n\t\t\t\t\talias: 'numeric',\r\n\t\t\t\t\trepeat: '3',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\trightAlign: false,\r\n\t\t\t\t\tunmaskAsNumber: true,\r\n\t\t\t\t\tallowMinus: false,\r\n\t\t\t\t\tdigits: 0,\r\n\t\t\t\t},\r\n\t\t\t\t'casem-invoice-time-rounding-hours': {\r\n\t\t\t\t\talias: 'numeric',\r\n\t\t\t\t\trepeat: '2',\r\n\t\t\t\t\tgreedy: false,\r\n\t\t\t\t\trightAlign: false,\r\n\t\t\t\t\tunmaskAsNumber: true,\r\n\t\t\t\t\tallowMinus: false,\r\n\t\t\t\t\tdigits: 2,\r\n\t\t\t\t},\r\n\t\t\t\t'casem-time': this.getCasemTimeMask(),\r\n\t\t\t\t'casem-date': this.getCasemDateMask(),\r\n\t\t\t\t'casem-cardexpire': this.getCasemCardExpireMask(),\r\n\t\t\t\t'casem-cardexpire-month': this.getCasemCardExpireMonthMask(),\r\n\t\t\t\t'casem-cardexpire-year': this.getCasemCardExpireYearhMask(),\r\n\t\t\t\t'casem-participant-individual-inn': this.getCasemParticipantIndividualInnMask(),\r\n\t\t\t\t'casem-resolution-number': {\r\n\t\t\t\t\tmask: '9{1,10}',\r\n\t\t\t\t\tplaceholder: '',\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t}\r\n\r\n\tprivate getCasemDateMask (): IMask {\r\n\t\tconst inputDateMask = this.commonServerDateService.inputDateMask;\r\n\t\tconst mask = inputDateMask.replace(/dd|mm/, '1').replace(/dd|mm/, '2').replace('yyyy', 'y');\r\n\t\tconst alias = inputDateMask.replace(/\\W/g, '/');\r\n\t\tconst leapday = inputDateMask.replace('dd', '29').replace('mm', '02').replace('yyyy', '');\r\n\t\tconst separator = inputDateMask.match(/\\W/)[0];\r\n\r\n\t\treturn {\r\n\t\t\tmask,\r\n\t\t\tplaceholder: this.commonServerDateService.inputDatePlaceholder,\r\n\t\t\tleapday,\r\n\t\t\tseparator,\r\n\t\t\talias,\r\n\t\t\tyearrange: {\r\n\t\t\t\tminyear: 1900,\r\n\t\t\t\tmaxyear: 2999,\r\n\t\t\t},\r\n\t\t\tshowMaskOnHover: false,\r\n\t\t\tshowMaskOnFocus: true,\r\n\t\t};\r\n\t}\r\n\r\n\tprivate getCasemTimeMask (): IMask {\r\n\t\treturn {\r\n\t\t\tmask: this.commonServerDateService.inputTimeMask,\r\n\t\t\tplaceholder: this.commonServerDateService.inputTimePlaceholder,\r\n\t\t\talias: 'datetime',\r\n\t\t\thourFormat: this.commonGeneralSettingsService.hasMeridiem() ? '12' : '24',\r\n\t\t\tshowMaskOnHover: false,\r\n\t\t\tshowMaskOnFocus: true,\r\n\t\t};\r\n\t}\r\n\r\n\tprivate getCasemCardExpireMask (): IMask {\r\n\t\tconst monthsSymbol = this.commonLocaleService.instant('common.symbols.months');\r\n\t\tconst yearsSymbol = this.commonLocaleService.instant('common.symbols.years');\r\n\r\n\t\treturn {\r\n\t\t\tmask: '99/99',\r\n\t\t\tplaceholder: (monthsSymbol + monthsSymbol + '/' + yearsSymbol + yearsSymbol).toUpperCase(),\r\n\t\t\tshowMaskOnHover: false,\r\n\t\t\tshowMaskOnFocus: false,\r\n\t\t};\r\n\t}\r\n\r\n\tprivate getCasemCardExpireMonthMask (): IMask {\r\n\t\tconst monthsSymbol = this.commonLocaleService.instant('common.symbols.months');\r\n\r\n\t\treturn {\r\n\t\t\tmask: '99',\r\n\t\t\tplaceholder: (monthsSymbol + monthsSymbol).toUpperCase(),\r\n\t\t\tshowMaskOnHover: false,\r\n\t\t\tshowMaskOnFocus: false,\r\n\t\t};\r\n\t}\r\n\r\n\tprivate getCasemCardExpireYearhMask (): IMask {\r\n\t\tconst yearsSymbol = this.commonLocaleService.instant('common.symbols.years');\r\n\r\n\t\treturn {\r\n\t\t\tmask: '(99)|(9999)',\r\n\t\t\tplaceholder: (yearsSymbol + yearsSymbol).toUpperCase(),\r\n\t\t\tshowMaskOnHover: false,\r\n\t\t\tshowMaskOnFocus: false,\r\n\t\t};\r\n\t}\r\n\r\n\tprivate getCasemParticipantIndividualInnMask (): IMask {\r\n\t\tconst locale = this.commonLocaleService.locale;\r\n\r\n\t\tconst masks = {\r\n\t\t\tru: {\r\n\t\t\t\tmask: '999999999999',\r\n\t\t\t},\r\n\t\t\ten: {\r\n\t\t\t\tmask: '999-99-9999',\r\n\t\t\t},\r\n\t\t\tfr: {\r\n\t\t\t\tmask: '9 99 99 99 999 999 99',\r\n\t\t\t},\r\n\t\t\tpt: {\r\n\t\t\t\tmask: '999-99-9999',\r\n\t\t\t},\r\n\t\t};\r\n\r\n\t\tconst maskParams = {\r\n\t\t\tautoUnmask: true,\r\n\t\t};\r\n\r\n\t\treturn merge(masks[locale], maskParams);\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CommonBaseDictionaryService } from '../controls/base-dictionary.service/common-base-dictionary.service';\r\nimport {\r\n\tICommonListResourceServiceQueryData\r\n} from '@CaseOne/Common/base-list-resource.service/common-base-list-resource.service';\r\nimport { cancelRequestPolyfill, IPromiseWithCancel } from '@CaseOne/Common/utilities/core.service';\r\nimport { ICommonResponse } from '@CaseOne/Common/interfaces/response';\r\nimport { ICommonSysNameModel, UUID } from '@CaseOne/Common/interfaces/core';\r\nimport { commonConstants } from '../constants/common.constants';\r\n\r\n\r\nexport const COMMON_MAX_COUNT_ZEROS = 6;\r\n\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonCountZerosDictionaryService extends CommonBaseDictionaryService> {\r\n\tname = 'CommonCountZerosDictionaryService';\r\n\r\n\tgetDefaultValue(): ICommonSysNameModel {\r\n\t\treturn {\r\n\t\t\tId: commonConstants.defaultNumberDigitsAfterDecimal.toString() as UUID,\r\n\t\t\tName: commonConstants.defaultNumberDigitsAfterDecimal.toString(),\r\n\t\t\tSysName: commonConstants.defaultNumberDigitsAfterDecimal,\r\n\t\t};\r\n\t}\r\n\r\n\tgetValues(): ICommonSysNameModel[] {\r\n\t\tconst result = [];\r\n\t\tlet i = 0;\r\n\r\n\t\twhile (i <= COMMON_MAX_COUNT_ZEROS) {\r\n\t\t\tresult.push({\r\n\t\t\t\tId: i.toString() as UUID,\r\n\t\t\t\tName: i.toString(),\r\n\t\t\t\tSysName: i,\r\n\t\t\t});\r\n\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tget(data: ICommonListResourceServiceQueryData = {}): IPromiseWithCancel[]>> {\r\n\t\tconst promise = Promise.resolve()\r\n\t\t\t.then(() => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tResult: this.getValues(),\r\n\t\t\t\t\tIsSuccess: true,\r\n\t\t\t\t\tPage: 1,\r\n\t\t\t\t\tPageSize: 100500,\r\n\t\t\t\t} as ICommonResponse;\r\n\t\t\t});\r\n\r\n\t\treturn cancelRequestPolyfill(promise);\r\n\t}\r\n}\r\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { CommonPipesModule } from '../../pipes/pipes.module';\r\nimport { CommonLoaderModule } from '../../loader/loader.module';\r\nimport { CommonValidationModule } from '../control/validation/validation.module';\r\nimport { CommonTextfieldComponent } from './textfield.component';\r\nimport { CommonTextfieldInputMaskAliasesService } from './inputmasks_aliases_service';\r\n\r\ndeclare const COMPONENT_SPECS_MODE: boolean;\r\n\r\nexport function initCommonTextfieldInputMaskAliasesService (\r\n\tcommonTextfieldInputMaskAliasesService: CommonTextfieldInputMaskAliasesService,\r\n) {\r\n\treturn () => {\r\n\t\tif (!COMPONENT_SPECS_MODE) { // until https://github.com/angular/angular/issues/24218 is fixed\r\n\t\t\treturn commonTextfieldInputMaskAliasesService.init();\r\n\t\t}\r\n\t};\r\n}\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t\tCommonValidationModule,\r\n\t\tCommonPipesModule,\r\n\t\tCommonLoaderModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonTextfieldComponent,\r\n\t\tFormsModule,\r\n\t\tCommonValidationModule,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonTextfieldComponent,\r\n\t],\r\n\tentryComponents: [\r\n\t\tCommonTextfieldComponent,\r\n\t],\r\n\tproviders: [\r\n\t\tCommonTextfieldInputMaskAliasesService,\r\n\t\t{\r\n\t\t\tprovide: APP_INITIALIZER,\r\n\t\t\tuseFactory: initCommonTextfieldInputMaskAliasesService,\r\n\t\t\tmulti: true,\r\n\t\t\tdeps: [\r\n\t\t\t\tCommonTextfieldInputMaskAliasesService,\r\n\t\t\t],\r\n\t\t},\r\n\t],\r\n})\r\nexport class CommonTextfieldModule {}\r\n\r\n","import {NgModule} from '@angular/core';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {CommonChooseTrueValidatorDirective} from './choose_true.directive';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonChooseTrueValidatorDirective,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonChooseTrueValidatorDirective,\r\n\t],\r\n\tentryComponents: [],\r\n})\r\nexport class CommonChooseTrueValidatorModule {}\r\n","import {CommonCheckboxComponent} from './checkbox.component';\r\nimport {NgModule} from '@angular/core';\r\nimport {CommonChooseTrueValidatorModule} from '../../control_validators/choose_true/choose_true.module';\r\nimport {CommonValidationModule} from '../control/validation/validation.module';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CommonCheckboxColorStylePipe } from '@CaseOne/Common/controls/checkbox/checkbox-color-style.pipe';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tFormsModule,\r\n\t\tCommonModule,\r\n\t\tCommonChooseTrueValidatorModule,\r\n\t\tCommonValidationModule,\r\n\t],\r\n\texports: [\r\n\t\tCommonCheckboxComponent,\r\n\r\n\t\tFormsModule,\r\n\t\tCommonChooseTrueValidatorModule,\r\n\t\tCommonValidationModule,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonCheckboxComponent,\r\n\t\tCommonCheckboxColorStylePipe,\r\n\t],\r\n\tentryComponents: [\r\n\t\tCommonCheckboxComponent,\r\n\t],\r\n})\r\nexport class CommonCheckboxModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CommonAutofocusDirective } from './common_autofocus.directive';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonModule,\r\n\t],\r\n\tdeclarations: [\r\n\t\tCommonAutofocusDirective,\r\n\t],\r\n\texports: [\r\n\t\tCommonAutofocusDirective,\r\n\t],\r\n})\r\nexport class CommonAutofocusModule {}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonAppNameComponent } from './common-app-name.component';\r\n\r\n@NgModule({\r\n\tdeclarations: [\r\n\t\tCommonAppNameComponent,\r\n\t],\r\n\texports: [\r\n\t\tCommonAppNameComponent,\r\n\t],\r\n})\r\nexport class CommonAppNameModule {}\r\n","import { NgModule } from '@angular/core';\r\n\r\nimport { CommonTextfieldModule } from '../../../Common/controls/textfield/textfield.module';\r\nimport { CommonCheckboxModule } from '../../../Common/controls/checkbox/checkbox.module';\r\nimport { CommonAutofocusModule } from '../../../Common/directives/common_autofocus/common_autofocus.module';\r\nimport { CommonPageTitleModule } from '../../../Common/page-title/page-title.module';\r\nimport { CommonAppNameModule } from '../../../Common/app-name/common-app-name.module';\r\n\r\n\r\n@NgModule({\r\n\texports: [\r\n\t\tCommonTextfieldModule,\r\n\t\tCommonCheckboxModule,\r\n\t\tCommonAutofocusModule,\r\n\t\tCommonPageTitleModule,\r\n\t\tCommonAppNameModule,\r\n\t],\r\n})\r\nexport class AuthenticationCommonModule {}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\nimport { Injectable } from '@angular/core';\r\n\r\nconst urls = {\r\n\tlogin: 'authentication/account/login',\r\n\tchangePhone: 'authentication/account/changePhone',\r\n\tconfirmPhoneCode: 'authentication/account/checkPhoneConfirmationCode',\r\n\tcheckLoginCode: 'authentication/account/checkValidationCode',\r\n\tresendPhoneCode: 'authentication/account/resendPhoneConfirmationCode',\r\n\tresendLoginCode: 'authentication/account/resendCode',\r\n\tremindPassword: 'authentication/account/remindPassword',\r\n\tresetPassword: 'api/accountactions/resetpassword',\r\n\tregister: 'api/users/registerByInvite',\r\n};\r\n\r\n@Injectable()\r\nexport class AuthenticationUserService {\r\n\tconstructor(\r\n\t\tprivate http: HttpClient,\r\n\t) {}\r\n\r\n\tlogin (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.login, data);\r\n\t}\r\n\r\n\tchangePhone (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.changePhone, data);\r\n\t}\r\n\r\n\tconfirmPhoneCode (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.confirmPhoneCode, data);\r\n\t}\r\n\r\n\tcheckLoginCode (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.checkLoginCode, data);\r\n\t}\r\n\r\n\tresendPhoneCode (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.resendPhoneCode, data);\r\n\t}\r\n\r\n\tresendLoginCode (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.resendLoginCode, data);\r\n\t}\r\n\r\n\tremindPassword (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.remindPassword, data);\r\n\t}\r\n\r\n\tresetPassword (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.resetPassword, data);\r\n\t}\r\n\r\n\tregister (data): Observable<{}> {\r\n\t\treturn this.http.post(urls.register, data);\r\n\t}\r\n}\r\n","
","import {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tEventEmitter,\r\n\tInput,\r\n\tOutput,\r\n\tSimpleChanges,\r\n} from '@angular/core';\r\nimport { CommonBaseComponent } from '../../base_component/base.component';\r\n\r\n@Component({\r\n\tselector: 'common-form-submitters',\r\n\ttemplateUrl: './common-form-submitters.component.pug',\r\n\tstyleUrls: [\r\n\t\t'./common-form-submitters.component.sass',\r\n\t],\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CommonFormSubmittersComponent extends CommonBaseComponent {\r\n\t@Input() isCreateForm: boolean; // edit or create form\r\n\t@Input() isReadonly: boolean = false; // use with readonly forms\r\n\t@Input() isDisabled: boolean = false; // use with invalid forms, but available for saving\r\n\r\n\t@Input() submitTitleEdit: string = '';\r\n\t@Input() submitTitleCreate: string = '';\r\n\t@Input() cancelTitleEdit: string = '';\r\n\t@Input() cancelTitleCreate: string = '';\r\n\r\n\t@Output() onSubmit = new EventEmitter();\r\n\t@Output() onCancel = new EventEmitter();\r\n\r\n\tsubmitTitle: string = '';\r\n\tcancelTitle: string = '';\r\n\r\n\tngOnChanges(changes: SimpleChanges) {\r\n\t\tsuper.ngOnChanges(changes);\r\n\r\n\t\tthis.setBtnTitles();\r\n\t}\r\n\r\n\tonSubmitActionHandler($event: Event) {\r\n\t\tthis.onSubmit.emit($event);\r\n\t}\r\n\r\n\tonCancelClickOrEnterOrSpaceHandler($event: Event) {\r\n\t\tthis.onCancel.emit($event);\r\n\t}\r\n\r\n\tprivate setBtnTitles () {\r\n\t\tif (this.isReadonly) {\r\n\t\t\tconst DEFAULT_CANCEL_TITLE_READONLY = this.instant('common.close');\r\n\r\n\t\t\tthis.cancelTitle = this.cancelTitleEdit || this.cancelTitleCreate || DEFAULT_CANCEL_TITLE_READONLY;\r\n\t\t} else {\r\n\t\t\tconst DEFAULT_SUBMIT_TITLE_CREATE = this.instant('common.add');\r\n\t\t\tconst DEFAULT_SUBMIT_TITLE_EDIT = this.instant('common.save');\r\n\t\t\tconst DEFAULT_CANCEL_TITLE = this.instant('common.cancel');\r\n\r\n\t\t\tif (this.isCreateForm) {\r\n\t\t\t\tthis.submitTitle = this.submitTitleCreate || DEFAULT_SUBMIT_TITLE_CREATE;\r\n\t\t\t\tthis.cancelTitle = this.cancelTitleCreate || DEFAULT_CANCEL_TITLE;\r\n\t\t\t} else {\r\n\t\t\t\tthis.submitTitle = this.submitTitleEdit || DEFAULT_SUBMIT_TITLE_EDIT;\r\n\t\t\t\tthis.cancelTitle = this.cancelTitleEdit || DEFAULT_CANCEL_TITLE;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import { ViewChild, Directive, Input, Output, EventEmitter, SimpleChanges } from '@angular/core';\r\nimport { FormGroup, FormGroupDirective, NgForm } from '@angular/forms';\r\n\r\nimport { distinctUntilChanged, finalize, map } from 'rxjs/operators';\r\nimport { Observable, BehaviorSubject, merge, of } from 'rxjs';\r\n\r\nimport { CommonBaseComponent } from '../../base_component/base.component';\r\nimport { ICommonResponse } from '../../interfaces/response';\r\nimport { CommonControlComponent } from '../../controls/control/control.class';\r\nimport { remove, filter, sortBy } from 'lodash';\r\nimport { Rect } from '../../utilities/rect';\r\nimport { CommonFormSubmittersComponent } from '@CaseOne/Common/form/common-form-submitters.component/common-form-submitters.component';\r\n\r\n\r\nexport const SCROLL_TOP_OFFSET = 128;\r\n\r\nexport interface ICommonFormSubmitRequestOptions {\r\n\thideLoaderOnlyOnError?: boolean, // we do not unlock the form if after saving it is no longer needed (IE bug with mass submit)\r\n\tonSuccess?: (response?: Response) => any,\r\n\tonError?: (response?: Response) => any,\r\n\tonFinalize?: () => any,\r\n}\r\n\r\nexport interface ICommonFormState {\r\n\tisSaving: boolean;\r\n\tisChanged: boolean;\r\n\tisDisabled: boolean;\r\n\tisReadonly: boolean;\r\n\tisDirty: boolean;\r\n}\r\n\r\n\r\n@Directive()\r\nexport abstract class CommonFormComponent extends CommonBaseComponent {\r\n\t@Input() isSubmitted: boolean;\r\n\r\n\t@Input() isValid: boolean;\r\n\t@Output() isValidChange: EventEmitter = new EventEmitter();\r\n\t@Input() isInvalid: boolean;\r\n\t@Output() isInvalidChange: EventEmitter = new EventEmitter();\r\n\r\n\t@ViewChild(NgForm, { static: true }) form: NgForm;\r\n\t@ViewChild(FormGroupDirective, { static: true }) formGroup: FormGroupDirective;\r\n\t@ViewChild(CommonFormSubmittersComponent, { static: true }) submittersComponent: CommonFormSubmittersComponent;\r\n\r\n\tpublic blurValidationEnabled = true;\r\n\r\n\tpublic state$: BehaviorSubject = new BehaviorSubject({\r\n\t\tisSaving: false,\r\n\t\tisChanged: false,\r\n\t\tisDisabled: false,\r\n\t\tisReadonly: false,\r\n\t\tisDirty: false,\r\n\t} as StateType);\r\n\tpublic isSubmitButtonDisabled$: Observable;\r\n\tpublic reactiveForm = new FormGroup({});\r\n\r\n\tprotected scrollContainerSelector = 'html, body';\r\n\tprotected controls: CommonControlComponent[] = [];\r\n\r\n\tprivate changes$: Observable<[StateType, any, any]>;\r\n\r\n\tprivate get formGetter(): NgForm | FormGroupDirective {\r\n\t\treturn this.form || this.formGroup;\r\n\t}\r\n\r\n\tngOnChanges(changes: SimpleChanges) {\r\n\t\tsuper.ngOnChanges(changes);\r\n\r\n\t\tif (changes.isSubmitted?.currentValue && this.formGetter.form && !this.formGetter.submitted) {\r\n\t\t\tthis.submitForm();\r\n\t\t}\r\n\t}\r\n\r\n\tngAfterViewInit() {\r\n\t\tsuper.ngAfterViewInit();\r\n\r\n\t\tif (this.isSubmitted && !this.formGetter.submitted) {\r\n\t\t\tthis.submitForm();\r\n\t\t}\r\n\r\n\t\tthis.changes$ = merge(\r\n\t\t\tthis.state$,\r\n\t\t\tthis.formGetter.ngSubmit,\r\n\t\t\tthis.formGetter.statusChanges,\r\n\t\t);\r\n\r\n\t\tthis.isSubmitButtonDisabled$ = this.changes$.pipe(\r\n\t\t\tmap(() => {\r\n\t\t\t\tconst { isSaving, isDisabled } = this.state$.getValue();\r\n\t\t\t\tconst { submitted, invalid } = this.formGetter;\r\n\r\n\t\t\t\treturn isSaving || isDisabled || submitted && invalid;\r\n\t\t\t}),\r\n\t\t\tdistinctUntilChanged(),\r\n\t\t);\r\n\r\n\t\t// highlight invalid fields in forms without submit button after blur/change\r\n\t\tif (!this.submittersComponent) {\r\n\t\t\tthis.changes$\r\n\t\t\t\t.pipe(\r\n\t\t\t\t\tmap(() => {\r\n\t\t\t\t\t\tconst { isDirty } = this.state$.getValue();\r\n\t\t\t\t\t\tconst { valid } = this.formGetter;\r\n\r\n\t\t\t\t\t\treturn isDirty && !valid;\r\n\t\t\t\t\t}),\r\n\t\t\t\t\tdistinctUntilChanged(),\r\n\t\t\t\t\tthis.takeUntilDestroy(),\r\n\t\t\t\t)\r\n\t\t\t\t.subscribe((isDirtyAndInvalid) => {\r\n\t\t\t\t\tif (isDirtyAndInvalid) {\r\n\t\t\t\t\t\tthis.submitForm();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\r\n\t\t\tthis.changes$,\r\n\t\t\t() => {\r\n\t\t\t\tthis.isValidChange.emit(this.formGetter.valid);\r\n\t\t\t\tthis.isInvalidChange.emit(this.formGetter.invalid);\r\n\r\n\t\t\t\t// Wait full rendering form CASEM-63898\r\n\t\t\t\tthis.setTimeout(() => {\r\n\t\t\t\t\tthis.runUpdate();\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\t// Only used inside reactive forms. Inside template-driven forms fires after init\r\n\t\tif (this.formGroup) {\r\n\t\t\tthis.formGroup.valueChanges\r\n\t\t\t\t.pipe(this.takeUntilDestroy())\r\n\t\t\t\t.subscribe((a) => {\r\n\t\t\t\t\tif (!this.state$.getValue().isChanged) {\r\n\t\t\t\t\t\tthis.setState({ isChanged: true } as Partial);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tonSubmitForm = (): any => {\r\n\t\tif (this.formGetter.valid) {\r\n\t\t\tthis.onValidSubmit();\r\n\r\n\t\t} else {\r\n\t\t\t// Wait change state in controls\r\n\t\t\tthis.setTimeout(() => {\r\n\t\t\t\tthis.scrollToInvalidControl();\r\n\t\t\t\tthis.runUpdate();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToInvalidControl(): void {\r\n\t\tconst invalidControls = filter(this.controls, (c) => !c.isValid);\r\n\t\tconst sortedControls = sortBy(invalidControls, (c) => new Rect(c.elementRef.nativeElement).lt.y);\r\n\t\tconst firstInvalidControl = sortedControls[0];\r\n\r\n\t\tif (firstInvalidControl) {\r\n\t\t\tconst controlRect = new Rect(firstInvalidControl.elementRef.nativeElement);\r\n\r\n\t\t\tif (controlRect.lt.y < 0) {\r\n\t\t\t\tconst scrollContainer = document.querySelector(this.scrollContainerSelector);\r\n\t\t\t\tscrollContainer.scrollTop += controlRect.lt.y - SCROLL_TOP_OFFSET;\r\n\t\t\t}\r\n\r\n\t\t\tif (window.innerHeight < controlRect.rb.y) {\r\n\t\t\t\tconst scrollContainer = document.querySelector(this.scrollContainerSelector);\r\n\t\t\t\tscrollContainer.scrollTop += (controlRect.rb.y - window.innerHeight) + SCROLL_TOP_OFFSET;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tregisterControl(control: CommonControlComponent) {\r\n\t\t// highlight invalid fields in forms without submit button after blur/change\r\n\t\tif (!this.submittersComponent && this.blurValidationEnabled) {\r\n\t\t\tmerge(\r\n\t\t\t\tcontrol.onBlur,\r\n\t\t\t\tcontrol.onChange,\r\n\t\t\t)\r\n\t\t\t\t.pipe(this.takeUntilDestroy())\r\n\t\t\t\t.subscribe(() => {\r\n\t\t\t\t\tthis.setState({ isDirty: true } as Partial);\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.controls.push(control);\r\n\t}\r\n\r\n\tremoveControl(control: CommonControlComponent) {\r\n\t\tremove(this.controls as any, (c) => c === control);\r\n\t}\r\n\r\n\tsubmitForm = (): void => {\r\n\t\tthis.formGetter.onSubmit(undefined);\r\n\t}\r\n\r\n\tprotected setState = (state: Partial): void => {\r\n\t\tthis.state$.next({\r\n\t\t\t...this.state$.getValue(),\r\n\t\t\t...state,\r\n\t\t});\r\n\t}\r\n\r\n\tprotected getState = (): StateType => {\r\n\t\treturn {\r\n\t\t\t...this.state$.getValue(),\r\n\t\t};\r\n\t}\r\n\r\n\tprotected abstract onValidSubmit(): Observable | void;\r\n\r\n\tprotected sendRequest> (\r\n\t\trequest$: Observable,\r\n\t\toptions: ICommonFormSubmitRequestOptions = {},\r\n\t): Observable {\r\n\t\tthis.setState({ isSaving: true } as Partial);\r\n\r\n\t\trequest$\r\n\t\t\t.pipe(\r\n\t\t\t\tthis.takeUntilDestroy(),\r\n\t\t\t\tfinalize(() => {\r\n\t\t\t\t\tif (options.onFinalize) {\r\n\t\t\t\t\t\toptions.onFinalize();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!options.hideLoaderOnlyOnError) {\r\n\t\t\t\t\t\tthis.setState({ isSaving: false } as Partial);\r\n\t\t\t\t\t}\r\n\t\t\t\t}),\r\n\t\t\t)\r\n\t\t\t.subscribe((response) => {\r\n\t\t\t\tif (response && response.IsSuccess) {\r\n\t\t\t\t\tthis.setState({ isChanged: false, isDirty: false } as Partial);\r\n\r\n\t\t\t\t\tif (options.onSuccess) {\r\n\t\t\t\t\t\toptions.onSuccess(response);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (options.hideLoaderOnlyOnError) {\r\n\t\t\t\t\t\tthis.setState({ isSaving: false } as Partial);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (options.onError) {\r\n\t\t\t\t\t\toptions.onError(response);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, (err) => {\r\n\t\t\t\tthis.setState({ isSaving: false } as Partial);\r\n\r\n\t\t\t\tif (options.onError) {\r\n\t\t\t\t\toptions.onError(err);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn err;\r\n\t\t\t});\r\n\r\n\t\treturn request$;\r\n\t}\r\n}\r\n","import {\r\n\tElementRef,\r\n\tEventEmitter,\r\n\tHostBinding,\r\n\tInput,\r\n\tOutput,\r\n\tSimpleChanges,\r\n\tDirective,\r\n} from '@angular/core';\r\nimport {\r\n\tuniqueId,\r\n\tisEqual,\r\n\tcloneDeep,\r\n\tisNil,\r\n} from 'lodash';\r\nimport {\r\n\tControlValueAccessor,\r\n\tFormControlDirective,\r\n\tFormGroupDirective,\r\n\tNgModel,\r\n} from '@angular/forms';\r\nimport { ICommonValidationComponentCustomErrors } from './validation/validation.component';\r\nimport { COMMON_CONTROL_STATUS } from './control_status.constant';\r\nimport { CommonBaseComponent } from '../../base_component/base.component';\r\nimport { CommonFormComponent } from '../../form/common-form.component/common-form.component';\r\nimport { BehaviorSubject } from 'rxjs';\r\n\r\n// TODO: Need rename to CommonBaseControl\r\n@Directive()\r\nexport class CommonControlComponent extends CommonBaseComponent implements ControlValueAccessor {\r\n\t@Input() model: ModelType; // Model input for old Angular integration mode\r\n\t@Output() modelChange = new EventEmitter(); // Model change emitter for old Angular integration mode\r\n\r\n\t@Input() get formTabIndex(): number {\r\n\t\treturn this.isDisabled ? null : this.tabIndex;\r\n\t}\r\n\tset formTabIndex(tabIndex) {\r\n\t\tthis.tabIndex = tabIndex;\r\n\t}\r\n\t@Input() isDisabled: boolean = false; // Control equivalent for disabled attribute on input element, disabled control\r\n\t@Input() isReadonly: boolean = false; // Disabled the ability to edit control model\r\n\t@Input() isOldContext: boolean; // Enabled old Angular integration mode\r\n\t@Input() oldModelCtrl: any; // Controller for old Angular ngModel\r\n\t@Input() placeholder: string = ''; // Placeholder for input (null as default, because if it is null - it is not rendered in tags)\r\n\t@Input() floatLabel: string = ''; // Float label in input\r\n\t@Input() highlight: number; // used to temporarily highlight the control\r\n\r\n\t/** @deprecated Use cssClasses from CommonBaseComponent */\r\n\t@Input() ctrlClasses: string = ''; // Css classes for control root element\r\n\t@Input() name: string = ''; // Control name for Form\r\n\t@Input() enabledValidationMessages: boolean = true;\r\n\r\n\t@Input() ignoreSubmittedForm: boolean = false;\r\n\t@Input() customErrors: ICommonValidationComponentCustomErrors; // Custom errors messages for validation\r\n\r\n\t@Output() onChange = new EventEmitter(); // Model change emitter, called when user changes the model\r\n\t@Output() onEnter = new EventEmitter();\r\n\t@Output() onKeyDown = new EventEmitter();\r\n\t@Output() onKeyUp = new EventEmitter();\r\n\t@Output() onClick = new EventEmitter();\r\n\t@Output() onFocus = new EventEmitter();\r\n\t@Output() onBlur = new EventEmitter();\r\n\t@Output() focusState = new EventEmitter();\r\n\t@Output() onRegisterRef = new EventEmitter>();\r\n\r\n\telementRef = this.injector.get(ElementRef);\r\n\tngModelControl: NgModel;\r\n\tformControlDirective: FormControlDirective;\r\n\tformGroupDirective: FormGroupDirective;\r\n\tid: string = '';\r\n\r\n\t/** @deprecated */\r\n\tisFocused: boolean = false;\r\n\r\n\tisFocused$ = new BehaviorSubject(false);\r\n\tisHovered: boolean = false;\r\n\tisPressed: boolean = false;\r\n\ttabIndex: number = 0;\r\n\r\n\tisValid: boolean;\r\n\tisShowValidation: boolean = false;\r\n\tisEmpty: boolean;\r\n\r\n\tprotected onChangeForValueAccessor: (value: ModelType) => {};\r\n\tprotected onTouchedForValueAccessor: () => {};\r\n\tprotected idKey: string = 'control_';\r\n\tprotected form: CommonFormComponent;\r\n\tprivate previousModel: ModelType; // saved prev model input for old Angular integration mode\r\n\r\n\t// highlight props start\r\n\tisBgTransitionEnabled$ = new BehaviorSubject(false); // enable background-color transition\r\n\tisHighlighted$ = new BehaviorSubject(false); // enable highlighted background-color\r\n\r\n\tprivate bgTransitionTimer: any;\r\n\tprivate highlightTimer: any;\r\n\tprivate readonly HIGHLIGHT_IN_TIME = 300;\r\n\tprivate readonly HIGHLIGHT_DELAY_TIME = 1000;\r\n\tprivate readonly HIGHLIGHT_OUT_TIME = 3000;\r\n\t// highlight props end\r\n\r\n\t@HostBinding('attr.qa-control-name') get qaControlName() {\r\n\t\treturn this.name;\r\n\t}\r\n\tset qaControlName(value) {\r\n\t\t// do nothing\r\n\t}\r\n\r\n\twriteValue(value: ModelType): void {\r\n\t\tthis.model = value;\r\n\r\n\t\tthis.onModelChange();\r\n\t\tthis.runUpdate();\r\n\t}\r\n\r\n\tregisterOnChange(fn: any): void {\r\n\t\tthis.onChangeForValueAccessor = fn;\r\n\t}\r\n\r\n\tregisterOnTouched(fn: any): void {\r\n\t\tthis.onTouchedForValueAccessor = fn;\r\n\t}\r\n\r\n\tngOnChanges(changes: SimpleChanges) {\r\n\t\tif (changes.enabledValidationMessages) {\r\n\t\t\tthis.recalcShowValidation();\r\n\t\t}\r\n\r\n\t\tif (changes.highlight && !isNil(changes.highlight.currentValue) && changes.highlight.currentValue !== changes.highlight.previousValue) {\r\n\t\t\tthis.startHighlight();\r\n\t\t}\r\n\t}\r\n\r\n\tngOnInit() {\r\n\t\tsuper.ngOnInit();\r\n\r\n\t\tthis.initNgModelControl();\r\n\t\tthis.registerControlInForm();\r\n\t\tthis.id = uniqueId(this.idKey);\r\n\r\n\t\tif (this.ngModelControl || this.formGroupDirective) {\r\n\t\t\tthis.subscribe((this.ngModelControl || this.formGroupDirective).formDirective.ngSubmit, () => {\r\n\t\t\t\tthis.onNgModelControlChange();\r\n\t\t\t});\r\n\r\n\t\t\tthis.subscribe((this.ngModelControl || this.formGroupDirective).control.statusChanges, () => {\r\n\t\t\t\tthis.onNgModelControlChange();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.oldModelCtrl) {\r\n\t\t\tthis.oldModelCtrl._ctrl_cache_$valid = this.oldModelCtrl.$valid;\r\n\r\n\t\t\tObject.defineProperty(this.oldModelCtrl, '$valid', {\r\n\t\t\t\tget: () => this.oldModelCtrl._ctrl_cache_$valid,\r\n\t\t\t\tset: (value) => {\r\n\t\t\t\t\tthis.oldModelCtrl._ctrl_cache_$valid = value;\r\n\t\t\t\t\tthis.onNgModelControlChange();\r\n\t\t\t\t},\r\n\t\t\t});\r\n\r\n\t\t\tthis.oldModelCtrl._ctrl_cache_$submitted = this.oldModelCtrl.$submitted;\r\n\r\n\t\t\tObject.defineProperty(this.oldModelCtrl.$$parentForm, '$submitted', {\r\n\t\t\t\tget: () => this.oldModelCtrl._ctrl_cache_$submitted,\r\n\t\t\t\tset: (value) => {\r\n\t\t\t\t\tthis.oldModelCtrl._ctrl_cache_$submitted = value;\r\n\t\t\t\t\tthis.onNgModelControlChange();\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.recalcShowValidation();\r\n\t\tthis.onRegisterRef.emit(this as any);\r\n\t}\r\n\r\n\tngOnDestroy() {\r\n\t\tthis.clearBgTransitionTimer();\r\n\t\tthis.clearHighlightTimer();\r\n\r\n\t\tsuper.ngOnDestroy();\r\n\t}\r\n\r\n\tprivate startHighlight () {\r\n\t\tif (this.isBgTransitionEnabled$.getValue()) {\r\n\t\t\tthis.clearBgTransitionTimer();\r\n\t\t\tthis.clearHighlightTimer();\r\n\t\t} // else nothing\r\n\r\n\t\tthis.isBgTransitionEnabled$.next(true);\r\n\t\tthis.isHighlighted$.next(true);\r\n\r\n\t\tthis.highlightTimer = setTimeout(() => {\r\n\t\t\tthis.isHighlighted$.next(false);\r\n\t\t\tthis.runUpdate();\r\n\t\t\tthis.clearHighlightTimer();\r\n\t\t}, this.HIGHLIGHT_IN_TIME + this.HIGHLIGHT_DELAY_TIME);\r\n\r\n\t\tthis.bgTransitionTimer = setTimeout(() => {\r\n\t\t\tthis.isBgTransitionEnabled$.next(false);\r\n\t\t\tthis.runUpdate();\r\n\t\t\tthis.clearBgTransitionTimer();\r\n\t\t}, this.HIGHLIGHT_IN_TIME + this.HIGHLIGHT_DELAY_TIME + this.HIGHLIGHT_OUT_TIME);\r\n\t}\r\n\r\n\tprivate clearBgTransitionTimer () {\r\n\t\tif (this.bgTransitionTimer) {\r\n\t\t\tclearTimeout(this.bgTransitionTimer);\r\n\t\t\tthis.bgTransitionTimer = null;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate clearHighlightTimer () {\r\n\t\tif (this.highlightTimer) {\r\n\t\t\tclearTimeout(this.highlightTimer);\r\n\t\t\tthis.highlightTimer = null;\r\n\t\t}\r\n\t}\r\n\r\n\t// old Angular doesn't call writeValue\r\n\tngDoCheck() {\r\n\t\tif (this.isOldContext) {\r\n\t\t\tif (!isEqual(this.previousModel, this.model)) {\r\n\t\t\t\tthis.writeValue(this.model);\r\n\t\t\t\tthis.previousModel = cloneDeep(this.model);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisSubmittedForm(): boolean {\r\n\t\tif (this.isOldContext) {\r\n\t\t\treturn this.oldModelCtrl.$$parentForm.$submitted;\r\n\r\n\t\t} else {\r\n\t\t\tif (this.ngModelControl || this.formGroupDirective) {\r\n\t\t\t\treturn (this.ngModelControl || this.formGroupDirective).formDirective.submitted;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// With zonejs\r\n\tonMouseEnterHandler(event?: Event): void {\r\n\t\tthis.zone.run(() => {\r\n\t\t\tthis.isHovered = true;\r\n\t\t});\r\n\t}\r\n\r\n\t// With zonejs\r\n\tonMouseLeaveHandler(event?: Event): void {\r\n\t\tthis.zone.run(() => {\r\n\t\t\tthis.isHovered = false;\r\n\t\t\tthis.isPressed = false;\r\n\t\t});\r\n\t}\r\n\r\n\tonFocusHandler(event: Event): void {\r\n\t\tif (this.isDisabled) {\r\n\t\t\t// blocked native focus\r\n\t\t\tevent.preventDefault();\r\n\r\n\t\t} else {\r\n\t\t\tthis.isFocused = true;\r\n\t\t\tthis.isFocused$.next(true);\r\n\t\t\tthis.focusState.emit(true);\r\n\t\t\tthis.onFocus.emit(event);\r\n\t\t}\r\n\t}\r\n\r\n\t// With zonejs\r\n\tonBlurHandler(event?: Event): void {\r\n\t\tif (this.onTouchedForValueAccessor) {\r\n\t\t\tthis.onTouchedForValueAccessor();\r\n\t\t}\r\n\r\n\t\tif (this.isFocused) {\r\n\t\t\tthis.isFocused = false;\r\n\t\t\tthis.isFocused$.next(false);\r\n\t\t\tthis.focusState.emit(false);\r\n\t\t\tthis.onBlur.emit(event);\r\n\t\t}\r\n\t}\r\n\r\n\tonMouseDownHandler(event?: MouseEvent): void {\r\n\t\tthis.isPressed = true;\r\n\t}\r\n\r\n\tonMouseUpHandler(event?: MouseEvent): void {\r\n\t\tthis.isPressed = false;\r\n\t}\r\n\r\n\tprotected initNgModelControl() {\r\n\t\t// Branching to work surrounded by the old Angular\r\n\t\tif (this.isOldContext) {\r\n\t\t\t// Attempt to find control model\r\n\t\t\ttry {\r\n\t\t\t\tthis.ngModelControl = this.injector.get(NgModel);\r\n\t\t\t} catch (e) {\r\n\t\t\t\t// Empty\r\n\t\t\t}\r\n\r\n\t\t\tthis.onModelChange();\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tthis.ngModelControl = this.injector.get(NgModel);\r\n\t\t\t} catch (e) {\r\n\t\t\t\t// Not empty\r\n\t\t\t}\r\n\r\n\t\t\tif (!this.ngModelControl) {\r\n\t\t\t\tthis.formControlDirective = this.injector.get(FormControlDirective);\r\n\t\t\t\tthis.formGroupDirective = this.injector.get(FormGroupDirective);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected registerControlInForm() {\r\n\t\tif (!this.isOldContext) {\r\n\t\t\tthis.form = this.injector.get(CommonFormComponent, null);\r\n\r\n\t\t\tif (this.form) {\r\n\t\t\t\tthis.form.registerControl(this as CommonControlComponent);\r\n\r\n\t\t\t\tthis.willUnbind(() => {\r\n\t\t\t\t\tthis.form.removeControl(this as CommonControlComponent);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected getIsValid() {\r\n\t\tif (this.isOldContext) {\r\n\t\t\tif (this.oldModelCtrl) {\r\n\t\t\t\tconst validValue = this.oldModelCtrl.$valid;\r\n\r\n\t\t\t\tif (this.ignoreSubmittedForm) {\r\n\t\t\t\t\treturn validValue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst pristineForm = !this.isSubmittedForm();\r\n\t\t\t\t\treturn pristineForm || validValue;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this.ngModelControl || this.formControlDirective) {\r\n\t\t\t\tconst isPendingAsyncValidation = (this.ngModelControl || this.formControlDirective).control.status === COMMON_CONTROL_STATUS.PENDING;\r\n\t\t\t\tconst controlIsDisabled = (this.ngModelControl || this.formControlDirective).control.status === COMMON_CONTROL_STATUS.DISABLED;\r\n\t\t\t\tconst validValue = (this.ngModelControl || this.formControlDirective).valid;\r\n\r\n\t\t\t\tif (this.ignoreSubmittedForm) {\r\n\t\t\t\t\treturn isPendingAsyncValidation || validValue || controlIsDisabled;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst pristineForm = !this.isSubmittedForm();\r\n\t\t\t\t\treturn pristineForm || isPendingAsyncValidation || validValue || controlIsDisabled;\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected getIsEmpty() {\r\n\t\treturn !this.hasValue(this.model);\r\n\t}\r\n\r\n\tprotected emitOnChange(value: ModelType) {\r\n\t\tif (this.onChangeForValueAccessor) {\r\n\t\t\tthis.onChangeForValueAccessor(value);\r\n\t\t}\r\n\r\n\t\tthis.onChange.emit(value);\r\n\t}\r\n\r\n\tprotected checkIsValid(): void {\r\n\t\tthis.isValid = this.getIsValid();\r\n\t}\r\n\r\n\tprotected onModelChange(): void {\r\n\t\tthis.isEmpty = this.getIsEmpty();\r\n\t\tthis.checkIsValid();\r\n\t}\r\n\r\n\tprotected onNgModelControlChange(): void {\r\n\t\tthis.checkIsValid();\r\n\t\tthis.runUpdate();\r\n\t}\r\n\r\n\tprivate recalcShowValidation() {\r\n\t\tthis.isShowValidation = this.enabledValidationMessages;\r\n\t}\r\n}\r\n","/**\r\n * Took from Angular AbstractControl\r\n *\r\n * The validation status of the control. There are four possible\r\n * validation status values:\r\n *\r\n * * **VALID**: This control has passed all validation checks.\r\n * * **INVALID**: This control has failed at least one validation check.\r\n * * **PENDING**: This control is in the midst of conducting a validation check.\r\n * * **DISABLED**: This control is exempt from validation checks.\r\n *\r\n * These status values are mutually exclusive, so a control cannot be\r\n * both valid AND invalid or invalid AND disabled.\r\n */\r\nexport const COMMON_CONTROL_STATUS = {\r\n\tVALID: 'VALID',\r\n\tINVALID: 'INVALID',\r\n\tPENDING: 'PENDING',\r\n\tDISABLED: 'DISABLED',\r\n};\r\n","import { COMMON_MASK_ERROR_KEY } from '@CaseOne/Common/control_validators/mask/mask.validator';\r\n\r\nexport const COMMON_PATTERN_ERROR_KEY = 'CommonPatternValidator';\r\n\r\nexport const DEFAULT_ERROR_MESSAGES = {\r\n\tmin: 'common.validation.min_common',\r\n\tmax: 'common.validation.max_common',\r\n\tminLength: 'common.validation.minlength_common',\r\n\tmaxLength: 'common.validation.maxlength_common',\r\n\t[COMMON_PATTERN_ERROR_KEY]: 'common.validation.pattern',\r\n\t[COMMON_MASK_ERROR_KEY]: 'common.validation.mask',\r\n\tincorrectDate: 'common.validation.incorrectDate',\r\n\temail: 'common.validation.email',\r\n};\r\n","
{{ message }}
","// New version src/Common/controls/control/validation/validation.component.ts CommonValidationComponent\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/widgets/validation_component_service.jsx ValidationComponent\r\n\r\nimport {\r\n\tChangeDetectionStrategy,\r\n\tComponent,\r\n\tInput,\r\n\tSimpleChanges,\r\n\tViewEncapsulation,\r\n} from '@angular/core';\r\nimport {\r\n\tNgModel,\r\n\tNgForm,\r\n\tFormControlDirective,\r\n\tFormGroupDirective,\r\n} from '@angular/forms';\r\nimport {\r\n\tforEach,\r\n\tisBoolean,\r\n\tget,\r\n\tincludes,\r\n} from 'lodash';\r\nimport { merge } from 'rxjs';\r\n\r\nimport { CommonBaseComponent } from '../../../base_component/base.component';\r\nimport { DEFAULT_ERROR_MESSAGES } from './default_error_messages.constant';\r\nimport { COMMON_REQUIRED_ERROR_KEY } from '../../../control_validators/required/required.validator';\r\nimport { COMMON_REQUIRED_ID_ERROR_KEY } from '../../../control_validators/required-id.directive/common-required-id.validator';\r\nimport { COMMON_MULTIPLE_FIELD_REQUIRED_ERROR_KEY } from '../../../control_validators/multiple-field-required/multiple-field-required.directive';\r\nimport { COMMON_REQUIRED_GROUP_ERROR_KEY } from '../../../control_validators/common-required-group/common-required-group.validator';\r\nimport {\r\n\tCOMMON_FILE_UPLOADING_ERROR_KEY\r\n} from '@CaseOne/Common/files-uploading/file-uploading.validator/common-file-uploading.validator';\r\nimport { COMMON_MASK_ERROR_KEY } from '@CaseOne/Common/control_validators/mask/mask.validator';\r\n\r\ndeclare const COMPONENT_SPECS_MODE: boolean;\r\n\r\nexport interface ICommonValidationComponentCustomErrors {\r\n\t[errorName: string]: string,\r\n}\r\n\r\nexport interface ICommonValidationComponentError {\r\n\tmessage: string,\r\n\tcontext: {\r\n\t\t[key: string]: any,\r\n\t},\r\n}\r\n\r\nexport type TCommonValidationComponentError = ICommonValidationComponentError | boolean;\r\n\r\n@Component({\r\n\tselector: 'common-validation',\r\n\ttemplateUrl: './validation.component.pug',\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n\tstyleUrls: [\r\n\t\t'./validation.component.sass',\r\n\t],\r\n\tencapsulation: ViewEncapsulation.None,\r\n})\r\nexport class CommonValidationComponent extends CommonBaseComponent {\r\n\t@Input() customErrors: ICommonValidationComponentCustomErrors;\r\n\t@Input() ngModelControl: NgModel;\r\n\t@Input() formControlDirective: FormControlDirective;\r\n\t@Input() formGroupDirective: FormGroupDirective;\r\n\t@Input() isShow: boolean = true;\r\n\t@Input() set commonMaxForMessage(max: number) {\r\n\t\tif (typeof(max) === 'number') {\r\n\t\t\tthis.computedErrorMessages.max = this.instant('common.validation.max', { value: max });\r\n\t\t}\r\n\t}\r\n\t@Input() set commonMinForMessage(min: number) {\r\n\t\tif (typeof(min) === 'number') {\r\n\t\t\tthis.computedErrorMessages.min = this.instant('common.validation.min', { value: min });\r\n\t\t}\r\n\t}\r\n\t@Input() set commonMinLengthForMessage(min: number) {\r\n\t\tif (typeof(min) === 'number') {\r\n\t\t\tthis.computedErrorMessages.minLength = this.instant('common.validation.minlength', { value: min });\r\n\t\t}\r\n\t}\r\n\t@Input() set commonMaxLengthForMessage(max: number) {\r\n\t\tif (typeof(max) === 'number') {\r\n\t\t\tthis.computedErrorMessages.maxLength = this.instant('common.validation.maxlength', { value: max });\r\n\t\t}\r\n\t}\r\n\r\n\tpublic message: string = '';\r\n\r\n\tprivate isModelControlInit = false;\r\n\r\n\tprivate computedErrorMessages = {\r\n\t\tmax: null,\r\n\t\tmin: null,\r\n\t\tmaxLength: null,\r\n\t\tminLength: null,\r\n\t};\r\n\r\n\tngOnChanges(changes: SimpleChanges) {\r\n\t\tsuper.ngOnChanges(changes);\r\n\r\n\t\tif (!this.isModelControlInit) {\r\n\t\t\tif (changes.ngModelControl && changes.ngModelControl.currentValue) {\r\n\t\t\t\tmerge(\r\n\t\t\t\t\tthis.ngModelControl.formDirective.ngSubmit,\r\n\t\t\t\t\tthis.ngModelControl.update,\r\n\t\t\t\t\tthis.ngModelControl.control.statusChanges,\r\n\t\t\t\t)\r\n\t\t\t\t\t.pipe(this.takeUntilDestroy())\r\n\t\t\t\t\t.subscribe(() => this.setMessage());\r\n\r\n\t\t\t\tthis.isModelControlInit = true;\r\n\t\t\t}\telse if (changes.formControlDirective && changes.formControlDirective.currentValue) {\r\n\t\t\t\tmerge(\r\n\t\t\t\t\t(this.formGroupDirective.formDirective as FormGroupDirective).ngSubmit,\r\n\t\t\t\t\tthis.formControlDirective.control.valueChanges,\r\n\t\t\t\t\tthis.formControlDirective.control.statusChanges,\r\n\t\t\t\t)\r\n\t\t\t\t\t.pipe(this.takeUntilDestroy())\r\n\t\t\t\t\t.subscribe(() => this.setMessage());\r\n\r\n\t\t\t\tthis.isModelControlInit = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setMessage();\r\n\t}\r\n\r\n\tprivate getMessage(): string {\r\n\t\tlet result = '';\r\n\r\n\t\tif ((this.ngModelControl || this.formControlDirective) && this.isShow) {\r\n\t\t\tconst formDirective: NgForm = (this.ngModelControl || this.formGroupDirective).formDirective;\r\n\t\t\tconst formControl = this.ngModelControl || this.formControlDirective;\r\n\r\n\t\t\tif (formDirective.submitted && !formControl.valid) {\r\n\t\t\t\tforEach(formControl.errors, (val: TCommonValidationComponentError, errorName) => {\r\n\t\t\t\t\tif (!val) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet message = DEFAULT_ERROR_MESSAGES[errorName];\r\n\t\t\t\t\tlet context = {};\r\n\r\n\t\t\t\t\tif (!isBoolean(val)) {\r\n\t\t\t\t\t\tcontext = val.context || context;\r\n\t\t\t\t\t\tmessage = val.message || message;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tmessage = get(this.customErrors, errorName) || get(this.computedErrorMessages, errorName) || message;\r\n\r\n\t\t\t\t\tif (!message) {\r\n\t\t\t\t\t\tif (!includes([\r\n\t\t\t\t\t\t\tCOMMON_REQUIRED_ERROR_KEY,\r\n\t\t\t\t\t\t\tCOMMON_REQUIRED_ID_ERROR_KEY,\r\n\t\t\t\t\t\t\tCOMMON_MULTIPLE_FIELD_REQUIRED_ERROR_KEY,\r\n\t\t\t\t\t\t\tCOMMON_REQUIRED_GROUP_ERROR_KEY,\r\n\t\t\t\t\t\t\tCOMMON_FILE_UPLOADING_ERROR_KEY,\r\n\t\t\t\t\t\t\tCOMMON_MASK_ERROR_KEY,\r\n\t\t\t\t\t\t], errorName)) {\r\n\t\t\t\t\t\t\tconsole.warn('CommonValidationComponent#getMessage not have message for error', errorName, !COMPONENT_SPECS_MODE && this);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tmessage = this.instant(message, context);\r\n\t\t\t\t\tresult = message || result;\r\n\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tprivate setMessage() {\r\n\t\tthis.message = this.getMessage();\r\n\t\tthis.runUpdate();\r\n\t}\r\n}\r\n","import { Directive, Input } from '@angular/core';\r\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator} from '@angular/forms';\r\nimport { commonUtilitiesCoreService } from '../../utilities/core.service';\r\n\r\nexport const COMMON_MULTIPLE_FIELD_REQUIRED_ERROR_KEY = 'CommonMultipleFieldRequired';\r\n\r\n@Directive({\r\n\tselector: '[commonMultipleFieldRequired]',\r\n\tproviders: [{\r\n\t\tprovide: NG_VALIDATORS,\r\n\t\tuseExisting: CommonMultipleFieldRequiredDirective,\r\n\t\tmulti: true,\r\n\t}],\r\n})\r\nexport class CommonMultipleFieldRequiredDirective implements Validator {\r\n\t@Input('commonMultipleFieldRequired') enabled: boolean;\r\n\t@Input() minModelField: string;\r\n\t@Input() maxModelField: string;\r\n\r\n\tvalidate(control: AbstractControl): ValidationErrors | null {\r\n\t\tconst valueIsEmpty =\r\n\t\t\t!commonUtilitiesCoreService.hasValue(control.value)\r\n\t\t\t|| (\r\n\t\t\t\t!commonUtilitiesCoreService.hasValue(control.value[this.minModelField])\r\n\t\t\t\t&& !commonUtilitiesCoreService.hasValue(control.value[this.maxModelField])\r\n\t\t\t);\r\n\r\n\t\tif (this.enabled !== false && valueIsEmpty) {\r\n\t\t\treturn { [COMMON_MULTIPLE_FIELD_REQUIRED_ERROR_KEY]: true };\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { AbstractControl, ValidationErrors } from '@angular/forms';\r\nimport { isEmpty, every, forEach } from 'lodash';\r\nimport { CommonValidator } from '../common-validator';\r\n\r\nexport const COMMON_REQUIRED_GROUP_ERROR_KEY = 'commonRequiredGroup';\r\nexport interface ICommonRequiredGroupValidatorContext {\r\n\tgroup: ICommonRequiredGroupValidatorGroup,\r\n}\r\n\r\nexport interface ICommonRequiredGroupValidatorGroup {\r\n\tcontrols: AbstractControl[],\r\n\toldIsValidFlag: boolean,\r\n}\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonRequiredGroupValidator extends CommonValidator {\r\n\tgetValidator(context: ICommonRequiredGroupValidatorContext) {\r\n\t\tconst updateOtherControls = (group, control, isValid) => {\r\n\t\t\tif (group.oldIsValidFlag !== isValid) {\r\n\t\t\t\tgroup.oldIsValidFlag = isValid;\r\n\r\n\t\t\t\tforEach(group.controls, (c: AbstractControl) => {\r\n\t\t\t\t\tif (c !== control) {\r\n\t\t\t\t\t\tc.updateValueAndValidity({ onlySelf: true, emitEvent: false });\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn (control: AbstractControl): ValidationErrors | null => {\r\n\t\t\tconst group = context.group;\r\n\t\t\tconst isEmptyAll = every(group.controls, (c: AbstractControl) => {\r\n\t\t\t\treturn isEmpty(c.value);\r\n\t\t\t});\r\n\r\n\t\t\tif (isEmptyAll) {\r\n\t\t\t\tupdateOtherControls(group, control, true);\r\n\t\t\t\treturn null;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tconst isAllHaveValue = every(group.controls, (c: AbstractControl) => {\r\n\t\t\t\t\treturn !isEmpty(c.value);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tupdateOtherControls(group, control, isAllHaveValue);\r\n\r\n\t\t\t\tif (isAllHaveValue) {\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (isEmpty(control.value)) {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t[COMMON_REQUIRED_GROUP_ERROR_KEY]: true,\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n","import {\r\n\tAbstractControl,\r\n\tNG_VALIDATORS,\r\n\tValidator,\r\n} from '@angular/forms';\r\nimport { Directive } from '@angular/core';\r\nimport {\r\n\tisArray,\r\n\tfind,\r\n} from 'lodash';\r\nimport { ICommonFile } from '../uploading-files.service/common-uploading-files.intarfaces';\r\n\r\nexport const COMMON_FILE_UPLOADING_ERROR_KEY = 'fileUploading';\r\n\r\n@Directive({\r\n\tselector: '[commonFileUploadingValidator]',\r\n\tproviders: [{\r\n\t\tprovide: NG_VALIDATORS,\r\n\t\tuseExisting: CommonFileUploadingValidatorDirective,\r\n\t\tmulti: true,\r\n\t}],\r\n})\r\nexport class CommonFileUploadingValidatorDirective implements Validator {\r\n\tvalidate(control: AbstractControl): {[key: string]: any} | null {\r\n\t\tlet files = [];\r\n\r\n\t\tif (control.value) {\r\n\t\t\tfiles = !isArray(control.value) ? [control.value] : control.value;\r\n\t\t}\r\n\r\n\t\tconst foundUploadingFile = find(files, (file: ICommonFile) => file.isUploading);\r\n\r\n\t\tif (foundUploadingFile) {\r\n\t\t\treturn {\r\n\t\t\t\t[COMMON_FILE_UPLOADING_ERROR_KEY]: true,\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { AbstractControl, ValidationErrors } from '@angular/forms';\r\nimport { CommonValidator } from '../common-validator';\r\nimport { hasValue } from '../../utilities/core.service';\r\nimport { CommonInputMaskService } from '../../inputmask/services/common-inputmask.service';\r\n\r\nexport const COMMON_MASK_ERROR_KEY = 'CommonMaskValidator';\r\nexport interface ICommonMaskValidatorContext {\r\n\tmask?: string,\r\n}\r\n\r\n@Injectable()\r\nexport class CommonMaskValidator extends CommonValidator {\r\n\tconstructor(private maskService: CommonInputMaskService) {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tgetValidator(context: ICommonMaskValidatorContext = {}) {\r\n\t\treturn (control: AbstractControl): ValidationErrors | null => {\r\n\t\t\tconst isHasValue = hasValue(control.value);\r\n\r\n\t\t\tif (isHasValue && context.mask && !this.maskService.isValidMaskValue(control.value, context.mask)) {\r\n\t\t\t\treturn { [COMMON_MASK_ERROR_KEY]: true };\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n","
{{ floatLabel }}
{{ charsLeft }}
","// New version src/Common/controls/textfield/textfield.component.ts CommonTextfieldComponent\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/controls/common_controls_textfield_module/ctrl_textfield_component_service.jsx CtrlTextfieldComponent\r\n\r\nimport {\r\n\tComponent,\r\n\tInput,\r\n\tElementRef,\r\n\tViewChild,\r\n\tSimpleChanges,\r\n\tforwardRef,\r\n\tChangeDetectionStrategy,\r\n\tViewEncapsulation,\r\n\tSkipSelf,\r\n} from '@angular/core';\r\nimport { ControlContainer, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport {\r\n\tforEach,\r\n\tisString,\r\n\tisNumber,\r\n} from 'lodash';\r\nimport * as Inputmask from 'inputmask';\r\n\r\nimport { commonBrowserService } from '../../browser/common-browser.service';\r\nimport { commonUtilitiesCoreService } from '../../utilities/core.service';\r\nimport { COMMON_KEYBOARD_KEY } from '../../constants/keyboard.constant';\r\nimport { TCallbackFunc, THTMLInputType } from '../../interfaces/core';\r\nimport { CommonDebugComponent } from '../control/debug/debug.decorator';\r\nimport { CommonControlComponent } from '../control/control.class';\r\nimport { COMMON_THROTTLE_MILLISECONDS } from '../control/throttler_milliseconds.constant';\r\nimport { COMMON_HOT_KEYS } from '../control/hot_keys.constant';\r\nimport { COMMON_SUGGEST_OFF_PROPERTY } from '../control/autocomplete_off_property.constant';\r\n\r\n\r\nexport type TCommonTextfieldModel = string | number;\r\n\r\n@CommonDebugComponent({\r\n\tname: 'common-textfield',\r\n\tdesignLink: 'https://app.zeplin.io/project/591460ff7793c56928756817/screen/594a79f173e050bcc42578c8',\r\n\tdescription: 'Text field for forms',\r\n\ttestsFile: require('!raw-loader!./textfield.tests.spec.ts'),\r\n\tprops: {\r\n\t\tmodel: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Model',\r\n\t\t\tdefaultValue: 'Custom text',\r\n\t\t},\r\n\t\tisDisabled: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Control disabling',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tisReadonly: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Controls readonly state',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tinputMask: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Mask for textfield (ex. casem-numeric)',\r\n\t\t\tdefaultValue: '',\r\n\t\t},\r\n\t\tinputMaskParams: {\r\n\t\t\ttype: 'interface',\r\n\t\t\tdescription: 'Params for inputmask',\r\n\t\t\tdefaultValue: {\r\n\t\t\t\tmax: 10,\r\n\t\t\t},\r\n\t\t},\r\n\t\tinputMaskUnmaskedValue: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Model is masks value, not masks text',\r\n\t\t\tdefaultValue: true,\r\n\t\t},\r\n\t\tplaceholder: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Textfield placeholder',\r\n\t\t\tdefaultValue: 'Placeholder',\r\n\t\t},\r\n\t\tfloatLabel: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Label above placeholder',\r\n\t\t\tdefaultValue: 'FloatLabel',\r\n\t\t},\r\n\t\tautocomplete: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Browsers automplete mode',\r\n\t\t\tdefaultValue: 'off',\r\n\t\t},\r\n\t\tname: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Name in form',\r\n\t\t\tdefaultValue: 'Name',\r\n\t\t},\r\n\t\ttype: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Type of imput (THTMLInputType)',\r\n\t\t\tdefaultValue: 'text',\r\n\t\t},\r\n\t\ticonClasses: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'CSS classes for icon',\r\n\t\t\tdefaultValue: '',\r\n\t\t},\r\n\t\thideCount: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Hides the number of remaining letters',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tctrlClasses: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'CSS classes for control',\r\n\t\t\tdefaultValue: 'b-textfield--border_bottom',\r\n\t\t},\r\n\t\thasClearIcon: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Hides clear icon',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\thasDebounce: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Delayed model changing',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tisUrl: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Showed text as url',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tparseUrl: {\r\n\t\t\ttype: 'function',\r\n\t\t\tdescription: 'Function for parsing value to url',\r\n\t\t\tdefaultValue: null,\r\n\t\t},\r\n\t\tisLoading: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Showed loader',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\thasLoaderDelay: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Delay berfore loader showed',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tisUseHint: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Hint on not focused fields',\r\n\t\t\tdefaultValue: false,\r\n\t\t},\r\n\t\tmaxLength: {\r\n\t\t\ttype: 'number',\r\n\t\t\tdescription: 'Max letters in field',\r\n\t\t\tdefaultValue: undefined,\r\n\t\t},\r\n\t\tonFocus: {\r\n\t\t\ttype: 'function',\r\n\t\t\tdescription: 'Focus event',\r\n\t\t\tdefaultValue: null,\r\n\t\t},\r\n\t},\r\n\tstates: {\r\n\t\tisFocused: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Control is focused',\r\n\t\t},\r\n\t\tisHovered: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Cursor is over control',\r\n\t\t},\r\n\t\tvalue: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Value in first cycle value -> model -> value',\r\n\t\t},\r\n\t\tinputValue: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Value in second cycle. Used for set value in input',\r\n\t\t},\r\n\t\tisInputMaskInitialized: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Indicate than input mask have been initialized. Dont correctly runing again',\r\n\t\t},\r\n\t\tcharsLeft: {\r\n\t\t\ttype: 'number',\r\n\t\t\tdescription: 'Amount of remained characters in string',\r\n\t\t},\r\n\t\tcancelSetModel: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'There is awaiting before value writed in model',\r\n\t\t\tget: (component) => !!component.cancelSetModel,\r\n\t\t\tset: () => void(0),\r\n\t\t},\r\n\t\tisHintOn: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Hint on',\r\n\t\t},\r\n\t\thintValue: {\r\n\t\t\ttype: 'string',\r\n\t\t\tdescription: 'Hint text',\r\n\t\t},\r\n\t\tisValid: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Control is valid',\r\n\t\t},\r\n\t\tisEmpty: {\r\n\t\t\ttype: 'boolean',\r\n\t\t\tdescription: 'Control is empty',\r\n\t\t},\r\n\t},\r\n})\r\n@Component({\r\n\tselector: 'common-textfield',\r\n\ttemplateUrl: './textfield.component.pug',\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n\tstyleUrls: ['./textfield.component.sass'],\r\n\tproviders: [\r\n\t\t{\r\n\t\t\tprovide: NG_VALUE_ACCESSOR,\r\n\t\t\tuseExisting: forwardRef(() => CommonTextfieldComponent),\r\n\t\t\tmulti: true,\r\n\t\t},\r\n\t],\r\n\tencapsulation: ViewEncapsulation.None,\r\n\tviewProviders: [\r\n\t\t{\r\n\t\t\tprovide: ControlContainer,\r\n\t\t\tuseFactory: (container: ControlContainer) => container,\r\n\t\t\tdeps: [[new SkipSelf(), ControlContainer]],\r\n\t\t},\r\n\t],\r\n})\r\nexport class CommonTextfieldComponent extends CommonControlComponent {\r\n\t@Input() inputMask: string = '';\r\n\t@Input() inputMaskParams: any = null; // interface\r\n\t@Input() inputMaskUnmaskedValue: boolean = false;\r\n\t@Input() autocomplete: string = COMMON_SUGGEST_OFF_PROPERTY;\r\n\t@Input() type: THTMLInputType = 'text';\r\n\t@Input() iconClasses: string = '';\r\n\t@Input() hideCount: boolean = true;\r\n\t@Input() hasClearIcon: boolean = false;\r\n\t@Input() hasDebounce: boolean = false;\r\n\t@Input() isUrl: boolean = false;\r\n\t@Input() parseUrl: (value: string) => string;\r\n\t@Input() isLoading: boolean = false;\r\n\t@Input() hasLoaderDelay: boolean = false;\r\n\t@Input() maxLength: number;\r\n\t@Input() commonMaxForMessage: number;\r\n\t@Input() commonMinForMessage: number;\r\n\t@Input() commonMaxLengthForMessage: number;\r\n\t@Input() commonMinLengthForMessage: number;\r\n\t@Input() withRightIcon: boolean;\r\n\r\n\t@Input() titleExternal: string;\r\n\r\n\t@Input() isUseHint: boolean = false;\r\n\t@Input() onHint: (model: TCommonTextfieldModel) => string;\r\n\r\n\tvalue: string = '';\r\n\ttitleValue: string = '';\r\n\tinputValue: string = '';\r\n\thintValue: string = '';\r\n\tisHintOn: boolean = false;\r\n\tcharsLeft: number = 0;\r\n\r\n\t@ViewChild('input', { static: true }) public inputRef: ElementRef;\r\n\tprotected idKey: string = 'textfield_';\r\n\tprotected isInputMaskInitialized: boolean = false;\r\n\tprotected inputMaskEventRemover: () => void;\r\n\tprotected formatterInput: HTMLInputElement;\r\n\tprotected cancelSetModel: () => void;\r\n\r\n\tprivate isOnFocusEmitDisabled = false;\r\n\r\n\tngOnInit() {\r\n\t\tsuper.ngOnInit();\r\n\r\n\t\tthis.value = this.formattedModel(this.model);\r\n\t\tthis.setInputValue(this.value);\r\n\t\tthis.charsLeft = this.getCharsLeft(this.value);\r\n\r\n\t\tif (this.isNeedEnableHint(this.model)) {\r\n\t\t\tthis.hintValue = this.onHint(this.model);\r\n\t\t\tthis.isHintOn = true;\r\n\t\t}\r\n\t}\r\n\r\n\tngOnChanges(changes: SimpleChanges) {\r\n\t\tsuper.ngOnChanges(changes);\r\n\r\n\t\tif (changes.model) {\r\n\t\t\tthis.updateModel(changes.model.previousValue, changes.model.currentValue);\r\n\t\t}\r\n\r\n\t\tif (changes.inputMask) {\r\n\t\t\t// remove old Mask\r\n\t\t\tif (this.isInputMaskInitialized) {\r\n\t\t\t\tconst input = this.inputRef.nativeElement;\r\n\r\n\t\t\t\tthis.inputMaskEventRemover();\r\n\t\t\t\tthis.inputMaskEventRemover = null;\r\n\t\t\t\tinput.inputmask.remove();\r\n\t\t\t\tthis.isInputMaskInitialized = false;\r\n\t\t\t}\r\n\r\n\t\t\t// Set new Mask\r\n\t\t\tif (changes.inputMask.currentValue) {\r\n\t\t\t\tthis.initInputMask();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (changes.titleExternal) {\r\n\t\t\tthis.setTitleValue();\r\n\t\t\tthis.runUpdate();\r\n\t\t}\r\n\t}\r\n\r\n\twriteValue(value: any): void {\r\n\t\tthis.updateModel(this.model, value);\r\n\t\tthis.onModelChange();\r\n\t\tthis.runUpdate();\r\n\t}\r\n\r\n\tisWithRightIcon(): boolean {\r\n\t\treturn this.hasClearIcon || this.isUrl || this.isLoading || this.withRightIcon;\r\n\t}\r\n\r\n\tisWithCount(): boolean {\r\n\t\treturn !!this.maxLength && !this.hideCount && !this.isDisabled;\r\n\t}\r\n\r\n\t// With zonejs\r\n\tonFocusHandler(event: Event): void {\r\n\t\tif (this.isDisabled || this.isOnFocusEmitDisabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.initInputMask();\r\n\t\tsuper.onFocusHandler(event);\r\n\t\tthis.onFocus.emit(event);\r\n\t\tthis.disableHint();\r\n\t}\r\n\r\n\t// Blur with zonejs\r\n\tonBlurHandler(event: Event): void {\r\n\t\tif (this.isDisabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet model = this.model;\r\n\r\n\t\t// Cancel debounce and set model\r\n\t\tif (this.cancelSetModel) {\r\n\t\t\tthis.cancelSetModel();\r\n\t\t\tmodel = this.parseValue(this.value);\r\n\t\t\tthis.setModel(model);\r\n\t\t}\r\n\r\n\t\tsuper.onBlurHandler(event);\r\n\r\n\t\tthis.timeout(() => {\r\n\t\t\tthis.checkHint(model);\r\n\t\t});\r\n\t}\r\n\r\n\tcheckHint(model = this.model) {\r\n\t\tif (this.isNeedEnableHint(model)) {\r\n\t\t\tthis.enableHint(model);\r\n\t\t\tthis.runUpdate();\r\n\t\t}\r\n\t}\r\n\r\n\t// Without zonejs\r\n\tonKeyDownInput(event: KeyboardEvent): void {\r\n\t\tif (this.isDisabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// const normalizeEvent = this.getNormalizeEvent(event);\r\n\r\n\t\tif (event.which === COMMON_HOT_KEYS.ENTER || event.key === COMMON_KEYBOARD_KEY.ENTER) {\r\n\t\t\tthis.onEnter.emit(event);\r\n\t\t}\r\n\r\n\t\tthis.onKeyDown.emit(event);\r\n\t}\r\n\r\n\t// Without zonejs\r\n\tonKeyUpInput(event: KeyboardEvent): void {\r\n\t\t// For input mask\r\n\t\tthis.onChangeInput(this.inputRef.nativeElement.value, event);\r\n\r\n\t\tif (!this.isDisabled) {\r\n\t\t\tthis.onKeyUp.emit(event);\r\n\t\t}\r\n\t}\r\n\r\n\t// With zonejs\r\n\tonMouseUpInput(event: MouseEvent): void {\r\n\t\tif (commonBrowserService.browser.ie && event.which === COMMON_HOT_KEYS.RIGHT_MOUSE) {\r\n\t\t\tthis.focus();\r\n\t\t}\r\n\t}\r\n\r\n\t// With zonejs\r\n\tonClickHandler(event?: MouseEvent): void {\r\n\t\tif (!this.isDisabled) {\r\n\t\t\tthis.onClick.emit(event);\r\n\t\t}\r\n\t}\r\n\r\n\t// Without zonejs\r\n\tonChangeInput(value: string, event: Event) {\r\n\t\tif (this.isDisabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst oldValue = this.value;\r\n\r\n\t\tif (value === oldValue) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Saves async access to variables of an event (react)\r\n\t\t// event.persist && event.persist();\r\n\r\n\t\tconst parseValue = this.parseValue(value);\r\n\r\n\t\tthis.setValue(value, parseValue);\r\n\r\n\t\tif (this.isInputMaskInitialized && this.inputMask) {\r\n\t\t\tconst inputmask = this.inputRef.nativeElement.inputmask;\r\n\t\t\tconst unmaskAsNumber = inputmask.option('unmaskAsNumber');\r\n\r\n\t\t\t// Save '-' when user writes the first character\r\n\t\t\tif (!(unmaskAsNumber && oldValue === '' && value === '-')) {\r\n\t\t\t\tthis.debounceSetModel(parseValue);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.debounceSetModel(parseValue);\r\n\t\t}\r\n\t}\r\n\r\n\tselectAll() {\r\n\t\tthis.focus();\r\n\r\n\t\tif (this.value) {\r\n\t\t\tthis.inputRef.nativeElement.setSelectionRange(0, this.value.length);\r\n\t\t}\r\n\t}\r\n\r\n\tprotected updateModel(oldModel, newModel) {\r\n\t\tconst hasValueInModels = commonUtilitiesCoreService.hasValue(newModel) || commonUtilitiesCoreService.hasValue(oldModel);\r\n\r\n\t\tif (hasValueInModels && newModel !== oldModel) {\r\n\t\t\t// Filter the placeholder value for IE\r\n\t\t\tif (this.isInputMaskInitialized && this.inputMask) {\r\n\t\t\t\tconst inputmask = this.inputRef.nativeElement.inputmask;\r\n\t\t\t\tconst unMaskValue = inputmask.unmaskedvalue();\r\n\r\n\t\t\t\tif (unMaskValue !== newModel) {\r\n\t\t\t\t\tconst newValue = this.formattedModel(newModel);\r\n\t\t\t\t\tconst placeholder = inputmask.option('placeholder');\r\n\r\n\t\t\t\t\tif (!(placeholder && newValue === '' && unMaskValue === '' && this.value === placeholder)) {\r\n\t\t\t\t\t\tthis.setValue(newValue, newModel);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.model = newModel;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst newValue = this.formattedModel(newModel);\r\n\t\t\t\tthis.setValue(newValue, newModel);\r\n\t\t\t}\r\n\r\n\t\t\tif (this.isNeedEnableHint(newModel)) {\r\n\t\t\t\tthis.enableHint(newModel);\r\n\t\t\t} else {\r\n\t\t\t\tthis.disableHint();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected focus() {\r\n\t\tthis.inputRef.nativeElement.focus();\r\n\t}\r\n\r\n\tprotected initInputMask() {\r\n\t\tif (!this.isInputMaskInitialized && this.inputMask) {\r\n\t\t\tconst input = this.inputRef.nativeElement;\r\n\r\n\t\t\t// https://jira.parcsis.org/browse/CASEM-55856\r\n\t\t\t// IE Workaround: Setting of inputmask triggers focus event on input that propagates to upper wrappers\r\n\t\t\t// https://github.com/RobinHerbots/Inputmask/issues/2358 - issue with similar behavior\r\n\t\t\t// Solution: disable onFocus emit for period of initializing mask and call blur on input\r\n\t\t\tif (commonBrowserService.browser.ie) {\r\n\t\t\t\tthis.isOnFocusEmitDisabled = true;\r\n\r\n\t\t\t\tInputmask(this.inputMask, this.inputMaskParams).mask(input);\r\n\r\n\t\t\t\tthis.timeout(() => {\r\n\t\t\t\t\tthis.isOnFocusEmitDisabled = false;\r\n\t\t\t\t\tinput.blur();\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tInputmask(this.inputMask, this.inputMaskParams).mask(input);\r\n\t\t\t}\r\n\r\n\t\t\tconst removeFormEventRemover = this.willUnbind(() => {\r\n\t\t\t\t// When run \"inputmask.remove()\" \"input\" is not have \"form\" field,\r\n\t\t\t\t// so inputmask can't remove \"submit\" handler\r\n\t\t\t\t// https://jira.parcsis.org/browse/CASEM-26200\r\n\t\t\t\tconst events = input.inputmask.events;\r\n\t\t\t\tconst form = input.form;\r\n\r\n\t\t\t\tforEach(events, (eventHandlers, eventName) => {\r\n\t\t\t\t\tif (-1 < ['submit', 'reset'].indexOf(eventName) && input.form) {\r\n\t\t\t\t\t\twhile (0 < eventHandlers.length) {\r\n\t\t\t\t\t\t\tconst eventHandler = eventHandlers.pop();\r\n\t\t\t\t\t\t\tform.removeEventListener(eventName, eventHandler);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tdelete events[eventName];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// timeout so that the events on submit do not break, then remove the mask\r\n\t\t\t\t// https://jira.parcsis.org/browse/CASEM-22727\r\n\t\t\t\tthis.timeout(() => {\r\n\t\t\t\t\tif (input.inputmask) {\r\n\t\t\t\t\t\tinput.inputmask.remove();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\t// Input mask beak event change\r\n\t\t\t// in IE without incomplete the garbage gets to model\r\n\r\n\t\t\t// The 'blur' event is needed to update numbers in the model, if inputmask params has min, max values\r\n\t\t\t// https://jira.parcsis.org/browse/CASEM-23473\r\n\t\t\t// const removeEventRemover = this.willUnbind(\r\n\t\t\t// \tthis.onEvent(input, 'keyup keydown paste cut incomplete blur', (event) => this.onChangeInput(input.value, event)),\r\n\t\t\t// );\r\n\r\n\t\t\tthis.inputMaskEventRemover = () => {\r\n\t\t\t\tremoveFormEventRemover();\r\n\t\t\t\t// removeEventRemover(true);\r\n\t\t\t};\r\n\r\n\t\t\tthis.isInputMaskInitialized = true;\r\n\r\n\t\t\tthis.setValue(this.formattedModel(this.model), this.model);\r\n\t\t}\r\n\t}\r\n\r\n\t// Formats value of model till a line of an input\r\n\tprotected formattedModel(model: TCommonTextfieldModel): string {\r\n\t\tconst maxLength = this.maxLength;\r\n\t\tlet result: string = '';\r\n\r\n\t\tif (isString(model)) {\r\n\t\t\tresult = model;\r\n\t\t}\r\n\r\n\t\tif (isNumber(model) && isFinite(model)) {\r\n\t\t\tresult = model.toString();\r\n\t\t}\r\n\r\n\t\tresult = result.trim();\r\n\r\n\t\tif (maxLength && result.length > maxLength) {\r\n\t\t\tresult = this.limitTo(result, maxLength);\r\n\t\t}\r\n\r\n\t\t// In IE in case of an initialization doesn't fulfill input a mask\r\n\t\t// Blank lines not to lay down, behaves inadequately\r\n\t\tif (result && this.inputMask) {\r\n\t\t\tconst inputmask = new Inputmask(this.inputMask, this.inputMaskParams);\r\n\t\t\tconst autoUnmask = inputmask.option('autoUnmask');\r\n\t\t\tconst radixPoint = inputmask.option('radixPoint');\r\n\r\n\t\t\tif (!autoUnmask || !this.isInputMaskInitialized) {\r\n\t\t\t\t// Inputmask have incorrect formating for `format` method\r\n\t\t\t\t// Because using default mechanism\r\n\t\t\t\tif (!this.formatterInput) {\r\n\t\t\t\t\tthis.formatterInput = document.createElement('input');\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// CASEM-63584: radixPoint in the value must match the inputmask settings radixPoint\r\n\t\t\t\t// https://github.com/RobinHerbots/Inputmask/blob/5.x/README_numeric.md#inputtype\r\n\t\t\t\tif (radixPoint) {\r\n\t\t\t\t\tresult = result.replace('.', radixPoint);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.formatterInput.value = result;\r\n\t\t\t\tinputmask.mask(this.formatterInput);\r\n\t\t\t\tresult = (this.formatterInput as any).inputmask.maskset.buffer.join('');\r\n\t\t\t\t(this.formatterInput as any).inputmask.remove();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t// input value -> model\r\n\tprotected parseValue(inputValue: string): TCommonTextfieldModel {\r\n\t\tconst maxLength = this.maxLength;\r\n\t\tlet value: TCommonTextfieldModel = inputValue.trim();\r\n\r\n\t\tif (maxLength) {\r\n\t\t\tvalue = this.limitTo(value, maxLength);\r\n\t\t}\r\n\r\n\t\tif (this.isInputMaskInitialized && this.inputMask) {\r\n\t\t\tconst input = this.inputRef.nativeElement;\r\n\t\t\tconst inputmask = input.inputmask;\r\n\t\t\tconst unmaskAsNumber = inputmask.option('unmaskAsNumber');\r\n\t\t\tconst autoUnmask = inputmask.option('autoUnmask');\r\n\t\t\tconst unMaskValue = inputmask.unmaskedvalue();\r\n\t\t\tconst placeholder = inputmask.option('placeholder');\r\n\r\n\t\t\t// Filter the placeholder value for IE\r\n\t\t\tif (placeholder && unMaskValue === '' && value === placeholder) {\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\r\n\t\t\tif (this.inputMaskUnmaskedValue || autoUnmask || unmaskAsNumber) {\r\n\t\t\t\tvalue = unMaskValue;\r\n\r\n\t\t\t\tif (isString(value)) {\r\n\t\t\t\t\tvalue = value.trim();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Because of check (unmaskedValue = opts.onUnMask(bufferValue, unmaskedValue, opts) || unmaskedValue)\r\n\t\t\t\t// for numerical masks method unmaskedvalue return 0 as string, it is necessary to put this crutch\r\n\t\t\t\t// https://github.com/RobinHerbots/jquery.inputmask/blob/3.x/js/inputmask.js#L1736\r\n\t\t\t\tif (unmaskAsNumber && value === '0') {\r\n\t\t\t\t\tvalue = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// In IE return '0' with empty sting in input\r\n\t\t\t\tif (!input.value) {\r\n\t\t\t\t\tvalue = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tprotected limitTo(val: string, limit: number): string {\r\n\t\treturn val.substr(0, limit);\r\n\t}\r\n\r\n\tprotected parseUrlFunc(url: string): string {\r\n\t\tif (this.parseUrl) {\r\n\t\t\turl = this.parseUrl(url);\r\n\t\t}\r\n\r\n\t\tif (!url.match(/^[a-zA-Z\\+]+:/)) {\r\n\t\t\turl = 'http://' + url;\r\n\t\t}\r\n\r\n\t\treturn url;\r\n\t}\r\n\r\n\t// Quantity of the remained free characters\r\n\tprotected getCharsLeft(value: string): number {\r\n\t\tconst maxLength = this.maxLength;\r\n\r\n\t\tif (maxLength && !this.hideCount) {\r\n\t\t\treturn maxLength - value.length;\r\n\t\t} else {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\r\n\tprotected getIsEmpty(): boolean {\r\n\t\tconst value = this.formattedModel(this.model);\r\n\r\n\t\treturn !this.hasValue(value);\r\n\t}\r\n\r\n\tprotected isNeedEnableHint(model: TCommonTextfieldModel): boolean {\r\n\t\treturn this.isUseHint && !!model;\r\n\t}\r\n\r\n\t// The single method which shall change value in state\r\n\tprotected setValue(value: string, model: TCommonTextfieldModel): void {\r\n\t\tthis.value = value;\r\n\t\tthis.model = model;\r\n\t\tthis.charsLeft = this.getCharsLeft(value);\r\n\r\n\t\tthis.setInputValue(value);\r\n\t\tthis.setTitleValue();\r\n\t}\r\n\r\n\t// Fix for inputmask\r\n\tprotected setInputValue(value: string): void {\r\n\t\tif (value !== this.inputRef.nativeElement.value) {\r\n\t\t\tthis.inputValue = value;\r\n\t\t\tthis.inputRef.nativeElement.value = value;\r\n\r\n\t\t\tif (!(commonBrowserService.browser.ie && this.isDisabled)) { // CASEM-68023: IE11 doesn't set inputRef.nativeElement.value when control is disabled\r\n\t\t\t\tif (this.inputRef.nativeElement.value !== value) {\r\n\t\t\t\t\tthis.model = this.inputRef.nativeElement.value;\r\n\r\n\t\t\t\t\tthis.zone.run(() => {\r\n\t\t\t\t\t\tthis.modelChange.emit(this.model);\r\n\r\n\t\t\t\t\t\tif (this.onChangeForValueAccessor) {\r\n\t\t\t\t\t\t\tthis.onChangeForValueAccessor(this.model);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected setTitleValue(): void {\r\n\t\tthis.titleValue = this.isHintOn && !this.isFocused ? this.hintValue : this.value;\r\n\t}\r\n\r\n\tprotected setModel(model: TCommonTextfieldModel): void {\r\n\t\tthis.zone.run(() => {\r\n\t\t\tthis.modelChange.emit(model);\r\n\t\t\tthis.emitOnChange(model);\r\n\t\t});\r\n\t}\r\n\r\n\tprotected debounceSetModel(model: TCommonTextfieldModel): void {\r\n\t\tthis.model = model;\r\n\t\tthis.onModelChange();\r\n\r\n\t\tif (this.hasDebounce) {\r\n\t\t\tif (this.cancelSetModel) {\r\n\t\t\t\tthis.cancelSetModel();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cancelSetModel = this.timeout(\r\n\t\t\t\t() => this.setModel(model),\r\n\t\t\t\tCOMMON_THROTTLE_MILLISECONDS,\r\n\t\t\t\t() => this.cancelSetModel = null,\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tthis.setModel(model);\r\n\t\t}\r\n\t}\r\n\r\n\t// Click with zonejs\r\n\tprotected clearModel(): void {\r\n\t\t// Don't forget about debounce\r\n\t\tif (this.cancelSetModel) {\r\n\t\t\tthis.cancelSetModel();\r\n\t\t}\r\n\r\n\t\tthis.setValue('', '');\r\n\t\tthis.setModel('');\r\n\t\tthis.onModelChange();\r\n\t}\r\n\r\n\tprotected enableHint(model: TCommonTextfieldModel): void {\r\n\t\tconst hintValue = this.onHint(this.model);\r\n\r\n\t\tthis.isHintOn = true;\r\n\t\tthis.hintValue = hintValue;\r\n\t\tthis.setTitleValue();\r\n\t}\r\n\r\n\tprotected disableHint(): void {\r\n\t\tif (this.isHintOn) {\r\n\t\t\tthis.isHintOn = false;\r\n\t\t\tthis.hintValue = '';\r\n\t\t\tthis.setTitleValue();\r\n\t\t}\r\n\t}\r\n\r\n\tprotected mouseDownPreventDefault(\r\n\t\tevent: MouseEvent,\r\n\t\tcallback: TCallbackFunc = () => void(0),\r\n\t): void {\r\n\t\t// const normalizeEvent = this.getNormalizeEvent(event);\r\n\r\n\t\tif (event.which === COMMON_HOT_KEYS.LEFT_MOUSE && !this.isDisabled) {\r\n\t\t\t// Save focus in input\r\n\t\t\tevent.preventDefault();\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\t// Mousedown with zonejs\r\n\tprotected onClickClearButton(event: MouseEvent): void {\r\n\t\tif (this.isDisabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.mouseDownPreventDefault(event, () => this.clearModel());\r\n\t}\r\n\r\n\tprotected onUrlClickHandler(event: MouseEvent): void {\r\n\t\treturn;\r\n\t}\r\n}\r\n","export const COMMON_SUGGEST_OFF_PROPERTY = 'off';\r\n","import { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\r\nimport { Directive } from '@angular/core';\r\nimport { CommonEmailValidator } from '@CaseOne/Common/control_validators/email/email.validator';\r\nimport { CommonBaseService } from '@CaseOne/Common/common-base-service.class/common-base-service.class';\r\n\r\n@Directive({\r\n\tselector: '[commonEmail]',\r\n\tproviders: [{\r\n\t\tprovide: NG_VALIDATORS,\r\n\t\tuseExisting: CommonEmailValidatorDirective,\r\n\t\tmulti: true,\r\n\t}],\r\n})\r\nexport class CommonEmailValidatorDirective extends CommonBaseService implements Validator {\r\n\tprivate commonEmailValidator = this.injector.get(CommonEmailValidator);\r\n\r\n\tvalidate(control: AbstractControl): ValidationErrors | null {\r\n\t\treturn this.commonEmailValidator.getValidator()(control);\r\n\t}\r\n}\r\n","import { FormControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\r\nimport { Directive, Input, OnChanges, SimpleChanges } from '@angular/core';\r\nimport {CommonRequireValidator, ICommonRequireValidatorContext} from './required.validator';\r\nimport {CommonBaseEntityClass} from '../../common-base-entity.class/common-base-entity.class';\r\n\r\n@Directive({\r\n\tselector: '[commonRequired]',\r\n\tproviders: [{\r\n\t\tprovide: NG_VALIDATORS,\r\n\t\tuseExisting: CommonRequiredDirective,\r\n\t\tmulti: true,\r\n\t}],\r\n})\r\nexport class CommonRequiredDirective extends CommonBaseEntityClass implements Validator, ICommonRequireValidatorContext, OnChanges {\r\n\t@Input('commonRequired') enabled: boolean;\r\n\t/**\r\n\t * By default empty array is invalid value for commonRequired validator\r\n\t * If this logic should be disabled and empty array is correct for some control - this input should be set to 'false'\r\n\t */\r\n\t@Input('commonRequiredArrayEnabled') arrayRequiredEnabled: boolean;\r\n\r\n\tprivate control: FormControl;\r\n\tprivate validator = this.injector.get(CommonRequireValidator);\r\n\r\n\tngOnChanges(changes: SimpleChanges) {\r\n\t\tif (changes.enabled && this.control) {\r\n\t\t\tthis.control.updateValueAndValidity();\r\n\t\t}\r\n\t}\r\n\r\n\tvalidate(control: FormControl): ValidationErrors | null {\r\n\t\tif (!this.control) {\r\n\t\t\tthis.control = control;\r\n\t\t}\r\n\r\n\t\treturn this.validator.getValidator(this)(control);\r\n\t}\r\n}\r\n","// New version src/Common/directives/common_autofocus/common_autofocus.directive.ts\r\n// Old version src/CaseDotStar.ServicePackages.Frontend.Common/scripts/common/directives/ng_autofocus_directive.js\r\n\r\nimport {\r\n\tAfterViewInit,\r\n\tDirective,\r\n\tElementRef,\r\n\tInput,\r\n\tOnChanges,\r\n\tSimpleChanges,\r\n} from '@angular/core';\r\nimport { isNil } from 'lodash';\r\n\r\n@Directive({\r\n\tselector: '[commonAutofocus]',\r\n})\r\nexport class CommonAutofocusDirective implements AfterViewInit, OnChanges {\r\n\t@Input('commonAutofocusElement') elementSelector: string = 'input';\r\n\t@Input('commonAutofocusDelay') delay: number = 0;\r\n\t@Input('commonAutofocusTrigger') trigger: boolean = true;\r\n\r\n\tprivate element: HTMLElement;\r\n\r\n\tconstructor(\r\n\t\tprivate elementRef: ElementRef,\r\n\t) {\r\n\t}\r\n\r\n\tngOnChanges(changes: SimpleChanges): void {\r\n\t\tif (\r\n\t\t\t!isNil(changes.trigger) &&\r\n\t\t\t!changes.trigger.firstChange &&\r\n\t\t\tchanges.trigger.currentValue\r\n\t\t) {\r\n\t\t\t// timeout 400 = css $transition--duration and delay. Safari fix for https://jira.parcsis.org/browse/CASEM-25883\r\n\t\t\tthis.triggerFocus(400);\r\n\t\t}\r\n\t}\r\n\r\n\tngAfterViewInit(): void {\r\n\t\tthis.element = this.elementSelector ?\r\n\t\t\tthis.elementRef.nativeElement.querySelector(this.elementSelector) :\r\n\t\t\tthis.elementRef.nativeElement;\r\n\r\n\t\tthis.triggerFocus(this.delay);\r\n\t}\r\n\r\n\tprivate triggerFocus(delay: number) {\r\n\t\tif (this.trigger) {\r\n\t\t\t// Without zonejs\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.element.focus();\r\n\t\t\t}, delay);\r\n\t\t}\r\n\t}\r\n}\r\n","
{{resource.domainName}}
{{'authentication.form.login.remind_btn.title' | translate}}
{{resource.authFlashMessage}}
{{resource.domainName}}
{{'authentication.form.add_phone.description' | translate}}
{{'authentication.form.add_phone.return_to_login_text' | translate}}
{{resource.domainName}}

{{'authentication.form.confirm_code.description.didnt_receive_text' | translate}} {{'authentication.form.confirm_code.description.try_again_text' | translate}}

{{'authentication.form.confirm_code.return_to_login_text' | translate}}
{{'authentication.form.remind.title' | translate}}
{{'authentication.form.remind.recall_btn.title' | translate}}
{{'authentication.form.remind.link_sent.title' | translate}}
{{'authentication.form.remind.link_sent.description' | translate}}
{{'authentication.form.remind.link_sent.return_btn.title' | translate}}
","import {\r\n\tFormControl,\r\n\tFormGroup,\r\n} from '@angular/forms';\r\nimport {\r\n\tComponent,\r\n\tInjector,\r\n} from '@angular/core';\r\nimport {\r\n\tfinalize,\r\n\tcatchError,\r\n} from 'rxjs/operators';\r\nimport {\r\n\tthrowError,\r\n} from 'rxjs';\r\nimport {\r\n\tincludes,\r\n\tisString,\r\n} from 'lodash';\r\n\r\nimport { CommonServerDateService } from '../../../Common/server_date/server_date.service';\r\nimport { CommonAppDataService } from '../../../Common/app_data/app_data.service';\r\nimport { CommonNotificationService } from '../../../Common/notification/notification.service';\r\nimport { CommonSecondsFormatterPipe } from '../../../Common/pipes/seconds_formatter.pipe';\r\n\r\nimport { AuthenticationUserService } from '../user/user_authentication.service';\r\nimport { AuthenticationErrorService } from '../authentication/services/authentication_error.service';\r\nimport { CommonBaseComponent } from '../../../Common/base_component/base.component';\r\nimport { UIRouter } from '@uirouter/angular';\r\n\r\ndeclare interface IUser {\r\n\tlogin: string;\r\n\tpassword: string;\r\n}\r\n\r\ndeclare interface IResource {\r\n\tauthState: string;\r\n\tisLinkSent: boolean;\r\n\tappName: string;\r\n\tdomainName: string;\r\n\tvalidationCustomErrors: {},\r\n\tauthFlashMessage: string\r\n\tisPhoneConfirmState: boolean;\r\n\tphone: string;\r\n\tresendDelaySeconds?: number;\r\n\twaitResendText?: string;\r\n}\r\n\r\n@Component({\r\n\tselector: 'authentication-login',\r\n\ttemplateUrl: './login.component.pug',\r\n})\r\nexport class AuthenticationLoginComponent extends CommonBaseComponent {\r\n\tresource: IResource;\r\n\tuser: IUser;\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t};\r\n\r\n\tcodeFormModel = {\r\n\t\tcode: null,\r\n\t};\r\n\r\n\tphoneFormModel = {\r\n\t\tphone: null,\r\n\t};\r\n\r\n\tonChangeFieldHandler = this.authenticationErrorService.onChangeFieldHandler;\r\n\r\n\tprivate stopResendTimer;\r\n\r\n\tconstructor (\r\n\t\tprivate commonAppDataService: CommonAppDataService,\r\n\t\tprivate authenticationUserService: AuthenticationUserService,\r\n\t\tprivate commonServerDateService: CommonServerDateService,\r\n\t\tprivate commonNotificationService: CommonNotificationService,\r\n\t\tprivate commonSecondsFormatterPipe: CommonSecondsFormatterPipe,\r\n\t\tprivate authenticationErrorService: AuthenticationErrorService,\r\n\t\tprivate uiRouter: UIRouter,\r\n\t\tprotected injector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\r\n\t\tthis.user = {\r\n\t\t\tlogin: '',\r\n\t\t\tpassword: '',\r\n\t\t};\r\n\r\n\t\tthis.resource = {\r\n\t\t\tauthState: 'login',\r\n\t\t\tisLinkSent: false,\r\n\t\t\tappName: this.commonAppDataService.getDataByPath('appName'),\r\n\t\t\tdomainName: this.commonAppDataService.getDataByPath('domainName'),\r\n\t\t\tvalidationCustomErrors: {},\r\n\t\t\tauthFlashMessage: this.commonAppDataService.getDataByPath('authFlashMessage'),\r\n\t\t\tisPhoneConfirmState: false,\r\n\t\t\tphone: '',\r\n\t\t};\r\n\r\n\t\tthis.commonAppDataService.setDataByPath('', 'authFlashMessage');\r\n\t}\r\n\r\n\tsendLogin (form: FormGroup): void {\r\n\t\tif (form.valid) {\r\n\t\t\tthis.state.isLoading = true;\r\n\r\n\t\t\tthis.authenticationUserService\r\n\t\t\t\t.login(this.user)\r\n\t\t\t\t.pipe(\r\n\t\t\t\t\tcatchError((err) => {\r\n\t\t\t\t\t\tthis.state.isLoading = false;\r\n\t\t\t\t\t\treturn throwError(err);\r\n\t\t\t\t\t}),\r\n\t\t\t\t)\r\n\t\t\t\t.subscribe((response: any) => {\r\n\t\t\t\t\tif (response.Succeeded) {\r\n\t\t\t\t\t\tif (response.Is2FAActive) {\r\n\t\t\t\t\t\t\tif (response.IsPhoneConfirmed) {\r\n\t\t\t\t\t\t\t\tthis.goToConfirmCode({\r\n\t\t\t\t\t\t\t\t\tisPhoneConfirm: false,\r\n\t\t\t\t\t\t\t\t\tphone: response.Phone,\r\n\t\t\t\t\t\t\t\t\tnextResendTime: response.NextAttemptTime,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tthis.phoneFormModel.phone = response.Phone;\r\n\t\t\t\t\t\t\t\tthis.resource.authState = 'add_phone';\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.state.isLoading = false;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.signIn(response.ReturnUrl);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.state.isLoading = false;\r\n\t\t\t\t\t\tthis.authenticationErrorService.handleSuccessResponse(response, this.resource.validationCustomErrors, form.controls.password as FormControl);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tsendPhone (form: FormGroup) {\r\n\t\tif (form.valid) {\r\n\t\t\tthis.state.isLoading = true;\r\n\r\n\t\t\tthis.authenticationUserService\r\n\t\t\t\t.changePhone({\r\n\t\t\t\t\tLogin: this.user.login,\r\n\t\t\t\t\tPhone: this.phoneFormModel.phone,\r\n\t\t\t\t})\r\n\t\t\t\t.pipe(\r\n\t\t\t\t\tfinalize(() => {\r\n\t\t\t\t\t\tthis.state.isLoading = false;\r\n\t\t\t\t\t}),\r\n\t\t\t\t)\r\n\t\t\t\t.subscribe((response: any) => {\r\n\t\t\t\t\tif (response.IsSuccess) {\r\n\t\t\t\t\t\tthis.goToConfirmCode({\r\n\t\t\t\t\t\t\tisPhoneConfirm: true,\r\n\t\t\t\t\t\t\tphone: response.PendingPhone,\r\n\t\t\t\t\t\t\tnextResendTime: response.NextAttemptTime,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.authenticationErrorService.showCustomError(response, this.resource.validationCustomErrors, form.controls.phone as FormControl);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tsendCode (form: FormGroup): void {\r\n\t\tif (form.valid) {\r\n\t\t\tthis.state.isLoading = true;\r\n\r\n\t\t\tthis.authenticationUserService[this.resource.isPhoneConfirmState ? 'confirmPhoneCode' : 'checkLoginCode']({\r\n\t\t\t\tLogin: this.user.login,\r\n\t\t\t\tCode: this.codeFormModel.code,\r\n\t\t\t})\r\n\t\t\t\t.pipe(\r\n\t\t\t\t\tcatchError((err) => {\r\n\t\t\t\t\t\tthis.state.isLoading = false;\r\n\t\t\t\t\t\treturn throwError(err);\r\n\t\t\t\t\t}),\r\n\t\t\t\t)\r\n\t\t\t\t.subscribe((response: any) => {\r\n\t\t\t\t\tif (response.Succeeded) {\r\n\t\t\t\t\t\tthis.signIn(response.ReturnUrl);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.state.isLoading = false;\r\n\t\t\t\t\t\tthis.authenticationErrorService.handleSuccessResponse(response, this.resource.validationCustomErrors, form.controls.code as FormControl);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tresendCode (form: FormGroup): void {\r\n\t\tthis.state.isLoading = true;\r\n\r\n\t\tthis.authenticationUserService[this.resource.isPhoneConfirmState ? 'resendPhoneCode' : 'resendLoginCode']({\r\n\t\t\tLogin: this.user.login,\r\n\t\t})\r\n\t\t\t.pipe(\r\n\t\t\t\tfinalize(() => this.state.isLoading = false),\r\n\t\t\t)\r\n\t\t\t.subscribe((response: any) => {\r\n\t\t\t\tif (response.IsSuccess) {\r\n\t\t\t\t\tthis.initResendTimer(response.NextAttemptTime);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.authenticationErrorService.handleSuccessResponse(response, this.resource.validationCustomErrors, form.controls.code as FormControl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\r\n\tremind (form: FormGroup): void {\r\n\t\tif (form.valid) {\r\n\t\t\tthis.state.isLoading = true;\r\n\r\n\t\t\tthis.authenticationUserService\r\n\t\t\t\t.remindPassword({\r\n\t\t\t\t\tlogin: this.user.login,\r\n\t\t\t\t})\r\n\t\t\t\t.pipe(\r\n\t\t\t\t\tfinalize(() => this.state.isLoading = false),\r\n\t\t\t\t)\r\n\t\t\t\t.subscribe((response: any) => {\r\n\t\t\t\t\tconst hasErrors = response.Errors && response.Errors.length;\r\n\r\n\t\t\t\t\tthis.user.password = hasErrors ? '' : this.user.password;\r\n\r\n\t\t\t\t\tif (!hasErrors) {\r\n\t\t\t\t\t\tthis.resource.isLinkSent = true;\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (includes(response.Errors, this.instant('authentication.actions.login.noty.account_blocked.title')) && isString(response.Errors[0])) {\r\n\t\t\t\t\t\t\tthis.commonNotificationService.show('', response.Errors[0], 'error');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.authenticationErrorService.showCustomError(response, this.resource.validationCustomErrors, form.controls.login as FormControl);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tgoToConfirmCode (params): void {\r\n\t\tthis.resource.isPhoneConfirmState = !!params.isPhoneConfirm;\r\n\t\tthis.resource.phone = params.phone;\r\n\t\tthis.initResendTimer(params.nextResendTime);\r\n\t\tthis.resource.authState = 'confirm_code';\r\n\t}\r\n\r\n\tgoToLogin () {\r\n\t\tthis.resource.authState = 'login';\r\n\t\tthis.resource.isLinkSent = false;\r\n\t}\r\n\r\n\tbackFromConfirmCode (): void {\r\n\t\tif (this.resource.isPhoneConfirmState) {\r\n\t\t\tthis.resource.authState = 'add_phone';\r\n\t\t} else {\r\n\t\t\tthis.goToLogin();\r\n\t\t}\r\n\t}\r\n\r\n\tgoToRemind () {\r\n\t\tthis.resource.authState = 'remind';\r\n\t\tthis.resource.isLinkSent = false;\r\n\t}\r\n\r\n\tprivate signIn (returnUrl: string): void {\r\n\t\treturnUrl = returnUrl || this.getReturnUrl();\r\n\t\tthis.redirect(returnUrl);\r\n\t}\r\n\r\n\tprivate redirect (url: string): void {\r\n\t\tconst isLocalUrl = location.href.split('#')[0] === url.split('#')[0];\r\n\r\n\t\turl = url.replace(/&/g, '&'); // back-end add & in url\r\n\r\n\t\t// Disabled routing for defender not allowed url\r\n\t\tthis.uiRouter.dispose();\r\n\t\twindow.location.assign(url);\r\n\r\n\t\t// Run redirect for local url\r\n\t\tif (isLocalUrl) {\r\n\t\t\twindow.location.reload();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate getReturnUrl (): string {\r\n\t\tlet returnUrl = this.commonAppDataService.getDataByPath('authenticationReturnUrl');\r\n\r\n\t\t// we haven't the hash in ReturnUrl, when user redirected by back-end\r\n\t\t// we save the current hash in authenticationReturnUrlHash before the auth application is initialized\r\n\t\tif (returnUrl && !returnUrl.includes('#')) {\r\n\t\t\treturnUrl += this.commonAppDataService.getDataByPath('authenticationReturnUrlHash');\r\n\t\t}\r\n\r\n\t\treturn returnUrl || this.commonAppDataService.getDataByPath('appFullLocationUrl');\r\n\t}\r\n\r\n\tprivate initResendTimer (NextPhoneConfirmationAttemptTime: number): void {\r\n\t\twindow.clearInterval(this.stopResendTimer);\r\n\r\n\t\tthis.resource.resendDelaySeconds = this.getResendDelaySeconds(NextPhoneConfirmationAttemptTime);\r\n\t\tthis.setWaitResendText();\r\n\r\n\t\tthis.stopResendTimer = window.setInterval(() => {\r\n\t\t\tthis.resource.resendDelaySeconds--;\r\n\t\t\tthis.setWaitResendText();\r\n\r\n\t\t\tif (!this.resource.resendDelaySeconds) {\r\n\t\t\t\twindow.clearInterval(this.stopResendTimer);\r\n\t\t\t}\r\n\t\t}, 1000);\r\n\t}\r\n\r\n\r\n\tprivate getResendDelaySeconds (NextPhoneConfirmationAttemptTime?: number): number {\r\n\t\treturn !NextPhoneConfirmationAttemptTime ? 0 : Math.abs(this.commonServerDateService.getMoment().diff(this.commonServerDateService.getMoment(NextPhoneConfirmationAttemptTime), 'seconds') || 0);\r\n\t}\r\n\r\n\tprivate setWaitResendText (): void {\r\n\t\tthis.resource.waitResendText = this.instant('authentication.form.confirm_code.description.timer_text', {\r\n\t\t\ttime: this.commonSecondsFormatterPipe.transform(this.resource.resendDelaySeconds),\r\n\t\t});\r\n\t}\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {AbstractControl, ValidationErrors} from '@angular/forms';\r\nimport {CommonValidator} from '../common-validator';\r\nimport {isEmpty} from 'lodash';\r\n\r\nexport const COMMON_MATCH_ERROR_KEY = 'commonMatch';\r\n\r\nexport interface ICommonMatchValidatorContext {\r\n\tmatchControl: AbstractControl,\r\n}\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root',\r\n})\r\nexport class CommonMatchValidator extends CommonValidator {\r\n\tgetValidator(context: ICommonMatchValidatorContext) {\r\n\t\treturn (control: AbstractControl): ValidationErrors | null => {\r\n\t\t\tconst changeSubscription = context.matchControl.valueChanges.subscribe(() => {\r\n\t\t\t\tcontrol.updateValueAndValidity();\r\n\t\t\t\tchangeSubscription.unsubscribe();\r\n\t\t\t});\r\n\r\n\t\t\tif (isEmpty(control.value) || context.matchControl.value === control.value) {\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\t\t\t\treturn {\r\n\t\t\t\t\t[COMMON_MATCH_ERROR_KEY]: true,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n","import {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator} from '@angular/forms';\r\nimport {Directive, Input} from '@angular/core';\r\nimport {CommonMatchValidator} from './match.validator';\r\nimport {CommonBaseEntityClass} from '../../common-base-entity.class/common-base-entity.class';\r\n\r\n@Directive({\r\n\tselector: '[commonMatch]',\r\n\tproviders: [{\r\n\t\tprovide: NG_VALIDATORS,\r\n\t\tuseExisting: CommonMatchValidatorDirective,\r\n\t\tmulti: true,\r\n\t}],\r\n})\r\nexport class CommonMatchValidatorDirective extends CommonBaseEntityClass implements Validator {\r\n\t@Input() commonMatch: string;\r\n\r\n\tprivate validator = this.injector.get(CommonMatchValidator);\r\n\r\n\tvalidate(control: AbstractControl): ValidationErrors | null {\r\n\t\tconst matchControl = control.root.get(this.commonMatch);\r\n\r\n\t\treturn this.validator.getValidator({ matchControl })(control);\r\n\t}\r\n}\r\n","import {\r\n\tFormGroup,\r\n\tFormControl,\r\n} from '@angular/forms';\r\nimport {\r\n\tComponent,\r\n\tInjector,\r\n} from '@angular/core';\r\nimport {\r\n\tisEmpty,\r\n\tmerge,\r\n} from 'lodash';\r\nimport { finalize } from 'rxjs/operators';\r\nimport {\r\n\tUIRouter,\r\n\tTransition,\r\n} from '@uirouter/angular';\r\n\r\nimport { CommonAppDataService } from '../../../Common/app_data/app_data.service';\r\nimport { CommonBaseComponent } from '../../../Common/base_component/base.component';\r\n\r\nimport { AuthenticationUserService } from '../user/user_authentication.service';\r\nimport { AuthenticationErrorService } from '../authentication/services/authentication_error.service';\r\n\r\n@Component({\r\n\tselector: 'authentication-reset-password',\r\n\ttemplateUrl: './reset_password.component.pug',\r\n})\r\nexport class AuthenticationResetPasswordComponent extends CommonBaseComponent {\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t};\r\n\r\n\tresource = {\r\n\t\tvalidationCustomErrors: {\r\n\t\t\tpasswordsMatch: 'authentication.form.reset.messages.match',\r\n\t\t\tcustom: {},\r\n\t\t},\r\n\t};\r\n\r\n\tpasswords = {\r\n\t\tnewPassword: '',\r\n\t\tconfirmPassword: '',\r\n\t};\r\n\r\n\tonChangeFieldHandler = this.authenticationErrorService.onChangeFieldHandler;\r\n\r\n\tconstructor (\r\n\t\tprivate authenticationUserService: AuthenticationUserService,\r\n\t\tprivate authenticationErrorService: AuthenticationErrorService,\r\n\t\tprivate transition: Transition,\r\n\t\tprivate uIRouter: UIRouter,\r\n\t\tprivate commonAppDataService: CommonAppDataService,\r\n\t\tprotected injector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\t}\r\n\r\n\tgoToLoginPage (authFlashMessage?: string): void {\r\n\t\tif (authFlashMessage) {\r\n\t\t\tthis.commonAppDataService.setDataByPath(authFlashMessage, 'authFlashMessage');\r\n\t\t}\r\n\r\n\t\tthis.uIRouter.stateService.go('login');\r\n\t}\r\n\r\n\treset (form: FormGroup): void {\r\n\t\tif (form.valid) {\r\n\t\t\tthis.state.isLoading = true;\r\n\r\n\t\t\tthis.authenticationUserService\r\n\t\t\t\t.resetPassword(merge({}, this.passwords, { key: this.transition.params().id }))\r\n\t\t\t\t.pipe(\r\n\t\t\t\t\tfinalize(() => this.state.isLoading = false),\r\n\t\t\t\t)\r\n\t\t\t\t.subscribe((response: any) => {\r\n\t\t\t\t\tif (response.Succeeded) {\r\n\t\t\t\t\t\tthis.goToLoginPage(this.instant('authentication.form.reset.messages.success'));\r\n\t\t\t\t\t} else if (!isEmpty(response.Errors)) {\r\n\t\t\t\t\t\tthis.authenticationErrorService.showCustomError(response, this.resource.validationCustomErrors, form.controls.newPassword as FormControl);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n","
{{ 'authentication.form.reset.title' | translate }}
{{'authentication.form.remind.recall_btn.title' | translate}}
","
{{registrationTexts.errorTitle}}
{{registrationTexts.errorText}}
{{'authentication.form.user_registration.link_sent.title' | translate}}
{{'authentication.form.user_registration.link_sent.description' | translate}}
{{appData.domainName}}
{{'authentication.form.user_registration.registration_enabled.description' | translate}}
{{'authentication.form.user_registration.controls.go_to_login_btn.title' | translate}}
","import {\r\n\tComponent,\r\n\tInjector,\r\n} from '@angular/core';\r\nimport { finalize } from 'rxjs/operators';\r\nimport {\r\n\tFormGroup,\r\n\tFormControl,\r\n} from '@angular/forms';\r\nimport { UIRouter } from '@uirouter/angular';\r\nimport {\r\n\tisNil,\r\n\tisEmpty,\r\n} from 'lodash';\r\n\r\nimport { CommonAppDataService } from '../../../Common/app_data/app_data.service';\r\nimport { CommonEscapedBracketReplace } from '../../../Common/pipes/escape_bracket_replace.filter';\r\n\r\nimport { AuthenticationUserService } from '../user/user_authentication.service';\r\nimport { AuthenticationErrorService } from '../authentication/services/authentication_error.service';\r\nimport { CommonBaseComponent } from '../../../Common/base_component/base.component';\r\n\r\n@Component({\r\n\tselector: 'authentication-registration-link',\r\n\ttemplateUrl: './registration_link.component.pug',\r\n})\r\nexport class AuthenticationRegistrationLinkComponent extends CommonBaseComponent {\r\n\tappData = this.commonAppDataService.getData();\r\n\r\n\tstate = {\r\n\t\tisSaving: false,\r\n\t\tisSubmitted: false,\r\n\t\tisError: !this.appData.isRegistrationByLinkEnabled || !!(this.appData.registrationErrorTitle || this.appData.registrationErrorText),\r\n\t};\r\n\r\n\tresource = {\r\n\t\tvalidationCustomErrors: {},\r\n\t};\r\n\r\n\tuser = {\r\n\t\tInviteKey: location.search.replace(/[?&]key=([^&]*)/i, '$1'),\r\n\t\tConfirmPassword: '',\r\n\t\tPassword: '',\r\n\t\tFirstName: '',\r\n\t\tLastName: '',\r\n\t\tEmail: '',\r\n\t};\r\n\r\n\tregistrationTexts = {\r\n\t\tterms: new CommonEscapedBracketReplace().transform(\r\n\t\t\tthis.instant('authentication.form.user_registration.terms_links.text', {\r\n\t\t\t\tappName: this.appData.appName,\r\n\t\t\t\tprivacyPolicyLink: this.getPrivacyPolicyLink(),\r\n\t\t\t\ttermsOfServiceLink: this.getTermsOfServiceLink(),\r\n\t\t\t}),\r\n\t\t),\r\n\t\terrorTitle: this.getErrorTitle(),\r\n\t\terrorText: this.getErrorText(),\r\n\t};\r\n\r\n\tonChangeFieldHandler = this.authenticationErrorService.onChangeFieldHandler;\r\n\r\n\tconstructor (\r\n\t\tprivate commonAppDataService: CommonAppDataService,\r\n\t\tprivate authenticationUserService: AuthenticationUserService,\r\n\t\tprivate authenticationErrorService: AuthenticationErrorService,\r\n\t\tprivate uIRouter: UIRouter,\r\n\t\tprotected injector: Injector,\r\n\t) {\r\n\t\tsuper(injector);\r\n\t}\r\n\r\n\tgoToLogin (): void {\r\n\t\tthis.uIRouter.stateService.go('login');\r\n\t}\r\n\r\n\tregister (form: FormGroup): void {\r\n\t\tif (form.valid) {\r\n\t\t\tthis.user.ConfirmPassword = this.user.Password;\r\n\t\t\tthis.state.isSaving = true;\r\n\r\n\t\t\tthis.authenticationUserService\r\n\t\t\t\t.register(this.user)\r\n\t\t\t\t.pipe(\r\n\t\t\t\t\tfinalize(() => this.state.isSaving = false),\r\n\t\t\t\t)\r\n\t\t\t\t.subscribe((response: any) => {\r\n\t\t\t\t\tif (!isNil(response.Data.Errors) && !isEmpty(response.Data.Errors)) {\r\n\t\t\t\t\t\tthis.authenticationErrorService.handleSuccessResponse(response.Data, this.resource.validationCustomErrors, form.controls.email as FormControl);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.state.isSubmitted = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprivate getPrivacyPolicyLink (): string {\r\n\t\treturn `${ this.instant('authentication.form.user_registration.terms_links.privacy_policy_in_text') }`;\r\n\t}\r\n\r\n\tprivate getTermsOfServiceLink (): string {\r\n\t\treturn `${ this.instant('authentication.form.user_registration.terms_links.terms_of_service_in_text') }`;\r\n\t}\r\n\r\n\tprivate getErrorText (): string {\r\n\t\treturn !this.appData.isRegistrationByLinkEnabled ? this.instant('authentication.form.user_registration.registration_disabled.description') : this.appData.registrationErrorText;\r\n\t}\r\n\r\n\tprivate getErrorTitle (): string {\r\n\t\treturn !this.appData.isRegistrationByLinkEnabled ? this.instant('authentication.form.user_registration.registration_disabled.title') : this.appData.registrationErrorTitle;\r\n\t}\r\n}\r\n","import { AuthenticationLoginComponent } from '../login/login.component';\r\nimport { AuthenticationResetPasswordComponent } from '../reset_password/reset_password.component';\r\nimport { AuthenticationRegistrationLinkComponent } from '../registration_link/registration_link.component';\r\nimport { Ng2StateDeclaration } from '@uirouter/angular';\r\n\r\nexport const authenticationRoutes: Ng2StateDeclaration[] = [\r\n\t{\r\n\t\tname: 'login',\r\n\t\turl: '/login',\r\n\t\tcomponent: AuthenticationLoginComponent,\r\n\t},\r\n\t{\r\n\t\tname: 'reset',\r\n\t\turl: '/remind/code/:id',\r\n\t\tcomponent: AuthenticationResetPasswordComponent,\r\n\t},\r\n\t{\r\n\t\tname: 'registration',\r\n\t\turl: '/registration?key',\r\n\t\tcomponent: AuthenticationRegistrationLinkComponent,\r\n\t},\r\n];\r\n","import { UIRouter } from '@uirouter/core';\r\n\r\nimport { registrationLinkErrorHook } from '../registration_link/registration-link-error.hook';\r\n\r\nexport function authenticationRouterConfigFn (router: UIRouter) {\r\n\tconst transitionService = router.transitionService;\r\n\r\n\tregistrationLinkErrorHook(transitionService);\r\n}\r\n","import { TransitionService } from '@uirouter/core';\r\nimport { CommonAppDataService } from '../../../Common/app_data/app_data.service';\r\n\r\nexport function registrationLinkErrorHook (transitionService: TransitionService) {\r\n\tconst criteria = {\r\n\t\tfrom: '',\r\n\t\tto: (state, transition) => {\r\n\t\t\tconst commonAppDataService: CommonAppDataService = transition.injector().get(CommonAppDataService);\r\n\t\t\tconst registrationErrorTitle = commonAppDataService.getDataByPath('registrationErrorTitle');\r\n\t\t\tconst registrationErrorText = commonAppDataService.getDataByPath('registrationErrorText');\r\n\r\n\t\t\treturn state.name === 'login' && (registrationErrorTitle || registrationErrorText);\r\n\t\t},\r\n\t};\r\n\r\n\tfunction redirectToRegistration (transition) {\r\n\t\treturn transition.router.stateService.target('registration');\r\n\t}\r\n\r\n\ttransitionService.onBefore(criteria, redirectToRegistration);\r\n}\r\n\r\n","import { NgModuleRef, ApplicationRef } from '@angular/core';\r\nimport { ICommonAppConfig } from './app.config.token';\r\nimport { CommonPageTitleService } from '../page-title/page-title.service';\r\n\r\n// FIX for the HYBRID\r\n// https://stackoverflow.com/questions/44802253/cannot-start-ui-router-hybrid-app-with-systemjs\r\nimport { servicesPlugin } from '@uirouter/angular';\r\nimport { CommonDebugService } from '@CaseOne/Common/debug/common-debug.service';\r\nservicesPlugin(null);\r\n\r\nfunction getTimerText (layoutTranslations, time: number): string {\r\n\treturn `${layoutTranslations.Layout_Reconnect_StartMessage} ${time} ${layoutTranslations.Layout_Reconnect_Seconds}.`;\r\n}\r\n\r\nexport function initApp (\r\n\tplatformBrowserDynamicPromise: Promise>,\r\n\tconfig: ICommonAppConfig,\r\n\tcallback?: (moduleRef: NgModuleRef) => Promise>,\r\n): Promise {\r\n\tconst layoutTranslations = window.LocaleData.layoutTranslations;\r\n\tconst loader = window.initialLoader;\r\n\r\n\treturn platformBrowserDynamicPromise\r\n\t\t.then((moduleRef) => {\r\n\t\t\tif (callback) {\r\n\t\t\t\treturn callback(moduleRef);\r\n\t\t\t} else {\r\n\t\t\t\tconst commonPageTitleService = moduleRef.injector.get(CommonPageTitleService);\r\n\r\n\t\t\t\tcommonPageTitleService.startWatchingState();\r\n\r\n\t\t\t\treturn moduleRef;\r\n\t\t\t}\r\n\t\t})\r\n\t\t.then((moduleRef) => {\r\n\t\t\tconst commonDebugService = moduleRef.injector.get(CommonDebugService);\r\n\r\n\t\t\t// enable debug tools\r\n\t\t\tif (commonDebugService.isDebugToolsEnabled) {\r\n\t\t\t\tconst applicationRef = moduleRef.injector.get(ApplicationRef);\r\n\t\t\t\tconst appComponent = applicationRef.components[0];\r\n\r\n\t\t\t\t// hybrid Angular+AngularJS apps do not have a root component\r\n\t\t\t\tif (appComponent) {\r\n\t\t\t\t\tcommonDebugService.enableDebugTools(appComponent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// disable main app loader\r\n\t\t\tif (loader) {\r\n\t\t\t\tloader.disable();\r\n\t\t\t}\r\n\r\n\t\t\treturn moduleRef;\r\n\t\t})\r\n\t\t.catch((error) => {\r\n\t\t\tdocument.title = layoutTranslations.Layout_RunError;\r\n\r\n\t\t\tconsole.error(error);\r\n\r\n\t\t\tif (!loader) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst second = 1000;\r\n\t\t\tconst countdownTime = 60; // seconds\r\n\t\t\tconst end = new Date().getTime() + countdownTime * second;\r\n\r\n\t\t\tloader.setLabel(layoutTranslations.Layout_Error);\r\n\t\t\tloader.error({\r\n\t\t\t\ttext: layoutTranslations.Layout_Error_Message,\r\n\t\t\t\tdescription: error.data && error.data.Error ? `${layoutTranslations.Layout_ServerResponse} ${error.data.Error}` : '',\r\n\t\t\t\ttimer: getTimerText(layoutTranslations, countdownTime),\r\n\t\t\t});\r\n\r\n\t\t\t// Without zonejs\r\n\t\t\tsetTimeout(function countdown () {\r\n\t\t\t\tconst now = new Date().getTime();\r\n\r\n\t\t\t\tif (end < now) {\r\n\t\t\t\t\tlocation.reload();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst countDownSecond = Math.round((end - now) / second);\r\n\r\n\t\t\t\t\tloader.error({\r\n\t\t\t\t\t\ttimer: getTimerText(layoutTranslations, countDownSecond),\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t// Without zonejs\r\n\t\t\t\t\tsetTimeout(countdown, second);\r\n\t\t\t\t}\r\n\t\t\t}, second);\r\n\t\t});\r\n}\r\n\r\nexport function commonInitApp (platformBrowserDynamicPromise: Promise>, config: ICommonAppConfig): Promise {\r\n\treturn initApp(platformBrowserDynamicPromise, config);\r\n}\r\n","import { NgModule, Inject, Injector } from '@angular/core';\r\nimport { UIRouterModule } from '@uirouter/angular';\r\n\r\nimport { COMMON_APP_CONFIG, ICommonAppConfig } from '../../../Common/app/app.config.token';\r\nimport { CommonAppModule } from '../../../Common/app/app.module';\r\n\r\nimport { authenticationAppConfig } from './authentication.app_config.constant';\r\nimport { AuthenticationCommonModule } from './authentication.common.module';\r\nimport { AuthenticationComponent } from './authentication.component';\r\nimport { AuthenticationLoginComponent } from '../login/login.component';\r\nimport { AuthenticationResetPasswordComponent } from '../reset_password/reset_password.component';\r\nimport { authenticationRoutes } from '../routes/routes.constant';\r\nimport { authenticationRouterConfigFn } from '../routes/router.config';\r\nimport { AuthenticationUserService } from '../user/user_authentication.service';\r\nimport { AuthenticationRegistrationLinkComponent } from '../registration_link/registration_link.component';\r\n\r\n@NgModule({\r\n\tdeclarations: [\r\n\t\tAuthenticationComponent,\r\n\t\tAuthenticationLoginComponent,\r\n\t\tAuthenticationResetPasswordComponent,\r\n\t\tAuthenticationRegistrationLinkComponent,\r\n\t],\r\n\timports: [\r\n\t\tCommonAppModule,\r\n\t\tUIRouterModule.forRoot({\r\n\t\t\totherwise: '/login',\r\n\t\t\tstates: authenticationRoutes,\r\n\t\t\tuseHash: true,\r\n\t\t\tconfig: authenticationRouterConfigFn,\r\n\t\t}),\r\n\t\tAuthenticationCommonModule,\r\n\t],\r\n\tentryComponents: [\r\n\t\tAuthenticationComponent,\r\n\t],\r\n\tproviders: [\r\n\t\t{ provide: COMMON_APP_CONFIG, useValue: authenticationAppConfig },\r\n\t\tAuthenticationUserService,\r\n\t],\r\n})\r\nexport class AuthenticationModule extends CommonAppModule {\r\n\tconstructor (\r\n\t\tprotected injector: Injector,\r\n\t\t@Inject(COMMON_APP_CONFIG) commonAppConfig: ICommonAppConfig,\r\n\t) {\r\n\t\tsuper(\r\n\t\t\tinjector,\r\n\t\t\tcommonAppConfig,\r\n\t\t);\r\n\t}\r\n}\r\n","import { enableProdMode } from '@angular/core';\r\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\n\r\nimport { AuthenticationModule } from './authentication/authentication.module';\r\nimport { environment } from '../../../environments/environment';\r\nimport { commonInitApp } from '../../Common/app/app.main.init';\r\nimport { authenticationAppConfig } from './authentication/authentication.app_config.constant';\r\n\r\nif (environment.production && !window.AppData?.IsDebugToolsEnabled) {\r\n\tenableProdMode();\r\n}\r\n\r\ncommonInitApp(platformBrowserDynamic().bootstrapModule(AuthenticationModule), authenticationAppConfig);\r\n","/**\r\n * Polyfill service v3.40.0\r\n * For detailed credits and licence information see https://github.com/financial-times/polyfill-service.\r\n *\r\n * Features requested: Element.prototype.append,Element.prototype.classList,Element.prototype.cloneNode,Element.prototype.matches,Element.prototype.prepend,Element.prototype.remove,Element.prototype.replaceWith\r\n *\r\n * - document, License: CC0 (required by \"Element.prototype.append\", \"Element.prototype.prepend\", \"Element.prototype.remove\", \"Element.prototype.replaceWith\", \"Element\", \"Element.prototype.classList\", \"Element.prototype.cloneNode\", \"Element.prototype.matches\", \"_mutation\", \"document.querySelector\")\r\n * - Element, License: CC0 (required by \"Element.prototype.append\", \"Element.prototype.classList\", \"Element.prototype.cloneNode\", \"Element.prototype.matches\", \"Element.prototype.prepend\", \"Element.prototype.remove\", \"Element.prototype.replaceWith\", \"_mutation\", \"document.querySelector\")\r\n * - _mutation, License: CC0 (required by \"Element.prototype.append\", \"Element.prototype.prepend\", \"Element.prototype.remove\", \"Element.prototype.replaceWith\")\r\n * - document.querySelector, License: CC0 (required by \"Element.prototype.matches\")\r\n * - Element.prototype.append, License: CC0\r\n * - Element.prototype.cloneNode, License: CC0\r\n * - Element.prototype.matches, License: CC0\r\n * - Element.prototype.prepend, License: CC0\r\n * - Element.prototype.remove, License: CC0\r\n * - Element.prototype.replaceWith, License: CC0\r\n * - Object.defineProperty, License: CC0 (required by \"Element.prototype.classList\", \"_DOMTokenList\", \"DOMTokenList\")\r\n * - _DOMTokenList, License: ISC (required by \"DOMTokenList\", \"Element.prototype.classList\")\r\n * - DOMTokenList, License: CC0 (required by \"Element.prototype.classList\")\r\n * - Element.prototype.classList, License: ISC\r\n */\r\n\r\n(function(undefined) {\r\n\tif (!(\"document\"in this\r\n\t)) {\r\n\r\n// document\r\n\t\tif ((typeof WorkerGlobalScope === \"undefined\") && (typeof importScripts !== \"function\")) {\r\n\r\n\t\t\tif (this.HTMLDocument) { // IE8\r\n\r\n\t\t\t\t// HTMLDocument is an extension of Document. If the browser has HTMLDocument but not Document, the former will suffice as an alias for the latter.\r\n\t\t\t\tthis.Document = this.HTMLDocument;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\t// Create an empty function to act as the missing constructor for the document object, attach the document object as its prototype. The function needs to be anonymous else it is hoisted and causes the feature detect to prematurely pass, preventing the assignments below being made.\r\n\t\t\t\tthis.Document = this.HTMLDocument = document.constructor = (new Function('return function Document() {}')());\r\n\t\t\t\tthis.Document.prototype = document;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tif (!(\"Element\"in this&&\"HTMLElement\"in this\r\n\t)) {\r\n\r\n// Element\r\n\t\t(function () {\r\n\r\n\t\t\t// IE8\r\n\t\t\tif (window.Element && !window.HTMLElement) {\r\n\t\t\t\twindow.HTMLElement = window.Element;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// create Element constructor\r\n\t\t\twindow.Element = window.HTMLElement = new Function('return function Element() {}')();\r\n\r\n\t\t\t// generate sandboxed iframe\r\n\t\t\tvar vbody = document.appendChild(document.createElement('body'));\r\n\t\t\tvar frame = vbody.appendChild(document.createElement('iframe'));\r\n\r\n\t\t\t// use sandboxed iframe to replicate Element functionality\r\n\t\t\tvar frameDocument = frame.contentWindow.document;\r\n\t\t\tvar prototype = Element.prototype = frameDocument.appendChild(frameDocument.createElement('*'));\r\n\t\t\tvar cache = {};\r\n\r\n\t\t\t// polyfill Element.prototype on an element\r\n\t\t\tvar shiv = function (element, deep) {\r\n\t\t\t\tvar\r\n\t\t\t\t\tchildNodes = element.childNodes || [],\r\n\t\t\t\t\tindex = -1,\r\n\t\t\t\t\tkey, value, childNode;\r\n\r\n\t\t\t\tif (element.nodeType === 1 && element.constructor !== Element) {\r\n\t\t\t\t\telement.constructor = Element;\r\n\r\n\t\t\t\t\tfor (key in cache) {\r\n\t\t\t\t\t\tvalue = cache[key];\r\n\t\t\t\t\t\telement[key] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\twhile (childNode = deep && childNodes[++index]) {\r\n\t\t\t\t\tshiv(childNode, deep);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn element;\r\n\t\t\t};\r\n\r\n\t\t\tvar elements = document.getElementsByTagName('*');\r\n\t\t\tvar nativeCreateElement = document.createElement;\r\n\t\t\tvar interval;\r\n\t\t\tvar loopLimit = 100;\r\n\r\n\t\t\tprototype.attachEvent('onpropertychange', function (event) {\r\n\t\t\t\tvar\r\n\t\t\t\t\tpropertyName = event.propertyName,\r\n\t\t\t\t\tnonValue = !cache.hasOwnProperty(propertyName),\r\n\t\t\t\t\tnewValue = prototype[propertyName],\r\n\t\t\t\t\toldValue = cache[propertyName],\r\n\t\t\t\t\tindex = -1,\r\n\t\t\t\t\telement;\r\n\r\n\t\t\t\twhile (element = elements[++index]) {\r\n\t\t\t\t\tif (element.nodeType === 1) {\r\n\t\t\t\t\t\tif (nonValue || element[propertyName] === oldValue) {\r\n\t\t\t\t\t\t\telement[propertyName] = newValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcache[propertyName] = newValue;\r\n\t\t\t});\r\n\r\n\t\t\tprototype.constructor = Element;\r\n\r\n\t\t\tif (!prototype.hasAttribute) {\r\n\t\t\t\t// .hasAttribute\r\n\t\t\t\tprototype.hasAttribute = function hasAttribute(name) {\r\n\t\t\t\t\treturn this.getAttribute(name) !== null;\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\t// Apply Element prototype to the pre-existing DOM as soon as the body element appears.\r\n\t\t\tfunction bodyCheck() {\r\n\t\t\t\tif (!(loopLimit--)) clearTimeout(interval);\r\n\t\t\t\tif (document.body && !document.body.prototype && /(complete|interactive)/.test(document.readyState)) {\r\n\t\t\t\t\tshiv(document, true);\r\n\t\t\t\t\tif (interval && document.body.prototype) clearTimeout(interval);\r\n\t\t\t\t\treturn (!!document.body.prototype);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (!bodyCheck()) {\r\n\t\t\t\tdocument.onreadystatechange = bodyCheck;\r\n\t\t\t\tinterval = setInterval(bodyCheck, 25);\r\n\t\t\t}\r\n\r\n\t\t\t// Apply to any new elements created after load\r\n\t\t\tdocument.createElement = function createElement(nodeName) {\r\n\t\t\t\tvar element = nativeCreateElement(String(nodeName).toLowerCase());\r\n\t\t\t\treturn shiv(element);\r\n\t\t\t};\r\n\r\n\t\t\t// remove sandboxed iframe\r\n\t\t\tdocument.removeChild(vbody);\r\n\t\t}());\r\n\r\n\t}\r\n\r\n\r\n// _mutation\r\n\tvar _mutation = (function () { // eslint-disable-line no-unused-vars\r\n\r\n\t\tfunction isNode(object) {\r\n\t\t\t// DOM, Level2\r\n\t\t\tif (typeof Node === 'function') {\r\n\t\t\t\treturn object instanceof Node;\r\n\t\t\t}\r\n\t\t\t// Older browsers, check if it looks like a Node instance)\r\n\t\t\treturn object &&\r\n\t\t\t\ttypeof object === \"object\" &&\r\n\t\t\t\tobject.nodeName &&\r\n\t\t\t\tobject.nodeType >= 1 &&\r\n\t\t\t\tobject.nodeType <= 12;\r\n\t\t}\r\n\r\n\t\t// http://dom.spec.whatwg.org/#mutation-method-macro\r\n\t\treturn function mutation(nodes) {\r\n\t\t\tif (nodes.length === 1) {\r\n\t\t\t\treturn isNode(nodes[0]) ? nodes[0] : document.createTextNode(nodes[0] + '');\r\n\t\t\t}\r\n\r\n\t\t\tvar fragment = document.createDocumentFragment();\r\n\t\t\tfor (var i = 0; i < nodes.length; i++) {\r\n\t\t\t\tfragment.appendChild(isNode(nodes[i]) ? nodes[i] : document.createTextNode(nodes[i] + ''));\r\n\r\n\t\t\t}\r\n\t\t\treturn fragment;\r\n\t\t};\r\n\t}());\r\n\tif (!(\"document\"in this&&\"querySelector\"in this.document\r\n\t)) {\r\n\r\n// document.querySelector\r\n\t\t(function () {\r\n\t\t\tvar\r\n\t\t\t\thead = document.getElementsByTagName('head')[0];\r\n\r\n\t\t\tfunction getElementsByQuery(node, selector, one) {\r\n\t\t\t\tvar\r\n\t\t\t\t\tgenerator = document.createElement('div'),\r\n\t\t\t\t\tid = 'qsa' + String(Math.random()).slice(3),\r\n\t\t\t\t\tstyle, elements;\r\n\r\n\t\t\t\tgenerator.innerHTML = 'x