{"version":3,"sources":["webpack:///node_modules/@angular/cdk/__ivy_ngcc__/esm2015/drag-drop.js","webpack:///src/app/modules/prescriptions/listing-modal/listing-modal.component.ts","webpack:///src/app/modules/prescriptions/listing-modal/listing-modal.component.html","webpack:///src/app/modules/prescriptions/listing-modal/listing-modal.component.scss","webpack:///src/app/modules/prescriptions/prescriptions.module.ts","webpack:///src/app/modules/admin/guards/admin.guard.ts","webpack:///src/app/modules/admin/guards/master.guard.ts","webpack:///src/app/modules/admin/overview/overview.component.html","webpack:///src/app/modules/admin/overview/overview.component.ts","webpack:///src/app/modules/admin/overview/overview.component.scss","webpack:///src/app/modules/admin/overview/prescribers/prescribers.component.html","webpack:///src/app/modules/admin/overview/prescribers/prescribers.service.ts","webpack:///src/app/modules/admin/overview/prescribers/prescribers.component.ts","webpack:///src/app/modules/admin/overview/prescribers/prescribers.component.scss","webpack:///src/app/modules/admin/register/register.component.html","webpack:///src/app/modules/admin/register/modal-form-admin/modal-form-admin.component.ts","webpack:///src/app/modules/admin/register/modal-form-admin/modal-form-admin.component.html","webpack:///src/app/modules/admin/register/modal-form-admin/modal-form-admin.component.scss","webpack:///src/app/modules/admin/register/register.component.ts","webpack:///src/app/shared/models/admin.ts","webpack:///src/app/modules/admin/register/register.component.scss","webpack:///src/app/modules/admin/specialties/specialties.component.ts","webpack:///src/app/modules/admin/specialties/specialties.component.html","webpack:///src/app/modules/admin/specialties/specialties.component.scss","webpack:///src/app/modules/admin/unsubscribe-user/unsubscribe-user.component.html","webpack:///src/app/modules/admin/unsubscribe-user/unsubscribe-user.component.ts","webpack:///src/app/modules/admin/unsubscribe-user/unsubscribe-user.component.scss","webpack:///src/app/modules/admin/domains/exams/exams.component.ts","webpack:///src/app/modules/admin/domains/exams/exams.component.html","webpack:///src/app/modules/admin/domains/exams/exams.component.scss","webpack:///src/app/modules/admin/domains/serene/serene.component.html","webpack:///src/app/modules/admin/domains/serene/serene.component.ts","webpack:///src/app/modules/admin/domains/serene/serene.component.scss","webpack:///src/app/modules/admin/domains/medicaments/medicaments.component.html","webpack:///src/app/modules/document/services/medicament.service.ts","webpack:///src/app/modules/admin/domains/medicaments/medicaments.component.ts","webpack:///src/app/modules/admin/domains/medicaments/medicaments.component.scss","webpack:///src/app/modules/admin/admin-routing.module.ts","webpack:///src/app/modules/admin/listing/features-listing/features-listing.component.html","webpack:///src/app/modules/admin/modal-add-additional-feature/modal-add-additional-feature.component.ts","webpack:///src/app/modules/admin/modal-add-additional-feature/modal-add-additional-feature.component.html","webpack:///src/app/modules/admin/modal-add-additional-feature/modal-add-additional-feature.component.scss","webpack:///src/app/modules/admin/listing/features-listing/features-listing.component.ts","webpack:///src/app/modules/admin/listing/features-listing/features-listing.component.scss","webpack:///src/app/modules/admin/listing/form-filter/form-filter.component.html","webpack:///src/app/modules/admin/listing/form-filter/form-filter.component.ts","webpack:///src/app/modules/admin/listing/form-filter/form-filter.component.scss","webpack:///src/app/modules/admin/listing/health-professional-listing/health-professional-listing.component.html","webpack:///src/app/modules/admin/modal-additionals-features/modal-additionals-features.component.ts","webpack:///src/app/modules/admin/modal-additionals-features/modal-additionals-features.component.html","webpack:///src/app/modules/admin/modal-additionals-features/modal-additionals-features.component.scss","webpack:///src/app/modules/admin/listing/base-listing.component.ts","webpack:///src/app/modules/admin/listing/health-professional-listing/health-professional-listing.component.ts","webpack:///src/app/modules/admin/listing/health-professional-listing/health-professional-listing.component.scss","webpack:///src/app/modules/admin/listing/listing.component.html","webpack:///src/app/modules/admin/listing/listing.component.scss","webpack:///src/app/modules/admin/listing/listing.component.ts","webpack:///src/app/modules/admin/listing/features-listing/medicaments.service.ts","webpack:///src/app/modules/admin/modal-add-medicaments/modal-add-medicaments.component.ts","webpack:///src/app/modules/admin/modal-add-medicaments/modal-add-medicaments.component.html","webpack:///src/app/modules/admin/modal-add-medicaments/modal-add-medicaments.component.scss","webpack:///src/app/modules/admin/listing/medicament-listing/medicament-listing.component.ts","webpack:///src/app/modules/admin/listing/medicament-listing/medicament-listing.component.html","webpack:///src/app/modules/admin/listing/medicament-listing/medicament-listing.component.scss","webpack:///src/app/modules/admin/listing/patients-listing/patients-listing.component.ts","webpack:///src/app/modules/admin/listing/patients-listing/patients-listing.component.html","webpack:///src/app/modules/admin/listing/patients-listing/patients-listing.component.scss","webpack:///src/app/modules/admin/listing/pharmacies-listing/pharmacies-listing.component.html","webpack:///src/app/modules/admin/listing/pharmacies-listing/pharmacies-listing.component.ts","webpack:///src/app/modules/admin/listing/pharmacies-listing/pharmacies-listing.component.scss","webpack:///src/app/modules/admin/listing/pharmacists-listing/pharmacists-listing.component.html","webpack:///src/app/modules/admin/listing/pharmacists-listing/pharmacists-listing.component.ts","webpack:///src/app/modules/admin/listing/pharmacists-listing/pharmacists-listing.component.scss","webpack:///src/app/modules/admin/listing/prescriptions-listing/prescriptions-listing.component.html","webpack:///src/app/modules/admin/listing/prescriptions-listing/prescriptions-listing.component.ts","webpack:///src/app/modules/admin/listing/prescriptions-listing/prescriptions-listing.component.scss","webpack:///src/app/modules/admin/listing/retentions-listing/retentions-listing.component.html","webpack:///src/app/modules/admin/listing/retentions-listing/retentions-listing.component.ts","webpack:///src/app/modules/admin/listing/retentions-listing/retentions-listing.component.scss","webpack:///src/app/modules/admin/listing/specialties-listing/specialties-listing.component.html","webpack:///src/app/modules/admin/modal-add-specialties/modal-add-specialties.component.ts","webpack:///src/app/modules/admin/modal-add-specialties/modal-add-specialties.component.html","webpack:///src/app/modules/admin/modal-add-specialties/modal-add-specialties.component.scss","webpack:///src/app/modules/admin/listing/specialties-listing/specialties-listing.component.ts","webpack:///src/app/modules/admin/listing/specialties-listing/specialties-listing.component.scss","webpack:///src/app/modules/admin/modal-form-tag/modal-form-tag.component.ts","webpack:///src/app/modules/admin/modal-form-tag/modal-form-tag.component.html","webpack:///src/app/modules/admin/modal-form-tag/modal-form-tag.component.scss","webpack:///src/app/modules/admin/listing/tags-listing/tags.service.ts","webpack:///src/app/modules/admin/listing/tags-listing/tags-listing.component.ts","webpack:///src/app/modules/admin/listing/tags-listing/tags-listing.component.html","webpack:///src/app/modules/admin/listing/tags-listing/tags-listing.component.scss","webpack:///src/app/shared/models/user-telemedicine.ts","webpack:///src/app/modules/admin/listing/telemedicine-listing/telemedicine.service.ts","webpack:///src/app/modules/admin/listing/telemedicine-listing/telemedicine-listing.component.ts","webpack:///src/app/modules/admin/listing/telemedicine-listing/telemedicine-listing.component.html","webpack:///src/app/modules/admin/listing/telemedicine-listing/telemedicine-listing.component.scss","webpack:///src/app/modules/admin/listing/victa-listing/victa-listing.component.html","webpack:///src/app/modules/admin/listing/victa-listing/victa-listing.component.ts","webpack:///src/app/modules/admin/listing/victa-listing/victa-listing.component.scss","webpack:///src/app/modules/admin/logs/all-logs/all-logs.component.ts","webpack:///src/app/modules/admin/logs/all-logs/all-logs.component.html","webpack:///src/app/modules/admin/logs/all-logs/all-logs.component.scss","webpack:///src/app/modules/admin/logs/date-logs/date-logs.component.ts","webpack:///src/app/modules/admin/logs/date-logs/date-logs.component.html","webpack:///src/app/modules/admin/logs/date-logs/date-logs.component.scss","webpack:///src/app/modules/admin/logs/logs.component.html","webpack:///src/app/modules/admin/logs/logs.component.ts","webpack:///src/app/modules/admin/logs/logs.component.scss","webpack:///src/app/modules/admin/logs/month-logs/month-logs.component.ts","webpack:///src/app/modules/admin/logs/month-logs/month-logs.component.html","webpack:///src/app/modules/admin/logs/month-logs/month-logs.component.scss","webpack:///src/app/modules/admin/logs/prescription-logs/prescription-logs.component.ts","webpack:///src/app/modules/admin/logs/prescription-logs/prescription-logs.component.html","webpack:///src/app/modules/admin/logs/prescription-logs/prescription-logs.component.scss","webpack:///src/app/modules/admin/listing/pets-listing/pets-listing.component.html","webpack:///src/app/modules/admin/listing/pets-listing/pets-listing.component.ts","webpack:///src/app/modules/admin/listing/pets-listing/pets-listing.component.scss","webpack:///src/app/modules/admin/admin.module.ts"],"names":["extendStyles","dest","source","key","hasOwnProperty","toggleNativeDragInteractions","element","enable","userSelect","style","touchAction","webkitUserDrag","webkitTapHighlightColor","msUserSelect","webkitUserSelect","MozUserSelect","parseCssTimeUnitsToMs","value","multiplier","toLowerCase","indexOf","parseFloat","parseCssPropertyValue","computedStyle","name","getPropertyValue","split","map","part","trim","passiveEventListenerOptions","passive","activeEventListenerOptions","_config","_document","_ngZone","_viewportRuler","_dragDropRegistry","this","_passiveTransform","x","y","_activeTransform","_moveEvents","Subject","_pointerMoveSubscription","Subscription","EMPTY","_pointerUpSubscription","_scrollSubscription","_resizeSubscription","_boundaryElement","_nativeInteractionsEnabled","_handles","_disabledHandles","Set","_direction","dragStartDelay","_disabled","beforeStarted","started","released","ended","entered","exited","dropped","moved","asObservable","_pointerDown","event","next","length","targetHandle","find","handle","target","contains","has","disabled","_initializeDragSequence","_rootElement","_pointerMove","_hasStartedDragging","pointerPosition","_getPointerPositionOnPage","Math","abs","_pickupPositionOnPage","dragStartThreshold","Date","now","_dragStartTime","_endDragSequence","_dropContainer","isDragging","run","_startDragSequence","_previewRect","width","height","_preview","getBoundingClientRect","constrainedPointerPosition","_getConstrainedPointerPosition","_hasMoved","preventDefault","_updatePointerDirectionDelta","_updateActiveDropContainer","activeTransform","_applyRootElementTransform","SVGElement","appliedTransform","setAttribute","observers","distance","_getDragDistance","delta","_pointerDirectionDelta","_pointerUp","withRootElement","registerDragItem","newValue","c","_toggleNativeDragInteractions","_placeholder","handles","forEach","template","_previewTemplate","_placeholderTemplate","rootElement","_removeRootElementListeners","addEventListener","_initialTransform","undefined","boundaryElement","unsubscribe","change","subscribe","_containInsideBoundaryOnResize","removeElement","_destroyPreview","_destroyPlaceholder","removeDragItem","_removeSubscriptions","complete","clear","_nextSibling","transform","add","delete","direction","container","position","_pointerPositionAtLastDirectionChange","_previewRef","destroy","_placeholderRef","stopDragging","_rootElementTapHighlight","_stopScrolling","_animatePreviewToPlaceholder","then","_cleanupDragArtifacts","_cleanupCachedDimensions","isTouchEvent","_lastTouchEventTime","nextSibling","preview","_createPreviewElement","placeholder","_createPlaceholderElement","display","body","appendChild","replaceChild","documentRef","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","start","referenceElement","stopPropagation","isTouchSequence","isAuxiliaryMouseButton","button","isSyntheticEvent","draggable","type","_initialContainer","pointerMove","pointerUp","scroll","pipe","startWith","_scrollPosition","getViewportScrollPosition","_boundaryRect","_pickupPositionInElement","_getPointerPositionInElement","startDragging","insertBefore","currentIndex","getItemIndex","isPointerOverContainer","_isOverContainer","item","previousIndex","previousContainer","drop","newContainer","_getSiblingContainerFromPosition","exit","enter","_startScrollingIfNecessary","_sortItem","getTransform","previewConfig","previewTemplate","viewRef","viewContainer","createEmbeddedView","context","getRootNode","elementRect","deepCloneNode","left","top","pointerEvents","margin","zIndex","classList","Promise","resolve","placeholderRect","duration","getComputedStyle","transitionedProperties","property","prop","propertyIndex","rawDurations","rawDelays","runOutsideAngular","handler","propertyName","removeEventListener","clearTimeout","timeout","setTimeout","placeholderConfig","placeholderTemplate","handleElement","referenceRect","point","targetTouches","pageX","pageY","touches","changedTouches","constrainedPoint","constrainPosition","dropContainerLock","lockAxis","pickupX","pickupY","boundaryRect","previewRect","minY","maxY","bottom","minX","maxX","right","clamp","pointerPositionOnPage","positionSinceLastChange","changeX","changeY","pointerDirectionChangeThreshold","shouldEnable","currentPosition","pickupPosition","leftOverflow","rightOverflow","topOverflow","bottomOverflow","setFreeDragPosition","round","node","clone","cloneNode","descendantsWithId","querySelectorAll","descendantCanvases","removeAttribute","i","cloneCanvases","correspondingCloneContext","getContext","drawImage","min","max","parentNode","removeChild","rootNode","rootNodes","nodeType","ELEMENT_NODE","wrapper","createElement","moveItemInArray","array","fromIndex","toIndex","from","clamp$1","to","_uniqueIdCounter","SCROLL_PROXIMITY_THRESHOLD","id","sortingDisabled","autoScrollDisabled","enterPredicate","sorted","_isDragging","_itemPositions","_viewportScrollPosition","_previousSwap","drag","_siblings","_orientation","_activeSiblings","_viewportScrollSubscription","_verticalScrollDirection","_horizontalScrollDirection","_stopScrollTimers","_handleScroll","_updateAfterScroll","scrollTop","scrollLeft","_startScrollInterval","interval","animationFrame","a","takeUntil","_scrollNode","incrementVerticalScroll","incrementHorizontalScroll","nativeNode","_shadowRoot","ShadowRoot","registerDropContainer","_removeListeners","removeDropContainer","_cacheItems","sibling","_startReceiving","_listenToScrollEvents","pointerX","pointerY","newIndex","_draggables","_getItemIndexFromPointerPosition","activeDraggables","_activeDraggables","getPlaceholderElement","newPositionReference","splice","getRootElement","push","_cacheItemPositions","_reset","items","_withDropContainer","connectedTo","slice","orientation","findIndex","reverse","currentItem","size","pointerDelta","_isPointerNearDropContainer","siblings","isHorizontal","siblingAtNewPosition","clientRect","newPosition","itemOffset","_getItemOffsetPx","siblingOffset","_getSiblingOffsetPx","oldOrder","index","isDraggedItem","offset","elementToOffset","adjustClientRect","scrollNode","verticalScrollDirection","horizontalScrollDirection","computedVertical","getVerticalScrollDirection","computedHorizontal","getHorizontalScrollDirection","scrollHeight","clientHeight","scrollWidth","clientWidth","_clientRect","getViewportSize","window","getMutableClientRect","elementToMeasure","sort","b","_stopReceiving","immediateSibling","end","xThreshold","yThreshold","_","floor","_cacheOwnPosition","scrollPosition","newTop","newLeft","extraClientRect","topDifference","leftDifference","_sortFromLastPointerPosition","isInsideClientRect","_canReceive","elementFromPoint","nativeElement","activeSiblings","isReceiving","predicate","amount","scrollBy","activeCapturingEventOptions","capture","_dropInstances","_dragInstances","_activeDragInstances","_globalListeners","Map","_preventDefaultWhileDragging","getDropContainer","Error","startsWith","moveEvent","upEvent","set","e","options","config","_clearGlobalListeners","Array","instance","ɵfac","t","ɵprov","token","factory","providedIn","ctorParameters","decorators","args","ngInjectableDef","DEFAULT_CONFIG","DragDrop","CDK_DROP_LIST","CDK_DROP_LIST_CONTAINER","CDK_DRAG_PARENT","parentDrag","_stateChanges","_parentDrag","ɵdir","selectors","hostAttrs","inputs","propDecorators","I","CdkDragPlaceholder","templateRef","data","CdkDragPreview","CDK_DRAG_CONFIG","dropContainer","_viewContainerRef","_dir","dragDrop","_changeDetectorRef","_destroyed","Observable","observer","subscription","_dragRef","movedEvent","createDrag","_syncInputs","_handleEvents","selector","reset","getFreeDragPosition","onStable","take","_updateRootElement","changes","tap","childHandleElements","filter","withHandles","switchMap","merge","handleInstance","dragRef","disableHandle","enableHandle","freeDragPosition","rootSelectorChange","positionChange","firstChange","dispose","rootElementSelector","getClosestMatchingAncestor","nodeName","boundary","ref","dir","withBoundaryElement","_getBoundaryElement","withPlaceholderTemplate","withPreviewTemplate","withDirection","emit","markForCheck","currentElement","matches","msMatchesSelector","parentElement","contentQueries","rf","ctx","dirIndex","_t","first","hostVars","hostBindings","outputs","exportAs","features","provide","useExisting","descendants","static","_items","_uniqueIdCounter$1","_group","_sortingDisabled","_dropListRef","createDropList","_dropLists","withItems","result","list","withOrientation","useValue","DragDropModule","ɵmod","ɵinj","providers","ngJitMode","declarations","exports","modalService","prescriptionService","attestationsService","orientationsService","examsService","close","pageSize","selectedTabIndex","selectedTab","tabs","paginationData","skip","totalRecord","orderBy","sortOrder","user","userType","documents","prescriptions","attestations","exams","orientations","tplModal","create","nzTitle","tplTitle","nzContent","tplContent","nzFooter","tplFooter","nzClosable","nzWidth","nzMaskClosable","nzOnCancel","nzWrapClassName","nzOnOk","console","log","destroyTplModal","prescription","loading","downloadOrGeneratePdf","code","err","error","pageIndex","loadData","loadPrescriptions","loadAttestations","loadOrientations","loadExams","getPrescriptionsByPrescriberUserId","_id","limit","toPromise","getPrescriptionsByPatientId","getAttestationsByPrescriberUserId","getAttestationsByPatientId","getOrientationsByPrescriberUserId","getOrientationsByPatientId","getExamsByPrescriberUserId","getExamsByPatientId","nativeAsync","PrescriptionsModule","imports","AdminGuard","authService","route","state","router","permission","MASTER","navigate","OverviewComponent","userService","documentService","notification","displayChart","tenantId","checkParam","getQuantityUsers","patients","doctors","dentists","pharmacies","admins","userChart","pieChartLabels","pieChartColors","backgroundColor","retentions","getTotals","documentsChart","total","statuses","prescriptionsChart","s","status","st","Object","keys","attestationsChart","examsChart","orientationsChart","notify","logout","params","param","queryParam","initCharts","http","month","get","environment","apiRoot","PrescribersComponent","prescribersService","months","number","getMonth","getPrescribersActivity","prescribersActivity","chart","registeredPrescribers","fb","registerService","adminService","saved","form","group","required","email","cpf","permissions","label","MANAGER","BASIC","admin","patchValue","markFormGroup","valid","save","isEdit","update","register","adminForm","control","loadAdmins","getAdmins","nzClassName","nzComponentParams","afterClose","confirm","async","deleteAdmin","SpecialtiesComponent","patientService","healthProfessional","current","searchOption","field","controls","searchField","setValue","query","queryParamType","res","getUser","userDocuments","setCurrent","unsubscribePatient","warning","newCurrent","patient","doctor","dentist","pharmacy","professionalType","modalPrescriptions","createTplModal","reduce","examService","file","isPet","uploadExams","libraryService","uploadProtocols","formData","FormData","append","post","URL","catchError","medicamentService","upload","routes","path","component","canActivate","AdminRoutingModule","forChild","nzModalRef","additionalFeatureService","isVisible","formAdditionalFeature","destinations","description","updateListFeatures","updateFeature","saveFeature","feature","valueForm","setValues","destination","destinationsOptions","pharmacist","getAdditionalsFeatures","getAdditionalFeatures","getFilter","modal","afterOpen","getContentComponent","filterData","updateListFeature","d","join","resolvePendingView","exportDataBtn","filterDataEvent","exportDataEmit","resolvePendingEmit","Permission","clients","currentValue","filters","initFilter","changeDate","initDate","moment","subtract","format","endDate","getClientApps","tenantRdOnly","responsibleCpf","access","healthProfessionals","createdBy","veterinarians","businessName","fantasyName","cnpj","pharmacists","prescriberCpf","patientCpf","version","infusions","prescriptionCode","dispensationCode","cpfBuyer","cnpjPharmacy","pets","responsibleName","entries","some","listingType","ModalAdditionalsFeaturesComponent","additionalsFeaturesOptions","additionalsFeaturesSelected","getAdditionalsFeaturesOptions","getAdditionalFeaturesByUser","additionalFeatures","option","associateFunctionalities","disassociateFunctionality","injector","isLoading","userId","ouSuccess","toggleTentat","httpError","message","healthProfessionalService","super","importPatientsVisible","scrollConfig","fileForm","getProfessionalTypeName","getHealthProfessionalsByProfessionalType","response","setFilter","getHealthProfessionals","specialties","title","completeUser","userTypeLogged","updateUserEvent","JSON","parse","stringify","setVisible","visible","commercialDataVisible","commercialDataIndex","commercialData","exportData","resolvePending","checked","getProfessionalTypeNameLabel","activationToken","getDomain","healthProfessionalId","importPatients","count","hideImportPatients","rowNumber","cfm","refreshCrmStatus","loadingRevalidate","revalidateCpf","consult","dateOfBirth","nascimento","toDate","fullname","nome","arr","location","href","replace","loadingTenant","Blob","masterGuard","medicament","put","medicamentsService","formMedicament","principio","laboratorio","ggrem","registro","ean","apresentacao","apresentacaoCustomizada","comercializado2019","tarja","tipo","updateMedicaments","updateMedicament","registerMedicament","_medicamentForm","excel","loadMedicaments","getMedicaments","medicaments","medicamentForm","sendExcelMedicaments","tenants","getPatients","getPatientsByFilter","updatedUser","updateUserData","pharmacyService","cdr","currentPage","isPublic","getPharmacies","detectChanges","getPharmaciesByFilter","pharmicies","upDateUserData","technicalResponsible","importPharmacies","pharmacistService","getPharmacists","attestationService","orientationService","infusionService","getPrescriptions","previousValue","getPrescriptionsByFilter","getByFilter","page","retentionService","getRetentions","getRetentionsByFilter","specialtyService","submit","specialty","updateSpecialty","saveSpecialty","msg","specialtiesService","specialtyTypeOptions","getSpecialties","requiredIfNotChild","parent","nullValidator","minLength","maxLength","content","tag","tagForm","parentId","tagsService","disableDragging","loadTags","tags","findAll","convertTreeToList","children","expand","collapse","tagToSave","newTag","listingTable","selectedTag","order","enabled","editTag","root","stack","hashMap","level","pop","visitNode","UserTelemedicine","assign","in_review","fromJson","responseType","TelemedicinesListingComponent","telemedicineService","statusOptions","getTelemedicines","disable","ut","downloadDocument","document","createObjectURL","download","click","victaProtocolService","import","pageIndexChange","sortChange","date","dateLog","logs","logsService","origin","queryParams","p","groupBy","test","endOf","startOf","getLogs","getLogsByFilter","petPatientService","bsModalService","pagination","searchPaginate","pet","initialState","isVeterinarian","displayAlert","show","class","backdrop","keyboard","AdminModule","forRoot"],"mappings":"0XA8BA,SAASA,EAAaC,EAAMC,GACxB,IAAK,IAAIC,KAAOD,EACRA,EAAOE,eAAeD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AwC,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IAEF3F,QAAS,CACP,IACAuI,GACA,KACA,KACA,KACA,KACA9M,GACA,KACAsE,GACA,KAAcyZ,UACd,KAAYA,WAEd5d,UAAW,CAAC,SAED2d","file":"x","sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { normalizePassiveListenerOptions, _supportsShadowDom } from '@angular/cdk/platform';\nimport { coerceBooleanProperty, coerceElement, coerceNumberProperty, coerceArray } from '@angular/cdk/coercion';\nimport { Subscription, Subject, interval, animationFrameScheduler, Observable, merge } from 'rxjs';\nimport { startWith, takeUntil, take, map, switchMap, tap } from 'rxjs/operators';\nimport { Injectable, NgZone, Inject, InjectionToken, NgModule, ContentChildren, ElementRef, EventEmitter, forwardRef, Input, Output, Optional, Directive, ChangeDetectorRef, SkipSelf, ContentChild, ViewContainerRef, isDevMode, TemplateRef, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport { Directionality } from '@angular/cdk/bidi';\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Shallow-extends a stylesheet object with another stylesheet object.\n * \\@docs-private\n * @param {?} dest\n * @param {?} source\n * @return {?}\n */\nimport * as ɵngcc0 from '@angular/core';\nimport * as ɵngcc1 from '@angular/cdk/scrolling';\nimport * as ɵngcc2 from '@angular/cdk/bidi';\nfunction extendStyles(dest, source) {\n    for (let key in source) {\n        if (source.hasOwnProperty(key)) {\n            dest[key] = (/** @type {?} */ (source[key]));\n        }\n    }\n    return dest;\n}\n/**\n * Toggles whether the native drag interactions should be enabled for an element.\n * \\@docs-private\n * @param {?} element Element on which to toggle the drag interactions.\n * @param {?} enable Whether the drag interactions should be enabled.\n * @return {?}\n */\nfunction toggleNativeDragInteractions(element, enable) {\n    /** @type {?} */\n    const userSelect = enable ? '' : 'none';\n    extendStyles(element.style, {\n        touchAction: enable ? '' : 'none',\n        webkitUserDrag: enable ? '' : 'none',\n        webkitTapHighlightColor: enable ? '' : 'transparent',\n        userSelect: userSelect,\n        msUserSelect: userSelect,\n        webkitUserSelect: userSelect,\n        MozUserSelect: userSelect\n    });\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\n/**\n * Parses a CSS time value to milliseconds.\n * @param {?} value\n * @return {?}\n */\nfunction parseCssTimeUnitsToMs(value) {\n    // Some browsers will return it in seconds, whereas others will return milliseconds.\n    /** @type {?} */\n    const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n    return parseFloat(value) * multiplier;\n}\n/**\n * Gets the transform transition duration, including the delay, of an element in milliseconds.\n * @param {?} element\n * @return {?}\n */\nfunction getTransformTransitionDurationInMs(element) {\n    /** @type {?} */\n    const computedStyle = getComputedStyle(element);\n    /** @type {?} */\n    const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n    /** @type {?} */\n    const property = transitionedProperties.find((/**\n     * @param {?} prop\n     * @return {?}\n     */\n    prop => prop === 'transform' || prop === 'all'));\n    // If there's no transition for `all` or `transform`, we shouldn't do anything.\n    if (!property) {\n        return 0;\n    }\n    // Get the index of the property that we're interested in and match\n    // it up to the same index in `transition-delay` and `transition-duration`.\n    /** @type {?} */\n    const propertyIndex = transitionedProperties.indexOf(property);\n    /** @type {?} */\n    const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n    /** @type {?} */\n    const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n    return parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n        parseCssTimeUnitsToMs(rawDelays[propertyIndex]);\n}\n/**\n * Parses out multiple values from a computed style into an array.\n * @param {?} computedStyle\n * @param {?} name\n * @return {?}\n */\nfunction parseCssPropertyValue(computedStyle, name) {\n    /** @type {?} */\n    const value = computedStyle.getPropertyValue(name);\n    return value.split(',').map((/**\n     * @param {?} part\n     * @return {?}\n     */\n    part => part.trim()));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Options that can be used to bind a passive event listener.\n * @type {?}\n */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });\n/**\n * Options that can be used to bind an active event listener.\n * @type {?}\n */\nconst activeEventListenerOptions = normalizePassiveListenerOptions({ passive: false });\n/**\n * Time in milliseconds for which to ignore mouse events, after\n * receiving a touch event. Used to avoid doing double work for\n * touch devices where the browser fires fake mouse events, in\n * addition to touch events.\n * @type {?}\n */\nconst MOUSE_EVENT_IGNORE_TIME = 800;\n/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n * \\@docs-private\n * @template T\n */\nclass DragRef {\n    /**\n     * @param {?} element\n     * @param {?} _config\n     * @param {?} _document\n     * @param {?} _ngZone\n     * @param {?} _viewportRuler\n     * @param {?} _dragDropRegistry\n     */\n    constructor(element, _config, _document, _ngZone, _viewportRuler, _dragDropRegistry) {\n        this._config = _config;\n        this._document = _document;\n        this._ngZone = _ngZone;\n        this._viewportRuler = _viewportRuler;\n        this._dragDropRegistry = _dragDropRegistry;\n        /**\n         * CSS `transform` applied to the element when it isn't being dragged. We need a\n         * passive transform in order for the dragged element to retain its new position\n         * after the user has stopped dragging and because we need to know the relative\n         * position in case they start dragging again. This corresponds to `element.style.transform`.\n         */\n        this._passiveTransform = { x: 0, y: 0 };\n        /**\n         * CSS `transform` that is applied to the element while it's being dragged.\n         */\n        this._activeTransform = { x: 0, y: 0 };\n        /**\n         * Emits when the item is being moved.\n         */\n        this._moveEvents = new Subject();\n        /**\n         * Subscription to pointer movement events.\n         */\n        this._pointerMoveSubscription = Subscription.EMPTY;\n        /**\n         * Subscription to the event that is dispatched when the user lifts their pointer.\n         */\n        this._pointerUpSubscription = Subscription.EMPTY;\n        /**\n         * Subscription to the viewport being scrolled.\n         */\n        this._scrollSubscription = Subscription.EMPTY;\n        /**\n         * Subscription to the viewport being resized.\n         */\n        this._resizeSubscription = Subscription.EMPTY;\n        /**\n         * Cached reference to the boundary element.\n         */\n        this._boundaryElement = null;\n        /**\n         * Whether the native dragging interactions have been enabled on the root element.\n         */\n        this._nativeInteractionsEnabled = true;\n        /**\n         * Elements that can be used to drag the draggable item.\n         */\n        this._handles = [];\n        /**\n         * Registered handles that are currently disabled.\n         */\n        this._disabledHandles = new Set();\n        /**\n         * Layout direction of the item.\n         */\n        this._direction = 'ltr';\n        /**\n         * Amount of milliseconds to wait after the user has put their\n         * pointer down before starting to drag the element.\n         */\n        this.dragStartDelay = 0;\n        this._disabled = false;\n        /**\n         * Emits as the drag sequence is being prepared.\n         */\n        this.beforeStarted = new Subject();\n        /**\n         * Emits when the user starts dragging the item.\n         */\n        this.started = new Subject();\n        /**\n         * Emits when the user has released a drag item, before any animations have started.\n         */\n        this.released = new Subject();\n        /**\n         * Emits when the user stops dragging an item in the container.\n         */\n        this.ended = new Subject();\n        /**\n         * Emits when the user has moved the item into a new container.\n         */\n        this.entered = new Subject();\n        /**\n         * Emits when the user removes the item its container by dragging it into another container.\n         */\n        this.exited = new Subject();\n        /**\n         * Emits when the user drops the item inside a container.\n         */\n        this.dropped = new Subject();\n        /**\n         * Emits as the user is dragging the item. Use with caution,\n         * because this event will fire for every pixel that the user has dragged.\n         */\n        this.moved = this._moveEvents.asObservable();\n        /**\n         * Handler for the `mousedown`/`touchstart` events.\n         */\n        this._pointerDown = (/**\n         * @param {?} event\n         * @return {?}\n         */\n        (event) => {\n            this.beforeStarted.next();\n            // Delegate the event based on whether it started from a handle or the element itself.\n            if (this._handles.length) {\n                /** @type {?} */\n                const targetHandle = this._handles.find((/**\n                 * @param {?} handle\n                 * @return {?}\n                 */\n                handle => {\n                    /** @type {?} */\n                    const target = event.target;\n                    return !!target && (target === handle || handle.contains((/** @type {?} */ (target))));\n                }));\n                if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n                    this._initializeDragSequence(targetHandle, event);\n                }\n            }\n            else if (!this.disabled) {\n                this._initializeDragSequence(this._rootElement, event);\n            }\n        });\n        /**\n         * Handler that is invoked when the user moves their pointer after they've initiated a drag.\n         */\n        this._pointerMove = (/**\n         * @param {?} event\n         * @return {?}\n         */\n        (event) => {\n            if (!this._hasStartedDragging) {\n                /** @type {?} */\n                const pointerPosition = this._getPointerPositionOnPage(event);\n                /** @type {?} */\n                const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x);\n                /** @type {?} */\n                const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y);\n                /** @type {?} */\n                const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold;\n                // Only start dragging after the user has moved more than the minimum distance in either\n                // direction. Note that this is preferrable over doing something like `skip(minimumDistance)`\n                // in the `pointerMove` subscription, because we're not guaranteed to have one move event\n                // per pixel of movement (e.g. if the user moves their pointer quickly).\n                if (isOverThreshold) {\n                    /** @type {?} */\n                    const isDelayElapsed = Date.now() >= this._dragStartTime + (this.dragStartDelay || 0);\n                    if (!isDelayElapsed) {\n                        this._endDragSequence(event);\n                        return;\n                    }\n                    // Prevent other drag sequences from starting while something in the container is still\n                    // being dragged. This can happen while we're waiting for the drop animation to finish\n                    // and can cause errors, because some elements might still be moving around.\n                    if (!this._dropContainer || !this._dropContainer.isDragging()) {\n                        this._hasStartedDragging = true;\n                        this._ngZone.run((/**\n                         * @return {?}\n                         */\n                        () => this._startDragSequence(event)));\n                    }\n                }\n                return;\n            }\n            // We only need the preview dimensions if we have a boundary element.\n            if (this._boundaryElement) {\n                // Cache the preview element rect if we haven't cached it already or if\n                // we cached it too early before the element dimensions were computed.\n                if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {\n                    this._previewRect = (this._preview || this._rootElement).getBoundingClientRect();\n                }\n            }\n            /** @type {?} */\n            const constrainedPointerPosition = this._getConstrainedPointerPosition(event);\n            this._hasMoved = true;\n            event.preventDefault();\n            this._updatePointerDirectionDelta(constrainedPointerPosition);\n            if (this._dropContainer) {\n                this._updateActiveDropContainer(constrainedPointerPosition);\n            }\n            else {\n                /** @type {?} */\n                const activeTransform = this._activeTransform;\n                activeTransform.x =\n                    constrainedPointerPosition.x - this._pickupPositionOnPage.x + this._passiveTransform.x;\n                activeTransform.y =\n                    constrainedPointerPosition.y - this._pickupPositionOnPage.y + this._passiveTransform.y;\n                this._applyRootElementTransform(activeTransform.x, activeTransform.y);\n                // Apply transform as attribute if dragging and svg element to work for IE\n                if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n                    /** @type {?} */\n                    const appliedTransform = `translate(${activeTransform.x} ${activeTransform.y})`;\n                    this._rootElement.setAttribute('transform', appliedTransform);\n                }\n            }\n            // Since this event gets fired for every pixel while dragging, we only\n            // want to fire it if the consumer opted into it. Also we have to\n            // re-enter the zone because we run all of the events on the outside.\n            if (this._moveEvents.observers.length) {\n                this._ngZone.run((/**\n                 * @return {?}\n                 */\n                () => {\n                    this._moveEvents.next({\n                        source: this,\n                        pointerPosition: constrainedPointerPosition,\n                        event,\n                        distance: this._getDragDistance(constrainedPointerPosition),\n                        delta: this._pointerDirectionDelta\n                    });\n                }));\n            }\n        });\n        /**\n         * Handler that is invoked when the user lifts their pointer up, after initiating a drag.\n         */\n        this._pointerUp = (/**\n         * @param {?} event\n         * @return {?}\n         */\n        (event) => {\n            this._endDragSequence(event);\n        });\n        this.withRootElement(element);\n        _dragDropRegistry.registerDragItem(this);\n    }\n    /**\n     * Whether starting to drag this element is disabled.\n     * @return {?}\n     */\n    get disabled() {\n        return this._disabled || !!(this._dropContainer && this._dropContainer.disabled);\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    set disabled(value) {\n        /** @type {?} */\n        const newValue = coerceBooleanProperty(value);\n        if (newValue !== this._disabled) {\n            this._disabled = newValue;\n            this._toggleNativeDragInteractions();\n        }\n    }\n    /**\n     * Returns the element that is being used as a placeholder\n     * while the current element is being dragged.\n     * @return {?}\n     */\n    getPlaceholderElement() {\n        return this._placeholder;\n    }\n    /**\n     * Returns the root draggable element.\n     * @return {?}\n     */\n    getRootElement() {\n        return this._rootElement;\n    }\n    /**\n     * Registers the handles that can be used to drag the element.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} handles\n     * @return {THIS}\n     */\n    withHandles(handles) {\n        (/** @type {?} */ (this))._handles = handles.map((/**\n         * @param {?} handle\n         * @return {?}\n         */\n        handle => coerceElement(handle)));\n        (/** @type {?} */ (this))._handles.forEach((/**\n         * @param {?} handle\n         * @return {?}\n         */\n        handle => toggleNativeDragInteractions(handle, false)));\n        (/** @type {?} */ (this))._toggleNativeDragInteractions();\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Registers the template that should be used for the drag preview.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} template Template that from which to stamp out the preview.\n     * @return {THIS}\n     */\n    withPreviewTemplate(template) {\n        (/** @type {?} */ (this))._previewTemplate = template;\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Registers the template that should be used for the drag placeholder.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} template Template that from which to stamp out the placeholder.\n     * @return {THIS}\n     */\n    withPlaceholderTemplate(template) {\n        (/** @type {?} */ (this))._placeholderTemplate = template;\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Sets an alternate drag root element. The root element is the element that will be moved as\n     * the user is dragging. Passing an alternate root element is useful when trying to enable\n     * dragging on an element that you might not have access to.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} rootElement\n     * @return {THIS}\n     */\n    withRootElement(rootElement) {\n        /** @type {?} */\n        const element = coerceElement(rootElement);\n        if (element !== (/** @type {?} */ (this))._rootElement) {\n            if ((/** @type {?} */ (this))._rootElement) {\n                (/** @type {?} */ (this))._removeRootElementListeners((/** @type {?} */ (this))._rootElement);\n            }\n            element.addEventListener('mousedown', (/** @type {?} */ (this))._pointerDown, activeEventListenerOptions);\n            element.addEventListener('touchstart', (/** @type {?} */ (this))._pointerDown, passiveEventListenerOptions);\n            (/** @type {?} */ (this))._initialTransform = undefined;\n            (/** @type {?} */ (this))._rootElement = element;\n        }\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Element to which the draggable's position will be constrained.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} boundaryElement\n     * @return {THIS}\n     */\n    withBoundaryElement(boundaryElement) {\n        (/** @type {?} */ (this))._boundaryElement = boundaryElement ? coerceElement(boundaryElement) : null;\n        (/** @type {?} */ (this))._resizeSubscription.unsubscribe();\n        if (boundaryElement) {\n            (/** @type {?} */ (this))._resizeSubscription = (/** @type {?} */ (this))._viewportRuler\n                .change(10)\n                .subscribe((/**\n             * @return {?}\n             */\n            () => (/** @type {?} */ (this))._containInsideBoundaryOnResize()));\n        }\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Removes the dragging functionality from the DOM element.\n     * @return {?}\n     */\n    dispose() {\n        this._removeRootElementListeners(this._rootElement);\n        // Do this check before removing from the registry since it'll\n        // stop being considered as dragged once it is removed.\n        if (this.isDragging()) {\n            // Since we move out the element to the end of the body while it's being\n            // dragged, we have to make sure that it's removed if it gets destroyed.\n            removeElement(this._rootElement);\n        }\n        this._destroyPreview();\n        this._destroyPlaceholder();\n        this._dragDropRegistry.removeDragItem(this);\n        this._removeSubscriptions();\n        this.beforeStarted.complete();\n        this.started.complete();\n        this.released.complete();\n        this.ended.complete();\n        this.entered.complete();\n        this.exited.complete();\n        this.dropped.complete();\n        this._moveEvents.complete();\n        this._handles = [];\n        this._disabledHandles.clear();\n        this._dropContainer = undefined;\n        this._boundaryElement = this._rootElement = this._placeholderTemplate =\n            this._previewTemplate = this._nextSibling = (/** @type {?} */ (null));\n    }\n    /**\n     * Checks whether the element is currently being dragged.\n     * @return {?}\n     */\n    isDragging() {\n        return this._hasStartedDragging && this._dragDropRegistry.isDragging(this);\n    }\n    /**\n     * Resets a standalone drag item to its initial position.\n     * @return {?}\n     */\n    reset() {\n        this._rootElement.style.transform = this._initialTransform || '';\n        this._activeTransform = { x: 0, y: 0 };\n        this._passiveTransform = { x: 0, y: 0 };\n    }\n    /**\n     * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging.\n     * @param {?} handle Handle element that should be disabled.\n     * @return {?}\n     */\n    disableHandle(handle) {\n        if (this._handles.indexOf(handle) > -1) {\n            this._disabledHandles.add(handle);\n        }\n    }\n    /**\n     * Enables a handle, if it has been disabled.\n     * @param {?} handle Handle element to be enabled.\n     * @return {?}\n     */\n    enableHandle(handle) {\n        this._disabledHandles.delete(handle);\n    }\n    /**\n     * Sets the layout direction of the draggable item.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} direction\n     * @return {THIS}\n     */\n    withDirection(direction) {\n        (/** @type {?} */ (this))._direction = direction;\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Sets the container that the item is part of.\n     * @param {?} container\n     * @return {?}\n     */\n    _withDropContainer(container) {\n        this._dropContainer = container;\n    }\n    /**\n     * Gets the current position in pixels the draggable outside of a drop container.\n     * @return {?}\n     */\n    getFreeDragPosition() {\n        /** @type {?} */\n        const position = this.isDragging() ? this._activeTransform : this._passiveTransform;\n        return { x: position.x, y: position.y };\n    }\n    /**\n     * Sets the current position in pixels the draggable outside of a drop container.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} value New position to be set.\n     * @return {THIS}\n     */\n    setFreeDragPosition(value) {\n        (/** @type {?} */ (this))._activeTransform = { x: 0, y: 0 };\n        (/** @type {?} */ (this))._passiveTransform.x = value.x;\n        (/** @type {?} */ (this))._passiveTransform.y = value.y;\n        if (!(/** @type {?} */ (this))._dropContainer) {\n            (/** @type {?} */ (this))._applyRootElementTransform(value.x, value.y);\n        }\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Updates the item's sort order based on the last-known pointer position.\n     * @return {?}\n     */\n    _sortFromLastPointerPosition() {\n        /** @type {?} */\n        const position = this._pointerPositionAtLastDirectionChange;\n        if (position && this._dropContainer) {\n            this._updateActiveDropContainer(position);\n        }\n    }\n    /**\n     * Unsubscribes from the global subscriptions.\n     * @private\n     * @return {?}\n     */\n    _removeSubscriptions() {\n        this._pointerMoveSubscription.unsubscribe();\n        this._pointerUpSubscription.unsubscribe();\n        this._scrollSubscription.unsubscribe();\n    }\n    /**\n     * Destroys the preview element and its ViewRef.\n     * @private\n     * @return {?}\n     */\n    _destroyPreview() {\n        if (this._preview) {\n            removeElement(this._preview);\n        }\n        if (this._previewRef) {\n            this._previewRef.destroy();\n        }\n        this._preview = this._previewRef = (/** @type {?} */ (null));\n    }\n    /**\n     * Destroys the placeholder element and its ViewRef.\n     * @private\n     * @return {?}\n     */\n    _destroyPlaceholder() {\n        if (this._placeholder) {\n            removeElement(this._placeholder);\n        }\n        if (this._placeholderRef) {\n            this._placeholderRef.destroy();\n        }\n        this._placeholder = this._placeholderRef = (/** @type {?} */ (null));\n    }\n    /**\n     * Clears subscriptions and stops the dragging sequence.\n     * @private\n     * @param {?} event Browser event object that ended the sequence.\n     * @return {?}\n     */\n    _endDragSequence(event) {\n        // Note that here we use `isDragging` from the service, rather than from `this`.\n        // The difference is that the one from the service reflects whether a dragging sequence\n        // has been initiated, whereas the one on `this` includes whether the user has passed\n        // the minimum dragging threshold.\n        if (!this._dragDropRegistry.isDragging(this)) {\n            return;\n        }\n        this._removeSubscriptions();\n        this._dragDropRegistry.stopDragging(this);\n        this._toggleNativeDragInteractions();\n        if (this._handles) {\n            this._rootElement.style.webkitTapHighlightColor = this._rootElementTapHighlight;\n        }\n        if (!this._hasStartedDragging) {\n            return;\n        }\n        this.released.next({ source: this });\n        if (this._dropContainer) {\n            // Stop scrolling immediately, instead of waiting for the animation to finish.\n            this._dropContainer._stopScrolling();\n            this._animatePreviewToPlaceholder().then((/**\n             * @return {?}\n             */\n            () => {\n                this._cleanupDragArtifacts(event);\n                this._cleanupCachedDimensions();\n                this._dragDropRegistry.stopDragging(this);\n            }));\n        }\n        else {\n            // Convert the active transform into a passive one. This means that next time\n            // the user starts dragging the item, its position will be calculated relatively\n            // to the new passive transform.\n            this._passiveTransform.x = this._activeTransform.x;\n            this._passiveTransform.y = this._activeTransform.y;\n            this._ngZone.run((/**\n             * @return {?}\n             */\n            () => {\n                this.ended.next({\n                    source: this,\n                    distance: this._getDragDistance(this._getPointerPositionOnPage(event))\n                });\n            }));\n            this._cleanupCachedDimensions();\n            this._dragDropRegistry.stopDragging(this);\n        }\n    }\n    /**\n     * Starts the dragging sequence.\n     * @private\n     * @param {?} event\n     * @return {?}\n     */\n    _startDragSequence(event) {\n        // Emit the event on the item before the one on the container.\n        this.started.next({ source: this });\n        if (isTouchEvent(event)) {\n            this._lastTouchEventTime = Date.now();\n        }\n        this._toggleNativeDragInteractions();\n        if (this._dropContainer) {\n            /** @type {?} */\n            const element = this._rootElement;\n            // Grab the `nextSibling` before the preview and placeholder\n            // have been created so we don't get the preview by accident.\n            this._nextSibling = element.nextSibling;\n            /** @type {?} */\n            const preview = this._preview = this._createPreviewElement();\n            /** @type {?} */\n            const placeholder = this._placeholder = this._createPlaceholderElement();\n            // We move the element out at the end of the body and we make it hidden, because keeping it in\n            // place will throw off the consumer's `:last-child` selectors. We can't remove the element\n            // from the DOM completely, because iOS will stop firing all subsequent events in the chain.\n            element.style.display = 'none';\n            this._document.body.appendChild((/** @type {?} */ (element.parentNode)).replaceChild(placeholder, element));\n            getPreviewInsertionPoint(this._document).appendChild(preview);\n            this._dropContainer.start();\n        }\n    }\n    /**\n     * Sets up the different variables and subscriptions\n     * that will be necessary for the dragging sequence.\n     * @private\n     * @param {?} referenceElement Element that started the drag sequence.\n     * @param {?} event Browser event object that started the sequence.\n     * @return {?}\n     */\n    _initializeDragSequence(referenceElement, event) {\n        // Always stop propagation for the event that initializes\n        // the dragging sequence, in order to prevent it from potentially\n        // starting another sequence for a draggable parent somewhere up the DOM tree.\n        event.stopPropagation();\n        /** @type {?} */\n        const isDragging = this.isDragging();\n        /** @type {?} */\n        const isTouchSequence = isTouchEvent(event);\n        /** @type {?} */\n        const isAuxiliaryMouseButton = !isTouchSequence && ((/** @type {?} */ (event))).button !== 0;\n        /** @type {?} */\n        const rootElement = this._rootElement;\n        /** @type {?} */\n        const isSyntheticEvent = !isTouchSequence && this._lastTouchEventTime &&\n            this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now();\n        // If the event started from an element with the native HTML drag&drop, it'll interfere\n        // with our own dragging (e.g. `img` tags do it by default). Prevent the default action\n        // to stop it from happening. Note that preventing on `dragstart` also seems to work, but\n        // it's flaky and it fails if the user drags it away quickly. Also note that we only want\n        // to do this for `mousedown` since doing the same for `touchstart` will stop any `click`\n        // events from firing on touch devices.\n        if (event.target && ((/** @type {?} */ (event.target))).draggable && event.type === 'mousedown') {\n            event.preventDefault();\n        }\n        // Abort if the user is already dragging or is using a mouse button other than the primary one.\n        if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent) {\n            return;\n        }\n        // If we've got handles, we need to disable the tap highlight on the entire root element,\n        // otherwise iOS will still add it, even though all the drag interactions on the handle\n        // are disabled.\n        if (this._handles.length) {\n            this._rootElementTapHighlight = rootElement.style.webkitTapHighlightColor;\n            rootElement.style.webkitTapHighlightColor = 'transparent';\n        }\n        this._hasStartedDragging = this._hasMoved = false;\n        this._initialContainer = (/** @type {?} */ (this._dropContainer));\n        // Avoid multiple subscriptions and memory leaks when multi touch\n        // (isDragging check above isn't enough because of possible temporal and/or dimensional delays)\n        this._removeSubscriptions();\n        this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);\n        this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);\n        this._scrollSubscription = this._dragDropRegistry.scroll.pipe(startWith(null)).subscribe((/**\n         * @return {?}\n         */\n        () => {\n            this._scrollPosition = this._viewportRuler.getViewportScrollPosition();\n        }));\n        if (this._boundaryElement) {\n            this._boundaryRect = this._boundaryElement.getBoundingClientRect();\n        }\n        // If we have a custom preview template, the element won't be visible anyway so we avoid the\n        // extra `getBoundingClientRect` calls and just move the preview next to the cursor.\n        this._pickupPositionInElement = this._previewTemplate && this._previewTemplate.template ?\n            { x: 0, y: 0 } :\n            this._getPointerPositionInElement(referenceElement, event);\n        /** @type {?} */\n        const pointerPosition = this._pickupPositionOnPage = this._getPointerPositionOnPage(event);\n        this._pointerDirectionDelta = { x: 0, y: 0 };\n        this._pointerPositionAtLastDirectionChange = { x: pointerPosition.x, y: pointerPosition.y };\n        this._dragStartTime = Date.now();\n        this._dragDropRegistry.startDragging(this, event);\n    }\n    /**\n     * Cleans up the DOM artifacts that were added to facilitate the element being dragged.\n     * @private\n     * @param {?} event\n     * @return {?}\n     */\n    _cleanupDragArtifacts(event) {\n        // Restore the element's visibility and insert it at its old position in the DOM.\n        // It's important that we maintain the position, because moving the element around in the DOM\n        // can throw off `NgFor` which does smart diffing and re-creates elements only when necessary,\n        // while moving the existing elements in all other cases.\n        this._rootElement.style.display = '';\n        if (this._nextSibling) {\n            (/** @type {?} */ (this._nextSibling.parentNode)).insertBefore(this._rootElement, this._nextSibling);\n        }\n        else {\n            coerceElement(this._initialContainer.element).appendChild(this._rootElement);\n        }\n        this._destroyPreview();\n        this._destroyPlaceholder();\n        this._boundaryRect = this._previewRect = undefined;\n        // Re-enter the NgZone since we bound `document` events on the outside.\n        this._ngZone.run((/**\n         * @return {?}\n         */\n        () => {\n            /** @type {?} */\n            const container = (/** @type {?} */ (this._dropContainer));\n            /** @type {?} */\n            const currentIndex = container.getItemIndex(this);\n            /** @type {?} */\n            const pointerPosition = this._getPointerPositionOnPage(event);\n            /** @type {?} */\n            const distance = this._getDragDistance(this._getPointerPositionOnPage(event));\n            /** @type {?} */\n            const isPointerOverContainer = container._isOverContainer(pointerPosition.x, pointerPosition.y);\n            this.ended.next({ source: this, distance });\n            this.dropped.next({\n                item: this,\n                currentIndex,\n                previousIndex: this._initialContainer.getItemIndex(this),\n                container: container,\n                previousContainer: this._initialContainer,\n                isPointerOverContainer,\n                distance\n            });\n            container.drop(this, currentIndex, this._initialContainer, isPointerOverContainer, distance);\n            this._dropContainer = this._initialContainer;\n        }));\n    }\n    /**\n     * Updates the item's position in its drop container, or moves it\n     * into a new one, depending on its current drag position.\n     * @private\n     * @param {?} __0\n     * @return {?}\n     */\n    _updateActiveDropContainer({ x, y }) {\n        // Drop container that draggable has been moved into.\n        /** @type {?} */\n        let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);\n        // If we couldn't find a new container to move the item into, and the item has left its\n        // initial container, check whether the it's over the initial container. This handles the\n        // case where two containers are connected one way and the user tries to undo dragging an\n        // item into a new container.\n        if (!newContainer && this._dropContainer !== this._initialContainer &&\n            this._initialContainer._isOverContainer(x, y)) {\n            newContainer = this._initialContainer;\n        }\n        if (newContainer && newContainer !== this._dropContainer) {\n            this._ngZone.run((/**\n             * @return {?}\n             */\n            () => {\n                // Notify the old container that the item has left.\n                this.exited.next({ item: this, container: (/** @type {?} */ (this._dropContainer)) });\n                (/** @type {?} */ (this._dropContainer)).exit(this);\n                // Notify the new container that the item has entered.\n                this._dropContainer = (/** @type {?} */ (newContainer));\n                this._dropContainer.enter(this, x, y);\n                this.entered.next({\n                    item: this,\n                    container: (/** @type {?} */ (newContainer)),\n                    currentIndex: (/** @type {?} */ (newContainer)).getItemIndex(this)\n                });\n            }));\n        }\n        (/** @type {?} */ (this._dropContainer))._startScrollingIfNecessary(x, y);\n        (/** @type {?} */ (this._dropContainer))._sortItem(this, x, y, this._pointerDirectionDelta);\n        this._preview.style.transform =\n            getTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y);\n    }\n    /**\n     * Creates the element that will be rendered next to the user's pointer\n     * and will be used as a preview of the element that is being dragged.\n     * @private\n     * @return {?}\n     */\n    _createPreviewElement() {\n        /** @type {?} */\n        const previewConfig = this._previewTemplate;\n        /** @type {?} */\n        const previewTemplate = previewConfig ? previewConfig.template : null;\n        /** @type {?} */\n        let preview;\n        if (previewTemplate) {\n            /** @type {?} */\n            const viewRef = (/** @type {?} */ (previewConfig)).viewContainer.createEmbeddedView(previewTemplate, (/** @type {?} */ (previewConfig)).context);\n            preview = getRootNode(viewRef, this._document);\n            this._previewRef = viewRef;\n            preview.style.transform =\n                getTransform(this._pickupPositionOnPage.x, this._pickupPositionOnPage.y);\n        }\n        else {\n            /** @type {?} */\n            const element = this._rootElement;\n            /** @type {?} */\n            const elementRect = element.getBoundingClientRect();\n            preview = deepCloneNode(element);\n            preview.style.width = `${elementRect.width}px`;\n            preview.style.height = `${elementRect.height}px`;\n            preview.style.transform = getTransform(elementRect.left, elementRect.top);\n        }\n        extendStyles(preview.style, {\n            // It's important that we disable the pointer events on the preview, because\n            // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`.\n            pointerEvents: 'none',\n            // We have to reset the margin, because can throw off positioning relative to the viewport.\n            margin: '0',\n            position: 'fixed',\n            top: '0',\n            left: '0',\n            zIndex: '1000'\n        });\n        toggleNativeDragInteractions(preview, false);\n        preview.classList.add('cdk-drag-preview');\n        preview.setAttribute('dir', this._direction);\n        return preview;\n    }\n    /**\n     * Animates the preview element from its current position to the location of the drop placeholder.\n     * @private\n     * @return {?} Promise that resolves when the animation completes.\n     */\n    _animatePreviewToPlaceholder() {\n        // If the user hasn't moved yet, the transitionend event won't fire.\n        if (!this._hasMoved) {\n            return Promise.resolve();\n        }\n        /** @type {?} */\n        const placeholderRect = this._placeholder.getBoundingClientRect();\n        // Apply the class that adds a transition to the preview.\n        this._preview.classList.add('cdk-drag-animating');\n        // Move the preview to the placeholder position.\n        this._preview.style.transform = getTransform(placeholderRect.left, placeholderRect.top);\n        // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since\n        // we need to trigger a style recalculation in order for the `cdk-drag-animating` class to\n        // apply its style, we take advantage of the available info to figure out whether we need to\n        // bind the event in the first place.\n        /** @type {?} */\n        const duration = getTransformTransitionDurationInMs(this._preview);\n        if (duration === 0) {\n            return Promise.resolve();\n        }\n        return this._ngZone.runOutsideAngular((/**\n         * @return {?}\n         */\n        () => {\n            return new Promise((/**\n             * @param {?} resolve\n             * @return {?}\n             */\n            resolve => {\n                /** @type {?} */\n                const handler = (/** @type {?} */ (((/**\n                 * @param {?} event\n                 * @return {?}\n                 */\n                (event) => {\n                    if (!event || (event.target === this._preview && event.propertyName === 'transform')) {\n                        this._preview.removeEventListener('transitionend', handler);\n                        resolve();\n                        clearTimeout(timeout);\n                    }\n                }))));\n                // If a transition is short enough, the browser might not fire the `transitionend` event.\n                // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll\n                // fire if the transition hasn't completed when it was supposed to.\n                /** @type {?} */\n                const timeout = setTimeout((/** @type {?} */ (handler)), duration * 1.5);\n                this._preview.addEventListener('transitionend', handler);\n            }));\n        }));\n    }\n    /**\n     * Creates an element that will be shown instead of the current element while dragging.\n     * @private\n     * @return {?}\n     */\n    _createPlaceholderElement() {\n        /** @type {?} */\n        const placeholderConfig = this._placeholderTemplate;\n        /** @type {?} */\n        const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null;\n        /** @type {?} */\n        let placeholder;\n        if (placeholderTemplate) {\n            this._placeholderRef = (/** @type {?} */ (placeholderConfig)).viewContainer.createEmbeddedView(placeholderTemplate, (/** @type {?} */ (placeholderConfig)).context);\n            placeholder = getRootNode(this._placeholderRef, this._document);\n        }\n        else {\n            placeholder = deepCloneNode(this._rootElement);\n        }\n        placeholder.classList.add('cdk-drag-placeholder');\n        return placeholder;\n    }\n    /**\n     * Figures out the coordinates at which an element was picked up.\n     * @private\n     * @param {?} referenceElement Element that initiated the dragging.\n     * @param {?} event Event that initiated the dragging.\n     * @return {?}\n     */\n    _getPointerPositionInElement(referenceElement, event) {\n        /** @type {?} */\n        const elementRect = this._rootElement.getBoundingClientRect();\n        /** @type {?} */\n        const handleElement = referenceElement === this._rootElement ? null : referenceElement;\n        /** @type {?} */\n        const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect;\n        /** @type {?} */\n        const point = isTouchEvent(event) ? event.targetTouches[0] : event;\n        /** @type {?} */\n        const x = point.pageX - referenceRect.left - this._scrollPosition.left;\n        /** @type {?} */\n        const y = point.pageY - referenceRect.top - this._scrollPosition.top;\n        return {\n            x: referenceRect.left - elementRect.left + x,\n            y: referenceRect.top - elementRect.top + y\n        };\n    }\n    /**\n     * Determines the point of the page that was touched by the user.\n     * @private\n     * @param {?} event\n     * @return {?}\n     */\n    _getPointerPositionOnPage(event) {\n        // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\n        /** @type {?} */\n        const point = isTouchEvent(event) ? (event.touches[0] || event.changedTouches[0]) : event;\n        return {\n            x: point.pageX - this._scrollPosition.left,\n            y: point.pageY - this._scrollPosition.top\n        };\n    }\n    /**\n     * Gets the pointer position on the page, accounting for any position constraints.\n     * @private\n     * @param {?} event\n     * @return {?}\n     */\n    _getConstrainedPointerPosition(event) {\n        /** @type {?} */\n        const point = this._getPointerPositionOnPage(event);\n        /** @type {?} */\n        const constrainedPoint = this.constrainPosition ? this.constrainPosition(point, this) : point;\n        /** @type {?} */\n        const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;\n        if (this.lockAxis === 'x' || dropContainerLock === 'x') {\n            constrainedPoint.y = this._pickupPositionOnPage.y;\n        }\n        else if (this.lockAxis === 'y' || dropContainerLock === 'y') {\n            constrainedPoint.x = this._pickupPositionOnPage.x;\n        }\n        if (this._boundaryRect) {\n            const { x: pickupX, y: pickupY } = this._pickupPositionInElement;\n            /** @type {?} */\n            const boundaryRect = this._boundaryRect;\n            /** @type {?} */\n            const previewRect = (/** @type {?} */ (this._previewRect));\n            /** @type {?} */\n            const minY = boundaryRect.top + pickupY;\n            /** @type {?} */\n            const maxY = boundaryRect.bottom - (previewRect.height - pickupY);\n            /** @type {?} */\n            const minX = boundaryRect.left + pickupX;\n            /** @type {?} */\n            const maxX = boundaryRect.right - (previewRect.width - pickupX);\n            constrainedPoint.x = clamp(constrainedPoint.x, minX, maxX);\n            constrainedPoint.y = clamp(constrainedPoint.y, minY, maxY);\n        }\n        return constrainedPoint;\n    }\n    /**\n     * Updates the current drag delta, based on the user's current pointer position on the page.\n     * @private\n     * @param {?} pointerPositionOnPage\n     * @return {?}\n     */\n    _updatePointerDirectionDelta(pointerPositionOnPage) {\n        const { x, y } = pointerPositionOnPage;\n        /** @type {?} */\n        const delta = this._pointerDirectionDelta;\n        /** @type {?} */\n        const positionSinceLastChange = this._pointerPositionAtLastDirectionChange;\n        // Amount of pixels the user has dragged since the last time the direction changed.\n        /** @type {?} */\n        const changeX = Math.abs(x - positionSinceLastChange.x);\n        /** @type {?} */\n        const changeY = Math.abs(y - positionSinceLastChange.y);\n        // Because we handle pointer events on a per-pixel basis, we don't want the delta\n        // to change for every pixel, otherwise anything that depends on it can look erratic.\n        // To make the delta more consistent, we track how much the user has moved since the last\n        // delta change and we only update it after it has reached a certain threshold.\n        if (changeX > this._config.pointerDirectionChangeThreshold) {\n            delta.x = x > positionSinceLastChange.x ? 1 : -1;\n            positionSinceLastChange.x = x;\n        }\n        if (changeY > this._config.pointerDirectionChangeThreshold) {\n            delta.y = y > positionSinceLastChange.y ? 1 : -1;\n            positionSinceLastChange.y = y;\n        }\n        return delta;\n    }\n    /**\n     * Toggles the native drag interactions, based on how many handles are registered.\n     * @private\n     * @return {?}\n     */\n    _toggleNativeDragInteractions() {\n        if (!this._rootElement || !this._handles) {\n            return;\n        }\n        /** @type {?} */\n        const shouldEnable = this._handles.length > 0 || !this.isDragging();\n        if (shouldEnable !== this._nativeInteractionsEnabled) {\n            this._nativeInteractionsEnabled = shouldEnable;\n            toggleNativeDragInteractions(this._rootElement, shouldEnable);\n        }\n    }\n    /**\n     * Removes the manually-added event listeners from the root element.\n     * @private\n     * @param {?} element\n     * @return {?}\n     */\n    _removeRootElementListeners(element) {\n        element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n        element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n    }\n    /**\n     * Applies a `transform` to the root element, taking into account any existing transforms on it.\n     * @private\n     * @param {?} x New transform value along the X axis.\n     * @param {?} y New transform value along the Y axis.\n     * @return {?}\n     */\n    _applyRootElementTransform(x, y) {\n        /** @type {?} */\n        const transform = getTransform(x, y);\n        // Cache the previous transform amount only after the first drag sequence, because\n        // we don't want our own transforms to stack on top of each other.\n        if (this._initialTransform == null) {\n            this._initialTransform = this._rootElement.style.transform || '';\n        }\n        // Preserve the previous `transform` value, if there was one. Note that we apply our own\n        // transform before the user's, because things like rotation can affect which direction\n        // the element will be translated towards.\n        this._rootElement.style.transform = this._initialTransform ?\n            transform + ' ' + this._initialTransform : transform;\n    }\n    /**\n     * Gets the distance that the user has dragged during the current drag sequence.\n     * @private\n     * @param {?} currentPosition Current position of the user's pointer.\n     * @return {?}\n     */\n    _getDragDistance(currentPosition) {\n        /** @type {?} */\n        const pickupPosition = this._pickupPositionOnPage;\n        if (pickupPosition) {\n            return { x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y };\n        }\n        return { x: 0, y: 0 };\n    }\n    /**\n     * Cleans up any cached element dimensions that we don't need after dragging has stopped.\n     * @private\n     * @return {?}\n     */\n    _cleanupCachedDimensions() {\n        this._boundaryRect = this._previewRect = undefined;\n    }\n    /**\n     * Checks whether the element is still inside its boundary after the viewport has been resized.\n     * If not, the position is adjusted so that the element fits again.\n     * @private\n     * @return {?}\n     */\n    _containInsideBoundaryOnResize() {\n        let { x, y } = this._passiveTransform;\n        if ((x === 0 && y === 0) || this.isDragging() || !this._boundaryElement) {\n            return;\n        }\n        /** @type {?} */\n        const boundaryRect = this._boundaryElement.getBoundingClientRect();\n        /** @type {?} */\n        const elementRect = this._rootElement.getBoundingClientRect();\n        /** @type {?} */\n        const leftOverflow = boundaryRect.left - elementRect.left;\n        /** @type {?} */\n        const rightOverflow = elementRect.right - boundaryRect.right;\n        /** @type {?} */\n        const topOverflow = boundaryRect.top - elementRect.top;\n        /** @type {?} */\n        const bottomOverflow = elementRect.bottom - boundaryRect.bottom;\n        // If the element has become wider than the boundary, we can't\n        // do much to make it fit so we just anchor it to the left.\n        if (boundaryRect.width > elementRect.width) {\n            if (leftOverflow > 0) {\n                x += leftOverflow;\n            }\n            if (rightOverflow > 0) {\n                x -= rightOverflow;\n            }\n        }\n        else {\n            x = 0;\n        }\n        // If the element has become taller than the boundary, we can't\n        // do much to make it fit so we just anchor it to the top.\n        if (boundaryRect.height > elementRect.height) {\n            if (topOverflow > 0) {\n                y += topOverflow;\n            }\n            if (bottomOverflow > 0) {\n                y -= bottomOverflow;\n            }\n        }\n        else {\n            y = 0;\n        }\n        if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) {\n            this.setFreeDragPosition({ y, x });\n        }\n    }\n}\n/**\n * Gets a 3d `transform` that can be applied to an element.\n * @param {?} x Desired position of the element along the X axis.\n * @param {?} y Desired position of the element along the Y axis.\n * @return {?}\n */\nfunction getTransform(x, y) {\n    // Round the transforms since some browsers will\n    // blur the elements for sub-pixel transforms.\n    return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}\n/**\n * Creates a deep clone of an element.\n * @param {?} node\n * @return {?}\n */\nfunction deepCloneNode(node) {\n    /** @type {?} */\n    const clone = (/** @type {?} */ (node.cloneNode(true)));\n    /** @type {?} */\n    const descendantsWithId = clone.querySelectorAll('[id]');\n    /** @type {?} */\n    const descendantCanvases = node.querySelectorAll('canvas');\n    // Remove the `id` to avoid having multiple elements with the same id on the page.\n    clone.removeAttribute('id');\n    for (let i = 0; i < descendantsWithId.length; i++) {\n        descendantsWithId[i].removeAttribute('id');\n    }\n    // `cloneNode` won't transfer the content of `canvas` elements so we have to do it ourselves.\n    // We match up the cloned canvas to their sources using their index in the DOM.\n    if (descendantCanvases.length) {\n        /** @type {?} */\n        const cloneCanvases = clone.querySelectorAll('canvas');\n        for (let i = 0; i < descendantCanvases.length; i++) {\n            /** @type {?} */\n            const correspondingCloneContext = cloneCanvases[i].getContext('2d');\n            if (correspondingCloneContext) {\n                correspondingCloneContext.drawImage(descendantCanvases[i], 0, 0);\n            }\n        }\n    }\n    return clone;\n}\n/**\n * Clamps a value between a minimum and a maximum.\n * @param {?} value\n * @param {?} min\n * @param {?} max\n * @return {?}\n */\nfunction clamp(value, min, max) {\n    return Math.max(min, Math.min(max, value));\n}\n/**\n * Helper to remove an element from the DOM and to do all the necessary null checks.\n * @param {?} element Element to be removed.\n * @return {?}\n */\nfunction removeElement(element) {\n    if (element && element.parentNode) {\n        element.parentNode.removeChild(element);\n    }\n}\n/**\n * Determines whether an event is a touch event.\n * @param {?} event\n * @return {?}\n */\nfunction isTouchEvent(event) {\n    // This function is called for every pixel that the user has dragged so we need it to be\n    // as fast as possible. Since we only bind mouse events and touch events, we can assume\n    // that if the event's name starts with `t`, it's a touch event.\n    return event.type[0] === 't';\n}\n/**\n * Gets the element into which the drag preview should be inserted.\n * @param {?} documentRef\n * @return {?}\n */\nfunction getPreviewInsertionPoint(documentRef) {\n    // We can't use the body if the user is in fullscreen mode,\n    // because the preview will render under the fullscreen element.\n    // TODO(crisbeto): dedupe this with the `FullscreenOverlayContainer` eventually.\n    return documentRef.fullscreenElement ||\n        documentRef.webkitFullscreenElement ||\n        documentRef.mozFullScreenElement ||\n        documentRef.msFullscreenElement ||\n        documentRef.body;\n}\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n * @param {?} viewRef\n * @param {?} _document\n * @return {?}\n */\nfunction getRootNode(viewRef, _document) {\n    /** @type {?} */\n    const rootNode = viewRef.rootNodes[0];\n    if (rootNode.nodeType !== _document.ELEMENT_NODE) {\n        /** @type {?} */\n        const wrapper = _document.createElement('div');\n        wrapper.appendChild(rootNode);\n        return wrapper;\n    }\n    return (/** @type {?} */ (rootNode));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\n/**\n * Moves an item one index in an array to another.\n * @template T\n * @param {?} array Array in which to move the item.\n * @param {?} fromIndex Starting index of the item.\n * @param {?} toIndex Index to which the item should be moved.\n * @return {?}\n */\nfunction moveItemInArray(array, fromIndex, toIndex) {\n    /** @type {?} */\n    const from = clamp$1(fromIndex, array.length - 1);\n    /** @type {?} */\n    const to = clamp$1(toIndex, array.length - 1);\n    if (from === to) {\n        return;\n    }\n    /** @type {?} */\n    const target = array[from];\n    /** @type {?} */\n    const delta = to < from ? -1 : 1;\n    for (let i = from; i !== to; i += delta) {\n        array[i] = array[i + delta];\n    }\n    array[to] = target;\n}\n/**\n * Moves an item from one array to another.\n * @template T\n * @param {?} currentArray Array from which to transfer the item.\n * @param {?} targetArray Array into which to put the item.\n * @param {?} currentIndex Index of the item in its current array.\n * @param {?} targetIndex Index at which to insert the item.\n * @return {?}\n */\nfunction transferArrayItem(currentArray, targetArray, currentIndex, targetIndex) {\n    /** @type {?} */\n    const from = clamp$1(currentIndex, currentArray.length - 1);\n    /** @type {?} */\n    const to = clamp$1(targetIndex, targetArray.length);\n    if (currentArray.length) {\n        targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n    }\n}\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @template T\n * @param {?} currentArray Array from which to copy the item.\n * @param {?} targetArray Array into which is copy the item.\n * @param {?} currentIndex Index of the item in its current array.\n * @param {?} targetIndex Index at which to insert the item.\n *\n * @return {?}\n */\nfunction copyArrayItem(currentArray, targetArray, currentIndex, targetIndex) {\n    /** @type {?} */\n    const to = clamp$1(targetIndex, targetArray.length);\n    if (currentArray.length) {\n        targetArray.splice(to, 0, currentArray[currentIndex]);\n    }\n}\n/**\n * Clamps a number between zero and a maximum.\n * @param {?} value\n * @param {?} max\n * @return {?}\n */\nfunction clamp$1(value, max) {\n    return Math.max(0, Math.min(max, value));\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Counter used to generate unique ids for drop refs.\n * @type {?}\n */\nlet _uniqueIdCounter = 0;\n/**\n * Proximity, as a ratio to width/height, at which a\n * dragged item will affect the drop container.\n * @type {?}\n */\nconst DROP_PROXIMITY_THRESHOLD = 0.05;\n/**\n * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the\n * viewport. The value comes from trying it out manually until it feels right.\n * @type {?}\n */\nconst SCROLL_PROXIMITY_THRESHOLD = 0.05;\n/**\n * Number of pixels to scroll for each frame when auto-scrolling an element.\n * The value comes from trying it out manually until it feels right.\n * @type {?}\n */\nconst AUTO_SCROLL_STEP = 2;\n/**\n * Reference to a drop list. Used to manipulate or dispose of the container.\n * \\@docs-private\n * @template T\n */\nclass DropListRef {\n    /**\n     * @param {?} element\n     * @param {?} _dragDropRegistry\n     * @param {?} _document\n     * @param {?=} _ngZone\n     * @param {?=} _viewportRuler\n     */\n    constructor(element, _dragDropRegistry, _document, _ngZone, _viewportRuler) {\n        this._dragDropRegistry = _dragDropRegistry;\n        this._ngZone = _ngZone;\n        this._viewportRuler = _viewportRuler;\n        /**\n         * Unique ID for the drop list.\n         * @deprecated No longer being used. To be removed.\n         * \\@breaking-change 8.0.0\n         */\n        this.id = `cdk-drop-list-ref-${_uniqueIdCounter++}`;\n        /**\n         * Whether starting a dragging sequence from this container is disabled.\n         */\n        this.disabled = false;\n        /**\n         * Whether sorting items within the list is disabled.\n         */\n        this.sortingDisabled = false;\n        /**\n         * Whether auto-scrolling the view when the user\n         * moves their pointer close to the edges is disabled.\n         */\n        this.autoScrollDisabled = false;\n        /**\n         * Function that is used to determine whether an item\n         * is allowed to be moved into a drop container.\n         */\n        this.enterPredicate = (/**\n         * @return {?}\n         */\n        () => true);\n        /**\n         * Emits right before dragging has started.\n         */\n        this.beforeStarted = new Subject();\n        /**\n         * Emits when the user has moved a new drag item into this container.\n         */\n        this.entered = new Subject();\n        /**\n         * Emits when the user removes an item from the container\n         * by dragging it into another container.\n         */\n        this.exited = new Subject();\n        /**\n         * Emits when the user drops an item inside the container.\n         */\n        this.dropped = new Subject();\n        /**\n         * Emits as the user is swapping items while actively dragging.\n         */\n        this.sorted = new Subject();\n        /**\n         * Whether an item in the list is being dragged.\n         */\n        this._isDragging = false;\n        /**\n         * Cache of the dimensions of all the items inside the container.\n         */\n        this._itemPositions = [];\n        /**\n         * Keeps track of the container's scroll position.\n         */\n        this._scrollPosition = { top: 0, left: 0 };\n        /**\n         * Keeps track of the scroll position of the viewport.\n         */\n        this._viewportScrollPosition = { top: 0, left: 0 };\n        /**\n         * Keeps track of the item that was last swapped with the dragged item, as\n         * well as what direction the pointer was moving in when the swap occured.\n         */\n        this._previousSwap = { drag: (/** @type {?} */ (null)), delta: 0 };\n        /**\n         * Drop lists that are connected to the current one.\n         */\n        this._siblings = [];\n        /**\n         * Direction in which the list is oriented.\n         */\n        this._orientation = 'vertical';\n        /**\n         * Connected siblings that currently have a dragged item.\n         */\n        this._activeSiblings = new Set();\n        /**\n         * Layout direction of the drop list.\n         */\n        this._direction = 'ltr';\n        /**\n         * Subscription to the window being scrolled.\n         */\n        this._viewportScrollSubscription = Subscription.EMPTY;\n        /**\n         * Vertical direction in which the list is currently scrolling.\n         */\n        this._verticalScrollDirection = 0 /* NONE */;\n        /**\n         * Horizontal direction in which the list is currently scrolling.\n         */\n        this._horizontalScrollDirection = 0 /* NONE */;\n        /**\n         * Used to signal to the current auto-scroll sequence when to stop.\n         */\n        this._stopScrollTimers = new Subject();\n        /**\n         * Handles the container being scrolled. Has to be an arrow function to preserve the context.\n         */\n        this._handleScroll = (/**\n         * @return {?}\n         */\n        () => {\n            if (!this.isDragging()) {\n                return;\n            }\n            /** @type {?} */\n            const element = coerceElement(this.element);\n            this._updateAfterScroll(this._scrollPosition, element.scrollTop, element.scrollLeft);\n        });\n        /**\n         * Starts the interval that'll auto-scroll the element.\n         */\n        this._startScrollInterval = (/**\n         * @return {?}\n         */\n        () => {\n            this._stopScrolling();\n            interval(0, animationFrameScheduler)\n                .pipe(takeUntil(this._stopScrollTimers))\n                .subscribe((/**\n             * @return {?}\n             */\n            () => {\n                /** @type {?} */\n                const node = this._scrollNode;\n                if (this._verticalScrollDirection === 1 /* UP */) {\n                    incrementVerticalScroll(node, -AUTO_SCROLL_STEP);\n                }\n                else if (this._verticalScrollDirection === 2 /* DOWN */) {\n                    incrementVerticalScroll(node, AUTO_SCROLL_STEP);\n                }\n                if (this._horizontalScrollDirection === 1 /* LEFT */) {\n                    incrementHorizontalScroll(node, -AUTO_SCROLL_STEP);\n                }\n                else if (this._horizontalScrollDirection === 2 /* RIGHT */) {\n                    incrementHorizontalScroll(node, AUTO_SCROLL_STEP);\n                }\n            }));\n        });\n        /** @type {?} */\n        const nativeNode = this.element = coerceElement(element);\n        this._shadowRoot = getShadowRoot(nativeNode) || _document;\n        _dragDropRegistry.registerDropContainer(this);\n    }\n    /**\n     * Removes the drop list functionality from the DOM element.\n     * @return {?}\n     */\n    dispose() {\n        this._stopScrolling();\n        this._stopScrollTimers.complete();\n        this._removeListeners();\n        this.beforeStarted.complete();\n        this.entered.complete();\n        this.exited.complete();\n        this.dropped.complete();\n        this.sorted.complete();\n        this._activeSiblings.clear();\n        this._scrollNode = (/** @type {?} */ (null));\n        this._dragDropRegistry.removeDropContainer(this);\n    }\n    /**\n     * Whether an item from this list is currently being dragged.\n     * @return {?}\n     */\n    isDragging() {\n        return this._isDragging;\n    }\n    /**\n     * Starts dragging an item.\n     * @return {?}\n     */\n    start() {\n        /** @type {?} */\n        const element = coerceElement(this.element);\n        this.beforeStarted.next();\n        this._isDragging = true;\n        this._cacheItems();\n        this._siblings.forEach((/**\n         * @param {?} sibling\n         * @return {?}\n         */\n        sibling => sibling._startReceiving(this)));\n        this._removeListeners();\n        // @breaking-change 9.0.0 Remove check for _ngZone once it's marked as a required param.\n        if (this._ngZone) {\n            this._ngZone.runOutsideAngular((/**\n             * @return {?}\n             */\n            () => element.addEventListener('scroll', this._handleScroll)));\n        }\n        else {\n            element.addEventListener('scroll', this._handleScroll);\n        }\n        // @breaking-change 9.0.0 Remove check for _viewportRuler once it's marked as a required param.\n        if (this._viewportRuler) {\n            this._listenToScrollEvents();\n        }\n    }\n    /**\n     * Emits an event to indicate that the user moved an item into the container.\n     * @param {?} item Item that was moved into the container.\n     * @param {?} pointerX Position of the item along the X axis.\n     * @param {?} pointerY Position of the item along the Y axis.\n     * @return {?}\n     */\n    enter(item, pointerX, pointerY) {\n        this.start();\n        // If sorting is disabled, we want the item to return to its starting\n        // position if the user is returning it to its initial container.\n        /** @type {?} */\n        let newIndex = this.sortingDisabled ? this._draggables.indexOf(item) : -1;\n        if (newIndex === -1) {\n            // We use the coordinates of where the item entered the drop\n            // zone to figure out at which index it should be inserted.\n            newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY);\n        }\n        /** @type {?} */\n        const activeDraggables = this._activeDraggables;\n        /** @type {?} */\n        const currentIndex = activeDraggables.indexOf(item);\n        /** @type {?} */\n        const placeholder = item.getPlaceholderElement();\n        /** @type {?} */\n        let newPositionReference = activeDraggables[newIndex];\n        // If the item at the new position is the same as the item that is being dragged,\n        // it means that we're trying to restore the item to its initial position. In this\n        // case we should use the next item from the list as the reference.\n        if (newPositionReference === item) {\n            newPositionReference = activeDraggables[newIndex + 1];\n        }\n        // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it\n        // into another container and back again), we have to ensure that it isn't duplicated.\n        if (currentIndex > -1) {\n            activeDraggables.splice(currentIndex, 1);\n        }\n        // Don't use items that are being dragged as a reference, because\n        // their element has been moved down to the bottom of the body.\n        if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) {\n            /** @type {?} */\n            const element = newPositionReference.getRootElement();\n            (/** @type {?} */ (element.parentElement)).insertBefore(placeholder, element);\n            activeDraggables.splice(newIndex, 0, item);\n        }\n        else {\n            coerceElement(this.element).appendChild(placeholder);\n            activeDraggables.push(item);\n        }\n        // The transform needs to be cleared so it doesn't throw off the measurements.\n        placeholder.style.transform = '';\n        // Note that the positions were already cached when we called `start` above,\n        // but we need to refresh them since the amount of items has changed.\n        this._cacheItemPositions();\n        this.entered.next({ item, container: this, currentIndex: this.getItemIndex(item) });\n    }\n    /**\n     * Removes an item from the container after it was dragged into another container by the user.\n     * @param {?} item Item that was dragged out.\n     * @return {?}\n     */\n    exit(item) {\n        this._reset();\n        this.exited.next({ item, container: this });\n    }\n    /**\n     * Drops an item into this container.\n     * \\@breaking-change 9.0.0 `distance` parameter to become required.\n     * @param {?} item Item being dropped into the container.\n     * @param {?} currentIndex Index at which the item should be inserted.\n     * @param {?} previousContainer Container from which the item got dragged in.\n     * @param {?} isPointerOverContainer Whether the user's pointer was over the\n     *    container when the item was dropped.\n     * @param {?=} distance Distance the user has dragged since the start of the dragging sequence.\n     * @return {?}\n     */\n    drop(item, currentIndex, previousContainer, isPointerOverContainer, distance = { x: 0, y: 0 }) {\n        this._reset();\n        this.dropped.next({\n            item,\n            currentIndex,\n            previousIndex: previousContainer.getItemIndex(item),\n            container: this,\n            previousContainer,\n            isPointerOverContainer,\n            distance\n        });\n    }\n    /**\n     * Sets the draggable items that are a part of this list.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} items Items that are a part of this list.\n     * @return {THIS}\n     */\n    withItems(items) {\n        (/** @type {?} */ (this))._draggables = items;\n        items.forEach((/**\n         * @param {?} item\n         * @return {?}\n         */\n        item => item._withDropContainer((/** @type {?} */ (this)))));\n        if ((/** @type {?} */ (this)).isDragging()) {\n            (/** @type {?} */ (this))._cacheItems();\n        }\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Sets the layout direction of the drop list.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} direction\n     * @return {THIS}\n     */\n    withDirection(direction) {\n        (/** @type {?} */ (this))._direction = direction;\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Sets the containers that are connected to this one. When two or more containers are\n     * connected, the user will be allowed to transfer items between them.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} connectedTo Other containers that the current containers should be connected to.\n     * @return {THIS}\n     */\n    connectedTo(connectedTo) {\n        (/** @type {?} */ (this))._siblings = connectedTo.slice();\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Sets the orientation of the container.\n     * @template THIS\n     * @this {THIS}\n     * @param {?} orientation New orientation for the container.\n     * @return {THIS}\n     */\n    withOrientation(orientation) {\n        (/** @type {?} */ (this))._orientation = orientation;\n        return (/** @type {?} */ (this));\n    }\n    /**\n     * Figures out the index of an item in the container.\n     * @param {?} item Item whose index should be determined.\n     * @return {?}\n     */\n    getItemIndex(item) {\n        if (!this._isDragging) {\n            return this._draggables.indexOf(item);\n        }\n        // Items are sorted always by top/left in the cache, however they flow differently in RTL.\n        // The rest of the logic still stands no matter what orientation we're in, however\n        // we need to invert the array when determining the index.\n        /** @type {?} */\n        const items = this._orientation === 'horizontal' && this._direction === 'rtl' ?\n            this._itemPositions.slice().reverse() : this._itemPositions;\n        return findIndex(items, (/**\n         * @param {?} currentItem\n         * @return {?}\n         */\n        currentItem => currentItem.drag === item));\n    }\n    /**\n     * Whether the list is able to receive the item that\n     * is currently being dragged inside a connected drop list.\n     * @return {?}\n     */\n    isReceiving() {\n        return this._activeSiblings.size > 0;\n    }\n    /**\n     * Sorts an item inside the container based on its position.\n     * @param {?} item Item to be sorted.\n     * @param {?} pointerX Position of the item along the X axis.\n     * @param {?} pointerY Position of the item along the Y axis.\n     * @param {?} pointerDelta Direction in which the pointer is moving along each axis.\n     * @return {?}\n     */\n    _sortItem(item, pointerX, pointerY, pointerDelta) {\n        // Don't sort the item if sorting is disabled or it's out of range.\n        if (this.sortingDisabled || !this._isPointerNearDropContainer(pointerX, pointerY)) {\n            return;\n        }\n        /** @type {?} */\n        const siblings = this._itemPositions;\n        /** @type {?} */\n        const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta);\n        if (newIndex === -1 && siblings.length > 0) {\n            return;\n        }\n        /** @type {?} */\n        const isHorizontal = this._orientation === 'horizontal';\n        /** @type {?} */\n        const currentIndex = findIndex(siblings, (/**\n         * @param {?} currentItem\n         * @return {?}\n         */\n        currentItem => currentItem.drag === item));\n        /** @type {?} */\n        const siblingAtNewPosition = siblings[newIndex];\n        /** @type {?} */\n        const currentPosition = siblings[currentIndex].clientRect;\n        /** @type {?} */\n        const newPosition = siblingAtNewPosition.clientRect;\n        /** @type {?} */\n        const delta = currentIndex > newIndex ? 1 : -1;\n        this._previousSwap.drag = siblingAtNewPosition.drag;\n        this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y;\n        // How many pixels the item's placeholder should be offset.\n        /** @type {?} */\n        const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta);\n        // How many pixels all the other items should be offset.\n        /** @type {?} */\n        const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta);\n        // Save the previous order of the items before moving the item to its new index.\n        // We use this to check whether an item has been moved as a result of the sorting.\n        /** @type {?} */\n        const oldOrder = siblings.slice();\n        // Shuffle the array in place.\n        moveItemInArray(siblings, currentIndex, newIndex);\n        this.sorted.next({\n            previousIndex: currentIndex,\n            currentIndex: newIndex,\n            container: this,\n            item\n        });\n        siblings.forEach((/**\n         * @param {?} sibling\n         * @param {?} index\n         * @return {?}\n         */\n        (sibling, index) => {\n            // Don't do anything if the position hasn't changed.\n            if (oldOrder[index] === sibling) {\n                return;\n            }\n            /** @type {?} */\n            const isDraggedItem = sibling.drag === item;\n            /** @type {?} */\n            const offset = isDraggedItem ? itemOffset : siblingOffset;\n            /** @type {?} */\n            const elementToOffset = isDraggedItem ? item.getPlaceholderElement() :\n                sibling.drag.getRootElement();\n            // Update the offset to reflect the new position.\n            sibling.offset += offset;\n            // Since we're moving the items with a `transform`, we need to adjust their cached\n            // client rects to reflect their new position, as well as swap their positions in the cache.\n            // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the\n            // elements may be mid-animation which will give us a wrong result.\n            if (isHorizontal) {\n                // Round the transforms since some browsers will\n                // blur the elements, for sub-pixel transforms.\n                elementToOffset.style.transform = `translate3d(${Math.round(sibling.offset)}px, 0, 0)`;\n                adjustClientRect(sibling.clientRect, 0, offset);\n            }\n            else {\n                elementToOffset.style.transform = `translate3d(0, ${Math.round(sibling.offset)}px, 0)`;\n                adjustClientRect(sibling.clientRect, offset, 0);\n            }\n        }));\n    }\n    /**\n     * Checks whether the user's pointer is close to the edges of either the\n     * viewport or the drop list and starts the auto-scroll sequence.\n     * @param {?} pointerX User's pointer position along the x axis.\n     * @param {?} pointerY User's pointer position along the y axis.\n     * @return {?}\n     */\n    _startScrollingIfNecessary(pointerX, pointerY) {\n        if (this.autoScrollDisabled) {\n            return;\n        }\n        /** @type {?} */\n        let scrollNode;\n        /** @type {?} */\n        let verticalScrollDirection = 0 /* NONE */;\n        /** @type {?} */\n        let horizontalScrollDirection = 0 /* NONE */;\n        // Check whether we should start scrolling the container.\n        if (this._isPointerNearDropContainer(pointerX, pointerY)) {\n            /** @type {?} */\n            const element = coerceElement(this.element);\n            [verticalScrollDirection, horizontalScrollDirection] =\n                getElementScrollDirections(element, this._clientRect, pointerX, pointerY);\n            if (verticalScrollDirection || horizontalScrollDirection) {\n                scrollNode = element;\n            }\n        }\n        // @breaking-change 9.0.0 Remove null check for _viewportRuler once it's a required parameter.\n        // Otherwise check if we can start scrolling the viewport.\n        if (this._viewportRuler && !verticalScrollDirection && !horizontalScrollDirection) {\n            const { width, height } = this._viewportRuler.getViewportSize();\n            /** @type {?} */\n            const clientRect = { width, height, top: 0, right: width, bottom: height, left: 0 };\n            verticalScrollDirection = getVerticalScrollDirection(clientRect, pointerY);\n            horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);\n            scrollNode = window;\n        }\n        if (scrollNode && (verticalScrollDirection !== this._verticalScrollDirection ||\n            horizontalScrollDirection !== this._horizontalScrollDirection ||\n            scrollNode !== this._scrollNode)) {\n            this._verticalScrollDirection = verticalScrollDirection;\n            this._horizontalScrollDirection = horizontalScrollDirection;\n            this._scrollNode = scrollNode;\n            if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {\n                // @breaking-change 9.0.0 Remove null check for `_ngZone` once it is made required.\n                if (this._ngZone) {\n                    this._ngZone.runOutsideAngular(this._startScrollInterval);\n                }\n                else {\n                    this._startScrollInterval();\n                }\n            }\n            else {\n                this._stopScrolling();\n            }\n        }\n    }\n    /**\n     * Stops any currently-running auto-scroll sequences.\n     * @return {?}\n     */\n    _stopScrolling() {\n        this._stopScrollTimers.next();\n    }\n    /**\n     * Caches the position of the drop list.\n     * @private\n     * @return {?}\n     */\n    _cacheOwnPosition() {\n        /** @type {?} */\n        const element = coerceElement(this.element);\n        this._clientRect = getMutableClientRect(element);\n        this._scrollPosition = { top: element.scrollTop, left: element.scrollLeft };\n    }\n    /**\n     * Refreshes the position cache of the items and sibling containers.\n     * @private\n     * @return {?}\n     */\n    _cacheItemPositions() {\n        /** @type {?} */\n        const isHorizontal = this._orientation === 'horizontal';\n        this._itemPositions = this._activeDraggables.map((/**\n         * @param {?} drag\n         * @return {?}\n         */\n        drag => {\n            /** @type {?} */\n            const elementToMeasure = this._dragDropRegistry.isDragging(drag) ?\n                // If the element is being dragged, we have to measure the\n                // placeholder, because the element is hidden.\n                drag.getPlaceholderElement() :\n                drag.getRootElement();\n            return { drag, offset: 0, clientRect: getMutableClientRect(elementToMeasure) };\n        })).sort((/**\n         * @param {?} a\n         * @param {?} b\n         * @return {?}\n         */\n        (a, b) => {\n            return isHorizontal ? a.clientRect.left - b.clientRect.left :\n                a.clientRect.top - b.clientRect.top;\n        }));\n    }\n    /**\n     * Resets the container to its initial state.\n     * @private\n     * @return {?}\n     */\n    _reset() {\n        this._isDragging = false;\n        // TODO(crisbeto): may have to wait for the animations to finish.\n        this._activeDraggables.forEach((/**\n         * @param {?} item\n         * @return {?}\n         */\n        item => item.getRootElement().style.transform = ''));\n        this._siblings.forEach((/**\n         * @param {?} sibling\n         * @return {?}\n         */\n        sibling => sibling._stopReceiving(this)));\n        this._activeDraggables = [];\n        this._itemPositions = [];\n        this._previousSwap.drag = null;\n        this._previousSwap.delta = 0;\n        this._stopScrolling();\n        this._removeListeners();\n    }\n    /**\n     * Gets the offset in pixels by which the items that aren't being dragged should be moved.\n     * @private\n     * @param {?} currentIndex Index of the item currently being dragged.\n     * @param {?} siblings All of the items in the list.\n     * @param {?} delta Direction in which the user is moving.\n     * @return {?}\n     */\n    _getSiblingOffsetPx(currentIndex, siblings, delta) {\n        /** @type {?} */\n        const isHorizontal = this._orientation === 'horizontal';\n        /** @type {?} */\n        const currentPosition = siblings[currentIndex].clientRect;\n        /** @type {?} */\n        const immediateSibling = siblings[currentIndex + delta * -1];\n        /** @type {?} */\n        let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta;\n        if (immediateSibling) {\n            /** @type {?} */\n            const start = isHorizontal ? 'left' : 'top';\n            /** @type {?} */\n            const end = isHorizontal ? 'right' : 'bottom';\n            // Get the spacing between the start of the current item and the end of the one immediately\n            // after it in the direction in which the user is dragging, or vice versa. We add it to the\n            // offset in order to push the element to where it will be when it's inline and is influenced\n            // by the `margin` of its siblings.\n            if (delta === -1) {\n                siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end];\n            }\n            else {\n                siblingOffset += currentPosition[start] - immediateSibling.clientRect[end];\n            }\n        }\n        return siblingOffset;\n    }\n    /**\n     * Checks whether the pointer coordinates are close to the drop container.\n     * @private\n     * @param {?} pointerX Coordinates along the X axis.\n     * @param {?} pointerY Coordinates along the Y axis.\n     * @return {?}\n     */\n    _isPointerNearDropContainer(pointerX, pointerY) {\n        const { top, right, bottom, left, width, height } = this._clientRect;\n        /** @type {?} */\n        const xThreshold = width * DROP_PROXIMITY_THRESHOLD;\n        /** @type {?} */\n        const yThreshold = height * DROP_PROXIMITY_THRESHOLD;\n        return pointerY > top - yThreshold && pointerY < bottom + yThreshold &&\n            pointerX > left - xThreshold && pointerX < right + xThreshold;\n    }\n    /**\n     * Gets the offset in pixels by which the item that is being dragged should be moved.\n     * @private\n     * @param {?} currentPosition Current position of the item.\n     * @param {?} newPosition Position of the item where the current item should be moved.\n     * @param {?} delta Direction in which the user is moving.\n     * @return {?}\n     */\n    _getItemOffsetPx(currentPosition, newPosition, delta) {\n        /** @type {?} */\n        const isHorizontal = this._orientation === 'horizontal';\n        /** @type {?} */\n        let itemOffset = isHorizontal ? newPosition.left - currentPosition.left :\n            newPosition.top - currentPosition.top;\n        // Account for differences in the item width/height.\n        if (delta === -1) {\n            itemOffset += isHorizontal ? newPosition.width - currentPosition.width :\n                newPosition.height - currentPosition.height;\n        }\n        return itemOffset;\n    }\n    /**\n     * Gets the index of an item in the drop container, based on the position of the user's pointer.\n     * @private\n     * @param {?} item Item that is being sorted.\n     * @param {?} pointerX Position of the user's pointer along the X axis.\n     * @param {?} pointerY Position of the user's pointer along the Y axis.\n     * @param {?=} delta Direction in which the user is moving their pointer.\n     * @return {?}\n     */\n    _getItemIndexFromPointerPosition(item, pointerX, pointerY, delta) {\n        /** @type {?} */\n        const isHorizontal = this._orientation === 'horizontal';\n        return findIndex(this._itemPositions, (/**\n         * @param {?} __0\n         * @param {?} _\n         * @param {?} array\n         * @return {?}\n         */\n        ({ drag, clientRect }, _, array) => {\n            if (drag === item) {\n                // If there's only one item left in the container, it must be\n                // the dragged item itself so we use it as a reference.\n                return array.length < 2;\n            }\n            if (delta) {\n                /** @type {?} */\n                const direction = isHorizontal ? delta.x : delta.y;\n                // If the user is still hovering over the same item as last time, and they didn't change\n                // the direction in which they're dragging, we don't consider it a direction swap.\n                if (drag === this._previousSwap.drag && direction === this._previousSwap.delta) {\n                    return false;\n                }\n            }\n            return isHorizontal ?\n                // Round these down since most browsers report client rects with\n                // sub-pixel precision, whereas the pointer coordinates are rounded to pixels.\n                pointerX >= Math.floor(clientRect.left) && pointerX <= Math.floor(clientRect.right) :\n                pointerY >= Math.floor(clientRect.top) && pointerY <= Math.floor(clientRect.bottom);\n        }));\n    }\n    /**\n     * Caches the current items in the list and their positions.\n     * @private\n     * @return {?}\n     */\n    _cacheItems() {\n        this._activeDraggables = this._draggables.slice();\n        this._cacheItemPositions();\n        this._cacheOwnPosition();\n    }\n    /**\n     * Updates the internal state of the container after a scroll event has happened.\n     * @private\n     * @param {?} scrollPosition Object that is keeping track of the scroll position.\n     * @param {?} newTop New top scroll position.\n     * @param {?} newLeft New left scroll position.\n     * @param {?=} extraClientRect Extra `ClientRect` object that should be updated, in addition to the\n     *  ones of the drag items. Useful when the viewport has been scrolled and we also need to update\n     *  the `ClientRect` of the list.\n     * @return {?}\n     */\n    _updateAfterScroll(scrollPosition, newTop, newLeft, extraClientRect) {\n        /** @type {?} */\n        const topDifference = scrollPosition.top - newTop;\n        /** @type {?} */\n        const leftDifference = scrollPosition.left - newLeft;\n        if (extraClientRect) {\n            adjustClientRect(extraClientRect, topDifference, leftDifference);\n        }\n        // Since we know the amount that the user has scrolled we can shift all of the client rectangles\n        // ourselves. This is cheaper than re-measuring everything and we can avoid inconsistent\n        // behavior where we might be measuring the element before its position has changed.\n        this._itemPositions.forEach((/**\n         * @param {?} __0\n         * @return {?}\n         */\n        ({ clientRect }) => {\n            adjustClientRect(clientRect, topDifference, leftDifference);\n        }));\n        // We need two loops for this, because we want all of the cached\n        // positions to be up-to-date before we re-sort the item.\n        this._itemPositions.forEach((/**\n         * @param {?} __0\n         * @return {?}\n         */\n        ({ drag }) => {\n            if (this._dragDropRegistry.isDragging(drag)) {\n                // We need to re-sort the item manually, because the pointer move\n                // events won't be dispatched while the user is scrolling.\n                drag._sortFromLastPointerPosition();\n            }\n        }));\n        scrollPosition.top = newTop;\n        scrollPosition.left = newLeft;\n    }\n    /**\n     * Removes the event listeners associated with this drop list.\n     * @private\n     * @return {?}\n     */\n    _removeListeners() {\n        coerceElement(this.element).removeEventListener('scroll', this._handleScroll);\n        this._viewportScrollSubscription.unsubscribe();\n    }\n    /**\n     * Checks whether the user's pointer is positioned over the container.\n     * @param {?} x Pointer position along the X axis.\n     * @param {?} y Pointer position along the Y axis.\n     * @return {?}\n     */\n    _isOverContainer(x, y) {\n        return isInsideClientRect(this._clientRect, x, y);\n    }\n    /**\n     * Figures out whether an item should be moved into a sibling\n     * drop container, based on its current position.\n     * @param {?} item Drag item that is being moved.\n     * @param {?} x Position of the item along the X axis.\n     * @param {?} y Position of the item along the Y axis.\n     * @return {?}\n     */\n    _getSiblingContainerFromPosition(item, x, y) {\n        return this._siblings.find((/**\n         * @param {?} sibling\n         * @return {?}\n         */\n        sibling => sibling._canReceive(item, x, y)));\n    }\n    /**\n     * Checks whether the drop list can receive the passed-in item.\n     * @param {?} item Item that is being dragged into the list.\n     * @param {?} x Position of the item along the X axis.\n     * @param {?} y Position of the item along the Y axis.\n     * @return {?}\n     */\n    _canReceive(item, x, y) {\n        if (!this.enterPredicate(item, this) || !isInsideClientRect(this._clientRect, x, y)) {\n            return false;\n        }\n        /** @type {?} */\n        const elementFromPoint = (/** @type {?} */ (this._shadowRoot.elementFromPoint(x, y)));\n        // If there's no element at the pointer position, then\n        // the client rect is probably scrolled out of the view.\n        if (!elementFromPoint) {\n            return false;\n        }\n        /** @type {?} */\n        const nativeElement = coerceElement(this.element);\n        // The `ClientRect`, that we're using to find the container over which the user is\n        // hovering, doesn't give us any information on whether the element has been scrolled\n        // out of the view or whether it's overlapping with other containers. This means that\n        // we could end up transferring the item into a container that's invisible or is positioned\n        // below another one. We use the result from `elementFromPoint` to get the top-most element\n        // at the pointer position and to find whether it's one of the intersecting drop containers.\n        return elementFromPoint === nativeElement || nativeElement.contains(elementFromPoint);\n    }\n    /**\n     * Called by one of the connected drop lists when a dragging sequence has started.\n     * @param {?} sibling Sibling in which dragging has started.\n     * @return {?}\n     */\n    _startReceiving(sibling) {\n        /** @type {?} */\n        const activeSiblings = this._activeSiblings;\n        if (!activeSiblings.has(sibling)) {\n            activeSiblings.add(sibling);\n            this._cacheOwnPosition();\n            this._listenToScrollEvents();\n        }\n    }\n    /**\n     * Called by a connected drop list when dragging has stopped.\n     * @param {?} sibling Sibling whose dragging has stopped.\n     * @return {?}\n     */\n    _stopReceiving(sibling) {\n        this._activeSiblings.delete(sibling);\n        this._viewportScrollSubscription.unsubscribe();\n    }\n    /**\n     * Starts listening to scroll events on the viewport.\n     * Used for updating the internal state of the list.\n     * @private\n     * @return {?}\n     */\n    _listenToScrollEvents() {\n        this._viewportScrollPosition = (/** @type {?} */ (this._viewportRuler)).getViewportScrollPosition();\n        this._viewportScrollSubscription = this._dragDropRegistry.scroll.subscribe((/**\n         * @return {?}\n         */\n        () => {\n            if (this.isDragging()) {\n                /** @type {?} */\n                const newPosition = (/** @type {?} */ (this._viewportRuler)).getViewportScrollPosition();\n                this._updateAfterScroll(this._viewportScrollPosition, newPosition.top, newPosition.left, this._clientRect);\n            }\n            else if (this.isReceiving()) {\n                this._cacheOwnPosition();\n            }\n        }));\n    }\n}\n/**\n * Updates the top/left positions of a `ClientRect`, as well as their bottom/right counterparts.\n * @param {?} clientRect `ClientRect` that should be updated.\n * @param {?} top Amount to add to the `top` position.\n * @param {?} left Amount to add to the `left` position.\n * @return {?}\n */\nfunction adjustClientRect(clientRect, top, left) {\n    clientRect.top += top;\n    clientRect.bottom = clientRect.top + clientRect.height;\n    clientRect.left += left;\n    clientRect.right = clientRect.left + clientRect.width;\n}\n/**\n * Finds the index of an item that matches a predicate function. Used as an equivalent\n * of `Array.prototype.findIndex` which isn't part of the standard Google typings.\n * @template T\n * @param {?} array Array in which to look for matches.\n * @param {?} predicate Function used to determine whether an item is a match.\n * @return {?}\n */\nfunction findIndex(array, predicate) {\n    for (let i = 0; i < array.length; i++) {\n        if (predicate(array[i], i, array)) {\n            return i;\n        }\n    }\n    return -1;\n}\n/**\n * Checks whether some coordinates are within a `ClientRect`.\n * @param {?} clientRect ClientRect that is being checked.\n * @param {?} x Coordinates along the X axis.\n * @param {?} y Coordinates along the Y axis.\n * @return {?}\n */\nfunction isInsideClientRect(clientRect, x, y) {\n    const { top, bottom, left, right } = clientRect;\n    return y >= top && y <= bottom && x >= left && x <= right;\n}\n/**\n * Gets a mutable version of an element's bounding `ClientRect`.\n * @param {?} element\n * @return {?}\n */\nfunction getMutableClientRect(element) {\n    /** @type {?} */\n    const clientRect = element.getBoundingClientRect();\n    // We need to clone the `clientRect` here, because all the values on it are readonly\n    // and we need to be able to update them. Also we can't use a spread here, because\n    // the values on a `ClientRect` aren't own properties. See:\n    // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\n    return {\n        top: clientRect.top,\n        right: clientRect.right,\n        bottom: clientRect.bottom,\n        left: clientRect.left,\n        width: clientRect.width,\n        height: clientRect.height\n    };\n}\n/**\n * Increments the vertical scroll position of a node.\n * @param {?} node Node whose scroll position should change.\n * @param {?} amount Amount of pixels that the `node` should be scrolled.\n * @return {?}\n */\nfunction incrementVerticalScroll(node, amount) {\n    if (node === window) {\n        ((/** @type {?} */ (node))).scrollBy(0, amount);\n    }\n    else {\n        // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\n        ((/** @type {?} */ (node))).scrollTop += amount;\n    }\n}\n/**\n * Increments the horizontal scroll position of a node.\n * @param {?} node Node whose scroll position should change.\n * @param {?} amount Amount of pixels that the `node` should be scrolled.\n * @return {?}\n */\nfunction incrementHorizontalScroll(node, amount) {\n    if (node === window) {\n        ((/** @type {?} */ (node))).scrollBy(amount, 0);\n    }\n    else {\n        // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\n        ((/** @type {?} */ (node))).scrollLeft += amount;\n    }\n}\n/**\n * Gets whether the vertical auto-scroll direction of a node.\n * @param {?} clientRect Dimensions of the node.\n * @param {?} pointerY Position of the user's pointer along the y axis.\n * @return {?}\n */\nfunction getVerticalScrollDirection(clientRect, pointerY) {\n    const { top, bottom, height } = clientRect;\n    /** @type {?} */\n    const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;\n    if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {\n        return 1 /* UP */;\n    }\n    else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {\n        return 2 /* DOWN */;\n    }\n    return 0 /* NONE */;\n}\n/**\n * Gets whether the horizontal auto-scroll direction of a node.\n * @param {?} clientRect Dimensions of the node.\n * @param {?} pointerX Position of the user's pointer along the x axis.\n * @return {?}\n */\nfunction getHorizontalScrollDirection(clientRect, pointerX) {\n    const { left, right, width } = clientRect;\n    /** @type {?} */\n    const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\n    if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\n        return 1 /* LEFT */;\n    }\n    else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\n        return 2 /* RIGHT */;\n    }\n    return 0 /* NONE */;\n}\n/**\n * Gets the directions in which an element node should be scrolled,\n * assuming that the user's pointer is already within it scrollable region.\n * @param {?} element Element for which we should calculate the scroll direction.\n * @param {?} clientRect Bounding client rectangle of the element.\n * @param {?} pointerX Position of the user's pointer along the x axis.\n * @param {?} pointerY Position of the user's pointer along the y axis.\n * @return {?}\n */\nfunction getElementScrollDirections(element, clientRect, pointerX, pointerY) {\n    /** @type {?} */\n    const computedVertical = getVerticalScrollDirection(clientRect, pointerY);\n    /** @type {?} */\n    const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);\n    /** @type {?} */\n    let verticalScrollDirection = 0 /* NONE */;\n    /** @type {?} */\n    let horizontalScrollDirection = 0 /* NONE */;\n    // Note that we here we do some extra checks for whether the element is actually scrollable in\n    // a certain direction and we only assign the scroll direction if it is. We do this so that we\n    // can allow other elements to be scrolled, if the current element can't be scrolled anymore.\n    // This allows us to handle cases where the scroll regions of two scrollable elements overlap.\n    if (computedVertical) {\n        /** @type {?} */\n        const scrollTop = element.scrollTop;\n        if (computedVertical === 1 /* UP */) {\n            if (scrollTop > 0) {\n                verticalScrollDirection = 1 /* UP */;\n            }\n        }\n        else if (element.scrollHeight - scrollTop > element.clientHeight) {\n            verticalScrollDirection = 2 /* DOWN */;\n        }\n    }\n    if (computedHorizontal) {\n        /** @type {?} */\n        const scrollLeft = element.scrollLeft;\n        if (computedHorizontal === 1 /* LEFT */) {\n            if (scrollLeft > 0) {\n                horizontalScrollDirection = 1 /* LEFT */;\n            }\n        }\n        else if (element.scrollWidth - scrollLeft > element.clientWidth) {\n            horizontalScrollDirection = 2 /* RIGHT */;\n        }\n    }\n    return [verticalScrollDirection, horizontalScrollDirection];\n}\n/**\n * Gets the shadow root of an element, if any.\n * @param {?} element\n * @return {?}\n */\nfunction getShadowRoot(element) {\n    if (_supportsShadowDom()) {\n        /** @type {?} */\n        const rootNode = element.getRootNode ? element.getRootNode() : null;\n        if (rootNode instanceof ShadowRoot) {\n            return rootNode;\n        }\n    }\n    return null;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Event options that can be used to bind an active, capturing event.\n * @type {?}\n */\nconst activeCapturingEventOptions = normalizePassiveListenerOptions({\n    passive: false,\n    capture: true\n});\n/**\n * Service that keeps track of all the drag item and drop container\n * instances, and manages global event listeners on the `document`.\n * \\@docs-private\n * @template I, C\n */\n// Note: this class is generic, rather than referencing CdkDrag and CdkDropList directly, in order\n// to avoid circular imports. If we were to reference them here, importing the registry into the\n// classes that are registering themselves will introduce a circular import.\nclass DragDropRegistry {\n    /**\n     * @param {?} _ngZone\n     * @param {?} _document\n     */\n    constructor(_ngZone, _document) {\n        this._ngZone = _ngZone;\n        /**\n         * Registered drop container instances.\n         */\n        this._dropInstances = new Set();\n        /**\n         * Registered drag item instances.\n         */\n        this._dragInstances = new Set();\n        /**\n         * Drag item instances that are currently being dragged.\n         */\n        this._activeDragInstances = new Set();\n        /**\n         * Keeps track of the event listeners that we've bound to the `document`.\n         */\n        this._globalListeners = new Map();\n        /**\n         * Emits the `touchmove` or `mousemove` events that are dispatched\n         * while the user is dragging a drag item instance.\n         */\n        this.pointerMove = new Subject();\n        /**\n         * Emits the `touchend` or `mouseup` events that are dispatched\n         * while the user is dragging a drag item instance.\n         */\n        this.pointerUp = new Subject();\n        /**\n         * Emits when the viewport has been scrolled while the user is dragging an item.\n         */\n        this.scroll = new Subject();\n        /**\n         * Event listener that will prevent the default browser action while the user is dragging.\n         * @param event Event whose default action should be prevented.\n         */\n        this._preventDefaultWhileDragging = (/**\n         * @param {?} event\n         * @return {?}\n         */\n        (event) => {\n            if (this._activeDragInstances.size) {\n                event.preventDefault();\n            }\n        });\n        this._document = _document;\n    }\n    /**\n     * Adds a drop container to the registry.\n     * @param {?} drop\n     * @return {?}\n     */\n    registerDropContainer(drop) {\n        if (!this._dropInstances.has(drop)) {\n            if (this.getDropContainer(drop.id)) {\n                throw Error(`Drop instance with id \"${drop.id}\" has already been registered.`);\n            }\n            this._dropInstances.add(drop);\n        }\n    }\n    /**\n     * Adds a drag item instance to the registry.\n     * @param {?} drag\n     * @return {?}\n     */\n    registerDragItem(drag) {\n        this._dragInstances.add(drag);\n        // The `touchmove` event gets bound once, ahead of time, because WebKit\n        // won't preventDefault on a dynamically-added `touchmove` listener.\n        // See https://bugs.webkit.org/show_bug.cgi?id=184250.\n        if (this._dragInstances.size === 1) {\n            this._ngZone.runOutsideAngular((/**\n             * @return {?}\n             */\n            () => {\n                // The event handler has to be explicitly active,\n                // because newer browsers make it passive by default.\n                this._document.addEventListener('touchmove', this._preventDefaultWhileDragging, activeCapturingEventOptions);\n            }));\n        }\n    }\n    /**\n     * Removes a drop container from the registry.\n     * @param {?} drop\n     * @return {?}\n     */\n    removeDropContainer(drop) {\n        this._dropInstances.delete(drop);\n    }\n    /**\n     * Removes a drag item instance from the registry.\n     * @param {?} drag\n     * @return {?}\n     */\n    removeDragItem(drag) {\n        this._dragInstances.delete(drag);\n        this.stopDragging(drag);\n        if (this._dragInstances.size === 0) {\n            this._document.removeEventListener('touchmove', this._preventDefaultWhileDragging, activeCapturingEventOptions);\n        }\n    }\n    /**\n     * Starts the dragging sequence for a drag instance.\n     * @param {?} drag Drag instance which is being dragged.\n     * @param {?} event Event that initiated the dragging.\n     * @return {?}\n     */\n    startDragging(drag, event) {\n        // Do not process the same drag twice to avoid memory leaks and redundant listeners\n        if (this._activeDragInstances.has(drag)) {\n            return;\n        }\n        this._activeDragInstances.add(drag);\n        if (this._activeDragInstances.size === 1) {\n            /** @type {?} */\n            const isTouchEvent = event.type.startsWith('touch');\n            /** @type {?} */\n            const moveEvent = isTouchEvent ? 'touchmove' : 'mousemove';\n            /** @type {?} */\n            const upEvent = isTouchEvent ? 'touchend' : 'mouseup';\n            // We explicitly bind __active__ listeners here, because newer browsers will default to\n            // passive ones for `mousemove` and `touchmove`. The events need to be active, because we\n            // use `preventDefault` to prevent the page from scrolling while the user is dragging.\n            this._globalListeners\n                .set(moveEvent, {\n                handler: (/**\n                 * @param {?} e\n                 * @return {?}\n                 */\n                (e) => this.pointerMove.next((/** @type {?} */ (e)))),\n                options: activeCapturingEventOptions\n            })\n                .set(upEvent, {\n                handler: (/**\n                 * @param {?} e\n                 * @return {?}\n                 */\n                (e) => this.pointerUp.next((/** @type {?} */ (e)))),\n                options: true\n            })\n                .set('scroll', {\n                handler: (/**\n                 * @param {?} e\n                 * @return {?}\n                 */\n                (e) => this.scroll.next(e)),\n                // Use capturing so that we pick up scroll changes in any scrollable nodes that aren't\n                // the document. See https://github.com/angular/components/issues/17144.\n                options: true\n            })\n                // Preventing the default action on `mousemove` isn't enough to disable text selection\n                // on Safari so we need to prevent the selection event as well. Alternatively this can\n                // be done by setting `user-select: none` on the `body`, however it has causes a style\n                // recalculation which can be expensive on pages with a lot of elements.\n                .set('selectstart', {\n                handler: this._preventDefaultWhileDragging,\n                options: activeCapturingEventOptions\n            });\n            this._ngZone.runOutsideAngular((/**\n             * @return {?}\n             */\n            () => {\n                this._globalListeners.forEach((/**\n                 * @param {?} config\n                 * @param {?} name\n                 * @return {?}\n                 */\n                (config, name) => {\n                    this._document.addEventListener(name, config.handler, config.options);\n                }));\n            }));\n        }\n    }\n    /**\n     * Stops dragging a drag item instance.\n     * @param {?} drag\n     * @return {?}\n     */\n    stopDragging(drag) {\n        this._activeDragInstances.delete(drag);\n        if (this._activeDragInstances.size === 0) {\n            this._clearGlobalListeners();\n        }\n    }\n    /**\n     * Gets whether a drag item instance is currently being dragged.\n     * @param {?} drag\n     * @return {?}\n     */\n    isDragging(drag) {\n        return this._activeDragInstances.has(drag);\n    }\n    /**\n     * Gets a drop container by its id.\n     * @deprecated No longer being used. To be removed.\n     * \\@breaking-change 8.0.0\n     * @param {?} id\n     * @return {?}\n     */\n    getDropContainer(id) {\n        return Array.from(this._dropInstances).find((/**\n         * @param {?} instance\n         * @return {?}\n         */\n        instance => instance.id === id));\n    }\n    /**\n     * @return {?}\n     */\n    ngOnDestroy() {\n        this._dragInstances.forEach((/**\n         * @param {?} instance\n         * @return {?}\n         */\n        instance => this.removeDragItem(instance)));\n        this._dropInstances.forEach((/**\n         * @param {?} instance\n         * @return {?}\n         */\n        instance => this.removeDropContainer(instance)));\n        this._clearGlobalListeners();\n        this.pointerMove.complete();\n        this.pointerUp.complete();\n    }\n    /**\n     * Clears out the global event listeners from the `document`.\n     * @private\n     * @return {?}\n     */\n    _clearGlobalListeners() {\n        this._globalListeners.forEach((/**\n         * @param {?} config\n         * @param {?} name\n         * @return {?}\n         */\n        (config, name) => {\n            this._document.removeEventListener(name, config.handler, config.options);\n        }));\n        this._globalListeners.clear();\n    }\n}\nDragDropRegistry.ɵfac = function DragDropRegistry_Factory(t) { return new (t || DragDropRegistry)(ɵngcc0.ɵɵinject(ɵngcc0.NgZone), ɵngcc0.ɵɵinject(DOCUMENT)); };\nDragDropRegistry.ɵprov = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjectable({ token: DragDropRegistry, factory: DragDropRegistry.ɵfac, providedIn: 'root' });\n/** @nocollapse */\nDragDropRegistry.ctorParameters = () => [\n    { type: NgZone },\n    { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }\n];\n/** @nocollapse */ DragDropRegistry.ngInjectableDef = ɵɵdefineInjectable({ factory: function DragDropRegistry_Factory() { return new DragDropRegistry(ɵɵinject(NgZone), ɵɵinject(DOCUMENT)); }, token: DragDropRegistry, providedIn: \"root\" });\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(DragDropRegistry, [{\n        type: Injectable,\n        args: [{ providedIn: 'root' }]\n    }], function () { return [{ type: ɵngcc0.NgZone }, { type: undefined, decorators: [{\n                type: Inject,\n                args: [DOCUMENT]\n            }] }]; }, null); })();\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Default configuration to be used when creating a `DragRef`.\n * @type {?}\n */\nconst DEFAULT_CONFIG = {\n    dragStartThreshold: 5,\n    pointerDirectionChangeThreshold: 5\n};\n/**\n * Service that allows for drag-and-drop functionality to be attached to DOM elements.\n */\nclass DragDrop {\n    /**\n     * @param {?} _document\n     * @param {?} _ngZone\n     * @param {?} _viewportRuler\n     * @param {?} _dragDropRegistry\n     */\n    constructor(_document, _ngZone, _viewportRuler, _dragDropRegistry) {\n        this._document = _document;\n        this._ngZone = _ngZone;\n        this._viewportRuler = _viewportRuler;\n        this._dragDropRegistry = _dragDropRegistry;\n    }\n    /**\n     * Turns an element into a draggable item.\n     * @template T\n     * @param {?} element Element to which to attach the dragging functionality.\n     * @param {?=} config Object used to configure the dragging behavior.\n     * @return {?}\n     */\n    createDrag(element, config = DEFAULT_CONFIG) {\n        return new DragRef(element, config, this._document, this._ngZone, this._viewportRuler, this._dragDropRegistry);\n    }\n    /**\n     * Turns an element into a drop list.\n     * @template T\n     * @param {?} element Element to which to attach the drop list functionality.\n     * @return {?}\n     */\n    createDropList(element) {\n        return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler);\n    }\n}\nDragDrop.ɵfac = function DragDrop_Factory(t) { return new (t || DragDrop)(ɵngcc0.ɵɵinject(DOCUMENT), ɵngcc0.ɵɵinject(ɵngcc0.NgZone), ɵngcc0.ɵɵinject(ɵngcc1.ViewportRuler), ɵngcc0.ɵɵinject(DragDropRegistry)); };\nDragDrop.ɵprov = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjectable({ token: DragDrop, factory: DragDrop.ɵfac, providedIn: 'root' });\n/** @nocollapse */\nDragDrop.ctorParameters = () => [\n    { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },\n    { type: NgZone },\n    { type: ViewportRuler },\n    { type: DragDropRegistry }\n];\n/** @nocollapse */ DragDrop.ngInjectableDef = ɵɵdefineInjectable({ factory: function DragDrop_Factory() { return new DragDrop(ɵɵinject(DOCUMENT), ɵɵinject(NgZone), ɵɵinject(ViewportRuler), ɵɵinject(DragDropRegistry)); }, token: DragDrop, providedIn: \"root\" });\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(DragDrop, [{\n        type: Injectable,\n        args: [{ providedIn: 'root' }]\n    }], function () { return [{ type: undefined, decorators: [{\n                type: Inject,\n                args: [DOCUMENT]\n            }] }, { type: ɵngcc0.NgZone }, { type: ɵngcc1.ViewportRuler }, { type: DragDropRegistry }]; }, null); })();\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Injection token that is used to provide a CdkDropList instance to CdkDrag.\n * Used for avoiding circular imports.\n * @type {?}\n */\nconst CDK_DROP_LIST = new InjectionToken('CDK_DROP_LIST');\n/**\n * Injection token that is used to provide a CdkDropList instance to CdkDrag.\n * Used for avoiding circular imports.\n * @deprecated Use `CDK_DROP_LIST` instead.\n * \\@breaking-change 8.0.0\n * @type {?}\n */\nconst CDK_DROP_LIST_CONTAINER = CDK_DROP_LIST;\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the\n * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily\n * to avoid circular imports.\n * \\@docs-private\n * @type {?}\n */\nconst CDK_DRAG_PARENT = new InjectionToken('CDK_DRAG_PARENT');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Handle that can be used to drag and CdkDrag instance.\n */\nclass CdkDragHandle {\n    /**\n     * @param {?} element\n     * @param {?=} parentDrag\n     */\n    constructor(element, parentDrag) {\n        this.element = element;\n        /**\n         * Emits when the state of the handle has changed.\n         */\n        this._stateChanges = new Subject();\n        this._disabled = false;\n        this._parentDrag = parentDrag;\n        toggleNativeDragInteractions(element.nativeElement, false);\n    }\n    /**\n     * Whether starting to drag through this handle is disabled.\n     * @return {?}\n     */\n    get disabled() { return this._disabled; }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    set disabled(value) {\n        this._disabled = coerceBooleanProperty(value);\n        this._stateChanges.next(this);\n    }\n    /**\n     * @return {?}\n     */\n    ngOnDestroy() {\n        this._stateChanges.complete();\n    }\n}\nCdkDragHandle.ɵfac = function CdkDragHandle_Factory(t) { return new (t || CdkDragHandle)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(CDK_DRAG_PARENT, 8)); };\nCdkDragHandle.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkDragHandle, selectors: [[\"\", \"cdkDragHandle\", \"\"]], hostAttrs: [1, \"cdk-drag-handle\"], inputs: { disabled: [\"cdkDragHandleDisabled\", \"disabled\"] } });\n/** @nocollapse */\nCdkDragHandle.ctorParameters = () => [\n    { type: ElementRef },\n    { type: undefined, decorators: [{ type: Inject, args: [CDK_DRAG_PARENT,] }, { type: Optional }] }\n];\nCdkDragHandle.propDecorators = {\n    disabled: [{ type: Input, args: ['cdkDragHandleDisabled',] }]\n};\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkDragHandle, [{\n        type: Directive,\n        args: [{\n                selector: '[cdkDragHandle]',\n                host: {\n                    'class': 'cdk-drag-handle'\n                }\n            }]\n    }], function () { return [{ type: ɵngcc0.ElementRef }, { type: undefined, decorators: [{\n                type: Inject,\n                args: [CDK_DRAG_PARENT]\n            }, {\n                type: Optional\n            }] }]; }, { disabled: [{\n            type: Input,\n            args: ['cdkDragHandleDisabled']\n        }] }); })();\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Element that will be used as a template for the placeholder of a CdkDrag when\n * it is being dragged. The placeholder is displayed in place of the element being dragged.\n * @template T\n */\nclass CdkDragPlaceholder {\n    /**\n     * @param {?} templateRef\n     */\n    constructor(templateRef) {\n        this.templateRef = templateRef;\n    }\n}\nCdkDragPlaceholder.ɵfac = function CdkDragPlaceholder_Factory(t) { return new (t || CdkDragPlaceholder)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.TemplateRef)); };\nCdkDragPlaceholder.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkDragPlaceholder, selectors: [[\"ng-template\", \"cdkDragPlaceholder\", \"\"]], inputs: { data: \"data\" } });\n/** @nocollapse */\nCdkDragPlaceholder.ctorParameters = () => [\n    { type: TemplateRef }\n];\nCdkDragPlaceholder.propDecorators = {\n    data: [{ type: Input }]\n};\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkDragPlaceholder, [{\n        type: Directive,\n        args: [{\n                selector: 'ng-template[cdkDragPlaceholder]'\n            }]\n    }], function () { return [{ type: ɵngcc0.TemplateRef }]; }, { data: [{\n            type: Input\n        }] }); })();\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Element that will be used as a template for the preview\n * of a CdkDrag when it is being dragged.\n * @template T\n */\nclass CdkDragPreview {\n    /**\n     * @param {?} templateRef\n     */\n    constructor(templateRef) {\n        this.templateRef = templateRef;\n    }\n}\nCdkDragPreview.ɵfac = function CdkDragPreview_Factory(t) { return new (t || CdkDragPreview)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.TemplateRef)); };\nCdkDragPreview.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkDragPreview, selectors: [[\"ng-template\", \"cdkDragPreview\", \"\"]], inputs: { data: \"data\" } });\n/** @nocollapse */\nCdkDragPreview.ctorParameters = () => [\n    { type: TemplateRef }\n];\nCdkDragPreview.propDecorators = {\n    data: [{ type: Input }]\n};\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkDragPreview, [{\n        type: Directive,\n        args: [{\n                selector: 'ng-template[cdkDragPreview]'\n            }]\n    }], function () { return [{ type: ɵngcc0.TemplateRef }]; }, { data: [{\n            type: Input\n        }] }); })();\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Injection token that can be used to configure the behavior of `CdkDrag`.\n * @type {?}\n */\nconst CDK_DRAG_CONFIG = new InjectionToken('CDK_DRAG_CONFIG', {\n    providedIn: 'root',\n    factory: CDK_DRAG_CONFIG_FACTORY\n});\n/**\n * \\@docs-private\n * @return {?}\n */\nfunction CDK_DRAG_CONFIG_FACTORY() {\n    return { dragStartThreshold: 5, pointerDirectionChangeThreshold: 5 };\n}\n/**\n * Element that can be moved inside a CdkDropList container.\n * @template T\n */\nclass CdkDrag {\n    /**\n     * @param {?} element\n     * @param {?} dropContainer\n     * @param {?} _document\n     * @param {?} _ngZone\n     * @param {?} _viewContainerRef\n     * @param {?} config\n     * @param {?} _dir\n     * @param {?} dragDrop\n     * @param {?} _changeDetectorRef\n     */\n    constructor(element, dropContainer, _document, _ngZone, _viewContainerRef, config, _dir, dragDrop, _changeDetectorRef) {\n        this.element = element;\n        this.dropContainer = dropContainer;\n        this._document = _document;\n        this._ngZone = _ngZone;\n        this._viewContainerRef = _viewContainerRef;\n        this._dir = _dir;\n        this._changeDetectorRef = _changeDetectorRef;\n        this._destroyed = new Subject();\n        /**\n         * Amount of milliseconds to wait after the user has put their\n         * pointer down before starting to drag the element.\n         */\n        this.dragStartDelay = 0;\n        this._disabled = false;\n        /**\n         * Emits when the user starts dragging the item.\n         */\n        this.started = new EventEmitter();\n        /**\n         * Emits when the user has released a drag item, before any animations have started.\n         */\n        this.released = new EventEmitter();\n        /**\n         * Emits when the user stops dragging an item in the container.\n         */\n        this.ended = new EventEmitter();\n        /**\n         * Emits when the user has moved the item into a new container.\n         */\n        this.entered = new EventEmitter();\n        /**\n         * Emits when the user removes the item its container by dragging it into another container.\n         */\n        this.exited = new EventEmitter();\n        /**\n         * Emits when the user drops the item inside a container.\n         */\n        this.dropped = new EventEmitter();\n        /**\n         * Emits as the user is dragging the item. Use with caution,\n         * because this event will fire for every pixel that the user has dragged.\n         */\n        this.moved = new Observable((/**\n         * @param {?} observer\n         * @return {?}\n         */\n        (observer) => {\n            /** @type {?} */\n            const subscription = this._dragRef.moved.pipe(map((/**\n             * @param {?} movedEvent\n             * @return {?}\n             */\n            movedEvent => ({\n                source: this,\n                pointerPosition: movedEvent.pointerPosition,\n                event: movedEvent.event,\n                delta: movedEvent.delta,\n                distance: movedEvent.distance\n            })))).subscribe(observer);\n            return (/**\n             * @return {?}\n             */\n            () => {\n                subscription.unsubscribe();\n            });\n        }));\n        this._dragRef = dragDrop.createDrag(element, config);\n        this._dragRef.data = this;\n        this._syncInputs(this._dragRef);\n        this._handleEvents(this._dragRef);\n    }\n    /**\n     * Selector that will be used to determine the element to which the draggable's position will\n     * be constrained. Matching starts from the element's parent and goes up the DOM until a matching\n     * element has been found\n     * @deprecated Use `boundaryElement` instead.\n     * \\@breaking-change 9.0.0\n     * @return {?}\n     */\n    get boundaryElementSelector() {\n        return typeof this.boundaryElement === 'string' ? this.boundaryElement : (/** @type {?} */ (undefined));\n    }\n    /**\n     * @param {?} selector\n     * @return {?}\n     */\n    set boundaryElementSelector(selector) {\n        this.boundaryElement = selector;\n    }\n    /**\n     * Whether starting to drag this element is disabled.\n     * @return {?}\n     */\n    get disabled() {\n        return this._disabled || (this.dropContainer && this.dropContainer.disabled);\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    set disabled(value) {\n        this._disabled = coerceBooleanProperty(value);\n        this._dragRef.disabled = this._disabled;\n    }\n    /**\n     * Returns the element that is being used as a placeholder\n     * while the current element is being dragged.\n     * @return {?}\n     */\n    getPlaceholderElement() {\n        return this._dragRef.getPlaceholderElement();\n    }\n    /**\n     * Returns the root draggable element.\n     * @return {?}\n     */\n    getRootElement() {\n        return this._dragRef.getRootElement();\n    }\n    /**\n     * Resets a standalone drag item to its initial position.\n     * @return {?}\n     */\n    reset() {\n        this._dragRef.reset();\n    }\n    /**\n     * Gets the pixel coordinates of the draggable outside of a drop container.\n     * @return {?}\n     */\n    getFreeDragPosition() {\n        return this._dragRef.getFreeDragPosition();\n    }\n    /**\n     * @return {?}\n     */\n    ngAfterViewInit() {\n        // We need to wait for the zone to stabilize, in order for the reference\n        // element to be in the proper place in the DOM. This is mostly relevant\n        // for draggable elements inside portals since they get stamped out in\n        // their original DOM position and then they get transferred to the portal.\n        this._ngZone.onStable.asObservable()\n            .pipe(take(1), takeUntil(this._destroyed))\n            .subscribe((/**\n         * @return {?}\n         */\n        () => {\n            this._updateRootElement();\n            // Listen for any newly-added handles.\n            this._handles.changes.pipe(startWith(this._handles), \n            // Sync the new handles with the DragRef.\n            tap((/**\n             * @param {?} handles\n             * @return {?}\n             */\n            (handles) => {\n                /** @type {?} */\n                const childHandleElements = handles\n                    .filter((/**\n                 * @param {?} handle\n                 * @return {?}\n                 */\n                handle => handle._parentDrag === this))\n                    .map((/**\n                 * @param {?} handle\n                 * @return {?}\n                 */\n                handle => handle.element));\n                this._dragRef.withHandles(childHandleElements);\n            })), \n            // Listen if the state of any of the handles changes.\n            switchMap((/**\n             * @param {?} handles\n             * @return {?}\n             */\n            (handles) => {\n                return merge(...handles.map((/**\n                 * @param {?} item\n                 * @return {?}\n                 */\n                item => item._stateChanges)));\n            })), takeUntil(this._destroyed)).subscribe((/**\n             * @param {?} handleInstance\n             * @return {?}\n             */\n            handleInstance => {\n                // Enabled/disable the handle that changed in the DragRef.\n                /** @type {?} */\n                const dragRef = this._dragRef;\n                /** @type {?} */\n                const handle = handleInstance.element.nativeElement;\n                handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);\n            }));\n            if (this.freeDragPosition) {\n                this._dragRef.setFreeDragPosition(this.freeDragPosition);\n            }\n        }));\n    }\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    ngOnChanges(changes) {\n        /** @type {?} */\n        const rootSelectorChange = changes['rootElementSelector'];\n        /** @type {?} */\n        const positionChange = changes['freeDragPosition'];\n        // We don't have to react to the first change since it's being\n        // handled in `ngAfterViewInit` where it needs to be deferred.\n        if (rootSelectorChange && !rootSelectorChange.firstChange) {\n            this._updateRootElement();\n        }\n        // Skip the first change since it's being handled in `ngAfterViewInit`.\n        if (positionChange && !positionChange.firstChange && this.freeDragPosition) {\n            this._dragRef.setFreeDragPosition(this.freeDragPosition);\n        }\n    }\n    /**\n     * @return {?}\n     */\n    ngOnDestroy() {\n        this._destroyed.next();\n        this._destroyed.complete();\n        this._dragRef.dispose();\n    }\n    /**\n     * Syncs the root element with the `DragRef`.\n     * @private\n     * @return {?}\n     */\n    _updateRootElement() {\n        /** @type {?} */\n        const element = this.element.nativeElement;\n        /** @type {?} */\n        const rootElement = this.rootElementSelector ?\n            getClosestMatchingAncestor(element, this.rootElementSelector) : element;\n        if (rootElement && rootElement.nodeType !== this._document.ELEMENT_NODE) {\n            throw Error(`cdkDrag must be attached to an element node. ` +\n                `Currently attached to \"${rootElement.nodeName}\".`);\n        }\n        this._dragRef.withRootElement(rootElement || element);\n    }\n    /**\n     * Gets the boundary element, based on the `boundaryElement` value.\n     * @private\n     * @return {?}\n     */\n    _getBoundaryElement() {\n        /** @type {?} */\n        const boundary = this.boundaryElement;\n        if (!boundary) {\n            return null;\n        }\n        if (typeof boundary === 'string') {\n            return getClosestMatchingAncestor(this.element.nativeElement, boundary);\n        }\n        /** @type {?} */\n        const element = coerceElement(boundary);\n        if (isDevMode() && !element.contains(this.element.nativeElement)) {\n            throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');\n        }\n        return element;\n    }\n    /**\n     * Syncs the inputs of the CdkDrag with the options of the underlying DragRef.\n     * @private\n     * @param {?} ref\n     * @return {?}\n     */\n    _syncInputs(ref) {\n        ref.beforeStarted.subscribe((/**\n         * @return {?}\n         */\n        () => {\n            if (!ref.isDragging()) {\n                /** @type {?} */\n                const dir = this._dir;\n                /** @type {?} */\n                const placeholder = this._placeholderTemplate ? {\n                    template: this._placeholderTemplate.templateRef,\n                    context: this._placeholderTemplate.data,\n                    viewContainer: this._viewContainerRef\n                } : null;\n                /** @type {?} */\n                const preview = this._previewTemplate ? {\n                    template: this._previewTemplate.templateRef,\n                    context: this._previewTemplate.data,\n                    viewContainer: this._viewContainerRef\n                } : null;\n                ref.disabled = this.disabled;\n                ref.lockAxis = this.lockAxis;\n                ref.dragStartDelay = coerceNumberProperty(this.dragStartDelay);\n                ref.constrainPosition = this.constrainPosition;\n                ref\n                    .withBoundaryElement(this._getBoundaryElement())\n                    .withPlaceholderTemplate(placeholder)\n                    .withPreviewTemplate(preview);\n                if (dir) {\n                    ref.withDirection(dir.value);\n                }\n            }\n        }));\n    }\n    /**\n     * Handles the events from the underlying `DragRef`.\n     * @private\n     * @param {?} ref\n     * @return {?}\n     */\n    _handleEvents(ref) {\n        ref.started.subscribe((/**\n         * @return {?}\n         */\n        () => {\n            this.started.emit({ source: this });\n            // Since all of these events run outside of change detection,\n            // we need to ensure that everything is marked correctly.\n            this._changeDetectorRef.markForCheck();\n        }));\n        ref.released.subscribe((/**\n         * @return {?}\n         */\n        () => {\n            this.released.emit({ source: this });\n        }));\n        ref.ended.subscribe((/**\n         * @param {?} event\n         * @return {?}\n         */\n        event => {\n            this.ended.emit({ source: this, distance: event.distance });\n            // Since all of these events run outside of change detection,\n            // we need to ensure that everything is marked correctly.\n            this._changeDetectorRef.markForCheck();\n        }));\n        ref.entered.subscribe((/**\n         * @param {?} event\n         * @return {?}\n         */\n        event => {\n            this.entered.emit({\n                container: event.container.data,\n                item: this,\n                currentIndex: event.currentIndex\n            });\n        }));\n        ref.exited.subscribe((/**\n         * @param {?} event\n         * @return {?}\n         */\n        event => {\n            this.exited.emit({\n                container: event.container.data,\n                item: this\n            });\n        }));\n        ref.dropped.subscribe((/**\n         * @param {?} event\n         * @return {?}\n         */\n        event => {\n            this.dropped.emit({\n                previousIndex: event.previousIndex,\n                currentIndex: event.currentIndex,\n                previousContainer: event.previousContainer.data,\n                container: event.container.data,\n                isPointerOverContainer: event.isPointerOverContainer,\n                item: this,\n                distance: event.distance\n            });\n        }));\n    }\n}\nCdkDrag.ɵfac = function CdkDrag_Factory(t) { return new (t || CdkDrag)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(CDK_DROP_LIST, 12), ɵngcc0.ɵɵdirectiveInject(DOCUMENT), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.NgZone), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ViewContainerRef), ɵngcc0.ɵɵdirectiveInject(CDK_DRAG_CONFIG), ɵngcc0.ɵɵdirectiveInject(ɵngcc2.Directionality, 8), ɵngcc0.ɵɵdirectiveInject(DragDrop), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef)); };\nCdkDrag.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkDrag, selectors: [[\"\", \"cdkDrag\", \"\"]], contentQueries: function CdkDrag_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {\n        ɵngcc0.ɵɵcontentQuery(dirIndex, CdkDragPreview, 5);\n        ɵngcc0.ɵɵcontentQuery(dirIndex, CdkDragPlaceholder, 5);\n        ɵngcc0.ɵɵcontentQuery(dirIndex, CdkDragHandle, 5);\n    } if (rf & 2) {\n        let _t;\n        ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx._previewTemplate = _t.first);\n        ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx._placeholderTemplate = _t.first);\n        ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx._handles = _t);\n    } }, hostAttrs: [1, \"cdk-drag\"], hostVars: 4, hostBindings: function CdkDrag_HostBindings(rf, ctx) { if (rf & 2) {\n        ɵngcc0.ɵɵclassProp(\"cdk-drag-disabled\", ctx.disabled)(\"cdk-drag-dragging\", ctx._dragRef.isDragging());\n    } }, inputs: { dragStartDelay: [\"cdkDragStartDelay\", \"dragStartDelay\"], boundaryElement: [\"cdkDragBoundary\", \"boundaryElement\"], disabled: [\"cdkDragDisabled\", \"disabled\"], data: [\"cdkDragData\", \"data\"], lockAxis: [\"cdkDragLockAxis\", \"lockAxis\"], rootElementSelector: [\"cdkDragRootElement\", \"rootElementSelector\"], freeDragPosition: [\"cdkDragFreeDragPosition\", \"freeDragPosition\"], constrainPosition: [\"cdkDragConstrainPosition\", \"constrainPosition\"] }, outputs: { started: \"cdkDragStarted\", released: \"cdkDragReleased\", ended: \"cdkDragEnded\", entered: \"cdkDragEntered\", exited: \"cdkDragExited\", dropped: \"cdkDragDropped\", moved: \"cdkDragMoved\" }, exportAs: [\"cdkDrag\"], features: [ɵngcc0.ɵɵProvidersFeature([{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }]), ɵngcc0.ɵɵNgOnChangesFeature] });\n/** @nocollapse */\nCdkDrag.ctorParameters = () => [\n    { type: ElementRef },\n    { type: undefined, decorators: [{ type: Inject, args: [CDK_DROP_LIST,] }, { type: Optional }, { type: SkipSelf }] },\n    { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },\n    { type: NgZone },\n    { type: ViewContainerRef },\n    { type: undefined, decorators: [{ type: Inject, args: [CDK_DRAG_CONFIG,] }] },\n    { type: Directionality, decorators: [{ type: Optional }] },\n    { type: DragDrop },\n    { type: ChangeDetectorRef }\n];\nCdkDrag.propDecorators = {\n    _handles: [{ type: ContentChildren, args: [CdkDragHandle, { descendants: true },] }],\n    _previewTemplate: [{ type: ContentChild, args: [CdkDragPreview, { static: false },] }],\n    _placeholderTemplate: [{ type: ContentChild, args: [CdkDragPlaceholder, { static: false },] }],\n    data: [{ type: Input, args: ['cdkDragData',] }],\n    lockAxis: [{ type: Input, args: ['cdkDragLockAxis',] }],\n    rootElementSelector: [{ type: Input, args: ['cdkDragRootElement',] }],\n    boundaryElement: [{ type: Input, args: ['cdkDragBoundary',] }],\n    dragStartDelay: [{ type: Input, args: ['cdkDragStartDelay',] }],\n    freeDragPosition: [{ type: Input, args: ['cdkDragFreeDragPosition',] }],\n    disabled: [{ type: Input, args: ['cdkDragDisabled',] }],\n    constrainPosition: [{ type: Input, args: ['cdkDragConstrainPosition',] }],\n    started: [{ type: Output, args: ['cdkDragStarted',] }],\n    released: [{ type: Output, args: ['cdkDragReleased',] }],\n    ended: [{ type: Output, args: ['cdkDragEnded',] }],\n    entered: [{ type: Output, args: ['cdkDragEntered',] }],\n    exited: [{ type: Output, args: ['cdkDragExited',] }],\n    dropped: [{ type: Output, args: ['cdkDragDropped',] }],\n    moved: [{ type: Output, args: ['cdkDragMoved',] }]\n};\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkDrag, [{\n        type: Directive,\n        args: [{\n                selector: '[cdkDrag]',\n                exportAs: 'cdkDrag',\n                host: {\n                    'class': 'cdk-drag',\n                    '[class.cdk-drag-disabled]': 'disabled',\n                    '[class.cdk-drag-dragging]': '_dragRef.isDragging()'\n                },\n                providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }]\n            }]\n    }], function () { return [{ type: ɵngcc0.ElementRef }, { type: undefined, decorators: [{\n                type: Inject,\n                args: [CDK_DROP_LIST]\n            }, {\n                type: Optional\n            }, {\n                type: SkipSelf\n            }] }, { type: undefined, decorators: [{\n                type: Inject,\n                args: [DOCUMENT]\n            }] }, { type: ɵngcc0.NgZone }, { type: ɵngcc0.ViewContainerRef }, { type: undefined, decorators: [{\n                type: Inject,\n                args: [CDK_DRAG_CONFIG]\n            }] }, { type: ɵngcc2.Directionality, decorators: [{\n                type: Optional\n            }] }, { type: DragDrop }, { type: ɵngcc0.ChangeDetectorRef }]; }, { dragStartDelay: [{\n            type: Input,\n            args: ['cdkDragStartDelay']\n        }], started: [{\n            type: Output,\n            args: ['cdkDragStarted']\n        }], released: [{\n            type: Output,\n            args: ['cdkDragReleased']\n        }], ended: [{\n            type: Output,\n            args: ['cdkDragEnded']\n        }], entered: [{\n            type: Output,\n            args: ['cdkDragEntered']\n        }], exited: [{\n            type: Output,\n            args: ['cdkDragExited']\n        }], dropped: [{\n            type: Output,\n            args: ['cdkDragDropped']\n        }], moved: [{\n            type: Output,\n            args: ['cdkDragMoved']\n        }], boundaryElement: [{\n            type: Input,\n            args: ['cdkDragBoundary']\n        }], disabled: [{\n            type: Input,\n            args: ['cdkDragDisabled']\n        }], _handles: [{\n            type: ContentChildren,\n            args: [CdkDragHandle, { descendants: true }]\n        }], _previewTemplate: [{\n            type: ContentChild,\n            args: [CdkDragPreview, { static: false }]\n        }], _placeholderTemplate: [{\n            type: ContentChild,\n            args: [CdkDragPlaceholder, { static: false }]\n        }], data: [{\n            type: Input,\n            args: ['cdkDragData']\n        }], lockAxis: [{\n            type: Input,\n            args: ['cdkDragLockAxis']\n        }], rootElementSelector: [{\n            type: Input,\n            args: ['cdkDragRootElement']\n        }], freeDragPosition: [{\n            type: Input,\n            args: ['cdkDragFreeDragPosition']\n        }], constrainPosition: [{\n            type: Input,\n            args: ['cdkDragConstrainPosition']\n        }] }); })();\n/**\n * Gets the closest ancestor of an element that matches a selector.\n * @param {?} element\n * @param {?} selector\n * @return {?}\n */\nfunction getClosestMatchingAncestor(element, selector) {\n    /** @type {?} */\n    let currentElement = (/** @type {?} */ (element.parentElement));\n    while (currentElement) {\n        // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.\n        if (currentElement.matches ? currentElement.matches(selector) :\n            ((/** @type {?} */ (currentElement))).msMatchesSelector(selector)) {\n            return currentElement;\n        }\n        currentElement = currentElement.parentElement;\n    }\n    return null;\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`\n * elements that are placed inside a `cdkDropListGroup` will be connected to each other\n * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input\n * from `cdkDropList`.\n * @template T\n */\nclass CdkDropListGroup {\n    constructor() {\n        /**\n         * Drop lists registered inside the group.\n         */\n        this._items = new Set();\n        this._disabled = false;\n    }\n    /**\n     * Whether starting a dragging sequence from inside this group is disabled.\n     * @return {?}\n     */\n    get disabled() { return this._disabled; }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    set disabled(value) {\n        this._disabled = coerceBooleanProperty(value);\n    }\n    /**\n     * @return {?}\n     */\n    ngOnDestroy() {\n        this._items.clear();\n    }\n}\nCdkDropListGroup.ɵfac = function CdkDropListGroup_Factory(t) { return new (t || CdkDropListGroup)(); };\nCdkDropListGroup.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkDropListGroup, selectors: [[\"\", \"cdkDropListGroup\", \"\"]], inputs: { disabled: [\"cdkDropListGroupDisabled\", \"disabled\"] }, exportAs: [\"cdkDropListGroup\"] });\nCdkDropListGroup.propDecorators = {\n    disabled: [{ type: Input, args: ['cdkDropListGroupDisabled',] }]\n};\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkDropListGroup, [{\n        type: Directive,\n        args: [{\n                selector: '[cdkDropListGroup]',\n                exportAs: 'cdkDropListGroup'\n            }]\n    }], function () { return []; }, { disabled: [{\n            type: Input,\n            args: ['cdkDropListGroupDisabled']\n        }] }); })();\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Counter used to generate unique ids for drop zones.\n * @type {?}\n */\nlet _uniqueIdCounter$1 = 0;\nconst ɵ0 = undefined;\n// @breaking-change 8.0.0 `CdkDropList` implements `CdkDropListContainer` for backwards\n// compatiblity. The implements clause, as well as all the methods that it enforces can\n// be removed when `CdkDropListContainer` is deleted.\n/**\n * Container that wraps a set of draggable items.\n * @template T\n */\nclass CdkDropList {\n    /**\n     * @param {?} element\n     * @param {?} dragDrop\n     * @param {?} _changeDetectorRef\n     * @param {?=} _dir\n     * @param {?=} _group\n     */\n    constructor(element, dragDrop, _changeDetectorRef, _dir, _group) {\n        this.element = element;\n        this._changeDetectorRef = _changeDetectorRef;\n        this._dir = _dir;\n        this._group = _group;\n        /**\n         * Emits when the list has been destroyed.\n         */\n        this._destroyed = new Subject();\n        /**\n         * Other draggable containers that this container is connected to and into which the\n         * container's items can be transferred. Can either be references to other drop containers,\n         * or their unique IDs.\n         */\n        this.connectedTo = [];\n        /**\n         * Direction in which the list is oriented.\n         */\n        this.orientation = 'vertical';\n        /**\n         * Unique ID for the drop zone. Can be used as a reference\n         * in the `connectedTo` of another `CdkDropList`.\n         */\n        this.id = `cdk-drop-list-${_uniqueIdCounter$1++}`;\n        this._disabled = false;\n        this._sortingDisabled = false;\n        /**\n         * Function that is used to determine whether an item\n         * is allowed to be moved into a drop container.\n         */\n        this.enterPredicate = (/**\n         * @return {?}\n         */\n        () => true);\n        /**\n         * Whether to auto-scroll the view when the user moves their pointer close to the edges.\n         */\n        this.autoScrollDisabled = false;\n        /**\n         * Emits when the user drops an item inside the container.\n         */\n        this.dropped = new EventEmitter();\n        /**\n         * Emits when the user has moved a new drag item into this container.\n         */\n        this.entered = new EventEmitter();\n        /**\n         * Emits when the user removes an item from the container\n         * by dragging it into another container.\n         */\n        this.exited = new EventEmitter();\n        /**\n         * Emits as the user is swapping items while actively dragging.\n         */\n        this.sorted = new EventEmitter();\n        this._dropListRef = dragDrop.createDropList(element);\n        this._dropListRef.data = this;\n        this._dropListRef.enterPredicate = (/**\n         * @param {?} drag\n         * @param {?} drop\n         * @return {?}\n         */\n        (drag, drop) => {\n            return this.enterPredicate(drag.data, drop.data);\n        });\n        this._syncInputs(this._dropListRef);\n        this._handleEvents(this._dropListRef);\n        CdkDropList._dropLists.push(this);\n        if (_group) {\n            _group._items.add(this);\n        }\n    }\n    /**\n     * Whether starting a dragging sequence from this container is disabled.\n     * @return {?}\n     */\n    get disabled() {\n        return this._disabled || (!!this._group && this._group.disabled);\n    }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    set disabled(value) {\n        this._disabled = coerceBooleanProperty(value);\n    }\n    /**\n     * Whether sorting within this drop list is disabled.\n     * @return {?}\n     */\n    get sortingDisabled() { return this._sortingDisabled; }\n    /**\n     * @param {?} value\n     * @return {?}\n     */\n    set sortingDisabled(value) {\n        this._sortingDisabled = coerceBooleanProperty(value);\n    }\n    /**\n     * @return {?}\n     */\n    ngAfterContentInit() {\n        this._draggables.changes\n            .pipe(startWith(this._draggables), takeUntil(this._destroyed))\n            .subscribe((/**\n         * @param {?} items\n         * @return {?}\n         */\n        (items) => {\n            this._dropListRef.withItems(items.map((/**\n             * @param {?} drag\n             * @return {?}\n             */\n            drag => drag._dragRef)));\n        }));\n    }\n    /**\n     * @return {?}\n     */\n    ngOnDestroy() {\n        /** @type {?} */\n        const index = CdkDropList._dropLists.indexOf(this);\n        if (index > -1) {\n            CdkDropList._dropLists.splice(index, 1);\n        }\n        if (this._group) {\n            this._group._items.delete(this);\n        }\n        this._dropListRef.dispose();\n        this._destroyed.next();\n        this._destroyed.complete();\n    }\n    /**\n     * Starts dragging an item.\n     * @return {?}\n     */\n    start() {\n        this._dropListRef.start();\n    }\n    /**\n     * Drops an item into this container.\n     * @param {?} item Item being dropped into the container.\n     * @param {?} currentIndex Index at which the item should be inserted.\n     * @param {?} previousContainer Container from which the item got dragged in.\n     * @param {?} isPointerOverContainer Whether the user's pointer was over the\n     *    container when the item was dropped.\n     * @return {?}\n     */\n    drop(item, currentIndex, previousContainer, isPointerOverContainer) {\n        this._dropListRef.drop(item._dragRef, currentIndex, ((/** @type {?} */ (previousContainer)))._dropListRef, isPointerOverContainer);\n    }\n    /**\n     * Emits an event to indicate that the user moved an item into the container.\n     * @param {?} item Item that was moved into the container.\n     * @param {?} pointerX Position of the item along the X axis.\n     * @param {?} pointerY Position of the item along the Y axis.\n     * @return {?}\n     */\n    enter(item, pointerX, pointerY) {\n        this._dropListRef.enter(item._dragRef, pointerX, pointerY);\n    }\n    /**\n     * Removes an item from the container after it was dragged into another container by the user.\n     * @param {?} item Item that was dragged out.\n     * @return {?}\n     */\n    exit(item) {\n        this._dropListRef.exit(item._dragRef);\n    }\n    /**\n     * Figures out the index of an item in the container.\n     * @param {?} item Item whose index should be determined.\n     * @return {?}\n     */\n    getItemIndex(item) {\n        return this._dropListRef.getItemIndex(item._dragRef);\n    }\n    /**\n     * Sorts an item inside the container based on its position.\n     * @param {?} item Item to be sorted.\n     * @param {?} pointerX Position of the item along the X axis.\n     * @param {?} pointerY Position of the item along the Y axis.\n     * @param {?} pointerDelta Direction in which the pointer is moving along each axis.\n     * @return {?}\n     */\n    _sortItem(item, pointerX, pointerY, pointerDelta) {\n        return this._dropListRef._sortItem(item._dragRef, pointerX, pointerY, pointerDelta);\n    }\n    /**\n     * Figures out whether an item should be moved into a sibling\n     * drop container, based on its current position.\n     * @param {?} item Drag item that is being moved.\n     * @param {?} x Position of the item along the X axis.\n     * @param {?} y Position of the item along the Y axis.\n     * @return {?}\n     */\n    _getSiblingContainerFromPosition(item, x, y) {\n        /** @type {?} */\n        const result = this._dropListRef._getSiblingContainerFromPosition(item._dragRef, x, y);\n        return result ? result.data : null;\n    }\n    /**\n     * Checks whether the user's pointer is positioned over the container.\n     * @param {?} x Pointer position along the X axis.\n     * @param {?} y Pointer position along the Y axis.\n     * @return {?}\n     */\n    _isOverContainer(x, y) {\n        return this._dropListRef._isOverContainer(x, y);\n    }\n    /**\n     * Syncs the inputs of the CdkDropList with the options of the underlying DropListRef.\n     * @private\n     * @param {?} ref\n     * @return {?}\n     */\n    _syncInputs(ref) {\n        if (this._dir) {\n            this._dir.change\n                .pipe(startWith(this._dir.value), takeUntil(this._destroyed))\n                .subscribe((/**\n             * @param {?} value\n             * @return {?}\n             */\n            value => ref.withDirection(value)));\n        }\n        ref.beforeStarted.subscribe((/**\n         * @return {?}\n         */\n        () => {\n            /** @type {?} */\n            const siblings = coerceArray(this.connectedTo).map((/**\n             * @param {?} drop\n             * @return {?}\n             */\n            drop => {\n                return typeof drop === 'string' ?\n                    (/** @type {?} */ (CdkDropList._dropLists.find((/**\n                     * @param {?} list\n                     * @return {?}\n                     */\n                    list => list.id === drop)))) : drop;\n            }));\n            if (this._group) {\n                this._group._items.forEach((/**\n                 * @param {?} drop\n                 * @return {?}\n                 */\n                drop => {\n                    if (siblings.indexOf(drop) === -1) {\n                        siblings.push(drop);\n                    }\n                }));\n            }\n            ref.disabled = this.disabled;\n            ref.lockAxis = this.lockAxis;\n            ref.sortingDisabled = this.sortingDisabled;\n            ref.autoScrollDisabled = this.autoScrollDisabled;\n            ref\n                .connectedTo(siblings.filter((/**\n             * @param {?} drop\n             * @return {?}\n             */\n            drop => drop && drop !== this)).map((/**\n             * @param {?} list\n             * @return {?}\n             */\n            list => list._dropListRef)))\n                .withOrientation(this.orientation);\n        }));\n    }\n    /**\n     * Handles events from the underlying DropListRef.\n     * @private\n     * @param {?} ref\n     * @return {?}\n     */\n    _handleEvents(ref) {\n        ref.beforeStarted.subscribe((/**\n         * @return {?}\n         */\n        () => {\n            this._changeDetectorRef.markForCheck();\n        }));\n        ref.entered.subscribe((/**\n         * @param {?} event\n         * @return {?}\n         */\n        event => {\n            this.entered.emit({\n                container: this,\n                item: event.item.data,\n                currentIndex: event.currentIndex\n            });\n        }));\n        ref.exited.subscribe((/**\n         * @param {?} event\n         * @return {?}\n         */\n        event => {\n            this.exited.emit({\n                container: this,\n                item: event.item.data\n            });\n            this._changeDetectorRef.markForCheck();\n        }));\n        ref.sorted.subscribe((/**\n         * @param {?} event\n         * @return {?}\n         */\n        event => {\n            this.sorted.emit({\n                previousIndex: event.previousIndex,\n                currentIndex: event.currentIndex,\n                container: this,\n                item: event.item.data\n            });\n        }));\n        ref.dropped.subscribe((/**\n         * @param {?} event\n         * @return {?}\n         */\n        event => {\n            this.dropped.emit({\n                previousIndex: event.previousIndex,\n                currentIndex: event.currentIndex,\n                previousContainer: event.previousContainer.data,\n                container: event.container.data,\n                item: event.item.data,\n                isPointerOverContainer: event.isPointerOverContainer,\n                distance: event.distance\n            });\n            // Mark for check since all of these events run outside of change\n            // detection and we're not guaranteed for something else to have triggered it.\n            this._changeDetectorRef.markForCheck();\n        }));\n    }\n}\nCdkDropList.ɵfac = function CdkDropList_Factory(t) { return new (t || CdkDropList)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(DragDrop), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc2.Directionality, 8), ɵngcc0.ɵɵdirectiveInject(CdkDropListGroup, 12)); };\nCdkDropList.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkDropList, selectors: [[\"\", \"cdkDropList\", \"\"], [\"cdk-drop-list\"]], contentQueries: function CdkDropList_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {\n        ɵngcc0.ɵɵcontentQuery(dirIndex, CdkDrag, 4);\n    } if (rf & 2) {\n        let _t;\n        ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx._draggables = _t);\n    } }, hostAttrs: [1, \"cdk-drop-list\"], hostVars: 7, hostBindings: function CdkDropList_HostBindings(rf, ctx) { if (rf & 2) {\n        ɵngcc0.ɵɵhostProperty(\"id\", ctx.id);\n        ɵngcc0.ɵɵclassProp(\"cdk-drop-list-disabled\", ctx.disabled)(\"cdk-drop-list-dragging\", ctx._dropListRef.isDragging())(\"cdk-drop-list-receiving\", ctx._dropListRef.isReceiving());\n    } }, inputs: { connectedTo: [\"cdkDropListConnectedTo\", \"connectedTo\"], orientation: [\"cdkDropListOrientation\", \"orientation\"], id: \"id\", enterPredicate: [\"cdkDropListEnterPredicate\", \"enterPredicate\"], autoScrollDisabled: [\"cdkDropListAutoScrollDisabled\", \"autoScrollDisabled\"], disabled: [\"cdkDropListDisabled\", \"disabled\"], sortingDisabled: [\"cdkDropListSortingDisabled\", \"sortingDisabled\"], data: [\"cdkDropListData\", \"data\"], lockAxis: [\"cdkDropListLockAxis\", \"lockAxis\"] }, outputs: { dropped: \"cdkDropListDropped\", entered: \"cdkDropListEntered\", exited: \"cdkDropListExited\", sorted: \"cdkDropListSorted\" }, exportAs: [\"cdkDropList\"], features: [ɵngcc0.ɵɵProvidersFeature([\n            // Prevent child drop lists from picking up the same group as their parent.\n            { provide: CdkDropListGroup, useValue: ɵ0 },\n            { provide: CDK_DROP_LIST_CONTAINER, useExisting: CdkDropList },\n        ])] });\n/**\n * Keeps track of the drop lists that are currently on the page.\n */\nCdkDropList._dropLists = [];\n/** @nocollapse */\nCdkDropList.ctorParameters = () => [\n    { type: ElementRef },\n    { type: DragDrop },\n    { type: ChangeDetectorRef },\n    { type: Directionality, decorators: [{ type: Optional }] },\n    { type: CdkDropListGroup, decorators: [{ type: Optional }, { type: SkipSelf }] }\n];\nCdkDropList.propDecorators = {\n    _draggables: [{ type: ContentChildren, args: [forwardRef((/**\n                 * @return {?}\n                 */\n                () => CdkDrag)), {\n                    // Explicitly set to false since some of the logic below makes assumptions about it.\n                    // The `.withItems` call below should be updated if we ever need to switch this to `true`.\n                    descendants: false\n                },] }],\n    connectedTo: [{ type: Input, args: ['cdkDropListConnectedTo',] }],\n    data: [{ type: Input, args: ['cdkDropListData',] }],\n    orientation: [{ type: Input, args: ['cdkDropListOrientation',] }],\n    id: [{ type: Input }],\n    lockAxis: [{ type: Input, args: ['cdkDropListLockAxis',] }],\n    disabled: [{ type: Input, args: ['cdkDropListDisabled',] }],\n    sortingDisabled: [{ type: Input, args: ['cdkDropListSortingDisabled',] }],\n    enterPredicate: [{ type: Input, args: ['cdkDropListEnterPredicate',] }],\n    autoScrollDisabled: [{ type: Input, args: ['cdkDropListAutoScrollDisabled',] }],\n    dropped: [{ type: Output, args: ['cdkDropListDropped',] }],\n    entered: [{ type: Output, args: ['cdkDropListEntered',] }],\n    exited: [{ type: Output, args: ['cdkDropListExited',] }],\n    sorted: [{ type: Output, args: ['cdkDropListSorted',] }]\n};\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkDropList, [{\n        type: Directive,\n        args: [{\n                selector: '[cdkDropList], cdk-drop-list',\n                exportAs: 'cdkDropList',\n                providers: [\n                    // Prevent child drop lists from picking up the same group as their parent.\n                    { provide: CdkDropListGroup, useValue: ɵ0 },\n                    { provide: CDK_DROP_LIST_CONTAINER, useExisting: CdkDropList },\n                ],\n                host: {\n                    'class': 'cdk-drop-list',\n                    '[id]': 'id',\n                    '[class.cdk-drop-list-disabled]': 'disabled',\n                    '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',\n                    '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()'\n                }\n            }]\n    }], function () { return [{ type: ɵngcc0.ElementRef }, { type: DragDrop }, { type: ɵngcc0.ChangeDetectorRef }, { type: ɵngcc2.Directionality, decorators: [{\n                type: Optional\n            }] }, { type: CdkDropListGroup, decorators: [{\n                type: Optional\n            }, {\n                type: SkipSelf\n            }] }]; }, { connectedTo: [{\n            type: Input,\n            args: ['cdkDropListConnectedTo']\n        }], orientation: [{\n            type: Input,\n            args: ['cdkDropListOrientation']\n        }], id: [{\n            type: Input\n        }], enterPredicate: [{\n            type: Input,\n            args: ['cdkDropListEnterPredicate']\n        }], autoScrollDisabled: [{\n            type: Input,\n            args: ['cdkDropListAutoScrollDisabled']\n        }], dropped: [{\n            type: Output,\n            args: ['cdkDropListDropped']\n        }], entered: [{\n            type: Output,\n            args: ['cdkDropListEntered']\n        }], exited: [{\n            type: Output,\n            args: ['cdkDropListExited']\n        }], sorted: [{\n            type: Output,\n            args: ['cdkDropListSorted']\n        }], disabled: [{\n            type: Input,\n            args: ['cdkDropListDisabled']\n        }], sortingDisabled: [{\n            type: Input,\n            args: ['cdkDropListSortingDisabled']\n        }], _draggables: [{\n            type: ContentChildren,\n            args: [forwardRef(( /**\n                             * @return {?}\n                             */() => CdkDrag)), {\n                    // Explicitly set to false since some of the logic below makes assumptions about it.\n                    // The `.withItems` call below should be updated if we ever need to switch this to `true`.\n                    descendants: false\n                }]\n        }], data: [{\n            type: Input,\n            args: ['cdkDropListData']\n        }], lockAxis: [{\n            type: Input,\n            args: ['cdkDropListLockAxis']\n        }] }); })();\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\nclass DragDropModule {\n}\nDragDropModule.ɵfac = function DragDropModule_Factory(t) { return new (t || DragDropModule)(); };\nDragDropModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: DragDropModule });\nDragDropModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({ providers: [\n        DragDrop,\n    ] });\n(function () { (typeof ngDevMode === \"undefined\" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(DragDropModule, [{\n        type: NgModule,\n        args: [{\n                declarations: [\n                    CdkDropList,\n                    CdkDropListGroup,\n                    CdkDrag,\n                    CdkDragHandle,\n                    CdkDragPreview,\n                    CdkDragPlaceholder,\n                ],\n                exports: [\n                    CdkDropList,\n                    CdkDropListGroup,\n                    CdkDrag,\n                    CdkDragHandle,\n                    CdkDragPreview,\n                    CdkDragPlaceholder,\n                ],\n                providers: [\n                    DragDrop,\n                ]\n            }]\n    }], null, null); })();\n(function () { (typeof ngJitMode === \"undefined\" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(DragDropModule, { declarations: [CdkDropList, CdkDropListGroup, CdkDrag, CdkDragHandle, CdkDragPreview, CdkDragPlaceholder], exports: [CdkDropList, CdkDropListGroup, CdkDrag, CdkDragHandle, CdkDragPreview, CdkDragPlaceholder] }); })();\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\nexport { DragDrop, DragRef, DropListRef, CdkDropList, CDK_DROP_LIST, CDK_DROP_LIST_CONTAINER, moveItemInArray, transferArrayItem, copyArrayItem, DragDropModule, DragDropRegistry, CdkDropListGroup, CDK_DRAG_CONFIG_FACTORY, CDK_DRAG_CONFIG, CdkDrag, CdkDragHandle, CdkDragPreview, CdkDragPlaceholder, CDK_DRAG_PARENT as ɵb };\n\n//# sourceMappingURL=drag-drop.js.map","import {\n  Component,\n  EventEmitter,\n  HostListener,\n  OnInit,\n  Output,\n  TemplateRef,\n  ViewChild\n} from '@angular/core';\nimport { AttestationService } from '@app/modules/document/pages/attestation/attestation.service';\nimport { OrientationService } from '@app/modules/document/pages/orientation/orientation.service';\nimport { ExamService } from '@app/modules/document/services/exam.service';\nimport { PrescriptionService } from '@app/modules/document/services/prescription.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\nimport { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';\n\n@Component({\n  selector: 'app-listing-modal',\n  templateUrl: './listing-modal.component.html',\n  styleUrls: ['./listing-modal.component.scss']\n})\nexport class ListingModalComponent implements OnInit {\n  @Output()\n  close: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n  tplModal: NzModalRef;\n\n  @ViewChild('tplTitle', { static: true })\n  tplTitle: TemplateRef<{}>;\n\n  @ViewChild('tplContent', { static: true })\n  tplContent: TemplateRef<{}>;\n\n  @ViewChild('tplFooter', { static: true })\n  tplFooter: TemplateRef<{}>;\n\n  user: any;\n  prescriptions: any;\n  attestations: any;\n  exams: any;\n  orientations: any;\n  pageSize = 7;\n  loading: boolean;\n  selectedTabIndex = 0;\n  selectedTab = 'prescription';\n\n  tabs = [];\n  paginationData = [\n    { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 },\n    { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 },\n    { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 },\n    { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 }\n  ];\n  constructor(\n    private modalService: NzModalService,\n    private prescriptionService: PrescriptionService,\n    private attestationsService: AttestationService,\n    private orientationsService: OrientationService,\n    private examsService: ExamService\n  ) {}\n\n  ngOnInit() {\n    this.tabs =\n      this.user && this.user.user.userType === 'pharmacy'\n        ? ['prescription', 'retentionOfThirdParties']\n        : ['prescription', 'attestation', 'exam', 'orientation'];\n  }\n\n  createTplModal(user: string, documents: any): void {\n    this.user = user;\n    const prescriptions = documents.prescriptions;\n    const attestations = documents.attestations;\n    const exams = documents.exams;\n    const orientations = documents.orientations;\n\n    this.prescriptions = prescriptions.prescriptions;\n    this.attestations = attestations.attestations;\n    this.exams = exams.exams;\n    this.orientations = orientations.orientations;\n\n    this.paginationData[0].totalRecord = prescriptions.totalRecord;\n    this.paginationData[1].totalRecord = attestations.totalRecord;\n    this.paginationData[2].totalRecord = exams.totalRecord;\n    this.paginationData[3].totalRecord = orientations.totalRecord;\n    this.tplModal = this.modalService.create({\n      nzTitle: this.tplTitle,\n      nzContent: this.tplContent,\n      nzFooter: this.tplFooter,\n      nzClosable: true,\n      nzWidth: 828,\n      nzMaskClosable: true,\n      nzOnCancel: () => {\n        this.prescriptions = null;\n        this.attestations = null;\n        this.exams = null;\n      },\n      nzWrapClassName: 'vertical-center-modal',\n      nzOnOk: () => console.log('Click ok')\n    });\n  }\n\n  destroyTplModal(): void {\n    this.tplModal.destroy();\n  }\n\n  @HostListener('document:keydown.escape', ['$event'])\n  onKeydownHandler(event: KeyboardEvent) {\n    this.destroyTplModal();\n  }\n\n  tabChange(args: any): void {\n    this.selectedTabIndex = args.index;\n    this.selectedTab = this.tabs[this.selectedTabIndex];\n  }\n\n  @nativeAsync\n  async downloadPrescriptionPdf(prescription) {\n    try {\n      this.loading = true;\n      await this.prescriptionService.downloadOrGeneratePdf(prescription.code);\n    } catch (err) {\n      console.error(err);\n    }\n    this.loading = false;\n  }\n  @nativeAsync\n  async pageIndexChanged(pageIndex: any) {\n    this.paginationData[this.selectedTabIndex].skip = this.pageSize * (pageIndex - 1);\n    await this.loadData();\n  }\n  @nativeAsync\n  async loadData() {\n    try {\n      switch (this.selectedTab) {\n        case 'prescription':\n          await this.loadPrescriptions();\n          break;\n        case 'attestation':\n          await this.loadAttestations();\n          break;\n        case 'orientation':\n          await this.loadOrientations();\n          break;\n        default:\n          await this.loadExams();\n      }\n      // this.loadingFilter = false;\n    } catch (error) {\n      // this.loadingFilter = false;\n    }\n  }\n  @nativeAsync\n  async loadPrescriptions() {\n    let result = null;\n    switch (this.user.userType) {\n      case 'healthProfessional':\n        result = await this.prescriptionService\n          .getPrescriptionsByPrescriberUserId(this.user._id, {\n            skip: this.paginationData[this.selectedTabIndex].skip,\n            limit: this.pageSize,\n            orderBy: 'updatedAt',\n            sortOrder: -1\n          })\n          .toPromise();\n        break;\n\n      default:\n        result = await this.prescriptionService\n          .getPrescriptionsByPatientId(this.user._id, {\n            skip: this.paginationData[this.selectedTabIndex].skip,\n            limit: this.pageSize,\n            orderBy: 'updatedAt',\n            sortOrder: -1\n          })\n          .toPromise();\n    }\n    if (result) {\n      this.prescriptions = result.prescriptions;\n      this.paginationData[0].totalRecord = result.totalRecord;\n    }\n  }\n  @nativeAsync\n  async loadAttestations() {\n    let result = null;\n    switch (this.user.userType) {\n      case 'healthProfessional':\n        result = await this.attestationsService\n          .getAttestationsByPrescriberUserId(this.user._id, {\n            skip: this.paginationData[this.selectedTabIndex].skip,\n            limit: this.pageSize,\n            orderBy: 'updatedAt',\n            sortOrder: -1\n          })\n          .toPromise();\n        break;\n\n      default:\n        result = await this.attestationsService\n          .getAttestationsByPatientId(this.user._id, {\n            skip: this.paginationData[this.selectedTabIndex].skip,\n            limit: this.pageSize,\n            orderBy: 'updatedAt',\n            sortOrder: -1\n          })\n          .toPromise();\n    }\n    if (result) {\n      this.prescriptions = result.prescriptions;\n      this.paginationData[0].totalRecord = result.totalRecord;\n    }\n  }\n  @nativeAsync\n  async loadOrientations() {\n    let result = null;\n    switch (this.user.userType) {\n      case 'healthProfessional':\n        result = await this.orientationsService\n          .getOrientationsByPrescriberUserId(this.user._id, {\n            skip: this.paginationData[this.selectedTabIndex].skip,\n            limit: this.pageSize,\n            orderBy: 'updatedAt',\n            sortOrder: -1\n          })\n          .toPromise();\n        break;\n\n      default:\n        result = await this.orientationsService\n          .getOrientationsByPatientId(this.user._id, {\n            skip: this.paginationData[this.selectedTabIndex].skip,\n            limit: this.pageSize,\n            orderBy: 'updatedAt',\n            sortOrder: -1\n          })\n          .toPromise();\n    }\n    if (result) {\n      this.prescriptions = result.prescriptions;\n      this.paginationData[0].totalRecord = result.totalRecord;\n    }\n  }\n  @nativeAsync\n  async loadExams() {\n    let result = null;\n    switch (this.user.userType) {\n      case 'healthProfessional':\n        result = await this.examsService\n          .getExamsByPrescriberUserId(this.user._id, {\n            skip: this.paginationData[this.selectedTabIndex].skip,\n            limit: this.pageSize,\n            orderBy: 'updatedAt',\n            sortOrder: -1\n          })\n          .toPromise();\n        break;\n\n      default:\n        result = await this.examsService\n          .getExamsByPatientId(this.user._id, {\n            skip: this.paginationData[this.selectedTabIndex].skip,\n            limit: this.pageSize,\n            orderBy: 'updatedAt',\n            sortOrder: -1\n          })\n          .toPromise();\n    }\n    if (result) {\n      this.prescriptions = result.prescriptions;\n      this.paginationData[0].totalRecord = result.totalRecord;\n    }\n  }\n}\n","export default \"<ng-template #tplContent>\\n  <div>\\n    <nz-tabset (nzSelectChange)=\\\"tabChange($event)\\\">\\n      <nz-tab nzTitle=\\\"Receitas locais\\\">\\n        <nz-table\\n          #nzTable\\n          [nzData]=\\\"prescriptions\\\"\\n          [nzLoading]=\\\"loading\\\"\\n          [nzTotal]=\\\"paginationData[0].totalRecord\\\"\\n          [nzPageSize]=\\\"pageSize\\\"\\n          nzFrontPagination=\\\"false\\\"\\n          (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n          nzNoResult=\\\"Você não possui nenhuma prescrição\\\"\\n          [nzScroll]=\\\"scrollConfigReceitasLocais\\\"\\n        >\\n          <thead nzAlign=\\\"center\\\" (nzSortChange)=\\\"onSortChange($event)\\\">\\n            <tr>\\n              <th nzShowExpand></th>\\n              <th *ngIf=\\\"user.user.userType == 'pharmacy'\\\" nzShowSort nzSortKey=\\\"updatedAt\\\">\\n                Data da Dispensação\\n              </th>\\n              <th\\n                *ngIf=\\\"user.user.userType == 'patient' || user.user.userType == 'healthProfessional'\\\"\\n                nzShowSort\\n                nzSortKey=\\\"updatedAt\\\"\\n              >\\n                Data de atualização\\n              </th>\\n              <th>Código da prescrição</th>\\n              <th *ngIf=\\\"user.user.userType == 'pharmacy'\\\">CPF do comprador</th>\\n              <th *ngIf=\\\"user.user.userType == 'pharmacy'\\\">Código da dispensação</th>\\n              <th *ngIf=\\\"user.user.userType == 'pharmacy'\\\">Registro do Prescritor</th>\\n              <th *ngIf=\\\"user.user.userType == 'patient'\\\" nzShowSort nzSortKey=\\\"healthProfessional.name\\\">\\n                Médico(a)/Dentista Prescritor(a)\\n              </th>\\n              <th *ngIf=\\\"user.user.userType == 'healthProfessional'\\\" nzShowSort nzSortKey=\\\"patient.name\\\">\\n                Paciente\\n              </th>\\n              <th>Status</th>\\n              <th>Prescrição</th>\\n            </tr>\\n          </thead>\\n          <tbody>\\n            <ng-template\\n              ngFor\\n              let-item\\n              [ngForOf]=\\\"nzTable.data\\\"\\n              *ngIf=\\\"user.user.userType == 'pharmacy'\\\"\\n            >\\n              <ng-container>\\n                <tr>\\n                  <td nzShowExpand [(nzExpand)]=\\\"item.expand\\\"></td>\\n                  <td>{{ item.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n                  <td>{{ item.prescription?.code }}</td>\\n                  <td>{{ item?.cpfBuyer | formattedCpf }}</td>\\n                  <td>{{ item.dispensationCode }}</td>\\n                  <td>\\n                    {{ item.healthProfessional.regionalCouncilNumber.number }}\\n                  </td>\\n                  <td>{{ item.prescription?.status }}</td>\\n                  <td>\\n                    <div class=\\\"row\\\">\\n                      <div class=\\\"col-3\\\">\\n                        <div\\n                          (click)=\\\"\\n                            downloadPrescriptionPdf({\\n                              code: item.prescription.code,\\n                              patient: item.patient\\n                            })\\n                          \\\"\\n                          title=\\\"Baixar prescrição\\\"\\n                        >\\n                          <i\\n                            nz-icon\\n                            nzType=\\\"file-pdf\\\"\\n                            nzTheme=\\\"twotone\\\"\\n                            nzTwotoneColor=\\\"#B22222\\\"\\n                            class=\\\"icon-pdf\\\"\\n                          ></i>\\n                        </div>\\n                      </div>\\n                      <div class=\\\"col-3\\\">\\n                        <a\\n                          title=\\\"Cancelar Retenção\\\"\\n                          (click)=\\\"showModalCancelRetention(item)\\\"\\n                          *ngIf=\\\"\\n                            item.prescription.status == 'Dispensada' ||\\n                            item.prescription.status == 'Dispensada Parcial' ||\\n                            item.prescription.status == 'Dispensada Total'\\n                          \\\"\\n                        >\\n                          <i class=\\\"fa fa-trash-solid\\\"></i>\\n                        </a>\\n                      </div>\\n                    </div>\\n                  </td>\\n                </tr>\\n                <tr [(nzExpand)]=\\\"item.expand\\\" *ngFor=\\\"let medicament of item.medicaments\\\">\\n                  <td></td>\\n                  <td colspan=\\\"5\\\">\\n                    <span class=\\\"title\\\"> {{ getPreWriterInfo(item).label }}: </span>\\n                    <span>{{ getPreWriterInfo(item).name }}</span>\\n                    <br />\\n                    <div class=\\\"d-flex\\\">\\n                      <span class=\\\"title\\\"> Medicamento: </span>\\n                      <span class=\\\"break-line\\\"> {{ medicament.description }}</span>\\n                    </div>\\n                    <span class=\\\"title\\\"> Quantidade prescrita: </span\\n                    ><span> {{ medicament.prescribedQuantity }}</span>\\n                    <br />\\n                    <span class=\\\"title\\\"> Quantidade retida: </span\\n                    ><span> {{ medicament.quantityRetained }}</span>\\n                  </td>\\n                </tr>\\n              </ng-container>\\n            </ng-template>\\n\\n            <ng-template\\n              ngFor\\n              let-item\\n              [ngForOf]=\\\"nzTable.data\\\"\\n              *ngIf=\\\"user.user.userType == 'patient' || user.user.userType == 'healthProfessional'\\\"\\n            >\\n              <ng-container>\\n                <tr>\\n                  <td nzShowExpand [(nzExpand)]=\\\"item.expand\\\"></td>\\n                  <td>{{ item.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n                  <td>{{ item.code }}</td>\\n                  <td *ngIf=\\\"user.user.userType == 'patient'\\\">\\n                    {{ item.healthProfessional?.name }}\\n                  </td>\\n                  <td *ngIf=\\\"user.user.userType == 'healthProfessional'\\\">\\n                    {{ item.patient?.name }}\\n                  </td>\\n                  <td>{{ item.status }}</td>\\n                  <td>\\n                    <div class=\\\"row\\\">\\n                      <div class=\\\"col-3\\\">\\n                        <div (click)=\\\"downloadPrescriptionPdf(item)\\\" title=\\\"Baixar prescrição\\\">\\n                          <i\\n                            nz-icon\\n                            nzType=\\\"file-pdf\\\"\\n                            nzTheme=\\\"twotone\\\"\\n                            nzTwotoneColor=\\\"#B22222\\\"\\n                            class=\\\"icon-pdf\\\"\\n                          ></i>\\n                        </div>\\n                      </div>\\n\\n                      <div\\n                        *ngIf=\\\"\\n                          user.user.userType == 'healthProfessional' && item.status !== 'Não Assinada'\\n                        \\\"\\n                        class=\\\"col-3\\\"\\n                      >\\n                        <a title=\\\"Repetir prescrição\\\" (click)=\\\"navigateToNew(item.code, 'prescription')\\\">\\n                          <i class=\\\"fa fa-repeat\\\"></i>\\n                        </a>\\n                      </div>\\n\\n                      <div\\n                        *ngIf=\\\"\\n                          user.user.userType == 'healthProfessional' && item.status === 'Não Assinada'\\n                        \\\"\\n                        class=\\\"col-3\\\"\\n                      >\\n                        <a title=\\\"Editar prescrição\\\" (click)=\\\"navigateToEdit(item.code, 'prescription')\\\">\\n                          <i class=\\\"fa fa-pencil-solid\\\"></i>\\n                        </a>\\n                      </div>\\n\\n                      <div class=\\\"col-3\\\">\\n                        <a\\n                          title=\\\"Cancelar prescrição\\\"\\n                          (click)=\\\"showModalCancelPrescrition(item)\\\"\\n                          *ngIf=\\\"\\n                            (item.status === 'Não Assinada' || item.status === 'Assinada') &&\\n                            user.user.userType == 'healthProfessional'\\n                          \\\"\\n                        >\\n                          <i class=\\\"fa fa-trash-solid\\\"></i>\\n                        </a>\\n                      </div>\\n                    </div>\\n                  </td>\\n                </tr>\\n                <tr [nzExpand]=\\\"item.expand\\\">\\n                  <td></td>\\n                  <td colspan=\\\"4\\\">\\n                    <div *ngFor=\\\"let medicament of item.medicaments; let i = index\\\" class=\\\"row\\\">\\n                      <div class=\\\"col-sm\\\">\\n                        {{ i + 1 }} <span>) {{ medicament.name }}</span>\\n                      </div>\\n                      <div class=\\\"col-sm\\\">\\n                        <span>{{ medicament.dosage }}</span>\\n                      </div>\\n                      <div class=\\\"col-sm\\\">\\n                        <span>[{{ medicament.prescribedQuantity }}] Embalagem</span>\\n                      </div>\\n                    </div>\\n                  </td>\\n                </tr>\\n              </ng-container>\\n            </ng-template>\\n          </tbody>\\n        </nz-table>\\n      </nz-tab>\\n      <nz-tab\\n        nzTitle=\\\"Atestados\\\"\\n        *ngIf=\\\"user.user.userType == 'healthProfessional' || user.user.userType == 'patient'\\\"\\n      >\\n        <nz-table\\n          #nzTable\\n          [nzData]=\\\"attestations\\\"\\n          [nzLoading]=\\\"loading\\\"\\n          [nzTotal]=\\\"paginationData[1].totalRecord\\\"\\n          [nzPageSize]=\\\"pageSize\\\"\\n          (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n          nzFrontPagination=\\\"false\\\"\\n          nzNoResult=\\\"Você não possui nenhum atestado\\\"\\n          [nzScroll]=\\\"scrollConfigAtestados\\\"\\n        >\\n          <thead nzAlign=\\\"center\\\" (nzSortChange)=\\\"onSortChange($event)\\\">\\n            <tr>\\n              <th nzShowSort nzSortKey=\\\"updatedAt\\\">\\n                Data de atualização\\n              </th>\\n              <th>Código do atestado</th>\\n              <th *ngIf=\\\"user.user.userType == 'pharmacy'\\\">Registro do Prescritor</th>\\n              <th *ngIf=\\\"user.user.userType == 'patient'\\\">Médico(a)/Dentista Prescritor(a)</th>\\n              <th *ngIf=\\\"user.user.userType == 'healthProfessional'\\\" nzShowSort nzSortKey=\\\"patient.name\\\">\\n                Paciente\\n              </th>\\n              <th *ngIf=\\\"user.user.userType != 'pharmacy'\\\">Atestado</th>\\n            </tr>\\n          </thead>\\n          <tbody>\\n            <ng-template\\n              ngFor\\n              let-item\\n              [ngForOf]=\\\"nzTable.data\\\"\\n              *ngIf=\\\"user.user.userType == 'patient' || user.user.userType == 'healthProfessional'\\\"\\n            >\\n              <ng-container>\\n                <tr>\\n                  <td>{{ item.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n                  <td>{{ item.code }}</td>\\n                  <td *ngIf=\\\"user.user.userType == 'patient'\\\">\\n                    {{ item.healthProfessional?.name }}\\n                  </td>\\n                  <td *ngIf=\\\"user.user.userType == 'healthProfessional'\\\">\\n                    {{ item.patient?.name }}\\n                  </td>\\n                  <td>\\n                    <div class=\\\"row\\\">\\n                      <div class=\\\"col-3\\\">\\n                        <div (click)=\\\"downloadPrescriptionPdf(item)\\\" title=\\\"Baixar atestado\\\">\\n                          <i\\n                            nz-icon\\n                            nzType=\\\"file-pdf\\\"\\n                            nzTheme=\\\"twotone\\\"\\n                            nzTwotoneColor=\\\"#B22222\\\"\\n                            class=\\\"icon-pdf\\\"\\n                          ></i>\\n                        </div>\\n                      </div>\\n                      <div\\n                        *ngIf=\\\"\\n                          user.user.userType == 'healthProfessional' && item.status === 'Não Assinada'\\n                        \\\"\\n                        class=\\\"col-3\\\"\\n                      >\\n                        <a title=\\\"Editar atestado\\\" (click)=\\\"navigateToEdit(item.code, 'attestation')\\\">\\n                          <i class=\\\"fa fa-pencil-solid\\\"></i>\\n                        </a>\\n                      </div>\\n\\n                      <div\\n                        *ngIf=\\\"\\n                          user.user.userType == 'healthProfessional' && item.status !== 'Não Assinada'\\n                        \\\"\\n                        class=\\\"col-3\\\"\\n                      >\\n                        <a title=\\\"Repetir atestado\\\" (click)=\\\"navigateToNew(item.code, 'attestation')\\\">\\n                          <i class=\\\"fa fa-repeat\\\"></i>\\n                        </a>\\n                      </div>\\n\\n                      <div class=\\\"col-3\\\">\\n                        <a\\n                          title=\\\"Cancelar atestado\\\"\\n                          (click)=\\\"showModalCancelAttestation(item)\\\"\\n                          *ngIf=\\\"\\n                            (item.status === 'Não Assinada' || item.status === 'Assinada') &&\\n                            user.user.userType == 'healthProfessional'\\n                          \\\"\\n                        >\\n                          <i class=\\\"fa fa-trash-solid\\\"></i>\\n                        </a>\\n                      </div>\\n                    </div>\\n                  </td>\\n                </tr>\\n                <tr [nzExpand]=\\\"item.expand\\\"></tr>\\n              </ng-container>\\n            </ng-template>\\n          </tbody>\\n        </nz-table>\\n      </nz-tab>\\n\\n      <nz-tab\\n        nzTitle=\\\"Exames\\\"\\n        *ngIf=\\\"user.user.userType == 'healthProfessional' || user.user.userType == 'patient'\\\"\\n      >\\n        <nz-table\\n          #nzTable\\n          [nzData]=\\\"exams\\\"\\n          [nzLoading]=\\\"loading\\\"\\n          nzFrontPagination=\\\"false\\\"\\n          [nzPageSize]=\\\"pageSize\\\"\\n          [nzTotal]=\\\"paginationData[2].totalRecord\\\"\\n          (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n          [nzNoResult]=\\\"'Você não possui nenhum exame.'\\\"\\n          [nzScroll]=\\\"scrollConfigExames\\\"\\n        >\\n          <thead nzAlign=\\\"center\\\" (nzSortChange)=\\\"onSortChange($event)\\\">\\n            <tr>\\n              <th nzShowSort nzSortKey=\\\"updatedAt\\\">\\n                Data de atualização\\n              </th>\\n              <th>Código do exame</th>\\n              <th *ngIf=\\\"user.user.userType == 'pharmacy'\\\">Registro do Prescritor</th>\\n              <th *ngIf=\\\"user.user.userType == 'patient'\\\">Médico(a)/Dentista Prescritor(a)</th>\\n              <th *ngIf=\\\"user.user.userType == 'healthProfessional'\\\" nzShowSort nzSortKey=\\\"patient.name\\\">\\n                Paciente\\n              </th>\\n              <th *ngIf=\\\"user.user.userType != 'pharmacy'\\\">Exame</th>\\n            </tr>\\n          </thead>\\n          <tbody>\\n            <ng-template\\n              ngFor\\n              let-item\\n              [ngForOf]=\\\"nzTable.data\\\"\\n              *ngIf=\\\"user.user.userType == 'patient' || user.user.userType == 'healthProfessional'\\\"\\n            >\\n              <ng-container>\\n                <tr>\\n                  <td>{{ item.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n                  <td>{{ item.code }}</td>\\n                  <td *ngIf=\\\"user.user.userType == 'patient'\\\">\\n                    {{ item.healthProfessional?.name }}\\n                  </td>\\n                  <td *ngIf=\\\"user.user.userType == 'healthProfessional'\\\">\\n                    {{ item.patient?.name }}\\n                  </td>\\n                  <td>\\n                    <div class=\\\"row\\\">\\n                      <div class=\\\"col-3\\\">\\n                        <div (click)=\\\"downloadPrescriptionPdf(item)\\\" title=\\\"Baixar exame\\\">\\n                          <i\\n                            nz-icon\\n                            nzType=\\\"file-pdf\\\"\\n                            nzTheme=\\\"twotone\\\"\\n                            nzTwotoneColor=\\\"#B22222\\\"\\n                            class=\\\"icon-pdf\\\"\\n                          ></i>\\n                        </div>\\n                      </div>\\n                      <div\\n                        *ngIf=\\\"\\n                          user.user.userType == 'healthProfessional' && item.status === 'Não Assinada'\\n                        \\\"\\n                        class=\\\"col-3\\\"\\n                      >\\n                        <a title=\\\"Editar exame\\\" (click)=\\\"navigateToEdit(item.code, 'exam')\\\">\\n                          <i class=\\\"fa fa-pencil-solid\\\"></i>\\n                        </a>\\n                      </div>\\n\\n                      <div\\n                        *ngIf=\\\"\\n                          user.user.userType == 'healthProfessional' && item.status !== 'Não Assinada'\\n                        \\\"\\n                        class=\\\"col-3\\\"\\n                      >\\n                        <a title=\\\"Repetir exame\\\" (click)=\\\"navigateToNew(item.code, 'exam')\\\">\\n                          <i class=\\\"fa fa-repeat\\\"></i>\\n                        </a>\\n                      </div>\\n\\n                      <div class=\\\"col-3\\\">\\n                        <a\\n                          title=\\\"Cancelar exame\\\"\\n                          (click)=\\\"showModalCancelExam(item)\\\"\\n                          *ngIf=\\\"\\n                            (item.status === 'Não Assinada' || item.status === 'Assinada') &&\\n                            user.user.userType == 'healthProfessional'\\n                          \\\"\\n                        >\\n                          <i class=\\\"fa fa-trash-solid\\\"></i>\\n                        </a>\\n                      </div>\\n                    </div>\\n                  </td>\\n                </tr>\\n                <tr [nzExpand]=\\\"item.expand\\\"></tr>\\n              </ng-container>\\n            </ng-template>\\n          </tbody>\\n        </nz-table>\\n      </nz-tab>\\n      <nz-tab\\n        nzTitle=\\\"Outros documentos\\\"\\n        *ngIf=\\\"user.user.userType == 'healthProfessional' || user.user.userType == 'patient'\\\"\\n      >\\n        <nz-table\\n          #nzTable\\n          [nzData]=\\\"orientations\\\"\\n          [nzLoading]=\\\"loading\\\"\\n          nzFrontPagination=\\\"false\\\"\\n          [nzPageSize]=\\\"pageSize\\\"\\n          [nzTotal]=\\\"paginationData[3].totalRecord\\\"\\n          (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n          [nzNoResult]=\\\"'Você não possui nenhum documento de orientação.'\\\"\\n          [nzScroll]=\\\"scrollConfigOrientacoes\\\"\\n        >\\n          <thead nzAlign=\\\"center\\\" (nzSortChange)=\\\"onSortChange($event)\\\">\\n            <tr>\\n              <th nzShowSort nzSortKey=\\\"updatedAt\\\">\\n                Data de atualização\\n              </th>\\n              <th>Código da orientação</th>\\n              <th *ngIf=\\\"user.user.userType == 'pharmacy'\\\">Registro do Prescritor</th>\\n              <th *ngIf=\\\"user.user.userType == 'patient'\\\">Médico(a)/Dentista Prescritor(a)</th>\\n              <th *ngIf=\\\"user.user.userType == 'healthProfessional'\\\" nzShowSort nzSortKey=\\\"patient.name\\\">\\n                Paciente\\n              </th>\\n              <th>Status</th>\\n              <th *ngIf=\\\"user.user.userType != 'pharmacy'\\\">Orientação</th>\\n            </tr>\\n          </thead>\\n          <tbody>\\n            <ng-template\\n              ngFor\\n              let-item\\n              [ngForOf]=\\\"nzTable.data\\\"\\n              *ngIf=\\\"user.user.userType == 'patient' || user.user.userType == 'healthProfessional'\\\"\\n            >\\n              <ng-container>\\n                <tr>\\n                  <td>{{ item.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n                  <td>{{ item.code }}</td>\\n                  <td *ngIf=\\\"user.user.userType == 'patient'\\\">\\n                    {{ item.healthProfessional?.name }}\\n                  </td>\\n                  <td *ngIf=\\\"user.user.userType == 'healthProfessional'\\\">\\n                    {{ item.patient?.name }}\\n                  </td>\\n                  <td>\\n                    {{ item.status }}\\n                  </td>\\n                  <td>\\n                    <div class=\\\"row\\\">\\n                      <div class=\\\"col-3\\\">\\n                        <div (click)=\\\"downloadPrescriptionPdf(item)\\\" title=\\\"Baixar orientação\\\">\\n                          <i\\n                            nz-icon\\n                            nzType=\\\"file-pdf\\\"\\n                            nzTheme=\\\"twotone\\\"\\n                            nzTwotoneColor=\\\"#B22222\\\"\\n                            class=\\\"icon-pdf\\\"\\n                          ></i>\\n                        </div>\\n                      </div>\\n                      <div\\n                        *ngIf=\\\"\\n                          user.user.userType == 'healthProfessional' && item.status === 'Não Assinada'\\n                        \\\"\\n                        class=\\\"col-3\\\"\\n                      >\\n                        <a title=\\\"Editar orientação\\\" (click)=\\\"navigateToEdit(item.code, 'orientation')\\\">\\n                          <i class=\\\"fa fa-pencil-solid\\\"></i>\\n                        </a>\\n                      </div>\\n\\n                      <div\\n                        *ngIf=\\\"\\n                          user.user.userType == 'healthProfessional' && item.status !== 'Não Assinada'\\n                        \\\"\\n                        class=\\\"col-3\\\"\\n                      >\\n                        <a title=\\\"Repetir documento\\\" (click)=\\\"navigateToNew(item.code, 'orientation')\\\">\\n                          <i class=\\\"fa fa-repeat\\\"></i>\\n                        </a>\\n                      </div>\\n\\n                      <div class=\\\"col-3\\\">\\n                        <a\\n                          title=\\\"Cancelar documento\\\"\\n                          (click)=\\\"showModalCancelOrientation(item)\\\"\\n                          *ngIf=\\\"\\n                            (item.status === 'Não Assinada' || item.status === 'Assinada') &&\\n                            user.user.userType == 'healthProfessional'\\n                          \\\"\\n                        >\\n                          <i class=\\\"fa fa-trash-solid\\\"></i>\\n                        </a>\\n                      </div>\\n                    </div>\\n                  </td>\\n                </tr>\\n                <tr [nzExpand]=\\\"item.expand\\\"></tr>\\n              </ng-container>\\n            </ng-template>\\n          </tbody>\\n        </nz-table>\\n      </nz-tab>\\n      <nz-tab nzTitle=\\\"Receitas de terceiros\\\" *ngIf=\\\"user.user.userType == 'pharmacy'\\\">\\n        <nz-table\\n          #nzTable\\n          [nzData]=\\\"retentionOfThirdParties\\\"\\n          [nzLoading]=\\\"loading\\\"\\n          [nzTotal]=\\\"paginationData[1].totalRecord\\\"\\n          [nzPageSize]=\\\"pageSize\\\"\\n          (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n          nzFrontPagination=\\\"false\\\"\\n          nzNoResult=\\\"Você ainda não realizou nenhuma retenção\\\"\\n          [nzScroll]=\\\"scrollConfig\\\"\\n        >\\n          <thead nzAlign=\\\"center\\\">\\n            <tr>\\n              <th></th>\\n              <th>Data da Dispensação</th>\\n              <th>CPF do comprador</th>\\n              <th>Código da dispensação</th>\\n              <th>Registro do Prescritor</th>\\n              <th>Arquivo na base</th>\\n            </tr>\\n          </thead>\\n          <tbody *ngFor=\\\"let item of nzTable.data\\\">\\n            <tr>\\n              <td></td>\\n              <td>{{ item.dispensationDate | date: 'dd/MM/yyyy' }}</td>\\n              <td>{{ item?.cpfBuyer | formattedCpf }}</td>\\n              <td>{{ item.dispensationCode }}</td>\\n              <td>{{ item.preWriterRegister.number }}</td>\\n              <td>\\n                <div class=\\\"prescription\\\">\\n                  <div>\\n                    <a title=\\\"Baixar prescrição\\\" (click)=\\\"downloadPrescriptionPdfOfThirdParties(item)\\\">\\n                      <i\\n                        nz-icon\\n                        nzType=\\\"file-pdf\\\"\\n                        nzTheme=\\\"twotone\\\"\\n                        nzTwotoneColor=\\\"#B22222\\\"\\n                        class=\\\"icon-pdf\\\"\\n                      ></i>\\n                    </a>\\n                  </div>\\n                </div>\\n              </td>\\n            </tr>\\n          </tbody>\\n        </nz-table>\\n      </nz-tab>\\n    </nz-tabset>\\n  </div>\\n</ng-template>\\n\";","export default \"\";","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SharedModule } from '@app/shared';\nimport { HistoricModule } from '../historic/historic.module';\nimport { ListingModalComponent } from './listing-modal/listing-modal.component';\n\n@NgModule({\n  declarations: [ListingModalComponent],\n  imports: [CommonModule, HistoricModule, SharedModule],\n  exports: [ListingModalComponent]\n})\nexport class PrescriptionsModule {}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from '@angular/router';\nimport { AuthService } from '@app/core/services/auth.service';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class AdminGuard implements CanActivate {\n  constructor(private authService: AuthService) {}\n\n  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {\n    const user = this.authService.user();\n    return user.userType === 'admin';\n  }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, Router } from '@angular/router';\nimport { AuthService } from '@app/core/services/auth.service';\nimport { Permission } from '@app/shared/models/permission.enum';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class MasterGuard implements CanActivate {\n  constructor(private authService: AuthService, private router: Router) {}\n\n  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {\n    const user = this.authService.user();\n    if (user.permission === Permission.MASTER) {\n      return true;\n    }\n\n    this.router.navigate(['/admin']);\n    return false;\n  }\n}\n","export default \"<app-alternative-navbar></app-alternative-navbar>\\r\\n<app-menu></app-menu>\\r\\n\\r\\n<div class=\\\"container\\\">\\r\\n  <ng-container *ngIf=\\\"displayChart\\\">\\r\\n    <nz-form-label nzFor=\\\"tenantId\\\" theme>Sistema:</nz-form-label>\\r\\n    <nz-select [(ngModel)]=\\\"tenantId\\\" (ngModelChange)=\\\"initCharts()\\\" name=\\\"tenantId\\\" theme>\\r\\n      <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\"></nz-option>\\r\\n      <nz-option nzValue=\\\"RD\\\" nzLabel=\\\"RD\\\"></nz-option>\\r\\n      <nz-option nzValue=\\\"MRD\\\" nzLabel=\\\"MRD\\\"></nz-option>\\r\\n    </nz-select>\\r\\n\\r\\n    <div class=\\\"row\\\">\\r\\n      <app-my-pie-chart class=\\\"col-6\\\" title=\\\"Usuários\\\" [chart]=\\\"userChart\\\"></app-my-pie-chart>\\r\\n      <app-my-pie-chart class=\\\"col-6\\\" title=\\\"Documentos\\\" [chart]=\\\"documentsChart\\\"></app-my-pie-chart>\\r\\n      <app-my-pie-chart\\r\\n        class=\\\"col-6\\\"\\r\\n        title=\\\"Prescrições\\\"\\r\\n        [chart]=\\\"prescriptionsChart\\\"\\r\\n      ></app-my-pie-chart>\\r\\n      <app-my-pie-chart class=\\\"col-6\\\" title=\\\"Atestados\\\" [chart]=\\\"attestationsChart\\\"></app-my-pie-chart>\\r\\n      <app-my-pie-chart class=\\\"col-6\\\" title=\\\"Exames\\\" [chart]=\\\"examsChart\\\"></app-my-pie-chart>\\r\\n      <app-my-pie-chart\\r\\n        class=\\\"col-6\\\"\\r\\n        title=\\\"Outros documentos\\\"\\r\\n        [chart]=\\\"orientationsChart\\\"\\r\\n      ></app-my-pie-chart>\\r\\n    </div>\\r\\n  </ng-container>\\r\\n\\r\\n  <app-listing *ngIf=\\\"!displayChart\\\" [listingType]=\\\"queryParam\\\"></app-listing>\\r\\n</div>\\r\\n\";","import { Component, OnInit } from '@angular/core';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { AuthService } from '@app/core/services/auth.service';\r\nimport { DocumentService } from '@app/modules/document/services/document.service';\r\nimport { UserService } from '@app/modules/user/user.service';\r\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\r\nimport { MyPieChart } from '@app/shared/models/my-pie-chart';\r\nimport { AppToastService } from '@app/shared/services/app-toast.service';\r\n\r\n@Component({\r\n  selector: 'app-overview',\r\n  templateUrl: './overview.component.html',\r\n  styleUrls: ['./overview.component.scss']\r\n})\r\nexport class OverviewComponent implements OnInit {\r\n  queryParam: string;\r\n  displayChart = true;\r\n  userChart: MyPieChart;\r\n  documentsChart: MyPieChart;\r\n  prescriptionsChart: MyPieChart;\r\n  attestationsChart: MyPieChart;\r\n  examsChart: MyPieChart;\r\n  orientationsChart: MyPieChart;\r\n  retentionsChart: MyPieChart;\r\n\r\n  tenantId = 'RD';\r\n\r\n  constructor(\r\n    private route: ActivatedRoute,\r\n    private userService: UserService,\r\n    private documentService: DocumentService,\r\n    private notification: AppToastService,\r\n    private authService: AuthService,\r\n    private router: Router\r\n  ) {}\r\n\r\n  ngOnInit() {\r\n    this.checkParam();\r\n  }\r\n\r\n  @nativeAsync\r\n  async initCharts() {\r\n    this.userService.getQuantityUsers(this.tenantId).subscribe(data => {\r\n      const { patients, doctors, dentists, pharmacies, admins } = data;\r\n      this.userChart = {\r\n        data: [patients, doctors, dentists, pharmacies, admins],\r\n        pieChartLabels: ['Pacientes', 'Médicos', 'Dentistas', 'Farmácias', 'Administradores'],\r\n        pieChartColors: [\r\n          {\r\n            backgroundColor: [\r\n              'rgba(22,168,95,1)',\r\n              'rgba(232,74,58,1)',\r\n              'rgba(27,64,58,1)',\r\n              'rgba(26,224,194,1)',\r\n              'rgba(29,125,110,1)'\r\n            ]\r\n          }\r\n        ]\r\n      };\r\n    });\r\n\r\n    try {\r\n      const {\r\n        prescriptions,\r\n        attestations,\r\n        exams,\r\n        orientations,\r\n        retentions\r\n      } = await this.documentService.getTotals(this.tenantId).toPromise();\r\n\r\n      this.documentsChart = {\r\n        data: [\r\n          prescriptions.total,\r\n          attestations.total,\r\n          exams.total,\r\n          orientations.total,\r\n          retentions.total\r\n        ],\r\n        pieChartLabels: [\r\n          'Prescrições',\r\n          'Atestados',\r\n          'Pedidos de exame',\r\n          'Outros documentos',\r\n          'Retenções'\r\n        ],\r\n        pieChartColors: [\r\n          {\r\n            backgroundColor: [\r\n              'rgba(22,168,95,1)',\r\n              'rgba(232,74,58,1)',\r\n              'rgba(27,64,58,1)',\r\n              'rgba(26,224,194,1)',\r\n              'rgba(29,125,110,1)'\r\n            ]\r\n          }\r\n        ]\r\n      };\r\n\r\n      const pieChartColors = [\r\n        {\r\n          backgroundColor: [\r\n            'rgba(27,64,58,1)',\r\n            'rgba(22,168,95,1)',\r\n            'rgba(232,74,58,1)',\r\n            'rgba(29,125,110,1)',\r\n            'rgba(26,224,194,1)'\r\n          ]\r\n        }\r\n      ];\r\n      const statuses = [\r\n        'Assinada',\r\n        'Não Assinada',\r\n        'Excluída',\r\n        'Dispensada Total',\r\n        'Dispensada Parcial'\r\n      ];\r\n      this.prescriptionsChart = {\r\n        total: prescriptions.total,\r\n        data: statuses.map(s => prescriptions.status[s]).filter(item => !!item),\r\n        pieChartLabels: statuses.filter(st => Object.keys(prescriptions.status).find(s => s === st)),\r\n        pieChartColors\r\n      };\r\n\r\n      this.attestationsChart = {\r\n        total: attestations.total,\r\n        data: statuses.map(s => attestations.status[s]).filter(item => !!item),\r\n        pieChartLabels: statuses.filter(st => Object.keys(attestations.status).find(s => s === st)),\r\n        pieChartColors\r\n      };\r\n\r\n      this.examsChart = {\r\n        total: exams.total,\r\n        data: statuses.map(s => exams.status[s]).filter(item => !!item),\r\n        pieChartLabels: statuses.filter(st => Object.keys(exams.status).find(s => s === st)),\r\n        pieChartColors\r\n      };\r\n\r\n      this.orientationsChart = {\r\n        total: orientations.total,\r\n        data: statuses.map(s => orientations.status[s]).filter(item => !!item),\r\n        pieChartLabels: statuses.filter(st => Object.keys(orientations.status).find(s => s === st)),\r\n        pieChartColors\r\n      };\r\n    } catch (err) {\r\n      console.error(err);\r\n      if (err.status === 401) {\r\n        this.notification.notify('warning', 'Aviso', 'Acesso expirado. Realize o login novamente');\r\n        this.authService.logout();\r\n        this.router.navigate(['/entry/login']);\r\n      }\r\n    }\r\n  }\r\n\r\n  private checkParam() {\r\n    this.route.params.subscribe(params => {\r\n      if (params.param) {\r\n        this.queryParam = params.param;\r\n        this.displayChart = false;\r\n      } else {\r\n        this.queryParam = '';\r\n        this.displayChart = true;\r\n        this.initCharts();\r\n      }\r\n    });\r\n  }\r\n}\r\n","export default \".container {\\n  max-width: 98%;\\n}\\n\\n@media (min-width: 1680px) {\\n  .container {\\n    max-width: 80%;\\n  }\\n}\\n\\nnz-select {\\n  width: 100px;\\n  margin-left: 15px;\\n}\";","export default \"<app-alternative-navbar></app-alternative-navbar>\\n<app-menu></app-menu>\\n\\n<div class=\\\"row\\\">\\n  <div>\\n    <div class=\\\"month-select\\\">\\n      <nz-select\\n        [(ngModel)]=\\\"month\\\"\\n        (ngModelChange)=\\\"getPrescribersActivity()\\\"\\n        nzShowSearch\\n        [nzPlaceHolder]=\\\"'Selecione o mês'\\\"\\n      >\\n        <nz-option *ngFor=\\\"let month of months\\\" [nzLabel]=\\\"month?.name\\\" [nzValue]=\\\"month?.number\\\">\\n        </nz-option>\\n      </nz-select>\\n    </div>\\n    <div>\\n      <nz-table\\n        #listingTable\\n        [nzLoading]=\\\"loading\\\"\\n        nzFrontPagination=\\\"false\\\"\\n        [nzData]=\\\"prescribersActivity\\\"\\n        [nzPageSize]=\\\"pageSize\\\"\\n        nzSize=\\\"default\\\"\\n        (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n      >\\n        <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\n          <tr>\\n            <th nzShowSort nzSortKey=\\\"updatedAt\\\">Nome</th>\\n            <th nzShowSort nzSortKey=\\\"updatedAt\\\">CPF</th>\\n            <th nzShowSort nzSortKey=\\\"fullname\\\">Total de prescrições</th>\\n            <th nzShowSort nzSortKey=\\\"fullname\\\">Porcentagem</th>\\n          </tr>\\n        </thead>\\n\\n        <tbody>\\n          <ng-template ngFor let-item let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n            <tr>\\n              <td>{{ item.prescriber?.name }}</td>\\n              <td>{{ item.prescriber?.cpf }}</td>\\n              <td>{{ item.totalDocuments }}</td>\\n              <td>{{ (item.totalDocuments / data.totalPrescriptions) * 100 | number: '1.2-2' }}%</td>\\n            </tr>\\n          </ng-template>\\n        </tbody>\\n      </nz-table>\\n      <ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n    </div>\\n\\n    <nz-modal\\n      [(nzVisible)]=\\\"commercialDataVisible\\\"\\n      nzTitle=\\\"Dados Comerciais\\\"\\n      (nzOnCancel)=\\\"setVisible(false)\\\"\\n      (nzOnOk)=\\\"setVisible(false)\\\"\\n    >\\n      <div class=\\\"row\\\" *ngFor=\\\"let data of healthProfessional?.commercialData; index as i\\\">\\n        <span class=\\\"col-9\\\">{{ i + 1 }}. {{ data.name }}</span>\\n        <button\\n          class=\\\"col-3\\\"\\n          id=\\\"button-edit-business\\\"\\n          class=\\\"btn-edit\\\"\\n          (click)=\\\"showModalBusinessData(healthProfessional, i)\\\"\\n        >\\n          <img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\" />\\n        </button>\\n      </div>\\n    </nz-modal>\\n  </div>\\n\\n  <div>\\n    <app-my-pie-chart class=\\\"col-6\\\" title=\\\"Usuários\\\" [chart]=\\\"chart\\\"></app-my-pie-chart>\\n  </div>\\n</div>\\n\";","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { environment } from '@env/environment';\n\nconst DOCUMENT_URL = 'documents';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class PrescribersService {\n  constructor(private http: HttpClient) {}\n\n  getPrescribersActivity(month: number) {\n    return this.http.get<any>(\n      `${environment.apiRoot}${DOCUMENT_URL}/prescribers-activity?month=${month}`\n    );\n  }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { MyPieChart } from '@app/shared/models/my-pie-chart';\nimport { PrescribersService } from './prescribers.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-prescribers',\n  templateUrl: './prescribers.component.html',\n  styleUrls: ['./prescribers.component.scss']\n})\nexport class PrescribersComponent implements OnInit {\n  chart: MyPieChart;\n  data: any;\n  prescribersActivity: any[];\n  pageSize = 10;\n  month: number;\n  months = [\n    { name: 'Janeiro', number: 1 },\n    { name: 'Fevereiro', number: 2 },\n    { name: 'Março', number: 3 },\n    { name: 'Abril', number: 4 },\n    { name: 'Maio', number: 5 },\n    { name: 'Junho', number: 6 },\n    { name: 'Julho', number: 7 },\n    { name: 'Agosto', number: 8 },\n    { name: 'Setembro', number: 9 },\n    { name: 'Outubro', number: 10 },\n    { name: 'Novembro', number: 11 },\n    { name: 'Dezembro', number: 12 }\n  ];\n  loading = false;\n\n  /** TODO: Hemi implementar esses métodos */\n  healthProfessional;\n  commercialDataVisible;\n\n  pageIndexChanged(e) {}\n  onSortChange(e) {}\n  setVisible(value: boolean) {}\n\n  constructor(private prescribersService: PrescribersService) {}\n\n  ngOnInit() {\n    this.month = new Date().getMonth() + 1;\n    this.getPrescribersActivity();\n  }\n\n  @nativeAsync\n  async getPrescribersActivity() {\n    try {\n      const data = await this.prescribersService.getPrescribersActivity(this.month).toPromise();\n      this.data = data;\n      this.prescribersActivity = data.prescribersActivity;\n      this.chart = {\n        data: [data.prescribersActivity.length, data.registeredPrescribers],\n        pieChartLabels: ['Prescritores Ativos', 'Prescritores Cadastrados'],\n        pieChartColors: [\n          {\n            backgroundColor: ['rgba(22,168,95,1)', 'rgba(232,74,58,1)']\n          }\n        ]\n      };\n    } catch (err) {\n      console.error(err);\n    }\n    this.loading = false;\n  }\n}\n","export default \".row {\\n  justify-content: center;\\n  align-items: center;\\n}\\n\\n.month-select {\\n  width: 195px;\\n  margin-bottom: 25px;\\n}\\n\\n.month-select nz-select {\\n  width: 100%;\\n}\";","export default \"<app-alternative-navbar></app-alternative-navbar>\\n<app-menu></app-menu>\\n<div class=\\\"container\\\">\\n  <h2 class=\\\"title\\\">Administradores</h2>\\n\\n  <div class=\\\"add-btn\\\">\\n    <button nz-button nzType=\\\"primary\\\" (click)=\\\"showModalFormAdmin()\\\">\\n      <i class=\\\"fa fa-plus\\\"></i>\\n      Novo\\n    </button>\\n  </div>\\n\\n  <nz-table\\n    #listingTable\\n    [nzLoading]=\\\"loading\\\"\\n    nzFrontPagination=\\\"true\\\"\\n    [nzData]=\\\"admins\\\"\\n    nzSize=\\\"small\\\"\\n    style=\\\"overflow-x: auto;\\\"\\n  >\\n    <thead>\\n      <tr>\\n        <th>Nome</th>\\n        <th>CPF</th>\\n        <th>E-mail</th>\\n        <th>Permissão</th>\\n        <th>Ações</th>\\n      </tr>\\n    </thead>\\n\\n    <tbody>\\n      <ng-template ngFor let-admin let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n        <tr>\\n          <td>{{ admin.name }}</td>\\n          <td>{{ admin.cpf | formattedCpf }}</td>\\n          <td>{{ admin.user.email }}</td>\\n          <td>{{ getPermission(admin.user.permission) }}</td>\\n          <td>\\n            <a class=\\\"action-btn\\\" (click)=\\\"showModalFormAdmin(admin)\\\" title=\\\"Editar\\\">\\n              <img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\" />\\n            </a>\\n            <a class=\\\"action-btn\\\" (click)=\\\"deleteAdmin(admin)\\\" title=\\\"Excluir\\\">\\n              <i class=\\\"fa fa-trash-solid icon-trash\\\"></i>\\n            </a>\\n          </td>\\n        </tr>\\n      </ng-template>\\n    </tbody>\\n  </nz-table>\\n</div>\\n\";","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { FormBuilder, Validators } from '@angular/forms';\nimport { RegisterService } from '@app/modules/entry/services/register.service';\nimport { Administrator } from '@app/shared/models/admin';\nimport { Permission } from '@app/shared/models/permission.enum';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { markFormGroup } from '@app/utils/markFormGroup';\nimport { NzModalRef } from 'ng-zorro-antd/modal';\nimport { AdminService } from '../../admin.service';\n\n@Component({\n  selector: 'app-modal-form-admin',\n  templateUrl: './modal-form-admin.component.html',\n  styleUrls: ['./modal-form-admin.component.scss']\n})\nexport class ModaFormAdminComponent {\n  @Output() saved = new EventEmitter();\n\n  form = this.fb.group({\n    _id: [''],\n    name: ['', Validators.required],\n    email: ['', [Validators.required, Validators.email]],\n    cpf: ['', [Validators.min(11)]],\n    permission: ['', Validators.required]\n  });\n\n  loading = false;\n  permissions = [\n    {\n      label: 'Acesso total',\n      value: Permission.MASTER\n    },\n    {\n      label: 'Suporte (visualização e edição de alguns dados)',\n      value: Permission.MANAGER\n    },\n    {\n      label: 'Básico (apenas visualização)',\n      value: Permission.BASIC,\n      disabled: true\n    }\n  ];\n\n  constructor(\n    private ref: NzModalRef,\n    private fb: FormBuilder,\n    private registerService: RegisterService,\n    private notification: AppToastService,\n    private adminService: AdminService\n  ) {}\n\n  @Input()\n  set admin(admin: Administrator) {\n    if (admin) {\n      this.form.patchValue({\n        _id: admin._id,\n        name: admin.name,\n        email: admin.user.email,\n        cpf: admin.cpf,\n        permission: admin.user.permission\n      });\n    }\n  }\n\n  private get isEdit(): boolean {\n    return this.form.value._id;\n  }\n\n  cancel() {\n    this.ref.close();\n  }\n\n  async submit() {\n    markFormGroup(this.form);\n    if (this.form.valid) {\n      this.loading = true;\n      try {\n        const saved = await this.save();\n\n        if (this.isEdit) {\n          this.notification.notify('success', 'Sucesso', 'Administrador atualizado com sucesso');\n        } else {\n          this.notification.notify(\n            'success',\n            'Sucesso',\n            'Conta criada com sucesso. Um e-mail foi enviado para o administrador para que ele defina uma senha de acesso.'\n          );\n        }\n        this.ref.close(saved);\n      } catch (err) {\n        console.error(err);\n        if (err.status === 409) {\n          this.notification.notify('warning', 'Alerta', 'E-mail já existe');\n        } else {\n          this.notification.notify('error', 'Erro', 'Ocorreu um erro ao salvar o administrador');\n        }\n      }\n      this.loading = false;\n    }\n  }\n\n  private save(): Promise<Administrator> {\n    const admin = this.form.value;\n    if (admin._id) {\n      return this.adminService.update(admin._id, admin);\n    } else {\n      return <Promise<Administrator>>this.registerService.register('admin', this.form.value).toPromise();\n    }\n  }\n}\n","export default \"<div theme>\\n  <div class=\\\"modal-body\\\">\\n    <form nz-form [formGroup]=\\\"form\\\" (submit)=\\\"submit()\\\">\\n      <div class=\\\"form-input\\\">\\n        <nz-form-label nzFor=\\\"name\\\">Nome<span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n        <nz-form-control nzHasFeedback *ngIf=\\\"form.get('name') as ctrl\\\">\\n          <input nz-input id=\\\"name\\\" type=\\\"text\\\" formControlName=\\\"name\\\" maxlength=\\\"128\\\" />\\n          <nz-form-explain *ngIf=\\\"ctrl.dirty && ctrl.errors\\\">\\n            <ng-container *ngIf=\\\"ctrl.hasError('required')\\\">\\n              Campo obrigatório, por favor informe um nome.\\n            </ng-container>\\n            <ng-container *ngIf=\\\"!ctrl.hasError('required')\\\">\\n              Campo inválido.\\n            </ng-container>\\n          </nz-form-explain>\\n        </nz-form-control>\\n      </div>\\n\\n      <div class=\\\"form-input\\\">\\n        <nz-form-label nzFor=\\\"email\\\">E-mail<span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n        <nz-form-control nzHasFeedback *ngIf=\\\"form.get('email') as ctrl\\\">\\n          <input nz-input id=\\\"email\\\" type=\\\"email\\\" formControlName=\\\"email\\\" />\\n          <nz-form-explain *ngIf=\\\"ctrl.dirty && ctrl.errors\\\">\\n            <ng-container *ngIf=\\\"ctrl.hasError('required')\\\">\\n              Campo obrigatório, por favor informe um e-mail.\\n            </ng-container>\\n            <ng-container *ngIf=\\\"!ctrl.hasError('required')\\\">\\n              Campo inválido.\\n            </ng-container>\\n          </nz-form-explain>\\n        </nz-form-control>\\n      </div>\\n\\n      <div class=\\\"form-input\\\">\\n        <nz-form-label nzFor=\\\"cpf\\\">CPF</nz-form-label>\\n        <nz-form-control nzHasFeedback *ngIf=\\\"form.get('cpf') as ctrl\\\">\\n          <input nz-input id=\\\"cpf\\\" mask=\\\"000.000.000-00\\\" type=\\\"text\\\" formControlName=\\\"cpf\\\" />\\n          <nz-form-explain *ngIf=\\\"ctrl.dirty && ctrl.errors\\\">\\n            Campo inválido.\\n          </nz-form-explain>\\n        </nz-form-control>\\n      </div>\\n\\n      <div class=\\\"form-input\\\">\\n        <nz-form-label nzFor=\\\"permission\\\">Defina a permissão do novo administrador</nz-form-label>\\n        <nz-form-control nzHasFeedback *ngIf=\\\"form.get('permission') as ctrl\\\">\\n          <nz-form-explain *ngIf=\\\"ctrl.dirty && ctrl.errors\\\">\\n            <ng-container *ngIf=\\\"ctrl.hasError('required')\\\">\\n              Campo obrigatório, por favor selecione uma permissão.\\n            </ng-container>\\n          </nz-form-explain>\\n        </nz-form-control>\\n        <nz-radio-group formControlName=\\\"permission\\\">\\n          <ul>\\n            <li *ngFor=\\\"let permission of permissions\\\">\\n              <label nz-radio [nzValue]=\\\"permission.value\\\" [nzDisabled]=\\\"permission.disabled\\\">{{\\n                permission.label\\n              }}</label>\\n            </li>\\n          </ul>\\n        </nz-radio-group>\\n      </div>\\n    </form>\\n  </div>\\n\\n  <div class=\\\"modal-footer\\\">\\n    <button nz-button nzType=\\\"default\\\" (click)=\\\"cancel()\\\">\\n      Cancelar\\n    </button>\\n    <button nz-button nzType=\\\"primary\\\" class=\\\"btn-primary\\\" [nzLoading]=\\\"loading\\\" (click)=\\\"submit()\\\">\\n      Salvar\\n    </button>\\n  </div>\\n</div>\\n\";","export default \"::ng-deep .modal-form-admin .ant-modal-header {\\n  background: #4cbca3;\\n}\\n::ng-deep .modal-form-admin .ant-modal-header .ant-modal-title {\\n  color: white;\\n  font-family: \\\"probold\\\";\\n  font-size: 20px;\\n}\\n::ng-deep .modal-form-admin nz-form-explain {\\n  color: #f5222d;\\n}\\n::ng-deep .modal-form-admin .form-input {\\n  margin-bottom: 10px;\\n}\\n::ng-deep .modal-form-admin .modal-body {\\n  padding: 0;\\n}\\n::ng-deep .modal-form-admin .modal-body .ant-radio-inner {\\n  border-color: var(--bg-color-primary);\\n}\\n::ng-deep .modal-form-admin .modal-body .ant-radio-inner::after {\\n  background-color: var(--bd-select);\\n}\\n::ng-deep .modal-form-admin .modal-body ul {\\n  list-style-type: none;\\n  padding: 0;\\n  margin-left: 10px;\\n}\\n::ng-deep .modal-form-admin .ant-modal-footer {\\n  background-color: var(--bg-modal-header);\\n}\\n::ng-deep .modal-form-admin .ant-btn-default:hover {\\n  color: var(--bg-color-primary);\\n  border-color: var(--bg-color-primary);\\n}\\n::ng-deep .modal-form-admin .ant-btn-default:focus {\\n  color: rgba(0, 0, 0, 0.65);\\n  border-color: #d9d9d9;\\n}\\n::ng-deep .modal-form-admin .ant-btn-primary {\\n  color: white;\\n  background-color: var(--bg-color-primary);\\n  border-color: var(--bg-color-primary);\\n}\\n::ng-deep .modal-form-admin .ant-btn-primary:hover {\\n  background-color: var(--bg-color-primary);\\n  border-color: var(--bg-color-primary);\\n}\";","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { Administrator } from '@app/shared/models/admin';\nimport { Permission } from '@app/shared/models/permission.enum';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { NzModalService } from 'ng-zorro-antd/modal';\nimport { AdminService } from '../admin.service';\nimport { ModaFormAdminComponent } from './modal-form-admin/modal-form-admin.component';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-register',\n  templateUrl: './register.component.html',\n  styleUrls: ['./register.component.scss']\n})\nexport class RegisterComponent implements OnInit {\n  public adminForm: FormGroup;\n\n  loading = false;\n  admins: Administrator[] = [];\n\n  constructor(\n    private fb: FormBuilder,\n    private adminService: AdminService,\n    private modalService: NzModalService,\n    private notification: AppToastService\n  ) {\n    this.adminForm = this.fb.group({\n      name: this.fb.control('', Validators.required),\n      email: this.fb.control('', Validators.required),\n      cpf: this.fb.control('', Validators.required),\n      permission: this.fb.control('', Validators.required)\n    });\n  }\n\n  ngOnInit() {\n    this.loadAdmins();\n  }\n\n  @nativeAsync\n  private async loadAdmins() {\n    this.loading = true;\n    this.admins = await this.adminService.getAdmins();\n    this.loading = false;\n  }\n\n  getPermission(permission: Permission) {\n    switch (permission) {\n      case Permission.MASTER:\n        return 'Acesso total';\n      case Permission.MANAGER:\n        return 'Suporte';\n      case Permission.BASIC:\n        return 'Básico';\n    }\n  }\n\n  showModalFormAdmin(admin?: Administrator): void {\n    const modal = this.modalService.create({\n      nzTitle: admin ? 'Editar administrador' : 'Adicionar administrador',\n      nzContent: ModaFormAdminComponent,\n      nzFooter: null,\n      nzClosable: false,\n      nzClassName: 'modal-form-admin',\n      nzComponentParams: {\n        admin\n      }\n    });\n\n    modal.afterClose.subscribe((saved: Administrator) => {\n      if (saved) {\n        this.loadAdmins();\n      }\n    });\n  }\n\n  @nativeAsync\n  async deleteAdmin(admin: Administrator) {\n    this.modalService.confirm({\n      nzTitle: 'Excluir administrador',\n      nzContent: `Deseja excluir o administrador ${admin.name}?`,\n      nzOnOk: async () => {\n        try {\n          await this.adminService.deleteAdmin(admin._id);\n          this.loadAdmins();\n          this.notification.notify('success', 'Sucesso', 'Administrador excluído com sucesso');\n        } catch (error) {\n          this.notification.notify('error', 'Erro', 'Não foi possível excluir o administrador');\n        }\n      }\n    });\n  }\n}\n","import { User } from './decodedLoginToken';\n\nexport class Administrator {\n  _id?: string;\n  name: string;\n  cpf: string;\n  userId: string;\n  user: User;\n}\n","export default \".add-btn {\\n  text-align: end;\\n  margin-bottom: 10px;\\n}\\n\\n.action-btn {\\n  margin: 0;\\n  padding: 8px;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.icon-trash {\\n  color: #ff0000;\\n}\";","import { Component, OnInit } from '@angular/core';\n\n@Component({\n  selector: 'app-specialties',\n  templateUrl: './specialties.component.html',\n  styleUrls: ['./specialties.component.scss']\n})\nexport class SpecialtiesComponent implements OnInit {\n  constructor() {}\n\n  ngOnInit() {}\n}\n","export default \"<app-alternative-navbar></app-alternative-navbar>\\n<app-menu></app-menu>\\n\\n<div class=\\\"container\\\">\\n  <app-specialties-listing></app-specialties-listing>\\n</div>\\n\";","export default \"\";","export default \"<div class=\\\"unsubscribe-user\\\">\\n  <app-alternative-navbar></app-alternative-navbar>\\n  <app-menu></app-menu>\\n\\n  <div class=\\\"container\\\">\\n    <h2 class=\\\"title mb-3\\\">Remover usuário</h2>\\n\\n    <nz-steps [nzCurrent]=\\\"current\\\">\\n      <nz-step nzTitle=\\\"Busca\\\" nzIcon=\\\"user\\\"></nz-step>\\n      <nz-step nzTitle=\\\"Verificação dos dados\\\" nzIcon=\\\"solution\\\"> </nz-step>\\n      <nz-step nzTitle=\\\"Confirmação\\\" nzIcon=\\\"check\\\"></nz-step>\\n      <ng-template #iconTemplate><i nz-icon nzType=\\\"smile\\\"></i></ng-template>\\n    </nz-steps>\\n\\n    <ng-container *ngIf=\\\"current === 0\\\">\\n      <h3>Buscar usuário por:</h3>\\n      <nz-radio-group [(ngModel)]=\\\"searchOption\\\">\\n        <label nz-radio nzValue=\\\"cpf\\\">CPF</label>\\n        <label nz-radio nzValue=\\\"email\\\">E-mail</label>\\n      </nz-radio-group>\\n\\n      <nz-form-label nzFor=\\\"tenantId\\\">Sistema:</nz-form-label>\\n      <nz-select [(ngModel)]=\\\"tenantId\\\" name=\\\"tenantId\\\">\\n        <nz-option nzValue=\\\"RD\\\" nzLabel=\\\"RD\\\"></nz-option>\\n        <nz-option nzValue=\\\"MRD\\\" nzLabel=\\\"MRD\\\"></nz-option>\\n      </nz-select>\\n\\n      <form [formGroup]=\\\"form\\\" (ngSubmit)=\\\"searchUser()\\\">\\n        <div class=\\\"search-area\\\">\\n          <input\\n            nz-input\\n            class=\\\"mt-2\\\"\\n            placeholder=\\\"Digite o {{ searchOption === 'cpf' ? 'CPF' : 'e-mail' }} do usuário\\\"\\n            formControlName=\\\"field\\\"\\n            [ngModel]=\\\"searchField\\\"\\n            [mask]=\\\"searchOption === 'cpf' ? '000.000.000-00' : ''\\\"\\n            [type]=\\\"searchOption === 'cpf' ? 'tel' : 'email'\\\"\\n            [dropSpecialCharacters]=\\\"searchOption === 'cpf'\\\"\\n          />\\n\\n          <button nz-button type=\\\"submit\\\" class=\\\"btn-primary\\\" [disabled]=\\\"!searchField\\\">\\n            <i nz-icon nzType=\\\"search\\\"></i>\\n            Buscar\\n          </button>\\n        </div>\\n      </form>\\n    </ng-container>\\n    <ng-container *ngIf=\\\"current === 1 && user\\\">\\n      <p class=\\\"mt-2\\\">Sistema: {{ tenantId }}</p>\\n      <p>Tipo de usuário: {{ getUserType() }}</p>\\n      <p>Nome: {{ user.name }}</p>\\n      <p>Email: {{ user.user.email }}</p>\\n      <p>CPF: {{ user.cpf }}</p>\\n      <p *ngIf=\\\"user.dependents\\\">\\n        Dependentes: {{ user.dependents.length }}\\n        <span>\\n          <ul>\\n            <li *ngFor=\\\"let dependent of user.dependents\\\">{{ dependent.name }}</li>\\n          </ul>\\n        </span>\\n      </p>\\n      <p>Documentos: {{ getNumberOfDocuments() }}</p>\\n      <a (click)=\\\"togglePrescriptionsModal($event)\\\" class=\\\"text-decoration\\\">Visualizar documentos</a>\\n      <br />\\n      <br />\\n      <button nz-button (click)=\\\"setCurrent(0)\\\">Cancelar</button>\\n      <button nz-button class=\\\"btn-primary ml-2\\\" (click)=\\\"unsubscribeUser()\\\">\\n        <i nz-icon nzType=\\\"delete\\\" nzTheme=\\\"outline\\\"></i>\\n        Confirmar descadastramento\\n      </button>\\n    </ng-container>\\n\\n    <ng-container *ngIf=\\\"current === 2\\\">\\n      <div class=\\\"confirmation\\\">\\n        <h1>Descadastramento concluído com sucesso!</h1>\\n        <p>Clique <span (click)=\\\"setCurrent(0)\\\">aqui</span> para voltar para a tela de busca.</p>\\n      </div>\\n    </ng-container>\\n  </div>\\n  <app-listing-modal #modalPrescriptions></app-listing-modal>\\n</div>\\n\";","import { Component, ViewChild } from '@angular/core';\nimport { FormBuilder, Validators } from '@angular/forms';\nimport { HealthProfessionalService } from '@app/modules/health-professional/services/health-professional.service';\nimport { PatientsService } from '@app/modules/patients/services/patients.service';\nimport { ListingModalComponent } from '@app/modules/prescriptions/listing-modal/listing-modal.component';\nimport { UserService } from '@app/modules/user/user.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\nimport { OnlyNumbersPipe } from '@app/shared/pipes';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { NzModalService } from 'ng-zorro-antd/modal';\n\n@Component({\n  selector: 'app-unsubscribe-user',\n  templateUrl: './unsubscribe-user.component.html',\n  styleUrls: ['./unsubscribe-user.component.scss']\n})\nexport class UnsubscribeUserComponent {\n  @ViewChild(ListingModalComponent, { static: true }) modalPrescriptions: ListingModalComponent;\n\n  current = 0;\n  searchOption = 'cpf';\n  user: any;\n  userPrescriptions: any[];\n  userDocuments: any;\n  showHealthProfessionalsModal: boolean;\n  tenantId = 'RD';\n\n  form = this.fb.group({\n    field: ['', Validators.required]\n  });\n\n  constructor(\n    private fb: FormBuilder,\n    private patientService: PatientsService,\n    private healthProfessional: HealthProfessionalService,\n    private modalService: NzModalService,\n    private userService: UserService,\n    private notification: AppToastService\n  ) {}\n\n  get searchField() {\n    return this.form.controls.field.value;\n  }\n\n  set searchField(value: string) {\n    if (this.searchField !== value) {\n      this.form.get('field').setValue(value);\n    }\n  }\n\n  @nativeAsync\n  async searchUser() {\n    const query: any = {\n      limit: 10,\n      skip: 0,\n      tenantId: this.tenantId\n    };\n    if (this.searchOption === 'cpf') {\n      const cpf = new OnlyNumbersPipe().transform(this.searchField);\n      query.queryParam = cpf;\n      query.queryParamType = 'cpf';\n    } else if (this.searchOption === 'email') {\n      query.queryParam = this.searchField;\n      query.queryParamType = 'email';\n    } else {\n      // do nothing\n      return;\n    }\n\n    const res = await this.userService.getUser(query).toPromise();\n    if (res) {\n      this.user = res.user;\n      this.userDocuments = res.documents;\n      this.setCurrent(1);\n    } else {\n      this.notification.notify('warning', 'Aviso', 'Usuário não encontrado');\n    }\n  }\n\n  @nativeAsync\n  async unsubscribeUser() {\n    this.modalService.confirm({\n      nzTitle: 'Alerta',\n      nzContent:\n        `Tem certeza que deseja descadastrar <b>permanentemente</b> esse usuário? ` +\n        'Esta ação impedirá que o usuário acesse a plataforma.',\n      nzOnOk: () => {\n        console.log('user >', this.user);\n        if (this.user.user.userType === 'patient') {\n          this.patientService.unsubscribePatient(this.user._id).subscribe(\n            res => {\n              console.log({ res });\n              this.setCurrent(2);\n              this.searchField = '';\n            },\n            err => {\n              this.modalService.warning();\n            }\n          );\n        } else if (this.user.user.userType === 'healthProfessional') {\n          this.healthProfessional.unsubscribe(this.user._id).subscribe(\n            res => {\n              console.log({ res });\n              this.setCurrent(2);\n              this.searchField = '';\n            },\n            err => {\n              this.modalService.warning();\n            }\n          );\n        }\n      }\n    });\n  }\n\n  setCurrent(newCurrent: number) {\n    this.current = newCurrent;\n  }\n\n  getUserType() {\n    const UserType = {\n      patient: 'Paciente',\n      doctor: 'Médico',\n      dentist: 'Dentista',\n      pharmacy: 'Farmácia'\n    };\n    const t = this.user.professionalType ? this.user.professionalType : this.user.user.userType;\n    return UserType[t];\n  }\n\n  togglePrescriptionsModal(event: Event): void {\n    event.preventDefault();\n    this.modalPrescriptions.createTplModal(this.user, this.userDocuments);\n  }\n\n  getNumberOfDocuments() {\n    return Object.keys(this.userDocuments)\n      .map(key => this.userDocuments[key][key].length)\n      .reduce((a, b) => a + b, 0);\n  }\n}\n","export default \".title {\\n  font-weight: bold;\\n}\\n\\n.unsubscribe-user .search-area {\\n  width: 40%;\\n  display: flex;\\n  align-items: center;\\n}\\n\\n.unsubscribe-user .search-area input {\\n  margin-right: 20px;\\n}\\n\\n.unsubscribe-user .confirmation {\\n  margin-top: 40px;\\n}\\n\\n.unsubscribe-user .confirmation span {\\n  cursor: pointer;\\n  color: #19e0c2;\\n}\\n\\n.unsubscribe-user .text-decoration {\\n  text-decoration: underline;\\n  -webkit-text-decoration-color: #086053;\\n          text-decoration-color: #086053;\\n}\\n\\nnz-select {\\n  width: 100px;\\n  margin-left: 15px;\\n}\";","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { ExamService } from '@app/modules/document/services/exam.service';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\n\n@Component({\n  selector: 'app-exams',\n  templateUrl: './exams.component.html',\n  styleUrls: ['./exams.component.scss']\n})\nexport class ExamsComponent implements OnInit {\n  form: FormGroup;\n  loading = false;\n\n  constructor(\n    private fb: FormBuilder,\n    private notification: AppToastService,\n    private examService: ExamService\n  ) {}\n\n  ngOnInit(): void {\n    this.form = this.fb.group({\n      file: this.fb.control('', Validators.required),\n      isPet: this.fb.control(false)\n    });\n  }\n\n  sendFile() {\n    const file: File = this.form.get('file').value;\n    if (!file) {\n      this.notification.notify('warning', 'Aviso', 'Selecione um arquivo excel');\n      return;\n    }\n    this.loading = true;\n    this.examService.uploadExams(file, this.form.get('isPet').value).subscribe(\n      () => {\n        this.loading = false;\n        this.notification.notify('success', 'Sucesso', 'Arquivo importado com sucesso');\n        this.form.reset();\n      },\n      err => {\n        console.error(err);\n        this.loading = false;\n      }\n    );\n  }\n}\n","export default \"<app-alternative-navbar></app-alternative-navbar>\\n<app-menu></app-menu>\\n\\n<div class=\\\"container\\\">\\n  <h3>Importar exames:</h3>\\n  <form nz-form [formGroup]=\\\"form\\\">\\n    <div class=\\\"row\\\">\\n      <div class=\\\"col-10\\\">\\n        <nz-form-item>\\n          <nz-form-control>\\n            <app-input-file\\n              accept=\\\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel\\\"\\n              textButton=\\\"Selecione um arquivo excel\\\"\\n              formControlName=\\\"file\\\"\\n              name=\\\"file\\\"\\n            ></app-input-file>\\n          </nz-form-control>\\n        </nz-form-item>\\n      </div>\\n      <div class=\\\"col\\\">\\n        <button nz-button nzType=\\\"primary\\\" (click)=\\\"sendFile()\\\">Enviar arquivo</button>\\n      </div>\\n    </div>\\n  </form>\\n</div>\\n\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","export default \"\";","export default \"<app-alternative-navbar></app-alternative-navbar>\\n<app-menu></app-menu>\\n\\n<div class=\\\"container\\\">\\n  <h3>Importar Protocolos Serene:</h3>\\n  <form nz-form [formGroup]=\\\"form\\\">\\n    <div class=\\\"row\\\">\\n      <div class=\\\"col-10\\\">\\n        <nz-form-item>\\n          <nz-form-control>\\n            <app-input-file\\n              accept=\\\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel\\\"\\n              textButton=\\\"Selecione um arquivo excel\\\"\\n              formControlName=\\\"file\\\"\\n              name=\\\"file\\\"\\n            ></app-input-file>\\n          </nz-form-control>\\n        </nz-form-item>\\n      </div>\\n      <div class=\\\"col\\\">\\n        <button nz-button nzType=\\\"primary\\\" (click)=\\\"sendFile()\\\">Enviar arquivo</button>\\n      </div>\\n    </div>\\n  </form>\\n</div>\\n\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { ExamService } from '@app/modules/document/services/exam.service';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { LibraryService } from '@app/shared/services/library.service';\n\n@Component({\n  selector: 'app-serene',\n  templateUrl: './serene.component.html',\n  styleUrls: ['./serene.component.scss']\n})\nexport class SereneComponent implements OnInit {\n  form: FormGroup;\n  loading = false;\n\n  constructor(\n    private fb: FormBuilder,\n    private notification: AppToastService,\n    private libraryService: LibraryService\n  ) {}\n\n  ngOnInit(): void {\n    this.form = this.fb.group({\n      file: this.fb.control('', Validators.required)\n    });\n  }\n\n  sendFile() {\n    const file: File = this.form.get('file').value;\n    if (!file) {\n      this.notification.notify('warning', 'Aviso', 'Selecione um arquivo excel');\n      return;\n    }\n    this.loading = true;\n    this.libraryService.uploadProtocols(file).subscribe(\n      () => {\n        this.loading = false;\n        this.notification.notify('success', 'Sucesso', 'Arquivo importado com sucesso');\n        this.form.reset();\n      },\n      err => {\n        console.error(err);\n        this.loading = false;\n      }\n    );\n  }\n}\n","export default \"\";","export default \"<app-alternative-navbar></app-alternative-navbar>\\n<app-menu></app-menu>\\n\\n<div class=\\\"container\\\">\\n  <h3>Importar Medicamentos:</h3>\\n  <form nz-form [formGroup]=\\\"form\\\">\\n    <div class=\\\"row\\\">\\n      <div class=\\\"col-10\\\">\\n        <nz-form-item>\\n          <nz-form-control>\\n            <app-input-file\\n              accept=\\\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel\\\"\\n              textButton=\\\"Selecione um arquivo excel\\\"\\n              formControlName=\\\"file\\\"\\n              name=\\\"file\\\"\\n            ></app-input-file>\\n          </nz-form-control>\\n        </nz-form-item>\\n      </div>\\n      <div class=\\\"col\\\">\\n        <button nz-button nzType=\\\"primary\\\" (click)=\\\"sendFile()\\\">Enviar arquivo</button>\\n      </div>\\n    </div>\\n  </form>\\n</div>\\n\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","import { Injectable } from '@angular/core';\nimport { environment } from '@env/environment';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable } from 'rxjs';\n\nimport { Medicamento } from '@app/shared/models/prescription';\nimport { catchError, map } from 'rxjs/operators';\n\nexport const MEDICAMENT_URL = 'medicament';\n\n@Injectable({ providedIn: 'root' })\nexport class MedicamentService {\n  constructor(private http: HttpClient) {}\n\n  upload(file: File) {\n    const formData = new FormData();\n    formData.append('file', file);\n    return this.http.post(`${environment.apiRoot}medicaments/import`, formData);\n  }\n\n  getMedicaments(filter: any): Observable<any> {\n    const URL = `${environment.apiRoot}${MEDICAMENT_URL}/filter`;\n    return this.http\n      .get<any>(URL, { params: filter })\n      .pipe(\n        map(data => {\n          return data;\n        }),\n        catchError(error => {\n          throw error;\n        })\n      );\n  }\n\n  sendExcelMedicaments(file: File) {\n    const formData = new FormData();\n    formData.append('medicaments', file);\n    return this.http.post(`${environment.apiRoot}${MEDICAMENT_URL}/excel`, formData);\n  }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { MedicamentService } from '@app/modules/document/services/medicament.service';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { LibraryService } from '@app/shared/services/library.service';\n\n@Component({\n  selector: 'app-medicaments',\n  templateUrl: './medicaments.component.html',\n  styleUrls: ['./medicaments.component.scss']\n})\nexport class MedicamentsComponent implements OnInit {\n  form: FormGroup;\n  loading = false;\n\n  constructor(\n    private fb: FormBuilder,\n    private notification: AppToastService,\n    private medicamentService: MedicamentService\n  ) {}\n\n  ngOnInit(): void {\n    this.form = this.fb.group({\n      file: this.fb.control('', Validators.required)\n    });\n  }\n\n  sendFile() {\n    const file: File = this.form.get('file').value;\n    if (!file) {\n      this.notification.notify('warning', 'Aviso', 'Selecione um arquivo excel');\n      return;\n    }\n    this.loading = true;\n    this.medicamentService.upload(file).subscribe(\n      () => {\n        this.loading = false;\n        this.notification.notify('success', 'Sucesso', 'Arquivo importado com sucesso');\n        this.form.reset();\n      },\n      err => {\n        console.error(err);\n        this.loading = false;\n      }\n    );\n  }\n}\n","export default \"\";","import { NgModule } from '@angular/core';\r\nimport { RouterModule, Routes } from '@angular/router';\r\nimport { AdminGuard } from './guards/admin.guard';\r\nimport { MasterGuard } from './guards/master.guard';\r\nimport { OverviewComponent } from './overview/overview.component';\r\nimport { PrescribersComponent } from './overview/prescribers/prescribers.component';\r\nimport { RegisterComponent } from './register/register.component';\r\nimport { SpecialtiesComponent } from './specialties/specialties.component';\r\nimport { UnsubscribeUserComponent } from './unsubscribe-user/unsubscribe-user.component';\r\nimport { ExamsComponent } from './domains/exams/exams.component';\r\nimport { SereneComponent } from './domains/serene/serene.component';\r\nimport { MedicamentsComponent } from './domains/medicaments/medicaments.component';\r\n\r\nconst routes: Routes = [\r\n  { path: '', component: OverviewComponent, canActivate: [AdminGuard] },\r\n  { path: 'prescribers', component: PrescribersComponent, canActivate: [AdminGuard, MasterGuard] },\r\n  { path: 'specialties', component: SpecialtiesComponent, canActivate: [AdminGuard, MasterGuard] },\r\n  { path: 'register', component: RegisterComponent, canActivate: [AdminGuard, MasterGuard] },\r\n  {\r\n    path: 'unsubscribe-user',\r\n    component: UnsubscribeUserComponent,\r\n    canActivate: [AdminGuard, MasterGuard]\r\n  },\r\n  {\r\n    path: 'domain-exams',\r\n    component: ExamsComponent,\r\n    canActivate: [AdminGuard, MasterGuard]\r\n  },\r\n  {\r\n    path: 'domain-serene',\r\n    component: SereneComponent,\r\n    canActivate: [AdminGuard, MasterGuard]\r\n  },\r\n  {\r\n    path: 'domain-medicaments',\r\n    component: MedicamentsComponent,\r\n    canActivate: [AdminGuard, MasterGuard]\r\n  },\r\n  { path: ':param', component: OverviewComponent, canActivate: [AdminGuard] }\r\n];\r\n\r\n@NgModule({\r\n  imports: [RouterModule.forChild(routes)],\r\n  exports: [RouterModule]\r\n})\r\nexport class AdminRoutingModule {}\r\n","export default \"<div class=\\\"filter-form patients-listing\\\">\\n  <h2 class=\\\"title\\\">\\n    Funcionalidades adicionais\\n  </h2>\\n  <br />\\n  <form>\\n    <div class=\\\"row\\\">\\n      <div class=\\\"col-3\\\">\\n        <nz-form-label nzFor=\\\"name\\\" theme>Nome:</nz-form-label>\\n        <input nz-input id=\\\"name\\\" name=\\\"name\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.name\\\" theme />\\n      </div>\\n\\n      <div class=\\\"col-3\\\">\\n        <nz-form-label nzFor=\\\"destination\\\" theme>Destinação</nz-form-label>\\n        <nz-select\\n          [(ngModel)]=\\\"filter.destination\\\"\\n          id=\\\"destination\\\"\\n          name=\\\"destination\\\"\\n          nzPlaceHolder=\\\"Selecione destinação\\\"\\n          nzDropdownClassName=\\\"account-select\\\"\\n          theme\\n        >\\n          <nz-option\\n            *ngFor=\\\"let destination of destinationsOptions\\\"\\n            [nzLabel]=\\\"destination?.label\\\"\\n            [nzValue]=\\\"destination?.value\\\"\\n          >\\n          </nz-option>\\n        </nz-select>\\n      </div>\\n\\n      <div class=\\\"col-2\\\">\\n        <nz-form-label nzFor=\\\"code\\\" theme>Código:</nz-form-label>\\n        <input nz-input id=\\\"code\\\" name=\\\"code\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.code\\\" theme />\\n      </div>\\n      <div class=\\\"col-3\\\" class=\\\"buttons\\\">\\n        <button nz-button type=\\\"button\\\" nzType=\\\"primary\\\" (click)=\\\"filterData()\\\">\\n          <i nz-icon nzType=\\\"search\\\"></i>\\n          Filtrar\\n        </button>\\n        <button nz-button type=\\\"button\\\" nzType=\\\"primary\\\" (click)=\\\"showModalAddFeature()\\\">\\n          <i class=\\\"fa fa-plus\\\"></i>\\n          Nova funcionalidade\\n        </button>\\n      </div>\\n    </div>\\n  </form>\\n</div>\\n<nz-table\\n  #listingTable\\n  [nzLoading]=\\\"loading\\\"\\n  nzFrontPagination=\\\"false\\\"\\n  [nzTotal]=\\\"data?.totalRecord\\\"\\n  [nzData]=\\\"data?.additionalFeatures\\\"\\n  [nzPageSize]=\\\"pageSize\\\"\\n  nzSize=\\\"small\\\"\\n  (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n  style=\\\"overflow-x: auto;\\\"\\n>\\n  <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\n    <tr>\\n      <th nzShowExpand></th>\\n      <th nzShowSort nzSortKey=\\\"updatedAt\\\">Última atualização</th>\\n      <th nzShowSort nzSortKey=\\\"name\\\">Nome</th>\\n      <th>Destinação</th>\\n      <th>Código</th>\\n      <th></th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-feature let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <tr>\\n        <td nzShowExpand [(nzExpand)]=\\\"feature.expand\\\"></td>\\n        <td>{{ feature.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n        <td>{{ feature.name }}</td>\\n        <td>{{ getDestinations(feature.destinations) }}</td>\\n        <td>{{ feature.code }}</td>\\n        <td>\\n          <button\\n            (click)=\\\"showModalEditFeature(feature, i)\\\"\\n            title=\\\"Editar funcionalidade\\\"\\n            class=\\\"btn btn-icon btn-simple\\\"\\n            type=\\\"button\\\"\\n          >\\n            <span class=\\\"btn-inner--icon\\\"><i class=\\\"fa fa-pencil-solid\\\"></i></span>\\n          </button>\\n        </td>\\n      </tr>\\n      <tr [(nzExpand)]=\\\"feature.expand\\\">\\n        <td></td>\\n        <td colspan=\\\"5\\\">\\n          {{ feature.description }}\\n        </td>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { AdditionalFeature } from '@app/shared/models';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { markFormGroup } from '@app/utils/markFormGroup';\nimport { NzModalRef } from 'ng-zorro-antd/modal';\nimport { AdditionalFeatureService } from '../listing/features-listing/additional-feature.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-modal-add-additional-feature',\n  templateUrl: './modal-add-additional-feature.component.html',\n  styleUrls: ['./modal-add-additional-feature.component.scss']\n})\nexport class ModalAddAdditionalFeatureComponent implements OnInit {\n  isVisible = true;\n  loading: boolean;\n  index = 0;\n  code = null;\n\n  formAdditionalFeature: FormGroup = new FormGroup({\n    name: new FormControl(null, Validators.required),\n    destinations: new FormControl(null, Validators.required),\n    description: new FormControl(null)\n  });\n\n  destinations = [\n    { name: 'Todos', value: 'all' },\n    { name: 'Pacientes', value: 'patient' },\n    { name: 'Médicos', value: 'doctor' },\n    { name: 'Dentistas', value: 'dentist' },\n    { name: 'Farmácias', value: 'pharmacy' },\n    { name: 'Farmacêuticos', value: 'pharmacist' }\n  ];\n\n  @Output() updateListFeatures = new EventEmitter<any>();\n\n  constructor(\n    private nzModalRef: NzModalRef,\n    private notification: AppToastService,\n    private additionalFeatureService: AdditionalFeatureService\n  ) {}\n\n  ngOnInit() {}\n\n  handleCancel(): void {\n    this.nzModalRef.destroy();\n  }\n\n  @nativeAsync\n  async save() {\n    markFormGroup(this.formAdditionalFeature);\n    if (this.formAdditionalFeature.valid) {\n      if (this.code) {\n        this.updateFeature();\n      } else {\n        this.saveFeature();\n      }\n    }\n  }\n  @nativeAsync\n  async saveFeature() {\n    try {\n      this.loading = true;\n      await this.additionalFeatureService.save(this.formAdditionalFeature.value).toPromise();\n      this.notification.notify('success', 'Funcionalidade cadastrada com sucesso!', '');\n      this.loading = false;\n      this.updateListFeatures.next(null);\n      this.nzModalRef.destroy();\n    } catch (error) {\n      this.loading = false;\n      console.log(error);\n    }\n  }\n  @nativeAsync\n  async updateFeature() {\n    try {\n      this.loading = true;\n      const feature = await this.additionalFeatureService\n        .update(this.code, this.formAdditionalFeature.value)\n        .toPromise();\n      this.notification.notify('success', 'Funcionalidade atualizada com sucesso!', '');\n      this.loading = false;\n      this.updateListFeatures.emit({ feature, index: this.index });\n      this.nzModalRef.destroy();\n    } catch (error) {\n      this.loading = false;\n      console.log(error);\n    }\n  }\n\n  setValues(feature) {\n    const valueForm = this.formAdditionalFeature.value;\n    for (const key in valueForm) {\n      this.formAdditionalFeature.get(key).setValue(feature[key]);\n    }\n  }\n\n  set feature(feature: AdditionalFeature) {\n    this.setValues(feature);\n    this.code = feature.code;\n  }\n}\n","export default \"<div>\\n  <div class=\\\"modal-body\\\">\\n    <form nz-form [formGroup]=\\\"formAdditionalFeature\\\">\\n      <div class=\\\"row justify-content-between\\\">\\n        <div class=\\\"col-8\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"nome\\\" theme>Nome: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"name\\\" id=\\\"nome\\\" maxlength=\\\"128\\\" theme />\\n              <nz-form-explain\\n                *ngIf=\\\"\\n                  formAdditionalFeature.get('name').dirty && formAdditionalFeature.get('name').errors\\n                \\\"\\n              >\\n                <ng-container *ngIf=\\\"formAdditionalFeature.get('name').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o nome.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-4\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"destination\\\" theme\\n              >Destinação: <span class=\\\"mandatory\\\"> *</span></nz-form-label\\n            >\\n            <nz-form-control nzHasFeedback>\\n              <nz-select\\n                formControlName=\\\"destinations\\\"\\n                id=\\\"destinations\\\"\\n                nzAllowClear\\n                nzShowSearch\\n                nzDropdownClassName=\\\"account-select\\\"\\n                nzMode=\\\"multiple\\\"\\n                nzPlaceHolder=\\\"Selecione\\\"\\n                theme\\n              >\\n                <nz-option\\n                  *ngFor=\\\"let destination of destinations\\\"\\n                  [nzLabel]=\\\"destination?.name\\\"\\n                  [nzValue]=\\\"destination?.value\\\"\\n                ></nz-option>\\n              </nz-select>\\n\\n              <nz-form-explain\\n                *ngIf=\\\"\\n                  formAdditionalFeature.get('destinations').dirty &&\\n                  formAdditionalFeature.get('destinations').errors\\n                \\\"\\n              >\\n                <ng-container *ngIf=\\\"formAdditionalFeature.get('destinations').hasError('required')\\\">\\n                  Campo obrigatório, por favor selecione uma destinação.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n      </div>\\n      <div class=\\\"row justify-content-between\\\">\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"description\\\" theme>Descrição:</nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <textarea\\n                rows=\\\"4\\\"\\n                cols=\\\"6\\\"\\n                nz-input\\n                formControlName=\\\"description\\\"\\n                id=\\\"description\\\"\\n                theme\\n              ></textarea>\\n              <nz-form-explain\\n                *ngIf=\\\"\\n                  formAdditionalFeature.get('description').dirty &&\\n                  formAdditionalFeature.get('description').errors\\n                \\\"\\n              >\\n                <ng-container *ngIf=\\\"formAdditionalFeature.get('description').hasError('required')\\\">\\n                  Campo obrigatório, por favor informe uma descrição.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n      </div>\\n    </form>\\n  </div>\\n  <div class=\\\"modal-footer\\\">\\n    <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-default\\\" (click)=\\\"handleCancel()\\\">\\n      Cancelar\\n    </button>\\n    <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-primary\\\" (click)=\\\"save()\\\">\\n      Salvar <i class=\\\"fa\\\"></i>\\n    </button>\\n  </div>\\n</div>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","export default \".modal-body {\\n  padding: 10px;\\n}\\n.modal-body input {\\n  border-radius: 10px;\\n}\\n.modal-body .btn-save {\\n  float: right;\\n  padding-top: 7px;\\n  padding-bottom: 7px;\\n  margin-top: 13px;\\n  margin-bottom: 5px;\\n}\\n.modal-body i {\\n  font-size: 24px;\\n}\\n.modal-body .mandatory {\\n  color: red;\\n}\\n.modal-body input::-webkit-input-placeholder {\\n  color: #bdc2c7;\\n}\\n::ng-deep .ant-select-selection {\\n  height: 100%;\\n}\\n.modal-header {\\n  background: #4cbca3 !important;\\n}\\n::ng-deep .ant-modal-header {\\n  background: #4cbca3 !important;\\n  border-radius: 4px 4px 0 0;\\n}\\n::ng-deep .ant-modal-title {\\n  color: white !important;\\n  font-size: 17px;\\n}\\n::ng-deep .ant-modal {\\n  width: 600px !important;\\n}\\n.modal-footer {\\n  margin: 0;\\n}\";","import { Component, OnInit } from '@angular/core';\n\nimport { NzModalService } from 'ng-zorro-antd/modal';\nimport { ModalAddAdditionalFeatureComponent } from '../../modal-add-additional-feature/modal-add-additional-feature.component';\n\nimport { AdditionalFeatureService } from './additional-feature.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-features-listing',\n  templateUrl: './features-listing.component.html',\n  styleUrls: ['./features-listing.component.scss']\n})\nexport class FeaturesListingComponent implements OnInit {\n  loading: boolean;\n  filter = { name: '', destination: '', code: '' };\n  pageSize = 10;\n  paginationData = { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 };\n  data: any;\n  destinationsOptions = [\n    { label: 'Todos', value: '' },\n    { label: 'Pacientes', value: 'patient' },\n    { label: 'Médicos', value: 'doctor' },\n    { label: 'Dentistas', value: 'dentist' },\n    { label: 'Farmácias', value: 'pharmacy' },\n    { label: 'Farmacêuticos', value: 'pharmacist' }\n  ];\n\n  destinations = {\n    patient: 'Pacientes',\n    doctor: 'Médicos',\n    dentist: 'Dentistas',\n    pharmacy: 'Farmácias',\n    pharmacist: 'Farmacêuticos'\n  };\n\n  constructor(\n    private additionalFeatureService: AdditionalFeatureService,\n    private modalService: NzModalService\n  ) {}\n\n  @nativeAsync\n  async ngOnInit() {\n    await this.getAdditionalsFeatures();\n  }\n\n  @nativeAsync\n  async getAdditionalsFeatures() {\n    try {\n      this.loading = true;\n      this.data = await this.additionalFeatureService\n        .getAdditionalFeatures(this.getFilter())\n        .toPromise();\n      this.loading = false;\n    } catch (error) {\n      this.loading = false;\n    }\n  }\n\n  filterData() {\n    this.paginationData.skip = 0;\n    this.getAdditionalsFeatures();\n  }\n\n  getFilter() {\n    return {\n      ...this.filter,\n      skip: this.paginationData.skip,\n      limit: this.pageSize,\n      orderBy: this.paginationData.orderBy,\n      sortOrder: this.paginationData.sortOrder\n    };\n  }\n\n  showModalAddFeature() {\n    const modal = this.modalService.create({\n      nzContent: ModalAddAdditionalFeatureComponent,\n      nzComponentParams: {},\n      nzTitle: 'Nova funcionalidade',\n      nzClosable: false,\n      nzFooter: null\n    });\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().updateListFeatures.subscribe(result => this.filterData());\n    });\n  }\n\n  showModalEditFeature(feature, index) {\n    const modal = this.modalService.create({\n      nzContent: ModalAddAdditionalFeatureComponent,\n      nzComponentParams: {\n        feature: feature,\n        index: index\n      },\n      nzTitle: 'Editar funcionalidade',\n      nzClosable: false,\n      nzFooter: null\n    });\n\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().updateListFeatures.subscribe(result => {\n        this.updateListFeature();\n      });\n    });\n  }\n  @nativeAsync\n  async updateListFeature() {\n    this.paginationData.skip = 0;\n    await this.getAdditionalsFeatures();\n  }\n  @nativeAsync\n  async pageIndexChanged(pageIndex: any) {\n    this.paginationData.skip = this.pageSize * (pageIndex - 1);\n    await this.getAdditionalsFeatures();\n  }\n  @nativeAsync\n  async onSortChange(params) {\n    this.paginationData.orderBy = params.key;\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\n    await this.getAdditionalsFeatures();\n  }\n\n  getDestinations(destinations: string[]) {\n    return destinations.map(d => this.destinations[d]).join(', ');\n  }\n}\n","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.buttons {\\n  padding-top: 33px;\\n}\\n\\n.buttons button {\\n  margin-right: 15px;\\n}\";","export default \"<div class=\\\"row\\\">\\n  <div class=\\\"col-md-12\\\">\\n    <h2 class=\\\"title\\\">{{ title }}</h2>\\n  </div>\\n</div>\\n\\n<div class=\\\"filter-form\\\">\\n  <form nz-form (ngSubmit)=\\\"filterData()\\\">\\n    <div class=\\\"row\\\">\\n      <ng-container\\n        *ngIf=\\\"\\n          listingType === 'healthProfessionals' ||\\n          listingType === 'patients' ||\\n          listingType === 'pharmacists' ||\\n          listingType === 'veterinarians'\\n        \\\"\\n      >\\n        <div class=\\\"col-md-3\\\">\\n          <nz-form-label nzFor=\\\"nome\\\">Nome:</nz-form-label>\\n          <input nz-input id=\\\"nome\\\" name=\\\"name\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.name\\\" />\\n        </div>\\n\\n        <div class=\\\"col-md-3\\\">\\n          <nz-form-label nzFor=\\\"email\\\">E-mail:</nz-form-label>\\n          <input nz-input id=\\\"email\\\" name=\\\"email\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.email\\\" />\\n        </div>\\n\\n        <div class=\\\"col-md-3\\\">\\n          <nz-form-label nzFor=\\\"cpf\\\">CPF:</nz-form-label>\\n          <input\\n            nz-input\\n            id=\\\"cpf\\\"\\n            name=\\\"cpf\\\"\\n            mask=\\\"000.000.000-00\\\"\\n            type=\\\"text\\\"\\n            [(ngModel)]=\\\"filter.cpf\\\"\\n          />\\n        </div>\\n\\n        <div class=\\\"col-md-3\\\" *ngIf=\\\"listingType === 'patients'\\\">\\n          <nz-form-label nzFor=\\\"responsibleCpf\\\">CPF do Responsável:</nz-form-label>\\n          <input\\n            nz-input\\n            id=\\\"responsibleCpf\\\"\\n            name=\\\"responsibleCpf\\\"\\n            type=\\\"text\\\"\\n            [(ngModel)]=\\\"filter.responsibleCpf\\\"\\n            mask=\\\"000.000.000-00\\\"\\n          />\\n        </div>\\n      </ng-container>\\n\\n      <ng-container *ngIf=\\\"listingType === 'pharmacies'\\\">\\n        <div class=\\\"col-3\\\">\\n          <nz-form-label nzFor=\\\"businessName\\\">Nome empresarial:</nz-form-label>\\n          <input\\n            nz-input\\n            id=\\\"businessName\\\"\\n            name=\\\"businessName\\\"\\n            type=\\\"text\\\"\\n            [(ngModel)]=\\\"filter.businessName\\\"\\n          />\\n        </div>\\n        <div class=\\\"col-3\\\">\\n          <nz-form-label nzFor=\\\"fantasyName\\\">Nome fantasia:</nz-form-label>\\n          <input\\n            nz-input\\n            id=\\\"fantasyName\\\"\\n            name=\\\"fantasyName\\\"\\n            type=\\\"text\\\"\\n            [(ngModel)]=\\\"filter.fantasyName\\\"\\n          />\\n        </div>\\n\\n        <div class=\\\"col-3\\\">\\n          <nz-form-label nzFor=\\\"email\\\">E-mail:</nz-form-label>\\n          <input nz-input id=\\\"email\\\" name=\\\"email\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.email\\\" />\\n        </div>\\n\\n        <div class=\\\"col-3\\\">\\n          <nz-form-label nzFor=\\\"cnpj\\\">CNPJ:</nz-form-label>\\n          <input\\n            nz-input\\n            id=\\\"cnpj\\\"\\n            name=\\\"cnpj\\\"\\n            type=\\\"text\\\"\\n            [(ngModel)]=\\\"filter.cnpj\\\"\\n            mask=\\\"00.000.000/0000-00\\\"\\n          />\\n        </div>\\n      </ng-container>\\n\\n      <ng-container *ngIf=\\\"listingType === 'additional-features'\\\">\\n        <div class=\\\"col-3\\\">\\n          <nz-form-label nzFor=\\\"name\\\">Nome:</nz-form-label>\\n          <input nz-input id=\\\"name\\\" name=\\\"name\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.name\\\" />\\n        </div>\\n\\n        <div class=\\\"col-3\\\">\\n          <nz-form-label nzFor=\\\"destination\\\">Destinação</nz-form-label>\\n          <input\\n            nz-input\\n            id=\\\"destination\\\"\\n            name=\\\"destination\\\"\\n            type=\\\"text\\\"\\n            [(ngModel)]=\\\"filter.destination\\\"\\n          />\\n        </div>\\n\\n        <div class=\\\"col-3\\\">\\n          <nz-form-label nzFor=\\\"code\\\">Código:</nz-form-label>\\n          <input nz-input id=\\\"code\\\" name=\\\"code\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.code\\\" />\\n        </div>\\n      </ng-container>\\n\\n      <ng-container\\n        *ngIf=\\\"\\n          listingType === 'prescriptions' ||\\n          listingType === 'attestations' ||\\n          listingType === 'exams' ||\\n          listingType === 'orientations' ||\\n          listingType === 'infusions'\\n        \\\"\\n      >\\n        <div class=\\\"row\\\">\\n          <div class=\\\"col-md-3\\\">\\n            <nz-form-label nzFor=\\\"initDate\\\">Data início:</nz-form-label>\\n            <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.initDate\\\" name=\\\"initDate\\\" />\\n          </div>\\n\\n          <div class=\\\"col-md-3\\\">\\n            <nz-form-label nzFor=\\\"endDate\\\">Data fim:</nz-form-label>\\n            <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.endDate\\\" name=\\\"endDate\\\" />\\n          </div>\\n\\n          <div class=\\\"col-md-3\\\">\\n            <nz-form-label nzFor=\\\"code\\\">Código da prescrição:</nz-form-label>\\n            <input nz-input id=\\\"code\\\" name=\\\"code\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.code\\\" />\\n          </div>\\n\\n          <div class=\\\"col-md-3\\\">\\n            <nz-form-label nzFor=\\\"prescriberCpf\\\">CPF do prescritor:</nz-form-label>\\n            <input\\n              nz-input\\n              id=\\\"prescriberCpf\\\"\\n              name=\\\"prescriberCpf\\\"\\n              type=\\\"text\\\"\\n              [(ngModel)]=\\\"filter.prescriberCpf\\\"\\n              mask=\\\"000.000.000-00\\\"\\n            />\\n          </div>\\n\\n          <div class=\\\"col-md-2\\\">\\n            <nz-form-label nzFor=\\\"patientCpf\\\">CPF do paciente:</nz-form-label>\\n            <input\\n              nz-input\\n              id=\\\"patientCpf\\\"\\n              name=\\\"patientCpf\\\"\\n              type=\\\"text\\\"\\n              [(ngModel)]=\\\"filter.patientCpf\\\"\\n              mask=\\\"000.000.000-00\\\"\\n            />\\n          </div>\\n\\n          <div class=\\\"col-md-2\\\">\\n            <nz-form-label nzFor=\\\"responsibleCpf\\\">CPF do Responsável:</nz-form-label>\\n            <input\\n              nz-input\\n              id=\\\"responsibleCpf\\\"\\n              name=\\\"responsibleCpf\\\"\\n              type=\\\"text\\\"\\n              [(ngModel)]=\\\"filter.responsibleCpf\\\"\\n              mask=\\\"000.000.000-00\\\"\\n            />\\n          </div>\\n\\n          <div\\n            *ngIf=\\\"\\n              listingType === 'prescriptions' ||\\n              listingType === 'attestations' ||\\n              listingType === 'exams' ||\\n              listingType === 'orientations'\\n            \\\"\\n            class=\\\"col-md-2\\\"\\n          >\\n            <nz-form-label nzFor=\\\"version\\\">Versão:</nz-form-label>\\n            <nz-select [(ngModel)]=\\\"filter.version\\\" name=\\\"version\\\">\\n              <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\"></nz-option>\\n              <nz-option nzValue=\\\"PRODUCTION\\\" nzLabel=\\\"Estável\\\"></nz-option>\\n              <nz-option nzValue=\\\"BETA\\\" nzLabel=\\\"Beta\\\"></nz-option>\\n            </nz-select>\\n          </div>\\n        </div>\\n      </ng-container>\\n\\n      <ng-container *ngIf=\\\"listingType === 'retentions'\\\">\\n        <div class=\\\"row\\\">\\n          <div class=\\\"col-md-2\\\">\\n            <nz-form-label nzFor=\\\"initDate\\\">Data início:</nz-form-label>\\n            <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.initDate\\\" name=\\\"initDate\\\" />\\n          </div>\\n          <div class=\\\"col-md-2\\\">\\n            <nz-form-label nzFor=\\\"endDate\\\">Data fim:</nz-form-label>\\n            <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.endDate\\\" name=\\\"endDate\\\" />\\n          </div>\\n          <div class=\\\"col-md-3\\\">\\n            <nz-form-label nzFor=\\\"code\\\">Código da prescrição:</nz-form-label>\\n            <input\\n              nz-input\\n              id=\\\"code\\\"\\n              name=\\\"prescriptionCode\\\"\\n              type=\\\"text\\\"\\n              [(ngModel)]=\\\"filter.prescriptionCode\\\"\\n            />\\n          </div>\\n\\n          <div class=\\\"col-md-3\\\">\\n            <nz-form-label nzFor=\\\"prescriberName\\\">Código da dispensação:</nz-form-label>\\n            <input\\n              nz-input\\n              id=\\\"prescriberName\\\"\\n              name=\\\"dispensationCode\\\"\\n              type=\\\"text\\\"\\n              [(ngModel)]=\\\"filter.dispensationCode\\\"\\n            />\\n          </div>\\n          <div class=\\\"col-md-2\\\">\\n            <nz-form-label nzFor=\\\"cpfBuyer\\\">CPF do comprador:</nz-form-label>\\n            <input\\n              nz-input\\n              id=\\\"cpfBuyer\\\"\\n              name=\\\"cpfBuyer\\\"\\n              type=\\\"text\\\"\\n              [(ngModel)]=\\\"filter.cpfBuyer\\\"\\n              mask=\\\"000.000.000-00\\\"\\n            />\\n          </div>\\n          <div class=\\\"col-md-2\\\">\\n            <nz-form-label nzFor=\\\"cnpjFarmacy\\\">CNPJ da farmácia:</nz-form-label>\\n            <input\\n              nz-input\\n              id=\\\"cnpjFarmacy\\\"\\n              name=\\\"cnpjPharmacy\\\"\\n              type=\\\"text\\\"\\n              [(ngModel)]=\\\"filter.cnpjPharmacy\\\"\\n              mask=\\\"00.000.000/0000-00\\\"\\n            />\\n          </div>\\n        </div>\\n      </ng-container>\\n\\n      <ng-container\\n        *ngIf=\\\"\\n          listingType === 'healthProfessionals' ||\\n          listingType === 'patients' ||\\n          listingType === 'pharmacists' ||\\n          listingType === 'pharmacies' ||\\n          listingType === 'veterinarians'\\n        \\\"\\n      >\\n        <div class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"access\\\">Acesso:</nz-form-label>\\n          <nz-select [(ngModel)]=\\\"filter.access\\\" name=\\\"access\\\">\\n            <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\"></nz-option>\\n            <nz-option nzValue=\\\"Desbloqueado\\\" nzLabel=\\\"Ativo\\\"></nz-option>\\n            <nz-option nzValue=\\\"Bloqueado\\\" nzLabel=\\\"Inativo\\\"></nz-option>\\n          </nz-select>\\n        </div>\\n\\n        <div class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"initDate\\\">Data início:</nz-form-label>\\n          <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.initDate\\\" name=\\\"initDate\\\" />\\n        </div>\\n\\n        <div class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"endDate\\\">Data fim:</nz-form-label>\\n          <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.endDate\\\" name=\\\"endDate\\\" />\\n        </div>\\n\\n        <div class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"status\\\">Status:</nz-form-label>\\n          <nz-select [(ngModel)]=\\\"filter.status\\\" name=\\\"status\\\">\\n            <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\"></nz-option>\\n            <nz-option nzValue=\\\"Valido\\\" nzLabel=\\\"Válido\\\"></nz-option>\\n            <nz-option nzValue=\\\"Inválido\\\" nzLabel=\\\"Inválido\\\"></nz-option>\\n            <nz-option nzValue=\\\"Pendente de validação\\\" nzLabel=\\\"Pendente de validação\\\"></nz-option>\\n          </nz-select>\\n        </div>\\n\\n        <div *ngIf=\\\"listingType === 'pharmacies'\\\" class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"covid\\\">Covid:</nz-form-label>\\n          <nz-select [(ngModel)]=\\\"filter.covid\\\" name=\\\"covid\\\">\\n            <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\"></nz-option>\\n            <nz-option nzValue=\\\"1\\\" nzLabel='\\\"Sim, realizo\\\"'></nz-option>\\n            <nz-option nzValue=\\\"2\\\" nzLabel='\\\"Não realizo\\\"'></nz-option>\\n            <nz-option nzValue=\\\"3\\\" nzLabel='\\\"Não realizo, mas gostaria de ter\\\"'></nz-option>\\n            <nz-option nzValue=\\\"null\\\" nzLabel=\\\"Sem resposta\\\"></nz-option>\\n          </nz-select>\\n        </div>\\n\\n        <div *ngIf=\\\"listingType === 'healthProfessionals'\\\" class=\\\"col-md-3\\\">\\n          <nz-form-label nzFor=\\\"createdBy\\\">Parceiros:</nz-form-label>\\n          <nz-select [(ngModel)]=\\\"filter.createdBy\\\" name=\\\"createdBy\\\" nzMode=\\\"multiple\\\">\\n            <nz-option\\n              *ngFor=\\\"let client of clients\\\"\\n              [nzValue]=\\\"client._id\\\"\\n              [nzLabel]=\\\"client.name\\\"\\n            ></nz-option>\\n          </nz-select>\\n        </div>\\n\\n        <div class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"tenantId\\\">Sistema:</nz-form-label>\\n          <nz-select [(ngModel)]=\\\"filter.tenantId\\\" name=\\\"tenantId\\\">\\n            <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\" [nzDisabled]=\\\"tenantRdOnly\\\"></nz-option>\\n            <nz-option nzValue=\\\"RD\\\" nzLabel=\\\"RD\\\"></nz-option>\\n            <nz-option nzValue=\\\"MRD\\\" nzLabel=\\\"MRD\\\" [nzDisabled]=\\\"tenantRdOnly\\\"></nz-option>\\n          </nz-select>\\n        </div>\\n      </ng-container>\\n\\n      <ng-container *ngIf=\\\"listingType === 'pets'\\\">\\n        <div class=\\\"col-md-3\\\">\\n          <nz-form-label nzFor=\\\"nome\\\">Nome:</nz-form-label>\\n          <input nz-input id=\\\"nome\\\" name=\\\"name\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.name\\\" />\\n        </div>\\n        <div class=\\\"col-md-3\\\">\\n          <nz-form-label nzFor=\\\"responsibleName\\\">Nome Responsável:</nz-form-label>\\n          <input\\n            nz-input\\n            id=\\\"responsibleName\\\"\\n            name=\\\"responsibleName\\\"\\n            type=\\\"responsibleName\\\"\\n            [(ngModel)]=\\\"filter.responsibleName\\\"\\n          />\\n        </div>\\n\\n        <div class=\\\"col-md-3\\\">\\n          <nz-form-label nzFor=\\\"responsibleCpf\\\">CPF do Responsável:</nz-form-label>\\n          <input\\n            nz-input\\n            id=\\\"responsibleCpf\\\"\\n            name=\\\"responsibleCpf\\\"\\n            type=\\\"text\\\"\\n            [(ngModel)]=\\\"filter.responsibleCpf\\\"\\n            mask=\\\"000.000.000-00\\\"\\n          />\\n        </div>\\n        <div class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"initDate\\\">Data início:</nz-form-label>\\n          <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.initDate\\\" name=\\\"initDate\\\" />\\n        </div>\\n\\n        <div class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"endDate\\\">Data fim:</nz-form-label>\\n          <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.endDate\\\" name=\\\"endDate\\\" />\\n        </div>\\n        <div class=\\\"col-md-2\\\">\\n          <nz-form-label nzFor=\\\"tenantId\\\">Sistema:</nz-form-label>\\n          <nz-select [(ngModel)]=\\\"filter.tenantId\\\" name=\\\"tenantId\\\">\\n            <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\" [nzDisabled]=\\\"tenantRdOnly\\\"></nz-option>\\n            <nz-option nzValue=\\\"RD\\\" nzLabel=\\\"RD\\\"></nz-option>\\n            <nz-option nzValue=\\\"MRD\\\" nzLabel=\\\"MRD\\\" [nzDisabled]=\\\"tenantRdOnly\\\"></nz-option>\\n          </nz-select>\\n        </div>\\n      </ng-container>\\n    </div>\\n\\n    <div class=\\\"row\\\">\\n      <div class=\\\"col-md-2 buttons\\\">\\n        <button nz-button type=\\\"submit\\\" nzType=\\\"primary\\\" class=\\\"button\\\">\\n          <i nz-icon nzType=\\\"search\\\"></i>\\n          Filtrar\\n        </button>\\n      </div>\\n      <div class=\\\"col-md-2 buttons\\\" *ngIf=\\\"user.permission === Permission.MASTER && exportDataBtn\\\">\\n        <button nz-button type=\\\"button\\\" nzType=\\\"primary\\\" class=\\\"button\\\" (click)=\\\"exportData()\\\">\\n          <i nz-icon nzType=\\\"export\\\"></i>\\n          Exportar\\n        </button>\\n      </div>\\n\\n      <div class=\\\"col-md-3 buttons\\\">\\n        <button\\n          nz-button\\n          type=\\\"button\\\"\\n          nzType=\\\"primary\\\"\\n          class=\\\"button\\\"\\n          (click)=\\\"resolvePendingEmit.emit(null)\\\"\\n          *ngIf=\\\"user.permission === Permission.MASTER && listingType === 'healthProfessionals'\\\"\\n        >\\n          <i nz-icon nzType=\\\"redo\\\" nz=\\\"outline\\\"></i>\\n          Resolver médicos pendentes\\n        </button>\\n      </div>\\n    </div>\\n  </form>\\n</div>\\n\";","import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\nimport { AuthService } from '@app/core/services/auth.service';\nimport { User } from '@app/shared/models/decodedLoginToken';\nimport { Permission } from '@app/shared/models/permission.enum';\nimport * as moment from 'moment';\nimport { AdminService } from '../../admin.service';\n\n@Component({\n  selector: 'app-form-filter',\n  templateUrl: './form-filter.component.html',\n  styleUrls: ['./form-filter.component.scss']\n})\nexport class FormFilterComponent implements OnInit, OnChanges {\n  @Input() listingType: string;\n  @Input() title: string;\n  @Input() resolvePendingView = false;\n  @Input() exportDataBtn = true;\n\n  @Output() filterDataEvent = new EventEmitter<any>();\n  @Output() exportDataEmit = new EventEmitter<any>();\n  @Output() resolvePendingEmit = new EventEmitter();\n\n  Permission = Permission;\n\n  filters: any;\n\n  clients = [];\n\n  constructor(private adminService: AdminService, private authService: AuthService) {}\n\n  ngOnChanges(changes: SimpleChanges): void {\n    if (changes['listingType'].currentValue) {\n      this.filters = this.initFilter;\n      this.changeDate();\n    }\n  }\n\n  ngOnInit() {\n    this.changeDate();\n  }\n\n  changeDate() {\n    Object.keys(this.filters).forEach(key => {\n      const filter = this.filters[key];\n      if (filter.hasOwnProperty('initDate') && filter.hasOwnProperty('endDate')) {\n        filter.initDate = moment(new Date())\n          .subtract(30, 'days')\n          .format('YYYY-MM-DD');\n\n        filter.endDate = moment(new Date()).format('YYYY-MM-DD');\n      }\n    });\n\n    if (this.filter && this.filter.initDate) {\n      this.filterData();\n    }\n\n    this.adminService.getClientApps().subscribe(clients => (this.clients = clients));\n\n    if (this.tenantRdOnly) {\n      this.filter.tenantId = 'RD';\n    }\n  }\n\n  get initFilter() {\n    return {\n      patients: {\n        name: '',\n        email: '',\n        cpf: '',\n        responsibleCpf: '',\n        status: '',\n        access: '',\n        tenantId: ''\n      },\n      healthProfessionals: {\n        initDate: '',\n        endDate: '',\n        name: '',\n        email: '',\n        cpf: '',\n        status: '',\n        access: '',\n        createdBy: [],\n        tenantId: ''\n      },\n      veterinarians: {\n        initDate: '',\n        endDate: '',\n        name: '',\n        email: '',\n        cpf: '',\n        status: '',\n        access: '',\n        createdBy: [],\n        tenantId: ''\n      },\n      pharmacies: {\n        businessName: '',\n        fantasyName: '',\n        email: '',\n        cnpj: '',\n        status: '',\n        access: '',\n        tenantId: ''\n      },\n      pharmacists: { name: '', email: '', cpf: '', status: '', access: '', tenantId: '' },\n      prescriptions: {\n        initDate: '',\n        endDate: '',\n        code: '',\n        prescriberCpf: '',\n        patientCpf: '',\n        responsibleCpf: '',\n        version: ''\n      },\n      attestations: {\n        initDate: '',\n        endDate: '',\n        code: '',\n        prescriberCpf: '',\n        patientCpf: '',\n        responsibleCpf: '',\n        version: ''\n      },\n      exams: {\n        initDate: '',\n        endDate: '',\n        code: '',\n        prescriberCpf: '',\n        patientCpf: '',\n        responsibleCpf: '',\n        version: ''\n      },\n      orientations: {\n        initDate: '',\n        endDate: '',\n        code: '',\n        prescriberCpf: '',\n        patientCpf: '',\n        responsibleCpf: '',\n        version: ''\n      },\n      infusions: { initDate: '', endDate: '', code: '', prescriberCpf: '', patientCpf: '' },\n      retentions: {\n        prescriptionCode: '',\n        initDate: '',\n        endDate: '',\n        dispensationCode: '',\n        cpfBuyer: '',\n        cnpjPharmacy: ''\n      },\n      'additional-features': { name: '', destination: '', code: '' },\n      pets: {\n        name: '',\n        responsibleCpf: '',\n        responsibleName: '',\n        initDate: '',\n        endDate: '',\n        tenantId: ''\n      }\n    };\n  }\n\n  get user(): User {\n    return this.authService.user();\n  }\n\n  private get hasCustomFilter() {\n    return Object.entries(this.filter).some(\n      ([key, value]) =>\n        key !== 'tenantId' &&\n        key !== 'access' &&\n        key !== 'covid' &&\n        key !== 'createdBy' &&\n        key !== 'version' &&\n        value\n    );\n  }\n\n  get filter() {\n    return this.filters[this.listingType];\n  }\n\n  get tenantRdOnly(): boolean {\n    return this.listingType === 'healthProfessionals' && this.user.permission !== Permission.MASTER;\n  }\n\n  filterData() {\n    this.filterDataEvent.emit(this.filter);\n  }\n\n  exportData() {\n    this.exportDataEmit.emit(this.filter);\n  }\n}\n","export default \".filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.buttons {\\n  padding-top: 15px;\\n  padding-right: 22px;\\n  margin-right: 5px;\\n}\\n\\n.button {\\n  width: 100%;\\n}\";","export default \"<app-form-filter\\n  listingType=\\\"healthProfessionals\\\"\\n  [title]=\\\"title\\\"\\n  (filterDataEvent)=\\\"filterData($event)\\\"\\n  (exportDataEmit)=\\\"exportData($event)\\\"\\n  (resolvePendingEmit)=\\\"resolvePending()\\\"\\n>\\n</app-form-filter>\\n\\n<nz-table\\n  #listingTable\\n  style=\\\"overflow-x: auto;\\\"\\n  nzFrontPagination=\\\"false\\\"\\n  [nzTotal]=\\\"data?.totalRecord\\\"\\n  [nzData]=\\\"data?.list\\\"\\n  [nzPageSize]=\\\"pageSize\\\"\\n  nzSize=\\\"default\\\"\\n  (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n  style=\\\"overflow-x: auto;\\\"\\n  [nzLoading]=\\\"loading\\\"\\n>\\n  <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\n    <tr>\\n      <th></th>\\n      <th nzShowSort nzSortKey=\\\"createdAt\\\">Data de criação</th>\\n      <th nzShowSort nzSortKey=\\\"tenantId\\\">Sistema</th>\\n      <th nzShowSort nzSortKey=\\\"createdBy\\\">Parceiro</th>\\n      <th nzShowSort nzSortKey=\\\"fullname\\\">Nome completo</th>\\n      <th nzShowSort nzSortKey=\\\"name\\\">Nome</th>\\n      <th>E-mail</th>\\n      <th>CPF</th>\\n      <th>{{ getProfessionalTypeNameLabel() }}</th>\\n      <th>Cel.</th>\\n      <th colspan=\\\"7\\\"></th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-healthProfessional let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <tr>\\n        <td nzShowExpand [(nzExpand)]=\\\"healthProfessional.expand\\\"></td>\\n        <td>{{ healthProfessional.createdAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n        <!-- <td>{{ healthProfessional.tenantId || 'RD' }}</td> -->\\n        <td>\\n          <a\\n            *ngIf=\\\"!healthProfessional.loadingTenant\\\"\\n            nz-dropdown\\n            nzTrigger=\\\"click\\\"\\n            [nzDropdownMenu]=\\\"menu\\\"\\n            style=\\\"display: flex;align-items: center; gap: 16px;\\\"\\n            [nzDisabled]=\\\"isLoading\\\"\\n          >\\n            <span>{{ healthProfessional.tenantId || 'RD' }}</span>\\n            <i nz-icon nzType=\\\"down\\\"></i>\\n          </a>\\n          <nz-dropdown-menu #menu=\\\"nzDropdownMenu\\\">\\n            <ul nz-menu nzSelectable>\\n              <li\\n                nz-menu-item\\n                (click)=\\\"toggleTentat(healthProfessional.userId, null)\\\"\\n                *ngIf=\\\"healthProfessional.tenantId === 'MRD'\\\"\\n              >\\n                RD\\n              </li>\\n              <li\\n                nz-menu-item\\n                (click)=\\\"toggleTentat(healthProfessional.userId, 'MRD')\\\"\\n                *ngIf=\\\"!healthProfessional.tenantId\\\"\\n              >\\n                MRD\\n              </li>\\n            </ul>\\n          </nz-dropdown-menu>\\n          <i\\n            *ngIf=\\\"healthProfessional.loadingTenant\\\"\\n            nz-icon\\n            [nzType]=\\\"'sync'\\\"\\n            [nzSpin]=\\\"healthProfessional.loadingTenant\\\"\\n          ></i>\\n        </td>\\n        <td>{{ healthProfessional.createdBy?.name }}</td>\\n        <td>{{ healthProfessional.fullname }}</td>\\n        <td>{{ healthProfessional.name }}</td>\\n        <td>\\n          <span *ngIf=\\\"healthProfessional.user as user\\\">\\n            {{ user.email }}\\n            <span *ngIf=\\\"user.emailContact && user.emailContact !== user.email\\\">\\n              / {{ user.emailContact }}\\n            </span>\\n          </span>\\n        </td>\\n        <td>{{ healthProfessional.cpf | formattedCpf }}</td>\\n        <td>\\n          {{ healthProfessional.regionalCouncilNumber?.number }}-{{\\n            healthProfessional.regionalCouncilNumber?.uf\\n          }}\\n        </td>\\n        <td>{{ healthProfessional.cellphone | formattedCel }}</td>\\n\\n        <td\\n          class=\\\"action-btn\\\"\\n          *ngIf=\\\"healthProfessional.loadingRevalidate; else templateIconCpfInvalido\\\"\\n        >\\n          <a style=\\\"display: flex;\\\" title=\\\"Em processamento...\\\"\\n            ><i nz-icon [nzType]=\\\"'sync'\\\" [nzSpin]=\\\"healthProfessional.loadingRevalidate\\\"></i\\n          ></a>\\n        </td>\\n\\n        <ng-template #templateIconCpfInvalido>\\n          <td\\n            class=\\\"action-btn\\\"\\n            *ngIf=\\\"healthProfessional.user.userStatus !== 'Valido'; else templateIconCpfValido\\\"\\n          >\\n            <a style=\\\"display: flex;\\\" title=\\\"Revalidar CPF\\\"\\n              ><i nz-icon [nzType]=\\\"'sync'\\\" (click)=\\\"revalidateCpf(healthProfessional)\\\"></i\\n            ></a>\\n          </td>\\n        </ng-template>\\n\\n        <ng-template #templateIconCpfValido>\\n          <td class=\\\"action-btn\\\">\\n            <a style=\\\"display: flex;\\\" title=\\\"CPF válido\\\"\\n              ><i\\n                nz-icon\\n                [nzType]=\\\"'check-circle'\\\"\\n                [nzTheme]=\\\"'twotone'\\\"\\n                [nzTwotoneColor]=\\\"'#52c41a'\\\"\\n                (click)=\\\"revalidateCpf(healthProfessional)\\\"\\n              ></i\\n            ></a>\\n          </td>\\n        </ng-template>\\n\\n        <ng-container *ngIf=\\\"healthProfessional.professionalType === 'doctor'\\\">\\n          <td\\n            class=\\\"action-btn\\\"\\n            (click)=\\\"refreshCrmStatus(healthProfessional)\\\"\\n            *ngIf=\\\"!healthProfessional.loading\\\"\\n          >\\n            <span *ngIf=\\\"healthProfessional?.cfm as cfm; else errorCode\\\">\\n              <a\\n                title=\\\"Registro professional válido\\\"\\n                *ngIf=\\\"\\n                  cfm?.situation?.status === 'ok' ||\\n                    (cfm?.validar?.resultadoConsulta && cfm?.consultar?.isValid);\\n                  else warn\\n                \\\"\\n              >\\n                <i class=\\\"fas fa-address-card\\\" style=\\\"color: #24a960\\\"></i>\\n              </a>\\n              <ng-template #warn>\\n                <a\\n                  [title]=\\\"cfm?.situation?.description || cfm?.consultar?.situation?.description\\\"\\n                  *ngIf=\\\"\\n                    cfm?.situation?.status === 'warn' ||\\n                      (cfm?.validar?.resultadoConsulta && !cfm?.consultar?.isValid);\\n                    else error\\n                  \\\"\\n                >\\n                  <i class=\\\"fas fa-address-card\\\" style=\\\"color: #f18434\\\"></i>\\n                </a>\\n              </ng-template>\\n              <ng-template #error>\\n                <span\\n                  *ngIf=\\\"\\n                    healthProfessional.cfm?.errorMessage || !cfm?.validar?.resultadoConsulta;\\n                    else undef\\n                  \\\"\\n                >\\n                  <a title=\\\"Erro ao validar registro\\\">\\n                    <i class=\\\"fas fa-address-card\\\" style=\\\"color: #E94A3C\\\"></i>\\n                  </a>\\n                </span>\\n              </ng-template>\\n              <ng-template #undef>\\n                <a title=\\\"Erro ao validar registro\\\">\\n                  <i class=\\\"fas fa-address-card\\\" style=\\\"color: #4d4d4d\\\"></i>\\n                </a>\\n              </ng-template>\\n            </span>\\n            <ng-template #errorCode>\\n              <span>\\n                <a title=\\\"Erro ao validar registro\\\">\\n                  <i class=\\\"fas fa-address-card\\\" style=\\\"color: #E94A3C\\\"></i>\\n                </a>\\n              </span>\\n            </ng-template>\\n          </td>\\n          <td class=\\\"action-btn\\\" *ngIf=\\\"healthProfessional.loading\\\">\\n            <div class=\\\"fa-3x\\\">\\n              <i class=\\\"fas fa-spinner fa-pulse\\\"></i>\\n            </div>\\n          </td>\\n        </ng-container>\\n        <td class=\\\"action-btn\\\">\\n          <a (click)=\\\"showModalEditData(healthProfessional, i)\\\" title=\\\"Editar\\\"\\n            ><img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\"\\n          /></a>\\n        </td>\\n        <td class=\\\"action-btn\\\">\\n          <a (click)=\\\"showModalAdditionalsFeatures(healthProfessional)\\\" title=\\\"Funcionalidade adicionais\\\"\\n            ><i nz-icon nzType=\\\"tool\\\" nzTheme=\\\"outline\\\"></i\\n          ></a>\\n        </td>\\n        <td class=\\\"action-btn\\\">\\n          <a (click)=\\\"showCommercialData(healthProfessional, i)\\\" title=\\\"Dados comerciais\\\"\\n            ><img src=\\\"assets/icons/briefcase-solid.svg\\\"\\n          /></a>\\n        </td>\\n        <td class=\\\"action-btn\\\" *ngIf=\\\"user.permission === Permission.MASTER\\\">\\n          <a (click)=\\\"showImportPatients(healthProfessional, i)\\\" title=\\\"Importar pacientes\\\"\\n            ><i class=\\\"fas fa-upload\\\"></i>\\n          </a>\\n        </td>\\n        <td class=\\\"action-btn\\\" *ngIf=\\\"user.permission === Permission.MASTER\\\">\\n          <nz-switch\\n            nzCheckedChildren=\\\"Ativo\\\"\\n            (ngModelChange)=\\\"toggleLocked($event, healthProfessional.user)\\\"\\n            [ngModel]=\\\"isUserUnlocked(healthProfessional.user)\\\"\\n            nzUnCheckedChildren=\\\"Inativo\\\"\\n          ></nz-switch>\\n        </td>\\n      </tr>\\n      <tr [(nzExpand)]=\\\"healthProfessional.expand\\\">\\n        <td></td>\\n        <td colspan=\\\"4\\\">\\n          <div>Especialidades: {{ getProfessionalSpecialties(healthProfessional) }}</div>\\n          <div>\\n            Telefone:\\n            <span *ngIf=\\\"healthProfessional.telephone\\\">{{\\n              healthProfessional.telephone | formattedTel\\n            }}</span>\\n            <span *ngIf=\\\"!healthProfessional.telephone\\\">Não cadastrado</span>\\n          </div>\\n          <div>\\n            Data de nascimento:\\n            <span *ngIf=\\\"healthProfessional.dateOfBirth\\\">{{\\n              healthProfessional.dateOfBirth | date: 'dd/MM/yyyy':'GMT'\\n            }}</span>\\n            <span *ngIf=\\\"!healthProfessional.dateOfBirth\\\">Não cadastrado</span>\\n          </div>\\n          <div *ngIf=\\\"healthProfessional.cfm as cfm; else templateCfmEmpty\\\" style=\\\"margin-top: 16px;\\\">\\n            <ng-container *ngIf=\\\"cfm.novoPadraoDados; else templateAntigo\\\">\\n              <div style=\\\"display: flex; align-items: center; gap: 8px;\\\">\\n                <span\\n                  >CRM: {{ cfm?.consultar?.crm || cfm?.validar?.crm }} -\\n                  {{ cfm?.consultar?.uf || cfm?.validar?.uf }}</span\\n                >\\n                <span\\n                  [ngClass]=\\\"\\n                    cfm?.validar?.resultadoConsulta ? 'badge badge-success' : 'badge badge-danger'\\n                  \\\"\\n                  >{{ cfm?.validar?.resultadoConsulta ? 'Válido' : 'Inválido' }}</span\\n                >\\n              </div>\\n              <div *ngIf=\\\"cfm?.consultar?.name\\\">Nome no CRM: {{ cfm?.consultar?.name }}</div>\\n              <ng-container *ngIf=\\\"cfm?.consultar?.situation\\\">\\n                <div>Situação CRM: {{ cfm?.consultar?.situation?.description }}</div>\\n                <div>Código: {{ cfm?.consultar?.situation?.code }}</div>\\n                <div>Inscrição: {{ cfm?.consultar?.inscription?.description }}</div>\\n              </ng-container>\\n              <ng-container *ngIf=\\\"cfm?.consultar?.errorCode\\\">\\n                <div>\\n                  Erro verificação registro CRM: {{ cfm?.consultar?.errorCode }} -\\n                  {{ cfm?.consultar?.errorMessage }}\\n                </div>\\n              </ng-container>\\n              <ng-container *ngIf=\\\"cfm?.consultar?.error\\\">\\n                <div>Erro verificação registro CRM: {{ cfm?.error }}</div>\\n              </ng-container>\\n              <div *ngIf=\\\"cfm?.consultar?.specialties\\\">\\n                Especialidades: {{ cfm?.consultar?.specialties.join(',') }}\\n              </div>\\n            </ng-container>\\n            <ng-template #templateAntigo>\\n              <div>CRM: {{ cfm.crm }} - {{ cfm.uf }}</div>\\n              <div *ngIf=\\\"cfm.name\\\">Nome no CRM: {{ cfm.name }}</div>\\n              <ng-container *ngIf=\\\"cfm.situation\\\">\\n                <div>Situação CRM: {{ cfm.situation.description }}</div>\\n                <div>Código: {{ cfm.situation.code }}</div>\\n                <div>Inscrição: {{ cfm.inscription.description }}</div>\\n              </ng-container>\\n              <ng-container *ngIf=\\\"cfm.errorCode\\\">\\n                <div>Erro verificação registro CRM: {{ cfm.errorCode }} - {{ cfm.errorMessage }}</div>\\n              </ng-container>\\n              <ng-container *ngIf=\\\"cfm.error\\\">\\n                <div>Erro verificação registro CRM: {{ cfm.error }}</div>\\n              </ng-container>\\n              <div *ngIf=\\\"cfm.specialties\\\">Especialidades: {{ cfm.specialties.join(',') }}</div>\\n            </ng-template>\\n          </div>\\n          <ng-template #templateCfmEmpty>\\n            <div>Profissional sem consulta de CFM realizada</div>\\n          </ng-template>\\n        </td>\\n        <td>\\n          <div style=\\\"display: flex;flex-direction: column; gap: 8px;\\\">\\n            <div style=\\\"display: flex;align-items: center;gap: 8px;\\\">\\n              Status:\\n              <span class=\\\"badge badge-success\\\" *ngIf=\\\"healthProfessional.user.userStatus === 'Valido'\\\"\\n                >VÁLIDO</span\\n              >\\n              <span\\n                *ngIf=\\\"healthProfessional.user.userStatus === 'Pendente de validação'\\\"\\n                class=\\\"badge badge-warning\\\"\\n                >PENDENTE DE VALIDAÇÃO</span\\n              >\\n              <span *ngIf=\\\"healthProfessional.user.userStatus === 'Inválido'\\\" class=\\\"badge badge-danger\\\"\\n                >INVÁLIDO</span\\n              >\\n            </div>\\n            <div *ngIf=\\\"healthProfessional.user.pendency\\\">\\n              Erro: <strong>{{ healthProfessional.user.pendency.erro }}</strong>\\n            </div>\\n          </div>\\n        </td>\\n        <td colspan=\\\"12\\\">\\n          <div\\n            style=\\\"display: flex;flex-direction: column;gap: 8px;\\\"\\n            *ngIf=\\\"\\n              healthProfessional.user.activationToken || healthProfessional.user.passwordResetToken;\\n              else tdEmpty\\n            \\\"\\n          >\\n            <span *ngIf=\\\"healthProfessional.user.activationToken\\\">\\n              Link de ativação: <br />\\n              <strong>{{\\n                getActivationLink(healthProfessional.user.activationToken, healthProfessional?.tenantId)\\n              }}</strong>\\n            </span>\\n\\n            <span *ngIf=\\\"healthProfessional.user.passwordResetToken\\\">\\n              Link de trocar senha:<br />\\n              <strong>\\n                {{\\n                  getResetLink(healthProfessional.user.passwordResetToken, healthProfessional?.tenantId)\\n                }}\\n              </strong>\\n            </span>\\n          </div>\\n        </td>\\n        <ng-template #tdEmpty>\\n          <div></div>\\n        </ng-template>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\\n<nz-modal\\n  [(nzVisible)]=\\\"commercialDataVisible\\\"\\n  nzTitle=\\\"Dados Comerciais\\\"\\n  (nzOnCancel)=\\\"setVisible(false)\\\"\\n  (nzOnOk)=\\\"setVisible(false)\\\"\\n>\\n  <div class=\\\"row\\\" *ngFor=\\\"let data of healthProfessional?.commercialData; index as i\\\">\\n    <span class=\\\"col-9\\\">{{ i + 1 }}. {{ data.name }}</span>\\n    <button\\n      class=\\\"col-3\\\"\\n      id=\\\"button-edit-business\\\"\\n      class=\\\"btn-edit\\\"\\n      (click)=\\\"showModalBusinessData(healthProfessional, i)\\\"\\n    >\\n      <img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\" />\\n    </button>\\n  </div>\\n</nz-modal>\\n\\n<nz-modal\\n  [nzVisible]=\\\"importPatientsVisible\\\"\\n  nzTitle=\\\"Importação de pacientes\\\"\\n  (nzOnCancel)=\\\"hideImportPatients()\\\"\\n  (nzOnOk)=\\\"uploadFile(healthProfessional._id, fileForm.value.file)\\\"\\n>\\n  <form [formGroup]=\\\"fileForm\\\">\\n    <app-input-file accept=\\\".csv\\\" formControlName=\\\"file\\\"></app-input-file>\\n  </form>\\n</nz-modal>\\n\";","import { Component, OnInit } from '@angular/core';\nimport { NzModalRef } from 'ng-zorro-antd/modal';\n\nimport { NzModalService } from 'ng-zorro-antd/modal';\nimport { AdditionalFeatureService } from '../listing/features-listing/additional-feature.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-modal-additionals-features',\n  templateUrl: './modal-additionals-features.component.html',\n  styleUrls: ['./modal-additionals-features.component.scss']\n})\nexport class ModalAdditionalsFeaturesComponent implements OnInit {\n  loading: boolean;\n  filter = { name: '', destination: '', code: '' };\n  pageSize = 10;\n  paginationData = { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 };\n  data: any;\n  additionalsFeaturesOptions = [];\n  additionalsFeaturesSelected = [];\n  destinations = {\n    patient: 'Pacientes',\n    doctor: 'Médicos',\n    dentist: 'Dentistas',\n    pharmacy: 'Farmácias',\n    pharmacist: 'Farmacêuticos'\n  };\n\n  user: any;\n  destination: string;\n\n  constructor(\n    private nzModalRef: NzModalRef,\n    private additionalFeatureService: AdditionalFeatureService,\n    private modalService: NzModalService\n  ) {}\n\n  @nativeAsync\n  async ngOnInit() {\n    await this.getAdditionalsFeaturesOptions();\n    this.getAdditionalsFeatures();\n  }\n\n  @nativeAsync\n  async getAdditionalsFeaturesOptions() {\n    try {\n      this.loading = true;\n      const result = await this.additionalFeatureService\n        .getAdditionalFeatures({ destination: this.destination })\n        .toPromise();\n      this.additionalsFeaturesOptions = result['additionalFeatures'];\n      this.loading = false;\n    } catch (error) {\n      this.loading = false;\n    }\n  }\n\n  @nativeAsync\n  async getAdditionalsFeatures() {\n    try {\n      this.loading = true;\n      this.data = await this.additionalFeatureService\n        .getAdditionalFeaturesByUser(this.user._id, this.getFilter())\n        .toPromise();\n      this.data.additionalFeatures.map(feature => {\n        this.additionalsFeaturesOptions = this.additionalsFeaturesOptions.filter(\n          option => option.code !== feature.code\n        );\n      });\n      this.loading = false;\n    } catch (error) {\n      this.loading = false;\n    }\n  }\n\n  getFilter() {\n    return {\n      ...this.filter,\n      skip: this.paginationData.skip,\n      limit: this.pageSize,\n      orderBy: this.paginationData.orderBy,\n      sortOrder: this.paginationData.sortOrder\n    };\n  }\n\n  handleCancel(): void {\n    this.nzModalRef.destroy();\n  }\n\n  pageIndexChanged(pageIndex: any) {\n    this.paginationData.skip = this.pageSize * (pageIndex - 1);\n    this.getAdditionalsFeatures();\n  }\n\n  onSortChange(params) {\n    this.paginationData.orderBy = params.key;\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\n    this.getAdditionalsFeatures();\n  }\n\n  @nativeAsync\n  async add() {\n    try {\n      await this.additionalFeatureService\n        .associateFunctionalities(this.user._id, this.additionalsFeaturesSelected)\n        .toPromise();\n      await this.getAdditionalsFeatures();\n      this.additionalsFeaturesSelected = [];\n    } catch (error) {\n      console.log(error);\n    }\n  }\n\n  @nativeAsync\n  async disassociateFunctionality(feature) {\n    try {\n      await this.additionalFeatureService\n        .disassociateFunctionality(this.user._id, feature._id)\n        .toPromise();\n      await this.getAdditionalsFeatures();\n      this.additionalsFeaturesOptions.push(feature);\n    } catch (error) {\n      console.log(error);\n    }\n  }\n\n  showConfirmDisassociate(feature) {\n    this.modalService.confirm({\n      nzTitle: '<i>Tem certeza que deseja desassociar esta funcionalidade?</i>',\n      nzContent: null,\n      nzOnOk: () => this.disassociateFunctionality(feature)\n    });\n  }\n}\n","export default \"<div>\\n  <div class=\\\"modal-body\\\">\\n    <div class=\\\"row\\\">\\n      <div class=\\\"col-9\\\">\\n        <nz-select\\n          [(ngModel)]=\\\"additionalsFeaturesSelected\\\"\\n          nzMode=\\\"multiple\\\"\\n          nzPlaceHolder=\\\"Selecione as funcionalidades\\\"\\n          theme\\n        >\\n          <nz-option\\n            *ngFor=\\\"let option of additionalsFeaturesOptions\\\"\\n            [nzLabel]=\\\"option.name\\\"\\n            [nzValue]=\\\"option._id\\\"\\n          >\\n          </nz-option>\\n        </nz-select>\\n      </div>\\n      <div class=\\\"col-3 btn-add \\\">\\n        <button\\n          class=\\\"ok-btn\\\"\\n          nz-button\\n          class=\\\"btn-primary\\\"\\n          [ngClass]=\\\"{ disabled: additionalsFeaturesSelected.length === 0 }\\\"\\n          (click)=\\\"add()\\\"\\n          [disabled]=\\\"additionalsFeaturesSelected.length === 0\\\"\\n        >\\n          Adicionar\\n        </button>\\n      </div>\\n    </div>\\n    <div class=\\\"table\\\">\\n      <nz-table\\n        #listingTable\\n        [nzLoading]=\\\"loading\\\"\\n        nzFrontPagination=\\\"false\\\"\\n        [nzTotal]=\\\"data?.totalRecord\\\"\\n        [nzData]=\\\"data?.additionalFeatures\\\"\\n        [nzPageSize]=\\\"pageSize\\\"\\n        (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n      >\\n        <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\n          <tr>\\n            <th nzShowSort nzSortKey=\\\"name\\\">Nome</th>\\n            <th>Destinação</th>\\n            <th>Código</th>\\n            <th></th>\\n          </tr>\\n        </thead>\\n\\n        <tbody>\\n          <ng-template ngFor let-feature let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n            <tr>\\n              <td>{{ feature.name }}</td>\\n              <td>{{ destinations[feature.destination] }}</td>\\n              <td>{{ feature.code }}</td>\\n              <td>\\n                <button\\n                  (click)=\\\"showConfirmDisassociate(feature)\\\"\\n                  title=\\\"Remover funcionalidade\\\"\\n                  class=\\\"btn btn-icon btn-simple\\\"\\n                  type=\\\"button\\\"\\n                >\\n                  <span class=\\\"btn-inner--icon\\\"><i class=\\\"fa fa-trash-solid\\\"></i></span>\\n                </button>\\n              </td>\\n            </tr>\\n          </ng-template>\\n        </tbody>\\n      </nz-table>\\n    </div>\\n  </div>\\n  <div class=\\\"modal-footer\\\">\\n    <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-default\\\" (click)=\\\"handleCancel()\\\">\\n      Fechar\\n    </button>\\n  </div>\\n</div>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","export default \".modal-body {\\n  padding: 10px;\\n}\\n.modal-body .disabled {\\n  opacity: 0.5;\\n}\\n.modal-body input {\\n  border-radius: 10px;\\n}\\n.modal-body .btn-add {\\n  padding-top: 5px;\\n}\\n.modal-body i {\\n  font-size: 24px;\\n}\\n.modal-body .mandatory {\\n  color: red;\\n}\\n.modal-body .table {\\n  padding-top: 15px;\\n}\\n.modal-body input::-webkit-input-placeholder {\\n  color: #bdc2c7;\\n}\\nnz-select {\\n  width: 100%;\\n}\\n::ng-deep .ant-modal-header {\\n  background: #4cbca3 !important;\\n  border-radius: 4px 4px 0 0;\\n}\\n::ng-deep .ant-modal-title {\\n  color: white !important;\\n  font-size: 17px;\\n}\";","import { AppToastService } from '@app/shared/services/app-toast.service';\nimport { AdminService } from '../admin.service';\nimport { Injector } from '@angular/core';\n\nexport abstract class BaseListingComponent<T> {\n  data: { list: T[]; totalRecord: number };\n  pageSize = 7;\n  isLoading = false;\n\n  protected adminService: AdminService;\n  protected notification: AppToastService;\n\n  constructor(public injector: Injector) {\n    this.adminService = injector.get<AdminService>(AdminService);\n    this.notification = injector.get<AppToastService>(AppToastService);\n  }\n\n  toggleTentat(userType: string, userId: string, value: string | null, ouSuccess: any) {\n    this.isLoading = true;\n    this.adminService.toggleTentat(userType, userId, value).subscribe(\n      () => {\n        ouSuccess();\n        this.isLoading = false;\n      },\n      httpError => {\n        console.log(httpError);\n        this.notification.notify('error', httpError.error.message);\n        this.isLoading = false;\n      }\n    );\n  }\n}\n","import { CoreService } from '@app/core/services/core.service';\nimport { Component, Injector, Input } from '@angular/core';\nimport { FormBuilder, FormGroup } from '@angular/forms';\nimport { AuthService } from '@app/core/services/auth.service';\nimport { ModalEditAddressDataComponent } from '@app/modules/dashboard/modal-edit-address-data/modal-edit-address-data.component';\nimport { ModalEditPersonalDataComponent } from '@app/modules/dashboard/modal-edit-personal-data/modal-edit-personal-data.component';\nimport { HealthProfessionalService } from '@app/modules/health-professional/services/health-professional.service';\nimport { UserService } from '@app/modules/user/user.service';\nimport { HealthProfessional } from '@app/shared/models';\nimport { User } from '@app/shared/models/decodedLoginToken';\nimport { Permission } from '@app/shared/models/permission.enum';\nimport { NzModalService } from 'ng-zorro-antd/modal';\nimport { ModalAdditionalsFeaturesComponent } from '../../modal-additionals-features/modal-additionals-features.component';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\nimport moment from 'moment';\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { BaseListingComponent } from '../base-listing.component';\n\n@Component({\n  selector: 'app-health-professional-listing',\n  templateUrl: './health-professional-listing.component.html',\n  styleUrls: ['./health-professional-listing.component.scss']\n})\nexport class HealthProfessionalListingComponent extends BaseListingComponent<HealthProfessional> {\n  @Input() professionalType: string;\n  @Input() listingType = 'healthProfessionals';\n\n  loading: boolean;\n  commercialDataVisible: boolean;\n  importPatientsVisible = false;\n  healthProfessional: HealthProfessional;\n  private filter: any;\n  pageSize = 10;\n  paginationData = { skip: 0, totalRecord: 0, orderBy: 'createdAt', sortOrder: -1 };\n\n  scrollConfig = { x: '830px', y: '583px' };\n\n  fileForm: FormGroup;\n  Permission = Permission;\n\n  constructor(\n    private fb: FormBuilder,\n    private authService: AuthService,\n    private healthProfessionalService: HealthProfessionalService,\n    private modalService: NzModalService,\n    private userService: UserService,\n    injector: Injector\n  ) {\n    super(injector);\n    this.fileForm = this.fb.group({\n      file: this.fb.control('')\n    });\n  }\n\n  get user(): User {\n    return this.authService.user();\n  }\n\n  get title() {\n    return `${this.getProfessionalTypeName()}s`;\n  }\n\n  getHealthProfessionals() {\n    this.loading = true;\n    this.healthProfessionalService\n      .getHealthProfessionalsByProfessionalType(this.professionalType, this.getFilter())\n      .subscribe(response => {\n        this.data = { list: response.healthProfessionals, totalRecord: response.totalRecord };\n      })\n      .add(() => {\n        this.loading = false;\n      });\n  }\n\n  filterData(filter) {\n    this.setFilter(filter);\n    this.getHealthProfessionals();\n  }\n\n  getFilter() {\n    return {\n      ...this.filter,\n      skip: this.paginationData.skip,\n      limit: this.pageSize,\n      orderBy: this.paginationData.orderBy,\n      sortOrder: this.paginationData.sortOrder\n    };\n  }\n\n  pageIndexChanged(pageIndex: any) {\n    this.paginationData.skip = this.pageSize * (pageIndex - 1);\n    this.getHealthProfessionals();\n  }\n\n  onSortChange(params) {\n    this.paginationData.orderBy = params.key;\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\n    this.getHealthProfessionals();\n  }\n\n  getProfessionalSpecialties(healthProfessional: HealthProfessional) {\n    if (healthProfessional.specialties) {\n      return healthProfessional.specialties.map(s => s.title).join(', ');\n    }\n  }\n\n  showModalEditData(healthProfessional: HealthProfessional, index: number) {\n    const modal = this.modalService.create({\n      nzContent: ModalEditPersonalDataComponent,\n      nzComponentParams: {\n        user: healthProfessional.user,\n        completeUser: healthProfessional,\n        userTypeLogged: this.user.userType\n      },\n      nzFooter: null,\n      nzWidth: 800\n    });\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().updateUserEvent.subscribe(user => {\n        const data = JSON.parse(JSON.stringify(this.data));\n        data.healthProfessionals[index] = user;\n        this.data = data;\n      });\n    });\n  }\n\n  showModalAdditionalsFeatures(healthProfessional: HealthProfessional) {\n    const modal = this.modalService.create({\n      nzContent: ModalAdditionalsFeaturesComponent,\n      nzComponentParams: {\n        user: healthProfessional.user,\n        destination: healthProfessional.professionalType\n      },\n      nzTitle: 'Funcionalidades adicionais',\n      nzClosable: false,\n      nzFooter: null\n    });\n  }\n\n  showCommercialData(healthProfessional: HealthProfessional) {\n    this.setVisible(true);\n    this.healthProfessional = healthProfessional;\n    console.log(this.healthProfessional);\n  }\n\n  showImportPatients(healthProfessional) {\n    this.importPatientsVisible = true;\n    this.healthProfessional = healthProfessional;\n  }\n\n  hideImportPatients() {\n    this.importPatientsVisible = false;\n    this.healthProfessional = null;\n    this.fileForm.reset();\n  }\n\n  setVisible(visible: boolean) {\n    this.commercialDataVisible = visible;\n  }\n\n  showModalBusinessData(healthProfessional: HealthProfessional, index: number) {\n    const modal = this.modalService.create({\n      nzContent: ModalEditAddressDataComponent,\n      nzComponentParams: {\n        commercialDataIndex: index,\n        commercialData: healthProfessional.commercialData[index],\n        completeUser: healthProfessional,\n        userType: 'healthProfessional'\n      },\n      nzFooter: null\n    });\n  }\n  @nativeAsync\n  async exportData(filter: any) {\n    try {\n      this.loading = true;\n      this.setFilter(filter);\n      await this.adminService.exportData(this.listingType, this.getFilter());\n    } catch (error) {\n      this.notification.notify('error', 'Erro', 'Erro na exportação');\n      console.error(error);\n    }\n    this.loading = false;\n  }\n\n  private setFilter(filter: any) {\n    this.filter = filter;\n    this.paginationData.skip = 0;\n  }\n\n  resolvePending() {\n    this.loading = true;\n    this.healthProfessionalService\n      .resolvePending(this.professionalType)\n      .subscribe(() => {\n        this.getHealthProfessionals();\n      })\n      .add(() => {\n        this.loading = false;\n      });\n  }\n\n  isUserUnlocked(user) {\n    return user.access === 'Desbloqueado';\n  }\n\n  toggleLocked(checked, user) {\n    this.loading = true;\n    const data = { access: checked ? 'Desbloqueado' : 'Bloqueado' };\n    this.userService\n      .update(user._id, data)\n      .subscribe()\n      .add(() => {\n        this.loading = false;\n      });\n  }\n\n  getProfessionalTypeNameLabel() {\n    return HealthProfessional.getProfessionalTypeNameLabel(this.professionalType);\n  }\n\n  getProfessionalTypeName() {\n    return HealthProfessional.getProfessionalTypeName(this.professionalType);\n  }\n\n  getActivationLink(activationToken: string, tenantId = 'RD') {\n    return this.getDomain(tenantId) + '/entry/activate-account/' + activationToken;\n  }\n\n  getResetLink(token: string, tenantId = 'RD') {\n    return this.getDomain(tenantId) + '/entry/reset-password/' + token;\n  }\n\n  @nativeAsync\n  async uploadFile(healthProfessionalId: string, file: Blob) {\n    if (!file) {\n      this.notification.notify('warning', 'Aviso', 'Arquivo não selecionado');\n      return;\n    }\n    try {\n      const res = await this.healthProfessionalService.importPatients(healthProfessionalId, file);\n      this.notification.notify('success', 'Sucesso', 'Registros importados com sucesso: ' + res.count);\n      this.hideImportPatients();\n    } catch (err) {\n      console.log(err);\n      if (err.status === 400) {\n        this.notification.notify(\n          'warning',\n          'Aviso',\n          'Erro na importação. Linha: ' + err.error.rowNumber\n        );\n      }\n    }\n  }\n\n  @nativeAsync\n  async refreshCrmStatus(healthProfessional: HealthProfessional) {\n    try {\n      healthProfessional.loading = true;\n      const cfm = await this.healthProfessionalService.refreshCrmStatus(healthProfessional._id);\n      healthProfessional.cfm = cfm;\n    } catch (error) {\n      healthProfessional.cfm = { error };\n    }\n\n    healthProfessional.loading = false;\n  }\n\n  revalidateCpf(healthProfessional: HealthProfessional) {\n    healthProfessional.loadingRevalidate = true;\n\n    this.userService\n      .revalidateCpf({\n        id: healthProfessional._id,\n        userType: 'healthprofessional'\n      })\n      .subscribe(\n        ({ user, consult }) => {\n          healthProfessional.user = user;\n          if (consult) {\n            const dateOfBirth = moment(consult.nascimento, 'DD/MM/YYYY').toDate();\n            healthProfessional.fullname = consult.nome;\n            healthProfessional.dateOfBirth = dateOfBirth;\n          }\n        },\n        (httpError: HttpErrorResponse) => {\n          const message =\n            httpError.error && httpError.error.message ? httpError.error.message : httpError.message;\n          this.notification.notify('error', message);\n        }\n      )\n      .add(() => {\n        healthProfessional.loadingRevalidate = false;\n      });\n  }\n\n  private getDomain(tenantId = 'RD') {\n    const url = window.location.href;\n    const arr = url.split('/');\n    if (tenantId === 'MRD') {\n      return arr[0] + '//' + arr[2].replace(/(app|staging|homolog|testing|develop)/gm, 'meureceituario');\n    }\n    return arr[0] + '//' + arr[2];\n  }\n\n  toggleTentat(userId: string, value: string | null) {\n    this.data.list = this.data.list.map(healthProfessional => {\n      if (healthProfessional.userId === userId) {\n        return {\n          ...healthProfessional,\n          loadingTenant: true\n        };\n      }\n      return healthProfessional;\n    });\n    super.toggleTentat('healthProfessional', userId, value, () => {\n      this.data.list = this.data.list.map(healthProfessional => {\n        if (healthProfessional.userId === userId) {\n          return {\n            ...healthProfessional,\n            tenantId: value,\n            loadingTenant: false\n          };\n        }\n        return healthProfessional;\n      });\n    });\n  }\n}\n","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\\n\\n.action-btn {\\n  margin: 0;\\n  padding: 8px;\\n}\";","export default \"<div class=\\\"filter-form\\\">\\r\\n  <app-health-professional-listing\\r\\n    *ngIf=\\\"listingType === 'doctors'\\\"\\r\\n    professionalType=\\\"doctor\\\"\\r\\n    [listingType]=\\\"'doctors'\\\"\\r\\n  ></app-health-professional-listing>\\r\\n\\r\\n  <app-health-professional-listing\\r\\n    *ngIf=\\\"listingType === 'dentists'\\\"\\r\\n    professionalType=\\\"dentist\\\"\\r\\n    [listingType]=\\\"'dentists'\\\"\\r\\n  ></app-health-professional-listing>\\r\\n\\r\\n  <app-health-professional-listing\\r\\n    *ngIf=\\\"listingType === 'veterinarians'\\\"\\r\\n    professionalType=\\\"veterinarian\\\"\\r\\n    [listingType]=\\\"'veterinarians'\\\"\\r\\n  ></app-health-professional-listing>\\r\\n\\r\\n  <app-patients-listing *ngIf=\\\"listingType === 'patients'\\\"></app-patients-listing>\\r\\n\\r\\n  <app-pharmacies-listing *ngIf=\\\"listingType === 'pharmacies'\\\"></app-pharmacies-listing>\\r\\n  <app-patients-listing *ngIf=\\\"listingType === 'specialties'\\\"></app-patients-listing>\\r\\n\\r\\n  <app-prescriptions-listing\\r\\n    *ngIf=\\\"\\r\\n      listingType === 'prescriptions' ||\\r\\n      listingType === 'attestations' ||\\r\\n      listingType === 'exams' ||\\r\\n      listingType === 'orientations' ||\\r\\n      listingType === 'infusions'\\r\\n    \\\"\\r\\n    [listingType]=\\\"listingType\\\"\\r\\n  ></app-prescriptions-listing>\\r\\n\\r\\n  <app-retentions-listing *ngIf=\\\"listingType === 'retentions'\\\"></app-retentions-listing>\\r\\n\\r\\n  <app-logs *ngIf=\\\"listingType === 'logs'\\\"></app-logs>\\r\\n\\r\\n  <app-medicament-listing *ngIf=\\\"listingType === 'medicaments'\\\"></app-medicament-listing>\\r\\n\\r\\n  <app-victa-listing *ngIf=\\\"listingType === 'victa'\\\"></app-victa-listing>\\r\\n\\r\\n  <app-pharmacists-listing *ngIf=\\\"listingType === 'pharmacists'\\\"></app-pharmacists-listing>\\r\\n\\r\\n  <app-features-listing *ngIf=\\\"listingType === 'additional-features'\\\"></app-features-listing>\\r\\n\\r\\n  <app-telemedicine-listing *ngIf=\\\"listingType === 'telemedicine'\\\"></app-telemedicine-listing>\\r\\n\\r\\n  <app-tags-listing *ngIf=\\\"listingType === 'tags'\\\"></app-tags-listing>\\r\\n\\r\\n  <app-pets-listing *ngIf=\\\"listingType === 'pets'\\\"></app-pets-listing>\\r\\n</div>\\r\\n\";","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\";","import { Component, OnInit, Input } from '@angular/core';\r\nimport { AuthService } from '@app/core/services/auth.service';\r\nimport { User } from '@app/shared/models/decodedLoginToken';\r\nimport { Permission } from '@app/shared/models/permission.enum';\r\nimport { Router } from '@angular/router';\r\n\r\n@Component({\r\n  selector: 'app-listing',\r\n  templateUrl: './listing.component.html',\r\n  styleUrls: ['./listing.component.scss']\r\n})\r\nexport class ListingComponent implements OnInit {\r\n  @Input() listingType: string;\r\n\r\n  constructor(private authService: AuthService, private router: Router) {}\r\n\r\n  get user(): User {\r\n    return this.authService.user();\r\n  }\r\n\r\n  private get masterGuard(): boolean {\r\n    return (\r\n      this.user.permission !== Permission.MASTER &&\r\n      (this.listingType === 'specialties' ||\r\n        this.listingType === 'logs' ||\r\n        this.listingType === 'medicaments' ||\r\n        this.listingType === 'victa' ||\r\n        this.listingType === 'additional-features' ||\r\n        this.listingType === 'telemedicine' ||\r\n        this.listingType === 'tags',\r\n      this.listingType === 'pets')\r\n    );\r\n  }\r\n\r\n  ngOnInit() {\r\n    if (this.masterGuard) {\r\n      this.router.navigate(['/']);\r\n    }\r\n  }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Medicament } from '@app/shared/models/medicament';\nimport { environment } from '@env/environment';\nimport { Observable } from 'rxjs';\n\nconst MEDICAMENT_URL = 'medicaments';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class MedicamentsService {\n  constructor(private http: HttpClient) {}\n\n  save(medicament: Medicament): Observable<Medicament> {\n    return this.http.post<Medicament>(`${environment.apiRoot}${MEDICAMENT_URL}`, medicament);\n  }\n  update(medicament: Medicament, id: string): Observable<Medicament> {\n    return this.http.put<Medicament>(`${environment.apiRoot}${MEDICAMENT_URL}/${id}`, medicament);\n  }\n  delete(id: string): Observable<Medicament> {\n    return this.http.delete<Medicament>(`${environment.apiRoot}${MEDICAMENT_URL}/${id}`);\n  }\n}\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { Medicament } from '@app/shared/models/medicament';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { NzModalRef } from 'ng-zorro-antd/modal';\nimport { MedicamentsService } from '../listing/features-listing/medicaments.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-modal-add-medicaments',\n  templateUrl: './modal-add-medicaments.component.html',\n  styleUrls: ['./modal-add-medicaments.component.scss']\n})\nexport class ModalAddMedicamentsComponent implements OnInit {\n  isVisible = true;\n  loading: boolean;\n  index = 0;\n  code = null;\n  id = null;\n\n  formMedicament: FormGroup = new FormGroup({\n    principio: new FormControl(null, Validators.required),\n    cnpj: new FormControl(null, Validators.required),\n    laboratorio: new FormControl(null, Validators.required),\n    ggrem: new FormControl(null, Validators.required),\n    registro: new FormControl(null, Validators.required),\n    ean: new FormControl(null, Validators.required),\n    nome: new FormControl(null, Validators.required),\n    apresentacao: new FormControl(null, Validators.required),\n    apresentacaoCustomizada: new FormControl(null, Validators.required),\n    comercializado2019: new FormControl(null),\n    tarja: new FormControl(null, Validators.required),\n    tipo: new FormControl(null, Validators.required)\n  });\n\n  @Output() updateMedicaments = new EventEmitter<any>();\n\n  constructor(\n    private nzModalRef: NzModalRef,\n    private notification: AppToastService,\n    private medicamentsService: MedicamentsService\n  ) {}\n\n  ngOnInit() {}\n\n  handleCancel(): void {\n    this.nzModalRef.destroy();\n  }\n\n  @nativeAsync\n  async save() {\n    if (this.formMedicament.valid) {\n      if (!this.id) {\n        this.registerMedicament();\n      } else {\n        this.updateMedicament();\n      }\n    }\n  }\n\n  @nativeAsync\n  async registerMedicament() {\n    try {\n      this.loading = true;\n\n      const { _id } = await this.medicamentsService.save(this.formMedicament.value).toPromise();\n\n      if (!_id) {\n        this.notification.notify('error', 'Erro', 'Não foi possível cadastrar o medicamento!');\n        return;\n      }\n\n      this.notification.notify('success', 'Sucesso', 'Medicamento cadastrado com sucesso!');\n      this.loading = false;\n\n      this.updateMedicaments.next(null);\n      this.nzModalRef.destroy();\n    } catch (err) {\n      this.loading = false;\n      if (err.status === 409) {\n        this.notification.notify(\n          'warning',\n          'Aviso',\n          'Um medicamento já foi cadastrado com essas informações!'\n        );\n      } else {\n        console.error(err);\n        this.notification.notify('error', 'Erro', 'Erro ao cadastrar medicamento');\n      }\n    }\n  }\n\n  @nativeAsync\n  async updateMedicament() {\n    try {\n      this.loading = true;\n\n      const { _id } = await this.medicamentsService\n        .update(this.formMedicament.value, this.id)\n        .toPromise();\n\n      if (!_id) {\n        this.notification.notify('error', 'Erro', 'Não foi possível atualizar o medicamento!');\n        return;\n      }\n\n      this.notification.notify('success', 'Sucesso', 'Medicamento atualizado com sucesso!');\n      this.loading = false;\n\n      this.updateMedicaments.next(null);\n      this.nzModalRef.destroy();\n    } catch (err) {\n      this.loading = false;\n      if (err.status === 409) {\n        this.notification.notify(\n          'warning',\n          'Aviso',\n          'Um medicamento já foi cadastrado com essas informações!'\n        );\n      } else {\n        console.error(err);\n        this.notification.notify('error', 'Erro', 'Erro ao atualizar medicamento');\n      }\n    }\n  }\n\n  setValues(medicament) {\n    const valueForm = this.formMedicament.value;\n    for (const key in valueForm) {\n      this.formMedicament.get(key).setValue(medicament[key]);\n    }\n  }\n\n  set medicament(medicament: Medicament) {\n    this.setValues(medicament);\n    this.id = medicament._id;\n  }\n}\n","export default \"<div>\\n  <div class=\\\"modal-body\\\">\\n    <form nz-form [formGroup]=\\\"formMedicament\\\">\\n      <div class=\\\"row justify-content-between\\\">\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"nome\\\" theme>Nome: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"nome\\\" id=\\\"nome\\\" maxlength=\\\"128\\\" theme />\\n              <nz-form-explain\\n                *ngIf=\\\"formMedicament.get('nome').dirty && formMedicament.get('nome').errors\\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('nome').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o nome.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"principio\\\" theme\\n              >Princípio: <span class=\\\"mandatory\\\"> *</span></nz-form-label\\n            >\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"principio\\\" id=\\\"principio\\\" maxlength=\\\"128\\\" theme />\\n              <nz-form-explain\\n                *ngIf=\\\"formMedicament.get('principio').dirty && formMedicament.get('principio').errors\\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('principio').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o princípio.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"apresentacao\\\" theme\\n              >Apresentação: <span class=\\\"mandatory\\\"> *</span></nz-form-label\\n            >\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"apresentacao\\\" id=\\\"apresentacao\\\" maxlength=\\\"128\\\" theme />\\n              <nz-form-explain\\n                *ngIf=\\\"\\n                  formMedicament.get('apresentacao').dirty && formMedicament.get('apresentacao').errors\\n                \\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('apresentacao').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite a apresentação.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"apresentacaoCustomizada\\\" theme\\n              >Apresentação Customizada: <span class=\\\"mandatory\\\"> *</span></nz-form-label\\n            >\\n            <nz-form-control nzHasFeedback>\\n              <input\\n                nz-input\\n                formControlName=\\\"apresentacaoCustomizada\\\"\\n                id=\\\"apresentacaoCustomizada\\\"\\n                theme\\n              />\\n              <nz-form-explain\\n                *ngIf=\\\"\\n                  formMedicament.get('apresentacaoCustomizada').dirty &&\\n                  formMedicament.get('apresentacaoCustomizada').errors\\n                \\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('apresentacaoCustomizada').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite a apresentação customizada.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"tarja\\\" theme>Tarja: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <input\\n                nz-input\\n                formControlName=\\\"tarja\\\"\\n                id=\\\"tarja\\\"\\n                maxlength=\\\"128\\\"\\n                placeholder=\\\"Tarja Vermelha (*)\\\"\\n                theme\\n              />\\n              <nz-form-explain\\n                *ngIf=\\\"formMedicament.get('tarja').dirty && formMedicament.get('tarja').errors\\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('tarja').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite a tarja.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"tipo\\\" theme>Tipo: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <select nz-input formControlName=\\\"tipo\\\" placeholder=\\\"Selecione o tipo\\\" id=\\\"tipo\\\" theme>\\n                <option value=\\\"Específico\\\">Específico</option>\\n                <option value=\\\"Novo\\\">Novo</option>\\n                <option value=\\\"Similar\\\">Similar</option>\\n                <option value=\\\"Genérico\\\">Genérico</option>\\n                <option value=\\\"Biológico\\\">Biológico</option>\\n                <option value=\\\"Fitoterápico\\\">Fitoterápico</option>\\n                <option value=\\\"Produto de Terapia Avançada\\\">Produto de Terapia Avançada</option>\\n                <option value=\\\"Referência\\\">Referência</option>\\n              </select>\\n              <nz-form-explain\\n                *ngIf=\\\"formMedicament.get('tipo').dirty && formMedicament.get('tipo').errors\\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('tipo').hasError('required')\\\">\\n                  Campo obrigatório, por favor informe o tipo.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item class=\\\"d-flex align-items-center\\\">\\n            <nz-form-control>\\n              <input\\n                nz-input\\n                type=\\\"checkbox\\\"\\n                formControlName=\\\"comercializado2019\\\"\\n                id=\\\"comercializado2019\\\"\\n                theme\\n              />\\n              <nz-form-label style=\\\"margin-left: 8px;\\\" nzFor=\\\"comercializado2019\\\" theme\\n                >Comercializado em 2019?</nz-form-label\\n              >\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"cnpj\\\" theme>CNPJ: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <input\\n                nz-input\\n                formControlName=\\\"cnpj\\\"\\n                id=\\\"cnpj\\\"\\n                maxlength=\\\"128\\\"\\n                placeholder=\\\"00.000.000/0000-00\\\"\\n                theme\\n              />\\n              <nz-form-explain\\n                *ngIf=\\\"formMedicament.get('cnpj').dirty && formMedicament.get('cnpj').errors\\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('cnpj').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o CNPJ.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"laboratorio\\\" theme\\n              >Laboratório: <span class=\\\"mandatory\\\"> *</span></nz-form-label\\n            >\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"laboratorio\\\" id=\\\"laboratorio\\\" maxlength=\\\"128\\\" theme />\\n              <nz-form-explain\\n                *ngIf=\\\"\\n                  formMedicament.get('laboratorio').dirty && formMedicament.get('laboratorio').errors\\n                \\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('laboratorio').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o laboratório.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"registro\\\" theme\\n              >Registro: <span class=\\\"mandatory\\\"> *</span></nz-form-label\\n            >\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"registro\\\" id=\\\"registro\\\" maxlength=\\\"128\\\" theme />\\n              <nz-form-explain\\n                *ngIf=\\\"formMedicament.get('registro').dirty && formMedicament.get('registro').errors\\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('registro').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o registro.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"ggrem\\\" theme>GGREM: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"ggrem\\\" id=\\\"ggrem\\\" maxlength=\\\"128\\\" theme />\\n              <nz-form-explain\\n                *ngIf=\\\"formMedicament.get('ggrem').dirty && formMedicament.get('ggrem').errors\\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('ggrem').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o GGREM.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"ean\\\" theme>EAN: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"ean\\\" id=\\\"ean\\\" maxlength=\\\"128\\\" theme />\\n              <nz-form-explain\\n                *ngIf=\\\"formMedicament.get('ean').dirty && formMedicament.get('ean').errors\\\"\\n              >\\n                <ng-container *ngIf=\\\"formMedicament.get('ean').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o EAN.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n      </div>\\n    </form>\\n  </div>\\n  <div class=\\\"modal-footer\\\">\\n    <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-default\\\" (click)=\\\"handleCancel()\\\">\\n      Cancelar\\n    </button>\\n    <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-primary\\\" (click)=\\\"save()\\\">\\n      Salvar <i class=\\\"fa\\\"></i>\\n    </button>\\n  </div>\\n</div>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","export default \".modal-body {\\n  padding-bottom: 30px;\\n  margin-top: 15px;\\n  height: 40vh;\\n  overflow-y: scroll;\\n}\";","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { MedicamentService } from '@app/modules/document/services/medicament.service';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { NzModalService } from 'ng-zorro-antd/modal';\nimport { ModalAddMedicamentsComponent } from '../../modal-add-medicaments/modal-add-medicaments.component';\nimport { MedicamentsService } from '../features-listing/medicaments.service';\n\n@Component({\n  selector: 'app-medicament-listing',\n  templateUrl: './medicament-listing.component.html',\n  styleUrls: ['./medicament-listing.component.scss']\n})\nexport class MedicamentListingComponent implements OnInit {\n  loading: boolean;\n  medicaments: [];\n  totalRecord = 0;\n  filter = {\n    nome: '',\n    principio: '',\n    apresentacao: '',\n    pageSize: 7,\n    pageIndex: 1\n  };\n  scrollConfig = { x: '830px', y: '583px' };\n\n  private _medicamentForm: FormGroup;\n\n  get medicamentForm() {\n    return this._medicamentForm;\n  }\n\n  constructor(\n    private fb: FormBuilder,\n    private medicamentService: MedicamentService,\n    private medicamentsService: MedicamentsService,\n    private notification: AppToastService,\n    private modalService: NzModalService\n  ) {\n    this._medicamentForm = this.fb.group({\n      excel: this.fb.control('', Validators.required)\n    });\n  }\n\n  ngOnInit() {\n    this.loadMedicaments();\n  }\n\n  loadMedicaments() {\n    this.loading = true;\n    const filter = {\n      ...this.filter,\n      pageIndex: this.filter.pageIndex - 1\n    };\n    this.medicamentService.getMedicaments(filter).subscribe(\n      result => {\n        this.totalRecord = result.totalRecord;\n        this.medicaments = result.medicaments;\n        this.loading = false;\n      },\n      err => (this.loading = false)\n    );\n  }\n\n  showModalAddMedicaments() {\n    const modal = this.modalService.create({\n      nzContent: ModalAddMedicamentsComponent,\n      nzComponentParams: {},\n      nzTitle: 'Novo medicamento',\n      nzClosable: false,\n      nzFooter: null\n    });\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().updateMedicaments.subscribe(result => {\n        this.loadMedicaments();\n      });\n    });\n  }\n\n  showModalEditMedicament(medicament) {\n    const modal = this.modalService.create({\n      nzContent: ModalAddMedicamentsComponent,\n      nzComponentParams: {\n        medicament\n      },\n      nzTitle: 'Editar medicamento',\n      nzClosable: false,\n      nzFooter: null\n    });\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().updateMedicaments.subscribe(result => this.loadMedicaments());\n    });\n  }\n\n  deleteMedicament(medicament) {\n    this.modalService.confirm({\n      nzTitle: 'Tem certeza que deseja remover esse medicamento?',\n      nzContent: null,\n      nzOnOk: async () => {\n        try {\n          this.loading = true;\n          await this.medicamentsService.delete(medicament._id).toPromise();\n          this.loadMedicaments();\n\n          this.loading = false;\n          this.notification.notify('success', 'Sucesso', 'Medicamento apagado com sucesso!');\n        } catch (err) {\n          this.loading = false;\n          if (err.status === 404) {\n            this.notification.notify('warning', 'Aviso', 'Medicamento já removido');\n            this.loadMedicaments();\n          } else {\n            this.notification.notify('error', 'Erro', 'Erro ao remover medicamento');\n          }\n        }\n      }\n    });\n  }\n\n  pageIndexChanged(index: any): void {\n    this.filter.pageIndex = index;\n    this.loadMedicaments();\n  }\n\n  sendFile() {\n    const file: File = this.medicamentForm.get('excel').value;\n    if (!file) {\n      this.notification.notify('warning', 'Aviso', 'Selecione um arquivo excel');\n      return;\n    }\n\n    this.loading = true;\n    this.medicamentService.sendExcelMedicaments(file).subscribe(\n      response => {\n        this.loading = false;\n        this.notification.notify('success', 'Sucesso', 'Arquivo importado com sucesso');\n        this.medicamentForm.reset();\n        setTimeout(() => this.loadMedicaments(), 10000);\n      },\n      err => {\n        console.error(err);\n        this.loading = false;\n      }\n    );\n  }\n\n  search() {\n    this.loadMedicaments();\n  }\n}\n","export default \"<h2 class=\\\"title\\\">Medicamentos</h2>\\r\\n<br />\\r\\n<form nz-form [formGroup]=\\\"medicamentForm\\\">\\r\\n  <div class=\\\"row\\\">\\r\\n    <div class=\\\"col-10\\\">\\r\\n      <nz-form-item>\\r\\n        <nz-form-control>\\r\\n          <app-input-file\\r\\n            accept=\\\".xls\\\"\\r\\n            textButton=\\\"Selecione um arquivo excel\\\"\\r\\n            formControlName=\\\"excel\\\"\\r\\n            name=\\\"excel\\\"\\r\\n          ></app-input-file>\\r\\n        </nz-form-control>\\r\\n      </nz-form-item>\\r\\n    </div>\\r\\n    <div class=\\\"col\\\">\\r\\n      <button nz-button nzType=\\\"primary\\\" (click)=\\\"sendFile()\\\">Enviar arquivo</button>\\r\\n    </div>\\r\\n  </div>\\r\\n</form>\\r\\n\\r\\n<form nz-form>\\r\\n  <div class=\\\"row\\\">\\r\\n    <div class=\\\"col\\\">\\r\\n      <nz-form-item>\\r\\n        <nz-form-label nzFor=\\\"nome\\\" theme>Nome </nz-form-label>\\r\\n        <nz-form-control nzHasFeedback>\\r\\n          <input nz-input type=\\\"text\\\" [(ngModel)]=\\\"filter.nome\\\" name=\\\"nome\\\" theme />\\r\\n        </nz-form-control>\\r\\n      </nz-form-item>\\r\\n    </div>\\r\\n    <div class=\\\"col\\\">\\r\\n      <nz-form-label nzFor=\\\"principio\\\" theme>Principio</nz-form-label>\\r\\n      <nz-form-item>\\r\\n        <nz-form-control nzHasFeedback>\\r\\n          <input\\r\\n            nz-input\\r\\n            type=\\\"text\\\"\\r\\n            [(ngModel)]=\\\"filter.principio\\\"\\r\\n            [(ngModel)]=\\\"filter.principio\\\"\\r\\n            name=\\\"principio\\\"\\r\\n            theme\\r\\n          />\\r\\n        </nz-form-control>\\r\\n      </nz-form-item>\\r\\n    </div>\\r\\n    <div class=\\\"col\\\">\\r\\n      <nz-form-item>\\r\\n        <nz-form-label nzFor=\\\"apresentacao\\\" theme>Apresentação</nz-form-label>\\r\\n        <nz-form-control nzHasFeedback>\\r\\n          <input nz-input type=\\\"text\\\" [(ngModel)]=\\\"filter.apresentacao\\\" name=\\\"apresentacao\\\" theme />\\r\\n        </nz-form-control>\\r\\n      </nz-form-item>\\r\\n    </div>\\r\\n\\r\\n    <div class=\\\"col-1\\\" style=\\\"padding-top: 27px\\\">\\r\\n      <nz-form-item>\\r\\n        <nz-form-control>\\r\\n          <button nz-button type=\\\"button\\\" nzType=\\\"primary\\\" (click)=\\\"search()\\\">\\r\\n            <i nz-icon nzType=\\\"search\\\"></i>\\r\\n            Buscar\\r\\n          </button>\\r\\n        </nz-form-control>\\r\\n      </nz-form-item>\\r\\n    </div>\\r\\n    <div class=\\\"col-2\\\" style=\\\"padding-top: 27px; margin-left: 16px;\\\">\\r\\n      <nz-form-item>\\r\\n        <nz-form-control>\\r\\n          <button nz-button type=\\\"button\\\" nzType=\\\"primary\\\" (click)=\\\"showModalAddMedicaments()\\\">\\r\\n            <i class=\\\"fa fa-plus\\\"></i>\\r\\n            Cadastrar\\r\\n          </button>\\r\\n        </nz-form-control>\\r\\n      </nz-form-item>\\r\\n    </div>\\r\\n  </div>\\r\\n</form>\\r\\n\\r\\n<nz-table\\r\\n  *ngIf=\\\"medicaments\\\"\\r\\n  #listingTable\\r\\n  [nzData]=\\\"medicaments\\\"\\r\\n  [nzTotal]=\\\"totalRecord\\\"\\r\\n  [nzPageSize]=\\\"filter.pageSize\\\"\\r\\n  [nzPageIndex]=\\\"filter.pageIndex\\\"\\r\\n  (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\r\\n  [nzFrontPagination]=\\\"false\\\"\\r\\n  nzSize=\\\"default\\\"\\r\\n  style=\\\"overflow-x: auto;\\\"\\r\\n>\\r\\n  <thead>\\r\\n    <tr>\\r\\n      <th>Nome</th>\\r\\n      <th>Princípio</th>\\r\\n      <th>Laboratório</th>\\r\\n      <th>EAN</th>\\r\\n      <th>Apresentação</th>\\r\\n      <th>Comercializado em 2019</th>\\r\\n      <th>Tipo</th>\\r\\n      <th colspan=\\\"5\\\"></th>\\r\\n    </tr>\\r\\n  </thead>\\r\\n\\r\\n  <tbody>\\r\\n    <tr *ngFor=\\\"let medicament of listingTable.data\\\">\\r\\n      <td>{{ medicament.nome }}</td>\\r\\n      <td>{{ medicament.principio }}</td>\\r\\n      <td>{{ medicament.laboratorio }}</td>\\r\\n      <td>{{ medicament.ean }}</td>\\r\\n      <td>{{ medicament.apresentacaoCustomizada }}</td>\\r\\n      <td>{{ medicament.comercializado2019 == true ? 'Sim' : 'Não' }}</td>\\r\\n      <td>{{ medicament.tipo }}</td>\\r\\n      <td>\\r\\n        <button\\r\\n          (click)=\\\"showModalEditMedicament(medicament)\\\"\\r\\n          title=\\\"Editar medicamento\\\"\\r\\n          class=\\\"btn btn-icon btn-simple\\\"\\r\\n          type=\\\"button\\\"\\r\\n        >\\r\\n          <span class=\\\"btn-inner--icon\\\"><i class=\\\"fa fa-pencil-solid\\\"></i></span>\\r\\n        </button>\\r\\n        <button\\r\\n          (click)=\\\"deleteMedicament(medicament)\\\"\\r\\n          title=\\\"Apagar medicamento\\\"\\r\\n          class=\\\"btn btn-icon btn-simple\\\"\\r\\n          type=\\\"button\\\"\\r\\n        >\\r\\n          <span class=\\\"btn-inner--icon danger\\\"><i class=\\\"fa fa-trash-solid\\\"></i></span>\\r\\n        </button>\\r\\n      </td>\\r\\n    </tr>\\r\\n  </tbody>\\r\\n</nz-table>\\r\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\r\\n\";","export default \".danger {\\n  color: #f75f5f;\\n}\";","import { Component, Injector, OnInit } from '@angular/core';\r\nimport { AuthService } from '@app/core/services/auth.service';\r\nimport { ModalEditAddressDataComponent } from '@app/modules/dashboard/modal-edit-address-data/modal-edit-address-data.component';\r\nimport { ModalEditPersonalDataComponent } from '@app/modules/dashboard/modal-edit-personal-data/modal-edit-personal-data.component';\r\nimport { PatientsService } from '@app/modules/patients/services/patients.service';\r\nimport { UserService } from '@app/modules/user/user.service';\r\nimport { Patient } from '@app/shared/models';\r\nimport { User } from '@app/shared/models/decodedLoginToken';\r\nimport { Permission } from '@app/shared/models/permission.enum';\r\nimport { AppToastService } from '@app/shared/services/app-toast.service';\r\nimport { NzModalService } from 'ng-zorro-antd/modal';\r\nimport { AdminService } from '../../admin.service';\r\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\r\nimport moment from 'moment';\r\nimport { HttpErrorResponse } from '@angular/common/http';\r\nimport { BaseListingComponent } from '../base-listing.component';\r\n\r\n@Component({\r\n  selector: 'app-patients-listing',\r\n  templateUrl: './patients-listing.component.html',\r\n  styleUrls: ['./patients-listing.component.scss']\r\n})\r\nexport class PatientsListingComponent extends BaseListingComponent<Patient> {\r\n  loading = false;\r\n\r\n  filter: any;\r\n  paginationData = { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 };\r\n\r\n  scrollConfig = { x: '830px', y: '583px' };\r\n  Permission = Permission;\r\n\r\n  tenants = [\r\n    { label: 'RD', value: null || undefined },\r\n    { label: 'MRD', value: 'MRD' }\r\n  ];\r\n\r\n  constructor(\r\n    private authService: AuthService,\r\n    private patientService: PatientsService,\r\n    private modalService: NzModalService,\r\n    private userService: UserService,\r\n    public injector: Injector\r\n  ) {\r\n    super(injector);\r\n  }\r\n\r\n  get user(): User {\r\n    return this.authService.user();\r\n  }\r\n\r\n  filterData(filter) {\r\n    this.setFilter(filter);\r\n    this.getPatients();\r\n  }\r\n\r\n  pageIndexChanged(pageIndex: any) {\r\n    this.paginationData.skip = this.pageSize * (pageIndex - 1);\r\n    this.getPatients();\r\n  }\r\n\r\n  onSortChange(params) {\r\n    this.paginationData.orderBy = params.key;\r\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\r\n    this.getPatients();\r\n  }\r\n\r\n  getPatients() {\r\n    this.loading = true;\r\n    this.patientService.getPatientsByFilter(this.getFilter()).subscribe(\r\n      response => {\r\n        this.data = { list: response.patients, totalRecord: response.totalRecord };\r\n      },\r\n      () => {\r\n        this.notification.notify('error', 'Ocorreu um erro buscar pacientes');\r\n      },\r\n      () => {\r\n        this.loading = false;\r\n      }\r\n    );\r\n  }\r\n\r\n  getFilter() {\r\n    return {\r\n      ...this.filter,\r\n      skip: this.paginationData.skip,\r\n      limit: this.pageSize,\r\n      orderBy: this.paginationData.orderBy,\r\n      sortOrder: this.paginationData.sortOrder\r\n    };\r\n  }\r\n\r\n  showModalEditData(patient: Patient, index: number) {\r\n    const modal = this.modalService.create({\r\n      nzContent: ModalEditPersonalDataComponent,\r\n      nzComponentParams: {\r\n        user: patient.user,\r\n        completeUser: patient,\r\n        userTypeLogged: this.user.userType\r\n      },\r\n      nzFooter: null\r\n    });\r\n    modal.afterOpen.subscribe(() => {\r\n      modal\r\n        .getContentComponent()\r\n        .updateUserEvent.subscribe(updatedUser => this.updateUserData(updatedUser, index));\r\n    });\r\n  }\r\n\r\n  private updateUserData(updatedUser, index) {\r\n    this.data.list[index] = updatedUser;\r\n    this.getPatients();\r\n  }\r\n\r\n  public resolvePending() {\r\n    this.loading = true;\r\n    try {\r\n      this.patientService.resolvePending().subscribe(() => {});\r\n      this.getPatients();\r\n      this.loading = false;\r\n    } catch (error) {\r\n      this.loading = false;\r\n    }\r\n  }\r\n\r\n  isUserUnlocked(user) {\r\n    return user && user.access === 'Desbloqueado';\r\n  }\r\n\r\n  toggleLocked(checked, user) {\r\n    if (user) {\r\n      const access = checked ? 'Desbloqueado' : 'Bloqueado';\r\n      const data = { access };\r\n      this.userService.update(user._id, data).subscribe(\r\n        () => {\r\n          this.notification.notify('success', `Usuário ${access} com sucesso!`);\r\n        },\r\n        () => {\r\n          this.notification.notify('error', `Error ao tentar ${access} usuário!`);\r\n        }\r\n      );\r\n    } else {\r\n      this.notification.notify('warning', 'Paciente não possui usuário vinculado!');\r\n    }\r\n  }\r\n\r\n  @nativeAsync\r\n  async exportData(filter: any) {\r\n    try {\r\n      this.loading = true;\r\n      this.setFilter(filter);\r\n      await this.adminService.exportData('patients', this.getFilter());\r\n    } catch (error) {\r\n      this.notification.notify('error', 'Erro', 'Erro na exportação');\r\n      console.error(error);\r\n    }\r\n    this.loading = false;\r\n  }\r\n\r\n  private setFilter(filter: any) {\r\n    this.filter = filter;\r\n    this.filter.cpf = this.filter.cpf === undefined ? '' : this.filter.cpf.replace(/[^0-9]+/gi, '');\r\n    this.paginationData.skip = 0;\r\n  }\r\n\r\n  showModalEditAddress(patient: Patient, index: number) {\r\n    const modal = this.modalService.create({\r\n      nzContent: ModalEditAddressDataComponent,\r\n      nzComponentParams: {\r\n        completeUser: patient,\r\n        userType: 'patient'\r\n      },\r\n      nzFooter: null\r\n    });\r\n\r\n    modal.afterOpen.subscribe(() => {\r\n      modal\r\n        .getContentComponent()\r\n        .updateUserEvent.subscribe(updatedUser => this.updateUserData(updatedUser, index));\r\n    });\r\n  }\r\n\r\n  getActivationLink(activationToken: string, tenantId = 'RD') {\r\n    return this.getDomain() + '/entry/activate-account/' + activationToken;\r\n  }\r\n\r\n  getResetLink(token: string, tenantId = 'RD') {\r\n    return this.getDomain() + '/entry/reset-password/' + token;\r\n  }\r\n\r\n  revalidateCpf(patient: Patient) {\r\n    patient.loadingRevalidate = true;\r\n\r\n    this.userService\r\n      .revalidateCpf({\r\n        id: patient._id,\r\n        userType: 'patient'\r\n      })\r\n      .subscribe(\r\n        ({ user, consult }) => {\r\n          patient.user = user;\r\n          if (consult) {\r\n            const dateOfBirth = moment(consult.nascimento, 'DD/MM/YYYY').toDate();\r\n            patient.fullname = consult.nome;\r\n            patient.dateOfBirth = dateOfBirth;\r\n          }\r\n        },\r\n        (httpError: HttpErrorResponse) => {\r\n          const message =\r\n            httpError.error && httpError.error.message ? httpError.error.message : httpError.message;\r\n          this.notification.notify('error', message);\r\n        }\r\n      )\r\n      .add(() => {\r\n        patient.loadingRevalidate = false;\r\n      });\r\n  }\r\n\r\n  private getDomain(tenantId = 'RD') {\r\n    const url = window.location.href;\r\n    const arr = url.split('/');\r\n    if (tenantId === 'MRD') {\r\n      return arr[0] + '//' + arr[2].replace(/(app|staging|homolog|testing|develop)/gm, 'meureceituario');\r\n    }\r\n    return arr[0] + '//' + arr[2];\r\n  }\r\n\r\n  toggleTentat(userId: string, value: string | null) {\r\n    this.data.list = this.data.list.map(patient => {\r\n      if (patient.userId === userId) {\r\n        return {\r\n          ...patient,\r\n          loadingTenant: true\r\n        };\r\n      }\r\n      return patient;\r\n    });\r\n    super.toggleTentat('patient', userId, value, () => {\r\n      this.data.list = this.data.list.map(patient => {\r\n        if (patient.userId === userId) {\r\n          return {\r\n            ...patient,\r\n            tenantId: value,\r\n            loadingTenant: false\r\n          };\r\n        }\r\n        return patient;\r\n      });\r\n    });\r\n  }\r\n}\r\n","export default \"<app-form-filter\\r\\n  listingType=\\\"patients\\\"\\r\\n  (filterDataEvent)=\\\"filterData($event)\\\"\\r\\n  title=\\\"Pacientes\\\"\\r\\n  (exportDataEmit)=\\\"exportData($event)\\\"\\r\\n  (resolvePendingEmit)=\\\"resolvePending()\\\"\\r\\n></app-form-filter>\\r\\n<div class=\\\"patients-listing\\\">\\r\\n  <nz-table\\r\\n    #listingTable\\r\\n    [nzLoading]=\\\"loading\\\"\\r\\n    nzFrontPagination=\\\"false\\\"\\r\\n    nzNoResult=\\\"Nenhum resultado encontrado\\\"\\r\\n    [nzTotal]=\\\"data?.totalRecord\\\"\\r\\n    [nzData]=\\\"data?.list\\\"\\r\\n    [nzPageSize]=\\\"pageSize\\\"\\r\\n    nzSize=\\\"small\\\"\\r\\n    (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\r\\n    style=\\\"overflow-x: auto;\\\"\\r\\n  >\\r\\n    <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\r\\n      <tr>\\r\\n        <th nzShowExpand></th>\\r\\n        <th nzShowSort nzSortKey=\\\"updatedAt\\\">Última atualização</th>\\r\\n        <th nzShowSort nzSortKey=\\\"tenantId\\\">Sistema</th>\\r\\n        <th nzShowSort nzSortKey=\\\"fullname\\\">Nome completo</th>\\r\\n        <th nzShowSort nzSortKey=\\\"name\\\">Nome</th>\\r\\n        <th>E-mail</th>\\r\\n        <th>CPF</th>\\r\\n        <th>Celular</th>\\r\\n        <th>Telefone</th>\\r\\n        <th></th>\\r\\n        <th></th>\\r\\n        <th></th>\\r\\n      </tr>\\r\\n    </thead>\\r\\n\\r\\n    <tbody>\\r\\n      <ng-template ngFor let-patient let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\r\\n        <tr>\\r\\n          <td nzShowExpand [(nzExpand)]=\\\"patient.expand\\\"></td>\\r\\n          <td>{{ patient?.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\r\\n          <!-- <td>{{ patient?.tenantId || 'RD' }}</td> -->\\r\\n          <td>\\r\\n            <a\\r\\n              *ngIf=\\\"!patient?.loadingTenant\\\"\\r\\n              nz-dropdown\\r\\n              nzTrigger=\\\"click\\\"\\r\\n              [nzDropdownMenu]=\\\"menu\\\"\\r\\n              style=\\\"display: flex;align-items: center; gap: 16px;\\\"\\r\\n            >\\r\\n              <span>{{ patient?.tenantId || 'RD' }}</span>\\r\\n              <i nz-icon nzType=\\\"down\\\"></i>\\r\\n            </a>\\r\\n            <nz-dropdown-menu #menu=\\\"nzDropdownMenu\\\">\\r\\n              <ul nz-menu nzSelectable>\\r\\n                <li\\r\\n                  nz-menu-item\\r\\n                  (click)=\\\"toggleTentat(patient?.userId, null)\\\"\\r\\n                  *ngIf=\\\"patient?.tenantId === 'MRD'\\\"\\r\\n                >\\r\\n                  RD\\r\\n                </li>\\r\\n                <li\\r\\n                  nz-menu-item\\r\\n                  (click)=\\\"toggleTentat(patient?.userId, 'MRD')\\\"\\r\\n                  *ngIf=\\\"!patient?.tenantId\\\"\\r\\n                >\\r\\n                  MRD\\r\\n                </li>\\r\\n              </ul>\\r\\n            </nz-dropdown-menu>\\r\\n\\r\\n            <i\\r\\n              *ngIf=\\\"patient?.loadingTenant\\\"\\r\\n              nz-icon\\r\\n              [nzType]=\\\"'sync'\\\"\\r\\n              [nzSpin]=\\\"patient?.loadingTenant\\\"\\r\\n            ></i>\\r\\n          </td>\\r\\n          <td>{{ patient?.fullname }}</td>\\r\\n          <td>{{ patient?.name }}</td>\\r\\n          <td>\\r\\n            <span *ngIf=\\\"patient?.user as user\\\">\\r\\n              <span *ngIf=\\\"user?.email\\\">{{ user?.email }}</span\\r\\n              ><span *ngIf=\\\"user?.email && user?.emailContact && user?.email !== user?.emailContact\\\">\\r\\n                /\\r\\n              </span>\\r\\n              <span *ngIf=\\\"user?.emailContact && user?.emailContact !== user?.email\\\">{{\\r\\n                user.emailContact\\r\\n              }}</span>\\r\\n            </span>\\r\\n          </td>\\r\\n          <td>{{ patient?.cpf | formattedCpf }}</td>\\r\\n          <td>{{ patient?.cellphone | formattedCel }}</td>\\r\\n          <td>{{ patient?.telephone | formattedTel }}</td>\\r\\n          <td class=\\\"action-btn\\\" *ngIf=\\\"patient?.loadingRevalidate; else templateIconCpfInvalido\\\">\\r\\n            <a style=\\\"display: flex;\\\" title=\\\"Em processamento...\\\"\\r\\n              ><i nz-icon [nzType]=\\\"'sync'\\\" [nzSpin]=\\\"patient?.loadingRevalidate\\\"></i\\r\\n            ></a>\\r\\n          </td>\\r\\n\\r\\n          <ng-template #templateIconCpfInvalido>\\r\\n            <td\\r\\n              class=\\\"action-btn\\\"\\r\\n              *ngIf=\\\"patient?.user?.userStatus !== 'Valido'; else templateIconCpfValido\\\"\\r\\n            >\\r\\n              <a style=\\\"display: flex;\\\" title=\\\"Revalidar CPF\\\"\\r\\n                ><i nz-icon [nzType]=\\\"'sync'\\\" (click)=\\\"revalidateCpf(patient)\\\"></i\\r\\n              ></a>\\r\\n            </td>\\r\\n          </ng-template>\\r\\n\\r\\n          <ng-template #templateIconCpfValido>\\r\\n            <td class=\\\"action-btn\\\">\\r\\n              <a style=\\\"display: flex;\\\" title=\\\"CPF válido\\\"\\r\\n                ><i\\r\\n                  nz-icon\\r\\n                  [nzType]=\\\"'check-circle'\\\"\\r\\n                  [nzTheme]=\\\"'twotone'\\\"\\r\\n                  [nzTwotoneColor]=\\\"'#52c41a'\\\"\\r\\n                  (click)=\\\"revalidateCpf(patient)\\\"\\r\\n                ></i\\r\\n              ></a>\\r\\n            </td>\\r\\n          </ng-template>\\r\\n\\r\\n          <td>\\r\\n            <a (click)=\\\"showModalEditData(patient, i)\\\"\\r\\n              ><img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\"\\r\\n            /></a>\\r\\n          </td>\\r\\n          <td *ngIf=\\\"user.permission === Permission.MASTER\\\">\\r\\n            <nz-switch\\r\\n              nzCheckedChildren=\\\"Ativo\\\"\\r\\n              (ngModelChange)=\\\"toggleLocked($event, patient?.user)\\\"\\r\\n              [ngModel]=\\\"isUserUnlocked(patient?.user)\\\"\\r\\n              nzUnCheckedChildren=\\\"Inativo\\\"\\r\\n            ></nz-switch>\\r\\n          </td>\\r\\n        </tr>\\r\\n        <tr [(nzExpand)]=\\\"patient.expand\\\">\\r\\n          <td></td>\\r\\n          <td colspan=\\\"4\\\">\\r\\n            <div *ngIf=\\\"patient?.address\\\">\\r\\n              <strong>Endereço:</strong>\\r\\n              <span>\\r\\n                <span>\\r\\n                  {{ patient?.address.street }}, {{ patient?.address.number }} -\\r\\n                  {{ patient?.address.neighborhood }}\\r\\n                </span>\\r\\n                <br />\\r\\n                <span class=\\\"info-bottom\\\">\\r\\n                  {{ patient?.address.city }}, {{ patient?.address.uf }} -\\r\\n                  {{ patient?.address.cep }}</span\\r\\n                >\\r\\n              </span>\\r\\n              <button\\r\\n                class=\\\"col-3\\\"\\r\\n                id=\\\"button-edit-business\\\"\\r\\n                class=\\\"btn-edit\\\"\\r\\n                (click)=\\\"showModalEditAddress(patient, i)\\\"\\r\\n              >\\r\\n                <img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\" />\\r\\n              </button>\\r\\n              <br />\\r\\n            </div>\\r\\n            <div *ngIf=\\\"patient?.identity\\\">\\r\\n              <strong>Identidade:</strong>\\r\\n              <span>{{ patient?.identity }}</span>\\r\\n            </div>\\r\\n            <div *ngIf=\\\"patient?.dateOfBirth\\\">\\r\\n              <strong>Data de Nascimento:</strong>\\r\\n              <span>{{ patient?.dateOfBirth | date: 'dd/MM/yyyy':'GMT' }}</span>\\r\\n            </div>\\r\\n            <div *ngIf=\\\"patient?.responsible\\\">\\r\\n              <strong>Responsável:</strong>\\r\\n              <span> {{ patient?.responsible.name || patient?.responsible.fullname }} - </span>\\r\\n              <span>{{ patient?.responsible.cpf | formattedCpf }}</span>\\r\\n            </div>\\r\\n          </td>\\r\\n          <td>\\r\\n            <div style=\\\"display: flex;flex-direction: column; gap: 8px;\\\">\\r\\n              <div style=\\\"display: flex;align-items: center;gap: 8px;\\\">\\r\\n                <strong>Status:</strong>\\r\\n                <span class=\\\"badge badge-success\\\" *ngIf=\\\"patient?.user?.userStatus === 'Valido'\\\"\\r\\n                  >VÁLIDO</span\\r\\n                >\\r\\n                <span\\r\\n                  *ngIf=\\\"patient?.user?.userStatus === 'Pendente de validação'\\\"\\r\\n                  class=\\\"badge badge-warning\\\"\\r\\n                  >PENDENTE DE VALIDAÇÃO</span\\r\\n                >\\r\\n                <span *ngIf=\\\"patient?.user?.userStatus === 'Inválido'\\\" class=\\\"badge badge-danger\\\"\\r\\n                  >INVÁLIDO</span\\r\\n                >\\r\\n              </div>\\r\\n              <div *ngIf=\\\"patient?.user?.pendency\\\">\\r\\n                Erro: <strong>{{ patient?.user?.pendency?.erro }}</strong>\\r\\n              </div>\\r\\n            </div>\\r\\n          </td>\\r\\n          <td *ngIf=\\\"patient?.user?.activationToken\\\" colspan=\\\"6\\\">\\r\\n            <strong>Link de ativação:</strong>\\r\\n            <div>\\r\\n              <span>{{ getActivationLink(patient?.user?.activationToken, patient?.tenantId) }}</span>\\r\\n            </div>\\r\\n          </td>\\r\\n          <td *ngIf=\\\"patient?.user?.passwordResetToken\\\" colspan=\\\"6\\\">\\r\\n            <strong>Link de trocar senha:</strong>\\r\\n            <div>\\r\\n              <span>{{ getResetLink(patient?.user?.passwordResetToken, patient?.tenantId) }}</span>\\r\\n            </div>\\r\\n          </td>\\r\\n          <td\\r\\n            *ngIf=\\\"!patient?.user?.activationToken && !patient?.user?.passwordResetToken\\\"\\r\\n            colspan=\\\"6\\\"\\r\\n          ></td>\\r\\n        </tr>\\r\\n      </ng-template>\\r\\n    </tbody>\\r\\n  </nz-table>\\r\\n</div>\\r\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\r\\n\";","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\\n\\n#button-edit-business {\\n  width: 12px;\\n}\";","export default \"<app-form-filter\\r\\n  listingType=\\\"pharmacies\\\"\\r\\n  (filterDataEvent)=\\\"filterData($event)\\\"\\r\\n  title=\\\"Farmácias\\\"\\r\\n  (exportDataEmit)=\\\"exportData($event)\\\"\\r\\n  (resolvePendingEmit)=\\\"resolvePending()\\\"\\r\\n></app-form-filter>\\r\\n\\r\\n<form nz-form [formGroup]=\\\"form\\\">\\r\\n  <div class=\\\"row\\\" *ngIf=\\\"user.permission === Permission.MASTER\\\">\\r\\n    <div class=\\\"col-5\\\">\\r\\n      <nz-form-label nzFor=\\\"excel\\\">Importar farmácias </nz-form-label>\\r\\n      <nz-form-item>\\r\\n        <nz-form-control>\\r\\n          <app-input-file\\r\\n            accept=\\\".csv,.xls*,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\\\"\\r\\n            textButton=\\\"Selecione um arquivo excel\\\"\\r\\n            formControlName=\\\"excel\\\"\\r\\n            name=\\\"excel\\\"\\r\\n          ></app-input-file>\\r\\n        </nz-form-control>\\r\\n      </nz-form-item>\\r\\n    </div>\\r\\n    <div class=\\\"col align-self-center\\\">\\r\\n      <div style=\\\"display: flex; align-items: center; justify-content: flex-start; gap: 16px;\\\">\\r\\n        <nz-form-item class=\\\"d-flex align-items-center\\\" style=\\\"margin-top: 16px;\\\">\\r\\n          <nz-form-control>\\r\\n            <input nz-input type=\\\"checkbox\\\" id=\\\"isPublic\\\" theme formControlName=\\\"isPublic\\\" />\\r\\n            <nz-form-label style=\\\"margin-left: 8px;\\\" nzFor=\\\"isPublic\\\" theme\\r\\n              >É farmácias pública ?</nz-form-label\\r\\n            >\\r\\n          </nz-form-control>\\r\\n        </nz-form-item>\\r\\n        <button nz-button nzType=\\\"primary\\\" (click)=\\\"sendFile()\\\">Enviar arquivo</button>\\r\\n      </div>\\r\\n    </div>\\r\\n  </div>\\r\\n</form>\\r\\n<nz-table\\r\\n  #listingTable\\r\\n  [nzLoading]=\\\"loading\\\"\\r\\n  nzFrontPagination=\\\"false\\\"\\r\\n  [nzTotal]=\\\"data?.totalRecord\\\"\\r\\n  [nzData]=\\\"data?.pharmacies\\\"\\r\\n  [nzPageSize]=\\\"pageSize\\\"\\r\\n  nzSize=\\\"small\\\"\\r\\n  [nzPageIndex]=\\\"currentPage\\\"\\r\\n  (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\r\\n  style=\\\"overflow-x: auto;\\\"\\r\\n>\\r\\n  <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\r\\n    <tr>\\r\\n      <th nzShowExpand></th>\\r\\n      <th nzShowSort nzSortKey=\\\"updatedAt\\\">Última atualização</th>\\r\\n      <th nzShowSort nzSortKey=\\\"businessName\\\">Nome empresarial</th>\\r\\n      <th>Nome</th>\\r\\n      <th>E-mail</th>\\r\\n      <th>CNPJ</th>\\r\\n      <th>Telefone</th>\\r\\n      <th></th>\\r\\n      <th></th>\\r\\n      <th></th>\\r\\n    </tr>\\r\\n  </thead>\\r\\n\\r\\n  <tbody>\\r\\n    <ng-template ngFor let-pharmacy let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\r\\n      <tr>\\r\\n        <td nzShowExpand [(nzExpand)]=\\\"pharmacy.expand\\\"></td>\\r\\n        <td>{{ pharmacy.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\r\\n        <td>{{ pharmacy.businessName || pharmacy.business_name_entity }}</td>\\r\\n        <td>{{ pharmacy.fantasyName }}</td>\\r\\n        <td>{{ pharmacy?.user?.email }}</td>\\r\\n        <td>{{ pharmacy.cnpj || pharmacy.cnpj_entity | formattedCnpj }}</td>\\r\\n        <td>{{ pharmacy.telephone || pharmacy.cellphone | formattedTel }}</td>\\r\\n        <td>\\r\\n          <a (click)=\\\"showModalEditData(pharmacy, i)\\\"\\r\\n            ><img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\"\\r\\n          /></a>\\r\\n        </td>\\r\\n        <td>\\r\\n          <a (click)=\\\"showModalAdditionalsFeatures(pharmacy)\\\" title=\\\"Funcionalidade adicionais\\\"\\r\\n            ><i nz-icon nzType=\\\"tool\\\" nzTheme=\\\"outline\\\"></i\\r\\n          ></a>\\r\\n        </td>\\r\\n        <td *ngIf=\\\"user.permission === Permission.MASTER\\\">\\r\\n          <nz-switch\\r\\n            nzCheckedChildren=\\\"Ativo\\\"\\r\\n            (ngModelChange)=\\\"toggleLocked($event, pharmacy?.user)\\\"\\r\\n            [ngModel]=\\\"isUserUnlocked(pharmacy?.user)\\\"\\r\\n            nzUnCheckedChildren=\\\"Inativo\\\"\\r\\n          ></nz-switch>\\r\\n        </td>\\r\\n      </tr>\\r\\n      <tr [(nzExpand)]=\\\"pharmacy.expand\\\">\\r\\n        <td></td>\\r\\n        <td colspan=\\\"4\\\">\\r\\n          <div class=\\\"row\\\">\\r\\n            <div class=\\\"col\\\">\\r\\n              Responsável técnico: {{ pharmacy.technicalResponsible?.name }},\\r\\n              {{ pharmacy.technicalResponsible?.cpf | formattedCpf }},\\r\\n              {{ pharmacy.technicalResponsible?.crf.number }}/{{ pharmacy.technicalResponsible?.crf.uf }}\\r\\n            </div>\\r\\n            <div class=\\\"col\\\">\\r\\n              <button\\r\\n                class=\\\"col-3\\\"\\r\\n                id=\\\"button-edit-business\\\"\\r\\n                class=\\\"btn-edit\\\"\\r\\n                (click)=\\\"showModalEditPharmacyTechnicianData(pharmacy)\\\"\\r\\n              >\\r\\n                <img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\" />\\r\\n              </button>\\r\\n            </div>\\r\\n          </div>\\r\\n          <nz-divider nzOrientation=\\\"horizontal\\\"></nz-divider>\\r\\n          <div class=\\\"row\\\">\\r\\n            <div class=\\\"col\\\">\\r\\n              Endereço:\\r\\n              <span *ngIf=\\\"pharmacy.address\\\"\\r\\n                >{{ pharmacy.address.street }}, {{ pharmacy.address.number }} -\\r\\n                {{ pharmacy.address.uf }}</span\\r\\n              >\\r\\n            </div>\\r\\n            <div class=\\\"col\\\">\\r\\n              <button\\r\\n                class=\\\"col-3\\\"\\r\\n                id=\\\"button-edit-business\\\"\\r\\n                class=\\\"btn-edit\\\"\\r\\n                (click)=\\\"showModalEditAddress(pharmacy)\\\"\\r\\n              >\\r\\n                <img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\" />\\r\\n              </button>\\r\\n            </div>\\r\\n          </div>\\r\\n        </td>\\r\\n        <td colspan=\\\"1\\\">\\r\\n          Status: {{ pharmacy?.user?.userStatus }}<br />\\r\\n          <div *ngIf=\\\"pharmacy?.user?.pendency\\\">\\r\\n            Erro: {{ pharmacy?.user?.pendency.erro }}<br />\\r\\n            Código de erro: {{ pharmacy?.user?.pendency.erroCodigo }}\\r\\n          </div>\\r\\n        </td>\\r\\n        <td *ngIf=\\\"pharmacy?.user?.activationToken\\\" colspan=\\\"6\\\">\\r\\n          Link de ativação:<br />\\r\\n          {{ getActivationLink(pharmacy?.user?.activationToken) }}\\r\\n        </td>\\r\\n        <td *ngIf=\\\"pharmacy?.user?.passwordResetToken\\\" colspan=\\\"6\\\">\\r\\n          Link de trocar senha:<br />\\r\\n          {{ getResetLink(pharmacy?.user?.passwordResetToken) }}\\r\\n        </td>\\r\\n        <td\\r\\n          *ngIf=\\\"!pharmacy?.user?.activationToken && !pharmacy?.user?.passwordResetToken\\\"\\r\\n          colspan=\\\"6\\\"\\r\\n        ></td>\\r\\n      </tr>\\r\\n    </ng-template>\\r\\n  </tbody>\\r\\n</nz-table>\\r\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\r\\n\";","import { ChangeDetectorRef, Component, OnInit } from '@angular/core';\r\nimport { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';\r\nimport { AuthService } from '@app/core/services/auth.service';\r\nimport { ModalEditAddressDataComponent } from '@app/modules/dashboard/modal-edit-address-data/modal-edit-address-data.component';\r\nimport { ModalEditPersonalDataComponent } from '@app/modules/dashboard/modal-edit-personal-data/modal-edit-personal-data.component';\r\nimport { ModalEditPharmacyTechnicianComponent } from '@app/modules/dashboard/modal-edit-pharmacy-technician/modal-edit-pharmacy-technician.component';\r\nimport { PharmacyService } from '@app/modules/pharmacy/services/pharmacy.service';\r\nimport { UserService } from '@app/modules/user/user.service';\r\nimport { Pharmacy } from '@app/shared/models';\r\nimport { User } from '@app/shared/models/decodedLoginToken';\r\nimport { Permission } from '@app/shared/models/permission.enum';\r\nimport { AppToastService } from '@app/shared/services/app-toast.service';\r\nimport { NzModalService } from 'ng-zorro-antd/modal';\r\nimport { AdminService } from '../../admin.service';\r\nimport { ModalAdditionalsFeaturesComponent } from '../../modal-additionals-features/modal-additionals-features.component';\r\n\r\n@Component({\r\n  selector: 'app-pharmacies-listing',\r\n  templateUrl: './pharmacies-listing.component.html',\r\n  styleUrls: ['./pharmacies-listing.component.scss']\r\n})\r\nexport class PharmaciesListingComponent implements OnInit {\r\n  public data: any;\r\n  public loading: boolean;\r\n  private filter: any;\r\n  pageSize = 10;\r\n  currentPage = 1;\r\n  paginationData = { totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 };\r\n  scrollConfig = { x: '830px', y: '583px' };\r\n  Permission = Permission;\r\n\r\n  form: FormGroup;\r\n\r\n  constructor(\r\n    private fb: FormBuilder,\r\n    private adminService: AdminService,\r\n    private authService: AuthService,\r\n    private pharmacyService: PharmacyService,\r\n    private modalService: NzModalService,\r\n    private userService: UserService,\r\n    private notification: AppToastService,\r\n    private cdr: ChangeDetectorRef\r\n  ) {\r\n    this.form = this.fb.group({\r\n      excel: this.fb.control('', Validators.required),\r\n      isPublic: this.fb.control(false)\r\n    });\r\n  }\r\n\r\n  ngOnInit() {\r\n    this.getPharmacies();\r\n  }\r\n\r\n  get user(): User {\r\n    return this.authService.user();\r\n  }\r\n  filterData(filter) {\r\n    this.setFilter(filter);\r\n    this.getPharmacies();\r\n  }\r\n\r\n  pageIndexChanged(pageIndex: any) {\r\n    this.currentPage = pageIndex;\r\n    this.getPharmacies();\r\n  }\r\n\r\n  getPharmacies() {\r\n    this.loading = true;\r\n    this.cdr.detectChanges();\r\n    this.pharmacyService.getPharmaciesByFilter(this.getFilter()).subscribe(\r\n      pharmicies => {\r\n        this.data = pharmicies;\r\n      },\r\n      () => {\r\n        this.notification.notify('error', 'Ocorreu um erro buscar farmácias');\r\n      },\r\n      () => {\r\n        this.loading = false;\r\n        this.cdr.detectChanges();\r\n      }\r\n    );\r\n  }\r\n\r\n  onSortChange(params) {\r\n    this.paginationData.orderBy = params.key;\r\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\r\n    this.getPharmacies();\r\n  }\r\n\r\n  getFilter() {\r\n    return {\r\n      ...this.filter,\r\n      skip: this.currentPage,\r\n      limit: this.pageSize,\r\n      orderBy: this.paginationData.orderBy,\r\n      sortOrder: this.paginationData.sortOrder\r\n    };\r\n  }\r\n\r\n  showModalEditData(pharmacy: Pharmacy, index: number) {\r\n    const modal = this.modalService.create({\r\n      nzContent: ModalEditPersonalDataComponent,\r\n      nzComponentParams: {\r\n        user: pharmacy.user,\r\n        completeUser: pharmacy,\r\n        userTypeLogged: this.user.userType\r\n      },\r\n      nzFooter: null\r\n    });\r\n    modal.afterOpen.subscribe(() => {\r\n      modal\r\n        .getContentComponent()\r\n        .updateUserEvent.subscribe(updatedUser => this.upDateUserData(updatedUser, index));\r\n    });\r\n  }\r\n\r\n  showModalAdditionalsFeatures(pharmacy: Pharmacy) {\r\n    this.modalService.create({\r\n      nzContent: ModalAdditionalsFeaturesComponent,\r\n      nzComponentParams: {\r\n        user: pharmacy.user,\r\n        destination: pharmacy.user.userType\r\n      },\r\n      nzTitle: 'Funcionalidades adicionais',\r\n      nzClosable: false,\r\n      nzFooter: null\r\n    });\r\n  }\r\n\r\n  private upDateUserData(updatedUser, index) {\r\n    this.data.pharmacies[index] = updatedUser;\r\n    this.getPharmacies();\r\n  }\r\n\r\n  public resolvePending() {\r\n    this.loading = true;\r\n    try {\r\n      this.pharmacyService.resolvePending().subscribe(() => {});\r\n      this.getPharmacies();\r\n      this.loading = false;\r\n    } catch (error) {\r\n      this.loading = false;\r\n    }\r\n  }\r\n\r\n  isUserUnlocked(user) {\r\n    if (user) {\r\n      return user.access === 'Desbloqueado';\r\n    }\r\n    return false;\r\n  }\r\n\r\n  async toggleLocked(checked, user) {\r\n    this.loading = true;\r\n    try {\r\n      const data = { access: checked ? 'Desbloqueado' : 'Bloqueado' };\r\n      await this.userService.update(user._id, data).toPromise();\r\n      this.loading = false;\r\n    } catch (error) {\r\n      this.loading = false;\r\n    }\r\n  }\r\n\r\n  async exportData(filter: any) {\r\n    try {\r\n      this.loading = true;\r\n      this.setFilter(filter);\r\n      await this.adminService.exportData('pharmacies', this.getFilter());\r\n    } catch (error) {\r\n      this.notification.notify('error', 'Erro', 'Erro na exportação');\r\n      console.error(error);\r\n    }\r\n    this.loading = false;\r\n  }\r\n\r\n  private setFilter(filter: any) {\r\n    this.filter = filter;\r\n    this.filter.cnpj = this.filter.cnpj === undefined ? '' : this.filter.cnpj.replace(/[^0-9]+/gi, '');\r\n    this.currentPage = 1;\r\n  }\r\n\r\n  public showModalEditPharmacyTechnicianData(pharmacy: Pharmacy) {\r\n    this.modalService.create({\r\n      nzContent: ModalEditPharmacyTechnicianComponent,\r\n      nzComponentParams: {\r\n        completeUser: pharmacy,\r\n        technicalResponsible: pharmacy,\r\n        userType: 'pharmacy'\r\n      },\r\n      nzFooter: null\r\n    });\r\n  }\r\n\r\n  public showModalEditAddress(pharmacy: Pharmacy) {\r\n    this.modalService.create({\r\n      nzContent: ModalEditAddressDataComponent,\r\n      nzComponentParams: { completeUser: pharmacy, userType: 'pharmacy' },\r\n      nzFooter: null\r\n    });\r\n  }\r\n\r\n  getActivationLink(activationToken: string) {\r\n    return this.getDomain() + '/entry/activate-account/' + activationToken;\r\n  }\r\n\r\n  getResetLink(token: string) {\r\n    return this.getDomain() + '/entry/reset-password/' + token;\r\n  }\r\n\r\n  private getDomain() {\r\n    const url = window.location.href;\r\n    const arr = url.split('/');\r\n    return arr[0] + '//' + arr[2];\r\n  }\r\n\r\n  sendFile() {\r\n    const file: File = this.form.get('excel').value;\r\n    if (!file) {\r\n      this.notification.notify('warning', 'Aviso', 'Selecione um arquivo excel');\r\n      return;\r\n    }\r\n\r\n    this.loading = true;\r\n    const isPublic = this.form.get('isPublic').value;\r\n    this.pharmacyService.importPharmacies(file, isPublic).subscribe(\r\n      response => {\r\n        this.loading = false;\r\n        this.notification.notify('success', 'Sucesso', 'Arquivo importado com sucesso');\r\n        this.form.reset();\r\n        setTimeout(() => this.getPharmacies(), 10000);\r\n      },\r\n      err => {\r\n        console.error(err);\r\n        if (err.status === 400) {\r\n          this.notification.notify('warning', 'Aviso', 'Planilha com dados incompletos');\r\n        }\r\n        this.loading = false;\r\n      }\r\n    );\r\n  }\r\n}\r\n","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\";","export default \"<app-form-filter\\n  listingType=\\\"pharmacists\\\"\\n  (filterDataEvent)=\\\"filterData($event)\\\"\\n  title=\\\"Farmacêuticos\\\"\\n  (exportDataEmit)=\\\"exportData($event)\\\"\\n></app-form-filter>\\n\\n<nz-table\\n  #listingTable\\n  [nzLoading]=\\\"loading\\\"\\n  nzFrontPagination=\\\"false\\\"\\n  [nzTotal]=\\\"data?.totalRecord\\\"\\n  [nzData]=\\\"data?.pharmacists\\\"\\n  nzSize=\\\"small\\\"\\n  [nzPageSize]=\\\"pageSize\\\"\\n  (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n  style=\\\"overflow-x: auto;\\\"\\n  theme\\n>\\n  <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\n    <tr>\\n      <th nzShowExpand></th>\\n      <th nzShowSort nzSortKey=\\\"updatedAt\\\">Última atualização</th>\\n      <th>Nome</th>\\n      <th>E-mail</th>\\n      <th>CPF</th>\\n      <th>Telefone</th>\\n      <th>Número CRF</th>\\n      <th></th>\\n      <th></th>\\n      <th></th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-pharmacist let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <tr>\\n        <td nzShowExpand [(nzExpand)]=\\\"pharmacist.expand\\\"></td>\\n        <td>{{ pharmacist.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n        <td>{{ pharmacist.name }}</td>\\n        <td>\\n          <span *ngIf=\\\"pharmacist.user as user\\\">\\n            {{ user.email }}\\n            <span *ngIf=\\\"user.emailContact && user.emailContact !== user.email\\\">\\n              / {{ user.emailContact }}\\n            </span>\\n          </span>\\n        </td>\\n        <td>{{ pharmacist.cpf | formattedCpf }}</td>\\n        <td>{{ pharmacist.telephone | formattedTel }}</td>\\n        <td>{{ pharmacist.crf.number }}/{{ pharmacist.crf.uf }}</td>\\n        <td>\\n          <a (click)=\\\"showModalEditData(pharmacist, i)\\\"\\n            ><img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\"\\n          /></a>\\n        </td>\\n        <td>\\n          <a (click)=\\\"showModalAdditionalsFeatures(pharmacist)\\\" title=\\\"Funcionalidade adicionais\\\"\\n            ><i nz-icon nzType=\\\"tool\\\" nzTheme=\\\"outline\\\"></i\\n          ></a>\\n        </td>\\n        <td *ngIf=\\\"user.permission === Permission.MASTER\\\">\\n          <nz-switch\\n            nzCheckedChildren=\\\"Ativo\\\"\\n            (ngModelChange)=\\\"toggleLocked($event, pharmacist.user)\\\"\\n            [ngModel]=\\\"isUserUnlocked(pharmacist.user)\\\"\\n            nzUnCheckedChildren=\\\"Inativo\\\"\\n          ></nz-switch>\\n        </td>\\n      </tr>\\n      <tr [(nzExpand)]=\\\"pharmacist.expand\\\">\\n        <td></td>\\n        <td colspan=\\\"8\\\">\\n          Status: {{ pharmacist.user.userStatus }}<br />\\n          <div *ngIf=\\\"pharmacist.user.pendency\\\">\\n            Erro: {{ pharmacist.user.pendency.erro }}<br />\\n            Código de erro: {{ pharmacist.user.pendency.erroCodigo }}\\n          </div>\\n        </td>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","import { Component, OnInit } from '@angular/core';\nimport { AuthService } from '@app/core/services/auth.service';\nimport { ModalEditPersonalDataComponent } from '@app/modules/dashboard/modal-edit-personal-data/modal-edit-personal-data.component';\nimport { PharmacistService } from '@app/modules/pharmacist/services/pharmacist.service';\nimport { UserService } from '@app/modules/user/user.service';\nimport { Pharmacist } from '@app/shared/models';\nimport { User } from '@app/shared/models/decodedLoginToken';\nimport { Permission } from '@app/shared/models/permission.enum';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { NzModalService } from 'ng-zorro-antd/modal';\nimport { AdminService } from '../../admin.service';\nimport { ModalAdditionalsFeaturesComponent } from '../../modal-additionals-features/modal-additionals-features.component';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-pharmacists-listing',\n  templateUrl: './pharmacists-listing.component.html',\n  styleUrls: ['./pharmacists-listing.component.scss']\n})\nexport class PharmacistsListingComponent implements OnInit {\n  public data: any;\n  public loading: boolean;\n  private filter: any;\n  pageSize = 10;\n  paginationData = { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 };\n  scrollConfig = { x: '830px', y: '583px' };\n  Permission = Permission;\n\n  constructor(\n    private adminService: AdminService,\n    private authService: AuthService,\n    private pharmacistService: PharmacistService,\n    private modalService: NzModalService,\n    private userService: UserService,\n    private notification: AppToastService\n  ) {}\n\n  @nativeAsync\n  async ngOnInit() {\n    this.loading = true;\n    await this.getPharmacists();\n    this.loading = false;\n  }\n\n  get user(): User {\n    return this.authService.user();\n  }\n\n  filterData(filter) {\n    this.setFilter(filter);\n    this.getPharmacists();\n  }\n  @nativeAsync\n  async pageIndexChanged(pageIndex: any) {\n    this.paginationData.skip = this.pageSize * (pageIndex - 1);\n    await this.getPharmacists();\n  }\n  @nativeAsync\n  async getPharmacists() {\n    try {\n      this.loading = true;\n      this.data = await this.pharmacistService.getPharmaciesByFilter(this.getFilter()).toPromise();\n      this.loading = false;\n    } catch (error) {\n      this.loading = false;\n    }\n  }\n  @nativeAsync\n  async onSortChange(params) {\n    this.paginationData.orderBy = params.key;\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\n    await this.getPharmacists();\n  }\n\n  getFilter() {\n    return {\n      ...this.filter,\n      skip: this.paginationData.skip,\n      limit: this.pageSize,\n      orderBy: this.paginationData.orderBy,\n      sortOrder: this.paginationData.sortOrder\n    };\n  }\n  @nativeAsync\n  public async showModalEditData(pharmacist: Pharmacist, index: number) {\n    const modal = this.modalService.create({\n      nzContent: ModalEditPersonalDataComponent,\n      nzComponentParams: {\n        user: pharmacist.user,\n        completeUser: pharmacist,\n        userTypeLogged: this.user.userType\n      },\n      nzFooter: null\n    });\n    modal.afterOpen.subscribe(() => {\n      modal\n        .getContentComponent()\n        .updateUserEvent.subscribe(updatedUser => this.updateUserData(updatedUser, index));\n    });\n  }\n\n  showModalAdditionalsFeatures(pharmacist: Pharmacist) {\n    this.modalService.create({\n      nzContent: ModalAdditionalsFeaturesComponent,\n      nzComponentParams: {\n        user: pharmacist.user,\n        destination: pharmacist.user.userType\n      },\n      nzTitle: 'Funcionalidades adicionais',\n      nzClosable: false,\n      nzFooter: null\n    });\n  }\n\n  private updateUserData(updatedUser, index) {\n    this.data.pharmacists[index] = updatedUser;\n    this.getPharmacists();\n  }\n\n  isUserUnlocked(user) {\n    return user.access === 'Desbloqueado';\n  }\n  @nativeAsync\n  async toggleLocked(checked, user) {\n    this.loading = true;\n    try {\n      const data = { access: checked ? 'Desbloqueado' : 'Bloqueado' };\n      await this.userService.update(user._id, data).toPromise();\n      this.loading = false;\n    } catch (error) {\n      this.loading = false;\n    }\n  }\n  @nativeAsync\n  async exportData(filter: any) {\n    try {\n      this.loading = true;\n      this.setFilter(filter);\n      await this.adminService.exportData('pharmacists', this.getFilter());\n    } catch (error) {\n      this.notification.notify('error', 'Erro', 'Erro na exportação');\n      console.error(error);\n    }\n    this.loading = false;\n  }\n\n  private setFilter(filter: any) {\n    this.filter = filter;\n    this.filter.cnpj = this.filter.cnpj === undefined ? '' : this.filter.cnpj.replace(/[^0-9]+/gi, '');\n    this.paginationData.skip = 0;\n  }\n}\n","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\";","export default \"<app-form-filter\\r\\n  [listingType]=\\\"listingType\\\"\\r\\n  [title]=\\\"title\\\"\\r\\n  (filterDataEvent)=\\\"filterData($event)\\\"\\r\\n  (exportDataEmit)=\\\"exportData($event)\\\"\\r\\n>\\r\\n</app-form-filter>\\r\\n\\r\\n<nz-table\\r\\n  #listingTable\\r\\n  [nzLoading]=\\\"loading\\\"\\r\\n  nzFrontPagination=\\\"false\\\"\\r\\n  [nzTotal]=\\\"data?.totalRecord\\\"\\r\\n  [nzData]=\\\"dataTable\\\"\\r\\n  nzSize=\\\"small\\\"\\r\\n  [nzPageSize]=\\\"pageSize\\\"\\r\\n  (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\r\\n  nzPaginationPosition=\\\"both\\\"\\r\\n  nzShowTotal=\\\"true\\\"\\r\\n  [nzShowTotal]=\\\"totalTemplate\\\"\\r\\n  style=\\\"overflow-x: auto;\\\"\\r\\n>\\r\\n  <thead nzAlign=\\\"center\\\" (nzSortChange)=\\\"onSortChange($event)\\\">\\r\\n    <tr>\\r\\n      <th nzShowExpand *ngIf=\\\"user.permission === Permission.MASTER\\\"></th>\\r\\n      <th nzShowSort nzSortKey=\\\"updatedAt\\\">Última atualização</th>\\r\\n      <th>Código</th>\\r\\n      <th>Prescritor</th>\\r\\n      <th>Endereço</th>\\r\\n      <th>Paciente</th>\\r\\n      <th>Código de segurança</th>\\r\\n      <th>Status</th>\\r\\n      <th>Versão</th>\\r\\n    </tr>\\r\\n  </thead>\\r\\n\\r\\n  <tbody *ngFor=\\\"let prescription of listingTable.data\\\">\\r\\n    <tr>\\r\\n      <td\\r\\n        nzShowExpand\\r\\n        [(nzExpand)]=\\\"prescription.expand\\\"\\r\\n        *ngIf=\\\"user.permission === Permission.MASTER\\\"\\r\\n      ></td>\\r\\n      <td>{{ prescription.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\r\\n      <td>{{ prescription.code }}</td>\\r\\n      <td>\\r\\n        <span\\r\\n          >{{ getProfessionalTypeNameLabel(prescription.healthProfessional?.professionalType) }}:\\r\\n          {{ prescription.healthProfessional?.name }}\\r\\n        </span>\\r\\n        <br />\\r\\n        <span class=\\\"info-bottom\\\"\\r\\n          >{{ prescription.healthProfessional?.cpf | formattedCpf }},\\r\\n          {{ prescription.healthProfessional?.regionalCouncilNumber?.number }}/{{\\r\\n            prescription.healthProfessional?.regionalCouncilNumber?.uf\\r\\n          }}</span\\r\\n        >\\r\\n      </td>\\r\\n      <td>\\r\\n        <span *ngIf=\\\"prescription.local?.address\\\">\\r\\n          <span>\\r\\n            {{ prescription.local.address.street }}, {{ prescription.local.address.number }} -\\r\\n            {{ prescription.local.address.neighborhood }}\\r\\n          </span>\\r\\n          <br />\\r\\n          <span class=\\\"info-bottom\\\">\\r\\n            {{ prescription.local.address.city }}, {{ prescription.local.address.uf }} -\\r\\n            {{ prescription.local.address.cep }}</span\\r\\n          >\\r\\n        </span>\\r\\n      </td>\\r\\n      <td>\\r\\n        <span> {{ prescription?.patient?.name || prescription?.pet?.name }} </span>\\r\\n        <br />\\r\\n        <span class=\\\"info-bottom\\\">{{ prescription.patient?.cpf | formattedCpf }}</span>\\r\\n        <div *ngIf=\\\"prescription?.patient?.responsible\\\" class=\\\"info-bottom\\\">\\r\\n          <strong>Responsável:</strong>\\r\\n          <span>\\r\\n            {{\\r\\n              prescription?.patient?.responsible?.name || prescription?.patient?.responsible?.fullname\\r\\n            }}\\r\\n            -\\r\\n          </span>\\r\\n          <span>{{ prescription?.patient?.responsible?.cpf | formattedCpf }}</span>\\r\\n        </div>\\r\\n      </td>\\r\\n      <td>{{ prescription.secretCode }}</td>\\r\\n      <td>{{ prescription.status }}</td>\\r\\n      <td>{{ getVersionLabel(prescription.version) }}</td>\\r\\n    </tr>\\r\\n\\r\\n    <ng-template ngFor let-medicament [ngForOf]=\\\"prescription.medicaments\\\">\\r\\n      <tr [nzExpand]=\\\"prescription.expand\\\">\\r\\n        <td></td>\\r\\n        <td colspan=\\\"7\\\">\\r\\n          <div class=\\\"name-area\\\">\\r\\n            <span class=\\\"title\\\">Nome:&nbsp;</span>\\r\\n            <span class=\\\"break-line\\\">{{ medicament.name }}</span>\\r\\n          </div>\\r\\n          <div>\\r\\n            <span class=\\\"title\\\">Descrição: </span>\\r\\n            <span>{{ medicament.description != undefined ? medicament.description : '-' }} </span>\\r\\n          </div>\\r\\n          <div>\\r\\n            <span class=\\\"title\\\">Posologia: </span>\\r\\n            <span>{{ medicament.dosage }}</span>\\r\\n          </div>\\r\\n          <div>\\r\\n            <span class=\\\"title\\\">Quantidade prescrita: </span>\\r\\n            <span>{{ medicament.prescribedQuantity }}</span>\\r\\n          </div>\\r\\n          <div>\\r\\n            <span class=\\\"title\\\">Quantidade disponível: </span>\\r\\n            <span>{{ medicament.availableQuantity }}</span>\\r\\n          </div>\\r\\n        </td>\\r\\n      </tr>\\r\\n    </ng-template>\\r\\n  </tbody>\\r\\n</nz-table>\\r\\n<ng-template #totalTemplate let-total>\\r\\n  {{ paginationData.skip + 1 }} -\\r\\n  <span *ngIf=\\\"loading\\\">\\r\\n    {{ paginationData.skip + pageSize > total ? total : paginationData.skip + pageSize }}\\r\\n  </span>\\r\\n  <span *ngIf=\\\"!loading\\\">\\r\\n    {{ paginationData.skip + dataTable?.length }}\\r\\n  </span>\\r\\n  de {{ total }}\\r\\n</ng-template>\\r\\n\";","import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\r\nimport { AuthService } from '@app/core/services/auth.service';\r\nimport { AttestationService } from '@app/modules/document/pages/attestation/attestation.service';\r\nimport { OrientationService } from '@app/modules/document/pages/orientation/orientation.service';\r\nimport { ExamService } from '@app/modules/document/services/exam.service';\r\nimport { InfusionService } from '@app/modules/document/services/infusion.service';\r\nimport { PrescriptionService } from '@app/modules/document/services/prescription.service';\r\nimport { HealthProfessional } from '@app/shared/models';\r\nimport { User } from '@app/shared/models/decodedLoginToken';\r\nimport { Permission } from '@app/shared/models/permission.enum';\r\nimport { AppToastService } from '@app/shared/services/app-toast.service';\r\nimport { AdminService } from '../../admin.service';\r\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\r\n\r\n@Component({\r\n  selector: 'app-prescriptions-listing',\r\n  templateUrl: './prescriptions-listing.component.html',\r\n  styleUrls: ['./prescriptions-listing.component.scss']\r\n})\r\nexport class PrescriptionsListingComponent implements OnInit, OnChanges {\r\n  public data: any;\r\n  public loading: boolean;\r\n  @Input() listingType: string;\r\n\r\n  filter: any = {};\r\n  title: string;\r\n  pageSize = 10;\r\n  paginationData = { skip: 1, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 };\r\n  scrollConfig = { x: '830px', y: '583px' };\r\n  Permission = Permission;\r\n\r\n  constructor(\r\n    private authService: AuthService,\r\n    private prescriptionService: PrescriptionService,\r\n    private attestationService: AttestationService,\r\n    private examService: ExamService,\r\n    private orientationService: OrientationService,\r\n    private adminService: AdminService,\r\n    private notification: AppToastService,\r\n    private infusionService: InfusionService\r\n  ) {}\r\n\r\n  async ngOnInit() {}\r\n\r\n  get user(): User {\r\n    return this.authService.user();\r\n  }\r\n\r\n  get dataTable(): any {\r\n    return this.data && (this.data.prescriptions || this.data.data);\r\n  }\r\n  @nativeAsync\r\n  async pageIndexChanged(pageIndex: any) {\r\n    this.paginationData.skip = pageIndex;\r\n\r\n    await this.getPrescriptions();\r\n  }\r\n\r\n  ngOnChanges(changes: SimpleChanges): void {\r\n    if (changes.listingType && changes.listingType.previousValue) {\r\n      this.getPrescriptions();\r\n    }\r\n  }\r\n  @nativeAsync\r\n  async onSortChange(params) {\r\n    this.paginationData.orderBy = params.key;\r\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\r\n    await this.getPrescriptions();\r\n  }\r\n  @nativeAsync\r\n  async getPrescriptions() {\r\n    try {\r\n      this.loading = true;\r\n      switch (this.listingType) {\r\n        case 'prescriptions':\r\n          this.title = 'Prescrições';\r\n          this.data = await this.prescriptionService.getPrescriptionsByFilter(this.getFilter());\r\n          break;\r\n        case 'attestations':\r\n          this.title = 'Atestados';\r\n          this.data = await this.attestationService.getByFilter(this.getFilter());\r\n          break;\r\n        case 'exams':\r\n          this.title = 'Exames';\r\n          this.data = await this.examService.getByFilter(this.getFilter());\r\n          break;\r\n        case 'orientations':\r\n          this.title = 'Orientações';\r\n          this.data = await this.orientationService.getByFilter(this.getFilter());\r\n          break;\r\n        case 'infusions':\r\n          this.title = 'Prescrições de infusão';\r\n          this.data = await this.infusionService.getByFilter(this.getFilter());\r\n          break;\r\n      }\r\n    } catch (error) {\r\n      console.error(error);\r\n    }\r\n    this.loading = false;\r\n  }\r\n\r\n  filterData(filter: any) {\r\n    this.setFilter(filter);\r\n    this.getPrescriptions();\r\n  }\r\n\r\n  getFilter() {\r\n    return {\r\n      ...this.filter,\r\n      page: this.paginationData.skip,\r\n      limit: this.pageSize,\r\n      orderBy: this.paginationData.orderBy,\r\n      sortOrder: this.paginationData.sortOrder\r\n    };\r\n  }\r\n  @nativeAsync\r\n  public async exportData(filter: any) {\r\n    try {\r\n      this.loading = true;\r\n      this.setFilter(filter);\r\n      await this.adminService.exportData(this.listingType, this.getFilter());\r\n    } catch (error) {\r\n      this.notification.notify('error', 'Erro', 'Erro na exportação');\r\n      console.error(error);\r\n    }\r\n    this.loading = false;\r\n  }\r\n\r\n  private setFilter(filter) {\r\n    this.filter = filter;\r\n    this.filter.prescriberCpf = this.filter.prescriberCpf.replace(/[^0-9]+/gi, '');\r\n    this.filter.patientCpf = this.filter.patientCpf.replace(/[^0-9]+/gi, '');\r\n    this.paginationData.skip = 1;\r\n  }\r\n\r\n  getProfessionalTypeNameLabel(professionalType: string) {\r\n    return HealthProfessional.getProfessionalTypeNameLabel(professionalType);\r\n  }\r\n\r\n  getVersionLabel(version?: string) {\r\n    if (version === 'BETA') {\r\n      return 'Beta';\r\n    }\r\n    return 'Estável';\r\n  }\r\n}\r\n","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\\n\\n.name-area {\\n  display: flex;\\n}\";","export default \"<app-form-filter\\r\\n  listingType=\\\"retentions\\\"\\r\\n  title=\\\"Retenções\\\"\\r\\n  (filterDataEvent)=\\\"filterData($event)\\\"\\r\\n  (exportDataEmit)=\\\"exportData($event)\\\"\\r\\n>\\r\\n</app-form-filter>\\r\\n\\r\\n<nz-table\\r\\n  #listingTable\\r\\n  [nzLoading]=\\\"loading\\\"\\r\\n  nzFrontPagination=\\\"false\\\"\\r\\n  [nzTotal]=\\\"data?.totalRecord\\\"\\r\\n  [nzData]=\\\"data?.retentions\\\"\\r\\n  nzSize=\\\"small\\\"\\r\\n  [nzPageSize]=\\\"pageSize\\\"\\r\\n  nzSize=\\\"small\\\"\\r\\n  (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\r\\n  style=\\\"overflow-x: auto;\\\"\\r\\n>\\r\\n  <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\r\\n    <tr>\\r\\n      <th nzShowExpand *ngIf=\\\"user.permission === Permission.MASTER\\\"></th>\\r\\n      <th nzShowSort nzSortKey=\\\"updatedAt\\\">Última atualização</th>\\r\\n      <th>Código</th>\\r\\n      <th>Código da Prescrição</th>\\r\\n      <th>Paciente</th>\\r\\n      <th>Data de criação</th>\\r\\n      <th>Farmácia</th>\\r\\n    </tr>\\r\\n  </thead>\\r\\n\\r\\n  <tbody *ngFor=\\\"let retention of listingTable.data\\\">\\r\\n    <ng-template ngFor let-medicament [ngForOf]=\\\"retention.medicaments\\\">\\r\\n      <tr>\\r\\n        <td\\r\\n          nzShowExpand\\r\\n          [(nzExpand)]=\\\"medicament.expand\\\"\\r\\n          *ngIf=\\\"user.permission === Permission.MASTER\\\"\\r\\n        ></td>\\r\\n        <td>{{ retention.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\r\\n        <td>{{ retention.dispensationCode }}</td>\\r\\n        <td>\\r\\n          {{ retention.prescription?.code }}\\r\\n        </td>\\r\\n        <td>\\r\\n          <span> {{ retention.patient?.name }} </span>\\r\\n          <br />\\r\\n          <span class=\\\"info-bottom\\\">{{ retention.patient?.cpf | formattedCpf }}</span>\\r\\n        </td>\\r\\n        <td>\\r\\n          {{ retention.createdAt | date: 'dd/MM/yyyy, HH:mm' }}\\r\\n        </td>\\r\\n        <td>\\r\\n          {{ retention.pharmacy.fantasyName }}<br />\\r\\n          {{ retention.pharmacy.cnpj || retention.pharmacy.cnpj_entity | formattedCnpj }}\\r\\n        </td>\\r\\n      </tr>\\r\\n\\r\\n      <tr [nzExpand]=\\\"medicament.expand\\\">\\r\\n        <td></td>\\r\\n        <td colspan=\\\"3\\\">\\r\\n          <div class=\\\"d-flex\\\">\\r\\n            <span class=\\\"title\\\"> Medicamento: </span>\\r\\n            <span class=\\\"break-line\\\">{{ medicament.description }}</span>\\r\\n          </div>\\r\\n          <span class=\\\"title\\\"> Quantidade prescrita: </span\\r\\n          ><span>{{ medicament.prescribedQuantity }}</span>\\r\\n          <br />\\r\\n          <span class=\\\"title\\\"> Quantidade retida: </span><span>{{ medicament.quantityRetained }}</span>\\r\\n        </td>\\r\\n      </tr>\\r\\n    </ng-template>\\r\\n  </tbody>\\r\\n</nz-table>\\r\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\r\\n\";","import { Component, OnInit } from '@angular/core';\r\nimport { AuthService } from '@app/core/services/auth.service';\r\nimport { RetentionService } from '@app/modules/document/services/retention.service';\r\nimport { User } from '@app/shared/models/decodedLoginToken';\r\nimport { Permission } from '@app/shared/models/permission.enum';\r\nimport { AppToastService } from '@app/shared/services/app-toast.service';\r\nimport { AdminService } from '../../admin.service';\r\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\r\n\r\n@Component({\r\n  selector: 'app-retentions-listing',\r\n  templateUrl: './retentions-listing.component.html',\r\n  styleUrls: ['./retentions-listing.component.scss']\r\n})\r\nexport class RetentionsListingComponent implements OnInit {\r\n  public data: any;\r\n  public loading: boolean;\r\n  private filter: any;\r\n\r\n  pageSize = 10;\r\n  paginationData = { skip: 0, totalRecord: 0, orderBy: 'updatedAt', sortOrder: -1 };\r\n  scrollConfig = { x: '830px', y: '583px' };\r\n  Permission = Permission;\r\n\r\n  constructor(\r\n    private authService: AuthService,\r\n    private adminService: AdminService,\r\n    private retentionService: RetentionService,\r\n    private notification: AppToastService\r\n  ) {}\r\n\r\n  @nativeAsync\r\n  async ngOnInit() {\r\n    this.getRetentions();\r\n    this.loading = false;\r\n  }\r\n\r\n  get user(): User {\r\n    return this.authService.user();\r\n  }\r\n\r\n  filterData(filter) {\r\n    this.setFilter(filter);\r\n    this.getRetentions();\r\n  }\r\n  @nativeAsync\r\n  async pageIndexChanged(pageIndex: any) {\r\n    this.paginationData.skip = this.pageSize * (pageIndex - 1);\r\n    await this.getRetentions();\r\n  }\r\n  @nativeAsync\r\n  async onSortChange(params) {\r\n    this.paginationData.orderBy = params.key;\r\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\r\n    await this.getRetentions();\r\n  }\r\n\r\n  @nativeAsync\r\n  async getRetentions() {\r\n    try {\r\n      this.loading = true;\r\n      this.data = await this.retentionService.getRetentionsByFilter(this.getFilter()).toPromise();\r\n      this.loading = false;\r\n    } catch (error) {\r\n      this.loading = false;\r\n    }\r\n  }\r\n  @nativeAsync\r\n  public async exportData(filter: any) {\r\n    try {\r\n      this.loading = true;\r\n      this.setFilter(filter);\r\n      await this.adminService.exportData('rententions', this.getFilter());\r\n    } catch (error) {\r\n      this.notification.notify('error', 'Erro', 'Erro na exportação');\r\n      console.error(error);\r\n    }\r\n    this.loading = false;\r\n  }\r\n\r\n  private setFilter(filter: any) {\r\n    this.filter = filter;\r\n    this.filter.cpfBuyer = this.filter.cpfBuyer.replace(/[^0-9]+/gi, '');\r\n    this.paginationData.skip = 0;\r\n  }\r\n\r\n  getFilter() {\r\n    return {\r\n      ...this.filter,\r\n      skip: this.paginationData.skip,\r\n      limit: this.pageSize,\r\n      orderBy: this.paginationData.orderBy,\r\n      sortOrder: this.paginationData.sortOrder\r\n    };\r\n  }\r\n}\r\n","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\";","export default \"<div class=\\\"filter-form patients-listing\\\" theme>\\n  <h2 class=\\\"title\\\">\\n    Especialidades\\n  </h2>\\n  <br />\\n  <form (submit)=\\\"filterData()\\\">\\n    <div class=\\\"row form-inputs-align-center\\\">\\n      <div class=\\\"col-3\\\">\\n        <nz-form-label nzFor=\\\"title\\\">Nome:</nz-form-label>\\n        <input nz-input id=\\\"title\\\" name=\\\"title\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.title\\\" />\\n      </div>\\n\\n      <div class=\\\"col-3\\\">\\n        <nz-form-label nzFor=\\\"type\\\">Tipo</nz-form-label>\\n        <nz-select\\n          [(ngModel)]=\\\"filter.type\\\"\\n          id=\\\"type\\\"\\n          name=\\\"type\\\"\\n          nzPlaceHolder=\\\"Selecione o tipo\\\"\\n          nzDropdownClassName=\\\"account-select\\\"\\n        >\\n          <nz-option\\n            *ngFor=\\\"let specialtyType of specialtyTypeOptions\\\"\\n            [nzLabel]=\\\"specialtyType?.label\\\"\\n            [nzValue]=\\\"specialtyType?.value\\\"\\n          >\\n          </nz-option>\\n        </nz-select>\\n      </div>\\n\\n      <div class=\\\"col-2\\\">\\n        <nz-form-label nzFor=\\\"code\\\">Código:</nz-form-label>\\n        <input nz-input id=\\\"code\\\" name=\\\"code\\\" type=\\\"number\\\" [(ngModel)]=\\\"filter.code\\\" />\\n      </div>\\n      <div class=\\\"col-3\\\" class=\\\"buttons\\\">\\n        <button nz-button type=\\\"submit\\\" nzType=\\\"primary\\\">\\n          <i nz-icon nzType=\\\"search\\\"></i>\\n          Filtrar\\n        </button>\\n        <button nz-button type=\\\"button\\\" nzType=\\\"primary\\\" (click)=\\\"showModalAddSpecialty()\\\">\\n          <i class=\\\"fa fa-plus\\\"></i>\\n          Nova especialidade\\n        </button>\\n      </div>\\n    </div>\\n  </form>\\n</div>\\n<br />\\n<nz-table\\n  #listingTable\\n  [nzLoading]=\\\"loading\\\"\\n  nzFrontPagination=\\\"false\\\"\\n  [nzTotal]=\\\"data?.total\\\"\\n  [nzData]=\\\"data?.specialties\\\"\\n  [nzPageIndex]=\\\"paginationData.skip\\\"\\n  [nzPageSize]=\\\"pageSize\\\"\\n  nzSize=\\\"default\\\"\\n  (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n  style=\\\"overflow-x: auto;\\\"\\n>\\n  <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\n    <tr>\\n      <th>Código</th>\\n      <th>Tipo</th>\\n      <th>Nome</th>\\n      <th></th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-specialty let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <tr>\\n        <td>{{ specialty.code }}</td>\\n        <td>{{ getSpecialtyType(specialty.type) }}</td>\\n        <td>{{ specialty.title }}</td>\\n        <td>\\n          <button\\n            (click)=\\\"showModalEditSpecialty(specialty)\\\"\\n            title=\\\"Editar especialidade\\\"\\n            class=\\\"btn btn-icon btn-simple\\\"\\n            type=\\\"button\\\"\\n          >\\n            <span class=\\\"btn-inner--icon\\\"><i class=\\\"fa fa-pencil-solid\\\"></i></span>\\n          </button>\\n          <button\\n            (click)=\\\"deleteSpecialty(specialty, i)\\\"\\n            title=\\\"Apagar especialidade\\\"\\n            class=\\\"btn btn-icon btn-simple\\\"\\n            type=\\\"button\\\"\\n          >\\n            <span class=\\\"btn-inner--icon danger\\\"><i class=\\\"fa fa-trash-solid\\\"></i></span>\\n          </button>\\n        </td>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { Specialty } from '@app/shared/models';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { NzModalRef } from 'ng-zorro-antd/modal';\nimport { SpecialtiesService } from '../listing/features-listing/specialties.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-modal-add-specialties',\n  templateUrl: './modal-add-specialties.component.html',\n  styleUrls: ['./modal-add-specialties.component.scss']\n})\nexport class ModalAddSpecialtiesComponent implements OnInit {\n  @Input() specialty: Specialty;\n  @Output() submit = new EventEmitter<any>();\n\n  form: FormGroup;\n  loading = false;\n\n  constructor(\n    private fb: FormBuilder,\n    private nzModalRef: NzModalRef,\n    private notification: AppToastService,\n    private specialtyService: SpecialtiesService\n  ) {}\n\n  ngOnInit() {\n    this.form = this.fb.group({\n      title: [null, Validators.required],\n      code: [\n        {\n          value: '',\n          disabled: true\n        }\n      ],\n      type: [null, Validators.required],\n      description: [null]\n    });\n\n    if (this.specialty) {\n      this.form.get('code').setValue(this.specialty.code);\n    }\n\n    if (this.specialty) {\n      this.form.patchValue(this.specialty);\n    }\n  }\n\n  handleCancel(): void {\n    this.nzModalRef.destroy();\n  }\n\n  save() {\n    if (this.form.valid) {\n      if (!this.specialty) {\n        this.saveSpecialty();\n      } else {\n        this.updateSpecialty();\n      }\n    }\n  }\n\n  get isEdit() {\n    return !!this.specialty;\n  }\n\n  @nativeAsync\n  async updateSpecialty() {\n    try {\n      this.loading = true;\n\n      await this.specialtyService.update(this.specialty._id, this.form.value).toPromise();\n      this.notification.notify('success', 'Sucesso', 'Especialidade autalizada com sucesso!');\n      this.loading = false;\n\n      this.submit.next();\n      this.nzModalRef.destroy();\n    } catch (error) {\n      this.loading = false;\n      this.notification.notify('error', 'Erro', 'Houve um problema ao editar a especialidade!');\n      console.error(error);\n    }\n  }\n\n  @nativeAsync\n  async saveSpecialty() {\n    try {\n      this.loading = true;\n\n      await this.specialtyService.save(this.form.value).toPromise();\n      this.notification.notify('success', 'Sucesso', 'Especialidade cadastrada com sucesso!');\n      this.loading = false;\n\n      this.submit.next();\n      this.nzModalRef.destroy();\n    } catch (error) {\n      this.loading = false;\n\n      if (error.status === 409) {\n        this.notification.notify('error', 'Erro', 'Já existe uma especialidade com esses dados.');\n      } else {\n        this.notification.notify('error', 'Erro', error.error.msg);\n      }\n    }\n  }\n}\n","export default \"<div theme>\\n  <div class=\\\"modal-body\\\">\\n    <form nz-form [formGroup]=\\\"form\\\">\\n      <div class=\\\"row justify-content-between\\\">\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"nome\\\">Nome: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <input nz-input formControlName=\\\"title\\\" id=\\\"nome\\\" maxlength=\\\"128\\\" />\\n              <nz-form-explain *ngIf=\\\"form.get('title').dirty && form.get('title').errors\\\">\\n                <ng-container *ngIf=\\\"form.get('title').hasError('required')\\\">\\n                  Campo obrigatório, por favor digite o nome.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div class=\\\"col-4\\\" *ngIf=\\\"isEdit\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"code\\\">Código: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n            <nz-form-control>\\n              <input type=\\\"number\\\" nz-input formControlName=\\\"code\\\" id=\\\"code\\\" value=\\\"0000\\\" />\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n        <div [ngClass]=\\\"isEdit ? 'col-8' : 'col-12'\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"type\\\">Tipo: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n\\n            <nz-form-control nzHasFeedback>\\n              <select nz-input formControlName=\\\"type\\\" id=\\\"type\\\">\\n                <option value=\\\"doctor\\\">Médico</option>\\n                <option value=\\\"dentist\\\">Dentista</option>\\n                <option value=\\\"pharmacist\\\">Farmacêutico</option>\\n                <option value=\\\"biomedic\\\">Biomédico</option>\\n                <option value=\\\"veterinarian\\\">Veterinário</option>\\n              </select>\\n\\n              <nz-form-explain *ngIf=\\\"form.get('type').dirty && form.get('type').errors\\\">\\n                <ng-container *ngIf=\\\"form.get('type').hasError('required')\\\">\\n                  Campo obrigatório, por favor selecione uma destinação.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n      </div>\\n      <div class=\\\"row justify-content-between\\\">\\n        <div class=\\\"col-12\\\">\\n          <nz-form-item>\\n            <nz-form-label nzFor=\\\"description\\\">Descrição:</nz-form-label>\\n            <nz-form-control nzHasFeedback>\\n              <textarea\\n                rows=\\\"4\\\"\\n                cols=\\\"6\\\"\\n                nz-input\\n                formControlName=\\\"description\\\"\\n                id=\\\"description\\\"\\n              ></textarea>\\n              <nz-form-explain *ngIf=\\\"form.get('description').dirty && form.get('description').errors\\\">\\n                <ng-container *ngIf=\\\"form.get('description').hasError('required')\\\">\\n                  Campo obrigatório, por favor informe uma descrição.\\n                </ng-container>\\n              </nz-form-explain>\\n            </nz-form-control>\\n          </nz-form-item>\\n        </div>\\n      </div>\\n    </form>\\n  </div>\\n  <div class=\\\"modal-footer\\\">\\n    <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-default\\\" (click)=\\\"handleCancel()\\\">\\n      Cancelar\\n    </button>\\n    <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-primary\\\" (click)=\\\"save()\\\">\\n      Salvar <i class=\\\"fa\\\"></i>\\n    </button>\\n  </div>\\n</div>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","export default \"\";","import { Component, OnInit } from '@angular/core';\nimport { Specialty } from '@app/shared/models';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { NzModalService } from 'ng-zorro-antd/modal';\nimport { ModalAddSpecialtiesComponent } from '../../modal-add-specialties/modal-add-specialties.component';\nimport { SpecialtiesService } from '../features-listing/specialties.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-specialties-listing',\n  templateUrl: './specialties-listing.component.html',\n  styleUrls: ['./specialties-listing.component.scss']\n})\nexport class SpecialtiesListingComponent implements OnInit {\n  loading: boolean;\n  filter = { title: '', type: '', code: '' };\n  pageSize = 10;\n  paginationData = { skip: 0, total: 0, orderBy: 'updatedAt', sortOrder: -1 };\n  data: any;\n  specialtyTypeOptions = [\n    { label: 'Todos', value: '' },\n    { label: 'Médico', value: 'doctor' },\n    { label: 'Dentista', value: 'dentist' },\n    { label: 'Farmacêutico', value: 'pharmacist' },\n    { label: 'Biomédico', value: 'biomedic' },\n    { label: 'Veterinário', value: 'veterinarian' }\n  ];\n  scrollConfig = {};\n\n  constructor(\n    private specialtiesService: SpecialtiesService,\n    private modalService: NzModalService,\n    private notification: AppToastService\n  ) {}\n\n  ngOnInit() {\n    this.filterData();\n  }\n\n  private get lastCode(): number {\n    return this.data.specialties.length && this.data.specialties[0].code;\n  }\n\n  @nativeAsync\n  async getSpecialties() {\n    try {\n      this.loading = true;\n      this.data = await this.specialtiesService.getSpecialties(this.getFilter()).toPromise();\n    } catch (error) {\n      console.error(error);\n    }\n    this.loading = false;\n  }\n  @nativeAsync\n  async filterData() {\n    this.paginationData.skip = 0;\n    await this.getSpecialties();\n  }\n\n  getFilter() {\n    return {\n      ...this.filter,\n      skip: this.paginationData.skip,\n      limit: this.pageSize\n    };\n  }\n  @nativeAsync\n  async deleteSpecialty(specialty) {\n    this.modalService.confirm({\n      nzTitle: 'Tem certeza que deseja remover essa especialidade?',\n      nzContent: null,\n      nzOnOk: async () => {\n        await this.specialtiesService.delete(specialty).toPromise();\n        await this.getSpecialties();\n\n        this.notification.notify('success', 'Especialidade apagada com sucesso!', '');\n      }\n    });\n  }\n\n  showModalAddSpecialty() {\n    const modal = this.modalService.create({\n      nzContent: ModalAddSpecialtiesComponent,\n      nzTitle: 'Nova especialidade',\n      nzClosable: false,\n      nzFooter: null\n    });\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().submit.subscribe(_ => this.filterData());\n    });\n  }\n\n  showModalEditSpecialty(specialty: Specialty) {\n    const modal = this.modalService.create({\n      nzContent: ModalAddSpecialtiesComponent,\n      nzComponentParams: { specialty },\n      nzTitle: 'Editar especialidade',\n      nzClosable: false,\n      nzFooter: null\n    });\n\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().submit.subscribe(_ => this.filterData());\n    });\n  }\n  @nativeAsync\n  async updateSpecialties() {\n    this.paginationData.skip = 1;\n    await this.getSpecialties();\n  }\n  @nativeAsync\n  async pageIndexChanged(pageIndex: any) {\n    this.paginationData.skip = pageIndex;\n    await this.getSpecialties();\n  }\n  @nativeAsync\n  async onSortChange(params) {\n    this.paginationData.orderBy = params.key;\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\n    await this.getSpecialties();\n  }\n\n  getSpecialtyType(type: string): string {\n    switch (type) {\n      case 'doctor':\n        return 'Médico';\n      case 'dentist':\n        return 'Dentista';\n      case 'pharmacist':\n        return 'Farmacêutico';\n      case 'biomedic':\n        return 'Biomédico';\n      case 'veterinarian':\n        return 'Veterinário';\n      default:\n        return type;\n    }\n  }\n}\n","export default \".form-inputs-align-center {\\n  align-items: center;\\n}\\n.form-inputs-align-center button {\\n  margin: 0 8px;\\n  margin-top: 24px;\\n}\\n.danger {\\n  color: #f75f5f;\\n}\\n.btn {\\n  color: #525f7f;\\n}\";","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms';\nimport { NzModalRef } from 'ng-zorro-antd/modal';\nimport { Tag } from '../../../shared/models/tag';\n\n@Component({\n  selector: 'app-modal-form-tag',\n  templateUrl: './modal-form-tag.component.html',\n  styleUrls: ['./modal-form-tag.component.scss']\n})\nexport class ModalFormTagComponent implements OnInit {\n  @Output() save = new EventEmitter<Tag>();\n\n  tag: Tag;\n  parent: Tag;\n  form: FormGroup;\n\n  constructor(private nzModalRef: NzModalRef, private fb: FormBuilder) {}\n\n  ngOnInit() {\n    this.form = this.fb.group({\n      name: this.fb.control('', [\n        this.requiredIfNotChild,\n        Validators.minLength(2),\n        Validators.maxLength(5)\n      ]),\n      description: this.fb.control('', Validators.required),\n      content: this.fb.control('')\n    });\n\n    if (this.tag) {\n      this.form.patchValue(this.tag);\n    }\n  }\n\n  private readonly requiredIfNotChild: ValidatorFn = () => {\n    return !!this.parent ? Validators.required : Validators.nullValidator;\n  };\n\n  get tagForm() {\n    return this.form.value;\n  }\n\n  onSave() {\n    this.save.emit({\n      ...this.tagForm,\n      name: this.tagForm.name && this.tagForm.name.replace('#', '')\n    });\n  }\n\n  onCancel() {\n    this.nzModalRef.destroy();\n  }\n}\n","export default \"<div class=\\\"modal-body\\\" theme>\\n  <form nz-form [formGroup]=\\\"form\\\">\\n    <div class=\\\"row justify-content-between\\\">\\n      <div class=\\\"col-12\\\" *ngIf=\\\"parent\\\">\\n        <nz-form-item>\\n          <nz-form-label nzFor=\\\"nome\\\">Tag pai:</nz-form-label>\\n          <nz-form-control nzHasFeedback>\\n            <input\\n              disabled\\n              nz-input\\n              minlength=\\\"2\\\"\\n              maxlength=\\\"5\\\"\\n              style=\\\"text-transform:uppercase\\\"\\n              [value]=\\\"parent.description\\\"\\n            />\\n          </nz-form-control>\\n        </nz-form-item>\\n      </div>\\n      <div class=\\\"col-12\\\" *ngIf=\\\"!parent\\\">\\n        <nz-form-item>\\n          <nz-form-label nzFor=\\\"nome\\\">Nome: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n          <nz-form-control nzHasFeedback>\\n            <input\\n              nz-input\\n              formControlName=\\\"name\\\"\\n              id=\\\"nome\\\"\\n              minlength=\\\"2\\\"\\n              maxlength=\\\"5\\\"\\n              placeholder=\\\"#ABC\\\"\\n              style=\\\"text-transform:uppercase\\\"\\n            />\\n            <nz-form-explain *ngIf=\\\"form.get('name').dirty && form.get('name').errors\\\">\\n              <ng-container *ngIf=\\\"form.get('name').hasError('required')\\\">\\n                Campo obrigatório, por favor digite o nome da tag.\\n              </ng-container>\\n            </nz-form-explain>\\n          </nz-form-control>\\n        </nz-form-item>\\n      </div>\\n    </div>\\n    <div class=\\\"row justify-content-between\\\">\\n      <div class=\\\"col-12\\\">\\n        <nz-form-item>\\n          <nz-form-label nzFor=\\\"description\\\">Descrição: <span class=\\\"mandatory\\\"> *</span></nz-form-label>\\n          <nz-form-control nzHasFeedback>\\n            <input nz-input formControlName=\\\"description\\\" id=\\\"description\\\" maxlength=\\\"120\\\" />\\n            <nz-form-explain *ngIf=\\\"form.get('description').dirty && form.get('description').errors\\\">\\n              <ng-container *ngIf=\\\"form.get('description').hasError('required')\\\">\\n                Campo obrigatório, por favor informe uma descrição.\\n              </ng-container>\\n            </nz-form-explain>\\n          </nz-form-control>\\n        </nz-form-item>\\n      </div>\\n    </div>\\n    <div class=\\\"row justify-content-between\\\">\\n      <div class=\\\"col-12\\\">\\n        <nz-form-item>\\n          <nz-form-label nzFor=\\\"content\\\">Conteúdo:</nz-form-label>\\n          <nz-form-control nzHasFeedback>\\n            <textarea rows=\\\"2\\\" cols=\\\"6\\\" nz-input formControlName=\\\"content\\\" id=\\\"content\\\"></textarea>\\n          </nz-form-control>\\n        </nz-form-item>\\n      </div>\\n    </div>\\n  </form>\\n</div>\\n<div class=\\\"modal-footer\\\" theme>\\n  <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-default\\\" (click)=\\\"onCancel()\\\">\\n    Cancelar\\n  </button>\\n  <button class=\\\"ok-btn\\\" nz-button class=\\\"btn-primary\\\" (click)=\\\"onSave()\\\" [disabled]=\\\"!form.valid\\\">\\n    Salvar <i class=\\\"fa\\\"></i>\\n  </button>\\n</div>\\n\";","export default \".modal-body {\\n  padding: 10px;\\n}\\n.modal-body .btn-save {\\n  float: right;\\n  padding-top: 7px;\\n  padding-bottom: 7px;\\n  margin-top: 13px;\\n  margin-bottom: 5px;\\n}\\n.modal-body i {\\n  font-size: 24px;\\n}\\n.modal-body .mandatory {\\n  color: red;\\n}\\n.modal-body input::-webkit-input-placeholder {\\n  color: #bdc2c7;\\n}\\n::ng-deep .ant-select-selection {\\n  height: 100%;\\n}\\n.modal-header {\\n  background: #4cbca3 !important;\\n}\\n::ng-deep .ant-modal-header {\\n  background: #4cbca3 !important;\\n  border-radius: 4px 4px 0 0;\\n}\\n::ng-deep .ant-modal-title {\\n  color: white !important;\\n  font-size: 17px;\\n}\\n::ng-deep .ant-modal {\\n  width: 600px !important;\\n}\\n.modal-footer {\\n  margin: 0;\\n}\";","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Tag } from '@app/shared/models/tag';\nimport { environment } from '@env/environment';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class TagsService {\n  constructor(private http: HttpClient) {}\n\n  findAll(): Promise<Tag[]> {\n    return this.http.get<Tag[]>(`${environment.apiRoot}tags`).toPromise();\n  }\n\n  save(tag: Tag, parentId = ''): Promise<Tag> {\n    return this.http\n      .post<Tag>(`${environment.apiRoot}tags${parentId ? '/' + parentId : ''}`, tag)\n      .toPromise();\n  }\n\n  update(id: string, tag: Tag) {\n    return this.http.put<Tag>(`${environment.apiRoot}tags/${id}`, tag).toPromise();\n  }\n\n  delete(id: string) {\n    return this.http.delete(`${environment.apiRoot}tags/${id}`).toPromise();\n  }\n}\n","import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { Component, OnInit, ViewChild } from '@angular/core';\nimport { Tag } from '@app/shared/models/tag';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { NzModalService } from 'ng-zorro-antd/modal';\nimport { ModalFormTagComponent } from '../../modal-form-tag/modal-form-tag.component';\nimport { TagsService } from './tags.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-tags-listing',\n  templateUrl: './tags-listing.component.html',\n  styleUrls: ['./tags-listing.component.scss']\n})\nexport class TagsListingComponent implements OnInit {\n  tags: Tag[];\n  list: { [key: string]: Tag[] } = {};\n  loading = false;\n  disableDragging = false;\n\n  @ViewChild('listingTable')\n  private listingTable: any;\n\n  constructor(\n    private tagsService: TagsService,\n    private modalService: NzModalService,\n    private notification: AppToastService\n  ) {}\n\n  @nativeAsync\n  async ngOnInit() {\n    this.loadTags();\n  }\n\n  @nativeAsync\n  private async loadTags() {\n    this.tags = await this.tagsService.findAll();\n    this.tags.forEach(tag => {\n      this.list[tag.id] = this.convertTreeToList(tag);\n    });\n  }\n\n  collapse(array: Tag[], data: Tag, event: boolean): void {\n    this.disableDragging = !!event;\n\n    if (!event) {\n      if (data.children) {\n        data.children.forEach(d => {\n          const target = array.find(a => a.id === d.id)!;\n          target.expand = false;\n          this.collapse(array, target, false);\n        });\n      }\n    }\n  }\n\n  showAddTag(parent?: Tag) {\n    const modal = this.modalService.create({\n      nzContent: ModalFormTagComponent,\n      nzComponentParams: { parent },\n      nzTitle: parent ? 'Nova Subtag' : 'Nova Tag',\n      nzClosable: false,\n      nzFooter: null\n    });\n\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().save.subscribe(async (tag: Tag) => {\n        try {\n          await this.tagsService.save(tag, parent && parent.id);\n          this.notification.notify('success', 'Sucesso', 'Tag salva com sucesso');\n          modal.close();\n          await this.loadTags();\n        } catch (err) {\n          if (err.status === 409) {\n            this.notification.notify('warning', 'Aviso', err.error.message);\n          } else {\n            this.notification.notify('error', 'Erro', 'Erro ao salvar tag');\n          }\n        }\n      });\n    });\n  }\n\n  showEditTag(tag: Tag, parent: Tag) {\n    const modal = this.modalService.create({\n      nzContent: ModalFormTagComponent,\n      nzComponentParams: { tag, parent },\n      nzTitle: parent ? 'Editar Subtag' : 'Editar Tag',\n      nzClosable: false,\n      nzFooter: null\n    });\n    modal.afterOpen.subscribe(() => {\n      modal.getContentComponent().save.subscribe(async (newTag: Tag) => {\n        try {\n          const tagToSave = { ...tag, ...newTag };\n          await this.tagsService.update(tag.id, tagToSave);\n          this.notification.notify('success', 'Sucesso', 'Tag salva com sucesso');\n          modal.close();\n          await this.loadTags();\n        } catch (err) {\n          if (err.status === 409) {\n            this.notification.notify('warning', 'Aviso', err.error.message);\n          } else {\n            this.notification.notify('error', 'Erro', 'Erro ao salvar tag');\n          }\n        }\n      });\n    });\n  }\n\n  @nativeAsync\n  async drop(event: CdkDragDrop<string[]>) {\n    const { previousIndex, currentIndex } = event;\n\n    try {\n      const tags = this.listingTable.data;\n\n      const selectedTag = tags[event.previousIndex];\n      selectedTag.order = event.currentIndex;\n      await this.tagsService.update(selectedTag.id, selectedTag);\n\n      const start = previousIndex < currentIndex ? previousIndex + 1 : currentIndex;\n      const end = previousIndex < currentIndex ? currentIndex + 1 : previousIndex;\n\n      for (let i = start; i < end; i++) {\n        const tag = tags[i];\n        tag.order = previousIndex < currentIndex ? i - 1 : i + 1;\n        await this.tagsService.update(tag.id, tag);\n      }\n\n      moveItemInArray(tags, previousIndex, currentIndex);\n      this.tags = tags;\n    } catch (err) {\n      this.listingTable.data = this.tags;\n    }\n  }\n  @nativeAsync\n  async toggleEnable(tag: Tag) {\n    tag.enabled = !tag.enabled;\n    await this.editTag(tag);\n  }\n  @nativeAsync\n  async editTag(tag: Tag) {\n    try {\n      tag = await this.tagsService.update(tag.id, tag);\n    } catch (err) {\n      if (err.status === 409) {\n        this.notification.notify('warning', 'Aviso', err.error.message);\n      } else if (err.error.status) {\n        this.notification.notify('warning', 'Aviso', 'Tag não existe');\n        await this.loadTags();\n      } else {\n        this.notification.notify('error', 'Erro', 'Erro ao atualizar tag');\n      }\n    }\n  }\n\n  deleteTag(tag: Tag) {\n    this.modalService.confirm({\n      nzTitle: `<p>Tem certeza que deseja excluir a tag ${\n        tag.children.length ? 'e suas subtags?' : '?'\n      }</p>\n      ${tag.name ? '<p>Tag: #' + tag.name + '<br>' : ''}\n      Descrição: ${tag.description}\n      ${tag.children.length ? '<br>Subtags: ' + tag.children.length : ''}\n      </p>`,\n      nzContent: null,\n      nzOnOk: async () => {\n        try {\n          await this.tagsService.delete(tag.id);\n          this.notification.notify('success', 'Sucesso', 'Tag excluída com sucesso');\n          await this.loadTags();\n        } catch (err) {\n          if (err.status === 404) {\n            this.notification.notify('success', 'Sucesso', 'Tag excluída com sucesso');\n            await this.loadTags();\n          } else {\n            this.notification.notify('error', 'Erro', 'Erro ao excluir tag');\n          }\n        }\n      }\n    });\n  }\n\n  private convertTreeToList(root: Tag): Tag[] {\n    const stack: Tag[] = [];\n    const array: Tag[] = [];\n    const hashMap = {};\n    stack.push({ ...root, level: 0, expand: false });\n\n    while (stack.length !== 0) {\n      const node = stack.pop()!;\n      this.visitNode(node, hashMap, array);\n      if (node.children) {\n        for (let i = node.children.length - 1; i >= 0; i--) {\n          stack.push({ ...node.children[i], level: node.level! + 1, expand: false, parent: node });\n        }\n      } else {\n        node.children = [];\n      }\n    }\n\n    return array;\n  }\n\n  private visitNode(node: Tag, hashMap: { [key: string]: boolean }, array: Tag[]): void {\n    if (!hashMap[node.id]) {\n      hashMap[node.id] = true;\n      array.push(node);\n    }\n  }\n}\n","export default \"<div class=\\\"filter-form patients-listing\\\">\\n  <h2 class=\\\"title\\\">\\n    Tags de prontuário\\n  </h2>\\n  <br />\\n  <div class=\\\"row\\\">\\n    <button nz-button class=\\\"ml-3\\\" type=\\\"button\\\" nzType=\\\"primary\\\" (click)=\\\"showAddTag()\\\">\\n      <i class=\\\"fa fa-plus\\\"></i>\\n      Novo\\n    </button>\\n  </div>\\n</div>\\n\\n<nz-table #listingTable [nzData]=\\\"tags\\\" nzFrontPagination=\\\"false\\\">\\n  <thead>\\n    <tr>\\n      <th>Descrição</th>\\n      <th>Tag</th>\\n      <th>Ações</th>\\n    </tr>\\n  </thead>\\n  <tbody\\n    cdkDropList\\n    [cdkDropListSortingDisabled]=\\\"disableDragging\\\"\\n    (cdkDropListDropped)=\\\"drop($event)\\\"\\n    class=\\\"example-list\\\"\\n  >\\n    <ng-template ngFor let-tag let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <ng-container *ngFor=\\\"let item of list[tag.id]\\\">\\n        <tr\\n          *ngIf=\\\"(item.parent && item.parent.expand) || !item.parent\\\"\\n          cdkDrag\\n          [cdkDragDisabled]=\\\"disableDragging\\\"\\n          [class.tag-item]=\\\"!disableDragging\\\"\\n        >\\n          <td\\n            [nzIndentSize]=\\\"item.level * 20\\\"\\n            [nzShowExpand]=\\\"item.children && item.children.length > 0\\\"\\n            [(nzExpand)]=\\\"item.expand\\\"\\n            (nzExpandChange)=\\\"collapse(list[tag.id], item, $event)\\\"\\n          >\\n            {{ item.parent ? item.order + 1 + '.' : '' }} {{ item.description }}\\n          </td>\\n          <td>\\n            {{ !item.parent && item.name ? '#' + item.name : '' }}\\n          </td>\\n          <td>\\n            <nz-switch\\n              class=\\\"pr-2\\\"\\n              nzCheckedChildren=\\\"Ativo\\\"\\n              (ngModelChange)=\\\"toggleEnable(item)\\\"\\n              [ngModel]=\\\"item.enabled\\\"\\n              nzUnCheckedChildren=\\\"Inativo\\\"\\n            ></nz-switch>\\n            <button class=\\\"btn m-0 p-2\\\" title=\\\"Editar\\\" (click)=\\\"showEditTag(item, item.parent)\\\">\\n              <i nz-icon class=\\\"fas fa-pencil-solid\\\"></i>\\n            </button>\\n            <button class=\\\"btn m-0 p-2\\\" title=\\\"Excluir\\\" (click)=\\\"deleteTag(item)\\\">\\n              <i nz-icon class=\\\"fas fa-trash-alt\\\"></i>\\n            </button>\\n            <button\\n              class=\\\"btn m-0 p-2\\\"\\n              title=\\\"Nova subtag\\\"\\n              (click)=\\\"showAddTag(item)\\\"\\n              *ngIf=\\\"!item.parentId\\\"\\n            >\\n              <i nz-icon class=\\\"fas fa-plus\\\"></i>\\n            </button>\\n          </td>\\n        </tr>\\n      </ng-container>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\\n\\n.tag-item {\\n  cursor: move;\\n}\\n\\n.cdk-drag-preview {\\n  box-sizing: border-box;\\n  border-radius: 4px;\\n  box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);\\n}\\n\\n.cdk-drag-placeholder {\\n  opacity: 0;\\n}\\n\\n.cdk-drag-animating {\\n  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);\\n}\\n\\n.tag-item:last-child {\\n  border: none;\\n}\\n\\n.example-list.cdk-drop-list-dragging .tag-item:not(.cdk-drag-placeholder) {\\n  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);\\n}\";","import { User } from './decodedLoginToken';\nimport { HealthProfessional } from './health-professional';\nexport class UserTelemedicine {\n  userId: string;\n  status: string;\n  document: {\n    name: string;\n    path: string;\n    contentType: string;\n  };\n  healthProfessional: HealthProfessional;\n  subaccount: any;\n  subscription: any;\n  user: User;\n  expand?: boolean;\n\n  static fromJson(data: any): UserTelemedicine {\n    return Object.assign(new UserTelemedicine(), data);\n  }\n\n  get statusText(): string {\n    return { in_review: 'Em análise', enabled: 'Habilitado', disabled: 'Desabilitado' }[this.status];\n  }\n}\n","import { UserTelemedicine } from '@app/shared/models/user-telemedicine';\nimport { environment } from '@env/environment';\nimport { map } from 'rxjs/operators';\nimport { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class TelemedicineService {\n  constructor(private http: HttpClient) {}\n\n  getTelemedicines(filter: any) {\n    return this.http\n      .get<UserTelemedicine[]>(`${environment.apiRoot}user-telemedicine`, { params: filter })\n      .pipe(map(list => list.map(data => UserTelemedicine.fromJson(data))))\n      .toPromise();\n  }\n\n  enable(userId: string) {\n    return this.http\n      .put<any>(`${environment.apiRoot}user-telemedicine/${userId}/enable`, {})\n      .toPromise();\n  }\n\n  disable(userId: string) {\n    return this.http.delete<any>(`${environment.apiRoot}user-telemedicine/${userId}/enable`).toPromise();\n  }\n\n  downloadDocument(userId: string) {\n    return this.http\n      .get<any>(`${environment.apiRoot}user-telemedicine/${userId}/download-document`, {\n        responseType: 'blob' as 'json'\n      })\n      .toPromise();\n  }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { UserTelemedicine } from '@app/shared/models/user-telemedicine';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\nimport { TelemedicineService } from './telemedicine.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-telemedicine-listing',\n  templateUrl: './telemedicine-listing.component.html',\n  styleUrls: ['./telemedicine-listing.component.scss']\n})\nexport class TelemedicinesListingComponent implements OnInit {\n  scrollConfig = { x: '830px', y: '583px' };\n  statusOptions = [\n    { label: 'Todos', value: '' },\n    { label: 'Em análise', value: 'in_review' },\n    { label: 'Habilitado', value: 'enabled' },\n    { label: 'Desabilitado', value: 'disabled' }\n  ];\n\n  filter = { name: '', email: '', cpf: '', status: 'in_review' };\n  paginationData = { orderBy: 'date', sortOrder: -1 };\n\n  loading = false;\n  data: UserTelemedicine[];\n\n  constructor(private telemedicineService: TelemedicineService, private notification: AppToastService) {}\n\n  ngOnInit() {\n    this.filterData();\n  }\n\n  filterData() {\n    this.getTelemedicines();\n  }\n\n  private getFilter() {\n    return {\n      ...this.filter,\n      ...this.paginationData\n    };\n  }\n\n  @nativeAsync\n  private async getTelemedicines() {\n    try {\n      this.loading = true;\n      this.data = await this.telemedicineService.getTelemedicines(this.getFilter());\n      console.log(this.data);\n    } catch (err) {\n      console.error(err);\n    }\n    this.loading = false;\n  }\n\n  @nativeAsync\n  async onSortChange(params) {\n    this.paginationData.orderBy = params.key;\n    this.paginationData.sortOrder = params.value === 'descend' ? -1 : 1;\n    await this.getTelemedicines();\n  }\n\n  @nativeAsync\n  async enableUser(userId: string) {\n    try {\n      this.loading = true;\n      await this.telemedicineService.enable(userId);\n      this.notification.notify('success', 'Sucesso', 'Usuário habilitado com sucesso');\n      this.filterData();\n    } catch (err) {\n      console.error(err.error);\n    }\n    this.loading = false;\n  }\n\n  @nativeAsync\n  async disableUser(userId: string) {\n    try {\n      this.loading = true;\n      await this.telemedicineService.disable(userId);\n      this.notification.notify('success', 'Sucesso', 'Usuário desabilitado com sucesso');\n      this.filterData();\n    } catch (err) {\n      console.error(err.error);\n    }\n    this.loading = false;\n  }\n\n  @nativeAsync\n  async downloadDocument(ut: UserTelemedicine) {\n    try {\n      this.loading = true;\n      const response = await this.telemedicineService.downloadDocument(ut.userId);\n\n      const a = document.createElement('a');\n      a.href = URL.createObjectURL(response);\n      a.download = ut.document.name;\n      a.click();\n    } catch (err) {\n      if (err.error.status === 404) {\n        this.notification.notify('warning', 'Alerta', 'Documento não encontrado');\n      } else {\n        this.notification.notify('warning', 'Alerta', 'Ocorreu um problema ao baixar documento');\n      }\n      console.error(err.error);\n    }\n    this.loading = false;\n  }\n}\n","export default \"<div class=\\\"filter-form patients-listing\\\">\\n  <h2 class=\\\"title\\\">\\n    Telemedicina\\n  </h2>\\n  <br />\\n  <form>\\n    <div class=\\\"row\\\">\\n      <div class=\\\"col-3\\\">\\n        <nz-form-label nzFor=\\\"name\\\">Nome:</nz-form-label>\\n        <input nz-input id=\\\"name\\\" name=\\\"name\\\" [(ngModel)]=\\\"filter.name\\\" />\\n      </div>\\n      <div class=\\\"col-3\\\">\\n        <nz-form-label nzFor=\\\"email\\\">E-mail:</nz-form-label>\\n        <input nz-input name=\\\"email\\\" [(ngModel)]=\\\"filter.email\\\" />\\n      </div>\\n      <div class=\\\"col-2\\\">\\n        <nz-form-label nzFor=\\\"cpf\\\">CPF:</nz-form-label>\\n        <input nz-input name=\\\"cpf\\\" [(ngModel)]=\\\"filter.cpf\\\" />\\n      </div>\\n      <div class=\\\"col-2\\\">\\n        <nz-form-label nzFor=\\\"status\\\">Status</nz-form-label>\\n        <nz-select [(ngModel)]=\\\"filter.status\\\" name=\\\"status\\\">\\n          <nz-option\\n            *ngFor=\\\"let status of statusOptions\\\"\\n            [nzLabel]=\\\"status.label\\\"\\n            [nzValue]=\\\"status.value\\\"\\n          >\\n          </nz-option>\\n        </nz-select>\\n      </div>\\n      <div class=\\\"col-2\\\" class=\\\"buttons\\\">\\n        <button nz-button type=\\\"button\\\" nzType=\\\"primary\\\" (click)=\\\"filterData()\\\">\\n          <i nz-icon nzType=\\\"search\\\"></i>\\n          Filtrar\\n        </button>\\n      </div>\\n    </div>\\n  </form>\\n</div>\\n<nz-table\\n  #listingTable\\n  [nzLoading]=\\\"loading\\\"\\n  [nzData]=\\\"data\\\"\\n  nzSize=\\\"small\\\"\\n  nzShowTotal=\\\"true\\\"\\n  nzFrontPagination=\\\"false\\\"\\n>\\n  <thead (nzSortChange)=\\\"onSortChange($event)\\\">\\n    <tr>\\n      <th nzShowExpand></th>\\n      <th nzShowSort nzSortKey=\\\"updatedAt\\\">Última atualização</th>\\n      <th nzShowSort nzSortKey=\\\"name\\\">Nome</th>\\n      <th nzShowSort nzSortKey=\\\"name\\\">E-mail</th>\\n      <th>CPF</th>\\n      <th>Status</th>\\n      <th></th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-ut let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <tr>\\n        <td nzShowExpand [(nzExpand)]=\\\"ut.expand\\\"></td>\\n        <td>{{ ut.updatedAt | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n        <td>{{ ut[(ut.user?.userType)]?.name }}</td>\\n        <td>{{ ut.user?.email }}</td>\\n        <td>{{ ut[(ut.user?.userType)]?.cpf | formattedCpf }}</td>\\n        <td>{{ ut.statusText }}</td>\\n        <td>\\n          <button\\n            *ngIf=\\\"ut.status !== 'enabled'\\\"\\n            title=\\\"Habilitar\\\"\\n            class=\\\"btn\\\"\\n            (click)=\\\"enableUser(ut.userId)\\\"\\n          >\\n            <span><i class=\\\"fa fa-check\\\"></i></span>\\n          </button>\\n          <button\\n            *ngIf=\\\"ut.status === 'enabled'\\\"\\n            title=\\\"Desabilitar\\\"\\n            class=\\\"btn\\\"\\n            (click)=\\\"disableUser(ut.userId)\\\"\\n          >\\n            <span><i class=\\\"fa fa-times\\\"></i></span>\\n          </button>\\n        </td>\\n      </tr>\\n      <tr [(nzExpand)]=\\\"ut.expand\\\">\\n        <td></td>\\n        <td colspan=\\\"6\\\">\\n          <button nz-button (click)=\\\"downloadDocument(ut)\\\">Baixar documento</button>\\n          <div class=\\\"mt-2\\\">\\n            Adesão:\\n            <pre>{{ ut.subscription.response | json }}</pre>\\n            Subconta:\\n            <pre>{{ ut.subaccount.response | json }}</pre>\\n          </div>\\n        </td>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","export default \".info-bottom {\\n  font-size: 0.76rem;\\n}\\n\\n.break-line {\\n  white-space: pre-wrap;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.filter-form form {\\n  margin-bottom: 20px;\\n}\\n\\n.filter-form form .cpf-area {\\n  display: flex;\\n  flex-direction: column;\\n  justify-content: space-between;\\n}\\n\\n.filter-form form .cpf-area button {\\n  width: 20%;\\n}\\n\\n.filter-form form .cpf-area .btn-area {\\n  display: flex;\\n  justify-content: center;\\n}\\n\\nimg {\\n  width: 15px;\\n}\\n\\n.btn-area-pharmacy {\\n  display: flex;\\n  justify-content: center;\\n  margin-top: 25px;\\n}\\n\\n.btn-edit {\\n  background: none;\\n  border: none;\\n}\\n\\n.filter-form {\\n  margin-bottom: 40px;\\n}\\n\\n.buttons {\\n  padding-top: 33px;\\n}\\n\\n.buttons button {\\n  margin-right: 15px;\\n}\\n\\npre {\\n  white-space: pre-wrap;\\n  /* Since CSS 2.1 */\\n  white-space: -moz-pre-wrap;\\n  /* Mozilla, since 1999 */\\n  white-space: -pre-wrap;\\n  /* Opera 4-6 */\\n  white-space: -o-pre-wrap;\\n  /* Opera 7 */\\n  word-wrap: break-word;\\n  /* Internet Explorer 5.5+ */\\n}\";","export default \"<h2 class=\\\"title\\\">Sugestão de Protocolos</h2>\\n<br />\\n<form nz-form [formGroup]=\\\"form\\\">\\n  <div class=\\\"row\\\">\\n    <div class=\\\"col-10\\\">\\n      <nz-form-item>\\n        <nz-form-control>\\n          <app-input-file\\n            accept=\\\".csv,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\\\"\\n            textButton=\\\"Selecione um arquivo .csv ou .xslx\\\"\\n            formControlName=\\\"file\\\"\\n            name=\\\"file\\\"\\n          ></app-input-file>\\n        </nz-form-control>\\n      </nz-form-item>\\n    </div>\\n    <div class=\\\"col\\\">\\n      <button nz-button nzType=\\\"primary\\\" (click)=\\\"sendFile()\\\">Enviar arquivo</button>\\n    </div>\\n  </div>\\n</form>\\n\\n<ngx-loading [show]=\\\"loading\\\" [config]=\\\"{ backdropBorderRadius: '3px' }\\\"></ngx-loading>\\n\";","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { VictaProtocolService } from '@app/modules/document/services/victa-protocol.service';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\nimport { AppToastService } from '@app/shared/services/app-toast.service';\n\n@Component({\n  selector: 'app-victa-listing',\n  templateUrl: './victa-listing.component.html',\n  styleUrls: ['./victa-listing.component.scss']\n})\nexport class VictaListingComponent implements OnInit {\n  loading: boolean;\n\n  form: FormGroup = this.fb.group({\n    file: this.fb.control('', Validators.required)\n  });\n\n  constructor(\n    private fb: FormBuilder,\n    private victaProtocolService: VictaProtocolService,\n    private notification: AppToastService\n  ) {}\n\n  ngOnInit() {}\n\n  @nativeAsync\n  async sendFile() {\n    const file: File = this.form.get('file').value;\n    if (!file) {\n      this.notification.notify('warning', 'Aviso', 'Selecionar um arquivo .csv ou .xlsx');\n    } else {\n      try {\n        this.loading = true;\n        await this.victaProtocolService.import(file);\n        this.notification.notify('success', 'Sucesso', 'Arquivo importado com sucesso');\n        this.form.reset();\n      } catch (error) {\n        console.error(error);\n      }\n      this.loading = false;\n    }\n  }\n}\n","export default \"\";","import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';\n\n@Component({\n  selector: 'app-all-logs',\n  templateUrl: './all-logs.component.html',\n  styleUrls: ['./all-logs.component.scss']\n})\nexport class AllLogsComponent implements OnInit {\n  @Input() data: any;\n  @Input() pageSize: number;\n  @Input() loading: boolean;\n  @Output() pageIndexChange = new EventEmitter<number>();\n  @Output() sortChange = new EventEmitter<number>();\n\n  scrollConfig = { x: '830px', y: '583px' };\n\n  constructor() {}\n\n  ngOnInit() {}\n}\n","export default \"<nz-table\\n  #listingTable\\n  [nzLoading]=\\\"loading\\\"\\n  nzFrontPagination=\\\"false\\\"\\n  [nzTotal]=\\\"data?.total\\\"\\n  [nzData]=\\\"data?.list\\\"\\n  [nzPageSize]=\\\"pageSize\\\"\\n  nzSize=\\\"small\\\"\\n  (nzPageIndexChange)=\\\"pageIndexChange.emit($event)\\\"\\n  [nzScroll]=\\\"scrollConfig\\\"\\n>\\n  <thead (nzSortChange)=\\\"sortChange.emit($event)\\\">\\n    <tr>\\n      <th></th>\\n      <th nzShowSort nzSortKey=\\\"date\\\">Data/hora</th>\\n      <th nzShowSort nzSortKey=\\\"code\\\">Prescrição</th>\\n      <th nzShowSort nzSortKey=\\\"format\\\">Origem</th>\\n      <th nzShowSort nzSortKey=\\\"clientIp\\\">IP</th>\\n      <th nzShowSort nzSortKey=\\\"status\\\">Status</th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-log let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <tr>\\n        <td nzShowExpand [(nzExpand)]=\\\"log.expand\\\"></td>\\n        <td>{{ log.date | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n        <td>{{ log.code }}</td>\\n        <td>{{ log.format ? 'ITI' : 'Receita Digital' }}</td>\\n        <td>{{ log.clientIp }}</td>\\n        <td>{{ log.status }} - {{ log.success ? 'Sucesso' : 'Erro' }}</td>\\n      </tr>\\n      <tr [(nzExpand)]=\\\"log.expand\\\">\\n        <td></td>\\n        <td colspan=\\\"5\\\">\\n          <div>\\n            <span class=\\\"font-weight-bold\\\">Formato de resposta:</span>\\n            {{ log.format || 'application/json' }}\\n          </div>\\n          <div class=\\\"font-weight-bold\\\">Resposta do servidor:</div>\\n          <div>\\n            <pre>{{ log.success || log.error | toJSON }}</pre>\\n          </div>\\n        </td>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n\";","export default \"\";","import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';\nimport { LogData } from '@app/shared/models/log-data';\n\n@Component({\n  selector: 'app-date-logs',\n  templateUrl: './date-logs.component.html',\n  styleUrls: ['./date-logs.component.scss']\n})\nexport class DateLogsComponent implements OnInit {\n  @Input() data: LogData;\n  @Input() loading: boolean;\n  @Output() sortChange = new EventEmitter<number>();\n\n  scrollConfig = { x: '830px', y: '583px' };\n\n  constructor() {}\n\n  ngOnInit() {}\n\n  sortInnerTable(event, date) {\n    const dateLog = this.data.list.find(item => item.date === date);\n    dateLog.logs = dateLog.logs.sort((a, b) => {\n      if (a[event.key] < b[event.key]) {\n        return event.value === 'descend' ? 1 : -1;\n      }\n      if (a[event.key] > b[event.key]) {\n        return event.value === 'descend' ? -1 : 1;\n      }\n      return 0;\n    });\n  }\n}\n","export default \"<nz-table\\n  #listingTable\\n  [nzLoading]=\\\"loading\\\"\\n  [nzTotal]=\\\"data?.list?.length\\\"\\n  [nzData]=\\\"data?.list\\\"\\n  nzSize=\\\"small\\\"\\n  nzPageSize=\\\"10\\\"\\n>\\n  <thead (nzSortChange)=\\\"sortChange.emit($event)\\\">\\n    <tr>\\n      <th></th>\\n      <th>Data</th>\\n      <th>Sucesso</th>\\n      <th>Erro</th>\\n      <th>Total</th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-dateLog let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <tr>\\n        <td nzShowExpand [(nzExpand)]=\\\"dateLog.expand\\\"></td>\\n        <td>{{ dateLog.key | date: 'dd/MM/yyyy' }}</td>\\n        <td>{{ dateLog.success }}</td>\\n        <td>{{ dateLog.error }}</td>\\n        <td>{{ dateLog.count }}</td>\\n      </tr>\\n      <tr [(nzExpand)]=\\\"dateLog.expand\\\">\\n        <td></td>\\n        <td colspan=\\\"3\\\">\\n          <nz-table\\n            #innerTable\\n            [nzTotal]=\\\"dateLog.count\\\"\\n            [nzData]=\\\"dateLog.logs\\\"\\n            [nzScroll]=\\\"scrollConfig\\\"\\n            nzShowPagination=\\\"false\\\"\\n            nzSize=\\\"small\\\"\\n          >\\n            <thead (nzSortChange)=\\\"sortInnerTable($event, dateLog.date)\\\">\\n              <tr>\\n                <th></th>\\n                <th nzShowSort nzSortKey=\\\"date\\\">Data/hora</th>\\n                <th nzShowSort nzSortKey=\\\"code\\\">Prescrição</th>\\n                <th nzShowSort nzSortKey=\\\"format\\\">Origem</th>\\n                <th nzShowSort nzSortKey=\\\"clientIp\\\">IP</th>\\n                <th nzShowSort nzSortKey=\\\"status\\\">Status</th>\\n              </tr>\\n            </thead>\\n            <tbody>\\n              <ng-template ngFor let-log let-i=\\\"index\\\" [ngForOf]=\\\"dateLog.logs\\\">\\n                <tr>\\n                  <td [nzShowExpand]=\\\"log.error\\\" [(nzExpand)]=\\\"log.expand\\\"></td>\\n                  <td>{{ log.date | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n                  <td>{{ log.code }}</td>\\n                  <td>{{ log.format ? 'ITI' : 'Receita Digital' }}</td>\\n                  <td>{{ log.clientIp }}</td>\\n                  <td>{{ log.status }} - {{ log.success ? 'Sucesso' : 'Erro' }}</td>\\n                </tr>\\n                <tr [(nzExpand)]=\\\"log.expand\\\" colspan=\\\"3\\\">\\n                  <td></td>\\n                  <td colspan=\\\"5\\\">\\n                    <div>\\n                      <span class=\\\"font-weight-bold\\\">Formato de resposta:</span>\\n                      {{ log.format || 'application/json' }}\\n                    </div>\\n                    <div class=\\\"font-weight-bold\\\">Resposta do servidor:</div>\\n                    <div>\\n                      <pre>{{ log.error | toJSON }}</pre>\\n                    </div>\\n                  </td>\\n                </tr>\\n              </ng-template>\\n            </tbody>\\n          </nz-table>\\n        </td>\\n        <td></td>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n\";","export default \"\";","export default \"<div class=\\\"filter-form\\\">\\n  <h2 class=\\\"title\\\">QR Code Logs</h2>\\n  <div [ngSwitch]=\\\"filter.groupBy\\\">\\n    <h4 *ngSwitchCase=\\\"'date'\\\">Por dia</h4>\\n    <h4 *ngSwitchCase=\\\"'month'\\\">Por mês</h4>\\n    <h4 *ngSwitchCase=\\\"'prescription'\\\">Por prescrição</h4>\\n    <h4 *ngSwitchDefault>Todos</h4>\\n  </div>\\n  <div class=\\\"row mt-2\\\">\\n    <div class=\\\"col-3\\\">\\n      <nz-form-label nzFor=\\\"initDate\\\" theme>Data início:</nz-form-label>\\n      <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.initDate\\\" name=\\\"initDate\\\" theme />\\n    </div>\\n    <div class=\\\"col-3\\\">\\n      <nz-form-label nzFor=\\\"endDate\\\" theme>Data fim:</nz-form-label>\\n      <input nz-input type=\\\"date\\\" [(ngModel)]=\\\"filter.endDate\\\" name=\\\"endDate\\\" theme />\\n    </div>\\n    <div class=\\\"col-3\\\">\\n      <nz-form-label nzFor=\\\"code\\\" theme>Código da prescrição:</nz-form-label>\\n      <input nz-input id=\\\"code\\\" name=\\\"code\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.code\\\" theme />\\n    </div>\\n    <div class=\\\"col-3\\\">\\n      <nz-form-label nzFor=\\\"code\\\" theme>IP:</nz-form-label>\\n      <input nz-input id=\\\"clientIp\\\" name=\\\"clientIp\\\" type=\\\"text\\\" [(ngModel)]=\\\"filter.clientIp\\\" theme />\\n    </div>\\n    <div class=\\\"col-3\\\">\\n      <nz-form-label nzFor=\\\"code\\\" theme>Origem: </nz-form-label>\\n      <br />\\n      <nz-select [(ngModel)]=\\\"filter.origin\\\" theme>\\n        <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\"></nz-option>\\n        <nz-option nzValue=\\\"rd\\\" nzLabel=\\\"Receita Digital\\\"></nz-option>\\n        <nz-option nzValue=\\\"iti\\\" nzLabel=\\\"ITI\\\"></nz-option>\\n      </nz-select>\\n    </div>\\n    <div class=\\\"col-3\\\">\\n      <nz-form-label nzFor=\\\"code\\\" theme>Status: </nz-form-label>\\n      <br />\\n      <nz-select [(ngModel)]=\\\"filter.status\\\" theme>\\n        <nz-option nzValue=\\\"\\\" nzLabel=\\\"Todos\\\"></nz-option>\\n        <nz-option nzValue=\\\"success\\\" nzLabel=\\\"Sucesso\\\"></nz-option>\\n        <nz-option nzValue=\\\"error\\\" nzLabel=\\\"Erro\\\"></nz-option>\\n      </nz-select>\\n    </div>\\n    <div class=\\\"col-3\\\" class=\\\"buttons\\\">\\n      <button nz-button type=\\\"button\\\" nzType=\\\"primary\\\" (click)=\\\"onFilter()\\\">\\n        <i nz-icon nzType=\\\"search\\\"></i>\\n        Filtrar\\n      </button>\\n    </div>\\n  </div>\\n</div>\\n\\n<div [ngSwitch]=\\\"filter.groupBy\\\">\\n  <app-date-logs\\n    *ngSwitchCase=\\\"'date'\\\"\\n    [data]=\\\"data\\\"\\n    [loading]=\\\"loading\\\"\\n    (sortChange)=\\\"onSortChange($event)\\\"\\n  ></app-date-logs>\\n  <app-month-logs\\n    *ngSwitchCase=\\\"'month'\\\"\\n    [data]=\\\"data\\\"\\n    [loading]=\\\"loading\\\"\\n    (sortChange)=\\\"onSortChange($event)\\\"\\n  ></app-month-logs>\\n  <app-prescription-logs\\n    *ngSwitchCase=\\\"'prescription'\\\"\\n    [data]=\\\"data\\\"\\n    [loading]=\\\"loading\\\"\\n    (sortChange)=\\\"onSortChange($event)\\\"\\n  ></app-prescription-logs>\\n  <app-all-logs\\n    *ngSwitchDefault\\n    [data]=\\\"data\\\"\\n    [pageSize]=\\\"pageSize\\\"\\n    [loading]=\\\"loading\\\"\\n    (pageIndexChange)=\\\"onPageIndexChange($event)\\\"\\n    (sortChange)=\\\"onSortChange($event)\\\"\\n  ></app-all-logs>\\n</div>\\n\";","import { ActivatedRoute } from '@angular/router';\nimport { LogsService } from './logs.service';\nimport { Component, OnInit } from '@angular/core';\n\nimport * as moment from 'moment';\nimport { nativeAsync } from '@app/shared/decorators/nativeAsync';\n\n@Component({\n  selector: 'app-logs',\n  templateUrl: './logs.component.html',\n  styleUrls: ['./logs.component.scss', '../listing/listing.component.scss']\n})\nexport class LogsComponent implements OnInit {\n  loading = false;\n  data: any;\n  pageSize = 20;\n  paginationData = { skip: 0, totalRecord: 0, orderBy: 'date', sortOrder: -1 };\n\n  filter: any = {\n    origin: '',\n    status: ''\n  };\n\n  constructor(private logsService: LogsService, private route: ActivatedRoute) {}\n\n  ngOnInit() {\n    this.route.queryParams.subscribe(p => {\n      this.data = {};\n\n      this.filter.groupBy = p.groupBy;\n      if (p.code) {\n        this.filter.code = p.code;\n        if (!p.initDate) {\n          delete this.filter.initDate;\n        }\n      }\n\n      if (p.endDate) {\n        this.filter.endDate = moment(p.endDate).format('YYYY-MM-DD');\n      } else {\n        delete this.filter.endDate;\n      }\n\n      if (p.initDate) {\n        this.filter.initDate = moment(p.initDate).format('YYYY-MM-DD');\n        if (!p.endDate && /^\\d{4}-\\d{2}$/.test(p.initDate)) {\n          this.filter.endDate = moment(p.initDate)\n            .endOf('month')\n            .format('YYYY-MM-DD');\n        }\n      } else if (p.groupBy === 'date') {\n        this.filter.initDate = moment(new Date())\n          .subtract(7, 'days')\n          .format('YYYY-MM-DD');\n      } else if (p.groupBy === 'prescription') {\n        this.filter.initDate = moment(new Date())\n          .subtract(1, 'month')\n          .format('YYYY-MM-DD');\n      } else if (p.groupBy === 'month') {\n        this.filter.initDate = moment(new Date())\n          .subtract(1, 'year')\n          .startOf('month')\n          .format('YYYY-MM-DD');\n      }\n\n      this.getLogs();\n    });\n  }\n\n  onSortChange(params) {\n    this.paginationData.orderBy = params.value ? params.key : 'date';\n    this.paginationData.sortOrder = params.value === 'ascend' ? 1 : -1;\n    this.getLogs();\n  }\n\n  onPageIndexChange(pageIndex: number) {\n    this.paginationData.skip = this.pageSize * (pageIndex - 1);\n    this.getLogs();\n  }\n\n  onFilter() {\n    this.getLogs();\n  }\n\n  @nativeAsync\n  private async getLogs() {\n    this.loading = true;\n    const filter = this.getFilter();\n    this.data = await this.logsService.getLogsByFilter(filter).toPromise();\n    this.loading = false;\n  }\n\n  private getFilter() {\n    return {\n      ...this.filter,\n      ...this.paginationData,\n      limit: this.pageSize\n    };\n  }\n}\n","export default \".title {\\n  margin: 0;\\n}\\n\\n.filter-form {\\n  margin-bottom: 20px;\\n}\\n\\n.buttons {\\n  padding-top: 33px;\\n}\\n\\n.buttons button {\\n  margin-left: 15px;\\n  margin-right: 15px;\\n}\\n\\nnz-select {\\n  margin: 0 8px 10px 0;\\n  width: 230px;\\n}\";","import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';\nimport { LogData } from '@app/shared/models/log-data';\n\n@Component({\n  selector: 'app-month-logs',\n  templateUrl: './month-logs.component.html',\n  styleUrls: ['./month-logs.component.scss']\n})\nexport class MonthLogsComponent implements OnInit {\n  @Input() data: LogData;\n  @Input() loading: boolean;\n  @Output() sortChange = new EventEmitter<number>();\n\n  scrollConfig = { x: '830px', y: '583px' };\n\n  constructor() {}\n\n  ngOnInit() {}\n}\n","export default \"<nz-table\\n  #listingTable\\n  [nzLoading]=\\\"loading\\\"\\n  [nzTotal]=\\\"data?.list?.length\\\"\\n  [nzData]=\\\"data?.list\\\"\\n>\\n  <thead (nzSortChange)=\\\"sortChange.emit($event)\\\">\\n    <tr>\\n      <th></th>\\n      <th>Data</th>\\n      <th>Sucesso</th>\\n      <th>Erro</th>\\n      <th>Total</th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-dateLog let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n      <tr [routerLink]=\\\"['/admin/logs']\\\" [queryParams]=\\\"{ groupBy: 'date', initDate: dateLog.key }\\\">\\n        <td></td>\\n        <td>{{ dateLog.key | date: 'MM/yyyy':'GMT' }}</td>\\n        <td>{{ dateLog.success }}</td>\\n        <td>{{ dateLog.error }}</td>\\n        <td>{{ dateLog.count }}</td>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n\";","export default \"tr {\\n  cursor: pointer;\\n}\";","import { LogData } from './../../../../shared/models/log-data';\nimport { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\n\n@Component({\n  selector: 'app-prescription-logs',\n  templateUrl: './prescription-logs.component.html',\n  styleUrls: ['./prescription-logs.component.scss']\n})\nexport class PrescriptionLogsComponent implements OnInit {\n  @Input() data: LogData;\n  @Input() loading: boolean;\n  @Output() sortChange = new EventEmitter<number>();\n\n  scrollConfig = { x: '830px', y: '583px' };\n\n  constructor() {}\n\n  ngOnInit() {}\n\n  sortInnerTable(event, date) {\n    const dateLog = this.data.list.find(item => item.date === date);\n    dateLog.logs = dateLog.logs.sort((a, b) => {\n      if (a[event.key] < b[event.key]) {\n        return event.value === 'descend' ? 1 : -1;\n      }\n      if (a[event.key] > b[event.key]) {\n        return event.value === 'descend' ? -1 : 1;\n      }\n      return 0;\n    });\n  }\n}\n","export default \"<nz-table\\n  #listingTable\\n  [nzLoading]=\\\"loading\\\"\\n  [nzShowPagination]=\\\"false\\\"\\n  [nzTotal]=\\\"data?.total\\\"\\n  [nzData]=\\\"data?.list\\\"\\n  nzSize=\\\"small\\\"\\n>\\n  <thead (nzSortChange)=\\\"sortChange.emit($event)\\\">\\n    <tr>\\n      <th></th>\\n      <th>Prescrição</th>\\n      <th>Sucesso</th>\\n      <th>Erro</th>\\n      <th>Total</th>\\n    </tr>\\n  </thead>\\n\\n  <tbody>\\n    <ng-template ngFor let-dateLog let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n        <tr [routerLink]=\\\"['/admin/logs']\\\" [queryParams]=\\\"{ code: dateLog.key }\\\">\\n          <td nzShowExpand [(nzExpand)]=\\\"dateLog.expand\\\"></td>\\n        <td>{{ dateLog.key }}</td>\\n        <td>{{ dateLog.success }}</td>\\n        <td>{{ dateLog.error }}</td>\\n        <td>{{ dateLog.count }}</td>\\n      </tr>\\n      <tr [(nzExpand)]=\\\"dateLog.expand\\\">\\n        <td></td>\\n        <td colspan=\\\"3\\\">\\n          <nz-table\\n            #innerTable\\n            [nzData]=\\\"dateLog.logs\\\"\\n            [nzScroll]=\\\"scrollConfig\\\"\\n            [nzShowPagination]=\\\"false\\\"\\n            nzSize=\\\"small\\\"\\n          >\\n            <thead (nzSortChange)=\\\"sortInnerTable($event, dateLog.date)\\\">\\n              <tr>\\n                <th></th>\\n                <th nzShowSort nzSortKey=\\\"date\\\">Data/hora</th>\\n                <th nzShowSort nzSortKey=\\\"code\\\">Prescrição</th>\\n                <th nzShowSort nzSortKey=\\\"format\\\">Origem</th>\\n                <th nzShowSort nzSortKey=\\\"clientIp\\\">IP</th>\\n                <th nzShowSort nzSortKey=\\\"status\\\">Status</th>\\n              </tr>\\n            </thead>\\n            <tbody>\\n              <ng-template ngFor let-log let-i=\\\"index\\\" [ngForOf]=\\\"dateLog.logs\\\">\\n                <tr>\\n                  <td nzShowExpand [(nzExpand)]=\\\"log.expand\\\"></td>\\n                  <td>{{ log.date | date: 'dd/MM/yyyy, HH:mm' }}</td>\\n                  <td>{{ log.code }}</td>\\n                  <td>{{ log.format ? 'ITI' : 'Receita Digital' }}</td>\\n                  <td>{{ log.clientIp }}</td>\\n                  <td>{{ log.status }} - {{ log.success ? 'Sucesso' : 'Erro' }}</td>\\n                </tr>\\n                <tr [(nzExpand)]=\\\"log.expand\\\" colspan=\\\"3\\\">\\n                  <td></td>\\n                  <td colspan=\\\"5\\\">\\n                    <div>\\n                      <span class=\\\"font-weight-bold\\\">Formato de resposta:</span>\\n                      {{ log.format || 'application/json' }}\\n                    </div>\\n                    <div class=\\\"font-weight-bold\\\">Resposta do servidor:</div>\\n                    <div>\\n                      <pre>{{ log.success || log.error | toJSON }}</pre>\\n                    </div>\\n                  </td>\\n                </tr>\\n              </ng-template>\\n            </tbody>\\n          </nz-table>\\n        </td>\\n        <td></td>\\n      </tr>\\n    </ng-template>\\n  </tbody>\\n</nz-table>\\n\";","export default \"tr {\\n  cursor: pointer;\\n}\";","export default \"<app-form-filter\\n  listingType=\\\"pets\\\"\\n  (filterDataEvent)=\\\"handleSearchPaginateFilter($event)\\\"\\n  title=\\\"Pets\\\"\\n  [exportDataBtn]=\\\"false\\\"\\n></app-form-filter>\\n\\n<div class=\\\"pets-listing\\\">\\n  <nz-table\\n    #listingTable\\n    [nzLoading]=\\\"loading\\\"\\n    nzFrontPagination=\\\"false\\\"\\n    nzNoResult=\\\"Nenhum resultado encontrado\\\"\\n    [nzTotal]=\\\"data?.totalRecord\\\"\\n    [nzData]=\\\"data?.list\\\"\\n    [nzPageSize]=\\\"pagination?.limit\\\"\\n    nzSize=\\\"small\\\"\\n    (nzPageIndexChange)=\\\"pageIndexChanged($event)\\\"\\n    style=\\\"overflow-x: auto;\\\"\\n  >\\n    <thead>\\n      <tr>\\n        <th nzShowSort nzSortKey=\\\"name\\\">Nome</th>\\n        <th>Especie</th>\\n        <th>Sexo</th>\\n        <th>Responsável</th>\\n        <th></th>\\n      </tr>\\n    </thead>\\n\\n    <tbody>\\n      <ng-template ngFor let-item let-i=\\\"index\\\" [ngForOf]=\\\"listingTable.data\\\">\\n        <tr>\\n          <td style=\\\"width: 250px;\\\">{{ item?.name }}</td>\\n          <td style=\\\"width: 250px;\\\">{{ item?.species }}</td>\\n          <td style=\\\"width: 250px;\\\">{{ item?.sex | sexPetParsed }}</td>\\n          <td>\\n            <div style=\\\"display: flex; gap: 24px \\\">\\n              <div style=\\\"display: flex; flex-direction: column; width: 250px;\\\">\\n                <span><strong>Nome: </strong>{{ item?.responsible?.name }}</span>\\n                <span><strong>CPF: </strong>{{ item?.responsible?.cpf | formattedCpf }}</span>\\n              </div>\\n              <div style=\\\"display: flex; flex-direction: column;\\\">\\n                <span\\n                  ><strong>Email: </strong\\n                  >{{\\n                    item?.responsible?.user?.email || item?.responsible?.user?.emailContact || ' - '\\n                  }}</span\\n                >\\n                <span\\n                  ><strong>Telefone: </strong\\n                  >{{ item?.responsible?.cellphone ?? item?.responsible?.telephone | formattedCel }}</span\\n                >\\n              </div>\\n            </div>\\n          </td>\\n          <td colspan=\\\"2\\\">\\n            <a (click)=\\\"showModalEditData(item, i)\\\"\\n              ><img src=\\\"assets/icons/pen-solid.svg\\\" class=\\\"svg\\\" width=\\\"16px\\\" height=\\\"16px\\\"\\n            /></a>\\n          </td>\\n        </tr>\\n      </ng-template>\\n    </tbody>\\n  </nz-table>\\n</div>\\n\";","import { Component, Injector, OnInit } from '@angular/core';\nimport { PetPatient } from '@app/shared/models/pet-patient';\nimport { BaseListingComponent } from '../base-listing.component';\nimport {\n  FilterPaginate,\n  FilterSearch,\n  PetPatientService\n} from '@app/modules/patients/services/pet-patient.service';\nimport { ModalEditPetComponent } from '@app/modules/patients/pages/modal-edit-pet/modal-edit-pet.component';\nimport { BsModalService } from 'ngx-bootstrap/modal';\n\n@Component({\n  selector: 'app-pets-listing',\n  templateUrl: './pets-listing.component.html',\n  styleUrls: ['./pets-listing.component.scss']\n})\nexport class PetsListingComponent extends BaseListingComponent<PetPatient> {\n  loading = false;\n  filter: FilterSearch;\n  pagination: FilterPaginate = { page: 1, limit: 6 };\n\n  constructor(\n    public injector: Injector,\n    private petPatientService: PetPatientService,\n    private bsModalService: BsModalService\n  ) {\n    super(injector);\n  }\n\n  searchPaginate() {\n    this.loading = true;\n    this.petPatientService\n      .searchPaginate(this.getFilter())\n      .subscribe(response => {\n        this.data = response;\n      })\n      .add(() => {\n        this.loading = false;\n      });\n  }\n\n  handleSearchPaginateFilter(filter: FilterSearch) {\n    this.filter = filter;\n    this.pagination.page = 1;\n    this.searchPaginate();\n  }\n\n  pageIndexChanged(pageIndex: any) {\n    this.pagination.page = pageIndex;\n    this.searchPaginate();\n  }\n\n  showModalEditData(pet: PetPatient, index: number) {\n    const initialState = { pet, isVeterinarian: false, displayAlert: false };\n\n    const modal = this.bsModalService.show(ModalEditPetComponent, {\n      initialState,\n      class: '',\n      backdrop: 'static',\n      keyboard: false\n    });\n\n    modal.content.submit.subscribe((p: PetPatient) => {\n      this.petPatientService.update(p._id, p).subscribe(\n        () => {\n          this.notification.notify('success', 'Sucesso', 'Pet alterado com sucesso!');\n          this.data.list = this.data.list.map(item => {\n            if (item._id === p._id) {\n              return p;\n            }\n            return item;\n          });\n        },\n        err => {\n          console.error(err);\n          this.notification.notify('error', 'Aviso', 'Erro ao salvar pet');\n        }\n      );\n    });\n  }\n\n  private getFilter() {\n    return {\n      ...this.filter,\n      page: this.pagination.page,\n      limit: this.pagination.limit\n    };\n  }\n}\n","export default \"\";","import { DragDropModule } from '@angular/cdk/drag-drop';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { SharedModule } from '@app/shared';\r\nimport { ComponentsModule } from '@app/shared/components/components.module';\r\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\r\nimport { ThemeService } from 'ng2-charts';\r\nimport { ModalModule } from 'ngx-bootstrap/modal';\r\nimport { NgxLoadingModule } from 'ngx-loading';\r\nimport { NgxMaskModule } from 'ngx-mask';\r\nimport { HistoricModule } from '../historic/historic.module';\r\nimport { PrescriptionsModule } from '../prescriptions/prescriptions.module';\r\nimport { AdminRoutingModule } from './admin-routing.module';\r\nimport { FeaturesListingComponent } from './listing/features-listing/features-listing.component';\r\nimport { FormFilterComponent } from './listing/form-filter/form-filter.component';\r\nimport { HealthProfessionalListingComponent } from './listing/health-professional-listing/health-professional-listing.component';\r\nimport { ListingComponent } from './listing/listing.component';\r\nimport { MedicamentListingComponent } from './listing/medicament-listing/medicament-listing.component';\r\nimport { PatientsListingComponent } from './listing/patients-listing/patients-listing.component';\r\nimport { PharmaciesListingComponent } from './listing/pharmacies-listing/pharmacies-listing.component';\r\nimport { PharmacistsListingComponent } from './listing/pharmacists-listing/pharmacists-listing.component';\r\nimport { PrescriptionsListingComponent } from './listing/prescriptions-listing/prescriptions-listing.component';\r\nimport { RetentionsListingComponent } from './listing/retentions-listing/retentions-listing.component';\r\nimport { SpecialtiesListingComponent } from './listing/specialties-listing/specialties-listing.component';\r\nimport { TagsListingComponent } from './listing/tags-listing/tags-listing.component';\r\nimport { TelemedicinesListingComponent } from './listing/telemedicine-listing/telemedicine-listing.component';\r\nimport { VictaListingComponent } from './listing/victa-listing/victa-listing.component';\r\nimport { AllLogsComponent } from './logs/all-logs/all-logs.component';\r\nimport { DateLogsComponent } from './logs/date-logs/date-logs.component';\r\nimport { LogsComponent } from './logs/logs.component';\r\nimport { MonthLogsComponent } from './logs/month-logs/month-logs.component';\r\nimport { PrescriptionLogsComponent } from './logs/prescription-logs/prescription-logs.component';\r\nimport { ModalAddAdditionalFeatureComponent } from './modal-add-additional-feature/modal-add-additional-feature.component';\r\nimport { ModalAddMedicamentsComponent } from './modal-add-medicaments/modal-add-medicaments.component';\r\nimport { ModalAddSpecialtiesComponent } from './modal-add-specialties/modal-add-specialties.component';\r\nimport { ModalAdditionalsFeaturesComponent } from './modal-additionals-features/modal-additionals-features.component';\r\nimport { ModalFormTagComponent } from './modal-form-tag/modal-form-tag.component';\r\nimport { OverviewComponent } from './overview/overview.component';\r\nimport { PrescribersComponent } from './overview/prescribers/prescribers.component';\r\nimport { ModaFormAdminComponent } from './register/modal-form-admin/modal-form-admin.component';\r\nimport { RegisterComponent } from './register/register.component';\r\nimport { SpecialtiesComponent } from './specialties/specialties.component';\r\nimport { UnsubscribeUserComponent } from './unsubscribe-user/unsubscribe-user.component';\r\nimport { ExamsComponent } from './domains/exams/exams.component';\r\nimport { PetsListingComponent } from './listing/pets-listing/pets-listing.component';\r\nimport { SereneComponent } from './domains/serene/serene.component';\r\nimport { MedicamentsComponent } from './domains/medicaments/medicaments.component';\r\n\r\n@NgModule({\r\n  declarations: [\r\n    OverviewComponent,\r\n    ListingComponent,\r\n    RetentionsListingComponent,\r\n    PrescriptionsListingComponent,\r\n    PharmaciesListingComponent,\r\n    PatientsListingComponent,\r\n    MedicamentListingComponent,\r\n    VictaListingComponent,\r\n    RegisterComponent,\r\n    FormFilterComponent,\r\n    HealthProfessionalListingComponent,\r\n    PharmacistsListingComponent,\r\n    LogsComponent,\r\n    FeaturesListingComponent,\r\n    ModalAddAdditionalFeatureComponent,\r\n    ModalAdditionalsFeaturesComponent,\r\n    AllLogsComponent,\r\n    DateLogsComponent,\r\n    MonthLogsComponent,\r\n    PrescriptionLogsComponent,\r\n    TelemedicinesListingComponent,\r\n    TagsListingComponent,\r\n    ModalFormTagComponent,\r\n    // TagsListingComponent,\r\n    UnsubscribeUserComponent,\r\n    PrescribersComponent,\r\n    SpecialtiesComponent,\r\n    SpecialtiesListingComponent,\r\n    ModalAddSpecialtiesComponent,\r\n    ModalAddMedicamentsComponent,\r\n    ModaFormAdminComponent,\r\n    ExamsComponent,\r\n    PetsListingComponent,\r\n    SereneComponent,\r\n    MedicamentsComponent\r\n  ],\r\n  imports: [\r\n    CommonModule,\r\n    AdminRoutingModule,\r\n    SharedModule,\r\n    NgxLoadingModule,\r\n    ComponentsModule,\r\n    NzRadioModule,\r\n    DragDropModule,\r\n    HistoricModule,\r\n    PrescriptionsModule,\r\n    NgxMaskModule.forRoot(),\r\n    ModalModule.forRoot()\r\n  ],\r\n  providers: [ThemeService]\r\n})\r\nexport class AdminModule {}\r\n"]}