@ampath-kenya/ngx-openmrs-formentry 3.0.0-alpha9 → 3.0.0-ampath.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract-controls-extension/afe-control-type.d.ts +1 -1
- package/abstract-controls-extension/afe-form-array.d.ts +2 -3
- package/abstract-controls-extension/afe-form-control.d.ts +1 -1
- package/abstract-controls-extension/afe-form-group.d.ts +1 -1
- package/ampath-kenya-ngx-openmrs-formentry.d.ts +48 -74
- package/ampath-kenya-ngx-openmrs-formentry.metadata.json +1 -1
- package/bundles/ampath-kenya-ngx-openmrs-formentry.umd.js +5729 -9376
- package/bundles/ampath-kenya-ngx-openmrs-formentry.umd.js.map +1 -1
- package/bundles/ampath-kenya-ngx-openmrs-formentry.umd.min.js +1 -16
- package/bundles/ampath-kenya-ngx-openmrs-formentry.umd.min.js.map +1 -1
- package/change-tracking/control-relation.d.ts +4 -4
- package/change-tracking/control-relations.d.ts +3 -3
- package/components/check-box/checkbox.component.d.ts +1 -2
- package/components/date-time-picker/date-time-picker.component.d.ts +1 -2
- package/components/date-time-picker/date-time-picker.module.d.ts +0 -3
- package/components/file-upload/file-upload.component.d.ts +25 -0
- package/components/file-upload/file-upload.module.d.ts +2 -0
- package/components/file-upload/secure.pipe.d.ts +5 -5
- package/components/ngx-date-time-picker/ngx-date-time-picker.component.d.ts +52 -0
- package/components/{ngx-datetime-picker/ngx-datetime-picker.module.d.ts → ngx-date-time-picker/ngx-date-time-picker.module.d.ts} +0 -3
- package/components/ngx-time-picker/ngx-time-picker.component.d.ts +13 -0
- package/components/ngx-time-picker/ngx-time-picker.module.d.ts +2 -0
- package/components/{ngx-remote-select/ngx-remote-select.component.d.ts → remote-select/remote-select.component.d.ts} +8 -12
- package/components/remote-select/remote-select.module.d.ts +2 -0
- package/components/select/diacritics.d.ts +844 -0
- package/components/select/option-list.d.ts +36 -0
- package/components/select/option.d.ts +17 -0
- package/components/select/select-dropdown.component.d.ts +40 -0
- package/components/select/select-dropdown.component.style.d.ts +1 -0
- package/components/select/select.component.d.ts +96 -108
- package/components/select/select.component.style.d.ts +1 -0
- package/encounter-viewer/display-controls/file-preview.component.d.ts +25 -0
- package/encounter-viewer/display-controls/question-control.component.d.ts +15 -0
- package/encounter-viewer/display-controls/remote-answer.component.d.ts +17 -0
- package/encounter-viewer/encounter-container/encounter-container.component.d.ts +15 -0
- package/encounter-viewer/encounter-pdf-viewer.service.d.ts +27 -0
- package/encounter-viewer/encounter-view/encounter-viewer.component.d.ts +30 -0
- package/encounter-viewer/encounter-viewer.module.d.ts +2 -0
- package/encounter-viewer/encounter-viewer.service.d.ts +16 -0
- package/esm2015/abstract-controls-extension/afe-control-type.js +2 -1
- package/esm2015/abstract-controls-extension/afe-form-array.js +2 -1
- package/esm2015/abstract-controls-extension/afe-form-control.js +2 -1
- package/esm2015/abstract-controls-extension/afe-form-group.js +2 -1
- package/esm2015/abstract-controls-extension/control-extensions.js +2 -1
- package/esm2015/abstract-controls-extension/index.js +2 -1
- package/esm2015/abstract-controls-extension/value-change.listener.js +2 -2
- package/esm2015/ampath-kenya-ngx-openmrs-formentry.js +40 -65
- package/esm2015/change-tracking/control-relation.js +2 -1
- package/esm2015/change-tracking/control-relations.js +2 -1
- package/esm2015/components/afe-ng-select.component.js +3 -2
- package/esm2015/components/appointments-overview/appointments-overview.component.js +78 -33
- package/esm2015/components/check-box/checkbox.component.js +24 -3
- package/esm2015/components/check-box/checkbox.module.js +3 -2
- package/esm2015/components/date-time-picker/date-picker/date-picker.component.js +93 -4
- package/esm2015/components/date-time-picker/date-time-picker.component.js +109 -5
- package/esm2015/components/date-time-picker/date-time-picker.module.js +3 -2
- package/esm2015/components/date-time-picker/picker-modal/modal.component.js +13 -5
- package/esm2015/components/date-time-picker/pipes/moment.pipe.js +3 -2
- package/esm2015/components/date-time-picker/time-picker/time-picker.component.js +51 -4
- package/esm2015/components/file-upload/file-upload.component.js +130 -0
- package/esm2015/components/file-upload/file-upload.module.js +28 -0
- package/esm2015/components/file-upload/secure.pipe.js +5 -3
- package/esm2015/components/ngx-date-time-picker/ngx-date-time-picker.component.js +259 -0
- package/esm2015/components/ngx-date-time-picker/ngx-date-time-picker.module.js +43 -0
- package/esm2015/components/ngx-time-picker/ngx-time-picker.component.js +78 -0
- package/esm2015/components/ngx-time-picker/ngx-time-picker.module.js +16 -0
- package/esm2015/components/remote-select/remote-select.component.js +171 -0
- package/esm2015/components/remote-select/remote-select.module.js +18 -0
- package/esm2015/components/select/diacritics.js +856 -0
- package/esm2015/components/select/option-list.js +180 -0
- package/esm2015/components/select/option.js +30 -0
- package/esm2015/components/select/select-dropdown.component.js +162 -0
- package/esm2015/components/select/select-dropdown.component.style.js +59 -0
- package/esm2015/components/select/select.component.js +493 -216
- package/esm2015/components/select/select.component.style.js +102 -0
- package/esm2015/components/select/select.module.js +11 -24
- package/esm2015/encounter-viewer/display-controls/file-preview.component.js +111 -0
- package/esm2015/encounter-viewer/display-controls/question-control.component.js +94 -0
- package/esm2015/encounter-viewer/display-controls/remote-answer.component.js +81 -0
- package/esm2015/encounter-viewer/encounter-container/encounter-container.component.js +50 -0
- package/esm2015/encounter-viewer/encounter-pdf-viewer.service.js +437 -0
- package/esm2015/encounter-viewer/encounter-view/encounter-viewer.component.js +301 -0
- package/esm2015/encounter-viewer/encounter-viewer.module.js +36 -0
- package/esm2015/encounter-viewer/encounter-viewer.service.js +162 -0
- package/esm2015/form-entry/control-alerts/alert-helpers.js +2 -1
- package/esm2015/form-entry/control-alerts/can-generate-alert.js +2 -2
- package/esm2015/form-entry/control-calculators/can-calculate.js +2 -2
- package/esm2015/form-entry/control-hiders-disablers/can-disable.js +2 -2
- package/esm2015/form-entry/control-hiders-disablers/can-hide.js +2 -2
- package/esm2015/form-entry/control-hiders-disablers/disabler-helper.js +2 -1
- package/esm2015/form-entry/control-hiders-disablers/hider-helpers.js +2 -1
- package/esm2015/form-entry/data-sources/data-sources.js +5 -3
- package/esm2015/form-entry/data-sources/dummy-data-source.js +2 -1
- package/esm2015/form-entry/directives/historical-value-directive.js +4 -2
- package/esm2015/form-entry/error-renderer/error-renderer.component.js +20 -4
- package/esm2015/form-entry/expression-runner/expression-runner.js +13 -16
- package/esm2015/form-entry/form-entry.module.js +29 -25
- package/esm2015/form-entry/form-factory/control-relations.factory.js +4 -2
- package/esm2015/form-entry/form-factory/form-control.service.js +4 -2
- package/esm2015/form-entry/form-factory/form-node.js +2 -4
- package/esm2015/form-entry/form-factory/form.factory.js +4 -2
- package/esm2015/form-entry/form-factory/form.js +2 -1
- package/esm2015/form-entry/form-factory/hiders-disablers.factory.js +4 -2
- package/esm2015/form-entry/form-factory/question.factory.js +158 -23
- package/esm2015/form-entry/form-factory/show-messages.factory.js +4 -2
- package/esm2015/form-entry/form-factory/validation.factory.js +4 -2
- package/esm2015/form-entry/form-renderer/form-renderer.component.css.js +8 -12
- package/esm2015/form-entry/form-renderer/form-renderer.component.js +458 -9
- package/esm2015/form-entry/helpers/historical-expression-helper-service.js +4 -2
- package/esm2015/form-entry/helpers/historical-field-helper-service.js +2 -5
- package/esm2015/form-entry/helpers/js-expression-helper.js +2 -5
- package/esm2015/form-entry/question-models/checkbox.model.js +2 -1
- package/esm2015/form-entry/question-models/conditional-validation.model.js +2 -1
- package/esm2015/form-entry/question-models/date-question.js +3 -1
- package/esm2015/form-entry/question-models/date-validation.model.js +2 -1
- package/esm2015/form-entry/question-models/decimal-point-validation.model.js +20 -0
- package/esm2015/form-entry/question-models/file-upload-question.js +2 -1
- package/esm2015/form-entry/question-models/group-question.js +2 -1
- package/esm2015/form-entry/question-models/interfaces/base-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/checkbox-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/data-source.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/date-question-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/file-upload-question-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/group-question-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/multi-select-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/nested-questions.js +2 -1
- package/esm2015/form-entry/question-models/interfaces/repeating-question-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/select-option.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/select-question-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/test-order-question-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/text-area-question-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/text-question-options.js +2 -2
- package/esm2015/form-entry/question-models/interfaces/time-question-options.js +2 -0
- package/esm2015/form-entry/question-models/interfaces/ui-select-question-options.js +2 -2
- package/esm2015/form-entry/question-models/js-expression-validation.model.js +2 -1
- package/esm2015/form-entry/question-models/max-validation.model.js +2 -1
- package/esm2015/form-entry/question-models/min-validation.model.js +2 -1
- package/esm2015/form-entry/question-models/models.js +2 -1
- package/esm2015/form-entry/question-models/multi-select-question.js +2 -1
- package/esm2015/form-entry/question-models/pair.model.js +2 -1
- package/esm2015/form-entry/question-models/question-base.js +2 -1
- package/esm2015/form-entry/question-models/rendering-type.js +2 -1
- package/esm2015/form-entry/question-models/repeating-question.js +2 -1
- package/esm2015/form-entry/question-models/select-option.js +2 -1
- package/esm2015/form-entry/question-models/select-question.js +2 -1
- package/esm2015/form-entry/question-models/test-order-question.js +2 -1
- package/esm2015/form-entry/question-models/text-area-input-question.js +2 -1
- package/esm2015/form-entry/question-models/text-input-question.js +2 -1
- package/esm2015/form-entry/question-models/time-question.js +11 -0
- package/esm2015/form-entry/question-models/ui-select-question.js +2 -1
- package/esm2015/form-entry/question-models/validation.model.js +2 -1
- package/esm2015/form-entry/services/debug-mode.service.js +4 -2
- package/esm2015/form-entry/services/form-errors.service.js +3 -2
- package/esm2015/form-entry/services/form-schema-compiler.service.js +4 -2
- package/esm2015/form-entry/services/historical-encounter-data.service.js +4 -2
- package/esm2015/form-entry/utils/messages.js +2 -1
- package/esm2015/form-entry/validators/conditional-answered.validator.js +2 -1
- package/esm2015/form-entry/validators/conditional-required.validator.js +2 -1
- package/esm2015/form-entry/validators/date.validator.js +2 -1
- package/esm2015/form-entry/validators/future-date-restriction.validator.js +2 -1
- package/esm2015/form-entry/validators/js-expression.validator.js +2 -1
- package/esm2015/form-entry/validators/max-date.validator.js +2 -1
- package/esm2015/form-entry/validators/max.validator.js +2 -1
- package/esm2015/form-entry/validators/min-date.validator.js +2 -1
- package/esm2015/form-entry/validators/min.validator.js +2 -1
- package/esm2015/form-entry/validators/required.validator.js +2 -1
- package/esm2015/form-entry/validators/validations.js +2 -1
- package/esm2015/form-entry/value-adapters/encounter.adapter.js +5 -3
- package/esm2015/form-entry/value-adapters/obs-adapter-helper.js +5 -11
- package/esm2015/form-entry/value-adapters/obs.adapter.js +5 -6
- package/esm2015/form-entry/value-adapters/order.adapter.js +3 -2
- package/esm2015/form-entry/value-adapters/person-attribute.adapter.js +8 -3
- package/esm2015/form-entry/value-adapters/value.adapter.js +2 -2
- package/esm2015/public_api.js +52 -2
- package/esm2015/shared.module.js +3 -2
- package/esm5/abstract-controls-extension/afe-control-type.js +9 -0
- package/esm5/abstract-controls-extension/afe-form-array.js +99 -0
- package/esm5/abstract-controls-extension/afe-form-control.js +97 -0
- package/esm5/abstract-controls-extension/afe-form-group.js +71 -0
- package/esm5/abstract-controls-extension/control-extensions.js +6 -0
- package/esm5/abstract-controls-extension/index.js +6 -0
- package/esm5/abstract-controls-extension/value-change.listener.js +2 -0
- package/esm5/ampath-kenya-ngx-openmrs-formentry.js +45 -0
- package/esm5/change-tracking/control-relation.js +60 -0
- package/esm5/change-tracking/control-relations.js +47 -0
- package/esm5/components/afe-ng-select.component.js +88 -0
- package/esm5/components/appointments-overview/appointments-overview.component.js +127 -0
- package/esm5/components/check-box/checkbox.component.js +89 -0
- package/esm5/components/check-box/checkbox.module.js +19 -0
- package/esm5/components/date-time-picker/date-picker/date-picker.component.js +188 -0
- package/esm5/components/date-time-picker/date-time-picker.component.js +113 -0
- package/esm5/components/date-time-picker/date-time-picker.module.js +39 -0
- package/esm5/components/date-time-picker/picker-modal/modal.component.js +34 -0
- package/esm5/components/date-time-picker/pipes/moment.pipe.js +18 -0
- package/esm5/components/date-time-picker/time-picker/time-picker.component.js +119 -0
- package/esm5/components/file-upload/file-upload.component.js +128 -0
- package/esm5/components/file-upload/file-upload.module.js +32 -0
- package/esm5/components/file-upload/secure.pipe.js +107 -0
- package/esm5/components/ngx-date-time-picker/ngx-date-time-picker.component.js +221 -0
- package/esm5/components/ngx-date-time-picker/ngx-date-time-picker.module.js +47 -0
- package/esm5/components/ngx-time-picker/ngx-time-picker.component.js +74 -0
- package/esm5/components/ngx-time-picker/ngx-time-picker.module.js +20 -0
- package/esm5/components/remote-select/remote-select.component.js +165 -0
- package/esm5/components/remote-select/remote-select.module.js +22 -0
- package/esm5/components/select/diacritics.js +861 -0
- package/esm5/components/select/option-list.js +225 -0
- package/esm5/components/select/option.js +32 -0
- package/esm5/components/select/select-dropdown.component.js +132 -0
- package/esm5/components/select/select-dropdown.component.style.js +3 -0
- package/esm5/components/select/select.component.js +457 -0
- package/esm5/components/select/select.component.style.js +3 -0
- package/esm5/components/select/select.module.js +20 -0
- package/esm5/encounter-viewer/display-controls/file-preview.component.js +111 -0
- package/esm5/encounter-viewer/display-controls/question-control.component.js +106 -0
- package/esm5/encounter-viewer/display-controls/remote-answer.component.js +88 -0
- package/esm5/encounter-viewer/encounter-container/encounter-container.component.js +47 -0
- package/esm5/encounter-viewer/encounter-pdf-viewer.service.js +523 -0
- package/esm5/encounter-viewer/encounter-view/encounter-viewer.component.js +187 -0
- package/esm5/encounter-viewer/encounter-viewer.module.js +40 -0
- package/esm5/encounter-viewer/encounter-viewer.service.js +167 -0
- package/esm5/form-entry/control-alerts/alert-helpers.js +45 -0
- package/esm5/form-entry/control-alerts/can-generate-alert.js +2 -0
- package/esm5/form-entry/control-calculators/can-calculate.js +2 -0
- package/esm5/form-entry/control-hiders-disablers/can-disable.js +2 -0
- package/esm5/form-entry/control-hiders-disablers/can-hide.js +2 -0
- package/esm5/form-entry/control-hiders-disablers/disabler-helper.js +38 -0
- package/esm5/form-entry/control-hiders-disablers/hider-helpers.js +45 -0
- package/esm5/form-entry/data-sources/data-sources.js +39 -0
- package/esm5/form-entry/data-sources/dummy-data-source.js +107 -0
- package/esm5/form-entry/directives/historical-value-directive.js +74 -0
- package/esm5/form-entry/error-renderer/error-renderer.component.js +64 -0
- package/esm5/form-entry/expression-runner/expression-runner.js +159 -0
- package/esm5/form-entry/form-entry.module.js +111 -0
- package/esm5/form-entry/form-factory/control-relations.factory.js +245 -0
- package/esm5/form-entry/form-factory/form-control.service.js +122 -0
- package/esm5/form-entry/form-factory/form-node.js +117 -0
- package/esm5/form-entry/form-factory/form.factory.js +138 -0
- package/esm5/form-entry/form-factory/form.js +214 -0
- package/esm5/form-entry/form-factory/hiders-disablers.factory.js +70 -0
- package/esm5/form-entry/form-factory/question.factory.js +980 -0
- package/esm5/form-entry/form-factory/show-messages.factory.js +34 -0
- package/esm5/form-entry/form-factory/validation.factory.js +191 -0
- package/esm5/form-entry/form-renderer/form-renderer.component.css.js +3 -0
- package/esm5/form-entry/form-renderer/form-renderer.component.js +219 -0
- package/esm5/form-entry/helpers/historical-expression-helper-service.js +43 -0
- package/esm5/form-entry/helpers/historical-field-helper-service.js +37 -0
- package/esm5/form-entry/helpers/js-expression-helper.js +243 -0
- package/esm5/form-entry/question-models/checkbox.model.js +17 -0
- package/esm5/form-entry/question-models/conditional-validation.model.js +15 -0
- package/esm5/form-entry/question-models/date-question.js +19 -0
- package/esm5/form-entry/question-models/date-validation.model.js +16 -0
- package/esm5/form-entry/question-models/decimal-point-validation.model.js +22 -0
- package/esm5/form-entry/question-models/file-upload-question.js +19 -0
- package/esm5/form-entry/question-models/group-question.js +18 -0
- package/esm5/form-entry/question-models/interfaces/base-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/checkbox-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/data-source.js +2 -0
- package/esm5/form-entry/question-models/interfaces/date-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/file-upload-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/group-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/multi-select-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/nested-questions.js +12 -0
- package/esm5/form-entry/question-models/interfaces/repeating-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/select-option.js +2 -0
- package/esm5/form-entry/question-models/interfaces/select-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/test-order-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/text-area-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/text-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/time-question-options.js +2 -0
- package/esm5/form-entry/question-models/interfaces/ui-select-question-options.js +2 -0
- package/esm5/form-entry/question-models/js-expression-validation.model.js +14 -0
- package/esm5/form-entry/question-models/max-validation.model.js +15 -0
- package/esm5/form-entry/question-models/min-validation.model.js +15 -0
- package/esm5/form-entry/question-models/models.js +13 -0
- package/esm5/form-entry/question-models/multi-select-question.js +17 -0
- package/esm5/form-entry/question-models/pair.model.js +10 -0
- package/esm5/form-entry/question-models/question-base.js +27 -0
- package/esm5/form-entry/question-models/rendering-type.js +10 -0
- package/esm5/form-entry/question-models/repeating-question.js +17 -0
- package/esm5/form-entry/question-models/select-option.js +10 -0
- package/esm5/form-entry/question-models/select-question.js +18 -0
- package/esm5/form-entry/question-models/test-order-question.js +21 -0
- package/esm5/form-entry/question-models/text-area-input-question.js +19 -0
- package/esm5/form-entry/question-models/text-input-question.js +16 -0
- package/esm5/form-entry/question-models/time-question.js +16 -0
- package/esm5/form-entry/question-models/ui-select-question.js +17 -0
- package/esm5/form-entry/question-models/validation.model.js +10 -0
- package/esm5/form-entry/services/debug-mode.service.js +26 -0
- package/esm5/form-entry/services/form-errors.service.js +21 -0
- package/esm5/form-entry/services/form-schema-compiler.service.js +254 -0
- package/esm5/form-entry/services/historical-encounter-data.service.js +180 -0
- package/esm5/form-entry/utils/messages.js +17 -0
- package/esm5/form-entry/validators/conditional-answered.validator.js +50 -0
- package/esm5/form-entry/validators/conditional-required.validator.js +44 -0
- package/esm5/form-entry/validators/date.validator.js +22 -0
- package/esm5/form-entry/validators/future-date-restriction.validator.js +25 -0
- package/esm5/form-entry/validators/js-expression.validator.js +30 -0
- package/esm5/form-entry/validators/max-date.validator.js +28 -0
- package/esm5/form-entry/validators/max.validator.js +22 -0
- package/esm5/form-entry/validators/min-date.validator.js +28 -0
- package/esm5/form-entry/validators/min.validator.js +22 -0
- package/esm5/form-entry/validators/required.validator.js +16 -0
- package/esm5/form-entry/validators/validations.js +9 -0
- package/esm5/form-entry/value-adapters/encounter.adapter.js +178 -0
- package/esm5/form-entry/value-adapters/obs-adapter-helper.js +509 -0
- package/esm5/form-entry/value-adapters/obs.adapter.js +737 -0
- package/esm5/form-entry/value-adapters/order.adapter.js +227 -0
- package/esm5/form-entry/value-adapters/person-attribute.adapter.js +96 -0
- package/esm5/form-entry/value-adapters/value.adapter.js +2 -0
- package/esm5/public_api.js +52 -0
- package/esm5/shared.module.js +20 -0
- package/fesm2015/ampath-kenya-ngx-openmrs-formentry.js +5093 -6889
- package/fesm2015/ampath-kenya-ngx-openmrs-formentry.js.map +1 -1
- package/fesm5/ampath-kenya-ngx-openmrs-formentry.js +10737 -0
- package/fesm5/ampath-kenya-ngx-openmrs-formentry.js.map +1 -0
- package/form-entry/data-sources/data-sources.d.ts +1 -1
- package/form-entry/directives/historical-value-directive.d.ts +2 -2
- package/form-entry/error-renderer/error-renderer.component.d.ts +1 -1
- package/form-entry/expression-runner/expression-runner.d.ts +6 -6
- package/form-entry/form-factory/form-control.service.d.ts +3 -3
- package/form-entry/form-factory/form-node.d.ts +9 -10
- package/form-entry/form-factory/form.d.ts +6 -7
- package/form-entry/form-factory/question.factory.d.ts +7 -1
- package/form-entry/form-factory/validation.factory.d.ts +10 -10
- package/form-entry/form-renderer/form-renderer.component.css.d.ts +1 -1
- package/form-entry/form-renderer/form-renderer.component.d.ts +4 -6
- package/form-entry/helpers/js-expression-helper.d.ts +1 -1
- package/form-entry/question-models/date-question.d.ts +2 -0
- package/form-entry/question-models/decimal-point-validation.model.d.ts +10 -0
- package/form-entry/question-models/interfaces/base-options.d.ts +1 -0
- package/form-entry/question-models/interfaces/time-question-options.d.ts +3 -0
- package/form-entry/question-models/question-base.d.ts +4 -0
- package/form-entry/question-models/rendering-type.d.ts +1 -1
- package/form-entry/question-models/time-question.d.ts +5 -0
- package/form-entry/services/form-errors.service.d.ts +2 -1
- package/form-entry/services/form-schema-compiler.service.d.ts +16 -16
- package/form-entry/services/historical-encounter-data.service.d.ts +3 -3
- package/form-entry/utils/messages.d.ts +9 -9
- package/form-entry/value-adapters/encounter.adapter.d.ts +2 -2
- package/form-entry/value-adapters/order.adapter.d.ts +9 -9
- package/form-entry/value-adapters/person-attribute.adapter.d.ts +1 -1
- package/package.json +18 -16
- package/public_api.d.ts +50 -1
- package/components/input/input.directive.d.ts +0 -28
- package/components/input/input.module.d.ts +0 -2
- package/components/input/label.component.d.ts +0 -87
- package/components/input/text-area.directive.d.ts +0 -21
- package/components/ngx-datetime-picker/ngx-datetime-picker.component.d.ts +0 -13
- package/components/ngx-pick-datetime/lib/date-time/adapter/date-time-adapter.class.d.ts +0 -189
- package/components/ngx-pick-datetime/lib/date-time/adapter/date-time-format.class.d.ts +0 -15
- package/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time-adapter.class.d.ts +0 -73
- package/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time-format.class.d.ts +0 -5
- package/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time.module.d.ts +0 -7
- package/components/ngx-pick-datetime/lib/date-time/calendar-body.component.d.ts +0 -77
- package/components/ngx-pick-datetime/lib/date-time/calendar-month-view.component.d.ts +0 -139
- package/components/ngx-pick-datetime/lib/date-time/calendar-multi-year-view.component.d.ts +0 -109
- package/components/ngx-pick-datetime/lib/date-time/calendar-year-view.component.d.ts +0 -120
- package/components/ngx-pick-datetime/lib/date-time/calendar.component.d.ts +0 -141
- package/components/ngx-pick-datetime/lib/date-time/date-time-inline.component.d.ts +0 -90
- package/components/ngx-pick-datetime/lib/date-time/date-time-picker-container.component.d.ts +0 -122
- package/components/ngx-pick-datetime/lib/date-time/date-time-picker-input.directive.d.ts +0 -152
- package/components/ngx-pick-datetime/lib/date-time/date-time-picker-intl.service.d.ts +0 -51
- package/components/ngx-pick-datetime/lib/date-time/date-time-picker-trigger.directive.d.ts +0 -21
- package/components/ngx-pick-datetime/lib/date-time/date-time-picker.animations.d.ts +0 -8
- package/components/ngx-pick-datetime/lib/date-time/date-time-picker.component.d.ts +0 -157
- package/components/ngx-pick-datetime/lib/date-time/date-time.class.d.ts +0 -86
- package/components/ngx-pick-datetime/lib/date-time/date-time.module.d.ts +0 -5
- package/components/ngx-pick-datetime/lib/date-time/numberedFixLen.pipe.d.ts +0 -7
- package/components/ngx-pick-datetime/lib/date-time/timer-box.component.d.ts +0 -35
- package/components/ngx-pick-datetime/lib/date-time/timer.component.d.ts +0 -129
- package/components/ngx-pick-datetime/lib/dialog/dialog-config.class.d.ts +0 -93
- package/components/ngx-pick-datetime/lib/dialog/dialog-container.component.d.ts +0 -56
- package/components/ngx-pick-datetime/lib/dialog/dialog-ref.class.d.ts +0 -49
- package/components/ngx-pick-datetime/lib/dialog/dialog.module.d.ts +0 -5
- package/components/ngx-pick-datetime/lib/dialog/dialog.service.d.ts +0 -70
- package/components/ngx-pick-datetime/lib/utils/index.d.ts +0 -4
- package/components/ngx-pick-datetime/lib/utils/object.utils.d.ts +0 -11
- package/components/ngx-remote-select/ngx-remote-select.module.d.ts +0 -2
- package/components/ngx-tabset/components/tab-set.d.ts +0 -15
- package/components/ngx-tabset/components/tab.d.ts +0 -10
- package/components/ngx-tabset/directives/hover-class.directive.d.ts +0 -8
- package/components/ngx-tabset/modules/ngx-tabset.module.d.ts +0 -11
- package/components/number-input/number-input.component.d.ts +0 -148
- package/components/number-input/number-input.module.d.ts +0 -2
- package/components/select/optgroup.directive.d.ts +0 -3
- package/components/select/option.directive.d.ts +0 -3
- package/esm2015/components/input/input.directive.js +0 -55
- package/esm2015/components/input/input.module.js +0 -29
- package/esm2015/components/input/label.component.js +0 -139
- package/esm2015/components/input/text-area.directive.js +0 -40
- package/esm2015/components/ngx-datetime-picker/ngx-datetime-picker.component.js +0 -52
- package/esm2015/components/ngx-datetime-picker/ngx-datetime-picker.module.js +0 -28
- package/esm2015/components/ngx-pick-datetime/lib/date-time/adapter/date-time-adapter.class.js +0 -115
- package/esm2015/components/ngx-pick-datetime/lib/date-time/adapter/date-time-format.class.js +0 -7
- package/esm2015/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time-adapter.class.js +0 -346
- package/esm2015/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time-format.class.js +0 -10
- package/esm2015/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time.module.js +0 -30
- package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar-body.component.js +0 -149
- package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar-month-view.component.js +0 -432
- package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar-multi-year-view.component.js +0 -353
- package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar-year-view.component.js +0 -362
- package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar.component.js +0 -337
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-inline.component.js +0 -252
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-container.component.js +0 -379
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-input.directive.js +0 -601
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-intl.service.js +0 -60
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-trigger.directive.js +0 -69
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker.animations.js +0 -21
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker.component.js +0 -515
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time.class.js +0 -154
- package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time.module.js +0 -63
- package/esm2015/components/ngx-pick-datetime/lib/date-time/numberedFixLen.pipe.js +0 -24
- package/esm2015/components/ngx-pick-datetime/lib/date-time/timer-box.component.js +0 -83
- package/esm2015/components/ngx-pick-datetime/lib/date-time/timer.component.js +0 -293
- package/esm2015/components/ngx-pick-datetime/lib/dialog/dialog-config.class.js +0 -56
- package/esm2015/components/ngx-pick-datetime/lib/dialog/dialog-container.component.js +0 -208
- package/esm2015/components/ngx-pick-datetime/lib/dialog/dialog-ref.class.js +0 -113
- package/esm2015/components/ngx-pick-datetime/lib/dialog/dialog.module.js +0 -29
- package/esm2015/components/ngx-pick-datetime/lib/dialog/dialog.service.js +0 -228
- package/esm2015/components/ngx-pick-datetime/lib/utils/index.js +0 -5
- package/esm2015/components/ngx-pick-datetime/lib/utils/object.utils.js +0 -26
- package/esm2015/components/ngx-remote-select/ngx-remote-select.component.js +0 -119
- package/esm2015/components/ngx-remote-select/ngx-remote-select.module.js +0 -18
- package/esm2015/components/ngx-tabset/components/tab-set.js +0 -67
- package/esm2015/components/ngx-tabset/components/tab.js +0 -38
- package/esm2015/components/ngx-tabset/directives/hover-class.directive.js +0 -26
- package/esm2015/components/ngx-tabset/modules/ngx-tabset.module.js +0 -40
- package/esm2015/components/number-input/number-input.component.js +0 -203
- package/esm2015/components/number-input/number-input.module.js +0 -15
- package/esm2015/components/select/optgroup.directive.js +0 -17
- package/esm2015/components/select/option.directive.js +0 -17
- package/esm2015/form-entry/directives/collapse-animations.js +0 -11
- package/esm2015/form-entry/directives/collapse.directive.js +0 -157
- package/esm2015/form-entry/pipes/time-ago.pipe.js +0 -107
- package/esm2015/lib/index.js +0 -49
- package/form-entry/directives/collapse-animations.d.ts +0 -4
- package/form-entry/directives/collapse.directive.d.ts +0 -42
- package/form-entry/pipes/time-ago.pipe.d.ts +0 -11
- package/lib/index.d.ts +0 -49
- package/styles/ngx-formentry.css +0 -317
- package/styles/picker.min.css +0 -1
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("rxjs"),require("moment"),require("lodash"),require("@angular/animations"),require("@ng-select/ng-select"),require("@angular/cdk/a11y"),require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/cdk/keycodes"),require("@angular/cdk/coercion"),require("rxjs/operators"),require("@angular/cdk/platform"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@ampath-kenya/ngx-openmrs-formentry",["exports","@angular/core","@angular/common","@angular/forms","rxjs","moment","lodash","@angular/animations","@ng-select/ng-select","@angular/cdk/a11y","@angular/cdk/overlay","@angular/cdk/portal","@angular/cdk/keycodes","@angular/cdk/coercion","rxjs/operators","@angular/cdk/platform","@angular/platform-browser"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["ampath-kenya"]=e["ampath-kenya"]||{},e["ampath-kenya"]["ngx-openmrs-formentry"]={}),e.ng.core,e.ng.common,e.ng.forms,e.rxjs,e.moment_,e._,e.ng.animations,e.ngSelect,e.ng.cdk.a11y,e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.cdk.keycodes,e.ng.cdk.coercion,e.rxjs.operators,e.ng.cdk.platform,e.ng.platformBrowser)}(this,(function(e,t,n,r,i,o,a,s,l,c,u,p,d,h,f,m,y){"use strict";function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var b=g(o),v=function(){function e(){this.cookieKey="formDebug"}return e.prototype.debugEnabled=function(){return!1},e}();v.decorators=[{type:t.Injectable}],v.ctorParameters=function(){return[]};var w=function(){function e(e,t){this.changeDetectorRef=e,this.ngZone=t}return e.prototype.transform=function(e){var t=this;this.removeTimer();var n=new Date(e),r=new Date,i=Math.round(Math.abs((r.getTime()-n.getTime())/1e3)),o=Number.isNaN(i)?1e3:1e3*this.getSecondsUntilUpdate(i);this.timer=this.ngZone.runOutsideAngular((function(){return"undefined"!=typeof window?window.setTimeout((function(){t.ngZone.run((function(){return t.changeDetectorRef.markForCheck()}))}),o):null}));var a=Math.round(Math.abs(i/60)),s=Math.round(Math.abs(a/60)),l=Math.round(Math.abs(s/24)),c=Math.round(Math.abs(l/30.416)),u=Math.round(Math.abs(l/365));return Number.isNaN(i)?"":i<=45?"a few seconds ago":i<=90?"a minute ago":a<=45?a+" minutes ago":a<=90?"an hour ago":s<=22?s+" hours ago":s<=36?"a day ago":l<=25?l+" days ago":l<=45?"a month ago":l<=345?c+" months ago":l<=545?"a year ago":u+" years ago"},e.prototype.ngOnDestroy=function(){this.removeTimer()},e.prototype.removeTimer=function(){this.timer&&(window.clearTimeout(this.timer),this.timer=null)},e.prototype.getSecondsUntilUpdate=function(e){return e<60?2:e<3600?30:e<86400?300:3600},e}();w.decorators=[{type:t.Pipe,args:[{name:"timeAgo",pure:!1}]}],w.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:t.NgZone}]};var x=function(){function e(){this.announceErrorFieldSource=new i.Subject,this.announceErrorField$=this.announceErrorFieldSource.asObservable()}return e.prototype.announceErrorField=function(e){this.announceErrorFieldSource.next(e)},e}();x.control=null,x.tab=null,x.decorators=[{type:t.Injectable}];
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var k=function(e,t){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function C(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}k(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function T(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function O(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function M(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(D(arguments[t]));return e}Object.create;var A=function(){function e(e,t){this._control=e,this._relatedTo=t,this._registerForChangesFromRelatedControl()}return Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relatedTo",{get:function(){return this._relatedTo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastUpdateValue",{get:function(){return this._lastUpdateValue},enumerable:!1,configurable:!0}),e.prototype.updateControlBasedOnRelation=function(e){return e!==this._lastUpdateValue&&(this._lastUpdateValue=e,this._control.updateCalculatedValue&&this._control.updateCalculatedValue(),this._control.updateValueAndValidity(),this._control.updateHiddenState&&this._control.updateHiddenState(),this._control.updateDisabledState&&this._control.updateDisabledState(),this._control.updateAlert&&this._control.updateAlert(),!0)},e.prototype._registerForChangesFromRelatedControl=function(){var e=this;this._relatedTo.valueChanges.subscribe((function(t){e.updateControlBasedOnRelation(t)}))},e}(),S=function(){function e(e,t){this._otherRelations=[],this._relationFor=e,this._relations=[],t&&this.addRelatedControls(t)}return Object.defineProperty(e.prototype,"relationsFor",{get:function(){return this._relationFor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relations",{get:function(){return this._relations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"otherRelations",{get:function(){return this._otherRelations},enumerable:!1,configurable:!0}),e.prototype.addRelatedControls=function(e){if(e instanceof r.AbstractControl&&this.relations.push(new A(this._relationFor,e)),e instanceof Array)for(var t=0;t<e.length;t++)this.relations.push(new A(this._relationFor,e[t]))},e}(),_=function(){function e(){}return e.prototype.hideControl=function(e){e.hidden=!0,e.disable&&e.disable()},e.prototype.showControl=function(e){e.hidden=!1},e.prototype.setHiderForControl=function(e,t){e.hiders.push(t)},e.prototype.clearHidersForControl=function(e){e.hiders.splice(0),e.hidden=!1},e.prototype.evaluateControlHiders=function(e){var t=!1;e.hiders.forEach((function(e){e.reEvaluateHidingExpression(),!0===e.toHide&&(t=!0)})),e.hidden=t,e.hidden&&e.disable&&e.disable()},e.prototype.setUpReEvaluationWhenValueChanges=function(e){e.updateHiddenState&&e.valueChanges.subscribe((function(t){e.updateHiddenState()}))},e}(),I=function(){function e(){}return e.prototype.hideAlert=function(e){e.shown=!1},e.prototype.showAlert=function(e){e.shown=!0},e.prototype.setAlertsForControl=function(e,t){e.alerts.push(t)},e.prototype.clearAlertsForControl=function(e){e.alerts.splice(0),e.alert=""},e.prototype.evaluateControlAlerts=function(e){var t="";e.alerts.forEach((function(e){e.reEvaluateAlertExpression(),t=!0===e.shown?e.alertMessage:""})),e.alert=t},e.prototype.setUpReEvaluationWhenValueChanges=function(e){e.updateAlert&&e.valueChanges.subscribe((function(t){e.updateAlert()}))},e}(),P=function(){function e(){}return e.prototype.setDisablerForControl=function(e,t){e.disablers.push(t)},e.prototype.clearDisablersForControl=function(e){e.disablers.splice(0),e.disable()},e.prototype.evaluateControlDisablers=function(e){var t=!1;e.disablers.forEach((function(e){e.reEvaluateDisablingExpression(),!0===e.toDisable&&(t=!0)})),t?e.disable():e.enable()},e.prototype.setUpReEvaluationWhenValueChanges=function(e){e.updateDisabledState&&e.valueChanges.subscribe((function(t){e.updateDisabledState()}))},e}(),E=function(){function e(e,t,n,r){this._control=t,this._questionModel=e,this._form=n,this._path=r?r+"."+e.key:e.key}return Object.defineProperty(e.prototype,"question",{get:function(){return this._questionModel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"form",{get:function(){return this._form},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._path},enumerable:!1,configurable:!0}),e.prototype.removeAt=function(e){},e.prototype.createChildNode=function(){},e.prototype.removeChildNode=function(){},e}(),V=function(e){function t(t,n,r,i,o){return e.call(this,t,n,i,o)||this}return C(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return null},enumerable:!1,configurable:!0}),t}(E),q=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,i,o)||this;return a._children={},a}return C(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),t.prototype.setChild=function(e,t){this.children[e]=t},t}(E),F=function(e){function t(t,n,r,i,o,a){var s=e.call(this,t,n,o,a)||this;return s.formFactory=i,s.childNodeCreatedEvents=[],s._children=[],s.childNodeCreatedEvents=[],s}return C(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),t.prototype.createChildNode=function(){if(this.createChildFunc){var e=this.createChildFunc(this.question,this,this.formFactory);return this.fireChildNodeCreatedListener(e),e}return null},t.prototype.removeAt=function(e){confirm("Are you sure you want to remove?")&&this.removeChildFunc&&this.removeChildFunc(e,this)},t.prototype.addChildNodeCreatedListener=function(e){this.childNodeCreatedEvents.push(e)},t.prototype.fireChildNodeCreatedListener=function(e){for(var t=0;t<this.childNodeCreatedEvents.length;t++){(0,this.childNodeCreatedEvents[t])(e)}},t}(E),j=function(e){this.type=e.type,this.message=e.message||null},R=function(e){function t(t){var n=e.call(this,t)||this;return n.failsWhenExpression=t.failsWhenExpression,n}return C(t,e),t}(j),N=function(e){function t(t){var n=e.call(this,t)||this;return n.referenceQuestionId=t.referenceQuestionId,n.referenceQuestionAnswers=t.referenceQuestionAnswers,n}return C(t,e),t}(j),H=function(){function e(){}return e.prototype.buildRelations=function(e){var t=this.mapControlIds(e,{});for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];this.setRelations(t,r)}},e.prototype.buildArrayNodeRelations=function(e){var t=e.form;if(t){var n=t.rootNode;this.buildRelations(e);var r=this.mapControlIds(n,{}),i=this.mapControlIds(e,{});for(var o in r){if(r.hasOwnProperty(o))if((l=r[o])instanceof V){var a=l.question;a.key&&a.key.length>0&&this.setRelations(i,l)}}for(var s in this.createRelationsToArrayControls(e),i)if(i.hasOwnProperty(s)){var l,c=(l=i[s]).control;c.updateHiddenState(),c.updateAlert()}}},e.prototype.createRelationsToArrayControls=function(e){var t=e.form.rootNode,n=this.mapControlIds(t,{}),r=this.mapControlIds(e,{});for(var i in n)if(n.hasOwnProperty(i)){var o=n[i],a=e.path.substring(0,e.path.lastIndexOf("."));if(-1===o.path.indexOf(a+".")){var s=function(n){if(r.hasOwnProperty(n)){var i=r[n],s=i.question.key;if(l.hasRelation(s,o.question)){var c=e.form.searchNodeByPath(t,a,[]);if(c.length>0){var u=c[0],p=o.control;-1===p.controlRelations.otherRelations.indexOf(u)&&p.controlRelations.otherRelations.push(u),i.control.addValueChangeListener((function(e){p.updateCalculatedValue&&p.updateCalculatedValue(),p.updateValueAndValidity(),p.updateHiddenState&&p.updateHiddenState(),p.updateAlert&&p.updateAlert(),p.updateDisabledState&&p.updateDisabledState()}))}}}},l=this;for(var c in r)s(c)}}},e.prototype.getRelationsForControl=function(e,t){var n=new Array,r=t.form.searchNodeByQuestionId(e);if(r.length>0){var i=r[0],o=this.mapControlIds(t,{});for(var a in o)o.hasOwnProperty(a)&&this.hasRelation(o[a].question.key,i.question)&&n.push(o[a].control)}return n},e.prototype.mapControlIds=function(e,t){var n=e.children;for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];if(i instanceof q)this.mapControlIds(i,t);else if(i instanceof V){(o=i.question).key&&o.key.length>0&&(t[o.key]=i)}else if(i instanceof F){var o;(o=i.question).key&&o.key.length>0&&(t[o.key]=i)}}return t},e.prototype.setRelations=function(e,t){var n=t.question.key;for(var r in e)if(e.hasOwnProperty(r)&&r!==n){var i=e[r],o=i.question;if(this.hasRelation(n,o,t)&&this.addRelationToControl(i.control,t.control),"object"==typeof o.required){var a=o.required;"conditionalRequired"===a.type&&a.referenceQuestionId===n&&this.addRelationToControl(i.control,t.control)}}},e.prototype.hasRelation=function(e,t,n){var r=!1;if(t.validators&&t.validators.length>0&&t.validators.forEach((function(t){if(t instanceof R){var n=t.failsWhenExpression;n&&-1!==n.indexOf(e)&&(r=!0)}else t instanceof N&&"conditionalAnswered"===t.type&&t.referenceQuestionId===e&&(r=!0)})),!r){if("string"==typeof t.hide){var i=t.hide;i.length>0&&-1!==i.indexOf(e)&&(r=!0)}else if("object"==typeof t.hide){t.hide.field===e&&(r=!0)}if(t.alert&&"object"==typeof t.alert&&(r=!0),"string"==typeof t.disable){var o=t.disable;o.length>0&&-1!==o.indexOf(e)&&(r=!0)}}return!r&&t.calculateExpression&&t.calculateExpression.length>0&&-1!==t.calculateExpression.indexOf(e)&&(r=!0),r},e.prototype.addRelationToControl=function(e,t){e.controlRelations.addRelatedControls(t)},e}();H.decorators=[{type:t.Injectable}],H.ctorParameters=function(){return[]};var L=b,Y=function(){function e(){}return e.prototype.getRunnable=function(e,t,n,r,i){var o=this,a=this;return{run:function(){var s={};t.uuid&&(s[t.uuid]=t.value),window.moment=L,s.myValue=t.value,a.getControlRelationValueString(t,s),a.getHelperMethods(n,s),a.getDataDependencies(r,s),i&&a.getDataDependencies(i.dataSourcesContainer.dataSources,s);var l="",c="";for(var u in s)l=""===l?l+u:l+","+u,c=""===c?c+"scope['"+u+"']":c+",scope['"+u+"']";-1===e.indexOf("return")&&(e="return "+e);var p=new Function(l,e);s[Symbol.iterator]=function(){var e,t,n;return T(this,(function(r){switch(r.label){case 0:for(t in e=[],this)e.push(t);n=0,r.label=1;case 1:return n<e.length?[4,this[e[n]]]:[3,4];case 2:r.sent(),r.label=3;case 3:return n++,[3,1];case 4:return[2]}}))};try{return Object.keys(s).indexOf("undefined")>=0?(console.warn("Missing reference found",e,s),!1):p.call.apply(p,M([o],s))}catch(e){return!1}}}},e.prototype.getControlRelationValueString=function(e,t){var n=this;e&&e.controlRelations&&e.controlRelations.relations&&e.controlRelations.relations.forEach((function(e){if(e.relatedTo){var n=e.relatedTo,r=e.relatedTo;r&&Array.isArray(r.value)?t[n.uuid]=e.relatedTo.value:t[n.uuid]=e.relatedTo.value&&e.relatedTo.value.value?e.relatedTo.value.value:e.relatedTo.value}})),e&&e.controlRelations&&e.controlRelations.otherRelations&&e.controlRelations.otherRelations.length>0&&e.controlRelations.otherRelations.forEach((function(r){if(r instanceof F){var i=r,o=e.uuid,a=new H,s=[];i.children.forEach((function(e){s=s.concat(a.getRelationsForControl(o,e))})),n.setControlArrayValues(e,s,t)}}))},e.prototype.setControlArrayValues=function(e,t,n){var r=this;this._getFormControlKeys(t).forEach((function(e){var i=r._getValuesForKey(e,t);n[e]=i}))},e.prototype._getFormControlKeys=function(e){var t=[];return e.forEach((function(e){-1===t.indexOf(e.uuid)&&t.push(e.uuid)})),t},e.prototype._getValuesForKey=function(e,t){var n=[];return t.forEach((function(t){t.uuid===e&&n.push(t.value)})),n},e.prototype.getHelperMethods=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},e.prototype.getDataDependencies=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},e}();Y.decorators=[{type:t.Injectable}];var B,Q=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.hidden=!1,i.hiderHelper=new _,i.disablerHelper=new P,i.AlertHelper=new I,i._controlRelations=new S(i),i.hiders=[],i.disablers=[],i.alerts=[],i.valueChanges.subscribe((function(e){i._previousValue!==e&&(i.fireValueChangeListener(e),i._previousValue=e)})),i}return C(t,e),Object.defineProperty(t.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!1,configurable:!0}),t.prototype.disable=function(t){e.prototype.disable.call(this,t),e.prototype.setValue.call(this,"")},t.prototype.hide=function(){this.hiderHelper.hideControl(this)},t.prototype.show=function(){this.hiderHelper.showControl(this)},t.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},t.prototype.setCalculatorFn=function(e){this.calculator=e},t.prototype.updateCalculatedValue=function(){if(this.calculator){var e=this.calculator.call(Y,{});this.setValue(e)}},t.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},t.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},t.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},t.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},t.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},t.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},t.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},t.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},t.prototype.addValueChangeListener=function(e){this._valueChangeListener=e},t.prototype.fireValueChangeListener=function(e){this._valueChangeListener&&"function"==typeof this._valueChangeListener&&this._valueChangeListener(e)},t.prototype.setValue=function(t){e.prototype.setValue.call(this,t)},t}(r.FormControl),G=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.hiderHelper=new _,i.disablerHelper=new P,i.AlertHelper=new I,i._controlRelations=new S(i),i.hiders=[],i.disablers=[],i.alerts=[],i}return C(t,e),Object.defineProperty(t.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!1,configurable:!0}),t.prototype.hide=function(){this.hiderHelper.hideControl(this)},t.prototype.show=function(){this.hiderHelper.showControl(this)},t.prototype.disable=function(t){e.prototype.disable.call(this,t),e.prototype.setValue.call(this,{})},t.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},t.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},t.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},t.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},t.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},t.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},t.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},t.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},t.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},t.prototype.setValue=function(t){e.prototype.setValue.call(this,t)},t}(r.FormGroup),z=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.hiderHelper=new _,i.AlertHelper=new I,i.disablerHelper=new P,i._controlRelations=new S(i),i.hiders=[],i.alerts=[],i.disablers=[],i.valueChanges.subscribe((function(e){i._previousValue!==e&&(i.fireValueChangeListener(e),i._previousValue=e)})),i}return C(t,e),Object.defineProperty(t.prototype,"uuid",{get:function(){return this._uuid},set:function(e){this._uuid=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!1,configurable:!0}),t.prototype.hide=function(){this.hiderHelper.hideControl(this)},t.prototype.show=function(){this.hiderHelper.showControl(this)},t.prototype.disable=function(t){e.prototype.disable.call(this,t),e.prototype.setValue.call(this,[])},t.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},t.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},t.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},t.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},t.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},t.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},t.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},t.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},t.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},t.prototype.addValueChangeListener=function(e){this._valueChangeListener=e},t.prototype.fireValueChangeListener=function(e){this.alerts.length>0&&this.updateAlert(),this._valueChangeListener&&"function"==typeof this._valueChangeListener&&this._valueChangeListener(e)},t.prototype.setValue=function(t){e.prototype.setValue.call(this,t)},t}(r.FormArray);(B=e.AfeControlType||(e.AfeControlType={}))[B.AfeFormControl=0]="AfeFormControl",B[B.AfeFormArray=1]="AfeFormArray",B[B.AfeFormGroup=2]="AfeFormGroup",B[B.None=3]="None";var W=function(){function e(e){this.defaultValue=e.defaultValue,this.originalValue=e.originalValue,this.extras=e.extras,this.renderingType=e.type,this.key=e.key||"",this.label=e.label||"",this.validators=e.validators||[],this.required=e.required,this.hide=e.hide,this.disable=e.disable,this.alert=e.alert,this.historicalDataValue=e.historicalDataValue,this.calculateExpression=e.calculateExpression}return e.prototype.setHistoricalValue=function(e){this.enableHistoricalValue=e},e.prototype.showHistoricalEncounterDate=function(e){this.showHistoricalValueDate=void 0===e||e},e}(),U=function(){function e(){}return e.prototype.validate=function(e){return function(t){var n,r=t.value,i=null,o=e.referenceQuestionId,a=e.referenceQuestionAnswers;return t&&t.controlRelations&&t.controlRelations.relations&&t.controlRelations.relations.forEach((function(e){var t=e.relatedTo;t.uuid===o&&(i=t&&Array.isArray(t.value)?e.relatedTo.value:e.relatedTo.value&&e.relatedTo.value.value?e.relatedTo.value.value:e.relatedTo.value)})),"object"==typeof a&&-1!==a.indexOf(i)&&(n=!0),n&&!r?{conditional_required:{message:e.message}}:null}},e}(),$=function(){function e(){}return e.prototype.validate=function(e){return function(t){var n=t.value,r=null,i=e.referenceQuestionId,o=e.referenceQuestionAnswers,a=!0;return n&&t&&t.controlRelations&&t.controlRelations.relations&&t.controlRelations.relations.forEach((function(e){var t=e.relatedTo;t.uuid===i&&(r=Array.isArray(t.value)?t.value:t.value&&"object"==typeof t.value&&t.value.value?t.value.value:t.value),r?"object"==typeof o&&-1===o.indexOf(r)&&(a=!1):a=!1})),a?null:{conditional_answered:{message:e.message}}}},e}(),J=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value;return null==t||"string"==typeof t&&0===t.length?{required:!0}:null},e}(),Z=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value;return t&&0!==t.length?!/Invalid|NaN/.test(new Date(t).toString())?null:{date:!0}:null},e}(),X=function(){function e(){}return e.prototype.validate=function(e){return function(t){if(t.hidden)return null;if(t.value&&0!==t.value.length){var n=t.value;return n>=e?null:{min:{requiredValue:e,actualValue:n}}}return null}},e}(),K=function(){function e(){}return e.prototype.validate=function(e){return function(t){if(t.hidden)return null;if(t.value&&0!==t.value.length){var n=t.value;return n<=e?null:{max:{requiredValue:e,actualValue:n}}}return null}},e}(),ee=function(){function e(){}return e.prototype.validate=function(e){return function(t){if(t.hidden)return null;if(t.value&&0!==t.value.length){if((new Z).validate(t.value))return{mindate:{requiredDate:e}};var n=new Date(t.value);return n.getTime()<e.getTime()?{mindate:{requiredDate:e,actualDate:n}}:null}return null}},e}(),te=function(){function e(){}return e.prototype.validate=function(e){return function(t){if(t.hidden)return null;if(t.value&&0!==t.value.length){if((new Z).validate(t.value))return{maxdate:{requiredDate:e}};var n=new Date(t.value);return n.getTime()>e.getTime()?{maxdate:{requiredDate:e,actualDate:n}}:null}return null}},e}(),ne=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value,n=new Date;if(t&&0!==t.length&&!(new Z).validate(t))return new Date(t).getTime()>n.getTime()?{futureDateRestriction:!0}:null;return null},e}(),re=function(){function e(){}return e.prototype.calcBMI=function(e,t){var n;return e&&t&&(n=(t/(e/100*e/100)).toFixed(1)),e&&t?parseFloat(n):null},e.prototype.calcBSA=function(e,t){var n;return e&&t&&(n=Math.sqrt(e*t/3600).toFixed(2)),e&&t?parseFloat(n):null},e.prototype.calcBMIForAgeZscore=function(e,t,n){var r;t&&n&&(r=(n/(t/100*t/100)).toFixed(1));var i,o=a.first(e);if(o){var s=Object.keys(o).map((function(e){return o[e]})).map((function(e){return e})),l=Object.keys(o),c=s[1],u=[];r<c?u.push(c):a.forEach(s,(function(e){e<=r&&u.push(e)}));var p=a.last(u);(i=l[a.findIndex(s,(function(e){return e===p}))].replace("SD","")).includes("neg")&&(i="-"+(i=i.substring(1,0))),"S"!==i&&"L"!==i&&"M"!==i&&"-5"!==i||(i="-4")}return r&&o?i:null},e.prototype.calcWeightForHeightZscore=function(e,t,n){var r,i;t&&n&&(t=parseFloat(t).toFixed(1));t<45||t>110?i=-4:r=a.filter(e,(function(e){return parseFloat(e.Length).toFixed(1)===t}));var o=a.first(r);if(o){var s=Object.keys(o).map((function(e){return o[e]})).map((function(e){return e})),l=Object.keys(o),c=s[1],u=[];n<c?u.push(c):a.forEach(s,(function(e){e<=n&&u.push(e)}));var p=a.last(u);(i=l[a.findIndex(s,(function(e){return e===p}))].replace("SD","")).includes("neg")&&(i="-"+(i=i.substring(1,0))),"S"!==i&&"L"!==i&&"M"!==i&&"-5"!==i||(i="-4")}return t&&n?i:null},e.prototype.calcHeightForAgeZscore=function(e,t,n){var r,i=a.first(e);if(i){var o=Object.keys(i).map((function(e){return i[e]})).map((function(e){return e})),s=Object.keys(i),l=o[1],c=[];t<l?c.push(l):a.forEach(o,(function(e){e<=t&&c.push(e)}));var u=a.last(c);(r=s[a.findIndex(o,(function(e){return e===u}))].replace("SD","")).includes("neg")&&(r="-"+(r=r.substring(1,0))),"S"!==r&&"L"!==r&&"M"!==r&&"-5"!==r||(r="-4")}return t&&n&&i?r:null},e.prototype.isEmpty=function(e){return null==e||""===e||"null"===e||"undefined"===e||!(!Array.isArray(e)||0!==e.length)},e.prototype.arrayContains=function(e,t){if(Array.isArray(t)){if(0===t.length)return!0;for(var n=!0,r=0;r<t.length;r++){var i=t[r];-1===e.indexOf(i)&&(n=!1)}return n}return-1!==e.indexOf(t)},e.prototype.extractRepeatingGroupValues=function(e,t){return t.map((function(t){return t[e]}))},e.prototype.formatDate=function(e,t,n){if(t=t||"yyyy-MM-dd",n=n||"+0300",!(e instanceof Date)&&null==(e=new Date(e)))throw new Error("DateFormatException: value passed is not a valid date");return e},e.prototype.arrayContainsAny=function(e,t){if(Array.isArray(t)){if(0===t.length)return!0;for(var n=!1,r=0;r<t.length;r++){var i=t[r];-1!==e.indexOf(i)&&(n=!0)}return n}return-1!==e.indexOf(t)},Object.defineProperty(e.prototype,"helperFunctions",{get:function(){var e=this;return{arrayContainsAny:e.arrayContainsAny,calcBMI:e.calcBMI,calcBMIForAgeZscore:e.calcBMIForAgeZscore,calcWeightForHeightZscore:e.calcWeightForHeightZscore,calcHeightForAgeZscore:e.calcHeightForAgeZscore,isEmpty:e.isEmpty,arrayContains:e.arrayContains,extractRepeatingGroupValues:e.extractRepeatingGroupValues}},enumerable:!1,configurable:!0}),e}();re.decorators=[{type:t.Injectable}];var ie=function(){};ie.JSExpressionValidatorsEnabled=!1;var oe=function(){function e(){}return e.prototype.validate=function(e,t){return function(n){if(!ie.JSExpressionValidatorsEnabled)return null;var r=e.failsWhenExpression,i=(new re).helperFunctions;return(new Y).getRunnable(r,n,i,{},t).run()?{js_expression:{expression:r,message:e.message}}:null}},e}(),ae=function(){};ae.REQUIRED_FIELD_MSG="This field is required!",ae.INVALID_DATE_MSG="Provided date is invalid!",ae.FUTURE_DATE_RESTRICTION_MSG="Future date is not allowed!",ae.MIN_LENGTH_MSG="Min Length should be {minLength}",ae.MAX_LENGTH_MSG="Max Length should be {maxLength}",ae.MAX_DATE_MSG="Max Date should be {maxDate}",ae.MIN_DATE_MSG="Min Date should be {minDate}",ae.MAX_MSG="Max value should be {max}",ae.MIN_MSG="Min value should be {min}";var se=function(){function e(){}return e.prototype.getValidators=function(e,t){var n=this,r=[];return e.validators&&a.forEach(e.validators,(function(e){switch(e.type){case"date":r.push(n.dateValidator),e.allowFutureDates||r.push(n.futureDateRestrictionValidator);break;case"js_expression":r.push(n.jsExpressionValidator.validate(e,t));break;case"max":r.push(n.getMaxValueValidator(e.max));break;case"min":r.push(n.getMinValueValidator(e.min));break;case"conditionalRequired":r.push(n.conditionalRequiredValidator.validate(e));break;case"conditionalAnswered":r.push(n.conditionalAnsweredValidator.validate(e))}})),e.required&&"string"==typeof e.required&&"true"===e.required&&r.push(this.requiredValidator),r},Object.defineProperty(e.prototype,"conditionalRequiredValidator",{get:function(){return new U},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"conditionalAnsweredValidator",{get:function(){return new $},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requiredValidator",{get:function(){return(new J).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateValidator",{get:function(){return(new Z).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"futureDateRestrictionValidator",{get:function(){return(new ne).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDateValidator",{get:function(){return(new te).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDateValidator",{get:function(){return(new ee).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minLengthValidator",{get:function(){return r.Validators.minLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLengthValidator",{get:function(){return r.Validators.maxLength},enumerable:!1,configurable:!0}),e.prototype.getMinValueValidator=function(e){return(new X).validate(e)},e.prototype.getMaxValueValidator=function(e){return(new K).validate(e)},Object.defineProperty(e.prototype,"jsExpressionValidator",{get:function(){return new oe},enumerable:!1,configurable:!0}),e.prototype.errors=function(e,t){var n=[];for(var r in e)if(e.hasOwnProperty(r))switch(r){case"required":n.push(ae.REQUIRED_FIELD_MSG);break;case"date":n.push(ae.INVALID_DATE_MSG);break;case"futureDateRestriction":n.push(ae.FUTURE_DATE_RESTRICTION_MSG);break;case"minlength":n.push(ae.MIN_LENGTH_MSG.replace("{minLength}",e.minlength.requiredLength));break;case"maxlength":n.push(ae.MIN_LENGTH_MSG.replace("{maxLength}",e.maxlength.requiredLength));break;case"maxdate":n.push(ae.MAX_DATE_MSG.replace("{maxDate}",e.maxdate.requiredDate));break;case"mindate":n.push(ae.MIN_DATE_MSG.replace("{minDate}",e.mindate.requiredDate));break;case"max":n.push(ae.MAX_MSG.replace("{max}",e.max.requiredValue));break;case"min":n.push(ae.MIN_MSG.replace("{min}",e.min.requiredValue));break;case"js_expression":n.push(e.js_expression.message);break;case"conditional_required":n.push(e.conditional_required.message);break;case"conditional_answered":n.push(e.conditional_answered.message)}return n},e}();se.decorators=[{type:t.Injectable}],se.ctorParameters=function(){return[]};var le=function(){function e(e,t,n){this.expressionRunner=e,this.expressionHelper=t,this._debugModeService=n}return e.prototype.getJsExpressionDisabler=function(e,t,n){var r=this.expressionRunner.getRunnable(e.disable,t,this.expressionHelper.helperFunctions,{},n),i={toDisable:!1,disableWhenExpression:e.disable,reEvaluateDisablingExpression:function(){var e=r.run();i.toDisable=e}};return i},e.prototype.getJsExpressionHider=function(e,t,n){var r=e.hide,i="object"==typeof r?this.convertHideObjectToString(r):e.hide,o=this._debugModeService.debugEnabled(),a=this.expressionRunner.getRunnable(i,t,this.expressionHelper.helperFunctions,{},n),s={toHide:!1,hideWhenExpression:i,reEvaluateHidingExpression:function(){s.toHide=!0!==o&&a.run()}};return s},e.prototype.convertHideObjectToString=function(e){return e.value instanceof Array?"!arrayContains(["+("'"+e.value.join("','")+"'")+"],"+e.field+")":""},e}();le.decorators=[{type:t.Injectable}],le.ctorParameters=function(){return[{type:Y},{type:re},{type:v}]};var ce=function(){function e(e,t){this.expressionRunner=e,this.expressionHelper=t}return e.prototype.getJsExpressionshowAlert=function(e,t,n){var r=this.expressionRunner.getRunnable(e.alert.alertWhenExpression,t,this.expressionHelper.helperFunctions,{},n),i={shown:!1,alertWhenExpression:e.alert.alertWhenExpression,alertMessage:e.alert.message,reEvaluateAlertExpression:function(){var e=r.run();i.shown=e}};return i},e}();ce.decorators=[{type:t.Injectable}],ce.ctorParameters=function(){return[{type:Y},{type:re}]};var ue=function(){function t(e,t,n){this.alertsFactory=n,this.controls=[],this.validationFactory=e,this.hidersDisablersFactory=t}return t.prototype.generateControlModel=function(t,n,r,i){if(t instanceof W){if(t.controlType===e.AfeControlType.AfeFormArray)return this.generateFormArray(t,n,i);if(t.controlType===e.AfeControlType.AfeFormGroup)return this.generateFormGroupModel(t,r,n,i);if(t.controlType===e.AfeControlType.AfeFormControl)return this.generateFormControl(t,n,i)}return null},t.prototype.generateFormGroupModel=function(e,t,n,r){var i=new G({});this.wireHidersDisablers(e,i,r),this.wireAlerts(e,i,r),n instanceof G&&n.setControl(e.key,i);var o=e;return t&&o&&o.questions.length>0&&this._generateFormGroupChildrenModel(o.questions,i,r),i},t.prototype._generateFormGroupChildrenModel=function(e,t,n){var r=this;e.length>0&&e.forEach((function(e){var i=r.generateControlModel(e,t,!0,n);null!==i&&t.addControl(e.key,i)}))},t.prototype.generateFormArray=function(e,t,n){var r,i=this.validationFactory.getValidators(e,n);return(r=i&&i.length>0?new z([],i[0]):new z([])).uuid=e.key,this.wireHidersDisablers(e,r,n),this.wireAlerts(e,r,n),t instanceof G&&t.setControl(e.key,r),r},t.prototype.generateFormControl=function(e,t,n){var r=e.defaultValue||"",i=this.validationFactory.getValidators(e,n),o=new Q(r,i);return o.uuid=e.key,this.wireHidersDisablers(e,o,n),this.wireAlerts(e,o,n),this.wireCalculator(e,o,n?n.dataSourcesContainer.dataSources:null),t instanceof G&&t.setControl(e.key,o),o},t.prototype.wireAlerts=function(e,t,n){if(e.alert&&""!==e.alert){var r=this.alertsFactory.getJsExpressionshowAlert(e,t,n);t.setAlertFn(r)}},t.prototype.wireHidersDisablers=function(e,t,n){if(e.hide&&""!==e.hide){var r=this.hidersDisablersFactory.getJsExpressionHider(e,t,n);t.setHidingFn(r)}if(e.disable&&""!==e.disable){var i=this.hidersDisablersFactory.getJsExpressionDisabler(e,t,n);t.setDisablingFn(i)}},t.prototype.wireCalculator=function(e,t,n){if(e.calculateExpression&&""!==e.calculateExpression){var r=new re,i=(new Y).getRunnable(e.calculateExpression,t,r.helperFunctions,n);t.setCalculatorFn(i.run)}},t}();ue.decorators=[{type:t.Injectable}],ue.ctorParameters=function(){return[{type:se},{type:le},{type:ce}]};var pe='a {\n color: white;\n text-decoration: none;\n font-size: 12px;\n text-transform: uppercase;\n }\n\n ul {\n list-style-type: none;\n margin: 2px auto;\n position: relative;\n }\n\n li {\n display: block;\n padding: 10px 20px;\n white-space: nowrap;\n transition: all 0.3s ease-in;\n border-bottom: 4px solid transparent;\n }\n\n li:hover {\n border-bottom: 4px solid white;\n opacity: 0.7;\n cursor: pointer;\n }\n\n .owl-theme .owl-controls .owl-nav {\n position: absolute;\n width: 100%;\n top: 0;\n }\n\n .owl-theme .owl-controls .owl-nav [class*="owl-"] {\n position: absolute;\n background: none;\n color: black;\n }\n\n .owl-theme .owl-controls .owl-nav [class*="owl-"]:hover {\n background: none;\n color: black;\n }\n\n .owl-theme .owl-controls .owl-nav .owl-next {\n right: 0;\n transform: translate(120%);\n }\n\n .owl-theme .owl-controls .owl-nav .owl-prev {\n left: 0;\n transform: translate(-120%);\n }\n\n .slick-initialized .swipe-tab-content {\n position: relative;\n min-height: 365px;\n }\n @media screen and (min-width: 767px) {\n .slick-initialized .swipe-tab-content {\n min-height: 500px;\n }\n }\n .slick-initialized .swipe-tab {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 50px;\n background: none;\n border: 0;\n color: #757575;\n cursor: pointer;\n text-align: center;\n border-bottom: 2px solid rgba(51, 122, 183, 0);\n transition: all 0.5s;\n }\n .slick-initialized .swipe-tab:hover {\n color: #337AB7;\n }\n .slick-initialized .swipe-tab.active-tab {\n border-bottom-color: #337AB7;\n color: #337AB7;\n font-weight: bold;\n }\n\n .disabled {\n opacity: .5;\n pointer-events: none;\n }\n\n .select2-container {\n margin-top: -5px;\n }\n\n .btn {\n padding: 0px 12px !important;\n }\n\n .form-tooltip{\n color:rgb(51, 122, 183);\n display: inline-block;\n }\n .question-info{\n opacity:0;\n height:0px;\n display: none;\n transition-duration: opacity 1s ease-out;\n transtion-delay: 0.5s;\n padding-top: 2px;\n padding-bottom: 2px;\n color: #696969;\n border-style: ridge;\n border-width: 1px;\n border-color: #337ab7;\n margin-top: 2px;\n }\n .hide-info{\n display:none;\n height:0px;\n }\n .form-tooltip:hover ~ .question-info {\n display:block;\n opacity:1;\n height:auto;\n }\n .form-tooltip .tooltipcontent::after {\n content: " ";\n position: absolute;\n bottom: 100%; /* At the top of the tooltip */\n right: 0%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n border-top-color: transparent;\n border-right-color: transparent;\n border-bottom-color: #337ab7;\n border-left-color: transparent;\n }\n\n ng-select.form-control {\n padding-top: 0;\n height: auto;\n padding-bottom: 0;\n }\n\n .forms-dropdown-menu {\n max-height: 450px;\n overflow-y: scroll;\n }\n .no-border {\n border: 0;\n box-shadow: none;\n}\n.text-danger{\n color: var(--cds-support-01, #da1e28);\n}\n.error{\n margin-bottom: 3rem;\n}\n.afe-control{\n margin-bottom: 1.5rem;\n}\n[hidden] {\n display: none !important;\n}\n ',de=function(){function e(){this._dataSources={}}return Object.defineProperty(e.prototype,"dataSources",{get:function(){return this._dataSources},enumerable:!1,configurable:!0}),e.prototype.registerDataSource=function(e,t,n){if(void 0===n&&(n=!1),n)for(var r in t)this.registerDataSource(r,t[r],!1);this.dataSources[e]&&console.warn("Overriding registered data source",e),this._dataSources[e]=t},e.prototype.clearDataSource=function(e){delete this._dataSources[e]},e}();de.decorators=[{type:t.Injectable}],de.ctorParameters=function(){return[]};var he=function(){function e(e,t,n,r){this.validationFactory=e,this.dataSources=t,this.formErrorsService=n,this.document=r,this.childComponents=[],this.isCollapsed=!1,this.followFocus=!0,this.cacheActive=!1,this.isNavigation=!0,this.type="default",this.inlineDatePicker=new Date,this.activeTab=0}return e.prototype.ngOnInit=function(){var e=this;if(this.setUpRemoteSelect(),this.setUpFileUpload(),this.node&&this.node.form){var t=this.node.form.valueProcessingInfo.lastFormTab;t&&t!==this.activeTab&&(this.activeTab=t)}this.node&&"form"===this.node.question.renderingType&&this.formErrorsService.announceErrorField$.subscribe((function(t){e.scrollToControl(t)})),this.node&&"section"===this.node.question.renderingType&&(this.isCollapsed=!this.node.question.isExpanded),this.parentComponent&&this.parentComponent.addChildComponent(this)},e.prototype.addChildComponent=function(e){this.childComponents.push(e)},e.prototype.setUpRemoteSelect=function(){this.node&&this.node.question.extras&&"remote-select"===this.node.question.renderingType&&(this.dataSource=this.dataSources.dataSources[this.node.question.dataSource],this.dataSource&&this.node.question.dataSourceOptions&&(this.dataSource.dataSourceOptions=this.node.question.dataSourceOptions))},e.prototype.setUpFileUpload=function(){this.node&&this.node.question.extras&&"file"===this.node.question.renderingType&&(this.dataSource=this.dataSources.dataSources[this.node.question.dataSource])},e.prototype.checkSection=function(e){if("section"===e.question.renderingType){var t=!1;return!Object.keys(e.children).every((function(n){var r=e.children[n];return r instanceof q&&(t=Object.keys(r.children).every((function(e){return r.children[e].control.hidden}))),e.children[n].control.hidden||t}))}return!0},e.prototype.clickTab=function(e){this.activeTab=e},e.prototype.loadPreviousTab=function(){this.isCurrentTabFirst()||(this.clickTab(this.activeTab-1),document.body.scrollTop=0)},e.prototype.isCurrentTabFirst=function(){return 0===this.activeTab},e.prototype.isCurrentTabLast=function(){return this.activeTab===this.node.question.questions.length-1},e.prototype.loadNextTab=function(){this.isCurrentTabLast()||(this.clickTab(this.activeTab+1),document.body.scrollTop=0)},e.prototype.tabSelected=function(e){this.activeTab=e,this.setPreviousTab()},e.prototype.setPreviousTab=function(){this.node&&this.node.form&&(this.node.form.valueProcessingInfo.lastFormTab=this.activeTab)},e.prototype.hasErrors=function(){return this.node.control.touched&&!this.node.control.valid},e.prototype.errors=function(){return this.getErrors(this.node)},e.prototype.scrollToControl=function(e){var t=this,n=+e.split(",")[0],r=e.split(",")[1]+"id",i=this.childComponents[n];this.clickTab(n),setTimeout((function(){i.childComponents.forEach((function(e){e.isCollapsed=!1,setTimeout((function(){var e=t.document.getElementById(r);null!==e&&e.focus&&(e.focus(),e.scrollIntoView({behavior:"smooth",block:"center"}))}),100)}))}),200)},e.prototype.onDateChanged=function(e){this.node=e},e.prototype.upload=function(e){},e.prototype.toggleInformation=function(e){var t=document.getElementById(e);"block"===t.style.display?t.style.display="none":t.style.display="block"},e.prototype.getErrors=function(e){var t=e.control.errors;return t?this.validationFactory.errors(t,e.question):[]},e}();he.decorators=[{type:t.Component,args:[{selector:"form-renderer",template:'\x3c!--CONTAINERS--\x3e\n<div *ngIf="node.question.renderingType === \'form\'">\n <ngx-tabset (onSelect)="tabSelected($event)" [selectedIndex]="activeTab">\n <ngx-tab [tabTitle]="question.label" *ngFor="let question of node.question.questions; let i = index">\n <form-renderer [node]="node.children[question.key]" [parentComponent]="this" [parentGroup]="node.control">\n </form-renderer>\n </ngx-tab>\n <error-renderer [form]="node.form"></error-renderer>\n </ngx-tabset>\n\n</div>\n<div *ngIf="node.question.renderingType === \'page\'">\n <form-renderer *ngFor="let question of node.question.questions" [parentComponent]="this"\n [node]="node.children[question.key]" [parentGroup]="parentGroup"></form-renderer>\n</div>\n<div *ngIf="node.question.renderingType === \'section\' && checkSection(node)">\n <div class="bx--accordion__item" [ngClass]="{ \'bx--accordion__item--active\': !isCollapsed }">\n <button class="bx--accordion__heading" type="button" [attr.aria-expanded]="isCollapsed ? \'false\' : \'true\'"\n aria-controls="accordion-item-0" (click)="isCollapsed = !isCollapsed">\n <svg class="bx--accordion__arrow" ibmIcon="chevron--right" size="16" xmlns="http://www.w3.org/2000/svg"\n focusable="false" preserveAspectRatio="xMidYMid meet" aria-hidden="true" width="16" height="16"\n viewBox="0 0 16 16">\n <path d="M11 8L6 13 5.3 12.3 9.6 8 5.3 3.7 6 3z"></path>\n </svg>\n <p class="bx--accordion__title">\n {{ node.question.label }}\n </p>\n </button>\n <div class="bx--accordion__content" [collapse]="isCollapsed">\n <form-renderer *ngFor="let question of node.question.questions" [parentComponent]="this"\n [node]="node.children[question.key]" [parentGroup]="parentGroup"></form-renderer>\n </div>\n </div>\n</div>\n\n\x3c!-- MESSAGES --\x3e\n<div *ngIf="node.control && node.control.alert && node.control.alert !== \'\'" class="alert alert-warning">\n <a class="close" data-dismiss="alert">×</a> {{ node.control.alert }}\n</div>\n\n\x3c!--CONTROLS--\x3e\n\n\n<div *ngIf="node.question.controlType === 0" class="bx--form-item" [formGroup]="parentGroup"\n [hidden]="node.control.hidden" [ngClass]="{ disabled: node.control.disabled }">\n \x3c!--LEAF CONTROL--\x3e\n <div class="question-area">\n <a class="form-tooltip pull-right" (click)="toggleInformation(node.question.extras.id)" data-placement="right"\n *ngIf="\n node.question &&\n node.question.extras.questionInfo &&\n node.question.extras.questionInfo !== \'\' &&\n node.question.extras.questionInfo !== \' \'\n ">\n <i class="glyphicon glyphicon-question-sign" aria-hidden="true"></i>\n </a>\n\n <label *ngIf="node.question.label" [style.color]="hasErrors() ? \'red\' : \'\'" class="bx--label"\n [attr.for]="node.question.key">\n {{ node.question.required ? \'*\' : \'\' }} {{ node.question.label }}\n </label>\n <div class="afe-control" [ngSwitch]="node.question.renderingType">\n <ibm-select *ngSwitchCase="\'select\'" [formControlName]="node.question.key" [id]="node.question.key + \'id\'">\n <option *ngFor="let o of node.question.options" [value]="o.value">\n {{ o.label }}\n </option>\n </ibm-select>\n\n \x3c!-- <app-file-upload *ngSwitchCase="\'file\'" [dataSource]="dataSource" [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'" (fileChanged)="upload($event)">\n </app-file-upload> --\x3e\n <textarea [placeholder]="node.question.placeholder" [rows]="node.question.rows"\n class="bx--text-area bx--text-area--v2" *ngSwitchCase="\'textarea\'" [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'">\n </textarea>\n\n <ngx-remote-select *ngSwitchCase="\'remote-select\'" [placeholder]="node.question.placeholder" tabindex="0"\n [dataSource]="dataSource" [componentID]="node.question.key + \'id\'" [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"></ngx-remote-select>\n\n <ngx-datetimepicker [id]="node.question.key + \'id\'" [formControlName]="node.question.key" *ngSwitchCase="\'date\'">\n </ngx-datetimepicker>\n <ng-select [id]="node.question.key + \'id\'" *ngSwitchCase="\'multi-select\'" [items]="node.question.options"\n bindLabel="label" bindValue="value" [multiple]="true" placeholder="" clearAllText="Clear"\n [formControlName]="node.question.key">\n </ng-select>\n\n <ng-select [id]="node.question.key + \'id\'" *ngSwitchCase="\'single-select\'" [items]="node.question.options"\n bindLabel="label" bindValue="value" placeholder="" clearAllText="Clear" [formControlName]="node.question.key">\n </ng-select>\n\n <number-input *ngSwitchCase="\'number\'" [id]="node.question.key + \'id\'"\n [min]="node.question.extras.questionOptions.min" [max]="node.question.extras.questionOptions.max"\n [formControlName]="node.question.key" [attr.placeholder]="node.question.placeholder">\n </number-input>\n\n <input class="bx--text-input" *ngSwitchDefault [formControlName]="node.question.key"\n [attr.placeholder]="node.question.placeholder" [type]="node.question.renderingType"\n [id]="node.question.key + \'id\'" />\n\n <div *ngSwitchCase="\'radio\'">\n <div *ngFor="let o of node.question.options">\n <label class="form-control no-border">\n <input type="radio" [formControlName]="node.question.key" [id]="node.question.key + \'id\'"\n [value]="o.value" />\n {{ o.label }}\n </label>\n </div>\n </div>\n\n <div *ngSwitchCase="\'checkbox\'">\n <checkbox [id]="node.question.key + \'id\'" [formControlName]="node.question.key"\n [options]="node.question.options" [selected]="node.control.value"></checkbox>\n </div>\n\n <div *ngIf="\n node.question.enableHistoricalValue && node.question.historicalDisplay\n " style="margin-top: 2px">\n <div class="container-fluid">\n <div class="row">\n <div class="col-xs-9">\n <span class="text-warning">Previous Value: </span>\n <strong>{{ node.question.historicalDisplay?.text }}</strong>\n <span *ngIf="node.question.showHistoricalValueDate">\n <span> | </span>\n <strong class="text-primary">{{ node.question.historicalDisplay?._date }}\n </strong>\n <span class="text-primary" *ngIf="\n node.question.historicalDisplay &&\n node.question.historicalDisplay._date\n ">\n ({{ node.question.historicalDisplay._date | timeAgo }})</span>\n </span>\n </div>\n <button type="button" [node]="node" [name]="\'historyValue\'"\n class="bx--btn bx--btn--primary bx--btn--sm col-xs-3">\n Use Value\n </button>\n </div>\n </div>\n </div>\n <appointments-overview [node]="node"></appointments-overview>\n <div *ngIf="hasErrors()">\n <div *ngFor="let e of errors()">\n <span class="text-danger">{{ e }}</span>\n </div>\n </div>\n </div>\n\n <div class="question-info col-md-12 col-lg-12 col-sm-12" id="{{ node.question.extras.id }}" *ngIf="\n node.question &&\n node.question.extras.questionInfo &&\n node.question.extras.questionInfo !== \'\' &&\n node.question.extras.questionInfo !== \' \'\n ">\n {{ node.question.extras.questionInfo }}\n </div>\n </div>\n\n</div>\n<div *ngIf="node.question.controlType === 1" [hidden]="node.control.hidden"\n [ngClass]="{ disabled: node.control.disabled }">\n \x3c!--ARRAY CONTROL--\x3e\n <div [ngSwitch]="node.question.renderingType">\n <div class="well" style="padding: 2px" *ngSwitchCase="\'repeating\'">\n <h4 style="margin: 2px; font-weight: bold">{{ node.question.label }}</h4>\n <hr style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 2px;\n " />\n <div [ngSwitch]="node.question.extras.type">\n <div *ngSwitchCase="\'testOrder\'">\n <div *ngFor="let child of node.children; let i = index">\n <form-renderer *ngFor="let question of child.question.questions" [parentComponent]="this"\n [node]="child.children[question.key]" [parentGroup]="child.control"></form-renderer>\n <div>{{ child.orderNumber }}</div>\n <button type="button " class="bx--btn bx--btn--danger bx--btn--sm" (click)="node.removeAt(i)">\n Remove\n </button>\n <br />\n <hr style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 1px;\n " />\n </div>\n </div>\n\n <div *ngSwitchCase="\'obsGroup\'" style="margin-bottom: 20px">\n <div *ngFor="let child of node.children; let i = index">\n <form-renderer *ngFor="let question of child.question.questions" [parentComponent]="this"\n [node]="child.children[question.key]" [parentGroup]="child.control"></form-renderer>\n <button type="button " class="bx--btn bx--btn--danger bx--btn--sm" (click)="node.removeAt(i)">\n Remove\n </button>\n <br />\n <hr style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 1px;\n " />\n </div>\n </div>\n </div>\n <button type="button" class="bx--btn bx--btn--primary" (click)="node.createChildNode()">\n Add\n </button>\n </div>\n </div>\n</div>\n<div *ngIf="node.question.controlType === 2" [hidden]="node.control.hidden"\n [ngClass]="{ disabled: node.control.disabled }">\n \x3c!--GROUP--\x3e\n <div [ngSwitch]="node.question.renderingType">\n <div *ngSwitchCase="\'group\'">\n <form-renderer *ngFor="let question of node.question.questions" [parentComponent]="this"\n [node]="node.children[question.key]" [parentGroup]="node.control"></form-renderer>\n </div>\n <div *ngSwitchCase="\'field-set\'" style="border: 1px solid #eeeeee; padding: 2px; margin: 2px">\n <form-renderer *ngFor="let question of node.question.questions" [parentComponent]="this"\n [node]="node.children[question.key]" [parentGroup]="node.control"></form-renderer>\n </div>\n </div>\n</div>',styles:["../../style/app.css",pe]}]}],he.ctorParameters=function(){return[{type:se},{type:de},{type:x},{type:void 0,decorators:[{type:t.Inject,args:[n.DOCUMENT]}]}]},he.propDecorators={parentComponent:[{type:t.Input}],node:[{type:t.Input}],parentGroup:[{type:t.Input}]};var fe=function(){function e(e,t){this.validationFactory=e,this.formErrorsService=t}return e.prototype.ngOnInit=function(){},e.prototype.showErrors=function(){return!this.form.valid&&this.form.showErrors},Object.defineProperty(e.prototype,"errorNodes",{get:function(){return this.form.markInvalidControls(this.form.rootNode,[])},enumerable:!1,configurable:!0}),e.prototype.getControlError=function(e){var t=e.control.errors;return t?this.validationFactory.errors(t,e.question):[]},e.prototype.announceErrorField=function(e){var t=this,n=this.form.searchNodeByQuestionId(e.path.substring(0,e.path.indexOf(".")));a.forEach(n,(function(n){if("page"===n.question.renderingType){var r=t.getPageIndex(n);t.formErrorsService.announceErrorField(r+","+e.question.key)}}))},e.prototype.getPageIndex=function(e){return this.form.rootNode.question.questions.indexOf(e.question)},e}();fe.decorators=[{type:t.Component,args:[{selector:"error-renderer",template:'<div *ngIf="showErrors()" class="container">\n <div data-notification *ngFor="let errorNode of errorNodes"\n class="bx--inline-notification bx--inline-notification--error bx--inline-notification--low-contrast" role="alert">\n <div class="bx--inline-notification__details">\n <div class="bx--inline-notification__text-wrapper">\n <p class="bx--inline-notification__title">{{ errorNode.question.label }}</p>\n <p class="bx--inline-notification__subtitle">{{ getControlError(errorNode) }}</p>\n </div>\n </div>\n <button tabindex="0" (click)="announceErrorField(errorNode)"\n class="bx--inline-notification__action-button bx--btn bx--btn--sm bx--btn--ghost" type="button">Fix</button>\n <svg focusable="false" preserveAspectRatio="xMidYMid meet" style="will-change: transform;"\n xmlns="http://www.w3.org/2000/svg" class="bx--inline-notification__icon" width="20" height="20"\n viewBox="0 0 20 20" aria-hidden="true">\n <path d="M10,1c-5,0-9,4-9,9s4,9,9,9s9-4,9-9S15,1,10,1z M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z"></path>\n <path d="M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z" data-icon-path="inner-path" opacity="0"></path>\n </svg>\n </div>\n</div>',styles:["ul{list-style:none}.list-group-item{padding:2px 15px;cursor:pointer}ul li:hover{background-color:#fff}h4{margin-top:7px;margin-bottom:7px}"]}]}],fe.ctorParameters=function(){return[{type:se},{type:x}]},fe.propDecorators={form:[{type:t.Input}]};var me=function(){function e(){}return e.prototype.getDisplayTextFromOptions=function(e,t,n){var r="",i=e.historicalDataValue;if(a.isArray(i.value)){var o=0;a.each(i.value,(function(i){a.each(e.options,(function(e){e[t]===i&&(0===o?r+=e[n]:r=r+", "+e[n],o++)}))}))}else a.each(e.options,(function(e){e[t]===i.value&&(r=e[n])}));return r},e}();me.decorators=[{type:t.Injectable}];var ye=function(){function e(e){this.historicalFieldHelper=e,this._nodeChange=new t.EventEmitter}return e.prototype.setValue=function(e){"historyValue"===e.target.name&&(!this._node||this.compareString(this._node.question.renderingType,"page")&&this.compareString(this._node.question.renderingType,"section")||(this._node.control.setValue(this._node.question.historicalDataValue.value),this._node.question.historicalValue=this._node.question.historicalDataValue,e.stopPropagation(),this._nodeChange.emit(this._node)))},e.prototype.compareString=function(e,t){return e===t},Object.defineProperty(e.prototype,"node",{set:function(e){if(e&&(this._node=e,this._node.question.enableHistoricalValue&&!a.isUndefined(this._node.question.historicalDataValue))){var t={text:"",_date:""};"select"===this._node.question.renderingType||"multi-select"===this._node.question.renderingType||"single-select"===this._node.question.renderingType?(t.text=this.historicalFieldHelper.getDisplayTextFromOptions(this._node.question,"value","label"),t._date=this._node.question.historicalDataValue.valueDate,this._node.question.historicalDisplay=t):a.isUndefined(this._node.question.historicalDataValue)||(t.text=this._node.question.historicalDataValue.value,t._date=this._node.question.historicalDataValue.valueDate,this._node.question.historicalDisplay=t)}},enumerable:!1,configurable:!0}),e}();ye.decorators=[{type:t.Directive,args:[{selector:"[node]"}]}],ye.ctorParameters=function(){return[{type:me}]},ye.propDecorators={_node:[{type:t.Input}],_nodeChange:[{type:t.Output}],setValue:[{type:t.HostListener,args:["click",["$event"]]}],node:[{type:t.Input}]};var ge="400ms cubic-bezier(0.4,0.0,0.2,1)",be=[s.style({height:0,visibility:"hidden"}),s.animate(ge,s.style({height:"*",visibility:"visible"}))],ve=[s.style({height:"*",visibility:"visible"}),s.animate(ge,s.style({height:0,visibility:"hidden"}))],we=function(){function e(e,n,r){this._el=e,this._renderer=n,this.collapsed=new t.EventEmitter,this.collapses=new t.EventEmitter,this.expanded=new t.EventEmitter,this.expands=new t.EventEmitter,this.isExpanded=!0,this.collapseNewValue=!0,this.isCollapsed=!1,this.isCollapse=!0,this.isCollapsing=!1,this.isAnimated=!1,this._display="block",this._stylesLoaded=!1,this._COLLAPSE_ACTION_NAME="collapse",this._EXPAND_ACTION_NAME="expand",this._factoryCollapseAnimation=r.build(ve),this._factoryExpandAnimation=r.build(be)}return Object.defineProperty(e.prototype,"display",{set:function(e){this.isAnimated?(this._display=e,"none"!==e?this.show():this.hide()):this._renderer.setStyle(this._el.nativeElement,"display",e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"collapse",{get:function(){return this.isExpanded},set:function(e){this.collapseNewValue=e,this._player&&!this._isAnimationDone||(this.isExpanded=e,this.toggle())},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewChecked=function(){this._stylesLoaded=!0,this._player&&this._isAnimationDone&&(this._player.reset(),this._renderer.setStyle(this._el.nativeElement,"height","*"))},e.prototype.toggle=function(){this.isExpanded?this.hide():this.show()},e.prototype.hide=function(){var e=this;this.isCollapsing=!0,this.isExpanded=!1,this.isCollapsed=!0,this.isCollapsing=!1,this.collapses.emit(this),this._isAnimationDone=!1,this.animationRun(this.isAnimated,this._COLLAPSE_ACTION_NAME)((function(){e._isAnimationDone=!0,e.collapseNewValue!==e.isCollapsed&&e.isAnimated?e.show():(e.collapsed.emit(e),e._renderer.setStyle(e._el.nativeElement,"display","none"))}))},e.prototype.show=function(){var e=this;this._renderer.setStyle(this._el.nativeElement,"display",this._display),this.isCollapsing=!0,this.isExpanded=!0,this.isCollapsed=!1,this.isCollapsing=!1,this.expands.emit(this),this._isAnimationDone=!1,this.animationRun(this.isAnimated,this._EXPAND_ACTION_NAME)((function(){e._isAnimationDone=!0,e.collapseNewValue!==e.isCollapsed&&e.isAnimated?e.hide():(e.expanded.emit(e),e._renderer.removeStyle(e._el.nativeElement,"overflow"))}))},e.prototype.animationRun=function(e,t){var n=this;if(!e||!this._stylesLoaded)return function(e){return e()};this._renderer.setStyle(this._el.nativeElement,"overflow","hidden"),this._renderer.addClass(this._el.nativeElement,"collapse");var r=t===this._EXPAND_ACTION_NAME?this._factoryExpandAnimation:this._factoryCollapseAnimation;return this._player&&this._player.destroy(),this._player=r.create(this._el.nativeElement),this._player.play(),function(e){var t;return null===(t=n._player)||void 0===t?void 0:t.onDone(e)}},e}();we.decorators=[{type:t.Directive,args:[{selector:"[collapse]",exportAs:"bs-collapse",host:{"[class.collapse]":"true"}}]}],we.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:s.AnimationBuilder}]},we.propDecorators={collapsed:[{type:t.Output}],collapses:[{type:t.Output}],expanded:[{type:t.Output}],expands:[{type:t.Output}],isExpanded:[{type:t.HostBinding,args:["class.in"]},{type:t.HostBinding,args:["class.show"]},{type:t.HostBinding,args:["attr.aria-expanded"]}],isCollapsed:[{type:t.HostBinding,args:["attr.aria-hidden"]}],isCollapse:[{type:t.HostBinding,args:["class.collapse"]}],isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],display:[{type:t.Input}],isAnimated:[{type:t.Input}],collapse:[{type:t.Input}]};var xe=function(){},ke=function(){function e(){this.theme="dark",this.disabled=!1,this.skeleton=!1,this.invalid=!1,this.id="number-"+e.numberCount,this.size="md",this.min=null,this.max=null,this.step=1,this.warn=!1,this.change=new t.EventEmitter,this.decrementLabel="Decrease",this.incrementLabel="Increase",this._value=0,this.onTouched=function(){},this.propagateChange=function(e){},e.numberCount++}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=""!==e&&null!==e?Number(e):null},enumerable:!1,configurable:!0}),e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.focusOut=function(){this.onTouched()},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.onIncrement=function(){var e=this._value||0;null===this.max||e+this.step<=this.max?this.value=parseFloat((e+this.step).toPrecision(this.precision)):this.value=this.max,this.emitChangeEvent()},e.prototype.onDecrement=function(){var e=this._value||0;null===this.min||e-this.step>=this.min?this.value=parseFloat((e-this.step).toPrecision(this.precision)):this.value=this.min,this.emitChangeEvent()},e.prototype.emitChangeEvent=function(){var e=new xe;e.source=this,e.value=this.value,this.change.emit(e),this.propagateChange(this.value)},e.prototype.onNumberInputChange=function(e){this.value=e.target.value,this.emitChangeEvent()},e.prototype.isTemplate=function(e){return e instanceof t.TemplateRef},e}();ke.numberCount=0,ke.decorators=[{type:t.Component,args:[{selector:"number-input",template:'<div data-numberinput [attr.data-invalid]="invalid ? true : null" class="bx--number" [ngClass]="{\n \'bx--number--light\': theme === \'light\',\n \'bx--number--nolabel\': !label,\n \'bx--number--helpertext\': helperText,\n \'bx--skeleton\': skeleton,\n \'bx--number--sm\': size === \'sm\',\n \'bx--number--xl\': size === \'xl\'\n }">\n <div class="bx--number__input-wrapper" [ngClass]="{\n \'bx--number__input-wrapper--warning\': warn\n }">\n <input type="number" [id]="id" [value]="value" [attr.min]="min" [attr.max]="max" [attr.step]="step"\n [disabled]="disabled" [required]="required" (input)="onNumberInputChange($event)" />\n <div class="bx--number__controls">\n <button type="button" class="bx--number__control-btn down-icon" (click)="onDecrement()" title="Decrement number"\n [attr.aria-label]="decrementLabel" tabindex="-1">\n <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"\n fill="currentColor" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true" class="down-icon">\n <path d="M8 15H24V17H8z"></path>\n </svg>\n </button>\n <div class="bx--number__rule-divider"></div>\n <button type="button" class="bx--number__control-btn up-icon" (click)="onIncrement()" title="Increment number"\n [attr.aria-label]="incrementLabel" tabindex="-1">\n <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"\n fill="currentColor" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true" class="up-icon">\n <path d="M17 15L17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z"></path>\n </svg>\n </button>\n <div class="bx--number__rule-divider"></div>\n </div>\n </div>\n <div *ngIf="helperText && !invalid && !warn" class="bx--form__helper-text">\n <ng-container *ngIf="!isTemplate(helperText)">{{\n helperText\n }}</ng-container>\n <ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>\n </div>\n <div *ngIf="!warn && invalid" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(invalidText)">{{\n invalidText\n }}</ng-container>\n <ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>\n </div>\n <div *ngIf="!invalid && warn" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(warnText)">{{ warnText }}</ng-container>\n <ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>\n </div>\n</div>',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return ke})),multi:!0}]}]}],ke.ctorParameters=function(){return[]},ke.propDecorators={theme:[{type:t.Input}],disabled:[{type:t.Input}],skeleton:[{type:t.Input}],invalid:[{type:t.Input}],id:[{type:t.Input}],size:[{type:t.Input}],required:[{type:t.Input}],value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],label:[{type:t.Input}],helperText:[{type:t.Input}],invalidText:[{type:t.Input}],step:[{type:t.Input}],precision:[{type:t.Input}],warn:[{type:t.Input}],warnText:[{type:t.Input}],change:[{type:t.Output}],decrementLabel:[{type:t.Input}],incrementLabel:[{type:t.Input}],focusOut:[{type:t.HostListener,args:["focusout"]}]};var Ce=function(){};Ce.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,r.FormsModule],exports:[ke],declarations:[ke],providers:[]}]}];var Te=b,Oe=function(){function e(){this.locale="en",this.viewFormat="ll",this.returnObject="js",this.onDatePickerCancel=new t.EventEmitter,this.onSelectDate=new t.EventEmitter,this.onDisplayMonths=!1,this.onDisplayYears=!1,this.displayYearsIndex=0,this.monthsShort=Te.monthsShort()}return e.prototype.ngOnInit=function(){var e=this;this.initValue(),a.each(this.fullYearRange,(function(t,n){e.currentYear=e.calendarDate.clone().startOf("year").year(),-1!==t.indexOf(e.currentYear)&&(e.displayYearsIndex=n)})),this.displayYearRange=this.fullYearRange[this.displayYearsIndex],this.generateCalendar()},e.prototype.prev=function(){this.onDisplayYears?(this.displayYearsIndex--,this.displayYearsIndex<0&&(this.displayYearsIndex=0),this.displayYearRange=this.fullYearRange[this.displayYearsIndex]):this.calendarDate=this.calendarDate.clone().subtract(1,"M"),this.generateCalendar()},e.prototype.showMonthSelection=function(){this.onDisplayMonths=!0,this.onDisplayYears=!1},e.prototype.showYearSelection=function(){this.onDisplayYears=!0,this.onDisplayMonths=!1},e.prototype.next=function(){this.onDisplayYears?(this.displayYearsIndex++,this.displayYearsIndex>=this.fullYearRange.length&&(this.displayYearsIndex=this.fullYearRange.length-1),this.displayYearRange=this.fullYearRange[this.displayYearsIndex++]):this.calendarDate=this.calendarDate.clone().add(1,"M"),this.generateCalendar()},e.prototype.selectDay=function(e){var t=e.diff(this.calendarDate.clone().startOf("date"),"days");e=this.calendarDate.clone().add(t,"d");var n=this.parseToReturnObjectType(e);this.onSelectDate.emit(n),this.cancelDatePicker()},e.prototype.selectMonth=function(e){this.calendarDate=this.calendarDate.clone().month(e),this.onDisplayMonths=!1,this.generateCalendar()},e.prototype.selectYear=function(e){this.calendarDate=this.calendarDate.clone().year(e),this.onDisplayYears=!1,this.generateCalendar()},e.prototype.selectToday=function(){var e=this.parseToReturnObjectType(Te());this.onSelectDate.emit(e),this.cancelDatePicker()},e.prototype.clearPickDate=function(){this.onSelectDate.emit(null),this.cancelDatePicker()},e.prototype.cancelDatePicker=function(){this.onDatePickerCancel.emit(!1)},e.prototype.generateYears=function(){for(var e=Te().year(),t=[],n=this.calendarDate.clone().subtract(100,"y").year();n<=e;n++)t.push(n);this.fullYearRange=a.chunk(t,14)},e.prototype.initValue=function(){Te.locale(this.locale),this.today=Te().startOf("date"),this.currentMonth=this.monthsShort[Te().month()],this.currentYear=Te().year(),this.dayNames=Te.weekdaysShort(!0),this.initDate?(this.calendarDate="string"===this.returnObject?Te(this.initDate,this.viewFormat):Te(this.initDate),this.selectedDate=this.calendarDate.clone().startOf("date")):this.calendarDate=Te(),this.generateYears()},e.prototype.generateCalendar=function(){this.calendarDays=[];for(var e=0-(this.calendarDate.clone().startOf("month").day()+(7-Te.localeData().firstDayOfWeek()))%7,t=41+e,n=e;n<=t;n+=1){var r=this.calendarDate.clone().startOf("month").add(n,"days");this.calendarDays.push(r)}},e.prototype.parseToReturnObjectType=function(e){switch(this.returnObject){case"js":return e.toDate();case"string":return e.format(this.viewFormat);case"moment":return e;case"json":return e.toJSON();case"array":return e.toArray();case"iso":return e.toISOString();case"object":return e.toObject();default:return e}},e}();Oe.decorators=[{type:t.Component,args:[{selector:"date-picker",template:'<picker-modal (onOverlayClick)="cancelDatePicker()">\n <div class="picker-wrap">\n <div class="picker-box">\n <div class="picker-header">\n <div class="picker-header-nav">\n <span class="nav-prev" (click)="prev()"></span>\n </div>\n <div class="picker-header-content">\n <div class="content">\n <span (click)="showMonthSelection()" class="month">{{\n calendarDate | moment: \'MMMM\'\n }}</span>\n <span class="seperator">|</span>\n <span (click)="showYearSelection()" class="year">{{\n calendarDate | moment: \'YYYY\'\n }}</span>\n </div>\n </div>\n <div class="picker-header-nav">\n <span class="nav-next" (click)="next()"></span>\n </div>\n </div>\n <div class="picker-calendar">\n <div\n class="picker-calendar-row"\n *ngIf="!onDisplayMonths && !onDisplayYears"\n >\n <span class="picker-weekday" *ngFor="let day of dayNames">{{\n day\n }}</span>\n </div>\n <div\n class="picker-calendar-row"\n *ngIf="!onDisplayMonths && !onDisplayYears"\n >\n <span\n class="picker-day"\n (click)="selectDay(day)"\n [ngClass]="{\n \'out-focus\': day.month() != calendarDate.month(),\n today: day.isSame(today),\n selected: day.isSame(selectedDate)\n }"\n *ngFor="let day of calendarDays"\n >\n {{ day | moment: \'D\' }}\n </span>\n </div>\n <div class="picker-calendar-row" *ngIf="onDisplayMonths">\n <span\n class="picker-month"\n *ngFor="let month of monthsShort"\n (click)="selectMonth(month)"\n [ngClass]="{\n selected: month === currentMonth\n }"\n >\n {{ month }}\n </span>\n </div>\n <div class="picker-calendar-row" *ngIf="onDisplayYears">\n <span\n class="picker-year"\n *ngFor="let year of displayYearRange"\n (click)="selectYear(year)"\n [ngClass]="{\n selected: year === currentYear\n }"\n >\n {{ year }}\n </span>\n </div>\n </div>\n <div class="picker-footer">\n <div class="picker-action action-today" (click)="selectToday()">\n <span class="text">Today</span>\n </div>\n <div class="picker-action action-clear" (click)="clearPickDate()">\n <span class="text">Clear</span>\n </div>\n <div class="picker-action action-close" (click)="cancelDatePicker()">\n <span class="text">Close</span>\n </div>\n </div>\n </div>\n </div>\n</picker-modal>\n',styles:['*,:after,:before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:666px}.picker-box{font-family:Open Sans;min-width:400px!important;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;display:flex;height:2.5rem;width:100%}.picker-header-nav{position:relative;cursor:pointer;width:calc(100% / 8)}.picker-header-nav>*{position:absolute;top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}.picker-header-nav .nav-next:before,.picker-header-nav .nav-prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker-header-nav .nav-next:before{border-right:0;border-left:.75em solid #000}.picker-header-content{width:calc(100% * 6 / 8);text-align:center}.picker-header-content .month{font-size:1.778rem;line-height:2.5rem;margin-right:.5rem;font-weight:700}.picker-header-content .year{font-style:italic;color:#999}.picker-calendar{width:100%}.picker-calendar .picker-calendar-row{display:flex;flex-wrap:wrap;width:100%;margin-bottom:.625rem}.picker-calendar .picker-weekday{font-weight:700;text-align:left;color:#999;width:calc(100% / 7)}.picker-calendar .picker-day,.picker-calendar .picker-month,.picker-calendar .picker-year{font-size:1.333rem;line-height:2.5rem;position:relative;height:2.5rem;text-align:center;cursor:pointer;width:calc(100% / 7)}.picker-calendar .picker-day:hover,.picker-calendar .picker-month:hover,.picker-calendar .picker-year:hover{background:#b1dcfb}.picker-calendar .out-focus{color:#ddd}.picker-calendar .out-focus:hover{color:#000}.picker-calendar .selected{background:#0089ec;color:#fff}.picker-calendar .selected:hover{background:#0089ec}.picker-calendar .today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker-footer{cursor:pointer}.picker-footer .picker-action{text-align:center;width:calc(100% / 3)}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear:before,.picker-footer .action-close:before,.picker-footer .action-today:before{content:" ";position:relative;display:inline-block;height:0;width:0}.picker-footer .action-today:before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-clear:before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close:before{width:1rem;height:1rem;background:linear-gradient(180deg,transparent 35%,#777 0,#777 65%,transparent 0),linear-gradient(90deg,transparent 35%,#777 0,#777 65%,transparent 0);transform:rotate(45deg)}']}]}],Oe.ctorParameters=function(){return[]},Oe.propDecorators={initDate:[{type:t.Input}],locale:[{type:t.Input}],viewFormat:[{type:t.Input}],returnObject:[{type:t.Input}],onDatePickerCancel:[{type:t.Output}],onSelectDate:[{type:t.Output}]};var De=b,Me=function(){function e(){this.showSecond=!0,this.viewFormat="hh:mm A",this.use12Hour=!1,this.returnObject="js",this.onSelectTime=new t.EventEmitter,this.onTimePickerCancel=new t.EventEmitter,this.hourFormat="HH"}return e.prototype.ngOnInit=function(){this.use12Hour&&(this.hourFormat="hh"),this.time=this.initTime?De(this.initTime,this.viewFormat):De(),this.initTime?this.time="string"===this.returnObject?De(this.initTime,this.viewFormat):De(this.initTime):this.time=De()},e.prototype.increaseHour=function(){this.time=this.time.clone().add(1,"h")},e.prototype.decreaseHour=function(){this.time=this.time.clone().subtract(1,"h")},e.prototype.increaseMinute=function(){this.time=this.time.clone().add(1,"m")},e.prototype.decreaseMinute=function(){this.time=this.time.clone().subtract(1,"m")},e.prototype.increaseSecond=function(){this.time=this.time.clone().add(1,"s")},e.prototype.decreaseSecond=function(){this.time=this.time.clone().subtract(1,"s")},e.prototype.selectTime=function(){var e=this.parseToReturnObjectType(this.time);this.onSelectTime.emit(e),this.cancelTimePicker()},e.prototype.selectNow=function(){var e=this.parseToReturnObjectType(De());this.onSelectTime.emit(e),this.cancelTimePicker()},e.prototype.clearTime=function(){this.onSelectTime.emit(null),this.cancelTimePicker()},e.prototype.cancelTimePicker=function(){this.onTimePickerCancel.emit(!1)},e.prototype.parseToReturnObjectType=function(e){switch(this.returnObject){case"js":return e.toDate();case"string":return e.format(this.viewFormat);case"moment":return e;case"json":return e.toJSON();case"array":return e.toArray();case"iso":return e.toISOString();case"object":return e.toObject();default:return e}},e}();Me.decorators=[{type:t.Component,args:[{selector:"time-picker",template:'<picker-modal (onOverlayClick)="cancelTimePicker()">\n <div class="picker-wrap">\n <div class="picker-box">\n <div class="picker-header">Time Picker</div>\n <div class="picker-table">\n <ul class="picker-table-time">\n <li class="picker-table-number hour">\n <span class="arrow up" (click)="increaseHour()"></span>\n {{ time | moment: hourFormat }}\n <span class="arrow down" (click)="decreaseHour()"></span>\n </li>\n <li class="picker-table-separator">:</li>\n <li class="picker-table-number minute">\n <span class="arrow up" (click)="increaseMinute()"></span>\n {{ time | moment: \'mm\' }}\n <span class="arrow down" (click)="decreaseMinute()"></span>\n </li>\n <li *ngIf="showSecond" class="picker-table-separator">:</li>\n <li *ngIf="showSecond" class="picker-table-number second">\n <span class="arrow up" (click)="increaseSecond()"></span>\n {{ time | moment: \'ss\' }}\n <span class="arrow down" (click)="decreaseSecond()"></span>\n </li>\n <li *ngIf="use12Hour" class="picker-table-meridiem meridiem">\n {{ time | moment: \'A\' }}\n </li>\n </ul>\n </div>\n <div class="picker-footer">\n <div class="picker-action action-now" (click)="selectNow()">\n <span class="text">Now</span>\n </div>\n <div class="picker-action action-confirm" (click)="selectTime()">\n <span class="text">Confirm</span>\n </div>\n <div class="picker-action action-clear" (click)="clearTime()">\n <span class="text">Clear</span>\n </div>\n <div class="picker-action action-close" (click)="cancelTimePicker()">\n <span class="text">Close</span>\n </div>\n </div>\n </div>\n </div>\n</picker-modal>\n',styles:['*,:after,:before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:40rem;font-family:Open Sans}.picker-box{width:100%;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;height:2.5rem;width:100%}.picker-header{text-align:center}.picker-table{width:100%;margin:2.5rem 0}.picker-table-time{font-size:2.37rem;line-height:2.5rem;list-style:none;margin:0;padding:0;display:flex;justify-content:center;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-table-meridiem,.picker-table-number,.picker-table-separator{text-align:center}.picker-table-meridiem,.picker-table-number{position:relative;width:20%}.arrow{position:absolute;left:50%;border:solid #777;border-width:0 .2rem .2rem 0;display:inline-block;padding:.25rem;cursor:pointer}.arrow.up{top:-1rem;transform:translateX(-50%) rotate(-135deg)}.arrow.down{bottom:-1rem;transform:translateX(-50%) rotate(45deg)}.arrow:hover{border-color:#1975d2}.picker-table-separator{width:calc(20% / 3)}.picker-footer{display:flex;justify-content:center;width:100%;cursor:pointer}.picker-footer .picker-action{width:25%;text-align:center}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear:before,.picker-footer .action-close:before,.picker-footer .action-confirm:before,.picker-footer .action-now:before{content:" ";position:relative;display:inline-block;height:0;width:0}.picker-footer .action-now:before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-confirm:before{width:1rem;height:1rem;border-radius:100%;background-color:#00b5ad}.picker-footer .action-clear:before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close:before{width:1rem;height:1rem;background:linear-gradient(180deg,transparent 35%,#777 0,#777 65%,transparent 0),linear-gradient(90deg,transparent 35%,#777 0,#777 65%,transparent 0);transform:rotate(45deg)}']}]}],Me.ctorParameters=function(){return[]},Me.propDecorators={initTime:[{type:t.Input}],showSecond:[{type:t.Input}],viewFormat:[{type:t.Input}],use12Hour:[{type:t.Input}],returnObject:[{type:t.Input}],onSelectTime:[{type:t.Output}],onTimePickerCancel:[{type:t.Output}]};var Ae=function(){function e(){this.onOverlayClick=new t.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.closeModal=function(){this.onOverlayClick.emit(!1)},e}();Ae.decorators=[{type:t.Component,args:[{selector:"picker-modal",template:'<section class="x-modal">\n <section class="modal-overlay" (click)="closeModal()"></section>\n <section class="modal-main" id="section-modal-main">\n <ng-content></ng-content>\n </section>\n</section>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,animations:[],styles:[":host{z-index:9999999999}*,:after,:before{box-sizing:border-box}.modal-main{position:absolute;left:19.6%;right:auto;top:auto;z-index:111;background-color:#fff;border:1px solid #d7dad7;border-radius:6px;transform:translate(-50%);box-shadow:0 5px 15px rgba(0,0,0,.3)}"]}]}],Ae.ctorParameters=function(){return[]},Ae.propDecorators={onOverlayClick:[{type:t.Output}]};var Se=function(){function e(){}return e.prototype.transform=function(e,t){return t?e.format(t):e.format("MMM DD, YYYY")},e}();Se.decorators=[{type:t.Pipe,args:[{name:"moment"}]}];var _e=b,Ie=function(){function e(){this.showDate=!0,this.showTime=!1,this.showWeeks=!1,this.weeks=[2,4,6,8,12,16,24],this.onDateChange=new t.EventEmitter,this.showDatePicker=!1,this.showTimePicker=!1,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){},e.prototype.weeksSelected=function(e){var t=new Date,n=t.setDate(t.getDate()+7*e);this.value=_e(n).format()},e.prototype.setDate=function(e){this.value=e&&""!==e?_e(e).format():e},e.prototype.setTime=function(e){this.value=e&&""!==e?_e(e).format():e},e.prototype.toggleDatePicker=function(e){this.showDatePicker=e},e.prototype.toggleTimePicker=function(e){this.showTimePicker=e},Object.defineProperty(e.prototype,"value",{get:function(){return this.modelValue},set:function(e){this.modelValue=e,this.onDateChange.emit(e),this.onChange(e),this.onTouched()},enumerable:!1,configurable:!0}),e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.writeValue=function(e){e instanceof Date?this.value=_e(e).format():this.value=e},e}();Ie.decorators=[{type:t.Component,args:[{selector:"date-time-picker",template:'<div class="row">\n <div *ngIf="!showTime" class="col-xs-12 col-md-12">\n <input\n *ngIf="!showWeeks"\n type="text"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div *ngIf="showWeeks" class="input-group">\n <input\n type="text"\n class="form-control"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div class="input-group-btn">\n <button\n type="button"\n class="btn btn-default dropdown-toggle"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false"\n >\n Weeks <span class="caret"></span>\n </button>\n <ul class="dropdown-menu up">\n <li (click)="weeksSelected(count)" *ngFor="let count of weeks">\n <span> {{ count }} Weeks</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div *ngIf="showTime" class="col-xs-8 col-md-8">\n <input\n *ngIf="!showWeeks"\n type="text"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div *ngIf="showWeeks" class="input-group">\n <input\n type="text"\n class="form-control"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div class="input-group-btn">\n <button\n type="button"\n class="btn btn-default dropdown-toggle"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false"\n >\n Weeks <span class="caret"></span>\n </button>\n <ul class="dropdown-menu up">\n <li (click)="weeksSelected(count)" *ngFor="let count of weeks">\n <span> {{ count }} Weeks</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div *ngIf="showTime" class="col-xs-4 col-md-4">\n <input\n type="text"\n class="form-control"\n [value]="value | date: \'shortTime\'"\n (focus)="toggleTimePicker(true)"\n readonly\n placeholder="Select Time"\n />\n </div>\n</div>\n<date-picker\n *ngIf="showDatePicker"\n [initDate]="value"\n (onSelectDate)="setDate($event)"\n (onDatePickerCancel)="toggleDatePicker($event)"\n></date-picker>\n\n<time-picker\n *ngIf="showTimePicker"\n [initTime]="value"\n [use12Hour]="true"\n (onSelectTime)="setTime($event)"\n (onTimePickerCancel)="toggleTimePicker($event)"\n></time-picker>\n',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Ie})),multi:!0}],styles:["input[readonly]{background-color:#fff}.up{bottom:100%!important;top:auto!important}.glyphicon{top:1px}"]}]}],Ie.ctorParameters=function(){return[]},Ie.propDecorators={modelValue:[{type:t.Input}],showDate:[{type:t.Input}],showTime:[{type:t.Input}],showWeeks:[{type:t.Input}],weeks:[{type:t.Input}],onDateChange:[{type:t.Output}]};var Pe=function(){};Pe.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,r.FormsModule],declarations:[Oe,Me,Ae,Se,Ie],exports:[Oe,Me,Ae,Se,Ie],providers:[]}]}];var Ee=b,Ve=function(){function e(){this.value="",this.isDisabled=!1,this.id="",this.onChange=function(e){},this.onTouch=function(){}}return e.prototype.onInput=function(e){this.onTouch(),this.onChange(Ee(e.value).format())},e.prototype.writeValue=function(e){this.value=e&&""!==e?Ee(e).format():""},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouch=e},e.prototype.setDisabledState=function(e){this.isDisabled=e},e}();Ve.decorators=[{type:t.Component,args:[{selector:"ngx-datetimepicker",template:'<div data-date-picker data-date-picker-type="single" class="bx--date-picker bx--date-picker--single">\n <div class="bx--date-picker-container">\n <div class="bx--date-picker-input__wrapper">\n <input [disabled]="isDisabled" (dateTimeChange)="onInput($event)" type="text" class="bx--date-picker__input" [id]="id" [value]="value" [owlDateTime]="dt1"\n [owlDateTimeTrigger]="dt1" placeholder="mm/dd/yyyy" data-date-picker-input />\n <svg focusable="false" preserveAspectRatio="xMidYMid meet" style="will-change: transform;"\n xmlns="http://www.w3.org/2000/svg" data-date-picker-icon="true" class="bx--date-picker__icon" width="16"\n height="16" viewBox="0 0 16 16" aria-hidden="true">\n <path\n d="M13,2h-2V1h-1v1H6V1H5v1H3C2.4,2,2,2.4,2,3v10c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1V3C14,2.4,13.6,2,13,2z M13,13H3V6h10V13z M13,5H3V3h2v1h1V3h4v1h1V3h2V5z">\n </path>\n </svg>\n </div>\n </div>\n</div>\n<owl-date-time [disabled]="isDisabled" #dt1></owl-date-time>',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Ve})),multi:!0}],styles:[""]}]}],Ve.propDecorators={id:[{type:t.Input}]};var qe=function(){function e(e){this.changeDetector=e,this.stateChanges=i.Subscription.EMPTY}return Object.defineProperty(e.prototype,"disabled",{get:function(){return void 0===this._disabled?this.dtPicker.disabled:!!this._disabled},set:function(e){this._disabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTTriggerDisabledClass",{get:function(){return this.disabled},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){e.datepicker&&this.watchStateChanges()},e.prototype.ngAfterContentInit=function(){this.watchStateChanges()},e.prototype.ngOnDestroy=function(){this.stateChanges.unsubscribe()},e.prototype.handleClickOnHost=function(e){this.dtPicker&&(this.dtPicker.open(),e.stopPropagation())},e.prototype.watchStateChanges=function(){var e=this;this.stateChanges.unsubscribe();var t=this.dtPicker&&this.dtPicker.dtInput?this.dtPicker.dtInput.disabledChange:i.of(),n=this.dtPicker?this.dtPicker.disabledChange:i.of();this.stateChanges=i.merge(n,t).subscribe((function(){e.changeDetector.markForCheck()}))},e}();qe.decorators=[{type:t.Directive,args:[{selector:"[owlDateTimeTrigger]",host:{"(click)":"handleClickOnHost($event)","[class.owl-dt-trigger-disabled]":"owlDTTriggerDisabledClass"}}]}],qe.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},qe.propDecorators={dtPicker:[{type:t.Input,args:["owlDateTimeTrigger"]}],disabled:[{type:t.Input}]};var Fe=function(){this.changes=new i.Subject,this.upSecondLabel="Add a second",this.downSecondLabel="Minus a second",this.upMinuteLabel="Add a minute",this.downMinuteLabel="Minus a minute",this.upHourLabel="Add a hour",this.downHourLabel="Minus a hour",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 21 years",this.nextMultiYearLabel="Next 21 years",this.switchToMonthViewLabel="Change to month view",this.switchToMultiYearViewLabel="Choose month and year",this.cancelBtnLabel="Cancel",this.setBtnLabel="Set",this.rangeFromLabel="From",this.rangeToLabel="To",this.hour12AMLabel="AM",this.hour12PMLabel="PM"};Fe.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new Fe},token:Fe,providedIn:"root"}),Fe.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var je=new t.InjectionToken("OWL_DATE_TIME_LOCALE",{providedIn:"root",factory:Re});function Re(){return t.inject(t.LOCALE_ID)}t.LOCALE_ID;var Ne=function(){function e(){this._localeChanges=new i.Subject,this.millisecondsInDay=864e5,this.milliseondsInMinute=6e4}return Object.defineProperty(e.prototype,"localeChanges",{get:function(){return this._localeChanges},enumerable:!1,configurable:!0}),e.prototype.compare=function(e,t){if(!this.isValid(e)||!this.isValid(t))throw Error("JSNativeDate: Cannot compare invalid dates.");var n=this.clone(e),r=this.clone(t),i=this.getTime(n)-this.getTime(r);return i<0?-1:i>0?1:i},e.prototype.compareYear=function(e,t){if(!this.isValid(e)||!this.isValid(t))throw Error("JSNativeDate: Cannot compare invalid dates.");var n=this.getYear(e)-this.getYear(t);return n<0?-1:n>0?1:0},e.prototype.deserialize=function(e){return null==e||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()},e.prototype.setLocale=function(e){this.locale=e,this._localeChanges.next()},e.prototype.clampDate=function(e,t,n){return t&&this.compare(e,t)<0?t:n&&this.compare(e,n)>0?n:e},e}(),He=new t.InjectionToken("OWL_DATE_TIME_FORMATS"),Le=function(){function e(e,n,r,o,a,s){var l=this;this.elmRef=e,this.pickerIntl=n,this.ngZone=r,this.cdRef=o,this.dateTimeAdapter=a,this.dateTimeFormats=s,this.firstDayOfWeek=0,this._selecteds=[],this.startView="month",this.pickerMomentChange=new t.EventEmitter,this.selectedChange=new t.EventEmitter,this.userSelection=new t.EventEmitter,this.yearSelected=new t.EventEmitter,this.monthSelected=new t.EventEmitter,this.intlChangesSub=i.Subscription.EMPTY,this.moveFocusOnNextTick=!1,this.dateFilterForViews=function(e){return!!e&&(!l.dateFilter||l.dateFilter(e))&&(!l.minDate||l.dateTimeAdapter.compare(e,l.minDate)>=0)&&(!l.maxDate||l.dateTimeAdapter.compare(e,l.maxDate)<=0)},this.intlChangesSub=this.pickerIntl.changes.subscribe((function(){l.cdRef.markForCheck()}))}return Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),e=this.getValidDate(e),this._minDate=e?this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(e),this.dateTimeAdapter.getMonth(e),this.dateTimeAdapter.getDate(e)):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),e=this.getValidDate(e),this._maxDate=e?this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(e),this.dateTimeAdapter.getMonth(e),this.dateTimeAdapter.getDate(e)):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._selected=this.getValidDate(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){var t=this;this._selecteds=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),t.getValidDate(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"periodButtonText",{get:function(){return this.isMonthView?this.dateTimeAdapter.format(this.pickerMoment,this.dateTimeFormats.monthYearLabel):this.dateTimeAdapter.getYearName(this.pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"periodButtonLabel",{get:function(){return this.isMonthView?this.pickerIntl.switchToMultiYearViewLabel:this.pickerIntl.switchToMonthViewLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prevButtonLabel",{get:function(){return"month"===this._currentView?this.pickerIntl.prevMonthLabel:"year"===this._currentView?this.pickerIntl.prevYearLabel:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextButtonLabel",{get:function(){return"month"===this._currentView?this.pickerIntl.nextMonthLabel:"year"===this._currentView?this.pickerIntl.nextYearLabel:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentView",{get:function(){return this._currentView},set:function(e){this._currentView=e,this.moveFocusOnNextTick=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showControlArrows",{get:function(){return"multi-years"!==this._currentView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMonthView",{get:function(){return"month"===this._currentView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarClass",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.ngAfterContentInit=function(){this._currentView=this.startView},e.prototype.ngAfterViewChecked=function(){this.moveFocusOnNextTick&&(this.moveFocusOnNextTick=!1,this.focusActiveCell())},e.prototype.ngOnDestroy=function(){this.intlChangesSub.unsubscribe()},e.prototype.toggleViews=function(){this.currentView="month"===this._currentView?"multi-years":"month"},e.prototype.previousClicked=function(){this.pickerMoment=this.isMonthView?this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-1):this.dateTimeAdapter.addCalendarYears(this.pickerMoment,-1),this.pickerMomentChange.emit(this.pickerMoment)},e.prototype.nextClicked=function(){this.pickerMoment=this.isMonthView?this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,1):this.dateTimeAdapter.addCalendarYears(this.pickerMoment,1),this.pickerMomentChange.emit(this.pickerMoment)},e.prototype.dateSelected=function(e){this.dateFilterForViews(e)&&this.selectedChange.emit(e)},e.prototype.goToDateInView=function(e,t){this.handlePickerMomentChange(e),this.currentView=t},e.prototype.handlePickerMomentChange=function(e){this.pickerMoment=this.dateTimeAdapter.clampDate(e,this.minDate,this.maxDate),this.pickerMomentChange.emit(this.pickerMoment)},e.prototype.userSelected=function(){this.userSelection.emit()},e.prototype.prevButtonEnabled=function(){return!this.minDate||!this.isSameView(this.pickerMoment,this.minDate)},e.prototype.nextButtonEnabled=function(){return!this.maxDate||!this.isSameView(this.pickerMoment,this.maxDate)},e.prototype.focusActiveCell=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.ngZone.onStable.asObservable().pipe(f.take(1)).subscribe((function(){e.elmRef.nativeElement.querySelector(".owl-dt-calendar-cell-active").focus()}))}))},e.prototype.selectYearInMultiYearView=function(e){this.yearSelected.emit(e)},e.prototype.selectMonthInYearView=function(e){this.monthSelected.emit(e)},e.prototype.isSameView=function(e,t){return"month"===this._currentView?!(!e||!t||this.dateTimeAdapter.getYear(e)!==this.dateTimeAdapter.getYear(t)||this.dateTimeAdapter.getMonth(e)!==this.dateTimeAdapter.getMonth(t)):"year"===this._currentView&&!(!e||!t||this.dateTimeAdapter.getYear(e)!==this.dateTimeAdapter.getYear(t))},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e}();Le.decorators=[{type:t.Component,args:[{selector:"owl-date-time-calendar",exportAs:"owlDateTimeCalendar",template:'<div class="owl-dt-calendar-control">\n \x3c!-- focus when keyboard tab (http://kizu.ru/en/blog/keyboard-only-focus/#x) --\x3e\n <button class="owl-dt-control owl-dt-control-button owl-dt-control-arrow-button"\n type="button" tabindex="0"\n [style.visibility]="showControlArrows? \'visible\': \'hidden\'"\n [disabled]="!prevButtonEnabled()"\n [attr.aria-label]="prevButtonLabel"\n (click)="previousClicked()">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Left"> --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n version="1.1" x="0px" y="0px" viewBox="0 0 250.738 250.738"\n style="enable-background:new 0 0 250.738 250.738;" xml:space="preserve"\n width="100%" height="100%">\n <path style="fill-rule: evenodd; clip-rule: evenodd;" d="M96.633,125.369l95.053-94.533c7.101-7.055,7.101-18.492,0-25.546 c-7.1-7.054-18.613-7.054-25.714,0L58.989,111.689c-3.784,3.759-5.487,8.759-5.238,13.68c-0.249,4.922,1.454,9.921,5.238,13.681 l106.983,106.398c7.101,7.055,18.613,7.055,25.714,0c7.101-7.054,7.101-18.491,0-25.544L96.633,125.369z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n </button>\n <div class="owl-dt-calendar-control-content">\n <button class="owl-dt-control owl-dt-control-button owl-dt-control-period-button"\n type="button" tabindex="0"\n [attr.aria-label]="periodButtonLabel"\n (click)="toggleViews()">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n {{periodButtonText}}\n\n <span class="owl-dt-control-button-arrow"\n [style.transform]="\'rotate(\' + (isMonthView? 0 : 180) +\'deg)\'">\n \x3c!-- <editor-fold desc="SVG Arrow"> --\x3e\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n width="50%" height="50%" viewBox="0 0 292.362 292.362" style="enable-background:new 0 0 292.362 292.362;"\n xml:space="preserve">\n <g>\n <path d="M286.935,69.377c-3.614-3.617-7.898-5.424-12.848-5.424H18.274c-4.952,0-9.233,1.807-12.85,5.424\n C1.807,72.998,0,77.279,0,82.228c0,4.948,1.807,9.229,5.424,12.847l127.907,127.907c3.621,3.617,7.902,5.428,12.85,5.428\n s9.233-1.811,12.847-5.428L286.935,95.074c3.613-3.617,5.427-7.898,5.427-12.847C292.362,77.279,290.548,72.998,286.935,69.377z"/>\n </g>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n </span>\n </button>\n </div>\n <button class="owl-dt-control owl-dt-control-button owl-dt-control-arrow-button"\n type="button" tabindex="0"\n [style.visibility]="showControlArrows? \'visible\': \'hidden\'"\n [disabled]="!nextButtonEnabled()"\n [attr.aria-label]="nextButtonLabel"\n (click)="nextClicked()">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Right"> --\x3e\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 250.738 250.738" style="enable-background:new 0 0 250.738 250.738;" xml:space="preserve">\n <path style="fill-rule:evenodd;clip-rule:evenodd;" d="M191.75,111.689L84.766,5.291c-7.1-7.055-18.613-7.055-25.713,0\n c-7.101,7.054-7.101,18.49,0,25.544l95.053,94.534l-95.053,94.533c-7.101,7.054-7.101,18.491,0,25.545\n c7.1,7.054,18.613,7.054,25.713,0L191.75,139.05c3.784-3.759,5.487-8.759,5.238-13.681\n C197.237,120.447,195.534,115.448,191.75,111.689z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n </button>\n</div>\n<div class="owl-dt-calendar-main" cdkMonitorSubtreeFocus [ngSwitch]="currentView" tabindex="-1">\n <owl-date-time-month-view\n *ngSwitchCase="\'month\'"\n [pickerMoment]="pickerMoment"\n [firstDayOfWeek]="firstDayOfWeek"\n [selected]="selected"\n [selecteds]="selecteds"\n [selectMode]="selectMode"\n [minDate]="minDate"\n [maxDate]="maxDate"\n [dateFilter]="dateFilter"\n [hideOtherMonths]="hideOtherMonths"\n (pickerMomentChange)="handlePickerMomentChange($event)"\n (selectedChange)="dateSelected($event)"\n (userSelection)="userSelected()"></owl-date-time-month-view>\n\n <owl-date-time-year-view\n *ngSwitchCase="\'year\'"\n [pickerMoment]="pickerMoment"\n [selected]="selected"\n [selecteds]="selecteds"\n [selectMode]="selectMode"\n [minDate]="minDate"\n [maxDate]="maxDate"\n [dateFilter]="dateFilter"\n (keyboardEnter)="focusActiveCell()"\n (pickerMomentChange)="handlePickerMomentChange($event)"\n (monthSelected)="selectMonthInYearView($event)"\n (change)="goToDateInView($event, \'month\')"></owl-date-time-year-view>\n\n <owl-date-time-multi-year-view\n *ngSwitchCase="\'multi-years\'"\n [pickerMoment]="pickerMoment"\n [selected]="selected"\n [selecteds]="selecteds"\n [selectMode]="selectMode"\n [minDate]="minDate"\n [maxDate]="maxDate"\n [dateFilter]="dateFilter"\n (keyboardEnter)="focusActiveCell()"\n (pickerMomentChange)="handlePickerMomentChange($event)"\n (yearSelected)="selectYearInMultiYearView($event)"\n (change)="goToDateInView($event, \'year\')"></owl-date-time-multi-year-view>\n</div>\n',host:{"[class.owl-dt-calendar]":"owlDTCalendarClass"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],Le.ctorParameters=function(){return[{type:t.ElementRef},{type:Fe},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:Ne,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[He]}]}]},Le.propDecorators={minDate:[{type:t.Input}],maxDate:[{type:t.Input}],pickerMoment:[{type:t.Input}],selected:[{type:t.Input}],selecteds:[{type:t.Input}],dateFilter:[{type:t.Input}],firstDayOfWeek:[{type:t.Input}],selectMode:[{type:t.Input}],startView:[{type:t.Input}],hideOtherMonths:[{type:t.Input}],pickerMomentChange:[{type:t.Output}],selectedChange:[{type:t.Output}],userSelection:[{type:t.Output}],yearSelected:[{type:t.Output}],monthSelected:[{type:t.Output}]};var Ye=function(){function e(e,n,r,i,o){this.ngZone=e,this.elmRef=n,this.pickerIntl=r,this.cdRef=i,this.dateTimeAdapter=o,this.isPM=!1,this.stepHour=1,this.stepMinute=1,this.stepSecond=1,this.selectedChange=new t.EventEmitter}return Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDateTime",{get:function(){return this._minDateTime},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._minDateTime=this.getValidDate(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDateTime",{get:function(){return this._maxDateTime},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._maxDateTime=this.getValidDate(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hourValue",{get:function(){return this.dateTimeAdapter.getHours(this.pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hourBoxValue",{get:function(){var e=this.hourValue;return this.hour12Timer?(0===e?(e=12,this.isPM=!1):e>0&&e<12?this.isPM=!1:12===e?this.isPM=!0:e>12&&e<24&&(e-=12,this.isPM=!0),e):e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minuteValue",{get:function(){return this.dateTimeAdapter.getMinutes(this.pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secondValue",{get:function(){return this.dateTimeAdapter.getSeconds(this.pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"upHourButtonLabel",{get:function(){return this.pickerIntl.upHourLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"downHourButtonLabel",{get:function(){return this.pickerIntl.downHourLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"upMinuteButtonLabel",{get:function(){return this.pickerIntl.upMinuteLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"downMinuteButtonLabel",{get:function(){return this.pickerIntl.downMinuteLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"upSecondButtonLabel",{get:function(){return this.pickerIntl.upSecondLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"downSecondButtonLabel",{get:function(){return this.pickerIntl.downSecondLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hour12ButtonLabel",{get:function(){return this.isPM?this.pickerIntl.hour12PMLabel:this.pickerIntl.hour12AMLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTTimerClass",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTTimeTabIndex",{get:function(){return-1},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.focus=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.ngZone.onStable.asObservable().pipe(f.take(1)).subscribe((function(){e.elmRef.nativeElement.focus()}))}))},e.prototype.setHourValueViaInput=function(e){this.hour12Timer&&this.isPM&&e>=1&&e<=11?e+=12:this.hour12Timer&&!this.isPM&&12===e&&(e=0),this.setHourValue(e)},e.prototype.setHourValue=function(e){var t=this.dateTimeAdapter.setHours(this.pickerMoment,e);this.selectedChange.emit(t),this.cdRef.markForCheck()},e.prototype.setMinuteValue=function(e){var t=this.dateTimeAdapter.setMinutes(this.pickerMoment,e);this.selectedChange.emit(t),this.cdRef.markForCheck()},e.prototype.setSecondValue=function(e){var t=this.dateTimeAdapter.setSeconds(this.pickerMoment,e);this.selectedChange.emit(t),this.cdRef.markForCheck()},e.prototype.setMeridiem=function(e){this.isPM=!this.isPM;var t=this.hourValue;this.isPM?t+=12:t-=12,t>=0&&t<=23&&this.setHourValue(t),this.cdRef.markForCheck(),e.preventDefault()},e.prototype.upHourEnabled=function(){return!this.maxDateTime||this.compareHours(this.stepHour,this.maxDateTime)<1},e.prototype.downHourEnabled=function(){return!this.minDateTime||this.compareHours(-this.stepHour,this.minDateTime)>-1},e.prototype.upMinuteEnabled=function(){return!this.maxDateTime||this.compareMinutes(this.stepMinute,this.maxDateTime)<1},e.prototype.downMinuteEnabled=function(){return!this.minDateTime||this.compareMinutes(-this.stepMinute,this.minDateTime)>-1},e.prototype.upSecondEnabled=function(){return!this.maxDateTime||this.compareSeconds(this.stepSecond,this.maxDateTime)<1},e.prototype.downSecondEnabled=function(){return!this.minDateTime||this.compareSeconds(-this.stepSecond,this.minDateTime)>-1},e.prototype.compareHours=function(e,t){var n=this.dateTimeAdapter.getHours(this.pickerMoment)+e,r=this.dateTimeAdapter.setHours(this.pickerMoment,n);return this.dateTimeAdapter.compare(r,t)},e.prototype.compareMinutes=function(e,t){var n=this.dateTimeAdapter.getMinutes(this.pickerMoment)+e,r=this.dateTimeAdapter.setMinutes(this.pickerMoment,n);return this.dateTimeAdapter.compare(r,t)},e.prototype.compareSeconds=function(e,t){var n=this.dateTimeAdapter.getSeconds(this.pickerMoment)+e,r=this.dateTimeAdapter.setSeconds(this.pickerMoment,n);return this.dateTimeAdapter.compare(r,t)},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e}();Ye.decorators=[{type:t.Component,args:[{exportAs:"owlDateTimeTimer",selector:"owl-date-time-timer",template:'<owl-date-time-timer-box\n [upBtnAriaLabel]="upHourButtonLabel"\n [downBtnAriaLabel]="downHourButtonLabel"\n [upBtnDisabled]="!upHourEnabled()"\n [downBtnDisabled]="!downHourEnabled()"\n [boxValue]="hourBoxValue"\n [value]="hourValue" [min]="0" [max]="23"\n [step]="stepHour" [inputLabel]="\'Hour\'"\n (inputChange)="setHourValueViaInput($event)"\n (valueChange)="setHourValue($event)"></owl-date-time-timer-box>\n<owl-date-time-timer-box\n [showDivider]="true"\n [upBtnAriaLabel]="upMinuteButtonLabel"\n [downBtnAriaLabel]="downMinuteButtonLabel"\n [upBtnDisabled]="!upMinuteEnabled()"\n [downBtnDisabled]="!downMinuteEnabled()"\n [value]="minuteValue" [min]="0" [max]="59"\n [step]="stepMinute" [inputLabel]="\'Minute\'"\n (inputChange)="setMinuteValue($event)"\n (valueChange)="setMinuteValue($event)"></owl-date-time-timer-box>\n<owl-date-time-timer-box\n *ngIf="showSecondsTimer"\n [showDivider]="true"\n [upBtnAriaLabel]="upSecondButtonLabel"\n [downBtnAriaLabel]="downSecondButtonLabel"\n [upBtnDisabled]="!upSecondEnabled()"\n [downBtnDisabled]="!downSecondEnabled()"\n [value]="secondValue" [min]="0" [max]="59"\n [step]="stepSecond" [inputLabel]="\'Second\'"\n (inputChange)="setSecondValue($event)"\n (valueChange)="setSecondValue($event)"></owl-date-time-timer-box>\n\n<div *ngIf="hour12Timer" class="owl-dt-timer-hour12">\n <button class="owl-dt-control-button owl-dt-timer-hour12-box"\n type="button" tabindex="0"\n (click)="setMeridiem($event)">\n <span class="owl-dt-control-button-content" tabindex="-1">\n {{hour12ButtonLabel}}\n </span>\n </button>\n</div>\n',preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,host:{"[class.owl-dt-timer]":"owlDTTimerClass","[attr.tabindex]":"owlDTTimeTabIndex"},styles:[""]}]}],Ye.ctorParameters=function(){return[{type:t.NgZone},{type:t.ElementRef},{type:Fe},{type:t.ChangeDetectorRef},{type:Ne,decorators:[{type:t.Optional}]}]},Ye.propDecorators={pickerMoment:[{type:t.Input}],minDateTime:[{type:t.Input}],maxDateTime:[{type:t.Input}],showSecondsTimer:[{type:t.Input}],hour12Timer:[{type:t.Input}],stepHour:[{type:t.Input}],stepMinute:[{type:t.Input}],stepSecond:[{type:t.Input}],selectedChange:[{type:t.Output}]};var Be={transformPicker:s.trigger("transformPicker",[s.state("void",s.style({opacity:0,transform:"scale(1, 0)"})),s.state("enter",s.style({opacity:1,transform:"scale(1, 1)"})),s.transition("void => enter",s.group([s.query("@fadeInPicker",s.animateChild(),{optional:!0}),s.animate("400ms cubic-bezier(0.25, 0.8, 0.25, 1)")])),s.transition("enter => void",s.animate("100ms linear",s.style({opacity:0})))]),fadeInPicker:s.trigger("fadeInPicker",[s.state("enter",s.style({opacity:1})),s.state("void",s.style({opacity:0})),s.transition("void => enter",s.animate("400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])},Qe=function(){function e(e,t,n,r){this.cdRef=e,this.elmRef=t,this.pickerIntl=n,this.dateTimeAdapter=r,this.activeSelectedIndex=0,this.hidePicker$=new i.Subject,this.confirmSelected$=new i.Subject,this.pickerOpened$=new i.Subject}return Object.defineProperty(e.prototype,"hidePickerStream",{get:function(){return this.hidePicker$.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"confirmSelectedStream",{get:function(){return this.confirmSelected$.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerOpenedStream",{get:function(){return this.pickerOpened$.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._clamPickerMoment},set:function(e){e&&(this._clamPickerMoment=this.dateTimeAdapter.clampDate(e,this.picker.minDateTime,this.picker.maxDateTime)),this.cdRef.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerType",{get:function(){return this.picker.pickerType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cancelLabel",{get:function(){return this.pickerIntl.cancelBtnLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setLabel",{get:function(){return this.pickerIntl.setBtnLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fromLabel",{get:function(){return this.pickerIntl.rangeFromLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toLabel",{get:function(){return this.pickerIntl.rangeToLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fromFormattedValue",{get:function(){var e=this.picker.selecteds[0];return e?this.dateTimeAdapter.format(e,this.picker.formatString):""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toFormattedValue",{get:function(){var e=this.picker.selecteds[1];return e?this.dateTimeAdapter.format(e,this.picker.formatString):""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showControlButtons",{get:function(){return"dialog"===this.picker.pickerMode||"calendar"!==this.picker.pickerType&&"inline"!==this.picker.pickerMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerElm",{get:function(){return this.elmRef.nativeElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTContainerClass",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTPopupContainerClass",{get:function(){return"popup"===this.picker.pickerMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTDialogContainerClass",{get:function(){return"dialog"===this.picker.pickerMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTInlineContainerClass",{get:function(){return"inline"===this.picker.pickerMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTContainerDisabledClass",{get:function(){return this.picker.disabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTContainerId",{get:function(){return this.picker.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTContainerAnimation",{get:function(){return"inline"===this.picker.pickerMode?"":"enter"},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.ngAfterContentInit=function(){this.initPicker()},e.prototype.ngAfterViewInit=function(){this.focusPicker()},e.prototype.handleContainerAnimationDone=function(e){"enter"===e.toState&&this.pickerOpened$.next()},e.prototype.dateSelected=function(e){var t;this.picker.isInSingleMode?(t=this.dateSelectedInSingleMode(e))?(this.pickerMoment=t,this.picker.select(t)):"calendar"===this.pickerType&&this.hidePicker$.next(null):this.picker.isInRangeMode&&(t=this.dateSelectedInRangeMode(e))&&(this.pickerMoment=t[this.activeSelectedIndex],this.picker.select(t))},e.prototype.timeSelected=function(e){if(this.pickerMoment=this.dateTimeAdapter.clone(e),this.picker.dateTimeChecker(this.pickerMoment))if(this.picker.isInSingleMode)this.picker.select(this.pickerMoment);else if(this.picker.isInRangeMode){var t=M(this.picker.selecteds);0===this.activeSelectedIndex&&t[1]&&1===this.dateTimeAdapter.compare(this.pickerMoment,t[1])||1===this.activeSelectedIndex&&t[0]&&-1===this.dateTimeAdapter.compare(this.pickerMoment,t[0])?(t[0]=this.pickerMoment,t[1]=this.pickerMoment):t[this.activeSelectedIndex]=this.pickerMoment,this.picker.select(t)}},e.prototype.onCancelClicked=function(e){this.hidePicker$.next(null),e.preventDefault()},e.prototype.onSetClicked=function(e){if(!this.picker.dateTimeChecker(this.pickerMoment))return this.hidePicker$.next(null),void e.preventDefault();this.confirmSelected$.next(e),e.preventDefault()},e.prototype.handleClickOnInfoGroup=function(e,t){this.setActiveSelectedIndex(t),e.preventDefault(),e.stopPropagation()},e.prototype.handleKeydownOnInfoGroup=function(e,t,n){switch(e.keyCode){case d.DOWN_ARROW:case d.RIGHT_ARROW:case d.UP_ARROW:case d.LEFT_ARROW:t.focus(),this.setActiveSelectedIndex(0===n?1:0),e.preventDefault(),e.stopPropagation();break;case d.SPACE:this.setActiveSelectedIndex(n),e.preventDefault(),e.stopPropagation();break;default:return}},e.prototype.setActiveSelectedIndex=function(e){if("range"===this.picker.selectMode&&this.activeSelectedIndex!==e){this.activeSelectedIndex=e;var t=this.picker.selecteds[this.activeSelectedIndex];this.picker.selecteds&&t&&(this.pickerMoment=this.dateTimeAdapter.clone(t))}},e.prototype.initPicker=function(){this.pickerMoment=this.picker.startAt||this.dateTimeAdapter.now(),this.activeSelectedIndex="rangeTo"===this.picker.selectMode?1:0},e.prototype.dateSelectedInSingleMode=function(e){return this.dateTimeAdapter.isSameDay(e,this.picker.selected)?null:this.updateAndCheckCalendarDate(e)},e.prototype.dateSelectedInRangeMode=function(e){var t=this.picker.selecteds[0],n=this.picker.selecteds[1],r=this.updateAndCheckCalendarDate(e);return r?("range"===this.picker.selectMode?this.picker.selecteds&&this.picker.selecteds.length&&!n&&t&&this.dateTimeAdapter.differenceInCalendarDays(r,t)>=0?(n=r,this.activeSelectedIndex=1):(t=r,n=null,this.activeSelectedIndex=0):"rangeFrom"===this.picker.selectMode?(t=r,n&&this.dateTimeAdapter.compare(t,n)>0&&(n=null)):"rangeTo"===this.picker.selectMode&&(n=r,t&&this.dateTimeAdapter.compare(t,n)>0&&(t=null)),[t,n]):null},e.prototype.updateAndCheckCalendarDate=function(e){var t;return"both"===this.picker.pickerType?(t=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(e),this.dateTimeAdapter.getMonth(e),this.dateTimeAdapter.getDate(e),this.dateTimeAdapter.getHours(this.pickerMoment),this.dateTimeAdapter.getMinutes(this.pickerMoment),this.dateTimeAdapter.getSeconds(this.pickerMoment)),t=this.dateTimeAdapter.clampDate(t,this.picker.minDateTime,this.picker.maxDateTime)):t=this.dateTimeAdapter.clone(e),this.picker.dateTimeChecker(t)?t:null},e.prototype.focusPicker=function(){"inline"!==this.picker.pickerMode&&(this.calendar?this.calendar.focusActiveCell():this.timer&&this.timer.focus())},e}();Qe.decorators=[{type:t.Component,args:[{exportAs:"owlDateTimeContainer",selector:"owl-date-time-container",template:'<div [cdkTrapFocus]="picker.pickerMode !== \'inline\'"\n [@fadeInPicker]="picker.pickerMode === \'inline\'? \'\' : \'enter\'"\n class="owl-dt-container-inner">\n\n <owl-date-time-calendar\n *ngIf="pickerType === \'both\' || pickerType === \'calendar\'"\n class="owl-dt-container-row"\n [firstDayOfWeek]="picker.firstDayOfWeek"\n [(pickerMoment)]="pickerMoment"\n [selected]="picker.selected"\n [selecteds]="picker.selecteds"\n [selectMode]="picker.selectMode"\n [minDate]="picker.minDateTime"\n [maxDate]="picker.maxDateTime"\n [dateFilter]="picker.dateTimeFilter"\n [startView]="picker.startView"\n [hideOtherMonths]="picker.hideOtherMonths"\n (yearSelected)="picker.selectYear($event)"\n (monthSelected)="picker.selectMonth($event)"\n (selectedChange)="dateSelected($event)"></owl-date-time-calendar>\n\n <owl-date-time-timer\n *ngIf="pickerType === \'both\' || pickerType === \'timer\'"\n class="owl-dt-container-row"\n [pickerMoment]="pickerMoment"\n [minDateTime]="picker.minDateTime"\n [maxDateTime]="picker.maxDateTime"\n [showSecondsTimer]="picker.showSecondsTimer"\n [hour12Timer]="picker.hour12Timer"\n [stepHour]="picker.stepHour"\n [stepMinute]="picker.stepMinute"\n [stepSecond]="picker.stepSecond"\n (selectedChange)="timeSelected($event)"></owl-date-time-timer>\n\n <div *ngIf="picker.isInRangeMode"\n role="radiogroup"\n class="owl-dt-container-info owl-dt-container-row">\n <div role="radio" [tabindex]="activeSelectedIndex === 0 ? 0 : -1"\n [attr.aria-checked]="activeSelectedIndex === 0"\n class="owl-dt-control owl-dt-container-range owl-dt-container-from"\n [ngClass]="{\'owl-dt-container-info-active\': activeSelectedIndex === 0}"\n (click)="handleClickOnInfoGroup($event, 0)"\n (keydown)="handleKeydownOnInfoGroup($event, to, 0)" #from>\n <span class="owl-dt-control-content owl-dt-container-range-content" tabindex="-1">\n <span class="owl-dt-container-info-label">{{fromLabel}}:</span>\n <span class="owl-dt-container-info-value">{{fromFormattedValue}}</span>\n </span>\n </div>\n <div role="radio" [tabindex]="activeSelectedIndex === 1 ? 0 : -1"\n [attr.aria-checked]="activeSelectedIndex === 1"\n class="owl-dt-control owl-dt-container-range owl-dt-container-to"\n [ngClass]="{\'owl-dt-container-info-active\': activeSelectedIndex === 1}"\n (click)="handleClickOnInfoGroup($event, 1)"\n (keydown)="handleKeydownOnInfoGroup($event, from, 1)" #to>\n <span class="owl-dt-control-content owl-dt-container-range-content" tabindex="-1">\n <span class="owl-dt-container-info-label">{{toLabel}}:</span>\n <span class="owl-dt-container-info-value">{{toFormattedValue}}</span>\n </span>\n </div>\n </div>\n\n <div *ngIf="showControlButtons" class="owl-dt-container-buttons owl-dt-container-row">\n <button class="owl-dt-control owl-dt-control-button owl-dt-container-control-button"\n type="button" tabindex="0"\n (click)="onCancelClicked($event)">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n {{cancelLabel}}\n </span>\n </button>\n <button class="owl-dt-control owl-dt-control-button owl-dt-container-control-button"\n type="button" tabindex="0"\n (click)="onSetClicked($event)">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n {{setLabel}}\n </span>\n </button>\n </div>\n</div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,animations:[Be.transformPicker,Be.fadeInPicker],host:{"(@transformPicker.done)":"handleContainerAnimationDone($event)","[class.owl-dt-container]":"owlDTContainerClass","[class.owl-dt-popup-container]":"owlDTPopupContainerClass","[class.owl-dt-dialog-container]":"owlDTDialogContainerClass","[class.owl-dt-inline-container]":"owlDTInlineContainerClass","[class.owl-dt-container-disabled]":"owlDTContainerDisabledClass","[attr.id]":"owlDTContainerId","[@transformPicker]":"owlDTContainerAnimation"},styles:[""]}]}],Qe.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:t.ElementRef},{type:Fe},{type:Ne,decorators:[{type:t.Optional}]}]},Qe.propDecorators={calendar:[{type:t.ViewChild,args:[Le,{static:!1}]}],timer:[{type:t.ViewChild,args:[Ye,{static:!1}]}]};var Ge=0,ze=function(){function e(e,t){var n=this;if(this.dateTimeAdapter=e,this.dateTimeFormats=t,this._showSecondsTimer=!1,this._hour12Timer=!1,this.startView="month",this._stepHour=1,this._stepMinute=1,this._stepSecond=1,this._firstDayOfWeek=0,this._hideOtherMonths=!1,this.dateTimeChecker=function(e){return!!e&&(!n.dateTimeFilter||n.dateTimeFilter(e))&&(!n.minDateTime||n.dateTimeAdapter.compare(e,n.minDateTime)>=0)&&(!n.maxDateTime||n.dateTimeAdapter.compare(e,n.maxDateTime)<=0)},!this.dateTimeAdapter)throw Error("OwlDateTimePicker: No provider found for DateTimeAdapter. You must import one of the following modules at your application root: OwlNativeDateTimeModule, OwlMomentDateTimeModule, or provide a custom implementation.");if(!this.dateTimeFormats)throw Error("OwlDateTimePicker: No provider found for OWL_DATE_TIME_FORMATS. You must import one of the following modules at your application root: OwlNativeDateTimeModule, OwlMomentDateTimeModule, or provide a custom implementation.");this._id="owl-dt-picker-"+Ge++}return Object.defineProperty(e.prototype,"showSecondsTimer",{get:function(){return this._showSecondsTimer},set:function(e){this._showSecondsTimer=h.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hour12Timer",{get:function(){return this._hour12Timer},set:function(e){this._hour12Timer=h.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stepHour",{get:function(){return this._stepHour},set:function(e){this._stepHour=h.coerceNumberProperty(e,1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stepMinute",{get:function(){return this._stepMinute},set:function(e){this._stepMinute=h.coerceNumberProperty(e,1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stepSecond",{get:function(){return this._stepSecond},set:function(e){this._stepSecond=h.coerceNumberProperty(e,1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstDayOfWeek",{get:function(){return this._firstDayOfWeek},set:function(e){e=h.coerceNumberProperty(e,0),this._firstDayOfWeek=e>6||e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hideOtherMonths",{get:function(){return this._hideOtherMonths},set:function(e){this._hideOtherMonths=h.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formatString",{get:function(){return"both"===this.pickerType?this.dateTimeFormats.fullPickerInput:"calendar"===this.pickerType?this.dateTimeFormats.datePickerInput:this.dateTimeFormats.timePickerInput},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e}();ze.decorators=[{type:t.Injectable}],ze.ctorParameters=function(){return[{type:Ne,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[He]}]}]},ze.propDecorators={showSecondsTimer:[{type:t.Input}],hour12Timer:[{type:t.Input}],stepHour:[{type:t.Input}],stepMinute:[{type:t.Input}],stepSecond:[{type:t.Input}],firstDayOfWeek:[{type:t.Input}],hideOtherMonths:[{type:t.Input}],startView:[{type:t.Input}]};var We=0,Ue=function(){this.ariaDescribedBy=null,this.autoFocus=!0,this.hasBackdrop=!0,this.data=null,this.disableClose=!1,this.role="dialog",this.paneClass="",this.event=null,this.backdropClass="",this.closeOnNavigation=!0,this.width="",this.height="",this.maxWidth="85vw",this.scrollStrategy=new u.NoopScrollStrategy,this.id="owl-dialog-"+We++},$e=function(){function e(e,t,n,r){var o=this;this.overlayRef=e,this.container=t,this.id=n,this._beforeClose$=new i.Subject,this._afterOpen$=new i.Subject,this._afterClosed$=new i.Subject,this.locationChanged=i.Subscription.EMPTY,this.disableClose=this.container.config.disableClose,this.container.animationStateChanged.pipe(f.filter((function(e){return"done"===e.phaseName&&"enter"===e.toState})),f.take(1)).subscribe((function(){o._afterOpen$.next(),o._afterOpen$.complete()})),this.container.animationStateChanged.pipe(f.filter((function(e){return"done"===e.phaseName&&"exit"===e.toState})),f.take(1)).subscribe((function(){o.overlayRef.dispose(),o.locationChanged.unsubscribe(),o._afterClosed$.next(o.result),o._afterClosed$.complete(),o.componentInstance=null})),this.overlayRef.keydownEvents().pipe(f.filter((function(e){return e.keyCode===d.ESCAPE&&!o.disableClose}))).subscribe((function(){return o.close()})),r&&(this.locationChanged=r.subscribe((function(){o.container.config.closeOnNavigation&&o.close()})))}return e.prototype.close=function(e){var t=this;this.result=e,this.container.animationStateChanged.pipe(f.filter((function(e){return"start"===e.phaseName})),f.take(1)).subscribe((function(){t._beforeClose$.next(e),t._beforeClose$.complete(),t.overlayRef.detachBackdrop()})),this.container.startExitAnimation()},e.prototype.backdropClick=function(){return this.overlayRef.backdropClick()},e.prototype.keydownEvents=function(){return this.overlayRef.keydownEvents()},e.prototype.updatePosition=function(e){var t=this.getPositionStrategy();return e&&(e.left||e.right)?e.left?t.left(e.left):t.right(e.right):t.centerHorizontally(),e&&(e.top||e.bottom)?e.top?t.top(e.top):t.bottom(e.bottom):t.centerVertically(),this.overlayRef.updatePosition(),this},e.prototype.updateSize=function(e,t){return void 0===e&&(e="auto"),void 0===t&&(t="auto"),this.getPositionStrategy().width(e).height(t),this.overlayRef.updatePosition(),this},e.prototype.isAnimating=function(){return this.container.isAnimating},e.prototype.afterOpen=function(){return this._afterOpen$.asObservable()},e.prototype.beforeClose=function(){return this._beforeClose$.asObservable()},e.prototype.afterClosed=function(){return this._afterClosed$.asObservable()},e.prototype.getPositionStrategy=function(){return this.overlayRef.getConfig().positionStrategy},e}(),Je=function(e){function n(n,r,i,o){var a=e.call(this)||this;return a.changeDetector=n,a.elementRef=r,a.focusTrapFactory=i,a.document=o,a.ariaLabelledBy=null,a.animationStateChanged=new t.EventEmitter,a.isAnimating=!1,a.state="enter",a.params={x:"0px",y:"0px",ox:"50%",oy:"50%",scale:0},a.elementFocusedBeforeDialogWasOpened=null,a}return C(n,e),Object.defineProperty(n.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerClass",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerTabIndex",{get:function(){return-1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerId",{get:function(){return this._config.id},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerRole",{get:function(){return this._config.role||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerAriaLabelledby",{get:function(){return this.ariaLabelledBy},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerAriaDescribedby",{get:function(){return this._config.ariaDescribedBy||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerAnimation",{get:function(){return{value:this.state,params:this.params}},enumerable:!1,configurable:!0}),n.prototype.ngOnInit=function(){},n.prototype.attachComponentPortal=function(e){if(this.portalOutlet.hasAttached())throw Error("Attempting to attach dialog content after content is already attached");return this.savePreviouslyFocusedElement(),this.portalOutlet.attachComponentPortal(e)},n.prototype.attachTemplatePortal=function(e){throw new Error("Method not implemented.")},n.prototype.setConfig=function(e){this._config=e,e.event&&this.calculateZoomOrigin(event)},n.prototype.onAnimationStart=function(e){this.isAnimating=!0,this.animationStateChanged.emit(e)},n.prototype.onAnimationDone=function(e){"enter"===e.toState?this.trapFocus():"exit"===e.toState&&this.restoreFocus(),this.animationStateChanged.emit(e),this.isAnimating=!1},n.prototype.startExitAnimation=function(){this.state="exit",this.changeDetector.markForCheck()},n.prototype.calculateZoomOrigin=function(e){if(e){var t=e.clientX,n=e.clientY,r=t-window.innerWidth/2,i=n-window.innerHeight/2,o=t/window.innerWidth,a=n/window.innerHeight;this.params.x=r+"px",this.params.y=i+"px",this.params.ox=100*o+"%",this.params.oy=100*a+"%",this.params.scale=0}},n.prototype.savePreviouslyFocusedElement=function(){var e=this;this.document&&(this.elementFocusedBeforeDialogWasOpened=this.document.activeElement,Promise.resolve().then((function(){return e.elementRef.nativeElement.focus()})))},n.prototype.trapFocus=function(){this.focusTrap||(this.focusTrap=this.focusTrapFactory.create(this.elementRef.nativeElement)),this._config.autoFocus&&this.focusTrap.focusInitialElementWhenReady()},n.prototype.restoreFocus=function(){var e=this.elementFocusedBeforeDialogWasOpened;e&&"function"==typeof e.focus&&e.focus(),this.focusTrap&&this.focusTrap.destroy()},n}(p.BasePortalOutlet);Je.decorators=[{type:t.Component,args:[{selector:"owl-dialog-container",template:"<ng-template cdkPortalOutlet></ng-template>\n",animations:[s.trigger("slideModal",[s.transition("void => enter",[s.style({opacity:0,transform:"translateX({{ x }}) translateY({{ y }}) scale({{scale}})",transformOrigin:"{{ ox }} {{ oy }}"}),s.animate("300ms cubic-bezier(0.35, 0, 0.25, 1)",s.style("*")),s.animate("150ms",s.keyframes([s.style({transform:"scale(1)",offset:0}),s.style({transform:"scale(1.05)",offset:.3}),s.style({transform:"scale(.95)",offset:.8}),s.style({transform:"scale(1)",offset:1})])),s.animateChild()],{params:{x:"0px",y:"0px",ox:"50%",oy:"50%",scale:1}}),s.transition("enter => exit",[s.animateChild(),s.animate(200,s.style({opacity:0,transform:"translateX({{ x }}) translateY({{ y }}) scale({{scale}})"}))],{params:{x:"0px",y:"0px",ox:"50%",oy:"50%"}})])],host:{"(@slideModal.start)":"onAnimationStart($event)","(@slideModal.done)":"onAnimationDone($event)","[class.owl-dialog-container]":"owlDialogContainerClass","[attr.tabindex]":"owlDialogContainerTabIndex","[attr.id]":"owlDialogContainerId","[attr.role]":"owlDialogContainerRole","[attr.aria-labelledby]":"owlDialogContainerAriaLabelledby","[attr.aria-describedby]":"owlDialogContainerAriaDescribedby","[@slideModal]":"owlDialogContainerAnimation"}}]}],Je.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:t.ElementRef},{type:c.FocusTrapFactory},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[n.DOCUMENT]}]}]},Je.propDecorators={portalOutlet:[{type:t.ViewChild,args:[p.CdkPortalOutlet,{static:!0}]}]};var Ze=new t.InjectionToken("OwlDialogData"),Xe=new t.InjectionToken("owl-dialog-scroll-strategy");function Ke(e){return function(){return e.scrollStrategies.block()}}var et={provide:Xe,deps:[u.Overlay],useFactory:Ke},tt=new t.InjectionToken("owl-dialog-default-options"),nt=function(){function e(e,t,n,r,o,a,s){var l=this;this.overlay=e,this.injector=t,this.location=n,this.defaultOptions=o,this.parentDialog=a,this.overlayContainer=s,this.ariaHiddenElements=new Map,this._openDialogsAtThisLevel=[],this._afterOpenAtThisLevel=new i.Subject,this._afterAllClosedAtThisLevel=new i.Subject,this.afterAllClosed=i.defer((function(){return l._openDialogsAtThisLevel.length?l._afterAllClosed:l._afterAllClosed.pipe(f.startWith(void 0))})),this.scrollStrategy=r,!a&&n&&n.subscribe((function(){return l.closeAll()}))}return Object.defineProperty(e.prototype,"openDialogs",{get:function(){return this.parentDialog?this.parentDialog.openDialogs:this._openDialogsAtThisLevel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"afterOpen",{get:function(){return this.parentDialog?this.parentDialog.afterOpen:this._afterOpenAtThisLevel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_afterAllClosed",{get:function(){var e=this.parentDialog;return e?e._afterAllClosed:this._afterAllClosedAtThisLevel},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){var n=this;if((t=function(e,t){return function(e){for(var t,n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(null==e)throw TypeError("Cannot convert undefined or null to object");try{for(var o=O(r),a=o.next();!a.done;a=o.next()){var s=a.value;if(null!=s)for(var l in s)s.hasOwnProperty(l)&&(e[l]=s[l])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e}(new Ue,e,t)}(t,this.defaultOptions)).id&&this.getDialogById(t.id))throw Error('Dialog with id "'+t.id+'" exists already. The dialog id must be unique.');var r=this.createOverlay(t),i=this.attachDialogContainer(r,t),o=this.attachDialogContent(e,i,r,t);return this.openDialogs.length||this.hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe((function(){return n.removeOpenDialog(o)})),this.afterOpen.next(o),o},e.prototype.closeAll=function(){for(var e=this.openDialogs.length;e--;)this.openDialogs[e].close()},e.prototype.getDialogById=function(e){return this.openDialogs.find((function(t){return t.id===e}))},e.prototype.attachDialogContent=function(e,n,r,i){var o=new $e(r,n,i.id,this.location);if(i.hasBackdrop&&r.backdropClick().subscribe((function(){o.disableClose||o.close()})),e instanceof t.TemplateRef);else{var a=this.createInjector(i,o,n),s=n.attachComponentPortal(new p.ComponentPortal(e,void 0,a));o.componentInstance=s.instance}return o.updateSize(i.width,i.height).updatePosition(i.position),o},e.prototype.createInjector=function(e,t,n){var r=e&&e.viewContainerRef&&e.viewContainerRef.injector,i=new WeakMap;return i.set($e,t),i.set(Je,n),i.set(Ze,e.data),new p.PortalInjector(r||this.injector,i)},e.prototype.createOverlay=function(e){var t=this.getOverlayConfig(e);return this.overlay.create(t)},e.prototype.attachDialogContainer=function(e,t){var n=new p.ComponentPortal(Je,t.viewContainerRef),r=e.attach(n);return r.instance.setConfig(t),r.instance},e.prototype.getOverlayConfig=function(e){var t=new u.OverlayConfig({positionStrategy:this.overlay.position().global(),scrollStrategy:e.scrollStrategy||this.scrollStrategy(),panelClass:e.paneClass,hasBackdrop:e.hasBackdrop,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight});return e.backdropClass&&(t.backdropClass=e.backdropClass),t},e.prototype.removeOpenDialog=function(e){var t=this._openDialogsAtThisLevel.indexOf(e);t>-1&&(this.openDialogs.splice(t,1),this.openDialogs.length||(this.ariaHiddenElements.forEach((function(e,t){e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")})),this.ariaHiddenElements.clear(),this._afterAllClosed.next()))},e.prototype.hideNonDialogContentFromAssistiveTechnology=function(){var e=this.overlayContainer.getContainerElement();if(e.parentElement)for(var t=e.parentElement.children,n=t.length-1;n>-1;n--){var r=t[n];r===e||"SCRIPT"===r.nodeName||"STYLE"===r.nodeName||r.hasAttribute("aria-live")||(this.ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}},e}();nt.decorators=[{type:t.Injectable}],nt.ctorParameters=function(){return[{type:u.Overlay},{type:t.Injector},{type:n.Location,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Inject,args:[Xe]}]},{type:Ue,decorators:[{type:t.Optional},{type:t.Inject,args:[tt]}]},{type:nt,decorators:[{type:t.Optional},{type:t.SkipSelf}]},{type:u.OverlayContainer}]};var rt=new t.InjectionToken("owl-dtpicker-scroll-strategy");function it(e){return function(){return e.scrollStrategies.block()}}var ot={provide:rt,deps:[u.Overlay],useFactory:it},at=function(e){function n(n,r,o,a,s,l,c,u,p){var d=e.call(this,l,u)||this;return d.overlay=n,d.viewContainerRef=r,d.dialogService=o,d.ngZone=a,d.changeDetector=s,d.dateTimeAdapter=l,d.dateTimeFormats=u,d.document=p,d.backdropClass=[],d.panelClass=[],d._pickerType="both",d._pickerMode="popup",d._opened=!1,d.afterPickerClosed=new t.EventEmitter,d.afterPickerOpen=new t.EventEmitter,d.yearSelected=new t.EventEmitter,d.monthSelected=new t.EventEmitter,d.confirmSelectedChange=new t.EventEmitter,d.disabledChange=new t.EventEmitter,d.dtInputSub=i.Subscription.EMPTY,d.hidePickerStreamSub=i.Subscription.EMPTY,d.confirmSelectedStreamSub=i.Subscription.EMPTY,d.pickerOpenedStreamSub=i.Subscription.EMPTY,d.focusedElementBeforeOpen=null,d._selecteds=[],d.defaultScrollStrategy=c,d}return C(n,e),Object.defineProperty(n.prototype,"startAt",{get:function(){return this._startAt?this._startAt:this._dtInput?"single"===this._dtInput.selectMode?this._dtInput.value||null:"range"===this._dtInput.selectMode||"rangeFrom"===this._dtInput.selectMode?this._dtInput.values[0]||null:"rangeTo"===this._dtInput.selectMode?this._dtInput.values[1]||null:void 0:null},set:function(e){this._startAt=this.getValidDate(this.dateTimeAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pickerType",{get:function(){return this._pickerType},set:function(e){e!==this._pickerType&&(this._pickerType=e,this._dtInput&&this._dtInput.formatNativeInputValue())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pickerMode",{get:function(){return this._pickerMode},set:function(e){this._pickerMode="popup"===e?e:"dialog"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return void 0===this._disabled&&this._dtInput?this._dtInput.disabled:!!this._disabled},set:function(e){(e=h.coerceBooleanProperty(e))!==this._disabled&&(this._disabled=e,this.disabledChange.next(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"opened",{get:function(){return this._opened},set:function(e){e?this.open():this.close()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dtInput",{get:function(){return this._dtInput},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=e,this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){this._selecteds=e,this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"minDateTime",{get:function(){return this._dtInput&&this._dtInput.min},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"maxDateTime",{get:function(){return this._dtInput&&this._dtInput.max},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dateTimeFilter",{get:function(){return this._dtInput&&this._dtInput.dateTimeFilter},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectMode",{get:function(){return this._dtInput.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInSingleMode",{get:function(){return this._dtInput.isInSingleMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInRangeMode",{get:function(){return this._dtInput.isInRangeMode},enumerable:!1,configurable:!0}),n.prototype.ngOnInit=function(){},n.prototype.ngOnDestroy=function(){this.close(),this.dtInputSub.unsubscribe(),this.disabledChange.complete(),this.popupRef&&this.popupRef.dispose()},n.prototype.registerInput=function(e){var t=this;if(this._dtInput)throw Error("A Owl DateTimePicker can only be associated with a single input.");this._dtInput=e,this.dtInputSub=this._dtInput.valueChange.subscribe((function(e){Array.isArray(e)?t.selecteds=e:t.selected=e}))},n.prototype.open=function(){var e=this;if(!this._opened&&!this.disabled){if(!this._dtInput)throw Error("Attempted to open an DateTimePicker with no associated input.");this.document&&(this.focusedElementBeforeOpen=this.document.activeElement),this.isInSingleMode?this.selected=this._dtInput.value:this.isInRangeMode&&(this.selecteds=this._dtInput.values),this.selected&&"calendar"!==this.pickerType&&this._startAt&&(this.selected=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.selected),this.dateTimeAdapter.getMonth(this.selected),this.dateTimeAdapter.getDate(this.selected),this.dateTimeAdapter.getHours(this._startAt),this.dateTimeAdapter.getMinutes(this._startAt),this.dateTimeAdapter.getSeconds(this._startAt))),"dialog"===this.pickerMode?this.openAsDialog():this.openAsPopup(),this.pickerContainer.picker=this,this.hidePickerStreamSub=this.pickerContainer.hidePickerStream.subscribe((function(){e.close()})),this.confirmSelectedStreamSub=this.pickerContainer.confirmSelectedStream.subscribe((function(t){e.confirmSelect(t)}))}},n.prototype.select=function(e){Array.isArray(e)?this.selecteds=M(e):this.selected=e,"dialog"!==this.pickerMode&&"calendar"===this.pickerType&&("single"===this.selectMode&&this.selected||"rangeFrom"===this.selectMode&&this.selecteds[0]||"rangeTo"===this.selectMode&&this.selecteds[1]||"range"===this.selectMode&&this.selecteds[0]&&this.selecteds[1])&&this.confirmSelect()},n.prototype.selectYear=function(e){this.yearSelected.emit(e)},n.prototype.selectMonth=function(e){this.monthSelected.emit(e)},n.prototype.close=function(){var e=this;if(this._opened){this.popupRef&&this.popupRef.hasAttached()&&this.popupRef.detach(),this.pickerContainerPortal&&this.pickerContainerPortal.isAttached&&this.pickerContainerPortal.detach(),this.hidePickerStreamSub&&(this.hidePickerStreamSub.unsubscribe(),this.hidePickerStreamSub=null),this.confirmSelectedStreamSub&&(this.confirmSelectedStreamSub.unsubscribe(),this.confirmSelectedStreamSub=null),this.pickerOpenedStreamSub&&(this.pickerOpenedStreamSub.unsubscribe(),this.pickerOpenedStreamSub=null),this.dialogRef&&(this.dialogRef.close(),this.dialogRef=null);var t=function(){e._opened&&(e._opened=!1,e.afterPickerClosed.emit(null),e.focusedElementBeforeOpen=null)};this.focusedElementBeforeOpen&&"function"==typeof this.focusedElementBeforeOpen.focus?(this.focusedElementBeforeOpen.focus(),setTimeout(t)):t()}},n.prototype.confirmSelect=function(e){if(this.isInSingleMode){var t=this.selected||this.startAt||this.dateTimeAdapter.now();this.confirmSelectedChange.emit(t)}else this.isInRangeMode&&this.confirmSelectedChange.emit(this.selecteds);this.close()},n.prototype.openAsDialog=function(){var e=this;this.dialogRef=this.dialogService.open(Qe,{autoFocus:!1,backdropClass:M(["cdk-overlay-dark-backdrop"],h.coerceArray(this.backdropClass)),paneClass:M(["owl-dt-dialog"],h.coerceArray(this.panelClass)),viewContainerRef:this.viewContainerRef,scrollStrategy:this.scrollStrategy||this.defaultScrollStrategy(),closeOnNavigation:!0,width:"",height:""}),this.pickerContainer=this.dialogRef.componentInstance,this.dialogRef.afterOpen().subscribe((function(){e.afterPickerOpen.emit(null),e._opened=!0})),this.dialogRef.afterClosed().subscribe((function(){return e.close()}))},n.prototype.openAsPopup=function(){var e=this;if(this.pickerContainerPortal||(this.pickerContainerPortal=new p.ComponentPortal(Qe,this.viewContainerRef)),this.popupRef||this.createPopup(),!this.popupRef.hasAttached()){var t=this.popupRef.attach(this.pickerContainerPortal);this.pickerContainer=t.instance,this.ngZone.onStable.asObservable().pipe(f.take(1)).subscribe((function(){e.popupRef.updatePosition()})),this.pickerOpenedStreamSub=this.pickerContainer.pickerOpenedStream.pipe(f.take(1)).subscribe((function(){e.afterPickerOpen.emit(null),e._opened=!0}))}},n.prototype.createPopup=function(){var e=this,t=new u.OverlayConfig({positionStrategy:this.createPopupPositionStrategy(),hasBackdrop:!0,backdropClass:M(["cdk-overlay-transparent-backdrop"],h.coerceArray(this.backdropClass)),scrollStrategy:this.scrollStrategy||this.defaultScrollStrategy(),panelClass:M(["owl-dt-popup"],h.coerceArray(this.panelClass))});this.popupRef=this.overlay.create(t),i.merge(this.popupRef.backdropClick(),this.popupRef.detachments(),this.popupRef.keydownEvents().pipe(f.filter((function(t){return t.keyCode===d.ESCAPE||e._dtInput&&t.altKey&&t.keyCode===d.UP_ARROW})))).subscribe((function(){return e.close()}))},n.prototype.createPopupPositionStrategy=function(){return this.overlay.position().flexibleConnectedTo(this._dtInput.elementRef).withTransformOriginOn(".owl-dt-container").withFlexibleDimensions(!1).withPush(!1).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"start",overlayY:"top",offsetY:-176},{originX:"start",originY:"top",overlayX:"start",overlayY:"top",offsetY:-352}])},n}(ze);at.decorators=[{type:t.Component,args:[{selector:"owl-date-time",exportAs:"owlDateTime",template:"",changeDetection:t.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,styles:[""]}]}],at.ctorParameters=function(){return[{type:u.Overlay},{type:t.ViewContainerRef},{type:nt},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:Ne,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Inject,args:[rt]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[He]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[n.DOCUMENT]}]}]},at.propDecorators={backdropClass:[{type:t.Input}],panelClass:[{type:t.Input}],startAt:[{type:t.Input}],pickerType:[{type:t.Input}],pickerMode:[{type:t.Input}],disabled:[{type:t.Input}],opened:[{type:t.Input}],scrollStrategy:[{type:t.Input}],afterPickerClosed:[{type:t.Output}],afterPickerOpen:[{type:t.Output}],yearSelected:[{type:t.Output}],monthSelected:[{type:t.Output}]};var st={provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return ct})),multi:!0},lt={provide:r.NG_VALIDATORS,useExisting:t.forwardRef((function(){return ct})),multi:!0},ct=function(){function e(e,n,o,a){var s=this;if(this.elmRef=e,this.renderer=n,this.dateTimeAdapter=o,this.dateTimeFormats=a,this._selectMode="single",this.rangeSeparator="~",this._values=[],this.dateTimeChange=new t.EventEmitter,this.dateTimeInput=new t.EventEmitter,this.dtPickerSub=i.Subscription.EMPTY,this.localeSub=i.Subscription.EMPTY,this.lastValueValid=!0,this.parseValidator=function(){return s.lastValueValid?null:{owlDateTimeParse:{text:s.elmRef.nativeElement.value}}},this.minValidator=function(e){if(s.isInSingleMode){var t=s.getValidDate(s.dateTimeAdapter.deserialize(e.value));return!s.min||!t||s.dateTimeAdapter.compare(s.min,t)<=0?null:{owlDateTimeMin:{min:s.min,actual:t}}}if(s.isInRangeMode&&e.value){var n=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[0])),r=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[1]));return!s.min||!n||!r||s.dateTimeAdapter.compare(s.min,n)<=0?null:{owlDateTimeMin:{min:s.min,actual:[n,r]}}}},this.maxValidator=function(e){if(s.isInSingleMode){var t=s.getValidDate(s.dateTimeAdapter.deserialize(e.value));return!s.max||!t||s.dateTimeAdapter.compare(s.max,t)>=0?null:{owlDateTimeMax:{max:s.max,actual:t}}}if(s.isInRangeMode&&e.value){var n=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[0])),r=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[1]));return!s.max||!n||!r||s.dateTimeAdapter.compare(s.max,r)>=0?null:{owlDateTimeMax:{max:s.max,actual:[n,r]}}}},this.filterValidator=function(e){var t=s.getValidDate(s.dateTimeAdapter.deserialize(e.value));return s._dateTimeFilter&&t&&!s._dateTimeFilter(t)?{owlDateTimeFilter:!0}:null},this.rangeValidator=function(e){if(s.isInSingleMode||!e.value)return null;var t=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[0])),n=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[1]));return!t||!n||s.dateTimeAdapter.compare(t,n)<=0?null:{owlDateTimeRange:!0}},this.validator=r.Validators.compose([this.parseValidator,this.minValidator,this.maxValidator,this.filterValidator,this.rangeValidator]),this.valueChange=new t.EventEmitter,this.disabledChange=new t.EventEmitter,this.onModelChange=function(){},this.onModelTouched=function(){},this.validatorOnChange=function(){},!this.dateTimeAdapter)throw Error("OwlDateTimePicker: No provider found for DateTimePicker. You must import one of the following modules at your application root: OwlNativeDateTimeModule, OwlMomentDateTimeModule, or provide a custom implementation.");if(!this.dateTimeFormats)throw Error("OwlDateTimePicker: No provider found for OWL_DATE_TIME_FORMATS. You must import one of the following modules at your application root: OwlNativeDateTimeModule, OwlMomentDateTimeModule, or provide a custom implementation.");this.localeSub=this.dateTimeAdapter.localeChanges.subscribe((function(){s.value=s.value}))}return Object.defineProperty(e.prototype,"owlDateTime",{set:function(e){this.registerDateTimePicker(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDateTimeFilter",{set:function(e){this._dateTimeFilter=e,this.validatorOnChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateTimeFilter",{get:function(){return this._dateTimeFilter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return!!this._disabled},set:function(e){var t=h.coerceBooleanProperty(e),n=this.elmRef.nativeElement;this._disabled!==t&&(this._disabled=t,this.disabledChange.emit(t)),t&&n.blur&&n.blur()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this._min},set:function(e){this._min=this.getValidDate(this.dateTimeAdapter.deserialize(e)),this.validatorOnChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},set:function(e){this._max=this.getValidDate(this.dateTimeAdapter.deserialize(e)),this.validatorOnChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){if("single"!==e&&"range"!==e&&"rangeFrom"!==e&&"rangeTo"!==e)throw Error("OwlDateTime Error: invalid selectMode value!");this._selectMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){e=this.dateTimeAdapter.deserialize(e),this.lastValueValid=!e||this.dateTimeAdapter.isValid(e),e=this.getValidDate(e);var t=this._value;this._value=e,this.value,this.dtPicker&&this.formatNativeInputValue(),this.dateTimeAdapter.isEqual(t,e)||this.valueChange.emit(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._values},set:function(e){var t=this;e&&e.length>0?(this._values=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),t.getValidDate(e)})),this.lastValueValid=(!this._values[0]||this.dateTimeAdapter.isValid(this._values[0]))&&(!this._values[1]||this.dateTimeAdapter.isValid(this._values[1]))):(this._values=[],this.lastValueValid=!0),this.formatNativeInputValue(),this.valueChange.emit(this._values)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elementRef",{get:function(){return this.elmRef},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this._selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this._selectMode||"rangeFrom"===this._selectMode||"rangeTo"===this._selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDateTimeInputAriaHaspopup",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDateTimeInputAriaOwns",{get:function(){return this.dtPicker.opened&&this.dtPicker.id||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minIso8601",{get:function(){return this.min?this.dateTimeAdapter.toIso8601(this.min):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxIso8601",{get:function(){return this.max?this.dateTimeAdapter.toIso8601(this.max):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDateTimeInputDisabled",{get:function(){return this.disabled},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){if(!this.dtPicker)throw Error("OwlDateTimePicker: the picker input doesn't have any associated owl-date-time component");this.formatNativeInputValue()},e.prototype.ngAfterContentInit=function(){var e=this;this.dtPickerSub=this.dtPicker.confirmSelectedChange.subscribe((function(t){Array.isArray(t)?e.values=t:e.value=t,e.onModelChange(t),e.onModelTouched(),e.dateTimeChange.emit({source:e,value:t,input:e.elmRef.nativeElement}),e.dateTimeInput.emit({source:e,value:t,input:e.elmRef.nativeElement})}))},e.prototype.ngOnDestroy=function(){this.dtPickerSub.unsubscribe(),this.localeSub.unsubscribe(),this.valueChange.complete(),this.disabledChange.complete()},e.prototype.writeValue=function(e){this.isInSingleMode?this.value=e:this.values=e},e.prototype.registerOnChange=function(e){this.onModelChange=e},e.prototype.registerOnTouched=function(e){this.onModelTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.validate=function(e){return this.validator?this.validator(e):null},e.prototype.registerOnValidatorChange=function(e){this.validatorOnChange=e},e.prototype.handleKeydownOnHost=function(e){e.altKey&&e.keyCode===d.DOWN_ARROW&&(this.dtPicker.open(),e.preventDefault())},e.prototype.handleBlurOnHost=function(e){this.onModelTouched()},e.prototype.handleInputOnHost=function(e){var t=e.target.value;"single"===this._selectMode?this.changeInputInSingleMode(t):"range"===this._selectMode?this.changeInputInRangeMode(t):this.changeInputInRangeFromToMode(t)},e.prototype.handleChangeOnHost=function(e){var t;this.isInSingleMode?t=this.value:this.isInRangeMode&&(t=this.values),this.dateTimeChange.emit({source:this,value:t,input:this.elmRef.nativeElement})},e.prototype.formatNativeInputValue=function(){if(this.isInSingleMode)this.renderer.setProperty(this.elmRef.nativeElement,"value",this._value?this.dateTimeAdapter.format(this._value,this.dtPicker.formatString):"");else if(this.isInRangeMode)if(this._values&&this.values.length>0){var e=this._values[0],t=this._values[1],n=e?this.dateTimeAdapter.format(e,this.dtPicker.formatString):"",r=t?this.dateTimeAdapter.format(t,this.dtPicker.formatString):"";n||r?"range"===this._selectMode?this.renderer.setProperty(this.elmRef.nativeElement,"value",n+" "+this.rangeSeparator+" "+r):"rangeFrom"===this._selectMode?this.renderer.setProperty(this.elmRef.nativeElement,"value",n):"rangeTo"===this._selectMode&&this.renderer.setProperty(this.elmRef.nativeElement,"value",r):this.renderer.setProperty(this.elmRef.nativeElement,"value",null)}else this.renderer.setProperty(this.elmRef.nativeElement,"value","")},e.prototype.registerDateTimePicker=function(e){e&&(this.dtPicker=e,this.dtPicker.registerInput(this))},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e.prototype.convertTimeStringToDateTimeString=function(e,t){if(e){var n=t||this.dateTimeAdapter.now();return this.dateTimeAdapter.format(n,this.dateTimeFormats.datePickerInput)+" "+e}return null},e.prototype.changeInputInSingleMode=function(e){var t=e;"timer"===this.dtPicker.pickerType&&(t=this.convertTimeStringToDateTimeString(t,this.value));var n=this.dateTimeAdapter.parse(t,this.dateTimeFormats.parseInput);this.lastValueValid=!n||this.dateTimeAdapter.isValid(n),n=this.getValidDate(n),this.isSameValue(n,this._value)&&null!==n||(this._value=n,this.valueChange.emit(n),this.onModelChange(n),this.dateTimeInput.emit({source:this,value:n,input:this.elmRef.nativeElement}))},e.prototype.changeInputInRangeFromToMode=function(e){var t="rangeFrom"===this._selectMode?this._values[0]:this._values[1];"timer"===this.dtPicker.pickerType&&(e=this.convertTimeStringToDateTimeString(e,t));var n=this.dateTimeAdapter.parse(e,this.dateTimeFormats.parseInput);this.lastValueValid=!n||this.dateTimeAdapter.isValid(n),n=this.getValidDate(n),"rangeFrom"===this._selectMode&&this.isSameValue(n,this._values[0])&&n||"rangeTo"===this._selectMode&&this.isSameValue(n,this._values[1])&&n||(this._values="rangeFrom"===this._selectMode?[n,this._values[1]]:[this._values[0],n],this.valueChange.emit(this._values),this.onModelChange(this._values),this.dateTimeInput.emit({source:this,value:this._values,input:this.elmRef.nativeElement}))},e.prototype.changeInputInRangeMode=function(e){var t=e.split(this.rangeSeparator),n=t[0],r=t[1];"timer"===this.dtPicker.pickerType&&(n=this.convertTimeStringToDateTimeString(n,this.values[0]),r=this.convertTimeStringToDateTimeString(r,this.values[1]));var i=this.dateTimeAdapter.parse(n,this.dateTimeFormats.parseInput),o=this.dateTimeAdapter.parse(r,this.dateTimeFormats.parseInput);this.lastValueValid=(!i||this.dateTimeAdapter.isValid(i))&&(!o||this.dateTimeAdapter.isValid(o)),i=this.getValidDate(i),o=this.getValidDate(o),this.isSameValue(i,this._values[0])&&this.isSameValue(o,this._values[1])&&(null!==i||null!==o)||(this._values=[i,o],this.valueChange.emit(this._values),this.onModelChange(this._values),this.dateTimeInput.emit({source:this,value:this._values,input:this.elmRef.nativeElement}))},e.prototype.isSameValue=function(e,t){return e&&t?0===this.dateTimeAdapter.compare(e,t):e===t},e}();ct.decorators=[{type:t.Directive,args:[{selector:"input[owlDateTime]",exportAs:"owlDateTimeInput",host:{"(keydown)":"handleKeydownOnHost($event)","(blur)":"handleBlurOnHost($event)","(input)":"handleInputOnHost($event)","(change)":"handleChangeOnHost($event)","[attr.aria-haspopup]":"owlDateTimeInputAriaHaspopup","[attr.aria-owns]":"owlDateTimeInputAriaOwns","[attr.min]":"minIso8601","[attr.max]":"maxIso8601","[disabled]":"owlDateTimeInputDisabled"},providers:[st,lt]}]}],ct.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:Ne,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[He]}]}]},ct.propDecorators={owlDateTime:[{type:t.Input}],owlDateTimeFilter:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],selectMode:[{type:t.Input}],value:[{type:t.Input}],values:[{type:t.Input}],_disabled:[{type:t.Input}],rangeSeparator:[{type:t.Input}],dateTimeChange:[{type:t.Output}],dateTimeInput:[{type:t.Output}]};var ut=function(e,t,n,r,i,o){void 0===i&&(i=!1),void 0===o&&(o=""),this.value=e,this.displayValue=t,this.ariaLabel=n,this.enabled=r,this.out=i,this.cellClass=o},pt=function(){function e(e,n){this.elmRef=e,this.ngZone=n,this.activeCell=0,this.numCols=7,this.cellRatio=1,this.select=new t.EventEmitter}return Object.defineProperty(e.prototype,"owlDTCalendarBodyClass",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.selectCell=function(e){this.select.emit(e)},e.prototype.isActiveCell=function(e,t){return e*this.numCols+t===this.activeCell},e.prototype.isSelected=function(e){if(!this.selectedValues||0===this.selectedValues.length)return!1;if(this.isInSingleMode)return e===this.selectedValues[0];if(this.isInRangeMode){var t=this.selectedValues[0],n=this.selectedValues[1];return e===t||e===n}},e.prototype.isInRange=function(e){if(this.isInRangeMode){var t=this.selectedValues[0],n=this.selectedValues[1];return null!==t&&null!==n?e>=t&&e<=n:e===t||e===n}},e.prototype.isRangeFrom=function(e){if(this.isInRangeMode){var t=this.selectedValues[0];return null!==t&&e===t}},e.prototype.isRangeTo=function(e){if(this.isInRangeMode){var t=this.selectedValues[1];return null!==t&&e===t}},e.prototype.focusActiveCell=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.ngZone.onStable.asObservable().pipe(f.take(1)).subscribe((function(){e.elmRef.nativeElement.querySelector(".owl-dt-calendar-cell-active").focus()}))}))},e}();pt.decorators=[{type:t.Component,args:[{selector:"[owl-date-time-calendar-body]",exportAs:"owlDateTimeCalendarBody",template:'<tr *ngFor="let row of rows; let rowIndex = index" role="row">\n <td *ngFor="let item of row; let colIndex = index"\n class="owl-dt-calendar-cell {{item.cellClass}}"\n [tabindex]="isActiveCell(rowIndex, colIndex) ? 0 : -1"\n [class.owl-dt-calendar-cell-active]="isActiveCell(rowIndex, colIndex)"\n [class.owl-dt-calendar-cell-disabled]="!item.enabled"\n [class.owl-dt-calendar-cell-in-range]="isInRange(item.value)"\n [class.owl-dt-calendar-cell-range-from]="isRangeFrom(item.value)"\n [class.owl-dt-calendar-cell-range-to]="isRangeTo(item.value)"\n [attr.aria-label]="item.ariaLabel"\n [attr.aria-disabled]="!item.enabled || null"\n [style.width.%]="100 / numCols"\n [style.paddingTop.%]="50 * cellRatio / numCols"\n [style.paddingBottom.%]="50 * cellRatio / numCols"\n (click)="selectCell(item)">\n <span class="owl-dt-calendar-cell-content"\n [ngClass]="{\n \'owl-dt-calendar-cell-out\': item.out,\n \'owl-dt-calendar-cell-today\': item.value === todayValue,\n \'owl-dt-calendar-cell-selected\': isSelected(item.value)\n }">\n {{item.displayValue}}\n </span>\n </td>\n</tr>\n',host:{"[class.owl-dt-calendar-body]":"owlDTCalendarBodyClass"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],pt.ctorParameters=function(){return[{type:t.ElementRef},{type:t.NgZone}]},pt.propDecorators={activeCell:[{type:t.Input}],rows:[{type:t.Input}],numCols:[{type:t.Input}],cellRatio:[{type:t.Input}],todayValue:[{type:t.Input}],selectedValues:[{type:t.Input}],selectMode:[{type:t.Input}],select:[{type:t.Output}]};var dt=function(){function e(e,n,r){this.cdRef=e,this.dateTimeAdapter=n,this.dateTimeFormats=r,this.hideOtherMonths=!1,this._firstDayOfWeek=0,this._selectMode="single",this._selecteds=[],this.localeSub=i.Subscription.EMPTY,this.initiated=!1,this.selectedDates=[],this.selectedChange=new t.EventEmitter,this.userSelection=new t.EventEmitter,this.pickerMomentChange=new t.EventEmitter}return Object.defineProperty(e.prototype,"firstDayOfWeek",{get:function(){return this._firstDayOfWeek},set:function(e){(e=h.coerceNumberProperty(e))>=0&&e<=6&&e!==this._firstDayOfWeek&&(this._firstDayOfWeek=e,this.initiated&&(this.generateWeekDays(),this.generateCalendar(),this.cdRef.markForCheck()))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){this._selectMode=e,this.initiated&&(this.generateCalendar(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){var t=this._selected;e=this.dateTimeAdapter.deserialize(e),this._selected=this.getValidDate(e),this.dateTimeAdapter.isSameDay(t,this._selected)||this.setSelectedDates()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){var t=this;this._selecteds=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),t.getValidDate(e)})),this.setSelectedDates()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){var t=this._pickerMoment;e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now(),this.firstDateOfMonth=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this._pickerMoment),this.dateTimeAdapter.getMonth(this._pickerMoment),1),!this.isSameMonth(t,this._pickerMoment)&&this.initiated&&this.generateCalendar()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateFilter",{get:function(){return this._dateFilter},set:function(e){this._dateFilter=e,this.initiated&&(this.generateCalendar(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._minDate=this.getValidDate(e),this.initiated&&(this.generateCalendar(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._maxDate=this.getValidDate(e),this.initiated&&(this.generateCalendar(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weekdays",{get:function(){return this._weekdays},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"days",{get:function(){return this._days},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeCell",{get:function(){if(this.pickerMoment)return this.dateTimeAdapter.getDate(this.pickerMoment)+this.firstRowOffset-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarView",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.generateWeekDays(),this.localeSub=this.dateTimeAdapter.localeChanges.subscribe((function(){e.generateWeekDays(),e.generateCalendar(),e.cdRef.markForCheck()}))},e.prototype.ngAfterContentInit=function(){this.generateCalendar(),this.initiated=!0},e.prototype.ngOnDestroy=function(){this.localeSub.unsubscribe()},e.prototype.selectCalendarCell=function(e){!e.enabled||this.hideOtherMonths&&e.out||this.selectDate(e.value)},e.prototype.selectDate=function(e){var t=e-1,n=this.dateTimeAdapter.addCalendarDays(this.firstDateOfMonth,t);this.selectedChange.emit(n),this.userSelection.emit()},e.prototype.handleCalendarKeydown=function(e){var t;switch(e.keyCode){case d.LEFT_ARROW:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,-1),this.pickerMomentChange.emit(t);break;case d.RIGHT_ARROW:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,1),this.pickerMomentChange.emit(t);break;case d.UP_ARROW:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,-7),this.pickerMomentChange.emit(t);break;case d.DOWN_ARROW:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,7),this.pickerMomentChange.emit(t);break;case d.HOME:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,1-this.dateTimeAdapter.getDate(this.pickerMoment)),this.pickerMomentChange.emit(t);break;case d.END:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,this.dateTimeAdapter.getNumDaysInMonth(this.pickerMoment)-this.dateTimeAdapter.getDate(this.pickerMoment)),this.pickerMomentChange.emit(t);break;case d.PAGE_UP:t=e.altKey?this.dateTimeAdapter.addCalendarYears(this.pickerMoment,-1):this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-1),this.pickerMomentChange.emit(t);break;case d.PAGE_DOWN:t=e.altKey?this.dateTimeAdapter.addCalendarYears(this.pickerMoment,1):this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,1),this.pickerMomentChange.emit(t);break;case d.ENTER:this.dateFilter&&!this.dateFilter(this.pickerMoment)||this.selectDate(this.dateTimeAdapter.getDate(this.pickerMoment));break;default:return}this.focusActiveCell(),e.preventDefault()},e.prototype.generateWeekDays=function(){var e=this.dateTimeAdapter.getDayOfWeekNames("long"),t=this.dateTimeAdapter.getDayOfWeekNames("short"),n=this.dateTimeAdapter.getDayOfWeekNames("narrow"),r=this.firstDayOfWeek,i=e.map((function(e,r){return{long:e,short:t[r],narrow:n[r]}}));this._weekdays=i.slice(r).concat(i.slice(0,r)),this.dateNames=this.dateTimeAdapter.getDateNames()},e.prototype.generateCalendar=function(){if(this.pickerMoment){this.todayDate=null;var e=0-(this.dateTimeAdapter.getDay(this.firstDateOfMonth)+(7-this.firstDayOfWeek))%7;this.firstRowOffset=Math.abs(e),this._days=[];for(var t=0;t<6;t++){for(var n=[],r=0;r<7;r++){var i=this.dateTimeAdapter.addCalendarDays(this.firstDateOfMonth,e),o=this.createDateCell(i,e);this.dateTimeAdapter.isSameDay(this.dateTimeAdapter.now(),i)&&(this.todayDate=e+1),n.push(o),e+=1}this._days.push(n)}this.setSelectedDates()}},e.prototype.createDateCell=function(e,t){var n=this.dateTimeAdapter.getNumDaysInMonth(this.pickerMoment),r=this.dateTimeAdapter.getDate(e).toString(),i=this.dateTimeAdapter.format(e,this.dateTimeFormats.dateA11yLabel),o=this.isDateEnabled(e),a=t+1,s=a<1||a>n,l="owl-dt-day-"+this.dateTimeAdapter.getDay(e);return new ut(a,r,i,o,s,l)},e.prototype.isDateEnabled=function(e){return!!e&&(!this.dateFilter||this.dateFilter(e))&&(!this.minDate||this.dateTimeAdapter.compare(e,this.minDate)>=0)&&(!this.maxDate||this.dateTimeAdapter.compare(e,this.maxDate)<=0)},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e.prototype.isSameMonth=function(e,t){return!!(e&&t&&this.dateTimeAdapter.isValid(e)&&this.dateTimeAdapter.isValid(t)&&this.dateTimeAdapter.getYear(e)===this.dateTimeAdapter.getYear(t)&&this.dateTimeAdapter.getMonth(e)===this.dateTimeAdapter.getMonth(t))},e.prototype.setSelectedDates=function(){var e=this;if(this.selectedDates=[],this.firstDateOfMonth)if(this.isInSingleMode&&this.selected){var t=this.dateTimeAdapter.differenceInCalendarDays(this.selected,this.firstDateOfMonth);this.selectedDates[0]=t+1}else this.isInRangeMode&&this.selecteds&&(this.selectedDates=this.selecteds.map((function(t){return e.dateTimeAdapter.isValid(t)?e.dateTimeAdapter.differenceInCalendarDays(t,e.firstDateOfMonth)+1:null})))},e.prototype.focusActiveCell=function(){this.calendarBodyElm.focusActiveCell()},e}();dt.decorators=[{type:t.Component,args:[{selector:"owl-date-time-month-view",exportAs:"owlYearView",template:'<table class="owl-dt-calendar-table owl-dt-calendar-month-table"\n [class.owl-dt-calendar-only-current-month]="hideOtherMonths">\n <thead class="owl-dt-calendar-header">\n <tr class="owl-dt-weekdays">\n <th *ngFor="let weekday of weekdays"\n [attr.aria-label]="weekday.long"\n class="owl-dt-weekday" scope="col">\n <span>{{weekday.short}}</span>\n </th>\n </tr>\n <tr>\n <th class="owl-dt-calendar-table-divider" aria-hidden="true" colspan="7"></th>\n </tr>\n </thead>\n <tbody owl-date-time-calendar-body role="grid"\n [rows]="days" [todayValue]="todayDate"\n [selectedValues]="selectedDates"\n [selectMode]="selectMode"\n [activeCell]="activeCell"\n (keydown)="handleCalendarKeydown($event)"\n (select)="selectCalendarCell($event)">\n </tbody>\n</table>\n',host:{"[class.owl-dt-calendar-view]":"owlDTCalendarView"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],dt.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:Ne,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[He]}]}]},dt.propDecorators={hideOtherMonths:[{type:t.Input}],firstDayOfWeek:[{type:t.Input}],selectMode:[{type:t.Input}],selected:[{type:t.Input}],selecteds:[{type:t.Input}],pickerMoment:[{type:t.Input}],dateFilter:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],selectedChange:[{type:t.Output}],userSelection:[{type:t.Output}],pickerMomentChange:[{type:t.Output}],calendarBodyElm:[{type:t.ViewChild,args:[pt,{static:!0}]}]};var ht=function(){function e(e,n,r){this.cdRef=e,this.dateTimeAdapter=n,this.dateTimeFormats=r,this._selectMode="single",this._selecteds=[],this.localeSub=i.Subscription.EMPTY,this.initiated=!1,this.selectedMonths=[],this.change=new t.EventEmitter,this.monthSelected=new t.EventEmitter,this.pickerMomentChange=new t.EventEmitter,this.keyboardEnter=new t.EventEmitter,this.monthNames=this.dateTimeAdapter.getMonthNames("short")}return Object.defineProperty(e.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){this._selectMode=e,this.initiated&&(this.generateMonthList(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._selected=this.getValidDate(e),this.setSelectedMonths()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){this._selecteds=[];for(var t=0;t<e.length;t++){var n=this.dateTimeAdapter.deserialize(e[t]);this._selecteds.push(this.getValidDate(n))}this.setSelectedMonths()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){var t=this._pickerMoment;e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now(),!this.hasSameYear(t,this._pickerMoment)&&this.initiated&&this.generateMonthList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateFilter",{get:function(){return this._dateFilter},set:function(e){this._dateFilter=e,this.initiated&&this.generateMonthList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._minDate=this.getValidDate(e),this.initiated&&this.generateMonthList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._maxDate=this.getValidDate(e),this.initiated&&this.generateMonthList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"months",{get:function(){return this._months},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeCell",{get:function(){if(this._pickerMoment)return this.dateTimeAdapter.getMonth(this._pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarView",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.localeSub=this.dateTimeAdapter.localeChanges.subscribe((function(){e.generateMonthList(),e.cdRef.markForCheck()}))},e.prototype.ngAfterContentInit=function(){this.generateMonthList(),this.initiated=!0},e.prototype.ngOnDestroy=function(){this.localeSub.unsubscribe()},e.prototype.selectCalendarCell=function(e){this.selectMonth(e.value)},e.prototype.selectMonth=function(e){var t=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.pickerMoment),e,1);this.monthSelected.emit(t);var n=this.dateTimeAdapter.getNumDaysInMonth(t),r=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.pickerMoment),e,Math.min(n,this.dateTimeAdapter.getDate(this.pickerMoment)),this.dateTimeAdapter.getHours(this.pickerMoment),this.dateTimeAdapter.getMinutes(this.pickerMoment),this.dateTimeAdapter.getSeconds(this.pickerMoment));this.change.emit(r)},e.prototype.handleCalendarKeydown=function(e){var t;switch(e.keyCode){case d.LEFT_ARROW:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-1),this.pickerMomentChange.emit(t);break;case d.RIGHT_ARROW:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,1),this.pickerMomentChange.emit(t);break;case d.UP_ARROW:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-3),this.pickerMomentChange.emit(t);break;case d.DOWN_ARROW:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,3),this.pickerMomentChange.emit(t);break;case d.HOME:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-this.dateTimeAdapter.getMonth(this.pickerMoment)),this.pickerMomentChange.emit(t);break;case d.END:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,11-this.dateTimeAdapter.getMonth(this.pickerMoment)),this.pickerMomentChange.emit(t);break;case d.PAGE_UP:t=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,e.altKey?-10:-1),this.pickerMomentChange.emit(t);break;case d.PAGE_DOWN:t=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,e.altKey?10:1),this.pickerMomentChange.emit(t);break;case d.ENTER:this.selectMonth(this.dateTimeAdapter.getMonth(this.pickerMoment)),this.keyboardEnter.emit();break;default:return}this.focusActiveCell(),e.preventDefault()},e.prototype.generateMonthList=function(){if(this.pickerMoment){this.setSelectedMonths(),this.todayMonth=this.getMonthInCurrentYear(this.dateTimeAdapter.now()),this._months=[];for(var e=0;e<4;e++){for(var t=[],n=0;n<3;n++){var r=n+3*e,i=this.createMonthCell(r);t.push(i)}this._months.push(t)}}},e.prototype.createMonthCell=function(e){var t=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.pickerMoment),e,1),n=this.dateTimeAdapter.format(t,this.dateTimeFormats.monthYearA11yLabel),r="owl-dt-month-"+e;return new ut(e,this.monthNames[e],n,this.isMonthEnabled(e),!1,r)},e.prototype.isMonthEnabled=function(e){for(var t=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.pickerMoment),e,1);this.dateTimeAdapter.getMonth(t)===e;t=this.dateTimeAdapter.addCalendarDays(t,1))if(t&&(!this.dateFilter||this.dateFilter(t))&&(!this.minDate||this.dateTimeAdapter.compare(t,this.minDate)>=0)&&(!this.maxDate||this.dateTimeAdapter.compare(t,this.maxDate)<=0))return!0;return!1},e.prototype.getMonthInCurrentYear=function(e){if(this.getValidDate(e)&&this.getValidDate(this._pickerMoment)){var t=this.dateTimeAdapter.compareYear(e,this._pickerMoment);return t<0?-1:t>0?12:this.dateTimeAdapter.getMonth(e)}return null},e.prototype.setSelectedMonths=function(){this.selectedMonths=[],this.isInSingleMode&&this.selected&&(this.selectedMonths[0]=this.getMonthInCurrentYear(this.selected)),this.isInRangeMode&&this.selecteds&&(this.selectedMonths[0]=this.getMonthInCurrentYear(this.selecteds[0]),this.selectedMonths[1]=this.getMonthInCurrentYear(this.selecteds[1]))},e.prototype.hasSameYear=function(e,t){return!(!e||!t||this.dateTimeAdapter.getYear(e)!==this.dateTimeAdapter.getYear(t))},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e.prototype.focusActiveCell=function(){this.calendarBodyElm.focusActiveCell()},e}();ht.decorators=[{type:t.Component,args:[{selector:"owl-date-time-year-view",exportAs:"owlMonthView",template:'<table class="owl-dt-calendar-table owl-dt-calendar-year-table">\n <thead class="owl-dt-calendar-header">\n <tr>\n <th class="owl-dt-calendar-table-divider" aria-hidden="true" colspan="3"></th>\n </tr>\n </thead>\n <tbody owl-date-time-calendar-body role="grid"\n [rows]="months" [numCols]="3" [cellRatio]="3 / 7"\n [activeCell]="activeCell"\n [todayValue]="todayMonth"\n [selectedValues]="selectedMonths"\n [selectMode]="selectMode"\n (keydown)="handleCalendarKeydown($event)"\n (select)="selectCalendarCell($event)">\n </tbody>\n</table>\n',host:{"[class.owl-dt-calendar-view]":"owlDTCalendarView"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],ht.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:Ne,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[He]}]}]},ht.propDecorators={selectMode:[{type:t.Input}],selected:[{type:t.Input}],selecteds:[{type:t.Input}],pickerMoment:[{type:t.Input}],dateFilter:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],change:[{type:t.Output}],monthSelected:[{type:t.Output}],pickerMomentChange:[{type:t.Output}],keyboardEnter:[{type:t.Output}],calendarBodyElm:[{type:t.ViewChild,args:[pt,{static:!0}]}]};var ft=function(){function e(e,n,r){this.cdRef=e,this.pickerIntl=n,this.dateTimeAdapter=r,this._selectMode="single",this._selecteds=[],this.initiated=!1,this.change=new t.EventEmitter,this.yearSelected=new t.EventEmitter,this.pickerMomentChange=new t.EventEmitter,this.keyboardEnter=new t.EventEmitter}return Object.defineProperty(e.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){this._selectMode=e,this.initiated&&(this.setSelectedYears(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){var t=this._selected;e=this.dateTimeAdapter.deserialize(e),this._selected=this.getValidDate(e),this.dateTimeAdapter.isSameDay(t,this._selected)||this.setSelectedYears()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){var t=this;this._selecteds=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),t.getValidDate(e)})),this.setSelectedYears()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){var t=this._pickerMoment;e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now(),t&&this._pickerMoment&&!this.isSameYearList(t,this._pickerMoment)&&this.generateYearList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateFilter",{get:function(){return this._dateFilter},set:function(e){this._dateFilter=e,this.initiated&&this.generateYearList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._minDate=this.getValidDate(e),this.initiated&&this.generateYearList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._maxDate=this.getValidDate(e),this.initiated&&this.generateYearList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todayYear",{get:function(){return this._todayYear},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"years",{get:function(){return this._years},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedYears",{get:function(){return this._selectedYears},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeCell",{get:function(){if(this._pickerMoment)return this.dateTimeAdapter.getYear(this._pickerMoment)%21},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableHeader",{get:function(){if(this._years&&this._years.length>0)return this._years[0][0].displayValue+" ~ "+this._years[6][2].displayValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prevButtonLabel",{get:function(){return this.pickerIntl.prevMultiYearLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextButtonLabel",{get:function(){return this.pickerIntl.nextMultiYearLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarView",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarMultiYearView",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.ngAfterContentInit=function(){this._todayYear=this.dateTimeAdapter.getYear(this.dateTimeAdapter.now()),this.generateYearList(),this.initiated=!0},e.prototype.selectCalendarCell=function(e){this.selectYear(e.value)},e.prototype.selectYear=function(e){this.yearSelected.emit(this.dateTimeAdapter.createDate(e,0,1));var t=this.dateTimeAdapter.createDate(e,this.dateTimeAdapter.getMonth(this.pickerMoment),1),n=this.dateTimeAdapter.getNumDaysInMonth(t),r=this.dateTimeAdapter.createDate(e,this.dateTimeAdapter.getMonth(this.pickerMoment),Math.min(n,this.dateTimeAdapter.getDate(this.pickerMoment)),this.dateTimeAdapter.getHours(this.pickerMoment),this.dateTimeAdapter.getMinutes(this.pickerMoment),this.dateTimeAdapter.getSeconds(this.pickerMoment));this.change.emit(r)},e.prototype.prevYearList=function(e){this._pickerMoment=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,-21),this.generateYearList(),e.preventDefault()},e.prototype.nextYearList=function(e){this._pickerMoment=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,21),this.generateYearList(),e.preventDefault()},e.prototype.generateYearList=function(){this._years=[];for(var e=this.dateTimeAdapter.getYear(this._pickerMoment),t=e%21,n=0;n<7;n++){for(var r=[],i=0;i<3;i++){var o=e-t+(i+3*n),a=this.createYearCell(o);r.push(a)}this._years.push(r)}},e.prototype.previousEnabled=function(){return!this.minDate||(!this.minDate||!this.isSameYearList(this._pickerMoment,this.minDate))},e.prototype.nextEnabled=function(){return!this.maxDate||!this.isSameYearList(this._pickerMoment,this.maxDate)},e.prototype.handleCalendarKeydown=function(e){var t;switch(e.keyCode){case d.LEFT_ARROW:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,-1),this.pickerMomentChange.emit(t);break;case d.RIGHT_ARROW:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,1),this.pickerMomentChange.emit(t);break;case d.UP_ARROW:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,-3),this.pickerMomentChange.emit(t);break;case d.DOWN_ARROW:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,3),this.pickerMomentChange.emit(t);break;case d.HOME:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,-this.dateTimeAdapter.getYear(this._pickerMoment)%21),this.pickerMomentChange.emit(t);break;case d.END:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,21-this.dateTimeAdapter.getYear(this._pickerMoment)%21-1),this.pickerMomentChange.emit(t);break;case d.PAGE_UP:t=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,e.altKey?-210:-21),this.pickerMomentChange.emit(t);break;case d.PAGE_DOWN:t=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,e.altKey?210:21),this.pickerMomentChange.emit(t);break;case d.ENTER:this.selectYear(this.dateTimeAdapter.getYear(this._pickerMoment)),this.keyboardEnter.emit();break;default:return}this.focusActiveCell(),e.preventDefault()},e.prototype.createYearCell=function(e){var t=this.dateTimeAdapter.createDate(e,0,1),n=this.dateTimeAdapter.getYearName(t),r="owl-dt-year-"+e;return new ut(e,e.toString(),n,this.isYearEnabled(e),!1,r)},e.prototype.setSelectedYears=function(){var e=this;this._selectedYears=[],this.isInSingleMode&&this.selected&&(this._selectedYears[0]=this.dateTimeAdapter.getYear(this.selected)),this.isInRangeMode&&this.selecteds&&(this._selectedYears=this.selecteds.map((function(t){return e.dateTimeAdapter.isValid(t)?e.dateTimeAdapter.getYear(t):null})))},e.prototype.isYearEnabled=function(e){if(null==e||this.maxDate&&e>this.dateTimeAdapter.getYear(this.maxDate)||this.minDate&&e<this.dateTimeAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(var t=this.dateTimeAdapter.createDate(e,0,1);this.dateTimeAdapter.getYear(t)===e;t=this.dateTimeAdapter.addCalendarDays(t,1))if(this.dateFilter(t))return!0;return!1},e.prototype.isSameYearList=function(e,t){return Math.floor(this.dateTimeAdapter.getYear(e)/21)===Math.floor(this.dateTimeAdapter.getYear(t)/21)},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e.prototype.focusActiveCell=function(){this.calendarBodyElm.focusActiveCell()},e}();ft.decorators=[{type:t.Component,args:[{selector:"owl-date-time-multi-year-view",template:'<button class="owl-dt-control-button owl-dt-control-arrow-button"\n [disabled]="!previousEnabled()" [attr.aria-label]="prevButtonLabel"\n type="button" tabindex="0" (click)="prevYearList($event)">\n <span class="owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Left"> --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n version="1.1" x="0px" y="0px" viewBox="0 0 250.738 250.738"\n style="enable-background:new 0 0 250.738 250.738;" xml:space="preserve"\n width="100%" height="100%">\n <path style="fill-rule: evenodd; clip-rule: evenodd;" d="M96.633,125.369l95.053-94.533c7.101-7.055,7.101-18.492,0-25.546 c-7.1-7.054-18.613-7.054-25.714,0L58.989,111.689c-3.784,3.759-5.487,8.759-5.238,13.68c-0.249,4.922,1.454,9.921,5.238,13.681 l106.983,106.398c7.101,7.055,18.613,7.055,25.714,0c7.101-7.054,7.101-18.491,0-25.544L96.633,125.369z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n</button>\n<table class="owl-dt-calendar-table owl-dt-calendar-multi-year-table">\n <thead class="owl-dt-calendar-header">\n <tr>\n <th colspan="3">{{tableHeader}}</th>\n </tr>\n </thead>\n <tbody owl-date-time-calendar-body role="grid"\n [rows]="years" [numCols]="3" [cellRatio]="3 / 7"\n [activeCell]="activeCell"\n [todayValue]="todayYear"\n [selectedValues]="selectedYears"\n [selectMode]="selectMode"\n (keydown)="handleCalendarKeydown($event)"\n (select)="selectCalendarCell($event)"></tbody>\n</table>\n<button class="owl-dt-control-button owl-dt-control-arrow-button"\n [disabled]="!nextEnabled()" [attr.aria-label]="nextButtonLabel"\n type="button" tabindex="0" (click)="nextYearList($event)">\n <span class="owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Right"> --\x3e\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 250.738 250.738" style="enable-background:new 0 0 250.738 250.738;" xml:space="preserve">\n <path style="fill-rule:evenodd;clip-rule:evenodd;" d="M191.75,111.689L84.766,5.291c-7.1-7.055-18.613-7.055-25.713,0\n c-7.101,7.054-7.101,18.49,0,25.544l95.053,94.534l-95.053,94.533c-7.101,7.054-7.101,18.491,0,25.545\n c7.1,7.054,18.613,7.054,25.713,0L191.75,139.05c3.784-3.759,5.487-8.759,5.238-13.681\n C197.237,120.447,195.534,115.448,191.75,111.689z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n</button>\n',host:{"[class.owl-dt-calendar-view]":"owlDTCalendarView","[class.owl-dt-calendar-multi-year-view]":"owlDTCalendarMultiYearView"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],ft.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:Fe},{type:Ne,decorators:[{type:t.Optional}]}]},ft.propDecorators={selectMode:[{type:t.Input}],selected:[{type:t.Input}],selecteds:[{type:t.Input}],pickerMoment:[{type:t.Input}],dateFilter:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],change:[{type:t.Output}],yearSelected:[{type:t.Output}],pickerMomentChange:[{type:t.Output}],keyboardEnter:[{type:t.Output}],calendarBodyElm:[{type:t.ViewChild,args:[pt,{static:!0}]}]};var mt=function(){function e(){this.showDivider=!1,this.step=1,this.valueChange=new t.EventEmitter,this.inputChange=new t.EventEmitter,this.inputStream=new i.Subject,this.inputStreamSub=i.Subscription.EMPTY}return Object.defineProperty(e.prototype,"displayValue",{get:function(){return this.boxValue||this.value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTTimerBoxClass",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.inputStreamSub=this.inputStream.pipe(f.debounceTime(500),f.distinctUntilChanged()).subscribe((function(t){if(t){var n=h.coerceNumberProperty(t,0);e.updateValueViaInput(n)}}))},e.prototype.ngOnDestroy=function(){this.inputStreamSub.unsubscribe()},e.prototype.upBtnClicked=function(){this.updateValue(this.value+this.step)},e.prototype.downBtnClicked=function(){this.updateValue(this.value-this.step)},e.prototype.handleInputChange=function(e){this.inputStream.next(e)},e.prototype.updateValue=function(e){this.valueChange.emit(e)},e.prototype.updateValueViaInput=function(e){e>this.max||e<this.min||this.inputChange.emit(e)},e}();mt.decorators=[{type:t.Component,args:[{exportAs:"owlDateTimeTimerBox",selector:"owl-date-time-timer-box",template:'<div *ngIf="showDivider" class="owl-dt-timer-divider" aria-hidden="true"></div>\n<button class="owl-dt-control-button owl-dt-control-arrow-button"\n type="button" tabindex="-1"\n [disabled]="upBtnDisabled"\n [attr.aria-label]="upBtnAriaLabel"\n (click)="upBtnClicked()">\n <span class="owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Up"> --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n version="1.1" x="0px" y="0px" viewBox="0 0 451.847 451.846"\n style="enable-background:new 0 0 451.847 451.846;" xml:space="preserve"\n width="100%" height="100%">\n <path d="M248.292,106.406l194.281,194.29c12.365,12.359,12.365,32.391,0,44.744c-12.354,12.354-32.391,12.354-44.744,0\n L225.923,173.529L54.018,345.44c-12.36,12.354-32.395,12.354-44.748,0c-12.359-12.354-12.359-32.391,0-44.75L203.554,106.4\n c6.18-6.174,14.271-9.259,22.369-9.259C234.018,97.141,242.115,100.232,248.292,106.406z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n</button>\n<label class="owl-dt-timer-content">\n <input class="owl-dt-timer-input" maxlength="2"\n [value]="displayValue | numberFixedLen : 2"\n (input)="handleInputChange(valueInput.value)" #valueInput>\n <span class="owl-hidden-accessible">{{inputLabel}}</span>\n</label>\n<button class="owl-dt-control-button owl-dt-control-arrow-button"\n type="button" tabindex="-1"\n [disabled]="downBtnDisabled"\n [attr.aria-label]="downBtnAriaLabel"\n (click)="downBtnClicked()">\n <span class="owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Down"> --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n version="1.1" x="0px" y="0px" viewBox="0 0 451.847 451.846"\n style="enable-background:new 0 0 451.847 451.846;" xml:space="preserve"\n width="100%" height="100%">\n <path d="M225.923,354.706c-8.098,0-16.195-3.092-22.369-9.263L9.27,151.157c-12.359-12.359-12.359-32.397,0-44.751\n c12.354-12.354,32.388-12.354,44.748,0l171.905,171.915l171.906-171.909c12.359-12.354,32.391-12.354,44.744,0\n c12.365,12.354,12.365,32.392,0,44.751L248.292,345.449C242.115,351.621,234.018,354.706,225.923,354.706z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n</button>\n',preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,host:{"[class.owl-dt-timer-box]":"owlDTTimerBoxClass"},styles:[""]}]}],mt.ctorParameters=function(){return[]},mt.propDecorators={showDivider:[{type:t.Input}],upBtnAriaLabel:[{type:t.Input}],upBtnDisabled:[{type:t.Input}],downBtnAriaLabel:[{type:t.Input}],downBtnDisabled:[{type:t.Input}],boxValue:[{type:t.Input}],value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],step:[{type:t.Input}],inputLabel:[{type:t.Input}],valueChange:[{type:t.Output}],inputChange:[{type:t.Output}]};var yt=function(){function e(){}return e.prototype.transform=function(e,t){var n=Math.floor(e),r=Math.floor(t);if(null===e||isNaN(n)||isNaN(r))return e;for(var i=n.toString();i.length<r;)i="0"+i;return i},e}();yt.decorators=[{type:t.Pipe,args:[{name:"numberFixedLen"}]}];var gt={provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return bt})),multi:!0},bt=function(e){function n(n,r,i){var o=e.call(this,r,i)||this;return o.changeDetector=n,o.dateTimeAdapter=r,o.dateTimeFormats=i,o._pickerType="both",o._disabled=!1,o._selectMode="single",o._values=[],o.yearSelected=new t.EventEmitter,o.monthSelected=new t.EventEmitter,o._selecteds=[],o.onModelChange=function(){},o.onModelTouched=function(){},o}return C(n,e),Object.defineProperty(n.prototype,"pickerType",{get:function(){return this._pickerType},set:function(e){e!==this._pickerType&&(this._pickerType=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return!!this._disabled},set:function(e){this._disabled=h.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){if("single"!==e&&"range"!==e&&"rangeFrom"!==e&&"rangeTo"!==e)throw Error("OwlDateTime Error: invalid selectMode value!");this._selectMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"startAt",{get:function(){return this._startAt?this._startAt:"single"===this.selectMode?this.value||null:"range"===this.selectMode||"rangeFrom"===this.selectMode?this.values[0]||null:"rangeTo"===this.selectMode&&this.values[1]||null},set:function(e){this._startAt=this.getValidDate(this.dateTimeAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dateTimeFilter",{get:function(){return this._dateTimeFilter},set:function(e){this._dateTimeFilter=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"minDateTime",{get:function(){return this._min||null},set:function(e){this._min=this.getValidDate(this.dateTimeAdapter.deserialize(e)),this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"maxDateTime",{get:function(){return this._max||null},set:function(e){this._max=this.getValidDate(this.dateTimeAdapter.deserialize(e)),this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(e){e=this.dateTimeAdapter.deserialize(e),e=this.getValidDate(e),this._value=e,this.selected=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this._values},set:function(e){var t=this;e&&e.length>0?(e=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),(e=t.getValidDate(e))?t.dateTimeAdapter.clone(e):null})),this._values=M(e),this.selecteds=M(e)):(this._values=[],this.selecteds=[])},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=e,this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){this._selecteds=e,this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"opened",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pickerMode",{get:function(){return"inline"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInSingleMode",{get:function(){return"single"===this._selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInRangeMode",{get:function(){return"range"===this._selectMode||"rangeFrom"===this._selectMode||"rangeTo"===this._selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDTInlineClass",{get:function(){return!0},enumerable:!1,configurable:!0}),n.prototype.ngOnInit=function(){this.container.picker=this},n.prototype.writeValue=function(e){this.isInSingleMode?(this.value=e,this.container.pickerMoment=e):(this.values=e,this.container.pickerMoment=this._values[this.container.activeSelectedIndex])},n.prototype.registerOnChange=function(e){this.onModelChange=e},n.prototype.registerOnTouched=function(e){this.onModelTouched=e},n.prototype.setDisabledState=function(e){this.disabled=e},n.prototype.select=function(e){this.disabled||(Array.isArray(e)?this.values=M(e):this.value=e,this.onModelChange(e),this.onModelTouched())},n.prototype.selectYear=function(e){this.yearSelected.emit(e)},n.prototype.selectMonth=function(e){this.monthSelected.emit(e)},n}(ze);bt.decorators=[{type:t.Component,args:[{selector:"owl-date-time-inline",template:"<owl-date-time-container></owl-date-time-container>",host:{"[class.owl-dt-inline]":"owlDTInlineClass"},changeDetection:t.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,providers:[gt],styles:[""]}]}],bt.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:Ne,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[He]}]}]},bt.propDecorators={container:[{type:t.ViewChild,args:[Qe,{static:!0}]}],pickerType:[{type:t.Input}],disabled:[{type:t.Input}],selectMode:[{type:t.Input}],startAt:[{type:t.Input}],dateTimeFilter:[{type:t.Input,args:["owlDateTimeFilter"]}],minDateTime:[{type:t.Input,args:["min"]}],maxDateTime:[{type:t.Input,args:["max"]}],value:[{type:t.Input}],values:[{type:t.Input}],yearSelected:[{type:t.Output}],monthSelected:[{type:t.Output}]};var vt=function(){};vt.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,c.A11yModule,u.OverlayModule,p.PortalModule],exports:[],declarations:[Je],providers:[et,nt],entryComponents:[Je]}]}];var wt=function(){};wt.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,u.OverlayModule,vt,c.A11yModule],exports:[Le,Ye,qe,ct,at,bt,ft,ht,dt],declarations:[qe,ct,at,Qe,ft,ht,dt,Ye,mt,Le,pt,yt,bt],providers:[Fe,ot],entryComponents:[Qe]}]}];var xt={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},kt={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},Ct=Dt(31,(function(e){return String(e+1)})),Tt="undefined"!=typeof Intl,Ot=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;function Dt(e,t){for(var n=Array(e),r=0;r<e;r++)n[r]=t(r);return n}var Mt=function(e){function t(t,n){var r=e.call(this)||this;return r.owlDateTimeLocale=t,e.prototype.setLocale.call(r,t),r.useUtcForDisplay=!n.TRIDENT,r._clampDate=n.TRIDENT||n.EDGE,r}return C(t,e),t.prototype.getYear=function(e){return e.getFullYear()},t.prototype.getMonth=function(e){return e.getMonth()},t.prototype.getDay=function(e){return e.getDay()},t.prototype.getDate=function(e){return e.getDate()},t.prototype.getHours=function(e){return e.getHours()},t.prototype.getMinutes=function(e){return e.getMinutes()},t.prototype.getSeconds=function(e){return e.getSeconds()},t.prototype.getTime=function(e){return e.getTime()},t.prototype.getNumDaysInMonth=function(e){var t=this.createDateWithOverflow(this.getYear(e),this.getMonth(e)+1,0);return this.getDate(t)},t.prototype.differenceInCalendarDays=function(e,t){if(this.isValid(e)&&this.isValid(t)){var n=this.createDate(this.getYear(e),this.getMonth(e),this.getDate(e)),r=this.createDate(this.getYear(t),this.getMonth(t),this.getDate(t)),i=this.getTime(n)-n.getTimezoneOffset()*this.milliseondsInMinute,o=this.getTime(r)-r.getTimezoneOffset()*this.milliseondsInMinute;return Math.round((i-o)/this.millisecondsInDay)}return null},t.prototype.getYearName=function(e){if(Tt){var t=new Intl.DateTimeFormat(this.locale,{year:"numeric",timeZone:"utc"});return this.stripDirectionalityCharacters(this._format(t,e))}return String(this.getYear(e))},t.prototype.getMonthNames=function(e){var t=this;if(Tt){var n=new Intl.DateTimeFormat(this.locale,{month:e,timeZone:"utc"});return Dt(12,(function(e){return t.stripDirectionalityCharacters(t._format(n,new Date(2017,e,1)))}))}return xt[e]},t.prototype.getDayOfWeekNames=function(e){var t=this;if(Tt){var n=new Intl.DateTimeFormat(this.locale,{weekday:e,timeZone:"utc"});return Dt(7,(function(e){return t.stripDirectionalityCharacters(t._format(n,new Date(2017,0,e+1)))}))}return kt[e]},t.prototype.getDateNames=function(){var e=this;if(Tt){var t=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return Dt(31,(function(n){return e.stripDirectionalityCharacters(e._format(t,new Date(2017,0,n+1)))}))}return Ct},t.prototype.toIso8601=function(e){return e.toISOString()},t.prototype.isEqual=function(e,t){return!(!this.isValid(e)||!this.isValid(t))&&e.getTime()===t.getTime()},t.prototype.isSameDay=function(e,t){if(this.isValid(e)&&this.isValid(t)){var n=this.clone(e),r=this.clone(t);return n.setHours(0,0,0,0),r.setHours(0,0,0,0),n.getTime()===r.getTime()}return!1},t.prototype.isValid=function(e){return e&&!isNaN(e.getTime())},t.prototype.invalid=function(){return new Date(NaN)},t.prototype.isDateInstance=function(e){return e instanceof Date},t.prototype.addCalendarYears=function(e,t){return this.addCalendarMonths(e,12*t)},t.prototype.addCalendarMonths=function(e,t){var n=this.clone(e);t=Number(t);var r=n.getMonth()+t,i=new Date(0);i.setFullYear(n.getFullYear(),r,1),i.setHours(0,0,0,0);var o=this.getNumDaysInMonth(i);return n.setMonth(r,Math.min(o,n.getDate())),n},t.prototype.addCalendarDays=function(e,t){var n=this.clone(e);return t=Number(t),n.setDate(n.getDate()+t),n},t.prototype.setHours=function(e,t){var n=this.clone(e);return n.setHours(t),n},t.prototype.setMinutes=function(e,t){var n=this.clone(e);return n.setMinutes(t),n},t.prototype.setSeconds=function(e,t){var n=this.clone(e);return n.setSeconds(t),n},t.prototype.createDate=function(e,t,n,r,i,o){if(void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),t<0||t>11)throw Error('Invalid month index "'+t+'". Month index has to be between 0 and 11.');if(n<1)throw Error('Invalid date "'+n+'". Date has to be greater than 0.');if(r<0||r>23)throw Error('Invalid hours "'+r+'". Hours has to be between 0 and 23.');if(i<0||i>59)throw Error('Invalid minutes "'+i+'". Minutes has to between 0 and 59.');if(o<0||o>59)throw Error('Invalid seconds "'+o+'". Seconds has to be between 0 and 59.');var a=this.createDateWithOverflow(e,t,n,r,i,o);if(a.getMonth()!==t)throw Error('Invalid date "'+n+'" for month with index "'+t+'".');return a},t.prototype.clone=function(e){return this.createDate(this.getYear(e),this.getMonth(e),this.getDate(e),this.getHours(e),this.getMinutes(e),this.getSeconds(e))},t.prototype.now=function(){return new Date},t.prototype.format=function(e,t){if(!this.isValid(e))throw Error("JSNativeDate: Cannot format invalid date.");if(Tt){this._clampDate&&(e.getFullYear()<1||e.getFullYear()>9999)&&(e=this.clone(e)).setFullYear(Math.max(1,Math.min(9999,e.getFullYear()))),t=Object.assign(Object.assign({},t),{timeZone:"utc"});var n=new Intl.DateTimeFormat(this.locale,t);return this.stripDirectionalityCharacters(this._format(n,e))}return this.stripDirectionalityCharacters(e.toDateString())},t.prototype.parse=function(e,t){return"number"==typeof e?new Date(e):e?new Date(Date.parse(e)):null},t.prototype.deserialize=function(t){if("string"==typeof t){if(!t)return null;if(Ot.test(t)){var n=new Date(t);if(this.isValid(n))return n}}return e.prototype.deserialize.call(this,t)},t.prototype.createDateWithOverflow=function(e,t,n,r,i,o){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0);var a=new Date(e,t,n,r,i,o);return e>=0&&e<100&&a.setFullYear(this.getYear(a)-1900),a},t.prototype.stripDirectionalityCharacters=function(e){return e.replace(/[\u200e\u200f]/g,"")},t.prototype._format=function(e,t){var n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.format(n)},t}(Ne);Mt.decorators=[{type:t.Injectable}],Mt.ctorParameters=function(){return[{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[je]}]},{type:m.Platform}]};var At={parseInput:null,fullPickerInput:{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"},datePickerInput:{year:"numeric",month:"numeric",day:"numeric"},timePickerInput:{hour:"numeric",minute:"numeric"},monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}},St=function(){};St.decorators=[{type:t.NgModule,args:[{imports:[m.PlatformModule],providers:[{provide:Ne,useClass:Mt}]}]}];var _t=At,It=function(){};It.decorators=[{type:t.NgModule,args:[{imports:[St],providers:[{provide:He,useValue:_t}]}]}];var Pt=function(){};Pt.decorators=[{type:t.NgModule,args:[{schemas:[t.CUSTOM_ELEMENTS_SCHEMA],imports:[n.CommonModule,r.FormsModule,wt,It],declarations:[Ve],exports:[Ve],providers:[]}]}];var Et=function(e){this.label=e.label,this.value=e.value},Vt=function(){function e(){this.question_options=[],this.errors=[],this.propagateChange=function(e){}}return e.prototype.getChangingText=function(e){var t=this;this.getData(e).subscribe((function(e){t.question_options=e}))},e.prototype.writeValue=function(e){},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.ngOnChanges=function(e){},e.prototype.ngOnInit=function(){var e=this;this.extras&&this.extras.originalValue&&this.resolveSelectedOption(this.extras.originalValue).subscribe((function(t){e.selected_question_option=t}))},e.prototype.getData=function(e){var t=this;return this.subject=new i.BehaviorSubject([]),this.dataSource.searchOptions(e).subscribe((function(e){for(var n=new Array,r=0;r<e.length;r++)n.push(new Et(e[r]));t.subject.next(n)}),(function(e){t.subject.error(e)})),this.subject.asObservable()},e.prototype.onValueChange=function(e){},e.prototype.resolveSelectedOption=function(e){var t=this;return this.subjectOption=new i.BehaviorSubject(null),this.dataSource.resolveSelectedValue(e).subscribe((function(e){t.subjectOption.next(e)}),(function(e){t.subjectOption.error(e)})),this.subjectOption.asObservable()},e.prototype.resetOptions=function(){this.subject.next(new Array)},e}();Vt.decorators=[{type:t.Component,args:[{selector:"afe-ng-select",template:'<ng-select\n (searchInputText)="getChangingText($event)"\n (ngModelChange)="onValueChange($event)"\n [options]="question_options"\n [multiple]="multiple"\n >\n </ng-select> ',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Vt})),multi:!0}]}]}],Vt.propDecorators={dataSource:[{type:t.Input}],multiple:[{type:t.Input}],extras:[{type:t.Input}]};var qt=function(){function e(){}return e.prototype.compileFormSchema=function(e,t){var n=this.getReferencedForms(e,t);if(a.isEmpty(n))return e;var r=this.getAllPlaceholderObjects(e);return a.isEmpty(r)||this.replaceAllPlaceholdersWithActualObjects(n,r),e},e.prototype.findSchemaByName=function(e,t){if(!a.isEmpty(e)&&!a.isEmpty(t)){var n={};return a.each(e,(function(e){e.name===t&&(n=e)})),n}},e.prototype.getPageInSchemaByLabel=function(e,t){if(!a.isEmpty(e)&&!a.isEmpty(t)){var n={};return a.each(e.pages,(function(e){e.label===t&&(n=e)})),n}},e.prototype.getSectionInSchemaByPageLabelBySectionLabel=function(e,t,n){if(!(a.isEmpty(e)||a.isEmpty(t)||a.isEmpty(n))){var r=this.getPageInSchemaByLabel(e,t);if(!a.isEmpty(r)){var i={};return a.each(r.sections,(function(e){e.label===n&&(i=e)})),i}}},e.prototype.getQuestionByIdInSchema=function(e,t){if(!a.isEmpty(e)&&!a.isEmpty(t)){if(Array.isArray(e)){for(var n=void 0,r=0;r<e.length&&(a.isEmpty(e[r])||(n=this.getQuestionByIdInSchema(e[r],t)),a.isEmpty(n));r++);return n}if("object"!=typeof e);else{if(this.isQuestionObjectWithId(e,t))return e;if(this.isSchemaSubObjectExpandable(e)){var i=e.pages||e.sections||e.questions;return this.getQuestionByIdInSchema(i,t)}}}},e.prototype.getQuestionsArrayByQuestionIdInSchema=function(e,t){if(!a.isEmpty(e)&&!a.isEmpty(t))return this.getQuestionsArrayByQuestionId(e,e,t)},e.prototype.getQuestionsArrayByQuestionId=function(e,t,n){if(Array.isArray(t)){for(var r=void 0,i=0;i<t.length&&(a.isEmpty(t[i])||(r=this.getQuestionsArrayByQuestionId(t,t[i],n)),a.isEmpty(r));i++);return r}if("object"!=typeof t);else{if(this.isQuestionObjectWithId(t,n))return e;if(this.isSchemaSubObjectExpandable(t)){var o=t.pages||t.sections||t.questions;return this.getQuestionsArrayByQuestionId(o,o,n)}}},e.prototype.isSchemaSubObjectExpandable=function(e){if("object"==typeof e){var t=Object.keys(e);if(a.includes(t,"pages")||a.includes(t,"sections")||a.includes(t,"questions"))return!0}return!1},e.prototype.isQuestionObjectWithId=function(e,t){return e.id===t},e.prototype.getAllPlaceholderObjects=function(e){var t=[];return this.extractPlaceholderObjects(e,t),t},e.prototype.extractPlaceholderObjects=function(e,t){if(!a.isEmpty(e))if(Array.isArray(e))for(var n=0;n<e.length;n++)a.isEmpty(e[n])||this.extractPlaceholderObjects(e[n],t);else if("object"==typeof e)if(a.isEmpty(e.reference)){if(this.isSchemaSubObjectExpandable(e)){var r=e.pages||e.sections||e.questions;this.extractPlaceholderObjects(r,t)}}else t.push(e)},e.prototype.fillPlaceholderObject=function(e,t){for(var n in t)a.isEmpty(e[n])&&(e[n]=t[n]);return e},e.prototype.replaceAllPlaceholdersWithActualObjects=function(e,t){var n=this;return a.each(t,(function(t){var r=n.getReferencedObject(t.reference,e);a.isEmpty(r)?console.error("Form compile: Error finding referenced object",t.reference):(t=n.fillPlaceholderObject(t,r),delete(t=n.removeExcludedQuestionsFromPlaceholder(t)).reference)})),t},e.prototype.removeObjectFromArray=function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)},e.prototype.removeExcludedQuestionsFromPlaceholder=function(e){var t=this;return Array.isArray(e.reference.excludeQuestions)&&a.each(e.reference.excludeQuestions,(function(n){var r=t.getQuestionsArrayByQuestionIdInSchema(e,n);if(Array.isArray(r)){var i=t.getQuestionByIdInSchema(r,n);t.removeObjectFromArray(r,i)}})),e},e.prototype.getReferencedObject=function(e,t){if(a.isEmpty(e.form))console.error("Form compile: reference missing form attribute",e);else{if(!a.isEmpty(t[e.form]))return a.isEmpty(e.questionId)?a.isEmpty(e.page)||a.isEmpty(e.section)?a.isEmpty(e.page)?void console.error("Form compile: Unsupported reference type",e.reference):this.getPageInSchemaByLabel(t[e.form],e.page):this.getSectionInSchemaByPageLabelBySectionLabel(t[e.form],e.page,e.section):this.getQuestionByIdInSchema(t[e.form],e.questionId);console.error("Form compile: referenced form alias not found",e)}},e.prototype.getReferencedForms=function(e,t){var n=this,r=e.referencedForms;if(!a.isEmpty(r)){var i={};return a.each(r,(function(e){i[e.alias]=n.findSchemaByName(t,e.formName)})),i}},e}();qt.decorators=[{type:t.Injectable}],qt.ctorParameters=function(){return[]};var Ft=function(t){function n(n){var r=t.call(this,n)||this;return r.placeholder=n.placeholder||"",r.controlType=e.AfeControlType.AfeFormControl,r}return C(n,t),n}(W),jt=function(t){function n(n){var r=t.call(this,n)||this;return r.placeholder=n.placeholder||"",r.isExpanded=n.isExpanded||!1,r.rows=n.rows||18,r.renderingType="textarea",r.controlType=e.AfeControlType.AfeFormControl,r}return C(n,t),n}(Ft),Rt=function(t){function n(n){var r=t.call(this,n)||this;return r.renderingType="select",r.options=n.options||[],r.controlType=e.AfeControlType.AfeFormControl,r.dataSource=n.dataSource||"",r}return C(n,t),n}(W),Nt=function(t){function n(n){var r=t.call(this,n)||this;return r.renderingType="ui-select",r.options=n.options||[],r.controlType=e.AfeControlType.AfeFormControl,r}return C(n,t),n}(W),Ht=function(t){function n(n){var r=t.call(this,n)||this;return r.showTime=!0,r.showWeeksAdder=!1,r.renderingType="date",r.controlType=e.AfeControlType.AfeFormControl,r}return C(n,t),n}(W),Lt=function(t){function n(n){var r=t.call(this,n)||this;return r.renderingType="multi-select",r.options=n.options||[],r.controlType=e.AfeControlType.AfeFormControl,r}return C(n,t),n}(Rt),Yt=function(e){function t(t){return e.call(this,t)||this}return C(t,e),t}(W),Bt=function(t){function n(n){var r=t.call(this,n)||this;return r.isExpanded=!0,r.renderingType="group",r.questions=n.questions||[],r.controlType=e.AfeControlType.AfeFormGroup,r}return C(n,t),n}(Yt),Qt=function(t){function n(n){var r=t.call(this,n)||this;return r.renderingType="repeating",r.questions=n.questions||[],r.controlType=e.AfeControlType.AfeFormArray,r}return C(n,t),n}(Yt),Gt=function(t){function n(n){var r=t.call(this,n)||this;return r.renderingType="checkbox",r.options=n.options||[],r.controlType=e.AfeControlType.AfeFormControl,r}return C(n,t),n}(W),zt=function(t){function n(n){var r=t.call(this,n)||this;return r.showTime=!0,r.showWeeksAdder=!1,r.renderingType="file",r.dataSource=n.dataSource,r.controlType=e.AfeControlType.AfeFormControl,r}return C(n,t),n}(W),Wt=function(t){function n(n){var r=t.call(this,n)||this;return r.renderingType="select",r.orderType=n.orderType,r.selectableOrders=n.selectableOrders,r.options=n.options,r.orderSettingUuid=n.orderSettingUuid,r.rendering=n.orderSettingUuid,r.controlType=e.AfeControlType.AfeFormControl,r}return C(n,t),n}(W),Ut=function(e){function t(t){var n=e.call(this,t)||this;return n.allowFutureDates=!1,n.allowFutureDates="true"===t.allowFutureDates,n}return C(t,e),t}(j),$t=function(e){function t(t){var n=e.call(this,t)||this,r=t.max;return n.max=+r,n}return C(t,e),t}(j),Jt=function(e){function t(t){var n=e.call(this,t)||this,r=t.min;return n.min=+r,n}return C(t,e),t}(j),Zt=function(){function e(){this.returnErrorOnNext=!1}return e.prototype.resolveSelectedValue=function(e){var t=this.sampleData();t=(t=t.map((function(e){return new Et({label:e.label,value:e.concept})}))).filter((function(t){return t.value===e}));var n=new i.BehaviorSubject([]);return this.returnErrorOnNext?n.error(new Error("Error loading Options")):n.next(t[0]),n.asObservable()},e.prototype.fileUpload=function(e){return i.of({image:""})},e.prototype.fetchFile=function(e){return i.of({image:""})},e.prototype.searchOptions=function(e){var t=this.sampleData();t=(t=t.map((function(e){return new Et({label:e.label,value:e.concept})}))).filter((function(t){return-1!==t.label.indexOf(e)}));var n=new i.BehaviorSubject([]);return this.returnErrorOnNext?n.error(new Error("Error loading Options")):n.next(t),n.asObservable()},e.prototype.sampleData=function(){return[{concept:"a899e0ac-1350-11df-a1f1-0026b9348838",label:"None"},{concept:"a8ad1276-1350-11df-a1f1-0026b9348838",label:"Breathlessness"},{concept:"a892e4b4-1350-11df-a1f1-0026b9348838",label:"Chest pain"},{concept:"a8afc8b8-1350-11df-a1f1-0026b9348838",label:"Cough = 2 weeks"},{concept:"d7adae14-c386-49cc-8f7c-765d8ceec566",label:"Fever for = 2 weeks"},{concept:"3f57aafc-7162-41da-a51b-6a804cb6f5e8",label:"New exposure to household contact with TB"},{concept:"a89807f0-1350-11df-a1f1-0026b9348838",label:"Noticeable Weight loss"},{concept:"e1862fef-68ed-4df4-90dd-a00152f719aa",label:"Night sweats = 2 weeks"},{concept:"a8ad462e-1350-11df-a1f1-0026b9348838",label:"Abdomen"},{concept:"f218c60e-4b54-475a-a4fa-facab9216da8",label:"Groin"},{concept:"a8a774b0-1350-11df-a1f1-0026b9348838",label:"Joints"},{concept:"4639388c-ee31-4dcf-abb4-ad71253493bb",label:"Neck Kw"}]},e}(),Xt=b,Kt=function(){function e(){this.dataSources={}}return e.prototype.registerEncounters=function(e,t){var n=this,r={data:[],getValue:function(e,t){void 0===t&&(t=0);var i=e.split(".");return i.length>0?n.getFirstValue(i,r.data[t]):r.data[t][e]},getAllObjects:function(){return r.data},getSingleObject:function(e){return void 0===e&&(e=0),r.data[e]}};if(a.isArray(t)){var i=[];a.each(t,(function(e){i.push(n._transformEncounter(e))})),r.data=a.sortBy(i,"encounterDatetime").reverse()}else r.data.push(this._transformEncounter(t));this.putObject(e,r)},e.prototype.putObject=function(e,t){this.dataSources[e]=t},e.prototype.getObject=function(e){return this.dataSources[e]||null},e.prototype.getFirstValue=function(e,t){var n=[];if(this.getAllValues(e,t,n),n.length>0)return{value:n[0],valueDate:Xt(t.encounterDatetime).format("ll")}},e.prototype.getAllValues=function(e,t,n){var r=this;if(!a.isNil(t))if(e.length<=1)a.isNil(t[e[0]])||n.push(t[e[0]]);else{var i=e.splice(1),o=e[0];a.isArray(t[o])&&t[o].length>0?a.each(t[o],(function(e){r.getAllValues(i.slice(0),e,n)})):this.getAllValues(i.slice(0),t[o],n)}},e.prototype._transformEncounter=function(e){if(!a.isNil(e)){var t={encounterDatetime:e.encounterDatetime};if(e.location&&e.location.uuid&&(t.location=e.location.uuid),e.patient&&e.patient.uuid&&(t.patient=e.patient.uuid),e.form&&e.form.uuid&&(t.form=e.form.uuid),e.encounterType&&e.encounterType.uuid&&(t.encounterType=e.encounterType.uuid),e.provider){var n=e.provider;t.provider=n.uuid}if(e.obs){var r=this._transformObs(e.obs);a.extend(t,r)}return t}},e.prototype._transformObs=function(e){var t=this;if(!e)return null;var n={};if(a.isArray(e))return a.each(e,(function(e){t._augumentObs(n,t._transformObs(e))})),n;if(e.groupMembers){var r={};return a.each(e.groupMembers,(function(e){t._augumentObs(r,t._transformObs(e))})),n[e.concept.uuid]&&a.isArray(n[e.concept.uuid])?n[e.concept.uuid].push(r):n[e.concept.uuid]=[r],n}return e.value instanceof Object?n[e.concept.uuid]=e.value.uuid:n[e.concept.uuid]=e.value,n},e.prototype._augumentObs=function(e,t){for(var n in t)if(a.has(e,n)){if(!a.isArray(e[n])){var r=e[n];e[n]=[r]}a.isArray(t[n])?Array.prototype.push.apply(e[n],t[n]):e[n].push(t[n])}else e[n]=t[n];return e},e}();Kt.decorators=[{type:t.Injectable}],Kt.ctorParameters=function(){return[]};var en=function(){function e(){}return e.prototype.evaluate=function(e,t,n){var r=new Kt;r.registerEncounters("prevEnc",t.rawPrevEnc);var i={HD:r};if(n)for(var o in n)n[o]&&(i[o]=n[o]);var a=new re,s=new Q;return(new Y).getRunnable(e,s,a.helperFunctions,i).run()},e.prototype.evaluatePrecondition=function(e,t,n){var r={histValue:n};return this.evaluate(e,t,r)},e}();en.decorators=[{type:t.Injectable}],en.ctorParameters=function(){return[]};var tn=b,nn=function(){function t(){this.dataSources={},this.historicalHelperService=new en}return t.prototype.createQuestionModel=function(e,t){if(t){var n=t.dataSourcesContainer.dataSources;this.dataSources=n}return this.toFormQuestionModel(e)},t.prototype.toSelectQuestion=function(e){var t=new Rt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.options=e.questionOptions.answers.map((function(e){return{label:e.label,value:e.concept}})),t.options.splice(0,0,{label:"",value:""}),t.renderingType=e.questionOptions.rendering,t.validators=this.addValidators(e),t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toNumericQuestion=function(e){var t=new Ft({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="number",t.placeholder=e.questionOptions.placeholder,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toNumberQuestion=function(e){var t=new Ft({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="number",t.placeholder=e.questionOptions.placeholder||"",t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),t.validators=this.addValidators(e),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toDateQuestion=function(e){if("encounterDatetime"===e.type)return this.toEncounterDatetimeQuestion(e);var t=new Ht({type:"",key:""});t.renderingType="date",t.validators=this.addValidators(e),t.extras=e,t.showTime=e.questionOptions.showTime,t.showWeeksAdder=!!e.questionOptions.weeksList;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toEncounterDatetimeQuestion=function(e){var t=new Ht({type:"",key:""});t.label=e.label,t.renderingType="date",t.key=e.id,t.validators=this.addValidators(e),t.extras=e,t.showWeeksAdder=!!e.questionOptions.weeksList;return t.showTime=!0,this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toCheckBoxQuestion=function(e){var t=new Gt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.extras=e,t.options=e.questionOptions.answers.map((function(e){return{label:e.label,value:e.concept}})),t.options.splice(0,0),t.renderingType=e.questionOptions.rendering;return this.copyProperties({label:"label",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toMultiCheckboxQuestion=function(e){var t=new Lt({renderType:"",options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.options=e.questionOptions.answers.map((function(e){return{label:e.label,value:e.concept}})),t.validators=this.addValidators(e),t.dataSource=new Zt,t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toTextAreaQuestion=function(e){var t=new jt({isExpanded:!1,rows:18,placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.placeholder=e.questionOptions.placeholder,t.isExpanded=e.isExpanded,t.rows=e.questionOptions.rows,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toTextQuestion=function(e){var t=new Ft({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="text",t.placeholder=e.questionOptions.placeholder,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toFileUploadQuestion=function(e){var t=new zt({type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="file",t.dataSource="file",t.validators=this.addValidators(e),t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toDrugQuestion=function(e){var t=new Rt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="drug";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toProblemQuestion=function(e){var t=new Rt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="problem";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toConceptAnswerSelect=function(e){var t=new Rt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource=e.questionOptions.dataSource||"conceptAnswers",t.dataSourceOptions={concept:e.questionOptions.concept};return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toRepeatingQuestion=function(e){var t=new Qt({questions:[],type:"",key:""});if(t.label=e.label,t.questions=this.getChildrenQuestionModels(e.questions),t.key=e.id,t.validators=this.addValidators(e),t.extras=e,"testOrder"===e.type){var n=this.toTestOrderQuestion(e),r=[];r.push(n),t.questions=r}return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toGroupQuestion=function(e){var t=new Bt({questions:[],type:"",key:""});t.label=e.label,t.questions=this.getChildrenQuestionModels(e.questions),t.key=e.id,t.validators=this.addValidators(e),t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toPageQuestion=function(t){var n=this,r=new Bt({questions:[],type:"",key:""});return r.label=t.label,r.key=t.label,r.renderingType="page",r.controlType=e.AfeControlType.None,r.questions=[],t.sections.forEach((function(e){r.questions.push(n.toSectionQuestion(e))})),r},t.prototype.toFormQuestionModel=function(t){var n=this,r=new Bt({questions:[],type:"",key:""});return r.label=t.label,r.key=t.label,r.renderingType="form",r.controlType=e.AfeControlType.AfeFormGroup,r.extras=t,r.questions=[],t.pages.forEach((function(e){r.questions.push(n.toPageQuestion(e))})),r},t.prototype.toSectionQuestion=function(t){var n=new Bt({questions:[],type:"",key:""});return n.label=t.label,n.key=t.label,n.renderingType="section",n.controlType=e.AfeControlType.None,n.isExpanded="true"===t.isExpanded,n.questions=this.getSchemaQuestions(t.questions),n},t.prototype.toPersonAttributeQuestion=function(e){var t=new Nt({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="personAttribute";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addHistoricalExpressions(e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toEncounterProviderQuestion=function(e){var t=new Nt({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="provider";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toFieldSetQuestion=function(e){var t=this.toGroupQuestion(e);return t.renderingType="field-set",t},t.prototype.toEncounterLocationQuestion=function(e){var t=new Nt({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType=e.type,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="location";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toTestOrderQuestion=function(e){var t=new Wt({type:"",key:"",orderType:"",selectableOrders:[],orderSettingUuid:"",label:"",rendering:""});t.label=e.label,t.key=e.id,t.validators=this.addValidators(e),t.extras=e,t.options=e.questionOptions.selectableOrders.map((function(e){return{label:e.label,value:e.concept}}));return this.copyProperties({label:"label",required:"required",id:"key"},e,t),t},t.prototype.getSchemaQuestions=function(e){var t=new Array;return this.getQuestions(e,t),t},t.prototype.getQuestions=function(e,t){if(Array.isArray(t)||(t=[]),Array.isArray(e))for(var n in e)e.hasOwnProperty(n)&&this.getQuestions(e[n],t);if(e&&!Array.isArray(e)&&"object"==typeof e)if(e.questionOptions)"group"===e.questionOptions.rendering||"repeating"===e.questionOptions.rendering?t.push(this.toModel(e,e.questionOptions.rendering)):"field-set"===e.questionOptions.rendering||t.push(this.toModel(e,e.questionOptions.rendering));else for(var r in e)e.hasOwnProperty(r)&&this.getQuestions(e[r],t)},t.prototype.getChildrenQuestionModels=function(e){var t=[];return this.getQuestions(e,t),t},t.prototype.toModel=function(e,t){switch("ui-select-extended"===t&&(t=e.type),e.id||(e.id=this.generateId(10)),!e.questionOptions||!0!==e.questionOptions.showDate&&"true"!==e.questionOptions.showDate||(e=this.convertOldVersionComplexObsQuestionToNewVersion(e),t="field-set"),t){case"select":case"single-select":case"multi-select":return this.toSelectQuestion(e);case"numeric":return this.toNumericQuestion(e);case"number":return this.toNumberQuestion(e);case"encounterDatetime":return this.toEncounterDatetimeQuestion(e);case"date":return this.toDateQuestion(e);case"multiCheckbox":return this.toMultiCheckboxQuestion(e);case"drug":return this.toDrugQuestion(e);case"problem":return this.toProblemQuestion(e);case"group":return this.toGroupQuestion(e);case"field-set":return this.toFieldSetQuestion(e);case"repeating":return this.toRepeatingQuestion(e);case"personAttribute":return this.toPersonAttributeQuestion(e);case"text":return this.toTextQuestion(e);case"textarea":case"textarea":return this.toTextAreaQuestion(e);case"select-concept-answers":return this.toConceptAnswerSelect(e);case"encounterLocation":return this.toEncounterLocationQuestion(e);case"encounterDatetime":return this.toEncounterDatetimeQuestion(e);case"encounterProvider":return this.toEncounterProviderQuestion(e);case"radio":case"checkbox":return this.toCheckBoxQuestion(e);case"encounterProvider":return this.toEncounterProviderQuestion(e);case"file":return this.toFileUploadQuestion(e);default:return console.warn("New Schema Question Type found........."+t),this.toTextQuestion(e)}},t.prototype.convertOldVersionComplexObsQuestionToNewVersion=function(e){var t={type:"complex-obs"};t.label=e.label,t.id="complex_"+e.id,t.questionOptions={},t.questionOptions.concept=e.questionOptions.concept,t.questionOptions.rendering="field-set",t.questions=[],t.validators=[];var n=JSON.parse(JSON.stringify(e));n.type="complex-obs-child",delete n.questionOptions.showDate,delete n.questionOptions.shownDateOptions,n.questionOptions.obsField="value";var r={type:"complex-obs-child"};r.label="Date of "+n.label,r.id="date_"+n.id,r.questionOptions={},r.questionOptions.concept=e.questionOptions.concept,r.questionOptions.rendering="date",r.questionOptions.obsField="obsDatetime";var i=Object.assign({},e.questionOptions.shownDateOptions);return r.validators=i.validators,r.hide=i.hide,t.questions.push(n),t.questions.push(r),t},t.prototype.copyProperties=function(e,t,n){for(var r in t)e.hasOwnProperty(r)&&n.hasOwnProperty(e[r])&&(n[e[r]]=t[r])},t.prototype.addValidators=function(e){var t=[];e.validators&&a.forEach(e.validators,(function(e){switch(e.type){case"date":t.push(new Ut(e));break;case"js_expression":t.push(new R(e));break;case"conditionalAnswered":t.push(new N(e));break;default:t.push(new j(e))}}));var n=e.questionOptions;switch(n?n.rendering:""){case"number":n.max&&n.min&&(t.push(new $t({type:"max",max:n.max})),t.push(new Jt({type:"min",min:n.min})))}if("object"==typeof e.required){var r=e.required;"conditionalRequired"===r.type&&t.push(new N({referenceQuestionId:r.referenceQuestionId,referenceQuestionAnswers:r.referenceQuestionAnswers,type:r.type,message:r.message}))}return t},t.prototype.addHistoricalExpressions=function(e,t){if(e.historicalExpression&&e.historicalExpression.length>0){t.setHistoricalValue(!0),void 0!==e.showHistoricalEncounterDate?t.showHistoricalEncounterDate("true"===e.showHistoricalEncounterDate):t.showHistoricalEncounterDate();var n=this.historicalHelperService.evaluate(e.historicalExpression,this.dataSources,void 0);if(t.historicalDataValue=n,e.historicalPrepopulateCondition&&n)return void(this.historicalHelperService.evaluatePrecondition(e.historicalPrepopulateCondition,this.dataSources,n)&&(t.defaultValue=n.value));if(e.historicalPrepopulate&&n){var r=tn(n.valueDate),i=tn().diff(r,"days");Number.isInteger(e.allowedHistoricalValueAgeInDays)?i<=e.allowedHistoricalValueAgeInDays&&(t.defaultValue=n.value):t.defaultValue=n.value}}},t.prototype.addCalculatorProperty=function(e,t){e.questionOptions&&"object"==typeof e.questionOptions.calculate&&(t.calculateExpression=e.questionOptions.calculate.calculateExpression)},t.prototype.addAlertProperty=function(e,t){e.alert&&(t.alert=e.alert)},t.prototype.addDisableOrHideProperty=function(e,t){e.disable&&(t.disable=e.disable),"object"==typeof e.disable&&(t.disable=e.disable.disableWhenExpression),e.hide&&(t.hide=e.hide),"object"==typeof e.hide&&e.hide.hideWhenExpression&&(t.hide=e.hide.hideWhenExpression)},t.prototype.generateId=function(e){for(var t="_";t.length<e&&e>0;){var n=Math.random();t+=n<.1?Math.floor(100*n):String.fromCharCode(Math.floor(26*n)+(n>.5?97:65))}return"_"+t},t}();nn.decorators=[{type:t.Injectable}],nn.ctorParameters=function(){return[]};var rn=function(){function e(e,t,n){this.schema=e,this.formFactory=t,this.questionFactory=n,this.valueProcessingInfo={},this.existingOrders={},this._showErrors=!1,this._dataSourcesContainer=new de}return Object.defineProperty(e.prototype,"dataSourcesContainer",{get:function(){return this._dataSourcesContainer},enumerable:!1,configurable:!0}),e.prototype.searchNodeByPath=function(e,t,n){var r=this,i=e.children;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];if(a instanceof q){if(t===a.path)return n.push(a),n;this.searchNodeByPath(a,t,n)}else if(a instanceof V){if(t===a.path)return n.push(a),n}else if(a instanceof F){if(t===a.path)return n.push(a),n;a.children.forEach((function(e){r.searchNodeByPath(e,t,n)}))}}return n},e.prototype.searchNodeByQuestionId=function(e,t){var n=[];return t?this.searchNodeByQuestionType(this.rootNode,t,n):this.findNodesByQuestionId(this.rootNode,e,n),n},e.prototype.searchNodeByQuestionType=function(e,t,n){var r=this;if(e instanceof q){var i=e;for(var o in i.children)this.searchNodeByQuestionType(i.children[o],t,n)}e instanceof F&&e.children.forEach((function(e){r.searchNodeByQuestionType(e,t,n)}));if(e instanceof V){var a=e.question;a.extras&&a.extras.type&&a.extras.type===t&&n.push(e)}},e.prototype.findNodesByQuestionId=function(e,t,n){var r=this;if(e.question.key===t&&n.push(e),e instanceof q){var i=e;for(var o in i.children)this.findNodesByQuestionId(i.children[o],t,n)}e instanceof F&&e.children.forEach((function(e){r.findNodesByQuestionId(e,t,n)}))},Object.defineProperty(e.prototype,"valid",{get:function(){return this.rootNode.control.valid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showErrors",{get:function(){return this._showErrors},set:function(e){this._showErrors=e},enumerable:!1,configurable:!0}),e.prototype.markInvalidControls=function(e,t){var n=this,r=e.children;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];if(o instanceof q)this.markInvalidControls(o,t);else if(o instanceof V){var s=o.question;if(s.key&&s.key.length>0){var l=o.control;l.valid||l.disabled||(t&&t.push(o),l.markAsTouched())}}else if(o instanceof F){var c=o;c&&c.children&&c.children.length>0&&a.forEach(c.children,(function(e){n.markInvalidControls(e,t)}))}}return t},e.prototype.updateHiddenDisabledStateForAllControls=function(){this._updateHiddenDisabledStateForAllControls(this.rootNode)},e.prototype.updateAlertsForAllControls=function(){this._updateAlertsForAllControls(this.rootNode)},e.prototype._updateAlertsForAllControls=function(e){var t=this;if(e.control&&e.control.updateAlert&&e.control.updateAlert(),e instanceof q){var n=e;for(var r in n.children)this._updateAlertsForAllControls(n.children[r])}e instanceof F&&e.children.forEach((function(e){t._updateAlertsForAllControls(e)}))},e.prototype._updateHiddenDisabledStateForAllControls=function(e){var t=this;if(e.control&&(e.control.updateDisabledState&&e.control.updateDisabledState(),e.control.updateHiddenState&&e.control.updateHiddenState()),e instanceof q){var n=e;for(var r in n.children)this._updateHiddenDisabledStateForAllControls(n.children[r])}e instanceof F&&e.children.forEach((function(e){t._updateHiddenDisabledStateForAllControls(e)}))},e}(),on=function(){function t(e,t,n){this.controlService=e,this.questionFactroy=t,this.controlRelationsFactory=n,this.hd={getValue:function(){return 20}}}return t.prototype.createForm=function(e,t){var n=new rn(e,this,this.questionFactroy);if(t)for(var r in t)t.hasOwnProperty(r)&&n.dataSourcesContainer.registerDataSource(r,t[r],!1);var i=this.questionFactroy.createQuestionModel(e,n);return n.rootNode=this.createNode(i,null,null,n),this.buildRelations(n.rootNode),n.updateHiddenDisabledStateForAllControls(),n.updateAlertsForAllControls(),n},t.prototype.buildRelations=function(e){ie.JSExpressionValidatorsEnabled=!1,this.controlRelationsFactory.buildRelations(e),ie.JSExpressionValidatorsEnabled=!0},t.prototype.createNode=function(e,t,n,r){return e instanceof Yt?e instanceof Qt?this.createArrayNode(e,t,n,r):this.createGroupNode(e,t,n,r):this.createLeafNode(e,t,n,r)},t.prototype.createLeafNode=function(e,t,n,r){var i=this.controlService.generateControlModel(e,n,!1,r);return new V(e,i,null,r,t?t.path:void 0)},t.prototype.createGroupNode=function(e,t,n,r){var i=this.controlService.generateControlModel(e,n,!1,r),o=new q(e,i,null,r,t?t.path:void 0);return this.createNodeChildren(e,o,i||n,r),o},t.prototype.createArrayNode=function(e,t,n,r){var i=this,o=this.controlService.generateControlModel(e,n,!1,r),a=new F(e,o,n,this,r,t?t.path:void 0);return a.createChildFunc=this.createArrayNodeChild,a.removeChildFunc=this.removeArrayNodeChild,a.addChildNodeCreatedListener((function(e){ie.JSExpressionValidatorsEnabled=!1,i.controlRelationsFactory.buildArrayNodeRelations(e),ie.JSExpressionValidatorsEnabled=!0})),a},t.prototype.createNodeChildren=function(e,t,n,r){var i=this;return e.questions.forEach((function(e){var o=i.createNode(e,t,n,r);t.setChild(e.key,o)})),t.children},t.prototype.createArrayNodeChild=function(t,n,r){null==r&&(r=this);var i=new Bt({key:n.path+"."+n.children.length,type:"group",extras:t.extras,label:"",questions:t.questions});t.controlType===e.AfeControlType.None&&(i.controlType=t.controlType);var o=r.createGroupNode(i,null,null,n.form);if(n.children.push(o),n.control instanceof z){var a=n.control;a.setControl(a.controls.length,o.control)}return o},t.prototype.removeArrayNodeChild=function(e,t){var n=t.children[e];if(t.children.splice(e,1),(null!==t.control||void 0!==t.control)&&t.control instanceof z){var r=t.control,i=r.controls.indexOf(n.control);i>=0&&r.removeAt(i)}},t}();on.decorators=[{type:t.Injectable}],on.ctorParameters=function(){return[{type:ue},{type:nn},{type:H}]};var an=b,sn=function(){function e(){}return e.prototype.findObsAnswerToQuestion=function(e,t){var n=this,r=[];if(!this.isObsNode(e))return r;if(e instanceof V||e instanceof q&&"complex-obs"===e.question.extras.type)return a.each(t,(function(t){t.concept&&t.concept.uuid===e.question.extras.questionOptions.concept&&r.push(t)})),r;var i=this.getChildQuestionsConceptUuids(e);return i.length>0&&a.each(t,(function(t){t.concept&&t.concept.uuid===e.question.extras.questionOptions.concept&&Array.isArray(t.groupMembers)&&n.isSubsetOf(i,n.getGroupMembersConceptUuids(t))&&r.push(t)})),r},e.prototype.getChildQuestionsConceptUuids=function(e){var t=[];return e.question.extras&&e.question.extras.questions&&a.each(e.question.extras.questions,(function(e){e.questionOptions&&e.questionOptions.concept&&t.push(e.questionOptions.concept)})),t},e.prototype.getGroupMembersConceptUuids=function(e){var t=[];return Array.isArray(e.groupMembers)&&a.each(e.groupMembers,(function(e){t.push(e.concept.uuid)})),t},e.prototype.isObsNode=function(e){return e.question.extras&&("obs"===e.question.extras.type||"obsGroup"===e.question.extras.type||"complex-obs"===e.question.extras.type||"complex-obs-child"===e.question.extras.type)},e.prototype.isSubsetOf=function(e,t){return 0===t.length&&0===e.length||t.every((function(t){return e.indexOf(t)>=0}))},e.prototype.setSimpleObsNodeValue=function(e,t){if(e&&t.length>0){var n=t[0];e.initialValue=n,!this.isEmpty(n.value)&&n.value.uuid?this.setNodeFormControlValue(e,n.value.uuid):this.isEmpty(n.value)||this.setNodeFormControlValue(e,n.value)}},e.prototype.setMultiselectObsNodeValue=function(e,t){var n,r;if(e&&t.length>0){e.initialValue=t;var i=[];try{for(var o=O(t),a=o.next();!a.done;a=o.next()){var s=a.value;i.push(s.value.uuid)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}this.setNodeFormControlValue(e,i)}},e.prototype.setComplexObsNodeValue=function(e,t){if(e&&t.length>0){var n=void 0,r=void 0,i=e;for(var o in i.children)"value"===i.children[o].question.extras.questionOptions.obsField&&(n=i.children[o]),"obsDatetime"===i.children[o].question.extras.questionOptions.obsField&&(r=i.children[o]);this.setNodeValue(n,t),e.initialValue=n.initialValue,r.initialValue=n.initialValue,this.setNodeFormControlValue(r,n.initialValue.obsDatetime)}},e.prototype.setGroupObsNodeValue=function(e,t){if(e&&t.length>0){var n=e;for(var r in n.initialValue=t[0],n.children)this.setNodeValue(n.children[r],t[0].groupMembers)}},e.prototype.setRepeatingGroupObsNodeValue=function(e,t){if(e&&t.length>0){var n=e;n.initialValue=t;for(var r=0;r<t.length;r++){var i=n.createChildNode();this.setGroupObsNodeValue(i,[t[r]])}}},e.prototype.setNodeValue=function(e,t){switch(this.getObsNodeType(e)){case"unknown":if(e instanceof q){var n=e;for(var r in n.children)this.setNodeValue(n.children[r],t);break}if(e instanceof F){for(var i=e,o=0;o<i.children.length;o++)this.setNodeValue(i.children[o],t);break}break;case"simple":var a=this.findObsAnswerToQuestion(e,t);this.setSimpleObsNodeValue(e,a);break;case"multiselect":var s=this.findObsAnswerToQuestion(e,t);this.setMultiselectObsNodeValue(e,s);break;case"complex":var l=this.findObsAnswerToQuestion(e,t);this.setComplexObsNodeValue(e,l);break;case"group":var c=this.findObsAnswerToQuestion(e,t);c.length>0&&this.setGroupObsNodeValue(e,c);break;case"repeatingGroup":var u=this.findObsAnswerToQuestion(e,t);u.length>0&&this.setRepeatingGroupObsNodeValue(e,u);break;default:console.error("Unknown obs node",e)}},e.prototype.setNodeFormControlValue=function(e,t){e.control.setValue(t),e.question.enableHistoricalValue&&void 0!==e.initialValue&&e.question.setHistoricalValue(!1)},e.prototype.getObsNodeType=function(e){return this.isObsNode(e)?e instanceof V&&("multiCheckbox"===e.question.extras.questionOptions.rendering||"checkbox"===e.question.extras.questionOptions.rendering||"multi-select"===e.question.extras.questionOptions.rendering)?"multiselect":e instanceof V?"simple":e instanceof q&&"complex-obs"===e.question.extras.type?"complex":e instanceof F&&"obsGroup"===e.question.extras.type&&"repeating"===e.question.extras.questionOptions.rendering?"repeatingGroup":e instanceof q&&"obsGroup"===e.question.extras.type?"group":"unknownObs":"unknown"},e.prototype.getSimpleObsPayload=function(e){if(this.isEmpty(e.control.value))return e.initialValue?{uuid:e.initialValue.uuid,voided:!0}:null;if(e.initialValue&&!this.simpleNodeValueChanged(e))return null;var t={concept:e.question.extras.questionOptions.concept,value:e.control.value};return"date"===e.question.extras.questionOptions.rendering&&(t.value=this.toOpenMrsDateTimeString(e.control.value)),e.initialValue&&(delete t.concept,t.uuid=e.initialValue.uuid),t},e.prototype.getComplexObsPayload=function(e){var t,n,r=e;for(var i in r.children)"value"===r.children[i].question.extras.questionOptions.obsField&&(t=r.children[i]),"obsDatetime"===r.children[i].question.extras.questionOptions.obsField&&(n=r.children[i]);var o=this.getObsNodePayload(t);if(o.length>0)return o[0].obsDatetime=this.toOpenMrsDateTimeString(n.control.value),o[0];if(0===o.length&&e.initialValue&&!this.areDatesEqual(e.initialValue.obsDatetime,n.control.value)){var a={uuid:e.initialValue.uuid};return a.obsDatetime=this.toOpenMrsDateTimeString(n.control.value),a}return null},e.prototype.getMultiselectObsPayload=function(e){var t=[],n=[];return Array.isArray(e.initialValue)&&a.each(e.initialValue,(function(r){n.push(r.value.uuid),Array.isArray(e.control.value)?e.control.value.indexOf(r.value.uuid)<0&&t.push({uuid:r.uuid,voided:!0}):t.push({uuid:r.uuid,voided:!0})})),Array.isArray(e.control.value)&&a.each(e.control.value,(function(r){n.indexOf(r)<0&&t.push({concept:e.question.extras.questionOptions.concept,value:r})})),t},e.prototype.getGroupPayload=function(e){var t=this,n=e,r=[];if(a.each(n.children,(function(e){var n=t.getObsNodePayload(e);n.length>0&&(r=r.concat(n))})),0===r.length)return null;var i={groupMembers:r};return n.initialValue?i.uuid=n.initialValue.uuid:i.concept=n.question.extras.questionOptions.concept,i},e.prototype.getRepeatingGroupPayload=function(e){var t=this,n=e,r=[],i=[];return a.each(n.children,(function(e){var n=t.getObsNodePayload(e);n.length>0&&(r=r.concat(n)),e.initialValue&&e.initialValue.uuid&&i.push(e.initialValue.uuid)})),n.initialValue&&Array.isArray(n.initialValue)&&a.each(n.initialValue,(function(e){if(i.indexOf(e.uuid)<0){var t={uuid:e.uuid,voided:!0};r.push(t)}})),r.length<=0?null:r},e.prototype.getObsNodePayload=function(e){var t=[];switch(this.getObsNodeType(e)){case"unknown":if(e instanceof q){var n=e;for(var r in n.children){var i=this.getObsNodePayload(n.children[r]);Array.isArray(i)&&i.length>0&&(t=t.concat(i))}break}if(e instanceof F){for(var o=e,a=0;a<o.children.length;a++){var s=this.getObsNodePayload(o.children[a]);Array.isArray(s)&&s.length>0&&(t=t.concat(s))}break}break;case"simple":var l=this.getSimpleObsPayload(e);null!==l&&t.push(l);break;case"multiselect":var c=this.getMultiselectObsPayload(e);Array.isArray(c)&&c.length>0&&(t=t.concat(c));break;case"complex":var u=this.getComplexObsPayload(e);null!==u&&t.push(u);break;case"group":var p=this.getGroupPayload(e);p&&null!==p&&t.push(p);break;case"repeatingGroup":var d=this.getRepeatingGroupPayload(e);Array.isArray(d)&&d.length>0&&(t=t.concat(d))}return t},e.prototype.simpleNodeValueChanged=function(e){return!!e.initialValue&&(e.initialValue.value&&e.initialValue.value.uuid?e.control.value!==e.initialValue.value.uuid:"date"===e.question.extras.questionOptions.rendering?!this.areDatesEqual(e.control.value,e.initialValue.value):e.control.value!==e.initialValue.value)},e.prototype.areDatesEqual=function(e,t){return an(e).isSame(t)},e.prototype.isEmpty=function(e){return""===e||null==e},e.prototype.toOpenMrsDateTimeString=function(e){if(!this.isEmpty(e)){var t=an(e).format().substring(0,19).replace("T"," ");return this.isEmpty(t)?void 0:t}},e}();sn.decorators=[{type:t.Injectable}],sn.ctorParameters=function(){return[]};var ln=function(){function e(e){this.helper=e}return e.prototype.generateFormPayload=function(e){return this.helper.getObsNodePayload(e.rootNode)},e.prototype.populateForm=function(e,t){this.helper.setNodeValue(e.rootNode,t)},e.prototype.setValues=function(e,t,n){var r,i;if(e){var o=function(e){if(e instanceof V)s.setObsValue(e,t),e.question.enableHistoricalValue&&void 0!==e.initialValue&&e.question.setHistoricalValue(!1);else if(e.question&&e.question.extras&&"group"===e.question.renderingType||n){var r=a.find(t,(function(t){return t.concept.uuid===e.question.extras.questionOptions.concept&&t.groupMembers}));r&&(e.node&&(e.node.initialValue=r),s.setValues(e.groupMembers,r.groupMembers)),n&&e.payload&&s.setValues(e.groupMembers,e.payload.groupMembers)}else if(e instanceof q&&"complex-obs"===e.question.extras.type)s.setComplexObsValue(e,t);else{if(!e.question||!e.question.extras||"repeating"!==e.question.renderingType||n)throw new Error("not implemented");s.setRepeatingGroupValues(e,t),e.node.control.updateValueAndValidity()}},s=this;try{for(var l=O(e),c=l.next();!c.done;c=l.next()){o(c.value)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}},e.prototype.setObsValue=function(e,t){if(e.question&&e.question.extras&&("obs"===e.question.extras.type||"complex-obs-child"===e.question.extras.type&&"value"===e.question.extras.questionOptions.obsField)&&"multiCheckbox"!==e.question.extras.questionOptions.rendering||"checkbox"!==e.question.extras.questionOptions.rendering||"multi-select"!==e.question.extras.questionOptions.rendering){var n=a.find(t,(function(t){return t.concept.uuid===e.question.extras.questionOptions.concept}));n&&(n.value instanceof Object?(e.control.setValue(n.value.uuid),e.control.updateValueAndValidity()):(e.control.setValue(n.value),e.control.updateValueAndValidity()),e.initialValue={obsUuid:n.uuid,value:n.value})}else{var r=a.filter(t,(function(t){return t.concept.uuid===e.question.extras.questionOptions.concept}));r&&r.length>0&&(e.control.setValue(this.getMultiselectValues(r)),e.control.updateValueAndValidity(),e.initialValue=r)}},e.prototype.setComplexObsValue=function(e,t){var n,r;for(var i in e.children)"value"===e.children[i].question.extras.questionOptions.obsField&&(n=e.children[i]),"obsDatetime"===e.children[i].question.extras.questionOptions.obsField&&(r=e.children[i]);this.setObsValue(n,t);var o=a.find(t,(function(t){return t.concept.uuid===e.question.extras.questionOptions.concept}));o&&(r.initialValue={obsUuid:o.uuid,value:o.obsDatetime},r.control.setValue(o.obsDatetime),r.control.updateValueAndValidity())},e.prototype.getMultiselectValues=function(e){var t,n,r=[];try{for(var i=O(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.push(a.value.uuid)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.setRepeatingGroupValues=function(e,t){var n,r,i=a.filter(t,(function(t){var n=t.concept.uuid===e.question.extras.questionOptions.concept,r=!1;if(n&&t.groupMembers){var i=t.groupMembers.map((function(e){return e.concept.uuid})),o=e.question.questions.map((function(e){return e.extras.questionOptions.concept}));r=a.intersection(i,o).length>0}return n&&r}));if(i.length>0){e.node.initialValue=i;for(var o=0;o<i.length;o++)e.node.createChildNode()}var s=[],l=0,c=function(t){var n=Object.keys(t.children).map((function(e){return t.children[e]})),r=i[l];s.push({question:e.question,groupMembers:n,payload:r}),l++};try{for(var u=O(e.node.children),p=u.next();!p.done;p=u.next()){c(p.value)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}this.setValues(s,i,!0)},e.prototype.getQuestionNodes=function(e){var t,n,r,i,o=[];try{for(var a=O(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var c=(r=void 0,O(l.page)),u=c.next();!u.done;u=c.next()){var p=u.value;o.push(p.section)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return[].concat.apply([],o)},e.prototype.repeatingGroup=function(e){var t,n,r=[];try{for(var i=O(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.push({question:a.question,groupMembers:this.traverse(a)})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.processGroup=function(e,t){if(e.question&&e.question.extras&&"group"===e.question.extras.questionOptions.rendering){var n=a.filter(this.getObsPayload(e.groupMembers),(function(e){return""!==e.value})),r=n.map((function(e){return e.voided}));n.length>0&&r.every(Boolean)?t.push({uuid:e.node.initialValue.uuid,voided:!0}):n.length>0&&(e.node.initialValue?t.push({uuid:e.node.initialValue.uuid,groupMembers:n}):t.push({concept:e.question.extras.questionOptions.concept,groupMembers:n}))}},e.prototype.mapInitialGroup=function(e){var t,n,r={};try{for(var i=O(e.groupMembers),o=i.next();!o.done;o=i.next()){var a=o.value,s="";a.value instanceof Object?s=a.value.uuid:a.value?s=a.value:a.groupMembers&&a.groupMembers.length>0&&(r=this.mapInitialGroup(e)),r[a.concept.uuid+":"+s]=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.mapModelGroup=function(e,t){var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=a.find(e.question.questions,{key:r}),o=t[r];o instanceof Object||""!==o&&(n[i.extras.questionOptions.concept+":"+o]=o)}return n},e.prototype.processRepeatingGroups=function(e,t){var n,r,i,o,a,s,l,c,u=[];if(e.node.initialValue)try{for(var p=O(e.node.initialValue),d=p.next();!d.done;d=p.next()){var h=d.value;u.push({uuid:h.uuid,value:this.mapInitialGroup(h)})}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var f=[];try{for(var m=O(e.node.control.value),y=m.next();!y.done;y=m.next()){var g=y.value;f.push({value:this.mapModelGroup(e,g)})}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}var b=this.leftOuterJoinArrays(u,f),v=this.leftOuterJoinArrays(f,u),w=e.question.extras.questionOptions.concept,x=[];if(b.length>0){var k=this.createGroupDeletedObs(b);try{for(var C=O(k),T=C.next();!T.done;T=C.next()){var D=T.value;t.push(D)}}catch(e){a={error:e}}finally{try{T&&!T.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}v.length>0&&(x=this.createGroupNewObs(v,w))}else x=this.createGroupNewObs(v,w);if(x.length>0)try{for(var M=O(x),A=M.next();!A.done;A=M.next()){var S=A.value;t.push(S)}}catch(e){l={error:e}}finally{try{A&&!A.done&&(c=M.return)&&c.call(M)}finally{if(l)throw l.error}}},e.prototype.leftOuterJoinArrays=function(e,t){return e.filter((function(e){return!t.some((function(t){return a.isEqual(e.value,t.value)}))}))},e.prototype.createGroupNewObs=function(e,t){var n,r,i=[];try{for(var o=O(e),a=o.next();!a.done;a=o.next()){var s=a.value,l=[];for(var c in s.value){var u=c.split(":")[0],p=c.split(":")[1];l.push({concept:u,value:p})}i.push({concept:t,groupMembers:l})}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.createGroupDeletedObs=function(e){var t,n,r=[];try{for(var i=O(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.push({uuid:a.uuid,voided:!0})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.getExactTime=function(e){return e.substring(0,19).replace("T"," ")},e.prototype.processObs=function(e,t){if(e.control&&e.question.extras){var n={concept:e.question.extras.questionOptions.concept,value:"date"!==e.question.extras.questionOptions.rendering||this.isEmpty(e.control.value)?e.control.value:this.getExactTime(e.control.value)};if("multiCheckbox"===e.question.extras.questionOptions.rendering||"checkbox"===e.question.extras.questionOptions.rendering||"multi-select"===e.question.extras.questionOptions.rendering){var r=this.processMultiSelect(e.question.extras.questionOptions.concept,e.control.value);if(e.initialValue){var i=e.initialValue.map((function(e){return{uuid:e.uuid,value:{concept:e.concept.uuid,value:e.value.uuid}}})),o=r.map((function(e){return{value:e}})),a=this.leftOuterJoinArrays(i,o),s=this.leftOuterJoinArrays(o,i);this.processDeletedMultiSelectObs(a,t),this.processNewMultiSelectObs(s,t)}else this.processNewMultiSelectObs(r,t)}else e.initialValue&&e.initialValue.value&&n?this.updateOrVoidObs(n,e.initialValue,t):""!==n.value&&null!==n.value&&t.push(n)}},e.prototype.processComplexObs=function(e,t){var n,r;for(var i in e.children)"value"===e.children[i].question.extras.questionOptions.obsField&&(n=e.children[i]),"obsDatetime"===e.children[i].question.extras.questionOptions.obsField&&(r=e.children[i]);if(n){this.processObs(n,t);var o=t.length>0?t[t.length-1]:void 0;o&&(o.concept&&o.concept===e.question.extras.questionOptions.concept||n.initialValue&&o.uuid===n.initialValue.obsUuid)&&r.initialValue&&r.control.value!==r.initialValue.value&&(o.obsDatetime=r.control.value)}},e.prototype.processDeletedMultiSelectObs=function(e,t){var n,r;try{for(var i=O(e),o=i.next();!o.done;o=i.next()){var a=o.value;t.push({uuid:a.uuid,voided:!0})}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.processNewMultiSelectObs=function(e,t){var n,r;try{for(var i=O(e),o=i.next();!o.done;o=i.next()){var a=o.value;a.value instanceof Object?t.push(a.value):t.push(a)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.updateOrVoidObs=function(e,t,n){this.isEmpty(e.value)&&t.value?n.push({uuid:t.obsUuid,voided:!0}):!this.isEmpty(e.value)&&t.value&&n.push({uuid:t.obsUuid,value:e.value})},e.prototype.isEmpty=function(e){return""===e||null==e},e.prototype.traverse=function(e,t){var n=[];if(e.children){if(e.children instanceof Array)return this.repeatingGroup(e.children);if(e.children instanceof Object)for(var r in e.children)if(e.children.hasOwnProperty(r))switch(e.children[r].question.renderingType){case"page":var i=this.traverse(e.children[r]);n.push({page:i,label:e.children[r].question.label});break;case"section":var o=this.traverse(e.children[r]);n.push({section:o,node:e.children[r],label:e.children[r].question.label});break;case"group":var a=this.traverse(e.children[r]);n.push({node:e.children[r],question:e.children[r].question,groupMembers:a});break;case"repeating":var s=this.repeatingGroup(e.children[r].children);n.push({node:e.children[r],question:e.children[r].question,groupMembers:s});break;default:n.push(e.children[r])}}return n},e.prototype.processMultiSelect=function(e,t){var n,r,i=[];if(t&&null!==t)try{for(var o=O(t),a=o.next();!a.done;a=o.next()){var s={concept:e,value:a.value};i.push(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.isObs=function(e){return"obs"===e.question.extras.type||"obsGroup"===e.question.extras.type||"complex-obs"===e.question.extras.type},e.prototype.getObsPayload=function(e){var t,n,r=[];try{for(var i=O(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.isObs(a)&&(a.groupMembers,"group"===a.question.extras.questionOptions.rendering?this.processGroup(a,r):(a.groupMembers,"repeating"===a.question.extras.questionOptions.rendering?this.processRepeatingGroups(a,r):a instanceof q&&"complex-obs"===a.question.extras.type?this.processComplexObs(a,r):this.processObs(a,r)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e}();ln.decorators=[{type:t.Injectable}],ln.ctorParameters=function(){return[{type:sn}]};var cn=function(){function e(){this.formOrderNodes=[],this.provider=""}return e.prototype.generateFormPayload=function(e){return this.formOrderNodes=[],this._setOrderProvider(e),this._findTestOrderQuestionNodes(e.rootNode),this._createOrdersPayload(this.formOrderNodes,e)},e.prototype.populateForm=function(e,t){e.existingOrders=t,this.formOrderNodes=[],this._findTestOrderQuestionNodes(e.rootNode);var n=this._getExistingOrders(e);this._setOrderValues(this.formOrderNodes,n)},e.prototype._setOrderProvider=function(e){e.valueProcessingInfo.providerUuid&&(this.provider=e.valueProcessingInfo.providerUuid)},e.prototype._createOrdersPayload=function(e,t){var n,r,i,o=[],a=[],s=this._getExistingOrders(t),l=function(e){var t=e.control.value,n=[];for(var r in s&&s.map((function(e){n[e.concept]=e.concept})),t)if(t.hasOwnProperty(r)){var i=t[r][e.question.key],l=c._createPayloadOrder(i,e.question.extras);n[i]!==i&&""!==l.concept&&o.push(l),a[i]=i,""===l.orderNumber&&delete l.orderNumber,""===l.uuid&&delete l.uuid}},c=this;try{for(var u=O(e),p=u.next();!p.done;p=u.next()){l(p.value)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return i=this._getDeletedOrders(a,s),this._addDeletedOrdersToPayload(i,o)},e.prototype._getExistingOrders=function(e){if(e.existingOrders&&e.existingOrders.orders){var t=e.existingOrders.orders.map((function(e){return{concept:e.concept.uuid,orderNumber:e.orderNumber,orderUuid:e.uuid,voided:e.voided,dateVoided:e.auditInfo.dateVoided}}));return a.filter(t,(function(e){return!0!==e.voided&&!e.dateVoided}))}},e.prototype._setOrderValues=function(e,t){var n,r;this._findTestOrderQuestionNodes(e);var i=this.formOrderNodes;try{for(var o=O(i),a=o.next();!a.done;a=o.next()){var s=a.value;this._setOrderNodeValues(s,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype._addDeletedOrdersToPayload=function(e,t){for(var n in e)e.hasOwnProperty(n)&&t.push({uuid:e[n],voided:!0});return t},e.prototype._createPayloadOrder=function(e,t){var n={concept:"",type:"",orderer:"",careSetting:""};return n.concept=e,n.type=t.questionOptions.orderType,n.orderer=this.provider,n.careSetting=t.questionOptions.orderSettingUuid,""===n.orderer&&delete n.orderer,n},e.prototype._getDeletedOrders=function(e,t){var n=[];if(e)for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].concept;e[i]!==i&&n.push(t[r].orderUuid)}return n},e.prototype._setOrderNodeValues=function(e,t){var n,r,i=0;e.initialValue=t;try{for(var o=O(t),a=o.next();!a.done;a=o.next()){var s=a.value;e.createChildNode();var l={};l[e.question.key]=s.concept;var c=e.children[i];c.control.setValue(l),c.initialValue=l,c.orderNumber=s.orderNumber,i++}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype._findTestOrderQuestionNodes=function(e){if(e.children&&e.children instanceof Object)for(var t in e.children)if(e.children.hasOwnProperty(t))switch(e.children[t].question.renderingType){case"page":case"section":case"group":this._findTestOrderQuestionNodes(e.children[t]);break;case"repeating":if(e.children)for(var n in e.children){var r=e.children[n].question;r.extras&&"testOrder"===r.extras.type&&this.formOrderNodes.push(e.children[n])}}},e}();cn.decorators=[{type:t.Injectable}];var un=b,pn=function(){function e(e,t){this.ordersAdapter=e,this.obsAdapter=t}return e.prototype.populateForm=function(e,t){this.populateNode(e.rootNode,t),Array.isArray(t.orders)&&this.ordersAdapter.populateForm(e,t),Array.isArray(t.obs)&&this.obsAdapter.populateForm(e,t.obs)},e.prototype.populateNode=function(e,t){if(null==t)throw new Error("Expected payload");this.getEncounterNodes(e).forEach((function(e){switch(e.question.extras.type){case"encounterDatetime":t.encounterDatetime&&(e.control.setValue(un(t.encounterDatetime).toDate()),e.initialValue=un(t.encounterDatetime).toDate());break;case"encounterProvider":if(Array.isArray(t.encounterProviders)&&t.encounterProviders.length>0){var n=t.encounterProviders[0].provider;n&&n.uuid&&(e.control.setValue(n.uuid),setTimeout((function(){e.control.setValue(n.uuid)})),e.initialValue=n.uuid)}break;case"encounterLocation":t.location&&t.location.uuid&&(e.control.setValue(t.location.uuid),e.initialValue=t.location.uuid)}}))},e.prototype.generateFormPayload=function(e){var t=this.generateNodePayload(e.rootNode);return this.setNonFilledPayloadMembers(e,t),t.obs=this.obsAdapter.generateFormPayload(e)||[],t.orders=this.ordersAdapter.generateFormPayload(e)||[],t},e.prototype.generateNodePayload=function(e){var t=this.getEncounterNodes(e),n={};return t.forEach((function(t){if(null!==t.control.value&&void 0!==t.control.value&&""!==t.control.value)switch(t.question.extras.type){case"encounterDatetime":var r=un(t.control.value).utcOffset(e.form.valueProcessingInfo.utcOffset||"+0300");n.encounterDatetime=r.format();break;case"encounterProvider":if(t.control.value&&""!==t.control.value){var i=[];i.push({provider:t.control.value,encounterRole:"a0b03050-c99b-11e0-9572-0800200c9a66"}),n.encounterProviders=i}break;case"encounterLocation":n.location=t.control.value}})),n},e.prototype.getEncounterNodes=function(e){var t=[];return this._getEncounterNodes(e,t),t},e.prototype.setNonFilledPayloadMembers=function(e,t){e.valueProcessingInfo.patientUuid&&this.setPayloadPatientUuid(t,e.valueProcessingInfo.patientUuid),e.valueProcessingInfo.visitUuid&&this.setPayloadVisitUuid(t,e.valueProcessingInfo.visitUuid),e.valueProcessingInfo.encounterTypeUuid&&this.setPayloadEncounterTypeUuid(t,e.valueProcessingInfo.encounterTypeUuid),e.valueProcessingInfo.formUuid&&this.setPayloadFormUuid(t,e.valueProcessingInfo.formUuid),e.valueProcessingInfo.encounterUuid&&this.setPayloadEncounterUuid(t,e.valueProcessingInfo.encounterUuid)},e.prototype.setPayloadPatientUuid=function(e,t){e.patient=t},e.prototype.setPayloadVisitUuid=function(e,t){e.visit=t},e.prototype.setPayloadEncounterTypeUuid=function(e,t){e.encounterType=t},e.prototype.setPayloadFormUuid=function(e,t){e.form=t},e.prototype.setPayloadEncounterUuid=function(e,t){e.uuid=t},e.prototype._getEncounterNodes=function(e,t){var n=this;if(this._isEncounterNode(e)&&t.push(e),e instanceof q){var r=e;for(var i in r.children)r.children[i]instanceof E&&this._getEncounterNodes(r.children[i],t)}e instanceof F&&(r=e).children.forEach((function(e){n._getEncounterNodes(e,t)}))},e.prototype._isEncounterNode=function(e){return!(!e.question.extras||"encounterDatetime"!==e.question.extras.type&&"encounterProvider"!==e.question.extras.type&&"encounterLocation"!==e.question.extras.type)},e}();pn.decorators=[{type:t.Injectable}],pn.ctorParameters=function(){return[{type:cn},{type:ln}]};var dn=function(){function e(){}return e.prototype.generateFormPayload=function(e){return this.generateNodePayload(e.rootNode)},e.prototype.generateNodePayload=function(e){var t=this.getPersonAttributeNodes(e),n=[];return t.forEach((function(e){null!==e.control.value&&void 0!==e.control.value&&""!==e.control.value&&e.initialValue!==e.control.value&&(!0===e.question.extras.questionOptions.isSimpleValue?n.push({attributeType:e.question.extras.questionOptions.attributeType,value:e.control.value}):n.push({attributeType:e.question.extras.questionOptions.attributeType,hydratedObject:e.control.value}))})),n},e.prototype.populateForm=function(e,t){this.populateNode(e.rootNode,t)},e.prototype.populateNode=function(e,t){if(!Array.isArray(t))throw new Error("Expected an array of attributes");this.getPersonAttributeNodes(e).forEach((function(e){t.forEach((function(t){t.attributeType.uuid===e.question.extras.questionOptions.attributeType&&(t.value.uuid?(e.control.setValue(t.value.uuid),e.initialValue=t.value.uuid):(e.control.setValue(t.value),e.initialValue=t.value))}))}))},e.prototype.getPersonAttributeNodes=function(e){var t=[];return this._getPersonAttributesNodes(e,t),t},e.prototype._getPersonAttributesNodes=function(e,t){var n=this;if(e.question.extras&&"personAttribute"===e.question.extras.type&&t.push(e),e instanceof q){var r=e;for(var i in r.children)r.children[i]instanceof E&&this._getPersonAttributesNodes(r.children[i],t)}e instanceof F&&(r=e).children.forEach((function(e){n._getPersonAttributesNodes(e,t)}))},e}();dn.decorators=[{type:t.Injectable}],dn.ctorParameters=function(){return[]};var hn=function(){function e(e){this.renderer=e,this.remoteOptionsLoading=!1,this.remoteOptionInput$=new i.Subject,this.placeholder="Search...",this.disabled=!1,this.items=[],this.value=[],this.loading=!1,this.searchText="",this.notFoundMsg="match no found",this.done=new t.EventEmitter,this.compareItems=function(e,t){return!(!e.value||!t.value)&&e.value===t.value},this.propagateChange=function(e){}}return Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource=e,this._dataSource&&this._dataSource.dataFromSourceChanged&&this.subscribeToDataSourceDataChanges()},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.loadOptions()},e.prototype.subscribeToDataSourceDataChanges=function(){var e=this;this._dataSource.dataFromSourceChanged.subscribe((function(t){t.length>0?(e.items=t,e.notFoundMsg=""):(e.notFoundMsg="Not found",e.items=[])}))},e.prototype.writeValue=function(e){var t=this;e&&""!==e&&this.dataSource&&(this.loading=!0,this.dataSource.resolveSelectedValue(e).subscribe((function(e){t.items=[e],t.selectedRemoteOptions=e,t.loading=!1}),(function(e){t.loading=!1})))},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(){},e.prototype.onChange=function(e){this.propagateChange(e.id)},e.prototype.selected=function(e){this.propagateChange(e)},e.prototype.trackByFn=function(e){return e.value},e.prototype.loadOptions=function(){var e=this;this.remoteOptions$=i.concat(i.of([]),this.remoteOptionInput$.pipe(f.distinctUntilChanged(),f.tap((function(){e.loading=!0})),f.switchMap((function(t){return e.dataSource.searchOptions(t).pipe(f.catchError((function(){return i.of([])})),f.tap((function(){return e.loading=!1})))}))))},e}();hn.decorators=[{type:t.Component,args:[{selector:"ngx-remote-select",template:'<div>\n <ng-select [disabled]="disabled" [items]="remoteOptions$ | async" bindLabel="label" bindValue="value" [multiple]="false"\n [hideSelected]="true" [compareWith]="compareItems" [trackByFn]="trackByFn" [loading]="loading"\n typeToSearchText="Please enter 2 or more characters" [typeahead]="remoteOptionInput$"\n [(ngModel)]="selectedRemoteOptions" (ngModelChange)="selected($event)">\n </ng-select>\n</div>',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return hn})),multi:!0}]}]}],hn.ctorParameters=function(){return[{type:t.Renderer2}]},hn.propDecorators={placeholder:[{type:t.Input}],componentID:[{type:t.Input}],disabled:[{type:t.Input}],done:[{type:t.Output}],dataSource:[{type:t.Input}]};var fn=function(){};fn.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,l.NgSelectModule,r.FormsModule],exports:[hn],declarations:[hn],providers:[]}]}];var mn=b,yn=function(){function e(){this.showAppointments=!1,this.loadingAppointments=!1,this.errorLoadingAppointments=!1,this.appointmentsLoaded=!1,this.appointments=[],this.today=""}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(){var e=this;this.node.control.valueChanges.subscribe((function(t){e.resetProperties();var n=e.node;if(n.question.extras.questionOptions.concept&&("a8a666ba-1350-11df-a1f1-0026b9348838"===n.question.extras.questionOptions.concept||"a89d2398-1350-11df-a1f1-0026b9348838"===n.question.extras.questionOptions.concept)&&!e.showAppointments){e.loadingAppointments=!0,e.showAppointments=!0;var r=void 0;n.form&&n.form.dataSourcesContainer.dataSources&&(r=n.form.dataSourcesContainer.dataSources.monthlyScheduleResourceService);var i=n.form.dataSourcesContainer.dataSources.userLocation.uuid;if(r&&i){var o=mn(t).startOf("week").add(1,"day").format("YYYY-MM-DD"),a=mn(t).endOf("week").subtract(1,"day").format("YYYY-MM-DD");e.today=mn(t).format("DD-MM-YYYY");for(var s=[],l=["781d85b0-1359-11df-a1f1-0026b9348838","781d897a-1359-11df-a1f1-0026b9348838","96047aaf-7ab3-45e9-be6a-b61810fe617d","c19aec66-1a40-4588-9b03-b6be55a8dd1d","f7793d42-11ac-4cfd-9b35-e0a21a7a7c31","334c9e98-173f-4454-a8ce-f80b20b7fdf0","96ba279b-b23b-4e78-aba9-dcbd46a96b7b","781d8880-1359-11df-a1f1-0026b9348838"].join(),c=1;c<=5;c++)s.push({date:mn(t).startOf("week").add(c,"day").format("DD-MM-YYYY"),count:0});r.getMonthlySchedule({startDate:o,endDate:a,limit:5,locationUuids:i,programType:l}).subscribe((function(t){e.appointmentsLoaded=!0,e.loadingAppointments=!1,s.map((function(e,n){e.count=void 0!==t[n]?t[n].count.scheduled:0})),e.appointments=s}),(function(t){e.loadingAppointments=!1,e.errorLoadingAppointments=!0,e.showAppointments=!1,console.error(t)}))}else e.showAppointments=!1,e.errorLoadingAppointments=!0}}))},e.prototype.resetProperties=function(){this.loadingAppointments=!1,this.appointmentsLoaded=!1,this.errorLoadingAppointments=!1,this.showAppointments=!1,this.appointments=[],this.today=""},e}();yn.decorators=[{type:t.Component,args:[{selector:"appointments-overview",template:'<div *ngIf="showAppointments" class="appointments">\n <p *ngIf="loadingAppointments">\n <span *ngIf="!appointmentsLoaded && errorLoadingAppointments"\n >Error checking appointments</span\n >\n <span *ngIf="loadingAppointments"\n ><span class="fa fa-spinner fa-spin"></span>Checking appointments...</span\n >\n </p>\n <div *ngIf="appointmentsLoaded && !errorLoadingAppointments">\n <table\n *ngIf="appointments.length > 0"\n class="table table-stripped table-bordered"\n >\n <thead>\n <tr>\n <th\n *ngFor="let appointment of appointments"\n [ngClass]="{ active: appointment.date === today }"\n >\n <span>{{ appointment.date }}</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td\n *ngFor="let appointment of appointments"\n [ngClass]="{ active: appointment.date === today }"\n >\n <span\n ><strong\n ><em>{{ appointment.count }}</em></strong\n ></span\n >\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n',styles:[".appointments{margin-top:12px;font-size:12px;color:#999}.appointments p{padding-top:12px}.appointments th{border-bottom:0!important;color:#333}.appointments td span,.appointments th span{display:block}.appointments td.active,.appointments th.active{background-color:#3c8dbc;color:#fff!important;padding:0}.appointments td.active span,.appointments th.active span{padding:4px}.appointments span.fa{display:inline-block;margin-right:7px}"]}]}],yn.ctorParameters=function(){return[]},yn.propDecorators={node:[{type:t.Input}]};var gn=function(){function e(){this._value=[],this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){var e=this;this.options=this.options.map((function(t){return-1!==e.selected.indexOf(t.value)&&Object.assign(t,{checked:!0}),t}))},e.prototype.ngAfterViewInit=function(){},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},Object.defineProperty(e.prototype,"value",{get:function(){return 0===this._value.length?"":this._value||this._value[0]},set:function(e){if(null==e||""===e)e=[];else if("string"==typeof e)e=[e];else if(!Array.isArray(e))throw new TypeError("Value must be a string or an array.")},enumerable:!1,configurable:!0}),e.prototype.selectOpt=function(e,t){var n=this;t.target.checked?this._value.push(e.value):this.options.forEach((function(t){t.value===e.value&&n._value.splice(t,1)})),this.onChange(this.value)},e}();gn.decorators=[{type:t.Component,args:[{selector:"checkbox",template:'<fieldset class="bx--fieldset">\n <div class="bx--form-item bx--checkbox-wrapper" *ngFor="let option of options; let i = index">\n <input type="checkbox" class="bx--checkbox" [id]="i + \'id\'" [checked]="option.checked" (change)="selectOpt(option, $event)" [value]="option.value">\n <label [for]="i + \'id\'" class="bx--checkbox-label">\n <span class="bx--checkbox-label-text">{{ option.label }}</span>\n </label>\n </div>\n</fieldset>\n',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return gn})),multi:!0}]}]}],gn.propDecorators={options:[{type:t.Input}],selected:[{type:t.Input}]};var bn=function(){};bn.decorators=[{type:t.NgModule,args:[{declarations:[gn],exports:[gn],imports:[n.CommonModule,r.FormsModule]}]}];var vn=function(){function e(e,t){this._ref=e,this.sanitizer=t,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._result=new i.BehaviorSubject(null),this.result=this._result.asObservable(),this._internalSubscription=null}return e.prototype.ngOnDestroy=function(){this._subscription&&this._dispose()},e.prototype.transform=function(e,t){this.getfile=t;var n=this.internalTransform(e);return this.asyncTrasnform(n)},e.prototype.internalTransform=function(e){var t=this;return e?(this.previousUrl!==e&&(this.previousUrl=e,this._internalSubscription=this.getfile(e).subscribe((function(e){var n=t.sanitizer.bypassSecurityTrustUrl(e);t._result.next(n)}))),this.result):this.result},e.prototype.asyncTrasnform=function(e){return this._obj?e!==this._obj?(this._dispose(),this.asyncTrasnform(e)):this._latestValue===this._latestReturnedValue?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,t.WrappedValue.wrap(this._latestValue)):(e&&this._subscribe(e),this._latestReturnedValue=this._latestValue,this._latestValue)},e.prototype._subscribe=function(e){var t=this;this._obj=e,this._subscription=e.subscribe({next:function(n){return t._updateLatestValue(e,n)},error:function(e){throw e}})},e.prototype._dispose=function(){this._subscription&&this._subscription.unsubscribe(),this._internalSubscription&&this._internalSubscription.unsubscribe(),this._internalSubscription=null,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null},e.prototype._updateLatestValue=function(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())},e}();vn.decorators=[{type:t.Pipe,args:[{name:"secure",pure:!1}]}],vn.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:y.DomSanitizer}]};var wn=function(){};wn.decorators=[{type:t.NgModule,args:[{declarations:[vn],imports:[n.CommonModule],exports:[vn],providers:[de]}]}];var xn=function(){this.active=!1,this.disabled=!1,this.bypassDOM=!1,this.customPaneClass=""};xn.decorators=[{type:t.Component,args:[{selector:"ngx-tab",template:'\n\n <div *ngIf="active"\n class="pane"\n [ngClass]="customPaneClass">\n <h4>{{tabTitle}}</h4>\n <div *ngIf="bypassDOM">\n <ng-container [ngTemplateOutlet]="template"></ng-container>\n </div>\n <div *ngIf="!bypassDOM">\n <ng-content></ng-content>\n </div>\n </div>\n '}]}],xn.propDecorators={tabTitle:[{type:t.Input}],tabSubTitle:[{type:t.Input}],active:[{type:t.Input}],disabled:[{type:t.Input}],bypassDOM:[{type:t.Input}],customPaneClass:[{type:t.Input}],template:[{type:t.ContentChild,args:[t.TemplateRef]}]};var kn=function(){function e(){this.disableStyle=!1,this.customNavClass="",this.customTabsClass="",this.selectedIndex=0,this.onSelect=new t.EventEmitter}return e.prototype.ngOnChanges=function(e){e.selectedIndex&&!e.selectedIndex.firstChange&&this.selectTab(this.tabs.toArray()[e.selectedIndex.currentValue])},e.prototype.ngAfterContentInit=function(){var e=this,t=this.tabs.filter((function(e){return e.active}));setTimeout((function(){0===t.length&&e.selectTab(e.tabs.first)}))},e.prototype.onHover=function(e){console.log(e)},e.prototype.selectTab=function(e){!0!==e.disabled&&!0!==e.active&&(this.tabs.toArray().forEach((function(e){return e.active=!1})),e.active=!0,this.onSelect.emit(this.tabs.toArray().indexOf(e)))},e.prototype.getStatusClasses=function(e,t){return e?"active":t||e?t?"disabled":void 0:"enabled"},e}();kn.decorators=[{type:t.Component,args:[{selector:"ngx-tabset",template:'<div class="bx--grid">\n <div class="bx--row">\n <div class="bx--col-sm-2 bx--col-md-4 bx--col-lg-4">\n <div class="tab">\n <button hover-class="hover" class="tablinks completed" *ngFor="let tab of tabs" (click)="selectTab(tab)" \n [class]="getStatusClasses(tab.active,tab.disabled)">\n <span>{{ tab.tabTitle }}</span>\n </button>\n </div>\n </div>\n <div class="bx--col-sm-2 bx--col-md-4 bx--col-lg-8">\n <div id="tab" class="tabcontent">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</div>',styles:[".tab button{font-family:inherit;display:block;background-color:inherit;width:100%;border:none;outline:none;text-align:left;transition:.3s;min-height:2rem;white-space:normal;word-wrap:break-word;margin:0 0 .063rem}.tab button.active.hover,.tab button.enabled.hover{background-color:var(--gray-gray-10)}.tab button.completed{border-left:.5rem solid var(--inverse-support-02);background-color:var(--color-green-10);font-weight:400}.tab button.active,.tab button.completed{font-size:.875rem;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:.16px;color:#161616}.tab button.active{background-color:#ededed;border-left:.5rem solid #009d9a;font-weight:600}.tab button.enabled{background-color:#fff;border-left:.5rem solid #9ef0f0;line-height:1.43;color:var(--color-gray-100)}.tab button.enabled,.tab button.error{font-size:.875rem;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:.16px}.tab button.error{background-color:var(--color-red-10);border-left:.5rem solid var(--open-mrs-danger-red-60);line-height:1.29;color:#da1e28}.tab button.disabled{background-color:#fff;border-left:.5rem solid #dae0e0;font-weight:400;line-height:1.43;color:var(--gray-gray-30)}.tab button.active.error,.tab button.disabled{font-size:.875rem;font-stretch:normal;font-style:normal;letter-spacing:.16px}.tab button.active.error{background-color:var(--color-red-20);border-left:.5rem solid var(--open-mrs-danger-red-60);font-weight:600;line-height:1.29;color:#da1e28}"]}]}],kn.propDecorators={tabs:[{type:t.ContentChildren,args:[xn]}],disableStyle:[{type:t.Input}],customNavClass:[{type:t.Input}],customTabsClass:[{type:t.Input}],selectedIndex:[{type:t.Input}],onSelect:[{type:t.Output}]};var Cn=function(){function e(e){this.elementRef=e}return e.prototype.onMouseEnter=function(){this.elementRef.nativeElement.classList.add(this.hoverClass)},e.prototype.onMouseLeave=function(){this.elementRef.nativeElement.classList.remove(this.hoverClass)},e}();Cn.decorators=[{type:t.Directive,args:[{selector:"[hover-class]"}]}],Cn.ctorParameters=function(){return[{type:t.ElementRef}]},Cn.propDecorators={hoverClass:[{type:t.Input,args:["hover-class"]}],onMouseEnter:[{type:t.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:t.HostListener,args:["mouseleave"]}]};var Tn=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.forChild=function(){return{ngModule:e,providers:[]}},e}();Tn.decorators=[{type:t.NgModule,args:[{declarations:[xn,kn,Cn],exports:[xn,kn],imports:[n.CommonModule]}]}];var On=function(){function e(){this.display="default",this.warn=!1,this.id="select-"+e.selectCount++,this.size="md",this.disabled=!1,this.skeleton=!1,this.invalid=!1,this.theme="dark",this.valueChange=new t.EventEmitter,this.onChangeHandler=function(e){},this.onTouchedHandler=function(){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this.select&&(this.select.nativeElement.value=this._value)},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){void 0!==this.value&&null!==this.value&&this.select&&this.select.nativeElement.value!==this.value&&(this.select.nativeElement.value=this.value)},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChangeHandler=e},e.prototype.registerOnTouched=function(e){this.onTouchedHandler=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.onChange=function(e){this.value=e.target.value,this.onChangeHandler(e.target.value),this.valueChange.emit(e.target.value)},e.prototype.focusOut=function(){this.onTouchedHandler()},e.prototype.isTemplate=function(e){return e instanceof t.TemplateRef},e}();On.selectCount=0,On.decorators=[{type:t.Component,args:[{selector:"ibm-select",template:'\n <div class="bx--form-item">\n <ng-template [ngIf]="skeleton">\n <div *ngIf="label" class="bx--label bx--skeleton"></div>\n <div class="bx--select bx--skeleton"></div>\n </ng-template>\n <div\n *ngIf="!skeleton"\n class="bx--select"\n [ngClass]="{\n \'bx--select--inline\': display === \'inline\',\n \'bx--select--light\': theme === \'light\',\n \'bx--select--invalid\': invalid,\n \'bx--select--warning\': warn,\n \'bx--select--disabled\': disabled\n }">\n <label *ngIf="label" [for]="id" class="bx--label">\n <ng-container *ngIf="!isTemplate(label)">{{label}}</ng-container>\n <ng-template *ngIf="isTemplate(label)" [ngTemplateOutlet]="label"></ng-template>\n </label>\n <div *ngIf="helperText" class="bx--form__helper-text">\n <ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>\n <ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>\n </div>\n <div *ngIf="display === \'inline\'; else noInline" class="bx--select-input--inline__wrapper">\n <ng-container *ngTemplateOutlet="noInline"></ng-container>\n </div>\n </div>\n </div>\n\n \x3c!-- select element: dynamically projected based on \'display\' variant --\x3e\n <ng-template #noInline>\n <div class="bx--select-input__wrapper" [attr.data-invalid]="(invalid ? true : null)">\n <select\n #select\n [attr.id]="id"\n [attr.aria-label]="ariaLabel"\n [disabled]="disabled"\n (change)="onChange($event)"\n [attr.aria-invalid]="invalid ? \'true\' : null"\n class="bx--select-input"\n [ngClass]="{\n \'bx--select-input--xl\': size === \'xl\',\n \'bx--select-input--sm\': size === \'sm\'\n }">\n <ng-content></ng-content>\n </select>\n <svg\n focusable="false"\n preserveAspectRatio="xMidYMid meet"\n style="will-change: transform;"\n xmlns="http://www.w3.org/2000/svg"\n class="bx--select__arrow"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n aria-hidden="true">\n <path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path>\n </svg>\n <svg *ngIf="invalid"focusable="false" preserveAspectRatio="xMidYMid meet" style="will-change: transform;" xmlns="http://www.w3.org/2000/svg" class="bx--text-input__invalid-icon" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8,1C4.2,1,1,4.2,1,8s3.2,7,7,7s7-3.1,7-7S11.9,1,8,1z M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2 c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z"></path><path d="M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8 c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z" data-icon-path="inner-path" opacity="0"></path></svg>\n </div>\n <div *ngIf="invalid && invalidText && !warn" role="alert" class="bx--form-requirement" aria-live="polite">\n <ng-container *ngIf="!isTemplate(invalidText)">{{invalidText}}</ng-container>\n <ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>\n </div>\n <div *ngIf="!invalid && warn" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>\n <ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>\n </div>\n </ng-template>\n ',providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:On,multi:!0}],styles:["\n .bx--select--inline .bx--form__helper-text {\n order: 4;\n }\n\n .bx--select--inline:not(.bx--select--invalid) .bx--form__helper-text {\n margin-top: 0;\n }\n "]}]}],On.propDecorators={display:[{type:t.Input}],label:[{type:t.Input}],helperText:[{type:t.Input}],invalidText:[{type:t.Input}],warn:[{type:t.Input}],warnText:[{type:t.Input}],id:[{type:t.Input}],size:[{type:t.Input}],disabled:[{type:t.Input}],skeleton:[{type:t.Input}],invalid:[{type:t.Input}],theme:[{type:t.Input}],ariaLabel:[{type:t.Input}],valueChange:[{type:t.Output}],select:[{type:t.ViewChild,args:["select",{static:!1}]}],value:[{type:t.Input}],focusOut:[{type:t.HostListener,args:["focusout"]}]};var Dn=function(){this.inputClass="bx--select-option"};Dn.decorators=[{type:t.Directive,args:[{selector:"option"}]}],Dn.propDecorators={inputClass:[{type:t.HostBinding,args:["class"]}]};var Mn=function(){this.inputClass="bx--select-optgroup"};Mn.decorators=[{type:t.Directive,args:[{selector:"optgroup"}]}],Mn.propDecorators={inputClass:[{type:t.HostBinding,args:["class"]}]};var An=function(){};An.decorators=[{type:t.NgModule,args:[{declarations:[On,Dn,Mn],exports:[On,Dn,Mn],imports:[n.CommonModule,r.FormsModule]}]}];var Sn=function(){function e(){this.theme="dark",this.baseClass=!0,this.invalid=!1,this.skeleton=!1}return Object.defineProperty(e.prototype,"isLightTheme",{get:function(){return"light"===this.theme},enumerable:!1,configurable:!0}),e}();Sn.decorators=[{type:t.Directive,args:[{selector:"[ibmTextArea]"}]}],Sn.propDecorators={theme:[{type:t.Input}],baseClass:[{type:t.HostBinding,args:["class.bx--text-area"]}],invalid:[{type:t.HostBinding,args:["class.bx--text-area--invalid"]},{type:t.Input}],skeleton:[{type:t.HostBinding,args:["class.bx--skeleton"]},{type:t.Input}],isLightTheme:[{type:t.HostBinding,args:["class.bx--text-area--light"]}]};var _n=function(){function e(){this.wrapperClass="bx--text-input__field-wrapper",this.labelInputID="ibm-label-"+e.labelCounter,this.labelState="",this.skeleton=!1,this.invalid=!1,this.warn=!1,this.labelClass=!0,e.labelCounter++}return e.prototype.ngAfterContentInit=function(){this.textArea&&(this.wrapperClass="bx--text-area__wrapper")},e.prototype.ngAfterViewInit=function(){if(this.wrapper){var e=this.wrapper.nativeElement.querySelector("input,textarea,div");e&&e.setAttribute("id",this.labelInputID)}},e.prototype.isTemplate=function(e){return e instanceof t.TemplateRef},e}();_n.labelCounter=0,_n.decorators=[{type:t.Component,args:[{selector:"ibm-label",template:'\n <label\n [for]="labelInputID"\n [attr.aria-label]="ariaLabel"\n class="bx--label"\n [ngClass]="{\n \'bx--skeleton\': skeleton\n }">\n <ng-content></ng-content>\n </label>\n <div\n [class]="wrapperClass"\n [ngClass]="{\n \'bx--text-input__field-wrapper--warning\': warn\n }"\n [attr.data-invalid]="(invalid ? true : null)"\n #wrapper>\n <svg *ngIf="invalid"focusable="false" preserveAspectRatio="xMidYMid meet" style="will-change: transform;" xmlns="http://www.w3.org/2000/svg" class="bx--text-input__invalid-icon" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8,1C4.2,1,1,4.2,1,8s3.2,7,7,7s7-3.1,7-7S11.9,1,8,1z M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2 c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z"></path><path d="M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8 c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z" data-icon-path="inner-path" opacity="0"></path></svg>\n <ng-content select="input,textarea,div"></ng-content>\n </div>\n <div *ngIf="!skeleton && helperText && !invalid && !warn" class="bx--form__helper-text">\n <ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>\n <ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>\n </div>\n <div *ngIf="!warn && invalid" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(invalidText)">{{invalidText}}</ng-container>\n <ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>\n </div>\n <div *ngIf="!invalid && warn" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>\n <ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>\n </div>\n '}]}],_n.ctorParameters=function(){return[]},_n.propDecorators={labelInputID:[{type:t.Input}],labelState:[{type:t.Input}],skeleton:[{type:t.Input}],helperText:[{type:t.Input}],invalidText:[{type:t.Input}],invalid:[{type:t.Input}],warn:[{type:t.Input}],warnText:[{type:t.Input}],ariaLabel:[{type:t.Input}],wrapper:[{type:t.ViewChild,args:["wrapper",{static:!1}]}],textArea:[{type:t.ContentChild,args:[Sn,{static:!1}]}],labelClass:[{type:t.HostBinding,args:["class.bx--form-item"]}]};var In=function(){function e(){this.theme="dark",this.size="md",this.inputClass=!0,this.invalid=!1,this.warn=!1,this.skeleton=!1}return Object.defineProperty(e.prototype,"isSizeXl",{get:function(){return"xl"===this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSizeSm",{get:function(){return"sm"===this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLightTheme",{get:function(){return"light"===this.theme},enumerable:!1,configurable:!0}),e}();In.decorators=[{type:t.Directive,args:[{selector:"[ibmText]"}]}],In.propDecorators={theme:[{type:t.Input}],size:[{type:t.Input}],inputClass:[{type:t.HostBinding,args:["class.bx--text-input"]}],isSizeXl:[{type:t.HostBinding,args:["class.bx--text-input--xl"]}],isSizeSm:[{type:t.HostBinding,args:["class.bx--text-input--sm"]}],invalid:[{type:t.HostBinding,args:["class.bx--text-input--invalid"]},{type:t.Input}],warn:[{type:t.HostBinding,args:["class.bx--text-input__field-wrapper--warning"]},{type:t.Input}],skeleton:[{type:t.HostBinding,args:["class.bx--skeleton"]},{type:t.Input}],isLightTheme:[{type:t.HostBinding,args:["class.bx--text-input--light"]}]};var Pn=function(){};Pn.decorators=[{type:t.NgModule,args:[{declarations:[_n,In,Sn],exports:[_n,In,Sn],imports:[n.CommonModule,r.FormsModule]}]}];var En=function(){};En.decorators=[{type:t.NgModule,args:[{schemas:[t.CUSTOM_ELEMENTS_SCHEMA],imports:[n.CommonModule,r.ReactiveFormsModule,An,l.NgSelectModule,Ce,Pn,Pe,fn,bn,Pt,wn,Tn.forRoot()],declarations:[he,Vt,yn,ye,fe,w,we],providers:[r.FormBuilder,ue,x,se,le,ce,Y,re,me,qt,on,nn,se,H,sn,ln,pn,dn,cn,v],exports:[he,Vt,fe,Pe,Pt]}]}];var Vn,qn=function(e,t){this.key=e,this.value=t};(Vn=e.RenderingType||(e.RenderingType={}))[Vn.Form=0]="Form",Vn[Vn.Page=1]="Page",Vn[Vn.Section=2]="Section",Vn[Vn.Select=3]="Select",Vn[Vn.DropDown=4]="DropDown",e.AfeFormArray=z,e.AfeFormControl=Q,e.AfeFormGroup=G,e.CheckBoxQuestion=Gt,e.ConditionalValidationModel=N,e.ControlRelationsFactory=H,e.DataSources=de,e.DateQuestion=Ht,e.DateTimePickerModule=Pe,e.DateValidationModel=Ut,e.EncounterAdapter=pn,e.FileUploadQuestion=zt,e.Form=rn,e.FormControlService=ue,e.FormEntryModule=En,e.FormErrorsService=x,e.FormFactory=on,e.FormSchemaCompiler=qt,e.HistoricalEncounterDataService=Kt,e.JsExpressionHelper=re,e.JsExpressionValidationModel=R,e.MaxValidationModel=$t,e.MinValidationModel=Jt,e.MultiSelectQuestion=Lt,e.NestedQuestion=Yt,e.NgxDateTimePickerModule=Pt,e.ObsAdapterHelper=sn,e.ObsValueAdapter=ln,e.Option=Et,e.OrderValueAdapter=cn,e.Pair=qn,e.PersonAttribuAdapter=dn,e.QuestionBase=W,e.QuestionFactory=nn,e.QuestionGroup=Bt,e.RepeatingQuestion=Qt,e.SelectQuestion=Rt,e.TestOrderQuestion=Wt,e.TextAreaInputQuestion=jt,e.TextInputQuestion=Ft,e.UiSelectQuestion=Nt,e.ValidationFactory=se,e.ValidationModel=j,e.ɵa=An,e.ɵb=On,e.ɵba=nt,e.ɵbb=Ue,e.ɵbc=Le,e.ɵbe=He,e.ɵbf=Fe,e.ɵbg=je,e.ɵbh=Re,e.ɵbi=Ne,e.ɵbj=Ye,e.ɵbk=qe,e.ɵbl=st,e.ɵbm=lt,e.ɵbn=ct,e.ɵbo=rt,e.ɵbp=it,e.ɵbq=ot,e.ɵbr=at,e.ɵbs=ze,e.ɵbt=gt,e.ɵbu=bt,e.ɵbv=Qe,e.ɵbw=Be,e.ɵbx=ft,e.ɵby=pt,e.ɵbz=ht,e.ɵc=Dn,e.ɵca=dt,e.ɵcb=mt,e.ɵcc=yt,e.ɵcd=St,e.ɵce=It,e.ɵcf=Mt,e.ɵcg=At,e.ɵch=Ve,e.ɵci=wn,e.ɵcj=vn,e.ɵck=Tn,e.ɵcl=xn,e.ɵcm=kn,e.ɵcn=Cn,e.ɵco=he,e.ɵcp=pe,e.ɵcq=Vt,e.ɵcr=yn,e.ɵcs=ye,e.ɵct=me,e.ɵcu=fe,e.ɵcv=w,e.ɵcw=we,e.ɵcx=le,e.ɵcy=Y,e.ɵcz=v,e.ɵd=Mn,e.ɵda=ce,e.ɵe=Ce,e.ɵf=ke,e.ɵg=Pn,e.ɵh=_n,e.ɵi=Sn,e.ɵj=In,e.ɵk=Oe,e.ɵl=Me,e.ɵm=Ae,e.ɵn=Se,e.ɵo=Ie,e.ɵp=fn,e.ɵq=hn,e.ɵr=bn,e.ɵs=gn,e.ɵt=wt,e.ɵu=vt,e.ɵv=Je,e.ɵw=Xe,e.ɵx=Ke,e.ɵy=et,e.ɵz=tt,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("@angular/forms"),require("moment"),require("lodash"),require("hammerjs"),require("@angular/common"),require("@angular/platform-browser"),require("ngx-file-uploader"),require("ngx-webcam"),require("@angular/material/core"),require("@angular/material-moment-adapter"),require("@angular/material/datepicker"),require("@angular/material/form-field"),require("@angular/material"),require("@angular/material/select"),require("pdfmake/build/pdfmake.js"),require("pdfmake/build/vfs_fonts.js"),require("@angular/common/http"),require("ngx-bootstrap/collapse"),require("time-ago-pipe")):"function"==typeof define&&define.amd?define("@ampath-kenya/ngx-openmrs-formentry",["exports","@angular/core","rxjs","@angular/forms","moment","lodash","hammerjs","@angular/common","@angular/platform-browser","ngx-file-uploader","ngx-webcam","@angular/material/core","@angular/material-moment-adapter","@angular/material/datepicker","@angular/material/form-field","@angular/material","@angular/material/select","pdfmake/build/pdfmake.js","pdfmake/build/vfs_fonts.js","@angular/common/http","ngx-bootstrap/collapse","time-ago-pipe"],t):t((e["ampath-kenya"]=e["ampath-kenya"]||{},e["ampath-kenya"]["ngx-openmrs-formentry"]={}),e.ng.core,e.rxjs,e.ng.forms,null,null,null,e.ng.common,e.ng.platformBrowser,null,null,e.ng.material.core,e.ng["material-moment-adapter"],e.ng.material.datepicker,e.ng.material["form-field"],e.ng.material,e.ng.material.select,null,null,e.ng.common.http,null,null)}(this,function(exports,i0,rxjs,forms,moment_,_,hammerjs,common,platformBrowser,ngxFileUploader,ngxWebcam,core,materialMomentAdapter,datepicker,formField,material,select,pdfMake,vfs_fonts_js,http,collapse,timeAgoPipe){"use strict";var DebugModeService=function(){function e(){this.cookieKey="formDebug"}return e.prototype.debugEnabled=function(){return!1},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),FormErrorsService=function(){function e(){this.announceErrorFieldSource=new rxjs.Subject,this.announceErrorField$=this.announceErrorFieldSource.asObservable()}return e.prototype.announceErrorField=function(e){this.announceErrorFieldSource.next(e)},e.control=null,e.tab=null,e.decorators=[{type:i0.Injectable}],e}(),extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var ControlRelation=function(){function e(e,t){this._control=e,this._relatedTo=t,this._registerForChangesFromRelatedControl()}return Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"relatedTo",{get:function(){return this._relatedTo},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastUpdateValue",{get:function(){return this._lastUpdateValue},enumerable:!0,configurable:!0}),e.prototype.updateControlBasedOnRelation=function(e){return e!==this._lastUpdateValue&&(this._lastUpdateValue=e,this._control.updateCalculatedValue&&this._control.updateCalculatedValue(),this._control.updateValueAndValidity(),this._control.updateHiddenState&&this._control.updateHiddenState(),this._control.updateDisabledState&&this._control.updateDisabledState(),this._control.updateAlert&&this._control.updateAlert(),!0)},e.prototype._registerForChangesFromRelatedControl=function(){var t=this;this._relatedTo.valueChanges.subscribe(function(e){t.updateControlBasedOnRelation(e)})},e}(),ControlRelations=function(){function e(e,t){this._otherRelations=[],this._relationFor=e,this._relations=[],t&&this.addRelatedControls(t)}return Object.defineProperty(e.prototype,"relationsFor",{get:function(){return this._relationFor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"relations",{get:function(){return this._relations},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"otherRelations",{get:function(){return this._otherRelations},enumerable:!0,configurable:!0}),e.prototype.addRelatedControls=function(e){if(e instanceof forms.AbstractControl&&this.relations.push(new ControlRelation(this._relationFor,e)),e instanceof Array)for(var t=0;t<e.length;t++)this.relations.push(new ControlRelation(this._relationFor,e[t]))},e}(),HiderHelper=function(){function e(){}return e.prototype.hideControl=function(e){e.hidden=!0,e.disable&&e.disable()},e.prototype.showControl=function(e){e.hidden=!1},e.prototype.setHiderForControl=function(e,t){e.hiders.push(t)},e.prototype.clearHidersForControl=function(e){e.hiders.splice(0),e.hidden=!1},e.prototype.evaluateControlHiders=function(e){var t=!1;e.hiders.forEach(function(e){e.reEvaluateHidingExpression(),!0===e.toHide&&(t=!0)}),e.hidden=t,e.hidden&&e.disable&&e.disable()},e.prototype.setUpReEvaluationWhenValueChanges=function(t){t.updateHiddenState&&t.valueChanges.subscribe(function(e){t.updateHiddenState()})},e}(),AlertHelper=function(){function e(){}return e.prototype.hideAlert=function(e){e.shown=!1},e.prototype.showAlert=function(e){e.shown=!0},e.prototype.setAlertsForControl=function(e,t){e.alerts.push(t)},e.prototype.clearAlertsForControl=function(e){e.alerts.splice(0),e.alert=""},e.prototype.evaluateControlAlerts=function(e){var t="";e.alerts.forEach(function(e){e.reEvaluateAlertExpression(),t=!0===e.shown?e.alertMessage:""}),e.alert=t},e.prototype.setUpReEvaluationWhenValueChanges=function(t){t.updateAlert&&t.valueChanges.subscribe(function(e){t.updateAlert()})},e}(),DisablerHelper=function(){function e(){}return e.prototype.setDisablerForControl=function(e,t){e.disablers.push(t)},e.prototype.clearDisablersForControl=function(e){e.disablers.splice(0),e.disable()},e.prototype.evaluateControlDisablers=function(e){var t=!1;e.disablers.forEach(function(e){e.reEvaluateDisablingExpression(),!0===e.toDisable&&(t=!0)}),t?e.disable():e.enable()},e.prototype.setUpReEvaluationWhenValueChanges=function(t){t.updateDisabledState&&t.valueChanges.subscribe(function(e){t.updateDisabledState()})},e}(),NodeBase=function(){function e(e,t,n,o){this._control=t,this._questionModel=e,this._form=n,this._path=o?o+"."+e.key:e.key}return Object.defineProperty(e.prototype,"question",{get:function(){return this._questionModel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"form",{get:function(){return this._form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._path},enumerable:!0,configurable:!0}),e.prototype.removeAt=function(e){},e.prototype.createChildNode=function(){},e.prototype.removeChildNode=function(){},e}(),LeafNode=function(i){function e(e,t,n,o,r){return i.call(this,e,t,o,r)||this}return __extends(e,i),e}(NodeBase),GroupNode=function(a){function e(e,t,n,o,r){var i=a.call(this,e,t,o,r)||this;return i._children={},i}return __extends(e,a),Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!0,configurable:!0}),e.prototype.setChild=function(e,t){this.children[e]=t},e}(NodeBase),ArrayNode=function(s){function e(e,t,n,o,r,i){var a=s.call(this,e,t,r,i)||this;return a.formFactory=o,a.childNodeCreatedEvents=[],a._children=[],a.childNodeCreatedEvents=[],a}return __extends(e,s),Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!0,configurable:!0}),e.prototype.createChildNode=function(){if(this.createChildFunc){var e=this.createChildFunc(this.question,this,this.formFactory);return this.fireChildNodeCreatedListener(e),e}return null},e.prototype.removeAt=function(e){confirm("Are you sure you want to remove?")&&this.removeChildFunc&&this.removeChildFunc(e,this)},e.prototype.addChildNodeCreatedListener=function(e){this.childNodeCreatedEvents.push(e)},e.prototype.fireChildNodeCreatedListener=function(e){for(var t=0;t<this.childNodeCreatedEvents.length;t++){(0,this.childNodeCreatedEvents[t])(e)}},e}(NodeBase),ValidationModel=function Xa(e){this.type=e.type,this.message=e.message||null},JsExpressionValidationModel=function(n){function e(e){var t=n.call(this,e)||this;return t.failsWhenExpression=e.failsWhenExpression,t}return __extends(e,n),e}(ValidationModel),ConditionalValidationModel=function(n){function e(e){var t=n.call(this,e)||this;return t.referenceQuestionId=e.referenceQuestionId,t.referenceQuestionAnswers=e.referenceQuestionAnswers,t}return __extends(e,n),e}(ValidationModel),ControlRelationsFactory=function(){function e(){}return e.prototype.buildRelations=function(e){var t=this.mapControlIds(e,{});for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];this.setRelations(t,o)}},e.prototype.buildArrayNodeRelations=function(e){var t=e.form;if(t){var n=t.rootNode;this.buildRelations(e);var o=this.mapControlIds(n,{}),r=this.mapControlIds(e,{});for(var i in o){if(o.hasOwnProperty(i))if((l=o[i])instanceof LeafNode){var a=l.question;a.key&&0<a.key.length&&this.setRelations(r,l)}}for(var s in this.createRelationsToArrayControls(e),r)if(r.hasOwnProperty(s)){var l,u=(l=r[s]).control;u.updateHiddenState(),u.updateAlert()}}},e.prototype.createRelationsToArrayControls=function(a){var s=a.form.rootNode,e=this.mapControlIds(s,{}),l=this.mapControlIds(a,{});for(var t in e)if(e.hasOwnProperty(t)){var u=e[t],c=a.path.substring(0,a.path.lastIndexOf("."));if(-1===u.path.indexOf(c+".")){var n=function(e){if(l.hasOwnProperty(e)){var t=l[e],n=t.question.key;if(p.hasRelation(n,u.question)){var o=a.form.searchNodeByPath(s,c,[]);if(0<o.length){var r=o[0],i=u.control;-1===i.controlRelations.otherRelations.indexOf(r)&&i.controlRelations.otherRelations.push(r),t.control.addValueChangeListener(function(e){i.updateCalculatedValue&&i.updateCalculatedValue(),i.updateValueAndValidity(),i.updateHiddenState&&i.updateHiddenState(),i.updateAlert&&i.updateAlert(),i.updateDisabledState&&i.updateDisabledState()})}}}},p=this;for(var o in l)n(o)}}},e.prototype.getRelationsForControl=function(e,t){var n=new Array,o=t.form.searchNodeByQuestionId(e);if(0<o.length){var r=o[0],i=this.mapControlIds(t,{});for(var a in i)i.hasOwnProperty(a)&&this.hasRelation(i[a].question.key,r.question)&&n.push(i[a].control)}return n},e.prototype.mapControlIds=function(e,t){var n=e.children;for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];if(r instanceof GroupNode)this.mapControlIds(r,t);else if(r instanceof LeafNode){(i=r.question).key&&0<i.key.length&&(t[i.key]=r)}else if(r instanceof ArrayNode){var i;(i=r.question).key&&0<i.key.length&&(t[i.key]=r)}}return t},e.prototype.setRelations=function(e,t){var n=t.question.key;for(var o in e)if(e.hasOwnProperty(o)&&o!==n){var r=e[o],i=r.question;if(this.hasRelation(n,i,t)&&this.addRelationToControl(r.control,t.control),"object"==typeof i.required){var a=i.required;"conditionalRequired"===a.type&&a.referenceQuestionId===n&&this.addRelationToControl(r.control,t.control)}}},e.prototype.hasRelation=function(n,e,t){var o=!1;if(e.validators&&0<e.validators.length&&e.validators.forEach(function(e){if(e instanceof JsExpressionValidationModel){var t=e.failsWhenExpression;t&&-1!==t.indexOf(n)&&(o=!0)}else e instanceof ConditionalValidationModel&&"conditionalAnswered"===e.type&&e.referenceQuestionId===n&&(o=!0)}),!o){if("string"==typeof e.hide){var r=e.hide;0<r.length&&-1!==r.indexOf(n)&&(o=!0)}else if("object"==typeof e.hide){e.hide.field===n&&(o=!0)}if(e.alert&&"object"==typeof e.alert&&(o=!0),"string"==typeof e.disable){var i=e.disable;0<i.length&&-1!==i.indexOf(n)&&(o=!0)}}return!o&&e.calculateExpression&&0<e.calculateExpression.length&&-1!==e.calculateExpression.indexOf(n)&&(o=!0),o},e.prototype.addRelationToControl=function(e,t){e.controlRelations.addRelatedControls(t)},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),moment=moment_,ExpressionRunner=function(){function ExpressionRunner(){}return ExpressionRunner.prototype.getRunnable=function(expression,control,helper,dataDependencies,form){var runner=this,runnable={run:function(){var scope={};control.uuid&&(scope[control.uuid]=control.value),window.moment=moment,scope.myValue=control.value,runner.getControlRelationValueString(control,scope),runner.getHelperMethods(helper,scope),runner.getDataDependencies(dataDependencies,scope),form&&runner.getDataDependencies(form.dataSourcesContainer.dataSources,scope);var paramList="",argList="";for(var o in scope)paramList=""===paramList?paramList+o:paramList+","+o,argList=""===argList?argList+"scope['"+o+"']":argList+",scope['"+o+"']";-1===expression.indexOf("return")&&(expression='"return '+expression+'"');var funcDeclarationCode='var afeDynamicFunc = new Function("'+paramList+'", '+expression+");",funcCallCode="afeDynamicFunc.call(this "+(""===argList?"":","+argList)+");";try{return 0<=Object.keys(scope).indexOf("undefined")?(console.warn("Missing reference found",expression,scope),!1):eval(funcDeclarationCode+funcCallCode)}catch(e){return!1}}};return runnable},ExpressionRunner.prototype.getControlRelationValueString=function(i,a){var s=this;i&&i.controlRelations&&i.controlRelations.relations&&i.controlRelations.relations.forEach(function(e){if(e.relatedTo){var t=e.relatedTo,n=e.relatedTo;n&&Array.isArray(n.value)?a[t.uuid]=e.relatedTo.value:a[t.uuid]=e.relatedTo.value&&e.relatedTo.value.value?e.relatedTo.value.value:e.relatedTo.value}}),i&&i.controlRelations&&i.controlRelations.otherRelations&&0<i.controlRelations.otherRelations.length&&i.controlRelations.otherRelations.forEach(function(e){if(e instanceof ArrayNode){var t=e,n=i.uuid,o=new ControlRelationsFactory,r=[];t.children.forEach(function(e){r=r.concat(o.getRelationsForControl(n,e))}),s.setControlArrayValues(i,r,a)}})},ExpressionRunner.prototype.setControlArrayValues=function(e,n,o){var r=this;this._getFormControlKeys(n).forEach(function(e){var t=r._getValuesForKey(e,n);o[e]=t})},ExpressionRunner.prototype._getFormControlKeys=function(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e.uuid)&&t.push(e.uuid)}),t},ExpressionRunner.prototype._getValuesForKey=function(t,e){var n=[];return e.forEach(function(e){e.uuid===t&&n.push(e.value)}),n},ExpressionRunner.prototype.getHelperMethods=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},ExpressionRunner.prototype.getDataDependencies=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},ExpressionRunner}(),AfeFormControl=function(r){function e(e,t,n){var o=r.call(this,e,t,n)||this;return o.hidden=!1,o.hiderHelper=new HiderHelper,o.disablerHelper=new DisablerHelper,o.AlertHelper=new AlertHelper,o._controlRelations=new ControlRelations(o),o.hiders=[],o.disablers=[],o.alerts=[],o.valueChanges.subscribe(function(e){o._previousValue!==e&&(o.fireValueChangeListener(e),o._previousValue=e)}),o}return __extends(e,r),Object.defineProperty(e.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!0,configurable:!0}),e.prototype.disable=function(e){r.prototype.disable.call(this,e),r.prototype.setValue.call(this,"")},e.prototype.hide=function(){this.hiderHelper.hideControl(this)},e.prototype.show=function(){this.hiderHelper.showControl(this)},e.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},e.prototype.setCalculatorFn=function(e){this.calculator=e},e.prototype.updateCalculatedValue=function(){if(this.calculator){var e=this.calculator.call(ExpressionRunner,{});this.setValue(e)}},e.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},e.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},e.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},e.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},e.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},e.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},e.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},e.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},e.prototype.addValueChangeListener=function(e){this._valueChangeListener=e},e.prototype.fireValueChangeListener=function(e){this._valueChangeListener&&"function"==typeof this._valueChangeListener&&this._valueChangeListener(e)},e.prototype.setValue=function(e){r.prototype.setValue.call(this,e)},e}(forms.FormControl),AfeFormGroup=function(r){function e(e,t,n){var o=r.call(this,e,t,n)||this;return o.hiderHelper=new HiderHelper,o.disablerHelper=new DisablerHelper,o.AlertHelper=new AlertHelper,o._controlRelations=new ControlRelations(o),o.hiders=[],o.disablers=[],o.alerts=[],o}return __extends(e,r),Object.defineProperty(e.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!0,configurable:!0}),e.prototype.hide=function(){this.hiderHelper.hideControl(this)},e.prototype.show=function(){this.hiderHelper.showControl(this)},e.prototype.disable=function(e){r.prototype.disable.call(this,e),r.prototype.setValue.call(this,{})},e.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},e.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},e.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},e.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},e.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},e.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},e.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},e.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},e.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},e.prototype.setValue=function(e){r.prototype.setValue.call(this,e)},e}(forms.FormGroup),AfeFormArray=function(r){function e(e,t,n){var o=r.call(this,e,t,n)||this;return o.hiderHelper=new HiderHelper,o.AlertHelper=new AlertHelper,o.disablerHelper=new DisablerHelper,o._controlRelations=new ControlRelations(o),o.hiders=[],o.alerts=[],o.disablers=[],o.valueChanges.subscribe(function(e){o._previousValue!==e&&(o.fireValueChangeListener(e),o._previousValue=e)}),o}return __extends(e,r),Object.defineProperty(e.prototype,"uuid",{get:function(){return this._uuid},set:function(e){this._uuid=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!0,configurable:!0}),e.prototype.hide=function(){this.hiderHelper.hideControl(this)},e.prototype.show=function(){this.hiderHelper.showControl(this)},e.prototype.disable=function(e){r.prototype.disable.call(this,e),r.prototype.setValue.call(this,[])},e.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},e.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},e.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},e.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},e.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},e.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},e.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},e.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},e.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},e.prototype.addValueChangeListener=function(e){this._valueChangeListener=e},e.prototype.fireValueChangeListener=function(e){0<this.alerts.length&&this.updateAlert(),this._valueChangeListener&&"function"==typeof this._valueChangeListener&&this._valueChangeListener(e)},e.prototype.setValue=function(e){r.prototype.setValue.call(this,e)},e}(forms.FormArray),Ld;Ld=exports.AfeControlType||(exports.AfeControlType={}),Ld[Ld.AfeFormControl=0]="AfeFormControl",Ld[Ld.AfeFormArray=1]="AfeFormArray",Ld[Ld.AfeFormGroup=2]="AfeFormGroup",Ld[Ld.None=3]="None";var QuestionBase=function(){function e(e){this.defaultValue=e.defaultValue,this.originalValue=e.originalValue,this.extras=e.extras,this.renderingType=e.type,this.key=e.key||"",this.label=e.label||"",this.validators=e.validators||[],this.required=e.required,this.hide=e.hide,this.disable=e.disable,this.alert=e.alert,this.historicalDataValue=e.historicalDataValue,this.calculateExpression=e.calculateExpression}return e.prototype.setHistoricalValue=function(e){this.enableHistoricalValue=e},e.prototype.showHistoricalEncounterDate=function(e){this.showHistoricalValueDate=e===undefined||e},e}(),ConditionalRequiredValidator=function(){function e(){}return e.prototype.validate=function(a){return function(e){var t,n=e.value,o=null,r=a.referenceQuestionId,i=a.referenceQuestionAnswers;return e&&e.controlRelations&&e.controlRelations.relations&&e.controlRelations.relations.forEach(function(e){var t=e.relatedTo;t.uuid===r&&(o=t&&Array.isArray(t.value)?e.relatedTo.value:e.relatedTo.value&&e.relatedTo.value.value?e.relatedTo.value.value:e.relatedTo.value)}),"object"==typeof i&&-1!==i.indexOf(o)&&(t=!0),t&&!n?{conditional_required:{message:a.message}}:null}},e}(),ConditionalAnsweredValidator=function(){function e(){}return e.prototype.validate=function(a){return function(e){var t=e.value,n=null,o=a.referenceQuestionId,r=a.referenceQuestionAnswers,i=!0;return t&&e&&e.controlRelations&&e.controlRelations.relations&&e.controlRelations.relations.forEach(function(e){var t=e.relatedTo;t.uuid===o&&(n=Array.isArray(t.value)?t.value:t.value&&"object"==typeof t.value&&t.value.value?t.value.value:t.value),n?"object"==typeof r&&-1===r.indexOf(n)&&(i=!1):i=!1}),i?null:{conditional_answered:{message:a.message}}}},e}(),RequiredValidator=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value;return null==t||"string"==typeof t&&0===t.length?{required:!0}:null},e}(),DateValidator=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value;return t&&0!==t.length?!/Invalid|NaN/.test(new Date(t).toString())?null:{date:!0}:null},e}(),MinValidator=function(){function e(){}return e.prototype.validate=function(n){return function(e){if(e.hidden)return null;if(e.value&&0!==e.value.length){var t=e.value;return n<=t?null:{min:{requiredValue:n,actualValue:t}}}return null}},e}(),MaxValidator=function(){function e(){}return e.prototype.validate=function(n){return function(e){if(e.hidden)return null;if(e.value&&0!==e.value.length){var t=e.value;return t<=n?null:{max:{requiredValue:n,actualValue:t}}}return null}},e}(),MinDateValidator=function(){function e(){}return e.prototype.validate=function(n){return function(e){if(e.hidden)return null;if(e.value&&0!==e.value.length){if((new DateValidator).validate(e.value))return{mindate:{requiredDate:n}};var t=new Date(e.value);return t.getTime()<n.getTime()?{mindate:{requiredDate:n,actualDate:t}}:null}return null}},e}(),MaxDateValidator=function(){function e(){}return e.prototype.validate=function(n){return function(e){if(e.hidden)return null;if(e.value&&0!==e.value.length){if((new DateValidator).validate(e.value))return{maxdate:{requiredDate:n}};var t=new Date(e.value);return t.getTime()>n.getTime()?{maxdate:{requiredDate:n,actualDate:t}}:null}return null}},e}(),FutureDateRestrictionValidator=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value,n=new Date;if(t&&0!==t.length&&!(new DateValidator).validate(t))return new Date(t).getTime()>n.getTime()?{futureDateRestriction:!0}:null;return null},e}(),JsExpressionHelper=function(){function e(){}return e.prototype.calcBMI=function(e,t){var n;return e&&t&&(n=(t/(e/100*e/100)).toFixed(1)),e&&t?parseFloat(n):null},e.prototype.calcBSA=function(e,t){var n;return e&&t&&(n=Math.sqrt(e*t/3600).toFixed(2)),e&&t?parseFloat(n):null},e.prototype.calcBMIForAgeZscore=function(e,t,n){var o;t&&n&&(o=(n/(t/100*t/100)).toFixed(1));var r,i=_.first(e);if(i){var a=Object.keys(i).map(function(e){return i[e]}).map(function(e){return e}),s=Object.keys(i),l=a[1],u=[];o<l?u.push(l):_.forEach(a,function(e){e<=o&&u.push(e)});var c=_.last(u);(r=s[_.findIndex(a,function(e){return e===c})].replace("SD","")).includes("neg")&&(r="-"+(r=r.substring(1,0))),"S"!==r&&"L"!==r&&"M"!==r&&"-5"!==r||(r="-4")}return o&&i?r:null},e.prototype.calcWeightForHeightZscore=function(e,t,n){var o,r;t&&n&&(t=parseFloat(t).toFixed(1));t<45||110<t?r=-4:o=_.filter(e,function(e){return parseFloat(e.Length).toFixed(1)===t});var i=_.first(o);if(i){var a=Object.keys(i).map(function(e){return i[e]}).map(function(e){return e}),s=Object.keys(i),l=a[1],u=[];n<l?u.push(l):_.forEach(a,function(e){e<=n&&u.push(e)});var c=_.last(u);(r=s[_.findIndex(a,function(e){return e===c})].replace("SD","")).includes("neg")&&(r="-"+(r=r.substring(1,0))),"S"!==r&&"L"!==r&&"M"!==r&&"-5"!==r||(r="-4")}return t&&n?r:null},e.prototype.calcHeightForAgeZscore=function(e,t,n){var o,r=_.first(e);if(r){var i=Object.keys(r).map(function(e){return r[e]}).map(function(e){return e}),a=Object.keys(r),s=i[1],l=[];t<s?l.push(s):_.forEach(i,function(e){e<=t&&l.push(e)});var u=_.last(l);(o=a[_.findIndex(i,function(e){return e===u})].replace("SD","")).includes("neg")&&(o="-"+(o=o.substring(1,0))),"S"!==o&&"L"!==o&&"M"!==o&&"-5"!==o||(o="-4")}return t&&n&&r?o:null},e.prototype.isEmpty=function(e){return e===undefined||null===e||""===e||"null"===e||"undefined"===e||!(!Array.isArray(e)||0!==e.length)},e.prototype.arrayContains=function(e,t){if(Array.isArray(t)){if(0===t.length)return!0;for(var n=!0,o=0;o<t.length;o++){var r=t[o];-1===e.indexOf(r)&&(n=!1)}return n}return-1!==e.indexOf(t)},e.prototype.extractRepeatingGroupValues=function(t,e){return e.map(function(e){return e[t]})},e.prototype.formatDate=function(e,t,n){if(t=t||"yyyy-MM-dd",n=n||"+0300",!(e instanceof Date||null!==(e=new Date(e))&&e!==undefined))throw new Error("DateFormatException: value passed is not a valid date");return e},e.prototype.arrayContainsAny=function(e,t){if(Array.isArray(t)){if(0===t.length)return!0;for(var n=!1,o=0;o<t.length;o++){var r=t[o];-1!==e.indexOf(r)&&(n=!0)}return n}return-1!==e.indexOf(t)},Object.defineProperty(e.prototype,"helperFunctions",{get:function(){var e=this;return{arrayContainsAny:e.arrayContainsAny,calcBMI:e.calcBMI,calcBMIForAgeZscore:e.calcBMIForAgeZscore,calcWeightForHeightZscore:e.calcWeightForHeightZscore,calcHeightForAgeZscore:e.calcHeightForAgeZscore,isEmpty:e.isEmpty,arrayContains:e.arrayContains,extractRepeatingGroupValues:e.extractRepeatingGroupValues}},enumerable:!0,configurable:!0}),e}(),Validations=function(){function e(){}return e.JSExpressionValidatorsEnabled=!1,e}(),JsExpressionValidator=function(){function e(){}return e.prototype.validate=function(o,r){return function(e){if(!Validations.JSExpressionValidatorsEnabled)return null;var t=o.failsWhenExpression,n=(new JsExpressionHelper).helperFunctions;return(new ExpressionRunner).getRunnable(t,e,n,{},r).run()?{js_expression:{expression:t,message:o.message}}:null}},e}(),Messages=function(){function e(){}return e.REQUIRED_FIELD_MSG="This field is required!",e.INVALID_DATE_MSG="Provided date is invalid!",e.FUTURE_DATE_RESTRICTION_MSG="Future date is not allowed!",e.MIN_LENGTH_MSG="Min Length should be {minLength}",e.MAX_LENGTH_MSG="Max Length should be {maxLength}",e.MAX_DATE_MSG="Max Date should be {maxDate}",e.MIN_DATE_MSG="Min Date should be {minDate}",e.MAX_MSG="Max value should be {max}",e.MIN_MSG="Min value should be {min}",e}(),ValidationFactory=function(){function e(){}return e.prototype.getValidators=function(e,t){var n=this,o=[];return e.validators&&_.forEach(e.validators,function(e){switch(e.type){case"date":o.push(n.dateValidator),e.allowFutureDates||o.push(n.futureDateRestrictionValidator);break;case"js_expression":o.push(n.jsExpressionValidator.validate(e,t));break;case"max":o.push(n.getMaxValueValidator(e.max));break;case"min":o.push(n.getMinValueValidator(e.min));break;case"conditionalRequired":o.push(n.conditionalRequiredValidator.validate(e));break;case"conditionalAnswered":o.push(n.conditionalAnsweredValidator.validate(e))}}),e.required&&"string"==typeof e.required&&"true"===e.required&&o.push(this.requiredValidator),o},Object.defineProperty(e.prototype,"conditionalRequiredValidator",{get:function(){return new ConditionalRequiredValidator},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"conditionalAnsweredValidator",{get:function(){return new ConditionalAnsweredValidator},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requiredValidator",{get:function(){return(new RequiredValidator).validate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dateValidator",{get:function(){return(new DateValidator).validate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"futureDateRestrictionValidator",{get:function(){return(new FutureDateRestrictionValidator).validate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDateValidator",{get:function(){return(new MaxDateValidator).validate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDateValidator",{get:function(){return(new MinDateValidator).validate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minLengthValidator",{get:function(){return forms.Validators.minLength},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLengthValidator",{get:function(){return forms.Validators.maxLength},enumerable:!0,configurable:!0}),e.prototype.getMinValueValidator=function(e){return(new MinValidator).validate(e)},e.prototype.getMaxValueValidator=function(e){return(new MaxValidator).validate(e)},Object.defineProperty(e.prototype,"jsExpressionValidator",{get:function(){return new JsExpressionValidator},enumerable:!0,configurable:!0}),e.prototype.errors=function(e,t){var n=[];for(var o in e)if(e.hasOwnProperty(o))switch(o){case"required":n.push(Messages.REQUIRED_FIELD_MSG);break;case"date":n.push(Messages.INVALID_DATE_MSG);break;case"futureDateRestriction":n.push(Messages.FUTURE_DATE_RESTRICTION_MSG);break;case"minlength":n.push(Messages.MIN_LENGTH_MSG.replace("{minLength}",e.minlength.requiredLength));break;case"maxlength":n.push(Messages.MIN_LENGTH_MSG.replace("{maxLength}",e.maxlength.requiredLength));break;case"maxdate":n.push(Messages.MAX_DATE_MSG.replace("{maxDate}",e.maxdate.requiredDate));break;case"mindate":n.push(Messages.MIN_DATE_MSG.replace("{minDate}",e.mindate.requiredDate));break;case"max":n.push(Messages.MAX_MSG.replace("{max}",e.max.requiredValue));break;case"min":n.push(Messages.MIN_MSG.replace("{min}",e.min.requiredValue));break;case"js_expression":n.push(e.js_expression.message);break;case"conditional_required":n.push(e.conditional_required.message);break;case"conditional_answered":n.push(e.conditional_answered.message)}return n},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),HidersDisablersFactory=function(){function e(e,t,n){this.expressionRunner=e,this.expressionHelper=t,this._debugModeService=n}return e.prototype.getJsExpressionDisabler=function(e,t,n){var o=this.expressionRunner.getRunnable(e.disable,t,this.expressionHelper.helperFunctions,{},n),r={toDisable:!1,disableWhenExpression:e.disable,reEvaluateDisablingExpression:function(){var e=o.run();r.toDisable=e}};return r},e.prototype.getJsExpressionHider=function(e,t,n){var o=e.hide,r="object"==typeof o?this.convertHideObjectToString(o):e.hide,i=this._debugModeService.debugEnabled(),a=this.expressionRunner.getRunnable(r,t,this.expressionHelper.helperFunctions,{},n),s={toHide:!1,hideWhenExpression:r,reEvaluateHidingExpression:function(){s.toHide=!0!==i&&a.run()}};return s},e.prototype.convertHideObjectToString=function(e){return e.value instanceof Array?"!arrayContains(["+("'"+e.value.join("','")+"'")+"],"+e.field+")":""},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[{type:ExpressionRunner},{type:JsExpressionHelper},{type:DebugModeService}]},e}(),AlertsFactory=function(){function e(e,t){this.expressionRunner=e,this.expressionHelper=t}return e.prototype.getJsExpressionshowAlert=function(e,t,n){var o=this.expressionRunner.getRunnable(e.alert.alertWhenExpression,t,this.expressionHelper.helperFunctions,{},n),r={shown:!1,alertWhenExpression:e.alert.alertWhenExpression,alertMessage:e.alert.message,reEvaluateAlertExpression:function(){var e=o.run();r.shown=e}};return r},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[{type:ExpressionRunner},{type:JsExpressionHelper}]},e}(),FormControlService=function(){function e(e,t,n){this.alertsFactory=n,this.controls=[],this.validationFactory=e,this.hidersDisablersFactory=t}return e.prototype.generateControlModel=function(e,t,n,o){if(e instanceof QuestionBase){if(e.controlType===exports.AfeControlType.AfeFormArray)return this.generateFormArray(e,t,o);if(e.controlType===exports.AfeControlType.AfeFormGroup)return this.generateFormGroupModel(e,n,t,o);if(e.controlType===exports.AfeControlType.AfeFormControl)return this.generateFormControl(e,t,o)}return null},e.prototype.generateFormGroupModel=function(e,t,n,o){var r=new AfeFormGroup({});this.wireHidersDisablers(e,r,o),this.wireAlerts(e,r,o),n instanceof AfeFormGroup&&n.setControl(e.key,r);var i=e;return t&&i&&0<i.questions.length&&this._generateFormGroupChildrenModel(i.questions,r,o),r},e.prototype._generateFormGroupChildrenModel=function(e,n,o){var r=this;0<e.length&&e.forEach(function(e){var t=r.generateControlModel(e,n,!0,o);null!==t&&n.addControl(e.key,t)})},e.prototype.generateFormArray=function(e,t,n){var o,r=this.validationFactory.getValidators(e,n);return(o=r&&0<r.length?new AfeFormArray([],r[0]):new AfeFormArray([])).uuid=e.key,this.wireHidersDisablers(e,o,n),this.wireAlerts(e,o,n),t instanceof AfeFormGroup&&t.setControl(e.key,o),o},e.prototype.generateFormControl=function(e,t,n){var o=e.defaultValue||"",r=this.validationFactory.getValidators(e,n),i=new AfeFormControl(o,r);return i.uuid=e.key,this.wireHidersDisablers(e,i,n),this.wireAlerts(e,i,n),this.wireCalculator(e,i,n?n.dataSourcesContainer.dataSources:null),t instanceof AfeFormGroup&&t.setControl(e.key,i),i},e.prototype.wireAlerts=function(e,t,n){if(e.alert&&""!==e.alert){var o=this.alertsFactory.getJsExpressionshowAlert(e,t,n);t.setAlertFn(o)}},e.prototype.wireHidersDisablers=function(e,t,n){if(e.hide&&""!==e.hide){var o=this.hidersDisablersFactory.getJsExpressionHider(e,t,n);t.setHidingFn(o)}if(e.disable&&""!==e.disable){var r=this.hidersDisablersFactory.getJsExpressionDisabler(e,t,n);t.setDisablingFn(r)}},e.prototype.wireCalculator=function(e,t,n){if(e.calculateExpression&&""!==e.calculateExpression){var o=new JsExpressionHelper,r=(new ExpressionRunner).getRunnable(e.calculateExpression,t,o.helperFunctions,n);t.setCalculatorFn(r.run)}},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[{type:ValidationFactory},{type:HidersDisablersFactory},{type:AlertsFactory}]},e}(),DEFAULT_STYLES='a {\n color: white;\n text-decoration: none;\n font-size: 12px;\n text-transform: uppercase;\n }\n\n ul {\n list-style-type: none;\n margin: 2px auto;\n position: relative;\n }\n\n li {\n display: block;\n padding: 10px 20px;\n white-space: nowrap;\n transition: all 0.3s ease-in;\n border-bottom: 4px solid transparent;\n }\n\n li:hover {\n border-bottom: 4px solid white;\n opacity: 0.7;\n cursor: pointer;\n }\n\n .owl-theme .owl-controls .owl-nav {\n position: absolute;\n width: 100%;\n top: 0;\n }\n\n .owl-theme .owl-controls .owl-nav [class*="owl-"] {\n position: absolute;\n background: none;\n color: black;\n }\n\n .owl-theme .owl-controls .owl-nav [class*="owl-"]:hover {\n background: none;\n color: black;\n }\n\n .owl-theme .owl-controls .owl-nav .owl-next {\n right: 0;\n transform: translate(120%);\n }\n\n .owl-theme .owl-controls .owl-nav .owl-prev {\n left: 0;\n transform: translate(-120%);\n }\n\n .slick-initialized .swipe-tab-content {\n position: relative;\n min-height: 365px;\n }\n @media screen and (min-width: 767px) {\n .slick-initialized .swipe-tab-content {\n min-height: 500px;\n }\n .time-control{\n width:50%;\n }\n }\n .slick-initialized .swipe-tab {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 50px;\n background: none;\n border: 0;\n color: #757575;\n cursor: pointer;\n text-align: center;\n border-bottom: 2px solid rgba(51, 122, 183, 0);\n transition: all 0.5s;\n }\n .slick-initialized .swipe-tab:hover {\n color: #337AB7;\n }\n .slick-initialized .swipe-tab.active-tab {\n border-bottom-color: #337AB7;\n color: #337AB7;\n font-weight: bold;\n }\n\n .disabled {\n opacity: .5;\n pointer-events: none;\n }\n\n .select2-container {\n margin-top: -5px;\n }\n\n .btn {\n padding: 0px 12px !important;\n }\n\n .form-tooltip{\n color:rgb(51, 122, 183);\n display: inline-block;\n }\n .question-info{\n opacity:0;\n height:0px;\n display: none;\n transition-duration: opacity 1s ease-out;\n transtion-delay: 0.5s;\n padding-top: 2px;\n padding-bottom: 2px;\n color: #696969;\n border-style: ridge;\n border-width: 1px;\n border-color: #337ab7;\n margin-top: 2px;\n }\n .hide-info{\n display:none;\n height:0px;\n }\n .form-tooltip:hover ~ .question-info {\n display:block;\n opacity:1;\n height:auto;\n }\n .form-tooltip .tooltipcontent::after {\n content: " ";\n position: absolute;\n bottom: 100%; /* At the top of the tooltip */\n right: 0%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n border-top-color: transparent;\n border-right-color: transparent;\n border-bottom-color: #337ab7;\n border-left-color: transparent;\n }\n\n ng-select.form-control {\n padding-top: 0;\n height: auto;\n padding-bottom: 0;\n }\n\n .forms-dropdown-menu {\n max-height: 450px;\n overflow-y: scroll;\n }\n .no-border {\n border: 0;\n box-shadow: none;\n}\n.time-control{\n width:100%;\n}\n\n ',DataSources=function(){function e(){this._dataSources={}}return Object.defineProperty(e.prototype,"dataSources",{get:function(){return this._dataSources},enumerable:!0,configurable:!0}),e.prototype.registerDataSource=function(e,t,n){if(void 0===n&&(n=!1),n)for(var o in t)console.log("registering",o,t[o]),this.registerDataSource(o,t[o],!1);this.dataSources[e]&&console.warn("Overriding registered data source",e),this._dataSources[e]=t},e.prototype.clearDataSource=function(e){delete this._dataSources[e]},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),FormRendererComponent=function(){function e(e,t,n,o){this.validationFactory=e,this.dataSources=t,this.formErrorsService=n,this.document=o,this.childComponents=[],this.isCollapsed=!1,this.activeTab=0}return e.prototype.ngOnInit=function(){var t=this;if(this.setUpRemoteSelect(),this.setUpFileUpload(),this.setUpDatepickerHolidays(),this.node&&this.node.form){var e=this.node.form.valueProcessingInfo.lastFormTab;e&&e!==this.activeTab&&(this.activeTab=e)}this.node&&"form"===this.node.question.renderingType&&this.formErrorsService.announceErrorField$.subscribe(function(e){t.scrollToControl(e)}),this.node&&"section"===this.node.question.renderingType&&(this.isCollapsed=!this.node.question.isExpanded),this.parentComponent&&this.parentComponent.addChildComponent(this)},e.prototype.addChildComponent=function(e){this.childComponents.push(e)},e.prototype.setUpRemoteSelect=function(){this.node&&this.node.question.extras&&"remote-select"===this.node.question.renderingType&&(this.dataSource=this.dataSources.dataSources[this.node.question.dataSource],this.dataSource&&this.node.question.dataSourceOptions&&(this.dataSource.dataSourceOptions=this.node.question.dataSourceOptions))},e.prototype.setUpFileUpload=function(){this.node&&this.node.question.extras&&"file"===this.node.question.renderingType&&(this.dataSource=this.dataSources.dataSources[this.node.question.dataSource])},e.prototype.setUpDatepickerHolidays=function(){this.node&&this.node.question&&this.node.question.showHolidays&&(this.dataSource=this.dataSources.dataSources[this.node.question.dataSource])},e.prototype.checkSection=function(n){if("section"!==n.question.renderingType)return!0;var o=!1;return!Object.keys(n.children).every(function(e){var t=n.children[e];return t instanceof GroupNode&&(o=Object.keys(t.children).every(function(e){return t.children[e].control.hidden})),n.children[e].control.hidden||o})},e.prototype.clickTab=function(e){this.activeTab=e},e.prototype.loadPreviousTab=function(){this.isCurrentTabFirst()||(this.clickTab(this.activeTab-1),document.body.scrollTop=0)},e.prototype.isCurrentTabFirst=function(){return 0===this.activeTab},e.prototype.isCurrentTabLast=function(){return this.activeTab===this.node.question.questions.length-1},e.prototype.loadNextTab=function(){this.isCurrentTabLast()||(this.clickTab(this.activeTab+1),document.body.scrollTop=0)},e.prototype.tabSelected=function(e){this.activeTab=e,this.setPreviousTab()},e.prototype.setPreviousTab=function(){this.node&&this.node.form&&(this.node.form.valueProcessingInfo.lastFormTab=this.activeTab)},e.prototype.hasErrors=function(){return this.node.control.touched&&!this.node.control.valid},e.prototype.errors=function(){return this.getErrors(this.node)},e.prototype.scrollToControl=function(e){var t=this,n=+e.split(",")[0],o=e.split(",")[1]+"id",r=this.childComponents[n];this.clickTab(n),setTimeout(function(){r.childComponents.forEach(function(e){e.isCollapsed=!1,setTimeout(function(){var e=t.document.getElementById(o);null!==e&&e.focus&&(e.focus(),e.scrollIntoView({behavior:"smooth",block:"center"}))},100)})},200)},e.prototype.onDateChanged=function(e){this.node=e},e.prototype.upload=function(e){},e.prototype.toggleInformation=function(e){var t=document.getElementById(e);"block"===t.style.display?t.style.display="none":t.style.display="block",console.log("InfoId",e)},e.prototype.getErrors=function(e){var t=e.control.errors;return t?this.validationFactory.errors(t,e.question):[]},e.decorators=[{type:i0.Component,args:[{selector:"form-renderer",template:'\x3c!--CONTAINERS--\x3e\n<div *ngIf="node.question.renderingType === \'form\'">\n <div class="dropdown dropdown-tabs forms-dropdown">\n <a class="btn dropdown-toggle" data-toggle="dropdown">\n <i class="fa fa-angle-double-down"></i>\n </a>\n <ul\n class="dropdown-menu dropdown-menu-right forms-dropdown-menu"\n role="menu"\n aria-labelledby="dropdownMenu"\n >\n <li\n *ngFor="let question of node.question.questions; let i = index"\n (click)="clickTab(i)"\n >\n {{ question.label }}\n </li>\n </ul>\n </div>\n <mat-tab-group\n (selectedIndexChange)="tabSelected($event)"\n [selectedIndex]="activeTab"\n >\n <mat-tab\n [label]="question.label"\n *ngFor="let question of node.question.questions; let i = index"\n >\n <div (swipeLeft)="loadNextTab()" (swipeRight)="loadPreviousTab()">\n <form-renderer\n [node]="node.children[question.key]"\n [parentComponent]="this"\n [parentGroup]="node.control"\n ></form-renderer>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div style="text-align: center">\n <button\n type="button"\n class="btn btn-default"\n (click)="loadPreviousTab()"\n [ngClass]="{ disabled: isCurrentTabFirst() }"\n >\n <<\n </button>\n <button\n type="button"\n class="btn btn-default"\n (click)="loadNextTab()"\n [ngClass]="{ disabled: isCurrentTabLast() }"\n >\n >>\n </button>\n </div>\n</div>\n<div *ngIf="node.question.renderingType === \'page\'">\n \x3c!--<h2>{{node.question.label}}</h2>--\x3e\n <form-renderer\n *ngFor="let question of node.question.questions"\n [parentComponent]="this"\n [node]="node.children[question.key]"\n [parentGroup]="parentGroup"\n ></form-renderer>\n</div>\n<div *ngIf="node.question.renderingType === \'section\' && checkSection(node)">\n <div class="panel panel-primary">\n <div class="panel-heading">\n <button\n type="button"\n class="btn btn-primary pull-right"\n (click)="isCollapsed = !isCollapsed"\n >\n {{ isCollapsed ? \'Show\' : \'Hide\' }}\n </button>\n {{ node.question.label }}\n </div>\n <div class="panel-body" [collapse]="isCollapsed">\n <form-renderer\n *ngFor="let question of node.question.questions"\n [parentComponent]="this"\n [node]="node.children[question.key]"\n [parentGroup]="parentGroup"\n ></form-renderer>\n </div>\n </div>\n</div>\n\n\x3c!-- MESSAGES --\x3e\n<div\n *ngIf="node.control && node.control.alert && node.control.alert !== \'\'"\n class="alert alert-warning"\n>\n <a class="close" data-dismiss="alert">×</a> {{ node.control.alert }}\n</div>\n\n\x3c!--CONTROLS--\x3e\n\n<div\n *ngIf="node.question.controlType === 0"\n class="form-group"\n [formGroup]="parentGroup"\n [hidden]="node.control.hidden"\n [ngClass]="{ disabled: node.control.disabled }"\n>\n \x3c!--LEAF CONTROL--\x3e\n <div class="question-area">\n <a\n class="form-tooltip pull-right"\n (click)="toggleInformation(node.question.extras.id)"\n data-placement="right"\n *ngIf="\n node.question &&\n node.question.extras.questionInfo &&\n node.question.extras.questionInfo !== \'\' &&\n node.question.extras.questionInfo !== \' \'\n "\n >\n <i class="glyphicon glyphicon-question-sign" aria-hidden="true"></i>\n </a>\n\n <label\n *ngIf="node.question.label"\n [style.color]="hasErrors() ? \'red\' : \'\'"\n class="control-label"\n [attr.for]="node.question.key"\n >\n {{ node.question.required ? \'*\' : \'\' }} {{ node.question.label }}\n </label>\n <div [ngSwitch]="node.question.renderingType">\n <select\n class="form-control"\n *ngSwitchCase="\'select\'"\n [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"\n >\n <option *ngFor="let o of node.question.options" [ngValue]="o.value">\n {{ o.label }}\n </option>\n </select>\n\n <app-file-upload\n *ngSwitchCase="\'file\'"\n [dataSource]="dataSource"\n [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"\n (fileChanged)="upload($event)"\n >\n </app-file-upload>\n <textarea\n [placeholder]="node.question.placeholder"\n [rows]="node.question.rows"\n class="form-control"\n *ngSwitchCase="\'textarea\'"\n [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"\n >\n </textarea>\n \x3c!--\n <ng-select *ngSwitchCase="\'remote-select\'" [items]="items$ | async" bindLabel="label" bindValue="value" placeholder="{{node.question.placeholder}}"\n [hideSelected]="true" [loading]="itemsLoading" [typeahead]="itemsInput$" [formControlName]="node.question.key" [id]="node.question.key + \'id\'">\n </ng-select>\n --\x3e\n <remote-select\n *ngSwitchCase="\'remote-select\'"\n [placeholder]="node.question.placeholder"\n tabindex="0"\n [dataSource]="dataSource"\n [componentID]="node.question.key + \'id\'"\n [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"\n ></remote-select>\n \x3c!-- \n <date-time-picker *ngSwitchCase="\'date\'" [showTime]="node.question.showTime" tabindex="0" [weeks]=\'node.question.extras.questionOptions.weeksList\'\n (onDateChange)="onDateChanged(node)" [showWeeks]="node.question.showWeeksAdder" [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"></date-time-picker>\n --\x3e\n\n <ngx-date-time-picker\n *ngSwitchCase="\'date\'"\n [showTime]="node.question.showTime"\n [id]="node.question.key + \'id\'"\n [formControlName]="node.question.key"\n [weeks]="node.question.extras.questionOptions.weeksList"\n (onDateChange)="onDateChanged(node)"\n [showWeeks]="node.question.showWeeksAdder"\n [showHolidays]="node.question.showHolidays"\n [dataSource]="dataSource"\n ></ngx-date-time-picker>\n <ngx-time-picker \n *ngSwitchCase="\'time\'" \n id="node.question.key + \'id\'" \n [formControlName]="node.question.key"\n ></ngx-time-picker>\n <ng-select\n *ngSwitchCase="\'multi-select\'"\n [style.height]="\'auto\'"\n [style.overflow-x]="\'hidden\'"\n tabindex="0"\n [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"\n [options]="node.question.options"\n [multiple]="true"\n >\n </ng-select>\n <ng-select\n *ngSwitchCase="\'single-select\'"\n [style.height]="auto"\n tabindex="0"\n [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"\n [options]="node.question.options"\n [multiple]="false"\n >\n </ng-select>\n <input\n class="form-control"\n *ngSwitchCase="\'number\'"\n [formControlName]="node.question.key"\n [attr.placeholder]="node.question.placeholder"\n [type]="\'number\'"\n [id]="node.question.key + \'id\'"\n [step]="\'any\'"\n [min]="node.question.extras.questionOptions.min"\n [max]="node.question.extras.questionOptions.max"\n />\n <input\n class="form-control"\n *ngSwitchCase="\'decimal\'"\n [formControlName]="node.question.key"\n [attr.placeholder]="node.question.placeholder"\n [type]="\'text\'"\n [id]="node.question.key + \'id\'"\n [min]="node.question.extras.questionOptions.min"\n [max]="node.question.extras.questionOptions.max"\n />\n <input\n class="form-control"\n *ngSwitchDefault\n [formControlName]="node.question.key"\n [attr.placeholder]="node.question.placeholder"\n [type]="node.question.renderingType"\n [id]="node.question.key + \'id\'"\n />\n\n <div *ngSwitchCase="\'radio\'">\n <div *ngFor="let o of node.question.options">\n <label class="form-control no-border">\n <input\n type="radio"\n [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'"\n [value]="o.value"\n />\n {{ o.label }}\n </label>\n </div>\n </div>\n\n <div *ngSwitchCase="\'checkbox\'">\n <checkbox\n [id]="node.question.key + \'id\'"\n [formControlName]="node.question.key"\n [options]="node.question.options"\n [selected]="node.control.value"\n ></checkbox>\n </div>\n\n <div\n *ngIf="\n node.question.enableHistoricalValue && node.question.historicalDisplay\n "\n style="margin-top: 2px"\n >\n <div class="container-fluid">\n <div class="row">\n <div class="col-xs-9">\n <span class="text-warning">Previous Value: </span>\n <strong>{{ node.question.historicalDisplay?.text }}</strong>\n <span *ngIf="node.question.showHistoricalValueDate">\n <span> | </span>\n <strong class="text-primary"\n >{{ node.question.historicalDisplay?._date }}\n </strong>\n <span\n class="text-primary"\n *ngIf="\n node.question.historicalDisplay &&\n node.question.historicalDisplay._date\n "\n >\n ({{ node.question.historicalDisplay._date | timeAgo }})</span\n >\n </span>\n </div>\n <button\n type="button"\n [node]="node"\n [name]="\'historyValue\'"\n class="btn btn-primary btn-small col-xs-3"\n >\n Use Value\n </button>\n </div>\n </div>\n </div>\n <appointments-overview [node]="node"></appointments-overview>\n <div *ngIf="hasErrors()">\n <p *ngFor="let e of errors()">\n <span class="text-danger">{{ e }}</span>\n </p>\n </div>\n </div>\n\n <div\n class="question-info col-md-12 col-lg-12 col-sm-12"\n id="{{ node.question.extras.id }}"\n *ngIf="\n node.question &&\n node.question.extras.questionInfo &&\n node.question.extras.questionInfo !== \'\' &&\n node.question.extras.questionInfo !== \' \'\n "\n >\n {{ node.question.extras.questionInfo }}\n </div>\n </div>\n</div>\n<div\n *ngIf="node.question.controlType === 1"\n [hidden]="node.control.hidden"\n [ngClass]="{ disabled: node.control.disabled }"\n>\n \x3c!--ARRAY CONTROL--\x3e\n <div [ngSwitch]="node.question.renderingType">\n <div class="well" style="padding: 2px" *ngSwitchCase="\'repeating\'">\n <h4 style="margin: 2px; font-weight: bold">{{ node.question.label }}</h4>\n <hr\n style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 2px;\n "\n />\n <div [ngSwitch]="node.question.extras.type">\n <div *ngSwitchCase="\'testOrder\'">\n <div *ngFor="let child of node.children; let i = index">\n <form-renderer\n *ngFor="let question of child.question.questions"\n [parentComponent]="this"\n [node]="child.children[question.key]"\n [parentGroup]="child.control"\n ></form-renderer>\n <div>{{ child.orderNumber }}</div>\n <button\n type="button "\n class="btn btn-sm btn-danger"\n (click)="node.removeAt(i)"\n >\n Remove\n </button>\n <br />\n <hr\n style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 1px;\n "\n />\n </div>\n </div>\n\n <div *ngSwitchCase="\'obsGroup\'" style="margin-bottom: 20px">\n <div *ngFor="let child of node.children; let i = index">\n <form-renderer\n *ngFor="let question of child.question.questions"\n [parentComponent]="this"\n [node]="child.children[question.key]"\n [parentGroup]="child.control"\n ></form-renderer>\n <button\n type="button "\n class="btn btn-sm btn-danger"\n (click)="node.removeAt(i)"\n >\n Remove\n </button>\n <br />\n <hr\n style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 1px;\n "\n />\n </div>\n </div>\n </div>\n <button\n type="button "\n class="btn btn-primary"\n (click)="node.createChildNode()"\n >\n Add\n </button>\n </div>\n </div>\n</div>\n<div\n *ngIf="node.question.controlType === 2"\n [hidden]="node.control.hidden"\n [ngClass]="{ disabled: node.control.disabled }"\n>\n \x3c!--GROUP--\x3e\n <div [ngSwitch]="node.question.renderingType">\n <div *ngSwitchCase="\'group\'">\n <form-renderer\n *ngFor="let question of node.question.questions"\n [parentComponent]="this"\n [node]="node.children[question.key]"\n [parentGroup]="node.control"\n ></form-renderer>\n </div>\n <div\n *ngSwitchCase="\'field-set\'"\n style="border: 1px solid #eeeeee; padding: 2px; margin: 2px"\n >\n <form-renderer\n *ngFor="let question of node.question.questions"\n [parentComponent]="this"\n [node]="node.children[question.key]"\n [parentGroup]="node.control"\n ></form-renderer>\n </div>\n </div>\n</div>\n',styles:["../../style/app.css",DEFAULT_STYLES]}]}],e.ctorParameters=function(){return[{type:ValidationFactory},{type:DataSources},{type:FormErrorsService},{type:undefined,decorators:[{type:i0.Inject,args:[common.DOCUMENT]}]}]},e.propDecorators={parentComponent:[{type:i0.Input}],node:[{type:i0.Input}],parentGroup:[{type:i0.Input}]},e}(),ErrorRendererComponent=function(){function e(e,t){this.validationFactory=e,this.formErrorsService=t}return e.prototype.ngOnInit=function(){},e.prototype.showErrors=function(){return!this.form.valid&&this.form.showErrors},Object.defineProperty(e.prototype,"errorNodes",{get:function(){return this.form.markInvalidControls(this.form.rootNode,[])},enumerable:!0,configurable:!0}),e.prototype.getControlError=function(e){var t=e.control.errors;return t?this.validationFactory.errors(t,e.question):[]},e.prototype.announceErrorField=function(n){var o=this,e=this.form.searchNodeByQuestionId(n.path.substring(0,n.path.indexOf(".")));_.forEach(e,function(e){if("page"===e.question.renderingType){var t=o.getPageIndex(e);o.formErrorsService.announceErrorField(t+","+n.question.key)}})},e.prototype.getPageIndex=function(e){return this.form.rootNode.question.questions.indexOf(e.question)},e.decorators=[{type:i0.Component,args:[{selector:"error-renderer",template:'<div *ngIf="showErrors()" class="container">\n <ul class="list-group">\n <li\n class="list-group-item list-group-item-warning"\n *ngFor="let errorNode of errorNodes"\n (click)="announceErrorField(errorNode)"\n >\n <div class="error" *ngIf="errorNode.control.valid == false">\n <h4>{{ errorNode.question.label }}</h4>\n <span class="text-danger"> {{ getControlError(errorNode) }}</span>\n </div>\n </li>\n </ul>\n</div>\n',styles:["ul{list-style:none}.list-group-item{padding:2px 15px;cursor:pointer}ul li:hover{background-color:#fff}h4{margin-top:7px;margin-bottom:7px}"]}]}],e.ctorParameters=function(){return[{type:ValidationFactory},{type:FormErrorsService}]},e.propDecorators={form:[{type:i0.Input}]},e}(),HistoricalFieldHelperService=function(){function e(){}return e.prototype.getDisplayTextFromOptions=function(e,n,o){var r="",t=e.historicalDataValue;if(_.isArray(t.value)){var i=0;_.each(t.value,function(t){_.each(e.options,function(e){e[n]===t&&(0===i?r+=e[o]:r=r+", "+e[o],i++)})})}else _.each(e.options,function(e){e[n]===t.value&&(r=e[o])});return r},e}(),HistoricalValueDirective=function(){function e(e){this.historicalFieldHelper=e,this._nodeChange=new i0.EventEmitter}return e.prototype.setValue=function(e){"historyValue"===e.target.name&&(!this._node||this.compareString(this._node.question.renderingType,"page")&&this.compareString(this._node.question.renderingType,"section")||(this._node.control.setValue(this._node.question.historicalDataValue.value),this._node.question.historicalValue=this._node.question.historicalDataValue,e.stopPropagation(),this._nodeChange.emit(this._node)))},e.prototype.compareString=function(e,t){return e===t},Object.defineProperty(e.prototype,"node",{set:function(e){if(e&&(this._node=e,this._node.question.enableHistoricalValue&&!_.isUndefined(this._node.question.historicalDataValue))){var t={text:"",_date:""};"select"===this._node.question.renderingType||"multi-select"===this._node.question.renderingType||"single-select"===this._node.question.renderingType?(t.text=this.historicalFieldHelper.getDisplayTextFromOptions(this._node.question,"value","label"),t._date=this._node.question.historicalDataValue.valueDate,this._node.question.historicalDisplay=t):_.isUndefined(this._node.question.historicalDataValue)||(t.text=this._node.question.historicalDataValue.value,t._date=this._node.question.historicalDataValue.valueDate,this._node.question.historicalDisplay=t)}},enumerable:!0,configurable:!0}),e.decorators=[{type:i0.Directive,args:[{selector:"[node]"}]}],e.ctorParameters=function(){return[{type:HistoricalFieldHelperService}]},e.propDecorators={_node:[{type:i0.Input}],_nodeChange:[{type:i0.Output}],setValue:[{type:i0.HostListener,args:["click",["$event"]]}],node:[{type:i0.Input}]},e}(),STYLE="\nng-select {\n display: inline-block;\n margin: 0;\n position: relative;\n vertical-align: middle;\n width: 100%;\n}\nng-select * {\n box-sizing: border-box;\n font-family: Sans-Serif;\n}\nng-select > div {\n border: 1px solid #ddd;\n box-sizing: border-box;\n cursor: pointer;\n user-select: none;\n width: 100%;\n}\nng-select > div.disabled {\n background-color: #eee;\n color: #aaa;\n cursor: default;\n pointer-events: none;\n}\nng-select > div > div.single {\n display: flex;\n height: 30px;\n width: 100%;\n}\nng-select > div > div.single > div.value,\nng-select > div > div.single > div.placeholder {\n flex: 1;\n line-height: 30px;\n overflow: hidden;\n padding: 0 10px;\n white-space: nowrap;\n}\nng-select > div > div.single > div.placeholder {\n color: #a9a9a9;\n}\nng-select > div > div.single > div.clear,\nng-select > div > div.single > div.toggle {\n color: #aaa;\n line-height: 30px;\n text-align: center;\n width: 30px;\n}\nng-select > div > div.single > div.clear:hover,\nng-select > div > div.single > div.toggle:hover {\n background-color: #ececec;\n}\nng-select > div > div.single > div.clear {\n font-size: 18px;\n}\nng-select > div > div.single > div.toggle {\n font-size: 14px;\n}\nng-select > div > div.multiple {\n display: flex;\n flex-flow: row wrap;\n height: 100%;\n min-height: 30px;\n padding: 0 10px;\n width: 100%;\n}\nng-select > div > div.multiple > div.option {\n background-color: #eee;\n border: 1px solid #aaa;\n border-radius: 4px;\n color: #333;\n cursor: default;\n display: inline-block;\n flex-shrink: 0;\n font-size: 14px;\n line-height: 22px;\n margin: 3px 5px 3px 0;\n padding: 0 4px;\n}\nng-select > div > div.multiple > div.option span.deselect-option {\n color: #aaa;\n cursor: pointer;\n font-size: 14px;\n height: 20px;\n line-height: 20px;\n}\nng-select > div > div.multiple > div.option span.deselect-option:hover {\n color: #555;\n}\nng-select > div > div.multiple input {\n background-color: transparent;\n border: none;\n height: 30px;\n line-height: 30px;\n padding: 0;\n}\nng-select > div > div.multiple input:focus {\n outline: none;\n}\n",Option=function(){function e(e,t){this.value=e,this.label=t,this.disabled=!1,this.highlighted=!1,this.selected=!1,this.shown=!0}return e.prototype.show=function(){this.shown=!0},e.prototype.hide=function(){this.shown=!1},e.prototype.disable=function(){this.disabled=!0},e.prototype.enable=function(){this.disabled=!1},e.prototype.undecoratedCopy=function(){return{label:this.label,value:this.value}},e}(),Diacritics=function(){function e(){}return e.strip=function(e){var t=this;return e?e.replace(/[^\u0000-\u007E]/g,function(e){return t.DIACRITICS[e]||e}):""},e.DIACRITICS={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},e}(),OptionList=function(){function e(e){(this._highlightedOption=null)==e&&(e=[]),this._options=e.map(function(e){var t=new Option(e.value,e.label);return e.disabled&&t.disable(),t}),this.highlight()}return e.equalValues=function(e,t){if(e.length!==t.length)return!1;var n=e.slice().sort(),o=t.slice().sort();return n.every(function(e,t){return e===o[t]})},Object.defineProperty(e.prototype,"options",{get:function(){return this._options},enumerable:!0,configurable:!0}),e.prototype.getOptionsByValue=function(t){return this.options.filter(function(e){return e.value===t})},Object.defineProperty(e.prototype,"value",{get:function(){return this.selection.map(function(e){return e.value})},set:function(t){t=null==t?[]:t,this.options.forEach(function(e){e.selected=-1<t.indexOf(e.value)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){return this.options.filter(function(e){return e.selected})},enumerable:!0,configurable:!0}),e.prototype.select=function(e,t){t||this.clearSelection(),e.selected=!0},e.prototype.deselect=function(e){e.selected=!1},e.prototype.clearSelection=function(){this.options.forEach(function(e){e.selected=!1})},Object.defineProperty(e.prototype,"filtered",{get:function(){return this.options.filter(function(e){return e.shown})},enumerable:!0,configurable:!0}),e.prototype.filter=function(o){""===o.trim()?this.resetFilter():this.options.forEach(function(e){var t=Diacritics.strip(e.label).toUpperCase(),n=Diacritics.strip(o).toUpperCase();e.shown=-1<t.indexOf(n)}),this.highlight()},e.prototype.resetFilter=function(){this.options.forEach(function(e){e.shown=!0})},Object.defineProperty(e.prototype,"highlightedOption",{get:function(){return this._highlightedOption},enumerable:!0,configurable:!0}),e.prototype.highlight=function(){var e=this.hasShownSelected()?this.getFirstShownSelected():this.getFirstShown();this.highlightOption(e)},e.prototype.highlightOption=function(e){this.clearHighlightedOption(),null!==e&&(e.highlighted=!0,this._highlightedOption=e)},e.prototype.highlightNextOption=function(){var e=this.filtered,t=this.getHighlightedIndexFromList(e);-1<t&&t<e.length-1&&this.highlightOption(e[t+1])},e.prototype.highlightPreviousOption=function(){var e=this.filtered,t=this.getHighlightedIndexFromList(e);0<t&&this.highlightOption(e[t-1])},e.prototype.clearHighlightedOption=function(){null!==this.highlightedOption&&(this.highlightedOption.highlighted=!1,this._highlightedOption=null)},e.prototype.getHighlightedIndexFromList=function(e){for(var t=0;t<e.length;t++)if(e[t].highlighted)return t;return-1},e.prototype.getHighlightedIndex=function(){return this.getHighlightedIndexFromList(this.filtered)},e.prototype.hasShown=function(){return this.options.some(function(e){return e.shown})},e.prototype.hasSelected=function(){return this.options.some(function(e){return e.selected})},e.prototype.hasShownSelected=function(){return this.options.some(function(e){return e.shown&&e.selected})},e.prototype.getFirstShown=function(){try{for(var e=__values(this.options),t=e.next();!t.done;t=e.next()){var n=t.value;if(n.shown)return n}}catch(i){o={error:i}}finally{try{t&&!t.done&&(r=e["return"])&&r.call(e)}finally{if(o)throw o.error}}return null;var o,r},e.prototype.getFirstShownSelected=function(){try{for(var e=__values(this.options),t=e.next();!t.done;t=e.next()){var n=t.value;if(n.shown&&n.selected)return n}}catch(i){o={error:i}}finally{try{t&&!t.done&&(r=e["return"])&&r.call(e)}finally{if(o)throw o.error}}return null;var o,r},e}(),SELECT_VALUE_ACCESSOR={provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return SelectComponent}),multi:!0},SelectComponent=function(){function e(){this.KEYS={BACKSPACE:8,TAB:9,ENTER:13,ESC:27,SPACE:32,UP:38,DOWN:40},this.allowClear=!1,this.disabled=!1,this.highlightColor="#2196f3",this.highlightTextColor="#fff",this.multiple=!1,this.noFilter=0,this.notFoundMsg="No results found",this.placeholder="",this.opened=new i0.EventEmitter,this.closed=new i0.EventEmitter,this.selected=new i0.EventEmitter,this.deselected=new i0.EventEmitter,this.typed=new i0.EventEmitter,this._value=[],this.hasSelected=!1,this.filterEnabled=!0,this.filterInputWidth=1,this.hasFocus=!1,this.isBelow=!0,this.isDisabled=!1,this.isOpen=!1,this.placeholderView="",this.clearClicked=!1,this.selectContainerClicked=!1,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){this.placeholderView=this.placeholder},e.prototype.ngAfterViewInit=function(){this.updateFilterWidth()},e.prototype.ngOnChanges=function(e){if(e.hasOwnProperty("options")&&this.updateOptionsList(e.options.isFirstChange()),e.hasOwnProperty("noFilter")){var t=this.optionList.options.length,n=e.noFilter.currentValue;this.filterEnabled=n<=t}},e.prototype.onWindowClick=function(){this.selectContainerClicked||this.closeDropdown(),this.clearClicked=!1,this.selectContainerClicked=!1},e.prototype.onWindowResize=function(){this.updateWidth()},e.prototype.onSelectContainerClick=function(e){this.selectContainerClicked=!0,this.clearClicked||this.toggleDropdown()},e.prototype.onSelectContainerFocus=function(){this.onTouched()},e.prototype.onSelectContainerKeydown=function(e){this.handleSelectContainerKeydown(e)},e.prototype.onDropdownOptionClicked=function(e){this.multiple?this.toggleSelectOption(e):this.selectOption(e)},e.prototype.onDropdownClose=function(e){this.closeDropdown(e)},e.prototype.onSingleFilterClick=function(){this.selectContainerClicked=!0},e.prototype.onSingleFilterInput=function(e){var t=this;setTimeout(function(){2<e.length&&t.typed.emit(e)},500),this.optionList.filter(e)},e.prototype.onSingleFilterKeydown=function(e){this.handleSingleFilterKeydown(e)},e.prototype.onMultipleFilterInput=function(e){var t=this;this.isOpen||this.openDropdown(),this.updateFilterWidth(),setTimeout(function(){t.optionList.filter(e.target.value)})},e.prototype.onMultipleFilterKeydown=function(e){this.handleMultipleFilterKeydown(e)},e.prototype.onClearSelectionClick=function(e){this.clearClicked=!0,this.clearSelection(),this.closeDropdown(!0)},e.prototype.onDeselectOptionClick=function(e){this.clearClicked=!0,this.deselectOption(e)},e.prototype.open=function(){this.openDropdown()},e.prototype.close=function(){this.closeDropdown()},e.prototype.clear=function(){this.clearSelection()},e.prototype.select=function(e){var t=this;this.optionList.getOptionsByValue(e).forEach(function(e){t.selectOption(e)}),this.valueChanged()},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e},Object.defineProperty(e.prototype,"value",{get:function(){return 0===this._value.length?"":this.multiple?this._value:this._value[0]},set:function(e){if(null==e||""===e)e=[];else if("string"==typeof e)e=[e];else if(!Array.isArray(e))throw new TypeError("Value must be a string or an array.");OptionList.equalValues(e,this._value)||(this.optionList.value=e,this.valueChanged())},enumerable:!0,configurable:!0}),e.prototype.valueChanged=function(){this._value=this.optionList.value,this.hasSelected=0<this._value.length,this.placeholderView=this.hasSelected?"":this.placeholder,this.updateFilterWidth(),this.onChange(this.value)},e.prototype.updateOptionsList=function(e){var t;e||(t=this.optionList.value),this.optionList=new OptionList(this.options),e||(this.optionList.value=t,this.valueChanged())},e.prototype.toggleDropdown=function(){this.isDisabled||(this.isOpen?this.closeDropdown(!0):this.openDropdown())},e.prototype.openDropdown=function(){this.isOpen||(this.updateWidth(),this.updatePosition(),this.isOpen=!0,this.multiple&&this.filterEnabled&&this.filterInput.nativeElement.focus(),this.opened.emit(null))},e.prototype.closeDropdown=function(e){void 0===e&&(e=!1),this.isOpen&&(this.clearFilterInput(),this.isOpen=!1,e&&this.focus(),this.closed.emit(null))},e.prototype.selectOption=function(e){e.selected||(this.optionList.select(e,this.multiple),this.valueChanged(),this.selected.emit(e.undecoratedCopy()))},e.prototype.deselectOption=function(e){var t=this;e.selected&&(this.optionList.deselect(e),this.valueChanged(),this.deselected.emit(e.undecoratedCopy()),setTimeout(function(){t.multiple&&(t.updatePosition(),t.optionList.highlight(),t.isOpen&&t.dropdown.moveHighlightedIntoView())}))},e.prototype.clearSelection=function(){var e=this.optionList.selection;0<e.length&&(this.optionList.clearSelection(),this.valueChanged(),1===e.length?this.deselected.emit(e[0].undecoratedCopy()):this.deselected.emit(e.map(function(e){return e.undecoratedCopy()})))},e.prototype.toggleSelectOption=function(e){e.selected?this.deselectOption(e):this.selectOption(e)},e.prototype.selectHighlightedOption=function(){var e=this.optionList.highlightedOption;null!==e&&(this.selectOption(e),this.closeDropdown(!0))},e.prototype.deselectLast=function(){var e=this.optionList.selection;if(0<e.length){var t=e[e.length-1];this.deselectOption(t),this.setMultipleFilterInput(t.label+" ")}},e.prototype.clearFilterInput=function(){this.multiple&&this.filterEnabled?this.filterInput.nativeElement.value="":this.dropdown.clearFilterInput()},e.prototype.setMultipleFilterInput=function(e){this.filterEnabled&&(this.filterInput.nativeElement.value=e)},e.prototype.handleSelectContainerKeydown=function(e){var t=this,n=e.which;this.isOpen?n===this.KEYS.ESC||n===this.KEYS.UP&&e.altKey?this.closeDropdown(!0):n===this.KEYS.TAB?this.closeDropdown():n===this.KEYS.ENTER?this.selectHighlightedOption():n===this.KEYS.UP?(this.optionList.highlightPreviousOption(),this.dropdown.moveHighlightedIntoView(),this.filterEnabled||e.preventDefault()):n===this.KEYS.DOWN&&(this.optionList.highlightNextOption(),this.dropdown.moveHighlightedIntoView(),this.filterEnabled||e.preventDefault()):(n===this.KEYS.ENTER||n===this.KEYS.SPACE||n===this.KEYS.DOWN&&e.altKey)&&setTimeout(function(){t.openDropdown()})},e.prototype.handleMultipleFilterKeydown=function(e){e.which===this.KEYS.BACKSPACE&&this.hasSelected&&this.filterEnabled&&""===this.filterInput.nativeElement.value&&this.deselectLast()},e.prototype.handleSingleFilterKeydown=function(e){var t=e.which;t!==this.KEYS.ESC&&t!==this.KEYS.TAB&&t!==this.KEYS.UP&&t!==this.KEYS.DOWN&&t!==this.KEYS.ENTER||this.handleSelectContainerKeydown(e)},e.prototype.focus=function(){this.hasFocus=!0,this.multiple&&this.filterEnabled?this.filterInput.nativeElement.focus():this.selectionSpan.nativeElement.focus()},e.prototype.blur=function(){this.hasFocus=!1,this.selectionSpan.nativeElement.blur()},e.prototype.updateWidth=function(){this.width=this.selectionSpan.nativeElement.offsetWidth},e.prototype.updatePosition=function(){var e=this.selectionSpan.nativeElement;this.left=e.offsetLeft,this.top=e.offsetTop+e.offsetHeight},e.prototype.updateFilterWidth=function(){if("undefined"!=typeof this.filterInput){var e=this.filterInput.nativeElement.value;this.filterInputWidth=0===e.length?1+10*this.placeholderView.length:1+10*e.length}},e.decorators=[{type:i0.Component,args:[{selector:"ng-select",template:'<div\n #selection\n [attr.tabindex]="disabled ? null : 0"\n [ngClass]="{\n open: isOpen,\n focus: hasFocus,\n below: isBelow,\n disabled: disabled\n }"\n (click)="onSelectContainerClick($event)"\n (focus)="onSelectContainerFocus()"\n (keydown)="onSelectContainerKeydown($event)"\n (window:click)="onWindowClick()"\n (window:resize)="onWindowResize()"\n>\n <div class="single" *ngIf="!multiple">\n <div class="value" *ngIf="optionList.hasSelected()">\n {{ optionList.selection[0].label }}\n </div>\n <div class="placeholder" *ngIf="!optionList.hasSelected()">\n {{ placeholderView }}\n </div>\n <div\n class="clear"\n *ngIf="allowClear"\n (click)="onClearSelectionClick($event)"\n >\n ✕\n </div>\n <div class="toggle" *ngIf="isOpen">▲</div>\n <div class="toggle" *ngIf="!isOpen">▼</div>\n </div>\n\n <div class="multiple" *ngIf="multiple">\n <div class="option" *ngFor="let option of optionList.selection">\n <span class="deselect-option" (click)="onDeselectOptionClick(option)">\n ✕\n </span>\n {{ option.label }}\n </div>\n <input\n *ngIf="filterEnabled"\n #filterInput\n tabindex="-1"\n [placeholder]="placeholderView"\n [ngStyle]="{ \'width.px\': filterInputWidth }"\n (input)="onMultipleFilterInput($event)"\n (keydown)="onMultipleFilterKeydown($event)"\n />\n </div>\n</div>\n<select-dropdown\n *ngIf="isOpen"\n #dropdown\n [multiple]="multiple"\n [optionList]="optionList"\n [notFoundMsg]="notFoundMsg"\n [highlightColor]="highlightColor"\n [highlightTextColor]="highlightTextColor"\n [filterEnabled]="filterEnabled"\n [width]="width"\n [top]="top"\n [left]="left"\n (close)="onDropdownClose($event)"\n (optionClicked)="onDropdownOptionClicked($event)"\n (singleFilterClick)="onSingleFilterClick()"\n (singleFilterInput)="onSingleFilterInput($event)"\n (singleFilterKeydown)="onSingleFilterKeydown($event)"\n>\n</select-dropdown>\n',styles:[STYLE],providers:[SELECT_VALUE_ACCESSOR],encapsulation:i0.ViewEncapsulation.None}]}],e.propDecorators={options:[{type:i0.Input}],allowClear:[{type:i0.Input}],disabled:[{type:i0.Input}],highlightColor:[{type:i0.Input}],highlightTextColor:[{type:i0.Input}],multiple:[{type:i0.Input}],noFilter:[{type:i0.Input}],notFoundMsg:[{type:i0.Input}],placeholder:[{type:i0.Input}],opened:[{type:i0.Output}],closed:[{type:i0.Output}],selected:[{type:i0.Output}],deselected:[{type:i0.Output}],typed:[{type:i0.Output}],selectionSpan:[{type:i0.ViewChild,args:["selection"]}],dropdown:[{type:i0.ViewChild,args:["dropdown"]}],filterInput:[{type:i0.ViewChild,args:["filterInput"]}]},e}(),STYLE$1="select-dropdown {\n box-sizing: border-box;\n font-family: Sans-Serif;\n}\nselect-dropdown * {\n box-sizing: border-box;\n font-family: Sans-Serif;\n}\nselect-dropdown > div {\n background-color: #fff;\n border: 1px solid #ccc;\n border-top: none;\n box-sizing: border-box;\n position: absolute;\n z-index: 1;\n}\nselect-dropdown > div .filter {\n padding: 3px;\n width: 100%;\n}\nselect-dropdown > div .filter input {\n border: 1px solid #eee;\n box-sizing: border-box;\n padding: 4px;\n width: 100%;\n}\nselect-dropdown > div .options {\n max-height: 200px;\n overflow-y: auto;\n}\nselect-dropdown > div .options ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\nselect-dropdown > div .options ul li {\n padding: 4px 8px;\n cursor: pointer;\n user-select: none;\n}\nselect-dropdown .selected {\n background-color: #e0e0e0;\n}\nselect-dropdown .selected.highlighted {\n background-color: #2196F3;\n color: #fff;\n}\nselect-dropdown .highlighted {\n background-color: #2196F3;\n color: #fff;\n}\nselect-dropdown .disabled {\n background-color: #fff;\n color: #9e9e9e;\n cursor: default;\n pointer-events: none;\n}",SelectDropdownComponent=function(){function e(){this.close=new i0.EventEmitter,this.optionClicked=new i0.EventEmitter,this.singleFilterClick=new i0.EventEmitter,this.singleFilterInput=new i0.EventEmitter,this.singleFilterKeydown=new i0.EventEmitter,this.disabledColor="#fff",this.disabledTextColor="9e9e9e"}return e.prototype.ngOnInit=function(){this.optionsReset()},e.prototype.ngOnChanges=function(e){e.hasOwnProperty("optionList")&&this.optionsReset()},e.prototype.ngAfterViewInit=function(){this.moveHighlightedIntoView(),!this.multiple&&this.filterEnabled&&this.filterInput.nativeElement.focus()},e.prototype.onSingleFilterClick=function(e){this.singleFilterClick.emit(null)},e.prototype.onSingleFilterInput=function(e){this.singleFilterInput.emit(e.target.value)},e.prototype.onSingleFilterKeydown=function(e){this.singleFilterKeydown.emit(e)},e.prototype.onOptionsWheel=function(e){this.handleOptionsWheel(e)},e.prototype.onOptionMouseover=function(e){this.optionList.highlightOption(e)},e.prototype.onOptionClick=function(e){this.optionClicked.emit(e)},e.prototype.optionsReset=function(){this.optionList.resetFilter(),this.optionList.highlight()},e.prototype.getOptionStyle=function(e){return e.highlighted?{"background-color":this.highlightColor,color:this.highlightTextColor}:{}},e.prototype.clearFilterInput=function(){this.filterEnabled&&(this.filterInput.nativeElement.value="")},e.prototype.moveHighlightedIntoView=function(){var e=this.optionsList.nativeElement,t=e.offsetHeight,n=this.optionList.getHighlightedIndex();if(-1<n){var o=e.children[0].children[n].offsetHeight,r=n*o,i=r+o,a=e.scrollTop;a+t<i?e.scrollTop=i-t:r<a&&(e.scrollTop=r)}},e.prototype.handleOptionsWheel=function(e){var t=this.optionsList.nativeElement,n=0===t.scrollTop,o=t.offsetHeight+t.scrollTop===t.scrollHeight;n&&e.deltaY<0?e.preventDefault():o&&0<e.deltaY&&e.preventDefault()},e.decorators=[{type:i0.Component,args:[{selector:"select-dropdown",template:'<div [ngStyle]="{ \'top.px\': top, \'left.px\': left, \'width.px\': width }">\n <div class="filter" *ngIf="!multiple">\n <input\n *ngIf="filterEnabled"\n #filterInput\n (click)="onSingleFilterClick($event)"\n (input)="onSingleFilterInput($event)"\n (keydown)="onSingleFilterKeydown($event)"\n />\n </div>\n\n <div class="options" #optionsList>\n <ul (wheel)="onOptionsWheel($event)">\n <li\n *ngFor="let option of optionList.filtered"\n [ngClass]="{\n highlighted: option.highlighted,\n selected: option.selected,\n disabled: option.disabled\n }"\n [ngStyle]="getOptionStyle(option)"\n (click)="onOptionClick(option)"\n (mouseover)="onOptionMouseover(option)"\n >\n {{ option.label }}\n </li>\n <li *ngIf="!optionList.hasShown()" class="message">\n {{ notFoundMsg }}\n </li>\n </ul>\n </div>\n</div>\n',styles:[STYLE$1],encapsulation:i0.ViewEncapsulation.None}]}],e.propDecorators={filterEnabled:[{type:i0.Input}],highlightColor:[{type:i0.Input}],highlightTextColor:[{type:i0.Input}],left:[{type:i0.Input}],multiple:[{type:i0.Input}],notFoundMsg:[{type:i0.Input}],optionList:[{type:i0.Input}],top:[{type:i0.Input}],width:[{type:i0.Input}],close:[{type:i0.Output}],optionClicked:[{type:i0.Output}],singleFilterClick:[{type:i0.Output}],singleFilterInput:[{type:i0.Output}],singleFilterKeydown:[{type:i0.Output}],filterInput:[{type:i0.ViewChild,args:["filterInput"]}],optionsList:[{type:i0.ViewChild,args:["optionsList"]}]},e}(),SelectModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{declarations:[SelectComponent,SelectDropdownComponent],exports:[SelectComponent],imports:[common.CommonModule,forms.FormsModule]}]}],e}(),SecurePipe=function(){function e(e,t){this._ref=e,this.sanitizer=t,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._result=new rxjs.BehaviorSubject(null),this.result=this._result.asObservable(),this._internalSubscription=null}return e.prototype.ngOnDestroy=function(){this._subscription&&this._dispose()},e.prototype.transform=function(e,t){this.getfile=t;var n=this.internalTransform(e);return this.asyncTrasnform(n)},e.prototype.internalTransform=function(e){var n=this;return e&&this.previousUrl!==e&&(this.previousUrl=e,this._internalSubscription=this.getfile(e).subscribe(function(e){var t=n.sanitizer.bypassSecurityTrustUrl(e);n._result.next(t)})),this.result},e.prototype.asyncTrasnform=function(e){return this._obj?e!==this._obj?(this._dispose(),this.asyncTrasnform(e)):this._latestValue===this._latestReturnedValue?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,i0.WrappedValue.wrap(this._latestValue)):(e&&this._subscribe(e),this._latestReturnedValue=this._latestValue,this._latestValue)},e.prototype._subscribe=function(t){var n=this;this._obj=t,this._subscription=t.subscribe({next:function(e){return n._updateLatestValue(t,e)},error:function(e){throw e}})},e.prototype._dispose=function(){this._subscription&&this._subscription.unsubscribe(),this._internalSubscription&&this._internalSubscription.unsubscribe(),this._internalSubscription=null,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null},e.prototype._updateLatestValue=function(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())},e.decorators=[{type:i0.Pipe,args:[{name:"secure",pure:!1}]}],e.ctorParameters=function(){return[{type:i0.ChangeDetectorRef},{type:platformBrowser.DomSanitizer}]},e}(),SharedModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{declarations:[SecurePipe],imports:[common.CommonModule],exports:[SecurePipe],providers:[DataSources]}]}],e}(),FileUploadComponent=function(){function e(e){this.renderer=e,this.uploading=!1,this.fileUuid=null,this.pdfUploaded=!1,this.formEntryMode=!0,this.propagateChange=function(e){}}return Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.fileUuid&&this.checkFileType()},e.prototype.onFileChange=function(e){try{for(var t=__values(e),n=t.next();!n.done;n=t.next()){var o=n.value;this.upload(o)}}catch(a){r={error:a}}finally{try{n&&!n.done&&(i=t["return"])&&i.call(t)}finally{if(r)throw r.error}}var r,i},e.prototype.upload=function(e){var t=this;this.dataSource&&(this.uploading=!0,this.dataSource.fileUpload(e).subscribe(function(e){t.fileUuid=e.image,t.checkFileType(),t.propagateChange(t.fileUuid),t.uploading=!1},function(e){t.uploading=!1}))},e.prototype.writeValue=function(e){e!==this.fileUuid&&(this.fileUuid=e,this.checkFileType())},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(){},e.prototype.onChange=function(e){this.propagateChange(e.id)},e.prototype.clearValue=function(){this.fileUuid=null,this.pdfUploaded=!1,this.pdfUrl=null,this.propagateChange(this.fileUuid)},e.prototype.getPdfUrl=function(e){var t=this;this.dataSource.fetchFile(e,"pdf").subscribe(function(e){t.pdfUploaded=!0,t.pdfUrl=e.changingThisBreaksApplicationSecurity})},e.prototype.checkFileType=function(){-1!==this.fileUuid.search(/pdf/gi)&&this.getPdfUrl(this.fileUuid)},e.decorators=[{type:i0.Component,args:[{selector:"app-file-upload",template:'<lib-file-uploader\n [srcUrl]="pdfUrl"\n [formEntry]="formEntryMode"\n [(ngModel)]="fileUuid"\n (_onClear)="clearValue()"\n (uploadData)="onFileChange($event)"\n>\n</lib-file-uploader>\n<div *ngIf="fileUuid">\n <img\n *ngIf="!pdfUploaded"\n class="img-responsive"\n [src]="fileUuid | secure: this.dataSource.fetchFile"\n alt=""\n />\n</div>\n',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return e}),multi:!0}],styles:["\n img {\n margin-left: auto;\n margin-right: auto;\n display: block;\n }\n "]}]}],e.ctorParameters=function(){return[{type:i0.Renderer2}]},e.propDecorators={dataSource:[{type:i0.Input}]},e}(),RemoteFileUploadModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{imports:[common.CommonModule,SelectModule,forms.FormsModule,SharedModule,ngxWebcam.WebcamModule,ngxFileUploader.NgxFileUploaderModule],exports:[FileUploadComponent],declarations:[FileUploadComponent],providers:[]}]}],e}(),moment$1=moment_,DatePickerComponent=function(){function e(){this.locale="en",this.viewFormat="ll",this.returnObject="js",this.onDatePickerCancel=new i0.EventEmitter,this.onSelectDate=new i0.EventEmitter,this.onDisplayMonths=!1,this.onDisplayYears=!1,this.displayYearsIndex=0,this.monthsShort=moment$1.monthsShort()}return e.prototype.ngOnInit=function(){var n=this;this.initValue(),_.each(this.fullYearRange,function(e,t){n.currentYear=n.calendarDate.clone().startOf("year").year(),-1!==e.indexOf(n.currentYear)&&(n.displayYearsIndex=t)}),this.displayYearRange=this.fullYearRange[this.displayYearsIndex],this.generateCalendar()},e.prototype.prev=function(){this.onDisplayYears?(this.displayYearsIndex--,this.displayYearsIndex<0&&(this.displayYearsIndex=0),this.displayYearRange=this.fullYearRange[this.displayYearsIndex]):this.calendarDate=this.calendarDate.clone().subtract(1,"M"),this.generateCalendar()},e.prototype.showMonthSelection=function(){this.onDisplayMonths=!0,this.onDisplayYears=!1},e.prototype.showYearSelection=function(){this.onDisplayYears=!0,this.onDisplayMonths=!1},e.prototype.next=function(){this.onDisplayYears?(this.displayYearsIndex++,this.displayYearsIndex>=this.fullYearRange.length&&(this.displayYearsIndex=this.fullYearRange.length-1),this.displayYearRange=this.fullYearRange[this.displayYearsIndex++]):this.calendarDate=this.calendarDate.clone().add(1,"M"),this.generateCalendar()},e.prototype.selectDay=function(e){var t=e.diff(this.calendarDate.clone().startOf("date"),"days");e=this.calendarDate.clone().add(t,"d");var n=this.parseToReturnObjectType(e);this.onSelectDate.emit(n),this.cancelDatePicker()},e.prototype.selectMonth=function(e){this.calendarDate=this.calendarDate.clone().month(e),this.onDisplayMonths=!1,this.generateCalendar()},e.prototype.selectYear=function(e){this.calendarDate=this.calendarDate.clone().year(e),this.onDisplayYears=!1,this.generateCalendar()},e.prototype.selectToday=function(){var e=this.parseToReturnObjectType(moment$1());this.onSelectDate.emit(e),this.cancelDatePicker()},e.prototype.clearPickDate=function(){this.onSelectDate.emit(null),this.cancelDatePicker()},e.prototype.cancelDatePicker=function(){this.onDatePickerCancel.emit(!1)},e.prototype.generateYears=function(){for(var e=moment$1().year(),t=[],n=this.calendarDate.clone().subtract(100,"y").year();n<=e;n++)t.push(n);this.fullYearRange=_.chunk(t,14)},e.prototype.initValue=function(){moment$1.locale(this.locale),this.today=moment$1().startOf("date"),this.currentMonth=this.monthsShort[moment$1().month()],this.currentYear=moment$1().year(),this.dayNames=moment$1.weekdaysShort(!0),this.initDate?(this.calendarDate="string"===this.returnObject?moment$1(this.initDate,this.viewFormat):moment$1(this.initDate),this.selectedDate=this.calendarDate.clone().startOf("date")):this.calendarDate=moment$1(),this.generateYears()},e.prototype.generateCalendar=function(){this.calendarDays=[];for(var e=0-(this.calendarDate.clone().startOf("month").day()+(7-moment$1.localeData().firstDayOfWeek()))%7,t=41+e,n=e;n<=t;n+=1){var o=this.calendarDate.clone().startOf("month").add(n,"days");this.calendarDays.push(o)}},e.prototype.parseToReturnObjectType=function(e){switch(this.returnObject){case"js":return e.toDate();case"string":return e.format(this.viewFormat);case"moment":return e;case"json":return e.toJSON();case"array":return e.toArray();case"iso":return e.toISOString();case"object":return e.toObject();default:return e}},e.decorators=[{type:i0.Component,args:[{selector:"date-picker",template:'<picker-modal (onOverlayClick)="cancelDatePicker()">\n <div class="picker-wrap">\n <div class="picker-box">\n <div class="picker-header">\n <div class="picker-header-nav">\n <span class="nav-prev" (click)="prev()"></span>\n </div>\n <div class="picker-header-content">\n <div class="content">\n <span (click)="showMonthSelection()" class="month">{{\n calendarDate | moment: \'MMMM\'\n }}</span>\n <span class="seperator">|</span>\n <span (click)="showYearSelection()" class="year">{{\n calendarDate | moment: \'YYYY\'\n }}</span>\n </div>\n </div>\n <div class="picker-header-nav">\n <span class="nav-next" (click)="next()"></span>\n </div>\n </div>\n <div class="picker-calendar">\n <div\n class="picker-calendar-row"\n *ngIf="!onDisplayMonths && !onDisplayYears"\n >\n <span class="picker-weekday" *ngFor="let day of dayNames">{{\n day\n }}</span>\n </div>\n <div\n class="picker-calendar-row"\n *ngIf="!onDisplayMonths && !onDisplayYears"\n >\n <span\n class="picker-day"\n (click)="selectDay(day)"\n [ngClass]="{\n \'out-focus\': day.month() != calendarDate.month(),\n today: day.isSame(today),\n selected: day.isSame(selectedDate)\n }"\n *ngFor="let day of calendarDays"\n >\n {{ day | moment: \'D\' }}\n </span>\n </div>\n <div class="picker-calendar-row" *ngIf="onDisplayMonths">\n <span\n class="picker-month"\n *ngFor="let month of monthsShort"\n (click)="selectMonth(month)"\n [ngClass]="{\n selected: month === currentMonth\n }"\n >\n {{ month }}\n </span>\n </div>\n <div class="picker-calendar-row" *ngIf="onDisplayYears">\n <span\n class="picker-year"\n *ngFor="let year of displayYearRange"\n (click)="selectYear(year)"\n [ngClass]="{\n selected: year === currentYear\n }"\n >\n {{ year }}\n </span>\n </div>\n </div>\n <div class="picker-footer">\n <div class="picker-action action-today" (click)="selectToday()">\n <span class="text">Today</span>\n </div>\n <div class="picker-action action-clear" (click)="clearPickDate()">\n <span class="text">Clear</span>\n </div>\n <div class="picker-action action-close" (click)="cancelDatePicker()">\n <span class="text">Close</span>\n </div>\n </div>\n </div>\n </div>\n</picker-modal>\n',styles:["*,::after,::before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:666px}.picker-box{font-family:'Open Sans';min-width:400px!important;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;display:flex;height:2.5rem;width:100%}.picker-header-nav{position:relative;cursor:pointer;width:calc(100% / 8)}.picker-header-nav>*{position:absolute;top:50%;right:auto;bottom:auto;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.picker-header-nav .nav-next::before,.picker-header-nav .nav-prev::before{content:' ';border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker-header-nav .nav-next::before{border-right:0;border-left:.75em solid #000}.picker-header-content{width:calc(100% * 6 / 8);text-align:center}.picker-header-content .month{font-size:1.778rem;line-height:2.5rem;margin-right:.5rem;font-weight:700}.picker-header-content .year{font-style:italic;color:#999}.picker-calendar{width:100%}.picker-calendar .picker-calendar-row{display:flex;flex-wrap:wrap;width:100%;margin-bottom:.625rem}.picker-calendar .picker-weekday{font-weight:700;text-align:left;color:#999;width:calc(100% / 7)}.picker-calendar .picker-day,.picker-calendar .picker-month,.picker-calendar .picker-year{font-size:1.333rem;line-height:2.5rem;position:relative;height:2.5rem;text-align:center;cursor:pointer;width:calc(100% / 7)}.picker-calendar .picker-day:hover,.picker-calendar .picker-month:hover,.picker-calendar .picker-year:hover{background:#b1dcfb}.picker-calendar .out-focus{color:#ddd}.picker-calendar .out-focus:hover{color:#000}.picker-calendar .selected{background:#0089ec;color:#fff}.picker-calendar .selected:hover{background:#0089ec}.picker-calendar .today::before{content:' ';position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker-footer{cursor:pointer}.picker-footer .picker-action{text-align:center;width:calc(100% / 3)}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear::before,.picker-footer .action-close::before,.picker-footer .action-today::before{content:' ';position:relative;display:inline-block;height:0;width:0}.picker-footer .action-today::before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-clear::before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close::before{width:1rem;height:1rem;background:linear-gradient(to bottom,transparent 35%,#777 35%,#777 65%,transparent 65%),linear-gradient(to right,transparent 35%,#777 35%,#777 65%,transparent 65%);-webkit-transform:rotate(45deg);transform:rotate(45deg)}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={initDate:[{type:i0.Input}],locale:[{type:i0.Input}],viewFormat:[{type:i0.Input}],returnObject:[{type:i0.Input}],onDatePickerCancel:[{type:i0.Output}],onSelectDate:[{type:i0.Output}]},e}(),moment$2=moment_,TimePickerComponent=function(){function e(){this.showSecond=!0,this.viewFormat="hh:mm A",this.use12Hour=!1,this.returnObject="js",this.onSelectTime=new i0.EventEmitter,this.onTimePickerCancel=new i0.EventEmitter,this.hourFormat="HH"}return e.prototype.ngOnInit=function(){this.use12Hour&&(this.hourFormat="hh"),this.time=this.initTime?moment$2(this.initTime,this.viewFormat):moment$2(),this.initTime?this.time="string"===this.returnObject?moment$2(this.initTime,this.viewFormat):moment$2(this.initTime):this.time=moment$2()},e.prototype.increaseHour=function(){this.time=this.time.clone().add(1,"h")},e.prototype.decreaseHour=function(){this.time=this.time.clone().subtract(1,"h")},e.prototype.increaseMinute=function(){this.time=this.time.clone().add(1,"m")},e.prototype.decreaseMinute=function(){this.time=this.time.clone().subtract(1,"m")},e.prototype.increaseSecond=function(){this.time=this.time.clone().add(1,"s")},e.prototype.decreaseSecond=function(){this.time=this.time.clone().subtract(1,"s")},e.prototype.selectTime=function(){var e=this.parseToReturnObjectType(this.time);this.onSelectTime.emit(e),this.cancelTimePicker()},e.prototype.selectNow=function(){var e=this.parseToReturnObjectType(moment$2());this.onSelectTime.emit(e),this.cancelTimePicker()},e.prototype.clearTime=function(){this.onSelectTime.emit(null),this.cancelTimePicker()},e.prototype.cancelTimePicker=function(){this.onTimePickerCancel.emit(!1)},e.prototype.parseToReturnObjectType=function(e){switch(this.returnObject){case"js":return e.toDate();case"string":return e.format(this.viewFormat);case"moment":return e;case"json":return e.toJSON();case"array":return e.toArray();case"iso":return e.toISOString();case"object":return e.toObject();default:return e}},e.decorators=[{type:i0.Component,args:[{selector:"time-picker",template:'<picker-modal (onOverlayClick)="cancelTimePicker()">\n <div class="picker-wrap">\n <div class="picker-box">\n <div class="picker-header">Time Picker</div>\n <div class="picker-table">\n <ul class="picker-table-time">\n <li class="picker-table-number hour">\n <span class="arrow up" (click)="increaseHour()"></span>\n {{ time | moment: hourFormat }}\n <span class="arrow down" (click)="decreaseHour()"></span>\n </li>\n <li class="picker-table-separator">:</li>\n <li class="picker-table-number minute">\n <span class="arrow up" (click)="increaseMinute()"></span>\n {{ time | moment: \'mm\' }}\n <span class="arrow down" (click)="decreaseMinute()"></span>\n </li>\n <li *ngIf="showSecond" class="picker-table-separator">:</li>\n <li *ngIf="showSecond" class="picker-table-number second">\n <span class="arrow up" (click)="increaseSecond()"></span>\n {{ time | moment: \'ss\' }}\n <span class="arrow down" (click)="decreaseSecond()"></span>\n </li>\n <li *ngIf="use12Hour" class="picker-table-meridiem meridiem">\n {{ time | moment: \'A\' }}\n </li>\n </ul>\n </div>\n <div class="picker-footer">\n <div class="picker-action action-now" (click)="selectNow()">\n <span class="text">Now</span>\n </div>\n <div class="picker-action action-confirm" (click)="selectTime()">\n <span class="text">Confirm</span>\n </div>\n <div class="picker-action action-clear" (click)="clearTime()">\n <span class="text">Clear</span>\n </div>\n <div class="picker-action action-close" (click)="cancelTimePicker()">\n <span class="text">Close</span>\n </div>\n </div>\n </div>\n </div>\n</picker-modal>\n',styles:["*,::after,::before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:40rem;font-family:'Open Sans'}.picker-box{width:100%;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;height:2.5rem;width:100%}.picker-header{text-align:center}.picker-table{width:100%;margin:2.5rem 0}.picker-table-time{font-size:2.37rem;line-height:2.5rem;list-style:none;margin:0;padding:0;display:flex;justify-content:center;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-table-meridiem,.picker-table-number,.picker-table-separator{text-align:center}.picker-table-meridiem,.picker-table-number{position:relative;width:20%}.arrow{position:absolute;left:50%;border:solid #777;border-width:0 .2rem .2rem 0;display:inline-block;padding:.25rem;cursor:pointer}.arrow.up{top:-1rem;-webkit-transform:translateX(-50%) rotate(-135deg);transform:translateX(-50%) rotate(-135deg)}.arrow.down{bottom:-1rem;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg)}.arrow:hover{border-color:#1975d2}.picker-table-separator{width:calc(20% / 3)}.picker-footer{display:flex;justify-content:center;width:100%;cursor:pointer}.picker-footer .picker-action{width:25%;text-align:center}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear::before,.picker-footer .action-close::before,.picker-footer .action-confirm::before,.picker-footer .action-now::before{content:' ';position:relative;display:inline-block;height:0;width:0}.picker-footer .action-now::before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-confirm::before{width:1rem;height:1rem;border-radius:100%;background-color:#00b5ad}.picker-footer .action-clear::before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close::before{width:1rem;height:1rem;background:linear-gradient(to bottom,transparent 35%,#777 35%,#777 65%,transparent 65%),linear-gradient(to right,transparent 35%,#777 35%,#777 65%,transparent 65%);-webkit-transform:rotate(45deg);transform:rotate(45deg)}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={initTime:[{type:i0.Input}],showSecond:[{type:i0.Input}],viewFormat:[{type:i0.Input}],use12Hour:[{type:i0.Input}],returnObject:[{type:i0.Input}],onSelectTime:[{type:i0.Output}],onTimePickerCancel:[{type:i0.Output}]},e}(),ModalComponent=function(){function e(){this.onOverlayClick=new i0.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.closeModal=function(){this.onOverlayClick.emit(!1)},e.decorators=[{type:i0.Component,args:[{selector:"picker-modal",template:'<section class="x-modal">\n <section class="modal-overlay" (click)="closeModal()"></section>\n <section class="modal-main" id="section-modal-main">\n <ng-content></ng-content>\n </section>\n</section>\n',styles:[":host{z-index:9999999999}*,::after,::before{box-sizing:border-box}.modal-main{position:absolute;left:19.6%;right:auto;top:auto;z-index:111;background-color:#fff;border:1px solid #d7dad7;border-radius:6px;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);box-shadow:0 5px 15px rgba(0,0,0,.3)}"],changeDetection:i0.ChangeDetectionStrategy.OnPush,animations:[]}]}],e.ctorParameters=function(){return[]},e.propDecorators={onOverlayClick:[{type:i0.Output}]},e}(),MomentPipe=function(){function e(){}return e.prototype.transform=function(e,t){return t?e.format(t):e.format("MMM DD, YYYY")},e.decorators=[{type:i0.Pipe,args:[{name:"moment"}]}],e}(),Moment=moment_,DateTimePickerComponent=function(){function e(){this.showDate=!0,this.showTime=!1,this.showWeeks=!1,this.weeks=[2,4,6,8,12,16,24],this.onDateChange=new i0.EventEmitter,this.showDatePicker=!1,this.showTimePicker=!1,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){},e.prototype.weeksSelected=function(e){var t=new Date,n=t.setDate(t.getDate()+7*e);this.value=Moment(n).format()},e.prototype.setDate=function(e){this.value=e&&""!==e?Moment(e).format():e},e.prototype.setTime=function(e){this.value=e&&""!==e?Moment(e).format():e},e.prototype.toggleDatePicker=function(e){this.showDatePicker=e},e.prototype.toggleTimePicker=function(e){this.showTimePicker=e},Object.defineProperty(e.prototype,"value",{get:function(){return this.modelValue},set:function(e){this.modelValue=e,this.onDateChange.emit(e),this.onChange(e),this.onTouched()},enumerable:!0,configurable:!0}),e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.writeValue=function(e){e instanceof Date?this.value=Moment(e).format():this.value=e},e.decorators=[{type:i0.Component,args:[{selector:"date-time-picker",template:'<div class="row">\n <div *ngIf="!showTime" class="col-xs-12 col-md-12">\n <input\n *ngIf="!showWeeks"\n type="text"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div *ngIf="showWeeks" class="input-group">\n <input\n type="text"\n class="form-control"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div class="input-group-btn">\n <button\n type="button"\n class="btn btn-default dropdown-toggle"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false"\n >\n Weeks <span class="caret"></span>\n </button>\n <ul class="dropdown-menu up">\n <li (click)="weeksSelected(count)" *ngFor="let count of weeks">\n <span> {{ count }} Weeks</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div *ngIf="showTime" class="col-xs-8 col-md-8">\n <input\n *ngIf="!showWeeks"\n type="text"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div *ngIf="showWeeks" class="input-group">\n <input\n type="text"\n class="form-control"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div class="input-group-btn">\n <button\n type="button"\n class="btn btn-default dropdown-toggle"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false"\n >\n Weeks <span class="caret"></span>\n </button>\n <ul class="dropdown-menu up">\n <li (click)="weeksSelected(count)" *ngFor="let count of weeks">\n <span> {{ count }} Weeks</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div *ngIf="showTime" class="col-xs-4 col-md-4">\n <input\n type="text"\n class="form-control"\n [value]="value | date: \'shortTime\'"\n (focus)="toggleTimePicker(true)"\n readonly\n placeholder="Select Time"\n />\n </div>\n</div>\n<date-picker\n *ngIf="showDatePicker"\n [initDate]="value"\n (onSelectDate)="setDate($event)"\n (onDatePickerCancel)="toggleDatePicker($event)"\n></date-picker>\n\n<time-picker\n *ngIf="showTimePicker"\n [initTime]="value"\n [use12Hour]="true"\n (onSelectTime)="setTime($event)"\n (onTimePickerCancel)="toggleTimePicker($event)"\n></time-picker>\n',styles:["input[readonly]{background-color:#fff}.up{bottom:100%!important;top:auto!important}.glyphicon{top:1px}"],providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[]},e.propDecorators={modelValue:[{type:i0.Input}],showDate:[{type:i0.Input}],showTime:[{type:i0.Input}],showWeeks:[{type:i0.Input}],weeks:[{type:i0.Input}],onDateChange:[{type:i0.Output}]},e}(),DateTimePickerModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{imports:[common.CommonModule,forms.FormsModule],declarations:[DatePickerComponent,TimePickerComponent,ModalComponent,MomentPipe,DateTimePickerComponent],exports:[DatePickerComponent,TimePickerComponent,ModalComponent,MomentPipe,DateTimePickerComponent],providers:[]}]}],e}(),moment$3=moment_,MY_FORMATS={parse:{dateInput:"LL"},display:{dateInput:"MMMM DD, YYYY (dddd)",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},NgxDateTimePickerComponent=function(){function e(){this.selectedTime=moment$3().format(),this.selectedDate=moment$3().format(),this.loadInitial=!1,this.showTimePicker=!1,this.weeks=[0,2,4,6,8,12,16,24],this.showTime=!1,this.showWeeks=!0,this.dateFormat="MMMM DD, YYYY (dddd)",this._showHolidays=!0,this.observer=null,this.onDateChange=new i0.EventEmitter,this.onChange=function(){},this.onTouched=function(){}}return Object.defineProperty(e.prototype,"showHolidays",{set:function(e){this._showHolidays=!0===e||"true"===e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.onTimeSelect=function(e){var t=moment$3(this.selectedDate),n=e;this.setDateTime(t,n)},e.prototype.onDateSelect=function(e){var t=moment$3(e.value),n=this.selectedTime,o=this.setDateTime(t,n);e.value;this.value=o},e.prototype.toggleTimePicker=function(e){this.showTimePicker=e},e.prototype.setCurrentTime=function(){var e=moment$3(this.selectedDate),t=moment$3().format("HH:mm:ss");this.setDateTime(e,t)},e.prototype.weekSelect=function(e){var t=moment$3().format(),n=moment$3(t).add(e.value,"weeks"),o=t;this.setDateTime(n,o)},e.prototype.selectionChange=function(e){console.log("Week selected",e)},e.prototype.getWeekPickerCssClass=function(){return this.showTime?"col-sm-2 form-group":"col-sm-3 form-group"},e.prototype.getDatePickerCssClass=function(){return this.showTime&&this.showWeeks?"col-sm-5 form-group":!0===this.showWeeks?"col-sm-9 form-group":!0===this.showTime?"col-sm-8 form-group":"col-sm-12 form-group"},e.prototype.getTimePickerCssClass=function(){return this.showTime&&this.showWeeks?"col-sm-5 form-group":!0===this.showWeeks?"col-sm-9 form-group":"col-sm-4 form-group"},e.prototype.setDateTime=function(e,t){var n,o=moment$3(e).format("DD-MM-YYYY");n=this.showTime?moment$3(t).format("HH:mm:ss"):"00:00:00";var r=moment$3(o+""+n,"DD-MM-YYYY HH:mm:ss"),i=moment$3(r).format();return this.selectedDate=i,this.selectedTime=i,this.value=i,this.onChange(this.value),i},e.prototype.onOpen=function(){var e=this;if(this._showHolidays){var t=document.querySelector(".mat-calendar-content");t&&(this.observer=new MutationObserver(function(){e.highlightHolidays()}),this.observer.observe(t,{childList:!0,subtree:!0}))}},e.prototype.onClose=function(){this.observer&&(this.observer.disconnect(),this.observer=null)},e.prototype.highlightHolidays=function(){if(!!document.querySelector("mat-month-view")){var a=document.querySelectorAll(".mat-calendar-body-cell"),e=function(e){var t=a[e],n=new Date(t.getAttribute("aria-label")),o=moment$3(n).format("YYYY-MM-DD"),r=s.dataSource.filter(function(e){return e.date===o});if(0<r.length){var i=r.map(function(e){return e.name}).sort().join("\n\n");t.classList.add("highlight-date"),t.setAttribute("data-tooltip",i)}else t.classList.remove("highlight-date"),t.removeAttribute("data-tooltip")},s=this;for(n=0;n<a.length;n++)e(n)}else for(var t=document.querySelectorAll(".mat-calendar-body-cell"),n=0;n<t.length;n++)t[n].classList.remove("highlight-date"),t[n].removeAttribute("data-tooltip")},e.decorators=[{type:i0.Component,args:[{selector:"ngx-date-time-picker",template:'<div>\n <div class="row">\n <div [class]="getDatePickerCssClass()">\n <div class="input-group">\n <input\n matInput\n [matDatepicker]="picker"\n class="form-control"\n [value]="value"\n placeholder="Choose a date"\n (dateChange)="onDateSelect($event)"\n (click)="picker.open()"\n readonly\n />\n <mat-datepicker #picker (opened)="onOpen()" (closed)="onClose()"></mat-datepicker>\n <mat-datepicker-toggle\n matSuffix\n [for]="picker"\n class="input-group-btn"\n ></mat-datepicker-toggle>\n </div>\n </div>\n <div [class]="getWeekPickerCssClass()" *ngIf="showWeeks">\n <mat-select\n placeholder="Select Weeks"\n class="form-control"\n name="weeks"\n (selectionChange)="weekSelect($event)"\n >\n <mat-option *ngFor="let count of weeks" [value]="count">\n {{ count }} Weeks\n </mat-option>\n </mat-select>\n </div>\n <div [class]="getTimePickerCssClass()" *ngIf="showTime">\n <input\n type="text"\n class="form-control"\n [value]="value | date: \'shortTime\'"\n (focus)="toggleTimePicker(true)"\n readonly\n placeholder="Select Time"\n />\n <time-picker\n *ngIf="showTimePicker"\n [initTime]="value"\n [use12Hour]="true"\n (onSelectTime)="onTimeSelect($event)"\n (onTimePickerCancel)="toggleTimePicker($event)"\n ></time-picker>\n </div>\n </div>\n</div>\n',styles:["#time-section{display:inline-block}#ngx-atp-time-picker,#ngx-mat-form-field{width:100%}.up{bottom:100%!important;top:auto!important}.time-btn{margin-top:-20px}::ng-deep .highlight-date{border-radius:999px;background-color:#90ee90!important}::ng-deep .highlight-date[data-tooltip]:hover::after{content:attr(data-tooltip);position:absolute;top:-40px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:#333;color:#fff;padding:9px 10px;border-radius:4px;font-size:12px;line-height:6px;white-space:pre-wrap;z-index:1000;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-max-content;width:-moz-max-content;width:max-content;text-align:start}::ng-deep .highlight-date[data-tooltip]:hover::before{content:'';position:absolute;top:-8px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);border:4px solid transparent;border-top-color:#333;z-index:1000}"],providers:[{provide:core.MAT_DATE_FORMATS,useValue:MY_FORMATS},{provide:core.DateAdapter,useClass:materialMomentAdapter.MomentDateAdapter},{provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return e}),multi:!0}]}]}],e.propDecorators={weeks:[{type:i0.Input}],modelValue:[{type:i0.Input}],showTime:[{type:i0.Input}],showWeeks:[{type:i0.Input}],dateFormat:[{type:i0.Input}],showHolidays:[{type:i0.Input}],picker:[{type:i0.ViewChild,args:["picker"]}],dataSource:[{type:i0.Input}],onDateChange:[{type:i0.Output}]},e}(),NgxDateTimePickerModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{imports:[common.CommonModule,forms.FormsModule,forms.ReactiveFormsModule,datepicker.MatDatepickerModule,formField.MatFormFieldModule,material.MatNativeDateModule,material.MatInputModule,DateTimePickerModule,select.MatSelectModule,material.MatTooltipModule],declarations:[NgxDateTimePickerComponent],exports:[datepicker.MatDatepickerModule,formField.MatFormFieldModule,material.MatNativeDateModule,material.MatInputModule,NgxDateTimePickerComponent],providers:[]}]}],e}(),Option$1=function ao(e){this.label=e.label,this.value=e.value},AfeNgSelectComponent=function(){function e(){this.question_options=[],this.errors=[],this.propagateChange=function(e){}}return e.prototype.getChangingText=function(e){var t=this;this.getData(e).subscribe(function(e){t.question_options=e})},e.prototype.writeValue=function(e){},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.ngOnChanges=function(e){},e.prototype.ngOnInit=function(){var t=this;this.extras&&this.extras.originalValue&&this.resolveSelectedOption(this.extras.originalValue).subscribe(function(e){t.selected_question_option=e})},e.prototype.getData=function(e){var o=this;return this.subject=new rxjs.BehaviorSubject([]),this.dataSource.searchOptions(e).subscribe(function(e){for(var t=new Array,n=0;n<e.length;n++)t.push(new Option$1(e[n]));o.subject.next(t)},function(e){o.subject.error(e)}),this.subject.asObservable()},e.prototype.onValueChange=function(e){},e.prototype.resolveSelectedOption=function(e){var t=this;return this.subjectOption=new rxjs.BehaviorSubject(null),this.dataSource.resolveSelectedValue(e).subscribe(function(e){t.subjectOption.next(e)},function(e){t.subjectOption.error(e)}),this.subjectOption.asObservable()},e.prototype.resetOptions=function(){this.subject.next(new Array)},e.decorators=[{type:i0.Component,args:[{selector:"afe-ng-select",template:'<ng-select\n (searchInputText)="getChangingText($event)"\n (ngModelChange)="onValueChange($event)"\n [options]="question_options"\n [multiple]="multiple"\n >\n </ng-select> ',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return e}),multi:!0}]}]}],e.propDecorators={dataSource:[{type:i0.Input}],multiple:[{type:i0.Input}],extras:[{type:i0.Input}]},e}(),FormSchemaCompiler=function(){function e(){}return e.prototype.compileFormSchema=function(e,t){var n=this.getReferencedForms(e,t);if(_.isEmpty(n))return e;var o=this.getAllPlaceholderObjects(e);return _.isEmpty(o)||this.replaceAllPlaceholdersWithActualObjects(n,o),e},e.prototype.findSchemaByName=function(e,t){if(!_.isEmpty(e)&&!_.isEmpty(t)){var n={};return _.each(e,function(e){e.name===t&&(n=e)}),n}},e.prototype.getPageInSchemaByLabel=function(e,t){if(!_.isEmpty(e)&&!_.isEmpty(t)){var n={};return _.each(e.pages,function(e){e.label===t&&(n=e)}),n}},e.prototype.getSectionInSchemaByPageLabelBySectionLabel=function(e,t,n){if(!(_.isEmpty(e)||_.isEmpty(t)||_.isEmpty(n))){var o=this.getPageInSchemaByLabel(e,t);if(!_.isEmpty(o)){var r={};return _.each(o.sections,function(e){e.label===n&&(r=e)}),r}}},e.prototype.getQuestionByIdInSchema=function(e,t){if(!_.isEmpty(e)&&!_.isEmpty(t)){if(Array.isArray(e)){for(var n=void 0,o=0;o<e.length&&(_.isEmpty(e[o])||(n=this.getQuestionByIdInSchema(e[o],t)),_.isEmpty(n));o++);return n}if("object"==typeof e){if(this.isQuestionObjectWithId(e,t))return e;if(this.isSchemaSubObjectExpandable(e)){var r=e.pages||e.sections||e.questions;return this.getQuestionByIdInSchema(r,t)}}}},e.prototype.getQuestionsArrayByQuestionIdInSchema=function(e,t){if(!_.isEmpty(e)&&!_.isEmpty(t))return this.getQuestionsArrayByQuestionId(e,e,t)},e.prototype.getQuestionsArrayByQuestionId=function(e,t,n){if(Array.isArray(t)){for(var o=void 0,r=0;r<t.length&&(_.isEmpty(t[r])||(o=this.getQuestionsArrayByQuestionId(t,t[r],n)),_.isEmpty(o));r++);return o}if("object"==typeof t){if(this.isQuestionObjectWithId(t,n))return e;if(this.isSchemaSubObjectExpandable(t)){var i=t.pages||t.sections||t.questions;return this.getQuestionsArrayByQuestionId(i,i,n)}}},e.prototype.isSchemaSubObjectExpandable=function(e){if("object"==typeof e){var t=Object.keys(e);if(_.includes(t,"pages")||_.includes(t,"sections")||_.includes(t,"questions"))return!0}return!1},e.prototype.isQuestionObjectWithId=function(e,t){return e.id===t},e.prototype.getAllPlaceholderObjects=function(e){var t=[];return this.extractPlaceholderObjects(e,t),t},e.prototype.extractPlaceholderObjects=function(e,t){if(!_.isEmpty(e))if(Array.isArray(e))for(var n=0;n<e.length;n++)_.isEmpty(e[n])||this.extractPlaceholderObjects(e[n],t);else if("object"==typeof e)if(_.isEmpty(e.reference)){if(this.isSchemaSubObjectExpandable(e)){var o=e.pages||e.sections||e.questions;this.extractPlaceholderObjects(o,t)}}else t.push(e)},e.prototype.fillPlaceholderObject=function(e,t){for(var n in t)_.isEmpty(e[n])&&(e[n]=t[n]);return e},e.prototype.replaceAllPlaceholdersWithActualObjects=function(n,e){var o=this;return _.each(e,function(e){var t=o.getReferencedObject(e.reference,n);_.isEmpty(t)?console.error("Form compile: Error finding referenced object",e.reference):(e=o.fillPlaceholderObject(e,t),delete(e=o.removeExcludedQuestionsFromPlaceholder(e)).reference)}),e},e.prototype.removeObjectFromArray=function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)},e.prototype.removeExcludedQuestionsFromPlaceholder=function(o){var r=this;return Array.isArray(o.reference.excludeQuestions)&&_.each(o.reference.excludeQuestions,function(e){var t=r.getQuestionsArrayByQuestionIdInSchema(o,e);if(Array.isArray(t)){var n=r.getQuestionByIdInSchema(t,e);r.removeObjectFromArray(t,n)}}),o},e.prototype.getReferencedObject=function(e,t){if(_.isEmpty(e.form))console.error("Form compile: reference missing form attribute",e);else{if(!_.isEmpty(t[e.form]))return _.isEmpty(e.questionId)?_.isEmpty(e.page)||_.isEmpty(e.section)?_.isEmpty(e.page)?void console.error("Form compile: Unsupported reference type",e.reference):this.getPageInSchemaByLabel(t[e.form],e.page):this.getSectionInSchemaByPageLabelBySectionLabel(t[e.form],e.page,e.section):this.getQuestionByIdInSchema(t[e.form],e.questionId);console.error("Form compile: referenced form alias not found",e)}},e.prototype.getReferencedForms=function(e,t){var n=this,o=e.referencedForms;if(!_.isEmpty(o)){var r={};return _.each(o,function(e){r[e.alias]=n.findSchemaByName(t,e.formName)}),r}},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),TextInputQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.placeholder=e.placeholder||"",t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(QuestionBase),TextAreaInputQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.placeholder=e.placeholder||"",t.isExpanded=e.isExpanded||!1,t.rows=e.rows||18,t.renderingType="textarea",t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(TextInputQuestion),SelectQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.renderingType="select",t.options=e.options||[],t.controlType=exports.AfeControlType.AfeFormControl,t.dataSource=e.dataSource||"",t}return __extends(e,n),e}(QuestionBase),UiSelectQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.renderingType="ui-select",t.options=e.options||[],t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(QuestionBase),DateQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.showTime=!0,t.showWeeksAdder=!1,t.showHolidays=!0,t.renderingType="date",t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(QuestionBase),MultiSelectQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.renderingType="multi-select",t.options=e.options||[],t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(SelectQuestion),NestedQuestion=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e}(QuestionBase),QuestionGroup=function(n){function e(e){var t=n.call(this,e)||this;return t.isExpanded=!0,t.renderingType="group",t.questions=e.questions||[],t.controlType=exports.AfeControlType.AfeFormGroup,t}return __extends(e,n),e}(NestedQuestion),RepeatingQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.renderingType="repeating",t.questions=e.questions||[],t.controlType=exports.AfeControlType.AfeFormArray,t}return __extends(e,n),e}(NestedQuestion),CheckBoxQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.renderingType="checkbox",t.options=e.options||[],t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(QuestionBase),TimeQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.renderingType="time",t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(QuestionBase),FileUploadQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.showTime=!0,t.showWeeksAdder=!1,t.renderingType="file",t.dataSource=e.dataSource,t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(QuestionBase),TestOrderQuestion=function(n){function e(e){var t=n.call(this,e)||this;return t.renderingType="select",t.orderType=e.orderType,t.selectableOrders=e.selectableOrders,t.options=e.options,t.orderSettingUuid=e.orderSettingUuid,t.rendering=e.orderSettingUuid,t.controlType=exports.AfeControlType.AfeFormControl,t}return __extends(e,n),e}(QuestionBase),DateValidationModel=function(n){function e(e){var t=n.call(this,e)||this;return t.allowFutureDates=!1,t.allowFutureDates="true"===e.allowFutureDates,t}return __extends(e,n),e}(ValidationModel),MaxValidationModel=function(o){function e(e){var t=o.call(this,e)||this,n=e.max;return t.max=+n,t}return __extends(e,o),e}(ValidationModel),MinValidationModel=function(o){function e(e){var t=o.call(this,e)||this,n=e.min;return t.min=+n,t}return __extends(e,o),e}(ValidationModel),DecimalPointValidationModel=function(){function e(e){this.decimalPlace=0,this.failsWhenExpression="",this.type="js_expression",this.decimalPlace=e.decimalPlace}return e.prototype.setFailExpression=function(){this.failsWhenExpression="!isEmpty(myValue) && String(myValue).split('.')[1].length !== "+this.decimalPlace},e.prototype.setMessage=function(){this.message="Value must be to "+this.decimalPlace+" decimal places"},e.prototype.setValuesAndExpressions=function(){this.setMessage(),this.setFailExpression()},e}(),DummyDataSource=function(){function e(){this.returnErrorOnNext=!1}return e.prototype.resolveSelectedValue=function(t){var e=this.sampleData();e=(e=e.map(function(e){return new Option$1({label:e.label,value:e.concept})})).filter(function(e){return e.value===t});var n=new rxjs.BehaviorSubject([]);return this.returnErrorOnNext?n.error(new Error("Error loading Options")):n.next(e[0]),n.asObservable()},e.prototype.fileUpload=function(e){return rxjs.of({image:""})},e.prototype.fetchFile=function(e){return rxjs.of({image:""})},e.prototype.searchOptions=function(t){var e=this.sampleData();e=(e=e.map(function(e){return new Option$1({label:e.label,value:e.concept})})).filter(function(e){return-1!==e.label.indexOf(t)});var n=new rxjs.BehaviorSubject([]);return this.returnErrorOnNext?n.error(new Error("Error loading Options")):n.next(e),n.asObservable()},e.prototype.sampleData=function(){return[{concept:"a899e0ac-1350-11df-a1f1-0026b9348838",label:"None"},{concept:"a8ad1276-1350-11df-a1f1-0026b9348838",label:"Breathlessness"},{concept:"a892e4b4-1350-11df-a1f1-0026b9348838",label:"Chest pain"},{concept:"a8afc8b8-1350-11df-a1f1-0026b9348838",label:"Cough = 2 weeks"},{concept:"d7adae14-c386-49cc-8f7c-765d8ceec566",label:"Fever for = 2 weeks"},{concept:"3f57aafc-7162-41da-a51b-6a804cb6f5e8",label:"New exposure to household contact with TB"},{concept:"a89807f0-1350-11df-a1f1-0026b9348838",label:"Noticeable Weight loss"},{concept:"e1862fef-68ed-4df4-90dd-a00152f719aa",label:"Night sweats = 2 weeks"},{concept:"a8ad462e-1350-11df-a1f1-0026b9348838",label:"Abdomen"},{concept:"f218c60e-4b54-475a-a4fa-facab9216da8",label:"Groin"},{concept:"a8a774b0-1350-11df-a1f1-0026b9348838",label:"Joints"},{concept:"4639388c-ee31-4dcf-abb4-ad71253493bb",label:"Neck Kw"}]},e}(),moment$4=moment_,HistoricalEncounterDataService=function(){function e(){this.dataSources={}}return e.prototype.registerEncounters=function(e,t){var o=this,r={data:[],getValue:function(e,t){void 0===t&&(t=0);var n=e.split(".");return 0<n.length?o.getFirstValue(n,r.data[t]):r.data[t][e]},getAllObjects:function(){return r.data},getSingleObject:function(e){return void 0===e&&(e=0),r.data[e]}};if(_.isArray(t)){var n=[];_.each(t,function(e){n.push(o._transformEncounter(e))}),r.data=_.sortBy(n,"encounterDatetime").reverse()}else r.data.push(this._transformEncounter(t));this.putObject(e,r)},e.prototype.putObject=function(e,t){this.dataSources[e]=t},e.prototype.getObject=function(e){return this.dataSources[e]||null},e.prototype.getFirstValue=function(e,t){var n=[];if(this.getAllValues(e,t,n),0<n.length)return{value:n[0],valueDate:moment$4(t.encounterDatetime).format("ll")}},e.prototype.getAllValues=function(e,t,n){var o=this;if(!_.isNil(t))if(e.length<=1)_.isNil(t[e[0]])||n.push(t[e[0]]);else{var r=e.splice(1),i=e[0];_.isArray(t[i])&&0<t[i].length?_.each(t[i],function(e){o.getAllValues(r.slice(0),e,n)}):this.getAllValues(r.slice(0),t[i],n)}},e.prototype._transformEncounter=function(e){if(!_.isNil(e)){var t={encounterDatetime:e.encounterDatetime};if(e.location&&e.location.uuid&&(t.location=e.location.uuid),e.patient&&e.patient.uuid&&(t.patient=e.patient.uuid),e.form&&e.form.uuid&&(t.form=e.form.uuid),e.encounterType&&e.encounterType.uuid&&(t.encounterType=e.encounterType.uuid),e.provider){var n=e.provider;t.provider=n.uuid}if(e.obs){var o=this._transformObs(e.obs);_.extend(t,o)}return t}},e.prototype._transformObs=function(e){var t=this;if(!e)return null;var n={};if(_.isArray(e))return _.each(e,function(e){t._augumentObs(n,t._transformObs(e))}),n;if(e.groupMembers){var o={};return _.each(e.groupMembers,function(e){t._augumentObs(o,t._transformObs(e))}),n[e.concept.uuid]&&_.isArray(n[e.concept.uuid])?n[e.concept.uuid].push(o):n[e.concept.uuid]=[o],n}return e.value instanceof Object?n[e.concept.uuid]=e.value.uuid:n[e.concept.uuid]=e.value,n},e.prototype._augumentObs=function(e,t){for(var n in t)if(_.has(e,n)){if(!_.isArray(e[n])){var o=e[n];e[n]=[o]}_.isArray(t[n])?Array.prototype.push.apply(e[n],t[n]):e[n].push(t[n])}else e[n]=t[n];return e},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),HistoricalHelperService=function(){function e(){}return e.prototype.evaluate=function(e,t,n){var o=new HistoricalEncounterDataService;o.registerEncounters("prevEnc",t.rawPrevEnc);var r={HD:o};if(n)for(var i in n)n[i]&&(r[i]=n[i]);var a=new JsExpressionHelper,s=new AfeFormControl;return(new ExpressionRunner).getRunnable(e,s,a.helperFunctions,r).run()},e.prototype.evaluatePrecondition=function(e,t,n){var o={histValue:n};return this.evaluate(e,t,o)},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),moment$5=moment_,QuestionFactory=function(){function e(){this.dataSources={},this.historicalHelperService=new HistoricalHelperService}return e.prototype.createQuestionModel=function(e,t){if(t){var n=t.dataSourcesContainer.dataSources;this.dataSources=n}return this.toFormQuestionModel(e)},e.prototype.toSelectQuestion=function(e){var t=new SelectQuestion({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.options=e.questionOptions.answers.map(function(e){return{label:e.label,value:e.concept}}),t.options.splice(0,0,{label:"",value:""}),t.renderingType=e.questionOptions.rendering,t.validators=this.addValidators(e),t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toNumericQuestion=function(e){var t=new TextInputQuestion({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="number",t.placeholder=e.questionOptions.placeholder,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toNumberQuestion=function(e){var t=new TextInputQuestion({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="number",t.placeholder=e.questionOptions.placeholder||"",t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),t.validators=this.addValidators(e),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toDecimalQuestion=function(e){var t=new TextInputQuestion({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="decimal",t.placeholder=e.questionOptions.placeholder||"",t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),t.validators=this.addValidators(e),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toDateQuestion=function(e){if("encounterDatetime"===e.type)return this.toEncounterDatetimeQuestion(e);var t=new DateQuestion({type:"",key:""});t.renderingType="date",t.validators=this.addValidators(e),t.extras=e,t.showTime=e.questionOptions.showTime,t.showHolidays=e.questionOptions.showHolidays,t.showWeeksAdder=!!e.questionOptions.weeksList;return t.dataSource="holidays",this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toTimeQuestion=function(e){var t=new TimeQuestion({type:"",key:""});t.renderingType="time",t.validators=this.addValidators(e),t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toEncounterDatetimeQuestion=function(e){var t=new DateQuestion({type:"",key:""});t.label=e.label,t.renderingType="date",t.key=e.id,t.validators=this.addValidators(e),t.extras=e,t.showHolidays=e.questionOptions.showHolidays,t.showWeeksAdder=!!e.questionOptions.weeksList;return t.showTime=!0,t.dataSource="holidays",this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toCheckBoxQuestion=function(e){var t=new CheckBoxQuestion({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.extras=e,t.options=e.questionOptions.answers.map(function(e){return{label:e.label,value:e.concept}}),t.options.splice(0,0),t.renderingType=e.questionOptions.rendering;return this.copyProperties({label:"label",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toMultiCheckboxQuestion=function(e){var t=new MultiSelectQuestion({renderType:"",options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.options=e.questionOptions.answers.map(function(e){return{label:e.label,value:e.concept}}),t.validators=this.addValidators(e),t.dataSource=new DummyDataSource,t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toTextAreaQuestion=function(e){var t=new TextAreaInputQuestion({isExpanded:!1,rows:18,placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.placeholder=e.questionOptions.placeholder,t.isExpanded=e.isExpanded,t.rows=e.questionOptions.rows,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toTextQuestion=function(e){var t=new TextInputQuestion({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="text",t.placeholder=e.questionOptions.placeholder,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toFileUploadQuestion=function(e){var t=new FileUploadQuestion({type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="file",t.dataSource="file",t.validators=this.addValidators(e),t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toDrugQuestion=function(e){var t=new SelectQuestion({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="drug";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toProblemQuestion=function(e){var t=new SelectQuestion({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="problem";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toConceptAnswerSelect=function(e){var t=new SelectQuestion({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource=e.questionOptions.dataSource||"conceptAnswers",t.dataSourceOptions={concept:e.questionOptions.concept};return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toRepeatingQuestion=function(e){var t=new RepeatingQuestion({questions:[],type:"",key:""});if(t.label=e.label,t.questions=this.getChildrenQuestionModels(e.questions),t.key=e.id,t.validators=this.addValidators(e),"testOrder"===(t.extras=e).type){var n=this.toTestOrderQuestion(e),o=[];o.push(n),t.questions=o}return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toGroupQuestion=function(e){var t=new QuestionGroup({questions:[],type:"",key:""});t.label=e.label,t.questions=this.getChildrenQuestionModels(e.questions),t.key=e.id,t.validators=this.addValidators(e),t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toPageQuestion=function(e){var t=this,n=new QuestionGroup({questions:[],type:"",key:""});return n.label=e.label,n.key=e.label,n.renderingType="page",n.controlType=exports.AfeControlType.None,n.questions=[],e.sections.forEach(function(e){n.questions.push(t.toSectionQuestion(e))}),n},e.prototype.toFormQuestionModel=function(e){var t=this,n=new QuestionGroup({questions:[],type:"",key:""});return n.label=e.label,n.key=e.label,n.renderingType="form",n.controlType=exports.AfeControlType.AfeFormGroup,n.extras=e,n.questions=[],e.pages.forEach(function(e){n.questions.push(t.toPageQuestion(e))}),n},e.prototype.toSectionQuestion=function(e){var t=new QuestionGroup({questions:[],type:"",key:""});return t.label=e.label,t.key=e.label,t.renderingType="section",t.controlType=exports.AfeControlType.None,t.isExpanded="true"===e.isExpanded,t.questions=this.getSchemaQuestions(e.questions),t},e.prototype.toPersonAttributeQuestion=function(e){var t=new UiSelectQuestion({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="personAttribute";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addHistoricalExpressions(e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toEncounterProviderQuestion=function(e){var t=new UiSelectQuestion({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="provider";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toFieldSetQuestion=function(e){var t=this.toGroupQuestion(e);return t.renderingType="field-set",t},e.prototype.toEncounterLocationQuestion=function(e){var t=new UiSelectQuestion({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType=e.type,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="location";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toAmrsLocationsQuestion=function(e){var t=new UiSelectQuestion({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType=e.type,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="amrsLocations";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toSiblingLocationsQuestion=function(e){var t=new UiSelectQuestion({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType=e.type,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="siblingLocations";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toNonAmrsLocationsQuestion=function(e){var t=new UiSelectQuestion({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType=e.type,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="nonAmrsLocations";return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},e.prototype.toTestOrderQuestion=function(e){var t=new TestOrderQuestion({type:"",key:"",orderType:"",selectableOrders:[],orderSettingUuid:"",label:"",rendering:""});t.label=e.label,t.key=e.id,t.validators=this.addValidators(e),t.extras=e,t.options=e.questionOptions.selectableOrders.map(function(e){return{label:e.label,value:e.concept}});return this.copyProperties({label:"label",required:"required",id:"key"},e,t),t},e.prototype.getSchemaQuestions=function(e){var t=new Array;return this.getQuestions(e,t),t},e.prototype.getQuestions=function(e,t){if(Array.isArray(t)||(t=[]),Array.isArray(e))for(var n in e)e.hasOwnProperty(n)&&this.getQuestions(e[n],t);if(e&&!Array.isArray(e)&&"object"==typeof e)if(e.questionOptions)"group"===e.questionOptions.rendering||"repeating"===e.questionOptions.rendering?t.push(this.toModel(e,e.questionOptions.rendering)):"field-set"===e.questionOptions.rendering||t.push(this.toModel(e,e.questionOptions.rendering));else for(var o in e)e.hasOwnProperty(o)&&this.getQuestions(e[o],t)},e.prototype.getChildrenQuestionModels=function(e){var t=[];return this.getQuestions(e,t),t},e.prototype.toModel=function(e,t){switch("ui-select-extended"===t&&(t=e.type),e.id||(e.id=this.generateId(10)),!e.questionOptions||!0!==e.questionOptions.showDate&&"true"!==e.questionOptions.showDate||(e=this.convertOldVersionComplexObsQuestionToNewVersion(e),t="field-set"),t){case"select":case"single-select":case"multi-select":return this.toSelectQuestion(e);case"numeric":return this.toNumericQuestion(e);case"number":return this.toNumberQuestion(e);case"decimal":return this.toDecimalQuestion(e);case"encounterDatetime":return this.toEncounterDatetimeQuestion(e);case"date":return this.toDateQuestion(e);case"time":return this.toTimeQuestion(e);case"multiCheckbox":return this.toMultiCheckboxQuestion(e);case"drug":return this.toDrugQuestion(e);case"problem":return this.toProblemQuestion(e);case"group":return this.toGroupQuestion(e);case"field-set":return this.toFieldSetQuestion(e);case"repeating":return this.toRepeatingQuestion(e);case"personAttribute":return this.toPersonAttributeQuestion(e);case"text":return this.toTextQuestion(e);case"textarea":return this.toTextAreaQuestion(e);case"select-concept-answers":return this.toConceptAnswerSelect(e);case"encounterLocation":return this.toEncounterLocationQuestion(e);case"amrsLocations":return this.toAmrsLocationsQuestion(e);case"nonAmrsLocations":return this.toNonAmrsLocationsQuestion(e);case"siblingLocations":return this.toSiblingLocationsQuestion(e);case"encounterDatetime":return this.toEncounterDatetimeQuestion(e);case"encounterProvider":return this.toEncounterProviderQuestion(e);case"radio":case"checkbox":return this.toCheckBoxQuestion(e);case"encounterProvider":return this.toEncounterProviderQuestion(e);case"file":return this.toFileUploadQuestion(e);default:return console.warn("New Schema Question Type found........."+t),this.toTextQuestion(e)}},e.prototype.convertOldVersionComplexObsQuestionToNewVersion=function(e){var t={type:"complex-obs"};t.label=e.label,t.id="complex_"+e.id,t.questionOptions={},t.questionOptions.concept=e.questionOptions.concept,t.questionOptions.rendering="field-set",t.questions=[],t.validators=[];var n=JSON.parse(JSON.stringify(e));n.type="complex-obs-child",delete n.questionOptions.showDate,delete n.questionOptions.shownDateOptions,n.questionOptions.obsField="value";var o={type:"complex-obs-child"};o.label="Date of "+n.label,o.id="date_"+n.id,o.questionOptions={},o.questionOptions.concept=e.questionOptions.concept,o.questionOptions.rendering="date",o.questionOptions.obsField="obsDatetime";var r=Object.assign({},e.questionOptions.shownDateOptions);return o.validators=r.validators,o.hide=r.hide,t.questions.push(n),t.questions.push(o),t},e.prototype.copyProperties=function(e,t,n){for(var o in t)e.hasOwnProperty(o)&&n.hasOwnProperty(e[o])&&(n[e[o]]=t[o])},e.prototype.addValidators=function(e){var n=[];e.validators&&_.forEach(e.validators,function(e){switch(e.type){case"date":n.push(new DateValidationModel(e));break;case"js_expression":n.push(new JsExpressionValidationModel(e));break;case"decimal":var t=new DecimalPointValidationModel(e);t.setValuesAndExpressions(),n.push(t);break;case"conditionalAnswered":n.push(new ConditionalValidationModel(e));break;default:n.push(new ValidationModel(e))}});var t=e.questionOptions,o=t?t.rendering:"";if("number"!==o&&"decimal"!==o||t.max&&t.min&&(n.push(new MaxValidationModel({type:"max",max:t.max})),n.push(new MinValidationModel({type:"min",min:t.min}))),"object"==typeof e.required){var r=e.required;"conditionalRequired"===r.type&&n.push(new ConditionalValidationModel({referenceQuestionId:r.referenceQuestionId,referenceQuestionAnswers:r.referenceQuestionAnswers,type:r.type,message:r.message}))}return n},e.prototype.addHistoricalExpressions=function(e,t){if(e.historicalExpression&&0<e.historicalExpression.length){t.setHistoricalValue(!0),e.showHistoricalEncounterDate!==undefined?t.showHistoricalEncounterDate("true"===e.showHistoricalEncounterDate):t.showHistoricalEncounterDate();var n=this.historicalHelperService.evaluate(e.historicalExpression,this.dataSources,undefined);if(t.historicalDataValue=n,e.historicalPrepopulateCondition&&n)return void(this.historicalHelperService.evaluatePrecondition(e.historicalPrepopulateCondition,this.dataSources,n)&&(t.defaultValue=n.value));if(e.historicalPrepopulate&&n){var o=moment$5(n.valueDate),r=moment$5().diff(o,"days");Number.isInteger(e.allowedHistoricalValueAgeInDays)?r<=e.allowedHistoricalValueAgeInDays&&(t.defaultValue=n.value):t.defaultValue=n.value}}},e.prototype.addCalculatorProperty=function(e,t){e.questionOptions&&"object"==typeof e.questionOptions.calculate&&(t.calculateExpression=e.questionOptions.calculate.calculateExpression)},e.prototype.addAlertProperty=function(e,t){e.alert&&(t.alert=e.alert)},e.prototype.addDisableOrHideProperty=function(e,t){e.disable&&(t.disable=e.disable),"object"==typeof e.disable&&(t.disable=e.disable.disableWhenExpression),e.hide&&(t.hide=e.hide),"object"==typeof e.hide&&e.hide.hideWhenExpression&&(t.hide=e.hide.hideWhenExpression)},e.prototype.generateId=function(e){for(var t="_";t.length<e&&0<e;){var n=Math.random();t+=n<.1?Math.floor(100*n):String.fromCharCode(Math.floor(26*n)+(.5<n?97:65))}return"_"+t},e}(),Form=function(){function e(e,t,n){this.schema=e,this.formFactory=t,this.questionFactory=n,this.valueProcessingInfo={},this.existingOrders={},this._showErrors=!1,this._dataSourcesContainer=new DataSources}return Object.defineProperty(e.prototype,"dataSourcesContainer",{get:function(){return this._dataSourcesContainer},enumerable:!0,configurable:!0}),e.prototype.searchNodeByPath=function(e,t,n){var o=this,r=e.children;for(var i in r)if(r.hasOwnProperty(i)){var a=r[i];if(a instanceof GroupNode){if(t===a.path)return n.push(a),n;this.searchNodeByPath(a,t,n)}else if(a instanceof LeafNode){if(t===a.path)return n.push(a),n}else if(a instanceof ArrayNode){if(t===a.path)return n.push(a),n;a.children.forEach(function(e){o.searchNodeByPath(e,t,n)})}}return n},e.prototype.searchNodeByQuestionId=function(e,t){var n=[];return t?this.searchNodeByQuestionType(this.rootNode,t,n):this.findNodesByQuestionId(this.rootNode,e,n),n},e.prototype.searchNodeByQuestionType=function(e,t,n){var o=this;if(e instanceof GroupNode){var r=e;for(var i in r.children)this.searchNodeByQuestionType(r.children[i],t,n)}e instanceof ArrayNode&&e.children.forEach(function(e){o.searchNodeByQuestionType(e,t,n)});if(e instanceof LeafNode){var a=e.question;a.extras&&a.extras.type&&a.extras.type===t&&n.push(e)}},e.prototype.findNodesByQuestionId=function(e,t,n){var o=this;if(e.question.key===t&&n.push(e),e instanceof GroupNode){var r=e;for(var i in r.children)this.findNodesByQuestionId(r.children[i],t,n)}e instanceof ArrayNode&&e.children.forEach(function(e){o.findNodesByQuestionId(e,t,n)})},Object.defineProperty(e.prototype,"valid",{get:function(){return this.rootNode.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showErrors",{get:function(){return this._showErrors},set:function(e){this._showErrors=e},enumerable:!0,configurable:!0}),e.prototype.markInvalidControls=function(e,t){var n=this,o=e.children;for(var r in o)if(o.hasOwnProperty(r)){var i=o[r];if(i instanceof GroupNode)this.markInvalidControls(i,t);else if(i instanceof LeafNode){var a=i.question;if(a.key&&0<a.key.length){var s=i.control;s.valid||s.disabled||(t&&t.push(i),s.markAsTouched())}}else if(i instanceof ArrayNode){var l=i;l&&l.children&&0<l.children.length&&_.forEach(l.children,function(e){n.markInvalidControls(e,t)})}}return t},e.prototype.updateHiddenDisabledStateForAllControls=function(){this._updateHiddenDisabledStateForAllControls(this.rootNode)},e.prototype.updateAlertsForAllControls=function(){this._updateAlertsForAllControls(this.rootNode)},e.prototype._updateAlertsForAllControls=function(e){var t=this;if(e.control&&e.control.updateAlert&&e.control.updateAlert(),e instanceof GroupNode){var n=e;for(var o in n.children)this._updateAlertsForAllControls(n.children[o])}e instanceof ArrayNode&&e.children.forEach(function(e){t._updateAlertsForAllControls(e)})},e.prototype._updateHiddenDisabledStateForAllControls=function(e){var t=this;if(e.control&&(e.control.updateDisabledState&&e.control.updateDisabledState(),e.control.updateHiddenState&&e.control.updateHiddenState()),e instanceof GroupNode){var n=e;for(var o in n.children)this._updateHiddenDisabledStateForAllControls(n.children[o])}e instanceof ArrayNode&&e.children.forEach(function(e){t._updateHiddenDisabledStateForAllControls(e)})},e}(),FormFactory=function(){function e(e,t,n){this.controlService=e,this.questionFactroy=t,this.controlRelationsFactory=n,this.hd={getValue:function(){return 20}}}return e.prototype.createForm=function(e,t){var n=new Form(e,this,this.questionFactroy);if(t)for(var o in t)t.hasOwnProperty(o)&&n.dataSourcesContainer.registerDataSource(o,t[o],!1);var r=this.questionFactroy.createQuestionModel(e,n);return n.rootNode=this.createNode(r,null,null,n),this.buildRelations(n.rootNode),n.updateHiddenDisabledStateForAllControls(),n.updateAlertsForAllControls(),n},e.prototype.buildRelations=function(e){Validations.JSExpressionValidatorsEnabled=!1,this.controlRelationsFactory.buildRelations(e),Validations.JSExpressionValidatorsEnabled=!0},e.prototype.createNode=function(e,t,n,o){return e instanceof NestedQuestion?e instanceof RepeatingQuestion?this.createArrayNode(e,t,n,o):this.createGroupNode(e,t,n,o):this.createLeafNode(e,t,n,o)},e.prototype.createLeafNode=function(e,t,n,o){var r=this.controlService.generateControlModel(e,n,!1,o);return new LeafNode(e,r,null,o,t?t.path:undefined)},e.prototype.createGroupNode=function(e,t,n,o){var r=this.controlService.generateControlModel(e,n,!1,o),i=new GroupNode(e,r,null,o,t?t.path:undefined);return this.createNodeChildren(e,i,r||n,o),i},e.prototype.createArrayNode=function(e,t,n,o){var r=this,i=this.controlService.generateControlModel(e,n,!1,o),a=new ArrayNode(e,i,n,this,o,t?t.path:undefined);return a.createChildFunc=this.createArrayNodeChild,a.removeChildFunc=this.removeArrayNodeChild,a.addChildNodeCreatedListener(function(e){Validations.JSExpressionValidatorsEnabled=!1,r.controlRelationsFactory.buildArrayNodeRelations(e),Validations.JSExpressionValidatorsEnabled=!0}),a},e.prototype.createNodeChildren=function(e,n,o,r){var i=this;return e.questions.forEach(function(e){var t=i.createNode(e,n,o,r);n.setChild(e.key,t)}),n.children},e.prototype.createArrayNodeChild=function(e,t,n){null!==n&&n!==undefined||(n=this);var o=new QuestionGroup({key:t.path+"."+t.children.length,type:"group",extras:e.extras,label:"",questions:e.questions});e.controlType===exports.AfeControlType.None&&(o.controlType=e.controlType);var r=n.createGroupNode(o,null,null,t.form);if(t.children.push(r),t.control instanceof AfeFormArray){var i=t.control;i.setControl(i.controls.length,r.control)}return r},e.prototype.removeArrayNodeChild=function(e,t){var n=t.children[e];if(t.children.splice(e,1),(null!==t.control||t.control!==undefined)&&t.control instanceof AfeFormArray){var o=t.control,r=o.controls.indexOf(n.control);0<=r&&o.removeAt(r)}},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[{type:FormControlService},{type:QuestionFactory},{type:ControlRelationsFactory}]},e}(),moment$6=moment_,ObsAdapterHelper=function(){function e(){}return e.prototype.findObsAnswerToQuestion=function(t,e){var n=this,o=[];if(!this.isObsNode(t))return o;if(t instanceof LeafNode||t instanceof GroupNode&&"complex-obs"===t.question.extras.type)return _.each(e,function(e){e.concept&&e.concept.uuid===t.question.extras.questionOptions.concept&&o.push(e)}),o;var r=this.getChildQuestionsConceptUuids(t);return 0<r.length&&_.each(e,function(e){e.concept&&e.concept.uuid===t.question.extras.questionOptions.concept&&Array.isArray(e.groupMembers)&&n.isSubsetOf(r,n.getGroupMembersConceptUuids(e))&&o.push(e)}),o},e.prototype.getChildQuestionsConceptUuids=function(e){var t=[];return e.question.extras&&e.question.extras.questions&&_.each(e.question.extras.questions,function(e){e.questionOptions&&e.questionOptions.concept&&t.push(e.questionOptions.concept)}),t},e.prototype.getGroupMembersConceptUuids=function(e){var t=[];return Array.isArray(e.groupMembers)&&_.each(e.groupMembers,function(e){t.push(e.concept.uuid)}),t},e.prototype.isObsNode=function(e){return e.question.extras&&("obs"===e.question.extras.type||"obsGroup"===e.question.extras.type||"complex-obs"===e.question.extras.type||"complex-obs-child"===e.question.extras.type)},e.prototype.isSubsetOf=function(t,e){return 0===e.length&&0===t.length||e.every(function(e){return 0<=t.indexOf(e)})},e.prototype.setSimpleObsNodeValue=function(e,t){if(e&&0<t.length){var n=t[0];e.initialValue=n,!this.isEmpty(n.value)&&n.value.uuid?this.setNodeFormControlValue(e,n.value.uuid):this.isEmpty(n.value)||this.setNodeFormControlValue(e,n.value)}},e.prototype.setMultiselectObsNodeValue=function(e,t){if(e&&0<t.length){e.initialValue=t;var n=[];try{for(var o=__values(t),r=o.next();!r.done;r=o.next()){var i=r.value;n.push(i.value.uuid)}}catch(l){a={error:l}}finally{try{r&&!r.done&&(s=o["return"])&&s.call(o)}finally{if(a)throw a.error}}this.setNodeFormControlValue(e,n)}var a,s},e.prototype.setComplexObsNodeValue=function(e,t){if(e&&0<t.length){var n=void 0,o=void 0,r=e;for(var i in r.children)"value"===r.children[i].question.extras.questionOptions.obsField&&(n=r.children[i]),"obsDatetime"===r.children[i].question.extras.questionOptions.obsField&&(o=r.children[i]);this.setNodeValue(n,t),e.initialValue=n.initialValue,o.initialValue=n.initialValue,this.setNodeFormControlValue(o,n.initialValue.obsDatetime)}},e.prototype.setGroupObsNodeValue=function(e,t){if(e&&0<t.length){var n=e;for(var o in n.initialValue=t[0],n.children)this.setNodeValue(n.children[o],t[0].groupMembers)}},e.prototype.setRepeatingGroupObsNodeValue=function(e,t){if(e&&0<t.length){var n=e;n.initialValue=t;for(var o=0;o<t.length;o++){var r=n.createChildNode();this.setGroupObsNodeValue(r,[t[o]])}}},e.prototype.setNodeValue=function(e,t){switch(this.getObsNodeType(e)){case"unknown":if(e instanceof GroupNode){var n=e;for(var o in n.children)this.setNodeValue(n.children[o],t);break}if(e instanceof ArrayNode){for(var r=e,i=0;i<r.children.length;i++)this.setNodeValue(r.children[i],t);break}break;case"simple":var a=this.findObsAnswerToQuestion(e,t);this.setSimpleObsNodeValue(e,a);break;case"multiselect":var s=this.findObsAnswerToQuestion(e,t);this.setMultiselectObsNodeValue(e,s);break;case"complex":var l=this.findObsAnswerToQuestion(e,t);this.setComplexObsNodeValue(e,l);break;case"group":var u=this.findObsAnswerToQuestion(e,t);0<u.length&&this.setGroupObsNodeValue(e,u);break;case"repeatingGroup":var c=this.findObsAnswerToQuestion(e,t);0<c.length&&this.setRepeatingGroupObsNodeValue(e,c);break;default:console.error("Unknown obs node",e)}},e.prototype.setNodeFormControlValue=function(e,t){e.control.setValue(t),e.question.enableHistoricalValue&&e.initialValue!==undefined&&e.question.setHistoricalValue(!1)},e.prototype.getObsNodeType=function(e){return this.isObsNode(e)?e instanceof LeafNode&&("multiCheckbox"===e.question.extras.questionOptions.rendering||"checkbox"===e.question.extras.questionOptions.rendering||"multi-select"===e.question.extras.questionOptions.rendering)?"multiselect":e instanceof LeafNode?"simple":e instanceof GroupNode&&"complex-obs"===e.question.extras.type?"complex":e instanceof ArrayNode&&"obsGroup"===e.question.extras.type&&"repeating"===e.question.extras.questionOptions.rendering?"repeatingGroup":e instanceof GroupNode&&"obsGroup"===e.question.extras.type?"group":"unknownObs":"unknown"},e.prototype.getSimpleObsPayload=function(e){if(this.isEmpty(e.control.value))return e.initialValue?{uuid:e.initialValue.uuid,voided:!0}:null;if(e.initialValue&&!this.simpleNodeValueChanged(e))return null;var t={concept:e.question.extras.questionOptions.concept,value:e.control.value};return"date"===e.question.extras.questionOptions.rendering&&(t.value=this.toOpenMrsDateTimeString(e.control.value)),e.initialValue&&(delete t.concept,t.uuid=e.initialValue.uuid),t},e.prototype.getComplexObsPayload=function(e){var t,n,o=e;for(var r in o.children)"value"===o.children[r].question.extras.questionOptions.obsField&&(t=o.children[r]),"obsDatetime"===o.children[r].question.extras.questionOptions.obsField&&(n=o.children[r]);var i=this.getObsNodePayload(t);if(console.log("valuePayload",i),0<i.length)return i[0].obsDatetime=this.toOpenMrsDateTimeString(n.control.value),i[0];if(0!==i.length||!e.initialValue||this.areDatesEqual(e.initialValue.obsDatetime,n.control.value))return null;var a={uuid:e.initialValue.uuid};return a.obsDatetime=this.toOpenMrsDateTimeString(n.control.value),a},e.prototype.getMultiselectObsPayload=function(t){var n=[],o=[];return Array.isArray(t.initialValue)&&_.each(t.initialValue,function(e){o.push(e.value.uuid),Array.isArray(t.control.value)?t.control.value.indexOf(e.value.uuid)<0&&n.push({uuid:e.uuid,voided:!0}):n.push({uuid:e.uuid,voided:!0})}),Array.isArray(t.control.value)&&_.each(t.control.value,function(e){o.indexOf(e)<0&&n.push({concept:t.question.extras.questionOptions.concept,value:e})}),n},e.prototype.getGroupPayload=function(e){var n=this,t=e,o=[];if(_.each(t.children,function(e){var t=n.getObsNodePayload(e);0<t.length&&(o=o.concat(t))}),0===o.length)return null;var r={groupMembers:o};return t.initialValue?r.uuid=t.initialValue.uuid:r.concept=t.question.extras.questionOptions.concept,r},e.prototype.getRepeatingGroupPayload=function(e){var n=this,t=e,o=[],r=[];return _.each(t.children,function(e){var t=n.getObsNodePayload(e);0<t.length&&(o=o.concat(t)),e.initialValue&&e.initialValue.uuid&&r.push(e.initialValue.uuid)}),t.initialValue&&Array.isArray(t.initialValue)&&_.each(t.initialValue,function(e){if(r.indexOf(e.uuid)<0){var t={uuid:e.uuid,voided:!0};o.push(t)}}),o.length<=0?null:o},e.prototype.getObsNodePayload=function(e){var t=[];switch(this.getObsNodeType(e)){case"unknown":if(e instanceof GroupNode){var n=e;for(var o in n.children){var r=this.getObsNodePayload(n.children[o]);Array.isArray(r)&&0<r.length&&(t=t.concat(r))}break}if(e instanceof ArrayNode){for(var i=e,a=0;a<i.children.length;a++){var s=this.getObsNodePayload(i.children[a]);Array.isArray(s)&&0<s.length&&(t=t.concat(s))}break}break;case"simple":var l=this.getSimpleObsPayload(e);null!==l&&t.push(l);break;case"multiselect":var u=this.getMultiselectObsPayload(e);Array.isArray(u)&&0<u.length&&(t=t.concat(u));break;case"complex":var c=this.getComplexObsPayload(e);null!==c&&t.push(c);break;case"group":var p=this.getGroupPayload(e);p&&null!==p&&t.push(p);break;case"repeatingGroup":var d=this.getRepeatingGroupPayload(e);Array.isArray(d)&&0<d.length&&(t=t.concat(d))}return t},e.prototype.simpleNodeValueChanged=function(e){return!!e.initialValue&&(e.initialValue.value&&e.initialValue.value.uuid?e.control.value!==e.initialValue.value.uuid:"date"===e.question.extras.questionOptions.rendering?!this.areDatesEqual(e.control.value,e.initialValue.value):e.control.value!==e.initialValue.value)},e.prototype.areDatesEqual=function(e,t){return moment$6(e).isSame(t)},e.prototype.isEmpty=function(e){return""===e||null===e||e===undefined},e.prototype.toOpenMrsDateTimeString=function(e){if(this.isEmpty(e))return undefined;var t=moment$6(e).format().substring(0,19).replace("T"," ");return this.isEmpty(t)?undefined:t},e}(),ObsValueAdapter=function(){function e(e){this.helper=e}return e.prototype.generateFormPayload=function(e){return this.helper.getObsNodePayload(e.rootNode)},e.prototype.populateForm=function(e,t){this.helper.setNodeValue(e.rootNode,t)},e.prototype.setValues=function(e,n,o){if(e){var t=function(t){if(t instanceof LeafNode)r.setObsValue(t,n),t.question.enableHistoricalValue&&t.initialValue!==undefined&&t.question.setHistoricalValue(!1);else if(t.question&&t.question.extras&&"group"===t.question.renderingType||o){var e=_.find(n,function(e){return e.concept.uuid===t.question.extras.questionOptions.concept&&e.groupMembers});e&&(t.node&&(t.node.initialValue=e),r.setValues(t.groupMembers,e.groupMembers)),o&&t.payload&&r.setValues(t.groupMembers,t.payload.groupMembers)}else if(t instanceof GroupNode&&"complex-obs"===t.question.extras.type)r.setComplexObsValue(t,n);else{if(!t.question||!t.question.extras||"repeating"!==t.question.renderingType||o)throw new Error("not implemented");r.setRepeatingGroupValues(t,n),t.node.control.updateValueAndValidity()}},r=this;try{for(var i=__values(e),a=i.next();!a.done;a=i.next()){t(a.value)}}catch(u){s={error:u}}finally{try{a&&!a.done&&(l=i["return"])&&l.call(i)}finally{if(s)throw s.error}}}var s,l},e.prototype.setObsValue=function(t,e){if(t.question&&t.question.extras&&("obs"===t.question.extras.type||"complex-obs-child"===t.question.extras.type&&"value"===t.question.extras.questionOptions.obsField)&&"multiCheckbox"!==t.question.extras.questionOptions.rendering||"checkbox"!==t.question.extras.questionOptions.rendering||"multi-select"!==t.question.extras.questionOptions.rendering){var n=_.find(e,function(e){return e.concept.uuid===t.question.extras.questionOptions.concept});n&&(n.value instanceof Object?t.control.setValue(n.value.uuid):t.control.setValue(n.value),t.control.updateValueAndValidity(),t.initialValue={obsUuid:n.uuid,value:n.value})}else{var o=_.filter(e,function(e){return e.concept.uuid===t.question.extras.questionOptions.concept});o&&0<o.length&&(t.control.setValue(this.getMultiselectValues(o)),t.control.updateValueAndValidity(),t.initialValue=o)}},e.prototype.setComplexObsValue=function(t,e){var n,o;for(var r in t.children)"value"===t.children[r].question.extras.questionOptions.obsField&&(n=t.children[r]),"obsDatetime"===t.children[r].question.extras.questionOptions.obsField&&(o=t.children[r]);this.setObsValue(n,e);var i=_.find(e,function(e){return e.concept.uuid===t.question.extras.questionOptions.concept});i&&(o.initialValue={obsUuid:i.uuid,value:i.obsDatetime},o.control.setValue(i.obsDatetime),o.control.updateValueAndValidity())},e.prototype.getMultiselectValues=function(e){var t,n,o=[];try{for(var r=__values(e),i=r.next();!i.done;i=r.next()){var a=i.value;o.push(a.value.uuid)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return o},e.prototype.setRepeatingGroupValues=function(i,e){var o=_.filter(e,function(e){var t=e.concept.uuid===i.question.extras.questionOptions.concept,n=!1;if(t&&e.groupMembers){var o=e.groupMembers.map(function(e){return e.concept.uuid}),r=i.question.questions.map(function(e){return e.extras.questionOptions.concept});n=0<_.intersection(o,r).length}return t&&n});if(0<o.length){i.node.initialValue=o;for(var t=0;t<o.length;t++)i.node.createChildNode()}var n,r,a=[],s=0,l=function(t){var e=Object.keys(t.children).map(function(e){return t.children[e]}),n=o[s];a.push({question:i.question,groupMembers:e,payload:n}),s++};try{for(var u=__values(i.node.children),c=u.next();!c.done;c=u.next()){l(c.value)}}catch(p){n={error:p}}finally{try{c&&!c.done&&(r=u["return"])&&r.call(u)}finally{if(n)throw n.error}}this.setValues(a,o,!0)},e.prototype.getQuestionNodes=function(e){var t,n,o,r,i=[];try{for(var a=__values(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var u=__values(l.page),c=u.next();!c.done;c=u.next()){var p=c.value;i.push(p.section)}}catch(d){o={error:d}}finally{try{c&&!c.done&&(r=u["return"])&&r.call(u)}finally{if(o)throw o.error}}}}catch(h){t={error:h}}finally{try{s&&!s.done&&(n=a["return"])&&n.call(a)}finally{if(t)throw t.error}}return[].concat.apply([],i)},e.prototype.repeatingGroup=function(e){var t,n,o=[];try{for(var r=__values(e),i=r.next();!i.done;i=r.next()){var a=i.value;o.push({question:a.question,groupMembers:this.traverse(a)})}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return o},e.prototype.processGroup=function(e,t){if(e.question&&e.question.extras&&"group"===e.question.extras.questionOptions.rendering){var n=_.filter(this.getObsPayload(e.groupMembers),function(e){return""!==e.value}),o=n.map(function(e){return e.voided});0<n.length&&o.every(Boolean)?t.push({uuid:e.node.initialValue.uuid,voided:!0}):0<n.length&&(e.node.initialValue?t.push({uuid:e.node.initialValue.uuid,groupMembers:n}):t.push({concept:e.question.extras.questionOptions.concept,groupMembers:n}))}},e.prototype.mapInitialGroup=function(e){var t,n,o={};try{for(var r=__values(e.groupMembers),i=r.next();!i.done;i=r.next()){var a=i.value,s="";a.value instanceof Object?s=a.value.uuid:a.value?s=a.value:a.groupMembers&&0<a.groupMembers.length&&(o=this.mapInitialGroup(e)),o[a.concept.uuid+":"+s]=s}}catch(l){t={error:l}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return o},e.prototype.mapModelGroup=function(e,t){var n={};for(var o in t)if(t.hasOwnProperty(o)){var r=_.find(e.question.questions,{key:o}),i=t[o];i instanceof Object||""!==i&&(n[r.extras.questionOptions.concept+":"+i]=i)}return n},e.prototype.processRepeatingGroups=function(e,t){var n=[];if(e.node.initialValue)try{for(var o=__values(e.node.initialValue),r=o.next();!r.done;r=o.next()){var i=r.value;n.push({uuid:i.uuid,value:this.mapInitialGroup(i)})}}catch(D){c={error:D}}finally{try{r&&!r.done&&(p=o["return"])&&p.call(o)}finally{if(c)throw c.error}}var a=[];try{for(var s=__values(e.node.control.value),l=s.next();!l.done;l=s.next()){var u=l.value;a.push({value:this.mapModelGroup(e,u)})}}catch(E){d={error:E}}finally{try{l&&!l.done&&(h=s["return"])&&h.call(s)}finally{if(d)throw d.error}}var c,p,d,h,f,y,m,g,v=this.leftOuterJoinArrays(n,a),b=this.leftOuterJoinArrays(a,n),x=e.question.extras.questionOptions.concept,w=[];if(0<v.length){var C=this.createGroupDeletedObs(v);try{for(var k=__values(C),S=k.next();!S.done;S=k.next()){var O=S.value;t.push(O)}}catch(T){f={error:T}}finally{try{S&&!S.done&&(y=k["return"])&&y.call(k)}finally{if(f)throw f.error}}0<b.length&&(w=this.createGroupNewObs(b,x))}else w=this.createGroupNewObs(b,x);if(0<w.length)try{for(var q=__values(w),A=q.next();!A.done;A=q.next()){var _=A.value;t.push(_)}}catch(V){m={error:V}}finally{try{A&&!A.done&&(g=q["return"])&&g.call(q)}finally{if(m)throw m.error}}},e.prototype.leftOuterJoinArrays=function(e,n){return e.filter(function(t){return!n.some(function(e){return _.isEqual(t.value,e.value)})})},e.prototype.createGroupNewObs=function(e,t){var n,o,r=[];try{for(var i=__values(e),a=i.next();!a.done;a=i.next()){var s=a.value,l=[];for(var u in s.value){var c=u.split(":")[0],p=u.split(":")[1];l.push({concept:c,value:p})}r.push({concept:t,groupMembers:l})}}catch(d){n={error:d}}finally{try{a&&!a.done&&(o=i["return"])&&o.call(i)}finally{if(n)throw n.error}}return r},e.prototype.createGroupDeletedObs=function(e){var t,n,o=[];try{for(var r=__values(e),i=r.next();!i.done;i=r.next()){var a=i.value;o.push({uuid:a.uuid,voided:!0})}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return o},e.prototype.getExactTime=function(e){return e.substring(0,19).replace("T"," ")},e.prototype.processObs=function(e,t){if(e.control&&e.question.extras){var n={concept:e.question.extras.questionOptions.concept,value:"date"!==e.question.extras.questionOptions.rendering||this.isEmpty(e.control.value)?e.control.value:this.getExactTime(e.control.value)};if("multiCheckbox"===e.question.extras.questionOptions.rendering||"checkbox"===e.question.extras.questionOptions.rendering||"multi-select"===e.question.extras.questionOptions.rendering){var o=this.processMultiSelect(e.question.extras.questionOptions.concept,e.control.value);if(e.initialValue){var r=e.initialValue.map(function(e){return{uuid:e.uuid,value:{concept:e.concept.uuid,value:e.value.uuid}}}),i=o.map(function(e){return{value:e}}),a=this.leftOuterJoinArrays(r,i),s=this.leftOuterJoinArrays(i,r);this.processDeletedMultiSelectObs(a,t),this.processNewMultiSelectObs(s,t)}else this.processNewMultiSelectObs(o,t)}else e.initialValue&&e.initialValue.value&&n?this.updateOrVoidObs(n,e.initialValue,t):""!==n.value&&null!==n.value&&t.push(n)}},e.prototype.processComplexObs=function(e,t){var n,o;for(var r in e.children)"value"===e.children[r].question.extras.questionOptions.obsField&&(n=e.children[r]),"obsDatetime"===e.children[r].question.extras.questionOptions.obsField&&(o=e.children[r]);if(n){this.processObs(n,t);var i=0<t.length?t[t.length-1]:undefined;i&&(i.concept&&i.concept===e.question.extras.questionOptions.concept||n.initialValue&&i.uuid===n.initialValue.obsUuid)&&o.initialValue&&o.control.value!==o.initialValue.value&&(i.obsDatetime=o.control.value)}},e.prototype.processDeletedMultiSelectObs=function(e,t){try{for(var n=__values(e),o=n.next();!o.done;o=n.next()){var r=o.value;t.push({uuid:r.uuid,voided:!0})}}catch(s){i={error:s}}finally{try{o&&!o.done&&(a=n["return"])&&a.call(n)}finally{if(i)throw i.error}}var i,a},e.prototype.processNewMultiSelectObs=function(e,t){try{for(var n=__values(e),o=n.next();!o.done;o=n.next()){var r=o.value;r.value instanceof Object?t.push(r.value):t.push(r)}}catch(s){i={error:s}}finally{try{o&&!o.done&&(a=n["return"])&&a.call(n)}finally{if(i)throw i.error}}var i,a},e.prototype.updateOrVoidObs=function(e,t,n){this.isEmpty(e.value)&&t.value?n.push({uuid:t.obsUuid,voided:!0}):!this.isEmpty(e.value)&&t.value&&n.push({uuid:t.obsUuid,value:e.value})},e.prototype.isEmpty=function(e){return""===e||null===e||e===undefined},e.prototype.traverse=function(e,t){var n=[];if(e.children){if(e.children instanceof Array)return this.repeatingGroup(e.children);if(e.children instanceof Object)for(var o in e.children)if(e.children.hasOwnProperty(o))switch(e.children[o].question.renderingType){case"page":var r=this.traverse(e.children[o]);n.push({page:r,label:e.children[o].question.label});break;case"section":var i=this.traverse(e.children[o]);n.push({section:i,node:e.children[o],label:e.children[o].question.label});break;case"group":var a=this.traverse(e.children[o]);n.push({node:e.children[o],question:e.children[o].question,groupMembers:a});break;case"repeating":var s=this.repeatingGroup(e.children[o].children);n.push({node:e.children[o],question:e.children[o].question,groupMembers:s});break;default:n.push(e.children[o])}}return n},e.prototype.processMultiSelect=function(e,t){var n,o,r=[];if(t&&null!==t)try{for(var i=__values(t),a=i.next();!a.done;a=i.next()){var s={concept:e,value:a.value};r.push(s)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(o=i["return"])&&o.call(i)}finally{if(n)throw n.error}}return r},e.prototype.isObs=function(e){return"obs"===e.question.extras.type||"obsGroup"===e.question.extras.type||"complex-obs"===e.question.extras.type},e.prototype.getObsPayload=function(e){var t,n,o=[];try{for(var r=__values(e),i=r.next();!i.done;i=r.next()){var a=i.value;this.isObs(a)&&(a.groupMembers,"group"===a.question.extras.questionOptions.rendering?this.processGroup(a,o):(a.groupMembers,"repeating"===a.question.extras.questionOptions.rendering?this.processRepeatingGroups(a,o):a instanceof GroupNode&&"complex-obs"===a.question.extras.type?this.processComplexObs(a,o):this.processObs(a,o)))}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return o},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[{type:ObsAdapterHelper}]},e}(),OrderValueAdapter=function(){function e(){this.formOrderNodes=[],this.provider=""}return e.prototype.generateFormPayload=function(e){return this.formOrderNodes=[],this._setOrderProvider(e),this._findTestOrderQuestionNodes(e.rootNode),this._createOrdersPayload(this.formOrderNodes,e)},e.prototype.populateForm=function(e,t){e.existingOrders=t,this.formOrderNodes=[],this._findTestOrderQuestionNodes(e.rootNode);var n=this._getExistingOrders(e);this._setOrderValues(this.formOrderNodes,n)},e.prototype._setOrderProvider=function(e){e.valueProcessingInfo.providerUuid&&(this.provider=e.valueProcessingInfo.providerUuid)},e.prototype._createOrdersPayload=function(e,t){var n,o,r,a=[],s=[],l=this._getExistingOrders(t),i=function(e){var t=e.control.value,n=[];for(var o in l&&l.map(function(e){n[e.concept]=e.concept}),t)if(t.hasOwnProperty(o)){var r=t[o][e.question.key],i=u._createPayloadOrder(r,e.question.extras);n[r]!==r&&""!==i.concept&&a.push(i),s[r]=r,""===i.orderNumber&&delete i.orderNumber,""===i.uuid&&delete i.uuid}},u=this;try{for(var c=__values(e),p=c.next();!p.done;p=c.next()){i(p.value)}}catch(d){o={error:d}}finally{try{p&&!p.done&&(r=c["return"])&&r.call(c)}finally{if(o)throw o.error}}return n=this._getDeletedOrders(s,l),this._addDeletedOrdersToPayload(n,a)},e.prototype._getExistingOrders=function(e){if(e.existingOrders&&e.existingOrders.orders){var t=e.existingOrders.orders.map(function(e){return{concept:e.concept.uuid,orderNumber:e.orderNumber,orderUuid:e.uuid,voided:e.voided,dateVoided:e.auditInfo.dateVoided}});return _.filter(t,function(e){return!0!==e.voided&&!e.dateVoided})}},e.prototype._setOrderValues=function(e,t){this._findTestOrderQuestionNodes(e);var n,o,r=this.formOrderNodes;try{for(var i=__values(r),a=i.next();!a.done;a=i.next()){var s=a.value;this._setOrderNodeValues(s,t)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(o=i["return"])&&o.call(i)}finally{if(n)throw n.error}}},e.prototype._addDeletedOrdersToPayload=function(e,t){for(var n in e)e.hasOwnProperty(n)&&t.push({uuid:e[n],voided:!0});return t},e.prototype._createPayloadOrder=function(e,t){var n={concept:"",type:"",orderer:"",careSetting:""};return n.concept=e,n.type=t.questionOptions.orderType,n.orderer=this.provider,n.careSetting=t.questionOptions.orderSettingUuid,""===n.orderer&&delete n.orderer,n},e.prototype._getDeletedOrders=function(e,t){var n=[];if(e)for(var o in t)if(t.hasOwnProperty(o)){var r=t[o].concept;e[r]!==r&&n.push(t[o].orderUuid)}return n},e.prototype._setOrderNodeValues=function(e,t){var n,o,r=0;e.initialValue=t;try{for(var i=__values(t),a=i.next();!a.done;a=i.next()){var s=a.value;e.createChildNode();var l={};l[e.question.key]=s.concept;var u=e.children[r];u.control.setValue(l),u.initialValue=l,u.orderNumber=s.orderNumber,r++}}catch(c){n={error:c}}finally{try{a&&!a.done&&(o=i["return"])&&o.call(i)}finally{if(n)throw n.error}}},e.prototype._findTestOrderQuestionNodes=function(e){if(e.children&&e.children instanceof Object)for(var t in e.children)if(e.children.hasOwnProperty(t))switch(e.children[t].question.renderingType){case"page":case"section":case"group":this._findTestOrderQuestionNodes(e.children[t]);break;case"repeating":if(e.children)for(var n in e.children){var o=e.children[n].question;o.extras&&"testOrder"===o.extras.type&&this.formOrderNodes.push(e.children[n])}}},e.decorators=[{type:i0.Injectable}],e}(),moment$7=moment_,EncounterAdapter=function(){function e(e,t){this.ordersAdapter=e,this.obsAdapter=t}return e.prototype.populateForm=function(e,t){this.populateNode(e.rootNode,t),Array.isArray(t.orders)&&this.ordersAdapter.populateForm(e,t),Array.isArray(t.obs)&&this.obsAdapter.populateForm(e,t.obs)},e.prototype.populateNode=function(e,n){if(n===undefined||null===n)throw new Error("Expected payload");this.getEncounterNodes(e).forEach(function(e){switch(e.question.extras.type){case"encounterDatetime":n.encounterDatetime&&(e.control.setValue(moment$7(n.encounterDatetime).toDate()),e.initialValue=moment$7(n.encounterDatetime).toDate());break;case"encounterProvider":if(Array.isArray(n.encounterProviders)&&0<n.encounterProviders.length){var t=n.encounterProviders[0].provider;t&&t.uuid&&(e.control.setValue(t.uuid),setTimeout(function(){e.control.setValue(t.uuid)}),e.initialValue=t.uuid)}break;case"encounterLocation":n.location&&n.location.uuid&&(e.control.setValue(n.location.uuid),e.initialValue=n.location.uuid)}})},e.prototype.generateFormPayload=function(e){var t=this.generateNodePayload(e.rootNode);return this.setNonFilledPayloadMembers(e,t),t.obs=this.obsAdapter.generateFormPayload(e)||[],t.orders=this.ordersAdapter.generateFormPayload(e)||[],t},e.prototype.generateNodePayload=function(o){var e=this.getEncounterNodes(o),r={};return e.forEach(function(e){if(null!==e.control.value&&e.control.value!==undefined&&""!==e.control.value)switch(e.question.extras.type){case"encounterDatetime":var t=moment$7(e.control.value).utcOffset(o.form.valueProcessingInfo.utcOffset||"+0300");r.encounterDatetime=t.format("YYYY-MM-DD HH:mm:ss");break;case"encounterProvider":if(e.control.value&&""!==e.control.value){var n=[];n.push({provider:e.control.value,encounterRole:"a0b03050-c99b-11e0-9572-0800200c9a66"}),r.encounterProviders=n}break;case"encounterLocation":r.location=e.control.value}}),r},e.prototype.getEncounterNodes=function(e){var t=[];return this._getEncounterNodes(e,t),t},e.prototype.setNonFilledPayloadMembers=function(e,t){e.valueProcessingInfo.patientUuid&&this.setPayloadPatientUuid(t,e.valueProcessingInfo.patientUuid),e.valueProcessingInfo.visitUuid&&this.setPayloadVisitUuid(t,e.valueProcessingInfo.visitUuid),e.valueProcessingInfo.encounterTypeUuid&&this.setPayloadEncounterTypeUuid(t,e.valueProcessingInfo.encounterTypeUuid),e.valueProcessingInfo.formUuid&&this.setPayloadFormUuid(t,e.valueProcessingInfo.formUuid),e.valueProcessingInfo.encounterUuid&&this.setPayloadEncounterUuid(t,e.valueProcessingInfo.encounterUuid)},e.prototype.setPayloadPatientUuid=function(e,t){e.patient=t},e.prototype.setPayloadVisitUuid=function(e,t){e.visit=t},e.prototype.setPayloadEncounterTypeUuid=function(e,t){e.encounterType=t},e.prototype.setPayloadFormUuid=function(e,t){e.form=t},e.prototype.setPayloadEncounterUuid=function(e,t){e.uuid=t},e.prototype._getEncounterNodes=function(e,t){var n=this;if(this._isEncounterNode(e)&&t.push(e),e instanceof GroupNode){var o=e;for(var r in o.children)o.children[r]instanceof NodeBase&&this._getEncounterNodes(o.children[r],t)}e instanceof ArrayNode&&(o=e).children.forEach(function(e){n._getEncounterNodes(e,t)})},e.prototype._isEncounterNode=function(e){return!(!e.question.extras||"encounterDatetime"!==e.question.extras.type&&"encounterProvider"!==e.question.extras.type&&"encounterLocation"!==e.question.extras.type)},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[{type:OrderValueAdapter},{type:ObsValueAdapter}]},e}(),PersonAttribuAdapter=function(){function e(){}return e.prototype.generateFormPayload=function(e){return this.generateNodePayload(e.rootNode)},e.prototype.generateNodePayload=function(e){var t=this.getPersonAttributeNodes(e),n=[];return t.forEach(function(e){null!==e.control.value&&e.control.value!==undefined&&""!==e.control.value&&e.initialValue!==e.control.value&&(!0===e.question.extras.questionOptions.isSimpleValue?n.push({attributeType:e.question.extras.questionOptions.attributeType,value:e.control.value}):n.push({attributeType:e.question.extras.questionOptions.attributeType,hydratedObject:e.control.value}))}),n},e.prototype.populateForm=function(e,t){this.populateNode(e.rootNode,t)},e.prototype.populateNode=function(e,n){if(!Array.isArray(n))throw new Error("Expected an array of attributes");this.getPersonAttributeNodes(e).forEach(function(t){n.forEach(function(e){e.attributeType.uuid===t.question.extras.questionOptions.attributeType&&(e.value.uuid?(t.control.setValue(e.value.uuid),t.initialValue=e.value.uuid):(t.control.setValue(e.value),t.initialValue=e.value))})})},e.prototype.getPersonAttributeNodes=function(e){var t=[];return this._getPersonAttributesNodes(e,t),t},e.prototype._getPersonAttributesNodes=function(e,t){var n=this;if(!e.question.extras||"personAttribute"!==e.question.extras.type&&"amrsLocations"!==e.question.extras.type&&"nonAmrsLocations"!==e.question.extras.type&&"siblingLocations"!==e.question.extras.type||t.push(e),e instanceof GroupNode){var o=e;for(var r in o.children)o.children[r]instanceof NodeBase&&this._getPersonAttributesNodes(o.children[r],t)}e instanceof ArrayNode&&(o=e).children.forEach(function(e){n._getPersonAttributesNodes(e,t)})},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),RemoteSelectComponent=function(){function e(e){this.renderer=e,this.placeholder="Search...",this.items=[],this.value=[],this.loading=!1,this.searchText="",this.notFoundMsg="match no found",this.done=new i0.EventEmitter,this.characters=[],this.propagateChange=function(e){}}return Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource=e,this._dataSource&&this._dataSource.dataFromSourceChanged&&this.subscribeToDataSourceDataChanges()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.subscribeToDataSourceDataChanges=function(){var t=this;this._dataSource.dataFromSourceChanged.subscribe(function(e){0<e.length?(t.items=e,t.notFoundMsg="",t.restoreSelectedValue(t.selectC.value,e)):(t.notFoundMsg="Not found",t.items=[])})},e.prototype.typed=function(e){this.search(e)},e.prototype.search=function(e){var n=this;this.dataSource&&(this.searchText=e,this.notFoundMsg="Loading.........",this.dataSource.searchOptions(e).subscribe(function(e){if(0<e.length){var t=_.map(n.value,_.clone).concat(e);n.items=_.uniqBy(t,"value")}n.notFoundMsg=""},function(e){n.notFoundMsg="Errored"}))},e.prototype.restoreSelectedValue=function(t,e){var n=this,o=!1;_.each(e,function(e){e.value===t&&(setTimeout(function(){n.selectC.select(t),n.selectC.value=t}),o=!0)}),o||setTimeout(function(){n.selectC.select(""),n.selectC.value=""})},e.prototype.canSearch=function(e){return(2<=e.length-this.searchText.length||e.length-this.searchText.length<=2&&""!==e)&&!1===this.loading},e.prototype.writeValue=function(e){var t=this;e&&""!==e&&this.dataSource&&(this.loading=!0,this.dataSource.resolveSelectedValue(e).subscribe(function(e){t.items=[e],setTimeout(function(){t.selectC.select(e.value),t.selectC.value=e.value}),t.loading=!1},function(e){t.loading=!1}))},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(){},e.prototype.onChange=function(e){this.propagateChange(e.id)},e.prototype.removed=function(e){console.log("Removed"),this.propagateChange("")},e.prototype.selected=function(e){this.propagateChange(e.value)},e.decorators=[{type:i0.Component,args:[{selector:"remote-select",template:'<div>\n <ng-select\n [id]="componentID"\n [noFilter]="0"\n (selected)="selected($event)"\n (deselected)="removed($event)"\n [options]="items"\n [allowClear]="true"\n [placeholder]="placeholder"\n [notFoundMsg]="notFoundMsg"\n (typed)="typed($event)"\n tabindex="0"\n >\n </ng-select>\n <div *ngIf="loading">resolving....</div>\n</div>\n',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:i0.Renderer2}]},e.propDecorators={placeholder:[{type:i0.Input}],componentID:[{type:i0.Input}],done:[{type:i0.Output}],selectC:[{type:i0.ViewChild,args:[SelectComponent]}],dataSource:[{type:i0.Input}]},e}(),RemoteSelectModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{imports:[common.CommonModule,SelectModule,forms.FormsModule],exports:[RemoteSelectComponent],declarations:[RemoteSelectComponent],providers:[]}]}],e}(),moment$8=moment_,AppointmentsOverviewComponent=function(){function e(){this.showAppointments=!1,this.loadingAppointments=!1,this.errorLoadingAppointments=!1,this.appointmentsLoaded=!1,this.appointments=[],this.today=""}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(){var s=this;this.node.control.valueChanges.subscribe(function(a){s.resetProperties();var e=s.node;if(e.question.extras.questionOptions.concept&&("a8a666ba-1350-11df-a1f1-0026b9348838"===e.question.extras.questionOptions.concept||"a89d2398-1350-11df-a1f1-0026b9348838"===e.question.extras.questionOptions.concept)&&!s.showAppointments){s.loadingAppointments=!0,s.showAppointments=!0;var t=void 0;e.form&&e.form.dataSourcesContainer.dataSources&&(t=e.form.dataSourcesContainer.dataSources.monthlyScheduleResourceService);var n=e.form.dataSourcesContainer.dataSources.userLocation.uuid;if(t&&n){var o=moment$8(a).startOf("week").add(1,"day").format("YYYY-MM-DD"),r=moment$8(a).endOf("week").subtract(1,"day").format("YYYY-MM-DD");s.today=moment$8(a).format("DD-MM-YYYY"),t.getMonthlySchedule({startDate:o,endDate:r,limit:5,locationUuids:n,department:"HIV",groupBy:"groupByPerson,groupByAttendedDate,groupByRtcDate"}).subscribe(function(e){for(var o=[],t=new Map,n=0;n<5;n++){var r=moment$8(a).startOf("week").add(n,"day").format("YYYY-MM-DD"),i={date:r,count:{scheduled:0}};t.set(r,i)}(e.results||[]).forEach(function(e){t.set(e.date,e)}),t.forEach(function(e,t){var n={date:t,count:e.count.scheduled||0};o.push(n)}),s.appointmentsLoaded=!0,s.loadingAppointments=!1,s.appointments=o},function(e){s.loadingAppointments=!1,s.errorLoadingAppointments=!0,s.showAppointments=!1,console.error(e)})}else s.showAppointments=!1,s.errorLoadingAppointments=!0}})},e.prototype.resetProperties=function(){this.loadingAppointments=!1,this.appointmentsLoaded=!1,this.errorLoadingAppointments=!1,this.showAppointments=!1,this.appointments=[],this.today=""},e.decorators=[{type:i0.Component,args:[{selector:"appointments-overview",template:'<div *ngIf="showAppointments" class="appointments">\n <p *ngIf="loadingAppointments">\n <span *ngIf="!appointmentsLoaded && errorLoadingAppointments"\n >Error checking appointments</span\n >\n <span *ngIf="loadingAppointments"\n ><span class="fa fa-spinner fa-spin"></span>Checking appointments...</span\n >\n </p>\n <div *ngIf="appointmentsLoaded && !errorLoadingAppointments">\n <table\n *ngIf="appointments.length > 0"\n class="table table-stripped table-bordered"\n >\n <thead>\n <tr>\n <th\n *ngFor="let appointment of appointments"\n [ngClass]="{ active: appointment.date === today }"\n >\n <span>{{ appointment.date }}</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td\n *ngFor="let appointment of appointments"\n [ngClass]="{ active: appointment.date === today }"\n >\n <span\n ><strong\n ><em>{{ appointment.count }}</em></strong\n ></span\n >\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n',styles:[".appointments{margin-top:12px;font-size:12px;color:#999}.appointments p{padding-top:12px}.appointments th{border-bottom:0!important;color:#333}.appointments td span,.appointments th span{display:block}.appointments td.active,.appointments th.active{background-color:#3c8dbc;color:#fff!important;padding:0}.appointments td.active span,.appointments th.active span{padding:4px}.appointments span.fa{display:inline-block;margin-right:7px}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={node:[{type:i0.Input}]},e}(),EncounterViewerService=function(){function e(){}return e.prototype.resolveSelectedValue=function(e){},e.prototype.searchOptions=function(e){},e.prototype.fileUpload=function(e){},e.prototype.fetchFile=function(e){},e.prototype.resolveSelectedValueFromSchema=function(n,e){var o,r=this;return e.pages&&_.forEach(e.pages,function(e){var t=r.resolveSelectedValueFromSchema(n,e);t&&(o=t)}),e.sections&&_.forEach(e.sections,function(e){var t=r.resolveSelectedValueFromSchema(n,e);t&&(o=t)}),e.questions&&_.forEach(e.questions,function(e){if(e.questions){var t=r.resolveSelectedValueFromSchema(n,e);t&&(o=t)}else e.questionOptions.answers?_.forEach(e.questionOptions.answers,function(e){e.concept===n&&(o=e.label)}):e.questionOptions.selectableOrders&&_.forEach(e.questionOptions.selectableOrders,function(e){e.concept===n&&(o=e.label)})}),o},e.prototype.hasAnswer=function(e){var t=!1;return e.initialValue&&(t=!0),t},e.prototype.questionsAnswered=function(e,t){var n=this,o=t||[];if("page"===e.question.renderingType)_.forEach(e.children,function(e){n.questionsAnswered(e,o)});else{if("section"!==e.question.renderingType)return this.hasAnswer(e);_.forEach(e.children,function(e){"group"===e.question.renderingType?_.forEach(e.children,function(e){var t=n.questionsAnswered(e,o);t&&o.push(t)}):n.hasAnswer(e)&&o.push(!0)})}return 0<o.length},e.prototype.isDate=function(e){return!!Date.parse(e)},e.prototype.convertTime=function(e){var t=new Date(e),n=t.getFullYear(),o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],r=t.getDate(),i=t.getHours(),a=t.getMinutes();t.getSeconds();return 0===i&&0===a?r+" "+o+" "+n:r+" "+o+" "+n+" "+i+":"+a+(i<12?"AM":"PM")+" (EAT)"},e.decorators=[{type:i0.Injectable}],e.ctorParameters=function(){return[]},e}(),EncounterViewerComponent=function(){function e(e,t){this.encounterViewerService=e,this.dataSources=t}return Object.defineProperty(e.prototype,"node",{set:function(e){this.rootNode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{set:function(e){this._schema=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"encounter",{set:function(e){this.enc=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"form",{set:function(e){this.rootNode=e.rootNode,this._schema=e.schema,console.log(this.getQuestionNodes(this.traverse(this.rootNode)))},enumerable:!0,configurable:!0}),e.prototype.getQuestionNodes=function(e){var t,n,o=[];try{for(var r=__values(e),i=r.next();!i.done;i=r.next()){var a=i.value;o.push(a.page)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return[].concat.apply([],o)},e.prototype.ngOnInit=function(){this.rootNode,this.rootNode&&this.rootNode.question.extras&&"file"===this.rootNode.question.renderingType?this.fileDataSource=this.dataSources.dataSources[this.rootNode.question.dataSource]:this.rootNode&&this.rootNode.question.extras&&"remote-select"===this.rootNode.question.renderingType?this.remoteDataSource=this.dataSources.dataSources[this.rootNode.question.dataSource]:this.customDataSource=this.encounterViewerService},e.prototype.questionsAnswered=function(e){return this.encounterViewerService.questionsAnswered(e)},e.prototype.questionAnswered=function(e){return this.encounterViewerService.hasAnswer(e)},e.prototype.checkForColon=function(e){return-1===e.indexOf(":")},e.prototype.traverse=function(e,t){var n=[];if(e.children){if(e.children instanceof Array)return this.repeatingGroup(e.children);if(e.children instanceof Object){for(var o in e.children)if(e.children.hasOwnProperty(o))switch(e.children[o].question.renderingType){case"page":var r=this.traverse(e.children[o]);n.push({page:r});break;case"section":var i=this.traverse(e.children[o]);n.push({section:i});break;case"group":var a=this.traverse(e.children[o]);n.push({node:e.children[o],question:e.children[o].question,groupMembers:a});break;case"repeating":var s=this.repeatingGroup(e.children[o].children);n.push({node:e.children[o],question:e.children[o].question,groupMembers:s});break;default:n.push(e.children[o])}}else console.log("Console.log",e)}return n},e.prototype.repeatingGroup=function(e){var t,n,o=[];try{for(var r=__values(e),i=r.next();!i.done;i=r.next()){var a=i.value;o.push({question:a.question,groupMembers:this.traverse(a)})}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return o},e.decorators=[{type:i0.Component,args:[{selector:"encounter-viewer",template:'<div class="viewer">\n <div *ngIf="rootNode.question.renderingType === \'form\'" class="form">\n <div *ngFor="let question of rootNode.question.questions; let i = index">\n <div *ngIf="questionsAnswered(rootNode.children[question.key])">\n <div [attr.id]="\'page\' + i" class="panel panel-default">\n <p class="page-label panel-heading text-primary">\n {{ question.label }}\n </p>\n <div class="panel-body">\n <encounter-viewer\n [node]="rootNode.children[question.key]"\n [schema]="_schema"\n [parentComponent]="this"\n [parentGroup]="rootNode.control"\n ></encounter-viewer>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngIf="rootNode.question.renderingType === \'page\'" class="page">\n <encounter-viewer\n *ngFor="let question of rootNode.question.questions"\n [parentComponent]="this"\n [node]="rootNode.children[question.key]"\n [schema]="_schema"\n [parentGroup]="parentGroup"\n ></encounter-viewer>\n </div>\n\n <div\n *ngIf="\n rootNode.question.renderingType === \'section\' &&\n questionsAnswered(rootNode)\n "\n class="section"\n >\n <div class="panel panel-primary">\n <p class="panel-heading section-label">{{ rootNode.question.label }}</p>\n </div>\n <div *ngFor="let question of rootNode.question.questions">\n <encounter-viewer\n [node]="rootNode.children[question.key]"\n [parentComponent]="this"\n [schema]="_schema"\n [parentGroup]="parentGroup"\n ></encounter-viewer>\n </div>\n </div>\n\n \x3c!--Leaf Controls--\x3e\n <div style="margin-left: 10px">\n <form *ngIf="rootNode.question.controlType === 0" [formGroup]="parentGroup">\n <div *ngIf="rootNode.control.value">\n <div class="question-answer">\n <label\n *ngIf="rootNode.question.label"\n [attr.for]="rootNode.question.key"\n style="font-weight: 400"\n >\n {{ rootNode.question.label }}\n </label>\n <span *ngIf="checkForColon(rootNode.question.label)">:</span>\n <div\n [ngSwitch]="rootNode.question.renderingType"\n style="display: inline-block; font-weight: bold"\n >\n <div *ngSwitchCase="\'file\'">\n <file-preview\n [formControlName]="rootNode.question.key"\n [id]="rootNode.question.key + \'id\'"\n [dataSource]="fileDataSource"\n ></file-preview>\n </div>\n <div *ngSwitchCase="\'remote-select\'">\n <remote-answer\n [formControlName]="rootNode.question.key"\n [id]="rootNode.question.key + \'id\'"\n [dataSource]="remoteDataSource"\n ></remote-answer>\n </div>\n <div *ngSwitchDefault style="display: inline-block">\n <question-control\n [schema]="_schema"\n [value]="rootNode.control.value"\n [dataSource]="customDataSource"\n ></question-control>\n </div>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n \x3c!--Array Controls--\x3e\n <div\n *ngIf="rootNode.question.controlType === 1 && questionsAnswered(rootNode)"\n >\n <div [ngSwitch]="rootNode.question.renderingType">\n <div *ngSwitchCase="\'repeating\'">\n <div [ngSwitch]="rootNode.question.extras.type">\n <div *ngSwitchCase="\'testOrder\'">\n <label>{{ rootNode.question.label }}:</label>\n <div *ngFor="let child of rootNode.children; let i = index">\n <encounter-viewer\n *ngFor="let question of child.question.questions"\n [parentComponent]="this"\n [node]="child.children[question.key]"\n [parentGroup]="child.control"\n [schema]="_schema"\n ></encounter-viewer>\n </div>\n </div>\n\n <div *ngSwitchCase="\'obsGroup\'">\n <div *ngFor="let child of rootNode.children; let i = index">\n <encounter-viewer\n *ngFor="let question of child.question.questions"\n [parentComponent]="this"\n [node]="child.children[question.key]"\n [parentGroup]="child.control"\n [schema]="_schema"\n ></encounter-viewer>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngIf="rootNode.question.controlType === 2">\n \x3c!--GROUP--\x3e\n <div [ngSwitch]="rootNode.question.renderingType">\n <div *ngSwitchCase="\'group\'">\n <encounter-viewer\n *ngFor="let question of rootNode.question.questions"\n [parentComponent]="this"\n [node]="rootNode.children[question.key]"\n [parentGroup]="rootNode.control"\n [schema]="_schema"\n ></encounter-viewer>\n </div>\n <div *ngSwitchCase="\'field-set\'">\n <encounter-viewer\n *ngFor="let question of rootNode.question.questions"\n [parentComponent]="this"\n [node]="rootNode.children[question.key]"\n [parentGroup]="rootNode.control"\n [schema]="_schema"\n ></encounter-viewer>\n </div>\n </div>\n </div>\n</div>\n',styles:[".page-label{font-size:20px;font-weight:700}.section-label{font-size:18px;font-weight:500}.panel-primary{border:none!important}.question-answer{font-size:16px}.panel{margin-bottom:5px}div.section{margin-bottom:15px!important}.line-breaker{white-space:pre-line}hr{margin:10px}"]}]}],e.ctorParameters=function(){return[{type:EncounterViewerService},{type:DataSources}]},e.propDecorators={parentGroup:[{type:i0.Input}],parentComponent:[{type:i0.Input}],node:[{type:i0.Input}],schema:[{type:i0.Input}],encounter:[{type:i0.Input}],form:[{type:i0.Input}]},e}(),moment$9=moment_,EncounterPdfViewerService=function(){function e(e,t,n){this.encounterViewerService=e,this.obsValueAdapter=t,this.dataSources=n,this.subscribedAnswers={questions:{stack:[]},answers:[]}}return e.prototype.getPages=function(e,t,n,o){var r,i,a,s,l=[],u=[];try{for(var c=__values(e),p=c.next();!p.done;p=c.next()){var d=p.value;if(n)u=u.concat(this.getSections(d.page,t,!1,o));else try{for(var h=__values(t.rootNode.question.questions),f=h.next();!f.done;f=h.next()){var y=f.value;d.label===t.rootNode.children[y.key].question.label&&this.encounterViewerService.questionsAnswered(t.rootNode.children[y.key])&&l.push({style:"tableExample",table:{widths:["*"],headerRows:1,keepWithHeaderRows:1,body:[[{text:d.label,style:"tableHeader"}],[{style:"tableExample",table:{widths:["*"],body:this.getSections(d.page,t,!0,o)},layout:"noBorders",margin:[5,0,0,0]}]]},layout:{hLineWidth:function(e,t){return 0===e||t.table.body.length,.5},vLineWidth:function(e,t){return 0===e||t.table.widths.length,.5},hLineColor:function(e,t){return 0===e||t.table.body.length,"#ddd"},vLineColor:function(e,t){return 0===e||t.table.body.length,"#ddd"}}})}}catch(m){a={error:m}}finally{try{f&&!f.done&&(s=h["return"])&&s.call(h)}finally{if(a)throw a.error}}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=c["return"])&&i.call(c)}finally{if(r)throw r.error}}return n?u:l},e.prototype.getSections=function(e,t,n,o){var r,i,a,s,l=this,u=[],c=[],p=[];e.map(function(e){l.encounterViewerService.questionsAnswered(e.node)&&c.push(e)});try{for(var d=__values(c),h=d.next();!h.done;h=d.next()){var f=h.value;p=p.concat(this.getRemoteSectionData(f.section))}}catch(g){r={error:g}}finally{try{h&&!h.done&&(i=d["return"])&&i.call(d)}finally{if(r)throw r.error}}if(n&&o){try{for(var y=__values(c),m=y.next();!m.done;m=y.next()){f=m.value;u.push([{table:{widths:["*"],body:[[{text:f.label,style:"tableSubheader"}],[this.getSectionData(f.section,o,t)]]},layout:"noBorders"}])}}catch(v){a={error:v}}finally{try{m&&!m.done&&(s=y["return"])&&s.call(y)}finally{if(a)throw a.error}}return u}return p},e.prototype.appendResolvedAnswer=function(e,t,n){e&&t.stack.push({text:[(n?n.question.label:"Question label")+(n?1<n.question.label.indexOf(":")?"":":":"")+" ",{text:""+e,bold:!0}],style:"answers"})},e.prototype.getRemoteSectionData=function(e){var t,n,o=[];this.subscribedAnswers.questions.stack=[];try{for(var r=__values(e),i=r.next();!i.done;i=r.next()){var a=i.value;"remote-select"===a.question.renderingType&&(this.remoteDataSource=this.dataSources.dataSources[a.question.dataSource],""!==a.control.value&&this.remoteDataSource&&o.push(this.remoteDataSource.resolveSelectedValue(a.control.value)))}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return o},e.prototype.getSectionData=function(e,c,p){var t,n,d={stack:[]},h="",o=function(t){switch(t.question.renderingType){case"group":t.groupMembers&&d.stack.push(f.getSectionData(t.groupMembers,c,p));break;case"field-set":if(t.children){var e=[],n=Object.keys(t.children).map(function(e){return t.children[e]});n&&(e.push(n),d.stack.push(f.getSectionData(e[0],c,p)))}break;case"repeating":t.groupMembers&&d.stack.push(f.getSectionData(t.groupMembers,c,p));break;case"remote-select":f.remoteDataSource=f.dataSources.dataSources[t.question.dataSource];try{for(var o=__values(c),r=o.next();!r.done;r=o.next()){var i=r.value;i.value===t.control.value&&f.appendResolvedAnswer(i.label,d,t)}}catch(u){s={error:u}}finally{try{r&&!r.done&&(l=o["return"])&&l.call(o)}finally{if(s)throw s.error}}break;default:var a=t.control.value;a&&(h=f.resolveValue(a,p),f.appendResolvedAnswer(h,d,t))}var s,l},f=this;try{for(var r=__values(e),i=r.next();!i.done;i=r.next()){o(i.value)}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}return d},e.prototype.resolveValue=function(t,n,e){var o=this;if(""!==t){if(this.isUuid(t)){var r=this.encounterViewerService.resolveSelectedValueFromSchema(t,n.schema);return e?r:r?r.toUpperCase():t}if(_.isArray(t)){var i=[];return _.forEach(t,function(e){i.push(o.resolveValue(e,n,!0))}),i.toString()}if(this.isDate(t))return this.encounterViewerService.convertTime(t);if("object"!=typeof t)return t;var a=[],s=Object.keys(t).map(function(e){return[e,t[e]]});return a.push(s),a}},e.prototype.generatePdfDefinition=function(n){var o=this,r=new rxjs.BehaviorSubject({}),e=this.getPages(this.obsValueAdapter.traverse(n.rootNode),n,!0);return rxjs.combineLatest(e).subscribe(function(e){if(e){var t={pageSize:"A4",content:o.getPages(o.obsValueAdapter.traverse(n.rootNode),n,!1,e),styles:{answers:{fontSize:8},banner:{fontSize:9,bold:!0,margin:[50,15,30,0]},bannerItem:{margin:[2,2,2,2]},bannerLabel:{color:"#2f4f4f"},confidential:{color:"red",fontSize:8,bold:!0,margin:[60,0,0,0]},footer:{alignment:"center",fontSize:8,bold:!0},header:{fontSize:9,bold:!0,margin:[5,5,5,5]},pageNumber:{color:"#2f4f4f",fontSize:6},tableExample:{fontSize:10,margin:[5,0,0,5]},tableHeader:{fillColor:"#f5f5f5",width:["100%"],borderColor:"#333",fontSize:9,bold:!0,margin:[5,0,5,0]},tableSubheader:{fillColor:"#337ab7",width:["100%"],fontSize:9,color:"white",margin:[5,0,5,0]},timestamp:{bold:!0,color:"#2f4f4f"}},defaultStyle:{fontSize:7}};r.next(t)}}),r},e.prototype.displayPdf=function(e){var o,r=this,i=pdfMake;i.vfs=pdfMake.vfs,e.dataSourcesContainer.dataSources._dataSources&&(o=e.dataSourcesContainer.dataSources._dataSources.patientInfo),this.generatePdfDefinition(e).subscribe(function(e){if(!_.isEmpty(e)){if(void 0!==o){var t=[];o.name&&t.push({text:[{text:"Name: ",style:"bannerLabel"},{text:""+r.titleize(o.name)}],style:"bannerItem"}),o.nid&&t.push({text:[{text:"ID: ",style:"bannerLabel"},{text:""+o.nid}],style:"bannerItem"}),o.birthdate&&t.push({text:[{text:"DOB: ",style:"bannerLabel"},{text:moment$9(o.birthdate).format("l")+" ("+o.age+" yo)"}],style:"bannerItem"}),o.mui&&t.push({text:[{text:"MUI: ",style:"bannerLabel"},{text:""+o.mui}],style:"bannerItem"}),o.mhn&&t.push({text:[{text:"MTRH No: ",style:"bannerLabel"},{text:""+o.mhn}],style:"bannerItem"}),e.header={style:"banner",table:{body:[t]},layout:"noBorders"}}e.footer=function(e,t){return{style:"footer",widths:["*","auto"],table:{body:[[{text:"Note: Confidentiality is one of the core duties of all medical practitioners. Patients' personal health information should be kept private.",style:"confidential"},""],[{text:"Generated on "+(new Date).toUTCString(),style:"timestamp"},{text:e.toString()+" of "+t,style:"pageNumber"}]]},layout:"noBorders"}};var n=window.open("","_blank");i.createPdf(e).open({},n)}},function(e){console.log("Error: ",e)})},e.prototype.isDate=function(e){return moment$9(e,moment$9.ISO_8601,!0).isValid()},e.prototype.isUuid=function(e){return 36===e.length&&-1===e.indexOf(" ")&&-1===e.indexOf(".")},e.prototype.titleize=function(e){return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},e.decorators=[{type:i0.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:EncounterViewerService},{type:ObsValueAdapter},{type:DataSources}]},e.ngInjectableDef=i0.defineInjectable({factory:function(){return new e(i0.inject(EncounterViewerService),i0.inject(ObsValueAdapter),i0.inject(DataSources))},token:e,providedIn:"root"}),e}(),EncounterContainerComponent=function(){function e(e,t){this.encAdapter=e,this.encounterPdfViewerService=t}return Object.defineProperty(e.prototype,"form",{set:function(e){this.$form=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"encounter",{set:function(e){this.$enc=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.displayPdf=function(){this.encounterPdfViewerService.displayPdf(this.$form)},e.decorators=[{type:i0.Component,args:[{selector:"encounter-renderer",template:'<a\n type="button"\n style="display: block; font-size: 28px; cursor: pointer"\n class="text-right"\n (click)="displayPdf()"\n>\n <span class="glyphicon text-primary glyphicon-print"></span>\n</a>\n<encounter-viewer\n class="card"\n [form]="$form"\n [encounter]="$enc"\n></encounter-viewer>\n',styles:[".card{box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12)}"]}]}],e.ctorParameters=function(){return[{type:EncounterAdapter},{type:EncounterPdfViewerService}]},e.propDecorators={form:[{type:i0.Input}],encounter:[{type:i0.Input}]},e}(),QuestionControlComponent=function(){function e(){this.innerValue=""}return Object.defineProperty(e.prototype,"schema",{set:function(e){this._schema=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{set:function(e){this._value=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{set:function(e){this._dataSource=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.writeValue(this._value)},e.prototype.isUuid=function(e){return 36===e.length&&-1===e.indexOf(" ")&&-1===e.indexOf(".")},e.prototype.writeValue=function(e,t){var n=this;if(e!==this.innerValue)if(this.isUuid(e)){if(t)return this._dataSource.resolveSelectedValueFromSchema(e,this._schema);var o=this._dataSource.resolveSelectedValueFromSchema(e,this._schema);this.innerValue=o?o.toUpperCase():e}else if(_.isArray(e)){var r=[];_.forEach(e,function(e){r.push(n.writeValue(e,!0))}),this.innerValue=r}else if(this.isDate(e)){if(t)return this._dataSource.convertTime(e);this.innerValue=this._dataSource.convertTime(e)}else{if(t)return e;this.innerValue=e}},e.prototype.isDate=function(e){return this._dataSource.isDate(e)&&!_.isNumber(e)},e.decorators=[{type:i0.Component,args:[{selector:"question-control",styles:["input{border:none;box-shadow:none;color:#000;background:#fff!important;padding-top:23px;display:block;position:relative}"],template:"<div>\n {{ innerValue }}\n</div>\n"}]}],e.ctorParameters=function(){return[]},e.propDecorators={schema:[{type:i0.Input}],value:[{type:i0.Input}],dataSource:[{type:i0.Input}]},e}(),noop=function(){},FilePreviewComponent=function(){function e(e){this.encounterService=e,this.fileUuid=null,this.resultsIsPdf=!1,this.onTouchedCallback=noop,this.onChangeCallback=noop}return Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},Object.defineProperty(e.prototype,"value",{get:function(){return this.fileUuid},set:function(e){e!==this.fileUuid&&(this.fileUuid=e)},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){e!==this.fileUuid&&(this.fileUuid=e,this.checkFileType())},e.prototype.checkFileType=function(){-1!==this.fileUuid.search(/pdf/gi)&&(this.resultsIsPdf=!0)},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.onBlur=function(){this.onTouchedCallback()},e.prototype.onChange=function(e){},e.prototype.getUrl=function(){this.dataSource.fetchFile(this.fileUuid,"pdf").subscribe(function(e){window.open(e.changingThisBreaksApplicationSecurity,"_blank")})},e.decorators=[{type:i0.Component,args:[{selector:"file-preview",styles:[""],template:'<div *ngIf="fileUuid">\n <img\n *ngIf="!resultsIsPdf"\n class="img-responsive"\n [src]="fileUuid | secure: this._dataSource.fetchFile"\n alt="image"\n />\n </div>\n <a *ngIf="resultsIsPdf" (click)="getUrl()" style="cursor: pointer"\n ><u>Open PDF</u></a\n > ',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:EncounterViewerService}]},e.propDecorators={source:[{type:i0.Input}],dataSource:[{type:i0.Input}]},e}(),noop$1=function(){},RemoteAnswerComponent=function(){function e(){this.innerValue=null,this.onTouchedCallback=noop$1,this.onChangeCallback=noop$1}return Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.innerValue},set:function(e){e!==this.innerValue&&(this.innerValue=e)},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){var t=this;e!==this.innerValue&&(this._dataSource?this._dataSource.resolveSelectedValue(e).subscribe(function(e){t.innerValue=e.label}):this.innerValue=e)},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.onBlur=function(){this.onTouchedCallback()},e.prototype.onChange=function(e){},e.decorators=[{type:i0.Component,args:[{selector:"remote-answer",styles:[],template:'\n <div *ngIf="innerValue">\n {{ innerValue }}\n </div>\n ',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[]},e.propDecorators={source:[{type:i0.Input}],dataSource:[{type:i0.Input}]},e}(),EncounterViewerModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{declarations:[EncounterViewerComponent,EncounterContainerComponent,QuestionControlComponent,FilePreviewComponent,RemoteAnswerComponent],imports:[forms.FormsModule,forms.ReactiveFormsModule,common.CommonModule,http.HttpClientModule,SharedModule],providers:[EncounterViewerService,EncounterPdfViewerService],exports:[EncounterContainerComponent,http.HttpClientModule]}]}],e}(),CheckboxControlComponent=function(){function e(){this._value=[],this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){var t=this;this.options=this.options.map(function(e){return-1!==t.selected.indexOf(e.value)&&Object.assign(e,{checked:!0}),e})},e.prototype.ngAfterViewInit=function(){},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},Object.defineProperty(e.prototype,"value",{get:function(){return 0===this._value.length?"":this._value||this._value[0]},set:function(e){if(null==e||""===e)e=[];else if("string"==typeof e)e=[e];else if(!Array.isArray(e))throw new TypeError("Value must be a string or an array.")},enumerable:!0,configurable:!0}),e.prototype.selectOpt=function(t,e){var n=this;e.target.checked?this._value.push(t.value):this.options.forEach(function(e){e.value===t.value&&n._value.splice(e,1)}),this.onChange(this.value)},e.decorators=[{type:i0.Component,args:[{selector:"checkbox",template:'<div *ngFor="let option of options; let i = index">\n <label class="form-control no-border">\n <input\n type="checkbox"\n id="i + \'id\'"\n (change)="selectOpt(option, $event)"\n value="option.value"\n [checked]="option.checked"\n />\n {{ option.label }}\n </label>\n</div>\n',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef(function(){return e}),multi:!0}],styles:["\n .no-border {\n border: 0;\n box-shadow: none;\n }\n "]}]}],e.propDecorators={options:[{type:i0.Input}],selected:[{type:i0.Input}]},e}(),CheckboxModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{declarations:[CheckboxControlComponent],exports:[CheckboxControlComponent],imports:[common.CommonModule,forms.FormsModule]}]}],e}(),moment$a=moment_,NgxTimePickerComponent=function(){function e(){this.value=moment$a().format("HH:mm:ss"),this.onChange=function(){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){},e.prototype.writeValue=function(e){this.value=this.formatTimeValue(e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.onTimeSelect=function(e){var t=this.formatTimeValue(e);this.value=t,this.onChange(t)},e.prototype.formatTimeValue=function(e){var t=[],n=[];return null==e||(t=e.split(":"),n=e.split("-")),1===t.length&&moment$a(e).isValid()?moment$a(e).format("HH:mm:ss"):1<t.length&&t.length<2?moment$a(e,moment$a.defaultFormat).format("HH:mm:ss"):2<=t.length&&1<n.length?moment$a(e,moment$a.defaultFormat).format("HH:mm:ss"):2<=t.length&&n.length<=1?moment$a(e,"HH:mm:ss").format("HH:mm:ss"):moment$a().format("HH:mm:ss")},e.decorators=[{type:i0.Component,args:[{selector:"ngx-time-picker",template:'<input\n type="time"\n class="form-control"\n [ngModel]="value"\n (ngModelChange)="onTimeSelect($event)"\n/>\n',styles:[""],providers:[{provide:forms.NG_VALUE_ACCESSOR,multi:!0,useExisting:i0.forwardRef(function(){return e})}]}]}],e}(),NgxTimePickerModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{imports:[common.CommonModule,forms.FormsModule,forms.ReactiveFormsModule],declarations:[NgxTimePickerComponent],exports:[NgxTimePickerComponent],providers:[]}]}],e}(),FormEntryModule=function(){function e(){}return e.decorators=[{type:i0.NgModule,args:[{imports:[common.CommonModule,forms.ReactiveFormsModule,collapse.CollapseModule,SelectModule,DateTimePickerModule,RemoteSelectModule,RemoteFileUploadModule,EncounterViewerModule,CheckboxModule,material.MatIconModule,material.MatTabsModule,material.MatCardModule,NgxDateTimePickerModule,NgxTimePickerModule,SharedModule],declarations:[FormRendererComponent,AfeNgSelectComponent,AppointmentsOverviewComponent,HistoricalValueDirective,ErrorRendererComponent,timeAgoPipe.TimeAgoPipe],providers:[forms.FormBuilder,FormControlService,FormErrorsService,ValidationFactory,HidersDisablersFactory,AlertsFactory,ExpressionRunner,JsExpressionHelper,HistoricalFieldHelperService,FormSchemaCompiler,FormFactory,QuestionFactory,ValidationFactory,ControlRelationsFactory,ObsAdapterHelper,ObsValueAdapter,EncounterAdapter,PersonAttribuAdapter,OrderValueAdapter,DebugModeService],exports:[FormRendererComponent,AfeNgSelectComponent,ErrorRendererComponent,DateTimePickerModule,EncounterViewerModule,NgxDateTimePickerModule,NgxTimePickerModule]}]}],e}(),Pair=function FL(e,t){this.key=e,this.value=t},IL;IL=exports.RenderingType||(exports.RenderingType={}),IL[IL.Form=0]="Form",IL[IL.Page=1]="Page",IL[IL.Section=2]="Section",IL[IL.Select=3]="Select",IL[IL.DropDown=4]="DropDown",exports.ɵbg=AfeNgSelectComponent,exports.ɵbh=AppointmentsOverviewComponent,exports.ɵz=CheckboxControlComponent,exports.ɵy=CheckboxModule,exports.ɵg=DatePickerComponent,exports.ɵk=DateTimePickerComponent,exports.ɵi=ModalComponent,exports.ɵj=MomentPipe,exports.ɵh=TimePickerComponent,exports.ɵq=FileUploadComponent,exports.ɵn=RemoteFileUploadModule,exports.ɵp=SecurePipe,exports.ɵba=MY_FORMATS,exports.ɵbb=NgxDateTimePickerComponent,exports.ɵbd=NgxTimePickerComponent,exports.ɵbc=NgxTimePickerModule,exports.ɵm=RemoteSelectComponent,exports.ɵl=RemoteSelectModule,exports.ɵe=SelectDropdownComponent,exports.ɵf=STYLE$1,exports.ɵb=SELECT_VALUE_ACCESSOR,exports.ɵc=SelectComponent,exports.ɵd=STYLE,exports.ɵa=SelectModule,exports.ɵw=FilePreviewComponent,exports.ɵv=QuestionControlComponent,exports.ɵx=RemoteAnswerComponent,exports.ɵu=EncounterContainerComponent,exports.ɵs=EncounterViewerComponent,exports.ɵr=EncounterViewerModule,exports.ɵt=EncounterViewerService,exports.ɵbi=HistoricalValueDirective,exports.ɵbk=ErrorRendererComponent,exports.ɵbm=ExpressionRunner,exports.ɵbl=HidersDisablersFactory,exports.ɵbo=AlertsFactory,exports.ɵbe=FormRendererComponent,exports.ɵbf=DEFAULT_STYLES,exports.ɵbj=HistoricalFieldHelperService,exports.ɵbn=DebugModeService,exports.ɵo=SharedModule,exports.FormEntryModule=FormEntryModule,exports.AfeFormControl=AfeFormControl,exports.AfeFormGroup=AfeFormGroup,exports.AfeFormArray=AfeFormArray,exports.EncounterPdfViewerService=EncounterPdfViewerService,exports.ControlRelationsFactory=ControlRelationsFactory,exports.FormControlService=FormControlService,exports.FormFactory=FormFactory,exports.Form=Form,exports.QuestionFactory=QuestionFactory,exports.ValidationFactory=ValidationFactory,exports.FormSchemaCompiler=FormSchemaCompiler,exports.HistoricalEncounterDataService=HistoricalEncounterDataService,exports.FormErrorsService=FormErrorsService,exports.EncounterAdapter=EncounterAdapter,exports.PersonAttribuAdapter=PersonAttribuAdapter,exports.OrderValueAdapter=OrderValueAdapter,exports.ObsValueAdapter=ObsValueAdapter,exports.ObsAdapterHelper=ObsAdapterHelper,exports.DataSources=DataSources,exports.CheckBoxQuestion=CheckBoxQuestion,exports.ConditionalValidationModel=ConditionalValidationModel,exports.DateQuestion=DateQuestion,exports.DateValidationModel=DateValidationModel,exports.FileUploadQuestion=FileUploadQuestion,exports.QuestionGroup=QuestionGroup,exports.JsExpressionValidationModel=JsExpressionValidationModel,exports.MaxValidationModel=MaxValidationModel,exports.MinValidationModel=MinValidationModel,exports.MultiSelectQuestion=MultiSelectQuestion,exports.Pair=Pair,exports.QuestionBase=QuestionBase,exports.RepeatingQuestion=RepeatingQuestion,exports.Option=Option$1,exports.SelectQuestion=SelectQuestion,exports.TestOrderQuestion=TestOrderQuestion,exports.TextAreaInputQuestion=TextAreaInputQuestion,exports.TextInputQuestion=TextInputQuestion,exports.UiSelectQuestion=UiSelectQuestion,exports.ValidationModel=ValidationModel,exports.NestedQuestion=NestedQuestion,exports.DateTimePickerModule=DateTimePickerModule,exports.NgxDateTimePickerModule=NgxDateTimePickerModule,exports.JsExpressionHelper=JsExpressionHelper,Object.defineProperty(exports,"__esModule",{value:!0})});
|
|
17
2
|
//# sourceMappingURL=ampath-kenya-ngx-openmrs-formentry.umd.min.js.map
|