gbc-kyc-kit 1.7.9 → 1.8.1

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.
@@ -14727,6 +14727,9 @@ function createFormControl(props = {}, flushRootRender) {
14727
14727
  }
14728
14728
  });
14729
14729
  _names.mount.add(name);
14730
+ if (!isUndefined(options.value)) {
14731
+ set$1(_formValues, name, options.value);
14732
+ }
14730
14733
  field ? disabledIsDefined && set$1(_formValues, name, options.disabled ? void 0 : get$2(_formValues, name, getFieldValue(field._f))) : updateValidAndValue(name, true, options.value);
14731
14734
  return {
14732
14735
  ...disabledIsDefined ? { disabled: options.disabled } : {},
@@ -14992,6 +14995,7 @@ function createFormControl(props = {}, flushRootRender) {
14992
14995
  }
14993
14996
  function useForm(props = {}) {
14994
14997
  const _formControl = React__default$1.useRef();
14998
+ const _values = React__default$1.useRef();
14995
14999
  const [formState, updateFormState] = React__default$1.useState({
14996
15000
  isDirty: false,
14997
15001
  isValidating: false,
@@ -15023,8 +15027,9 @@ function useForm(props = {}) {
15023
15027
  }
15024
15028
  });
15025
15029
  React__default$1.useEffect(() => {
15026
- if (props.values && !deepEqual(props.values, control._defaultValues)) {
15030
+ if (props.values && !deepEqual(props.values, _values.current)) {
15027
15031
  control._reset(props.values, control._options.resetOptions);
15032
+ _values.current = props.values;
15028
15033
  } else {
15029
15034
  control._resetDefaultValues();
15030
15035
  }
@@ -18792,19 +18797,36 @@ function isEmpty$2(val) {
18792
18797
  return false;
18793
18798
  }
18794
18799
  var lib$1 = isEmpty$2;
18795
- function useGeolocation() {
18800
+ const fetchCheckIp = async (inProduction) => {
18801
+ const parseReq = {
18802
+ method: "GET",
18803
+ path: "api/v1/kyc-kit/check_ip",
18804
+ inProduction
18805
+ };
18806
+ try {
18807
+ const res = await request2(parseReq);
18808
+ return res.data;
18809
+ } catch (error) {
18810
+ console.log(error);
18811
+ return error;
18812
+ }
18813
+ };
18814
+ function useGeolocation(inProduction) {
18796
18815
  const [geolocation, setGeolocation] = useState(null);
18797
18816
  useEffect(() => {
18798
- fetch("https://ipapi.co/json").then((res) => res.json()).then((res) => setGeolocation(res)).catch((error) => console.log(error));
18817
+ fetchCheckIp(inProduction).then((res) => setGeolocation(res)).catch((error) => console.log(error));
18799
18818
  }, []);
18800
18819
  return geolocation;
18801
18820
  }
18802
- const saveDataToDB = async ({ data: data2, component, eventId, inProduction, source: source2, clientId }) => {
18821
+ const saveDataToDB = async ({ data: data2, component, eventId, inProduction, source: source2, clientId, geolocation }) => {
18803
18822
  const parseReq = {
18804
18823
  method: "POST",
18805
18824
  inProduction,
18806
18825
  path: `api/v1/kyc-kit/events/register/${component}/${source2}/${clientId}/${eventId}`,
18807
- bodyParams: data2
18826
+ bodyParams: data2,
18827
+ customHeaders: {
18828
+ check_ip: JSON.stringify(geolocation)
18829
+ }
18808
18830
  };
18809
18831
  try {
18810
18832
  const res = await request2(parseReq);
@@ -18813,7 +18835,7 @@ const saveDataToDB = async ({ data: data2, component, eventId, inProduction, sou
18813
18835
  return error;
18814
18836
  }
18815
18837
  };
18816
- const BlackListController = (clientId, authorize, eventId, inProduction, countryCodeAllowed, source2) => {
18838
+ const BlackListController = (clientId, authorize, eventId, inProduction, countryCodeAllowed, source2, validateVpn) => {
18817
18839
  const [isLoading, setIsLoading] = useState(false);
18818
18840
  const [status, setStatus] = useState(clientId === void 0 ? "CLIENTID" : authorize === void 0 ? "TOKEN" : "");
18819
18841
  const [message, setMessage] = useState("");
@@ -18821,16 +18843,20 @@ const BlackListController = (clientId, authorize, eventId, inProduction, country
18821
18843
  const [select, setSelect] = useState("");
18822
18844
  const [dataReq, setDataReq] = useState({});
18823
18845
  const [countryCode, setCountryCode] = useState(null);
18824
- const geolocation = useGeolocation();
18846
+ const geolocation = useGeolocation(inProduction);
18825
18847
  useEffect(() => {
18826
- if (countryCodeAllowed && geolocation) {
18827
- if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.country_code))) {
18848
+ if (countryCodeAllowed && (geolocation == null ? void 0 : geolocation.data_connection.isocode)) {
18849
+ if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item.value === (geolocation == null ? void 0 : geolocation.data_connection.isocode))) {
18828
18850
  setStatus("COUNTRY_NOT_ALLOWED");
18829
18851
  setMessage("Pa\xEDs no autorizado");
18830
18852
  }
18831
18853
  }
18832
- countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
18833
- }, [geolocation, countryCodeAllowed]);
18854
+ if (validateVpn && (geolocation == null ? void 0 : geolocation.data_connection.proxy) == "yes") {
18855
+ setStatus("USE_VPN");
18856
+ setMessage("Uso de Proxy o VPN no permitido");
18857
+ }
18858
+ countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.data_connection.isocode);
18859
+ }, [geolocation, countryCodeAllowed, validateVpn]);
18834
18860
  const clearState = () => {
18835
18861
  reset();
18836
18862
  complementarySearch();
@@ -18923,7 +18949,8 @@ const BlackListController = (clientId, authorize, eventId, inProduction, country
18923
18949
  eventId,
18924
18950
  source: source2,
18925
18951
  inProduction,
18926
- clientId
18952
+ clientId,
18953
+ geolocation
18927
18954
  });
18928
18955
  if (!lib$1(match2)) {
18929
18956
  setListMatch(match2[0]);
@@ -20085,8 +20112,7 @@ function ErrorAnimation({
20085
20112
  });
20086
20113
  }
20087
20114
  function ListsAccordion({
20088
- lists,
20089
- handleReport
20115
+ lists
20090
20116
  }) {
20091
20117
  function parseName(value) {
20092
20118
  let name = value.replace(/[\[\]']+/g, "");
@@ -20294,6 +20320,20 @@ const grey = {
20294
20320
  A700: "#616161"
20295
20321
  };
20296
20322
  var grey$1 = grey;
20323
+ function _extends$1() {
20324
+ _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
20325
+ for (var i = 1; i < arguments.length; i++) {
20326
+ var source2 = arguments[i];
20327
+ for (var key in source2) {
20328
+ if (Object.prototype.hasOwnProperty.call(source2, key)) {
20329
+ target[key] = source2[key];
20330
+ }
20331
+ }
20332
+ }
20333
+ return target;
20334
+ };
20335
+ return _extends$1.apply(this, arguments);
20336
+ }
20297
20337
  function isPlainObject(item) {
20298
20338
  return item !== null && typeof item === "object" && item.constructor === Object;
20299
20339
  }
@@ -20310,9 +20350,7 @@ function deepClone(source2) {
20310
20350
  function deepmerge(target, source2, options = {
20311
20351
  clone: true
20312
20352
  }) {
20313
- const output = options.clone ? {
20314
- ...target
20315
- } : target;
20353
+ const output = options.clone ? _extends$1({}, target) : target;
20316
20354
  if (isPlainObject(target) && isPlainObject(source2)) {
20317
20355
  Object.keys(source2).forEach((key) => {
20318
20356
  if (key === "__proto__") {
@@ -20343,15 +20381,10 @@ function capitalize(string2) {
20343
20381
  return string2.charAt(0).toUpperCase() + string2.slice(1);
20344
20382
  }
20345
20383
  function resolveProps(defaultProps, props) {
20346
- const output = {
20347
- ...props
20348
- };
20384
+ const output = _extends$1({}, props);
20349
20385
  Object.keys(defaultProps).forEach((propName) => {
20350
20386
  if (propName.toString().match(/^(components|slots)$/)) {
20351
- output[propName] = {
20352
- ...defaultProps[propName],
20353
- ...output[propName]
20354
- };
20387
+ output[propName] = _extends$1({}, defaultProps[propName], output[propName]);
20355
20388
  } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
20356
20389
  const defaultSlotProps = defaultProps[propName] || {};
20357
20390
  const slotProps = props[propName];
@@ -20361,9 +20394,7 @@ function resolveProps(defaultProps, props) {
20361
20394
  } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
20362
20395
  output[propName] = slotProps;
20363
20396
  } else {
20364
- output[propName] = {
20365
- ...slotProps
20366
- };
20397
+ output[propName] = _extends$1({}, slotProps);
20367
20398
  Object.keys(defaultSlotProps).forEach((slotPropName) => {
20368
20399
  output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
20369
20400
  });
@@ -20436,20 +20467,6 @@ function generateUtilityClasses(componentName, slots, globalStatePrefix = "Mui")
20436
20467
  return result;
20437
20468
  }
20438
20469
  var THEME_ID = "$$material";
20439
- function _extends$1() {
20440
- _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
20441
- for (var i = 1; i < arguments.length; i++) {
20442
- var source2 = arguments[i];
20443
- for (var key in source2) {
20444
- if (Object.prototype.hasOwnProperty.call(source2, key)) {
20445
- target[key] = source2[key];
20446
- }
20447
- }
20448
- }
20449
- return target;
20450
- };
20451
- return _extends$1.apply(this, arguments);
20452
- }
20453
20470
  function _objectWithoutPropertiesLoose$1(source2, excluded) {
20454
20471
  if (source2 == null)
20455
20472
  return {};
@@ -22255,8 +22272,8 @@ const width = style$1({
22255
22272
  const maxWidth = (props) => {
22256
22273
  if (props.maxWidth !== void 0 && props.maxWidth !== null) {
22257
22274
  const styleFromPropValue = (propValue) => {
22258
- var _props$theme, _props$theme$breakpoi, _props$theme$breakpoi2;
22259
- const breakpoint = ((_props$theme = props.theme) == null ? void 0 : (_props$theme$breakpoi = _props$theme.breakpoints) == null ? void 0 : (_props$theme$breakpoi2 = _props$theme$breakpoi.values) == null ? void 0 : _props$theme$breakpoi2[propValue]) || values[propValue];
22275
+ var _props$theme;
22276
+ const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values[propValue];
22260
22277
  return {
22261
22278
  maxWidth: breakpoint || sizingTransform(propValue)
22262
22279
  };
@@ -22723,7 +22740,7 @@ const splitProps = (props) => {
22723
22740
  systemProps: {},
22724
22741
  otherProps: {}
22725
22742
  };
22726
- const config = (_props$theme$unstable = props == null ? void 0 : (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig$1;
22743
+ const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig$1;
22727
22744
  Object.keys(props).forEach((prop) => {
22728
22745
  if (config[prop]) {
22729
22746
  result.systemProps[prop] = props[prop];
@@ -22829,12 +22846,12 @@ const getVariantStyles = (name, theme) => {
22829
22846
  return variantsStyles;
22830
22847
  };
22831
22848
  const variantsResolver = (props, styles2, theme, name) => {
22832
- var _theme$components, _theme$components$nam;
22849
+ var _theme$components;
22833
22850
  const {
22834
22851
  ownerState = {}
22835
22852
  } = props;
22836
22853
  const variantsStyles = [];
22837
- const themeVariants = theme == null ? void 0 : (_theme$components = theme.components) == null ? void 0 : (_theme$components$nam = _theme$components[name]) == null ? void 0 : _theme$components$nam.variants;
22854
+ const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[name]) == null ? void 0 : _theme$components.variants;
22838
22855
  if (themeVariants) {
22839
22856
  themeVariants.forEach((themeVariant) => {
22840
22857
  let isMatch = true;
@@ -23587,26 +23604,26 @@ const SvgIconRoot = styled$1("svg", {
23587
23604
  theme,
23588
23605
  ownerState
23589
23606
  }) => {
23590
- var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette$ownerState$c2, _palette2, _palette2$action, _palette3, _palette3$action;
23607
+ var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3;
23591
23608
  return {
23592
23609
  userSelect: "none",
23593
23610
  width: "1em",
23594
23611
  height: "1em",
23595
23612
  display: "inline-block",
23596
- fill: "currentColor",
23613
+ fill: ownerState.hasSvgAsChild ? void 0 : "currentColor",
23597
23614
  flexShrink: 0,
23598
- transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, "fill", {
23599
- duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter
23615
+ transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, "fill", {
23616
+ duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter
23600
23617
  }),
23601
23618
  fontSize: {
23602
23619
  inherit: "inherit",
23603
- small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || "1.25rem",
23604
- medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || "1.5rem",
23605
- large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || "2.1875rem"
23620
+ small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || "1.25rem",
23621
+ medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || "1.5rem",
23622
+ large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || "2.1875rem"
23606
23623
  }[ownerState.fontSize],
23607
- color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null ? void 0 : (_palette$ownerState$c2 = _palette[ownerState.color]) == null ? void 0 : _palette$ownerState$c2.main) != null ? _palette$ownerState$c : {
23608
- action: (_palette2 = (theme.vars || theme).palette) == null ? void 0 : (_palette2$action = _palette2.action) == null ? void 0 : _palette2$action.active,
23609
- disabled: (_palette3 = (theme.vars || theme).palette) == null ? void 0 : (_palette3$action = _palette3.action) == null ? void 0 : _palette3$action.disabled,
23624
+ color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : {
23625
+ action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active,
23626
+ disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled,
23610
23627
  inherit: void 0
23611
23628
  }[ownerState.color]
23612
23629
  };
@@ -23627,13 +23644,15 @@ const SvgIcon = /* @__PURE__ */ React$1.forwardRef(function SvgIcon2(inProps, re
23627
23644
  titleAccess,
23628
23645
  viewBox = "0 0 24 24"
23629
23646
  } = props, other = _objectWithoutPropertiesLoose$1(props, _excluded);
23647
+ const hasSvgAsChild = /* @__PURE__ */ React$1.isValidElement(children) && children.type === "svg";
23630
23648
  const ownerState = _extends$1({}, props, {
23631
23649
  color: color2,
23632
23650
  component,
23633
23651
  fontSize,
23634
23652
  instanceFontSize: inProps.fontSize,
23635
23653
  inheritViewBox,
23636
- viewBox
23654
+ viewBox,
23655
+ hasSvgAsChild
23637
23656
  });
23638
23657
  const more = {};
23639
23658
  if (!inheritViewBox) {
@@ -23648,9 +23667,9 @@ const SvgIcon = /* @__PURE__ */ React$1.forwardRef(function SvgIcon2(inProps, re
23648
23667
  "aria-hidden": titleAccess ? void 0 : true,
23649
23668
  role: titleAccess ? "img" : void 0,
23650
23669
  ref
23651
- }, more, other, {
23670
+ }, more, other, hasSvgAsChild && children.props, {
23652
23671
  ownerState,
23653
- children: [children, titleAccess ? /* @__PURE__ */ jsx("title", {
23672
+ children: [hasSvgAsChild ? children.props.children : children, titleAccess ? /* @__PURE__ */ jsx("title", {
23654
23673
  children: titleAccess
23655
23674
  }) : null]
23656
23675
  }));
@@ -23678,79 +23697,29 @@ const Box = createBox({
23678
23697
  });
23679
23698
  var Box$1 = Box;
23680
23699
  function StatusComponent({
23681
- title,
23682
23700
  status,
23683
- message,
23684
- lists,
23685
- complementarySearch,
23686
- clearState,
23687
- dataReq
23701
+ message
23688
23702
  }) {
23689
- const arrWarning = ["TOKEN", "CLIENTID", "MATCH", "NOT_VERIFY", "COUNTRY_NOT_ALLOWED", "0", 400, 404, 0, 429, 500];
23703
+ const arrWarning = ["TOKEN", "CLIENTID", "MATCH", "NOT_VERIFY", "COUNTRY_NOT_ALLOWED", "USE_VPN", "0", 400, 404, 0, 429, 500];
23690
23704
  const arrSuccess = ["ACCEPT", "Success", "FACER_OK"];
23691
- const [report, setReport] = useState({});
23692
- const handleReport = (list) => {
23693
- setReport(list);
23694
- };
23695
- return /* @__PURE__ */ jsx(Fragment, {
23696
- children: !lib$1(report) ? /* @__PURE__ */ jsx(Fragment, {
23697
- children: /* @__PURE__ */ jsxs("div", {
23698
- style: {
23699
- width: "100%"
23700
- },
23701
- children: [/* @__PURE__ */ jsx("h4", {
23702
- children: "Lista de sanciones"
23703
- }), /* @__PURE__ */ jsx("p", {
23704
- children: report[0]
23705
- }), /* @__PURE__ */ jsx("div", {
23706
- children: /* @__PURE__ */ jsx("ul", {
23707
- style: {
23708
- listStyleType: "none"
23709
- },
23710
- children: report.map((item, i) => {
23711
- return /* @__PURE__ */ jsx("li", {
23712
- style: {
23713
- textAlign: "left"
23714
- },
23715
- children: item
23716
- }, i);
23717
- })
23718
- })
23719
- })]
23720
- })
23721
- }) : /* @__PURE__ */ jsxs(Fragment, {
23722
- children: [arrWarning.includes(status) ? /* @__PURE__ */ jsx(ErrorAnimation, {
23723
- message: message ? message : "Error obteniendo el Token"
23724
- }) : arrSuccess.includes(status) ? /* @__PURE__ */ jsx(SuccessAnimation, {
23725
- message
23726
- }) : null, !lib$1(lists) && /* @__PURE__ */ jsx(ListsAccordion, {
23727
- lists,
23728
- handleReport
23729
- }), status !== "COUNTRY_NOT_ALLOWED" && status !== "TOKEN" ? /* @__PURE__ */ jsxs(Box$1, {
23730
- className: `${lists && Object.keys(lists).length > 0 ? "both-button" : ""}`,
23731
- children: [/* @__PURE__ */ jsx(CustomButton, {
23732
- className: "my-2 col-6 warning-button",
23733
- onClick: () => clearState(),
23734
- children: "Volver"
23735
- }), complementarySearch && Object.keys(lists).length > 0 && /* @__PURE__ */ jsx(CustomButton, {
23736
- className: "my-1 col-6",
23737
- onClick: complementarySearch,
23738
- children: "Filtrar por"
23739
- })]
23740
- }) : null]
23741
- })
23705
+ return /* @__PURE__ */ jsxs(Fragment, {
23706
+ children: [arrWarning.includes(status) && /* @__PURE__ */ jsx(ErrorAnimation, {
23707
+ message: message ? message : "Error obteniendo el Token"
23708
+ }), arrSuccess.includes(status) && /* @__PURE__ */ jsx(SuccessAnimation, {
23709
+ message
23710
+ })]
23742
23711
  });
23743
23712
  }
23744
23713
  function BlackList({
23745
23714
  mode,
23746
- loader,
23747
23715
  icon,
23748
23716
  clientId,
23749
23717
  authorize,
23750
23718
  inProduction,
23751
23719
  source: source2,
23752
23720
  eventId,
23753
- countryCodeAllowed
23721
+ countryCodeAllowed,
23722
+ validateVpn
23754
23723
  }) {
23755
23724
  const {
23756
23725
  onSendSubmitDocument,
@@ -23767,7 +23736,7 @@ function BlackList({
23767
23736
  complementarySearch,
23768
23737
  dataReq,
23769
23738
  countryCode
23770
- } = BlackListController(clientId, authorize, eventId, inProduction, countryCodeAllowed, source2);
23739
+ } = BlackListController(clientId, authorize, eventId, inProduction, countryCodeAllowed, source2, validateVpn);
23771
23740
  return /* @__PURE__ */ jsxs("div", {
23772
23741
  className: `kit-gbc ${mode}`,
23773
23742
  children: [/* @__PURE__ */ jsx(k$1, {
@@ -23785,19 +23754,20 @@ function BlackList({
23785
23754
  id: "blacklist",
23786
23755
  children: /* @__PURE__ */ jsxs("div", {
23787
23756
  className: "sub",
23788
- children: [/* @__PURE__ */ jsx("h4", {
23789
- children: "Lista de sanciones y PEP's"
23790
- }), !lib$1(status) ? /* @__PURE__ */ jsx(StatusComponent, {
23791
- status,
23792
- message: message.message ? message.message : message,
23793
- lists: listMatch,
23794
- complementarySearch,
23795
- clearState,
23796
- dataReq
23797
- }) : /* @__PURE__ */ jsxs(Fragment, {
23798
- children: [/* @__PURE__ */ jsx("p", {
23757
+ children: [/* @__PURE__ */ jsxs("div", {
23758
+ className: "header-component",
23759
+ children: [/* @__PURE__ */ jsx("h4", {
23760
+ children: "Lista de sanciones y PEP's"
23761
+ }), !lib$1(status) ? /* @__PURE__ */ jsx(StatusComponent, {
23762
+ status,
23763
+ message: message.message ? message.message : message
23764
+ }) : /* @__PURE__ */ jsx("p", {
23799
23765
  children: "Ingrese al menos el primer nombre y apellido de la persona a consultar."
23800
- }), /* @__PURE__ */ jsx(CustomInputForm, {
23766
+ })]
23767
+ }), !lib$1(listMatch) && /* @__PURE__ */ jsx(ListsAccordion, {
23768
+ lists: listMatch
23769
+ }), lib$1(status) && /* @__PURE__ */ jsxs(Fragment, {
23770
+ children: [/* @__PURE__ */ jsx(CustomInputForm, {
23801
23771
  type: "text",
23802
23772
  name: "first_name",
23803
23773
  placeholder: "Primer nombre",
@@ -23851,47 +23821,63 @@ function BlackList({
23851
23821
  type: "submit",
23852
23822
  children: "Procesar"
23853
23823
  })]
23854
- })]
23824
+ }), status !== "COUNTRY_NOT_ALLOWED" && status !== "TOKEN" && status !== "CLIENTID" && status !== "USE_VPN" ? /* @__PURE__ */ jsxs(Box$1, {
23825
+ className: `${listMatch && Object.keys(listMatch).length > 0 ? "both-button" : ""}`,
23826
+ children: [!lib$1(status) && /* @__PURE__ */ jsx(CustomButton, {
23827
+ type: "warning",
23828
+ className: "my-2 col-6 warning-button",
23829
+ onClick: () => clearState(),
23830
+ children: "Volver"
23831
+ }), complementarySearch && Object.keys(listMatch).length > 0 && /* @__PURE__ */ jsx(CustomButton, {
23832
+ className: "my-1 col-6",
23833
+ onClick: complementarySearch,
23834
+ children: "Filtrar por"
23835
+ })]
23836
+ }) : null]
23855
23837
  })
23856
23838
  })]
23857
23839
  });
23858
23840
  }
23859
23841
  BlackList.defaultProps = {
23860
23842
  mode: "light",
23861
- loader: false,
23862
23843
  inProduction: "prd",
23863
23844
  countryCodeAllowed: null,
23864
23845
  source: "component",
23865
- eventId: null
23846
+ eventId: null,
23847
+ validateVpn: false
23866
23848
  };
23867
23849
  BlackList.propTypes = {
23868
23850
  mode: propTypes.exports.PropTypes.string,
23869
- loader: propTypes.exports.PropTypes.bool,
23870
23851
  icon: propTypes.exports.PropTypes.func,
23871
23852
  clientId: propTypes.exports.PropTypes.string.isRequired,
23872
23853
  authorize: propTypes.exports.PropTypes.func.isRequired,
23873
23854
  inProduction: propTypes.exports.PropTypes.string,
23874
23855
  countryCodeAllowed: propTypes.exports.PropTypes.array,
23875
23856
  source: propTypes.exports.PropTypes.string,
23876
- eventId: propTypes.exports.PropTypes.string
23857
+ eventId: propTypes.exports.PropTypes.string,
23858
+ validateVpn: propTypes.exports.PropTypes.bool
23877
23859
  };
23878
- const DocumentReaderController = (dataDocument, clientId, authorize, eventId, source2, inProduction, countryCodeAllowed) => {
23860
+ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, source2, inProduction, countryCodeAllowed, validateVpn) => {
23879
23861
  const [docImage, setDocImage] = useState({});
23880
23862
  const [base64, setBase64] = useState({});
23881
23863
  const [message, setMessage] = useState("");
23882
23864
  const [isLoading, setIsLoading] = useState(false);
23883
23865
  const [status, setStatus] = useState(clientId === void 0 ? "CLIENTID" : authorize === void 0 ? "TOKEN" : "");
23884
23866
  const [countryCode, setCountryCode] = useState(null);
23885
- const geolocation = useGeolocation();
23867
+ const geolocation = useGeolocation(inProduction);
23886
23868
  const [dualMode, setDualMode] = useState(false);
23887
23869
  useEffect(() => {
23888
- if (countryCodeAllowed && geolocation) {
23889
- if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.country_code))) {
23870
+ if (countryCodeAllowed && (geolocation == null ? void 0 : geolocation.data_connection.isocode)) {
23871
+ if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.data_connection.isocode))) {
23890
23872
  setStatus("COUNTRY_NOT_ALLOWED");
23891
23873
  setMessage("Pa\xEDs no autorizado");
23892
23874
  }
23893
23875
  }
23894
- countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
23876
+ if (validateVpn && (geolocation == null ? void 0 : geolocation.data_connection.proxy) == "yes") {
23877
+ setStatus("USE_VPN");
23878
+ setMessage("Uso de Proxy o VPN no permitido");
23879
+ }
23880
+ countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.data_connection.isocode);
23895
23881
  }, [geolocation, countryCodeAllowed]);
23896
23882
  const clearState = () => {
23897
23883
  setDocImage({});
@@ -23952,7 +23938,8 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
23952
23938
  eventId,
23953
23939
  source: source2,
23954
23940
  inProduction,
23955
- clientId
23941
+ clientId,
23942
+ geolocation
23956
23943
  });
23957
23944
  fullData && await dataDocument(fullData);
23958
23945
  const {
@@ -24047,7 +24034,8 @@ function DocumentReader({
24047
24034
  eventId,
24048
24035
  source: source2,
24049
24036
  inProduction,
24050
- countryCodeAllowed
24037
+ countryCodeAllowed,
24038
+ validateVpn
24051
24039
  }) {
24052
24040
  const {
24053
24041
  onSendSubmitDocument,
@@ -24062,7 +24050,7 @@ function DocumentReader({
24062
24050
  countryCode,
24063
24051
  setDualMode,
24064
24052
  dualMode
24065
- } = DocumentReaderController(dataDocument, clientId, authorize, eventId, source2, inProduction, countryCodeAllowed);
24053
+ } = DocumentReaderController(dataDocument, clientId, authorize, eventId, source2, inProduction, countryCodeAllowed, validateVpn);
24066
24054
  return /* @__PURE__ */ jsxs("div", {
24067
24055
  className: `kit-gbc ${mode}`,
24068
24056
  children: [/* @__PURE__ */ jsx(k$1, {
@@ -24077,6 +24065,7 @@ function DocumentReader({
24077
24065
  pauseOnHover: true
24078
24066
  }), isLoading || countryCodeAllowed !== null && !countryCode ? /* @__PURE__ */ jsx(BackDropLoader, {}) : null, /* @__PURE__ */ jsx("form", {
24079
24067
  onSubmit: simpleHandleSubmit(onSendSubmitDocument),
24068
+ id: "document-reader",
24080
24069
  children: /* @__PURE__ */ jsxs("div", {
24081
24070
  className: "sub",
24082
24071
  children: [/* @__PURE__ */ jsxs("div", {
@@ -24085,8 +24074,7 @@ function DocumentReader({
24085
24074
  children: "Lectura del documento"
24086
24075
  }), !lib$1(status) ? /* @__PURE__ */ jsx(StatusComponent, {
24087
24076
  status,
24088
- message,
24089
- clearState
24077
+ message
24090
24078
  }) : /* @__PURE__ */ jsx("p", {
24091
24079
  children: "Utilice la c\xE1mara de su dispositivo para capturar una foto de su documento de identidad."
24092
24080
  })]
@@ -24150,14 +24138,14 @@ function DocumentReader({
24150
24138
  type: "submit",
24151
24139
  children: "Procesar"
24152
24140
  })]
24153
- }), docImage.firstImage && dualMode && !status && docImage.secondImage || !dualMode && !status && docImage.secondImage ? /* @__PURE__ */ jsx(Box$1, {
24141
+ }), docImage.firstImage && dualMode && docImage.secondImage || !dualMode && docImage.secondImage || status && status !== "COUNTRY_NOT_ALLOWED" && status !== "TOKEN" && status !== "CLIENTID" && status !== "USE_VPN" ? /* @__PURE__ */ jsx(Box$1, {
24154
24142
  children: /* @__PURE__ */ jsxs("div", {
24155
- className: "both-button",
24143
+ className: `${!status && "both-button"}`,
24156
24144
  children: [/* @__PURE__ */ jsx(CustomButton, {
24157
24145
  type: "warning",
24158
24146
  onClick: () => clearState(),
24159
24147
  children: "Volver"
24160
- }), /* @__PURE__ */ jsx(CustomButton, {
24148
+ }), !status && /* @__PURE__ */ jsx(CustomButton, {
24161
24149
  type: "submit",
24162
24150
  children: "Procesar"
24163
24151
  })]
@@ -24174,7 +24162,8 @@ DocumentReader.defaultProps = {
24174
24162
  inProduction: "prd",
24175
24163
  countryCodeAllowed: null,
24176
24164
  source: "component",
24177
- eventId: null
24165
+ eventId: null,
24166
+ validateVpn: false
24178
24167
  };
24179
24168
  DocumentReader.propTypes = {
24180
24169
  mode: propTypes.exports.PropTypes.string,
@@ -24186,7 +24175,8 @@ DocumentReader.propTypes = {
24186
24175
  inProduction: propTypes.exports.PropTypes.string,
24187
24176
  countryCodeAllowed: propTypes.exports.PropTypes.array,
24188
24177
  source: propTypes.exports.PropTypes.string,
24189
- eventId: propTypes.exports.PropTypes.string
24178
+ eventId: propTypes.exports.PropTypes.string,
24179
+ validateVpn: propTypes.exports.PropTypes.bool
24190
24180
  };
24191
24181
  const fetchFaceMatch = async (faceMatch, selfie, inProduction, customHeaders) => {
24192
24182
  const parseReq = {
@@ -24207,7 +24197,7 @@ const fetchFaceMatch = async (faceMatch, selfie, inProduction, customHeaders) =>
24207
24197
  return error;
24208
24198
  }
24209
24199
  };
24210
- const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authorize, inProduction, picBase64, setTakePic, countryCodeAllowed) => {
24200
+ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authorize, inProduction, picBase64, setTakePic, countryCodeAllowed, validateVpn) => {
24211
24201
  const [docImage, setDocImage] = useState({});
24212
24202
  const [image, setImage] = useState("");
24213
24203
  const [message, setMessage] = useState("");
@@ -24216,7 +24206,7 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
24216
24206
  const webcamRef = useRef(null);
24217
24207
  const [url, setUrl] = useState(null);
24218
24208
  const [countryCode, setCountryCode] = useState(null);
24219
- const geolocation = useGeolocation();
24209
+ const geolocation = useGeolocation(inProduction);
24220
24210
  const capturePhoto = useCallback(async () => {
24221
24211
  const imageSrc = webcamRef.current.getScreenshot({
24222
24212
  width: 480,
@@ -24228,12 +24218,16 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
24228
24218
  }, [webcamRef]);
24229
24219
  useEffect(() => {
24230
24220
  if (countryCodeAllowed && geolocation) {
24231
- if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.country_code))) {
24221
+ if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.data_connection.isocode))) {
24232
24222
  setStatus("COUNTRY_NOT_ALLOWED");
24233
24223
  setMessage("Pa\xEDs no autorizado");
24234
24224
  }
24235
24225
  }
24236
- countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
24226
+ if (validateVpn && (geolocation == null ? void 0 : geolocation.data_connection.proxy) == "yes") {
24227
+ setStatus("USE_VPN");
24228
+ setMessage("Uso de Proxy o VPN no permitido");
24229
+ }
24230
+ countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.data_connection.isocode);
24237
24231
  }, [geolocation, countryCodeAllowed]);
24238
24232
  const clearState = () => {
24239
24233
  setDocImage({});
@@ -24269,7 +24263,8 @@ const FaceMatchController = (dataFaceMatch, clientId, eventId, source2, authoriz
24269
24263
  eventId,
24270
24264
  source: source2,
24271
24265
  inProduction,
24272
- clientId
24266
+ clientId,
24267
+ geolocation
24273
24268
  });
24274
24269
  const {
24275
24270
  message: message2
@@ -24724,7 +24719,8 @@ function FaceMatch({
24724
24719
  picBase64,
24725
24720
  eventId,
24726
24721
  source: source2,
24727
- countryCodeAllowed
24722
+ countryCodeAllowed,
24723
+ validateVpn
24728
24724
  }) {
24729
24725
  const [takePic, setTakePic] = useState(false);
24730
24726
  const {
@@ -24740,7 +24736,7 @@ function FaceMatch({
24740
24736
  url,
24741
24737
  setUrl,
24742
24738
  countryCode
24743
- } = FaceMatchController(dataFaceMatch, clientId, eventId, source2, authorize, inProduction, picBase64, setTakePic, countryCodeAllowed);
24739
+ } = FaceMatchController(dataFaceMatch, clientId, eventId, source2, authorize, inProduction, picBase64, setTakePic, countryCodeAllowed, validateVpn);
24744
24740
  const onUserMedia = (e2) => {
24745
24741
  console.log(e2, "userMedia");
24746
24742
  };
@@ -24764,81 +24760,84 @@ function FaceMatch({
24764
24760
  pauseOnHover: true
24765
24761
  }), isLoading || countryCodeAllowed !== null && !countryCode ? /* @__PURE__ */ jsx(BackDropLoader, {}) : null, /* @__PURE__ */ jsx("form", {
24766
24762
  onSubmit: simpleHandleSubmit(onSendSubmitSelfie),
24763
+ id: "face-match",
24767
24764
  children: /* @__PURE__ */ jsxs("div", {
24768
24765
  className: "sub",
24769
- children: [/* @__PURE__ */ jsx("h4", {
24770
- children: "Comparaci\xF3n de rostro"
24771
- }), !lib$1(status) ? /* @__PURE__ */ jsx(StatusComponent, {
24772
- status,
24773
- message,
24774
- clearState
24775
- }) : /* @__PURE__ */ jsxs(Fragment, {
24776
- children: [/* @__PURE__ */ jsx("p", {
24766
+ children: [/* @__PURE__ */ jsxs("div", {
24767
+ className: "header-component",
24768
+ children: [/* @__PURE__ */ jsx("h4", {
24769
+ children: "Comparaci\xF3n de rostro"
24770
+ }), !lib$1(status) ? /* @__PURE__ */ jsx(StatusComponent, {
24771
+ status,
24772
+ message
24773
+ }) : /* @__PURE__ */ jsx("p", {
24777
24774
  children: "Utilice la c\xE1mara de su dispositivo para capturar una selfie."
24778
- }), /* @__PURE__ */ jsxs("div", {
24779
- className: "pics-container",
24780
- children: [/* @__PURE__ */ jsx("div", {
24775
+ })]
24776
+ }), lib$1(status) && /* @__PURE__ */ jsxs("div", {
24777
+ className: "pics-container",
24778
+ children: [/* @__PURE__ */ jsx("div", {
24779
+ className: "box-image",
24780
+ children: lib$1(picBase64) ? /* @__PURE__ */ jsxs("div", {
24781
+ className: "upload-document without-image",
24782
+ style: {
24783
+ backgroundImage: `url(${dummyImage})`
24784
+ },
24785
+ children: [/* @__PURE__ */ jsx(ImageNotSupportedIcon, {}), /* @__PURE__ */ jsx("p", {
24786
+ children: "Imagen no detectada"
24787
+ })]
24788
+ }) : /* @__PURE__ */ jsx("div", {
24789
+ className: "upload-document bg-img-container",
24790
+ style: {
24791
+ backgroundImage: `url(${picBase64})`
24792
+ }
24793
+ })
24794
+ }), /* @__PURE__ */ jsx("div", {
24795
+ className: "icon",
24796
+ children: /* @__PURE__ */ jsx(CompareArrowsIcon, {})
24797
+ }), /* @__PURE__ */ jsx("div", {
24798
+ children: !takePic ? /* @__PURE__ */ jsx("label", {
24781
24799
  className: "box-image",
24782
- children: lib$1(picBase64) ? /* @__PURE__ */ jsxs("div", {
24800
+ children: /* @__PURE__ */ jsxs("div", {
24783
24801
  className: "upload-document without-image",
24784
24802
  style: {
24785
24803
  backgroundImage: `url(${dummyImage})`
24786
24804
  },
24787
- children: [/* @__PURE__ */ jsx(ImageNotSupportedIcon, {}), /* @__PURE__ */ jsx("p", {
24788
- children: "Imagen no detectada"
24805
+ children: [/* @__PURE__ */ jsx(CloudUploadIcon, {}), /* @__PURE__ */ jsx("p", {
24806
+ children: lib$1(docImage) ? "Tomar selfie" : docImage
24807
+ }), /* @__PURE__ */ jsx("input", {
24808
+ hidden: true,
24809
+ accept: "image/*",
24810
+ capture: "camera",
24811
+ id: "docImage",
24812
+ onClick: () => setTakePic(true)
24789
24813
  })]
24790
- }) : /* @__PURE__ */ jsx("div", {
24791
- className: "upload-document bg-img-container",
24792
- style: {
24793
- backgroundImage: `url(${picBase64})`
24794
- }
24795
24814
  })
24796
- }), /* @__PURE__ */ jsx("div", {
24797
- className: "icon",
24798
- children: /* @__PURE__ */ jsx(CompareArrowsIcon, {})
24799
- }), /* @__PURE__ */ jsx("div", {
24800
- children: !takePic ? /* @__PURE__ */ jsx("label", {
24801
- className: "box-image",
24802
- children: /* @__PURE__ */ jsxs("div", {
24803
- className: "upload-document without-image",
24815
+ }) : /* @__PURE__ */ jsx("div", {
24816
+ className: "box-image",
24817
+ children: !url ? /* @__PURE__ */ jsx(Webcam, {
24818
+ ref: webcamRef,
24819
+ audio: false,
24820
+ screenshotFormat: "image/png",
24821
+ videoConstraints,
24822
+ forceScreenshotSourceSize: true,
24823
+ onUserMedia,
24824
+ mirrored: true
24825
+ }) : /* @__PURE__ */ jsx(Fragment, {
24826
+ children: /* @__PURE__ */ jsx("div", {
24827
+ className: "upload-document bg-img-container",
24804
24828
  style: {
24805
- backgroundImage: `url(${dummyImage})`
24806
- },
24807
- children: [/* @__PURE__ */ jsx(CloudUploadIcon, {}), /* @__PURE__ */ jsx("p", {
24808
- children: lib$1(docImage) ? "Tomar selfie" : docImage
24809
- }), /* @__PURE__ */ jsx("input", {
24810
- hidden: true,
24811
- accept: "image/*",
24812
- capture: "camera",
24813
- id: "docImage",
24814
- onClick: () => setTakePic(true)
24815
- })]
24816
- })
24817
- }) : /* @__PURE__ */ jsx("div", {
24818
- className: "box-image",
24819
- children: !url ? /* @__PURE__ */ jsx(Webcam, {
24820
- ref: webcamRef,
24821
- audio: false,
24822
- screenshotFormat: "image/png",
24823
- videoConstraints,
24824
- forceScreenshotSourceSize: true,
24825
- onUserMedia,
24826
- mirrored: true
24827
- }) : /* @__PURE__ */ jsx(Fragment, {
24828
- children: /* @__PURE__ */ jsx("div", {
24829
- className: "upload-document bg-img-container",
24830
- style: {
24831
- backgroundImage: `url(${url})`
24832
- }
24833
- })
24829
+ backgroundImage: `url(${url})`
24830
+ }
24834
24831
  })
24835
24832
  })
24836
- })]
24837
- }), takePic && !url && webcamRef && /* @__PURE__ */ jsx(CustomButton, {
24838
- type: "button",
24839
- onClick: capturePhoto,
24840
- children: "Capturar Selfie"
24841
- }), url && /* @__PURE__ */ jsxs("div", {
24833
+ })
24834
+ })]
24835
+ }), takePic && !url && webcamRef && /* @__PURE__ */ jsx(CustomButton, {
24836
+ type: "button",
24837
+ onClick: capturePhoto,
24838
+ children: "Capturar Selfie"
24839
+ }), /* @__PURE__ */ jsx(Fragment, {
24840
+ children: url && /* @__PURE__ */ jsxs("div", {
24842
24841
  style: {
24843
24842
  display: "flex",
24844
24843
  justifyContent: "space-between"
@@ -24852,7 +24851,7 @@ function FaceMatch({
24852
24851
  type: "submit",
24853
24852
  children: "Procesar"
24854
24853
  })]
24855
- })]
24854
+ })
24856
24855
  })]
24857
24856
  })
24858
24857
  })]
@@ -24865,7 +24864,8 @@ FaceMatch.defaultProps = {
24865
24864
  picBase64: "",
24866
24865
  countryCodeAllowed: null,
24867
24866
  eventId: null,
24868
- source: "component"
24867
+ source: "component",
24868
+ validateVpn: false
24869
24869
  };
24870
24870
  FaceMatch.propTypes = {
24871
24871
  mode: propTypes.exports.PropTypes.string,
@@ -24878,39 +24878,22 @@ FaceMatch.propTypes = {
24878
24878
  picBase64: propTypes.exports.PropTypes.string.isRequired,
24879
24879
  countryCodeAllowed: propTypes.exports.PropTypes.array,
24880
24880
  eventId: propTypes.exports.PropTypes.string,
24881
- source: propTypes.exports.PropTypes.string
24881
+ source: propTypes.exports.PropTypes.string,
24882
+ validateVpn: propTypes.exports.PropTypes.bool
24882
24883
  };
24883
- const LivenessController = (clientId, eventId, source2, inProduction, countryCodeAllowed, faceMatch, dataLiveness) => {
24884
+ const LivenessController = (clientId, eventId, source2, inProduction, countryCodeAllowed, faceMatch, dataLiveness, validateVpn) => {
24884
24885
  const [isLoading, setIsLoading] = useState(false);
24885
24886
  const [token2, setToken] = useState("");
24886
24887
  const [status, setStatus] = useState(clientId === void 0 ? "CLIENTID" : token2 === void 0 ? "TOKEN" : "");
24887
24888
  const [message, setMessage] = useState("");
24888
24889
  const [countryCode, setCountryCode] = useState(null);
24889
- const geolocation = useGeolocation();
24890
+ const geolocation = useGeolocation(inProduction);
24890
24891
  const [data2, setData] = useState({});
24891
24892
  const [similarity, setSimilarity] = useState(0);
24892
24893
  const listener = (event) => {
24893
24894
  if (event.detail) {
24894
- if (event.detail.action === "PROCESS_FINISHED") {
24895
- const {
24896
- data: data22
24897
- } = event.detail;
24898
- if (data22.reason) {
24899
- setStatus("NOT_VERIFY");
24900
- setMessage("Error de conexi\xF3n, contactar con soporte!");
24901
- } else {
24902
- const {
24903
- response
24904
- } = event.detail.data;
24905
- const {
24906
- code
24907
- } = response;
24908
- if (code === -1) {
24909
- setStatus("NOT_VERIFY");
24910
- setMessage("Error interno de aplicaci\xF3n, contactar con soporte!");
24911
- }
24912
- setData(response);
24913
- }
24895
+ if (event.detail.action === "PROCESS_FINISHED" && event.detail.data.response.code != -1) {
24896
+ setData(event.detail.data.response);
24914
24897
  }
24915
24898
  }
24916
24899
  };
@@ -24920,13 +24903,17 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
24920
24903
  }
24921
24904
  }, [data2]);
24922
24905
  useEffect(() => {
24923
- if (countryCodeAllowed && geolocation) {
24924
- if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.country_code))) {
24906
+ if (countryCodeAllowed && (geolocation == null ? void 0 : geolocation.data_connection.isocode)) {
24907
+ if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.data_connection.isocode))) {
24925
24908
  setStatus("COUNTRY_NOT_ALLOWED");
24926
24909
  setMessage("Pa\xEDs no autorizado");
24927
24910
  }
24928
24911
  }
24929
- countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
24912
+ if (validateVpn && (geolocation == null ? void 0 : geolocation.data_connection.proxy) == "yes") {
24913
+ setStatus("USE_VPN");
24914
+ setMessage("Uso de Proxy o VPN no permitido");
24915
+ }
24916
+ countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.data_connection.isocode);
24930
24917
  }, [geolocation, countryCodeAllowed]);
24931
24918
  const clearState = () => {
24932
24919
  setStatus("");
@@ -24944,10 +24931,10 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
24944
24931
  eventId,
24945
24932
  source: source2,
24946
24933
  inProduction,
24947
- clientId
24934
+ clientId,
24935
+ geolocation
24948
24936
  }).then((res) => dataLiveness(res));
24949
24937
  } catch (errorSavingData) {
24950
- console.log(errorSavingData);
24951
24938
  return errorSavingData;
24952
24939
  }
24953
24940
  };
@@ -26148,7 +26135,8 @@ function LivenessCheck({
26148
26135
  inProduction,
26149
26136
  countryCodeAllowed,
26150
26137
  faceMatch,
26151
- dataLiveness
26138
+ dataLiveness,
26139
+ validateVpn
26152
26140
  }) {
26153
26141
  const {
26154
26142
  status,
@@ -26158,7 +26146,7 @@ function LivenessCheck({
26158
26146
  message,
26159
26147
  countryCode,
26160
26148
  setToken
26161
- } = LivenessController(clientId, eventId, source2, inProduction, countryCodeAllowed, faceMatch, dataLiveness);
26149
+ } = LivenessController(clientId, eventId, source2, inProduction, countryCodeAllowed, faceMatch, dataLiveness, validateVpn);
26162
26150
  useEffect(() => {
26163
26151
  const component = document.getElementsByTagName("face-liveness")[0];
26164
26152
  if (component) {
@@ -26189,8 +26177,14 @@ function LivenessCheck({
26189
26177
  children: "Verificaci\xF3n liveness"
26190
26178
  }), /* @__PURE__ */ jsx(StatusComponent, {
26191
26179
  status,
26192
- message,
26193
- clearState
26180
+ message
26181
+ }), status !== "COUNTRY_NOT_ALLOWED" && status !== "TOKEN" && status !== "CLIENTID" && status !== "USE_VPN" && /* @__PURE__ */ jsx(Box$1, {
26182
+ width: "100%",
26183
+ children: /* @__PURE__ */ jsx(CustomButton, {
26184
+ type: "warning",
26185
+ onClick: () => clearState(),
26186
+ children: "Volver"
26187
+ })
26194
26188
  })]
26195
26189
  }) : /* @__PURE__ */ jsx("face-liveness", {
26196
26190
  locale: "es",
@@ -26206,7 +26200,8 @@ LivenessCheck.defaultProps = {
26206
26200
  countryCodeAllowed: null,
26207
26201
  eventId: null,
26208
26202
  source: "component",
26209
- faceMatch: null
26203
+ faceMatch: null,
26204
+ validateVpn: false
26210
26205
  };
26211
26206
  LivenessCheck.propTypes = {
26212
26207
  mode: propTypes.exports.PropTypes.string,
@@ -26217,7 +26212,8 @@ LivenessCheck.propTypes = {
26217
26212
  eventId: propTypes.exports.PropTypes.string,
26218
26213
  source: propTypes.exports.PropTypes.string,
26219
26214
  faceMatch: propTypes.exports.PropTypes.string,
26220
- dataLiveness: propTypes.exports.PropTypes.func.isRequired
26215
+ dataLiveness: propTypes.exports.PropTypes.func.isRequired,
26216
+ validateVpn: propTypes.exports.PropTypes.bool
26221
26217
  };
26222
26218
  var bootstrap_min = "";
26223
26219
  var bootstrap_bundle_min = { exports: {} };