@tap-payments/auth-jsconnect 2.11.0-sandbox → 2.11.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.
Files changed (126) hide show
  1. package/build/@types/form.d.ts +4 -2
  2. package/build/@types/terminal.d.ts +32 -44
  3. package/build/api/account.d.ts +2 -2
  4. package/build/api/account.js +7 -4
  5. package/build/api/auth.d.ts +8 -2
  6. package/build/api/auth.js +7 -3
  7. package/build/api/axios.d.ts +1 -1
  8. package/build/api/entity.d.ts +3 -0
  9. package/build/api/headers.d.ts +5 -0
  10. package/build/api/headers.js +3 -0
  11. package/build/api/index.d.ts +6 -6
  12. package/build/api/lead.d.ts +1 -0
  13. package/build/api/operator.d.ts +1 -1
  14. package/build/api/operator.js +5 -2
  15. package/build/api/terminal.d.ts +3 -6
  16. package/build/api/terminal.js +22 -12
  17. package/build/assets/currencies/AEDSymbol.js +1 -1
  18. package/build/assets/currencies/SARSymbol.js +1 -1
  19. package/build/assets/locales/ar.json +10 -6
  20. package/build/assets/locales/en.json +13 -8
  21. package/build/components/DeviceCard/DeviceCard.d.ts +3 -2
  22. package/build/components/DeviceCard/DeviceCard.js +9 -10
  23. package/build/components/TruncatedTooltipText/TruncatedTooltipText.d.ts +7 -0
  24. package/build/components/TruncatedTooltipText/TruncatedTooltipText.js +33 -0
  25. package/build/components/TruncatedTooltipText/index.d.ts +2 -0
  26. package/build/components/TruncatedTooltipText/index.js +2 -0
  27. package/build/constants/api.d.ts +2 -0
  28. package/build/constants/api.js +4 -0
  29. package/build/constants/app.d.ts +12 -2
  30. package/build/constants/app.js +142 -41
  31. package/build/constants/flows.d.ts +2 -1
  32. package/build/constants/flows.js +2 -1
  33. package/build/constants/validation.d.ts +1 -0
  34. package/build/constants/validation.js +1 -0
  35. package/build/features/app/auth/authStore.js +64 -54
  36. package/build/features/app/bank/bankStore.js +24 -20
  37. package/build/features/app/board/boardStore.js +11 -7
  38. package/build/features/app/brand/brandStore.js +22 -18
  39. package/build/features/app/business/businessStore.js +45 -36
  40. package/build/features/app/connect/connectStore.d.ts +6 -5
  41. package/build/features/app/connect/connectStore.js +48 -31
  42. package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -5
  43. package/build/features/app/connectExpress/connectExpressStore.js +61 -20
  44. package/build/features/app/entity/entityStore.js +21 -17
  45. package/build/features/app/individual/individualStore.js +34 -28
  46. package/build/features/app/password/passwordStore.js +44 -46
  47. package/build/features/app/signIn/signInStore.js +12 -16
  48. package/build/features/app/tax/taxStore.js +20 -16
  49. package/build/features/app/terminal/terminalStore.d.ts +8 -7
  50. package/build/features/app/terminal/terminalStore.js +93 -63
  51. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +10 -7
  52. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
  53. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +6 -4
  54. package/build/features/auth/screens/AuthenticationList/EntityList.js +11 -3
  55. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
  56. package/build/features/business/screens/BusinessType/BusinessType.js +15 -5
  57. package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
  58. package/build/features/business/screens/BusinessType/LicenseList.js +20 -12
  59. package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
  60. package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
  61. package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
  62. package/build/features/business/screens/BusinessType/validation.js +31 -10
  63. package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
  64. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +10 -10
  65. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
  66. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +6 -4
  67. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +11 -3
  68. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
  69. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +27 -16
  70. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  71. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
  72. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
  73. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
  74. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
  75. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
  76. package/build/features/connectExpress/screens/Mobile/Mobile.js +7 -6
  77. package/build/features/entity/screens/EntityName/EntityName.js +16 -15
  78. package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
  79. package/build/features/entity/screens/EntityName/validation.d.ts +50 -48
  80. package/build/features/entity/screens/EntityName/validation.js +100 -85
  81. package/build/features/featuresScreens.js +63 -3
  82. package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
  83. package/build/features/shared/Button/FlowsButtons.js +1 -1
  84. package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.js +9 -0
  85. package/build/features/shared/OTPVerifySecurityError/index.d.ts +2 -0
  86. package/build/features/shared/OTPVerifySecurityError/index.js +2 -0
  87. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -1
  88. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -2
  89. package/build/features/terminal/Terminal.js +2 -2
  90. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +8 -9
  91. package/build/features/terminal/screens/LinkNewTerminal/styles.js +2 -2
  92. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +5 -6
  93. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +15 -10
  94. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +59 -12
  95. package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.d.ts +3 -0
  96. package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.js +50 -0
  97. package/build/features/terminal/screens/POSDeviceListPage/index.d.ts +2 -0
  98. package/build/features/terminal/screens/POSDeviceListPage/index.js +2 -0
  99. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -5
  100. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +3 -3
  101. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +2 -2
  102. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +26 -17
  103. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +5 -7
  104. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +12 -11
  105. package/build/features/terminal/screens/Verify/Verify.js +6 -2
  106. package/build/features/terminal/screens/shared/POSDeviceList.d.ts +11 -0
  107. package/build/features/terminal/screens/shared/POSDeviceList.js +30 -0
  108. package/build/features/terminal/screens/shared/index.d.ts +2 -2
  109. package/build/features/terminal/screens/shared/index.js +2 -2
  110. package/build/features/terminal/screens/shared/styles.d.ts +1 -1
  111. package/build/features/terminal/screens/shared/styles.js +1 -1
  112. package/build/features/terminal/screens/shared/utils.d.ts +4 -4
  113. package/build/features/terminal/screens/shared/utils.js +9 -9
  114. package/build/utils/common.js +11 -4
  115. package/build/utils/error.d.ts +3 -0
  116. package/build/utils/error.js +9 -0
  117. package/build/utils/string.d.ts +2 -1
  118. package/build/utils/string.js +3 -2
  119. package/build/utils/validation.js +1 -1
  120. package/package.json +3 -3
  121. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +0 -42
  122. package/build/features/terminal/screens/TerminalListPage/index.d.ts +0 -2
  123. package/build/features/terminal/screens/TerminalListPage/index.js +0 -2
  124. package/build/features/terminal/screens/shared/TerminalList.d.ts +0 -11
  125. package/build/features/terminal/screens/shared/TerminalList.js +0 -25
  126. /package/build/features/{terminal/screens/TerminalListPage/TerminalListPage.d.ts → shared/OTPVerifySecurityError/OTPVerifySecurityError.d.ts} +0 -0
@@ -27,5 +27,8 @@ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledCom
27
27
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
28
28
  ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
29
29
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
30
- declare const Type: () => JSX.Element;
30
+ declare type TypeProps = {
31
+ show: boolean;
32
+ };
33
+ declare const Type: ({ show }: TypeProps) => JSX.Element;
31
34
  export default Type;
@@ -26,6 +26,7 @@ import Tooltip from '../../../../components/Tooltip';
26
26
  import Radio from '../../../../components/Radio';
27
27
  import { clearError, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
28
28
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
29
+ import Collapse from '../../../../components/Collapse';
29
30
  var LabelTextStyled = styled(Text)(function (_a) {
30
31
  var theme = _a.theme;
31
32
  return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
@@ -70,12 +71,13 @@ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
70
71
  display: 'inline-flex'
71
72
  });
72
73
  });
73
- var Type = function () {
74
+ var Type = function (_a) {
75
+ var show = _a.show;
74
76
  var t = useTranslation().t;
75
77
  var control = useFormContext().control;
76
78
  var error = useAppSelector(connectExpressSelector).error;
77
- var _a = React.useState(false), isCRHovered = _a[0], setIsCRHovered = _a[1];
78
- var _b = React.useState(false), isFLHovered = _b[0], setIsFLHovered = _b[1];
79
+ var _b = React.useState(false), isCRHovered = _b[0], setIsCRHovered = _b[1];
80
+ var _c = React.useState(false), isFLHovered = _c[0], setIsFLHovered = _c[1];
79
81
  var typeControl = useController({ control: control, name: 'licenseType' });
80
82
  var dispatch = useAppDispatch();
81
83
  var handleOnChange = function (_a) {
@@ -85,6 +87,6 @@ var Type = function () {
85
87
  typeControl.field.onChange(target.value);
86
88
  };
87
89
  var typeValue = typeControl.field.value;
88
- return (_jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })));
90
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })) })));
89
91
  };
90
92
  export default Type;
@@ -43,9 +43,12 @@ import SimpleList from '../../../../components/SimpleList';
43
43
  import Text from '../../../../components/Text';
44
44
  import ExpandIcon from '../../../../components/ExpandIcon';
45
45
  import Collapse from '../../../../components/Collapse';
46
+ import { LicenseType } from '../../../../@types';
46
47
  import Icon from '../../../../components/Icon';
47
48
  import { connectExpressSelector } from '../../../../features/app/connectExpress/connectExpressStore';
48
49
  import { ADD_ENTITY } from '../../../../constants';
50
+ import { isSA } from '../../../../utils';
51
+ import { settingsSelector } from '../../../../app/settings';
49
52
  var EntityContainer = styled(Box)(function () { return ({
50
53
  display: 'flex',
51
54
  alignItems: 'center'
@@ -70,13 +73,15 @@ var EntityList = function (_a) {
70
73
  var isAr = useLanguage().isAr;
71
74
  var _f = useFormContext(), control = _f.control, watch = _f.watch, setValue = _f.setValue, getValues = _f.getValues;
72
75
  var data = useAppSelector(connectExpressSelector).data;
76
+ var businessCountry = useAppSelector(settingsSelector).data.businessCountry;
73
77
  var brandInfo = watch('brandInfo');
74
78
  var entityList = ((_c = (_b = data.responseData) === null || _b === void 0 ? void 0 : _b.authenticationData) === null || _c === void 0 ? void 0 : _c.entityList) || [];
75
79
  var selectedEntityControl = useController({ control: control, name: 'entityInfo' });
80
+ var isSACountry = React.useMemo(function () { return isSA(businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.iso2); }, [businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.iso2]);
76
81
  React.useEffect(function () {
77
82
  if (entityList.length > 0) {
78
- var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; });
79
- var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false) || [];
83
+ var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; }) || [];
84
+ var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false);
80
85
  setList(list_1);
81
86
  if (filteredEntityList.length) {
82
87
  setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
@@ -120,8 +125,11 @@ var EntityList = function (_a) {
120
125
  };
121
126
  var onSelectItem = function (entity) {
122
127
  selectedEntityControl.field.onChange(entity);
123
- if (entity.id === ADD_ENTITY)
128
+ if (entity.id === ADD_ENTITY) {
129
+ if (!isSACountry)
130
+ setValue('licenseType', LicenseType.CR);
124
131
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
132
+ }
125
133
  else {
126
134
  setValue('licenseNumber', '');
127
135
  setValue('legalName', '');
@@ -78,6 +78,7 @@ var CollectBusinessInfo = function (_a) {
78
78
  var onSubmit = function (data) {
79
79
  var dataValues = {
80
80
  brandName: data.brandName,
81
+ unifiedNumber: data.unifiedNumber,
81
82
  selectedLicense: data.selectedLicense,
82
83
  licenseNumber: data.licenseNumber,
83
84
  termAndConditionChecked: data.termAndConditionChecked
@@ -28,9 +28,9 @@ import Box from '@mui/material/Box';
28
28
  import { styled } from '@mui/material/styles';
29
29
  import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
30
30
  import { BusinessType } from '../../../../@types';
31
- import { isKW, isOtherLicense, isOtherThanKWOrSA, isSA } from '../../../../utils';
31
+ import { isKW, isOtherLicense, isSA } from '../../../../utils';
32
32
  import { settingsSelector } from '../../../../app/settings';
33
- import { OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../../constants';
33
+ import { OTHER_CR_LICENSE } from '../../../../constants';
34
34
  import SimpleList from '../../../../components/SimpleList';
35
35
  import Text from '../../../../components/Text';
36
36
  import ExpandIcon from '../../../../components/ExpandIcon';
@@ -40,7 +40,7 @@ import InputSelect from '../../../shared/InputSelect';
40
40
  import CheckIcon from '../../../shared/CheckIcon';
41
41
  import { connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
42
42
  import LicenseNumber from './LicenseNumber';
43
- import LicenseType from './LicenseType';
43
+ import UnifiedNumber from './UnifiedNumber';
44
44
  var InputStyled = styled(InputSelect)(function (_a) {
45
45
  var theme = _a.theme;
46
46
  return ({
@@ -80,7 +80,6 @@ var LicenseList = function (_a) {
80
80
  setAnchorEl(null);
81
81
  (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
82
82
  };
83
- var isOtherThanKWOrSACountry = React.useMemo(function () { return isOtherThanKWOrSA(country_code); }, [country_code]);
84
83
  var isKWCountry = React.useMemo(function () { return isKW(country_code); }, [country_code]);
85
84
  var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
86
85
  React.useEffect(function () {
@@ -96,16 +95,15 @@ var LicenseList = function (_a) {
96
95
  }
97
96
  }, [licenseList, selectedLicense]);
98
97
  React.useEffect(function () {
99
- if (!!country_code) {
100
- if (isKWCountry) {
101
- var license = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR ? OTHER_CR_LICENSE : OTHER_FL_LICENSE;
102
- setValue('selectedLicense', license, { shouldValidate: true });
103
- }
98
+ if (!!country_code && !isSACountry) {
99
+ setValue('selectedLicense', OTHER_CR_LICENSE, { shouldValidate: true });
104
100
  }
105
101
  }, [country_code]);
106
102
  var getLicenseNumber = function (item) {
107
- var _a;
108
- return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) || '';
103
+ var _a, _b, _c;
104
+ if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.CR && isSACountry)
105
+ return ((_b = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) || '';
106
+ return ((_c = item === null || item === void 0 ? void 0 : item.license) === null || _c === void 0 ? void 0 : _c.number) || '';
109
107
  };
110
108
  var getLicenseName = function (item) {
111
109
  var _a, _b;
@@ -114,13 +112,18 @@ var LicenseList = function (_a) {
114
112
  return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
115
113
  };
116
114
  var onSelectItem = function (license) {
115
+ var _a, _b, _c;
117
116
  if (error)
118
117
  dispatch(clearError());
119
118
  selectedLicenseControl.field.onChange(license);
120
- if (isOtherLicense(license))
119
+ if (isOtherLicense(license)) {
121
120
  setValue('licenseNumber', '', { shouldValidate: true });
122
- else
123
- setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
121
+ setValue('unifiedNumber', '', { shouldValidate: true });
122
+ }
123
+ else {
124
+ setValue('licenseNumber', ((_a = license === null || license === void 0 ? void 0 : license.license) === null || _a === void 0 ? void 0 : _a.number) || '', { shouldValidate: true });
125
+ setValue('unifiedNumber', ((_c = (_b = license === null || license === void 0 ? void 0 : license.license) === null || _b === void 0 ? void 0 : _b.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number) || '', { shouldValidate: true });
126
+ }
124
127
  onCloseLicenseList();
125
128
  };
126
129
  var getLicenseFullName = function (item) {
@@ -128,13 +131,21 @@ var LicenseList = function (_a) {
128
131
  return _jsx("span", { children: "".concat(getLicenseName(item), " - ").concat(getLicenseNumber(item)) });
129
132
  return _jsx("span", { children: "".concat(getLicenseNumber(item), " - ").concat(getLicenseName(item)) });
130
133
  };
134
+ var showLicenseNumber = function () {
135
+ if (isKWCountry)
136
+ return show && isCR;
137
+ if (isSACountry)
138
+ return show && isFL;
139
+ return show;
140
+ };
131
141
  var show = !anchorEl;
132
142
  var selected = selectedLicenseControl.field.value;
133
143
  var licenseReadonly = !isOtherLicense(selected);
134
144
  var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
145
+ var isFL = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.FL;
135
146
  var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
136
- return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry || isOtherThanKWOrSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
147
+ return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: (isCR ? t(getLicenseName(selected)) : flValue) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
137
148
  return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
138
- } }) }))] })), _jsx(LicenseType, { show: show && isKWCountry, readOnly: readOnly }), _jsx(LicenseNumber, { show: isKWCountry ? isCR : show, readOnly: licenseReadonly })] }));
149
+ } }) }))] })), _jsx(LicenseNumber, { show: showLicenseNumber(), readOnly: licenseReadonly }), _jsx(UnifiedNumber, { show: isSACountry && isCR && show, readOnly: licenseReadonly })] }));
139
150
  };
140
151
  export default React.memo(LicenseList);
@@ -42,12 +42,12 @@ var LicenseNumber = function (_a) {
42
42
  var clearLicenseNumber = function () {
43
43
  licenseNumberControl.field.onChange('');
44
44
  };
45
- var licenseNumberValue = licenseNumberControl.field.value;
45
+ var licenseNumberValue = licenseNumberControl.field.value || '';
46
46
  var error = (_b = licenseNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
47
47
  var length = isKWCountry || isOtherThanKWOrSACountry ? KW_MAX_LICENSE_LENGTH : isCR ? CR_NUMBER_MAX_LENGTH : FL_NUMBER_MAX_LENGTH;
48
48
  var minLength = isKWCountry || isOtherThanKWOrSACountry ? KW_MIN_LICENSE_LENGTH : isCR ? CR_MIN_LICENSE_LENGTH : FL_MIN_LICENSE_LENGTH;
49
49
  var label = isCR ? 'cr_number' : 'fl_number';
50
50
  var showCheckIcon = isKWCountry || isOtherThanKWOrSACountry ? (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) >= minLength : (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length;
51
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), required: isKWCountry, onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: showCheckIcon || (readOnly && licenseNumberValue) ? _jsx(CheckIcon, {}) : licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber }), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) }) })));
51
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t(label), required: isKWCountry, onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: showCheckIcon || (readOnly && licenseNumberValue) ? _jsx(CheckIcon, {}) : licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber }), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) })) })));
52
52
  };
53
53
  export default React.memo(LicenseNumber);
@@ -77,6 +77,6 @@ var TAC = function (_a) {
77
77
  return;
78
78
  tacControl.field.onChange(checked);
79
79
  };
80
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
80
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
81
81
  };
82
82
  export default React.memo(TAC);
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
3
+ children?: React.ReactNode;
4
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
5
+ color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
6
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
7
+ htmlColor?: string | undefined;
8
+ inheritViewBox?: boolean | undefined;
9
+ shapeRendering?: string | undefined;
10
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
11
+ titleAccess?: string | undefined;
12
+ viewBox?: string | undefined;
13
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
14
+ ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
15
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
16
+ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
17
+ children?: React.ReactNode;
18
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
19
+ color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
20
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
21
+ htmlColor?: string | undefined;
22
+ inheritViewBox?: boolean | undefined;
23
+ shapeRendering?: string | undefined;
24
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
25
+ titleAccess?: string | undefined;
26
+ viewBox?: string | undefined;
27
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
28
+ ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
29
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
30
+ interface UnifiedNumberProps {
31
+ show: boolean;
32
+ readOnly?: boolean;
33
+ isVerified?: boolean;
34
+ }
35
+ declare const _default: React.MemoExoticComponent<({ show, readOnly, isVerified }: UnifiedNumberProps) => JSX.Element>;
36
+ export default _default;
@@ -0,0 +1,81 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useController, useFormContext } from 'react-hook-form';
16
+ import { alpha, styled } from '@mui/material/styles';
17
+ import InfoIcon from '@mui/icons-material/Info';
18
+ import Box from '@mui/material/Box';
19
+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
20
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { removeAllCharsFromNumber } from '../../../../utils';
22
+ import Collapse from '../../../../components/Collapse';
23
+ import Tooltip from '../../../../components/Tooltip';
24
+ import Text from '../../../../components/Text';
25
+ import { ScreenContainer } from '../../../shared/Containers';
26
+ import Input from '../../../shared/Input';
27
+ import { clearError, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
28
+ import { EndAdornment } from '../../../shared/EndAdornment';
29
+ var LabelContainerStyled = styled(Box)(function (_a) {
30
+ var theme = _a.theme;
31
+ return ({
32
+ display: 'flex',
33
+ justifyContent: 'space-between',
34
+ padding: theme.spacing(0, 2.5, 1, 2.5)
35
+ });
36
+ });
37
+ var InputLabelStyled = styled(Text)(function (_a) {
38
+ var theme = _a.theme;
39
+ return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
40
+ });
41
+ export var InfoIconStyled = styled(InfoIcon)(function (_a) {
42
+ var theme = _a.theme;
43
+ return ({
44
+ width: theme.spacing(2.75),
45
+ height: theme.spacing(2.125),
46
+ cursor: 'pointer',
47
+ color: alpha(theme.palette.text.primary, 0.4),
48
+ display: 'inline-flex'
49
+ });
50
+ });
51
+ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
52
+ var theme = _a.theme;
53
+ return ({
54
+ width: theme.spacing(2.75),
55
+ height: theme.spacing(2.125),
56
+ cursor: 'pointer',
57
+ color: alpha(theme.palette.text.primary, 0.4),
58
+ display: 'inline-flex'
59
+ });
60
+ });
61
+ var UnifiedNumber = function (_a) {
62
+ var _b;
63
+ var show = _a.show, readOnly = _a.readOnly, isVerified = _a.isVerified;
64
+ var t = useTranslation().t;
65
+ var bckError = useAppSelector(connectExpressSelector).error;
66
+ var control = useFormContext().control;
67
+ var dispatch = useAppDispatch();
68
+ var _c = React.useState(false), hovered = _c[0], setHovered = _c[1];
69
+ var handleChange = function (_a) {
70
+ var target = _a.target;
71
+ if (bckError)
72
+ dispatch(clearError());
73
+ var value = removeAllCharsFromNumber(target.value);
74
+ unifiedNumberControl.field.onChange(value);
75
+ };
76
+ var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
77
+ var unifiedNumberValue = unifiedNumberControl.field.value || '';
78
+ var error = (_b = unifiedNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
79
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('v1_company_unified_number_label') }), _jsx(Tooltip, __assign({ title: t('v1_company_unified_number_description'), onMouseOver: function () { return setHovered(true); }, onMouseLeave: function () { return setHovered(false); }, onTouchStartCapture: function () { return setHovered(true); } }, { children: hovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { readOnly: readOnly, onChange: handleChange, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('v1_company_unified_number_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: unifiedNumberValue, isVerified: isVerified }) })] })) })));
80
+ };
81
+ export default React.memo(UnifiedNumber);
@@ -15,15 +15,18 @@ export declare const OtherThanKWOrSABusinessDataSchema: (isLeadIdPassed: boolean
15
15
  export declare const BusinessDataSchema: (isLeadIdPassed: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
16
16
  brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
17
17
  selectedLicense: any;
18
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
+ unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
19
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
19
20
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
20
21
  brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
21
22
  selectedLicense: any;
22
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
23
+ unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
24
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
23
25
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
24
26
  brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
25
27
  selectedLicense: any;
26
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
28
+ unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
29
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
27
30
  }>>>;
28
31
  export declare const KWBusinessDataSchema: (isLeadIdPassed: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
29
32
  brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
@@ -1,5 +1,5 @@
1
1
  import * as yup from 'yup';
2
- import { KW_MIN_LICENSE_LENGTH, FL_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH, BRAND_NAME_MAX_LENGTH } from '../../../../constants';
2
+ import { KW_MIN_LICENSE_LENGTH, FL_MIN_LICENSE_LENGTH, BRAND_NAME_MAX_LENGTH, UNIFIED_NUMBER_MIN_LENGTH } from '../../../../constants';
3
3
  import { BusinessType } from '../../../../@types';
4
4
  var objectElements = {
5
5
  legal_name: yup.object().shape({
@@ -7,7 +7,7 @@ var objectElements = {
7
7
  en: yup.string()
8
8
  }),
9
9
  license: yup.object().shape({
10
- number: yup.string()
10
+ number: yup.string().nullable()
11
11
  }),
12
12
  type: yup.string()
13
13
  };
@@ -94,22 +94,40 @@ export var BusinessDataSchema = function (isLeadIdPassed) {
94
94
  })
95
95
  .required('enter_brand_name_english_chars_numbers_space'),
96
96
  selectedLicense: yup.object().shape(objectElements).required(''),
97
- licenseNumber: yup
98
- .string()
99
- .test({
97
+ unifiedNumber: yup.string().test({
98
+ name: 'unifiedNumber',
99
+ message: '',
100
100
  test: function (value) {
101
+ var _a;
101
102
  var selectedLicense = this.parent.selectedLicense;
102
- var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
103
+ var isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
103
104
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
105
+ if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
106
+ return false;
107
+ if (isFL || length >= UNIFIED_NUMBER_MIN_LENGTH)
108
+ return true;
104
109
  if (length === 0)
110
+ return this.createError({ message: '' });
111
+ return this.createError({ message: 'unified_number_required' });
112
+ }
113
+ }),
114
+ licenseNumber: yup.string().test({
115
+ name: 'licenseNumber',
116
+ message: '',
117
+ test: function (value) {
118
+ var _a;
119
+ var selectedLicense = this.parent.selectedLicense;
120
+ var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
121
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
122
+ if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
123
+ return false;
124
+ if (isCR || length >= FL_MIN_LICENSE_LENGTH)
105
125
  return true;
106
- if (isCR) {
107
- return length >= CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
108
- }
109
- return length >= FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
126
+ if (length === 0)
127
+ return this.createError({ message: '' });
128
+ return this.createError({ message: 'fl_max_length' });
110
129
  }
111
- })
112
- .required(''),
130
+ }),
113
131
  termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond')
114
132
  });
115
133
  }
@@ -127,22 +145,40 @@ export var BusinessDataSchema = function (isLeadIdPassed) {
127
145
  })
128
146
  .required('enter_brand_name_english_chars_numbers_space'),
129
147
  selectedLicense: yup.object().shape(objectElements).required(''),
130
- licenseNumber: yup
131
- .string()
132
- .test({
148
+ unifiedNumber: yup.string().test({
149
+ name: 'unifiedNumber',
150
+ message: '',
133
151
  test: function (value) {
152
+ var _a;
134
153
  var selectedLicense = this.parent.selectedLicense;
135
- var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
154
+ var isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
136
155
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
156
+ if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
157
+ return false;
158
+ if (isFL || length >= UNIFIED_NUMBER_MIN_LENGTH)
159
+ return true;
137
160
  if (length === 0)
161
+ return this.createError({ message: '' });
162
+ return this.createError({ message: 'unified_number_required' });
163
+ }
164
+ }),
165
+ licenseNumber: yup.string().test({
166
+ name: 'licenseNumber',
167
+ message: '',
168
+ test: function (value) {
169
+ var _a;
170
+ var selectedLicense = this.parent.selectedLicense;
171
+ var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
172
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
173
+ if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
174
+ return false;
175
+ if (isCR || length >= FL_MIN_LICENSE_LENGTH)
138
176
  return true;
139
- if (isCR) {
140
- return length >= CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
141
- }
142
- return length >= FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
177
+ if (length === 0)
178
+ return this.createError({ message: '' });
179
+ return this.createError({ message: 'fl_max_length' });
143
180
  }
144
181
  })
145
- .required('')
146
182
  });
147
183
  };
148
184
  export var KWBusinessDataSchema = function (isLeadIdPassed) {
@@ -69,16 +69,16 @@ var OrBoxStyled = styled(Box)(function (_a) {
69
69
  });
70
70
  });
71
71
  var Mobile = function (_a) {
72
- var _b, _c;
72
+ var _b, _c, _d;
73
73
  var settingData = useAppSelector(settingsSelector).data;
74
- var _d = useAppSelector(connectExpressSelector), data = _d.data, loading = _d.loading, error = _d.error;
75
- var _e = React.useState(false), anchor = _e[0], setAnchor = _e[1];
74
+ var _e = useAppSelector(connectExpressSelector), data = _e.data, loading = _e.loading, error = _e.error;
75
+ var _f = React.useState(false), anchor = _f[0], setAnchor = _f[1];
76
76
  var t = useTranslation().t;
77
77
  var isAr = useLanguage().isAr;
78
78
  var dispatch = useAppDispatch();
79
- var _f = useCountry(settingData.businessCountry.iso2), isKuwait = _f.isKuwait, isOther = _f.isOther;
79
+ var _g = useCountry((_b = settingData.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2), isKuwait = _g.isKuwait, isOther = _g.isOther;
80
80
  var responseData = data.responseData, isLeadIdPassed = data.isLeadIdPassed;
81
- var isLeadIdentityIdAvailable = (_c = (_b = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _b === void 0 ? void 0 : _b.identification) === null || _c === void 0 ? void 0 : _c.id;
81
+ var isLeadIdentityIdAvailable = (_d = (_c = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _c === void 0 ? void 0 : _c.identification) === null || _d === void 0 ? void 0 : _d.id;
82
82
  var methods = useForm({
83
83
  resolver: yupResolver(PhoneValidationSchema(isLeadIdPassed)),
84
84
  defaultValues: data.mobileData,
@@ -95,13 +95,14 @@ var Mobile = function (_a) {
95
95
  dispatch(createMobileAuthAsync(deepCopy(formData)));
96
96
  };
97
97
  var onBack = function () {
98
+ var _a;
98
99
  var screen = isKuwait ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP';
99
100
  var eventAction = isKuwait ? 'PACI Click' : 'Abser Click';
100
101
  sendCustomEventToGTM({
101
102
  event: 'Send Event',
102
103
  event_category: 'User Registration Flow',
103
104
  event_action: eventAction,
104
- event_label: settingData.businessCountry.iso2
105
+ event_label: (_a = settingData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2
105
106
  });
106
107
  dispatch(handlePrevScreenStep(screen));
107
108
  };