UNPKG

@regulaforensics/face-sdk

Version:

This is an npm module for Regula Face SDK. It allows you to easily compaire faces using your phone's camera.

1,375 lines (1,139 loc) • 180 kB
/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./src/customization/camera_position.js" /*!**********************************************!*\ !*** ./src/customization/camera_position.js ***! \**********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CameraPosition: () => (/* binding */ CameraPosition) /* harmony export */ }); const CameraPosition = { FRONT: 0, BACK: 1, } /***/ }, /***/ "./src/customization/customization.js" /*!********************************************!*\ !*** ./src/customization/customization.js ***! \********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Customization: () => (/* binding */ Customization) /* harmony export */ }); /* harmony import */ var _customization_colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./customization_colors */ "./src/customization/customization_colors.js"); /* harmony import */ var _customization_fonts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./customization_fonts */ "./src/customization/customization_fonts.js"); /* harmony import */ var _customization_images__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./customization_images */ "./src/customization/customization_images.js"); /* harmony import */ var _internal_bridge__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../internal/bridge */ "./src/internal/bridge.js"); /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../index */ "./src/index.js"); class Customization { get colors() { return this._colors } _colors = new _customization_colors__WEBPACK_IMPORTED_MODULE_0__.CustomizationColors() set colors(val) { (this._colors = val)._apply(this) } get fonts() { return this._fonts } _fonts = new _customization_fonts__WEBPACK_IMPORTED_MODULE_1__.CustomizationFonts() set fonts(val) { (this._fonts = val)._apply(this) } get images() { return this._images } _images = new _customization_images__WEBPACK_IMPORTED_MODULE_2__.CustomizationImages() set images(val) { (this._images = val)._apply(this) } get uiCustomizationLayer() { return this._uiCustomizationLayer } _uiCustomizationLayer set uiCustomizationLayer(val) { var temp = Object.assign({}, val); Object.freeze(temp); this._uiCustomizationLayer = temp this._set({ "uiCustomizationLayer": val }) } set onCustomButtonTapped(completion) { (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_3__._setCustomButtonTappedCompletion)(completion) } static fromJson(jsonObject) { var result = new Customization() result.colors = _customization_colors__WEBPACK_IMPORTED_MODULE_0__.CustomizationColors.fromJson(jsonObject["colors"]) result.fonts = _customization_fonts__WEBPACK_IMPORTED_MODULE_1__.CustomizationFonts.fromJson(jsonObject["fonts"]) result.images = _customization_images__WEBPACK_IMPORTED_MODULE_2__.CustomizationImages.fromJson(jsonObject["images"]) result._uiCustomizationLayer = jsonObject["uiCustomizationLayer"] return result } toJson() { return { "colors": this.colors.toJson(), "fonts": this.fonts.toJson(), "images": this.images.toJson(), "uiCustomizationLayer": this.uiCustomizationLayer } } _set(json) { if (this === _index__WEBPACK_IMPORTED_MODULE_4__.FaceSDK.instance.customization) { (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_3__.exec)("setCustomization", [json]) } } _apply() { this._set(toJson()) } } /***/ }, /***/ "./src/customization/customization_colors.js" /*!***************************************************!*\ !*** ./src/customization/customization_colors.js ***! \***************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CustomizationColors: () => (/* binding */ CustomizationColors) /* harmony export */ }); /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./src/index.js"); class CustomizationColors { _onboardingScreenStartButtonBackground set onboardingScreenStartButtonBackground(val) { this._onboardingScreenStartButtonBackground = val this._set({ "100": val }) } _onboardingScreenStartButtonTitle set onboardingScreenStartButtonTitle(val) { this._onboardingScreenStartButtonTitle = val this._set({ "101": val }) } _onboardingScreenBackground set onboardingScreenBackground(val) { this._onboardingScreenBackground = val this._set({ "102": val }) } _onboardingScreenTitleLabelText set onboardingScreenTitleLabelText(val) { this._onboardingScreenTitleLabelText = val this._set({ "103": val }) } _onboardingScreenSubtitleLabelText set onboardingScreenSubtitleLabelText(val) { this._onboardingScreenSubtitleLabelText = val this._set({ "104": val }) } _onboardingScreenMessageLabelsText set onboardingScreenMessageLabelsText(val) { this._onboardingScreenMessageLabelsText = val this._set({ "105": val }) } _cameraScreenStrokeNormal set cameraScreenStrokeNormal(val) { this._cameraScreenStrokeNormal = val this._set({ "200": val }) } _cameraScreenStrokeActive set cameraScreenStrokeActive(val) { this._cameraScreenStrokeActive = val this._set({ "201": val }) } _cameraScreenSectorTarget set cameraScreenSectorTarget(val) { this._cameraScreenSectorTarget = val this._set({ "202": val }) } _cameraScreenSectorActive set cameraScreenSectorActive(val) { this._cameraScreenSectorActive = val this._set({ "203": val }) } _cameraScreenFrontHintLabelBackground set cameraScreenFrontHintLabelBackground(val) { this._cameraScreenFrontHintLabelBackground = val this._set({ "204": val }) } _cameraScreenFrontHintLabelText set cameraScreenFrontHintLabelText(val) { this._cameraScreenFrontHintLabelText = val this._set({ "205": val }) } _cameraScreenBackHintLabelBackground set cameraScreenBackHintLabelBackground(val) { this._cameraScreenBackHintLabelBackground = val this._set({ "206": val }) } _cameraScreenBackHintLabelText set cameraScreenBackHintLabelText(val) { this._cameraScreenBackHintLabelText = val this._set({ "207": val }) } _cameraScreenLightToolbarTint set cameraScreenLightToolbarTint(val) { this._cameraScreenLightToolbarTint = val this._set({ "208": val }) } _cameraScreenDarkToolbarTint set cameraScreenDarkToolbarTint(val) { this._cameraScreenDarkToolbarTint = val this._set({ "209": val }) } _retryScreenBackground set retryScreenBackground(val) { this._retryScreenBackground = val this._set({ "300": val }) } _retryScreenRetryButtonBackground set retryScreenRetryButtonBackground(val) { this._retryScreenRetryButtonBackground = val this._set({ "301": val }) } _retryScreenRetryButtonTitle set retryScreenRetryButtonTitle(val) { this._retryScreenRetryButtonTitle = val this._set({ "302": val }) } _retryScreenTitleLabelText set retryScreenTitleLabelText(val) { this._retryScreenTitleLabelText = val this._set({ "303": val }) } _retryScreenSubtitleLabelText set retryScreenSubtitleLabelText(val) { this._retryScreenSubtitleLabelText = val this._set({ "304": val }) } _retryScreenHintLabelsText set retryScreenHintLabelsText(val) { this._retryScreenHintLabelsText = val this._set({ "305": val }) } _processingScreenBackground set processingScreenBackground(val) { this._processingScreenBackground = val this._set({ "400": val }) } _processingScreenProgress set processingScreenProgress(val) { this._processingScreenProgress = val this._set({ "401": val }) } _processingScreenTitleLabel set processingScreenTitleLabel(val) { this._processingScreenTitleLabel = val this._set({ "402": val }) } _successScreenBackground set successScreenBackground(val) { this._successScreenBackground = val this._set({ "500": val }) } static fromJson(jsonObject) { var result = new CustomizationColors() result._onboardingScreenStartButtonBackground = jsonObject["100"] result._onboardingScreenStartButtonTitle = jsonObject["101"] result._onboardingScreenBackground = jsonObject["102"] result._onboardingScreenTitleLabelText = jsonObject["103"] result._onboardingScreenSubtitleLabelText = jsonObject["104"] result._onboardingScreenMessageLabelsText = jsonObject["105"] result._cameraScreenStrokeNormal = jsonObject["200"] result._cameraScreenStrokeActive = jsonObject["201"] result._cameraScreenSectorTarget = jsonObject["202"] result._cameraScreenSectorActive = jsonObject["203"] result._cameraScreenFrontHintLabelBackground = jsonObject["204"] result._cameraScreenFrontHintLabelText = jsonObject["205"] result._cameraScreenBackHintLabelBackground = jsonObject["206"] result._cameraScreenBackHintLabelText = jsonObject["207"] result._cameraScreenLightToolbarTint = jsonObject["208"] result._cameraScreenDarkToolbarTint = jsonObject["209"] result._retryScreenBackground = jsonObject["300"] result._retryScreenRetryButtonBackground = jsonObject["301"] result._retryScreenRetryButtonTitle = jsonObject["302"] result._retryScreenTitleLabelText = jsonObject["303"] result._retryScreenSubtitleLabelText = jsonObject["304"] result._retryScreenHintLabelsText = jsonObject["305"] result._processingScreenBackground = jsonObject["400"] result._processingScreenProgress = jsonObject["401"] result._processingScreenTitleLabel = jsonObject["402"] result._successScreenBackground = jsonObject["500"] return result } toJson() { return { "100": this._onboardingScreenStartButtonBackground, "101": this._onboardingScreenStartButtonTitle, "102": this._onboardingScreenBackground, "103": this._onboardingScreenTitleLabelText, "104": this._onboardingScreenSubtitleLabelText, "105": this._onboardingScreenMessageLabelsText, "200": this._cameraScreenStrokeNormal, "201": this._cameraScreenStrokeActive, "202": this._cameraScreenSectorTarget, "203": this._cameraScreenSectorActive, "204": this._cameraScreenFrontHintLabelBackground, "205": this._cameraScreenFrontHintLabelText, "206": this._cameraScreenBackHintLabelBackground, "207": this._cameraScreenBackHintLabelText, "208": this._cameraScreenLightToolbarTint, "209": this._cameraScreenDarkToolbarTint, "300": this._retryScreenBackground, "301": this._retryScreenRetryButtonBackground, "302": this._retryScreenRetryButtonTitle, "303": this._retryScreenTitleLabelText, "304": this._retryScreenSubtitleLabelText, "305": this._retryScreenHintLabelsText, "400": this._processingScreenBackground, "401": this._processingScreenProgress, "402": this._processingScreenTitleLabel, "500": this._successScreenBackground, } } _set(json) { var parentJson = { "colors": json } var parent = _index__WEBPACK_IMPORTED_MODULE_0__.FaceSDK.instance.customization if (this === parent.colors) parent._set(parentJson) } _apply() { this._set(this.toJson()) } } /***/ }, /***/ "./src/customization/customization_fonts.js" /*!**************************************************!*\ !*** ./src/customization/customization_fonts.js ***! \**************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CustomizationFonts: () => (/* binding */ CustomizationFonts) /* harmony export */ }); /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./src/index.js"); /* harmony import */ var _font__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./font */ "./src/customization/font.js"); class CustomizationFonts { _onboardingScreenStartButton set onboardingScreenStartButton(val) { this._onboardingScreenStartButton = val this._set({ "100": val }) } _onboardingScreenTitleLabel set onboardingScreenTitleLabel(val) { this._onboardingScreenTitleLabel = val this._set({ "101": val }) } _onboardingScreenSubtitleLabel set onboardingScreenSubtitleLabel(val) { this._onboardingScreenSubtitleLabel = val this._set({ "102": val }) } _onboardingScreenMessageLabels set onboardingScreenMessageLabels(val) { this._onboardingScreenMessageLabels = val this._set({ "103": val }) } _cameraScreenHintLabel set cameraScreenHintLabel(val) { this._cameraScreenHintLabel = val this._set({ "200": val }) } _retryScreenRetryButton set retryScreenRetryButton(val) { this._retryScreenRetryButton = val this._set({ "300": val }) } _retryScreenTitleLabel set retryScreenTitleLabel(val) { this._retryScreenTitleLabel = val this._set({ "301": val }) } _retryScreenSubtitleLabel set retryScreenSubtitleLabel(val) { this._retryScreenSubtitleLabel = val this._set({ "302": val }) } _retryScreenHintLabels set retryScreenHintLabels(val) { this._retryScreenHintLabels = val this._set({ "303": val }) } _processingScreenLabel set processingScreenLabel(val) { this._processingScreenLabel = val this._set({ "400": val }) } static fromJson(jsonObject) { var result = new CustomizationFonts() result._onboardingScreenStartButton = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["100"]) result._onboardingScreenTitleLabel = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["101"]) result._onboardingScreenSubtitleLabel = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["102"]) result._onboardingScreenMessageLabels = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["103"]) result._cameraScreenHintLabel = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["200"]) result._retryScreenRetryButton = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["300"]) result._retryScreenTitleLabel = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["301"]) result._retryScreenSubtitleLabel = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["302"]) result._retryScreenHintLabels = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["303"]) result._processingScreenLabel = _font__WEBPACK_IMPORTED_MODULE_1__.Font.fromJson(jsonObject["400"]) return result } toJson() { return { "100": this._onboardingScreenStartButton, "101": this._onboardingScreenTitleLabel, "102": this._onboardingScreenSubtitleLabel, "103": this._onboardingScreenMessageLabels, "200": this._cameraScreenHintLabel, "300": this._retryScreenRetryButton, "301": this._retryScreenTitleLabel, "302": this._retryScreenSubtitleLabel, "303": this._retryScreenHintLabels, "400": this._processingScreenLabel, } } _set(json) { var parentJson = { "fonts": json } var parent = _index__WEBPACK_IMPORTED_MODULE_0__.FaceSDK.instance.customization if (this === parent.fonts) parent._set(parentJson) } _apply() { this._set(this.toJson()) } } /***/ }, /***/ "./src/customization/customization_images.js" /*!***************************************************!*\ !*** ./src/customization/customization_images.js ***! \***************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CustomizationImages: () => (/* binding */ CustomizationImages) /* harmony export */ }); /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./src/index.js"); class CustomizationImages { _onboardingScreenCloseButton set onboardingScreenCloseButton(val) { this._onboardingScreenCloseButton = val this._set({ "onboardingScreenCloseButton": val }) } _onboardingScreenIllumination set onboardingScreenIllumination(val) { this._onboardingScreenIllumination = val this._set({ "onboardingScreenIllumination": val }) } _onboardingScreenAccessories set onboardingScreenAccessories(val) { this._onboardingScreenAccessories = val this._set({ "onboardingScreenAccessories": val }) } _onboardingScreenCameraLevel set onboardingScreenCameraLevel(val) { this._onboardingScreenCameraLevel = val this._set({ "onboardingScreenCameraLevel": val }) } _cameraScreenCloseButton set cameraScreenCloseButton(val) { this._cameraScreenCloseButton = val this._set({ "cameraScreenCloseButton": val }) } _cameraScreenLightOnButton set cameraScreenLightOnButton(val) { this._cameraScreenLightOnButton = val this._set({ "cameraScreenLightOnButton": val }) } _cameraScreenLightOffButton set cameraScreenLightOffButton(val) { this._cameraScreenLightOffButton = val this._set({ "cameraScreenLightOffButton": val }) } _cameraScreenSwitchButton set cameraScreenSwitchButton(val) { this._cameraScreenSwitchButton = val this._set({ "cameraScreenSwitchButton": val }) } _retryScreenCloseButton set retryScreenCloseButton(val) { this._retryScreenCloseButton = val this._set({ "retryScreenCloseButton": val }) } _retryScreenHintEnvironment set retryScreenHintEnvironment(val) { this._retryScreenHintEnvironment = val this._set({ "retryScreenHintEnvironment": val }) } _retryScreenHintSubject set retryScreenHintSubject(val) { this._retryScreenHintSubject = val this._set({ "retryScreenHintSubject": val }) } _retryScreenHintGeo set retryScreenHintGeo(val) { this._retryScreenHintGeo = val this._set({ "retryScreenHintGeo": val }) } _processingScreenCloseButton set processingScreenCloseButton(val) { this._processingScreenCloseButton = val this._set({ "processingScreenCloseButton": val }) } _successScreenImage set successScreenImage(val) { this._successScreenImage = val this._set({ "successScreenImage": val }) } static fromJson(jsonObject) { var result = new CustomizationImages() result._onboardingScreenCloseButton = jsonObject["onboardingScreenCloseButton"] result._onboardingScreenIllumination = jsonObject["onboardingScreenIllumination"] result._onboardingScreenAccessories = jsonObject["onboardingScreenAccessories"] result._onboardingScreenCameraLevel = jsonObject["onboardingScreenCameraLevel"] result._cameraScreenCloseButton = jsonObject["cameraScreenCloseButton"] result._cameraScreenLightOnButton = jsonObject["cameraScreenLightOnButton"] result._cameraScreenLightOffButton = jsonObject["cameraScreenLightOffButton"] result._cameraScreenSwitchButton = jsonObject["cameraScreenSwitchButton"] result._retryScreenCloseButton = jsonObject["retryScreenCloseButton"] result._retryScreenHintEnvironment = jsonObject["retryScreenHintEnvironment"] result._retryScreenHintSubject = jsonObject["retryScreenHintSubject"] result._retryScreenHintGeo = jsonObject["retryScreenHintGeo"] result._processingScreenCloseButton = jsonObject["processingScreenCloseButton"] result._successScreenImage = jsonObject["successScreenImage"] return result } toJson() { return { "onboardingScreenCloseButton": this._onboardingScreenCloseButton, "onboardingScreenIllumination": this._onboardingScreenIllumination, "onboardingScreenAccessories": this._onboardingScreenAccessories, "onboardingScreenCameraLevel": this._onboardingScreenCameraLevel, "cameraScreenCloseButton": this._cameraScreenCloseButton, "cameraScreenLightOnButton": this._cameraScreenLightOnButton, "cameraScreenLightOffButton": this._cameraScreenLightOffButton, "cameraScreenSwitchButton": this._cameraScreenSwitchButton, "retryScreenCloseButton": this._retryScreenCloseButton, "retryScreenHintEnvironment": this._retryScreenHintEnvironment, "retryScreenHintSubject": this._retryScreenHintSubject, "retryScreenHintGeo": this._retryScreenHintGeo, "processingScreenCloseButton": this._processingScreenCloseButton, "successScreenImage": this._successScreenImage, } } _set(json) { var parentJson = { "images": json } var parent = _index__WEBPACK_IMPORTED_MODULE_0__.FaceSDK.instance.customization if (this === parent.images) parent._set(parentJson) } _apply() { this._set(this.toJson()) } } /***/ }, /***/ "./src/customization/font.js" /*!***********************************!*\ !*** ./src/customization/font.js ***! \***********************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Font: () => (/* binding */ Font), /* harmony export */ FontStyle: () => (/* binding */ FontStyle) /* harmony export */ }); class Font { name size style constructor(name, params) { this.name = name this.size = params?.size this.style = params?.style } static fromJson(jsonObject) { if (jsonObject == null) return null const result = new Font() result.name = jsonObject["name"] result.size = jsonObject["size"] result.style = jsonObject["style"] return result } toJson() { return { "name": this.name, "size": this.size, "style": this.style, } } } const FontStyle = { NORMAL: 0, BOLD: 1, ITALIC: 2, BOLD_ITALIC: 3, } /***/ }, /***/ "./src/customization/screen_orientation.js" /*!*************************************************!*\ !*** ./src/customization/screen_orientation.js ***! \*************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScreenOrientation: () => (/* binding */ ScreenOrientation) /* harmony export */ }); const ScreenOrientation = { PORTRAIT: 0, LANDSCAPE: 1, } /***/ }, /***/ "./src/detect_faces/detect_face_result.js" /*!************************************************!*\ !*** ./src/detect_faces/detect_face_result.js ***! \************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFaceResult: () => (/* binding */ DetectFaceResult) /* harmony export */ }); /* harmony import */ var _detect_faces_attribute_result__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./detect_faces_attribute_result */ "./src/detect_faces/detect_faces_attribute_result.js"); /* harmony import */ var _image_quality_image_quality_result__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image_quality/image_quality_result */ "./src/image_quality/image_quality_result.js"); /* harmony import */ var _image_params_rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../image_params/rect */ "./src/image_params/rect.js"); /* harmony import */ var _image_params_point__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../image_params/point */ "./src/image_params/point.js"); class DetectFaceResult { quality attributes crop faceRect originalRect landmarks isQualityCompliant static fromJson(jsonObject) { if (jsonObject == null) return null const result = new DetectFaceResult() result.quality = [] if (jsonObject["quality"] != null) for (const item of jsonObject["quality"]) result.quality.push(_image_quality_image_quality_result__WEBPACK_IMPORTED_MODULE_1__.ImageQualityResult.fromJson(item)) result.attributes = [] if (jsonObject["attributes"] != null) for (const item of jsonObject["attributes"]) result.attributes.push(_detect_faces_attribute_result__WEBPACK_IMPORTED_MODULE_0__.DetectFacesAttributeResult.fromJson(item)) result.crop = jsonObject["crop"] result.faceRect = _image_params_rect__WEBPACK_IMPORTED_MODULE_2__.Rect.fromJson(jsonObject["faceRect"]) result.originalRect = _image_params_rect__WEBPACK_IMPORTED_MODULE_2__.Rect.fromJson(jsonObject["originalRect"]) result.landmarks = [] if (jsonObject["landmarks"] != null) for (const item of jsonObject["landmarks"]) result.landmarks.push(_image_params_point__WEBPACK_IMPORTED_MODULE_3__.Point.fromJson(item)) result.isQualityCompliant = jsonObject["isQualityCompliant"] return result } toJson() { return { "quality": this.quality?.map(e => e.toJson()), "crop": this.crop, "attributes": this.attributes?.map(e => e.toJson()), "landmarks": this.landmarks?.map(e => e.toJson()), "faceRect": this.faceRect?.toJson(), "originalRect": this.originalRect?.toJson(), "isQualityCompliant": this.isQualityCompliant, } } } /***/ }, /***/ "./src/detect_faces/detect_faces_attribute.js" /*!****************************************************!*\ !*** ./src/detect_faces/detect_faces_attribute.js ***! \****************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFacesAttribute: () => (/* binding */ DetectFacesAttribute) /* harmony export */ }); const DetectFacesAttribute = { AGE: "Age", EYE_RIGHT: "EyeRight", EYE_LEFT: "EyeLeft", EMOTION: "Emotion", SMILE: "Smile", GLASSES: "Glasses", HEAD_COVERING: "HeadCovering", FOREHEAD_COVERING: "ForeheadCovering", MOUTH: "Mouth", MEDICAL_MASK: "MedicalMask", OCCLUSION: "Occlusion", STRONG_MAKEUP: "StrongMakeup", HEADPHONES: "Headphones", } /***/ }, /***/ "./src/detect_faces/detect_faces_attribute_result.js" /*!***********************************************************!*\ !*** ./src/detect_faces/detect_faces_attribute_result.js ***! \***********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFacesAttributeResult: () => (/* binding */ DetectFacesAttributeResult) /* harmony export */ }); /* harmony import */ var _image_quality_image_quality_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../image_quality/image_quality_range */ "./src/image_quality/image_quality_range.js"); class DetectFacesAttributeResult { attribute value range confidence static fromJson(jsonObject) { if (jsonObject == null) return null const result = new DetectFacesAttributeResult() result.attribute = jsonObject["attribute"] result.value = jsonObject["value"] result.range = _image_quality_image_quality_range__WEBPACK_IMPORTED_MODULE_0__.ImageQualityRange.fromJson(jsonObject["range"]) result.confidence = jsonObject["confidence"] return result } toJson() { return { "attribute": this.attribute, "value": this.value, "range": this.range?.toJson(), "confidence": this.confidence, } } } /***/ }, /***/ "./src/detect_faces/detect_faces_backend_exception.js" /*!************************************************************!*\ !*** ./src/detect_faces/detect_faces_backend_exception.js ***! \************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFacesBackendErrorCode: () => (/* binding */ DetectFacesBackendErrorCode), /* harmony export */ DetectFacesBackendException: () => (/* binding */ DetectFacesBackendException) /* harmony export */ }); class DetectFacesBackendException { code message static fromJson(jsonObject) { if (jsonObject == null) return null const result = new DetectFacesBackendException() result.code = jsonObject["code"] result.message = jsonObject["message"] ?? "" return result } toJson() { return { "code": this.code, "message": this.message, } } } const DetectFacesBackendErrorCode = { FR_FACE_NOT_DETECTED: 2, FACER_NO_LICENSE: 200, FACER_IS_NOT_INITIALIZED: 201, FACER_COMMAND_IS_NOT_SUPPORTED: 202, FACER_COMMAND_PARAMS_READ_ERROR: 203, UNDEFINED: -1, } /***/ }, /***/ "./src/detect_faces/detect_faces_config.js" /*!*************************************************!*\ !*** ./src/detect_faces/detect_faces_config.js ***! \*************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFacesConfig: () => (/* binding */ DetectFacesConfig) /* harmony export */ }); /* harmony import */ var _image_quality_image_quality_characteristic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../image_quality/image_quality_characteristic */ "./src/image_quality/image_quality_characteristic.js"); /* harmony import */ var _image_params_output_image_params__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image_params/output_image_params */ "./src/image_params/output_image_params.js"); class DetectFacesConfig { attributes customQuality outputImageParams onlyCentralFace constructor(params) { this.onlyCentralFace = false this.attributes = params?.attributes this.customQuality = params?.customQuality this.outputImageParams = params?.outputImageParams this.onlyCentralFace = params?.onlyCentralFace ?? this.onlyCentralFace } static fromJson(jsonObject) { if (jsonObject == null) return null const result = new DetectFacesConfig() if (jsonObject["attributes"] != null) { result.attributes = [] for (const item of jsonObject["attributes"]) { result.attributes.push(item) } } if (jsonObject["customQuality"] != null) { result.customQuality = [] for (const item of jsonObject["customQuality"]) { result.customQuality.push(_image_quality_image_quality_characteristic__WEBPACK_IMPORTED_MODULE_0__.ImageQualityCharacteristic.fromJson(item)) } } result.outputImageParams = _image_params_output_image_params__WEBPACK_IMPORTED_MODULE_1__.OutputImageParams.fromJson(jsonObject["outputImageParams"]) result.onlyCentralFace = jsonObject["onlyCentralFace"] return result } toJson() { return { "attributes": this.attributes?.map(e => e), "customQuality": this.customQuality?.map(e => e.toJson()), "outputImageParams": this.outputImageParams?.toJson(), "onlyCentralFace": this.onlyCentralFace, } } } /***/ }, /***/ "./src/detect_faces/detect_faces_exception.js" /*!****************************************************!*\ !*** ./src/detect_faces/detect_faces_exception.js ***! \****************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFacesErrorCode: () => (/* binding */ DetectFacesErrorCode), /* harmony export */ DetectFacesException: () => (/* binding */ DetectFacesException) /* harmony export */ }); /* harmony import */ var _detect_faces_backend_exception__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./detect_faces_backend_exception */ "./src/detect_faces/detect_faces_backend_exception.js"); class DetectFacesException { code message underlyingError static fromJson(jsonObject) { if (jsonObject == null) return null const result = new DetectFacesException() result.code = jsonObject["code"] result.message = jsonObject["message"] ?? "" result.underlyingError = _detect_faces_backend_exception__WEBPACK_IMPORTED_MODULE_0__.DetectFacesBackendException.fromJson(jsonObject["underlyingError"]) return result } toJson() { return { "code": this.code, "message": this.message, "underlyingError": this.underlyingError?.toJson(), } } } const DetectFacesErrorCode = { IMAGE_EMPTY: 0, FR_FACE_NOT_DETECTED: 1, FACER_NO_LICENSE: 2, FACER_IS_NOT_INITIALIZED: 3, FACER_COMMAND_IS_NOT_SUPPORTED: 4, FACER_COMMAND_PARAMS_READ_ERROR: 5, PROCESSING_FAILED: 6, REQUEST_FAILED: 7, API_CALL_FAILED: 8, } /***/ }, /***/ "./src/detect_faces/detect_faces_request.js" /*!**************************************************!*\ !*** ./src/detect_faces/detect_faces_request.js ***! \**************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFacesRequest: () => (/* binding */ DetectFacesRequest) /* harmony export */ }); /* harmony import */ var _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./detect_faces_scenario */ "./src/detect_faces/detect_faces_scenario.js"); /* harmony import */ var _detect_faces_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./detect_faces_config */ "./src/detect_faces/detect_faces_config.js"); class DetectFacesRequest { image configuration tag constructor(image, configuration, params) { this.image = image this.configuration = configuration this.tag = params?.tag } static qualityFull(image) { const result = new DetectFacesRequest() result.image = image result.scenario = _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__.DetectFacesScenario.QUALITY_FULL return result } static qualityICAO(image) { const result = new DetectFacesRequest() result.image = image result.scenario = _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__.DetectFacesScenario.QUALITY_ICAO return result } static qualityVisaSchengen(image) { const result = new DetectFacesRequest() result.image = image result.scenario = _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__.DetectFacesScenario.QUALITY_VISA_SCHENGEN return result } static qualityVisaUSA(image) { const result = new DetectFacesRequest() result.image = image result.scenario = _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__.DetectFacesScenario.QUALITY_VISA_USA return result } static cropCentralFace(image) { const result = new DetectFacesRequest() result.image = image result.scenario = _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__.DetectFacesScenario.CROP_CENTRAL_FACE return result } static cropAllFaces(image) { const result = new DetectFacesRequest() result.image = image result.scenario = _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__.DetectFacesScenario.CROP_ALL_FACES return result } static thumbnail(image) { const result = new DetectFacesRequest() result.image = image result.scenario = _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__.DetectFacesScenario.THUMBNAIL return result } static allAttributes(image) { const result = new DetectFacesRequest() result.image = image result.scenario = _detect_faces_scenario__WEBPACK_IMPORTED_MODULE_0__.DetectFacesScenario.ATTRIBUTES_ALL return result } static fromJson(jsonObject) { if (jsonObject == null) return null const result = new DetectFacesRequest() result.tag = jsonObject["tag"] result.scenario = jsonObject["scenario"] result.image = jsonObject["image"] result.configuration = _detect_faces_config__WEBPACK_IMPORTED_MODULE_1__.DetectFacesConfig.fromJson(jsonObject["configuration"]) return result } toJson() { return { "tag": this.tag, "scenario": this.scenario, "image": this.image, "configuration": this.configuration?.toJson(), } } } /***/ }, /***/ "./src/detect_faces/detect_faces_response.js" /*!***************************************************!*\ !*** ./src/detect_faces/detect_faces_response.js ***! \***************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFacesResponse: () => (/* binding */ DetectFacesResponse) /* harmony export */ }); /* harmony import */ var _detect_face_result__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./detect_face_result */ "./src/detect_faces/detect_face_result.js"); /* harmony import */ var _detect_faces_exception__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./detect_faces_exception */ "./src/detect_faces/detect_faces_exception.js"); class DetectFacesResponse { detection scenario error allDetections static fromJson(jsonObject) { if (jsonObject == null) return null const result = new DetectFacesResponse() result.detection = _detect_face_result__WEBPACK_IMPORTED_MODULE_0__.DetectFaceResult.fromJson(jsonObject["detection"]) result.scenario = jsonObject["scenario"] result.error = _detect_faces_exception__WEBPACK_IMPORTED_MODULE_1__.DetectFacesException.fromJson(jsonObject["error"]) result.allDetections = [] if (jsonObject["allDetections"] != null) for (const item of jsonObject["allDetections"]) result.allDetections.push(_detect_face_result__WEBPACK_IMPORTED_MODULE_0__.DetectFaceResult.fromJson(item)) return result } toJson() { return { "detection": this.detection?.toJson(), "allDetections": this.allDetections?.map(e => e.toJson()), "scenario": this.scenario, "error": this.error?.toJson(), } } } /***/ }, /***/ "./src/detect_faces/detect_faces_scenario.js" /*!***************************************************!*\ !*** ./src/detect_faces/detect_faces_scenario.js ***! \***************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DetectFacesScenario: () => (/* binding */ DetectFacesScenario) /* harmony export */ }); const DetectFacesScenario = { CROP_CENTRAL_FACE: "CropCentralFace", CROP_ALL_FACES: "CropAllFaces", THUMBNAIL: "Thumbnail", ATTRIBUTES_ALL: "AttributesAll", QUALITY_FULL: "QualityFull", QUALITY_ICAO: "QualityICAO", QUALITY_VISA_SCHENGEN: "QualityVisaSchengen", QUALITY_VISA_USA: "QualityVisaUSA", } /***/ }, /***/ "./src/face_capture/face_capture_config.js" /*!*************************************************!*\ !*** ./src/face_capture/face_capture_config.js ***! \*************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaceCaptureConfig: () => (/* binding */ FaceCaptureConfig) /* harmony export */ }); /* harmony import */ var _customization_camera_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../customization/camera_position */ "./src/customization/camera_position.js"); /* harmony import */ var _customization_screen_orientation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../customization/screen_orientation */ "./src/customization/screen_orientation.js"); class FaceCaptureConfig { copyright cameraSwitchEnabled closeButtonEnabled torchButtonEnabled vibrateOnSteps detectOcclusion showFaceAnimation preventScreenRecording cameraPositionIOS cameraPositionAndroid screenOrientation timeout holdStillDuration constructor(params) { this.copyright = params?.copyright ?? true this.cameraSwitchEnabled = params?.cameraSwitchEnabled ?? false this.closeButtonEnabled = params?.closeButtonEnabled ?? true this.torchButtonEnabled = params?.torchButtonEnabled ?? true this.vibrateOnSteps = params?.vibrateOnSteps ?? true this.detectOcclusion = params?.detectOcclusion ?? true this.showFaceAnimation = params?.showFaceAnimation ?? true this.preventScreenRecording = params?.preventScreenRecording ?? false this.cameraPositionIOS = params?.cameraPositionIOS ?? _customization_camera_position__WEBPACK_IMPORTED_MODULE_0__.CameraPosition.FRONT this.cameraPositionAndroid = params?.cameraPositionAndroid this.screenOrientation = params?.screenOrientation ?? [_customization_screen_orientation__WEBPACK_IMPORTED_MODULE_1__.ScreenOrientation.PORTRAIT] this.timeout = params?.timeout this.holdStillDuration = params?.holdStillDuration } static fromJson(jsonObject) { if (jsonObject == null) return null const result = new FaceCaptureConfig() result.copyright = jsonObject["copyright"] result.cameraSwitchEnabled = jsonObject["cameraSwitchEnabled"] result.closeButtonEnabled = jsonObject["closeButtonEnabled"] result.torchButtonEnabled = jsonObject["torchButtonEnabled"] result.vibrateOnSteps = jsonObject["vibrateOnSteps"] result.detectOcclusion = jsonObject["detectOcclusion"] result.showFaceAnimation = jsonObject["showFaceAnimation"] result.preventScreenRecording = jsonObject["preventScreenRecording"] result.cameraPositionAndroid = jsonObject["cameraPositionAndroid"] result.cameraPositionIOS = jsonObject["cameraPositionIOS"] result.screenOrientation = jsonObject["screenOrientation"] result.timeout = jsonObject["timeout"] result.holdStillDuration = jsonObject["holdStillDuration"] return result } toJson() { return { "copyright": this.copyright, "cameraSwitchEnabled": this.cameraSwitchEnabled, "closeButtonEnabled": this.closeButtonEnabled, "torchButtonEnabled": this.torchButtonEnabled, "vibrateOnSteps": this.vibrateOnSteps, "detectOcclusion": this.detectOcclusion, "showFaceAnimation": this.showFaceAnimation, "preventScreenRecording": this.preventScreenRecording, "cameraPositionAndroid": this.cameraPositionAndroid, "cameraPositionIOS": this.cameraPositionIOS, "screenOrientation": this.screenOrientation, "timeout": this.timeout, "holdStillDuration": this.holdStillDuration, } } } /***/ }, /***/ "./src/face_capture/face_capture_exception.js" /*!****************************************************!*\ !*** ./src/face_capture/face_capture_exception.js ***! \****************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaceCaptureErrorCode: () => (/* binding */ FaceCaptureErrorCode), /* harmony export */ FaceCaptureException: () => (/* binding */ FaceCaptureException) /* harmony export */ }); class FaceCaptureException { code message static fromJson(jsonObject) { if (jsonObject == null) return null const result = new FaceCaptureException() result.code = jsonObject["code"] result.message = jsonObject["message"] ?? "" return result } toJson() { return { "code": this.code, "message": this.message, } } } const FaceCaptureErrorCode = { CANCEL: 0, TIMEOUT: 1, NOT_INITIALIZED: 2, SESSION_START_FAILED: 3, CAMERA_NOT_AVAILABLE: 4, CAMERA_NO_PERMISSION: 5, IN_PROGRESS_ALREADY: 6, CONTEXT_IS_NULL: 7, } /***/ }, /***/ "./src/face_capture/face_capture_image.js" /*!************************************************!*\ !*** ./src/face_capture/face_capture_image.js ***! \************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaceCaptureImage: () => (/* binding */ FaceCaptureImage), /* harmony export */ ImageType: () => (/* binding */ ImageType) /* harmony export */ }); class FaceCaptureImage { imageType image tag static fromJson(jsonObject) { if (jsonObject == null) return null const result = new FaceCaptureImage() result.imageType = jsonObject["imageType"] result.image = jsonObject["image"] result.tag = jsonObject["tag"] return result } toJson() { return { "imageType": this.imageType, "image": this.image, "tag": this.tag, } } } const ImageType = { PRINTED: 1, RFID: 2, LIVE: 3, DOCUMENT_WITH_LIVE: 4, EXTERNAL: 5, GHOST_PORTRAIT: 6, BARCODE: 7, } /***/ }, /***/ "./src/face_capture/face_capture_response.js" /*!***************************************************!*\ !*** ./src/face_capture/face_capture_response.js ***! \***************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaceCaptureResponse: () => (/* binding */ FaceCaptureResponse) /* harmony export */ }); /* harmony import */ var _face_capture_image__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./face_capture_image */ "./src/face_capture/face_capture_image.js"); /* harmony import */ var _face_capture_exception__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./face_capture_exception */ "./src/face_capture/face_capture_exception.js"); class FaceCaptureResponse { error image static fromJson(jsonObject) { if (jsonObject == null) return null const result = new FaceCaptureResponse() result.error = _face_capture_exception__WEBPACK_IMPORTED_MODULE_1__.FaceCaptureEx